commit b03b6c8197648e7d3368971b5a0624c410cf05f1 Author: nawrhehe Date: Thu Oct 15 18:07:10 2026 +0200 premier push diff --git a/QualcommWireless.xcodeproj/project.pbxproj b/QualcommWireless.xcodeproj/project.pbxproj new file mode 100644 index 0000000..581e55e --- /dev/null +++ b/QualcommWireless.xcodeproj/project.pbxproj @@ -0,0 +1,348 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXFileReference section */ + AE7E20C7307F7D1E000AD02F /* QualcommWireless.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = QualcommWireless.kext; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + AE7E20CF307F7D1E000AD02F /* Exceptions for "QualcommWireless" folder in "QualcommWireless" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = AE7E20C6307F7D1E000AD02F /* QualcommWireless */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + AE7E20C9307F7D1E000AD02F /* QualcommWireless */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + AE7E20CF307F7D1E000AD02F /* Exceptions for "QualcommWireless" folder in "QualcommWireless" target */, + ); + path = QualcommWireless; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + AE7E20C4307F7D1E000AD02F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + AE7E20BD307F7D1E000AD02F = { + isa = PBXGroup; + children = ( + AE7E20C9307F7D1E000AD02F /* QualcommWireless */, + AE7E20C8307F7D1E000AD02F /* Products */, + ); + sourceTree = ""; + }; + AE7E20C8307F7D1E000AD02F /* Products */ = { + isa = PBXGroup; + children = ( + AE7E20C7307F7D1E000AD02F /* QualcommWireless.kext */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + AE7E20C2307F7D1E000AD02F /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + AE7E20C6307F7D1E000AD02F /* QualcommWireless */ = { + isa = PBXNativeTarget; + buildConfigurationList = AE7E20D0307F7D1E000AD02F /* Build configuration list for PBXNativeTarget "QualcommWireless" */; + buildPhases = ( + AE7E20C2307F7D1E000AD02F /* Headers */, + AE7E20C3307F7D1E000AD02F /* Sources */, + AE7E20C4307F7D1E000AD02F /* Frameworks */, + AE7E20C5307F7D1E000AD02F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + AE7E20C9307F7D1E000AD02F /* QualcommWireless */, + ); + name = QualcommWireless; + packageProductDependencies = ( + ); + productName = QualcommWireless; + productReference = AE7E20C7307F7D1E000AD02F /* QualcommWireless.kext */; + productType = "com.apple.product-type.kernel-extension"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + AE7E20BE307F7D1E000AD02F /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastUpgradeCheck = 1640; + TargetAttributes = { + AE7E20C6307F7D1E000AD02F = { + CreatedOnToolsVersion = 16.4; + }; + }; + }; + buildConfigurationList = AE7E20C1307F7D1E000AD02F /* Build configuration list for PBXProject "QualcommWireless" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = AE7E20BD307F7D1E000AD02F; + minimizedProjectReferenceProxies = 1; + preferredProjectObjectVersion = 77; + productRefGroup = AE7E20C8307F7D1E000AD02F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + AE7E20C6307F7D1E000AD02F /* QualcommWireless */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + AE7E20C5307F7D1E000AD02F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + AE7E20C3307F7D1E000AD02F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + AE7E20D1307F7D1E000AD02F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1.0.2; + GCC_PREPROCESSOR_DEFINITIONS = ( + "__IO80211_TARGET=150000", + "$(inherited)", + ); + GENERATE_INFOPLIST_FILE = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/QualcommWireless/include", + ); + INFOPLIST_FILE = QualcommWireless/Info.plist; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + MACOSX_DEPLOYMENT_TARGET = 15.5; + MARKETING_VERSION = 1.0.2; + MODULE_NAME = com.nawrhehe.QualcommWireless; + MODULE_VERSION = 1.0.1; + PRODUCT_BUNDLE_IDENTIFIER = com.nawrhehe.QualcommWireless; + PRODUCT_NAME = "$(TARGET_NAME)"; + RUN_CLANG_STATIC_ANALYZER = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + WRAPPER_EXTENSION = kext; + }; + name = Debug; + }; + AE7E20D2307F7D1E000AD02F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1.0.2; + GCC_PREPROCESSOR_DEFINITIONS = ( + "__IO80211_TARGET=150000", + "$(inherited)", + ); + GENERATE_INFOPLIST_FILE = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/QualcommWireless/include", + ); + INFOPLIST_FILE = QualcommWireless/Info.plist; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + MACOSX_DEPLOYMENT_TARGET = 15.5; + MARKETING_VERSION = 1.0.2; + MODULE_NAME = com.nawrhehe.QualcommWireless; + MODULE_VERSION = 1.0.1; + PRODUCT_BUNDLE_IDENTIFIER = com.nawrhehe.QualcommWireless; + PRODUCT_NAME = "$(TARGET_NAME)"; + RUN_CLANG_STATIC_ANALYZER = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + WRAPPER_EXTENSION = kext; + }; + name = Release; + }; + AE7E20D3307F7D1E000AD02F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 15.5; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + AE7E20D4307F7D1E000AD02F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 15.5; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + AE7E20C1307F7D1E000AD02F /* Build configuration list for PBXProject "QualcommWireless" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AE7E20D3307F7D1E000AD02F /* Debug */, + AE7E20D4307F7D1E000AD02F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + AE7E20D0307F7D1E000AD02F /* Build configuration list for PBXNativeTarget "QualcommWireless" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AE7E20D1307F7D1E000AD02F /* Debug */, + AE7E20D2307F7D1E000AD02F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = AE7E20BE307F7D1E000AD02F /* Project object */; +} diff --git a/QualcommWireless.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/QualcommWireless.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/QualcommWireless.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/QualcommWireless/Firmware_WCN7850.h b/QualcommWireless/Firmware_WCN7850.h new file mode 100644 index 0000000..ce94bff --- /dev/null +++ b/QualcommWireless/Firmware_WCN7850.h @@ -0,0 +1,21653 @@ +unsigned char rampatch_usb_00190200_bin[] = { + 0x01, 0xa0, 0xd1, 0x03, 0x80, 0xd1, 0x03, 0x00, 0x5c, 0xd1, 0x03, 0x00, + 0x01, 0x00, 0x03, 0x00, 0x19, 0x00, 0x00, 0x02, 0x67, 0x85, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x02, 0x00, 0xf8, 0xb5, 0xca, 0x4d, 0xc8, 0x4c, 0x00, 0x20, + 0xad, 0xf8, 0x02, 0x00, 0x20, 0x46, 0x29, 0x46, 0x00, 0xf0, 0xac, 0xf9, + 0xc8, 0x49, 0xc6, 0x48, 0xc6, 0x4a, 0x0b, 0x46, 0x00, 0xf0, 0xac, 0xf9, + 0x3c, 0xf0, 0x0a, 0xfd, 0xc5, 0x48, 0xc6, 0x49, 0xc6, 0x4f, 0xc8, 0x4e, + 0x41, 0x61, 0xc6, 0x48, 0x3b, 0x68, 0x00, 0xf1, 0x0e, 0x01, 0x00, 0xf1, + 0x10, 0x02, 0x30, 0x46, 0x98, 0x47, 0xc4, 0x48, 0x3b, 0x68, 0x0d, 0xf1, + 0x02, 0x01, 0x82, 0x1c, 0x30, 0x46, 0x98, 0x47, 0xc2, 0x49, 0xc3, 0x4a, + 0x60, 0x19, 0xc0, 0x4c, 0x03, 0x30, 0x11, 0x44, 0xc1, 0x4a, 0x20, 0xf0, + 0x03, 0x00, 0x11, 0x44, 0xc4, 0xe9, 0x01, 0x10, 0x31, 0xf0, 0x52, 0xfd, + 0x01, 0xf0, 0x9c, 0xfc, 0x00, 0xf0, 0x8c, 0xff, 0x01, 0xf0, 0x02, 0xfc, + 0x03, 0xf0, 0x7e, 0xf8, 0x03, 0xf0, 0x3c, 0xfb, 0x03, 0xf0, 0xf2, 0xfd, + 0x05, 0xf0, 0x08, 0xf9, 0x03, 0xf0, 0x40, 0xfd, 0x04, 0xf0, 0xb8, 0xfa, + 0x04, 0xf0, 0x00, 0xfb, 0x04, 0xf0, 0x5c, 0xfb, 0x04, 0xf0, 0xc0, 0xf9, + 0x03, 0xf0, 0xd6, 0xfc, 0x05, 0xf0, 0xa6, 0xf8, 0x33, 0xf0, 0xd0, 0xf8, + 0x32, 0xf0, 0x9e, 0xfc, 0x07, 0xf0, 0x62, 0xfa, 0x07, 0xf0, 0xbe, 0xfb, + 0x3a, 0xf0, 0x98, 0xfc, 0x3c, 0xf0, 0x3e, 0xfe, 0x3b, 0xf0, 0x4a, 0xfa, + 0x24, 0xf0, 0xf4, 0xfe, 0x13, 0xf0, 0x52, 0xfd, 0x08, 0xf0, 0x50, 0xfb, + 0x08, 0xf0, 0xb4, 0xfc, 0x08, 0xf0, 0xde, 0xfc, 0x33, 0xf0, 0x40, 0xfb, + 0x06, 0xf0, 0x56, 0xff, 0x06, 0xf0, 0xa8, 0xfd, 0x07, 0xf0, 0x18, 0xf8, + 0x07, 0xf0, 0x7c, 0xf9, 0x08, 0xf0, 0xb0, 0xf8, 0x07, 0xf0, 0x4a, 0xfd, + 0x08, 0xf0, 0x30, 0xf8, 0x3c, 0xf0, 0x34, 0xfc, 0x39, 0xf0, 0xd2, 0xfe, + 0x33, 0xf0, 0xb4, 0xfb, 0x3c, 0xf0, 0x54, 0xfa, 0x3c, 0xf0, 0xf8, 0xf8, + 0x3c, 0xf0, 0x4a, 0xfb, 0x32, 0xf0, 0x66, 0xf9, 0x32, 0xf0, 0x38, 0xff, + 0x0b, 0xf0, 0x82, 0xfd, 0x0c, 0xf0, 0xfa, 0xf8, 0x0f, 0xf0, 0xfe, 0xfe, + 0x10, 0xf0, 0xa2, 0xfa, 0x10, 0xf0, 0x34, 0xfb, 0x10, 0xf0, 0x54, 0xfb, + 0x10, 0xf0, 0x88, 0xfb, 0x32, 0xf0, 0x8e, 0xfc, 0x08, 0xf0, 0xc0, 0xfc, + 0x08, 0xf0, 0xde, 0xfc, 0x23, 0xf0, 0x50, 0xfc, 0x23, 0xf0, 0xa0, 0xfd, + 0x23, 0xf0, 0x4e, 0xfe, 0x11, 0xf0, 0x06, 0xf9, 0x24, 0xf0, 0x6e, 0xfc, + 0x25, 0xf0, 0xe2, 0xf8, 0x25, 0xf0, 0x4e, 0xfa, 0x25, 0xf0, 0x36, 0xfb, + 0x25, 0xf0, 0x88, 0xfb, 0x25, 0xf0, 0x14, 0xff, 0x26, 0xf0, 0x56, 0xf8, + 0x26, 0xf0, 0x1c, 0xfa, 0x26, 0xf0, 0xa6, 0xfb, 0x26, 0xf0, 0xf2, 0xfc, + 0x26, 0xf0, 0x9e, 0xfd, 0x26, 0xf0, 0xc2, 0xfd, 0x26, 0xf0, 0xe4, 0xff, + 0x27, 0xf0, 0xec, 0xf8, 0x27, 0xf0, 0x9a, 0xf9, 0x27, 0xf0, 0x5c, 0xfa, + 0x27, 0xf0, 0xa8, 0xfa, 0x27, 0xf0, 0x54, 0xff, 0x1c, 0xf0, 0x48, 0xfa, + 0x28, 0xf0, 0x18, 0xfe, 0x28, 0xf0, 0x20, 0xff, 0x28, 0xf0, 0xc0, 0xff, + 0x2a, 0xf0, 0xec, 0xfa, 0x29, 0xf0, 0xb2, 0xfd, 0x29, 0xf0, 0x4a, 0xff, + 0x2a, 0xf0, 0x7c, 0xfc, 0x2a, 0xf0, 0x40, 0xf8, 0x2a, 0xf0, 0x50, 0xf9, + 0x29, 0xf0, 0x4e, 0xfa, 0x14, 0xf0, 0xd0, 0xff, 0x2f, 0xf0, 0x4e, 0xfb, + 0x2a, 0xf0, 0x70, 0xfc, 0x2a, 0xf0, 0x16, 0xfd, 0x2a, 0xf0, 0xee, 0xfd, + 0x2a, 0xf0, 0x06, 0xfe, 0x2a, 0xf0, 0x98, 0xfe, 0x2b, 0xf0, 0xe6, 0xff, + 0x0c, 0xf0, 0x1e, 0xfa, 0x0d, 0xf0, 0xc8, 0xf8, 0x0e, 0xf0, 0x5e, 0xfb, + 0x0d, 0xf0, 0x96, 0xfa, 0x0e, 0xf0, 0x3e, 0xfd, 0x0e, 0xf0, 0x88, 0xfe, + 0x10, 0xf0, 0x22, 0xfd, 0x11, 0xf0, 0x46, 0xf9, 0x15, 0xf0, 0x54, 0xfa, + 0x16, 0xf0, 0xd2, 0xfc, 0x17, 0xf0, 0x8c, 0xfc, 0x17, 0xf0, 0x9e, 0xff, + 0x19, 0xf0, 0xe2, 0xfd, 0x1a, 0xf0, 0x32, 0xfc, 0x1a, 0xf0, 0x20, 0xfe, + 0x1b, 0xf0, 0x16, 0xf8, 0x1b, 0xf0, 0xba, 0xfb, 0x1b, 0xf0, 0xd8, 0xfb, + 0x1c, 0xf0, 0x18, 0xf9, 0x1b, 0xf0, 0x0e, 0xfa, 0x1c, 0xf0, 0x6a, 0xf9, + 0x12, 0xf0, 0xea, 0xfb, 0x13, 0xf0, 0xaa, 0xf8, 0x11, 0xf0, 0x52, 0xff, + 0x13, 0xf0, 0x36, 0xfb, 0x1c, 0xf0, 0x22, 0xfd, 0x1c, 0xf0, 0xba, 0xfa, + 0x1e, 0xf0, 0xf2, 0xfd, 0x1f, 0xf0, 0x9a, 0xfb, 0x20, 0xf0, 0x28, 0xfb, + 0x2f, 0xf0, 0x0c, 0xfe, 0x21, 0xf0, 0xfa, 0xfa, 0x21, 0xf0, 0x2e, 0xff, + 0x22, 0xf0, 0x70, 0xf8, 0x22, 0xf0, 0x94, 0xf9, 0x22, 0xf0, 0x78, 0xfa, + 0x22, 0xf0, 0x5a, 0xff, 0x23, 0xf0, 0x38, 0xf9, 0x14, 0xf0, 0x38, 0xfe, + 0x14, 0xf0, 0xde, 0xfe, 0x2d, 0xf0, 0xda, 0xfb, 0x2d, 0xf0, 0x78, 0xfc, + 0x2d, 0xf0, 0x3c, 0xfa, 0x2f, 0xf0, 0xfe, 0xf8, 0x2f, 0xf0, 0x4a, 0xfa, + 0x2f, 0xf0, 0x62, 0xfb, 0x2f, 0xf0, 0xee, 0xfb, 0x2f, 0xf0, 0x28, 0xfc, + 0x3c, 0xf0, 0x98, 0xfd, 0x30, 0xf0, 0x96, 0xfe, 0x30, 0xf0, 0x1e, 0xff, + 0x2c, 0xf0, 0x6c, 0xf8, 0x30, 0xf0, 0xf4, 0xff, 0x31, 0xf0, 0x66, 0xf8, + 0x2f, 0xf0, 0x5e, 0xff, 0x31, 0xf0, 0x36, 0xfa, 0x2e, 0xf0, 0x78, 0xf9, + 0x2e, 0xf0, 0x7c, 0xf8, 0x2d, 0xf0, 0x10, 0xff, 0x2e, 0xf0, 0x50, 0xff, + 0x2d, 0xf0, 0x96, 0xfc, 0x2e, 0xf0, 0xb6, 0xf8, 0x2e, 0xf0, 0xd8, 0xf9, + 0x2e, 0xf0, 0x10, 0xff, 0x2e, 0xf0, 0xfa, 0xff, 0x2f, 0xf0, 0x28, 0xf8, + 0x2f, 0xf0, 0x6a, 0xf8, 0x31, 0xf0, 0xb4, 0xfc, 0x31, 0xf0, 0xc4, 0xfe, + 0x0e, 0xf0, 0xf2, 0xfe, 0x33, 0xf0, 0xb0, 0xf9, 0x1a, 0x48, 0x90, 0xf8, + 0x2e, 0x01, 0x80, 0x07, 0x10, 0xd4, 0x21, 0x68, 0x18, 0x48, 0x09, 0xb9, + 0x62, 0x68, 0x3a, 0xb1, 0x81, 0x65, 0x61, 0x68, 0x41, 0x66, 0x01, 0x68, + 0x41, 0xf0, 0x02, 0x01, 0x01, 0x60, 0xf8, 0xbd, 0x01, 0x68, 0x21, 0xf0, + 0x02, 0x01, 0x01, 0x60, 0xf8, 0xbd, 0x00, 0xbf, 0x60, 0xd4, 0x05, 0x00, + 0x1f, 0x58, 0x00, 0x00, 0x6c, 0xd1, 0x05, 0x00, 0x74, 0xce, 0x05, 0x00, + 0xf2, 0x02, 0x00, 0x00, 0xe0, 0xfe, 0x00, 0x00, 0xb4, 0x03, 0x02, 0x00, + 0xb4, 0xec, 0x08, 0x00, 0xe0, 0xf1, 0x01, 0x00, 0x8c, 0xca, 0x05, 0x00, + 0x48, 0x8d, 0x01, 0x00, 0xec, 0xf5, 0x01, 0x00, 0x84, 0x03, 0x00, 0x00, + 0x10, 0x00, 0x02, 0x00, 0xe0, 0xca, 0x03, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0xc8, 0x11, 0x00, 0x40, 0x4b, 0xf2, 0xc7, 0x4c, 0xc1, 0xf2, 0x12, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4c, 0xf6, 0x4d, 0x5c, 0xc1, 0xf2, 0x11, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4d, 0x61, 0x79, 0x20, 0x32, 0x37, 0x20, 0x32, + 0x30, 0x32, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x30, 0x3a, 0x31, + 0x36, 0x3a, 0x31, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x42, 0x54, 0x46, 0x57, 0x2e, 0x48, 0x41, 0x4d, 0x49, 0x4c, 0x54, 0x4f, + 0x4e, 0x2e, 0x32, 0x2e, 0x30, 0x2e, 0x30, 0x2d, 0x30, 0x30, 0x37, 0x39, + 0x39, 0x2d, 0x55, 0x53, 0x42, 0x5f, 0x50, 0x41, 0x54, 0x43, 0x48, 0x5a, + 0x2d, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xb0, 0xb5, 0x16, 0x4c, 0x64, 0x7f, 0x2b, 0x2c, + 0x01, 0xd1, 0x2b, 0x21, 0x0a, 0xe0, 0xa1, 0xf1, 0x2b, 0x04, 0x0b, 0x2c, + 0x1a, 0xd8, 0x01, 0x25, 0x05, 0xfa, 0x04, 0xf4, 0x40, 0xf6, 0x01, 0x65, + 0x2c, 0x42, 0x13, 0xd0, 0x0e, 0x4a, 0x12, 0x68, 0xa2, 0xb1, 0xfb, 0x4d, + 0x00, 0xeb, 0x40, 0x04, 0x55, 0xf8, 0x24, 0x40, 0xb4, 0xf8, 0x74, 0x51, + 0x94, 0xf8, 0x1d, 0x41, 0xc4, 0xeb, 0x04, 0x14, 0x02, 0xeb, 0x44, 0x12, + 0x92, 0xf8, 0xc1, 0x20, 0x45, 0xea, 0x02, 0x42, 0xbd, 0xe8, 0xb0, 0x40, + 0x00, 0xf0, 0xd4, 0xbd, 0x00, 0x20, 0x69, 0x21, 0x00, 0xf0, 0xd6, 0xfd, + 0xfc, 0x20, 0x01, 0x00, 0xe0, 0x35, 0x01, 0x00, 0x03, 0x28, 0x3c, 0xbf, + 0x01, 0x20, 0x70, 0x47, 0x04, 0x28, 0x04, 0xbf, 0x03, 0x20, 0x70, 0x47, + 0x03, 0x28, 0x14, 0xbf, 0x00, 0x20, 0x02, 0x20, 0x70, 0x47, 0x00, 0xbf, + 0x2d, 0xe9, 0xf8, 0x4f, 0x05, 0x46, 0xdc, 0x48, 0x93, 0x46, 0x8a, 0x46, + 0x00, 0x68, 0x80, 0x47, 0xa0, 0xb3, 0xda, 0x4c, 0x20, 0x7c, 0x60, 0xb3, + 0xda, 0x49, 0x91, 0xf8, 0x2c, 0x22, 0x02, 0xb9, 0x70, 0xb3, 0x4f, 0xf0, + 0x00, 0x09, 0xa8, 0x46, 0x80, 0x2d, 0x1b, 0xd1, 0x9a, 0xf8, 0x05, 0x00, + 0x4e, 0x28, 0x47, 0xd0, 0x0b, 0x28, 0x00, 0xf0, 0x9b, 0x80, 0x3a, 0x28, + 0x00, 0xf0, 0xa0, 0x80, 0x43, 0x28, 0x00, 0xf0, 0xab, 0x80, 0x4d, 0x28, + 0x00, 0xf0, 0xd0, 0x80, 0x01, 0x28, 0x40, 0xf0, 0x0c, 0x81, 0xd9, 0x48, + 0xd9, 0x49, 0x00, 0x78, 0x09, 0x78, 0x08, 0x44, 0xd8, 0x49, 0x09, 0x78, + 0x08, 0x44, 0x98, 0xe0, 0x40, 0x46, 0x51, 0x46, 0x5a, 0x46, 0x00, 0xf0, + 0x93, 0xfd, 0x07, 0x46, 0x1d, 0xe1, 0xc3, 0x49, 0x09, 0x68, 0xb1, 0xf1, + 0xff, 0x3f, 0xcd, 0xdd, 0x01, 0x27, 0x71, 0xe1, 0x01, 0xf5, 0x0b, 0x76, + 0xc1, 0x49, 0x05, 0x20, 0x4f, 0x1c, 0xc1, 0x49, 0x88, 0x46, 0x81, 0x46, + 0xbd, 0x48, 0x00, 0x88, 0x00, 0xeb, 0x80, 0x00, 0x02, 0x38, 0xb8, 0x47, + 0xb9, 0xf1, 0x1e, 0x0f, 0x24, 0xbf, 0x01, 0x20, 0x30, 0x70, 0x40, 0x46, + 0xd8, 0xf8, 0x00, 0x00, 0x40, 0x04, 0x00, 0xf1, 0xa8, 0x80, 0x30, 0x78, + 0x00, 0x28, 0xb6, 0xd1, 0x21, 0x7c, 0x09, 0xf1, 0x05, 0x00, 0x00, 0x29, + 0xe5, 0xd0, 0xb0, 0xe7, 0x9a, 0xf8, 0x07, 0x30, 0x16, 0x2b, 0x00, 0xf2, + 0xce, 0x80, 0xb2, 0x4a, 0x03, 0xeb, 0x43, 0x01, 0x52, 0xf8, 0x21, 0x00, + 0x00, 0x28, 0x00, 0xf0, 0xc6, 0x80, 0x03, 0xeb, 0x43, 0x03, 0x02, 0xeb, + 0x83, 0x03, 0x1b, 0x79, 0x5c, 0x1f, 0x01, 0x2c, 0x00, 0xf2, 0xbd, 0x80, + 0xaa, 0x4e, 0xb0, 0xf8, 0x28, 0x41, 0xb6, 0xf8, 0xb8, 0x61, 0x34, 0x44, + 0x90, 0xf8, 0x1d, 0x61, 0xaa, 0xf8, 0x0e, 0x40, 0xa6, 0x4c, 0xc6, 0xeb, + 0x06, 0x16, 0x24, 0x68, 0x04, 0xeb, 0x46, 0x14, 0xe6, 0x78, 0x81, 0x2e, + 0x11, 0xd3, 0x90, 0xf8, 0x46, 0x71, 0x90, 0xf8, 0x50, 0x61, 0x90, 0xf8, + 0x20, 0xc1, 0xb7, 0x42, 0x38, 0xbf, 0x37, 0x46, 0x94, 0xf8, 0xc0, 0x60, + 0xac, 0xeb, 0x07, 0x0c, 0x9c, 0xfb, 0xf6, 0xf6, 0x3e, 0x44, 0x8a, 0xf8, + 0x0b, 0x60, 0x9a, 0xf8, 0x0c, 0x60, 0x15, 0x2e, 0x40, 0xf0, 0x93, 0x80, + 0x97, 0x4f, 0x66, 0x78, 0x7f, 0x68, 0xc6, 0xeb, 0xc6, 0x06, 0x07, 0xeb, + 0x86, 0x06, 0x36, 0x7e, 0x00, 0x2e, 0x00, 0xf0, 0x88, 0x80, 0x02, 0xeb, + 0x81, 0x01, 0x09, 0x68, 0x00, 0x29, 0x00, 0xf0, 0x04, 0x81, 0x99, 0x1f, + 0xb1, 0xfa, 0x81, 0xf1, 0x49, 0x09, 0xff, 0xe0, 0x00, 0x20, 0xaa, 0xf8, + 0x0a, 0x00, 0x00, 0xf0, 0x13, 0xfd, 0xca, 0xf8, 0x0c, 0x00, 0x74, 0xe0, + 0x9a, 0xf8, 0x06, 0x00, 0x84, 0x49, 0x00, 0xeb, 0x40, 0x00, 0x51, 0xf8, + 0x20, 0x00, 0x00, 0x28, 0x6b, 0xd0, 0x90, 0xf8, 0x3a, 0x00, 0x8a, 0xf8, + 0x09, 0x00, 0x66, 0xe0, 0x84, 0x48, 0x00, 0x23, 0x01, 0x88, 0xaa, 0xf8, + 0x06, 0x10, 0x41, 0x88, 0x80, 0x88, 0xaa, 0xf8, 0x0a, 0x00, 0x81, 0x48, + 0xaa, 0xf8, 0x08, 0x10, 0x02, 0x88, 0x41, 0x88, 0x86, 0x88, 0xc4, 0x88, + 0x03, 0x60, 0x43, 0x60, 0xff, 0x20, 0xff, 0x2a, 0x28, 0xbf, 0x02, 0x46, + 0x8a, 0xf8, 0x0c, 0x20, 0xff, 0x29, 0x28, 0xbf, 0x01, 0x46, 0x8a, 0xf8, + 0x0d, 0x10, 0xff, 0x2e, 0x28, 0xbf, 0x06, 0x46, 0x8a, 0xf8, 0x0e, 0x60, + 0xff, 0x2c, 0x38, 0xbf, 0x20, 0x46, 0x8a, 0xf8, 0x0f, 0x00, 0x3e, 0xe0, + 0x9a, 0xf8, 0x07, 0x00, 0x10, 0xf0, 0x06, 0x0f, 0x0c, 0xd0, 0x6c, 0x49, + 0x9a, 0xf8, 0x06, 0x00, 0x09, 0x68, 0x88, 0x47, 0x0c, 0xe0, 0x01, 0x20, + 0x4f, 0xf4, 0x80, 0x41, 0x30, 0x70, 0x62, 0x48, 0x01, 0x60, 0x0a, 0xe7, + 0x66, 0x49, 0x9a, 0xf8, 0x06, 0x00, 0x0a, 0x68, 0x00, 0x21, 0x90, 0x47, + 0x06, 0x46, 0x00, 0x28, 0x00, 0xf0, 0xa3, 0x80, 0x5f, 0x48, 0x71, 0x78, + 0x40, 0x68, 0xc1, 0xeb, 0xc1, 0x01, 0x00, 0xeb, 0x81, 0x04, 0x60, 0x7b, + 0xff, 0xf7, 0xd6, 0xfe, 0x8a, 0xf8, 0x0d, 0x00, 0x20, 0x7e, 0x08, 0xb9, + 0x96, 0xf8, 0xc0, 0x00, 0x8a, 0xf8, 0x0c, 0x00, 0xf0, 0x78, 0x81, 0x28, + 0x0d, 0xd3, 0x9a, 0xf8, 0x07, 0x00, 0x40, 0xf0, 0x01, 0x00, 0x8a, 0xf8, + 0x07, 0x00, 0x00, 0xf0, 0xcf, 0x00, 0xf1, 0x78, 0x61, 0xf3, 0x05, 0x10, + 0x8a, 0xf8, 0x07, 0x00, 0xff, 0xe7, 0x56, 0x4c, 0x01, 0x21, 0x4f, 0xf4, + 0x8c, 0x62, 0x72, 0xb6, 0x20, 0x68, 0x40, 0x00, 0x01, 0x30, 0x20, 0x60, + 0x52, 0x48, 0x01, 0x60, 0x52, 0x48, 0x01, 0x68, 0x62, 0xf3, 0x0d, 0x01, + 0x01, 0x60, 0x3f, 0x48, 0x3f, 0x49, 0x00, 0x88, 0x01, 0x31, 0x02, 0x38, + 0x88, 0x47, 0x80, 0x20, 0x51, 0x46, 0x5a, 0x46, 0x00, 0xf0, 0x7a, 0xfc, + 0x07, 0x46, 0x20, 0x68, 0x40, 0x08, 0x20, 0x60, 0x20, 0x68, 0x80, 0xf3, + 0x10, 0x88, 0x48, 0x4c, 0xbb, 0xf1, 0x00, 0x0f, 0xd4, 0xf8, 0x38, 0x06, + 0x04, 0xf5, 0xc7, 0x66, 0x00, 0xeb, 0x80, 0x00, 0x04, 0xeb, 0x80, 0x00, + 0x80, 0xf8, 0xa8, 0x84, 0x07, 0xd0, 0x00, 0xf2, 0xac, 0x40, 0x10, 0x21, + 0x52, 0x46, 0x5b, 0x46, 0x00, 0xf0, 0x6a, 0xfc, 0x12, 0xe0, 0x3e, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x32, 0x68, 0x04, 0xf5, 0x95, 0x61, 0x02, 0xeb, + 0x82, 0x02, 0x01, 0xeb, 0x82, 0x02, 0x50, 0x60, 0x30, 0x68, 0x00, 0xeb, + 0x80, 0x00, 0x01, 0xeb, 0x80, 0x00, 0x94, 0xf8, 0x63, 0x11, 0x81, 0x60, + 0x30, 0x68, 0x01, 0x30, 0x13, 0x28, 0x88, 0xbf, 0x00, 0x20, 0x30, 0x60, + 0x04, 0xf2, 0x94, 0x46, 0xb9, 0xf1, 0x1e, 0x0f, 0x14, 0xd3, 0x30, 0x68, + 0x90, 0xb1, 0x2f, 0x48, 0x00, 0x22, 0x33, 0x46, 0x31, 0x58, 0x01, 0x31, + 0x31, 0x50, 0x2d, 0x48, 0x00, 0x21, 0x05, 0x68, 0x10, 0x20, 0x00, 0x90, + 0x40, 0xf2, 0x11, 0x40, 0xa8, 0x47, 0x2a, 0x48, 0x12, 0x21, 0x00, 0x78, + 0x00, 0xf0, 0x3c, 0xfc, 0x24, 0x48, 0x00, 0x68, 0x80, 0x47, 0x30, 0x60, + 0x86, 0xf8, 0x0c, 0x80, 0x84, 0xf8, 0xa1, 0xb4, 0xda, 0xf8, 0x00, 0x00, + 0x70, 0x60, 0x20, 0x48, 0x30, 0x58, 0xb0, 0x60, 0xda, 0xf8, 0x04, 0x00, + 0xa4, 0xf8, 0xa2, 0x04, 0x38, 0x46, 0xbd, 0xe8, 0xf8, 0x8f, 0x00, 0x27, + 0xfa, 0xe7, 0x00, 0x21, 0x22, 0x89, 0x00, 0xf0, 0x27, 0xfc, 0x78, 0xe7, + 0x48, 0xe5, 0x08, 0x00, 0x4c, 0x01, 0x01, 0x00, 0x30, 0x60, 0x00, 0x40, + 0x38, 0x21, 0x01, 0x00, 0x34, 0xec, 0x01, 0x00, 0x40, 0xec, 0x01, 0x00, + 0x1c, 0x50, 0x00, 0x40, 0x10, 0x50, 0x00, 0x40, 0xe8, 0x72, 0x01, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0xe0, 0x35, 0x01, 0x00, 0xec, 0xe5, 0x05, 0x00, + 0x10, 0xb6, 0x08, 0x00, 0xfc, 0x9b, 0x08, 0x00, 0x7a, 0x2e, 0x01, 0x00, + 0xf8, 0xda, 0x05, 0x00, 0x5c, 0x34, 0x01, 0x00, 0x53, 0x34, 0x01, 0x00, + 0xd4, 0x58, 0x01, 0x00, 0x24, 0x36, 0x01, 0x00, 0x58, 0x60, 0x00, 0x40, + 0x50, 0x60, 0x00, 0x40, 0x64, 0xd4, 0x05, 0x00, 0xa4, 0xe5, 0x08, 0x00, + 0xb8, 0xfe, 0xff, 0xff, 0xa0, 0xa0, 0x08, 0x00, 0x66, 0x34, 0x01, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x93, 0xb0, 0xdf, 0xf8, 0x60, 0x86, 0x00, 0x20, + 0xad, 0xf8, 0x48, 0x00, 0x31, 0x20, 0xd8, 0xf8, 0x00, 0x10, 0x88, 0x47, + 0xdf, 0xf8, 0x50, 0x06, 0x00, 0x68, 0x80, 0x47, 0x00, 0x28, 0x00, 0xf0, + 0x81, 0x80, 0xe3, 0x4e, 0xe3, 0x4c, 0x71, 0x68, 0x60, 0x68, 0x11, 0xb9, + 0x00, 0x28, 0x00, 0xf0, 0x95, 0x80, 0xdf, 0xf8, 0x3c, 0x06, 0xe5, 0x68, + 0x03, 0x21, 0x04, 0x22, 0x07, 0x68, 0xd6, 0xf8, 0x0c, 0xa0, 0x4f, 0xf4, + 0x80, 0x60, 0x53, 0x46, 0xb8, 0x47, 0xba, 0xf1, 0x00, 0x0f, 0x7e, 0xd0, + 0x2a, 0xf4, 0x80, 0x40, 0x25, 0x60, 0x30, 0x60, 0x5f, 0xea, 0xca, 0x70, + 0x05, 0xd0, 0xdf, 0xf8, 0x14, 0x06, 0x08, 0x21, 0x00, 0x78, 0x00, 0xf0, + 0xb3, 0xfb, 0xdf, 0xf8, 0x0c, 0x06, 0x40, 0x30, 0x0c, 0x90, 0x5f, 0xea, + 0x4a, 0x40, 0x0a, 0xd5, 0x4f, 0xf4, 0x80, 0x40, 0x30, 0x60, 0x01, 0x20, + 0x0c, 0x99, 0x81, 0xf8, 0xec, 0x01, 0xdf, 0xf8, 0xf4, 0x05, 0x00, 0x68, + 0x80, 0x47, 0x5f, 0xea, 0xca, 0x50, 0x0e, 0xd5, 0x0c, 0x98, 0xd0, 0xf8, + 0x70, 0x05, 0x50, 0xb9, 0x0c, 0x99, 0xd1, 0xf8, 0xbc, 0x01, 0x01, 0x30, + 0xc1, 0xf8, 0xbc, 0x01, 0xdf, 0xf8, 0xd4, 0x05, 0x01, 0x68, 0x01, 0x20, + 0x88, 0x47, 0x5f, 0xea, 0x0a, 0x70, 0x4a, 0xd5, 0x60, 0x68, 0x05, 0x40, + 0x00, 0xf0, 0x3f, 0x82, 0xdf, 0xf8, 0xb4, 0x05, 0x00, 0xf2, 0xb6, 0x54, + 0xe8, 0x03, 0x52, 0xd5, 0xff, 0x20, 0x0d, 0xaa, 0x01, 0x21, 0x00, 0x23, + 0x00, 0x27, 0x8d, 0xf8, 0x34, 0x00, 0xdf, 0xf8, 0xa8, 0x05, 0x06, 0x68, + 0x01, 0x20, 0xb0, 0x47, 0x0c, 0x98, 0xd0, 0xf8, 0x70, 0x05, 0x01, 0x28, + 0x11, 0xd1, 0xdf, 0xf8, 0x98, 0x05, 0x02, 0x21, 0x04, 0x22, 0x09, 0x23, + 0x06, 0x68, 0x40, 0xf2, 0x1a, 0x20, 0xcd, 0xe9, 0x00, 0x70, 0x40, 0xf2, + 0xe2, 0x40, 0xb0, 0x47, 0xdf, 0xf8, 0x74, 0x05, 0x01, 0x68, 0x03, 0x20, + 0x88, 0x47, 0xdf, 0xf8, 0x78, 0x05, 0x25, 0xf4, 0x80, 0x35, 0x01, 0x68, + 0x60, 0x78, 0x30, 0xb3, 0x00, 0x20, 0x25, 0xe0, 0xa4, 0x48, 0xa5, 0x49, + 0xa1, 0x4a, 0x07, 0x23, 0x00, 0x68, 0x09, 0x68, 0x11, 0x60, 0xa0, 0x4a, + 0x10, 0x60, 0xdf, 0xf8, 0x50, 0x05, 0x08, 0x22, 0x04, 0x68, 0x40, 0xf2, + 0xbb, 0x10, 0xcd, 0xe9, 0x00, 0x10, 0x40, 0xf2, 0xe2, 0x40, 0x02, 0x21, + 0xa0, 0x47, 0xd8, 0xf8, 0x00, 0x10, 0x32, 0x20, 0x88, 0x47, 0x13, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0xdf, 0xf8, 0x28, 0x05, 0x00, 0x21, 0x04, 0x22, + 0x08, 0x23, 0x04, 0x68, 0x40, 0xf2, 0xc5, 0x10, 0xe9, 0xe7, 0x01, 0x20, + 0x88, 0x47, 0x68, 0x07, 0x10, 0xd5, 0x20, 0x20, 0x8d, 0xf8, 0x34, 0x00, + 0xdf, 0xf8, 0x10, 0x05, 0x00, 0x68, 0x80, 0x47, 0xdf, 0xf8, 0xfc, 0x04, + 0x0d, 0xaa, 0x01, 0x21, 0x00, 0x23, 0x06, 0x68, 0x02, 0x20, 0xb0, 0x47, + 0x25, 0xf0, 0x04, 0x05, 0xa8, 0x06, 0x01, 0xd5, 0x85, 0x48, 0x00, 0x6d, + 0x68, 0x06, 0x11, 0xd5, 0x60, 0x20, 0x0d, 0xaa, 0x01, 0x21, 0x00, 0x23, + 0x8d, 0xf8, 0x34, 0x00, 0xdf, 0xf8, 0xd0, 0x04, 0x06, 0x68, 0x01, 0x20, + 0xb0, 0x47, 0x7e, 0x49, 0x25, 0xf0, 0x40, 0x05, 0xc8, 0x69, 0x4f, 0xf0, + 0xff, 0x30, 0x08, 0x61, 0xdf, 0xf8, 0xc8, 0x04, 0x00, 0xf1, 0x02, 0x09, + 0xdf, 0xf8, 0xc4, 0x04, 0xcd, 0xf8, 0x2c, 0x90, 0x00, 0xf2, 0x63, 0x1b, + 0x05, 0xf4, 0x02, 0x50, 0xb0, 0xf5, 0x02, 0x5f, 0x6f, 0xd1, 0xdf, 0xf8, + 0xb4, 0x04, 0x00, 0x68, 0x80, 0x47, 0x07, 0x46, 0xdf, 0xf8, 0xac, 0x04, + 0x00, 0x68, 0x80, 0x47, 0x0c, 0x98, 0x99, 0xf8, 0x00, 0x10, 0x90, 0xf8, + 0xf4, 0x01, 0x0f, 0x91, 0x0e, 0x90, 0x60, 0xb3, 0x01, 0x28, 0x50, 0xd1, + 0x70, 0x20, 0x00, 0x21, 0x00, 0x22, 0x8d, 0xf8, 0x34, 0x00, 0xf8, 0x1e, + 0x01, 0x28, 0x9c, 0xbf, 0x02, 0x20, 0x84, 0xf8, 0xfe, 0x00, 0xdf, 0xf8, + 0x84, 0x04, 0x03, 0x68, 0x70, 0x20, 0x98, 0x47, 0xdf, 0xf8, 0x74, 0x04, + 0x00, 0x68, 0x80, 0x47, 0x9b, 0xf8, 0x00, 0x10, 0x4a, 0x1c, 0x8b, 0xf8, + 0x00, 0x20, 0x14, 0x22, 0xb1, 0xfb, 0xf2, 0xf2, 0x02, 0xeb, 0x82, 0x02, + 0xa1, 0xeb, 0x82, 0x01, 0xdf, 0xf8, 0x48, 0x24, 0x02, 0xeb, 0x81, 0x01, + 0xc1, 0xf8, 0x6c, 0x01, 0xdf, 0xf8, 0x50, 0x04, 0x00, 0x68, 0x80, 0x47, + 0x25, 0xe0, 0xa0, 0x20, 0x8d, 0xf8, 0x34, 0x00, 0x07, 0xf0, 0xfe, 0x00, + 0x02, 0x28, 0x04, 0xbf, 0x04, 0x20, 0x84, 0xf8, 0xfe, 0x00, 0xdf, 0xf8, + 0x2c, 0x04, 0x00, 0x68, 0x80, 0x47, 0x9b, 0xf8, 0x01, 0x10, 0x4a, 0x1c, + 0x8b, 0xf8, 0x01, 0x20, 0x14, 0x22, 0xb1, 0xfb, 0xf2, 0xf2, 0x02, 0xeb, + 0x82, 0x02, 0xa1, 0xeb, 0x82, 0x01, 0xdf, 0xf8, 0x00, 0x24, 0x02, 0xeb, + 0x81, 0x01, 0xc1, 0xf8, 0xbc, 0x01, 0x0b, 0x98, 0x00, 0x78, 0x02, 0x28, + 0x08, 0xbf, 0x06, 0xf0, 0xa7, 0xfc, 0xdf, 0xf8, 0xd4, 0x03, 0x0d, 0xaa, + 0x01, 0x21, 0x00, 0x23, 0x06, 0x68, 0x01, 0x20, 0xb0, 0x47, 0xdd, 0xf8, + 0x2c, 0x90, 0x25, 0xf4, 0x02, 0x55, 0x68, 0xb2, 0xb0, 0xf1, 0xff, 0x3f, + 0x3d, 0xdc, 0x0c, 0x9f, 0x70, 0x20, 0x0d, 0xaa, 0x01, 0x21, 0x00, 0x23, + 0x8d, 0xf8, 0x34, 0x00, 0x97, 0xf8, 0xf4, 0x01, 0x0e, 0x90, 0x99, 0xf8, + 0x00, 0x00, 0x4f, 0xf0, 0x01, 0x09, 0x0f, 0x90, 0xe5, 0x48, 0x06, 0x68, + 0x01, 0x20, 0xb0, 0x47, 0xe9, 0x48, 0x87, 0xf8, 0xf4, 0x91, 0x00, 0x68, + 0x80, 0x47, 0x04, 0x28, 0x04, 0xbf, 0x02, 0x20, 0x84, 0xf8, 0xfe, 0x00, + 0x00, 0x21, 0x00, 0x22, 0xe6, 0x48, 0x03, 0x68, 0x70, 0x20, 0x98, 0x47, + 0xe3, 0x48, 0x00, 0x68, 0x80, 0x47, 0x9b, 0xf8, 0x00, 0x10, 0x4a, 0x1c, + 0x8b, 0xf8, 0x00, 0x20, 0x14, 0x22, 0xb1, 0xfb, 0xf2, 0xf2, 0x02, 0xeb, + 0x82, 0x02, 0xa1, 0xeb, 0x82, 0x01, 0xd9, 0x4a, 0x02, 0xeb, 0x81, 0x01, + 0xc1, 0xf8, 0x6c, 0x01, 0xdb, 0x48, 0x00, 0x68, 0x80, 0x47, 0xdd, 0xf8, + 0x2c, 0x90, 0x25, 0xf0, 0x80, 0x05, 0xe8, 0x05, 0x0a, 0x94, 0x40, 0xf1, + 0x92, 0x80, 0xc6, 0x49, 0xc8, 0x4a, 0x20, 0x78, 0x89, 0x6e, 0xd2, 0xf8, + 0x9c, 0x26, 0xff, 0x28, 0x08, 0x92, 0x12, 0x79, 0x4f, 0xea, 0x11, 0x47, + 0xcd, 0xe9, 0x02, 0xb5, 0x07, 0x97, 0x09, 0x92, 0x40, 0xf0, 0xf2, 0x80, + 0xd0, 0x1e, 0x00, 0x26, 0x04, 0x25, 0x4f, 0xf0, 0x00, 0x08, 0x06, 0x90, + 0xec, 0x48, 0x00, 0xf2, 0xa4, 0x40, 0x05, 0x90, 0x0c, 0x98, 0x99, 0xf8, + 0x08, 0x10, 0xd0, 0xf8, 0x00, 0xb0, 0xc9, 0x07, 0x0b, 0xeb, 0x05, 0x00, + 0xa0, 0xf1, 0x04, 0x00, 0x10, 0xd1, 0xb6, 0x49, 0xc1, 0xf8, 0x9c, 0x06, + 0xc2, 0x49, 0x09, 0x68, 0x88, 0x47, 0xc4, 0xf8, 0xe6, 0x60, 0x53, 0xe0, + 0x10, 0x50, 0x00, 0x40, 0x10, 0x60, 0x00, 0x40, 0x1c, 0x60, 0x00, 0x40, + 0x1c, 0x50, 0x00, 0x40, 0x1b, 0xf8, 0x05, 0x10, 0xfe, 0x29, 0x3e, 0xd1, + 0x0c, 0x99, 0xd1, 0xf8, 0xc4, 0x01, 0x01, 0x30, 0xc1, 0xf8, 0xc4, 0x01, + 0x06, 0x98, 0x02, 0x28, 0x3b, 0xd8, 0xb2, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x05, 0x9e, 0x08, 0x9b, 0x0c, 0x9a, 0xdf, 0xf8, 0xb0, 0xc2, 0xbd, 0xf8, + 0x48, 0x40, 0x09, 0x9f, 0xdd, 0xf8, 0x2c, 0x90, 0x31, 0x68, 0x93, 0xf8, + 0x05, 0xe0, 0x1b, 0x68, 0xd2, 0xf8, 0xc4, 0x21, 0x0c, 0xeb, 0x01, 0x11, + 0xc1, 0xe9, 0xd5, 0x03, 0xc1, 0xf8, 0x5c, 0x23, 0xa1, 0xf8, 0x60, 0x43, + 0x81, 0xf8, 0x62, 0x73, 0x81, 0xf8, 0x63, 0xe3, 0x31, 0x68, 0x0c, 0xeb, + 0x01, 0x11, 0xc1, 0xe9, 0xfd, 0x03, 0xa1, 0xf8, 0x00, 0x44, 0x81, 0xf8, + 0x02, 0x74, 0x0a, 0x9c, 0x07, 0x9f, 0xc1, 0xf8, 0xfc, 0x23, 0x81, 0xf8, + 0x03, 0xe4, 0x30, 0x68, 0x01, 0x30, 0x09, 0x28, 0x88, 0xbf, 0x00, 0x20, + 0x30, 0x60, 0x00, 0x26, 0x05, 0xe0, 0x8c, 0x49, 0xc1, 0xf8, 0x9c, 0x06, + 0x98, 0x49, 0x09, 0x68, 0x88, 0x47, 0xfe, 0x20, 0x0b, 0xf8, 0x05, 0x00, + 0x08, 0xf1, 0x01, 0x00, 0xb8, 0x45, 0x05, 0xf1, 0x10, 0x05, 0x80, 0x46, + 0x90, 0xd1, 0x03, 0x9d, 0xdf, 0xf8, 0xf8, 0x81, 0xdd, 0xf8, 0x08, 0xb0, + 0x27, 0x70, 0x25, 0xf4, 0x80, 0x75, 0xa8, 0x04, 0x61, 0xd5, 0x0c, 0x9e, + 0xa0, 0x20, 0x0d, 0xaa, 0x01, 0x21, 0x00, 0x23, 0x00, 0x25, 0x8d, 0xf8, + 0x34, 0x00, 0x96, 0xf8, 0xf4, 0x01, 0x0e, 0x90, 0x99, 0xf8, 0x00, 0x00, + 0x0f, 0x90, 0x7b, 0x48, 0x04, 0x68, 0x01, 0x20, 0xa0, 0x47, 0x86, 0xf8, + 0xf4, 0x51, 0x7e, 0x4d, 0x28, 0x68, 0x80, 0x47, 0x02, 0x28, 0x03, 0xd0, + 0x28, 0x68, 0x80, 0x47, 0x03, 0x28, 0x03, 0xd1, 0x0a, 0x99, 0x04, 0x20, + 0x81, 0xf8, 0xfe, 0x00, 0x79, 0x48, 0x00, 0x68, 0x80, 0x47, 0x9b, 0xf8, + 0x01, 0x10, 0x14, 0x22, 0x9a, 0x4b, 0xb1, 0xfb, 0xf2, 0xf2, 0x02, 0xeb, + 0x82, 0x02, 0xa1, 0xeb, 0x82, 0x02, 0x01, 0x31, 0x03, 0xeb, 0x82, 0x02, + 0xc2, 0xf8, 0xbc, 0x01, 0x74, 0x48, 0x02, 0x68, 0x22, 0xf0, 0x70, 0x42, + 0x02, 0x60, 0x42, 0x68, 0x22, 0xf0, 0x40, 0x42, 0x42, 0x60, 0x71, 0x48, + 0xc2, 0x69, 0x22, 0xf4, 0xc0, 0x62, 0xc2, 0x61, 0x02, 0x68, 0x22, 0xf4, + 0x40, 0x72, 0x02, 0x60, 0x6d, 0x4a, 0x13, 0x68, 0x23, 0xf0, 0x70, 0x43, + 0x13, 0x60, 0x53, 0x68, 0x23, 0xf0, 0x40, 0x43, 0x53, 0x60, 0xc2, 0x69, + 0x22, 0xf4, 0xc0, 0x72, 0xc2, 0x61, 0x8b, 0xf8, 0x01, 0x10, 0x41, 0x6a, + 0x21, 0xf4, 0x40, 0x71, 0x41, 0x62, 0x00, 0x20, 0xff, 0x21, 0x02, 0xf0, + 0x5d, 0xfd, 0x99, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x08, 0xbf, 0x06, 0xf0, + 0x5f, 0xfb, 0x1a, 0xf4, 0x70, 0x5f, 0x3f, 0xf4, 0x04, 0xae, 0x0c, 0x98, + 0x14, 0x21, 0xc0, 0xf8, 0xd8, 0xa1, 0x49, 0x48, 0x00, 0x78, 0x00, 0xf0, + 0x3d, 0xf9, 0xfa, 0xe5, 0x39, 0x1a, 0x11, 0xf0, 0x0f, 0x01, 0x08, 0xd1, + 0x0c, 0x99, 0x09, 0x68, 0x01, 0xeb, 0x00, 0x11, 0x09, 0x79, 0xfe, 0x29, + 0x3f, 0xf4, 0x7b, 0xaf, 0x10, 0x21, 0x01, 0xf1, 0x01, 0x08, 0x09, 0x99, + 0x4f, 0xf0, 0x01, 0x0b, 0xcd, 0xf8, 0x10, 0xa0, 0xcd, 0x1e, 0x6c, 0x49, + 0x01, 0xf2, 0xa4, 0x41, 0x06, 0x91, 0x0c, 0x99, 0x58, 0x44, 0x00, 0xf0, + 0x0f, 0x00, 0x09, 0x68, 0x01, 0xeb, 0x00, 0x10, 0x99, 0xf8, 0x08, 0x10, + 0xc9, 0x07, 0x09, 0xd1, 0x35, 0x49, 0xc1, 0xf8, 0x9c, 0x06, 0x42, 0x49, + 0x09, 0x68, 0x88, 0x47, 0x00, 0x20, 0xc4, 0xf8, 0xe6, 0x00, 0x50, 0xe0, + 0x06, 0x46, 0x16, 0xf8, 0x04, 0x1f, 0xfe, 0x29, 0x41, 0xd1, 0x0c, 0x99, + 0x02, 0x2d, 0xd1, 0xf8, 0xc4, 0x01, 0x00, 0xf1, 0x01, 0x00, 0xc1, 0xf8, + 0xc4, 0x01, 0x3e, 0xd8, 0x34, 0x48, 0x00, 0x68, 0x80, 0x47, 0x08, 0x9a, + 0xdd, 0xf8, 0x18, 0xa0, 0xdf, 0xf8, 0xb8, 0xc0, 0xbd, 0xf8, 0x48, 0x40, + 0x09, 0x9f, 0x0c, 0x9b, 0xae, 0x46, 0xda, 0xf8, 0x00, 0x10, 0x52, 0x68, + 0xd3, 0xf8, 0xc4, 0x31, 0x0c, 0xeb, 0x01, 0x11, 0x15, 0x0a, 0xa1, 0xf8, + 0x60, 0x43, 0x81, 0xf8, 0x63, 0x53, 0x81, 0xf8, 0x62, 0x73, 0x01, 0xf5, + 0x55, 0x71, 0x0d, 0xc1, 0xda, 0xf8, 0x00, 0x10, 0x0c, 0xeb, 0x01, 0x11, + 0xa1, 0xf8, 0x00, 0x44, 0x81, 0xf8, 0x03, 0x54, 0x81, 0xf8, 0x02, 0x74, + 0x01, 0xf5, 0x7d, 0x71, 0x0a, 0x9c, 0x07, 0x9f, 0x75, 0x46, 0x0d, 0xc1, + 0xda, 0xf8, 0x00, 0x00, 0x01, 0x30, 0x09, 0x28, 0x88, 0xbf, 0x00, 0x20, + 0xca, 0xf8, 0x00, 0x00, 0xdd, 0xf8, 0x10, 0xa0, 0x05, 0xe0, 0x0d, 0x49, + 0xc1, 0xf8, 0x9c, 0x06, 0x19, 0x49, 0x09, 0x68, 0x88, 0x47, 0xfe, 0x20, + 0xdd, 0xf8, 0x2c, 0x90, 0x30, 0x70, 0x0b, 0xf1, 0x01, 0x0b, 0xc3, 0x45, + 0x3f, 0xf4, 0x03, 0xaf, 0x20, 0x78, 0x92, 0xe7, 0x00, 0x9d, 0x08, 0x00, + 0x48, 0xe5, 0x08, 0x00, 0x10, 0x60, 0x00, 0x40, 0xac, 0x9a, 0x08, 0x00, + 0xa5, 0x58, 0x01, 0x00, 0x38, 0x21, 0x01, 0x00, 0xb0, 0x9a, 0x08, 0x00, + 0x9c, 0xe5, 0x08, 0x00, 0x80, 0xe5, 0x08, 0x00, 0xec, 0x9a, 0x08, 0x00, + 0x44, 0xe5, 0x08, 0x00, 0xa0, 0xe5, 0x08, 0x00, 0x74, 0x2a, 0x01, 0x00, + 0x64, 0xd4, 0x05, 0x00, 0x3c, 0xe5, 0x08, 0x00, 0x90, 0xe5, 0x08, 0x00, + 0xa4, 0xe5, 0x08, 0x00, 0x8c, 0xe5, 0x08, 0x00, 0x78, 0xe5, 0x08, 0x00, + 0xa8, 0x9a, 0x08, 0x00, 0x28, 0xd8, 0x05, 0x30, 0x5c, 0xc0, 0x05, 0x30, + 0x28, 0xf0, 0x05, 0x30, 0x10, 0xb5, 0x0d, 0x49, 0x44, 0xb2, 0x0d, 0x4b, + 0x00, 0x2c, 0x0a, 0x68, 0x02, 0xf0, 0x7f, 0x72, 0x48, 0xbf, 0x1a, 0x43, + 0x0a, 0x4b, 0x93, 0xf8, 0x73, 0x32, 0x1b, 0xb9, 0xc3, 0x06, 0x48, 0xbf, + 0x42, 0xf4, 0x10, 0x72, 0xc3, 0x02, 0x00, 0xf4, 0x00, 0x10, 0x48, 0xbf, + 0x42, 0xf0, 0x03, 0x02, 0x42, 0xea, 0x80, 0x20, 0x08, 0x60, 0x10, 0xbd, + 0x30, 0x60, 0x00, 0x40, 0x18, 0x01, 0x03, 0x04, 0x8c, 0x7e, 0x08, 0x00, + 0x80, 0xb5, 0x00, 0xf0, 0x6f, 0xf8, 0x03, 0x48, 0x01, 0x68, 0x21, 0xf0, + 0x01, 0x01, 0x01, 0x60, 0x80, 0xbd, 0x00, 0xbf, 0x08, 0x00, 0x00, 0x40, + 0x05, 0x4a, 0x92, 0xf8, 0x3e, 0x26, 0x01, 0x2a, 0x04, 0xd1, 0x04, 0x4a, + 0x52, 0x79, 0x01, 0x3a, 0x08, 0xbf, 0x11, 0x46, 0x00, 0xf0, 0x60, 0xb8, + 0x64, 0xd4, 0x05, 0x00, 0x48, 0xdc, 0x05, 0x00, 0x09, 0x48, 0x0a, 0x49, + 0x01, 0x60, 0x0a, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, 0x0b, 0x49, + 0x01, 0x60, 0x0b, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0c, 0x49, + 0x01, 0x60, 0x0c, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x8c, 0xe5, 0x08, 0x00, 0x75, 0x04, 0x02, 0x00, 0x44, 0x97, 0x08, 0x00, + 0xf5, 0x03, 0x02, 0x00, 0x14, 0x9b, 0x08, 0x00, 0x59, 0x08, 0x02, 0x00, + 0x84, 0xe5, 0x08, 0x00, 0x1d, 0x0f, 0x02, 0x00, 0xcc, 0x96, 0x08, 0x00, + 0x61, 0x0f, 0x02, 0x00, 0x68, 0xbb, 0x08, 0x00, 0x79, 0x0f, 0x02, 0x00, + 0x4a, 0xf2, 0x89, 0x0c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4c, 0xf2, 0x91, 0x0c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf2, 0x91, 0x2c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf6, 0xe5, 0x7c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4c, 0xf6, 0x4d, 0x5c, 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4a, 0xf6, 0x5d, 0x6c, 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x45, 0xf2, 0xdd, 0x5c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x48, 0xf6, 0x5d, 0x7c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf2, 0xfd, 0x1c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xa0, 0xf1, 0x35, 0x01, 0x36, 0x28, 0xb1, 0xfa, 0x81, 0xf1, 0x4f, 0xea, + 0x51, 0x11, 0x08, 0xbf, 0x02, 0x21, 0x08, 0x46, 0x70, 0x47, 0x00, 0xbf, + 0xf8, 0xb5, 0x0c, 0x46, 0x34, 0x49, 0x0e, 0x68, 0x26, 0xb1, 0xc0, 0xeb, + 0x00, 0x10, 0x06, 0xeb, 0x40, 0x12, 0x00, 0xe0, 0x00, 0x22, 0xd2, 0xf8, + 0xb0, 0x70, 0xd7, 0xe9, 0x7c, 0x01, 0x50, 0xea, 0x01, 0x03, 0x52, 0xd0, + 0xd3, 0x78, 0x55, 0x78, 0xc1, 0x32, 0x81, 0x2b, 0x08, 0xbf, 0x07, 0xf5, + 0x07, 0x72, 0x12, 0x78, 0x52, 0x00, 0x00, 0xf0, 0x11, 0xfc, 0x28, 0x49, + 0xa4, 0xf1, 0x35, 0x03, 0xc5, 0xeb, 0xc5, 0x02, 0x36, 0x2c, 0x00, 0xf0, + 0x03, 0x00, 0xb3, 0xfa, 0x83, 0xf3, 0x49, 0x68, 0x4f, 0xea, 0x53, 0x13, + 0x08, 0xbf, 0x02, 0x23, 0x01, 0xeb, 0x82, 0x02, 0x02, 0xeb, 0x83, 0x02, + 0x15, 0x5c, 0x97, 0xf8, 0x42, 0x20, 0xd2, 0x06, 0x2e, 0xd4, 0x01, 0x28, + 0x2c, 0xd8, 0x97, 0xf8, 0x1d, 0x01, 0xc0, 0xeb, 0x00, 0x10, 0x06, 0xeb, + 0x40, 0x10, 0x40, 0x78, 0xc0, 0xeb, 0xc0, 0x00, 0x01, 0xeb, 0x80, 0x00, + 0xd0, 0xe9, 0x04, 0x10, 0x81, 0x42, 0x38, 0xbf, 0x01, 0x46, 0x1f, 0x29, + 0x1a, 0xd3, 0xb7, 0xf8, 0x74, 0x61, 0x07, 0xf5, 0xa3, 0x70, 0x31, 0x46, + 0x1f, 0xf0, 0x02, 0xfd, 0x28, 0xb9, 0x07, 0xf5, 0xa8, 0x70, 0x31, 0x46, + 0x1f, 0xf0, 0xfc, 0xfc, 0x60, 0xb1, 0x0c, 0x48, 0x43, 0x21, 0xa7, 0xf8, + 0x36, 0x62, 0x41, 0x77, 0xb7, 0xf8, 0x34, 0x02, 0x01, 0x30, 0xa7, 0xf8, + 0x34, 0x02, 0x08, 0x48, 0x90, 0xf8, 0xee, 0x50, 0x1d, 0xb9, 0x07, 0x48, + 0x20, 0x44, 0x90, 0xf8, 0x14, 0x52, 0x28, 0x46, 0xf8, 0xbd, 0x00, 0xbf, + 0xe0, 0x35, 0x01, 0x00, 0xec, 0xe5, 0x05, 0x00, 0xfc, 0x20, 0x01, 0x00, + 0x04, 0x31, 0x06, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x80, 0xb5, 0x0b, 0x48, + 0x01, 0x68, 0x91, 0xf8, 0x8c, 0x00, 0x03, 0x28, 0x05, 0xd8, 0x01, 0x28, + 0x03, 0xd0, 0xb1, 0xf8, 0x68, 0x20, 0x07, 0x4b, 0x02, 0xe0, 0xb1, 0xf8, + 0x68, 0x20, 0x06, 0x4b, 0x91, 0xf8, 0x7c, 0x10, 0x1b, 0x68, 0x01, 0xf0, + 0x0f, 0x01, 0x98, 0x47, 0x80, 0xb2, 0x80, 0xbd, 0xf8, 0x35, 0x01, 0x00, + 0x04, 0x97, 0x08, 0x00, 0xd0, 0x98, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x87, 0xb0, 0x0c, 0x46, 0xdf, 0xf8, 0x5c, 0x14, 0x91, 0x46, 0x2b, 0x2a, + 0x03, 0x92, 0x06, 0x46, 0x08, 0xbf, 0x4f, 0xf0, 0x34, 0x09, 0x00, 0x28, + 0x01, 0x93, 0x01, 0xf2, 0xac, 0x58, 0x00, 0xf0, 0x8d, 0x80, 0x96, 0xf8, + 0x3a, 0x00, 0x9a, 0x46, 0x06, 0x90, 0x96, 0xf8, 0x74, 0x00, 0x02, 0x90, + 0x96, 0xf8, 0x35, 0x01, 0x05, 0x90, 0xd6, 0xf8, 0xd4, 0x00, 0x00, 0xf0, + 0x7f, 0xfb, 0x04, 0x90, 0x96, 0xf8, 0x35, 0x01, 0x96, 0xf8, 0xb0, 0x35, + 0x16, 0x28, 0x1d, 0x46, 0x1f, 0xd8, 0xdf, 0xf8, 0x1c, 0x14, 0x00, 0xeb, + 0x40, 0x02, 0x51, 0xf8, 0x22, 0x20, 0xc2, 0xb1, 0x00, 0xeb, 0x40, 0x00, + 0x01, 0xeb, 0x80, 0x00, 0x00, 0x79, 0x01, 0x28, 0x40, 0xf0, 0xd0, 0x80, + 0xdf, 0xf8, 0x00, 0x04, 0xdf, 0xf8, 0x00, 0x14, 0x00, 0x78, 0x00, 0xeb, + 0x00, 0x10, 0x01, 0xeb, 0xc0, 0x01, 0xdf, 0xf8, 0xf8, 0x03, 0x02, 0x68, + 0x30, 0x46, 0x90, 0x47, 0x2b, 0x46, 0x83, 0x46, 0x01, 0xe0, 0x4f, 0xf0, + 0x00, 0x0b, 0xa9, 0xf1, 0x04, 0x00, 0x3e, 0x28, 0x00, 0xf2, 0x32, 0x81, + 0xdf, 0xe8, 0x10, 0xf0, 0x2c, 0x01, 0xf0, 0x00, 0xb2, 0x00, 0xb2, 0x00, + 0x2c, 0x01, 0x30, 0x01, 0x1e, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, + 0x30, 0x01, 0x26, 0x01, 0xd5, 0x00, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, + 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x29, 0x01, + 0x30, 0x01, 0x30, 0x01, 0xbd, 0x00, 0xbd, 0x00, 0x30, 0x01, 0x30, 0x01, + 0x30, 0x01, 0xd5, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, + 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0xd5, 0x00, 0x30, 0x01, 0x30, 0x01, + 0x30, 0x01, 0xf0, 0x00, 0xb2, 0x00, 0xb2, 0x00, 0x30, 0x01, 0x30, 0x01, + 0x30, 0x01, 0x30, 0x01, 0xe5, 0x00, 0xe5, 0x00, 0xe5, 0x00, 0x30, 0x01, + 0x30, 0x01, 0xbd, 0x00, 0xbd, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, + 0x3f, 0x00, 0x30, 0x01, 0x30, 0x01, 0xb2, 0x00, 0xb2, 0x00, 0x00, 0x2c, + 0x00, 0xf0, 0xee, 0x80, 0xdf, 0xf8, 0x64, 0x03, 0xb4, 0xf8, 0x98, 0x20, + 0x94, 0xf8, 0x9c, 0x10, 0x03, 0x68, 0x20, 0x78, 0x98, 0x47, 0x2b, 0x46, + 0x83, 0x46, 0xe1, 0xe0, 0xdf, 0xf8, 0x50, 0x03, 0x01, 0xf2, 0xab, 0x34, + 0x00, 0x68, 0x80, 0x47, 0x82, 0x46, 0xa9, 0xf1, 0x29, 0x00, 0x81, 0x21, + 0x00, 0x27, 0x0d, 0x28, 0x06, 0x91, 0x20, 0xd9, 0xa9, 0xf1, 0x02, 0x00, + 0x0e, 0x28, 0x40, 0xd9, 0xa9, 0xf1, 0x41, 0x00, 0x02, 0x28, 0xc0, 0xf0, + 0x91, 0x80, 0xb9, 0xf1, 0x21, 0x0f, 0x00, 0xf0, 0x5e, 0x80, 0xb9, 0xf1, + 0x16, 0x0f, 0x00, 0xf0, 0xd1, 0x80, 0xb9, 0xf1, 0x1a, 0x0f, 0x00, 0xf0, + 0xd1, 0x80, 0xb9, 0xf1, 0x14, 0x0f, 0x4f, 0xf0, 0x00, 0x02, 0x40, 0xf0, + 0xd6, 0x80, 0xdf, 0xf8, 0x10, 0x03, 0x17, 0x27, 0x90, 0xf8, 0x50, 0x20, + 0xcd, 0xe0, 0x19, 0x21, 0x00, 0x22, 0x05, 0x91, 0xdf, 0xe8, 0x00, 0xf0, + 0x45, 0xcb, 0xcb, 0xcb, 0x69, 0x76, 0x76, 0xcb, 0xcb, 0xcb, 0xcb, 0x07, + 0x07, 0x07, 0xaf, 0x48, 0x00, 0x78, 0x00, 0x28, 0x5a, 0xd1, 0xae, 0x48, + 0xc0, 0x68, 0x00, 0x28, 0x56, 0xd0, 0x90, 0xf8, 0x44, 0x20, 0xe8, 0x49, + 0xb0, 0xf8, 0x74, 0xa1, 0x05, 0x92, 0x90, 0xf8, 0x1d, 0x21, 0x09, 0x68, + 0xc2, 0xeb, 0x02, 0x12, 0x01, 0xeb, 0x42, 0x11, 0x01, 0xf1, 0xe4, 0x04, + 0x56, 0xe0, 0x19, 0x21, 0x00, 0x22, 0x05, 0x91, 0xdf, 0xe8, 0x00, 0xf0, + 0x08, 0xa7, 0xa7, 0x45, 0x52, 0x52, 0xa7, 0x67, 0xa7, 0xa7, 0xa7, 0xa7, + 0xa7, 0xa7, 0x21, 0x00, 0x9f, 0x48, 0x18, 0x27, 0x02, 0x78, 0x98, 0xe0, + 0x97, 0x48, 0x90, 0xf8, 0xab, 0x03, 0x3c, 0xe0, 0x4f, 0xf0, 0x00, 0x0b, + 0x03, 0x28, 0x08, 0xbf, 0x4f, 0xf0, 0xc8, 0x0b, 0x3b, 0xe7, 0x05, 0x98, + 0x93, 0x49, 0x00, 0xeb, 0x40, 0x00, 0x51, 0xf8, 0x20, 0x00, 0xb0, 0xf8, + 0x14, 0x03, 0x04, 0x90, 0x68, 0xe0, 0x94, 0x48, 0x94, 0x4c, 0x01, 0x78, + 0x20, 0x79, 0x47, 0x18, 0x93, 0x49, 0x09, 0x68, 0x88, 0x47, 0x02, 0x46, + 0x20, 0x79, 0x20, 0x44, 0x90, 0xf8, 0xad, 0x00, 0x76, 0xe0, 0x8d, 0x48, + 0x8d, 0x4c, 0x01, 0x78, 0x20, 0x79, 0x01, 0x44, 0x05, 0x91, 0x8c, 0x49, + 0x09, 0x68, 0x88, 0x47, 0x02, 0x90, 0x20, 0x79, 0x2b, 0x46, 0x20, 0x44, + 0x90, 0xf8, 0xad, 0x00, 0x49, 0xe0, 0x81, 0x48, 0x00, 0x78, 0x40, 0xb3, + 0x07, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x7b, 0x48, 0x00, 0xf2, 0xaa, 0x34, + 0x1a, 0x20, 0x06, 0xe0, 0x78, 0x48, 0x90, 0xf8, 0xaa, 0x03, 0x02, 0x90, + 0x81, 0x20, 0x38, 0xe0, 0x19, 0x20, 0x05, 0x90, 0x75, 0x48, 0xcd, 0xf8, + 0x10, 0xa0, 0x81, 0x27, 0x25, 0x78, 0x08, 0xf1, 0x0a, 0x02, 0x08, 0xf1, + 0x08, 0x03, 0x08, 0xf1, 0x06, 0x04, 0x01, 0x21, 0x4f, 0xf0, 0x00, 0x0b, + 0x00, 0x68, 0x06, 0x97, 0xdd, 0xf8, 0x04, 0xa0, 0x00, 0xf0, 0x7f, 0x40, + 0x52, 0xe0, 0x81, 0x20, 0x00, 0x22, 0x1b, 0x27, 0x3a, 0xe0, 0x6c, 0x48, + 0xc0, 0x68, 0x00, 0x28, 0xd2, 0xd0, 0xb0, 0xf8, 0x74, 0x11, 0x90, 0xf8, + 0x44, 0x00, 0x04, 0x91, 0x05, 0x90, 0xdd, 0xf8, 0x04, 0xa0, 0x11, 0xe0, + 0x67, 0x48, 0x00, 0x78, 0x02, 0x90, 0x81, 0x20, 0x06, 0x90, 0x1e, 0x20, + 0x05, 0x90, 0x09, 0xe0, 0xff, 0xf7, 0x68, 0xfe, 0x21, 0xe7, 0x62, 0x48, + 0x00, 0x78, 0x02, 0x90, 0x81, 0x20, 0x4f, 0xf0, 0x00, 0x0b, 0x06, 0x90, + 0x59, 0x48, 0x01, 0x2b, 0x00, 0x68, 0x00, 0xf0, 0x7f, 0x40, 0x22, 0xd1, + 0x08, 0xf1, 0x0a, 0x02, 0x08, 0xf1, 0x08, 0x03, 0x08, 0xf1, 0x06, 0x04, + 0x01, 0x21, 0x20, 0xe0, 0x5f, 0x48, 0x1d, 0x27, 0xc2, 0x7c, 0x08, 0xe0, + 0x5b, 0x48, 0x1c, 0x27, 0x00, 0x7e, 0x02, 0x28, 0x5a, 0x48, 0x08, 0xbf, + 0x1f, 0x27, 0x90, 0xf8, 0x4a, 0x20, 0x81, 0x20, 0x06, 0x90, 0x4b, 0x48, + 0x02, 0x92, 0xcd, 0xf8, 0x10, 0xa0, 0x4f, 0xf0, 0x00, 0x0b, 0x00, 0x68, + 0x05, 0x97, 0xdd, 0xf8, 0x04, 0xa0, 0x00, 0xf0, 0x7f, 0x40, 0x08, 0xf1, + 0x04, 0x02, 0x08, 0xf1, 0x02, 0x03, 0x00, 0x21, 0x44, 0x46, 0x02, 0x9d, + 0x1b, 0x88, 0x12, 0x78, 0x03, 0x9f, 0x00, 0x29, 0x40, 0xea, 0x03, 0x20, + 0x4f, 0xf0, 0x02, 0x03, 0x40, 0xea, 0x02, 0x40, 0x22, 0x88, 0x3c, 0x4c, + 0x40, 0xea, 0x02, 0x00, 0x20, 0x60, 0x4f, 0xf0, 0x04, 0x00, 0x18, 0xbf, + 0x0a, 0x20, 0x62, 0x68, 0x18, 0xf8, 0x00, 0x00, 0x18, 0xbf, 0x08, 0x23, + 0x00, 0x29, 0x38, 0xf8, 0x03, 0x30, 0x02, 0xf0, 0x7f, 0x42, 0x18, 0xbf, + 0x08, 0xf1, 0x06, 0x08, 0xb8, 0xf8, 0x00, 0x10, 0x42, 0xea, 0x03, 0x22, + 0x42, 0xea, 0x00, 0x40, 0x40, 0xea, 0x01, 0x00, 0x60, 0x60, 0x2c, 0x4c, + 0x3e, 0xb1, 0x94, 0xf8, 0xa2, 0x02, 0x20, 0xb1, 0x96, 0xf8, 0xb8, 0x75, + 0x00, 0x20, 0x86, 0xf8, 0xb8, 0x05, 0xd8, 0x48, 0x51, 0x46, 0x02, 0x68, + 0x48, 0x46, 0x90, 0x47, 0x94, 0xf8, 0xec, 0x02, 0x98, 0xb1, 0xc3, 0x48, + 0x90, 0xf8, 0xfe, 0x06, 0x78, 0xb1, 0x31, 0x48, 0x40, 0x78, 0x03, 0x28, + 0x0b, 0xd1, 0x56, 0xb1, 0x5c, 0x48, 0x40, 0x7f, 0x40, 0x28, 0x06, 0xd1, + 0x96, 0xf8, 0xbc, 0x06, 0x01, 0x28, 0x04, 0xbf, 0x00, 0x20, 0x86, 0xf8, + 0xbc, 0x06, 0x2a, 0x48, 0x04, 0x9a, 0x1f, 0xfa, 0x8b, 0xf3, 0x39, 0x46, + 0x04, 0x68, 0x05, 0x98, 0xc0, 0xb2, 0xa0, 0x47, 0x26, 0x48, 0x29, 0x46, + 0x00, 0x68, 0xc0, 0x07, 0x14, 0xbf, 0x25, 0x48, 0x25, 0x48, 0x06, 0x9c, + 0x03, 0x68, 0x50, 0x46, 0x62, 0xb2, 0x98, 0x47, 0x23, 0x48, 0x90, 0xf8, + 0xd4, 0x0d, 0x88, 0xb1, 0xa8, 0x06, 0x0f, 0xd4, 0x75, 0xb1, 0x1f, 0x48, + 0x64, 0xb2, 0x22, 0x46, 0x03, 0x68, 0x68, 0x1e, 0xc5, 0xb2, 0x50, 0x46, + 0x29, 0x46, 0x98, 0x47, 0x19, 0x48, 0x29, 0x46, 0x22, 0x46, 0x03, 0x68, + 0x50, 0x46, 0x98, 0x47, 0x19, 0x48, 0x1a, 0x49, 0x80, 0x68, 0x09, 0x68, + 0x07, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0x08, 0x47, 0x8c, 0x7e, 0x08, 0x00, + 0x20, 0x50, 0x00, 0x40, 0xe8, 0x72, 0x01, 0x00, 0x74, 0x87, 0x08, 0x00, + 0xfc, 0x6d, 0x01, 0x00, 0xe0, 0x96, 0x08, 0x00, 0x69, 0x34, 0x01, 0x00, + 0x14, 0x01, 0x01, 0x00, 0x30, 0x72, 0x01, 0x00, 0x50, 0x97, 0x08, 0x00, + 0x04, 0x97, 0x08, 0x00, 0xe0, 0xa0, 0x08, 0x00, 0x80, 0x4b, 0x01, 0x00, + 0x04, 0x5b, 0x01, 0x00, 0x50, 0x5b, 0x01, 0x00, 0x24, 0x5c, 0x01, 0x00, + 0x50, 0x2e, 0x01, 0x00, 0x44, 0x97, 0x08, 0x00, 0x04, 0x10, 0x00, 0x40, + 0x4c, 0x97, 0x08, 0x00, 0x48, 0x97, 0x08, 0x00, 0x00, 0x69, 0x08, 0x00, + 0x74, 0x2a, 0x01, 0x00, 0x84, 0xe5, 0x08, 0x00, 0xb0, 0xb5, 0x00, 0xf0, + 0x3f, 0xf9, 0x6e, 0x49, 0x23, 0x4c, 0x91, 0xf8, 0x20, 0x20, 0x14, 0xf8, + 0x1d, 0x0f, 0x01, 0x2a, 0x15, 0xd1, 0x00, 0xf0, 0xfe, 0x02, 0x06, 0x2a, + 0x11, 0xd1, 0x94, 0xf9, 0x01, 0x20, 0x00, 0x2a, 0x0d, 0xd4, 0x89, 0x7f, + 0x01, 0x29, 0x05, 0xd1, 0x6a, 0x21, 0x06, 0x28, 0x08, 0xbf, 0x69, 0x21, + 0x61, 0x70, 0x04, 0xe0, 0x06, 0x28, 0x02, 0xd1, 0x01, 0x20, 0x60, 0x70, + 0xb0, 0xbd, 0x2d, 0x28, 0x0c, 0xd0, 0x05, 0x28, 0x19, 0xd1, 0x14, 0x48, + 0x05, 0x68, 0x68, 0x1c, 0x06, 0xd0, 0xff, 0xf7, 0xad, 0xfc, 0x28, 0x1a, + 0x00, 0xf5, 0xa0, 0x70, 0x00, 0x01, 0x0e, 0xd5, 0x0f, 0x48, 0x90, 0xf8, + 0xc3, 0x01, 0x50, 0xb1, 0x0e, 0x49, 0x00, 0x22, 0x09, 0x68, 0x0b, 0x78, + 0x02, 0x2b, 0x05, 0xd0, 0x01, 0x32, 0x01, 0xf5, 0xf0, 0x71, 0x82, 0x42, + 0xf7, 0xd3, 0xb0, 0xbd, 0x61, 0x78, 0x20, 0x78, 0x41, 0xf0, 0x80, 0x01, + 0x05, 0x28, 0x61, 0x70, 0xf7, 0xd1, 0xff, 0xf7, 0x8f, 0xfc, 0x02, 0x49, + 0x08, 0x60, 0xb0, 0xbd, 0xfc, 0x20, 0x01, 0x00, 0x6c, 0xd1, 0x05, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0xe0, 0x35, 0x01, 0x00, 0x10, 0xb5, 0x04, 0x46, + 0x00, 0xf0, 0xf0, 0xf8, 0x10, 0x49, 0x91, 0xf8, 0x4d, 0x10, 0x02, 0x29, + 0x1b, 0xd1, 0x0f, 0x49, 0xb1, 0xf8, 0x48, 0x26, 0xa2, 0x42, 0x03, 0xd0, + 0xb1, 0xf8, 0x4a, 0x36, 0xa3, 0x42, 0x12, 0xd1, 0x02, 0xeb, 0xc2, 0x03, + 0x0a, 0x4a, 0x02, 0xeb, 0x43, 0x03, 0x5b, 0x78, 0x01, 0x2b, 0x08, 0xd0, + 0xb1, 0xf8, 0x4a, 0x16, 0x01, 0xeb, 0xc1, 0x01, 0x02, 0xeb, 0x41, 0x01, + 0x49, 0x78, 0x01, 0x29, 0x01, 0xd1, 0x40, 0xf0, 0x80, 0x00, 0x10, 0xbd, + 0x18, 0x74, 0x01, 0x00, 0x64, 0xd4, 0x05, 0x00, 0x44, 0x28, 0x01, 0x00, + 0xf8, 0xb5, 0x0c, 0x46, 0x07, 0x28, 0x02, 0xd0, 0x05, 0x46, 0x42, 0x28, + 0x18, 0xd1, 0x2f, 0x49, 0x44, 0xf0, 0x80, 0x00, 0x0a, 0x68, 0x22, 0xf4, + 0x7f, 0x42, 0x42, 0xea, 0x00, 0x22, 0x0a, 0x60, 0x0a, 0x69, 0x22, 0xf4, + 0x7f, 0x42, 0x42, 0xea, 0x00, 0x20, 0x08, 0x61, 0x28, 0x48, 0x4f, 0xf6, + 0x0f, 0x72, 0x01, 0x68, 0x91, 0x43, 0x41, 0xf2, 0x01, 0x12, 0x11, 0x43, + 0x01, 0x60, 0xf8, 0xbd, 0x06, 0x2d, 0x18, 0xbf, 0x41, 0x2d, 0x2e, 0xd1, + 0x1d, 0x48, 0x90, 0xf8, 0x21, 0x10, 0x01, 0x29, 0x03, 0xd1, 0x90, 0xf8, + 0x20, 0x00, 0x01, 0x28, 0xd9, 0xd0, 0x06, 0x2d, 0x18, 0xbf, 0x41, 0x2d, + 0x21, 0xd1, 0x18, 0x4e, 0x96, 0xf8, 0xec, 0x00, 0xe8, 0xb1, 0x17, 0x49, + 0x0f, 0x68, 0x79, 0x1c, 0x0a, 0xd0, 0xff, 0xf7, 0x1d, 0xfc, 0x38, 0x1a, + 0x20, 0x30, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x10, 0xd9, + 0x96, 0xf8, 0xec, 0x00, 0x10, 0x49, 0x0a, 0x68, 0x22, 0xf4, 0x7f, 0x42, + 0x42, 0xea, 0x00, 0x20, 0x08, 0x60, 0x08, 0x69, 0x96, 0xf8, 0xec, 0x20, + 0x20, 0xf4, 0x7f, 0x40, 0x40, 0xea, 0x02, 0x20, 0xc1, 0xe7, 0x0a, 0x48, + 0x4f, 0xf6, 0x0f, 0x72, 0x01, 0x68, 0x91, 0x43, 0x01, 0x60, 0x28, 0x46, + 0x21, 0x46, 0xbd, 0xe8, 0xf8, 0x40, 0x00, 0xf0, 0x6f, 0xb8, 0x00, 0xbf, + 0x8c, 0xe6, 0x05, 0x00, 0x04, 0x31, 0x06, 0x00, 0x78, 0xd3, 0x05, 0x00, + 0x30, 0x50, 0x00, 0x40, 0x0c, 0x18, 0x21, 0x40, 0xb0, 0xb5, 0x1c, 0x46, + 0x0d, 0x46, 0x25, 0x28, 0x0c, 0xd1, 0x5d, 0xb1, 0x0e, 0x48, 0x01, 0x68, + 0x28, 0x46, 0x88, 0x47, 0x0d, 0x49, 0x91, 0xf8, 0xf8, 0x16, 0x49, 0xb1, + 0x00, 0x20, 0x20, 0x70, 0x3e, 0x20, 0xb0, 0xbd, 0x29, 0x46, 0x23, 0x46, + 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x52, 0xb8, 0xd5, 0xf8, 0xd4, 0x10, + 0x49, 0x7f, 0x21, 0xb1, 0x18, 0xb1, 0x90, 0xf8, 0xa1, 0x00, 0x02, 0x28, + 0xec, 0xd2, 0x28, 0x20, 0xb0, 0xbd, 0x00, 0xbf, 0xec, 0xbf, 0x08, 0x00, + 0x38, 0x21, 0x01, 0x00, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, + 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x04, 0x99, 0x08, 0x00, 0x9d, 0x11, 0x02, 0x00, 0x34, 0x97, 0x08, 0x00, + 0x39, 0x18, 0x02, 0x00, 0xf4, 0xa0, 0x08, 0x00, 0x65, 0x16, 0x02, 0x00, + 0x38, 0x97, 0x08, 0x00, 0x0d, 0x17, 0x02, 0x00, 0x3c, 0x97, 0x08, 0x00, + 0x65, 0x17, 0x02, 0x00, 0x4b, 0xf6, 0xd5, 0x6c, 0xc1, 0xf2, 0x12, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0xf9, 0x7c, 0xc1, 0xf2, 0x0f, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf6, 0x3d, 0x3c, 0xc1, 0xf2, 0x02, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf6, 0x09, 0x2c, 0xc1, 0xf2, 0x02, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf6, 0x21, 0x4c, 0xc1, 0xf2, 0x02, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf2, 0x45, 0x7c, 0xc1, 0xf2, 0x02, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x10, 0xb5, 0x02, 0x46, 0x22, 0x48, 0x92, 0xf8, + 0x1d, 0x31, 0x00, 0x68, 0xc3, 0xeb, 0x03, 0x13, 0x00, 0xeb, 0x43, 0x10, + 0xd0, 0xf8, 0xa0, 0x00, 0x40, 0x7f, 0x40, 0xb1, 0xd2, 0xf8, 0x00, 0x01, + 0xd0, 0xf8, 0x88, 0x00, 0x43, 0x03, 0x02, 0xd4, 0xc0, 0xf3, 0x40, 0x43, + 0x00, 0xe0, 0x01, 0x23, 0x61, 0xb1, 0x01, 0x29, 0x23, 0xd1, 0x92, 0xf8, + 0x4a, 0x11, 0x16, 0x48, 0x92, 0xf8, 0x46, 0x41, 0x30, 0xf8, 0x11, 0x00, + 0x14, 0xb3, 0xb2, 0xf8, 0x48, 0x21, 0x09, 0xe0, 0x92, 0xf8, 0x54, 0x11, + 0x10, 0x48, 0x92, 0xf8, 0x50, 0x41, 0x30, 0xf8, 0x11, 0x00, 0xbc, 0xb1, + 0xb2, 0xf8, 0x52, 0x21, 0x00, 0x2b, 0x18, 0xbf, 0x04, 0x32, 0x05, 0x29, + 0x0b, 0xd3, 0x09, 0x29, 0x09, 0xd8, 0x92, 0xb2, 0x03, 0x39, 0xd2, 0x00, + 0x01, 0x32, 0x92, 0xfb, 0xf1, 0xf1, 0x08, 0x44, 0x10, 0xbd, 0x00, 0x20, + 0x10, 0xbd, 0x05, 0x4b, 0x92, 0xb2, 0x59, 0x5c, 0x01, 0xfb, 0x02, 0x00, + 0x10, 0xbd, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, 0xb0, 0x31, 0x0a, 0x10, + 0xc4, 0x31, 0x0a, 0x10, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xb8, 0x96, 0x08, 0x00, 0x19, 0x19, 0x02, 0x00, 0x4a, 0x48, 0x00, 0x68, + 0x00, 0x47, 0x00, 0xbf, 0x70, 0xb5, 0x81, 0x79, 0xa8, 0x4d, 0x06, 0x7b, + 0x02, 0x7a, 0x43, 0x7a, 0x84, 0x7a, 0x01, 0xeb, 0x41, 0x01, 0x42, 0xea, + 0x03, 0x22, 0x55, 0xf8, 0x21, 0x10, 0x45, 0x7b, 0x42, 0xea, 0x04, 0x42, + 0x46, 0xea, 0x05, 0x25, 0x86, 0x7b, 0x45, 0xea, 0x06, 0x45, 0xc6, 0x7b, + 0xc0, 0x7a, 0x45, 0xea, 0x06, 0x65, 0x42, 0xea, 0x00, 0x60, 0xc1, 0xe9, + 0x7c, 0x05, 0x70, 0xbd, 0x10, 0xb5, 0x97, 0x49, 0x91, 0xf8, 0xb7, 0x16, + 0x49, 0x07, 0x20, 0xd5, 0x6d, 0x49, 0x91, 0xf8, 0xa5, 0x12, 0x49, 0x07, + 0x1b, 0xd5, 0x81, 0x79, 0x51, 0x48, 0x69, 0x4c, 0x90, 0xf8, 0xcd, 0x01, + 0x01, 0x29, 0x84, 0xf8, 0x3e, 0x16, 0x0a, 0xd1, 0x18, 0xb9, 0x01, 0x20, + 0x00, 0x21, 0x37, 0xf0, 0x1d, 0xf9, 0x2f, 0x48, 0x00, 0x68, 0x80, 0x47, + 0xc4, 0xf8, 0x44, 0x06, 0x04, 0xe0, 0x18, 0xb9, 0x00, 0x20, 0x00, 0x21, + 0x37, 0xf0, 0x12, 0xf9, 0x2a, 0x48, 0x80, 0x79, 0x00, 0xb1, 0x10, 0xbd, + 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x00, 0xb8, 0xb0, 0xb5, 0x86, 0xb0, + 0x58, 0x4c, 0x94, 0xf8, 0x3e, 0x06, 0x00, 0xf0, 0x49, 0xf8, 0xb8, 0x48, + 0x00, 0x68, 0x80, 0x47, 0xc8, 0xb3, 0x1e, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x03, 0x28, 0x34, 0xd1, 0x04, 0xf2, 0x3e, 0x64, 0x20, 0x78, 0xe0, 0xb1, + 0xb2, 0x48, 0x00, 0x25, 0xcd, 0xe9, 0x04, 0x55, 0x00, 0x68, 0x80, 0x47, + 0x02, 0x90, 0x19, 0x48, 0x45, 0xf2, 0x0c, 0x51, 0x10, 0x22, 0xad, 0xf8, + 0x0c, 0x10, 0x41, 0x79, 0x00, 0x7a, 0x8d, 0xf8, 0x0f, 0x00, 0x20, 0x78, + 0x01, 0x29, 0x02, 0xa9, 0x18, 0xbf, 0x28, 0x46, 0x8d, 0xf8, 0x0e, 0x00, + 0xde, 0x48, 0x03, 0x68, 0x80, 0x20, 0x98, 0x47, 0x13, 0xe0, 0xe0, 0x78, + 0x00, 0x28, 0xdf, 0xd0, 0x0a, 0x48, 0x05, 0x68, 0x0a, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x40, 0xf2, 0x64, 0x71, 0x08, 0x22, 0x24, 0x23, 0xcd, 0xe9, + 0x00, 0x01, 0x40, 0xf2, 0xe2, 0x40, 0x01, 0x21, 0xa8, 0x47, 0x00, 0x20, + 0xe0, 0x70, 0x06, 0xb0, 0xb0, 0xbd, 0x00, 0xbf, 0x3c, 0xe5, 0x08, 0x00, + 0xec, 0x9a, 0x08, 0x00, 0xe0, 0xa0, 0x08, 0x00, 0x48, 0xdc, 0x05, 0x00, + 0x10, 0xb5, 0x17, 0x49, 0x0a, 0x68, 0x60, 0xf3, 0x82, 0x02, 0x0a, 0x60, + 0x15, 0x49, 0x0a, 0x68, 0x60, 0xf3, 0x41, 0x02, 0x0a, 0x60, 0x0a, 0x68, + 0x60, 0xf3, 0x00, 0x02, 0x0a, 0x60, 0x12, 0x4a, 0x12, 0x49, 0x53, 0x78, + 0x68, 0xb1, 0x12, 0x4c, 0x12, 0x78, 0x01, 0x28, 0x64, 0x7a, 0x23, 0x44, + 0x22, 0x44, 0x0b, 0x70, 0x4a, 0x70, 0xab, 0x49, 0x89, 0x68, 0x07, 0xd1, + 0x21, 0xf0, 0x10, 0x00, 0x06, 0xe0, 0x10, 0x78, 0x0b, 0x70, 0x48, 0x70, + 0xa6, 0x48, 0x81, 0x68, 0x41, 0xf0, 0x10, 0x00, 0xa4, 0x49, 0x88, 0x60, + 0x07, 0x49, 0x09, 0x68, 0xbd, 0xe8, 0x10, 0x40, 0x08, 0x47, 0x00, 0xbf, + 0x00, 0xf4, 0x23, 0x40, 0xa8, 0x51, 0x00, 0x30, 0x00, 0x69, 0x08, 0x00, + 0x8a, 0x76, 0x01, 0x00, 0xad, 0x2f, 0x06, 0x00, 0x84, 0xe5, 0x08, 0x00, + 0x10, 0xb5, 0x13, 0x4a, 0x01, 0x21, 0x82, 0xf8, 0x4e, 0x16, 0x83, 0x79, + 0x82, 0xf8, 0x4f, 0x36, 0x01, 0x2b, 0xc1, 0x79, 0x82, 0xf8, 0x50, 0x16, + 0x04, 0x7a, 0x82, 0xf8, 0x52, 0x46, 0x40, 0x7a, 0x82, 0xf8, 0x53, 0x06, + 0x0a, 0xd1, 0x02, 0xf2, 0x4e, 0x60, 0x0a, 0x4a, 0x80, 0x88, 0x00, 0x28, + 0x08, 0xbf, 0x12, 0x20, 0x82, 0xf8, 0x7a, 0x02, 0x29, 0xb9, 0x03, 0xe0, + 0x05, 0x48, 0x12, 0x21, 0x80, 0xf8, 0x7a, 0x12, 0x28, 0x21, 0x03, 0x48, + 0x80, 0xf8, 0xfd, 0x12, 0x10, 0xbd, 0x00, 0xbf, 0x64, 0xd4, 0x05, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x47, 0x05, 0x46, 0x24, 0x48, + 0x1e, 0x46, 0x17, 0x46, 0x88, 0x46, 0x90, 0xf8, 0x33, 0x92, 0x00, 0xf2, + 0x32, 0x2a, 0x21, 0x48, 0x00, 0x78, 0x01, 0x28, 0x02, 0xd1, 0x9a, 0xf8, + 0x00, 0x00, 0x58, 0xb3, 0x00, 0x24, 0x48, 0x2e, 0x03, 0xd1, 0xff, 0xf7, + 0x0b, 0xfa, 0x1c, 0x49, 0x48, 0x60, 0x28, 0x46, 0x41, 0x46, 0x3a, 0x46, + 0x33, 0x46, 0x01, 0xf0, 0x85, 0xfb, 0x14, 0xb1, 0x00, 0x20, 0x8a, 0xf8, + 0x00, 0x00, 0x16, 0x2d, 0x16, 0xd8, 0x16, 0x49, 0x05, 0xeb, 0x45, 0x00, + 0x51, 0xf8, 0x20, 0x00, 0x80, 0xb1, 0x05, 0xeb, 0x45, 0x02, 0x01, 0xeb, + 0x82, 0x01, 0x09, 0x79, 0x01, 0x29, 0x09, 0xd1, 0x90, 0xf8, 0x88, 0x04, + 0x80, 0x07, 0x05, 0xd5, 0xb9, 0xf1, 0x01, 0x0f, 0x08, 0xbf, 0xb8, 0xf1, + 0x01, 0x0f, 0x05, 0xd0, 0xbd, 0xe8, 0xf0, 0x87, 0x01, 0x24, 0x8a, 0xf8, + 0x00, 0x40, 0xd0, 0xe7, 0x9a, 0xf8, 0x01, 0x00, 0x00, 0x28, 0xf5, 0xd1, + 0x06, 0x48, 0x01, 0x68, 0x01, 0x20, 0xbd, 0xe8, 0xf0, 0x47, 0x08, 0x47, + 0x38, 0x21, 0x01, 0x00, 0x60, 0xd4, 0x05, 0x00, 0x14, 0xf0, 0x05, 0x00, + 0xe8, 0x72, 0x01, 0x00, 0x88, 0xe5, 0x08, 0x00, 0x70, 0x47, 0x00, 0xbf, + 0xf0, 0xb5, 0x85, 0xb0, 0x04, 0x46, 0x32, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x00, 0x28, 0x5c, 0xd0, 0xce, 0x48, 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, + 0x57, 0xd1, 0x2e, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x21, 0x2d, 0x4a, + 0x01, 0x90, 0x8d, 0xf8, 0x0d, 0x10, 0x04, 0xeb, 0x44, 0x01, 0x02, 0xeb, + 0x81, 0x03, 0x12, 0xf8, 0x21, 0x10, 0xdd, 0x7a, 0x58, 0x88, 0xdf, 0x79, + 0x5a, 0x78, 0x93, 0xf8, 0x06, 0xc0, 0x01, 0xf0, 0x0f, 0x01, 0x05, 0xf0, + 0x0f, 0x05, 0xad, 0xf8, 0x0e, 0x00, 0x98, 0x88, 0x8d, 0xf8, 0x0a, 0x70, + 0x41, 0xea, 0x05, 0x15, 0x99, 0x7a, 0x8d, 0xf8, 0x0b, 0x50, 0xad, 0xf8, + 0x10, 0x00, 0x00, 0x28, 0x53, 0x48, 0x01, 0xf0, 0x0f, 0x06, 0x59, 0x7a, + 0xc4, 0xeb, 0xc4, 0x03, 0x1a, 0x4c, 0x01, 0xf0, 0x0f, 0x01, 0x64, 0x68, + 0x4f, 0xea, 0x01, 0x21, 0x41, 0xea, 0x06, 0x31, 0x44, 0xf6, 0x0c, 0x36, + 0x04, 0xeb, 0x83, 0x03, 0x4f, 0xea, 0x11, 0x21, 0xad, 0xf8, 0x08, 0x60, + 0x8d, 0xf8, 0x0c, 0x10, 0x5b, 0x7b, 0x8d, 0xf8, 0x0c, 0x10, 0x8d, 0xf8, + 0x0b, 0x50, 0xa3, 0xf1, 0x02, 0x01, 0xb1, 0xfa, 0x81, 0xf1, 0x4f, 0xea, + 0x51, 0x11, 0x4f, 0xea, 0xc1, 0x11, 0x8d, 0xf8, 0x0d, 0x10, 0x08, 0xbf, + 0x02, 0xf0, 0x0f, 0x02, 0x03, 0x68, 0x8d, 0xf8, 0x12, 0x20, 0x01, 0xa9, + 0x80, 0x20, 0x8d, 0xf8, 0x13, 0xc0, 0x10, 0x22, 0x98, 0x47, 0x05, 0xb0, + 0xf0, 0xbd, 0x00, 0xbf, 0x48, 0xe5, 0x08, 0x00, 0xa4, 0xe5, 0x08, 0x00, + 0xbc, 0xda, 0x05, 0x00, 0xec, 0xe5, 0x05, 0x00, 0xfe, 0xb5, 0x04, 0x46, + 0x00, 0x7a, 0x03, 0x28, 0x25, 0xd0, 0x0c, 0x28, 0x35, 0xd1, 0x65, 0x7a, + 0x50, 0x2d, 0x32, 0xd3, 0x97, 0x48, 0x01, 0x21, 0x08, 0x22, 0x20, 0x23, + 0x06, 0x68, 0x40, 0xf2, 0x59, 0x10, 0xcd, 0xe9, 0x00, 0x50, 0x40, 0xf2, + 0xe7, 0x40, 0xb0, 0x47, 0x5a, 0x2d, 0x24, 0xd8, 0x15, 0x4e, 0x50, 0x3d, + 0x56, 0xf8, 0x25, 0x00, 0xf8, 0xb1, 0x14, 0x48, 0x14, 0x21, 0x22, 0x46, + 0x00, 0x23, 0x07, 0x68, 0x01, 0x20, 0xb8, 0x47, 0x56, 0xf8, 0x25, 0x10, + 0x20, 0x1d, 0x03, 0xb0, 0xbd, 0xe8, 0xf0, 0x40, 0x08, 0x47, 0x0b, 0x48, + 0x80, 0x78, 0x01, 0x28, 0x0d, 0xd1, 0x85, 0x48, 0x00, 0x21, 0x04, 0x22, + 0x15, 0x23, 0x04, 0x68, 0x40, 0xf2, 0x6b, 0x10, 0xcd, 0xe9, 0x00, 0x10, + 0x40, 0xf2, 0xe1, 0x40, 0x01, 0x21, 0xa0, 0x47, 0xfe, 0xbd, 0x20, 0x46, + 0xbd, 0xe8, 0xfe, 0x40, 0x01, 0xf0, 0xa0, 0xba, 0x74, 0x2a, 0x01, 0x00, + 0x70, 0xd1, 0x05, 0x00, 0x80, 0xe5, 0x08, 0x00, 0xbf, 0xb5, 0x04, 0x46, + 0x75, 0x48, 0x0d, 0x46, 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, 0x18, 0xd1, + 0x00, 0x20, 0x02, 0x90, 0xcd, 0xe9, 0x00, 0x00, 0xa6, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x00, 0x90, 0x08, 0x48, 0x01, 0x21, 0x0c, 0x22, 0x8d, 0xf8, + 0x08, 0x50, 0x8d, 0xf8, 0x07, 0x40, 0x8d, 0xf8, 0x06, 0x10, 0x45, 0xf2, + 0x0c, 0x61, 0x03, 0x68, 0xad, 0xf8, 0x04, 0x10, 0x69, 0x46, 0x80, 0x20, + 0x98, 0x47, 0xbf, 0xbd, 0x8c, 0xe5, 0x08, 0x00, 0xfe, 0xb5, 0x04, 0x46, + 0x63, 0x48, 0x9a, 0x49, 0x00, 0x68, 0x01, 0xf2, 0x3c, 0x66, 0x80, 0x47, + 0x03, 0x28, 0x26, 0xd1, 0x60, 0x4d, 0x95, 0xf8, 0xa4, 0x02, 0xc0, 0x06, + 0x16, 0xd5, 0xa0, 0x79, 0x40, 0x07, 0x05, 0xd0, 0x20, 0x7a, 0x10, 0xf0, + 0x07, 0x00, 0x18, 0xbf, 0x01, 0x20, 0x00, 0xe0, 0x00, 0x20, 0x5a, 0x49, + 0x30, 0x70, 0x08, 0x22, 0x1f, 0x23, 0x0f, 0x68, 0x40, 0xf2, 0xa9, 0x11, + 0xcd, 0xe9, 0x00, 0x01, 0x40, 0xf2, 0xe7, 0x40, 0x01, 0x21, 0xb8, 0x47, + 0x54, 0x48, 0x90, 0xf8, 0xb7, 0x06, 0x40, 0x07, 0x44, 0xbf, 0x95, 0xf8, + 0xa5, 0x02, 0x5f, 0xea, 0x40, 0x70, 0x00, 0xf1, 0x87, 0x80, 0x20, 0x46, + 0x01, 0xf0, 0x48, 0xfa, 0x4d, 0x4f, 0x30, 0x79, 0x97, 0xf8, 0x00, 0x17, + 0x51, 0xb1, 0x68, 0xb9, 0x00, 0x20, 0x00, 0x21, 0x00, 0x22, 0x00, 0x23, + 0xcd, 0xe9, 0x00, 0x00, 0x01, 0x20, 0x32, 0xf0, 0x3b, 0xfa, 0x03, 0xe0, + 0x10, 0xb9, 0x01, 0x20, 0x32, 0xf0, 0xda, 0xf9, 0xe0, 0x7b, 0x10, 0x28, + 0x03, 0xd3, 0x44, 0x48, 0x90, 0xf8, 0xcd, 0x01, 0x60, 0xb3, 0x00, 0x22, + 0x70, 0x7c, 0x32, 0x74, 0x10, 0xb1, 0x00, 0x25, 0x02, 0x24, 0x48, 0xe0, + 0x3f, 0x4b, 0x40, 0x48, 0x40, 0x49, 0x1c, 0x68, 0x12, 0xb3, 0x44, 0xf0, + 0x70, 0x42, 0x01, 0x24, 0x01, 0x25, 0x1a, 0x60, 0x5a, 0x68, 0x42, 0xf0, + 0x40, 0x42, 0x5a, 0x60, 0xc2, 0x69, 0x42, 0xf4, 0xc0, 0x62, 0xc2, 0x61, + 0x02, 0x68, 0x42, 0xf4, 0x40, 0x72, 0x02, 0x60, 0x0a, 0x68, 0x42, 0xf0, + 0x70, 0x42, 0x0a, 0x60, 0x4a, 0x68, 0x42, 0xf0, 0x40, 0x42, 0x4a, 0x60, + 0xc1, 0x69, 0x41, 0xf4, 0xc0, 0x71, 0xc1, 0x61, 0x41, 0x6a, 0x41, 0xf4, + 0x40, 0x71, 0x21, 0xe0, 0x01, 0x22, 0xd1, 0xe7, 0x24, 0xf0, 0x70, 0x42, + 0x00, 0x25, 0x01, 0x24, 0x1a, 0x60, 0x5a, 0x68, 0x22, 0xf0, 0x40, 0x42, + 0x5a, 0x60, 0xc2, 0x69, 0x22, 0xf4, 0xc0, 0x62, 0xc2, 0x61, 0x02, 0x68, + 0x22, 0xf4, 0x40, 0x72, 0x02, 0x60, 0x0a, 0x68, 0x22, 0xf0, 0x70, 0x42, + 0x0a, 0x60, 0x4a, 0x68, 0x22, 0xf0, 0x40, 0x42, 0x4a, 0x60, 0xc1, 0x69, + 0x21, 0xf4, 0xc0, 0x71, 0xc1, 0x61, 0x41, 0x6a, 0x21, 0xf4, 0x40, 0x71, + 0x41, 0x62, 0x28, 0x46, 0x21, 0x46, 0x01, 0xf0, 0x65, 0xfc, 0x28, 0x46, + 0x21, 0x46, 0xff, 0xf7, 0x35, 0xff, 0x30, 0x78, 0x10, 0xb9, 0x97, 0xf8, + 0x00, 0x07, 0x38, 0xb1, 0x17, 0x49, 0x70, 0x78, 0x09, 0x7d, 0x88, 0x42, + 0x38, 0xbf, 0x01, 0x46, 0x31, 0x76, 0xfe, 0xbd, 0x30, 0x79, 0x78, 0xb1, + 0x70, 0x78, 0x0e, 0xe0, 0xe0, 0x7b, 0x10, 0xf0, 0x01, 0x00, 0x30, 0x71, + 0x03, 0xd0, 0x0a, 0x48, 0x00, 0x68, 0x80, 0x47, 0xb0, 0x60, 0xe0, 0x7b, + 0x00, 0xf0, 0x02, 0x00, 0xf0, 0x70, 0x6a, 0xe7, 0x7f, 0x20, 0x30, 0x76, + 0xfe, 0xbd, 0x00, 0xbf, 0x3c, 0xe5, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0xec, 0x9a, 0x08, 0x00, 0x38, 0x21, 0x01, 0x00, 0xe0, 0xa0, 0x08, 0x00, + 0x00, 0x69, 0x08, 0x00, 0x28, 0xd8, 0x05, 0x30, 0x5c, 0xc0, 0x05, 0x30, + 0x28, 0xf0, 0x05, 0x30, 0xb2, 0xd0, 0x01, 0x00, 0xf8, 0xb5, 0xe3, 0x4d, + 0x04, 0x46, 0x95, 0xf8, 0x7b, 0x62, 0xff, 0xf7, 0x09, 0xf8, 0x13, 0x4f, + 0x39, 0x68, 0x4a, 0x1c, 0x02, 0x2a, 0x07, 0xd3, 0x08, 0x1a, 0x00, 0xf5, + 0x48, 0x60, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x15, 0xd9, + 0xfe, 0xf7, 0xfa, 0xff, 0x38, 0x60, 0x20, 0x46, 0x01, 0xf0, 0x8a, 0xf9, + 0x1f, 0x48, 0x40, 0x78, 0x04, 0x28, 0x03, 0xd1, 0x08, 0x48, 0x00, 0x78, + 0x00, 0xf0, 0x12, 0xf8, 0x07, 0x48, 0x07, 0x21, 0x00, 0x78, 0xfe, 0xf7, + 0xf5, 0xff, 0x85, 0xf8, 0x7b, 0x62, 0xf8, 0xbd, 0x00, 0x20, 0x85, 0xf8, + 0x7b, 0x02, 0xe8, 0xe7, 0xec, 0xda, 0x05, 0x00, 0x9c, 0xe9, 0x01, 0x00, + 0xa5, 0x58, 0x01, 0x00, 0x1f, 0xb5, 0x04, 0x46, 0xc1, 0x48, 0x00, 0x68, + 0x80, 0x47, 0xe0, 0xb1, 0xc7, 0x48, 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, + 0x17, 0xd1, 0x0c, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x90, 0x0b, 0x48, + 0x45, 0xf2, 0x0c, 0x11, 0x8d, 0xf8, 0x06, 0x40, 0x10, 0x22, 0xad, 0xf8, + 0x04, 0x10, 0x01, 0x78, 0x8d, 0xf8, 0x07, 0x10, 0xd0, 0xe9, 0x01, 0x10, + 0xcd, 0xe9, 0x02, 0x10, 0xb9, 0x48, 0x69, 0x46, 0x03, 0x68, 0x80, 0x20, + 0x98, 0x47, 0x1f, 0xbd, 0xa4, 0xe5, 0x08, 0x00, 0x64, 0xd4, 0x05, 0x00, + 0x2d, 0xe9, 0xfe, 0x4f, 0xdf, 0xf8, 0xb0, 0xa2, 0x1a, 0xf8, 0x02, 0x0f, + 0x01, 0x38, 0xc0, 0xb2, 0x03, 0x28, 0x05, 0xd2, 0xc0, 0x00, 0x01, 0x21, + 0x21, 0xfa, 0x00, 0xf0, 0xbd, 0xe8, 0xfe, 0x8f, 0xa6, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x00, 0x28, 0x00, 0xf0, 0xb6, 0x80, 0xa4, 0x48, 0xa5, 0x49, + 0xdf, 0xf8, 0x94, 0x92, 0x72, 0xb6, 0x00, 0x68, 0x08, 0x60, 0xd9, 0xf8, + 0x00, 0x00, 0x40, 0x00, 0x01, 0x30, 0xc9, 0xf8, 0x00, 0x00, 0xa1, 0x48, + 0x90, 0xf8, 0x34, 0x02, 0x01, 0x28, 0x1a, 0xd1, 0xd9, 0xf8, 0x00, 0x00, + 0x00, 0x21, 0x00, 0x22, 0x4f, 0xf0, 0x00, 0x0b, 0x40, 0x08, 0xc9, 0xf8, + 0x00, 0x00, 0xd9, 0xf8, 0x00, 0x00, 0x80, 0xf3, 0x10, 0x88, 0x9a, 0x48, + 0x03, 0x68, 0x70, 0x20, 0x98, 0x47, 0x99, 0x48, 0x00, 0xf5, 0x05, 0x76, + 0x36, 0xf8, 0x44, 0x0f, 0xb1, 0x88, 0xc1, 0x42, 0x0e, 0xd1, 0x01, 0x25, + 0x79, 0xe0, 0x03, 0x20, 0x8a, 0xf8, 0x00, 0x00, 0xd9, 0xf8, 0x00, 0x00, + 0x40, 0x08, 0xc9, 0xf8, 0x00, 0x00, 0xd9, 0xf8, 0x00, 0x00, 0x80, 0xf3, + 0x10, 0x88, 0xfa, 0xe0, 0xe2, 0x49, 0x8e, 0x4f, 0xdf, 0xf8, 0x38, 0xb2, + 0x01, 0x20, 0x6f, 0xf0, 0x01, 0x08, 0x4c, 0x1c, 0x05, 0x46, 0x38, 0x68, + 0x80, 0x47, 0x03, 0x28, 0x02, 0xd1, 0x9a, 0xf8, 0x01, 0x00, 0xe0, 0xb1, + 0x9b, 0xf8, 0x00, 0x00, 0x01, 0x28, 0x06, 0xd1, 0x86, 0x48, 0x00, 0x78, + 0x18, 0xb1, 0x9a, 0xf8, 0x01, 0x00, 0x00, 0x28, 0x3f, 0xd0, 0xd4, 0x48, + 0x00, 0x88, 0x00, 0xeb, 0x80, 0x00, 0x08, 0xeb, 0x40, 0x00, 0xa0, 0x47, + 0x30, 0x88, 0xb1, 0x88, 0xaa, 0xb2, 0x01, 0x44, 0x68, 0x1c, 0x91, 0x42, + 0xde, 0xd8, 0x4f, 0xf0, 0x00, 0x0b, 0x05, 0x46, 0x3f, 0xe0, 0xdf, 0xf8, + 0xec, 0x81, 0x4f, 0xf0, 0x00, 0x0b, 0x42, 0xf2, 0x10, 0x77, 0x88, 0xf8, + 0x00, 0xb0, 0xbb, 0xf1, 0x03, 0x0f, 0x25, 0xd0, 0x72, 0xb6, 0xd9, 0xf8, + 0x00, 0x00, 0x40, 0x00, 0x01, 0x30, 0xc9, 0xf8, 0x00, 0x00, 0x73, 0x48, + 0x00, 0x68, 0x80, 0x47, 0xe8, 0xb1, 0x01, 0x20, 0x8a, 0xf8, 0x00, 0x00, + 0xd9, 0xf8, 0x00, 0x00, 0x40, 0x08, 0xc9, 0xf8, 0x00, 0x00, 0xd9, 0xf8, + 0x00, 0x00, 0x80, 0xf3, 0x10, 0x88, 0xba, 0x48, 0x00, 0x88, 0x78, 0x43, + 0x02, 0x38, 0xa0, 0x47, 0x98, 0xf8, 0x00, 0x00, 0x0b, 0xf1, 0x01, 0x0b, + 0x01, 0x28, 0xda, 0xd1, 0x11, 0xe0, 0x4f, 0xf0, 0x00, 0x0b, 0x0e, 0xe0, + 0x4f, 0xf0, 0x03, 0x0b, 0x0b, 0xe0, 0x03, 0x20, 0x8a, 0xf8, 0x00, 0x00, + 0xd9, 0xf8, 0x00, 0x00, 0x40, 0x08, 0xc9, 0xf8, 0x00, 0x00, 0xd9, 0xf8, + 0x00, 0x00, 0x80, 0xf3, 0x10, 0x88, 0x30, 0x88, 0xb1, 0x88, 0x08, 0x44, + 0xa9, 0xb2, 0x88, 0x42, 0x02, 0xd8, 0x57, 0x48, 0x01, 0x21, 0x01, 0x70, + 0x9a, 0xf8, 0x00, 0x00, 0x00, 0x28, 0x75, 0xd0, 0x03, 0x28, 0x00, 0xd1, + 0x7d, 0xe0, 0x70, 0x88, 0x00, 0x28, 0x5a, 0xd0, 0xa2, 0x48, 0x51, 0x4c, + 0x01, 0x25, 0x00, 0xf1, 0x01, 0x09, 0x96, 0xf8, 0x20, 0x00, 0x18, 0xb1, + 0x44, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x9b, 0x48, 0x6f, 0xf0, + 0x01, 0x01, 0x00, 0x88, 0x00, 0xeb, 0x80, 0x00, 0x01, 0xeb, 0x40, 0x00, + 0xc8, 0x47, 0x20, 0x78, 0x02, 0x28, 0x3a, 0xd0, 0x01, 0x28, 0x67, 0xd0, + 0x70, 0x88, 0x1f, 0xfa, 0x85, 0xf8, 0xb8, 0xeb, 0x50, 0x0f, 0x2d, 0xd1, + 0x43, 0x48, 0x00, 0x21, 0x00, 0x22, 0x00, 0x23, 0x07, 0x68, 0x48, 0xf2, + 0x68, 0x00, 0xb8, 0x47, 0x40, 0x48, 0x01, 0x21, 0x04, 0x22, 0x1e, 0x23, + 0x07, 0x68, 0x00, 0x20, 0x00, 0x90, 0x40, 0xf2, 0xf2, 0x20, 0x01, 0x90, + 0x40, 0xf2, 0xe1, 0x40, 0xb8, 0x47, 0xbb, 0xf1, 0x05, 0x0f, 0x15, 0xd8, + 0x5f, 0x46, 0x36, 0x48, 0x00, 0x68, 0x80, 0x47, 0xd0, 0xb3, 0x83, 0x48, + 0x42, 0xf2, 0x10, 0x71, 0x00, 0x88, 0x48, 0x43, 0x02, 0x38, 0xc8, 0x47, + 0x20, 0x78, 0x01, 0x28, 0x05, 0xd0, 0x07, 0xf1, 0x01, 0x0b, 0x05, 0x2f, + 0x5f, 0x46, 0xec, 0xd3, 0x00, 0xe0, 0xbb, 0x46, 0x70, 0x88, 0x01, 0x35, + 0x80, 0x45, 0xb2, 0xd3, 0x07, 0xe0, 0x2a, 0x48, 0x00, 0x21, 0x00, 0x22, + 0x00, 0x23, 0x04, 0x68, 0x48, 0xf2, 0x61, 0x00, 0xa0, 0x47, 0x24, 0x48, + 0x00, 0x78, 0x02, 0x28, 0x0b, 0xd0, 0x24, 0x48, 0x00, 0x21, 0x00, 0x22, + 0x00, 0x23, 0x04, 0x68, 0x48, 0xf2, 0x62, 0x00, 0xa0, 0x47, 0x6d, 0x48, + 0x81, 0x78, 0x01, 0x31, 0x81, 0x70, 0x20, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x01, 0x28, 0x07, 0xd1, 0xea, 0x48, 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, + 0x04, 0xbf, 0x01, 0x20, 0xbd, 0xe8, 0xfe, 0x8f, 0x03, 0x20, 0x8a, 0xf8, + 0x00, 0x00, 0x0e, 0x48, 0x01, 0x68, 0x01, 0x20, 0x03, 0xb0, 0xbd, 0xe8, + 0xf0, 0x4f, 0x08, 0x47, 0x12, 0x48, 0x00, 0x21, 0x00, 0x22, 0x00, 0x23, + 0x04, 0x68, 0x48, 0xf2, 0x60, 0x00, 0xa0, 0x47, 0x02, 0x20, 0xec, 0xe7, + 0x74, 0x2a, 0x01, 0x00, 0x48, 0xe5, 0x08, 0x00, 0xac, 0xfd, 0x08, 0x00, + 0xa0, 0xe9, 0x01, 0x00, 0x24, 0x36, 0x01, 0x00, 0x38, 0x21, 0x01, 0x00, + 0xa8, 0xfd, 0x08, 0x00, 0x8c, 0xe5, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0x3c, 0xe5, 0x08, 0x00, 0xa6, 0x58, 0x01, 0x00, 0xf0, 0xda, 0x05, 0x00, + 0x60, 0x14, 0x01, 0x00, 0xb0, 0xfd, 0x08, 0x00, 0x78, 0x9b, 0x08, 0x00, + 0xec, 0x9a, 0x08, 0x00, 0x90, 0xe5, 0x08, 0x00, 0xf8, 0xb5, 0xd5, 0x4d, + 0xa8, 0x78, 0x18, 0xb1, 0xbd, 0xe8, 0xf8, 0x40, 0xff, 0xf7, 0x7a, 0xbe, + 0xc5, 0x4e, 0x30, 0x68, 0x80, 0x47, 0xc5, 0x4f, 0x78, 0x60, 0xff, 0xf7, + 0x73, 0xfe, 0x04, 0x46, 0xa8, 0x78, 0x38, 0x70, 0x30, 0x68, 0x80, 0x47, + 0xb8, 0x60, 0x20, 0x46, 0xf8, 0xbd, 0x00, 0xbf, 0xf0, 0xb5, 0x85, 0xb0, + 0x05, 0x46, 0xbc, 0x48, 0x00, 0x68, 0x80, 0x47, 0xbb, 0x4e, 0xc6, 0x4f, + 0x04, 0x46, 0x01, 0x2d, 0xc6, 0xf8, 0x68, 0x01, 0xb8, 0x78, 0x70, 0x70, + 0x12, 0xd1, 0x30, 0x78, 0x01, 0x28, 0x03, 0xd0, 0x34, 0x48, 0xc0, 0x78, + 0x02, 0x28, 0x0b, 0xd3, 0x01, 0x20, 0xff, 0xf7, 0x29, 0xfe, 0x32, 0x48, + 0x44, 0xf6, 0x20, 0x61, 0x00, 0x88, 0x48, 0x43, 0x30, 0x49, 0x02, 0x38, + 0x01, 0x31, 0x88, 0x47, 0x2f, 0x48, 0x90, 0xf8, 0x34, 0x02, 0x01, 0x28, + 0x34, 0xd1, 0x02, 0x20, 0x06, 0xf2, 0x65, 0x15, 0x01, 0x94, 0x8d, 0xf8, + 0x08, 0x00, 0x00, 0x20, 0x04, 0x90, 0x96, 0xf8, 0x62, 0x01, 0x8d, 0xf8, + 0x09, 0x00, 0xb8, 0x78, 0x8d, 0xf8, 0x0a, 0x00, 0xa4, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x8d, 0xf8, 0x0b, 0x00, 0x28, 0x78, 0x14, 0x21, 0x03, 0x94, + 0x01, 0xac, 0x10, 0x23, 0x22, 0x46, 0xb0, 0xfb, 0xf1, 0xf1, 0x01, 0xeb, + 0x81, 0x01, 0xa0, 0xeb, 0x81, 0x00, 0x10, 0x21, 0x06, 0xeb, 0x00, 0x10, + 0x00, 0xf5, 0x03, 0x70, 0xfe, 0xf7, 0xd6, 0xfd, 0x28, 0x78, 0x21, 0x46, + 0x10, 0x22, 0x01, 0x30, 0x28, 0x70, 0x96, 0xf8, 0x62, 0x01, 0x01, 0x30, + 0x86, 0xf8, 0x62, 0x01, 0x94, 0x48, 0x03, 0x68, 0x80, 0x20, 0x98, 0x47, + 0x9c, 0x49, 0x00, 0x20, 0xb8, 0x70, 0x08, 0x60, 0x11, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x11, 0x48, 0x00, 0x68, 0x80, 0x47, 0x10, 0x48, 0x00, 0x68, + 0xc6, 0xf8, 0x4c, 0x01, 0x0f, 0x48, 0x00, 0x68, 0xc6, 0xf8, 0x50, 0x01, + 0x0e, 0x48, 0x00, 0x68, 0xc6, 0xf8, 0x54, 0x01, 0x0d, 0x48, 0x00, 0x68, + 0xc6, 0xf8, 0x58, 0x01, 0x0c, 0x48, 0x00, 0x68, 0xc6, 0xf8, 0x5c, 0x01, + 0x05, 0xb0, 0xf0, 0xbd, 0x9c, 0xe9, 0x01, 0x00, 0x34, 0xec, 0x01, 0x00, + 0x40, 0xec, 0x01, 0x00, 0x38, 0x21, 0x01, 0x00, 0x70, 0xe5, 0x08, 0x00, + 0x50, 0xe5, 0x08, 0x00, 0x30, 0x60, 0x00, 0x40, 0x14, 0x50, 0x00, 0x40, + 0x14, 0x60, 0x00, 0x40, 0x1c, 0x50, 0x00, 0x40, 0x1c, 0x60, 0x00, 0x40, + 0x2d, 0xe9, 0xf0, 0x41, 0x86, 0xb0, 0x0d, 0xf1, 0x04, 0x08, 0x05, 0x46, + 0x14, 0x21, 0x40, 0x46, 0x00, 0xf0, 0x1c, 0xff, 0x16, 0x4f, 0x70, 0x49, + 0x2c, 0x79, 0x6e, 0x79, 0x2a, 0x46, 0x10, 0x23, 0x38, 0x78, 0x14, 0x28, + 0x24, 0xbf, 0x00, 0x20, 0x38, 0x70, 0x01, 0xeb, 0x00, 0x10, 0x10, 0x21, + 0x0c, 0x30, 0xfe, 0xf7, 0x77, 0xfd, 0x38, 0x78, 0x0c, 0x2c, 0x00, 0xf1, + 0x01, 0x00, 0x38, 0x70, 0x08, 0xbf, 0x03, 0x2e, 0x03, 0xd0, 0x28, 0x46, + 0x00, 0xf0, 0x06, 0xff, 0x0d, 0xe0, 0x80, 0x20, 0x10, 0x21, 0x2a, 0x46, + 0x10, 0x23, 0x8d, 0xf8, 0x04, 0x00, 0x08, 0xf1, 0x04, 0x00, 0xfe, 0xf7, + 0x61, 0xfd, 0x04, 0x48, 0x01, 0x68, 0x40, 0x46, 0x88, 0x47, 0x06, 0xb0, + 0xbd, 0xe8, 0xf0, 0x81, 0xf1, 0xda, 0x05, 0x00, 0xa0, 0x9a, 0x08, 0x00, + 0xf0, 0xb5, 0x85, 0xb0, 0x9f, 0x48, 0x90, 0xf8, 0x34, 0x02, 0x01, 0x28, + 0x45, 0xd1, 0x53, 0x48, 0x00, 0x68, 0x80, 0x47, 0x52, 0x4f, 0x04, 0x46, + 0x01, 0x90, 0x00, 0x26, 0x04, 0x96, 0x8d, 0xf8, 0x08, 0x60, 0x97, 0xf8, + 0x60, 0x01, 0x8d, 0xf8, 0x09, 0x00, 0x58, 0x48, 0x80, 0x78, 0x8d, 0xf8, + 0x0a, 0x00, 0x4c, 0x48, 0x00, 0x68, 0x80, 0x47, 0x8d, 0xf8, 0x0b, 0x00, + 0x97, 0xf8, 0x65, 0x01, 0x14, 0x21, 0x01, 0xad, 0x10, 0x23, 0x03, 0x94, + 0x2a, 0x46, 0xb0, 0xfb, 0xf1, 0xf1, 0x01, 0xeb, 0x81, 0x01, 0xa0, 0xeb, + 0x81, 0x00, 0x10, 0x21, 0x07, 0xeb, 0x00, 0x10, 0x00, 0xf5, 0x03, 0x70, + 0xfe, 0xf7, 0x24, 0xfd, 0x97, 0xf8, 0x60, 0x01, 0x97, 0xf8, 0x65, 0x11, + 0x00, 0x22, 0x00, 0x23, 0x00, 0x96, 0x01, 0x24, 0x01, 0x30, 0x01, 0x31, + 0x87, 0xf8, 0x60, 0x01, 0x36, 0x48, 0x87, 0xf8, 0x65, 0x11, 0x01, 0x21, + 0x07, 0x68, 0x48, 0xf2, 0x63, 0x00, 0xb8, 0x47, 0x36, 0x48, 0x29, 0x46, + 0x10, 0x22, 0x03, 0x68, 0x80, 0x20, 0x98, 0x47, 0x09, 0xe0, 0x2f, 0x48, + 0x00, 0x24, 0x01, 0x21, 0x00, 0x22, 0x00, 0x23, 0x00, 0x94, 0x05, 0x68, + 0x48, 0xf2, 0x64, 0x00, 0xa8, 0x47, 0x20, 0x46, 0x05, 0xb0, 0xf0, 0xbd, + 0xb0, 0xb5, 0x86, 0xb0, 0x72, 0x48, 0x90, 0xf8, 0x34, 0x02, 0x01, 0x28, + 0x3d, 0xd1, 0x26, 0x48, 0x00, 0x68, 0x80, 0x47, 0x04, 0x46, 0x00, 0x20, + 0x24, 0x4d, 0x05, 0x90, 0x07, 0x20, 0x02, 0x94, 0x8d, 0xf8, 0x0c, 0x00, + 0x95, 0xf8, 0x61, 0x01, 0x8d, 0xf8, 0x0d, 0x00, 0x2a, 0x48, 0x80, 0x78, + 0x8d, 0xf8, 0x0e, 0x00, 0x1e, 0x48, 0x00, 0x68, 0x80, 0x47, 0x8d, 0xf8, + 0x0f, 0x00, 0x95, 0xf8, 0x65, 0x01, 0x14, 0x21, 0x04, 0x94, 0x02, 0xac, + 0x10, 0x23, 0x22, 0x46, 0xb0, 0xfb, 0xf1, 0xf1, 0x01, 0xeb, 0x81, 0x01, + 0xa0, 0xeb, 0x81, 0x00, 0x10, 0x21, 0x05, 0xeb, 0x00, 0x10, 0x00, 0xf5, + 0x03, 0x70, 0xfe, 0xf7, 0xc9, 0xfc, 0x95, 0xf8, 0x61, 0x01, 0x95, 0xf8, + 0x65, 0x11, 0x10, 0x22, 0x01, 0x30, 0x01, 0x31, 0x85, 0xf8, 0x61, 0x01, + 0x0e, 0x48, 0x85, 0xf8, 0x65, 0x11, 0x21, 0x46, 0x03, 0x68, 0x80, 0x20, + 0x98, 0x47, 0x01, 0x24, 0x09, 0xe0, 0x06, 0x48, 0x00, 0x24, 0x01, 0x21, + 0x00, 0x22, 0x00, 0x23, 0x00, 0x94, 0x05, 0x68, 0x48, 0xf2, 0x64, 0x00, + 0xa8, 0x47, 0x20, 0x46, 0x06, 0xb0, 0xb0, 0xbd, 0xa0, 0xa0, 0x08, 0x00, + 0xa4, 0xe5, 0x08, 0x00, 0x64, 0xd4, 0x05, 0x00, 0x3c, 0xe5, 0x08, 0x00, + 0x8c, 0xe5, 0x08, 0x00, 0x80, 0xb5, 0x08, 0x48, 0x01, 0x68, 0x49, 0xb1, + 0x05, 0x48, 0x80, 0x78, 0x03, 0x28, 0x05, 0xd1, 0x02, 0x20, 0x88, 0x47, + 0xbd, 0xe8, 0x80, 0x40, 0xff, 0xf7, 0x96, 0xbf, 0x80, 0xbd, 0x00, 0xbf, + 0x74, 0x2a, 0x01, 0x00, 0xa0, 0xe9, 0x01, 0x00, 0x70, 0xb5, 0xe4, 0x48, + 0x90, 0xf8, 0x55, 0x02, 0xd0, 0xb3, 0x39, 0x48, 0xd0, 0xf8, 0xac, 0x05, + 0x02, 0x46, 0x41, 0x79, 0x12, 0xf8, 0x04, 0x3f, 0x43, 0xea, 0x01, 0x21, + 0x93, 0x78, 0xd2, 0x78, 0x43, 0xea, 0x02, 0x22, 0x41, 0xea, 0x02, 0x41, + 0x81, 0x42, 0x29, 0xd0, 0xb1, 0x4a, 0x16, 0x4b, 0x11, 0xf8, 0x0a, 0x4c, + 0x16, 0x2c, 0x16, 0xd8, 0x04, 0xeb, 0x44, 0x05, 0x52, 0xf8, 0x25, 0x50, + 0x8d, 0xb1, 0x04, 0xeb, 0x44, 0x05, 0x02, 0xeb, 0x85, 0x05, 0x2d, 0x79, + 0x05, 0x3d, 0x01, 0x2d, 0x09, 0xd8, 0x04, 0xeb, 0xc4, 0x04, 0x03, 0xeb, + 0x44, 0x04, 0xe4, 0x79, 0x04, 0xf0, 0x03, 0x04, 0x01, 0x3c, 0x02, 0x2c, + 0x0e, 0xd3, 0x11, 0xf8, 0x04, 0x4f, 0x4d, 0x78, 0x8e, 0x78, 0xc9, 0x78, + 0x44, 0xea, 0x05, 0x24, 0x46, 0xea, 0x01, 0x21, 0x44, 0xea, 0x01, 0x41, + 0x81, 0x42, 0xd7, 0xd1, 0x00, 0x20, 0x70, 0xbd, 0x01, 0x20, 0x70, 0xbd, + 0x44, 0x28, 0x01, 0x00, 0x80, 0xb5, 0x00, 0xf0, 0xe3, 0xfd, 0xc0, 0x49, + 0x91, 0xf8, 0x7a, 0x12, 0xb0, 0xeb, 0x41, 0x0f, 0x06, 0xd9, 0x29, 0xb1, + 0x03, 0x4a, 0x92, 0xf8, 0x20, 0x20, 0x01, 0x2a, 0x08, 0xbf, 0x48, 0x00, + 0x80, 0xbd, 0x00, 0xbf, 0x8c, 0xe6, 0x05, 0x00, 0x70, 0xb5, 0x06, 0x46, + 0x0d, 0x48, 0x0d, 0x46, 0x14, 0x46, 0x90, 0xf8, 0x32, 0x12, 0x29, 0xb9, + 0x06, 0xf0, 0xfc, 0x01, 0x18, 0x29, 0x08, 0xbf, 0x01, 0x2c, 0x06, 0xd0, + 0x30, 0x46, 0x29, 0x46, 0x22, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, + 0xc3, 0xbd, 0x90, 0xf8, 0x33, 0x02, 0x00, 0x28, 0xf4, 0xd1, 0x03, 0x48, + 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0xef, 0xe7, 0x38, 0x21, 0x01, 0x00, + 0x88, 0xe5, 0x08, 0x00, 0x06, 0x28, 0x04, 0xbf, 0x01, 0x20, 0x70, 0x47, + 0xff, 0x28, 0x09, 0xd1, 0x0f, 0x20, 0x0a, 0x29, 0x07, 0xd1, 0xad, 0x2a, + 0x08, 0xbf, 0x05, 0x20, 0x01, 0x2a, 0x08, 0xbf, 0x03, 0x20, 0x70, 0x47, + 0x00, 0x20, 0x70, 0x47, 0x2d, 0xe9, 0xf8, 0x43, 0x05, 0x46, 0x55, 0x48, + 0x88, 0x46, 0x95, 0xf8, 0x1d, 0x41, 0x07, 0x68, 0x68, 0x6b, 0x82, 0x89, + 0x41, 0x89, 0x40, 0x7a, 0xff, 0xf7, 0xe0, 0xff, 0x25, 0x4a, 0x04, 0xeb, + 0x44, 0x01, 0x02, 0xeb, 0x81, 0x06, 0x02, 0xf8, 0x21, 0x00, 0x95, 0xf8, + 0x47, 0x11, 0x70, 0x78, 0x01, 0xf0, 0x0f, 0x01, 0x00, 0xf0, 0xf0, 0x00, + 0x08, 0x44, 0x70, 0x70, 0x95, 0xf8, 0x51, 0x01, 0x41, 0xea, 0x00, 0x10, + 0x70, 0x70, 0xc4, 0xeb, 0x04, 0x10, 0x07, 0xeb, 0x40, 0x17, 0xb8, 0x78, + 0xf0, 0x71, 0x19, 0x48, 0x00, 0x88, 0x08, 0xb9, 0xb5, 0xf8, 0x34, 0x01, + 0x70, 0x80, 0xb5, 0xf8, 0x36, 0x01, 0xdf, 0xf8, 0x58, 0x90, 0x16, 0x4c, + 0xb0, 0x80, 0x78, 0x78, 0xd9, 0xf8, 0x04, 0x10, 0xc0, 0xeb, 0xc0, 0x00, + 0x01, 0xeb, 0x80, 0x00, 0xd0, 0xe9, 0x04, 0x10, 0x81, 0x42, 0x38, 0xbf, + 0x01, 0x46, 0xb1, 0x71, 0x95, 0xf8, 0x4a, 0x01, 0x21, 0x68, 0x88, 0x47, + 0x70, 0x72, 0x21, 0x68, 0x95, 0xf8, 0x54, 0x01, 0x88, 0x47, 0x79, 0x78, + 0xd9, 0xf8, 0x04, 0x20, 0xb0, 0x72, 0x01, 0x20, 0x86, 0xf8, 0x0b, 0x80, + 0x30, 0x72, 0xc1, 0xeb, 0xc1, 0x01, 0x02, 0xeb, 0x81, 0x01, 0x08, 0x73, + 0xbd, 0xe8, 0xf8, 0x83, 0xbc, 0xda, 0x05, 0x00, 0x7e, 0xe5, 0x05, 0x00, + 0xec, 0xe5, 0x05, 0x00, 0x68, 0xe5, 0x08, 0x00, 0x2d, 0xe9, 0xfe, 0x43, + 0x43, 0x4c, 0x05, 0x46, 0x01, 0xeb, 0x41, 0x00, 0xdd, 0xf8, 0x30, 0x80, + 0x54, 0xf8, 0x20, 0x40, 0x0b, 0x98, 0xcd, 0xf8, 0x08, 0x80, 0x01, 0x90, + 0x0a, 0x98, 0x00, 0x90, 0x28, 0x46, 0x00, 0xf0, 0x35, 0xfd, 0x14, 0x2d, + 0x33, 0xd1, 0x1b, 0x48, 0x94, 0xf8, 0x1d, 0x11, 0xdf, 0xf8, 0x68, 0x90, + 0x00, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0xd9, 0xf8, 0x00, 0x20, 0x00, 0xeb, + 0x41, 0x15, 0x01, 0x21, 0x28, 0x46, 0x90, 0x47, 0xc1, 0x4f, 0x69, 0x78, + 0x4f, 0xf4, 0x7a, 0x76, 0xb0, 0xfb, 0xf6, 0xf0, 0x7a, 0x68, 0xc1, 0xeb, + 0xc1, 0x01, 0x02, 0xeb, 0x81, 0x01, 0xd9, 0xf8, 0x00, 0x20, 0x08, 0x61, + 0x28, 0x46, 0x00, 0x21, 0x90, 0x47, 0x69, 0x78, 0x7a, 0x68, 0xb0, 0xfb, + 0xf6, 0xf0, 0xc1, 0xeb, 0xc1, 0x01, 0x02, 0xeb, 0x81, 0x01, 0x48, 0x61, + 0x20, 0x46, 0x01, 0x21, 0xff, 0xf7, 0x5c, 0xff, 0xb8, 0xf1, 0x01, 0x0f, + 0x03, 0xd1, 0x05, 0x48, 0x4f, 0xf0, 0xff, 0x31, 0x01, 0x60, 0xbd, 0xe8, + 0xfe, 0x83, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, 0x00, 0x9e, 0x08, 0x00, + 0x6c, 0xd1, 0x05, 0x00, 0x70, 0xb5, 0x05, 0x46, 0x80, 0x79, 0x0c, 0x46, + 0x02, 0x28, 0x29, 0xd1, 0x28, 0x7a, 0x01, 0x28, 0x26, 0xd1, 0x68, 0x79, + 0x05, 0x28, 0x23, 0xd1, 0xe8, 0x79, 0x16, 0x28, 0x20, 0xd8, 0x14, 0x49, + 0x00, 0xeb, 0x40, 0x02, 0x51, 0xf8, 0x22, 0x60, 0xd6, 0xb1, 0x00, 0xeb, + 0x40, 0x00, 0x01, 0xeb, 0x80, 0x00, 0x00, 0x79, 0x01, 0x28, 0x13, 0xd1, + 0x0e, 0x48, 0x01, 0x68, 0x30, 0x46, 0x88, 0x47, 0xb0, 0xfa, 0x80, 0xf0, + 0x19, 0x21, 0x40, 0x09, 0xe8, 0x72, 0x7e, 0x48, 0x02, 0x68, 0x30, 0x46, + 0x90, 0x47, 0x28, 0xb1, 0x08, 0x48, 0x41, 0x78, 0x21, 0xf0, 0x03, 0x01, + 0xa9, 0x73, 0x41, 0x70, 0x62, 0x48, 0x29, 0x46, 0x22, 0x46, 0x03, 0x68, + 0x80, 0x20, 0xbd, 0xe8, 0x70, 0x40, 0x18, 0x47, 0xe8, 0x72, 0x01, 0x00, + 0x54, 0x9d, 0x08, 0x00, 0x50, 0x2e, 0x01, 0x00, 0x1f, 0xb5, 0xe7, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, 0x3e, 0xd1, 0xe5, 0x48, 0x00, 0x24, + 0xcd, 0xe9, 0x02, 0x44, 0xcd, 0xe9, 0x00, 0x44, 0x00, 0x68, 0x80, 0x47, + 0x00, 0x90, 0x1b, 0x48, 0x44, 0xf2, 0x0c, 0x11, 0xad, 0xf8, 0x04, 0x10, + 0x00, 0x78, 0x68, 0xb1, 0x18, 0x48, 0x90, 0xf8, 0xd4, 0x1d, 0x18, 0x48, + 0x90, 0xf8, 0xb8, 0x05, 0x00, 0x29, 0x00, 0xf0, 0x01, 0x00, 0x01, 0x46, + 0x1c, 0xbf, 0x03, 0x21, 0x01, 0x20, 0x01, 0xe0, 0x00, 0x20, 0x00, 0x21, + 0x8d, 0xf8, 0x08, 0x10, 0xa9, 0x49, 0x40, 0xea, 0x80, 0x00, 0x8d, 0xf8, + 0x09, 0x40, 0x8d, 0xf8, 0x07, 0x40, 0x91, 0xf8, 0x3e, 0x16, 0x8d, 0xf8, + 0x0a, 0x10, 0x17, 0x49, 0x09, 0x78, 0x01, 0xf0, 0x01, 0x02, 0x01, 0xf0, + 0x02, 0x01, 0x40, 0xea, 0x42, 0x00, 0x0c, 0x22, 0x40, 0xea, 0x81, 0x00, + 0x69, 0x46, 0x8d, 0xf8, 0x06, 0x00, 0x3b, 0x48, 0x03, 0x68, 0x80, 0x20, + 0x98, 0x47, 0x1f, 0xbd, 0x53, 0xf1, 0x05, 0x00, 0x00, 0x69, 0x08, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, 0xc0, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x03, 0x28, 0x0c, 0xd1, 0xe1, 0x79, 0x06, 0x4b, 0xa0, 0x79, + 0x22, 0x7a, 0x59, 0x70, 0x19, 0x78, 0x00, 0xf0, 0x03, 0x00, 0x9a, 0x70, + 0x01, 0xf0, 0xfc, 0x01, 0x08, 0x44, 0x18, 0x70, 0x10, 0xbd, 0x00, 0xbf, + 0xf2, 0xda, 0x05, 0x00, 0x7f, 0xb5, 0x00, 0x28, 0x45, 0xd0, 0x0d, 0x46, + 0x00, 0x29, 0x42, 0xd0, 0x04, 0x46, 0x00, 0x20, 0xcd, 0xe9, 0x02, 0x00, + 0xcd, 0xe9, 0x00, 0x00, 0xb0, 0x48, 0x00, 0x68, 0x80, 0x47, 0x20, 0x4e, + 0x00, 0x90, 0x45, 0xf2, 0x0c, 0x21, 0xad, 0xf8, 0x04, 0x10, 0x30, 0x78, + 0x10, 0xb1, 0x1d, 0x49, 0x09, 0x88, 0x69, 0xb3, 0x00, 0xeb, 0xc0, 0x01, + 0x6a, 0x1a, 0x1a, 0x4d, 0x93, 0xb2, 0x2a, 0x80, 0x02, 0xf0, 0x0f, 0x02, + 0x09, 0x2b, 0x4f, 0xf0, 0x09, 0x03, 0x88, 0xbf, 0x0f, 0x22, 0x42, 0xea, + 0x00, 0x10, 0x62, 0x18, 0x6c, 0x46, 0x8d, 0xf8, 0x06, 0x00, 0x09, 0x21, + 0xe0, 0x1d, 0xfe, 0xf7, 0x77, 0xfa, 0x11, 0x48, 0x21, 0x46, 0x10, 0x22, + 0x03, 0x68, 0x80, 0x20, 0x98, 0x47, 0x30, 0x78, 0x01, 0x30, 0x30, 0x70, + 0x28, 0x88, 0x08, 0x28, 0x0a, 0xd8, 0x00, 0x24, 0x2c, 0x80, 0x0b, 0x4d, + 0x34, 0x70, 0xe8, 0x7b, 0x20, 0xb1, 0x0a, 0x48, 0x01, 0x68, 0x42, 0x20, + 0x88, 0x47, 0xec, 0x73, 0x7f, 0xbd, 0x04, 0x48, 0x00, 0x21, 0x01, 0x80, + 0x01, 0x48, 0x01, 0x70, 0x7f, 0xbd, 0x00, 0xbf, 0xf5, 0xda, 0x05, 0x00, + 0xf6, 0xda, 0x05, 0x00, 0x8c, 0xe5, 0x08, 0x00, 0x90, 0xdb, 0x05, 0x00, + 0x30, 0x9d, 0x08, 0x00, 0x2d, 0xe9, 0xfe, 0x43, 0xf0, 0xb1, 0x05, 0x46, + 0x0f, 0x48, 0x1c, 0x46, 0x16, 0x46, 0x0f, 0x46, 0x00, 0x68, 0x80, 0x47, + 0xb0, 0xb1, 0x0d, 0x48, 0xdd, 0xe9, 0x0a, 0x98, 0x1a, 0x21, 0x02, 0x68, + 0x28, 0x46, 0x90, 0x47, 0x30, 0xb1, 0x95, 0xf8, 0x35, 0x11, 0xcd, 0xe9, + 0x00, 0x98, 0x28, 0x46, 0x65, 0x22, 0x04, 0xe0, 0x28, 0x46, 0x39, 0x46, + 0x32, 0x46, 0xcd, 0xe9, 0x00, 0x98, 0x23, 0x46, 0x00, 0xf0, 0xde, 0xfb, + 0xbd, 0xe8, 0xfe, 0x83, 0x48, 0xe5, 0x08, 0x00, 0x0c, 0xbb, 0x08, 0x00, + 0xf8, 0xb5, 0x04, 0x46, 0x80, 0x79, 0xe6, 0x79, 0x25, 0x7b, 0x16, 0xf0, + 0xc0, 0x0f, 0x03, 0xd0, 0x12, 0x49, 0x09, 0x68, 0x88, 0x47, 0x03, 0xe0, + 0x11, 0x49, 0x0a, 0x68, 0x00, 0x21, 0x90, 0x47, 0xd0, 0xb1, 0xf1, 0x07, + 0x18, 0xd1, 0xc6, 0xf3, 0x41, 0x02, 0xdf, 0xf8, 0x38, 0xc0, 0x04, 0xf1, + 0x08, 0x01, 0x00, 0x23, 0x92, 0x00, 0x25, 0xfa, 0x03, 0xf6, 0xf6, 0x07, + 0x09, 0xd0, 0x44, 0x78, 0xdc, 0xf8, 0x04, 0x70, 0xce, 0x5c, 0xc4, 0xeb, + 0xc4, 0x04, 0x07, 0xeb, 0x84, 0x04, 0x14, 0x44, 0xe6, 0x54, 0x01, 0x33, + 0x04, 0x2b, 0xee, 0xd1, 0xf8, 0xbd, 0x00, 0xbf, 0x10, 0xb6, 0x08, 0x00, + 0xfc, 0x9b, 0x08, 0x00, 0xec, 0xe5, 0x05, 0x00, 0x01, 0x46, 0x80, 0x79, + 0x0a, 0x7a, 0x01, 0x2a, 0x0a, 0xd0, 0x32, 0xbb, 0xc9, 0x79, 0x40, 0x28, + 0x0d, 0xd8, 0xda, 0x4a, 0x02, 0x44, 0x82, 0xf8, 0x14, 0x12, 0x26, 0x49, + 0x09, 0x68, 0x08, 0x47, 0x40, 0x28, 0x0d, 0xd8, 0xd5, 0x49, 0x01, 0x44, + 0x91, 0xf8, 0x14, 0x12, 0x11, 0xe0, 0x44, 0x28, 0x13, 0xd8, 0x1f, 0x4a, + 0x41, 0x38, 0x52, 0xfa, 0x80, 0xf0, 0x80, 0xf8, 0xec, 0x10, 0x0c, 0xe0, + 0x44, 0x28, 0x0a, 0xd8, 0x1a, 0x4a, 0xa0, 0xf1, 0x41, 0x01, 0x52, 0xfa, + 0x81, 0xf1, 0x91, 0xf8, 0xec, 0x10, 0x02, 0x4a, 0x13, 0x68, 0x02, 0x22, + 0x18, 0x47, 0x70, 0x47, 0x90, 0x96, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x41, + 0x04, 0x46, 0x41, 0x48, 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, 0x1c, 0xd1, + 0xc2, 0x4e, 0x10, 0x4f, 0xdf, 0xf8, 0x38, 0x80, 0x06, 0x34, 0x00, 0x25, + 0x20, 0x78, 0xff, 0x28, 0x13, 0xd0, 0x61, 0x78, 0x40, 0x28, 0x05, 0xd8, + 0x32, 0x18, 0x82, 0xf8, 0x14, 0x12, 0x39, 0x68, 0x88, 0x47, 0x06, 0xe0, + 0x44, 0x28, 0x9e, 0xbf, 0x41, 0x38, 0x58, 0xfa, 0x80, 0xf0, 0x80, 0xf8, + 0xec, 0x10, 0x01, 0x35, 0x02, 0x34, 0x05, 0x2d, 0xe8, 0xd1, 0xbd, 0xe8, + 0xf0, 0x81, 0x00, 0xbf, 0x04, 0x31, 0x06, 0x00, 0x8c, 0x96, 0x08, 0x00, + 0x80, 0x79, 0x02, 0x49, 0x81, 0xf8, 0x3d, 0x06, 0x70, 0x47, 0x00, 0xbf, + 0x64, 0xd4, 0x05, 0x00, 0x7f, 0xb5, 0x04, 0x46, 0x27, 0x48, 0x0d, 0x46, + 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, 0x47, 0xd1, 0x00, 0x20, 0xcd, 0xe9, + 0x02, 0x00, 0x24, 0x48, 0x00, 0x68, 0x80, 0x47, 0x43, 0xf6, 0x0c, 0x11, + 0x00, 0x90, 0x04, 0xeb, 0x44, 0x00, 0x8d, 0xf8, 0x07, 0x50, 0x8d, 0xf8, + 0x06, 0x40, 0xad, 0xf8, 0x04, 0x10, 0xa2, 0x49, 0x01, 0xeb, 0x80, 0x00, + 0x01, 0x79, 0x05, 0x29, 0x16, 0xd0, 0x01, 0x29, 0x28, 0xd1, 0x00, 0x68, + 0x30, 0xb3, 0x90, 0xf8, 0x88, 0x04, 0x80, 0x07, 0x22, 0xd5, 0x72, 0x48, + 0x72, 0x49, 0xd0, 0xe9, 0x01, 0x45, 0x20, 0x46, 0x00, 0xf0, 0x18, 0xfb, + 0x06, 0x46, 0x20, 0x46, 0x29, 0x46, 0x00, 0xf0, 0x19, 0xfb, 0x01, 0x46, + 0x30, 0x46, 0x0d, 0xe0, 0x05, 0x68, 0x8d, 0xb1, 0xd5, 0xf8, 0xac, 0x01, + 0x69, 0x49, 0x00, 0xf0, 0x09, 0xfb, 0x04, 0x46, 0x95, 0xf8, 0xb2, 0x01, + 0x00, 0xf0, 0x10, 0xfb, 0x01, 0x46, 0x20, 0x46, 0x00, 0xf0, 0x12, 0xfb, + 0x00, 0xf0, 0x16, 0xfb, 0x8d, 0xf8, 0x08, 0x00, 0xd3, 0x48, 0x69, 0x46, + 0x10, 0x22, 0x03, 0x68, 0x80, 0x20, 0x98, 0x47, 0x7f, 0xbd, 0x00, 0xbf, + 0x3c, 0xe5, 0x08, 0x00, 0xa4, 0xe5, 0x08, 0x00, 0x70, 0x47, 0x70, 0x47, + 0x70, 0x47, 0x00, 0xbf, 0x2d, 0xe9, 0xf0, 0x43, 0x85, 0xb0, 0x04, 0x46, + 0x7d, 0x48, 0x90, 0xf8, 0x55, 0x12, 0x00, 0x29, 0x00, 0xf0, 0x9a, 0x80, + 0x4e, 0x49, 0x91, 0xf8, 0x00, 0x90, 0x4e, 0x49, 0x91, 0xf8, 0xb6, 0x16, + 0x49, 0x06, 0x44, 0xbf, 0x90, 0xf8, 0xa4, 0x12, 0x5f, 0xea, 0x41, 0x61, + 0x04, 0xd4, 0x75, 0x49, 0x09, 0x78, 0x00, 0x29, 0x00, 0xf0, 0x88, 0x80, + 0x16, 0x2c, 0x22, 0xd8, 0x72, 0x48, 0x04, 0xeb, 0x44, 0x01, 0x50, 0xf8, + 0x21, 0x60, 0x00, 0x2e, 0x46, 0xd0, 0x04, 0xeb, 0x44, 0x01, 0x96, 0xf8, + 0x74, 0x90, 0x00, 0xeb, 0x81, 0x00, 0x00, 0x79, 0x05, 0x28, 0x24, 0xd1, + 0xd6, 0xf8, 0xac, 0x01, 0x41, 0x49, 0x00, 0xf0, 0xb9, 0xfa, 0x05, 0x46, + 0x96, 0xf8, 0xb2, 0x01, 0x00, 0xf0, 0xc0, 0xfa, 0x01, 0x46, 0x28, 0x46, + 0x00, 0xf0, 0xc2, 0xfa, 0x00, 0xf0, 0xc6, 0xfa, 0x96, 0xf8, 0x42, 0x51, + 0x40, 0xe0, 0xa4, 0xf1, 0x17, 0x01, 0x00, 0x26, 0x08, 0x29, 0x26, 0xd8, + 0x00, 0x25, 0x00, 0x27, 0xdf, 0xe8, 0x01, 0xf0, 0x13, 0x3a, 0x17, 0x1a, + 0x3a, 0x05, 0x1f, 0x3a, 0x05, 0x00, 0x2e, 0x48, 0x90, 0xf8, 0x4a, 0x90, + 0x18, 0xe0, 0x96, 0xf8, 0x3a, 0x50, 0x01, 0x28, 0x03, 0xd1, 0x96, 0xf8, + 0x88, 0x04, 0x80, 0x07, 0x14, 0xd4, 0x00, 0x26, 0x10, 0xe0, 0x29, 0x48, + 0x90, 0xf8, 0x50, 0x90, 0x0a, 0xe0, 0x90, 0xf8, 0xab, 0x93, 0x01, 0xe0, + 0x90, 0xf8, 0xaa, 0x93, 0x00, 0x25, 0x02, 0x26, 0x04, 0xe0, 0x22, 0x48, + 0x90, 0xf8, 0x13, 0x90, 0x00, 0x26, 0x00, 0x25, 0x00, 0x27, 0x13, 0xe0, + 0x20, 0x48, 0x21, 0x49, 0xd0, 0xe9, 0x01, 0x68, 0x30, 0x46, 0x00, 0xf0, + 0x75, 0xfa, 0x07, 0x46, 0x30, 0x46, 0x41, 0x46, 0x00, 0xf0, 0x76, 0xfa, + 0x01, 0x46, 0x38, 0x46, 0x00, 0xf0, 0x7e, 0xfa, 0x00, 0xf0, 0x82, 0xfa, + 0x07, 0x46, 0x00, 0x26, 0x86, 0x48, 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, + 0x1a, 0xd1, 0x85, 0x48, 0x00, 0x68, 0x80, 0x47, 0x01, 0x90, 0x14, 0x48, + 0x40, 0xf6, 0x0c, 0x71, 0x8d, 0xf8, 0x0a, 0x40, 0xad, 0xf8, 0x08, 0x10, + 0x31, 0x46, 0x02, 0x68, 0x48, 0x46, 0x90, 0x47, 0x8d, 0xf8, 0x0b, 0x00, + 0x7e, 0x48, 0x01, 0xa9, 0x10, 0x22, 0x8d, 0xf8, 0x0d, 0x70, 0x8d, 0xf8, + 0x0c, 0x50, 0x03, 0x68, 0x80, 0x20, 0x98, 0x47, 0x05, 0xb0, 0xbd, 0xe8, + 0xf0, 0x83, 0x00, 0xbf, 0x69, 0x34, 0x01, 0x00, 0x38, 0x21, 0x01, 0x00, + 0x04, 0x5b, 0x01, 0x00, 0x50, 0x5b, 0x01, 0x00, 0x24, 0x5c, 0x01, 0x00, + 0xac, 0x76, 0x01, 0x00, 0x00, 0x00, 0xc8, 0x42, 0x34, 0x9c, 0x08, 0x00, + 0x2d, 0xe9, 0xf0, 0x47, 0x22, 0x49, 0x21, 0x4c, 0x20, 0x78, 0x91, 0xf8, + 0x55, 0x12, 0x01, 0x30, 0x00, 0x29, 0x20, 0x70, 0x36, 0xd0, 0x1f, 0x49, + 0xc0, 0xb2, 0x09, 0x78, 0x81, 0x42, 0x2f, 0xd8, 0x71, 0xb3, 0x1d, 0x48, + 0xdf, 0xf8, 0x74, 0x90, 0xdf, 0xf8, 0x74, 0x80, 0x4f, 0xf0, 0x00, 0x0a, + 0x00, 0x27, 0x00, 0x26, 0x05, 0x1d, 0x55, 0xf8, 0x04, 0x0c, 0x84, 0xf8, + 0x00, 0xa0, 0xd0, 0xb1, 0x29, 0x78, 0x05, 0x29, 0x17, 0xd8, 0xdf, 0xe8, + 0x01, 0xf0, 0x03, 0x09, 0x03, 0x0d, 0x16, 0x10, 0x40, 0x69, 0xd9, 0xf8, + 0x00, 0x20, 0x90, 0xf9, 0x3a, 0x10, 0x0a, 0xe0, 0xd8, 0xf8, 0x2c, 0x10, + 0x81, 0x42, 0x08, 0xd0, 0x90, 0xf9, 0x3a, 0x10, 0x01, 0xe0, 0x90, 0xf9, + 0x42, 0x11, 0xd9, 0xf8, 0x00, 0x20, 0xf8, 0xb2, 0x90, 0x47, 0x01, 0x36, + 0x01, 0x37, 0x0c, 0x35, 0x17, 0x2e, 0xda, 0xd1, 0xbd, 0xe8, 0xf0, 0x87, + 0x00, 0x20, 0x20, 0x70, 0xbd, 0xe8, 0xf0, 0x87, 0x2c, 0x21, 0x01, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x2b, 0x21, 0x01, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0x74, 0x9a, 0x08, 0x00, 0x38, 0x5d, 0x01, 0x00, 0xf0, 0xb5, 0x05, 0x9c, + 0x94, 0xf8, 0x1d, 0x51, 0x94, 0xf8, 0x20, 0x61, 0x94, 0xf8, 0xb0, 0x71, + 0x1a, 0x4c, 0x24, 0x68, 0xc5, 0xeb, 0x05, 0x15, 0x76, 0x1a, 0x04, 0xeb, + 0x45, 0x14, 0x94, 0xf8, 0xc0, 0x50, 0x96, 0xfb, 0xf5, 0xf5, 0x0d, 0x44, + 0x39, 0x44, 0xee, 0xb2, 0xcf, 0xb2, 0xb7, 0x42, 0x03, 0xd9, 0xe4, 0x78, + 0x80, 0x2c, 0x88, 0xbf, 0x29, 0x46, 0x73, 0xb1, 0x0b, 0x06, 0x19, 0xd0, + 0xcb, 0xb2, 0x00, 0x24, 0x01, 0x25, 0x00, 0x21, 0x16, 0x18, 0x05, 0xfa, + 0x02, 0xf2, 0x01, 0x34, 0x11, 0x43, 0x9c, 0x42, 0x32, 0x46, 0xf7, 0xd1, + 0x0d, 0xe0, 0x08, 0x06, 0x0a, 0xd0, 0xc8, 0xb2, 0x00, 0x22, 0x01, 0x23, + 0x00, 0x21, 0x03, 0xfa, 0x02, 0xf4, 0x01, 0x32, 0x21, 0x43, 0x82, 0x42, + 0xf9, 0xd1, 0x00, 0xe0, 0x00, 0x21, 0x08, 0x46, 0xf0, 0xbd, 0x00, 0xbf, + 0xe0, 0x35, 0x01, 0x00, 0x80, 0xb5, 0x0f, 0x48, 0x90, 0xf8, 0x5f, 0x10, + 0x01, 0x29, 0x15, 0xd1, 0x90, 0xf8, 0x60, 0x00, 0x01, 0x28, 0x11, 0xd1, + 0x0b, 0x48, 0x01, 0x68, 0x14, 0x20, 0x88, 0x47, 0x50, 0xb1, 0xcb, 0x21, + 0x01, 0x70, 0x09, 0x49, 0x60, 0x31, 0x00, 0xf0, 0xab, 0xf9, 0x08, 0x48, + 0x05, 0x21, 0x00, 0x78, 0xfd, 0xf7, 0xd6, 0xff, 0x00, 0x20, 0x80, 0xbd, + 0xbd, 0xe8, 0x80, 0x40, 0x00, 0xf0, 0xa6, 0xb9, 0xd0, 0xe2, 0x05, 0x00, + 0xd4, 0x9b, 0x08, 0x00, 0x2c, 0xba, 0x01, 0x00, 0x67, 0x34, 0x01, 0x00, + 0xbf, 0xb5, 0x05, 0x46, 0x0e, 0x48, 0x74, 0x46, 0x00, 0x68, 0x80, 0x47, + 0x03, 0x28, 0x16, 0xd1, 0x0c, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x21, + 0x00, 0x90, 0x0b, 0x48, 0x8d, 0xf8, 0x06, 0x50, 0x03, 0x94, 0x10, 0x22, + 0x8d, 0xf8, 0x07, 0x10, 0x44, 0xf6, 0x0c, 0x21, 0xad, 0xf8, 0x04, 0x10, + 0x69, 0x46, 0x00, 0x68, 0x02, 0x90, 0x05, 0x48, 0x03, 0x68, 0x80, 0x20, + 0x98, 0x47, 0xbf, 0xbd, 0x3c, 0xe5, 0x08, 0x00, 0xa4, 0xe5, 0x08, 0x00, + 0x24, 0x20, 0x00, 0x40, 0x8c, 0xe5, 0x08, 0x00, 0xf1, 0x20, 0xff, 0xf7, + 0xd5, 0xbf, 0x00, 0xbf, 0x10, 0xb5, 0x14, 0x46, 0x0a, 0x46, 0x21, 0x78, + 0xa0, 0x29, 0x01, 0xd0, 0x70, 0x29, 0x13, 0xd1, 0x0c, 0x49, 0x89, 0x78, + 0x01, 0xf0, 0xfe, 0x01, 0x02, 0x29, 0x0d, 0xd1, 0x0a, 0x49, 0x4f, 0xf4, + 0x84, 0x60, 0x00, 0x2b, 0x23, 0x46, 0x08, 0xbf, 0x4f, 0xf4, 0x82, 0x60, + 0xd1, 0xf8, 0x00, 0xc0, 0x00, 0x21, 0xbd, 0xe8, 0x10, 0x40, 0x60, 0x47, + 0x11, 0x46, 0x22, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x56, 0xb9, + 0x74, 0x2a, 0x01, 0x00, 0xe8, 0x9a, 0x08, 0x00, 0x80, 0xb5, 0x07, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x06, 0x48, 0x00, 0x68, 0x80, 0x47, 0x06, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x05, 0x48, 0x00, 0x68, 0xbd, 0xe8, 0x80, 0x40, + 0x00, 0x47, 0x00, 0xbf, 0x8c, 0x92, 0x08, 0x00, 0x94, 0x92, 0x08, 0x00, + 0x98, 0x92, 0x08, 0x00, 0x90, 0x92, 0x08, 0x00, 0x03, 0x49, 0x91, 0xf8, + 0xe5, 0x10, 0x09, 0xb1, 0x00, 0xf0, 0x3a, 0xb9, 0x70, 0x47, 0x00, 0xbf, + 0xe8, 0x65, 0x08, 0x00, 0x2d, 0x48, 0x2e, 0x49, 0x2f, 0x4a, 0xc0, 0xf8, + 0x98, 0x10, 0x2d, 0x49, 0x0a, 0x60, 0x2e, 0x49, 0x2f, 0x4a, 0x81, 0x60, + 0x2d, 0x49, 0x0a, 0x60, 0x2e, 0x49, 0x2f, 0x4a, 0x0a, 0x60, 0x2f, 0x49, + 0x2f, 0x4a, 0x0a, 0x60, 0x2f, 0x49, 0x30, 0x4a, 0x0a, 0x60, 0x30, 0x49, + 0x30, 0x4a, 0x0a, 0x60, 0x30, 0x49, 0x31, 0x4a, 0x0a, 0x60, 0x31, 0x49, + 0x31, 0x4a, 0x0a, 0x60, 0x31, 0x49, 0x33, 0x4a, 0xc0, 0xf8, 0x08, 0x11, + 0x30, 0x49, 0x0a, 0x60, 0x31, 0x49, 0x33, 0x4a, 0xc0, 0xf8, 0x18, 0x11, + 0x30, 0x49, 0x0a, 0x60, 0x31, 0x49, 0x32, 0x4a, 0x0a, 0x60, 0x32, 0x49, + 0x35, 0x4a, 0xc0, 0xf8, 0xf4, 0x10, 0x31, 0x49, 0x41, 0x62, 0x31, 0x49, + 0xc0, 0xf8, 0xdc, 0x10, 0x30, 0x49, 0x0a, 0x60, 0x31, 0x49, 0x32, 0x4a, + 0x0a, 0x60, 0x32, 0x49, 0x32, 0x4a, 0x0a, 0x60, 0x32, 0x49, 0x33, 0x4a, + 0x0a, 0x60, 0x33, 0x49, 0x33, 0x4a, 0x0a, 0x60, 0x33, 0x49, 0x34, 0x4a, + 0x0a, 0x60, 0x34, 0x49, 0x34, 0x4a, 0x0a, 0x60, 0x34, 0x49, 0x35, 0x4a, + 0x0a, 0x60, 0x35, 0x49, 0x35, 0x4a, 0x0a, 0x60, 0x35, 0x49, 0x36, 0x4a, + 0x0a, 0x60, 0x36, 0x49, 0x36, 0x4a, 0x0a, 0x60, 0x36, 0x49, 0x37, 0x4a, + 0x0a, 0x60, 0x37, 0x49, 0x01, 0x61, 0x70, 0x47, 0x30, 0x99, 0x08, 0x00, + 0x39, 0x1e, 0x02, 0x00, 0x04, 0xa1, 0x08, 0x00, 0xd1, 0x1b, 0x02, 0x00, + 0xf5, 0x1f, 0x02, 0x00, 0x84, 0x9a, 0x08, 0x00, 0xa9, 0x23, 0x02, 0x00, + 0xa8, 0x9a, 0x08, 0x00, 0xfd, 0x24, 0x02, 0x00, 0x78, 0xe5, 0x08, 0x00, + 0xe1, 0x26, 0x02, 0x00, 0x70, 0xcf, 0x08, 0x00, 0x95, 0x27, 0x02, 0x00, + 0xfc, 0xa0, 0x08, 0x00, 0xbd, 0x27, 0x02, 0x00, 0x24, 0xce, 0x08, 0x00, + 0x8d, 0x29, 0x02, 0x00, 0x18, 0xc3, 0x08, 0x00, 0x09, 0x2a, 0x02, 0x00, + 0xa1, 0x2a, 0x02, 0x00, 0x2c, 0xce, 0x08, 0x00, 0x85, 0x2b, 0x02, 0x00, + 0xd5, 0x2b, 0x02, 0x00, 0xd4, 0xb6, 0x08, 0x00, 0x7d, 0x1c, 0x02, 0x00, + 0xa0, 0x9a, 0x08, 0x00, 0x61, 0x1d, 0x02, 0x00, 0x9d, 0x2c, 0x02, 0x00, + 0x3d, 0x2c, 0x02, 0x00, 0xf5, 0x2c, 0x02, 0x00, 0x74, 0x9a, 0x08, 0x00, + 0x05, 0x2d, 0x02, 0x00, 0x5c, 0xe5, 0x08, 0x00, 0xb1, 0x2d, 0x02, 0x00, + 0xd4, 0x9a, 0x08, 0x00, 0xe9, 0x28, 0x02, 0x00, 0x60, 0xe5, 0x08, 0x00, + 0xb3, 0x2d, 0x02, 0x00, 0x64, 0xe5, 0x08, 0x00, 0xb5, 0x2d, 0x02, 0x00, + 0x30, 0xd9, 0x08, 0x00, 0xb9, 0x2d, 0x02, 0x00, 0xac, 0xca, 0x08, 0x00, + 0x29, 0x2f, 0x02, 0x00, 0x70, 0xd2, 0x08, 0x00, 0xcd, 0x2f, 0x02, 0x00, + 0x94, 0xb7, 0x08, 0x00, 0x4d, 0x30, 0x02, 0x00, 0xb0, 0xfd, 0x08, 0x00, + 0x75, 0x25, 0x02, 0x00, 0x80, 0xe5, 0x08, 0x00, 0xf5, 0x30, 0x02, 0x00, + 0x88, 0x9f, 0x08, 0x00, 0x41, 0x31, 0x02, 0x00, 0x71, 0x31, 0x02, 0x00, + 0x47, 0xf2, 0x09, 0x7c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x46, 0xf6, 0x19, 0x1c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x46, 0xf2, 0xb1, 0x1c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x44, 0xf2, 0x91, 0x4c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf2, 0xc7, 0x4c, 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x46, 0xf6, 0x75, 0x0c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x47, 0xf6, 0xb5, 0x1c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x46, 0xf6, 0xe9, 0x5c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x45, 0xf2, 0xe1, 0x4c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x45, 0xf6, 0x61, 0x3c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4c, 0xf2, 0xf9, 0x1c, 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf6, 0x59, 0x1c, 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf6, 0x7f, 0x6c, 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf6, 0x8d, 0x3c, 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf6, 0x11, 0x5c, 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf6, 0x85, 0x6c, 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x47, 0xf2, 0xf9, 0x3c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x48, 0xf6, 0xad, 0x4c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x45, 0xf6, 0x89, 0x6c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xbc, 0xb5, 0xb9, 0x49, 0x14, 0x46, 0x91, 0xf8, 0xcb, 0x22, 0x52, 0x07, + 0x3f, 0xd5, 0x62, 0x7a, 0x74, 0x23, 0x00, 0x2a, 0x08, 0xbf, 0x3a, 0x23, + 0xc2, 0x5c, 0x1d, 0x4b, 0xa2, 0x72, 0x90, 0xf8, 0xf3, 0x22, 0x90, 0xf8, + 0x3e, 0x03, 0x33, 0xf8, 0x12, 0x20, 0x01, 0xf2, 0x4d, 0x23, 0xc0, 0x07, + 0x62, 0x61, 0x08, 0xbf, 0x01, 0xf5, 0x0c, 0x73, 0x18, 0x78, 0xe0, 0x72, + 0x20, 0x68, 0x10, 0x44, 0x60, 0x60, 0x14, 0x48, 0x00, 0x68, 0x80, 0x47, + 0xa8, 0xb1, 0x05, 0x46, 0x50, 0xf8, 0x08, 0x0c, 0x22, 0x46, 0x38, 0x23, + 0x01, 0x89, 0x28, 0x46, 0xfd, 0xf7, 0xe4, 0xfd, 0x0e, 0x48, 0x00, 0xf5, + 0x90, 0x71, 0x28, 0x46, 0xff, 0xf7, 0xb4, 0xff, 0xa4, 0x48, 0x15, 0x21, + 0x00, 0x78, 0xbd, 0xe8, 0xbc, 0x40, 0xfd, 0xf7, 0xdd, 0xbd, 0x09, 0x48, + 0x00, 0x21, 0x04, 0x22, 0x03, 0x23, 0x04, 0x68, 0x7b, 0x20, 0xcd, 0xe9, + 0x00, 0x10, 0x40, 0xf2, 0xe1, 0x40, 0x01, 0x21, 0xa0, 0x47, 0xbc, 0xbd, + 0xb0, 0x31, 0x0a, 0x10, 0xe8, 0x9b, 0x08, 0x00, 0x2c, 0xba, 0x01, 0x00, + 0xec, 0x9a, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x47, 0x92, 0xb0, 0x0f, 0x46, + 0x06, 0x46, 0x01, 0xa8, 0x38, 0x21, 0x1c, 0x46, 0x15, 0x46, 0xff, 0xf7, + 0x4b, 0xff, 0x8c, 0x48, 0x90, 0xf8, 0xca, 0x02, 0x18, 0xb1, 0x07, 0x2d, + 0x98, 0xbf, 0x16, 0x2e, 0x02, 0xd9, 0x12, 0xb0, 0xbd, 0xe8, 0xf0, 0x87, + 0x88, 0x48, 0x06, 0xeb, 0x46, 0x01, 0x50, 0xf8, 0x21, 0x80, 0xb8, 0xf1, + 0x00, 0x0f, 0xf4, 0xd0, 0x06, 0xeb, 0x46, 0x01, 0x00, 0xeb, 0x81, 0x00, + 0x00, 0x79, 0x41, 0x1f, 0x02, 0x29, 0x06, 0xd3, 0x03, 0x28, 0x01, 0xd0, + 0x01, 0x28, 0xe8, 0xd1, 0x08, 0xf1, 0xd4, 0x00, 0x08, 0xe0, 0x22, 0x48, + 0x98, 0xf8, 0x1d, 0x11, 0x00, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, + 0x41, 0x10, 0xa0, 0x30, 0xd0, 0xf8, 0x00, 0xa0, 0xba, 0xf1, 0x00, 0x0f, + 0xd7, 0xd0, 0x1c, 0x48, 0xd7, 0xf8, 0x00, 0x90, 0x10, 0xaa, 0x0f, 0xab, + 0x40, 0x69, 0x50, 0x45, 0x11, 0xbf, 0x0a, 0xf1, 0x14, 0x00, 0xd7, 0xe9, + 0x02, 0x01, 0xcd, 0xe9, 0x10, 0x01, 0x00, 0x20, 0x15, 0x49, 0x0f, 0x68, + 0x49, 0x46, 0xb8, 0x47, 0x00, 0x28, 0xc2, 0xd0, 0x10, 0x98, 0x01, 0xaa, + 0x49, 0x46, 0x23, 0x46, 0x8d, 0xf8, 0x10, 0x60, 0x09, 0x90, 0xbd, 0xf8, + 0x44, 0x00, 0xad, 0xf8, 0x28, 0x00, 0x00, 0x20, 0x0e, 0x90, 0xad, 0xf8, + 0x16, 0x00, 0x0d, 0x90, 0x0e, 0x20, 0x8d, 0xf8, 0x0c, 0x00, 0x0f, 0x98, + 0x01, 0x90, 0x9a, 0xf8, 0x1d, 0x00, 0xb0, 0xfa, 0x80, 0xf0, 0x40, 0x09, + 0x8d, 0xf8, 0x0d, 0x00, 0x6a, 0x48, 0x50, 0xf8, 0x25, 0x50, 0x40, 0x46, + 0xa8, 0x47, 0xa0, 0xe7, 0xe0, 0x35, 0x01, 0x00, 0xfc, 0x73, 0x01, 0x00, + 0x18, 0x97, 0x08, 0x00, 0x2d, 0xe9, 0xfc, 0x47, 0x54, 0x4d, 0x04, 0x46, + 0x0a, 0x98, 0x4f, 0xea, 0x13, 0x68, 0x91, 0x42, 0x08, 0xbf, 0xb8, 0xf1, + 0x00, 0x0f, 0x05, 0xf2, 0x73, 0x2a, 0x00, 0xf0, 0x9a, 0x80, 0xc7, 0xb2, + 0x05, 0xf2, 0xac, 0x55, 0x16, 0x2f, 0x15, 0xd8, 0xdf, 0xf8, 0x34, 0xc1, + 0x07, 0xeb, 0x47, 0x07, 0x5c, 0xf8, 0x27, 0x60, 0x06, 0xb3, 0x0c, 0xeb, + 0x87, 0x06, 0x05, 0xf1, 0x0a, 0x09, 0x05, 0xf1, 0x08, 0x0c, 0x05, 0xf1, + 0x06, 0x0e, 0x37, 0x79, 0x03, 0x2f, 0x1a, 0xd0, 0x7e, 0x1f, 0x02, 0x2e, + 0x12, 0xd2, 0x16, 0xe0, 0xa7, 0xf1, 0x19, 0x06, 0x05, 0xf1, 0x0a, 0x09, + 0x05, 0xf1, 0x08, 0x0c, 0x05, 0xf1, 0x06, 0x0e, 0x02, 0x2e, 0x0c, 0xd3, + 0x2c, 0x2f, 0x05, 0xd3, 0x3b, 0x4e, 0x96, 0xf8, 0xc3, 0x61, 0x2c, 0x36, + 0xb7, 0x42, 0x04, 0xd9, 0x05, 0xf1, 0x04, 0x09, 0x05, 0xf1, 0x02, 0x0c, + 0x00, 0xe0, 0x75, 0x46, 0xb9, 0xf8, 0x00, 0x60, 0x31, 0x44, 0x03, 0xf4, + 0x7f, 0x46, 0x64, 0x39, 0xb6, 0xf5, 0x80, 0x7f, 0x0a, 0xd1, 0x9a, 0xf8, + 0x59, 0x50, 0x9a, 0xf8, 0x5b, 0x60, 0x49, 0x1b, 0x21, 0x60, 0xbc, 0xf8, + 0x00, 0x10, 0x11, 0x44, 0x31, 0x44, 0x08, 0xe0, 0x9a, 0xf8, 0x5a, 0x60, + 0x9a, 0xf8, 0x5c, 0x70, 0x89, 0x1b, 0x21, 0x60, 0x29, 0x88, 0x11, 0x44, + 0x39, 0x44, 0x61, 0x60, 0x00, 0xf0, 0x7f, 0x41, 0xe1, 0x60, 0x06, 0x21, + 0x01, 0xea, 0xd0, 0x12, 0x4f, 0xf0, 0xff, 0x61, 0x01, 0xea, 0xc3, 0x01, + 0x41, 0xea, 0x03, 0x71, 0x41, 0xea, 0xc8, 0x25, 0xc1, 0xb2, 0xc0, 0xf3, + 0x00, 0x40, 0x45, 0xea, 0xc1, 0x05, 0x2a, 0x44, 0x9a, 0xf8, 0x00, 0x50, + 0x10, 0x44, 0x4f, 0xf0, 0x00, 0x62, 0x00, 0x2d, 0x08, 0xbf, 0x02, 0xea, + 0xc3, 0x42, 0x10, 0x44, 0x19, 0x4a, 0xa0, 0x60, 0x12, 0x78, 0x91, 0x42, + 0x06, 0xd3, 0x08, 0x32, 0x91, 0x42, 0x03, 0xd2, 0x16, 0x49, 0xc9, 0x78, + 0x08, 0x43, 0xa0, 0x60, 0x15, 0x48, 0x11, 0x21, 0x00, 0x78, 0xfd, 0xf7, + 0xc1, 0xfc, 0x9a, 0xf8, 0x30, 0x00, 0xa0, 0xb1, 0xff, 0x28, 0x01, 0xd0, + 0x80, 0x45, 0x10, 0xd1, 0x10, 0x48, 0x01, 0x21, 0x00, 0x22, 0x23, 0x46, + 0x05, 0x68, 0x10, 0x20, 0x00, 0x90, 0x40, 0xf2, 0xfd, 0x40, 0xa8, 0x47, + 0x0c, 0x48, 0x12, 0x21, 0x00, 0x78, 0xbd, 0xe8, 0xfc, 0x47, 0xfd, 0xf7, + 0xa9, 0xbc, 0xbd, 0xe8, 0xfc, 0x87, 0x21, 0x60, 0xb4, 0xe7, 0x00, 0xbf, + 0x8c, 0x7e, 0x08, 0x00, 0xe8, 0x65, 0x08, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0x14, 0x01, 0x01, 0x00, 0x30, 0x72, 0x01, 0x00, 0xa5, 0x58, 0x01, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0x66, 0x34, 0x01, 0x00, 0x04, 0x48, 0x05, 0x49, + 0x01, 0x60, 0x05, 0x48, 0x05, 0x49, 0xc1, 0x60, 0x05, 0x48, 0x06, 0x49, + 0x01, 0x60, 0x70, 0x47, 0xc8, 0x98, 0x08, 0x00, 0x9d, 0x34, 0x02, 0x00, + 0xa0, 0x98, 0x08, 0x00, 0xfd, 0x33, 0x02, 0x00, 0x4c, 0xe5, 0x08, 0x00, + 0x8d, 0x35, 0x02, 0x00, 0x2d, 0xe9, 0xfe, 0x4f, 0x32, 0x48, 0x90, 0xf8, + 0x55, 0x02, 0x38, 0xb3, 0xdf, 0xf8, 0xc4, 0x80, 0xdf, 0xf8, 0xc4, 0xa0, + 0x7c, 0x4e, 0x00, 0x27, 0x4f, 0xf0, 0x10, 0x0b, 0x08, 0xf5, 0x7d, 0x79, + 0x4d, 0x46, 0x28, 0x68, 0x68, 0xb1, 0xda, 0xf8, 0x00, 0x40, 0x40, 0xf2, + 0x12, 0x40, 0x00, 0x21, 0x00, 0x22, 0x2b, 0x46, 0xcd, 0xf8, 0x00, 0xb0, + 0xa0, 0x47, 0x30, 0x78, 0x12, 0x21, 0xfd, 0xf7, 0x5d, 0xfc, 0x01, 0x37, + 0x10, 0x35, 0x0a, 0x2f, 0xeb, 0xd1, 0x48, 0x46, 0xa0, 0x21, 0xff, 0xf7, + 0xe3, 0xfd, 0x00, 0xf0, 0x95, 0xf9, 0x86, 0x48, 0x01, 0x78, 0x09, 0xb1, + 0xbd, 0xe8, 0xfe, 0x8f, 0x98, 0xf8, 0x3e, 0x16, 0x01, 0x29, 0xf9, 0xd1, + 0x40, 0x79, 0x01, 0x28, 0xf6, 0xd1, 0x94, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x04, 0x28, 0xf1, 0xd1, 0xa9, 0x48, 0x08, 0xf2, 0x3e, 0x64, 0x00, 0x68, + 0x80, 0x47, 0xd4, 0xf8, 0x06, 0x10, 0x40, 0x1a, 0x14, 0x49, 0x08, 0x44, + 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0xe2, 0xd8, 0x79, 0x48, + 0x90, 0xf8, 0xcd, 0x01, 0x18, 0xb9, 0x00, 0x20, 0x00, 0x21, 0x35, 0xf0, + 0x4f, 0xfa, 0x00, 0x20, 0x00, 0x25, 0xfe, 0xf7, 0x91, 0xf9, 0x74, 0x48, + 0x25, 0x70, 0x99, 0x21, 0x08, 0x22, 0x23, 0x23, 0x05, 0x68, 0xd4, 0xf8, + 0x06, 0x00, 0xcd, 0xe9, 0x00, 0x01, 0x40, 0xf2, 0xe7, 0x40, 0x01, 0x21, + 0xa8, 0x47, 0xbd, 0xe8, 0xfe, 0x8f, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, + 0x64, 0xd4, 0x05, 0x00, 0xa0, 0xa0, 0x08, 0x00, 0x80, 0xc1, 0xff, 0x0f, + 0x01, 0x28, 0x14, 0xd1, 0x0b, 0x48, 0x00, 0x78, 0x00, 0xea, 0x50, 0x00, + 0xc0, 0x07, 0x0e, 0xd1, 0x75, 0x48, 0x90, 0xf8, 0xb4, 0x16, 0x51, 0xb1, + 0x90, 0xf8, 0x34, 0x12, 0x39, 0xb1, 0x90, 0xf8, 0x2f, 0x12, 0x11, 0xb9, + 0x90, 0xf8, 0x30, 0x02, 0x08, 0xb1, 0x00, 0x20, 0x70, 0x47, 0x01, 0x20, + 0x70, 0x47, 0x00, 0xbf, 0xf2, 0xda, 0x05, 0x00, 0x7c, 0xb5, 0x05, 0x46, + 0x58, 0x48, 0x0c, 0x46, 0x06, 0x68, 0x08, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x45, 0xea, 0x04, 0x22, 0xe5, 0x21, 0x22, 0x23, 0x42, 0xea, 0x00, 0x40, + 0x08, 0x22, 0xcd, 0xe9, 0x00, 0x01, 0x40, 0xf2, 0xe7, 0x40, 0x01, 0x21, + 0xb0, 0x47, 0x7c, 0xbd, 0xa4, 0xe5, 0x08, 0x00, 0x1c, 0xb5, 0x00, 0xf0, + 0x1f, 0xf9, 0x49, 0x48, 0x7f, 0x21, 0x00, 0x24, 0x80, 0xf8, 0x54, 0x16, + 0x80, 0xf8, 0x3d, 0x16, 0x23, 0x48, 0x04, 0x60, 0x00, 0x20, 0xfe, 0xf7, + 0x35, 0xf9, 0x22, 0x48, 0x22, 0x4a, 0x90, 0xf8, 0xf4, 0x30, 0x00, 0xf1, + 0xf0, 0x01, 0x21, 0x48, 0x13, 0xb3, 0x53, 0x6b, 0xb4, 0xeb, 0x93, 0x5f, + 0x03, 0xd1, 0x53, 0x6b, 0x1e, 0x4c, 0x23, 0x42, 0x04, 0xd0, 0x53, 0x6b, + 0x1d, 0x4c, 0xb4, 0xeb, 0x13, 0x3f, 0x15, 0xd1, 0x13, 0x68, 0x43, 0xf0, + 0x01, 0x03, 0x13, 0x60, 0x53, 0x68, 0x43, 0xf0, 0x00, 0x43, 0x53, 0x60, + 0x0b, 0x88, 0x54, 0x6b, 0x6f, 0xf3, 0x9f, 0x54, 0x44, 0xea, 0x83, 0x53, + 0x53, 0x63, 0x01, 0x23, 0x03, 0x72, 0x4b, 0x88, 0x54, 0x6b, 0x63, 0xf3, + 0x15, 0x34, 0x54, 0x63, 0x09, 0x68, 0x0e, 0x4b, 0x41, 0x60, 0x51, 0x6b, + 0x40, 0xf6, 0xff, 0x72, 0x91, 0x43, 0x00, 0x22, 0x01, 0x60, 0x0d, 0x48, + 0x01, 0x21, 0x04, 0x68, 0x0c, 0x20, 0x00, 0x90, 0x40, 0xf2, 0x74, 0x40, + 0xa0, 0x47, 0x0a, 0x48, 0x12, 0x21, 0x00, 0x78, 0xbd, 0xe8, 0x1c, 0x40, + 0xfd, 0xf7, 0x88, 0xbb, 0xec, 0xda, 0x05, 0x00, 0x04, 0x31, 0x06, 0x00, + 0x84, 0x48, 0x05, 0x30, 0x00, 0xdb, 0x05, 0x00, 0x00, 0xf0, 0x3f, 0x00, + 0x60, 0x81, 0x05, 0x00, 0xa0, 0xa0, 0x08, 0x00, 0x66, 0x34, 0x01, 0x00, + 0x7c, 0xb5, 0x00, 0xf0, 0xc3, 0xf8, 0x17, 0x48, 0x01, 0x78, 0x01, 0xb1, + 0x7c, 0xbd, 0x16, 0x4c, 0x94, 0xf8, 0x3e, 0x16, 0x01, 0x29, 0xf9, 0xd1, + 0x40, 0x79, 0x01, 0x28, 0xf6, 0xd1, 0x13, 0x4d, 0x28, 0x68, 0x00, 0x07, + 0xf2, 0xd4, 0x12, 0x48, 0x90, 0xf8, 0xcd, 0x01, 0x18, 0xb9, 0x00, 0x20, + 0x00, 0x21, 0x35, 0xf0, 0x81, 0xf9, 0x00, 0x20, 0x00, 0x26, 0xfe, 0xf7, + 0xc3, 0xf8, 0x01, 0x20, 0x84, 0xf8, 0x3e, 0x66, 0x4f, 0xf4, 0x9c, 0x71, + 0x08, 0x22, 0x25, 0x23, 0x84, 0xf8, 0x41, 0x06, 0x08, 0x48, 0x04, 0x68, + 0x28, 0x68, 0xcd, 0xe9, 0x00, 0x01, 0x40, 0xf2, 0xe2, 0x40, 0x01, 0x21, + 0xa0, 0x47, 0x7c, 0xbd, 0x48, 0xdc, 0x05, 0x00, 0x64, 0xd4, 0x05, 0x00, + 0xac, 0x41, 0x05, 0x30, 0x00, 0x69, 0x08, 0x00, 0xec, 0x9a, 0x08, 0x00, + 0x70, 0xb5, 0x0e, 0x4e, 0x30, 0x68, 0x80, 0x47, 0x05, 0x46, 0x00, 0xf0, + 0x89, 0xf8, 0x04, 0x46, 0x01, 0x2d, 0x10, 0xd1, 0x30, 0x68, 0x80, 0x47, + 0x03, 0x28, 0x0c, 0xd1, 0x08, 0x48, 0x00, 0x7c, 0x48, 0xb9, 0x08, 0x48, + 0x02, 0x21, 0x00, 0x22, 0x80, 0xf8, 0xb4, 0x16, 0x06, 0x48, 0x00, 0x21, + 0x03, 0x68, 0x70, 0x20, 0x98, 0x47, 0x20, 0x46, 0x70, 0xbd, 0x00, 0xbf, + 0x3c, 0xe5, 0x08, 0x00, 0x4c, 0x01, 0x01, 0x00, 0x38, 0x21, 0x01, 0x00, + 0x8c, 0xe5, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0x07, 0x46, 0x0f, 0x48, + 0x00, 0x7a, 0x40, 0x06, 0x17, 0xd5, 0x0e, 0x48, 0x1c, 0x46, 0x15, 0x46, + 0x0e, 0x46, 0x00, 0x68, 0x80, 0x47, 0x80, 0xb1, 0x0b, 0x48, 0xd0, 0xf8, + 0x00, 0x80, 0x0b, 0x48, 0x00, 0x68, 0x80, 0x47, 0xc0, 0x47, 0x0a, 0x48, + 0x31, 0x46, 0x2a, 0x46, 0x23, 0x46, 0xd0, 0xf8, 0x00, 0xc0, 0x38, 0x46, + 0xbd, 0xe8, 0xf0, 0x41, 0x60, 0x47, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, + 0x74, 0x2a, 0x01, 0x00, 0x48, 0xe5, 0x08, 0x00, 0x2c, 0x97, 0x08, 0x00, + 0xe0, 0xa0, 0x08, 0x00, 0xc8, 0x98, 0x08, 0x00, 0x09, 0x48, 0x0a, 0x49, + 0x01, 0x60, 0x0a, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, 0x0b, 0x49, + 0x01, 0x60, 0x0b, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0c, 0x49, + 0x01, 0x60, 0x0c, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0xcc, 0xbd, 0x08, 0x00, 0x11, 0x38, 0x02, 0x00, 0xa8, 0xca, 0x08, 0x00, + 0x31, 0x37, 0x02, 0x00, 0x7c, 0x96, 0x08, 0x00, 0x79, 0x38, 0x02, 0x00, + 0xa0, 0x92, 0x08, 0x00, 0x3d, 0x39, 0x02, 0x00, 0x40, 0xe5, 0x08, 0x00, + 0xb5, 0x39, 0x02, 0x00, 0x6c, 0xd2, 0x08, 0x00, 0x01, 0x3a, 0x02, 0x00, + 0x40, 0xf2, 0x95, 0x4c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4f, 0xf6, 0xe1, 0x6c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x40, 0xf2, 0x2d, 0x3c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x40, 0xf2, 0x95, 0x1c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xf8, 0xb5, 0x0b, 0x4c, 0x94, 0xf8, 0xc3, 0x01, 0x88, 0xb1, 0x0a, 0x49, + 0x00, 0x26, 0x00, 0x27, 0x01, 0xf1, 0x08, 0x05, 0x29, 0x78, 0x01, 0x29, + 0x05, 0xd1, 0xf8, 0xb2, 0x2e, 0x70, 0xfe, 0xf7, 0xbf, 0xf8, 0x94, 0xf8, + 0xc3, 0x01, 0x01, 0x37, 0x0c, 0x35, 0x87, 0x42, 0xf2, 0xd3, 0xf8, 0xbd, + 0xe8, 0x65, 0x08, 0x00, 0xbc, 0xda, 0x05, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x9c, 0xf4, 0x08, 0x00, 0xe1, 0x3a, 0x02, 0x00, + 0x70, 0xb5, 0x2d, 0x49, 0x2b, 0x4c, 0x00, 0x20, 0x01, 0xf5, 0x40, 0x75, + 0x26, 0x46, 0x15, 0xf8, 0x11, 0x1f, 0x46, 0xf8, 0x34, 0x0f, 0x30, 0x83, + 0x19, 0xb3, 0x70, 0x68, 0x40, 0xb9, 0x27, 0x48, 0x02, 0x68, 0x88, 0x00, + 0x90, 0x47, 0x29, 0x78, 0xa0, 0x63, 0x89, 0x00, 0x00, 0xf0, 0xac, 0xf8, + 0xb0, 0x68, 0x48, 0xb9, 0x21, 0x48, 0x01, 0x68, 0x28, 0x78, 0x80, 0x00, + 0x88, 0x47, 0x29, 0x78, 0xe0, 0x63, 0x89, 0x00, 0x00, 0xf0, 0xa0, 0xf8, + 0xf0, 0x68, 0x68, 0xb9, 0x1b, 0x48, 0x01, 0x68, 0x28, 0x78, 0x80, 0x00, + 0x88, 0x47, 0x29, 0x78, 0x20, 0x64, 0x89, 0x00, 0x00, 0xf0, 0x94, 0xf8, + 0x02, 0xe0, 0xc6, 0xe9, 0x01, 0x00, 0xf0, 0x60, 0x68, 0x78, 0x68, 0xb1, + 0x31, 0x69, 0x41, 0xb9, 0x12, 0x49, 0x80, 0x00, 0x09, 0x68, 0x88, 0x47, + 0x69, 0x78, 0x60, 0x64, 0x89, 0x00, 0x00, 0xf0, 0x83, 0xf8, 0x70, 0x69, + 0x20, 0xb1, 0x70, 0xbd, 0x00, 0x20, 0xc6, 0xe9, 0x04, 0x00, 0x70, 0xbd, + 0x0a, 0x49, 0x68, 0x78, 0x03, 0x26, 0x06, 0xeb, 0x40, 0x00, 0x09, 0x68, + 0x20, 0xf0, 0x03, 0x00, 0x88, 0x47, 0x69, 0x78, 0xa0, 0x64, 0x06, 0xeb, + 0x41, 0x01, 0x21, 0xf0, 0x03, 0x01, 0x00, 0xf0, 0x6b, 0xf8, 0x70, 0xbd, + 0xc4, 0x1d, 0x01, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0xdc, 0x9b, 0x08, 0x00, + 0x10, 0xb5, 0x14, 0x46, 0x00, 0xf0, 0x66, 0xf8, 0x01, 0x20, 0x00, 0xf0, + 0xff, 0xfb, 0x1d, 0x48, 0x00, 0x21, 0x01, 0x2c, 0xc0, 0xe9, 0x00, 0x11, + 0x18, 0xbf, 0x10, 0xbd, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x40, 0xbe, + 0x10, 0xb5, 0x15, 0x48, 0x00, 0x78, 0x01, 0x28, 0x18, 0xbf, 0x10, 0xbd, + 0x14, 0x4c, 0x20, 0x79, 0x28, 0xb1, 0x01, 0x20, 0x00, 0xf0, 0xe8, 0xfb, + 0x00, 0x20, 0xc4, 0xe9, 0x00, 0x00, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, + 0x4b, 0xb8, 0x00, 0xbf, 0x10, 0xb5, 0x0b, 0x48, 0x00, 0x78, 0x01, 0x28, + 0x11, 0xd1, 0x0a, 0x48, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0x0a, 0x49, + 0x08, 0x4c, 0x09, 0x8e, 0x20, 0x68, 0x01, 0xeb, 0x81, 0x01, 0xb0, 0xeb, + 0x41, 0x0f, 0x04, 0xd9, 0x00, 0x20, 0x00, 0xf0, 0xcb, 0xfb, 0x01, 0x20, + 0x20, 0x71, 0x10, 0xbd, 0xec, 0x1e, 0x01, 0x00, 0x6c, 0x92, 0x08, 0x00, + 0x0c, 0xdb, 0x05, 0x00, 0xfc, 0x31, 0x06, 0x00, 0x06, 0x48, 0x07, 0x49, + 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, + 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x84, 0x95, 0x08, 0x00, 0xe9, 0x3b, 0x02, 0x00, 0xa8, 0x95, 0x08, 0x00, + 0x29, 0x3b, 0x02, 0x00, 0x9c, 0x92, 0x08, 0x00, 0x0d, 0x3c, 0x02, 0x00, + 0x8c, 0x92, 0x08, 0x00, 0x35, 0x3c, 0x02, 0x00, 0x4b, 0xf2, 0xc7, 0x4c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0x61, 0x6c, + 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4c, 0xf2, 0xad, 0x4c, + 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x7f, 0xb5, 0x05, 0x46, + 0x22, 0x48, 0x0c, 0x46, 0x02, 0x21, 0x22, 0x46, 0x2b, 0x46, 0x06, 0x68, + 0x00, 0x20, 0x00, 0x90, 0x01, 0x20, 0xb0, 0x47, 0x1e, 0x48, 0x0d, 0xf1, + 0x0f, 0x01, 0x03, 0xaa, 0x0d, 0xf1, 0x0a, 0x03, 0x06, 0x68, 0x02, 0xa8, + 0x00, 0x90, 0x28, 0x46, 0xb0, 0x47, 0xbd, 0xf8, 0x0a, 0x00, 0x69, 0x28, + 0x0c, 0xd0, 0x21, 0x28, 0x10, 0xd0, 0x67, 0x28, 0x20, 0xd0, 0x20, 0x28, + 0x23, 0xd1, 0x17, 0x48, 0x61, 0x1f, 0xc9, 0xb2, 0x02, 0x68, 0xa8, 0x1c, + 0x90, 0x47, 0x1c, 0xe0, 0x61, 0x1f, 0xa8, 0x1c, 0xc9, 0xb2, 0x00, 0xf0, + 0x91, 0xf8, 0x16, 0xe0, 0x0e, 0x48, 0x61, 0x1f, 0xc9, 0xb2, 0x02, 0x68, + 0xa8, 0x1c, 0x90, 0x47, 0xa3, 0x4c, 0x20, 0x7b, 0x01, 0x28, 0x0c, 0xd1, + 0x0a, 0x48, 0x00, 0x21, 0x00, 0x25, 0x02, 0x68, 0x02, 0x20, 0x90, 0x47, + 0x25, 0x73, 0x04, 0xe0, 0x61, 0x1f, 0xa8, 0x1c, 0xc9, 0xb2, 0x00, 0xf0, + 0x0d, 0xf8, 0x01, 0x20, 0x04, 0xb0, 0x70, 0xbd, 0xec, 0x9e, 0x08, 0x00, + 0xf0, 0x9e, 0x08, 0x00, 0xc0, 0x9e, 0x08, 0x00, 0x68, 0xa3, 0x08, 0x00, + 0xbc, 0x9e, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x43, 0xa1, 0xb0, 0x92, 0x4c, + 0x0e, 0x46, 0x05, 0x46, 0x27, 0x68, 0x27, 0xb9, 0x00, 0x20, 0xca, 0x21, + 0xfd, 0xf7, 0x36, 0xf9, 0x27, 0x68, 0x0d, 0xf1, 0x44, 0x08, 0x40, 0x21, + 0x4f, 0xf0, 0x40, 0x09, 0x40, 0x46, 0xff, 0xf7, 0xd3, 0xfa, 0x29, 0x48, + 0x39, 0x46, 0x67, 0x22, 0x2b, 0x46, 0x8d, 0xe8, 0x40, 0x03, 0x04, 0x68, + 0x02, 0x20, 0xa0, 0x47, 0x03, 0xad, 0x36, 0x21, 0x68, 0x1c, 0xff, 0xf7, + 0x79, 0xff, 0x14, 0x99, 0xe8, 0x1d, 0x08, 0xf1, 0x2c, 0x04, 0x00, 0xf8, + 0x02, 0x1b, 0x0a, 0x0e, 0x8b, 0x00, 0x42, 0x70, 0x0a, 0x0c, 0x02, 0x70, + 0x12, 0x98, 0x9d, 0xf8, 0x4d, 0x20, 0xad, 0xf8, 0x0e, 0x00, 0x8d, 0xf8, + 0x0c, 0x20, 0x9d, 0xf8, 0x45, 0x20, 0x00, 0x0c, 0xad, 0xf8, 0x10, 0x00, + 0x08, 0x0a, 0x14, 0x21, 0x8d, 0xf8, 0x12, 0x20, 0x8d, 0xf8, 0x14, 0x00, + 0x05, 0xf1, 0x0b, 0x00, 0x22, 0x46, 0xfd, 0xf7, 0x0f, 0xf9, 0x1b, 0x99, + 0x05, 0xf1, 0x1f, 0x00, 0x00, 0x22, 0x8d, 0xf8, 0x2c, 0x20, 0x00, 0xf8, + 0x02, 0x1b, 0x8b, 0x00, 0x14, 0x21, 0x42, 0x70, 0x02, 0x70, 0x05, 0xf1, + 0x23, 0x00, 0x22, 0x46, 0xfd, 0xf7, 0xfe, 0xf8, 0x2c, 0x48, 0x90, 0xf8, + 0x2c, 0x01, 0x80, 0x07, 0x06, 0xd5, 0xb4, 0x48, 0x06, 0x49, 0x11, 0xaa, + 0x40, 0x23, 0x04, 0x68, 0x09, 0x20, 0xa0, 0x47, 0x03, 0xa8, 0x06, 0xf0, + 0x9f, 0xf9, 0x21, 0xb0, 0xbd, 0xe8, 0xf0, 0x83, 0xc8, 0xff, 0x08, 0x00, + 0xae, 0x44, 0x02, 0x00, 0xf0, 0xb5, 0x85, 0xb0, 0x5c, 0x4e, 0x0d, 0x46, + 0x04, 0x46, 0x31, 0x68, 0x29, 0xb9, 0x00, 0x20, 0x4f, 0xf4, 0x84, 0x71, + 0xfd, 0xf7, 0xca, 0xf8, 0x31, 0x68, 0xe6, 0x48, 0x04, 0xaa, 0x00, 0x26, + 0x23, 0x46, 0xcd, 0xe9, 0x00, 0x52, 0x69, 0x22, 0x04, 0x96, 0x07, 0x68, + 0x04, 0x20, 0x02, 0x90, 0x02, 0x20, 0xb8, 0x47, 0x51, 0x48, 0xc1, 0x7b, + 0x05, 0x29, 0x09, 0xd1, 0xc6, 0x73, 0x65, 0x48, 0x01, 0x68, 0x42, 0x20, + 0x88, 0x47, 0x18, 0xb1, 0xdb, 0x48, 0x01, 0x68, 0x42, 0x20, 0x88, 0x47, + 0x0d, 0x4c, 0xd4, 0xf8, 0x2c, 0x01, 0x81, 0x07, 0x08, 0xd5, 0xbd, 0xf8, + 0x12, 0x30, 0x0b, 0x48, 0x0b, 0x4a, 0x78, 0x21, 0x00, 0xf0, 0xdc, 0xfa, + 0xd4, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, 0x08, 0x48, 0x06, 0x4a, + 0x02, 0x21, 0x03, 0x68, 0x09, 0x20, 0x98, 0x47, 0x00, 0x20, 0x06, 0xf0, + 0x25, 0xf8, 0x05, 0xb0, 0xf0, 0xbd, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, + 0x14, 0xdb, 0x05, 0x00, 0x88, 0x44, 0x02, 0x00, 0x70, 0x9b, 0x08, 0x00, + 0x70, 0xb5, 0x8e, 0xb0, 0x19, 0x9c, 0x36, 0x4e, 0x02, 0xad, 0x0d, 0x94, + 0x18, 0x9c, 0x0c, 0x94, 0x17, 0x9c, 0x0b, 0x94, 0x16, 0x9c, 0x0a, 0x94, + 0x15, 0x9c, 0x09, 0x94, 0x14, 0x9c, 0x08, 0x94, 0x13, 0x9c, 0x07, 0x94, + 0x12, 0x9c, 0x1f, 0xc5, 0x30, 0x68, 0x1a, 0x9d, 0x20, 0xb9, 0x00, 0x20, + 0x4f, 0xf4, 0xa1, 0x71, 0xfd, 0xf7, 0x6e, 0xf8, 0x2a, 0x4c, 0x14, 0xf8, + 0x0d, 0x0f, 0x03, 0x28, 0x04, 0xd1, 0x29, 0x48, 0x90, 0xf8, 0x79, 0x00, + 0x01, 0x28, 0x0d, 0xd1, 0xe7, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, + 0x2c, 0xd5, 0xe6, 0x48, 0x27, 0x4a, 0x03, 0x68, 0x09, 0x20, 0x00, 0x21, + 0x0e, 0xb0, 0xbd, 0xe8, 0x70, 0x40, 0x18, 0x47, 0x01, 0x2d, 0x09, 0xd1, + 0xa0, 0x78, 0x58, 0xb1, 0xde, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, + 0x1a, 0xd5, 0xdd, 0x48, 0xde, 0x4a, 0xec, 0xe7, 0x15, 0xb9, 0xa0, 0x78, + 0x00, 0x28, 0xf3, 0xd0, 0xdc, 0x49, 0x30, 0x68, 0x02, 0xab, 0x68, 0x22, + 0x0e, 0x68, 0x30, 0x21, 0x00, 0x91, 0x02, 0x21, 0xb0, 0x47, 0x14, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x30, 0xb1, 0x13, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x03, 0x28, 0x08, 0xbf, 0x01, 0x2d, 0x01, 0xd0, 0x0e, 0xb0, 0x70, 0xbd, + 0xcd, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x06, 0xd5, 0x56, 0x48, + 0x0c, 0x49, 0x02, 0xaa, 0x30, 0x23, 0x05, 0x68, 0x09, 0x20, 0xa8, 0x47, + 0xcc, 0x48, 0x00, 0x21, 0x01, 0x70, 0x00, 0xf0, 0x13, 0xf8, 0x00, 0x28, + 0xea, 0xd1, 0x05, 0x20, 0xa0, 0x70, 0xe7, 0xe7, 0x18, 0x1f, 0x01, 0x00, + 0x90, 0xdb, 0x05, 0x00, 0x50, 0xe2, 0x05, 0x00, 0x48, 0xe5, 0x08, 0x00, + 0x3c, 0xe5, 0x08, 0x00, 0xe7, 0x44, 0x02, 0x00, 0xc1, 0x44, 0x02, 0x00, + 0xb0, 0xb5, 0x0f, 0x48, 0x01, 0x68, 0x42, 0x20, 0x88, 0x47, 0x08, 0xb1, + 0x17, 0x20, 0xb0, 0xbd, 0xbc, 0x4c, 0x20, 0x78, 0x09, 0x28, 0x03, 0xd3, + 0x00, 0x20, 0x20, 0x70, 0x43, 0x20, 0xb0, 0xbd, 0x08, 0x49, 0x91, 0xf8, + 0xc0, 0x10, 0x39, 0xb1, 0x07, 0x48, 0x01, 0x21, 0x01, 0x22, 0x03, 0x23, + 0x05, 0x68, 0x42, 0x20, 0xa8, 0x47, 0x20, 0x78, 0x01, 0x30, 0x20, 0x70, + 0x00, 0x20, 0xb0, 0xbd, 0x34, 0x9d, 0x08, 0x00, 0xd0, 0x32, 0x06, 0x00, + 0x20, 0x9d, 0x08, 0x00, 0x70, 0xb5, 0x92, 0xb0, 0xa6, 0x4d, 0x04, 0x46, + 0x28, 0x68, 0x20, 0xb9, 0x00, 0x20, 0x4f, 0xf4, 0xc8, 0x71, 0xfc, 0xf7, + 0xdb, 0xff, 0x01, 0x2c, 0x0e, 0xd1, 0xe8, 0x48, 0xc0, 0x7b, 0x78, 0xb1, + 0xa0, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x4c, 0xd5, 0x9f, 0x48, + 0xa0, 0x4a, 0x03, 0x68, 0x09, 0x20, 0x00, 0x21, 0x98, 0x47, 0x45, 0xe0, + 0x14, 0xb9, 0xe0, 0x48, 0xc0, 0x7b, 0xe0, 0xb3, 0x02, 0xa8, 0x40, 0x21, + 0xff, 0xf7, 0x68, 0xf9, 0xd0, 0x48, 0x01, 0x78, 0x1f, 0x29, 0x00, 0xd8, + 0x09, 0xb9, 0x01, 0x21, 0x01, 0x70, 0x40, 0x78, 0x08, 0x23, 0x41, 0xf0, + 0x80, 0x01, 0x01, 0x22, 0x8d, 0xf8, 0x10, 0x30, 0x02, 0x23, 0x8d, 0xf8, + 0x11, 0x10, 0x40, 0x21, 0x8d, 0xf8, 0x12, 0x20, 0x8d, 0xf8, 0x08, 0x20, + 0x20, 0x22, 0x8d, 0xf8, 0x13, 0x00, 0x8e, 0x48, 0x03, 0x93, 0x00, 0x91, + 0x02, 0xab, 0x02, 0x21, 0x06, 0x68, 0x28, 0x68, 0xb0, 0x47, 0x01, 0x2c, + 0x1a, 0xd1, 0x85, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x06, 0xd5, + 0x0d, 0x48, 0x0e, 0x49, 0x02, 0xaa, 0x40, 0x23, 0x04, 0x68, 0x09, 0x20, + 0xa0, 0x47, 0x84, 0x48, 0x00, 0x21, 0x01, 0x70, 0xff, 0xf7, 0x82, 0xff, + 0x40, 0xb9, 0xc2, 0x48, 0x01, 0x21, 0xc1, 0x73, 0x04, 0xe0, 0x7a, 0x48, + 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x01, 0xd4, 0x12, 0xb0, 0x70, 0xbd, + 0x77, 0x48, 0x78, 0x4a, 0xaf, 0xe7, 0x00, 0xbf, 0xf8, 0x9d, 0x08, 0x00, + 0x19, 0x45, 0x02, 0x00, 0x2d, 0xe9, 0xf0, 0x43, 0x93, 0xb0, 0x70, 0x4c, + 0x0e, 0x46, 0x81, 0x46, 0x27, 0x68, 0x2f, 0xb9, 0x00, 0x20, 0x4f, 0xf4, + 0xf1, 0x71, 0xfc, 0xf7, 0x6d, 0xff, 0x27, 0x68, 0x03, 0xac, 0x40, 0x21, + 0x4f, 0xf0, 0x40, 0x08, 0x20, 0x46, 0xff, 0xf7, 0x0b, 0xf9, 0x34, 0x48, + 0x39, 0x46, 0x20, 0x22, 0x4b, 0x46, 0xcd, 0xe9, 0x00, 0x64, 0xcd, 0xf8, + 0x08, 0x80, 0x05, 0x68, 0x02, 0x20, 0xa8, 0x47, 0x04, 0x98, 0x98, 0xb1, + 0x9b, 0x49, 0x00, 0x23, 0x01, 0x22, 0x04, 0xeb, 0x43, 0x03, 0x1d, 0x7a, + 0x01, 0x2d, 0x06, 0xd1, 0x4d, 0x78, 0x5b, 0x7a, 0x05, 0xf0, 0x1f, 0x05, + 0x45, 0xea, 0x53, 0x13, 0x4b, 0x70, 0xd3, 0xb2, 0x55, 0x1c, 0x98, 0x42, + 0x2a, 0x46, 0xee, 0xd8, 0x9d, 0x48, 0x41, 0x7b, 0x03, 0x29, 0x1c, 0xbf, + 0x03, 0x21, 0x41, 0x73, 0x9b, 0x48, 0x09, 0x21, 0x00, 0x78, 0xfc, 0xf7, + 0x51, 0xff, 0x13, 0xb0, 0xbd, 0xe8, 0xf0, 0x83, 0x2d, 0xe9, 0xf0, 0x43, + 0x93, 0xb0, 0x4e, 0x4f, 0x0d, 0x46, 0x81, 0x46, 0x3e, 0x68, 0x2e, 0xb9, + 0x00, 0x20, 0x40, 0xf2, 0x49, 0x21, 0xfc, 0xf7, 0x29, 0xff, 0x3e, 0x68, + 0x04, 0xaf, 0x3c, 0x21, 0x4f, 0xf0, 0x3c, 0x08, 0x38, 0x46, 0xff, 0xf7, + 0xc7, 0xf8, 0x12, 0x48, 0x31, 0x46, 0x21, 0x22, 0x4b, 0x46, 0x8d, 0xe8, + 0xa0, 0x01, 0x04, 0x68, 0x02, 0x20, 0xa0, 0x47, 0x87, 0x48, 0x10, 0xf8, + 0x0d, 0x1f, 0x03, 0x29, 0x1c, 0xbf, 0x03, 0x21, 0x01, 0x70, 0x81, 0x78, + 0x01, 0x29, 0x0e, 0xd1, 0x00, 0x21, 0x81, 0x70, 0x75, 0x48, 0x01, 0x78, + 0x01, 0x31, 0x01, 0x70, 0x7e, 0x48, 0x01, 0x68, 0x42, 0x20, 0x88, 0x47, + 0x18, 0xb1, 0x04, 0x48, 0x01, 0x68, 0x42, 0x20, 0x88, 0x47, 0x13, 0xb0, + 0xbd, 0xe8, 0xf0, 0x83, 0xc8, 0xff, 0x08, 0x00, 0x30, 0x9d, 0x08, 0x00, + 0x70, 0xb5, 0x90, 0xb0, 0x2f, 0x4e, 0x04, 0x46, 0x30, 0x68, 0x20, 0xb9, + 0x00, 0x20, 0x40, 0xf2, 0x81, 0x21, 0xfc, 0xf7, 0xed, 0xfe, 0x01, 0xa8, + 0x3c, 0x21, 0xff, 0xf7, 0x8f, 0xf8, 0x70, 0x48, 0x01, 0x2c, 0x00, 0xf1, + 0x0d, 0x05, 0x0d, 0xd1, 0xa8, 0x78, 0x70, 0xb1, 0x26, 0x48, 0x90, 0xf8, + 0x2c, 0x01, 0x80, 0x07, 0x40, 0xd5, 0x25, 0x48, 0x26, 0x4a, 0x03, 0x68, + 0x09, 0x20, 0x00, 0x21, 0x98, 0x47, 0x39, 0xe0, 0x0c, 0xb9, 0xa8, 0x78, + 0x88, 0xb3, 0x01, 0x21, 0x08, 0x20, 0x01, 0xab, 0x8d, 0xf8, 0x04, 0x10, + 0x8d, 0xf8, 0x0e, 0x10, 0x55, 0x49, 0x8d, 0xf8, 0x0c, 0x00, 0x02, 0x20, + 0x02, 0x90, 0x0a, 0x78, 0x49, 0x78, 0x8d, 0xf8, 0x0f, 0x10, 0x29, 0x78, + 0x8d, 0xf8, 0x0d, 0x20, 0x21, 0x22, 0x03, 0x29, 0x18, 0x49, 0x18, 0xbf, + 0x28, 0x70, 0x30, 0x68, 0x0e, 0x68, 0x3c, 0x21, 0x00, 0x91, 0x02, 0x21, + 0xb0, 0x47, 0x01, 0x2c, 0x16, 0xd1, 0x44, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x90, 0xb1, 0x43, 0x48, 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, 0x0d, 0xd1, + 0x0f, 0x48, 0x00, 0x21, 0x01, 0x70, 0xff, 0xf7, 0x99, 0xfe, 0x38, 0xb9, + 0x02, 0x20, 0xa8, 0x70, 0x04, 0xe0, 0x06, 0x48, 0x90, 0xf8, 0x2c, 0x01, + 0x80, 0x07, 0x01, 0xd4, 0x10, 0xb0, 0x70, 0xbd, 0x03, 0x48, 0x04, 0x4a, + 0xbb, 0xe7, 0x00, 0xbf, 0x18, 0x1f, 0x01, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0x70, 0x9b, 0x08, 0x00, 0x01, 0x45, 0x02, 0x00, 0xd4, 0x44, 0x02, 0x00, + 0x48, 0xca, 0x08, 0x00, 0x8c, 0xdb, 0x05, 0x00, 0x42, 0x28, 0x18, 0xbf, + 0x00, 0xf0, 0xc4, 0xb8, 0x2d, 0xe9, 0xf0, 0x4f, 0x89, 0xb0, 0x3c, 0x4a, + 0xd0, 0x7b, 0x02, 0xf1, 0x0c, 0x04, 0x05, 0x28, 0x28, 0xd8, 0xdf, 0xe8, + 0x00, 0xf0, 0x4c, 0x03, 0x07, 0x27, 0x27, 0x0b, 0x00, 0x20, 0xff, 0xf7, + 0x8d, 0xfe, 0x1f, 0xe0, 0x00, 0x20, 0xff, 0xf7, 0x77, 0xff, 0x1b, 0xe0, + 0x52, 0xf8, 0x14, 0x0f, 0x04, 0xf1, 0x20, 0x0e, 0x04, 0xf1, 0x2c, 0x0a, + 0xa6, 0x69, 0x00, 0x25, 0x9e, 0xe8, 0x80, 0x48, 0x9a, 0xe8, 0x00, 0x07, + 0xd2, 0xf8, 0x14, 0xc0, 0x51, 0x68, 0xd3, 0x68, 0x22, 0x69, 0x08, 0x95, + 0x02, 0xad, 0xcd, 0xe9, 0x00, 0x6c, 0x85, 0xe8, 0x80, 0x48, 0x05, 0xad, + 0x85, 0xe8, 0x00, 0x07, 0xff, 0xf7, 0xc8, 0xfd, 0xff, 0xf7, 0x44, 0xfe, + 0x08, 0xb3, 0x12, 0x48, 0x00, 0x68, 0x80, 0x47, 0x48, 0xb1, 0x11, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, 0x04, 0xd1, 0x0f, 0x48, 0x00, 0x21, + 0x01, 0x80, 0x0f, 0x48, 0x01, 0x70, 0xe0, 0x78, 0x01, 0x28, 0x0e, 0xd1, + 0x0d, 0x48, 0x00, 0x68, 0x80, 0x47, 0x0d, 0x48, 0x00, 0x25, 0x45, 0x70, + 0x20, 0x78, 0x01, 0x28, 0x05, 0xd1, 0x0b, 0x48, 0x01, 0x21, 0x02, 0x68, + 0x02, 0x20, 0x90, 0x47, 0x25, 0x70, 0x00, 0x20, 0xe0, 0x70, 0x09, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0x48, 0xe5, 0x08, 0x00, 0x3c, 0xe5, 0x08, 0x00, + 0xf6, 0xda, 0x05, 0x00, 0xf5, 0xda, 0x05, 0x00, 0x3c, 0xca, 0x08, 0x00, + 0x50, 0x1f, 0x01, 0x00, 0x68, 0xa3, 0x08, 0x00, 0x80, 0xb5, 0x08, 0x48, + 0x01, 0x68, 0x42, 0x20, 0x88, 0x47, 0x08, 0xb1, 0x17, 0x20, 0x80, 0xbd, + 0x05, 0x48, 0x01, 0x21, 0x01, 0x73, 0x05, 0x48, 0x08, 0x21, 0x00, 0x78, + 0xfc, 0xf7, 0x24, 0xfe, 0x00, 0x20, 0x80, 0xbd, 0x34, 0x9d, 0x08, 0x00, + 0x90, 0xdb, 0x05, 0x00, 0x24, 0xba, 0x01, 0x00, 0x1c, 0xb5, 0x04, 0x46, + 0x09, 0x48, 0x01, 0x68, 0x20, 0x01, 0x0b, 0x30, 0x8d, 0xf8, 0x07, 0x00, + 0xc0, 0xb2, 0x88, 0x47, 0x4c, 0xb1, 0x06, 0x48, 0x0d, 0xf1, 0x07, 0x03, + 0x03, 0x21, 0x01, 0x22, 0x04, 0x68, 0x01, 0x20, 0x00, 0x90, 0x01, 0x20, + 0xa0, 0x47, 0x1c, 0xbd, 0xf4, 0x9e, 0x08, 0x00, 0xec, 0x9e, 0x08, 0x00, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x08, 0x48, 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, 0x09, 0x49, 0x01, 0x60, + 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x70, 0x47, 0xc0, 0x9e, 0x08, 0x00, + 0x91, 0x41, 0x02, 0x00, 0xb8, 0x9e, 0x08, 0x00, 0xd5, 0x3c, 0x02, 0x00, + 0xbc, 0x9e, 0x08, 0x00, 0x09, 0x41, 0x02, 0x00, 0x5c, 0x95, 0x08, 0x00, + 0xed, 0x42, 0x02, 0x00, 0xe8, 0x9e, 0x08, 0x00, 0xc5, 0x43, 0x02, 0x00, + 0x4b, 0xf2, 0x7d, 0x3c, 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4c, 0xf6, 0xd5, 0x3c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x70, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x20, 0x61, 0x63, 0x6b, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x64, 0x20, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x75, 0x6d, 0x3a, 0x20, 0x25, + 0x78, 0x00, 0x52, 0x58, 0x3a, 0x20, 0x42, 0x54, 0x20, 0x4e, 0x45, 0x20, + 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x3a, 0x20, 0x20, 0x00, 0x4d, 0x57, 0x53, + 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x65, 0x64, 0x00, 0x4d, 0x57, 0x53, 0x20, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x66, 0x61, 0x63, 0x65, 0x20, 0x62, 0x75, 0x73, 0x79, 0x00, 0x54, + 0x58, 0x3a, 0x20, 0x42, 0x54, 0x20, 0x4e, 0x45, 0x20, 0x50, 0x4f, 0x57, + 0x45, 0x52, 0x20, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x3a, 0x20, 0x20, + 0x00, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x74, 0x72, 0x79, + 0x00, 0x54, 0x58, 0x3a, 0x20, 0x42, 0x54, 0x20, 0x53, 0x59, 0x4e, 0x43, + 0x20, 0x52, 0x45, 0x51, 0x3a, 0x20, 0x20, 0x00, 0x2d, 0xe9, 0xfc, 0x41, + 0x05, 0x46, 0x2e, 0x48, 0x01, 0x2a, 0x00, 0x68, 0x01, 0x90, 0x22, 0xd8, + 0x0d, 0xb3, 0x00, 0x27, 0x00, 0xb3, 0x0e, 0x46, 0x80, 0x21, 0x14, 0x46, + 0xff, 0xf7, 0xb2, 0xfb, 0x28, 0x48, 0x01, 0xab, 0x31, 0x46, 0x22, 0x46, + 0x00, 0x97, 0xd0, 0xf8, 0x00, 0xc0, 0x28, 0x46, 0xe0, 0x47, 0x88, 0xb1, + 0xdf, 0xf8, 0x90, 0x80, 0x04, 0x46, 0xd8, 0xf8, 0x00, 0x00, 0x80, 0x47, + 0x68, 0xb1, 0x22, 0x48, 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, 0x08, 0xd1, + 0x01, 0x98, 0x21, 0x46, 0xfe, 0xf7, 0xa8, 0xfa, 0x32, 0xe0, 0x10, 0x27, + 0x38, 0x46, 0xbd, 0xe8, 0xfc, 0x81, 0x1c, 0x48, 0xf2, 0xb2, 0x02, 0x21, + 0x2b, 0x46, 0x07, 0x68, 0x01, 0x20, 0x00, 0x90, 0x01, 0x20, 0xb8, 0x47, + 0xd8, 0xf8, 0x00, 0x00, 0x80, 0x47, 0x17, 0x4d, 0x78, 0xb1, 0x17, 0x48, + 0x90, 0xf8, 0x34, 0x02, 0x58, 0xb9, 0x28, 0x68, 0x40, 0xf4, 0x00, 0x70, + 0x28, 0x60, 0x28, 0x68, 0x40, 0xf4, 0x80, 0x60, 0x28, 0x60, 0x28, 0x68, + 0x20, 0xf4, 0x00, 0x60, 0x28, 0x60, 0x10, 0x48, 0x21, 0x46, 0x02, 0x68, + 0x01, 0x98, 0x90, 0x47, 0x28, 0x68, 0x20, 0xf4, 0x80, 0x60, 0x28, 0x60, + 0x28, 0x68, 0x40, 0xf4, 0x00, 0x70, 0x28, 0x60, 0x28, 0x68, 0x40, 0xf4, + 0x00, 0x60, 0x28, 0x60, 0x00, 0x27, 0xcb, 0xe7, 0x70, 0x20, 0x01, 0x00, + 0xd0, 0x95, 0x08, 0x00, 0x48, 0xe5, 0x08, 0x00, 0x3c, 0xe5, 0x08, 0x00, + 0xec, 0x9e, 0x08, 0x00, 0xb0, 0x50, 0x00, 0x30, 0x38, 0x21, 0x01, 0x00, + 0xd4, 0x95, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xf0, 0x95, 0x08, 0x00, 0x2d, 0x45, 0x02, 0x00, 0x2d, 0xe9, 0xf8, 0x43, + 0x98, 0x46, 0x15, 0x46, 0x0e, 0x46, 0x07, 0x46, 0x20, 0xb1, 0x02, 0x2e, + 0x02, 0xd8, 0xb8, 0xf1, 0x00, 0x0f, 0x03, 0xd1, 0x00, 0x20, 0x54, 0x21, + 0xfc, 0xf7, 0xe0, 0xfc, 0x38, 0x68, 0x01, 0x38, 0x05, 0x28, 0x23, 0xd8, + 0xdf, 0xf8, 0x54, 0x90, 0x07, 0xeb, 0x46, 0x00, 0x07, 0xeb, 0x86, 0x01, + 0x00, 0x8a, 0x8c, 0x69, 0x58, 0xb1, 0x00, 0xeb, 0x40, 0x01, 0x04, 0xeb, + 0x41, 0x01, 0x22, 0x88, 0xaa, 0x42, 0x0f, 0xd0, 0x01, 0x38, 0x04, 0xf1, + 0x06, 0x04, 0xf8, 0xd1, 0x0c, 0x46, 0xd9, 0xf8, 0x00, 0x10, 0x38, 0x46, + 0x88, 0x47, 0x07, 0x46, 0x00, 0x28, 0xe5, 0xd1, 0x00, 0x20, 0x72, 0x21, + 0xfc, 0xf7, 0xbc, 0xfc, 0xa0, 0x88, 0xc8, 0xf8, 0x00, 0x00, 0x03, 0xe0, + 0x00, 0x20, 0x79, 0x21, 0xfc, 0xf7, 0xb4, 0xfc, 0x00, 0x20, 0xbd, 0xe8, + 0xf8, 0x83, 0x00, 0xbf, 0xc8, 0x95, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0xf4, 0x95, 0x08, 0x00, 0x1d, 0x46, 0x02, 0x00, + 0xb0, 0xb5, 0x12, 0x48, 0x00, 0x21, 0x14, 0x4c, 0x26, 0x4d, 0x01, 0x70, + 0x10, 0x48, 0x11, 0x49, 0x01, 0x60, 0x94, 0xf8, 0x0b, 0x03, 0x00, 0x28, + 0x18, 0xbf, 0x01, 0x20, 0x28, 0x70, 0x0f, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x0e, 0x48, 0x2a, 0x78, 0xd4, 0xf8, 0x00, 0x13, 0x03, 0x68, 0x01, 0x20, + 0x98, 0x47, 0x28, 0x78, 0x40, 0xb1, 0x1c, 0x48, 0x01, 0x68, 0x01, 0x20, + 0x88, 0x47, 0x01, 0x20, 0xbd, 0xe8, 0xb0, 0x40, 0xff, 0xf7, 0x9c, 0xbc, + 0xb0, 0xbd, 0x00, 0xbf, 0xed, 0x1e, 0x01, 0x00, 0x18, 0x1f, 0x01, 0x00, + 0x9c, 0xd1, 0x05, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x7c, 0x95, 0x08, 0x00, + 0x84, 0x95, 0x08, 0x00, 0x0f, 0x48, 0x00, 0x78, 0x01, 0x28, 0x18, 0xbf, + 0x70, 0x47, 0x01, 0x20, 0xff, 0xf7, 0x86, 0xbc, 0x0b, 0x48, 0x00, 0x78, + 0x01, 0x28, 0x18, 0xbf, 0x70, 0x47, 0x01, 0x20, 0xff, 0xf7, 0x6c, 0xbd, + 0x80, 0xb5, 0x07, 0x48, 0x00, 0x78, 0x01, 0x28, 0x18, 0xbf, 0x80, 0xbd, + 0x05, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x01, 0x20, 0xbd, 0xe8, + 0x80, 0x40, 0xff, 0xf7, 0x6f, 0xbc, 0x00, 0xbf, 0xec, 0x1e, 0x01, 0x00, + 0x74, 0x95, 0x08, 0x00, 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, + 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x20, 0xf5, 0x08, 0x00, + 0x15, 0x47, 0x02, 0x00, 0xfc, 0xf4, 0x08, 0x00, 0xb1, 0x46, 0x02, 0x00, + 0x24, 0xf5, 0x08, 0x00, 0x25, 0x47, 0x02, 0x00, 0x1c, 0xf5, 0x08, 0x00, + 0x35, 0x47, 0x02, 0x00, 0x01, 0x38, 0x00, 0x21, 0x02, 0x28, 0x38, 0xbf, + 0x01, 0x21, 0x48, 0x00, 0x38, 0x49, 0x48, 0x73, 0x70, 0x47, 0x00, 0xbf, + 0x36, 0x49, 0x88, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x2d, 0xe9, 0xf0, 0x47, + 0x8a, 0xb0, 0x33, 0x4d, 0x04, 0x46, 0x30, 0x21, 0x05, 0xf1, 0x14, 0x00, + 0xfe, 0xf7, 0xc0, 0xfd, 0x20, 0x78, 0x61, 0x78, 0xe2, 0x78, 0xa3, 0x79, + 0x4f, 0xf0, 0x01, 0x08, 0x85, 0xf8, 0x14, 0x80, 0x85, 0xf8, 0x18, 0x80, + 0x85, 0xf8, 0x20, 0x80, 0x85, 0xf8, 0x22, 0x80, 0x85, 0xf8, 0x28, 0x80, + 0x85, 0xf8, 0x2a, 0x80, 0x40, 0xea, 0x01, 0x20, 0x85, 0xf8, 0x21, 0x30, + 0xe3, 0x7a, 0xe8, 0x82, 0x20, 0x46, 0x10, 0xf8, 0x02, 0x1f, 0x85, 0xf8, + 0x29, 0x30, 0x14, 0x23, 0x41, 0xea, 0x02, 0x21, 0x82, 0x78, 0xc0, 0x78, + 0x42, 0xea, 0x00, 0x20, 0x41, 0xea, 0x00, 0x40, 0x21, 0x46, 0xe8, 0x61, + 0x20, 0x7a, 0x11, 0xf8, 0x07, 0x2f, 0x42, 0xea, 0x00, 0x20, 0x8a, 0x78, + 0xc9, 0x78, 0x42, 0xea, 0x01, 0x21, 0x40, 0xea, 0x01, 0x40, 0x21, 0x46, + 0x68, 0x62, 0x60, 0x7b, 0x11, 0xf8, 0x0c, 0x2f, 0x42, 0xea, 0x00, 0x20, + 0x8a, 0x78, 0xc9, 0x78, 0x42, 0xea, 0x01, 0x21, 0x04, 0xf1, 0x10, 0x02, + 0x40, 0xea, 0x01, 0x40, 0x14, 0x21, 0xe8, 0x62, 0x05, 0xf1, 0x30, 0x00, + 0xfc, 0xf7, 0xe4, 0xfb, 0x05, 0xf1, 0x14, 0x07, 0x05, 0xf1, 0x2c, 0x0e, + 0xd5, 0xe9, 0x0e, 0x9a, 0x2d, 0x6c, 0x9f, 0xcf, 0x9e, 0xe8, 0x40, 0x50, + 0xcd, 0xe9, 0x00, 0x47, 0x02, 0xac, 0x84, 0xe8, 0x40, 0x50, 0xcd, 0xe9, + 0x05, 0x9a, 0xcd, 0xe9, 0x07, 0x58, 0xff, 0xf7, 0x33, 0xfb, 0x0a, 0xb0, + 0xbd, 0xe8, 0xf0, 0x87, 0x90, 0xdb, 0x05, 0x00, 0x10, 0x48, 0x00, 0x21, + 0x01, 0x22, 0x40, 0xf8, 0x0c, 0x1f, 0x81, 0x80, 0x42, 0x70, 0x40, 0xf8, + 0x04, 0x1c, 0x70, 0x47, 0x0b, 0x48, 0x00, 0x21, 0x41, 0x73, 0x70, 0x47, + 0x09, 0x48, 0x01, 0x21, 0x41, 0x73, 0x70, 0x47, 0x07, 0x48, 0x01, 0x21, + 0x01, 0x73, 0x70, 0x47, 0x05, 0x48, 0x00, 0x21, 0x01, 0x73, 0x70, 0x47, + 0x03, 0x48, 0x02, 0x21, 0x41, 0x73, 0x70, 0x47, 0x01, 0x48, 0x03, 0x21, + 0x41, 0x73, 0x70, 0x47, 0x90, 0xdb, 0x05, 0x00, 0x02, 0x28, 0x08, 0xbf, + 0x10, 0x29, 0x01, 0xd0, 0x00, 0x20, 0x70, 0x47, 0x02, 0x48, 0x06, 0x2a, + 0x18, 0xbf, 0x00, 0x20, 0x70, 0x47, 0x00, 0xbf, 0x9c, 0xd1, 0x05, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x21, 0x00, 0x01, 0x00, 0x39, 0x00, + 0x22, 0x00, 0x02, 0x00, 0x05, 0x00, 0x23, 0x00, 0x03, 0x00, 0x1c, 0x00, + 0x24, 0x00, 0x04, 0x00, 0x8b, 0x00, 0x25, 0x00, 0x05, 0x00, 0x25, 0x00, + 0x26, 0x00, 0x06, 0x00, 0x45, 0x00, 0x27, 0x00, 0x09, 0x00, 0x25, 0x00, + 0x28, 0x00, 0x0a, 0x00, 0x25, 0x00, 0x29, 0x00, 0x0b, 0x00, 0x25, 0x00, + 0x2a, 0x00, 0x0e, 0x00, 0x6a, 0x00, 0x2b, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x2c, 0x00, 0x10, 0x00, 0x08, 0x00, 0x2d, 0x00, 0x11, 0x00, 0x08, 0x00, + 0x2e, 0x00, 0x12, 0x00, 0x04, 0x00, 0x2f, 0x00, 0x13, 0x00, 0x0e, 0x00, + 0x30, 0x00, 0x14, 0x00, 0x04, 0x00, 0x31, 0x00, 0x07, 0x00, 0x45, 0x00, + 0x32, 0x00, 0x08, 0x00, 0x45, 0x00, 0x33, 0x00, 0x19, 0x00, 0x04, 0x00, + 0x34, 0x00, 0x1a, 0x00, 0x25, 0x00, 0x35, 0x00, 0x0c, 0x00, 0x25, 0x00, + 0x36, 0x00, 0x1b, 0x00, 0x78, 0x00, 0x37, 0x00, 0x1c, 0x00, 0x08, 0x00, + 0x38, 0x00, 0x1d, 0x00, 0x40, 0x00, 0x39, 0x00, 0x1e, 0x00, 0x28, 0x00, + 0x3a, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x8b, 0x00, + 0x3c, 0x00, 0x11, 0x00, 0x08, 0x00, 0x3d, 0x00, 0x12, 0x00, 0x04, 0x00, + 0x3e, 0x00, 0x13, 0x00, 0x0e, 0x00, 0x3f, 0x00, 0x14, 0x00, 0x04, 0x00, + 0x40, 0x00, 0x15, 0x00, 0x0e, 0x00, 0x41, 0x00, 0x16, 0x00, 0x46, 0x00, + 0x42, 0x00, 0x17, 0x00, 0x00, 0x00, 0x43, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x44, 0x00, 0x15, 0x00, 0x0e, 0x00, 0x45, 0x00, 0x16, 0x00, 0x46, 0x00, + 0x46, 0x00, 0x17, 0x00, 0x00, 0x00, 0x47, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x0d, 0x00, 0x25, 0x00, 0x49, 0x00, 0x20, 0x00, 0x0e, 0x00, + 0x4a, 0x00, 0x0d, 0x00, 0x25, 0x00, 0x4b, 0x00, 0x21, 0x00, 0x04, 0x00, + 0x4c, 0x00, 0x22, 0x00, 0x18, 0x00, 0x4d, 0x00, 0x23, 0x00, 0x1b, 0x00, + 0x4e, 0x00, 0x24, 0x00, 0x29, 0x00, 0x4f, 0x00, 0x25, 0x00, 0x19, 0x00, + 0x50, 0x00, 0x26, 0x00, 0x18, 0x00, 0x51, 0x00, 0x27, 0x00, 0x18, 0x00, + 0x52, 0x00, 0x28, 0x00, 0x25, 0x00, 0x53, 0x00, 0x29, 0x00, 0x05, 0x00, + 0x54, 0x00, 0x2a, 0x00, 0x05, 0x00, 0x55, 0x00, 0x2b, 0x00, 0x15, 0x00, + 0x56, 0x00, 0x2c, 0x00, 0x09, 0x00, 0x57, 0x00, 0x2d, 0x00, 0x13, 0x00, + 0x58, 0x00, 0x2e, 0x00, 0x64, 0x00, 0x59, 0x00, 0x30, 0x00, 0x44, 0x00, + 0x5a, 0x00, 0x31, 0x00, 0x05, 0x00, 0x5b, 0x00, 0x32, 0x00, 0x4b, 0x00, + 0x5c, 0x00, 0x33, 0x00, 0x05, 0x00, 0x5d, 0x00, 0x34, 0x00, 0x43, 0x00, + 0x5e, 0x00, 0x2f, 0x00, 0x4e, 0x00, 0x5f, 0x00, 0x35, 0x00, 0x08, 0x00, + 0x60, 0x00, 0x3e, 0x00, 0x10, 0x00, 0x61, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x62, 0x00, 0x41, 0x00, 0x13, 0x00, 0x63, 0x00, 0x36, 0x00, 0x05, 0x00, + 0x64, 0x00, 0x37, 0x00, 0x51, 0x00, 0x65, 0x00, 0x38, 0x00, 0x43, 0x00, + 0x66, 0x00, 0x39, 0x00, 0x05, 0x00, 0x67, 0x00, 0x3a, 0x00, 0x3f, 0x00, + 0x68, 0x00, 0x3b, 0x00, 0x33, 0x00, 0x69, 0x00, 0x3c, 0x00, 0x05, 0x00, + 0x6a, 0x00, 0x3d, 0x00, 0x53, 0x00, 0x6b, 0x00, 0x3f, 0x00, 0x8a, 0x00, + 0x28, 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x00, 0xd0, 0x4a, 0x02, 0x00, + 0x10, 0x4c, 0x02, 0x00, 0xcc, 0xd1, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x94, 0x50, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x94, 0x50, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x99, 0x50, 0x02, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x9e, 0x50, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0xa3, 0x50, 0x02, 0x00, 0x28, 0x00, 0x00, 0x00, 0xae, 0x50, 0x02, 0x00, + 0x08, 0x00, 0x00, 0x00, 0xb7, 0x50, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, + 0xbc, 0x50, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, 0xbc, 0x50, 0x02, 0x00, + 0x18, 0x00, 0x00, 0x00, 0xbc, 0x50, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, + 0xc1, 0x50, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xc4, 0x50, 0x02, 0x00, + 0x06, 0x00, 0x00, 0x00, 0xd1, 0x50, 0x02, 0x00, 0x74, 0x00, 0x00, 0x00, + 0xd8, 0x50, 0x02, 0x00, 0x28, 0x00, 0x00, 0x00, 0xe7, 0x50, 0x02, 0x00, + 0x48, 0x00, 0x00, 0x00, 0xf0, 0x50, 0x02, 0x00, 0x28, 0x00, 0x00, 0x00, + 0xe7, 0x50, 0x02, 0x00, 0x28, 0x00, 0x00, 0x00, 0xe7, 0x50, 0x02, 0x00, + 0x28, 0x00, 0x00, 0x00, 0xe7, 0x50, 0x02, 0x00, 0x28, 0x00, 0x00, 0x00, + 0xe7, 0x50, 0x02, 0x00, 0x14, 0x00, 0x00, 0x00, 0xf9, 0x50, 0x02, 0x00, + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x51, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x0f, 0x51, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc1, 0x50, 0x02, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x16, 0x51, 0x02, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x21, 0x51, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2a, 0x51, 0x02, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x2a, 0x51, 0x02, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x31, 0x51, 0x02, 0x00, 0x28, 0x00, 0x00, 0x00, 0x3e, 0x51, 0x02, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x99, 0x50, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x4b, 0x51, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x50, 0x51, 0x02, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x57, 0x51, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, + 0xd1, 0x50, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x99, 0x50, 0x02, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x5c, 0x51, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x94, 0x50, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x94, 0x50, 0x02, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x69, 0x51, 0x02, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x20, 0x4e, 0x02, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x30, 0x4e, 0x02, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x3c, 0x4e, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x42, 0x4e, 0x02, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x4a, 0x4e, 0x02, 0x00, + 0x2c, 0x00, 0x00, 0x00, 0x56, 0x4e, 0x02, 0x00, 0x4c, 0x00, 0x00, 0x00, + 0x5c, 0x4e, 0x02, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x5c, 0x4e, 0x02, 0x00, + 0x4c, 0x00, 0x00, 0x00, 0x5c, 0x4e, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, + 0x62, 0x4e, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x68, 0x4e, 0x02, 0x00, + 0x2c, 0x00, 0x00, 0x00, 0x6e, 0x4e, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, + 0x6e, 0x4e, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x74, 0x4e, 0x02, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x7a, 0x4e, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x4e, 0x02, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x86, 0x4e, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x90, 0x4e, 0x02, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x94, 0x4e, 0x02, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x90, 0x4e, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x9e, 0x4e, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0xa4, 0x4e, 0x02, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x4e, 0x02, 0x00, + 0x2c, 0x00, 0x00, 0x00, 0xcc, 0x4e, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x00, + 0xd2, 0x4e, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0xf2, 0x4e, 0x02, 0x00, + 0x50, 0x00, 0x00, 0x00, 0xfa, 0x4e, 0x02, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x02, 0x4f, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x0e, 0x4f, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x14, 0x4f, 0x02, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x17, 0x4f, 0x02, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0x1d, 0x4f, 0x02, 0x00, 0x2c, 0x00, 0x00, 0x00, + 0x26, 0x4f, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, 0x41, 0x4f, 0x02, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x50, 0x4f, 0x02, 0x00, 0x1c, 0x00, 0x00, 0x00, + 0x5f, 0x4f, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x6e, 0x4f, 0x02, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x7e, 0x4f, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x7e, 0x4f, 0x02, 0x00, 0x10, 0x00, 0x00, 0x00, 0x82, 0x4f, 0x02, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x91, 0x4f, 0x02, 0x00, 0x1c, 0x00, 0x00, 0x00, + 0x99, 0x4f, 0x02, 0x00, 0x6c, 0x00, 0x00, 0x00, 0xa0, 0x4f, 0x02, 0x00, + 0x58, 0x00, 0x00, 0x00, 0xc2, 0x4f, 0x02, 0x00, 0x48, 0x00, 0x00, 0x00, + 0xc9, 0x4f, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x7e, 0x4f, 0x02, 0x00, + 0x50, 0x00, 0x00, 0x00, 0xe5, 0x4f, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x7e, 0x4f, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x05, 0x50, 0x02, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xf2, 0x4e, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x7e, 0x4f, 0x02, 0x00, 0x44, 0x00, 0x00, 0x00, 0x12, 0x50, 0x02, 0x00, + 0x50, 0x00, 0x00, 0x00, 0x2e, 0x50, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x3b, 0x50, 0x02, 0x00, 0x40, 0x00, 0x00, 0x00, 0x3e, 0x50, 0x02, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x56, 0x50, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x7e, 0x4f, 0x02, 0x00, 0x58, 0x00, 0x00, 0x00, 0x70, 0x50, 0x02, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x7a, 0x50, 0x02, 0x00, 0x9c, 0x00, 0x00, 0x00, + 0x7f, 0x50, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0x99, 0x4f, 0x02, 0x00, 0x48, 0x10, 0x57, 0x08, + 0x18, 0x04, 0x02, 0x00, 0x41, 0x11, 0x00, 0x39, 0xc2, 0x12, 0x01, 0x3c, + 0x48, 0x10, 0x57, 0x08, 0x18, 0x04, 0x02, 0x00, 0xc2, 0x11, 0x01, 0x3a, + 0xc1, 0x10, 0x07, 0x01, 0x02, 0x00, 0xc8, 0x10, 0x57, 0x08, 0x18, 0x04, + 0x0a, 0x00, 0x44, 0x10, 0x07, 0x04, 0x0b, 0x00, 0xc4, 0x11, 0x07, 0x34, + 0x0d, 0x00, 0xc4, 0x10, 0x07, 0x04, 0x0e, 0x00, 0xc4, 0x10, 0x07, 0x04, + 0x0f, 0x00, 0xc4, 0x10, 0x07, 0x04, 0x10, 0x00, 0xc4, 0x10, 0x07, 0x04, + 0x11, 0x00, 0xc4, 0x10, 0x07, 0x04, 0x12, 0x00, 0xc4, 0x10, 0x07, 0x04, + 0x13, 0x00, 0xc4, 0x10, 0x07, 0x04, 0x15, 0x00, 0xc2, 0x10, 0x07, 0x02, + 0x16, 0x00, 0x41, 0x10, 0x07, 0x01, 0x17, 0x00, 0xc1, 0x11, 0x00, 0x03, + 0xc1, 0x10, 0x00, 0x01, 0x41, 0x10, 0x07, 0x01, 0x19, 0x00, 0xc1, 0x11, + 0x00, 0x09, 0x01, 0x02, 0x00, 0x82, 0x02, 0x04, 0x44, 0x10, 0x02, 0x04, + 0x44, 0x11, 0x02, 0x0c, 0x44, 0x12, 0x02, 0x14, 0x44, 0x13, 0x02, 0x1c, + 0x44, 0x14, 0x02, 0x24, 0x44, 0x15, 0x02, 0x2c, 0x44, 0x16, 0x02, 0x34, + 0x44, 0x17, 0x02, 0x3c, 0x44, 0x18, 0x02, 0x44, 0xc4, 0x19, 0x02, 0x4c, + 0xc4, 0x10, 0x07, 0x04, 0x1d, 0x00, 0x48, 0x10, 0x57, 0x08, 0x08, 0x04, + 0x1e, 0x00, 0x48, 0x11, 0x57, 0x20, 0x08, 0x04, 0x1f, 0x00, 0x48, 0x12, + 0x57, 0x48, 0x08, 0x04, 0x20, 0x00, 0xc8, 0x13, 0x57, 0x80, 0x08, 0x04, + 0x21, 0x00, 0x41, 0x10, 0x00, 0x01, 0xc1, 0x11, 0x00, 0x03, 0xc8, 0x10, + 0x57, 0x08, 0x0c, 0x04, 0x22, 0x00, 0x41, 0x10, 0x00, 0x01, 0xc6, 0x11, + 0x57, 0x08, 0x10, 0x04, 0x23, 0x00, 0xc8, 0x10, 0x50, 0x08, 0x0a, 0x04, + 0x81, 0x00, 0x00, 0xc4, 0x10, 0x07, 0x04, 0x24, 0x00, 0x01, 0x02, 0x00, + 0xc8, 0x10, 0x51, 0x0c, 0x08, 0x04, 0x01, 0x02, 0x00, 0x42, 0x10, 0x01, + 0x06, 0x42, 0x11, 0x01, 0x0a, 0x48, 0x12, 0x57, 0x14, 0x02, 0x04, 0x26, + 0x00, 0xc8, 0x13, 0x57, 0x24, 0x02, 0x04, 0x26, 0x00, 0x01, 0x02, 0x00, + 0x44, 0x10, 0x02, 0x08, 0x44, 0x11, 0x02, 0x10, 0xc1, 0x12, 0x00, 0x15, + 0x01, 0x57, 0x04, 0x02, 0x04, 0x25, 0x00, 0x42, 0x10, 0x01, 0x0e, 0xc4, + 0x11, 0x02, 0x14, 0x01, 0x57, 0x04, 0x02, 0x04, 0x26, 0x00, 0xc8, 0x10, + 0x57, 0x14, 0x02, 0x04, 0x26, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0x04, + 0x43, 0x10, 0x02, 0x08, 0xc4, 0x11, 0x07, 0x10, 0x27, 0x00, 0xc2, 0x10, + 0x01, 0x02, 0x01, 0x02, 0x00, 0x42, 0x10, 0x01, 0x06, 0x42, 0x11, 0x01, + 0x0a, 0xc1, 0x12, 0x00, 0x0d, 0x41, 0x10, 0x00, 0x01, 0xc2, 0x11, 0x01, + 0x04, 0x81, 0x57, 0x04, 0x03, 0x04, 0x06, 0x00, 0x01, 0x01, 0x00, 0x02, + 0x02, 0x04, 0x03, 0x00, 0x08, 0x04, 0x01, 0x0a, 0x05, 0x51, 0x10, 0x03, + 0x04, 0x06, 0x57, 0x1c, 0x02, 0x04, 0x07, 0x00, 0x07, 0x57, 0x50, 0x03, + 0x04, 0x03, 0x00, 0x88, 0x02, 0x68, 0x81, 0x57, 0x08, 0x02, 0x08, 0x05, + 0x00, 0x41, 0x10, 0x00, 0x01, 0x41, 0x11, 0x00, 0x03, 0x42, 0x12, 0x01, + 0x06, 0x44, 0x13, 0x02, 0x0c, 0x48, 0x14, 0x52, 0x18, 0x05, 0x04, 0xc8, + 0x15, 0x52, 0x34, 0x05, 0x04, 0x44, 0x10, 0x02, 0x04, 0x42, 0x11, 0x01, + 0x0a, 0x44, 0x12, 0x02, 0x10, 0x41, 0x13, 0x00, 0x15, 0x41, 0x14, 0x00, + 0x17, 0x48, 0x15, 0x52, 0x20, 0x05, 0x04, 0xc8, 0x16, 0x52, 0x3c, 0x05, + 0x04, 0x01, 0x00, 0x00, 0x02, 0x01, 0x02, 0x83, 0x57, 0x08, 0x06, 0x04, + 0x04, 0x00, 0x01, 0x00, 0x00, 0x02, 0x01, 0x02, 0x03, 0x01, 0x04, 0x04, + 0x00, 0x06, 0x05, 0x01, 0x08, 0x06, 0x01, 0x0a, 0x07, 0x57, 0x10, 0x02, + 0x04, 0x08, 0x00, 0x88, 0x02, 0x40, 0x01, 0x01, 0x00, 0x02, 0x00, 0x02, + 0x83, 0x57, 0x08, 0x06, 0x04, 0x04, 0x00, 0x81, 0x01, 0x00, 0x41, 0x10, + 0x00, 0x01, 0x42, 0x11, 0x02, 0x04, 0x41, 0x12, 0x00, 0x09, 0x46, 0x13, + 0x52, 0x10, 0x05, 0x04, 0xc8, 0x14, 0x52, 0x2c, 0x05, 0x04, 0x42, 0x10, + 0x01, 0x02, 0x44, 0x11, 0x02, 0x08, 0x41, 0x12, 0x00, 0x0d, 0x42, 0x13, + 0x02, 0x10, 0x41, 0x14, 0x00, 0x15, 0xc6, 0x15, 0x52, 0x1c, 0x05, 0x04, + 0x01, 0x01, 0x00, 0x82, 0x57, 0x08, 0x02, 0x04, 0x05, 0x00, 0x81, 0x52, + 0x04, 0x03, 0x04, 0x01, 0x57, 0x04, 0x02, 0x04, 0x09, 0x00, 0x02, 0x57, + 0x38, 0x02, 0x04, 0x09, 0x00, 0x83, 0x57, 0x6c, 0x02, 0x04, 0x09, 0x00, + 0x01, 0x00, 0x01, 0x02, 0x20, 0x00, 0x00, 0x00, 0x01, 0x20, 0x50, 0x04, + 0x03, 0x04, 0x20, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x04, 0x00, + 0x08, 0x20, 0x52, 0x04, 0x05, 0x04, 0x03, 0x18, 0x03, 0x20, 0x20, 0x51, + 0x04, 0x02, 0x04, 0x20, 0x52, 0x04, 0x05, 0x04, 0x20, 0x00, 0x00, 0x20, + 0x57, 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x24, 0x01, 0x26, 0x01, 0x28, + 0x20, 0x00, 0x00, 0x01, 0x02, 0x01, 0x04, 0x20, 0x57, 0x04, 0x08, 0x04, + 0x00, 0x00, 0x00, 0x24, 0x57, 0x2c, 0x0c, 0x04, 0x0c, 0x00, 0x20, 0x57, + 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x24, 0x20, 0x57, 0x04, 0x10, 0x04, + 0x00, 0x00, 0x00, 0x44, 0x20, 0x57, 0x04, 0x04, 0x04, 0x00, 0x00, 0x20, + 0x57, 0x04, 0x08, 0x04, 0x00, 0x00, 0x57, 0x28, 0x04, 0x04, 0x14, 0x00, + 0x00, 0x78, 0x20, 0x07, 0x00, 0x01, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x20, 0x00, 0x00, 0x00, + 0x01, 0x07, 0x02, 0x18, 0x00, 0x20, 0x01, 0x00, 0x01, 0x02, 0x01, 0x04, + 0x20, 0x07, 0x00, 0x1a, 0x00, 0x07, 0x06, 0x1b, 0x00, 0x01, 0x0c, 0x00, + 0x0e, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x57, 0x08, 0x02, 0x04, + 0x1c, 0x00, 0x20, 0x01, 0x00, 0x00, 0x02, 0x20, 0x01, 0x00, 0x00, 0x02, + 0x01, 0x04, 0x20, 0x00, 0x00, 0x01, 0x02, 0x20, 0x02, 0x00, 0x00, 0x04, + 0x02, 0x08, 0x02, 0x0c, 0x02, 0x10, 0x02, 0x14, 0x20, 0x02, 0x00, 0x01, + 0x04, 0x01, 0x06, 0x01, 0x08, 0x01, 0x0a, 0x01, 0x0c, 0x01, 0x0e, 0x20, + 0xb0, 0xb5, 0x1c, 0x4c, 0x21, 0x78, 0x61, 0xb1, 0x7e, 0x28, 0x11, 0xd1, + 0x61, 0x78, 0x00, 0x25, 0xf9, 0xb1, 0x1a, 0x48, 0x02, 0x68, 0x1a, 0x48, + 0x90, 0x47, 0x65, 0x70, 0xa5, 0x70, 0x25, 0x70, 0xb0, 0xbd, 0x7e, 0x28, + 0x24, 0xd1, 0x00, 0x20, 0x01, 0x21, 0xa0, 0x70, 0x21, 0x70, 0x1e, 0xe0, + 0x7d, 0x28, 0x02, 0xd1, 0x01, 0x20, 0xa0, 0x70, 0xb0, 0xbd, 0x65, 0x78, + 0x69, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, 0x07, 0xdc, 0x00, 0x20, 0x20, 0x70, + 0x0b, 0x48, 0x81, 0x6a, 0x01, 0x31, 0x81, 0x62, 0xb0, 0xbd, 0x00, 0x21, + 0xa2, 0x78, 0x01, 0x2a, 0x06, 0xd1, 0x09, 0x4a, 0x80, 0xf0, 0x20, 0x00, + 0x50, 0x55, 0x00, 0x20, 0xa0, 0x70, 0x01, 0xe0, 0x05, 0x4a, 0x50, 0x55, + 0x48, 0x1c, 0x60, 0x70, 0xb0, 0xbd, 0x00, 0xbf, 0xd4, 0xdb, 0x05, 0x00, + 0xc4, 0x1d, 0x01, 0x00, 0xcc, 0x95, 0x08, 0x00, 0x78, 0x20, 0x01, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, 0x98, 0x95, 0x08, 0x00, + 0x79, 0x51, 0x02, 0x00, 0x2d, 0xe9, 0xf8, 0x43, 0x06, 0x46, 0x1e, 0x48, + 0x08, 0x9c, 0x98, 0x46, 0x91, 0x46, 0x0f, 0x46, 0x00, 0x78, 0x01, 0x28, + 0x06, 0xd0, 0x1b, 0x48, 0x39, 0x46, 0x02, 0x68, 0x30, 0x46, 0x90, 0x47, + 0x01, 0x28, 0x1b, 0xd1, 0x18, 0x48, 0x90, 0xf8, 0xfc, 0x14, 0x18, 0x48, + 0x00, 0xf5, 0xa0, 0x70, 0x01, 0xf0, 0x01, 0x01, 0x00, 0xf0, 0x38, 0xf8, + 0x80, 0xb1, 0x05, 0x46, 0x80, 0xf8, 0x04, 0x90, 0x87, 0x70, 0x06, 0x80, + 0x64, 0xb1, 0x08, 0xf1, 0x04, 0x00, 0x44, 0x21, 0x22, 0x46, 0x41, 0x23, + 0xe8, 0x70, 0x05, 0xf1, 0x08, 0x00, 0xfb, 0xf7, 0xdd, 0xfe, 0x03, 0xe0, + 0xbd, 0xe8, 0xf8, 0x83, 0x01, 0x20, 0xe8, 0x70, 0x0a, 0x48, 0x00, 0xf5, + 0xb4, 0x71, 0x28, 0x46, 0xfe, 0xf7, 0xa8, 0xf8, 0x08, 0x48, 0x0e, 0x21, + 0x00, 0x78, 0xbd, 0xe8, 0xf8, 0x43, 0xfb, 0xf7, 0xd1, 0xbe, 0x00, 0xbf, + 0x25, 0xba, 0x01, 0x00, 0xd4, 0xa2, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0x68, 0x8a, 0x01, 0x00, 0x2c, 0xba, 0x01, 0x00, 0x24, 0xba, 0x01, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, 0x90, 0x95, 0x08, 0x00, + 0x0d, 0x52, 0x02, 0x00, 0x49, 0xf6, 0xd5, 0x5c, 0xc1, 0xf2, 0x11, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xb0, 0xb5, 0x94, 0xb0, 0x21, 0x4d, 0x03, 0xac, + 0x40, 0x21, 0x28, 0x68, 0x13, 0x90, 0x00, 0x20, 0x02, 0x90, 0x20, 0x46, + 0xfe, 0xf7, 0x38, 0xf8, 0x1d, 0x48, 0x00, 0x68, 0x80, 0x47, 0x1d, 0x49, + 0x1d, 0x4a, 0x83, 0xb2, 0x20, 0x46, 0x09, 0x68, 0x00, 0x91, 0x40, 0x21, + 0xff, 0xf7, 0xc0, 0xf8, 0x1a, 0x48, 0x02, 0xaa, 0x90, 0x21, 0x03, 0x68, + 0xff, 0x20, 0x98, 0x47, 0x02, 0x98, 0xc0, 0xb1, 0xcc, 0x21, 0x17, 0x4a, + 0x4f, 0x23, 0x81, 0x70, 0x02, 0x98, 0x50, 0xf8, 0x08, 0x1c, 0x03, 0x30, + 0x09, 0x89, 0x03, 0x39, 0xfb, 0xf7, 0x84, 0xfe, 0x02, 0x98, 0x03, 0xaa, + 0x40, 0x23, 0x50, 0xf8, 0x08, 0x1c, 0x52, 0x30, 0x09, 0x89, 0x52, 0x39, + 0xfb, 0xf7, 0x7a, 0xfe, 0x02, 0x98, 0x01, 0xf0, 0xa9, 0xfc, 0x00, 0x20, + 0x4f, 0xf6, 0xdd, 0x41, 0x01, 0xf0, 0xaa, 0xfc, 0x28, 0x68, 0x13, 0x99, + 0x40, 0x1a, 0x04, 0xbf, 0x14, 0xb0, 0xb0, 0xbd, 0x01, 0xf0, 0xa8, 0xfc, + 0x38, 0xec, 0x01, 0x00, 0xcc, 0x9d, 0x08, 0x00, 0xb8, 0x60, 0x01, 0x30, + 0x98, 0x6d, 0x02, 0x00, 0x24, 0x9c, 0x08, 0x00, 0xd4, 0xd1, 0x05, 0x00, + 0x2d, 0xe9, 0xf8, 0x43, 0x30, 0xb3, 0x0d, 0x46, 0x21, 0xb3, 0x04, 0x46, + 0x47, 0x88, 0x00, 0x88, 0x16, 0x46, 0x48, 0x28, 0x03, 0xd1, 0x28, 0x78, + 0x01, 0x30, 0xb8, 0x42, 0x45, 0xd1, 0x24, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x38, 0xb9, 0x00, 0x20, 0x60, 0x60, 0x60, 0x80, 0x21, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x68, 0xb1, 0x20, 0x88, 0x71, 0x28, + 0x0d, 0xd0, 0xc5, 0x28, 0x19, 0xbf, 0x4f, 0xf0, 0x00, 0x08, 0x4f, 0xf0, + 0x00, 0x09, 0x4f, 0xf0, 0x08, 0x09, 0xdf, 0xf8, 0x6c, 0x80, 0x06, 0xe0, + 0x05, 0x20, 0xbd, 0xe8, 0xf8, 0x83, 0xdf, 0xf8, 0x5c, 0x80, 0x4f, 0xf0, + 0x10, 0x09, 0x60, 0x88, 0x08, 0xb3, 0xb0, 0x42, 0x1f, 0xd8, 0xa7, 0xeb, + 0x09, 0x01, 0x81, 0x42, 0x1b, 0xd1, 0x60, 0x68, 0x2a, 0x46, 0x0b, 0x46, + 0xfb, 0xf7, 0x20, 0xfe, 0xb8, 0xf1, 0x00, 0x0f, 0x18, 0xbf, 0xb9, 0xf1, + 0x00, 0x0f, 0x09, 0xd0, 0x60, 0x88, 0x49, 0x46, 0x4b, 0x46, 0x2a, 0x18, + 0x40, 0x46, 0xfb, 0xf7, 0x13, 0xfe, 0x60, 0x88, 0x48, 0x44, 0x60, 0x80, + 0x08, 0x49, 0x20, 0x88, 0x09, 0x68, 0x88, 0x47, 0x00, 0x20, 0xbd, 0xe8, + 0xf8, 0x83, 0x06, 0x20, 0xbd, 0xe8, 0xf8, 0x83, 0x88, 0xa5, 0x08, 0x00, + 0x84, 0xa5, 0x08, 0x00, 0x74, 0x32, 0x06, 0x00, 0x84, 0x32, 0x06, 0x00, + 0x78, 0xa5, 0x08, 0x00, 0x01, 0xf0, 0x3e, 0xbc, 0xb0, 0xb5, 0x04, 0x46, + 0xc5, 0x78, 0x46, 0x48, 0x46, 0x49, 0x25, 0x22, 0x03, 0x68, 0x20, 0x46, + 0x98, 0x47, 0x00, 0x28, 0x00, 0xf0, 0x82, 0x80, 0xa5, 0xf1, 0x0e, 0x00, + 0x16, 0x28, 0x27, 0xd8, 0xdf, 0xe8, 0x00, 0xf0, 0x28, 0x34, 0x34, 0x34, + 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x0c, 0x39, 0x3d, 0x34, + 0x41, 0x45, 0x55, 0x59, 0x5d, 0x61, 0x65, 0x00, 0x20, 0x46, 0x00, 0xf0, + 0x79, 0xf8, 0x05, 0x46, 0x40, 0xb9, 0x20, 0x46, 0x00, 0xf0, 0xdb, 0xf8, + 0x05, 0x46, 0x18, 0xb9, 0x1a, 0x21, 0x00, 0xf0, 0x07, 0xf9, 0x00, 0x25, + 0x34, 0x48, 0x4f, 0xf6, 0xda, 0x41, 0x2a, 0x46, 0x1a, 0x23, 0x04, 0x68, + 0x02, 0x20, 0xa0, 0x47, 0x00, 0x28, 0x57, 0xd0, 0x45, 0x71, 0x51, 0xe0, + 0x06, 0x2d, 0x0b, 0xd1, 0x2e, 0x48, 0x90, 0xf8, 0x78, 0x00, 0x0d, 0x38, + 0x01, 0x28, 0x05, 0xd8, 0x2a, 0x48, 0x4f, 0xf6, 0xda, 0x41, 0x0c, 0x22, + 0x2b, 0x46, 0x3f, 0xe0, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x01, 0xf0, + 0xf9, 0xbb, 0x20, 0x46, 0x03, 0xf0, 0x58, 0xff, 0x39, 0xe0, 0x20, 0x46, + 0x03, 0xf0, 0x96, 0xff, 0x35, 0xe0, 0x20, 0x46, 0x03, 0xf0, 0xd6, 0xff, + 0x31, 0xe0, 0x20, 0x79, 0x61, 0x79, 0x1d, 0x4b, 0x42, 0x1e, 0xb2, 0xfa, + 0x82, 0xf2, 0x52, 0x09, 0x1a, 0x70, 0x33, 0xf0, 0xc3, 0xfb, 0x02, 0x46, + 0x19, 0x48, 0x4f, 0xf6, 0xda, 0x41, 0x1f, 0x23, 0x1e, 0xe0, 0x20, 0x46, + 0x03, 0xf0, 0xda, 0xff, 0x1d, 0xe0, 0x20, 0x46, 0x04, 0xf0, 0x00, 0xf8, + 0x19, 0xe0, 0x20, 0x46, 0x04, 0xf0, 0x38, 0xf8, 0x15, 0xe0, 0x20, 0x46, + 0x04, 0xf0, 0x14, 0xf8, 0x11, 0xe0, 0x20, 0x79, 0x01, 0x28, 0x06, 0xd8, + 0x0c, 0x49, 0x00, 0x22, 0x00, 0x28, 0x18, 0xbf, 0x01, 0x20, 0x48, 0x70, + 0x00, 0xe0, 0x12, 0x22, 0x09, 0x48, 0x4f, 0xf6, 0xda, 0x41, 0x24, 0x23, + 0x04, 0x68, 0x02, 0x20, 0xa0, 0x47, 0x18, 0xb1, 0xbd, 0xe8, 0xb0, 0x40, + 0x01, 0xf0, 0x9e, 0xbb, 0xb0, 0xbd, 0x00, 0xbf, 0x58, 0x9c, 0x08, 0x00, + 0xb6, 0x6d, 0x02, 0x00, 0x48, 0xdc, 0x05, 0x00, 0x2c, 0x9c, 0x08, 0x00, + 0x50, 0xe2, 0x05, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, 0x81, 0x78, 0x06, 0x29, + 0x5e, 0xd3, 0x90, 0xf8, 0x04, 0x90, 0xb9, 0xf1, 0x05, 0x0f, 0x59, 0xd8, + 0xb9, 0xf1, 0x00, 0x0f, 0x56, 0xd0, 0x00, 0xf1, 0x08, 0x02, 0x02, 0x27, + 0x4f, 0xf0, 0x00, 0x0e, 0x4f, 0xf0, 0x00, 0x08, 0x4f, 0xf0, 0x00, 0x0b, + 0x4f, 0xf0, 0x00, 0x0a, 0x00, 0x92, 0x02, 0x37, 0xfa, 0xb2, 0x8a, 0x42, + 0x46, 0xd8, 0x50, 0xfa, 0x8b, 0xf2, 0x52, 0x79, 0x04, 0x2a, 0x41, 0xd8, + 0x5f, 0xfa, 0x8b, 0xf4, 0x95, 0x1e, 0x23, 0x18, 0x02, 0x2d, 0x9b, 0x79, + 0x05, 0xd2, 0xb8, 0xf1, 0x00, 0x0f, 0x08, 0xbf, 0x4f, 0xf0, 0x01, 0x08, + 0x04, 0xe0, 0x04, 0x2a, 0x08, 0xbf, 0xbe, 0xf1, 0x00, 0x0f, 0x02, 0xd0, + 0xbe, 0xf1, 0x01, 0x0f, 0x04, 0xd1, 0xb8, 0xf1, 0x01, 0x0f, 0x29, 0xd0, + 0x4f, 0xf0, 0x01, 0x0e, 0x04, 0x2b, 0x25, 0xd8, 0x07, 0xeb, 0x43, 0x02, + 0xd7, 0xb2, 0x8f, 0x42, 0x20, 0xd8, 0x8b, 0xb1, 0x00, 0x9a, 0x14, 0x44, + 0x00, 0x22, 0x94, 0xf9, 0x00, 0x50, 0x14, 0xf8, 0x01, 0x6c, 0x15, 0xf1, + 0x80, 0x0c, 0x01, 0xd0, 0x50, 0x2d, 0x13, 0xdc, 0x03, 0x2e, 0x11, 0xd8, + 0x01, 0x32, 0x02, 0x34, 0x9a, 0x42, 0xf0, 0xd1, 0x5a, 0x00, 0x0b, 0xf1, + 0x02, 0x03, 0x0a, 0xf1, 0x01, 0x0a, 0x52, 0xfa, 0x83, 0xfb, 0xca, 0x45, + 0xb9, 0xd1, 0x78, 0x1a, 0x18, 0xbf, 0x12, 0x20, 0xbd, 0xe8, 0xf8, 0x8f, + 0x12, 0x20, 0xbd, 0xe8, 0xf8, 0x8f, 0x2d, 0xe9, 0xf8, 0x4f, 0x90, 0xf8, + 0x04, 0x90, 0xb9, 0xf1, 0x00, 0x0f, 0x26, 0xd0, 0x82, 0x46, 0x08, 0x30, + 0x4f, 0xf0, 0x00, 0x0b, 0x00, 0x26, 0x00, 0x90, 0x5a, 0xfa, 0x8b, 0xf0, + 0x84, 0x79, 0xa4, 0xb1, 0x00, 0x99, 0x5f, 0xfa, 0x8b, 0xf0, 0x4f, 0xf0, + 0x00, 0x08, 0x0f, 0x18, 0x50, 0x44, 0x45, 0x79, 0x97, 0xf9, 0x00, 0x20, + 0x17, 0xf8, 0x01, 0x1c, 0x28, 0x46, 0x00, 0xf0, 0xe9, 0xf8, 0x68, 0xb9, + 0x08, 0xf1, 0x01, 0x08, 0x02, 0x37, 0xa0, 0x45, 0xf2, 0xd1, 0x01, 0x36, + 0x0b, 0xf1, 0x02, 0x00, 0x61, 0x00, 0x51, 0xfa, 0x80, 0xfb, 0x4e, 0x45, + 0xde, 0xd1, 0x00, 0x20, 0xbd, 0xe8, 0xf8, 0x8f, 0x2d, 0xe9, 0xf0, 0x4f, + 0x85, 0xb0, 0x1a, 0x29, 0x40, 0xf0, 0xcc, 0x80, 0xae, 0x4f, 0x03, 0x20, + 0x00, 0x21, 0x00, 0x24, 0x01, 0xeb, 0xc1, 0x02, 0x00, 0x23, 0x00, 0x25, + 0x37, 0xf8, 0x12, 0x20, 0x22, 0xfa, 0x03, 0xf6, 0xf6, 0x07, 0x04, 0xd0, + 0x15, 0xb9, 0x02, 0x30, 0x01, 0x34, 0x01, 0x25, 0x04, 0x30, 0x01, 0x33, + 0x04, 0x2b, 0xf3, 0xd1, 0x01, 0x31, 0x05, 0x29, 0xea, 0xd1, 0x21, 0x06, + 0x00, 0xf0, 0xb0, 0x80, 0x59, 0x49, 0x04, 0xaa, 0x0b, 0x68, 0xc1, 0xb2, + 0xff, 0x20, 0x98, 0x47, 0x04, 0x98, 0x00, 0x28, 0x00, 0xf0, 0xa6, 0x80, + 0xb4, 0x21, 0x9a, 0x4d, 0x00, 0x26, 0x81, 0x70, 0x1a, 0x20, 0x04, 0x99, + 0xc8, 0x70, 0x05, 0xf5, 0xca, 0x71, 0x04, 0x98, 0x00, 0x91, 0x04, 0x71, + 0x00, 0x20, 0x3c, 0x46, 0x05, 0x22, 0x07, 0x21, 0xdd, 0xf8, 0x00, 0x90, + 0x01, 0x96, 0x4f, 0xf0, 0x00, 0x0c, 0x52, 0xfa, 0x86, 0xf2, 0x51, 0xfa, + 0x86, 0xf3, 0x06, 0x21, 0xcd, 0xe9, 0x02, 0x20, 0x00, 0xeb, 0xc0, 0x02, + 0x51, 0xfa, 0x86, 0xf1, 0x00, 0x26, 0x07, 0xeb, 0x42, 0x08, 0x00, 0x22, + 0xb8, 0xf8, 0x00, 0x70, 0x27, 0xfa, 0x0c, 0xf7, 0xff, 0x07, 0x36, 0xd0, + 0x62, 0xb9, 0x22, 0x46, 0x2c, 0x46, 0x0d, 0x46, 0x19, 0x46, 0xdd, 0xe9, + 0x03, 0x07, 0x02, 0x9b, 0xf8, 0x54, 0x0b, 0x46, 0x29, 0x46, 0x25, 0x46, + 0x14, 0x46, 0x01, 0x22, 0x04, 0x9f, 0x06, 0xf1, 0x01, 0x0e, 0xf6, 0xb2, + 0x03, 0xeb, 0x86, 0x0a, 0x07, 0xf8, 0x01, 0xe0, 0x04, 0xeb, 0x0c, 0x07, + 0x04, 0x9e, 0x06, 0xf8, 0x0a, 0xc0, 0x04, 0x9e, 0xb8, 0x78, 0x56, 0x44, + 0x70, 0x70, 0x04, 0x98, 0xbe, 0x79, 0x50, 0x44, 0x86, 0x70, 0x73, 0x48, + 0x90, 0xf8, 0x00, 0xb0, 0xbb, 0xf1, 0x00, 0x0f, 0x0f, 0xd0, 0xbb, 0xf1, + 0x0b, 0x0f, 0x05, 0xeb, 0x0b, 0x06, 0x98, 0xbf, 0xbc, 0xf1, 0x02, 0x0f, + 0x19, 0xf9, 0x0b, 0x00, 0x96, 0xf9, 0x88, 0x61, 0x00, 0xeb, 0x86, 0x06, + 0x07, 0xe0, 0xb6, 0x46, 0x27, 0xe0, 0x95, 0xf9, 0x88, 0x01, 0x99, 0xf9, + 0x00, 0x60, 0x06, 0xeb, 0x80, 0x06, 0x95, 0xf9, 0x0e, 0x72, 0x70, 0xb2, + 0xb8, 0x42, 0x01, 0xdd, 0xfe, 0xb2, 0x16, 0xe0, 0xbb, 0xf1, 0x00, 0x0f, + 0x0d, 0xd0, 0xbb, 0xf1, 0x0b, 0x0f, 0x05, 0xeb, 0x0b, 0x06, 0x98, 0xbf, + 0xbc, 0xf1, 0x02, 0x0f, 0x19, 0xf8, 0x0b, 0x00, 0x96, 0xf8, 0x88, 0x61, + 0x00, 0xeb, 0x86, 0x06, 0x05, 0xe0, 0x95, 0xf8, 0x88, 0x01, 0x99, 0xf8, + 0x00, 0x60, 0x06, 0xeb, 0x80, 0x06, 0x04, 0x98, 0x50, 0x44, 0xc6, 0x70, + 0x76, 0x46, 0x0c, 0xf1, 0x01, 0x0c, 0x09, 0xf1, 0x0c, 0x09, 0xbc, 0xf1, + 0x04, 0x0f, 0x91, 0xd1, 0x32, 0xb1, 0x01, 0x98, 0x51, 0x4f, 0x00, 0xeb, + 0x8e, 0x00, 0x86, 0x1c, 0x03, 0x98, 0x02, 0xe0, 0x4e, 0x4f, 0x03, 0x98, + 0x01, 0x9e, 0x01, 0x30, 0x12, 0x34, 0x05, 0x28, 0x7f, 0xf4, 0x6c, 0xaf, + 0x04, 0x98, 0x01, 0xf0, 0x29, 0xfa, 0xff, 0xe7, 0x05, 0xb0, 0xbd, 0xe8, + 0xf0, 0x8f, 0x00, 0xbf, 0x24, 0x9c, 0x08, 0x00, 0xf8, 0xb5, 0x04, 0x29, + 0x1b, 0xd2, 0x12, 0xf1, 0x80, 0x03, 0x1f, 0xd1, 0x42, 0x4b, 0x00, 0xeb, + 0xc0, 0x00, 0x01, 0x22, 0x8a, 0x40, 0x33, 0xf8, 0x10, 0x40, 0x24, 0xea, + 0x02, 0x02, 0x3c, 0x4c, 0x23, 0xf8, 0x10, 0x20, 0x03, 0xeb, 0x40, 0x02, + 0x00, 0x20, 0x24, 0x78, 0x53, 0x18, 0x02, 0xeb, 0x41, 0x01, 0x4f, 0xf6, + 0x80, 0x72, 0x98, 0x71, 0x9c, 0x70, 0x4a, 0x81, 0xf8, 0xbd, 0x00, 0x20, + 0x40, 0xf6, 0x48, 0x11, 0x01, 0xf0, 0x1c, 0xfa, 0x12, 0x20, 0xf8, 0xbd, + 0x30, 0x4b, 0x93, 0xf9, 0x00, 0xe0, 0xbe, 0xf1, 0x01, 0x0f, 0x1f, 0xdb, + 0xdf, 0xf8, 0xb8, 0xc0, 0x01, 0xeb, 0x41, 0x03, 0x00, 0x27, 0xbe, 0xf1, + 0x0c, 0x0f, 0xa8, 0xbf, 0x4f, 0xf0, 0x0c, 0x0e, 0x0c, 0xeb, 0x83, 0x03, + 0x03, 0xf5, 0xca, 0x76, 0x00, 0x23, 0x0c, 0xeb, 0x07, 0x04, 0xf5, 0x57, + 0x01, 0x37, 0x94, 0xf9, 0x88, 0x41, 0x05, 0xeb, 0x84, 0x04, 0x94, 0x42, + 0xb8, 0xbf, 0x01, 0x33, 0x77, 0x45, 0xf2, 0xdb, 0xdc, 0xb2, 0x0b, 0x2c, + 0x02, 0xd9, 0x02, 0xe0, 0x00, 0x24, 0x00, 0x23, 0x02, 0x29, 0x1d, 0x4d, + 0x01, 0xeb, 0x41, 0x06, 0x05, 0xf5, 0xc4, 0x75, 0x2f, 0x57, 0x05, 0xeb, + 0x86, 0x05, 0x2c, 0x44, 0x94, 0xf9, 0x0c, 0x50, 0xfc, 0xb2, 0x05, 0xeb, + 0x87, 0x06, 0xed, 0xb2, 0x96, 0x42, 0x0a, 0xdd, 0x15, 0x4e, 0x05, 0xeb, + 0x84, 0x04, 0x00, 0xeb, 0xc0, 0x05, 0xa4, 0x1a, 0x06, 0xeb, 0x45, 0x05, + 0x0d, 0x44, 0xac, 0x71, 0x07, 0xe0, 0x10, 0x4d, 0x00, 0xeb, 0xc0, 0x04, + 0x05, 0xeb, 0x44, 0x04, 0x00, 0x25, 0x0c, 0x44, 0xa5, 0x71, 0x0c, 0x4c, + 0x00, 0xeb, 0xc0, 0x00, 0x04, 0xeb, 0x40, 0x05, 0x05, 0xeb, 0x41, 0x06, + 0x72, 0x81, 0x6a, 0x18, 0x93, 0x70, 0x01, 0x22, 0x02, 0xfa, 0x01, 0xf1, + 0x34, 0xf8, 0x10, 0x20, 0x11, 0x43, 0x24, 0xf8, 0x10, 0x10, 0x00, 0x20, + 0xf8, 0xbd, 0x00, 0xbf, 0x6a, 0x34, 0x01, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0xd8, 0xdb, 0x05, 0x00, 0x10, 0xb5, 0x27, 0x48, 0x0f, 0x21, 0x02, 0x68, + 0x4f, 0xf6, 0x17, 0x40, 0x90, 0x47, 0x00, 0x28, 0x45, 0xd0, 0x06, 0x21, + 0x59, 0x4b, 0x05, 0x22, 0x02, 0x24, 0xc1, 0x71, 0x19, 0x21, 0x81, 0x71, + 0x00, 0x21, 0x41, 0x71, 0x93, 0xf8, 0x78, 0x10, 0x42, 0x72, 0x01, 0xf0, + 0x0f, 0x01, 0x02, 0x39, 0xb1, 0xfa, 0x81, 0xf1, 0x49, 0x09, 0x89, 0x00, + 0x01, 0x72, 0x93, 0xf8, 0x78, 0x10, 0xc2, 0x72, 0x01, 0xf0, 0x0f, 0x01, + 0x02, 0x29, 0x08, 0xbf, 0x04, 0x24, 0x84, 0x72, 0x93, 0xf8, 0x78, 0x10, + 0x42, 0x73, 0x01, 0x22, 0x01, 0xf0, 0x0f, 0x01, 0x02, 0x29, 0x4f, 0xf0, + 0x01, 0x01, 0x08, 0xbf, 0x04, 0x21, 0x01, 0x73, 0x03, 0xf1, 0x0a, 0x01, + 0x93, 0xf8, 0x8f, 0x30, 0x1b, 0xb1, 0x01, 0x2b, 0x14, 0xbf, 0x04, 0x22, + 0x02, 0x22, 0x82, 0x73, 0x00, 0x22, 0x09, 0x78, 0xc2, 0x73, 0x04, 0x22, + 0xc2, 0x74, 0x82, 0x74, 0x05, 0x22, 0x42, 0x74, 0x01, 0xf0, 0x0f, 0x01, + 0x02, 0x22, 0x02, 0x29, 0x08, 0xbf, 0x04, 0x22, 0x02, 0x74, 0xbd, 0xe8, + 0x10, 0x40, 0x01, 0xf0, 0x45, 0xb9, 0x10, 0xbd, 0x28, 0x9c, 0x08, 0x00, + 0xbc, 0xb5, 0x04, 0x46, 0xc0, 0x78, 0x03, 0x28, 0x11, 0xd0, 0x19, 0x28, + 0x03, 0xd1, 0xbd, 0xe8, 0xbc, 0x40, 0xff, 0xf7, 0xa3, 0xbf, 0xa2, 0x48, + 0x1b, 0x49, 0x18, 0x22, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x50, 0xb3, + 0xe0, 0x78, 0x19, 0x28, 0xf1, 0xd0, 0x03, 0x28, 0x26, 0xd1, 0x20, 0x79, + 0x78, 0xb1, 0x16, 0x48, 0x01, 0x21, 0x4f, 0xf4, 0x7a, 0x72, 0x4f, 0xf4, + 0x7a, 0x73, 0x01, 0x70, 0x13, 0x48, 0x00, 0x21, 0x05, 0x68, 0x00, 0x20, + 0xcd, 0xe9, 0x00, 0x00, 0x29, 0x20, 0xa8, 0x47, 0x06, 0xe0, 0x0e, 0x48, + 0x00, 0x21, 0x01, 0x70, 0x29, 0x20, 0x00, 0x21, 0x01, 0xf0, 0x36, 0xf9, + 0x02, 0x20, 0x4f, 0xf6, 0x17, 0x41, 0x00, 0x22, 0x01, 0xf0, 0x36, 0xf9, + 0x28, 0xb1, 0xe1, 0x78, 0x81, 0x71, 0xbd, 0xe8, 0xbc, 0x40, 0x01, 0xf0, + 0x05, 0xb9, 0xbc, 0xbd, 0x20, 0x46, 0xbd, 0xe8, 0xbc, 0x40, 0x01, 0xf0, + 0x2f, 0xb9, 0x00, 0xbf, 0xb3, 0x9f, 0x01, 0x10, 0xf8, 0xdd, 0x05, 0x00, + 0xcc, 0x9b, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x01, 0xf0, 0x2a, 0xf9, + 0x0e, 0x48, 0x90, 0xf8, 0x3e, 0x00, 0xc0, 0x06, 0x16, 0xd5, 0x21, 0x79, + 0x6f, 0xf0, 0x02, 0x03, 0xe0, 0x78, 0x6f, 0xf0, 0x02, 0x02, 0xff, 0x29, + 0x08, 0xbf, 0x4f, 0xf0, 0xff, 0x33, 0x00, 0x29, 0x08, 0xbf, 0x0b, 0x46, + 0x06, 0x49, 0xff, 0x28, 0xcb, 0x72, 0x08, 0xbf, 0x4f, 0xf0, 0xff, 0x32, + 0x00, 0x28, 0x08, 0xbf, 0x02, 0x46, 0x8a, 0x72, 0x10, 0xbd, 0x00, 0xbf, + 0x40, 0x86, 0x08, 0x00, 0xa4, 0x11, 0x01, 0x00, 0xf0, 0xb5, 0x85, 0xb0, + 0x06, 0x46, 0x00, 0x20, 0x15, 0x46, 0x0c, 0x46, 0x04, 0xaa, 0x06, 0x21, + 0x04, 0x90, 0x10, 0x48, 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, 0x04, 0x98, + 0xc0, 0xb1, 0x0e, 0x48, 0x02, 0xaf, 0x01, 0x68, 0x38, 0x46, 0x88, 0x47, + 0x0c, 0x48, 0x0d, 0x49, 0x6a, 0x46, 0x03, 0x68, 0x38, 0x46, 0x98, 0x47, + 0x04, 0x99, 0xd1, 0x20, 0x88, 0x70, 0x31, 0x0a, 0x04, 0x98, 0xc6, 0x70, + 0x01, 0x71, 0x29, 0x0a, 0x04, 0x98, 0xc1, 0x71, 0x85, 0x71, 0x44, 0x71, + 0x01, 0xf0, 0xe6, 0xf8, 0x05, 0xb0, 0xf0, 0xbd, 0x24, 0x9c, 0x08, 0x00, + 0x50, 0xa1, 0x08, 0x00, 0x44, 0xa1, 0x08, 0x00, 0x0c, 0xf0, 0x05, 0x00, + 0x70, 0xb5, 0x86, 0xb0, 0x04, 0x46, 0x00, 0x20, 0x55, 0x49, 0x04, 0x22, + 0x05, 0x90, 0x53, 0x48, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0xe8, 0xb3, + 0x52, 0x48, 0xa5, 0x79, 0x05, 0xa9, 0x02, 0x68, 0x20, 0x79, 0x90, 0x47, + 0x40, 0xbb, 0x01, 0x2d, 0x26, 0xd8, 0xe0, 0x78, 0x03, 0x28, 0x33, 0xd0, + 0x02, 0x28, 0x3a, 0xd0, 0x01, 0x28, 0x1f, 0xd1, 0x05, 0x98, 0x00, 0x2d, + 0xd0, 0xf8, 0x88, 0x14, 0x73, 0xd0, 0x41, 0xf0, 0x02, 0x01, 0x21, 0xf0, + 0x20, 0x01, 0xc0, 0xf8, 0x88, 0x14, 0x01, 0xf0, 0xb9, 0xf8, 0x4a, 0x48, + 0x00, 0x26, 0x01, 0x22, 0x05, 0x68, 0x05, 0x98, 0x90, 0xf8, 0xb0, 0x35, + 0x90, 0xf8, 0x35, 0x11, 0x00, 0xf5, 0xee, 0x70, 0xcd, 0xe9, 0x00, 0x26, + 0xcd, 0xe9, 0x02, 0x26, 0x01, 0x2b, 0x08, 0xbf, 0x02, 0x22, 0x68, 0xe0, + 0x01, 0x22, 0x20, 0x78, 0x61, 0x78, 0x40, 0xea, 0x01, 0x20, 0x81, 0xb2, + 0x02, 0x20, 0x01, 0xf0, 0x85, 0xf8, 0x18, 0xb1, 0xe1, 0x78, 0x81, 0x71, + 0x01, 0xf0, 0x56, 0xf8, 0x06, 0xb0, 0x70, 0xbd, 0x05, 0x98, 0xd0, 0xf8, + 0x88, 0x14, 0x2d, 0xb3, 0x02, 0x22, 0x62, 0xf3, 0x98, 0x51, 0x01, 0x22, + 0x07, 0xe0, 0x05, 0x98, 0xd0, 0xf8, 0x88, 0x14, 0xe5, 0xb1, 0x06, 0x22, + 0x62, 0xf3, 0x98, 0x51, 0x00, 0x22, 0xc0, 0xf8, 0x88, 0x14, 0x2a, 0x49, + 0x0b, 0x68, 0x01, 0x21, 0x98, 0x47, 0x05, 0x98, 0xd0, 0xf8, 0x88, 0x14, + 0x8a, 0x07, 0x5c, 0xbf, 0x41, 0xf0, 0x20, 0x01, 0xc0, 0xf8, 0x88, 0x14, + 0x09, 0xb2, 0x00, 0x29, 0x37, 0xd4, 0x23, 0x49, 0x90, 0xf8, 0x35, 0x01, + 0x0a, 0x68, 0x01, 0x21, 0x90, 0x47, 0x30, 0xe0, 0x0a, 0x02, 0x06, 0xd5, + 0x1f, 0x49, 0x0a, 0x68, 0x01, 0x21, 0x90, 0x47, 0x05, 0x98, 0xd0, 0xf8, + 0x88, 0x14, 0x21, 0xf0, 0xc0, 0x72, 0x09, 0xb2, 0x00, 0x29, 0xc0, 0xf8, + 0x88, 0x24, 0x20, 0xd4, 0x19, 0x49, 0x90, 0xf8, 0x35, 0x01, 0x00, 0x22, + 0x0b, 0x68, 0x01, 0x21, 0x98, 0x47, 0x05, 0x98, 0xd0, 0xf8, 0x88, 0x14, + 0x21, 0xf0, 0x20, 0x01, 0xc0, 0xf8, 0x88, 0x14, 0x11, 0xe0, 0x20, 0x22, + 0x02, 0xea, 0x91, 0x22, 0x21, 0xf0, 0x02, 0x01, 0x11, 0x43, 0x90, 0xf8, + 0x35, 0x21, 0xc0, 0xf8, 0x88, 0x14, 0x10, 0x49, 0x0d, 0x68, 0x00, 0xf5, + 0xee, 0x71, 0x10, 0x46, 0x01, 0x22, 0x00, 0x23, 0xa8, 0x47, 0x0a, 0x48, + 0x0c, 0x21, 0x00, 0x78, 0xfb, 0xf7, 0xc8, 0xf9, 0x00, 0x22, 0x8e, 0xe7, + 0x58, 0x9c, 0x08, 0x00, 0xdb, 0x6d, 0x02, 0x00, 0x14, 0x9c, 0x08, 0x00, + 0x08, 0xce, 0x08, 0x00, 0x10, 0xce, 0x08, 0x00, 0x50, 0xd4, 0x08, 0x00, + 0x54, 0xd4, 0x08, 0x00, 0x67, 0x34, 0x01, 0x00, 0x48, 0xd4, 0x08, 0x00, + 0x44, 0xd4, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x05, 0x48, 0x00, 0x78, + 0x01, 0x28, 0x02, 0xd1, 0x00, 0x20, 0xfe, 0xf7, 0x8d, 0xfb, 0x20, 0x46, + 0xbd, 0xe8, 0x10, 0x40, 0x01, 0xf0, 0x18, 0xb8, 0xec, 0x1e, 0x01, 0x00, + 0x70, 0xb5, 0x8e, 0xb0, 0x3c, 0x4d, 0x04, 0x46, 0x34, 0x21, 0x28, 0x68, + 0x0d, 0x90, 0x68, 0x46, 0xfd, 0xf7, 0x26, 0xfb, 0xe0, 0x78, 0x03, 0x28, + 0x62, 0xd1, 0x38, 0x4e, 0xb0, 0x8a, 0xb1, 0x8c, 0xad, 0xf8, 0x00, 0x00, + 0x70, 0x8a, 0xad, 0xf8, 0x02, 0x00, 0xb0, 0x8e, 0xad, 0xf8, 0x06, 0x00, + 0xb0, 0x8b, 0xad, 0xf8, 0x08, 0x00, 0x70, 0x8b, 0xad, 0xf8, 0x0a, 0x00, + 0x96, 0xf8, 0x32, 0x00, 0x8d, 0xf8, 0x0c, 0x00, 0x70, 0x8c, 0x08, 0x44, + 0x4f, 0xf6, 0xff, 0x71, 0x88, 0x42, 0x38, 0xbf, 0x01, 0x46, 0x08, 0x0a, + 0x8d, 0xf8, 0x04, 0x10, 0x96, 0xf8, 0x33, 0x10, 0x8d, 0xf8, 0x05, 0x00, + 0x20, 0x79, 0x8d, 0xf8, 0x0d, 0x10, 0xf1, 0x8e, 0xad, 0xf8, 0x0e, 0x10, + 0x31, 0x8f, 0xad, 0xf8, 0x10, 0x10, 0x31, 0x8b, 0xad, 0xf8, 0x12, 0x10, + 0xf1, 0x8a, 0xad, 0xf8, 0x14, 0x10, 0x31, 0x8c, 0xad, 0xf8, 0x16, 0x10, + 0xf1, 0x8b, 0xad, 0xf8, 0x18, 0x10, 0x80, 0xb1, 0x06, 0xf1, 0x12, 0x00, + 0x14, 0x21, 0xfd, 0xf7, 0x99, 0xff, 0x1a, 0x48, 0x00, 0x21, 0x26, 0xf8, + 0x32, 0x1f, 0x01, 0x80, 0x18, 0x48, 0xf1, 0x80, 0xb1, 0x80, 0x71, 0x80, + 0xc0, 0xe9, 0x00, 0x11, 0x01, 0x81, 0x35, 0x48, 0x1c, 0x21, 0x02, 0x68, + 0x4f, 0xf6, 0x19, 0x40, 0x90, 0x47, 0xa0, 0xb1, 0x04, 0x46, 0x03, 0x20, + 0x6a, 0x46, 0x1a, 0x23, 0xa0, 0x71, 0x00, 0x20, 0x60, 0x71, 0x54, 0xf8, + 0x08, 0x0c, 0x01, 0x89, 0xe0, 0x1d, 0x07, 0x39, 0xfb, 0xf7, 0x30, 0xf9, + 0x20, 0x46, 0x00, 0xf0, 0x5f, 0xff, 0x02, 0xe0, 0x20, 0x46, 0x00, 0xf0, + 0xa9, 0xff, 0x28, 0x68, 0x0d, 0x99, 0x40, 0x1a, 0x04, 0xbf, 0x0e, 0xb0, + 0x70, 0xbd, 0x00, 0xf0, 0x5f, 0xff, 0x00, 0xbf, 0x38, 0xec, 0x01, 0x00, + 0xc4, 0x79, 0x01, 0x00, 0x7e, 0xfa, 0x05, 0x00, 0x74, 0xfa, 0x05, 0x00, + 0x2d, 0xe9, 0xfc, 0x41, 0x4c, 0x48, 0x90, 0xf8, 0x1c, 0x81, 0xd0, 0xf8, + 0x18, 0x41, 0x90, 0xf8, 0x4c, 0x61, 0x19, 0x48, 0x01, 0x68, 0x01, 0xa8, + 0x88, 0x47, 0x18, 0x48, 0xbd, 0xf8, 0x06, 0x70, 0x9d, 0xf8, 0x04, 0x50, + 0x19, 0x21, 0x02, 0x68, 0x4f, 0xf6, 0x53, 0x50, 0x90, 0x47, 0x08, 0xb3, + 0x00, 0x21, 0x1f, 0x22, 0x01, 0x23, 0x07, 0x74, 0x05, 0x73, 0x86, 0x72, + 0x04, 0x72, 0x80, 0xf8, 0x06, 0x80, 0x41, 0x77, 0x01, 0x77, 0xc1, 0x76, + 0x01, 0x76, 0xc1, 0x75, 0x81, 0x75, 0x01, 0x75, 0xc1, 0x73, 0x41, 0x71, + 0x39, 0x0a, 0x82, 0x76, 0x42, 0x75, 0x62, 0x22, 0x43, 0x76, 0xc3, 0x74, + 0x83, 0x74, 0x43, 0x73, 0xc3, 0x72, 0xc3, 0x71, 0x41, 0x74, 0x21, 0x0a, + 0x82, 0x73, 0x41, 0x72, 0x00, 0xf0, 0x10, 0xff, 0xbd, 0xe8, 0xfc, 0x81, + 0xf8, 0xb3, 0x08, 0x00, 0x28, 0x9c, 0x08, 0x00, 0x10, 0xb5, 0x0c, 0x46, + 0x00, 0xf0, 0x5a, 0xff, 0x06, 0x2c, 0x18, 0xbf, 0x10, 0xbd, 0x04, 0x48, + 0x80, 0x21, 0x00, 0x22, 0x03, 0x68, 0x00, 0x20, 0xbd, 0xe8, 0x10, 0x40, + 0x18, 0x47, 0x00, 0xbf, 0x48, 0x9c, 0x08, 0x00, 0x1c, 0xb5, 0x21, 0x48, + 0x21, 0x49, 0x22, 0x4a, 0x06, 0x23, 0x04, 0x68, 0x68, 0x46, 0xa0, 0x47, + 0x0b, 0x20, 0x4f, 0xf6, 0x1d, 0x41, 0x00, 0x22, 0x00, 0xf0, 0x14, 0xff, + 0x04, 0x46, 0x1d, 0x48, 0x90, 0xf8, 0x7c, 0x12, 0xc9, 0x07, 0x04, 0xd0, + 0x1b, 0x49, 0x91, 0xf8, 0xc8, 0x11, 0xc9, 0x07, 0x05, 0xd0, 0x9d, 0xf8, + 0x03, 0x10, 0x01, 0xf0, 0xef, 0x01, 0x8d, 0xf8, 0x03, 0x10, 0x90, 0xf8, + 0xfe, 0x01, 0xc0, 0x07, 0x04, 0xd0, 0x14, 0x48, 0x90, 0xf8, 0xc8, 0x01, + 0xc0, 0x07, 0x05, 0xd0, 0x9d, 0xf8, 0x03, 0x00, 0x00, 0xf0, 0xdf, 0x00, + 0x8d, 0xf8, 0x03, 0x00, 0x9c, 0xb1, 0x00, 0x20, 0x01, 0x21, 0x6a, 0x46, + 0x06, 0x23, 0x60, 0x72, 0xe0, 0x71, 0x19, 0x20, 0x21, 0x72, 0xa0, 0x71, + 0x54, 0xf8, 0x08, 0x0c, 0x01, 0x89, 0x04, 0xf1, 0x0a, 0x00, 0x0a, 0x39, + 0xfb, 0xf7, 0x86, 0xf8, 0x20, 0x46, 0x00, 0xf0, 0xb5, 0xfe, 0x1c, 0xbd, + 0x74, 0xc3, 0x08, 0x00, 0x98, 0x32, 0x06, 0x00, 0xdf, 0x6d, 0x02, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x50, 0xec, 0x01, 0x00, 0x10, 0xb5, 0x04, 0x46, + 0x0e, 0x48, 0xb0, 0xf8, 0x6c, 0x05, 0x40, 0x06, 0x11, 0xd5, 0xe0, 0x78, + 0x05, 0x28, 0x0e, 0xd1, 0xe4, 0x48, 0x02, 0x21, 0x02, 0x68, 0x4f, 0xf6, + 0x3a, 0x40, 0x90, 0x47, 0x60, 0xb1, 0x01, 0x21, 0x41, 0x71, 0xe1, 0x78, + 0x81, 0x71, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x91, 0xbe, 0x20, 0x46, + 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0xe6, 0xbe, 0x10, 0xbd, 0x00, 0xbf, + 0x8c, 0x7e, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0xc1, 0x78, 0x24, 0x29, + 0x0b, 0xd0, 0x23, 0x29, 0x15, 0xd0, 0x1e, 0x29, 0x1c, 0xd1, 0x81, 0x79, + 0x90, 0xf8, 0x04, 0x80, 0x46, 0x79, 0x01, 0x29, 0x25, 0xd9, 0x12, 0x22, + 0x5a, 0xe0, 0x01, 0x79, 0x01, 0x29, 0x15, 0xd1, 0x40, 0x79, 0x98, 0xb1, + 0x03, 0x28, 0x11, 0xd8, 0xe9, 0x49, 0x01, 0x38, 0x00, 0x22, 0xc8, 0x70, + 0x0d, 0xe0, 0x00, 0x79, 0xe6, 0x49, 0x00, 0x22, 0x23, 0x23, 0xc8, 0x72, + 0x33, 0x48, 0x4f, 0xf6, 0xff, 0x71, 0x08, 0xe0, 0xbd, 0xe8, 0xf0, 0x41, + 0x00, 0xf0, 0xbe, 0xbe, 0x12, 0x22, 0x2f, 0x48, 0x4f, 0xf6, 0xff, 0x71, + 0x24, 0x23, 0x04, 0x68, 0x02, 0x20, 0xa0, 0x47, 0x00, 0x28, 0x46, 0xd1, + 0x49, 0xe0, 0x48, 0xea, 0x06, 0x22, 0x16, 0x2a, 0x31, 0xd8, 0x6e, 0x4b, + 0x02, 0xeb, 0x42, 0x04, 0x53, 0xf8, 0x24, 0x00, 0x58, 0xb3, 0x03, 0xeb, + 0x84, 0x04, 0x24, 0x79, 0x03, 0x2c, 0x26, 0xd1, 0xdf, 0xf8, 0x8c, 0xc0, + 0x1c, 0x1d, 0x00, 0x27, 0x4f, 0xf0, 0x68, 0x0e, 0x97, 0x42, 0x0d, 0xd0, + 0x54, 0xf8, 0x04, 0x3c, 0x53, 0xb1, 0x25, 0x78, 0x03, 0x2d, 0x07, 0xd1, + 0x93, 0xf8, 0x35, 0x31, 0x13, 0xfb, 0x0e, 0xc3, 0x93, 0xf8, 0x2e, 0x30, + 0x01, 0x2b, 0x2d, 0xd0, 0x01, 0x37, 0x0c, 0x34, 0x17, 0x2f, 0xeb, 0xd1, + 0x00, 0x22, 0x90, 0xf8, 0x35, 0x31, 0x68, 0x24, 0x13, 0xfb, 0x04, 0xc3, + 0x13, 0xf8, 0x2e, 0x4f, 0x8c, 0x42, 0x00, 0xd0, 0xba, 0xb1, 0x0c, 0x22, + 0x00, 0xe0, 0x02, 0x22, 0x00, 0x27, 0x00, 0x24, 0x0d, 0x48, 0x4f, 0xf6, + 0xff, 0x71, 0x1e, 0x23, 0x05, 0x68, 0x06, 0x20, 0xa8, 0x47, 0x40, 0xb1, + 0x87, 0x72, 0x44, 0x72, 0x06, 0x72, 0x80, 0xf8, 0x07, 0x80, 0xbd, 0xe8, + 0xf0, 0x41, 0x00, 0xf0, 0x09, 0xbe, 0xbd, 0xe8, 0xf0, 0x81, 0x19, 0x70, + 0x00, 0xf0, 0x6a, 0xfe, 0x04, 0x46, 0x07, 0x0a, 0x00, 0x22, 0xe5, 0xe7, + 0x0c, 0x22, 0xd4, 0xe7, 0x2c, 0x9c, 0x08, 0x00, 0xb0, 0xe6, 0x05, 0x00, + 0x2d, 0xe9, 0xf0, 0x43, 0x8d, 0xb0, 0x06, 0x46, 0x00, 0x20, 0x59, 0x21, + 0x00, 0x22, 0x0c, 0x90, 0x07, 0x20, 0x00, 0xf0, 0x19, 0xfe, 0x00, 0x28, + 0x75, 0xd0, 0x04, 0x46, 0x3b, 0x48, 0x37, 0x79, 0x75, 0x79, 0x0c, 0xa9, + 0x02, 0x68, 0x47, 0xea, 0x05, 0x20, 0x90, 0x47, 0x10, 0xb1, 0x02, 0x20, + 0x60, 0x71, 0x65, 0xe0, 0x4f, 0xf0, 0x00, 0x08, 0x0c, 0x21, 0x84, 0xf8, + 0x05, 0x80, 0xf0, 0x78, 0x25, 0x72, 0xe7, 0x71, 0xf0, 0x4d, 0xa0, 0x71, + 0x0c, 0x98, 0xd0, 0xf8, 0xb0, 0x96, 0xd0, 0xf8, 0xb4, 0x66, 0xd0, 0xf8, + 0xb8, 0x76, 0x72, 0xb6, 0x28, 0x68, 0x40, 0x00, 0x01, 0x30, 0x28, 0x60, + 0x0c, 0x98, 0x00, 0xf5, 0xd6, 0x60, 0xfd, 0xf7, 0xdb, 0xfd, 0x28, 0x68, + 0x40, 0x08, 0x28, 0x60, 0x28, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x09, 0xeb, + 0x07, 0x00, 0x82, 0x19, 0x07, 0xd0, 0x42, 0xf2, 0x10, 0x71, 0x00, 0x23, + 0xa0, 0xfb, 0x01, 0x01, 0x00, 0xf0, 0x20, 0xfe, 0x80, 0x46, 0x4f, 0xea, + 0x18, 0x20, 0x0c, 0x99, 0x84, 0xf8, 0x09, 0x80, 0xa0, 0x72, 0x91, 0xf8, + 0x3a, 0x00, 0x80, 0x28, 0x2d, 0xd1, 0x91, 0xf8, 0x35, 0x01, 0x16, 0x28, + 0x11, 0xd8, 0x19, 0x4a, 0x00, 0xeb, 0x40, 0x03, 0x52, 0xf8, 0x23, 0x30, + 0x5b, 0xb1, 0x00, 0xeb, 0x40, 0x00, 0x02, 0xeb, 0x80, 0x00, 0x00, 0x79, + 0x01, 0x28, 0x04, 0xd1, 0x13, 0x48, 0x02, 0x68, 0x05, 0xa8, 0x90, 0x47, + 0x03, 0xe0, 0x12, 0x48, 0x01, 0x68, 0x05, 0xa8, 0x88, 0x47, 0x11, 0x48, + 0xdd, 0xf8, 0x2c, 0xc0, 0x05, 0x99, 0x06, 0x9a, 0x07, 0x9b, 0x08, 0x9d, + 0xdd, 0xf8, 0x28, 0xe0, 0x09, 0x9f, 0x06, 0x68, 0x0c, 0x98, 0x8d, 0xe8, + 0xa0, 0x40, 0xcd, 0xf8, 0x0c, 0xc0, 0xb0, 0x47, 0x0c, 0x98, 0x90, 0xf8, + 0x3a, 0x00, 0xe0, 0x72, 0x20, 0x46, 0x00, 0xf0, 0x77, 0xfd, 0x0d, 0xb0, + 0xbd, 0xe8, 0xf0, 0x83, 0x14, 0x9c, 0x08, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0x24, 0xb8, 0x08, 0x00, 0xc4, 0xb7, 0x08, 0x00, 0x14, 0xb8, 0x08, 0x00, + 0xc1, 0x78, 0x03, 0x29, 0x18, 0xbf, 0x00, 0xf0, 0xd7, 0xbd, 0xff, 0xf7, + 0x69, 0xbf, 0x00, 0xbf, 0x70, 0xb5, 0x04, 0x46, 0xd4, 0x48, 0x3c, 0x49, + 0x04, 0x22, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x00, 0x28, 0x65, 0xd0, + 0xe5, 0x78, 0x03, 0x2d, 0x41, 0xd8, 0xdf, 0xe8, 0x05, 0xf0, 0x02, 0x0a, + 0x11, 0x17, 0x3c, 0x48, 0x62, 0x79, 0x01, 0x68, 0x20, 0x79, 0x40, 0xea, + 0x02, 0x20, 0x80, 0xb2, 0x02, 0xe0, 0x37, 0x49, 0x20, 0x79, 0x09, 0x68, + 0x88, 0x47, 0x00, 0x24, 0x00, 0x26, 0x3c, 0xe0, 0x20, 0x79, 0x32, 0x49, + 0x00, 0x26, 0x01, 0x24, 0x08, 0x70, 0x36, 0xe0, 0x21, 0x79, 0xa1, 0xf1, + 0x0e, 0x00, 0x03, 0x28, 0x1d, 0xd8, 0xdf, 0xe8, 0x00, 0xf0, 0x02, 0x25, + 0x44, 0x48, 0xe0, 0x7a, 0xa1, 0x7a, 0xe2, 0x79, 0x27, 0x4e, 0x23, 0x7a, + 0x41, 0xea, 0x00, 0x20, 0x21, 0x7b, 0x40, 0xea, 0x01, 0x40, 0x61, 0x7b, + 0x40, 0xea, 0x01, 0x60, 0xa1, 0x79, 0x64, 0x7a, 0xc6, 0xf8, 0xd8, 0x02, + 0x41, 0xea, 0x02, 0x20, 0x40, 0xea, 0x03, 0x40, 0x40, 0xea, 0x04, 0x60, + 0xc6, 0xf8, 0x34, 0x02, 0x11, 0xe0, 0x01, 0x29, 0x03, 0xd1, 0x1c, 0x48, + 0x01, 0x68, 0xa0, 0x1d, 0xcc, 0xe7, 0x12, 0x26, 0x00, 0x24, 0x0a, 0xe0, + 0xa0, 0x79, 0xe1, 0x79, 0x22, 0x7a, 0x40, 0xea, 0x01, 0x20, 0x84, 0x49, + 0x21, 0xf8, 0xc4, 0x0f, 0x8a, 0x70, 0x12, 0x26, 0x01, 0x24, 0x17, 0x48, + 0x02, 0x21, 0x02, 0x68, 0x4f, 0xf6, 0x3b, 0x40, 0x90, 0x47, 0x18, 0xb1, + 0x85, 0x71, 0x46, 0x71, 0x00, 0xf0, 0xfa, 0xfc, 0x34, 0xb1, 0xa4, 0x48, + 0x1a, 0x21, 0x00, 0x78, 0xbd, 0xe8, 0x70, 0x40, 0xfa, 0xf7, 0xc6, 0xbe, + 0x70, 0xbd, 0x60, 0x1d, 0x2d, 0xf0, 0x22, 0xfb, 0xa7, 0xe7, 0x04, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x03, 0x48, 0x00, 0x68, 0x80, 0x47, 0xa0, 0xe7, + 0xe5, 0x6d, 0x02, 0x00, 0x3c, 0xbc, 0x08, 0x00, 0x68, 0xfc, 0x08, 0x00, + 0x00, 0x69, 0x08, 0x00, 0xb4, 0xfd, 0x08, 0x00, 0x64, 0x8d, 0x08, 0x00, + 0xbc, 0xfd, 0x08, 0x00, 0xb8, 0xfd, 0x08, 0x00, 0x28, 0x9c, 0x08, 0x00, + 0x7c, 0xb5, 0x05, 0x46, 0x1a, 0x48, 0x40, 0x78, 0x58, 0xb3, 0x1a, 0x48, + 0x0c, 0x46, 0x01, 0xaa, 0x07, 0x21, 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, + 0x01, 0x98, 0x18, 0xb3, 0xda, 0x21, 0x16, 0x4e, 0x81, 0x70, 0x03, 0x20, + 0x01, 0x99, 0xc8, 0x70, 0x95, 0xf8, 0x35, 0x01, 0x01, 0x99, 0x32, 0x68, + 0x08, 0x71, 0x95, 0xf8, 0x36, 0x01, 0x48, 0x71, 0x00, 0x21, 0x95, 0xf8, + 0x74, 0x00, 0x90, 0x47, 0x01, 0x99, 0x32, 0x68, 0x88, 0x71, 0x01, 0x21, + 0x95, 0xf8, 0x74, 0x00, 0x90, 0x47, 0x00, 0x2c, 0x18, 0xbf, 0x01, 0x24, + 0x01, 0x99, 0xe2, 0x01, 0xc8, 0x71, 0x08, 0x46, 0x0a, 0x72, 0x00, 0xf0, + 0xa3, 0xfc, 0x7c, 0xbd, 0x00, 0x20, 0x40, 0xf6, 0x9c, 0x41, 0x00, 0xf0, + 0xbb, 0xfc, 0x7c, 0xbd, 0x48, 0xdc, 0x05, 0x00, 0x24, 0x9c, 0x08, 0x00, + 0x34, 0x9c, 0x08, 0x00, 0xbc, 0xb5, 0x04, 0x46, 0x90, 0xf8, 0x74, 0x00, + 0x90, 0x42, 0x19, 0xd0, 0x0d, 0x46, 0x0d, 0x49, 0x94, 0xf8, 0x35, 0x01, + 0x09, 0x68, 0x88, 0x47, 0x20, 0x46, 0x29, 0x46, 0xff, 0xf7, 0xb2, 0xff, + 0x94, 0xf8, 0x74, 0x00, 0x94, 0xf8, 0x35, 0x11, 0x07, 0x4b, 0x00, 0x22, + 0xc3, 0xe9, 0x00, 0x10, 0x06, 0x48, 0x01, 0x21, 0x04, 0x68, 0x08, 0x20, + 0x00, 0x90, 0x40, 0xf2, 0x13, 0x20, 0xa0, 0x47, 0xbc, 0xbd, 0x00, 0xbf, + 0x54, 0x9c, 0x08, 0x00, 0x8c, 0x34, 0x01, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0xb0, 0xb5, 0x34, 0x4d, 0x28, 0x7c, 0x02, 0x28, 0x15, 0xd1, 0x33, 0x48, + 0x33, 0x49, 0xc0, 0x79, 0x08, 0x70, 0x33, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x32, 0x48, 0x00, 0x68, 0x80, 0x47, 0x32, 0x48, 0x29, 0x68, 0x02, 0x68, + 0xe8, 0x68, 0x90, 0x47, 0x48, 0xb1, 0x30, 0x49, 0x04, 0x46, 0xe8, 0x68, + 0x09, 0x68, 0x88, 0x47, 0x32, 0xe0, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, + 0xc7, 0xbc, 0x2c, 0x4c, 0x72, 0xb6, 0x20, 0x68, 0x40, 0x00, 0x01, 0x30, + 0x20, 0x60, 0x2a, 0x48, 0x29, 0x68, 0x2a, 0x7c, 0x03, 0x68, 0xe8, 0x68, + 0x98, 0x47, 0x20, 0x68, 0x24, 0x49, 0x40, 0x08, 0x20, 0x60, 0x20, 0x68, + 0x80, 0xf3, 0x10, 0x88, 0xe8, 0x68, 0x09, 0x68, 0x88, 0x47, 0x23, 0x48, + 0x00, 0x21, 0x01, 0x70, 0x28, 0x7c, 0x22, 0x49, 0x01, 0x28, 0x08, 0x70, + 0x01, 0xd0, 0x7f, 0x28, 0x01, 0xd1, 0x20, 0x49, 0x08, 0x70, 0x00, 0xf0, + 0xa9, 0xfc, 0x58, 0xb1, 0x1e, 0x48, 0x00, 0x21, 0x00, 0x22, 0x00, 0x24, + 0x03, 0x68, 0x89, 0x20, 0x98, 0x47, 0x1c, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x20, 0x46, 0xb0, 0xbd, 0x72, 0xb6, 0x20, 0x68, 0x40, 0x00, 0x01, 0x30, + 0x20, 0x60, 0x18, 0x48, 0x00, 0x68, 0x80, 0x47, 0x17, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x17, 0x48, 0x00, 0x68, 0x80, 0x47, 0x11, 0x48, 0x02, 0x21, + 0x00, 0x22, 0x03, 0x68, 0x89, 0x20, 0x98, 0x47, 0x13, 0x48, 0x01, 0x68, + 0x41, 0xf0, 0x04, 0x01, 0x01, 0x60, 0xfe, 0xe7, 0x8c, 0x35, 0x01, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0xda, 0xf1, 0x01, 0x00, 0xe0, 0x9d, 0x08, 0x00, + 0xc0, 0x9d, 0x08, 0x00, 0x04, 0xa5, 0x08, 0x00, 0xe0, 0x9b, 0x08, 0x00, + 0x24, 0x36, 0x01, 0x00, 0x08, 0xa5, 0x08, 0x00, 0xde, 0xf1, 0x01, 0x00, + 0xdb, 0xf1, 0x01, 0x00, 0xdc, 0xf1, 0x01, 0x00, 0x7c, 0x9d, 0x08, 0x00, + 0xac, 0x9d, 0x08, 0x00, 0xd4, 0x9d, 0x08, 0x00, 0xa4, 0x9d, 0x08, 0x00, + 0x98, 0x9d, 0x08, 0x00, 0x30, 0x60, 0x01, 0x30, 0x10, 0xb5, 0x00, 0xb3, + 0x04, 0x46, 0x13, 0x48, 0x13, 0x49, 0x4c, 0x22, 0x03, 0x68, 0x20, 0x46, + 0x98, 0x47, 0xc0, 0xb1, 0xe0, 0x78, 0x00, 0xf0, 0xfe, 0x00, 0x04, 0x28, + 0x14, 0xd1, 0x02, 0x20, 0x4f, 0xf6, 0x0c, 0x41, 0x01, 0x22, 0x00, 0xf0, + 0xf5, 0xfb, 0x68, 0xb1, 0xe1, 0x78, 0x81, 0x71, 0x0a, 0x49, 0x0c, 0x31, + 0xfc, 0xf7, 0x68, 0xff, 0x09, 0x48, 0x0a, 0x21, 0x00, 0x78, 0xbd, 0xe8, + 0x10, 0x40, 0xfa, 0xf7, 0x91, 0xbd, 0x10, 0xbd, 0x20, 0x46, 0xbd, 0xe8, + 0x10, 0x40, 0x00, 0xf0, 0x3b, 0xbc, 0x00, 0xbf, 0x58, 0x9c, 0x08, 0x00, + 0x33, 0x9f, 0x01, 0x10, 0x2c, 0xba, 0x01, 0x00, 0x66, 0x34, 0x01, 0x00, + 0x2d, 0xe9, 0xfe, 0x4f, 0x00, 0x21, 0xdf, 0xf8, 0xa0, 0x81, 0xcd, 0xe9, + 0x01, 0x11, 0x90, 0xf8, 0x04, 0x90, 0x45, 0x79, 0x43, 0x46, 0x03, 0xf8, + 0x10, 0x5f, 0xb9, 0xf1, 0x03, 0x0f, 0x4f, 0xd1, 0x00, 0x2d, 0x00, 0xf0, + 0x96, 0x80, 0xd9, 0x78, 0x93, 0xf8, 0x02, 0xe0, 0xdf, 0xf8, 0x7c, 0xb1, + 0x82, 0x1d, 0x00, 0x24, 0x00, 0x26, 0x00, 0x91, 0x5d, 0x49, 0xd1, 0xf8, + 0x00, 0xa0, 0x92, 0xf8, 0x00, 0xc0, 0x51, 0x78, 0x61, 0xf3, 0x0b, 0x2c, + 0x0c, 0xeb, 0x4c, 0x01, 0x5b, 0xf8, 0x21, 0x70, 0xbc, 0xb1, 0xbc, 0xf1, + 0x16, 0x0f, 0x7a, 0xd8, 0x00, 0x2f, 0x78, 0xd0, 0x0b, 0xeb, 0x81, 0x01, + 0x09, 0x79, 0x05, 0x29, 0x73, 0xd1, 0x97, 0xf8, 0x1c, 0x11, 0x01, 0x29, + 0x6f, 0xd1, 0x97, 0xf8, 0x1d, 0x11, 0xc1, 0xeb, 0x01, 0x11, 0x0a, 0xeb, + 0x41, 0x11, 0x89, 0x78, 0xb1, 0x42, 0x1a, 0xd0, 0x65, 0xe0, 0xbc, 0xf1, + 0x16, 0x0f, 0x62, 0xd8, 0x00, 0x2f, 0x60, 0xd0, 0x0b, 0xeb, 0x81, 0x01, + 0x09, 0x79, 0x05, 0x29, 0x5b, 0xd1, 0x97, 0xf8, 0x1c, 0x11, 0x01, 0x29, + 0x57, 0xd1, 0x97, 0xf8, 0x1d, 0x11, 0xc1, 0xeb, 0x01, 0x11, 0x0a, 0xeb, + 0x41, 0x11, 0x8e, 0x78, 0x00, 0x99, 0x11, 0xb1, 0xb6, 0x45, 0x76, 0x46, + 0x4b, 0xd1, 0x01, 0x34, 0x02, 0x32, 0xac, 0x42, 0xbf, 0xd1, 0x14, 0xe0, + 0x95, 0xb1, 0xfb, 0x4c, 0x81, 0x1d, 0x00, 0x22, 0x0e, 0x78, 0x4f, 0x78, + 0x67, 0xf3, 0x0b, 0x26, 0x06, 0xeb, 0x46, 0x06, 0x54, 0xf8, 0x26, 0x60, + 0x96, 0xf8, 0x24, 0x61, 0x0a, 0x2e, 0x54, 0xd1, 0x01, 0x32, 0x02, 0x31, + 0xaa, 0x42, 0xef, 0xd1, 0x00, 0x26, 0x12, 0x22, 0xb9, 0xf1, 0x03, 0x0f, + 0x4c, 0xd8, 0xb9, 0xf1, 0x01, 0x0f, 0x49, 0xd0, 0x95, 0xb1, 0x06, 0x30, + 0x00, 0x21, 0x10, 0xf8, 0x11, 0x20, 0x08, 0xeb, 0x41, 0x04, 0x22, 0x72, + 0x00, 0xeb, 0x41, 0x02, 0x01, 0x31, 0x52, 0x78, 0x62, 0x72, 0x22, 0x89, + 0x6f, 0xf3, 0x1f, 0x32, 0x22, 0x81, 0x1a, 0x78, 0x91, 0x42, 0xee, 0xd3, + 0xb9, 0xf1, 0x03, 0x0f, 0x9e, 0x70, 0x83, 0xf8, 0x01, 0x90, 0x18, 0xbf, + 0xb9, 0xf1, 0x02, 0x0f, 0x13, 0xd0, 0xb9, 0xf1, 0x00, 0x0f, 0x22, 0xd1, + 0x1e, 0x48, 0x01, 0x68, 0x01, 0xa8, 0x88, 0x47, 0xdd, 0xe9, 0x01, 0x01, + 0xc8, 0xe9, 0x00, 0x01, 0x00, 0xf0, 0x38, 0xf8, 0x17, 0xe0, 0x12, 0x22, + 0x1c, 0xe0, 0x00, 0x20, 0x83, 0xf8, 0x01, 0x90, 0x98, 0x70, 0x16, 0x48, + 0x01, 0x68, 0x01, 0xa8, 0x88, 0x47, 0x01, 0x98, 0x40, 0xf2, 0x71, 0x21, + 0x04, 0x30, 0x01, 0x90, 0x48, 0x43, 0xbd, 0xf8, 0x08, 0x10, 0x40, 0x08, + 0x00, 0xeb, 0x11, 0x10, 0x01, 0x21, 0x00, 0xf0, 0xa3, 0xf9, 0xdd, 0xe9, + 0x01, 0x01, 0xc8, 0xe9, 0x00, 0x01, 0xbd, 0xe8, 0xfe, 0x8f, 0x02, 0x22, + 0x0a, 0x48, 0x4f, 0xf6, 0x91, 0x51, 0x06, 0x23, 0x04, 0x68, 0x02, 0x20, + 0xa0, 0x47, 0x00, 0x28, 0xf3, 0xd0, 0x00, 0xf0, 0xdd, 0xfa, 0xbd, 0xe8, + 0xfe, 0x8f, 0x00, 0xbf, 0x34, 0xdc, 0x05, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0xe0, 0x35, 0x01, 0x00, 0x50, 0xa1, 0x08, 0x00, 0x2c, 0x9c, 0x08, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x89, 0xb0, 0xb9, 0x4d, 0x40, 0xf2, 0x71, 0x21, + 0x00, 0x24, 0x07, 0x94, 0xcd, 0xe9, 0x04, 0x44, 0x28, 0x68, 0x48, 0x43, + 0xa9, 0x88, 0x40, 0x08, 0x00, 0xeb, 0x11, 0x10, 0x14, 0x21, 0x06, 0x90, + 0x28, 0x7c, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x80, 0x00, 0xc1, 0xb2, + 0xaf, 0x48, 0x02, 0x68, 0x4f, 0xf6, 0x91, 0x50, 0x90, 0x47, 0x00, 0x28, + 0x00, 0xf0, 0x53, 0x81, 0x06, 0x46, 0x06, 0x20, 0x04, 0xaa, 0x08, 0x21, + 0x08, 0x23, 0xb0, 0x71, 0x74, 0x71, 0x68, 0x7c, 0xf0, 0x71, 0x06, 0xf1, + 0x08, 0x00, 0xfa, 0xf7, 0x71, 0xfc, 0x06, 0xf1, 0x10, 0x00, 0x06, 0xaa, + 0x08, 0x21, 0x08, 0x23, 0xfa, 0xf7, 0x6a, 0xfc, 0x28, 0x7c, 0x00, 0x96, + 0x00, 0x28, 0x30, 0x76, 0x00, 0xf0, 0x36, 0x81, 0x00, 0x98, 0xa3, 0x4f, + 0xac, 0x46, 0x4f, 0xf0, 0x00, 0x0a, 0x00, 0xf1, 0x24, 0x04, 0x00, 0x20, + 0x02, 0x90, 0x00, 0x20, 0x01, 0x90, 0x0c, 0xeb, 0x4a, 0x00, 0x99, 0x49, + 0xb0, 0xf8, 0x08, 0xb0, 0x0b, 0xeb, 0x4b, 0x00, 0xbb, 0xf1, 0x17, 0x0f, + 0x01, 0xeb, 0x80, 0x00, 0x7d, 0xd2, 0xd0, 0xf8, 0x00, 0x90, 0xb9, 0xf1, + 0x00, 0x0f, 0x7a, 0xd0, 0x00, 0x79, 0x03, 0x28, 0x77, 0xd1, 0x91, 0x48, + 0x68, 0x21, 0x40, 0xf2, 0x71, 0x23, 0x0b, 0xfb, 0x01, 0x08, 0xd9, 0xf8, + 0xd4, 0x10, 0x4a, 0x69, 0x09, 0x8b, 0xd8, 0xf8, 0x54, 0x00, 0xb8, 0xf8, + 0x58, 0x70, 0xcd, 0xf8, 0x08, 0x80, 0x5a, 0x43, 0x52, 0x08, 0x02, 0xeb, + 0x11, 0x11, 0xdd, 0xe9, 0x06, 0x32, 0x45, 0x1a, 0x4f, 0xf0, 0x00, 0x00, + 0x60, 0xf1, 0x00, 0x06, 0xe8, 0x1a, 0x66, 0xeb, 0x02, 0x01, 0xb0, 0xf1, + 0x00, 0x40, 0x71, 0xf1, 0x00, 0x00, 0x13, 0xd3, 0x80, 0x48, 0x29, 0x46, + 0x02, 0x68, 0x18, 0x46, 0x90, 0x47, 0xb8, 0xf8, 0x5a, 0x10, 0x40, 0xf2, + 0xe2, 0x42, 0x51, 0x43, 0xb0, 0xfb, 0xf1, 0xf2, 0x17, 0x44, 0x02, 0xfb, + 0x11, 0x00, 0xdd, 0xe9, 0x06, 0x32, 0x1d, 0x1a, 0x62, 0xf1, 0x00, 0x06, + 0xb9, 0xf8, 0x14, 0x03, 0xb9, 0xb2, 0x03, 0x97, 0x81, 0x42, 0x1b, 0xd1, + 0x70, 0x00, 0x90, 0x46, 0x37, 0x46, 0x1e, 0x46, 0x40, 0xf2, 0x71, 0x22, + 0x00, 0x23, 0x40, 0xea, 0xd5, 0x71, 0x4f, 0xf4, 0x1c, 0x70, 0x10, 0xeb, + 0x45, 0x00, 0x41, 0xf1, 0x00, 0x01, 0x00, 0xf0, 0x95, 0xfa, 0xd9, 0xf8, + 0x20, 0x13, 0x33, 0x46, 0x42, 0x46, 0x3e, 0x46, 0x40, 0x1a, 0x20, 0xf0, + 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x08, 0xd8, 0x58, 0x1b, 0x62, 0xeb, + 0x06, 0x01, 0x65, 0x4a, 0x80, 0x1a, 0x71, 0xf1, 0x00, 0x00, 0xc0, 0xf0, + 0xa3, 0x80, 0x02, 0x9e, 0x40, 0xf2, 0xe2, 0x41, 0xb6, 0xf8, 0x5a, 0x00, + 0x41, 0x43, 0x5e, 0x48, 0x02, 0x68, 0x28, 0x46, 0x90, 0x47, 0xdd, 0xf8, + 0x0c, 0x80, 0x06, 0x9b, 0xdf, 0xf8, 0x58, 0xc1, 0xbe, 0x4f, 0x05, 0x46, + 0xa8, 0xf1, 0x01, 0x08, 0x93, 0xe0, 0xd0, 0xf8, 0x00, 0x90, 0x99, 0xf8, + 0x1d, 0x31, 0xd7, 0xf8, 0x00, 0xe0, 0x40, 0xf2, 0x71, 0x25, 0x54, 0x4a, + 0xcd, 0xf8, 0x0c, 0xb0, 0xbb, 0x46, 0xb9, 0xf8, 0x74, 0x81, 0xc3, 0xeb, + 0x03, 0x10, 0x0e, 0xeb, 0x40, 0x10, 0xb0, 0xf8, 0xbc, 0x10, 0xd0, 0xf8, + 0xb8, 0x00, 0x68, 0x43, 0x40, 0x08, 0x00, 0xeb, 0x11, 0x15, 0xdd, 0xe9, + 0x06, 0x10, 0x4e, 0x1b, 0x60, 0xf1, 0x00, 0x07, 0xb6, 0x1a, 0x77, 0xf1, + 0x00, 0x06, 0x24, 0xd3, 0x45, 0x48, 0x02, 0x68, 0x28, 0x46, 0x90, 0x47, + 0x99, 0xf8, 0x1d, 0x31, 0xdb, 0xf8, 0x00, 0xe0, 0x40, 0xf2, 0xe2, 0x46, + 0xdf, 0xf8, 0xf0, 0xc0, 0xc3, 0xeb, 0x03, 0x11, 0x0e, 0xeb, 0x41, 0x11, + 0x09, 0x89, 0x71, 0x43, 0xb0, 0xfb, 0xf1, 0xf6, 0x06, 0xfb, 0x11, 0x00, + 0x00, 0x28, 0x18, 0xbf, 0x01, 0x36, 0x06, 0xfb, 0x01, 0xf0, 0xa8, 0xeb, + 0x06, 0x08, 0x2d, 0x1a, 0x4f, 0xf0, 0x00, 0x00, 0x60, 0xf1, 0x00, 0x06, + 0xdd, 0xe9, 0x06, 0x10, 0x00, 0xe0, 0x00, 0x26, 0xc3, 0xeb, 0x03, 0x13, + 0x5f, 0x46, 0xdd, 0xf8, 0x0c, 0xb0, 0x0e, 0xeb, 0x43, 0x12, 0xd3, 0x68, + 0x5b, 0x19, 0x46, 0xf1, 0x00, 0x05, 0x5e, 0x1a, 0x65, 0xeb, 0x00, 0x00, + 0xb6, 0xf1, 0x00, 0x45, 0x70, 0xf1, 0x00, 0x00, 0x04, 0xd3, 0x10, 0x89, + 0x40, 0xf2, 0xe2, 0x45, 0x68, 0x43, 0x1b, 0x18, 0x58, 0x1a, 0x02, 0xf1, + 0x08, 0x01, 0x01, 0x9a, 0x09, 0x88, 0x04, 0xf8, 0x07, 0x0c, 0x04, 0xf8, + 0x09, 0x8c, 0x04, 0xf8, 0x0b, 0xbc, 0x0a, 0xf1, 0x01, 0x0a, 0x22, 0x70, + 0x02, 0x9a, 0x04, 0xf8, 0x03, 0x1c, 0x04, 0xf8, 0x01, 0x2c, 0x02, 0x0e, + 0x04, 0xf8, 0x04, 0x2c, 0x02, 0x0c, 0x04, 0xf8, 0x05, 0x2c, 0x02, 0x0a, + 0x4f, 0xea, 0x18, 0x20, 0x04, 0xf8, 0x08, 0x0c, 0x4f, 0xea, 0x1b, 0x20, + 0x04, 0xf8, 0x06, 0x2c, 0x04, 0xf8, 0x0a, 0x0c, 0x08, 0x0a, 0x04, 0xf8, + 0x02, 0x0c, 0x0c, 0x34, 0x9c, 0xf8, 0x10, 0x00, 0x82, 0x45, 0xff, 0xf4, + 0xe8, 0xae, 0x11, 0xe0, 0xdf, 0xf8, 0x2c, 0xc0, 0x73, 0x4f, 0xdd, 0xe9, + 0x02, 0x68, 0x30, 0x6b, 0x06, 0xf1, 0x5a, 0x01, 0x00, 0xeb, 0x80, 0x00, + 0xc0, 0xf3, 0x12, 0x32, 0x01, 0x92, 0xc0, 0xf3, 0x1a, 0x10, 0x02, 0x90, + 0x58, 0x1b, 0xc2, 0xe7, 0x00, 0x98, 0x00, 0xf0, 0x5d, 0xf9, 0x09, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0x34, 0xdc, 0x05, 0x00, 0x28, 0x9c, 0x08, 0x00, + 0xe8, 0x72, 0x01, 0x00, 0xb0, 0xe6, 0x05, 0x00, 0x1c, 0x9d, 0x08, 0x00, + 0x01, 0x00, 0x00, 0x80, 0xe0, 0x35, 0x01, 0x00, 0xbc, 0xb5, 0x05, 0x46, + 0x08, 0x48, 0x0c, 0x46, 0x0d, 0xf1, 0x07, 0x01, 0x02, 0x68, 0x1c, 0x20, + 0x90, 0x47, 0x9d, 0xf8, 0x07, 0x00, 0x35, 0xf0, 0x85, 0xff, 0x04, 0x49, + 0x28, 0x46, 0x22, 0x46, 0x2c, 0xf0, 0x3a, 0xfe, 0xbc, 0xbd, 0x00, 0xbf, + 0xf4, 0xfe, 0x08, 0x00, 0x1d, 0x6a, 0x02, 0x00, 0x10, 0xb5, 0x0d, 0x4c, + 0x60, 0x6c, 0x80, 0x07, 0x5c, 0xbf, 0x60, 0x6c, 0x5f, 0xea, 0x80, 0x40, + 0x02, 0xd5, 0x42, 0xf2, 0x02, 0x00, 0x20, 0x60, 0x60, 0x6c, 0x80, 0x06, + 0x5c, 0xbf, 0x60, 0x6c, 0x5f, 0xea, 0x80, 0x30, 0x03, 0xd5, 0x05, 0x48, + 0x20, 0x60, 0xff, 0xf7, 0x4d, 0xfe, 0x00, 0x20, 0xc4, 0xf8, 0xc4, 0x00, + 0x10, 0xbd, 0x00, 0xbf, 0x40, 0x22, 0x00, 0x40, 0x20, 0x00, 0x02, 0x00, + 0x10, 0xb5, 0xc3, 0x78, 0x07, 0x2b, 0x05, 0xd0, 0x06, 0x2b, 0x07, 0xd1, + 0xbd, 0xe8, 0x10, 0x40, 0xff, 0xf7, 0x5c, 0xbd, 0xbd, 0xe8, 0x10, 0x40, + 0x00, 0xf0, 0x0e, 0xb8, 0x41, 0x48, 0x4f, 0xf6, 0x91, 0x51, 0x01, 0x22, + 0x04, 0x68, 0x02, 0x20, 0xa0, 0x47, 0x18, 0xb1, 0xbd, 0xe8, 0x10, 0x40, + 0x00, 0xf0, 0xfa, 0xb8, 0x10, 0xbd, 0x00, 0xbf, 0xf8, 0xb5, 0x41, 0x79, + 0x03, 0x29, 0x59, 0xd1, 0x82, 0x79, 0x00, 0x2a, 0x41, 0xd0, 0x34, 0x49, + 0x34, 0x4e, 0xc4, 0x1d, 0x00, 0x25, 0x4f, 0xf0, 0x00, 0x0c, 0xd1, 0xf8, + 0x00, 0xe0, 0x23, 0x78, 0x61, 0x78, 0x61, 0xf3, 0x0b, 0x23, 0x03, 0xeb, + 0x43, 0x01, 0x56, 0xf8, 0x21, 0x70, 0xad, 0xb1, 0x16, 0x2b, 0x2c, 0xd8, + 0x5f, 0xb3, 0x06, 0xeb, 0x81, 0x01, 0x09, 0x79, 0x05, 0x29, 0x26, 0xd1, + 0x97, 0xf8, 0x1c, 0x11, 0x01, 0x29, 0x22, 0xd1, 0x97, 0xf8, 0x1d, 0x11, + 0xc1, 0xeb, 0x01, 0x11, 0x0e, 0xeb, 0x41, 0x11, 0x89, 0x78, 0x61, 0x45, + 0x14, 0xd0, 0x18, 0xe0, 0x16, 0x2b, 0x16, 0xd8, 0xaf, 0xb1, 0x06, 0xeb, + 0x81, 0x01, 0x09, 0x79, 0x05, 0x29, 0x10, 0xd1, 0x97, 0xf8, 0x1c, 0x11, + 0x01, 0x29, 0x0c, 0xd1, 0x97, 0xf8, 0x1d, 0x11, 0xc1, 0xeb, 0x01, 0x11, + 0x0e, 0xeb, 0x41, 0x11, 0x91, 0xf8, 0x02, 0xc0, 0x01, 0x35, 0x02, 0x34, + 0x95, 0x42, 0xc8, 0xd1, 0x03, 0xe0, 0x02, 0x22, 0x02, 0xe0, 0x4f, 0xf0, + 0x00, 0x0c, 0x00, 0x22, 0x13, 0x4b, 0x13, 0xf8, 0x11, 0x1f, 0x03, 0x29, + 0x02, 0xd1, 0x59, 0x78, 0x61, 0x45, 0x09, 0xd1, 0x4a, 0xb9, 0x00, 0x79, + 0x01, 0x28, 0x13, 0xd1, 0x01, 0x20, 0x83, 0xf8, 0x01, 0xc0, 0x00, 0x22, + 0x98, 0x70, 0x00, 0xe0, 0x12, 0x22, 0x0b, 0x48, 0x4f, 0xf6, 0x91, 0x51, + 0x07, 0x23, 0x04, 0x68, 0x02, 0x20, 0xa0, 0x47, 0x18, 0xb1, 0xbd, 0xe8, + 0xf8, 0x40, 0x00, 0xf0, 0x8d, 0xb8, 0xf8, 0xbd, 0x00, 0x22, 0x9a, 0x70, + 0xef, 0xe7, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0x34, 0xdc, 0x05, 0x00, 0x2c, 0x9c, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x85, 0xb0, 0x07, 0x46, 0x27, 0x48, 0x99, 0x46, 0x93, 0x46, 0x0c, 0x46, + 0x4f, 0xf0, 0x00, 0x0a, 0x04, 0xaa, 0x18, 0x21, 0xcd, 0xf8, 0x10, 0xa0, + 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, 0x04, 0x98, 0xe8, 0xb3, 0x21, 0x48, + 0x02, 0xad, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, 0x1f, 0x48, 0xdf, 0xf8, + 0x80, 0x80, 0x6a, 0x46, 0x03, 0x68, 0x28, 0x46, 0x41, 0x46, 0x98, 0x47, + 0x04, 0x98, 0xd0, 0x21, 0xbd, 0xf8, 0x04, 0x50, 0x00, 0x9e, 0x07, 0xf5, + 0x80, 0x72, 0x06, 0x23, 0x81, 0x70, 0x06, 0x21, 0x04, 0x98, 0x80, 0xf8, + 0x03, 0xa0, 0x04, 0x98, 0x04, 0x30, 0xfa, 0xf7, 0x1d, 0xfa, 0x97, 0xf8, + 0x2c, 0x03, 0x04, 0x99, 0x42, 0x46, 0x08, 0x23, 0x88, 0x72, 0x81, 0xf8, + 0x14, 0xb0, 0x81, 0xf8, 0x0b, 0x90, 0x01, 0xf1, 0x0c, 0x00, 0x08, 0x21, + 0xfa, 0xf7, 0x0e, 0xfa, 0x04, 0x98, 0x21, 0x0a, 0x2a, 0x09, 0x41, 0x76, + 0x40, 0xf2, 0x71, 0x21, 0x04, 0x76, 0x80, 0xf8, 0x15, 0xa0, 0x71, 0x43, + 0x02, 0xeb, 0x51, 0x01, 0x0a, 0x0a, 0x81, 0x75, 0xc2, 0x75, 0x00, 0xf0, + 0x2f, 0xf8, 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x24, 0x9c, 0x08, 0x00, + 0x50, 0xa1, 0x08, 0x00, 0x44, 0xa1, 0x08, 0x00, 0x0c, 0xf0, 0x05, 0x00, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x08, 0x48, 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, 0x09, 0x49, 0x01, 0x60, + 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x70, 0x47, 0x50, 0xb5, 0x08, 0x00, + 0xe1, 0x5a, 0x02, 0x00, 0x5c, 0xa3, 0x08, 0x00, 0x65, 0x53, 0x02, 0x00, + 0xec, 0xa3, 0x08, 0x00, 0xf1, 0x5d, 0x02, 0x00, 0xd8, 0xd7, 0x08, 0x00, + 0x71, 0x5e, 0x02, 0x00, 0x58, 0xa3, 0x08, 0x00, 0xa9, 0x63, 0x02, 0x00, + 0x40, 0xf6, 0x41, 0x5c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x40, 0xf6, 0x61, 0x6c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4a, 0xf6, 0x49, 0x1c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf2, 0xb3, 0x0c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x48, 0xf6, 0x75, 0x5c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4c, 0xf6, 0xe1, 0x4c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x44, 0xf6, 0x5d, 0x0c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x40, 0xf6, 0x09, 0x6c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x48, 0xf2, 0x51, 0x1c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf6, 0x05, 0x1c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf6, 0x79, 0x6c, 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x41, 0xf2, 0x5b, 0x7c, 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf2, 0xb1, 0x4c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x48, 0xf2, 0xc1, 0x5c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf2, 0x6d, 0x2c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf6, 0x11, 0x5c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf2, 0x5d, 0x4c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x43, 0xf2, 0x77, 0x0c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf6, 0xc1, 0x0c, 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x44, 0xf6, 0x95, 0x3c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x45, 0xf6, 0xc1, 0x5c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x41, 0xf2, 0x71, 0x2c, 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x46, 0xf6, 0x21, 0x2c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x20, 0x50, 0x61, 0x74, 0x63, 0x68, 0x56, 0x65, 0x72, 0x3d, 0x30, 0x78, + 0x25, 0x6c, 0x58, 0x20, 0x53, 0x6f, 0x43, 0x49, 0x44, 0x3d, 0x30, 0x78, + 0x25, 0x38, 0x6c, 0x58, 0x20, 0x00, 0x01, 0x01, 0x04, 0x03, 0x03, 0x03, + 0x02, 0x01, 0x01, 0x02, 0x01, 0x04, 0x01, 0x02, 0xff, 0xff, 0x05, 0x06, + 0x01, 0x02, 0x04, 0x05, 0x03, 0x02, 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, + 0x02, 0x03, 0x02, 0x02, 0x03, 0x02, 0x02, 0x00, 0x04, 0x04, 0x04, 0x1c, + 0xfd, 0x7f, 0xfc, 0x01, 0x01, 0x03, 0x02, 0x02, 0xff, 0x00, 0x00, 0x00, + 0xf0, 0xb5, 0x67, 0x4d, 0x6f, 0xf3, 0x9f, 0x20, 0x00, 0x22, 0x16, 0x23, + 0x0b, 0x24, 0xa6, 0xb2, 0x35, 0xf8, 0x36, 0x60, 0xb0, 0x42, 0x0c, 0xd0, + 0x94, 0xbf, 0x23, 0x46, 0x62, 0x1c, 0x96, 0xb2, 0x9f, 0xb2, 0x16, 0xfa, + 0x83, 0xf4, 0xbe, 0x42, 0x4f, 0xea, 0x54, 0x04, 0xef, 0xd3, 0x00, 0x20, + 0xf0, 0xbd, 0x01, 0x20, 0x0c, 0x80, 0xf0, 0xbd, 0x70, 0xb5, 0x05, 0x46, + 0x0f, 0x48, 0x16, 0x46, 0x0c, 0x46, 0x00, 0x68, 0x80, 0x47, 0x28, 0xb1, + 0x55, 0x48, 0x00, 0xeb, 0xc6, 0x00, 0xc0, 0x78, 0x80, 0x07, 0x0a, 0xd4, + 0x52, 0x48, 0xa9, 0x78, 0x00, 0xeb, 0xc6, 0x00, 0x80, 0x78, 0x81, 0x42, + 0x18, 0xbf, 0xff, 0x28, 0x03, 0xd1, 0x01, 0x20, 0x70, 0xbd, 0x0c, 0x20, + 0x00, 0xe0, 0x12, 0x20, 0x21, 0x46, 0xff, 0xf7, 0x17, 0xff, 0x00, 0x20, + 0x70, 0xbd, 0x00, 0xbf, 0x34, 0xa4, 0x08, 0x00, 0x7c, 0xb5, 0x04, 0x46, + 0x00, 0x78, 0x45, 0x4a, 0x61, 0x78, 0x40, 0xea, 0x01, 0x20, 0x25, 0x49, + 0x86, 0xb2, 0x88, 0x80, 0x30, 0x46, 0x12, 0x68, 0x0a, 0x60, 0x4f, 0xf6, + 0xff, 0x71, 0xad, 0xf8, 0x06, 0x10, 0x0d, 0xf1, 0x06, 0x01, 0xff, 0xf7, + 0xab, 0xff, 0x01, 0x28, 0x1b, 0xd1, 0xbd, 0xf8, 0x06, 0x50, 0x20, 0x46, + 0x31, 0x46, 0x2a, 0x46, 0xff, 0xf7, 0xbe, 0xff, 0x01, 0x28, 0x2c, 0xd1, + 0x37, 0x48, 0x00, 0xeb, 0xc5, 0x06, 0x16, 0xf8, 0x03, 0x1f, 0xc9, 0x07, + 0x0f, 0xd1, 0x17, 0x48, 0x00, 0xf1, 0x54, 0x01, 0x20, 0x46, 0xfc, 0xf7, + 0x83, 0xfa, 0x15, 0x48, 0x04, 0x21, 0x00, 0x78, 0xfa, 0xf7, 0xae, 0xf8, + 0x7c, 0xbd, 0x20, 0x46, 0x00, 0xf0, 0x6e, 0xf8, 0x7c, 0xbd, 0x00, 0xeb, + 0xc5, 0x00, 0x41, 0x68, 0x89, 0xb1, 0x20, 0x46, 0x88, 0x47, 0x2a, 0x48, + 0x90, 0xf8, 0x2c, 0x01, 0xc0, 0x06, 0x0a, 0xd4, 0x08, 0x48, 0x00, 0x78, + 0x01, 0x28, 0x06, 0xd0, 0x30, 0x78, 0x40, 0x07, 0x03, 0xd5, 0x00, 0x20, + 0x00, 0x21, 0xff, 0xf7, 0xc5, 0xfe, 0x20, 0x46, 0xff, 0xf7, 0xf8, 0xfe, + 0x7c, 0xbd, 0x00, 0xbf, 0x54, 0xdc, 0x05, 0x00, 0x9e, 0x53, 0x01, 0x00, + 0x2c, 0xba, 0x01, 0x00, 0x67, 0x34, 0x01, 0x00, 0x7c, 0xb5, 0x06, 0x46, + 0x0d, 0x46, 0x41, 0xf4, 0x7c, 0x40, 0x16, 0x49, 0x34, 0x68, 0x88, 0x80, + 0x15, 0x48, 0x00, 0x68, 0x08, 0x60, 0x4f, 0xf6, 0xff, 0x70, 0x0d, 0xf1, + 0x06, 0x01, 0xad, 0xf8, 0x06, 0x00, 0x28, 0x46, 0xff, 0xf7, 0x52, 0xff, + 0x01, 0x28, 0x15, 0xd1, 0xbd, 0xf8, 0x06, 0x00, 0x0e, 0x49, 0x01, 0xeb, + 0xc0, 0x05, 0x69, 0x68, 0x09, 0xb1, 0x20, 0x46, 0x88, 0x47, 0x0c, 0x48, + 0x90, 0xf8, 0x2c, 0x01, 0xc0, 0x06, 0x0b, 0xd4, 0xe8, 0x78, 0x40, 0x07, + 0x08, 0xd5, 0x00, 0x20, 0x00, 0x21, 0xff, 0xf7, 0x8d, 0xfe, 0x7c, 0xbd, + 0x30, 0x46, 0x29, 0x46, 0x00, 0xf0, 0x20, 0xf8, 0x7c, 0xbd, 0x00, 0xbf, + 0x5c, 0xdc, 0x05, 0x00, 0x24, 0x20, 0x00, 0x40, 0x24, 0xd2, 0x05, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x03, 0x48, 0x04, 0x49, 0x01, 0x60, 0x04, 0x48, + 0x04, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x20, 0xe6, 0x08, 0x00, + 0x21, 0x6f, 0x02, 0x00, 0xd0, 0xa9, 0x08, 0x00, 0x6d, 0x6e, 0x02, 0x00, + 0x4a, 0xf2, 0x2d, 0x1c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4a, 0xf2, 0xa1, 0x1c, 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x5c, 0x49, 0x09, 0x78, 0x02, 0x29, 0x04, 0xd1, 0x0a, 0x49, 0x09, 0x88, + 0x08, 0x43, 0x0a, 0x49, 0x0b, 0xe0, 0x07, 0x49, 0x09, 0x78, 0x0b, 0x29, + 0x08, 0xd1, 0x06, 0x4a, 0x01, 0x02, 0x11, 0x80, 0x05, 0x49, 0x0a, 0x68, + 0xd2, 0xb2, 0x42, 0xea, 0x00, 0x20, 0x08, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x8c, 0x01, 0x01, 0x00, 0x26, 0x21, 0x01, 0x00, 0x04, 0x08, 0x00, 0x40, + 0xf8, 0xb5, 0x18, 0x48, 0x00, 0x68, 0x80, 0x47, 0x17, 0x4c, 0x20, 0x68, + 0xc0, 0xb2, 0x52, 0x28, 0x0c, 0xd0, 0x17, 0x48, 0x15, 0x4d, 0x41, 0xf2, + 0x88, 0x36, 0x47, 0x1c, 0x28, 0x88, 0x70, 0x43, 0x02, 0x38, 0xb8, 0x47, + 0x20, 0x68, 0xc0, 0xb2, 0x52, 0x28, 0xf7, 0xd1, 0x00, 0x20, 0x12, 0x49, + 0x4f, 0xf0, 0x00, 0x52, 0x4f, 0xf4, 0x10, 0x23, 0x20, 0x60, 0x0e, 0x48, + 0x00, 0x68, 0x08, 0x44, 0x4f, 0xf4, 0x10, 0x21, 0xf9, 0xf7, 0xe8, 0xff, + 0x08, 0x48, 0x41, 0xf2, 0x88, 0x31, 0x00, 0x88, 0x48, 0x43, 0x07, 0x49, + 0x02, 0x38, 0x01, 0x31, 0x88, 0x47, 0x60, 0x68, 0x07, 0x48, 0x60, 0x60, + 0xf8, 0xbd, 0x00, 0xbf, 0x80, 0xf2, 0x08, 0x00, 0x80, 0x10, 0x01, 0x30, + 0x34, 0xec, 0x01, 0x00, 0x40, 0xec, 0x01, 0x00, 0x08, 0x00, 0x00, 0x70, + 0x00, 0x00, 0xc0, 0x6e, 0x52, 0x44, 0x44, 0x41, 0x10, 0xb5, 0x08, 0x4c, + 0x20, 0x78, 0x01, 0x28, 0x02, 0xd1, 0x60, 0x78, 0x01, 0x28, 0x05, 0xd0, + 0x00, 0xf0, 0x64, 0xf8, 0x20, 0x78, 0x01, 0x28, 0x18, 0xbf, 0x10, 0xbd, + 0xbd, 0xe8, 0x10, 0x40, 0xff, 0xf7, 0xae, 0xbf, 0xf8, 0xdd, 0x05, 0x00, + 0x10, 0xb5, 0x0f, 0x4b, 0x0f, 0x4a, 0x19, 0x68, 0x01, 0x31, 0x31, 0x29, + 0x88, 0xbf, 0x00, 0x21, 0x19, 0x60, 0x14, 0x68, 0x0c, 0x4a, 0xff, 0x28, + 0x42, 0xf8, 0x31, 0x40, 0x01, 0xd0, 0x03, 0x46, 0x06, 0xe0, 0xef, 0xf3, + 0x05, 0x84, 0x19, 0x68, 0xa4, 0xf1, 0x10, 0x03, 0x43, 0xf4, 0x00, 0x43, + 0x02, 0xeb, 0xc1, 0x01, 0x4b, 0x60, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, + 0x41, 0xb8, 0x00, 0xbf, 0x64, 0xdc, 0x05, 0x00, 0x24, 0x20, 0x00, 0x40, + 0x68, 0xdc, 0x05, 0x00, 0x70, 0xb5, 0x06, 0x46, 0x06, 0x48, 0x0d, 0x46, + 0x14, 0x46, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0x30, 0x46, 0x29, 0x46, + 0x22, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, 0x31, 0xb8, 0x00, 0xbf, + 0xa8, 0xfd, 0x08, 0x00, 0x07, 0x48, 0x02, 0x21, 0x01, 0x70, 0x07, 0x48, + 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x09, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x6f, 0x34, 0x01, 0x00, 0x00, 0x9d, 0x08, 0x00, 0xcd, 0x6f, 0x02, 0x00, + 0xd0, 0x8f, 0x08, 0x00, 0x89, 0x70, 0x02, 0x00, 0xa4, 0x8d, 0x08, 0x00, + 0xb1, 0x70, 0x02, 0x00, 0x60, 0xa0, 0x08, 0x00, 0xfd, 0x70, 0x02, 0x00, + 0x4c, 0xf6, 0x01, 0x3c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf6, 0xa5, 0x7c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4c, 0xf2, 0x51, 0x2c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xf0, 0xb5, 0x85, 0xb0, 0x06, 0x46, 0x40, 0xf2, 0x16, 0x70, 0x0c, 0x46, + 0x86, 0x42, 0x05, 0xd1, 0x03, 0xad, 0x28, 0x46, 0x2f, 0xf0, 0xe8, 0xfe, + 0x08, 0x23, 0x00, 0xe0, 0x15, 0x46, 0x9e, 0x48, 0x01, 0x21, 0x22, 0x46, + 0x07, 0x68, 0x00, 0x20, 0xcd, 0xe9, 0x00, 0x30, 0x30, 0x46, 0x2b, 0x46, + 0xb8, 0x47, 0x05, 0xb0, 0xf0, 0xbd, 0x00, 0xbf, 0xf8, 0xb5, 0x14, 0x46, + 0x0a, 0x46, 0x88, 0x49, 0x00, 0xf0, 0x07, 0x03, 0x01, 0xeb, 0xd0, 0x01, + 0x91, 0xf8, 0x50, 0x11, 0xd9, 0x40, 0xc9, 0x07, 0x27, 0xd0, 0x14, 0x4d, + 0x55, 0xf8, 0x04, 0x1f, 0x01, 0xb3, 0xeb, 0x88, 0xaf, 0x88, 0x1e, 0x19, + 0xbe, 0x42, 0x1b, 0xd2, 0x5e, 0x1c, 0x40, 0x28, 0xee, 0x80, 0x39, 0xbf, + 0x40, 0xf0, 0xc0, 0x00, 0xc8, 0x54, 0xff, 0x26, 0xce, 0x54, 0x21, 0xbf, + 0xe9, 0x88, 0x4b, 0x1c, 0xeb, 0x80, 0x2b, 0x68, 0x28, 0xbf, 0x58, 0x54, + 0xe9, 0x88, 0x28, 0x68, 0xab, 0x88, 0x08, 0x44, 0x59, 0x1a, 0x23, 0x46, + 0xf9, 0xf7, 0x02, 0xff, 0xe8, 0x88, 0x20, 0x44, 0xe8, 0x80, 0xf8, 0xbd, + 0x68, 0x7a, 0x01, 0x30, 0x68, 0x72, 0xf8, 0xbd, 0x78, 0x34, 0x01, 0x00, + 0xb0, 0xb5, 0x0d, 0x46, 0x04, 0x46, 0x00, 0xf0, 0xf7, 0xf8, 0x20, 0x78, + 0xc0, 0x07, 0x0d, 0xd0, 0x02, 0x2d, 0x0b, 0xd3, 0x68, 0x48, 0x62, 0x78, + 0xb0, 0xf8, 0x3c, 0x11, 0xd2, 0x07, 0x0c, 0xbf, 0x41, 0xf4, 0x00, 0x51, + 0x21, 0xf4, 0x00, 0x51, 0xa0, 0xf8, 0x3c, 0x11, 0xb0, 0xbd, 0x00, 0xbf, + 0x2d, 0xe9, 0xf8, 0x4f, 0xb0, 0xf5, 0xc0, 0x6f, 0x31, 0xd0, 0x0f, 0x46, + 0x40, 0xf2, 0x14, 0x61, 0x88, 0x42, 0x2c, 0xd0, 0x15, 0x46, 0x40, 0xf2, + 0xfd, 0x62, 0xdd, 0xf8, 0x28, 0x90, 0x1c, 0x46, 0x90, 0x42, 0x27, 0xd0, + 0x40, 0xf2, 0xa9, 0x61, 0x88, 0x42, 0x22, 0xd1, 0xfc, 0xb1, 0xdf, 0xf8, + 0xec, 0xa0, 0x3b, 0x49, 0x1a, 0xf8, 0x01, 0x0f, 0x00, 0xeb, 0x40, 0x00, + 0x51, 0xf8, 0x20, 0xb0, 0x38, 0x48, 0x39, 0x46, 0x02, 0x68, 0x4f, 0xf4, + 0xc0, 0x60, 0x90, 0x47, 0x78, 0xb1, 0x36, 0x48, 0x01, 0x68, 0x09, 0xf1, + 0x0c, 0x00, 0x1f, 0xfa, 0x80, 0xf8, 0x40, 0x46, 0x88, 0x47, 0x30, 0xb1, + 0x06, 0x46, 0x9b, 0xf8, 0xb0, 0x05, 0x01, 0x28, 0x0e, 0xd1, 0x03, 0x21, + 0x12, 0xe0, 0xbd, 0xe8, 0xf8, 0x8f, 0x01, 0x46, 0x08, 0x46, 0x39, 0x46, + 0x2a, 0x46, 0x23, 0x46, 0xcd, 0xf8, 0x00, 0x90, 0x00, 0xf0, 0xa8, 0xf8, + 0xbd, 0xe8, 0xf8, 0x8f, 0x9b, 0xf8, 0x00, 0x00, 0x01, 0x38, 0xb0, 0xfa, + 0x80, 0xf0, 0x41, 0x09, 0x25, 0x4a, 0x9a, 0xf8, 0x03, 0x00, 0x12, 0x68, + 0x90, 0x47, 0x8a, 0xf8, 0x03, 0x00, 0x9b, 0xf8, 0x74, 0x00, 0x06, 0xf1, + 0x0a, 0x03, 0x39, 0x46, 0x2a, 0x46, 0x8a, 0xf8, 0x06, 0x00, 0x1f, 0x48, + 0xd0, 0xf8, 0x00, 0xc0, 0x09, 0xf1, 0x02, 0x00, 0x80, 0xb2, 0x00, 0x90, + 0x4f, 0xf4, 0xc0, 0x60, 0xe0, 0x47, 0x56, 0xf8, 0x08, 0x0c, 0x22, 0x46, + 0x4b, 0x46, 0x01, 0x89, 0x06, 0xf1, 0x14, 0x00, 0x14, 0x39, 0xf9, 0xf7, + 0x73, 0xfe, 0x09, 0xf1, 0x14, 0x00, 0x15, 0x4a, 0x00, 0x21, 0x04, 0x23, + 0xff, 0x24, 0xc0, 0xb2, 0x92, 0xf8, 0x5f, 0x50, 0x01, 0x2d, 0x01, 0xeb, + 0x00, 0x05, 0x11, 0xbf, 0x74, 0x55, 0x02, 0xeb, 0x41, 0x07, 0xb7, 0xf9, + 0x58, 0x70, 0x97, 0xfb, 0xf3, 0xf7, 0x08, 0xbf, 0x77, 0x55, 0x00, 0x29, + 0x4f, 0xf0, 0x01, 0x01, 0xec, 0xd0, 0x0a, 0x48, 0x41, 0x46, 0x02, 0x68, + 0x30, 0x46, 0xbd, 0xe8, 0xf8, 0x4f, 0x10, 0x47, 0xe0, 0x76, 0x01, 0x00, + 0xe8, 0x72, 0x01, 0x00, 0xd4, 0xa2, 0x08, 0x00, 0xd8, 0xa2, 0x08, 0x00, + 0x34, 0x9c, 0x08, 0x00, 0xcc, 0xa2, 0x08, 0x00, 0xd0, 0xe2, 0x05, 0x00, + 0xdc, 0xa2, 0x08, 0x00, 0xbc, 0xb5, 0x07, 0x4c, 0x25, 0x78, 0x06, 0x9c, + 0x25, 0xb1, 0x1c, 0x4d, 0x00, 0x94, 0x2d, 0x68, 0xa8, 0x47, 0xbc, 0xbd, + 0x07, 0x9d, 0xcd, 0xe9, 0x00, 0x45, 0x00, 0xf0, 0x43, 0xf8, 0xbc, 0xbd, + 0xdb, 0xb8, 0x01, 0x00, 0x80, 0xb5, 0x09, 0x4a, 0xb2, 0xf8, 0x3c, 0x31, + 0xdb, 0x07, 0x01, 0xd1, 0x00, 0x20, 0x80, 0xbd, 0x20, 0xf0, 0xff, 0x03, + 0xb3, 0xf5, 0x80, 0x6f, 0x03, 0xd1, 0x92, 0xf8, 0x7b, 0x22, 0x00, 0x2a, + 0xf4, 0xd0, 0x00, 0xf0, 0x33, 0xf8, 0x80, 0xbd, 0x8c, 0x7e, 0x08, 0x00, + 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0xf4, 0xa2, 0x08, 0x00, 0x31, 0x72, 0x02, 0x00, + 0x78, 0x9b, 0x08, 0x00, 0x89, 0x71, 0x02, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0x61, 0x72, 0x02, 0x00, 0x00, 0xa3, 0x08, 0x00, 0x9d, 0x73, 0x02, 0x00, + 0x4e, 0xf2, 0x35, 0x2c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4d, 0xf6, 0x29, 0x4c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4d, 0xf6, 0xdd, 0x5c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4d, 0xf6, 0xb9, 0x2c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x11, 0x48, 0x1f, 0x21, 0x00, 0x78, 0xf9, 0xf7, 0xe5, 0xbd, 0x00, 0xbf, + 0x70, 0xb5, 0x06, 0x46, 0xd0, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0x98, 0xb1, + 0x0a, 0x48, 0x0c, 0x46, 0x15, 0x46, 0x01, 0x68, 0x0c, 0x20, 0x88, 0x47, + 0x60, 0xb1, 0x3d, 0x49, 0x05, 0x72, 0xc0, 0xe9, 0x00, 0x64, 0xfb, 0xf7, + 0xa1, 0xff, 0x05, 0x48, 0x1e, 0x21, 0x00, 0x78, 0xf9, 0xf7, 0xcc, 0xfd, + 0x01, 0x20, 0x70, 0xbd, 0x00, 0x20, 0x70, 0xbd, 0x4c, 0x9c, 0x08, 0x00, + 0x66, 0x34, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, 0x81, 0x46, 0x00, 0x78, + 0x0d, 0x46, 0x00, 0x07, 0x13, 0xd5, 0x2f, 0x4c, 0x2f, 0x48, 0x21, 0x68, + 0x88, 0x47, 0x70, 0xb1, 0x2d, 0x4e, 0x07, 0x46, 0x78, 0x68, 0x08, 0xb1, + 0xff, 0xf7, 0x1a, 0xfc, 0x38, 0x46, 0xff, 0xf7, 0x17, 0xfc, 0x21, 0x68, + 0x30, 0x46, 0x88, 0x47, 0x07, 0x46, 0x00, 0x28, 0xf2, 0xd1, 0xd9, 0xf8, + 0x00, 0x00, 0x41, 0x00, 0x3b, 0xd5, 0xdf, 0xf8, 0x8c, 0x80, 0x23, 0x48, + 0x00, 0x95, 0xd8, 0xf8, 0x00, 0x10, 0x88, 0x47, 0x80, 0xb3, 0x20, 0x4e, + 0xdf, 0xf8, 0x80, 0xa0, 0xdf, 0xf8, 0x80, 0xb0, 0x07, 0x46, 0x38, 0x68, + 0xf0, 0xb1, 0x7a, 0x68, 0xe2, 0xb1, 0x3c, 0x7a, 0x10, 0x1d, 0x21, 0x46, + 0x23, 0x46, 0x00, 0xf0, 0x3f, 0xf8, 0xda, 0xf8, 0x00, 0x20, 0xd7, 0xe9, + 0x00, 0x01, 0x90, 0x47, 0xd7, 0xe9, 0x00, 0x01, 0x23, 0x1d, 0x90, 0xf8, + 0x35, 0x01, 0x08, 0x70, 0x00, 0x21, 0x78, 0x68, 0x84, 0x70, 0x4f, 0xf4, + 0x40, 0x70, 0x7a, 0x68, 0xdb, 0xf8, 0x00, 0x50, 0xa8, 0x47, 0x78, 0x68, + 0xff, 0xf7, 0xde, 0xfb, 0x38, 0x46, 0xff, 0xf7, 0xdb, 0xfb, 0xd8, 0xf8, + 0x00, 0x10, 0x30, 0x46, 0x88, 0x47, 0x07, 0x46, 0x00, 0x28, 0xd4, 0xd1, + 0xd9, 0xf8, 0x00, 0x00, 0x00, 0x9d, 0xb0, 0xf1, 0xff, 0x3f, 0xd8, 0xbf, + 0xfb, 0xf7, 0xc4, 0xfd, 0x48, 0x46, 0x29, 0x46, 0xbd, 0xe8, 0xf8, 0x4f, + 0x00, 0xf0, 0x16, 0xb8, 0x24, 0x9d, 0x08, 0x00, 0xfc, 0xdd, 0x05, 0x00, + 0xa4, 0xc2, 0x08, 0x00, 0x78, 0x9b, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x98, 0xaa, 0x08, 0x00, 0xa5, 0x74, 0x02, 0x00, + 0x4c, 0xf6, 0x63, 0x5c, 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf2, 0xa9, 0x0c, 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x80, 0xb5, 0x00, 0xf0, 0x65, 0xf9, 0x08, 0x48, 0x01, 0x68, 0x2a, 0x20, + 0x88, 0x47, 0x97, 0x49, 0x00, 0x28, 0x4f, 0xf0, 0x2a, 0x00, 0x0b, 0x68, + 0x4f, 0xf0, 0x01, 0x01, 0x0c, 0xbf, 0x00, 0x22, 0x01, 0x22, 0xbd, 0xe8, + 0x80, 0x40, 0x18, 0x47, 0xe8, 0x9c, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x41, + 0x42, 0x4e, 0x00, 0x20, 0x00, 0x21, 0x00, 0x24, 0x32, 0x68, 0x90, 0x47, + 0x87, 0x48, 0xdf, 0xf8, 0x04, 0x81, 0x01, 0x68, 0x21, 0xf0, 0x40, 0x61, + 0x01, 0x60, 0x01, 0x68, 0x21, 0xf4, 0x40, 0x71, 0x01, 0x60, 0x3b, 0x48, + 0x00, 0x68, 0x80, 0xf8, 0x7d, 0x40, 0x80, 0xf8, 0x7e, 0x40, 0x80, 0xf8, + 0x7f, 0x40, 0x98, 0xf8, 0x00, 0x00, 0x40, 0xf0, 0x04, 0x01, 0x05, 0x29, + 0x3c, 0xd1, 0x36, 0x48, 0x00, 0x78, 0x01, 0x28, 0x04, 0xd1, 0x35, 0x48, + 0x32, 0x68, 0x01, 0x68, 0x00, 0x20, 0x90, 0x47, 0x33, 0x48, 0x01, 0x78, + 0x01, 0x29, 0x03, 0xd1, 0x32, 0x49, 0x00, 0x22, 0x0a, 0x70, 0x02, 0x70, + 0x73, 0x48, 0x40, 0x21, 0x30, 0x4f, 0x00, 0x26, 0x06, 0x25, 0x01, 0x80, + 0x2f, 0x48, 0x3e, 0x60, 0xf8, 0x67, 0x2f, 0x48, 0x04, 0x68, 0x2f, 0x48, + 0x01, 0x68, 0x06, 0x20, 0x88, 0x47, 0x2e, 0x48, 0x21, 0x46, 0x02, 0x68, + 0x06, 0x20, 0x90, 0x47, 0x2c, 0x48, 0x01, 0x68, 0x06, 0x20, 0x88, 0x47, + 0x78, 0x6e, 0x01, 0x24, 0x65, 0xf3, 0x13, 0x40, 0x78, 0x66, 0xb8, 0x6e, + 0x65, 0xf3, 0x13, 0x40, 0xb8, 0x66, 0x27, 0x48, 0xc7, 0xf8, 0xec, 0x40, + 0x04, 0x70, 0x26, 0x48, 0x06, 0x70, 0x26, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x98, 0xf8, 0x00, 0x00, 0x03, 0x28, 0x19, 0xd1, 0x5e, 0x48, 0x00, 0x21, + 0x02, 0x68, 0x2a, 0x20, 0x90, 0x47, 0x5d, 0x48, 0x5d, 0x4c, 0x01, 0x21, + 0x03, 0x68, 0xe0, 0x7e, 0x00, 0x28, 0x4f, 0xf0, 0x2a, 0x00, 0x14, 0xbf, + 0x00, 0x22, 0x01, 0x22, 0x98, 0x47, 0x6e, 0x4d, 0x60, 0x7f, 0x29, 0x68, + 0x35, 0xf0, 0xd8, 0xf8, 0x28, 0x68, 0xbd, 0xe8, 0xf0, 0x41, 0x00, 0x47, + 0x0c, 0xb1, 0xbd, 0xe8, 0xf0, 0x81, 0x12, 0x48, 0x01, 0x21, 0x01, 0x70, + 0x12, 0x48, 0x00, 0x68, 0x80, 0x47, 0x4b, 0x48, 0x40, 0x21, 0x01, 0x80, + 0xbd, 0xe8, 0xf0, 0x81, 0xc4, 0x9c, 0x08, 0x00, 0xcc, 0x35, 0x01, 0x00, + 0xba, 0x36, 0x01, 0x00, 0xb9, 0x36, 0x01, 0x00, 0x08, 0xa7, 0x08, 0x00, + 0xb1, 0x36, 0x01, 0x00, 0xb3, 0x36, 0x01, 0x00, 0xc4, 0x21, 0x00, 0x40, + 0x00, 0x01, 0x10, 0x00, 0x0c, 0xa7, 0x08, 0x00, 0xb8, 0x9c, 0x08, 0x00, + 0xac, 0x9c, 0x08, 0x00, 0xb0, 0x9c, 0x08, 0x00, 0xb5, 0x36, 0x01, 0x00, + 0xb4, 0x36, 0x01, 0x00, 0x88, 0x9c, 0x08, 0x00, 0x01, 0x28, 0x08, 0xd1, + 0x05, 0x4a, 0x06, 0x4b, 0x12, 0x68, 0x1a, 0x60, 0x0a, 0x78, 0x03, 0xf8, + 0x04, 0x2f, 0x4a, 0x78, 0x5a, 0x70, 0x00, 0xf0, 0xa3, 0xb8, 0x00, 0xbf, + 0x24, 0x20, 0x00, 0x40, 0x08, 0xde, 0x05, 0x00, 0xb0, 0xb5, 0x04, 0x46, + 0x2b, 0x48, 0x01, 0x21, 0x2b, 0x4d, 0x01, 0x60, 0x28, 0x78, 0x40, 0xf0, + 0x04, 0x01, 0x05, 0x29, 0x0c, 0xd1, 0x29, 0x48, 0x01, 0x68, 0x21, 0xf0, + 0x40, 0x61, 0x01, 0x60, 0x01, 0x68, 0x21, 0xf4, 0x40, 0x71, 0x01, 0x60, + 0x25, 0x48, 0x40, 0x21, 0x01, 0x80, 0x28, 0x78, 0x03, 0x28, 0x13, 0xd1, + 0x23, 0x48, 0x40, 0x21, 0x01, 0x80, 0x23, 0x48, 0x00, 0x21, 0x02, 0x68, + 0x2a, 0x20, 0x90, 0x47, 0x21, 0x48, 0x01, 0x21, 0x03, 0x68, 0x21, 0x48, + 0xc0, 0x7e, 0x00, 0x28, 0x4f, 0xf0, 0x2a, 0x00, 0x14, 0xbf, 0x00, 0x22, + 0x01, 0x22, 0x98, 0x47, 0x64, 0xb9, 0x28, 0x78, 0x40, 0xf0, 0x04, 0x00, + 0x05, 0x28, 0x07, 0xd1, 0x1a, 0x48, 0x64, 0x21, 0x00, 0x88, 0x48, 0x43, + 0x19, 0x49, 0x02, 0x38, 0x01, 0x31, 0x88, 0x47, 0x18, 0x4c, 0x01, 0x20, + 0x81, 0x21, 0x22, 0x68, 0x90, 0x47, 0x22, 0x68, 0x03, 0x20, 0x81, 0x21, + 0x90, 0x47, 0x15, 0x48, 0x16, 0x4a, 0x01, 0x88, 0x14, 0x48, 0x12, 0x68, + 0x00, 0x88, 0x90, 0x47, 0x14, 0x48, 0x00, 0x68, 0x80, 0x47, 0x14, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x28, 0x78, 0x03, 0x28, 0x02, 0xd0, 0x05, 0x48, + 0x40, 0x21, 0x01, 0x80, 0xb0, 0xbd, 0x00, 0xbf, 0x04, 0x04, 0x00, 0x40, + 0xba, 0x36, 0x01, 0x00, 0x24, 0x40, 0x01, 0x30, 0x08, 0x90, 0x03, 0x30, + 0x0c, 0x90, 0x03, 0x30, 0xd8, 0x9c, 0x08, 0x00, 0xdc, 0x9c, 0x08, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x34, 0xec, 0x01, 0x00, 0x40, 0xec, 0x01, 0x00, + 0x88, 0xa7, 0x08, 0x00, 0xaa, 0x36, 0x01, 0x00, 0xa8, 0x36, 0x01, 0x00, + 0x18, 0xa7, 0x08, 0x00, 0x1c, 0xa7, 0x08, 0x00, 0x20, 0xa7, 0x08, 0x00, + 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x62, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x34, 0xa7, 0x08, 0x00, 0x25, 0x77, 0x02, 0x00, + 0x2c, 0xa7, 0x08, 0x00, 0xd5, 0x75, 0x02, 0x00, 0xc0, 0xa5, 0x08, 0x00, + 0x49, 0x77, 0x02, 0x00, 0x10, 0xa7, 0x08, 0x00, 0xa9, 0x75, 0x02, 0x00, + 0x4f, 0xf2, 0x49, 0x3c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4f, 0xf6, 0x5d, 0x6c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x2d, 0xe9, 0xf0, 0x47, 0x37, 0x48, 0x80, 0x79, 0x01, 0x28, 0x08, 0xd0, + 0xb9, 0x48, 0x44, 0x68, 0x00, 0xf0, 0x94, 0xf9, 0x18, 0xb1, 0x4f, 0x48, + 0x40, 0x88, 0xc0, 0x07, 0x01, 0xd1, 0xbd, 0xe8, 0xf0, 0x87, 0xdf, 0xf8, + 0xc4, 0x80, 0x98, 0xf8, 0x00, 0x00, 0x01, 0x28, 0x03, 0xd1, 0x98, 0xf8, + 0x01, 0x00, 0x01, 0x28, 0x4d, 0xd0, 0x86, 0x48, 0x40, 0xf6, 0x71, 0x11, + 0xac, 0x4f, 0xa0, 0xf8, 0x02, 0x11, 0x55, 0x21, 0x00, 0xf5, 0x81, 0x76, + 0xa0, 0xf8, 0x04, 0x11, 0x97, 0xf8, 0x5b, 0x07, 0x04, 0x28, 0x0d, 0xd8, + 0x01, 0x21, 0x01, 0xfa, 0x00, 0xf0, 0x10, 0xf0, 0x1a, 0x0f, 0x07, 0xd0, + 0x22, 0x48, 0x00, 0x68, 0x80, 0x47, 0x18, 0xb1, 0x21, 0x48, 0x01, 0x68, + 0x01, 0x20, 0x88, 0x47, 0x3a, 0x4d, 0xdf, 0xf8, 0x80, 0x90, 0xdf, 0xf8, + 0x80, 0xa0, 0x00, 0x20, 0xb0, 0x80, 0x28, 0x68, 0x80, 0x47, 0x30, 0x79, + 0x10, 0xb9, 0x71, 0x79, 0x01, 0x29, 0x13, 0xd0, 0x97, 0xf8, 0xfe, 0x13, + 0x02, 0x29, 0x04, 0xbf, 0x00, 0x20, 0x30, 0x71, 0xe1, 0x6a, 0x00, 0x29, + 0xef, 0xd1, 0x00, 0x28, 0xed, 0xd1, 0xd9, 0xf8, 0x00, 0x00, 0x80, 0x47, + 0x00, 0x28, 0xe8, 0xd0, 0xda, 0xf8, 0x00, 0x00, 0x80, 0x47, 0xe4, 0xe7, + 0x00, 0x20, 0x42, 0xf2, 0x28, 0x31, 0x70, 0x71, 0x28, 0x48, 0x00, 0x88, + 0x48, 0x43, 0x28, 0x49, 0x02, 0x38, 0x01, 0x31, 0x88, 0x47, 0x98, 0xf8, + 0x00, 0x00, 0x01, 0x28, 0x03, 0xd1, 0xbd, 0xe8, 0xf0, 0x47, 0xff, 0xf7, + 0x4f, 0xbb, 0xbd, 0xe8, 0xf0, 0x47, 0x00, 0xf0, 0x0d, 0xb8, 0x00, 0xbf, + 0x9e, 0x3a, 0x01, 0x00, 0xf8, 0xdd, 0x05, 0x00, 0x5c, 0xa9, 0x08, 0x00, + 0xe8, 0x9f, 0x08, 0x00, 0x7c, 0xa8, 0x08, 0x00, 0x9c, 0xa6, 0x08, 0x00, + 0xb0, 0xb5, 0x7d, 0x48, 0x53, 0x4d, 0xff, 0x21, 0x04, 0x68, 0x28, 0x46, + 0xfc, 0xf7, 0x8a, 0xf9, 0x4f, 0xf4, 0x88, 0x70, 0x29, 0x46, 0x03, 0x22, + 0x28, 0x80, 0x0f, 0x48, 0x00, 0x78, 0xa8, 0x70, 0x4e, 0x48, 0x03, 0x68, + 0x20, 0x46, 0x98, 0x47, 0x4d, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0x0a, 0x4c, 0x0b, 0x4d, 0x01, 0x20, 0x20, 0x70, 0x28, 0x68, 0x80, 0x47, + 0x20, 0x78, 0x00, 0x28, 0xfa, 0xd1, 0x08, 0x48, 0x42, 0xf2, 0x28, 0x31, + 0x00, 0x88, 0x48, 0x43, 0x06, 0x49, 0x02, 0x38, 0x01, 0x31, 0xbd, 0xe8, + 0xb0, 0x40, 0x08, 0x47, 0x48, 0xec, 0x01, 0x00, 0x10, 0xde, 0x05, 0x00, + 0x58, 0xa7, 0x08, 0x00, 0x34, 0xec, 0x01, 0x00, 0x40, 0xec, 0x01, 0x00, + 0x7c, 0xb5, 0x62, 0x48, 0x43, 0x4d, 0xff, 0x21, 0xff, 0x26, 0x44, 0x68, + 0x4f, 0xf4, 0x10, 0x20, 0x01, 0x90, 0x28, 0x46, 0xe5, 0x62, 0xfb, 0xf7, + 0x9b, 0xfc, 0x40, 0xf6, 0x01, 0x00, 0x2e, 0x71, 0xe8, 0x80, 0x42, 0xf6, + 0xdd, 0x60, 0x28, 0x80, 0x2f, 0x48, 0x00, 0xf5, 0x80, 0x76, 0x90, 0xf8, + 0x06, 0x01, 0xe0, 0xb1, 0x30, 0x88, 0x71, 0x88, 0x81, 0x42, 0x35, 0xd9, + 0xfb, 0x20, 0xf8, 0x21, 0x32, 0x46, 0x02, 0x23, 0xa8, 0x70, 0xf9, 0x20, + 0x68, 0x71, 0x05, 0xf1, 0x08, 0x00, 0xf9, 0xf7, 0xeb, 0xfa, 0x30, 0x88, + 0x25, 0x49, 0xf4, 0x22, 0xf4, 0x23, 0x00, 0xfb, 0x02, 0x12, 0x05, 0xf1, + 0x0b, 0x00, 0xf5, 0x21, 0xf9, 0xf7, 0xe0, 0xfa, 0x30, 0x88, 0x01, 0x30, + 0x14, 0xe0, 0xfb, 0x20, 0x01, 0xaa, 0xf5, 0x21, 0x04, 0x23, 0xa8, 0x70, + 0xf9, 0x20, 0x68, 0x71, 0x05, 0xf1, 0x0b, 0x00, 0xf9, 0xf7, 0xd2, 0xfa, + 0x05, 0xf1, 0x0f, 0x00, 0xf1, 0x21, 0x4f, 0xf0, 0x00, 0x52, 0xf0, 0x23, + 0xf9, 0xf7, 0xca, 0xfa, 0x01, 0x20, 0xb0, 0x71, 0x30, 0x80, 0x15, 0x48, + 0x29, 0x46, 0xff, 0x22, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x1a, 0xe0, + 0x4f, 0xf6, 0xff, 0x71, 0xf4, 0x23, 0x29, 0x81, 0xb1, 0x88, 0x8a, 0x1c, + 0x69, 0x71, 0xaa, 0x70, 0x0c, 0x4a, 0x00, 0xfb, 0x03, 0x22, 0x4b, 0x1f, + 0x05, 0xf1, 0x0b, 0x00, 0xf5, 0x21, 0xf9, 0xf7, 0xaf, 0xfa, 0x09, 0x48, + 0x29, 0x46, 0x03, 0x68, 0xb0, 0x88, 0x06, 0x30, 0x82, 0xb2, 0x20, 0x46, + 0x98, 0x47, 0x01, 0x20, 0xf0, 0x71, 0x05, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x7c, 0xbd, 0xec, 0x36, 0x01, 0x00, 0xfc, 0xff, 0xff, 0x1f, + 0x50, 0xa7, 0x08, 0x00, 0x54, 0xa7, 0x08, 0x00, 0x10, 0xb5, 0x48, 0xb1, + 0x04, 0x46, 0xc0, 0x6a, 0x30, 0xb1, 0x04, 0x49, 0x88, 0x42, 0x18, 0xbf, + 0xff, 0xf7, 0xfc, 0xf8, 0x00, 0x20, 0xe0, 0x62, 0x10, 0xbd, 0x00, 0xbf, + 0x00, 0xff, 0x00, 0x00, 0x2d, 0xe9, 0xf8, 0x43, 0x19, 0x48, 0x1a, 0x4c, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x19, 0x4e, 0xdf, 0xf8, 0x64, 0x90, + 0x00, 0x27, 0x04, 0xf1, 0x2c, 0x05, 0x04, 0xf2, 0xfe, 0x38, 0xc4, 0xf8, + 0x40, 0x77, 0x84, 0xf8, 0x00, 0x74, 0x84, 0xf8, 0x5b, 0x77, 0x07, 0xeb, + 0x87, 0x00, 0x31, 0x69, 0x04, 0xeb, 0x00, 0x10, 0x2c, 0x30, 0x88, 0x42, + 0x06, 0xd0, 0xf1, 0x68, 0x88, 0x42, 0x03, 0xd0, 0xd9, 0xf8, 0x00, 0x10, + 0x28, 0x46, 0x88, 0x47, 0x01, 0x37, 0x50, 0x35, 0x0b, 0x2f, 0xec, 0xd1, + 0x0a, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x20, 0x88, 0xf8, 0x04, 0x00, + 0x88, 0xf8, 0x03, 0x00, 0x02, 0x20, 0xa8, 0xf8, 0x00, 0x00, 0xbd, 0xe8, + 0xf8, 0x83, 0x00, 0xbf, 0x30, 0xa8, 0x08, 0x00, 0xf8, 0xf5, 0x01, 0x00, + 0x78, 0xfe, 0x01, 0x00, 0x8c, 0xa4, 0x08, 0x00, 0xc0, 0xa4, 0x08, 0x00, + 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x9c, 0xa6, 0x08, 0x00, 0xf9, 0x79, 0x02, 0x00, + 0x9c, 0x9e, 0x08, 0x00, 0x91, 0x78, 0x02, 0x00, 0x8c, 0xa4, 0x08, 0x00, + 0xf1, 0x7a, 0x02, 0x00, 0x40, 0xa8, 0x08, 0x00, 0x11, 0x7b, 0x02, 0x00, + 0x43, 0xf2, 0x39, 0x0c, 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x2d, 0xe9, 0xf8, 0x43, 0x07, 0x46, 0x42, 0x28, 0x04, 0xd3, 0x00, 0x20, + 0xb0, 0x21, 0xff, 0xf7, 0x6b, 0xf8, 0x41, 0x27, 0x4f, 0x4d, 0x50, 0x4e, + 0x28, 0x78, 0x30, 0x44, 0x90, 0xf8, 0x01, 0x04, 0x06, 0x28, 0x3d, 0xd1, + 0x4d, 0x48, 0x00, 0x68, 0x80, 0x47, 0x04, 0x46, 0x28, 0x78, 0x59, 0x49, + 0x30, 0x44, 0x09, 0x68, 0x90, 0xf8, 0x01, 0x04, 0x88, 0x47, 0xdf, 0xf8, + 0x24, 0x81, 0x06, 0x46, 0x45, 0x46, 0x15, 0xf8, 0x11, 0x0f, 0x80, 0xb3, + 0x4f, 0xf6, 0xff, 0x70, 0x84, 0x42, 0x2c, 0xd0, 0x44, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x58, 0xb1, 0x81, 0x46, 0xc0, 0x78, 0x07, 0xeb, + 0x47, 0x02, 0xc1, 0x1c, 0xc8, 0xb2, 0x82, 0x42, 0x25, 0xd2, 0x3f, 0x48, + 0x01, 0x68, 0x48, 0x46, 0x88, 0x47, 0x00, 0x20, 0x28, 0x72, 0xe8, 0x71, + 0xa8, 0x71, 0x28, 0x78, 0xc8, 0xb1, 0x3b, 0x48, 0x00, 0x68, 0x80, 0x47, + 0xa8, 0xb1, 0x2f, 0x78, 0xf0, 0xb2, 0x87, 0x42, 0x24, 0xd9, 0xb7, 0xeb, + 0x40, 0x0f, 0xae, 0x71, 0x4a, 0xd9, 0xa7, 0xeb, 0x46, 0x00, 0xee, 0x71, + 0x28, 0x72, 0x49, 0xe0, 0x38, 0x46, 0xbd, 0xe8, 0xf8, 0x43, 0x00, 0xf0, + 0x9b, 0xba, 0x00, 0x20, 0xe8, 0x71, 0x28, 0x72, 0xa8, 0x71, 0xbd, 0xe8, + 0xf8, 0x83, 0xf2, 0xb2, 0x90, 0x42, 0x08, 0xd9, 0xb0, 0xeb, 0x42, 0x0f, + 0xae, 0x71, 0x0d, 0xd9, 0xa1, 0xeb, 0x46, 0x00, 0xee, 0x71, 0x28, 0x72, + 0x0c, 0xe0, 0x00, 0x20, 0xa9, 0x71, 0x28, 0x72, 0xe8, 0x71, 0x08, 0xe0, + 0x00, 0x20, 0xaf, 0x71, 0x28, 0x72, 0x28, 0xe0, 0x00, 0x20, 0x28, 0x72, + 0x88, 0x1b, 0xe8, 0x71, 0x31, 0x46, 0x09, 0xf1, 0x01, 0x04, 0xcb, 0xb2, + 0x08, 0xf5, 0xce, 0x70, 0x44, 0x21, 0x22, 0x46, 0xf9, 0xf7, 0xa6, 0xf9, + 0xeb, 0x79, 0x3b, 0xb1, 0xa8, 0x79, 0x44, 0x21, 0x04, 0x44, 0x08, 0xf5, + 0xf0, 0x70, 0x22, 0x46, 0xf9, 0xf7, 0x9c, 0xf9, 0x2b, 0x7a, 0x33, 0xb1, + 0xe8, 0x79, 0x44, 0x21, 0x22, 0x18, 0x08, 0xf5, 0x09, 0x70, 0xf9, 0xf7, + 0x93, 0xf9, 0x48, 0x46, 0xbd, 0xe8, 0xf8, 0x43, 0xfe, 0xf7, 0xfc, 0xbf, + 0x00, 0x20, 0x28, 0x72, 0xb8, 0x1b, 0xe8, 0x71, 0x08, 0xf5, 0xce, 0x70, + 0xcc, 0x21, 0xfb, 0xf7, 0x19, 0xfb, 0xf8, 0x1e, 0x88, 0xf8, 0x9c, 0x41, + 0x88, 0xf8, 0x9e, 0x01, 0x20, 0x0a, 0x88, 0xf8, 0x9d, 0x01, 0xbd, 0xe8, + 0xf8, 0x83, 0x00, 0xbf, 0x8d, 0xfe, 0x01, 0x00, 0xf8, 0xf5, 0x01, 0x00, + 0xa8, 0xa8, 0x08, 0x00, 0xfc, 0x37, 0x01, 0x00, 0xac, 0xa8, 0x08, 0x00, + 0xa4, 0xa8, 0x08, 0x00, 0xb0, 0xa8, 0x08, 0x00, 0x80, 0xb5, 0x00, 0xf0, + 0x3b, 0xfa, 0xa3, 0x48, 0xa3, 0x49, 0x00, 0x78, 0x08, 0x44, 0x90, 0xf8, + 0x01, 0x04, 0x06, 0x28, 0x05, 0xd1, 0x03, 0x48, 0x01, 0x68, 0x06, 0x20, + 0x88, 0x47, 0x45, 0x49, 0x48, 0x74, 0x80, 0xbd, 0xac, 0xa4, 0x08, 0x00, + 0x2d, 0xe9, 0xf8, 0x43, 0x04, 0x46, 0x99, 0x48, 0x99, 0x49, 0x00, 0x78, + 0x08, 0x44, 0x90, 0xf8, 0x01, 0x04, 0x06, 0x28, 0x03, 0xd1, 0xb9, 0x48, + 0xc0, 0x68, 0xa0, 0x42, 0x04, 0xd0, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x43, + 0x00, 0xf0, 0x1c, 0xba, 0xdf, 0xf8, 0xe0, 0x80, 0x01, 0x20, 0x94, 0xf8, + 0x00, 0x90, 0x20, 0x70, 0x46, 0x46, 0x16, 0xf8, 0x11, 0x0f, 0x00, 0x28, + 0x54, 0xd0, 0x34, 0x48, 0x34, 0x4b, 0xdf, 0xf8, 0xd4, 0xc0, 0x00, 0x25, + 0x72, 0xb6, 0x01, 0x68, 0x49, 0x00, 0x01, 0x31, 0x01, 0x60, 0xb1, 0x78, + 0x03, 0xeb, 0xc5, 0x02, 0x2f, 0x46, 0x12, 0x79, 0x92, 0x07, 0x0e, 0xd5, + 0x53, 0xf8, 0x37, 0x50, 0x5d, 0xb1, 0x2a, 0x68, 0x4a, 0xb1, 0x92, 0xf8, + 0x0a, 0x21, 0x92, 0x07, 0x05, 0xd5, 0x3c, 0xf8, 0x17, 0x20, 0xed, 0x8a, + 0x95, 0x42, 0x00, 0xd0, 0xc1, 0xb3, 0x01, 0x25, 0x00, 0x2f, 0xe7, 0xd0, + 0x01, 0x68, 0x49, 0x08, 0x01, 0x60, 0x00, 0x68, 0x80, 0xf3, 0x10, 0x88, + 0xb0, 0x78, 0x03, 0x28, 0x1d, 0xd2, 0x08, 0xeb, 0x00, 0x01, 0xca, 0x7d, + 0xca, 0xb1, 0x00, 0xeb, 0x00, 0x10, 0x08, 0xeb, 0x80, 0x00, 0x00, 0xf5, + 0xce, 0x71, 0x96, 0x48, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0xb0, 0x78, + 0x01, 0x30, 0xc1, 0xb2, 0xb0, 0x70, 0x03, 0x29, 0x03, 0xd0, 0x58, 0xfa, + 0x80, 0xf0, 0xc0, 0x7d, 0x80, 0xb9, 0x00, 0x20, 0x30, 0x72, 0xb0, 0x70, + 0xf0, 0x71, 0xb0, 0x71, 0x0a, 0xe0, 0x00, 0x20, 0x00, 0x21, 0x00, 0x22, + 0x30, 0x72, 0xb0, 0x70, 0xf0, 0x71, 0xb0, 0x71, 0x0e, 0x48, 0x03, 0x68, + 0x20, 0x46, 0x98, 0x47, 0x84, 0xf8, 0x00, 0x90, 0xbd, 0xe8, 0xf8, 0x83, + 0x2c, 0xf8, 0x17, 0x50, 0x01, 0x68, 0x49, 0x08, 0x01, 0x60, 0xc7, 0x49, + 0x00, 0x68, 0x80, 0xf3, 0x10, 0x88, 0xe0, 0x89, 0x09, 0x68, 0x88, 0x47, + 0xc2, 0xe7, 0x00, 0xbf, 0xfc, 0x37, 0x01, 0x00, 0x24, 0x36, 0x01, 0x00, + 0x3c, 0x4c, 0x01, 0x00, 0x12, 0xde, 0x05, 0x00, 0xbc, 0xa4, 0x08, 0x00, + 0x2d, 0xe9, 0xf8, 0x4f, 0x05, 0x46, 0x51, 0x48, 0x0c, 0x46, 0x51, 0x49, + 0x00, 0x78, 0x08, 0x44, 0x90, 0xf8, 0x01, 0x04, 0x06, 0x28, 0x03, 0xd1, + 0x70, 0x48, 0x00, 0x69, 0xa0, 0x42, 0x05, 0xd0, 0x28, 0x46, 0x21, 0x46, + 0xbd, 0xe8, 0xf8, 0x4f, 0x00, 0xf0, 0x90, 0xb9, 0x49, 0x4e, 0xb0, 0x7c, + 0x06, 0xf1, 0x11, 0x07, 0x02, 0x28, 0x77, 0xd8, 0xe2, 0x69, 0x31, 0x18, + 0x00, 0x28, 0x0a, 0x75, 0x57, 0xd0, 0x39, 0x78, 0x00, 0x29, 0x6f, 0xd0, + 0xf9, 0x78, 0x3a, 0x79, 0x7b, 0x79, 0x11, 0x44, 0xca, 0x18, 0x98, 0x49, + 0xb1, 0xf8, 0x56, 0x35, 0x04, 0x3b, 0x9a, 0x42, 0x64, 0xdc, 0xb3, 0x7f, + 0x03, 0x33, 0x93, 0x42, 0x6c, 0xd1, 0x01, 0xf2, 0x54, 0x59, 0x93, 0x48, + 0x99, 0xf8, 0x00, 0x10, 0x00, 0xf5, 0x28, 0x70, 0x01, 0xf0, 0x01, 0x01, + 0xfd, 0xf7, 0xd4, 0xf9, 0x00, 0x28, 0x53, 0xd0, 0x80, 0x46, 0x00, 0x20, + 0xdf, 0xf8, 0xd4, 0xa0, 0x06, 0xf1, 0x1c, 0x02, 0x88, 0xf8, 0x00, 0x00, + 0x08, 0xf1, 0x01, 0x00, 0xb9, 0xf8, 0x02, 0x10, 0xfb, 0x78, 0x01, 0x39, + 0xd0, 0x47, 0xf8, 0x78, 0xb9, 0xf8, 0x02, 0x10, 0x3b, 0x79, 0x00, 0xf1, + 0x01, 0x0b, 0x5f, 0xfa, 0x8b, 0xf2, 0x58, 0xfa, 0x8b, 0xf0, 0x89, 0x1a, + 0x06, 0xf1, 0x9c, 0x02, 0xd0, 0x47, 0x38, 0x79, 0xb9, 0xf8, 0x02, 0x20, + 0x7b, 0x79, 0x83, 0x44, 0x5f, 0xfa, 0x8b, 0xf1, 0x58, 0xfa, 0x8b, 0xf0, + 0x51, 0x1a, 0x06, 0xf5, 0x8e, 0x72, 0xd0, 0x47, 0x78, 0x79, 0x98, 0xf8, + 0x03, 0x10, 0x58, 0x44, 0x04, 0x31, 0xc0, 0xb2, 0x81, 0x42, 0x2f, 0xd1, + 0x1e, 0x48, 0x00, 0xf1, 0x30, 0x01, 0x40, 0x46, 0xfb, 0xf7, 0x26, 0xfa, + 0x1a, 0xe0, 0x19, 0x48, 0x96, 0xf8, 0x1e, 0x80, 0x01, 0x68, 0xb0, 0x8b, + 0x88, 0x47, 0x60, 0xb1, 0x6c, 0x48, 0xb0, 0xf8, 0x56, 0x05, 0x01, 0x38, + 0x40, 0x45, 0x06, 0xdd, 0xb8, 0xf1, 0x00, 0x0f, 0x03, 0xd0, 0x78, 0x78, + 0x01, 0x30, 0x78, 0x70, 0x00, 0xe0, 0x78, 0x78, 0xc1, 0xb2, 0x02, 0x29, + 0x02, 0xd8, 0x01, 0x06, 0x8d, 0xd1, 0xff, 0xe7, 0x00, 0x20, 0x78, 0x71, + 0xa7, 0xf8, 0x03, 0x00, 0x78, 0x70, 0x7b, 0x48, 0x21, 0x46, 0x02, 0x68, + 0x28, 0x46, 0xbd, 0xe8, 0xf8, 0x4f, 0x10, 0x47, 0x01, 0x30, 0xf5, 0xe7, + 0x40, 0x46, 0xfe, 0xf7, 0x91, 0xfe, 0xed, 0xe7, 0x8d, 0xfe, 0x01, 0x00, + 0xf8, 0xf5, 0x01, 0x00, 0xfc, 0x37, 0x01, 0x00, 0xa8, 0xa4, 0x08, 0x00, + 0x4d, 0xcd, 0x11, 0x10, 0x2c, 0xba, 0x01, 0x00, 0x10, 0xb5, 0x1b, 0x48, + 0x0c, 0x46, 0x02, 0x68, 0x08, 0x46, 0x00, 0x21, 0x90, 0x47, 0x48, 0xb3, + 0x18, 0x48, 0x90, 0xf8, 0x06, 0x11, 0x01, 0x29, 0x03, 0xd1, 0x17, 0x49, + 0x49, 0x68, 0xa1, 0x42, 0x1a, 0xd0, 0x16, 0x48, 0x01, 0x78, 0x01, 0x29, + 0x05, 0xd1, 0x13, 0x49, 0x09, 0x68, 0xa1, 0x42, 0x04, 0xbf, 0x00, 0x21, + 0x01, 0x70, 0x94, 0xf8, 0x20, 0x00, 0x38, 0xb1, 0x10, 0x48, 0x00, 0x21, + 0x00, 0x22, 0x03, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x18, 0x47, + 0x55, 0x48, 0x01, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x08, 0x47, + 0x90, 0xf8, 0x07, 0x11, 0x19, 0xb1, 0x00, 0x21, 0x80, 0xf8, 0x06, 0x11, + 0x10, 0xbd, 0x07, 0x48, 0x00, 0x68, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0x47, + 0xa0, 0xa4, 0x08, 0x00, 0xec, 0x36, 0x01, 0x00, 0x78, 0xfe, 0x01, 0x00, + 0x10, 0xde, 0x05, 0x00, 0xac, 0xa6, 0x08, 0x00, 0x9c, 0xa6, 0x08, 0x00, + 0xf8, 0xb5, 0x04, 0x46, 0x0d, 0x46, 0x08, 0x79, 0x2d, 0x49, 0x0a, 0x78, + 0x02, 0xf0, 0xfe, 0x02, 0x02, 0x2a, 0x08, 0xbf, 0x5f, 0xea, 0x00, 0x72, + 0x48, 0xd0, 0x00, 0x07, 0x05, 0xd0, 0x20, 0x46, 0x29, 0x46, 0xbd, 0xe8, + 0xf8, 0x40, 0x00, 0xf0, 0xa1, 0xb8, 0xd4, 0xf8, 0x40, 0x07, 0x18, 0xb9, + 0x24, 0x48, 0x00, 0x68, 0xc4, 0xf8, 0x40, 0x07, 0x23, 0x4f, 0xb4, 0xf8, + 0x3c, 0x17, 0xb7, 0xf8, 0xb6, 0x04, 0x81, 0x42, 0x0e, 0xd2, 0x21, 0x48, + 0x90, 0xf8, 0x2a, 0x10, 0x51, 0xb1, 0x97, 0xf8, 0xb4, 0x14, 0x20, 0x30, + 0x01, 0xf0, 0x01, 0x01, 0xfd, 0xf7, 0xee, 0xf8, 0x10, 0xb1, 0x06, 0x46, + 0x1b, 0x48, 0x0c, 0xe0, 0x19, 0x48, 0x80, 0x7a, 0x18, 0xb3, 0x97, 0xf8, + 0xac, 0x04, 0x00, 0xf0, 0x01, 0x01, 0x16, 0x48, 0xfd, 0xf7, 0xe0, 0xf8, + 0xd8, 0xb1, 0x06, 0x46, 0x15, 0x48, 0xc4, 0xf8, 0x68, 0x07, 0xe9, 0x6a, + 0x31, 0xb1, 0x00, 0x20, 0x40, 0xf2, 0x7d, 0x21, 0xf8, 0xf7, 0x78, 0xff, + 0xd4, 0xf8, 0x68, 0x07, 0xee, 0x62, 0x01, 0x78, 0x01, 0x31, 0x01, 0x70, + 0x0e, 0x48, 0xb4, 0xf8, 0x3c, 0x17, 0x02, 0x68, 0x30, 0x46, 0xbd, 0xe8, + 0xf8, 0x40, 0x10, 0x47, 0x03, 0x20, 0x08, 0x70, 0xf8, 0xbd, 0x0a, 0x48, + 0x00, 0xf0, 0x60, 0xf8, 0x09, 0x48, 0x00, 0xf0, 0x5d, 0xf8, 0xfe, 0xe7, + 0xc1, 0xf0, 0x05, 0x00, 0xa8, 0xa6, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0x68, 0x8a, 0x01, 0x00, 0x01, 0x62, 0x01, 0x00, 0x00, 0x62, 0x01, 0x00, + 0xd8, 0xa4, 0x08, 0x00, 0x00, 0x82, 0x02, 0x00, 0x08, 0x82, 0x02, 0x00, + 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, 0x0a, 0x49, 0x41, 0x60, + 0x0a, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0b, 0x49, 0x01, 0x60, + 0x0b, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, 0x0c, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0xb8, 0xa4, 0x08, 0x00, 0xd9, 0x7b, 0x02, 0x00, + 0x98, 0x02, 0x01, 0x00, 0xf5, 0x7f, 0x02, 0x00, 0xb4, 0xa6, 0x08, 0x00, + 0x71, 0x7d, 0x02, 0x00, 0xb0, 0xa6, 0x08, 0x00, 0x91, 0x7e, 0x02, 0x00, + 0xb0, 0xa4, 0x08, 0x00, 0x49, 0x7d, 0x02, 0x00, 0xa4, 0xa6, 0x08, 0x00, + 0x7d, 0x80, 0x02, 0x00, 0x43, 0xf2, 0x51, 0x4c, 0xc1, 0xf2, 0x03, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf2, 0x7d, 0x0c, 0xc1, 0xf2, 0x03, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf6, 0x21, 0x0c, 0xc1, 0xf2, 0x03, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf6, 0x49, 0x3c, 0xc1, 0xf2, 0x03, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf6, 0xf5, 0x1c, 0xc1, 0xf2, 0x03, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf2, 0x59, 0x3c, 0xc1, 0xf2, 0x12, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x55, 0x53, 0x42, 0x5f, 0x41, 0x3a, 0x20, 0x00, + 0x55, 0x53, 0x42, 0x3a, 0x20, 0x4e, 0x6f, 0x20, 0x42, 0x75, 0x66, 0x66, + 0x65, 0x72, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x43, 0x4d, 0x44, 0x21, 0x00, + 0x10, 0xb5, 0x06, 0x48, 0x04, 0x68, 0x00, 0xf0, 0x27, 0xf8, 0x60, 0x06, + 0x58, 0xbf, 0x10, 0xbd, 0x03, 0x48, 0x01, 0x68, 0x07, 0x48, 0xbd, 0xe8, + 0x10, 0x40, 0x08, 0x47, 0x14, 0x00, 0x00, 0x54, 0x2c, 0xa0, 0x08, 0x00, + 0x03, 0x48, 0x90, 0xf8, 0x5b, 0x07, 0x08, 0xb1, 0x00, 0xf0, 0x1a, 0xb8, + 0x00, 0x20, 0x70, 0x47, 0xf8, 0xf5, 0x01, 0x00, 0x03, 0x48, 0x04, 0x49, + 0x01, 0x60, 0x04, 0x48, 0x04, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x5c, 0xa9, 0x08, 0x00, 0x45, 0x82, 0x02, 0x00, 0x44, 0xa9, 0x08, 0x00, + 0x21, 0x82, 0x02, 0x00, 0x46, 0xf2, 0xdd, 0x0c, 0xc1, 0xf2, 0x03, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x46, 0xf2, 0x9d, 0x4c, 0xc1, 0xf2, 0x03, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x70, 0x47, 0x00, 0x00, 0x70, 0xb5, 0x04, 0x46, + 0x0c, 0x20, 0x00, 0xf0, 0x25, 0xf8, 0x20, 0x46, 0x00, 0xf0, 0x56, 0xf8, + 0xc4, 0x4e, 0xc5, 0x4d, 0x04, 0xeb, 0x44, 0x04, 0x31, 0x78, 0x01, 0xeb, + 0x41, 0x00, 0x05, 0xeb, 0x40, 0x10, 0x50, 0xf8, 0x24, 0x00, 0x60, 0xb1, + 0xfe, 0xf7, 0x1e, 0xfd, 0x31, 0x78, 0x00, 0x22, 0x01, 0xeb, 0x41, 0x00, + 0x05, 0xeb, 0x40, 0x10, 0x40, 0xf8, 0x24, 0x20, 0x00, 0xeb, 0x84, 0x00, + 0x42, 0x60, 0x01, 0xeb, 0x41, 0x00, 0x00, 0x21, 0x05, 0xeb, 0x40, 0x10, + 0x00, 0xeb, 0x84, 0x00, 0x41, 0x72, 0x70, 0xbd, 0xf0, 0xb5, 0xdf, 0xf8, + 0x58, 0xc0, 0x16, 0x4d, 0xb2, 0x4e, 0xbc, 0xf8, 0x00, 0x20, 0x02, 0xeb, + 0xc2, 0x04, 0x05, 0xf8, 0x24, 0x00, 0x05, 0xeb, 0x84, 0x00, 0xad, 0x4c, + 0x00, 0xf1, 0x08, 0x0e, 0x24, 0x78, 0x04, 0xeb, 0x44, 0x04, 0x65, 0x01, + 0x06, 0xeb, 0x44, 0x14, 0x75, 0x59, 0x23, 0x6b, 0xa6, 0x69, 0x67, 0x6a, + 0x45, 0x60, 0xe5, 0x68, 0xae, 0xe8, 0xe0, 0x00, 0x43, 0x61, 0xe3, 0x6b, + 0x41, 0x70, 0x08, 0x49, 0x83, 0x61, 0xa3, 0x6c, 0xc3, 0x61, 0x09, 0x68, + 0x01, 0x62, 0x50, 0x1c, 0x00, 0xf0, 0x1d, 0x00, 0xac, 0xf8, 0x00, 0x00, + 0xf0, 0xbd, 0x00, 0xbf, 0x16, 0xde, 0x05, 0x00, 0x18, 0xde, 0x05, 0x00, + 0x24, 0x20, 0x00, 0x40, 0x01, 0x38, 0x06, 0x28, 0x2d, 0xd8, 0xdf, 0xe8, + 0x00, 0xf0, 0x04, 0x0b, 0x12, 0x19, 0x2c, 0x2c, 0x20, 0x00, 0x21, 0x48, + 0x00, 0x21, 0x01, 0x60, 0x20, 0x48, 0x01, 0x60, 0x20, 0x48, 0x1a, 0xe0, + 0x1a, 0x48, 0x00, 0x21, 0x01, 0x60, 0x1a, 0x48, 0x01, 0x60, 0x1a, 0x48, + 0x13, 0xe0, 0x14, 0x48, 0x00, 0x21, 0x01, 0x60, 0x13, 0x48, 0x01, 0x60, + 0x13, 0x48, 0x0c, 0xe0, 0x0d, 0x48, 0x00, 0x21, 0x01, 0x60, 0x0d, 0x48, + 0x01, 0x60, 0x0d, 0x48, 0x05, 0xe0, 0x06, 0x48, 0x00, 0x21, 0x01, 0x60, + 0x05, 0x48, 0x01, 0x60, 0x05, 0x48, 0x01, 0x60, 0x05, 0x48, 0x01, 0x68, + 0x21, 0xf0, 0x7f, 0x61, 0x01, 0x60, 0x70, 0x47, 0x80, 0x80, 0x21, 0x40, + 0x84, 0x80, 0x21, 0x40, 0x88, 0x80, 0x21, 0x40, 0x08, 0x00, 0x2c, 0x40, + 0x1c, 0x80, 0x21, 0x40, 0x4c, 0x80, 0x21, 0x40, 0x3c, 0x80, 0x21, 0x40, + 0x18, 0x80, 0x21, 0x40, 0x48, 0x80, 0x21, 0x40, 0x38, 0x80, 0x21, 0x40, + 0x14, 0x80, 0x21, 0x40, 0x44, 0x80, 0x21, 0x40, 0x34, 0x80, 0x21, 0x40, + 0x10, 0x80, 0x21, 0x40, 0x40, 0x80, 0x21, 0x40, 0x30, 0x80, 0x21, 0x40, + 0x2d, 0xe9, 0xf8, 0x4f, 0xab, 0x48, 0x05, 0x68, 0xa9, 0x48, 0xd0, 0xf8, + 0x00, 0x90, 0x6b, 0x48, 0x04, 0x68, 0x0e, 0x20, 0x21, 0x46, 0xff, 0xf7, + 0x6d, 0xff, 0xe0, 0x07, 0x5f, 0xd0, 0xc4, 0xf3, 0x02, 0x16, 0x00, 0x2e, + 0x5b, 0xd0, 0xdf, 0xf8, 0x98, 0xb1, 0xdf, 0xf8, 0x98, 0x81, 0xdf, 0xf8, + 0x98, 0xa1, 0x06, 0xeb, 0x46, 0x01, 0x72, 0xb6, 0xdb, 0xf8, 0x00, 0x00, + 0x40, 0x00, 0x01, 0x30, 0xcb, 0xf8, 0x00, 0x00, 0x98, 0xf8, 0x00, 0x00, + 0x00, 0xeb, 0x40, 0x00, 0x0a, 0xeb, 0x40, 0x10, 0x00, 0xeb, 0x81, 0x00, + 0x42, 0x68, 0x1a, 0xb1, 0x5f, 0xfa, 0x89, 0xf1, 0x30, 0x46, 0x90, 0x47, + 0x0f, 0x20, 0x31, 0x46, 0xff, 0xf7, 0x46, 0xff, 0x98, 0xf8, 0x00, 0x00, + 0x06, 0xeb, 0x46, 0x07, 0x00, 0xeb, 0x40, 0x00, 0x0a, 0xeb, 0x40, 0x10, + 0x50, 0xf8, 0x27, 0x00, 0xc0, 0xb1, 0x30, 0x46, 0xff, 0xf7, 0x6c, 0xff, + 0x98, 0xf8, 0x00, 0x00, 0x00, 0xeb, 0x40, 0x00, 0x0a, 0xeb, 0x40, 0x10, + 0x50, 0xf8, 0x27, 0x00, 0xfe, 0xf7, 0x38, 0xfc, 0x98, 0xf8, 0x00, 0x00, + 0x00, 0x21, 0x00, 0xeb, 0x40, 0x00, 0x0a, 0xeb, 0x40, 0x10, 0x40, 0xf8, + 0x27, 0x10, 0x00, 0xeb, 0x87, 0x00, 0x41, 0x60, 0xdb, 0xf8, 0x00, 0x00, + 0x29, 0x46, 0x40, 0x08, 0xcb, 0xf8, 0x00, 0x00, 0xdb, 0xf8, 0x00, 0x00, + 0x80, 0xf3, 0x10, 0x88, 0x10, 0x20, 0xff, 0xf7, 0x15, 0xff, 0x98, 0xf8, + 0x00, 0x00, 0x00, 0x21, 0x00, 0xeb, 0x40, 0x00, 0x0a, 0xeb, 0x40, 0x10, + 0x00, 0xeb, 0x87, 0x00, 0x41, 0x72, 0xc5, 0xf3, 0x02, 0x15, 0x00, 0x2d, + 0x5c, 0xd0, 0x11, 0x20, 0x29, 0x46, 0xff, 0xf7, 0x03, 0xff, 0xa2, 0x4e, + 0xdf, 0xf8, 0xd0, 0xa0, 0xdf, 0xf8, 0xd0, 0x80, 0x05, 0xeb, 0x45, 0x01, + 0x72, 0xb6, 0x30, 0x68, 0x40, 0x00, 0x01, 0x30, 0x30, 0x60, 0x9a, 0xf8, + 0x00, 0x00, 0x00, 0xeb, 0x40, 0x00, 0x08, 0xeb, 0x40, 0x10, 0x00, 0xeb, + 0x81, 0x00, 0x42, 0x68, 0x1a, 0xb1, 0x5f, 0xfa, 0x89, 0xf1, 0x28, 0x46, + 0x90, 0x47, 0x12, 0x20, 0x29, 0x46, 0xff, 0xf7, 0xe5, 0xfe, 0x9a, 0xf8, + 0x00, 0x00, 0x05, 0xeb, 0x45, 0x07, 0x00, 0xeb, 0x40, 0x00, 0x08, 0xeb, + 0x40, 0x10, 0x50, 0xf8, 0x27, 0x00, 0xc0, 0xb1, 0x28, 0x46, 0xff, 0xf7, + 0x0b, 0xff, 0x9a, 0xf8, 0x00, 0x00, 0x00, 0xeb, 0x40, 0x00, 0x08, 0xeb, + 0x40, 0x10, 0x50, 0xf8, 0x27, 0x00, 0xfe, 0xf7, 0xd7, 0xfb, 0x9a, 0xf8, + 0x00, 0x00, 0x00, 0x21, 0x00, 0xeb, 0x40, 0x00, 0x08, 0xeb, 0x40, 0x10, + 0x40, 0xf8, 0x27, 0x10, 0x00, 0xeb, 0x87, 0x00, 0x41, 0x60, 0x30, 0x68, + 0x29, 0x46, 0x40, 0x08, 0x30, 0x60, 0x30, 0x68, 0x80, 0xf3, 0x10, 0x88, + 0x13, 0x20, 0xff, 0xf7, 0xb7, 0xfe, 0x9a, 0xf8, 0x00, 0x00, 0x4d, 0x49, + 0x01, 0x22, 0x00, 0xeb, 0x40, 0x00, 0x0a, 0x60, 0x00, 0x21, 0x08, 0xeb, + 0x40, 0x10, 0x00, 0xeb, 0x87, 0x00, 0x41, 0x72, 0x0a, 0x48, 0x80, 0x21, + 0x01, 0x60, 0x47, 0x48, 0x01, 0x68, 0x0a, 0x20, 0x88, 0x47, 0x14, 0x20, + 0x21, 0x46, 0xbd, 0xe8, 0xf8, 0x4f, 0xff, 0xf7, 0x9d, 0xbe, 0x00, 0xbf, + 0x08, 0x80, 0x21, 0x40, 0x24, 0x36, 0x01, 0x00, 0x74, 0x87, 0x08, 0x00, + 0x78, 0xad, 0x01, 0x00, 0x14, 0x00, 0x21, 0x40, 0x2d, 0xe9, 0xf8, 0x43, + 0x36, 0x48, 0x06, 0x68, 0x36, 0x48, 0x04, 0x68, 0x15, 0x20, 0x31, 0x46, + 0xff, 0xf7, 0x88, 0xfe, 0xc4, 0xf3, 0x02, 0x25, 0x00, 0x2d, 0x57, 0xd0, + 0x62, 0x4f, 0xdf, 0xf8, 0xc8, 0x90, 0xdf, 0xf8, 0xc8, 0x80, 0x05, 0xeb, + 0x45, 0x01, 0x72, 0xb6, 0x38, 0x68, 0x40, 0x00, 0x01, 0x30, 0x38, 0x60, + 0x99, 0xf8, 0x00, 0x00, 0x00, 0xeb, 0x40, 0x00, 0x08, 0xeb, 0x40, 0x10, + 0x00, 0xeb, 0x81, 0x00, 0x42, 0x68, 0x12, 0xb1, 0xf1, 0xb2, 0x28, 0x46, + 0x90, 0x47, 0x16, 0x20, 0x29, 0x46, 0xff, 0xf7, 0x67, 0xfe, 0x99, 0xf8, + 0x00, 0x00, 0x05, 0xeb, 0x45, 0x06, 0x00, 0xeb, 0x40, 0x00, 0x08, 0xeb, + 0x40, 0x10, 0x50, 0xf8, 0x26, 0x00, 0xc0, 0xb1, 0x28, 0x46, 0xff, 0xf7, + 0x8d, 0xfe, 0x99, 0xf8, 0x00, 0x00, 0x00, 0xeb, 0x40, 0x00, 0x08, 0xeb, + 0x40, 0x10, 0x50, 0xf8, 0x26, 0x00, 0xfe, 0xf7, 0x59, 0xfb, 0x99, 0xf8, + 0x00, 0x00, 0x00, 0x21, 0x00, 0xeb, 0x40, 0x00, 0x08, 0xeb, 0x40, 0x10, + 0x40, 0xf8, 0x26, 0x10, 0x00, 0xeb, 0x86, 0x00, 0x41, 0x60, 0x38, 0x68, + 0x29, 0x46, 0x40, 0x08, 0x38, 0x60, 0x38, 0x68, 0x80, 0xf3, 0x10, 0x88, + 0x17, 0x20, 0xff, 0xf7, 0x39, 0xfe, 0x99, 0xf8, 0x00, 0x00, 0x0e, 0x49, + 0x01, 0x22, 0x00, 0xeb, 0x40, 0x00, 0x0a, 0x60, 0x00, 0x21, 0x08, 0xeb, + 0x40, 0x10, 0x00, 0xeb, 0x86, 0x00, 0x41, 0x72, 0x09, 0x48, 0x01, 0x68, + 0x0e, 0x20, 0x88, 0x47, 0x18, 0x20, 0x21, 0x46, 0xbd, 0xe8, 0xf8, 0x43, + 0xff, 0xf7, 0x22, 0xbe, 0x0c, 0x10, 0x2c, 0x40, 0x0c, 0x80, 0x21, 0x40, + 0x74, 0x87, 0x08, 0x00, 0x78, 0xad, 0x01, 0x00, 0x94, 0x80, 0x21, 0x40, + 0xb8, 0x9c, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0x1a, 0x20, 0xaa, 0x21, + 0xff, 0xf7, 0x10, 0xfe, 0x1a, 0x4b, 0x17, 0x49, 0x17, 0x4a, 0xdf, 0xf8, + 0x60, 0xc0, 0x1a, 0x4f, 0x01, 0x20, 0x00, 0x26, 0x01, 0x24, 0x9e, 0x46, + 0x16, 0x4b, 0x98, 0x46, 0x80, 0x23, 0x15, 0x68, 0x25, 0xf0, 0x01, 0x05, + 0x25, 0x43, 0x15, 0x60, 0x75, 0x46, 0x8c, 0xf8, 0x00, 0x40, 0xce, 0xf8, + 0x00, 0x00, 0xc8, 0xf8, 0x00, 0x60, 0x3e, 0x60, 0x08, 0x60, 0x08, 0x61, + 0x01, 0x3c, 0x45, 0x46, 0x4d, 0x69, 0x45, 0xf0, 0x80, 0x05, 0x4d, 0x61, + 0x8b, 0x61, 0x4d, 0x68, 0x25, 0xf0, 0x02, 0x05, 0x4d, 0x60, 0xe5, 0xb2, + 0x02, 0x2d, 0xe2, 0xd3, 0x1a, 0x20, 0x55, 0x21, 0xbd, 0xe8, 0xf0, 0x41, + 0xff, 0xf7, 0xe0, 0xbd, 0x00, 0x00, 0x21, 0x40, 0x04, 0x10, 0x00, 0x40, + 0x74, 0x87, 0x08, 0x00, 0x00, 0x80, 0x21, 0x40, 0x0c, 0x00, 0x2c, 0x40, + 0x10, 0x00, 0x2c, 0x40, 0x80, 0xb5, 0x00, 0xf0, 0x37, 0xf8, 0x09, 0x48, + 0x0c, 0x22, 0x72, 0xb6, 0x01, 0x68, 0x49, 0x00, 0x01, 0x31, 0x01, 0x60, + 0x06, 0x49, 0x0a, 0x70, 0x06, 0x49, 0x0a, 0x70, 0x01, 0x68, 0x49, 0x08, + 0x01, 0x60, 0x00, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x80, 0xbd, 0x00, 0xbf, + 0x24, 0x36, 0x01, 0x00, 0x0a, 0xe4, 0x00, 0xe0, 0x0e, 0xe4, 0x00, 0xe0, + 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x08, 0xf4, 0x08, 0x00, 0xc5, 0x85, 0x02, 0x00, + 0x04, 0xf4, 0x08, 0x00, 0xf5, 0x83, 0x02, 0x00, 0x3c, 0x9f, 0x08, 0x00, + 0xbd, 0x86, 0x02, 0x00, 0x54, 0x8f, 0x08, 0x00, 0x41, 0x87, 0x02, 0x00, + 0x46, 0xf2, 0xe9, 0x6c, 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xf8, 0xb5, 0x00, 0x28, 0x45, 0xd0, 0x04, 0x46, 0x22, 0x48, 0x0d, 0x46, + 0x00, 0x21, 0x16, 0x46, 0x00, 0xf5, 0xf8, 0x70, 0xfc, 0xf7, 0x6e, 0xfd, + 0x07, 0x46, 0x30, 0xb9, 0x1e, 0x48, 0x01, 0x68, 0x68, 0x1c, 0x80, 0xb2, + 0x88, 0x47, 0x07, 0x46, 0xf8, 0xb1, 0x57, 0xf8, 0x08, 0x0c, 0x3e, 0x70, + 0x22, 0x46, 0x2b, 0x46, 0x01, 0x89, 0x78, 0x1c, 0x01, 0x39, 0xf8, 0xf7, + 0x11, 0xfc, 0x17, 0x48, 0x00, 0xf5, 0x84, 0x71, 0x38, 0x46, 0xfa, 0xf7, + 0xe1, 0xfd, 0x85, 0x48, 0x00, 0x7d, 0xc0, 0x07, 0x04, 0xd1, 0x14, 0x48, + 0x00, 0x68, 0xbd, 0xe8, 0xf8, 0x40, 0x00, 0x47, 0x10, 0x49, 0x68, 0x1c, + 0x08, 0x85, 0xbd, 0xe8, 0xf8, 0x40, 0x02, 0xf0, 0xdd, 0xbf, 0x0f, 0x48, + 0x00, 0x21, 0x02, 0x22, 0x05, 0x68, 0x01, 0x20, 0x00, 0x90, 0x4a, 0x48, + 0xc3, 0x1c, 0x40, 0xf2, 0x23, 0x70, 0xa8, 0x47, 0x20, 0x78, 0x0e, 0x28, + 0x05, 0xd1, 0x00, 0x20, 0x94, 0x21, 0xbd, 0xe8, 0xf8, 0x40, 0xf8, 0xf7, + 0xd5, 0xbb, 0xf8, 0xbd, 0x68, 0x8a, 0x01, 0x00, 0x08, 0xb8, 0x08, 0x00, + 0x2c, 0xba, 0x01, 0x00, 0x48, 0xe4, 0x05, 0x00, 0x24, 0xaa, 0x08, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0x01, 0x46, 0x42, 0xf2, 0x35, 0x00, 0x0a, 0x1a, + 0x01, 0x20, 0x0d, 0x2a, 0x06, 0xd8, 0x00, 0xfa, 0x02, 0xf2, 0x43, 0xf2, + 0xd7, 0x03, 0x1a, 0x42, 0x00, 0xd0, 0x70, 0x47, 0x40, 0xf6, 0x14, 0x42, + 0x91, 0x42, 0xfa, 0xd0, 0x4f, 0xf6, 0x53, 0x52, 0x91, 0x42, 0xf6, 0xd0, + 0x4f, 0xf6, 0x57, 0x52, 0x91, 0x42, 0x1c, 0xbf, 0x00, 0x20, 0x70, 0x47, + 0x70, 0x47, 0x00, 0xbf, 0x10, 0xb5, 0x4a, 0x48, 0x01, 0x21, 0x46, 0x4c, + 0x72, 0xb6, 0x01, 0x70, 0x20, 0x68, 0x40, 0x00, 0x01, 0x30, 0x20, 0x60, + 0x46, 0x48, 0x00, 0x68, 0x80, 0x47, 0x20, 0x68, 0x40, 0x08, 0x20, 0x60, + 0x20, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x10, 0xbd, 0x80, 0xb5, 0x00, 0xf0, + 0xd5, 0xf8, 0x25, 0x48, 0xb0, 0xf8, 0x6c, 0x15, 0x49, 0x06, 0x03, 0xd5, + 0x90, 0xf8, 0x72, 0x05, 0xff, 0x28, 0x00, 0xd0, 0x80, 0xbd, 0x0b, 0x48, + 0x00, 0x21, 0x02, 0x68, 0x0a, 0x20, 0x90, 0x47, 0x09, 0x48, 0x01, 0x21, + 0x01, 0x22, 0x03, 0x68, 0x0a, 0x20, 0x98, 0x47, 0x07, 0x48, 0x08, 0x49, + 0x02, 0x68, 0x01, 0x20, 0x90, 0x47, 0x49, 0x48, 0x01, 0x68, 0x41, 0xf0, + 0x30, 0x01, 0x01, 0x60, 0x80, 0xbd, 0x00, 0xbf, 0xd8, 0x9c, 0x08, 0x00, + 0xdc, 0x9c, 0x08, 0x00, 0xc4, 0x9c, 0x08, 0x00, 0xa9, 0x88, 0x02, 0x00, + 0x80, 0xb5, 0x0d, 0x48, 0x00, 0x78, 0x80, 0xb1, 0x0c, 0x48, 0x40, 0x6a, + 0x20, 0xb9, 0x0c, 0x48, 0x81, 0x21, 0x02, 0x68, 0x09, 0x20, 0x90, 0x47, + 0x0a, 0x48, 0xb0, 0xf8, 0x6c, 0x15, 0x49, 0x06, 0x03, 0xd5, 0x90, 0xf8, + 0x72, 0x05, 0xff, 0x28, 0x00, 0xd0, 0x80, 0xbd, 0x36, 0x48, 0x01, 0x68, + 0x21, 0xf0, 0x30, 0x01, 0x01, 0x60, 0x80, 0xbd, 0x1c, 0x3b, 0x01, 0x00, + 0x88, 0xea, 0x01, 0x00, 0x88, 0xa7, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0xb0, 0xb5, 0x15, 0x4c, 0x2a, 0x4d, 0x72, 0xb6, 0x20, 0x68, 0x40, 0x00, + 0x01, 0x30, 0x20, 0x60, 0x12, 0x48, 0x01, 0x68, 0xa8, 0x7b, 0x88, 0x47, + 0x11, 0x49, 0x40, 0xb1, 0x11, 0x48, 0x01, 0x22, 0x02, 0x70, 0xa8, 0x7b, + 0x02, 0xfa, 0x00, 0xf0, 0x0a, 0x68, 0x10, 0x43, 0x09, 0xe0, 0x0d, 0x48, + 0x00, 0x22, 0x02, 0x70, 0xa8, 0x7b, 0x01, 0x22, 0x02, 0xfa, 0x00, 0xf0, + 0x0a, 0x68, 0x22, 0xea, 0x00, 0x00, 0x08, 0x60, 0x08, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x20, 0x68, 0x40, 0x08, 0x20, 0x60, 0x20, 0x68, 0x80, 0xf3, + 0x10, 0x88, 0xb0, 0xbd, 0x24, 0x36, 0x01, 0x00, 0x10, 0xff, 0x08, 0x00, + 0x54, 0xf4, 0x00, 0x30, 0x18, 0x3b, 0x01, 0x00, 0xa0, 0x9e, 0x08, 0x00, + 0x10, 0xb5, 0x10, 0x4c, 0xa0, 0x7b, 0x0d, 0x28, 0x88, 0xbf, 0x10, 0xbd, + 0x0e, 0x49, 0x0a, 0x68, 0x00, 0x21, 0x90, 0x47, 0x0d, 0x4a, 0xa0, 0x7b, + 0x01, 0x21, 0x13, 0x68, 0x81, 0x40, 0x0b, 0x43, 0x13, 0x60, 0x53, 0x68, + 0x23, 0xea, 0x01, 0x01, 0x51, 0x60, 0x09, 0x49, 0x33, 0xf0, 0x32, 0xff, + 0x08, 0x48, 0x01, 0x68, 0x41, 0xf0, 0x30, 0x01, 0x01, 0x60, 0xbd, 0xe8, + 0x10, 0x40, 0xff, 0xf7, 0xa9, 0xbf, 0x00, 0xbf, 0xdc, 0x2c, 0x06, 0x00, + 0x04, 0xff, 0x08, 0x00, 0x50, 0xf4, 0x00, 0x30, 0x71, 0x89, 0x02, 0x00, + 0x24, 0x40, 0x01, 0x30, 0x80, 0xb5, 0x00, 0xf0, 0x29, 0xf8, 0xbd, 0xe8, + 0x80, 0x40, 0xff, 0xf7, 0xcd, 0xbf, 0x00, 0xbf, 0x06, 0x48, 0x07, 0x49, + 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, + 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x24, 0x9f, 0x08, 0x00, 0xd1, 0x88, 0x02, 0x00, 0xa8, 0xa2, 0x08, 0x00, + 0xc1, 0x87, 0x02, 0x00, 0x28, 0x9f, 0x08, 0x00, 0x29, 0x89, 0x02, 0x00, + 0x20, 0x9f, 0x08, 0x00, 0x35, 0x8a, 0x02, 0x00, 0x47, 0xf6, 0x95, 0x1c, + 0xc1, 0xf2, 0x03, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x47, 0xf2, 0x3d, 0x1c, + 0xc1, 0xf2, 0x03, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x02, 0xf0, 0x40, 0xbe, + 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, 0xb4, 0xa9, 0x08, 0x00, + 0x99, 0x8a, 0x02, 0x00, 0x80, 0xb5, 0x00, 0xf0, 0x11, 0xf8, 0x02, 0x48, + 0x02, 0x49, 0x01, 0x60, 0x80, 0xbd, 0x00, 0xbf, 0xd4, 0x40, 0x05, 0x30, + 0x00, 0x00, 0x01, 0x80, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x58, 0xa4, 0x08, 0x00, 0xad, 0x8a, 0x02, 0x00, 0x41, 0xf2, 0xf1, 0x3c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x70, 0x47, 0x00, 0x00, + 0x08, 0xb1, 0x00, 0xf0, 0x15, 0xb8, 0x05, 0x49, 0x91, 0xf8, 0x28, 0x20, + 0x01, 0x2a, 0x03, 0xd0, 0x91, 0xf8, 0x58, 0x10, 0x01, 0x29, 0xf4, 0xd1, + 0x00, 0x20, 0x70, 0x47, 0x4c, 0x49, 0x01, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x50, 0x9c, 0x08, 0x00, 0xe5, 0x8a, 0x02, 0x00, + 0x41, 0xf2, 0x71, 0x6c, 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xd4, 0x4a, 0x01, 0xeb, 0x41, 0x01, 0x02, 0xeb, 0xc1, 0x01, 0x89, 0x79, + 0x29, 0xb1, 0xc0, 0x43, 0x08, 0x44, 0xb0, 0xfa, 0x80, 0xf0, 0x40, 0x09, + 0x70, 0x47, 0x01, 0x20, 0x70, 0x47, 0x00, 0xbf, 0xb0, 0xb5, 0x04, 0x29, + 0x29, 0xd8, 0xdf, 0xe8, 0x01, 0xf0, 0x03, 0x18, 0x28, 0x03, 0x18, 0x00, + 0x42, 0x7e, 0x1e, 0x23, 0xc0, 0x7e, 0x14, 0x24, 0x01, 0xeb, 0x41, 0x01, + 0x02, 0xeb, 0x82, 0x02, 0x03, 0xeb, 0x82, 0x02, 0xd3, 0xb2, 0x13, 0xfb, + 0x00, 0x43, 0xc2, 0x4c, 0x24, 0xf8, 0x31, 0x30, 0x04, 0xeb, 0xc1, 0x01, + 0x08, 0x72, 0x4a, 0x72, 0xb0, 0xbd, 0x82, 0x7a, 0xc0, 0x7a, 0xbd, 0x4b, + 0x01, 0xeb, 0x41, 0x01, 0x42, 0xea, 0x00, 0x20, 0x00, 0xeb, 0x80, 0x02, + 0x04, 0x32, 0x23, 0xf8, 0x31, 0x20, 0x03, 0xeb, 0xc1, 0x01, 0x88, 0x80, + 0xb0, 0xbd, 0x03, 0x7c, 0xc2, 0x7b, 0x44, 0x7c, 0x85, 0x7c, 0x01, 0xeb, + 0x41, 0x01, 0x9b, 0x02, 0x43, 0xea, 0x82, 0x02, 0x42, 0xea, 0x84, 0x43, + 0x43, 0xea, 0x85, 0x63, 0x18, 0x44, 0xc3, 0x7c, 0x00, 0x7d, 0x80, 0x02, + 0x40, 0xea, 0x83, 0x00, 0x10, 0x44, 0xac, 0x4a, 0x0f, 0x30, 0x22, 0xf8, + 0x31, 0x00, 0xb0, 0xbd, 0x70, 0xb5, 0xa9, 0x49, 0x00, 0xeb, 0x40, 0x00, + 0x01, 0xeb, 0xc0, 0x04, 0x25, 0x69, 0x55, 0xb1, 0x68, 0x68, 0x08, 0xb1, + 0xfe, 0xf7, 0x8c, 0xf8, 0xae, 0x68, 0x28, 0x46, 0xfe, 0xf7, 0x88, 0xf8, + 0x00, 0x2e, 0x35, 0x46, 0xf4, 0xd1, 0x20, 0x46, 0x18, 0x21, 0xfa, 0xf7, + 0xa7, 0xfb, 0x70, 0xbd, 0x10, 0xb5, 0x00, 0x24, 0xe0, 0xb2, 0xff, 0xf7, + 0xe3, 0xff, 0x01, 0x34, 0xe0, 0xb2, 0x05, 0x28, 0xf8, 0xd1, 0x99, 0x48, + 0x80, 0x21, 0xfa, 0xf7, 0x99, 0xfb, 0x10, 0xbd, 0x96, 0x4a, 0x00, 0xeb, + 0x40, 0x00, 0x02, 0xeb, 0xc0, 0x00, 0x00, 0x69, 0x38, 0xb1, 0x00, 0x22, + 0xd3, 0xb2, 0x8b, 0x42, 0x04, 0xd0, 0x80, 0x68, 0x01, 0x32, 0x00, 0x28, + 0xf8, 0xd1, 0x00, 0x20, 0x70, 0x47, 0x00, 0xbf, 0x2d, 0xe9, 0xf8, 0x43, + 0x8c, 0x49, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0xc0, 0x00, 0x00, 0x69, + 0x40, 0x68, 0x81, 0x78, 0xc0, 0x78, 0x41, 0xea, 0x00, 0x29, 0xb9, 0xf1, + 0x00, 0x0f, 0x30, 0xd0, 0x00, 0x25, 0x33, 0x26, 0x00, 0x27, 0x4f, 0xf0, + 0x00, 0x08, 0x00, 0x24, 0xa1, 0xb2, 0xb1, 0xfb, 0xf6, 0xf1, 0x01, 0xfb, + 0x16, 0x42, 0x12, 0x04, 0x05, 0xd1, 0x48, 0x1c, 0xc1, 0xb2, 0x01, 0x20, + 0xff, 0xf7, 0xcc, 0xff, 0x40, 0x68, 0xb5, 0xfb, 0xf6, 0xf1, 0xa1, 0xeb, + 0x01, 0x21, 0x39, 0x44, 0x42, 0x5c, 0x7f, 0x2a, 0x09, 0xd1, 0x01, 0x44, + 0x89, 0x78, 0x01, 0x29, 0x03, 0xd0, 0x21, 0xb9, 0x48, 0xf0, 0x01, 0x08, + 0x01, 0xe0, 0x48, 0xf0, 0x02, 0x08, 0x01, 0x34, 0x01, 0x35, 0x05, 0x37, + 0xa1, 0xb2, 0x49, 0x45, 0xda, 0xd3, 0xb8, 0xf1, 0x03, 0x00, 0x18, 0xbf, + 0x12, 0x20, 0xbd, 0xe8, 0xf8, 0x83, 0x12, 0x20, 0xbd, 0xe8, 0xf8, 0x83, + 0x10, 0xb5, 0x04, 0x46, 0xff, 0xf7, 0x80, 0xff, 0x69, 0x49, 0x00, 0x2c, + 0x4f, 0xf0, 0x18, 0x03, 0x08, 0x46, 0x01, 0xf1, 0x60, 0x02, 0x18, 0xbf, + 0x18, 0x30, 0x08, 0xbf, 0x01, 0xf1, 0x48, 0x02, 0x18, 0x21, 0xbd, 0xe8, + 0x10, 0x40, 0xf8, 0xf7, 0x99, 0xb9, 0x00, 0xbf, 0xf0, 0xb5, 0x85, 0xb0, + 0x13, 0x4d, 0x00, 0x26, 0x72, 0xb6, 0x28, 0x68, 0x40, 0x00, 0x01, 0x30, + 0x28, 0x60, 0x00, 0x20, 0xff, 0xf7, 0xde, 0xff, 0x5a, 0x4f, 0x6c, 0x46, + 0x11, 0x21, 0x11, 0x23, 0x38, 0x69, 0x42, 0x68, 0x20, 0x46, 0xf8, 0xf7, + 0x83, 0xf9, 0x01, 0x20, 0xff, 0xf7, 0xd2, 0xff, 0x20, 0x46, 0x01, 0xf0, + 0x9b, 0xfa, 0x28, 0x68, 0x30, 0x21, 0x40, 0x08, 0x28, 0x60, 0x28, 0x68, + 0x80, 0xf3, 0x10, 0x88, 0x07, 0xf1, 0x48, 0x00, 0x87, 0xf8, 0x7b, 0x60, + 0xfa, 0xf7, 0x04, 0xfb, 0x05, 0xb0, 0xf0, 0xbd, 0x24, 0x36, 0x01, 0x00, + 0xf8, 0xb5, 0x17, 0x49, 0x49, 0x4e, 0x00, 0xeb, 0x40, 0x05, 0x36, 0xf8, + 0x35, 0x00, 0x09, 0x68, 0x88, 0x47, 0x18, 0xb3, 0x06, 0xeb, 0xc5, 0x05, + 0x04, 0x46, 0x28, 0x7a, 0x03, 0x28, 0x18, 0xd8, 0x2e, 0x69, 0xde, 0xb1, + 0x00, 0x27, 0x72, 0x68, 0x5a, 0xb1, 0x31, 0x78, 0x54, 0xfa, 0x87, 0xf0, + 0x0b, 0x46, 0xf8, 0xf7, 0x51, 0xf9, 0x30, 0x78, 0xb6, 0x68, 0x50, 0xfa, + 0x87, 0xf7, 0x00, 0x2e, 0xf1, 0xd1, 0x3b, 0x48, 0x2b, 0x88, 0x00, 0x21, + 0x22, 0x46, 0x05, 0x68, 0x4f, 0xf4, 0x8e, 0x60, 0xa8, 0x47, 0x20, 0x46, + 0xbd, 0xe8, 0xf8, 0x40, 0xfd, 0xf7, 0xac, 0xbf, 0xf8, 0xbd, 0x00, 0xbf, + 0xd4, 0x9b, 0x08, 0x00, 0xf8, 0xb5, 0x31, 0x49, 0x00, 0xeb, 0x40, 0x00, + 0x01, 0xeb, 0xc0, 0x05, 0xaa, 0x88, 0x61, 0x2a, 0x25, 0xd8, 0x31, 0xf8, + 0x30, 0x00, 0xed, 0x49, 0x09, 0x68, 0x88, 0x47, 0x00, 0x28, 0x52, 0xd0, + 0x2e, 0x69, 0x00, 0x2e, 0x4f, 0xd0, 0x04, 0x46, 0x00, 0x27, 0x31, 0x78, + 0x72, 0x68, 0x54, 0xfa, 0x87, 0xf0, 0x0b, 0x46, 0xf8, 0xf7, 0x1e, 0xf9, + 0x30, 0x78, 0xb6, 0x68, 0x50, 0xfa, 0x87, 0xf7, 0x00, 0x2e, 0xf2, 0xd1, + 0x21, 0x48, 0x2b, 0x88, 0x00, 0x21, 0x22, 0x46, 0x05, 0x68, 0x40, 0xf2, + 0x71, 0x40, 0xa8, 0x47, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x40, 0xfd, 0xf7, + 0x79, 0xbf, 0x2e, 0x69, 0x8e, 0xb3, 0xb1, 0x68, 0x30, 0x78, 0x09, 0x78, + 0x0c, 0x18, 0xd8, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x40, 0xb3, + 0x31, 0x78, 0x72, 0x68, 0x05, 0x46, 0x0b, 0x46, 0xf8, 0xf7, 0xfa, 0xf8, + 0xb2, 0x68, 0x30, 0x78, 0x11, 0x78, 0x52, 0x68, 0x28, 0x44, 0x0b, 0x46, + 0xf8, 0xf7, 0xf2, 0xf8, 0x0e, 0x4e, 0x40, 0xf2, 0x71, 0x40, 0x00, 0x21, + 0x2a, 0x46, 0x23, 0x46, 0x37, 0x68, 0xb8, 0x47, 0x28, 0x46, 0xfd, 0xf7, + 0x55, 0xff, 0x01, 0x20, 0x02, 0x21, 0xff, 0xf7, 0xdf, 0xfe, 0x50, 0xb1, + 0x04, 0x46, 0x23, 0x78, 0x62, 0x68, 0x35, 0x68, 0x40, 0xf2, 0x71, 0x40, + 0x00, 0x21, 0xa8, 0x47, 0xa4, 0x68, 0x00, 0x2c, 0xf5, 0xd1, 0xf8, 0xbd, + 0x50, 0xe2, 0x05, 0x00, 0x78, 0x9b, 0x08, 0x00, 0xb0, 0xb5, 0x86, 0xb0, + 0xa0, 0xf1, 0x1e, 0x01, 0x12, 0x24, 0x05, 0x29, 0x1c, 0xd8, 0xdf, 0xe8, + 0x01, 0xf0, 0x87, 0x88, 0x03, 0x39, 0x3f, 0x44, 0xb9, 0x4c, 0x94, 0xf8, + 0x78, 0x10, 0x01, 0xf0, 0x03, 0x00, 0x42, 0x1e, 0xd2, 0xb2, 0x01, 0x2a, + 0x05, 0xd8, 0x4a, 0x07, 0x48, 0xbf, 0x5f, 0xea, 0x01, 0x72, 0x00, 0xf1, + 0x79, 0x80, 0x88, 0x07, 0x72, 0xd1, 0x00, 0x20, 0x00, 0x24, 0x01, 0xf0, + 0xcf, 0xf8, 0xff, 0xf7, 0x9d, 0xfe, 0x6c, 0xe0, 0x04, 0x28, 0x6a, 0xd8, + 0xdf, 0xe8, 0x00, 0xf0, 0x03, 0x2b, 0x69, 0x32, 0x3d, 0x00, 0xaa, 0x4d, + 0x01, 0xac, 0x11, 0x21, 0x11, 0x23, 0x28, 0x69, 0x42, 0x68, 0x20, 0x46, + 0xf8, 0xf7, 0x9e, 0xf8, 0x20, 0x46, 0x01, 0xf0, 0xb9, 0xf9, 0x95, 0xf8, + 0x78, 0x00, 0x00, 0x24, 0x40, 0xf0, 0x04, 0x00, 0x85, 0xf8, 0x78, 0x00, + 0x00, 0x20, 0xff, 0xf7, 0x25, 0xff, 0x4e, 0xe0, 0x9e, 0x48, 0x90, 0xf8, + 0x7a, 0x00, 0x01, 0xf0, 0x9d, 0xf9, 0x47, 0xe0, 0x00, 0x20, 0x00, 0x24, + 0x01, 0xf0, 0x04, 0xf8, 0x43, 0xe0, 0x99, 0x48, 0x90, 0xf8, 0x7c, 0x00, + 0x00, 0xf0, 0x82, 0xfe, 0x3c, 0xe0, 0x01, 0x20, 0xff, 0xf7, 0x8a, 0xfe, + 0xb0, 0xb1, 0x04, 0x46, 0x01, 0x20, 0x10, 0xe0, 0x03, 0x20, 0xff, 0xf7, + 0x09, 0xff, 0x91, 0x48, 0x90, 0xf8, 0x7b, 0x10, 0x41, 0xf0, 0x01, 0x01, + 0x80, 0xf8, 0x7b, 0x10, 0x2a, 0xe0, 0x04, 0x20, 0xff, 0xf7, 0x78, 0xfe, + 0xc0, 0xb1, 0x04, 0x46, 0x04, 0x20, 0xff, 0xf7, 0x3b, 0xfe, 0x22, 0xe0, + 0x88, 0x49, 0x91, 0xf8, 0x78, 0x00, 0x40, 0xf0, 0x08, 0x02, 0x81, 0xf8, + 0x78, 0x20, 0xa2, 0xf1, 0x0d, 0x01, 0xc9, 0xb2, 0x01, 0x29, 0x03, 0xd8, + 0x00, 0xf0, 0x03, 0x00, 0x01, 0xf0, 0x72, 0xf8, 0x01, 0x20, 0xff, 0xf7, + 0x17, 0xff, 0x0d, 0xe0, 0x04, 0x20, 0xff, 0xf7, 0x13, 0xff, 0x7d, 0x48, + 0x90, 0xf8, 0x7b, 0x10, 0x41, 0xf0, 0x02, 0x01, 0x03, 0x29, 0x80, 0xf8, + 0x7b, 0x10, 0x01, 0xd1, 0xff, 0xf7, 0xaa, 0xfe, 0x00, 0x24, 0x20, 0x46, + 0x06, 0xb0, 0xb0, 0xbd, 0x01, 0xf0, 0x5a, 0xf8, 0x94, 0xf8, 0x78, 0x10, + 0x81, 0xe7, 0x00, 0xbf, 0x2d, 0xe9, 0xfe, 0x4f, 0x04, 0x46, 0x04, 0x28, + 0x00, 0xf2, 0xae, 0x80, 0xdf, 0xe8, 0x04, 0xf0, 0x03, 0x51, 0xac, 0x03, + 0x51, 0x00, 0xdf, 0xf8, 0xb0, 0xb1, 0x0c, 0x20, 0xdb, 0xf8, 0x00, 0x10, + 0x88, 0x47, 0x6a, 0x4a, 0x04, 0xeb, 0x44, 0x01, 0x4f, 0xf0, 0x00, 0x0a, + 0x14, 0x24, 0xc0, 0xf8, 0x08, 0xa0, 0x02, 0xeb, 0xc1, 0x06, 0xdb, 0xf8, + 0x00, 0x10, 0xb1, 0x46, 0x49, 0xf8, 0x10, 0x0f, 0x14, 0x20, 0x88, 0x47, + 0xd9, 0xf8, 0x00, 0x10, 0x35, 0x46, 0x45, 0xf8, 0x14, 0x1f, 0x48, 0x60, + 0x0c, 0x70, 0x2f, 0x46, 0x17, 0xf8, 0x0c, 0x0d, 0x00, 0x28, 0x00, 0xf0, + 0xa3, 0x80, 0x02, 0x96, 0x09, 0x36, 0x4f, 0xf0, 0x00, 0x08, 0xdb, 0xf8, + 0x00, 0x10, 0x0c, 0x20, 0x88, 0x47, 0x00, 0x28, 0x00, 0xf0, 0xa7, 0x80, + 0x04, 0x46, 0x30, 0x78, 0xdb, 0xf8, 0x00, 0x10, 0x88, 0x47, 0x00, 0x28, + 0x60, 0x60, 0x00, 0xf0, 0x99, 0x80, 0x30, 0x78, 0x08, 0xf1, 0x01, 0x08, + 0xc4, 0xf8, 0x08, 0xa0, 0x84, 0xf8, 0x01, 0xa0, 0x1f, 0xfa, 0x88, 0xf1, + 0x20, 0x70, 0x28, 0x68, 0x2c, 0x60, 0x84, 0x60, 0x38, 0x78, 0x81, 0x42, + 0xdf, 0xd3, 0xd9, 0xf8, 0x00, 0x10, 0x02, 0x9e, 0x08, 0xf1, 0x01, 0x00, + 0x79, 0xe0, 0xdf, 0xf8, 0x14, 0xb1, 0x0c, 0x20, 0xdb, 0xf8, 0x00, 0x10, + 0x88, 0x47, 0x43, 0x4a, 0x04, 0xeb, 0x44, 0x01, 0x4f, 0xf0, 0x00, 0x0a, + 0x04, 0x24, 0xc0, 0xf8, 0x08, 0xa0, 0x02, 0xeb, 0xc1, 0x05, 0xdb, 0xf8, + 0x00, 0x10, 0x2f, 0x46, 0x47, 0xf8, 0x10, 0x0f, 0x04, 0x20, 0x88, 0x47, + 0x39, 0x68, 0x2e, 0x46, 0x46, 0xf8, 0x14, 0x1f, 0x48, 0x60, 0x0c, 0x70, + 0x36, 0xf9, 0x10, 0x8c, 0xb8, 0xf1, 0x01, 0x0f, 0x5a, 0xdb, 0xcd, 0xe9, + 0x01, 0x75, 0x01, 0x27, 0x4f, 0xf0, 0x33, 0x09, 0x0f, 0xfa, 0x88, 0xf0, + 0x32, 0x28, 0x01, 0xdd, 0xff, 0x24, 0x07, 0xe0, 0x1f, 0xfa, 0x88, 0xf0, + 0xb0, 0xfb, 0xf9, 0xf1, 0x01, 0xfb, 0x19, 0x00, 0x00, 0xeb, 0x80, 0x04, + 0xdb, 0xf8, 0x00, 0x10, 0x0c, 0x20, 0x88, 0x47, 0x00, 0x28, 0x4c, 0xd0, + 0xdb, 0xf8, 0x00, 0x10, 0x05, 0x46, 0x20, 0x46, 0x88, 0x47, 0x00, 0x28, + 0x68, 0x60, 0x41, 0xd0, 0x30, 0x68, 0xc5, 0xf8, 0x08, 0xa0, 0x05, 0x21, + 0x01, 0x37, 0x2c, 0x70, 0x85, 0xf8, 0x01, 0xa0, 0x35, 0x60, 0x85, 0x60, + 0xe0, 0xb2, 0xb0, 0xfb, 0xf1, 0xf0, 0xa8, 0xeb, 0x00, 0x00, 0x0f, 0xfa, + 0x80, 0xf8, 0xb8, 0xf1, 0x00, 0x0f, 0xcf, 0xdc, 0x01, 0x98, 0x02, 0x9d, + 0x01, 0x68, 0x22, 0xe0, 0x17, 0x4d, 0x0c, 0x20, 0x29, 0x68, 0x88, 0x47, + 0xd7, 0x4a, 0x04, 0xeb, 0x44, 0x01, 0x02, 0xeb, 0xc1, 0x04, 0x26, 0x46, + 0x46, 0xf8, 0x10, 0x0f, 0xf8, 0xb1, 0x00, 0x23, 0x43, 0x70, 0x83, 0x60, + 0x32, 0xf8, 0x31, 0x00, 0x29, 0x68, 0x88, 0x47, 0x01, 0x46, 0x30, 0x68, + 0x41, 0x60, 0x91, 0xb1, 0x21, 0x78, 0x60, 0x61, 0x01, 0x70, 0x01, 0x20, + 0x20, 0x73, 0x06, 0xe0, 0x01, 0x20, 0x29, 0x60, 0x30, 0x73, 0x02, 0xe0, + 0x01, 0x27, 0x31, 0x60, 0x2f, 0x73, 0x00, 0x20, 0xbd, 0xe8, 0xfe, 0x8f, + 0x20, 0x46, 0x00, 0xe0, 0x28, 0x46, 0xfd, 0xf7, 0xc5, 0xfd, 0x07, 0x20, + 0xbd, 0xe8, 0xfe, 0x8f, 0xd4, 0x9b, 0x08, 0x00, 0x50, 0xe2, 0x05, 0x00, + 0x2d, 0xe9, 0xf8, 0x43, 0x6a, 0xb3, 0x05, 0x46, 0x01, 0xeb, 0x41, 0x00, + 0xbc, 0x49, 0x14, 0x46, 0x01, 0xeb, 0xc0, 0x08, 0x18, 0xf8, 0x07, 0x0f, + 0x47, 0x1c, 0x08, 0xf1, 0x0d, 0x09, 0xe1, 0xb2, 0xf6, 0x29, 0x1e, 0xd8, + 0xd9, 0xf8, 0x00, 0x00, 0xd8, 0xb1, 0x02, 0x78, 0x43, 0x78, 0x40, 0x68, + 0xd6, 0x1a, 0x18, 0x44, 0x8e, 0x42, 0x16, 0xda, 0xf1, 0xb2, 0x2a, 0x46, + 0x0b, 0x46, 0xf7, 0xf7, 0x2f, 0xff, 0xd9, 0xf8, 0x00, 0x00, 0xa4, 0x1b, + 0x88, 0xf8, 0x00, 0x70, 0x55, 0xfa, 0x86, 0xf5, 0x01, 0x37, 0x81, 0x68, + 0xc9, 0xf8, 0x00, 0x10, 0x41, 0x78, 0x31, 0x44, 0x41, 0x70, 0x20, 0x06, + 0xdd, 0xd1, 0xbd, 0xe8, 0xf8, 0x83, 0x2a, 0x46, 0x0b, 0x46, 0xf7, 0xf7, + 0x19, 0xff, 0xd9, 0xf8, 0x00, 0x00, 0x41, 0x78, 0x21, 0x44, 0x41, 0x70, + 0xbd, 0xe8, 0xf8, 0x83, 0x2d, 0xe9, 0xf8, 0x4f, 0x06, 0x46, 0x89, 0x46, + 0x01, 0xeb, 0x41, 0x00, 0x9d, 0x49, 0x96, 0xf8, 0x04, 0xa0, 0x77, 0x79, + 0xb4, 0x79, 0xf2, 0x79, 0x01, 0xeb, 0xc0, 0x0b, 0xd8, 0x46, 0x5d, 0x46, + 0x18, 0xf8, 0x06, 0x0f, 0xd8, 0xb1, 0x3b, 0xf8, 0x02, 0x1f, 0x28, 0x88, + 0xba, 0xf1, 0x00, 0x0f, 0x2d, 0xd0, 0x11, 0x44, 0x47, 0xea, 0x04, 0x23, + 0x89, 0xb2, 0x40, 0x1a, 0x98, 0x42, 0x2c, 0xd1, 0x06, 0xf1, 0x08, 0x00, + 0x49, 0x46, 0x14, 0x46, 0xff, 0xf7, 0x9c, 0xff, 0xbb, 0xf8, 0x00, 0x00, + 0x00, 0x27, 0x88, 0xf8, 0x00, 0xa0, 0x20, 0x44, 0xab, 0xf8, 0x00, 0x00, + 0x28, 0xe0, 0x30, 0x46, 0x49, 0x46, 0x00, 0x92, 0xff, 0xf7, 0x6e, 0xfc, + 0x28, 0x88, 0xba, 0xf1, 0x00, 0x0f, 0x18, 0xd0, 0x00, 0x9a, 0x47, 0xea, + 0x04, 0x21, 0x80, 0x1a, 0x88, 0x42, 0x18, 0xd1, 0x48, 0x46, 0xff, 0xf7, + 0x99, 0xfe, 0xc0, 0xb1, 0x07, 0x46, 0x48, 0x46, 0xff, 0xf7, 0xa2, 0xfc, + 0x10, 0xe0, 0x40, 0x1a, 0x90, 0x42, 0x02, 0xd1, 0x47, 0xea, 0x04, 0x20, + 0x70, 0xb3, 0x48, 0x46, 0xff, 0xf7, 0x98, 0xfc, 0x05, 0xe0, 0x00, 0x99, + 0x88, 0x42, 0x02, 0xd1, 0x47, 0xea, 0x04, 0x20, 0xb8, 0xb3, 0x12, 0x27, + 0x38, 0x46, 0xbd, 0xe8, 0xf8, 0x8f, 0xdb, 0xe9, 0x04, 0x02, 0x01, 0x78, + 0x50, 0x68, 0x06, 0xf1, 0x08, 0x02, 0x0b, 0x46, 0xf7, 0xf7, 0xae, 0xfe, + 0x01, 0x20, 0x00, 0x27, 0x00, 0x9c, 0x8b, 0xf8, 0x07, 0x00, 0xdb, 0xe9, + 0x04, 0x01, 0x89, 0x68, 0xcb, 0xf8, 0x14, 0x10, 0x4f, 0x70, 0x01, 0x78, + 0x88, 0x19, 0x61, 0x1a, 0xca, 0xb2, 0x08, 0x30, 0x49, 0x46, 0xff, 0xf7, + 0x4b, 0xff, 0x88, 0xf8, 0x00, 0xa0, 0xab, 0xf8, 0x02, 0x40, 0xdb, 0xe7, + 0x06, 0xf1, 0x08, 0x00, 0x49, 0x46, 0x14, 0x46, 0xff, 0xf7, 0x40, 0xff, + 0xbb, 0xf8, 0x00, 0x00, 0x20, 0x44, 0xab, 0xf8, 0x00, 0x00, 0x48, 0x46, + 0xff, 0xf7, 0xb6, 0xfd, 0x00, 0x21, 0x88, 0xf8, 0x00, 0x10, 0xbd, 0xe8, + 0xf8, 0x8f, 0x48, 0x46, 0xff, 0xf7, 0x48, 0xfe, 0x00, 0x28, 0xad, 0xd1, + 0x5c, 0x46, 0x06, 0xf1, 0x08, 0x02, 0x54, 0xf8, 0x10, 0x0f, 0x27, 0x46, + 0x01, 0x78, 0x57, 0xf8, 0x04, 0x0f, 0x0b, 0x46, 0x40, 0x68, 0xf7, 0xf7, + 0x71, 0xfe, 0x00, 0x9d, 0x01, 0x20, 0xb9, 0xf1, 0x02, 0x0f, 0x04, 0xf8, + 0x09, 0x0c, 0x0d, 0xd0, 0x38, 0x68, 0x00, 0x21, 0x80, 0x68, 0x38, 0x60, + 0x41, 0x70, 0x20, 0x68, 0x01, 0x78, 0x88, 0x19, 0x69, 0x1a, 0xca, 0xb2, + 0x08, 0x30, 0x49, 0x46, 0xff, 0xf7, 0x0c, 0xff, 0xab, 0xf8, 0x02, 0x50, + 0x48, 0x46, 0xbd, 0xe8, 0xf8, 0x4f, 0xff, 0xf7, 0x83, 0xbd, 0x00, 0xbf, + 0x2d, 0xe9, 0xf8, 0x43, 0x06, 0x46, 0xc4, 0x78, 0x05, 0x79, 0x90, 0x48, + 0x90, 0xf8, 0xc0, 0x00, 0x01, 0x28, 0x11, 0xd1, 0x3c, 0x48, 0x90, 0xf8, + 0x78, 0x10, 0x01, 0xf0, 0x03, 0x02, 0x01, 0x3a, 0x01, 0x2a, 0x09, 0xd8, + 0x0d, 0x39, 0x96, 0xf8, 0x02, 0x80, 0x96, 0xf8, 0x07, 0x90, 0x01, 0x29, + 0x0c, 0xd8, 0x90, 0xf8, 0x7b, 0x00, 0x58, 0xb1, 0x0c, 0x22, 0x03, 0x20, + 0x4f, 0xf6, 0xda, 0x41, 0x23, 0x46, 0x00, 0x95, 0x24, 0xf0, 0xe0, 0xfd, + 0xbd, 0xe8, 0xf8, 0x83, 0x00, 0x27, 0x00, 0xe0, 0x03, 0x27, 0x28, 0x46, + 0x39, 0x46, 0xff, 0xf7, 0xa7, 0xfb, 0x01, 0x28, 0x0c, 0xd1, 0xb9, 0xf1, + 0xf6, 0x0f, 0x09, 0xd8, 0x09, 0xf1, 0x05, 0x00, 0x40, 0x45, 0x05, 0xd1, + 0x30, 0x46, 0x39, 0x46, 0xff, 0xf7, 0x08, 0xff, 0x02, 0x46, 0xe0, 0xe7, + 0x38, 0x46, 0xff, 0xf7, 0xeb, 0xfb, 0x12, 0x22, 0xdb, 0xe7, 0x00, 0xbf, + 0x2d, 0xe9, 0xf8, 0x43, 0x06, 0x46, 0xc4, 0x78, 0x05, 0x79, 0x6f, 0x48, + 0x90, 0xf8, 0xc0, 0x00, 0x01, 0x28, 0x14, 0xd1, 0x1b, 0x48, 0x90, 0xf8, + 0x78, 0x10, 0x01, 0xf0, 0x07, 0x02, 0x05, 0x3a, 0x01, 0x2a, 0x0c, 0xd8, + 0x0d, 0x39, 0x96, 0xf8, 0x02, 0x80, 0x96, 0xf8, 0x07, 0x90, 0x01, 0x29, + 0x0f, 0xd8, 0x90, 0xf8, 0x7b, 0x00, 0x01, 0x28, 0x01, 0xd1, 0x04, 0x27, + 0x0a, 0xe0, 0x0c, 0x22, 0x03, 0x20, 0x4f, 0xf6, 0xda, 0x41, 0x23, 0x46, + 0x00, 0x95, 0x24, 0xf0, 0x9b, 0xfd, 0xbd, 0xe8, 0xf8, 0x83, 0x01, 0x27, + 0x28, 0x46, 0x39, 0x46, 0xff, 0xf7, 0x64, 0xfb, 0x01, 0x28, 0x0c, 0xd1, + 0xb9, 0xf1, 0xf6, 0x0f, 0x09, 0xd8, 0x09, 0xf1, 0x05, 0x00, 0x40, 0x45, + 0x05, 0xd1, 0x30, 0x46, 0x39, 0x46, 0xff, 0xf7, 0xc5, 0xfe, 0x02, 0x46, + 0xe2, 0xe7, 0x38, 0x46, 0xff, 0xf7, 0xa8, 0xfb, 0x12, 0x22, 0xdd, 0xe7, + 0x50, 0xe2, 0x05, 0x00, 0x4f, 0x49, 0xc3, 0x78, 0x91, 0xf8, 0xc0, 0x10, + 0x01, 0x29, 0x08, 0xd1, 0x00, 0x79, 0x01, 0x28, 0x8f, 0xbf, 0x12, 0x22, + 0xf2, 0x49, 0x81, 0xf8, 0x79, 0x00, 0x00, 0x22, 0x00, 0xe0, 0x0c, 0x22, + 0x48, 0x48, 0x4f, 0xf6, 0xda, 0x41, 0xd0, 0xf8, 0x00, 0xc0, 0x02, 0x20, + 0x60, 0x47, 0x00, 0xbf, 0x10, 0xb5, 0x43, 0x49, 0xc4, 0x78, 0x91, 0xf8, + 0xc0, 0x10, 0x01, 0x29, 0x15, 0xd1, 0x00, 0x79, 0x02, 0x28, 0x14, 0xd8, + 0xe6, 0x49, 0x91, 0xf8, 0x78, 0x20, 0x20, 0xb9, 0x02, 0xf0, 0x03, 0x03, + 0x01, 0x3b, 0x01, 0x2b, 0x09, 0xd8, 0x02, 0xf0, 0xfc, 0x02, 0x10, 0x43, + 0x81, 0xf8, 0x78, 0x00, 0x20, 0x20, 0xff, 0xf7, 0xc9, 0xfc, 0x02, 0x46, + 0x02, 0xe0, 0x0c, 0x22, 0x00, 0xe0, 0x12, 0x22, 0x34, 0x48, 0x4f, 0xf6, + 0xda, 0x41, 0x23, 0x46, 0xd0, 0xf8, 0x00, 0xc0, 0x02, 0x20, 0xbd, 0xe8, + 0x10, 0x40, 0x60, 0x47, 0x10, 0xb5, 0x2e, 0x49, 0xc4, 0x78, 0x91, 0xf8, + 0xc0, 0x10, 0x01, 0x29, 0x08, 0xd1, 0x00, 0x79, 0xd2, 0x49, 0x81, 0xf8, + 0x7a, 0x00, 0x21, 0x20, 0xff, 0xf7, 0xac, 0xfc, 0x02, 0x46, 0x00, 0xe0, + 0x0c, 0x22, 0x27, 0x48, 0x4f, 0xf6, 0xda, 0x41, 0x23, 0x46, 0xd0, 0xf8, + 0x00, 0xc0, 0x02, 0x20, 0xbd, 0xe8, 0x10, 0x40, 0x60, 0x47, 0x00, 0xbf, + 0x10, 0xb5, 0x20, 0x49, 0xc4, 0x78, 0x91, 0xf8, 0xc0, 0x10, 0x01, 0x29, + 0x0a, 0xd1, 0x00, 0x79, 0x01, 0x28, 0x09, 0xd8, 0xc3, 0x49, 0x81, 0xf8, + 0x7c, 0x00, 0x23, 0x20, 0xff, 0xf7, 0x8e, 0xfc, 0x02, 0x46, 0x02, 0xe0, + 0x0c, 0x22, 0x00, 0xe0, 0x12, 0x22, 0x17, 0x48, 0x4f, 0xf6, 0xda, 0x41, + 0x23, 0x46, 0xd0, 0xf8, 0x00, 0xc0, 0x02, 0x20, 0xbd, 0xe8, 0x10, 0x40, + 0x60, 0x47, 0x00, 0xbf, 0x10, 0xb5, 0x10, 0x49, 0xc4, 0x78, 0x91, 0xf8, + 0xc0, 0x10, 0x01, 0x29, 0x0f, 0xd1, 0xb5, 0x49, 0x91, 0xf8, 0x78, 0x20, + 0x0d, 0x3a, 0x01, 0x2a, 0x09, 0xd8, 0x02, 0x79, 0x01, 0xf8, 0x7e, 0x2f, + 0x40, 0x79, 0x48, 0x70, 0x22, 0x20, 0xff, 0xf7, 0x69, 0xfc, 0x02, 0x46, + 0x00, 0xe0, 0x0c, 0x22, 0x05, 0x48, 0x4f, 0xf6, 0xda, 0x41, 0x23, 0x46, + 0xd0, 0xf8, 0x00, 0xc0, 0x02, 0x20, 0xbd, 0xe8, 0x10, 0x40, 0x60, 0x47, + 0xd0, 0x32, 0x06, 0x00, 0x2c, 0x9c, 0x08, 0x00, 0xf8, 0xb5, 0x01, 0x30, + 0x0c, 0x46, 0x00, 0x25, 0xc1, 0xb2, 0x00, 0x20, 0xff, 0xf7, 0x1e, 0xfb, + 0x43, 0x68, 0x93, 0xf8, 0x00, 0xe0, 0xbe, 0xf1, 0x00, 0x0f, 0x1b, 0xd0, + 0x4f, 0xf0, 0x01, 0x0c, 0x01, 0x33, 0x00, 0x25, 0x0c, 0xfa, 0x04, 0xf2, + 0x00, 0x24, 0x03, 0xeb, 0x84, 0x07, 0x13, 0xf8, 0x24, 0x60, 0x79, 0x78, + 0xb8, 0x78, 0xff, 0x78, 0x46, 0xea, 0x01, 0x21, 0x40, 0xea, 0x07, 0x20, + 0x41, 0xea, 0x00, 0x40, 0x10, 0x42, 0x1c, 0xbf, 0x0c, 0xfa, 0x04, 0xf0, + 0x05, 0x43, 0x01, 0x34, 0x74, 0x45, 0xea, 0xd3, 0xe8, 0xb2, 0xf8, 0xbd, + 0xb0, 0xb5, 0x05, 0x46, 0x48, 0x1c, 0x14, 0x46, 0xc1, 0xb2, 0x00, 0x20, + 0xff, 0xf7, 0xf2, 0xfa, 0x40, 0x68, 0x01, 0x78, 0xa1, 0x42, 0x47, 0xd9, + 0x02, 0x2d, 0x16, 0xd0, 0x01, 0x2d, 0x27, 0xd0, 0x00, 0x2d, 0x41, 0xd1, + 0x01, 0x46, 0x11, 0xf8, 0x25, 0x2f, 0x4b, 0x78, 0x8d, 0x78, 0xc9, 0x78, + 0x42, 0xea, 0x03, 0x22, 0x45, 0xea, 0x01, 0x21, 0x42, 0xea, 0x01, 0x41, + 0xa1, 0x42, 0x33, 0xd9, 0x00, 0xeb, 0x84, 0x00, 0x10, 0xf8, 0x29, 0x1f, + 0x24, 0xe0, 0x01, 0x46, 0x11, 0xf8, 0x55, 0x2f, 0x4b, 0x78, 0x8d, 0x78, + 0xc9, 0x78, 0x42, 0xea, 0x03, 0x22, 0x45, 0xea, 0x01, 0x21, 0x42, 0xea, + 0x01, 0x41, 0xa1, 0x42, 0x20, 0xd9, 0x00, 0xeb, 0x84, 0x00, 0x10, 0xf8, + 0x59, 0x1f, 0x11, 0xe0, 0x01, 0x46, 0x11, 0xf8, 0x3d, 0x2f, 0x4b, 0x78, + 0x8d, 0x78, 0xc9, 0x78, 0x42, 0xea, 0x03, 0x22, 0x45, 0xea, 0x01, 0x21, + 0x42, 0xea, 0x01, 0x41, 0xa1, 0x42, 0x0d, 0xd9, 0x00, 0xeb, 0x84, 0x00, + 0x10, 0xf8, 0x41, 0x1f, 0x42, 0x78, 0x83, 0x78, 0xc0, 0x78, 0x41, 0xea, + 0x02, 0x21, 0x43, 0xea, 0x00, 0x20, 0x41, 0xea, 0x00, 0x40, 0xb0, 0xbd, + 0x4f, 0xf0, 0xff, 0x30, 0xb0, 0xbd, 0x10, 0xb5, 0x01, 0x30, 0x0c, 0x46, + 0xc1, 0xb2, 0x00, 0x20, 0xff, 0xf7, 0x9c, 0xfa, 0x40, 0x68, 0x01, 0x78, + 0xa1, 0x42, 0x11, 0xd9, 0x90, 0xf8, 0x6d, 0x10, 0xa1, 0x42, 0x0d, 0xd9, + 0x00, 0xeb, 0x84, 0x00, 0x10, 0xf8, 0x6e, 0x1f, 0x42, 0x78, 0x83, 0x78, + 0xc0, 0x78, 0x41, 0xea, 0x02, 0x21, 0x43, 0xea, 0x00, 0x20, 0x41, 0xea, + 0x00, 0x40, 0x10, 0xbd, 0x4f, 0xf0, 0xff, 0x30, 0x10, 0xbd, 0x2d, 0xe9, + 0xf8, 0x4f, 0x83, 0x46, 0x00, 0x20, 0x00, 0x21, 0xff, 0xf7, 0x7c, 0xfa, + 0x40, 0x68, 0x90, 0xf8, 0x13, 0xa0, 0xba, 0xf1, 0x00, 0x0f, 0x57, 0xd0, + 0x01, 0x20, 0x00, 0x24, 0xff, 0x26, 0x00, 0xfa, 0x0b, 0xf9, 0x04, 0xf1, + 0x01, 0x08, 0x00, 0x20, 0x5f, 0xfa, 0x88, 0xf5, 0x29, 0x46, 0xff, 0xf7, + 0x69, 0xfa, 0x40, 0x68, 0xf1, 0xb2, 0xff, 0x29, 0x00, 0xf1, 0x15, 0x00, + 0x20, 0xd1, 0x01, 0x46, 0x5f, 0x46, 0x11, 0xf8, 0x08, 0xcf, 0x11, 0xf8, + 0x04, 0xef, 0xce, 0x78, 0x8a, 0x78, 0x11, 0xf8, 0x02, 0x3c, 0x42, 0xea, + 0x06, 0x2b, 0x11, 0xf8, 0x03, 0x6c, 0x11, 0xf8, 0x01, 0x2c, 0x49, 0x78, + 0x4e, 0xea, 0x01, 0x21, 0x4c, 0xea, 0x06, 0x26, 0x43, 0xea, 0x02, 0x22, + 0x41, 0xea, 0x0b, 0x41, 0x46, 0xea, 0x02, 0x42, 0xbb, 0x46, 0x26, 0x46, + 0x11, 0x43, 0x08, 0xbf, 0x4f, 0xf0, 0xff, 0x36, 0xbb, 0xf1, 0x28, 0x0f, + 0x1b, 0xd8, 0x01, 0x78, 0x42, 0x78, 0x83, 0x78, 0xc7, 0x78, 0x41, 0xea, + 0x02, 0x21, 0x43, 0xea, 0x07, 0x23, 0x42, 0x79, 0x41, 0xea, 0x03, 0x41, + 0x10, 0xf8, 0x04, 0x3f, 0x01, 0xea, 0x09, 0x01, 0x43, 0xea, 0x02, 0x22, + 0x83, 0x78, 0xc0, 0x78, 0x43, 0xea, 0x00, 0x20, 0x42, 0xea, 0x00, 0x40, + 0x00, 0xea, 0xe9, 0x70, 0x08, 0x43, 0x20, 0x46, 0x05, 0xd1, 0x55, 0x45, + 0x44, 0x46, 0x30, 0x46, 0xad, 0xd3, 0x00, 0xe0, 0xff, 0x20, 0xc0, 0xb2, + 0xbd, 0xe8, 0xf8, 0x8f, 0x10, 0xb5, 0x0c, 0x46, 0x1e, 0x49, 0x91, 0xf8, + 0x78, 0x10, 0x0d, 0x39, 0x01, 0x29, 0x08, 0xd8, 0xff, 0xf7, 0x8d, 0xff, + 0xff, 0x28, 0x04, 0xd0, 0x21, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0xff, 0xf7, + 0xe3, 0xbe, 0xff, 0x20, 0x10, 0xbd, 0x00, 0xbf, 0xb0, 0xb5, 0x0c, 0x46, + 0x14, 0x49, 0x91, 0xf8, 0x78, 0x10, 0x0d, 0x39, 0x01, 0x29, 0x0b, 0xd8, + 0x15, 0x46, 0xff, 0xf7, 0x78, 0xff, 0xff, 0x28, 0x06, 0xd0, 0x01, 0x46, + 0x28, 0x46, 0x22, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0xff, 0xf7, 0xf8, 0xbe, + 0x4f, 0xf0, 0xff, 0x30, 0xb0, 0xbd, 0x00, 0xbf, 0x10, 0xb5, 0x0c, 0x46, + 0x08, 0x49, 0x91, 0xf8, 0x78, 0x10, 0x0d, 0x39, 0x01, 0x29, 0x08, 0xd8, + 0xff, 0xf7, 0x61, 0xff, 0xff, 0x28, 0x04, 0xd0, 0x21, 0x46, 0xbd, 0xe8, + 0x10, 0x40, 0xff, 0xf7, 0x3a, 0xbf, 0x4f, 0xf0, 0xff, 0x30, 0x10, 0xbd, + 0x50, 0xe2, 0x05, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x85, 0xb0, 0xcd, 0xe9, + 0x03, 0x01, 0x01, 0x20, 0x00, 0x21, 0x14, 0x46, 0xff, 0xf7, 0xce, 0xf9, + 0x45, 0x68, 0x20, 0x46, 0x05, 0x21, 0xfa, 0xf7, 0x15, 0xfa, 0xa8, 0x78, + 0xe9, 0x78, 0x40, 0xea, 0x01, 0x26, 0x00, 0x2e, 0x00, 0xf0, 0x89, 0x80, + 0xcd, 0xe9, 0x01, 0x54, 0x4f, 0xf0, 0x00, 0x08, 0x4f, 0xf0, 0xff, 0x0e, + 0x4f, 0xf0, 0x33, 0x0a, 0x4f, 0xf0, 0x00, 0x0b, 0x4f, 0xf0, 0x00, 0x09, + 0x00, 0x27, 0xdd, 0xf8, 0x0c, 0xc0, 0xb8, 0xb2, 0xb0, 0xfb, 0xfa, 0xf4, + 0x04, 0xfb, 0x1a, 0x70, 0x00, 0x04, 0x09, 0xd1, 0x60, 0x1c, 0x75, 0x46, + 0xc1, 0xb2, 0x01, 0x20, 0xff, 0xf7, 0xa6, 0xf9, 0xae, 0x46, 0xdd, 0xf8, + 0x0c, 0xc0, 0x45, 0x68, 0xbb, 0xfb, 0xfa, 0xf0, 0x5f, 0xfa, 0x8e, 0xf3, + 0xff, 0x2b, 0xa0, 0xeb, 0x00, 0x20, 0x48, 0x44, 0x05, 0xeb, 0x00, 0x01, + 0x2a, 0x5c, 0x88, 0x78, 0xc9, 0x78, 0x40, 0xea, 0x01, 0x21, 0x4f, 0xea, + 0x11, 0x20, 0x15, 0xd1, 0x7f, 0x2a, 0x0d, 0xd1, 0xca, 0xb2, 0xff, 0x2a, + 0x02, 0xd0, 0x04, 0x9b, 0x9a, 0x42, 0x04, 0xd0, 0xff, 0x28, 0x08, 0xd0, + 0x04, 0x9a, 0x90, 0x42, 0x05, 0xd1, 0x04, 0xfb, 0x1a, 0x8e, 0x04, 0xe0, + 0x4f, 0xf0, 0xff, 0x0e, 0x02, 0xe0, 0x4f, 0xf0, 0xff, 0x0e, 0x7f, 0x22, + 0x62, 0x45, 0x0a, 0xd1, 0xc9, 0xb2, 0xff, 0x29, 0x02, 0xd0, 0x04, 0x9a, + 0x91, 0x42, 0x10, 0xd0, 0xff, 0x28, 0x02, 0xd0, 0x04, 0x99, 0x88, 0x42, + 0x0b, 0xd0, 0x01, 0x37, 0x08, 0xf1, 0x01, 0x08, 0x0b, 0xf1, 0x01, 0x0b, + 0x09, 0xf1, 0x05, 0x09, 0xb8, 0xb2, 0xb0, 0x42, 0xaf, 0xd3, 0x02, 0x9c, + 0x14, 0xe0, 0x33, 0x20, 0x02, 0x9c, 0x05, 0x21, 0x05, 0x23, 0x76, 0x46, + 0xbb, 0xfb, 0xf0, 0xf0, 0xc0, 0xeb, 0x00, 0x20, 0xa9, 0xeb, 0x00, 0x00, + 0x2a, 0x18, 0x20, 0x46, 0xf7, 0xf7, 0x56, 0xfb, 0x01, 0x99, 0xb6, 0x46, + 0x88, 0x78, 0xc9, 0x78, 0x40, 0xea, 0x01, 0x26, 0x5f, 0xfa, 0x8e, 0xf0, + 0xff, 0x28, 0x0e, 0xd0, 0xb9, 0xb2, 0xb1, 0x42, 0x0b, 0xd1, 0x80, 0x00, + 0x05, 0x21, 0x05, 0x23, 0x50, 0xfa, 0x8e, 0xf0, 0x2a, 0x18, 0x20, 0x46, + 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0xf7, 0xf7, 0x3d, 0xbb, 0x05, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0x80, 0xb5, 0x03, 0x46, 0x00, 0x7b, 0x12, 0x21, + 0x1b, 0x22, 0x01, 0xeb, 0x80, 0x00, 0xb4, 0x21, 0xc0, 0xb2, 0x24, 0xf0, + 0xe9, 0xfa, 0x18, 0xb1, 0xbd, 0xe8, 0x80, 0x40, 0xfd, 0xf7, 0x5c, 0xb9, + 0x80, 0xbd, 0xe0, 0xb5, 0x03, 0x46, 0x08, 0x78, 0x00, 0x91, 0x07, 0x21, + 0x1c, 0x22, 0x01, 0xeb, 0x80, 0x00, 0xb4, 0x21, 0xc0, 0xb2, 0x24, 0xf0, + 0x2b, 0xfb, 0x18, 0xb1, 0xbd, 0xe8, 0x8c, 0x40, 0xfd, 0xf7, 0x4a, 0xb9, + 0x8c, 0xbd, 0x00, 0x00, 0x80, 0xb5, 0xf9, 0xf7, 0xd7, 0xfc, 0x4f, 0xf0, + 0x5e, 0x51, 0xf9, 0xf7, 0xc7, 0xfc, 0x80, 0xbd, 0xb0, 0xb5, 0xef, 0x48, + 0x00, 0xf1, 0x11, 0x05, 0x15, 0xf8, 0x06, 0x4f, 0x95, 0xf8, 0x3d, 0x10, + 0x20, 0x46, 0xff, 0xf7, 0xe5, 0xfe, 0x85, 0xf8, 0x3f, 0x00, 0x06, 0x48, + 0x00, 0x78, 0x00, 0xb1, 0xb0, 0xbd, 0x95, 0xf8, 0x3e, 0x10, 0x20, 0x46, + 0xff, 0xf7, 0xda, 0xfe, 0x85, 0xf8, 0x40, 0x00, 0xb0, 0xbd, 0x00, 0xbf, + 0x34, 0xe4, 0x05, 0x00, 0x02, 0x49, 0x01, 0xeb, 0x80, 0x00, 0x80, 0x6f, + 0x70, 0x47, 0x00, 0xbf, 0x04, 0xa9, 0x02, 0x00, 0x04, 0x48, 0x05, 0x49, + 0x00, 0x68, 0x09, 0x68, 0x88, 0x42, 0x8e, 0xbf, 0x40, 0x1a, 0xc9, 0x43, + 0x08, 0x44, 0x70, 0x47, 0x18, 0x12, 0x21, 0x40, 0x00, 0x12, 0x21, 0x40, + 0x40, 0x08, 0xb0, 0xfa, 0x80, 0xf0, 0xc0, 0xf1, 0x20, 0x00, 0xc0, 0xb2, + 0x70, 0x47, 0x00, 0xbf, 0xf0, 0xb5, 0xd2, 0x4b, 0x93, 0xf8, 0x5f, 0x30, + 0x01, 0x2b, 0x40, 0xf0, 0xb5, 0x80, 0x60, 0x4d, 0xdf, 0xf8, 0x80, 0xc1, + 0x12, 0x29, 0xd5, 0xe9, 0x05, 0x34, 0x03, 0xeb, 0x00, 0x06, 0xdc, 0xe9, + 0x05, 0x73, 0x04, 0xf1, 0x01, 0x04, 0xc5, 0xe9, 0x05, 0x64, 0x05, 0xf1, + 0x02, 0x04, 0x38, 0x44, 0x03, 0xf1, 0x01, 0x03, 0xcc, 0xe9, 0x05, 0x03, + 0x0c, 0xf1, 0x02, 0x00, 0x08, 0xdb, 0x14, 0x29, 0x45, 0xdc, 0x21, 0x88, + 0x01, 0x31, 0x21, 0x80, 0x01, 0x88, 0x01, 0x31, 0x01, 0x80, 0x3e, 0xe0, + 0x0f, 0x29, 0x06, 0xdb, 0x61, 0x88, 0x01, 0x31, 0x61, 0x80, 0x41, 0x88, + 0x01, 0x31, 0x41, 0x80, 0x35, 0xe0, 0x0c, 0x29, 0x06, 0xdb, 0xa1, 0x88, + 0x01, 0x31, 0xa1, 0x80, 0x81, 0x88, 0x01, 0x31, 0x81, 0x80, 0x2c, 0xe0, + 0x09, 0x29, 0x06, 0xdb, 0xe1, 0x88, 0x01, 0x31, 0xe1, 0x80, 0xc1, 0x88, + 0x01, 0x31, 0xc1, 0x80, 0x23, 0xe0, 0x06, 0x29, 0x06, 0xdb, 0x21, 0x89, + 0x01, 0x31, 0x21, 0x81, 0x01, 0x89, 0x01, 0x31, 0x01, 0x81, 0x1a, 0xe0, + 0x03, 0x29, 0x06, 0xdb, 0x61, 0x89, 0x01, 0x31, 0x61, 0x81, 0x41, 0x89, + 0x01, 0x31, 0x41, 0x81, 0x11, 0xe0, 0x00, 0x29, 0x06, 0xd4, 0xa1, 0x89, + 0x01, 0x31, 0xa1, 0x81, 0x81, 0x89, 0x01, 0x31, 0x81, 0x81, 0x08, 0xe0, + 0x11, 0xf1, 0x1e, 0x0f, 0x05, 0xdb, 0xe1, 0x89, 0x01, 0x31, 0xe1, 0x81, + 0xc1, 0x89, 0x01, 0x31, 0xc1, 0x81, 0x32, 0x49, 0x09, 0x78, 0x9a, 0xb1, + 0x31, 0x4a, 0x01, 0xeb, 0x01, 0x10, 0x02, 0xeb, 0xc0, 0x00, 0x90, 0xf8, + 0x49, 0x00, 0x00, 0xf0, 0xe0, 0x00, 0x20, 0x28, 0x2c, 0xd1, 0x01, 0xeb, + 0x81, 0x00, 0x2d, 0x49, 0x01, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0x24, 0x00, + 0x03, 0x30, 0x28, 0xe0, 0x29, 0x4a, 0x01, 0xeb, 0x81, 0x01, 0x05, 0x23, + 0x02, 0xeb, 0xc1, 0x01, 0x0a, 0x7a, 0x89, 0x7b, 0xb2, 0xfb, 0xf3, 0xf3, + 0x03, 0xeb, 0x83, 0x03, 0xd2, 0x1a, 0x24, 0x4b, 0x03, 0xeb, 0xc2, 0x12, + 0x02, 0xeb, 0xc1, 0x01, 0x09, 0x79, 0x01, 0x29, 0x1e, 0xd0, 0x03, 0x29, + 0x27, 0xd0, 0x05, 0x29, 0x24, 0xd1, 0xd4, 0xf8, 0x22, 0x10, 0x01, 0x31, + 0xc4, 0xf8, 0x22, 0x10, 0xd0, 0xf8, 0x22, 0x10, 0x01, 0x31, 0xc0, 0xf8, + 0x22, 0x10, 0xf0, 0xbd, 0x5c, 0x20, 0x11, 0xfb, 0x00, 0xf0, 0x15, 0x49, + 0x08, 0x5c, 0x05, 0xeb, 0x40, 0x01, 0x0c, 0xeb, 0x40, 0x00, 0x0a, 0x8d, + 0x01, 0x32, 0x0a, 0x85, 0x01, 0x8d, 0x01, 0x31, 0x01, 0x85, 0xf0, 0xbd, + 0xd4, 0xf8, 0x1a, 0x10, 0x01, 0x31, 0xc4, 0xf8, 0x1a, 0x10, 0xd0, 0xf8, + 0x1a, 0x10, 0x01, 0x31, 0xc0, 0xf8, 0x1a, 0x10, 0xf0, 0xbd, 0xd4, 0xf8, + 0x1e, 0x10, 0x01, 0x31, 0xc4, 0xf8, 0x1e, 0x10, 0xd0, 0xf8, 0x1e, 0x10, + 0x01, 0x31, 0xc0, 0xf8, 0x1e, 0x10, 0xf0, 0xbd, 0xbc, 0xe3, 0x05, 0x00, + 0xf8, 0xe3, 0x05, 0x00, 0x74, 0x87, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, + 0x44, 0x4f, 0x01, 0x00, 0x84, 0x71, 0x01, 0x00, 0x86, 0x71, 0x0d, 0x10, + 0x67, 0x49, 0x81, 0xf8, 0x53, 0x00, 0x91, 0xf8, 0x5f, 0x00, 0x01, 0x28, + 0x18, 0xbf, 0x70, 0x47, 0xc8, 0x7d, 0x00, 0xf0, 0x01, 0xb8, 0x00, 0xbf, + 0x2d, 0xe9, 0xf0, 0x4f, 0x89, 0xb0, 0x02, 0x90, 0x03, 0xa8, 0x18, 0x21, + 0xf9, 0xf7, 0x7e, 0xfb, 0xdf, 0xf8, 0x74, 0xa1, 0x0a, 0xf1, 0x0b, 0x05, + 0xff, 0xf7, 0xd6, 0xfe, 0x00, 0x24, 0xd7, 0x48, 0x00, 0x78, 0x01, 0x28, + 0x08, 0xbf, 0x01, 0x2c, 0x00, 0xf0, 0x8d, 0x80, 0x0a, 0xeb, 0x04, 0x06, + 0x04, 0xeb, 0x84, 0x00, 0x0a, 0xeb, 0x00, 0x0b, 0x96, 0xf8, 0x54, 0x10, + 0x02, 0x98, 0x0b, 0xf1, 0x48, 0x02, 0xff, 0xf7, 0xf3, 0xfd, 0x9b, 0xf8, + 0x4c, 0x00, 0x01, 0x28, 0x02, 0xd1, 0x4f, 0xf0, 0x7e, 0x56, 0x25, 0xe0, + 0x06, 0xf1, 0x56, 0x08, 0x4f, 0xf0, 0x9f, 0x46, 0x4f, 0xf0, 0x00, 0x09, + 0x98, 0xf8, 0x00, 0x00, 0x37, 0x46, 0x20, 0xfa, 0x09, 0xf0, 0xc0, 0x07, + 0x12, 0xd0, 0x95, 0xf8, 0x53, 0x00, 0x5f, 0xfa, 0x89, 0xf2, 0x00, 0x21, + 0x00, 0xf0, 0x8c, 0xf8, 0x06, 0x46, 0x38, 0x46, 0x4f, 0xf0, 0x9f, 0x41, + 0x00, 0xf0, 0x08, 0xfe, 0x28, 0xb9, 0x30, 0x46, 0x39, 0x46, 0x00, 0xf0, + 0x09, 0xfe, 0x00, 0xb9, 0x3e, 0x46, 0x09, 0xf1, 0x01, 0x09, 0xb9, 0xf1, + 0x05, 0x0f, 0xdf, 0xd1, 0x28, 0x78, 0x01, 0x28, 0x09, 0xd1, 0x30, 0x46, + 0x4f, 0xf0, 0x7e, 0x51, 0x00, 0xf0, 0xfa, 0xfd, 0x00, 0x28, 0x4f, 0xf0, + 0x7e, 0x50, 0x08, 0xbf, 0x06, 0x46, 0x88, 0x49, 0x30, 0x46, 0xf9, 0xf7, + 0x49, 0xfb, 0x00, 0xf0, 0xf5, 0xfd, 0xc8, 0x28, 0x5a, 0xd8, 0x0d, 0xf1, + 0x0c, 0x09, 0x07, 0x46, 0x30, 0x46, 0x00, 0x21, 0x09, 0xeb, 0x84, 0x08, + 0xc8, 0xf8, 0x08, 0x60, 0x00, 0xf0, 0xdc, 0xfd, 0x00, 0x28, 0x18, 0xbf, + 0x01, 0x20, 0x85, 0xf8, 0x55, 0x00, 0x04, 0x22, 0x09, 0xeb, 0x44, 0x01, + 0x9b, 0xf9, 0x49, 0x00, 0x90, 0xfb, 0xf2, 0xf0, 0x40, 0xb2, 0x88, 0x80, + 0x00, 0xf0, 0xde, 0xfd, 0x06, 0x46, 0x22, 0x48, 0x22, 0x49, 0x50, 0xf8, + 0x27, 0x00, 0xf9, 0xf7, 0x23, 0xfb, 0x31, 0x46, 0xf9, 0xf7, 0x26, 0xfb, + 0x4f, 0xf0, 0x81, 0x41, 0xf9, 0xf7, 0x1c, 0xfb, 0xf9, 0xf7, 0x32, 0xfb, + 0x0a, 0xeb, 0x44, 0x01, 0x50, 0x28, 0xa8, 0xbf, 0x50, 0x20, 0xa1, 0xf8, + 0x58, 0x00, 0x00, 0xf0, 0xc5, 0xfd, 0x4f, 0xf0, 0x7a, 0x51, 0xf9, 0xf7, + 0x0d, 0xfb, 0x01, 0x34, 0xc8, 0xf8, 0x10, 0x00, 0x02, 0x2c, 0x7f, 0xf4, + 0x6c, 0xaf, 0x28, 0x7b, 0x95, 0xf8, 0x4b, 0x20, 0x95, 0xf8, 0x4c, 0x30, + 0x95, 0xf8, 0x48, 0x10, 0x8d, 0xf8, 0x0c, 0x00, 0x95, 0xf8, 0x53, 0x00, + 0x8d, 0xf8, 0x0e, 0x10, 0x01, 0x21, 0x8d, 0xf8, 0x0d, 0x00, 0x43, 0xea, + 0x02, 0x00, 0x03, 0xab, 0x00, 0x22, 0x8d, 0xf8, 0x0f, 0x00, 0xf2, 0x48, + 0x04, 0x68, 0x18, 0x20, 0x00, 0x90, 0x40, 0xf2, 0x37, 0x70, 0xa0, 0x47, + 0x09, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0xbf, 0xd0, 0xe2, 0x05, 0x00, + 0xd0, 0xa9, 0x02, 0x00, 0x00, 0x00, 0x20, 0x41, 0x2d, 0xe9, 0xf0, 0x47, + 0xdf, 0xf8, 0x3c, 0x91, 0x90, 0x46, 0x07, 0x46, 0xd9, 0xf8, 0x18, 0x50, + 0x99, 0xf8, 0x17, 0x60, 0x09, 0xf1, 0x0d, 0x04, 0x15, 0xb1, 0x4f, 0xf0, + 0x00, 0x0a, 0x05, 0xe0, 0x30, 0x46, 0x41, 0x46, 0x02, 0x22, 0xff, 0xf7, + 0x09, 0xfd, 0x82, 0x46, 0x03, 0x2f, 0x22, 0xd0, 0x02, 0x2f, 0x2c, 0xd0, + 0x01, 0x2f, 0x50, 0xd1, 0x6b, 0x48, 0x00, 0x21, 0x41, 0x70, 0x00, 0x2d, + 0x6d, 0xd0, 0x20, 0x46, 0x10, 0xf8, 0x06, 0x1f, 0x42, 0x78, 0x83, 0x78, + 0xc0, 0x78, 0x41, 0xea, 0x02, 0x21, 0x43, 0xea, 0x00, 0x20, 0x41, 0xea, + 0x00, 0x40, 0x01, 0x28, 0x52, 0xd8, 0x14, 0xf8, 0x0f, 0x0f, 0x61, 0x78, + 0xa2, 0x78, 0xe3, 0x78, 0x40, 0xea, 0x01, 0x20, 0x42, 0xea, 0x03, 0x21, + 0x40, 0xea, 0x01, 0x4a, 0x53, 0xe0, 0x5c, 0x48, 0x00, 0x21, 0x41, 0x70, + 0x94, 0xf8, 0x46, 0x00, 0x01, 0x28, 0x30, 0xd1, 0x30, 0x46, 0x41, 0x46, + 0xff, 0xf7, 0xf0, 0xfc, 0x0b, 0xe0, 0x94, 0xf8, 0x46, 0x00, 0x01, 0x28, + 0x2b, 0xd1, 0x30, 0x46, 0x41, 0x46, 0x02, 0x22, 0xff, 0xf7, 0xce, 0xfc, + 0x51, 0x49, 0x01, 0x22, 0x4a, 0x70, 0x21, 0x78, 0x62, 0x78, 0xa3, 0x78, + 0xe4, 0x78, 0x43, 0xea, 0x04, 0x23, 0x41, 0xea, 0x02, 0x21, 0x41, 0xea, + 0x03, 0x45, 0xff, 0xf7, 0xb3, 0xfd, 0x04, 0x46, 0x8d, 0xb3, 0x28, 0x46, + 0xf9, 0xf7, 0x88, 0xfa, 0x00, 0xf0, 0x28, 0xfd, 0xff, 0xf7, 0xaa, 0xfd, + 0x01, 0x46, 0x20, 0x46, 0xf9, 0xf7, 0x74, 0xfa, 0x24, 0xe0, 0x00, 0x20, + 0x40, 0xf2, 0xaf, 0x11, 0xfc, 0xf7, 0x06, 0xff, 0x1b, 0xe0, 0x30, 0x46, + 0x41, 0x46, 0x00, 0x22, 0x06, 0xe0, 0x3e, 0x48, 0x40, 0x78, 0x01, 0x28, + 0xa3, 0xd1, 0x30, 0x46, 0x41, 0x46, 0x02, 0x22, 0xff, 0xf7, 0x9e, 0xfc, + 0x82, 0x46, 0x0c, 0xe0, 0x09, 0xeb, 0x88, 0x00, 0x10, 0xf8, 0x1c, 0x1f, + 0x42, 0x78, 0x83, 0x78, 0xc0, 0x78, 0x41, 0xea, 0x02, 0x21, 0x43, 0xea, + 0x00, 0x20, 0x41, 0xea, 0x00, 0x4a, 0x50, 0x46, 0xff, 0xf7, 0x80, 0xfd, + 0x04, 0x46, 0x08, 0x4d, 0x20, 0x46, 0x29, 0x46, 0xf9, 0xf7, 0x48, 0xfa, + 0x00, 0xf0, 0xf4, 0xfc, 0xf9, 0xf7, 0x50, 0xfa, 0x29, 0x46, 0xf9, 0xf7, + 0x53, 0xfa, 0xbd, 0xe8, 0xf0, 0x87, 0x00, 0xbf, 0xd0, 0xe2, 0x05, 0x00, + 0x00, 0x00, 0xc8, 0x42, 0xf8, 0xb5, 0x42, 0x4c, 0x42, 0x4d, 0x2c, 0x21, + 0xb4, 0xf8, 0x5c, 0x00, 0x01, 0x30, 0xa4, 0xf8, 0x5c, 0x00, 0x72, 0xb6, + 0x28, 0x68, 0x40, 0x00, 0x01, 0x30, 0x28, 0x60, 0x04, 0xf1, 0x90, 0x00, + 0xf9, 0xf7, 0x04, 0xfa, 0x1d, 0x4e, 0x00, 0x27, 0x04, 0xf1, 0xbc, 0x00, + 0x2c, 0x21, 0xb7, 0x70, 0xf9, 0xf7, 0xfc, 0xf9, 0x05, 0x48, 0xf7, 0x70, + 0x00, 0x68, 0xc4, 0xf8, 0xbc, 0x00, 0x28, 0x68, 0x40, 0x08, 0x28, 0x60, + 0x28, 0x68, 0x80, 0xf3, 0x10, 0x88, 0xf8, 0xbd, 0x24, 0x20, 0x00, 0x40, + 0x2e, 0x49, 0x81, 0xf8, 0x5e, 0x00, 0x70, 0x47, 0x0f, 0x48, 0x10, 0x49, + 0x00, 0x68, 0x09, 0x78, 0x01, 0x29, 0x0a, 0xd0, 0x69, 0xb9, 0x50, 0x28, + 0x03, 0xd0, 0x14, 0x28, 0x0a, 0xd0, 0x10, 0x28, 0x0d, 0xd1, 0x26, 0x48, + 0x4f, 0xf4, 0x80, 0x71, 0x06, 0xe0, 0x24, 0x48, 0x02, 0x21, 0x80, 0xf8, + 0x54, 0x10, 0x70, 0x47, 0x21, 0x48, 0x01, 0x21, 0xa0, 0xf8, 0x54, 0x10, + 0x70, 0x47, 0x00, 0x20, 0x40, 0xf2, 0x31, 0x21, 0xfc, 0xf7, 0x86, 0xbe, + 0x00, 0xc0, 0x00, 0x40, 0x34, 0xe4, 0x05, 0x00, 0xb0, 0xb5, 0x1a, 0x4a, + 0x92, 0xf8, 0x5f, 0x10, 0x01, 0x29, 0x18, 0xbf, 0xb0, 0xbd, 0x18, 0x4c, + 0x72, 0xb6, 0x21, 0x68, 0x49, 0x00, 0x01, 0x31, 0x21, 0x60, 0xf8, 0x49, + 0x0b, 0x78, 0x83, 0x42, 0x06, 0xd1, 0x20, 0x68, 0x40, 0x08, 0x20, 0x60, + 0x20, 0x68, 0x80, 0xf3, 0x10, 0x88, 0xb0, 0xbd, 0x02, 0xf1, 0x17, 0x05, + 0x95, 0xf8, 0x3f, 0x20, 0xca, 0x70, 0x8a, 0x70, 0x23, 0xb9, 0x95, 0xf8, + 0x40, 0x30, 0x1a, 0x43, 0xca, 0x70, 0x8a, 0x70, 0x00, 0x22, 0x08, 0x70, + 0xc5, 0xf8, 0x3d, 0x20, 0xff, 0xf7, 0xb2, 0xff, 0x20, 0x68, 0x40, 0x08, + 0x20, 0x60, 0x20, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x28, 0x78, 0xbd, 0xe8, + 0xb0, 0x40, 0xff, 0xf7, 0x0b, 0xbe, 0x00, 0xbf, 0xd0, 0xe2, 0x05, 0x00, + 0x24, 0x36, 0x01, 0x00, 0x10, 0xb5, 0x2d, 0x20, 0x00, 0x21, 0x00, 0x24, + 0xfc, 0xf7, 0x48, 0xfe, 0x2e, 0x20, 0x00, 0x21, 0xfc, 0xf7, 0x44, 0xfe, + 0xd9, 0x48, 0xec, 0x21, 0xf9, 0xf7, 0x7e, 0xf9, 0xff, 0xf7, 0x92, 0xff, + 0xd9, 0x48, 0xc4, 0x70, 0x44, 0x70, 0x84, 0x70, 0x10, 0xbd, 0x00, 0xbf, + 0x2d, 0xe9, 0xf0, 0x41, 0x8c, 0xb0, 0x02, 0xac, 0x05, 0x46, 0x28, 0x21, + 0x20, 0x46, 0xf9, 0xf7, 0x6d, 0xf9, 0x68, 0x1e, 0x02, 0x28, 0x79, 0xd2, + 0xcd, 0x4e, 0x30, 0x88, 0x20, 0xb9, 0x00, 0x20, 0x4f, 0xf4, 0x1c, 0x71, + 0xfc, 0xf7, 0x1e, 0xfe, 0x96, 0xf8, 0x5e, 0x00, 0xd8, 0xb9, 0xdf, 0xf8, + 0xe8, 0x80, 0xb2, 0x88, 0x01, 0x20, 0x00, 0x27, 0x00, 0x21, 0x86, 0xf8, + 0x5e, 0x00, 0x2d, 0x20, 0xcd, 0xe9, 0x00, 0x77, 0xd8, 0xf8, 0x00, 0xc0, + 0x13, 0x46, 0xe0, 0x47, 0x70, 0x88, 0x4f, 0xf4, 0x7a, 0x71, 0xd8, 0xf8, + 0x00, 0xc0, 0xcd, 0xe9, 0x00, 0x77, 0x00, 0xfb, 0x01, 0xf2, 0x2e, 0x20, + 0x00, 0x21, 0x13, 0x46, 0xe0, 0x47, 0xa8, 0x1e, 0xb0, 0xfa, 0x80, 0xf0, + 0x40, 0x09, 0xf0, 0x72, 0xf0, 0x7d, 0xff, 0xf7, 0xb5, 0xfd, 0x04, 0xf1, + 0x08, 0x00, 0x00, 0x21, 0x4f, 0xf4, 0x00, 0x42, 0x01, 0x31, 0x04, 0xc0, + 0x08, 0x29, 0xfb, 0xd1, 0x08, 0x20, 0x21, 0x1d, 0xb3, 0x4c, 0x01, 0x22, + 0x03, 0x90, 0xb6, 0xf9, 0x58, 0x00, 0x23, 0x78, 0x04, 0x90, 0x96, 0xf8, + 0x54, 0x00, 0x02, 0xfa, 0x00, 0xf0, 0x8d, 0xf8, 0x08, 0x00, 0x43, 0xb9, + 0xb6, 0xf9, 0x5a, 0x30, 0x05, 0x93, 0x96, 0xf8, 0x55, 0x30, 0x9a, 0x40, + 0x10, 0x43, 0x8d, 0xf8, 0x08, 0x00, 0xc0, 0xb2, 0xff, 0xf7, 0x59, 0xfc, + 0xb6, 0xf9, 0x58, 0x10, 0x04, 0x20, 0x91, 0xfb, 0xf0, 0xf1, 0x09, 0xb2, + 0x04, 0x91, 0x21, 0x78, 0x29, 0xb9, 0xb6, 0xf9, 0x5a, 0x10, 0x91, 0xfb, + 0xf0, 0xf0, 0x00, 0xb2, 0x05, 0x90, 0x0f, 0x48, 0x02, 0xab, 0x01, 0x21, + 0x01, 0x22, 0x01, 0x24, 0x05, 0x68, 0x28, 0x20, 0x00, 0x90, 0x40, 0xf2, + 0x36, 0x70, 0xa8, 0x47, 0x96, 0xf8, 0x5f, 0x00, 0x01, 0x28, 0x04, 0xd0, + 0x96, 0x48, 0x00, 0x68, 0x70, 0x66, 0xc6, 0xf8, 0xbc, 0x00, 0x86, 0xf8, + 0x5f, 0x40, 0x02, 0xe0, 0x0d, 0xb9, 0xff, 0xf7, 0x61, 0xff, 0x0c, 0xb0, + 0xbd, 0xe8, 0xf0, 0x81, 0xcc, 0x9b, 0x08, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0x70, 0x47, 0x00, 0xbf, 0x2d, 0xe9, 0xfc, 0x41, 0x04, 0x46, 0x89, 0x48, + 0x90, 0xf8, 0x5f, 0x10, 0x01, 0x29, 0x18, 0xbf, 0xbd, 0xe8, 0xfc, 0x81, + 0x85, 0x1c, 0x37, 0x21, 0x22, 0x46, 0x37, 0x23, 0x05, 0xf1, 0x0f, 0x00, + 0xf6, 0xf7, 0x3e, 0xff, 0x95, 0xf8, 0x5c, 0x00, 0x01, 0x28, 0x23, 0xd0, + 0x03, 0x28, 0x05, 0xd0, 0x02, 0x28, 0x40, 0xd1, 0x2e, 0x20, 0x00, 0x21, + 0xfc, 0xf7, 0x88, 0xfd, 0xdf, 0xf8, 0x80, 0x80, 0x6a, 0x88, 0x01, 0x20, + 0x00, 0x26, 0x00, 0x21, 0x85, 0xf8, 0x5c, 0x00, 0x2d, 0x20, 0xd8, 0xf8, + 0x00, 0x70, 0x13, 0x46, 0xcd, 0xe9, 0x00, 0x66, 0xb8, 0x47, 0x28, 0x88, + 0x4f, 0xf4, 0x7a, 0x71, 0xd8, 0xf8, 0x00, 0x70, 0xcd, 0xe9, 0x00, 0x66, + 0x00, 0xfb, 0x01, 0xf2, 0x2e, 0x20, 0x00, 0x21, 0x13, 0x46, 0xb8, 0x47, + 0x2d, 0x20, 0x00, 0x21, 0x00, 0x26, 0xfc, 0xf7, 0x67, 0xfd, 0xdf, 0xf8, + 0x40, 0x80, 0x6a, 0x88, 0x2d, 0x20, 0x00, 0x21, 0xd8, 0xf8, 0x00, 0x70, + 0x13, 0x46, 0xcd, 0xe9, 0x00, 0x66, 0xb8, 0x47, 0x2e, 0x20, 0x00, 0x21, + 0xfc, 0xf7, 0x58, 0xfd, 0x28, 0x88, 0x4f, 0xf4, 0x7a, 0x71, 0xd8, 0xf8, + 0x00, 0x70, 0xcd, 0xe9, 0x00, 0x66, 0x00, 0xfb, 0x01, 0xf2, 0x2e, 0x20, + 0x00, 0x21, 0x13, 0x46, 0xb8, 0x47, 0xa0, 0x79, 0xbd, 0xe8, 0xfc, 0x41, + 0xff, 0xf7, 0xfe, 0xbc, 0xcc, 0x9b, 0x08, 0x00, 0x59, 0x49, 0xca, 0x7d, + 0x82, 0x42, 0x06, 0xd0, 0xc8, 0x75, 0x91, 0xf8, 0x5f, 0x10, 0x01, 0x29, + 0x08, 0xbf, 0xff, 0xf7, 0xf1, 0xbc, 0x70, 0x47, 0x10, 0xb5, 0x53, 0x4c, + 0x02, 0x46, 0x11, 0x21, 0x11, 0x23, 0x20, 0x46, 0xf6, 0xf7, 0xda, 0xfe, + 0x94, 0xf8, 0x5f, 0x00, 0x01, 0x28, 0x18, 0xbf, 0x10, 0xbd, 0xe0, 0x7d, + 0xbd, 0xe8, 0x10, 0x40, 0xff, 0xf7, 0xde, 0xbc, 0x04, 0x48, 0x05, 0x49, + 0x00, 0x68, 0x09, 0x68, 0x88, 0x42, 0x8e, 0xbf, 0x40, 0x1a, 0xc9, 0x43, + 0x08, 0x44, 0x70, 0x47, 0x2c, 0x23, 0x21, 0x40, 0x1c, 0x23, 0x21, 0x40, + 0x2d, 0xe9, 0xf0, 0x41, 0x42, 0x4f, 0x0c, 0x46, 0x97, 0xf8, 0x5f, 0x10, + 0x01, 0x29, 0x7d, 0xd1, 0x15, 0x46, 0xf9, 0xf7, 0x7b, 0xf8, 0x3f, 0x49, + 0xf9, 0xf7, 0x7e, 0xf8, 0x06, 0x46, 0x3e, 0x48, 0xd0, 0xf8, 0x00, 0x80, + 0x28, 0x46, 0xff, 0xf7, 0xbb, 0xfb, 0x01, 0x46, 0x30, 0x46, 0xf9, 0xf7, + 0x61, 0xf8, 0x07, 0xeb, 0x84, 0x06, 0x05, 0x46, 0x30, 0x6f, 0xd6, 0xf8, + 0xc8, 0x40, 0x29, 0x46, 0xf9, 0xf7, 0x5e, 0xf8, 0x30, 0x67, 0x28, 0x46, + 0x21, 0x46, 0xf9, 0xf7, 0x59, 0xf8, 0xc6, 0xf8, 0xc8, 0x00, 0xb8, 0x79, + 0x43, 0xf6, 0x09, 0x51, 0x10, 0xfb, 0x01, 0xf0, 0xd7, 0xf8, 0xbc, 0x10, + 0xa8, 0xeb, 0x01, 0x01, 0xb1, 0xeb, 0x80, 0x1f, 0x1b, 0xd9, 0x97, 0xf8, + 0xe8, 0x10, 0xc8, 0x07, 0x4f, 0xf0, 0x00, 0x00, 0x16, 0xd1, 0x41, 0xf0, + 0x01, 0x01, 0x87, 0xf8, 0xe8, 0x10, 0xd7, 0xf8, 0xc8, 0x10, 0xc7, 0xf8, + 0xc8, 0x00, 0x25, 0x48, 0x00, 0x78, 0xc7, 0xf8, 0xc0, 0x10, 0x30, 0xb9, + 0xd7, 0xf8, 0xcc, 0x00, 0x00, 0x21, 0xc7, 0xf8, 0xcc, 0x10, 0xc7, 0xf8, + 0xc4, 0x00, 0x01, 0x20, 0x00, 0xe0, 0x00, 0x20, 0x39, 0x88, 0x4f, 0xf4, + 0x7a, 0x72, 0x51, 0x43, 0x7a, 0x6e, 0xa8, 0xeb, 0x02, 0x02, 0x8a, 0x42, + 0x13, 0xd9, 0x97, 0xf8, 0xe8, 0x10, 0x8a, 0x07, 0x0f, 0xd4, 0x3a, 0x6f, + 0x41, 0xf0, 0x02, 0x01, 0x87, 0xf8, 0xe8, 0x10, 0x00, 0x21, 0xba, 0x66, + 0x13, 0x4a, 0x39, 0x67, 0x12, 0x78, 0x12, 0xb9, 0x7a, 0x6f, 0x79, 0x67, + 0xfa, 0x66, 0x84, 0x1c, 0x01, 0xe0, 0xa8, 0xb1, 0x01, 0x24, 0x0f, 0x48, + 0x01, 0x68, 0x14, 0x20, 0x88, 0x47, 0x78, 0xb1, 0xca, 0x21, 0x04, 0x72, + 0xc0, 0xf8, 0x04, 0x80, 0x01, 0x70, 0x0b, 0x49, 0x60, 0x31, 0xf9, 0xf7, + 0x19, 0xf8, 0x0a, 0x48, 0x05, 0x21, 0x00, 0x78, 0xbd, 0xe8, 0xf0, 0x41, + 0xf6, 0xf7, 0x42, 0xbe, 0xbd, 0xe8, 0xf0, 0x81, 0xd0, 0xe2, 0x05, 0x00, + 0x00, 0x00, 0x7a, 0x44, 0x24, 0x20, 0x00, 0x40, 0x34, 0xe4, 0x05, 0x00, + 0xd4, 0x9b, 0x08, 0x00, 0x2c, 0xba, 0x01, 0x00, 0x67, 0x34, 0x01, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x97, 0xb0, 0x0d, 0xf1, 0x38, 0x09, 0x8a, 0x46, + 0x06, 0x46, 0x24, 0x21, 0x48, 0x46, 0xf8, 0xf7, 0xb5, 0xff, 0x0d, 0xf1, + 0x10, 0x08, 0x28, 0x21, 0x40, 0x46, 0xf8, 0xf7, 0xaf, 0xff, 0xe8, 0x49, + 0x91, 0xf8, 0x5f, 0x00, 0x01, 0x28, 0x40, 0xf0, 0xc8, 0x81, 0x01, 0xf1, + 0x06, 0x0b, 0x5f, 0xea, 0xca, 0x70, 0x9b, 0xf8, 0x06, 0x70, 0xcd, 0xe9, + 0x02, 0x76, 0x00, 0xf0, 0xd8, 0x80, 0xdb, 0xf8, 0xb6, 0x00, 0x4f, 0xf4, + 0x7a, 0x71, 0xdb, 0xf8, 0xba, 0x50, 0x30, 0x1a, 0xb0, 0xfb, 0xf1, 0xf0, + 0xf8, 0xf7, 0xc4, 0xff, 0x04, 0x46, 0x28, 0x46, 0x21, 0x46, 0xf8, 0xf7, + 0xc5, 0xff, 0xd9, 0x4d, 0xcb, 0xf8, 0xba, 0x00, 0x28, 0x78, 0x30, 0xb9, + 0xdb, 0xf8, 0xbe, 0x00, 0x21, 0x46, 0xf8, 0xf7, 0xbb, 0xff, 0xcb, 0xf8, + 0xbe, 0x00, 0x01, 0x20, 0x01, 0x24, 0x00, 0xf0, 0xab, 0xf9, 0xbb, 0xf8, + 0x56, 0x00, 0xad, 0xf8, 0x38, 0x00, 0x9b, 0xf8, 0x11, 0x00, 0x8d, 0xf8, + 0x3e, 0x00, 0x07, 0xf0, 0xfe, 0x00, 0x02, 0x28, 0x08, 0xd1, 0x28, 0x78, + 0x9b, 0xf8, 0x50, 0x40, 0x8d, 0xf8, 0x43, 0x40, 0x20, 0xb9, 0x9b, 0xf8, + 0x51, 0x00, 0x04, 0x43, 0x8d, 0xf8, 0x43, 0x40, 0x4f, 0xf0, 0x00, 0x08, + 0xe8, 0x78, 0xdb, 0xf8, 0xde, 0x20, 0xdb, 0xf8, 0xb6, 0x10, 0x85, 0xf8, + 0x03, 0x80, 0x09, 0xf1, 0x07, 0x05, 0x2b, 0x46, 0x16, 0x0e, 0x20, 0x43, + 0x03, 0xf8, 0x02, 0x2b, 0x8d, 0xf8, 0x43, 0x00, 0x5e, 0x70, 0x16, 0x0c, + 0x12, 0x0a, 0x1e, 0x70, 0x03, 0x9e, 0x05, 0x23, 0x8d, 0xf8, 0x40, 0x20, + 0x11, 0x93, 0x14, 0x23, 0x70, 0x1a, 0x4f, 0xf4, 0x7a, 0x71, 0xb0, 0xfb, + 0xf1, 0xf0, 0xb4, 0x49, 0x01, 0xf1, 0xd0, 0x04, 0xad, 0xf8, 0x3a, 0x00, + 0x00, 0x0c, 0x14, 0x21, 0xad, 0xf8, 0x3c, 0x00, 0x09, 0xf1, 0x10, 0x00, + 0x22, 0x46, 0xf6, 0xf7, 0xa5, 0xfd, 0x58, 0x46, 0x10, 0xf8, 0x01, 0x1f, + 0x42, 0x78, 0x83, 0x78, 0xc0, 0x78, 0x41, 0xea, 0x02, 0x21, 0x43, 0xea, + 0x00, 0x20, 0x41, 0xea, 0x00, 0x40, 0x10, 0x21, 0x09, 0xeb, 0x01, 0x03, + 0x39, 0xf8, 0x01, 0x20, 0x5b, 0x88, 0x42, 0xea, 0x03, 0x42, 0x90, 0x42, + 0x06, 0xd3, 0x08, 0xf1, 0x01, 0x08, 0x04, 0x31, 0xb8, 0xf1, 0x05, 0x0f, + 0xf0, 0xd1, 0x34, 0xe0, 0x48, 0x46, 0xff, 0xf7, 0x4b, 0xfa, 0xeb, 0x49, + 0x04, 0xaf, 0x22, 0x46, 0x14, 0x23, 0xd1, 0xe9, 0x30, 0x01, 0xcd, 0xe9, + 0x06, 0x01, 0x07, 0xf1, 0x10, 0x00, 0x14, 0x21, 0xf6, 0xf7, 0x78, 0xfd, + 0x9d, 0xf8, 0x43, 0x10, 0xbd, 0xf8, 0x3a, 0x20, 0x01, 0x20, 0x3b, 0x46, + 0x8d, 0xf8, 0x10, 0x00, 0x9d, 0xf8, 0x40, 0x00, 0x8d, 0xf8, 0x11, 0x10, + 0xbd, 0xf8, 0x3c, 0x10, 0x42, 0xea, 0x01, 0x41, 0x05, 0x91, 0x15, 0xf8, + 0x02, 0x1b, 0x41, 0xea, 0x00, 0x20, 0x29, 0x78, 0x6a, 0x78, 0x41, 0xea, + 0x02, 0x21, 0x00, 0x22, 0x40, 0xea, 0x01, 0x40, 0x01, 0x21, 0x0d, 0x90, + 0x89, 0x48, 0x04, 0x68, 0x28, 0x20, 0x00, 0x90, 0x4f, 0xf4, 0xe7, 0x60, + 0xa0, 0x47, 0x87, 0x4c, 0x01, 0x20, 0x01, 0x21, 0x00, 0x22, 0x20, 0x70, + 0x83, 0x48, 0x23, 0x46, 0x05, 0x68, 0x3c, 0x20, 0x00, 0x90, 0x40, 0xf2, + 0x39, 0x70, 0xa8, 0x47, 0xcb, 0x48, 0x28, 0x21, 0xc0, 0x30, 0xf8, 0xf7, + 0xd5, 0xfe, 0x20, 0x46, 0x3c, 0x21, 0xf8, 0xf7, 0xd1, 0xfe, 0x9b, 0xf8, + 0xe2, 0x00, 0x0d, 0xf1, 0x10, 0x08, 0xcb, 0xf8, 0xb6, 0x60, 0x00, 0xf0, + 0xfe, 0x00, 0x8b, 0xf8, 0xe2, 0x00, 0x5f, 0xea, 0x8a, 0x70, 0x40, 0xf1, + 0xe2, 0x80, 0x9b, 0xf8, 0x00, 0x00, 0x43, 0xf6, 0x09, 0x51, 0x10, 0xfb, + 0x01, 0xf2, 0xdb, 0xf8, 0x8a, 0x10, 0xdb, 0xf8, 0x5e, 0x00, 0x0b, 0x46, + 0x00, 0x29, 0x08, 0xbf, 0x03, 0x46, 0xf3, 0x1a, 0xb3, 0xeb, 0x82, 0x1f, + 0x0d, 0xd9, 0xb7, 0x48, 0x54, 0x21, 0x68, 0x30, 0xf8, 0xf7, 0xac, 0xfe, + 0x9b, 0xf8, 0xe2, 0x00, 0xcb, 0xf8, 0x5e, 0x60, 0x00, 0xf0, 0xfd, 0x00, + 0x8b, 0xf8, 0xe2, 0x00, 0xc1, 0xe0, 0x09, 0xb9, 0xcb, 0xf8, 0x8a, 0x00, + 0x30, 0x1a, 0x4f, 0xf4, 0x7a, 0x71, 0xb0, 0xfb, 0xf1, 0xf0, 0xf8, 0xf7, + 0xc9, 0xfe, 0xdf, 0xf8, 0x74, 0xa1, 0x04, 0x46, 0x00, 0x26, 0x0a, 0xeb, + 0x86, 0x07, 0x21, 0x46, 0xb8, 0x6e, 0xd7, 0xf8, 0x94, 0x50, 0xf8, 0xf7, + 0xc3, 0xfe, 0x29, 0x46, 0xb8, 0x66, 0xf8, 0xf7, 0xb3, 0xfe, 0x00, 0x2e, + 0x4f, 0xf0, 0x01, 0x06, 0xc7, 0xf8, 0x94, 0x00, 0xed, 0xd0, 0x56, 0x48, + 0x00, 0x21, 0x01, 0x70, 0x0a, 0xf1, 0x64, 0x00, 0x2c, 0x21, 0xf8, 0xf7, + 0x7b, 0xfe, 0x00, 0x20, 0x00, 0xf0, 0xa4, 0xf8, 0xbb, 0xf8, 0x56, 0x00, + 0xad, 0xf8, 0x38, 0x00, 0x9b, 0xf8, 0x11, 0x00, 0x8d, 0xf8, 0x3e, 0x00, + 0x02, 0x98, 0x00, 0xf0, 0xfe, 0x00, 0x02, 0x28, 0x0b, 0xd1, 0x97, 0x49, + 0x9b, 0xf8, 0x50, 0x00, 0x47, 0x46, 0x09, 0x78, 0x8d, 0xf8, 0x43, 0x00, + 0x39, 0xb9, 0x9b, 0xf8, 0x51, 0x10, 0x08, 0x43, 0x01, 0xe0, 0x01, 0x20, + 0x47, 0x46, 0x8d, 0xf8, 0x43, 0x00, 0x09, 0xf1, 0x07, 0x05, 0xdb, 0xf8, + 0xb2, 0x20, 0x8d, 0x4e, 0xdb, 0xf8, 0x8a, 0x10, 0x2b, 0x46, 0x03, 0xf8, + 0x02, 0x2b, 0x14, 0x0e, 0x5c, 0x70, 0x14, 0x0c, 0x12, 0x0a, 0x8d, 0xf8, + 0x40, 0x20, 0xb2, 0x78, 0x1c, 0x70, 0x05, 0x23, 0x0a, 0xf1, 0xa4, 0x04, + 0x11, 0x93, 0x14, 0x23, 0x10, 0x43, 0x22, 0x46, 0x8d, 0xf8, 0x43, 0x00, + 0x03, 0x98, 0x40, 0x1a, 0x4f, 0xf4, 0x7a, 0x71, 0xb0, 0xfb, 0xf1, 0xf0, + 0x14, 0x21, 0xad, 0xf8, 0x3a, 0x00, 0x00, 0x0c, 0xad, 0xf8, 0x3c, 0x00, + 0x09, 0xf1, 0x10, 0x00, 0xf6, 0xf7, 0x9c, 0xfc, 0x48, 0x46, 0xfa, 0xf7, + 0x63, 0xf8, 0xda, 0xf8, 0x94, 0x00, 0x06, 0x90, 0x30, 0x78, 0x01, 0x28, + 0x02, 0xd0, 0xda, 0xf8, 0x98, 0x00, 0x07, 0x90, 0x07, 0xf1, 0x10, 0x00, + 0x14, 0x21, 0x22, 0x46, 0x14, 0x23, 0xf6, 0xf7, 0x89, 0xfc, 0x03, 0x98, + 0x9d, 0xf8, 0x43, 0x10, 0xbd, 0xf8, 0x3a, 0x20, 0x20, 0x4c, 0xcb, 0xf8, + 0x5e, 0x00, 0x9b, 0xf8, 0xe2, 0x00, 0x8d, 0xf8, 0x11, 0x10, 0xbd, 0xf8, + 0x3c, 0x10, 0x23, 0x46, 0x00, 0xf0, 0xfd, 0x00, 0x42, 0xea, 0x01, 0x41, + 0x8b, 0xf8, 0xe2, 0x00, 0x00, 0x20, 0x05, 0x91, 0x15, 0xf8, 0x02, 0x1b, + 0x8d, 0xf8, 0x10, 0x00, 0x9d, 0xf8, 0x40, 0x00, 0x6a, 0x78, 0x41, 0xea, + 0x00, 0x20, 0x29, 0x78, 0x10, 0x4d, 0x41, 0xea, 0x02, 0x21, 0x2e, 0x68, + 0x00, 0x22, 0x40, 0xea, 0x01, 0x40, 0x01, 0x21, 0x0d, 0x90, 0x3c, 0x20, + 0x00, 0x90, 0x40, 0xf2, 0x39, 0x70, 0xb0, 0x47, 0x28, 0x20, 0x2d, 0x68, + 0x01, 0x21, 0x00, 0x22, 0x3b, 0x46, 0x00, 0x90, 0x4f, 0xf4, 0xe7, 0x60, + 0xa8, 0x47, 0x20, 0x46, 0x3c, 0x21, 0xf8, 0xf7, 0xe1, 0xfd, 0x17, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0xd0, 0xe2, 0x05, 0x00, 0x34, 0xe4, 0x05, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0xbc, 0xe3, 0x05, 0x00, 0xf8, 0xe3, 0x05, 0x00, + 0x2d, 0xe9, 0xfe, 0x4f, 0x47, 0x4f, 0x97, 0xf8, 0x5f, 0x10, 0x00, 0x29, + 0x00, 0xf0, 0x80, 0x80, 0x97, 0xf8, 0x0c, 0x90, 0x01, 0x28, 0x06, 0xd0, + 0x00, 0x28, 0x7b, 0xd1, 0xba, 0x46, 0x43, 0x4d, 0x3a, 0xf8, 0x90, 0x6b, + 0x07, 0xe0, 0xb8, 0x79, 0x4f, 0xf4, 0x7a, 0x71, 0x3e, 0x4d, 0x07, 0xf1, + 0xbc, 0x0a, 0x10, 0xfb, 0x01, 0xf6, 0x0a, 0xf1, 0x14, 0x04, 0x18, 0x21, + 0x20, 0x46, 0xf9, 0xf7, 0x67, 0xfa, 0x30, 0x46, 0xf8, 0xf7, 0xe0, 0xfd, + 0x29, 0x46, 0xf8, 0xf7, 0xe3, 0xfd, 0x02, 0x90, 0x09, 0xf0, 0xfe, 0x00, + 0x00, 0x25, 0x01, 0x90, 0x35, 0x48, 0x90, 0xf8, 0x00, 0xb0, 0xbb, 0xf1, + 0x01, 0x0f, 0x08, 0xbf, 0x01, 0x2d, 0x53, 0xd0, 0x05, 0xeb, 0x85, 0x00, + 0x04, 0x21, 0x38, 0x44, 0x90, 0xf9, 0x49, 0x00, 0x90, 0xfb, 0xf1, 0xf0, + 0x40, 0xb2, 0xff, 0xf7, 0x0f, 0xf9, 0x01, 0x46, 0x0a, 0xeb, 0x85, 0x00, + 0x40, 0x68, 0xf8, 0xf7, 0xc5, 0xfd, 0x01, 0x46, 0x02, 0x98, 0xf8, 0xf7, + 0xaf, 0xfd, 0x4f, 0xf0, 0x8f, 0x41, 0xf8, 0xf7, 0xab, 0xfd, 0x06, 0x46, + 0x01, 0x98, 0x02, 0x28, 0x1c, 0xd1, 0x78, 0x19, 0x4f, 0xf0, 0x00, 0x09, + 0x00, 0xf1, 0x56, 0x08, 0x98, 0xf8, 0x00, 0x00, 0x20, 0xfa, 0x09, 0xf0, + 0xc0, 0x07, 0x0b, 0xd0, 0x54, 0xf8, 0x29, 0x00, 0xf8, 0xf7, 0xa4, 0xfd, + 0x01, 0x46, 0x30, 0x46, 0xf8, 0xf7, 0x9a, 0xfd, 0x00, 0xf0, 0x40, 0xf8, + 0x44, 0xf8, 0x29, 0x00, 0x09, 0xf1, 0x01, 0x09, 0xb9, 0xf1, 0x05, 0x0f, + 0xe8, 0xd1, 0x09, 0xe0, 0x20, 0x68, 0xf8, 0xf7, 0x93, 0xfd, 0x01, 0x46, + 0x30, 0x46, 0xf8, 0xf7, 0x89, 0xfd, 0x00, 0xf0, 0x2f, 0xf8, 0x20, 0x60, + 0xda, 0xf8, 0x28, 0x00, 0xf8, 0xf7, 0x88, 0xfd, 0x01, 0x46, 0x30, 0x46, + 0xf8, 0xf7, 0x7e, 0xfd, 0x00, 0xf0, 0x24, 0xf8, 0x01, 0x35, 0x07, 0x4f, + 0xca, 0xf8, 0x28, 0x00, 0x02, 0x2d, 0xa6, 0xd1, 0xbd, 0xe8, 0xfe, 0x8f, + 0x00, 0x20, 0x40, 0xf2, 0x4e, 0x41, 0x03, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, + 0xfc, 0xf7, 0xfe, 0xb9, 0xd0, 0xe2, 0x05, 0x00, 0x00, 0x40, 0x9c, 0x45, + 0x00, 0x00, 0xfa, 0x43, 0x34, 0xe4, 0x05, 0x00, 0x4b, 0xf2, 0xe1, 0x7c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf2, 0xf5, 0x7c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0xb1, 0x5c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0xf1, 0x5c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x6f, 0x12, 0x83, 0x3a, + 0x87, 0x02, 0xa5, 0x3a, 0x31, 0xbc, 0xcf, 0x3a, 0xf2, 0xc2, 0x02, 0x3b, + 0x76, 0x9e, 0x24, 0x3b, 0x37, 0x3e, 0x4f, 0x3b, 0xa6, 0x73, 0x82, 0x3b, + 0xa2, 0x3a, 0xa4, 0x3b, 0x8a, 0xc0, 0xce, 0x3b, 0x8a, 0x24, 0x02, 0x3c, + 0x0a, 0xd7, 0x23, 0x3c, 0x29, 0x43, 0x4e, 0x3c, 0x9f, 0xd5, 0x81, 0x3c, + 0xaf, 0x73, 0xa3, 0x3c, 0x14, 0xc6, 0xcd, 0x3c, 0xe2, 0x86, 0x01, 0x3d, + 0x90, 0x10, 0x23, 0x3d, 0x4a, 0x49, 0x4d, 0x3d, 0x56, 0x38, 0x81, 0x3d, + 0xad, 0xad, 0xa2, 0x3d, 0xcd, 0xcc, 0xcc, 0x3d, 0xf9, 0xe9, 0x00, 0x3e, + 0x06, 0x4b, 0x22, 0x3e, 0x9b, 0x50, 0x4c, 0x3e, 0xcc, 0x9b, 0x80, 0x3e, + 0x9b, 0xe8, 0xa1, 0x3e, 0xb4, 0xd4, 0xcb, 0x3e, 0xce, 0x4d, 0x00, 0x3f, + 0x6c, 0x86, 0x21, 0x3f, 0x18, 0x59, 0x4b, 0x3f, 0x00, 0x00, 0x80, 0x3f, + 0x78, 0x24, 0xa1, 0x3f, 0xc8, 0xdd, 0xca, 0x3f, 0xc1, 0x64, 0xff, 0x3f, + 0xbf, 0xc2, 0x20, 0x40, 0xc2, 0x62, 0x4a, 0x40, 0xe1, 0xc9, 0x7e, 0x40, + 0x42, 0x61, 0xa0, 0x40, 0x07, 0xe8, 0xc9, 0x40, 0x5e, 0x2f, 0xfe, 0x40, + 0x00, 0x00, 0x20, 0x41, 0x96, 0x6d, 0x49, 0x41, 0x3a, 0x95, 0x7d, 0x41, + 0xf9, 0x9e, 0x9f, 0x41, 0x6f, 0xf3, 0xc8, 0x41, 0x72, 0xfb, 0xfc, 0x41, + 0x2d, 0x3e, 0x1f, 0x42, 0x93, 0x79, 0x48, 0x42, 0x08, 0x62, 0x7c, 0x42, + 0x9b, 0xdd, 0x9e, 0x42, 0x00, 0x00, 0xc8, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x52, 0xb8, 0xfe, 0xbf, 0xec, 0x51, 0xd8, 0xbf, 0x5c, 0x8f, 0xc2, 0xbf, + 0x85, 0xeb, 0xb1, 0xbf, 0x66, 0x66, 0xa6, 0xbf, 0xf6, 0x28, 0x9c, 0xbf, + 0x33, 0x33, 0x93, 0xbf, 0x1f, 0x85, 0x8b, 0xbf, 0xb8, 0x1e, 0x85, 0xbf, + 0xa4, 0x70, 0x7d, 0xbf, 0x33, 0x33, 0x73, 0xbf, 0x1f, 0x85, 0x6b, 0xbf, + 0xae, 0x47, 0x61, 0xbf, 0x9a, 0x99, 0x59, 0xbf, 0x85, 0xeb, 0x51, 0xbf, + 0x71, 0x3d, 0x4a, 0xbf, 0x5c, 0x8f, 0x42, 0xbf, 0xa4, 0x70, 0x3d, 0xbf, + 0xec, 0x51, 0x38, 0xbf, 0xd7, 0xa3, 0x30, 0xbf, 0x1f, 0x85, 0x2b, 0xbf, + 0x66, 0x66, 0x26, 0xbf, 0xae, 0x47, 0x21, 0xbf, 0xf6, 0x28, 0x1c, 0xbf, + 0x9a, 0x99, 0x19, 0xbf, 0xe1, 0x7a, 0x14, 0xbf, 0x29, 0x5c, 0x0f, 0xbf, + 0xcd, 0xcc, 0x0c, 0xbf, 0x14, 0xae, 0x07, 0xbf, 0xb8, 0x1e, 0x05, 0xbf, + 0x00, 0x00, 0x00, 0xbf, 0x48, 0xe1, 0xfa, 0xbe, 0x8f, 0xc2, 0xf5, 0xbe, + 0x1f, 0x85, 0xeb, 0xbe, 0x66, 0x66, 0xe6, 0xbe, 0xae, 0x47, 0xe1, 0xbe, + 0xf6, 0x28, 0xdc, 0xbe, 0x3d, 0x0a, 0xd7, 0xbe, 0xcd, 0xcc, 0xcc, 0xbe, + 0x14, 0xae, 0xc7, 0xbe, 0x5c, 0x8f, 0xc2, 0xbe, 0xa4, 0x70, 0xbd, 0xbe, + 0xec, 0x51, 0xb8, 0xbe, 0x33, 0x33, 0xb3, 0xbe, 0x7b, 0x14, 0xae, 0xbe, + 0xc3, 0xf5, 0xa8, 0xbe, 0x0a, 0xd7, 0xa3, 0xbe, 0x52, 0xb8, 0x9e, 0xbe, + 0x9a, 0x99, 0x99, 0xbe, 0x9a, 0x99, 0x99, 0xbe, 0xe1, 0x7a, 0x94, 0xbe, + 0x29, 0x5c, 0x8f, 0xbe, 0x71, 0x3d, 0x8a, 0xbe, 0xb8, 0x1e, 0x85, 0xbe, + 0x00, 0x00, 0x80, 0xbe, 0x00, 0x00, 0x80, 0xbe, 0x8f, 0xc2, 0x75, 0xbe, + 0x1f, 0x85, 0x6b, 0xbe, 0xae, 0x47, 0x61, 0xbe, 0xae, 0x47, 0x61, 0xbe, + 0x3d, 0x0a, 0x57, 0xbe, 0xcd, 0xcc, 0x4c, 0xbe, 0xcd, 0xcc, 0x4c, 0xbe, + 0x5c, 0x8f, 0x42, 0xbe, 0xec, 0x51, 0x38, 0xbe, 0xec, 0x51, 0x38, 0xbe, + 0x7b, 0x14, 0x2e, 0xbe, 0x0a, 0xd7, 0x23, 0xbe, 0x0a, 0xd7, 0x23, 0xbe, + 0x9a, 0x99, 0x19, 0xbe, 0x29, 0x5c, 0x0f, 0xbe, 0x29, 0x5c, 0x0f, 0xbe, + 0xb8, 0x1e, 0x05, 0xbe, 0xb8, 0x1e, 0x05, 0xbe, 0x8f, 0xc2, 0xf5, 0xbd, + 0xae, 0x47, 0xe1, 0xbd, 0xae, 0x47, 0xe1, 0xbd, 0xcd, 0xcc, 0xcc, 0xbd, + 0xcd, 0xcc, 0xcc, 0xbd, 0xec, 0x51, 0xb8, 0xbd, 0xec, 0x51, 0xb8, 0xbd, + 0x0a, 0xd7, 0xa3, 0xbd, 0x0a, 0xd7, 0xa3, 0xbd, 0x29, 0x5c, 0x8f, 0xbd, + 0x8f, 0xc2, 0x75, 0xbd, 0x8f, 0xc2, 0x75, 0xbd, 0x8f, 0xc2, 0x75, 0xbd, + 0xcd, 0xcc, 0x4c, 0xbd, 0xcd, 0xcc, 0x4c, 0xbd, 0x0a, 0xd7, 0x23, 0xbd, + 0x0a, 0xd7, 0x23, 0xbd, 0x8f, 0xc2, 0xf5, 0xbc, 0x8f, 0xc2, 0xf5, 0xbc, + 0x0a, 0xd7, 0xa3, 0xbc, 0x0a, 0xd7, 0xa3, 0xbc, 0x0a, 0xd7, 0x23, 0xbc, + 0x0a, 0xd7, 0x23, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0a, 0xd7, 0x23, 0x3c, 0x0a, 0xd7, 0x23, 0x3c, 0x0a, 0xd7, 0xa3, 0x3c, + 0x0a, 0xd7, 0xa3, 0x3c, 0x0a, 0xd7, 0xa3, 0x3c, 0x8f, 0xc2, 0xf5, 0x3c, + 0x8f, 0xc2, 0xf5, 0x3c, 0x0a, 0xd7, 0x23, 0x3d, 0x0a, 0xd7, 0x23, 0x3d, + 0x0a, 0xd7, 0x23, 0x3d, 0xcd, 0xcc, 0x4c, 0x3d, 0xcd, 0xcc, 0x4c, 0x3d, + 0x8f, 0xc2, 0x75, 0x3d, 0x8f, 0xc2, 0x75, 0x3d, 0x8f, 0xc2, 0x75, 0x3d, + 0x29, 0x5c, 0x8f, 0x3d, 0x29, 0x5c, 0x8f, 0x3d, 0x29, 0x5c, 0x8f, 0x3d, + 0x0a, 0xd7, 0xa3, 0x3d, 0x0a, 0xd7, 0xa3, 0x3d, 0x0a, 0xd7, 0xa3, 0x3d, + 0xec, 0x51, 0xb8, 0x3d, 0xec, 0x51, 0xb8, 0x3d, 0xcd, 0xcc, 0xcc, 0x3d, + 0xcd, 0xcc, 0xcc, 0x3d, 0xcd, 0xcc, 0xcc, 0x3d, 0xae, 0x47, 0xe1, 0x3d, + 0xae, 0x47, 0xe1, 0x3d, 0xae, 0x47, 0xe1, 0x3d, 0x8f, 0xc2, 0xf5, 0x3d, + 0x8f, 0xc2, 0xf5, 0x3d, 0x8f, 0xc2, 0xf5, 0x3d, 0xb8, 0x1e, 0x05, 0x3e, + 0xb8, 0x1e, 0x05, 0x3e, 0xb8, 0x1e, 0x05, 0x3e, 0xb8, 0x1e, 0x05, 0x3e, + 0x29, 0x5c, 0x0f, 0x3e, 0x29, 0x5c, 0x0f, 0x3e, 0x29, 0x5c, 0x0f, 0x3e, + 0x9a, 0x99, 0x19, 0x3e, 0x9a, 0x99, 0x19, 0x3e, 0x9a, 0x99, 0x19, 0x3e, + 0x0a, 0xd7, 0x23, 0x3e, 0x0a, 0xd7, 0x23, 0x3e, 0x0a, 0xd7, 0x23, 0x3e, + 0x7b, 0x14, 0x2e, 0x3e, 0x7b, 0x14, 0x2e, 0x3e, 0x7b, 0x14, 0x2e, 0x3e, + 0x7b, 0x14, 0x2e, 0x3e, 0xec, 0x51, 0x38, 0x3e, 0xec, 0x51, 0x38, 0x3e, + 0xec, 0x51, 0x38, 0x3e, 0x5c, 0x8f, 0x42, 0x3e, 0x5c, 0x8f, 0x42, 0x3e, + 0x5c, 0x8f, 0x42, 0x3e, 0x5c, 0x8f, 0x42, 0x3e, 0xcd, 0xcc, 0x4c, 0x3e, + 0xcd, 0xcc, 0x4c, 0x3e, 0xcd, 0xcc, 0x4c, 0x3e, 0xcd, 0xcc, 0x4c, 0x3e, + 0x3d, 0x0a, 0x57, 0x3e, 0x3d, 0x0a, 0x57, 0x3e, 0x3d, 0x0a, 0x57, 0x3e, + 0xae, 0x47, 0x61, 0x3e, 0xae, 0x47, 0x61, 0x3e, 0xae, 0x47, 0x61, 0x3e, + 0xae, 0x47, 0x61, 0x3e, 0x1f, 0x85, 0x6b, 0x3e, 0x1f, 0x85, 0x6b, 0x3e, + 0x1f, 0x85, 0x6b, 0x3e, 0x1f, 0x85, 0x6b, 0x3e, 0x8f, 0xc2, 0x75, 0x3e, + 0x8f, 0xc2, 0x75, 0x3e, 0x8f, 0xc2, 0x75, 0x3e, 0x8f, 0xc2, 0x75, 0x3e, + 0x00, 0x00, 0x80, 0x3e, 0x00, 0x00, 0x80, 0x3e, 0x00, 0x00, 0x80, 0x3e, + 0xb8, 0x1e, 0x85, 0x3e, 0xb8, 0x1e, 0x85, 0x3e, 0xb8, 0x1e, 0x85, 0x3e, + 0xb8, 0x1e, 0x85, 0x3e, 0xb8, 0x1e, 0x85, 0x3e, 0xb8, 0x1e, 0x85, 0x3e, + 0x71, 0x3d, 0x8a, 0x3e, 0x71, 0x3d, 0x8a, 0x3e, 0x71, 0x3d, 0x8a, 0x3e, + 0x71, 0x3d, 0x8a, 0x3e, 0x29, 0x5c, 0x8f, 0x3e, 0x29, 0x5c, 0x8f, 0x3e, + 0x29, 0x5c, 0x8f, 0x3e, 0x29, 0x5c, 0x8f, 0x3e, 0xe1, 0x7a, 0x94, 0x3e, + 0xe1, 0x7a, 0x94, 0x3e, 0xe1, 0x7a, 0x94, 0x3e, 0xe1, 0x7a, 0x94, 0x3e, + 0xe1, 0x7a, 0x94, 0x3e, 0x9a, 0x99, 0x99, 0x3e, 0x00, 0x00, 0x30, 0x41, + 0x00, 0x00, 0x30, 0x41, 0x00, 0x00, 0xa0, 0x41, 0x66, 0x66, 0x0e, 0x42, + 0x33, 0x33, 0x33, 0x42, 0x9a, 0x99, 0x83, 0x42, 0x9a, 0x99, 0x88, 0x42, + 0x9a, 0x99, 0xa6, 0x42, 0x9a, 0x99, 0xa6, 0x42, 0x00, 0x00, 0xac, 0x42, + 0x00, 0x00, 0x10, 0x41, 0x00, 0x00, 0x10, 0x41, 0x00, 0x00, 0x10, 0x41, + 0x10, 0xb5, 0xc7, 0x4c, 0xa0, 0x7a, 0x0d, 0x28, 0x88, 0xbf, 0x10, 0xbd, + 0x66, 0x49, 0x0a, 0x68, 0x00, 0x21, 0x90, 0x47, 0x0d, 0x4b, 0xa0, 0x7a, + 0xa1, 0x78, 0x01, 0x22, 0x1c, 0x68, 0x82, 0x40, 0x81, 0x40, 0x11, 0x40, + 0x14, 0x43, 0x1c, 0x60, 0x5c, 0x68, 0x24, 0xea, 0x02, 0x02, 0x11, 0x43, + 0x59, 0x60, 0x07, 0x49, 0x31, 0xf0, 0x88, 0xfd, 0x06, 0x48, 0x01, 0x68, + 0x41, 0xf0, 0x30, 0x01, 0x01, 0x60, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, + 0x07, 0xb8, 0x00, 0xbf, 0x50, 0xf4, 0x00, 0x30, 0x81, 0xad, 0x02, 0x00, + 0x24, 0x40, 0x01, 0x30, 0xb0, 0xb5, 0x19, 0x49, 0xb0, 0x4c, 0xa0, 0x7a, + 0x09, 0x68, 0x88, 0x47, 0x01, 0x46, 0x00, 0x28, 0x88, 0x4d, 0x18, 0xbf, + 0x01, 0x21, 0xa2, 0x78, 0x85, 0xf8, 0x32, 0x10, 0x01, 0x2a, 0x04, 0xbf, + 0xb0, 0xfa, 0x80, 0xf0, 0x41, 0x09, 0x21, 0xb1, 0x29, 0x20, 0x00, 0xf0, + 0x21, 0xf8, 0x01, 0x20, 0x03, 0xe0, 0x2a, 0x20, 0x00, 0xf0, 0x1c, 0xf8, + 0x00, 0x20, 0x85, 0xf8, 0x31, 0x00, 0x00, 0xf0, 0x31, 0xf8, 0x95, 0xf8, + 0x32, 0x20, 0xa0, 0x7a, 0x01, 0x21, 0x00, 0x2a, 0x18, 0xbf, 0x01, 0x22, + 0x81, 0x40, 0x02, 0xfa, 0x00, 0xf0, 0x05, 0x4a, 0x08, 0x40, 0x13, 0x68, + 0x23, 0xea, 0x01, 0x01, 0x08, 0x43, 0x10, 0x60, 0xb0, 0xbd, 0x00, 0xbf, + 0x10, 0xff, 0x08, 0x00, 0x54, 0xf4, 0x00, 0x30, 0x10, 0xb5, 0x7b, 0x49, + 0x09, 0x68, 0x89, 0xb1, 0x09, 0x4a, 0x7b, 0x4b, 0x12, 0x68, 0x1c, 0x78, + 0x41, 0xf8, 0x34, 0x20, 0x01, 0xeb, 0xc4, 0x01, 0x08, 0x71, 0x8f, 0x48, + 0x19, 0x78, 0xc0, 0x88, 0x01, 0x31, 0xca, 0xb2, 0x90, 0x42, 0x98, 0xbf, + 0x00, 0x21, 0x19, 0x70, 0x10, 0xbd, 0x00, 0xbf, 0x24, 0x20, 0x00, 0x40, + 0x63, 0x48, 0x90, 0xf8, 0x31, 0x10, 0x11, 0xb9, 0x90, 0xf8, 0x30, 0x00, + 0x20, 0xb1, 0x04, 0x48, 0x01, 0x21, 0x02, 0x68, 0x0d, 0x20, 0x10, 0x47, + 0x01, 0x48, 0x00, 0x21, 0xf9, 0xe7, 0x00, 0xbf, 0x18, 0x9d, 0x08, 0x00, + 0xf8, 0xb5, 0x7f, 0x49, 0x04, 0x46, 0xc8, 0x7a, 0x0d, 0x28, 0x88, 0xbf, + 0xf8, 0xbd, 0xcd, 0x1c, 0x1d, 0x49, 0x01, 0x27, 0x0a, 0x68, 0x01, 0x21, + 0x90, 0x47, 0x1c, 0x4e, 0x72, 0xb6, 0x30, 0x68, 0x4f, 0xea, 0x40, 0x00, + 0x00, 0xf1, 0x01, 0x00, 0x30, 0x60, 0x54, 0xb1, 0x2b, 0x20, 0xff, 0xf7, + 0xbb, 0xff, 0x4e, 0x48, 0x80, 0xf8, 0x30, 0x70, 0x00, 0xf0, 0x2e, 0xf8, + 0x00, 0xf0, 0x42, 0xf8, 0x06, 0xe0, 0x2c, 0x20, 0xff, 0xf7, 0xb0, 0xff, + 0x48, 0x48, 0x00, 0x21, 0x80, 0xf8, 0x30, 0x10, 0x30, 0x68, 0x40, 0x08, + 0x30, 0x60, 0x30, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x28, 0x78, 0x01, 0x28, + 0x04, 0xbf, 0xb4, 0xfa, 0x84, 0xf0, 0x44, 0x09, 0x2c, 0xb1, 0x2d, 0x20, + 0xff, 0xf7, 0x9c, 0xff, 0x28, 0x7a, 0x07, 0x49, 0x04, 0xe0, 0x2e, 0x20, + 0xff, 0xf7, 0x96, 0xff, 0x28, 0x7a, 0x05, 0x49, 0x09, 0x68, 0xbd, 0xe8, + 0xf8, 0x40, 0x08, 0x47, 0x04, 0xff, 0x08, 0x00, 0x24, 0x36, 0x01, 0x00, + 0x08, 0xff, 0x08, 0x00, 0x0c, 0xff, 0x08, 0x00, 0x80, 0xb5, 0x16, 0x48, + 0x00, 0x21, 0x01, 0x60, 0x06, 0x48, 0x15, 0x49, 0x01, 0x60, 0x06, 0x48, + 0x01, 0x68, 0x07, 0x20, 0x88, 0x47, 0x94, 0x48, 0x01, 0x68, 0x07, 0x20, + 0xbd, 0xe8, 0x80, 0x40, 0x08, 0x47, 0x00, 0xbf, 0x40, 0x22, 0x00, 0x40, + 0xb4, 0x9c, 0x08, 0x00, 0x80, 0xb5, 0x0b, 0x48, 0x0b, 0x49, 0x47, 0xf2, + 0x30, 0x52, 0xc1, 0x66, 0x01, 0x68, 0x41, 0xf0, 0x01, 0x01, 0x01, 0x60, + 0x08, 0x49, 0x41, 0x58, 0x11, 0x44, 0x41, 0x60, 0x87, 0x48, 0x01, 0x68, + 0x07, 0x20, 0x88, 0x47, 0x6a, 0x48, 0x01, 0x68, 0x07, 0x20, 0xbd, 0xe8, + 0x80, 0x40, 0x08, 0x47, 0xd4, 0x21, 0x00, 0x40, 0x00, 0x02, 0x20, 0x00, + 0x50, 0xfe, 0xff, 0xff, 0x80, 0xb5, 0x1a, 0x48, 0x90, 0xf8, 0x30, 0x00, + 0x20, 0xb1, 0xff, 0xf7, 0xc5, 0xff, 0xbd, 0xe8, 0x80, 0x40, 0xd7, 0xe7, + 0x80, 0xbd, 0x80, 0xb5, 0x2f, 0x20, 0xff, 0xf7, 0x45, 0xff, 0xff, 0xf7, + 0xbb, 0xff, 0x00, 0x20, 0xbd, 0xe8, 0x80, 0x40, 0xff, 0xf7, 0x6a, 0xbf, + 0x10, 0xb5, 0x0f, 0x4c, 0x60, 0x69, 0x20, 0xb1, 0x50, 0xf8, 0x08, 0x1c, + 0x09, 0xb1, 0xfb, 0xf7, 0xbb, 0xfe, 0x60, 0x6a, 0x20, 0xb1, 0x50, 0xf8, + 0x08, 0x1c, 0x09, 0xb1, 0xfb, 0xf7, 0xb4, 0xfe, 0xf4, 0x48, 0x34, 0x21, + 0xf8, 0xf7, 0xd6, 0xf9, 0x10, 0x48, 0x00, 0x68, 0x38, 0xb1, 0x29, 0x49, + 0xc9, 0x88, 0xc9, 0x00, 0xf8, 0xf7, 0x82, 0xfe, 0x0e, 0x48, 0x00, 0x21, + 0x01, 0x70, 0x10, 0xbd, 0x48, 0xe4, 0x05, 0x00, 0xb0, 0xb5, 0x23, 0x4c, + 0xe1, 0x88, 0x71, 0xb1, 0x07, 0x4d, 0x28, 0x68, 0x28, 0xb9, 0x07, 0x48, + 0x02, 0x68, 0xc8, 0x00, 0x90, 0x47, 0xe1, 0x88, 0x28, 0x60, 0xc9, 0x00, + 0xf8, 0xf7, 0x6c, 0xfe, 0x03, 0x48, 0x00, 0x21, 0x01, 0x70, 0xb0, 0xbd, + 0x7c, 0xe4, 0x05, 0x00, 0xdc, 0x9b, 0x08, 0x00, 0x80, 0xe4, 0x05, 0x00, + 0x16, 0x49, 0x4f, 0xf4, 0xa0, 0x73, 0x08, 0x78, 0x4a, 0x7b, 0x01, 0x28, + 0x78, 0x48, 0x08, 0xbf, 0x50, 0x23, 0x43, 0x63, 0x83, 0x63, 0x1a, 0xb1, + 0x0a, 0x7b, 0x42, 0xf0, 0x10, 0x02, 0x00, 0xe0, 0x00, 0x22, 0xc2, 0x63, + 0x0a, 0x89, 0x49, 0x78, 0x01, 0x29, 0x12, 0xbf, 0x02, 0xf0, 0x7f, 0x02, + 0x01, 0x21, 0x61, 0xf3, 0x9f, 0x22, 0x91, 0xb2, 0x01, 0x63, 0x40, 0xf6, + 0x5f, 0x01, 0x01, 0x62, 0x02, 0x68, 0x22, 0xf0, 0x08, 0x02, 0x02, 0x60, + 0x43, 0xf2, 0x08, 0x02, 0x02, 0x60, 0x81, 0x66, 0x4f, 0xf0, 0x80, 0x21, + 0x01, 0x64, 0x03, 0x21, 0x01, 0x66, 0x70, 0x47, 0x38, 0xe4, 0x05, 0x00, + 0xf8, 0xb5, 0x1e, 0x48, 0x01, 0x68, 0x41, 0xf0, 0x20, 0x01, 0x01, 0x60, + 0x1c, 0x48, 0x8e, 0x21, 0x01, 0x60, 0x1c, 0x48, 0x01, 0x60, 0xff, 0xf7, + 0xc3, 0xff, 0xff, 0xf7, 0x5f, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0xec, 0xfe, + 0xff, 0xf7, 0x80, 0xff, 0xff, 0xf7, 0xa0, 0xff, 0xff, 0xf7, 0x32, 0xff, + 0x32, 0x4c, 0x07, 0x20, 0x07, 0x25, 0x21, 0x68, 0x88, 0x47, 0x13, 0x4e, + 0x13, 0x49, 0x07, 0x20, 0x32, 0x68, 0x90, 0x47, 0x12, 0x4f, 0x07, 0x20, + 0x39, 0x68, 0x88, 0x47, 0x11, 0x48, 0x01, 0x68, 0x65, 0xf3, 0x17, 0x51, + 0x01, 0x60, 0x41, 0x68, 0x65, 0xf3, 0x17, 0x51, 0x41, 0x60, 0x01, 0x21, + 0xc0, 0xf8, 0x98, 0x10, 0x34, 0x20, 0x21, 0x68, 0x88, 0x47, 0x32, 0x68, + 0x0a, 0x49, 0x34, 0x20, 0x90, 0x47, 0x39, 0x68, 0x34, 0x20, 0xbd, 0xe8, + 0xf8, 0x40, 0x08, 0x47, 0x04, 0x00, 0x00, 0x40, 0x30, 0xf4, 0x00, 0x30, + 0x34, 0xf4, 0x00, 0x30, 0xac, 0x9c, 0x08, 0x00, 0x5f, 0xaf, 0x02, 0x00, + 0xb0, 0x9c, 0x08, 0x00, 0x28, 0x22, 0x00, 0x40, 0xe9, 0xb0, 0x02, 0x00, + 0xb0, 0xb5, 0xff, 0xf7, 0x2d, 0xff, 0x15, 0x4c, 0x9d, 0x4d, 0x20, 0x68, + 0x28, 0x60, 0x60, 0x68, 0x68, 0x60, 0x60, 0x6b, 0xe8, 0x60, 0x20, 0x6b, + 0xa8, 0x60, 0x00, 0xf0, 0x23, 0xf8, 0x00, 0xf0, 0x6f, 0xf8, 0x00, 0xf0, + 0xa5, 0xf8, 0x00, 0xf0, 0xfb, 0xf8, 0x20, 0x68, 0x29, 0x7c, 0x02, 0x22, + 0x40, 0x0a, 0x49, 0x08, 0x61, 0xf3, 0x5f, 0x00, 0x28, 0x74, 0x00, 0xf0, + 0xfd, 0x00, 0x21, 0x68, 0x02, 0xea, 0xd1, 0x11, 0x08, 0x44, 0x28, 0x74, + 0x0c, 0x20, 0xff, 0xf7, 0x5d, 0xfe, 0x04, 0x48, 0x01, 0x68, 0x34, 0x20, + 0xbd, 0xe8, 0xb0, 0x40, 0x08, 0x47, 0x00, 0xbf, 0x14, 0xf0, 0x03, 0x30, + 0xb8, 0x9c, 0x08, 0x00, 0x70, 0xb5, 0x86, 0x4d, 0x28, 0x78, 0xc0, 0x07, + 0x40, 0xd0, 0x01, 0x20, 0x01, 0x26, 0xff, 0xf7, 0x49, 0xfe, 0x19, 0x20, + 0xff, 0xf7, 0x46, 0xfe, 0x1d, 0x4c, 0x20, 0x68, 0x20, 0xf0, 0x04, 0x00, + 0x20, 0x60, 0x28, 0x78, 0xc1, 0x09, 0xb6, 0xeb, 0xd0, 0x1f, 0x85, 0xf8, + 0x2f, 0x10, 0x18, 0xd1, 0x08, 0x20, 0xff, 0xf7, 0x37, 0xfe, 0x17, 0x48, + 0x01, 0x68, 0x17, 0x48, 0x00, 0xf5, 0x84, 0x70, 0x88, 0x47, 0x00, 0x21, + 0x85, 0xf8, 0x2e, 0x60, 0x68, 0x62, 0xa9, 0x85, 0x08, 0xb1, 0x28, 0x8d, + 0x20, 0xb9, 0x00, 0x20, 0x4f, 0xf4, 0xd9, 0x71, 0xf5, 0xf7, 0x2a, 0xff, + 0x00, 0xf0, 0x5e, 0xfa, 0x10, 0xe0, 0x09, 0x20, 0xff, 0xf7, 0x1e, 0xfe, + 0x85, 0xf8, 0x22, 0x60, 0x4f, 0xf6, 0xff, 0x71, 0x60, 0x68, 0x88, 0x43, + 0x60, 0x60, 0x17, 0x20, 0xff, 0xf7, 0x14, 0xfe, 0xa0, 0x68, 0x40, 0xf4, + 0x80, 0x50, 0xa0, 0x60, 0xa0, 0x6e, 0x40, 0xf0, 0x01, 0x00, 0xa0, 0x66, + 0x70, 0xbd, 0x00, 0xbf, 0x00, 0xf0, 0x03, 0x30, 0x24, 0x9d, 0x08, 0x00, + 0x2c, 0xba, 0x01, 0x00, 0xb0, 0xb5, 0x5f, 0x4d, 0x19, 0x4c, 0x28, 0x68, + 0x41, 0x07, 0x09, 0xd5, 0x03, 0x20, 0xff, 0xf7, 0xfb, 0xfd, 0x00, 0xf0, + 0xb9, 0xf8, 0x20, 0x6d, 0x40, 0xf0, 0x04, 0x00, 0x20, 0x65, 0x28, 0x68, + 0x80, 0x07, 0x21, 0xd5, 0x02, 0x20, 0xff, 0xf7, 0xef, 0xfd, 0x68, 0x8d, + 0x21, 0x68, 0x6f, 0xf3, 0xdf, 0x31, 0x81, 0x42, 0x04, 0xd0, 0x00, 0x20, + 0x40, 0xf2, 0xed, 0x11, 0xf5, 0xf7, 0xea, 0xfe, 0xa8, 0x8d, 0x29, 0x8d, + 0x81, 0x42, 0x06, 0xd1, 0x4f, 0xf0, 0x00, 0x40, 0xa0, 0x62, 0x03, 0x20, + 0x85, 0xf8, 0x2e, 0x00, 0x04, 0xe0, 0x02, 0x20, 0x85, 0xf8, 0x2e, 0x00, + 0x00, 0xf0, 0x10, 0xfa, 0x20, 0x6d, 0x40, 0xf0, 0x02, 0x00, 0x20, 0x65, + 0xb0, 0xbd, 0x00, 0xbf, 0x18, 0xf0, 0x03, 0x30, 0xb0, 0xb5, 0x43, 0x4d, + 0x28, 0x68, 0x01, 0x05, 0x03, 0xd5, 0x0b, 0x20, 0xff, 0xf7, 0xc4, 0xfd, + 0x28, 0x68, 0x41, 0x05, 0x03, 0xd5, 0x0a, 0x20, 0xff, 0xf7, 0xbe, 0xfd, + 0x28, 0x68, 0x23, 0x4c, 0x40, 0x06, 0x10, 0xd5, 0x07, 0x20, 0xff, 0xf7, + 0xb7, 0xfd, 0x95, 0xf8, 0x2f, 0x00, 0x30, 0xb9, 0x95, 0xf8, 0x22, 0x00, + 0x05, 0x28, 0x02, 0xd0, 0x26, 0x20, 0xff, 0xf7, 0xad, 0xfd, 0x60, 0x6a, + 0x40, 0xf0, 0x40, 0x00, 0x60, 0x62, 0x60, 0x68, 0x00, 0x04, 0x06, 0xd0, + 0x0d, 0x20, 0xff, 0xf7, 0xa3, 0xfd, 0x00, 0xf0, 0x61, 0xf8, 0x02, 0x20, + 0xe0, 0x61, 0x60, 0x68, 0x40, 0x03, 0x04, 0xd5, 0x10, 0x20, 0xff, 0xf7, + 0x99, 0xfd, 0x02, 0x20, 0xe0, 0x61, 0x60, 0x68, 0x00, 0x03, 0x04, 0xd5, + 0x11, 0x20, 0xff, 0xf7, 0x91, 0xfd, 0x02, 0x20, 0xe0, 0x61, 0x20, 0x68, + 0x00, 0x03, 0x04, 0xd5, 0x16, 0x20, 0xff, 0xf7, 0x89, 0xfd, 0x01, 0x20, + 0xe0, 0x61, 0x20, 0x68, 0x40, 0x03, 0x04, 0xd5, 0x15, 0x20, 0xff, 0xf7, + 0x81, 0xfd, 0x01, 0x20, 0xe0, 0x61, 0x20, 0x68, 0x00, 0x04, 0x04, 0xd0, + 0x12, 0x20, 0xff, 0xf7, 0x79, 0xfd, 0x01, 0x20, 0xe0, 0x61, 0xb0, 0xbd, + 0x44, 0xf0, 0x03, 0x30, 0x10, 0xb5, 0x17, 0x4c, 0x20, 0x68, 0xc1, 0x06, + 0x08, 0xd5, 0x05, 0x20, 0xff, 0xf7, 0x6c, 0xfd, 0x14, 0x48, 0x01, 0x68, + 0x41, 0xf0, 0x10, 0x01, 0x01, 0x60, 0x20, 0x68, 0x00, 0x07, 0x1e, 0xd5, + 0x04, 0x20, 0xff, 0xf7, 0x61, 0xfd, 0x94, 0xf8, 0x2f, 0x00, 0x48, 0xb1, + 0x94, 0xf8, 0x2e, 0x00, 0x03, 0x28, 0x11, 0xbf, 0x1c, 0x20, 0x00, 0x20, + 0x84, 0xf8, 0x2e, 0x00, 0x1b, 0x20, 0x07, 0xe0, 0x94, 0xf8, 0x22, 0x00, + 0x05, 0x28, 0x05, 0xd1, 0x00, 0x20, 0x84, 0xf8, 0x22, 0x00, 0x23, 0x20, + 0xff, 0xf7, 0x4a, 0xfd, 0x03, 0x48, 0x01, 0x68, 0x41, 0xf0, 0x08, 0x01, + 0x01, 0x60, 0x10, 0xbd, 0x48, 0xe4, 0x05, 0x00, 0x68, 0xf0, 0x03, 0x30, + 0x2d, 0xe9, 0xf8, 0x43, 0xe3, 0x4f, 0x97, 0xf8, 0x22, 0x00, 0x1d, 0x30, + 0xc0, 0xb2, 0xff, 0xf7, 0x37, 0xfd, 0x90, 0x4c, 0xdf, 0xf8, 0x40, 0x92, + 0x07, 0xf1, 0x14, 0x05, 0xa6, 0x6c, 0x78, 0x8b, 0xb9, 0xf8, 0x2e, 0x15, + 0x10, 0xfa, 0x86, 0xf0, 0x88, 0x42, 0x04, 0xd9, 0x00, 0x20, 0x40, 0xf2, + 0xe9, 0x21, 0xf5, 0xf7, 0x2b, 0xfe, 0xa8, 0x7b, 0x06, 0x28, 0x00, 0xf2, + 0xee, 0x80, 0xdf, 0xe8, 0x00, 0xf0, 0x04, 0x3f, 0x7a, 0x17, 0x17, 0x04, + 0x07, 0x00, 0x28, 0x20, 0xff, 0xf7, 0x18, 0xfd, 0x82, 0x48, 0x00, 0x21, + 0x01, 0x80, 0x19, 0x20, 0xff, 0xf7, 0x12, 0xfd, 0x20, 0x68, 0x40, 0xf2, + 0x7a, 0x31, 0x20, 0xf0, 0x04, 0x00, 0x20, 0x60, 0x00, 0x20, 0xf5, 0xf7, + 0x0f, 0xfe, 0xda, 0xe0, 0x7a, 0x4f, 0xb0, 0xb2, 0x39, 0x88, 0x81, 0x42, + 0x05, 0xd0, 0x00, 0x20, 0x4f, 0xf4, 0x4f, 0x71, 0xf5, 0xf7, 0x04, 0xfe, + 0x39, 0x88, 0x28, 0x68, 0xea, 0x88, 0x10, 0x44, 0x01, 0x38, 0x00, 0xf0, + 0xf1, 0xf8, 0xe9, 0x88, 0x08, 0x44, 0xa9, 0x88, 0x82, 0xb2, 0xe8, 0x80, + 0x8a, 0x42, 0x7b, 0xd2, 0x8e, 0x1a, 0xbd, 0x4a, 0x04, 0x23, 0xab, 0x73, + 0x92, 0x88, 0x96, 0x42, 0xc8, 0xbf, 0x16, 0x46, 0xb2, 0xb2, 0x3e, 0x80, + 0x12, 0xfa, 0x80, 0xf0, 0x88, 0x42, 0x00, 0xf0, 0xa6, 0x80, 0xb4, 0xe0, + 0x00, 0x20, 0x68, 0x81, 0x68, 0x60, 0x28, 0x68, 0x20, 0xb1, 0x50, 0xf8, + 0x08, 0x1c, 0x09, 0xb1, 0xfb, 0xf7, 0x5c, 0xfc, 0x65, 0x48, 0x00, 0x21, + 0x00, 0xf5, 0x00, 0x70, 0xf9, 0xf7, 0x32, 0xff, 0x28, 0x60, 0x28, 0xb9, + 0x00, 0x20, 0x40, 0xf2, 0xfa, 0x21, 0xf5, 0xf7, 0xcf, 0xfd, 0x28, 0x68, + 0xb9, 0xf8, 0x2e, 0x15, 0xf8, 0xf7, 0x24, 0xfc, 0x05, 0xf1, 0x0d, 0x00, + 0x01, 0x21, 0x01, 0x26, 0x00, 0xf0, 0xb8, 0xf8, 0xe9, 0x88, 0x08, 0x44, + 0xe8, 0x80, 0x68, 0x7b, 0x05, 0x28, 0x68, 0xd3, 0x24, 0x20, 0xff, 0xf7, + 0xb5, 0xfc, 0x18, 0x20, 0xff, 0xf7, 0xb2, 0xfc, 0x20, 0x68, 0x40, 0xf0, + 0x04, 0x00, 0x20, 0x60, 0x4d, 0x48, 0x06, 0x80, 0x06, 0x20, 0xa8, 0x73, + 0x20, 0x6c, 0x40, 0xf4, 0x00, 0x40, 0x20, 0x64, 0x7f, 0xe0, 0xdf, 0xf8, + 0x24, 0x81, 0x28, 0x68, 0xb8, 0xf8, 0x00, 0x10, 0x00, 0xf0, 0x98, 0xf8, + 0xe9, 0x88, 0x2b, 0x7b, 0x08, 0x44, 0xd9, 0x43, 0xe8, 0x80, 0x28, 0x89, + 0x08, 0x44, 0x29, 0x68, 0x0a, 0x18, 0x07, 0xf1, 0x1e, 0x00, 0x02, 0x21, + 0xf5, 0xf7, 0xa8, 0xfd, 0x8d, 0x48, 0x69, 0x89, 0x80, 0x88, 0x88, 0x42, + 0x28, 0xbf, 0x08, 0x46, 0x2a, 0x89, 0xa8, 0xf8, 0x00, 0x00, 0x11, 0x44, + 0xb9, 0xf8, 0x2e, 0x25, 0xa9, 0x80, 0x89, 0xb2, 0x91, 0x42, 0x3e, 0xd9, + 0x25, 0x20, 0xff, 0xf7, 0x7d, 0xfc, 0x01, 0x20, 0xa8, 0xf8, 0x00, 0x00, + 0x18, 0x20, 0xff, 0xf7, 0x77, 0xfc, 0x06, 0x20, 0xa8, 0x73, 0x3b, 0xe0, + 0x05, 0x20, 0xa8, 0x73, 0x00, 0x20, 0x38, 0x80, 0x19, 0x20, 0xff, 0xf7, + 0x6d, 0xfc, 0x20, 0x68, 0x20, 0xf0, 0x04, 0x00, 0x20, 0x60, 0xa8, 0x88, + 0xe9, 0x88, 0x81, 0x42, 0x02, 0xd0, 0x27, 0x20, 0xff, 0xf7, 0x62, 0xfc, + 0x2a, 0x68, 0x10, 0x78, 0x51, 0x78, 0x40, 0xea, 0x01, 0x20, 0x0c, 0x28, + 0x28, 0xd1, 0x26, 0x48, 0x00, 0xf5, 0x8a, 0x71, 0x10, 0x46, 0xf7, 0xf7, + 0x43, 0xff, 0x24, 0x48, 0x05, 0x21, 0x00, 0x78, 0xf5, 0xf7, 0x6e, 0xfd, + 0x21, 0xe0, 0x02, 0x21, 0x1d, 0x4b, 0xa9, 0x73, 0x21, 0x49, 0x11, 0xf8, + 0x10, 0x20, 0x01, 0xeb, 0x40, 0x00, 0x40, 0x78, 0x1a, 0x80, 0x28, 0x73, + 0x50, 0x1c, 0x28, 0x81, 0x13, 0xe0, 0x03, 0x22, 0xaa, 0x73, 0xea, 0x88, + 0x10, 0x44, 0x88, 0x42, 0x07, 0xd1, 0x18, 0x20, 0xff, 0xf7, 0x38, 0xfc, + 0x20, 0x68, 0x40, 0xf0, 0x04, 0x00, 0x20, 0x60, 0x05, 0xe0, 0x04, 0xe0, + 0x10, 0x49, 0x68, 0x7b, 0x0b, 0x68, 0x11, 0x46, 0x98, 0x47, 0x0d, 0x48, + 0x06, 0x88, 0x20, 0x6c, 0x40, 0xf4, 0x00, 0x40, 0x20, 0x64, 0x30, 0x04, + 0x0b, 0xd0, 0x60, 0x68, 0x71, 0x1e, 0xc1, 0xea, 0x00, 0x00, 0x60, 0x60, + 0x17, 0x20, 0xff, 0xf7, 0x1d, 0xfc, 0xa0, 0x68, 0x40, 0xf4, 0x80, 0x50, + 0xa0, 0x60, 0xbd, 0xe8, 0xf8, 0x83, 0x00, 0xbf, 0x00, 0xf0, 0x03, 0x30, + 0x8c, 0x7e, 0x08, 0x00, 0x82, 0xe4, 0x05, 0x00, 0x34, 0xa7, 0x08, 0x00, + 0x2c, 0xba, 0x01, 0x00, 0x9d, 0x53, 0x01, 0x00, 0x68, 0x8a, 0x01, 0x00, + 0x10, 0xb7, 0x02, 0x00, 0x2d, 0xe9, 0xfe, 0x4f, 0x1d, 0x4d, 0x0c, 0x46, + 0x4f, 0xf0, 0x00, 0x0a, 0x04, 0x29, 0x1f, 0xd3, 0x21, 0x1f, 0xdf, 0xf8, + 0x6c, 0x80, 0x02, 0xae, 0x07, 0x46, 0x01, 0x90, 0x21, 0xf0, 0x03, 0x0b, + 0x00, 0x91, 0x0b, 0xf1, 0x04, 0x09, 0x28, 0x68, 0x32, 0x46, 0x04, 0x23, + 0x02, 0x90, 0xc5, 0xf8, 0x00, 0xa0, 0x38, 0x46, 0xb8, 0xf8, 0x2e, 0x15, + 0xf5, 0xf7, 0x00, 0xfd, 0x04, 0x3c, 0x04, 0x37, 0xa0, 0xb2, 0x03, 0x28, + 0xef, 0xd8, 0x00, 0x98, 0xa0, 0xeb, 0x0b, 0x04, 0x01, 0x98, 0x01, 0xe0, + 0x4f, 0xf0, 0x00, 0x09, 0x21, 0x04, 0x0d, 0xd0, 0x29, 0x68, 0x10, 0xfa, + 0x89, 0xf0, 0xa3, 0xb2, 0x02, 0xaa, 0x02, 0x91, 0x00, 0x21, 0x29, 0x60, + 0x05, 0x49, 0xb1, 0xf8, 0x2e, 0x15, 0xf5, 0xf7, 0xe5, 0xfc, 0xa1, 0x44, + 0x1f, 0xfa, 0x89, 0xf0, 0xbd, 0xe8, 0xfe, 0x8f, 0x28, 0xf0, 0x03, 0x30, + 0x8c, 0x7e, 0x08, 0x00, 0xf8, 0xb5, 0x1a, 0x20, 0xff, 0xf7, 0xc0, 0xfb, + 0x24, 0x4c, 0x54, 0xf8, 0x24, 0x0f, 0x28, 0xb9, 0x00, 0x20, 0x40, 0xf2, + 0xab, 0x21, 0xf5, 0xf7, 0xbd, 0xfc, 0x20, 0x68, 0x21, 0x89, 0x20, 0x4b, + 0x20, 0x4e, 0x42, 0x18, 0xa0, 0x88, 0x9b, 0x88, 0x45, 0x1a, 0x9d, 0x42, + 0xb8, 0xbf, 0x2b, 0x46, 0x9f, 0xb2, 0x00, 0x25, 0x04, 0x2f, 0x07, 0xd3, + 0x3b, 0x46, 0xaf, 0xb2, 0x04, 0x3b, 0x04, 0x35, 0xd7, 0x59, 0x03, 0x2b, + 0x37, 0x62, 0xf8, 0xd8, 0x01, 0x27, 0xb7, 0x66, 0x1f, 0x04, 0x05, 0xd0, + 0xaf, 0xb2, 0x01, 0x35, 0x01, 0x3b, 0xd7, 0x5d, 0x37, 0x62, 0xf7, 0xe7, + 0x00, 0x22, 0xb2, 0x66, 0x2a, 0x04, 0x0e, 0xd0, 0x30, 0x68, 0xc0, 0xea, + 0x05, 0x40, 0xa0, 0xf5, 0x80, 0x30, 0x30, 0x60, 0x17, 0x20, 0xff, 0xf7, + 0x89, 0xfb, 0x70, 0x68, 0x40, 0xf4, 0x80, 0x50, 0x70, 0x60, 0xa0, 0x88, + 0x21, 0x89, 0x29, 0x44, 0xe5, 0x80, 0x21, 0x81, 0x89, 0xb2, 0x88, 0x42, + 0x88, 0xbf, 0xf8, 0xbd, 0x20, 0x68, 0xbd, 0xe8, 0xf8, 0x40, 0xfb, 0xf7, + 0xfd, 0xba, 0x00, 0xbf, 0x48, 0xe4, 0x05, 0x00, 0x38, 0xe4, 0x05, 0x00, + 0x04, 0xf0, 0x03, 0x30, 0x01, 0x00, 0x03, 0x01, 0x04, 0x02, 0x03, 0x01, + 0x02, 0x01, 0x00, 0x00, 0xb0, 0xb5, 0x2d, 0x4a, 0x10, 0x7d, 0xc1, 0x07, + 0x02, 0xd0, 0x2c, 0x49, 0x8b, 0x7b, 0x03, 0xb1, 0xb0, 0xbd, 0x01, 0x23, + 0x0e, 0x32, 0x8b, 0x73, 0xc0, 0xf3, 0xc0, 0x03, 0x4b, 0x73, 0xc0, 0xf3, + 0x80, 0x03, 0xd5, 0x79, 0x54, 0x79, 0x0b, 0x70, 0x13, 0x78, 0x0d, 0x73, + 0xc0, 0xf3, 0x40, 0x05, 0xcc, 0x72, 0x4d, 0x70, 0x15, 0x89, 0x8b, 0x72, + 0x0d, 0x81, 0x55, 0x89, 0x92, 0x89, 0x8d, 0x80, 0xca, 0x80, 0xc0, 0xf3, + 0x40, 0x12, 0xca, 0x70, 0xc0, 0xf3, 0x00, 0x10, 0x88, 0x70, 0xbd, 0xe8, + 0xb0, 0x40, 0xff, 0xf7, 0x6d, 0xbc, 0x00, 0xbf, 0x70, 0xb5, 0x17, 0x48, + 0x00, 0x7d, 0xc0, 0x07, 0x28, 0xd0, 0x16, 0x48, 0x80, 0x7b, 0x01, 0x28, + 0x24, 0xd1, 0xff, 0xf7, 0x31, 0xfc, 0x14, 0x4d, 0xd5, 0xf8, 0x08, 0x01, + 0x58, 0xb1, 0x13, 0x4e, 0x05, 0xf5, 0x84, 0x74, 0x31, 0x68, 0x20, 0x46, + 0x88, 0x47, 0xfb, 0xf7, 0xad, 0xfa, 0xd5, 0xf8, 0x08, 0x01, 0x00, 0x28, + 0xf6, 0xd1, 0xd5, 0xf8, 0x14, 0x01, 0x58, 0xb1, 0x0b, 0x4e, 0x05, 0xf5, + 0x8a, 0x74, 0x31, 0x68, 0x20, 0x46, 0x88, 0x47, 0xfb, 0xf7, 0x9e, 0xfa, + 0xd5, 0xf8, 0x14, 0x01, 0x00, 0x28, 0xf6, 0xd1, 0xbd, 0xe8, 0x70, 0x40, + 0xff, 0xf7, 0xd2, 0xbb, 0x70, 0xbd, 0x00, 0xbf, 0xdc, 0x2c, 0x06, 0x00, + 0x38, 0xe4, 0x05, 0x00, 0x2c, 0xba, 0x01, 0x00, 0x24, 0x9d, 0x08, 0x00, + 0x01, 0x20, 0xff, 0xf7, 0x2f, 0xbb, 0x00, 0x00, 0x00, 0xb3, 0x01, 0x88, + 0xa1, 0xf1, 0xf1, 0x02, 0x0f, 0x2a, 0x1d, 0xd9, 0x01, 0x29, 0x2d, 0xd0, + 0x0a, 0x29, 0x31, 0xd0, 0x34, 0x29, 0x35, 0xd0, 0x40, 0x29, 0x3a, 0xd0, + 0x41, 0x29, 0x3e, 0xd0, 0x53, 0x29, 0x42, 0xd0, 0x9b, 0x29, 0x46, 0xd0, + 0xab, 0x29, 0x4a, 0xd0, 0xdc, 0x29, 0x4e, 0xd0, 0xe1, 0x29, 0x52, 0xd0, + 0xe5, 0x29, 0x17, 0xd1, 0x00, 0x21, 0x01, 0x72, 0xd2, 0x49, 0x41, 0x60, + 0xa0, 0x21, 0x83, 0xe0, 0x00, 0x21, 0x83, 0xe0, 0xdf, 0xe8, 0x02, 0xf0, + 0x08, 0x4f, 0x0e, 0x0e, 0x55, 0x5b, 0x61, 0x0e, 0x67, 0x6b, 0x6f, 0x75, + 0x0e, 0x0e, 0x0e, 0x7b, 0x00, 0x21, 0x01, 0x72, 0xd0, 0x49, 0x41, 0x60, + 0x18, 0x21, 0x71, 0xe0, 0x00, 0xf0, 0x08, 0xba, 0x00, 0x21, 0x01, 0x72, + 0xca, 0x49, 0x41, 0x60, 0x40, 0x21, 0x69, 0xe0, 0x00, 0x21, 0x01, 0x72, + 0xe8, 0x49, 0x41, 0x60, 0x06, 0x21, 0x63, 0xe0, 0x00, 0x21, 0x01, 0x72, + 0xcf, 0x49, 0x41, 0x60, 0x01, 0x21, 0x41, 0x80, 0x5e, 0xe0, 0x00, 0x21, + 0x01, 0x72, 0xd9, 0x49, 0x41, 0x60, 0xf8, 0x21, 0x56, 0xe0, 0x00, 0x21, + 0x01, 0x72, 0xe1, 0x49, 0x41, 0x60, 0x34, 0x21, 0x50, 0xe0, 0x00, 0x21, + 0x01, 0x72, 0xc7, 0x49, 0x41, 0x60, 0x0f, 0x21, 0x4a, 0xe0, 0x00, 0x21, + 0x01, 0x72, 0xc0, 0x49, 0x41, 0x60, 0x1c, 0x21, 0x44, 0xe0, 0x00, 0x21, + 0x01, 0x72, 0x24, 0x49, 0x41, 0x60, 0x08, 0x21, 0x3e, 0xe0, 0x00, 0x21, + 0x01, 0x72, 0xce, 0x49, 0x41, 0x60, 0xe4, 0x21, 0x38, 0xe0, 0x00, 0x21, + 0x01, 0x72, 0x04, 0x21, 0x41, 0x80, 0xb4, 0x49, 0x04, 0x31, 0x41, 0x60, + 0x31, 0xe0, 0x00, 0x21, 0x01, 0x72, 0xa8, 0x49, 0x41, 0x60, 0x84, 0x21, + 0x2a, 0xe0, 0x00, 0x21, 0x01, 0x72, 0xac, 0x49, 0x41, 0x60, 0x80, 0x21, + 0x24, 0xe0, 0x00, 0x21, 0x01, 0x72, 0xab, 0x49, 0x41, 0x60, 0x04, 0x21, + 0x1e, 0xe0, 0x00, 0x21, 0x01, 0x72, 0x10, 0x49, 0x41, 0x60, 0x0d, 0x21, + 0x18, 0xe0, 0x00, 0x21, 0x01, 0x72, 0xad, 0x49, 0x12, 0xe0, 0x00, 0x21, + 0x01, 0x72, 0xad, 0x49, 0x02, 0xe0, 0x00, 0x21, 0x01, 0x72, 0xad, 0x49, + 0x41, 0x60, 0x86, 0x21, 0x0a, 0xe0, 0x00, 0x21, 0x01, 0x72, 0xac, 0x49, + 0x41, 0x60, 0x3e, 0x21, 0x04, 0xe0, 0x00, 0x21, 0x01, 0x72, 0x8d, 0x49, + 0x41, 0x60, 0x0a, 0x21, 0x41, 0x80, 0x01, 0x21, 0x08, 0x46, 0x70, 0x47, + 0xa0, 0x2f, 0x06, 0x00, 0xf8, 0x2c, 0x06, 0x00, 0x70, 0xb5, 0x04, 0x46, + 0x0a, 0x28, 0x1b, 0xd0, 0x40, 0x2c, 0x1e, 0xd0, 0x41, 0x2c, 0x23, 0xd0, + 0x53, 0x2c, 0x28, 0xd0, 0x5f, 0x2c, 0x2d, 0xd0, 0x74, 0x2c, 0x31, 0xd0, + 0x9b, 0x2c, 0x36, 0xd0, 0xcd, 0x2c, 0x4f, 0xd0, 0xdc, 0x2c, 0x54, 0xd0, + 0xe1, 0x2c, 0x59, 0xd0, 0xe5, 0x2c, 0x60, 0xd1, 0x82, 0x49, 0x41, 0xf2, + 0xac, 0x00, 0x7d, 0x4a, 0xa0, 0x23, 0x08, 0x44, 0x20, 0x21, 0x56, 0xe0, + 0x2e, 0x48, 0xa0, 0x4a, 0x05, 0x21, 0x05, 0x23, 0x51, 0xe0, 0x2c, 0x48, + 0x94, 0x4a, 0xec, 0x21, 0xec, 0x23, 0x00, 0xf5, 0x05, 0x70, 0x4a, 0xe0, + 0x28, 0x48, 0x9c, 0x4a, 0x30, 0x21, 0x34, 0x23, 0x00, 0xf5, 0x40, 0x70, + 0x43, 0xe0, 0x25, 0x48, 0x81, 0x4a, 0x09, 0x21, 0x09, 0x23, 0x00, 0xf2, + 0xaa, 0x30, 0x3c, 0xe0, 0x22, 0x48, 0x91, 0x4a, 0xc0, 0x21, 0xc8, 0x23, + 0xf4, 0x30, 0x36, 0xe0, 0x1f, 0x48, 0x89, 0x4a, 0x1e, 0x21, 0x1e, 0x23, + 0x00, 0xf5, 0xdc, 0x70, 0x2f, 0xe0, 0x1b, 0x48, 0x73, 0x4d, 0x10, 0x21, + 0x1c, 0x23, 0x00, 0xf2, 0x64, 0x50, 0x2a, 0x46, 0xf5, 0xf7, 0x1c, 0xfb, + 0x17, 0x48, 0xeb, 0x7b, 0x2e, 0x7c, 0x6d, 0x7c, 0x90, 0xf8, 0x1c, 0x21, + 0x90, 0xf8, 0x17, 0x11, 0x90, 0xf8, 0x55, 0x01, 0x1a, 0x44, 0x6d, 0x4b, + 0x31, 0x44, 0x28, 0x44, 0x5a, 0x70, 0x99, 0x70, 0xd8, 0x70, 0x16, 0xe0, + 0x0e, 0x48, 0x74, 0x4a, 0x0c, 0x21, 0x0c, 0x23, 0x00, 0xf5, 0x35, 0x70, + 0x0d, 0xe0, 0x5a, 0x48, 0x76, 0x4a, 0xd8, 0x21, 0xe4, 0x23, 0x00, 0xf6, + 0xc4, 0x40, 0x06, 0xe0, 0x06, 0x48, 0x5d, 0x49, 0x04, 0x23, 0x0a, 0x1d, + 0x00, 0xf5, 0xf6, 0x60, 0x02, 0x21, 0xf5, 0xf7, 0xf3, 0xfa, 0x20, 0x46, + 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, 0x18, 0xb9, 0x8c, 0x7e, 0x08, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x70, 0xb5, 0x46, 0x48, 0x46, 0x4a, 0x47, 0x4e, + 0x0c, 0x21, 0x0c, 0x23, 0xb0, 0x47, 0x46, 0x48, 0x46, 0x4a, 0xa0, 0x21, + 0xa0, 0x23, 0xb0, 0x47, 0x45, 0x48, 0x46, 0x4a, 0x84, 0x21, 0x84, 0x23, + 0xb0, 0x47, 0x45, 0x4c, 0x01, 0x20, 0x46, 0x4a, 0x40, 0x21, 0x40, 0x23, + 0x84, 0xf8, 0xef, 0x02, 0x42, 0x48, 0xb0, 0x47, 0x43, 0x48, 0x44, 0x4a, + 0x18, 0x21, 0x18, 0x23, 0xb0, 0x47, 0x40, 0xf2, 0xff, 0x30, 0x43, 0x4a, + 0x80, 0x21, 0x80, 0x23, 0xa4, 0xf8, 0xde, 0x02, 0x3f, 0x48, 0xb0, 0x47, + 0x40, 0x4d, 0x41, 0x4a, 0x04, 0x21, 0x04, 0x23, 0x28, 0x46, 0xb0, 0x47, + 0x3f, 0x48, 0x40, 0x4a, 0x1c, 0x21, 0x1c, 0x23, 0xb0, 0x47, 0x3f, 0x48, + 0x3f, 0x4c, 0x0f, 0x23, 0x90, 0xf8, 0x17, 0x11, 0x90, 0xf8, 0x1c, 0x21, + 0x90, 0xf8, 0x55, 0x01, 0xe0, 0x70, 0x62, 0x70, 0x3b, 0x48, 0x3c, 0x4a, + 0xa1, 0x70, 0x0f, 0x21, 0xb0, 0x47, 0x3b, 0x48, 0x3b, 0x4a, 0x0a, 0x21, + 0x0a, 0x23, 0xb0, 0x47, 0x3a, 0x48, 0x3b, 0x4a, 0x86, 0x21, 0x86, 0x23, + 0xb0, 0x47, 0x3a, 0x48, 0x3a, 0x4a, 0x86, 0x21, 0x86, 0x23, 0xb0, 0x47, + 0x39, 0x48, 0x3a, 0x4a, 0x3e, 0x21, 0x3e, 0x23, 0xb0, 0x47, 0x39, 0x48, + 0x39, 0x4a, 0x20, 0x21, 0x20, 0x23, 0xb0, 0x47, 0x38, 0x48, 0x39, 0x4a, + 0xf8, 0x21, 0xf8, 0x23, 0xb0, 0x47, 0x38, 0x48, 0x38, 0x4a, 0x24, 0x21, + 0x24, 0x23, 0xb0, 0x47, 0x37, 0x48, 0x38, 0x4a, 0xe4, 0x21, 0xe4, 0x23, + 0xb0, 0x47, 0x37, 0x4a, 0x28, 0x1d, 0x04, 0x21, 0x04, 0x23, 0xb0, 0x47, + 0x35, 0x48, 0x36, 0x4a, 0xc8, 0x21, 0xc8, 0x23, 0xb0, 0x47, 0x35, 0x4d, + 0x35, 0x4a, 0x06, 0x21, 0x06, 0x23, 0xa8, 0x1d, 0xb0, 0x47, 0x34, 0x48, + 0x34, 0x4a, 0x34, 0x21, 0x34, 0x23, 0xb0, 0x47, 0x33, 0x4a, 0x20, 0x46, + 0x01, 0x21, 0x01, 0x23, 0xb0, 0x47, 0x32, 0x4a, 0x28, 0x46, 0x06, 0x21, + 0x06, 0x23, 0xb4, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0x60, 0x47, 0x00, 0xbf, + 0x80, 0x2c, 0x06, 0x00, 0x80, 0xbc, 0x02, 0x00, 0x4d, 0xcd, 0x11, 0x10, + 0xfc, 0x2d, 0x06, 0x00, 0x8c, 0xbc, 0x02, 0x00, 0x9c, 0x2e, 0x06, 0x00, + 0x2c, 0xbd, 0x02, 0x00, 0x00, 0x69, 0x08, 0x00, 0x8c, 0x2c, 0x06, 0x00, + 0xb0, 0xbd, 0x02, 0x00, 0xe4, 0x2d, 0x06, 0x00, 0xf0, 0xbd, 0x02, 0x00, + 0x20, 0x2f, 0x06, 0x00, 0x08, 0xbe, 0x02, 0x00, 0x8c, 0x32, 0x06, 0x00, + 0x88, 0xbe, 0x02, 0x00, 0xdc, 0x2c, 0x06, 0x00, 0x8c, 0xbe, 0x02, 0x00, + 0x50, 0x50, 0x00, 0x10, 0x94, 0x32, 0x06, 0x00, 0xcc, 0x2c, 0x06, 0x00, + 0xa8, 0xbe, 0x02, 0x00, 0xad, 0x2f, 0x06, 0x00, 0xb7, 0xbe, 0x02, 0x00, + 0xb8, 0x2f, 0x06, 0x00, 0xc2, 0xbe, 0x02, 0x00, 0x3e, 0x30, 0x06, 0x00, + 0x48, 0xbf, 0x02, 0x00, 0xc4, 0x30, 0x06, 0x00, 0xce, 0xbf, 0x02, 0x00, + 0x30, 0x32, 0x06, 0x00, 0x0c, 0xc0, 0x02, 0x00, 0x04, 0x31, 0x06, 0x00, + 0x2c, 0xc0, 0x02, 0x00, 0x50, 0x32, 0x06, 0x00, 0x24, 0xc1, 0x02, 0x00, + 0x00, 0x2d, 0x06, 0x00, 0x48, 0xc1, 0x02, 0x00, 0x2c, 0xc2, 0x02, 0x00, + 0xd0, 0x32, 0x06, 0x00, 0x84, 0xc3, 0x02, 0x00, 0x98, 0x32, 0x06, 0x00, + 0xd4, 0xd2, 0x05, 0x00, 0xfc, 0x31, 0x06, 0x00, 0x30, 0xc2, 0x02, 0x00, + 0x64, 0xc2, 0x02, 0x00, 0x65, 0xc2, 0x02, 0x00, 0xff, 0xf7, 0x12, 0xbf, + 0x08, 0x48, 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, 0x09, 0x49, 0x01, 0x60, + 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, 0x00, 0x78, 0x02, 0x38, + 0x03, 0x28, 0x28, 0xbf, 0xff, 0xf7, 0x02, 0xbf, 0x70, 0x47, 0x00, 0xbf, + 0x78, 0xa5, 0x08, 0x00, 0x49, 0xb9, 0x02, 0x00, 0x5c, 0x90, 0x08, 0x00, + 0xed, 0xb7, 0x02, 0x00, 0xb4, 0x1d, 0x01, 0x00, 0x25, 0xbc, 0x02, 0x00, + 0xdb, 0xf1, 0x01, 0x00, 0x45, 0xf2, 0x75, 0x3c, 0xc1, 0xf2, 0x00, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x47, 0xf6, 0x01, 0x2c, 0xc1, 0xf2, 0x00, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x33, 0x22, 0x11, 0x00, 0x77, 0x66, 0x55, 0x44, + 0x99, 0x88, 0x00, 0x00, 0x01, 0x32, 0xaa, 0x02, 0x05, 0x20, 0x28, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0xc8, 0x02, 0x32, + 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, + 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, + 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, + 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, + 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, + 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, + 0xb2, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, + 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, + 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, + 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, + 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, + 0x00, 0x00, 0x00, 0x0e, 0x0e, 0x10, 0x10, 0x10, 0x70, 0x17, 0x00, 0x00, + 0x03, 0xe0, 0x09, 0x00, 0x03, 0x20, 0x0b, 0x00, 0x07, 0x20, 0x0b, 0x00, + 0x0b, 0x20, 0x0b, 0x00, 0x0f, 0x20, 0x0b, 0x00, 0x17, 0x20, 0x0b, 0x00, + 0x1f, 0x20, 0x0b, 0x00, 0x27, 0x20, 0x8f, 0x00, 0x27, 0x20, 0x93, 0x0a, + 0x2b, 0x20, 0x9b, 0x13, 0x33, 0x20, 0x9f, 0x1b, 0x02, 0x21, 0x03, 0x24, + 0x03, 0x00, 0x08, 0x00, 0x03, 0x40, 0x08, 0x00, 0x03, 0x80, 0x08, 0x00, + 0x03, 0xc0, 0x08, 0x00, 0x03, 0xe0, 0x09, 0x00, 0x03, 0x20, 0x0b, 0x00, + 0x07, 0x20, 0x0b, 0x00, 0x0b, 0x20, 0x0b, 0x00, 0x0f, 0x20, 0x0b, 0x00, + 0x17, 0x20, 0x0b, 0x00, 0x1f, 0x20, 0x0b, 0x00, 0x27, 0x20, 0x8f, 0x00, + 0x27, 0x20, 0x93, 0x0a, 0x2b, 0x20, 0x9b, 0x13, 0x33, 0x20, 0x9f, 0x1b, + 0x02, 0x21, 0x03, 0x24, 0x03, 0x00, 0x08, 0x00, 0x03, 0x40, 0x08, 0x00, + 0x03, 0x80, 0x08, 0x00, 0x03, 0xc0, 0x08, 0x00, 0x00, 0x00, 0x07, 0x08, + 0x00, 0x10, 0x0e, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x48, 0x00, + 0x48, 0x00, 0xff, 0x08, 0x10, 0x10, 0x00, 0xff, 0x0c, 0x02, 0x60, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, 0x00, 0x01, 0x03, 0x05, + 0x07, 0x00, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x00, 0xff, 0x0a, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x03, 0x05, 0x05, 0x05, 0x07, 0x05, + 0x09, 0x05, 0x0b, 0x05, 0x0d, 0x05, 0x43, 0x05, 0x45, 0x05, 0x47, 0x05, + 0x49, 0x05, 0x4b, 0x05, 0x4d, 0x05, 0x82, 0x05, 0x84, 0x05, 0x86, 0x05, + 0x88, 0x05, 0x8a, 0x05, 0x8c, 0x05, 0x92, 0x05, 0x94, 0x05, 0x96, 0x05, + 0x98, 0x05, 0x9a, 0x05, 0x9c, 0x05, 0x92, 0x09, 0x94, 0x09, 0x96, 0x09, + 0x98, 0x09, 0x9a, 0x09, 0x9c, 0x09, 0x92, 0x0d, 0x94, 0x0d, 0x96, 0x0d, + 0x98, 0x0d, 0x9a, 0x0d, 0x9c, 0x0d, 0x91, 0x11, 0x93, 0x11, 0x95, 0x11, + 0x97, 0x11, 0x99, 0x11, 0x9b, 0x11, 0x92, 0x15, 0x94, 0x15, 0x96, 0x15, + 0x98, 0x15, 0x9a, 0x15, 0x9c, 0x15, 0x91, 0x19, 0x93, 0x19, 0x95, 0x19, + 0x97, 0x19, 0x99, 0x19, 0x9b, 0x19, 0xa1, 0x19, 0xa3, 0x19, 0xa5, 0x19, + 0xa7, 0x19, 0xa9, 0x19, 0xab, 0x19, 0xa2, 0x1d, 0xa4, 0x1d, 0xa6, 0x1d, + 0xa8, 0x1d, 0xaa, 0x1d, 0xac, 0x1d, 0xe3, 0x1d, 0x44, 0x01, 0x46, 0x01, + 0x48, 0x01, 0x4a, 0x01, 0x4c, 0x01, 0x4e, 0x01, 0x83, 0x01, 0x85, 0x01, + 0x87, 0x01, 0x89, 0x01, 0x8b, 0x01, 0x8d, 0x01, 0xc4, 0x01, 0xc6, 0x01, + 0xc8, 0x01, 0xca, 0x01, 0xcc, 0x01, 0xce, 0x01, 0xd4, 0x01, 0xd6, 0x01, + 0xd8, 0x01, 0xda, 0x01, 0xdc, 0x01, 0xde, 0x01, 0xe4, 0x01, 0xe6, 0x01, + 0xe8, 0x01, 0xea, 0x01, 0xec, 0x01, 0xee, 0x01, 0xe3, 0x05, 0xe5, 0x05, + 0xe7, 0x05, 0xe9, 0x05, 0xeb, 0x05, 0xed, 0x05, 0xe3, 0x09, 0xe5, 0x09, + 0xe7, 0x09, 0xe9, 0x09, 0xeb, 0x09, 0xed, 0x09, 0xe2, 0x0d, 0xe4, 0x0d, + 0xe6, 0x0d, 0xe8, 0x0d, 0xea, 0x0d, 0xec, 0x0d, 0xe1, 0x11, 0xe3, 0x11, + 0xe5, 0x11, 0xe7, 0x11, 0xe9, 0x11, 0xeb, 0x11, 0xe3, 0x15, 0xe5, 0x15, + 0xe7, 0x15, 0xe9, 0x15, 0xeb, 0x15, 0xed, 0x15, 0xe2, 0x19, 0xe4, 0x19, + 0xe6, 0x19, 0xe8, 0x19, 0xea, 0x19, 0xec, 0x19, 0xe3, 0x1d, 0x91, 0x11, + 0x93, 0x11, 0x95, 0x11, 0x97, 0x11, 0x99, 0x11, 0x9b, 0x11, 0x92, 0x15, + 0x94, 0x15, 0x96, 0x15, 0x98, 0x15, 0x9a, 0x15, 0x9c, 0x15, 0x91, 0x19, + 0x93, 0x19, 0x95, 0x19, 0x97, 0x19, 0x99, 0x19, 0x9b, 0x19, 0xa1, 0x19, + 0xa3, 0x19, 0xa5, 0x19, 0xa7, 0x19, 0xa9, 0x19, 0xab, 0x19, 0xa2, 0x1d, + 0xa4, 0x1d, 0xa6, 0x1d, 0xa8, 0x1d, 0xaa, 0x1d, 0xac, 0x1d, 0xe3, 0x1d, + 0x00, 0x09, 0xae, 0xb1, 0x21, 0x0f, 0x19, 0x0a, 0xab, 0x50, 0xfa, 0x14, + 0x00, 0x09, 0x05, 0x05, 0x12, 0x08, 0x1e, 0x0f, 0x05, 0xa9, 0xb1, 0x00, + 0x64, 0x00, 0x14, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08, 0x0a, + 0x0c, 0x0e, 0x10, 0x40, 0x12, 0x14, 0x16, 0x1e, 0x20, 0x22, 0x24, 0x28, + 0x2e, 0x32, 0x34, 0x38, 0x3a, 0x3c, 0x3e, 0x40, 0x42, 0x44, 0x48, 0x4a, + 0x4c, 0x4e, 0x50, 0x5a, 0x60, 0x66, 0x6e, 0x70, 0x72, 0x74, 0x76, 0x78, + 0x7a, 0xe6, 0x00, 0x00, 0x5e, 0x6b, 0x6b, 0x6b, 0x3e, 0xbe, 0x7b, 0x6d, + 0x7c, 0x7c, 0x7e, 0x46, 0x7a, 0x74, 0x76, 0x7a, 0x78, 0x76, 0x6e, 0x5a, + 0x5a, 0x00, 0x38, 0x00, 0xd0, 0x07, 0x20, 0x4e, 0x00, 0x00, 0x05, 0x01, + 0x38, 0x00, 0x41, 0x00, 0xa0, 0x00, 0x01, 0x04, 0x00, 0x61, 0x3c, 0x30, + 0x30, 0x20, 0x00, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, + 0x00, 0x12, 0x00, 0x00, 0x55, 0x65, 0x95, 0x55, 0x55, 0x45, 0x55, 0x55, + 0x55, 0x55, 0x55, 0x55, 0x55, 0x51, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0xe7, + 0x00, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x7f, 0x0f, 0xff, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0x03, 0x00, 0x00, 0x00, 0x76, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, + 0x30, 0x02, 0x04, 0x07, 0x90, 0x01, 0x60, 0x00, 0x1a, 0xff, 0x64, 0x32, + 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, 0x0f, 0x00, 0x14, 0x00, 0xd0, 0x07, + 0xfb, 0x03, 0x08, 0x04, 0x10, 0x08, 0x01, 0x02, 0x04, 0x06, 0x08, 0x0a, + 0x0c, 0x0e, 0x04, 0x28, 0x04, 0x06, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x16, 0x0f, 0x00, 0x84, 0x00, 0x25, 0x00, 0x84, 0x80, 0x1c, 0x00, + 0x44, 0x82, 0x18, 0x00, 0x44, 0x86, 0x18, 0x00, 0x44, 0x8a, 0x18, 0x00, + 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, + 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0xc4, 0x00, 0x25, 0x00, + 0x84, 0x00, 0x1d, 0x00, 0x84, 0x80, 0x14, 0x00, 0x44, 0x82, 0x18, 0x00, + 0x44, 0x86, 0x18, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, + 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, + 0x84, 0x00, 0x25, 0x00, 0x84, 0x80, 0x1c, 0x00, 0x44, 0x82, 0x18, 0x00, + 0x44, 0x86, 0x18, 0x00, 0x44, 0x8a, 0x18, 0x00, 0x14, 0x00, 0x10, 0x00, + 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, + 0x14, 0x00, 0x10, 0x00, 0xc4, 0x00, 0x25, 0x00, 0x84, 0x00, 0x1d, 0x00, + 0x84, 0x80, 0x14, 0x00, 0x44, 0x82, 0x18, 0x00, 0x44, 0x86, 0x18, 0x00, + 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, + 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x90, 0xa0, 0xb0, 0x0b, 0x11, 0x1b, + 0x2b, 0x45, 0x0b, 0x11, 0x1b, 0x2b, 0x45, 0xc4, 0xd6, 0xea, 0xf6, 0x00, + 0xb8, 0xcc, 0xde, 0xea, 0xf6, 0xc4, 0xd6, 0xea, 0xf6, 0x00, 0xb8, 0xcc, + 0xde, 0xea, 0xf6, 0x26, 0x4e, 0x76, 0x8e, 0xa6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0xc0, 0xc6, 0x2d, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x04, 0x00, 0x02, 0x96, + 0x01, 0x32, 0x32, 0x00, 0x01, 0x00, 0x00, 0x00, 0x55, 0xa9, 0xaa, 0xaa, + 0xaa, 0xaa, 0x96, 0xaa, 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0x00, + 0x8a, 0xaa, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc3, 0x00, 0x00, + 0x0c, 0x1c, 0x7d, 0x7f, 0xfc, 0x01, 0x01, 0x00, 0xe4, 0x07, 0x00, 0x00, + 0x05, 0x06, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00, + 0xe4, 0x07, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x22, 0x48, 0x02, 0x4a, + 0x2a, 0x21, 0x2a, 0x23, 0xf4, 0xf7, 0xc8, 0xbe, 0x58, 0xc3, 0x02, 0x00, + 0x80, 0xb5, 0x00, 0xf0, 0x53, 0xf8, 0xbd, 0xe8, 0x80, 0x40, 0xff, 0xf7, + 0xf1, 0xbf, 0x00, 0xbf, 0x90, 0xb1, 0x01, 0x88, 0x5f, 0x29, 0x11, 0xd0, + 0xfe, 0x29, 0x15, 0xd0, 0xcd, 0x29, 0x1b, 0xd0, 0xf3, 0x29, 0x1f, 0xd0, + 0x74, 0x29, 0x18, 0xbf, 0x00, 0xf0, 0x46, 0xb8, 0x00, 0x21, 0x01, 0x72, + 0x14, 0x49, 0x41, 0x60, 0x24, 0x21, 0x1a, 0xe0, 0x00, 0x20, 0x70, 0x47, + 0x00, 0x21, 0x01, 0x72, 0x0d, 0x49, 0x41, 0x60, 0xc8, 0x21, 0x12, 0xe0, + 0x00, 0x21, 0x01, 0x72, 0x06, 0x21, 0x41, 0x80, 0x08, 0x49, 0x06, 0x31, + 0x41, 0x60, 0x0b, 0xe0, 0x00, 0x21, 0x01, 0x72, 0x08, 0x49, 0x41, 0x60, + 0x20, 0x21, 0x04, 0xe0, 0x00, 0x21, 0x01, 0x72, 0x04, 0x49, 0x41, 0x60, + 0x2a, 0x21, 0x41, 0x80, 0x01, 0x20, 0x70, 0x47, 0x98, 0x32, 0x06, 0x00, + 0xd0, 0x32, 0x06, 0x00, 0xa4, 0x32, 0x06, 0x00, 0x30, 0x32, 0x06, 0x00, + 0x50, 0x32, 0x06, 0x00, 0x80, 0xb5, 0x04, 0x48, 0x04, 0x49, 0x01, 0x60, + 0xff, 0xf7, 0xae, 0xff, 0x03, 0x48, 0x04, 0x49, 0x01, 0x60, 0x80, 0xbd, + 0x38, 0x90, 0x08, 0x00, 0x95, 0xc2, 0x02, 0x00, 0x60, 0x90, 0x08, 0x00, + 0xa5, 0xc2, 0x02, 0x00, 0x44, 0xf6, 0xf5, 0x5c, 0xc1, 0xf2, 0x00, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x44, 0xf6, 0x19, 0x6c, 0xc1, 0xf2, 0x00, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, + 0xe0, 0x01, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0c, 0x00, + 0x05, 0x05, 0x05, 0x00, 0x01, 0x00, 0x80, 0x02, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x4f, 0x02, 0x00, 0x00, 0x10, 0x33, 0x73, 0x33, 0x33, 0x07, 0x00, + 0x02, 0x00, 0x01, 0x22, 0xd7, 0x03, 0xec, 0x01, 0xda, 0x00, 0x66, 0x06, + 0x33, 0x13, 0x90, 0x00, 0x00, 0x13, 0x36, 0x00, 0x21, 0x00, 0x07, 0x40, + 0x00, 0x28, 0x00, 0x00, 0x10, 0x01, 0x14, 0x64, 0x0a, 0x00, 0x72, 0x01, + 0x2b, 0x2b, 0x44, 0x4a, 0x47, 0x45, 0x45, 0x45, 0x43, 0x44, 0x58, 0x57, + 0x55, 0x54, 0x5a, 0x59, 0x25, 0x40, 0x28, 0x28, 0x39, 0x3d, 0x39, 0x3a, + 0x3a, 0x3a, 0x38, 0x39, 0x44, 0x44, 0x43, 0x42, 0x45, 0x45, 0x24, 0x36, + 0x19, 0x48, 0x40, 0x00, 0x20, 0x40, 0x0a, 0x00, 0x72, 0x06, 0x2c, 0x01, + 0x03, 0x40, 0x06, 0x00, 0x00, 0x04, 0x00, 0x00, 0x05, 0x03, 0x01, 0x00, + 0x02, 0x00, 0x10, 0x00, 0x07, 0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0xc0, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x14, 0x35, 0x09, 0x01, + 0x00, 0x00, 0x00, 0x90, 0x32, 0x38, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, + 0x00, 0x02, 0x04, 0x03, 0x03, 0x06, 0x00, 0x01, 0x51, 0x32, 0xd0, 0x0d, + 0xb2, 0x26, 0xf2, 0x08, 0x0e, 0x05, 0x84, 0x06, 0x8e, 0x12, 0xdb, 0x06, + 0x5e, 0x01, 0xd6, 0x03, 0xb0, 0x02, 0x2e, 0x00, 0x45, 0x00, 0x67, 0x00, + 0x9a, 0x00, 0xe7, 0x00, 0x14, 0x00, 0x90, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x46, + 0x00, 0xf0, 0xfc, 0xf8, 0x00, 0xb1, 0x10, 0xbd, 0x4c, 0x49, 0x4f, 0xf6, + 0x0a, 0x43, 0xb1, 0xf8, 0x7c, 0x20, 0x9a, 0x42, 0xf7, 0xd1, 0xe2, 0x78, + 0x0a, 0x2a, 0xf4, 0xd1, 0x91, 0xf8, 0x79, 0x20, 0x0a, 0x2a, 0x06, 0xd0, + 0x02, 0x2a, 0xee, 0xd1, 0xe2, 0x7f, 0xd2, 0x09, 0x81, 0xf8, 0x98, 0x20, + 0x10, 0xbd, 0x94, 0xf8, 0x22, 0x10, 0x01, 0xf0, 0x03, 0x01, 0x03, 0x29, + 0x02, 0x49, 0x14, 0xbf, 0x00, 0x22, 0x01, 0x22, 0x0a, 0x70, 0x10, 0xbd, + 0x84, 0xe4, 0x05, 0x00, 0x7c, 0xb5, 0x06, 0x9d, 0x00, 0x95, 0x00, 0xf0, + 0xd9, 0xf8, 0x04, 0x46, 0x08, 0xb1, 0x20, 0x46, 0x7c, 0xbd, 0x0d, 0x4e, + 0x05, 0xeb, 0x85, 0x05, 0x56, 0xf8, 0x35, 0x00, 0x00, 0x28, 0xf6, 0xd0, + 0x01, 0x78, 0x00, 0x29, 0xf3, 0xd1, 0x32, 0x49, 0x91, 0xf8, 0x79, 0x10, + 0x00, 0x29, 0xee, 0xd1, 0x06, 0x49, 0x0a, 0x68, 0x08, 0x21, 0x90, 0x47, + 0x00, 0x28, 0xe8, 0xd0, 0x06, 0xeb, 0xc5, 0x00, 0x40, 0xf2, 0x53, 0x11, + 0xc1, 0x82, 0xe2, 0xe7, 0x40, 0x01, 0x00, 0x00, 0x0c, 0xbb, 0x08, 0x00, + 0x70, 0xb5, 0x04, 0x46, 0x00, 0x78, 0x26, 0x4e, 0x61, 0x78, 0x40, 0xea, + 0x01, 0x25, 0xa6, 0xf8, 0x7c, 0x50, 0xe0, 0x78, 0xa6, 0xf8, 0x7e, 0x00, + 0x48, 0x48, 0x00, 0x78, 0x01, 0x28, 0x17, 0xd1, 0x20, 0x48, 0x21, 0x49, + 0x22, 0x22, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0xe0, 0xb1, 0xe0, 0x78, + 0x13, 0x28, 0x1a, 0xd1, 0x1d, 0x48, 0x90, 0xf8, 0x62, 0x00, 0x48, 0xb1, + 0x21, 0x79, 0x06, 0xf1, 0x29, 0x02, 0x00, 0x23, 0x16, 0x78, 0xae, 0xb9, + 0x01, 0x33, 0x30, 0x32, 0x83, 0x42, 0xf9, 0xd3, 0xa9, 0xb2, 0x02, 0x20, + 0x0c, 0x22, 0xfa, 0xf7, 0xc9, 0xfb, 0x28, 0xb1, 0xe1, 0x78, 0x81, 0x71, + 0xbd, 0xe8, 0x70, 0x40, 0xfa, 0xf7, 0x98, 0xbb, 0x70, 0xbd, 0x20, 0x46, + 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, 0x82, 0xb8, 0x0e, 0x48, 0x00, 0x7a, + 0x18, 0xb1, 0x0e, 0x48, 0x00, 0x78, 0x80, 0x07, 0x01, 0xd4, 0x0c, 0x22, + 0x09, 0xe0, 0x39, 0xb1, 0x02, 0x29, 0x05, 0xd8, 0x0a, 0x48, 0x02, 0x68, + 0x60, 0x1d, 0x90, 0x47, 0x00, 0x22, 0x00, 0xe0, 0x12, 0x22, 0xa9, 0xb2, + 0x02, 0x20, 0xda, 0xe7, 0x4c, 0x49, 0x01, 0x00, 0x58, 0x9c, 0x08, 0x00, + 0xb2, 0x2f, 0x04, 0x10, 0x40, 0x86, 0x08, 0x00, 0xa8, 0x35, 0x01, 0x00, + 0xa4, 0x5a, 0x01, 0x00, 0x20, 0xe2, 0x08, 0x00, 0xb0, 0xb5, 0x1f, 0x4a, + 0x04, 0x46, 0x00, 0x78, 0x61, 0x78, 0x12, 0x78, 0x01, 0x2a, 0x12, 0xd1, + 0xe2, 0x78, 0x40, 0xea, 0x01, 0x21, 0x02, 0x2a, 0x17, 0xd0, 0x01, 0x2a, + 0x24, 0xd1, 0xc6, 0x20, 0x00, 0x22, 0xfa, 0xf7, 0x85, 0xfb, 0x50, 0xb3, + 0x05, 0x46, 0xe0, 0x78, 0xa8, 0x71, 0x28, 0x46, 0x01, 0xf0, 0xba, 0xff, + 0x1e, 0xe0, 0x40, 0xea, 0x01, 0x21, 0x02, 0x20, 0x0c, 0x22, 0xfa, 0xf7, + 0x77, 0xfb, 0xe0, 0xb1, 0xe1, 0x78, 0x81, 0x71, 0x15, 0xe0, 0x04, 0x20, + 0x00, 0x22, 0xfa, 0xf7, 0x6f, 0xfb, 0xa0, 0xb1, 0x05, 0x46, 0x20, 0x46, + 0x02, 0xf0, 0x1a, 0xf8, 0xe1, 0x78, 0xe8, 0x71, 0xa9, 0x71, 0x01, 0x0a, + 0x29, 0x72, 0x05, 0xe0, 0x02, 0x20, 0x01, 0x22, 0xfa, 0xf7, 0x60, 0xfb, + 0x05, 0x46, 0x20, 0xb1, 0x28, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0xfa, 0xf7, + 0x2f, 0xbb, 0xb0, 0xbd, 0x48, 0x49, 0x01, 0x00, 0x03, 0x48, 0x04, 0x49, + 0x01, 0x60, 0x04, 0x48, 0x04, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x6c, 0xd9, 0x08, 0x00, 0x9d, 0xc4, 0x02, 0x00, 0x5c, 0xe2, 0x08, 0x00, + 0x4d, 0xc4, 0x02, 0x00, 0x42, 0xf2, 0x91, 0x2c, 0xc1, 0xf2, 0x04, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf2, 0x51, 0x3c, 0xc1, 0xf2, 0x04, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf6, 0x11, 0x3c, 0xc1, 0xf2, 0x04, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xb0, 0xb5, 0x0c, 0x46, 0x05, 0x46, 0x00, 0xf0, + 0xc5, 0xfe, 0x03, 0x28, 0x18, 0xbf, 0xb0, 0xbd, 0x03, 0x48, 0x21, 0x46, + 0x02, 0x68, 0x28, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x10, 0x47, 0x00, 0xbf, + 0x80, 0xaf, 0x08, 0x00, 0xd0, 0xf8, 0xbc, 0x05, 0x13, 0x23, 0x90, 0xf8, + 0x3e, 0x00, 0xc0, 0xf1, 0x05, 0x02, 0x12, 0xfb, 0x03, 0xf2, 0x8a, 0x42, + 0x01, 0xdd, 0x01, 0x30, 0x09, 0xe0, 0x06, 0x4b, 0x1b, 0x89, 0x1a, 0x44, + 0x8a, 0x42, 0x04, 0xda, 0x41, 0x1e, 0x08, 0xbf, 0x01, 0x46, 0xc8, 0xb2, + 0x70, 0x47, 0xc0, 0xb2, 0x70, 0x47, 0x00, 0xbf, 0xda, 0xd2, 0x05, 0x00, + 0x2d, 0xe9, 0xf8, 0x43, 0x07, 0x46, 0x72, 0x48, 0x98, 0x46, 0x91, 0x46, + 0x0e, 0x46, 0x3c, 0x0c, 0x00, 0x68, 0x80, 0x47, 0x01, 0x28, 0x1b, 0xd1, + 0x6e, 0x48, 0xb9, 0xb2, 0x6e, 0x4f, 0x05, 0x22, 0x04, 0x23, 0x00, 0xf5, + 0xd5, 0x60, 0x37, 0xf8, 0x13, 0x50, 0xa9, 0x42, 0x0b, 0xd8, 0x30, 0xf8, + 0x06, 0x5c, 0xac, 0x42, 0x07, 0xd8, 0x50, 0xf8, 0x04, 0x5c, 0xae, 0x42, + 0x03, 0xd8, 0x05, 0x68, 0xa9, 0x45, 0x40, 0xf2, 0xc2, 0x80, 0x0c, 0x38, + 0x01, 0x3b, 0x01, 0x3a, 0xeb, 0xd1, 0x13, 0xe0, 0x60, 0x48, 0x05, 0x27, + 0x05, 0x21, 0x00, 0xf5, 0xd5, 0x60, 0x30, 0xf8, 0x06, 0x2c, 0x94, 0x42, + 0x06, 0xd8, 0x50, 0xf8, 0x04, 0x2c, 0x96, 0x42, 0x02, 0xd8, 0x02, 0x68, + 0x91, 0x45, 0x04, 0xd9, 0x0c, 0x38, 0x01, 0x3f, 0x01, 0x39, 0xf0, 0xd1, + 0x01, 0x27, 0xd2, 0x48, 0x81, 0x89, 0x40, 0x46, 0xff, 0xf7, 0xa2, 0xff, + 0xf9, 0xb2, 0x00, 0x22, 0x88, 0x42, 0xd2, 0x49, 0x38, 0xbf, 0x01, 0x22, + 0x8a, 0x70, 0x38, 0xbf, 0x07, 0x46, 0xf8, 0xb2, 0x05, 0x28, 0x0e, 0xd1, + 0xb8, 0xf8, 0x3e, 0x04, 0x42, 0xf2, 0x04, 0x22, 0x10, 0x42, 0x01, 0xd0, + 0x05, 0x27, 0x06, 0xe0, 0x49, 0x48, 0x04, 0x27, 0x90, 0xf8, 0xae, 0x06, + 0x00, 0x28, 0x08, 0xbf, 0x05, 0x27, 0xc3, 0x48, 0x02, 0x7a, 0x2a, 0xb1, + 0xd8, 0xf8, 0xbc, 0x25, 0x92, 0xf8, 0x44, 0x20, 0x92, 0x07, 0x09, 0xd4, + 0xfa, 0xb2, 0x04, 0x2a, 0x1b, 0xd3, 0x44, 0x4a, 0x92, 0xf8, 0x2f, 0x22, + 0x00, 0x2a, 0x18, 0xbf, 0x03, 0x27, 0x14, 0xe0, 0xfa, 0xb2, 0x04, 0x2a, + 0x11, 0xd3, 0x3d, 0x4a, 0x12, 0x7d, 0x22, 0xb1, 0x39, 0x4a, 0x92, 0xf8, + 0xaf, 0x26, 0xd2, 0x07, 0x08, 0xd1, 0x3a, 0x4a, 0x12, 0x7b, 0x00, 0x2a, + 0xe9, 0xd0, 0x35, 0x4a, 0x92, 0xf8, 0xaf, 0x26, 0x92, 0x07, 0xe4, 0xd5, + 0x03, 0x27, 0x32, 0x4a, 0x92, 0xf8, 0xec, 0x22, 0x1a, 0xb1, 0x34, 0x4a, + 0x92, 0xf8, 0xfe, 0x26, 0x32, 0xb9, 0x33, 0x4a, 0x92, 0xf8, 0x3e, 0x26, + 0xaa, 0xb1, 0x49, 0x79, 0x01, 0x29, 0x12, 0xd1, 0x30, 0x49, 0x91, 0xf8, + 0x79, 0x20, 0xf9, 0xb2, 0x02, 0x29, 0x07, 0xd3, 0x01, 0x24, 0x04, 0x2a, + 0x0a, 0xd0, 0x0a, 0x2a, 0x04, 0xd0, 0x40, 0x2a, 0x05, 0xd1, 0x05, 0xe0, + 0x0a, 0x2a, 0x02, 0xd1, 0x03, 0x29, 0x28, 0xbf, 0x03, 0x27, 0x3c, 0x46, + 0xd8, 0xf8, 0xbc, 0x15, 0x02, 0x23, 0xe4, 0xb2, 0x91, 0xf8, 0x3e, 0x20, + 0x03, 0x2a, 0x88, 0xbf, 0x01, 0x23, 0x83, 0x72, 0x94, 0x42, 0x01, 0xd2, + 0x00, 0x20, 0x03, 0xe0, 0x05, 0x2a, 0x19, 0xd1, 0x00, 0x20, 0x05, 0x22, + 0xd5, 0xb2, 0xac, 0x42, 0x12, 0xd8, 0x01, 0x2d, 0x10, 0xd0, 0x91, 0xf8, + 0x43, 0x60, 0x01, 0x36, 0x81, 0xf8, 0x43, 0x60, 0xf6, 0xb2, 0x9e, 0x42, + 0x08, 0xd3, 0xac, 0x42, 0x06, 0xd2, 0x00, 0x20, 0xa1, 0xf8, 0x42, 0x00, + 0x50, 0x1e, 0x81, 0xf8, 0x3e, 0x00, 0x01, 0x20, 0xbd, 0xe8, 0xf8, 0x83, + 0x91, 0xf8, 0x42, 0x50, 0xc0, 0x7a, 0x01, 0x35, 0x81, 0xf8, 0x42, 0x50, + 0xed, 0xb2, 0x85, 0x42, 0xd8, 0xd3, 0x00, 0x20, 0x94, 0x42, 0xdb, 0xd9, + 0xa1, 0xf8, 0x42, 0x00, 0x01, 0x32, 0x01, 0x20, 0x81, 0xf8, 0x3e, 0x20, + 0xd4, 0xe7, 0x5f, 0x1c, 0x55, 0xe7, 0x00, 0xbf, 0x74, 0xcf, 0x08, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0xe4, 0x05, 0x01, 0x00, 0x7c, 0x5c, 0x01, 0x00, + 0x24, 0x5c, 0x01, 0x00, 0x38, 0x21, 0x01, 0x00, 0x64, 0xd4, 0x05, 0x00, + 0x4c, 0x49, 0x01, 0x00, 0x2d, 0xe9, 0xff, 0x41, 0xd0, 0xb3, 0x04, 0x46, + 0xd0, 0xf8, 0xbc, 0x05, 0xb0, 0xb3, 0x00, 0xf0, 0xa1, 0xfd, 0x30, 0x48, + 0x21, 0x46, 0x02, 0x68, 0x01, 0xa8, 0x90, 0x47, 0x2e, 0x48, 0x01, 0xaa, + 0x23, 0x46, 0x05, 0x68, 0x07, 0xca, 0xa8, 0x47, 0x6b, 0x4f, 0x05, 0x46, + 0x38, 0x7a, 0x38, 0xb1, 0xd4, 0xf8, 0xbc, 0x05, 0x90, 0xf8, 0x44, 0x10, + 0xc9, 0x07, 0x18, 0xbf, 0x00, 0x2d, 0x1f, 0xd1, 0x01, 0xa9, 0x28, 0x46, + 0x22, 0x46, 0x00, 0xf0, 0x4b, 0xf8, 0xd4, 0xf8, 0xbc, 0x05, 0x00, 0x25, + 0xc5, 0x86, 0xc0, 0xe9, 0x05, 0x55, 0xf4, 0xf7, 0x7f, 0xfb, 0xd4, 0xf8, + 0xbc, 0x15, 0x0a, 0x23, 0x8d, 0x87, 0xc1, 0xe9, 0x07, 0x55, 0x4d, 0x62, + 0x3a, 0x88, 0x52, 0x01, 0xb2, 0xfb, 0xf3, 0xf2, 0x10, 0x44, 0x20, 0xf0, + 0x70, 0x40, 0x08, 0x61, 0x00, 0xf0, 0x72, 0xfd, 0xbd, 0xe8, 0xff, 0x81, + 0x06, 0x69, 0x70, 0x1c, 0xdc, 0xd0, 0xf4, 0xf7, 0x67, 0xfb, 0x30, 0x1a, + 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0xd4, 0xd9, 0x38, 0x88, + 0x0a, 0x21, 0x40, 0x01, 0xb0, 0xfb, 0xf1, 0xf6, 0xf4, 0xf7, 0x5a, 0xfb, + 0xd4, 0xf8, 0xbc, 0x15, 0x0a, 0x69, 0x8b, 0x69, 0xc9, 0x6a, 0x80, 0x1a, + 0xda, 0x00, 0x30, 0x44, 0x00, 0xeb, 0x80, 0x00, 0xc0, 0xf3, 0x0f, 0x10, + 0xb2, 0xfb, 0xf0, 0xf8, 0x06, 0x48, 0x06, 0x68, 0x08, 0x46, 0xfd, 0xf7, + 0xb3, 0xff, 0x01, 0x46, 0x20, 0x46, 0x42, 0x46, 0xb0, 0x47, 0xb5, 0xe7, + 0xe4, 0xa3, 0x08, 0x00, 0xe8, 0xa3, 0x08, 0x00, 0xe0, 0xa3, 0x08, 0x00, + 0x2d, 0xe9, 0xf8, 0x43, 0xd2, 0xf8, 0xbc, 0xe5, 0x91, 0x46, 0x03, 0x22, + 0x80, 0x46, 0x8e, 0xf8, 0x41, 0x20, 0x37, 0x4a, 0x13, 0x68, 0x96, 0x6a, + 0x4b, 0x45, 0x18, 0xbf, 0x1e, 0x46, 0xbe, 0xb1, 0xd6, 0xf8, 0xbc, 0x25, + 0x92, 0xf8, 0x41, 0x30, 0x93, 0xb1, 0x03, 0x2b, 0x55, 0xd1, 0xdf, 0xf8, + 0xc4, 0xc0, 0x92, 0xf8, 0x3e, 0x20, 0x9e, 0xf8, 0x3e, 0x70, 0x9c, 0xf8, + 0x0e, 0x30, 0x97, 0x42, 0x4d, 0xd9, 0x93, 0x42, 0x1c, 0xbf, 0x8c, 0xf8, + 0x0e, 0x20, 0x4f, 0xf0, 0x01, 0x08, 0x04, 0xe0, 0x9e, 0xf8, 0x3e, 0x20, + 0x27, 0x4b, 0x00, 0x26, 0x9a, 0x73, 0x0f, 0x46, 0x25, 0x4b, 0x97, 0xe8, + 0x31, 0x00, 0x25, 0x4f, 0x31, 0xc3, 0x38, 0x7a, 0x78, 0xb3, 0x9e, 0xf8, + 0x44, 0x00, 0x80, 0x07, 0x2b, 0xd5, 0x22, 0x48, 0x89, 0x78, 0x03, 0x68, + 0x48, 0x46, 0x98, 0x47, 0x20, 0x49, 0x08, 0x78, 0x01, 0x30, 0x08, 0x70, + 0xc0, 0xb2, 0x09, 0x28, 0x0c, 0xd8, 0xb8, 0xf1, 0x00, 0x0f, 0x09, 0xd1, + 0xd9, 0xf8, 0xbc, 0xe5, 0xf8, 0x7a, 0x9e, 0xf8, 0x42, 0x20, 0x82, 0x42, + 0x15, 0xd3, 0x19, 0x48, 0x80, 0x78, 0x90, 0xb1, 0x00, 0x20, 0x13, 0x4b, + 0x00, 0x22, 0x08, 0x70, 0x16, 0x48, 0x01, 0x21, 0x04, 0x68, 0x10, 0x20, + 0x00, 0x90, 0x40, 0xf6, 0x07, 0x10, 0xa0, 0x47, 0x13, 0x48, 0x12, 0x21, + 0x00, 0x78, 0xf4, 0xf7, 0xe5, 0xfa, 0xd9, 0xf8, 0xbc, 0xe5, 0x04, 0x21, + 0x8e, 0xf8, 0x41, 0x10, 0x1e, 0xb1, 0xd6, 0xf8, 0xbc, 0x05, 0x80, 0xf8, + 0x41, 0x10, 0xbd, 0xe8, 0xf8, 0x83, 0xbb, 0x42, 0x1c, 0xbf, 0x8c, 0xf8, + 0x0e, 0x70, 0x4f, 0xf0, 0x01, 0x08, 0x3a, 0x46, 0xb5, 0xe7, 0x00, 0xbf, + 0x40, 0x01, 0x00, 0x00, 0xa4, 0x4a, 0x01, 0x00, 0xa8, 0x35, 0x01, 0x00, + 0x5c, 0xaf, 0x08, 0x00, 0xb5, 0x4a, 0x01, 0x00, 0x48, 0xdc, 0x05, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0x66, 0x34, 0x01, 0x00, 0x70, 0xb5, 0x04, 0x46, + 0x90, 0xf8, 0x88, 0x04, 0x80, 0x07, 0x00, 0xd4, 0x70, 0xbd, 0x94, 0xf8, + 0xa4, 0x04, 0x41, 0x07, 0x01, 0xd5, 0x00, 0x07, 0xf8, 0xd5, 0x94, 0xf8, + 0xf5, 0x04, 0x40, 0xbb, 0x43, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0x18, 0xbb, 0x94, 0xf8, 0xf4, 0x04, 0x00, 0xbb, 0xd4, 0xf8, 0x04, 0x05, + 0x80, 0xb1, 0xf4, 0xf7, 0x97, 0xfa, 0xd4, 0xf8, 0x04, 0x15, 0x40, 0x1a, + 0x3c, 0x49, 0x08, 0x40, 0xb0, 0xf5, 0xc8, 0x5f, 0x06, 0xd3, 0x3b, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x01, 0x20, 0x84, 0xf8, 0xf4, 0x04, + 0x38, 0x48, 0x90, 0xf8, 0x4d, 0x00, 0x02, 0x28, 0x07, 0xd3, 0x40, 0xf2, + 0x59, 0x10, 0xc4, 0xf8, 0x0c, 0x05, 0x35, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x34, 0x48, 0x01, 0x68, 0x14, 0x20, 0x88, 0x47, 0xd4, 0xf8, + 0xbc, 0x05, 0x00, 0x28, 0x4f, 0xd0, 0x31, 0x48, 0x05, 0x68, 0xf4, 0xf7, + 0x6f, 0xfa, 0x28, 0x1a, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, + 0x03, 0xd9, 0x70, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xd4, 0xf8, + 0xbc, 0x05, 0x05, 0x69, 0xf4, 0xf7, 0x60, 0xfa, 0x28, 0x1a, 0x20, 0xf0, + 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x36, 0xd9, 0x67, 0x48, 0x02, 0x68, + 0xd4, 0xf8, 0xbc, 0x05, 0xc1, 0x6a, 0x20, 0x46, 0x90, 0x47, 0xd4, 0xf8, + 0xbc, 0x65, 0x05, 0x46, 0x64, 0x49, 0xf0, 0x62, 0x02, 0x20, 0x86, 0xf8, + 0x41, 0x00, 0x30, 0x6b, 0xf6, 0xf7, 0x06, 0xfc, 0x4f, 0xf0, 0x76, 0x51, + 0xf6, 0xf7, 0x02, 0xfc, 0x04, 0x46, 0xf0, 0x8e, 0xf6, 0xf7, 0x0a, 0xfc, + 0x4f, 0xf0, 0x76, 0x51, 0xf6, 0xf7, 0xfa, 0xfb, 0x01, 0x46, 0x20, 0x46, + 0xf6, 0xf7, 0xfc, 0xfb, 0x01, 0x46, 0x30, 0x63, 0x28, 0x46, 0xf6, 0xf7, + 0xf7, 0xfb, 0x57, 0x49, 0x04, 0x46, 0x28, 0x46, 0xf6, 0xf7, 0xec, 0xfb, + 0x21, 0x46, 0xf6, 0xf7, 0xfb, 0xfb, 0xfd, 0xf7, 0x95, 0xfe, 0x70, 0x61, + 0x52, 0x48, 0x22, 0x21, 0x00, 0x78, 0xf4, 0xf7, 0x2f, 0xfa, 0x0a, 0x48, + 0x01, 0x68, 0x14, 0x20, 0xbd, 0xe8, 0x70, 0x40, 0x08, 0x47, 0x00, 0xbf, + 0x54, 0x9d, 0x08, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x38, 0xa2, 0x08, 0x00, + 0x18, 0x74, 0x01, 0x00, 0x00, 0xe2, 0x08, 0x00, 0x40, 0x9d, 0x08, 0x00, + 0xac, 0x76, 0x01, 0x00, 0x44, 0x9d, 0x08, 0x00, 0xf8, 0xb5, 0x68, 0xb1, + 0x04, 0x46, 0x90, 0xf8, 0x88, 0x04, 0x80, 0x07, 0x08, 0xd5, 0xd4, 0xf8, + 0xbc, 0x05, 0x28, 0xb1, 0x94, 0xf8, 0xa4, 0x04, 0x41, 0x07, 0x02, 0xd5, + 0x00, 0x07, 0x00, 0xd4, 0xf8, 0xbd, 0x37, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0xfb, 0x4e, 0x35, 0x4d, 0x20, 0x46, 0x71, 0x68, 0x2a, 0x68, + 0x90, 0x47, 0x70, 0x60, 0x36, 0x68, 0xf4, 0xf7, 0xed, 0xf9, 0x30, 0x1a, + 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x03, 0xd9, 0x2f, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xd4, 0xf8, 0xbc, 0x05, 0x06, 0x69, + 0xf4, 0xf7, 0xde, 0xf9, 0x30, 0x1a, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, + 0x00, 0x6f, 0x35, 0xd9, 0xd4, 0xf8, 0xbc, 0x05, 0x2a, 0x68, 0xc1, 0x6a, + 0x20, 0x46, 0x90, 0x47, 0xd4, 0xf8, 0xbc, 0x75, 0x05, 0x46, 0x24, 0x49, + 0xf8, 0x62, 0x02, 0x20, 0x87, 0xf8, 0x41, 0x00, 0x38, 0x6b, 0xf6, 0xf7, + 0x85, 0xfb, 0x4f, 0xf0, 0x76, 0x51, 0xf6, 0xf7, 0x81, 0xfb, 0x06, 0x46, + 0xf8, 0x8e, 0xf6, 0xf7, 0x89, 0xfb, 0x4f, 0xf0, 0x76, 0x51, 0xf6, 0xf7, + 0x79, 0xfb, 0x01, 0x46, 0x30, 0x46, 0xf6, 0xf7, 0x7b, 0xfb, 0x01, 0x46, + 0x38, 0x63, 0x28, 0x46, 0xf6, 0xf7, 0x76, 0xfb, 0x16, 0x49, 0x06, 0x46, + 0x28, 0x46, 0xf6, 0xf7, 0x6b, 0xfb, 0x31, 0x46, 0xf6, 0xf7, 0x7a, 0xfb, + 0xfd, 0xf7, 0x14, 0xfe, 0x78, 0x61, 0x12, 0x48, 0x22, 0x21, 0x00, 0x78, + 0xf4, 0xf7, 0xae, 0xf9, 0x94, 0xf8, 0x33, 0x04, 0xc1, 0x07, 0xa1, 0xd0, + 0x80, 0x07, 0x9f, 0xd5, 0xf4, 0xf7, 0x9a, 0xf9, 0x05, 0x46, 0x20, 0x46, + 0x00, 0xf0, 0xa0, 0xfb, 0xd4, 0xf8, 0xbc, 0x15, 0x28, 0x1a, 0x20, 0xf0, + 0x70, 0x40, 0xca, 0x69, 0x10, 0x44, 0xc8, 0x61, 0xf8, 0xbd, 0x00, 0xbf, + 0x30, 0xa2, 0x08, 0x00, 0x34, 0xa2, 0x08, 0x00, 0x2c, 0xa2, 0x08, 0x00, + 0x00, 0x00, 0x70, 0x41, 0x00, 0x00, 0xc8, 0x42, 0x67, 0x34, 0x01, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x85, 0xb0, 0x82, 0x46, 0xbc, 0x48, 0x89, 0x46, + 0x01, 0x68, 0x50, 0x46, 0x88, 0x47, 0xbb, 0x49, 0x01, 0xf1, 0x0e, 0x07, + 0xba, 0x49, 0x01, 0xf1, 0x4d, 0x05, 0xcd, 0xe9, 0x03, 0x75, 0xd0, 0xb1, + 0xb8, 0x48, 0x01, 0x68, 0x50, 0x46, 0x88, 0x47, 0x00, 0x28, 0x00, 0xf0, + 0x84, 0x80, 0x84, 0x46, 0x64, 0x20, 0xbb, 0x79, 0x3a, 0x79, 0x0c, 0xfb, + 0x00, 0xf0, 0xb0, 0xfb, 0xf3, 0xf1, 0x33, 0x2a, 0x39, 0xd8, 0x0b, 0x22, + 0xa1, 0xf1, 0x0a, 0x08, 0x13, 0xfb, 0x02, 0xf2, 0x90, 0x42, 0x38, 0xbf, + 0x4f, 0xf0, 0x00, 0x08, 0x73, 0xe0, 0x28, 0x78, 0x02, 0x28, 0x32, 0xd3, + 0xdf, 0xf8, 0xac, 0xb2, 0xab, 0x4d, 0xdf, 0xf8, 0xa4, 0x82, 0x00, 0x27, + 0x00, 0x26, 0x0b, 0xeb, 0x47, 0x01, 0xb1, 0xf8, 0x48, 0x16, 0x01, 0xeb, + 0x41, 0x01, 0x55, 0xf8, 0x21, 0x10, 0x09, 0x6a, 0xb9, 0xb1, 0xb8, 0xf8, + 0x1e, 0x05, 0x03, 0x30, 0x20, 0xf0, 0x03, 0x00, 0x0a, 0x18, 0x08, 0x5c, + 0x51, 0x78, 0x93, 0x78, 0xd2, 0x78, 0x40, 0xea, 0x01, 0x20, 0x40, 0xea, + 0x03, 0x40, 0x40, 0xea, 0x02, 0x64, 0xf4, 0xf7, 0x2d, 0xf9, 0x00, 0x1b, + 0x20, 0xf0, 0x70, 0x40, 0x06, 0x44, 0x04, 0x98, 0x00, 0x78, 0x01, 0x37, + 0x87, 0x42, 0xda, 0xd3, 0x20, 0xe0, 0x03, 0x20, 0xb2, 0xfb, 0xf0, 0xf0, + 0x01, 0xeb, 0x00, 0x08, 0x3d, 0xe0, 0xda, 0xf8, 0x20, 0x00, 0xb0, 0xb1, + 0x8f, 0x49, 0xb1, 0xf8, 0x1e, 0x15, 0x03, 0x31, 0x21, 0xf0, 0x03, 0x01, + 0x42, 0x18, 0x40, 0x5c, 0x51, 0x78, 0x93, 0x78, 0xd2, 0x78, 0x40, 0xea, + 0x01, 0x20, 0x40, 0xea, 0x03, 0x40, 0x40, 0xea, 0x02, 0x64, 0xf4, 0xf7, + 0x07, 0xf9, 0x00, 0x1b, 0x20, 0xf0, 0x70, 0x46, 0x00, 0xe0, 0x00, 0x26, + 0x06, 0xeb, 0x86, 0x01, 0xc1, 0xf3, 0x1a, 0x10, 0x4a, 0x00, 0x84, 0x49, + 0x03, 0x9f, 0x4b, 0x78, 0x8c, 0x78, 0x23, 0x44, 0xb3, 0xeb, 0x52, 0x1f, + 0x10, 0xd2, 0x04, 0x9d, 0x0a, 0x1d, 0x00, 0x21, 0x01, 0x31, 0x07, 0x29, + 0x00, 0xf0, 0xd7, 0x80, 0xd3, 0x1c, 0x14, 0x78, 0x52, 0x78, 0x22, 0x44, + 0x90, 0x42, 0x1a, 0x46, 0xf4, 0xd8, 0x13, 0xf8, 0x07, 0x8c, 0x02, 0xe0, + 0x04, 0x9d, 0x4f, 0xf0, 0x00, 0x08, 0x4f, 0xf0, 0x00, 0x0c, 0xfa, 0x79, + 0x51, 0x1f, 0x41, 0x45, 0x02, 0xd9, 0x05, 0x2a, 0x88, 0xbf, 0x88, 0x46, + 0x72, 0x4b, 0xf8, 0x78, 0x1b, 0x78, 0x1b, 0x1a, 0x28, 0x78, 0x1b, 0x1a, + 0x02, 0x28, 0x03, 0xeb, 0x83, 0x03, 0x4f, 0xea, 0x43, 0x03, 0x7b, 0x70, + 0x0d, 0xd3, 0xeb, 0x4c, 0x94, 0xf9, 0x3c, 0x50, 0xb5, 0xf1, 0xff, 0x3f, + 0x07, 0xdc, 0x80, 0x35, 0x05, 0xd0, 0x94, 0xf8, 0x3d, 0x40, 0x01, 0x2c, + 0x04, 0xbf, 0x0a, 0x33, 0x7b, 0x70, 0x3c, 0x79, 0x64, 0x26, 0x04, 0xfb, + 0x09, 0xf5, 0xe1, 0x46, 0xb5, 0xfb, 0xf6, 0xf5, 0x56, 0x1d, 0x2c, 0x44, + 0xe5, 0xb2, 0x3c, 0x70, 0xae, 0x42, 0x03, 0xd3, 0x05, 0x2a, 0x4b, 0xd3, + 0xa9, 0x42, 0x49, 0xdd, 0xaa, 0x42, 0x84, 0xbf, 0x39, 0x70, 0x0c, 0x46, + 0xd9, 0xb2, 0xfc, 0x71, 0xba, 0x78, 0x51, 0xfa, 0x84, 0xf1, 0x8c, 0x18, + 0x58, 0x49, 0xa0, 0x45, 0x82, 0xbf, 0x87, 0xf8, 0x00, 0x80, 0x87, 0xf8, + 0x07, 0x80, 0x44, 0x46, 0x09, 0x7d, 0x00, 0x29, 0x18, 0xbf, 0x0a, 0x34, + 0x02, 0x28, 0x73, 0xd3, 0xdf, 0xf8, 0x34, 0xb1, 0x4d, 0x4e, 0xdf, 0xf8, + 0x44, 0xa1, 0x00, 0x25, 0x0b, 0xeb, 0x45, 0x00, 0xb0, 0xf8, 0x48, 0x06, + 0x00, 0xeb, 0x40, 0x00, 0x56, 0xf8, 0x20, 0x00, 0x90, 0xf8, 0xf6, 0x14, + 0x49, 0xb1, 0x03, 0x99, 0xda, 0xf8, 0x00, 0x70, 0x01, 0x23, 0x0a, 0x79, + 0x90, 0xf8, 0x35, 0x11, 0xcd, 0xe9, 0x00, 0x8c, 0x0e, 0xe0, 0x03, 0x9a, + 0x90, 0xf8, 0x35, 0x11, 0xda, 0xf8, 0x00, 0x70, 0xcd, 0xe9, 0x00, 0x8c, + 0x12, 0x79, 0xa3, 0x18, 0x5f, 0x2b, 0x88, 0xbf, 0xc2, 0xf1, 0x5f, 0x04, + 0xe2, 0xb2, 0x02, 0x23, 0xb8, 0x47, 0x04, 0x98, 0x01, 0x35, 0xcc, 0x46, + 0x00, 0x78, 0x85, 0x42, 0xd4, 0xd3, 0x5b, 0xe0, 0xb0, 0x45, 0x59, 0xd9, + 0x03, 0x9a, 0x58, 0xfa, 0x83, 0xf1, 0x82, 0xf8, 0x07, 0x80, 0x82, 0xf8, + 0x00, 0x80, 0x92, 0x78, 0x8c, 0x18, 0x33, 0x49, 0x09, 0x7d, 0x00, 0x29, + 0x18, 0xbf, 0x0a, 0x34, 0x02, 0x28, 0x3b, 0xd3, 0xdf, 0xf8, 0xac, 0xb0, + 0xdf, 0xf8, 0xac, 0xa0, 0x2e, 0x4e, 0x00, 0x25, 0x0b, 0xeb, 0x45, 0x00, + 0xb0, 0xf8, 0x48, 0x06, 0x00, 0xeb, 0x40, 0x00, 0x5a, 0xf8, 0x20, 0x00, + 0x90, 0xf8, 0xf6, 0x14, 0x41, 0xb1, 0x03, 0x99, 0x37, 0x68, 0x04, 0x23, + 0x0a, 0x79, 0x90, 0xf8, 0x35, 0x11, 0xcd, 0xe9, 0x00, 0x8c, 0x0d, 0xe0, + 0x03, 0x9a, 0x90, 0xf8, 0x35, 0x11, 0x37, 0x68, 0xcd, 0xe9, 0x00, 0x8c, + 0x12, 0x79, 0xa3, 0x18, 0x5f, 0x2b, 0x88, 0xbf, 0xc2, 0xf1, 0x5f, 0x04, + 0xe2, 0xb2, 0x05, 0x23, 0xb8, 0x47, 0x04, 0x98, 0x01, 0x35, 0xcc, 0x46, + 0x00, 0x78, 0x85, 0x42, 0xd6, 0xd3, 0x19, 0xe0, 0x18, 0x48, 0x9a, 0xf8, + 0x35, 0x11, 0xcd, 0xe9, 0x00, 0x8c, 0x5f, 0x2c, 0x4f, 0xf0, 0x03, 0x03, + 0x0a, 0xe0, 0x12, 0xf8, 0x04, 0x8c, 0x32, 0xe7, 0x12, 0x48, 0x9a, 0xf8, + 0x35, 0x11, 0xcd, 0xe9, 0x00, 0x8c, 0x5f, 0x2c, 0x4f, 0xf0, 0x06, 0x03, + 0x05, 0x68, 0x28, 0xbf, 0x5f, 0x24, 0xe2, 0xb2, 0x50, 0x46, 0xa8, 0x47, + 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0xbf, 0x54, 0x9d, 0x08, 0x00, + 0xac, 0x76, 0x01, 0x00, 0x18, 0x74, 0x01, 0x00, 0x50, 0x9d, 0x08, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x64, 0xd4, 0x05, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0xe4, 0xd2, 0x05, 0x00, 0x5c, 0x34, 0x01, 0x00, 0x7c, 0x5c, 0x01, 0x00, + 0x2c, 0xce, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x8d, 0xb0, 0x71, 0x4d, + 0x06, 0x46, 0x28, 0x68, 0x0c, 0x90, 0x70, 0x48, 0x00, 0x78, 0x00, 0x28, + 0x00, 0xf0, 0xd1, 0x80, 0x6e, 0x48, 0x90, 0x46, 0x8a, 0x46, 0x00, 0x24, + 0x90, 0xf8, 0x78, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x02, 0x28, 0x12, 0xd1, + 0x03, 0x20, 0x8d, 0xf8, 0x0f, 0x80, 0x8d, 0xf8, 0x0e, 0x40, 0x8d, 0xf8, + 0x0d, 0x00, 0x11, 0x20, 0x8d, 0xf8, 0x0c, 0x00, 0x65, 0x48, 0x01, 0x68, + 0x30, 0x46, 0x88, 0x47, 0x01, 0x27, 0x05, 0x24, 0x8d, 0xf8, 0x10, 0x00, + 0x00, 0xe0, 0x00, 0x27, 0x61, 0x48, 0x90, 0xf8, 0x79, 0x00, 0x0a, 0x28, + 0x04, 0xd0, 0x40, 0x28, 0x6b, 0xd0, 0x0c, 0x28, 0x40, 0xf0, 0xa3, 0x80, + 0x5d, 0x49, 0x03, 0xad, 0x05, 0x20, 0xcd, 0xe9, 0x01, 0x78, 0x4f, 0xf0, + 0x02, 0x0b, 0x4f, 0xf0, 0x01, 0x09, 0x28, 0x55, 0x44, 0xf0, 0x02, 0x00, + 0x0a, 0x78, 0x05, 0xeb, 0x00, 0x08, 0x49, 0x78, 0x88, 0xf8, 0x03, 0x90, + 0x2a, 0x54, 0x06, 0x20, 0x88, 0xf8, 0x01, 0x10, 0x2a, 0x19, 0x88, 0xf8, + 0x02, 0x00, 0x4f, 0x48, 0x82, 0xf8, 0x01, 0xb0, 0x01, 0x68, 0x30, 0x46, + 0x88, 0x47, 0x88, 0xf8, 0x04, 0x00, 0x4e, 0x48, 0x44, 0xf0, 0x0a, 0x01, + 0x08, 0x22, 0x88, 0xf8, 0x07, 0xa0, 0x88, 0xf8, 0x06, 0x90, 0x6a, 0x54, + 0x07, 0x22, 0x6f, 0x18, 0x00, 0x68, 0x88, 0xf8, 0x05, 0x20, 0x87, 0xf8, + 0x01, 0x90, 0x80, 0x47, 0xb8, 0x70, 0x46, 0x48, 0x0e, 0x21, 0x03, 0x22, + 0x87, 0xf8, 0x05, 0x90, 0x87, 0xf8, 0x0a, 0xb0, 0x87, 0xf8, 0x09, 0xb0, + 0x87, 0xf8, 0x0d, 0xb0, 0x05, 0x23, 0x3a, 0x71, 0xf9, 0x70, 0x39, 0x72, + 0xba, 0x73, 0x39, 0x73, 0x00, 0x78, 0xf8, 0x73, 0x3d, 0x48, 0xc0, 0x69, + 0x00, 0x28, 0x18, 0xbf, 0x01, 0x20, 0xb8, 0x71, 0x3b, 0x48, 0x90, 0xf8, + 0x3c, 0x00, 0xc0, 0x09, 0xf8, 0x71, 0x96, 0xf8, 0xb0, 0x05, 0x01, 0x38, + 0xb0, 0xfa, 0x80, 0xf0, 0x4f, 0xea, 0x50, 0x10, 0xf8, 0x72, 0x44, 0xf0, + 0x1a, 0x00, 0x29, 0x54, 0x05, 0xeb, 0x00, 0x01, 0x8b, 0x70, 0x4a, 0x70, + 0x15, 0xd1, 0x96, 0xf8, 0xc3, 0x23, 0x96, 0xf8, 0xc4, 0x33, 0x26, 0x4d, + 0xdd, 0xe9, 0x01, 0x68, 0x2d, 0xe0, 0x03, 0xa8, 0x06, 0x21, 0x96, 0xf8, + 0xa6, 0x20, 0x01, 0x37, 0x01, 0x55, 0x44, 0xf0, 0x02, 0x01, 0x42, 0x54, + 0x20, 0x44, 0x01, 0x22, 0x42, 0x70, 0x48, 0x1c, 0x24, 0xe0, 0xb6, 0xf8, + 0xb8, 0x33, 0x42, 0xf2, 0x04, 0x22, 0x1b, 0x4d, 0x1a, 0x40, 0x18, 0xbf, + 0x01, 0x22, 0xdd, 0xe9, 0x01, 0x68, 0x9c, 0x04, 0x58, 0xbf, 0x5f, 0xea, + 0xc3, 0x44, 0x01, 0xd5, 0x05, 0x23, 0x0e, 0xe0, 0x9c, 0x05, 0x58, 0xbf, + 0x5f, 0xea, 0xc3, 0x54, 0x01, 0xd5, 0x03, 0x23, 0x07, 0xe0, 0x5c, 0x07, + 0x58, 0xbf, 0x5f, 0xea, 0x83, 0x73, 0x01, 0xd5, 0x01, 0x23, 0x00, 0xe0, + 0x00, 0x23, 0x0b, 0x71, 0xca, 0x70, 0xb1, 0x1d, 0x05, 0x30, 0x8f, 0x1c, + 0x25, 0x28, 0x04, 0xd3, 0x00, 0x20, 0x40, 0xf2, 0x33, 0x61, 0xf9, 0xf7, + 0x6b, 0xfd, 0x11, 0x48, 0x03, 0xa9, 0x3a, 0x46, 0x03, 0x68, 0x40, 0x46, + 0x98, 0x47, 0x28, 0x68, 0x0c, 0x99, 0x40, 0x1a, 0x04, 0xbf, 0x0d, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0xf9, 0xf7, 0x4a, 0xfd, 0x38, 0xec, 0x01, 0x00, + 0x80, 0x4a, 0x01, 0x00, 0x40, 0x86, 0x08, 0x00, 0xe4, 0xc2, 0x08, 0x00, + 0x4c, 0x49, 0x01, 0x00, 0xda, 0x05, 0x01, 0x00, 0xd8, 0xc2, 0x08, 0x00, + 0x96, 0x4a, 0x01, 0x00, 0x38, 0x5d, 0x01, 0x00, 0x90, 0x01, 0x00, 0x00, + 0xe8, 0xc2, 0x08, 0x00, 0xf8, 0xb5, 0x30, 0xb1, 0x04, 0x46, 0x1b, 0x48, + 0x1a, 0x21, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x00, 0xb1, 0xf8, 0xbd, + 0x18, 0x4f, 0x4d, 0x49, 0xd7, 0xe9, 0x01, 0x50, 0xf6, 0xf7, 0x9e, 0xf8, + 0x4f, 0xf0, 0x76, 0x51, 0xf6, 0xf7, 0x9a, 0xf8, 0x06, 0x46, 0xb8, 0x89, + 0xf6, 0xf7, 0xa2, 0xf8, 0x4f, 0xf0, 0x76, 0x51, 0xf6, 0xf7, 0x92, 0xf8, + 0x01, 0x46, 0x30, 0x46, 0xf6, 0xf7, 0x94, 0xf8, 0x0e, 0x49, 0x06, 0x46, + 0xb8, 0x60, 0x28, 0x46, 0xf6, 0xf7, 0x88, 0xf8, 0x31, 0x46, 0xf6, 0xf7, + 0x97, 0xf8, 0xfd, 0xf7, 0x31, 0xfb, 0x01, 0x46, 0x55, 0x48, 0x02, 0x68, + 0x20, 0x46, 0x90, 0x47, 0x00, 0x20, 0xb8, 0x81, 0xf3, 0xf7, 0xbc, 0xfe, + 0xa0, 0x30, 0x20, 0xf0, 0x70, 0x40, 0x38, 0x60, 0xf8, 0xbd, 0x00, 0xbf, + 0x0c, 0xbb, 0x08, 0x00, 0xac, 0x76, 0x01, 0x00, 0x00, 0x00, 0xc8, 0x42, + 0xf8, 0xb5, 0x8c, 0x46, 0x2e, 0x49, 0x91, 0xf8, 0x4d, 0x10, 0x02, 0x29, + 0x2a, 0xd3, 0x2d, 0x48, 0xdf, 0xf8, 0xb4, 0xe0, 0x00, 0x23, 0x00, 0x24, + 0x00, 0xf5, 0xc9, 0x60, 0x02, 0x88, 0x02, 0xeb, 0x42, 0x02, 0x5e, 0xf8, + 0x22, 0x60, 0xd6, 0xf8, 0xd4, 0x20, 0x52, 0x7f, 0x62, 0xb1, 0xb6, 0xf8, + 0x76, 0x71, 0xb6, 0xf8, 0x78, 0x21, 0xb6, 0xf8, 0x80, 0x61, 0xd5, 0x19, + 0xb5, 0x42, 0x3e, 0xbf, 0x34, 0x44, 0xe4, 0x1b, 0xa4, 0x1a, 0x08, 0xe0, + 0xb6, 0xf8, 0x74, 0x21, 0x22, 0x44, 0xb6, 0xf8, 0x82, 0x41, 0x22, 0x44, + 0x96, 0xf8, 0x89, 0x41, 0x14, 0x44, 0x01, 0x33, 0x02, 0x30, 0x8b, 0x42, + 0xdc, 0xd1, 0x18, 0xe0, 0xd0, 0xf8, 0xd4, 0x10, 0x49, 0x7f, 0x61, 0xb1, + 0xb0, 0xf8, 0x76, 0x11, 0xb0, 0xf8, 0x78, 0x21, 0xb0, 0xf8, 0x80, 0x01, + 0x53, 0x18, 0x83, 0x42, 0x3a, 0xbf, 0x40, 0x1a, 0x84, 0x1a, 0x00, 0x24, + 0x07, 0xe0, 0xb0, 0xf8, 0x74, 0x11, 0xb0, 0xf8, 0x82, 0x21, 0x90, 0xf8, + 0x89, 0x01, 0x11, 0x44, 0x0c, 0x18, 0x0d, 0x49, 0x60, 0x46, 0xf6, 0xf7, + 0x1f, 0xf8, 0x4f, 0xf0, 0x76, 0x51, 0xf6, 0xf7, 0x1b, 0xf8, 0x05, 0x46, + 0x20, 0x46, 0xf6, 0xf7, 0x23, 0xf8, 0x4f, 0xf0, 0x76, 0x51, 0xf6, 0xf7, + 0x13, 0xf8, 0x01, 0x46, 0x28, 0x46, 0xf6, 0xf7, 0x15, 0xf8, 0xf8, 0xbd, + 0x18, 0x74, 0x01, 0x00, 0x64, 0xd4, 0x05, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0x00, 0x00, 0x70, 0x41, 0x0d, 0x48, 0x0e, 0x49, 0x01, 0x60, 0x0e, 0x48, + 0x0e, 0x49, 0x01, 0x60, 0x0e, 0x48, 0x0f, 0x49, 0x01, 0x60, 0x0f, 0x48, + 0x0f, 0x49, 0x01, 0x60, 0x0f, 0x48, 0x10, 0x49, 0x01, 0x60, 0x10, 0x48, + 0x10, 0x49, 0x01, 0x60, 0x10, 0x48, 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, + 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, 0x12, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xe8, 0xa3, 0x08, 0x00, 0xcd, 0xc6, 0x02, 0x00, 0x84, 0xaf, 0x08, 0x00, + 0x71, 0xc6, 0x02, 0x00, 0x7c, 0xaf, 0x08, 0x00, 0xbd, 0xc8, 0x02, 0x00, + 0x20, 0xb8, 0x08, 0x00, 0xad, 0xca, 0x02, 0x00, 0x38, 0xe3, 0x08, 0x00, + 0xfd, 0xcb, 0x02, 0x00, 0x58, 0xaf, 0x08, 0x00, 0x15, 0xcd, 0x02, 0x00, + 0x5c, 0xaf, 0x08, 0x00, 0x3d, 0xd0, 0x02, 0x00, 0x2c, 0xa2, 0x08, 0x00, + 0x35, 0xd2, 0x02, 0x00, 0x34, 0xa2, 0x08, 0x00, 0xb5, 0xd2, 0x02, 0x00, + 0x40, 0xf6, 0xdd, 0x0c, 0xc1, 0xf2, 0x04, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x47, 0xf6, 0x05, 0x5c, 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x47, 0xf6, 0x39, 0x5c, 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4e, 0xf6, 0x9d, 0x4c, 0xc1, 0xf2, 0x03, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xf0, 0xb5, 0xb0, 0xf8, 0x3e, 0xe4, 0x5f, 0xea, 0x8e, 0x62, 0x44, 0xbf, + 0x08, 0x20, 0xf0, 0xbd, 0x05, 0x78, 0x1d, 0x4b, 0x1d, 0x4a, 0x37, 0x4e, + 0x01, 0x24, 0x00, 0x2d, 0x08, 0xbf, 0x1a, 0x46, 0x4f, 0xf0, 0x07, 0x03, + 0x06, 0xeb, 0xc5, 0x15, 0x08, 0xbf, 0x06, 0x23, 0xb0, 0xf8, 0x26, 0xc4, + 0x00, 0x20, 0x32, 0xf8, 0x20, 0x60, 0x35, 0xf8, 0x36, 0x70, 0x8f, 0x42, + 0x05, 0xd3, 0x02, 0xeb, 0x80, 0x07, 0x7f, 0x88, 0x17, 0xea, 0x0e, 0x0f, + 0x05, 0xd1, 0xe0, 0xb2, 0x66, 0x1c, 0x83, 0x42, 0x34, 0x46, 0xee, 0xd8, + 0x76, 0x46, 0x83, 0x42, 0x1c, 0xbf, 0x30, 0x46, 0xf0, 0xbd, 0x00, 0x24, + 0x01, 0x21, 0x32, 0xf8, 0x24, 0x00, 0x35, 0xf8, 0x30, 0x70, 0xbc, 0x45, + 0x04, 0xd3, 0x02, 0xeb, 0x84, 0x04, 0x64, 0x88, 0x34, 0x42, 0x05, 0xd1, + 0xcc, 0xb2, 0x48, 0x1c, 0xa3, 0x42, 0x01, 0x46, 0xef, 0xd8, 0x03, 0x20, + 0xf0, 0xbd, 0x00, 0xbf, 0x16, 0xd3, 0x05, 0x00, 0xfa, 0xd2, 0x05, 0x00, + 0xf8, 0xb5, 0x04, 0x46, 0x01, 0xfb, 0x02, 0xf6, 0x06, 0xf1, 0x11, 0x00, + 0xb4, 0xf8, 0x26, 0x24, 0x81, 0xb2, 0xb1, 0xfb, 0xf2, 0xf7, 0x07, 0xfb, + 0x12, 0x00, 0x85, 0xb2, 0x20, 0x46, 0x29, 0x46, 0xff, 0xf7, 0xa6, 0xff, + 0x22, 0x78, 0x0f, 0x4b, 0xf9, 0xb2, 0x00, 0x2d, 0x03, 0xeb, 0xc2, 0x12, + 0xb4, 0xf8, 0x40, 0x34, 0x02, 0xeb, 0xc0, 0x00, 0x02, 0xeb, 0xc3, 0x03, + 0x00, 0x79, 0x1b, 0x79, 0x03, 0xf1, 0x01, 0x03, 0x13, 0xfb, 0x01, 0x00, + 0x00, 0xf1, 0x01, 0x00, 0x08, 0xbf, 0x13, 0xfb, 0x01, 0xf0, 0xb1, 0xb2, + 0x00, 0xeb, 0x80, 0x00, 0xc9, 0x00, 0xb1, 0xfb, 0xf0, 0xf0, 0x80, 0xb2, + 0xf8, 0xbd, 0x00, 0xbf, 0x86, 0x71, 0x0d, 0x10, 0x2d, 0xe9, 0xf0, 0x47, + 0x80, 0x46, 0xa1, 0xf1, 0x11, 0x00, 0x14, 0x46, 0x90, 0xfb, 0xf2, 0xf0, + 0x0e, 0x28, 0x07, 0xdc, 0x5f, 0xfa, 0x80, 0xf9, 0xb9, 0xf1, 0x00, 0x0f, + 0x08, 0xbf, 0x4f, 0xf0, 0x01, 0x09, 0x01, 0xe0, 0x4f, 0xf0, 0x0f, 0x09, + 0x00, 0x27, 0x02, 0x25, 0x68, 0x1e, 0x22, 0x46, 0xc6, 0xb2, 0x40, 0x46, + 0x31, 0x46, 0xff, 0xf7, 0xaf, 0xff, 0xb9, 0xb2, 0x88, 0x42, 0x82, 0xbf, + 0x06, 0xfb, 0x04, 0xf1, 0x01, 0xf1, 0x0d, 0x0a, 0x07, 0x46, 0x68, 0x1c, + 0xe9, 0xb2, 0x05, 0x46, 0x89, 0x45, 0xeb, 0xd2, 0x1f, 0xfa, 0x8a, 0xf0, + 0xbd, 0xe8, 0xf0, 0x87, 0x2d, 0xe9, 0xf0, 0x4f, 0x87, 0xb0, 0x43, 0x4e, + 0x0d, 0x46, 0x04, 0x46, 0x37, 0x68, 0x3f, 0xb1, 0xb7, 0xf8, 0xd2, 0x01, + 0x0a, 0x28, 0x03, 0xd1, 0x97, 0xf8, 0xd1, 0x01, 0x04, 0x28, 0x09, 0xd9, + 0x3d, 0x48, 0x90, 0xf8, 0x79, 0x00, 0x40, 0x07, 0x04, 0xd5, 0x1f, 0xb1, + 0x97, 0xf8, 0xb0, 0x05, 0x01, 0x28, 0x06, 0xd1, 0x20, 0x46, 0x29, 0x46, + 0x07, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0x00, 0xf0, 0xb7, 0xb8, 0xdf, 0xf8, + 0xd8, 0x90, 0xb9, 0xf8, 0x04, 0x00, 0x00, 0x28, 0xf2, 0xd0, 0xb7, 0xf8, + 0x26, 0x04, 0xb9, 0xf8, 0x00, 0x10, 0x81, 0x42, 0x52, 0xd0, 0x31, 0x48, + 0xdf, 0xf8, 0xc8, 0xb0, 0xd0, 0xf8, 0x00, 0x80, 0x2f, 0x48, 0xd0, 0xf8, + 0x00, 0xa0, 0xdb, 0xf8, 0x00, 0x00, 0x80, 0x47, 0xb9, 0xf8, 0x04, 0x20, + 0x01, 0x46, 0x38, 0x46, 0xff, 0xf7, 0x94, 0xff, 0xd0, 0x47, 0x30, 0x68, + 0xb0, 0xf8, 0x26, 0x04, 0xa9, 0xf8, 0x00, 0x00, 0x00, 0x20, 0xcd, 0xe9, + 0x04, 0x00, 0xcd, 0xe9, 0x02, 0x00, 0xdb, 0xf8, 0x00, 0x00, 0x80, 0x47, + 0x95, 0xf8, 0x3d, 0x10, 0xad, 0xf8, 0x08, 0x00, 0xb9, 0xf8, 0x04, 0x00, + 0x8d, 0xf8, 0x16, 0x10, 0x31, 0x68, 0xad, 0xf8, 0x0e, 0x00, 0x38, 0x48, + 0xb1, 0xf8, 0x26, 0x24, 0x00, 0x89, 0xad, 0xf8, 0x0a, 0x20, 0xb1, 0xf8, + 0x40, 0x24, 0xad, 0xf8, 0x12, 0x00, 0xa0, 0x42, 0x4f, 0xf0, 0x00, 0x00, + 0xad, 0xf8, 0x0c, 0x20, 0x09, 0x78, 0xad, 0xf8, 0x14, 0x40, 0x8d, 0xf8, + 0x10, 0x10, 0x38, 0xbf, 0x01, 0x20, 0x8d, 0xf8, 0x11, 0x00, 0x41, 0x46, + 0x12, 0x48, 0x02, 0x68, 0x0e, 0x48, 0x00, 0x68, 0x90, 0x47, 0x06, 0x90, + 0x10, 0x48, 0x02, 0xab, 0x00, 0x21, 0x00, 0x22, 0x05, 0x68, 0x14, 0x20, + 0x00, 0x90, 0x40, 0xf6, 0x5e, 0x10, 0xa8, 0x47, 0x23, 0x48, 0x01, 0x89, + 0x00, 0x20, 0xa1, 0x42, 0x38, 0xbf, 0x01, 0x20, 0x07, 0xb0, 0xbd, 0xe8, + 0xf0, 0x8f, 0x00, 0xbf, 0x40, 0x01, 0x00, 0x00, 0x40, 0x86, 0x08, 0x00, + 0x86, 0xe4, 0x05, 0x00, 0x24, 0x20, 0x00, 0x40, 0x2c, 0xe2, 0x08, 0x00, + 0x28, 0xe2, 0x08, 0x00, 0x1c, 0x9d, 0x08, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0x40, 0xf8, 0x3c, 0xb1, 0x0c, 0x2c, + 0x01, 0xd0, 0x0a, 0x2c, 0x09, 0xd1, 0x06, 0x48, 0x07, 0x49, 0x01, 0x61, + 0x10, 0xbd, 0x03, 0x48, 0x00, 0x21, 0x01, 0x80, 0x02, 0x48, 0x03, 0x49, + 0xc1, 0x61, 0x10, 0xbd, 0x86, 0xe4, 0x05, 0x00, 0xec, 0x4a, 0x01, 0x00, + 0x89, 0xd5, 0x02, 0x00, 0xf5, 0xd6, 0x02, 0x00, 0x07, 0x48, 0x00, 0x78, + 0x01, 0x28, 0x08, 0xd1, 0x07, 0x48, 0x08, 0x49, 0x00, 0x68, 0xc9, 0x6e, + 0x48, 0x43, 0x07, 0x49, 0xb0, 0xfb, 0xf1, 0xf0, 0x70, 0x47, 0x02, 0x48, + 0x00, 0x68, 0x70, 0x47, 0x84, 0xe4, 0x05, 0x00, 0xe8, 0x49, 0x01, 0x00, + 0x98, 0x4a, 0x01, 0x00, 0x4c, 0x49, 0x01, 0x00, 0x40, 0x42, 0x0f, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, 0xf4, 0xaf, 0x08, 0x00, + 0xbd, 0xd6, 0x02, 0x00, 0x44, 0xf2, 0xa5, 0x0c, 0xc1, 0xf2, 0x04, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf6, 0x5d, 0x6c, 0xc1, 0xf2, 0x04, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x10, 0xb5, 0x01, 0xf0, 0xef, 0xf8, 0x13, 0x49, + 0x91, 0xf8, 0x79, 0x10, 0x8a, 0x1e, 0xd3, 0xb2, 0x09, 0x2b, 0x07, 0xd8, + 0x53, 0xb2, 0x10, 0x4a, 0x10, 0x4c, 0x52, 0xf8, 0x23, 0x20, 0x54, 0xf8, + 0x23, 0x30, 0x02, 0xe0, 0x96, 0x22, 0x40, 0xf2, 0x59, 0x13, 0x5a, 0x43, + 0xcb, 0x23, 0x40, 0xf2, 0xa7, 0x24, 0x03, 0xeb, 0xd2, 0x02, 0x4f, 0xf6, + 0xfc, 0x73, 0x03, 0xea, 0x02, 0x03, 0xb3, 0xfb, 0xf4, 0xf3, 0x07, 0x4c, + 0x23, 0x75, 0x01, 0xb1, 0x10, 0xbd, 0x22, 0xf0, 0x03, 0x01, 0x05, 0x4a, + 0x51, 0x80, 0x10, 0xbd, 0x4c, 0x49, 0x01, 0x00, 0x24, 0xce, 0x05, 0x00, + 0xfc, 0xcd, 0x05, 0x00, 0xac, 0x76, 0x01, 0x00, 0x90, 0x4a, 0x01, 0x00, + 0x2d, 0xe9, 0xf0, 0x41, 0x86, 0xb0, 0x07, 0x46, 0x25, 0x48, 0x00, 0x26, + 0x90, 0x46, 0x0d, 0x46, 0x0d, 0xf1, 0x16, 0x01, 0x03, 0xaa, 0x05, 0xab, + 0xad, 0xf8, 0x16, 0x60, 0xad, 0xf8, 0x14, 0x60, 0xcd, 0xe9, 0x03, 0x66, + 0x04, 0x68, 0x04, 0xa8, 0xa0, 0x47, 0xbd, 0xf8, 0x16, 0x20, 0xbd, 0xf8, + 0x14, 0x00, 0x10, 0x44, 0x06, 0x28, 0x2e, 0xd3, 0x67, 0xb3, 0x00, 0x20, + 0x0d, 0xf1, 0x06, 0x01, 0x5a, 0xb1, 0x04, 0x9a, 0x53, 0x1c, 0x04, 0x93, + 0x12, 0x78, 0x01, 0xf8, 0x01, 0x2b, 0xbd, 0xf8, 0x16, 0x20, 0x01, 0x3a, + 0xad, 0xf8, 0x16, 0x20, 0x0d, 0xe0, 0xbd, 0xf8, 0x14, 0x20, 0x52, 0xb1, + 0x03, 0x9a, 0x53, 0x1c, 0x03, 0x93, 0x12, 0x78, 0x01, 0xf8, 0x01, 0x2b, + 0xbd, 0xf8, 0x14, 0x20, 0x01, 0x3a, 0xad, 0xf8, 0x14, 0x20, 0x01, 0x30, + 0x06, 0x28, 0x02, 0xd0, 0xbd, 0xf8, 0x16, 0x20, 0xde, 0xe7, 0x0c, 0x48, + 0x29, 0x46, 0x42, 0x46, 0x03, 0x68, 0x0d, 0xf1, 0x06, 0x00, 0x98, 0x47, + 0x06, 0x46, 0x00, 0xe0, 0x00, 0x26, 0x30, 0x46, 0x06, 0xb0, 0xbd, 0xe8, + 0xf0, 0x81, 0x00, 0xbf, 0x78, 0x9d, 0x08, 0x00, 0x18, 0xb1, 0x03, 0x48, + 0x03, 0x68, 0x03, 0x48, 0x18, 0x47, 0x00, 0x20, 0x70, 0x47, 0x00, 0xbf, + 0xc0, 0xae, 0x08, 0x00, 0x8c, 0xe4, 0x05, 0x00, 0x70, 0xb5, 0xb0, 0xb3, + 0x04, 0x46, 0xd0, 0xf8, 0xbc, 0x05, 0x90, 0xb3, 0x19, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x88, 0xb1, 0xf3, 0xf7, 0xc3, 0xfb, 0x05, 0x46, + 0x16, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x28, 0x1a, 0xd4, 0xf8, + 0xbc, 0x55, 0x20, 0xf0, 0x70, 0x40, 0xa8, 0x62, 0x00, 0xeb, 0x80, 0x00, + 0xc0, 0xf3, 0x1a, 0x10, 0x03, 0xe0, 0xd4, 0xf8, 0xbc, 0x55, 0x00, 0x20, + 0xa8, 0x62, 0x0e, 0x49, 0x8a, 0x88, 0x81, 0xb2, 0x91, 0x42, 0x12, 0xd3, + 0x95, 0xf8, 0x3e, 0x60, 0x04, 0x2e, 0x0e, 0xd3, 0x20, 0x46, 0xfe, 0xf7, + 0xe3, 0xfe, 0xb0, 0x42, 0x09, 0xd2, 0x02, 0x20, 0x22, 0x21, 0x85, 0xf8, + 0x41, 0x00, 0x06, 0x48, 0x00, 0x78, 0xbd, 0xe8, 0x70, 0x40, 0xf3, 0xf7, + 0xa3, 0xbb, 0x70, 0xbd, 0x4c, 0x9d, 0x08, 0x00, 0x58, 0x9d, 0x08, 0x00, + 0xee, 0x05, 0x01, 0x00, 0x67, 0x34, 0x01, 0x00, 0xb0, 0xb5, 0x04, 0x46, + 0x40, 0x89, 0xe1, 0x88, 0x11, 0xf0, 0x03, 0x05, 0x04, 0xd0, 0x24, 0xf0, + 0xb5, 0xfb, 0x6f, 0xf3, 0x9f, 0x30, 0x06, 0xe0, 0x21, 0x89, 0x01, 0xf0, + 0x01, 0x01, 0x08, 0x44, 0x80, 0xb2, 0x24, 0xf0, 0xab, 0xfb, 0x08, 0x21, + 0x00, 0x2d, 0x08, 0xbf, 0x0a, 0x21, 0x08, 0x44, 0x21, 0x89, 0x08, 0x44, + 0x21, 0x7b, 0x08, 0x44, 0xc0, 0xf3, 0x4f, 0x00, 0xb0, 0xbd, 0x00, 0xbf, + 0x2d, 0xe9, 0xf0, 0x4f, 0x99, 0xb0, 0xdf, 0xf8, 0x7c, 0xc7, 0x06, 0x46, + 0x01, 0xeb, 0x81, 0x00, 0x0f, 0x46, 0x8d, 0xf8, 0x63, 0x10, 0x5c, 0xf8, + 0x30, 0x10, 0x00, 0x29, 0x00, 0xf0, 0xa2, 0x80, 0xdf, 0xf8, 0x64, 0x57, + 0x95, 0xf8, 0x79, 0x40, 0x0c, 0x2c, 0x01, 0xd0, 0x0a, 0x2c, 0x00, 0xd1, + 0x08, 0x3e, 0x07, 0xeb, 0x47, 0x04, 0x05, 0xeb, 0x04, 0x1b, 0x9b, 0xf8, + 0x28, 0x40, 0x00, 0x2c, 0x00, 0xf0, 0x9a, 0x80, 0x0d, 0x92, 0x05, 0xf1, + 0x29, 0x02, 0x05, 0x93, 0x0f, 0x92, 0xdf, 0xf8, 0x3c, 0x27, 0x94, 0x1c, + 0x91, 0xf8, 0xf3, 0x24, 0xba, 0xb1, 0x0c, 0xeb, 0xc0, 0x05, 0xf3, 0xf7, + 0x3d, 0xfb, 0x29, 0x68, 0xc1, 0xf8, 0x04, 0x05, 0xdf, 0xf8, 0x24, 0x07, + 0x00, 0x68, 0x80, 0x47, 0xf3, 0xf7, 0x34, 0xfb, 0x29, 0x68, 0x00, 0x22, + 0xa0, 0x30, 0x20, 0xf0, 0x70, 0x40, 0x81, 0xf8, 0xf3, 0x24, 0xe2, 0x55, + 0xdf, 0xf8, 0x0c, 0x27, 0x10, 0x60, 0xd1, 0xf8, 0x08, 0x05, 0x0e, 0x94, + 0x0d, 0xf1, 0x52, 0x02, 0x15, 0xab, 0x10, 0xfa, 0x86, 0xf0, 0xc1, 0xf8, + 0x08, 0x05, 0xdf, 0xf8, 0xf8, 0x06, 0x16, 0xa9, 0x00, 0xeb, 0x87, 0x19, + 0xdb, 0xf8, 0x20, 0x00, 0x09, 0xf1, 0x0c, 0x04, 0xc9, 0xf8, 0x18, 0x00, + 0xdf, 0xf8, 0xe4, 0x06, 0x05, 0x68, 0x14, 0xa8, 0x00, 0x90, 0x20, 0x46, + 0xa8, 0x47, 0xc8, 0x46, 0xbd, 0xf8, 0x50, 0x70, 0xbd, 0xf8, 0x52, 0xa0, + 0x38, 0xf8, 0x30, 0x0f, 0x58, 0xb1, 0x99, 0xf8, 0x4a, 0x00, 0x40, 0xb9, + 0x00, 0x20, 0xa8, 0xf8, 0x00, 0x00, 0x89, 0xf8, 0x49, 0x00, 0xdb, 0xf8, + 0x1c, 0x00, 0xc9, 0xf8, 0x14, 0x00, 0x0f, 0x9d, 0xb5, 0xf8, 0x47, 0x00, + 0x28, 0xb9, 0xdf, 0xf8, 0xac, 0x06, 0xff, 0xf7, 0x63, 0xff, 0xa5, 0xf8, + 0x47, 0x00, 0xdf, 0xf8, 0xa0, 0x06, 0xb2, 0xb2, 0x90, 0xf8, 0x21, 0x10, + 0xc9, 0x07, 0x1c, 0xbf, 0x80, 0x8c, 0xa5, 0xf8, 0x47, 0x00, 0x0d, 0x98, + 0x07, 0xeb, 0x0a, 0x01, 0x00, 0x28, 0x18, 0xbf, 0x01, 0x20, 0x22, 0xfa, + 0x00, 0xf3, 0x0c, 0x92, 0x0e, 0x98, 0xcd, 0xe9, 0x0a, 0x13, 0x43, 0x80, + 0xb8, 0xf8, 0x00, 0x00, 0x70, 0xb3, 0xdf, 0xf8, 0x70, 0x06, 0x8a, 0xb2, + 0x59, 0x46, 0x06, 0x68, 0x00, 0x20, 0x00, 0x90, 0x20, 0x46, 0xb0, 0x47, + 0x0b, 0x99, 0xdf, 0xf8, 0x3c, 0x66, 0x00, 0x28, 0x08, 0x46, 0x25, 0xd0, + 0xb8, 0xf8, 0x00, 0x00, 0x00, 0x28, 0x08, 0x46, 0x20, 0xd1, 0xdf, 0xf8, + 0x3c, 0x06, 0x40, 0x89, 0x08, 0x44, 0x1b, 0xe0, 0xdf, 0xf8, 0x80, 0x06, + 0x0d, 0xf1, 0x63, 0x03, 0x04, 0x68, 0x01, 0x20, 0x00, 0x90, 0x40, 0xf6, + 0x0a, 0x10, 0x08, 0xe0, 0xdf, 0xf8, 0x6c, 0x06, 0x0d, 0xf1, 0x63, 0x03, + 0x04, 0x68, 0x01, 0x20, 0x00, 0x90, 0x40, 0xf6, 0x5f, 0x10, 0x00, 0x21, + 0x02, 0x22, 0x83, 0xe0, 0xdf, 0xf8, 0x04, 0x06, 0xdf, 0xf8, 0xec, 0x65, + 0x40, 0x89, 0x18, 0x44, 0x09, 0x90, 0x22, 0x98, 0x37, 0x46, 0x08, 0x94, + 0x48, 0xb1, 0xb8, 0xf8, 0x00, 0x00, 0x90, 0xb1, 0x00, 0x20, 0x00, 0x24, + 0x4f, 0xf0, 0x00, 0x0a, 0x07, 0x90, 0x00, 0x20, 0x1c, 0xe0, 0xdf, 0xf8, + 0xdc, 0x05, 0x00, 0x24, 0x4f, 0xf0, 0x00, 0x0a, 0x46, 0x68, 0x00, 0x20, + 0x07, 0x90, 0x00, 0x20, 0x17, 0x96, 0x06, 0x90, 0x1e, 0xe0, 0x95, 0xf8, + 0x50, 0x00, 0x0c, 0x28, 0x01, 0xd0, 0x0a, 0x28, 0xe6, 0xd1, 0xdf, 0xf8, + 0xc8, 0x05, 0x00, 0x68, 0x80, 0x47, 0x82, 0x46, 0x00, 0x0e, 0x07, 0x90, + 0x4f, 0xea, 0x1a, 0x40, 0x4f, 0xea, 0x1a, 0x24, 0x06, 0x90, 0x9d, 0xf8, + 0x63, 0x00, 0x17, 0xaa, 0x00, 0xeb, 0x80, 0x00, 0x56, 0xf8, 0x30, 0x10, + 0xdf, 0xf8, 0xa4, 0x05, 0x03, 0x68, 0x01, 0x20, 0x98, 0x47, 0x17, 0x9e, + 0xdf, 0xf8, 0x9c, 0x05, 0x0a, 0x21, 0xb0, 0xf8, 0x8c, 0x00, 0x40, 0x01, + 0xb0, 0xfb, 0xf1, 0xf5, 0xf3, 0xf7, 0x5c, 0xfa, 0x30, 0x1a, 0x28, 0x44, + 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x36, 0xd9, 0x22, 0x98, + 0x0f, 0x9d, 0xc8, 0xb1, 0x9d, 0xf8, 0x63, 0x00, 0xdf, 0xf8, 0x58, 0x45, + 0x00, 0xeb, 0x80, 0x00, 0x22, 0x1d, 0x57, 0xf8, 0x30, 0x10, 0xdf, 0xf8, + 0x60, 0x05, 0x03, 0x68, 0x01, 0x20, 0x98, 0x47, 0x20, 0x60, 0x95, 0xf8, + 0x50, 0x00, 0x0c, 0x28, 0x01, 0xd0, 0x0a, 0x28, 0x04, 0xd1, 0xdf, 0xf8, + 0x50, 0x05, 0x01, 0x68, 0x08, 0x20, 0x88, 0x47, 0x23, 0x98, 0x20, 0xb1, + 0xdf, 0xf8, 0x40, 0x05, 0x01, 0x68, 0x0c, 0x98, 0x88, 0x47, 0xdb, 0xf8, + 0x08, 0x00, 0x17, 0xab, 0x00, 0x21, 0x00, 0x22, 0x01, 0x30, 0xcb, 0xf8, + 0x08, 0x00, 0xdf, 0xf8, 0x5c, 0x05, 0x04, 0x68, 0x04, 0x20, 0x00, 0x90, + 0x40, 0xf6, 0x03, 0x10, 0xa0, 0x47, 0x19, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0xdd, 0xe9, 0x09, 0x10, 0x0f, 0x9d, 0x3e, 0x46, 0x88, 0x42, 0x1e, 0xd3, + 0x16, 0x98, 0xe0, 0xb1, 0xb8, 0xf8, 0x00, 0x00, 0x00, 0x28, 0x52, 0xd0, + 0x22, 0x98, 0x08, 0x9c, 0x00, 0x28, 0x00, 0xf0, 0x3f, 0x81, 0xdf, 0xf8, + 0xe8, 0x04, 0x00, 0x21, 0x00, 0x22, 0x03, 0x68, 0x00, 0x20, 0x98, 0x47, + 0x95, 0xf8, 0x50, 0x00, 0x0c, 0x28, 0x02, 0xd0, 0x0a, 0x28, 0x40, 0xf0, + 0x31, 0x81, 0xdf, 0xf8, 0xd4, 0x04, 0x01, 0x68, 0x08, 0x20, 0x88, 0x47, + 0x2a, 0xe1, 0x9d, 0xf8, 0x63, 0x00, 0x0e, 0x9a, 0x01, 0x21, 0x0c, 0x9b, + 0x11, 0x54, 0xbb, 0xf8, 0x24, 0x10, 0xdb, 0xf8, 0x2c, 0x20, 0x01, 0x31, + 0x1a, 0x44, 0xab, 0xf8, 0x24, 0x10, 0xcb, 0xf8, 0x2c, 0x20, 0xdb, 0xf8, + 0x10, 0x10, 0xb5, 0xf8, 0x47, 0x20, 0x11, 0x44, 0xcb, 0xf8, 0x10, 0x10, + 0x22, 0x99, 0xb9, 0xb1, 0x00, 0xeb, 0x80, 0x00, 0xdf, 0xf8, 0x74, 0x44, + 0x56, 0xf8, 0x30, 0x10, 0xdf, 0xf8, 0x80, 0x04, 0x22, 0x1d, 0x03, 0x68, + 0x01, 0x20, 0x98, 0x47, 0x20, 0x60, 0x95, 0xf8, 0x50, 0x00, 0x0c, 0x28, + 0x01, 0xd0, 0x0a, 0x28, 0x04, 0xd1, 0xdf, 0xf8, 0x70, 0x04, 0x01, 0x68, + 0x08, 0x20, 0x88, 0x47, 0x23, 0x98, 0x00, 0x28, 0xa3, 0xd0, 0xdf, 0xf8, + 0x60, 0x04, 0x01, 0x68, 0x0c, 0x98, 0x88, 0x47, 0x9d, 0xe7, 0xdf, 0xf8, + 0x58, 0x04, 0x01, 0x68, 0x9d, 0xf8, 0x63, 0x00, 0x88, 0x47, 0x89, 0xf8, + 0x4a, 0x00, 0x95, 0xf8, 0x50, 0x00, 0x0c, 0x28, 0x01, 0xd0, 0x0a, 0x28, + 0x0b, 0xd1, 0xdf, 0xf8, 0x2c, 0x04, 0x00, 0x68, 0x80, 0x47, 0x82, 0x46, + 0x00, 0x0e, 0x07, 0x90, 0x4f, 0xea, 0x1a, 0x40, 0x4f, 0xea, 0x1a, 0x24, + 0x06, 0x90, 0x22, 0x98, 0x58, 0xb3, 0x95, 0xf8, 0x50, 0x00, 0x0c, 0x28, + 0x01, 0xd0, 0x0a, 0x28, 0x03, 0xd1, 0xdf, 0xf8, 0x18, 0x04, 0x00, 0x68, + 0x78, 0xb1, 0x9d, 0xf8, 0x63, 0x00, 0x00, 0xeb, 0x80, 0x00, 0x56, 0xf8, + 0x30, 0x10, 0xdf, 0xf8, 0xf4, 0x03, 0xdf, 0xf8, 0xdc, 0x63, 0x03, 0x68, + 0x32, 0x1d, 0x01, 0x20, 0x98, 0x47, 0x30, 0x60, 0x06, 0xe0, 0xdf, 0xf8, + 0xe0, 0x03, 0x00, 0x21, 0x00, 0x22, 0x03, 0x68, 0x00, 0x20, 0x98, 0x47, + 0x95, 0xf8, 0x50, 0x00, 0x0c, 0x28, 0x01, 0xd0, 0x0a, 0x28, 0x04, 0xd1, + 0xdf, 0xf8, 0xcc, 0x03, 0x01, 0x68, 0x08, 0x20, 0x88, 0x47, 0xdf, 0xf8, + 0xa8, 0x03, 0x17, 0xaa, 0x04, 0x21, 0x04, 0x23, 0x40, 0x68, 0x17, 0x90, + 0x09, 0xf1, 0x39, 0x00, 0xf3, 0xf7, 0x72, 0xf9, 0xdf, 0xf8, 0xb8, 0x63, + 0x31, 0x69, 0x11, 0xb1, 0x58, 0x46, 0x88, 0x47, 0x00, 0xe0, 0x00, 0x20, + 0x01, 0x0a, 0x04, 0x90, 0x89, 0xf8, 0x42, 0x00, 0x89, 0xf8, 0x41, 0x10, + 0x01, 0x0c, 0x00, 0x0e, 0x89, 0xf8, 0x3f, 0x00, 0x95, 0xf8, 0x50, 0x00, + 0x89, 0xf8, 0x40, 0x10, 0x0a, 0x28, 0x0c, 0xd0, 0x0c, 0x28, 0xd9, 0x4d, + 0xdd, 0xe9, 0x06, 0x10, 0x10, 0xd0, 0xf1, 0x68, 0x49, 0xb1, 0x88, 0x47, + 0x82, 0x46, 0x00, 0x20, 0x00, 0x21, 0x00, 0x24, 0x08, 0xe0, 0xd3, 0x4d, + 0xdd, 0xe9, 0x06, 0x10, 0x04, 0xe0, 0x00, 0x20, 0x00, 0x21, 0x00, 0x24, + 0x4f, 0xf0, 0x00, 0x0a, 0x89, 0xf8, 0x44, 0x10, 0xbd, 0xf8, 0x52, 0x10, + 0x89, 0xf8, 0x43, 0x00, 0x16, 0x98, 0x89, 0xf8, 0x45, 0x40, 0x89, 0xf8, + 0x46, 0xa0, 0x08, 0x9c, 0xa9, 0xf8, 0x24, 0x10, 0x15, 0x99, 0xc9, 0xe9, + 0x07, 0x01, 0xbd, 0xf8, 0x50, 0x00, 0xb8, 0xf8, 0x00, 0x10, 0xa9, 0xf8, + 0x26, 0x00, 0xc2, 0x48, 0x40, 0x89, 0x08, 0x44, 0xa8, 0xf8, 0x00, 0x00, + 0x81, 0xb2, 0xca, 0x48, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x14, 0xa8, + 0x2d, 0x68, 0x16, 0xa9, 0x0d, 0xf1, 0x52, 0x02, 0x15, 0xab, 0x00, 0x90, + 0x20, 0x46, 0xa8, 0x47, 0x0f, 0x9d, 0xb3, 0x4e, 0x95, 0xf8, 0x50, 0x00, + 0x0c, 0x28, 0x01, 0xd0, 0x0a, 0x28, 0x3d, 0xd1, 0x00, 0x20, 0x10, 0xaa, + 0xad, 0xf8, 0x4c, 0x00, 0x17, 0x98, 0x12, 0x90, 0x9d, 0xf8, 0x63, 0x00, + 0x00, 0xeb, 0x80, 0x00, 0x56, 0xf8, 0x30, 0x00, 0xd0, 0xf8, 0xd4, 0x00, + 0x00, 0xf1, 0x14, 0x01, 0xb8, 0x48, 0x03, 0x68, 0x12, 0xa8, 0x98, 0x47, + 0x10, 0x99, 0x40, 0xf2, 0x71, 0x20, 0x04, 0x9a, 0xa1, 0xfb, 0x00, 0x01, + 0x5f, 0xea, 0x51, 0x01, 0xbd, 0xf8, 0x44, 0x10, 0x4f, 0xea, 0x30, 0x00, + 0x00, 0xeb, 0x11, 0x10, 0x82, 0x42, 0x01, 0xd9, 0x10, 0x1a, 0x07, 0xe0, + 0xc1, 0x0e, 0x10, 0x29, 0x87, 0xbf, 0xc0, 0x43, 0x10, 0x44, 0x10, 0x1a, + 0x00, 0xf1, 0x08, 0x40, 0xaa, 0x49, 0x88, 0x42, 0x07, 0xd2, 0x44, 0xf6, + 0x37, 0x21, 0x88, 0x42, 0x08, 0xd8, 0x00, 0x20, 0x40, 0xf2, 0x99, 0x31, + 0x02, 0xe0, 0x00, 0x20, 0x4f, 0xf4, 0x66, 0x71, 0xf8, 0xf7, 0x24, 0xff, + 0x16, 0x99, 0x81, 0xb1, 0x37, 0x46, 0xbd, 0xf8, 0x52, 0x20, 0x0b, 0x9e, + 0x96, 0x42, 0x11, 0xd9, 0x15, 0x9b, 0x00, 0x2b, 0x3f, 0xf4, 0xa1, 0xae, + 0x0d, 0x98, 0x00, 0xb3, 0x9d, 0x48, 0x05, 0x68, 0xb0, 0x1a, 0x80, 0xb2, + 0x0d, 0xe0, 0xa0, 0x48, 0x00, 0x21, 0x06, 0x22, 0x00, 0x23, 0x04, 0x68, + 0x00, 0x20, 0x8e, 0xe6, 0x0d, 0x98, 0x68, 0xb1, 0x96, 0x48, 0x32, 0x46, + 0x00, 0x23, 0x05, 0x68, 0x00, 0x20, 0x00, 0x90, 0x05, 0x98, 0x01, 0x90, + 0x23, 0x98, 0x02, 0x90, 0x0c, 0x98, 0xa8, 0x47, 0x0f, 0x9d, 0x11, 0xe0, + 0x8e, 0x48, 0x02, 0x68, 0x08, 0x46, 0x31, 0x46, 0x0b, 0xe0, 0x8c, 0x4d, + 0x08, 0x46, 0x11, 0x46, 0x2b, 0x68, 0x98, 0x47, 0xbd, 0xf8, 0x52, 0x00, + 0x2a, 0x68, 0x0f, 0x9d, 0x30, 0x1a, 0x81, 0xb2, 0x15, 0x98, 0x90, 0x47, + 0x95, 0xf8, 0x50, 0x00, 0xd8, 0xb9, 0xbd, 0xf8, 0x52, 0x00, 0x03, 0x28, + 0x17, 0xd3, 0x16, 0x98, 0x41, 0x78, 0xc1, 0xf3, 0x01, 0x11, 0x85, 0xf8, + 0x5f, 0x10, 0x41, 0x78, 0xc1, 0xf3, 0x81, 0x01, 0x85, 0xf8, 0x60, 0x10, + 0x41, 0x78, 0xc1, 0xf3, 0x40, 0x01, 0x85, 0xf8, 0x61, 0x10, 0x41, 0x78, + 0x01, 0xf0, 0x01, 0x01, 0x85, 0xf8, 0x62, 0x10, 0x80, 0x78, 0x85, 0xf8, + 0x63, 0x00, 0x73, 0x48, 0x0b, 0x9e, 0x02, 0x68, 0x20, 0x46, 0x31, 0x46, + 0x90, 0x47, 0xb8, 0xf8, 0x00, 0x00, 0x33, 0x46, 0x81, 0x19, 0x95, 0xf8, + 0x50, 0x00, 0xa8, 0xf8, 0x00, 0x10, 0x20, 0xb9, 0x99, 0xf8, 0x49, 0x20, + 0x01, 0x32, 0x89, 0xf8, 0x49, 0x20, 0x09, 0x04, 0x0b, 0xd0, 0x99, 0xf8, + 0x4a, 0x10, 0x41, 0xb9, 0x00, 0x21, 0xa8, 0xf8, 0x00, 0x10, 0x89, 0xf8, + 0x49, 0x10, 0xdb, 0xf8, 0x1c, 0x10, 0xc9, 0xf8, 0x14, 0x10, 0x9d, 0xf8, + 0x63, 0x10, 0x0e, 0x9e, 0x72, 0x5c, 0x01, 0x2a, 0x12, 0xd1, 0x95, 0xf8, + 0x4c, 0x20, 0x01, 0x2a, 0x0c, 0xd1, 0x01, 0xeb, 0x81, 0x02, 0x07, 0xeb, + 0xc2, 0x02, 0x92, 0xf8, 0x26, 0x20, 0xd2, 0x07, 0x04, 0xd0, 0xb9, 0xf8, + 0x32, 0x20, 0x01, 0x32, 0xa9, 0xf8, 0x32, 0x20, 0x00, 0x22, 0x72, 0x54, + 0xdd, 0xe9, 0x09, 0x21, 0x3e, 0x46, 0x91, 0x42, 0x8c, 0xbf, 0x89, 0x1a, + 0x00, 0x21, 0x40, 0x28, 0x09, 0xd0, 0x0a, 0x28, 0x07, 0xd0, 0x0c, 0x28, + 0x05, 0xd0, 0x04, 0x28, 0x08, 0xd1, 0x95, 0xf8, 0x70, 0x00, 0x7f, 0x28, + 0x04, 0xd1, 0x44, 0x48, 0x59, 0x46, 0x00, 0x22, 0x00, 0x23, 0x02, 0xe0, + 0x41, 0x48, 0x8a, 0xb2, 0x59, 0x46, 0x05, 0x68, 0x00, 0x20, 0x00, 0x90, + 0x20, 0x46, 0xa8, 0x47, 0x0f, 0x9d, 0xdb, 0xf8, 0x10, 0x00, 0xb5, 0xf8, + 0x47, 0x10, 0x08, 0x44, 0xcb, 0xf8, 0x10, 0x00, 0x9d, 0xf8, 0x63, 0x00, + 0x00, 0xeb, 0x80, 0x00, 0x56, 0xf8, 0x30, 0x00, 0xff, 0xf7, 0x38, 0xfc, + 0x95, 0xf8, 0x50, 0x00, 0x0c, 0x28, 0x0b, 0xd0, 0x0a, 0x28, 0x1a, 0xd1, + 0x9d, 0xf8, 0x63, 0x00, 0x3e, 0x49, 0x00, 0xeb, 0x80, 0x00, 0x0a, 0x68, + 0x00, 0x21, 0x56, 0xf8, 0x30, 0x00, 0x0f, 0xe0, 0x22, 0x98, 0x70, 0xb1, + 0x2a, 0x78, 0x95, 0xf8, 0x30, 0x30, 0x30, 0x68, 0xb1, 0x6a, 0x00, 0x24, + 0x03, 0x2a, 0x36, 0x4a, 0x18, 0xbf, 0x20, 0x46, 0x03, 0x2b, 0x18, 0xbf, + 0x21, 0x46, 0x12, 0x68, 0x90, 0x47, 0xf2, 0xf7, 0xe5, 0xff, 0x01, 0x46, + 0x9d, 0xf8, 0x63, 0x00, 0x00, 0xeb, 0x80, 0x00, 0x56, 0xf8, 0x30, 0x00, + 0xd0, 0xf8, 0x04, 0x25, 0x89, 0x1a, 0x2d, 0x4a, 0x21, 0xf0, 0x70, 0x41, + 0x12, 0x78, 0x01, 0xeb, 0x81, 0x01, 0x49, 0x00, 0x52, 0x07, 0x04, 0xd4, + 0xb1, 0xf5, 0xfa, 0x4f, 0xff, 0xf4, 0xad, 0xad, 0x1c, 0xe0, 0x95, 0xf8, + 0x50, 0x20, 0x02, 0x2a, 0x03, 0xd1, 0x95, 0xf8, 0x6f, 0x20, 0x01, 0x2a, + 0xf2, 0xd0, 0xb1, 0xf5, 0xfa, 0x4f, 0xff, 0xf4, 0xa0, 0xad, 0x48, 0xf2, + 0x3f, 0x32, 0x91, 0x42, 0x0c, 0xd8, 0xd0, 0xf8, 0x08, 0x15, 0xc5, 0xf8, + 0x67, 0x10, 0x1d, 0x49, 0x09, 0x68, 0x88, 0x47, 0x9d, 0xf8, 0x63, 0x00, + 0x00, 0xeb, 0x80, 0x00, 0x57, 0xf8, 0x30, 0x00, 0x19, 0x49, 0x09, 0x68, + 0xeb, 0xe5, 0x00, 0xbf, 0x40, 0x01, 0x00, 0x00, 0x4c, 0x49, 0x01, 0x00, + 0x86, 0xe4, 0x05, 0x00, 0x10, 0xa2, 0x08, 0x00, 0xac, 0x76, 0x01, 0x00, + 0xe8, 0x49, 0x01, 0x00, 0x04, 0xa2, 0x08, 0x00, 0x8c, 0xe4, 0x05, 0x00, + 0x14, 0xa2, 0x08, 0x00, 0x20, 0xa2, 0x08, 0x00, 0x18, 0xa2, 0x08, 0x00, + 0x40, 0x86, 0x08, 0x00, 0x34, 0xf3, 0x08, 0x00, 0x1c, 0xa2, 0x08, 0x00, + 0x84, 0x4a, 0x01, 0x00, 0xec, 0x4a, 0x01, 0x00, 0x08, 0xa2, 0x08, 0x00, + 0x48, 0xa1, 0x08, 0x00, 0xe9, 0xe5, 0x04, 0x00, 0x44, 0xa2, 0x08, 0x00, + 0x48, 0xa2, 0x08, 0x00, 0x24, 0xa2, 0x08, 0x00, 0x28, 0x5e, 0x01, 0x00, + 0xfc, 0xa1, 0x08, 0x00, 0x38, 0xa2, 0x08, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x97, 0xb0, 0xd5, 0x4d, 0x06, 0x92, 0x83, 0x46, + 0x0e, 0x46, 0xbb, 0xf1, 0x00, 0x0f, 0x28, 0x68, 0x16, 0x90, 0x04, 0xd1, + 0x00, 0x20, 0x40, 0xf2, 0xca, 0x41, 0xf8, 0xf7, 0xbd, 0xfd, 0xcf, 0x48, + 0x0d, 0xf1, 0x4a, 0x01, 0x10, 0xaa, 0x12, 0xab, 0x04, 0x68, 0x11, 0xa8, + 0xa0, 0x47, 0xbd, 0xf8, 0x4a, 0x00, 0xbd, 0xf8, 0x48, 0x10, 0x08, 0x44, + 0x0a, 0x28, 0x01, 0xd2, 0x00, 0x24, 0x81, 0xe1, 0x0b, 0xf1, 0x20, 0x00, + 0xdf, 0xf8, 0x18, 0x83, 0x04, 0x96, 0x4f, 0xf0, 0x0a, 0x09, 0x00, 0x24, + 0x13, 0xae, 0x4f, 0xf0, 0x00, 0x0a, 0x0a, 0x25, 0xcd, 0xf8, 0x20, 0xb0, + 0x05, 0x90, 0x00, 0x20, 0x0a, 0x90, 0xaf, 0xb2, 0x0c, 0x2f, 0x0c, 0xd2, + 0x1f, 0xfa, 0x8a, 0xf3, 0x10, 0x9a, 0xbd, 0xf8, 0x4a, 0x10, 0x11, 0x98, + 0xcd, 0xe9, 0x00, 0x37, 0x00, 0x23, 0x02, 0x96, 0x23, 0xf0, 0x0e, 0xff, + 0x04, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0xe2, 0x41, 0xf8, 0xf7, 0x86, 0xfd, + 0xd8, 0xf8, 0x00, 0x10, 0x38, 0x46, 0x88, 0x47, 0xe0, 0xb2, 0x0a, 0xeb, + 0x05, 0x07, 0x04, 0x28, 0x00, 0xf2, 0xa4, 0x80, 0xdf, 0xe8, 0x00, 0xf0, + 0x03, 0x5c, 0x65, 0x6c, 0x7d, 0x00, 0x9d, 0xf8, 0x54, 0x00, 0x9d, 0xf8, + 0x55, 0x10, 0xc8, 0x46, 0x40, 0xea, 0x01, 0x24, 0xbd, 0xf8, 0x4a, 0x00, + 0xbd, 0xf8, 0x48, 0x10, 0xa6, 0xb2, 0x16, 0xfa, 0x85, 0xf9, 0x08, 0x44, + 0x48, 0x45, 0xc0, 0xf0, 0x2b, 0x81, 0x9d, 0xf8, 0x52, 0x00, 0x9d, 0xf8, + 0x53, 0x10, 0x40, 0xea, 0x01, 0x20, 0x09, 0x90, 0x00, 0xf0, 0x03, 0x0b, + 0x06, 0x98, 0x83, 0x45, 0x10, 0xd0, 0x06, 0x98, 0x01, 0x21, 0x01, 0x22, + 0x0d, 0xf1, 0x2e, 0x03, 0x8d, 0xf8, 0x2e, 0xb0, 0x8d, 0xf8, 0x2f, 0x00, + 0x9b, 0x48, 0xd0, 0xf8, 0x00, 0xc0, 0x02, 0x20, 0x00, 0x90, 0x40, 0xf6, + 0x61, 0x10, 0xe0, 0x47, 0x4b, 0xf0, 0x02, 0x00, 0x02, 0x28, 0x40, 0xf0, + 0x10, 0x81, 0xdd, 0xe9, 0x08, 0xa0, 0x06, 0x21, 0x13, 0xaa, 0x06, 0x23, + 0xaa, 0xf8, 0x06, 0x00, 0x50, 0x46, 0xf2, 0xf7, 0xe9, 0xfe, 0x91, 0x4a, + 0x06, 0xf0, 0x01, 0x01, 0xaa, 0xf8, 0x08, 0x40, 0x8a, 0xf8, 0x0c, 0x10, + 0x49, 0x44, 0x50, 0x88, 0x02, 0x31, 0x8b, 0xb2, 0x01, 0x30, 0x50, 0x80, + 0x11, 0x9a, 0x0c, 0x92, 0xbd, 0xf8, 0x4a, 0x20, 0x93, 0x42, 0x28, 0xbf, + 0x13, 0x46, 0xad, 0xf8, 0x34, 0x30, 0x52, 0xd9, 0x10, 0x9b, 0x89, 0x1a, + 0x0e, 0x93, 0x50, 0xe0, 0x9d, 0xf8, 0x4c, 0x00, 0x02, 0x24, 0x8b, 0xf8, + 0x20, 0x00, 0x00, 0x28, 0x08, 0xbf, 0x04, 0x24, 0x3b, 0xe0, 0x9d, 0xf8, + 0x4c, 0x00, 0x9d, 0xf8, 0x4d, 0x50, 0x03, 0x24, 0x07, 0x90, 0x35, 0xe0, + 0x79, 0x4a, 0x07, 0x9b, 0x00, 0x20, 0x12, 0xf8, 0x30, 0x10, 0x8b, 0x42, + 0x1d, 0xd0, 0x00, 0x28, 0x4f, 0xf0, 0x01, 0x00, 0xf7, 0xd0, 0x00, 0x20, + 0x40, 0xf2, 0x9e, 0x51, 0xf8, 0xf7, 0xfe, 0xfc, 0x19, 0xe0, 0x9d, 0xf8, + 0x4c, 0x00, 0x9d, 0xf8, 0x4d, 0x10, 0x9d, 0xf8, 0x4e, 0x20, 0x41, 0xea, + 0x02, 0x24, 0x00, 0x28, 0x5a, 0xd0, 0x00, 0x20, 0x4f, 0xf4, 0xb7, 0x61, + 0xf8, 0xf7, 0xee, 0xfc, 0x04, 0xeb, 0x07, 0x0a, 0x04, 0x24, 0x03, 0x25, + 0x11, 0xe0, 0x02, 0xeb, 0xc0, 0x00, 0x31, 0x46, 0x42, 0x68, 0x05, 0x98, + 0x90, 0x47, 0x0a, 0x99, 0x9b, 0xf8, 0x20, 0x00, 0x04, 0x24, 0x01, 0x31, + 0x0a, 0x91, 0xc9, 0xb2, 0x81, 0x42, 0x38, 0xbf, 0x02, 0x24, 0x03, 0x25, + 0xba, 0x46, 0x1f, 0xfa, 0x89, 0xf0, 0x1f, 0xfa, 0x8a, 0xf1, 0x81, 0x42, + 0xff, 0xf4, 0x35, 0xaf, 0x92, 0xe0, 0x00, 0x21, 0x0e, 0x91, 0xad, 0xf8, + 0x3c, 0x10, 0x5b, 0x49, 0x01, 0x22, 0xc1, 0x46, 0x0b, 0x68, 0x81, 0xb2, + 0x0c, 0xa8, 0x98, 0x47, 0x04, 0xeb, 0x08, 0x09, 0xdf, 0xf8, 0x48, 0x81, + 0xbb, 0xf1, 0x02, 0x0f, 0x44, 0xd0, 0xbb, 0xf1, 0x00, 0x0f, 0x56, 0xd1, + 0xdd, 0xf8, 0x20, 0xb0, 0xbd, 0xf8, 0x4a, 0x10, 0x16, 0xfa, 0x87, 0xfa, + 0x9b, 0xf8, 0x0c, 0x00, 0x8a, 0x45, 0xab, 0xf8, 0x0a, 0x40, 0x00, 0xf1, + 0x02, 0x00, 0x8b, 0xf8, 0x0c, 0x00, 0xb8, 0xb2, 0x4b, 0xd9, 0x81, 0x42, + 0x4b, 0xd9, 0x10, 0x9a, 0xcb, 0xf8, 0x18, 0x20, 0xca, 0x1b, 0xab, 0xf8, + 0x14, 0x20, 0x11, 0x9a, 0x10, 0x44, 0xcb, 0xf8, 0x10, 0x00, 0xe0, 0x19, + 0x40, 0x1a, 0xab, 0xf8, 0x1c, 0x00, 0x43, 0xe0, 0x20, 0x04, 0xa2, 0xd0, + 0x04, 0x99, 0xa0, 0xb2, 0x88, 0x42, 0x9e, 0xd8, 0xbd, 0xf8, 0x4a, 0x10, + 0x10, 0xfa, 0x87, 0xfa, 0xb8, 0xb2, 0xab, 0xf8, 0x0a, 0x40, 0x8a, 0x45, + 0x42, 0xd9, 0x81, 0x42, 0x42, 0xd9, 0x10, 0x9a, 0xcb, 0xf8, 0x18, 0x20, + 0xca, 0x1b, 0xab, 0xf8, 0x14, 0x20, 0x11, 0x9a, 0x10, 0x44, 0xcb, 0xf8, + 0x10, 0x00, 0xe0, 0x19, 0x40, 0x1a, 0xab, 0xf8, 0x1c, 0x00, 0x8b, 0xe7, + 0xdd, 0xf8, 0x20, 0xb0, 0x09, 0x98, 0x01, 0x24, 0x01, 0x25, 0xba, 0x46, + 0x13, 0xae, 0x9b, 0xf8, 0x0c, 0x10, 0x80, 0xb2, 0x10, 0xf0, 0x04, 0x00, + 0x01, 0xf1, 0x02, 0x01, 0x8b, 0xf8, 0x0c, 0x10, 0x08, 0xbf, 0x04, 0x24, + 0x08, 0xbf, 0x03, 0x25, 0x8b, 0xe7, 0xdd, 0xf8, 0x20, 0xb0, 0x00, 0x24, + 0xba, 0x46, 0x13, 0xae, 0x85, 0xe7, 0x11, 0x99, 0x01, 0xe0, 0x40, 0x1a, + 0x10, 0x99, 0xab, 0xf8, 0x14, 0x40, 0x08, 0x44, 0xcb, 0xf8, 0x10, 0x00, + 0x1f, 0xfa, 0x8a, 0xf0, 0x1f, 0xfa, 0x89, 0xf1, 0x13, 0xae, 0x81, 0x42, + 0x10, 0xd0, 0x00, 0x20, 0x40, 0xf2, 0x5c, 0x51, 0x00, 0x24, 0xf8, 0xf7, + 0x47, 0xfc, 0x6e, 0xe7, 0x11, 0x99, 0x01, 0xe0, 0x40, 0x1a, 0x10, 0x99, + 0xab, 0xf8, 0x14, 0x40, 0x08, 0x44, 0xcb, 0xf8, 0x10, 0x00, 0x4f, 0xe7, + 0x01, 0x24, 0x0e, 0xe0, 0x00, 0xf0, 0x78, 0xfa, 0x00, 0x24, 0x00, 0x20, + 0x40, 0xf2, 0xff, 0x41, 0x05, 0xe0, 0x00, 0xf0, 0x71, 0xfa, 0x00, 0x24, + 0x00, 0x20, 0x4f, 0xf4, 0xa2, 0x61, 0xf2, 0xf7, 0xc9, 0xfd, 0x05, 0x4d, + 0x28, 0x68, 0x16, 0x99, 0x40, 0x1a, 0x02, 0xbf, 0x20, 0x46, 0x17, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0xf8, 0xf7, 0x0e, 0xfc, 0x38, 0xec, 0x01, 0x00, + 0x78, 0x9d, 0x08, 0x00, 0x34, 0xf3, 0x08, 0x00, 0x30, 0xd3, 0x05, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0x76, 0xe5, 0x05, 0x00, 0x04, 0xb1, 0x08, 0x00, + 0xbc, 0xb5, 0x24, 0x4c, 0x28, 0x21, 0x20, 0x46, 0xf4, 0xf7, 0x50, 0xff, + 0x22, 0x48, 0x4f, 0xf6, 0xff, 0x75, 0xe5, 0x80, 0xc1, 0x8a, 0x21, 0x48, + 0x90, 0xf8, 0x78, 0x00, 0x02, 0x09, 0x20, 0x46, 0xff, 0xf7, 0x32, 0xfe, + 0xd0, 0xb1, 0x1e, 0x49, 0x60, 0x89, 0x09, 0x68, 0x88, 0x47, 0xe0, 0x88, + 0xa8, 0x42, 0x06, 0xd0, 0x1b, 0x49, 0x20, 0x7b, 0x09, 0x68, 0x88, 0x47, + 0x4f, 0xf6, 0xff, 0x70, 0xe0, 0x80, 0x19, 0x48, 0x01, 0x68, 0x0b, 0x20, + 0x88, 0x47, 0x18, 0x48, 0x4f, 0xf4, 0x7a, 0x71, 0x4f, 0xf4, 0x7a, 0x72, + 0x00, 0x23, 0x04, 0x68, 0x0b, 0x20, 0xa0, 0x47, 0x14, 0x48, 0x01, 0x68, + 0x00, 0x20, 0x88, 0x47, 0xea, 0x4c, 0xad, 0xf8, 0x06, 0x00, 0xb4, 0xf8, + 0x72, 0x10, 0x88, 0x42, 0x0c, 0xd0, 0x9b, 0x48, 0x0d, 0xf1, 0x06, 0x03, + 0x01, 0x21, 0x03, 0x22, 0x05, 0x68, 0x02, 0x20, 0x00, 0x90, 0x40, 0xf6, + 0x01, 0x10, 0xa8, 0x47, 0xbd, 0xf8, 0x06, 0x00, 0xa4, 0xf8, 0x72, 0x00, + 0xbc, 0xbd, 0x00, 0xbf, 0x8c, 0xe4, 0x05, 0x00, 0x40, 0x01, 0x00, 0x00, + 0x40, 0x86, 0x08, 0x00, 0x38, 0xaf, 0x08, 0x00, 0x34, 0xf3, 0x08, 0x00, + 0x30, 0x9d, 0x08, 0x00, 0x20, 0x9d, 0x08, 0x00, 0x3c, 0xaf, 0x08, 0x00, + 0xf8, 0xb5, 0x04, 0x46, 0x37, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, + 0xc5, 0x00, 0x40, 0xf2, 0x59, 0x13, 0x1f, 0x22, 0x00, 0x21, 0xb5, 0xfb, + 0xf3, 0xf7, 0xe2, 0x71, 0x96, 0x22, 0x61, 0x72, 0x21, 0x72, 0x21, 0x73, + 0xa1, 0x72, 0x32, 0x23, 0x21, 0x74, 0xa1, 0x74, 0xa1, 0x75, 0x21, 0x76, + 0x21, 0x77, 0x84, 0xf8, 0x22, 0x10, 0xa1, 0x77, 0x84, 0xf8, 0x28, 0x10, + 0x84, 0xf8, 0x24, 0x10, 0xe2, 0x72, 0xe3, 0x73, 0x62, 0x74, 0x63, 0x75, + 0xe2, 0x75, 0xe3, 0x76, 0x84, 0xf8, 0x21, 0x30, 0x62, 0x77, 0x84, 0xf8, + 0x23, 0x20, 0x84, 0xf8, 0x27, 0x30, 0x00, 0x22, 0x3e, 0x0a, 0x67, 0x73, + 0xa6, 0x73, 0x71, 0x4e, 0x37, 0x80, 0xa5, 0x27, 0x73, 0x80, 0x33, 0x81, + 0xf3, 0x81, 0xb5, 0xfb, 0xf7, 0xf7, 0xf7, 0x80, 0xe7, 0x74, 0x3f, 0x0a, + 0x27, 0x75, 0x4f, 0xf4, 0xbe, 0x77, 0xb3, 0x82, 0xb5, 0xfb, 0xf7, 0xf7, + 0xb7, 0x81, 0x67, 0x76, 0x3f, 0x0a, 0xa7, 0x76, 0x48, 0x27, 0x73, 0x83, + 0x27, 0x23, 0xb0, 0xfb, 0xf7, 0xf0, 0x40, 0xf2, 0xde, 0x37, 0xb5, 0xfb, + 0xf7, 0xf5, 0x70, 0x82, 0xe0, 0x77, 0x35, 0x83, 0x06, 0x0a, 0x28, 0x0a, + 0x84, 0xf8, 0x25, 0x50, 0x84, 0xf8, 0x26, 0x00, 0x02, 0x20, 0x84, 0xf8, + 0x20, 0x60, 0x9d, 0x1c, 0x04, 0x33, 0x01, 0x32, 0xee, 0xb2, 0x54, 0xfa, + 0x85, 0xf5, 0x1b, 0x2a, 0x69, 0x70, 0xdd, 0xb2, 0xa1, 0x55, 0x61, 0x55, + 0x54, 0xfa, 0x83, 0xf5, 0x50, 0xfa, 0x83, 0xf3, 0x69, 0x70, 0xdd, 0xb2, + 0x61, 0x55, 0x54, 0xfa, 0x83, 0xf5, 0x69, 0x70, 0xe9, 0xd1, 0xf8, 0xbd, + 0x98, 0xd4, 0x08, 0x00, 0xb0, 0xb5, 0x4f, 0x49, 0x0a, 0x88, 0x9a, 0xb1, + 0x9a, 0x4a, 0x04, 0x79, 0x40, 0x79, 0x92, 0xf8, 0x28, 0x30, 0x01, 0x2b, + 0x03, 0xd0, 0x92, 0xf8, 0x58, 0x30, 0x01, 0x2b, 0x0a, 0xd1, 0x92, 0xf8, + 0x79, 0x20, 0x09, 0x2a, 0x04, 0xd8, 0x40, 0xf2, 0x15, 0x33, 0xd3, 0x40, + 0xdb, 0x07, 0x13, 0xd1, 0x00, 0x20, 0xb0, 0xbd, 0x44, 0xea, 0x00, 0x22, + 0x02, 0x31, 0x00, 0x23, 0x0d, 0x88, 0xaa, 0x42, 0x04, 0xd3, 0x31, 0xf8, + 0x02, 0x5c, 0xaa, 0x42, 0x98, 0xbf, 0x15, 0x46, 0x01, 0x33, 0x4d, 0x80, + 0x06, 0x31, 0x05, 0x2b, 0xf2, 0xd1, 0x18, 0xe0, 0x44, 0xea, 0x00, 0x20, + 0x0d, 0x4c, 0x53, 0xb2, 0x54, 0xf8, 0x23, 0x30, 0x03, 0xeb, 0x43, 0x03, + 0x01, 0xeb, 0x43, 0x04, 0x64, 0x88, 0xa0, 0x42, 0x05, 0xd3, 0x31, 0xf8, + 0x13, 0x10, 0x88, 0x42, 0x88, 0xbf, 0x08, 0x46, 0x04, 0x46, 0x95, 0x48, + 0x21, 0x46, 0x03, 0x68, 0x00, 0x20, 0x98, 0x47, 0x20, 0x0a, 0xe1, 0xb2, + 0x41, 0xea, 0x00, 0x20, 0xb0, 0xbd, 0x00, 0xbf, 0x4c, 0xce, 0x05, 0x00, + 0x2d, 0xe9, 0xfc, 0x41, 0x0c, 0x46, 0x00, 0x20, 0x09, 0x2a, 0x0a, 0xd8, + 0x4f, 0xf0, 0x00, 0x08, 0xdf, 0xe8, 0x02, 0xf0, 0x05, 0x1d, 0x0a, 0x1d, + 0x0f, 0x1d, 0x1d, 0x1d, 0x14, 0x19, 0x22, 0x48, 0x80, 0x88, 0x4f, 0xf0, + 0x00, 0x08, 0x12, 0xe0, 0x1f, 0x48, 0x4f, 0xf0, 0x01, 0x08, 0x40, 0x89, + 0x0d, 0xe0, 0x1d, 0x48, 0x4f, 0xf0, 0x04, 0x08, 0x80, 0x8b, 0x08, 0xe0, + 0x1a, 0x48, 0x4f, 0xf0, 0x02, 0x08, 0x00, 0x8a, 0x03, 0xe0, 0x18, 0x48, + 0x4f, 0xf0, 0x03, 0x08, 0xc0, 0x8a, 0x24, 0xb9, 0x04, 0x46, 0x00, 0x28, + 0x0c, 0xbf, 0xc8, 0x24, 0xc8, 0x20, 0x60, 0x4f, 0x61, 0x01, 0x0a, 0x23, + 0x40, 0x01, 0xb1, 0xfb, 0xf3, 0xf6, 0xb0, 0xfb, 0xf3, 0xf1, 0x38, 0x6e, + 0x81, 0x42, 0x18, 0xbf, 0x86, 0x42, 0x16, 0xd8, 0x0d, 0x48, 0x8d, 0xf8, + 0x06, 0x20, 0x01, 0xab, 0x01, 0x21, 0x00, 0x22, 0xad, 0xf8, 0x04, 0x40, + 0x05, 0x68, 0x04, 0x20, 0x00, 0x90, 0x40, 0xf6, 0x12, 0x10, 0xa8, 0x47, + 0x05, 0x49, 0x08, 0xeb, 0x48, 0x00, 0x3e, 0x66, 0x01, 0xeb, 0x40, 0x00, + 0x84, 0x80, 0xbd, 0xe8, 0xfc, 0x81, 0x00, 0x28, 0xfb, 0xd1, 0xe5, 0xe7, + 0xb4, 0xe4, 0x05, 0x00, 0xa0, 0xa0, 0x08, 0x00, 0x80, 0xb5, 0x4a, 0x4a, + 0x00, 0xeb, 0x40, 0x01, 0x02, 0xeb, 0x01, 0x11, 0x91, 0xf8, 0x28, 0x20, + 0x0a, 0xb9, 0x49, 0x69, 0x61, 0xb1, 0x00, 0xf0, 0xd9, 0xf8, 0x00, 0xb1, + 0x80, 0xbd, 0x07, 0x48, 0x4f, 0xf4, 0xfa, 0x51, 0x01, 0x60, 0x0a, 0x48, + 0x01, 0x21, 0x01, 0x70, 0x00, 0x20, 0x80, 0xbd, 0x07, 0x49, 0x09, 0x78, + 0x00, 0x29, 0xee, 0xd0, 0x07, 0x20, 0x80, 0xbd, 0xe0, 0x77, 0x01, 0x00, + 0x80, 0xb5, 0x00, 0xf0, 0xc9, 0xf8, 0x02, 0x48, 0x00, 0x21, 0x01, 0x70, + 0x80, 0xbd, 0x00, 0xbf, 0x74, 0xe5, 0x05, 0x00, 0x80, 0xb5, 0x09, 0x49, + 0x09, 0x68, 0x88, 0x47, 0x58, 0xb1, 0x33, 0x48, 0x90, 0xf8, 0x79, 0x00, + 0x0a, 0x28, 0x06, 0xd1, 0x05, 0x48, 0x00, 0x78, 0x01, 0x38, 0xb0, 0xfa, + 0x80, 0xf0, 0x40, 0x09, 0x80, 0xbd, 0x01, 0x20, 0x80, 0xbd, 0x00, 0xbf, + 0x54, 0x9d, 0x08, 0x00, 0x84, 0xe4, 0x05, 0x00, 0x70, 0xb5, 0x1d, 0x4e, + 0x05, 0x46, 0x81, 0xf8, 0x32, 0x04, 0x00, 0xeb, 0x80, 0x00, 0x0c, 0x46, + 0x28, 0x21, 0x06, 0xeb, 0xc0, 0x00, 0xf4, 0xf7, 0x95, 0xfd, 0x94, 0xf8, + 0x32, 0x04, 0x00, 0xeb, 0x80, 0x00, 0x46, 0xf8, 0x30, 0x40, 0x20, 0x48, + 0x90, 0xf8, 0x7a, 0x00, 0x28, 0xb9, 0x13, 0x48, 0xb4, 0xf8, 0x30, 0x14, + 0x00, 0xeb, 0x85, 0x10, 0x41, 0x86, 0x11, 0x48, 0x72, 0xb6, 0x01, 0x68, + 0x49, 0x00, 0x01, 0x31, 0x01, 0x60, 0x4f, 0xf0, 0xff, 0x31, 0xc4, 0xf8, + 0x70, 0x11, 0x94, 0xf8, 0x33, 0x14, 0x41, 0xf0, 0x01, 0x01, 0x84, 0xf8, + 0x33, 0x14, 0x01, 0x68, 0x49, 0x08, 0x01, 0x60, 0x01, 0x21, 0x00, 0x68, + 0x80, 0xf3, 0x10, 0x88, 0x00, 0x20, 0x84, 0xf8, 0xf3, 0x14, 0xc4, 0xf8, + 0x04, 0x05, 0xc4, 0xf8, 0x08, 0x05, 0x70, 0xbd, 0x40, 0x01, 0x00, 0x00, + 0xe8, 0x49, 0x01, 0x00, 0x24, 0x36, 0x01, 0x00, 0x1c, 0xb5, 0x08, 0x4c, + 0xd4, 0xe9, 0x19, 0x01, 0xcd, 0xe9, 0x00, 0x01, 0x00, 0xf0, 0x66, 0xf8, + 0x05, 0x48, 0x01, 0x68, 0x21, 0xb9, 0xdd, 0xe9, 0x00, 0x12, 0x44, 0xf8, + 0x64, 0x1f, 0x62, 0x60, 0x80, 0x68, 0x1c, 0xbd, 0x4c, 0x49, 0x01, 0x00, + 0x84, 0x4a, 0x01, 0x00, 0x0d, 0x48, 0x0e, 0x49, 0x01, 0x60, 0x0e, 0x48, + 0x0e, 0x49, 0x01, 0x60, 0x0e, 0x48, 0x0f, 0x49, 0x01, 0x60, 0x0f, 0x48, + 0x0f, 0x49, 0x01, 0x60, 0x0f, 0x48, 0x10, 0x49, 0x01, 0x60, 0x10, 0x48, + 0x10, 0x49, 0x01, 0x60, 0x10, 0x48, 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, + 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, 0x12, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xf0, 0x98, 0x08, 0x00, 0x39, 0xd9, 0x02, 0x00, 0x58, 0xfa, 0x08, 0x00, + 0x51, 0xd7, 0x02, 0x00, 0xbc, 0xae, 0x08, 0x00, 0x9d, 0xe4, 0x02, 0x00, + 0x18, 0xa2, 0x08, 0x00, 0x5d, 0xd8, 0x02, 0x00, 0x44, 0xaf, 0x08, 0x00, + 0xd1, 0xe6, 0x02, 0x00, 0x50, 0xd9, 0x08, 0x00, 0x81, 0xe7, 0x02, 0x00, + 0x10, 0xe2, 0x08, 0x00, 0xc1, 0xe7, 0x02, 0x00, 0x54, 0xd9, 0x08, 0x00, + 0x05, 0xe8, 0x02, 0x00, 0x20, 0xa2, 0x08, 0x00, 0x89, 0xe8, 0x02, 0x00, + 0x40, 0xf2, 0x81, 0x0c, 0xc1, 0xf2, 0x04, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x42, 0xf6, 0x19, 0x2c, 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x40, 0xf2, 0x29, 0x3c, 0xc1, 0xf2, 0x04, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4e, 0xf6, 0x75, 0x1c, 0xc1, 0xf2, 0x03, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4f, 0xf6, 0x11, 0x3c, 0xc1, 0xf2, 0x03, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x2d, 0xe9, 0xf0, 0x4f, 0x8b, 0xb0, 0x90, 0xf8, 0x32, 0x54, 0x83, 0x49, + 0x04, 0x46, 0x05, 0xeb, 0x85, 0x00, 0x01, 0xeb, 0xc0, 0x08, 0x85, 0x49, + 0x08, 0xf1, 0x04, 0x00, 0x01, 0x90, 0x05, 0xeb, 0x45, 0x00, 0x01, 0xeb, + 0x00, 0x19, 0x09, 0xf1, 0x0c, 0x00, 0x09, 0xf1, 0x14, 0x06, 0x04, 0x90, + 0x09, 0xf1, 0x08, 0x00, 0x03, 0x90, 0x09, 0xf1, 0x04, 0x00, 0x02, 0x90, + 0x09, 0xf1, 0x20, 0x00, 0x07, 0x90, 0x09, 0xf1, 0x1c, 0x00, 0x06, 0x90, + 0x34, 0x48, 0x00, 0x68, 0x80, 0x47, 0x05, 0x90, 0xa8, 0x1c, 0x00, 0x25, + 0x4f, 0xf0, 0x02, 0x0a, 0x4f, 0xf0, 0x00, 0x0b, 0x00, 0x90, 0x07, 0x98, + 0x06, 0x99, 0x00, 0x68, 0x09, 0x68, 0x81, 0x42, 0x55, 0xd0, 0x6c, 0x48, + 0x08, 0xa9, 0x08, 0x22, 0x00, 0x23, 0x07, 0x68, 0x30, 0x46, 0xb8, 0x47, + 0x6c, 0x48, 0x00, 0x6e, 0xd0, 0xb1, 0x09, 0x99, 0x05, 0x9a, 0x51, 0x1a, + 0x21, 0xf0, 0x70, 0x41, 0x88, 0x42, 0x13, 0xd8, 0xd9, 0xf8, 0x00, 0x10, + 0x04, 0x9a, 0x01, 0x25, 0x08, 0x44, 0x02, 0x99, 0xc9, 0xf8, 0x00, 0x00, + 0x08, 0x68, 0x01, 0x30, 0x08, 0x60, 0x03, 0x99, 0x08, 0x68, 0x01, 0x30, + 0x08, 0x60, 0x10, 0x68, 0xbd, 0xf8, 0x20, 0x10, 0x08, 0x44, 0x10, 0x60, + 0xd8, 0xf8, 0x00, 0x00, 0xa0, 0x42, 0x1c, 0xd1, 0xdc, 0xb1, 0x94, 0xf8, + 0x33, 0x04, 0x80, 0x07, 0x17, 0xd5, 0x55, 0x48, 0x0a, 0xa9, 0x04, 0x22, + 0x04, 0x23, 0x07, 0x68, 0x01, 0x98, 0xb8, 0x47, 0x00, 0x98, 0x08, 0xa9, + 0x08, 0x5c, 0x60, 0xb1, 0xdd, 0xe9, 0x09, 0x10, 0x81, 0x42, 0x08, 0xd1, + 0x01, 0x2d, 0x04, 0xd1, 0x8f, 0x49, 0xd8, 0xf8, 0x00, 0x00, 0x09, 0x68, + 0x88, 0x47, 0x0b, 0xf1, 0x01, 0x0b, 0x5f, 0xea, 0x0b, 0x60, 0x18, 0xbf, + 0x01, 0x2d, 0x0a, 0xd1, 0x07, 0x48, 0xbd, 0xf8, 0x20, 0x10, 0x02, 0x68, + 0x30, 0x46, 0x90, 0x47, 0xaa, 0xf1, 0x01, 0x0a, 0x5f, 0xea, 0x0a, 0x60, + 0xa3, 0xd1, 0x0b, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0xe0, 0xa0, 0x08, 0x00, + 0x38, 0xe5, 0x08, 0x00, 0x90, 0xf8, 0x32, 0x14, 0x3b, 0x4a, 0x01, 0xeb, + 0x81, 0x01, 0x02, 0xeb, 0xc1, 0x01, 0xd1, 0xe9, 0x03, 0x21, 0x8a, 0x42, + 0x18, 0xbf, 0x00, 0xf0, 0x05, 0xb9, 0x70, 0x47, 0xf8, 0xb5, 0x04, 0x46, + 0x00, 0x20, 0x8d, 0xf8, 0x03, 0x00, 0x1c, 0xb9, 0x00, 0x20, 0xe1, 0x21, + 0xf2, 0xf7, 0x9c, 0xfa, 0x65, 0x68, 0x30, 0x49, 0x95, 0xf8, 0x32, 0x64, + 0x06, 0xeb, 0x86, 0x00, 0x01, 0xeb, 0xc0, 0x01, 0x08, 0x46, 0x50, 0xf8, + 0x04, 0x2f, 0xda, 0xb3, 0x8b, 0x68, 0x9a, 0x42, 0x38, 0xd0, 0xd1, 0xe9, + 0x03, 0x21, 0x8a, 0x42, 0x34, 0xd0, 0x28, 0x49, 0xb3, 0x1c, 0x01, 0x22, + 0x0f, 0x68, 0x0d, 0xf1, 0x03, 0x01, 0xb8, 0x47, 0x95, 0xf8, 0x62, 0x00, + 0x01, 0x28, 0x29, 0xd1, 0x9d, 0xf8, 0x03, 0x00, 0x02, 0x28, 0x25, 0xd1, + 0xd5, 0xf8, 0xd4, 0x10, 0x11, 0xb3, 0x0a, 0x7f, 0x04, 0x2a, 0x1f, 0xd8, + 0x1e, 0x48, 0x50, 0xf8, 0x22, 0x20, 0x91, 0x42, 0x1a, 0xd1, 0x91, 0xf8, + 0xe6, 0x20, 0x2a, 0xb9, 0x91, 0xf8, 0xe7, 0x20, 0x12, 0xb9, 0x91, 0xf8, + 0xe8, 0x20, 0x8a, 0xb1, 0x18, 0x4a, 0x80, 0x69, 0x02, 0xeb, 0x86, 0x12, + 0x00, 0x69, 0x92, 0x6a, 0x10, 0x1a, 0x00, 0xf5, 0x70, 0x70, 0x20, 0xf0, + 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x15, 0xd9, 0x52, 0x48, 0x01, 0x68, + 0x28, 0x46, 0x88, 0x47, 0x11, 0x48, 0x90, 0xf8, 0x7b, 0x10, 0x21, 0xb1, + 0x01, 0x39, 0x80, 0xf8, 0x7b, 0x10, 0x08, 0x06, 0x04, 0xd1, 0x0e, 0x48, + 0x14, 0x21, 0x00, 0x78, 0xf2, 0xf7, 0x5e, 0xfa, 0x20, 0x46, 0x00, 0xf0, + 0xa7, 0xf8, 0xf8, 0xbd, 0x20, 0x68, 0x04, 0x30, 0x20, 0x60, 0x06, 0x48, + 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0xf8, 0xbd, 0x40, 0x01, 0x00, 0x00, + 0x34, 0xe5, 0x08, 0x00, 0xfc, 0x73, 0x01, 0x00, 0xe8, 0x49, 0x01, 0x00, + 0xc4, 0xa0, 0x08, 0x00, 0x4c, 0x49, 0x01, 0x00, 0x66, 0x34, 0x01, 0x00, + 0x7c, 0xb5, 0xd0, 0xf8, 0x08, 0x65, 0xd0, 0xf8, 0x0c, 0x55, 0x04, 0x46, + 0xf2, 0xf7, 0x30, 0xfa, 0xd4, 0xf8, 0x04, 0x15, 0x40, 0x1a, 0xf1, 0x00, + 0x20, 0xf0, 0x70, 0x40, 0x00, 0xeb, 0x80, 0x00, 0xc0, 0xf3, 0x1a, 0x10, + 0xb1, 0xfb, 0xf0, 0xf0, 0xa8, 0x42, 0x02, 0xd9, 0x41, 0x1b, 0x01, 0x29, + 0x03, 0xd8, 0x29, 0x1a, 0x39, 0xd9, 0x02, 0x29, 0x37, 0xd3, 0x20, 0x4e, + 0x04, 0xf2, 0x0c, 0x55, 0x72, 0xb6, 0xc4, 0xf8, 0x0c, 0x05, 0x30, 0x68, + 0x40, 0x00, 0x01, 0x30, 0x30, 0x60, 0x1c, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x30, 0x68, 0x01, 0x21, 0x00, 0x22, 0x2b, 0x46, 0x40, 0x08, + 0x30, 0x60, 0x30, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x16, 0x48, 0x06, 0x68, + 0x04, 0x20, 0x00, 0x90, 0x4f, 0xf4, 0x11, 0x60, 0xb0, 0x47, 0x14, 0x48, + 0x94, 0xf8, 0x35, 0x51, 0x06, 0x68, 0x13, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x01, 0x46, 0x28, 0x46, 0xb0, 0x47, 0x94, 0xf8, 0x35, 0x01, + 0x0f, 0x4a, 0x00, 0x23, 0x00, 0xeb, 0xc0, 0x01, 0x02, 0xeb, 0x41, 0x01, + 0x0d, 0x4a, 0x49, 0x78, 0x15, 0x68, 0x20, 0x22, 0x00, 0x92, 0x01, 0x22, + 0xa8, 0x47, 0xf2, 0xf7, 0xe1, 0xf9, 0x00, 0x21, 0xc4, 0xf8, 0x04, 0x05, + 0xc4, 0xf8, 0x08, 0x15, 0x7c, 0xbd, 0x00, 0xbf, 0x24, 0x36, 0x01, 0x00, + 0x00, 0xe2, 0x08, 0x00, 0xa0, 0xa0, 0x08, 0x00, 0x0c, 0xe2, 0x08, 0x00, + 0x24, 0xd9, 0x08, 0x00, 0x44, 0x28, 0x01, 0x00, 0x28, 0xd9, 0x08, 0x00, + 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, + 0x07, 0x48, 0x08, 0x49, 0xc1, 0x64, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0xe8, 0xaf, 0x08, 0x00, 0x95, 0xea, 0x02, 0x00, + 0xec, 0xaf, 0x08, 0x00, 0x71, 0xe9, 0x02, 0x00, 0xc8, 0xae, 0x08, 0x00, + 0xb1, 0xea, 0x02, 0x00, 0x38, 0xa2, 0x08, 0x00, 0xa5, 0xeb, 0x02, 0x00, + 0x42, 0xf6, 0xd9, 0x7c, 0xc1, 0xf2, 0x04, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x43, 0xf2, 0x11, 0x5c, 0xc1, 0xf2, 0x10, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x2d, 0xe9, 0xf0, 0x43, 0x85, 0xb0, 0x0e, 0x46, 0x05, 0x46, 0x00, 0xf0, + 0x39, 0xf9, 0x04, 0x46, 0x73, 0x48, 0x00, 0x78, 0x02, 0x28, 0x52, 0xd1, + 0x2b, 0x48, 0x01, 0x68, 0x13, 0x20, 0x88, 0x47, 0x00, 0x28, 0x04, 0x90, + 0x3e, 0xd0, 0x00, 0xf1, 0x08, 0x01, 0x04, 0xaa, 0x0d, 0xf1, 0x0e, 0x03, + 0x41, 0x60, 0x26, 0x48, 0x0d, 0xf1, 0x0f, 0x01, 0x07, 0x68, 0x03, 0xa8, + 0xcd, 0xe9, 0x00, 0x10, 0x28, 0x46, 0x31, 0x46, 0xb8, 0x47, 0x98, 0xb3, + 0x07, 0x46, 0x21, 0x48, 0x00, 0x21, 0x4f, 0xf0, 0x00, 0x09, 0x00, 0xf5, + 0xe8, 0x70, 0xf6, 0xf7, 0xc5, 0xfa, 0x48, 0xb3, 0x80, 0x46, 0x1d, 0x48, + 0x9d, 0xf8, 0x0e, 0x30, 0x04, 0x9a, 0x3f, 0x21, 0xd0, 0xf8, 0x00, 0xc0, + 0xbd, 0xf8, 0x0c, 0x00, 0xcd, 0xe9, 0x00, 0x90, 0x40, 0x46, 0x02, 0x97, + 0xe0, 0x47, 0x07, 0x46, 0x30, 0x46, 0xf7, 0xf7, 0xd5, 0xff, 0x6d, 0x48, + 0x2c, 0x21, 0x3a, 0x46, 0x15, 0xfb, 0x01, 0x00, 0x12, 0x49, 0x90, 0xf8, + 0x29, 0x00, 0x0b, 0x68, 0x41, 0x46, 0x98, 0x47, 0x01, 0x28, 0x0a, 0xd0, + 0x40, 0x46, 0xf7, 0xf7, 0xc5, 0xff, 0x06, 0xe0, 0x00, 0x20, 0x66, 0x21, + 0x00, 0x25, 0xf7, 0xf7, 0xa1, 0xff, 0x04, 0xe0, 0x00, 0x24, 0x04, 0x98, + 0xf7, 0xf7, 0xba, 0xff, 0x01, 0x25, 0x05, 0xb9, 0x00, 0x24, 0x20, 0x46, + 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x83, 0x00, 0xbf, 0xd4, 0x9b, 0x08, 0x00, + 0xb0, 0xaf, 0x08, 0x00, 0x68, 0x8a, 0x01, 0x00, 0xc0, 0xaf, 0x08, 0x00, + 0xd4, 0xaf, 0x08, 0x00, 0xf0, 0xb5, 0x85, 0xb0, 0x41, 0x4c, 0x94, 0xf8, + 0x8f, 0x50, 0x0b, 0x9c, 0x02, 0x2d, 0x07, 0xd1, 0x09, 0x4d, 0xb5, 0xf8, + 0x22, 0x55, 0x19, 0x3d, 0xa5, 0x42, 0x01, 0xda, 0x12, 0x20, 0x08, 0xe0, + 0x0a, 0x9f, 0xdd, 0xe9, 0x0c, 0x65, 0xcd, 0xe9, 0x00, 0x74, 0xcd, 0xe9, + 0x02, 0x65, 0x00, 0xf0, 0xbf, 0xf8, 0x05, 0xb0, 0xf0, 0xbd, 0x00, 0xbf, + 0x8c, 0x7e, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x85, 0xb0, 0x0c, 0x46, + 0xd1, 0xb2, 0x45, 0x4a, 0x2c, 0x23, 0x11, 0xfb, 0x03, 0x27, 0xf9, 0x7a, + 0x0a, 0x29, 0x42, 0xd1, 0x2b, 0x49, 0x0b, 0x22, 0x03, 0xae, 0x09, 0x78, + 0x02, 0x29, 0x08, 0xbf, 0x0e, 0x22, 0x81, 0x18, 0x21, 0x60, 0x10, 0xf8, + 0x02, 0x90, 0x4d, 0x78, 0x91, 0xf8, 0x02, 0xa0, 0x91, 0xf8, 0x03, 0xb0, + 0x30, 0x46, 0x00, 0xf0, 0xa1, 0xf8, 0x80, 0x46, 0x38, 0x69, 0x32, 0x46, + 0xd0, 0xf8, 0xd4, 0x00, 0x00, 0xf1, 0x14, 0x01, 0x1f, 0x48, 0x03, 0x68, + 0x30, 0x46, 0x98, 0x47, 0x03, 0x9a, 0x40, 0xf2, 0x71, 0x21, 0x49, 0xea, + 0x05, 0x20, 0x1c, 0x4b, 0x40, 0xea, 0x0a, 0x40, 0xa2, 0xfb, 0x01, 0x12, + 0x40, 0xea, 0x0b, 0x60, 0x93, 0xf8, 0x91, 0x30, 0x5f, 0xea, 0x52, 0x02, + 0xbd, 0xf8, 0x10, 0x20, 0x4f, 0xea, 0x31, 0x01, 0x01, 0xeb, 0x12, 0x11, + 0x42, 0x1a, 0x9a, 0x42, 0x0f, 0xdd, 0xa8, 0xeb, 0x03, 0x00, 0x21, 0x68, + 0x10, 0x44, 0x02, 0x0e, 0x08, 0x70, 0xca, 0x70, 0x02, 0x0c, 0x00, 0x0a, + 0x8a, 0x70, 0x48, 0x70, 0x01, 0xe0, 0x00, 0x20, 0x20, 0x60, 0x01, 0x24, + 0x0c, 0xe0, 0xcd, 0xe9, 0x01, 0x01, 0x0a, 0x48, 0x01, 0xab, 0x00, 0x21, + 0x00, 0x22, 0x00, 0x24, 0x05, 0x68, 0x08, 0x20, 0x00, 0x90, 0x40, 0xf6, + 0x22, 0x10, 0xa8, 0x47, 0x20, 0x46, 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0xe7, 0x4a, 0x01, 0x00, 0x48, 0xa1, 0x08, 0x00, 0x40, 0x86, 0x08, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0x10, 0x4a, 0x12, 0x78, 0x01, 0x2a, 0x12, 0xd1, + 0x0f, 0x4a, 0x2c, 0x23, 0x10, 0xfb, 0x03, 0x20, 0x00, 0x69, 0x48, 0xb1, + 0x90, 0xf8, 0x35, 0x01, 0x0d, 0x4a, 0x00, 0xeb, 0x40, 0x00, 0x02, 0xeb, + 0x40, 0x10, 0x42, 0x6c, 0x01, 0x32, 0x42, 0x64, 0x08, 0x46, 0xf7, 0xf7, + 0x07, 0xbf, 0x06, 0x4a, 0x2c, 0x23, 0x10, 0xfb, 0x03, 0x20, 0x00, 0xf1, + 0x14, 0x02, 0x04, 0x48, 0x03, 0x68, 0x08, 0x46, 0x11, 0x46, 0x18, 0x47, + 0xe8, 0x4a, 0x01, 0x00, 0xb8, 0x4a, 0x01, 0x00, 0x4c, 0xb5, 0x08, 0x00, + 0x54, 0xf1, 0x05, 0x00, 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, + 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x44, 0xe2, 0x08, 0x00, + 0xad, 0xed, 0x02, 0x00, 0xdc, 0xaf, 0x08, 0x00, 0xd1, 0xec, 0x02, 0x00, + 0x14, 0xe9, 0x08, 0x00, 0xe9, 0xed, 0x02, 0x00, 0xe0, 0xaf, 0x08, 0x00, + 0xc1, 0xee, 0x02, 0x00, 0x41, 0xf6, 0xc9, 0x3c, 0xc1, 0xf2, 0x04, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0x49, 0x7c, 0xc1, 0xf2, 0x04, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4c, 0xf2, 0x27, 0x0c, 0xc1, 0xf2, 0x0f, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x7c, 0xb5, 0x04, 0x46, 0x08, 0x78, 0x0f, 0x4d, + 0xa0, 0x70, 0x48, 0x78, 0xe0, 0x70, 0x60, 0x78, 0x61, 0x88, 0x40, 0xf0, + 0x02, 0x00, 0x60, 0x70, 0x28, 0x88, 0x88, 0x42, 0x0e, 0xd0, 0xad, 0xf8, + 0x06, 0x00, 0x09, 0x48, 0xad, 0xf8, 0x04, 0x10, 0x01, 0xab, 0x00, 0x21, + 0x01, 0x22, 0x06, 0x68, 0x04, 0x20, 0x00, 0x90, 0x40, 0xf6, 0x62, 0x10, + 0xb0, 0x47, 0x60, 0x88, 0x01, 0x30, 0x28, 0x80, 0x7c, 0xbd, 0x00, 0xbf, + 0x76, 0xe5, 0x05, 0x00, 0xa0, 0xa0, 0x08, 0x00, 0x42, 0x78, 0x42, 0xf0, + 0x01, 0x02, 0x42, 0x70, 0x4a, 0x78, 0x02, 0x71, 0x89, 0x78, 0x41, 0x71, + 0x70, 0x47, 0x10, 0xb5, 0x51, 0xb1, 0x09, 0x23, 0x10, 0xfa, 0x83, 0xf4, + 0x01, 0x39, 0x64, 0x78, 0x23, 0x44, 0x0c, 0x06, 0x03, 0xf1, 0x03, 0x03, + 0xf6, 0xd1, 0x00, 0xe0, 0x08, 0x23, 0x0a, 0xb1, 0x98, 0x18, 0xc3, 0x1c, + 0x98, 0x1c, 0xc1, 0x07, 0x18, 0xbf, 0xd8, 0x1c, 0x80, 0xb2, 0x10, 0xbd, + 0x7f, 0xb5, 0x0d, 0x46, 0x32, 0x49, 0xb1, 0xf8, 0x3c, 0x11, 0x49, 0x06, + 0x03, 0xd4, 0x31, 0x48, 0x00, 0x21, 0x01, 0x70, 0x7f, 0xbd, 0x2f, 0x49, + 0x14, 0x46, 0x01, 0x22, 0x0a, 0x70, 0x81, 0x88, 0x82, 0x89, 0x56, 0x18, + 0x2c, 0x4a, 0xb1, 0xb2, 0xb2, 0xf8, 0x78, 0x22, 0x14, 0x3a, 0xad, 0xf8, + 0x08, 0x20, 0x92, 0xb2, 0x8a, 0x42, 0x45, 0xd2, 0x28, 0x48, 0x0d, 0xf1, + 0x0a, 0x01, 0x02, 0xaa, 0x03, 0x68, 0x03, 0xa8, 0x98, 0x47, 0x01, 0x28, + 0x40, 0xd1, 0xbd, 0xf8, 0x0a, 0x00, 0x03, 0x99, 0x01, 0x2c, 0x0d, 0x54, + 0x08, 0x44, 0x4f, 0xea, 0x15, 0x21, 0x41, 0x70, 0xbd, 0xf8, 0x0a, 0x00, + 0x03, 0x9a, 0x00, 0xf1, 0x02, 0x00, 0x81, 0xb2, 0xad, 0xf8, 0x0a, 0x00, + 0x12, 0xfa, 0x80, 0xf0, 0x56, 0x54, 0x4f, 0xea, 0x16, 0x21, 0x41, 0x70, + 0xbd, 0xf8, 0x0a, 0x00, 0x03, 0x9a, 0x9d, 0xf8, 0x08, 0x30, 0x00, 0xf1, + 0x02, 0x00, 0x81, 0xb2, 0xad, 0xf8, 0x0a, 0x00, 0x12, 0xfa, 0x80, 0xf0, + 0x53, 0x54, 0x4f, 0xf0, 0x01, 0x02, 0x9d, 0xf8, 0x09, 0x10, 0x41, 0x70, + 0x10, 0x48, 0x4f, 0xf0, 0x00, 0x01, 0x03, 0x9b, 0x05, 0x68, 0x4f, 0xf0, + 0x06, 0x00, 0x00, 0x90, 0x40, 0xf6, 0x59, 0x10, 0x08, 0xbf, 0x40, 0xf6, + 0x58, 0x10, 0xa8, 0x47, 0x0a, 0x48, 0x12, 0x21, 0x00, 0x78, 0xf1, 0xf7, + 0xb5, 0xff, 0x7f, 0xbd, 0x29, 0x46, 0x22, 0x46, 0x00, 0xf0, 0x16, 0xf8, + 0x7f, 0xbd, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, 0x1c, 0x4c, 0x01, 0x00, + 0x68, 0x8a, 0x01, 0x00, 0xf8, 0xa1, 0x08, 0x00, 0xf4, 0xa1, 0x08, 0x00, + 0x66, 0x34, 0x01, 0x00, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x04, 0xb1, 0x08, 0x00, 0x01, 0xf0, 0x02, 0x00, 0x4a, 0xf2, 0x79, 0x4c, + 0xc1, 0xf2, 0x04, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x70, 0x47, 0x70, 0x47, + 0x7f, 0xb5, 0x05, 0x46, 0x10, 0x48, 0x0c, 0x46, 0xb0, 0xf8, 0x3c, 0x01, + 0xc0, 0x04, 0x15, 0xd5, 0xa0, 0x7a, 0x98, 0xb9, 0x00, 0x20, 0x01, 0xab, + 0x01, 0x21, 0x00, 0x22, 0x8d, 0xf8, 0x04, 0x00, 0xa8, 0x8a, 0xad, 0xf8, + 0x06, 0x00, 0x20, 0x68, 0x02, 0x90, 0x68, 0x68, 0x03, 0x90, 0x80, 0x48, + 0x06, 0x68, 0x0c, 0x20, 0x00, 0x90, 0x4f, 0xf4, 0x16, 0x60, 0xb0, 0x47, + 0x28, 0x46, 0x21, 0x46, 0x00, 0xf0, 0x60, 0xff, 0x7f, 0xbd, 0x00, 0xbf, + 0x8c, 0x7e, 0x08, 0x00, 0xbc, 0xb5, 0x04, 0x46, 0x80, 0x79, 0xe1, 0x79, + 0x40, 0xea, 0x01, 0x20, 0xc0, 0xf3, 0xc5, 0x00, 0x0e, 0x28, 0x8d, 0xf8, + 0x07, 0x00, 0x0c, 0xd0, 0x3f, 0x28, 0x0a, 0xd0, 0x71, 0x48, 0x0d, 0xf1, + 0x07, 0x03, 0x00, 0x21, 0x01, 0x22, 0x05, 0x68, 0x01, 0x20, 0x00, 0x90, + 0x40, 0xf6, 0x09, 0x10, 0xa8, 0x47, 0x20, 0x46, 0x00, 0xf0, 0x46, 0xff, + 0xbc, 0xbd, 0x00, 0xbf, 0x2d, 0xe9, 0xf0, 0x43, 0x85, 0xb0, 0x81, 0x46, + 0x08, 0x78, 0x16, 0x46, 0x88, 0x46, 0x13, 0x28, 0x3d, 0xd1, 0xd8, 0xf8, + 0x04, 0xc0, 0x9c, 0xf8, 0x01, 0x10, 0x02, 0x29, 0x37, 0xd1, 0xd9, 0xf8, + 0x00, 0x20, 0x5d, 0x49, 0xd2, 0xf8, 0xd8, 0x20, 0x09, 0x68, 0x52, 0x78, + 0xc2, 0xeb, 0x02, 0x12, 0x01, 0xeb, 0x42, 0x12, 0x02, 0xf5, 0xea, 0x73, + 0x92, 0xf8, 0xd5, 0x11, 0x02, 0xf5, 0xe8, 0x72, 0x13, 0xf8, 0x02, 0x7b, + 0x47, 0xea, 0x01, 0x21, 0x1f, 0x78, 0x5b, 0x78, 0x47, 0xea, 0x03, 0x23, + 0x41, 0xea, 0x03, 0x41, 0x91, 0x42, 0x1a, 0xd0, 0x91, 0xf8, 0x24, 0x30, + 0x01, 0x2b, 0x0b, 0xd0, 0x11, 0xf8, 0x04, 0x3f, 0x4f, 0x78, 0x88, 0x78, + 0xc9, 0x78, 0x43, 0xea, 0x07, 0x23, 0x40, 0xea, 0x01, 0x20, 0x43, 0xea, + 0x00, 0x41, 0xed, 0xe7, 0x9c, 0xf8, 0x02, 0x20, 0x3a, 0xb1, 0x89, 0x68, + 0xb1, 0xf8, 0xdc, 0x12, 0x19, 0x29, 0x9c, 0xbf, 0x51, 0x1e, 0x8c, 0xf8, + 0x02, 0x10, 0x43, 0x48, 0x01, 0x68, 0x48, 0x46, 0x88, 0x47, 0xff, 0x28, + 0x21, 0xd0, 0x07, 0x46, 0x01, 0x2e, 0x03, 0xd1, 0x3f, 0x48, 0x01, 0x68, + 0x40, 0x46, 0x88, 0x47, 0x5d, 0x49, 0x09, 0xeb, 0x87, 0x04, 0x00, 0x26, + 0x42, 0x46, 0x01, 0x23, 0x20, 0x6b, 0xcd, 0xe9, 0x00, 0x66, 0x02, 0x96, + 0x0d, 0x68, 0x0e, 0x21, 0xa8, 0x47, 0x02, 0x46, 0x57, 0x48, 0x21, 0x6b, + 0x03, 0x68, 0x99, 0xf8, 0x8c, 0x00, 0x98, 0x47, 0x01, 0x28, 0x1c, 0xbf, + 0x09, 0xeb, 0x07, 0x00, 0x80, 0xf8, 0x40, 0x60, 0x59, 0xe0, 0x99, 0xf8, + 0x4c, 0x00, 0x04, 0x28, 0x2d, 0xd8, 0x98, 0xf8, 0x00, 0x00, 0x0a, 0x28, + 0x29, 0xd0, 0x10, 0x28, 0x27, 0xd0, 0x15, 0x28, 0x25, 0xd0, 0x13, 0x28, + 0x04, 0xd1, 0xd8, 0xf8, 0x04, 0x00, 0x40, 0x78, 0x02, 0x28, 0x1e, 0xd0, + 0x27, 0x48, 0x01, 0x68, 0xb8, 0xf8, 0x02, 0x00, 0x08, 0x30, 0x88, 0x47, + 0xb8, 0xb1, 0xb8, 0xf8, 0x02, 0x10, 0x06, 0x46, 0x98, 0xf8, 0x00, 0x20, + 0x41, 0x80, 0x08, 0x30, 0x32, 0x70, 0x70, 0x60, 0xb8, 0xf8, 0x02, 0x30, + 0xd8, 0xf8, 0x04, 0x20, 0xf1, 0xf7, 0xb0, 0xfe, 0x09, 0xf1, 0x44, 0x01, + 0x30, 0x46, 0xf4, 0xf7, 0x81, 0xf8, 0xd9, 0xf8, 0x6c, 0x00, 0x01, 0x21, + 0x05, 0xe0, 0xd9, 0xf8, 0x6c, 0x00, 0x00, 0x21, 0x01, 0x30, 0xc9, 0xf8, + 0x6c, 0x00, 0x8d, 0xf8, 0x0f, 0x00, 0x00, 0x20, 0x8d, 0xf8, 0x0e, 0x00, + 0x40, 0xf2, 0x17, 0x10, 0xad, 0xf8, 0x0c, 0x00, 0x11, 0xb1, 0x01, 0x20, + 0x8d, 0xf8, 0x0e, 0x00, 0x98, 0xf8, 0x00, 0x00, 0x13, 0x28, 0x8d, 0xf8, + 0x10, 0x00, 0x04, 0xd1, 0xd8, 0xf8, 0x04, 0x00, 0x40, 0x78, 0x8d, 0xf8, + 0x11, 0x00, 0x0a, 0x48, 0x03, 0xab, 0x00, 0x21, 0x00, 0x22, 0x04, 0x68, + 0x06, 0x20, 0x00, 0x90, 0x40, 0xf6, 0x5b, 0x10, 0xa0, 0x47, 0x05, 0xb0, + 0xbd, 0xe8, 0xf0, 0x83, 0xe0, 0x35, 0x01, 0x00, 0xd0, 0xaf, 0x08, 0x00, + 0xcc, 0xaf, 0x08, 0x00, 0xd4, 0x9b, 0x08, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0xf0, 0xb5, 0x85, 0xb0, 0x14, 0x46, 0x05, 0x46, 0x00, 0x6d, 0x0e, 0x46, + 0x8a, 0x68, 0x99, 0x88, 0x1f, 0x46, 0x03, 0x30, 0x0b, 0x46, 0xf1, 0xf7, + 0x65, 0xfe, 0x70, 0x7c, 0x29, 0x6d, 0x01, 0x23, 0x08, 0x70, 0x30, 0x7c, + 0xf2, 0x89, 0x29, 0x6d, 0x42, 0xea, 0x80, 0x30, 0x4a, 0x70, 0x11, 0x4a, + 0x00, 0x0a, 0x88, 0x70, 0x0f, 0x20, 0x8d, 0xf8, 0x0c, 0x00, 0x28, 0x6d, + 0xb9, 0x88, 0x17, 0x68, 0x72, 0x7c, 0x00, 0x26, 0x04, 0x90, 0xc8, 0x1c, + 0xad, 0xf8, 0x0e, 0x00, 0x20, 0x68, 0xcd, 0xe9, 0x00, 0x21, 0x03, 0xaa, + 0x0e, 0x21, 0x02, 0x96, 0xb8, 0x47, 0x02, 0x46, 0x06, 0x48, 0x21, 0x68, + 0x03, 0x68, 0x95, 0xf8, 0x8c, 0x00, 0x98, 0x47, 0x01, 0x28, 0x18, 0xbf, + 0xa6, 0x71, 0x05, 0xb0, 0xf0, 0xbd, 0x00, 0xbf, 0xc0, 0xaf, 0x08, 0x00, + 0xd4, 0xaf, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x93, 0xb0, 0xde, 0x49, + 0x0d, 0xf1, 0x3a, 0x02, 0x0c, 0xab, 0x09, 0x68, 0x12, 0x91, 0x06, 0x90, + 0x0e, 0xa9, 0x90, 0xf8, 0x8d, 0x00, 0x00, 0x91, 0x0d, 0xa9, 0x00, 0xf0, + 0x25, 0xfe, 0xbd, 0xf8, 0x3a, 0x10, 0xbd, 0xf8, 0x38, 0x00, 0x08, 0x44, + 0x0a, 0x28, 0x09, 0xd2, 0xd3, 0x48, 0x00, 0x68, 0x12, 0x99, 0x40, 0x1a, + 0x04, 0xbf, 0x13, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0xf7, 0xf7, 0x50, 0xfc, + 0xcf, 0x48, 0x0a, 0x25, 0x00, 0x24, 0x0d, 0xf1, 0x3c, 0x0b, 0x4f, 0xf0, + 0x00, 0x08, 0x4f, 0xf0, 0x00, 0x0a, 0x4f, 0xf0, 0x0a, 0x09, 0x02, 0x30, + 0x01, 0x90, 0x00, 0x20, 0x03, 0x90, 0x00, 0x20, 0x05, 0x90, 0x00, 0x20, + 0x04, 0x90, 0x14, 0xfa, 0x89, 0xf7, 0x88, 0xb2, 0x1f, 0xfa, 0x89, 0xf6, + 0x87, 0x42, 0x0f, 0xd9, 0x1f, 0xfa, 0x8a, 0xf2, 0x90, 0x42, 0x13, 0xd9, + 0x0d, 0x99, 0x0a, 0x19, 0x01, 0x1b, 0x58, 0x46, 0x0b, 0x46, 0xf1, 0xf7, + 0xed, 0xfd, 0xbd, 0xf8, 0x3a, 0x10, 0x0a, 0x1b, 0x92, 0x44, 0x08, 0xe0, + 0x0d, 0x98, 0x31, 0x46, 0x33, 0x46, 0x02, 0x19, 0x58, 0x46, 0xf1, 0xf7, + 0xe1, 0xfd, 0x0f, 0xe0, 0x00, 0x22, 0x1b, 0xfa, 0x82, 0xf0, 0x92, 0xb2, + 0x89, 0xb2, 0xb7, 0x1a, 0x1f, 0xfa, 0x8a, 0xf2, 0x51, 0x1a, 0x0c, 0x9a, + 0x3b, 0x46, 0x0a, 0x44, 0x39, 0x46, 0xf1, 0xf7, 0xd1, 0xfd, 0x57, 0x44, + 0x5f, 0xfa, 0x88, 0xf0, 0x04, 0x28, 0x00, 0xf2, 0xe3, 0x80, 0x07, 0x95, + 0xdf, 0xe8, 0x00, 0xf0, 0x03, 0x2d, 0x3a, 0x5d, 0x71, 0x00, 0x9b, 0xf8, + 0x08, 0x50, 0x9b, 0xf8, 0x09, 0x00, 0xbd, 0xf8, 0x38, 0x20, 0x45, 0xea, + 0x00, 0x24, 0xbd, 0xf8, 0x3a, 0x00, 0x16, 0xfa, 0x84, 0xf1, 0x02, 0x44, + 0x8a, 0x42, 0xc0, 0xf0, 0x20, 0x81, 0x9b, 0xf8, 0x06, 0x20, 0x9b, 0xf8, + 0x07, 0x30, 0x42, 0xea, 0x03, 0x28, 0x18, 0xf0, 0x03, 0x0a, 0x77, 0xd0, + 0xba, 0xf1, 0x02, 0x0f, 0x40, 0xf0, 0x1d, 0x81, 0x01, 0x9b, 0x1f, 0xfa, + 0x84, 0xfc, 0x02, 0x31, 0x1a, 0x88, 0x01, 0x32, 0x1a, 0x80, 0x0c, 0xf0, + 0x01, 0x03, 0x13, 0xfa, 0x81, 0xf1, 0x01, 0x23, 0x6b, 0xe0, 0x9b, 0xf8, + 0x00, 0x10, 0x4f, 0xf0, 0x02, 0x08, 0x08, 0x46, 0x04, 0x91, 0x00, 0x29, + 0x08, 0xbf, 0x4f, 0xf0, 0x04, 0x08, 0x4f, 0xf0, 0x03, 0x09, 0xa5, 0xe0, + 0x8f, 0x48, 0x9b, 0xf8, 0x02, 0x20, 0x01, 0x68, 0x9b, 0xf8, 0x01, 0x00, + 0x40, 0xea, 0x02, 0x29, 0x1f, 0xfa, 0x89, 0xf0, 0x88, 0x47, 0x05, 0x9c, + 0x00, 0x28, 0x04, 0xf1, 0x01, 0x04, 0x05, 0x94, 0x00, 0xf0, 0x96, 0x80, + 0x01, 0x46, 0x9b, 0xf8, 0x00, 0x00, 0xa1, 0xf8, 0x02, 0x90, 0x03, 0x91, + 0x08, 0x70, 0x5f, 0xea, 0x09, 0x40, 0x08, 0x46, 0x00, 0xf0, 0xa3, 0x80, + 0xd1, 0xf8, 0x04, 0xb0, 0x4f, 0xf0, 0x03, 0x08, 0x82, 0xe0, 0x7d, 0x48, + 0x03, 0x99, 0x02, 0x68, 0x06, 0x98, 0x90, 0x47, 0x04, 0x98, 0x05, 0x99, + 0x4f, 0xf0, 0x04, 0x08, 0x4f, 0xf0, 0x03, 0x09, 0x0d, 0xf1, 0x3c, 0x0b, + 0xc0, 0xb2, 0xc9, 0xb2, 0x81, 0x42, 0x38, 0xbf, 0x4f, 0xf0, 0x02, 0x08, + 0x6e, 0xe0, 0x9b, 0xf8, 0x01, 0x10, 0x9b, 0xf8, 0x02, 0x20, 0x9b, 0xf8, + 0x00, 0x00, 0x41, 0xea, 0x02, 0x24, 0x06, 0x99, 0x09, 0x68, 0x91, 0xf8, + 0x08, 0x21, 0x90, 0x42, 0x0a, 0xd2, 0x01, 0xeb, 0x80, 0x01, 0xc9, 0x6b, + 0xb1, 0xf8, 0x42, 0x10, 0x49, 0xb1, 0x22, 0x04, 0x02, 0xd0, 0xa2, 0xb2, + 0x8a, 0x42, 0x7e, 0xd9, 0x00, 0x20, 0x4f, 0xf4, 0x2d, 0x71, 0xf7, 0xf7, + 0x89, 0xfb, 0x04, 0xeb, 0x07, 0x0a, 0x4f, 0xf0, 0x04, 0x08, 0x5b, 0xe0, + 0x01, 0x9b, 0x1a, 0x88, 0x01, 0x32, 0x1a, 0x80, 0x00, 0x23, 0x02, 0x93, + 0x0d, 0x9b, 0x08, 0x93, 0x8b, 0xb2, 0x83, 0x42, 0x28, 0xbf, 0x03, 0x46, + 0xad, 0xf8, 0x24, 0x30, 0x03, 0xd9, 0x0c, 0x9b, 0x08, 0x1a, 0x0a, 0x93, + 0x01, 0xe0, 0x00, 0x20, 0x0a, 0x90, 0xad, 0xf8, 0x2c, 0x00, 0x58, 0x48, + 0x91, 0xb2, 0x01, 0x22, 0x03, 0x68, 0x08, 0xa8, 0x98, 0x47, 0x06, 0x98, + 0x31, 0x46, 0x90, 0xf8, 0x8d, 0x00, 0x00, 0xf0, 0x19, 0xfd, 0xba, 0xf1, + 0x00, 0x0f, 0x00, 0xf0, 0x8e, 0x80, 0x07, 0x98, 0x20, 0x44, 0x07, 0x90, + 0x02, 0x98, 0xe0, 0xb1, 0x4e, 0x48, 0x06, 0x9e, 0x1f, 0xfa, 0x88, 0xf9, + 0x01, 0x68, 0x0f, 0xa8, 0xa6, 0xf8, 0x12, 0x80, 0x88, 0x47, 0x01, 0x21, + 0x70, 0x60, 0x19, 0xf0, 0x04, 0x00, 0x4f, 0xf0, 0x01, 0x08, 0x4f, 0xf0, + 0x01, 0x09, 0xb4, 0x82, 0x61, 0xf3, 0x5f, 0x05, 0x86, 0xf8, 0x8e, 0x50, + 0x08, 0xbf, 0x4f, 0xf0, 0x04, 0x08, 0x08, 0xbf, 0x4f, 0xf0, 0x03, 0x09, + 0x01, 0xe0, 0x4f, 0xf0, 0x00, 0x08, 0x07, 0x9d, 0xba, 0x46, 0x0f, 0xe0, + 0x04, 0x98, 0xe1, 0xb2, 0x4f, 0xf0, 0x04, 0x08, 0x09, 0xeb, 0x07, 0x0a, + 0xc0, 0xb2, 0x81, 0x42, 0x4f, 0xf0, 0x00, 0x00, 0x38, 0xbf, 0x4f, 0xf0, + 0x02, 0x08, 0x03, 0x90, 0x4f, 0xf0, 0x03, 0x09, 0xa8, 0xb2, 0x1f, 0xfa, + 0x8a, 0xf4, 0x84, 0x42, 0xbf, 0xf4, 0xb4, 0xae, 0xbd, 0xf8, 0x3a, 0x10, + 0xcd, 0xe6, 0x2e, 0x48, 0x02, 0x68, 0x06, 0x98, 0x90, 0x47, 0x04, 0x98, + 0xe1, 0xb2, 0x4f, 0xf0, 0x04, 0x08, 0xc0, 0xb2, 0x81, 0x42, 0x38, 0xbf, + 0x4f, 0xf0, 0x02, 0x08, 0x2d, 0xe7, 0xbd, 0xf8, 0x3a, 0x10, 0x12, 0xfa, + 0x87, 0xfa, 0xba, 0xb2, 0x8a, 0x45, 0x14, 0xd9, 0x91, 0x42, 0x15, 0xd9, + 0x06, 0x9d, 0x0d, 0x9b, 0xc9, 0x1b, 0xed, 0x69, 0x1a, 0x44, 0x03, 0x01, + 0x05, 0xeb, 0x00, 0x10, 0xea, 0x50, 0x07, 0x9d, 0x81, 0x80, 0x0c, 0x99, + 0xbd, 0xf8, 0x3a, 0x20, 0x81, 0x60, 0xe1, 0x19, 0x89, 0x1a, 0x81, 0x81, + 0x6b, 0xe7, 0x0d, 0x99, 0x11, 0x44, 0x02, 0xe0, 0x51, 0x1a, 0x0c, 0x9a, + 0x11, 0x44, 0x06, 0x9b, 0x02, 0x01, 0xdb, 0x69, 0x03, 0xeb, 0x00, 0x10, + 0x99, 0x50, 0x84, 0x80, 0x5d, 0xe7, 0x06, 0x98, 0x15, 0x49, 0x90, 0xf8, + 0x8d, 0x00, 0x09, 0x68, 0x88, 0x47, 0x00, 0x20, 0x4f, 0xf4, 0xe3, 0x71, + 0x08, 0xe0, 0x06, 0x98, 0x10, 0x49, 0x90, 0xf8, 0x8d, 0x00, 0x09, 0x68, + 0x88, 0x47, 0x00, 0x20, 0x4f, 0xf4, 0xe7, 0x71, 0xf1, 0xf7, 0x6e, 0xfc, + 0x62, 0xe6, 0x60, 0x1c, 0x4f, 0xf6, 0xfe, 0x71, 0x01, 0x40, 0x06, 0x98, + 0x90, 0xf8, 0x8d, 0x00, 0x00, 0xf0, 0x7e, 0xfc, 0x58, 0xe6, 0x00, 0xbf, + 0x38, 0xec, 0x01, 0x00, 0x76, 0xe5, 0x05, 0x00, 0x10, 0xb1, 0x08, 0x00, + 0x0c, 0xb1, 0x08, 0x00, 0x04, 0xb1, 0x08, 0x00, 0x08, 0xb1, 0x08, 0x00, + 0x14, 0xb1, 0x08, 0x00, 0xf8, 0xb5, 0x0c, 0x4e, 0xff, 0x21, 0x04, 0x46, + 0x32, 0x68, 0x90, 0x47, 0x80, 0xb1, 0x0a, 0x4f, 0x05, 0x46, 0x3b, 0x68, + 0x20, 0x46, 0x29, 0x46, 0x01, 0x22, 0x98, 0x47, 0x28, 0x46, 0xf7, 0xf7, + 0xc3, 0xfa, 0x32, 0x68, 0x20, 0x46, 0xff, 0x21, 0x90, 0x47, 0x05, 0x46, + 0x00, 0x28, 0xf0, 0xd1, 0xf8, 0xbd, 0x00, 0xbf, 0xd8, 0xb1, 0x08, 0x00, + 0x74, 0x9d, 0x08, 0x00, 0x40, 0x30, 0x00, 0x21, 0x02, 0x78, 0x32, 0xb1, + 0x01, 0x31, 0x01, 0x30, 0x04, 0x29, 0x04, 0xbf, 0x00, 0x20, 0x70, 0x47, + 0xf6, 0xe7, 0x01, 0x20, 0x70, 0x47, 0x00, 0xbf, 0xfe, 0xb5, 0x05, 0x46, + 0x00, 0x68, 0x0c, 0x46, 0x76, 0x49, 0xd0, 0xf8, 0xd8, 0x00, 0x09, 0x68, + 0x42, 0x78, 0xc2, 0xeb, 0x02, 0x12, 0x01, 0xeb, 0x42, 0x11, 0x01, 0xf5, + 0xea, 0x73, 0x91, 0xf8, 0xd5, 0x21, 0x01, 0xf5, 0xe8, 0x71, 0x13, 0xf8, + 0x02, 0x6b, 0x46, 0xea, 0x02, 0x22, 0x1e, 0x78, 0x5b, 0x78, 0x46, 0xea, + 0x03, 0x23, 0x42, 0xea, 0x03, 0x42, 0x8a, 0x42, 0x11, 0xd0, 0x92, 0xf8, + 0x24, 0x30, 0x01, 0x2b, 0x1e, 0xd0, 0xad, 0xf8, 0x0a, 0x30, 0x12, 0xf8, + 0x04, 0x3f, 0x56, 0x78, 0x97, 0x78, 0xd2, 0x78, 0x43, 0xea, 0x06, 0x23, + 0x47, 0xea, 0x02, 0x22, 0x43, 0xea, 0x02, 0x42, 0xeb, 0xe7, 0x00, 0x20, + 0x02, 0xab, 0x00, 0x21, 0x00, 0x22, 0xad, 0xf8, 0x08, 0x00, 0x24, 0x48, + 0x05, 0x68, 0x04, 0x20, 0x00, 0x90, 0x40, 0xf6, 0x5d, 0x10, 0xa8, 0x47, + 0x20, 0x46, 0xf7, 0xf7, 0x67, 0xfa, 0xfe, 0xbd, 0x21, 0x78, 0x18, 0x29, + 0x06, 0xd0, 0x0d, 0x29, 0x2d, 0xd1, 0x28, 0x46, 0x03, 0x21, 0x00, 0xf0, + 0xfd, 0xfb, 0x1e, 0xe0, 0x18, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0x61, 0x68, 0x4d, 0x4e, 0x0a, 0x78, 0x49, 0x78, 0x30, 0x88, 0x42, 0xea, + 0x01, 0x27, 0xb9, 0xb2, 0x88, 0x42, 0x0e, 0xd0, 0xad, 0xf8, 0x06, 0x00, + 0x11, 0x48, 0x01, 0xab, 0x00, 0x21, 0x01, 0x22, 0xad, 0xf8, 0x04, 0x70, + 0xd0, 0xf8, 0x00, 0xc0, 0x04, 0x20, 0x00, 0x90, 0x40, 0xf6, 0x62, 0x10, + 0xe0, 0x47, 0x78, 0x1c, 0x30, 0x80, 0x20, 0x46, 0xf7, 0xf7, 0x3a, 0xfa, + 0x95, 0xf8, 0x84, 0x00, 0x10, 0xb1, 0x28, 0x46, 0xff, 0xf7, 0x60, 0xff, + 0xfe, 0xbd, 0x00, 0x78, 0x00, 0x28, 0xc5, 0xd1, 0x28, 0x46, 0x21, 0x46, + 0x00, 0xf0, 0xd2, 0xfb, 0xf0, 0xe7, 0x00, 0xbf, 0xcc, 0xaf, 0x08, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0x70, 0xb5, 0x06, 0x46, 0x92, 0xf8, 0x8f, 0x00, + 0x14, 0x46, 0x0d, 0x46, 0x02, 0x28, 0x06, 0xd1, 0x94, 0xf8, 0x82, 0x00, + 0x18, 0xb9, 0x20, 0x46, 0x03, 0x21, 0x00, 0xf0, 0xb7, 0xfb, 0x30, 0x46, + 0x29, 0x46, 0x22, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, 0xbc, 0xbb, + 0x70, 0xb5, 0x0d, 0x46, 0x04, 0x46, 0x00, 0xf0, 0xbd, 0xfb, 0x27, 0x49, + 0x00, 0x22, 0x01, 0x28, 0x0a, 0x80, 0x26, 0x49, 0x4f, 0xf0, 0xff, 0x02, + 0x0a, 0x70, 0x41, 0xd1, 0x21, 0x68, 0x24, 0x4a, 0x01, 0xeb, 0x85, 0x01, + 0xc9, 0x6b, 0xb1, 0xf8, 0x40, 0x10, 0x01, 0xeb, 0x41, 0x01, 0x52, 0xf8, + 0x21, 0x10, 0x20, 0x4a, 0x91, 0xf8, 0x1d, 0x11, 0x12, 0x68, 0xc1, 0xeb, + 0x01, 0x11, 0x02, 0xeb, 0x41, 0x11, 0x49, 0x78, 0xc1, 0xeb, 0x01, 0x11, + 0x02, 0xeb, 0x41, 0x11, 0x01, 0xf5, 0xea, 0x73, 0x91, 0xf8, 0xd5, 0x21, + 0x01, 0xf5, 0xe8, 0x71, 0x13, 0xf8, 0x02, 0x5b, 0x45, 0xea, 0x02, 0x22, + 0x1d, 0x78, 0x5b, 0x78, 0x45, 0xea, 0x03, 0x23, 0x42, 0xea, 0x03, 0x42, + 0x8a, 0x42, 0x14, 0xd0, 0x52, 0xf8, 0xc8, 0x3c, 0x2b, 0xb1, 0x52, 0xf8, + 0xc4, 0x3c, 0x13, 0xb1, 0x1b, 0x78, 0xff, 0x2b, 0x0f, 0xd1, 0x12, 0xf8, + 0x04, 0x3f, 0x55, 0x78, 0x96, 0x78, 0xd2, 0x78, 0x43, 0xea, 0x05, 0x23, + 0x46, 0xea, 0x02, 0x22, 0x43, 0xea, 0x02, 0x42, 0xe8, 0xe7, 0x00, 0x21, + 0xa4, 0xf8, 0x82, 0x10, 0x70, 0xbd, 0x40, 0xf2, 0x01, 0x11, 0xf9, 0xe7, + 0x7c, 0xe5, 0x05, 0x00, 0x40, 0xd3, 0x05, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0xe0, 0x35, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x43, 0x0f, 0x46, 0x04, 0x46, + 0x10, 0x46, 0x40, 0x21, 0x98, 0x46, 0x91, 0x46, 0xf4, 0xf7, 0x84, 0xf9, + 0x04, 0xf1, 0x20, 0x00, 0x00, 0x21, 0x50, 0xf8, 0x31, 0x20, 0x0b, 0x46, + 0x42, 0xb1, 0x00, 0xeb, 0xc3, 0x06, 0x7d, 0x7c, 0xf1, 0x79, 0xa9, 0x42, + 0x02, 0xd1, 0x16, 0xf8, 0x06, 0x5f, 0x25, 0xb1, 0x01, 0x21, 0x00, 0x2b, + 0xef, 0xd0, 0x79, 0x7c, 0x08, 0xe0, 0x01, 0x20, 0xa9, 0xf8, 0x04, 0x80, + 0x30, 0x70, 0x08, 0xeb, 0x02, 0x00, 0x12, 0x30, 0xc9, 0xf8, 0x00, 0x00, + 0x03, 0x48, 0x00, 0x22, 0x03, 0x68, 0x20, 0x46, 0x01, 0xb0, 0xbd, 0xe8, + 0xf0, 0x43, 0x18, 0x47, 0xe4, 0xb1, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x47, + 0x86, 0xb0, 0x89, 0x46, 0x49, 0x7c, 0x90, 0x46, 0x04, 0x46, 0x00, 0xf1, + 0x20, 0x06, 0x00, 0x20, 0x06, 0xeb, 0xc0, 0x02, 0xd2, 0x79, 0x8a, 0x42, + 0x04, 0xd0, 0x00, 0x28, 0x4f, 0xf0, 0x01, 0x00, 0xf6, 0xd0, 0x3a, 0xe0, + 0xd8, 0xf8, 0x00, 0x00, 0xb8, 0xb3, 0x94, 0xf8, 0x8f, 0x00, 0x03, 0x28, + 0x72, 0xd1, 0x5d, 0x48, 0x82, 0x88, 0x01, 0x32, 0x82, 0x80, 0x99, 0xf8, + 0x10, 0x00, 0xb8, 0xf8, 0x04, 0x30, 0x0b, 0xb1, 0x00, 0x28, 0x4b, 0xd0, + 0xad, 0xf8, 0x0a, 0x20, 0xb9, 0xf8, 0x0c, 0x20, 0x8d, 0xf8, 0x15, 0x00, + 0x8d, 0xf8, 0x14, 0x10, 0xad, 0xf8, 0x12, 0x30, 0xad, 0xf8, 0x08, 0x20, + 0x22, 0x68, 0x02, 0xeb, 0x81, 0x01, 0xf5, 0x4a, 0xc9, 0x6b, 0xb1, 0xf8, + 0x40, 0x10, 0x01, 0xeb, 0x41, 0x01, 0x52, 0xf8, 0x21, 0x10, 0x39, 0xb3, + 0x4a, 0x6b, 0x2a, 0xb3, 0x92, 0xf8, 0x28, 0x20, 0xd1, 0xf8, 0x60, 0x31, + 0xa3, 0xeb, 0x02, 0x02, 0xd2, 0xb2, 0xa3, 0xeb, 0x02, 0x02, 0x03, 0x92, + 0xb1, 0xf8, 0x74, 0x21, 0x98, 0xb1, 0x50, 0x1e, 0x14, 0xe0, 0x00, 0x20, + 0x02, 0xab, 0x00, 0x21, 0x00, 0x22, 0x8d, 0xf8, 0x0a, 0x00, 0x40, 0xf2, + 0x07, 0x40, 0xad, 0xf8, 0x08, 0x00, 0x79, 0x48, 0x04, 0x68, 0x06, 0x20, + 0x00, 0x90, 0x40, 0xf6, 0x5b, 0x10, 0xa0, 0x47, 0x69, 0xe0, 0x91, 0xf8, + 0x51, 0x01, 0x10, 0x1a, 0xad, 0xf8, 0x10, 0x00, 0x72, 0x48, 0x02, 0xab, + 0x01, 0x21, 0x00, 0x22, 0x05, 0x68, 0x10, 0x20, 0x00, 0x90, 0x40, 0xf6, + 0x55, 0x10, 0xa8, 0x47, 0x99, 0xf8, 0x11, 0x10, 0xdf, 0xf8, 0xc8, 0xa0, + 0x20, 0x46, 0xda, 0xf8, 0x00, 0x20, 0x90, 0x47, 0x90, 0xb1, 0x30, 0x4d, + 0x07, 0x46, 0x2b, 0x68, 0x20, 0x46, 0x39, 0x46, 0x01, 0x22, 0x98, 0x47, + 0x38, 0x46, 0xf7, 0xf7, 0xff, 0xf8, 0x99, 0xf8, 0x11, 0x10, 0xda, 0xf8, + 0x00, 0x20, 0x20, 0x46, 0x90, 0x47, 0x07, 0x46, 0x00, 0x28, 0xee, 0xd1, + 0x99, 0xf8, 0x11, 0x10, 0x00, 0x20, 0x06, 0xeb, 0xc0, 0x07, 0xfa, 0x79, + 0x8a, 0x42, 0x04, 0xd0, 0x00, 0x28, 0x4f, 0xf0, 0x01, 0x00, 0xf6, 0xd0, + 0x2c, 0xe0, 0xd8, 0xf8, 0x00, 0x00, 0x48, 0xb3, 0x94, 0xf8, 0x8f, 0x20, + 0x03, 0x2a, 0x2d, 0xd1, 0xb8, 0xf8, 0x04, 0x20, 0x62, 0xb9, 0x22, 0x68, + 0x02, 0xeb, 0x81, 0x01, 0xc9, 0x6b, 0xb1, 0xf8, 0x44, 0x10, 0xa8, 0xf8, + 0x04, 0x10, 0xf4, 0xf7, 0xaf, 0xf8, 0x03, 0x20, 0x89, 0xf8, 0x10, 0x00, + 0x15, 0x48, 0x49, 0x46, 0x3a, 0x46, 0x43, 0x46, 0x05, 0x68, 0x20, 0x46, + 0xa8, 0x47, 0x99, 0xf8, 0x11, 0x00, 0x80, 0xb9, 0x94, 0xf8, 0x8f, 0x00, + 0x03, 0x28, 0x0c, 0xd1, 0xc5, 0x48, 0xd9, 0xf8, 0x00, 0x10, 0x00, 0x22, + 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x04, 0xe0, 0x00, 0x20, 0x40, 0xf2, + 0x53, 0x41, 0xf7, 0xf7, 0x99, 0xf8, 0x06, 0xb0, 0xbd, 0xe8, 0xf0, 0x87, + 0x00, 0x20, 0xb8, 0x71, 0xb4, 0xf8, 0x80, 0x00, 0x01, 0x30, 0xa4, 0xf8, + 0x80, 0x00, 0xf4, 0xe7, 0x76, 0xe5, 0x05, 0x00, 0xd8, 0xb1, 0x08, 0x00, + 0x74, 0x9d, 0x08, 0x00, 0xdc, 0xb1, 0x08, 0x00, 0x70, 0xb5, 0x05, 0x46, + 0x08, 0x78, 0x16, 0x46, 0x0c, 0x46, 0x13, 0x28, 0x1a, 0xd1, 0x61, 0x68, + 0x48, 0x78, 0x04, 0x28, 0x16, 0xd1, 0x12, 0x4a, 0x28, 0x68, 0x09, 0x78, + 0x12, 0x68, 0x90, 0x47, 0x61, 0x68, 0x08, 0x70, 0xae, 0xb1, 0x95, 0xf8, + 0x84, 0x00, 0x01, 0x28, 0x11, 0xd1, 0xef, 0x48, 0x21, 0x46, 0x01, 0x22, + 0x03, 0x68, 0x28, 0x46, 0x98, 0x47, 0x20, 0x46, 0xbd, 0xe8, 0x70, 0x40, + 0xf7, 0xf7, 0x82, 0xb8, 0x28, 0x46, 0x21, 0x46, 0x32, 0x46, 0xbd, 0xe8, + 0x70, 0x40, 0x00, 0xf0, 0x33, 0xba, 0x05, 0xf1, 0x44, 0x01, 0x20, 0x46, + 0xbd, 0xe8, 0x70, 0x40, 0xf3, 0xf7, 0xdc, 0xbb, 0x34, 0xce, 0x08, 0x00, + 0xfe, 0xb5, 0x0e, 0x46, 0x05, 0x46, 0x10, 0x46, 0x40, 0x21, 0x1f, 0x46, + 0x14, 0x46, 0xf4, 0xf7, 0x43, 0xf8, 0x6f, 0xb3, 0xa2, 0x48, 0xb1, 0x7a, + 0x02, 0x68, 0x28, 0x46, 0x90, 0x47, 0x15, 0x4f, 0xad, 0xf8, 0x0a, 0x00, + 0x79, 0x88, 0x38, 0x80, 0x81, 0x42, 0x0e, 0xd0, 0x12, 0x48, 0x0d, 0xf1, + 0x0a, 0x03, 0x01, 0x21, 0x03, 0x22, 0xd0, 0xf8, 0x00, 0xc0, 0x02, 0x20, + 0x00, 0x90, 0x40, 0xf6, 0x5c, 0x10, 0xe0, 0x47, 0xbd, 0xf8, 0x0a, 0x00, + 0x78, 0x80, 0xb0, 0x7a, 0xe9, 0x69, 0x01, 0xeb, 0x00, 0x12, 0x00, 0x01, + 0x52, 0x68, 0x62, 0x60, 0x08, 0x58, 0x20, 0x60, 0xb0, 0x7a, 0xe9, 0x69, + 0x01, 0xeb, 0x00, 0x10, 0xd0, 0xe9, 0x02, 0x10, 0xc4, 0xe9, 0x02, 0x10, + 0x01, 0x20, 0xfe, 0xbd, 0x00, 0x20, 0xfe, 0xbd, 0x7e, 0xe5, 0x05, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0x06, 0x46, 0x10, 0x48, + 0x0f, 0x46, 0x00, 0x21, 0x00, 0x24, 0x06, 0xf1, 0x44, 0x08, 0x02, 0x68, + 0x40, 0x46, 0x90, 0x47, 0x90, 0xb1, 0x05, 0x46, 0x40, 0x68, 0x00, 0x78, + 0xb8, 0x42, 0x18, 0xbf, 0xff, 0x2f, 0x0a, 0xd1, 0x30, 0x46, 0xff, 0xf7, + 0x67, 0xfd, 0x30, 0xb1, 0x06, 0x48, 0x29, 0x46, 0x02, 0x68, 0x40, 0x46, + 0x90, 0x47, 0x2c, 0x46, 0x00, 0xe0, 0x00, 0x24, 0x20, 0x46, 0xbd, 0xe8, + 0xf0, 0x81, 0x00, 0xbf, 0x2c, 0xfa, 0x08, 0x00, 0xe8, 0xa0, 0x08, 0x00, + 0x2d, 0xe9, 0xf0, 0x41, 0x8c, 0xb0, 0xdf, 0xf8, 0x48, 0x81, 0x04, 0x46, + 0x51, 0x4a, 0x0d, 0x46, 0xd8, 0xf8, 0x00, 0x00, 0x0b, 0x90, 0x20, 0x20, + 0xad, 0xf8, 0x06, 0x00, 0x15, 0x20, 0x8d, 0xf8, 0x04, 0x00, 0x20, 0x68, + 0x00, 0xeb, 0x81, 0x00, 0x03, 0xa9, 0xc0, 0x6b, 0x02, 0x91, 0x00, 0x21, + 0x8d, 0xf8, 0x0c, 0x50, 0xad, 0xf8, 0x0e, 0x10, 0x06, 0x91, 0xb0, 0xf8, + 0x40, 0x00, 0x00, 0xeb, 0x40, 0x00, 0x52, 0xf8, 0x20, 0x00, 0x90, 0xf8, + 0x90, 0x10, 0x90, 0xf8, 0x42, 0x21, 0x90, 0xf8, 0x89, 0x30, 0x90, 0xf8, + 0x8a, 0x70, 0x90, 0xf8, 0x8b, 0x60, 0x8d, 0xf8, 0x1c, 0x10, 0x90, 0xf8, + 0x91, 0x10, 0x8d, 0xf8, 0x0d, 0x20, 0x90, 0xf8, 0x88, 0x20, 0x8d, 0xf8, + 0x11, 0x30, 0x8d, 0xf8, 0x13, 0x60, 0x8d, 0xf8, 0x12, 0x70, 0x90, 0xf8, + 0x9a, 0x30, 0x90, 0xf8, 0x9b, 0x60, 0x8d, 0xf8, 0x1d, 0x10, 0x90, 0xf8, + 0x92, 0x10, 0x8d, 0xf8, 0x10, 0x20, 0x8d, 0xf8, 0x1e, 0x10, 0x90, 0xf8, + 0x93, 0x10, 0x8d, 0xf8, 0x1f, 0x10, 0x90, 0xf8, 0xa4, 0x10, 0x8d, 0xf8, + 0x20, 0x10, 0xd0, 0xe9, 0x21, 0x12, 0x8d, 0xf8, 0x26, 0x30, 0x8d, 0xf8, + 0x27, 0x60, 0x89, 0x1a, 0x0a, 0x0e, 0x8d, 0xf8, 0x14, 0x10, 0x8d, 0xf8, + 0x17, 0x20, 0x0a, 0x0c, 0x09, 0x0a, 0x8d, 0xf8, 0x15, 0x10, 0x90, 0xf8, + 0xa5, 0x10, 0x8d, 0xf8, 0x16, 0x20, 0x90, 0xf8, 0x99, 0x20, 0x8d, 0xf8, + 0x21, 0x10, 0x90, 0xf8, 0xa6, 0x10, 0x8d, 0xf8, 0x25, 0x20, 0x8d, 0xf8, + 0x22, 0x10, 0x90, 0xf8, 0xa7, 0x10, 0x8d, 0xf8, 0x23, 0x10, 0x90, 0xf8, + 0x98, 0x10, 0x8d, 0xf8, 0x24, 0x10, 0x90, 0xf8, 0xa8, 0x10, 0x8d, 0xf8, + 0x28, 0x10, 0x90, 0xf8, 0xa9, 0x10, 0x8d, 0xf8, 0x29, 0x10, 0x90, 0xf8, + 0xaa, 0x10, 0x90, 0xf8, 0xab, 0x00, 0x8d, 0xf8, 0x2b, 0x00, 0x6d, 0x48, + 0x8d, 0xf8, 0x2a, 0x10, 0x01, 0xa9, 0x03, 0x68, 0xb4, 0xf8, 0x88, 0x00, + 0xb0, 0xfa, 0x80, 0xf0, 0x42, 0x09, 0x20, 0x46, 0x98, 0x47, 0x20, 0x68, + 0x90, 0xf8, 0x08, 0x01, 0x01, 0x38, 0xa8, 0x42, 0x08, 0xd1, 0x0b, 0x49, + 0xb4, 0xf8, 0x88, 0x00, 0x09, 0x88, 0x41, 0x1a, 0x18, 0xbf, 0x41, 0x1c, + 0xa4, 0xf8, 0x88, 0x10, 0xd8, 0xf8, 0x00, 0x00, 0x0b, 0x99, 0x40, 0x1a, + 0x04, 0xbf, 0x0c, 0xb0, 0xbd, 0xe8, 0xf0, 0x81, 0xf6, 0xf7, 0x34, 0xff, + 0x38, 0xec, 0x01, 0x00, 0xe8, 0x72, 0x01, 0x00, 0x4a, 0x0a, 0x01, 0x00, + 0xb0, 0xb5, 0x0d, 0x46, 0x04, 0x46, 0x00, 0xf0, 0x17, 0xf9, 0x94, 0xf8, + 0x8f, 0x00, 0x03, 0x28, 0x19, 0xd1, 0xa8, 0x7a, 0x50, 0xb1, 0x94, 0xf8, + 0x8d, 0x00, 0x0b, 0x49, 0x08, 0x5c, 0x28, 0xb9, 0x0a, 0x48, 0x29, 0x68, + 0x01, 0x22, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x94, 0xf8, 0x8d, 0x00, + 0x05, 0x49, 0x01, 0x22, 0x0a, 0x54, 0x94, 0xf8, 0x84, 0x00, 0x20, 0xb1, + 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0xff, 0xf7, 0x67, 0xbc, 0xb0, 0xbd, + 0x88, 0xe5, 0x05, 0x00, 0xe0, 0xb1, 0x08, 0x00, 0x70, 0xb5, 0x05, 0x46, + 0x08, 0x48, 0x14, 0x46, 0x0e, 0x46, 0x89, 0x7a, 0x02, 0x68, 0x28, 0x46, + 0x90, 0x47, 0x20, 0x80, 0x38, 0xb1, 0xb0, 0x7a, 0x29, 0x68, 0x01, 0xeb, + 0x80, 0x00, 0xc0, 0x6b, 0xb0, 0xf8, 0x46, 0x00, 0x20, 0x80, 0x70, 0xbd, + 0xb0, 0xb1, 0x08, 0x00, 0xb0, 0xb5, 0x04, 0x46, 0x90, 0xf8, 0x8d, 0x00, + 0x0d, 0x46, 0x00, 0xf0, 0xdd, 0xf8, 0x0c, 0x4a, 0x11, 0x78, 0xff, 0x29, + 0x04, 0xbf, 0x15, 0x70, 0x29, 0x46, 0x22, 0x8b, 0x90, 0x42, 0x09, 0xd1, + 0xa9, 0x42, 0x18, 0xbf, 0xb0, 0xbd, 0x07, 0x48, 0x29, 0x46, 0x02, 0x68, + 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x10, 0x47, 0x20, 0x46, 0x03, 0x21, + 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0xa0, 0xb8, 0x40, 0xd3, 0x05, 0x00, + 0xac, 0xb1, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x90, 0xf8, 0x8d, 0x00, + 0x00, 0xf0, 0xc0, 0xf8, 0xe1, 0x8a, 0x88, 0x42, 0x07, 0xd1, 0x20, 0x46, + 0x01, 0x21, 0x00, 0xf0, 0x8f, 0xf8, 0x00, 0x20, 0x84, 0xf8, 0x84, 0x00, + 0xa0, 0x81, 0x10, 0xbd, 0x19, 0x48, 0x1a, 0x49, 0x2e, 0x4a, 0x01, 0x60, + 0x19, 0x48, 0x1a, 0x49, 0x01, 0x60, 0x1a, 0x48, 0x1a, 0x49, 0x01, 0x60, + 0x1a, 0x48, 0x1b, 0x49, 0x01, 0x60, 0x1b, 0x48, 0x1b, 0x49, 0x01, 0x60, + 0x1b, 0x48, 0x1c, 0x49, 0x01, 0x60, 0x1c, 0x48, 0x1c, 0x49, 0x01, 0x60, + 0x1c, 0x48, 0x1d, 0x49, 0x01, 0x60, 0x1d, 0x48, 0x1d, 0x49, 0x01, 0x60, + 0x1d, 0x48, 0x1e, 0x49, 0x01, 0x60, 0x1e, 0x48, 0x1e, 0x49, 0xc0, 0xe9, + 0x02, 0x21, 0x1f, 0x48, 0x1f, 0x49, 0x24, 0x4a, 0x01, 0x60, 0x1f, 0x48, + 0x1f, 0x49, 0x40, 0xf8, 0x20, 0x1f, 0x1f, 0x49, 0xc1, 0x61, 0x1f, 0x49, + 0xc0, 0xe9, 0x03, 0x21, 0x1f, 0x49, 0x41, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x08, 0xb1, 0x08, 0x00, 0x55, 0xf1, 0x02, 0x00, 0xf8, 0xb1, 0x08, 0x00, + 0x09, 0xf1, 0x02, 0x00, 0x74, 0x9d, 0x08, 0x00, 0x91, 0xf1, 0x02, 0x00, + 0xdc, 0xb1, 0x08, 0x00, 0x3d, 0xf3, 0x02, 0x00, 0xb4, 0xb1, 0x08, 0x00, + 0xb9, 0xf3, 0x02, 0x00, 0x10, 0xb1, 0x08, 0x00, 0xad, 0xf7, 0x02, 0x00, + 0xa4, 0xb1, 0x08, 0x00, 0xdd, 0xf8, 0x02, 0x00, 0xe8, 0xb1, 0x08, 0x00, + 0x19, 0xfc, 0x02, 0x00, 0xf0, 0xb1, 0x08, 0x00, 0xe5, 0xfc, 0x02, 0x00, + 0xd8, 0xb1, 0x08, 0x00, 0x95, 0xfc, 0x02, 0x00, 0x38, 0x0a, 0x01, 0x00, + 0x05, 0xff, 0x02, 0x00, 0xbd, 0xfe, 0x02, 0x00, 0xcc, 0xb1, 0x08, 0x00, + 0xb1, 0xf8, 0x02, 0x00, 0xf0, 0x09, 0x01, 0x00, 0x41, 0xfe, 0x02, 0x00, + 0xb5, 0xfb, 0x02, 0x00, 0xf9, 0xf9, 0x02, 0x00, 0x95, 0xf9, 0x02, 0x00, + 0x91, 0xfe, 0x02, 0x00, 0x41, 0xf6, 0x1d, 0x6c, 0xc1, 0xf2, 0x05, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0xd7, 0x3c, 0xc1, 0xf2, 0x05, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0xa1, 0x0c, 0xc1, 0xf2, 0x11, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0xbd, 0x0c, 0xc1, 0xf2, 0x11, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf6, 0x83, 0x4c, 0xc1, 0xf2, 0x05, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0x29, 0x3c, 0xc1, 0xf2, 0x05, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf6, 0xef, 0x3c, 0xc1, 0xf2, 0x05, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf6, 0x09, 0x3c, 0xc1, 0xf2, 0x05, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf2, 0x79, 0x0c, 0xc1, 0xf2, 0x05, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf6, 0x8f, 0x5c, 0xc1, 0xf2, 0x05, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0x75, 0x0c, 0xc1, 0xf2, 0x11, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0x81, 0x0c, 0xc1, 0xf2, 0x11, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xb0, 0xf8, 0x86, 0x10, 0xb0, 0xf8, 0x84, 0x00, + 0x40, 0x1a, 0x18, 0xbf, 0x01, 0x20, 0x70, 0x47, 0x10, 0xb5, 0x04, 0x46, + 0xb0, 0xf8, 0x96, 0x00, 0x4f, 0xf6, 0xff, 0x71, 0x88, 0x42, 0x10, 0xd1, + 0x0b, 0x49, 0xb4, 0xf8, 0x86, 0x00, 0x49, 0x88, 0x81, 0x42, 0x0a, 0xd0, + 0x21, 0x68, 0x09, 0x4a, 0x04, 0xf1, 0x90, 0x00, 0xc9, 0x6b, 0x92, 0x7a, + 0xb1, 0xf8, 0x42, 0x10, 0x12, 0x09, 0xfe, 0xf7, 0x23, 0xf8, 0xb4, 0xf8, + 0xa4, 0x00, 0xb4, 0xf8, 0xac, 0x10, 0x08, 0x44, 0x80, 0xb2, 0x10, 0xbd, + 0x76, 0xe5, 0x05, 0x00, 0x40, 0x86, 0x08, 0x00, 0x70, 0xb5, 0x14, 0x46, + 0x0d, 0x46, 0x06, 0x46, 0xff, 0xf7, 0xd6, 0xff, 0x20, 0x80, 0x06, 0x48, + 0x01, 0x68, 0xb0, 0x68, 0x88, 0x47, 0xa9, 0x7a, 0x32, 0x68, 0x02, 0xeb, + 0x81, 0x01, 0xc9, 0x6b, 0x81, 0xf8, 0x5e, 0x00, 0x70, 0xbd, 0x00, 0xbf, + 0x3c, 0xaf, 0x08, 0x00, 0xfe, 0xb5, 0x0c, 0x46, 0x23, 0x49, 0x05, 0x46, + 0x80, 0x68, 0x09, 0x68, 0x88, 0x47, 0xa5, 0xf8, 0x86, 0x00, 0x21, 0x48, + 0x01, 0x68, 0xa8, 0x68, 0x88, 0x47, 0xa5, 0xf8, 0x88, 0x00, 0x1f, 0x48, + 0x01, 0x68, 0xa8, 0x68, 0x88, 0x47, 0xa5, 0xf8, 0x8a, 0x00, 0x28, 0x46, + 0xff, 0xf7, 0xae, 0xff, 0x06, 0x46, 0xb5, 0xf8, 0x8a, 0x00, 0xc0, 0xb1, + 0x95, 0xf8, 0x9c, 0x10, 0x42, 0x1a, 0x29, 0x68, 0xc9, 0x6b, 0xb1, 0xf8, + 0x46, 0x10, 0x8a, 0x42, 0x0f, 0xd0, 0xad, 0xf8, 0x06, 0x00, 0x14, 0x48, + 0xad, 0xf8, 0x08, 0x10, 0x01, 0xab, 0x00, 0x21, 0x00, 0x22, 0xad, 0xf8, + 0x04, 0x60, 0x07, 0x68, 0x06, 0x20, 0x00, 0x90, 0x40, 0xf6, 0x4b, 0x10, + 0xb8, 0x47, 0x20, 0x46, 0x40, 0x21, 0xf3, 0xf7, 0x8f, 0xfd, 0x6e, 0xb1, + 0xb5, 0xf8, 0xa4, 0x00, 0xa0, 0x80, 0xd5, 0xf8, 0xa0, 0x00, 0x20, 0x60, + 0xb5, 0xf8, 0xac, 0x00, 0xa0, 0x81, 0xd5, 0xf8, 0xa8, 0x00, 0xa0, 0x60, + 0x01, 0x20, 0xfe, 0xbd, 0x00, 0x20, 0xfe, 0xbd, 0x50, 0xb2, 0x08, 0x00, + 0x4c, 0xb2, 0x08, 0x00, 0x54, 0xb2, 0x08, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0x10, 0xb5, 0x0c, 0x46, 0x00, 0xf0, 0xae, 0xfa, 0x20, 0x88, 0x2f, 0x30, + 0x20, 0xf0, 0x03, 0x00, 0x20, 0x80, 0x10, 0xbd, 0x2d, 0xe9, 0xf8, 0x43, + 0x1b, 0x4c, 0x89, 0x46, 0x00, 0x21, 0x90, 0x22, 0x07, 0x46, 0x00, 0x26, + 0x23, 0x68, 0x98, 0x47, 0x58, 0xb3, 0x23, 0x68, 0x05, 0x46, 0x38, 0x46, + 0x00, 0x21, 0x2c, 0x22, 0x00, 0x26, 0x98, 0x47, 0xdf, 0xf8, 0x50, 0x80, + 0xc8, 0xf8, 0x00, 0x00, 0xf8, 0xb1, 0x13, 0x48, 0x00, 0x21, 0x00, 0x26, + 0x05, 0x60, 0x2f, 0x60, 0x07, 0xeb, 0x89, 0x00, 0xc0, 0x6b, 0x23, 0x68, + 0xb0, 0xf8, 0x44, 0x00, 0x02, 0x30, 0x82, 0xb2, 0x38, 0x46, 0x98, 0x47, + 0x68, 0x60, 0x70, 0xb1, 0x0b, 0x48, 0x49, 0x46, 0x02, 0x68, 0x28, 0x46, + 0x90, 0x47, 0xa8, 0x60, 0x30, 0xb1, 0xd8, 0xf8, 0x00, 0x00, 0x4f, 0xf6, + 0xff, 0x71, 0x2e, 0x46, 0xc1, 0x80, 0x00, 0xe0, 0x00, 0x26, 0x30, 0x46, + 0xbd, 0xe8, 0xf8, 0x83, 0x74, 0xd4, 0x08, 0x00, 0x84, 0xe5, 0x05, 0x00, + 0x5c, 0x4c, 0x01, 0x00, 0x14, 0xb2, 0x08, 0x00, 0xb0, 0xb5, 0x04, 0x46, + 0x00, 0x20, 0x4f, 0xf6, 0xff, 0x75, 0xa4, 0xf8, 0xac, 0x00, 0xc4, 0xf8, + 0xa8, 0x00, 0xa4, 0xf8, 0xa4, 0x00, 0xc4, 0xf8, 0xa0, 0x00, 0xb4, 0xf8, + 0x96, 0x00, 0xa8, 0x42, 0x0a, 0xd0, 0x94, 0xf8, 0x9c, 0x00, 0xb4, 0xf8, + 0x9a, 0x10, 0x08, 0x44, 0x03, 0x49, 0x80, 0xb2, 0x09, 0x68, 0x88, 0x47, + 0xa4, 0xf8, 0x96, 0x50, 0xb0, 0xbd, 0x00, 0xbf, 0x34, 0xf3, 0x08, 0x00, + 0xf0, 0xb5, 0x85, 0xb0, 0x1c, 0x46, 0xdc, 0x4b, 0x04, 0x94, 0x9d, 0x88, + 0x01, 0x35, 0x9d, 0x80, 0xaf, 0x4b, 0x9b, 0x7a, 0x03, 0xf0, 0x0f, 0x05, + 0x0a, 0x9b, 0x02, 0x2d, 0x14, 0xd1, 0x4b, 0xb1, 0x26, 0x78, 0x00, 0x25, + 0x01, 0x35, 0x09, 0x2e, 0x04, 0xbf, 0x10, 0x26, 0x26, 0x70, 0xef, 0xb2, + 0x9f, 0x42, 0xf7, 0xd1, 0x0d, 0x4d, 0x00, 0x26, 0xcd, 0xe9, 0x00, 0x62, + 0x02, 0x91, 0x3f, 0x21, 0x22, 0x46, 0x2d, 0x68, 0xa8, 0x47, 0x0c, 0xe0, + 0x07, 0x4c, 0x15, 0x46, 0x00, 0x2a, 0x24, 0x68, 0x18, 0xbf, 0x01, 0x25, + 0xcd, 0xe9, 0x00, 0x52, 0x02, 0x91, 0x04, 0xaa, 0x40, 0xf2, 0xf9, 0x11, + 0xa0, 0x47, 0x05, 0xb0, 0xf0, 0xbd, 0x00, 0xbf, 0xbc, 0xaf, 0x08, 0x00, + 0xc0, 0xaf, 0x08, 0x00, 0xf0, 0xb5, 0x85, 0xb0, 0x06, 0x46, 0x92, 0xf8, + 0x57, 0x00, 0x0d, 0x46, 0x91, 0x68, 0x14, 0x46, 0x00, 0xeb, 0x80, 0x02, + 0x01, 0xeb, 0x82, 0x01, 0x64, 0x31, 0xb1, 0x42, 0x43, 0xd1, 0x90, 0x49, + 0x89, 0x7a, 0x01, 0xf0, 0x0f, 0x01, 0x02, 0x29, 0x3d, 0xd1, 0x71, 0x7a, + 0x10, 0x29, 0x3a, 0xd1, 0x31, 0x7b, 0x72, 0x7b, 0xb3, 0x7b, 0xf7, 0x7b, + 0x8d, 0xf8, 0x04, 0x10, 0x8d, 0xf8, 0x05, 0x20, 0x8d, 0xf8, 0x06, 0x30, + 0x8d, 0xf8, 0x07, 0x70, 0x01, 0x99, 0xb1, 0xf1, 0xff, 0x3f, 0x11, 0xdc, + 0xae, 0x48, 0x01, 0xab, 0x00, 0x21, 0x02, 0x22, 0x07, 0x68, 0x04, 0x20, + 0x00, 0x90, 0x40, 0xf6, 0x45, 0x10, 0xb8, 0x47, 0xaa, 0x48, 0x12, 0x21, + 0x00, 0x78, 0xf0, 0xf7, 0x59, 0xfe, 0x94, 0xf8, 0x57, 0x00, 0x01, 0x99, + 0x94, 0xf8, 0x7c, 0x20, 0x00, 0x27, 0x04, 0xeb, 0x82, 0x03, 0x99, 0x66, + 0x11, 0x1f, 0x18, 0xbf, 0x51, 0x1c, 0x84, 0xf8, 0x7c, 0x10, 0x21, 0x18, + 0x80, 0xf0, 0x01, 0x00, 0x84, 0xf8, 0x57, 0x00, 0xa0, 0x8f, 0x81, 0xf8, + 0x58, 0x70, 0x01, 0x30, 0xa0, 0x87, 0xe0, 0x69, 0x01, 0x30, 0xe0, 0x61, + 0x00, 0xe0, 0x01, 0x27, 0x00, 0x20, 0x00, 0x22, 0xcd, 0xe9, 0x03, 0x00, + 0xcd, 0xe9, 0x01, 0x60, 0xad, 0xf8, 0x10, 0x00, 0x07, 0x48, 0xad, 0xf8, + 0x08, 0x50, 0x03, 0x68, 0x91, 0x48, 0x81, 0x88, 0x01, 0xa8, 0x98, 0x47, + 0x27, 0xb1, 0x30, 0x46, 0x29, 0x46, 0x22, 0x46, 0x00, 0xf0, 0xaa, 0xf9, + 0x05, 0xb0, 0xf0, 0xbd, 0x04, 0xb1, 0x08, 0x00, 0x80, 0xb5, 0x00, 0x21, + 0xa0, 0xf8, 0x52, 0x10, 0x80, 0xf8, 0x64, 0x10, 0xa0, 0xf8, 0x54, 0x10, + 0xa0, 0xf8, 0x56, 0x10, 0xa0, 0xf8, 0x58, 0x10, 0x42, 0xf6, 0xb0, 0x01, + 0x41, 0x61, 0x68, 0x30, 0x18, 0x21, 0xf3, 0xf7, 0x51, 0xfc, 0x80, 0xbd, + 0x10, 0xb5, 0x04, 0x46, 0xb0, 0xf8, 0x84, 0x00, 0xb4, 0xf8, 0x86, 0x10, + 0x81, 0x42, 0x1d, 0xd1, 0xb4, 0xf8, 0x82, 0x00, 0xb4, 0xf8, 0x88, 0x10, + 0x81, 0x42, 0x1a, 0xd1, 0x00, 0x20, 0x18, 0x21, 0xa4, 0xf8, 0x52, 0x00, + 0x84, 0xf8, 0x64, 0x00, 0xa4, 0xf8, 0x54, 0x00, 0xa4, 0xf8, 0x56, 0x00, + 0xa4, 0xf8, 0x58, 0x00, 0x42, 0xf6, 0xb0, 0x00, 0x60, 0x61, 0x04, 0xf1, + 0x68, 0x00, 0xf3, 0xf7, 0x2f, 0xfc, 0x07, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x02, 0xe0, 0x94, 0xf8, 0xb8, 0x00, 0x28, 0xb1, 0xac, 0x48, + 0x01, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x08, 0x47, 0x10, 0xbd, + 0x7c, 0xb2, 0x08, 0x00, 0x3d, 0x4b, 0x9b, 0x7a, 0x03, 0xf0, 0x0f, 0x03, + 0x02, 0x2b, 0x09, 0xd1, 0x03, 0x79, 0x5b, 0x07, 0x06, 0xd5, 0xc3, 0x79, + 0x10, 0x2b, 0x03, 0xd1, 0x0c, 0x30, 0x08, 0x60, 0x01, 0x20, 0x70, 0x47, + 0x00, 0xf0, 0x54, 0xb9, 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0x56, 0xf9, + 0x40, 0xb1, 0x94, 0xf8, 0x63, 0x10, 0x04, 0x4a, 0x01, 0xeb, 0x81, 0x01, + 0x02, 0xeb, 0xc1, 0x01, 0x02, 0x4a, 0x8a, 0x60, 0x10, 0xbd, 0x00, 0xbf, + 0xb0, 0xaa, 0x01, 0x00, 0x75, 0x04, 0x03, 0x00, 0x2d, 0xe9, 0xfe, 0x43, + 0x0f, 0x46, 0x29, 0x49, 0x04, 0x46, 0x40, 0x68, 0x1d, 0x46, 0x91, 0x46, + 0x89, 0x7a, 0x01, 0xf0, 0x0f, 0x01, 0x02, 0x29, 0x19, 0xd1, 0xa9, 0x88, + 0xba, 0x68, 0x97, 0xf8, 0x10, 0x80, 0xfe, 0x89, 0x03, 0x30, 0x0b, 0x46, + 0xf0, 0xf7, 0x9a, 0xfd, 0x78, 0x7c, 0x61, 0x68, 0x08, 0x70, 0x46, 0xea, + 0x88, 0x31, 0x60, 0x68, 0x09, 0x0a, 0x46, 0x70, 0x81, 0x70, 0x0f, 0x20, + 0x8d, 0xf8, 0x04, 0x00, 0x60, 0x68, 0xaa, 0x88, 0x02, 0x90, 0xd0, 0x1c, + 0x11, 0xe0, 0xa9, 0x88, 0xba, 0x68, 0x02, 0x30, 0x0b, 0x46, 0xf0, 0xf7, + 0x83, 0xfd, 0x38, 0x7c, 0xf9, 0x89, 0x41, 0xea, 0x80, 0x30, 0x61, 0x68, + 0x08, 0x80, 0x0b, 0x20, 0x02, 0x91, 0xaa, 0x88, 0x8d, 0xf8, 0x04, 0x00, + 0x90, 0x1c, 0x6e, 0x4b, 0xad, 0xf8, 0x06, 0x00, 0x29, 0x68, 0xd9, 0xf8, + 0x00, 0x00, 0x1e, 0x68, 0x01, 0x23, 0x00, 0x93, 0x01, 0xab, 0xb0, 0x47, + 0x02, 0x46, 0x09, 0x48, 0xd9, 0xf8, 0x00, 0x10, 0x03, 0x68, 0x94, 0xf8, + 0x63, 0x00, 0x98, 0x47, 0x01, 0x28, 0x05, 0xd1, 0xa8, 0x88, 0xa4, 0xf8, + 0x4e, 0x00, 0xa0, 0x69, 0x01, 0x30, 0xa0, 0x61, 0xbd, 0xe8, 0xfe, 0x83, + 0x40, 0x86, 0x08, 0x00, 0xd4, 0xaf, 0x08, 0x00, 0x10, 0xb5, 0x8a, 0xb0, + 0x84, 0x8e, 0xb0, 0xf8, 0x88, 0x20, 0xb0, 0xf8, 0x86, 0x30, 0x90, 0xf8, + 0x80, 0x10, 0xad, 0xf8, 0x06, 0x40, 0x04, 0x8f, 0xad, 0xf8, 0x08, 0x20, + 0xad, 0xf8, 0x0a, 0x30, 0xad, 0xf8, 0x04, 0x10, 0x03, 0x29, 0x4f, 0xf0, + 0x01, 0x01, 0xad, 0xf8, 0x10, 0x40, 0x84, 0x8f, 0xad, 0xf8, 0x12, 0x40, + 0x44, 0x8f, 0xad, 0xf8, 0x14, 0x40, 0xb0, 0xf8, 0x82, 0x40, 0xa2, 0xeb, + 0x04, 0x02, 0xad, 0xf8, 0x0c, 0x20, 0xb0, 0xf8, 0x84, 0x20, 0xa3, 0xeb, + 0x02, 0x02, 0xd0, 0xf8, 0x8c, 0x30, 0xad, 0xf8, 0x0e, 0x20, 0xc2, 0x8f, + 0x07, 0x93, 0x01, 0xab, 0xad, 0xf8, 0x16, 0x20, 0xb0, 0xf8, 0x40, 0x20, + 0xad, 0xf8, 0x18, 0x20, 0xc2, 0x6a, 0xad, 0xf8, 0x1a, 0x20, 0x4f, 0xf0, + 0x00, 0x02, 0x0c, 0xbf, 0x00, 0x69, 0x00, 0x20, 0x08, 0x90, 0x09, 0x48, + 0x40, 0x88, 0xad, 0xf8, 0x24, 0x00, 0x08, 0x48, 0x04, 0x68, 0x24, 0x20, + 0x00, 0x90, 0x40, 0xf6, 0x4a, 0x10, 0xa0, 0x47, 0x05, 0x48, 0x12, 0x21, + 0x00, 0x78, 0xf0, 0xf7, 0x0f, 0xfd, 0x0a, 0xb0, 0x10, 0xbd, 0x00, 0xbf, + 0x76, 0xe5, 0x05, 0x00, 0xa0, 0xa0, 0x08, 0x00, 0x66, 0x34, 0x01, 0x00, + 0x70, 0xb5, 0x16, 0x46, 0x0d, 0x46, 0x04, 0x46, 0x00, 0xf0, 0x96, 0xf8, + 0xac, 0xb1, 0x94, 0xf8, 0x80, 0x00, 0x03, 0x28, 0x11, 0xd1, 0x30, 0x1d, + 0x00, 0x21, 0x02, 0x88, 0x12, 0xb1, 0x50, 0xf8, 0x04, 0x2c, 0x52, 0xb9, + 0x01, 0x31, 0x08, 0x30, 0x08, 0x29, 0xf6, 0xd1, 0x34, 0x48, 0x29, 0x68, + 0x02, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0x10, 0x47, 0x70, 0xbd, + 0xb0, 0xb5, 0x05, 0x8d, 0x04, 0x46, 0x00, 0xf0, 0x7f, 0xf8, 0xa0, 0x6a, + 0x40, 0x1b, 0x18, 0xbf, 0x01, 0x20, 0x84, 0xf8, 0xb8, 0x00, 0xb0, 0xbd, + 0x13, 0x48, 0x14, 0x49, 0x15, 0x4a, 0x41, 0x62, 0x13, 0x49, 0xc0, 0xe9, + 0x00, 0x21, 0x14, 0x49, 0x14, 0x4a, 0x0a, 0x60, 0x14, 0x49, 0x15, 0x4a, + 0x0a, 0x60, 0x15, 0x49, 0x15, 0x4a, 0x0a, 0x60, 0x15, 0x49, 0x16, 0x4a, + 0x0a, 0x60, 0x16, 0x49, 0x16, 0x4a, 0x0a, 0x60, 0x16, 0x49, 0x17, 0x4a, + 0x0a, 0x60, 0x17, 0x49, 0x17, 0x4a, 0x0a, 0x60, 0x17, 0x49, 0x18, 0x4a, + 0x0a, 0x60, 0x18, 0x49, 0x18, 0x4a, 0x0a, 0x60, 0x18, 0x49, 0x01, 0x63, + 0x18, 0x48, 0x19, 0x49, 0x01, 0x60, 0x70, 0x47, 0x24, 0x0c, 0x01, 0x00, + 0xf5, 0x00, 0x03, 0x00, 0xd9, 0x01, 0x03, 0x00, 0xc5, 0x01, 0x03, 0x00, + 0x90, 0xb2, 0x08, 0x00, 0x9d, 0x00, 0x03, 0x00, 0x60, 0xb2, 0x08, 0x00, + 0x21, 0x01, 0x03, 0x00, 0x20, 0xb2, 0x08, 0x00, 0x5d, 0x02, 0x03, 0x00, + 0xc8, 0xaf, 0x08, 0x00, 0x9d, 0x02, 0x03, 0x00, 0x80, 0xd4, 0x08, 0x00, + 0x0d, 0x03, 0x03, 0x00, 0x94, 0xb2, 0x08, 0x00, 0x11, 0x04, 0x03, 0x00, + 0x14, 0xb2, 0x08, 0x00, 0x99, 0x04, 0x03, 0x00, 0x58, 0xb2, 0x08, 0x00, + 0xc1, 0x04, 0x03, 0x00, 0x8c, 0xb2, 0x08, 0x00, 0x75, 0x05, 0x03, 0x00, + 0x21, 0x06, 0x03, 0x00, 0x5c, 0xb2, 0x08, 0x00, 0x5d, 0x06, 0x03, 0x00, + 0x43, 0xf6, 0xe5, 0x6c, 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x44, 0xf2, 0xa7, 0x0c, 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x44, 0xf2, 0xb9, 0x1c, 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x43, 0xf6, 0x65, 0x7c, 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x44, 0xf6, 0xff, 0x2c, 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x44, 0xf6, 0x6b, 0x3c, 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x90, 0xf8, 0x0a, 0x11, 0x89, 0x07, 0x58, 0xbf, 0x70, 0x47, 0xc1, 0x6b, + 0x51, 0xb1, 0x09, 0x6a, 0x41, 0xb1, 0x90, 0xf8, 0x09, 0x21, 0x92, 0x07, + 0x04, 0xd0, 0x91, 0xf8, 0x8d, 0x10, 0x02, 0x4a, 0x00, 0x23, 0x53, 0x54, + 0x00, 0xf0, 0x0a, 0xb8, 0x88, 0xe5, 0x05, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x58, 0xf4, 0x08, 0x00, 0x71, 0x07, 0x03, 0x00, + 0x4b, 0xf2, 0xc9, 0x4c, 0xc1, 0xf2, 0x04, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x10, 0xb5, 0x90, 0xf8, 0x09, 0x41, 0xa4, 0x07, 0x18, 0xbf, 0x10, 0xbd, + 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x1a, 0xb8, 0x10, 0xb5, 0x90, 0xf8, + 0x09, 0x41, 0xa4, 0x07, 0x18, 0xbf, 0x10, 0xbd, 0xbd, 0xe8, 0x10, 0x40, + 0x00, 0xf0, 0x16, 0xb8, 0x03, 0x48, 0x04, 0x49, 0x01, 0x60, 0x04, 0x48, + 0x04, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x98, 0xb1, 0x08, 0x00, + 0xcd, 0x07, 0x03, 0x00, 0x40, 0xce, 0x08, 0x00, 0xb9, 0x07, 0x03, 0x00, + 0x4d, 0xf2, 0x45, 0x1c, 0xc1, 0xf2, 0x04, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4d, 0xf2, 0xd3, 0x3c, 0xc1, 0xf2, 0x04, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x1c, 0xb5, 0x8a, 0x7a, 0x00, 0x68, 0x00, 0xeb, 0x82, 0x00, 0xc4, 0x6b, + 0xe2, 0x68, 0x20, 0x6a, 0x53, 0x6a, 0x0d, 0xf1, 0x06, 0x02, 0x98, 0x47, + 0xb4, 0xf8, 0x46, 0x00, 0xbd, 0xf8, 0x06, 0x10, 0x81, 0x42, 0x05, 0xd2, + 0x94, 0xf8, 0x5c, 0x00, 0x01, 0x30, 0x84, 0xf8, 0x5c, 0x00, 0x00, 0x20, + 0x1c, 0xbd, 0x00, 0xbf, 0x01, 0x48, 0x02, 0x49, 0x81, 0x61, 0x70, 0x47, + 0x84, 0x08, 0x01, 0x00, 0x19, 0x08, 0x03, 0x00, 0x07, 0x49, 0x09, 0x68, + 0x29, 0xb1, 0xc2, 0x78, 0x1a, 0xb1, 0x89, 0x78, 0x42, 0x79, 0x8a, 0x42, + 0x01, 0xd2, 0x00, 0xf0, 0x09, 0xb8, 0x12, 0x20, 0x4f, 0xf6, 0x57, 0x51, + 0xf6, 0xf7, 0x0a, 0xba, 0x84, 0x4c, 0x01, 0x00, 0x70, 0x47, 0x00, 0x00, + 0x4c, 0xf6, 0xcd, 0x6c, 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x80, 0xb5, 0x00, 0xf4, 0x7c, 0x41, 0xb1, 0xf5, 0x00, 0x5f, 0x03, 0xd1, + 0x06, 0x49, 0x09, 0x79, 0x49, 0x06, 0x03, 0xd5, 0x42, 0xf2, 0x5f, 0x01, + 0x88, 0x42, 0x01, 0xd1, 0x00, 0x20, 0x80, 0xbd, 0x00, 0xf0, 0xea, 0xf9, + 0x80, 0xbd, 0x00, 0xbf, 0xa8, 0x52, 0x01, 0x00, 0x70, 0xb5, 0xc0, 0xb1, + 0x0c, 0x46, 0xb1, 0xb1, 0x05, 0x46, 0xa0, 0x78, 0xe1, 0x78, 0x61, 0xf3, + 0x0d, 0x20, 0x06, 0x1d, 0x55, 0xf8, 0x08, 0x0c, 0x00, 0x89, 0x86, 0x42, + 0x03, 0xd9, 0x00, 0x20, 0x65, 0x21, 0xf0, 0xf7, 0x8d, 0xfb, 0x28, 0x46, + 0x31, 0x46, 0x22, 0x46, 0x33, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0xf0, 0xf7, + 0x97, 0xbb, 0x70, 0xbd, 0xb0, 0xb5, 0x43, 0x78, 0x01, 0x25, 0x1c, 0x09, + 0x65, 0xf3, 0x5f, 0x04, 0x02, 0x2c, 0x0a, 0xd1, 0xc3, 0xf3, 0x80, 0x13, + 0x91, 0xb1, 0x00, 0xeb, 0x83, 0x04, 0x25, 0x79, 0x0d, 0x70, 0x64, 0x79, + 0x4c, 0x70, 0x01, 0x21, 0x0b, 0xe0, 0x3a, 0xb1, 0x81, 0x78, 0x11, 0x70, + 0xc0, 0x78, 0x50, 0x70, 0x10, 0x88, 0x6f, 0xf3, 0x9f, 0x30, 0x10, 0x80, + 0x00, 0x21, 0x07, 0xe0, 0x00, 0x21, 0x2a, 0xb1, 0x00, 0xeb, 0x83, 0x00, + 0x83, 0x79, 0x13, 0x70, 0xc0, 0x79, 0x50, 0x70, 0x08, 0x46, 0xb0, 0xbd, + 0xfe, 0xb5, 0x0d, 0x46, 0x00, 0x21, 0x16, 0x46, 0x01, 0x22, 0x00, 0x23, + 0x02, 0x91, 0x02, 0xa9, 0x01, 0xf0, 0xfa, 0xf9, 0x02, 0x9c, 0x94, 0xb1, + 0x07, 0x46, 0x21, 0x1d, 0xa2, 0x1d, 0x28, 0x46, 0xa6, 0x70, 0xff, 0xf7, + 0xc5, 0xff, 0x06, 0x48, 0x01, 0x21, 0x00, 0x22, 0x23, 0x46, 0x00, 0x97, + 0x05, 0x68, 0x40, 0xf2, 0x33, 0x60, 0xa8, 0x47, 0x20, 0x46, 0xf6, 0xf7, + 0xbd, 0xf9, 0xfe, 0xbd, 0xa0, 0xa0, 0x08, 0x00, 0xf8, 0xb5, 0x00, 0x28, + 0x52, 0xd0, 0x05, 0x46, 0x04, 0x78, 0x40, 0x78, 0x60, 0xf3, 0x0b, 0x24, + 0x16, 0x2c, 0x17, 0xd8, 0x2c, 0x48, 0x04, 0xeb, 0x44, 0x01, 0x50, 0xf8, + 0x21, 0x60, 0x8e, 0xb1, 0x04, 0xeb, 0x44, 0x01, 0x00, 0xeb, 0x81, 0x00, + 0x00, 0x79, 0x05, 0x38, 0x01, 0x28, 0x09, 0xd8, 0x70, 0x6b, 0x38, 0xb1, + 0x31, 0x6b, 0x29, 0xb1, 0x90, 0xf8, 0x29, 0x10, 0xca, 0x07, 0x01, 0xd0, + 0x02, 0x78, 0x5a, 0xb1, 0x28, 0x46, 0xf6, 0xf7, 0x95, 0xf9, 0x21, 0x48, + 0x01, 0x21, 0x01, 0x22, 0x03, 0x68, 0x20, 0x46, 0x01, 0xb0, 0xbd, 0xe8, + 0xf0, 0x40, 0x18, 0x47, 0x00, 0x69, 0x00, 0x28, 0xf0, 0xd0, 0x48, 0x07, + 0xee, 0xd4, 0x93, 0x48, 0x90, 0xf8, 0x20, 0x00, 0xc0, 0x07, 0x15, 0xd0, + 0x16, 0x48, 0x90, 0xf9, 0xba, 0x01, 0x00, 0x28, 0x10, 0xd4, 0x6d, 0x48, + 0xea, 0x78, 0x01, 0x68, 0xa8, 0x78, 0x62, 0xf3, 0x0d, 0x20, 0x04, 0x30, + 0x88, 0x47, 0xb0, 0xb1, 0x29, 0x46, 0x07, 0x46, 0xff, 0xf7, 0x50, 0xff, + 0x28, 0x46, 0xf6, 0xf7, 0x6d, 0xf9, 0x00, 0xe0, 0x2f, 0x46, 0x38, 0x46, + 0x31, 0x46, 0xf2, 0xf7, 0xcf, 0xfc, 0x78, 0x78, 0x80, 0x06, 0x00, 0xd4, + 0xf8, 0xbd, 0x09, 0x48, 0x01, 0x68, 0x30, 0x46, 0xbd, 0xe8, 0xf8, 0x40, + 0x08, 0x47, 0x30, 0x46, 0x29, 0x46, 0x03, 0x22, 0xff, 0xf7, 0x7c, 0xff, + 0xbe, 0xe7, 0x00, 0xbf, 0xe8, 0x72, 0x01, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0xe4, 0xb2, 0x08, 0x00, 0x98, 0xb2, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x47, + 0x04, 0x46, 0x75, 0x48, 0x88, 0x46, 0x99, 0x46, 0x92, 0x46, 0x90, 0xf8, + 0x20, 0x10, 0xc9, 0x07, 0x0a, 0xd1, 0x72, 0x48, 0x90, 0xf8, 0x60, 0x15, + 0x71, 0x48, 0x00, 0xf5, 0x34, 0x70, 0x01, 0xf0, 0x01, 0x01, 0xf4, 0xf7, + 0x15, 0xfc, 0x09, 0xe0, 0x90, 0xf8, 0x22, 0x00, 0x21, 0x7d, 0x81, 0x42, + 0x19, 0xd2, 0x48, 0x48, 0x01, 0x68, 0x0a, 0xf1, 0x0c, 0x00, 0x88, 0x47, + 0x07, 0x46, 0x90, 0xb1, 0x0a, 0x98, 0x08, 0x9e, 0x00, 0x21, 0x02, 0x28, + 0x1d, 0xd0, 0x04, 0x28, 0x3c, 0xd0, 0x06, 0x28, 0x3d, 0xd1, 0xb2, 0x45, + 0x04, 0xd0, 0x00, 0x20, 0x40, 0xf2, 0x1d, 0x21, 0xf6, 0xf7, 0xfe, 0xf8, + 0x4f, 0xf4, 0x00, 0x50, 0x10, 0xe0, 0x3c, 0x48, 0x94, 0xf8, 0x1d, 0x11, + 0x00, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, 0xb0, 0xf8, + 0x8e, 0x10, 0x01, 0x31, 0xa0, 0xf8, 0x8e, 0x10, 0x00, 0x20, 0xbd, 0xe8, + 0xf0, 0x87, 0x00, 0x20, 0x09, 0x9a, 0x4f, 0xea, 0x19, 0x23, 0x0b, 0x99, + 0xbe, 0x72, 0x87, 0xf8, 0x08, 0x90, 0x7b, 0x72, 0x13, 0x0e, 0x3a, 0x71, + 0x00, 0x29, 0xfb, 0x71, 0x4f, 0xea, 0x12, 0x43, 0x4f, 0xea, 0x12, 0x22, + 0x7a, 0x71, 0x4f, 0xf4, 0x80, 0x42, 0xbb, 0x71, 0x04, 0xbf, 0x48, 0xf2, + 0x00, 0x02, 0xcf, 0xf6, 0xff, 0x72, 0x01, 0x29, 0x18, 0xbf, 0x16, 0x43, + 0x31, 0x0a, 0xf9, 0x72, 0x01, 0x21, 0x05, 0xe0, 0x4f, 0xf4, 0x40, 0x50, + 0x02, 0xe0, 0x00, 0x21, 0x4f, 0xf4, 0x80, 0x50, 0x00, 0xf4, 0x40, 0x50, + 0x94, 0xf8, 0x44, 0x20, 0x40, 0xea, 0x81, 0x30, 0x00, 0x0a, 0x3a, 0x70, + 0x78, 0x70, 0x11, 0xfb, 0x01, 0xf0, 0x80, 0x00, 0x40, 0xea, 0x41, 0x00, + 0x00, 0xeb, 0x41, 0x00, 0x06, 0x1d, 0x0a, 0xeb, 0x06, 0x00, 0x05, 0x1f, + 0xa8, 0xb2, 0xb0, 0xf5, 0x80, 0x4f, 0x04, 0xd3, 0x00, 0x20, 0x40, 0xf2, + 0x47, 0x21, 0xf6, 0xf7, 0xa7, 0xf8, 0x28, 0x0a, 0x51, 0x46, 0x42, 0x46, + 0x53, 0x46, 0xbd, 0x70, 0xf8, 0x70, 0xb8, 0x19, 0xf0, 0xf7, 0x4e, 0xfa, + 0x04, 0xf1, 0x0c, 0x01, 0x38, 0x46, 0xf2, 0xf7, 0x1f, 0xfc, 0x0b, 0x48, + 0x94, 0xf8, 0x1d, 0x11, 0x00, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, + 0x41, 0x10, 0xb0, 0xf8, 0x8c, 0x10, 0x01, 0x31, 0xa0, 0xf8, 0x8c, 0x10, + 0x05, 0x48, 0x04, 0x21, 0x00, 0x78, 0xf0, 0xf7, 0x3d, 0xfa, 0x01, 0x20, + 0xbd, 0xe8, 0xf0, 0x87, 0xd4, 0x9b, 0x08, 0x00, 0xe0, 0x35, 0x01, 0x00, + 0x66, 0x34, 0x01, 0x00, 0xb0, 0xb5, 0x1b, 0x48, 0x00, 0x78, 0x50, 0xb1, + 0x1a, 0x4a, 0x00, 0x21, 0x52, 0xf8, 0x21, 0x40, 0x14, 0xb1, 0x54, 0xf8, + 0x0c, 0x3f, 0x2b, 0xb9, 0x01, 0x31, 0x81, 0x42, 0xf6, 0xd3, 0x00, 0x25, + 0x28, 0x46, 0xb0, 0xbd, 0x14, 0x48, 0x90, 0xf8, 0x20, 0x00, 0xc0, 0x07, + 0x05, 0xd1, 0x15, 0x48, 0x01, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, + 0x08, 0x47, 0x10, 0x48, 0x90, 0xf8, 0x60, 0x15, 0x0f, 0x48, 0x00, 0xf5, + 0x34, 0x70, 0x01, 0xf0, 0x01, 0x01, 0xf4, 0xf7, 0x51, 0xfb, 0x00, 0x28, + 0xe5, 0xd0, 0x05, 0x46, 0x0b, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0x04, 0x46, 0x28, 0x46, 0x21, 0x46, 0xff, 0xf7, 0x49, 0xfe, 0x20, 0x46, + 0xf6, 0xf7, 0x66, 0xf8, 0xd8, 0xe7, 0x00, 0xbf, 0xd4, 0x58, 0x01, 0x00, + 0x14, 0x58, 0x01, 0x00, 0x50, 0x32, 0x06, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0x68, 0x8a, 0x01, 0x00, 0x24, 0x9d, 0x08, 0x00, 0x06, 0x48, 0x07, 0x49, + 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, + 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x6c, 0xa7, 0x08, 0x00, 0x89, 0x09, 0x03, 0x00, 0xc0, 0xb3, 0x08, 0x00, + 0x91, 0x08, 0x03, 0x00, 0xcc, 0xb3, 0x08, 0x00, 0x61, 0x0a, 0x03, 0x00, + 0xe4, 0xa2, 0x08, 0x00, 0xc5, 0x0b, 0x03, 0x00, 0x45, 0xf2, 0x5d, 0x2c, + 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x80, 0xb5, 0x00, 0xf0, + 0x7b, 0xfb, 0x04, 0x48, 0x5a, 0x21, 0xf2, 0xf7, 0x53, 0xfb, 0x03, 0x48, + 0x00, 0x21, 0x01, 0x60, 0x80, 0xbd, 0x00, 0xbf, 0x8c, 0xe5, 0x05, 0x00, + 0xe8, 0xe5, 0x05, 0x00, 0xbc, 0xb5, 0xc1, 0x78, 0x0f, 0x29, 0x18, 0xd1, + 0x00, 0x21, 0x04, 0x78, 0x45, 0x78, 0x8d, 0xf8, 0x07, 0x10, 0x0d, 0xf1, + 0x07, 0x01, 0x00, 0xf0, 0x13, 0xf8, 0x02, 0x46, 0x44, 0xea, 0x05, 0x20, + 0x81, 0xb2, 0x03, 0x20, 0xf5, 0xf7, 0xfe, 0xff, 0x30, 0xb1, 0x9d, 0xf8, + 0x07, 0x10, 0xc1, 0x71, 0x0f, 0x21, 0x81, 0x71, 0xf5, 0xf7, 0xcc, 0xff, + 0xbc, 0xbd, 0x00, 0xf0, 0x55, 0xfb, 0xbc, 0xbd, 0x2d, 0xe9, 0xf0, 0x4f, + 0x9b, 0xb0, 0xdf, 0xf8, 0xb4, 0x93, 0x05, 0x46, 0x8a, 0x46, 0xd9, 0xf8, + 0x00, 0x00, 0x1a, 0x90, 0x00, 0x20, 0x2e, 0x7a, 0x08, 0x70, 0x28, 0x46, + 0x00, 0xf0, 0xe8, 0xf9, 0x00, 0xb3, 0xdf, 0xf8, 0xa0, 0xb3, 0xdf, 0xf8, + 0x98, 0x03, 0xdb, 0xf8, 0x00, 0x10, 0x90, 0xf8, 0x1e, 0x01, 0x49, 0x78, + 0x81, 0x42, 0x80, 0xf0, 0xaa, 0x80, 0x95, 0xf8, 0x21, 0x00, 0x01, 0x38, + 0x03, 0x28, 0x0f, 0xd8, 0x80, 0x24, 0x05, 0x96, 0xdf, 0xe8, 0x00, 0xf0, + 0x70, 0x02, 0x0e, 0x19, 0x95, 0xf8, 0x22, 0x00, 0x03, 0x28, 0x20, 0xd0, + 0x02, 0x28, 0x25, 0xd0, 0x01, 0x28, 0x01, 0xd1, 0x02, 0x20, 0x22, 0xe0, + 0x12, 0x24, 0x93, 0xe0, 0x08, 0xa8, 0x05, 0xf1, 0x22, 0x02, 0x10, 0x21, + 0x10, 0x23, 0x08, 0x30, 0xf0, 0xf7, 0x5a, 0xf9, 0x4f, 0xf4, 0x80, 0x74, + 0x56, 0xe0, 0x95, 0xf8, 0x22, 0x00, 0x05, 0xf1, 0x23, 0x02, 0x06, 0x21, + 0x06, 0x23, 0x8d, 0xf8, 0x28, 0x00, 0x08, 0xa8, 0x09, 0x30, 0xf0, 0xf7, + 0x4b, 0xf9, 0x01, 0x24, 0x48, 0xe0, 0x10, 0x23, 0x00, 0x24, 0x0d, 0xf1, + 0x20, 0x08, 0x8d, 0xf8, 0x28, 0x30, 0x14, 0xe0, 0x04, 0x20, 0x0d, 0xf1, + 0x20, 0x08, 0xc6, 0x4a, 0x8d, 0xf8, 0x28, 0x00, 0x10, 0x21, 0x10, 0x23, + 0x08, 0xf1, 0x0a, 0x00, 0xf0, 0xf7, 0x36, 0xf9, 0x08, 0xf1, 0x1a, 0x00, + 0x10, 0x21, 0xff, 0x22, 0x00, 0xf0, 0xf4, 0xfa, 0x9d, 0xf8, 0x28, 0x30, + 0x0c, 0x24, 0x08, 0xf1, 0x0a, 0x06, 0xc4, 0xf1, 0x10, 0x01, 0x05, 0xf1, + 0x23, 0x02, 0x30, 0x19, 0xf0, 0xf7, 0x24, 0xf9, 0x08, 0xa8, 0x9d, 0xf8, + 0x28, 0x10, 0xff, 0x22, 0x00, 0xf1, 0x1a, 0x07, 0x38, 0x19, 0x00, 0xf0, + 0xdf, 0xfa, 0x98, 0xf8, 0x09, 0x00, 0xb3, 0x4a, 0x40, 0xf0, 0x01, 0x01, + 0x88, 0xf8, 0x09, 0x10, 0x00, 0x21, 0x33, 0x78, 0x3c, 0x78, 0x23, 0x40, + 0x14, 0x78, 0xa3, 0x42, 0x06, 0xd1, 0x01, 0x31, 0x01, 0x36, 0x01, 0x37, + 0x01, 0x32, 0x0c, 0x29, 0xf3, 0xd1, 0x03, 0xe0, 0x00, 0xf0, 0xfe, 0x00, + 0x88, 0xf8, 0x09, 0x00, 0x05, 0x9e, 0x04, 0x24, 0xa7, 0x48, 0x00, 0x68, + 0x80, 0x47, 0xff, 0x28, 0x2b, 0xd0, 0x07, 0x46, 0xa5, 0x48, 0x01, 0x68, + 0x06, 0x20, 0x88, 0x47, 0x88, 0xb3, 0x95, 0xf8, 0x21, 0x10, 0xdf, 0xf8, + 0x8c, 0xc2, 0x04, 0x94, 0x01, 0x23, 0x02, 0x90, 0x41, 0x71, 0x29, 0x79, + 0x41, 0x70, 0x69, 0x79, 0x81, 0x70, 0xa9, 0x79, 0xc1, 0x70, 0xe9, 0x79, + 0x07, 0x70, 0xdb, 0xf8, 0x00, 0x20, 0x01, 0x71, 0x51, 0x78, 0x02, 0xeb, + 0x81, 0x01, 0x48, 0x60, 0xdb, 0xf8, 0x00, 0x20, 0x51, 0x78, 0x01, 0x31, + 0x51, 0x70, 0xdc, 0xf8, 0x00, 0x40, 0xe1, 0x07, 0x16, 0xd1, 0x01, 0x21, + 0x4f, 0xf0, 0x00, 0x08, 0x01, 0x91, 0x01, 0x21, 0x23, 0xe0, 0x07, 0x24, + 0xd9, 0xf8, 0x00, 0x00, 0x1a, 0x99, 0x40, 0x1a, 0x02, 0xbf, 0x20, 0x46, + 0x1b, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0xf5, 0xf7, 0x01, 0xff, 0x91, 0x48, + 0x01, 0x68, 0x38, 0x46, 0x88, 0x47, 0xee, 0xe7, 0x4f, 0xf0, 0x00, 0x08, + 0x01, 0x22, 0x1e, 0x2a, 0x1b, 0xd0, 0x08, 0xf1, 0x01, 0x08, 0x01, 0x32, + 0x03, 0xfa, 0x08, 0xf1, 0x0c, 0x42, 0xf6, 0xd1, 0xa8, 0xf1, 0x01, 0x02, + 0x00, 0x23, 0x1d, 0x2a, 0x38, 0xbf, 0x01, 0x23, 0x01, 0x93, 0x02, 0x78, + 0x7f, 0x48, 0x08, 0xeb, 0x48, 0x03, 0xc2, 0x54, 0x03, 0x44, 0x44, 0xea, + 0x01, 0x00, 0x5e, 0x70, 0xcc, 0xf8, 0x00, 0x00, 0x68, 0x7a, 0x98, 0x70, + 0x08, 0xe0, 0x00, 0x21, 0xb8, 0xf1, 0x1d, 0x0f, 0x4f, 0xf0, 0x1e, 0x08, + 0x38, 0xbf, 0x01, 0x21, 0x02, 0x78, 0x01, 0x91, 0x75, 0x48, 0x8a, 0xf8, + 0x00, 0x20, 0x75, 0x49, 0x00, 0x22, 0xcd, 0xf8, 0x0c, 0xa0, 0x03, 0x68, + 0x38, 0x46, 0x98, 0x47, 0x04, 0x99, 0x07, 0x97, 0x80, 0x29, 0x37, 0xd1, + 0x95, 0xf8, 0x22, 0xa0, 0xba, 0xf1, 0x00, 0x0f, 0x41, 0xd0, 0x08, 0xa8, + 0x4f, 0xf0, 0x00, 0x09, 0x80, 0x27, 0x0c, 0x30, 0x06, 0x90, 0x23, 0x20, + 0x41, 0x1c, 0x00, 0xf1, 0x03, 0x0b, 0xc9, 0xb2, 0x55, 0xfa, 0x8b, 0xf2, + 0x69, 0x5c, 0x8d, 0xf8, 0x28, 0x10, 0x81, 0x1c, 0xc0, 0xb2, 0x28, 0x5c, + 0xc9, 0xb2, 0x69, 0x5c, 0x02, 0x38, 0x8d, 0xf8, 0x2b, 0x00, 0xc3, 0xb2, + 0x00, 0x20, 0x8d, 0xf8, 0x29, 0x10, 0x1d, 0x21, 0x8d, 0xf8, 0x2a, 0x00, + 0x06, 0x98, 0xf0, 0xf7, 0x5f, 0xf8, 0x5d, 0x48, 0x9d, 0xf8, 0x2b, 0x60, + 0x80, 0x21, 0x00, 0x22, 0x08, 0xab, 0x04, 0x68, 0x07, 0x98, 0xa0, 0x47, + 0x70, 0xb9, 0x09, 0xf1, 0x01, 0x09, 0x06, 0xeb, 0x0b, 0x00, 0xd1, 0x45, + 0xd4, 0xd1, 0x0e, 0xe0, 0x54, 0x48, 0x08, 0xab, 0x00, 0x22, 0x04, 0x68, + 0x38, 0x46, 0xa0, 0x47, 0x38, 0xb1, 0x04, 0x9f, 0xdf, 0xf8, 0x18, 0x91, + 0xdd, 0xf8, 0x0c, 0xa0, 0xdf, 0xf8, 0x18, 0xb1, 0x48, 0xe0, 0x05, 0x98, + 0x10, 0xf0, 0x05, 0x0f, 0x21, 0xd0, 0x08, 0xac, 0x48, 0x21, 0x20, 0x46, + 0x00, 0xf0, 0x00, 0xfa, 0x28, 0x7c, 0x05, 0xf1, 0x0a, 0x02, 0x06, 0x21, + 0x06, 0x23, 0x8d, 0xf8, 0x28, 0x00, 0x04, 0xf1, 0x09, 0x00, 0xf0, 0xf7, + 0x2b, 0xf8, 0x43, 0x48, 0x01, 0x21, 0x00, 0x22, 0x23, 0x46, 0x06, 0x68, + 0x07, 0x98, 0xb0, 0x47, 0x04, 0x99, 0xdf, 0xf8, 0xd4, 0x90, 0xdd, 0xf8, + 0x0c, 0xa0, 0xdf, 0xf8, 0xd4, 0xb0, 0x41, 0xf0, 0x01, 0x07, 0x18, 0xbb, + 0x06, 0xe0, 0x04, 0x9f, 0xdf, 0xf8, 0xbc, 0x90, 0xdd, 0xf8, 0x0c, 0xa0, + 0xdf, 0xf8, 0xbc, 0xb0, 0x05, 0x98, 0x10, 0xf0, 0x0a, 0x0f, 0x4a, 0xd0, + 0x08, 0xac, 0x48, 0x21, 0x20, 0x46, 0x00, 0xf0, 0xd3, 0xf9, 0x04, 0xf1, + 0x08, 0x00, 0x05, 0xf1, 0x11, 0x02, 0x10, 0x21, 0x10, 0x23, 0xf0, 0xf7, + 0x01, 0xf8, 0x2e, 0x48, 0x4f, 0xf4, 0x80, 0x71, 0x00, 0x22, 0x23, 0x46, + 0x05, 0x68, 0x07, 0x98, 0xa8, 0x47, 0x47, 0xf4, 0x80, 0x77, 0x90, 0xb3, + 0x29, 0x48, 0x07, 0x9e, 0x39, 0x46, 0x00, 0x22, 0x00, 0x23, 0x00, 0x24, + 0x05, 0x68, 0x02, 0x20, 0x00, 0x90, 0x30, 0x46, 0xa8, 0x47, 0x25, 0x48, + 0x8a, 0xf8, 0x00, 0x40, 0x01, 0x68, 0x30, 0x46, 0x88, 0x47, 0x02, 0x98, + 0xf5, 0xf7, 0x50, 0xfe, 0xdb, 0xf8, 0x00, 0x00, 0x41, 0x78, 0x01, 0x39, + 0x41, 0x70, 0xdb, 0xf8, 0x00, 0x00, 0x41, 0x78, 0x00, 0xeb, 0x81, 0x00, + 0x44, 0x60, 0x01, 0x98, 0x00, 0x28, 0x3f, 0xf4, 0x04, 0xaf, 0xad, 0x49, + 0x08, 0xeb, 0x48, 0x00, 0xaa, 0x4a, 0x0c, 0x54, 0x08, 0x44, 0x11, 0x68, + 0x84, 0x70, 0x44, 0x70, 0x01, 0x20, 0x00, 0xfa, 0x08, 0xf0, 0x21, 0xea, + 0x00, 0x00, 0x10, 0x60, 0xf3, 0xe6, 0x10, 0x48, 0x39, 0x46, 0x00, 0x22, + 0x00, 0x23, 0x00, 0x24, 0x05, 0x68, 0x02, 0x20, 0x00, 0x90, 0x07, 0x98, + 0xa8, 0x47, 0xe9, 0xe6, 0x38, 0xec, 0x01, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0xac, 0x4c, 0x01, 0x00, 0xf8, 0x31, 0x0a, 0x10, 0x00, 0xbf, 0x08, 0x00, + 0xd4, 0x9b, 0x08, 0x00, 0xe8, 0xe5, 0x05, 0x00, 0x8c, 0xe5, 0x05, 0x00, + 0x08, 0xbf, 0x08, 0x00, 0x25, 0x11, 0x03, 0x00, 0x08, 0x9c, 0x08, 0x00, + 0x0c, 0xbf, 0x08, 0x00, 0x04, 0xbf, 0x08, 0x00, 0xf8, 0xb5, 0x06, 0x7a, + 0xbe, 0xb1, 0xc4, 0x79, 0x45, 0x7a, 0x90, 0xf8, 0x21, 0x70, 0x16, 0xf0, + 0x0a, 0x0f, 0x05, 0xd0, 0x09, 0x49, 0x11, 0x30, 0x10, 0x22, 0x00, 0xf0, + 0x5f, 0xf9, 0x50, 0xb1, 0x30, 0x07, 0x02, 0xd0, 0xf8, 0x1e, 0x02, 0x28, + 0x05, 0xd3, 0xe8, 0x07, 0x18, 0xbf, 0x00, 0x2c, 0x01, 0xd1, 0x01, 0x20, + 0xf8, 0xbd, 0x00, 0x20, 0xf8, 0xbd, 0x00, 0xbf, 0x9a, 0xad, 0x09, 0x10, + 0x2d, 0xe9, 0xfe, 0x43, 0x07, 0x46, 0x1e, 0x48, 0xad, 0xf8, 0x0a, 0x10, + 0x92, 0xf8, 0x02, 0x90, 0x98, 0x46, 0x14, 0x46, 0x01, 0x68, 0x38, 0x46, + 0x88, 0x47, 0x05, 0x46, 0x38, 0x46, 0x00, 0xf0, 0x31, 0xf8, 0x40, 0xb3, + 0x3d, 0xb3, 0x06, 0x46, 0x0d, 0xf1, 0x0a, 0x03, 0x28, 0x46, 0x22, 0x46, + 0x31, 0x46, 0x00, 0xf0, 0x41, 0xf8, 0xe0, 0xb1, 0x80, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x7f, 0x28, 0x18, 0xd0, 0x0a, 0x98, 0xbd, 0xf8, + 0x0a, 0x10, 0x22, 0x46, 0x43, 0x46, 0x00, 0x90, 0x38, 0x46, 0x00, 0xf0, + 0x29, 0xf9, 0x70, 0xb1, 0x05, 0x46, 0x59, 0x48, 0x00, 0x68, 0x00, 0x78, + 0x01, 0x28, 0x09, 0xd1, 0x30, 0x46, 0x21, 0x46, 0x00, 0xf0, 0x57, 0xf8, + 0x20, 0xb9, 0x84, 0xf8, 0x02, 0x90, 0x01, 0x25, 0x00, 0xe0, 0x00, 0x25, + 0x28, 0x46, 0xbd, 0xe8, 0xfe, 0x83, 0x00, 0xbf, 0xb4, 0xca, 0x08, 0x00, + 0xb0, 0xb5, 0x01, 0x46, 0x5f, 0x48, 0x02, 0x68, 0x92, 0xb1, 0x5f, 0x48, + 0x00, 0x23, 0x00, 0x25, 0x1e, 0x2b, 0x0d, 0xd0, 0xd4, 0x07, 0x02, 0xd0, + 0x04, 0x78, 0x8c, 0x42, 0x09, 0xd0, 0x54, 0x08, 0xb5, 0xeb, 0x52, 0x0f, + 0x00, 0xf1, 0x03, 0x00, 0x03, 0xf1, 0x01, 0x03, 0x22, 0x46, 0xef, 0xd1, + 0x00, 0x20, 0xb0, 0xbd, 0xb0, 0xb5, 0x49, 0x78, 0x59, 0xb3, 0x12, 0x79, + 0x1c, 0x46, 0x52, 0x07, 0x0e, 0xd4, 0x8a, 0x06, 0x19, 0xd4, 0xca, 0x07, + 0x1c, 0xbf, 0x25, 0x88, 0x5f, 0xea, 0xc5, 0x72, 0x14, 0xd1, 0x89, 0x07, + 0x44, 0xbf, 0x25, 0x88, 0x5f, 0xea, 0xc5, 0x51, 0x13, 0xd5, 0x0d, 0xe0, + 0xca, 0x06, 0x12, 0xd4, 0x48, 0x07, 0x02, 0xd5, 0x20, 0x88, 0xc0, 0x07, + 0x11, 0xd1, 0x08, 0x07, 0x09, 0xd5, 0x20, 0x88, 0xc0, 0x05, 0x06, 0xd5, + 0x0b, 0xe0, 0x25, 0x88, 0x40, 0x79, 0x00, 0xf0, 0x29, 0xf8, 0x28, 0x42, + 0x05, 0xd1, 0x00, 0x20, 0xb0, 0xbd, 0x40, 0x79, 0x00, 0xf0, 0x22, 0xf8, + 0x20, 0x80, 0x01, 0x20, 0xb0, 0xbd, 0x42, 0x78, 0xb2, 0xb1, 0x82, 0x78, + 0xd2, 0x07, 0x03, 0xd0, 0x8a, 0x78, 0x42, 0xf0, 0x40, 0x02, 0x8a, 0x70, + 0x09, 0x79, 0x4a, 0x07, 0x05, 0xd4, 0x80, 0x78, 0xc9, 0x06, 0x07, 0xd4, + 0x40, 0x07, 0x03, 0xd5, 0x06, 0xe0, 0x80, 0x78, 0x00, 0x07, 0x03, 0xd4, + 0x00, 0x20, 0x70, 0x47, 0x80, 0x07, 0xfb, 0xd5, 0x01, 0x20, 0x70, 0x47, + 0x00, 0x79, 0xc0, 0xf3, 0x80, 0x00, 0x70, 0x47, 0x41, 0x1e, 0x03, 0x29, + 0x06, 0xd8, 0x80, 0x20, 0xdf, 0xe8, 0x01, 0xf0, 0x05, 0x02, 0x06, 0x09, + 0x04, 0x20, 0x70, 0x47, 0x00, 0x20, 0x70, 0x47, 0x4f, 0xf4, 0x80, 0x70, + 0x70, 0x47, 0x01, 0x20, 0x70, 0x47, 0x00, 0xbf, 0x10, 0xb5, 0x10, 0x48, + 0x00, 0x68, 0x00, 0x78, 0xb8, 0xb1, 0x20, 0x48, 0x01, 0x68, 0xa1, 0xb1, + 0x1f, 0x48, 0x00, 0x23, 0x42, 0x1c, 0x1e, 0x2b, 0x0f, 0xd0, 0xc8, 0x07, + 0x03, 0xd0, 0x10, 0x78, 0x10, 0xf0, 0x0c, 0x0f, 0x0b, 0xd1, 0x00, 0x20, + 0x4c, 0x08, 0x03, 0x32, 0x01, 0x33, 0xb0, 0xeb, 0x51, 0x0f, 0x21, 0x46, + 0x08, 0xbf, 0x10, 0xbd, 0xed, 0xe7, 0x00, 0x20, 0x10, 0xbd, 0x01, 0x20, + 0x10, 0xbd, 0x00, 0xbf, 0xac, 0x4c, 0x01, 0x00, 0xf8, 0xb5, 0x04, 0x46, + 0x00, 0xf0, 0x74, 0xf8, 0x88, 0xb9, 0xdf, 0xf8, 0x38, 0xc0, 0x0e, 0x4b, + 0x00, 0x25, 0x01, 0x26, 0xdc, 0xf8, 0x00, 0x20, 0x06, 0xfa, 0x05, 0xf7, + 0x3a, 0x42, 0x02, 0xd0, 0x19, 0x78, 0xa1, 0x42, 0x04, 0xd0, 0x01, 0x35, + 0x03, 0x33, 0x1e, 0x2d, 0xf4, 0xd1, 0xf8, 0xbd, 0x00, 0x21, 0x99, 0x70, + 0x59, 0x70, 0x19, 0x70, 0x22, 0xea, 0x07, 0x01, 0xcc, 0xf8, 0x00, 0x10, + 0xf8, 0xbd, 0x00, 0xbf, 0xe8, 0xe5, 0x05, 0x00, 0x8c, 0xe5, 0x05, 0x00, + 0xf8, 0xb5, 0x07, 0x46, 0x09, 0x48, 0x0e, 0x46, 0x1c, 0x46, 0x15, 0x46, + 0x01, 0x68, 0x10, 0x46, 0x88, 0x47, 0x7f, 0x28, 0x04, 0xbf, 0x00, 0x20, + 0xf8, 0xbd, 0x38, 0x46, 0x31, 0x46, 0x2a, 0x46, 0x23, 0x46, 0x01, 0xb0, + 0xbd, 0xe8, 0xf0, 0x40, 0x00, 0xf0, 0x36, 0xb8, 0x60, 0xa2, 0x08, 0x00, + 0x04, 0x48, 0x05, 0x49, 0x01, 0x60, 0x05, 0x48, 0x05, 0x49, 0x01, 0x60, + 0x05, 0x48, 0x06, 0x49, 0x01, 0x60, 0x70, 0x47, 0x60, 0xca, 0x08, 0x00, + 0xe9, 0x12, 0x03, 0x00, 0x24, 0xc3, 0x08, 0x00, 0x95, 0x0c, 0x03, 0x00, + 0x60, 0xbf, 0x08, 0x00, 0x35, 0x13, 0x03, 0x00, 0x4e, 0xf2, 0x55, 0x6c, + 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf2, 0x49, 0x0c, + 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf2, 0xc9, 0x4c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf2, 0xc7, 0x4c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0x59, 0x0c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf6, 0xd1, 0x1c, + 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf6, 0x09, 0x6c, + 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x3d, 0x28, 0x18, 0xbf, + 0x00, 0xf0, 0x66, 0xb8, 0x01, 0x20, 0x70, 0x47, 0xfe, 0xb5, 0x1d, 0x4e, + 0x1d, 0x4f, 0x30, 0x68, 0x02, 0x90, 0x97, 0xf8, 0x7c, 0x02, 0xc0, 0x07, + 0x06, 0xd0, 0x1b, 0x48, 0x90, 0xf8, 0xc8, 0x01, 0xc0, 0x07, 0x01, 0xd1, + 0x00, 0x25, 0x00, 0xe0, 0x0c, 0x25, 0x18, 0x48, 0x4f, 0xf6, 0x51, 0x41, + 0x2a, 0x46, 0x0b, 0x23, 0x04, 0x68, 0x0a, 0x20, 0xa0, 0x47, 0xd0, 0xb1, + 0x04, 0x46, 0xad, 0xb9, 0x13, 0x48, 0x07, 0xf5, 0x29, 0x71, 0x6f, 0x46, + 0x12, 0x4a, 0x08, 0x23, 0x05, 0x68, 0x38, 0x46, 0xa8, 0x47, 0x11, 0x48, + 0x11, 0x4a, 0x39, 0x46, 0x08, 0x23, 0x05, 0x68, 0x38, 0x46, 0xa8, 0x47, + 0xe0, 0x1d, 0x08, 0x21, 0x3a, 0x46, 0x08, 0x23, 0xef, 0xf7, 0xe6, 0xfd, + 0x20, 0x46, 0xf5, 0xf7, 0x15, 0xfc, 0x30, 0x68, 0x02, 0x99, 0x40, 0x1a, + 0x08, 0xbf, 0xfe, 0xbd, 0xf5, 0xf7, 0x1a, 0xfc, 0x38, 0xec, 0x01, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x50, 0xec, 0x01, 0x00, 0x2c, 0x9c, 0x08, 0x00, + 0x74, 0xc3, 0x08, 0x00, 0xbf, 0x82, 0x08, 0x10, 0x28, 0xc3, 0x08, 0x00, + 0x8c, 0x53, 0x01, 0x00, 0xc1, 0x78, 0x0b, 0x29, 0x18, 0xbf, 0x00, 0xf0, + 0x19, 0xb8, 0xff, 0xf7, 0xad, 0xbf, 0x00, 0xbf, 0x03, 0x48, 0x04, 0x49, + 0x01, 0x60, 0x04, 0x48, 0x04, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x84, 0xb4, 0x08, 0x00, 0x89, 0x14, 0x03, 0x00, 0x78, 0xb4, 0x08, 0x00, + 0xe5, 0x13, 0x03, 0x00, 0x4d, 0xf6, 0xfd, 0x3c, 0xc1, 0xf2, 0x05, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf2, 0xb5, 0x1c, 0xc1, 0xf2, 0x05, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x70, 0x47, 0x00, 0x00, 0x2d, 0xe9, 0xf0, 0x41, + 0x86, 0xb0, 0x0d, 0xf1, 0x04, 0x08, 0x0f, 0x46, 0x04, 0x46, 0x14, 0x21, + 0x1d, 0x46, 0x16, 0x46, 0x40, 0x46, 0xf1, 0xf7, 0x2d, 0xff, 0x7f, 0x48, + 0x00, 0x68, 0x01, 0x90, 0x79, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, + 0x02, 0x90, 0x0d, 0x98, 0x8d, 0xf8, 0x0c, 0x40, 0x00, 0x21, 0x42, 0x46, + 0x14, 0x23, 0x8d, 0xf8, 0x0e, 0x60, 0x8d, 0xf8, 0x0d, 0x70, 0xad, 0xf8, + 0x10, 0x50, 0x8d, 0xf8, 0x14, 0x00, 0x0c, 0x98, 0xad, 0xf8, 0x12, 0x00, + 0x70, 0x48, 0x00, 0x78, 0x8d, 0xf8, 0x0f, 0x00, 0x06, 0x48, 0x04, 0x68, + 0x40, 0xf2, 0x4c, 0x60, 0xa0, 0x47, 0x05, 0x48, 0x12, 0x21, 0x00, 0x78, + 0xef, 0xf7, 0x78, 0xfd, 0x06, 0xb0, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, + 0x78, 0x9b, 0x08, 0x00, 0x66, 0x34, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x85, 0xb0, 0x07, 0x46, 0x61, 0x48, 0x89, 0x46, 0x98, 0x46, 0x15, 0x46, + 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x04, 0x46, 0x5e, 0x48, 0x01, 0x68, + 0x01, 0x20, 0x88, 0x47, 0x5d, 0x49, 0x06, 0x46, 0x08, 0x78, 0xff, 0x28, + 0x12, 0xd1, 0x5c, 0x48, 0x02, 0x78, 0x0a, 0xb1, 0xff, 0x20, 0x0d, 0xe0, + 0x01, 0x22, 0x02, 0x70, 0x59, 0x48, 0x97, 0xf8, 0x1d, 0x21, 0x04, 0x60, + 0x58, 0x48, 0xc2, 0xeb, 0x02, 0x12, 0x00, 0x68, 0x00, 0xeb, 0x42, 0x10, + 0x40, 0x78, 0x08, 0x70, 0xdd, 0xb3, 0xdf, 0xf8, 0x50, 0xb1, 0x97, 0xf8, + 0x1d, 0x21, 0xdb, 0xf8, 0x00, 0x10, 0xc2, 0xeb, 0x02, 0x12, 0x01, 0xeb, + 0x42, 0x11, 0x49, 0x78, 0x88, 0x42, 0x30, 0xd1, 0x4c, 0x4a, 0xa0, 0x19, + 0x11, 0x68, 0x81, 0x42, 0x05, 0xd3, 0x00, 0x20, 0xa0, 0x21, 0x92, 0x46, + 0xef, 0xf7, 0x18, 0xfd, 0x52, 0x46, 0x5f, 0xea, 0x89, 0x70, 0x59, 0xbf, + 0x08, 0xf1, 0x04, 0x03, 0x07, 0xf5, 0xfe, 0x7a, 0x08, 0xf1, 0x0c, 0x03, + 0x07, 0xf5, 0x03, 0x7a, 0x10, 0x68, 0x68, 0xb3, 0xda, 0xf8, 0x00, 0x10, + 0xe1, 0xb3, 0x97, 0xf8, 0x1d, 0x11, 0xdb, 0xf8, 0x00, 0x00, 0x01, 0x24, + 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, 0x4f, 0xf6, 0xfc, 0x71, + 0x82, 0x78, 0xba, 0xf8, 0x08, 0x00, 0x0f, 0x30, 0x08, 0x40, 0xcd, 0xe9, + 0x00, 0x09, 0x01, 0x20, 0x0e, 0xe0, 0x02, 0x20, 0x00, 0xe0, 0x03, 0x20, + 0xeb, 0x49, 0x97, 0xf8, 0x1d, 0x21, 0x00, 0x24, 0x09, 0x68, 0xc2, 0xeb, + 0x02, 0x12, 0x01, 0xeb, 0x42, 0x11, 0x8a, 0x78, 0xcd, 0xe9, 0x00, 0x49, + 0x29, 0x46, 0x43, 0x46, 0xff, 0xf7, 0x4c, 0xff, 0x20, 0x46, 0x05, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0x97, 0xf8, 0x1d, 0x11, 0xdb, 0xf8, 0x00, 0x00, + 0x43, 0x46, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, 0x29, 0x46, + 0x82, 0x78, 0x00, 0x20, 0xcd, 0xe9, 0x00, 0x09, 0x04, 0x20, 0xff, 0xf7, + 0x37, 0xff, 0x37, 0xe0, 0x34, 0x44, 0x03, 0xf1, 0x0f, 0x0e, 0x4f, 0xf6, + 0xfc, 0x7c, 0x0e, 0xea, 0x0c, 0x01, 0x24, 0x1a, 0x94, 0xfb, 0xf1, 0xf4, + 0xa4, 0xb2, 0xac, 0x42, 0x01, 0xd2, 0x05, 0x20, 0xca, 0xe7, 0x69, 0x43, + 0x2e, 0xf0, 0x03, 0x04, 0x16, 0x46, 0x04, 0x91, 0x01, 0xea, 0x0c, 0x01, + 0x03, 0x94, 0x1c, 0x46, 0xf2, 0xf7, 0x0a, 0xfb, 0x30, 0x68, 0xa1, 0xb2, + 0x2a, 0x46, 0x02, 0x23, 0x00, 0x90, 0x50, 0x46, 0x21, 0xf0, 0xee, 0xf8, + 0x97, 0xf8, 0x1d, 0x11, 0xdb, 0xf8, 0x00, 0x00, 0x43, 0x46, 0xc1, 0xeb, + 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, 0x29, 0x46, 0x82, 0x78, 0x03, 0x98, + 0x80, 0xb2, 0xcd, 0xe9, 0x00, 0x09, 0x00, 0x20, 0xff, 0xf7, 0x02, 0xff, + 0x30, 0x68, 0x04, 0x99, 0x08, 0x44, 0x30, 0x60, 0x01, 0x24, 0xaf, 0xe7, + 0x94, 0xd4, 0x08, 0x00, 0x98, 0xd4, 0x08, 0x00, 0x41, 0xd3, 0x05, 0x00, + 0x74, 0xe5, 0x05, 0x00, 0xec, 0xe5, 0x05, 0x00, 0xe0, 0x35, 0x01, 0x00, + 0x10, 0xb5, 0x90, 0xf8, 0x50, 0x11, 0xe1, 0xb1, 0x90, 0xf8, 0x51, 0x41, + 0x90, 0xf8, 0x20, 0x31, 0x90, 0xf8, 0x1d, 0x21, 0x11, 0xfb, 0x04, 0xf1, + 0x13, 0xfb, 0x04, 0xf3, 0xc2, 0xeb, 0x02, 0x12, 0x01, 0xeb, 0x41, 0x01, + 0x8b, 0x42, 0x38, 0xbf, 0x19, 0x46, 0xab, 0x4b, 0x1b, 0x68, 0x03, 0xeb, + 0x42, 0x12, 0x01, 0x23, 0x92, 0xf8, 0x21, 0x20, 0x01, 0x2a, 0x08, 0xbf, + 0x03, 0x23, 0x19, 0x44, 0x00, 0xe0, 0x00, 0x21, 0xb0, 0xf8, 0x52, 0x31, + 0xca, 0xb2, 0x02, 0x21, 0xbd, 0xe8, 0x10, 0x40, 0xff, 0xf7, 0x02, 0xbf, + 0xb0, 0xb5, 0x03, 0x46, 0x44, 0x6b, 0x00, 0x20, 0x10, 0x60, 0x1d, 0x6b, + 0x0d, 0xb3, 0x58, 0x6b, 0x70, 0xb1, 0x90, 0xf8, 0x29, 0x50, 0xed, 0x07, + 0x0a, 0xd0, 0x9a, 0x4d, 0x93, 0xf8, 0x1d, 0x31, 0x2d, 0x68, 0xc3, 0xeb, + 0x03, 0x13, 0x05, 0xeb, 0x43, 0x13, 0x93, 0xf8, 0x21, 0x30, 0x0b, 0xb1, + 0x00, 0x20, 0xb0, 0xbd, 0xa3, 0x69, 0x33, 0xb1, 0x93, 0xf8, 0x2f, 0x40, + 0x8c, 0x42, 0x06, 0xd0, 0x53, 0xf8, 0x04, 0x3c, 0xf7, 0xe7, 0x00, 0x69, + 0x01, 0xf0, 0x80, 0xfb, 0x00, 0xe0, 0x13, 0x60, 0x01, 0x20, 0xb0, 0xbd, + 0x2d, 0xe9, 0xf0, 0x4f, 0x85, 0xb0, 0x82, 0x46, 0x90, 0xf8, 0x28, 0x00, + 0x00, 0x28, 0x40, 0xf0, 0xfa, 0x80, 0xdf, 0xf8, 0x1c, 0x92, 0x9a, 0xf8, + 0x1d, 0x01, 0xd9, 0xf8, 0x00, 0x10, 0xc0, 0xeb, 0x00, 0x12, 0x01, 0xeb, + 0x42, 0x10, 0xd0, 0xf8, 0xa0, 0x30, 0x5b, 0x7f, 0x23, 0xb1, 0x00, 0xf1, + 0x18, 0x06, 0x0a, 0xf5, 0x9b, 0x73, 0x03, 0xe0, 0x00, 0xf1, 0x14, 0x06, + 0x0a, 0xf5, 0x9a, 0x73, 0x9a, 0xf8, 0x46, 0x71, 0xb3, 0xf8, 0x00, 0x80, + 0x57, 0xb3, 0x03, 0x89, 0x40, 0xf2, 0xe2, 0x44, 0xc5, 0x68, 0x4f, 0xf0, + 0x02, 0x0b, 0x5c, 0x43, 0x65, 0x1b, 0xfb, 0x2d, 0x38, 0xbf, 0x4f, 0xf0, + 0x03, 0x0b, 0x90, 0xf8, 0x21, 0x50, 0x36, 0x68, 0x01, 0x2d, 0x06, 0xd1, + 0x34, 0x44, 0x01, 0x3c, 0xb4, 0xfb, 0xf6, 0xf4, 0x5c, 0x44, 0x04, 0xf1, + 0x01, 0x0b, 0x52, 0x01, 0x89, 0x5c, 0x01, 0xf0, 0xfe, 0x01, 0x02, 0x29, + 0x0e, 0xd1, 0x9a, 0xf8, 0x20, 0x11, 0x90, 0xf8, 0xe0, 0x20, 0x90, 0xf8, + 0xe1, 0x00, 0xb1, 0xfb, 0xf7, 0xf1, 0x89, 0x1a, 0x01, 0x22, 0x11, 0xfb, + 0x00, 0x27, 0x29, 0xe0, 0x00, 0x24, 0x32, 0xe0, 0x00, 0x20, 0xcd, 0xe9, + 0x03, 0x00, 0xda, 0xf8, 0x34, 0x00, 0x9a, 0xf8, 0x47, 0x71, 0xb0, 0xb1, + 0x50, 0xf8, 0x04, 0x2f, 0x03, 0xa9, 0x00, 0xf0, 0xc9, 0xf8, 0x00, 0xf0, + 0x05, 0x00, 0x05, 0x28, 0x0d, 0xd1, 0x9d, 0xf8, 0x13, 0x00, 0x01, 0x38, + 0x01, 0x28, 0x08, 0xd8, 0x9d, 0xf8, 0x11, 0x00, 0x02, 0x28, 0x04, 0xd1, + 0x9d, 0xf8, 0x10, 0x00, 0x06, 0x28, 0x08, 0xbf, 0x0c, 0x27, 0x9a, 0xf8, + 0x1d, 0x11, 0xd9, 0xf8, 0x00, 0x00, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, + 0x41, 0x10, 0x03, 0x89, 0x07, 0xfb, 0x03, 0xf0, 0x40, 0xf2, 0xe2, 0x41, + 0x00, 0xfb, 0x01, 0x60, 0x01, 0x38, 0xb0, 0xfb, 0xf6, 0xf0, 0x0b, 0xeb, + 0x00, 0x04, 0x04, 0x21, 0x9a, 0xf8, 0x44, 0x00, 0xdf, 0xf8, 0x20, 0x91, + 0xe6, 0xb2, 0x48, 0x4a, 0x01, 0xeb, 0x48, 0x01, 0x33, 0x46, 0xcd, 0xe9, + 0x00, 0x10, 0x48, 0x46, 0x48, 0x21, 0xf2, 0xf7, 0xd5, 0xfd, 0xa4, 0x48, + 0x00, 0xf5, 0x96, 0x7b, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, + 0x40, 0x48, 0x01, 0x21, 0x4a, 0x46, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, + 0x50, 0x46, 0x01, 0x21, 0x32, 0x46, 0x43, 0x46, 0xff, 0xf7, 0x30, 0xfe, + 0x02, 0x94, 0x58, 0xb3, 0x20, 0x06, 0x53, 0xd0, 0x0a, 0xf1, 0x18, 0x05, + 0x0a, 0xf5, 0xfe, 0x77, 0x4f, 0xf0, 0x00, 0x08, 0x38, 0x46, 0x01, 0x21, + 0xf3, 0xf7, 0xd6, 0xfc, 0x00, 0x28, 0x4e, 0xd0, 0x29, 0x46, 0x04, 0x46, + 0xf1, 0xf7, 0x5c, 0xfd, 0x9a, 0xf8, 0x44, 0x00, 0x30, 0x4a, 0x48, 0x21, + 0x23, 0x46, 0x00, 0x90, 0x48, 0x46, 0xf2, 0xf7, 0xa5, 0xfd, 0x9b, 0xf8, + 0x00, 0x00, 0x80, 0x07, 0x05, 0xd5, 0x2a, 0x48, 0x01, 0x21, 0x4a, 0x46, + 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x08, 0xf1, 0x01, 0x08, 0x5f, 0xfa, + 0x88, 0xf0, 0xb0, 0x42, 0xdc, 0xd1, 0x29, 0xe0, 0x20, 0x06, 0x27, 0xd0, + 0x08, 0xf1, 0x04, 0x07, 0x0a, 0xf1, 0x18, 0x05, 0x4f, 0xf0, 0x00, 0x08, + 0x23, 0x48, 0x01, 0x68, 0x38, 0x46, 0x88, 0x47, 0x18, 0xb3, 0x29, 0x46, + 0x04, 0x46, 0xf1, 0xf7, 0x31, 0xfd, 0x9a, 0xf8, 0x44, 0x00, 0x1b, 0x4a, + 0x48, 0x21, 0x23, 0x46, 0x00, 0x90, 0x48, 0x46, 0xf2, 0xf7, 0x7a, 0xfd, + 0x9b, 0xf8, 0x00, 0x00, 0x80, 0x07, 0x05, 0xd5, 0x14, 0x48, 0x01, 0x21, + 0x4a, 0x46, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x08, 0xf1, 0x01, 0x08, + 0x5f, 0xfa, 0x88, 0xf0, 0xb0, 0x42, 0xdd, 0xd1, 0x02, 0x98, 0x8a, 0xf8, + 0x28, 0x00, 0x01, 0x20, 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x0d, 0x48, + 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, 0x9b, 0xf8, 0x00, 0x00, 0x80, 0x07, + 0x05, 0xd5, 0x07, 0x48, 0x09, 0x4a, 0x01, 0x21, 0x03, 0x68, 0x02, 0x20, + 0x98, 0x47, 0x00, 0x20, 0xec, 0xe7, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, + 0x04, 0x86, 0x01, 0x00, 0x34, 0x22, 0x03, 0x00, 0x70, 0x9b, 0x08, 0x00, + 0x7e, 0x22, 0x03, 0x00, 0x2c, 0x9d, 0x08, 0x00, 0xc3, 0x22, 0x03, 0x00, + 0xd4, 0x9b, 0x08, 0x00, 0x70, 0xb5, 0x43, 0x79, 0x0b, 0x71, 0xc3, 0x88, + 0x0b, 0x80, 0x03, 0x89, 0x4b, 0x80, 0x1a, 0xb3, 0x03, 0x79, 0x0b, 0xb3, + 0x00, 0x24, 0x00, 0x20, 0x25, 0x46, 0x14, 0x5d, 0xec, 0xb1, 0x2c, 0x44, + 0x01, 0x34, 0xa4, 0xb2, 0x9c, 0x42, 0x18, 0xd8, 0x15, 0x44, 0x6e, 0x78, + 0x02, 0x2e, 0x07, 0xd0, 0x01, 0x2e, 0x0a, 0xd0, 0x6e, 0xb9, 0xad, 0x78, + 0x40, 0xf0, 0x01, 0x00, 0x4d, 0x71, 0x08, 0xe0, 0xad, 0x78, 0x40, 0xf0, + 0x04, 0x00, 0xcd, 0x71, 0x03, 0xe0, 0xad, 0x78, 0x40, 0xf0, 0x02, 0x00, + 0x8d, 0x71, 0x9c, 0x42, 0xe0, 0xd3, 0x00, 0xe0, 0x00, 0x20, 0xc0, 0xb2, + 0x70, 0xbd, 0x00, 0xbf, 0x2d, 0xe9, 0xf0, 0x43, 0x03, 0x68, 0x93, 0xf8, + 0x20, 0x51, 0x93, 0xf8, 0x46, 0x61, 0x93, 0x7f, 0x93, 0xb1, 0x92, 0xf8, + 0x20, 0x30, 0xdb, 0x07, 0x0e, 0xd0, 0xd3, 0x7f, 0x92, 0xf8, 0x21, 0x40, + 0xa3, 0x42, 0x09, 0xd0, 0x38, 0x4b, 0x1b, 0x68, 0x9b, 0x78, 0x2b, 0xb9, + 0x90, 0xf8, 0x3d, 0x30, 0xb3, 0x42, 0x04, 0xbf, 0x0a, 0x23, 0xd3, 0x70, + 0xdf, 0xf8, 0xd0, 0x90, 0x99, 0xf8, 0x80, 0x31, 0x9b, 0x07, 0x0a, 0xd4, + 0xd7, 0x78, 0x0a, 0x2f, 0x05, 0xd8, 0x01, 0x23, 0x03, 0xfa, 0x07, 0xf4, + 0x14, 0xf4, 0xe7, 0x6f, 0x02, 0xd1, 0x13, 0x7f, 0x1b, 0xb1, 0x01, 0x23, + 0x18, 0x46, 0xbd, 0xe8, 0xf0, 0x83, 0x07, 0x2f, 0x17, 0xd1, 0x07, 0x68, + 0x53, 0x4b, 0x97, 0xf8, 0x1d, 0xe1, 0xd3, 0xf8, 0x00, 0xc0, 0xce, 0xeb, + 0x0e, 0x18, 0x4f, 0xea, 0x48, 0x13, 0x1c, 0xf8, 0x03, 0x30, 0x01, 0x2b, + 0x14, 0xd8, 0x01, 0x23, 0xae, 0x42, 0xe9, 0xd1, 0x0c, 0xeb, 0x48, 0x14, + 0xd4, 0xf8, 0xa0, 0x40, 0x64, 0x7f, 0x5c, 0xb9, 0xe2, 0xe7, 0x7b, 0x1e, + 0x02, 0x2b, 0x01, 0xd2, 0x00, 0x23, 0xdd, 0xe7, 0x45, 0x4b, 0x07, 0x68, + 0xd3, 0xf8, 0x00, 0xc0, 0x97, 0xf8, 0x1d, 0xe1, 0x90, 0xf8, 0x3d, 0x40, + 0xb9, 0xf8, 0x82, 0x31, 0xc0, 0x6d, 0x99, 0xf8, 0x81, 0x61, 0x97, 0xf8, + 0x47, 0x51, 0x00, 0xfb, 0x04, 0x33, 0xce, 0xeb, 0x0e, 0x14, 0x00, 0x2e, + 0x0c, 0xeb, 0x44, 0x14, 0x24, 0x89, 0x08, 0xbf, 0x01, 0x26, 0xae, 0x42, + 0x88, 0xbf, 0x2e, 0x46, 0x75, 0x1e, 0x6c, 0x43, 0x40, 0xf2, 0xe2, 0x45, + 0x04, 0xfb, 0x05, 0x33, 0x7c, 0x6b, 0x24, 0x78, 0x03, 0xf2, 0x53, 0x73, + 0x1c, 0xb9, 0x08, 0x4c, 0xa4, 0x7f, 0x00, 0xfb, 0x04, 0x33, 0x88, 0x68, + 0x11, 0x69, 0x09, 0x1a, 0x00, 0x20, 0x99, 0x42, 0x88, 0xbf, 0x01, 0x20, + 0xbd, 0xe8, 0xf0, 0x83, 0xd4, 0x35, 0x01, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0x50, 0x32, 0x06, 0x00, 0x10, 0xb5, 0x28, 0x4b, 0x90, 0xf8, 0x1d, 0x41, + 0x1b, 0x68, 0xc4, 0xeb, 0x04, 0x14, 0x03, 0xeb, 0x44, 0x13, 0x93, 0xf8, + 0x21, 0x30, 0x3b, 0xb9, 0x32, 0xb9, 0x43, 0x6b, 0x93, 0xf8, 0x2a, 0x40, + 0x44, 0xf0, 0x04, 0x04, 0x83, 0xf8, 0x2a, 0x40, 0xbd, 0xe8, 0x10, 0x40, + 0x00, 0xf0, 0x22, 0xbb, 0x08, 0xb1, 0x01, 0x68, 0x09, 0xb1, 0x00, 0xf0, + 0x23, 0xbb, 0xf5, 0xf7, 0xaf, 0xb8, 0x02, 0x68, 0x0a, 0xb1, 0x00, 0xf0, + 0x23, 0xbb, 0x70, 0x47, 0x41, 0x6b, 0x09, 0xb1, 0x00, 0xf0, 0x24, 0xbb, + 0x70, 0x47, 0x00, 0xbf, 0xfe, 0xb5, 0x11, 0x4c, 0xa2, 0x42, 0x06, 0xd0, + 0xdd, 0xe9, 0x08, 0x54, 0xcd, 0xe9, 0x00, 0x54, 0x00, 0xf0, 0x1e, 0xfb, + 0xfe, 0xbd, 0x0d, 0x4c, 0x94, 0xf8, 0xc3, 0xc1, 0xbc, 0xf1, 0x00, 0x0f, + 0xf2, 0xd0, 0x0b, 0x4e, 0x90, 0xf8, 0x1d, 0x51, 0x00, 0x27, 0x36, 0x68, + 0x06, 0xf5, 0xec, 0x76, 0xaf, 0x42, 0x01, 0xd0, 0x34, 0x68, 0x2c, 0xb9, + 0x01, 0x37, 0x06, 0xf5, 0xf0, 0x76, 0x67, 0x45, 0xf6, 0xd3, 0xe1, 0xe7, + 0x00, 0x20, 0xfe, 0xbd, 0x18, 0x0d, 0x01, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0xe0, 0x35, 0x01, 0x00, 0xb0, 0xb5, 0x14, 0x46, 0x05, 0x46, 0x00, 0xf0, + 0xff, 0xfa, 0x21, 0x68, 0xc5, 0xf8, 0x30, 0x12, 0x21, 0x68, 0x31, 0xb1, + 0x89, 0x6a, 0x21, 0xb1, 0x0a, 0x7d, 0x06, 0x2a, 0x04, 0xbf, 0x00, 0x22, + 0x0a, 0x75, 0xb0, 0xbd, 0x42, 0xb1, 0xd0, 0xb1, 0xd0, 0xf8, 0x20, 0x22, + 0xba, 0xb1, 0x90, 0xf8, 0x2b, 0x02, 0x02, 0xf8, 0x10, 0x10, 0x12, 0xe0, + 0x40, 0x6b, 0x00, 0x69, 0x40, 0x69, 0x70, 0xb1, 0x02, 0x7e, 0x52, 0x1a, + 0x52, 0xb2, 0x00, 0x2a, 0x04, 0xd4, 0x82, 0x7d, 0x8a, 0x1a, 0x52, 0xb2, + 0x00, 0x2a, 0x02, 0xd5, 0x50, 0xf8, 0x04, 0x0c, 0xf1, 0xe7, 0x09, 0x21, + 0x01, 0x75, 0x00, 0x20, 0x70, 0x47, 0x00, 0xbf, 0xf0, 0xb5, 0x35, 0x4a, + 0x11, 0x78, 0xc1, 0xeb, 0x41, 0x13, 0x34, 0x49, 0x01, 0xeb, 0xc3, 0x03, + 0xb3, 0xf8, 0xdc, 0x40, 0x65, 0x06, 0x03, 0xd4, 0xe5, 0x07, 0x46, 0xd1, + 0x30, 0x24, 0x00, 0xe0, 0x20, 0x24, 0xd0, 0xf8, 0x24, 0x52, 0x00, 0x2d, + 0x3e, 0xd0, 0x00, 0xf5, 0x08, 0x70, 0x93, 0xf8, 0x72, 0x30, 0x0c, 0x27, + 0x86, 0x7a, 0xb3, 0x42, 0x08, 0xbf, 0x0b, 0x27, 0xc3, 0x5d, 0x05, 0xeb, + 0x43, 0x05, 0x6e, 0x78, 0x06, 0xf0, 0x0f, 0x06, 0x34, 0x43, 0x6c, 0x70, + 0x14, 0x78, 0x45, 0x68, 0xc4, 0xeb, 0x44, 0x14, 0x01, 0xeb, 0xc4, 0x04, + 0x94, 0xf8, 0xa0, 0x40, 0x05, 0xf8, 0x13, 0x40, 0x14, 0x78, 0xc4, 0xeb, + 0x44, 0x16, 0x01, 0xeb, 0xc6, 0x06, 0xb6, 0xf8, 0xdc, 0x60, 0x77, 0x06, + 0x0c, 0xd4, 0x06, 0xf0, 0x49, 0x07, 0x09, 0x2f, 0x08, 0xd1, 0x76, 0x05, + 0x06, 0xd4, 0x05, 0xeb, 0x43, 0x04, 0x65, 0x78, 0x45, 0xf0, 0x01, 0x05, + 0x65, 0x70, 0x14, 0x78, 0xc4, 0xeb, 0x44, 0x12, 0x01, 0xeb, 0xc2, 0x01, + 0x91, 0xf8, 0x9c, 0x10, 0x31, 0xb1, 0x40, 0x68, 0x00, 0xeb, 0x43, 0x00, + 0x41, 0x78, 0x41, 0xf0, 0x02, 0x01, 0x41, 0x70, 0xf0, 0xbd, 0x04, 0xf0, + 0x49, 0x05, 0x09, 0x2d, 0x04, 0xd1, 0x93, 0xf8, 0x9d, 0x50, 0x1d, 0xb1, + 0x50, 0x24, 0xb2, 0xe7, 0x40, 0x24, 0xb0, 0xe7, 0xb3, 0xf8, 0xde, 0x50, + 0x35, 0xb1, 0x65, 0xb2, 0x6f, 0xf0, 0x7f, 0x04, 0x00, 0x2d, 0x48, 0xbf, + 0x70, 0x24, 0xa6, 0xe7, 0x60, 0x24, 0xa4, 0xe7, 0x74, 0x87, 0x08, 0x00, + 0x0c, 0x6f, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x85, 0xb0, 0x89, 0x46, + 0x00, 0xf5, 0x08, 0x71, 0x83, 0x46, 0x88, 0x46, 0x7b, 0xb1, 0x40, 0x46, + 0x00, 0x2a, 0x4f, 0xf0, 0x20, 0x07, 0x08, 0xc8, 0x08, 0xbf, 0x01, 0x46, + 0x0e, 0x68, 0x5b, 0xb1, 0x98, 0xf8, 0x0d, 0x10, 0x01, 0x24, 0x03, 0x93, + 0x07, 0xeb, 0x41, 0x07, 0x05, 0xe0, 0x00, 0x24, 0x20, 0x27, 0x4f, 0xf0, + 0x00, 0x0a, 0x0e, 0xe0, 0x00, 0x24, 0x00, 0x68, 0x50, 0xb1, 0x03, 0xa9, + 0x04, 0xf1, 0x01, 0x0a, 0x41, 0xf8, 0x24, 0x00, 0x98, 0xf8, 0x0d, 0x00, + 0x02, 0x34, 0x07, 0xeb, 0x40, 0x07, 0x00, 0xe0, 0xa2, 0x46, 0x70, 0x48, + 0x01, 0x68, 0x38, 0x46, 0x88, 0x47, 0x05, 0x46, 0x00, 0x28, 0x00, 0xf0, + 0xd0, 0x80, 0x9b, 0xf8, 0x44, 0x00, 0x01, 0x95, 0x28, 0x70, 0xa0, 0x4d, + 0x9b, 0xf8, 0x1d, 0x11, 0x28, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x49, 0x01, + 0x40, 0x5c, 0x01, 0x99, 0x48, 0x70, 0x01, 0x99, 0x9b, 0xf8, 0x20, 0x01, + 0xc8, 0x70, 0x64, 0x48, 0x00, 0x68, 0x01, 0x99, 0xc8, 0x60, 0x63, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x01, 0x99, 0x9b, 0xf8, 0x1d, 0x21, 0xba, 0xf1, + 0x00, 0x0f, 0x08, 0x61, 0x29, 0x68, 0xc2, 0xeb, 0x02, 0x12, 0x01, 0x9d, + 0x01, 0xeb, 0x42, 0x11, 0xbb, 0xf8, 0x74, 0x21, 0xd1, 0xf8, 0xb8, 0x10, + 0xec, 0x76, 0xa1, 0xeb, 0x00, 0x00, 0xc0, 0xf3, 0xc0, 0x60, 0x10, 0x44, + 0xa0, 0xf1, 0x01, 0x00, 0xa8, 0x82, 0x78, 0xd0, 0x55, 0x4c, 0x72, 0xb6, + 0x20, 0x68, 0x40, 0x00, 0x01, 0x30, 0x20, 0x60, 0xb8, 0xf8, 0x08, 0x00, + 0x98, 0xf8, 0x0a, 0x10, 0xa9, 0x76, 0x28, 0x83, 0x20, 0x68, 0x40, 0x08, + 0x20, 0x60, 0x98, 0xf8, 0x0b, 0x00, 0x21, 0x68, 0x81, 0xf3, 0x10, 0x88, + 0xa9, 0x7e, 0x01, 0x39, 0xa9, 0x76, 0xcb, 0xb2, 0x9b, 0xf8, 0x20, 0x21, + 0x93, 0x42, 0x04, 0xd3, 0x51, 0x1e, 0x2a, 0x8b, 0xa9, 0x76, 0x01, 0x3a, + 0x2a, 0x83, 0x01, 0x38, 0x98, 0xf8, 0x0d, 0x30, 0xc2, 0xb2, 0x9a, 0x42, + 0x28, 0xbf, 0x58, 0x1e, 0x86, 0xb1, 0xc2, 0xb2, 0x06, 0xeb, 0x42, 0x03, + 0x5b, 0x78, 0x10, 0x2b, 0x0a, 0xd3, 0x98, 0xf8, 0x0b, 0x30, 0x9a, 0x42, + 0x06, 0xd0, 0x16, 0xf8, 0x12, 0x20, 0xeb, 0x7d, 0x9a, 0x1a, 0x52, 0xb2, + 0x00, 0x2a, 0xda, 0xd4, 0xcd, 0xf8, 0x00, 0x90, 0x72, 0xb6, 0x21, 0x68, + 0x49, 0x00, 0x01, 0x31, 0x21, 0x60, 0x98, 0xf8, 0x0b, 0x20, 0x98, 0xf8, + 0x0d, 0x10, 0x01, 0x32, 0xb2, 0xfb, 0xf1, 0xf3, 0x03, 0xfb, 0x11, 0x29, + 0xc2, 0xb2, 0x91, 0x45, 0x2d, 0xd9, 0x50, 0x1c, 0x00, 0x24, 0x00, 0x27, + 0xcd, 0xf8, 0x08, 0x80, 0x01, 0x44, 0x46, 0x00, 0xa1, 0xeb, 0x09, 0x01, + 0x29, 0x77, 0x20, 0x35, 0x0d, 0xf1, 0x0c, 0x0b, 0x15, 0xfa, 0x87, 0xf0, + 0x5b, 0xf8, 0x24, 0x10, 0x01, 0xeb, 0x49, 0x02, 0x02, 0x99, 0x49, 0x7b, + 0xa1, 0xeb, 0x09, 0x08, 0x4f, 0xea, 0x48, 0x01, 0x89, 0xb2, 0x0b, 0x46, + 0xef, 0xf7, 0x98, 0xf8, 0x07, 0xeb, 0x48, 0x07, 0x5b, 0xf8, 0x24, 0x20, + 0x31, 0x46, 0x33, 0x46, 0x15, 0xfa, 0x87, 0xf0, 0xef, 0xf7, 0x8e, 0xf8, + 0x01, 0x34, 0x37, 0x44, 0x54, 0x45, 0xdf, 0xd3, 0x1a, 0xe0, 0x00, 0x27, + 0x21, 0xe0, 0xa0, 0xeb, 0x09, 0x00, 0x05, 0xf1, 0x20, 0x04, 0x00, 0x27, + 0x0d, 0xf1, 0x0c, 0x08, 0x01, 0x30, 0x28, 0x77, 0xc0, 0xb2, 0x00, 0x25, + 0x46, 0x00, 0x58, 0xf8, 0x25, 0x10, 0xe0, 0x19, 0x33, 0x46, 0x01, 0xeb, + 0x49, 0x02, 0x31, 0x46, 0xef, 0xf7, 0x72, 0xf8, 0x01, 0x35, 0x37, 0x44, + 0x55, 0x45, 0xf2, 0xd3, 0x0b, 0x49, 0x08, 0x68, 0x40, 0x08, 0x08, 0x60, + 0x08, 0x68, 0x80, 0xf3, 0x10, 0x88, 0xdd, 0xe9, 0x00, 0x95, 0x07, 0xf1, + 0x20, 0x00, 0xc9, 0xf8, 0x00, 0x50, 0x80, 0xb2, 0x05, 0xb0, 0xbd, 0xe8, + 0xf0, 0x8f, 0x00, 0xbf, 0x4c, 0x9c, 0x08, 0x00, 0x24, 0x20, 0x00, 0x40, + 0xe0, 0xa0, 0x08, 0x00, 0x24, 0x36, 0x01, 0x00, 0xbc, 0xb5, 0x00, 0x68, + 0x0c, 0x46, 0x00, 0x21, 0x01, 0x91, 0x2f, 0x49, 0x90, 0xf8, 0x1d, 0x21, + 0x09, 0x68, 0xc2, 0xeb, 0x02, 0x12, 0x52, 0x01, 0x89, 0x5c, 0x01, 0xf0, + 0xfe, 0x01, 0x02, 0x29, 0x21, 0xd0, 0x21, 0x7d, 0x06, 0x29, 0x1e, 0xd0, + 0x01, 0xa9, 0x01, 0x22, 0x01, 0x23, 0xff, 0xf7, 0xd1, 0xfe, 0x01, 0x9d, + 0xbd, 0xb1, 0x21, 0x7d, 0x00, 0x22, 0x2b, 0x46, 0xa9, 0x70, 0x61, 0x88, + 0xa9, 0x80, 0x21, 0x88, 0xe9, 0x80, 0xa1, 0x7d, 0xa9, 0x75, 0x21, 0x7e, + 0xe9, 0x75, 0xa1, 0x68, 0xa9, 0x60, 0x1e, 0x49, 0x00, 0x90, 0x40, 0xf2, + 0x33, 0x60, 0x0c, 0x68, 0x01, 0x21, 0xa0, 0x47, 0x28, 0x46, 0xf4, 0xf7, + 0x8f, 0xfe, 0xbc, 0xbd, 0x7c, 0xb5, 0x00, 0x68, 0x0c, 0x46, 0x00, 0x21, + 0x01, 0x91, 0x15, 0x49, 0x90, 0xf8, 0x1d, 0x21, 0x09, 0x68, 0xc2, 0xeb, + 0x02, 0x12, 0x52, 0x01, 0x89, 0x5c, 0x01, 0xf0, 0xfe, 0x01, 0x02, 0x29, + 0x1d, 0xd0, 0x1d, 0x46, 0xdb, 0xb1, 0x01, 0xa9, 0x00, 0x22, 0x01, 0x23, + 0xff, 0xf7, 0x9e, 0xfe, 0x01, 0x9e, 0xa6, 0xb1, 0xb5, 0x70, 0x00, 0x22, + 0x33, 0x46, 0xa1, 0x88, 0xb1, 0x80, 0x21, 0x88, 0xf1, 0x80, 0xa1, 0x7e, + 0xb1, 0x75, 0x21, 0x7f, 0xf1, 0x75, 0x06, 0x49, 0x00, 0x90, 0x40, 0xf2, + 0x34, 0x60, 0x0c, 0x68, 0x01, 0x21, 0xa0, 0x47, 0x30, 0x46, 0xf4, 0xf7, + 0x5f, 0xfe, 0x7c, 0xbd, 0xe0, 0x35, 0x01, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0x2d, 0xe9, 0xf8, 0x43, 0x81, 0x46, 0x90, 0xf8, 0x26, 0x70, 0x17, 0x48, + 0x00, 0x78, 0x28, 0xb9, 0x16, 0x48, 0x17, 0x49, 0x00, 0x88, 0x40, 0xf0, + 0xe6, 0x00, 0x08, 0x60, 0x4d, 0x46, 0x55, 0xf8, 0x18, 0x6f, 0xa8, 0x7c, + 0x40, 0xf0, 0x02, 0x00, 0xa8, 0x74, 0xde, 0xb1, 0xdf, 0xf8, 0x44, 0x80, + 0x96, 0xf8, 0x2f, 0x00, 0x56, 0xf8, 0x04, 0x4c, 0x38, 0x1a, 0x40, 0xb2, + 0x00, 0x28, 0x0e, 0xd4, 0xd9, 0xf8, 0x14, 0x00, 0x32, 0x46, 0x01, 0x6b, + 0x0b, 0x6a, 0x01, 0x21, 0x98, 0x47, 0xd8, 0xf8, 0x00, 0x20, 0x28, 0x46, + 0x31, 0x46, 0x90, 0x47, 0x30, 0x46, 0xf4, 0xf7, 0x2b, 0xfe, 0x00, 0x2c, + 0x26, 0x46, 0xe5, 0xd1, 0xbd, 0xe8, 0xf8, 0x83, 0x6f, 0x34, 0x01, 0x00, + 0x26, 0x21, 0x01, 0x00, 0x04, 0x08, 0x00, 0x40, 0xe8, 0xa0, 0x08, 0x00, + 0x80, 0xb5, 0xca, 0x07, 0x1c, 0xbf, 0x00, 0x22, 0xc0, 0xf8, 0x30, 0x22, + 0x00, 0xf0, 0xa6, 0xf8, 0x80, 0xbd, 0x28, 0xb1, 0x90, 0xf8, 0x7c, 0x21, + 0x02, 0x2a, 0x1c, 0xbf, 0x00, 0x20, 0x70, 0x47, 0x00, 0xf0, 0xa2, 0xb8, + 0x41, 0x1e, 0x12, 0x20, 0x09, 0x29, 0x38, 0xbf, 0x00, 0x20, 0x70, 0x47, + 0x18, 0x48, 0x19, 0x49, 0x01, 0x60, 0x19, 0x48, 0x19, 0x49, 0x01, 0x60, + 0x19, 0x48, 0x1a, 0x49, 0x01, 0x60, 0x1a, 0x48, 0x1a, 0x49, 0x01, 0x60, + 0x1a, 0x48, 0x1b, 0x49, 0x01, 0x60, 0x1b, 0x48, 0x1b, 0x49, 0x01, 0x60, + 0x1b, 0x48, 0x1c, 0x49, 0x01, 0x60, 0x1c, 0x48, 0x1c, 0x49, 0x01, 0x60, + 0x1c, 0x48, 0x1d, 0x49, 0x01, 0x60, 0x1d, 0x48, 0x1d, 0x49, 0x01, 0x60, + 0x1d, 0x48, 0x1e, 0x49, 0x01, 0x60, 0x1e, 0x48, 0x1e, 0x49, 0x01, 0x60, + 0x1e, 0x48, 0x1f, 0x49, 0x01, 0x60, 0x1f, 0x48, 0x1f, 0x49, 0x01, 0x60, + 0x1f, 0x48, 0x20, 0x49, 0x01, 0x60, 0x20, 0x48, 0x20, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x00, 0xb7, 0x08, 0x00, 0x4d, 0x1a, 0x03, 0x00, + 0x5c, 0xb5, 0x08, 0x00, 0x9d, 0x17, 0x03, 0x00, 0x2c, 0xb7, 0x08, 0x00, + 0x61, 0x1b, 0x03, 0x00, 0xc0, 0xb4, 0x08, 0x00, 0x91, 0x1b, 0x03, 0x00, + 0xec, 0xb5, 0x08, 0x00, 0x9f, 0x1b, 0x03, 0x00, 0xf8, 0xb8, 0x08, 0x00, + 0xa9, 0x1b, 0x03, 0x00, 0x18, 0xb9, 0x08, 0x00, 0xb5, 0x1b, 0x03, 0x00, + 0x38, 0xb8, 0x08, 0x00, 0x09, 0x1c, 0x03, 0x00, 0x0c, 0xb7, 0x08, 0x00, + 0x2d, 0x1c, 0x03, 0x00, 0x20, 0xb7, 0x08, 0x00, 0x6d, 0x1c, 0x03, 0x00, + 0x1c, 0xb7, 0x08, 0x00, 0x79, 0x1f, 0x03, 0x00, 0x08, 0xb7, 0x08, 0x00, + 0xe1, 0x1f, 0x03, 0x00, 0xd0, 0xb8, 0x08, 0x00, 0x49, 0x20, 0x03, 0x00, + 0x30, 0xb7, 0x08, 0x00, 0xc1, 0x20, 0x03, 0x00, 0x3c, 0xb7, 0x08, 0x00, + 0xd3, 0x20, 0x03, 0x00, 0x98, 0xb3, 0x08, 0x00, 0xe5, 0x20, 0x03, 0x00, + 0x43, 0xf2, 0xe5, 0x0c, 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4f, 0xf6, 0x71, 0x2c, 0xc1, 0xf2, 0x05, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x41, 0xf6, 0x85, 0x1c, 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x43, 0xf2, 0x25, 0x1c, 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x42, 0xf6, 0x5d, 0x1c, 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x43, 0xf2, 0xa1, 0x3c, 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x43, 0xf2, 0x01, 0x2c, 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x43, 0xf6, 0xd9, 0x6c, 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4c, 0x45, 0x5f, 0x49, 0x53, 0x4f, 0x5f, 0x70, 0x72, 0x65, 0x70, 0x61, + 0x72, 0x65, 0x53, 0x64, 0x75, 0x42, 0x75, 0x66, 0x51, 0x2e, 0x20, 0x42, + 0x75, 0x66, 0x51, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x25, 0x64, + 0x20, 0x6c, 0x65, 0x6e, 0x3a, 0x20, 0x25, 0x64, 0x20, 0x66, 0x6f, 0x72, + 0x20, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x20, 0x68, 0x63, 0x69, 0x43, + 0x6f, 0x6e, 0x6e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x3a, 0x20, 0x25, + 0x64, 0x00, 0x4c, 0x45, 0x5f, 0x49, 0x53, 0x4f, 0x5f, 0x70, 0x72, 0x65, + 0x70, 0x61, 0x72, 0x65, 0x53, 0x64, 0x75, 0x42, 0x75, 0x66, 0x51, 0x2e, + 0x20, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x20, 0x70, 0x46, + 0x4d, 0x42, 0x20, 0x30, 0x78, 0x25, 0x30, 0x38, 0x78, 0x20, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x20, 0x68, 0x63, 0x69, 0x43, 0x6f, 0x6e, 0x6e, + 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x3a, 0x20, 0x25, 0x64, 0x00, 0x4c, + 0x45, 0x5f, 0x49, 0x53, 0x4f, 0x5f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, + 0x65, 0x53, 0x64, 0x75, 0x42, 0x75, 0x66, 0x51, 0x2e, 0x20, 0x46, 0x61, + 0x69, 0x6c, 0x65, 0x64, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x20, 0x6d, + 0x65, 0x6d, 0x2e, 0x20, 0x46, 0x72, 0x65, 0x65, 0x69, 0x6e, 0x67, 0x20, + 0x71, 0x75, 0x65, 0x75, 0x65, 0x00, 0x00, 0x00, 0x7c, 0xb5, 0x23, 0x4b, + 0x0c, 0x46, 0x00, 0xeb, 0x40, 0x01, 0x00, 0x25, 0x53, 0xf8, 0x21, 0x10, + 0x82, 0x4b, 0x13, 0xf8, 0x15, 0x60, 0x86, 0x42, 0x10, 0xd0, 0x00, 0x2d, + 0x4f, 0xf0, 0x01, 0x05, 0xf7, 0xd0, 0x00, 0x25, 0x13, 0xf8, 0x15, 0x60, + 0x36, 0xb1, 0x00, 0x2d, 0x4f, 0xf0, 0x01, 0x05, 0xf8, 0xd0, 0x18, 0x48, + 0x02, 0x78, 0x14, 0xe0, 0x03, 0xf8, 0x15, 0x00, 0x64, 0x20, 0xb2, 0xfb, + 0xf0, 0xf6, 0x06, 0xfb, 0x10, 0x26, 0x03, 0xeb, 0x45, 0x02, 0x12, 0xf8, + 0x01, 0x0f, 0x2e, 0xb9, 0x43, 0x1c, 0xd8, 0xb2, 0x08, 0x38, 0x18, 0xbf, + 0x18, 0x46, 0x10, 0x70, 0x0d, 0x4a, 0xc0, 0xb2, 0x12, 0x5c, 0xd1, 0xf8, + 0x00, 0x01, 0x01, 0xa9, 0x0d, 0xf1, 0x07, 0x03, 0xd0, 0xf8, 0xd4, 0x00, + 0x40, 0x7f, 0x00, 0x91, 0xb0, 0xfa, 0x80, 0xf0, 0x41, 0x09, 0x20, 0x46, + 0x09, 0xf0, 0x04, 0xf8, 0x9d, 0xf8, 0x07, 0x00, 0xbd, 0xf8, 0x04, 0x10, + 0x48, 0x43, 0x80, 0xb2, 0x7c, 0xbd, 0x00, 0xbf, 0xe8, 0x72, 0x01, 0x00, + 0x42, 0xd3, 0x05, 0x00, 0xf8, 0xb5, 0x04, 0x46, 0xc0, 0x8d, 0x62, 0x8e, + 0x43, 0x1c, 0x20, 0x68, 0xe3, 0x85, 0xd0, 0xf8, 0x3c, 0x11, 0x49, 0xb1, + 0x91, 0xf8, 0x21, 0x50, 0x35, 0xb1, 0x90, 0xf8, 0x44, 0x00, 0x02, 0x31, + 0x9a, 0xb2, 0xff, 0xf7, 0xa1, 0xff, 0x09, 0xe0, 0x94, 0xf8, 0x74, 0x00, + 0xc0, 0x07, 0x06, 0xd0, 0x47, 0x49, 0x94, 0xf8, 0x75, 0x00, 0x0b, 0x68, + 0x11, 0x46, 0x98, 0x47, 0x02, 0x46, 0x45, 0x48, 0x01, 0x21, 0x00, 0x23, + 0x05, 0x68, 0x20, 0x46, 0xa8, 0x47, 0x00, 0x28, 0x7e, 0xd0, 0x01, 0x88, + 0x0c, 0x29, 0x5e, 0xd3, 0xc1, 0x68, 0x22, 0x7c, 0x0a, 0x70, 0x00, 0x22, + 0xc1, 0x68, 0x4a, 0x70, 0xd0, 0xe9, 0x02, 0x12, 0x09, 0x0a, 0x91, 0x70, + 0xd0, 0xe9, 0x02, 0x12, 0xd1, 0x70, 0x53, 0x22, 0xc1, 0x68, 0x0a, 0x71, + 0x44, 0x22, 0xc1, 0x68, 0x4a, 0x71, 0x55, 0x22, 0xc1, 0x68, 0x8a, 0x71, + 0x41, 0x88, 0xc1, 0xf3, 0x03, 0x11, 0x0a, 0x29, 0x34, 0xbf, 0x30, 0x31, + 0x37, 0x31, 0xc2, 0x68, 0xd1, 0x71, 0x41, 0x88, 0x01, 0xf0, 0x0f, 0x01, + 0x0a, 0x29, 0x34, 0xbf, 0x30, 0x31, 0x37, 0x31, 0xc2, 0x68, 0x11, 0x72, + 0x01, 0x88, 0x0d, 0x29, 0x23, 0xd3, 0x2b, 0x4b, 0x09, 0x21, 0x00, 0x22, + 0xc5, 0x68, 0x86, 0x78, 0x6e, 0x54, 0x27, 0x68, 0x1e, 0x68, 0xc5, 0x68, + 0x97, 0xf8, 0x1d, 0x71, 0x0d, 0x44, 0xc7, 0xeb, 0x07, 0x17, 0x06, 0xeb, + 0x47, 0x16, 0xd6, 0xf8, 0xa0, 0x60, 0x76, 0x7f, 0x00, 0x2e, 0x4f, 0xf0, + 0x53, 0x06, 0x08, 0xbf, 0x4d, 0x26, 0x6e, 0x70, 0xc5, 0x68, 0x0d, 0x44, + 0x03, 0x31, 0xaa, 0x70, 0x89, 0xb2, 0x01, 0x32, 0x05, 0x88, 0x03, 0x3d, + 0xa9, 0x42, 0xdf, 0xdb, 0x00, 0xe0, 0xcd, 0x1e, 0xc1, 0x68, 0x45, 0x22, + 0x4a, 0x55, 0xc1, 0x68, 0x02, 0x88, 0x11, 0x44, 0x4e, 0x22, 0x01, 0xf8, + 0x02, 0x2c, 0xc1, 0x68, 0x02, 0x88, 0x11, 0x44, 0x44, 0x22, 0x01, 0xf8, + 0x01, 0x2c, 0x94, 0xf8, 0x74, 0x10, 0xc9, 0x07, 0x18, 0xd0, 0x22, 0x68, + 0x0e, 0x49, 0x92, 0xf8, 0x1d, 0x21, 0x09, 0x68, 0xc2, 0xeb, 0x02, 0x12, + 0x01, 0xeb, 0x42, 0x11, 0x91, 0xf8, 0x21, 0x10, 0x01, 0x29, 0x0b, 0xd1, + 0x01, 0x88, 0x04, 0x29, 0x08, 0xd3, 0x81, 0x78, 0xc2, 0x68, 0x11, 0x70, + 0xc1, 0x78, 0x51, 0x70, 0x01, 0x79, 0x91, 0x70, 0x41, 0x79, 0xd1, 0x70, + 0xf8, 0xbd, 0x00, 0xbf, 0x04, 0xb7, 0x08, 0x00, 0xd8, 0xb4, 0x08, 0x00, + 0xe0, 0x35, 0x01, 0x00, 0xb0, 0xb5, 0x09, 0x49, 0x00, 0x22, 0x0a, 0x60, + 0x49, 0x68, 0x88, 0x47, 0x04, 0x46, 0x40, 0xb9, 0x06, 0x4d, 0x07, 0x49, + 0x08, 0x20, 0x2a, 0x68, 0x90, 0x47, 0x2a, 0x68, 0x05, 0x49, 0x09, 0x20, + 0x90, 0x47, 0x20, 0x46, 0xb0, 0xbd, 0x00, 0xbf, 0xf4, 0xe5, 0x05, 0x00, + 0xac, 0x9c, 0x08, 0x00, 0x29, 0x25, 0x03, 0x00, 0x9d, 0x25, 0x03, 0x00, + 0x10, 0xb5, 0x1a, 0x4c, 0xd4, 0xf8, 0x30, 0x01, 0x40, 0x06, 0x11, 0xd5, + 0x36, 0x48, 0x41, 0x7d, 0x39, 0xb1, 0x40, 0x21, 0xc4, 0xf8, 0x9c, 0x10, + 0x00, 0x21, 0x21, 0x60, 0x01, 0x68, 0x00, 0x20, 0x17, 0xe0, 0x13, 0x48, + 0x01, 0x88, 0x01, 0x31, 0x01, 0x80, 0x00, 0x20, 0x00, 0xf0, 0x3a, 0xf9, + 0xd4, 0xf8, 0x30, 0x01, 0x40, 0x05, 0x58, 0xbf, 0x10, 0xbd, 0x2b, 0x48, + 0x90, 0xf8, 0x2d, 0x10, 0x51, 0xb1, 0x4f, 0xf4, 0x80, 0x61, 0xc4, 0xf8, + 0x9c, 0x10, 0x00, 0x21, 0x21, 0x64, 0x81, 0x69, 0x01, 0x20, 0xbd, 0xe8, + 0x10, 0x40, 0x09, 0xe1, 0x05, 0x48, 0x01, 0x8c, 0x01, 0x31, 0x01, 0x84, + 0x01, 0x20, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x1d, 0xb9, 0x00, 0xbf, + 0xa4, 0x21, 0x00, 0x40, 0xf4, 0x4d, 0x01, 0x00, 0x10, 0xb5, 0x1b, 0x4c, + 0xd4, 0xf8, 0x30, 0x01, 0x40, 0xb2, 0xb0, 0xf1, 0xff, 0x3f, 0x11, 0xdd, + 0xd4, 0xf8, 0x30, 0x01, 0x00, 0x05, 0x58, 0xbf, 0x10, 0xbd, 0x16, 0x48, + 0x90, 0xf8, 0x2e, 0x10, 0xa9, 0xb1, 0x4f, 0xf4, 0x00, 0x61, 0xc4, 0xf8, + 0x8c, 0x10, 0x00, 0x21, 0x21, 0x64, 0xc1, 0x69, 0x01, 0x20, 0x09, 0xe0, + 0xf5, 0x48, 0x81, 0x7d, 0x91, 0xb1, 0x80, 0x21, 0xc4, 0xf8, 0x8c, 0x10, + 0x00, 0x21, 0x21, 0x60, 0x41, 0x68, 0x00, 0x20, 0xbd, 0xe8, 0x10, 0x40, + 0x14, 0xe0, 0xf3, 0x48, 0x41, 0x8c, 0x01, 0x31, 0x41, 0x84, 0x01, 0x20, + 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x24, 0xb8, 0xee, 0x48, 0x41, 0x88, + 0x01, 0x31, 0x41, 0x80, 0x00, 0x20, 0x00, 0xf0, 0x1d, 0xf8, 0xcf, 0xe7, + 0xb4, 0x21, 0x00, 0x40, 0xe8, 0x0c, 0x01, 0x00, 0x1c, 0xb5, 0x04, 0x46, + 0x6a, 0x48, 0x01, 0x91, 0x01, 0x68, 0x01, 0xa8, 0x88, 0x47, 0xe0, 0x4a, + 0x70, 0x21, 0x01, 0x23, 0x00, 0x2c, 0x08, 0xbf, 0x30, 0x21, 0x8b, 0x50, + 0x65, 0x4b, 0x01, 0x9a, 0xca, 0x50, 0xdc, 0x4a, 0x04, 0xeb, 0x44, 0x01, + 0x02, 0xeb, 0xc1, 0x01, 0x88, 0x75, 0x1c, 0xbd, 0x2d, 0xe9, 0xfe, 0x4f, + 0xd7, 0x49, 0x83, 0x46, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0xc0, 0x04, + 0xa0, 0x46, 0x58, 0xf8, 0x04, 0xaf, 0x98, 0xf8, 0x10, 0x70, 0x00, 0xf0, + 0x91, 0xf8, 0x28, 0xb1, 0x43, 0x48, 0x44, 0x49, 0x00, 0x88, 0x40, 0xf0, + 0xf7, 0x00, 0x08, 0x60, 0x07, 0x20, 0x10, 0x21, 0xcb, 0x4d, 0xbb, 0xf1, + 0x00, 0x0f, 0x04, 0xf1, 0x08, 0x06, 0x08, 0xbf, 0x03, 0x20, 0x81, 0x40, + 0xc5, 0xf8, 0xbc, 0x10, 0x00, 0x01, 0x00, 0x21, 0x29, 0x50, 0xc7, 0x48, + 0x01, 0x68, 0x30, 0x46, 0x88, 0x47, 0x00, 0x28, 0x61, 0xd0, 0xde, 0x49, + 0xc7, 0xeb, 0x07, 0x10, 0xd8, 0xf8, 0x00, 0x30, 0xc2, 0x4f, 0x09, 0x68, + 0x01, 0xeb, 0x40, 0x10, 0x02, 0x89, 0x40, 0xf2, 0xe2, 0x40, 0x50, 0x43, + 0xc1, 0x18, 0xc8, 0xf8, 0x00, 0x10, 0xec, 0x59, 0x64, 0x1a, 0x29, 0xd4, + 0xdf, 0xf8, 0xb8, 0xe0, 0x40, 0xf6, 0xc4, 0x14, 0xa9, 0x46, 0xbc, 0x46, + 0x02, 0x96, 0x02, 0xfb, 0x04, 0x32, 0x4b, 0x42, 0x5e, 0xf8, 0x2b, 0x40, + 0x65, 0x1c, 0xb7, 0x4c, 0x04, 0xeb, 0x4b, 0x14, 0x34, 0xf8, 0x06, 0x7f, + 0x01, 0x94, 0x00, 0x24, 0x16, 0x19, 0x4e, 0xf8, 0x2b, 0x50, 0x1b, 0x1a, + 0x04, 0x44, 0x01, 0x35, 0x01, 0x37, 0xc8, 0xf8, 0x00, 0x60, 0x59, 0xf8, + 0x0c, 0x60, 0x1e, 0x44, 0xb6, 0xf1, 0xff, 0x3f, 0xf0, 0xdc, 0x01, 0x98, + 0x02, 0x9e, 0xa2, 0x44, 0x21, 0x44, 0x4d, 0x46, 0x07, 0x80, 0x67, 0x46, + 0x58, 0x46, 0xff, 0xf7, 0x7d, 0xff, 0x55, 0xf8, 0x07, 0x80, 0x36, 0x68, + 0x4e, 0xb1, 0x17, 0x4c, 0x23, 0x68, 0x30, 0x46, 0x51, 0x46, 0xff, 0x22, + 0x98, 0x47, 0x56, 0xf8, 0x04, 0x6c, 0x00, 0x2e, 0xf6, 0xd1, 0xa0, 0x48, + 0xa3, 0x4e, 0xed, 0x59, 0x41, 0x46, 0x00, 0xeb, 0x4b, 0x14, 0x32, 0x68, + 0x28, 0x46, 0x54, 0xf8, 0x1c, 0x7f, 0x44, 0xe9, 0x02, 0x85, 0x90, 0x47, + 0x87, 0x42, 0x04, 0xd2, 0x32, 0x68, 0x28, 0x46, 0x41, 0x46, 0x90, 0x47, + 0x20, 0x60, 0x00, 0xf0, 0x11, 0xf8, 0x28, 0xb1, 0x03, 0x48, 0x04, 0x49, + 0x00, 0x88, 0x40, 0xf0, 0x07, 0x00, 0x08, 0x60, 0xbd, 0xe8, 0xfe, 0x8f, + 0x26, 0x21, 0x01, 0x00, 0x04, 0x08, 0x00, 0x40, 0x34, 0x4e, 0x01, 0x00, + 0x38, 0xb7, 0x08, 0x00, 0x02, 0x48, 0x00, 0x78, 0xb0, 0xfa, 0x80, 0xf0, + 0x40, 0x09, 0x70, 0x47, 0x6f, 0x34, 0x01, 0x00, 0x1c, 0xb5, 0x04, 0x46, + 0x0a, 0x48, 0x01, 0x91, 0x01, 0x68, 0x01, 0xa8, 0x88, 0x47, 0x80, 0x4a, + 0x60, 0x21, 0x01, 0x23, 0x00, 0x2c, 0x08, 0xbf, 0x20, 0x21, 0x8b, 0x50, + 0x05, 0x4b, 0x01, 0x9a, 0xca, 0x50, 0x7c, 0x4a, 0x04, 0xeb, 0x44, 0x01, + 0x02, 0xeb, 0xc1, 0x01, 0x48, 0x75, 0x1c, 0xbd, 0x1c, 0xb9, 0x08, 0x00, + 0x88, 0x21, 0x00, 0x40, 0x2d, 0xe9, 0xf0, 0x4f, 0x85, 0xb0, 0x83, 0x46, + 0x06, 0x20, 0x10, 0x21, 0x72, 0x4a, 0x73, 0x4f, 0xbb, 0xf1, 0x00, 0x0f, + 0x08, 0xbf, 0x02, 0x20, 0x81, 0x40, 0x0b, 0xeb, 0x4b, 0x05, 0xc2, 0xf8, + 0xbc, 0x10, 0x00, 0x01, 0x00, 0x21, 0x07, 0xeb, 0xc5, 0x06, 0x11, 0x50, + 0x6c, 0x48, 0x06, 0xf1, 0x08, 0x08, 0x34, 0x7d, 0x01, 0x68, 0x40, 0x46, + 0x88, 0x47, 0x00, 0x28, 0x00, 0xf0, 0xc9, 0x80, 0xd8, 0xf8, 0x00, 0x00, + 0x57, 0xf8, 0x35, 0x90, 0xa0, 0xb1, 0x40, 0x69, 0x90, 0xb1, 0x7e, 0x49, + 0x90, 0xf8, 0x1d, 0x01, 0x09, 0x68, 0xc0, 0xeb, 0x00, 0x10, 0x01, 0xeb, + 0x40, 0x10, 0x00, 0x21, 0x00, 0xf0, 0x14, 0xf9, 0x31, 0x68, 0x04, 0x90, + 0x0a, 0x18, 0x71, 0x68, 0x32, 0x60, 0x08, 0x44, 0x70, 0x60, 0x02, 0xe0, + 0x00, 0x20, 0x4a, 0x46, 0x04, 0x90, 0x73, 0x49, 0xc4, 0xeb, 0x04, 0x10, + 0x55, 0x4d, 0x58, 0x4f, 0x09, 0x68, 0x01, 0xeb, 0x40, 0x10, 0x03, 0x89, + 0x40, 0xf2, 0xe2, 0x40, 0x58, 0x43, 0x81, 0x18, 0x31, 0x60, 0xec, 0x59, + 0x64, 0x1a, 0x32, 0xd4, 0x40, 0xf6, 0xc4, 0x14, 0xdf, 0xf8, 0x44, 0xe1, + 0xcd, 0xf8, 0x0c, 0x80, 0xa8, 0x46, 0xbc, 0x46, 0x4f, 0x42, 0x4f, 0xf0, + 0x01, 0x0a, 0x03, 0xfb, 0x04, 0x22, 0x4d, 0x4b, 0x5e, 0xf8, 0x2b, 0x40, + 0x03, 0xeb, 0x4b, 0x13, 0x33, 0xf8, 0x04, 0x5f, 0xcd, 0xe9, 0x01, 0x53, + 0x00, 0x23, 0x04, 0xeb, 0x0a, 0x05, 0x3f, 0x1a, 0x0a, 0xf1, 0x01, 0x0a, + 0x4e, 0xf8, 0x2b, 0x50, 0xd5, 0x18, 0x03, 0x44, 0x35, 0x60, 0x58, 0xf8, + 0x0c, 0x50, 0x3d, 0x44, 0xb5, 0xf1, 0xff, 0x3f, 0xef, 0xdc, 0x01, 0x98, + 0x45, 0x46, 0x02, 0x9a, 0xdd, 0xf8, 0x0c, 0x80, 0x99, 0x44, 0x19, 0x44, + 0x67, 0x46, 0x50, 0x44, 0x01, 0x38, 0x10, 0x80, 0x01, 0xe0, 0x4f, 0xf0, + 0x01, 0x0a, 0x58, 0x46, 0xff, 0xf7, 0x5e, 0xff, 0xe8, 0x59, 0xd8, 0xf8, + 0x00, 0x60, 0x00, 0x2e, 0x03, 0x90, 0x42, 0xd0, 0x35, 0x4c, 0xdf, 0xf8, + 0xdc, 0x80, 0xa9, 0xf1, 0x96, 0x00, 0x4f, 0xea, 0x0a, 0x67, 0x02, 0x90, + 0x70, 0x69, 0x01, 0x6b, 0x99, 0xb3, 0x41, 0x6b, 0x89, 0xb3, 0x91, 0xf8, + 0x29, 0x10, 0xc9, 0x07, 0x2d, 0xd0, 0x31, 0x78, 0xfe, 0x29, 0x1c, 0xd1, + 0xb1, 0x6d, 0x09, 0xb9, 0x02, 0x99, 0xb1, 0x65, 0x04, 0x9a, 0x11, 0x44, + 0xb1, 0x65, 0xb9, 0xeb, 0x01, 0x01, 0x12, 0xd4, 0x90, 0xf8, 0x44, 0x00, + 0x21, 0x68, 0x88, 0x47, 0xb0, 0x6d, 0xb9, 0xeb, 0x00, 0x00, 0x0a, 0xd4, + 0x70, 0x69, 0x21, 0x68, 0x90, 0xf8, 0x44, 0x00, 0x88, 0x47, 0xb0, 0x6d, + 0xa9, 0xeb, 0x00, 0x00, 0xb0, 0xf1, 0xff, 0x3f, 0xf4, 0xdc, 0x1e, 0x48, + 0x01, 0x68, 0x30, 0x46, 0x88, 0x47, 0x47, 0xb1, 0x55, 0x46, 0xd8, 0xf8, + 0x00, 0x20, 0x30, 0x46, 0x00, 0x21, 0x90, 0x47, 0x01, 0x3d, 0x28, 0x06, + 0xf7, 0xd1, 0x56, 0xf8, 0x04, 0x6c, 0x00, 0x2e, 0xc4, 0xd1, 0x0e, 0x48, + 0x10, 0x49, 0xdf, 0xf8, 0x58, 0x80, 0x45, 0x58, 0x10, 0x48, 0x03, 0x9e, + 0xd8, 0xf8, 0x00, 0x20, 0x00, 0xeb, 0x4b, 0x14, 0x28, 0x46, 0x31, 0x46, + 0x54, 0xf8, 0x10, 0x7f, 0x44, 0xe9, 0x02, 0x65, 0x90, 0x47, 0x87, 0x42, + 0x05, 0xd2, 0xd8, 0xf8, 0x00, 0x20, 0x28, 0x46, 0x31, 0x46, 0x90, 0x47, + 0x20, 0x60, 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x84, 0x21, 0x00, 0x40, + 0xe8, 0x0c, 0x01, 0x00, 0x28, 0x9d, 0x08, 0x00, 0xa0, 0xfe, 0xff, 0xff, + 0x3c, 0x4e, 0x01, 0x00, 0xf4, 0x4d, 0x01, 0x00, 0xe0, 0xb8, 0x08, 0x00, + 0xd0, 0xb8, 0x08, 0x00, 0xd4, 0xb8, 0x08, 0x00, 0x1c, 0x9d, 0x08, 0x00, + 0x70, 0xb5, 0x06, 0x46, 0x14, 0x46, 0x0d, 0x46, 0x88, 0x07, 0x02, 0xd5, + 0x30, 0x46, 0xfe, 0xf7, 0x8b, 0xfe, 0x0d, 0x48, 0x96, 0xf8, 0x1d, 0x11, + 0x00, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, 0x90, 0xf8, + 0x21, 0x00, 0x30, 0xb9, 0x70, 0x6b, 0x90, 0xf8, 0x2a, 0x10, 0x41, 0xf0, + 0x04, 0x01, 0x80, 0xf8, 0x2a, 0x10, 0x13, 0x48, 0x29, 0x46, 0x22, 0x46, + 0x83, 0x68, 0x30, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0x18, 0x47, 0x00, 0xbf, + 0xe0, 0x35, 0x01, 0x00, 0xb0, 0xb5, 0x08, 0x48, 0x08, 0x49, 0x0b, 0x4b, + 0x0b, 0x4c, 0x0c, 0x4d, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x61, + 0xd0, 0xe9, 0x00, 0x12, 0xc0, 0xe9, 0x00, 0x35, 0xc4, 0xe9, 0x01, 0x12, + 0xb0, 0xbd, 0x00, 0xbf, 0x70, 0xa7, 0x08, 0x00, 0x95, 0x23, 0x03, 0x00, + 0xc0, 0x0c, 0x01, 0x00, 0x6d, 0x34, 0x03, 0x00, 0xf1, 0x24, 0x03, 0x00, + 0xf4, 0xe5, 0x05, 0x00, 0xcd, 0x29, 0x03, 0x00, 0x43, 0xf6, 0x89, 0x6c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x2d, 0xe9, 0xf0, 0x4f, + 0x8d, 0xb0, 0xc0, 0xb3, 0x90, 0xf8, 0x70, 0x40, 0x05, 0x46, 0x00, 0x68, + 0x88, 0x46, 0x90, 0xf8, 0x4a, 0x71, 0xe8, 0x8e, 0x8d, 0xf8, 0x32, 0x40, + 0x0b, 0x90, 0x95, 0xf8, 0x3c, 0x00, 0x8d, 0xf8, 0x33, 0x70, 0x50, 0xb1, + 0xb5, 0xf8, 0x64, 0x00, 0x00, 0x07, 0x06, 0xd5, 0xdf, 0xf8, 0xd8, 0x03, + 0xb8, 0xfb, 0xf4, 0xf1, 0x02, 0x68, 0x28, 0x46, 0x90, 0x47, 0xdf, 0xf8, + 0xd0, 0x03, 0xa9, 0x6c, 0x02, 0x68, 0x05, 0xf1, 0x14, 0x00, 0x90, 0x47, + 0x02, 0x90, 0x38, 0xb1, 0x02, 0x98, 0x80, 0x88, 0x80, 0x07, 0x03, 0xd4, + 0x00, 0x20, 0x66, 0x21, 0xf4, 0xf7, 0xfe, 0xf8, 0x29, 0x68, 0xcd, 0xf8, + 0x14, 0x80, 0xd1, 0xf8, 0x3c, 0x01, 0x58, 0xb1, 0x90, 0xf8, 0x21, 0x20, + 0x42, 0xb1, 0x02, 0x9a, 0x52, 0xb1, 0x16, 0x88, 0x09, 0xe0, 0x00, 0x20, + 0x50, 0x21, 0xf4, 0xf7, 0xed, 0xf8, 0xc0, 0xe1, 0x00, 0x20, 0x03, 0x90, + 0x0a, 0x97, 0x2c, 0xe0, 0x00, 0x26, 0xd1, 0xf8, 0x00, 0x11, 0x0d, 0xf1, + 0x32, 0x02, 0x02, 0x30, 0x0d, 0xf1, 0x33, 0x03, 0xd1, 0xf8, 0xd4, 0x10, + 0x49, 0x7f, 0x00, 0x92, 0x32, 0x46, 0xb1, 0xfa, 0x81, 0xf1, 0x49, 0x09, + 0x08, 0xf0, 0xc6, 0xfb, 0x9d, 0xf8, 0x32, 0x40, 0xb6, 0xfb, 0xf4, 0xf0, + 0x0b, 0x90, 0x9d, 0xf8, 0x33, 0x00, 0x87, 0x42, 0x0a, 0x90, 0x06, 0xd1, + 0x28, 0x68, 0x90, 0xf8, 0xcc, 0x11, 0xa1, 0x42, 0x02, 0xd1, 0x01, 0x20, + 0xd9, 0xe7, 0x28, 0x68, 0x0a, 0x9a, 0x04, 0x21, 0x97, 0x42, 0x08, 0xbf, + 0x03, 0x21, 0xef, 0xf7, 0x6f, 0xfe, 0x01, 0x20, 0x03, 0x90, 0x05, 0x98, + 0x00, 0x28, 0x00, 0xf0, 0x8c, 0x81, 0x28, 0x1d, 0x00, 0x26, 0x09, 0x90, + 0x95, 0xf8, 0x70, 0x00, 0x00, 0x2c, 0x04, 0x90, 0x00, 0xf0, 0x74, 0x81, + 0xdd, 0xf8, 0x08, 0x90, 0xdd, 0xf8, 0x2c, 0xb0, 0x4f, 0xf0, 0x00, 0x0a, + 0x00, 0x20, 0x08, 0x90, 0x4f, 0x46, 0xcd, 0xe9, 0x06, 0xa6, 0x0b, 0x98, + 0x1f, 0xfa, 0x8b, 0xf8, 0x80, 0x45, 0x54, 0xd1, 0xbc, 0x48, 0x01, 0x68, + 0x64, 0x20, 0x88, 0x47, 0x06, 0x46, 0x18, 0xb9, 0x00, 0x20, 0x93, 0x21, + 0xee, 0xf7, 0x32, 0xfa, 0x28, 0x8a, 0x2a, 0x68, 0xb9, 0xf1, 0x00, 0x0f, + 0xc6, 0xf8, 0x28, 0x90, 0x00, 0xf1, 0x01, 0x01, 0x92, 0xf8, 0x1d, 0x21, + 0x86, 0xf8, 0x2f, 0x00, 0x29, 0x82, 0xb2, 0x49, 0xc2, 0xeb, 0x02, 0x12, + 0x09, 0x68, 0x01, 0xeb, 0x42, 0x12, 0xb2, 0xf8, 0x64, 0x30, 0x03, 0xf1, + 0x01, 0x03, 0xa2, 0xf8, 0x64, 0x30, 0x0a, 0x9a, 0x86, 0xf8, 0x46, 0x40, + 0x86, 0xf8, 0x47, 0x20, 0x30, 0xd1, 0xc0, 0xb2, 0x01, 0x22, 0xa5, 0xf8, + 0x96, 0x00, 0xa8, 0x48, 0x86, 0xf8, 0x2c, 0x20, 0x00, 0x68, 0xc5, 0xf8, + 0xac, 0x00, 0x5f, 0xea, 0x0a, 0x60, 0x10, 0xd1, 0x95, 0xf8, 0x3c, 0x00, + 0x01, 0x30, 0x85, 0xf8, 0x3c, 0x00, 0x28, 0x68, 0x90, 0xf8, 0x1d, 0x01, + 0xc0, 0xeb, 0x00, 0x10, 0x01, 0xeb, 0x40, 0x10, 0xb0, 0xf8, 0x56, 0x10, + 0x01, 0x31, 0xa0, 0xf8, 0x56, 0x10, 0x9f, 0x48, 0x09, 0x99, 0x02, 0x68, + 0x30, 0x46, 0x90, 0x47, 0x0a, 0xf1, 0x01, 0x0a, 0x4f, 0xf0, 0x00, 0x09, + 0x5f, 0xfa, 0x8a, 0xf0, 0xa0, 0x42, 0xa6, 0xd3, 0x0e, 0xe1, 0x67, 0xb3, + 0xdd, 0xf8, 0x18, 0xa0, 0xb9, 0x46, 0x30, 0xe0, 0xb9, 0xf8, 0x04, 0x10, + 0xca, 0x06, 0x44, 0xbf, 0x21, 0xf0, 0x10, 0x01, 0xa9, 0xf8, 0x04, 0x10, + 0x01, 0x21, 0x4f, 0xf6, 0xff, 0x72, 0x86, 0xf8, 0x2c, 0x10, 0xb9, 0xf8, + 0x16, 0x10, 0x91, 0x42, 0x04, 0xbf, 0xc1, 0xb2, 0xa9, 0xf8, 0x16, 0x10, + 0xc0, 0xb2, 0xa9, 0xf8, 0x18, 0x00, 0xa5, 0xf8, 0x96, 0x00, 0xb9, 0xf8, + 0x02, 0x00, 0xd9, 0xf8, 0x08, 0x10, 0xa5, 0xf8, 0x94, 0x00, 0x82, 0x48, + 0xc5, 0xf8, 0xa8, 0x10, 0x00, 0x68, 0xdd, 0xf8, 0x2c, 0x80, 0x07, 0x96, + 0xc5, 0xf8, 0xac, 0x00, 0x07, 0xe0, 0x00, 0x20, 0xd4, 0x21, 0x4f, 0xf0, + 0x00, 0x09, 0xee, 0xf7, 0xb3, 0xf9, 0xdd, 0xf8, 0x18, 0xa0, 0x08, 0x98, + 0xb9, 0xf8, 0x00, 0x60, 0x78, 0x49, 0x1f, 0xfa, 0x80, 0xfe, 0xa6, 0xeb, + 0x0e, 0x00, 0x40, 0x45, 0xc8, 0xbf, 0x40, 0x46, 0x0a, 0x68, 0x00, 0x2a, + 0x7e, 0xd0, 0x74, 0x49, 0xdf, 0xf8, 0xd0, 0x81, 0x91, 0xf8, 0xd2, 0x31, + 0x98, 0xf8, 0x00, 0x10, 0x99, 0x42, 0x72, 0xd2, 0xb1, 0xfb, 0xf3, 0xf7, + 0x4f, 0xf0, 0x1a, 0x0c, 0x07, 0xfb, 0x13, 0x11, 0xde, 0x27, 0x01, 0xfb, + 0x0c, 0xf1, 0x57, 0x52, 0x98, 0xf8, 0x00, 0x10, 0xb1, 0xfb, 0xf3, 0xf7, + 0x07, 0xfb, 0x13, 0x11, 0xb9, 0xf8, 0x02, 0x70, 0x01, 0xfb, 0x0c, 0x21, + 0x4f, 0x80, 0x98, 0xf8, 0x00, 0x10, 0xb1, 0xfb, 0xf3, 0xf7, 0x07, 0xfb, + 0x13, 0x11, 0x07, 0x9f, 0x01, 0xfb, 0x0c, 0x21, 0x8e, 0x80, 0x98, 0xf8, + 0x00, 0x10, 0xb1, 0xfb, 0xf3, 0xf6, 0x06, 0xfb, 0x13, 0x11, 0x2e, 0x8a, + 0x01, 0xfb, 0x0c, 0x21, 0xce, 0x82, 0x98, 0xf8, 0x00, 0x10, 0xb1, 0xfb, + 0xf3, 0xf6, 0x06, 0xfb, 0x13, 0x11, 0x08, 0x9e, 0x01, 0xfb, 0x0c, 0x21, + 0x0e, 0x81, 0x98, 0xf8, 0x00, 0x10, 0xb1, 0xfb, 0xf3, 0xf6, 0x06, 0xfb, + 0x13, 0x11, 0x01, 0xfb, 0x0c, 0x21, 0x48, 0x81, 0x98, 0xf8, 0x00, 0x10, + 0xb1, 0xfb, 0xf3, 0xf6, 0x06, 0xfb, 0x13, 0x11, 0x01, 0xfb, 0x0c, 0x21, + 0xa1, 0xf8, 0x0c, 0xb0, 0x98, 0xf8, 0x00, 0x10, 0xb1, 0xfb, 0xf3, 0xf6, + 0x06, 0xfb, 0x13, 0x11, 0x3e, 0x8e, 0x01, 0xfb, 0x0c, 0x21, 0xce, 0x81, + 0x98, 0xf8, 0x00, 0x10, 0xb1, 0xfb, 0xf3, 0xf6, 0x06, 0xfb, 0x13, 0x11, + 0x97, 0xf8, 0x2d, 0x60, 0x01, 0xfb, 0x0c, 0x21, 0x0e, 0x82, 0x98, 0xf8, + 0x00, 0x10, 0xb1, 0xfb, 0xf3, 0xf6, 0x06, 0xfb, 0x13, 0x11, 0x97, 0xf8, + 0x2e, 0x60, 0x01, 0xfb, 0x0c, 0x21, 0x4e, 0x82, 0x98, 0xf8, 0x00, 0x10, + 0xb1, 0xfb, 0xf3, 0xf6, 0x06, 0xfb, 0x13, 0x11, 0x01, 0xfb, 0x0c, 0x21, + 0x97, 0xf8, 0x2f, 0x20, 0x8a, 0x82, 0x98, 0xf8, 0x00, 0x10, 0x01, 0x31, + 0x88, 0xf8, 0x00, 0x10, 0x01, 0x04, 0x15, 0xd0, 0x07, 0x9e, 0xd9, 0xf8, + 0x0c, 0x10, 0xab, 0xeb, 0x00, 0x0b, 0x96, 0xf8, 0x2e, 0x20, 0x71, 0x44, + 0x46, 0xf8, 0x22, 0x10, 0x06, 0xeb, 0x42, 0x01, 0x48, 0x86, 0x51, 0x1c, + 0x08, 0x9a, 0x86, 0xf8, 0x2e, 0x10, 0x31, 0x8e, 0x02, 0x44, 0x01, 0x44, + 0x31, 0x86, 0x01, 0xe0, 0xdd, 0xe9, 0x07, 0x62, 0xb9, 0xf8, 0x00, 0x00, + 0x91, 0xb2, 0x81, 0x42, 0x06, 0xd1, 0xb9, 0xf8, 0x04, 0x00, 0x40, 0x07, + 0x04, 0xd4, 0x59, 0xf8, 0x04, 0x9c, 0x0c, 0xe0, 0x08, 0x92, 0x11, 0xe0, + 0x59, 0xf8, 0x04, 0x0c, 0x4f, 0xf0, 0x00, 0x0b, 0xc5, 0xf8, 0x48, 0x90, + 0x4f, 0xf0, 0x00, 0x09, 0x86, 0xf8, 0x2c, 0xb0, 0x02, 0x90, 0x96, 0xf8, + 0x2d, 0x00, 0x01, 0x30, 0x86, 0xf8, 0x2d, 0x00, 0x00, 0x20, 0x08, 0x90, + 0x5f, 0xea, 0x0b, 0x40, 0x08, 0xd1, 0x18, 0x48, 0x09, 0x99, 0x02, 0x68, + 0x30, 0x46, 0x90, 0x47, 0xdd, 0xf8, 0x2c, 0xb0, 0x0a, 0xf1, 0x01, 0x0a, + 0x5f, 0xfa, 0x8a, 0xf0, 0xa0, 0x42, 0xff, 0xf4, 0x95, 0xae, 0xff, 0xe7, + 0x03, 0x98, 0x28, 0xb1, 0x95, 0xf8, 0x70, 0x00, 0x29, 0x8a, 0x00, 0x1b, + 0x08, 0x44, 0x28, 0x82, 0xdd, 0xe9, 0x04, 0x01, 0x09, 0x1a, 0x08, 0x06, + 0x05, 0x91, 0x7f, 0xf4, 0x77, 0xae, 0x0d, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0xe0, 0xb6, 0x08, 0x00, 0xec, 0xa0, 0x08, 0x00, 0x4c, 0x9c, 0x08, 0x00, + 0xe0, 0x35, 0x01, 0x00, 0x24, 0x20, 0x00, 0x40, 0xd0, 0x35, 0x01, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0xc1, 0x4d, 0x01, 0x00, 0x10, 0xb7, 0x08, 0x00, + 0x40, 0x68, 0x30, 0xb1, 0x90, 0xf8, 0x2f, 0x30, 0x8b, 0x42, 0x04, 0xd0, + 0x50, 0xf8, 0x04, 0x0c, 0xf7, 0xe7, 0x00, 0x20, 0x70, 0x47, 0x10, 0x60, + 0x01, 0x20, 0x70, 0x47, 0xf8, 0xb5, 0x0d, 0x46, 0x04, 0x46, 0x00, 0xf0, + 0x95, 0xfa, 0x94, 0xf8, 0x74, 0x00, 0x80, 0x07, 0x2b, 0xd5, 0x55, 0xb3, + 0x2b, 0x88, 0x04, 0x2b, 0x27, 0xd3, 0x6a, 0x69, 0x24, 0x68, 0x10, 0x78, + 0x51, 0x78, 0x95, 0x78, 0xd6, 0x78, 0xb4, 0xf8, 0x74, 0x71, 0x10, 0x4c, + 0x40, 0xea, 0x01, 0x20, 0x0c, 0x21, 0xa7, 0x80, 0xe3, 0x80, 0x40, 0xea, + 0x05, 0x40, 0x40, 0xea, 0x06, 0x60, 0x20, 0x60, 0x04, 0xf1, 0x08, 0x00, + 0xee, 0xf7, 0x94, 0xf8, 0x09, 0x48, 0x01, 0x21, 0x00, 0x22, 0x23, 0x46, + 0x05, 0x68, 0x14, 0x20, 0x00, 0x90, 0x40, 0xf6, 0x5a, 0x10, 0xa8, 0x47, + 0x05, 0x48, 0x12, 0x21, 0x00, 0x78, 0xbd, 0xe8, 0xf8, 0x40, 0xee, 0xf7, + 0x89, 0xb8, 0xf8, 0xbd, 0x00, 0xe6, 0x05, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0x66, 0x34, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, 0x04, 0x46, 0x00, 0x68, + 0x41, 0x6b, 0x49, 0x78, 0xa9, 0xb1, 0xfe, 0x29, 0x13, 0xd0, 0x21, 0x6a, + 0x89, 0xb1, 0x0a, 0x89, 0x52, 0x06, 0x03, 0xd0, 0x36, 0x48, 0x00, 0x22, + 0x01, 0x23, 0x07, 0xe0, 0xb0, 0xf8, 0x36, 0x01, 0x0a, 0x88, 0x82, 0x42, + 0x05, 0xd0, 0x32, 0x48, 0x00, 0x22, 0x04, 0x23, 0x05, 0x68, 0x20, 0x46, + 0xa8, 0x47, 0x20, 0x68, 0x40, 0x6b, 0x40, 0x78, 0x00, 0x28, 0x52, 0xd0, + 0xfe, 0x28, 0x4e, 0xd1, 0x25, 0x46, 0x55, 0xf8, 0x20, 0x0f, 0x70, 0xb1, + 0x00, 0x21, 0xc2, 0x88, 0x92, 0x07, 0x02, 0x46, 0x04, 0xd4, 0x02, 0x88, + 0x0b, 0x88, 0x1a, 0x44, 0x0a, 0x80, 0x0a, 0x46, 0x50, 0xf8, 0x04, 0x0c, + 0x11, 0x46, 0x00, 0x28, 0xf1, 0xd1, 0xdf, 0xf8, 0x90, 0x80, 0x28, 0x46, + 0xd8, 0xf8, 0x00, 0x10, 0x88, 0x47, 0xa0, 0xb3, 0xdf, 0xf8, 0x84, 0x90, + 0xdf, 0xf8, 0x88, 0xa0, 0x22, 0x4f, 0xdf, 0xf8, 0x80, 0xb0, 0xd9, 0xf8, + 0x00, 0x10, 0x28, 0x46, 0x88, 0x47, 0x06, 0x46, 0xc0, 0x88, 0x81, 0x07, + 0x05, 0xd5, 0xdb, 0xf8, 0x00, 0x20, 0x20, 0x46, 0x31, 0x46, 0x90, 0x47, + 0xf0, 0x88, 0x22, 0x68, 0xda, 0xf8, 0x00, 0x10, 0x40, 0x07, 0x92, 0xf8, + 0x1d, 0x21, 0xc2, 0xeb, 0x02, 0x12, 0x01, 0xeb, 0x42, 0x11, 0xb1, 0xf8, + 0x7e, 0x20, 0x02, 0xf1, 0x01, 0x02, 0xa1, 0xf8, 0x7e, 0x20, 0x04, 0xd5, + 0x94, 0xf8, 0x2d, 0x00, 0x01, 0x38, 0x84, 0xf8, 0x2d, 0x00, 0x3a, 0x68, + 0x20, 0x46, 0x31, 0x46, 0x90, 0x47, 0xd8, 0xf8, 0x00, 0x10, 0x28, 0x46, + 0x88, 0x47, 0x00, 0x28, 0xd1, 0xd1, 0xbd, 0xe8, 0xf8, 0x8f, 0x04, 0x48, + 0x01, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x4f, 0x08, 0x47, 0x00, 0xbf, + 0x08, 0xb7, 0x08, 0x00, 0xd8, 0xb3, 0x08, 0x00, 0x28, 0x9d, 0x08, 0x00, + 0x24, 0x9d, 0x08, 0x00, 0xd4, 0xb3, 0x08, 0x00, 0xe0, 0x35, 0x01, 0x00, + 0xd0, 0xb3, 0x08, 0x00, 0x2d, 0xe9, 0xfe, 0x4f, 0x04, 0x46, 0x00, 0x68, + 0x90, 0xf8, 0x46, 0x51, 0x00, 0x2d, 0x00, 0xf0, 0x74, 0x81, 0xd2, 0x4a, + 0x02, 0xf5, 0xdd, 0x78, 0xb4, 0xf8, 0x64, 0x20, 0x12, 0xf0, 0x01, 0x02, + 0x0e, 0xd1, 0xb7, 0x4b, 0x90, 0xf8, 0x1d, 0x61, 0xc6, 0xeb, 0x06, 0x16, + 0x1b, 0x68, 0x76, 0x01, 0x9b, 0x5d, 0x01, 0x2b, 0x04, 0xd8, 0x43, 0x6b, + 0x1b, 0x78, 0x00, 0x2b, 0x00, 0xf0, 0x4b, 0x81, 0x71, 0xb1, 0xaf, 0x4b, + 0x90, 0xf8, 0x1d, 0x61, 0x1b, 0x68, 0xc6, 0xeb, 0x06, 0x16, 0x03, 0xeb, + 0x46, 0x13, 0x93, 0xf8, 0x21, 0x30, 0x1b, 0xb9, 0x94, 0xf8, 0x70, 0x30, + 0x03, 0xfb, 0x01, 0xf5, 0x00, 0x2a, 0x40, 0xf0, 0xb6, 0x80, 0xb8, 0xf8, + 0x00, 0x10, 0xc9, 0x05, 0x13, 0xd4, 0xa4, 0x49, 0x90, 0xf8, 0x1d, 0x21, + 0xc2, 0xeb, 0x02, 0x12, 0x09, 0x68, 0x53, 0x01, 0xcb, 0x5c, 0x02, 0x2b, + 0x09, 0xd1, 0x01, 0xeb, 0x42, 0x11, 0x91, 0xf8, 0xe2, 0x10, 0x21, 0xb1, + 0x94, 0xf8, 0x2c, 0x10, 0x00, 0x29, 0x56, 0xd1, 0x31, 0xe1, 0x42, 0x6b, + 0x94, 0xf8, 0x2c, 0x10, 0x12, 0x78, 0xd2, 0xb3, 0xdf, 0xf8, 0x5c, 0x92, + 0x90, 0xf8, 0x1d, 0x31, 0xd9, 0xf8, 0x00, 0x20, 0xc3, 0xeb, 0x03, 0x13, + 0x02, 0xeb, 0x43, 0x12, 0x94, 0xf8, 0x3d, 0x30, 0x92, 0xf8, 0x21, 0x20, + 0x00, 0x2a, 0x18, 0xbf, 0x01, 0x33, 0x8b, 0x42, 0x3d, 0xd2, 0xdf, 0xf8, + 0x40, 0xb2, 0x90, 0x4f, 0x04, 0xf1, 0x14, 0x05, 0x4f, 0xf0, 0x04, 0x0a, + 0x28, 0x68, 0x08, 0xb1, 0x80, 0xf8, 0x14, 0xa0, 0x39, 0x68, 0xdb, 0xf8, + 0x00, 0x60, 0x28, 0x46, 0x88, 0x47, 0x01, 0x46, 0x20, 0x46, 0xb0, 0x47, + 0x20, 0x68, 0xd9, 0xf8, 0x00, 0x10, 0x90, 0xf8, 0x1d, 0x21, 0xc2, 0xeb, + 0x02, 0x12, 0x01, 0xeb, 0x42, 0x11, 0x94, 0xf8, 0x3d, 0x20, 0x91, 0xf8, + 0x21, 0x10, 0x00, 0x29, 0x18, 0xbf, 0x01, 0x32, 0x94, 0xf8, 0x2c, 0x10, + 0x8a, 0x42, 0xdf, 0xd3, 0x15, 0xe0, 0x94, 0xf8, 0x3d, 0x20, 0x91, 0x42, + 0x11, 0xd2, 0x61, 0x69, 0x00, 0x29, 0x00, 0xf0, 0xea, 0x80, 0x7a, 0x48, + 0x7a, 0x4a, 0x00, 0x68, 0x12, 0x68, 0x89, 0x68, 0x90, 0x47, 0x94, 0xf8, + 0x3d, 0x10, 0xe2, 0x6d, 0x51, 0x43, 0x88, 0x42, 0xc0, 0xf0, 0xdd, 0x80, + 0x20, 0x68, 0x75, 0x49, 0x0d, 0xf1, 0x0a, 0x02, 0x01, 0xab, 0x0d, 0x68, + 0x01, 0x21, 0xa8, 0x47, 0x00, 0x28, 0x00, 0xf0, 0xd2, 0x80, 0x6a, 0x48, + 0x01, 0x99, 0x03, 0x68, 0x20, 0x68, 0x21, 0x82, 0x90, 0xf8, 0x1d, 0x21, + 0xc2, 0xeb, 0x02, 0x16, 0x03, 0xeb, 0x46, 0x12, 0x92, 0xf8, 0x21, 0x50, + 0x65, 0xb1, 0x75, 0x01, 0x5f, 0x5d, 0x90, 0xf8, 0x46, 0x51, 0x02, 0x2f, + 0x0b, 0xd1, 0x92, 0xf8, 0xe1, 0xc0, 0x92, 0xf8, 0xe2, 0x70, 0x07, 0xfb, + 0x0c, 0x55, 0x04, 0xe0, 0x94, 0xf8, 0x3d, 0x50, 0x94, 0xf8, 0x70, 0x70, + 0x7d, 0x43, 0xb8, 0xf8, 0x00, 0x70, 0xff, 0x05, 0x0d, 0xd4, 0x76, 0x01, + 0x9b, 0x5d, 0x02, 0x2b, 0x09, 0xd1, 0x92, 0xf8, 0xe2, 0x30, 0x33, 0xb1, + 0x92, 0xf8, 0xe1, 0x20, 0x90, 0xf8, 0x46, 0x51, 0x12, 0xfb, 0x03, 0x11, + 0x21, 0x82, 0xa4, 0xf8, 0x8e, 0x10, 0xb4, 0xf8, 0x64, 0x10, 0x41, 0xf0, + 0x01, 0x01, 0xa4, 0xf8, 0x64, 0x10, 0x61, 0x69, 0x49, 0x88, 0xa4, 0xf8, + 0x8c, 0x10, 0xb4, 0xf8, 0x90, 0x10, 0x94, 0xf8, 0x2c, 0x20, 0x91, 0x42, + 0x88, 0xbf, 0x0a, 0x46, 0x98, 0xf8, 0x17, 0x10, 0xa4, 0xf8, 0x90, 0x20, + 0xd1, 0xb3, 0x90, 0xf8, 0x1d, 0x21, 0x44, 0x4f, 0xc2, 0xeb, 0x02, 0x12, + 0x39, 0x68, 0x53, 0x01, 0xcb, 0x5c, 0x02, 0x2b, 0x0f, 0xd1, 0x90, 0xf8, + 0x20, 0x31, 0x90, 0xf8, 0x46, 0x01, 0x01, 0xeb, 0x42, 0x11, 0x91, 0xf8, + 0xe0, 0x20, 0x91, 0xf8, 0xe1, 0x10, 0xb3, 0xfb, 0xf0, 0xf0, 0x80, 0x1a, + 0x48, 0x43, 0x46, 0x1c, 0x01, 0xe0, 0x90, 0xf8, 0x47, 0x61, 0x3e, 0x48, + 0x01, 0x68, 0x20, 0x1d, 0x88, 0x47, 0x01, 0x46, 0x98, 0xf8, 0x17, 0x00, + 0x50, 0xfa, 0x86, 0xf0, 0x42, 0x1e, 0x20, 0x68, 0x90, 0xf8, 0x46, 0x31, + 0x12, 0xfb, 0x03, 0xf2, 0x8a, 0x42, 0x0d, 0xda, 0x90, 0xf8, 0x1d, 0x01, + 0x39, 0x68, 0xc0, 0xeb, 0x00, 0x10, 0x01, 0xeb, 0x40, 0x10, 0xb0, 0xf8, + 0x6c, 0x10, 0x01, 0x31, 0xa0, 0xf8, 0x6c, 0x10, 0xbd, 0xe8, 0xfe, 0x8f, + 0x27, 0x49, 0x90, 0xf8, 0x1d, 0x01, 0x09, 0x68, 0xc0, 0xeb, 0x00, 0x10, + 0x01, 0xeb, 0x40, 0x10, 0xe9, 0xb2, 0x90, 0xf8, 0x21, 0x00, 0x01, 0x28, + 0x14, 0xbf, 0x45, 0x48, 0x28, 0x48, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, + 0x27, 0x48, 0x00, 0x68, 0x98, 0xb1, 0x27, 0x4d, 0x98, 0xf8, 0x18, 0x20, + 0x29, 0x78, 0x91, 0x42, 0x0b, 0xd2, 0xb1, 0xfb, 0xf2, 0xf3, 0x03, 0xfb, + 0x12, 0x11, 0x1a, 0x22, 0x01, 0xfb, 0x02, 0x00, 0x1a, 0x21, 0xff, 0x22, + 0xfe, 0xf7, 0x60, 0xf8, 0x29, 0x78, 0x48, 0x1c, 0x28, 0x70, 0x1a, 0x4e, + 0x25, 0x1d, 0xb4, 0xf8, 0x92, 0x70, 0x28, 0x46, 0x31, 0x68, 0x88, 0x47, + 0x87, 0x42, 0x8f, 0xbf, 0xb4, 0xf8, 0x92, 0x00, 0x31, 0x68, 0x28, 0x46, + 0x88, 0x47, 0xa4, 0xf8, 0x92, 0x00, 0xbd, 0xe8, 0xfe, 0x8f, 0x98, 0xf9, + 0x00, 0x30, 0x00, 0x2b, 0x3f, 0xf5, 0xb0, 0xae, 0x08, 0x4b, 0x9b, 0x7f, + 0x00, 0x2b, 0x3f, 0xf4, 0xab, 0xae, 0x94, 0xf8, 0x3d, 0x70, 0x94, 0xf8, + 0x2c, 0x60, 0x3b, 0x44, 0xb3, 0x42, 0x7f, 0xf6, 0xa3, 0xae, 0xbd, 0xe8, + 0xfe, 0x8f, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, 0x50, 0x32, 0x06, 0x00, + 0xa0, 0xb2, 0x08, 0x00, 0x24, 0x9d, 0x08, 0x00, 0x24, 0x20, 0x00, 0x40, + 0x1c, 0x9d, 0x08, 0x00, 0xe0, 0xb5, 0x08, 0x00, 0x28, 0x9d, 0x08, 0x00, + 0xd0, 0xb5, 0x08, 0x00, 0xd0, 0x35, 0x01, 0x00, 0xc1, 0x4d, 0x01, 0x00, + 0x70, 0xb5, 0x04, 0x46, 0x00, 0x68, 0x0a, 0x4d, 0x40, 0x6b, 0x95, 0xf8, + 0xd1, 0x61, 0x00, 0x78, 0x10, 0xb9, 0x00, 0x20, 0x85, 0xf8, 0xd1, 0x01, + 0x20, 0x46, 0x00, 0xf0, 0x35, 0xf8, 0x21, 0x68, 0x49, 0x6b, 0x09, 0x78, + 0x01, 0xb1, 0x70, 0xbd, 0x85, 0xf8, 0xd1, 0x61, 0x70, 0xbd, 0x00, 0xbf, + 0xe8, 0x65, 0x08, 0x00, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, + 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xd4, 0xb3, 0x08, 0x00, 0xb1, 0x2e, 0x03, 0x00, 0xbc, 0xb4, 0x08, 0x00, + 0x29, 0x2f, 0x03, 0x00, 0xd4, 0xb5, 0x08, 0x00, 0x65, 0x2a, 0x03, 0x00, + 0xc4, 0xb4, 0x08, 0x00, 0x3d, 0x30, 0x03, 0x00, 0xd8, 0xb4, 0x08, 0x00, + 0x69, 0x33, 0x03, 0x00, 0x41, 0xf2, 0x8d, 0x0c, 0xc1, 0xf2, 0x06, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf2, 0xc9, 0x6c, 0xc1, 0xf2, 0x06, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xb0, 0xb5, 0x04, 0x46, 0xd0, 0xf8, 0x0c, 0x02, + 0x58, 0xb1, 0x08, 0x68, 0x0d, 0x46, 0x30, 0xb9, 0x04, 0xf5, 0x03, 0x70, + 0x01, 0x21, 0xf1, 0xf7, 0x4f, 0xff, 0x20, 0xb1, 0x28, 0x60, 0x01, 0x24, + 0x11, 0xe0, 0x00, 0x24, 0x0f, 0xe0, 0x09, 0x48, 0x94, 0xf8, 0x1d, 0x11, + 0x00, 0x24, 0x00, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, + 0x41, 0x8f, 0x01, 0x31, 0x41, 0x87, 0x00, 0x20, 0x53, 0x21, 0xed, 0xf7, + 0xdd, 0xfd, 0x20, 0x46, 0xb0, 0xbd, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, + 0x70, 0xb5, 0x06, 0x46, 0x14, 0x46, 0x0d, 0x46, 0x88, 0x07, 0x02, 0xd5, + 0x30, 0x46, 0xfe, 0xf7, 0x4b, 0xf9, 0x30, 0x46, 0x29, 0x46, 0x22, 0x46, + 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, 0x52, 0xba, 0xb0, 0xb5, 0x0c, 0x46, + 0x05, 0x46, 0xff, 0xf7, 0xc3, 0xff, 0x08, 0xb1, 0x01, 0x20, 0xb0, 0xbd, + 0x28, 0x46, 0x21, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x4a, 0xba, + 0x70, 0xb5, 0x04, 0x46, 0x40, 0x69, 0x02, 0x6b, 0x2a, 0xb1, 0x40, 0x6b, + 0x18, 0xb1, 0x90, 0xf8, 0x29, 0x00, 0x80, 0x07, 0x01, 0xd4, 0x00, 0x20, + 0x70, 0xbd, 0x18, 0x48, 0x01, 0x22, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, + 0xa1, 0x6d, 0x04, 0xf1, 0x54, 0x00, 0x00, 0x29, 0xf4, 0xd0, 0x0a, 0x68, + 0x02, 0xf4, 0x40, 0x42, 0xb2, 0xf5, 0x00, 0x4f, 0xee, 0xd1, 0x04, 0xf1, + 0x5c, 0x02, 0x4f, 0xf6, 0xff, 0x73, 0x00, 0x24, 0x0e, 0x46, 0x15, 0x46, + 0x2e, 0xb1, 0x36, 0x68, 0x9b, 0xb2, 0xb3, 0xeb, 0x96, 0x5f, 0x28, 0xbf, + 0xb3, 0x0d, 0x01, 0x34, 0x03, 0x2c, 0x01, 0xd0, 0x40, 0xcd, 0xf3, 0xe7, + 0x9b, 0x05, 0x00, 0x24, 0x21, 0xb1, 0x0d, 0x68, 0x6f, 0xf3, 0x9f, 0x55, + 0x1d, 0x43, 0x0d, 0x60, 0x01, 0x34, 0x03, 0x2c, 0xd0, 0xd0, 0x02, 0xca, + 0xf4, 0xe7, 0x00, 0xbf, 0x38, 0xb7, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x89, 0xb0, 0x98, 0xb1, 0x04, 0x46, 0x40, 0x6b, 0x80, 0xb1, 0xc4, 0x49, + 0x94, 0xf8, 0x1d, 0x21, 0x09, 0x68, 0xc2, 0xeb, 0x02, 0x12, 0x01, 0xeb, + 0x42, 0x16, 0xd6, 0xf8, 0xd8, 0x11, 0x71, 0xb1, 0x7c, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x00, 0x24, 0x04, 0xe0, 0x00, 0x20, 0xbb, 0x21, + 0xf3, 0xf7, 0xc0, 0xfb, 0x1f, 0x24, 0x20, 0x46, 0x09, 0xb0, 0xbd, 0xe8, + 0xf0, 0x8f, 0x96, 0xf8, 0xc0, 0x70, 0x7f, 0xb1, 0x21, 0x6b, 0x39, 0xb1, + 0x01, 0x78, 0xff, 0x29, 0x03, 0x91, 0x0c, 0xd1, 0x40, 0x78, 0xff, 0x28, + 0x03, 0x90, 0x08, 0xd1, 0x00, 0x20, 0xdb, 0x21, 0x00, 0x24, 0xf3, 0xf7, + 0xa9, 0xfb, 0xe8, 0xe7, 0x00, 0x20, 0xd2, 0x21, 0xe2, 0xe7, 0x6b, 0x48, + 0x94, 0xf8, 0x85, 0x51, 0x01, 0x68, 0x07, 0xeb, 0x87, 0x00, 0x80, 0x00, + 0x88, 0x47, 0x00, 0x28, 0x08, 0x90, 0x00, 0xf0, 0xc1, 0x80, 0x83, 0x46, + 0x06, 0xf5, 0xec, 0x70, 0x8d, 0xf8, 0x1c, 0x70, 0x06, 0xf5, 0xea, 0x71, + 0x01, 0x96, 0x00, 0x90, 0x96, 0xf8, 0xd5, 0x01, 0x11, 0xf8, 0x02, 0x2b, + 0x42, 0xea, 0x00, 0x20, 0x0a, 0x78, 0x49, 0x78, 0x42, 0xea, 0x01, 0x21, + 0x40, 0xea, 0x01, 0x48, 0x06, 0xf5, 0xe8, 0x70, 0x80, 0x45, 0x04, 0x90, + 0x00, 0xf0, 0x84, 0x80, 0x01, 0x98, 0x4f, 0xf0, 0x00, 0x09, 0xa0, 0x30, + 0x02, 0x90, 0x18, 0xf8, 0xb6, 0x0c, 0x00, 0x07, 0x05, 0xd5, 0x58, 0xf8, + 0xc8, 0x0c, 0x28, 0xb3, 0x58, 0xf8, 0xc4, 0x0c, 0x10, 0xb3, 0x02, 0x98, + 0x3e, 0x21, 0x5f, 0xfa, 0x89, 0xf7, 0x00, 0x68, 0x40, 0x7f, 0x00, 0x28, + 0x08, 0xbf, 0x3c, 0x21, 0x38, 0xf8, 0x01, 0x20, 0xf9, 0x00, 0x00, 0x28, + 0x4f, 0xf0, 0x3c, 0x00, 0x51, 0xfa, 0x89, 0xf1, 0x0b, 0xeb, 0x41, 0x06, + 0x72, 0x80, 0x88, 0xf8, 0x8d, 0x50, 0x08, 0xbf, 0x3e, 0x20, 0x38, 0xf8, + 0x00, 0x10, 0x26, 0xf8, 0x04, 0x1f, 0x32, 0xb1, 0x42, 0x48, 0x01, 0x68, + 0x03, 0x98, 0x88, 0x47, 0x31, 0x88, 0x01, 0xe0, 0x3e, 0xe0, 0xfe, 0x20, + 0x07, 0xeb, 0xc7, 0x07, 0x0b, 0xeb, 0x47, 0x0a, 0x8a, 0xf8, 0x10, 0x00, + 0x21, 0xb1, 0x3b, 0x48, 0x01, 0x68, 0x03, 0x98, 0x88, 0x47, 0x00, 0xe0, + 0xfe, 0x20, 0x18, 0xf8, 0xb4, 0x1c, 0x02, 0x2d, 0x2b, 0xf8, 0x17, 0x10, + 0x88, 0xf8, 0x8d, 0x50, 0x8a, 0xf8, 0x11, 0x00, 0x0f, 0xd1, 0x34, 0x48, + 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, 0x32, 0x48, 0x33, 0x4a, + 0x00, 0x21, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x4f, 0xf6, 0xff, 0x70, + 0xaa, 0xf8, 0x00, 0x00, 0x14, 0xe0, 0x0a, 0xf1, 0x0a, 0x00, 0x05, 0x2d, + 0x0a, 0xd1, 0x05, 0x21, 0x01, 0x70, 0x4f, 0xf4, 0x80, 0x50, 0xaa, 0xf8, + 0x0e, 0x00, 0x4f, 0xf4, 0x01, 0x70, 0xaa, 0xf8, 0x0c, 0x00, 0x03, 0xe0, + 0x03, 0x21, 0x01, 0x70, 0x8a, 0xf8, 0x0c, 0x10, 0x8a, 0xf8, 0x0b, 0x10, + 0x09, 0xf1, 0x01, 0x09, 0x18, 0xf8, 0x04, 0x0f, 0x98, 0xf8, 0x01, 0x10, + 0x98, 0xf8, 0x02, 0x20, 0x98, 0xf8, 0x03, 0x30, 0x40, 0xea, 0x01, 0x20, + 0x42, 0xea, 0x03, 0x21, 0x40, 0xea, 0x01, 0x48, 0x04, 0x98, 0x80, 0x45, + 0x7f, 0xf4, 0x81, 0xaf, 0x1a, 0x48, 0x06, 0x94, 0x58, 0x4d, 0x02, 0x21, + 0x05, 0x90, 0x01, 0x98, 0x90, 0xf8, 0x21, 0x00, 0x00, 0x28, 0x08, 0xbf, + 0x01, 0x21, 0x6a, 0x68, 0x05, 0xa8, 0x90, 0x47, 0x00, 0x9e, 0x30, 0x60, + 0x08, 0x98, 0xf3, 0xf7, 0x05, 0xfb, 0x30, 0x68, 0x88, 0xb1, 0xa9, 0x68, + 0x88, 0x47, 0x00, 0x28, 0x7f, 0xf4, 0x1a, 0xaf, 0x60, 0x6b, 0x90, 0xf8, + 0x2a, 0x10, 0x41, 0xf0, 0x01, 0x01, 0x80, 0xf8, 0x2a, 0x10, 0x11, 0xe7, + 0x00, 0x20, 0x40, 0xf2, 0x15, 0x11, 0xf3, 0xf7, 0xd3, 0xfa, 0x07, 0x24, + 0x11, 0xe7, 0x00, 0xbf, 0xf8, 0xb8, 0x08, 0x00, 0x4c, 0x9c, 0x08, 0x00, + 0x00, 0xb9, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x70, 0x9b, 0x08, 0x00, + 0x40, 0x39, 0x03, 0x00, 0x91, 0x54, 0x06, 0x10, 0x2d, 0xe9, 0xf0, 0x41, + 0x00, 0x28, 0x45, 0xd0, 0x42, 0x6b, 0x00, 0x2a, 0x42, 0xd0, 0x37, 0x4a, + 0x90, 0xf8, 0x1d, 0x41, 0x16, 0x68, 0x36, 0x4a, 0x12, 0x68, 0x90, 0x47, + 0x00, 0x28, 0x40, 0xd0, 0xdf, 0xf8, 0xd0, 0x80, 0x72, 0xb6, 0xd8, 0xf8, + 0x00, 0x00, 0x40, 0x00, 0x01, 0x30, 0xc8, 0xf8, 0x00, 0x00, 0xc4, 0xeb, + 0x04, 0x10, 0x06, 0xeb, 0x40, 0x11, 0xd1, 0xf8, 0xd8, 0x01, 0x00, 0x28, + 0x43, 0xd0, 0xc4, 0xeb, 0x04, 0x12, 0x06, 0xeb, 0x42, 0x12, 0x02, 0xf5, + 0xea, 0x74, 0x92, 0xf8, 0xd5, 0x31, 0x14, 0xf8, 0x02, 0x6b, 0x46, 0xea, + 0x03, 0x23, 0x26, 0x78, 0x64, 0x78, 0x46, 0xea, 0x04, 0x24, 0x43, 0xea, + 0x04, 0x44, 0x02, 0xf5, 0xe8, 0x73, 0x9c, 0x42, 0x1b, 0xd0, 0x54, 0xf8, + 0xc4, 0x6c, 0x1e, 0xb1, 0x96, 0xf8, 0x29, 0x60, 0xb6, 0x07, 0x26, 0xd1, + 0x14, 0xf8, 0x04, 0x6f, 0x67, 0x78, 0xa5, 0x78, 0xe4, 0x78, 0x46, 0xea, + 0x07, 0x26, 0x45, 0xea, 0x04, 0x24, 0x46, 0xea, 0x04, 0x44, 0xea, 0xe7, + 0x00, 0x20, 0x40, 0xf2, 0x8f, 0x11, 0xbd, 0xe8, 0xf0, 0x41, 0xf3, 0xf7, + 0x71, 0xba, 0xbd, 0xe8, 0xf0, 0x81, 0x01, 0xf5, 0xec, 0x75, 0x92, 0xf8, + 0x21, 0x10, 0x12, 0x4e, 0x02, 0x24, 0x00, 0x29, 0x08, 0xbf, 0x01, 0x24, + 0x72, 0x69, 0x21, 0x46, 0x90, 0x47, 0x28, 0x68, 0xf2, 0x68, 0x21, 0x46, + 0x90, 0x47, 0x00, 0x20, 0x28, 0x60, 0xd8, 0xf8, 0x00, 0x00, 0x0b, 0x4a, + 0x00, 0x21, 0x40, 0x08, 0xc8, 0xf8, 0x00, 0x00, 0xd8, 0xf8, 0x00, 0x00, + 0x80, 0xf3, 0x10, 0x88, 0x00, 0x20, 0xbd, 0xe8, 0xf0, 0x41, 0x00, 0xf0, + 0x81, 0xb8, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, 0x30, 0xb7, 0x08, 0x00, + 0x24, 0x36, 0x01, 0x00, 0x18, 0xb1, 0x08, 0x00, 0x65, 0x39, 0x03, 0x00, + 0x70, 0xb5, 0x00, 0xf5, 0xea, 0x73, 0x90, 0xf8, 0xd5, 0x21, 0x13, 0xf8, + 0x02, 0x4b, 0x44, 0xea, 0x02, 0x22, 0x1c, 0x78, 0x5b, 0x78, 0x44, 0xea, + 0x03, 0x23, 0x42, 0xea, 0x03, 0x43, 0x00, 0xf5, 0xe8, 0x72, 0x93, 0x42, + 0x24, 0xd0, 0xd0, 0xf8, 0xa0, 0x00, 0x89, 0x6a, 0x00, 0x24, 0x40, 0x7f, + 0x3e, 0x25, 0x00, 0x28, 0xe6, 0xb2, 0x04, 0xf1, 0x01, 0x04, 0x08, 0xbf, + 0x3c, 0x25, 0x00, 0x28, 0x5d, 0x5b, 0x21, 0xf8, 0x26, 0x50, 0x01, 0xeb, + 0x86, 0x05, 0x4f, 0xf0, 0x3c, 0x06, 0x08, 0xbf, 0x3e, 0x26, 0x9e, 0x5b, + 0x6e, 0x80, 0x5d, 0x79, 0x13, 0xf8, 0x04, 0x6f, 0x46, 0xea, 0x05, 0x25, + 0x9e, 0x78, 0xdb, 0x78, 0x46, 0xea, 0x03, 0x23, 0x45, 0xea, 0x03, 0x43, + 0x93, 0x42, 0xdf, 0xd1, 0x70, 0xbd, 0x4a, 0x79, 0x0a, 0xb1, 0x00, 0xf0, + 0x3f, 0xb8, 0x12, 0x20, 0x70, 0x47, 0x00, 0xbf, 0x09, 0x48, 0x0a, 0x49, + 0x0b, 0x4a, 0x0c, 0x4b, 0x13, 0x60, 0x01, 0x61, 0x08, 0x49, 0x0c, 0x4b, + 0x0a, 0x4a, 0xc0, 0xe9, 0x00, 0x31, 0x82, 0x60, 0x0a, 0x48, 0x0b, 0x49, + 0x01, 0x60, 0x0b, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x18, 0x0d, 0x01, 0x00, 0x6d, 0x34, 0x03, 0x00, 0x4d, 0x34, 0x03, 0x00, + 0x30, 0xb9, 0x08, 0x00, 0x89, 0x34, 0x03, 0x00, 0x3d, 0x37, 0x03, 0x00, + 0x09, 0x35, 0x03, 0x00, 0x08, 0xb9, 0x08, 0x00, 0x3d, 0x38, 0x03, 0x00, + 0x48, 0xb9, 0x08, 0x00, 0xaf, 0x38, 0x03, 0x00, 0x45, 0xf6, 0x25, 0x5c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf6, 0xd5, 0x5c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0x4d, 0x3c, + 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf6, 0xe9, 0x4c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x49, 0x53, 0x4f, 0x3a, + 0x20, 0x43, 0x56, 0x53, 0x44, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, + 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x6f, + 0x76, 0x65, 0x72, 0x20, 0x49, 0x53, 0x4f, 0x2e, 0x00, 0x73, 0x74, 0x6f, + 0x70, 0x56, 0x6f, 0x69, 0x63, 0x65, 0x00, 0x00, 0x70, 0xb5, 0x06, 0x46, + 0x12, 0x48, 0x0d, 0x46, 0x00, 0x21, 0x14, 0x46, 0x01, 0x60, 0x11, 0x48, + 0x01, 0x60, 0x22, 0xf0, 0x1b, 0xfa, 0x04, 0x2d, 0x12, 0xd8, 0x0f, 0x48, + 0x0f, 0x49, 0x40, 0x5d, 0x0a, 0x68, 0x40, 0x00, 0x22, 0xf0, 0x7f, 0x62, + 0xc0, 0xb2, 0x42, 0xea, 0x00, 0x52, 0x0a, 0x60, 0xd1, 0xf8, 0x90, 0x20, + 0x22, 0xf0, 0x7f, 0x62, 0x42, 0xea, 0x00, 0x50, 0xc1, 0xf8, 0x90, 0x00, + 0x30, 0x46, 0x29, 0x46, 0x22, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, + 0x17, 0xb9, 0x00, 0xbf, 0x10, 0xd6, 0x05, 0x30, 0x10, 0xee, 0x05, 0x30, + 0x75, 0x14, 0x01, 0x00, 0x00, 0xc2, 0x23, 0x40, 0x80, 0xb5, 0x00, 0xf0, + 0x11, 0xf9, 0x01, 0x28, 0x0c, 0xd1, 0x64, 0x49, 0x64, 0x4a, 0x5c, 0x23, + 0x09, 0x78, 0x11, 0xfb, 0x03, 0x21, 0x49, 0x78, 0x05, 0x29, 0x03, 0xd3, + 0x01, 0x20, 0x0a, 0x29, 0x38, 0xbf, 0x05, 0x20, 0x80, 0xbd, 0x00, 0xbf, + 0x80, 0xb5, 0x00, 0xf0, 0x03, 0xf9, 0x05, 0x48, 0x01, 0x68, 0x21, 0xf0, + 0x01, 0x01, 0x01, 0x60, 0x03, 0x48, 0x00, 0x21, 0xc0, 0xe9, 0x00, 0x11, + 0x80, 0xbd, 0x00, 0xbf, 0x5c, 0x11, 0x21, 0x40, 0x14, 0xe6, 0x05, 0x00, + 0xb0, 0xb5, 0x1c, 0x21, 0x04, 0x46, 0xef, 0xf7, 0x91, 0xfc, 0x13, 0x48, + 0x15, 0x4b, 0x00, 0x22, 0x00, 0x68, 0x60, 0x76, 0x11, 0x48, 0x00, 0x68, + 0xc0, 0xf3, 0x40, 0x00, 0x20, 0x76, 0x10, 0x48, 0x00, 0x68, 0x19, 0x68, + 0xc9, 0xb2, 0xc4, 0xe9, 0x01, 0x21, 0x19, 0xb1, 0x1d, 0x68, 0xc5, 0xf3, + 0x00, 0x65, 0x00, 0xe0, 0x00, 0x25, 0x25, 0x75, 0x1d, 0x6c, 0xed, 0xb2, + 0xc4, 0xe9, 0x03, 0x25, 0x15, 0xb1, 0x1a, 0x6c, 0xc2, 0xf3, 0x00, 0x62, + 0x00, 0x07, 0x62, 0x75, 0x03, 0xd5, 0xc8, 0x1c, 0xa0, 0x60, 0xe8, 0x1c, + 0x20, 0x61, 0xb0, 0xbd, 0x3c, 0x10, 0x21, 0x40, 0xf8, 0x95, 0x23, 0x40, + 0x54, 0x10, 0x21, 0x40, 0xa8, 0xc2, 0x23, 0x40, 0xb0, 0xb5, 0x1c, 0x21, + 0x04, 0x46, 0xef, 0xf7, 0x5d, 0xfc, 0x13, 0x48, 0x15, 0x4b, 0x00, 0x22, + 0x00, 0x68, 0x60, 0x76, 0x11, 0x48, 0x00, 0x68, 0xc0, 0xf3, 0x40, 0x00, + 0x20, 0x76, 0x10, 0x48, 0x00, 0x68, 0x19, 0x68, 0xc9, 0xb2, 0xc4, 0xe9, + 0x01, 0x21, 0x19, 0xb1, 0x1d, 0x68, 0xc5, 0xf3, 0x00, 0x65, 0x00, 0xe0, + 0x00, 0x25, 0x25, 0x75, 0x1d, 0x6c, 0xed, 0xb2, 0xc4, 0xe9, 0x03, 0x25, + 0x15, 0xb1, 0x1a, 0x6c, 0xc2, 0xf3, 0x00, 0x62, 0x00, 0x07, 0x62, 0x75, + 0x03, 0xd5, 0xc8, 0x1c, 0xa0, 0x60, 0xe8, 0x1c, 0x20, 0x61, 0xb0, 0xbd, + 0x8c, 0x10, 0x21, 0x40, 0xfc, 0x95, 0x23, 0x40, 0xa4, 0x10, 0x21, 0x40, + 0xc8, 0xc2, 0x23, 0x40, 0x10, 0xb5, 0x07, 0x4c, 0x72, 0xb6, 0x22, 0x68, + 0x52, 0x00, 0x01, 0x32, 0x22, 0x60, 0x00, 0xf0, 0x89, 0xf8, 0x20, 0x68, + 0x40, 0x08, 0x20, 0x60, 0x20, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x10, 0xbd, + 0x24, 0x36, 0x01, 0x00, 0x7c, 0xb5, 0x06, 0x9c, 0x24, 0x28, 0x0f, 0xd3, + 0x09, 0x4d, 0x6e, 0x7a, 0xf6, 0x07, 0x0b, 0xd0, 0x08, 0x4e, 0x06, 0x44, + 0x16, 0xf8, 0x24, 0x6c, 0x04, 0x2e, 0x28, 0xbf, 0x04, 0x26, 0x35, 0x44, + 0xad, 0x7a, 0x95, 0x42, 0x38, 0xbf, 0x2a, 0x46, 0x00, 0x94, 0x00, 0xf0, + 0x6f, 0xf8, 0x7c, 0xbd, 0xcc, 0x2c, 0x06, 0x00, 0x40, 0x0d, 0x01, 0x00, + 0x80, 0xb5, 0x08, 0x48, 0x08, 0x49, 0x5c, 0x22, 0x00, 0x78, 0x10, 0xfb, + 0x02, 0x10, 0x07, 0x49, 0x90, 0xf8, 0x52, 0x00, 0x0a, 0x68, 0x00, 0x21, + 0x90, 0x47, 0xbd, 0xe8, 0x80, 0x40, 0x00, 0xf0, 0x5f, 0xb8, 0x00, 0xbf, + 0x74, 0x87, 0x08, 0x00, 0x44, 0x4f, 0x01, 0x00, 0xbc, 0xfc, 0x08, 0x00, + 0x0c, 0x48, 0x0d, 0x49, 0x01, 0x60, 0x0d, 0x48, 0x0d, 0x49, 0x01, 0x60, + 0x0d, 0x48, 0x0e, 0x49, 0x01, 0x60, 0x0e, 0x48, 0x0e, 0x49, 0x01, 0x60, + 0x0e, 0x48, 0x0f, 0x49, 0x01, 0x60, 0x0f, 0x48, 0x0f, 0x49, 0x01, 0x60, + 0x0f, 0x48, 0x10, 0x49, 0x01, 0x60, 0x10, 0x48, 0x10, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x80, 0xb9, 0x08, 0x00, 0xd1, 0x39, 0x03, 0x00, + 0x20, 0xbe, 0x08, 0x00, 0x71, 0x39, 0x03, 0x00, 0xcc, 0xbc, 0x08, 0x00, + 0xf9, 0x39, 0x03, 0x00, 0x14, 0xbb, 0x08, 0x00, 0x1d, 0x3a, 0x03, 0x00, + 0xc4, 0xb7, 0x08, 0x00, 0x85, 0x3a, 0x03, 0x00, 0xac, 0xbe, 0x08, 0x00, + 0xed, 0x3a, 0x03, 0x00, 0x1c, 0xbe, 0x08, 0x00, 0x11, 0x3b, 0x03, 0x00, + 0x1c, 0xbb, 0x08, 0x00, 0x49, 0x3b, 0x03, 0x00, 0x48, 0xf2, 0x8f, 0x5c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x47, 0xf6, 0x7d, 0x4c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x46, 0xf2, 0xcd, 0x3c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf2, 0xd1, 0x1c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf2, 0x61, 0x4c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf2, 0x49, 0x7c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0xe0, 0xb5, 0x0b, 0x48, + 0x0b, 0x49, 0x00, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x01, 0xeb, 0xc0, 0x00, + 0x90, 0xf8, 0x84, 0x00, 0x01, 0x38, 0xb0, 0xfa, 0x80, 0xf0, 0x40, 0x09, + 0x8d, 0xf8, 0x04, 0x00, 0x05, 0x48, 0x01, 0x68, 0x01, 0xa8, 0x88, 0x47, + 0x04, 0x48, 0x00, 0x68, 0x80, 0x47, 0x8c, 0xbd, 0x74, 0x87, 0x08, 0x00, + 0xfc, 0x6d, 0x01, 0x00, 0x8c, 0xb7, 0x08, 0x00, 0x3c, 0xbd, 0x08, 0x00, + 0x2d, 0xe9, 0xfc, 0x47, 0xdf, 0xf8, 0xa4, 0x04, 0xd0, 0xe9, 0x00, 0x10, + 0xcd, 0xe9, 0x00, 0x10, 0x00, 0xf0, 0x7a, 0xfa, 0xc9, 0x4d, 0xdf, 0xf8, + 0x98, 0x14, 0xe8, 0x69, 0x08, 0x60, 0xa8, 0x69, 0x80, 0x05, 0x3f, 0xd4, + 0xa8, 0x68, 0x80, 0x07, 0x5a, 0xd4, 0xa8, 0x69, 0x40, 0x06, 0x14, 0xd5, + 0xdf, 0xf8, 0x80, 0x04, 0x6f, 0xf0, 0xfc, 0x21, 0x00, 0x78, 0x29, 0x60, + 0x40, 0x21, 0x29, 0x61, 0xdf, 0xf8, 0x74, 0x14, 0xc0, 0xeb, 0x40, 0x10, + 0x01, 0xeb, 0xc0, 0x00, 0x00, 0x21, 0xa0, 0xf8, 0xdc, 0x10, 0xe8, 0x69, + 0xb0, 0xf1, 0xff, 0x3f, 0x5d, 0xdc, 0xa8, 0x68, 0x40, 0xb2, 0xb0, 0xf1, + 0xff, 0x3f, 0x5a, 0xdc, 0xa8, 0x68, 0x80, 0x06, 0x57, 0xd4, 0x80, 0x20, + 0xd5, 0xf8, 0xe0, 0x20, 0x28, 0x60, 0xdf, 0xf8, 0x40, 0x04, 0x01, 0x78, + 0xc1, 0xeb, 0x41, 0x13, 0xdf, 0xf8, 0x38, 0x14, 0x01, 0xeb, 0xc3, 0x03, + 0xb3, 0xf8, 0xdc, 0x30, 0x5b, 0x06, 0x58, 0xbf, 0x5f, 0xea, 0xc2, 0x32, + 0x41, 0xd4, 0x00, 0x22, 0x45, 0xf8, 0x60, 0x2c, 0x00, 0x78, 0xc0, 0xeb, + 0x40, 0x10, 0x01, 0xeb, 0xc0, 0x00, 0x15, 0xe0, 0xdf, 0xf8, 0x0c, 0x04, + 0x4f, 0xf4, 0x00, 0x72, 0xdf, 0xf8, 0x08, 0x34, 0x01, 0x78, 0x2a, 0x61, + 0x00, 0x22, 0x45, 0xf8, 0x60, 0x2c, 0x00, 0x78, 0xc1, 0xeb, 0x41, 0x11, + 0x03, 0xeb, 0xc1, 0x01, 0xc0, 0xeb, 0x40, 0x10, 0xa1, 0xf8, 0xdc, 0x20, + 0x03, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x10, 0x41, 0xf0, 0x40, 0x01, + 0xa0, 0xf8, 0xdc, 0x10, 0xbd, 0xe8, 0xfc, 0x87, 0xdf, 0xf8, 0xd0, 0x43, + 0xdf, 0xf8, 0xd0, 0x63, 0x00, 0x27, 0x20, 0x78, 0xc0, 0xeb, 0x40, 0x10, + 0x06, 0xeb, 0xc0, 0x00, 0xa0, 0xf8, 0xdc, 0x70, 0xdf, 0xf8, 0xc0, 0x03, + 0x00, 0x68, 0x80, 0x47, 0x02, 0x20, 0x28, 0x60, 0x20, 0x78, 0xc0, 0xeb, + 0x40, 0x10, 0x06, 0xeb, 0xc0, 0x00, 0x00, 0x69, 0xc0, 0x68, 0x80, 0x47, + 0x70, 0xb3, 0xbd, 0xe8, 0xfc, 0x87, 0xdf, 0xf8, 0x98, 0x43, 0xdf, 0xf8, + 0x98, 0x93, 0x20, 0x78, 0xc0, 0xeb, 0x40, 0x11, 0x09, 0xeb, 0xc1, 0x02, + 0x32, 0xf8, 0xdc, 0x1f, 0xcb, 0x07, 0x10, 0xd0, 0x4b, 0x06, 0x0e, 0xd4, + 0xeb, 0x68, 0x03, 0xf0, 0xd0, 0x03, 0x10, 0x2b, 0x09, 0xd1, 0x41, 0xf0, + 0x18, 0x03, 0x13, 0x80, 0xee, 0x68, 0xb6, 0x05, 0x44, 0xbf, 0x41, 0xf0, + 0x38, 0x03, 0x13, 0x80, 0x00, 0xe0, 0x0b, 0x46, 0x00, 0xeb, 0x00, 0x10, + 0xd9, 0x07, 0x11, 0xd1, 0xd7, 0x49, 0x01, 0xeb, 0xc0, 0x00, 0x00, 0xf1, + 0x68, 0x01, 0xd7, 0x48, 0x02, 0x68, 0x68, 0x46, 0x90, 0x47, 0x27, 0xe0, + 0x45, 0xf8, 0x60, 0x7c, 0x20, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x06, 0xeb, + 0xc0, 0x00, 0xa5, 0xe7, 0xce, 0x49, 0x01, 0xeb, 0xc0, 0x00, 0xd5, 0xf8, + 0xc8, 0x10, 0xd5, 0xf8, 0xb0, 0x20, 0xd5, 0xf8, 0xcc, 0x30, 0xd5, 0xf8, + 0xb4, 0x60, 0xd5, 0xf8, 0xb8, 0x70, 0x89, 0x1a, 0x03, 0xf0, 0x0f, 0x02, + 0x40, 0xf8, 0x68, 0x7f, 0x42, 0xea, 0x01, 0x11, 0x06, 0xf0, 0x0f, 0x02, + 0xd5, 0xf8, 0xbc, 0x70, 0x89, 0x1a, 0xc3, 0x4a, 0x01, 0xf5, 0x16, 0x61, + 0x87, 0x80, 0x13, 0x68, 0x02, 0x46, 0x98, 0x47, 0xc1, 0x4f, 0xfe, 0xf7, + 0xa3, 0xfc, 0x20, 0xb1, 0xc0, 0x48, 0x00, 0x88, 0x40, 0xf0, 0xd4, 0x00, + 0x38, 0x60, 0x20, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x09, 0xeb, 0xc0, 0x00, + 0x00, 0x69, 0x00, 0x69, 0x80, 0x47, 0x21, 0x78, 0xdf, 0xf8, 0xe8, 0x82, + 0x5c, 0x22, 0x11, 0xfb, 0x02, 0x82, 0x92, 0xf8, 0x4d, 0x30, 0xeb, 0xb3, + 0x92, 0xf8, 0x4a, 0x00, 0x18, 0xb1, 0xb6, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x21, 0x78, 0xc1, 0xeb, 0x41, 0x10, 0x09, 0xeb, 0xc0, 0x00, 0x00, 0x69, + 0x80, 0x69, 0x80, 0x47, 0x00, 0x28, 0x00, 0xf0, 0x93, 0x80, 0xb0, 0x48, + 0xba, 0x46, 0x00, 0x68, 0x80, 0x47, 0x20, 0x78, 0xa6, 0x4f, 0x00, 0xeb, + 0x00, 0x10, 0x07, 0xeb, 0xc0, 0x00, 0x00, 0x69, 0x00, 0x68, 0x80, 0x47, + 0x21, 0x78, 0x5c, 0x26, 0x00, 0x20, 0x11, 0xfb, 0x06, 0x82, 0x82, 0xf8, + 0x4d, 0x00, 0x90, 0x6b, 0x28, 0xb1, 0xd1, 0x6b, 0xa5, 0x4a, 0x12, 0x68, + 0x52, 0x68, 0x90, 0x47, 0x21, 0x78, 0x11, 0xfb, 0x06, 0x80, 0x01, 0xeb, + 0x01, 0x11, 0xd0, 0xe9, 0x07, 0x20, 0x07, 0xeb, 0xc1, 0x01, 0x57, 0x46, + 0xc1, 0xe9, 0x1a, 0x20, 0x40, 0xf2, 0xff, 0x30, 0x28, 0x60, 0x9d, 0x48, + 0x28, 0x61, 0x06, 0xe0, 0x40, 0xf2, 0xff, 0x31, 0x00, 0x28, 0x29, 0x60, + 0x99, 0x49, 0x29, 0x61, 0x5a, 0xd0, 0x20, 0x78, 0x5c, 0x21, 0x10, 0xfb, + 0x01, 0x80, 0x90, 0xf8, 0x26, 0x00, 0x00, 0x28, 0x52, 0xd1, 0xe8, 0x69, + 0x40, 0x00, 0x4f, 0xd4, 0x93, 0x48, 0x00, 0x68, 0x80, 0x47, 0x93, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x26, 0x78, 0x92, 0x49, 0x92, 0x4a, 0x06, 0xeb, + 0x86, 0x00, 0x01, 0xeb, 0xc0, 0x00, 0xc1, 0x69, 0x11, 0x60, 0x28, 0x21, + 0xef, 0xf7, 0x0c, 0xfa, 0x06, 0xeb, 0x06, 0x10, 0x7f, 0x4e, 0x06, 0xeb, + 0xc0, 0x00, 0x00, 0x69, 0x40, 0x68, 0x80, 0x47, 0x00, 0x28, 0x00, 0xf0, + 0xbe, 0x80, 0x28, 0x6e, 0x00, 0xb2, 0x00, 0x28, 0x00, 0xf1, 0xb9, 0x80, + 0x86, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x85, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x20, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x09, 0xeb, 0xc0, 0x00, + 0x01, 0x69, 0x49, 0x69, 0x88, 0x47, 0xfe, 0xf7, 0x09, 0xfc, 0x20, 0xb1, + 0x73, 0x48, 0x00, 0x88, 0x40, 0xf0, 0xd6, 0x00, 0x38, 0x60, 0x20, 0x78, + 0x5c, 0x21, 0x10, 0xfb, 0x01, 0x80, 0xc0, 0x6a, 0x00, 0x28, 0x00, 0xf0, + 0xaf, 0x80, 0x80, 0x47, 0x00, 0x28, 0x00, 0xf0, 0xab, 0x80, 0x77, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x20, 0x78, 0x5c, 0x21, 0x01, 0x22, 0x10, 0xfb, + 0x01, 0x81, 0x81, 0xf8, 0x4d, 0x20, 0xa3, 0xe0, 0x07, 0xe0, 0x00, 0xbf, + 0xd0, 0x10, 0x21, 0x40, 0x40, 0xf2, 0xff, 0x30, 0x28, 0x60, 0x67, 0x48, + 0x28, 0x61, 0x00, 0x20, 0x45, 0xf8, 0xb0, 0x0c, 0x5c, 0x20, 0x25, 0x78, + 0x15, 0xfb, 0x00, 0x80, 0x90, 0xf8, 0x27, 0x10, 0x01, 0x29, 0x4d, 0xd1, + 0x01, 0x21, 0x80, 0xf8, 0x4d, 0x10, 0xfe, 0xf7, 0xd3, 0xfb, 0x28, 0xb1, + 0x58, 0x48, 0x00, 0x88, 0x40, 0xf0, 0xd7, 0x00, 0x38, 0x60, 0x25, 0x78, + 0xc5, 0xeb, 0x45, 0x10, 0x09, 0xeb, 0xc0, 0x00, 0x00, 0x69, 0x80, 0x69, + 0x80, 0x47, 0xc8, 0xb3, 0x00, 0xf0, 0xec, 0xf8, 0xfe, 0xf7, 0xc0, 0xfb, + 0x20, 0xb1, 0x4f, 0x48, 0x00, 0x88, 0x40, 0xf0, 0xd8, 0x00, 0x38, 0x60, + 0x4f, 0x48, 0x00, 0x68, 0x80, 0x47, 0x20, 0x78, 0x46, 0x4d, 0x00, 0xeb, + 0x00, 0x10, 0x05, 0xeb, 0xc0, 0x00, 0x00, 0x69, 0x00, 0x68, 0x80, 0x47, + 0x20, 0x78, 0x00, 0xeb, 0x00, 0x11, 0x05, 0xeb, 0xc1, 0x01, 0x91, 0xf8, + 0x49, 0x10, 0x01, 0xf0, 0xfe, 0x01, 0x60, 0x29, 0x05, 0xd0, 0x00, 0x20, + 0x4f, 0xf4, 0xee, 0x71, 0xf2, 0xf7, 0x3c, 0xfe, 0x20, 0x78, 0x00, 0xeb, + 0x00, 0x10, 0x01, 0x21, 0x05, 0xeb, 0xc0, 0x00, 0x80, 0xf8, 0x48, 0x10, + 0xfe, 0xf7, 0x94, 0xfb, 0x20, 0xb1, 0x39, 0x48, 0x00, 0x88, 0x40, 0xf0, + 0x81, 0x00, 0x38, 0x60, 0x00, 0xf0, 0xc8, 0xf8, 0xbd, 0xe8, 0xfc, 0x87, + 0xfe, 0xf7, 0x88, 0xfb, 0x20, 0xb1, 0x33, 0x48, 0x00, 0x88, 0x40, 0xf0, + 0xd5, 0x00, 0x38, 0x60, 0x20, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x09, 0xeb, + 0xc0, 0x00, 0x01, 0x69, 0x49, 0x69, 0x88, 0x47, 0x24, 0x78, 0x28, 0x4a, + 0xc4, 0xeb, 0x44, 0x10, 0x04, 0xeb, 0x04, 0x11, 0x02, 0xeb, 0xc1, 0x01, + 0x09, 0xeb, 0xc0, 0x00, 0x88, 0x22, 0x00, 0xf0, 0x8b, 0xff, 0x5c, 0x20, + 0x14, 0xfb, 0x00, 0x80, 0x90, 0xf8, 0x4d, 0x00, 0xb0, 0xfa, 0x80, 0xf0, + 0x40, 0x09, 0x00, 0xf0, 0xb1, 0xf8, 0xbd, 0xe8, 0xfc, 0x87, 0x28, 0x6e, + 0x00, 0xb2, 0xb0, 0xf1, 0xff, 0x3f, 0x3f, 0xf7, 0x78, 0xaf, 0x20, 0x78, + 0x00, 0xeb, 0x00, 0x10, 0x06, 0xeb, 0xc0, 0x00, 0xc0, 0x68, 0x00, 0x28, + 0x3f, 0xf4, 0x6f, 0xaf, 0xb0, 0xf8, 0xb4, 0x10, 0x01, 0x31, 0xa0, 0xf8, + 0xb4, 0x10, 0x68, 0xe7, 0x22, 0x48, 0x00, 0x68, 0x80, 0x47, 0x20, 0x78, + 0x5c, 0x25, 0x00, 0x26, 0x10, 0xfb, 0x05, 0x80, 0xc6, 0x62, 0x00, 0xf0, + 0x4b, 0xf8, 0x20, 0x78, 0x10, 0xfb, 0x05, 0x80, 0x00, 0x6b, 0x00, 0x28, + 0x3f, 0xf4, 0x3d, 0xae, 0x80, 0x47, 0x20, 0x78, 0x10, 0xfb, 0x05, 0x80, + 0x06, 0x63, 0xbd, 0xe8, 0xfc, 0x87, 0x00, 0xbf, 0x2c, 0x50, 0x03, 0x00, + 0x40, 0x36, 0x01, 0x00, 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0x8c, 0xa1, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, 0x5c, 0xa1, 0x08, 0x00, + 0x54, 0xa1, 0x08, 0x00, 0x04, 0x08, 0x00, 0x40, 0x26, 0x21, 0x01, 0x00, + 0x44, 0x4f, 0x01, 0x00, 0x88, 0xa1, 0x08, 0x00, 0x74, 0xa1, 0x08, 0x00, + 0xe4, 0x35, 0x01, 0x00, 0xf3, 0xf3, 0xff, 0x1f, 0x70, 0xa1, 0x08, 0x00, + 0x68, 0xa1, 0x08, 0x00, 0x84, 0x71, 0x01, 0x00, 0x0c, 0x36, 0x01, 0x00, + 0xf8, 0xa0, 0x08, 0x00, 0x94, 0xa1, 0x08, 0x00, 0x28, 0xbd, 0x08, 0x00, + 0x50, 0xbd, 0x08, 0x00, 0x04, 0x48, 0x00, 0x68, 0x00, 0xf0, 0x1f, 0x00, + 0x1f, 0x28, 0x18, 0xbf, 0x70, 0x47, 0x02, 0x48, 0x00, 0x68, 0x00, 0x47, + 0x00, 0x1b, 0x21, 0x40, 0x90, 0xa1, 0x08, 0x00, 0x10, 0xb5, 0xbb, 0x48, + 0x0d, 0x49, 0x04, 0x78, 0x0b, 0x48, 0x00, 0x68, 0x41, 0xf8, 0x24, 0x00, + 0xfe, 0xf7, 0xec, 0xfa, 0x70, 0xb1, 0xba, 0x48, 0x5c, 0x21, 0x14, 0xfb, + 0x01, 0x00, 0xe1, 0x21, 0x90, 0xf8, 0x4e, 0x00, 0x00, 0x28, 0xbf, 0x48, + 0x08, 0xbf, 0xe2, 0x21, 0x00, 0x88, 0x08, 0x43, 0xbd, 0x49, 0x08, 0x60, + 0x10, 0xbd, 0x00, 0xbf, 0xc0, 0xbe, 0x08, 0x00, 0xc0, 0x5d, 0x01, 0x00, + 0xb0, 0xb5, 0xab, 0x48, 0x5c, 0x21, 0x05, 0x78, 0xad, 0x48, 0x15, 0xfb, + 0x01, 0x04, 0x5c, 0x21, 0x20, 0x46, 0xef, 0xf7, 0xad, 0xf8, 0xb0, 0x48, + 0x90, 0xf8, 0xc9, 0x01, 0x68, 0x40, 0x84, 0xf8, 0x52, 0x00, 0xb0, 0xbd, + 0xa2, 0x48, 0xa3, 0x49, 0x00, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x01, 0xeb, + 0xc0, 0x00, 0x04, 0x49, 0x90, 0xf8, 0x49, 0x00, 0xc0, 0xf3, 0x42, 0x10, + 0x51, 0xf8, 0x20, 0x00, 0x00, 0x47, 0x00, 0xbf, 0xb8, 0xe6, 0x08, 0x00, + 0x10, 0xb5, 0x04, 0x46, 0xfe, 0xf7, 0xae, 0xfa, 0x28, 0xb1, 0xa4, 0x48, + 0xa4, 0x49, 0x00, 0x88, 0x40, 0xf0, 0xe3, 0x00, 0x08, 0x60, 0x03, 0x48, + 0x01, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x08, 0x47, 0x00, 0xbf, + 0x0c, 0xa1, 0x08, 0x00, 0xb0, 0xb5, 0x8f, 0x4c, 0x29, 0x4d, 0x20, 0x78, + 0x00, 0xeb, 0x80, 0x01, 0x05, 0xeb, 0x41, 0x11, 0x89, 0x6d, 0x6f, 0xf3, + 0x9f, 0x51, 0x79, 0xb1, 0x25, 0x4a, 0x04, 0x32, 0x91, 0x42, 0x03, 0xd0, + 0x08, 0x1f, 0xf2, 0xf7, 0x47, 0xfd, 0x20, 0x78, 0x00, 0xeb, 0x80, 0x00, + 0x00, 0x21, 0x05, 0xeb, 0x40, 0x10, 0x80, 0xf8, 0x9c, 0x10, 0x81, 0x65, + 0x00, 0xf0, 0xa4, 0xfe, 0x0a, 0x48, 0x01, 0x68, 0x2d, 0x20, 0x88, 0x47, + 0x70, 0xb1, 0x21, 0x78, 0x01, 0x22, 0x04, 0x30, 0x29, 0x23, 0x63, 0xf3, + 0x9f, 0x50, 0x01, 0xeb, 0x81, 0x01, 0x05, 0xeb, 0x41, 0x11, 0x81, 0xf8, + 0x9c, 0x20, 0x00, 0x22, 0xc1, 0xe9, 0x16, 0x02, 0xb0, 0xbd, 0x00, 0xbf, + 0xd4, 0x9b, 0x08, 0x00, 0xb0, 0xb5, 0x74, 0x4d, 0x0e, 0x4c, 0x28, 0x78, + 0x00, 0xeb, 0x80, 0x01, 0x04, 0xeb, 0x41, 0x11, 0x89, 0x6d, 0x6f, 0xf3, + 0x9f, 0x51, 0x79, 0xb1, 0x0a, 0x4a, 0x04, 0x32, 0x91, 0x42, 0x03, 0xd0, + 0x08, 0x1f, 0xf2, 0xf7, 0x11, 0xfd, 0x28, 0x78, 0x00, 0xeb, 0x80, 0x00, + 0x00, 0x21, 0x04, 0xeb, 0x40, 0x10, 0x80, 0xf8, 0x9c, 0x10, 0x81, 0x65, + 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x72, 0xbe, 0xbc, 0x65, 0x01, 0x00, + 0x4c, 0x51, 0x01, 0x00, 0x80, 0x48, 0x01, 0x68, 0x41, 0xf0, 0x01, 0x01, + 0x01, 0x60, 0x00, 0xf0, 0x6d, 0xbe, 0x00, 0xbf, 0x2d, 0xe9, 0xf0, 0x4f, + 0x8d, 0xb0, 0x5b, 0x4c, 0x20, 0x78, 0x08, 0x28, 0x05, 0xd1, 0x6a, 0x48, + 0x00, 0x68, 0x0d, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0x00, 0x47, 0x57, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x56, 0x48, 0x57, 0x49, 0x00, 0x78, 0x00, 0xeb, + 0x00, 0x10, 0x01, 0xeb, 0xc0, 0x00, 0x00, 0x69, 0x00, 0x68, 0x80, 0x47, + 0x70, 0x48, 0x00, 0x68, 0x38, 0xb1, 0x70, 0x49, 0x0a, 0x68, 0x01, 0x32, + 0x0a, 0x60, 0x82, 0x42, 0x04, 0xbf, 0x08, 0x20, 0x20, 0x70, 0x4e, 0x4d, + 0x40, 0xf2, 0xff, 0x30, 0x5c, 0x22, 0x4e, 0x4b, 0x28, 0x60, 0x4c, 0x48, + 0x28, 0x61, 0x48, 0x48, 0x00, 0x78, 0x10, 0xfb, 0x02, 0xf1, 0x5c, 0x5c, + 0x02, 0x21, 0x05, 0x2c, 0x03, 0xd3, 0x02, 0x21, 0x0a, 0x2c, 0x38, 0xbf, + 0x03, 0x21, 0x10, 0xfb, 0x02, 0x30, 0x46, 0x4a, 0x05, 0x91, 0x90, 0xf8, + 0x4f, 0x00, 0x12, 0x68, 0x90, 0x47, 0x47, 0x4c, 0x04, 0x90, 0x06, 0xa8, + 0xdf, 0xf8, 0x08, 0xa1, 0xdf, 0xf8, 0x08, 0x91, 0x42, 0x4f, 0x40, 0xf2, + 0x71, 0x28, 0x4f, 0xf0, 0x00, 0x0b, 0x02, 0x30, 0xa6, 0x1c, 0x03, 0x90, + 0xd9, 0xf8, 0x00, 0x20, 0xda, 0xf8, 0x00, 0x30, 0xb2, 0xf8, 0x68, 0x10, + 0x92, 0xf8, 0x8b, 0x00, 0x92, 0xf8, 0x9c, 0x20, 0x98, 0x47, 0x55, 0xf8, + 0xac, 0x1c, 0x08, 0x44, 0xd9, 0xf8, 0x00, 0x10, 0x91, 0xf8, 0xc0, 0x10, + 0x11, 0xfb, 0x08, 0x00, 0x45, 0xf8, 0xac, 0x0c, 0xc5, 0xf8, 0x74, 0xb0, + 0x00, 0x20, 0x39, 0x68, 0x88, 0x47, 0x20, 0x78, 0xf0, 0xb1, 0x32, 0x48, + 0x90, 0xf8, 0xca, 0x01, 0x02, 0x28, 0x19, 0xd1, 0x03, 0x98, 0x31, 0x46, + 0x0a, 0x22, 0x00, 0xf0, 0xfb, 0xfd, 0xf0, 0x48, 0xf0, 0x4a, 0x5c, 0x21, + 0x01, 0x23, 0x8d, 0xf8, 0x24, 0xb0, 0x8d, 0xf8, 0x19, 0x30, 0x00, 0x78, + 0x10, 0xfb, 0x01, 0x20, 0x90, 0xf8, 0x4f, 0x20, 0x02, 0x20, 0xcd, 0xe9, + 0x00, 0x03, 0x06, 0xa8, 0xdd, 0xe9, 0x04, 0x13, 0x27, 0xf0, 0x66, 0xfd, + 0x28, 0x6e, 0x00, 0xb2, 0x00, 0x28, 0xbf, 0xd4, 0x21, 0x48, 0x00, 0x68, + 0x80, 0x47, 0xe2, 0x4d, 0xeb, 0x49, 0xec, 0x4a, 0x2c, 0x78, 0x04, 0xeb, + 0x84, 0x00, 0x01, 0xeb, 0xc0, 0x00, 0xc1, 0x69, 0x11, 0x60, 0x28, 0x21, + 0xee, 0xf7, 0x7e, 0xff, 0xdd, 0x49, 0x04, 0xeb, 0x04, 0x10, 0x01, 0xeb, + 0xc0, 0x00, 0x00, 0x69, 0x40, 0x68, 0x80, 0x47, 0x28, 0x78, 0xf8, 0x49, + 0x15, 0x4a, 0x41, 0xf8, 0x20, 0x20, 0xfe, 0xf7, 0x8d, 0xf9, 0x28, 0xb1, + 0x13, 0x48, 0x14, 0x49, 0x00, 0x88, 0x40, 0xf0, 0xe7, 0x00, 0x08, 0x60, + 0x0d, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0xbf, 0x61, 0x34, 0x01, 0x00, + 0x74, 0xa1, 0x08, 0x00, 0x74, 0x87, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, + 0xd0, 0x10, 0x21, 0x40, 0xf3, 0xf3, 0xff, 0x1f, 0x44, 0x4f, 0x01, 0x00, + 0x38, 0x9c, 0x08, 0x00, 0xdc, 0xbc, 0x08, 0x00, 0xf8, 0x35, 0x01, 0x00, + 0xb8, 0xbe, 0x08, 0x00, 0x58, 0xf0, 0x05, 0x00, 0x00, 0x69, 0x08, 0x00, + 0x4c, 0xbd, 0x08, 0x00, 0x35, 0x3c, 0x03, 0x00, 0x26, 0x21, 0x01, 0x00, + 0x04, 0x08, 0x00, 0x40, 0x48, 0xbd, 0x08, 0x00, 0x10, 0xb5, 0x0d, 0x48, + 0x01, 0x68, 0x21, 0xf0, 0x01, 0x01, 0x01, 0x60, 0x0b, 0x48, 0x00, 0x68, + 0x68, 0xb1, 0x0b, 0x49, 0x09, 0x68, 0x81, 0x42, 0x09, 0xd1, 0x0a, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x09, 0x4c, 0x20, 0x68, 0x18, 0xb1, 0xf2, 0xf7, + 0x05, 0xfc, 0x00, 0x20, 0x20, 0x60, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, + 0x7f, 0xbd, 0x00, 0xbf, 0x5c, 0x11, 0x21, 0x40, 0x7c, 0x51, 0x01, 0x00, + 0x44, 0x36, 0x01, 0x00, 0x14, 0x8f, 0x08, 0x00, 0x04, 0x36, 0x01, 0x00, + 0x2d, 0xe9, 0xfe, 0x4f, 0xf0, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, + 0xa5, 0x48, 0x41, 0xf2, 0x01, 0x01, 0xdf, 0xf8, 0x94, 0xa2, 0xdf, 0xf8, + 0x94, 0x82, 0xa5, 0x4f, 0x01, 0x60, 0x5c, 0x20, 0x9a, 0xf8, 0x00, 0x10, + 0x11, 0xfb, 0x00, 0x80, 0x01, 0xeb, 0x01, 0x11, 0x50, 0xf8, 0x1c, 0x2f, + 0x07, 0xeb, 0xc1, 0x01, 0x43, 0x68, 0xc1, 0xe9, 0x1a, 0x23, 0x9e, 0x49, + 0x0a, 0x68, 0x01, 0xa9, 0x90, 0x47, 0x9d, 0x4e, 0x01, 0x98, 0x30, 0x60, + 0x9d, 0xf8, 0x08, 0x00, 0x70, 0x60, 0x4f, 0xf4, 0xd1, 0x70, 0xc6, 0xf8, + 0xb0, 0x00, 0x99, 0x48, 0xc6, 0xf8, 0xc0, 0x00, 0x98, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x98, 0x48, 0x00, 0x68, 0x00, 0xb1, 0x80, 0x47, 0x97, 0x48, + 0x4f, 0xf0, 0x00, 0x0b, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0x95, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x9a, 0xf8, 0x00, 0x40, 0xdf, 0xf8, 0x4c, 0x92, + 0x93, 0x4a, 0x04, 0xeb, 0x84, 0x00, 0x09, 0xeb, 0xc0, 0x00, 0xc1, 0x69, + 0x11, 0x60, 0x28, 0x21, 0xee, 0xf7, 0xce, 0xfe, 0x04, 0xeb, 0x04, 0x10, + 0x07, 0xeb, 0xc0, 0x00, 0x00, 0x69, 0x40, 0x68, 0x80, 0x47, 0x9a, 0xf8, + 0x00, 0x50, 0x04, 0x46, 0x05, 0xeb, 0x05, 0x10, 0x07, 0xeb, 0xc0, 0x00, + 0x10, 0xf8, 0x48, 0x1f, 0xa1, 0xb1, 0x80, 0xf8, 0x00, 0xb0, 0xfe, 0xf7, + 0xd7, 0xf8, 0x38, 0xb1, 0xc6, 0x48, 0xc7, 0x49, 0x00, 0x88, 0x40, 0xf0, + 0xd5, 0x00, 0x08, 0x60, 0x9a, 0xf8, 0x00, 0x50, 0xbd, 0x49, 0xc5, 0xeb, + 0x45, 0x10, 0x01, 0xeb, 0xc0, 0x00, 0x01, 0x69, 0x49, 0x69, 0x88, 0x47, + 0x00, 0x2c, 0x54, 0xd0, 0xd6, 0xf8, 0x0c, 0x01, 0x00, 0xb2, 0x00, 0x28, + 0x4f, 0xd4, 0x79, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x28, 0x4a, 0xd0, + 0x9a, 0xf8, 0x00, 0x10, 0x01, 0xeb, 0x01, 0x12, 0x07, 0xeb, 0xc2, 0x00, + 0x57, 0xf8, 0x32, 0x20, 0x00, 0x2a, 0x00, 0xf0, 0xbd, 0x80, 0x5c, 0x22, + 0x73, 0x4b, 0x74, 0x4c, 0x00, 0x90, 0x11, 0xfb, 0x02, 0xf2, 0x01, 0xeb, + 0x81, 0x01, 0x18, 0xf8, 0x02, 0x20, 0x09, 0xeb, 0xc1, 0x01, 0x49, 0x89, + 0x33, 0xf8, 0x12, 0x30, 0xa2, 0x5c, 0x01, 0xfb, 0x02, 0x31, 0x6d, 0x4a, + 0x03, 0x6a, 0x00, 0x20, 0x11, 0x80, 0x96, 0x22, 0x12, 0xfa, 0x81, 0xf1, + 0x6a, 0x4a, 0x11, 0x60, 0xa3, 0x49, 0x04, 0x22, 0x0c, 0x68, 0x00, 0x21, + 0xa0, 0x47, 0x9a, 0xf8, 0x00, 0x10, 0x5c, 0x24, 0x11, 0xfb, 0x04, 0x80, + 0xc0, 0x78, 0x10, 0xb9, 0x64, 0x48, 0x00, 0x68, 0x80, 0x47, 0xff, 0xf7, + 0x8d, 0xfd, 0x63, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x9a, 0xf8, + 0x00, 0x00, 0x10, 0xfb, 0x04, 0x80, 0x00, 0x6b, 0x38, 0xb1, 0x80, 0x47, + 0x9a, 0xf8, 0x00, 0x00, 0x5c, 0x21, 0x10, 0xfb, 0x01, 0x80, 0x00, 0x21, + 0x01, 0x63, 0xbd, 0xe8, 0xfe, 0x8f, 0x9a, 0xf8, 0x00, 0x40, 0x8d, 0x49, + 0x88, 0x22, 0xc4, 0xeb, 0x44, 0x10, 0x01, 0xeb, 0xc0, 0x00, 0x04, 0xeb, + 0x04, 0x11, 0x07, 0xeb, 0xc1, 0x01, 0x00, 0xf0, 0x7f, 0xfc, 0xd6, 0xf8, + 0x0c, 0x01, 0x00, 0xb2, 0xb0, 0xf1, 0xff, 0x3f, 0x2f, 0xdd, 0x47, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x00, 0x28, 0x5e, 0xd1, 0x9a, 0xf8, 0x00, 0x00, + 0x00, 0xeb, 0x00, 0x11, 0x07, 0xeb, 0xc1, 0x01, 0xc9, 0x68, 0x69, 0xb1, + 0xd1, 0xf8, 0x20, 0x22, 0x52, 0xb1, 0x91, 0xf8, 0x2b, 0x02, 0x02, 0xeb, + 0x40, 0x00, 0x02, 0x22, 0x41, 0x78, 0x62, 0xf3, 0x1f, 0x11, 0x41, 0x70, + 0x9a, 0xf8, 0x00, 0x00, 0x00, 0xeb, 0x80, 0x00, 0x09, 0xeb, 0xc0, 0x00, + 0xc1, 0x69, 0x41, 0xf4, 0x00, 0x21, 0xc1, 0x61, 0x00, 0xf0, 0x80, 0xf8, + 0x3d, 0x48, 0x00, 0x22, 0x03, 0x68, 0x3d, 0x48, 0x00, 0x68, 0x00, 0xf1, + 0x19, 0x01, 0x00, 0x20, 0x98, 0x47, 0xbd, 0xe8, 0xfe, 0x8f, 0xfe, 0xf7, + 0x29, 0xf8, 0x38, 0xb1, 0x6f, 0x48, 0x70, 0x49, 0x00, 0x88, 0x40, 0xf0, + 0xe4, 0x00, 0x08, 0x60, 0x9a, 0xf8, 0x00, 0x40, 0x04, 0xeb, 0x04, 0x10, + 0x57, 0xf8, 0x30, 0x10, 0x07, 0xeb, 0xc0, 0x00, 0x99, 0xb1, 0xd1, 0xf8, + 0xcc, 0x21, 0x22, 0xf0, 0x0f, 0x02, 0xc1, 0xf8, 0xcc, 0x21, 0x01, 0x68, + 0xd1, 0xf8, 0xcc, 0x21, 0x42, 0xf0, 0x06, 0x02, 0xc1, 0xf8, 0xcc, 0x21, + 0x01, 0x68, 0x21, 0xb1, 0x91, 0xf8, 0x6e, 0x21, 0x01, 0x32, 0x81, 0xf8, + 0x6e, 0x21, 0xc0, 0x68, 0x58, 0xb1, 0xd0, 0xf8, 0x20, 0x12, 0x41, 0xb1, + 0x90, 0xf8, 0x2b, 0x02, 0x01, 0x22, 0x01, 0xeb, 0x40, 0x00, 0x41, 0x78, + 0x62, 0xf3, 0x1f, 0x11, 0x41, 0x70, 0x01, 0x20, 0xff, 0xf7, 0x42, 0xfd, + 0xbd, 0xe8, 0xfe, 0x8f, 0x13, 0x4b, 0x02, 0x69, 0x1b, 0x68, 0x93, 0x42, + 0x3f, 0xf4, 0x3d, 0xaf, 0x11, 0x4b, 0x1b, 0x68, 0x93, 0x42, 0x7f, 0xf4, + 0x5a, 0xaf, 0x36, 0xe7, 0x40, 0x22, 0x00, 0x40, 0x74, 0x87, 0x08, 0x00, + 0x44, 0x4f, 0x01, 0x00, 0xfc, 0x6d, 0x01, 0x00, 0x58, 0xa1, 0x08, 0x00, + 0x24, 0x10, 0x21, 0x40, 0x40, 0x42, 0x13, 0x01, 0x70, 0xa1, 0x08, 0x00, + 0x14, 0xe6, 0x05, 0x00, 0xb8, 0xbe, 0x08, 0x00, 0x68, 0xa1, 0x08, 0x00, + 0x84, 0x71, 0x01, 0x00, 0x0c, 0x36, 0x01, 0x00, 0x94, 0xb7, 0x08, 0x00, + 0xe4, 0xbc, 0x08, 0x00, 0xf0, 0xbc, 0x08, 0x00, 0xb0, 0x31, 0x0a, 0x10, + 0xc4, 0x31, 0x0a, 0x10, 0x22, 0x21, 0x01, 0x00, 0x38, 0x36, 0x01, 0x00, + 0x50, 0xbd, 0x08, 0x00, 0x90, 0xb7, 0x08, 0x00, 0xdc, 0xa0, 0x08, 0x00, + 0x24, 0x20, 0x00, 0x40, 0x80, 0xb5, 0x72, 0x48, 0x07, 0x49, 0x08, 0x4a, + 0x00, 0x78, 0x09, 0x68, 0x42, 0xf8, 0x20, 0x10, 0xfd, 0xf7, 0xac, 0xff, + 0x28, 0xb1, 0x31, 0x48, 0x31, 0x49, 0x00, 0x88, 0x40, 0xf0, 0xe3, 0x00, + 0x08, 0x60, 0x80, 0xbd, 0x38, 0xbd, 0x08, 0x00, 0xc0, 0x5d, 0x01, 0x00, + 0xbc, 0xb5, 0x04, 0x46, 0x24, 0x48, 0x00, 0x25, 0x01, 0x68, 0x00, 0x20, + 0x88, 0x47, 0x66, 0x48, 0x05, 0x60, 0xc7, 0x48, 0x05, 0x60, 0x8c, 0xb1, + 0x61, 0x48, 0x20, 0x49, 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x01, 0xeb, + 0xc0, 0x00, 0x00, 0x69, 0x80, 0x69, 0x80, 0x47, 0x04, 0x46, 0xff, 0xf7, + 0xb1, 0xfc, 0x60, 0x48, 0xc0, 0xe9, 0x00, 0x55, 0x5c, 0xb9, 0x04, 0xe0, + 0xff, 0xf7, 0xaa, 0xfc, 0x5c, 0x48, 0xc0, 0xe9, 0x00, 0x55, 0x16, 0x48, + 0xc8, 0x21, 0x02, 0x68, 0x4f, 0xf0, 0xff, 0x30, 0x90, 0x47, 0xff, 0xf7, + 0x71, 0xfc, 0x13, 0x48, 0x00, 0x68, 0x80, 0x47, 0x50, 0x48, 0x53, 0x49, + 0x01, 0x22, 0x00, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x01, 0xeb, 0xc0, 0x00, + 0x0e, 0x49, 0x03, 0x6a, 0x0c, 0x68, 0x00, 0x90, 0x00, 0x20, 0x02, 0x21, + 0xa0, 0x47, 0x0c, 0x48, 0x00, 0x68, 0x80, 0x47, 0xfd, 0xf7, 0x5e, 0xff, + 0x28, 0xb1, 0x0a, 0x48, 0x0a, 0x49, 0x00, 0x88, 0x40, 0xf0, 0x81, 0x00, + 0x08, 0x60, 0xbd, 0xe8, 0xbc, 0x40, 0x8f, 0xe4, 0xf8, 0xa0, 0x08, 0x00, + 0x0c, 0x6f, 0x01, 0x00, 0xcc, 0xa0, 0x08, 0x00, 0x6c, 0xbb, 0x08, 0x00, + 0xf0, 0xa0, 0x08, 0x00, 0xd0, 0xa0, 0x08, 0x00, 0x26, 0x21, 0x01, 0x00, + 0x04, 0x08, 0x00, 0x40, 0x2d, 0xe9, 0xf8, 0x43, 0xdf, 0xf8, 0xe0, 0x80, + 0x5c, 0x23, 0xdf, 0xf8, 0xe0, 0x90, 0x98, 0xf8, 0x00, 0x20, 0x12, 0xfb, + 0x03, 0xf1, 0x19, 0xf8, 0x01, 0x40, 0x02, 0x21, 0x05, 0x2c, 0x02, 0xd3, + 0x0a, 0x2c, 0x38, 0xbf, 0x03, 0x21, 0x12, 0xfb, 0x03, 0x93, 0x00, 0x28, + 0x93, 0xf8, 0x27, 0x50, 0x93, 0xf8, 0x4b, 0x60, 0x96, 0x4b, 0x53, 0xf8, + 0x25, 0xc0, 0x94, 0x4d, 0x55, 0xf8, 0x26, 0x70, 0x91, 0x4d, 0x2b, 0x4e, + 0x55, 0xf8, 0x34, 0x40, 0x18, 0xbf, 0x01, 0x20, 0x08, 0xd0, 0x00, 0x25, + 0xb5, 0xf5, 0xc8, 0x5f, 0x04, 0xd0, 0xd6, 0xf8, 0xe0, 0x3a, 0x01, 0x35, + 0x9b, 0x04, 0xf7, 0xd4, 0x5c, 0x25, 0x00, 0x28, 0x23, 0x4b, 0x12, 0xfb, + 0x05, 0x92, 0x52, 0x68, 0x72, 0x61, 0x4f, 0xf0, 0x21, 0x02, 0x18, 0xbf, + 0x46, 0xf2, 0x31, 0x02, 0x44, 0xea, 0x02, 0x00, 0x38, 0x43, 0x40, 0xea, + 0x0c, 0x00, 0x30, 0x60, 0x98, 0xf8, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x12, + 0x53, 0xf8, 0x32, 0x20, 0x1a, 0xb1, 0x92, 0xf8, 0x24, 0x21, 0x0a, 0x2a, + 0x07, 0xd0, 0x17, 0x4a, 0x10, 0xfb, 0x05, 0x90, 0x90, 0xf8, 0x4f, 0x00, + 0x13, 0x68, 0x02, 0x22, 0x98, 0x47, 0x14, 0x48, 0x00, 0x79, 0x50, 0xb9, + 0x98, 0xf8, 0x00, 0x00, 0x5c, 0x21, 0x10, 0xfb, 0x01, 0x90, 0x11, 0x49, + 0x90, 0xf8, 0x52, 0x00, 0x0a, 0x68, 0x01, 0x21, 0x90, 0x47, 0x98, 0xf8, + 0x00, 0x00, 0x5c, 0x21, 0x10, 0xfb, 0x01, 0xf0, 0x0c, 0x49, 0x19, 0xf8, + 0x00, 0x00, 0x09, 0x68, 0x88, 0x47, 0x00, 0x20, 0xc6, 0xf8, 0x98, 0x02, + 0xc6, 0xf8, 0xcc, 0x02, 0xbd, 0xe8, 0xf8, 0x83, 0x74, 0x87, 0x08, 0x00, + 0x44, 0x4f, 0x01, 0x00, 0x20, 0x10, 0x21, 0x40, 0xfc, 0x6d, 0x01, 0x00, + 0x6c, 0xa1, 0x08, 0x00, 0x14, 0xe6, 0x05, 0x00, 0x2c, 0xa1, 0x08, 0x00, + 0x78, 0xa1, 0x08, 0x00, 0x2d, 0xe9, 0xfc, 0x47, 0xf5, 0x4c, 0xf6, 0x4d, + 0x5c, 0x26, 0x20, 0x78, 0x10, 0xfb, 0x06, 0x50, 0x90, 0xf8, 0x27, 0x10, + 0x01, 0x29, 0x07, 0xd1, 0x53, 0x49, 0x0a, 0x78, 0x01, 0x2a, 0x03, 0xd1, + 0x00, 0x20, 0x08, 0x70, 0xbd, 0xe8, 0xfc, 0x87, 0x4f, 0x49, 0x00, 0x22, + 0x90, 0xf8, 0x52, 0x00, 0x0a, 0x70, 0x4e, 0x49, 0x0a, 0x68, 0x03, 0x21, + 0x90, 0x47, 0x20, 0x78, 0x10, 0xfb, 0x06, 0x51, 0x4b, 0x4e, 0x49, 0x78, + 0x05, 0x29, 0x03, 0xd3, 0x09, 0x29, 0x01, 0xd8, 0x52, 0x20, 0x08, 0xe0, + 0x5c, 0x21, 0x10, 0xfb, 0x01, 0x50, 0x90, 0xf8, 0x51, 0x00, 0x08, 0xb1, + 0x32, 0x20, 0x00, 0xe0, 0x00, 0x20, 0xc6, 0xf8, 0x18, 0x02, 0x4f, 0xf0, + 0x5c, 0x0a, 0x20, 0x78, 0x10, 0xfb, 0x0a, 0x51, 0x91, 0xf8, 0x27, 0x10, + 0x02, 0x29, 0x43, 0xd0, 0x01, 0x29, 0x43, 0xd1, 0xd9, 0x49, 0x4f, 0xf0, + 0x5c, 0x08, 0x10, 0xfb, 0x08, 0x50, 0x0a, 0x68, 0x1c, 0x30, 0x69, 0x46, + 0x90, 0x47, 0x00, 0x98, 0x70, 0x60, 0x9d, 0xf8, 0x04, 0x00, 0xb0, 0x60, + 0x20, 0x78, 0x10, 0xfb, 0x08, 0x50, 0x90, 0xf8, 0x4e, 0x10, 0x90, 0xf8, + 0x58, 0x20, 0x4f, 0xea, 0xc2, 0x48, 0xd1, 0xb3, 0xdf, 0xf8, 0xc8, 0x90, + 0x40, 0x78, 0xd6, 0xf8, 0xe4, 0x70, 0xd9, 0xf8, 0x00, 0x10, 0x88, 0x47, + 0x87, 0x42, 0x0f, 0xd8, 0x00, 0x20, 0x40, 0xf2, 0x6f, 0x41, 0xf2, 0xf7, + 0xf9, 0xf8, 0x20, 0x78, 0x5c, 0x21, 0x10, 0xfb, 0x01, 0x50, 0xd9, 0xf8, + 0x00, 0x10, 0x40, 0x78, 0x88, 0x47, 0x0a, 0x30, 0xc6, 0xf8, 0xe4, 0x00, + 0xd6, 0xf8, 0xe4, 0x70, 0x20, 0x78, 0x5c, 0x21, 0x10, 0xfb, 0x01, 0x50, + 0xd9, 0xf8, 0x00, 0x10, 0x40, 0x78, 0x88, 0x47, 0x38, 0x1a, 0xc6, 0xf8, + 0xe4, 0x00, 0x48, 0xf0, 0xe3, 0x00, 0x12, 0xe0, 0x1c, 0x48, 0x10, 0xe0, + 0x5c, 0x21, 0x10, 0xfb, 0x01, 0x50, 0xb6, 0x49, 0x1c, 0x30, 0x0a, 0x68, + 0x69, 0x46, 0x90, 0x47, 0x00, 0x98, 0x70, 0x60, 0x9d, 0xf8, 0x04, 0x00, + 0xb0, 0x60, 0x17, 0x48, 0x01, 0xe0, 0x08, 0xf1, 0x23, 0x00, 0x21, 0x78, + 0x15, 0x4b, 0x16, 0x4f, 0x11, 0xfb, 0x0a, 0x51, 0x4a, 0x78, 0x03, 0xeb, + 0xc2, 0x02, 0x4b, 0x68, 0x52, 0x68, 0x73, 0x61, 0x91, 0xf8, 0x4c, 0x30, + 0x10, 0x43, 0x91, 0xf8, 0x27, 0x10, 0x10, 0x4a, 0x57, 0xf8, 0x23, 0x30, + 0x52, 0xf8, 0x21, 0x10, 0x18, 0x43, 0x08, 0x43, 0x0d, 0x49, 0x30, 0x60, + 0x20, 0x78, 0x09, 0x68, 0x10, 0xfb, 0x0a, 0x50, 0x40, 0x6b, 0x88, 0x47, + 0xbd, 0xe8, 0xfc, 0x87, 0x74, 0xe6, 0x05, 0x00, 0xb0, 0xb9, 0x08, 0x00, + 0x70, 0x10, 0x21, 0x40, 0x03, 0x00, 0x08, 0x00, 0xcc, 0xbe, 0x08, 0x00, + 0x23, 0x00, 0x08, 0x00, 0x58, 0x0d, 0x01, 0x00, 0x58, 0xb5, 0x0e, 0x10, + 0xc8, 0xbb, 0x06, 0x10, 0xf0, 0xb9, 0x08, 0x00, 0x2d, 0xe9, 0xfe, 0x43, + 0x8f, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x8e, 0x48, 0x41, 0xf2, + 0x01, 0x01, 0xdf, 0xf8, 0x38, 0x92, 0xdf, 0xf8, 0x38, 0x82, 0xd1, 0x4e, + 0x01, 0x60, 0x5c, 0x20, 0x99, 0xf8, 0x00, 0x10, 0x11, 0xfb, 0x00, 0x80, + 0x01, 0xeb, 0x01, 0x11, 0x50, 0xf8, 0x1c, 0x2f, 0x06, 0xeb, 0xc1, 0x01, + 0x43, 0x68, 0xc1, 0xe9, 0x1a, 0x23, 0x86, 0x49, 0x0a, 0x68, 0x01, 0xa9, + 0x90, 0x47, 0x85, 0x4d, 0x01, 0x98, 0x28, 0x60, 0x9d, 0xf8, 0x08, 0x00, + 0x68, 0x60, 0x4f, 0xf4, 0xd1, 0x70, 0xc5, 0xf8, 0xb0, 0x00, 0x81, 0x48, + 0xc5, 0xf8, 0xc0, 0x00, 0x80, 0x48, 0x00, 0x68, 0x80, 0x47, 0xe6, 0x48, + 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0x7e, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x99, 0xf8, 0x00, 0x40, 0x7c, 0x4f, 0x7d, 0x4a, 0x04, 0xeb, 0x84, 0x00, + 0x07, 0xeb, 0xc0, 0x00, 0xc1, 0x69, 0x11, 0x60, 0x28, 0x21, 0xee, 0xf7, + 0x95, 0xfb, 0x04, 0xeb, 0x04, 0x10, 0x06, 0xeb, 0xc0, 0x00, 0x00, 0x69, + 0x40, 0x68, 0x80, 0x47, 0x00, 0x28, 0x79, 0xd0, 0xd5, 0xf8, 0x0c, 0x01, + 0x00, 0xb2, 0x00, 0x28, 0x74, 0xd4, 0x72, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x00, 0x28, 0x6f, 0xd0, 0x99, 0xf8, 0x00, 0x00, 0x5c, 0x25, 0x6f, 0x4a, + 0x6f, 0x4b, 0x10, 0xfb, 0x05, 0xf1, 0x18, 0xf8, 0x01, 0x10, 0x32, 0xf8, + 0x11, 0x20, 0x59, 0x5c, 0x00, 0xeb, 0x80, 0x03, 0x00, 0xeb, 0x00, 0x10, + 0x07, 0xeb, 0xc3, 0x03, 0x06, 0xeb, 0xc0, 0x00, 0x5b, 0x89, 0x00, 0x90, + 0x03, 0xfb, 0x01, 0x21, 0x66, 0x4a, 0x03, 0x6a, 0x00, 0x20, 0x11, 0x80, + 0x65, 0x4a, 0x89, 0xb2, 0x11, 0x60, 0x65, 0x49, 0x04, 0x22, 0x0c, 0x68, + 0x00, 0x21, 0xa0, 0x47, 0xfd, 0xf7, 0x7a, 0xfd, 0x28, 0xb1, 0x62, 0x48, + 0x62, 0x49, 0x00, 0x88, 0x40, 0xf0, 0xd6, 0x00, 0x08, 0x60, 0x99, 0xf8, + 0x00, 0x70, 0x17, 0xfb, 0x05, 0x80, 0xc1, 0x6a, 0x49, 0xb1, 0x88, 0x47, + 0x99, 0xf8, 0x00, 0x70, 0x28, 0xb1, 0x5c, 0x20, 0x01, 0x21, 0x17, 0xfb, + 0x00, 0x80, 0x80, 0xf8, 0x4d, 0x10, 0x5c, 0x25, 0x00, 0x21, 0x88, 0x22, + 0x17, 0xfb, 0x05, 0x80, 0xc1, 0x62, 0x76, 0x49, 0xc7, 0xeb, 0x47, 0x10, + 0x01, 0xeb, 0xc0, 0x00, 0x07, 0xeb, 0x07, 0x11, 0x06, 0xeb, 0xc1, 0x01, + 0x00, 0xf0, 0x70, 0xf9, 0x50, 0x48, 0x51, 0x49, 0x00, 0x68, 0x41, 0xf8, + 0x27, 0x00, 0xfd, 0xf7, 0x4b, 0xfd, 0x28, 0xb1, 0x4a, 0x48, 0x4b, 0x49, + 0x00, 0x88, 0x40, 0xf0, 0xe2, 0x00, 0x08, 0x60, 0x4b, 0x48, 0x01, 0x68, + 0x01, 0x20, 0x88, 0x47, 0x99, 0xf8, 0x00, 0x00, 0x10, 0xfb, 0x05, 0x80, + 0x00, 0x6b, 0x38, 0xb1, 0x80, 0x47, 0x99, 0xf8, 0x00, 0x00, 0x5c, 0x21, + 0x10, 0xfb, 0x01, 0x80, 0x00, 0x21, 0x01, 0x63, 0xbd, 0xe8, 0xfe, 0x83, + 0x99, 0xf8, 0x00, 0x40, 0x5e, 0x49, 0x88, 0x22, 0xc4, 0xeb, 0x44, 0x10, + 0x01, 0xeb, 0xc0, 0x00, 0x04, 0xeb, 0x04, 0x11, 0x06, 0xeb, 0xc1, 0x01, + 0x00, 0xf0, 0x40, 0xf9, 0xd5, 0xf8, 0x0c, 0x01, 0x00, 0xb2, 0xb0, 0xf1, + 0xff, 0x3f, 0x25, 0xdc, 0xfd, 0xf7, 0x1a, 0xfd, 0x38, 0xb1, 0x32, 0x48, + 0x32, 0x49, 0x00, 0x88, 0x40, 0xf0, 0xe4, 0x00, 0x08, 0x60, 0x99, 0xf8, + 0x00, 0x40, 0x04, 0xeb, 0x04, 0x11, 0x56, 0xf8, 0x31, 0x00, 0xa8, 0xb1, + 0xd0, 0xf8, 0xcc, 0x21, 0x06, 0xeb, 0xc1, 0x01, 0x22, 0xf0, 0x0f, 0x02, + 0xc0, 0xf8, 0xcc, 0x21, 0x08, 0x68, 0xd0, 0xf8, 0xcc, 0x21, 0x42, 0xf0, + 0x06, 0x02, 0xc0, 0xf8, 0xcc, 0x21, 0x08, 0x68, 0x20, 0xb1, 0x90, 0xf8, + 0x6e, 0x11, 0x01, 0x31, 0x80, 0xf8, 0x6e, 0x11, 0x1a, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x20, 0xb1, 0x01, 0x20, 0xff, 0xf7, 0x3d, 0xfa, 0xbd, 0xe8, + 0xfe, 0x83, 0x99, 0xf8, 0x00, 0x00, 0x00, 0xeb, 0x80, 0x00, 0x07, 0xeb, + 0xc0, 0x00, 0xc1, 0x69, 0x41, 0xf4, 0x00, 0x21, 0xc1, 0x61, 0xff, 0xf7, + 0x2b, 0xfd, 0x1b, 0x48, 0x00, 0x22, 0x03, 0x68, 0x1a, 0x48, 0x00, 0x68, + 0x00, 0xf1, 0x19, 0x01, 0x00, 0x20, 0x98, 0x47, 0xbd, 0xe8, 0xfe, 0x83, + 0xf8, 0xa0, 0x08, 0x00, 0x40, 0x22, 0x00, 0x40, 0x74, 0x87, 0x08, 0x00, + 0x44, 0x4f, 0x01, 0x00, 0x58, 0xa1, 0x08, 0x00, 0x24, 0x10, 0x21, 0x40, + 0x40, 0x42, 0x13, 0x01, 0x70, 0xa1, 0x08, 0x00, 0x68, 0xa1, 0x08, 0x00, + 0x84, 0x71, 0x01, 0x00, 0x0c, 0x36, 0x01, 0x00, 0x94, 0xb7, 0x08, 0x00, + 0xb0, 0x31, 0x0a, 0x10, 0xc4, 0x31, 0x0a, 0x10, 0x22, 0x21, 0x01, 0x00, + 0x38, 0x36, 0x01, 0x00, 0xf0, 0xa0, 0x08, 0x00, 0x26, 0x21, 0x01, 0x00, + 0x04, 0x08, 0x00, 0x40, 0xbc, 0xbe, 0x08, 0x00, 0xc0, 0x5d, 0x01, 0x00, + 0x90, 0xb7, 0x08, 0x00, 0xdc, 0xa0, 0x08, 0x00, 0x24, 0x20, 0x00, 0x40, + 0x19, 0x48, 0x81, 0x69, 0x49, 0x06, 0x13, 0xd5, 0x2b, 0x49, 0x6f, 0xf0, + 0xfc, 0x22, 0x09, 0x78, 0x02, 0x60, 0x40, 0x22, 0x02, 0x61, 0x15, 0x4a, + 0xc1, 0xeb, 0x41, 0x11, 0x02, 0xeb, 0xc1, 0x01, 0x00, 0x22, 0xa1, 0xf8, + 0xdc, 0x20, 0xc0, 0x69, 0xb0, 0xf1, 0xff, 0x3f, 0xc8, 0xbf, 0x70, 0x47, + 0x00, 0xf0, 0xce, 0xb8, 0x0c, 0x48, 0x81, 0x69, 0x49, 0x06, 0x13, 0xd5, + 0x1e, 0x49, 0x6f, 0xf0, 0xfc, 0x22, 0x09, 0x78, 0x02, 0x60, 0x40, 0x22, + 0x02, 0x61, 0x08, 0x4a, 0xc1, 0xeb, 0x41, 0x11, 0x02, 0xeb, 0xc1, 0x01, + 0x00, 0x22, 0xa1, 0xf8, 0xdc, 0x20, 0xc0, 0x69, 0xb0, 0xf1, 0xff, 0x3f, + 0xc8, 0xbf, 0x70, 0x47, 0x00, 0xf0, 0xba, 0xb8, 0xd0, 0x10, 0x21, 0x40, + 0x0c, 0x6f, 0x01, 0x00, 0x80, 0xb5, 0x00, 0xf0, 0xb9, 0xf8, 0x0f, 0x48, + 0x00, 0x68, 0xb0, 0xf1, 0xff, 0x3f, 0x00, 0xdd, 0x80, 0xbd, 0x0d, 0x48, + 0x0d, 0x49, 0x00, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x01, 0xeb, 0xc0, 0x00, + 0xc0, 0x68, 0x00, 0x28, 0xf4, 0xd0, 0xd0, 0xf8, 0x24, 0x12, 0x00, 0x29, + 0xf0, 0xd0, 0x90, 0xf8, 0x2b, 0x02, 0x01, 0x22, 0x01, 0xeb, 0x40, 0x00, + 0x41, 0x78, 0x62, 0xf3, 0x1f, 0x11, 0x41, 0x70, 0x80, 0xbd, 0x00, 0xbf, + 0x30, 0x11, 0x21, 0x40, 0x74, 0x87, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, + 0x15, 0x48, 0x16, 0x49, 0x01, 0x60, 0x16, 0x48, 0x16, 0x49, 0x01, 0x60, + 0x16, 0x48, 0x17, 0x49, 0x01, 0x60, 0x17, 0x48, 0x17, 0x49, 0x01, 0x60, + 0x17, 0x48, 0x18, 0x49, 0x01, 0x60, 0x18, 0x48, 0x18, 0x49, 0x01, 0x60, + 0x18, 0x48, 0x19, 0x49, 0x01, 0x60, 0x19, 0x48, 0x19, 0x49, 0x01, 0x60, + 0x19, 0x48, 0x1a, 0x49, 0x01, 0x60, 0x1a, 0x48, 0x1a, 0x49, 0x01, 0x60, + 0x1a, 0x48, 0x1b, 0x49, 0x01, 0x60, 0x1b, 0x48, 0x1b, 0x49, 0x01, 0x60, + 0x1b, 0x48, 0x1c, 0x49, 0x01, 0x60, 0x1c, 0x48, 0x1c, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x24, 0xbd, 0x08, 0x00, 0x49, 0x42, 0x03, 0x00, + 0xc8, 0xbe, 0x08, 0x00, 0x75, 0x3c, 0x03, 0x00, 0x30, 0xbd, 0x08, 0x00, + 0xb5, 0x42, 0x03, 0x00, 0x18, 0xbd, 0x08, 0x00, 0xfd, 0x42, 0x03, 0x00, + 0x3c, 0xbd, 0x08, 0x00, 0x0d, 0x43, 0x03, 0x00, 0x48, 0xbd, 0x08, 0x00, + 0xc9, 0x44, 0x03, 0x00, 0x14, 0xbd, 0x08, 0x00, 0x15, 0x45, 0x03, 0x00, + 0x0c, 0xa1, 0x08, 0x00, 0x45, 0x48, 0x03, 0x00, 0xb8, 0xbe, 0x08, 0x00, + 0xfd, 0x48, 0x03, 0x00, 0x28, 0xbd, 0x08, 0x00, 0x05, 0x4a, 0x03, 0x00, + 0x1c, 0xbd, 0x08, 0x00, 0x95, 0x4b, 0x03, 0x00, 0x34, 0xbd, 0x08, 0x00, + 0x39, 0x4e, 0x03, 0x00, 0x2c, 0xbd, 0x08, 0x00, 0x6d, 0x4e, 0x03, 0x00, + 0x10, 0xbd, 0x08, 0x00, 0xa9, 0x4e, 0x03, 0x00, 0x4b, 0xf2, 0x93, 0x4c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf6, 0x17, 0x5c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf2, 0xa5, 0x1c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4a, 0xf2, 0x15, 0x4c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf2, 0x7f, 0x4c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4a, 0xf6, 0x2b, 0x0c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf2, 0x3d, 0x6c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf6, 0xa7, 0x6c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0x51, 0x0c, + 0xc1, 0xf2, 0x06, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x07, 0x00, 0x00, 0x03, 0x4a, 0x13, 0x68, 0x02, 0x22, 0x18, 0x47, + 0x01, 0x4a, 0x13, 0x68, 0x03, 0x22, 0x18, 0x47, 0xb8, 0xfc, 0x08, 0x00, + 0x03, 0x48, 0x04, 0x49, 0x01, 0x60, 0x04, 0x48, 0x04, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x9c, 0xbe, 0x08, 0x00, 0x3d, 0x50, 0x03, 0x00, + 0x2c, 0xa1, 0x08, 0x00, 0x35, 0x50, 0x03, 0x00, 0xb0, 0xb5, 0x04, 0x46, + 0x00, 0x79, 0x40, 0x07, 0x42, 0xd5, 0x20, 0x7d, 0x01, 0x28, 0x37, 0xd1, + 0xa0, 0x7e, 0x00, 0xf0, 0xc0, 0x00, 0x40, 0x28, 0x32, 0xd1, 0x2f, 0x48, + 0xa1, 0x79, 0x02, 0x68, 0xe0, 0x1d, 0x01, 0xf0, 0x01, 0x01, 0x90, 0x47, + 0xff, 0x28, 0x1d, 0xd0, 0x2b, 0x49, 0x34, 0x22, 0x09, 0x68, 0x10, 0xfb, + 0x02, 0x15, 0x2a, 0x49, 0x10, 0x22, 0x28, 0x46, 0xfc, 0xf7, 0x8c, 0xf9, + 0x90, 0xb1, 0x28, 0x48, 0x29, 0x46, 0x00, 0x22, 0x03, 0x68, 0x04, 0xf1, + 0x15, 0x00, 0x98, 0x47, 0x50, 0xb1, 0x25, 0x48, 0x90, 0xf8, 0x64, 0x00, + 0x03, 0x28, 0x11, 0xd8, 0xdf, 0xe8, 0x00, 0xf0, 0x02, 0x3a, 0x02, 0x3a, + 0x02, 0x20, 0x0a, 0xe0, 0x20, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0x01, 0x28, 0x03, 0xd1, 0x1e, 0x48, 0x00, 0x78, 0x80, 0x07, 0x21, 0xd4, + 0xfe, 0x20, 0x20, 0x75, 0x1a, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0x01, 0x28, 0x04, 0xbf, 0x00, 0x20, 0xe0, 0x76, 0x18, 0x48, 0xc0, 0x79, + 0x80, 0x06, 0x06, 0xd5, 0x17, 0x48, 0x41, 0x78, 0xc9, 0x06, 0x07, 0xd4, + 0x00, 0x78, 0x80, 0x07, 0x06, 0xd4, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, + 0xf1, 0xf7, 0xf2, 0xbd, 0x13, 0x48, 0x00, 0xe0, 0x13, 0x48, 0x01, 0x68, + 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x08, 0x47, 0x0c, 0x48, 0xc0, 0x79, + 0x80, 0x06, 0xdb, 0xd5, 0x0b, 0x48, 0x40, 0x78, 0x40, 0x07, 0xd7, 0xd5, + 0x0a, 0x48, 0xf0, 0xe7, 0x03, 0x20, 0xd2, 0xe7, 0x48, 0xc9, 0x08, 0x00, + 0x20, 0x54, 0x01, 0x00, 0x9a, 0xad, 0x09, 0x10, 0xf4, 0xc5, 0x08, 0x00, + 0x90, 0x01, 0x00, 0x00, 0xf8, 0xc5, 0x08, 0x00, 0x99, 0x53, 0x01, 0x00, + 0xc8, 0x52, 0x01, 0x00, 0x78, 0x52, 0x01, 0x00, 0xc4, 0xc5, 0x08, 0x00, + 0xc8, 0xc5, 0x08, 0x00, 0xcc, 0xc5, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x2c, 0xc4, 0x08, 0x00, 0x69, 0x50, 0x03, 0x00, + 0x2d, 0xe9, 0xf8, 0x43, 0xf2, 0x4f, 0x04, 0x46, 0x4f, 0xf4, 0xa8, 0x72, + 0x38, 0x68, 0x14, 0xfb, 0x02, 0x02, 0x92, 0xf8, 0x4d, 0x21, 0x0a, 0x42, + 0x36, 0xd0, 0x1c, 0x4e, 0xb1, 0x79, 0x01, 0x29, 0x32, 0xd1, 0x4f, 0xf4, + 0xa8, 0x71, 0x14, 0xfb, 0x01, 0x00, 0x90, 0xf8, 0x31, 0x11, 0x89, 0x07, + 0x2a, 0xd5, 0x17, 0x4a, 0x90, 0xf8, 0x32, 0x11, 0x00, 0xf2, 0x33, 0x10, + 0x12, 0x68, 0x90, 0x47, 0xff, 0x28, 0x21, 0xd0, 0x36, 0x68, 0x4f, 0xf0, + 0x34, 0x09, 0x12, 0x49, 0x05, 0x46, 0x10, 0x22, 0x10, 0xfb, 0x09, 0x68, + 0x40, 0x46, 0xfc, 0xf7, 0xf3, 0xf8, 0x38, 0xb1, 0x15, 0xfb, 0x09, 0x60, + 0x00, 0xf1, 0x20, 0x01, 0x0c, 0x48, 0x02, 0x68, 0x40, 0x46, 0x90, 0x47, + 0x38, 0x68, 0x4f, 0xf4, 0xa8, 0x71, 0x14, 0xfb, 0x01, 0x00, 0x90, 0xf8, + 0x54, 0x10, 0x01, 0x29, 0x04, 0xd1, 0x07, 0x49, 0x09, 0x68, 0xbd, 0xe8, + 0xf8, 0x43, 0x08, 0x47, 0xbd, 0xe8, 0xf8, 0x83, 0x20, 0x54, 0x01, 0x00, + 0x48, 0xc9, 0x08, 0x00, 0x9a, 0xad, 0x09, 0x10, 0x50, 0xba, 0x08, 0x00, + 0x3c, 0xba, 0x08, 0x00, 0xf0, 0xb5, 0x85, 0xb0, 0x04, 0x46, 0x12, 0x48, + 0xdd, 0xe9, 0x0a, 0xe7, 0x45, 0x7a, 0xed, 0x07, 0xdd, 0xe9, 0x0c, 0x5c, + 0x08, 0xd0, 0x3e, 0x46, 0x04, 0x2f, 0x28, 0xbf, 0x04, 0x26, 0x30, 0x44, + 0x80, 0x7a, 0xa8, 0x42, 0x38, 0xbf, 0x05, 0x46, 0x20, 0x46, 0xcd, 0xe9, + 0x00, 0xe7, 0xcd, 0xe9, 0x02, 0x5c, 0x00, 0xf0, 0x5d, 0xfa, 0x40, 0xb9, + 0x44, 0xf0, 0x02, 0x01, 0x03, 0x29, 0x04, 0xd1, 0x04, 0x49, 0x01, 0x22, + 0x0a, 0x73, 0x00, 0x22, 0x0a, 0x70, 0x05, 0xb0, 0xf0, 0xbd, 0x00, 0xbf, + 0xcc, 0x2c, 0x06, 0x00, 0x58, 0xf0, 0x05, 0x00, 0xb0, 0xb5, 0x90, 0xf9, + 0x16, 0x50, 0x04, 0x46, 0x7f, 0x2d, 0x0b, 0xd0, 0x08, 0x48, 0x09, 0x49, + 0x0a, 0x68, 0x00, 0x78, 0x02, 0x21, 0x90, 0x47, 0x85, 0x42, 0x01, 0xdb, + 0x14, 0x2d, 0x01, 0xdd, 0x12, 0x20, 0xb0, 0xbd, 0x20, 0x46, 0xbd, 0xe8, + 0xb0, 0x40, 0x00, 0xf0, 0x3b, 0xba, 0x00, 0xbf, 0x6b, 0x34, 0x01, 0x00, + 0x34, 0x9c, 0x08, 0x00, 0x2d, 0xe9, 0xfe, 0x43, 0xa6, 0x4e, 0x04, 0x46, + 0x4f, 0xf4, 0xa8, 0x77, 0x30, 0x68, 0x14, 0xfb, 0x07, 0x00, 0x90, 0xf8, + 0x54, 0x00, 0x08, 0xb1, 0xbd, 0xe8, 0xfe, 0x83, 0x4a, 0x48, 0x4f, 0xf0, + 0x00, 0x08, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0xeb, 0xf7, 0x9c, 0xfe, + 0x81, 0x46, 0x30, 0x68, 0x14, 0xfb, 0x07, 0x00, 0x01, 0x6d, 0x45, 0x48, + 0x05, 0x68, 0x02, 0xa8, 0xcd, 0xe9, 0x00, 0x08, 0x6f, 0xf0, 0x01, 0x00, + 0xc9, 0xf3, 0xc0, 0x63, 0x00, 0xea, 0x51, 0x02, 0x48, 0x46, 0xa8, 0x47, + 0x31, 0x68, 0x14, 0xfb, 0x07, 0x11, 0x48, 0x62, 0x3d, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x32, 0x68, 0x14, 0xfb, 0x07, 0x21, 0x91, 0xf8, + 0x55, 0x70, 0x48, 0x87, 0x05, 0x2f, 0x07, 0xd3, 0x4f, 0xf4, 0xa8, 0x70, + 0x10, 0x21, 0x14, 0xfb, 0x00, 0x20, 0xb0, 0xf8, 0x00, 0x31, 0x07, 0xe0, + 0x00, 0xeb, 0x40, 0x00, 0x40, 0xf2, 0x71, 0x21, 0xb0, 0xfb, 0xf1, 0xf0, + 0x07, 0x21, 0x43, 0x1c, 0x4f, 0xf4, 0xa8, 0x78, 0x14, 0xfb, 0x08, 0x20, + 0xb0, 0xf8, 0x50, 0x20, 0x2d, 0x48, 0x05, 0x68, 0x1a, 0x20, 0xcd, 0xe9, + 0x00, 0x07, 0x02, 0x20, 0xa8, 0x47, 0x30, 0x68, 0x14, 0xfb, 0x08, 0x00, + 0x90, 0xf8, 0x55, 0x00, 0x01, 0x28, 0x13, 0xd1, 0x20, 0x46, 0x00, 0xf0, + 0xdd, 0xf9, 0x30, 0x68, 0x2c, 0x49, 0x14, 0xfb, 0x08, 0x00, 0x0a, 0x68, + 0x20, 0x21, 0x08, 0x30, 0x90, 0x47, 0x30, 0x68, 0x29, 0x49, 0x14, 0xfb, + 0x08, 0x00, 0x09, 0x68, 0x08, 0x30, 0x88, 0x47, 0xbd, 0xe8, 0xfe, 0x83, + 0x1d, 0x48, 0x49, 0x46, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x30, 0x68, + 0x00, 0x21, 0x14, 0xfb, 0x08, 0x00, 0x80, 0xf8, 0x30, 0x11, 0x01, 0x21, + 0x80, 0xf8, 0x54, 0x10, 0x27, 0x21, 0x80, 0xf8, 0x56, 0x10, 0x20, 0x46, + 0x00, 0xf0, 0xb8, 0xf9, 0x14, 0x48, 0x00, 0x68, 0x80, 0x47, 0x14, 0x48, + 0x01, 0x68, 0x1a, 0x20, 0x88, 0x47, 0x13, 0x4a, 0x20, 0x04, 0x00, 0x21, + 0x08, 0x23, 0x10, 0x60, 0x30, 0x68, 0x14, 0xfb, 0x08, 0x00, 0x90, 0xf8, + 0x5d, 0x00, 0x50, 0x60, 0x0e, 0x48, 0x04, 0x68, 0x40, 0xf2, 0x13, 0x20, + 0xa0, 0x47, 0x0d, 0x48, 0x00, 0x68, 0x80, 0x47, 0x0c, 0x48, 0x00, 0x68, + 0x80, 0x47, 0xbd, 0xe8, 0xfe, 0x83, 0x00, 0xbf, 0xd4, 0x8e, 0x08, 0x00, + 0x08, 0xbb, 0x08, 0x00, 0x04, 0x8f, 0x08, 0x00, 0x14, 0x99, 0x08, 0x00, + 0x7c, 0xc9, 0x08, 0x00, 0x24, 0xc9, 0x08, 0x00, 0x54, 0x9c, 0x08, 0x00, + 0x8c, 0x34, 0x01, 0x00, 0x78, 0x9b, 0x08, 0x00, 0xec, 0xba, 0x08, 0x00, + 0xfc, 0xba, 0x08, 0x00, 0xe4, 0xc9, 0x08, 0x00, 0xe8, 0xc9, 0x08, 0x00, + 0x2d, 0xe9, 0xfc, 0x41, 0x04, 0x46, 0x41, 0xf0, 0x02, 0x00, 0x0d, 0x46, + 0x03, 0x28, 0x46, 0xd1, 0x43, 0x48, 0x06, 0x68, 0x20, 0x46, 0x11, 0x46, + 0x1a, 0x46, 0xb0, 0x47, 0x06, 0x46, 0xdf, 0xf8, 0x04, 0x81, 0x4f, 0xf4, + 0xa8, 0x71, 0xd8, 0xf8, 0x00, 0x00, 0x14, 0xfb, 0x01, 0x01, 0x91, 0xf8, + 0x54, 0x20, 0x92, 0xb1, 0x91, 0xf8, 0x55, 0x10, 0x05, 0x29, 0x0e, 0xd3, + 0x4f, 0xf4, 0xa8, 0x71, 0x14, 0xfb, 0x01, 0x00, 0x83, 0x8f, 0x02, 0x6d, + 0x90, 0xf8, 0x04, 0x11, 0x36, 0x48, 0x07, 0x68, 0x01, 0x20, 0x00, 0x90, + 0x20, 0x46, 0xb8, 0x47, 0x68, 0xb3, 0x45, 0x2e, 0x2b, 0xd0, 0x07, 0x2e, + 0x2a, 0xd0, 0x00, 0x2e, 0x56, 0xd1, 0x05, 0xf0, 0xfe, 0x00, 0x02, 0x28, + 0x45, 0xd1, 0x85, 0x49, 0xd8, 0xf8, 0x00, 0x00, 0x4f, 0xf4, 0xa8, 0x75, + 0x14, 0xfb, 0x05, 0x00, 0x09, 0x68, 0x66, 0x30, 0x88, 0x47, 0x8e, 0x48, + 0x02, 0x21, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0xd8, 0xf8, 0x00, 0x00, + 0x14, 0xfb, 0x05, 0x00, 0xb0, 0xf8, 0x62, 0x10, 0x21, 0xf0, 0x04, 0x01, + 0x37, 0xe0, 0x74, 0x48, 0x4f, 0xf4, 0xa8, 0x71, 0x00, 0x68, 0x14, 0xfb, + 0x01, 0x06, 0xb6, 0xf8, 0x62, 0x60, 0x76, 0x07, 0x17, 0xd4, 0x12, 0x26, + 0xb3, 0xe7, 0x45, 0x26, 0x73, 0x49, 0xd8, 0xf8, 0x00, 0x00, 0x4f, 0xf4, + 0xa8, 0x75, 0x14, 0xfb, 0x05, 0x00, 0x09, 0x68, 0x3c, 0x30, 0x88, 0x47, + 0xd8, 0xf8, 0x00, 0x00, 0x14, 0xfb, 0x05, 0x00, 0xb0, 0xf8, 0x62, 0x10, + 0x21, 0xf0, 0x04, 0x01, 0xa0, 0xf8, 0x62, 0x10, 0x18, 0xe0, 0x14, 0xfb, + 0x01, 0x00, 0x64, 0x4e, 0x30, 0xf8, 0x3c, 0x1f, 0xb6, 0xf8, 0x50, 0x61, + 0x19, 0x44, 0xb1, 0x42, 0x11, 0xd9, 0x07, 0x26, 0x91, 0xe7, 0xd8, 0xf8, + 0x00, 0x00, 0x4f, 0xf4, 0xa8, 0x71, 0x14, 0xfb, 0x01, 0x00, 0xb0, 0xf8, + 0x62, 0x10, 0x41, 0xf0, 0x04, 0x01, 0xa0, 0xf8, 0x62, 0x10, 0x00, 0x26, + 0x30, 0x46, 0xbd, 0xe8, 0xfc, 0x81, 0x58, 0x49, 0x0e, 0x68, 0x7a, 0xe7, + 0x24, 0xbe, 0x08, 0x00, 0xdc, 0x35, 0x01, 0x00, 0x6c, 0xc9, 0x08, 0x00, + 0x2d, 0xe9, 0xf0, 0x41, 0x0d, 0x46, 0x04, 0x46, 0x01, 0x29, 0x03, 0xd0, + 0x04, 0x2d, 0x2c, 0xd0, 0x03, 0x2d, 0x08, 0xd1, 0x4b, 0x48, 0x4f, 0xf4, + 0xa8, 0x71, 0x00, 0x68, 0x14, 0xfb, 0x01, 0x00, 0x49, 0x49, 0x70, 0x30, + 0x1a, 0xe0, 0x47, 0x48, 0x4f, 0xf4, 0xa8, 0x71, 0x00, 0x68, 0x14, 0xfb, + 0x01, 0x06, 0xb6, 0xf8, 0x62, 0x60, 0x36, 0x07, 0x5c, 0xbf, 0x12, 0x20, + 0xbd, 0xe8, 0xf0, 0x81, 0x14, 0xfb, 0x01, 0x00, 0x41, 0x4e, 0x30, 0xf8, + 0x70, 0x1f, 0xb6, 0xf8, 0x50, 0x61, 0x19, 0x44, 0xb1, 0x42, 0x84, 0xbf, + 0x07, 0x20, 0xbd, 0xe8, 0xf0, 0x81, 0x3d, 0x49, 0x0e, 0x68, 0x11, 0x46, + 0x1a, 0x46, 0xb0, 0x47, 0x08, 0xb1, 0xbd, 0xe8, 0xf0, 0x81, 0xdf, 0xf8, + 0xd8, 0x80, 0x4f, 0xf4, 0xa8, 0x77, 0xd8, 0xf8, 0x00, 0x00, 0x14, 0xfb, + 0x07, 0x00, 0xb0, 0xf8, 0x70, 0x10, 0x35, 0x48, 0x02, 0x68, 0x20, 0x46, + 0x90, 0x47, 0xd8, 0xf8, 0x00, 0x10, 0x14, 0xfb, 0x07, 0x12, 0xd2, 0xf8, + 0x84, 0x20, 0x3a, 0xb9, 0x14, 0xfb, 0x07, 0x13, 0xb3, 0xf8, 0x62, 0x30, + 0x03, 0xf0, 0xc0, 0x06, 0xc0, 0x2e, 0x21, 0xd1, 0x14, 0xfb, 0x07, 0x13, + 0xb3, 0xf8, 0x98, 0x30, 0x98, 0x42, 0x14, 0xd9, 0x4f, 0xf4, 0xa8, 0x75, + 0x14, 0xfb, 0x05, 0x10, 0x28, 0x49, 0x70, 0x30, 0x09, 0x68, 0x88, 0x47, + 0xd8, 0xf8, 0x00, 0x00, 0x14, 0xfb, 0x05, 0x00, 0xb0, 0xf8, 0x62, 0x10, + 0x21, 0xf0, 0x08, 0x01, 0xa0, 0xf8, 0x62, 0x10, 0x45, 0x20, 0xbd, 0xe8, + 0xf0, 0x81, 0x8a, 0xb9, 0x4f, 0xf4, 0xa8, 0x72, 0x14, 0xfb, 0x02, 0x12, + 0xb2, 0xf8, 0x62, 0x30, 0x03, 0xf0, 0xc0, 0x02, 0xc0, 0x2a, 0x07, 0xd0, + 0x4f, 0xf4, 0xa8, 0x72, 0x14, 0xfb, 0x02, 0x12, 0xb2, 0xf8, 0x9e, 0x20, + 0x90, 0x42, 0xd7, 0xd8, 0xa8, 0x1e, 0x02, 0x28, 0x10, 0xd8, 0x4f, 0xf4, + 0xa8, 0x75, 0x14, 0xfb, 0x05, 0x10, 0x12, 0x49, 0x82, 0x30, 0x09, 0x68, + 0x88, 0x47, 0xd8, 0xf8, 0x00, 0x00, 0x14, 0xfb, 0x05, 0x00, 0xb0, 0xf8, + 0x62, 0x10, 0x21, 0xf0, 0x08, 0x01, 0x07, 0xe0, 0x4f, 0xf4, 0xa8, 0x70, + 0x14, 0xfb, 0x00, 0x10, 0xb0, 0xf8, 0x62, 0x10, 0x41, 0xf0, 0x08, 0x01, + 0xa0, 0xf8, 0x62, 0x10, 0x00, 0x20, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, + 0xdc, 0x35, 0x01, 0x00, 0x08, 0xc9, 0x08, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0x10, 0xc9, 0x08, 0x00, 0x5c, 0xb6, 0x08, 0x00, 0x04, 0xc9, 0x08, 0x00, + 0x8c, 0xec, 0x08, 0x00, 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, + 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, + 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, + 0x0c, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x54, 0xbe, 0x08, 0x00, + 0x21, 0x52, 0x03, 0x00, 0x0c, 0xc9, 0x08, 0x00, 0x81, 0x51, 0x03, 0x00, + 0x30, 0xb6, 0x08, 0x00, 0x79, 0x52, 0x03, 0x00, 0x38, 0xba, 0x08, 0x00, + 0xb1, 0x52, 0x03, 0x00, 0x40, 0xbe, 0x08, 0x00, 0x2d, 0x54, 0x03, 0x00, + 0x44, 0xbe, 0x08, 0x00, 0x59, 0x55, 0x03, 0x00, 0x4b, 0xf2, 0xe5, 0x4c, + 0xc1, 0xf2, 0x07, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf2, 0xe9, 0x7c, + 0xc1, 0xf2, 0x07, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf2, 0xbb, 0x6c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0xb0, 0xb5, 0x17, 0x48, + 0x00, 0x78, 0x08, 0xb3, 0x16, 0x4a, 0x00, 0x21, 0x52, 0xf8, 0x21, 0x30, + 0xab, 0xb1, 0x93, 0xf8, 0x3b, 0x43, 0x87, 0x2c, 0x05, 0xd0, 0x93, 0xf8, + 0x3c, 0x53, 0x87, 0x2d, 0x18, 0xbf, 0x81, 0x2c, 0x0f, 0xd1, 0xb3, 0xf8, + 0x84, 0x40, 0xa4, 0x06, 0x10, 0xd5, 0xd3, 0xf8, 0xd4, 0x40, 0x64, 0x7f, + 0x1c, 0xb9, 0xd3, 0xf8, 0x34, 0x43, 0xe5, 0x00, 0x0a, 0xd5, 0x01, 0x31, + 0x81, 0x42, 0xe3, 0xd3, 0x02, 0xe0, 0x81, 0x2d, 0xed, 0xd0, 0xf8, 0xe7, + 0x00, 0x20, 0xb0, 0xbd, 0xd3, 0xf8, 0x34, 0x43, 0x44, 0xf0, 0x00, 0x50, + 0xc3, 0xf8, 0x34, 0x03, 0x01, 0x20, 0xb0, 0xbd, 0x53, 0x34, 0x01, 0x00, + 0xb8, 0x57, 0x01, 0x00, 0xca, 0x79, 0x07, 0x2a, 0x04, 0xd8, 0x0a, 0x7a, + 0x07, 0x2a, 0x98, 0xbf, 0x01, 0xf0, 0xcc, 0xba, 0x00, 0x20, 0x70, 0x47, + 0x70, 0xb5, 0xb8, 0xb1, 0x0c, 0x46, 0x05, 0x46, 0xf7, 0xf7, 0x2a, 0xfe, + 0x10, 0x48, 0x06, 0x68, 0x66, 0xb1, 0x10, 0x48, 0x95, 0xf8, 0x35, 0x11, + 0x00, 0x68, 0x72, 0x78, 0x91, 0x42, 0x01, 0xd1, 0xb0, 0x42, 0x0e, 0xd1, + 0x56, 0xf8, 0x04, 0x6c, 0x00, 0x2e, 0xf6, 0xd1, 0xf7, 0xf7, 0x1e, 0xfe, + 0x00, 0x24, 0x04, 0xe0, 0x00, 0x20, 0xbe, 0x21, 0x00, 0x24, 0xf1, 0xf7, + 0x69, 0xfa, 0x20, 0x46, 0x70, 0xbd, 0xf7, 0xf7, 0x13, 0xfe, 0x30, 0x78, + 0xa0, 0x42, 0xf1, 0xd0, 0x01, 0x24, 0xf6, 0xe7, 0x54, 0x52, 0x01, 0x00, + 0x60, 0x52, 0x01, 0x00, 0x10, 0xb5, 0x04, 0x46, 0xd0, 0xf8, 0x50, 0x04, + 0x10, 0xb1, 0xd4, 0xf8, 0x4c, 0x04, 0x00, 0xb1, 0x10, 0xbd, 0x94, 0xf8, + 0x3b, 0x03, 0x00, 0x28, 0xfa, 0xd1, 0x94, 0xf8, 0x3c, 0x03, 0x00, 0x28, + 0xf6, 0xd1, 0x20, 0x46, 0x50, 0x21, 0xff, 0xf7, 0xbf, 0xff, 0x00, 0x28, + 0xf0, 0xd1, 0xb4, 0xf8, 0x46, 0x04, 0x80, 0x07, 0x16, 0xd4, 0xd4, 0xf8, + 0x4c, 0x04, 0x20, 0xb1, 0x00, 0x20, 0x4f, 0xf4, 0x88, 0x71, 0xf1, 0xf7, + 0x39, 0xfa, 0x00, 0x20, 0xd4, 0xf8, 0x50, 0x14, 0xc4, 0xf8, 0x50, 0x04, + 0x12, 0x48, 0xc4, 0xf8, 0x4c, 0x14, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, + 0x92, 0x20, 0x84, 0xf8, 0x3b, 0x03, 0x10, 0xbd, 0x0c, 0x48, 0x72, 0xb6, + 0x01, 0x68, 0x49, 0x00, 0x01, 0x31, 0x01, 0x60, 0xb4, 0xf8, 0x46, 0x14, + 0x21, 0xf0, 0x02, 0x01, 0xa4, 0xf8, 0x46, 0x14, 0x01, 0x68, 0x49, 0x08, + 0x01, 0x60, 0x00, 0x68, 0x80, 0xf3, 0x10, 0x88, 0xd4, 0xf8, 0x50, 0x04, + 0xf1, 0xf7, 0x32, 0xfa, 0x00, 0x20, 0xc4, 0xf8, 0x50, 0x04, 0x10, 0xbd, + 0x24, 0x36, 0x01, 0x00, 0x24, 0xb5, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x85, 0xb0, 0xd0, 0xb1, 0x04, 0x46, 0xab, 0x48, 0x0d, 0x46, 0x16, 0x46, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x20, 0xb9, 0xa8, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x20, 0xb1, 0x00, 0x20, 0x40, 0xf2, 0x33, 0x11, + 0xeb, 0xf7, 0x94, 0xfb, 0x03, 0xf0, 0x8e, 0xfb, 0x68, 0xb1, 0xa3, 0x48, + 0xd0, 0xf8, 0x00, 0xc0, 0x8e, 0xb3, 0x4e, 0x20, 0x30, 0xe0, 0x00, 0x20, + 0x40, 0xf2, 0x2d, 0x11, 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0xf1, 0xf7, + 0xe5, 0xb9, 0x68, 0x79, 0x95, 0xf8, 0x08, 0xb0, 0x95, 0xf8, 0x0c, 0x90, + 0x95, 0xf8, 0x0b, 0xa0, 0xaf, 0x7a, 0x95, 0xf8, 0x09, 0x80, 0x29, 0x46, + 0x32, 0x46, 0x04, 0x90, 0xa8, 0x79, 0x03, 0x90, 0xe8, 0x79, 0x02, 0x90, + 0x20, 0x46, 0x01, 0xf0, 0x19, 0xfa, 0x7e, 0xb9, 0x0d, 0x49, 0x4a, 0xea, + 0x09, 0x20, 0x48, 0xea, 0x07, 0x23, 0x0d, 0x68, 0x00, 0x90, 0xdd, 0xe9, + 0x03, 0x10, 0x40, 0xea, 0x01, 0x21, 0x02, 0x98, 0x40, 0xea, 0x0b, 0x22, + 0x20, 0x46, 0xa8, 0x47, 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x06, 0x20, + 0x21, 0x46, 0x2a, 0x46, 0x01, 0x23, 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, + 0x60, 0x47, 0x00, 0xbf, 0x3c, 0xc7, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x47, + 0x00, 0x28, 0x67, 0xd0, 0x04, 0x46, 0xd0, 0xf8, 0x00, 0x04, 0x00, 0x28, + 0x62, 0xd0, 0xd0, 0xf8, 0xec, 0x50, 0x00, 0x2d, 0x5e, 0xd0, 0x95, 0xf8, + 0x1c, 0x01, 0x02, 0x28, 0x07, 0xd1, 0xd4, 0xf8, 0x04, 0x04, 0xa8, 0x42, + 0x03, 0xd1, 0x95, 0xf8, 0x41, 0x00, 0x80, 0x07, 0x52, 0xd4, 0x74, 0x48, + 0x72, 0x4e, 0x95, 0xf8, 0x1d, 0x81, 0x01, 0x68, 0xd6, 0xf8, 0x00, 0x90, + 0x20, 0x46, 0x88, 0x47, 0x20, 0xb9, 0x70, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x20, 0xb1, 0x00, 0x20, 0x4f, 0xf4, 0xcb, 0x71, 0xeb, 0xf7, + 0x23, 0xfb, 0x94, 0xf9, 0x3c, 0x03, 0xb0, 0xf1, 0xff, 0x3f, 0x3b, 0xdd, + 0xff, 0xf7, 0xb8, 0xfe, 0xc0, 0xbb, 0x94, 0xf8, 0x8c, 0x00, 0xc0, 0x06, + 0x34, 0xd4, 0x95, 0xf8, 0x1d, 0x11, 0x30, 0x68, 0xc1, 0xeb, 0x01, 0x11, + 0x00, 0xeb, 0x41, 0x17, 0x3e, 0x46, 0x16, 0xf8, 0x9a, 0x0f, 0x70, 0xb9, + 0x28, 0x6c, 0x4f, 0xf0, 0x00, 0x0a, 0xc7, 0xf8, 0x10, 0xa0, 0x40, 0xf0, + 0x01, 0x00, 0x28, 0x64, 0x5d, 0x48, 0x01, 0x68, 0x38, 0x46, 0x88, 0x47, + 0x00, 0x28, 0x00, 0xf0, 0x91, 0x80, 0x28, 0x6c, 0x41, 0xb2, 0x00, 0x29, + 0x4b, 0xd4, 0x57, 0xf8, 0x10, 0x0f, 0x57, 0xf8, 0x04, 0x1c, 0x09, 0x1a, + 0xc5, 0xf8, 0x30, 0x11, 0x17, 0xf8, 0x0d, 0x1c, 0x81, 0x29, 0x15, 0xd0, + 0x01, 0x29, 0x23, 0xd1, 0xd5, 0xf8, 0x28, 0x11, 0x08, 0x44, 0x51, 0x49, + 0xb1, 0xf8, 0xb8, 0x11, 0x43, 0x18, 0x21, 0xe0, 0xbd, 0xe8, 0xf0, 0x87, + 0x4b, 0x48, 0x21, 0x46, 0x00, 0x22, 0x01, 0x23, 0xd0, 0xf8, 0x00, 0xc0, + 0x34, 0x20, 0xbd, 0xe8, 0xf0, 0x47, 0x60, 0x47, 0xd5, 0xf8, 0x24, 0x11, + 0x95, 0xf8, 0x46, 0x31, 0xb0, 0xfb, 0xf1, 0xf2, 0x85, 0xf8, 0xf9, 0x21, + 0x95, 0xf8, 0x50, 0x21, 0x93, 0x42, 0x38, 0xbf, 0x13, 0x46, 0x01, 0xfb, + 0x03, 0x03, 0x05, 0xe0, 0x95, 0xf8, 0x20, 0x11, 0xd5, 0xf8, 0x24, 0x21, + 0x02, 0xfb, 0x01, 0x03, 0x3e, 0x48, 0x3f, 0x4a, 0x78, 0x21, 0x3b, 0x60, + 0xee, 0xf7, 0xf6, 0xfc, 0x3d, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, + 0x05, 0xd5, 0x3c, 0x48, 0x38, 0x4a, 0x01, 0x21, 0x03, 0x68, 0x02, 0x20, + 0x98, 0x47, 0x28, 0x6c, 0x40, 0xf0, 0x80, 0x00, 0x28, 0x64, 0xc0, 0x07, + 0x01, 0xd1, 0x00, 0x21, 0x06, 0xe0, 0xc8, 0xeb, 0x08, 0x10, 0x09, 0xeb, + 0x40, 0x10, 0xd0, 0xe9, 0x39, 0x10, 0x41, 0x1a, 0x28, 0x46, 0x02, 0xf0, + 0x21, 0xfe, 0xd4, 0xf8, 0x18, 0x01, 0xd5, 0xf8, 0xe0, 0x10, 0x48, 0x40, + 0xa8, 0x63, 0xd4, 0xf8, 0x1c, 0x01, 0xe8, 0x63, 0x8d, 0x20, 0x84, 0xf8, + 0x3b, 0x03, 0x29, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, + 0x27, 0x48, 0x28, 0x4a, 0x01, 0x21, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, + 0xd4, 0xf8, 0x1c, 0x04, 0x50, 0xb1, 0x01, 0x7e, 0x05, 0x29, 0x07, 0xd1, + 0x81, 0x79, 0x49, 0x06, 0x04, 0xd5, 0x1c, 0x49, 0x91, 0xf8, 0xa6, 0x12, + 0x49, 0x06, 0x25, 0xd4, 0x20, 0x48, 0x02, 0x68, 0x20, 0x46, 0x29, 0x46, + 0x90, 0x47, 0x1f, 0x48, 0x4f, 0xf4, 0x7a, 0x41, 0x0c, 0x22, 0x03, 0x68, + 0x20, 0x46, 0xbd, 0xe8, 0xf0, 0x47, 0x18, 0x47, 0x28, 0x6c, 0x86, 0xf8, + 0x00, 0xa0, 0x20, 0xf0, 0x01, 0x00, 0x28, 0x64, 0x12, 0x48, 0x90, 0xf8, + 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, 0x11, 0x48, 0x15, 0x4a, 0x00, 0x21, + 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x41, 0x48, 0x0d, 0x21, 0x02, 0x68, + 0x20, 0x46, 0xbd, 0xe8, 0xf0, 0x47, 0x10, 0x47, 0x0c, 0x49, 0x0a, 0x68, + 0xd9, 0xe7, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, 0xa0, 0x9b, 0x08, 0x00, + 0x84, 0x9b, 0x08, 0x00, 0x80, 0x9b, 0x08, 0x00, 0x8c, 0xb8, 0x08, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0xff, 0x6a, 0x01, 0x00, 0x50, 0x6e, 0x03, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x70, 0x9b, 0x08, 0x00, 0x65, 0x6e, 0x03, 0x00, + 0xa0, 0xb8, 0x08, 0x00, 0xb8, 0xb8, 0x08, 0x00, 0x8c, 0x9b, 0x08, 0x00, + 0x34, 0x6e, 0x03, 0x00, 0x70, 0xb5, 0x1e, 0x46, 0x04, 0x46, 0x01, 0xf0, + 0xdd, 0xf8, 0x05, 0x46, 0x50, 0xbb, 0xd4, 0xf8, 0x34, 0x03, 0x01, 0x2e, + 0x20, 0xf0, 0x80, 0x51, 0xc4, 0xf8, 0x34, 0x13, 0x22, 0xd1, 0x80, 0x00, + 0x03, 0xd5, 0x11, 0x48, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0xb4, 0xf8, + 0x84, 0x00, 0x80, 0x06, 0x18, 0xd5, 0xd4, 0xf8, 0xd4, 0x00, 0x40, 0x7f, + 0xa0, 0xb1, 0xd4, 0xf8, 0x34, 0x03, 0x41, 0x00, 0x10, 0xd5, 0x94, 0xf8, + 0x35, 0x11, 0x09, 0x4a, 0x68, 0x23, 0x11, 0xfb, 0x03, 0x21, 0x51, 0xf8, + 0x60, 0x2f, 0x01, 0x32, 0x06, 0xd0, 0x4f, 0xf0, 0xff, 0x32, 0x20, 0xf0, + 0x80, 0x40, 0x0a, 0x60, 0xc4, 0xf8, 0x34, 0x03, 0x28, 0x46, 0x70, 0xbd, + 0x10, 0xb5, 0x08, 0x00, 0xb0, 0xe6, 0x05, 0x00, 0x70, 0xb5, 0x05, 0x46, + 0xd0, 0xf8, 0x00, 0x04, 0x0e, 0x46, 0x95, 0xf8, 0x35, 0x11, 0xd0, 0xf8, + 0xec, 0x40, 0x55, 0x20, 0xf1, 0xf7, 0x56, 0xf8, 0x0d, 0x2e, 0x18, 0xbf, + 0x70, 0xbd, 0x09, 0x48, 0x10, 0x21, 0x02, 0x68, 0x28, 0x46, 0x90, 0x47, + 0x07, 0x48, 0x10, 0x21, 0x1f, 0x22, 0x00, 0x23, 0x06, 0x68, 0x28, 0x46, + 0xb0, 0x47, 0x05, 0x48, 0x10, 0x21, 0x02, 0x68, 0x20, 0x46, 0xbd, 0xe8, + 0x70, 0x40, 0x10, 0x47, 0x9c, 0xc4, 0x08, 0x00, 0x94, 0x9b, 0x08, 0x00, + 0xcc, 0xc4, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x85, 0xb0, 0x06, 0x46, + 0xb6, 0x48, 0xd6, 0xf8, 0x00, 0x90, 0x03, 0x68, 0x09, 0xf5, 0x80, 0x7a, + 0x99, 0xf8, 0x2c, 0x13, 0x4a, 0x46, 0x50, 0x46, 0x98, 0x47, 0x00, 0xb3, + 0x90, 0xf8, 0x24, 0x01, 0x0a, 0x28, 0x1c, 0xd1, 0x02, 0x20, 0x89, 0xf8, + 0x08, 0x03, 0xae, 0x48, 0x00, 0x68, 0x80, 0x47, 0xad, 0x48, 0xc0, 0x78, + 0x01, 0x28, 0x0a, 0xd1, 0xd9, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0x01, 0x28, + 0x05, 0xd1, 0xaa, 0x49, 0x99, 0xf9, 0x3d, 0x03, 0x0a, 0x68, 0x01, 0x21, + 0x90, 0x47, 0xa8, 0x48, 0x0b, 0x21, 0x02, 0x68, 0x48, 0x46, 0x05, 0xb0, + 0xbd, 0xe8, 0xf0, 0x4f, 0x10, 0x47, 0xb9, 0xf8, 0xe2, 0x02, 0x99, 0xf8, + 0x3d, 0x13, 0x00, 0x01, 0x80, 0xb2, 0xc9, 0xf8, 0xf0, 0x00, 0x15, 0x20, + 0xf0, 0xf7, 0xfe, 0xff, 0x9f, 0x48, 0x01, 0x21, 0x01, 0x22, 0x03, 0x68, + 0x48, 0x46, 0x98, 0x47, 0x74, 0x68, 0xa0, 0x79, 0xff, 0x28, 0x06, 0xd0, + 0x9b, 0x49, 0x34, 0x22, 0x09, 0x68, 0x10, 0xfb, 0x02, 0x10, 0x26, 0x30, + 0x00, 0xe0, 0x00, 0x20, 0x04, 0x90, 0xd9, 0xf8, 0xd4, 0x00, 0x40, 0x7f, + 0x00, 0xb3, 0x96, 0x48, 0x90, 0xf8, 0x9e, 0x10, 0xc9, 0x07, 0x0e, 0xd1, + 0xd0, 0xf8, 0xac, 0x00, 0x58, 0xb1, 0x00, 0xf5, 0x80, 0x70, 0x51, 0x46, + 0x06, 0x22, 0xfb, 0xf7, 0x53, 0xfb, 0x20, 0xb9, 0x8f, 0x48, 0x49, 0x46, + 0x02, 0x68, 0x02, 0x20, 0x90, 0x47, 0x8e, 0x48, 0xb9, 0xf8, 0xdc, 0x12, + 0xb9, 0xf8, 0xe4, 0x32, 0x05, 0x68, 0xb9, 0xf8, 0xe2, 0x02, 0x0a, 0x46, + 0x00, 0x90, 0x48, 0x46, 0xa8, 0x47, 0x3a, 0xe0, 0x86, 0x48, 0x49, 0x46, + 0x02, 0x68, 0x02, 0x20, 0x90, 0x47, 0xc9, 0x48, 0x90, 0xf8, 0x1c, 0x51, + 0x8d, 0xb3, 0x84, 0x48, 0x00, 0x27, 0x4f, 0xf0, 0x01, 0x0b, 0x40, 0xf2, + 0x52, 0x58, 0x00, 0x68, 0x00, 0xf5, 0x99, 0x76, 0x16, 0xf8, 0xde, 0x0c, + 0x01, 0x28, 0x0e, 0xd1, 0x16, 0xf8, 0xdd, 0x0c, 0x0a, 0x28, 0x0a, 0xd8, + 0x0b, 0xfa, 0x00, 0xf0, 0x10, 0xea, 0x08, 0x0f, 0x05, 0xd0, 0x70, 0x1c, + 0x51, 0x46, 0x06, 0x22, 0xfb, 0xf7, 0x1c, 0xfb, 0x28, 0xb1, 0x01, 0x37, + 0x06, 0xf5, 0xa8, 0x76, 0xaf, 0x42, 0xe7, 0xd3, 0x0f, 0xe0, 0x74, 0x48, + 0x74, 0x49, 0x0b, 0x23, 0x32, 0x58, 0x16, 0xf8, 0x01, 0x0b, 0x0d, 0x68, + 0x00, 0x21, 0xcd, 0xe9, 0x00, 0x11, 0x31, 0x46, 0xa8, 0x47, 0x70, 0x48, + 0x01, 0x68, 0x78, 0xb2, 0x88, 0x47, 0x01, 0x20, 0x4a, 0x46, 0x00, 0x23, + 0x00, 0x26, 0xa9, 0xf8, 0x40, 0x04, 0x6c, 0x48, 0x01, 0x88, 0xa9, 0xf8, + 0x36, 0x14, 0x41, 0x88, 0xa9, 0xf8, 0x38, 0x14, 0x81, 0x88, 0xa9, 0xf8, + 0x3a, 0x14, 0xc1, 0x88, 0x00, 0x89, 0xa9, 0xf8, 0x3e, 0x04, 0x63, 0x48, + 0xa9, 0xf8, 0x3c, 0x14, 0x05, 0x68, 0x99, 0xf8, 0x2c, 0x03, 0x00, 0x94, + 0x04, 0x99, 0x01, 0x91, 0x51, 0x46, 0xa8, 0x47, 0xd9, 0xf8, 0xd4, 0x00, + 0x40, 0x7f, 0x70, 0xb1, 0x5e, 0x48, 0x00, 0x78, 0xc0, 0x07, 0x0a, 0xd0, + 0x99, 0xf9, 0x3d, 0x03, 0x00, 0xf0, 0xae, 0xff, 0x5b, 0x49, 0x99, 0xf8, + 0x3d, 0x03, 0x4a, 0x46, 0x0b, 0x68, 0x00, 0x21, 0x98, 0x47, 0x59, 0x4a, + 0x99, 0xf8, 0x35, 0x01, 0x99, 0xf8, 0xb8, 0x12, 0x12, 0x68, 0x90, 0x47, + 0x56, 0x48, 0x01, 0x68, 0x48, 0x46, 0x88, 0x47, 0x55, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x55, 0x48, 0x99, 0xf8, 0x35, 0x11, 0x02, 0x68, 0x54, 0x48, + 0x90, 0x47, 0x3f, 0x48, 0x00, 0x68, 0x80, 0x47, 0x52, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x52, 0x48, 0x00, 0x68, 0x80, 0x47, 0x51, 0x48, 0x99, 0xf8, + 0x35, 0x11, 0x03, 0x22, 0x00, 0x23, 0x04, 0x68, 0x09, 0xf5, 0xee, 0x70, + 0xcd, 0xe9, 0x00, 0x66, 0xcd, 0xe9, 0x02, 0x66, 0xa0, 0x47, 0x4c, 0x48, + 0x01, 0x21, 0x02, 0x68, 0x00, 0x20, 0x90, 0x47, 0x60, 0xb1, 0x4a, 0x48, + 0x04, 0x68, 0xd9, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0x08, 0xb1, 0x18, 0x20, + 0x00, 0xe0, 0x16, 0x20, 0x49, 0x46, 0x00, 0x22, 0x01, 0x23, 0xa0, 0x47, + 0x76, 0x48, 0xb0, 0xf8, 0xe0, 0x01, 0xc0, 0x07, 0x06, 0xd0, 0x41, 0x48, + 0x49, 0x46, 0x00, 0x22, 0x01, 0x23, 0x04, 0x68, 0x16, 0x20, 0xa0, 0x47, + 0x99, 0xf8, 0xf2, 0x02, 0x02, 0x28, 0x01, 0xd3, 0x05, 0x28, 0x05, 0xd3, + 0x99, 0xf8, 0xf3, 0x02, 0x02, 0x28, 0x07, 0xd3, 0x04, 0x28, 0x05, 0xd8, + 0x99, 0xf8, 0x4b, 0x03, 0x40, 0xf0, 0x08, 0x00, 0x89, 0xf8, 0x4b, 0x03, + 0x09, 0xf2, 0xbb, 0x30, 0x28, 0x21, 0xed, 0xf7, 0xeb, 0xfe, 0x33, 0x48, + 0x99, 0xf8, 0x74, 0x10, 0x00, 0x22, 0x03, 0x68, 0x48, 0x46, 0x98, 0x47, + 0x99, 0xf8, 0xf2, 0x12, 0x48, 0x46, 0x81, 0x22, 0x00, 0x23, 0x1a, 0xf0, + 0x3f, 0xff, 0x2d, 0x48, 0xd0, 0xf8, 0x90, 0x60, 0xde, 0xb1, 0xdf, 0xf8, + 0xb0, 0xb0, 0xdf, 0xf8, 0xb0, 0x80, 0x00, 0xf1, 0x90, 0x07, 0x71, 0x79, + 0x99, 0xf8, 0x2c, 0x03, 0xdb, 0xf8, 0x00, 0x50, 0x56, 0xf8, 0x04, 0x4c, + 0xb3, 0x1d, 0x52, 0x46, 0xa8, 0x47, 0x38, 0xb1, 0xd8, 0xf8, 0x00, 0x20, + 0x38, 0x46, 0x31, 0x46, 0x90, 0x47, 0x30, 0x46, 0xf0, 0xf7, 0xe6, 0xfe, + 0x00, 0x2c, 0x26, 0x46, 0xe9, 0xd1, 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0xf8, 0xc8, 0x08, 0x00, 0xd4, 0xc4, 0x08, 0x00, 0xa8, 0x56, 0x01, 0x00, + 0x40, 0xc7, 0x08, 0x00, 0x38, 0xc7, 0x08, 0x00, 0xc0, 0x9b, 0x08, 0x00, + 0x20, 0x54, 0x01, 0x00, 0x90, 0x01, 0x00, 0x00, 0x9c, 0xba, 0x08, 0x00, + 0x3c, 0xc7, 0x08, 0x00, 0xdc, 0x35, 0x01, 0x00, 0xd2, 0xfe, 0xff, 0xff, + 0xe0, 0xb4, 0x08, 0x00, 0x08, 0xb5, 0x08, 0x00, 0x70, 0x58, 0x01, 0x00, + 0x99, 0x53, 0x01, 0x00, 0xe8, 0xb4, 0x08, 0x00, 0xf0, 0xc6, 0x08, 0x00, + 0x00, 0xc7, 0x08, 0x00, 0x3c, 0xc5, 0x08, 0x00, 0xa4, 0xda, 0x08, 0x00, + 0xc0, 0x52, 0x01, 0x00, 0xec, 0xba, 0x08, 0x00, 0xfc, 0xba, 0x08, 0x00, + 0x48, 0xd4, 0x08, 0x00, 0x0c, 0xbb, 0x08, 0x00, 0x80, 0x9b, 0x08, 0x00, + 0x00, 0x9c, 0x08, 0x00, 0x2c, 0xba, 0x01, 0x00, 0x5c, 0xc7, 0x08, 0x00, + 0xe8, 0xa0, 0x08, 0x00, 0x70, 0xb5, 0x0d, 0x46, 0x04, 0x46, 0x12, 0x48, + 0x6e, 0x79, 0x01, 0x68, 0x30, 0x46, 0x88, 0x47, 0x01, 0x28, 0x02, 0xd8, + 0x16, 0xf0, 0xf0, 0x0f, 0x09, 0xd0, 0x98, 0x48, 0x20, 0x21, 0x23, 0x22, + 0x00, 0x23, 0xd0, 0xf8, 0x00, 0xc0, 0x20, 0x46, 0xbd, 0xe8, 0x70, 0x40, + 0x60, 0x47, 0xd4, 0xf8, 0x1c, 0x04, 0x10, 0xb1, 0x00, 0x7e, 0x05, 0x28, + 0x01, 0xd0, 0x00, 0x2e, 0xed, 0xd0, 0x10, 0x2e, 0xeb, 0xd2, 0x20, 0x46, + 0x29, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, 0xb7, 0xbe, 0x00, 0xbf, + 0x5c, 0x9e, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0xb6, 0xfe, + 0x16, 0x48, 0xb0, 0xf8, 0xe0, 0x01, 0x80, 0x06, 0x09, 0xd5, 0xd4, 0xf8, + 0xd4, 0x00, 0x40, 0x7f, 0x28, 0xb9, 0x7d, 0x48, 0x90, 0xf9, 0x04, 0x00, + 0xb0, 0xf1, 0xff, 0x3f, 0x00, 0xdd, 0x10, 0xbd, 0xf6, 0x48, 0x21, 0x46, + 0x00, 0x22, 0x01, 0x23, 0xd0, 0xf8, 0x00, 0xc0, 0x55, 0x20, 0xbd, 0xe8, + 0x10, 0x40, 0x60, 0x47, 0x70, 0xb5, 0x09, 0x4e, 0x73, 0x4c, 0xb6, 0xf8, + 0xe0, 0x21, 0x25, 0x79, 0x92, 0x06, 0x44, 0xbf, 0x05, 0xf0, 0x7f, 0x02, + 0x22, 0x71, 0x00, 0xf0, 0x95, 0xfe, 0xb6, 0xf8, 0xe0, 0x01, 0x80, 0x06, + 0x48, 0xbf, 0x25, 0x71, 0x70, 0xbd, 0x00, 0xbf, 0xe8, 0x65, 0x08, 0x00, + 0xb0, 0xb5, 0x90, 0xf8, 0x4e, 0x53, 0x04, 0x46, 0x45, 0xf0, 0x80, 0x00, + 0x84, 0xf8, 0x4e, 0x03, 0x20, 0x46, 0x00, 0xf0, 0x87, 0xfe, 0x84, 0xf8, + 0x4e, 0x53, 0xb0, 0xbd, 0xb0, 0xb5, 0x90, 0xf8, 0x4e, 0x53, 0x04, 0x46, + 0x45, 0xf0, 0x80, 0x00, 0x84, 0xf8, 0x4e, 0x03, 0x20, 0x46, 0x00, 0xf0, + 0x7f, 0xfe, 0x84, 0xf8, 0x4e, 0x53, 0xb0, 0xbd, 0x2d, 0xe9, 0xf8, 0x4f, + 0x58, 0xb1, 0x04, 0x46, 0x59, 0x48, 0x0d, 0x46, 0x00, 0x79, 0x81, 0x06, + 0x48, 0xbf, 0x5f, 0xea, 0x40, 0x60, 0x09, 0xd4, 0x5b, 0x48, 0x1a, 0x21, + 0x38, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x2e, 0x41, 0xbd, 0xe8, 0xf8, 0x4f, + 0xf0, 0xf7, 0xf4, 0xbd, 0x94, 0xf8, 0x3b, 0x03, 0x93, 0x28, 0x09, 0xd1, + 0x94, 0xf8, 0x35, 0x11, 0x53, 0x20, 0xf0, 0xf7, 0xf1, 0xfd, 0x4d, 0x48, + 0x93, 0x21, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x68, 0x79, 0xa9, 0x79, + 0x40, 0xea, 0x01, 0x26, 0xb6, 0xf5, 0xfa, 0x7f, 0x1a, 0xd8, 0xce, 0xb1, + 0xe8, 0x7a, 0x29, 0x7b, 0x40, 0xea, 0x01, 0x27, 0xbe, 0x42, 0x13, 0xd9, + 0x68, 0x7a, 0xa9, 0x7a, 0x40, 0xea, 0x01, 0x29, 0x09, 0xf1, 0x01, 0x00, + 0x70, 0x43, 0xb0, 0xf5, 0xfa, 0x7f, 0x09, 0xd8, 0xb4, 0xf8, 0xdc, 0x12, + 0xaa, 0x7b, 0x48, 0x43, 0x69, 0x7b, 0x41, 0xea, 0x02, 0x2a, 0xb0, 0xeb, + 0x8a, 0x0f, 0x0a, 0xd9, 0x3e, 0x48, 0x1e, 0x21, 0xd0, 0xf8, 0x00, 0xc0, + 0x20, 0x46, 0x27, 0x22, 0x00, 0x23, 0x01, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, + 0x60, 0x47, 0xe8, 0x79, 0x95, 0xf8, 0x08, 0x80, 0x00, 0x90, 0xb4, 0xf8, + 0x40, 0x04, 0x86, 0x42, 0x12, 0xd1, 0xb4, 0xf8, 0xe4, 0x02, 0x81, 0x45, + 0x0e, 0xd1, 0xb4, 0xf8, 0x42, 0x04, 0x87, 0x42, 0x0a, 0xd1, 0xb4, 0xf8, + 0xe2, 0x02, 0x82, 0x45, 0x06, 0xd1, 0x94, 0xf8, 0x31, 0x03, 0x80, 0x07, + 0x02, 0xd4, 0x4f, 0xf0, 0x00, 0x0b, 0x01, 0xe0, 0x4f, 0xf0, 0x01, 0x0b, + 0x26, 0x48, 0x01, 0x68, 0x14, 0x20, 0x88, 0x47, 0xc8, 0xb1, 0x06, 0x80, + 0x05, 0x46, 0xa0, 0xf8, 0x08, 0xa0, 0x87, 0x80, 0xa0, 0xf8, 0x06, 0x90, + 0x00, 0x98, 0x21, 0x4e, 0x40, 0xea, 0x08, 0x20, 0x68, 0x80, 0x72, 0xb6, + 0x30, 0x68, 0x40, 0x00, 0x01, 0x30, 0x30, 0x60, 0xd4, 0xf8, 0x4c, 0x04, + 0x60, 0xb1, 0xf0, 0xf7, 0x9f, 0xfd, 0x00, 0x20, 0xc4, 0xf8, 0x4c, 0x04, + 0x07, 0xe0, 0xd4, 0xf8, 0x30, 0x03, 0x20, 0xf4, 0x00, 0x70, 0xc4, 0xf8, + 0x30, 0x03, 0x10, 0xe0, 0x01, 0x20, 0xc4, 0xf8, 0x4c, 0x54, 0x31, 0x68, + 0x4f, 0xea, 0x51, 0x01, 0x31, 0x60, 0x31, 0x68, 0x81, 0xf3, 0x10, 0x88, + 0xd4, 0xf8, 0x30, 0x13, 0x21, 0xf4, 0x00, 0x71, 0xc4, 0xf8, 0x30, 0x13, + 0x18, 0xb1, 0x0d, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xbb, 0xf1, + 0x00, 0x0f, 0x08, 0xbf, 0xbd, 0xe8, 0xf8, 0x8f, 0x09, 0x48, 0xd4, 0xf8, + 0x4c, 0x24, 0x00, 0x21, 0x03, 0x68, 0x20, 0x46, 0x01, 0xb0, 0xbd, 0xe8, + 0xf0, 0x4f, 0x18, 0x47, 0x70, 0x52, 0x01, 0x00, 0x88, 0x9b, 0x08, 0x00, + 0x78, 0xc4, 0x08, 0x00, 0x24, 0x36, 0x01, 0x00, 0x20, 0xb5, 0x08, 0x00, + 0xec, 0xb4, 0x08, 0x00, 0x94, 0x9b, 0x08, 0x00, 0x2d, 0xe9, 0xf8, 0x43, + 0x05, 0x46, 0x10, 0x78, 0x0e, 0x46, 0x35, 0x49, 0x14, 0x46, 0x02, 0x46, + 0x01, 0xeb, 0x40, 0x03, 0x03, 0x28, 0x88, 0xbf, 0x04, 0x22, 0x11, 0xf8, + 0x12, 0x80, 0x05, 0xeb, 0xc2, 0x07, 0x01, 0x33, 0x03, 0x28, 0x2f, 0x4a, + 0x88, 0xbf, 0x01, 0xf1, 0x09, 0x03, 0x03, 0x21, 0x93, 0xf8, 0x00, 0x90, + 0x05, 0x28, 0x38, 0xbf, 0x02, 0x21, 0x97, 0xf8, 0xbc, 0x03, 0x12, 0x68, + 0x90, 0x47, 0xa0, 0x70, 0x7e, 0xb1, 0x70, 0x79, 0x01, 0x28, 0x0c, 0xd1, + 0x30, 0x79, 0x05, 0x28, 0x3c, 0xd0, 0x40, 0xb9, 0x70, 0x78, 0x31, 0x78, + 0x60, 0x70, 0x23, 0x48, 0x21, 0x70, 0x02, 0x68, 0x28, 0x46, 0x90, 0x47, + 0x37, 0xe0, 0x97, 0xf8, 0xbe, 0x03, 0x01, 0x28, 0x13, 0xd8, 0x7f, 0x20, + 0x22, 0x78, 0x29, 0x46, 0x8d, 0xf8, 0x03, 0x00, 0x1c, 0x48, 0x04, 0x2a, + 0x28, 0xbf, 0x04, 0x22, 0x03, 0x68, 0x0d, 0xf1, 0x03, 0x00, 0x98, 0x47, + 0x9d, 0xf8, 0x03, 0x00, 0x7f, 0x28, 0x08, 0xd1, 0x00, 0x20, 0xbd, 0xe8, + 0xf8, 0x83, 0x02, 0x28, 0x14, 0xbf, 0x00, 0x20, 0x7f, 0x20, 0x60, 0x70, + 0x1a, 0xe0, 0x4f, 0xfa, 0x88, 0xf2, 0x07, 0xf2, 0xbe, 0x31, 0x02, 0x23, + 0x42, 0xfa, 0x89, 0xf2, 0x09, 0x78, 0x92, 0xfb, 0xf3, 0xf2, 0xa2, 0xeb, + 0x00, 0x00, 0x60, 0x70, 0x61, 0xb9, 0x97, 0xf9, 0xc0, 0x13, 0x49, 0xb1, + 0x40, 0xb2, 0x88, 0x42, 0xe2, 0xdb, 0x05, 0xe0, 0x7f, 0x20, 0xa0, 0x70, + 0x00, 0x20, 0x70, 0x71, 0x30, 0x78, 0x20, 0x70, 0x01, 0x20, 0xbd, 0xe8, + 0xf8, 0x83, 0x00, 0xbf, 0x80, 0x53, 0x01, 0x00, 0x34, 0x9c, 0x08, 0x00, + 0x58, 0x9e, 0x08, 0x00, 0x1c, 0xcb, 0x08, 0x00, 0x2d, 0xe9, 0xfc, 0x47, + 0x04, 0x46, 0x33, 0x48, 0x0d, 0x46, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0x00, 0x28, 0x56, 0xd0, 0x94, 0xf9, 0x3c, 0x03, 0x00, 0x28, 0x22, 0xd4, + 0xdf, 0xf8, 0xb8, 0x90, 0x04, 0xf2, 0xbe, 0x36, 0x04, 0xf2, 0xe3, 0x35, + 0x00, 0x20, 0x0d, 0xf1, 0x04, 0x08, 0x4f, 0xf0, 0x03, 0x0a, 0x07, 0x46, + 0x16, 0xf8, 0x30, 0x00, 0x03, 0x28, 0x0e, 0xd0, 0x38, 0x46, 0x03, 0x2f, + 0x29, 0x46, 0x42, 0x46, 0x88, 0xbf, 0x05, 0x20, 0xd9, 0xf8, 0x00, 0x30, + 0x8d, 0xf8, 0x04, 0x00, 0x20, 0x46, 0x98, 0x47, 0x70, 0xb9, 0x06, 0xf8, + 0x37, 0xa0, 0x78, 0x1c, 0x05, 0x28, 0xe8, 0xd1, 0x1b, 0xe0, 0x21, 0x48, + 0x21, 0x46, 0x2a, 0x46, 0x01, 0x23, 0x06, 0x68, 0x32, 0x20, 0xb0, 0x47, + 0xbd, 0xe8, 0xfc, 0x87, 0x19, 0x48, 0x01, 0xa9, 0x02, 0x68, 0x20, 0x46, + 0x90, 0x47, 0x01, 0x28, 0x0b, 0xd1, 0x17, 0x48, 0x4f, 0xf4, 0x7a, 0x41, + 0x0b, 0x22, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x0c, 0x20, 0x84, 0xf8, + 0x3b, 0x03, 0xbd, 0xe8, 0xfc, 0x87, 0x04, 0xeb, 0xc7, 0x00, 0x03, 0x21, + 0x80, 0xf8, 0xbe, 0x13, 0x0f, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0x01, 0x28, 0x08, 0xd1, 0x0d, 0x48, 0x21, 0x46, 0x00, 0x22, 0x01, 0x23, + 0x05, 0x68, 0x32, 0x20, 0xa8, 0x47, 0xbd, 0xe8, 0xfc, 0x87, 0xd4, 0xf8, + 0x34, 0x03, 0x20, 0xf0, 0x80, 0x00, 0xc4, 0xf8, 0x34, 0x03, 0xbd, 0xe8, + 0xfc, 0x87, 0x00, 0xbf, 0x10, 0xc1, 0x08, 0x00, 0x18, 0xc1, 0x08, 0x00, + 0x1c, 0xc1, 0x08, 0x00, 0x8c, 0x9b, 0x08, 0x00, 0x14, 0xc1, 0x08, 0x00, + 0x80, 0x9b, 0x08, 0x00, 0xf0, 0xb5, 0x85, 0xb0, 0x4f, 0x4f, 0x04, 0x46, + 0x0d, 0x46, 0x38, 0x68, 0x04, 0x90, 0x4e, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x70, 0xb1, 0xf1, 0x48, 0x21, 0x46, 0x2a, 0x46, 0x01, 0x23, + 0x06, 0x68, 0x96, 0x20, 0xb0, 0x47, 0x38, 0x68, 0x04, 0x99, 0x40, 0x1a, + 0x04, 0xbf, 0x05, 0xb0, 0xf0, 0xbd, 0xf0, 0xf7, 0x29, 0xfc, 0x25, 0xb9, + 0x00, 0x20, 0x40, 0xf2, 0x55, 0x51, 0xea, 0xf7, 0xd3, 0xfd, 0x28, 0x79, + 0x0e, 0x28, 0x0b, 0xd1, 0x40, 0x48, 0x00, 0x78, 0x00, 0x07, 0x07, 0xd4, + 0x45, 0x48, 0x07, 0x21, 0x0e, 0x22, 0x00, 0x23, 0x05, 0x68, 0x20, 0x46, + 0xa8, 0x47, 0xe2, 0xe7, 0x94, 0xf8, 0x3c, 0x03, 0x04, 0x28, 0xde, 0xd0, + 0x6a, 0x1d, 0x02, 0xad, 0x08, 0x21, 0x08, 0x23, 0x28, 0x46, 0xea, 0xf7, + 0xcb, 0xfd, 0x04, 0xf2, 0x4a, 0x36, 0x08, 0x21, 0x2a, 0x46, 0x08, 0x23, + 0x30, 0x46, 0xea, 0xf7, 0xc3, 0xfd, 0x31, 0x4d, 0x9d, 0xf8, 0x08, 0x10, + 0x31, 0x4a, 0x28, 0x78, 0x08, 0x40, 0xd4, 0xf8, 0x34, 0x13, 0x84, 0xf8, + 0x4a, 0x03, 0xc0, 0xb2, 0x41, 0xf0, 0x04, 0x01, 0xc4, 0xf8, 0x34, 0x13, + 0x94, 0xf8, 0x4b, 0x13, 0x40, 0xea, 0x01, 0x23, 0x28, 0x48, 0x78, 0x21, + 0xed, 0xf7, 0xd4, 0xff, 0x28, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, + 0x05, 0xd5, 0x27, 0x48, 0x23, 0x4a, 0x02, 0x21, 0x03, 0x68, 0x02, 0x20, + 0x98, 0x47, 0x30, 0x78, 0x80, 0x06, 0x44, 0xbf, 0x28, 0x78, 0x5f, 0xea, + 0x80, 0x60, 0x27, 0xd4, 0x94, 0xf8, 0x4d, 0x03, 0xc1, 0x07, 0x01, 0xd1, + 0x80, 0x07, 0x05, 0xd5, 0xd4, 0xf8, 0x34, 0x03, 0x40, 0xf4, 0x80, 0x70, + 0xc4, 0xf8, 0x34, 0x03, 0x6e, 0x46, 0x08, 0x21, 0x2a, 0x46, 0x08, 0x23, + 0x30, 0x46, 0xea, 0xf7, 0x87, 0xfd, 0x04, 0x20, 0x9d, 0xf8, 0x08, 0x10, + 0x84, 0xf8, 0x3c, 0x03, 0x28, 0x78, 0x08, 0x40, 0x31, 0x46, 0x8d, 0xf8, + 0x00, 0x00, 0x9d, 0xf8, 0x03, 0x00, 0x00, 0xf0, 0xf7, 0x00, 0x8d, 0xf8, + 0x03, 0x00, 0x11, 0x48, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x7e, 0xe7, + 0x0d, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x00, 0x28, 0xd1, 0xd0, + 0xaa, 0x48, 0x21, 0x46, 0x00, 0x22, 0x01, 0x23, 0x06, 0x68, 0x20, 0x20, + 0xb0, 0x47, 0xc9, 0xe7, 0x38, 0xec, 0x01, 0x00, 0xa0, 0x9b, 0x08, 0x00, + 0x70, 0x52, 0x01, 0x00, 0xff, 0x6a, 0x01, 0x00, 0x74, 0x6e, 0x03, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x70, 0x9b, 0x08, 0x00, 0x7c, 0x9b, 0x08, 0x00, + 0x10, 0xc2, 0x08, 0x00, 0x98, 0x9b, 0x08, 0x00, 0xf0, 0xb5, 0x85, 0xb0, + 0x04, 0x46, 0x15, 0x46, 0x90, 0xf8, 0x35, 0x01, 0x01, 0xf0, 0x7f, 0x03, + 0x26, 0x29, 0x94, 0xf8, 0x3b, 0x23, 0x8d, 0xf8, 0x0d, 0x30, 0x8d, 0xf8, + 0x0e, 0x00, 0x8d, 0xf8, 0x0c, 0x20, 0x94, 0xf9, 0x3c, 0x23, 0x8d, 0xf8, + 0x10, 0x20, 0x49, 0xd0, 0x05, 0x29, 0x4f, 0xd1, 0x00, 0x2d, 0x60, 0xd0, + 0xa9, 0x78, 0x02, 0x29, 0x4d, 0xd1, 0x8f, 0x49, 0x68, 0x22, 0x10, 0xfb, + 0x02, 0x10, 0x00, 0x79, 0x01, 0x28, 0x46, 0xd1, 0x5c, 0x48, 0x90, 0x21, + 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x5b, 0x48, 0x00, 0x21, 0x02, 0x68, + 0x20, 0x46, 0x90, 0x47, 0x59, 0x48, 0xb4, 0xf8, 0xdc, 0x72, 0x94, 0xf8, + 0xec, 0x32, 0x94, 0xf8, 0x35, 0x11, 0xb4, 0xf8, 0xe4, 0x62, 0xd0, 0xf8, + 0x00, 0xc0, 0xd4, 0xf8, 0xd4, 0x00, 0x42, 0x7f, 0xb4, 0xf8, 0xda, 0x02, + 0xcd, 0xe9, 0x00, 0x07, 0x10, 0x20, 0x02, 0x96, 0xe0, 0x47, 0x50, 0x48, + 0x94, 0xf8, 0xf2, 0x12, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x28, 0x46, + 0xf0, 0xf7, 0x72, 0xfb, 0xf4, 0x48, 0x00, 0x68, 0x18, 0xb9, 0x45, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x94, 0xf8, 0x3b, 0x03, 0x03, 0xaa, + 0x00, 0x21, 0x05, 0x23, 0x8d, 0xf8, 0x0f, 0x00, 0x40, 0x48, 0x05, 0x68, + 0x40, 0xf2, 0x03, 0x20, 0xa8, 0x47, 0x12, 0xe0, 0x00, 0x2a, 0x03, 0xd4, + 0x39, 0x48, 0x00, 0x68, 0x80, 0x47, 0xd0, 0xb1, 0x01, 0x26, 0x19, 0xe0, + 0x20, 0x46, 0x2a, 0x46, 0x12, 0xe0, 0x20, 0x46, 0x05, 0x21, 0x2a, 0x46, + 0x00, 0xf0, 0xa8, 0xfb, 0xa8, 0x78, 0x01, 0x28, 0x44, 0xd1, 0x94, 0xf8, + 0xf2, 0x12, 0x20, 0x46, 0x01, 0x22, 0x00, 0x23, 0x1a, 0xf0, 0x80, 0xfb, + 0x3c, 0xe0, 0x20, 0x46, 0x05, 0x21, 0x00, 0x22, 0x00, 0xf0, 0x98, 0xfb, + 0x36, 0xe0, 0x00, 0x26, 0x2a, 0x48, 0x29, 0x46, 0x05, 0x22, 0x03, 0x68, + 0x20, 0x46, 0x98, 0x47, 0xd5, 0x48, 0x00, 0x22, 0x01, 0x1d, 0x00, 0x20, + 0x51, 0xf8, 0x04, 0x3c, 0x2b, 0xb1, 0x0b, 0x78, 0x43, 0xf0, 0x02, 0x03, + 0x02, 0x2b, 0x08, 0xbf, 0x01, 0x30, 0x01, 0x32, 0x0c, 0x31, 0x17, 0x2a, + 0xf2, 0xd1, 0xd4, 0xf8, 0xd4, 0x10, 0x49, 0x7f, 0x39, 0xb1, 0x00, 0x06, + 0x05, 0xd0, 0x94, 0xf8, 0x3b, 0x03, 0x87, 0x28, 0x08, 0xbf, 0x00, 0x2e, + 0x14, 0xd0, 0xc8, 0x48, 0x00, 0x68, 0x18, 0xb9, 0xce, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x94, 0xf8, 0x3b, 0x03, 0x03, 0xaa, 0x00, 0x21, + 0x05, 0x23, 0x8d, 0xf8, 0x0f, 0x00, 0x14, 0x48, 0x04, 0x68, 0x40, 0xf2, + 0x03, 0x20, 0xa0, 0x47, 0x05, 0xb0, 0xf0, 0xbd, 0x94, 0xf8, 0x37, 0x03, + 0x40, 0x06, 0xe6, 0xd4, 0x94, 0xf8, 0x35, 0x01, 0x3d, 0x4d, 0x68, 0x26, + 0x10, 0xfb, 0x06, 0x50, 0x00, 0x6e, 0x01, 0x30, 0xdd, 0xd1, 0xea, 0xf7, + 0x81, 0xfc, 0x94, 0xf8, 0x35, 0x11, 0x11, 0xfb, 0x06, 0x51, 0x08, 0x66, + 0xd4, 0xf8, 0x34, 0x03, 0x40, 0xf0, 0x80, 0x40, 0xc4, 0xf8, 0x34, 0x03, + 0xcf, 0xe7, 0x00, 0xbf, 0x14, 0xb5, 0x08, 0x00, 0xcc, 0xc6, 0x08, 0x00, + 0x10, 0xb5, 0x08, 0x00, 0x78, 0x9b, 0x08, 0x00, 0x88, 0x9b, 0x08, 0x00, + 0x58, 0xc4, 0x08, 0x00, 0x10, 0xbb, 0x08, 0x00, 0x98, 0xc4, 0x08, 0x00, + 0xb0, 0xb5, 0x90, 0xf8, 0x74, 0x50, 0x04, 0x46, 0x00, 0xf0, 0x32, 0xfb, + 0x94, 0xf8, 0xf2, 0x12, 0x20, 0x46, 0x02, 0x22, 0x2b, 0x46, 0xbd, 0xe8, + 0xb0, 0x40, 0x1a, 0xf0, 0x05, 0xbb, 0x00, 0xbf, 0x90, 0xf8, 0x3b, 0x23, + 0x8d, 0x2a, 0x08, 0xbf, 0x00, 0xf0, 0x28, 0xbb, 0xd0, 0xf8, 0x00, 0x14, + 0xd1, 0xf8, 0xec, 0x10, 0x11, 0xb1, 0x91, 0xf8, 0x1f, 0x11, 0x00, 0xe0, + 0x02, 0x21, 0xce, 0x4a, 0x00, 0x23, 0xd2, 0xf8, 0x00, 0xc0, 0x20, 0x22, + 0x60, 0x47, 0x90, 0xf8, 0xd1, 0x11, 0x00, 0x20, 0x0b, 0x29, 0x38, 0xbf, + 0x01, 0x20, 0x70, 0x47, 0xb0, 0xb5, 0x04, 0x46, 0x90, 0xf8, 0x89, 0x00, + 0xc0, 0x07, 0x20, 0xd1, 0xed, 0x48, 0x0d, 0x46, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x48, 0xb1, 0x0d, 0x48, 0x21, 0x46, 0x2a, 0x46, 0x01, 0x23, + 0xd0, 0xf8, 0x00, 0xc0, 0x98, 0x20, 0xbd, 0xe8, 0xb0, 0x40, 0x60, 0x47, + 0x20, 0x46, 0x29, 0x46, 0x00, 0xf0, 0xfe, 0xfa, 0x94, 0xf8, 0xd1, 0x01, + 0x0a, 0x28, 0x08, 0xd8, 0x94, 0xf8, 0x35, 0x01, 0x04, 0x49, 0x68, 0x22, + 0x10, 0xfb, 0x02, 0x10, 0x00, 0x21, 0x80, 0xf8, 0x50, 0x10, 0xb0, 0xbd, + 0x80, 0x9b, 0x08, 0x00, 0xb0, 0xe6, 0x05, 0x00, 0x10, 0xb5, 0x04, 0x46, + 0x00, 0xf0, 0xee, 0xfa, 0x94, 0xf8, 0x3b, 0x03, 0x00, 0xb1, 0x10, 0xbd, + 0x94, 0xf8, 0x3c, 0x03, 0x00, 0x28, 0xfa, 0xd1, 0xd5, 0x48, 0x72, 0xb6, + 0x01, 0x68, 0x49, 0x00, 0x01, 0x31, 0x01, 0x60, 0xb4, 0xf8, 0x84, 0x10, + 0x6f, 0xf3, 0xdf, 0x31, 0xa4, 0xf8, 0x84, 0x10, 0x01, 0x68, 0x49, 0x08, + 0x01, 0x60, 0x00, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x10, 0xbd, 0x00, 0xbf, + 0x01, 0x78, 0x34, 0x29, 0x0b, 0xd1, 0x40, 0x78, 0x68, 0x49, 0x00, 0xeb, + 0x40, 0x00, 0x51, 0xf8, 0x20, 0x00, 0x90, 0xf8, 0x34, 0x03, 0x40, 0x07, + 0x44, 0xbf, 0x01, 0x20, 0x70, 0x47, 0x00, 0x20, 0x70, 0x47, 0xb0, 0xb5, + 0x00, 0x68, 0x00, 0x24, 0x68, 0xb1, 0x05, 0x46, 0xff, 0xf7, 0xe8, 0xff, + 0x20, 0xb9, 0x95, 0xf9, 0x00, 0x00, 0xb0, 0xf1, 0xff, 0x3f, 0x04, 0xdc, + 0x55, 0xf8, 0x04, 0x0c, 0x2c, 0x46, 0x00, 0x28, 0xf1, 0xd1, 0x20, 0x46, + 0xb0, 0xbd, 0x00, 0xbf, 0x2d, 0xe9, 0xf0, 0x41, 0x01, 0xb3, 0x06, 0x46, + 0x91, 0xf8, 0x35, 0x01, 0x0c, 0x46, 0x16, 0x28, 0x1a, 0xd8, 0x53, 0x49, + 0x15, 0x46, 0x00, 0xeb, 0x40, 0x02, 0x51, 0xf8, 0x22, 0x20, 0x9a, 0xb1, + 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x80, 0x00, 0x00, 0x79, 0x03, 0x28, + 0x0c, 0xd1, 0x1f, 0x46, 0xf6, 0xf7, 0xaa, 0xfd, 0xdf, 0xf8, 0x2c, 0x81, + 0xd8, 0xf8, 0x00, 0x00, 0x65, 0xb1, 0xa8, 0x42, 0x3b, 0xd0, 0x4f, 0xf0, + 0x00, 0x08, 0x0c, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x16, 0x71, 0xf0, 0xf7, + 0xf3, 0xf9, 0x0c, 0x20, 0xbd, 0xe8, 0xf0, 0x81, 0x41, 0x1c, 0x02, 0x29, + 0x55, 0xd2, 0x4f, 0xf0, 0x01, 0x08, 0x6f, 0xb1, 0x41, 0x48, 0x00, 0x68, + 0x50, 0xb1, 0x01, 0x78, 0xb1, 0x42, 0x04, 0xd1, 0x94, 0xf8, 0x35, 0x11, + 0x42, 0x78, 0x8a, 0x42, 0x53, 0xd0, 0x50, 0xf8, 0x04, 0x0c, 0xf3, 0xe7, + 0xf6, 0xf7, 0x88, 0xfd, 0xb8, 0xf1, 0x00, 0x0f, 0x2f, 0x46, 0x08, 0xd0, + 0x38, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x28, 0x42, 0xd0, 0x05, 0x21, + 0x07, 0x46, 0xed, 0xf7, 0xc5, 0xf9, 0x94, 0xf8, 0x35, 0x01, 0x3e, 0x70, + 0x78, 0x70, 0x38, 0x46, 0xff, 0xf7, 0x84, 0xff, 0x20, 0xb3, 0x31, 0x48, + 0x2e, 0x49, 0x02, 0x68, 0x38, 0x46, 0x90, 0x47, 0x3c, 0xe0, 0x29, 0x78, + 0xb1, 0x42, 0x04, 0xd1, 0x94, 0xf8, 0x35, 0x11, 0x40, 0x78, 0x88, 0x42, + 0x0f, 0xd0, 0x27, 0x48, 0x27, 0x4f, 0x29, 0x46, 0x02, 0x68, 0x38, 0x46, + 0x90, 0x47, 0xd8, 0xf8, 0x00, 0x00, 0x94, 0xf8, 0x35, 0x11, 0x41, 0x70, + 0x06, 0x70, 0x28, 0x46, 0x39, 0x46, 0xec, 0xf7, 0x2d, 0xfd, 0x4f, 0xf0, + 0xff, 0x30, 0xc8, 0xf8, 0x00, 0x00, 0xf6, 0xf7, 0x4f, 0xfd, 0x2f, 0xe0, + 0x70, 0xb2, 0x1c, 0x49, 0xb0, 0xf1, 0xff, 0x3f, 0x14, 0xdd, 0x38, 0x46, + 0xec, 0xf7, 0x1e, 0xfd, 0x14, 0xe0, 0x01, 0x78, 0xb1, 0x42, 0xa6, 0xd1, + 0x94, 0xf8, 0x35, 0x11, 0x40, 0x78, 0x88, 0x42, 0xa1, 0xd1, 0xe6, 0xe7, + 0x07, 0x20, 0xbd, 0xe8, 0xf0, 0x81, 0xf6, 0xf7, 0x37, 0xfd, 0x3a, 0x20, + 0xbd, 0xe8, 0xf0, 0x81, 0x12, 0x4a, 0x38, 0x46, 0x1b, 0xf0, 0xc0, 0xff, + 0x11, 0x48, 0x01, 0x68, 0x19, 0xb1, 0xa9, 0x42, 0x04, 0xbf, 0x00, 0x21, + 0x01, 0x60, 0x0f, 0x48, 0x01, 0x68, 0x19, 0xb1, 0xa9, 0x42, 0x04, 0xbf, + 0x00, 0x21, 0x01, 0x60, 0x0c, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0x00, 0x20, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, 0xe8, 0x72, 0x01, 0x00, + 0x60, 0x52, 0x01, 0x00, 0xe8, 0xa0, 0x08, 0x00, 0x54, 0x52, 0x01, 0x00, + 0x48, 0xb5, 0x08, 0x00, 0x4c, 0xb5, 0x08, 0x00, 0x5f, 0x68, 0x03, 0x00, + 0x64, 0x52, 0x01, 0x00, 0x68, 0x52, 0x01, 0x00, 0x10, 0xb5, 0x08, 0x00, + 0x08, 0x48, 0x00, 0x78, 0x50, 0xb1, 0x08, 0x4a, 0x00, 0x21, 0x52, 0xf8, + 0x21, 0x30, 0x13, 0xb1, 0xd3, 0xf8, 0x00, 0x34, 0x23, 0xb9, 0x01, 0x31, + 0x81, 0x42, 0xf6, 0xd3, 0x00, 0x20, 0x70, 0x47, 0x01, 0x20, 0x70, 0x47, + 0x53, 0x34, 0x01, 0x00, 0xb8, 0x57, 0x01, 0x00, 0xb0, 0xb5, 0x04, 0x46, + 0xd0, 0xf8, 0xd4, 0x00, 0x0d, 0x46, 0x40, 0x7f, 0x50, 0xb1, 0xff, 0xf7, + 0xe1, 0xff, 0xa0, 0xb1, 0xaa, 0x48, 0x21, 0x46, 0x2a, 0x46, 0x01, 0x23, + 0xd0, 0xf8, 0x00, 0xc0, 0xa2, 0x20, 0x2b, 0xe0, 0x94, 0xf9, 0x3b, 0x03, + 0xb0, 0xf1, 0xff, 0x3f, 0x17, 0xdd, 0x94, 0xf9, 0x3c, 0x03, 0xb0, 0xf1, + 0xff, 0x3f, 0xea, 0xdc, 0x13, 0x48, 0x24, 0x21, 0x19, 0xe0, 0x11, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x28, 0xb1, 0x94, 0xf8, 0x3b, 0x03, 0x81, 0x28, + 0x01, 0xd0, 0x87, 0x28, 0xe0, 0xd1, 0x20, 0x46, 0x29, 0x46, 0xbd, 0xe8, + 0xb0, 0x40, 0x00, 0xf0, 0xa9, 0xb9, 0x10, 0xf1, 0x7f, 0x01, 0x4f, 0xf0, + 0x23, 0x01, 0x03, 0xd0, 0xc0, 0xb2, 0x87, 0x28, 0x18, 0xbf, 0x2a, 0x21, + 0x05, 0x48, 0xd0, 0xf8, 0x00, 0xc0, 0x20, 0x46, 0x0f, 0x22, 0x00, 0x23, + 0xbd, 0xe8, 0xb0, 0x40, 0x60, 0x47, 0x00, 0xbf, 0x14, 0xb5, 0x08, 0x00, + 0x94, 0x9b, 0x08, 0x00, 0xb0, 0xb5, 0x15, 0x46, 0x04, 0x46, 0x00, 0xf0, + 0x93, 0xf9, 0x0f, 0x2d, 0x13, 0xd1, 0x94, 0xf8, 0x3e, 0x03, 0xc1, 0x07, + 0x0f, 0xd0, 0xb4, 0xf8, 0xdc, 0x12, 0x08, 0x29, 0x07, 0xd3, 0x10, 0x29, + 0x05, 0xd8, 0xb4, 0xf8, 0xe8, 0x12, 0x11, 0xb1, 0xb4, 0xf8, 0xea, 0x12, + 0x19, 0xb9, 0x00, 0xf0, 0xfe, 0x00, 0x84, 0xf8, 0x3e, 0x03, 0xb0, 0xbd, + 0x68, 0xb3, 0xb0, 0xb5, 0x05, 0x46, 0x18, 0x48, 0x0c, 0x46, 0x01, 0x68, + 0x28, 0x46, 0x88, 0x47, 0x20, 0xb1, 0x00, 0x20, 0x40, 0xf6, 0x14, 0x01, + 0xea, 0xf7, 0x70, 0xfa, 0xd5, 0xf8, 0x10, 0x03, 0xb8, 0xb9, 0xb5, 0xf8, + 0x14, 0x03, 0xb5, 0xf8, 0x16, 0x13, 0x81, 0x42, 0x11, 0xd1, 0x0f, 0x48, + 0x72, 0xb6, 0x01, 0x68, 0x49, 0x00, 0x01, 0x31, 0x01, 0x60, 0xb5, 0xf8, + 0x84, 0x10, 0x41, 0xf4, 0x00, 0x41, 0xa5, 0xf8, 0x84, 0x10, 0x01, 0x68, + 0x49, 0x08, 0x01, 0x60, 0x00, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x28, 0x46, + 0x21, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x53, 0xb9, 0x00, 0x20, + 0x40, 0xf6, 0x0e, 0x01, 0xf0, 0xf7, 0xac, 0xb8, 0xa0, 0x9b, 0x08, 0x00, + 0x24, 0x36, 0x01, 0x00, 0x20, 0xb1, 0xd0, 0xf8, 0x00, 0x24, 0x0a, 0xb1, + 0x00, 0xf0, 0x4a, 0xb9, 0x70, 0x47, 0xd0, 0xf8, 0x50, 0x24, 0x2a, 0xb1, + 0xb0, 0xf8, 0xe4, 0x32, 0xd3, 0x80, 0xb0, 0xf8, 0xe2, 0x32, 0x13, 0x81, + 0x00, 0xf0, 0x44, 0xb9, 0x90, 0xf8, 0x34, 0x23, 0x52, 0x07, 0x09, 0xd5, + 0x90, 0xf8, 0x4c, 0x23, 0xd2, 0x07, 0x05, 0xd0, 0x03, 0x4a, 0x92, 0x78, + 0xd2, 0x07, 0x18, 0xbf, 0x00, 0xf0, 0x3c, 0xb9, 0x70, 0x47, 0x00, 0xbf, + 0x70, 0x52, 0x01, 0x00, 0x2a, 0x48, 0x2b, 0x49, 0x01, 0x60, 0x2b, 0x48, + 0x2b, 0x49, 0x01, 0x60, 0x2b, 0x48, 0x2c, 0x49, 0x01, 0x60, 0x2c, 0x48, + 0x2c, 0x49, 0x01, 0x60, 0x2c, 0x48, 0x2d, 0x49, 0x01, 0x60, 0x2d, 0x48, + 0x2d, 0x49, 0x01, 0x60, 0x2d, 0x48, 0x2e, 0x49, 0x81, 0x61, 0x2e, 0x48, + 0x2e, 0x49, 0x01, 0x60, 0x2e, 0x48, 0x2f, 0x49, 0x01, 0x60, 0x2f, 0x48, + 0x2f, 0x49, 0x01, 0x60, 0x2f, 0x48, 0x30, 0x49, 0x01, 0x60, 0x30, 0x48, + 0x30, 0x49, 0x01, 0x60, 0x30, 0x48, 0x31, 0x49, 0x01, 0x60, 0x31, 0x48, + 0x31, 0x49, 0x01, 0x60, 0x31, 0x48, 0x32, 0x49, 0x01, 0x60, 0x32, 0x48, + 0x32, 0x49, 0x01, 0x60, 0x32, 0x48, 0x33, 0x49, 0x01, 0x60, 0x33, 0x48, + 0x33, 0x49, 0x01, 0x60, 0x33, 0x48, 0x34, 0x49, 0x01, 0x60, 0x34, 0x48, + 0x34, 0x49, 0x01, 0x60, 0x34, 0x48, 0x35, 0x49, 0x01, 0x60, 0x35, 0x48, + 0x35, 0x49, 0x01, 0x60, 0x35, 0x48, 0x36, 0x49, 0x01, 0x60, 0x36, 0x48, + 0x36, 0x49, 0x01, 0x60, 0x36, 0x48, 0x37, 0x49, 0x01, 0x60, 0x37, 0x48, + 0x37, 0x49, 0x01, 0x60, 0x37, 0x48, 0x38, 0x49, 0x01, 0x60, 0x38, 0x48, + 0x38, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x64, 0xcc, 0x08, 0x00, + 0x09, 0x58, 0x03, 0x00, 0x60, 0xc8, 0x08, 0x00, 0x9d, 0x57, 0x03, 0x00, + 0xc8, 0xc6, 0x08, 0x00, 0xa9, 0x58, 0x03, 0x00, 0x58, 0xc1, 0x08, 0x00, + 0x5d, 0x59, 0x03, 0x00, 0x94, 0xc4, 0x08, 0x00, 0x99, 0x5b, 0x03, 0x00, + 0x58, 0xcc, 0x08, 0x00, 0x09, 0x5c, 0x03, 0x00, 0x38, 0xc0, 0x08, 0x00, + 0x59, 0x5c, 0x03, 0x00, 0x64, 0xc6, 0x08, 0x00, 0xb9, 0x5f, 0x03, 0x00, + 0x50, 0xcc, 0x08, 0x00, 0x0d, 0x60, 0x03, 0x00, 0x1c, 0xc6, 0x08, 0x00, + 0x49, 0x60, 0x03, 0x00, 0xb4, 0xc1, 0x08, 0x00, 0x75, 0x60, 0x03, 0x00, + 0xbc, 0xc1, 0x08, 0x00, 0x91, 0x60, 0x03, 0x00, 0xa8, 0xc1, 0x08, 0x00, + 0xad, 0x60, 0x03, 0x00, 0x60, 0xc6, 0x08, 0x00, 0x29, 0x63, 0x03, 0x00, + 0x18, 0xc6, 0x08, 0x00, 0x15, 0x64, 0x03, 0x00, 0x60, 0xcc, 0x08, 0x00, + 0x81, 0x65, 0x03, 0x00, 0xa0, 0xc1, 0x08, 0x00, 0x4d, 0x67, 0x03, 0x00, + 0x60, 0xc1, 0x08, 0x00, 0x6d, 0x67, 0x03, 0x00, 0x24, 0xc6, 0x08, 0x00, + 0xa5, 0x67, 0x03, 0x00, 0x80, 0x9b, 0x08, 0x00, 0x89, 0x68, 0x03, 0x00, + 0x88, 0x9b, 0x08, 0x00, 0xfd, 0x67, 0x03, 0x00, 0xd4, 0xc6, 0x08, 0x00, + 0x3d, 0x6a, 0x03, 0x00, 0x5c, 0xcc, 0x08, 0x00, 0xc9, 0x6a, 0x03, 0x00, + 0xe0, 0xc6, 0x08, 0x00, 0x01, 0x6b, 0x03, 0x00, 0x9c, 0xc4, 0x08, 0x00, + 0x71, 0x6b, 0x03, 0x00, 0x98, 0xc1, 0x08, 0x00, 0x7f, 0x6b, 0x03, 0x00, + 0x5c, 0xc6, 0x08, 0x00, 0x95, 0x6b, 0x03, 0x00, 0x18, 0xc1, 0x08, 0x00, + 0x39, 0x62, 0x03, 0x00, 0x42, 0xf6, 0x71, 0x1c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x44, 0xf6, 0x8d, 0x5c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf2, 0x09, 0x6c, 0xc1, 0xf2, 0x06, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf2, 0xe3, 0x6c, 0xc1, 0xf2, 0x0f, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf6, 0x5d, 0x5c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf2, 0x9d, 0x1c, 0xc1, 0xf2, 0x06, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x44, 0xf2, 0x31, 0x0c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf2, 0xc5, 0x0c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf2, 0x79, 0x0c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf6, 0xe9, 0x5c, 0xc1, 0xf2, 0x06, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf2, 0xfd, 0x6c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf2, 0x01, 0x2c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf6, 0x91, 0x6c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0x0d, 0x1c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x44, 0xf6, 0x3d, 0x1c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x44, 0xf6, 0x71, 0x6c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x44, 0xf2, 0x31, 0x3c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0x09, 0x6c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0x75, 0x1c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf6, 0x9d, 0x7c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x49, 0x53, 0x4f, 0x3a, 0x20, 0x4d, 0x20, 0x73, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x20, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x00, 0x49, 0x53, 0x4f, 0x3a, + 0x20, 0x4d, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x43, 0x68, 0x20, 0x4f, 0x66, + 0x66, 0x3a, 0x25, 0x64, 0x00, 0x49, 0x53, 0x4f, 0x3a, 0x20, 0x54, 0x78, + 0x20, 0x43, 0x49, 0x53, 0x52, 0x65, 0x71, 0x00, 0x70, 0x65, 0x65, 0x72, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x25, + 0x30, 0x34, 0x78, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x91, 0xb0, 0xdf, 0xf8, + 0x2c, 0x55, 0x0b, 0x91, 0x04, 0x46, 0x29, 0x46, 0x68, 0x79, 0x11, 0xf8, + 0x04, 0x2f, 0x42, 0xea, 0x00, 0x20, 0x8a, 0x78, 0xc9, 0x78, 0x42, 0xea, + 0x01, 0x21, 0x40, 0xea, 0x01, 0x40, 0xa8, 0x42, 0x00, 0xf0, 0x79, 0x82, + 0xdf, 0xf8, 0x08, 0x05, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x20, 0xb1, + 0xfa, 0xf7, 0xee, 0xf9, 0x00, 0x28, 0x00, 0xf0, 0x6e, 0x82, 0xdf, 0xf8, + 0xf8, 0x04, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x29, 0x46, 0x06, 0x46, + 0x68, 0x79, 0x11, 0xf8, 0x04, 0x2f, 0x42, 0xea, 0x00, 0x20, 0x8a, 0x78, + 0xc9, 0x78, 0x42, 0xea, 0x01, 0x21, 0x40, 0xea, 0x01, 0x47, 0xaf, 0x42, + 0x00, 0xf0, 0x5c, 0x82, 0x0b, 0x98, 0x4f, 0xf0, 0x00, 0x08, 0x02, 0x21, + 0x00, 0x28, 0x08, 0xbf, 0x01, 0x21, 0x0a, 0x91, 0x97, 0xf9, 0x60, 0x00, + 0x7f, 0x28, 0x03, 0xd0, 0x71, 0xb2, 0x81, 0x42, 0xc0, 0xf2, 0x3a, 0x82, + 0x97, 0xf9, 0x5f, 0x00, 0x7f, 0x28, 0x03, 0xd0, 0x71, 0xb2, 0x81, 0x42, + 0x00, 0xf3, 0x32, 0x82, 0xb8, 0x68, 0x00, 0x28, 0x00, 0xf0, 0x2e, 0x82, + 0x0b, 0x98, 0x98, 0xb1, 0xdf, 0xf8, 0x90, 0x04, 0x01, 0x68, 0x0b, 0x98, + 0x88, 0x47, 0x06, 0x46, 0x97, 0xf9, 0x60, 0x00, 0x7f, 0x28, 0x02, 0xd0, + 0x86, 0x42, 0xc0, 0xf2, 0x1f, 0x82, 0x97, 0xf9, 0x5f, 0x00, 0x7f, 0x28, + 0x02, 0xd0, 0x86, 0x42, 0x00, 0xf3, 0x18, 0x82, 0xdf, 0xf8, 0x6c, 0x04, + 0x00, 0x78, 0xf0, 0xb1, 0x00, 0x20, 0xad, 0xf8, 0x38, 0x00, 0xb7, 0xf8, + 0x5c, 0x00, 0xc1, 0x07, 0xad, 0xf8, 0x3a, 0x00, 0x22, 0xd0, 0xdf, 0xf8, + 0x5c, 0x04, 0x07, 0xf1, 0x10, 0x01, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, + 0x01, 0x28, 0x17, 0xd1, 0xbd, 0xf8, 0x38, 0x00, 0x40, 0xf0, 0x01, 0x00, + 0xad, 0xf8, 0x38, 0x00, 0xbd, 0xf8, 0x3a, 0x00, 0x20, 0xf0, 0x01, 0x00, + 0xad, 0xf8, 0x3a, 0x00, 0x0c, 0xe0, 0xdf, 0xf8, 0x2c, 0x14, 0x97, 0xf8, + 0x5e, 0x00, 0x09, 0x68, 0x88, 0x47, 0x00, 0x28, 0xd8, 0xd0, 0x4f, 0xf0, + 0x01, 0x08, 0xe9, 0xe1, 0xbd, 0xf8, 0x3a, 0x00, 0xc0, 0x05, 0x14, 0xd5, + 0xdf, 0xf8, 0x14, 0x04, 0x07, 0xf1, 0x50, 0x01, 0x02, 0x68, 0x20, 0x46, + 0x90, 0x47, 0x01, 0x28, 0x0b, 0xd1, 0xbd, 0xf8, 0x38, 0x00, 0x40, 0xf4, + 0x80, 0x70, 0xad, 0xf8, 0x38, 0x00, 0xbd, 0xf8, 0x3a, 0x00, 0x20, 0xf4, + 0x80, 0x70, 0xad, 0xf8, 0x3a, 0x00, 0xb7, 0xf8, 0x5a, 0x50, 0x68, 0x07, + 0x52, 0xbf, 0x00, 0x20, 0x07, 0xf1, 0x18, 0x00, 0x00, 0xf0, 0x02, 0xfa, + 0x8d, 0xf8, 0x42, 0x00, 0x28, 0x07, 0x52, 0xbf, 0x00, 0x20, 0x07, 0xf1, + 0x20, 0x00, 0x00, 0xf0, 0xf9, 0xf9, 0x8d, 0xf8, 0x41, 0x00, 0xa8, 0x06, + 0x52, 0xbf, 0x00, 0x20, 0x07, 0xf1, 0x30, 0x00, 0x00, 0xf0, 0xf0, 0xf9, + 0x8d, 0xf8, 0x40, 0x00, 0x68, 0x06, 0x52, 0xbf, 0x00, 0x20, 0x07, 0xf1, + 0x38, 0x00, 0x00, 0xf0, 0xe7, 0xf9, 0x8d, 0xf8, 0x3f, 0x00, 0x68, 0xb2, + 0xb0, 0xf1, 0xff, 0x3f, 0xce, 0xbf, 0x00, 0x20, 0x07, 0xf1, 0x48, 0x00, + 0x00, 0xf0, 0xdc, 0xf9, 0x8d, 0xf8, 0x3e, 0x00, 0xa8, 0x05, 0xcd, 0xf8, + 0x08, 0x80, 0x03, 0x96, 0x52, 0xbf, 0x00, 0x20, 0x07, 0xf1, 0x40, 0x00, + 0x00, 0xf0, 0xd0, 0xf9, 0x8d, 0xf8, 0x3d, 0x00, 0x07, 0xf1, 0x18, 0x00, + 0x07, 0xf1, 0x48, 0x0a, 0x00, 0x26, 0x09, 0x90, 0x07, 0xf1, 0x20, 0x00, + 0x08, 0x90, 0x07, 0xf1, 0x28, 0x00, 0x06, 0x90, 0x07, 0xf1, 0x30, 0x00, + 0x04, 0x90, 0x07, 0xf1, 0x38, 0x00, 0x07, 0x90, 0x07, 0xf1, 0x40, 0x00, + 0x05, 0x90, 0x30, 0x06, 0xdf, 0xf8, 0x48, 0x13, 0xa0, 0x46, 0x0b, 0x98, + 0x08, 0xbf, 0x20, 0x46, 0x0a, 0x68, 0x0d, 0xf1, 0x43, 0x01, 0x90, 0x47, + 0x9d, 0xf8, 0x43, 0x10, 0x00, 0x29, 0x00, 0xf0, 0x2e, 0x81, 0x81, 0x46, + 0x00, 0x25, 0xbd, 0xf8, 0x3a, 0x00, 0x00, 0x28, 0x00, 0xf0, 0x27, 0x81, + 0x19, 0xf8, 0x05, 0x20, 0x00, 0x2a, 0x00, 0xf0, 0x22, 0x81, 0x09, 0xeb, + 0x05, 0x0b, 0x9b, 0xf8, 0x01, 0x30, 0x00, 0x2b, 0x00, 0xf0, 0x1b, 0x81, + 0x15, 0x44, 0x01, 0x35, 0xad, 0xb2, 0x8d, 0x42, 0x00, 0xf2, 0x15, 0x81, + 0x99, 0x1e, 0x24, 0x29, 0x00, 0xf2, 0x74, 0x80, 0xdf, 0xe8, 0x01, 0xf0, + 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x92, 0x92, 0xac, 0xac, 0xac, 0xac, + 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0x33, 0x33, 0x53, 0xac, 0xac, 0xac, + 0xac, 0xac, 0xac, 0xac, 0xac, 0x33, 0x53, 0x53, 0xac, 0xac, 0xac, 0xac, + 0xb5, 0x00, 0x40, 0x07, 0x40, 0xf1, 0xd1, 0x80, 0xb5, 0x48, 0x09, 0x99, + 0x0d, 0xf1, 0x42, 0x02, 0x03, 0x68, 0x58, 0x46, 0x98, 0x47, 0x01, 0x28, + 0x40, 0xf0, 0xc7, 0x80, 0xbd, 0xf8, 0x38, 0x00, 0x40, 0xf0, 0x04, 0x00, + 0xad, 0xf8, 0x38, 0x00, 0x97, 0xf8, 0x61, 0x00, 0x20, 0xb9, 0xb7, 0xf8, + 0x58, 0x00, 0x00, 0x28, 0x00, 0xf0, 0xb6, 0x80, 0xbd, 0xf8, 0x3a, 0x00, + 0x20, 0xf0, 0x04, 0x00, 0xb1, 0xe0, 0x00, 0x07, 0x40, 0xf1, 0xb1, 0x80, + 0xa5, 0x48, 0x08, 0x99, 0x0d, 0xf1, 0x41, 0x02, 0x03, 0x68, 0x58, 0x46, + 0x98, 0x47, 0x01, 0x28, 0x40, 0xf0, 0xa7, 0x80, 0xbd, 0xf8, 0x38, 0x00, + 0x40, 0xf0, 0x08, 0x00, 0xad, 0xf8, 0x38, 0x00, 0x97, 0xf8, 0x61, 0x00, + 0x20, 0xb9, 0xb7, 0xf8, 0x58, 0x00, 0x00, 0x28, 0x00, 0xf0, 0x96, 0x80, + 0xbd, 0xf8, 0x3a, 0x00, 0x20, 0xf0, 0x08, 0x00, 0x91, 0xe0, 0x40, 0x06, + 0x40, 0xf1, 0x91, 0x80, 0x92, 0x48, 0x07, 0x99, 0x0d, 0xf1, 0x3f, 0x02, + 0x03, 0x68, 0x58, 0x46, 0x98, 0x47, 0x01, 0x28, 0x40, 0xf0, 0x87, 0x80, + 0xbd, 0xf8, 0x38, 0x00, 0x40, 0xf0, 0x40, 0x00, 0xad, 0xf8, 0x38, 0x00, + 0x97, 0xf8, 0x61, 0x00, 0x18, 0xb9, 0xb7, 0xf8, 0x58, 0x00, 0x00, 0x28, + 0x76, 0xd0, 0xbd, 0xf8, 0x3a, 0x00, 0x20, 0xf0, 0x40, 0x00, 0x72, 0xe0, + 0x2e, 0x2b, 0x5c, 0xd0, 0xff, 0x2b, 0x35, 0xd1, 0x80, 0x06, 0x6e, 0xd5, + 0x82, 0x48, 0x04, 0x99, 0x10, 0xaa, 0x03, 0x68, 0x58, 0x46, 0x98, 0x47, + 0x01, 0x28, 0x66, 0xd1, 0xbd, 0xf8, 0x38, 0x00, 0x40, 0xf0, 0x20, 0x00, + 0xad, 0xf8, 0x38, 0x00, 0x97, 0xf8, 0x61, 0x00, 0x18, 0xb9, 0xb7, 0xf8, + 0x58, 0x00, 0x00, 0x28, 0x56, 0xd0, 0xbd, 0xf8, 0x3a, 0x00, 0x20, 0xf0, + 0x20, 0x00, 0x52, 0xe0, 0xc0, 0x06, 0x52, 0xd5, 0x75, 0x48, 0x06, 0x99, + 0x02, 0x68, 0x58, 0x46, 0x90, 0x47, 0x01, 0x28, 0x4b, 0xd1, 0xbd, 0xf8, + 0x38, 0x00, 0x40, 0xf0, 0x10, 0x00, 0xad, 0xf8, 0x38, 0x00, 0x97, 0xf8, + 0x61, 0x00, 0x10, 0xb9, 0xb7, 0xf8, 0x58, 0x00, 0xe0, 0xb3, 0xbd, 0xf8, + 0x3a, 0x00, 0x20, 0xf0, 0x10, 0x00, 0x38, 0xe0, 0x6b, 0x48, 0x39, 0x46, + 0x0d, 0xf1, 0x3a, 0x02, 0x0e, 0xab, 0x04, 0x68, 0x58, 0x46, 0xa0, 0x47, + 0x31, 0xe0, 0x80, 0x05, 0x2f, 0xd5, 0x61, 0x48, 0x05, 0x99, 0x0d, 0xf1, + 0x3d, 0x02, 0x03, 0x68, 0x58, 0x46, 0x98, 0x47, 0x01, 0x28, 0x26, 0xd1, + 0xbd, 0xf8, 0x38, 0x00, 0x40, 0xf4, 0x00, 0x70, 0xad, 0xf8, 0x38, 0x00, + 0x97, 0xf8, 0x61, 0x00, 0x10, 0xb9, 0xb7, 0xf8, 0x58, 0x00, 0xb8, 0xb1, + 0xbd, 0xf8, 0x3a, 0x00, 0x20, 0xf4, 0x00, 0x70, 0x13, 0xe0, 0x41, 0x05, + 0x13, 0xd5, 0x07, 0x2a, 0x11, 0xd1, 0xbd, 0xf8, 0x38, 0x10, 0x41, 0xf4, + 0x80, 0x61, 0xad, 0xf8, 0x38, 0x10, 0x97, 0xf8, 0x61, 0x10, 0x11, 0xb9, + 0xb7, 0xf8, 0x58, 0x10, 0x11, 0xb1, 0x20, 0xf4, 0x80, 0x60, 0x00, 0xe0, + 0x00, 0x20, 0xad, 0xf8, 0x3a, 0x00, 0x9d, 0xf9, 0x3a, 0x00, 0xb0, 0xf1, + 0xff, 0x3f, 0x1a, 0xdc, 0x4c, 0x48, 0x51, 0x46, 0x0d, 0xf1, 0x3e, 0x02, + 0x03, 0x68, 0x58, 0x46, 0x98, 0x47, 0x01, 0x28, 0x11, 0xd1, 0xbd, 0xf8, + 0x38, 0x00, 0x40, 0xf0, 0x80, 0x00, 0xad, 0xf8, 0x38, 0x00, 0x97, 0xf8, + 0x61, 0x00, 0x10, 0xb9, 0xb7, 0xf8, 0x58, 0x00, 0x58, 0xb1, 0xbd, 0xf8, + 0x3a, 0x00, 0x20, 0xf0, 0x80, 0x00, 0xad, 0xf8, 0x3a, 0x00, 0x9d, 0xf8, + 0x43, 0x10, 0x8d, 0x42, 0xff, 0xf4, 0xd7, 0xae, 0x01, 0xe0, 0x00, 0x20, + 0xf5, 0xe7, 0x01, 0x36, 0x0a, 0x99, 0x44, 0x46, 0xf0, 0xb2, 0x81, 0x42, + 0x3f, 0xf6, 0xbb, 0xae, 0xbd, 0xf8, 0x3a, 0x00, 0x10, 0xb1, 0x97, 0xf8, + 0x62, 0x00, 0x80, 0xb3, 0xb8, 0x68, 0x70, 0xb3, 0xbd, 0xf8, 0x38, 0x00, + 0x97, 0xf8, 0x61, 0x10, 0x97, 0xf8, 0x62, 0x20, 0x06, 0x23, 0xad, 0xf8, + 0x30, 0x00, 0xb7, 0xf8, 0x5c, 0x00, 0xad, 0xf8, 0x32, 0x00, 0x97, 0xf8, + 0x5e, 0x00, 0x8d, 0xf8, 0x34, 0x00, 0x41, 0xea, 0x02, 0x00, 0x00, 0x21, + 0x0c, 0xaa, 0x8d, 0xf8, 0x35, 0x00, 0x29, 0x48, 0x05, 0x68, 0x40, 0xf2, + 0x0e, 0x20, 0xa8, 0x47, 0xd7, 0xe9, 0x02, 0x52, 0x97, 0xf8, 0x5e, 0x00, + 0xbd, 0xf8, 0x38, 0x10, 0x0b, 0x9b, 0x00, 0x92, 0x22, 0x46, 0xa8, 0x47, + 0xdd, 0xf8, 0x08, 0x80, 0x11, 0x4d, 0xb8, 0xf1, 0x00, 0x0f, 0x08, 0xbf, + 0x80, 0x46, 0x03, 0x9e, 0x02, 0xe0, 0x0e, 0x4d, 0xdd, 0xe9, 0x02, 0x86, + 0x17, 0xf8, 0x04, 0x0f, 0x79, 0x78, 0xba, 0x78, 0xfb, 0x78, 0x40, 0xea, + 0x01, 0x20, 0x42, 0xea, 0x03, 0x21, 0x40, 0xea, 0x01, 0x47, 0xaf, 0x42, + 0x7f, 0xf4, 0xb0, 0xad, 0x04, 0xe0, 0x4f, 0xf0, 0x01, 0x08, 0x01, 0xe0, + 0x4f, 0xf0, 0x00, 0x08, 0x5f, 0xfa, 0x88, 0xf0, 0x11, 0xb0, 0xbd, 0xe8, + 0xf0, 0x8f, 0x00, 0xbf, 0xac, 0x0d, 0x01, 0x00, 0xf8, 0xc5, 0x08, 0x00, + 0x60, 0xa2, 0x08, 0x00, 0x88, 0x4c, 0x01, 0x00, 0x1c, 0xbf, 0x08, 0x00, + 0xd0, 0xc5, 0x08, 0x00, 0xd4, 0xc5, 0x08, 0x00, 0x64, 0xa2, 0x08, 0x00, + 0xe8, 0xc5, 0x08, 0x00, 0xe4, 0xc5, 0x08, 0x00, 0xe0, 0xc5, 0x08, 0x00, + 0xdc, 0xc5, 0x08, 0x00, 0xd8, 0xc5, 0x08, 0x00, 0xec, 0xc5, 0x08, 0x00, + 0xf0, 0xc5, 0x08, 0x00, 0x4c, 0xa2, 0x08, 0x00, 0xb0, 0xb5, 0x02, 0x46, + 0x41, 0x79, 0x12, 0xf8, 0x04, 0x3f, 0x43, 0xea, 0x01, 0x21, 0x93, 0x78, + 0xd2, 0x78, 0x43, 0xea, 0x02, 0x22, 0x41, 0xea, 0x02, 0x42, 0x00, 0x21, + 0x82, 0x42, 0x0c, 0xd0, 0x12, 0xf8, 0x04, 0x3f, 0x01, 0x31, 0x54, 0x78, + 0x95, 0x78, 0xd2, 0x78, 0x43, 0xea, 0x04, 0x23, 0x45, 0xea, 0x02, 0x22, + 0x43, 0xea, 0x02, 0x42, 0xf0, 0xe7, 0xc8, 0xb2, 0xb0, 0xbd, 0x00, 0xbf, + 0x2d, 0xe9, 0xf8, 0x4f, 0x82, 0x46, 0x33, 0x48, 0x0c, 0x46, 0x09, 0x78, + 0x00, 0x26, 0x8d, 0xf8, 0x03, 0x60, 0x02, 0x68, 0x50, 0x46, 0x90, 0x47, + 0x00, 0x28, 0x58, 0xd0, 0x07, 0x46, 0x2e, 0x48, 0x0d, 0xf1, 0x03, 0x01, + 0x02, 0x68, 0x38, 0x46, 0x90, 0x47, 0x61, 0x78, 0x9d, 0xf8, 0x03, 0x20, + 0x00, 0x26, 0x8a, 0x42, 0x4b, 0xd9, 0x10, 0xf8, 0x01, 0x80, 0x28, 0x48, + 0x08, 0xf1, 0x01, 0x09, 0x01, 0x68, 0x48, 0x46, 0x88, 0x47, 0x06, 0x46, + 0x4f, 0xf0, 0x00, 0x0b, 0x00, 0x2f, 0x3e, 0xd0, 0xa6, 0xb3, 0x21, 0x48, + 0x0d, 0xf1, 0x03, 0x01, 0x02, 0x68, 0x38, 0x46, 0x90, 0x47, 0x61, 0x78, + 0x9d, 0xf8, 0x03, 0x30, 0xa9, 0xeb, 0x0b, 0x07, 0x42, 0x18, 0x5b, 0x1a, + 0x06, 0xeb, 0x0b, 0x00, 0x39, 0x46, 0xe9, 0xf7, 0xb7, 0xfd, 0x05, 0x46, + 0x60, 0x78, 0x9d, 0xf8, 0x03, 0x10, 0x09, 0x1a, 0xb9, 0x42, 0x1d, 0xdc, + 0x4f, 0xf0, 0x00, 0x00, 0x1d, 0xd0, 0x60, 0x70, 0x11, 0x48, 0x02, 0x68, + 0x20, 0x78, 0x41, 0x1c, 0x50, 0x46, 0x90, 0x47, 0x07, 0x46, 0x18, 0xb1, + 0x20, 0x78, 0x01, 0x30, 0x20, 0x70, 0x04, 0xe0, 0x0e, 0x48, 0x01, 0x68, + 0x30, 0x46, 0x88, 0x47, 0x00, 0x26, 0x5b, 0xfa, 0x85, 0xf0, 0x1f, 0xfa, + 0x80, 0xfb, 0xc3, 0x45, 0xc8, 0xd9, 0x08, 0xe0, 0x00, 0x26, 0x06, 0xe0, + 0x28, 0x44, 0x60, 0x70, 0x03, 0xe0, 0x60, 0x70, 0x20, 0x78, 0x01, 0x30, + 0x20, 0x70, 0x30, 0x46, 0xbd, 0xe8, 0xf8, 0x8f, 0x2c, 0xfa, 0x08, 0x00, + 0x64, 0xa2, 0x08, 0x00, 0xdc, 0x9b, 0x08, 0x00, 0xe0, 0x9b, 0x08, 0x00, + 0x2d, 0xe9, 0xf0, 0x47, 0x05, 0x68, 0x05, 0xb3, 0xdf, 0xf8, 0x48, 0x90, + 0xdf, 0xf8, 0x48, 0xa0, 0x80, 0x46, 0x00, 0x27, 0x00, 0x24, 0xd9, 0xf8, + 0x00, 0x10, 0x28, 0x46, 0x88, 0x47, 0xda, 0xf8, 0x00, 0x20, 0x06, 0x46, + 0x40, 0x46, 0x29, 0x46, 0x90, 0x47, 0x05, 0x46, 0xa0, 0x19, 0x01, 0x37, + 0x04, 0xb2, 0x00, 0x2d, 0xef, 0xd1, 0x98, 0xf8, 0x08, 0x00, 0xf9, 0xb2, + 0x81, 0x42, 0x04, 0xd1, 0x98, 0xf8, 0x08, 0x00, 0x94, 0xfb, 0xf0, 0xf0, + 0x00, 0xe0, 0x81, 0x20, 0x40, 0xb2, 0xbd, 0xe8, 0xf0, 0x87, 0x00, 0xbf, + 0x60, 0xa2, 0x08, 0x00, 0xec, 0xa0, 0x08, 0x00, 0xfe, 0xb5, 0x0d, 0x46, + 0xb1, 0xf8, 0x5a, 0x70, 0x41, 0x78, 0x06, 0x46, 0x14, 0x46, 0x88, 0x1e, + 0x24, 0x28, 0x00, 0xf2, 0xb3, 0x80, 0xdf, 0xe8, 0x10, 0xf0, 0x25, 0x00, + 0x25, 0x00, 0x25, 0x00, 0x25, 0x00, 0x25, 0x00, 0x25, 0x00, 0x96, 0x00, + 0x96, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, + 0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x4b, 0x00, + 0x4b, 0x00, 0x71, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, + 0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x4b, 0x00, 0x71, 0x00, + 0x71, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xd8, 0x00, + 0x78, 0x07, 0x52, 0xbf, 0x00, 0x20, 0x05, 0xf1, 0x18, 0x00, 0xff, 0xf7, + 0x07, 0xff, 0x8d, 0xf8, 0x0b, 0x00, 0x20, 0x78, 0x40, 0x07, 0x7e, 0xd5, + 0x80, 0x48, 0x05, 0xf1, 0x18, 0x01, 0x0d, 0xf1, 0x0b, 0x02, 0x03, 0x68, + 0x30, 0x46, 0x98, 0x47, 0x01, 0x28, 0x74, 0xd1, 0x60, 0x88, 0x40, 0xf0, + 0x04, 0x00, 0x60, 0x80, 0x95, 0xf8, 0x61, 0x00, 0x20, 0xb9, 0xb5, 0xf8, + 0x58, 0x00, 0x00, 0x28, 0x00, 0xf0, 0xb5, 0x80, 0x20, 0x88, 0x20, 0xf0, + 0x04, 0x00, 0xb1, 0xe0, 0x38, 0x07, 0x52, 0xbf, 0x00, 0x20, 0x05, 0xf1, + 0x20, 0x00, 0xff, 0xf7, 0xe1, 0xfe, 0x8d, 0xf8, 0x0a, 0x00, 0x20, 0x78, + 0x00, 0x07, 0x58, 0xd5, 0x6d, 0x48, 0x05, 0xf1, 0x20, 0x01, 0x0d, 0xf1, + 0x0a, 0x02, 0x03, 0x68, 0x30, 0x46, 0x98, 0x47, 0x01, 0x28, 0x4e, 0xd1, + 0x60, 0x88, 0x40, 0xf0, 0x08, 0x00, 0x60, 0x80, 0x95, 0xf8, 0x61, 0x00, + 0x20, 0xb9, 0xb5, 0xf8, 0x58, 0x00, 0x00, 0x28, 0x00, 0xf0, 0x8f, 0x80, + 0x20, 0x88, 0x20, 0xf0, 0x08, 0x00, 0x8b, 0xe0, 0x78, 0x06, 0x52, 0xbf, + 0x00, 0x20, 0x05, 0xf1, 0x38, 0x00, 0xff, 0xf7, 0xbb, 0xfe, 0x8d, 0xf8, + 0x08, 0x00, 0x20, 0x78, 0x40, 0x06, 0x40, 0xf1, 0x80, 0x80, 0x57, 0x48, + 0x05, 0xf1, 0x38, 0x01, 0x02, 0xaa, 0x03, 0x68, 0x30, 0x46, 0x98, 0x47, + 0x01, 0x28, 0x76, 0xd1, 0x60, 0x88, 0x40, 0xf0, 0x40, 0x00, 0x60, 0x80, + 0x95, 0xf8, 0x61, 0x00, 0x18, 0xb9, 0xb5, 0xf8, 0x58, 0x00, 0x00, 0x28, + 0x69, 0xd0, 0x20, 0x88, 0x20, 0xf0, 0x40, 0x00, 0x66, 0xe0, 0x20, 0x88, + 0xc0, 0x06, 0x16, 0xd5, 0x4b, 0x48, 0x05, 0xf1, 0x28, 0x01, 0x02, 0x68, + 0x30, 0x46, 0x90, 0x47, 0x01, 0x28, 0x0e, 0xd1, 0x60, 0x88, 0x40, 0xf0, + 0x10, 0x00, 0x60, 0x80, 0x95, 0xf8, 0x61, 0x00, 0x18, 0xb9, 0xb5, 0xf8, + 0x58, 0x00, 0x00, 0x28, 0x4f, 0xd0, 0x20, 0x88, 0x20, 0xf0, 0x10, 0x00, + 0x4c, 0xe0, 0x4c, 0xe0, 0xff, 0x29, 0x23, 0xd1, 0xb8, 0x06, 0x52, 0xbf, + 0x00, 0x20, 0x05, 0xf1, 0x30, 0x00, 0xff, 0xf7, 0x79, 0xfe, 0x8d, 0xf8, + 0x09, 0x00, 0x20, 0x78, 0x80, 0x06, 0x17, 0xd5, 0x37, 0x48, 0x05, 0xf1, + 0x30, 0x01, 0x0d, 0xf1, 0x09, 0x02, 0x03, 0x68, 0x30, 0x46, 0x98, 0x47, + 0x01, 0x28, 0x0d, 0xd1, 0x60, 0x88, 0x40, 0xf0, 0x20, 0x00, 0x60, 0x80, + 0x95, 0xf8, 0x61, 0x00, 0x10, 0xb9, 0xb5, 0xf8, 0x58, 0x00, 0x40, 0xb3, + 0x20, 0x88, 0x20, 0xf0, 0x20, 0x00, 0x25, 0xe0, 0x25, 0xe0, 0xb8, 0x05, + 0x52, 0xbf, 0x00, 0x20, 0x05, 0xf1, 0x40, 0x00, 0xff, 0xf7, 0x54, 0xfe, + 0x8d, 0xf8, 0x06, 0x00, 0x60, 0x78, 0x80, 0x07, 0x19, 0xd5, 0x23, 0x48, + 0x05, 0xf1, 0x40, 0x01, 0x0d, 0xf1, 0x06, 0x02, 0x03, 0x68, 0x30, 0x46, + 0x98, 0x47, 0x01, 0x28, 0x0f, 0xd1, 0x60, 0x88, 0x40, 0xf4, 0x00, 0x70, + 0x60, 0x80, 0x95, 0xf8, 0x61, 0x00, 0x10, 0xb9, 0xb5, 0xf8, 0x58, 0x00, + 0x18, 0xb1, 0x20, 0x88, 0x20, 0xf4, 0x00, 0x70, 0x00, 0xe0, 0x00, 0x20, + 0x20, 0x80, 0x94, 0xf9, 0x00, 0x00, 0xb0, 0xf1, 0xff, 0x3f, 0x22, 0xdc, + 0x78, 0xb2, 0xb0, 0xf1, 0xff, 0x3f, 0xce, 0xbf, 0x00, 0x20, 0x05, 0xf1, + 0x48, 0x00, 0xff, 0xf7, 0x27, 0xfe, 0x8d, 0xf8, 0x07, 0x00, 0x13, 0x48, + 0x05, 0xf1, 0x48, 0x01, 0x0d, 0xf1, 0x07, 0x02, 0x03, 0x68, 0x30, 0x46, + 0x98, 0x47, 0x01, 0x28, 0x0d, 0xd1, 0x60, 0x88, 0x40, 0xf0, 0x80, 0x00, + 0x60, 0x80, 0x95, 0xf8, 0x61, 0x00, 0x10, 0xb9, 0xb5, 0xf8, 0x58, 0x00, + 0x28, 0xb1, 0x20, 0x88, 0x20, 0xf0, 0x80, 0x00, 0x20, 0x80, 0x01, 0x20, + 0xfe, 0xbd, 0x00, 0x20, 0xfa, 0xe7, 0x00, 0xbf, 0xe8, 0xc5, 0x08, 0x00, + 0xe4, 0xc5, 0x08, 0x00, 0xe0, 0xc5, 0x08, 0x00, 0xdc, 0xc5, 0x08, 0x00, + 0xd8, 0xc5, 0x08, 0x00, 0xf0, 0xc5, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x87, 0xb0, 0x81, 0x46, 0x00, 0x68, 0x00, 0x28, 0x01, 0x90, 0x00, 0xf0, + 0xd5, 0x80, 0xdf, 0xf8, 0xbc, 0xb1, 0x59, 0x46, 0x9b, 0xf8, 0x05, 0x00, + 0x11, 0xf8, 0x04, 0x2f, 0x42, 0xea, 0x00, 0x20, 0x8a, 0x78, 0xc9, 0x78, + 0x42, 0xea, 0x01, 0x21, 0x40, 0xea, 0x01, 0x40, 0x58, 0x45, 0x00, 0xf0, + 0xc5, 0x80, 0x67, 0x48, 0x01, 0x68, 0x01, 0x98, 0x88, 0x47, 0x20, 0xb1, + 0xf9, 0xf7, 0x2c, 0xfd, 0x00, 0x28, 0x00, 0xf0, 0xbb, 0x80, 0x48, 0x46, + 0xff, 0xf7, 0x66, 0xfe, 0x59, 0x46, 0x80, 0x46, 0x9b, 0xf8, 0x05, 0x00, + 0x11, 0xf8, 0x04, 0x2f, 0x42, 0xea, 0x00, 0x20, 0x8a, 0x78, 0xc9, 0x78, + 0x42, 0xea, 0x01, 0x21, 0x40, 0xea, 0x01, 0x47, 0x5f, 0x45, 0x00, 0xf0, + 0xa5, 0x80, 0x00, 0x20, 0x02, 0x90, 0x97, 0xf9, 0x60, 0x00, 0x7f, 0x28, + 0x02, 0xd0, 0x80, 0x45, 0xc0, 0xf2, 0x8d, 0x80, 0x97, 0xf9, 0x5f, 0x00, + 0x7f, 0x28, 0x02, 0xd0, 0x80, 0x45, 0x00, 0xf3, 0x86, 0x80, 0xb7, 0xf8, + 0x5c, 0x50, 0x00, 0x20, 0xad, 0xf8, 0x16, 0x00, 0xe8, 0x07, 0xad, 0xf8, + 0x14, 0x50, 0x11, 0xd0, 0x4c, 0x48, 0x07, 0xf1, 0x10, 0x01, 0x02, 0x68, + 0x01, 0x98, 0x90, 0x47, 0x01, 0x28, 0x09, 0xd1, 0x01, 0x20, 0x25, 0xf0, + 0x01, 0x05, 0x40, 0xf2, 0x01, 0x1a, 0xad, 0xf8, 0x16, 0x00, 0xad, 0xf8, + 0x14, 0x50, 0x01, 0xe0, 0x4f, 0xf4, 0x80, 0x7a, 0xe8, 0x05, 0x0d, 0xd5, + 0x42, 0x48, 0x07, 0xf1, 0x50, 0x01, 0x02, 0x68, 0x01, 0x98, 0x90, 0x47, + 0x01, 0x28, 0x02, 0xbf, 0xad, 0xf8, 0x16, 0xa0, 0x25, 0xf4, 0x80, 0x75, + 0xad, 0xf8, 0x14, 0x50, 0x3c, 0x4c, 0x00, 0x20, 0x0d, 0xf1, 0x14, 0x0a, + 0x06, 0xae, 0xad, 0xf8, 0x18, 0x00, 0xad, 0xb1, 0x48, 0x46, 0x31, 0x46, + 0xff, 0xf7, 0x9a, 0xfd, 0xa8, 0xb1, 0x05, 0x46, 0x00, 0x78, 0x78, 0xb1, + 0x68, 0x78, 0x68, 0xb1, 0x28, 0x46, 0x39, 0x46, 0x52, 0x46, 0xff, 0xf7, + 0x2f, 0xfe, 0x21, 0x68, 0x28, 0x46, 0x88, 0x47, 0xbd, 0xf8, 0x14, 0x00, + 0x00, 0x28, 0xe9, 0xd1, 0x01, 0x20, 0x06, 0xe0, 0x21, 0x68, 0x28, 0x46, + 0x88, 0x47, 0x97, 0xf8, 0x62, 0x00, 0x90, 0xb3, 0x00, 0x20, 0xb9, 0x68, + 0x51, 0xb3, 0xb7, 0xf8, 0x5c, 0x00, 0x97, 0xf8, 0x61, 0x10, 0x97, 0xf8, + 0x62, 0x20, 0xbd, 0xf8, 0x16, 0x50, 0x06, 0x23, 0xad, 0xf8, 0x0e, 0x00, + 0x97, 0xf8, 0x5e, 0x00, 0xad, 0xf8, 0x0c, 0x50, 0x8d, 0xf8, 0x10, 0x00, + 0x41, 0xea, 0x02, 0x00, 0x00, 0x21, 0x03, 0xaa, 0x8d, 0xf8, 0x11, 0x00, + 0x1d, 0x48, 0x06, 0x68, 0x40, 0xf2, 0x0e, 0x20, 0xb0, 0x47, 0xd7, 0xe9, + 0x02, 0x61, 0x97, 0xf8, 0x5e, 0x00, 0x01, 0x9a, 0x00, 0x23, 0x00, 0x91, + 0x29, 0x46, 0xb0, 0x47, 0x02, 0x9a, 0x11, 0x06, 0x08, 0xbf, 0x02, 0x46, + 0x02, 0x92, 0x04, 0xe0, 0x00, 0x28, 0x02, 0x98, 0x18, 0xbf, 0x01, 0x20, + 0x02, 0x90, 0x17, 0xf8, 0x04, 0x0f, 0x79, 0x78, 0xba, 0x78, 0xfb, 0x78, + 0x40, 0xea, 0x01, 0x20, 0x42, 0xea, 0x03, 0x21, 0x40, 0xea, 0x01, 0x47, + 0x5f, 0x45, 0x7f, 0xf4, 0x5e, 0xaf, 0x03, 0xe0, 0x00, 0x20, 0x00, 0xe0, + 0x01, 0x20, 0x02, 0x90, 0x02, 0x98, 0xc0, 0xb2, 0x07, 0xb0, 0xbd, 0xe8, + 0xf0, 0x8f, 0x00, 0xbf, 0xac, 0x0d, 0x01, 0x00, 0xf8, 0xc5, 0x08, 0x00, + 0xd0, 0xc5, 0x08, 0x00, 0xd4, 0xc5, 0x08, 0x00, 0xe0, 0x9b, 0x08, 0x00, + 0x4c, 0xa2, 0x08, 0x00, 0xb0, 0xb5, 0x4f, 0xf6, 0xff, 0x71, 0x88, 0x42, + 0x28, 0xd0, 0x04, 0x28, 0x13, 0xd0, 0x08, 0x28, 0x11, 0xd0, 0x10, 0x28, + 0x13, 0xd0, 0x20, 0x28, 0x0f, 0xd0, 0x40, 0x28, 0x0d, 0xd0, 0x80, 0x28, + 0x0f, 0xd0, 0xb0, 0xf5, 0x80, 0x7f, 0x0e, 0xd0, 0xb0, 0xf5, 0x00, 0x7f, + 0x0d, 0xd0, 0x01, 0x28, 0x0d, 0xd1, 0x0f, 0x24, 0x13, 0xe0, 0x2a, 0x24, + 0x11, 0xe0, 0x43, 0x24, 0x0f, 0xe0, 0x26, 0x24, 0x0d, 0xe0, 0x29, 0x24, + 0x0b, 0xe0, 0x18, 0x24, 0x09, 0xe0, 0x28, 0x24, 0x07, 0xe0, 0x00, 0x20, + 0x40, 0xf2, 0xe1, 0x31, 0x00, 0x24, 0xef, 0xf7, 0x3d, 0xf9, 0x00, 0xe0, + 0x64, 0x24, 0x38, 0x4d, 0x14, 0x4a, 0x28, 0x88, 0xb2, 0xf8, 0x82, 0x21, + 0x21, 0x18, 0x91, 0x42, 0x0d, 0xd8, 0x12, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x38, 0xb1, 0x04, 0x46, 0x28, 0x88, 0x54, 0xf8, 0x08, 0x1c, + 0x09, 0x89, 0x08, 0x44, 0x28, 0x80, 0x12, 0xe0, 0x28, 0x88, 0x0c, 0x4a, + 0x00, 0x21, 0x04, 0x23, 0x00, 0x24, 0x10, 0x60, 0x1d, 0x48, 0x05, 0x68, + 0x4f, 0xf4, 0x11, 0x70, 0xa8, 0x47, 0x1a, 0x48, 0x00, 0x68, 0x20, 0xb1, + 0x40, 0x78, 0x08, 0xb1, 0x00, 0xf0, 0x0a, 0xf8, 0x00, 0x24, 0x20, 0x46, + 0xb0, 0xbd, 0x00, 0xbf, 0xe8, 0x65, 0x08, 0x00, 0xd4, 0x9b, 0x08, 0x00, + 0x8c, 0x34, 0x01, 0x00, 0x70, 0xb5, 0x0f, 0x48, 0x0f, 0x4a, 0x00, 0x78, + 0x10, 0x70, 0x0f, 0x48, 0x00, 0x68, 0x41, 0x78, 0x03, 0x7a, 0x44, 0x7a, + 0x85, 0x7a, 0xc6, 0x88, 0x51, 0x70, 0x81, 0x88, 0x80, 0x89, 0x93, 0x71, + 0x96, 0x80, 0xd4, 0x71, 0x15, 0x72, 0x0c, 0x23, 0x50, 0x81, 0x08, 0x48, + 0x51, 0x80, 0x00, 0x21, 0xd0, 0xf8, 0x00, 0xc0, 0x40, 0xf2, 0xa3, 0x60, + 0xbd, 0xe8, 0x70, 0x40, 0x60, 0x47, 0x00, 0xbf, 0x88, 0x4c, 0x01, 0x00, + 0x1e, 0xe6, 0x05, 0x00, 0x84, 0x4c, 0x01, 0x00, 0x78, 0x9b, 0x08, 0x00, + 0x08, 0x46, 0x0b, 0x49, 0x50, 0xf8, 0x08, 0x3c, 0x0a, 0x88, 0x1b, 0x89, + 0xd2, 0x1a, 0x0a, 0x80, 0xef, 0xf7, 0xf6, 0xb8, 0x10, 0xb5, 0x00, 0xf0, + 0x2b, 0xf8, 0x05, 0x4c, 0x20, 0x88, 0x20, 0xb1, 0x00, 0x20, 0x40, 0xf2, + 0x27, 0x41, 0xef, 0xf7, 0xcd, 0xf8, 0x00, 0x20, 0x20, 0x80, 0x10, 0xbd, + 0x1c, 0xe6, 0x05, 0x00, 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, + 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x68, 0xbf, 0x08, 0x00, + 0xed, 0x79, 0x03, 0x00, 0x34, 0xc7, 0x08, 0x00, 0x89, 0x6e, 0x03, 0x00, + 0x6c, 0xbf, 0x08, 0x00, 0xfd, 0x7a, 0x03, 0x00, 0x04, 0xc3, 0x08, 0x00, + 0x11, 0x7b, 0x03, 0x00, 0x4e, 0xf2, 0xc9, 0x0c, 0xc1, 0xf2, 0x06, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x2d, 0xe9, 0xfe, 0x43, 0x04, 0x46, 0x00, 0x20, + 0x00, 0x2c, 0xcd, 0xe9, 0x01, 0x00, 0x00, 0xf0, 0x8b, 0x80, 0x01, 0xae, + 0xe2, 0x1d, 0x06, 0x21, 0x06, 0x23, 0x30, 0x46, 0xe9, 0xf7, 0x44, 0xfa, + 0xa0, 0x79, 0xdf, 0xf8, 0x14, 0x81, 0xe1, 0x7b, 0x44, 0x4d, 0x00, 0xf0, + 0x07, 0x00, 0xd8, 0xf8, 0x00, 0x20, 0x40, 0xea, 0xc1, 0x00, 0x31, 0x46, + 0x8d, 0xf8, 0x0a, 0x00, 0x28, 0x46, 0x90, 0x47, 0xff, 0x28, 0x08, 0xd0, + 0x29, 0x68, 0x01, 0xeb, 0xc0, 0x00, 0xc5, 0x79, 0xff, 0x2d, 0x6d, 0xd0, + 0x3b, 0x48, 0x06, 0x68, 0x40, 0xe0, 0xdf, 0xf8, 0xec, 0x90, 0x38, 0x4e, + 0x01, 0xa9, 0xd9, 0xf8, 0x00, 0x20, 0x30, 0x46, 0x90, 0x47, 0xff, 0x28, + 0x14, 0xd0, 0x07, 0x46, 0x36, 0x48, 0x00, 0x68, 0x80, 0x47, 0x05, 0x46, + 0x30, 0x7a, 0x87, 0x42, 0x05, 0xd3, 0xd8, 0xf8, 0x00, 0x20, 0x2f, 0x48, + 0x01, 0xa9, 0x90, 0x47, 0x07, 0x46, 0x30, 0x68, 0xff, 0x2d, 0x00, 0xeb, + 0xc7, 0x00, 0xc5, 0x71, 0x15, 0xd1, 0x4b, 0xe0, 0x2d, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x05, 0x46, 0xff, 0x28, 0x05, 0xd1, 0x2b, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x05, 0x46, 0xff, 0x28, 0x3f, 0xd0, 0xd9, 0xf8, 0x00, 0x20, + 0x01, 0xa9, 0x30, 0x46, 0x90, 0x47, 0x31, 0x68, 0x01, 0xeb, 0xc0, 0x00, + 0xc5, 0x71, 0x20, 0x49, 0x05, 0xeb, 0x85, 0x00, 0x0e, 0x68, 0x4f, 0xf6, + 0xff, 0x71, 0x06, 0xeb, 0x80, 0x00, 0x81, 0x81, 0x81, 0x7b, 0x41, 0xf0, + 0x01, 0x01, 0x81, 0x73, 0x1e, 0x48, 0x05, 0xeb, 0x85, 0x05, 0x00, 0x68, + 0x80, 0x47, 0x17, 0x49, 0x09, 0x68, 0x01, 0xeb, 0x85, 0x01, 0x06, 0xeb, + 0x85, 0x05, 0x08, 0x61, 0x20, 0x79, 0x10, 0xf0, 0x60, 0x00, 0x18, 0xbf, + 0x40, 0x28, 0x0f, 0xd1, 0x20, 0x46, 0x29, 0x46, 0xeb, 0xf7, 0xa8, 0xfb, + 0x28, 0x46, 0xff, 0xf7, 0xc1, 0xfd, 0x01, 0x28, 0x0c, 0xbf, 0x13, 0x48, + 0x11, 0x48, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, 0xbd, 0xe8, 0xfe, 0x83, + 0x20, 0x28, 0x05, 0xd1, 0x20, 0x46, 0x29, 0x46, 0xeb, 0xf7, 0x96, 0xfb, + 0xbd, 0xe8, 0xfe, 0x83, 0x20, 0x46, 0xef, 0xf7, 0x29, 0xf8, 0xbd, 0xe8, + 0xfe, 0x83, 0x00, 0xbf, 0x40, 0xc9, 0x08, 0x00, 0xd8, 0x54, 0x01, 0x00, + 0xcc, 0x58, 0x01, 0x00, 0x44, 0xc9, 0x08, 0x00, 0x60, 0xc7, 0x08, 0x00, + 0x48, 0xc7, 0x08, 0x00, 0x4c, 0xc7, 0x08, 0x00, 0xe0, 0xa0, 0x08, 0x00, + 0x2c, 0x9d, 0x08, 0x00, 0x0c, 0xc7, 0x08, 0x00, 0x70, 0xb5, 0x92, 0xb0, + 0x04, 0x46, 0x00, 0x78, 0x94, 0x28, 0x2a, 0xd0, 0x98, 0x28, 0x48, 0xd0, + 0xa6, 0x28, 0x50, 0xd0, 0xc7, 0x28, 0x65, 0xd0, 0xa7, 0x28, 0x5d, 0xd1, + 0x65, 0x68, 0xd5, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0xa0, 0xb9, 0x95, 0xf8, + 0x08, 0x03, 0x88, 0xb9, 0x48, 0x49, 0x62, 0x7a, 0x95, 0xf8, 0x35, 0x01, + 0x0b, 0x68, 0x21, 0x7a, 0x41, 0xea, 0x02, 0x21, 0x8c, 0xb2, 0x00, 0x21, + 0x22, 0x46, 0x98, 0x47, 0x28, 0x46, 0x21, 0x46, 0xff, 0x22, 0x00, 0x23, + 0xee, 0xf7, 0x2e, 0xff, 0x40, 0x48, 0x29, 0x46, 0x00, 0x22, 0x03, 0x68, + 0x01, 0x20, 0x12, 0xb0, 0xbd, 0xe8, 0x70, 0x40, 0x18, 0x47, 0xa5, 0x68, + 0x00, 0x2d, 0x5b, 0xd0, 0x28, 0x79, 0x66, 0x68, 0x18, 0x28, 0x59, 0xd0, + 0x90, 0xbb, 0xd6, 0xf8, 0x34, 0x03, 0x40, 0xf0, 0x80, 0x51, 0x80, 0x00, + 0xc6, 0xf8, 0x34, 0x13, 0x09, 0xd5, 0x32, 0x48, 0x01, 0x68, 0x00, 0x20, + 0x88, 0x47, 0xd6, 0xf8, 0x34, 0x03, 0x20, 0xf0, 0x00, 0x50, 0xc6, 0xf8, + 0x34, 0x03, 0x28, 0x46, 0x12, 0xb0, 0xbd, 0xe8, 0x70, 0x40, 0xee, 0xf7, + 0xc1, 0xbf, 0x21, 0x7a, 0x60, 0x68, 0x3e, 0x29, 0x80, 0xf8, 0x39, 0x10, + 0x14, 0xd1, 0x3e, 0x21, 0x14, 0xf0, 0x80, 0xf9, 0x10, 0xe0, 0x1f, 0x48, + 0x72, 0xb6, 0x01, 0x68, 0x49, 0x00, 0x01, 0x31, 0x01, 0x60, 0x1d, 0x49, + 0x0a, 0x78, 0x0a, 0xb1, 0x01, 0x3a, 0x0a, 0x70, 0x01, 0x68, 0x49, 0x08, + 0x01, 0x60, 0x00, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x20, 0x46, 0x12, 0xb0, + 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, 0x0e, 0xba, 0x01, 0xac, 0x15, 0x4a, + 0x44, 0x21, 0x20, 0x23, 0x20, 0x46, 0xe9, 0xf7, 0x2b, 0xf9, 0x13, 0x4a, + 0x04, 0xf1, 0x20, 0x00, 0x24, 0x21, 0x24, 0x23, 0xe9, 0xf7, 0x24, 0xf9, + 0x80, 0x48, 0x00, 0x21, 0x22, 0x46, 0x44, 0x23, 0xb0, 0xf8, 0xd0, 0x02, + 0xad, 0xf8, 0x3a, 0x00, 0x0c, 0x48, 0x00, 0x68, 0x0f, 0x90, 0x0c, 0x48, + 0x05, 0x68, 0x40, 0xf2, 0x17, 0x60, 0xa8, 0x47, 0x12, 0xb0, 0x70, 0xbd, + 0xa1, 0x89, 0x30, 0x46, 0x18, 0x22, 0x00, 0x23, 0xee, 0xf7, 0xbe, 0xfe, + 0xd2, 0xe7, 0x00, 0xbf, 0x24, 0x36, 0x01, 0x00, 0x52, 0xf1, 0x05, 0x00, + 0x38, 0x7a, 0x01, 0x00, 0x38, 0xfb, 0x05, 0x00, 0x34, 0x21, 0x01, 0x00, + 0x78, 0x9b, 0x08, 0x00, 0x10, 0xb5, 0x08, 0x00, 0x50, 0xb5, 0x08, 0x00, + 0xfc, 0xc8, 0x08, 0x00, 0x10, 0xb5, 0x00, 0xf0, 0xd7, 0xf9, 0x0a, 0x48, + 0x00, 0x24, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0x08, 0x49, 0x48, 0x70, + 0x08, 0x70, 0x08, 0x48, 0x00, 0x68, 0x80, 0x47, 0x07, 0x49, 0x08, 0x71, + 0x07, 0x48, 0x4f, 0xf0, 0xff, 0x31, 0x01, 0x60, 0x06, 0x48, 0x04, 0x70, + 0x10, 0xbd, 0x00, 0xbf, 0xdc, 0x8e, 0x08, 0x00, 0xb8, 0x58, 0x01, 0x00, + 0x10, 0x9c, 0x08, 0x00, 0xcd, 0x0d, 0x01, 0x00, 0x50, 0xd3, 0x05, 0x00, + 0x2c, 0xe6, 0x05, 0x00, 0xb0, 0xb5, 0x02, 0xf0, 0xc0, 0x04, 0x40, 0x2c, + 0x05, 0xd1, 0x07, 0x4d, 0x01, 0xeb, 0x41, 0x04, 0x55, 0xf8, 0x24, 0x40, + 0x3c, 0xb1, 0x2b, 0x2a, 0xbd, 0xe8, 0xb0, 0x40, 0x18, 0xbf, 0x00, 0xf0, + 0xab, 0xb9, 0x04, 0xf0, 0x1f, 0xba, 0xb0, 0xbd, 0xe8, 0x72, 0x01, 0x00, + 0xb0, 0xb5, 0x58, 0xb1, 0x01, 0x68, 0x49, 0xb1, 0x05, 0x4c, 0x89, 0x78, + 0xe5, 0x7a, 0x49, 0x06, 0x44, 0xbf, 0x01, 0x21, 0xe1, 0x72, 0x00, 0xf0, + 0x9f, 0xf9, 0xe5, 0x72, 0xb0, 0xbd, 0x00, 0xbf, 0x60, 0x55, 0x01, 0x00, + 0x2d, 0xe9, 0xf0, 0x41, 0x88, 0x46, 0x05, 0x46, 0x00, 0xf0, 0x9a, 0xf9, + 0x40, 0x48, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, 0x40, 0x45, 0x18, 0xd0, + 0xdf, 0xf8, 0x34, 0xc0, 0x00, 0x21, 0x01, 0x22, 0x01, 0xf0, 0x07, 0x03, + 0xce, 0x08, 0x02, 0xfa, 0x03, 0xf7, 0xab, 0x5d, 0x1f, 0x42, 0x09, 0xd0, + 0x1c, 0xf8, 0x06, 0x40, 0x27, 0x42, 0x05, 0xd1, 0xbb, 0x43, 0x01, 0x38, + 0xab, 0x55, 0xc3, 0xb2, 0x43, 0x45, 0x02, 0xd0, 0x01, 0x31, 0x25, 0x29, + 0xea, 0xd1, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, 0x4a, 0xd3, 0x05, 0x00, + 0x2d, 0xe9, 0xfe, 0x43, 0x89, 0x46, 0x48, 0x49, 0x29, 0x4a, 0x45, 0x4b, + 0x29, 0x4e, 0x2a, 0x4f, 0x80, 0x46, 0x00, 0x20, 0x0d, 0xf1, 0x07, 0x04, + 0x17, 0xf8, 0x01, 0xcb, 0x16, 0xf8, 0x01, 0x5b, 0x01, 0x30, 0x05, 0x28, + 0x0c, 0xea, 0x05, 0x0c, 0x13, 0xf8, 0x01, 0x5b, 0x0c, 0xea, 0x05, 0x0c, + 0x12, 0xf8, 0x01, 0x5b, 0x0c, 0xea, 0x05, 0x0c, 0x11, 0xf8, 0x01, 0x5b, + 0x05, 0xea, 0x0c, 0x05, 0x04, 0xf8, 0x01, 0x5b, 0xe8, 0xd1, 0x1d, 0x48, + 0x01, 0x68, 0x0d, 0xf1, 0x07, 0x00, 0x88, 0x47, 0x48, 0x45, 0x05, 0xd2, + 0x95, 0x48, 0x49, 0x46, 0x02, 0x68, 0x0d, 0xf1, 0x07, 0x00, 0x90, 0x47, + 0x0d, 0xf1, 0x07, 0x01, 0x40, 0x46, 0x05, 0x22, 0xf9, 0xf7, 0x1c, 0xfa, + 0xe0, 0xb1, 0x0d, 0xf1, 0x07, 0x02, 0x40, 0x46, 0x05, 0x21, 0x05, 0x23, + 0xe9, 0xf7, 0x44, 0xf8, 0x10, 0x48, 0xb0, 0xf8, 0x3c, 0x01, 0xc0, 0x07, + 0x06, 0xd0, 0x0f, 0x48, 0x05, 0x21, 0x42, 0x46, 0x05, 0x23, 0x10, 0x30, + 0xe9, 0xf7, 0x38, 0xf8, 0x0c, 0x48, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, + 0x0b, 0x48, 0x00, 0x68, 0x80, 0x47, 0x01, 0x20, 0xbd, 0xe8, 0xfe, 0x83, + 0x00, 0x20, 0xbd, 0xe8, 0xfe, 0x83, 0x00, 0xbf, 0x47, 0x52, 0x01, 0x00, + 0x3d, 0x52, 0x01, 0x00, 0x38, 0x52, 0x01, 0x00, 0x9c, 0xc7, 0x08, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0xa4, 0x79, 0x01, 0x00, 0xa8, 0xc7, 0x08, 0x00, + 0xa4, 0xc7, 0x08, 0x00, 0xb0, 0xb5, 0x11, 0x4d, 0x11, 0x48, 0x12, 0x49, + 0x2a, 0x68, 0x0c, 0x30, 0x90, 0x47, 0x04, 0x46, 0x2a, 0x68, 0x10, 0x48, + 0x10, 0x49, 0x90, 0x47, 0x04, 0xb9, 0xa0, 0xb1, 0x6d, 0x48, 0x0f, 0x4c, + 0x02, 0x21, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x0d, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x0d, 0x48, 0x00, 0x68, 0x80, 0x47, 0x0c, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x0c, 0x48, 0x01, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, + 0x08, 0x47, 0xb0, 0xbd, 0x8c, 0xc4, 0x08, 0x00, 0xb8, 0x68, 0x01, 0x00, + 0x42, 0x52, 0x01, 0x00, 0x34, 0xf1, 0x05, 0x00, 0x4a, 0xd3, 0x05, 0x00, + 0x4c, 0x52, 0x01, 0x00, 0xc4, 0xc4, 0x08, 0x00, 0xa8, 0xc4, 0x08, 0x00, + 0x88, 0xc4, 0x08, 0x00, 0x70, 0xc4, 0x08, 0x00, 0x2d, 0xe9, 0xfe, 0x43, + 0x04, 0x46, 0x00, 0x20, 0x00, 0x2c, 0x02, 0x90, 0xcd, 0xe9, 0x00, 0x00, + 0x6a, 0xd0, 0xdf, 0xf8, 0xd8, 0x80, 0xd8, 0xf8, 0x00, 0x70, 0x00, 0x2f, + 0x40, 0xd0, 0x34, 0x48, 0x94, 0xf8, 0x06, 0x90, 0xbe, 0x79, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0xf8, 0xb1, 0x31, 0x48, 0xfa, 0x1d, 0xe3, 0x1d, + 0x49, 0x46, 0x05, 0x68, 0x30, 0x46, 0xa8, 0x47, 0xb8, 0xb1, 0x2e, 0x49, + 0xd8, 0xf8, 0x00, 0x00, 0x0a, 0x68, 0x21, 0x46, 0x90, 0x47, 0x01, 0x46, + 0xd8, 0xf8, 0x00, 0x00, 0x01, 0x29, 0x3b, 0xd1, 0x6d, 0x46, 0x29, 0x46, + 0xeb, 0xf7, 0x8a, 0xf9, 0x3d, 0x48, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, + 0x20, 0x46, 0x29, 0x46, 0xeb, 0xf7, 0x82, 0xf9, 0x33, 0xe0, 0x22, 0x49, + 0xd8, 0xf8, 0x00, 0x00, 0x0a, 0x68, 0x00, 0x21, 0x90, 0x47, 0x01, 0x46, + 0xd8, 0xf8, 0x00, 0x00, 0x01, 0x29, 0x08, 0xd1, 0x6d, 0x46, 0x29, 0x46, + 0xeb, 0xf7, 0x72, 0xf9, 0x31, 0x48, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, + 0x01, 0xe0, 0xee, 0xf7, 0x03, 0xfe, 0x00, 0x20, 0xc8, 0xf8, 0x00, 0x00, + 0xa0, 0x78, 0x80, 0x06, 0x0b, 0xd4, 0x14, 0x48, 0x00, 0x21, 0x02, 0x68, + 0x20, 0x46, 0x90, 0x47, 0x01, 0x28, 0x07, 0xd1, 0x69, 0x46, 0x20, 0x46, + 0xeb, 0xf7, 0x5a, 0xf9, 0x0e, 0xe0, 0xc8, 0xf8, 0x00, 0x40, 0x0b, 0xe0, + 0x20, 0x46, 0xee, 0xf7, 0xeb, 0xfd, 0x07, 0xe0, 0xee, 0xf7, 0xe8, 0xfd, + 0x20, 0x46, 0xee, 0xf7, 0xe5, 0xfd, 0x00, 0x20, 0xc8, 0xf8, 0x00, 0x00, + 0x00, 0x98, 0x18, 0xb1, 0x1c, 0x48, 0x01, 0x68, 0x68, 0x46, 0x88, 0x47, + 0xbd, 0xe8, 0xfe, 0x83, 0xd0, 0x58, 0x01, 0x00, 0x54, 0xc7, 0x08, 0x00, + 0x5c, 0xc7, 0x08, 0x00, 0x34, 0xc7, 0x08, 0x00, 0x0d, 0x48, 0x0e, 0x49, + 0x01, 0x60, 0x0e, 0x48, 0x0e, 0x49, 0x01, 0x60, 0x0e, 0x48, 0x0f, 0x49, + 0x01, 0x60, 0x0f, 0x48, 0x0f, 0x49, 0x01, 0x60, 0x0f, 0x48, 0x10, 0x49, + 0x01, 0x60, 0x10, 0x48, 0x10, 0x49, 0x01, 0x60, 0x10, 0x48, 0x11, 0x49, + 0x01, 0x60, 0x11, 0x48, 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, 0x12, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x14, 0xcd, 0x08, 0x00, 0xd9, 0x7c, 0x03, 0x00, + 0x9c, 0xcd, 0x08, 0x00, 0x79, 0x7b, 0x03, 0x00, 0xdc, 0xc7, 0x08, 0x00, + 0x31, 0x7e, 0x03, 0x00, 0xf8, 0xcc, 0x08, 0x00, 0x79, 0x7e, 0x03, 0x00, + 0x0c, 0xc7, 0x08, 0x00, 0xa5, 0x7e, 0x03, 0x00, 0x90, 0xcd, 0x08, 0x00, + 0xed, 0x7f, 0x03, 0x00, 0x90, 0xc4, 0x08, 0x00, 0x1d, 0x7f, 0x03, 0x00, + 0xa0, 0xc7, 0x08, 0x00, 0xc9, 0x7e, 0x03, 0x00, 0xa0, 0xcd, 0x08, 0x00, + 0x5d, 0x80, 0x03, 0x00, 0x48, 0xf6, 0x31, 0x7c, 0xc1, 0xf2, 0x08, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf6, 0x21, 0x2c, 0xc1, 0xf2, 0x08, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf2, 0xc1, 0x2c, 0xc1, 0xf2, 0x08, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf6, 0x29, 0x3c, 0xc1, 0xf2, 0x08, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf2, 0x75, 0x2c, 0xc1, 0xf2, 0x06, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x2d, 0xe9, 0xf0, 0x4f, 0x87, 0xb0, 0x80, 0x46, + 0xc0, 0x78, 0x81, 0x28, 0x04, 0xbf, 0x07, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0xdf, 0xf8, 0xe0, 0xa0, 0x98, 0xf8, 0x01, 0x10, 0x81, 0x20, 0x88, 0xf8, + 0x03, 0x00, 0xda, 0xf8, 0x00, 0x00, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, + 0x41, 0x10, 0x00, 0xf5, 0xea, 0x72, 0x90, 0xf8, 0xd5, 0x11, 0x00, 0xf5, + 0xe8, 0x70, 0x12, 0xf8, 0x02, 0x3b, 0x43, 0xea, 0x01, 0x21, 0x13, 0x78, + 0x52, 0x78, 0x43, 0xea, 0x02, 0x22, 0x41, 0xea, 0x02, 0x46, 0x86, 0x42, + 0x4a, 0xd0, 0x4f, 0xf0, 0x01, 0x0b, 0x29, 0x48, 0x31, 0x6b, 0x96, 0xf8, + 0x4e, 0x20, 0xb0, 0xf8, 0xb8, 0x01, 0x08, 0x44, 0x11, 0x46, 0xf0, 0x62, + 0x96, 0xf8, 0x58, 0x00, 0x82, 0x42, 0x38, 0xbf, 0x01, 0x46, 0x96, 0xf8, + 0x28, 0x30, 0xc1, 0xeb, 0x43, 0x01, 0xcb, 0xb2, 0x1f, 0x2b, 0x28, 0xbf, + 0x1f, 0x21, 0x1f, 0x4b, 0x96, 0xf8, 0x52, 0x70, 0xb6, 0xf8, 0x50, 0x40, + 0x86, 0xf8, 0x28, 0x10, 0x96, 0xf8, 0x59, 0x50, 0x96, 0xf8, 0x5c, 0xe0, + 0xb6, 0xf8, 0x5a, 0x90, 0xc9, 0xb2, 0xd3, 0xf8, 0x00, 0xc0, 0x96, 0xf8, + 0x4f, 0x30, 0xcd, 0xe9, 0x00, 0x74, 0x02, 0xac, 0xa4, 0xe8, 0x21, 0x40, + 0xa6, 0xf1, 0xf8, 0x00, 0xcd, 0xe9, 0x05, 0x9b, 0xe0, 0x47, 0x16, 0xf8, + 0x04, 0x0f, 0x71, 0x78, 0xb2, 0x78, 0xf3, 0x78, 0x40, 0xea, 0x01, 0x20, + 0x42, 0xea, 0x03, 0x21, 0x40, 0xea, 0x01, 0x46, 0x98, 0xf8, 0x01, 0x10, + 0xda, 0xf8, 0x00, 0x00, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, + 0x00, 0xf5, 0xe8, 0x70, 0x86, 0x42, 0xb6, 0xd1, 0x06, 0x48, 0x01, 0x68, + 0x40, 0x46, 0x07, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0x08, 0x47, 0x00, 0xbf, + 0xe0, 0x35, 0x01, 0x00, 0xe8, 0x65, 0x08, 0x00, 0x08, 0xb6, 0x08, 0x00, + 0x84, 0xb8, 0x08, 0x00, 0x2d, 0xe9, 0xfc, 0x41, 0xdf, 0xf8, 0x78, 0x80, + 0x05, 0x46, 0x00, 0x20, 0x4f, 0xf4, 0xa8, 0x77, 0x6e, 0x46, 0x0c, 0x46, + 0xad, 0xf8, 0x04, 0x00, 0x32, 0x46, 0xd8, 0xf8, 0x00, 0x00, 0x15, 0xfb, + 0x07, 0x00, 0xd0, 0xf8, 0x88, 0x00, 0x00, 0x90, 0x16, 0x48, 0x03, 0x68, + 0xdb, 0x48, 0x00, 0x69, 0x00, 0xf1, 0x14, 0x01, 0x30, 0x46, 0x98, 0x47, + 0x13, 0x48, 0x04, 0xf1, 0x14, 0x01, 0x32, 0x46, 0x03, 0x68, 0x30, 0x46, + 0x98, 0x47, 0x11, 0x48, 0x50, 0x21, 0x02, 0x68, 0x30, 0x46, 0x90, 0x47, + 0x06, 0x46, 0x00, 0x90, 0xd8, 0xf8, 0x00, 0x00, 0x15, 0xfb, 0x07, 0x00, + 0xb0, 0xf8, 0x98, 0x00, 0x45, 0x00, 0x0b, 0x48, 0x07, 0x68, 0x20, 0x46, + 0xe9, 0xf7, 0xaa, 0xfa, 0xc0, 0xf3, 0xc0, 0x62, 0x30, 0x46, 0x29, 0x46, + 0xb8, 0x47, 0xc0, 0xf3, 0x47, 0x00, 0xbd, 0xe8, 0xfc, 0x81, 0x00, 0xbf, + 0xdc, 0x35, 0x01, 0x00, 0x44, 0xa1, 0x08, 0x00, 0x48, 0xa1, 0x08, 0x00, + 0x3c, 0xa1, 0x08, 0x00, 0x40, 0xa1, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x8d, 0xb0, 0x83, 0x46, 0xba, 0x48, 0x0e, 0x46, 0x01, 0x68, 0x58, 0x46, + 0x88, 0x47, 0x48, 0xb1, 0x04, 0x46, 0x9b, 0xf8, 0x00, 0x00, 0x48, 0xb1, + 0x02, 0x28, 0x15, 0xd1, 0xb6, 0x48, 0x01, 0x21, 0x01, 0x70, 0x11, 0xe0, + 0x00, 0x27, 0x00, 0x20, 0xd5, 0x21, 0xf7, 0xe0, 0x9b, 0xf8, 0xc0, 0x00, + 0x02, 0x28, 0x09, 0xd1, 0xaf, 0x48, 0x40, 0x7f, 0x81, 0x28, 0x05, 0xd1, + 0x58, 0x46, 0xff, 0xf7, 0x0f, 0xff, 0x9b, 0xf8, 0x00, 0x00, 0xe7, 0xe7, + 0xac, 0x4a, 0x08, 0x94, 0xbb, 0xf8, 0x08, 0x10, 0xdb, 0xf8, 0xa0, 0x00, + 0x0c, 0xab, 0x14, 0x68, 0x0d, 0xf1, 0x2f, 0x02, 0xcd, 0xe9, 0x00, 0x32, + 0x0d, 0xf1, 0x32, 0x03, 0x32, 0x46, 0xa0, 0x47, 0x07, 0x46, 0x9b, 0xf8, + 0x00, 0x00, 0x02, 0x28, 0x0f, 0xd1, 0xa1, 0x4c, 0x60, 0x78, 0x50, 0xb1, + 0xdb, 0xf8, 0xa0, 0x10, 0x9b, 0xf8, 0xe6, 0x00, 0xff, 0xf7, 0x72, 0xff, + 0x00, 0x21, 0x02, 0x30, 0x61, 0x70, 0xad, 0xf8, 0x32, 0x00, 0x00, 0x20, + 0x20, 0x70, 0x09, 0x2e, 0x05, 0xd3, 0x9b, 0xf8, 0x00, 0x00, 0x10, 0xb9, + 0x98, 0x48, 0xff, 0x21, 0x01, 0x70, 0x08, 0x9c, 0x01, 0x2f, 0x40, 0xf0, + 0xbb, 0x80, 0x9b, 0xf8, 0x00, 0x00, 0x8b, 0xf8, 0x9a, 0x60, 0x02, 0x28, + 0x00, 0xf0, 0xb8, 0x80, 0x00, 0x28, 0x40, 0xf0, 0xab, 0x80, 0xd4, 0xf8, + 0x00, 0x01, 0x00, 0x28, 0x00, 0xf0, 0xa6, 0x80, 0x0b, 0xa9, 0x0a, 0xaa, + 0x00, 0xf0, 0x28, 0xf9, 0xbd, 0xf8, 0x2c, 0x50, 0xd4, 0xf8, 0x00, 0x01, + 0xbb, 0xf8, 0x08, 0x20, 0xdd, 0xf8, 0x28, 0xe0, 0x00, 0x23, 0x07, 0x95, + 0x00, 0x25, 0xb0, 0xf8, 0xdc, 0x12, 0x05, 0x95, 0x00, 0x25, 0x06, 0x95, + 0x00, 0x25, 0x04, 0x95, 0x00, 0x25, 0x03, 0x95, 0x9a, 0x46, 0x86, 0x4b, + 0x9d, 0xf8, 0x2f, 0x50, 0x89, 0xb2, 0x0e, 0xeb, 0x81, 0x08, 0x91, 0xb2, + 0x1f, 0x68, 0xbd, 0xf8, 0x32, 0x30, 0xcd, 0xe9, 0x00, 0x35, 0x07, 0x9b, + 0x53, 0x44, 0x03, 0xf1, 0x01, 0x09, 0x28, 0xf0, 0x70, 0x43, 0x1f, 0xfa, + 0x89, 0xf6, 0x1d, 0x46, 0x32, 0x46, 0xb8, 0x47, 0x07, 0x46, 0xd4, 0xf8, + 0x00, 0x01, 0xb0, 0xf8, 0xdc, 0x12, 0xef, 0xb3, 0x8f, 0x42, 0xae, 0x46, + 0x3b, 0xd2, 0xbd, 0xf8, 0x32, 0x20, 0xbd, 0xf8, 0x30, 0x30, 0x06, 0x96, + 0x9a, 0x1a, 0xd3, 0x19, 0x9a, 0xb2, 0x8a, 0x42, 0x28, 0xbf, 0x4b, 0x1e, + 0x05, 0x93, 0x94, 0xf8, 0x20, 0x51, 0x9a, 0xb2, 0x40, 0xf2, 0xe2, 0x43, + 0xd4, 0xe9, 0x49, 0xc6, 0xde, 0x4c, 0x4b, 0x43, 0x01, 0x3d, 0x9e, 0x1b, + 0x05, 0xfb, 0x1c, 0x65, 0xb4, 0xf8, 0xb8, 0x61, 0x40, 0xf2, 0xe2, 0x44, + 0x40, 0xf2, 0xe2, 0x4c, 0xad, 0x1b, 0xb5, 0xfb, 0xf4, 0xf5, 0x5c, 0x46, + 0x95, 0x42, 0x88, 0xbf, 0x15, 0x46, 0xaa, 0xb2, 0xdb, 0xf8, 0x0c, 0x50, + 0x5b, 0x1b, 0x9b, 0x1b, 0xb3, 0xfb, 0xfc, 0xfb, 0x5a, 0x45, 0x38, 0xbf, + 0x93, 0x46, 0xbb, 0x45, 0x7e, 0xd2, 0xa3, 0x46, 0x08, 0x9c, 0x06, 0x97, + 0xcd, 0xf8, 0x10, 0x90, 0x72, 0x46, 0xcd, 0xf8, 0x0c, 0xe0, 0x00, 0xe0, + 0xae, 0x46, 0xbb, 0xf8, 0x08, 0x20, 0x0d, 0x46, 0x5f, 0xfa, 0x8a, 0xf6, + 0x0a, 0xf1, 0x01, 0x03, 0x8a, 0x42, 0x38, 0xbf, 0x15, 0x46, 0xb5, 0x42, + 0x96, 0xd8, 0x07, 0x98, 0x06, 0x99, 0xcd, 0xf8, 0x28, 0xe0, 0x18, 0x44, + 0xad, 0xf8, 0x2c, 0x00, 0x08, 0x04, 0x5d, 0xd0, 0x03, 0x98, 0x8d, 0xb2, + 0x05, 0x99, 0x00, 0xeb, 0x85, 0x00, 0x89, 0xb2, 0x20, 0xf0, 0x70, 0x40, + 0xcb, 0xf8, 0xb4, 0x00, 0x40, 0xf2, 0xe2, 0x40, 0x01, 0xfb, 0x00, 0xf3, + 0xba, 0x49, 0x05, 0xfb, 0x00, 0xf2, 0x20, 0x46, 0x0c, 0x68, 0x04, 0x99, + 0x89, 0xb2, 0xa0, 0x47, 0xb7, 0x48, 0x44, 0x4a, 0x78, 0x21, 0x2b, 0x46, + 0x00, 0x95, 0x5e, 0xe0, 0x00, 0x27, 0x00, 0x20, 0x40, 0xf2, 0xad, 0x11, + 0xee, 0xf7, 0x76, 0xfb, 0x38, 0x46, 0x0d, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x36, 0x48, 0x00, 0x69, 0xe9, 0xf7, 0x7c, 0xf9, 0x01, 0x46, 0x35, 0x48, + 0x9b, 0xf8, 0xe6, 0x20, 0x4f, 0xf4, 0xa8, 0x73, 0x00, 0x68, 0x12, 0xfb, + 0x03, 0x02, 0x6f, 0xf0, 0x1f, 0x03, 0xd2, 0xf8, 0x88, 0x00, 0x59, 0x1a, + 0x0b, 0x18, 0x1b, 0x01, 0x08, 0xd5, 0xb2, 0xf8, 0x98, 0x20, 0x92, 0x00, + 0x13, 0x18, 0x23, 0xf0, 0x70, 0x40, 0x0b, 0x44, 0x1b, 0x01, 0xf9, 0xd4, + 0x29, 0x49, 0xbd, 0xf8, 0x32, 0x20, 0x9d, 0xf8, 0x2f, 0x30, 0x20, 0x25, + 0x09, 0xae, 0x0c, 0x68, 0xbb, 0xf8, 0x08, 0x10, 0x52, 0x00, 0xcd, 0xe9, + 0x00, 0x65, 0x49, 0x00, 0xa0, 0x47, 0xcb, 0xf8, 0xb4, 0x00, 0x22, 0x48, + 0x59, 0x46, 0x01, 0x22, 0x01, 0x27, 0x03, 0x68, 0x9b, 0xf9, 0xe6, 0x00, + 0x98, 0x47, 0xc3, 0xe7, 0x00, 0x27, 0xc1, 0xe7, 0x08, 0xeb, 0x87, 0x00, + 0x06, 0x99, 0xcd, 0xf8, 0x28, 0xe0, 0xad, 0xf8, 0x2c, 0x90, 0x20, 0xf0, + 0x70, 0x40, 0xc4, 0xf8, 0xb4, 0x00, 0x40, 0xf2, 0xe2, 0x40, 0x07, 0xfb, + 0x00, 0xf2, 0x0b, 0xfb, 0x00, 0xf3, 0x89, 0x48, 0x04, 0x68, 0x08, 0x98, + 0xa0, 0x47, 0x88, 0x48, 0x13, 0x4a, 0xcd, 0xf8, 0x00, 0xb0, 0x78, 0x21, + 0x3b, 0x46, 0xeb, 0xf7, 0xf3, 0xfe, 0x86, 0x48, 0x90, 0xf8, 0x2c, 0x01, + 0x80, 0x07, 0x05, 0xd5, 0x84, 0x48, 0x81, 0x4a, 0x02, 0x21, 0x03, 0x68, + 0x02, 0x20, 0x98, 0x47, 0x01, 0x27, 0x97, 0xe7, 0x64, 0xb8, 0x08, 0x00, + 0x50, 0x32, 0x06, 0x00, 0x2a, 0xe6, 0x05, 0x00, 0x6c, 0xc7, 0x08, 0x00, + 0x7f, 0xd3, 0x05, 0x00, 0xfc, 0x73, 0x01, 0x00, 0xdc, 0x35, 0x01, 0x00, + 0x08, 0xbb, 0x08, 0x00, 0x68, 0xb8, 0x08, 0x00, 0x10, 0xc7, 0x08, 0x00, + 0x6c, 0x9f, 0x03, 0x00, 0x8a, 0x9f, 0x03, 0x00, 0x10, 0xb5, 0x09, 0x4b, + 0x72, 0xb6, 0x1c, 0x68, 0x64, 0x00, 0x01, 0x34, 0x1c, 0x60, 0x84, 0x6e, + 0xb0, 0xf8, 0x14, 0x03, 0x14, 0x60, 0x08, 0x80, 0x18, 0x68, 0x40, 0x08, + 0x18, 0x60, 0x18, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x10, 0xbd, 0x00, 0xbf, + 0x24, 0x36, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x87, 0xb0, 0x83, 0x46, + 0x60, 0x48, 0x03, 0x91, 0x0d, 0xf1, 0x1a, 0x01, 0x05, 0xaa, 0x9b, 0xf8, + 0x1d, 0x51, 0x04, 0x68, 0xdb, 0xf8, 0x00, 0x01, 0xff, 0xf7, 0xda, 0xff, + 0xc5, 0xeb, 0x05, 0x10, 0x40, 0xf2, 0x71, 0x25, 0xdb, 0xf8, 0x00, 0x31, + 0xdd, 0xf8, 0x14, 0x90, 0x4f, 0xf0, 0x00, 0x08, 0x04, 0xeb, 0x40, 0x10, + 0xdb, 0xf8, 0x30, 0x41, 0xc1, 0x68, 0xd0, 0xf8, 0xb4, 0x20, 0x00, 0xf1, + 0x08, 0x0a, 0x09, 0x1b, 0x4f, 0xf4, 0x1c, 0x74, 0x04, 0xeb, 0x41, 0x04, + 0xb4, 0xfb, 0xf5, 0xf4, 0x65, 0x43, 0xa1, 0xeb, 0x55, 0x01, 0xbd, 0xf8, + 0x1a, 0x50, 0x04, 0x91, 0xa1, 0x18, 0x21, 0xf0, 0x70, 0x47, 0xb3, 0xf8, + 0xdc, 0x12, 0x88, 0xb2, 0x09, 0xeb, 0x80, 0x02, 0xb9, 0x1a, 0x21, 0xf0, + 0x70, 0x43, 0x81, 0x00, 0xb3, 0xf1, 0x00, 0x6f, 0x0b, 0xd9, 0xba, 0xf8, + 0x00, 0x30, 0x9b, 0x00, 0xde, 0x19, 0x26, 0xf0, 0x70, 0x47, 0xb6, 0x1a, + 0x26, 0xf0, 0x70, 0x46, 0xb6, 0xf1, 0x00, 0x6f, 0xf6, 0xd8, 0x22, 0xf0, + 0x70, 0x49, 0x01, 0x35, 0x09, 0xeb, 0x01, 0x02, 0xd3, 0x1b, 0x1b, 0x01, + 0xf7, 0xd4, 0xba, 0xf8, 0x00, 0x10, 0x8b, 0x00, 0xfc, 0x1a, 0x3e, 0x46, + 0x24, 0xf0, 0x70, 0x47, 0xa9, 0xeb, 0x04, 0x04, 0x24, 0x01, 0xf7, 0xd4, + 0xb1, 0x45, 0x08, 0xd1, 0x4b, 0x44, 0x81, 0x42, 0x84, 0xbf, 0x22, 0xf0, + 0x70, 0x49, 0x01, 0x35, 0x23, 0xf0, 0x70, 0x47, 0x00, 0xe0, 0x37, 0x46, + 0xa7, 0xeb, 0x09, 0x02, 0x40, 0xf2, 0x71, 0x23, 0x22, 0xf0, 0x70, 0x42, + 0x5a, 0x43, 0x04, 0x9b, 0x03, 0xeb, 0x52, 0x06, 0xb6, 0xf5, 0xfa, 0x7f, + 0x14, 0xd3, 0x03, 0x9a, 0x06, 0xeb, 0x02, 0x0c, 0x40, 0xf2, 0xe2, 0x42, + 0x00, 0xfb, 0x02, 0xf3, 0xdb, 0xe9, 0x49, 0x42, 0x9a, 0x1a, 0x9b, 0xf8, + 0x20, 0x31, 0x01, 0x3b, 0x03, 0xfb, 0x14, 0x22, 0x20, 0x4b, 0xb3, 0xf8, + 0xb8, 0x31, 0xd2, 0x1a, 0x94, 0x45, 0x14, 0xd3, 0x1e, 0x4a, 0x12, 0x68, + 0x90, 0x47, 0xdb, 0xf8, 0x00, 0x11, 0xba, 0xf8, 0x00, 0x20, 0xb1, 0xf8, + 0xdc, 0x12, 0x8a, 0x42, 0x28, 0xbf, 0x0a, 0x46, 0x90, 0x42, 0x06, 0xd0, + 0x5f, 0xfa, 0x88, 0xf3, 0x08, 0xf1, 0x01, 0x00, 0x9a, 0x42, 0x80, 0x46, + 0x93, 0xd8, 0x03, 0x98, 0xa9, 0xb2, 0x32, 0x46, 0xcd, 0xf8, 0x14, 0x90, + 0xad, 0xf8, 0x1a, 0x50, 0x33, 0x18, 0x11, 0x48, 0x04, 0x68, 0x58, 0x46, + 0xa0, 0x47, 0x9b, 0xf8, 0x1e, 0x31, 0x0f, 0x48, 0x0f, 0x4a, 0x78, 0x21, + 0xcd, 0xe9, 0x00, 0x97, 0xeb, 0xf7, 0x02, 0xfe, 0x0d, 0x48, 0x90, 0xf8, + 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, 0x0c, 0x48, 0x08, 0x4a, 0x02, 0x21, + 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x01, 0x20, 0x07, 0xb0, 0xbd, 0xe8, + 0xf0, 0x8f, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0xc0, 0xc8, 0x08, 0x00, 0xf8, 0xc6, 0x08, 0x00, 0xff, 0x6a, 0x01, 0x00, + 0xaf, 0x9f, 0x03, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x70, 0x9b, 0x08, 0x00, + 0xf8, 0xb5, 0x04, 0x46, 0x90, 0xf8, 0x21, 0x00, 0x0d, 0x46, 0xa0, 0xb1, + 0x01, 0x28, 0x2a, 0xd1, 0x1b, 0x4f, 0x20, 0x46, 0x29, 0x46, 0x01, 0xf0, + 0x1d, 0xfb, 0x50, 0xb3, 0x39, 0x68, 0x06, 0x46, 0x20, 0x46, 0x88, 0x47, + 0x41, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, 0x23, 0xdc, 0x00, 0xf0, 0x87, 0x00, + 0x82, 0x28, 0xee, 0xd0, 0x1e, 0xe0, 0x20, 0x89, 0xa8, 0xb9, 0xa0, 0x8b, + 0x3c, 0x28, 0x12, 0xd3, 0x4f, 0x28, 0x10, 0xd8, 0x20, 0x78, 0x70, 0xb9, + 0xd4, 0xe9, 0x05, 0x01, 0x88, 0x42, 0x38, 0xbf, 0x08, 0x46, 0x47, 0xf2, + 0x30, 0x51, 0x88, 0x42, 0x05, 0xd8, 0x80, 0xb2, 0xb1, 0xfb, 0xf0, 0xf2, + 0x02, 0xfb, 0x10, 0x10, 0x40, 0xb1, 0x20, 0x46, 0x29, 0x46, 0xbd, 0xe8, + 0xf8, 0x40, 0x01, 0xf0, 0xf1, 0xba, 0x00, 0x26, 0x30, 0x46, 0xf8, 0xbd, + 0x18, 0x20, 0x01, 0x26, 0x20, 0x81, 0xf9, 0xe7, 0x98, 0xc8, 0x08, 0x00, + 0x2d, 0xe9, 0xfe, 0x43, 0x00, 0x28, 0x6f, 0xd0, 0xf4, 0x4d, 0x04, 0x46, + 0x00, 0x6c, 0x89, 0x46, 0x94, 0xf8, 0x1d, 0x61, 0x2f, 0x68, 0x20, 0xf4, + 0x80, 0x50, 0x20, 0x64, 0xe1, 0xbb, 0x01, 0x20, 0x4f, 0xf0, 0x00, 0x08, + 0x84, 0xf8, 0x1c, 0x01, 0x5b, 0x48, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, + 0x5a, 0x48, 0x00, 0x68, 0x80, 0x47, 0x5a, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x20, 0x46, 0x03, 0xf0, 0x4f, 0xf8, 0x94, 0xf8, 0x1d, 0x11, 0x28, 0x68, + 0x56, 0x4a, 0xd4, 0xf8, 0x00, 0x51, 0xc1, 0xeb, 0x01, 0x11, 0x52, 0x68, + 0xb5, 0xf8, 0xe2, 0x52, 0x00, 0xeb, 0x41, 0x10, 0x43, 0x78, 0xc3, 0xeb, + 0xc3, 0x01, 0x02, 0xeb, 0x81, 0x01, 0x0a, 0x7e, 0x01, 0x32, 0x0a, 0x76, + 0xd0, 0xf8, 0xa0, 0x10, 0x00, 0x89, 0x4a, 0x7f, 0x4c, 0x49, 0xd1, 0xf8, + 0x00, 0xc0, 0x94, 0xf8, 0x44, 0x10, 0xcd, 0xe9, 0x00, 0x50, 0x03, 0xf1, + 0x2c, 0x00, 0xcd, 0xf8, 0x08, 0x80, 0xc3, 0xb2, 0x14, 0x20, 0xe0, 0x47, + 0x46, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xc6, 0xeb, 0x06, 0x10, + 0x00, 0x22, 0x07, 0xeb, 0x40, 0x10, 0xd0, 0xf8, 0xec, 0x10, 0xc0, 0xf8, + 0xec, 0x20, 0xd1, 0xf8, 0x00, 0x01, 0xc0, 0xf8, 0x00, 0x24, 0xd4, 0xf8, + 0x00, 0x01, 0x90, 0xf8, 0x4e, 0x13, 0x49, 0x07, 0x08, 0xd5, 0x3c, 0x49, + 0x09, 0x79, 0x49, 0x07, 0x44, 0xbf, 0x90, 0xf8, 0x36, 0x03, 0x5f, 0xea, + 0x40, 0x60, 0x40, 0xd4, 0x3b, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0xb9, 0xf1, 0x00, 0x0f, 0x0c, 0xd0, 0x20, 0x6c, 0x81, 0x07, 0x2b, 0xd4, + 0x01, 0x25, 0x0e, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x76, 0x21, 0x03, 0xb0, + 0xbd, 0xe8, 0xf0, 0x43, 0xee, 0xf7, 0x4c, 0xb9, 0x33, 0x48, 0x21, 0x46, + 0x02, 0x68, 0x01, 0x20, 0x90, 0x47, 0x20, 0x6c, 0x00, 0x25, 0xc0, 0x05, + 0x08, 0xd5, 0x30, 0x48, 0x49, 0x46, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, + 0x20, 0x6c, 0x20, 0xf4, 0x80, 0x70, 0x20, 0x64, 0x1d, 0xb1, 0x2c, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x94, 0xf8, 0x4a, 0x11, 0xd4, 0xf8, + 0x00, 0x01, 0x82, 0x22, 0x00, 0x23, 0x03, 0xb0, 0xbd, 0xe8, 0xf0, 0x43, + 0x18, 0xf0, 0x84, 0xb9, 0x21, 0x48, 0x84, 0xf8, 0x1f, 0x91, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x06, 0x20, 0x84, 0xf8, 0x1c, 0x01, 0xbd, 0xe8, + 0xfe, 0x83, 0x18, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x28, 0xb9, 0xd0, + 0x06, 0x46, 0x94, 0xf8, 0x4a, 0x01, 0x02, 0x28, 0x07, 0xd3, 0x04, 0x28, + 0x01, 0xd8, 0x0c, 0x20, 0x05, 0xe0, 0x09, 0x28, 0x01, 0xd8, 0x80, 0x20, + 0x01, 0xe0, 0x10, 0x49, 0x08, 0x5c, 0x30, 0x71, 0x0f, 0x48, 0x32, 0x46, + 0x01, 0x23, 0xd4, 0xf8, 0x00, 0x11, 0x05, 0x68, 0x4f, 0x20, 0xa8, 0x47, + 0x00, 0x28, 0x9f, 0xd0, 0x30, 0x46, 0xee, 0xf7, 0x1b, 0xf9, 0x9b, 0xe7, + 0x00, 0xbb, 0x08, 0x00, 0xb8, 0xa0, 0x08, 0x00, 0xfc, 0xba, 0x08, 0x00, + 0xec, 0xe5, 0x05, 0x00, 0x10, 0xbb, 0x08, 0x00, 0x8c, 0xc8, 0x08, 0x00, + 0x70, 0x52, 0x01, 0x00, 0x48, 0xb5, 0x08, 0x00, 0x6a, 0x32, 0x0a, 0x10, + 0x80, 0x9b, 0x08, 0x00, 0x7c, 0xc8, 0x08, 0x00, 0x34, 0xb5, 0x08, 0x00, + 0x78, 0xc8, 0x08, 0x00, 0xcc, 0xc4, 0x08, 0x00, 0xd0, 0xc4, 0x08, 0x00, + 0x2d, 0xe9, 0xfe, 0x4f, 0x86, 0x46, 0x80, 0x48, 0x89, 0x46, 0x01, 0x26, + 0x4f, 0xf0, 0x00, 0x08, 0x4f, 0xf0, 0x00, 0x0b, 0x4f, 0xf0, 0x00, 0x0a, + 0x9e, 0xf8, 0x01, 0x10, 0x00, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, + 0x41, 0x10, 0x00, 0xf5, 0xea, 0x73, 0x90, 0xf8, 0xd5, 0x11, 0x00, 0xf5, + 0xe8, 0x7c, 0x13, 0xf8, 0x02, 0x4b, 0x44, 0xea, 0x01, 0x21, 0x1c, 0x78, + 0x5b, 0x78, 0x44, 0xea, 0x03, 0x23, 0x00, 0x24, 0x41, 0xea, 0x03, 0x41, + 0x61, 0x45, 0x00, 0xf0, 0xc0, 0x80, 0x00, 0x23, 0x91, 0xf8, 0x40, 0x00, + 0x91, 0xf8, 0x41, 0x50, 0xa8, 0x42, 0x01, 0xd3, 0x00, 0x28, 0x66, 0xd0, + 0x91, 0xf8, 0x4e, 0x40, 0x24, 0xb3, 0xd8, 0xb2, 0xd9, 0xf8, 0x08, 0x50, + 0x80, 0x00, 0x50, 0xfa, 0x83, 0xf0, 0x05, 0xeb, 0x40, 0x06, 0x15, 0xf8, + 0x10, 0x00, 0xb7, 0x78, 0x36, 0x79, 0x01, 0x38, 0xb6, 0xfb, 0xf7, 0xf5, + 0x10, 0xfb, 0x06, 0xf0, 0x05, 0xfb, 0x17, 0x66, 0x35, 0x44, 0x50, 0xfa, + 0x85, 0xfa, 0x91, 0xf8, 0x28, 0x00, 0x91, 0xf8, 0x4f, 0x50, 0xb0, 0xfb, + 0xf4, 0xf6, 0x01, 0x3d, 0x06, 0xfb, 0x14, 0x04, 0x15, 0xfb, 0x00, 0xf0, + 0x34, 0x44, 0x50, 0xfa, 0x84, 0xfb, 0x03, 0xe0, 0x4f, 0xf0, 0x00, 0x0a, + 0x4f, 0xf0, 0x00, 0x0b, 0x91, 0xf8, 0x58, 0x40, 0x1c, 0xb3, 0xd8, 0xb2, + 0xd9, 0xf8, 0x08, 0x50, 0x80, 0x00, 0x50, 0xfa, 0x83, 0xf0, 0x05, 0xeb, + 0x40, 0x00, 0x45, 0x78, 0xc6, 0x78, 0x00, 0x79, 0xb0, 0xfb, 0xf6, 0xf7, + 0x01, 0x3d, 0x15, 0xfb, 0x00, 0xf5, 0x07, 0xfb, 0x16, 0x00, 0x38, 0x44, + 0x55, 0xfa, 0x80, 0xf8, 0x91, 0xf8, 0x28, 0x00, 0x91, 0xf8, 0x59, 0x50, + 0xb0, 0xfb, 0xf4, 0xf6, 0x01, 0x3d, 0x06, 0xfb, 0x14, 0x04, 0x15, 0xfb, + 0x00, 0xf0, 0x34, 0x44, 0x50, 0xfa, 0x84, 0xf4, 0x02, 0xe0, 0x4f, 0xf0, + 0x00, 0x08, 0x00, 0x24, 0x1f, 0xfa, 0x8a, 0xf6, 0x1f, 0xfa, 0x8b, 0xf0, + 0xb0, 0x42, 0x31, 0xd8, 0x1f, 0xfa, 0x88, 0xf7, 0xa5, 0xb2, 0xbd, 0x42, + 0x2c, 0xd8, 0xb0, 0x42, 0x08, 0xbf, 0xbd, 0x42, 0x10, 0xd0, 0x01, 0x33, + 0x00, 0x26, 0x11, 0xf8, 0x04, 0x0f, 0x4d, 0x78, 0x8f, 0x78, 0xc9, 0x78, + 0x40, 0xea, 0x05, 0x20, 0x47, 0xea, 0x01, 0x21, 0x40, 0xea, 0x01, 0x41, + 0x61, 0x45, 0x7f, 0xf4, 0x83, 0xaf, 0x19, 0xe0, 0x99, 0xf8, 0x04, 0x00, + 0x10, 0xb1, 0x9e, 0xf8, 0xe2, 0x00, 0xa8, 0xb1, 0xb9, 0xf8, 0x00, 0x60, + 0xbe, 0xf8, 0x08, 0x00, 0xb0, 0x42, 0x07, 0xd8, 0x00, 0x2a, 0xe0, 0xd0, + 0xb6, 0xfb, 0xf2, 0xf0, 0x00, 0xfb, 0x12, 0x60, 0x00, 0x28, 0xda, 0xd0, + 0x01, 0x26, 0x44, 0x46, 0xd3, 0x46, 0x28, 0xe0, 0x01, 0x26, 0x26, 0xe0, + 0x2e, 0xbb, 0x01, 0xe0, 0x44, 0x46, 0xd3, 0x46, 0xb9, 0xf8, 0x00, 0x10, + 0x40, 0xf2, 0xe2, 0x45, 0xbe, 0xf8, 0x08, 0x00, 0x1f, 0xfa, 0x8a, 0xf2, + 0x1f, 0xfa, 0x8b, 0xf3, 0x77, 0x46, 0x69, 0x43, 0xcd, 0xe9, 0x00, 0x13, + 0x02, 0x92, 0x00, 0xfb, 0x05, 0xf3, 0x73, 0x48, 0x17, 0x4a, 0x78, 0x21, + 0xeb, 0xf7, 0xdc, 0xfb, 0x72, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, + 0x05, 0xd5, 0x71, 0x48, 0x6d, 0x4a, 0x01, 0x21, 0x03, 0x68, 0x02, 0x20, + 0x98, 0x47, 0x00, 0x26, 0xbe, 0x46, 0xb9, 0xf8, 0x00, 0x00, 0xbe, 0xf8, + 0x08, 0x10, 0x0e, 0x4a, 0x0c, 0x23, 0x41, 0xea, 0x00, 0x40, 0x1f, 0xfa, + 0x8a, 0xf1, 0x16, 0x60, 0x50, 0x60, 0xcb, 0xea, 0x04, 0x40, 0x40, 0xea, + 0x08, 0x60, 0x40, 0xea, 0x01, 0x20, 0x00, 0x21, 0x90, 0x60, 0x07, 0x48, + 0x04, 0x68, 0x40, 0xf2, 0x33, 0x20, 0xa0, 0x47, 0xf0, 0xb2, 0xbd, 0xe8, + 0xfe, 0x8f, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, 0xd3, 0x9f, 0x03, 0x00, + 0x8c, 0x34, 0x01, 0x00, 0x78, 0x9b, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x87, 0xb0, 0x06, 0x46, 0x4e, 0x48, 0x0d, 0x46, 0x00, 0x68, 0x80, 0x47, + 0x4d, 0x49, 0x91, 0xf8, 0xc4, 0x11, 0x88, 0x42, 0x14, 0xd2, 0x4c, 0x48, + 0x01, 0x68, 0x4f, 0xf4, 0x1a, 0x70, 0x88, 0x47, 0x70, 0xb1, 0x31, 0x78, + 0x80, 0x46, 0x06, 0x20, 0x02, 0x29, 0x48, 0x49, 0x38, 0xbf, 0x05, 0x20, + 0x0a, 0x68, 0x41, 0x46, 0x90, 0x47, 0xff, 0x28, 0x06, 0xd1, 0x40, 0x46, + 0xed, 0xf7, 0xce, 0xff, 0x00, 0x20, 0x07, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x41, 0x49, 0x88, 0xf8, 0x44, 0x00, 0x0a, 0x68, 0xc1, 0xb2, 0x40, 0x48, + 0x90, 0x47, 0x98, 0xf8, 0x44, 0x10, 0x00, 0x20, 0x16, 0x29, 0xf0, 0xd8, + 0x96, 0x49, 0xb3, 0x78, 0x44, 0x46, 0x0a, 0x68, 0x71, 0x78, 0x06, 0x93, + 0x05, 0x91, 0xc1, 0xeb, 0x01, 0x11, 0x04, 0x91, 0x02, 0xeb, 0x41, 0x11, + 0x01, 0xf5, 0xe8, 0x77, 0x91, 0xf8, 0xd1, 0xc1, 0x3a, 0x46, 0x12, 0xf8, + 0x02, 0x9b, 0x92, 0xf8, 0x00, 0xa0, 0x92, 0xf8, 0x01, 0xb0, 0x04, 0xf8, + 0xf8, 0x9f, 0x88, 0xf8, 0xf9, 0xc0, 0x49, 0xea, 0x0c, 0x2c, 0x4f, 0xea, + 0x14, 0x4e, 0x23, 0x0e, 0x84, 0xf8, 0x03, 0xb0, 0x84, 0xf8, 0x02, 0xa0, + 0x82, 0xf8, 0x00, 0xe0, 0x53, 0x70, 0x22, 0x0a, 0x81, 0xf8, 0xd0, 0x41, + 0x81, 0xf8, 0xd1, 0x21, 0x4a, 0xea, 0x0b, 0x21, 0x4c, 0xea, 0x01, 0x41, + 0x4a, 0x71, 0x01, 0xf8, 0x04, 0x4f, 0x04, 0x9a, 0x81, 0xf8, 0x02, 0xe0, + 0xcb, 0x70, 0x7b, 0x49, 0x88, 0xf8, 0x1c, 0x01, 0x20, 0x48, 0x05, 0x9b, + 0x88, 0xf8, 0x1e, 0x51, 0x09, 0x68, 0x90, 0xf8, 0xca, 0x01, 0x88, 0xf8, + 0x1d, 0x31, 0x01, 0xeb, 0x42, 0x11, 0x88, 0xf8, 0xd0, 0x01, 0x38, 0x0a, + 0x91, 0xf8, 0xc0, 0x20, 0x01, 0x32, 0x81, 0xf8, 0xc0, 0x20, 0x88, 0xf8, + 0xfd, 0x00, 0x40, 0x46, 0x39, 0x0c, 0x17, 0x4a, 0x00, 0xf8, 0xfc, 0x7f, + 0x81, 0x70, 0x39, 0x0e, 0xc1, 0x70, 0x96, 0xf8, 0xc0, 0x00, 0x78, 0x21, + 0x00, 0x90, 0x06, 0x98, 0xcd, 0xe9, 0x01, 0x05, 0x0f, 0x48, 0xeb, 0xf7, + 0x17, 0xfb, 0x10, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x40, 0x46, + 0x89, 0xd5, 0x0e, 0x48, 0x0a, 0x4a, 0x02, 0x21, 0x03, 0x68, 0x02, 0x20, + 0x98, 0x47, 0x40, 0x46, 0x81, 0xe7, 0x00, 0xbf, 0x40, 0xc8, 0x08, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x4c, 0x9c, 0x08, 0x00, 0x44, 0xc8, 0x08, 0x00, + 0xa4, 0xda, 0x08, 0x00, 0xc0, 0x52, 0x01, 0x00, 0x00, 0x69, 0x08, 0x00, + 0xff, 0x6a, 0x01, 0x00, 0x16, 0xa0, 0x03, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0x70, 0x9b, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x47, 0x00, 0x28, 0x00, 0xf0, + 0x97, 0x80, 0x04, 0x46, 0x90, 0xf8, 0x41, 0x00, 0x40, 0x06, 0x09, 0xd5, + 0x4d, 0x49, 0x94, 0xf8, 0x44, 0x00, 0x0a, 0x68, 0x00, 0x21, 0x90, 0x47, + 0x20, 0x6c, 0x20, 0xf4, 0x80, 0x40, 0x20, 0x64, 0xdf, 0xf8, 0x24, 0x91, + 0x94, 0xf8, 0x1d, 0x01, 0xc0, 0xeb, 0x00, 0x17, 0xd9, 0xf8, 0x00, 0x50, + 0x79, 0x01, 0x69, 0x5c, 0x01, 0x29, 0x29, 0x46, 0x09, 0xd8, 0x20, 0x46, + 0x02, 0xf0, 0xc0, 0xfe, 0x00, 0x20, 0xc4, 0xe9, 0x7c, 0x00, 0x94, 0xf8, + 0x1d, 0x01, 0xd9, 0xf8, 0x00, 0x10, 0xc0, 0xeb, 0x00, 0x10, 0xdf, 0xf8, + 0xf8, 0x80, 0x01, 0xeb, 0x40, 0x10, 0x40, 0x78, 0xd8, 0xf8, 0x04, 0x10, + 0xc0, 0xeb, 0xc0, 0x00, 0x01, 0xeb, 0x80, 0x00, 0x10, 0xf8, 0x18, 0x1f, + 0x09, 0xb1, 0x01, 0x39, 0x01, 0x70, 0x37, 0x48, 0x05, 0xeb, 0x47, 0x17, + 0x72, 0xb6, 0x01, 0x68, 0x49, 0x00, 0x01, 0x31, 0x01, 0x60, 0xb4, 0xf8, + 0x7a, 0x11, 0x21, 0xf0, 0x08, 0x01, 0xa4, 0xf8, 0x7a, 0x11, 0x01, 0x68, + 0x49, 0x08, 0x01, 0x60, 0x00, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x20, 0x46, + 0x00, 0xf0, 0xec, 0xff, 0x82, 0x46, 0x97, 0xf8, 0x06, 0x01, 0x03, 0x28, + 0x49, 0xd1, 0x94, 0xf8, 0x1d, 0x11, 0xd9, 0xf8, 0x00, 0x00, 0xc1, 0xeb, + 0x01, 0x11, 0x00, 0xeb, 0x41, 0x11, 0x4a, 0x78, 0x25, 0x49, 0x0b, 0x78, + 0x93, 0x42, 0x3c, 0xd1, 0x24, 0x4a, 0x00, 0x24, 0xc8, 0xf8, 0x00, 0x40, + 0x14, 0x70, 0xff, 0x22, 0x0a, 0x70, 0x17, 0xf8, 0x01, 0x1f, 0xc1, 0xeb, + 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, 0xd0, 0xf8, 0xd4, 0x61, 0x00, 0xf5, + 0xe8, 0x70, 0x86, 0x42, 0x29, 0xd0, 0x1c, 0x4d, 0x29, 0x68, 0xa6, 0xf1, + 0xe0, 0x00, 0x06, 0xf8, 0xd0, 0x4c, 0x88, 0x47, 0x06, 0xf5, 0x82, 0x70, + 0x10, 0x21, 0xea, 0xf7, 0x8d, 0xfe, 0x16, 0xf8, 0x04, 0x0f, 0x71, 0x78, + 0xb2, 0x78, 0xf3, 0x78, 0x40, 0xea, 0x01, 0x20, 0x42, 0xea, 0x03, 0x21, + 0x40, 0xea, 0x01, 0x46, 0x39, 0x78, 0xd9, 0xf8, 0x00, 0x00, 0xc1, 0xeb, + 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, 0x00, 0xf5, 0xe8, 0x70, 0x86, 0x42, + 0xde, 0xd1, 0x06, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x16, 0x41, 0x4f, 0xf0, + 0x00, 0x0a, 0xed, 0xf7, 0x77, 0xfe, 0x50, 0x46, 0xbd, 0xe8, 0xf0, 0x87, + 0x00, 0xb6, 0x08, 0x00, 0xe0, 0x35, 0x01, 0x00, 0xec, 0xe5, 0x05, 0x00, + 0x24, 0x36, 0x01, 0x00, 0x41, 0xd3, 0x05, 0x00, 0x74, 0xe5, 0x05, 0x00, + 0x2c, 0x9d, 0x08, 0x00, 0x0a, 0x48, 0x00, 0x22, 0x01, 0x1d, 0x51, 0xf8, + 0x04, 0x0c, 0x48, 0xb1, 0x0b, 0x78, 0x05, 0x2b, 0x06, 0xd1, 0x90, 0xf8, + 0x1c, 0x31, 0x01, 0x20, 0x02, 0x2b, 0x18, 0xbf, 0x04, 0x2b, 0x04, 0xd0, + 0x01, 0x32, 0x0c, 0x31, 0x17, 0x2a, 0xee, 0xd1, 0x00, 0x20, 0x70, 0x47, + 0xe8, 0x72, 0x01, 0x00, 0x70, 0xb5, 0x88, 0xb0, 0x04, 0x46, 0x12, 0x98, + 0x0e, 0x9e, 0x15, 0x46, 0x06, 0x90, 0x11, 0x98, 0x02, 0x96, 0x05, 0x90, + 0x10, 0x98, 0x04, 0x90, 0x0f, 0x98, 0x03, 0x90, 0x0d, 0x98, 0x01, 0x90, + 0x0c, 0x98, 0x00, 0x90, 0x20, 0x46, 0x00, 0xf0, 0x65, 0xff, 0xe2, 0x48, + 0x94, 0xf8, 0x1d, 0x11, 0x00, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, + 0x41, 0x12, 0xd2, 0xf8, 0xa0, 0x20, 0x52, 0x7f, 0x22, 0xb1, 0x04, 0xf5, + 0xe6, 0x72, 0x04, 0xf2, 0xcd, 0x13, 0x03, 0xe0, 0x04, 0xf2, 0xcd, 0x12, + 0x04, 0xf5, 0xe6, 0x73, 0x49, 0x01, 0x1d, 0x70, 0x40, 0x5c, 0x04, 0x49, + 0x01, 0x28, 0x98, 0xbf, 0x16, 0x70, 0xb4, 0xf8, 0x34, 0x01, 0x08, 0x80, + 0x08, 0xb0, 0x70, 0xbd, 0x7e, 0xe5, 0x05, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x8f, 0xb0, 0xb3, 0xf5, 0xfa, 0x7f, 0xc0, 0xf0, 0x97, 0x81, 0x18, 0x9c, + 0x1f, 0x46, 0xa3, 0x42, 0x00, 0xf2, 0x92, 0x81, 0x06, 0x46, 0xb1, 0xf8, + 0xdc, 0x02, 0x8b, 0x46, 0x40, 0xf2, 0xe2, 0x41, 0x48, 0x43, 0xa0, 0x42, + 0x40, 0xf2, 0x88, 0x81, 0x15, 0x46, 0xa7, 0x42, 0x06, 0xd1, 0xc7, 0x48, + 0x29, 0x46, 0x3a, 0x46, 0x3b, 0x46, 0x04, 0x68, 0x30, 0x46, 0xfe, 0xe0, + 0xc0, 0x48, 0x96, 0xf8, 0x1d, 0x11, 0xc0, 0x4b, 0x00, 0x68, 0xc1, 0xeb, + 0x01, 0x11, 0xd3, 0xf8, 0x00, 0xc0, 0x9b, 0xf8, 0x35, 0x31, 0x00, 0xeb, + 0x41, 0x18, 0xdb, 0xf8, 0xd4, 0x00, 0x38, 0xf8, 0x08, 0x1f, 0x98, 0xf8, + 0x92, 0x20, 0x00, 0x93, 0xb8, 0x4b, 0xe0, 0x47, 0x00, 0x28, 0x00, 0xf0, + 0x65, 0x81, 0x40, 0xf2, 0xe2, 0x40, 0x07, 0xf2, 0xe1, 0x42, 0xcd, 0xe9, + 0x0b, 0x86, 0x0e, 0x95, 0xb4, 0xfb, 0xf0, 0xf8, 0xb2, 0xfb, 0xf0, 0xfa, + 0x1f, 0xfa, 0x88, 0xf1, 0x1f, 0xfa, 0x8a, 0xf7, 0x41, 0x43, 0x07, 0xfb, + 0x00, 0xf2, 0x8a, 0x42, 0x54, 0xd2, 0xae, 0x48, 0x0e, 0x9c, 0x02, 0x68, + 0x58, 0x46, 0x21, 0x46, 0x90, 0x47, 0x81, 0x46, 0xab, 0x48, 0x22, 0x46, + 0x4b, 0x46, 0x05, 0x68, 0x0b, 0x98, 0x01, 0x88, 0xa5, 0x48, 0x00, 0x7a, + 0xcd, 0xe9, 0x00, 0x70, 0x58, 0x46, 0xa8, 0x47, 0x04, 0x46, 0xa8, 0xeb, + 0x0a, 0x00, 0xa5, 0x4e, 0xa5, 0x4a, 0x78, 0x21, 0x05, 0x19, 0x23, 0x46, + 0xa8, 0xb2, 0x0d, 0x90, 0x00, 0x90, 0x30, 0x46, 0xeb, 0xf7, 0x80, 0xf9, + 0xa1, 0x4f, 0x97, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, 0xa0, 0x48, + 0x02, 0x21, 0x32, 0x46, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x41, 0x2c, + 0x2b, 0xd3, 0x95, 0x48, 0x0b, 0x9e, 0xdf, 0xf8, 0x80, 0x82, 0x0e, 0x9d, + 0x4b, 0x46, 0x00, 0x7a, 0x31, 0x88, 0xd8, 0xf8, 0x00, 0x70, 0x2a, 0x46, + 0xcd, 0xe9, 0x00, 0x40, 0x58, 0x46, 0xb8, 0x47, 0x82, 0x46, 0x8d, 0x48, + 0x0d, 0x9a, 0xd8, 0xf8, 0x00, 0x40, 0x31, 0x88, 0x4b, 0x46, 0x00, 0x7a, + 0xcd, 0xe9, 0x00, 0x20, 0x58, 0x46, 0x2a, 0x46, 0xa0, 0x47, 0x40, 0xf2, + 0xe2, 0x41, 0x00, 0xfb, 0x01, 0xf3, 0x86, 0x48, 0x0a, 0xfb, 0x01, 0xf2, + 0x29, 0x46, 0x04, 0x68, 0x0c, 0x98, 0x7c, 0xe0, 0x82, 0x48, 0x18, 0xbf, + 0x22, 0x46, 0x0e, 0x99, 0x74, 0xe0, 0x0d, 0x98, 0x40, 0x21, 0x06, 0x95, + 0x3f, 0x28, 0x38, 0xbf, 0x41, 0x1c, 0xa1, 0x42, 0x5a, 0xd9, 0x07, 0xf5, + 0x96, 0x70, 0x0d, 0x46, 0x00, 0x26, 0xa0, 0x46, 0xa2, 0x46, 0x04, 0x94, + 0x05, 0x90, 0x77, 0x48, 0xd0, 0xe9, 0x00, 0x12, 0x07, 0x8a, 0x00, 0x20, + 0x07, 0x90, 0x00, 0x20, 0x08, 0x90, 0x00, 0x20, 0xcd, 0xe9, 0x09, 0x21, + 0x5f, 0xfa, 0x8a, 0xf9, 0x04, 0x46, 0xb9, 0xfb, 0xf7, 0xf0, 0x00, 0xfb, + 0x17, 0x92, 0xdd, 0xe9, 0x09, 0x10, 0xe8, 0xf7, 0x51, 0xfb, 0xc0, 0x07, + 0x07, 0xd0, 0x60, 0x1c, 0xb9, 0xf1, 0x3f, 0x0f, 0x16, 0xd0, 0x0d, 0x99, + 0x41, 0x45, 0x0c, 0xd1, 0x12, 0xe0, 0x08, 0x98, 0xe1, 0xb2, 0xc0, 0xb2, + 0x81, 0x42, 0x05, 0xd9, 0xaa, 0xeb, 0x04, 0x00, 0xaa, 0xf1, 0x01, 0x06, + 0x08, 0x94, 0x07, 0x90, 0x00, 0x20, 0x0a, 0xf1, 0x01, 0x0a, 0x5f, 0xfa, + 0x8a, 0xf8, 0x45, 0x45, 0xd8, 0xd8, 0x0a, 0xe0, 0x08, 0x99, 0xc2, 0xb2, + 0xc9, 0xb2, 0x8a, 0x42, 0x05, 0xd9, 0x08, 0x90, 0x5e, 0x48, 0xaa, 0xeb, + 0x04, 0x03, 0x56, 0x46, 0x05, 0xe0, 0x08, 0x98, 0x04, 0x9c, 0x07, 0x9b, + 0x00, 0x06, 0xfc, 0x48, 0x0e, 0xd0, 0x05, 0x46, 0x0d, 0x98, 0x0e, 0x9a, + 0xb0, 0x46, 0x40, 0x28, 0x20, 0xd3, 0xf0, 0xb2, 0xdd, 0xf8, 0x14, 0xa0, + 0x3f, 0x28, 0x7e, 0xd1, 0xdd, 0xf8, 0x18, 0x80, 0x0c, 0x9e, 0x1a, 0xe0, + 0x0b, 0x98, 0x0e, 0x9d, 0x23, 0x46, 0x01, 0x88, 0x54, 0x48, 0x2a, 0x46, + 0x06, 0x68, 0x4a, 0x48, 0x00, 0x7a, 0x00, 0x90, 0x58, 0x46, 0xb0, 0x47, + 0x40, 0xf2, 0xe2, 0x41, 0x00, 0xfb, 0x01, 0xf2, 0x46, 0x48, 0x29, 0x46, + 0x04, 0x68, 0x0c, 0x98, 0x13, 0x46, 0xa0, 0x47, 0x01, 0x20, 0x7c, 0xe0, + 0x0c, 0x9e, 0xdd, 0xf8, 0x14, 0xa0, 0x0b, 0x98, 0x5f, 0xfa, 0x83, 0xf9, + 0x4b, 0x46, 0x01, 0x88, 0x46, 0x48, 0x04, 0x68, 0x3c, 0x48, 0x00, 0x7a, + 0x00, 0x90, 0x58, 0x46, 0xa0, 0x47, 0x30, 0xb1, 0x07, 0x46, 0x5f, 0xfa, + 0x88, 0xf0, 0xa0, 0xeb, 0x09, 0x00, 0x38, 0x44, 0x11, 0xe0, 0x9a, 0xf8, + 0x00, 0x00, 0x80, 0x07, 0x05, 0xd5, 0xdd, 0x48, 0x3d, 0x4a, 0x01, 0x21, + 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x5f, 0xfa, 0x88, 0xf0, 0x01, 0x27, + 0xa0, 0xeb, 0x09, 0x00, 0x01, 0x28, 0xd8, 0xbf, 0x38, 0x46, 0xbb, 0xf8, + 0xdc, 0x12, 0x40, 0xf2, 0xe2, 0x42, 0xd6, 0xe9, 0x49, 0x34, 0x51, 0x43, + 0x09, 0x1b, 0x96, 0xf8, 0x20, 0x41, 0x01, 0x3c, 0x04, 0xfb, 0x13, 0x11, + 0xcb, 0x4b, 0xb3, 0xf8, 0xb8, 0x31, 0xc9, 0x1a, 0xb1, 0xfb, 0xf2, 0xf1, + 0xb9, 0x42, 0x01, 0xd2, 0x01, 0x46, 0x03, 0xe0, 0x80, 0xb2, 0x81, 0x42, + 0x88, 0xbf, 0x01, 0x46, 0x5f, 0xfa, 0x88, 0xf0, 0x29, 0x4a, 0x8c, 0xb2, + 0x78, 0x21, 0x4b, 0x46, 0xcd, 0xe9, 0x00, 0x07, 0x28, 0x46, 0x02, 0x94, + 0xeb, 0xf7, 0x7c, 0xf8, 0x9a, 0xf8, 0x00, 0x00, 0x80, 0x07, 0x05, 0xd5, + 0xc0, 0x48, 0x02, 0x21, 0x2a, 0x46, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, + 0x40, 0xf2, 0xe2, 0x40, 0x0e, 0x99, 0x07, 0xfb, 0x00, 0xf2, 0x04, 0xfb, + 0x00, 0xf3, 0x12, 0x48, 0x97, 0xe6, 0x0d, 0x98, 0x08, 0x99, 0x0c, 0x9e, + 0x3f, 0x38, 0xc9, 0xb2, 0x88, 0x42, 0x98, 0xd9, 0x01, 0x06, 0x05, 0xd0, + 0xdd, 0xf8, 0x18, 0x80, 0xa8, 0xeb, 0x00, 0x00, 0x43, 0x1c, 0x90, 0xe7, + 0x9a, 0xf8, 0x00, 0x00, 0x80, 0x07, 0x05, 0xd5, 0xaf, 0x48, 0x0e, 0x4a, + 0x01, 0x21, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x00, 0x20, 0x0f, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0xe0, 0x35, 0x01, 0x00, 0xf4, 0xc6, 0x08, 0x00, + 0x38, 0x53, 0x01, 0x00, 0xf8, 0xc6, 0x08, 0x00, 0x64, 0xc7, 0x08, 0x00, + 0x14, 0xc7, 0x08, 0x00, 0xff, 0x6a, 0x01, 0x00, 0x3e, 0xa0, 0x03, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x70, 0x9b, 0x08, 0x00, 0x9c, 0xa0, 0x03, 0x00, + 0x20, 0xc7, 0x08, 0x00, 0x5b, 0xa0, 0x03, 0x00, 0x71, 0xa0, 0x03, 0x00, + 0x10, 0xc7, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x00, 0x20, 0x21, 0x78, + 0x20, 0x81, 0x84, 0xf8, 0x9a, 0x00, 0xe0, 0x70, 0x01, 0x29, 0x07, 0xd8, + 0xe0, 0x60, 0x84, 0xf8, 0x06, 0x01, 0x04, 0xf5, 0x80, 0x70, 0x05, 0x21, + 0xea, 0xf7, 0x3c, 0xfc, 0x05, 0x48, 0x61, 0x78, 0x40, 0x68, 0xc1, 0xeb, + 0xc1, 0x01, 0x00, 0xeb, 0x81, 0x00, 0x1c, 0x21, 0xea, 0xf7, 0x32, 0xfc, + 0x10, 0xbd, 0x00, 0xbf, 0xec, 0xe5, 0x05, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x87, 0xb0, 0x00, 0x28, 0x00, 0xf0, 0xab, 0x80, 0x04, 0x46, 0x84, 0x48, + 0x0e, 0x46, 0x00, 0xf5, 0xdc, 0x78, 0x94, 0xf8, 0x9a, 0x00, 0x18, 0xf8, + 0x17, 0x9f, 0x98, 0xf8, 0x01, 0xa0, 0x18, 0xb1, 0x20, 0x89, 0x00, 0x28, + 0x40, 0xf0, 0x9b, 0x80, 0x94, 0xf8, 0x21, 0x00, 0x00, 0x28, 0x7b, 0xd0, + 0x46, 0x21, 0x00, 0x28, 0x7a, 0x4d, 0x7f, 0x4b, 0x7f, 0x4a, 0x08, 0xbf, + 0x55, 0x21, 0x20, 0x78, 0x00, 0x91, 0x7b, 0x49, 0x00, 0x28, 0x08, 0xbf, + 0x0b, 0x46, 0x28, 0x46, 0x78, 0x21, 0xea, 0xf7, 0xe3, 0xff, 0x75, 0x48, + 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, 0x73, 0x48, 0x01, 0x21, + 0x2a, 0x46, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x00, 0x27, 0x74, 0x48, + 0xcd, 0xe9, 0x04, 0x77, 0x01, 0x68, 0x94, 0xf8, 0xc0, 0x00, 0x00, 0xeb, + 0x80, 0x00, 0x40, 0x00, 0x88, 0x47, 0x00, 0x28, 0x06, 0x90, 0x6d, 0xd0, + 0xa0, 0x8b, 0x5b, 0x28, 0x07, 0xd3, 0x95, 0x28, 0x05, 0xd8, 0x00, 0x20, + 0x88, 0xf8, 0x01, 0x00, 0x39, 0x20, 0x88, 0xf8, 0x00, 0x00, 0x00, 0x20, + 0x20, 0x81, 0x5e, 0xb9, 0x67, 0x48, 0x06, 0x88, 0x46, 0xb9, 0x67, 0x48, + 0x00, 0x21, 0x02, 0x68, 0x00, 0x20, 0x90, 0x47, 0x06, 0x46, 0x08, 0xb9, + 0x64, 0x48, 0x06, 0x68, 0x64, 0x48, 0xb6, 0xb2, 0x31, 0x46, 0x02, 0x68, + 0x20, 0x46, 0x90, 0x47, 0x00, 0x28, 0x57, 0xd0, 0xcd, 0xe9, 0x02, 0x9a, + 0xdf, 0xf8, 0x80, 0xa1, 0xdf, 0xf8, 0x80, 0x91, 0x04, 0xaf, 0xda, 0xf8, + 0x00, 0x10, 0x20, 0x46, 0x88, 0x47, 0x4f, 0xfa, 0x80, 0xfb, 0xbb, 0xf1, + 0x00, 0x0f, 0x1c, 0xd4, 0x49, 0xd1, 0xd9, 0xf8, 0x00, 0x50, 0x20, 0x46, + 0x39, 0x46, 0x01, 0x22, 0x33, 0x46, 0xa8, 0x47, 0x57, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x30, 0xb1, 0xd9, 0xf8, 0x00, 0x50, 0x20, 0x46, + 0x39, 0x46, 0x01, 0x22, 0x33, 0x46, 0xa8, 0x47, 0x4e, 0x48, 0x31, 0x46, + 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x00, 0x28, 0xdb, 0xd1, 0x4f, 0xf0, + 0x00, 0x0b, 0xdd, 0xe9, 0x02, 0x9a, 0x38, 0xe0, 0xd4, 0xe9, 0x05, 0x31, + 0x40, 0xf2, 0xe2, 0x42, 0xb3, 0xfb, 0xf2, 0xf7, 0x07, 0xfb, 0x12, 0x37, + 0x37, 0xb9, 0xb1, 0xfb, 0xf2, 0xf7, 0x07, 0xfb, 0x12, 0x12, 0x00, 0x2a, + 0x3f, 0xf4, 0x74, 0xaf, 0x35, 0x48, 0x36, 0x4a, 0x00, 0x91, 0x78, 0x21, + 0xea, 0xf7, 0x62, 0xff, 0x34, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, + 0x04, 0xd4, 0x00, 0x27, 0x38, 0x46, 0x07, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x30, 0x48, 0x2d, 0x4a, 0x00, 0x21, 0x00, 0x27, 0x03, 0x68, 0x02, 0x20, + 0x98, 0x47, 0xf3, 0xe7, 0x4f, 0xf0, 0x00, 0x0b, 0x0d, 0xe0, 0xbd, 0xf8, + 0x10, 0x00, 0xdd, 0xf8, 0x0c, 0xa0, 0x30, 0xb9, 0xd9, 0xf8, 0x00, 0x70, + 0x04, 0xa9, 0x20, 0x46, 0x01, 0x22, 0x33, 0x46, 0xb8, 0x47, 0xdd, 0xf8, + 0x08, 0x90, 0xbd, 0xf8, 0x10, 0x00, 0x40, 0xb1, 0x2c, 0x48, 0x04, 0xa9, + 0x00, 0x22, 0x33, 0x46, 0x05, 0x68, 0x20, 0x46, 0xa8, 0x47, 0x01, 0x27, + 0x00, 0xe0, 0x00, 0x27, 0x06, 0x98, 0xed, 0xf7, 0x75, 0xfb, 0x20, 0x89, + 0x40, 0xf2, 0xe2, 0x41, 0x5f, 0xfa, 0x8b, 0xf6, 0x16, 0x4d, 0x26, 0x4b, + 0x26, 0x4a, 0x00, 0x2f, 0x01, 0xfb, 0x00, 0xf0, 0x4f, 0xf0, 0x78, 0x01, + 0xcd, 0xe9, 0x00, 0x06, 0x20, 0x48, 0x08, 0xbf, 0x03, 0x46, 0x28, 0x46, + 0xea, 0xf7, 0x1a, 0xff, 0x10, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, + 0x05, 0xd5, 0x0f, 0x48, 0x02, 0x21, 0x2a, 0x46, 0x03, 0x68, 0x02, 0x20, + 0x98, 0x47, 0x1b, 0x4a, 0x20, 0x89, 0x00, 0x21, 0x0c, 0x23, 0x50, 0x60, + 0x19, 0x48, 0x17, 0x60, 0x96, 0x60, 0x04, 0x68, 0x40, 0xf2, 0x36, 0x20, + 0xa0, 0x47, 0x88, 0xf8, 0x01, 0xa0, 0x88, 0xf8, 0x00, 0x90, 0xa1, 0xe7, + 0xe8, 0x65, 0x08, 0x00, 0xff, 0x6a, 0x01, 0x00, 0xb5, 0xa0, 0x03, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x70, 0x9b, 0x08, 0x00, 0xec, 0xa0, 0x03, 0x00, + 0xe8, 0xa0, 0x03, 0x00, 0xf0, 0xa0, 0x03, 0x00, 0xd4, 0x9b, 0x08, 0x00, + 0xc0, 0x58, 0x01, 0x00, 0x78, 0xc8, 0x08, 0x00, 0xd8, 0x0d, 0x01, 0x00, + 0x94, 0xc8, 0x08, 0x00, 0x98, 0xc8, 0x08, 0x00, 0x9c, 0xc8, 0x08, 0x00, + 0xa0, 0xc8, 0x08, 0x00, 0x1c, 0xa1, 0x03, 0x00, 0x17, 0xa1, 0x03, 0x00, + 0x21, 0xa1, 0x03, 0x00, 0x8c, 0x34, 0x01, 0x00, 0x78, 0x9b, 0x08, 0x00, + 0x1c, 0xb5, 0x0c, 0x46, 0x00, 0x21, 0xcd, 0xe9, 0x00, 0x11, 0x40, 0x6b, + 0xc0, 0xb1, 0x50, 0xf8, 0x04, 0x2f, 0x69, 0x46, 0xf8, 0xf7, 0x86, 0xf9, + 0x00, 0xf0, 0x05, 0x00, 0x05, 0x28, 0x0f, 0xd1, 0x9d, 0xf8, 0x07, 0x10, + 0x48, 0x1e, 0x01, 0x28, 0x0a, 0xd8, 0x9d, 0xf8, 0x05, 0x00, 0x02, 0x28, + 0x06, 0xd1, 0x9d, 0xf8, 0x04, 0x00, 0x06, 0x28, 0x02, 0xd1, 0x1c, 0xb1, + 0x07, 0x20, 0x1c, 0xbd, 0x0a, 0x20, 0x1c, 0xbd, 0x05, 0x20, 0x02, 0x29, + 0x08, 0xbf, 0x07, 0x20, 0x1c, 0xbd, 0x00, 0xbf, 0x70, 0xb5, 0x60, 0xb1, + 0x04, 0x46, 0x16, 0x48, 0x0e, 0x46, 0x01, 0x68, 0x4e, 0xb1, 0x94, 0xf8, + 0x3a, 0x01, 0x88, 0x47, 0x0a, 0x28, 0x10, 0xd1, 0x94, 0xf8, 0x3a, 0x01, + 0x08, 0xe0, 0x00, 0x25, 0x13, 0xe0, 0x94, 0xf8, 0x3b, 0x01, 0x88, 0x47, + 0x0a, 0x28, 0x10, 0xd1, 0x94, 0xf8, 0x3b, 0x01, 0x0c, 0x49, 0x08, 0x5c, + 0x0c, 0x49, 0x0d, 0x5c, 0x07, 0xe0, 0x05, 0x46, 0x20, 0x46, 0x31, 0x46, + 0xff, 0xf7, 0xb6, 0xff, 0x0a, 0x28, 0x18, 0xbf, 0x05, 0x46, 0x28, 0x46, + 0x70, 0xbd, 0x05, 0x46, 0x20, 0x46, 0x00, 0x21, 0xff, 0xf7, 0xac, 0xff, + 0x0a, 0x28, 0x08, 0xbf, 0x28, 0x46, 0x70, 0xbd, 0x50, 0xce, 0x08, 0x00, + 0xd7, 0x5b, 0x07, 0x10, 0xcd, 0x0d, 0x01, 0x00, 0xb0, 0xb5, 0x05, 0x46, + 0x28, 0x48, 0x0c, 0x46, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x48, 0xb1, + 0x28, 0x46, 0x21, 0x46, 0x00, 0xf0, 0xc4, 0xfb, 0x24, 0x49, 0x4a, 0x7a, + 0xd2, 0x07, 0x00, 0xd0, 0x10, 0xb1, 0xb0, 0xbd, 0x0d, 0x20, 0xb0, 0xbd, + 0x94, 0xf8, 0x4a, 0x21, 0x04, 0x20, 0x94, 0xf8, 0x40, 0x31, 0x04, 0x25, + 0x04, 0x2a, 0x38, 0xbf, 0x10, 0x46, 0x08, 0x44, 0x80, 0x7a, 0x98, 0x42, + 0x2f, 0xd2, 0x05, 0x2a, 0x1a, 0x4a, 0x4f, 0xf0, 0x03, 0x01, 0x84, 0xf8, + 0x40, 0x01, 0x38, 0xbf, 0x02, 0x21, 0x12, 0x68, 0x90, 0x47, 0x94, 0xf8, + 0x4a, 0x11, 0x84, 0xf8, 0x41, 0x01, 0x04, 0x29, 0x38, 0xbf, 0x0d, 0x46, + 0xd4, 0xf8, 0x00, 0x01, 0x94, 0xf8, 0x40, 0x21, 0x02, 0x29, 0x00, 0xeb, + 0xc5, 0x03, 0x83, 0xf8, 0xbc, 0x23, 0x14, 0xd3, 0x04, 0x29, 0x12, 0xd8, + 0x03, 0xf5, 0x6f, 0x71, 0x80, 0xf8, 0xd4, 0x23, 0x90, 0xf8, 0xd3, 0x33, + 0x90, 0xf8, 0xcb, 0x23, 0x09, 0x78, 0x43, 0xf0, 0x40, 0x03, 0x80, 0xf8, + 0xcc, 0x13, 0x42, 0xf0, 0x40, 0x01, 0x80, 0xf8, 0xd3, 0x33, 0x80, 0xf8, + 0xcb, 0x13, 0x00, 0x20, 0xb0, 0xbd, 0x00, 0xbf, 0x5c, 0xb5, 0x08, 0x00, + 0xcc, 0x2c, 0x06, 0x00, 0x34, 0x9c, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, + 0x38, 0xb3, 0xe6, 0x48, 0x94, 0xf8, 0x1d, 0x11, 0x00, 0x68, 0xc1, 0xeb, + 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, 0x90, 0xf8, 0xc0, 0x10, 0x01, 0x29, + 0x0b, 0xd8, 0x41, 0x78, 0x0f, 0x48, 0x02, 0x78, 0x8a, 0x42, 0x06, 0xd1, + 0x0e, 0x49, 0x00, 0x22, 0x0a, 0x60, 0xff, 0x21, 0x01, 0x70, 0x0d, 0x48, + 0x02, 0x70, 0xd4, 0xf8, 0x20, 0x02, 0x20, 0xb1, 0xed, 0xf7, 0x42, 0xfa, + 0x00, 0x20, 0xc4, 0xf8, 0x20, 0x02, 0xd4, 0xf8, 0x24, 0x02, 0x20, 0xb1, + 0xed, 0xf7, 0x3a, 0xfa, 0x00, 0x20, 0xc4, 0xf8, 0x24, 0x02, 0x20, 0x46, + 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x4c, 0xbb, 0x41, 0xd3, 0x05, 0x00, + 0xec, 0xe5, 0x05, 0x00, 0x74, 0xe5, 0x05, 0x00, 0xb0, 0xb5, 0xb0, 0xb1, + 0x05, 0x46, 0x90, 0xf8, 0x1c, 0x01, 0x90, 0xb1, 0x0c, 0x46, 0xd5, 0xf8, + 0x00, 0x11, 0x91, 0xf8, 0x8a, 0x20, 0xd2, 0x06, 0x0b, 0xd4, 0xc6, 0x4a, + 0x95, 0xf8, 0x1d, 0x31, 0xc3, 0xeb, 0x03, 0x13, 0x12, 0x68, 0x5b, 0x01, + 0xd2, 0x5c, 0x01, 0x2a, 0x03, 0xd1, 0x01, 0x28, 0x08, 0xd0, 0x00, 0x20, + 0xb0, 0xbd, 0x02, 0x28, 0x04, 0xd1, 0x91, 0xf8, 0x35, 0x11, 0x53, 0x20, + 0xed, 0xf7, 0xf2, 0xf9, 0x28, 0x46, 0x21, 0x46, 0xbd, 0xe8, 0xb0, 0x40, + 0x00, 0xf0, 0x24, 0xbb, 0x2d, 0xe9, 0xf0, 0x4f, 0x89, 0xb0, 0x81, 0x46, + 0x00, 0x89, 0x00, 0x28, 0x00, 0xf0, 0x3c, 0x81, 0xb4, 0x4f, 0x99, 0xf8, + 0x01, 0x10, 0x38, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, + 0x00, 0xf5, 0xea, 0x72, 0x90, 0xf8, 0xd5, 0x11, 0x12, 0xf8, 0x02, 0x3b, + 0x43, 0xea, 0x01, 0x21, 0x13, 0x78, 0x52, 0x78, 0x43, 0xea, 0x02, 0x22, + 0x41, 0xea, 0x02, 0x44, 0x00, 0xf5, 0xe8, 0x70, 0x84, 0x42, 0x00, 0xf0, + 0x23, 0x81, 0xa8, 0x4d, 0xa4, 0xf1, 0xf8, 0x0b, 0x01, 0x21, 0x58, 0x46, + 0x2a, 0x68, 0x90, 0x47, 0x2a, 0x68, 0x08, 0x90, 0x58, 0x46, 0x00, 0x21, + 0x90, 0x47, 0x94, 0xf8, 0x25, 0x10, 0x86, 0x46, 0x38, 0x68, 0xcd, 0xf8, + 0x1c, 0xe0, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, 0xd0, 0xf8, + 0xa0, 0x10, 0x49, 0x7f, 0x31, 0xb1, 0x80, 0x69, 0xb0, 0xb3, 0xe0, 0x8f, + 0xa0, 0xb3, 0xb4, 0xf8, 0x3c, 0x80, 0x06, 0xe0, 0x40, 0x69, 0x78, 0xb3, + 0xb4, 0xf8, 0x3c, 0x80, 0xb8, 0xf1, 0x00, 0x0f, 0x2a, 0xd0, 0x95, 0x48, + 0x08, 0x99, 0xd9, 0xf8, 0x14, 0x50, 0xb9, 0xf8, 0x08, 0x60, 0x02, 0x68, + 0x01, 0x20, 0x90, 0x47, 0x40, 0xf2, 0xe2, 0x41, 0x6b, 0x1e, 0x06, 0xfb, + 0x01, 0xf2, 0x99, 0xf8, 0x21, 0x60, 0x99, 0x18, 0xb1, 0xfb, 0xf5, 0xf1, + 0xce, 0xb1, 0x02, 0xfb, 0x08, 0x32, 0xb2, 0xfb, 0xf5, 0xf2, 0x02, 0xeb, + 0xc1, 0x01, 0x4f, 0xf0, 0xff, 0x32, 0x12, 0xfa, 0x81, 0xf2, 0x89, 0xb2, + 0x81, 0x42, 0x38, 0xbf, 0x08, 0x46, 0x11, 0x18, 0x91, 0xfb, 0xf0, 0xf6, + 0x52, 0xfa, 0x86, 0xf0, 0xf1, 0xb2, 0x90, 0xfb, 0xf1, 0xf5, 0x10, 0xe0, + 0x00, 0x26, 0x00, 0x25, 0x0f, 0xe0, 0xa2, 0x8f, 0x89, 0xb2, 0x82, 0x42, + 0x38, 0xbf, 0x10, 0x46, 0x01, 0x3a, 0x13, 0x18, 0x93, 0xfb, 0xf0, 0xf0, + 0x02, 0x44, 0x00, 0xfb, 0x01, 0xf6, 0x92, 0xfb, 0xf0, 0xf5, 0xdd, 0xf8, + 0x1c, 0xe0, 0x9b, 0xf8, 0x1d, 0x11, 0x38, 0x68, 0xc1, 0xeb, 0x01, 0x11, + 0x00, 0xeb, 0x41, 0x10, 0xd0, 0xf8, 0xa0, 0x10, 0x49, 0x7f, 0x31, 0xb1, + 0x40, 0x69, 0xb8, 0xb3, 0xa0, 0x8f, 0xa8, 0xb3, 0xb4, 0xf8, 0x3e, 0xa0, + 0x06, 0xe0, 0x80, 0x69, 0x80, 0xb3, 0xb4, 0xf8, 0x3e, 0xa0, 0xba, 0xf1, + 0x00, 0x0f, 0x2b, 0xd0, 0x69, 0x48, 0xa8, 0x46, 0x37, 0x46, 0xd9, 0xf8, + 0x18, 0x50, 0xb9, 0xf8, 0x08, 0x60, 0x71, 0x46, 0x02, 0x68, 0x00, 0x20, + 0x90, 0x47, 0x40, 0xf2, 0xe2, 0x41, 0x6b, 0x1e, 0x71, 0x43, 0x99, 0xf8, + 0x21, 0x60, 0x5a, 0x18, 0xb2, 0xfb, 0xf5, 0xf2, 0xce, 0xb1, 0x01, 0xfb, + 0x0a, 0x31, 0xb1, 0xfb, 0xf5, 0xf1, 0x01, 0xeb, 0xc2, 0x01, 0x4f, 0xf0, + 0xff, 0x32, 0x12, 0xfa, 0x81, 0xf2, 0x89, 0xb2, 0x81, 0x42, 0x38, 0xbf, + 0x08, 0x46, 0x11, 0x18, 0x91, 0xfb, 0xf0, 0xf0, 0x52, 0xfa, 0x80, 0xf1, + 0xc2, 0xb2, 0x91, 0xfb, 0xf2, 0xf1, 0x0f, 0xe0, 0x00, 0x20, 0x00, 0x21, + 0x10, 0xe0, 0xe1, 0x8f, 0x92, 0xb2, 0x81, 0x42, 0x38, 0xbf, 0x08, 0x46, + 0x01, 0x39, 0x0b, 0x18, 0x93, 0xfb, 0xf0, 0xf0, 0x01, 0x44, 0x91, 0xfb, + 0xf0, 0xf1, 0x50, 0x43, 0xdd, 0xf8, 0x1c, 0xe0, 0x3e, 0x46, 0x45, 0x46, + 0x99, 0xf8, 0x00, 0x20, 0x02, 0xf0, 0xfe, 0x03, 0x02, 0x2b, 0x06, 0xd1, + 0xc3, 0xb2, 0x07, 0x2b, 0x00, 0xf2, 0x80, 0x80, 0xf3, 0xb2, 0x07, 0x2b, + 0x7c, 0xd8, 0x01, 0x2a, 0x05, 0xd8, 0xc2, 0xb2, 0x0f, 0x2a, 0x77, 0xd8, + 0xf2, 0xb2, 0x0f, 0x2a, 0x74, 0xd8, 0x1f, 0xfa, 0x81, 0xfa, 0x08, 0x99, + 0xe7, 0x4a, 0xaf, 0xb2, 0x5f, 0xfa, 0x80, 0xf8, 0xf5, 0xb2, 0x01, 0x23, + 0xa8, 0x45, 0x8d, 0xe8, 0x82, 0x01, 0x4f, 0xf0, 0x01, 0x01, 0xd2, 0xf8, + 0x00, 0xc0, 0x2a, 0x46, 0xcd, 0xe9, 0x03, 0x1e, 0xcd, 0xe9, 0x05, 0xa1, + 0x38, 0xbf, 0x30, 0x46, 0xc6, 0xb2, 0x58, 0x46, 0x31, 0x46, 0xe0, 0x47, + 0x9b, 0xf8, 0x1e, 0x11, 0xb9, 0xf8, 0x08, 0x00, 0x31, 0x4a, 0xcd, 0xe9, + 0x00, 0x16, 0x40, 0xf2, 0xe2, 0x41, 0xcd, 0xe9, 0x02, 0x58, 0xcd, 0xe9, + 0x04, 0x7a, 0x00, 0xfb, 0x01, 0xf3, 0x2b, 0x48, 0x78, 0x21, 0xea, 0xf7, + 0x99, 0xfc, 0x64, 0x48, 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, + 0x28, 0x48, 0x26, 0x4a, 0x01, 0x21, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, + 0x14, 0xf8, 0x04, 0x0f, 0x9a, 0x4f, 0x61, 0x78, 0xa2, 0x78, 0xe3, 0x78, + 0x40, 0xea, 0x01, 0x20, 0x42, 0xea, 0x03, 0x21, 0x40, 0xea, 0x01, 0x44, + 0x99, 0xf8, 0x01, 0x10, 0x38, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, + 0x41, 0x10, 0xd9, 0xe6, 0x00, 0x25, 0x26, 0xe0, 0x99, 0xf8, 0x00, 0x00, + 0x00, 0xf0, 0xfe, 0x00, 0x02, 0x28, 0x05, 0xd1, 0x00, 0x20, 0x89, 0xf8, + 0xe2, 0x00, 0x01, 0x20, 0xa9, 0xf8, 0xe0, 0x00, 0x15, 0x48, 0x99, 0xf8, + 0x03, 0x10, 0x02, 0x68, 0x48, 0x46, 0x90, 0x47, 0x01, 0x46, 0x13, 0x48, + 0xff, 0x22, 0x03, 0x68, 0x48, 0x46, 0x98, 0x47, 0x05, 0x46, 0x11, 0x4a, + 0xb9, 0xf8, 0x08, 0x00, 0x00, 0x21, 0x08, 0x23, 0xc2, 0xe9, 0x00, 0x05, + 0x0e, 0x48, 0x04, 0x68, 0x4f, 0xf4, 0x0c, 0x70, 0xa0, 0x47, 0x00, 0xe0, + 0x84, 0x25, 0x28, 0x46, 0x09, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0xbf, + 0xe0, 0x35, 0x01, 0x00, 0x68, 0xc8, 0x08, 0x00, 0x6c, 0xc8, 0x08, 0x00, + 0xff, 0x6a, 0x01, 0x00, 0x5e, 0xa1, 0x03, 0x00, 0x70, 0x9b, 0x08, 0x00, + 0x04, 0xb6, 0x08, 0x00, 0x0c, 0xb6, 0x08, 0x00, 0x8c, 0x34, 0x01, 0x00, + 0x78, 0x9b, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0x04, 0x46, 0x90, 0xf8, + 0x20, 0x01, 0x94, 0xf8, 0x46, 0x11, 0x94, 0xf8, 0x50, 0x21, 0x91, 0x42, + 0x38, 0xbf, 0x11, 0x46, 0x40, 0x1a, 0x84, 0xf8, 0xb1, 0x01, 0x00, 0x06, + 0x41, 0xd0, 0x68, 0x4f, 0x94, 0xf8, 0x1d, 0x11, 0xdf, 0xf8, 0xa4, 0x80, + 0x38, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x98, 0xf8, 0xfa, 0x62, 0x00, 0xeb, + 0x41, 0x10, 0x05, 0x89, 0xe7, 0xf7, 0xea, 0xf9, 0x94, 0xf8, 0x1d, 0x11, + 0xc4, 0xf8, 0xa4, 0x01, 0x38, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, + 0x41, 0x10, 0x27, 0x49, 0x40, 0x78, 0x49, 0x68, 0xc0, 0xeb, 0xc0, 0x00, + 0x01, 0xeb, 0x80, 0x00, 0xd0, 0xe9, 0x04, 0x10, 0x81, 0x42, 0x38, 0xbf, + 0x01, 0x46, 0x1f, 0x29, 0x21, 0xd3, 0x00, 0x20, 0x0a, 0x21, 0x02, 0x22, + 0xc4, 0xf8, 0x40, 0x02, 0x30, 0x01, 0xb0, 0xfb, 0xf1, 0xf0, 0x05, 0xf0, + 0x7f, 0x01, 0x89, 0x00, 0x81, 0x42, 0x88, 0xbf, 0x01, 0x22, 0x94, 0xf8, + 0x20, 0x01, 0x94, 0xf8, 0x46, 0x11, 0x94, 0xf8, 0x50, 0x31, 0x84, 0xf8, + 0x38, 0x22, 0x50, 0x43, 0x99, 0x42, 0x38, 0xbf, 0x19, 0x46, 0x40, 0x1a, + 0x0f, 0xe0, 0x4f, 0xf0, 0xff, 0x30, 0xc4, 0xf8, 0xa4, 0x01, 0xbd, 0xe8, + 0xf0, 0x81, 0x69, 0x00, 0x98, 0xf8, 0xfa, 0x02, 0xc9, 0xb2, 0xb0, 0xfb, + 0xf1, 0xf0, 0x94, 0xf8, 0xb1, 0x11, 0x48, 0x43, 0x02, 0x30, 0x84, 0xf8, + 0xb2, 0x01, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, + 0x80, 0xb5, 0x00, 0xf0, 0x37, 0xf9, 0x40, 0xb1, 0x04, 0x49, 0x42, 0x78, + 0x49, 0x68, 0xc2, 0xeb, 0xc2, 0x02, 0x01, 0xeb, 0x82, 0x01, 0x00, 0x22, + 0x0a, 0x76, 0x80, 0xbd, 0xec, 0xe5, 0x05, 0x00, 0xb0, 0xb5, 0x60, 0xb3, + 0xd0, 0xf8, 0x00, 0x11, 0x04, 0x46, 0xd1, 0xf8, 0xd4, 0x00, 0x40, 0x7f, + 0x48, 0xb9, 0x91, 0xf8, 0x34, 0x03, 0x40, 0x07, 0x05, 0xd4, 0x2e, 0x48, + 0x00, 0x22, 0x01, 0x23, 0x05, 0x68, 0x16, 0x20, 0xa8, 0x47, 0x2a, 0x48, + 0x94, 0xf8, 0x1d, 0x11, 0x00, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, + 0x41, 0x10, 0xd0, 0xf8, 0xec, 0x00, 0x20, 0xb1, 0xd0, 0xf8, 0x00, 0x01, + 0xd0, 0xf8, 0x00, 0x04, 0x50, 0xb9, 0xd4, 0xf8, 0x00, 0x01, 0x90, 0xf8, + 0x38, 0x00, 0x03, 0x28, 0x04, 0xd1, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, + 0x00, 0xf0, 0x02, 0xb9, 0xb0, 0xbd, 0x00, 0x20, 0x40, 0xf6, 0x1b, 0x31, + 0xbd, 0xe8, 0xb0, 0x40, 0xec, 0xf7, 0xb0, 0xbf, 0xb0, 0xb5, 0x88, 0xb1, + 0x04, 0x46, 0x17, 0x48, 0x94, 0xf8, 0x1d, 0x11, 0x02, 0x68, 0xc1, 0xeb, + 0x01, 0x11, 0x02, 0xeb, 0x41, 0x12, 0x52, 0xf8, 0xf0, 0x3f, 0x4b, 0xb1, + 0xd3, 0xf8, 0x00, 0x31, 0xd3, 0xf8, 0xfc, 0x33, 0x23, 0xb1, 0xb0, 0xbd, + 0x00, 0x20, 0x40, 0xf6, 0x41, 0x31, 0x11, 0xe0, 0x14, 0x60, 0x00, 0x22, + 0x01, 0x23, 0x00, 0x68, 0x00, 0xeb, 0x41, 0x10, 0xd4, 0xf8, 0x00, 0x11, + 0xc1, 0xf8, 0xfc, 0x03, 0x08, 0x48, 0x05, 0x68, 0x3a, 0x20, 0xa8, 0x47, + 0x30, 0xb1, 0x00, 0x20, 0x40, 0xf6, 0x55, 0x31, 0xbd, 0xe8, 0xb0, 0x40, + 0xec, 0xf7, 0x82, 0xbf, 0x03, 0x20, 0x84, 0xf8, 0x1c, 0x01, 0xb0, 0xbd, + 0xe0, 0x35, 0x01, 0x00, 0x80, 0x9b, 0x08, 0x00, 0x03, 0x49, 0x09, 0x78, + 0x11, 0xb1, 0x03, 0x49, 0x09, 0x68, 0x08, 0x47, 0x00, 0xf0, 0xc2, 0xb8, + 0xc0, 0xf0, 0x05, 0x00, 0x5c, 0xb5, 0x08, 0x00, 0x1e, 0x48, 0x1f, 0x49, + 0x01, 0x60, 0x1f, 0x48, 0x1f, 0x49, 0x01, 0x60, 0x1f, 0x48, 0x20, 0x49, + 0x01, 0x60, 0x20, 0x48, 0x20, 0x49, 0x01, 0x60, 0x20, 0x48, 0x21, 0x49, + 0x01, 0x60, 0x21, 0x48, 0x21, 0x49, 0x01, 0x60, 0x21, 0x48, 0x22, 0x49, + 0x01, 0x60, 0x22, 0x48, 0x22, 0x49, 0x01, 0x60, 0x22, 0x48, 0x23, 0x49, + 0x01, 0x60, 0x23, 0x48, 0x23, 0x49, 0x01, 0x60, 0x23, 0x48, 0x24, 0x49, + 0x01, 0x60, 0x24, 0x48, 0x24, 0x49, 0x01, 0x60, 0x24, 0x48, 0x25, 0x49, + 0x01, 0x60, 0x25, 0x48, 0x25, 0x49, 0x01, 0x60, 0x25, 0x48, 0x26, 0x49, + 0x01, 0x60, 0x26, 0x48, 0x26, 0x49, 0x01, 0x60, 0x26, 0x48, 0x27, 0x49, + 0x01, 0x60, 0x27, 0x48, 0x27, 0x49, 0x01, 0x60, 0x27, 0x48, 0x28, 0x49, + 0x01, 0x60, 0x28, 0x48, 0x28, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x70, 0xc7, 0x08, 0x00, 0xb1, 0x83, 0x03, 0x00, 0xbc, 0x8e, 0x08, 0x00, + 0x1d, 0x8d, 0x03, 0x00, 0x94, 0xc8, 0x08, 0x00, 0xad, 0x88, 0x03, 0x00, + 0x88, 0xc7, 0x08, 0x00, 0x31, 0x89, 0x03, 0x00, 0x80, 0xc7, 0x08, 0x00, + 0x05, 0x8b, 0x03, 0x00, 0x08, 0xb6, 0x08, 0x00, 0x25, 0x90, 0x03, 0x00, + 0x5c, 0xc8, 0x08, 0x00, 0x95, 0x90, 0x03, 0x00, 0x74, 0xc7, 0x08, 0x00, + 0x15, 0x94, 0x03, 0x00, 0x7c, 0xc7, 0x08, 0x00, 0x55, 0x94, 0x03, 0x00, + 0xc4, 0x8e, 0x08, 0x00, 0x85, 0x97, 0x03, 0x00, 0xd0, 0xc4, 0x08, 0x00, + 0x8d, 0x8e, 0x03, 0x00, 0x68, 0xc8, 0x08, 0x00, 0x19, 0x97, 0x03, 0x00, + 0xb0, 0x8e, 0x08, 0x00, 0x39, 0x98, 0x03, 0x00, 0x8c, 0xc7, 0x08, 0x00, + 0xa5, 0x98, 0x03, 0x00, 0x98, 0xc8, 0x08, 0x00, 0xf5, 0x98, 0x03, 0x00, + 0x8c, 0xc8, 0x08, 0x00, 0x01, 0x9c, 0x03, 0x00, 0xcc, 0x8e, 0x08, 0x00, + 0xd5, 0x9c, 0x03, 0x00, 0x84, 0xc8, 0x08, 0x00, 0xf5, 0x9c, 0x03, 0x00, + 0x88, 0xc8, 0x08, 0x00, 0x61, 0x9d, 0x03, 0x00, 0x58, 0xc8, 0x08, 0x00, + 0xcd, 0x9d, 0x03, 0x00, 0x42, 0xf2, 0x5d, 0x3c, 0xc1, 0xf2, 0x08, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf2, 0xa5, 0x4c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf6, 0x61, 0x4c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf6, 0x79, 0x6c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf2, 0x15, 0x3c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf6, 0xb5, 0x7c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf6, 0x19, 0x6c, 0xc1, 0xf2, 0x08, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf6, 0xd9, 0x1c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf2, 0x81, 0x2c, 0xc1, 0xf2, 0x08, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x49, 0x53, 0x4f, 0x28, 0x4d, 0x29, 0x20, 0x31, + 0x73, 0x74, 0x20, 0x72, 0x65, 0x66, 0x3a, 0x20, 0x6d, 0x69, 0x6e, 0x3a, + 0x25, 0x64, 0x20, 0x6d, 0x61, 0x78, 0x3a, 0x25, 0x64, 0x00, 0x49, 0x53, + 0x4f, 0x28, 0x4d, 0x29, 0x20, 0x31, 0x73, 0x74, 0x20, 0x72, 0x65, 0x66, + 0x20, 0x28, 0x6c, 0x61, 0x73, 0x74, 0x29, 0x3a, 0x20, 0x6d, 0x69, 0x6e, + 0x3a, 0x25, 0x64, 0x20, 0x6d, 0x61, 0x78, 0x3a, 0x25, 0x64, 0x00, 0x49, + 0x53, 0x4f, 0x28, 0x4d, 0x29, 0x20, 0x43, 0x49, 0x44, 0x3a, 0x25, 0x64, + 0x2c, 0x20, 0x65, 0x43, 0x6c, 0x6b, 0x3a, 0x30, 0x78, 0x25, 0x78, 0x2c, + 0x20, 0x73, 0x43, 0x6c, 0x6b, 0x3a, 0x30, 0x78, 0x25, 0x78, 0x00, 0x50, + 0x43, 0x6f, 0x6e, 0x76, 0x3a, 0x20, 0x69, 0x73, 0x42, 0x65, 0x74, 0x74, + 0x65, 0x72, 0x53, 0x65, 0x74, 0x20, 0x28, 0x46, 0x41, 0x4c, 0x53, 0x45, + 0x29, 0x20, 0x49, 0x53, 0x4f, 0x5f, 0x69, 0x6e, 0x74, 0x3d, 0x25, 0x64, + 0x2c, 0x20, 0x4f, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x3d, 0x25, 0x64, + 0x2c, 0x20, 0x6e, 0x65, 0x77, 0x3d, 0x25, 0x64, 0x2c, 0x20, 0x6f, 0x6c, + 0x64, 0x3d, 0x25, 0x64, 0x2c, 0x00, 0x49, 0x53, 0x4f, 0x3a, 0x20, 0x53, + 0x74, 0x28, 0x25, 0x64, 0x29, 0x20, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, + 0x20, 0x6e, 0x75, 0x6d, 0x3a, 0x25, 0x64, 0x20, 0x53, 0x49, 0x44, 0x3a, + 0x25, 0x64, 0x20, 0x43, 0x49, 0x44, 0x3a, 0x25, 0x64, 0x00, 0x49, 0x53, + 0x4f, 0x3a, 0x20, 0x53, 0x20, 0x63, 0x68, 0x6b, 0x20, 0x52, 0x65, 0x6d, + 0x20, 0x6d, 0x69, 0x6e, 0x2f, 0x6d, 0x61, 0x78, 0x3a, 0x25, 0x64, 0x2f, + 0x25, 0x64, 0x00, 0x49, 0x53, 0x4f, 0x3a, 0x20, 0x53, 0x20, 0x73, 0x6b, + 0x69, 0x70, 0x20, 0x7a, 0x65, 0x72, 0x6f, 0x20, 0x52, 0x4f, 0x66, 0x66, + 0x00, 0x49, 0x53, 0x4f, 0x3a, 0x20, 0x53, 0x20, 0x63, 0x68, 0x6b, 0x20, + 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x44, 0x6f, 0x66, 0x66, 0x3a, 0x20, + 0x25, 0x64, 0x2f, 0x25, 0x64, 0x2c, 0x20, 0x72, 0x65, 0x66, 0x4f, 0x66, + 0x66, 0x3a, 0x25, 0x64, 0x2f, 0x25, 0x64, 0x00, 0x49, 0x53, 0x4f, 0x28, + 0x53, 0x29, 0x3a, 0x20, 0x4e, 0x6f, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x21, 0x00, 0x43, 0x6f, 0x6e, + 0x76, 0x20, 0x65, 0x72, 0x72, 0x2c, 0x20, 0x53, 0x44, 0x55, 0x20, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x20, 0x76, 0x69, 0x6f, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x25, 0x64, 0x2f, 0x25, 0x64, 0x20, + 0x69, 0x6e, 0x20, 0x55, 0x4e, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x44, 0x00, + 0x42, 0x49, 0x47, 0x00, 0x43, 0x49, 0x47, 0x00, 0x50, 0x43, 0x6f, 0x6e, + 0x76, 0x3a, 0x20, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x3a, 0x20, 0x25, 0x73, 0x2c, 0x20, 0x25, 0x63, 0x00, 0x50, + 0x41, 0x53, 0x53, 0x00, 0x46, 0x41, 0x49, 0x4c, 0x00, 0x50, 0x43, 0x6f, + 0x6e, 0x76, 0x3a, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x20, 0x63, + 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x6f, + 0x6e, 0x65, 0x20, 0x5b, 0x25, 0x73, 0x5d, 0x2c, 0x20, 0x49, 0x53, 0x4f, + 0x5f, 0x69, 0x6e, 0x74, 0x20, 0x25, 0x64, 0x3a, 0x2c, 0x20, 0x76, 0x69, + 0x6f, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x25, 0x78, 0x00, 0x50, 0x43, + 0x6f, 0x6e, 0x76, 0x3a, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x42, 0x61, + 0x73, 0x69, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x20, 0x49, 0x53, 0x4f, + 0x5f, 0x69, 0x6e, 0x74, 0x3d, 0x25, 0x64, 0x2c, 0x20, 0x6f, 0x6e, 0x20, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x28, 0x25, 0x64, 0x29, 0x3a, 0x20, + 0x4e, 0x53, 0x45, 0x3d, 0x25, 0x64, 0x2c, 0x20, 0x42, 0x4e, 0x28, 0x4d, + 0x53, 0x29, 0x3d, 0x25, 0x64, 0x2c, 0x20, 0x42, 0x4e, 0x28, 0x53, 0x4d, + 0x29, 0x3d, 0x25, 0x64, 0x2c, 0x20, 0x50, 0x4c, 0x28, 0x4d, 0x53, 0x29, + 0x3d, 0x25, 0x64, 0x2c, 0x20, 0x50, 0x4c, 0x28, 0x53, 0x4d, 0x29, 0x3d, + 0x25, 0x64, 0x00, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, 0x03, 0x26, 0x05, 0x29, + 0x4f, 0xf0, 0x04, 0x05, 0x00, 0x93, 0x88, 0x46, 0x17, 0x46, 0x81, 0x46, + 0x4f, 0xf0, 0x04, 0x04, 0x38, 0xbf, 0x02, 0x26, 0x04, 0x29, 0x38, 0xbf, + 0x0d, 0x46, 0x43, 0x49, 0x00, 0xeb, 0xc5, 0x0a, 0x9a, 0xf8, 0xbc, 0x03, + 0x0a, 0x68, 0x31, 0x46, 0x90, 0x47, 0x90, 0xfb, 0xf4, 0xfb, 0x97, 0xb1, + 0x97, 0xf9, 0x00, 0x00, 0x40, 0xfa, 0x8b, 0xf1, 0x01, 0x28, 0x04, 0xdb, + 0x7f, 0x29, 0xc8, 0xbf, 0xcb, 0xf1, 0x7f, 0x00, 0x06, 0xe0, 0x6f, 0xf0, + 0x7f, 0x02, 0x11, 0xf1, 0x80, 0x0f, 0xb8, 0xbf, 0xa2, 0xeb, 0x0b, 0x00, + 0x38, 0x70, 0x35, 0x48, 0x35, 0x4c, 0x41, 0x7a, 0xc9, 0x07, 0x1a, 0xbf, + 0x28, 0x44, 0x85, 0x7a, 0xff, 0x25, 0x99, 0xf8, 0x35, 0x01, 0x68, 0x21, + 0x10, 0xfb, 0x01, 0x40, 0x00, 0x79, 0x01, 0x28, 0x04, 0xd1, 0x2f, 0x48, + 0x40, 0x7b, 0x85, 0x42, 0x01, 0xd2, 0x03, 0xe0, 0x28, 0x46, 0xff, 0x28, + 0x05, 0x46, 0x4c, 0xd0, 0xcf, 0xb1, 0x97, 0xf9, 0x00, 0x00, 0x01, 0x28, + 0x15, 0xdb, 0x29, 0x48, 0x31, 0x46, 0x02, 0x68, 0x28, 0x46, 0x90, 0x47, + 0x39, 0x78, 0x7f, 0x29, 0x04, 0xd0, 0x59, 0x44, 0x4a, 0xb2, 0x82, 0x42, + 0xb8, 0xbf, 0x08, 0x46, 0x4f, 0xfa, 0x8b, 0xf1, 0x42, 0xb2, 0x00, 0x23, + 0x8a, 0x42, 0xc8, 0xbf, 0xa0, 0xeb, 0x0b, 0x03, 0x3b, 0x70, 0x00, 0x99, + 0x41, 0xb1, 0x0a, 0xf5, 0x6f, 0x70, 0x00, 0x78, 0xa8, 0x42, 0x03, 0xd3, + 0x08, 0x78, 0x40, 0xf0, 0x02, 0x00, 0x08, 0x70, 0x99, 0xf8, 0x35, 0x01, + 0x68, 0x21, 0x10, 0xfb, 0x01, 0x40, 0x00, 0x79, 0x01, 0x28, 0x1e, 0xd1, + 0x0a, 0x98, 0xe0, 0xb1, 0x90, 0xf9, 0x00, 0x00, 0xc8, 0xb1, 0xb8, 0xf1, + 0x04, 0x0f, 0x28, 0xbf, 0x4f, 0xf0, 0x04, 0x08, 0x25, 0x23, 0x00, 0x21, + 0x42, 0x46, 0x25, 0x46, 0x00, 0x24, 0x00, 0x28, 0x48, 0x46, 0xc8, 0xbf, + 0x23, 0x23, 0x01, 0xf0, 0x05, 0xfc, 0x99, 0xf8, 0x35, 0x01, 0x68, 0x21, + 0x10, 0xfb, 0x01, 0x50, 0x00, 0xeb, 0xc8, 0x00, 0x44, 0x81, 0x04, 0x81, + 0xc4, 0x80, 0xbd, 0xe8, 0xf8, 0x8f, 0x00, 0xbf, 0x38, 0x9c, 0x08, 0x00, + 0xcc, 0x2c, 0x06, 0x00, 0xb0, 0xe6, 0x05, 0x00, 0x30, 0x32, 0x06, 0x00, + 0x34, 0x9c, 0x08, 0x00, 0x00, 0x2a, 0x08, 0xbf, 0x41, 0xf0, 0x80, 0x01, + 0x00, 0xf0, 0xd8, 0xbb, 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0xda, 0xfb, + 0xe6, 0xf7, 0x7a, 0xfe, 0xb4, 0xf8, 0xdc, 0x12, 0x00, 0xeb, 0x81, 0x00, + 0x20, 0xf0, 0x70, 0x40, 0xc4, 0xf8, 0x54, 0x04, 0x10, 0xbd, 0x00, 0xbf, + 0x2d, 0xe9, 0xf0, 0x4f, 0x8d, 0xb0, 0x04, 0x46, 0x00, 0x20, 0x8d, 0xf8, + 0x32, 0x00, 0x8d, 0xf8, 0x31, 0x00, 0xd4, 0xf8, 0x1c, 0x04, 0x20, 0xb1, + 0x00, 0x7e, 0x05, 0x28, 0x01, 0xd1, 0x48, 0x79, 0xd8, 0xb1, 0x48, 0x79, + 0xdf, 0xf8, 0xc0, 0x25, 0x15, 0x5c, 0x03, 0x2d, 0x03, 0xd9, 0xdf, 0xf8, + 0xf0, 0x05, 0x20, 0x21, 0x5a, 0xe0, 0xa8, 0x1e, 0x02, 0x28, 0x05, 0xd2, + 0xdf, 0xf8, 0xac, 0x05, 0x40, 0x78, 0x00, 0x07, 0xf3, 0xd5, 0x0b, 0xe0, + 0x01, 0x2d, 0x08, 0xd1, 0xdf, 0xf8, 0x9c, 0x05, 0x40, 0x78, 0xc0, 0x07, + 0xeb, 0xd0, 0x01, 0x25, 0x02, 0xe0, 0x05, 0x25, 0x00, 0xe0, 0x00, 0x25, + 0x2f, 0x46, 0x04, 0x2d, 0x0d, 0xf1, 0x33, 0x02, 0x4f, 0xf0, 0x00, 0x03, + 0x28, 0xbf, 0x04, 0x27, 0x88, 0x79, 0xc9, 0x79, 0x04, 0xeb, 0xc7, 0x0a, + 0x05, 0x2d, 0x8d, 0xf8, 0x33, 0x00, 0x4f, 0xf0, 0x06, 0x00, 0x8a, 0xf8, + 0xbd, 0x13, 0x4f, 0xf0, 0x00, 0x01, 0x38, 0xbf, 0x04, 0x20, 0x04, 0xeb, + 0x00, 0x09, 0x9a, 0xf8, 0xbc, 0xb3, 0x00, 0x20, 0x39, 0xf8, 0x78, 0x6f, + 0x00, 0x91, 0x29, 0x46, 0x0b, 0x90, 0x20, 0x46, 0xff, 0xf7, 0xf4, 0xfe, + 0x4f, 0xf0, 0x03, 0x08, 0x05, 0x2d, 0x38, 0xbf, 0x4f, 0xf0, 0x02, 0x08, + 0x94, 0xf8, 0xe8, 0x03, 0x01, 0x28, 0x0f, 0xd1, 0x94, 0xf8, 0xe7, 0x03, + 0x04, 0xf2, 0xe3, 0x31, 0x0b, 0x91, 0x03, 0x28, 0x05, 0xd0, 0x02, 0x28, + 0x06, 0xd1, 0x00, 0x20, 0x84, 0xf8, 0xe8, 0x03, 0x0f, 0xe0, 0x00, 0x20, + 0x84, 0xf8, 0xe8, 0x03, 0x0a, 0xf2, 0xbd, 0x30, 0x00, 0x78, 0x7e, 0x28, + 0x0a, 0xd1, 0xdf, 0xf8, 0x38, 0x05, 0x1e, 0x21, 0x05, 0x68, 0x20, 0x46, + 0x23, 0x22, 0x00, 0x23, 0xa8, 0x47, 0x0d, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x30, 0xb2, 0x04, 0x21, 0x0a, 0xf5, 0x6f, 0x72, 0xdf, 0xf8, 0xe8, 0x34, + 0x90, 0xfb, 0xf1, 0xf0, 0x9d, 0xf9, 0x33, 0x10, 0xcd, 0xe9, 0x08, 0x20, + 0x18, 0x78, 0x12, 0x78, 0x82, 0x42, 0x02, 0xd1, 0xb1, 0xf1, 0xff, 0x3f, + 0x73, 0xdd, 0xdf, 0xf8, 0xd0, 0x64, 0xcd, 0xe9, 0x05, 0xb7, 0x30, 0x78, + 0x82, 0x42, 0x08, 0xd1, 0x01, 0x29, 0x2f, 0xdb, 0x00, 0x20, 0x7f, 0x26, + 0x8d, 0xf8, 0x33, 0x00, 0x01, 0x20, 0x0a, 0x90, 0xdf, 0xe1, 0x7f, 0x29, + 0x26, 0xd1, 0xdf, 0xf8, 0xb0, 0x74, 0x02, 0x21, 0x3a, 0x68, 0x90, 0x47, + 0x3a, 0x68, 0x08, 0x9f, 0x83, 0x46, 0x41, 0x46, 0x38, 0x78, 0x90, 0x47, + 0x01, 0x46, 0x30, 0x78, 0xab, 0xeb, 0x01, 0x01, 0x8d, 0xf8, 0x32, 0x10, + 0x94, 0xf8, 0xf2, 0x12, 0x38, 0x70, 0xa9, 0x42, 0x71, 0xd1, 0xdf, 0xf8, + 0x88, 0x14, 0x84, 0xf8, 0x74, 0x00, 0x0a, 0x68, 0x41, 0x46, 0x90, 0x47, + 0x04, 0x21, 0xa9, 0xf8, 0x00, 0x00, 0x00, 0x22, 0x90, 0xfb, 0xf1, 0xf0, + 0x94, 0xf8, 0x3a, 0x10, 0x09, 0x90, 0x1b, 0xe1, 0x94, 0xf8, 0xf2, 0x02, + 0x00, 0x29, 0x40, 0xd0, 0xa8, 0x42, 0x4d, 0xd1, 0xb9, 0xf9, 0x00, 0x00, + 0x04, 0x22, 0x00, 0x23, 0x4f, 0xf0, 0x00, 0x0b, 0x90, 0xfb, 0xf2, 0xf6, + 0x00, 0x22, 0x88, 0x19, 0xdf, 0xf8, 0x54, 0x14, 0x40, 0xb2, 0x0f, 0x68, + 0x41, 0x46, 0xb8, 0x47, 0x07, 0x46, 0xdf, 0xf8, 0x34, 0x04, 0x41, 0x46, + 0x02, 0x68, 0x38, 0x46, 0x90, 0x47, 0x08, 0x99, 0x80, 0x1b, 0x8d, 0xf8, + 0x32, 0x00, 0x08, 0x78, 0x87, 0x42, 0xdf, 0xf8, 0x20, 0x04, 0x14, 0xbf, + 0x0f, 0x70, 0x8d, 0xf8, 0x32, 0xb0, 0x41, 0x46, 0x84, 0xf8, 0x74, 0x70, + 0x02, 0x68, 0x38, 0x46, 0x90, 0x47, 0x04, 0x21, 0xa9, 0xf8, 0x00, 0x00, + 0x06, 0x9f, 0x90, 0xfb, 0xf1, 0xf0, 0x00, 0x21, 0x0a, 0x91, 0x09, 0x90, + 0x94, 0xf8, 0x3a, 0x00, 0x4b, 0xe0, 0x00, 0x20, 0x0b, 0x99, 0xdd, 0xf8, + 0x24, 0x80, 0x7f, 0x26, 0x8d, 0xf8, 0x33, 0x00, 0x01, 0x20, 0x0a, 0x90, + 0x75, 0xe1, 0xa8, 0x42, 0x28, 0xd1, 0xb9, 0xf9, 0x00, 0x00, 0x04, 0x21, + 0x94, 0xf8, 0x3a, 0x60, 0x4f, 0xf0, 0x00, 0x0b, 0x8d, 0xf8, 0x32, 0xb0, + 0x90, 0xfb, 0xf1, 0xf0, 0x09, 0x90, 0x3b, 0xe1, 0x02, 0x28, 0x2d, 0xd3, + 0x04, 0x28, 0x26, 0xd8, 0x01, 0x20, 0x02, 0x2d, 0x0a, 0x90, 0x4f, 0xf0, + 0x7f, 0x00, 0x28, 0xd3, 0x04, 0x2d, 0xa5, 0xd9, 0x25, 0xe0, 0x02, 0x29, + 0xc0, 0xf0, 0xb6, 0x80, 0x04, 0x29, 0x00, 0xf2, 0xae, 0x80, 0x01, 0x22, + 0x7f, 0x21, 0x02, 0x2d, 0xc0, 0xf0, 0xb0, 0x80, 0x04, 0x2d, 0x7f, 0xf6, + 0x80, 0xaf, 0xab, 0xe0, 0x02, 0x28, 0xc0, 0xf0, 0x1a, 0x81, 0x04, 0x28, + 0x00, 0xf2, 0x12, 0x81, 0x4f, 0xf0, 0x01, 0x0b, 0x7f, 0x26, 0x02, 0x2d, + 0xc0, 0xf0, 0x14, 0x81, 0x04, 0x2d, 0xc8, 0xd9, 0x10, 0xe1, 0x09, 0x28, + 0x02, 0xd8, 0x05, 0x2d, 0xbf, 0xf4, 0x82, 0xaf, 0x01, 0x20, 0x0a, 0x90, + 0x7f, 0x20, 0xd7, 0x4a, 0x07, 0x90, 0x10, 0x78, 0x00, 0x28, 0x7b, 0xd0, + 0x00, 0x20, 0x04, 0x2d, 0x4f, 0xf0, 0x00, 0x01, 0xd3, 0x4e, 0x4f, 0xf0, + 0x00, 0x0b, 0x88, 0xbf, 0x01, 0x20, 0x02, 0x2d, 0x38, 0xbf, 0x01, 0x21, + 0x08, 0x43, 0x04, 0x90, 0x68, 0x1f, 0xc0, 0xb2, 0x03, 0x90, 0x56, 0xf8, + 0x2b, 0x90, 0xb9, 0xf1, 0x00, 0x0f, 0x33, 0xd0, 0xcb, 0x48, 0x99, 0xf8, + 0x1d, 0x11, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0x68, 0x49, 0x01, 0x40, 0x5c, + 0x01, 0x28, 0x2f, 0xd8, 0xd9, 0xf8, 0x00, 0x01, 0xa0, 0x42, 0x2b, 0xd1, + 0x99, 0xf8, 0x4a, 0x01, 0xa8, 0x42, 0x2d, 0xd1, 0x0a, 0x98, 0x98, 0xb3, + 0x99, 0xf8, 0x41, 0x01, 0x9d, 0xf8, 0x33, 0x10, 0x00, 0x22, 0x00, 0x23, + 0x08, 0x44, 0xbf, 0x49, 0x40, 0xb2, 0x0f, 0x68, 0x41, 0x46, 0xb8, 0x47, + 0x07, 0x46, 0xb7, 0x48, 0x41, 0x46, 0x02, 0x68, 0x38, 0x46, 0x90, 0x47, + 0x99, 0xf8, 0x41, 0x11, 0x40, 0x1a, 0x08, 0x99, 0x8d, 0xf8, 0x32, 0x00, + 0x08, 0x78, 0x87, 0x42, 0x12, 0xbf, 0x0f, 0x70, 0x00, 0x20, 0x8d, 0xf8, + 0x32, 0x00, 0x15, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x81, 0x11, 0xec, 0xf7, + 0x21, 0xfb, 0xad, 0x4a, 0x10, 0x78, 0x0b, 0xf1, 0x01, 0x0b, 0x83, 0x45, + 0xbb, 0xd3, 0x25, 0xe0, 0x02, 0x28, 0xf7, 0xd3, 0x04, 0x28, 0x1b, 0xd8, + 0x04, 0x98, 0x00, 0x28, 0xca, 0xd0, 0xf1, 0xe7, 0x08, 0x98, 0x07, 0x78, + 0xf6, 0x48, 0x41, 0x46, 0x89, 0xf8, 0x40, 0x71, 0x02, 0x68, 0x38, 0x46, + 0x90, 0x47, 0x07, 0x9a, 0x99, 0xf9, 0x42, 0x11, 0x09, 0x90, 0x89, 0xf8, + 0x41, 0x01, 0x50, 0xb2, 0x88, 0x42, 0xa8, 0xbf, 0x0a, 0x46, 0x06, 0x9f, + 0x00, 0x20, 0x07, 0x92, 0x0a, 0x90, 0xd8, 0xe7, 0x03, 0x99, 0x04, 0x29, + 0x98, 0xbf, 0x09, 0x28, 0xd4, 0xd8, 0xab, 0xe7, 0x0a, 0x98, 0xdd, 0xf8, + 0x24, 0x80, 0xe5, 0x4b, 0x01, 0x28, 0x08, 0xbf, 0x4f, 0xf0, 0x7e, 0x08, + 0xdd, 0xf8, 0x14, 0xb0, 0x0b, 0x99, 0x07, 0x9e, 0xa5, 0xe0, 0x09, 0x29, + 0x02, 0xd8, 0x05, 0x2d, 0xbf, 0xf4, 0xd5, 0xae, 0x01, 0x22, 0x7f, 0x21, + 0xdf, 0xf8, 0x30, 0xb2, 0x0a, 0x92, 0x07, 0x91, 0x9b, 0xf8, 0x00, 0x00, + 0x00, 0x28, 0x57, 0xd0, 0x00, 0x20, 0x04, 0x2d, 0x4f, 0xf0, 0x00, 0x01, + 0x87, 0x4f, 0x4f, 0xf0, 0x00, 0x06, 0x88, 0xbf, 0x01, 0x20, 0x02, 0x2d, + 0x38, 0xbf, 0x01, 0x21, 0x08, 0x43, 0x04, 0x90, 0x68, 0x1f, 0xc0, 0xb2, + 0x03, 0x90, 0x57, 0xf8, 0x26, 0x90, 0xb9, 0xf1, 0x00, 0x0f, 0x28, 0xd0, + 0x7f, 0x48, 0x99, 0xf8, 0x1d, 0x11, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0x68, + 0x49, 0x01, 0x40, 0x5c, 0x01, 0x28, 0x23, 0xd8, 0xd9, 0xf8, 0x00, 0x01, + 0xa0, 0x42, 0x1f, 0xd1, 0x99, 0xf8, 0x4a, 0x01, 0xa8, 0x42, 0x21, 0xd1, + 0x08, 0x98, 0xc6, 0x49, 0x00, 0x78, 0x0a, 0x68, 0x41, 0x46, 0x89, 0xf8, + 0x40, 0x01, 0x90, 0x47, 0x07, 0x9a, 0x99, 0xf9, 0x42, 0x11, 0x09, 0x90, + 0x89, 0xf8, 0x41, 0x01, 0x50, 0xb2, 0x88, 0x42, 0x4f, 0xf0, 0x00, 0x00, + 0xa8, 0xbf, 0x0a, 0x46, 0x07, 0x92, 0x0a, 0x90, 0x04, 0xe0, 0x00, 0x20, + 0x4f, 0xf4, 0x9d, 0x71, 0xec, 0xf7, 0x94, 0xfa, 0x9b, 0xf8, 0x00, 0x00, + 0x01, 0x36, 0x86, 0x42, 0xc7, 0xd3, 0x0d, 0xe0, 0x02, 0x28, 0xf7, 0xd3, + 0x04, 0x28, 0x03, 0xd8, 0x04, 0x98, 0x00, 0x28, 0xd6, 0xd0, 0xf1, 0xe7, + 0x03, 0x99, 0x04, 0x29, 0x98, 0xbf, 0x09, 0x28, 0xec, 0xd8, 0xcf, 0xe7, + 0x0a, 0x98, 0x07, 0x9e, 0x01, 0x28, 0x34, 0xd1, 0x00, 0x20, 0x8d, 0xf8, + 0x32, 0x00, 0x01, 0x20, 0x4f, 0xf0, 0x7e, 0x08, 0x0a, 0x90, 0x21, 0xe0, + 0x09, 0x28, 0x02, 0xd8, 0x05, 0x2d, 0xbf, 0xf4, 0xba, 0xae, 0x4f, 0xf0, + 0x01, 0x0b, 0x7f, 0x26, 0x56, 0x48, 0x29, 0x46, 0x02, 0x68, 0x20, 0x46, + 0x90, 0x47, 0xc0, 0xb1, 0x07, 0x46, 0x00, 0x20, 0x00, 0x21, 0x0a, 0x90, + 0x9f, 0x48, 0x8d, 0xf8, 0x32, 0x10, 0x41, 0x46, 0x02, 0x68, 0x08, 0x98, + 0x00, 0x78, 0x90, 0x47, 0x97, 0xf9, 0x42, 0x11, 0x80, 0x46, 0x70, 0xb2, + 0x88, 0x42, 0xb8, 0xbf, 0x31, 0x46, 0x0e, 0x46, 0xdd, 0xe9, 0x05, 0xb7, + 0x0b, 0x99, 0x94, 0x4b, 0x0b, 0xe0, 0x00, 0x20, 0xbb, 0xf1, 0x00, 0x0f, + 0xcd, 0xd1, 0x00, 0x20, 0x0a, 0x90, 0xdd, 0xe9, 0x05, 0xb7, 0x0b, 0x99, + 0x8e, 0x4b, 0xdd, 0xf8, 0x24, 0x80, 0x31, 0xb1, 0x08, 0x79, 0x04, 0x28, + 0x03, 0xd1, 0x00, 0x20, 0x48, 0x71, 0x03, 0x20, 0x0b, 0xe0, 0x08, 0x98, + 0x19, 0x78, 0x00, 0x78, 0x88, 0x42, 0x01, 0xd1, 0x01, 0x20, 0x04, 0xe0, + 0x86, 0x49, 0x09, 0x78, 0x88, 0x42, 0x02, 0xd1, 0x02, 0x20, 0x8d, 0xf8, + 0x31, 0x00, 0x94, 0xf8, 0x3b, 0x03, 0x0c, 0x28, 0x02, 0xd0, 0x0a, 0x98, + 0x01, 0x28, 0x01, 0xd1, 0xff, 0x27, 0x08, 0xe0, 0x32, 0x48, 0x00, 0xeb, + 0x47, 0x00, 0x40, 0x78, 0x37, 0x1a, 0x78, 0xb2, 0x00, 0x28, 0xd8, 0xbf, + 0x00, 0x27, 0x0d, 0xf1, 0x32, 0x00, 0x0d, 0xf1, 0x31, 0x03, 0x29, 0x46, + 0x00, 0x22, 0x00, 0x90, 0x20, 0x46, 0xff, 0xf7, 0x91, 0xfc, 0x20, 0x46, + 0x29, 0x46, 0x00, 0x22, 0x5b, 0x46, 0x16, 0xf0, 0x63, 0xfa, 0x27, 0x48, + 0x9d, 0xf9, 0x32, 0x20, 0x9d, 0xf8, 0x31, 0x10, 0x4f, 0xfa, 0x88, 0xf8, + 0x7b, 0xb2, 0xcd, 0xf8, 0x00, 0x80, 0x06, 0x68, 0x20, 0x46, 0xb0, 0x47, + 0x9a, 0xf8, 0xbb, 0x03, 0x41, 0x07, 0x5e, 0xbf, 0x0a, 0xf2, 0xbb, 0x31, + 0x40, 0xf0, 0x04, 0x00, 0x08, 0x70, 0xd4, 0xf8, 0x34, 0x03, 0x41, 0x02, + 0x5c, 0xbf, 0x40, 0xf4, 0x80, 0x00, 0xc4, 0xf8, 0x34, 0x03, 0x00, 0xb2, + 0xb0, 0xf1, 0xff, 0x3f, 0x3f, 0xf7, 0x9b, 0xad, 0x9d, 0xf8, 0x32, 0x00, + 0x00, 0x28, 0x3f, 0xf4, 0x96, 0xad, 0x14, 0x49, 0x40, 0xb2, 0x00, 0x22, + 0x2b, 0x46, 0x0e, 0x68, 0x9d, 0xf8, 0x31, 0x10, 0xcd, 0xe9, 0x00, 0x81, + 0x02, 0x90, 0x20, 0x46, 0x00, 0x21, 0xb0, 0x47, 0x87, 0xe5, 0x00, 0xbf, + 0x72, 0x32, 0x0a, 0x10, 0x70, 0x52, 0x01, 0x00, 0x6b, 0x34, 0x01, 0x00, + 0x6a, 0x34, 0x01, 0x00, 0x34, 0x9c, 0x08, 0x00, 0x38, 0x9c, 0x08, 0x00, + 0xd4, 0x58, 0x01, 0x00, 0x14, 0x58, 0x01, 0x00, 0xe0, 0x35, 0x01, 0x00, + 0x3c, 0x9c, 0x08, 0x00, 0xe8, 0xc7, 0x08, 0x00, 0x80, 0x53, 0x01, 0x00, + 0xf0, 0xc1, 0x08, 0x00, 0xf4, 0x9b, 0x08, 0x00, 0x94, 0x9b, 0x08, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x85, 0xb0, 0x05, 0x46, 0x0c, 0x29, 0x01, 0x91, + 0x08, 0xd0, 0x80, 0x29, 0x1a, 0xbf, 0x41, 0x48, 0x47, 0x5c, 0x95, 0xf8, + 0xf2, 0x72, 0x3e, 0x46, 0x01, 0x20, 0x0b, 0xe0, 0x95, 0xf8, 0xcc, 0x03, + 0x95, 0xf8, 0xd4, 0x13, 0x03, 0x26, 0x02, 0x27, 0x88, 0x42, 0x08, 0xbf, + 0x02, 0x26, 0x40, 0x1a, 0x18, 0xbf, 0x01, 0x20, 0x02, 0x90, 0x4f, 0xf0, + 0x00, 0x08, 0x0d, 0xf1, 0x10, 0x0b, 0x44, 0x48, 0x00, 0x21, 0x25, 0x22, + 0x04, 0x23, 0x8d, 0xf8, 0x0f, 0x80, 0x04, 0x68, 0x58, 0x46, 0xa0, 0x47, + 0x04, 0x98, 0x00, 0x28, 0x56, 0xd0, 0xfc, 0xb2, 0x04, 0x20, 0x2f, 0x49, + 0x04, 0x2c, 0x38, 0xbf, 0x20, 0x46, 0x05, 0xeb, 0xc0, 0x09, 0x99, 0xf8, + 0xbc, 0x03, 0x09, 0x78, 0x09, 0xf5, 0x6f, 0x7a, 0x88, 0x42, 0x01, 0xd1, + 0x01, 0x20, 0x04, 0xe0, 0x28, 0x49, 0x09, 0x78, 0x88, 0x42, 0x02, 0xd1, + 0x02, 0x20, 0x8d, 0xf8, 0x0f, 0x00, 0x28, 0x46, 0x21, 0x46, 0x00, 0x22, + 0x0d, 0xf1, 0x0f, 0x03, 0xcd, 0xf8, 0x00, 0x80, 0xff, 0xf7, 0xe8, 0xfb, + 0x21, 0x49, 0x9a, 0xf8, 0x00, 0x00, 0x0a, 0x68, 0x02, 0x21, 0x90, 0x47, + 0xd5, 0xf8, 0x1c, 0x14, 0x99, 0xf8, 0xbf, 0x23, 0x51, 0xb1, 0x09, 0x7e, + 0x05, 0x29, 0x07, 0xd1, 0x05, 0x2c, 0x05, 0xd3, 0x09, 0x2c, 0x05, 0xd8, + 0x04, 0x99, 0x81, 0xf8, 0x05, 0x80, 0x0e, 0xe0, 0x04, 0x2c, 0x03, 0xd3, + 0x04, 0x98, 0xec, 0xf7, 0x69, 0xf9, 0x14, 0xe0, 0x02, 0x99, 0x19, 0xb1, + 0x13, 0x49, 0x0b, 0x5d, 0x04, 0x99, 0x01, 0xe0, 0x04, 0x99, 0x01, 0x9b, + 0x4b, 0x71, 0x08, 0x72, 0x9d, 0xf8, 0x0f, 0x00, 0xca, 0x71, 0x00, 0xf0, + 0x03, 0x00, 0x88, 0x71, 0x0d, 0x48, 0x02, 0x68, 0x08, 0x46, 0x29, 0x46, + 0x90, 0x47, 0x01, 0x37, 0xf8, 0xb2, 0xb0, 0x42, 0x9d, 0xd9, 0x04, 0xe0, + 0x00, 0x20, 0x40, 0xf2, 0x5d, 0x21, 0xec, 0xf7, 0x2b, 0xf9, 0x05, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0x72, 0x32, 0x0a, 0x10, 0x6b, 0x34, 0x01, 0x00, + 0x6a, 0x34, 0x01, 0x00, 0x34, 0x9c, 0x08, 0x00, 0x6a, 0x32, 0x0a, 0x10, + 0xa8, 0xb8, 0x08, 0x00, 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, + 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x04, 0xc2, 0x08, 0x00, + 0x15, 0xa3, 0x03, 0x00, 0xa4, 0xb8, 0x08, 0x00, 0x09, 0xa3, 0x03, 0x00, + 0x84, 0xc6, 0x08, 0x00, 0x35, 0xa3, 0x03, 0x00, 0x24, 0xc1, 0x08, 0x00, + 0x59, 0xa9, 0x03, 0x00, 0x45, 0xf6, 0xe1, 0x3c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf6, 0x69, 0x7c, 0xc1, 0xf2, 0x07, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xfe, 0xf7, 0x8a, 0xba, 0x2d, 0xe9, 0xf0, 0x4f, + 0x89, 0xb0, 0x04, 0x46, 0xbb, 0x48, 0x99, 0x46, 0x88, 0x46, 0x00, 0x78, + 0xff, 0x28, 0x18, 0xbf, 0x90, 0x42, 0x40, 0xf0, 0x33, 0x81, 0xb8, 0x49, + 0x02, 0xeb, 0x42, 0x00, 0x51, 0xf8, 0x20, 0x60, 0x00, 0x2e, 0x55, 0xd0, + 0x20, 0x78, 0x00, 0x21, 0x04, 0xeb, 0xc0, 0x00, 0xc1, 0x72, 0x96, 0xf8, + 0x24, 0x01, 0x0a, 0x28, 0x51, 0xd1, 0xdf, 0xf8, 0xc4, 0xa2, 0x72, 0xb6, + 0xda, 0xf8, 0x00, 0x00, 0x40, 0x00, 0x01, 0x30, 0xca, 0xf8, 0x00, 0x00, + 0xd6, 0xe9, 0xc8, 0x10, 0xb7, 0x6e, 0xb6, 0xf8, 0xdc, 0xb2, 0x01, 0x90, + 0xb6, 0xf8, 0xea, 0x02, 0x03, 0x91, 0x06, 0x90, 0x96, 0xf8, 0xf2, 0x02, + 0x05, 0x90, 0x96, 0xf8, 0xf3, 0x02, 0x04, 0x90, 0xd6, 0xf8, 0x84, 0x02, + 0xd0, 0xe9, 0x02, 0x50, 0x02, 0x90, 0xfe, 0xf7, 0x4d, 0xfa, 0x00, 0x28, + 0x42, 0xd0, 0xd6, 0xf8, 0x0c, 0x03, 0x00, 0x28, 0x3e, 0xd0, 0xb6, 0xf8, + 0x84, 0x10, 0x89, 0x06, 0x3a, 0xd5, 0xb6, 0xf8, 0x14, 0x13, 0x02, 0x8b, + 0x51, 0x1a, 0x09, 0xb2, 0x00, 0x29, 0x33, 0xd4, 0x90, 0xf8, 0x32, 0x20, + 0x89, 0xb2, 0x0b, 0xfb, 0x01, 0xf1, 0xb0, 0xf8, 0x1c, 0xb0, 0x05, 0x92, + 0x90, 0xf8, 0x33, 0x20, 0x89, 0x00, 0x04, 0x92, 0x42, 0x8d, 0x06, 0x92, + 0xd6, 0xf8, 0xd4, 0x20, 0x52, 0x7f, 0xa2, 0xb1, 0x40, 0x8b, 0x01, 0xeb, + 0x80, 0x00, 0x03, 0x99, 0x01, 0x44, 0x28, 0x44, 0x20, 0xf0, 0x70, 0x45, + 0x03, 0x91, 0x17, 0xe0, 0x00, 0x20, 0x64, 0x21, 0xec, 0xf7, 0x82, 0xf8, + 0xd0, 0xe0, 0x20, 0x46, 0x41, 0x46, 0x4b, 0x46, 0x00, 0xf0, 0x60, 0xf9, + 0xca, 0xe0, 0x03, 0x9a, 0x11, 0x44, 0x90, 0xf8, 0x2c, 0x20, 0x40, 0x8b, + 0x01, 0xeb, 0x42, 0x01, 0x01, 0xeb, 0x80, 0x00, 0x81, 0x49, 0x00, 0xea, + 0x01, 0x07, 0x03, 0x97, 0xda, 0xf8, 0x00, 0x00, 0x7f, 0x49, 0x40, 0x08, + 0xca, 0xf8, 0x00, 0x00, 0xda, 0xf8, 0x00, 0x00, 0x80, 0xf3, 0x10, 0x88, + 0xd6, 0xf8, 0xd4, 0x00, 0x49, 0x69, 0x81, 0x42, 0x0c, 0xd0, 0x7a, 0x49, + 0x4f, 0xf0, 0x00, 0x0a, 0x07, 0x97, 0xad, 0xf8, 0x20, 0xa0, 0x0b, 0x68, + 0x00, 0xf1, 0x14, 0x01, 0x07, 0xa8, 0x02, 0x46, 0x98, 0x47, 0x19, 0xe0, + 0x74, 0x48, 0x90, 0xf8, 0x2e, 0x00, 0x80, 0xb1, 0x98, 0xf8, 0x1d, 0x00, + 0x68, 0xb1, 0x72, 0x48, 0x41, 0x46, 0x02, 0x68, 0x30, 0x46, 0x90, 0x47, + 0x38, 0xb1, 0x01, 0x98, 0xa0, 0x25, 0x4f, 0xf0, 0x01, 0x0a, 0x08, 0x90, + 0x03, 0x98, 0x07, 0x90, 0x05, 0xe0, 0x02, 0x98, 0x4f, 0xf0, 0x00, 0x0a, + 0xcd, 0xe9, 0x07, 0x50, 0x50, 0x25, 0x69, 0x48, 0x07, 0xaf, 0x08, 0xf1, + 0x14, 0x01, 0x3a, 0x46, 0x03, 0x68, 0x38, 0x46, 0x98, 0x47, 0x66, 0x48, + 0x29, 0x46, 0x02, 0x68, 0x38, 0x46, 0x90, 0x47, 0x21, 0x78, 0x25, 0x1d, + 0xa2, 0x78, 0x07, 0x90, 0x05, 0xeb, 0xc1, 0x01, 0xa1, 0xf8, 0x02, 0xb0, + 0x60, 0x49, 0x0b, 0x68, 0x4f, 0xea, 0x4b, 0x01, 0x98, 0x47, 0x96, 0xf8, + 0x3e, 0x23, 0x41, 0x08, 0x20, 0x78, 0xd2, 0x07, 0x25, 0xf8, 0x30, 0x10, + 0x0c, 0xd0, 0x04, 0xeb, 0xc0, 0x03, 0xdf, 0x88, 0x7a, 0x08, 0xda, 0x80, + 0x8b, 0xb2, 0xb3, 0xeb, 0x57, 0x0f, 0x22, 0xbf, 0x05, 0xeb, 0xc0, 0x03, + 0x89, 0x1a, 0x19, 0x80, 0xba, 0xf1, 0x00, 0x0f, 0x08, 0xbf, 0xb9, 0xf1, + 0x00, 0x0f, 0x54, 0xd0, 0x06, 0x9d, 0x04, 0xeb, 0xc0, 0x02, 0x01, 0x21, + 0x11, 0x72, 0x05, 0x9b, 0x01, 0x2b, 0x02, 0xd8, 0x04, 0x9a, 0x02, 0x2a, + 0x05, 0xd3, 0x02, 0x29, 0x9e, 0xbf, 0x04, 0xeb, 0xc0, 0x01, 0x03, 0x22, + 0x0a, 0x72, 0x18, 0xb1, 0x14, 0xf8, 0x30, 0x00, 0x86, 0xf8, 0x76, 0x01, + 0x86, 0xf8, 0x77, 0x51, 0x02, 0x21, 0x20, 0x78, 0x04, 0xeb, 0xc0, 0x00, + 0x81, 0x72, 0x01, 0x21, 0x41, 0x72, 0x43, 0x48, 0x41, 0x46, 0x02, 0x68, + 0xd6, 0xf8, 0xd4, 0x00, 0x90, 0x47, 0x28, 0xb1, 0x37, 0x49, 0xd6, 0xf8, + 0xd4, 0x00, 0x49, 0x69, 0x81, 0x42, 0x12, 0xd1, 0xba, 0xf1, 0x00, 0x0f, + 0x0c, 0xd1, 0x20, 0x78, 0x04, 0xeb, 0xc0, 0x00, 0x01, 0x7a, 0x42, 0x7a, + 0xc3, 0x7a, 0x01, 0x31, 0x01, 0x72, 0x51, 0x1c, 0x41, 0x72, 0x43, 0xf0, + 0x01, 0x01, 0xc1, 0x72, 0x60, 0x78, 0x01, 0x30, 0x60, 0x70, 0x20, 0x78, + 0x33, 0x4a, 0x0c, 0x23, 0x10, 0x60, 0x04, 0xeb, 0xc0, 0x00, 0x01, 0x7a, + 0x80, 0x88, 0x90, 0x60, 0x30, 0x48, 0x51, 0x60, 0x00, 0x21, 0x05, 0x68, + 0x48, 0xf2, 0x0d, 0x00, 0xa8, 0x47, 0x20, 0x78, 0x01, 0x30, 0x20, 0x70, + 0x09, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x06, 0x9d, 0x5d, 0xb3, 0x26, 0x49, + 0x64, 0x23, 0x04, 0xeb, 0xc0, 0x02, 0xb1, 0xf8, 0xf0, 0x11, 0x01, 0xfb, + 0x0b, 0xf1, 0xb1, 0xfb, 0xf3, 0xf1, 0xc5, 0xf3, 0x47, 0x03, 0x99, 0x42, + 0x28, 0xbf, 0x69, 0x08, 0xc9, 0xb2, 0x00, 0x29, 0x08, 0xbf, 0x01, 0x21, + 0x40, 0x29, 0x28, 0xbf, 0x40, 0x21, 0x96, 0xf8, 0xf2, 0x32, 0x02, 0xf8, + 0x08, 0x1f, 0x01, 0x2b, 0x09, 0xd8, 0x96, 0xf8, 0xf3, 0x32, 0x01, 0x2b, + 0x05, 0xd8, 0x05, 0x9b, 0x05, 0x29, 0x24, 0xbf, 0x04, 0x21, 0x11, 0x70, + 0x88, 0xe7, 0x05, 0x9b, 0x11, 0x29, 0x24, 0xbf, 0x10, 0x21, 0x11, 0x70, + 0x82, 0xe7, 0x96, 0xf8, 0xa6, 0x13, 0x04, 0xeb, 0xc0, 0x02, 0x02, 0x29, + 0xff, 0xf4, 0x79, 0xaf, 0x40, 0x29, 0x28, 0xbf, 0x40, 0x21, 0x75, 0xe7, + 0x7f, 0xd3, 0x05, 0x00, 0xe8, 0x72, 0x01, 0x00, 0x24, 0x36, 0x01, 0x00, + 0xfc, 0xff, 0xff, 0x0f, 0xfc, 0x73, 0x01, 0x00, 0x44, 0xa1, 0x08, 0x00, + 0x10, 0x5a, 0x01, 0x00, 0xbc, 0xcd, 0x08, 0x00, 0x48, 0xa1, 0x08, 0x00, + 0x3c, 0xa1, 0x08, 0x00, 0x40, 0xa1, 0x08, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0x38, 0xa1, 0x08, 0x00, 0x8c, 0x34, 0x01, 0x00, 0x78, 0x9b, 0x08, 0x00, + 0xf8, 0xb5, 0x07, 0x46, 0x12, 0x48, 0x15, 0x46, 0x0e, 0x46, 0x19, 0x46, + 0x1c, 0x46, 0x02, 0x68, 0x28, 0x46, 0x90, 0x47, 0xc1, 0xb2, 0x55, 0xfa, + 0x80, 0xf0, 0x01, 0x38, 0x90, 0xfb, 0xf1, 0xf0, 0x00, 0xfb, 0x01, 0xf2, + 0x06, 0x98, 0xa2, 0x42, 0x09, 0xdc, 0x38, 0xb1, 0xb1, 0xfb, 0xf0, 0xf2, + 0x02, 0xfb, 0x10, 0x12, 0x00, 0x2a, 0x08, 0xbf, 0x08, 0x46, 0x00, 0xe0, + 0x00, 0x20, 0x00, 0x90, 0x38, 0x46, 0x31, 0x46, 0x2a, 0x46, 0x23, 0x46, + 0x00, 0xf0, 0x1a, 0xf8, 0xf8, 0xbd, 0x00, 0xbf, 0xc8, 0xc8, 0x08, 0x00, + 0x03, 0x48, 0x04, 0x49, 0x01, 0x60, 0x04, 0x48, 0x04, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x1c, 0xc7, 0x08, 0x00, 0x15, 0xae, 0x03, 0x00, + 0xa4, 0xc8, 0x08, 0x00, 0xe1, 0xaa, 0x03, 0x00, 0x4a, 0xf2, 0x39, 0x1c, + 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf6, 0xe5, 0x5c, + 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x10, 0xb5, 0x00, 0xf0, + 0xf7, 0xf9, 0x50, 0x48, 0x4f, 0xf0, 0xff, 0x31, 0x01, 0x60, 0x46, 0x48, + 0x90, 0xf8, 0x3d, 0x00, 0x40, 0xb1, 0x45, 0x4c, 0x00, 0x20, 0x21, 0x68, + 0x88, 0x47, 0x21, 0x68, 0x01, 0x20, 0xbd, 0xe8, 0x10, 0x40, 0x08, 0x47, + 0x10, 0xbd, 0x00, 0xbf, 0x2d, 0xe9, 0xf0, 0x41, 0x94, 0xb0, 0x04, 0x46, + 0x3c, 0x48, 0x02, 0x2c, 0x00, 0xf1, 0x3d, 0x06, 0x08, 0xd1, 0x3c, 0x48, + 0x0d, 0x46, 0x01, 0x68, 0x02, 0x20, 0x88, 0x47, 0xd5, 0xb1, 0x95, 0xf8, + 0x35, 0x01, 0x1c, 0xe0, 0x30, 0x78, 0x28, 0xb1, 0x35, 0x48, 0x00, 0x25, + 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0x35, 0x70, 0x33, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x32, 0x48, 0x0e, 0x21, 0x06, 0xf1, 0x23, 0x02, + 0x06, 0xf1, 0x1f, 0x03, 0x00, 0x78, 0xc0, 0x07, 0x08, 0xbf, 0x04, 0x21, + 0x19, 0x20, 0x0f, 0xe0, 0x00, 0x20, 0x87, 0x21, 0xeb, 0xf7, 0xcc, 0xfe, + 0xff, 0x20, 0x2a, 0x49, 0x06, 0xf1, 0x5b, 0x02, 0x06, 0xf1, 0x57, 0x03, + 0x09, 0x78, 0xc9, 0x07, 0x4f, 0xf0, 0x0f, 0x01, 0x08, 0xbf, 0x06, 0x21, + 0x25, 0x4c, 0x00, 0x25, 0x1b, 0x88, 0x12, 0x88, 0xcd, 0xe9, 0x00, 0x05, + 0x00, 0x20, 0x24, 0x68, 0xa0, 0x47, 0x22, 0x4c, 0x03, 0xae, 0x44, 0x21, + 0x20, 0x23, 0x4f, 0xf0, 0x44, 0x08, 0x30, 0x46, 0x22, 0x46, 0xe6, 0xf7, + 0x5d, 0xf8, 0x1e, 0x4d, 0x06, 0xf1, 0x20, 0x00, 0x24, 0x21, 0x24, 0x23, + 0x2a, 0x46, 0xe6, 0xf7, 0x55, 0xf8, 0x1b, 0x48, 0x01, 0x21, 0x00, 0x22, + 0x33, 0x46, 0xcd, 0xf8, 0x00, 0x80, 0xb0, 0xf8, 0xd0, 0x02, 0xad, 0xf8, + 0x42, 0x00, 0x17, 0x48, 0x00, 0x68, 0x11, 0x90, 0x16, 0x48, 0x07, 0x68, + 0x40, 0xf2, 0x17, 0x60, 0xb8, 0x47, 0x15, 0x4e, 0x20, 0x21, 0x72, 0xb6, + 0x30, 0x68, 0x40, 0x00, 0x01, 0x30, 0x30, 0x60, 0x20, 0x46, 0xe8, 0xf7, + 0xcd, 0xf9, 0x28, 0x46, 0x24, 0x21, 0xe8, 0xf7, 0xc9, 0xf9, 0x30, 0x68, + 0x40, 0x08, 0x30, 0x60, 0x30, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x14, 0xb0, + 0xbd, 0xe8, 0xf0, 0x81, 0x90, 0x01, 0x00, 0x00, 0x94, 0xba, 0x08, 0x00, + 0x60, 0xba, 0x08, 0x00, 0x99, 0x53, 0x01, 0x00, 0x14, 0x99, 0x08, 0x00, + 0x38, 0x7a, 0x01, 0x00, 0x38, 0xfb, 0x05, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0x34, 0x21, 0x01, 0x00, 0xa0, 0xa0, 0x08, 0x00, 0x24, 0x36, 0x01, 0x00, + 0x2d, 0xe9, 0xff, 0x41, 0x0f, 0x46, 0x04, 0x29, 0x05, 0x46, 0x90, 0x46, + 0x0e, 0x46, 0x28, 0xbf, 0x04, 0x27, 0xd0, 0xf8, 0x34, 0x03, 0x81, 0x03, + 0x04, 0xd4, 0xc0, 0x03, 0x15, 0xd5, 0xa3, 0xb1, 0x01, 0x22, 0x05, 0xe0, + 0x20, 0xf4, 0x00, 0x30, 0x00, 0x23, 0x02, 0x22, 0xc5, 0xf8, 0x34, 0x03, + 0x05, 0xeb, 0xc7, 0x00, 0x8a, 0x49, 0x90, 0xf9, 0xbd, 0x03, 0x0c, 0x68, + 0x00, 0x21, 0xcd, 0xe9, 0x00, 0x08, 0x02, 0x93, 0x28, 0x46, 0x33, 0x46, + 0xa0, 0x47, 0x05, 0xeb, 0xc7, 0x01, 0x01, 0xf2, 0xbb, 0x30, 0x91, 0xf8, + 0xbb, 0x13, 0x4a, 0x07, 0x5c, 0xbf, 0x41, 0xf0, 0x04, 0x01, 0x01, 0x70, + 0x01, 0xf0, 0xfc, 0x01, 0xb8, 0xf1, 0x02, 0x0f, 0x01, 0xd1, 0x01, 0x31, + 0x04, 0xe0, 0xb8, 0xf1, 0x01, 0x0f, 0x08, 0xbf, 0x41, 0xf0, 0x02, 0x01, + 0x01, 0x70, 0xbd, 0xe8, 0xff, 0x81, 0x00, 0xbf, 0x2d, 0xe9, 0xf0, 0x4f, + 0x85, 0xb0, 0x80, 0x46, 0x90, 0xf8, 0x4e, 0x03, 0x40, 0x07, 0x40, 0xf1, + 0xd2, 0x80, 0x6a, 0x48, 0x00, 0x79, 0x40, 0x07, 0x40, 0xf1, 0xcd, 0x80, + 0x0d, 0x46, 0x98, 0xf8, 0xf2, 0x12, 0x91, 0x46, 0x66, 0x4a, 0x0e, 0x46, + 0x04, 0x29, 0x28, 0xbf, 0x04, 0x26, 0x50, 0x7a, 0xc0, 0x07, 0x04, 0xd0, + 0x90, 0x19, 0x80, 0x7a, 0xa8, 0x42, 0x38, 0xbf, 0x05, 0x46, 0x61, 0x4c, + 0x4f, 0xf0, 0x03, 0x0a, 0x05, 0x29, 0x28, 0x46, 0x38, 0xbf, 0x4f, 0xf0, + 0x02, 0x0a, 0x04, 0x91, 0x51, 0x46, 0x22, 0x68, 0x90, 0x47, 0x07, 0x46, + 0x22, 0x68, 0x98, 0xf8, 0x74, 0x00, 0x04, 0x9c, 0x51, 0x46, 0x90, 0x47, + 0x08, 0xeb, 0xc6, 0x0b, 0x38, 0x1a, 0x51, 0x46, 0x88, 0xf8, 0x74, 0x50, + 0x8b, 0xf8, 0xbf, 0x03, 0x54, 0x48, 0x8b, 0xf8, 0xbc, 0x53, 0x02, 0x68, + 0x28, 0x46, 0x90, 0x47, 0x08, 0xeb, 0x4a, 0x01, 0x0b, 0xf5, 0x6f, 0x77, + 0xa1, 0xf8, 0x78, 0x00, 0xa0, 0x1e, 0x02, 0x28, 0x3e, 0xd8, 0x03, 0x2c, + 0x1d, 0xd0, 0x02, 0x2c, 0x40, 0xf0, 0x8d, 0x80, 0x48, 0x48, 0x41, 0x7b, + 0x38, 0x78, 0x81, 0x42, 0x38, 0xbf, 0x08, 0x46, 0x98, 0xf8, 0xd4, 0x53, + 0xa8, 0x42, 0x2f, 0xd0, 0x44, 0x4c, 0x02, 0x21, 0x88, 0xf8, 0xd4, 0x03, + 0x22, 0x68, 0x90, 0x47, 0x22, 0x68, 0x06, 0x46, 0x04, 0x9c, 0x28, 0x46, + 0x02, 0x21, 0x90, 0x47, 0x30, 0x1a, 0x03, 0x21, 0x88, 0xf8, 0xd7, 0x03, + 0x19, 0xe0, 0x3b, 0x48, 0x01, 0x7b, 0x38, 0x78, 0x81, 0x42, 0x38, 0xbf, + 0x08, 0x46, 0x98, 0xf8, 0xcc, 0x53, 0xa8, 0x42, 0x14, 0xd0, 0x37, 0x4c, + 0x02, 0x21, 0x88, 0xf8, 0xcc, 0x03, 0x22, 0x68, 0x90, 0x47, 0x22, 0x68, + 0x06, 0x46, 0x04, 0x9c, 0x28, 0x46, 0x02, 0x21, 0x90, 0x47, 0x30, 0x1a, + 0x02, 0x21, 0x88, 0xf8, 0xcf, 0x03, 0x40, 0x46, 0x03, 0x22, 0x2b, 0x46, + 0x15, 0xf0, 0xf8, 0xfd, 0xb9, 0xf1, 0x00, 0x0f, 0x4f, 0xd0, 0x98, 0xf8, + 0x36, 0x03, 0x40, 0x06, 0x4b, 0xd5, 0x9b, 0xf8, 0xbb, 0x03, 0x00, 0xf0, + 0xf7, 0x00, 0x8b, 0xf8, 0xbb, 0x03, 0x28, 0x48, 0x00, 0x68, 0x80, 0x47, + 0xc0, 0xb1, 0x05, 0x46, 0x02, 0x2c, 0x07, 0xd3, 0x04, 0x2c, 0x01, 0xd8, + 0x0c, 0x20, 0x05, 0xe0, 0x09, 0x2c, 0x01, 0xd8, 0x80, 0x20, 0x01, 0xe0, + 0x21, 0x48, 0x00, 0x5d, 0x28, 0x71, 0x21, 0x48, 0x41, 0x46, 0x2a, 0x46, + 0x01, 0x23, 0x06, 0x68, 0x4f, 0x20, 0xb0, 0x47, 0x10, 0xb1, 0x28, 0x46, + 0xeb, 0xf7, 0x92, 0xfd, 0xb8, 0xf9, 0x34, 0x03, 0xb0, 0xf1, 0xff, 0x3f, + 0x23, 0xdc, 0x15, 0x4e, 0x38, 0x78, 0x51, 0x46, 0x32, 0x68, 0x90, 0x47, + 0x05, 0x46, 0x17, 0x48, 0x32, 0x68, 0x02, 0x21, 0x00, 0x78, 0x90, 0x47, + 0x85, 0x42, 0x01, 0xd1, 0x01, 0x20, 0x09, 0xe0, 0x13, 0x48, 0x32, 0x68, + 0x02, 0x21, 0x00, 0x78, 0x90, 0x47, 0x28, 0x1a, 0xb0, 0xfa, 0x80, 0xf0, + 0x40, 0x09, 0x40, 0x00, 0x0f, 0x49, 0xcd, 0xe9, 0x00, 0x50, 0x40, 0x46, + 0x00, 0x22, 0x23, 0x46, 0x0e, 0x68, 0x7f, 0x21, 0x02, 0x91, 0x00, 0x21, + 0xb0, 0x47, 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x70, 0x52, 0x01, 0x00, + 0xcc, 0x2c, 0x06, 0x00, 0x34, 0x9c, 0x08, 0x00, 0x38, 0x9c, 0x08, 0x00, + 0x48, 0xb5, 0x08, 0x00, 0x6a, 0x32, 0x0a, 0x10, 0x80, 0x9b, 0x08, 0x00, + 0x6b, 0x34, 0x01, 0x00, 0x6a, 0x34, 0x01, 0x00, 0xf4, 0x9b, 0x08, 0x00, + 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x9c, 0xba, 0x08, 0x00, 0xcd, 0xae, 0x03, 0x00, + 0xfc, 0xc6, 0x08, 0x00, 0xa1, 0xae, 0x03, 0x00, 0xf4, 0xc8, 0x08, 0x00, + 0xf5, 0xaf, 0x03, 0x00, 0x00, 0x9c, 0x08, 0x00, 0x75, 0xb0, 0x03, 0x00, + 0x43, 0xf6, 0x35, 0x4c, 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xb0, 0xb5, 0x04, 0x9c, 0x01, 0xb3, 0x01, 0x7f, 0x19, 0xb1, 0x05, 0x8a, + 0x69, 0x43, 0x91, 0x42, 0x3e, 0xd2, 0x81, 0x7e, 0x19, 0xb1, 0x85, 0x89, + 0x69, 0x43, 0x91, 0x42, 0x3c, 0xd2, 0x01, 0x7e, 0x19, 0xb1, 0x05, 0x89, + 0x69, 0x43, 0x91, 0x42, 0x3e, 0xd2, 0x81, 0x7d, 0x19, 0xb1, 0x85, 0x88, + 0x69, 0x43, 0x91, 0x42, 0x40, 0xd2, 0x01, 0x7d, 0x19, 0xb1, 0x05, 0x88, + 0x69, 0x43, 0x91, 0x42, 0x42, 0xd2, 0x00, 0x20, 0x68, 0x21, 0x1f, 0xe0, + 0x41, 0x7f, 0x19, 0xb1, 0x45, 0x8a, 0x69, 0x43, 0x91, 0x42, 0x25, 0xd2, + 0xc1, 0x7e, 0x19, 0xb1, 0xc5, 0x89, 0x69, 0x43, 0x91, 0x42, 0x27, 0xd2, + 0x41, 0x7e, 0x19, 0xb1, 0x45, 0x89, 0x69, 0x43, 0x91, 0x42, 0x29, 0xd2, + 0xc1, 0x7d, 0x19, 0xb1, 0xc5, 0x88, 0x69, 0x43, 0x91, 0x42, 0x2b, 0xd2, + 0x41, 0x7d, 0x19, 0xb1, 0x45, 0x88, 0x69, 0x43, 0x91, 0x42, 0x29, 0xd2, + 0x00, 0x20, 0x8c, 0x21, 0xbd, 0xe8, 0xb0, 0x40, 0xe5, 0xf7, 0x66, 0xbe, + 0x05, 0x21, 0x19, 0x70, 0x00, 0x7f, 0x22, 0xe0, 0x06, 0x21, 0x19, 0x70, + 0x80, 0x7e, 0x1e, 0xe0, 0x05, 0x21, 0x19, 0x70, 0x40, 0x7f, 0x1a, 0xe0, + 0x07, 0x21, 0x19, 0x70, 0x00, 0x7e, 0x16, 0xe0, 0x06, 0x21, 0x19, 0x70, + 0xc0, 0x7e, 0x12, 0xe0, 0x08, 0x21, 0x19, 0x70, 0x80, 0x7d, 0x0e, 0xe0, + 0x07, 0x21, 0x19, 0x70, 0x40, 0x7e, 0x0a, 0xe0, 0x09, 0x21, 0x19, 0x70, + 0x00, 0x7d, 0x06, 0xe0, 0x08, 0x21, 0x19, 0x70, 0xc0, 0x7d, 0x02, 0xe0, + 0x09, 0x21, 0x19, 0x70, 0x40, 0x7d, 0x20, 0x70, 0xb0, 0xbd, 0x00, 0xbf, + 0x10, 0xb5, 0x02, 0x9c, 0x51, 0xb1, 0x51, 0x1f, 0x04, 0x29, 0x12, 0xd8, + 0xdf, 0xe8, 0x01, 0xf0, 0x03, 0x14, 0x17, 0x1a, 0x1d, 0x00, 0x01, 0x8a, + 0x00, 0x7f, 0x2a, 0xe0, 0x51, 0x1f, 0x04, 0x29, 0x16, 0xd8, 0xdf, 0xe8, + 0x01, 0xf0, 0x03, 0x1b, 0x1e, 0x21, 0x24, 0x00, 0x41, 0x8a, 0x40, 0x7f, + 0x1f, 0xe0, 0x00, 0x20, 0xbc, 0x21, 0x0d, 0xe0, 0x81, 0x89, 0x80, 0x7e, + 0x19, 0xe0, 0x01, 0x89, 0x00, 0x7e, 0x16, 0xe0, 0x81, 0x88, 0x80, 0x7d, + 0x13, 0xe0, 0x01, 0x88, 0x00, 0x7d, 0x10, 0xe0, 0x00, 0x20, 0xd9, 0x21, + 0xbd, 0xe8, 0x10, 0x40, 0xe5, 0xf7, 0x0e, 0xbe, 0xc1, 0x89, 0xc0, 0x7e, + 0x07, 0xe0, 0x41, 0x89, 0x40, 0x7e, 0x04, 0xe0, 0xc1, 0x88, 0xc0, 0x7d, + 0x01, 0xe0, 0x41, 0x88, 0x40, 0x7d, 0x21, 0x80, 0x18, 0x70, 0x10, 0xbd, + 0x02, 0x88, 0x0a, 0x80, 0x42, 0x88, 0x4a, 0x80, 0x82, 0x88, 0x8a, 0x80, + 0xc2, 0x88, 0xca, 0x80, 0x02, 0x89, 0x0a, 0x81, 0x42, 0x89, 0x4a, 0x81, + 0x82, 0x89, 0x8a, 0x81, 0xc2, 0x89, 0xca, 0x81, 0x02, 0x8a, 0x0a, 0x82, + 0x42, 0x8a, 0x43, 0x8b, 0x4a, 0x82, 0x4b, 0x83, 0x82, 0x8a, 0x8a, 0x82, + 0xc2, 0x8a, 0xca, 0x82, 0x02, 0x8b, 0x0a, 0x83, 0x02, 0x7f, 0x0a, 0x77, + 0x42, 0x7f, 0x90, 0xf8, 0x29, 0x00, 0x4a, 0x77, 0x88, 0x77, 0x70, 0x47, + 0x21, 0xb1, 0x01, 0x39, 0xc8, 0x40, 0x00, 0xf0, 0x01, 0x00, 0x70, 0x47, + 0x00, 0x20, 0x70, 0x47, 0x70, 0xb5, 0x18, 0x4d, 0x06, 0x46, 0x95, 0xf8, + 0x23, 0x00, 0xb0, 0xeb, 0x11, 0x6f, 0x26, 0xd1, 0x14, 0x46, 0xc1, 0xf3, + 0x07, 0x20, 0x95, 0xf8, 0x28, 0x20, 0x82, 0x42, 0x1f, 0xd1, 0xe8, 0x8c, + 0xc1, 0xf3, 0x07, 0x41, 0xff, 0xf7, 0xe4, 0xff, 0xc8, 0xb1, 0xa8, 0x8c, + 0xb0, 0xeb, 0x16, 0x4f, 0x15, 0xd1, 0xd4, 0xf8, 0x3c, 0x61, 0x3e, 0xb9, + 0x0b, 0x48, 0x01, 0x68, 0x2c, 0x20, 0x88, 0x47, 0x06, 0x46, 0xc4, 0xf8, + 0x3c, 0x01, 0x50, 0xb1, 0xb1, 0x1c, 0x28, 0x46, 0xff, 0xf7, 0xac, 0xff, + 0x00, 0x20, 0x84, 0xf8, 0xec, 0x01, 0x01, 0x20, 0x86, 0xf8, 0x21, 0x00, + 0x70, 0xbd, 0x00, 0x20, 0x70, 0xbd, 0x00, 0xbf, 0xa4, 0x32, 0x06, 0x00, + 0x4c, 0x9c, 0x08, 0x00, 0x19, 0xb1, 0x01, 0x7d, 0x29, 0xb1, 0x00, 0x88, + 0x22, 0xe0, 0x41, 0x7d, 0x29, 0xb1, 0x40, 0x88, 0x1e, 0xe0, 0x81, 0x7d, + 0x29, 0xb1, 0x80, 0x88, 0x1a, 0xe0, 0xc1, 0x7d, 0x29, 0xb1, 0xc0, 0x88, + 0x16, 0xe0, 0x01, 0x7e, 0x29, 0xb1, 0x00, 0x89, 0x12, 0xe0, 0x41, 0x7e, + 0x29, 0xb1, 0x40, 0x89, 0x0e, 0xe0, 0x81, 0x7e, 0x29, 0xb1, 0x80, 0x89, + 0x0a, 0xe0, 0xc1, 0x7e, 0x29, 0xb1, 0xc0, 0x89, 0x06, 0xe0, 0x01, 0x7f, + 0x31, 0xb1, 0x00, 0x8a, 0x02, 0xe0, 0x41, 0x7f, 0x11, 0xb1, 0x40, 0x8a, + 0x10, 0x80, 0x19, 0x70, 0x70, 0x47, 0x00, 0xbf, 0x70, 0xb5, 0x0c, 0x46, + 0x05, 0x46, 0x00, 0xf0, 0xb1, 0xf8, 0x0f, 0x48, 0xa1, 0x79, 0xe2, 0x79, + 0x2b, 0x46, 0x06, 0x68, 0x01, 0x20, 0xb0, 0x47, 0xa0, 0xb1, 0xd0, 0xf8, + 0x3c, 0x11, 0x89, 0xb1, 0x05, 0x22, 0x89, 0x7f, 0x80, 0xf8, 0x54, 0x21, + 0x90, 0xf8, 0x20, 0x21, 0x80, 0xf8, 0xcd, 0x11, 0xb2, 0xfb, 0xf1, 0xf3, + 0x03, 0xfb, 0x11, 0x21, 0x80, 0xf8, 0x56, 0x31, 0x19, 0x44, 0x01, 0x39, + 0x80, 0xf8, 0x55, 0x11, 0x70, 0xbd, 0x00, 0xbf, 0xf8, 0x9b, 0x08, 0x00, + 0x0b, 0x49, 0x91, 0xf8, 0xa4, 0x22, 0x02, 0xf0, 0x21, 0x02, 0x21, 0x2a, + 0x08, 0xd1, 0x42, 0xb2, 0xb2, 0xf1, 0xff, 0x3f, 0x06, 0xdd, 0x07, 0x49, + 0x08, 0x5c, 0x07, 0x49, 0x08, 0x5c, 0x04, 0xe0, 0x0a, 0x20, 0x02, 0xe0, + 0x91, 0xf8, 0xc8, 0x02, 0x05, 0x30, 0xc0, 0xb2, 0x70, 0x47, 0x00, 0xbf, + 0xe8, 0x65, 0x08, 0x00, 0xd7, 0x5b, 0x07, 0x10, 0xcd, 0x0d, 0x01, 0x00, + 0x2d, 0xe9, 0xf8, 0x43, 0xdf, 0xf8, 0xa4, 0x80, 0x04, 0x46, 0x40, 0x78, + 0xd8, 0xf8, 0x00, 0x10, 0xc0, 0xeb, 0x00, 0x12, 0x01, 0xeb, 0x42, 0x12, + 0x02, 0xf5, 0xea, 0x75, 0x92, 0xf8, 0xd5, 0x31, 0x02, 0xf5, 0xe8, 0x72, + 0x15, 0xf8, 0x02, 0x6b, 0x46, 0xea, 0x03, 0x23, 0x2e, 0x78, 0x6d, 0x78, + 0x46, 0xea, 0x05, 0x25, 0x43, 0xea, 0x05, 0x46, 0x96, 0x42, 0x2a, 0xd0, + 0x1c, 0x4f, 0xdf, 0xf8, 0x74, 0x90, 0x96, 0xf8, 0x24, 0x20, 0x01, 0x2a, + 0x0f, 0xd1, 0x38, 0x68, 0x80, 0x47, 0x48, 0xb3, 0x02, 0x46, 0x16, 0xf8, + 0xb4, 0x0c, 0xd9, 0xf8, 0x00, 0x50, 0x00, 0x23, 0x10, 0x71, 0x49, 0x20, + 0xb1, 0x68, 0xa8, 0x47, 0x60, 0x78, 0xd8, 0xf8, 0x00, 0x10, 0x16, 0xf8, + 0x04, 0x2f, 0x73, 0x78, 0xb5, 0x78, 0xf6, 0x78, 0x42, 0xea, 0x03, 0x22, + 0x45, 0xea, 0x06, 0x23, 0x42, 0xea, 0x03, 0x46, 0xc2, 0xb2, 0xc2, 0xeb, + 0x02, 0x12, 0x01, 0xeb, 0x42, 0x12, 0x02, 0xf5, 0xe8, 0x72, 0x96, 0x42, + 0xd7, 0xd1, 0x94, 0xf8, 0x04, 0x01, 0x40, 0xf0, 0x08, 0x00, 0x84, 0xf8, + 0x04, 0x01, 0x00, 0x20, 0xbd, 0xe8, 0xf8, 0x83, 0x07, 0x20, 0xbd, 0xe8, + 0xf8, 0x83, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, 0x48, 0xb5, 0x08, 0x00, + 0x80, 0x9b, 0x08, 0x00, 0x04, 0x48, 0x05, 0x49, 0x01, 0x60, 0x05, 0x48, + 0x05, 0x49, 0x01, 0x60, 0x05, 0x48, 0x06, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x50, 0xce, 0x08, 0x00, 0x65, 0xb5, 0x03, 0x00, 0xc0, 0xc6, 0x08, 0x00, + 0x19, 0xb5, 0x03, 0x00, 0x5c, 0xb9, 0x08, 0x00, 0xa1, 0xb5, 0x03, 0x00, + 0x4a, 0xf6, 0x21, 0x4c, 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x7f, 0xb5, 0x04, 0x46, 0x00, 0x20, 0x8d, 0xf8, 0x05, 0x10, 0xad, 0xf8, + 0x0c, 0x00, 0x94, 0xf8, 0x2d, 0x03, 0x94, 0xf8, 0x35, 0x31, 0x04, 0xf2, + 0x2d, 0x35, 0x12, 0x28, 0x8d, 0xf8, 0x06, 0x30, 0x8d, 0xf8, 0x04, 0x00, + 0x0d, 0xd8, 0xdf, 0xe8, 0x00, 0xf0, 0x20, 0x1a, 0x33, 0x33, 0x33, 0x0a, + 0x22, 0x24, 0x26, 0x33, 0x28, 0x1a, 0x33, 0x33, 0x33, 0x0a, 0x2a, 0x0a, + 0x0a, 0x00, 0x5b, 0x48, 0x20, 0xe0, 0x82, 0x38, 0x0c, 0x28, 0x23, 0xd8, + 0xdf, 0xe8, 0x00, 0xf0, 0x07, 0x0b, 0x0d, 0x22, 0x22, 0x22, 0x22, 0x1b, + 0x22, 0x22, 0x07, 0x0b, 0x0d, 0x00, 0x57, 0x48, 0x12, 0xe0, 0x57, 0x48, + 0x10, 0xe0, 0x54, 0x48, 0x0e, 0xe0, 0x52, 0x48, 0x0c, 0xe0, 0x55, 0x48, + 0x0a, 0xe0, 0x4b, 0x48, 0x08, 0xe0, 0x4d, 0x48, 0x06, 0xe0, 0x4b, 0x48, + 0x04, 0xe0, 0x47, 0x48, 0x02, 0xe0, 0x45, 0x48, 0x00, 0xe0, 0x47, 0x48, + 0x06, 0x68, 0x03, 0xa8, 0x2b, 0x46, 0x00, 0x90, 0x20, 0x46, 0xb0, 0x47, + 0xd4, 0xf8, 0x34, 0x03, 0x01, 0x07, 0x12, 0xd5, 0x95, 0xf9, 0x00, 0x10, + 0xb1, 0xf1, 0xff, 0x3f, 0x1b, 0xdd, 0x48, 0x48, 0x94, 0xf8, 0x39, 0x20, + 0x02, 0x21, 0xc0, 0x23, 0x06, 0x68, 0x20, 0x46, 0xb0, 0x47, 0xd4, 0xf8, + 0x34, 0x03, 0x20, 0xf0, 0x08, 0x00, 0xc4, 0xf8, 0x34, 0x03, 0xd4, 0xf8, + 0xd4, 0x20, 0x94, 0xf8, 0x2d, 0x13, 0x52, 0x7f, 0x59, 0xb9, 0x00, 0x21, + 0x00, 0x2a, 0x14, 0xbf, 0x84, 0xf8, 0x3c, 0x13, 0x84, 0xf8, 0x3b, 0x13, + 0x12, 0xe0, 0xd4, 0xf8, 0xd4, 0x20, 0xc9, 0xb2, 0x52, 0x7f, 0x00, 0x2a, + 0x4f, 0xf0, 0x03, 0x02, 0x14, 0xbf, 0x84, 0xf8, 0x3c, 0x23, 0x84, 0xf8, + 0x3b, 0x23, 0x10, 0x29, 0x2d, 0xd8, 0x01, 0x22, 0x33, 0x4b, 0x8a, 0x40, + 0x1a, 0x42, 0x28, 0xd0, 0x20, 0xf0, 0x40, 0x00, 0x0f, 0x29, 0xc4, 0xf8, + 0x34, 0x03, 0x01, 0xd0, 0x05, 0x29, 0x02, 0xd1, 0x40, 0xf4, 0x00, 0x60, + 0x01, 0xe0, 0x20, 0xf4, 0x00, 0x60, 0xc4, 0xf8, 0x34, 0x03, 0x9d, 0xf8, + 0x0d, 0x00, 0x02, 0x28, 0x03, 0xd0, 0x01, 0x28, 0x07, 0xd1, 0x29, 0x48, + 0x00, 0xe0, 0x27, 0x48, 0x02, 0x68, 0x9d, 0xf8, 0x0c, 0x10, 0x20, 0x46, + 0x90, 0x47, 0x28, 0x78, 0x78, 0xb9, 0x9d, 0xf8, 0x04, 0x00, 0x58, 0xb1, + 0x23, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x94, 0xf8, 0x2d, 0x03, + 0x05, 0xe0, 0x83, 0x29, 0xd4, 0xd0, 0x40, 0xf0, 0x40, 0x00, 0xd3, 0xe7, + 0x00, 0x20, 0x8d, 0xf8, 0x07, 0x00, 0xd4, 0xf8, 0x88, 0x00, 0x01, 0xaa, + 0x00, 0x21, 0x05, 0x23, 0x00, 0x25, 0xc0, 0xf3, 0x41, 0x40, 0x8d, 0xf8, + 0x08, 0x00, 0x18, 0x48, 0x04, 0x68, 0x40, 0xf2, 0x05, 0x20, 0xa0, 0x47, + 0x9d, 0xf8, 0x0d, 0x10, 0x9d, 0xf8, 0x0c, 0x00, 0x00, 0x29, 0x18, 0xbf, + 0x28, 0x46, 0xc0, 0xb2, 0x04, 0xb0, 0x70, 0xbd, 0xf8, 0xc3, 0x08, 0x00, + 0xf4, 0xc3, 0x08, 0x00, 0xf0, 0xc3, 0x08, 0x00, 0xec, 0xc3, 0x08, 0x00, + 0xe8, 0xc3, 0x08, 0x00, 0xe4, 0xc3, 0x08, 0x00, 0xe0, 0xc3, 0x08, 0x00, + 0xdc, 0xc3, 0x08, 0x00, 0xd8, 0xc3, 0x08, 0x00, 0xd4, 0xc3, 0x08, 0x00, + 0xd0, 0xc3, 0x08, 0x00, 0xcc, 0xc3, 0x08, 0x00, 0x98, 0x9b, 0x08, 0x00, + 0x83, 0x04, 0x01, 0x00, 0x40, 0xc3, 0x08, 0x00, 0x38, 0xc7, 0x08, 0x00, + 0x10, 0xb5, 0x08, 0x00, 0x78, 0x9b, 0x08, 0x00, 0xf0, 0xb5, 0x85, 0xb0, + 0x40, 0x4f, 0x04, 0x46, 0x38, 0x68, 0x04, 0x90, 0x3f, 0x48, 0x00, 0x78, + 0xc0, 0x07, 0x01, 0xd1, 0x1a, 0x20, 0x6e, 0xe0, 0x3d, 0x48, 0x0d, 0x46, + 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x40, 0xb1, 0x3b, 0x48, 0x21, 0x46, + 0x2a, 0x46, 0x01, 0x23, 0x06, 0x68, 0x8b, 0x20, 0xb0, 0x47, 0x24, 0x20, + 0x5f, 0xe0, 0x38, 0x48, 0x10, 0x21, 0x00, 0x22, 0x03, 0x68, 0x20, 0x46, + 0x98, 0x47, 0x01, 0x20, 0x10, 0x21, 0x84, 0xf8, 0x22, 0x01, 0x04, 0xf5, + 0x1a, 0x70, 0xe8, 0xf7, 0xf9, 0xf9, 0xe5, 0xf7, 0xa9, 0xfb, 0xc4, 0xf8, + 0x7c, 0x02, 0x25, 0xb9, 0x00, 0x20, 0x4f, 0xf4, 0xb4, 0x71, 0xe5, 0xf7, + 0x95, 0xfb, 0x2d, 0x4e, 0xd4, 0xf8, 0x80, 0x02, 0x05, 0xf1, 0x0f, 0x01, + 0x08, 0x22, 0x33, 0x68, 0x0c, 0x30, 0x98, 0x47, 0x04, 0xf5, 0x8c, 0x70, + 0x05, 0xf1, 0x17, 0x02, 0x08, 0x21, 0x04, 0x23, 0xe5, 0xf7, 0x96, 0xfb, + 0x25, 0x48, 0x6d, 0x46, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, 0xd4, 0xf8, + 0x80, 0x02, 0x33, 0x68, 0x29, 0x46, 0x08, 0x22, 0x04, 0x30, 0x98, 0x47, + 0x05, 0xf1, 0x08, 0x06, 0x04, 0xf5, 0x8e, 0x70, 0x04, 0x21, 0x04, 0x23, + 0x32, 0x46, 0xe5, 0xf7, 0x81, 0xfb, 0x1c, 0x48, 0x29, 0x46, 0x32, 0x46, + 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x94, 0xf8, 0x2d, 0x03, 0x06, 0x28, + 0x03, 0xd1, 0x18, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x17, 0x48, + 0xc0, 0x79, 0x80, 0x06, 0x03, 0xd5, 0x16, 0x48, 0x00, 0x78, 0xc0, 0x06, + 0x01, 0xd4, 0x06, 0x20, 0x09, 0xe0, 0x14, 0x49, 0x94, 0xf8, 0x35, 0x01, + 0x0b, 0x68, 0xd4, 0xf8, 0x80, 0x12, 0x8a, 0x8d, 0x24, 0x31, 0x98, 0x47, + 0x00, 0x20, 0x39, 0x68, 0x04, 0x9a, 0x89, 0x1a, 0x04, 0xbf, 0x05, 0xb0, + 0xf0, 0xbd, 0xeb, 0xf7, 0x95, 0xf9, 0x00, 0xbf, 0x38, 0xec, 0x01, 0x00, + 0x70, 0x52, 0x01, 0x00, 0x88, 0xc6, 0x08, 0x00, 0x80, 0x9b, 0x08, 0x00, + 0xc0, 0x9b, 0x08, 0x00, 0x10, 0x9e, 0x08, 0x00, 0xd8, 0x9b, 0x08, 0x00, + 0x80, 0xc6, 0x08, 0x00, 0x0c, 0x9e, 0x08, 0x00, 0xc8, 0x52, 0x01, 0x00, + 0x78, 0x52, 0x01, 0x00, 0x10, 0xc6, 0x08, 0x00, 0x03, 0x48, 0x04, 0x49, + 0x01, 0x60, 0x04, 0x48, 0x04, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0xb8, 0xc3, 0x08, 0x00, 0x6d, 0xb8, 0x03, 0x00, 0xec, 0xc7, 0x08, 0x00, + 0x91, 0xb6, 0x03, 0x00, 0x06, 0x49, 0x4f, 0xf4, 0xa8, 0x72, 0x09, 0x68, + 0x10, 0xfb, 0x02, 0x11, 0x91, 0xf9, 0x62, 0x10, 0x00, 0x29, 0x01, 0xd4, + 0x00, 0xf0, 0x0c, 0xb8, 0x70, 0x47, 0x00, 0xbf, 0xdc, 0x35, 0x01, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, 0x04, 0xc7, 0x08, 0x00, + 0xc5, 0xb9, 0x03, 0x00, 0x48, 0xf2, 0x8d, 0x6c, 0xc1, 0xf2, 0x08, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x73, 0x48, 0x00, 0x21, 0x01, 0x70, 0x71, 0x48, + 0x4f, 0xf0, 0xff, 0x31, 0x01, 0x60, 0x70, 0x47, 0xf8, 0xb5, 0x00, 0x28, + 0x41, 0xd0, 0x04, 0x46, 0xd0, 0xf8, 0x00, 0x01, 0xe8, 0xb3, 0x68, 0x49, + 0x0a, 0x7b, 0xd2, 0x07, 0x39, 0xd0, 0xb5, 0x4b, 0x4a, 0x7b, 0x1b, 0x78, + 0x93, 0x42, 0x34, 0xd9, 0x64, 0x4b, 0x1b, 0x78, 0x01, 0x2b, 0x30, 0xd0, + 0x63, 0x4b, 0x1b, 0x78, 0x01, 0x2b, 0x2c, 0xd0, 0x90, 0xf8, 0x35, 0x31, + 0x99, 0x4d, 0x68, 0x26, 0x13, 0xfb, 0x06, 0x53, 0x24, 0x4e, 0x5b, 0x79, + 0x36, 0x78, 0x16, 0xb1, 0x02, 0x2b, 0x02, 0xd1, 0x1f, 0xe0, 0x01, 0x2b, + 0x1d, 0xd1, 0x90, 0xf8, 0x4e, 0x33, 0x9b, 0x07, 0x03, 0xd5, 0xa3, 0x4b, + 0x1b, 0x79, 0x9b, 0x07, 0x03, 0xd4, 0x94, 0xf8, 0x40, 0x31, 0x93, 0x42, + 0x11, 0xd3, 0x94, 0xf8, 0x46, 0x21, 0x72, 0xb1, 0x94, 0xf8, 0x20, 0x31, + 0x94, 0xf8, 0x47, 0x61, 0x89, 0x7b, 0xb3, 0xfb, 0xf2, 0xf7, 0x01, 0x3a, + 0x12, 0xfb, 0x07, 0xf2, 0xd2, 0x43, 0x16, 0xfb, 0x03, 0x22, 0x8a, 0x42, + 0x00, 0xda, 0xf8, 0xbd, 0x94, 0xf8, 0x4a, 0x21, 0x21, 0x46, 0x40, 0x23, + 0x04, 0x26, 0x04, 0x2a, 0x28, 0xbf, 0x32, 0x46, 0x00, 0xf0, 0x1a, 0xf8, + 0xd4, 0xf8, 0x00, 0x01, 0x68, 0x21, 0x90, 0xf8, 0x35, 0x01, 0x10, 0xfb, + 0x01, 0x50, 0x01, 0x21, 0x01, 0x71, 0x94, 0xf8, 0x4a, 0x11, 0x04, 0x29, + 0x38, 0xbf, 0x0e, 0x46, 0x00, 0xeb, 0xc6, 0x00, 0x00, 0x21, 0x41, 0x81, + 0x01, 0x81, 0xc1, 0x80, 0xbd, 0xe8, 0xf8, 0x40, 0x00, 0xf0, 0x4a, 0xb8, + 0xe0, 0x0e, 0x01, 0x00, 0xbf, 0xb5, 0x00, 0x24, 0xad, 0xf8, 0x06, 0x30, + 0x8d, 0xf8, 0x04, 0x40, 0x33, 0x4c, 0x64, 0x7b, 0x8d, 0xf8, 0x0c, 0x40, + 0x7f, 0x4c, 0x65, 0x7a, 0xed, 0x07, 0x01, 0xd1, 0x7e, 0x4c, 0x05, 0xe0, + 0x15, 0x46, 0x04, 0x2a, 0x28, 0xbf, 0x04, 0x25, 0x2c, 0x44, 0x0a, 0x34, + 0x24, 0x78, 0x8d, 0xf8, 0x0b, 0x40, 0x90, 0xf8, 0x35, 0x41, 0x8d, 0xf8, + 0x08, 0x40, 0x90, 0xf8, 0x4e, 0x43, 0xa4, 0x07, 0x51, 0xbf, 0x00, 0x24, + 0x72, 0x4c, 0x24, 0x79, 0xc4, 0xf3, 0x40, 0x04, 0x8d, 0xf8, 0x09, 0x20, + 0x00, 0xeb, 0xc2, 0x02, 0x8d, 0xf8, 0x0d, 0x40, 0x92, 0xf8, 0xbc, 0x23, + 0x8d, 0xf8, 0x0a, 0x20, 0x1a, 0x06, 0x01, 0xea, 0xe2, 0x71, 0x00, 0xf0, + 0x45, 0xf8, 0x8d, 0xf8, 0x0e, 0x00, 0x04, 0x48, 0x01, 0xaa, 0x00, 0x21, + 0x0c, 0x23, 0x04, 0x68, 0x40, 0xf2, 0x42, 0x20, 0xa0, 0x47, 0xbf, 0xbd, + 0x78, 0x9b, 0x08, 0x00, 0x00, 0x21, 0x81, 0x80, 0x41, 0x80, 0x01, 0x80, + 0x70, 0x47, 0x00, 0xbf, 0x7c, 0xb5, 0x12, 0x4c, 0x20, 0x7b, 0xc0, 0x07, + 0x1f, 0xd0, 0x5f, 0x49, 0x60, 0x7b, 0x09, 0x78, 0x81, 0x42, 0x1a, 0xd9, + 0x0e, 0x48, 0x00, 0x78, 0x01, 0x28, 0x16, 0xd0, 0x0d, 0x48, 0x00, 0x78, + 0x01, 0x28, 0x12, 0xd0, 0x0c, 0x4d, 0x28, 0x68, 0x01, 0x30, 0x0e, 0xd1, + 0x0b, 0x48, 0x00, 0x26, 0x06, 0x70, 0xe5, 0xf7, 0x35, 0xfa, 0x28, 0x60, + 0x09, 0x48, 0x22, 0x8b, 0x00, 0x21, 0xcd, 0xe9, 0x00, 0x66, 0x05, 0x68, + 0x2b, 0x20, 0x13, 0x46, 0xa8, 0x47, 0x7c, 0xbd, 0x30, 0x32, 0x06, 0x00, + 0x54, 0x34, 0x01, 0x00, 0x63, 0x34, 0x01, 0x00, 0x50, 0xd3, 0x05, 0x00, + 0x2c, 0xe6, 0x05, 0x00, 0xcc, 0x9b, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x47, + 0x70, 0xb3, 0xdf, 0xf8, 0x68, 0x80, 0x05, 0x46, 0x98, 0xf8, 0x00, 0x00, + 0x40, 0xb3, 0x18, 0x4f, 0xdf, 0xf8, 0x60, 0xa0, 0x0c, 0x46, 0x00, 0x26, + 0x4f, 0xf0, 0x00, 0x09, 0x57, 0xf8, 0x26, 0x10, 0x99, 0xb1, 0x0c, 0xb1, + 0xa1, 0x42, 0x17, 0xd0, 0xd1, 0xf8, 0x00, 0x21, 0xaa, 0x42, 0x13, 0xd1, + 0x91, 0xf8, 0x1d, 0x11, 0xda, 0xf8, 0x00, 0x20, 0xc1, 0xeb, 0x01, 0x11, + 0x49, 0x01, 0x51, 0x5c, 0x02, 0x29, 0x38, 0xbf, 0x09, 0xf1, 0x01, 0x09, + 0x06, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x05, 0x21, 0xeb, 0xf7, 0x48, 0xf8, + 0x98, 0xf8, 0x00, 0x00, 0x01, 0x36, 0x86, 0x42, 0xde, 0xd3, 0x01, 0xe0, + 0x4f, 0xf0, 0x00, 0x09, 0x5f, 0xfa, 0x89, 0xf0, 0xbd, 0xe8, 0xf0, 0x87, + 0xd4, 0x58, 0x01, 0x00, 0x14, 0x58, 0x01, 0x00, 0xe0, 0x35, 0x01, 0x00, + 0x70, 0xb5, 0xd8, 0xb1, 0xd0, 0xf8, 0x00, 0x41, 0x05, 0x46, 0xbc, 0xb1, + 0x94, 0xf8, 0x35, 0x01, 0x11, 0x4e, 0x68, 0x21, 0x10, 0xfb, 0x01, 0x60, + 0x00, 0x79, 0x01, 0x28, 0x0e, 0xd1, 0x95, 0xf8, 0x4a, 0x21, 0x20, 0x46, + 0x29, 0x46, 0x80, 0x23, 0x04, 0x2a, 0x28, 0xbf, 0x04, 0x22, 0xff, 0xf7, + 0x2f, 0xff, 0x20, 0x46, 0x29, 0x46, 0xff, 0xf7, 0xa5, 0xff, 0x00, 0xb1, + 0x70, 0xbd, 0x94, 0xf8, 0x35, 0x01, 0x68, 0x21, 0x10, 0xfb, 0x01, 0x60, + 0x00, 0x21, 0x01, 0x71, 0x20, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, + 0x03, 0xb8, 0x00, 0xbf, 0xb0, 0xe6, 0x05, 0x00, 0x0f, 0x4a, 0x0e, 0x49, + 0x13, 0x68, 0x90, 0xf8, 0x4e, 0x23, 0x01, 0xf5, 0x6b, 0x71, 0x92, 0x07, + 0x10, 0xd5, 0x0c, 0x4a, 0x12, 0x79, 0x92, 0x07, 0x0c, 0xd5, 0x0b, 0x49, + 0x4a, 0x7a, 0xd2, 0x07, 0x01, 0xd1, 0x0a, 0x49, 0x06, 0xe0, 0x90, 0xf8, + 0xf2, 0x22, 0x04, 0x2a, 0x28, 0xbf, 0x04, 0x22, 0x11, 0x44, 0x0a, 0x31, + 0x09, 0x78, 0x01, 0x22, 0x18, 0x47, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, + 0x00, 0x9c, 0x08, 0x00, 0x70, 0x52, 0x01, 0x00, 0xcc, 0x2c, 0x06, 0x00, + 0x6a, 0x34, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x8f, 0xb0, 0xdf, 0xf8, + 0xcc, 0x23, 0x12, 0xf8, 0x0c, 0x0f, 0xc0, 0x07, 0x00, 0xf0, 0xd9, 0x81, + 0xdf, 0xf8, 0xc0, 0x13, 0x50, 0x78, 0x09, 0x78, 0x81, 0x42, 0x40, 0xf2, + 0xd2, 0x81, 0xdf, 0xf8, 0xb8, 0x03, 0x00, 0x78, 0x01, 0x28, 0x00, 0xf0, + 0xcc, 0x81, 0xdf, 0xf8, 0xb0, 0x03, 0x00, 0x78, 0x01, 0x28, 0x00, 0xf0, + 0xc6, 0x81, 0xdf, 0xf8, 0xa8, 0x03, 0x01, 0x78, 0x01, 0x31, 0x01, 0x70, + 0xdf, 0xf8, 0xa0, 0x03, 0x90, 0xf8, 0x00, 0xc0, 0xbc, 0xf1, 0x00, 0x0f, + 0x00, 0xf0, 0xb9, 0x81, 0xe5, 0x4c, 0xdf, 0xf8, 0xa0, 0xa3, 0xdf, 0xf8, + 0xa0, 0x53, 0x0d, 0xae, 0x00, 0x27, 0x4f, 0xf0, 0x00, 0x08, 0x07, 0x92, + 0x20, 0x68, 0x00, 0x28, 0x00, 0xf0, 0xa5, 0x81, 0x90, 0xf8, 0x35, 0x11, + 0xde, 0x4a, 0x68, 0x23, 0x11, 0xfb, 0x03, 0x21, 0x09, 0x79, 0x01, 0x29, + 0x40, 0xf0, 0x9b, 0x81, 0x0a, 0x90, 0x00, 0x20, 0x44, 0x21, 0x8d, 0xf8, + 0x38, 0x00, 0x0d, 0x90, 0xd8, 0x48, 0xe7, 0xf7, 0xd9, 0xfa, 0x9a, 0xf8, + 0x00, 0x00, 0xcd, 0xe9, 0x00, 0x74, 0xcd, 0xf8, 0x08, 0x80, 0x00, 0x28, + 0x6c, 0xd0, 0x07, 0x9c, 0xdd, 0xf8, 0x28, 0xe0, 0x00, 0x21, 0x4f, 0xf0, + 0xff, 0x0b, 0x00, 0x27, 0x4f, 0xf0, 0x7f, 0x08, 0x04, 0x91, 0x55, 0xf8, + 0x27, 0x10, 0x00, 0x29, 0x4b, 0xd0, 0xd1, 0xf8, 0x00, 0x21, 0x72, 0x45, + 0x4f, 0xd1, 0xcd, 0x4a, 0x91, 0xf8, 0x1d, 0x31, 0xc3, 0xeb, 0x03, 0x13, + 0x12, 0x68, 0x5b, 0x01, 0xd2, 0x5c, 0x01, 0x2a, 0x45, 0xd8, 0x91, 0xf8, + 0x1c, 0x21, 0x01, 0x2a, 0x41, 0xd1, 0x91, 0xf8, 0x4a, 0x31, 0x01, 0x22, + 0x91, 0xf8, 0x46, 0xc1, 0x04, 0x25, 0x4f, 0xfa, 0x88, 0xf4, 0x04, 0x2b, + 0x28, 0xbf, 0x2b, 0x46, 0xf2, 0x54, 0x91, 0xf9, 0x42, 0x21, 0x94, 0x42, + 0xa8, 0xbf, 0x90, 0x46, 0x9e, 0xf8, 0xf2, 0x22, 0x04, 0x2a, 0x28, 0xbf, + 0x2a, 0x46, 0x9a, 0x42, 0x04, 0x9a, 0x08, 0xbf, 0x01, 0x22, 0xbc, 0xf1, + 0x00, 0x0f, 0x04, 0x92, 0x27, 0xd0, 0x91, 0xf8, 0x20, 0x31, 0xac, 0xf1, + 0x01, 0x02, 0x91, 0xf8, 0x47, 0xe1, 0x5f, 0xfa, 0x8b, 0xf4, 0xb3, 0xfb, + 0xfc, 0xf5, 0x12, 0xfb, 0x05, 0xf1, 0xc9, 0x43, 0x13, 0xfb, 0x0e, 0x11, + 0xa1, 0x42, 0xde, 0xbf, 0x15, 0xfb, 0x02, 0xf1, 0xc9, 0x43, 0x13, 0xfb, + 0x0e, 0x1b, 0x07, 0x9c, 0xf0, 0x4d, 0xdd, 0xf8, 0x28, 0xe0, 0x01, 0x21, + 0x10, 0xe0, 0x00, 0x20, 0xd1, 0x21, 0xea, 0xf7, 0x2f, 0xff, 0xdd, 0xf8, + 0x28, 0xe0, 0x9a, 0xf8, 0x00, 0x00, 0x01, 0x37, 0x87, 0x42, 0xa4, 0xd3, + 0x0f, 0xe0, 0x01, 0x21, 0x07, 0x9c, 0xe7, 0x4d, 0x4f, 0xf0, 0x00, 0x0b, + 0x02, 0x91, 0xf4, 0xe7, 0x07, 0x9c, 0xdd, 0xf8, 0x28, 0xe0, 0x00, 0x20, + 0x4f, 0xf0, 0x7f, 0x08, 0x4f, 0xf0, 0xff, 0x0b, 0x04, 0x90, 0x4f, 0xfa, + 0x88, 0xf0, 0x0e, 0xf5, 0x6f, 0x75, 0x4f, 0xf0, 0x00, 0x08, 0x4f, 0xf0, + 0x06, 0x0a, 0x4f, 0xf0, 0x00, 0x09, 0x0b, 0xaf, 0xcd, 0xf8, 0x0c, 0xb0, + 0x08, 0x90, 0x00, 0x20, 0x09, 0x95, 0x05, 0x90, 0x00, 0x20, 0x06, 0x90, + 0x16, 0xf8, 0x08, 0x00, 0x00, 0x28, 0x00, 0xf0, 0xcf, 0x80, 0x15, 0xf8, + 0x38, 0x00, 0x61, 0x78, 0x88, 0x42, 0xc0, 0xf0, 0xc9, 0x80, 0x9e, 0xf8, + 0x35, 0x01, 0x68, 0x21, 0x08, 0x23, 0x10, 0xfb, 0x01, 0xa0, 0x85, 0x49, + 0x0a, 0x18, 0x38, 0x46, 0x08, 0x21, 0xe5, 0xf7, 0x9d, 0xf8, 0x7c, 0x48, + 0x09, 0x9d, 0x94, 0xf9, 0x09, 0x20, 0x21, 0x7a, 0x08, 0x9b, 0x15, 0xf8, + 0x38, 0xb0, 0x00, 0x78, 0xa0, 0xeb, 0x0b, 0x00, 0x10, 0xfb, 0x01, 0x22, + 0x9a, 0x42, 0x02, 0xdd, 0x0a, 0x9b, 0x0a, 0x24, 0x52, 0xe0, 0xbd, 0xf8, + 0x2e, 0x20, 0xbd, 0xf8, 0x2c, 0x30, 0x1a, 0x44, 0xbd, 0xf8, 0x30, 0x30, + 0xd7, 0x18, 0xe3, 0x89, 0x9f, 0x42, 0x03, 0xd2, 0xdd, 0xf8, 0x28, 0xe0, + 0x0b, 0xaf, 0x9b, 0xe0, 0x03, 0x9b, 0x94, 0xf8, 0x03, 0xc0, 0xa5, 0x1d, + 0x5f, 0xfa, 0x83, 0xfe, 0x64, 0x23, 0x5a, 0x43, 0xe6, 0x45, 0x38, 0xbf, + 0x25, 0x1d, 0xb2, 0xfb, 0xf7, 0xf2, 0x2d, 0x78, 0xd2, 0xb2, 0xaa, 0x42, + 0x02, 0xd9, 0x0a, 0x9b, 0x12, 0x24, 0x2c, 0xe0, 0xe5, 0x1d, 0xe6, 0x45, + 0x38, 0xbf, 0x65, 0x1d, 0x2b, 0x78, 0x9a, 0x42, 0x1a, 0xd2, 0x10, 0xfb, + 0x01, 0xf0, 0x94, 0xf9, 0x0a, 0x10, 0x08, 0x44, 0x08, 0x99, 0x88, 0x42, + 0x12, 0xda, 0x0a, 0x9b, 0x5f, 0x49, 0x68, 0x22, 0x93, 0xf8, 0x35, 0x01, + 0x10, 0xfb, 0x02, 0x10, 0x00, 0xeb, 0xc8, 0x00, 0x01, 0x7b, 0x01, 0x31, + 0x01, 0x73, 0xc8, 0xb2, 0x21, 0x7c, 0x1c, 0x24, 0x88, 0x42, 0x38, 0xbf, + 0x00, 0x24, 0x0a, 0xe0, 0x0a, 0x9b, 0x56, 0x49, 0x68, 0x22, 0x00, 0x24, + 0x93, 0xf8, 0x35, 0x01, 0x10, 0xfb, 0x02, 0x10, 0x00, 0xeb, 0xc8, 0x00, + 0x04, 0x73, 0x4f, 0xf0, 0x00, 0x09, 0x0b, 0xaf, 0x93, 0xf8, 0x35, 0x01, + 0x4e, 0x49, 0x68, 0x22, 0x10, 0xfb, 0x02, 0x10, 0x00, 0xeb, 0xc8, 0x00, + 0x01, 0x7b, 0x8d, 0xf8, 0x32, 0x10, 0x8c, 0xb3, 0x80, 0xf8, 0x0c, 0x90, + 0xa0, 0x07, 0x0d, 0xd5, 0x4c, 0x48, 0x10, 0xf8, 0x09, 0x1f, 0xc9, 0x07, + 0x40, 0x44, 0x3f, 0x49, 0x18, 0xbf, 0x41, 0x1c, 0x08, 0x78, 0x83, 0x45, + 0x02, 0xd2, 0x0b, 0xf1, 0x01, 0x0b, 0x08, 0xe0, 0x60, 0x07, 0x13, 0xd5, + 0x07, 0x98, 0x40, 0x78, 0x83, 0x45, 0x88, 0xbf, 0xab, 0xf1, 0x01, 0x0b, + 0x0c, 0xd9, 0x18, 0x46, 0x5f, 0xfa, 0x88, 0xf1, 0x5f, 0xfa, 0x8b, 0xf2, + 0x00, 0x23, 0x00, 0xf0, 0x7d, 0xf8, 0x0a, 0x9b, 0x44, 0xf0, 0x01, 0x04, + 0x01, 0x20, 0x05, 0x90, 0x06, 0x9a, 0x5f, 0xfa, 0x8b, 0xf0, 0xd1, 0xb2, + 0x81, 0x42, 0x88, 0xbf, 0x93, 0x46, 0xcd, 0xf8, 0x18, 0xb0, 0x00, 0xe0, + 0x00, 0x24, 0x18, 0x46, 0x5f, 0xfa, 0x88, 0xf1, 0x22, 0x46, 0x3b, 0x46, + 0x00, 0xf0, 0xf0, 0xf8, 0xdd, 0xf8, 0x28, 0xe0, 0x2b, 0x49, 0x68, 0x22, + 0x07, 0x9c, 0x09, 0x9d, 0x9e, 0xf8, 0x35, 0x01, 0x10, 0xfb, 0x02, 0x10, + 0x00, 0xeb, 0xc8, 0x00, 0xa0, 0xf8, 0x0a, 0x90, 0xa0, 0xf8, 0x08, 0x90, + 0xa0, 0xf8, 0x06, 0x90, 0x08, 0xf1, 0x01, 0x08, 0x0a, 0xf1, 0x08, 0x0a, + 0xb8, 0xf1, 0x05, 0x0f, 0x7f, 0xf4, 0x24, 0xaf, 0x05, 0x98, 0xa0, 0xb1, + 0x04, 0x98, 0x00, 0x06, 0x11, 0xd1, 0x06, 0x98, 0xc2, 0xb2, 0x9e, 0xf8, + 0x74, 0x00, 0x90, 0x42, 0x0b, 0xd2, 0x9e, 0xf8, 0xf2, 0x12, 0x04, 0x20, + 0x00, 0x23, 0x04, 0x29, 0x28, 0xbf, 0x01, 0x46, 0x70, 0x46, 0x00, 0xf0, + 0x37, 0xf8, 0xdd, 0xf8, 0x28, 0xe0, 0x08, 0x99, 0x70, 0x46, 0x00, 0xf0, + 0xf3, 0xf8, 0x10, 0x48, 0x01, 0x9c, 0xdf, 0xf8, 0x4c, 0xa0, 0x59, 0x4d, + 0x00, 0x9f, 0xdd, 0xf8, 0x08, 0x80, 0x90, 0xf8, 0x00, 0xc0, 0x01, 0x37, + 0x04, 0x34, 0x67, 0x45, 0xff, 0xf4, 0x52, 0xae, 0x01, 0xe0, 0x4f, 0xf0, + 0x00, 0x08, 0x5f, 0xfa, 0x88, 0xf0, 0x0f, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x30, 0x32, 0x06, 0x00, 0x6a, 0x34, 0x01, 0x00, 0x54, 0x34, 0x01, 0x00, + 0x63, 0x34, 0x01, 0x00, 0x2c, 0xe6, 0x05, 0x00, 0x53, 0x34, 0x01, 0x00, + 0xb8, 0x57, 0x01, 0x00, 0xb0, 0xe6, 0x05, 0x00, 0x30, 0xe6, 0x05, 0x00, + 0xd4, 0x58, 0x01, 0x00, 0x14, 0x58, 0x01, 0x00, 0xe0, 0x35, 0x01, 0x00, + 0xcc, 0x2c, 0x06, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, 0xdf, 0xf8, 0xf8, 0x90, + 0x04, 0x29, 0x4f, 0xf0, 0x04, 0x07, 0x4f, 0xf0, 0x02, 0x0a, 0x14, 0x46, + 0x06, 0x46, 0x8b, 0x46, 0x4f, 0xf0, 0x04, 0x05, 0x38, 0xbf, 0x0f, 0x46, + 0x03, 0x29, 0x88, 0xbf, 0x4f, 0xf0, 0x03, 0x0a, 0x20, 0x46, 0x51, 0x46, + 0xd9, 0xf8, 0x00, 0x20, 0x90, 0x47, 0x06, 0xeb, 0xc7, 0x07, 0x80, 0x46, + 0xd9, 0xf8, 0x00, 0x20, 0x51, 0x46, 0x97, 0xf8, 0xbc, 0x03, 0x90, 0x47, + 0xa8, 0xeb, 0x00, 0x00, 0x97, 0xf8, 0xbc, 0x33, 0x59, 0x46, 0x83, 0x22, + 0x00, 0x94, 0x87, 0xf8, 0xbc, 0x43, 0x87, 0xf8, 0xbf, 0x03, 0x30, 0x46, + 0x14, 0xf0, 0x06, 0xfe, 0x96, 0xf8, 0xf2, 0x02, 0x04, 0x28, 0x38, 0xbf, + 0x05, 0x46, 0x5d, 0x45, 0x0d, 0xd1, 0x00, 0x99, 0x07, 0xf5, 0x6f, 0x70, + 0x00, 0x78, 0x86, 0xf8, 0x74, 0x10, 0x22, 0x49, 0x0a, 0x68, 0x51, 0x46, + 0x90, 0x47, 0x06, 0xeb, 0x4a, 0x01, 0xa1, 0xf8, 0x78, 0x00, 0x1f, 0x4c, + 0x20, 0x78, 0xa0, 0xb3, 0x1e, 0x4d, 0xdf, 0xf8, 0x7c, 0x90, 0x00, 0x27, + 0x55, 0xf8, 0x27, 0x80, 0xb8, 0xf1, 0x00, 0x0f, 0x22, 0xd0, 0xd8, 0xf8, + 0x00, 0x01, 0xb0, 0x42, 0x23, 0xd1, 0x98, 0xf8, 0x1d, 0x11, 0xd9, 0xf8, + 0x00, 0x00, 0xc1, 0xeb, 0x01, 0x11, 0x49, 0x01, 0x40, 0x5c, 0x01, 0x28, + 0x19, 0xd8, 0x98, 0xf8, 0x1c, 0x01, 0x01, 0x28, 0x15, 0xd1, 0x98, 0xf8, + 0x4a, 0x01, 0x04, 0x28, 0x28, 0xbf, 0x04, 0x20, 0x58, 0x45, 0x0e, 0xd1, + 0x0a, 0x49, 0x00, 0x98, 0x0a, 0x68, 0x51, 0x46, 0x88, 0xf8, 0x40, 0x01, + 0x90, 0x47, 0x88, 0xf8, 0x41, 0x01, 0x04, 0xe0, 0x00, 0x20, 0x40, 0xf2, + 0xa7, 0x11, 0xea, 0xf7, 0x63, 0xfd, 0x20, 0x78, 0x01, 0x37, 0x87, 0x42, + 0xce, 0xd3, 0xbd, 0xe8, 0xf8, 0x8f, 0x00, 0xbf, 0x34, 0x9c, 0x08, 0x00, + 0x38, 0x9c, 0x08, 0x00, 0xd4, 0x58, 0x01, 0x00, 0x14, 0x58, 0x01, 0x00, + 0xe0, 0x35, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x47, 0x81, 0x46, 0x98, 0x46, + 0x14, 0x46, 0x0e, 0x46, 0xd0, 0x07, 0x03, 0xd1, 0x16, 0x48, 0x90, 0xf8, + 0x72, 0x01, 0x30, 0xb3, 0x26, 0x4f, 0xfd, 0x79, 0x07, 0xf1, 0x02, 0x0a, + 0x68, 0x1c, 0x05, 0x2d, 0xf8, 0x71, 0x04, 0xd3, 0x00, 0x20, 0x40, 0xf2, + 0x87, 0x21, 0xe4, 0xf7, 0xd7, 0xfe, 0x05, 0xeb, 0x45, 0x00, 0x04, 0x2e, + 0x42, 0x46, 0x4f, 0xf0, 0x08, 0x03, 0x07, 0xeb, 0x80, 0x00, 0x06, 0x72, + 0x44, 0x81, 0x28, 0xbf, 0x04, 0x26, 0x09, 0xeb, 0xc6, 0x01, 0x91, 0xf8, + 0xbc, 0x13, 0x41, 0x72, 0x0c, 0x30, 0x08, 0x21, 0xe4, 0xf7, 0xd4, 0xfe, + 0xba, 0xf8, 0x00, 0x00, 0x20, 0x43, 0xaa, 0xf8, 0x00, 0x00, 0xbd, 0xe8, + 0xf0, 0x87, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, 0x10, 0xb5, 0x10, 0x4a, + 0xd3, 0x79, 0xe3, 0xb1, 0x91, 0x71, 0x0f, 0x49, 0x01, 0x24, 0x14, 0x70, + 0x09, 0x78, 0x51, 0x70, 0x90, 0xf8, 0x35, 0x11, 0x90, 0xf8, 0xf2, 0x02, + 0x11, 0x71, 0x04, 0x28, 0x28, 0xbf, 0x04, 0x20, 0x50, 0x71, 0x08, 0x21, + 0x03, 0xeb, 0x43, 0x00, 0x01, 0xeb, 0x80, 0x03, 0x06, 0x48, 0x00, 0x21, + 0xd0, 0xf8, 0x00, 0xc0, 0x40, 0xf2, 0x42, 0x20, 0xbd, 0xe8, 0x10, 0x40, + 0x60, 0x47, 0x10, 0xbd, 0x30, 0xe6, 0x05, 0x00, 0x2c, 0xe6, 0x05, 0x00, + 0x78, 0x9b, 0x08, 0x00, 0x7c, 0xb5, 0x40, 0x4c, 0x20, 0x7b, 0xc0, 0x07, + 0x1d, 0xd0, 0x3f, 0x49, 0x60, 0x7b, 0x09, 0x78, 0x81, 0x42, 0x18, 0xd9, + 0x3d, 0x48, 0x00, 0x78, 0x01, 0x28, 0x14, 0xd0, 0x3c, 0x48, 0x00, 0x78, + 0x01, 0x28, 0x10, 0xd0, 0xe4, 0xf7, 0x88, 0xfe, 0x3a, 0x4d, 0x22, 0x8b, + 0x00, 0x21, 0x28, 0x60, 0x26, 0x48, 0x13, 0x46, 0x06, 0x68, 0x00, 0x20, + 0xcd, 0xe9, 0x00, 0x00, 0x2b, 0x20, 0xb0, 0x47, 0xff, 0xf7, 0xf0, 0xfc, + 0x00, 0xb1, 0x7c, 0xbd, 0x4f, 0xf0, 0xff, 0x30, 0x00, 0x21, 0x28, 0x60, + 0x2b, 0x20, 0xbd, 0xe8, 0x7c, 0x40, 0xea, 0xf7, 0xcb, 0xbc, 0x00, 0xbf, + 0xbc, 0xb5, 0x29, 0x4c, 0x20, 0x7b, 0xc0, 0x07, 0x2d, 0xd0, 0x28, 0x49, + 0x60, 0x7b, 0x09, 0x78, 0x81, 0x42, 0x28, 0xd9, 0x26, 0x48, 0x00, 0x78, + 0x01, 0x28, 0x24, 0xd0, 0x25, 0x48, 0x00, 0x78, 0x01, 0x28, 0x20, 0xd0, + 0x24, 0x4d, 0x28, 0x68, 0x01, 0x30, 0x1c, 0xd0, 0xe4, 0xf7, 0x56, 0xfe, + 0x29, 0x68, 0x0a, 0x22, 0x08, 0x1a, 0x21, 0x8b, 0x49, 0x01, 0xb1, 0xfb, + 0xf2, 0xf1, 0x08, 0x44, 0x01, 0x01, 0x11, 0xd4, 0x0a, 0x49, 0x20, 0xf0, + 0x70, 0x40, 0x00, 0xeb, 0x80, 0x00, 0x0c, 0x68, 0x00, 0x21, 0x40, 0x00, + 0xcd, 0xe9, 0x00, 0x11, 0x01, 0x21, 0x01, 0xeb, 0x50, 0x12, 0x2b, 0x20, + 0x00, 0x21, 0x13, 0x46, 0xa0, 0x47, 0xbc, 0xbd, 0xbd, 0xe8, 0xbc, 0x40, + 0xff, 0xf7, 0x9a, 0xbf, 0xcc, 0x9b, 0x08, 0x00, 0x0c, 0x48, 0x01, 0x7b, + 0xc9, 0x07, 0x14, 0xd0, 0x0b, 0x49, 0x40, 0x7b, 0x09, 0x78, 0x81, 0x42, + 0x0f, 0xd9, 0x0a, 0x48, 0x00, 0x78, 0x01, 0x28, 0x0b, 0xd0, 0x09, 0x48, + 0x00, 0x78, 0x01, 0x28, 0x07, 0xd0, 0x08, 0x48, 0x00, 0x68, 0x01, 0x30, + 0x03, 0xd0, 0x2b, 0x20, 0x00, 0x21, 0xea, 0xf7, 0x77, 0xbc, 0x70, 0x47, + 0x30, 0x32, 0x06, 0x00, 0x6a, 0x34, 0x01, 0x00, 0x54, 0x34, 0x01, 0x00, + 0x63, 0x34, 0x01, 0x00, 0x50, 0xd3, 0x05, 0x00, 0xfe, 0xb5, 0x0c, 0x46, + 0x45, 0x28, 0x29, 0xd1, 0x25, 0x68, 0x3d, 0xb3, 0x95, 0xf8, 0x35, 0x11, + 0x15, 0x4b, 0x68, 0x26, 0x11, 0xfb, 0x06, 0x33, 0x1b, 0x79, 0x01, 0x2b, + 0x1e, 0xd1, 0x13, 0x48, 0xb5, 0xf8, 0xdc, 0x72, 0x95, 0xf8, 0xec, 0x32, + 0xb5, 0xf8, 0xe4, 0x62, 0xd0, 0xf8, 0x00, 0xc0, 0xd5, 0xf8, 0xd4, 0x00, + 0x42, 0x7f, 0xb5, 0xf8, 0xda, 0x02, 0xcd, 0xe9, 0x00, 0x07, 0x10, 0x20, + 0x02, 0x96, 0xe0, 0x47, 0x0a, 0x48, 0x95, 0xf8, 0xf2, 0x12, 0x02, 0x68, + 0x28, 0x46, 0x90, 0x47, 0xe0, 0x7e, 0x00, 0xf0, 0xfb, 0x00, 0xe0, 0x76, + 0x00, 0x20, 0xfe, 0xbd, 0x21, 0x46, 0x03, 0xb0, 0xbd, 0xe8, 0xf0, 0x40, + 0x00, 0xf0, 0x0e, 0xb8, 0xb0, 0xe6, 0x05, 0x00, 0x10, 0xbb, 0x08, 0x00, + 0x98, 0xc4, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x48, 0xcc, 0x08, 0x00, 0xf5, 0xc3, 0x03, 0x00, 0x46, 0xf6, 0x49, 0x3c, + 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x2d, 0xe9, 0xf0, 0x47, + 0xa0, 0xb3, 0x20, 0x4b, 0xdf, 0xf8, 0x80, 0xc0, 0x00, 0x26, 0x02, 0x27, + 0x4f, 0xf0, 0x04, 0x0e, 0x4f, 0xf0, 0x00, 0x08, 0x4f, 0xf0, 0x00, 0x0a, + 0x93, 0xf9, 0xcc, 0x90, 0x00, 0x23, 0x00, 0xeb, 0xd6, 0x05, 0x06, 0xf0, + 0x07, 0x04, 0x95, 0xf8, 0x8a, 0x52, 0x25, 0xfa, 0x04, 0xf4, 0xe4, 0x07, + 0x13, 0xd0, 0x3d, 0x46, 0x0b, 0x2e, 0x28, 0xbf, 0x0e, 0xeb, 0x43, 0x05, + 0x5c, 0xfa, 0x85, 0xf4, 0x94, 0xf9, 0x01, 0x40, 0x4c, 0x45, 0x05, 0xdc, + 0xec, 0xb2, 0x64, 0x44, 0x94, 0xf9, 0x02, 0x40, 0x4c, 0x45, 0x04, 0xdd, + 0x0a, 0xf1, 0x01, 0x0a, 0x01, 0xe0, 0x08, 0xf1, 0x01, 0x08, 0x01, 0x36, + 0x02, 0x37, 0x01, 0x33, 0x25, 0x2e, 0xda, 0xd1, 0x01, 0x20, 0x04, 0xe0, + 0x00, 0x20, 0x4f, 0xf0, 0xff, 0x08, 0x4f, 0xf0, 0xff, 0x0a, 0x81, 0xf8, + 0x00, 0x80, 0x82, 0xf8, 0x00, 0xa0, 0xbd, 0xe8, 0xf0, 0x87, 0x00, 0xbf, + 0xe8, 0x65, 0x08, 0x00, 0x30, 0x69, 0x01, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0xb4, 0xbf, 0x08, 0x00, 0x85, 0xc4, 0x03, 0x00, + 0x2d, 0xe9, 0xfc, 0x41, 0x31, 0x48, 0x34, 0x4d, 0x81, 0x69, 0x01, 0x31, + 0x81, 0x61, 0x30, 0x48, 0x30, 0x49, 0x00, 0x78, 0x00, 0xeb, 0x00, 0x10, + 0x01, 0xeb, 0xc0, 0x00, 0x4f, 0xf4, 0xa8, 0x71, 0x90, 0xf8, 0x74, 0x40, + 0x28, 0x68, 0x14, 0xfb, 0x01, 0x01, 0x91, 0xf8, 0x54, 0x10, 0x01, 0x29, + 0x49, 0xd1, 0x2a, 0x49, 0x09, 0x68, 0x0a, 0x01, 0x58, 0xbf, 0x5f, 0xea, + 0x41, 0x11, 0x19, 0xd5, 0x4f, 0xf4, 0xa8, 0x77, 0x14, 0xfb, 0x07, 0x00, + 0x90, 0xf8, 0x55, 0x00, 0x01, 0x28, 0x11, 0xd0, 0x23, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x23, 0x4e, 0x30, 0x60, 0x28, 0x68, 0x14, 0xfb, 0x07, 0x01, + 0x91, 0xf8, 0x56, 0x00, 0x01, 0xf1, 0x59, 0x02, 0x1f, 0x49, 0x0b, 0x68, + 0x0d, 0xf1, 0x07, 0x01, 0x98, 0x47, 0x18, 0xb1, 0x00, 0xf0, 0x6a, 0xf8, + 0xbd, 0xe8, 0xfc, 0x81, 0x1b, 0x4f, 0xb9, 0x68, 0x00, 0x29, 0xf7, 0xd0, + 0x32, 0x68, 0x08, 0x68, 0x16, 0x1d, 0x80, 0x1b, 0x00, 0x01, 0x0f, 0xd5, + 0x18, 0x4a, 0xdf, 0xf8, 0x5c, 0x80, 0xd8, 0xf8, 0x18, 0x00, 0x12, 0x68, + 0x90, 0x47, 0xb8, 0x68, 0x26, 0xf0, 0x70, 0x41, 0x01, 0x60, 0x14, 0x49, + 0x0a, 0x68, 0xd8, 0xf8, 0x18, 0x10, 0x90, 0x47, 0x28, 0x68, 0x4f, 0xf4, + 0xa8, 0x71, 0x14, 0xfb, 0x01, 0x00, 0x9d, 0xf8, 0x07, 0x10, 0x80, 0xf8, + 0x57, 0x10, 0x80, 0xf8, 0x56, 0x10, 0x00, 0x20, 0xbd, 0xe8, 0xfc, 0x81, + 0x84, 0xf0, 0x05, 0x00, 0x74, 0x87, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, + 0xdc, 0x35, 0x01, 0x00, 0x40, 0x36, 0x01, 0x00, 0x14, 0xd9, 0x08, 0x00, + 0x54, 0xd3, 0x05, 0x00, 0x80, 0xba, 0x08, 0x00, 0xa8, 0x56, 0x01, 0x00, + 0xfc, 0x73, 0x01, 0x00, 0xe8, 0xa0, 0x08, 0x00, 0xc4, 0xa0, 0x08, 0x00, + 0x80, 0xb5, 0x03, 0x48, 0x00, 0x68, 0x80, 0x47, 0xbd, 0xe8, 0x80, 0x40, + 0xff, 0xf7, 0x7a, 0xbf, 0xb4, 0xd2, 0x08, 0x00, 0x06, 0x48, 0x07, 0x49, + 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, + 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0xe4, 0xbc, 0x08, 0x00, 0x9c, 0xc6, 0x03, 0x00, 0xec, 0xbc, 0x08, 0x00, + 0x7c, 0xc6, 0x03, 0x00, 0xe8, 0xbc, 0x08, 0x00, 0xbc, 0xc6, 0x03, 0x00, + 0xf0, 0xbc, 0x08, 0x00, 0xdc, 0xc6, 0x03, 0x00, 0x4c, 0xf6, 0x0b, 0x7c, + 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x41, 0xcd, 0x08, 0x10, + 0x85, 0xce, 0x08, 0x10, 0xeb, 0xce, 0x08, 0x10, 0xf5, 0xce, 0x08, 0x10, + 0xff, 0xce, 0x08, 0x10, 0x09, 0xcf, 0x08, 0x10, 0x25, 0xc5, 0x03, 0x00, + 0x63, 0x00, 0x00, 0x00, 0x61, 0xcd, 0x08, 0x10, 0x85, 0xce, 0x08, 0x10, + 0x79, 0xd0, 0x08, 0x10, 0x7d, 0xd0, 0x08, 0x10, 0x75, 0xdc, 0x08, 0x10, + 0x29, 0xdf, 0x08, 0x10, 0x25, 0xc5, 0x03, 0x00, 0x64, 0x00, 0x00, 0x00, + 0x61, 0xcd, 0x08, 0x10, 0xf1, 0xdf, 0x08, 0x10, 0xeb, 0xce, 0x08, 0x10, + 0xf5, 0xce, 0x08, 0x10, 0xff, 0xce, 0x08, 0x10, 0x09, 0xcf, 0x08, 0x10, + 0x25, 0xc5, 0x03, 0x00, 0x65, 0x00, 0x00, 0x00, 0x61, 0xcd, 0x08, 0x10, + 0x85, 0xce, 0x08, 0x10, 0x67, 0xe0, 0x08, 0x10, 0x6b, 0xe0, 0x08, 0x10, + 0xcb, 0xe0, 0x08, 0x10, 0xd9, 0xe2, 0x08, 0x10, 0x21, 0xc6, 0x03, 0x00, + 0x6c, 0x00, 0x00, 0x00, 0x2d, 0xe9, 0xfc, 0x47, 0x07, 0x68, 0x04, 0x46, + 0x00, 0x20, 0xcd, 0xe9, 0x00, 0x00, 0x3f, 0xb1, 0x2c, 0x48, 0x92, 0x46, + 0x89, 0x46, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0xff, 0x28, 0x01, 0xd0, + 0xbd, 0xe8, 0xfc, 0x87, 0x60, 0x7a, 0xb8, 0xb1, 0x00, 0x22, 0x00, 0x26, + 0x00, 0x21, 0x07, 0xeb, 0xc2, 0x05, 0xeb, 0x79, 0xff, 0x2b, 0x1a, 0xbf, + 0x01, 0x33, 0xeb, 0x71, 0xff, 0x23, 0x9e, 0x42, 0x06, 0xda, 0xad, 0x79, + 0xff, 0x2d, 0x18, 0xbf, 0x55, 0x45, 0x01, 0xd1, 0x11, 0x46, 0x1e, 0x46, + 0x01, 0x32, 0x82, 0x42, 0xeb, 0xd3, 0x00, 0xe0, 0x00, 0x21, 0xdf, 0xf8, + 0x6c, 0x80, 0x72, 0xb6, 0xd8, 0xf8, 0x00, 0x00, 0x40, 0x00, 0x01, 0x30, + 0xc8, 0xf8, 0x00, 0x00, 0x20, 0x7a, 0x63, 0x7a, 0x83, 0x42, 0x0e, 0xd1, + 0x58, 0x1e, 0x81, 0x42, 0x09, 0xda, 0x07, 0xeb, 0xc1, 0x00, 0x59, 0x1a, + 0xc9, 0x00, 0x00, 0xf1, 0x08, 0x02, 0x0b, 0x46, 0xea, 0xf7, 0x04, 0xff, + 0x63, 0x7a, 0x58, 0x1e, 0x60, 0x72, 0xd8, 0xf8, 0x00, 0x00, 0x6f, 0x46, + 0x06, 0x21, 0x4a, 0x46, 0x06, 0x23, 0x40, 0x08, 0xc8, 0xf8, 0x00, 0x00, + 0xd8, 0xf8, 0x00, 0x00, 0x80, 0xf3, 0x10, 0x88, 0x38, 0x46, 0xe4, 0xf7, + 0x39, 0xfc, 0x06, 0x48, 0x39, 0x46, 0x8d, 0xf8, 0x06, 0xa0, 0x02, 0x68, + 0x20, 0x46, 0x90, 0x47, 0xbd, 0xe8, 0xfc, 0x87, 0xc0, 0xd2, 0x08, 0x00, + 0x24, 0x36, 0x01, 0x00, 0x44, 0xc9, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0xc8, 0xd2, 0x08, 0x00, 0xfd, 0xc6, 0x03, 0x00, + 0x10, 0xb5, 0x11, 0x49, 0x0a, 0x68, 0x4f, 0xf4, 0xa8, 0x71, 0x10, 0xfb, + 0x01, 0x21, 0x91, 0xf8, 0x55, 0x30, 0x01, 0x2b, 0x16, 0xd0, 0x0d, 0x4b, + 0x1c, 0x68, 0x9c, 0xb1, 0x93, 0xf8, 0x32, 0x40, 0x01, 0x2c, 0x0f, 0xd1, + 0x9b, 0x68, 0x6b, 0xb1, 0xb3, 0xf8, 0xac, 0x32, 0xdb, 0x06, 0x09, 0xd4, + 0x4f, 0xf4, 0xa8, 0x73, 0x10, 0xfb, 0x03, 0x20, 0x02, 0x6d, 0xf5, 0x48, + 0xb0, 0xf8, 0x82, 0x00, 0x82, 0x42, 0x00, 0xd3, 0x08, 0x6d, 0x10, 0xbd, + 0xdc, 0x35, 0x01, 0x00, 0x7c, 0x5c, 0x01, 0x00, 0xb0, 0xb5, 0x04, 0x46, + 0x00, 0x7d, 0x6f, 0x28, 0x29, 0xd1, 0xf0, 0x48, 0xec, 0x4d, 0x21, 0x79, + 0x4f, 0xf4, 0xa8, 0x72, 0x00, 0x68, 0xb5, 0xf8, 0x64, 0x50, 0x11, 0xfb, + 0x02, 0x02, 0xad, 0x08, 0xb2, 0xf8, 0x98, 0x30, 0x05, 0xeb, 0x45, 0x05, + 0xab, 0x42, 0x18, 0xd9, 0xd2, 0xf8, 0xf8, 0x20, 0xd2, 0xb1, 0x4f, 0xf4, + 0xa8, 0x72, 0x11, 0xfb, 0x02, 0x05, 0x95, 0xf8, 0xd4, 0x00, 0x40, 0x08, + 0x00, 0xf0, 0x1e, 0xf8, 0x01, 0x28, 0x06, 0xd8, 0x95, 0xf8, 0xd5, 0x00, + 0x40, 0x08, 0x00, 0xf0, 0x17, 0xf8, 0x05, 0x28, 0x0d, 0xd3, 0x09, 0x48, + 0x90, 0xf8, 0x98, 0x03, 0x07, 0xe0, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, + 0x00, 0xf0, 0x26, 0xba, 0x04, 0x48, 0x90, 0xf8, 0x5b, 0x03, 0x01, 0x30, + 0xa0, 0x74, 0xe0, 0x7c, 0x40, 0xf0, 0x04, 0x00, 0xe0, 0x74, 0xb0, 0xbd, + 0x8c, 0x7e, 0x08, 0x00, 0xa0, 0xb1, 0x10, 0xf0, 0x0f, 0x01, 0x08, 0xbf, + 0x00, 0x09, 0xb1, 0xfa, 0x81, 0xf1, 0x82, 0x07, 0x4f, 0xea, 0x51, 0x11, + 0x4f, 0xf0, 0x01, 0x02, 0x4f, 0xea, 0x81, 0x01, 0x04, 0xbf, 0x80, 0x08, + 0x41, 0xf0, 0x02, 0x01, 0x22, 0xea, 0x00, 0x00, 0x08, 0x44, 0x70, 0x47, + 0xff, 0x20, 0x70, 0x47, 0x2d, 0xe9, 0xf0, 0x4f, 0x89, 0xb0, 0x05, 0x46, + 0xc1, 0x48, 0x90, 0xf8, 0x5e, 0x01, 0x01, 0x28, 0x04, 0xd1, 0xc0, 0x48, + 0x19, 0x21, 0x00, 0x78, 0xe4, 0xf7, 0x9a, 0xfb, 0xd5, 0xe9, 0x02, 0x01, + 0x00, 0x27, 0xcd, 0xe9, 0x05, 0x01, 0xbc, 0x48, 0x00, 0x21, 0x95, 0xf8, + 0x14, 0xb0, 0x95, 0xf9, 0x04, 0x90, 0x02, 0x68, 0xa8, 0x7c, 0x90, 0x47, + 0xdf, 0xf8, 0xe0, 0xa2, 0x06, 0x46, 0xdf, 0xf8, 0xe0, 0x82, 0xbb, 0xf1, + 0x6f, 0x0f, 0xda, 0xf8, 0x00, 0x00, 0x23, 0xd1, 0x4f, 0xf4, 0xa8, 0x71, + 0x19, 0xfb, 0x01, 0x00, 0xa0, 0xf8, 0x80, 0x70, 0x98, 0xf8, 0x53, 0x10, + 0x01, 0xf0, 0xbf, 0x01, 0x88, 0xf8, 0x53, 0x10, 0xd0, 0xf8, 0x20, 0x71, + 0x5f, 0xb1, 0x00, 0xf5, 0x90, 0x74, 0xae, 0x48, 0x01, 0x68, 0x38, 0x46, + 0x88, 0x47, 0x39, 0x7d, 0x00, 0x20, 0x38, 0x61, 0x38, 0x75, 0xb9, 0x75, + 0x20, 0x60, 0xa8, 0x48, 0x00, 0x68, 0x80, 0x47, 0x01, 0x28, 0x24, 0xd1, + 0x28, 0x46, 0x00, 0xf0, 0xbf, 0xf9, 0x1e, 0xe0, 0x4f, 0xf4, 0xa8, 0x74, + 0x19, 0xfb, 0x04, 0x00, 0x90, 0xf8, 0x2c, 0x01, 0x88, 0xf8, 0x50, 0x00, + 0x28, 0x46, 0xf2, 0xf7, 0x9f, 0xf9, 0xda, 0xf8, 0x00, 0x00, 0x19, 0xfb, + 0x04, 0x00, 0xc0, 0xf8, 0x20, 0x71, 0xda, 0xf8, 0x00, 0x00, 0x19, 0xfb, + 0x04, 0x00, 0xd0, 0xf8, 0x84, 0x00, 0x00, 0x28, 0x00, 0xf0, 0x1f, 0x81, + 0x96, 0x48, 0x00, 0x68, 0x80, 0x47, 0x01, 0x28, 0x03, 0xd1, 0x00, 0x27, + 0x17, 0xe1, 0x95, 0x48, 0x45, 0x60, 0xda, 0xf8, 0x00, 0x00, 0x4f, 0xf4, + 0xa8, 0x75, 0x5f, 0xfa, 0x89, 0xf3, 0x03, 0x93, 0x19, 0xfb, 0x05, 0x01, + 0xb1, 0xf8, 0x70, 0x20, 0xb1, 0xf8, 0x80, 0x40, 0x88, 0xf8, 0x74, 0x30, + 0x02, 0x92, 0x00, 0x22, 0xc8, 0xf8, 0x00, 0x20, 0x61, 0x22, 0x88, 0xf8, + 0x49, 0x20, 0x04, 0x22, 0x88, 0xf8, 0x54, 0x20, 0xff, 0x22, 0xa8, 0xf8, + 0x70, 0x20, 0x91, 0xf8, 0x6c, 0x20, 0x91, 0xf8, 0x0c, 0x31, 0x71, 0x1c, + 0x08, 0xbf, 0x4f, 0xf4, 0x48, 0x66, 0xd8, 0xf8, 0x20, 0x70, 0xd8, 0xf8, + 0x28, 0x10, 0x3e, 0x44, 0x88, 0xf8, 0x51, 0x30, 0x88, 0xf8, 0x53, 0x20, + 0x26, 0xf0, 0x70, 0x46, 0xc8, 0xf8, 0x34, 0x60, 0x69, 0xb3, 0x7c, 0x48, + 0x07, 0xaa, 0x03, 0x68, 0x01, 0xf1, 0x08, 0x00, 0x05, 0xa9, 0x98, 0x47, + 0xda, 0xf8, 0x00, 0x00, 0x40, 0xf2, 0x71, 0x23, 0x19, 0xfb, 0x05, 0x01, + 0x07, 0x9d, 0x91, 0xf8, 0x0c, 0x21, 0x75, 0x49, 0x6b, 0x43, 0xbd, 0xf8, + 0x20, 0x50, 0x5b, 0x08, 0x31, 0xf8, 0x12, 0x10, 0x03, 0xeb, 0x15, 0x13, + 0x67, 0x4d, 0xb5, 0xf8, 0xf4, 0x51, 0x5b, 0x1b, 0x59, 0x1a, 0x6f, 0x4b, + 0x9a, 0x5c, 0xc2, 0xeb, 0x02, 0x43, 0x99, 0x42, 0x09, 0xd2, 0xb1, 0xfb, + 0xf2, 0xf5, 0xb8, 0xf8, 0x70, 0x20, 0xa9, 0xb2, 0x8a, 0x42, 0x88, 0xbf, + 0xa8, 0xf8, 0x70, 0x50, 0x01, 0xe0, 0x4f, 0xf6, 0xff, 0x75, 0x98, 0xf8, + 0x53, 0x20, 0xdd, 0xf8, 0x08, 0xa0, 0xbb, 0xf1, 0x70, 0x0f, 0x02, 0xf0, + 0xd0, 0x01, 0x88, 0xf8, 0x53, 0x10, 0x09, 0xd1, 0x02, 0xf0, 0x90, 0x01, + 0x98, 0xf8, 0x54, 0x20, 0x88, 0xf8, 0x53, 0x10, 0x42, 0xf0, 0x01, 0x02, + 0x88, 0xf8, 0x54, 0x20, 0x4f, 0xf4, 0xa8, 0x72, 0x19, 0xfb, 0x02, 0x00, + 0xb0, 0xf8, 0x62, 0x00, 0x80, 0x05, 0x44, 0xbf, 0x41, 0xf0, 0x08, 0x00, + 0x88, 0xf8, 0x53, 0x00, 0x2f, 0x21, 0x56, 0x48, 0x00, 0x68, 0xc8, 0xf8, + 0x10, 0x00, 0x55, 0x48, 0x02, 0x68, 0x40, 0x46, 0x90, 0x47, 0x54, 0x48, + 0x40, 0x7c, 0x01, 0x28, 0x09, 0xd1, 0x42, 0xf6, 0xfa, 0x70, 0x0d, 0xf1, + 0x12, 0x01, 0xad, 0xf8, 0x12, 0x00, 0x50, 0x48, 0x02, 0x68, 0x02, 0x20, + 0x90, 0x47, 0x4f, 0x49, 0x98, 0xf8, 0x53, 0x00, 0xaa, 0xeb, 0x04, 0x07, + 0x09, 0x68, 0x88, 0x47, 0x06, 0x46, 0xbb, 0xf1, 0x6f, 0x0f, 0x30, 0xd1, + 0x4a, 0x48, 0xba, 0xb2, 0x31, 0x46, 0x02, 0x23, 0x04, 0x68, 0x49, 0x48, + 0x00, 0x90, 0x03, 0x98, 0x40, 0xb2, 0xa0, 0x47, 0x5a, 0x4b, 0x4f, 0xf4, + 0xa8, 0x72, 0x19, 0x68, 0x19, 0xfb, 0x02, 0x12, 0x82, 0xf8, 0xf4, 0x00, + 0x10, 0xb1, 0x01, 0x2e, 0x08, 0xbf, 0x02, 0x26, 0x92, 0xf8, 0xe1, 0x20, + 0x06, 0x44, 0x92, 0x07, 0x16, 0xd5, 0x4f, 0xf4, 0xa8, 0x70, 0x19, 0xfb, + 0x00, 0x10, 0x39, 0xb2, 0x90, 0xf8, 0xe0, 0x00, 0x51, 0xfa, 0x86, 0xf1, + 0x00, 0xf0, 0x3f, 0x00, 0x08, 0x44, 0xa9, 0xb2, 0x88, 0x42, 0x07, 0xdc, + 0x98, 0xf8, 0x53, 0x00, 0x40, 0xf0, 0x04, 0x00, 0x88, 0xf8, 0x53, 0x00, + 0x00, 0xe0, 0x47, 0x4b, 0x38, 0xb2, 0xb8, 0xf8, 0x70, 0x50, 0x50, 0xfa, + 0x86, 0xf0, 0xa8, 0x42, 0x30, 0xdd, 0x98, 0xf8, 0x53, 0x00, 0x4f, 0xf4, + 0xa8, 0x71, 0x00, 0x22, 0x40, 0xf0, 0x10, 0x00, 0x88, 0xf8, 0x53, 0x00, + 0x18, 0x68, 0x19, 0xfb, 0x01, 0x00, 0x22, 0x49, 0x90, 0xf8, 0x0c, 0x01, + 0x11, 0xf8, 0x00, 0x80, 0x1e, 0x49, 0x31, 0xf8, 0x10, 0x40, 0x14, 0x48, + 0xb0, 0xf8, 0x52, 0x91, 0xf0, 0x1c, 0xc0, 0xb2, 0x85, 0x42, 0x84, 0xbf, + 0x79, 0x1b, 0x0f, 0x18, 0x21, 0x48, 0x39, 0xb2, 0x03, 0x9f, 0x03, 0x68, + 0x38, 0x46, 0x98, 0x47, 0x08, 0x28, 0x28, 0xbf, 0x08, 0x20, 0x1e, 0x49, + 0x00, 0x90, 0x05, 0xaa, 0x08, 0xfb, 0x05, 0x40, 0x0e, 0x68, 0x70, 0x21, + 0x00, 0xeb, 0x09, 0x03, 0x78, 0xb2, 0xb0, 0x47, 0x19, 0x48, 0x0e, 0x21, + 0x01, 0x22, 0x01, 0x27, 0x03, 0x68, 0x1a, 0x20, 0x98, 0x47, 0x38, 0x46, + 0x09, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0xbf, 0xe8, 0x65, 0x08, 0x00, + 0x66, 0x34, 0x01, 0x00, 0x60, 0xcf, 0x08, 0x00, 0xdc, 0x35, 0x01, 0x00, + 0xfc, 0x70, 0x01, 0x00, 0x74, 0xcf, 0x08, 0x00, 0xc8, 0xa0, 0x08, 0x00, + 0x18, 0x74, 0x01, 0x00, 0x44, 0xa1, 0x08, 0x00, 0xb0, 0x31, 0x0a, 0x10, + 0xc4, 0x31, 0x0a, 0x10, 0x30, 0xcf, 0x08, 0x00, 0xf4, 0xa0, 0x08, 0x00, + 0x4c, 0x01, 0x01, 0x00, 0x08, 0xa1, 0x08, 0x00, 0x5c, 0xc9, 0x08, 0x00, + 0x18, 0xcf, 0x08, 0x00, 0xfc, 0x50, 0x01, 0x00, 0x1c, 0xc9, 0x08, 0x00, + 0x20, 0xc9, 0x08, 0x00, 0xfc, 0xa0, 0x08, 0x00, 0xb0, 0xb5, 0x0d, 0x46, + 0x04, 0x46, 0x00, 0xf0, 0x57, 0xf8, 0x0c, 0x48, 0x01, 0x68, 0x4a, 0x1c, + 0x12, 0xd0, 0x0b, 0x4a, 0x4f, 0xf4, 0xa8, 0x73, 0x12, 0x68, 0x15, 0xfb, + 0x03, 0x22, 0x52, 0xf8, 0x24, 0x3f, 0x8b, 0x42, 0x05, 0xd1, 0x08, 0x1d, + 0x20, 0xf0, 0x70, 0x40, 0x20, 0x60, 0x10, 0x60, 0xb0, 0xbd, 0x4f, 0xf0, + 0xff, 0x31, 0x01, 0x60, 0xb0, 0xbd, 0x00, 0xbf, 0x54, 0xd3, 0x05, 0x00, + 0xdc, 0x35, 0x01, 0x00, 0x03, 0x48, 0x40, 0x78, 0xc0, 0x07, 0x08, 0xbf, + 0x00, 0xf0, 0x3a, 0xb8, 0x70, 0x47, 0x00, 0xbf, 0x1b, 0x54, 0x01, 0x00, + 0x0a, 0x4a, 0x0b, 0x4b, 0x07, 0x48, 0x08, 0x49, 0x13, 0x60, 0x0a, 0x4a, + 0xc0, 0xe9, 0x2f, 0x12, 0xc0, 0xf8, 0xb4, 0x20, 0x08, 0x48, 0x09, 0x49, + 0x01, 0x60, 0x09, 0x48, 0x09, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x90, 0xcf, 0x08, 0x00, 0x2d, 0xc8, 0x03, 0x00, 0xf8, 0xce, 0x08, 0x00, + 0xdd, 0xc7, 0x03, 0x00, 0xdd, 0xc8, 0x03, 0x00, 0x80, 0xcf, 0x08, 0x00, + 0x41, 0xcc, 0x03, 0x00, 0x00, 0xcf, 0x08, 0x00, 0x85, 0xcc, 0x03, 0x00, + 0x4c, 0xf6, 0x13, 0x4c, 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4c, 0xf6, 0xf1, 0x1c, 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf2, 0x75, 0x3c, 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf2, 0x8d, 0x2c, 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xb0, 0xb5, 0xf4, 0x4c, 0xf4, 0x4d, 0x20, 0x78, 0x00, 0xeb, 0x00, 0x10, + 0x05, 0xeb, 0xc0, 0x01, 0xc9, 0x68, 0x51, 0xb1, 0x55, 0xf8, 0x30, 0x00, + 0x38, 0xb1, 0x0f, 0x48, 0x00, 0x78, 0x40, 0x07, 0x0a, 0xd4, 0x00, 0x20, + 0x40, 0xf2, 0x15, 0x71, 0x02, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x14, 0x71, + 0xbd, 0xe8, 0xb0, 0x40, 0xe9, 0xf7, 0xbc, 0xbf, 0x02, 0xf0, 0xc8, 0xf8, + 0x07, 0x48, 0x01, 0x21, 0x02, 0x68, 0x40, 0x20, 0x90, 0x47, 0x20, 0x78, + 0x00, 0xeb, 0x00, 0x10, 0x05, 0xeb, 0xc0, 0x00, 0xbd, 0xe8, 0xb0, 0x40, + 0x10, 0xf0, 0x2a, 0xbe, 0x97, 0x53, 0x01, 0x00, 0xf8, 0xb9, 0x08, 0x00, + 0x2d, 0xe9, 0xfe, 0x4f, 0xdb, 0x4e, 0xdf, 0xf8, 0x70, 0x83, 0x31, 0x78, + 0x01, 0xeb, 0x01, 0x10, 0x08, 0xeb, 0xc0, 0x02, 0xd4, 0x68, 0x00, 0x2c, + 0x46, 0xd0, 0xd8, 0x4d, 0xd5, 0xf8, 0x00, 0x90, 0xb9, 0xf1, 0x00, 0x0f, + 0x40, 0xd0, 0x58, 0xf8, 0x30, 0x00, 0xe8, 0xb3, 0x94, 0xf8, 0x1d, 0x21, + 0xb4, 0xf8, 0x48, 0x31, 0x02, 0x92, 0xb4, 0xf8, 0x52, 0x21, 0x93, 0x42, + 0x06, 0xd3, 0xd0, 0x4a, 0x5c, 0x23, 0x11, 0xfb, 0x03, 0x22, 0xcf, 0x4b, + 0x1b, 0x68, 0x13, 0x63, 0x5c, 0x22, 0x02, 0x23, 0x11, 0xfb, 0x02, 0xf1, + 0xca, 0x4a, 0x52, 0x5c, 0x02, 0x21, 0x05, 0x2a, 0x03, 0xd3, 0x02, 0x23, + 0x0a, 0x2a, 0x38, 0xbf, 0x03, 0x23, 0xd0, 0xf8, 0xd4, 0x00, 0x94, 0xf9, + 0x41, 0x71, 0x94, 0xf8, 0x40, 0x21, 0x40, 0x7f, 0xcd, 0xe9, 0x00, 0x10, + 0x04, 0xf5, 0xe8, 0x70, 0xb9, 0x00, 0x1f, 0xf0, 0x7f, 0xf8, 0x30, 0x78, + 0xb4, 0xf8, 0x48, 0x21, 0x00, 0xeb, 0x00, 0x11, 0x08, 0xeb, 0xc1, 0x01, + 0xa1, 0xf8, 0x70, 0x20, 0xbc, 0x49, 0x01, 0xf1, 0x1d, 0x0b, 0x94, 0xf8, + 0x78, 0x11, 0xc9, 0x07, 0x09, 0xd1, 0x4f, 0xf0, 0x01, 0x0a, 0x15, 0xe0, + 0x00, 0x20, 0x40, 0xf2, 0xdf, 0x41, 0x00, 0x24, 0xe9, 0xf7, 0x4e, 0xff, + 0xed, 0xe0, 0xd4, 0xf8, 0x90, 0x10, 0x4f, 0xf0, 0x00, 0x0a, 0x01, 0x31, + 0xc4, 0xf8, 0x90, 0x10, 0x35, 0x21, 0x8b, 0xf8, 0x00, 0x10, 0xb0, 0x49, + 0x91, 0xf8, 0x49, 0x12, 0x8b, 0xf8, 0x01, 0x10, 0xae, 0x4a, 0x00, 0xeb, + 0x80, 0x01, 0xa9, 0x4f, 0x02, 0xeb, 0x41, 0x11, 0x02, 0x22, 0x81, 0xf8, + 0x54, 0x20, 0x5c, 0x22, 0x10, 0xfb, 0x02, 0xf1, 0x7b, 0x5c, 0xa9, 0x49, + 0x05, 0x2b, 0x16, 0xd3, 0x09, 0x2b, 0x14, 0xd8, 0x5c, 0x22, 0x10, 0xfb, + 0x02, 0x70, 0xc0, 0x68, 0xc8, 0x60, 0x30, 0x78, 0x10, 0xfb, 0x02, 0x70, + 0x00, 0x69, 0x88, 0x60, 0x30, 0x78, 0x10, 0xfb, 0x02, 0x70, 0x40, 0x69, + 0x48, 0x60, 0x30, 0x78, 0x10, 0xfb, 0x02, 0x70, 0x80, 0x69, 0x08, 0x60, + 0x03, 0xe0, 0x10, 0xfb, 0x02, 0x70, 0x80, 0x68, 0xc8, 0x60, 0x9b, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xba, 0xf1, 0x00, 0x0f, 0x1c, 0xbf, + 0xb4, 0xf8, 0x78, 0x01, 0x5f, 0xea, 0xc0, 0x70, 0x40, 0xf0, 0xaa, 0x80, + 0x30, 0x78, 0x00, 0xeb, 0x00, 0x11, 0x58, 0xf8, 0x31, 0x10, 0x91, 0xf8, + 0x8a, 0x10, 0x89, 0x07, 0x14, 0xd5, 0xfd, 0x4f, 0x00, 0xeb, 0x80, 0x01, + 0x07, 0xeb, 0xc1, 0x01, 0x49, 0x89, 0x69, 0xb1, 0x8d, 0x48, 0x00, 0x68, + 0x82, 0x69, 0x04, 0xf5, 0xb0, 0x70, 0x90, 0x47, 0x30, 0x78, 0x00, 0xeb, + 0x80, 0x01, 0x07, 0xeb, 0xc1, 0x01, 0x4a, 0x89, 0x04, 0x32, 0x4a, 0x81, + 0x94, 0xf8, 0x50, 0x11, 0x41, 0xb1, 0xb4, 0xf8, 0x58, 0x11, 0xb4, 0xf8, + 0x74, 0x21, 0x51, 0x1a, 0x09, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, 0x0c, 0xdc, + 0xec, 0x4a, 0x00, 0xeb, 0x80, 0x01, 0x02, 0xeb, 0xc1, 0x01, 0x49, 0x7d, + 0x29, 0xb9, 0x7e, 0x49, 0xb1, 0xf8, 0xba, 0x11, 0xca, 0x07, 0x40, 0xf0, + 0x94, 0x80, 0x00, 0x25, 0xe5, 0x49, 0x00, 0xeb, 0x80, 0x00, 0x7b, 0x4b, + 0x01, 0xeb, 0xc0, 0x01, 0x94, 0xf8, 0x7e, 0x01, 0x1f, 0x68, 0x0a, 0x7d, + 0x92, 0xb1, 0x09, 0x7b, 0x00, 0x22, 0x01, 0x23, 0xcd, 0xe9, 0x00, 0x12, + 0x00, 0x21, 0x2a, 0x46, 0xb8, 0x47, 0x00, 0x2d, 0x68, 0x4f, 0x6c, 0x4d, + 0x1d, 0xd0, 0x2b, 0x20, 0x8b, 0xf8, 0x00, 0x00, 0x68, 0x48, 0x90, 0xf8, + 0x3f, 0x02, 0x14, 0xe0, 0x0a, 0x7b, 0x4b, 0x89, 0x94, 0xf8, 0x7d, 0x11, + 0xcd, 0xe9, 0x00, 0x23, 0x2a, 0x46, 0x00, 0x23, 0xb8, 0x47, 0x02, 0x98, + 0x9b, 0xf8, 0x00, 0x10, 0xc0, 0xeb, 0x00, 0x10, 0x09, 0xeb, 0x40, 0x10, + 0x40, 0x78, 0xe4, 0xf7, 0x77, 0xf8, 0x5a, 0x4f, 0x5d, 0x4d, 0x8b, 0xf8, + 0x01, 0x00, 0x63, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x30, 0x78, + 0x00, 0xeb, 0x80, 0x01, 0x05, 0xeb, 0x41, 0x11, 0x91, 0xf8, 0x54, 0x20, + 0x51, 0xf8, 0x22, 0x30, 0x6f, 0xf3, 0x9f, 0x53, 0x41, 0xf8, 0x22, 0x30, + 0x91, 0xf8, 0x54, 0x20, 0x51, 0xf8, 0x22, 0x30, 0x6f, 0xf3, 0x15, 0x03, + 0x41, 0xf8, 0x22, 0x30, 0x91, 0xf8, 0x54, 0x10, 0x0e, 0x29, 0x05, 0xd3, + 0x00, 0x20, 0x40, 0xf2, 0x3e, 0x51, 0xe4, 0xf7, 0x15, 0xf8, 0x30, 0x78, + 0x5c, 0x25, 0x52, 0x49, 0x02, 0x22, 0x10, 0xfb, 0x05, 0x70, 0x81, 0x62, + 0x00, 0x20, 0x21, 0x46, 0x1e, 0xf0, 0xda, 0xfc, 0x30, 0x78, 0x00, 0xeb, + 0x00, 0x11, 0x08, 0xeb, 0xc1, 0x01, 0x49, 0x68, 0x49, 0x7f, 0x19, 0xb1, + 0x4a, 0x49, 0x10, 0xfb, 0x05, 0x70, 0xc1, 0x62, 0x01, 0x24, 0x20, 0x46, + 0xbd, 0xe8, 0xfe, 0x8f, 0x94, 0xf8, 0x47, 0x01, 0xb4, 0xf8, 0x4e, 0x11, + 0x08, 0x44, 0xb4, 0xf8, 0x74, 0x11, 0x01, 0x38, 0x0a, 0x1a, 0x12, 0xb2, + 0xb2, 0xf1, 0xff, 0x3f, 0x39, 0xdd, 0x88, 0x42, 0x53, 0xd1, 0x94, 0xf8, + 0x4b, 0x01, 0x94, 0xf8, 0x4d, 0x11, 0x01, 0x30, 0x11, 0xb1, 0x94, 0xf8, + 0x4c, 0x11, 0x08, 0x44, 0x31, 0x78, 0x01, 0xeb, 0x01, 0x11, 0x08, 0xeb, + 0xc1, 0x01, 0x91, 0xf8, 0x72, 0x10, 0x40, 0x1a, 0x3f, 0xe0, 0xb4, 0xf8, + 0x78, 0x21, 0x89, 0x07, 0x42, 0xf0, 0x04, 0x02, 0xa4, 0xf8, 0x78, 0x21, + 0x1b, 0xd5, 0x2e, 0x4a, 0xc0, 0xeb, 0x40, 0x11, 0x02, 0xeb, 0xc1, 0x01, + 0x91, 0xf8, 0x9d, 0x20, 0x01, 0x2a, 0x02, 0xd0, 0x49, 0x68, 0x49, 0x7f, + 0x79, 0xb9, 0x94, 0xf8, 0x1d, 0x21, 0x29, 0x68, 0x94, 0xf8, 0x20, 0x31, + 0xc2, 0xeb, 0x02, 0x12, 0x01, 0xeb, 0x42, 0x11, 0x5a, 0x1e, 0x91, 0xf8, + 0xc1, 0x10, 0x8a, 0x42, 0x01, 0xd1, 0x00, 0x24, 0xb7, 0xe7, 0x01, 0x25, + 0x46, 0xe7, 0x40, 0x1a, 0x94, 0xf8, 0x20, 0x11, 0x94, 0xf8, 0x4d, 0x31, + 0x94, 0xf8, 0x4b, 0x21, 0x48, 0x43, 0x31, 0x78, 0x01, 0xeb, 0x01, 0x11, + 0x08, 0xeb, 0xc1, 0x01, 0x91, 0xf8, 0x72, 0x10, 0xa0, 0xeb, 0x01, 0x00, + 0x02, 0xf1, 0x01, 0x01, 0xa4, 0xf8, 0x3c, 0x02, 0x13, 0xb1, 0x94, 0xf8, + 0x4c, 0x21, 0x11, 0x44, 0x08, 0x44, 0xa4, 0xf8, 0x3c, 0x02, 0xb4, 0xf8, + 0x3a, 0x12, 0xb4, 0xf8, 0x3c, 0x02, 0x11, 0xb1, 0x81, 0x42, 0x7f, 0xf6, + 0xeb, 0xae, 0xa4, 0xf8, 0x3a, 0x02, 0xe7, 0xe6, 0x74, 0x87, 0x08, 0x00, + 0xfc, 0x6d, 0x01, 0x00, 0xe0, 0x35, 0x01, 0x00, 0x44, 0x4f, 0x01, 0x00, + 0x58, 0xa2, 0x08, 0x00, 0xfc, 0x20, 0x01, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0xbc, 0x65, 0x01, 0x00, 0xe0, 0x12, 0x21, 0x40, 0x5c, 0xa2, 0x08, 0x00, + 0xe4, 0x35, 0x01, 0x00, 0xe8, 0x65, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0x98, 0xb9, 0x08, 0x00, 0xf8, 0xa0, 0x08, 0x00, 0x29, 0xd1, 0x03, 0x00, + 0x6d, 0x71, 0x09, 0x10, 0xf8, 0xb5, 0x01, 0xf0, 0xdd, 0xfe, 0x01, 0x28, + 0x40, 0xf0, 0xab, 0x80, 0x5d, 0x4a, 0x5f, 0x4d, 0x5d, 0x49, 0x14, 0x78, + 0xed, 0x78, 0x04, 0xeb, 0x04, 0x13, 0x2d, 0x07, 0x01, 0xeb, 0xc3, 0x03, + 0xdb, 0x68, 0x31, 0xd4, 0x73, 0xb1, 0xd3, 0xf8, 0x00, 0x51, 0x5d, 0xb1, + 0x95, 0xf8, 0x35, 0x51, 0x57, 0x4e, 0x68, 0x27, 0x15, 0xfb, 0x07, 0x65, + 0x2d, 0x79, 0x01, 0x2d, 0x04, 0xbf, 0x00, 0x25, 0x83, 0xf8, 0xb9, 0x51, + 0x54, 0x4d, 0x93, 0xf8, 0x1d, 0x61, 0x2d, 0x68, 0xc6, 0xeb, 0x06, 0x16, + 0x05, 0xeb, 0x46, 0x15, 0xd5, 0xf8, 0xa0, 0x50, 0x6d, 0x7f, 0x2d, 0xb9, + 0x93, 0xf8, 0xf8, 0x51, 0x15, 0xb1, 0x01, 0x3d, 0x83, 0xf8, 0xf8, 0x51, + 0x4a, 0x4d, 0x04, 0xeb, 0x84, 0x04, 0x05, 0xeb, 0xc4, 0x04, 0x25, 0x7d, + 0xd3, 0xf8, 0x20, 0x42, 0x00, 0x2d, 0x42, 0xd0, 0x00, 0x2c, 0x4a, 0xd0, + 0x93, 0xf8, 0x2b, 0x32, 0x03, 0x25, 0x40, 0xe0, 0xdb, 0xb1, 0xd3, 0xf8, + 0x00, 0x51, 0x5d, 0xb1, 0x95, 0xf8, 0x35, 0x51, 0xe9, 0x4e, 0x68, 0x27, + 0x15, 0xfb, 0x07, 0x65, 0x2d, 0x79, 0x01, 0x2d, 0x04, 0xbf, 0x01, 0x25, + 0x83, 0xf8, 0xb9, 0x51, 0xd3, 0xf8, 0x20, 0x52, 0x4d, 0xb1, 0x93, 0xf8, + 0x2b, 0x32, 0x05, 0xeb, 0x43, 0x03, 0x02, 0x25, 0x5c, 0x78, 0x65, 0xf3, + 0x1f, 0x14, 0x5c, 0x70, 0x14, 0x78, 0x04, 0xeb, 0x04, 0x12, 0x33, 0x4b, + 0x01, 0xeb, 0xc2, 0x01, 0x04, 0xeb, 0x84, 0x02, 0x03, 0xeb, 0xc2, 0x02, + 0xc9, 0x68, 0x12, 0x7d, 0x01, 0x2a, 0x05, 0xd1, 0xd1, 0xf8, 0x60, 0x22, + 0x01, 0x32, 0xc1, 0xf8, 0x60, 0x22, 0x04, 0xe0, 0xd1, 0xf8, 0x54, 0x22, + 0x01, 0x32, 0xc1, 0xf8, 0x54, 0x22, 0xd1, 0xf8, 0xdc, 0x20, 0x05, 0x23, + 0x63, 0xf3, 0x03, 0x02, 0xc1, 0xf8, 0xdc, 0x20, 0xf8, 0xbd, 0x44, 0xb1, + 0x93, 0xf8, 0x2b, 0x32, 0x04, 0x25, 0x04, 0xeb, 0x43, 0x03, 0x5c, 0x78, + 0x65, 0xf3, 0x1f, 0x14, 0x5c, 0x70, 0x13, 0x78, 0xc1, 0x4d, 0xc3, 0xeb, + 0x43, 0x14, 0x05, 0xeb, 0xc4, 0x04, 0x94, 0xf8, 0x9e, 0x40, 0x01, 0x2c, + 0x11, 0xd1, 0x03, 0xeb, 0x03, 0x14, 0x01, 0xeb, 0xc4, 0x04, 0xe4, 0x68, + 0x5c, 0xb1, 0xd4, 0xf8, 0x20, 0x52, 0x45, 0xb1, 0x94, 0xf8, 0x2b, 0x32, + 0x05, 0xeb, 0x43, 0x03, 0x5c, 0x78, 0x44, 0xf0, 0x01, 0x04, 0x5c, 0x70, + 0x13, 0x78, 0x03, 0xeb, 0x03, 0x12, 0x01, 0xeb, 0xc2, 0x01, 0xc9, 0x68, + 0x91, 0xf9, 0x78, 0x21, 0xb2, 0xf1, 0xff, 0x3f, 0x00, 0xdd, 0xf8, 0xbd, + 0x00, 0x29, 0xfc, 0xd0, 0xd1, 0xf8, 0x20, 0x22, 0x00, 0x2a, 0xf8, 0xd0, + 0x91, 0xf8, 0x2b, 0x12, 0x02, 0xeb, 0x41, 0x01, 0x4a, 0x78, 0x42, 0xf0, + 0x02, 0x02, 0x4a, 0x70, 0xf8, 0xbd, 0x00, 0xbf, 0x74, 0x87, 0x08, 0x00, + 0xfc, 0x6d, 0x01, 0x00, 0x40, 0x36, 0x01, 0x00, 0xb0, 0xe6, 0x05, 0x00, + 0x84, 0x71, 0x01, 0x00, 0xe0, 0x35, 0x01, 0x00, 0xf8, 0xb5, 0x9f, 0x48, + 0xa1, 0x49, 0x00, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x01, 0xeb, 0xc0, 0x02, + 0x51, 0xf8, 0x30, 0x00, 0xd5, 0x68, 0xd0, 0xf8, 0xd4, 0x00, 0x46, 0x7f, + 0x01, 0xf0, 0x08, 0xfe, 0xb0, 0xb1, 0xd5, 0xf8, 0x3c, 0x01, 0x00, 0xf0, + 0x51, 0xf8, 0x98, 0xb1, 0xd5, 0xf8, 0x00, 0x11, 0x84, 0x7f, 0xb1, 0xf8, + 0x8a, 0x10, 0x01, 0xf0, 0x04, 0x02, 0x6e, 0xb1, 0x81, 0x88, 0x01, 0xeb, + 0x02, 0x0c, 0x01, 0x89, 0x01, 0xeb, 0x02, 0x0e, 0x81, 0x89, 0x8e, 0x18, + 0x01, 0x8a, 0x0d, 0xe0, 0x00, 0x21, 0x36, 0xe0, 0x01, 0x21, 0x34, 0xe0, + 0xc1, 0x88, 0x01, 0xeb, 0x02, 0x0c, 0x41, 0x89, 0x01, 0xeb, 0x02, 0x0e, + 0xc1, 0x89, 0x8e, 0x18, 0x41, 0x8a, 0x02, 0x30, 0x8f, 0x18, 0x01, 0x21, + 0x21, 0xea, 0x04, 0x03, 0xdc, 0x03, 0x44, 0xea, 0xc3, 0x75, 0x45, 0xea, + 0x06, 0x44, 0xbe, 0xb2, 0x45, 0xea, 0x0c, 0x45, 0x34, 0x43, 0x24, 0xf0, + 0x7c, 0x26, 0x0f, 0x4c, 0x27, 0x68, 0x07, 0xf0, 0x7c, 0x27, 0x3e, 0x44, + 0x26, 0x60, 0x1f, 0xfa, 0x8e, 0xf6, 0x35, 0x43, 0x66, 0x68, 0x25, 0xf0, + 0x7c, 0x25, 0x06, 0xf0, 0x7c, 0x26, 0x35, 0x44, 0x65, 0x60, 0x00, 0x88, + 0x10, 0x44, 0x48, 0xf2, 0xff, 0x32, 0x10, 0x40, 0xa2, 0x68, 0x40, 0xea, + 0xc3, 0x30, 0x02, 0xf0, 0x7c, 0x22, 0x10, 0x44, 0xa0, 0x60, 0x08, 0x46, + 0xf8, 0xbd, 0x00, 0xbf, 0x34, 0x14, 0x21, 0x40, 0x30, 0xb1, 0x90, 0xf8, + 0x21, 0x10, 0x00, 0x29, 0x18, 0xbf, 0x81, 0x1c, 0x08, 0x46, 0x70, 0x47, + 0x00, 0x20, 0x70, 0x47, 0x2d, 0xe9, 0xf8, 0x43, 0x66, 0x4e, 0xdf, 0xf8, + 0x9c, 0x91, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x09, 0xeb, 0xc0, 0x01, + 0x08, 0x46, 0x50, 0xf8, 0x0c, 0x4f, 0x54, 0xb3, 0x82, 0x4a, 0x94, 0xf8, + 0x1d, 0x31, 0x12, 0x68, 0xc3, 0xeb, 0x03, 0x13, 0x02, 0xeb, 0x43, 0x15, + 0xd5, 0xf8, 0xa0, 0x20, 0x52, 0x7f, 0x2a, 0xb1, 0x94, 0xf8, 0xf8, 0x21, + 0x12, 0xb1, 0x01, 0x3a, 0x84, 0xf8, 0xf8, 0x21, 0xb1, 0xf8, 0xdc, 0x10, + 0xc9, 0x07, 0x1b, 0xd1, 0xd4, 0xf8, 0xdc, 0x10, 0x0c, 0x22, 0x62, 0xf3, + 0x03, 0x01, 0xc4, 0xf8, 0xdc, 0x10, 0x94, 0xf9, 0x78, 0x11, 0xb1, 0xf1, + 0xff, 0x3f, 0x70, 0xdd, 0xd4, 0xf8, 0x9c, 0x10, 0x01, 0x31, 0xc4, 0xf8, + 0x9c, 0x10, 0x04, 0x68, 0x00, 0x2c, 0x6d, 0xd1, 0x7c, 0xe0, 0x00, 0x20, + 0x4f, 0xf4, 0xe3, 0x71, 0x00, 0x25, 0xe9, 0xf7, 0x4f, 0xfc, 0x76, 0xe0, + 0x49, 0x48, 0x00, 0x68, 0x80, 0x47, 0x30, 0x78, 0x48, 0x4f, 0x01, 0x21, + 0x01, 0x22, 0x00, 0xeb, 0x00, 0x10, 0x57, 0xf8, 0x30, 0x00, 0xd0, 0xf8, + 0xd4, 0x00, 0x43, 0x7f, 0x04, 0xf5, 0xe8, 0x70, 0x1e, 0xf0, 0xd8, 0xf9, + 0x30, 0x78, 0x00, 0xeb, 0x00, 0x11, 0x07, 0xeb, 0xc1, 0x01, 0x49, 0x68, + 0x49, 0x7f, 0xe9, 0xb1, 0x3e, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0xd5, 0xf8, 0xb8, 0x10, 0x03, 0x20, 0xc5, 0xe9, 0x31, 0x10, 0x3b, 0x4d, + 0x28, 0x78, 0xc0, 0x07, 0x0b, 0xd0, 0x3a, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x38, 0xb1, 0xb4, 0xf8, 0x58, 0x11, 0x80, 0x46, 0x20, 0x46, 0x00, 0xf0, + 0x71, 0xf8, 0xc8, 0xf8, 0x04, 0x00, 0x28, 0x78, 0x00, 0xf0, 0xfe, 0x00, + 0x28, 0x70, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0xb4, 0xf8, 0x52, 0x21, + 0x59, 0xf8, 0x30, 0x10, 0x09, 0xeb, 0xc0, 0x00, 0xb1, 0xf8, 0x8a, 0x10, + 0x01, 0xf0, 0x04, 0x01, 0x11, 0x44, 0xb0, 0xf8, 0xde, 0x20, 0x91, 0x42, + 0x15, 0xd2, 0x2a, 0x49, 0x00, 0x20, 0x00, 0x25, 0x01, 0xf0, 0x20, 0xfd, + 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x09, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, + 0xdc, 0x10, 0x41, 0xf0, 0x40, 0x01, 0xa0, 0xf8, 0xdc, 0x10, 0xd4, 0xf8, + 0xa0, 0x00, 0x01, 0x30, 0xc4, 0xf8, 0xa0, 0x00, 0x17, 0xe0, 0x01, 0x25, + 0x15, 0xe0, 0xd4, 0xf8, 0x58, 0x02, 0x01, 0x30, 0xc4, 0xf8, 0x58, 0x02, + 0xd4, 0xf8, 0x00, 0x21, 0x62, 0xb1, 0x92, 0xf8, 0x35, 0x01, 0x1a, 0x49, + 0x68, 0x23, 0x10, 0xfb, 0x03, 0x13, 0x1b, 0x79, 0x01, 0x2b, 0x03, 0xd1, + 0xd2, 0xf8, 0xd4, 0x20, 0x52, 0x7f, 0x1a, 0xb1, 0x00, 0x25, 0x28, 0x46, + 0xbd, 0xe8, 0xf8, 0x83, 0x94, 0xf8, 0xb9, 0x21, 0x1a, 0xb1, 0x00, 0x25, + 0x84, 0xf8, 0xb9, 0x51, 0xf5, 0xe7, 0x68, 0x22, 0x10, 0xfb, 0x02, 0x10, + 0x94, 0xf8, 0x4a, 0x11, 0x04, 0x29, 0x28, 0xbf, 0x04, 0x21, 0x00, 0xeb, + 0xc1, 0x00, 0xc1, 0x88, 0x01, 0x31, 0xc1, 0x80, 0xe6, 0xe7, 0x00, 0xbf, + 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0x98, 0xbb, 0x08, 0x00, + 0xfc, 0x6d, 0x01, 0x00, 0xa4, 0xbb, 0x08, 0x00, 0x97, 0x53, 0x01, 0x00, + 0x90, 0xbb, 0x08, 0x00, 0x78, 0xef, 0x03, 0x00, 0xb0, 0xe6, 0x05, 0x00, + 0xb0, 0xb5, 0xb0, 0xf8, 0x74, 0x21, 0x53, 0x1a, 0x1c, 0xb2, 0xb4, 0xf1, + 0xff, 0x3f, 0x12, 0xdd, 0x14, 0x49, 0x90, 0xf8, 0x1d, 0x01, 0x09, 0x68, + 0xc0, 0xeb, 0x00, 0x10, 0x01, 0xeb, 0x40, 0x10, 0x11, 0x49, 0x05, 0x89, + 0xb8, 0x30, 0x09, 0x68, 0x88, 0x47, 0xa1, 0xb2, 0x0f, 0x4a, 0x69, 0x43, + 0x01, 0xfb, 0x02, 0x00, 0xb0, 0xbd, 0x89, 0x1a, 0x0a, 0x4a, 0x90, 0xf8, + 0x1d, 0x01, 0x89, 0xb2, 0x12, 0x68, 0xc0, 0xeb, 0x00, 0x10, 0x02, 0xeb, + 0x40, 0x10, 0x02, 0x89, 0xb8, 0x30, 0x01, 0xfb, 0x02, 0xf4, 0x05, 0x49, + 0x09, 0x68, 0x88, 0x47, 0x40, 0xf2, 0xe2, 0x41, 0x04, 0xfb, 0x01, 0x00, + 0xb0, 0xbd, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, 0xd0, 0xb6, 0x08, 0x00, + 0x1e, 0xfb, 0xff, 0xff, 0x2d, 0xe9, 0xfe, 0x4f, 0xdf, 0xf8, 0xd8, 0xa6, + 0xdf, 0xf8, 0xd8, 0x86, 0x9a, 0xf8, 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x10, + 0x08, 0xeb, 0xc0, 0x01, 0xcc, 0x68, 0x00, 0x2c, 0x00, 0xf0, 0xa4, 0x80, + 0x58, 0xf8, 0x30, 0x00, 0x00, 0x28, 0x00, 0xf0, 0x9f, 0x80, 0xb4, 0xf8, + 0x78, 0x01, 0x94, 0xf8, 0x60, 0x21, 0x94, 0xf8, 0x68, 0x11, 0x20, 0xf0, + 0x02, 0x00, 0xa4, 0xf8, 0x78, 0x01, 0xdf, 0xf8, 0xa8, 0x06, 0x03, 0x68, + 0x20, 0x46, 0x98, 0x47, 0x9a, 0xf8, 0x00, 0x00, 0xdf, 0xf8, 0x9c, 0x96, + 0xc0, 0xeb, 0x40, 0x11, 0x00, 0xeb, 0x00, 0x10, 0x09, 0xeb, 0xc0, 0x00, + 0x08, 0xeb, 0xc1, 0x01, 0xc0, 0x68, 0x90, 0xf8, 0x60, 0x01, 0x81, 0xf8, + 0xa0, 0x00, 0xdf, 0xf8, 0x84, 0x06, 0x00, 0x68, 0x80, 0x47, 0xd2, 0x48, + 0x00, 0x25, 0x05, 0x60, 0xd1, 0x48, 0x05, 0x60, 0xd1, 0x48, 0x05, 0x60, + 0xdf, 0xf8, 0x70, 0x06, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0xdf, 0xf8, + 0x6c, 0x06, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0xdf, 0xf8, 0x64, 0x16, + 0x94, 0xf8, 0x7d, 0x01, 0x0a, 0x68, 0xb4, 0xf8, 0x78, 0x11, 0x01, 0xf0, + 0x01, 0x01, 0x90, 0x47, 0x9a, 0xf8, 0x00, 0x70, 0xc7, 0xeb, 0x47, 0x10, + 0x08, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x10, 0xc8, 0x07, 0x00, 0xf0, + 0xba, 0x81, 0x01, 0xf0, 0x49, 0x00, 0x09, 0x28, 0x0f, 0xd0, 0xdf, 0xf8, + 0x38, 0x06, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x9a, 0xf8, 0x00, 0x70, + 0x00, 0x28, 0xc7, 0xeb, 0x47, 0x11, 0x08, 0xeb, 0xc1, 0x02, 0xb2, 0xf8, + 0xdc, 0x10, 0x00, 0xf0, 0x85, 0x80, 0xc7, 0xeb, 0x47, 0x10, 0x08, 0xeb, + 0xc0, 0x06, 0x41, 0xf0, 0x10, 0x00, 0xa6, 0xf8, 0xdc, 0x00, 0xd4, 0xf8, + 0x3c, 0x01, 0xff, 0xf7, 0x5d, 0xfe, 0x28, 0xb1, 0x05, 0x46, 0x96, 0xf8, + 0x9d, 0x00, 0x00, 0x28, 0x00, 0xf0, 0x8a, 0x80, 0xb4, 0xf8, 0x78, 0x01, + 0xc1, 0x07, 0x00, 0xf0, 0x6b, 0x81, 0xc7, 0xeb, 0x47, 0x11, 0x94, 0xf8, + 0x7d, 0x31, 0x08, 0xeb, 0xc1, 0x01, 0x91, 0xf8, 0x99, 0x20, 0x93, 0x42, + 0x27, 0xd1, 0xb1, 0xf8, 0xdc, 0x20, 0x42, 0xf4, 0x80, 0x62, 0xa1, 0xf8, + 0xdc, 0x20, 0xd4, 0xf8, 0x00, 0x11, 0x00, 0x29, 0x00, 0xf0, 0x51, 0x81, + 0x91, 0xf8, 0x35, 0x11, 0xdf, 0xf8, 0xdc, 0x25, 0x68, 0x23, 0x11, 0xfb, + 0x03, 0x23, 0x1b, 0x79, 0x01, 0x2b, 0x40, 0xf0, 0x46, 0x81, 0x94, 0xf8, + 0xb9, 0x31, 0x00, 0x2b, 0x00, 0xf0, 0x34, 0x81, 0x00, 0x21, 0x84, 0xf8, + 0xb9, 0x11, 0x3c, 0xe1, 0x00, 0x20, 0x40, 0xf2, 0x92, 0x21, 0x00, 0x25, + 0xe9, 0xf7, 0xba, 0xfa, 0x28, 0x46, 0xbd, 0xe8, 0xfe, 0x8f, 0xd4, 0xf8, + 0x30, 0x02, 0x28, 0xb1, 0x80, 0x6a, 0x18, 0xb1, 0x01, 0x7d, 0x09, 0xb9, + 0x06, 0x21, 0x01, 0x75, 0xdf, 0xf8, 0x8c, 0x05, 0x94, 0xf8, 0x68, 0x11, + 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0xdf, 0xf8, 0x84, 0x05, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0xb4, 0xf8, 0x78, 0x01, 0xd4, 0xf8, 0x80, 0x20, + 0xd4, 0xf8, 0x00, 0x11, 0x20, 0xf0, 0x01, 0x00, 0x01, 0x32, 0x00, 0x29, + 0xa4, 0xf8, 0x78, 0x01, 0xc4, 0xf8, 0x80, 0x20, 0x00, 0xf0, 0x14, 0x81, + 0x91, 0xf8, 0x35, 0x11, 0xdf, 0xf8, 0x58, 0x25, 0x68, 0x23, 0x11, 0xfb, + 0x03, 0x21, 0x0a, 0x79, 0x01, 0x2a, 0x40, 0xf0, 0x09, 0x81, 0x94, 0xf8, + 0x4a, 0x21, 0x04, 0x2a, 0x28, 0xbf, 0x04, 0x22, 0x01, 0xeb, 0xc2, 0x01, + 0x4a, 0x89, 0x01, 0x32, 0x4a, 0x81, 0xfd, 0xe0, 0x48, 0x06, 0x00, 0xf1, + 0x1d, 0x81, 0x02, 0x20, 0x09, 0x21, 0x82, 0xf8, 0x9e, 0x00, 0xd4, 0xf8, + 0xdc, 0x00, 0x61, 0xf3, 0x03, 0x00, 0xc4, 0xf8, 0xdc, 0x00, 0xb2, 0xf8, + 0xde, 0x00, 0x00, 0x28, 0x00, 0xf0, 0x0e, 0x81, 0xd4, 0xf8, 0xa4, 0x00, + 0x01, 0x30, 0xc4, 0xf8, 0xa4, 0x00, 0x07, 0xe1, 0x96, 0xf8, 0xb2, 0x20, + 0x94, 0xf8, 0x54, 0x01, 0x90, 0x42, 0x00, 0xf0, 0x95, 0x80, 0x94, 0xf8, + 0x1e, 0x02, 0x90, 0x42, 0x16, 0xd0, 0x94, 0xf8, 0x44, 0x00, 0x01, 0xa9, + 0x40, 0xea, 0x02, 0x40, 0x00, 0xf5, 0x80, 0x70, 0x01, 0x90, 0xdf, 0xf8, + 0xbc, 0x04, 0x02, 0x68, 0x31, 0x20, 0x90, 0x47, 0x9a, 0xf8, 0x00, 0x00, + 0xc0, 0xeb, 0x40, 0x10, 0x08, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0xb2, 0x20, + 0x84, 0xf8, 0x1e, 0x22, 0xd4, 0xf8, 0x00, 0x01, 0x84, 0xf8, 0x54, 0x21, + 0x04, 0xf2, 0xcd, 0x13, 0xd0, 0xf8, 0xd4, 0x00, 0x41, 0x7f, 0x0d, 0xf1, + 0x0a, 0x00, 0x00, 0x90, 0x28, 0x46, 0x00, 0x29, 0x18, 0xbf, 0x01, 0x21, + 0xfd, 0xf7, 0x92, 0xfd, 0x94, 0xf8, 0x20, 0x01, 0x94, 0xf8, 0xcd, 0x11, + 0xb0, 0xfb, 0xf1, 0xf2, 0x02, 0xfb, 0x11, 0x00, 0x84, 0xf8, 0x56, 0x21, + 0x10, 0x44, 0x01, 0x38, 0x84, 0xf8, 0x55, 0x01, 0x9a, 0xf8, 0x00, 0x00, + 0xc0, 0xeb, 0x40, 0x10, 0x08, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0x72, 0x00, + 0x00, 0x28, 0x4f, 0xd0, 0xdf, 0xf8, 0x4c, 0xb4, 0x01, 0x38, 0xb4, 0xf8, + 0x74, 0x11, 0x04, 0xf5, 0xa8, 0x75, 0xc2, 0xb2, 0x28, 0x46, 0xdb, 0xf8, + 0x00, 0x30, 0x98, 0x47, 0x00, 0x28, 0x41, 0xd0, 0xdf, 0xf8, 0x34, 0x94, + 0xdf, 0xf8, 0x34, 0x74, 0xd4, 0xf8, 0x60, 0x21, 0x00, 0x20, 0x49, 0x46, + 0x01, 0xf0, 0x20, 0xfb, 0x39, 0x68, 0x20, 0x46, 0x88, 0x47, 0xd4, 0xf8, + 0x98, 0x00, 0xdb, 0xf8, 0x00, 0x30, 0xb4, 0xf8, 0x74, 0x11, 0x01, 0x30, + 0xc4, 0xf8, 0x98, 0x00, 0x9a, 0xf8, 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x10, + 0x08, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0x72, 0x00, 0x01, 0x38, 0xc2, 0xb2, + 0x28, 0x46, 0x98, 0x47, 0x00, 0x28, 0xdf, 0xd1, 0xdf, 0xf8, 0xf4, 0x03, + 0x00, 0x22, 0x01, 0x23, 0x01, 0x25, 0x06, 0x68, 0x94, 0xf8, 0x60, 0x01, + 0x01, 0x38, 0xc1, 0xb2, 0x20, 0x46, 0xb0, 0x47, 0x9a, 0xf8, 0x00, 0x00, + 0xdf, 0xf8, 0xb0, 0x93, 0xc0, 0xeb, 0x40, 0x11, 0x00, 0xeb, 0x00, 0x10, + 0x09, 0xeb, 0xc0, 0x00, 0x08, 0xeb, 0xc1, 0x01, 0xc0, 0x68, 0x90, 0xf8, + 0x60, 0x01, 0x81, 0xf8, 0xa0, 0x00, 0x00, 0xe0, 0x00, 0x25, 0xdf, 0xf8, + 0xbc, 0x03, 0x00, 0x68, 0x00, 0x6a, 0x80, 0x47, 0x70, 0xb1, 0xdd, 0xb1, + 0x9a, 0xf8, 0x00, 0x70, 0x02, 0x21, 0xc7, 0xeb, 0x47, 0x10, 0x08, 0xeb, + 0xc0, 0x00, 0x80, 0xf8, 0x9e, 0x10, 0x90, 0xf8, 0x9a, 0x10, 0x84, 0xf8, + 0x7e, 0x11, 0xa6, 0xe1, 0x9a, 0xf8, 0x00, 0x70, 0xc7, 0xeb, 0x47, 0x10, + 0x08, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xde, 0x10, 0x00, 0x29, 0x00, 0xf0, + 0x90, 0x81, 0x90, 0xf8, 0x9a, 0x10, 0x92, 0xe1, 0x9a, 0xf8, 0x00, 0x70, + 0x94, 0xf8, 0x7e, 0x21, 0xc7, 0xeb, 0x47, 0x10, 0x08, 0xeb, 0xc0, 0x00, + 0x90, 0xf8, 0x9a, 0x10, 0x8a, 0x42, 0x3f, 0xf4, 0xa9, 0xae, 0x87, 0xe1, + 0x34, 0x14, 0x21, 0x40, 0x38, 0x14, 0x21, 0x40, 0x3c, 0x14, 0x21, 0x40, + 0x68, 0x23, 0x11, 0xfb, 0x03, 0x21, 0x94, 0xf8, 0x4a, 0x21, 0x04, 0x2a, + 0x28, 0xbf, 0x04, 0x22, 0x01, 0xeb, 0xc2, 0x01, 0x0a, 0x89, 0x01, 0x32, + 0x0a, 0x81, 0xd4, 0xf8, 0x5c, 0x12, 0x01, 0x31, 0xc4, 0xf8, 0x5c, 0x12, + 0x9a, 0xf8, 0x00, 0x70, 0xc7, 0xeb, 0x47, 0x11, 0x08, 0xeb, 0xc1, 0x01, + 0x91, 0xf8, 0x9c, 0x20, 0x1a, 0xb1, 0x40, 0xf0, 0x04, 0x00, 0xa4, 0xf8, + 0x78, 0x01, 0xd4, 0xf8, 0xdc, 0x20, 0x01, 0x23, 0x63, 0xf3, 0x03, 0x02, + 0xc4, 0xf8, 0xdc, 0x20, 0xb1, 0xf8, 0xdc, 0x20, 0x02, 0xf0, 0x69, 0x02, + 0x09, 0x2a, 0x02, 0xd0, 0x91, 0xf8, 0x8f, 0x20, 0x22, 0xb9, 0x91, 0xf8, + 0x9d, 0x10, 0x00, 0x29, 0x00, 0xf0, 0x0a, 0x81, 0x01, 0x25, 0xc7, 0xeb, + 0x47, 0x10, 0x08, 0xeb, 0xc0, 0x00, 0x41, 0x68, 0x49, 0x7f, 0x39, 0xbb, + 0x90, 0xf8, 0x9e, 0x10, 0x01, 0x29, 0x23, 0xd0, 0x90, 0xf8, 0x72, 0x20, + 0xae, 0x48, 0xb4, 0xf8, 0x74, 0x11, 0x03, 0x68, 0x04, 0xf5, 0xa8, 0x70, + 0x98, 0x47, 0xc8, 0xb1, 0x20, 0x46, 0x00, 0xf0, 0x73, 0xf9, 0xab, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xd4, 0xf8, 0x98, 0x00, 0x94, 0xf8, + 0x1d, 0x11, 0x01, 0x30, 0xc1, 0xeb, 0x01, 0x11, 0xc4, 0xf8, 0x98, 0x00, + 0xaa, 0x48, 0x00, 0x68, 0x00, 0xeb, 0x41, 0x10, 0x90, 0xf8, 0xd6, 0x10, + 0x41, 0xf0, 0x01, 0x01, 0x80, 0xf8, 0xd6, 0x10, 0x00, 0xf0, 0x8a, 0xf9, + 0xa5, 0x48, 0x01, 0x78, 0x0a, 0x07, 0x23, 0xd4, 0xb4, 0xf8, 0x78, 0x21, + 0x52, 0x07, 0x7f, 0xf5, 0x67, 0xae, 0x9a, 0xf8, 0x00, 0x20, 0x02, 0xeb, + 0x02, 0x13, 0x09, 0xeb, 0xc3, 0x03, 0x5b, 0x68, 0x5b, 0x7f, 0x00, 0x2b, + 0x7f, 0xf4, 0x5c, 0xae, 0x9d, 0x4b, 0x1b, 0x68, 0xa3, 0x42, 0x7f, 0xf4, + 0x57, 0xae, 0x9f, 0x4b, 0x5c, 0x24, 0x01, 0xf0, 0xfd, 0x01, 0x01, 0x70, + 0x12, 0xfb, 0x04, 0x32, 0x00, 0x23, 0x82, 0xf8, 0x4d, 0x30, 0xd3, 0x62, + 0x01, 0x23, 0x82, 0xf8, 0x26, 0x30, 0x47, 0xe6, 0xed, 0x48, 0x94, 0xf8, + 0x1d, 0x11, 0x00, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, + 0xd0, 0xf8, 0xa4, 0x00, 0x84, 0x42, 0x08, 0xbf, 0x54, 0xf8, 0x04, 0x0c, + 0xb4, 0xf8, 0x78, 0x11, 0x49, 0x07, 0x00, 0xf1, 0x8b, 0x80, 0x94, 0xf8, + 0x50, 0xc1, 0xbc, 0xf1, 0x00, 0x0f, 0x1d, 0xd0, 0xb4, 0xf8, 0x58, 0x21, + 0xb4, 0xf8, 0x74, 0x31, 0x9a, 0x1a, 0x12, 0xb2, 0x00, 0x2a, 0x15, 0xd4, + 0x82, 0x4b, 0x94, 0xf8, 0x51, 0x61, 0x94, 0xf8, 0x56, 0x11, 0x94, 0xf8, + 0x55, 0x71, 0x63, 0xea, 0x02, 0x02, 0x94, 0xf8, 0x20, 0x31, 0x32, 0x44, + 0x5a, 0x43, 0x94, 0xf8, 0x57, 0x31, 0x13, 0xfb, 0x01, 0x21, 0x94, 0xf8, + 0xfb, 0x21, 0x39, 0x44, 0x8a, 0x1a, 0x00, 0xe0, 0xff, 0x22, 0x94, 0xf8, + 0x46, 0x31, 0xeb, 0xb1, 0xb4, 0xf8, 0x4e, 0x11, 0xb4, 0xf8, 0x74, 0x61, + 0x71, 0x1a, 0x0e, 0xb2, 0x00, 0x2e, 0x15, 0xd4, 0x71, 0x49, 0x94, 0xf8, + 0x47, 0x71, 0x94, 0xf8, 0x4b, 0xe1, 0x61, 0xea, 0x06, 0x08, 0x94, 0xf8, + 0x20, 0x61, 0x94, 0xf8, 0x4c, 0x11, 0x47, 0x44, 0x7e, 0x43, 0x94, 0xf8, + 0x4d, 0x71, 0x17, 0xfb, 0x01, 0x61, 0x94, 0xf8, 0xfb, 0x61, 0x71, 0x44, + 0x8e, 0x1b, 0x00, 0xe0, 0xff, 0x26, 0xb2, 0x42, 0x1a, 0xda, 0xbc, 0xf1, + 0x00, 0x0f, 0x36, 0xd0, 0xb4, 0xf8, 0x58, 0x11, 0xb4, 0xf8, 0x74, 0x21, + 0x51, 0x1a, 0x09, 0xb2, 0x00, 0x29, 0x2e, 0xd4, 0x5f, 0x4a, 0x94, 0xf8, + 0x51, 0x31, 0x94, 0xf8, 0x55, 0x61, 0x94, 0xf8, 0x56, 0x71, 0x62, 0xea, + 0x01, 0x01, 0x94, 0xf8, 0x20, 0x21, 0x19, 0x44, 0x51, 0x43, 0x94, 0xf8, + 0x57, 0x21, 0x17, 0xe0, 0xeb, 0xb1, 0xb4, 0xf8, 0x4e, 0x11, 0xb4, 0xf8, + 0x74, 0x21, 0x51, 0x1a, 0x09, 0xb2, 0x00, 0x29, 0x15, 0xd4, 0x53, 0x4a, + 0x94, 0xf8, 0x47, 0x31, 0x94, 0xf8, 0x4b, 0x61, 0x94, 0xf8, 0x4c, 0x71, + 0x62, 0xea, 0x01, 0x01, 0x94, 0xf8, 0x20, 0x21, 0x19, 0x44, 0x51, 0x43, + 0x94, 0xf8, 0x4d, 0x21, 0x12, 0xfb, 0x07, 0x11, 0x94, 0xf8, 0xfb, 0x21, + 0x31, 0x44, 0x89, 0x1a, 0x00, 0xe0, 0xff, 0x21, 0x84, 0xf8, 0xfa, 0x11, + 0xc9, 0xb2, 0x90, 0xf8, 0xfa, 0x21, 0x91, 0x42, 0xff, 0xf4, 0xaa, 0xad, + 0x44, 0x49, 0x45, 0x4a, 0x08, 0x60, 0x90, 0xf8, 0xfb, 0x11, 0x11, 0x70, + 0x00, 0xf0, 0x38, 0xf9, 0x42, 0x4c, 0x01, 0x20, 0x00, 0x26, 0x20, 0x71, + 0x41, 0x48, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0x26, 0x71, 0x97, 0xe5, + 0x80, 0x06, 0x08, 0xd5, 0x33, 0x48, 0x00, 0x68, 0x00, 0x6a, 0x80, 0x47, + 0x9a, 0xf8, 0x00, 0x70, 0x00, 0x28, 0x7f, 0xf4, 0xeb, 0xae, 0xc7, 0xeb, + 0x47, 0x10, 0x94, 0xf8, 0x7e, 0x21, 0x08, 0xeb, 0xc0, 0x00, 0x90, 0xf8, + 0x9a, 0x10, 0x8a, 0x42, 0x19, 0xd1, 0x28, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0xd4, 0xf8, 0x94, 0x00, 0xd4, 0xf8, 0xdc, 0x10, 0x9a, 0xf8, + 0x00, 0x70, 0x01, 0x25, 0x01, 0x30, 0xc4, 0xf8, 0x94, 0x00, 0x02, 0x20, + 0x60, 0xf3, 0x03, 0x01, 0xc7, 0xeb, 0x47, 0x10, 0x08, 0xeb, 0xc0, 0x00, + 0xc4, 0xf8, 0xdc, 0x10, 0x80, 0xf8, 0x9e, 0x50, 0xc7, 0xe6, 0xb0, 0xf8, + 0xdc, 0x10, 0x41, 0xf0, 0x80, 0x01, 0xa0, 0xf8, 0xdc, 0x10, 0xd4, 0xf8, + 0xa8, 0x00, 0x01, 0x30, 0xc4, 0xf8, 0xa8, 0x00, 0xba, 0xe6, 0x90, 0xf8, + 0x9a, 0x20, 0x94, 0xf8, 0x7e, 0x11, 0x91, 0x42, 0x02, 0xd1, 0x84, 0xf8, + 0x7e, 0x11, 0x1f, 0xe5, 0x02, 0x21, 0x80, 0xf8, 0x9e, 0x10, 0xb0, 0xf8, + 0xdc, 0x10, 0x41, 0xf0, 0x40, 0x01, 0xa0, 0xf8, 0xdc, 0x10, 0x15, 0xe5, + 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0x40, 0xb7, 0x08, 0x00, + 0xfc, 0x6d, 0x01, 0x00, 0x60, 0xb7, 0x08, 0x00, 0x68, 0xd2, 0x08, 0x00, + 0x70, 0xe3, 0x08, 0x00, 0x44, 0xb7, 0x08, 0x00, 0x4c, 0xb7, 0x08, 0x00, + 0x1c, 0xa1, 0x08, 0x00, 0xd0, 0xb7, 0x08, 0x00, 0xc2, 0xef, 0x03, 0x00, + 0xd8, 0xb7, 0x08, 0x00, 0xc0, 0xb7, 0x08, 0x00, 0xe4, 0x35, 0x01, 0x00, + 0xbc, 0xb7, 0x08, 0x00, 0xd4, 0xb7, 0x08, 0x00, 0xb0, 0xe6, 0x05, 0x00, + 0xe0, 0x35, 0x01, 0x00, 0x97, 0x53, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xd8, 0x35, 0x01, 0x00, 0x98, 0x53, 0x01, 0x00, 0x14, 0xe6, 0x05, 0x00, + 0xb8, 0xbe, 0x08, 0x00, 0x44, 0x4f, 0x01, 0x00, 0x54, 0x49, 0x90, 0xf8, + 0x1d, 0x21, 0x09, 0x68, 0xc2, 0xeb, 0x02, 0x12, 0x01, 0xeb, 0x42, 0x11, + 0x91, 0xf8, 0xc1, 0x10, 0x03, 0x29, 0x07, 0xd8, 0xdf, 0xe8, 0x01, 0xf0, + 0x02, 0x0a, 0x0e, 0x12, 0xd0, 0xf8, 0x60, 0x21, 0x0c, 0x49, 0x0e, 0xe0, + 0xd0, 0xf8, 0x60, 0x21, 0x0b, 0x49, 0x0a, 0xe0, 0xd0, 0xf8, 0x60, 0x21, + 0x07, 0x49, 0x06, 0xe0, 0xd0, 0xf8, 0x60, 0x21, 0x04, 0x49, 0x02, 0xe0, + 0xd0, 0xf8, 0x60, 0x21, 0x01, 0x49, 0x00, 0x20, 0x01, 0xf0, 0xca, 0xb8, + 0xaa, 0xef, 0x03, 0x00, 0x9e, 0xef, 0x03, 0x00, 0x92, 0xef, 0x03, 0x00, + 0x86, 0xef, 0x03, 0x00, 0xb6, 0xef, 0x03, 0x00, 0x70, 0xb5, 0x6f, 0x48, + 0x39, 0x49, 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x01, 0xeb, 0xc0, 0x02, + 0xd0, 0x68, 0x90, 0xf8, 0x46, 0x11, 0x41, 0xb1, 0xb0, 0xf8, 0x4e, 0x31, + 0xb0, 0xf8, 0x74, 0x41, 0xe3, 0x1a, 0x1b, 0xb2, 0xb3, 0xf1, 0xff, 0x3f, + 0x2c, 0xdc, 0x90, 0xf8, 0x50, 0x31, 0x43, 0xb1, 0xb0, 0xf8, 0x58, 0x31, + 0xb0, 0xf8, 0x74, 0x41, 0xe3, 0x1a, 0x1b, 0xb2, 0xb3, 0xf1, 0xff, 0x3f, + 0x20, 0xdc, 0xb0, 0xf8, 0x78, 0x31, 0x43, 0xf0, 0x80, 0x04, 0xa0, 0xf8, + 0x78, 0x41, 0x28, 0x4c, 0xb4, 0xf8, 0xba, 0x41, 0xa4, 0x07, 0x15, 0xd5, + 0x54, 0x68, 0x64, 0x7f, 0x94, 0xb9, 0x25, 0x4c, 0x90, 0xf8, 0x1d, 0x51, + 0x90, 0xf8, 0x20, 0x61, 0x24, 0x68, 0xc5, 0xeb, 0x05, 0x15, 0x04, 0xeb, + 0x45, 0x14, 0x94, 0xf8, 0xc1, 0x40, 0x02, 0x34, 0xb4, 0x42, 0x04, 0xbf, + 0x43, 0xf0, 0x84, 0x03, 0xa0, 0xf8, 0x78, 0x31, 0xb2, 0xf8, 0xdc, 0x30, + 0xdb, 0x07, 0x06, 0xbf, 0x90, 0xf8, 0xb8, 0x31, 0x01, 0x33, 0x00, 0x23, + 0x52, 0x68, 0x80, 0xf8, 0xb8, 0x31, 0x52, 0x7f, 0x02, 0xb1, 0x70, 0xbd, + 0x00, 0x29, 0xfc, 0xd0, 0xda, 0xb2, 0x03, 0x2a, 0xf9, 0xd3, 0x90, 0xf8, + 0x47, 0x21, 0x02, 0x2a, 0xf5, 0xd3, 0x90, 0xf8, 0x50, 0x31, 0xb0, 0xf8, + 0x74, 0x21, 0x33, 0xb1, 0xb0, 0xf8, 0x58, 0x31, 0xd3, 0x1a, 0x1b, 0xb2, + 0xb3, 0xf1, 0xff, 0x3f, 0xe9, 0xdc, 0xb0, 0xf8, 0x4e, 0x31, 0x93, 0x42, + 0xe5, 0xd1, 0x90, 0xf8, 0x4d, 0x21, 0x01, 0x39, 0x91, 0x42, 0xe0, 0xd1, + 0xb0, 0xf8, 0x78, 0x11, 0x41, 0xf0, 0x04, 0x01, 0xa0, 0xf8, 0x78, 0x11, + 0x70, 0xbd, 0x00, 0xbf, 0x0c, 0x6f, 0x01, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0xe0, 0x35, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x47, 0x89, 0x46, 0x04, 0x46, + 0x20, 0xb9, 0x00, 0x20, 0x4f, 0xf4, 0x18, 0x71, 0xe3, 0xf7, 0xb8, 0xf8, + 0x94, 0xf8, 0x20, 0x01, 0x48, 0x45, 0x04, 0xd8, 0x00, 0x20, 0x40, 0xf2, + 0x61, 0x21, 0xe3, 0xf7, 0xaf, 0xf8, 0xd4, 0xf8, 0x00, 0x01, 0x00, 0xf2, + 0xed, 0x20, 0x00, 0xf0, 0x53, 0xf8, 0xdf, 0xf8, 0x94, 0x80, 0xdf, 0xf8, + 0x94, 0xa0, 0x5c, 0x27, 0x04, 0xf5, 0x82, 0x71, 0x98, 0xf8, 0x00, 0x00, + 0x10, 0xfb, 0x07, 0xa0, 0x41, 0x63, 0x94, 0xf8, 0x40, 0x11, 0x80, 0xf8, + 0x4f, 0x10, 0xd4, 0xf8, 0xe0, 0x10, 0x81, 0x60, 0x04, 0xf1, 0xe4, 0x01, + 0x0c, 0x30, 0x91, 0xe8, 0x6c, 0x00, 0x6c, 0xc0, 0x1a, 0x48, 0x4b, 0x46, + 0xd4, 0xf8, 0x00, 0x11, 0xb4, 0xf8, 0x74, 0x21, 0x05, 0x68, 0xd4, 0xf8, + 0xe0, 0x00, 0x01, 0xf5, 0x22, 0x71, 0xa8, 0x47, 0x98, 0xf8, 0x00, 0x00, + 0x94, 0xf8, 0x4a, 0x21, 0x02, 0x23, 0x10, 0xfb, 0x07, 0xf1, 0x0a, 0xf8, + 0x01, 0x20, 0x10, 0xfb, 0x07, 0xa1, 0x94, 0xf8, 0x54, 0x01, 0x48, 0x70, + 0xd4, 0xf8, 0x00, 0x01, 0xd0, 0xf8, 0x88, 0x20, 0x03, 0xea, 0x52, 0x45, + 0x03, 0xea, 0x12, 0x42, 0x01, 0x23, 0x81, 0xf8, 0x4b, 0x20, 0x81, 0xf8, + 0x4c, 0x50, 0x01, 0xf1, 0x52, 0x02, 0x07, 0x49, 0xd1, 0xf8, 0x00, 0xc0, + 0x94, 0xf8, 0x44, 0x10, 0xbd, 0xe8, 0xf0, 0x47, 0x60, 0x47, 0x00, 0xbf, + 0x74, 0x87, 0x08, 0x00, 0x44, 0x4f, 0x01, 0x00, 0x24, 0xa1, 0x08, 0x00, + 0xc4, 0xbc, 0x08, 0x00, 0xcd, 0x49, 0x08, 0x4a, 0x5c, 0x23, 0x09, 0x78, + 0x11, 0xfb, 0x03, 0x21, 0x02, 0x78, 0x4a, 0x60, 0x43, 0x78, 0x42, 0xea, + 0x03, 0x22, 0x4a, 0x60, 0x80, 0x78, 0x42, 0xea, 0x00, 0x40, 0x48, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x44, 0x4f, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x41, + 0x8c, 0xb0, 0xc4, 0x68, 0x00, 0x2c, 0x3e, 0xd0, 0xc0, 0x4e, 0x05, 0x46, + 0xc0, 0x4f, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, + 0xb0, 0xf8, 0xdc, 0x00, 0x00, 0xf0, 0x49, 0x00, 0x09, 0x28, 0x1d, 0xd1, + 0xbb, 0x48, 0x00, 0x68, 0x80, 0x47, 0x29, 0x68, 0xc1, 0xf8, 0xd8, 0x00, + 0x20, 0x6c, 0x20, 0xf4, 0x80, 0x10, 0x20, 0x64, 0x28, 0x68, 0xd0, 0xf8, + 0xd8, 0x00, 0xc4, 0xf8, 0xf4, 0x00, 0x94, 0xf8, 0x54, 0x01, 0x02, 0x28, + 0x0a, 0xd3, 0x04, 0x28, 0x08, 0xd8, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, + 0x07, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0xb2, 0x00, 0x84, 0xf8, 0x54, 0x01, + 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x01, 0x91, 0xf8, + 0x9e, 0x20, 0x01, 0xf1, 0xde, 0x00, 0x82, 0xb1, 0x02, 0x88, 0x2a, 0xb1, + 0x2b, 0x68, 0x93, 0xf8, 0x8a, 0x30, 0x5b, 0x07, 0x00, 0xf1, 0xc7, 0x80, + 0x09, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x26, 0x41, 0x0c, 0xb0, 0xbd, 0xe8, + 0xf0, 0x41, 0xe8, 0xf7, 0x57, 0xbe, 0x00, 0x21, 0x01, 0x80, 0x30, 0x78, + 0xc0, 0xeb, 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, 0x41, 0x68, 0x49, 0x7f, + 0x39, 0xb3, 0x90, 0xf8, 0x9e, 0x10, 0x01, 0x29, 0x23, 0xd0, 0x90, 0xf8, + 0x72, 0x20, 0xc1, 0x48, 0xb4, 0xf8, 0x74, 0x11, 0x03, 0x68, 0x04, 0xf5, + 0xa8, 0x70, 0x98, 0x47, 0xc8, 0xb1, 0x20, 0x46, 0xff, 0xf7, 0x6c, 0xfe, + 0x96, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xd4, 0xf8, 0x98, 0x00, + 0x94, 0xf8, 0x1d, 0x11, 0x01, 0x30, 0xc1, 0xeb, 0x01, 0x11, 0xc4, 0xf8, + 0x98, 0x00, 0xb6, 0x48, 0x00, 0x68, 0x00, 0xeb, 0x41, 0x10, 0x90, 0xf8, + 0xd6, 0x10, 0x41, 0xf0, 0x01, 0x01, 0x80, 0xf8, 0xd6, 0x10, 0x8c, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x98, 0xb3, 0x31, 0x78, 0x02, 0x68, 0xc1, 0xeb, + 0x41, 0x11, 0x6f, 0xf3, 0x9f, 0x52, 0x07, 0xeb, 0xc1, 0x01, 0xb1, 0xf8, + 0xde, 0x10, 0x42, 0xea, 0x81, 0x51, 0x01, 0x60, 0x21, 0xf4, 0x40, 0x61, + 0x32, 0x78, 0xc2, 0xeb, 0x42, 0x12, 0x07, 0xeb, 0xc2, 0x02, 0x92, 0xf8, + 0xa1, 0x20, 0x02, 0xf0, 0x03, 0x02, 0x41, 0xea, 0x82, 0x21, 0x01, 0x60, + 0x21, 0xf4, 0x40, 0x41, 0x32, 0x78, 0xc2, 0xeb, 0x42, 0x12, 0x07, 0xeb, + 0xc2, 0x02, 0x92, 0xf8, 0x9e, 0x20, 0x02, 0xf0, 0x03, 0x02, 0x41, 0xea, + 0x82, 0x31, 0x01, 0x60, 0x21, 0xf0, 0xff, 0x01, 0x32, 0x78, 0xc2, 0xeb, + 0x42, 0x12, 0x07, 0xeb, 0xc2, 0x02, 0x92, 0xf8, 0xa0, 0x20, 0x11, 0x44, + 0x01, 0x60, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, + 0x90, 0xf8, 0x9e, 0x20, 0x90, 0xf8, 0xa0, 0x10, 0x94, 0xf8, 0x60, 0x01, + 0x43, 0x1a, 0x6b, 0x48, 0x18, 0xbf, 0x01, 0x23, 0x05, 0x68, 0x20, 0x46, + 0xa8, 0x47, 0x94, 0xf8, 0x7c, 0x01, 0x01, 0x28, 0x13, 0xd1, 0x30, 0x78, + 0xc0, 0xeb, 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x00, + 0x00, 0xf0, 0x49, 0x00, 0x09, 0x28, 0x08, 0xd1, 0x02, 0x20, 0x21, 0x46, + 0x00, 0x22, 0x84, 0xf8, 0x7c, 0x01, 0x59, 0x48, 0x03, 0x68, 0xac, 0x20, + 0x98, 0x47, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, + 0xb0, 0xf8, 0xdc, 0x10, 0xc9, 0x07, 0x12, 0xd0, 0x00, 0xf1, 0xc0, 0x01, + 0x57, 0x48, 0xd0, 0xf8, 0x00, 0x80, 0x57, 0x48, 0x02, 0x68, 0x05, 0xa8, + 0x90, 0x47, 0x08, 0xaf, 0x05, 0xab, 0x0b, 0x9d, 0xc1, 0xcf, 0x0e, 0xcb, + 0x8d, 0xe8, 0xc1, 0x00, 0x20, 0x46, 0x03, 0x95, 0xc0, 0x47, 0x51, 0x4a, + 0x94, 0xf8, 0x44, 0x10, 0xd4, 0xf8, 0x00, 0x01, 0x12, 0x68, 0x90, 0x47, + 0x4e, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x0c, 0xb0, 0xbd, 0xe8, + 0xf0, 0x81, 0x04, 0x3a, 0x02, 0x80, 0xb1, 0xf8, 0xdc, 0x00, 0x00, 0xf0, + 0x49, 0x00, 0x09, 0x28, 0x41, 0xd1, 0xb4, 0xf8, 0x7a, 0x01, 0x40, 0x07, + 0x3d, 0xd4, 0x3b, 0x48, 0x00, 0x68, 0x00, 0x6a, 0x80, 0x47, 0xc0, 0xb3, + 0x94, 0xf9, 0x8c, 0x01, 0x00, 0x28, 0x34, 0xd4, 0xd4, 0xf8, 0xdc, 0x00, + 0x0a, 0x21, 0x61, 0xf3, 0x03, 0x00, 0xc4, 0xf8, 0xdc, 0x00, 0x30, 0x78, + 0xc0, 0xeb, 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x10, + 0x41, 0xf4, 0x80, 0x71, 0xa0, 0xf8, 0xdc, 0x10, 0x94, 0xf8, 0x78, 0x01, + 0x80, 0x06, 0x5c, 0xbf, 0xb4, 0xf8, 0x7a, 0x01, 0x5f, 0xea, 0x00, 0x70, + 0x3e, 0xd5, 0xb4, 0xf8, 0x74, 0x21, 0x2a, 0x49, 0x00, 0x20, 0x00, 0x25, + 0x00, 0xf0, 0x82, 0xfe, 0x30, 0x78, 0x28, 0x49, 0xc0, 0xeb, 0x40, 0x10, + 0x07, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0x72, 0x20, 0x00, 0x20, 0x00, 0xf0, + 0x77, 0xfe, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, + 0xa0, 0xf8, 0xde, 0x50, 0xf9, 0xe6, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, + 0x07, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x00, 0x00, 0xf0, 0x49, 0x00, + 0x09, 0x28, 0x04, 0xd1, 0x16, 0x48, 0x00, 0x68, 0x00, 0x6a, 0x80, 0x47, + 0x68, 0xb1, 0xb4, 0xf8, 0x7a, 0x01, 0x40, 0x07, 0x7f, 0xf5, 0xe5, 0xae, + 0x30, 0x78, 0x00, 0x21, 0xc0, 0xeb, 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, + 0xa0, 0xf8, 0xde, 0x10, 0xdb, 0xe6, 0xb4, 0xf8, 0x78, 0x01, 0x20, 0xf0, + 0x20, 0x00, 0xa4, 0xf8, 0x78, 0x01, 0xd4, 0xe6, 0x0a, 0x48, 0x21, 0x46, + 0x3d, 0x22, 0x03, 0x68, 0xb1, 0x20, 0x98, 0x47, 0xb4, 0xf8, 0x7a, 0x01, + 0x40, 0xf0, 0x08, 0x00, 0xa4, 0xf8, 0x7a, 0x01, 0xb3, 0xe7, 0x00, 0xbf, + 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0xe0, 0xa0, 0x08, 0x00, + 0xe4, 0x35, 0x01, 0x00, 0xa8, 0xa0, 0x08, 0x00, 0xce, 0xef, 0x03, 0x00, + 0xe1, 0xef, 0x03, 0x00, 0xd8, 0xb7, 0x08, 0x00, 0xcc, 0xb7, 0x08, 0x00, + 0xc0, 0xb7, 0x08, 0x00, 0xf4, 0xb7, 0x08, 0x00, 0x18, 0xb8, 0x08, 0x00, + 0xcc, 0xa1, 0x08, 0x00, 0xdc, 0xb7, 0x08, 0x00, 0x70, 0xb5, 0x64, 0x4c, + 0x4f, 0x4d, 0x1c, 0x4b, 0x20, 0x78, 0x1b, 0x68, 0xc0, 0xeb, 0x40, 0x10, + 0x05, 0xeb, 0xc0, 0x00, 0xc6, 0x68, 0x90, 0xf8, 0x72, 0x20, 0xb6, 0xf8, + 0x74, 0x11, 0x06, 0xf5, 0xa3, 0x70, 0x98, 0x47, 0x50, 0xb1, 0xb6, 0xf8, + 0x78, 0x01, 0xc0, 0x07, 0x06, 0xd0, 0xd6, 0xf8, 0x30, 0x02, 0x18, 0xb1, + 0x80, 0x6a, 0x08, 0xb1, 0x08, 0x21, 0x01, 0x75, 0x00, 0xf0, 0x06, 0xfe, + 0x98, 0xb1, 0x01, 0x28, 0x14, 0xd1, 0x20, 0x78, 0x0c, 0x49, 0xc0, 0xeb, + 0x40, 0x10, 0x09, 0x68, 0x05, 0xeb, 0xc0, 0x00, 0xc0, 0x68, 0x90, 0xf8, + 0x1d, 0x01, 0xc0, 0xeb, 0x00, 0x10, 0x01, 0xeb, 0x40, 0x10, 0x07, 0x49, + 0x09, 0x68, 0x88, 0x47, 0x18, 0xb1, 0x3c, 0x49, 0x00, 0x20, 0x08, 0x70, + 0x70, 0xbd, 0x01, 0x20, 0x70, 0xbd, 0x00, 0xbf, 0xd0, 0xb7, 0x08, 0x00, + 0xe0, 0x35, 0x01, 0x00, 0x34, 0xd1, 0x08, 0x00, 0x80, 0xb5, 0x43, 0x48, + 0x43, 0x49, 0x00, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x01, 0xeb, 0xc0, 0x00, + 0xc0, 0x68, 0x38, 0xb1, 0x0b, 0x48, 0x00, 0x78, 0x40, 0x07, 0x0a, 0xd4, + 0x00, 0x20, 0x40, 0xf2, 0x27, 0x71, 0x02, 0xe0, 0x00, 0x20, 0x40, 0xf2, + 0x26, 0x71, 0xbd, 0xe8, 0x80, 0x40, 0xe8, 0xf7, 0xa5, 0xbc, 0x00, 0xf0, + 0xcf, 0xfd, 0x38, 0x48, 0x01, 0x21, 0x02, 0x68, 0x40, 0x20, 0xbd, 0xe8, + 0x80, 0x40, 0x10, 0x47, 0x97, 0x53, 0x01, 0x00, 0x10, 0xb5, 0x31, 0x48, + 0x1c, 0x49, 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x01, 0xeb, 0xc0, 0x00, + 0xc4, 0x68, 0x8c, 0xb1, 0x0c, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, + 0x0b, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x94, 0xf8, 0xf8, 0x01, + 0x10, 0xb1, 0x01, 0x38, 0x84, 0xf8, 0xf8, 0x01, 0xbd, 0xe8, 0x10, 0x40, + 0x00, 0xf0, 0xb0, 0xbd, 0x00, 0x20, 0x40, 0xf2, 0x45, 0x71, 0xe8, 0xf7, + 0x79, 0xfc, 0x00, 0x20, 0x10, 0xbd, 0x00, 0xbf, 0x68, 0xd2, 0x08, 0x00, + 0x70, 0xe3, 0x08, 0x00, 0x1d, 0x49, 0x09, 0x4a, 0x09, 0x78, 0xc1, 0xeb, + 0x41, 0x11, 0x02, 0xeb, 0xc1, 0x01, 0xb1, 0xf8, 0xdc, 0x10, 0x01, 0xf0, + 0x49, 0x01, 0x09, 0x29, 0x04, 0xd1, 0xc1, 0x68, 0x0a, 0x6c, 0x22, 0xf4, + 0x80, 0x12, 0x0a, 0x64, 0x00, 0xf0, 0x96, 0xbd, 0x0c, 0x6f, 0x01, 0x00, + 0x80, 0xb5, 0x00, 0xf0, 0x97, 0xfd, 0x00, 0xb1, 0x80, 0xbd, 0x02, 0x49, + 0x00, 0x22, 0x0a, 0x70, 0x80, 0xbd, 0x00, 0xbf, 0x60, 0xd4, 0x05, 0x00, + 0x80, 0xb5, 0x0c, 0x48, 0x0c, 0x49, 0x00, 0x78, 0x00, 0xeb, 0x00, 0x10, + 0x01, 0xeb, 0xc0, 0x00, 0xc0, 0x68, 0x40, 0xb1, 0x00, 0xf0, 0x88, 0xfd, + 0x08, 0x48, 0x01, 0x21, 0x02, 0x68, 0x40, 0x20, 0xbd, 0xe8, 0x80, 0x40, + 0x10, 0x47, 0x00, 0x20, 0x40, 0xf2, 0x36, 0x71, 0xbd, 0xe8, 0x80, 0x40, + 0xe8, 0xf7, 0x36, 0xbc, 0x74, 0x87, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, + 0xf8, 0xb9, 0x08, 0x00, 0x7c, 0xb5, 0x2c, 0x48, 0xf0, 0x4d, 0x00, 0x21, + 0x01, 0x60, 0x28, 0x78, 0xef, 0x49, 0x00, 0xeb, 0x00, 0x10, 0x01, 0xeb, + 0xc0, 0x02, 0xd4, 0x68, 0x00, 0x2c, 0x45, 0xd0, 0x51, 0xf8, 0x30, 0x00, + 0x00, 0x28, 0x41, 0xd0, 0x94, 0xf8, 0x68, 0x11, 0x01, 0xaa, 0x20, 0x46, + 0xf3, 0xf7, 0x5c, 0xf9, 0xc8, 0xb3, 0x01, 0x9e, 0xbe, 0xb3, 0x96, 0xf8, + 0x47, 0x00, 0x94, 0xf8, 0x4a, 0x11, 0x81, 0x42, 0x31, 0xd0, 0x94, 0xf8, + 0x1d, 0x12, 0x81, 0x42, 0x0f, 0xd0, 0x94, 0xf8, 0x44, 0x10, 0x41, 0xea, + 0x00, 0x40, 0x69, 0x46, 0x00, 0x90, 0xe5, 0x48, 0x02, 0x68, 0x31, 0x20, + 0x90, 0x47, 0x96, 0xf8, 0x47, 0x00, 0x84, 0xf8, 0x1d, 0x02, 0x96, 0xf8, + 0x47, 0x00, 0x84, 0xf8, 0x4a, 0x01, 0x2b, 0x78, 0x5c, 0x25, 0x96, 0xf8, + 0x46, 0x10, 0x13, 0xfb, 0x05, 0xf3, 0x84, 0xf8, 0xcc, 0x11, 0x94, 0xf8, + 0x20, 0x11, 0x96, 0xf8, 0x46, 0x20, 0xb1, 0xfb, 0xf2, 0xf2, 0x84, 0xf8, + 0x4c, 0x21, 0x96, 0xf8, 0x46, 0x50, 0xd3, 0x4e, 0xf0, 0x54, 0xb1, 0xfb, + 0xf5, 0xf0, 0x00, 0xfb, 0x15, 0x10, 0x10, 0x44, 0x01, 0x38, 0x84, 0xf8, + 0x4b, 0x01, 0x7c, 0xbd, 0x00, 0x20, 0x40, 0xf2, 0xc1, 0x51, 0xe8, 0xf7, + 0xd7, 0xfb, 0x7c, 0xbd, 0x14, 0xe6, 0x05, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x87, 0xb0, 0x88, 0x46, 0x04, 0x46, 0x20, 0xb9, 0x00, 0x20, 0x40, 0xf2, + 0xef, 0x51, 0xe2, 0xf7, 0x67, 0xfd, 0x94, 0xf8, 0x20, 0x01, 0x40, 0x45, + 0x04, 0xd8, 0x00, 0x20, 0x4f, 0xf4, 0xbe, 0x61, 0xe2, 0xf7, 0x5e, 0xfd, + 0xd4, 0xf8, 0x70, 0x01, 0xd4, 0xf8, 0x24, 0x11, 0xb5, 0x4e, 0x94, 0xf8, + 0x1d, 0x21, 0x01, 0xfb, 0x08, 0x05, 0x30, 0x68, 0xc2, 0xeb, 0x02, 0x12, + 0x00, 0xeb, 0x42, 0x10, 0xb1, 0x4a, 0x29, 0x01, 0xb8, 0x30, 0x13, 0x68, + 0x05, 0xaa, 0x98, 0x47, 0xdf, 0xf8, 0xbc, 0x92, 0xaf, 0x4a, 0x99, 0xf8, + 0x00, 0x00, 0x00, 0xeb, 0x00, 0x11, 0x02, 0xeb, 0xc1, 0x01, 0x49, 0x68, + 0x49, 0x7f, 0x29, 0xb3, 0x94, 0xf8, 0x7c, 0x01, 0x01, 0x28, 0x0e, 0xd1, + 0x94, 0xf8, 0x42, 0x00, 0x00, 0x07, 0x11, 0xd5, 0x94, 0xf8, 0x1d, 0x11, + 0x30, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, 0x90, 0xf8, + 0xc0, 0x00, 0x01, 0x28, 0x06, 0xd9, 0xa2, 0x48, 0x05, 0xaa, 0x29, 0x46, + 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x04, 0xe0, 0x9f, 0x48, 0x05, 0xa9, + 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x9e, 0x49, 0x09, 0x78, 0x08, 0x44, + 0x9d, 0x49, 0x08, 0x60, 0x99, 0xf8, 0x00, 0x00, 0x9c, 0x4f, 0x4f, 0xf0, + 0x5c, 0x0a, 0xdd, 0xe9, 0x05, 0x12, 0x10, 0xfb, 0x0a, 0x70, 0xc0, 0xe9, + 0x07, 0x12, 0x99, 0x49, 0x12, 0x22, 0x0a, 0x60, 0x05, 0x21, 0x80, 0xf8, + 0x27, 0x10, 0xfa, 0x21, 0x81, 0x84, 0x01, 0x21, 0x81, 0x70, 0x99, 0xf8, + 0x00, 0x00, 0x10, 0xfb, 0x0a, 0x70, 0x80, 0xf8, 0x51, 0x10, 0xd4, 0xf8, + 0x00, 0x01, 0x00, 0xf2, 0xed, 0x20, 0xff, 0xf7, 0xa3, 0xfc, 0x99, 0xf8, + 0x00, 0x00, 0x04, 0xf5, 0x82, 0x71, 0x10, 0xfb, 0x0a, 0x70, 0x41, 0x63, + 0x94, 0xf8, 0x40, 0x11, 0x80, 0xf8, 0x4f, 0x10, 0xd4, 0xf8, 0xe0, 0x10, + 0x81, 0x60, 0x04, 0xf1, 0xe4, 0x01, 0x0c, 0x30, 0x91, 0xe8, 0x6c, 0x00, + 0x6c, 0xc0, 0x85, 0x48, 0x43, 0x46, 0xd4, 0xf8, 0x00, 0x11, 0xb4, 0xf8, + 0x74, 0x21, 0x05, 0x68, 0xd4, 0xf8, 0xe0, 0x00, 0x01, 0xf5, 0x22, 0x71, + 0xa8, 0x47, 0xd4, 0xf8, 0x3c, 0x01, 0xfe, 0xf7, 0x9f, 0xfe, 0x00, 0x28, + 0x00, 0xf0, 0xc0, 0x80, 0x01, 0x90, 0x00, 0x20, 0x94, 0xf8, 0x68, 0x11, + 0x04, 0xaa, 0x04, 0x90, 0x20, 0x46, 0xf3, 0xf7, 0x6f, 0xf8, 0x00, 0x28, + 0x00, 0xf0, 0x90, 0x80, 0xa8, 0xf1, 0x01, 0x00, 0xdf, 0xf8, 0xd8, 0x91, + 0xdf, 0xf8, 0xe0, 0xa1, 0x76, 0x4f, 0x75, 0x4d, 0xcd, 0xf8, 0x08, 0x80, + 0x04, 0xf5, 0xa3, 0x78, 0xc6, 0xb2, 0xdd, 0xf8, 0x10, 0xb0, 0xbb, 0xf1, + 0x00, 0x0f, 0x7a, 0xd0, 0x9b, 0xf8, 0x47, 0x00, 0x94, 0xf8, 0x4a, 0x11, + 0x81, 0x42, 0x73, 0xd0, 0x94, 0xf8, 0x1d, 0x12, 0x81, 0x42, 0x0f, 0xd0, + 0x94, 0xf8, 0x44, 0x10, 0x41, 0xea, 0x00, 0x40, 0x03, 0xa9, 0x03, 0x90, + 0x65, 0x48, 0x02, 0x68, 0x31, 0x20, 0x90, 0x47, 0x9b, 0xf8, 0x47, 0x00, + 0x84, 0xf8, 0x1d, 0x02, 0x9b, 0xf8, 0x47, 0x00, 0x84, 0xf8, 0x4a, 0x01, + 0x94, 0xf8, 0x20, 0x11, 0x9b, 0xf8, 0x46, 0x00, 0xb1, 0xfb, 0xf0, 0xf2, + 0x84, 0xf8, 0xcc, 0x01, 0x02, 0xfb, 0x10, 0x10, 0x84, 0xf8, 0x4c, 0x21, + 0x10, 0x44, 0x01, 0x38, 0x84, 0xf8, 0x4b, 0x01, 0x02, 0x98, 0x00, 0x28, + 0x6d, 0xd0, 0xb4, 0xf8, 0x74, 0x11, 0xd9, 0xf8, 0x00, 0x30, 0x40, 0x46, + 0x32, 0x46, 0x98, 0x47, 0xdf, 0xf8, 0x1c, 0xb1, 0xb8, 0xb3, 0xd4, 0xf8, + 0x68, 0x21, 0x00, 0x20, 0x29, 0x46, 0x00, 0xf0, 0xf7, 0xfb, 0x94, 0xf8, + 0x68, 0x11, 0x3a, 0x68, 0x20, 0x46, 0x90, 0x47, 0xda, 0xf8, 0x00, 0x10, + 0x20, 0x46, 0x88, 0x47, 0xb4, 0xf8, 0x78, 0x01, 0xc1, 0x07, 0x08, 0xd0, + 0x20, 0xf0, 0x01, 0x00, 0xa4, 0xf8, 0x78, 0x01, 0xd4, 0xf8, 0x88, 0x00, + 0x01, 0x30, 0xc4, 0xf8, 0x88, 0x00, 0xd4, 0xf8, 0x84, 0x00, 0x94, 0xf8, + 0x1d, 0x11, 0x32, 0x46, 0x01, 0x30, 0xc1, 0xeb, 0x01, 0x11, 0xc4, 0xf8, + 0x84, 0x00, 0xdb, 0xf8, 0x00, 0x00, 0x00, 0xeb, 0x41, 0x10, 0x90, 0xf8, + 0xd6, 0x10, 0x41, 0xf0, 0x01, 0x01, 0x80, 0xf8, 0xd6, 0x10, 0x40, 0x46, + 0xb4, 0xf8, 0x74, 0x11, 0xd9, 0xf8, 0x00, 0x30, 0x98, 0x47, 0x00, 0x28, + 0xc7, 0xd1, 0x94, 0xf8, 0x68, 0x11, 0x20, 0x46, 0x04, 0xaa, 0xf2, 0xf7, + 0xe3, 0xff, 0x00, 0x28, 0x7f, 0xf4, 0x81, 0xaf, 0x21, 0xe0, 0x35, 0x48, + 0x35, 0x49, 0x01, 0x60, 0x94, 0xf8, 0xcc, 0x01, 0xd8, 0xb1, 0xd4, 0xf8, + 0x00, 0x01, 0x1d, 0x21, 0xd0, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0x00, 0x28, + 0x08, 0xbf, 0x1c, 0x21, 0x01, 0x98, 0x40, 0x5c, 0x05, 0x21, 0x84, 0xf8, + 0x4a, 0x11, 0x94, 0xf8, 0x20, 0x11, 0x84, 0xf8, 0xcc, 0x01, 0xb1, 0xfb, + 0xf0, 0xf2, 0x02, 0xfb, 0x10, 0x10, 0x84, 0xf8, 0x4c, 0x21, 0x10, 0x44, + 0x01, 0x38, 0x84, 0xf8, 0x4b, 0x01, 0xdf, 0xf8, 0x58, 0x90, 0x1b, 0x4f, + 0x4f, 0xf0, 0x5c, 0x0a, 0x99, 0xf8, 0x00, 0x00, 0x94, 0xf8, 0x4a, 0x21, + 0x02, 0x23, 0x10, 0xfb, 0x0a, 0xf1, 0x7a, 0x54, 0x10, 0xfb, 0x0a, 0x71, + 0x94, 0xf8, 0x54, 0x01, 0x48, 0x70, 0xd4, 0xf8, 0x00, 0x01, 0xd0, 0xf8, + 0x88, 0x20, 0x03, 0xea, 0x52, 0x45, 0x03, 0xea, 0x12, 0x42, 0x01, 0x23, + 0x81, 0xf8, 0x4b, 0x20, 0x81, 0xf8, 0x4c, 0x50, 0x01, 0xf1, 0x52, 0x02, + 0x15, 0x49, 0x0d, 0x68, 0x94, 0xf8, 0x44, 0x10, 0xa8, 0x47, 0x07, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0xe0, 0x35, 0x01, 0x00, 0x5c, 0xa1, 0x08, 0x00, + 0x74, 0x87, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, 0x30, 0xa1, 0x08, 0x00, + 0xa0, 0xbc, 0x08, 0x00, 0xa8, 0x0d, 0x01, 0x00, 0x54, 0x11, 0x21, 0x40, + 0x44, 0x4f, 0x01, 0x00, 0x60, 0x11, 0x21, 0x40, 0x24, 0xa1, 0x08, 0x00, + 0x1c, 0xa1, 0x08, 0x00, 0xd0, 0xb7, 0x08, 0x00, 0xf4, 0xef, 0x03, 0x00, + 0xbc, 0xb7, 0x08, 0x00, 0xd4, 0xb7, 0x08, 0x00, 0x14, 0xe6, 0x05, 0x00, + 0x61, 0xe4, 0x03, 0x00, 0xc4, 0xbc, 0x08, 0x00, 0x2d, 0xe9, 0xfc, 0x41, + 0x04, 0x46, 0x90, 0xf8, 0x46, 0x01, 0x00, 0x28, 0x69, 0xd0, 0xb4, 0xf8, + 0x4e, 0x61, 0xb4, 0xf8, 0x74, 0x01, 0x80, 0x1b, 0x00, 0xb2, 0x00, 0x28, + 0x61, 0xd4, 0xd4, 0xf8, 0x3c, 0x01, 0xfe, 0xf7, 0x7f, 0xfd, 0x05, 0x46, + 0xb4, 0xf8, 0x78, 0x01, 0x42, 0x4f, 0xdf, 0xf8, 0x0c, 0x81, 0x4f, 0xf4, + 0x80, 0x71, 0x40, 0xf0, 0x01, 0x00, 0xa4, 0xf8, 0x78, 0x01, 0x38, 0x78, + 0x00, 0xeb, 0x80, 0x00, 0x08, 0xeb, 0xc0, 0x00, 0x81, 0x82, 0x00, 0x21, + 0x41, 0x81, 0x20, 0x46, 0x31, 0x46, 0xfe, 0xf7, 0x53, 0xfe, 0x03, 0x46, + 0x39, 0x48, 0x94, 0xf8, 0x68, 0x11, 0x01, 0xaa, 0x06, 0x68, 0x20, 0x46, + 0xb0, 0x47, 0x00, 0x28, 0x48, 0xd0, 0x01, 0x98, 0x00, 0x28, 0x53, 0xd0, + 0x2d, 0xb1, 0x90, 0xf8, 0x47, 0x10, 0x94, 0xf8, 0x4a, 0x21, 0x8a, 0x42, + 0x4c, 0xd1, 0x39, 0x78, 0x90, 0xf8, 0x2c, 0x30, 0x90, 0xf8, 0x2e, 0x40, + 0x01, 0xeb, 0x81, 0x01, 0x08, 0xeb, 0xc1, 0x02, 0x13, 0x73, 0x03, 0x8e, + 0x53, 0x81, 0x14, 0xb3, 0x2a, 0x4a, 0x00, 0x23, 0x02, 0xeb, 0x41, 0x11, + 0x01, 0xf1, 0x54, 0x02, 0x15, 0x78, 0x00, 0xeb, 0x43, 0x04, 0x64, 0x8e, + 0x51, 0xf8, 0x25, 0x60, 0x6f, 0xf3, 0x9f, 0x56, 0x46, 0xea, 0x84, 0x54, + 0x50, 0xf8, 0x23, 0x60, 0x01, 0x33, 0x41, 0xf8, 0x25, 0x40, 0x14, 0x78, + 0x65, 0x1c, 0x15, 0x70, 0x51, 0xf8, 0x24, 0x50, 0x66, 0xf3, 0x15, 0x05, + 0x41, 0xf8, 0x24, 0x50, 0xdc, 0xb2, 0x90, 0xf8, 0x2e, 0x50, 0xac, 0x42, + 0xe2, 0xd3, 0xbd, 0xe8, 0xfc, 0x81, 0x15, 0x48, 0x15, 0x49, 0x00, 0x78, + 0x00, 0xeb, 0x80, 0x00, 0x01, 0xeb, 0xc0, 0x00, 0x01, 0x21, 0x81, 0x82, + 0x00, 0x21, 0x41, 0x81, 0xbd, 0xe8, 0xfc, 0x81, 0x12, 0x48, 0xd4, 0xe9, + 0x5a, 0x23, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x39, 0x78, 0x01, 0xeb, + 0x81, 0x01, 0x08, 0xeb, 0xc1, 0x01, 0x08, 0x73, 0xbd, 0xe8, 0xfc, 0x81, + 0xb4, 0xf8, 0x78, 0x01, 0x01, 0x21, 0x20, 0xf0, 0x01, 0x00, 0xa4, 0xf8, + 0x78, 0x01, 0x38, 0x78, 0x00, 0xeb, 0x80, 0x00, 0x08, 0xeb, 0xc0, 0x00, + 0x01, 0x75, 0xbd, 0xe8, 0xfc, 0x81, 0x00, 0xbf, 0x74, 0x87, 0x08, 0x00, + 0x84, 0x71, 0x01, 0x00, 0x38, 0xb8, 0x08, 0x00, 0xbc, 0x65, 0x01, 0x00, + 0x3c, 0xb8, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x90, 0xf8, 0x8c, 0x01, + 0xc0, 0x07, 0x21, 0xd0, 0x20, 0x6b, 0xf8, 0xb1, 0x60, 0x6b, 0xe8, 0xb1, + 0x90, 0xf8, 0x29, 0x00, 0x81, 0x07, 0x19, 0xd5, 0x00, 0x07, 0x17, 0xd4, + 0x0c, 0x48, 0x94, 0xf8, 0x1d, 0x11, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0x68, + 0x49, 0x01, 0x40, 0x5c, 0x01, 0x28, 0x08, 0xd8, 0x94, 0xf8, 0x96, 0x01, + 0x28, 0xb9, 0x07, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x84, 0xf8, + 0x97, 0x01, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0xa6, 0xba, + 0x10, 0xbd, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, 0x44, 0xe8, 0x08, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x87, 0xb0, 0x04, 0x91, 0x81, 0x46, 0x90, 0xf8, + 0xac, 0x00, 0x00, 0x28, 0x00, 0xf0, 0xce, 0x80, 0x99, 0xf8, 0xc1, 0x10, + 0xd9, 0xf8, 0xb0, 0x70, 0x00, 0x26, 0x00, 0x22, 0x4f, 0xf0, 0x00, 0x0a, + 0xc8, 0x43, 0x4d, 0x1c, 0xff, 0x21, 0x05, 0x91, 0xb7, 0xf8, 0x78, 0x11, + 0x49, 0x07, 0x2d, 0xd4, 0x97, 0xf8, 0x42, 0x10, 0xc9, 0x06, 0x02, 0xd5, + 0x97, 0xf8, 0xf8, 0x11, 0x31, 0xb3, 0x97, 0xf8, 0x20, 0x11, 0x6b, 0xb2, + 0x8b, 0x42, 0x21, 0xda, 0x00, 0x2b, 0x1f, 0xd4, 0x97, 0xf8, 0x50, 0xc1, + 0x06, 0x92, 0xbc, 0xf1, 0x00, 0x0f, 0x2d, 0xd0, 0xb7, 0xf8, 0x58, 0x21, + 0xb7, 0xf8, 0x74, 0x41, 0xa2, 0x1a, 0x12, 0xb2, 0x00, 0x2a, 0x25, 0xd4, + 0x5f, 0x4c, 0x97, 0xf8, 0x56, 0x81, 0x97, 0xf8, 0x57, 0xb1, 0x97, 0xf8, + 0x55, 0xe1, 0x64, 0xea, 0x02, 0x02, 0x97, 0xf8, 0x51, 0x41, 0x22, 0x44, + 0x4a, 0x43, 0xd2, 0x1a, 0x1b, 0xfb, 0x08, 0x22, 0x96, 0x44, 0x15, 0xe0, + 0x57, 0xf8, 0x04, 0x0c, 0x20, 0xb1, 0x90, 0xf8, 0xf9, 0x11, 0x07, 0x46, + 0x6d, 0x1a, 0x04, 0xe0, 0x97, 0xf8, 0xf9, 0x01, 0xd9, 0xf8, 0xa4, 0x70, + 0x05, 0x44, 0x99, 0xf8, 0xac, 0x10, 0x01, 0x36, 0x68, 0x42, 0x8e, 0x42, + 0xba, 0xd3, 0x7e, 0xe0, 0x4f, 0xf0, 0xff, 0x0e, 0x97, 0xf8, 0x46, 0xb1, + 0xbb, 0xf1, 0x00, 0x0f, 0x23, 0xd0, 0xb7, 0xf8, 0x4e, 0x41, 0xb7, 0xf8, + 0x74, 0x21, 0x12, 0x1b, 0x0f, 0xfa, 0x82, 0xf8, 0xb8, 0xf1, 0x00, 0x0f, + 0x19, 0xd4, 0x44, 0x4a, 0x97, 0xf8, 0x47, 0x41, 0x62, 0xea, 0x08, 0x02, + 0xe0, 0x46, 0x01, 0x92, 0x97, 0xf8, 0x4b, 0x21, 0xcd, 0xe9, 0x02, 0x2a, + 0x01, 0x9a, 0x97, 0xf8, 0x4c, 0xa1, 0x97, 0xf8, 0x4d, 0xc1, 0x22, 0x44, + 0x4a, 0x43, 0xd2, 0x1a, 0x1c, 0xfb, 0x0a, 0x22, 0xdd, 0xe9, 0x02, 0x3a, + 0xc4, 0x46, 0x13, 0x44, 0x00, 0xe0, 0xff, 0x23, 0x9e, 0x45, 0x15, 0xda, + 0xbc, 0xf1, 0x00, 0x0f, 0x2e, 0xd0, 0xb7, 0xf8, 0x58, 0x21, 0xb7, 0xf8, + 0x74, 0x31, 0x9a, 0x1a, 0x12, 0xb2, 0x00, 0x2a, 0x26, 0xd4, 0x6f, 0xea, + 0x02, 0x0e, 0x97, 0xf8, 0x51, 0x31, 0x97, 0xf8, 0x55, 0xc1, 0x97, 0xf8, + 0x56, 0x41, 0x97, 0xf8, 0x57, 0x21, 0x14, 0xe0, 0xbb, 0xf1, 0x00, 0x0f, + 0x18, 0xd0, 0xb7, 0xf8, 0x4e, 0x21, 0xb7, 0xf8, 0x74, 0x31, 0x9a, 0x1a, + 0x12, 0xb2, 0x00, 0x2a, 0x10, 0xd4, 0x6f, 0xea, 0x02, 0x0e, 0x97, 0xf8, + 0x47, 0x31, 0x97, 0xf8, 0x4b, 0xc1, 0x97, 0xf8, 0x4c, 0x41, 0x97, 0xf8, + 0x4d, 0x21, 0x73, 0x44, 0x03, 0xfb, 0x01, 0x00, 0x02, 0xfb, 0x04, 0x00, + 0x60, 0x44, 0x00, 0xe0, 0xff, 0x20, 0x87, 0xf8, 0xfa, 0x01, 0xe9, 0xb2, + 0x38, 0x46, 0x87, 0xf8, 0xfb, 0x51, 0x02, 0xf0, 0xab, 0xf9, 0x97, 0xf8, + 0xfa, 0x01, 0x05, 0x99, 0x81, 0x42, 0x0a, 0xd3, 0x04, 0x98, 0xba, 0x46, + 0x05, 0x70, 0x97, 0xf8, 0xfa, 0x01, 0x05, 0x90, 0x97, 0xf8, 0x1c, 0x02, + 0x01, 0x30, 0x87, 0xf8, 0x1c, 0x02, 0x06, 0x9a, 0x01, 0x32, 0x6f, 0xe7, + 0x4f, 0xf0, 0x00, 0x0a, 0x00, 0x22, 0xd9, 0xf8, 0xa0, 0x00, 0x40, 0x7f, + 0x30, 0xb9, 0xd0, 0xb2, 0x02, 0x28, 0x03, 0xd3, 0xd9, 0xf8, 0xb0, 0x00, + 0x82, 0x45, 0x09, 0xd0, 0x08, 0x48, 0x00, 0x78, 0x20, 0xf0, 0x08, 0x00, + 0x06, 0x49, 0x08, 0x70, 0x50, 0x46, 0x07, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x03, 0x48, 0x00, 0x78, 0x40, 0xf0, 0x08, 0x00, 0xf4, 0xe7, 0x00, 0xbf, + 0x00, 0x00, 0xff, 0xff, 0x97, 0x53, 0x01, 0x00, 0xf8, 0xb5, 0xc2, 0x78, + 0x90, 0xf8, 0xc1, 0x30, 0xd0, 0xf8, 0xb0, 0x40, 0x01, 0x2a, 0x05, 0xd0, + 0x81, 0x2a, 0x2d, 0xd1, 0xbd, 0xe8, 0xf8, 0x40, 0xff, 0xf7, 0xf8, 0xbe, + 0x4b, 0xb9, 0xd0, 0xf8, 0xa4, 0x20, 0x32, 0xb1, 0x00, 0x25, 0x82, 0xf8, + 0x1c, 0x52, 0x52, 0xf8, 0x04, 0x2c, 0x00, 0x2a, 0xf9, 0xd1, 0x90, 0xf8, + 0xc0, 0x50, 0xcd, 0xb1, 0x00, 0x26, 0x54, 0xf8, 0x04, 0x4c, 0x14, 0xb9, + 0xd0, 0xf8, 0xa4, 0x40, 0x01, 0x33, 0x94, 0xf8, 0x20, 0x71, 0xda, 0xb2, + 0xba, 0x42, 0x0a, 0xd2, 0xb4, 0xf8, 0x78, 0x71, 0x7f, 0x07, 0x06, 0xd4, + 0x94, 0xf8, 0x42, 0x70, 0xff, 0x06, 0x21, 0xd5, 0x94, 0xf8, 0xf8, 0x71, + 0xf7, 0xb9, 0x01, 0x36, 0xae, 0x42, 0xe6, 0xd3, 0x00, 0x24, 0x1e, 0xe0, + 0x58, 0x1c, 0x94, 0xf8, 0x20, 0x51, 0xc2, 0xb2, 0xaa, 0x42, 0x0c, 0xd2, + 0xb4, 0xf8, 0x78, 0x31, 0x5b, 0x07, 0x08, 0xd4, 0x94, 0xf8, 0x42, 0x30, + 0xdb, 0x06, 0x02, 0xd5, 0x94, 0xf8, 0xf8, 0x31, 0x0b, 0xb1, 0x08, 0x70, + 0x07, 0xe0, 0x54, 0xf8, 0x04, 0x0c, 0x00, 0x24, 0x38, 0xb1, 0x0c, 0x70, + 0x04, 0x46, 0x04, 0xe0, 0x0b, 0x70, 0x20, 0x46, 0x11, 0x46, 0x02, 0xf0, + 0x1f, 0xf9, 0x20, 0x46, 0xf8, 0xbd, 0x00, 0xbf, 0x2d, 0xe9, 0xf8, 0x43, + 0xd0, 0xf8, 0xb0, 0x40, 0x06, 0x46, 0x90, 0xf8, 0xc1, 0x70, 0xc0, 0x78, + 0xdf, 0xf8, 0x7c, 0x90, 0x88, 0x46, 0x94, 0xf8, 0x20, 0x51, 0x01, 0x28, + 0x19, 0xd1, 0x54, 0xf8, 0x04, 0x4c, 0x2c, 0xb9, 0x01, 0x37, 0xf8, 0xb2, + 0xa8, 0x42, 0x2d, 0xd2, 0xd6, 0xf8, 0xa4, 0x40, 0xd9, 0xf8, 0x00, 0x30, + 0xfa, 0xb2, 0x30, 0x46, 0x21, 0x46, 0x98, 0x47, 0x00, 0x28, 0xee, 0xd0, + 0x94, 0xf8, 0x42, 0x00, 0xc0, 0x06, 0x1c, 0xd5, 0x94, 0xf8, 0xf8, 0x01, + 0x00, 0x28, 0xe6, 0xd0, 0x17, 0xe0, 0x01, 0x37, 0xf8, 0xb2, 0xa8, 0x42, + 0x03, 0xd3, 0x54, 0xf8, 0x04, 0x4c, 0x00, 0x27, 0x94, 0xb1, 0xd9, 0xf8, + 0x00, 0x30, 0xfa, 0xb2, 0x30, 0x46, 0x21, 0x46, 0x98, 0x47, 0x00, 0x28, + 0xef, 0xd0, 0x94, 0xf8, 0x42, 0x00, 0xc0, 0x06, 0x03, 0xd5, 0x94, 0xf8, + 0xf8, 0x01, 0x00, 0x28, 0xe7, 0xd0, 0x88, 0xf8, 0x00, 0x70, 0x00, 0xe0, + 0x00, 0x24, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x83, 0x28, 0xd1, 0x08, 0x00, + 0x01, 0x78, 0xc9, 0xb9, 0xd0, 0xf8, 0xb0, 0x10, 0x90, 0xf8, 0xc1, 0x20, + 0x91, 0xf8, 0x20, 0x11, 0x02, 0x32, 0x8a, 0x42, 0x10, 0xd1, 0xd0, 0xf8, + 0xa4, 0x10, 0x49, 0xb1, 0xb1, 0xf8, 0x78, 0x21, 0x53, 0xb2, 0x00, 0x2b, + 0x01, 0xd4, 0x52, 0x07, 0x06, 0xd5, 0x51, 0xf8, 0x04, 0x1c, 0xf4, 0xe7, + 0xd0, 0xf8, 0x9c, 0x10, 0x11, 0x22, 0x8a, 0x74, 0xd0, 0xf8, 0x9c, 0x00, + 0x80, 0x7c, 0x70, 0x47, 0xf0, 0xb5, 0x85, 0xb0, 0x04, 0x46, 0x00, 0xf0, + 0xe3, 0xf8, 0x94, 0xf8, 0x7c, 0x01, 0x01, 0x28, 0x32, 0xd1, 0x1a, 0x48, + 0x06, 0x68, 0x94, 0xf8, 0x1d, 0x01, 0xc0, 0xeb, 0x00, 0x17, 0x78, 0x01, + 0x30, 0x5c, 0x01, 0x28, 0x28, 0xd1, 0xd4, 0xf8, 0x70, 0x01, 0x28, 0xbb, + 0x14, 0x48, 0x03, 0xad, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, 0x13, 0x48, + 0x13, 0x49, 0xd4, 0xf8, 0x70, 0x21, 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x10, + 0x01, 0xeb, 0xc0, 0x00, 0xd4, 0xf8, 0x24, 0x11, 0x01, 0xac, 0x90, 0xf8, + 0x72, 0x00, 0x01, 0xfb, 0x00, 0x20, 0x0d, 0x49, 0x0a, 0x68, 0x00, 0x01, + 0x21, 0x46, 0x90, 0x47, 0x0b, 0x48, 0x21, 0x46, 0x2a, 0x46, 0x03, 0x68, + 0x28, 0x46, 0x98, 0x47, 0xdd, 0xe9, 0x03, 0x12, 0x06, 0xeb, 0x47, 0x10, + 0xc0, 0xe9, 0x2e, 0x12, 0x05, 0xb0, 0xf0, 0xbd, 0xe0, 0x35, 0x01, 0x00, + 0xa4, 0xbe, 0x08, 0x00, 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0x4c, 0xa1, 0x08, 0x00, 0x44, 0xa1, 0x08, 0x00, 0xd0, 0xf8, 0x9c, 0x10, + 0x02, 0x78, 0x89, 0x7c, 0x02, 0x2a, 0x05, 0xd1, 0x90, 0xf8, 0xe0, 0x20, + 0x03, 0x2a, 0x28, 0xbf, 0x00, 0xf0, 0x98, 0xb8, 0x08, 0x46, 0x70, 0x47, + 0x10, 0x48, 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, 0x11, 0x49, 0x01, 0x60, + 0x11, 0x48, 0x12, 0x49, 0x01, 0x60, 0x12, 0x48, 0x12, 0x49, 0x01, 0x60, + 0x12, 0x48, 0x13, 0x49, 0x01, 0x60, 0x13, 0x48, 0x13, 0x49, 0x01, 0x60, + 0x13, 0x48, 0x14, 0x49, 0x01, 0x60, 0x14, 0x48, 0x14, 0x49, 0x01, 0x60, + 0x14, 0x48, 0x15, 0x49, 0x01, 0x60, 0x15, 0x48, 0x15, 0x49, 0x01, 0x60, + 0x15, 0x48, 0x16, 0x49, 0x01, 0x60, 0x70, 0x47, 0xc8, 0xb6, 0x08, 0x00, + 0x20, 0xf0, 0x03, 0x00, 0xc4, 0xb6, 0x08, 0x00, 0x00, 0xf0, 0x03, 0x00, + 0x0c, 0xd1, 0x08, 0x00, 0x19, 0xe5, 0x03, 0x00, 0x5c, 0xa2, 0x08, 0x00, + 0x6d, 0xe8, 0x03, 0x00, 0x30, 0xd1, 0x08, 0x00, 0x40, 0xf0, 0x03, 0x00, + 0x44, 0xb8, 0x08, 0x00, 0xb9, 0xe9, 0x03, 0x00, 0x10, 0xd1, 0x08, 0x00, + 0x09, 0xec, 0x03, 0x00, 0x20, 0xd1, 0x08, 0x00, 0xbd, 0xec, 0x03, 0x00, + 0x18, 0xd1, 0x08, 0x00, 0x51, 0xed, 0x03, 0x00, 0xa4, 0xbb, 0x08, 0x00, + 0x91, 0xed, 0x03, 0x00, 0x38, 0xd1, 0x08, 0x00, 0x25, 0xee, 0x03, 0x00, + 0x46, 0xf6, 0x09, 0x2c, 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x46, 0xf6, 0xe9, 0x7c, 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x47, 0xf2, 0xeb, 0x4c, 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf6, 0xd1, 0x2c, 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x48, 0xf2, 0x05, 0x1c, 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x48, 0xf2, 0x21, 0x3c, 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf2, 0x23, 0x6c, 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf6, 0x33, 0x0c, 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf6, 0x6d, 0x2c, 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x48, 0xf6, 0xc9, 0x5c, 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x47, 0xf2, 0xa3, 0x5c, 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x47, 0xf2, 0x97, 0x7c, 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf6, 0xf9, 0x3c, 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x52, 0x58, 0x20, 0x57, 0x72, 0x6f, 0x6e, 0x67, 0x20, 0x4c, 0x65, 0x6e, + 0x3a, 0x00, 0x52, 0x58, 0x5b, 0x30, 0x5d, 0x20, 0x46, 0x6c, 0x75, 0x73, + 0x68, 0x00, 0x52, 0x58, 0x5b, 0x31, 0x5d, 0x20, 0x46, 0x6c, 0x75, 0x73, + 0x68, 0x00, 0x52, 0x58, 0x5b, 0x32, 0x5d, 0x20, 0x46, 0x6c, 0x75, 0x73, + 0x68, 0x00, 0x52, 0x58, 0x5b, 0x33, 0x5d, 0x20, 0x46, 0x6c, 0x75, 0x73, + 0x68, 0x00, 0x52, 0x58, 0x5b, 0x78, 0x5d, 0x20, 0x46, 0x6c, 0x75, 0x73, + 0x68, 0x00, 0x52, 0x58, 0x5b, 0x55, 0x5d, 0x20, 0x46, 0x6c, 0x75, 0x73, + 0x68, 0x00, 0x4d, 0x49, 0x43, 0x20, 0x46, 0x41, 0x49, 0x4c, 0x3a, 0x20, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x74, 0x72, 0x00, 0x4d, 0x49, 0x43, + 0x20, 0x46, 0x41, 0x49, 0x4c, 0x3a, 0x20, 0x73, 0x75, 0x62, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x00, 0x54, 0x58, 0x5b, 0x55, 0x5d, 0x20, 0x46, 0x6c, + 0x75, 0x73, 0x68, 0x00, 0x11, 0xcd, 0x03, 0x00, 0x71, 0xcd, 0x03, 0x00, + 0xc5, 0xd2, 0x03, 0x00, 0xa5, 0xd3, 0x03, 0x00, 0xd9, 0xd5, 0x03, 0x00, + 0x79, 0xdf, 0x03, 0x00, 0xc1, 0xe2, 0x03, 0x00, 0x7d, 0x00, 0x00, 0x00, + 0x45, 0xe3, 0x03, 0x00, 0xad, 0x85, 0x09, 0x10, 0x57, 0x93, 0x09, 0x10, + 0xb3, 0x94, 0x09, 0x10, 0x8d, 0xe3, 0x03, 0x00, 0xdd, 0xe3, 0x03, 0x00, + 0x09, 0xe4, 0x03, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x21, 0xe4, 0x03, 0x00, + 0x9f, 0x8e, 0x09, 0x10, 0xc5, 0x8f, 0x09, 0x10, 0x53, 0x90, 0x09, 0x10, + 0x3f, 0x91, 0x09, 0x10, 0xdb, 0x91, 0x09, 0x10, 0x41, 0x93, 0x09, 0x10, + 0x7f, 0x00, 0x00, 0x00, 0x99, 0x48, 0xd9, 0x4a, 0x00, 0x78, 0xc0, 0xeb, + 0x40, 0x11, 0x52, 0xf8, 0x31, 0x00, 0x02, 0xeb, 0xc1, 0x01, 0xb1, 0xf8, + 0xdc, 0x20, 0xd1, 0x07, 0x03, 0xd0, 0x02, 0xf0, 0x49, 0x02, 0x09, 0x2a, + 0x0d, 0xd1, 0x51, 0xb9, 0x48, 0xb1, 0x90, 0xf8, 0x35, 0x01, 0x67, 0x49, + 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, 0xc1, 0x69, 0x01, 0x31, + 0xc1, 0x61, 0x00, 0xf0, 0xd9, 0xbc, 0x00, 0x28, 0xfb, 0xd0, 0x90, 0xf8, + 0x35, 0x01, 0x60, 0x49, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, + 0x01, 0x6d, 0x01, 0x31, 0x01, 0x65, 0x00, 0xf0, 0xcb, 0xbc, 0x00, 0xbf, + 0xf0, 0xb5, 0x85, 0xb0, 0x81, 0x4c, 0x5a, 0x4d, 0x2f, 0x49, 0x20, 0x78, + 0x49, 0x69, 0x00, 0xeb, 0x00, 0x10, 0x05, 0xeb, 0xc0, 0x00, 0x40, 0x68, + 0x81, 0x42, 0x04, 0xd0, 0x00, 0x20, 0x40, 0xf2, 0xdd, 0x11, 0xe1, 0xf7, + 0x8d, 0xff, 0x4f, 0xf4, 0x2a, 0x60, 0xad, 0xf8, 0x10, 0x00, 0x00, 0x20, + 0x03, 0x90, 0x26, 0x48, 0x02, 0x68, 0x03, 0xa8, 0x01, 0x46, 0x90, 0x47, + 0x24, 0x4e, 0x03, 0x99, 0xb0, 0x68, 0x42, 0x1a, 0x12, 0x01, 0x06, 0xd4, + 0x88, 0x42, 0x24, 0xd1, 0xb0, 0x89, 0xbd, 0xf8, 0x10, 0x10, 0x81, 0x42, + 0x1f, 0xd9, 0x1f, 0x48, 0x06, 0xf1, 0x08, 0x01, 0x01, 0xaa, 0x03, 0x68, + 0x03, 0xa8, 0x98, 0x47, 0x01, 0x99, 0x40, 0xf2, 0x71, 0x20, 0x48, 0x43, + 0xbd, 0xf8, 0x08, 0x10, 0x40, 0x08, 0x00, 0xeb, 0x11, 0x10, 0x21, 0x78, + 0x01, 0xeb, 0x01, 0x11, 0x55, 0xf8, 0x31, 0x10, 0xd1, 0xf8, 0x1c, 0x23, + 0x82, 0x42, 0x06, 0xd9, 0xdd, 0xe9, 0x03, 0x37, 0x10, 0x1a, 0xc6, 0xe9, + 0x02, 0x37, 0xc1, 0xf8, 0x1c, 0x03, 0x20, 0x78, 0x0f, 0x49, 0x00, 0xeb, + 0x00, 0x10, 0x09, 0x78, 0x55, 0xf8, 0x30, 0x00, 0xd0, 0xf8, 0x1c, 0x03, + 0x08, 0x44, 0x0c, 0x49, 0x08, 0x60, 0x0c, 0x48, 0x01, 0x21, 0x02, 0x68, + 0x80, 0x20, 0x90, 0x47, 0x0a, 0x48, 0x00, 0x68, 0x80, 0x47, 0x01, 0x20, + 0x00, 0xf0, 0x6e, 0xfc, 0x05, 0xb0, 0xf0, 0xbd, 0xfc, 0x73, 0x01, 0x00, + 0x54, 0xa1, 0x08, 0x00, 0x60, 0x86, 0x01, 0x00, 0x44, 0xa1, 0x08, 0x00, + 0xa8, 0x0d, 0x01, 0x00, 0x54, 0x11, 0x21, 0x40, 0xf8, 0xb9, 0x08, 0x00, + 0xb4, 0xb9, 0x08, 0x00, 0x48, 0x48, 0x88, 0x4b, 0x00, 0x78, 0xc0, 0xeb, + 0x40, 0x11, 0x53, 0xf8, 0x31, 0x20, 0x03, 0xeb, 0xc1, 0x01, 0xb1, 0xf8, + 0xdc, 0x30, 0xd9, 0x07, 0x03, 0xd0, 0x03, 0xf0, 0x49, 0x03, 0x09, 0x2b, + 0x0c, 0xd1, 0xb1, 0xb9, 0xaa, 0xb1, 0x92, 0xf8, 0x35, 0x21, 0x16, 0x4b, + 0x02, 0xeb, 0x42, 0x02, 0x03, 0xeb, 0x42, 0x12, 0xd3, 0x69, 0x01, 0x33, + 0xd3, 0x61, 0x0a, 0xe0, 0x4a, 0xb1, 0x92, 0xf8, 0x35, 0x21, 0x10, 0x4b, + 0x02, 0xeb, 0x42, 0x02, 0x03, 0xeb, 0x42, 0x12, 0x13, 0x6d, 0x01, 0x33, + 0x13, 0x65, 0xa9, 0xb1, 0x0c, 0x49, 0x00, 0xeb, 0x00, 0x10, 0x68, 0x22, + 0x51, 0xf8, 0x30, 0x00, 0x59, 0x49, 0x90, 0xf8, 0x35, 0x01, 0x10, 0xfb, + 0x02, 0x10, 0x01, 0x46, 0x11, 0xf8, 0x5c, 0x2f, 0xd3, 0x07, 0x05, 0xd0, + 0x02, 0xf0, 0xfe, 0x02, 0x0a, 0x70, 0x04, 0x49, 0x09, 0x68, 0x41, 0x65, + 0x00, 0xf0, 0x20, 0xbc, 0x54, 0xf1, 0x05, 0x00, 0xfc, 0x6d, 0x01, 0x00, + 0x80, 0x11, 0x21, 0x40, 0x2d, 0xe9, 0xf0, 0x43, 0x8b, 0xb0, 0x23, 0x48, + 0x62, 0x49, 0x4b, 0x4e, 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x51, 0xf8, + 0x30, 0x50, 0x68, 0x21, 0x95, 0xf8, 0x35, 0x01, 0x10, 0xfb, 0x01, 0x61, + 0x91, 0xf8, 0x2e, 0x10, 0x01, 0x29, 0x2f, 0xd1, 0xd5, 0xf8, 0x84, 0x12, + 0x09, 0x7d, 0x66, 0x29, 0x2a, 0xd1, 0x68, 0x21, 0x10, 0xfb, 0x01, 0x61, + 0xb1, 0xf8, 0x48, 0x20, 0x22, 0xb3, 0x91, 0xf8, 0x4b, 0x10, 0x09, 0xb3, + 0x4f, 0xf0, 0x68, 0x08, 0x8d, 0xf8, 0x28, 0x00, 0x02, 0xac, 0x20, 0x22, + 0x10, 0xfb, 0x08, 0x60, 0x00, 0xf1, 0x30, 0x01, 0x20, 0x46, 0xf5, 0xf7, + 0xaf, 0xfe, 0x01, 0x20, 0x01, 0x21, 0x00, 0x22, 0x23, 0x46, 0x4f, 0xf0, + 0x00, 0x09, 0x8d, 0xf8, 0x24, 0x00, 0x0a, 0x48, 0x07, 0x68, 0x24, 0x20, + 0x00, 0x90, 0x40, 0xf2, 0x51, 0x60, 0xb8, 0x47, 0x95, 0xf8, 0x35, 0x01, + 0x10, 0xfb, 0x08, 0x60, 0x80, 0xf8, 0x4b, 0x90, 0x00, 0xf0, 0xda, 0xfb, + 0x0b, 0xb0, 0xbd, 0xe8, 0xf0, 0x83, 0x00, 0xbf, 0x74, 0x87, 0x08, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0xf0, 0xb5, 0x90, 0xf8, 0x35, 0x41, 0xdf, 0xf8, + 0x94, 0xc0, 0x68, 0x26, 0x14, 0xfb, 0x06, 0xc6, 0x96, 0xf8, 0x50, 0x60, + 0x00, 0x2e, 0x40, 0xd0, 0x00, 0x2a, 0x3e, 0xd0, 0x20, 0x4a, 0xb0, 0xf8, + 0xdc, 0x52, 0x97, 0x88, 0xbd, 0x42, 0x38, 0xd3, 0x03, 0x29, 0x02, 0xf1, + 0x01, 0x02, 0x18, 0xbf, 0x00, 0x29, 0x17, 0xd1, 0xf5, 0x07, 0x30, 0xd0, + 0x03, 0x29, 0x1a, 0xd1, 0x19, 0x79, 0xa1, 0xf1, 0x1f, 0x03, 0x02, 0x2b, + 0x18, 0xd3, 0x21, 0x29, 0x27, 0xd1, 0x68, 0x21, 0x00, 0x22, 0x14, 0xfb, + 0x01, 0xc1, 0x81, 0xf8, 0x51, 0x20, 0xb0, 0xf8, 0x84, 0x10, 0x6f, 0xf3, + 0xdf, 0x31, 0xa0, 0xf8, 0x84, 0x10, 0xf0, 0xbd, 0xb0, 0x07, 0x18, 0xd5, + 0x68, 0x20, 0x52, 0x78, 0x14, 0xfb, 0x00, 0xc0, 0x0c, 0xe0, 0x59, 0x79, + 0xae, 0x29, 0x10, 0xd1, 0xb0, 0xf8, 0x84, 0x10, 0x41, 0xf4, 0x00, 0x41, + 0xa0, 0xf8, 0x84, 0x10, 0x68, 0x20, 0x14, 0xfb, 0x00, 0xc0, 0x12, 0x78, + 0x90, 0xf8, 0x51, 0x10, 0x91, 0x42, 0x38, 0xbf, 0x11, 0x46, 0x80, 0xf8, + 0x51, 0x10, 0xf0, 0xbd, 0xb0, 0xe6, 0x05, 0x00, 0x4c, 0xf1, 0x05, 0x00, + 0xb0, 0xb5, 0xe1, 0x49, 0x13, 0x4a, 0x09, 0x78, 0xc1, 0xeb, 0x41, 0x11, + 0x02, 0xeb, 0xc1, 0x01, 0xb1, 0xf8, 0xdc, 0x10, 0x01, 0xf0, 0x49, 0x01, + 0x09, 0x29, 0x16, 0xd1, 0xb0, 0xf8, 0xe4, 0x42, 0xb0, 0xf8, 0x14, 0x53, + 0x90, 0xf8, 0x35, 0x11, 0x68, 0x22, 0x2c, 0x44, 0x77, 0x4d, 0x11, 0xfb, + 0x02, 0xf3, 0x01, 0x34, 0x11, 0xfb, 0x02, 0x51, 0x00, 0x22, 0xec, 0x52, + 0x8a, 0x70, 0xb0, 0xf8, 0x38, 0x13, 0x6f, 0xf3, 0xdf, 0x31, 0xa0, 0xf8, + 0x38, 0x13, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x5d, 0xbb, 0x00, 0xbf, + 0x0c, 0x6f, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x43, 0x0c, 0x46, 0x06, 0x46, + 0x00, 0xf0, 0x5a, 0xfb, 0x05, 0x46, 0x68, 0x48, 0xa1, 0x7c, 0x00, 0xf2, + 0x83, 0x37, 0x90, 0xf8, 0x84, 0x03, 0x81, 0x42, 0x08, 0xbf, 0x13, 0x2d, + 0x4a, 0xd0, 0xb8, 0x78, 0x81, 0x42, 0x14, 0xd2, 0x96, 0xf8, 0x49, 0x23, + 0x03, 0x2a, 0x11, 0xd1, 0xb6, 0xf8, 0x84, 0x20, 0x92, 0x06, 0x0d, 0xd5, + 0xd6, 0xf8, 0xd4, 0x20, 0x52, 0x7f, 0x00, 0x2a, 0x75, 0xd0, 0x96, 0xf9, + 0x38, 0x23, 0xb2, 0xf1, 0xff, 0x3f, 0x03, 0xdc, 0xa0, 0x74, 0x01, 0x46, + 0x00, 0xe0, 0x76, 0xb3, 0xd6, 0xf8, 0x00, 0x24, 0x0a, 0xb1, 0xa0, 0x74, + 0x29, 0xe0, 0x81, 0x42, 0x27, 0xd2, 0xd6, 0xf8, 0xd4, 0x00, 0x40, 0x7f, + 0x18, 0xb3, 0x96, 0xf8, 0x3b, 0x03, 0x87, 0x28, 0x1f, 0xd1, 0x96, 0xf8, + 0x37, 0x03, 0x40, 0x06, 0x1b, 0xd5, 0x96, 0xf8, 0x35, 0x01, 0xdf, 0xf8, + 0x34, 0x81, 0x4f, 0xf0, 0x68, 0x09, 0x10, 0xfb, 0x09, 0x80, 0x00, 0x6e, + 0x01, 0x30, 0x10, 0xd0, 0xe1, 0xf7, 0xda, 0xfd, 0x96, 0xf8, 0x35, 0x11, + 0x11, 0xfb, 0x09, 0x81, 0x09, 0x6e, 0x40, 0x1a, 0xb6, 0xf8, 0xdc, 0x12, + 0x20, 0xf0, 0x70, 0x40, 0x01, 0xeb, 0xc1, 0x01, 0xb0, 0xeb, 0x81, 0x0f, + 0x7c, 0xd9, 0x28, 0x46, 0xbd, 0xe8, 0xf8, 0x83, 0xb6, 0xf8, 0x84, 0x00, + 0x80, 0x06, 0xb0, 0xd4, 0xb6, 0xf8, 0x38, 0x23, 0x50, 0xb2, 0x00, 0x28, + 0xab, 0xd4, 0xb6, 0xf8, 0xdc, 0x02, 0x07, 0x28, 0xa7, 0xd8, 0xd6, 0xf8, + 0xd4, 0x00, 0x40, 0x7f, 0x00, 0x28, 0x42, 0xd0, 0x96, 0xf8, 0x35, 0x31, + 0xdf, 0xf8, 0xd0, 0x80, 0x4f, 0xf0, 0x68, 0x09, 0x13, 0xfb, 0x09, 0x80, + 0x80, 0x78, 0x88, 0xb9, 0x82, 0xf4, 0x00, 0x40, 0xa6, 0xf8, 0x38, 0x03, + 0x2f, 0x48, 0x01, 0x68, 0x2f, 0x48, 0x88, 0x47, 0x96, 0xf8, 0x35, 0x31, + 0x01, 0x22, 0x62, 0xf3, 0x9f, 0x00, 0xb6, 0xf8, 0x38, 0x23, 0x13, 0xfb, + 0x09, 0x81, 0x88, 0x70, 0x11, 0xb2, 0x68, 0x22, 0x01, 0x38, 0xb1, 0xf1, + 0xff, 0x3f, 0xc6, 0xbf, 0x39, 0x78, 0xa1, 0x74, 0xa1, 0x7c, 0x13, 0xfb, + 0x02, 0x82, 0x90, 0x70, 0x79, 0xe7, 0x96, 0xf8, 0x3b, 0x23, 0x81, 0x2a, + 0x06, 0xd0, 0x87, 0x2a, 0x04, 0xd0, 0x96, 0xf8, 0x3c, 0x23, 0x87, 0x2a, + 0x7f, 0xf4, 0x7f, 0xaf, 0xb2, 0x68, 0x00, 0x2a, 0x3f, 0xf4, 0x7b, 0xaf, + 0x53, 0x78, 0x9b, 0x06, 0x3f, 0xf5, 0x77, 0xaf, 0x12, 0x79, 0x00, 0x2a, + 0x7f, 0xf4, 0x73, 0xaf, 0x01, 0x46, 0xa0, 0x74, 0x6f, 0xe7, 0xb6, 0xf8, + 0xe4, 0x02, 0x00, 0x28, 0xb8, 0xd0, 0x96, 0xf8, 0x35, 0xe1, 0x68, 0x20, + 0xdf, 0xf8, 0x40, 0xc0, 0x1e, 0xfb, 0x00, 0xf0, 0x3c, 0xf8, 0x00, 0x80, + 0xb6, 0xf8, 0x14, 0x03, 0xa0, 0xeb, 0x08, 0x03, 0x02, 0x33, 0x1b, 0xb2, + 0x00, 0x2b, 0xa7, 0xd4, 0xa8, 0xeb, 0x00, 0x00, 0x02, 0x30, 0x00, 0xb2, + 0x00, 0x28, 0xa1, 0xd4, 0x68, 0x20, 0x00, 0x23, 0x1e, 0xfb, 0x00, 0xc0, + 0x83, 0x70, 0x42, 0xf4, 0x00, 0x40, 0xa6, 0xf8, 0x38, 0x03, 0x3a, 0xe7, + 0xb8, 0x78, 0x54, 0xe7, 0x8c, 0x7e, 0x08, 0x00, 0xb0, 0xe6, 0x05, 0x00, + 0xa0, 0x8e, 0x08, 0x00, 0xf8, 0x6d, 0x01, 0x00, 0xf8, 0xb5, 0x5b, 0x4d, + 0xb5, 0x4e, 0x28, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x56, 0xf8, 0x30, 0x00, + 0xe0, 0xb3, 0xb0, 0xf8, 0x42, 0x71, 0x00, 0xf0, 0x79, 0xfa, 0x29, 0x78, + 0x04, 0x46, 0x01, 0xeb, 0x01, 0x12, 0x56, 0xf8, 0x32, 0x00, 0x68, 0xb1, + 0xb0, 0xf8, 0x42, 0x31, 0x9f, 0x42, 0x09, 0xd0, 0x90, 0xf8, 0x35, 0x31, + 0xf0, 0x4f, 0x03, 0xeb, 0x43, 0x03, 0x07, 0xeb, 0x43, 0x13, 0x9f, 0x69, + 0x01, 0x37, 0x9f, 0x61, 0x00, 0x2c, 0x3e, 0xd0, 0x01, 0x2c, 0x31, 0xd1, + 0x06, 0xeb, 0xc2, 0x02, 0x12, 0x69, 0x6a, 0xb3, 0x12, 0x7f, 0x66, 0x2a, + 0x18, 0xbf, 0x6d, 0x2a, 0x1d, 0xd1, 0x62, 0x4b, 0x01, 0xeb, 0x81, 0x02, + 0x03, 0xeb, 0xc2, 0x02, 0x12, 0x7b, 0x03, 0x2a, 0x00, 0xd0, 0xfa, 0xb9, + 0xd0, 0xf8, 0x1c, 0x34, 0x82, 0x68, 0x2b, 0xb1, 0x1b, 0x7e, 0x05, 0x2b, + 0x02, 0xd1, 0x53, 0x78, 0x9b, 0x06, 0x22, 0xd4, 0x12, 0x79, 0x18, 0x2a, + 0x09, 0xd0, 0x11, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x05, 0x21, 0x00, 0x24, + 0xe7, 0xf7, 0x4e, 0xfb, 0x15, 0xe0, 0x68, 0x2a, 0x08, 0xd1, 0x0f, 0x4a, + 0x5c, 0x23, 0x11, 0xfb, 0x03, 0x21, 0x0e, 0x4b, 0xca, 0x69, 0x09, 0x6a, + 0xc3, 0xe9, 0x00, 0x21, 0x00, 0x21, 0x02, 0x22, 0x1c, 0xf0, 0xac, 0xf9, + 0x28, 0x78, 0x08, 0x49, 0x5c, 0x22, 0x10, 0xfb, 0x02, 0x10, 0x08, 0x49, + 0x81, 0x62, 0x20, 0x46, 0xf8, 0xbd, 0x13, 0x79, 0x03, 0xf0, 0xfe, 0x03, + 0x02, 0x2b, 0xed, 0xd1, 0x52, 0x79, 0xa4, 0x2a, 0xe1, 0xd0, 0xe9, 0xe7, + 0x44, 0x4f, 0x01, 0x00, 0x0c, 0xf0, 0x05, 0x00, 0x75, 0xf6, 0x03, 0x00, + 0x2d, 0xe9, 0xf0, 0x41, 0xdf, 0xf8, 0x80, 0x80, 0x7a, 0x4f, 0x98, 0xf8, + 0x00, 0x00, 0x00, 0xeb, 0x00, 0x10, 0x57, 0xf8, 0x30, 0x50, 0x75, 0xb3, + 0x95, 0xf8, 0x6c, 0x61, 0x00, 0xf0, 0x08, 0xfa, 0x04, 0x46, 0x95, 0xf8, + 0x6c, 0x01, 0x86, 0x42, 0x03, 0xd0, 0x18, 0x48, 0xc1, 0x68, 0x01, 0x31, + 0xc1, 0x60, 0xd5, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0x18, 0xbb, 0x98, 0xf8, + 0x00, 0x00, 0x68, 0x21, 0x00, 0xeb, 0x00, 0x10, 0x57, 0xf8, 0x30, 0x00, + 0x90, 0xf8, 0x35, 0x21, 0x57, 0x48, 0x12, 0xfb, 0x01, 0x02, 0x92, 0xf8, + 0x5c, 0x20, 0xd2, 0x07, 0x13, 0xd0, 0x95, 0xf8, 0x35, 0x21, 0x12, 0xfb, + 0x01, 0x00, 0x0b, 0x49, 0x09, 0x68, 0x41, 0x65, 0x90, 0xf8, 0x5c, 0x10, + 0x01, 0xf0, 0xfe, 0x01, 0x80, 0xf8, 0x5c, 0x10, 0x05, 0xe0, 0x00, 0x20, + 0x40, 0xf2, 0xc5, 0x21, 0x00, 0x24, 0xe7, 0xf7, 0xe5, 0xfa, 0x20, 0x46, + 0xbd, 0xe8, 0xf0, 0x81, 0x74, 0x87, 0x08, 0x00, 0xb0, 0xf0, 0x05, 0x00, + 0x00, 0x12, 0x21, 0x40, 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0xd0, 0xf9, + 0xd4, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0x08, 0xb1, 0x00, 0x20, 0x02, 0xe0, + 0xb4, 0xf8, 0x84, 0x00, 0xc0, 0x0b, 0x94, 0xf8, 0x35, 0x11, 0x3e, 0x4a, + 0x68, 0x23, 0x11, 0xfb, 0x03, 0x21, 0x81, 0xf8, 0x51, 0x00, 0x10, 0xbd, + 0xb0, 0xb5, 0x05, 0x46, 0x00, 0xf0, 0xc0, 0xf9, 0x04, 0x46, 0x8d, 0x48, + 0x0c, 0x49, 0xab, 0x68, 0x00, 0x78, 0x00, 0xeb, 0x80, 0x00, 0x01, 0xeb, + 0xc0, 0x00, 0x42, 0x89, 0x01, 0x7b, 0x28, 0x46, 0xff, 0xf7, 0xbc, 0xfd, + 0x95, 0xf8, 0x35, 0x01, 0x30, 0x49, 0x68, 0x22, 0x10, 0xfb, 0x02, 0x10, + 0x10, 0xf8, 0x51, 0x1f, 0x11, 0xb1, 0x01, 0x39, 0x01, 0x24, 0x01, 0x70, + 0x20, 0x46, 0xb0, 0xbd, 0x84, 0x71, 0x01, 0x00, 0xf8, 0xb5, 0x7e, 0x4e, + 0x7e, 0x4f, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x57, 0xf8, 0x30, 0x40, + 0x8c, 0xb1, 0x07, 0xeb, 0xc0, 0x00, 0x22, 0x79, 0x90, 0xf8, 0x99, 0x10, + 0x94, 0xf8, 0x35, 0x01, 0x8a, 0x42, 0x0f, 0xd1, 0x79, 0x49, 0x00, 0xeb, + 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, 0x01, 0x6a, 0x01, 0x31, 0x01, 0x62, + 0x10, 0xe0, 0x00, 0x20, 0x4f, 0xf4, 0x27, 0x71, 0x00, 0x25, 0xe7, 0xf7, + 0x83, 0xfa, 0x2f, 0xe0, 0x18, 0x49, 0x68, 0x22, 0x10, 0xfb, 0x02, 0x10, + 0xb0, 0xf8, 0x64, 0x10, 0x21, 0xf0, 0x01, 0x01, 0xa0, 0xf8, 0x64, 0x10, + 0x00, 0xf0, 0x7a, 0xf9, 0x05, 0x46, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, + 0x07, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0x9e, 0x10, 0x01, 0x29, 0x19, 0xd1, + 0x90, 0xf8, 0x91, 0x10, 0xb1, 0xb1, 0xb0, 0xf8, 0xde, 0x60, 0x9e, 0xb1, + 0x94, 0xf8, 0x35, 0x11, 0x09, 0x4a, 0x68, 0x23, 0x11, 0xfb, 0x03, 0x21, + 0x91, 0xf8, 0x50, 0x10, 0x51, 0xb1, 0x90, 0xf8, 0xa1, 0x70, 0x06, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x03, 0x1f, 0x20, 0x46, 0x39, 0x46, 0x32, 0x46, + 0xff, 0xf7, 0x5a, 0xfd, 0x28, 0x46, 0xf8, 0xbd, 0xb0, 0xe6, 0x05, 0x00, + 0x60, 0xbd, 0x08, 0x00, 0xb0, 0xb5, 0x00, 0xf0, 0x53, 0xf9, 0x51, 0x4c, + 0x0d, 0x4d, 0x20, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x05, 0xeb, 0xc0, 0x00, + 0x0e, 0xf0, 0xbe, 0xf8, 0x20, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x55, 0xf8, + 0x30, 0x00, 0xb0, 0xf8, 0x38, 0x13, 0x8a, 0x04, 0x58, 0xbf, 0xb0, 0xbd, + 0x21, 0xf4, 0x00, 0x51, 0xa0, 0xf8, 0x38, 0x13, 0x03, 0x48, 0x01, 0x68, + 0x32, 0x20, 0xbd, 0xe8, 0xb0, 0x40, 0x08, 0x47, 0xfc, 0x6d, 0x01, 0x00, + 0xe4, 0x9c, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0x00, 0xf0, 0x34, 0xf9, + 0x3e, 0x4e, 0x3f, 0x4f, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x11, 0x57, 0xf8, + 0x31, 0x00, 0x00, 0x28, 0x46, 0xd0, 0x90, 0xf8, 0x35, 0x21, 0x16, 0x2a, + 0x42, 0xd8, 0x3a, 0x4b, 0x02, 0xeb, 0x42, 0x04, 0x53, 0xf8, 0x24, 0x40, + 0xe4, 0xb3, 0x02, 0xeb, 0x42, 0x02, 0x03, 0xeb, 0x82, 0x02, 0x12, 0x79, + 0x03, 0x2a, 0x35, 0xd1, 0x07, 0xeb, 0xc1, 0x01, 0x91, 0xf8, 0x91, 0x20, + 0x82, 0xb3, 0xb1, 0xf8, 0xdc, 0x20, 0xd2, 0x06, 0x2c, 0xd5, 0xb1, 0xf8, + 0xde, 0x10, 0xc1, 0xb1, 0x90, 0xf8, 0x8a, 0x00, 0x40, 0x07, 0x14, 0xd5, + 0x2c, 0x48, 0x00, 0x68, 0x00, 0x6a, 0x80, 0x47, 0x78, 0xb1, 0x30, 0x78, + 0xc0, 0xeb, 0x40, 0x10, 0x57, 0xf8, 0x30, 0x00, 0x48, 0xb1, 0x90, 0xf8, + 0x35, 0x01, 0x27, 0x49, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, + 0x41, 0x6b, 0x01, 0x31, 0x41, 0x63, 0x24, 0x48, 0x00, 0x78, 0x40, 0xf0, + 0x02, 0x00, 0x02, 0x28, 0x0c, 0xd1, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x11, + 0x57, 0xf8, 0x31, 0x10, 0x91, 0xf8, 0x88, 0x20, 0x52, 0x07, 0x08, 0xd5, + 0x1d, 0x4c, 0x08, 0xe0, 0xbd, 0xe8, 0xf0, 0x81, 0x30, 0x78, 0xc0, 0xeb, + 0x40, 0x11, 0x57, 0xf8, 0x31, 0x10, 0x01, 0xf1, 0x2c, 0x04, 0x25, 0x68, + 0x00, 0x2d, 0xf3, 0xd0, 0xc0, 0xeb, 0x40, 0x10, 0x29, 0x46, 0x57, 0xf8, + 0x30, 0x00, 0x10, 0xf0, 0xed, 0xfb, 0xdf, 0xf8, 0x50, 0x80, 0x20, 0x46, + 0x29, 0x46, 0xd8, 0xf8, 0x00, 0x20, 0x90, 0x47, 0x00, 0x28, 0xe3, 0xd0, + 0x05, 0x46, 0x30, 0x78, 0x29, 0x46, 0xc0, 0xeb, 0x40, 0x10, 0x57, 0xf8, + 0x30, 0x00, 0x10, 0xf0, 0xdb, 0xfb, 0xd8, 0xf8, 0x00, 0x20, 0x20, 0x46, + 0x29, 0x46, 0x90, 0x47, 0x05, 0x46, 0x00, 0x28, 0xef, 0xd1, 0xd1, 0xe7, + 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0xe4, 0x35, 0x01, 0x00, 0x54, 0xf1, 0x05, 0x00, 0x5d, 0x34, 0x01, 0x00, + 0xf4, 0x61, 0x01, 0x00, 0xec, 0xa0, 0x08, 0x00, 0x10, 0xb5, 0x15, 0x48, + 0x15, 0x49, 0x1a, 0x4a, 0x1a, 0x4b, 0x1b, 0x4c, 0x01, 0x60, 0x14, 0x48, + 0x14, 0x49, 0x01, 0x60, 0x14, 0x48, 0x15, 0x49, 0xc0, 0xe9, 0x00, 0x43, + 0xc0, 0xe9, 0x02, 0x12, 0x16, 0x48, 0x17, 0x49, 0x17, 0x4a, 0x18, 0x4b, + 0xc0, 0xe9, 0x00, 0x32, 0xc0, 0xe9, 0x02, 0x21, 0x16, 0x48, 0x17, 0x49, + 0x01, 0x60, 0x17, 0x48, 0x17, 0x49, 0x01, 0x60, 0x17, 0x48, 0x18, 0x49, + 0x01, 0x60, 0x18, 0x48, 0x18, 0x49, 0x01, 0x60, 0x18, 0x48, 0x19, 0x49, + 0x01, 0x60, 0x19, 0x48, 0x19, 0x49, 0x01, 0x60, 0x10, 0xbd, 0x00, 0xbf, + 0xa8, 0xba, 0x08, 0x00, 0x75, 0xf3, 0x03, 0x00, 0x94, 0xd1, 0x08, 0x00, + 0xcd, 0xf3, 0x03, 0x00, 0x60, 0xd1, 0x08, 0x00, 0x58, 0xd3, 0x05, 0x00, + 0x2c, 0xfb, 0x03, 0x00, 0x0c, 0xfb, 0x03, 0x00, 0xec, 0xfa, 0x03, 0x00, + 0x78, 0xd1, 0x08, 0x00, 0x8c, 0xfb, 0x03, 0x00, 0x6c, 0xfb, 0x03, 0x00, + 0x4c, 0xfb, 0x03, 0x00, 0x54, 0xa2, 0x08, 0x00, 0x8d, 0xf5, 0x03, 0x00, + 0xc8, 0xd1, 0x08, 0x00, 0x09, 0xf7, 0x03, 0x00, 0xf0, 0xbd, 0x08, 0x00, + 0x35, 0xf7, 0x03, 0x00, 0x48, 0xb7, 0x08, 0x00, 0x79, 0xf7, 0x03, 0x00, + 0xb4, 0xb9, 0x08, 0x00, 0x29, 0xf8, 0x03, 0x00, 0xdc, 0xd1, 0x08, 0x00, + 0x71, 0xf8, 0x03, 0x00, 0x41, 0xf6, 0x9b, 0x3c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf6, 0x37, 0x4c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf6, 0x25, 0x7c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf2, 0x57, 0x1c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf2, 0x35, 0x3c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf2, 0x59, 0x6c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf6, 0x51, 0x6c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf2, 0x9b, 0x2c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf2, 0x5d, 0x3c, 0xc1, 0xf2, 0x08, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf2, 0xa7, 0x4c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0x67, 0x5c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf6, 0x39, 0x4c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf2, 0x15, 0x4c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xef, 0x29, 0x09, 0x10, 0x5b, 0x2a, 0x09, 0x10, + 0xd7, 0x2c, 0x09, 0x10, 0x8f, 0x2d, 0x09, 0x10, 0xa5, 0xf1, 0x03, 0x00, + 0xf1, 0x33, 0x09, 0x10, 0xb3, 0x35, 0x09, 0x10, 0x69, 0x00, 0x00, 0x00, + 0xef, 0x29, 0x09, 0x10, 0x5b, 0x2a, 0x09, 0x10, 0xd7, 0x2c, 0x09, 0x10, + 0x8f, 0x2d, 0x09, 0x10, 0xa5, 0xf1, 0x03, 0x00, 0xdd, 0x34, 0x09, 0x10, + 0x57, 0x31, 0x09, 0x10, 0x6f, 0x00, 0x00, 0x00, 0xef, 0x29, 0x09, 0x10, + 0x5b, 0x2a, 0x09, 0x10, 0xd7, 0x2c, 0x09, 0x10, 0x8f, 0x2d, 0x09, 0x10, + 0xa5, 0xf1, 0x03, 0x00, 0x37, 0x37, 0x09, 0x10, 0x33, 0x38, 0x09, 0x10, + 0x6e, 0x00, 0x00, 0x00, 0xe9, 0x0b, 0x09, 0x10, 0xf1, 0x0d, 0x09, 0x10, + 0x17, 0x19, 0x09, 0x10, 0x21, 0x1a, 0x09, 0x10, 0x61, 0xf0, 0x03, 0x00, + 0x47, 0x32, 0x09, 0x10, 0x61, 0x33, 0x09, 0x10, 0x68, 0x00, 0x00, 0x00, + 0xe9, 0x0b, 0x09, 0x10, 0xf1, 0x0d, 0x09, 0x10, 0x17, 0x19, 0x09, 0x10, + 0x21, 0x1a, 0x09, 0x10, 0x61, 0xf0, 0x03, 0x00, 0x5f, 0x20, 0x09, 0x10, + 0x75, 0x28, 0x09, 0x10, 0x66, 0x00, 0x00, 0x00, 0xe9, 0x0b, 0x09, 0x10, + 0xf1, 0x0d, 0x09, 0x10, 0x17, 0x19, 0x09, 0x10, 0x21, 0x1a, 0x09, 0x10, + 0x61, 0xf0, 0x03, 0x00, 0x37, 0x36, 0x09, 0x10, 0x29, 0x37, 0x09, 0x10, + 0x6d, 0x00, 0x00, 0x00, 0x7f, 0xb5, 0xf4, 0x4c, 0x37, 0x49, 0x36, 0x4d, + 0x6a, 0x46, 0x20, 0x78, 0x0b, 0x68, 0x36, 0x49, 0x00, 0xeb, 0x00, 0x10, + 0x89, 0x69, 0x05, 0xeb, 0xc0, 0x00, 0x68, 0x30, 0x14, 0x31, 0x98, 0x47, + 0xf3, 0x48, 0x00, 0x99, 0x82, 0x6a, 0x8a, 0x1a, 0x12, 0x01, 0x02, 0xd5, + 0x2f, 0x4a, 0x11, 0x40, 0x81, 0x62, 0x20, 0x78, 0x00, 0xeb, 0x00, 0x10, + 0x05, 0xeb, 0xc0, 0x01, 0x4a, 0x6b, 0x88, 0x6e, 0x83, 0x1a, 0x1b, 0x01, + 0x06, 0xd4, 0x90, 0x42, 0x33, 0xd1, 0xb1, 0xf8, 0x6c, 0x30, 0x0c, 0x8f, + 0x9c, 0x42, 0x2e, 0xd9, 0xdc, 0x4c, 0xdb, 0x4d, 0xc4, 0xe9, 0x00, 0x02, + 0x25, 0x4a, 0x68, 0x60, 0x01, 0xf1, 0x34, 0x00, 0x68, 0x31, 0x13, 0x68, + 0x02, 0xaa, 0x98, 0x47, 0xbd, 0xf8, 0x0c, 0x10, 0x02, 0x9a, 0x41, 0xf2, + 0x88, 0x30, 0x02, 0xfb, 0x00, 0x10, 0x1f, 0x49, 0x01, 0xeb, 0x10, 0x16, + 0xb0, 0xf5, 0x2f, 0x5f, 0x2e, 0x82, 0x14, 0xd3, 0xe2, 0x48, 0x01, 0x68, + 0x02, 0x20, 0x88, 0x47, 0x1a, 0x48, 0x1b, 0x49, 0x00, 0x78, 0x30, 0x44, + 0x08, 0x60, 0x94, 0xf8, 0x20, 0x00, 0x01, 0x28, 0x0c, 0xd1, 0xdb, 0x48, + 0x02, 0x68, 0xa0, 0x7f, 0x01, 0x28, 0x10, 0xd0, 0x01, 0x20, 0x00, 0x21, + 0x0f, 0xe0, 0x0f, 0x48, 0x01, 0x21, 0x01, 0x70, 0x00, 0x20, 0x0f, 0xe0, + 0xa8, 0x7c, 0x40, 0x07, 0x03, 0xd4, 0x10, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x04, 0xe0, 0xd1, 0x48, 0x02, 0x68, 0x01, 0x20, 0x01, 0x21, 0x90, 0x47, + 0x06, 0x48, 0x00, 0x21, 0x01, 0x70, 0x01, 0x20, 0x04, 0xb0, 0x70, 0xbd, + 0xfc, 0x6d, 0x01, 0x00, 0x48, 0xa1, 0x08, 0x00, 0xfc, 0x73, 0x01, 0x00, + 0xfc, 0xff, 0xff, 0x0f, 0x74, 0xe6, 0x05, 0x00, 0x44, 0xa1, 0x08, 0x00, + 0xa8, 0xfd, 0xff, 0xff, 0xa8, 0x0d, 0x01, 0x00, 0x54, 0x11, 0x21, 0x40, + 0x64, 0xbb, 0x08, 0x00, 0x2d, 0xe9, 0xff, 0x47, 0xe1, 0xf7, 0xac, 0xf9, + 0xad, 0x4a, 0xab, 0x4d, 0xab, 0x4c, 0xff, 0x21, 0x13, 0x68, 0x29, 0x70, + 0xe1, 0x68, 0x1e, 0x1a, 0x09, 0x01, 0x36, 0x01, 0xe1, 0x60, 0x46, 0xbf, + 0xc3, 0x1a, 0x23, 0xf0, 0x70, 0x43, 0x00, 0x23, 0x92, 0xf8, 0x20, 0x60, + 0x01, 0x2e, 0x0a, 0xd1, 0x96, 0x7f, 0x9b, 0xb2, 0x01, 0x2e, 0x03, 0xd1, + 0x96, 0x68, 0x33, 0x44, 0x93, 0x60, 0x02, 0xe0, 0xd6, 0x68, 0x33, 0x44, + 0xd3, 0x60, 0x9f, 0x4b, 0xdb, 0x78, 0x5b, 0x07, 0x26, 0xd4, 0xdf, 0xf8, + 0x7c, 0xa2, 0x9f, 0x4f, 0x9a, 0xf8, 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x10, + 0x07, 0xeb, 0xc0, 0x02, 0xb2, 0xf8, 0xdc, 0x00, 0x00, 0xf0, 0x69, 0x00, + 0x09, 0x28, 0x13, 0xd1, 0x99, 0x4b, 0x92, 0xf8, 0xba, 0x00, 0x1b, 0x78, + 0x98, 0x42, 0x0d, 0xd2, 0x97, 0x4b, 0x92, 0xf8, 0xb0, 0x20, 0x13, 0xf8, + 0x10, 0x60, 0xb2, 0x42, 0x06, 0xd3, 0x03, 0xeb, 0x40, 0x03, 0x5b, 0x78, + 0x9a, 0x42, 0x98, 0xbf, 0x07, 0x28, 0x41, 0xd9, 0x41, 0xf0, 0x01, 0x00, + 0xe0, 0x60, 0x1c, 0xe0, 0x53, 0x68, 0x1b, 0x1a, 0xc3, 0xf3, 0x4e, 0x03, + 0x95, 0x7f, 0x1d, 0xb1, 0x95, 0x8a, 0x2b, 0x44, 0x93, 0x82, 0x02, 0xe0, + 0xd5, 0x8a, 0x2b, 0x44, 0xd3, 0x82, 0x20, 0x60, 0x41, 0xf0, 0x04, 0x00, + 0xe0, 0x60, 0xa0, 0x7c, 0x40, 0xf0, 0x01, 0x00, 0xa0, 0x74, 0x80, 0x48, + 0x01, 0x88, 0x01, 0x31, 0x01, 0x80, 0xb7, 0x48, 0x01, 0x89, 0x01, 0x31, + 0x01, 0x81, 0x00, 0x24, 0x8b, 0x48, 0x00, 0x21, 0x01, 0x26, 0x00, 0x25, + 0x02, 0x68, 0x01, 0x20, 0x90, 0x47, 0x89, 0x48, 0x01, 0x68, 0x00, 0x20, + 0x88, 0x47, 0xf0, 0x48, 0xf7, 0x49, 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x10, + 0x01, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x00, 0xc1, 0x07, 0x83, 0x49, + 0x09, 0x68, 0x18, 0xbf, 0x26, 0xea, 0xd0, 0x05, 0x28, 0x46, 0x88, 0x47, + 0x20, 0x46, 0x04, 0xb0, 0xbd, 0xe8, 0xf0, 0x87, 0x01, 0x22, 0x02, 0xfa, + 0x00, 0xf0, 0x10, 0xf0, 0xc7, 0x0f, 0xb7, 0xd0, 0x6d, 0x48, 0x00, 0x68, + 0x80, 0x47, 0xe1, 0x68, 0x00, 0x28, 0xb1, 0xd0, 0x41, 0xf0, 0x02, 0x00, + 0x6a, 0x49, 0xe0, 0x60, 0x9a, 0xf8, 0x00, 0x00, 0x0a, 0x68, 0x00, 0x21, + 0xc0, 0xeb, 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, 0x90, 0x47, 0xdf, 0xf8, + 0x98, 0x81, 0x58, 0xf8, 0x04, 0x0f, 0x01, 0x30, 0xc8, 0xf8, 0x00, 0x00, + 0x9a, 0xf8, 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x12, 0x07, 0xeb, 0xc2, 0x01, + 0x91, 0xf8, 0xba, 0x00, 0x07, 0x28, 0x2c, 0xd1, 0xe0, 0x68, 0x40, 0xf0, + 0x03, 0x00, 0xe0, 0x60, 0x60, 0x48, 0x90, 0xf8, 0x2e, 0x20, 0x85, 0x1c, + 0x00, 0x2a, 0x57, 0xd0, 0x95, 0xf8, 0x2b, 0x40, 0x01, 0x22, 0x81, 0xf8, + 0x91, 0x20, 0x02, 0x2c, 0x5f, 0xd0, 0x01, 0x2c, 0x03, 0xd1, 0x5a, 0x49, + 0x49, 0x78, 0xc9, 0x07, 0x5d, 0xd0, 0xe9, 0x8c, 0x00, 0x29, 0x9a, 0xd0, + 0x57, 0x4e, 0x01, 0x6a, 0x95, 0xf8, 0x28, 0x30, 0xd5, 0xf8, 0x1a, 0x00, + 0xd5, 0xf8, 0x22, 0x20, 0xdf, 0xf8, 0x50, 0xc1, 0x71, 0x27, 0x8d, 0xe8, + 0x90, 0x10, 0x36, 0x68, 0xb0, 0x47, 0x00, 0x24, 0x00, 0x28, 0x89, 0xd1, + 0x48, 0xe0, 0xdf, 0xf8, 0x20, 0x91, 0x99, 0xf8, 0x3c, 0x00, 0x00, 0xf0, + 0x82, 0x01, 0x82, 0x29, 0x0b, 0xd1, 0x57, 0xf8, 0x32, 0x10, 0x41, 0xb1, + 0x00, 0xf0, 0x5e, 0xfd, 0x01, 0x28, 0x3f, 0xd0, 0x04, 0x46, 0x00, 0x28, + 0x42, 0xd1, 0x99, 0xf8, 0x3c, 0x00, 0x00, 0xf0, 0x81, 0x00, 0x81, 0x28, + 0x1a, 0xd1, 0x00, 0xf0, 0x8d, 0xf8, 0x01, 0x28, 0x2e, 0xd1, 0x3b, 0x48, + 0x01, 0x24, 0x41, 0x88, 0x01, 0x31, 0x41, 0x80, 0xd8, 0xf8, 0x04, 0x00, + 0x01, 0x30, 0xc8, 0xf8, 0x04, 0x00, 0x9a, 0xf8, 0x00, 0x00, 0xc0, 0xeb, + 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0xb9, 0x10, 0x41, 0xf0, + 0x20, 0x01, 0x80, 0xf8, 0xb9, 0x10, 0x21, 0xe0, 0x00, 0x24, 0x1f, 0xe0, + 0x28, 0x78, 0xc0, 0x07, 0x3f, 0xf4, 0x4f, 0xaf, 0x2b, 0x48, 0x90, 0xf8, + 0x3c, 0x00, 0x00, 0xf0, 0x81, 0x00, 0x81, 0x28, 0x7f, 0xf4, 0x47, 0xaf, + 0x00, 0xf0, 0x2e, 0xfd, 0x43, 0xe7, 0x2b, 0x49, 0x49, 0x78, 0x09, 0x07, + 0xa1, 0xd4, 0x00, 0x24, 0xec, 0x84, 0x3d, 0xe7, 0x04, 0x46, 0x00, 0xf0, + 0x23, 0xfd, 0x05, 0xe0, 0xb8, 0xf8, 0x14, 0x00, 0x01, 0x24, 0x01, 0x30, + 0xa8, 0xf8, 0x14, 0x00, 0x2a, 0x78, 0x1f, 0x48, 0xff, 0x21, 0xff, 0x2a, + 0x01, 0x70, 0x1b, 0xd0, 0x02, 0xf0, 0x07, 0x01, 0x01, 0x23, 0xd2, 0x08, + 0x03, 0xfa, 0x01, 0xf1, 0x1a, 0x4b, 0x9d, 0x5c, 0x29, 0x42, 0x11, 0xd0, + 0x9a, 0xf8, 0x00, 0x50, 0xc5, 0xeb, 0x45, 0x15, 0x07, 0xeb, 0xc5, 0x05, + 0x95, 0xf8, 0xb1, 0x50, 0x05, 0xf0, 0x0f, 0x06, 0x01, 0x2e, 0x0f, 0xbf, + 0xe9, 0x09, 0x1a, 0x44, 0x12, 0x7c, 0x11, 0x40, 0x01, 0x70, 0x11, 0xe7, + 0x10, 0xe7, 0x00, 0xbf, 0xca, 0x0e, 0x01, 0x00, 0x78, 0xe6, 0x05, 0x00, + 0x8c, 0xe6, 0x05, 0x00, 0x40, 0x36, 0x01, 0x00, 0xf8, 0xda, 0x05, 0x00, + 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0x96, 0x53, 0x01, 0x00, + 0x1e, 0xcd, 0x08, 0x10, 0x50, 0xc9, 0x08, 0x00, 0x38, 0xc9, 0x08, 0x00, + 0x38, 0x7a, 0x01, 0x00, 0x90, 0x01, 0x00, 0x00, 0x7a, 0x2e, 0x01, 0x00, + 0xc9, 0x0e, 0x01, 0x00, 0x88, 0x56, 0x01, 0x00, 0x74, 0x54, 0x01, 0x00, + 0x70, 0x52, 0x01, 0x00, 0x54, 0xc9, 0x08, 0x00, 0xb4, 0x55, 0x01, 0x00, + 0x68, 0xbb, 0x08, 0x00, 0x20, 0xbb, 0x08, 0x00, 0x24, 0xbb, 0x08, 0x00, + 0xb0, 0xb5, 0x00, 0xf0, 0xcd, 0xfc, 0x04, 0x46, 0x64, 0x48, 0x65, 0x49, + 0x00, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x01, 0xeb, 0xc0, 0x00, 0x1c, 0x49, + 0x00, 0x69, 0x09, 0x68, 0x88, 0x42, 0x01, 0xd0, 0x20, 0x46, 0xb0, 0xbd, + 0x19, 0x4d, 0xe1, 0xf7, 0x11, 0xf8, 0x15, 0xf8, 0x1d, 0x2f, 0x42, 0x21, + 0x06, 0x2a, 0x5e, 0x4a, 0x08, 0xbf, 0x41, 0x21, 0x29, 0x70, 0x92, 0xf8, + 0x20, 0x30, 0x01, 0x2b, 0x08, 0xd1, 0x92, 0xf8, 0x21, 0x00, 0x01, 0x28, + 0xea, 0xd1, 0x68, 0x78, 0x40, 0xf0, 0x80, 0x00, 0x68, 0x70, 0xe5, 0xe7, + 0x0e, 0x4a, 0x11, 0x44, 0x91, 0xf8, 0xab, 0x10, 0x00, 0x29, 0xdf, 0xd0, + 0x0c, 0x4a, 0x12, 0x68, 0x53, 0x1c, 0x06, 0xd0, 0x10, 0x1a, 0x40, 0x30, + 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0xd4, 0xd9, 0x68, 0x78, + 0x88, 0x42, 0xd1, 0xd0, 0x06, 0x48, 0x69, 0x70, 0x81, 0x8a, 0x01, 0x31, + 0x81, 0x82, 0xcb, 0xe7, 0x68, 0xba, 0x08, 0x00, 0xfc, 0x20, 0x01, 0x00, + 0x04, 0x31, 0x06, 0x00, 0x78, 0xd3, 0x05, 0x00, 0x38, 0xfb, 0x05, 0x00, + 0x70, 0xb5, 0x3e, 0x48, 0x80, 0x7c, 0xc1, 0x07, 0x33, 0xd1, 0x80, 0x07, + 0x31, 0xd4, 0x00, 0xf0, 0x7f, 0xfc, 0x00, 0x28, 0x48, 0xd0, 0x01, 0x28, + 0x6e, 0xd1, 0x39, 0x4d, 0x39, 0x4c, 0x3f, 0x4e, 0x28, 0x78, 0x32, 0x68, + 0x00, 0xeb, 0x00, 0x11, 0x04, 0xeb, 0xc1, 0x01, 0x09, 0x69, 0x91, 0x42, + 0x13, 0xd1, 0x3b, 0x4a, 0xc0, 0xeb, 0x40, 0x11, 0x02, 0xeb, 0xc1, 0x01, + 0x91, 0xf8, 0xba, 0x10, 0x07, 0x29, 0x0c, 0xd0, 0x31, 0x48, 0x01, 0x68, + 0x00, 0x20, 0x88, 0x47, 0x28, 0x78, 0x32, 0x68, 0x00, 0xeb, 0x00, 0x11, + 0x04, 0xeb, 0xc1, 0x01, 0x09, 0x69, 0x91, 0x42, 0x07, 0xd1, 0x31, 0x49, + 0x00, 0xeb, 0x00, 0x10, 0x04, 0xeb, 0xc0, 0x00, 0x0a, 0x68, 0x2c, 0x21, + 0x90, 0x47, 0x01, 0x20, 0x70, 0xbd, 0xf8, 0x4c, 0x23, 0x4d, 0x24, 0x49, + 0x20, 0x78, 0x09, 0x68, 0x00, 0xeb, 0x00, 0x10, 0x05, 0xeb, 0xc0, 0x00, + 0x40, 0x68, 0x88, 0x47, 0x21, 0x78, 0x01, 0xeb, 0x01, 0x11, 0x05, 0xeb, + 0xc1, 0x01, 0x09, 0x6a, 0x0a, 0x1a, 0x12, 0x01, 0x46, 0xbf, 0x40, 0x1a, + 0xc0, 0xf3, 0x5a, 0x00, 0x00, 0x20, 0x1a, 0x49, 0x09, 0x68, 0x88, 0x47, + 0x19, 0x48, 0x90, 0xf8, 0x20, 0x10, 0x01, 0x29, 0x21, 0xd1, 0x08, 0x30, + 0x01, 0x68, 0x91, 0xb1, 0x42, 0xf2, 0x10, 0x72, 0x64, 0x25, 0x01, 0xfb, + 0x02, 0xf3, 0x42, 0x68, 0x54, 0x18, 0xb3, 0xfb, 0xf4, 0xf4, 0x12, 0x4b, + 0x93, 0xf8, 0xfd, 0x32, 0x13, 0xfb, 0x05, 0xf5, 0x00, 0x23, 0xa5, 0x42, + 0x88, 0xbf, 0x01, 0x23, 0x01, 0xe0, 0x42, 0x68, 0x01, 0x23, 0x11, 0x44, + 0x0c, 0x4a, 0x83, 0x75, 0x91, 0x42, 0x24, 0xbf, 0x00, 0x21, 0xc0, 0xe9, + 0x00, 0x11, 0x01, 0x21, 0x41, 0x76, 0x00, 0x20, 0x70, 0xbd, 0x00, 0xbf, + 0x78, 0xe6, 0x05, 0x00, 0x74, 0x87, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, + 0xac, 0xa0, 0x08, 0x00, 0x4c, 0xba, 0x08, 0x00, 0x8c, 0xe6, 0x05, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x01, 0xee, 0x02, 0x00, 0x6c, 0xba, 0x08, 0x00, + 0x0c, 0x6f, 0x01, 0x00, 0xf4, 0xa0, 0x08, 0x00, 0x70, 0xb5, 0x00, 0xf0, + 0xf7, 0xfb, 0x04, 0x46, 0x12, 0x4d, 0xc8, 0x48, 0x12, 0x49, 0x5c, 0x22, + 0xd5, 0xf8, 0x00, 0x61, 0x00, 0x78, 0x10, 0xfb, 0x02, 0x10, 0x10, 0x49, + 0x40, 0x78, 0x09, 0x68, 0x88, 0x47, 0x86, 0x42, 0x03, 0xd9, 0x8c, 0xb1, + 0x18, 0xf0, 0x8a, 0xfc, 0x0f, 0xe0, 0x0c, 0x48, 0x90, 0xf8, 0x64, 0x01, + 0xc0, 0xf3, 0xc1, 0x00, 0x29, 0x6d, 0x21, 0xf0, 0x0b, 0x01, 0x01, 0x44, + 0x29, 0x65, 0x29, 0x68, 0x21, 0xf0, 0x0b, 0x01, 0x08, 0x44, 0x28, 0x60, + 0x00, 0x24, 0x20, 0x46, 0x70, 0xbd, 0x00, 0xbf, 0x54, 0x10, 0x21, 0x40, + 0x44, 0x4f, 0x01, 0x00, 0xcc, 0xbe, 0x08, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0xb0, 0xb5, 0xb1, 0x4c, 0xb1, 0x4d, 0xff, 0x21, 0x20, 0x78, 0xc0, 0xeb, + 0x40, 0x10, 0x05, 0xeb, 0xc0, 0x00, 0x80, 0xf8, 0xbb, 0x10, 0xb0, 0xf8, + 0xdc, 0x00, 0xc0, 0x07, 0x17, 0xd0, 0x0d, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x20, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x05, 0xeb, 0xc0, 0x00, 0x90, 0xf8, + 0xba, 0x10, 0x07, 0x29, 0x0b, 0xd8, 0x01, 0x22, 0x02, 0xfa, 0x01, 0xf1, + 0x11, 0xf0, 0x86, 0x0f, 0x05, 0xd0, 0x90, 0xf8, 0xb0, 0x00, 0x26, 0x28, + 0x3c, 0xbf, 0x01, 0x20, 0xb0, 0xbd, 0x00, 0x20, 0xb0, 0xbd, 0x00, 0xbf, + 0x20, 0xa1, 0x08, 0x00, 0x2d, 0xe9, 0xfe, 0x43, 0x9a, 0x4f, 0x9b, 0x4e, + 0x38, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x06, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, + 0xdc, 0x10, 0x01, 0xf0, 0x69, 0x01, 0x09, 0x29, 0x42, 0xd1, 0xda, 0x4a, + 0x90, 0xf8, 0xba, 0x10, 0x12, 0x78, 0x91, 0x42, 0x3c, 0xd2, 0xd8, 0x4a, + 0x90, 0xf8, 0xb0, 0x00, 0x12, 0xf8, 0x11, 0x30, 0x98, 0x42, 0x35, 0xd3, + 0x02, 0xeb, 0x41, 0x01, 0x49, 0x78, 0x88, 0x42, 0x30, 0xd8, 0xd3, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x60, 0xb3, 0x38, 0x78, 0x8a, 0x49, 0xc0, 0xeb, + 0x40, 0x10, 0x0a, 0x68, 0x00, 0x21, 0x06, 0xeb, 0xc0, 0x00, 0x90, 0x47, + 0x38, 0x78, 0xdf, 0xf8, 0x1c, 0x92, 0xc0, 0xeb, 0x40, 0x10, 0x06, 0xeb, + 0xc0, 0x04, 0x94, 0xf8, 0xba, 0x00, 0x07, 0x28, 0x1d, 0xd0, 0x02, 0x28, + 0x4b, 0xd0, 0x01, 0x28, 0x40, 0xf0, 0xbc, 0x80, 0xdf, 0xf8, 0x00, 0x82, + 0xd8, 0xf8, 0xac, 0x00, 0x00, 0x28, 0x00, 0xf0, 0xb5, 0x80, 0x98, 0xf8, + 0x9e, 0x00, 0xc0, 0x07, 0x52, 0xd1, 0x81, 0x4b, 0x94, 0xf8, 0xb8, 0x20, + 0xd4, 0xf8, 0xb4, 0x10, 0x20, 0x68, 0x1b, 0x68, 0x98, 0x47, 0x50, 0xe0, + 0x18, 0xf0, 0x26, 0xfc, 0x00, 0x20, 0xbd, 0xe8, 0xfe, 0x83, 0x75, 0x48, + 0x90, 0xf8, 0x2e, 0x10, 0x85, 0x1c, 0xa1, 0xb3, 0x01, 0x21, 0x84, 0xf8, + 0x91, 0x10, 0x95, 0xf8, 0x2b, 0x40, 0x02, 0x2c, 0x00, 0xf0, 0x9c, 0x80, + 0x01, 0x2c, 0x04, 0xd1, 0x6e, 0x49, 0x49, 0x78, 0xc9, 0x07, 0x00, 0xf0, + 0x9a, 0x80, 0xe9, 0x8c, 0x00, 0x29, 0x00, 0xf0, 0x8b, 0x80, 0x6b, 0x4e, + 0x01, 0x6a, 0x95, 0xf8, 0x28, 0x30, 0xd5, 0xf8, 0x1a, 0x00, 0xd5, 0xf8, + 0x22, 0x20, 0xdf, 0xf8, 0xa0, 0xc1, 0x71, 0x27, 0x8d, 0xe8, 0x90, 0x10, + 0x36, 0x68, 0xb0, 0x47, 0x08, 0xb9, 0x00, 0x20, 0xe8, 0x84, 0xb9, 0xf8, + 0x06, 0x00, 0x01, 0x30, 0xa9, 0xf8, 0x06, 0x00, 0x72, 0xe0, 0x5c, 0x48, + 0x90, 0xf8, 0x3c, 0x00, 0x00, 0xf0, 0x81, 0x00, 0x81, 0x28, 0x6b, 0xd1, + 0x00, 0xf0, 0xfa, 0xfa, 0x68, 0xe0, 0x57, 0x48, 0x90, 0xf8, 0x3c, 0x00, + 0x00, 0xf0, 0x81, 0x00, 0x81, 0x28, 0x61, 0xd1, 0x28, 0x78, 0xc0, 0x07, + 0xf2, 0xd1, 0x5d, 0xe0, 0x56, 0x4a, 0x94, 0xf8, 0xb8, 0x10, 0xd4, 0xf8, + 0xb4, 0x00, 0x12, 0x68, 0x90, 0x47, 0x00, 0x28, 0x54, 0xd0, 0x38, 0x78, + 0x53, 0x49, 0x08, 0xf1, 0x94, 0x05, 0xc0, 0xeb, 0x40, 0x10, 0x0a, 0x68, + 0x29, 0x46, 0x06, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0xbb, 0x00, 0x90, 0x47, + 0x38, 0x78, 0x29, 0x46, 0xc0, 0xeb, 0x40, 0x10, 0x06, 0xeb, 0xc0, 0x00, + 0xd0, 0xf8, 0xa4, 0x00, 0x82, 0x1d, 0x4a, 0x48, 0x03, 0x68, 0x20, 0x46, + 0x98, 0x47, 0xc8, 0xb3, 0x38, 0x78, 0x48, 0x4b, 0x22, 0x68, 0xc0, 0xeb, + 0x40, 0x10, 0x1b, 0x68, 0x06, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0xb8, 0x10, + 0xd0, 0xf8, 0xb4, 0x00, 0x98, 0x47, 0x68, 0xb1, 0x01, 0x46, 0xb0, 0xf8, + 0x84, 0x00, 0xc0, 0x06, 0x08, 0xd5, 0x91, 0xf8, 0x24, 0x01, 0x46, 0x28, + 0x04, 0xd0, 0x3e, 0x48, 0x08, 0x22, 0x03, 0x68, 0x98, 0x20, 0x98, 0x47, + 0xc5, 0x4d, 0x72, 0xb6, 0x28, 0x68, 0x40, 0x00, 0x01, 0x30, 0x28, 0x60, + 0xd8, 0xe9, 0x08, 0x01, 0x81, 0x42, 0x21, 0xd1, 0x3d, 0x48, 0x08, 0xf1, + 0x04, 0x04, 0x00, 0x6b, 0xa0, 0x42, 0x3e, 0xd0, 0x36, 0x48, 0x00, 0x68, + 0x80, 0x47, 0xc8, 0xf8, 0x28, 0x00, 0x20, 0x30, 0x03, 0x21, 0xc8, 0xf8, + 0x14, 0x00, 0x37, 0x48, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x26, 0xe0, + 0xd9, 0xf8, 0x00, 0x00, 0x01, 0x30, 0xc9, 0xf8, 0x00, 0x00, 0x51, 0xe7, + 0x21, 0x49, 0x49, 0x78, 0x09, 0x07, 0x3f, 0xf5, 0x66, 0xaf, 0x00, 0x20, + 0xe8, 0x84, 0xf1, 0xe7, 0x27, 0x4a, 0x26, 0x4c, 0xd8, 0xf8, 0x00, 0x10, + 0xa0, 0x69, 0x12, 0x68, 0x90, 0x47, 0xd0, 0xb1, 0x24, 0x48, 0x00, 0x68, + 0x80, 0x47, 0xd8, 0xf8, 0x00, 0x20, 0x00, 0xf1, 0x20, 0x01, 0xc8, 0xf8, + 0x28, 0x00, 0xc8, 0xf8, 0x14, 0x10, 0xa1, 0x69, 0x10, 0x60, 0x1f, 0x48, + 0x03, 0x68, 0x10, 0x46, 0x98, 0x47, 0xd8, 0xf8, 0x24, 0x00, 0xd8, 0xf8, + 0x28, 0x10, 0x01, 0xeb, 0x40, 0x00, 0x1b, 0x49, 0x08, 0x40, 0x1b, 0x49, + 0x48, 0x60, 0x28, 0x68, 0x40, 0x08, 0x28, 0x60, 0x28, 0x68, 0x80, 0xf3, + 0x10, 0x88, 0xb9, 0xf8, 0x04, 0x00, 0x01, 0x30, 0xa9, 0xf8, 0x04, 0x00, + 0xc2, 0xe7, 0x00, 0xbf, 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0x38, 0xc9, 0x08, 0x00, 0x38, 0xfb, 0x05, 0x00, 0x90, 0x01, 0x00, 0x00, + 0x74, 0x54, 0x01, 0x00, 0x70, 0x52, 0x01, 0x00, 0x54, 0xc9, 0x08, 0x00, + 0xb4, 0x55, 0x01, 0x00, 0x3c, 0xc9, 0x08, 0x00, 0x34, 0xc9, 0x08, 0x00, + 0x4c, 0xc9, 0x08, 0x00, 0x58, 0xc9, 0x08, 0x00, 0xf8, 0xc8, 0x08, 0x00, + 0xa8, 0xa0, 0x08, 0x00, 0xfc, 0x73, 0x01, 0x00, 0xe8, 0xa0, 0x08, 0x00, + 0x14, 0xd9, 0x08, 0x00, 0xd4, 0xa0, 0x08, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0x64, 0x54, 0x01, 0x00, 0x18, 0x74, 0x01, 0x00, 0xbc, 0xa0, 0x08, 0x00, + 0xfe, 0xb5, 0xe4, 0x4c, 0xe4, 0x4d, 0x20, 0x78, 0xc0, 0xeb, 0x40, 0x10, + 0x05, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x10, 0x01, 0xf0, 0x69, 0x01, + 0x09, 0x29, 0x4d, 0xd1, 0x27, 0x4a, 0x90, 0xf8, 0xba, 0x10, 0x12, 0x78, + 0x91, 0x42, 0x47, 0xd2, 0x25, 0x4a, 0x90, 0xf8, 0xb0, 0x00, 0x12, 0xf8, + 0x11, 0x30, 0x98, 0x42, 0x40, 0xd3, 0x02, 0xeb, 0x41, 0x01, 0x49, 0x78, + 0x88, 0x42, 0x3b, 0xd8, 0x20, 0x48, 0x00, 0x68, 0x80, 0x47, 0xb8, 0xb3, + 0x20, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x05, 0xeb, 0xc0, 0x01, 0x91, 0xf8, + 0xba, 0x00, 0x07, 0x28, 0x2e, 0xd1, 0x91, 0xf8, 0x54, 0x00, 0x80, 0x07, + 0x70, 0x48, 0x00, 0xf1, 0x02, 0x04, 0x0b, 0xd4, 0x22, 0x78, 0x12, 0x07, + 0x08, 0xd5, 0x16, 0x4a, 0x23, 0x7c, 0x15, 0x79, 0x9d, 0x42, 0x1f, 0xd1, + 0x63, 0x7c, 0x52, 0x79, 0x9a, 0x42, 0x1b, 0xd1, 0x01, 0x22, 0x81, 0xf8, + 0x91, 0x20, 0x94, 0xf8, 0x2c, 0x10, 0xa9, 0xb1, 0xe1, 0x8c, 0x99, 0xb1, + 0xda, 0x4d, 0x01, 0x6a, 0x94, 0xf8, 0x28, 0x30, 0xd4, 0xf8, 0x1a, 0x00, + 0xd4, 0xf8, 0x22, 0x20, 0x94, 0xf8, 0x2b, 0x60, 0xdf, 0xf8, 0x24, 0xc0, + 0x72, 0x27, 0x2d, 0x68, 0x8d, 0xe8, 0xc0, 0x10, 0xa8, 0x47, 0x08, 0xb9, + 0x00, 0x20, 0xe0, 0x84, 0x00, 0x20, 0xfe, 0xbd, 0x96, 0x53, 0x01, 0x00, + 0x1e, 0xcd, 0x08, 0x10, 0x50, 0xc9, 0x08, 0x00, 0x94, 0x57, 0x01, 0x00, + 0xb4, 0x55, 0x01, 0x00, 0x80, 0xb5, 0x00, 0xf0, 0xd1, 0xf9, 0xaf, 0x48, + 0x04, 0x49, 0x5c, 0x22, 0x00, 0x78, 0x10, 0xfb, 0x02, 0x10, 0x03, 0x49, + 0x81, 0x62, 0x01, 0x20, 0x80, 0xbd, 0x00, 0xbf, 0x44, 0x4f, 0x01, 0x00, + 0x09, 0x06, 0x04, 0x00, 0x10, 0xb5, 0x2d, 0x48, 0x18, 0x4c, 0x41, 0x6a, + 0x01, 0x31, 0x41, 0x62, 0x15, 0x48, 0x90, 0xf8, 0x20, 0x10, 0x01, 0x29, + 0x04, 0xbf, 0x00, 0x21, 0x80, 0xf8, 0x21, 0x10, 0x20, 0x68, 0x01, 0x01, + 0x0b, 0xd4, 0x12, 0x49, 0x12, 0x4a, 0x91, 0xf8, 0xec, 0x10, 0x92, 0x7f, + 0x8a, 0x42, 0x04, 0xd1, 0xe0, 0xf7, 0xec, 0xfc, 0x0f, 0x49, 0x08, 0x60, + 0x20, 0x68, 0x00, 0x01, 0x5c, 0xbf, 0x01, 0x20, 0x10, 0xbd, 0x0d, 0x48, + 0x04, 0x22, 0x81, 0x7c, 0x41, 0xf0, 0x02, 0x01, 0x81, 0x74, 0xc1, 0x68, + 0x62, 0xf3, 0x03, 0x01, 0xc1, 0x60, 0x17, 0x48, 0x41, 0x8a, 0x01, 0x31, + 0x41, 0x82, 0x00, 0x20, 0x10, 0xbd, 0x00, 0xbf, 0x8c, 0xe6, 0x05, 0x00, + 0x40, 0x36, 0x01, 0x00, 0x04, 0x31, 0x06, 0x00, 0xfc, 0x20, 0x01, 0x00, + 0x78, 0xd3, 0x05, 0x00, 0x78, 0xe6, 0x05, 0x00, 0xb0, 0xb5, 0x0d, 0x4c, + 0xe5, 0x68, 0x00, 0xf0, 0x85, 0xf9, 0xe1, 0x68, 0x8d, 0x42, 0x03, 0xd0, + 0x0a, 0x49, 0x8a, 0x6a, 0x01, 0x32, 0x8a, 0x62, 0xb0, 0xbd, 0x00, 0xbf, + 0xb0, 0xb5, 0x06, 0x4c, 0xe5, 0x68, 0x00, 0xf0, 0x7d, 0xf9, 0xe1, 0x68, + 0x8d, 0x42, 0x03, 0xd0, 0x03, 0x49, 0x8a, 0x6a, 0x01, 0x32, 0x8a, 0x62, + 0xb0, 0xbd, 0x00, 0xbf, 0x38, 0x7a, 0x01, 0x00, 0x84, 0xf0, 0x05, 0x00, + 0x2d, 0xe9, 0xff, 0x47, 0x13, 0x4c, 0x07, 0x46, 0xdd, 0xf8, 0x38, 0x90, + 0x98, 0x46, 0x15, 0x46, 0x0e, 0x46, 0x72, 0xb6, 0x20, 0x68, 0x40, 0x00, + 0x01, 0x30, 0x20, 0x60, 0xdd, 0xe9, 0x0c, 0x0a, 0x02, 0x28, 0x04, 0xd3, + 0x04, 0x28, 0x02, 0xd8, 0x0b, 0x48, 0x00, 0x68, 0x80, 0x47, 0xcd, 0xe9, + 0x00, 0x0a, 0x38, 0x46, 0x31, 0x46, 0x2a, 0x46, 0x43, 0x46, 0xcd, 0xf8, + 0x08, 0x90, 0x00, 0xf0, 0x55, 0xf9, 0x21, 0x68, 0x49, 0x08, 0x21, 0x60, + 0x21, 0x68, 0x81, 0xf3, 0x10, 0x88, 0x04, 0xb0, 0xbd, 0xe8, 0xf0, 0x87, + 0x24, 0x36, 0x01, 0x00, 0x10, 0x9c, 0x08, 0x00, 0xb0, 0xb5, 0x05, 0x4c, + 0xa5, 0x78, 0x6d, 0x06, 0x44, 0xbf, 0x94, 0xf8, 0x58, 0x40, 0x84, 0x70, + 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x42, 0xb9, 0x74, 0x54, 0x01, 0x00, + 0x70, 0xb5, 0x85, 0x79, 0x00, 0x24, 0x80, 0x2d, 0x07, 0xd1, 0x7f, 0x25, + 0x85, 0x71, 0x3f, 0x4d, 0xb5, 0xf8, 0x58, 0x60, 0xa5, 0xf8, 0x58, 0x40, + 0x34, 0x46, 0x54, 0x4d, 0x54, 0x4e, 0x2d, 0x78, 0xc5, 0xeb, 0x45, 0x15, + 0x06, 0xeb, 0xc5, 0x05, 0x2d, 0x69, 0x2d, 0x7f, 0x7b, 0x2d, 0x02, 0xd1, + 0x05, 0x68, 0x7f, 0x26, 0xae, 0x70, 0x00, 0xf0, 0x29, 0xf9, 0x14, 0xb1, + 0x33, 0x49, 0xa1, 0xf8, 0x58, 0x40, 0x70, 0xbd, 0x70, 0xb5, 0x84, 0x79, + 0x80, 0x2c, 0x0d, 0xd1, 0x7f, 0x24, 0x00, 0x26, 0x84, 0x71, 0x2e, 0x4c, + 0xb4, 0xf8, 0x58, 0x50, 0xa4, 0xf8, 0x58, 0x60, 0x00, 0xf0, 0x1c, 0xf9, + 0x0d, 0xb1, 0xa4, 0xf8, 0x58, 0x50, 0x70, 0xbd, 0xbd, 0xe8, 0x70, 0x40, + 0x00, 0xf0, 0x14, 0xb9, 0x7c, 0xb5, 0x25, 0x4a, 0x01, 0x69, 0x12, 0x68, + 0x8a, 0x42, 0x03, 0xd0, 0xbd, 0xe8, 0x7c, 0x40, 0x00, 0xf0, 0x10, 0xb9, + 0x21, 0x49, 0xd1, 0xf8, 0xac, 0x40, 0x64, 0xb3, 0x91, 0xf8, 0x3c, 0x10, + 0x01, 0xf0, 0x82, 0x01, 0x82, 0x29, 0xf1, 0xd0, 0x34, 0x4d, 0x35, 0x4e, + 0x06, 0x21, 0x06, 0x23, 0x28, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x06, 0xeb, + 0xc0, 0x00, 0xd0, 0xf8, 0xb4, 0x20, 0x04, 0xf5, 0x80, 0x70, 0xe0, 0xf7, + 0x17, 0xfc, 0x28, 0x78, 0x15, 0x49, 0x00, 0x25, 0xc0, 0xeb, 0x40, 0x10, + 0x0b, 0x68, 0x14, 0x49, 0x06, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0xb8, 0x00, + 0x09, 0x78, 0x84, 0xf8, 0x2c, 0x03, 0x94, 0xf8, 0x35, 0x01, 0xc9, 0x07, + 0x06, 0xd1, 0x04, 0x21, 0x00, 0x22, 0x98, 0x47, 0x0d, 0x48, 0x06, 0x21, + 0x05, 0xe0, 0x7c, 0xbd, 0x0d, 0x21, 0x00, 0x22, 0x98, 0x47, 0x0a, 0x48, + 0x0f, 0x21, 0x06, 0x68, 0x94, 0xf8, 0x35, 0x01, 0xcd, 0xe9, 0x00, 0x05, + 0x00, 0x20, 0x00, 0x22, 0x00, 0x23, 0xb0, 0x47, 0x7c, 0xbd, 0x00, 0xbf, + 0x54, 0xd3, 0x08, 0x00, 0x90, 0x01, 0x00, 0x00, 0xfc, 0xa0, 0x08, 0x00, + 0x99, 0x53, 0x01, 0x00, 0x14, 0x99, 0x08, 0x00, 0x80, 0xb5, 0x00, 0xf0, + 0xc7, 0xf8, 0x12, 0x49, 0x12, 0x4a, 0x09, 0x78, 0xc1, 0xeb, 0x41, 0x11, + 0x02, 0xeb, 0xc1, 0x02, 0x10, 0x49, 0x92, 0xf8, 0x91, 0x30, 0x1c, 0x31, + 0x01, 0x2b, 0x03, 0xd1, 0xca, 0x88, 0x01, 0x32, 0xca, 0x80, 0x80, 0xbd, + 0xb2, 0xf8, 0xdc, 0x20, 0xd3, 0x07, 0x03, 0xd1, 0x0a, 0x88, 0x01, 0x32, + 0x0a, 0x80, 0x80, 0xbd, 0x02, 0xf0, 0x69, 0x02, 0x09, 0x2a, 0x1d, 0xbf, + 0x4a, 0x88, 0x01, 0x32, 0x4a, 0x80, 0x8a, 0x88, 0x04, 0xbf, 0x01, 0x32, + 0x8a, 0x80, 0x80, 0xbd, 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0x38, 0xfb, 0x05, 0x00, 0x10, 0x48, 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, + 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, 0x12, 0x49, 0x01, 0x60, 0x12, 0x48, + 0x12, 0x49, 0x01, 0x60, 0x12, 0x48, 0x13, 0x49, 0x01, 0x60, 0x13, 0x48, + 0x13, 0x49, 0x01, 0x60, 0x13, 0x48, 0x14, 0x49, 0x01, 0x60, 0x14, 0x48, + 0x14, 0x49, 0x01, 0x60, 0x14, 0x48, 0x15, 0x49, 0x01, 0x60, 0x15, 0x48, + 0x15, 0x49, 0x01, 0x60, 0x15, 0x48, 0x16, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x68, 0xba, 0x08, 0x00, 0x18, 0x0a, 0x04, 0x00, 0x6c, 0xba, 0x08, 0x00, + 0xf8, 0x09, 0x04, 0x00, 0x20, 0xd3, 0x08, 0x00, 0x38, 0x0a, 0x04, 0x00, + 0x54, 0xc9, 0x08, 0x00, 0xc5, 0x06, 0x04, 0x00, 0xdc, 0xd2, 0x08, 0x00, + 0x21, 0x07, 0x04, 0x00, 0xec, 0xb7, 0x08, 0x00, 0x3d, 0x07, 0x04, 0x00, + 0xe8, 0xb7, 0x08, 0x00, 0x81, 0x07, 0x04, 0x00, 0x40, 0xd3, 0x08, 0x00, + 0x58, 0x0a, 0x04, 0x00, 0x00, 0xca, 0x08, 0x00, 0xad, 0x07, 0x04, 0x00, + 0x04, 0xca, 0x08, 0x00, 0x78, 0x0a, 0x04, 0x00, 0x74, 0xba, 0x08, 0x00, + 0x98, 0x0a, 0x04, 0x00, 0x4c, 0xf6, 0x5b, 0x2c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4c, 0xf6, 0x1b, 0x6c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4c, 0xf6, 0x63, 0x4c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf2, 0x11, 0x1c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf2, 0x73, 0x7c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf2, 0xfd, 0x6c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf6, 0x11, 0x0c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf2, 0x63, 0x1c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4c, 0xf6, 0xd7, 0x6c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf2, 0x11, 0x4c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf2, 0xcb, 0x0c, 0xc1, 0xf2, 0x0a, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf2, 0x19, 0x4c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf6, 0x5b, 0x4c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf2, 0x09, 0x0c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x71, 0xc4, 0x09, 0x10, 0x89, 0xc5, 0x09, 0x10, + 0xad, 0xfb, 0x03, 0x00, 0x25, 0xc6, 0x09, 0x10, 0xb5, 0xfc, 0x03, 0x00, + 0x2b, 0xd0, 0x09, 0x10, 0x65, 0x00, 0x04, 0x00, 0x60, 0x00, 0x00, 0x00, + 0x71, 0xc4, 0x09, 0x10, 0xe5, 0x05, 0x04, 0x00, 0x3f, 0xd7, 0x09, 0x10, + 0x43, 0xd7, 0x09, 0x10, 0x85, 0x06, 0x04, 0x00, 0xeb, 0xd8, 0x09, 0x10, + 0x65, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x09, 0xf7, 0x09, 0x10, + 0x13, 0xf1, 0x08, 0x10, 0x8d, 0x01, 0x04, 0x00, 0xf1, 0x01, 0x04, 0x00, + 0x49, 0x02, 0x04, 0x00, 0x2b, 0xd0, 0x09, 0x10, 0xe9, 0x70, 0x0f, 0x10, + 0xa1, 0x00, 0x00, 0x00, 0x71, 0xc4, 0x09, 0x10, 0x89, 0xc5, 0x09, 0x10, + 0x37, 0xe5, 0x09, 0x10, 0x87, 0xe5, 0x09, 0x10, 0x15, 0x05, 0x04, 0x00, + 0xa3, 0xf6, 0x09, 0x10, 0xe7, 0xe0, 0x09, 0x10, 0x7a, 0x00, 0x00, 0x00, + 0x71, 0xc4, 0x09, 0x10, 0xfd, 0xde, 0x09, 0x10, 0xbb, 0xdf, 0x09, 0x10, + 0xbf, 0xdf, 0x09, 0x10, 0x59, 0x08, 0x04, 0x00, 0xd3, 0xdb, 0x09, 0x10, + 0xe7, 0xe0, 0x09, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x71, 0xc4, 0x09, 0x10, + 0xfd, 0xd6, 0x09, 0x10, 0x3f, 0xd7, 0x09, 0x10, 0x43, 0xd7, 0x09, 0x10, + 0xa1, 0x06, 0x04, 0x00, 0x8f, 0xf2, 0x09, 0x10, 0xe7, 0xe0, 0x09, 0x10, + 0x79, 0x00, 0x00, 0x00, 0xb0, 0xb5, 0x15, 0x4d, 0x04, 0x46, 0x28, 0x88, + 0x28, 0xb3, 0xa9, 0x48, 0x94, 0xf8, 0x1d, 0x11, 0xc1, 0xeb, 0x01, 0x11, + 0x00, 0x68, 0x49, 0x01, 0x40, 0x5c, 0x02, 0x28, 0x1b, 0xd0, 0x0f, 0x48, + 0x00, 0x68, 0x80, 0x47, 0xd4, 0xf8, 0xf4, 0x10, 0x40, 0x1a, 0x29, 0x88, + 0x20, 0xf0, 0x70, 0x40, 0x00, 0xeb, 0x80, 0x00, 0x40, 0x00, 0xb1, 0xeb, + 0x50, 0x1f, 0x0c, 0xd2, 0x20, 0x6c, 0x94, 0xf8, 0x46, 0x11, 0x40, 0xf4, + 0x80, 0x10, 0x20, 0x64, 0x94, 0xf8, 0x50, 0x01, 0x81, 0x42, 0x38, 0xbf, + 0x01, 0x46, 0x84, 0xf8, 0xf8, 0x11, 0xb0, 0xbd, 0x7c, 0xd3, 0x05, 0x00, + 0xe0, 0xa0, 0x08, 0x00, 0x42, 0x78, 0x03, 0x89, 0x1a, 0x44, 0x01, 0x3a, + 0x8a, 0x42, 0x1c, 0xbf, 0x00, 0x20, 0x70, 0x47, 0x00, 0x78, 0x00, 0x28, + 0x18, 0xbf, 0x01, 0x20, 0x70, 0x47, 0x00, 0xbf, 0x2d, 0xe9, 0xf0, 0x41, + 0x88, 0x46, 0x01, 0x78, 0x09, 0xb1, 0xbd, 0xe8, 0xf0, 0x81, 0xd0, 0xf8, + 0xa4, 0x40, 0x14, 0xb3, 0x94, 0xf8, 0x20, 0x51, 0x04, 0xf5, 0xa3, 0x77, + 0x38, 0x46, 0x29, 0x46, 0x00, 0xf0, 0x2e, 0xf8, 0x00, 0x28, 0xf0, 0xd1, + 0xb4, 0xf8, 0x74, 0x61, 0x38, 0x46, 0x31, 0x46, 0xff, 0xf7, 0xd8, 0xff, + 0x00, 0x28, 0xe8, 0xd1, 0x04, 0xf5, 0xa8, 0x77, 0x29, 0x46, 0x38, 0x46, + 0x00, 0xf0, 0x1e, 0xf8, 0x00, 0x28, 0xe0, 0xd1, 0x38, 0x46, 0x31, 0x46, + 0xff, 0xf7, 0xca, 0xff, 0x00, 0x28, 0xda, 0xd1, 0x54, 0xf8, 0x04, 0x4c, + 0xdb, 0xe7, 0x08, 0x49, 0x98, 0xf8, 0x12, 0x00, 0x91, 0xf8, 0x69, 0x23, + 0x91, 0xf8, 0x83, 0x13, 0x91, 0x42, 0x38, 0xbf, 0x0a, 0x46, 0x82, 0x42, + 0x98, 0xbf, 0x50, 0x1e, 0x88, 0xf8, 0x12, 0x00, 0xbd, 0xe8, 0xf0, 0x81, + 0x8c, 0x7e, 0x08, 0x00, 0x03, 0x78, 0x02, 0x46, 0x00, 0x20, 0x3b, 0xb1, + 0x53, 0x78, 0x52, 0x79, 0x01, 0x3b, 0x13, 0xfb, 0x01, 0x21, 0x0a, 0x29, + 0xb8, 0xbf, 0x01, 0x20, 0x70, 0x47, 0x00, 0xbf, 0x2d, 0xe9, 0xf0, 0x4f, + 0x85, 0xb0, 0x81, 0x46, 0x63, 0x48, 0x00, 0x68, 0x98, 0xb1, 0x99, 0xf8, + 0x04, 0x10, 0xc1, 0xeb, 0x01, 0x11, 0x00, 0xeb, 0x41, 0x15, 0x60, 0x49, + 0x05, 0xf1, 0xd4, 0x00, 0x09, 0x68, 0x88, 0x47, 0xd5, 0xf8, 0xa0, 0x00, + 0x40, 0x7f, 0x40, 0xb1, 0x28, 0x46, 0x49, 0x46, 0x00, 0xf0, 0x82, 0xfe, + 0x07, 0xe0, 0x48, 0x46, 0xee, 0xf7, 0x5c, 0xf8, 0x1d, 0xe0, 0x28, 0x46, + 0x49, 0x46, 0x00, 0xf0, 0x7f, 0xfe, 0x56, 0x48, 0x01, 0x68, 0x28, 0x46, + 0x88, 0x47, 0xab, 0x46, 0x1b, 0xf8, 0xc1, 0x0f, 0xa8, 0xb1, 0x55, 0x49, + 0x68, 0x78, 0x49, 0x68, 0xc0, 0xeb, 0xc0, 0x00, 0x01, 0xeb, 0x80, 0x00, + 0x10, 0xf8, 0x0c, 0x1f, 0x01, 0x29, 0x06, 0xd1, 0x00, 0x21, 0x01, 0x70, + 0x53, 0x48, 0x07, 0x21, 0x00, 0x78, 0xe0, 0xf7, 0xf1, 0xf9, 0x00, 0x20, + 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x28, 0x46, 0x50, 0xf8, 0xa4, 0x6f, + 0x00, 0x2e, 0xe4, 0xd0, 0x01, 0x90, 0xe8, 0x1c, 0x05, 0xf1, 0xc0, 0x0a, + 0x4f, 0xf0, 0x00, 0x08, 0x04, 0x90, 0x68, 0x1c, 0x03, 0x90, 0x00, 0x20, + 0x02, 0x90, 0x40, 0x49, 0x96, 0xf8, 0x44, 0x00, 0x0f, 0x68, 0x29, 0x78, + 0x02, 0x29, 0x06, 0xd3, 0x3d, 0x4b, 0x49, 0x46, 0x07, 0x22, 0xb8, 0x47, + 0x96, 0xf8, 0x20, 0x71, 0x21, 0xe0, 0x3a, 0x4b, 0x49, 0x46, 0x06, 0x22, + 0xb8, 0x47, 0x03, 0x99, 0x38, 0x48, 0x09, 0x78, 0x40, 0x68, 0xc1, 0xeb, + 0xc1, 0x01, 0x00, 0xeb, 0x81, 0x00, 0xd0, 0xe9, 0x04, 0x10, 0x81, 0x42, + 0x38, 0xbf, 0x01, 0x46, 0x96, 0xf8, 0x50, 0x01, 0x96, 0xf8, 0xcc, 0x71, + 0x87, 0x42, 0x38, 0xbf, 0x07, 0x46, 0x1f, 0x29, 0x03, 0xd3, 0x30, 0x46, + 0x00, 0xf0, 0x66, 0xf8, 0x03, 0xe0, 0x2d, 0x48, 0x01, 0x68, 0x30, 0x46, + 0x88, 0x47, 0x04, 0x98, 0x2b, 0x49, 0x5f, 0xfa, 0x88, 0xf2, 0x03, 0x78, + 0x9a, 0xf8, 0x00, 0x00, 0x0c, 0x68, 0x39, 0x46, 0x00, 0x96, 0xa0, 0x47, + 0xd6, 0xf8, 0xa0, 0x11, 0x81, 0x42, 0x0f, 0xd0, 0x96, 0xf8, 0x44, 0x10, + 0x24, 0x4a, 0x01, 0xeb, 0xc1, 0x01, 0x02, 0xeb, 0x41, 0x01, 0x91, 0xf9, + 0x08, 0x10, 0xb1, 0xf1, 0xff, 0x3f, 0x03, 0xdc, 0xc6, 0xf8, 0xa0, 0x01, + 0x01, 0x20, 0x02, 0x90, 0x9b, 0xf8, 0x00, 0x00, 0x18, 0xb9, 0x30, 0x46, + 0x00, 0x21, 0x00, 0xf0, 0xeb, 0xf8, 0x56, 0xf8, 0x04, 0x6c, 0x08, 0xf1, + 0x01, 0x08, 0x00, 0x2e, 0xa3, 0xd1, 0x02, 0x98, 0x00, 0x28, 0x01, 0x98, + 0x3f, 0xf4, 0x79, 0xaf, 0x04, 0x68, 0x00, 0x2c, 0x3f, 0xf4, 0x75, 0xaf, + 0xdf, 0xf8, 0x4c, 0x80, 0x00, 0x26, 0xd4, 0xf8, 0xa0, 0x31, 0xd9, 0xf8, + 0x00, 0x10, 0x94, 0xf8, 0x44, 0x00, 0xf2, 0xb2, 0xd8, 0xf8, 0x00, 0x70, + 0x00, 0x92, 0x01, 0x22, 0xb8, 0x47, 0x54, 0xf8, 0x04, 0x4c, 0x01, 0x36, + 0x00, 0x2c, 0xee, 0xd1, 0x5f, 0xe7, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, + 0x50, 0xd2, 0x08, 0x00, 0x98, 0xb6, 0x08, 0x00, 0x6c, 0xd2, 0x08, 0x00, + 0xfc, 0x70, 0x01, 0x00, 0xec, 0xe5, 0x05, 0x00, 0x1c, 0xd2, 0x08, 0x00, + 0x70, 0xd2, 0x08, 0x00, 0x44, 0x28, 0x01, 0x00, 0x74, 0xd2, 0x08, 0x00, + 0xa5, 0x58, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, 0x90, 0xf8, 0xb0, 0x81, + 0x04, 0x46, 0xe0, 0xf7, 0x39, 0xf9, 0x05, 0x46, 0xd4, 0xf8, 0xa4, 0x01, + 0x01, 0x30, 0x02, 0x28, 0x01, 0xd2, 0xbd, 0xe8, 0xf8, 0x8f, 0x94, 0xf8, + 0x38, 0x02, 0xd4, 0xf8, 0x40, 0x12, 0xb4, 0xf8, 0x74, 0x91, 0x08, 0x44, + 0xa9, 0xeb, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x28, 0xf1, 0xd4, 0xd4, 0xf8, + 0x90, 0x00, 0xd4, 0xf8, 0xa8, 0x11, 0x88, 0x42, 0x2e, 0xbf, 0x46, 0x1a, + 0xc9, 0x43, 0x46, 0x18, 0xd4, 0xf8, 0x50, 0x22, 0x94, 0xf8, 0x7f, 0x10, + 0x8a, 0x42, 0x92, 0xbf, 0x8a, 0x1a, 0xd2, 0x43, 0x0a, 0x44, 0xc4, 0xf8, + 0x50, 0x12, 0xc4, 0xf8, 0xa8, 0x01, 0xd4, 0xf8, 0xac, 0x01, 0x3c, 0x49, + 0x5f, 0xfa, 0x82, 0xfa, 0xa6, 0xeb, 0x0a, 0x0b, 0xe2, 0xf7, 0xc4, 0xfa, + 0x56, 0x45, 0x07, 0x46, 0x38, 0xbf, 0x4f, 0xf0, 0x00, 0x0b, 0x58, 0x46, + 0xe2, 0xf7, 0xc8, 0xfa, 0x01, 0x46, 0x38, 0x46, 0xe2, 0xf7, 0xbe, 0xfa, + 0x4f, 0xf0, 0x78, 0x51, 0xe2, 0xf7, 0xb4, 0xfa, 0x31, 0x49, 0xc4, 0xf8, + 0xac, 0x01, 0xe2, 0xf7, 0xaf, 0xfa, 0x07, 0x46, 0x94, 0xf8, 0xb2, 0x01, + 0xe2, 0xf7, 0xb6, 0xfa, 0x01, 0x46, 0x38, 0x46, 0xe2, 0xf7, 0xb8, 0xfa, + 0xe9, 0xf7, 0x52, 0xfd, 0xd4, 0xf8, 0x4c, 0x12, 0x4f, 0xf0, 0x00, 0x0c, + 0x00, 0x22, 0x81, 0x42, 0x82, 0xbf, 0xc1, 0xeb, 0xc1, 0x01, 0x08, 0x44, + 0xc0, 0x08, 0x94, 0xf8, 0x47, 0x31, 0x02, 0x2b, 0x18, 0xd3, 0xb4, 0xf8, + 0x3a, 0x22, 0xa2, 0xb1, 0x94, 0xf8, 0x20, 0xe1, 0x94, 0xf8, 0x4c, 0x71, + 0x59, 0x1e, 0x02, 0x26, 0x11, 0xfb, 0x0e, 0x71, 0x91, 0xfb, 0xf6, 0xf1, + 0x91, 0x42, 0x08, 0xdd, 0x1e, 0xfb, 0x03, 0xf3, 0x89, 0x1a, 0x64, 0x22, + 0xdb, 0x1b, 0x51, 0x43, 0xb1, 0xfb, 0xf3, 0xf2, 0x00, 0xe0, 0x00, 0x22, + 0x94, 0xf8, 0x20, 0x31, 0x64, 0x27, 0x11, 0x18, 0xc4, 0xf8, 0xa4, 0x51, + 0x94, 0xf8, 0xb1, 0x51, 0xc4, 0xf8, 0x40, 0x92, 0xa4, 0xf8, 0x3a, 0xc2, + 0xc4, 0xf8, 0x4c, 0x12, 0x9e, 0x00, 0xb7, 0xfb, 0xf3, 0xf3, 0xb7, 0xfb, + 0xf6, 0xf6, 0x31, 0x44, 0xb1, 0xfb, 0xf3, 0xf1, 0xa9, 0x42, 0x38, 0xbf, + 0x0d, 0x46, 0xe9, 0xb2, 0x84, 0xf8, 0xb0, 0x51, 0x88, 0x45, 0x3f, 0xf4, + 0x6c, 0xaf, 0x4b, 0xea, 0x0a, 0x61, 0x41, 0xea, 0x00, 0x20, 0x40, 0xea, + 0x02, 0x41, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x4f, 0x0f, 0xf0, 0xd6, 0xbf, + 0x00, 0x00, 0xe0, 0x40, 0x00, 0x00, 0xc8, 0x42, 0xf8, 0xb5, 0x00, 0x22, + 0xad, 0xf8, 0x00, 0x20, 0xd0, 0xf8, 0x24, 0x22, 0x1a, 0xb9, 0xd0, 0xf8, + 0x20, 0x22, 0x00, 0x2a, 0x4c, 0xd0, 0x90, 0xf8, 0x2b, 0x42, 0x90, 0xf8, + 0x2a, 0x62, 0xb0, 0xf8, 0x28, 0x72, 0xb0, 0xf8, 0x74, 0x21, 0x90, 0xf8, + 0x20, 0xc1, 0x90, 0xf8, 0x2d, 0x52, 0x63, 0x18, 0xd7, 0x1b, 0x80, 0xf8, + 0x2c, 0x42, 0x9b, 0x1b, 0x0c, 0xfb, 0x07, 0x33, 0xdb, 0xb2, 0xb3, 0xfb, + 0xf5, 0xf6, 0x06, 0xfb, 0x15, 0x33, 0x9c, 0x42, 0x2e, 0xd0, 0x01, 0x22, + 0xdb, 0xb2, 0x52, 0xfa, 0x84, 0xf4, 0xed, 0xb2, 0xb4, 0xfb, 0xf5, 0xf6, + 0x06, 0xfb, 0x15, 0x45, 0xd0, 0xf8, 0x20, 0x42, 0x80, 0xf8, 0x2b, 0x52, + 0x4c, 0xb1, 0x9d, 0xf8, 0x00, 0x60, 0xad, 0xb2, 0x9d, 0xf8, 0x01, 0x70, + 0x04, 0xf8, 0x15, 0x60, 0x04, 0xeb, 0x45, 0x04, 0x67, 0x70, 0xd0, 0xf8, + 0x24, 0x42, 0x54, 0xb1, 0x90, 0xf8, 0x2b, 0x52, 0x9d, 0xf8, 0x00, 0x60, + 0x9d, 0xf8, 0x01, 0x70, 0x04, 0xf8, 0x15, 0x60, 0x04, 0xeb, 0x45, 0x04, + 0x67, 0x70, 0x90, 0xf8, 0x2b, 0x42, 0x9c, 0x42, 0x02, 0xd0, 0x90, 0xf8, + 0x2d, 0x52, 0xd4, 0xe7, 0xb0, 0xf8, 0x74, 0x21, 0x80, 0xf8, 0x2a, 0x12, + 0xa0, 0xf8, 0x28, 0x22, 0xf8, 0xbd, 0xb0, 0xb5, 0x60, 0xb1, 0x04, 0x46, + 0xd0, 0xf8, 0x3c, 0x01, 0x40, 0xb1, 0x45, 0x6a, 0x20, 0x46, 0x00, 0xf0, + 0xb3, 0xfc, 0x1d, 0xb1, 0xd4, 0xf8, 0x3c, 0x01, 0x40, 0x6a, 0x00, 0xb1, + 0xb0, 0xbd, 0x20, 0x46, 0x02, 0x21, 0xbd, 0xe8, 0xb0, 0x40, 0xe1, 0xf7, + 0x29, 0xbc, 0x00, 0xbf, 0xf8, 0xb5, 0x04, 0x46, 0x3e, 0x48, 0x06, 0x68, + 0xd6, 0xb1, 0x25, 0x79, 0x20, 0x46, 0x00, 0xf0, 0xa3, 0xfc, 0xc5, 0xeb, + 0x05, 0x17, 0x21, 0x46, 0x06, 0xeb, 0x47, 0x15, 0x28, 0x46, 0xff, 0xf7, + 0x9f, 0xfd, 0x78, 0x01, 0x30, 0x5c, 0x02, 0x28, 0x0a, 0xd1, 0xd5, 0xf8, + 0x3c, 0x01, 0x38, 0xb1, 0x04, 0x48, 0xa1, 0x7c, 0x90, 0xf8, 0x98, 0x03, + 0x81, 0x42, 0x38, 0xbf, 0x01, 0x46, 0xa1, 0x74, 0xf8, 0xbd, 0x00, 0xbf, + 0x8c, 0x7e, 0x08, 0x00, 0x2d, 0xe9, 0xff, 0x41, 0xdf, 0xf8, 0xb0, 0x80, + 0xd8, 0xf8, 0x00, 0x70, 0x00, 0x2f, 0x48, 0xd0, 0x06, 0x79, 0x05, 0x46, + 0x00, 0xf0, 0x82, 0xfc, 0x04, 0x46, 0x01, 0x28, 0x1b, 0xd1, 0x27, 0x48, + 0x01, 0x21, 0x01, 0x70, 0x28, 0x7d, 0x8d, 0xf8, 0x0c, 0x00, 0xc6, 0xeb, + 0x06, 0x10, 0x07, 0xeb, 0x40, 0x10, 0x81, 0x78, 0x90, 0xf8, 0xc1, 0x20, + 0xd0, 0xf8, 0xb0, 0x00, 0xb0, 0xf8, 0x74, 0x01, 0x42, 0xea, 0x41, 0x11, + 0x8d, 0xf8, 0x0d, 0x10, 0x03, 0xa9, 0xad, 0xf8, 0x0e, 0x00, 0x1c, 0x48, + 0x02, 0x68, 0x1f, 0x20, 0x90, 0x47, 0x1b, 0x48, 0xc1, 0x7c, 0x41, 0xb3, + 0xc6, 0xeb, 0x06, 0x11, 0x80, 0x7c, 0x07, 0xeb, 0x41, 0x11, 0x89, 0x78, + 0x88, 0x42, 0x20, 0xd1, 0xd8, 0xf8, 0x00, 0x10, 0xc0, 0xeb, 0x00, 0x10, + 0x14, 0x4a, 0x01, 0xeb, 0x40, 0x11, 0x13, 0x68, 0x01, 0xaa, 0x01, 0xf1, + 0xb8, 0x00, 0xc9, 0x68, 0x09, 0x01, 0x98, 0x47, 0x01, 0x99, 0x40, 0xf2, + 0x71, 0x20, 0x48, 0x43, 0xbd, 0xf8, 0x08, 0x10, 0x40, 0x08, 0x00, 0xeb, + 0x11, 0x10, 0x81, 0x21, 0xe5, 0xf7, 0x98, 0xfc, 0x05, 0xe0, 0x00, 0x20, + 0x4f, 0xf4, 0xb2, 0x71, 0x00, 0x24, 0xe5, 0xf7, 0xfb, 0xfd, 0x20, 0x46, + 0x04, 0xb0, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, + 0x60, 0xd4, 0x05, 0x00, 0x1c, 0xa1, 0x08, 0x00, 0x34, 0xdc, 0x05, 0x00, + 0x5c, 0xa1, 0x08, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, 0x81, 0x46, 0x48, 0x48, + 0xd9, 0xf8, 0x04, 0xb0, 0x04, 0x68, 0x48, 0x46, 0x9b, 0xf8, 0x1d, 0x51, + 0xed, 0xf7, 0xe2, 0xfd, 0xc5, 0xeb, 0x05, 0x10, 0x04, 0xeb, 0x40, 0x1a, + 0x40, 0x01, 0x20, 0x5c, 0xd0, 0x46, 0x02, 0x28, 0x13, 0xd3, 0x56, 0x46, + 0x56, 0xf8, 0xa4, 0x7f, 0x00, 0x2f, 0x4c, 0xd0, 0x3d, 0x4d, 0x00, 0x24, + 0x2a, 0x68, 0x30, 0x46, 0x39, 0x46, 0x87, 0xf8, 0x7c, 0x41, 0x90, 0x47, + 0x38, 0x46, 0x00, 0xf0, 0x7d, 0xf8, 0x37, 0x68, 0x00, 0x2f, 0xf3, 0xd1, + 0x3d, 0xe0, 0x9b, 0xf8, 0x7c, 0x01, 0x01, 0x28, 0x0c, 0xd1, 0x50, 0x46, + 0x50, 0xf8, 0xf4, 0x1f, 0x41, 0xb1, 0x59, 0x45, 0x02, 0xd0, 0x51, 0xf8, + 0x04, 0x1c, 0xf9, 0xe7, 0x2f, 0x49, 0x0a, 0x68, 0x59, 0x46, 0x90, 0x47, + 0x57, 0x46, 0x57, 0xf8, 0xb0, 0x0f, 0x58, 0x45, 0x02, 0xd1, 0x5b, 0xf8, + 0x04, 0x0c, 0x38, 0x60, 0x00, 0x20, 0x0a, 0xf1, 0xa4, 0x06, 0x59, 0x46, + 0x8b, 0xf8, 0x7c, 0x01, 0x26, 0x48, 0x02, 0x68, 0x30, 0x46, 0x90, 0x47, + 0x38, 0x68, 0x08, 0xb9, 0x30, 0x68, 0x38, 0x60, 0x23, 0x48, 0x01, 0x68, + 0x40, 0x46, 0x88, 0x47, 0xda, 0xf8, 0x9c, 0x00, 0x21, 0x49, 0x02, 0x8a, + 0x00, 0x20, 0xfd, 0xf7, 0xb1, 0xfe, 0x20, 0x48, 0x9b, 0xf8, 0x1f, 0x21, + 0x59, 0x46, 0x03, 0x68, 0xad, 0x20, 0x98, 0x47, 0x58, 0x46, 0x00, 0xf0, + 0x3d, 0xf8, 0xda, 0xf8, 0xa4, 0x70, 0xdf, 0xb9, 0x98, 0xf8, 0x00, 0x00, + 0x01, 0x28, 0x02, 0xd8, 0xda, 0xf8, 0xf4, 0x00, 0xa0, 0xb9, 0x5a, 0xf8, + 0x9c, 0x6f, 0x56, 0xb1, 0x15, 0x48, 0x01, 0x68, 0x30, 0x46, 0x88, 0x47, + 0x31, 0x7d, 0x00, 0x20, 0x30, 0x61, 0x30, 0x75, 0xca, 0xf8, 0x00, 0x00, + 0xb1, 0x75, 0x0f, 0x48, 0x9b, 0xf8, 0x1f, 0x21, 0x41, 0x46, 0x03, 0x68, + 0xae, 0x20, 0x98, 0x47, 0x99, 0xf8, 0x14, 0x00, 0x69, 0x46, 0x8d, 0xf8, + 0x00, 0x00, 0x9b, 0xf8, 0x44, 0x00, 0x8d, 0xf8, 0x01, 0x00, 0x09, 0x48, + 0x02, 0x68, 0x19, 0x20, 0x90, 0x47, 0x00, 0x20, 0xbd, 0xe8, 0xf8, 0x8f, + 0xe0, 0x35, 0x01, 0x00, 0xe8, 0xa0, 0x08, 0x00, 0x98, 0xb6, 0x08, 0x00, + 0x80, 0x19, 0x04, 0x00, 0xa8, 0xa0, 0x08, 0x00, 0xc8, 0xa0, 0x08, 0x00, + 0xa4, 0xa0, 0x08, 0x00, 0xb0, 0xb5, 0xd0, 0xf8, 0x80, 0x20, 0x15, 0x49, + 0x15, 0x4d, 0x04, 0x46, 0x00, 0x20, 0xa8, 0x47, 0xd4, 0xf8, 0x84, 0x20, + 0x13, 0x49, 0x00, 0x20, 0xa8, 0x47, 0xd4, 0xf8, 0x90, 0x20, 0x12, 0x49, + 0x00, 0x20, 0xa8, 0x47, 0xd4, 0xf8, 0x94, 0x20, 0x10, 0x49, 0x00, 0x20, + 0xa8, 0x47, 0xd4, 0xf8, 0x98, 0x20, 0x0f, 0x49, 0x00, 0x20, 0xa8, 0x47, + 0xd4, 0xf8, 0x9c, 0x20, 0x0d, 0x49, 0x00, 0x20, 0xa8, 0x47, 0xd4, 0xf8, + 0xa0, 0x20, 0x0c, 0x49, 0x00, 0x20, 0xa8, 0x47, 0xe2, 0x6c, 0x0b, 0x49, + 0x00, 0x20, 0x2b, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x18, 0x47, 0x00, 0xbf, + 0x91, 0x19, 0x04, 0x00, 0xd1, 0xba, 0x02, 0x10, 0x9f, 0x19, 0x04, 0x00, + 0xad, 0x19, 0x04, 0x00, 0xbb, 0x19, 0x04, 0x00, 0xc9, 0x19, 0x04, 0x00, + 0xd7, 0x19, 0x04, 0x00, 0xe5, 0x19, 0x04, 0x00, 0xf3, 0x19, 0x04, 0x00, + 0xb0, 0xb5, 0x04, 0x46, 0x90, 0xf8, 0x4d, 0x01, 0x94, 0xf8, 0xcc, 0x51, + 0x01, 0x30, 0x84, 0xf8, 0x4d, 0x01, 0xc0, 0xb2, 0xa8, 0x42, 0x27, 0xd3, + 0x00, 0x20, 0x84, 0xf8, 0x4d, 0x01, 0xb4, 0xf8, 0x4e, 0x01, 0x01, 0x30, + 0xa4, 0xf8, 0x4e, 0x01, 0xd4, 0xf8, 0x3c, 0x01, 0xfc, 0xf7, 0x5a, 0xf8, + 0xd0, 0xb1, 0x94, 0xf8, 0x46, 0x01, 0xd4, 0xf8, 0x68, 0x11, 0x52, 0x4a, + 0x40, 0x1b, 0x09, 0x18, 0xc4, 0xf8, 0x68, 0x11, 0xd4, 0xf8, 0x6c, 0x11, + 0x41, 0xeb, 0xe0, 0x70, 0xd4, 0xf8, 0x00, 0x11, 0x00, 0xf0, 0x7f, 0x00, + 0xc4, 0xf8, 0x6c, 0x01, 0xd1, 0xf8, 0xd4, 0x10, 0x49, 0x7f, 0x12, 0xf8, + 0x11, 0x10, 0x08, 0x43, 0xc4, 0xf8, 0x6c, 0x01, 0xd4, 0xe9, 0x5a, 0x12, + 0xd4, 0xf8, 0x00, 0x01, 0x01, 0x31, 0x42, 0xf1, 0x00, 0x02, 0x02, 0xf0, + 0x7f, 0x02, 0xc4, 0xe9, 0x5a, 0x12, 0x94, 0xf8, 0x7d, 0x11, 0xd0, 0xf8, + 0xd4, 0x00, 0x81, 0xf0, 0x01, 0x01, 0x40, 0x7f, 0x84, 0xf8, 0x7d, 0x11, + 0x3c, 0x49, 0x11, 0xf8, 0x10, 0x00, 0x10, 0x43, 0xc4, 0xf8, 0x6c, 0x01, + 0xb0, 0xbd, 0x00, 0xbf, 0xb0, 0xb5, 0x04, 0x46, 0x90, 0xf8, 0x57, 0x01, + 0x94, 0xf8, 0xcd, 0x51, 0x01, 0x30, 0x84, 0xf8, 0x57, 0x01, 0xc0, 0xb2, + 0xa8, 0x42, 0x42, 0xd3, 0x00, 0x20, 0x84, 0xf8, 0x57, 0x01, 0xb4, 0xf8, + 0x58, 0x01, 0x01, 0x30, 0xa4, 0xf8, 0x58, 0x01, 0xd4, 0xf8, 0x3c, 0x01, + 0xfc, 0xf7, 0x0a, 0xf8, 0xa8, 0xb3, 0x94, 0xf8, 0x50, 0x11, 0xd4, 0xf8, + 0x60, 0x21, 0x49, 0x1b, 0x29, 0x4d, 0x52, 0x18, 0xc4, 0xf8, 0x60, 0x21, + 0xd4, 0xf8, 0x64, 0x21, 0x42, 0xeb, 0xe1, 0x71, 0xd4, 0xf8, 0x00, 0x21, + 0x01, 0xf0, 0x7f, 0x01, 0xc4, 0xf8, 0x64, 0x11, 0xd2, 0xf8, 0xd4, 0x30, + 0x5b, 0x7f, 0x05, 0xeb, 0x43, 0x03, 0x5b, 0x78, 0x19, 0x43, 0xc4, 0xf8, + 0x64, 0x11, 0xd2, 0xf8, 0xd4, 0x10, 0x1c, 0x22, 0x49, 0x7f, 0x00, 0x29, + 0x4f, 0xf0, 0x05, 0x01, 0x08, 0xbf, 0x1d, 0x22, 0x80, 0x5c, 0x84, 0xf8, + 0x54, 0x11, 0x94, 0xf8, 0x20, 0x11, 0x84, 0xf8, 0xcd, 0x01, 0xb1, 0xfb, + 0xf0, 0xf2, 0x02, 0xfb, 0x10, 0x10, 0x84, 0xf8, 0x56, 0x21, 0x10, 0x44, + 0x01, 0x38, 0x84, 0xf8, 0x55, 0x01, 0xd4, 0xe9, 0x58, 0x12, 0xd4, 0xf8, + 0x00, 0x01, 0x01, 0x31, 0x42, 0xf1, 0x00, 0x02, 0x02, 0xf0, 0x7f, 0x02, + 0xc4, 0xe9, 0x58, 0x12, 0x94, 0xf8, 0x7e, 0x11, 0xd0, 0xf8, 0xd4, 0x00, + 0x81, 0xf0, 0x01, 0x01, 0x40, 0x7f, 0x84, 0xf8, 0x7e, 0x11, 0xb4, 0xf8, + 0x78, 0x11, 0x41, 0xf0, 0x08, 0x01, 0xa4, 0xf8, 0x78, 0x11, 0x04, 0x49, + 0x01, 0xeb, 0x40, 0x00, 0x40, 0x78, 0x10, 0x43, 0xc4, 0xf8, 0x64, 0x01, + 0xb0, 0xbd, 0x00, 0xbf, 0xf4, 0x31, 0x0a, 0x10, 0x70, 0xb5, 0xd0, 0xf8, + 0xa4, 0x60, 0x0c, 0x46, 0x05, 0x46, 0x5e, 0xb1, 0x30, 0x46, 0xff, 0xf7, + 0x39, 0xfb, 0xb6, 0xf8, 0x78, 0x01, 0x20, 0xf0, 0x80, 0x00, 0xa6, 0xf8, + 0x78, 0x01, 0x56, 0xf8, 0x04, 0x6c, 0xf2, 0xe7, 0x28, 0x46, 0x21, 0x46, + 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, 0x70, 0xba, 0x70, 0xb5, 0xd0, 0xf8, + 0xa4, 0x60, 0x0c, 0x46, 0x05, 0x46, 0x2e, 0xb1, 0x30, 0x46, 0xff, 0xf7, + 0x21, 0xfb, 0x56, 0xf8, 0x04, 0x6c, 0xf8, 0xe7, 0x28, 0x46, 0x21, 0x46, + 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, 0x64, 0xba, 0x2d, 0xe9, 0xf0, 0x4f, + 0x85, 0xb0, 0x83, 0x46, 0x00, 0x20, 0xcd, 0xe9, 0x03, 0x00, 0xdb, 0xf8, + 0x9c, 0x00, 0x00, 0x28, 0x00, 0xf0, 0xef, 0x80, 0x7b, 0x48, 0x91, 0x46, + 0x0c, 0x46, 0xd1, 0xf8, 0x00, 0x71, 0x9a, 0x46, 0x02, 0x68, 0x08, 0x46, + 0x00, 0x21, 0x90, 0x47, 0xd4, 0xe9, 0x49, 0x01, 0xdf, 0xf8, 0xd8, 0x81, + 0x94, 0xf8, 0x20, 0x31, 0x75, 0x4a, 0xcd, 0xe9, 0x00, 0x10, 0x40, 0x46, + 0x78, 0x21, 0xcd, 0xf8, 0x08, 0x90, 0xe2, 0xf7, 0xcf, 0xff, 0xdb, 0x4d, + 0x95, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, 0x6f, 0x48, 0x01, 0x21, + 0x42, 0x46, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x94, 0xf8, 0x46, 0x01, + 0xb4, 0xf8, 0x48, 0x21, 0x94, 0xf8, 0x47, 0x31, 0x94, 0xf8, 0x4a, 0x11, + 0x8d, 0xe8, 0x07, 0x00, 0x68, 0x4a, 0x40, 0x46, 0x78, 0x21, 0xe2, 0xf7, + 0xb5, 0xff, 0x95, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, 0x63, 0x48, + 0x01, 0x21, 0x42, 0x46, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x94, 0xf8, + 0x50, 0x01, 0xb4, 0xf8, 0x52, 0x21, 0x94, 0xf8, 0x51, 0x31, 0x94, 0xf8, + 0x54, 0x11, 0x8d, 0xe8, 0x07, 0x00, 0x5d, 0x4a, 0x40, 0x46, 0x78, 0x21, + 0xe2, 0xf7, 0x9c, 0xff, 0x95, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, + 0x56, 0x48, 0x01, 0x21, 0x42, 0x46, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, + 0x9b, 0xf8, 0x03, 0x00, 0x01, 0x28, 0x08, 0xd1, 0xd4, 0xf8, 0x24, 0x01, + 0x48, 0x45, 0x04, 0xd8, 0x00, 0x20, 0x40, 0xf2, 0xdb, 0x21, 0xdf, 0xf7, + 0x4b, 0xfd, 0xd4, 0xf8, 0x00, 0x01, 0xc4, 0xf8, 0x70, 0x91, 0xd0, 0xf8, + 0xd8, 0x00, 0xc4, 0xf8, 0xf4, 0x00, 0x4c, 0x48, 0x01, 0x68, 0xdb, 0xf8, + 0xa0, 0x00, 0x14, 0x30, 0x88, 0x47, 0xb7, 0xf8, 0xdc, 0x32, 0x49, 0x4e, + 0x72, 0xb6, 0x00, 0xeb, 0x83, 0x00, 0x31, 0x68, 0x04, 0x30, 0x20, 0xf0, + 0x03, 0x00, 0x49, 0x00, 0x01, 0x31, 0x31, 0x60, 0x31, 0x68, 0x49, 0x08, + 0x31, 0x60, 0xba, 0x6e, 0xb7, 0xf8, 0x14, 0xe3, 0x36, 0x68, 0x86, 0xf3, + 0x10, 0x88, 0x80, 0x1a, 0x00, 0x01, 0x07, 0xd4, 0xb7, 0xf8, 0xdc, 0x02, + 0x0e, 0xf1, 0x01, 0x0e, 0x02, 0xeb, 0x80, 0x00, 0x20, 0xf0, 0x70, 0x42, + 0xdb, 0xf8, 0xb4, 0x00, 0xdd, 0xf8, 0x38, 0xc0, 0xbb, 0xf8, 0x08, 0x80, + 0x13, 0x1a, 0x1b, 0x01, 0x07, 0xd4, 0x4f, 0xea, 0x88, 0x03, 0x19, 0x18, + 0x21, 0xf0, 0x70, 0x40, 0x51, 0x1a, 0x09, 0x01, 0xf9, 0xd5, 0x32, 0x49, + 0x40, 0xf2, 0xe2, 0x43, 0x4f, 0xf4, 0x7a, 0x75, 0x08, 0xfb, 0x03, 0xf6, + 0xb1, 0xf9, 0xbc, 0x11, 0xaa, 0xf8, 0x00, 0xe0, 0x11, 0xfb, 0x05, 0x61, + 0x01, 0x39, 0x91, 0xfb, 0xf6, 0xf1, 0x08, 0xfb, 0x01, 0xf1, 0x00, 0xeb, + 0x81, 0x00, 0x40, 0xf2, 0x71, 0x21, 0x20, 0xf0, 0x70, 0x46, 0xb0, 0x1a, + 0x48, 0x43, 0xd4, 0xf8, 0x70, 0x11, 0x01, 0xeb, 0x50, 0x00, 0xb7, 0xf8, + 0xdc, 0x12, 0xcc, 0xf8, 0x00, 0x00, 0x59, 0x43, 0x88, 0x42, 0x0e, 0xd9, + 0x20, 0x4a, 0x0e, 0xf1, 0x01, 0x01, 0xaa, 0xf8, 0x00, 0x10, 0x01, 0x31, + 0xb7, 0xf8, 0xdc, 0x52, 0x05, 0xfb, 0x02, 0x00, 0x5d, 0x43, 0xa8, 0x42, + 0xf5, 0xd8, 0xcc, 0xf8, 0x00, 0x00, 0x1a, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x19, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x4a, 0x48, + 0x03, 0x96, 0x03, 0x68, 0x49, 0x48, 0x00, 0x69, 0x00, 0xf1, 0x14, 0x01, + 0x03, 0xa8, 0x02, 0x46, 0x98, 0x47, 0x13, 0x48, 0x03, 0x99, 0x02, 0x68, + 0x20, 0x46, 0x90, 0x47, 0x04, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0xcd, 0x21, + 0xe5, 0xf7, 0x1c, 0xfb, 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0xbf, + 0x88, 0xb6, 0x08, 0x00, 0xff, 0x6a, 0x01, 0x00, 0x01, 0x1a, 0x04, 0x00, + 0x70, 0x9b, 0x08, 0x00, 0x2a, 0x1a, 0x04, 0x00, 0x4b, 0x1a, 0x04, 0x00, + 0xec, 0xb9, 0x08, 0x00, 0x24, 0x36, 0x01, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0x1e, 0xfb, 0xff, 0xff, 0x8c, 0xb6, 0x08, 0x00, 0x6c, 0xb6, 0x08, 0x00, + 0x90, 0xb6, 0x08, 0x00, 0x00, 0xf0, 0x4a, 0xb9, 0x70, 0xb5, 0x86, 0xb0, + 0xd0, 0xf8, 0xb0, 0x20, 0x04, 0x46, 0x10, 0x46, 0x1a, 0xb9, 0xd4, 0xf8, + 0xa4, 0x00, 0x00, 0x28, 0x4e, 0xd0, 0xd4, 0xf8, 0x9c, 0x10, 0xc2, 0xb3, + 0xd4, 0xf8, 0xa0, 0x20, 0x52, 0x7f, 0xa2, 0xbb, 0x00, 0x20, 0x26, 0x4e, + 0xad, 0xf8, 0x0c, 0x00, 0x08, 0x68, 0x33, 0x68, 0x02, 0x90, 0x24, 0x48, + 0x00, 0x69, 0x00, 0xf1, 0x14, 0x01, 0x02, 0xa8, 0x02, 0x46, 0x98, 0x47, + 0x21, 0x48, 0x04, 0xad, 0x29, 0x46, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, + 0x1f, 0x48, 0x20, 0x49, 0x2a, 0x46, 0x03, 0x68, 0x28, 0x46, 0x98, 0x47, + 0x04, 0x98, 0x02, 0x99, 0x0a, 0x1a, 0x12, 0x01, 0x07, 0xd4, 0x81, 0x42, + 0x21, 0xd1, 0xbd, 0xf8, 0x0c, 0x00, 0xbd, 0xf8, 0x14, 0x10, 0x81, 0x42, + 0x1b, 0xd9, 0x33, 0x68, 0x04, 0xa8, 0x02, 0xa9, 0x6a, 0x46, 0x98, 0x47, + 0xbd, 0xf8, 0x04, 0x10, 0x00, 0x98, 0x00, 0x29, 0x18, 0xbf, 0x01, 0x30, + 0xd4, 0xf8, 0x9c, 0x10, 0x0a, 0xe0, 0xd0, 0xf8, 0x28, 0x01, 0x4f, 0xf4, + 0x1c, 0x72, 0x02, 0xeb, 0x40, 0x00, 0x40, 0xf2, 0x71, 0x22, 0xb0, 0xfb, + 0xf2, 0xf0, 0x01, 0x30, 0x08, 0x82, 0x06, 0xb0, 0x70, 0xbd, 0xd4, 0xf8, + 0x9c, 0x00, 0x01, 0x21, 0x01, 0x82, 0xf8, 0xe7, 0x20, 0x46, 0x06, 0xb0, + 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, 0xf0, 0xb8, 0x44, 0xa1, 0x08, 0x00, + 0xfc, 0x73, 0x01, 0x00, 0x14, 0xd1, 0x08, 0x00, 0x48, 0xa1, 0x08, 0x00, + 0x84, 0x0e, 0x01, 0x00, 0xb0, 0xb5, 0x04, 0x46, 0x27, 0x48, 0x00, 0xf5, + 0x96, 0x70, 0x10, 0xf8, 0x54, 0x1f, 0xca, 0x07, 0x02, 0xd0, 0x02, 0x79, + 0x02, 0xb1, 0xb0, 0xbd, 0x49, 0x07, 0x02, 0xd5, 0x41, 0x79, 0x00, 0x29, + 0xf9, 0xd1, 0x94, 0xf8, 0x1d, 0x21, 0x20, 0x4d, 0xc2, 0xeb, 0x02, 0x12, + 0x29, 0x68, 0x52, 0x01, 0x89, 0x5c, 0x00, 0x29, 0xef, 0xd1, 0x94, 0xf8, + 0x47, 0x21, 0x94, 0xf8, 0x51, 0x31, 0x00, 0x21, 0x84, 0xf8, 0x2c, 0x12, + 0xc4, 0xf8, 0x28, 0x12, 0x94, 0xf8, 0x20, 0x11, 0x9a, 0x42, 0x38, 0xbf, + 0x1a, 0x46, 0x00, 0x79, 0x01, 0x32, 0x51, 0x43, 0xca, 0xb2, 0x82, 0x42, + 0x38, 0xbf, 0x08, 0x46, 0xd4, 0xf8, 0x20, 0x12, 0x84, 0xf8, 0x2d, 0x02, + 0x79, 0xb9, 0x10, 0x49, 0xc0, 0xb2, 0x40, 0x00, 0x09, 0x68, 0x88, 0x47, + 0x94, 0xf8, 0x1d, 0x11, 0xc4, 0xf8, 0x20, 0x02, 0x28, 0x68, 0xc1, 0xeb, + 0x01, 0x11, 0x49, 0x01, 0x40, 0x5c, 0x01, 0x28, 0xc5, 0xd8, 0xd4, 0xf8, + 0x24, 0x02, 0x00, 0x28, 0xc1, 0xd1, 0x06, 0x48, 0x01, 0x68, 0x94, 0xf8, + 0x2d, 0x02, 0x40, 0x00, 0x88, 0x47, 0xc4, 0xf8, 0x24, 0x02, 0xb0, 0xbd, + 0x8c, 0x7e, 0x08, 0x00, 0xe0, 0x35, 0x01, 0x00, 0x4c, 0x9c, 0x08, 0x00, + 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0x90, 0xf8, 0x20, 0x46, 0xbd, 0xe8, + 0x10, 0x40, 0xff, 0xf7, 0x9f, 0xbf, 0x00, 0xbf, 0x10, 0xb5, 0x12, 0x48, + 0x12, 0x49, 0x13, 0x4a, 0x14, 0x4c, 0x13, 0x4b, 0xc0, 0xe9, 0x42, 0x42, + 0xc0, 0xe9, 0x44, 0x13, 0x12, 0x48, 0x13, 0x49, 0x01, 0x60, 0x13, 0x48, + 0x13, 0x49, 0x01, 0x60, 0x13, 0x48, 0x14, 0x49, 0x01, 0x60, 0x14, 0x48, + 0x14, 0x49, 0x01, 0x60, 0x14, 0x48, 0x15, 0x49, 0x01, 0x60, 0x15, 0x48, + 0x15, 0x49, 0x01, 0x60, 0x15, 0x48, 0x16, 0x49, 0x01, 0x60, 0x16, 0x48, + 0x16, 0x49, 0x01, 0x60, 0x16, 0x48, 0x17, 0x49, 0x01, 0x60, 0x10, 0xbd, + 0x90, 0xcf, 0x08, 0x00, 0xd5, 0x0f, 0x04, 0x00, 0xd1, 0x0b, 0x04, 0x00, + 0xe9, 0x10, 0x04, 0x00, 0x1d, 0x10, 0x04, 0x00, 0xd4, 0xb7, 0x08, 0x00, + 0xad, 0x12, 0x04, 0x00, 0xd8, 0xb7, 0x08, 0x00, 0x4d, 0x13, 0x04, 0x00, + 0xb8, 0xb6, 0x08, 0x00, 0x35, 0x14, 0x04, 0x00, 0xb4, 0xb6, 0x08, 0x00, + 0x65, 0x14, 0x04, 0x00, 0xbc, 0xb6, 0x08, 0x00, 0xa7, 0x0f, 0x04, 0x00, + 0xa4, 0xd2, 0x08, 0x00, 0x89, 0x14, 0x04, 0x00, 0xc0, 0xb8, 0x08, 0x00, + 0xc5, 0x16, 0x04, 0x00, 0x98, 0xb6, 0x08, 0x00, 0xc9, 0x16, 0x04, 0x00, + 0x88, 0xb6, 0x08, 0x00, 0x4d, 0x18, 0x04, 0x00, 0x45, 0xf6, 0x67, 0x7c, + 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf6, 0x37, 0x3c, + 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf6, 0x1d, 0x5c, + 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x46, 0xf2, 0x15, 0x4c, + 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf2, 0x19, 0x5c, + 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf6, 0x67, 0x4c, + 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf6, 0x65, 0x5c, + 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x44, 0xf2, 0xc9, 0x3c, + 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x44, 0xf6, 0xa3, 0x0c, + 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x44, 0xf2, 0x6b, 0x3c, + 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x2d, 0x20, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x20, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x00, 0x49, 0x53, 0x4f, 0x20, 0x20, 0x20, 0x54, 0x78, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x00, 0x49, 0x53, 0x4f, 0x20, 0x20, 0x20, 0x54, 0x78, 0x46, + 0x6c, 0x75, 0x73, 0x68, 0x00, 0x49, 0x53, 0x4f, 0x20, 0x54, 0x78, 0x52, + 0x65, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x00, 0x49, 0x53, 0x4f, 0x20, 0x20, + 0x20, 0x52, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x00, 0x49, 0x53, 0x4f, + 0x20, 0x20, 0x20, 0x52, 0x78, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x00, 0x49, + 0x53, 0x4f, 0x20, 0x20, 0x20, 0x20, 0x52, 0x78, 0x4d, 0x69, 0x73, 0x73, + 0x00, 0x49, 0x53, 0x4f, 0x20, 0x20, 0x20, 0x52, 0x78, 0x41, 0x62, 0x6f, + 0x72, 0x74, 0x00, 0x43, 0x6f, 0x6e, 0x6e, 0x53, 0x6c, 0x6f, 0x74, 0x73, + 0x55, 0x73, 0x65, 0x64, 0x00, 0x43, 0x49, 0x53, 0x2d, 0x4d, 0x3a, 0x20, + 0x4e, 0x53, 0x45, 0x3a, 0x25, 0x64, 0x20, 0x73, 0x75, 0x62, 0x44, 0x75, + 0x72, 0x3a, 0x25, 0x64, 0x20, 0x73, 0x75, 0x62, 0x49, 0x6e, 0x74, 0x3a, + 0x25, 0x64, 0x20, 0x6f, 0x66, 0x66, 0x3a, 0x25, 0x64, 0x00, 0x43, 0x49, + 0x53, 0x2d, 0x54, 0x58, 0x3a, 0x20, 0x46, 0x54, 0x3a, 0x25, 0x64, 0x20, + 0x42, 0x4e, 0x3a, 0x25, 0x64, 0x20, 0x50, 0x48, 0x59, 0x3a, 0x25, 0x64, + 0x20, 0x50, 0x4c, 0x3a, 0x25, 0x64, 0x00, 0x43, 0x49, 0x53, 0x2d, 0x52, + 0x58, 0x3a, 0x20, 0x46, 0x54, 0x3a, 0x25, 0x64, 0x20, 0x42, 0x4e, 0x3a, + 0x25, 0x64, 0x20, 0x50, 0x48, 0x59, 0x3a, 0x25, 0x64, 0x20, 0x50, 0x4c, + 0x3a, 0x25, 0x64, 0x00, 0x10, 0xb5, 0x8c, 0xb0, 0xcd, 0xe9, 0x02, 0x01, + 0x5e, 0x48, 0x02, 0xab, 0x90, 0xf8, 0xfd, 0x02, 0x04, 0x90, 0x9b, 0x48, + 0x01, 0x8a, 0x05, 0x91, 0x41, 0x8a, 0x06, 0x91, 0x01, 0x8b, 0x07, 0x91, + 0xd0, 0xe9, 0x02, 0x12, 0xcd, 0xe9, 0x08, 0x12, 0x81, 0x8a, 0xc0, 0x8a, + 0x00, 0x22, 0x0b, 0x90, 0x05, 0x48, 0x0a, 0x91, 0x01, 0x21, 0x04, 0x68, + 0x28, 0x20, 0x00, 0x90, 0x40, 0xf2, 0x45, 0x60, 0xa0, 0x47, 0x0c, 0xb0, + 0x10, 0xbd, 0x00, 0xbf, 0xa0, 0xa0, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x47, + 0x04, 0x46, 0x84, 0x48, 0xdf, 0xf8, 0xb8, 0x90, 0x87, 0x6a, 0xd9, 0xf8, + 0x20, 0x50, 0x90, 0xf8, 0x3d, 0x80, 0x00, 0xf1, 0x20, 0x06, 0xe9, 0x1b, + 0x09, 0x01, 0x07, 0xd5, 0x00, 0x20, 0x9b, 0x21, 0xe5, 0xf7, 0xf0, 0xf8, + 0xd9, 0xf8, 0x20, 0x70, 0x3d, 0x46, 0xb7, 0x60, 0xd6, 0xf8, 0x04, 0xa0, + 0x20, 0x46, 0x00, 0xf0, 0x1d, 0xfb, 0xd6, 0xe9, 0x00, 0x49, 0x4c, 0x45, + 0x0f, 0xd0, 0x21, 0x48, 0x21, 0x49, 0x00, 0x78, 0x09, 0x78, 0x08, 0x44, + 0x20, 0x49, 0x09, 0x78, 0xc8, 0x42, 0x06, 0xd1, 0x96, 0xf8, 0x45, 0x00, + 0x18, 0xb1, 0x1e, 0x48, 0x90, 0xf8, 0x3e, 0x06, 0x58, 0xb3, 0x1d, 0x48, + 0x80, 0x7c, 0x20, 0xf0, 0x04, 0x00, 0x1b, 0x49, 0x88, 0x74, 0xe0, 0xf7, + 0xef, 0xfd, 0x01, 0x28, 0x07, 0xd1, 0x17, 0x48, 0x90, 0xf8, 0x4f, 0x16, + 0x01, 0x29, 0x04, 0xd0, 0x90, 0xf8, 0x4e, 0x06, 0x08, 0xb1, 0x00, 0x20, + 0x00, 0xe0, 0x01, 0x20, 0x69, 0x49, 0xb8, 0xf1, 0x00, 0x0f, 0x81, 0xf8, + 0x20, 0x00, 0xa5, 0xeb, 0x07, 0x01, 0xc1, 0xf3, 0x5a, 0x01, 0x18, 0xbf, + 0x8a, 0x45, 0x07, 0xd8, 0x71, 0x7f, 0x01, 0x29, 0x04, 0xd1, 0x18, 0xb1, + 0x20, 0x46, 0x49, 0x46, 0xff, 0xf7, 0x80, 0xff, 0x01, 0x20, 0xbd, 0xe8, + 0xf0, 0x87, 0x07, 0x48, 0x80, 0x7c, 0x40, 0xf0, 0x04, 0x00, 0xd2, 0xe7, + 0xfc, 0x70, 0x01, 0x00, 0x5c, 0x34, 0x01, 0x00, 0x53, 0x34, 0x01, 0x00, + 0xd4, 0x58, 0x01, 0x00, 0x64, 0xd4, 0x05, 0x00, 0x78, 0xe6, 0x05, 0x00, + 0xb0, 0xb5, 0x0a, 0x46, 0x01, 0x46, 0x54, 0x48, 0x00, 0x23, 0x14, 0x4d, + 0x43, 0x82, 0x64, 0x23, 0x95, 0xf8, 0xfd, 0x52, 0x10, 0x30, 0x02, 0xfb, + 0x03, 0xf4, 0xb4, 0xfb, 0xf1, 0xf4, 0xac, 0x42, 0x14, 0x46, 0x84, 0xbf, + 0x05, 0xfb, 0x02, 0xf4, 0xb4, 0xfb, 0xf3, 0xf4, 0xa3, 0xb2, 0x04, 0x80, + 0x11, 0x2b, 0x0d, 0xd3, 0x00, 0x24, 0xb4, 0xeb, 0x13, 0x1f, 0x09, 0xd0, + 0x1b, 0x09, 0x4f, 0xf6, 0xf0, 0x74, 0xb2, 0xfb, 0xf3, 0xf3, 0x43, 0x80, + 0x23, 0x42, 0x1c, 0xbf, 0x10, 0x3b, 0x43, 0x80, 0x10, 0x46, 0xbd, 0xe8, + 0xb0, 0x40, 0xff, 0xf7, 0x3f, 0xbf, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, + 0x70, 0xb5, 0x36, 0x4d, 0xd5, 0xe9, 0x08, 0x01, 0x81, 0x42, 0x02, 0xd1, + 0x00, 0xf0, 0x9a, 0xfa, 0x57, 0xe0, 0x28, 0x7b, 0x00, 0x28, 0x54, 0xd1, + 0x95, 0xf8, 0x3c, 0x00, 0x00, 0x21, 0x31, 0x4e, 0x00, 0xf0, 0x82, 0x00, + 0x82, 0x28, 0x2e, 0x48, 0x14, 0xbf, 0x41, 0x84, 0x81, 0x84, 0x72, 0xb6, + 0x30, 0x68, 0x40, 0x00, 0x01, 0x30, 0x30, 0x60, 0x2b, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x04, 0x46, 0x30, 0x68, 0x4f, 0xea, 0x50, 0x00, 0x30, 0x60, + 0x30, 0x68, 0x80, 0xf3, 0x10, 0x88, 0xc4, 0xb3, 0x63, 0x20, 0x2c, 0x60, + 0x20, 0x75, 0x04, 0x20, 0x20, 0x82, 0x72, 0xb6, 0x30, 0x68, 0x40, 0x00, + 0x01, 0x30, 0x30, 0x60, 0x21, 0x48, 0x00, 0x68, 0x80, 0x47, 0x20, 0x60, + 0xee, 0x49, 0xf6, 0x4a, 0x30, 0x68, 0x40, 0x08, 0x30, 0x60, 0x30, 0x68, + 0x80, 0xf3, 0x10, 0x88, 0x25, 0x20, 0x85, 0xf8, 0x3e, 0x00, 0x00, 0x20, + 0x2b, 0x6a, 0x50, 0x86, 0xe8, 0x4a, 0x85, 0xf8, 0x3d, 0x00, 0x08, 0x73, + 0x20, 0x68, 0x5e, 0x00, 0xa8, 0x62, 0x12, 0x88, 0x00, 0xeb, 0x43, 0x00, + 0x2e, 0x63, 0x48, 0x60, 0xc8, 0x20, 0x8a, 0x60, 0x50, 0x43, 0x12, 0x4a, + 0x12, 0x88, 0xb0, 0xfb, 0xf2, 0xf0, 0x01, 0x30, 0x20, 0xf0, 0x01, 0x00, + 0x08, 0x60, 0x0f, 0x48, 0x02, 0x68, 0x6c, 0x48, 0x81, 0x69, 0x20, 0x46, + 0x90, 0x47, 0x0d, 0x48, 0x01, 0x21, 0x4f, 0xf0, 0xff, 0x32, 0x80, 0xf8, + 0x21, 0x10, 0x0b, 0x49, 0x0a, 0x60, 0x00, 0x21, 0xc0, 0xe9, 0x02, 0x11, + 0x70, 0xbd, 0x00, 0xbf, 0x90, 0x01, 0x00, 0x00, 0xc4, 0x79, 0x01, 0x00, + 0x24, 0x36, 0x01, 0x00, 0xd8, 0xa0, 0x08, 0x00, 0x14, 0xd9, 0x08, 0x00, + 0x9a, 0x0e, 0x01, 0x00, 0xd4, 0xa0, 0x08, 0x00, 0x8c, 0xe6, 0x05, 0x00, + 0x78, 0xd3, 0x05, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0xc6, 0x4e, 0x04, 0x46, + 0x70, 0x68, 0x50, 0xb1, 0x53, 0x48, 0x54, 0x49, 0x00, 0x68, 0x09, 0x6a, + 0x08, 0x1a, 0x53, 0x49, 0x20, 0xf0, 0x70, 0x40, 0xca, 0x68, 0x10, 0x44, + 0xc8, 0x60, 0xe8, 0x4d, 0x95, 0xf9, 0x3c, 0x00, 0xb0, 0xf1, 0xff, 0x3f, + 0x01, 0xdc, 0x80, 0x30, 0x0e, 0xd1, 0x6c, 0x48, 0x00, 0x26, 0x00, 0x21, + 0x85, 0xf8, 0x3c, 0x60, 0x02, 0x68, 0x28, 0x1d, 0x90, 0x47, 0x2e, 0x60, + 0x20, 0x46, 0xec, 0xf7, 0xc3, 0xff, 0x00, 0x20, 0xbd, 0xe8, 0xf0, 0x81, + 0xd5, 0xe9, 0x08, 0xc3, 0x63, 0x45, 0x0b, 0xd1, 0x31, 0x6b, 0x28, 0x1d, + 0x81, 0x42, 0x07, 0xd0, 0x41, 0x49, 0x28, 0x6b, 0x91, 0xf8, 0x2c, 0x10, + 0xa3, 0xeb, 0x50, 0x00, 0x88, 0x42, 0x2a, 0xd2, 0xdf, 0xf8, 0xf8, 0x80, + 0xa8, 0x6a, 0x2f, 0x6b, 0xd8, 0xf8, 0x18, 0x10, 0x04, 0x2f, 0x0a, 0x69, + 0xa2, 0xeb, 0x00, 0x00, 0xc0, 0xf3, 0x5a, 0x00, 0x28, 0xbf, 0x83, 0x42, + 0x0b, 0xd8, 0xdd, 0x49, 0x09, 0x68, 0x88, 0x47, 0xd8, 0xf8, 0x18, 0x10, + 0xa8, 0x6a, 0xd5, 0xe9, 0x08, 0xc3, 0x0a, 0x69, 0x10, 0x1a, 0x00, 0x01, + 0x08, 0xd4, 0x63, 0x45, 0x04, 0xd0, 0x2f, 0x4a, 0x6b, 0x8a, 0x90, 0x8f, + 0x83, 0x42, 0x15, 0xd2, 0x00, 0x20, 0x46, 0xe0, 0x63, 0x45, 0x07, 0xd1, + 0x49, 0x48, 0x01, 0x21, 0x02, 0x68, 0x28, 0x1d, 0x90, 0x47, 0x00, 0x20, + 0x28, 0x60, 0xbb, 0xe7, 0x96, 0xf8, 0x4d, 0x00, 0x60, 0xb1, 0x27, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, 0x07, 0xd1, 0xa8, 0x6a, 0x17, 0xe0, + 0x28, 0x48, 0x00, 0x7d, 0x00, 0xb3, 0xd0, 0x8e, 0x40, 0x00, 0x1e, 0xe0, + 0x22, 0x48, 0x01, 0x68, 0x22, 0x48, 0x88, 0x47, 0x4f, 0xf4, 0xff, 0x71, + 0x05, 0xf1, 0x20, 0x03, 0x01, 0xea, 0x40, 0x00, 0x0e, 0xcb, 0x51, 0x1a, + 0x48, 0x43, 0x40, 0xf2, 0xfb, 0x41, 0xb0, 0xfb, 0xf1, 0xf0, 0x18, 0x44, + 0x18, 0x49, 0x08, 0x40, 0x20, 0x60, 0x1a, 0x48, 0xd8, 0xf8, 0x18, 0x10, + 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x00, 0x20, 0x68, 0x82, 0x90, 0xe7, + 0x00, 0x20, 0x17, 0x4b, 0x1b, 0x7b, 0x13, 0xb1, 0x12, 0x8f, 0x00, 0xeb, + 0x42, 0x00, 0x00, 0x22, 0x6a, 0x82, 0x09, 0x4a, 0x12, 0x6a, 0x02, 0x44, + 0x22, 0xf0, 0x70, 0x42, 0x6a, 0x61, 0x06, 0x4a, 0x12, 0x6a, 0x10, 0x44, + 0x20, 0xf0, 0x70, 0x40, 0x20, 0x60, 0x0b, 0x48, 0x02, 0x68, 0x20, 0x46, + 0x90, 0x47, 0x76, 0xe7, 0x60, 0x86, 0x01, 0x00, 0xfc, 0x70, 0x01, 0x00, + 0x38, 0xfb, 0x05, 0x00, 0xe8, 0x65, 0x08, 0x00, 0xfc, 0x73, 0x01, 0x00, + 0x3c, 0xe5, 0x08, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xa0, 0x8e, 0x08, 0x00, + 0xf8, 0x6d, 0x01, 0x00, 0xc4, 0xa0, 0x08, 0x00, 0x7c, 0x5c, 0x01, 0x00, + 0x24, 0x5c, 0x01, 0x00, 0xb0, 0xb5, 0x8d, 0x4d, 0x2c, 0x1d, 0x00, 0xf0, + 0x5d, 0xf9, 0x2a, 0x7b, 0xd5, 0xe9, 0x08, 0x01, 0x42, 0xb1, 0x88, 0x42, + 0x1e, 0xd0, 0x10, 0x48, 0x00, 0x21, 0x02, 0x68, 0x20, 0x46, 0xbd, 0xe8, + 0xb0, 0x40, 0x10, 0x47, 0x88, 0x42, 0x15, 0xd1, 0x94, 0xf8, 0x38, 0x00, + 0x00, 0x21, 0x00, 0xf0, 0x82, 0x00, 0x82, 0x28, 0x61, 0x48, 0x19, 0xbf, + 0x41, 0x84, 0x21, 0x21, 0x81, 0x84, 0x22, 0x21, 0x06, 0x48, 0x02, 0x68, + 0x20, 0x46, 0x90, 0x47, 0x05, 0x48, 0x01, 0x68, 0x20, 0x46, 0xbd, 0xe8, + 0xb0, 0x40, 0x08, 0x47, 0xb0, 0xbd, 0x00, 0xbf, 0xbc, 0xa0, 0x08, 0x00, + 0xe4, 0xc9, 0x08, 0x00, 0xe8, 0xc9, 0x08, 0x00, 0x2d, 0xe9, 0xfe, 0x43, + 0x75, 0x49, 0xb1, 0xf8, 0xb0, 0x17, 0x49, 0x07, 0x05, 0xd5, 0x71, 0x4b, + 0x93, 0xf9, 0x3c, 0x20, 0xb2, 0xf1, 0xff, 0x3f, 0x02, 0xdd, 0x00, 0x20, + 0xbd, 0xe8, 0xfe, 0x83, 0x19, 0x1d, 0x12, 0xf1, 0x7e, 0x04, 0x05, 0xd0, + 0xd2, 0xb2, 0x81, 0x2a, 0x0a, 0xd1, 0x41, 0x4a, 0x12, 0x68, 0x05, 0xe0, + 0x3e, 0x4a, 0x12, 0x6b, 0x8a, 0x42, 0xee, 0xd0, 0x91, 0xf8, 0x39, 0x20, + 0x00, 0x2a, 0xea, 0xd1, 0x64, 0x4d, 0x3c, 0x4a, 0xad, 0x69, 0x54, 0x68, + 0x2d, 0x69, 0x2e, 0x1b, 0x37, 0x01, 0xe2, 0xd4, 0x00, 0x28, 0x68, 0xd0, + 0x10, 0x7b, 0xa8, 0xb1, 0x00, 0x20, 0x10, 0x73, 0x36, 0x48, 0x00, 0x88, + 0x90, 0x60, 0xc6, 0xf3, 0x5a, 0x06, 0x17, 0x68, 0x3e, 0x44, 0x01, 0x3e, + 0xb6, 0xfb, 0xf7, 0xf6, 0x7e, 0x43, 0x04, 0xeb, 0x46, 0x06, 0xad, 0x1b, + 0x26, 0xf0, 0x70, 0x44, 0x2d, 0x01, 0x54, 0x60, 0xc9, 0xd4, 0x00, 0xe0, + 0x90, 0x68, 0xdf, 0xf8, 0xb4, 0x80, 0xd3, 0xf8, 0xac, 0x30, 0xdf, 0xf8, + 0xb0, 0x90, 0x98, 0xf8, 0x00, 0x50, 0x05, 0xeb, 0x05, 0x16, 0x2a, 0x4d, + 0x49, 0xf8, 0x36, 0x30, 0x35, 0xf8, 0x06, 0x3f, 0xa0, 0xeb, 0x53, 0x07, + 0x09, 0xeb, 0xc6, 0x00, 0x65, 0x26, 0x80, 0xf8, 0x49, 0x60, 0x25, 0x4e, + 0x00, 0x2f, 0x97, 0x60, 0x36, 0x68, 0x06, 0x61, 0x4e, 0x8f, 0x91, 0xf8, + 0x3c, 0x10, 0xa0, 0xf8, 0x50, 0x60, 0x80, 0xf8, 0x52, 0x10, 0x06, 0xdc, + 0x1a, 0x49, 0x16, 0x68, 0x09, 0x88, 0x04, 0xeb, 0x46, 0x04, 0xc2, 0xe9, + 0x01, 0x41, 0xd5, 0xf8, 0x06, 0x20, 0x00, 0x21, 0xad, 0xf8, 0x08, 0x10, + 0xd5, 0xf8, 0x02, 0x10, 0x1a, 0x44, 0x22, 0xf0, 0x70, 0x42, 0x14, 0x31, + 0x01, 0x92, 0x00, 0xf1, 0x34, 0x02, 0x15, 0x48, 0x03, 0x68, 0x01, 0xa8, + 0x98, 0x47, 0x98, 0xf8, 0x00, 0x00, 0x13, 0x49, 0x00, 0xeb, 0x00, 0x10, + 0x0a, 0x68, 0x2c, 0x21, 0x09, 0xeb, 0xc0, 0x00, 0x90, 0x47, 0xe8, 0x8a, + 0x2a, 0x88, 0x01, 0x30, 0x01, 0x32, 0xe8, 0x82, 0x0d, 0x48, 0x41, 0x8e, + 0x01, 0xeb, 0x52, 0x01, 0x41, 0x86, 0x01, 0x20, 0xbd, 0xe8, 0xfe, 0x83, + 0x18, 0x74, 0x01, 0x00, 0xb4, 0x55, 0x01, 0x00, 0x64, 0x54, 0x01, 0x00, + 0x98, 0x0e, 0x01, 0x00, 0x74, 0x87, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, + 0x3c, 0x88, 0x01, 0x00, 0x20, 0xd3, 0x08, 0x00, 0x44, 0xa1, 0x08, 0x00, + 0xf4, 0xa0, 0x08, 0x00, 0xc4, 0x79, 0x01, 0x00, 0x80, 0xb5, 0x00, 0xf0, + 0x85, 0xf8, 0x06, 0x48, 0x06, 0x49, 0x00, 0x78, 0x08, 0x44, 0x80, 0x7e, + 0x00, 0x28, 0xbd, 0xe8, 0x80, 0x40, 0x08, 0xbf, 0x16, 0xf0, 0x70, 0xbd, + 0x16, 0xf0, 0x36, 0xbd, 0x74, 0x87, 0x08, 0x00, 0x48, 0x54, 0x01, 0x00, + 0xb0, 0xb5, 0x12, 0x49, 0x12, 0x4d, 0xca, 0x69, 0xac, 0x6a, 0x01, 0x32, + 0xca, 0x61, 0x00, 0xf0, 0x71, 0xf8, 0x28, 0x1d, 0x10, 0xf8, 0x08, 0x1f, + 0x59, 0xb1, 0x0e, 0x4a, 0xc1, 0x69, 0x92, 0x69, 0x12, 0x69, 0x51, 0x1a, + 0x04, 0x31, 0x21, 0xf0, 0x70, 0x41, 0xb1, 0xf1, 0x00, 0x6f, 0x88, 0xbf, + 0xc4, 0x61, 0x09, 0x48, 0x90, 0xf8, 0x2f, 0x01, 0xc0, 0x06, 0x06, 0xd5, + 0x07, 0x48, 0x01, 0x68, 0xc7, 0x20, 0x88, 0x47, 0x06, 0x48, 0x00, 0x21, + 0x01, 0x62, 0xb0, 0xbd, 0x84, 0xf0, 0x05, 0x00, 0x90, 0x01, 0x00, 0x00, + 0xfc, 0x73, 0x01, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x8c, 0xba, 0x08, 0x00, + 0x38, 0x7a, 0x01, 0x00, 0x0a, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, + 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, + 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, 0x0d, 0x49, 0x01, 0x60, 0x0d, 0x48, + 0x0d, 0x49, 0x40, 0xf8, 0x24, 0x1f, 0x0d, 0x49, 0x41, 0x60, 0x70, 0x47, + 0x54, 0xba, 0x08, 0x00, 0x69, 0x20, 0x04, 0x00, 0xf8, 0xd2, 0x08, 0x00, + 0xf5, 0x1b, 0x04, 0x00, 0x5c, 0xba, 0x08, 0x00, 0x81, 0x1e, 0x04, 0x00, + 0x00, 0xd3, 0x08, 0x00, 0xe5, 0x1e, 0x04, 0x00, 0x20, 0xbb, 0x08, 0x00, + 0x41, 0x20, 0x04, 0x00, 0x90, 0xcf, 0x08, 0x00, 0xb9, 0x1a, 0x04, 0x00, + 0xf5, 0x1c, 0x04, 0x00, 0x4b, 0xf6, 0x3f, 0x0c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf2, 0xf3, 0x5c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0x21, 0x3c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf2, 0x03, 0x0c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0x17, 0x2c, 0xc1, 0xf2, 0x09, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x10, 0xb5, 0x6d, 0x49, 0x0b, 0x4a, 0x5c, 0x23, + 0x08, 0x78, 0x10, 0xfb, 0x03, 0x20, 0xc4, 0x69, 0x09, 0x48, 0x84, 0x60, + 0x09, 0x78, 0x11, 0xfb, 0x03, 0x21, 0x09, 0x8c, 0x41, 0x60, 0x07, 0x49, + 0x01, 0x60, 0x41, 0x6a, 0xc9, 0x07, 0x11, 0xbf, 0x00, 0x20, 0x80, 0x69, + 0x01, 0x30, 0x40, 0x08, 0x10, 0xbd, 0x00, 0xbf, 0x44, 0x4f, 0x01, 0x00, + 0x80, 0x23, 0x00, 0x40, 0x20, 0x21, 0x31, 0x00, 0xf8, 0xb5, 0xff, 0xf7, + 0xdd, 0xff, 0x04, 0x46, 0x5a, 0x48, 0x5b, 0x4f, 0x5b, 0x4e, 0x5d, 0x4d, + 0x01, 0x6a, 0x21, 0x44, 0x01, 0x62, 0x5a, 0x49, 0x38, 0x78, 0x31, 0xf8, + 0x10, 0x2f, 0x00, 0xeb, 0x00, 0x10, 0x06, 0xeb, 0xc0, 0x00, 0x22, 0x44, + 0x0b, 0x46, 0x23, 0xf8, 0x02, 0x2b, 0xc0, 0xe9, 0x1e, 0x13, 0xd5, 0xe9, + 0x08, 0x12, 0x8a, 0x42, 0x49, 0xd1, 0x29, 0x7b, 0x00, 0x29, 0x00, 0xf0, + 0x97, 0x80, 0x51, 0x49, 0x00, 0x69, 0x0a, 0x69, 0x90, 0x42, 0x0e, 0xd0, + 0x49, 0x69, 0x88, 0x42, 0x0b, 0xd0, 0x4e, 0x49, 0x09, 0x68, 0x88, 0x42, + 0x07, 0xd0, 0x28, 0x6b, 0xb0, 0xeb, 0x44, 0x0f, 0x92, 0xbf, 0x00, 0x20, + 0x61, 0x00, 0x40, 0x1a, 0x28, 0x63, 0x68, 0x8a, 0x21, 0x46, 0x20, 0x44, + 0x68, 0x82, 0x4b, 0x48, 0x02, 0x68, 0xe8, 0x69, 0x00, 0x78, 0x90, 0x47, + 0x46, 0x48, 0x90, 0xf8, 0x2c, 0x10, 0xb0, 0xf8, 0x76, 0x00, 0x40, 0x1a, + 0x44, 0x49, 0x89, 0x69, 0x09, 0x69, 0x01, 0xeb, 0x40, 0x00, 0x29, 0x8a, + 0x20, 0xf0, 0x70, 0x40, 0x68, 0x61, 0x68, 0x8a, 0x01, 0x39, 0x81, 0x42, + 0x66, 0xdc, 0x28, 0x7b, 0x03, 0x28, 0x63, 0xd1, 0x2c, 0x68, 0x4c, 0xb1, + 0x3d, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x21, 0x7d, 0x00, 0x20, + 0x20, 0x61, 0x28, 0x60, 0x20, 0x75, 0xa1, 0x75, 0x39, 0x49, 0x28, 0x1d, + 0x0a, 0x68, 0x03, 0x21, 0xbd, 0xe8, 0xf8, 0x40, 0x10, 0x47, 0x2e, 0x4a, + 0x01, 0x69, 0x13, 0x69, 0x99, 0x42, 0x3a, 0xd0, 0x52, 0x69, 0x91, 0x42, + 0x37, 0xd0, 0x2b, 0x4a, 0x12, 0x68, 0x91, 0x42, 0x33, 0xd0, 0x2a, 0x49, + 0x40, 0x68, 0x09, 0x68, 0x88, 0x47, 0x29, 0x49, 0x08, 0x1d, 0x89, 0x7c, + 0xca, 0x07, 0x01, 0xd0, 0x4a, 0x07, 0x06, 0xd4, 0x8a, 0x07, 0x48, 0xbf, + 0x5f, 0xea, 0x41, 0x72, 0x0a, 0xd4, 0x60, 0x00, 0x1b, 0xe0, 0x01, 0xf0, + 0xfe, 0x01, 0x81, 0x73, 0x81, 0x68, 0x01, 0xf0, 0xf0, 0x01, 0x40, 0x29, + 0x03, 0xd1, 0x0c, 0xe0, 0x01, 0xf0, 0xfd, 0x01, 0x81, 0x73, 0x39, 0x78, + 0x00, 0x68, 0x01, 0xeb, 0x01, 0x11, 0x06, 0xeb, 0xc1, 0x01, 0x09, 0x6a, + 0x0a, 0x1a, 0x12, 0x01, 0x01, 0xd4, 0x00, 0x20, 0x03, 0xe0, 0x40, 0x1a, + 0x20, 0xf0, 0x70, 0x40, 0x01, 0x30, 0x29, 0x6b, 0x81, 0x42, 0x94, 0xbf, + 0x00, 0x20, 0x08, 0x1a, 0x28, 0x63, 0x68, 0x8a, 0x20, 0x44, 0x68, 0x82, + 0x10, 0x48, 0x90, 0xf8, 0x2c, 0x10, 0xb0, 0xf8, 0x76, 0x00, 0x40, 0x1a, + 0x0e, 0x49, 0x89, 0x69, 0x09, 0x69, 0x01, 0xeb, 0x40, 0x00, 0x20, 0xf0, + 0x70, 0x40, 0x68, 0x61, 0xf8, 0xbd, 0x00, 0xbf, 0x84, 0xf0, 0x05, 0x00, + 0x74, 0x87, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, 0xe4, 0x77, 0x01, 0x00, + 0x90, 0x01, 0x00, 0x00, 0x60, 0xd1, 0x08, 0x00, 0x24, 0xd3, 0x08, 0x00, + 0xac, 0xa0, 0x08, 0x00, 0x78, 0xe6, 0x05, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0xfc, 0x73, 0x01, 0x00, 0x34, 0xd3, 0x08, 0x00, 0xc8, 0xa0, 0x08, 0x00, + 0xbc, 0xa0, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x4c, 0xba, 0x08, 0x00, 0xa9, 0x21, 0x04, 0x00, 0xb0, 0xb5, 0x00, 0xf0, + 0x2b, 0xf9, 0x48, 0xb1, 0x0a, 0x4d, 0x00, 0x21, 0x01, 0x22, 0x01, 0x24, + 0xa8, 0x1c, 0x19, 0xf0, 0xcd, 0xfa, 0x18, 0xb1, 0x2c, 0x70, 0x08, 0xe0, + 0x00, 0x24, 0x06, 0xe0, 0x28, 0x78, 0x01, 0x24, 0x18, 0xb9, 0x01, 0x20, + 0x19, 0xf0, 0xc6, 0xfb, 0x28, 0x73, 0x20, 0x46, 0xb0, 0xbd, 0x00, 0xbf, + 0x58, 0xf0, 0x05, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x99, 0xb0, 0x5d, 0x48, + 0x04, 0x68, 0x5d, 0x48, 0x00, 0x68, 0x80, 0x47, 0xdf, 0xf8, 0x70, 0x91, + 0xdf, 0xf8, 0x70, 0xa1, 0x99, 0xf8, 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x10, + 0x0a, 0xeb, 0xc0, 0x01, 0xb1, 0xf8, 0xdc, 0x00, 0xc2, 0x07, 0x03, 0xd1, + 0x60, 0x68, 0x01, 0x30, 0x60, 0x60, 0x9d, 0xe0, 0x00, 0x07, 0x03, 0xd4, + 0xe0, 0x68, 0x01, 0x30, 0xe0, 0x60, 0x32, 0xe0, 0x6d, 0x4d, 0x91, 0xf8, + 0xbe, 0x10, 0x2a, 0x68, 0x92, 0xf8, 0x9c, 0x00, 0x92, 0xf8, 0x9d, 0x20, + 0x00, 0xf0, 0x3f, 0x03, 0x62, 0xf3, 0x87, 0x13, 0x8b, 0x42, 0x24, 0xd1, + 0x21, 0x68, 0x44, 0xf6, 0x3e, 0x12, 0x01, 0xf1, 0x01, 0x01, 0x21, 0x60, + 0x49, 0x49, 0x09, 0x78, 0x11, 0x44, 0x49, 0x4a, 0x11, 0x60, 0xc0, 0xb1, + 0x48, 0x48, 0x00, 0x68, 0x80, 0x47, 0x99, 0xf8, 0x00, 0x00, 0xc0, 0xeb, + 0x40, 0x10, 0x0a, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0xbe, 0x40, 0x44, 0x48, + 0xd0, 0xf8, 0x00, 0x80, 0x28, 0x68, 0x90, 0xf8, 0x72, 0x50, 0x42, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x03, 0x46, 0x00, 0x20, 0x29, 0x46, 0x22, 0x46, + 0xc0, 0x47, 0xdf, 0xf8, 0xe4, 0x80, 0xd8, 0xf8, 0x00, 0x00, 0x00, 0x69, + 0x00, 0x79, 0x20, 0xb3, 0x99, 0xf8, 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x10, + 0x0a, 0xeb, 0xc0, 0x00, 0x00, 0xf1, 0xc0, 0x01, 0x37, 0x48, 0xd0, 0xf8, + 0x00, 0xb0, 0x37, 0x48, 0x06, 0x68, 0x37, 0x48, 0x02, 0x68, 0x12, 0xa8, + 0x90, 0x47, 0x12, 0xaf, 0xdd, 0xe9, 0x17, 0x45, 0x8f, 0xcf, 0xcd, 0xe9, + 0x00, 0x74, 0x02, 0x95, 0xb0, 0x47, 0x32, 0x49, 0xca, 0x78, 0xd8, 0xf8, + 0x00, 0x10, 0x09, 0x69, 0x02, 0x31, 0xd8, 0x47, 0xd8, 0xf8, 0x00, 0x10, + 0x09, 0x69, 0x08, 0x70, 0x1c, 0xe0, 0x99, 0xf8, 0x00, 0x00, 0xc0, 0xeb, + 0x40, 0x10, 0x0a, 0xeb, 0xc0, 0x00, 0x00, 0xf1, 0xc0, 0x01, 0x26, 0x48, + 0x04, 0x68, 0x26, 0x48, 0x02, 0x68, 0x0b, 0xa8, 0x90, 0x47, 0x0b, 0xaf, + 0xef, 0xcf, 0x8d, 0xe8, 0xe0, 0x00, 0xa0, 0x47, 0xd8, 0xf8, 0x00, 0x10, + 0x01, 0x22, 0x09, 0x69, 0x0a, 0x71, 0x20, 0x4a, 0x08, 0x70, 0xd2, 0x78, + 0x90, 0x40, 0x48, 0x80, 0x99, 0xf8, 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x10, + 0x0a, 0xeb, 0xc0, 0x00, 0x00, 0xf1, 0xc0, 0x01, 0x18, 0x48, 0x02, 0x68, + 0x04, 0xa8, 0x90, 0x47, 0x15, 0x4f, 0x04, 0xae, 0x7f, 0xce, 0x8d, 0xe8, + 0x70, 0x00, 0x3f, 0x68, 0x4f, 0xf4, 0xff, 0x74, 0x54, 0xfa, 0x96, 0xf4, + 0xb8, 0x47, 0x01, 0x46, 0xc4, 0xf3, 0x47, 0x00, 0x0f, 0xf0, 0x8e, 0xf8, + 0x10, 0x48, 0x00, 0x68, 0x80, 0x47, 0x19, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x04, 0x36, 0x01, 0x00, 0xa4, 0xba, 0x08, 0x00, 0x74, 0x87, 0x08, 0x00, + 0x0c, 0x6f, 0x01, 0x00, 0xf8, 0x35, 0x01, 0x00, 0xa8, 0x0d, 0x01, 0x00, + 0x54, 0x11, 0x21, 0x40, 0x8c, 0xbb, 0x08, 0x00, 0xf0, 0xb7, 0x08, 0x00, + 0xc8, 0xb7, 0x08, 0x00, 0x10, 0xb8, 0x08, 0x00, 0x1c, 0xb8, 0x08, 0x00, + 0x18, 0xb8, 0x08, 0x00, 0x00, 0x69, 0x08, 0x00, 0xa0, 0xba, 0x08, 0x00, + 0x80, 0xb5, 0x00, 0xf0, 0x39, 0xf8, 0x0d, 0x48, 0x41, 0x7a, 0xc9, 0x07, + 0x14, 0xd0, 0x0c, 0x49, 0x09, 0x68, 0x91, 0xf8, 0x78, 0x20, 0x91, 0xf8, + 0x8b, 0x10, 0x04, 0x29, 0x28, 0xbf, 0x04, 0x21, 0x08, 0x44, 0x80, 0x7a, + 0x90, 0x42, 0x07, 0xd2, 0x06, 0x49, 0x07, 0x4a, 0x5c, 0x23, 0x09, 0x78, + 0x11, 0xfb, 0x03, 0x21, 0x81, 0xf8, 0x4f, 0x00, 0x80, 0xbd, 0x00, 0xbf, + 0xcc, 0x2c, 0x06, 0x00, 0xf8, 0x35, 0x01, 0x00, 0x74, 0x87, 0x08, 0x00, + 0x44, 0x4f, 0x01, 0x00, 0x03, 0x48, 0x04, 0x49, 0x01, 0x60, 0x04, 0x48, + 0x04, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x58, 0xd3, 0x08, 0x00, + 0xf8, 0x25, 0x04, 0x00, 0xa4, 0xd3, 0x08, 0x00, 0xd8, 0x25, 0x04, 0x00, + 0x40, 0xf6, 0x49, 0x0c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x40, 0xf6, 0xff, 0x1c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xaf, 0x07, 0x0a, 0x10, 0x13, 0xf1, 0x08, 0x10, 0x43, 0x08, 0x0a, 0x10, + 0x65, 0x23, 0x04, 0x00, 0xf1, 0x70, 0x0f, 0x10, 0x9d, 0x23, 0x04, 0x00, + 0xe9, 0x70, 0x0f, 0x10, 0x6b, 0x00, 0x00, 0x00, 0x55, 0x25, 0x04, 0x00, + 0x7b, 0x0a, 0x0a, 0x10, 0x09, 0x0b, 0x0a, 0x10, 0x1d, 0x0b, 0x0a, 0x10, + 0xf1, 0x70, 0x0f, 0x10, 0xbf, 0x0b, 0x0a, 0x10, 0xe9, 0x70, 0x0f, 0x10, + 0x72, 0x00, 0x00, 0x00, 0x2d, 0xe9, 0xf8, 0x43, 0x06, 0x46, 0x49, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x00, 0x28, 0x45, 0xd0, 0x04, 0x46, 0x46, 0x60, + 0x93, 0x20, 0x0c, 0x21, 0x04, 0xf1, 0x08, 0x05, 0x20, 0x70, 0x28, 0x46, + 0xe1, 0xf7, 0x3a, 0xfb, 0xff, 0x20, 0xa0, 0x73, 0xd6, 0xf8, 0xd4, 0x00, + 0x40, 0x7f, 0xb8, 0xb3, 0x3f, 0x48, 0x96, 0xf9, 0x3d, 0x13, 0x4f, 0xf4, + 0xa8, 0x72, 0x00, 0x68, 0x11, 0xfb, 0x02, 0x00, 0x90, 0xf8, 0x31, 0x11, + 0x89, 0x07, 0x21, 0xd5, 0x3a, 0x4a, 0x90, 0xf8, 0x32, 0x11, 0x00, 0xf2, + 0x33, 0x10, 0x12, 0x68, 0x90, 0x47, 0xff, 0x28, 0x18, 0xd0, 0x37, 0x49, + 0x34, 0x22, 0x09, 0x68, 0x10, 0xfb, 0x02, 0x10, 0x35, 0x49, 0x10, 0x22, + 0xee, 0xf7, 0x9e, 0xfe, 0x70, 0xb1, 0x34, 0x48, 0x34, 0x49, 0x06, 0x23, + 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x01, 0xeb, 0xc0, 0x00, 0x06, 0x21, + 0xd0, 0xf8, 0xa4, 0x00, 0x82, 0x1d, 0x28, 0x46, 0xde, 0xf7, 0xbe, 0xfc, + 0x2c, 0x48, 0x2d, 0x49, 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x01, 0xeb, + 0xc0, 0x00, 0x32, 0xe0, 0xbd, 0xe8, 0xf8, 0x83, 0xdf, 0xf8, 0x9c, 0x80, + 0x28, 0x49, 0xdf, 0xf8, 0x9c, 0x90, 0x98, 0xf8, 0x00, 0x70, 0xce, 0x6c, + 0xc7, 0xeb, 0x47, 0x10, 0x96, 0xf8, 0x9c, 0x10, 0x09, 0xeb, 0xc0, 0x00, + 0x90, 0xf8, 0xbb, 0x00, 0xff, 0x28, 0x05, 0xd1, 0x88, 0x07, 0x18, 0xd5, + 0x1b, 0x48, 0xc0, 0x79, 0xff, 0x28, 0x14, 0xd0, 0x89, 0x07, 0x12, 0xd5, + 0x18, 0x49, 0x34, 0x22, 0x09, 0x68, 0x10, 0xfb, 0x02, 0x10, 0x17, 0x49, + 0x10, 0x22, 0xee, 0xf7, 0x61, 0xfe, 0x40, 0xb1, 0x06, 0xf1, 0xa0, 0x02, + 0x28, 0x46, 0x06, 0x21, 0x06, 0x23, 0xde, 0xf7, 0x89, 0xfc, 0x98, 0xf8, + 0x00, 0x70, 0xc7, 0xeb, 0x47, 0x10, 0x09, 0xeb, 0xc0, 0x00, 0x90, 0xf8, + 0xb9, 0x10, 0x89, 0x07, 0x44, 0xbf, 0x90, 0xf8, 0xbb, 0x00, 0xa0, 0x73, + 0x0e, 0x48, 0x00, 0xf1, 0x60, 0x01, 0x20, 0x46, 0xe0, 0xf7, 0x4c, 0xfe, + 0x0c, 0x48, 0x05, 0x21, 0x00, 0x78, 0xbd, 0xe8, 0xf8, 0x43, 0xde, 0xf7, + 0x75, 0xbc, 0x00, 0xbf, 0xe8, 0xb9, 0x08, 0x00, 0xdc, 0x35, 0x01, 0x00, + 0x48, 0xc9, 0x08, 0x00, 0x20, 0x54, 0x01, 0x00, 0x9a, 0xad, 0x09, 0x10, + 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0xfc, 0x70, 0x01, 0x00, + 0x2c, 0xba, 0x01, 0x00, 0x67, 0x34, 0x01, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0xe4, 0x8e, 0x08, 0x00, 0x19, 0x26, 0x04, 0x00, + 0x2d, 0xe9, 0xfc, 0x47, 0x04, 0x46, 0x90, 0xf8, 0x12, 0xa0, 0x45, 0x68, + 0xc0, 0x7c, 0x01, 0x07, 0x4e, 0xd4, 0x40, 0xf0, 0x04, 0x00, 0x95, 0xf8, + 0x28, 0x91, 0x21, 0x46, 0xe0, 0x74, 0x66, 0x48, 0x02, 0x68, 0x28, 0x46, + 0x90, 0x47, 0x80, 0x46, 0x61, 0x48, 0x64, 0x4a, 0x68, 0x23, 0xb8, 0xf1, + 0x16, 0x0f, 0x00, 0xf2, 0x57, 0x31, 0x04, 0xbf, 0x91, 0xf8, 0x2b, 0x00, + 0xa0, 0x74, 0x95, 0xf8, 0x35, 0x01, 0x10, 0xfb, 0x03, 0x23, 0x93, 0xf8, + 0x2e, 0x30, 0x01, 0x2b, 0x17, 0xd1, 0x23, 0x7d, 0x66, 0x2b, 0x14, 0xd1, + 0xa3, 0x7c, 0x91, 0xf8, 0x2c, 0x60, 0xb3, 0x42, 0x02, 0xd8, 0x0b, 0x78, + 0x01, 0x33, 0xa3, 0x74, 0x68, 0x26, 0xdf, 0xb2, 0x10, 0xfb, 0x06, 0x26, + 0x32, 0x46, 0x12, 0xf8, 0x4a, 0xcf, 0xbc, 0x45, 0x1c, 0xbf, 0x01, 0x27, + 0x86, 0xf8, 0x4b, 0x70, 0x13, 0x70, 0x95, 0xf8, 0x3e, 0x23, 0xa3, 0x7c, + 0xd2, 0x07, 0x45, 0xd0, 0x91, 0xf8, 0x51, 0x20, 0x93, 0x42, 0x41, 0xd2, + 0xa2, 0x74, 0x95, 0xf8, 0x29, 0x31, 0x03, 0xf0, 0x1e, 0x03, 0x1e, 0x2b, + 0x28, 0xd1, 0x95, 0xf8, 0x28, 0x31, 0xc3, 0xf3, 0x41, 0x06, 0x03, 0x2e, + 0x26, 0xd1, 0x91, 0xf8, 0x52, 0xc0, 0x2c, 0xe0, 0xdf, 0x49, 0x91, 0xf8, + 0x81, 0x23, 0x92, 0x45, 0x15, 0xd9, 0x91, 0xf8, 0x82, 0x13, 0xa1, 0x74, + 0x89, 0xb1, 0x12, 0x20, 0x8d, 0xf8, 0x05, 0x10, 0x01, 0xa9, 0x8d, 0xf8, + 0x06, 0x00, 0x20, 0x7d, 0x8d, 0xf8, 0x04, 0x00, 0x95, 0xf8, 0x35, 0x01, + 0x8d, 0xf8, 0x07, 0x00, 0x35, 0x48, 0x02, 0x68, 0x15, 0x20, 0x90, 0x47, + 0xe0, 0x7c, 0x00, 0xf0, 0xfb, 0x00, 0xe0, 0x74, 0xbd, 0xe8, 0xfc, 0x87, + 0x91, 0xf8, 0x52, 0x30, 0xa3, 0x74, 0x0d, 0xe0, 0x5b, 0x08, 0x5b, 0x07, + 0x09, 0xd0, 0x91, 0xf8, 0x52, 0x30, 0xd4, 0x46, 0x9a, 0x45, 0x13, 0x46, + 0x04, 0xd1, 0x63, 0x46, 0x84, 0xf8, 0x12, 0xc0, 0x00, 0xe0, 0x13, 0x46, + 0x91, 0xf8, 0x2d, 0x10, 0x8b, 0x42, 0x17, 0xd2, 0x05, 0x21, 0x09, 0xf0, + 0x05, 0x02, 0x01, 0xea, 0x59, 0x01, 0x11, 0x44, 0x01, 0xf0, 0x03, 0x02, + 0x02, 0xeb, 0x91, 0x01, 0x95, 0xf8, 0x25, 0x21, 0x91, 0x42, 0x09, 0xd8, + 0xbf, 0x49, 0xb5, 0xf8, 0xdc, 0x22, 0x89, 0x7f, 0x51, 0x43, 0xd5, 0xf8, + 0xf0, 0x20, 0xb2, 0xeb, 0x81, 0x0f, 0x2e, 0xd2, 0x08, 0x23, 0x01, 0x21, + 0x1b, 0x4a, 0x16, 0x68, 0x01, 0x22, 0xb0, 0x47, 0x95, 0xf8, 0x29, 0x01, + 0x40, 0x08, 0xf9, 0xf7, 0xe7, 0xff, 0x04, 0x28, 0x09, 0xd3, 0x17, 0x48, + 0x01, 0x68, 0x17, 0x48, 0x88, 0x47, 0xa1, 0x7c, 0x00, 0xf0, 0x01, 0x00, + 0x08, 0x44, 0x03, 0x30, 0x01, 0xe0, 0xa1, 0x7c, 0x08, 0x44, 0xc1, 0xb2, + 0xa0, 0x74, 0x51, 0x45, 0x0f, 0xd0, 0x8d, 0xf8, 0x01, 0x00, 0x20, 0x7d, + 0x69, 0x46, 0x8d, 0xf8, 0x02, 0x80, 0x8d, 0xf8, 0x00, 0x00, 0x95, 0xf8, + 0x35, 0x01, 0x8d, 0xf8, 0x03, 0x00, 0xd5, 0x48, 0x02, 0x68, 0x15, 0x20, + 0x90, 0x47, 0xbd, 0xe8, 0xfc, 0x87, 0x36, 0x23, 0x00, 0x21, 0xcf, 0xe7, + 0x8c, 0x7e, 0x08, 0x00, 0x1c, 0xa1, 0x08, 0x00, 0x94, 0xd1, 0x08, 0x00, + 0xb0, 0xe6, 0x05, 0x00, 0x04, 0xa1, 0x08, 0x00, 0xa0, 0x8e, 0x08, 0x00, + 0xf8, 0x6d, 0x01, 0x00, 0x2d, 0xe9, 0xfe, 0x4f, 0xd0, 0xf8, 0x84, 0xb2, + 0x0c, 0x46, 0x05, 0x46, 0xbb, 0xf1, 0x00, 0x0f, 0x03, 0xd1, 0x00, 0x20, + 0xe0, 0x21, 0xde, 0xf7, 0x4d, 0xfb, 0xd9, 0x46, 0x95, 0xf8, 0x35, 0x01, + 0xc0, 0x4e, 0x68, 0x21, 0xb5, 0xf8, 0xdc, 0x72, 0x59, 0xf8, 0x08, 0x2f, + 0x10, 0xfb, 0x01, 0x60, 0x4f, 0xea, 0x87, 0x0a, 0x00, 0x97, 0xd9, 0xf8, + 0x04, 0x30, 0xc0, 0xe9, 0x0e, 0x23, 0xcd, 0xe9, 0x01, 0x23, 0x95, 0xf8, + 0x35, 0x01, 0x10, 0xfb, 0x01, 0x61, 0x08, 0x46, 0x30, 0xf8, 0x48, 0x2f, + 0xb2, 0xeb, 0x87, 0x0f, 0x1c, 0xbf, 0x01, 0x22, 0x81, 0xf8, 0x4b, 0x20, + 0xa0, 0xf8, 0x00, 0xa0, 0x7e, 0x48, 0x27, 0x46, 0x90, 0xf8, 0x4d, 0x20, + 0x90, 0xf8, 0x4e, 0x30, 0x90, 0xf8, 0x4c, 0x10, 0x1a, 0x44, 0x02, 0xeb, + 0x42, 0x02, 0x11, 0x44, 0x0a, 0x06, 0x0b, 0xd0, 0xc9, 0xb2, 0x03, 0x20, + 0xb1, 0xfb, 0xf0, 0xf0, 0x0b, 0x29, 0x00, 0xf1, 0x01, 0x00, 0x88, 0xbf, + 0x04, 0x20, 0x4f, 0xf0, 0x00, 0x08, 0x34, 0xe0, 0x00, 0xf1, 0x08, 0x02, + 0x71, 0x48, 0x00, 0x21, 0x4f, 0xf0, 0x00, 0x08, 0x03, 0x68, 0x70, 0x48, + 0x90, 0xf8, 0x81, 0x03, 0x01, 0x38, 0xc0, 0xb2, 0x98, 0x47, 0x28, 0xb3, + 0x39, 0x68, 0x82, 0x68, 0x53, 0x1a, 0x23, 0xf0, 0x70, 0x43, 0xb3, 0xf1, + 0x00, 0x6f, 0x06, 0xd8, 0x8a, 0x42, 0x19, 0xd1, 0xb9, 0x88, 0x82, 0x89, + 0x3c, 0x46, 0x8a, 0x42, 0x14, 0xd2, 0x00, 0x7d, 0xa0, 0xf1, 0x44, 0x01, + 0x1f, 0x29, 0x06, 0xd8, 0x01, 0x22, 0x02, 0xfa, 0x01, 0xf1, 0x62, 0x4a, + 0x11, 0x42, 0x40, 0xf0, 0xb9, 0x80, 0x32, 0x28, 0x00, 0xf0, 0xb6, 0x80, + 0x02, 0x28, 0x03, 0xd1, 0x00, 0x20, 0x4f, 0xf0, 0x16, 0x08, 0x02, 0xe0, + 0x4f, 0xf0, 0x00, 0x08, 0x00, 0x20, 0x5b, 0x49, 0x64, 0x22, 0x01, 0x44, + 0x91, 0xf8, 0x84, 0x10, 0x0a, 0xfb, 0x01, 0xf1, 0xb1, 0xfb, 0xf2, 0xf4, + 0x30, 0xb1, 0x43, 0xf6, 0xe3, 0x60, 0xb8, 0x46, 0x81, 0x42, 0x0a, 0xd9, + 0xa0, 0x24, 0x14, 0xe0, 0xb8, 0xf1, 0x00, 0x0f, 0x10, 0xd0, 0x52, 0x48, + 0x81, 0x42, 0x09, 0xd3, 0xc8, 0xf5, 0x96, 0x64, 0x0a, 0xe0, 0xaa, 0xeb, + 0x04, 0x00, 0x0c, 0x28, 0x38, 0xbf, 0xaa, 0xf1, 0x0c, 0x04, 0x04, 0xe0, + 0xb4, 0xeb, 0x08, 0x00, 0x88, 0xbf, 0x04, 0x46, 0xb8, 0x46, 0x95, 0xf8, + 0x35, 0x01, 0x68, 0x21, 0x48, 0x4b, 0x10, 0xfb, 0x01, 0x61, 0x1b, 0x68, + 0x08, 0x46, 0x50, 0xf8, 0x30, 0x2f, 0x9c, 0x42, 0x88, 0xbf, 0x1c, 0x46, + 0xa2, 0x42, 0x1c, 0xbf, 0x01, 0x22, 0x81, 0xf8, 0x4b, 0x20, 0x04, 0x60, + 0x3c, 0x49, 0x01, 0x98, 0x91, 0xf8, 0x59, 0x23, 0x91, 0xf8, 0x81, 0x13, + 0x20, 0x44, 0x20, 0xf0, 0x70, 0x47, 0x9b, 0xf8, 0x12, 0x00, 0x01, 0x97, + 0x88, 0x42, 0x98, 0xbf, 0x0a, 0x46, 0x34, 0x49, 0x50, 0x1e, 0xc0, 0xb2, + 0x42, 0x46, 0x0b, 0x68, 0x00, 0x21, 0x98, 0x47, 0x95, 0xf8, 0x35, 0x11, + 0x00, 0x28, 0x4a, 0xd0, 0x68, 0x22, 0x11, 0xfb, 0x02, 0x62, 0x92, 0xf8, + 0x2e, 0x20, 0x01, 0x2a, 0x32, 0xd1, 0x9b, 0xf8, 0x14, 0x20, 0x66, 0x2a, + 0x2e, 0xd1, 0x02, 0x7d, 0x37, 0x2a, 0x1f, 0xd1, 0x42, 0x68, 0xd2, 0xf8, + 0xd0, 0x20, 0x12, 0x78, 0x02, 0x2a, 0x19, 0xd1, 0x68, 0x22, 0x00, 0x9f, + 0x11, 0xfb, 0x02, 0x63, 0x1a, 0x46, 0x18, 0x2f, 0x52, 0xf8, 0x34, 0x5f, + 0x28, 0xbf, 0x18, 0x27, 0xbc, 0x42, 0x38, 0xbf, 0x27, 0x46, 0xbd, 0x42, + 0x1c, 0xbf, 0x01, 0x24, 0x83, 0xf8, 0x4b, 0x40, 0x17, 0x60, 0xd9, 0xf8, + 0x00, 0x20, 0x3a, 0x44, 0x22, 0xf0, 0x70, 0x47, 0x01, 0x97, 0x0b, 0xe0, + 0x68, 0x22, 0x11, 0xfb, 0x02, 0x62, 0x13, 0x46, 0x53, 0xf8, 0x34, 0x4f, + 0x24, 0xb1, 0x00, 0x24, 0x1c, 0x60, 0x01, 0x23, 0x82, 0xf8, 0x4b, 0x30, + 0x02, 0x46, 0x52, 0xf8, 0x08, 0x3f, 0xdc, 0x1b, 0x24, 0x01, 0x06, 0xd4, + 0xbb, 0x42, 0x08, 0xd1, 0x80, 0x89, 0xbd, 0xf8, 0x08, 0x30, 0x83, 0x42, + 0x03, 0xd9, 0xd2, 0xe9, 0x00, 0x02, 0xcd, 0xe9, 0x01, 0x02, 0x68, 0x20, + 0x11, 0xfb, 0x00, 0x60, 0xdd, 0xe9, 0x01, 0x12, 0xc0, 0xe9, 0x10, 0x12, + 0xc5, 0x48, 0x0b, 0x49, 0x42, 0x46, 0x03, 0x68, 0x01, 0xa8, 0x98, 0x47, + 0xbd, 0xe8, 0xfe, 0x8f, 0x01, 0x20, 0x18, 0xe7, 0x18, 0x74, 0x01, 0x00, + 0xa8, 0xeb, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x03, 0x00, 0x00, 0x90, + 0xe8, 0x65, 0x08, 0x00, 0x24, 0xd5, 0x01, 0x00, 0xa0, 0x5a, 0x01, 0x00, + 0x7c, 0x0e, 0x01, 0x00, 0x7c, 0xb5, 0x46, 0x68, 0x05, 0x46, 0x00, 0xf0, + 0xf1, 0xfa, 0x04, 0x46, 0x96, 0xf8, 0x35, 0x01, 0x25, 0x49, 0x68, 0x22, + 0xb6, 0xf8, 0xdc, 0x32, 0x01, 0x2c, 0x10, 0xfb, 0x02, 0x12, 0xb6, 0xf8, + 0x14, 0x13, 0xa2, 0xf8, 0x5a, 0x30, 0x92, 0xf8, 0x5c, 0x30, 0xa2, 0xf8, + 0x58, 0x10, 0x43, 0xf0, 0x01, 0x03, 0x82, 0xf8, 0x5c, 0x30, 0x0b, 0xd1, + 0x8d, 0xf8, 0x05, 0x00, 0x28, 0x7d, 0xad, 0xf8, 0x06, 0x10, 0x01, 0xa9, + 0x8d, 0xf8, 0x04, 0x00, 0x18, 0x48, 0x02, 0x68, 0x1f, 0x20, 0x90, 0x47, + 0x20, 0x46, 0x7c, 0xbd, 0x7c, 0xb5, 0x46, 0x68, 0x05, 0x46, 0x00, 0xf0, + 0xcd, 0xfa, 0x04, 0x46, 0x96, 0xf8, 0x35, 0x01, 0x10, 0x49, 0x68, 0x22, + 0xb6, 0xf8, 0xdc, 0x32, 0x01, 0x2c, 0x10, 0xfb, 0x02, 0x12, 0xb6, 0xf8, + 0x14, 0x13, 0xa2, 0xf8, 0x5a, 0x30, 0x92, 0xf8, 0x5c, 0x30, 0xa2, 0xf8, + 0x58, 0x10, 0x43, 0xf0, 0x01, 0x03, 0x82, 0xf8, 0x5c, 0x30, 0x0b, 0xd1, + 0x8d, 0xf8, 0x05, 0x00, 0x28, 0x7d, 0xad, 0xf8, 0x06, 0x10, 0x01, 0xa9, + 0x8d, 0xf8, 0x04, 0x00, 0x03, 0x48, 0x02, 0x68, 0x1f, 0x20, 0x90, 0x47, + 0x20, 0x46, 0x7c, 0xbd, 0xb0, 0xe6, 0x05, 0x00, 0x1c, 0xa1, 0x08, 0x00, + 0x10, 0xb5, 0x04, 0x46, 0xd0, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0xe8, 0xb9, + 0x94, 0xf8, 0x29, 0x01, 0x94, 0xf8, 0x30, 0x11, 0x08, 0x43, 0x40, 0x08, + 0xf9, 0xf7, 0x0e, 0xfe, 0xa0, 0xb9, 0x94, 0xf8, 0x2b, 0x01, 0x94, 0xf8, + 0x2c, 0x11, 0x94, 0xf8, 0x2d, 0x21, 0x94, 0xf8, 0x2e, 0x31, 0x08, 0x43, + 0x10, 0x43, 0x18, 0x43, 0x40, 0x08, 0xf9, 0xf7, 0xff, 0xfd, 0x05, 0x28, + 0x04, 0xd3, 0xb4, 0xf8, 0xe4, 0x02, 0x08, 0xb1, 0x00, 0x20, 0x10, 0xbd, + 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x81, 0xba, 0x00, 0xbf, + 0x10, 0xb5, 0x04, 0x46, 0xd0, 0xf8, 0x10, 0x03, 0xa8, 0xb9, 0xb4, 0xf9, + 0x84, 0x00, 0xb0, 0xf1, 0xff, 0x3f, 0x10, 0xdc, 0xb4, 0xf8, 0x14, 0x13, + 0xb4, 0xf8, 0x16, 0x23, 0x51, 0x1a, 0x09, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, + 0x07, 0xdc, 0x6f, 0xf3, 0xdf, 0x30, 0xa4, 0xf8, 0x84, 0x00, 0x04, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, + 0x00, 0xf0, 0x66, 0xba, 0x10, 0xb5, 0x08, 0x00, 0x80, 0xb5, 0x41, 0x68, + 0xb1, 0xf8, 0x38, 0x23, 0x12, 0x07, 0x03, 0xd4, 0xbd, 0xe8, 0x80, 0x40, + 0x00, 0xf0, 0x60, 0xba, 0x02, 0x7d, 0x6a, 0x2a, 0x05, 0xd1, 0xb1, 0xf8, + 0x84, 0x20, 0x22, 0xf0, 0x40, 0x02, 0xa1, 0xf8, 0x84, 0x20, 0xeb, 0xf7, + 0xc7, 0xff, 0x00, 0x20, 0x80, 0xbd, 0x00, 0xbf, 0xfe, 0xb5, 0x04, 0x46, + 0xd0, 0xf8, 0xd4, 0x00, 0x15, 0x46, 0x40, 0x7f, 0xe0, 0xb1, 0x56, 0x4e, + 0xd4, 0xf8, 0x20, 0x23, 0x30, 0x46, 0x50, 0xf8, 0x08, 0x1f, 0x53, 0x1a, + 0x1b, 0x01, 0x06, 0xd4, 0x8a, 0x42, 0x1d, 0xd1, 0xb4, 0xf8, 0x24, 0x13, + 0x82, 0x88, 0x8a, 0x42, 0x18, 0xd9, 0x4f, 0x4a, 0x04, 0xf5, 0x48, 0x71, + 0x13, 0x68, 0x01, 0xaa, 0x98, 0x47, 0xbd, 0xf8, 0x08, 0x10, 0x01, 0x98, + 0x59, 0xb1, 0x01, 0x30, 0x01, 0x90, 0x08, 0xe0, 0xd4, 0xf8, 0x84, 0x02, + 0x00, 0x68, 0x42, 0x1a, 0x12, 0x01, 0x2c, 0xd5, 0x08, 0x1a, 0x20, 0xf0, + 0x70, 0x40, 0x01, 0x30, 0x40, 0x08, 0x27, 0xe0, 0x94, 0xf8, 0x8c, 0x10, + 0x49, 0x07, 0x22, 0xd4, 0x40, 0x49, 0x01, 0xaa, 0x0b, 0x68, 0xd4, 0xf8, + 0x84, 0x12, 0x08, 0x31, 0x98, 0x47, 0x01, 0x99, 0x40, 0xf2, 0x71, 0x20, + 0xd4, 0xf8, 0x1c, 0x23, 0x48, 0x43, 0xd4, 0xf8, 0x84, 0x12, 0xa2, 0xeb, + 0x50, 0x00, 0xbd, 0xf8, 0x08, 0x20, 0xa0, 0xeb, 0x12, 0x10, 0xc4, 0xf8, + 0x1c, 0x03, 0x56, 0xf8, 0x08, 0x0f, 0x72, 0x68, 0xc1, 0xe9, 0x02, 0x02, + 0xce, 0x4a, 0xd4, 0xf8, 0x84, 0x02, 0x81, 0x68, 0x11, 0x40, 0x01, 0x60, + 0xfe, 0xbd, 0x01, 0x20, 0xd4, 0xf8, 0xf8, 0x20, 0xb0, 0xfb, 0xf2, 0xf1, + 0x4a, 0x43, 0x82, 0x42, 0x38, 0xbf, 0x01, 0x31, 0xb4, 0xf8, 0x40, 0x04, + 0x02, 0x28, 0x05, 0xd3, 0x29, 0x48, 0x89, 0xb2, 0x02, 0x68, 0x20, 0x46, + 0x90, 0x47, 0x01, 0x46, 0xd4, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0xe8, 0xb1, + 0xb4, 0xf8, 0xe4, 0x02, 0xd0, 0xb1, 0x94, 0xf8, 0x3a, 0x23, 0x80, 0x2a, + 0x16, 0xd1, 0x22, 0x6a, 0xa2, 0xb9, 0xa2, 0x68, 0x92, 0xb9, 0x20, 0x4a, + 0x92, 0xf8, 0xc3, 0x20, 0x22, 0xb1, 0xd4, 0xf8, 0x54, 0x23, 0x0a, 0xb1, + 0x92, 0x88, 0x4a, 0xb1, 0xb4, 0xf8, 0x40, 0x24, 0x02, 0x2a, 0x02, 0xd3, + 0x02, 0xfb, 0x00, 0x11, 0x02, 0xe0, 0x81, 0x42, 0x98, 0xbf, 0x41, 0x1c, + 0x17, 0x48, 0xb4, 0xf8, 0x14, 0x63, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, + 0xb4, 0xf8, 0x14, 0x23, 0x94, 0xf8, 0xb8, 0x32, 0x90, 0x1b, 0x01, 0x2b, + 0x86, 0xb2, 0x0a, 0xd0, 0x94, 0xf8, 0xb9, 0x02, 0x00, 0xfb, 0x06, 0xf1, + 0x0f, 0x48, 0x07, 0x68, 0x04, 0xf5, 0x22, 0x70, 0xb8, 0x47, 0x84, 0xf8, + 0x89, 0x02, 0x00, 0x2d, 0x08, 0xbf, 0x01, 0x26, 0x4e, 0xb1, 0x0b, 0x4f, + 0x04, 0xf5, 0x94, 0x74, 0x00, 0x25, 0x39, 0x68, 0x20, 0x46, 0x88, 0x47, + 0x01, 0x35, 0xb5, 0x42, 0xf9, 0xd1, 0xfe, 0xbd, 0x18, 0x74, 0x01, 0x00, + 0x44, 0xa1, 0x08, 0x00, 0x58, 0xd1, 0x08, 0x00, 0xd0, 0x32, 0x06, 0x00, + 0x5c, 0xd1, 0x08, 0x00, 0x50, 0xd1, 0x08, 0x00, 0x50, 0xd2, 0x08, 0x00, + 0xfe, 0xb5, 0x04, 0x46, 0x20, 0xb9, 0x00, 0x20, 0x40, 0xf2, 0xa9, 0x21, + 0xde, 0xf7, 0x96, 0xf8, 0xb4, 0xf8, 0x38, 0x03, 0x01, 0x07, 0x16, 0xd5, + 0x94, 0xf8, 0x35, 0x11, 0x8b, 0x4a, 0x68, 0x23, 0x11, 0xfb, 0x03, 0x21, + 0xb1, 0xf8, 0x64, 0x10, 0xc9, 0x07, 0x0c, 0xd1, 0x88, 0x49, 0x0b, 0x68, + 0xc0, 0xf3, 0x00, 0x12, 0x99, 0x20, 0x21, 0x46, 0x98, 0x47, 0xb4, 0xf8, + 0x38, 0x03, 0x20, 0xf0, 0x98, 0x00, 0xa4, 0xf8, 0x38, 0x03, 0xd4, 0xf8, + 0x0c, 0x03, 0x18, 0xb1, 0xb4, 0xf8, 0x84, 0x10, 0x89, 0x06, 0x02, 0xd4, + 0x00, 0x25, 0x28, 0x46, 0xfe, 0xbd, 0x7e, 0x4a, 0xb4, 0xf8, 0x14, 0x13, + 0x00, 0x8b, 0x12, 0x68, 0x90, 0x47, 0x00, 0x25, 0x90, 0xb1, 0x01, 0x28, + 0x2a, 0xd0, 0x02, 0x28, 0xf1, 0xd1, 0xd4, 0xf8, 0x0c, 0x13, 0xb4, 0xf8, + 0x14, 0x03, 0x09, 0x8b, 0x08, 0x1a, 0x01, 0x28, 0xe8, 0xd1, 0xb4, 0xf8, + 0x38, 0x03, 0x40, 0xf0, 0x80, 0x00, 0xa4, 0xf8, 0x38, 0x03, 0xe1, 0xe7, + 0xb4, 0xf8, 0x84, 0x00, 0x21, 0x46, 0x28, 0x22, 0x20, 0xf0, 0x20, 0x00, + 0xa4, 0xf8, 0x84, 0x00, 0x6b, 0x48, 0x03, 0x68, 0x98, 0x20, 0x98, 0x47, + 0x6e, 0x48, 0x94, 0xf8, 0x35, 0x11, 0x00, 0x23, 0x06, 0x68, 0xd4, 0xf8, + 0xd4, 0x00, 0x42, 0x7f, 0x12, 0x20, 0xcd, 0xe9, 0x00, 0x55, 0x02, 0x95, + 0xb0, 0x47, 0xc8, 0xe7, 0xd4, 0xf8, 0xd4, 0x10, 0xb4, 0xf8, 0xdc, 0x02, + 0xd4, 0xf8, 0x0c, 0x53, 0x49, 0x7f, 0x82, 0x00, 0x51, 0xb1, 0xd4, 0xf8, + 0x20, 0x13, 0x11, 0x44, 0x6a, 0x8b, 0x01, 0xeb, 0x82, 0x01, 0x21, 0xf0, + 0x70, 0x43, 0x95, 0xf8, 0x2c, 0x10, 0x0b, 0xe0, 0x95, 0xf8, 0x2c, 0x10, + 0xd4, 0xf8, 0x20, 0x33, 0x58, 0x4e, 0x02, 0xeb, 0x41, 0x02, 0x13, 0x44, + 0x6a, 0x8b, 0x03, 0xeb, 0x82, 0x03, 0x33, 0x40, 0xc4, 0xf8, 0x20, 0x33, + 0x02, 0x44, 0x23, 0xf0, 0x03, 0x03, 0x0a, 0x44, 0xb4, 0xf8, 0xe2, 0x12, + 0xa3, 0x66, 0xb2, 0xeb, 0xc1, 0x0f, 0x04, 0xd3, 0x6a, 0x8c, 0x12, 0x01, + 0x92, 0xb2, 0xc4, 0xf8, 0xf0, 0x20, 0xb4, 0xf8, 0x38, 0x23, 0x48, 0x4e, + 0x68, 0x27, 0x42, 0xf0, 0x08, 0x03, 0xa4, 0xf8, 0x38, 0x33, 0x94, 0xf8, + 0x35, 0x31, 0x13, 0xfb, 0x07, 0x63, 0xb3, 0xf8, 0x64, 0x60, 0x46, 0xf0, + 0x01, 0x06, 0xa3, 0xf8, 0x64, 0x60, 0xab, 0x8b, 0x98, 0x42, 0x0c, 0xd1, + 0xa8, 0x8c, 0xb4, 0xf8, 0xe4, 0x32, 0x83, 0x42, 0x02, 0xd1, 0x68, 0x8c, + 0x81, 0x42, 0x18, 0xd0, 0x42, 0xf0, 0x18, 0x00, 0xa4, 0xf8, 0x38, 0x03, + 0x13, 0xe0, 0x42, 0xf0, 0x18, 0x00, 0xa4, 0xf8, 0x38, 0x03, 0xb4, 0xf8, + 0x46, 0x04, 0x40, 0xf0, 0x02, 0x00, 0xa4, 0xf8, 0x46, 0x04, 0xb4, 0xf8, + 0x40, 0x04, 0x02, 0x28, 0x05, 0xd3, 0x00, 0x20, 0xa4, 0xf8, 0x42, 0x04, + 0x01, 0x20, 0xa4, 0xf8, 0x40, 0x04, 0x04, 0xf5, 0x30, 0x70, 0x29, 0x46, + 0x4c, 0x22, 0xf1, 0xf7, 0xb1, 0xff, 0x2f, 0x48, 0x2d, 0x21, 0x02, 0x68, + 0x2e, 0x48, 0x90, 0x47, 0x2e, 0x48, 0xaf, 0x8b, 0x95, 0xf8, 0x2c, 0x30, + 0x94, 0xf8, 0x35, 0x11, 0x06, 0x68, 0xd4, 0xf8, 0xd4, 0x00, 0x42, 0x7f, + 0x68, 0x8b, 0xad, 0x8c, 0xcd, 0xe9, 0x00, 0x07, 0x10, 0x20, 0x02, 0x95, + 0xb0, 0x47, 0xb4, 0xf8, 0xdc, 0x02, 0x40, 0x00, 0xc4, 0xf8, 0xf8, 0x00, + 0xb4, 0xf8, 0x38, 0x03, 0x40, 0xf0, 0x20, 0x00, 0xa4, 0xf8, 0x38, 0x03, + 0xd4, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0x30, 0xb1, 0x94, 0xf8, 0x3a, 0x03, + 0x00, 0xf0, 0xfc, 0x00, 0x02, 0x30, 0x84, 0xf8, 0x3a, 0x03, 0x1c, 0x48, + 0x00, 0x68, 0x80, 0x47, 0xc4, 0xf8, 0xd8, 0x00, 0xb4, 0xf8, 0x84, 0x00, + 0x20, 0xf0, 0x10, 0x00, 0xa4, 0xf8, 0x84, 0x00, 0x17, 0x48, 0x00, 0x78, + 0x20, 0xb1, 0x94, 0xf9, 0x82, 0x00, 0xb0, 0xf1, 0xff, 0x3f, 0x0d, 0xdc, + 0xd4, 0xf8, 0xf0, 0x00, 0x50, 0xb1, 0xb4, 0xf8, 0x82, 0x00, 0x08, 0x21, + 0x20, 0xf0, 0x80, 0x00, 0xa4, 0xf8, 0x82, 0x00, 0x0f, 0x48, 0x00, 0x78, + 0xdd, 0xf7, 0x9a, 0xff, 0xd4, 0xf8, 0x0c, 0x03, 0xe3, 0xf7, 0xfe, 0xfd, + 0x00, 0x20, 0x01, 0x25, 0xc4, 0xf8, 0x0c, 0x03, 0x05, 0xe7, 0x00, 0xbf, + 0xb0, 0xe6, 0x05, 0x00, 0xa8, 0xa0, 0x08, 0x00, 0xf8, 0xc9, 0x08, 0x00, + 0xfc, 0xff, 0xff, 0x0f, 0xf4, 0xa0, 0x08, 0x00, 0xfc, 0x70, 0x01, 0x00, + 0x10, 0xbb, 0x08, 0x00, 0xe0, 0xa0, 0x08, 0x00, 0x64, 0x34, 0x01, 0x00, + 0x67, 0x34, 0x01, 0x00, 0x0f, 0x48, 0x10, 0x49, 0x1a, 0x4a, 0x01, 0x60, + 0x0f, 0x48, 0x10, 0x49, 0x01, 0x60, 0x10, 0x48, 0x10, 0x49, 0x01, 0x60, + 0x10, 0x48, 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, 0x11, 0x49, 0x01, 0x60, + 0x11, 0x48, 0x12, 0x49, 0x40, 0xf8, 0x3c, 0x1f, 0x41, 0x62, 0x12, 0x49, + 0x42, 0x61, 0xc0, 0xe9, 0x0b, 0x21, 0xc0, 0xe9, 0x02, 0x21, 0x10, 0x49, + 0xc0, 0xe9, 0x0e, 0x21, 0x01, 0x64, 0x70, 0x47, 0x9c, 0xbb, 0x08, 0x00, + 0x49, 0x29, 0x04, 0x00, 0x98, 0xd1, 0x08, 0x00, 0x75, 0x2c, 0x04, 0x00, + 0xc0, 0xd1, 0x08, 0x00, 0xc9, 0x2c, 0x04, 0x00, 0xb0, 0xd1, 0x08, 0x00, + 0x3d, 0x2d, 0x04, 0x00, 0xcc, 0xd1, 0x08, 0x00, 0xc1, 0x2e, 0x04, 0x00, + 0x90, 0xcf, 0x08, 0x00, 0xc5, 0x2b, 0x04, 0x00, 0x7d, 0x27, 0x04, 0x00, + 0x19, 0x2c, 0x04, 0x00, 0x0d, 0x2d, 0x04, 0x00, 0x4f, 0xf2, 0x85, 0x6c, + 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf2, 0x15, 0x2c, + 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf2, 0x71, 0x7c, + 0xc1, 0xf2, 0x09, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf2, 0x69, 0x4c, + 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf6, 0x9b, 0x0c, + 0xc1, 0xf2, 0x08, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x70, 0xb5, 0x8a, 0x4c, + 0x20, 0x68, 0xb8, 0xb9, 0x87, 0x4d, 0x4d, 0x49, 0x4f, 0xf4, 0xa8, 0x76, + 0x95, 0xf8, 0x1c, 0x01, 0x09, 0x68, 0x10, 0xfb, 0x06, 0xf0, 0x88, 0x47, + 0x20, 0x60, 0x30, 0xb1, 0x95, 0xf8, 0x1c, 0x11, 0x11, 0xfb, 0x06, 0xf1, + 0xe0, 0xf7, 0x98, 0xf8, 0x20, 0x68, 0x18, 0xb9, 0x00, 0x20, 0xf9, 0x21, + 0xdd, 0xf7, 0xec, 0xfe, 0x03, 0x48, 0x00, 0x21, 0xc0, 0xe9, 0x00, 0x11, + 0xc0, 0xe9, 0x02, 0x11, 0x70, 0xbd, 0x00, 0xbf, 0xa8, 0x56, 0x01, 0x00, + 0xfe, 0xb5, 0x00, 0xb3, 0x1e, 0x4d, 0x04, 0x46, 0xdd, 0xe9, 0x0a, 0x60, + 0xdd, 0xe9, 0x08, 0xc7, 0x2d, 0x68, 0xcd, 0xe9, 0x00, 0x76, 0x02, 0x90, + 0x08, 0x46, 0x11, 0x46, 0x1a, 0x46, 0x63, 0x46, 0xa8, 0x47, 0x14, 0x28, + 0x0f, 0xdc, 0x10, 0xf1, 0x80, 0x01, 0x0c, 0xd0, 0x21, 0x6c, 0xca, 0x03, + 0x0a, 0xd4, 0x41, 0xf4, 0x80, 0x31, 0x84, 0xf8, 0x42, 0x01, 0x21, 0x64, + 0x73, 0x49, 0xc9, 0x78, 0x88, 0x40, 0xa4, 0xf8, 0x44, 0x01, 0xfe, 0xbd, + 0x2b, 0x49, 0x94, 0xf8, 0x1d, 0x21, 0x09, 0x68, 0xc2, 0xeb, 0x02, 0x12, + 0x01, 0xeb, 0x42, 0x11, 0x09, 0x89, 0x65, 0x29, 0x05, 0xd3, 0x02, 0x22, + 0xb1, 0xf5, 0xc8, 0x7f, 0x88, 0xbf, 0x01, 0x22, 0x01, 0xe0, 0x68, 0x49, + 0xca, 0x78, 0x05, 0x49, 0x0b, 0x68, 0x04, 0xf5, 0xa2, 0x71, 0x98, 0x47, + 0x84, 0xf8, 0x42, 0x01, 0xfe, 0xbd, 0x00, 0xbf, 0x1c, 0xb8, 0x08, 0x00, + 0x10, 0xb8, 0x08, 0x00, 0xb0, 0xb5, 0x19, 0x4d, 0x53, 0x49, 0x68, 0x68, + 0x01, 0xf2, 0xc3, 0x14, 0x40, 0xb9, 0x17, 0x48, 0x01, 0x68, 0x20, 0x78, + 0xc0, 0xeb, 0xc0, 0x00, 0x80, 0x00, 0x88, 0x47, 0x68, 0x60, 0xd8, 0xb1, + 0x21, 0x78, 0xc1, 0xeb, 0xc1, 0x01, 0x89, 0x00, 0xe0, 0xf7, 0xe2, 0xfc, + 0x10, 0x4d, 0x28, 0x68, 0x70, 0xb9, 0x20, 0x78, 0xc0, 0xeb, 0x00, 0x10, + 0x40, 0x01, 0x0f, 0xf0, 0xd3, 0xfe, 0x28, 0x60, 0x30, 0xb1, 0x21, 0x78, + 0xc1, 0xeb, 0x01, 0x11, 0x49, 0x01, 0x89, 0xb2, 0xe0, 0xf7, 0xd0, 0xfc, + 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x20, 0xb9, 0x00, 0x20, 0x40, 0xf2, + 0xa5, 0x11, 0xbd, 0xe8, 0xb0, 0x40, 0xe3, 0xf7, 0xcd, 0xbc, 0x00, 0xbf, + 0xec, 0xe5, 0x05, 0x00, 0xdc, 0x9b, 0x08, 0x00, 0xe0, 0x35, 0x01, 0x00, + 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0x14, 0xf9, 0x94, 0xf8, 0x35, 0x01, + 0x04, 0x49, 0x68, 0x22, 0x10, 0xfb, 0x02, 0x10, 0x03, 0x49, 0x89, 0x79, + 0x80, 0xf8, 0x50, 0x10, 0x10, 0xbd, 0x00, 0xbf, 0xb0, 0xe6, 0x05, 0x00, + 0x98, 0x32, 0x06, 0x00, 0x2d, 0xe9, 0xf0, 0x47, 0x29, 0x49, 0x27, 0x48, + 0x27, 0x4c, 0x09, 0x68, 0xc0, 0xe9, 0x00, 0x44, 0x88, 0x47, 0x27, 0x48, + 0x27, 0x49, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0xdf, 0xf8, 0x98, 0x80, + 0x98, 0xf8, 0x1c, 0x01, 0xc0, 0xb1, 0x25, 0x4f, 0xdf, 0xf8, 0x94, 0xa0, + 0x25, 0x4e, 0x00, 0x20, 0x01, 0x25, 0x4f, 0xf4, 0xa8, 0x79, 0x00, 0xfb, + 0x09, 0xf4, 0x38, 0x68, 0xda, 0xf8, 0x00, 0x10, 0x20, 0x44, 0x88, 0x47, + 0x38, 0x68, 0x31, 0x68, 0x20, 0x44, 0x88, 0x47, 0x98, 0xf8, 0x1c, 0x11, + 0x68, 0xb2, 0x01, 0x35, 0x88, 0x42, 0xee, 0xdb, 0x1b, 0x48, 0x00, 0x68, + 0x20, 0xb1, 0x00, 0x20, 0x40, 0xf2, 0xe3, 0x11, 0xe3, 0xf7, 0x7e, 0xfc, + 0x18, 0x48, 0x00, 0x24, 0x04, 0x70, 0x18, 0x48, 0x04, 0x80, 0x18, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x17, 0x49, 0x08, 0x70, 0x17, 0x48, 0x6f, 0xf0, + 0x7f, 0x41, 0x41, 0x60, 0x16, 0x49, 0x44, 0x72, 0x0c, 0x70, 0x98, 0xf8, + 0x54, 0x11, 0x01, 0x72, 0x14, 0x48, 0x00, 0x68, 0x80, 0x47, 0x14, 0x48, + 0x14, 0x49, 0x90, 0xf8, 0xca, 0x01, 0xc8, 0x70, 0xbd, 0xe8, 0xf0, 0x87, + 0xf4, 0x54, 0x01, 0x00, 0xd6, 0xbe, 0x89, 0x8e, 0x18, 0x8f, 0x08, 0x00, + 0x6c, 0xfb, 0x08, 0x00, 0x0c, 0x55, 0x01, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0xdc, 0x35, 0x01, 0x00, 0x3c, 0x9e, 0x08, 0x00, 0x40, 0x9e, 0x08, 0x00, + 0x08, 0xf0, 0x05, 0x00, 0x99, 0x53, 0x01, 0x00, 0xb2, 0x58, 0x01, 0x00, + 0xf4, 0x8e, 0x08, 0x00, 0x9a, 0x53, 0x01, 0x00, 0x24, 0x55, 0x01, 0x00, + 0x30, 0x55, 0x01, 0x00, 0xc4, 0xc4, 0x08, 0x00, 0x00, 0x69, 0x08, 0x00, + 0x48, 0xdc, 0x05, 0x00, 0x70, 0xb5, 0x1c, 0x4d, 0x04, 0x46, 0x28, 0x30, + 0x29, 0x68, 0x88, 0x47, 0x29, 0x68, 0x04, 0xf1, 0x3c, 0x00, 0x88, 0x47, + 0x29, 0x68, 0x04, 0xf1, 0x70, 0x00, 0x88, 0x47, 0x04, 0xf1, 0xe4, 0x00, + 0x00, 0xf0, 0x80, 0xf8, 0xd4, 0xf8, 0x84, 0x00, 0xc8, 0xb1, 0x13, 0x4e, + 0x72, 0xb6, 0x30, 0x68, 0x40, 0x00, 0x01, 0x30, 0x30, 0x60, 0xd4, 0xf8, + 0x84, 0x50, 0x55, 0xb1, 0x0f, 0x48, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, + 0x29, 0x7d, 0x00, 0x20, 0x28, 0x61, 0x28, 0x75, 0xc4, 0xf8, 0x84, 0x00, + 0xa9, 0x75, 0x30, 0x68, 0x40, 0x08, 0x30, 0x60, 0x30, 0x68, 0x80, 0xf3, + 0x10, 0x88, 0x11, 0x49, 0xd4, 0xf8, 0xdc, 0x00, 0x09, 0x68, 0x88, 0x47, + 0x20, 0x46, 0x4f, 0xf4, 0xa8, 0x71, 0xe0, 0xf7, 0xf9, 0xfb, 0x70, 0xbd, + 0x8c, 0xec, 0x08, 0x00, 0x24, 0x36, 0x01, 0x00, 0xc8, 0xa0, 0x08, 0x00, + 0xb0, 0xb5, 0x04, 0x46, 0x40, 0xb1, 0x07, 0x4d, 0xd4, 0xf8, 0x50, 0x04, + 0x29, 0x68, 0x88, 0x47, 0xd4, 0xf8, 0x4c, 0x04, 0x29, 0x68, 0x88, 0x47, + 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x47, 0xb8, 0x00, 0xbf, + 0x74, 0xc4, 0x08, 0x00, 0x0a, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, + 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, + 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, 0x0d, 0x49, 0x01, 0x60, 0x0d, 0x48, + 0x0d, 0x49, 0x01, 0x60, 0x0d, 0x48, 0x0e, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xf4, 0xb7, 0x08, 0x00, 0x39, 0x32, 0x04, 0x00, 0xc0, 0xb2, 0x08, 0x00, + 0xed, 0x31, 0x04, 0x00, 0xc4, 0xb2, 0x08, 0x00, 0xc1, 0x32, 0x04, 0x00, + 0x34, 0xc0, 0x08, 0x00, 0x35, 0x33, 0x04, 0x00, 0xb4, 0xb2, 0x08, 0x00, + 0x5d, 0x33, 0x04, 0x00, 0x3c, 0x9e, 0x08, 0x00, 0x4d, 0x34, 0x04, 0x00, + 0xb0, 0xb2, 0x08, 0x00, 0xcd, 0x34, 0x04, 0x00, 0x42, 0xf2, 0x6d, 0x7c, + 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf2, 0xab, 0x1c, + 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x46, 0xf6, 0xed, 0x3c, + 0xc1, 0xf2, 0x10, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf2, 0xad, 0x2c, + 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x70, 0xb5, 0x0d, 0x46, + 0x04, 0x46, 0x00, 0xf0, 0x51, 0xfa, 0x94, 0xf8, 0x88, 0x04, 0x80, 0x07, + 0x09, 0xd5, 0x17, 0x48, 0x4f, 0xf0, 0xff, 0x31, 0xb0, 0xf8, 0x1e, 0x05, + 0x03, 0x30, 0x20, 0xf0, 0x03, 0x00, 0x28, 0x44, 0x81, 0x60, 0x13, 0x48, + 0x00, 0x78, 0xb0, 0xb1, 0x12, 0x4a, 0x1c, 0x4b, 0x00, 0x21, 0x52, 0xf8, + 0x21, 0x50, 0x6d, 0xb1, 0x95, 0xf8, 0x88, 0x64, 0xb6, 0x07, 0x09, 0xd5, + 0x95, 0xf8, 0x35, 0x61, 0x95, 0xf8, 0xf6, 0x54, 0x15, 0xb1, 0xa3, 0xf8, + 0x4a, 0x66, 0x01, 0xe0, 0xa3, 0xf8, 0x48, 0x66, 0x01, 0x31, 0x81, 0x42, + 0xeb, 0xd3, 0x94, 0xf8, 0xa4, 0x04, 0x41, 0x07, 0x05, 0xd5, 0x00, 0x07, + 0x03, 0xd4, 0x05, 0x48, 0x4f, 0xf0, 0xff, 0x31, 0x01, 0x60, 0x70, 0xbd, + 0x8c, 0x7e, 0x08, 0x00, 0x5c, 0x34, 0x01, 0x00, 0x10, 0x61, 0x01, 0x00, + 0xbc, 0x11, 0x01, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0x18, 0xfa, + 0x94, 0xf8, 0xf6, 0x04, 0x00, 0x21, 0x00, 0x28, 0x03, 0x48, 0x0c, 0xbf, + 0xa0, 0xf8, 0x48, 0x16, 0xa0, 0xf8, 0x4a, 0x16, 0x10, 0xbd, 0x00, 0xbf, + 0x64, 0xd4, 0x05, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0x1b, 0x88, 0xdc, 0x07, + 0x41, 0xd1, 0x9c, 0x1e, 0x4f, 0xf0, 0x02, 0x08, 0x94, 0xfb, 0xf8, 0xf5, + 0x6c, 0xb2, 0x01, 0x2c, 0x39, 0xdb, 0x00, 0xf5, 0x97, 0x64, 0x00, 0x2a, + 0x40, 0xf2, 0xa7, 0x4e, 0x05, 0xf1, 0x01, 0x06, 0x4f, 0xf0, 0x00, 0x07, + 0x4f, 0xf0, 0x01, 0x0c, 0x1c, 0xbf, 0x00, 0xf5, 0x95, 0x64, 0x4f, 0xf0, + 0x01, 0x08, 0x01, 0xf1, 0x0b, 0x01, 0x18, 0xbf, 0x40, 0xf2, 0xa6, 0x4e, + 0x00, 0x2a, 0x18, 0xbf, 0x01, 0x22, 0x0d, 0x78, 0x0f, 0x2d, 0x19, 0xd8, + 0x11, 0xf8, 0x01, 0x3c, 0xfd, 0xb2, 0x9b, 0x08, 0x63, 0x55, 0x90, 0xf8, + 0xa4, 0x34, 0x43, 0xea, 0x08, 0x03, 0x80, 0xf8, 0xa4, 0x34, 0x0b, 0x78, + 0x2c, 0xea, 0xd3, 0x03, 0x93, 0x42, 0x03, 0xd0, 0x63, 0x5d, 0x43, 0xf0, + 0x40, 0x03, 0x63, 0x55, 0x01, 0x37, 0xfb, 0xb2, 0x00, 0xf8, 0x0e, 0x70, + 0x10, 0x2b, 0x04, 0xd0, 0x73, 0x1e, 0x02, 0x31, 0x5e, 0xb2, 0x01, 0x2e, + 0xdd, 0xdc, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, 0xf8, 0xb5, 0x07, 0x46, + 0x18, 0x88, 0x08, 0x28, 0x20, 0xd1, 0xd8, 0x88, 0x1c, 0x46, 0x04, 0x28, + 0x1c, 0xd1, 0x97, 0xf8, 0x88, 0x04, 0x15, 0x46, 0x0e, 0x46, 0x80, 0x07, + 0x0d, 0xd4, 0xdd, 0xf7, 0x99, 0xfc, 0x97, 0xf8, 0x35, 0x11, 0x13, 0x4a, + 0x01, 0xeb, 0x41, 0x01, 0x02, 0xeb, 0x41, 0x11, 0x08, 0x61, 0xd7, 0xf8, + 0xd4, 0x00, 0x40, 0x7f, 0x48, 0xb1, 0x38, 0x46, 0x31, 0x46, 0x2a, 0x46, + 0x23, 0x46, 0x01, 0xb0, 0xbd, 0xe8, 0xf0, 0x40, 0x00, 0xf0, 0xa0, 0xb9, + 0xf8, 0xbd, 0x20, 0x89, 0x19, 0x28, 0x01, 0xd0, 0x03, 0x28, 0xf0, 0xd1, + 0x97, 0xf8, 0x90, 0x00, 0x41, 0x07, 0xec, 0xd4, 0x05, 0x49, 0x91, 0xf8, + 0x4d, 0x10, 0x00, 0x29, 0xe7, 0xd1, 0x40, 0xf0, 0x04, 0x00, 0x87, 0xf8, + 0x90, 0x00, 0xe2, 0xe7, 0x54, 0xf1, 0x05, 0x00, 0x18, 0x74, 0x01, 0x00, + 0x2d, 0xe9, 0xf0, 0x41, 0x04, 0x46, 0x18, 0x88, 0x08, 0x28, 0x24, 0xd1, + 0xd8, 0x88, 0x1f, 0x46, 0x04, 0x28, 0x20, 0xd1, 0x06, 0x98, 0x00, 0x79, + 0x07, 0x28, 0x08, 0xbf, 0x00, 0x2a, 0x50, 0xd0, 0x00, 0x25, 0x9c, 0x4e, + 0x07, 0xf1, 0x0a, 0x08, 0x40, 0x46, 0x31, 0x68, 0x88, 0x47, 0x08, 0x37, + 0x31, 0x68, 0x38, 0x46, 0x88, 0x47, 0xd4, 0xf8, 0x88, 0x04, 0xc1, 0x03, + 0x2f, 0xd5, 0x96, 0x49, 0x00, 0xf4, 0x00, 0x60, 0x0a, 0x68, 0x29, 0x46, + 0x90, 0x47, 0xb4, 0xf8, 0xc8, 0x14, 0x20, 0xb1, 0xb8, 0xf8, 0x00, 0x00, + 0x02, 0xe0, 0xbd, 0xe8, 0xf0, 0x81, 0x38, 0x88, 0x81, 0x42, 0x1e, 0xd1, + 0x8e, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xd4, 0xf8, 0x88, 0x14, + 0x8c, 0x48, 0x0a, 0xb2, 0x08, 0x40, 0x00, 0x2a, 0xc4, 0xf8, 0x88, 0x04, + 0x01, 0xd4, 0x09, 0x02, 0x03, 0xd5, 0x40, 0xf0, 0x20, 0x00, 0xc4, 0xf8, + 0x88, 0x04, 0x20, 0xf4, 0x00, 0x60, 0x00, 0x21, 0xc4, 0xf8, 0x88, 0x04, + 0x84, 0x48, 0xc4, 0xf8, 0xc8, 0x14, 0x0c, 0x21, 0x00, 0x78, 0xdd, 0xf7, + 0x29, 0xfc, 0xd4, 0xf8, 0x88, 0x04, 0x01, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, + 0x2a, 0xdc, 0x7b, 0x49, 0x00, 0xf4, 0x80, 0x60, 0x0a, 0x68, 0x29, 0x46, + 0x90, 0x47, 0xb4, 0xf8, 0xd0, 0x14, 0x20, 0xb1, 0xb8, 0xf8, 0x00, 0x00, + 0x02, 0xe0, 0x01, 0x25, 0xad, 0xe7, 0x38, 0x88, 0x81, 0x42, 0x19, 0xd1, + 0xd4, 0xf8, 0x88, 0x04, 0x01, 0x02, 0x0c, 0xd4, 0x74, 0x49, 0x94, 0xf8, + 0x35, 0x01, 0x00, 0x22, 0x0b, 0x68, 0x01, 0x21, 0x98, 0x47, 0xd4, 0xf8, + 0x88, 0x04, 0x20, 0xf0, 0x20, 0x00, 0xc4, 0xf8, 0x88, 0x04, 0x20, 0xf4, + 0x04, 0x40, 0x0c, 0x21, 0xc4, 0xf8, 0x88, 0x04, 0x6a, 0x48, 0x00, 0x78, + 0xdd, 0xf7, 0xf8, 0xfb, 0x94, 0xf8, 0x8a, 0x04, 0x00, 0x06, 0x2e, 0xd5, + 0x63, 0x48, 0x29, 0x46, 0x02, 0x68, 0x00, 0x20, 0x90, 0x47, 0xb4, 0xf8, + 0xd6, 0x14, 0x10, 0xb1, 0xb8, 0xf8, 0x00, 0x00, 0x00, 0xe0, 0x38, 0x88, + 0x81, 0x42, 0x20, 0xd1, 0xb4, 0xf9, 0x88, 0x04, 0x00, 0x28, 0x0c, 0xd4, + 0x5e, 0x49, 0x94, 0xf8, 0x35, 0x01, 0x00, 0x22, 0x0b, 0x68, 0x01, 0x21, + 0x98, 0x47, 0xd4, 0xf8, 0x88, 0x04, 0x20, 0xf0, 0x20, 0x00, 0xc4, 0xf8, + 0x88, 0x04, 0x59, 0x48, 0x01, 0x21, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, + 0xd4, 0xf8, 0x88, 0x04, 0x0c, 0x21, 0x20, 0xf0, 0xc0, 0x70, 0xc4, 0xf8, + 0x88, 0x04, 0x51, 0x48, 0x00, 0x78, 0xdd, 0xf7, 0xc5, 0xfb, 0xd4, 0xf8, + 0x88, 0x04, 0x01, 0x07, 0x21, 0xd5, 0x4a, 0x49, 0x00, 0xf4, 0x80, 0x50, + 0x0a, 0x68, 0x29, 0x46, 0x90, 0x47, 0xb4, 0xf8, 0xce, 0x14, 0x10, 0xb1, + 0xb8, 0xf8, 0x00, 0x00, 0x00, 0xe0, 0x38, 0x88, 0x81, 0x42, 0x12, 0xd1, + 0x46, 0x49, 0x94, 0xf8, 0x35, 0x01, 0x00, 0x22, 0x0b, 0x68, 0x03, 0x21, + 0x98, 0x47, 0xd4, 0xf8, 0x88, 0x04, 0x41, 0xf2, 0x08, 0x01, 0x88, 0x43, + 0x0c, 0x21, 0xc4, 0xf8, 0x88, 0x04, 0x3e, 0x48, 0x00, 0x78, 0xdd, 0xf7, + 0x9f, 0xfb, 0xd4, 0xf8, 0x88, 0x04, 0x01, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, + 0x21, 0xdc, 0x36, 0x49, 0x00, 0xf4, 0x80, 0x60, 0x0a, 0x68, 0x29, 0x46, + 0x90, 0x47, 0xb4, 0xf8, 0xd0, 0x14, 0x10, 0xb1, 0xb8, 0xf8, 0x00, 0x00, + 0x00, 0xe0, 0x38, 0x88, 0x81, 0x42, 0x12, 0xd1, 0x32, 0x49, 0x94, 0xf8, + 0x35, 0x01, 0x00, 0x22, 0x0b, 0x68, 0x01, 0x21, 0x98, 0x47, 0xd4, 0xf8, + 0x88, 0x04, 0x48, 0xf2, 0x20, 0x41, 0x88, 0x43, 0x0c, 0x21, 0xc4, 0xf8, + 0x88, 0x04, 0x2a, 0x48, 0x00, 0x78, 0xdd, 0xf7, 0x77, 0xfb, 0xd4, 0xf8, + 0x88, 0x04, 0x41, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, 0x20, 0xdc, 0x22, 0x49, + 0x00, 0xf4, 0x00, 0x50, 0x0a, 0x68, 0x29, 0x46, 0x90, 0x47, 0xb4, 0xf8, + 0xd2, 0x14, 0x10, 0xb1, 0xb8, 0xf8, 0x00, 0x00, 0x00, 0xe0, 0x38, 0x88, + 0x81, 0x42, 0x11, 0xd1, 0x1e, 0x49, 0x94, 0xf8, 0x35, 0x01, 0x00, 0x22, + 0x0b, 0x68, 0x04, 0x21, 0x98, 0x47, 0xd4, 0xf8, 0x88, 0x04, 0x0c, 0x21, + 0x20, 0xf4, 0x02, 0x50, 0xc4, 0xf8, 0x88, 0x04, 0x16, 0x48, 0x00, 0x78, + 0xdd, 0xf7, 0x50, 0xfb, 0xd4, 0xf8, 0x88, 0x04, 0x81, 0x05, 0x7f, 0xf5, + 0xfe, 0xae, 0x0f, 0x49, 0x00, 0xf4, 0x80, 0x40, 0x0a, 0x68, 0x29, 0x46, + 0x90, 0x47, 0xb4, 0xf8, 0xd4, 0x14, 0x10, 0xb1, 0xb8, 0xf8, 0x00, 0x00, + 0x00, 0xe0, 0x38, 0x88, 0x81, 0x42, 0x7f, 0xf4, 0xee, 0xae, 0xd4, 0xf8, + 0x88, 0x04, 0x0c, 0x21, 0x20, 0xf4, 0x00, 0x70, 0xc4, 0xf8, 0x88, 0x04, + 0x06, 0x48, 0x00, 0x78, 0xbd, 0xe8, 0xf0, 0x41, 0xdd, 0xf7, 0x2e, 0xbb, + 0x2c, 0xd4, 0x08, 0x00, 0x34, 0xd4, 0x08, 0x00, 0x30, 0xd4, 0x08, 0x00, + 0xfd, 0xff, 0xfe, 0xff, 0x67, 0x34, 0x01, 0x00, 0x54, 0xd4, 0x08, 0x00, + 0x50, 0xd4, 0x08, 0x00, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, + 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xa8, 0xd4, 0x08, 0x00, 0x2d, 0x36, 0x04, 0x00, 0xb0, 0xd4, 0x08, 0x00, + 0x89, 0x35, 0x04, 0x00, 0xb4, 0xd4, 0x08, 0x00, 0x09, 0x36, 0x04, 0x00, + 0x54, 0xd5, 0x08, 0x00, 0xc1, 0x36, 0x04, 0x00, 0x5c, 0xd5, 0x08, 0x00, + 0x3d, 0x37, 0x04, 0x00, 0x48, 0xf2, 0xa5, 0x0c, 0xc1, 0xf2, 0x0a, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf2, 0xc1, 0x1c, 0xc1, 0xf2, 0x0a, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x47, 0xf2, 0x31, 0x6c, 0xc1, 0xf2, 0x0a, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x70, 0xb5, 0x17, 0x49, 0x09, 0x78, 0x81, 0xb1, + 0x16, 0x4b, 0x17, 0x4d, 0x00, 0x22, 0x01, 0x24, 0x53, 0xf8, 0x22, 0x60, + 0x96, 0xf8, 0xf9, 0x62, 0x1f, 0x2e, 0x03, 0xd8, 0x04, 0xfa, 0x06, 0xf6, + 0x2e, 0x42, 0x04, 0xd1, 0x01, 0x32, 0x8a, 0x42, 0xf2, 0xd3, 0x00, 0x22, + 0x00, 0xe0, 0x23, 0x22, 0xc0, 0x78, 0x07, 0x28, 0x01, 0xd3, 0x10, 0x28, + 0x0b, 0xd9, 0x11, 0x22, 0x01, 0x20, 0x40, 0xf6, 0x84, 0x41, 0xe3, 0xf7, + 0x1d, 0xf9, 0x18, 0xb1, 0xbd, 0xe8, 0x70, 0x40, 0xe3, 0xf7, 0xee, 0xb8, + 0x70, 0xbd, 0x00, 0x2a, 0xf2, 0xd1, 0x05, 0x49, 0x00, 0x22, 0x81, 0xf8, + 0xac, 0x00, 0xed, 0xe7, 0x5c, 0x34, 0x01, 0x00, 0x10, 0x61, 0x01, 0x00, + 0x80, 0x1f, 0x00, 0x80, 0xe8, 0x65, 0x08, 0x00, 0xbc, 0xb5, 0x04, 0x46, + 0x40, 0xf6, 0x84, 0x40, 0x81, 0x42, 0x17, 0xd0, 0x40, 0xf6, 0x1a, 0x40, + 0x81, 0x42, 0x0d, 0xd0, 0x40, 0xf6, 0x6d, 0x40, 0x81, 0x42, 0x14, 0xd0, + 0x40, 0xf2, 0x44, 0x40, 0x81, 0x42, 0x26, 0xd1, 0x4e, 0x48, 0x00, 0x78, + 0x00, 0x07, 0x27, 0xd4, 0x01, 0x20, 0x4d, 0xe0, 0xe0, 0x78, 0x10, 0xf0, + 0xfc, 0x0f, 0x53, 0xd0, 0x12, 0x20, 0x6e, 0xe0, 0x20, 0x46, 0xbd, 0xe8, + 0xbc, 0x40, 0xff, 0xf7, 0xa5, 0xbf, 0x3e, 0x48, 0x01, 0x21, 0x02, 0x68, + 0x40, 0xf6, 0x6d, 0x40, 0x90, 0x47, 0x00, 0x28, 0x67, 0xd0, 0x3b, 0x49, + 0x09, 0x79, 0x49, 0x06, 0x3e, 0xd5, 0xe1, 0x78, 0x00, 0x29, 0x61, 0xd0, + 0x01, 0x29, 0x39, 0xd1, 0x37, 0x49, 0x0a, 0x78, 0x42, 0xf0, 0x02, 0x02, + 0x5e, 0xe0, 0x20, 0x46, 0xbd, 0xe8, 0xbc, 0x40, 0x00, 0xf0, 0xbc, 0xb8, + 0x61, 0x7a, 0xa2, 0x7a, 0xe0, 0x7a, 0x23, 0x7b, 0x40, 0xea, 0x03, 0x20, + 0x41, 0xea, 0x02, 0x22, 0x83, 0xb2, 0x92, 0xb2, 0x9a, 0x42, 0x1a, 0xd3, + 0xc9, 0x07, 0x18, 0xd1, 0x22, 0x2b, 0x16, 0xd3, 0x4f, 0xf6, 0xfd, 0x71, + 0x8b, 0x42, 0x12, 0xd8, 0xc0, 0x07, 0x10, 0xd1, 0x60, 0x7b, 0xa1, 0x7b, + 0x40, 0xea, 0x01, 0x20, 0x99, 0x1c, 0x80, 0xb2, 0x81, 0x42, 0x08, 0xd8, + 0xc1, 0x07, 0x06, 0xd1, 0x29, 0x49, 0x0d, 0x68, 0x00, 0x90, 0xe1, 0x1c, + 0x00, 0x20, 0xa8, 0x47, 0x00, 0xe0, 0x12, 0x20, 0x26, 0x49, 0x0a, 0x68, + 0x40, 0xf2, 0x44, 0x41, 0x02, 0xb0, 0xbd, 0xe8, 0xb0, 0x40, 0x10, 0x47, + 0x11, 0x21, 0x29, 0xe0, 0x1a, 0x49, 0x82, 0x07, 0x01, 0xf1, 0x12, 0x01, + 0x0a, 0xd5, 0x19, 0x4b, 0x00, 0x22, 0x8a, 0x81, 0x0a, 0x80, 0x8a, 0x80, + 0x0a, 0x81, 0x1a, 0x80, 0x16, 0x4b, 0xc3, 0xe9, 0x00, 0x22, 0x1a, 0x81, + 0xc2, 0x07, 0x04, 0xd0, 0x00, 0x22, 0xca, 0x81, 0x4a, 0x80, 0xca, 0x80, + 0x4a, 0x81, 0x12, 0x49, 0x08, 0x70, 0x12, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x00, 0x20, 0x40, 0xf6, 0x1a, 0x41, 0xbd, 0xe8, 0xbc, 0x40, 0xe3, 0xf7, + 0x51, 0xb8, 0xbc, 0xbd, 0x07, 0x49, 0x0a, 0x78, 0x02, 0xf0, 0xfd, 0x02, + 0x0a, 0x70, 0x00, 0x21, 0x41, 0x71, 0xbd, 0xe8, 0xbc, 0x40, 0xe3, 0xf7, + 0x3f, 0xb8, 0x00, 0xbf, 0x28, 0x9c, 0x08, 0x00, 0xa8, 0x52, 0x01, 0x00, + 0xb0, 0x52, 0x01, 0x00, 0xc4, 0x79, 0x01, 0x00, 0x7e, 0xfa, 0x05, 0x00, + 0x74, 0xfa, 0x05, 0x00, 0x98, 0x58, 0x01, 0x00, 0xbc, 0xba, 0x08, 0x00, + 0xb8, 0x52, 0x01, 0x00, 0x74, 0xd8, 0x08, 0x00, 0xbc, 0x9b, 0x08, 0x00, + 0x10, 0xb5, 0x0c, 0x46, 0x58, 0xb1, 0x01, 0x46, 0x90, 0xf8, 0xfd, 0x02, + 0x40, 0x06, 0x07, 0xd4, 0x11, 0x48, 0x02, 0x68, 0x01, 0xf5, 0x80, 0x70, + 0x90, 0x47, 0x01, 0x46, 0x00, 0xe0, 0x00, 0x21, 0x08, 0x46, 0x21, 0x46, + 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x34, 0xb8, 0xb0, 0xb5, 0x05, 0x46, + 0x09, 0x48, 0x0c, 0x46, 0x00, 0x21, 0x02, 0x68, 0xe8, 0x1c, 0x90, 0x47, + 0x28, 0xb1, 0x90, 0xf8, 0xfa, 0x02, 0x80, 0x07, 0x44, 0xbf, 0x0c, 0x20, + 0xb0, 0xbd, 0x28, 0x46, 0x21, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, + 0x25, 0xb8, 0x00, 0xbf, 0xf0, 0xba, 0x08, 0x00, 0x04, 0x48, 0x05, 0x49, + 0x01, 0x60, 0x05, 0x48, 0x05, 0x49, 0x01, 0x60, 0x05, 0x48, 0x06, 0x49, + 0x01, 0x60, 0x70, 0x47, 0xac, 0xc0, 0x08, 0x00, 0x35, 0x3c, 0x04, 0x00, + 0x24, 0xe6, 0x08, 0x00, 0xc9, 0x3a, 0x04, 0x00, 0xa4, 0xc0, 0x08, 0x00, + 0x61, 0x3c, 0x04, 0x00, 0x43, 0xf6, 0xb5, 0x0c, 0xc1, 0xf2, 0x0a, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf2, 0x69, 0x5c, 0xc1, 0xf2, 0x0b, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf2, 0x5d, 0x3c, 0xc1, 0xf2, 0x0b, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xb0, 0xb5, 0x01, 0x23, 0x40, 0xf2, 0x44, 0x45, + 0x13, 0x70, 0x0c, 0x88, 0xac, 0x42, 0x07, 0xd0, 0x40, 0xf6, 0x84, 0x43, + 0x9c, 0x42, 0x08, 0xd1, 0x00, 0x20, 0x10, 0x70, 0x00, 0x20, 0xb0, 0xbd, + 0x2b, 0x48, 0x00, 0x78, 0x23, 0xea, 0x50, 0x00, 0xb0, 0xbd, 0xbd, 0xe8, + 0xb0, 0x40, 0x00, 0xf0, 0x8d, 0xb8, 0x00, 0xbf, 0x70, 0xb5, 0x90, 0xf8, + 0x3a, 0x60, 0x16, 0x2e, 0x1f, 0xd8, 0x04, 0x46, 0x14, 0xf9, 0x3c, 0x5f, + 0x28, 0x46, 0x00, 0xf0, 0x1f, 0xf8, 0xc0, 0xb1, 0x94, 0xf9, 0x01, 0x40, + 0x20, 0x46, 0x00, 0xf0, 0x19, 0xf8, 0x90, 0xb1, 0xac, 0x42, 0x10, 0xdb, + 0x08, 0x49, 0x60, 0x1b, 0x91, 0xf9, 0x00, 0x10, 0x88, 0x42, 0x0a, 0xdc, + 0x06, 0x49, 0x06, 0xeb, 0x46, 0x00, 0x01, 0xeb, 0x40, 0x10, 0xc1, 0x88, + 0x21, 0x44, 0xc1, 0x80, 0x01, 0x79, 0x01, 0x31, 0x01, 0x71, 0x70, 0xbd, + 0x7e, 0xd3, 0x05, 0x00, 0x54, 0xf1, 0x05, 0x00, 0x01, 0x46, 0x00, 0x20, + 0x1f, 0x29, 0x03, 0xdc, 0x11, 0xf1, 0x21, 0x0f, 0xc8, 0xbf, 0x01, 0x20, + 0x70, 0x47, 0x00, 0xbf, 0x80, 0xb5, 0x05, 0x48, 0x05, 0x49, 0x00, 0x68, + 0x08, 0x60, 0x08, 0xb1, 0xff, 0xf7, 0xc4, 0xff, 0xbd, 0xe8, 0x80, 0x40, + 0x00, 0xf0, 0x52, 0xb8, 0x4c, 0x76, 0x01, 0x00, 0x14, 0xf0, 0x05, 0x00, + 0x04, 0x49, 0x09, 0x78, 0x89, 0x07, 0x03, 0xd4, 0xc1, 0x7f, 0x01, 0xf0, + 0xf5, 0x01, 0xc1, 0x77, 0x70, 0x47, 0x00, 0xbf, 0xb8, 0x52, 0x01, 0x00, + 0x10, 0xb5, 0x0d, 0x4a, 0x00, 0x24, 0xb2, 0xf8, 0x1e, 0x35, 0x03, 0x33, + 0x23, 0xf0, 0x03, 0x03, 0x03, 0x44, 0xdc, 0x71, 0x9c, 0x71, 0x5c, 0x71, + 0x1c, 0x71, 0xb2, 0xf8, 0x1e, 0x25, 0x03, 0x32, 0x22, 0xf0, 0x03, 0x02, + 0x02, 0x44, 0xd4, 0x72, 0x94, 0x72, 0x54, 0x72, 0x14, 0x72, 0xbd, 0xe8, + 0x10, 0x40, 0x00, 0xf0, 0x2d, 0xb8, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, + 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0xc8, 0xb3, 0x08, 0x00, 0xe1, 0x3c, 0x04, 0x00, + 0x3c, 0xaa, 0x08, 0x00, 0x7d, 0x3d, 0x04, 0x00, 0xac, 0xb3, 0x08, 0x00, + 0x9d, 0x3d, 0x04, 0x00, 0x20, 0xb3, 0x08, 0x00, 0xb5, 0x3d, 0x04, 0x00, + 0x43, 0xf2, 0x65, 0x5c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x43, 0xf2, 0xc1, 0x3c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x43, 0xf2, 0x2d, 0x7c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x2d, 0xe9, 0xf0, 0x4f, 0x8b, 0xb0, 0xda, 0x4c, 0xdf, 0xf8, 0x0c, 0xb2, + 0x20, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x5b, 0xf8, 0x30, 0x80, 0x0b, 0xeb, + 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x00, 0xc1, 0x07, 0x0b, 0xd0, 0x00, 0x20, + 0x4f, 0xf4, 0xe0, 0x71, 0xdd, 0xf7, 0xc0, 0xf8, 0x20, 0x78, 0xc0, 0xeb, + 0x40, 0x10, 0x0b, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x00, 0x80, 0x07, + 0x04, 0xd5, 0x00, 0x20, 0x40, 0xf2, 0xc1, 0x11, 0xdd, 0xf7, 0xb2, 0xf8, + 0xb8, 0xf1, 0x00, 0x0f, 0x35, 0xd0, 0x73, 0x4a, 0x10, 0x68, 0xc0, 0x07, + 0x2e, 0xd0, 0xd2, 0xf8, 0x00, 0xa0, 0xd2, 0xf8, 0x00, 0x90, 0xd2, 0xf8, + 0xd4, 0x00, 0xc9, 0x49, 0x03, 0x90, 0x20, 0x78, 0xd2, 0xf8, 0xa4, 0x20, + 0x01, 0xeb, 0x40, 0x11, 0xc0, 0xeb, 0x40, 0x10, 0x0b, 0xeb, 0xc0, 0x00, + 0xca, 0x60, 0xb0, 0xf8, 0xdc, 0x10, 0x41, 0xf0, 0x01, 0x01, 0xa0, 0xf8, + 0xdc, 0x10, 0x66, 0x48, 0x05, 0x68, 0x66, 0x48, 0x01, 0x68, 0x04, 0xa8, + 0x88, 0x47, 0x04, 0xab, 0xa4, 0x46, 0xdd, 0xe9, 0x08, 0x64, 0x0a, 0x9f, + 0x0f, 0xcb, 0x00, 0x96, 0x66, 0x46, 0xcd, 0xe9, 0x01, 0x47, 0xa8, 0x47, + 0x5c, 0x4b, 0x5f, 0xea, 0x8a, 0x70, 0xd3, 0xf8, 0xd4, 0x10, 0x0a, 0xd4, + 0x0b, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0x20, 0x40, 0xf2, 0xc3, 0x11, + 0x0b, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0xe2, 0xf7, 0xd3, 0xbe, 0x4f, 0xfa, + 0x89, 0xf2, 0xb2, 0xf1, 0xff, 0x3f, 0x02, 0xdc, 0x03, 0x98, 0xc0, 0x03, + 0xec, 0xd5, 0xd3, 0xf8, 0xb4, 0x70, 0x30, 0x78, 0xb2, 0xf1, 0xff, 0x3f, + 0xc0, 0xeb, 0x40, 0x13, 0x07, 0xf0, 0x03, 0x04, 0x0b, 0xeb, 0xc3, 0x03, + 0x83, 0xf8, 0xa1, 0x40, 0xfc, 0xb2, 0xc4, 0xf3, 0xc0, 0x05, 0x83, 0xf8, + 0x9a, 0x50, 0xc7, 0xf3, 0x09, 0x25, 0xa3, 0xf8, 0xde, 0x50, 0xc4, 0xf3, + 0x40, 0x15, 0x83, 0xf8, 0xa2, 0x50, 0xc4, 0xf3, 0x00, 0x14, 0x83, 0xf8, + 0x99, 0x40, 0xc1, 0xf3, 0x03, 0x65, 0x4f, 0xf0, 0x01, 0x01, 0x83, 0xf8, + 0xe6, 0x50, 0x83, 0xf8, 0xa0, 0x10, 0x13, 0xdc, 0xb3, 0xf8, 0xdc, 0x10, + 0x00, 0xeb, 0x00, 0x10, 0x41, 0xf0, 0x40, 0x01, 0xa3, 0xf8, 0xdc, 0x10, + 0x97, 0x49, 0x01, 0xeb, 0xc0, 0x00, 0x8e, 0x49, 0x90, 0xf8, 0x84, 0x00, + 0x00, 0xeb, 0x40, 0x00, 0x51, 0xf8, 0x30, 0x00, 0x80, 0x47, 0x30, 0x78, + 0xc0, 0xeb, 0x40, 0x10, 0x0b, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0x4a, 0x10, + 0xc7, 0xf3, 0x80, 0x03, 0xc9, 0x07, 0x0d, 0xd0, 0x2b, 0xb1, 0xd8, 0xf8, + 0xb4, 0x15, 0x91, 0xf8, 0x6c, 0x10, 0x89, 0x07, 0x0b, 0xd4, 0x01, 0x46, + 0x31, 0xf8, 0xde, 0x2f, 0x05, 0x2a, 0x24, 0xbf, 0x04, 0x3a, 0x0a, 0x80, + 0x1b, 0xb9, 0x4f, 0xf0, 0x00, 0x09, 0x00, 0x27, 0x06, 0xe0, 0x81, 0x68, + 0x09, 0xb1, 0x0f, 0x78, 0x00, 0xe0, 0x00, 0x27, 0x4f, 0xf0, 0x01, 0x09, + 0x20, 0x49, 0xd1, 0xf8, 0xd8, 0x10, 0x49, 0x01, 0x2a, 0xd4, 0x90, 0xf8, + 0xa1, 0x20, 0xb0, 0xf8, 0xde, 0x10, 0x1f, 0x48, 0x04, 0x68, 0x28, 0x46, + 0x00, 0x97, 0xa0, 0x47, 0x00, 0xb3, 0x30, 0x78, 0xb9, 0xf1, 0x00, 0x0f, + 0xc0, 0xeb, 0x40, 0x10, 0x0b, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x10, + 0x41, 0xf0, 0x02, 0x01, 0xa0, 0xf8, 0xdc, 0x10, 0x08, 0xeb, 0x45, 0x00, + 0xb0, 0xf8, 0x92, 0x11, 0x01, 0xf1, 0x01, 0x01, 0xa0, 0xf8, 0x92, 0x11, + 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x0b, 0xeb, 0xc0, 0x00, 0x08, 0xd0, + 0x81, 0x68, 0x00, 0x29, 0x3f, 0xf4, 0x60, 0xaf, 0x49, 0x78, 0x04, 0xe0, + 0x00, 0xf0, 0x22, 0xfd, 0x5a, 0xe7, 0x98, 0xf8, 0x01, 0x10, 0x01, 0xf0, + 0x07, 0x01, 0x80, 0xf8, 0x9f, 0x10, 0xb0, 0xf8, 0xdc, 0x10, 0x41, 0xf0, + 0x04, 0x01, 0xa0, 0xf8, 0xdc, 0x10, 0x4d, 0xe7, 0x0c, 0x6f, 0x01, 0x00, + 0xdc, 0x10, 0x21, 0x40, 0x50, 0xbb, 0x08, 0x00, 0x14, 0xbb, 0x08, 0x00, + 0x88, 0xbb, 0x08, 0x00, 0xf8, 0xb5, 0x4f, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x00, 0x28, 0x7d, 0xd0, 0x4d, 0x4c, 0x4e, 0x4d, 0x4e, 0x49, 0x20, 0x78, + 0xc0, 0xeb, 0x40, 0x10, 0x05, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0x84, 0x00, + 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0xc0, 0x00, 0x40, 0x69, 0x80, 0x47, + 0x48, 0x48, 0x00, 0x68, 0x80, 0x47, 0x20, 0x78, 0xc0, 0xeb, 0x40, 0x10, + 0x05, 0xeb, 0xc0, 0x00, 0x00, 0x69, 0x00, 0x69, 0x80, 0x47, 0x44, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x43, 0x48, 0x00, 0x68, 0x80, 0x47, 0x21, 0x78, + 0x42, 0x4e, 0x4b, 0x01, 0xc1, 0xeb, 0x41, 0x12, 0xf3, 0x58, 0x05, 0xeb, + 0xc2, 0x00, 0xc0, 0xf8, 0x88, 0x30, 0x01, 0x23, 0x80, 0xf8, 0x8f, 0x30, + 0x3d, 0x4b, 0x1b, 0x68, 0x80, 0xf8, 0xe1, 0x30, 0x3c, 0x4b, 0x1b, 0x68, + 0x55, 0xf8, 0x32, 0x20, 0x80, 0xf8, 0xe2, 0x30, 0x6a, 0xb1, 0x92, 0xf8, + 0x4d, 0x34, 0x92, 0xf8, 0x35, 0x21, 0x80, 0xf8, 0x8d, 0x30, 0x37, 0x4b, + 0x02, 0xeb, 0xc2, 0x02, 0x03, 0xeb, 0x42, 0x02, 0x52, 0x78, 0x80, 0xf8, + 0x8c, 0x20, 0x34, 0x4e, 0x01, 0xeb, 0x01, 0x11, 0x90, 0xf8, 0x49, 0x20, + 0x06, 0xeb, 0xc1, 0x01, 0x91, 0xf8, 0x49, 0x30, 0x93, 0x42, 0x03, 0xd1, + 0x42, 0x68, 0x49, 0x68, 0x91, 0x42, 0x28, 0xd0, 0x01, 0x69, 0x49, 0x69, + 0x88, 0x47, 0x2c, 0x48, 0x01, 0x21, 0x01, 0x22, 0x07, 0x68, 0x20, 0x78, + 0x00, 0x91, 0xf8, 0x21, 0xc0, 0xeb, 0x40, 0x10, 0x05, 0xeb, 0xc0, 0x00, + 0x03, 0x46, 0xb8, 0x47, 0xee, 0xf7, 0x16, 0xfb, 0x28, 0xb1, 0x25, 0x48, + 0x25, 0x49, 0x00, 0x88, 0x40, 0xf0, 0x81, 0x00, 0x08, 0x60, 0x20, 0x78, + 0x23, 0x49, 0x00, 0xeb, 0x00, 0x10, 0x06, 0xeb, 0xc0, 0x00, 0x90, 0xf8, + 0x49, 0x00, 0xc0, 0xf3, 0x42, 0x10, 0x51, 0xf8, 0x20, 0x00, 0xbd, 0xe8, + 0xf8, 0x40, 0x00, 0x47, 0xf8, 0xbd, 0x19, 0x49, 0x01, 0x22, 0x03, 0x46, + 0x0d, 0x68, 0x01, 0x21, 0x00, 0x91, 0xf8, 0x21, 0xa8, 0x47, 0x19, 0x49, + 0x20, 0x78, 0x0a, 0x68, 0xf7, 0x49, 0x14, 0x46, 0x41, 0xf8, 0x20, 0x20, + 0xee, 0xf7, 0xee, 0xfa, 0x28, 0xb1, 0xf5, 0x48, 0xf5, 0x49, 0x00, 0x88, + 0x40, 0xf0, 0x91, 0x00, 0x08, 0x60, 0x20, 0x46, 0xe1, 0xe7, 0x00, 0xbf, + 0xfc, 0xd6, 0x08, 0x00, 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0x28, 0xd6, 0x08, 0x00, 0x10, 0xa1, 0x08, 0x00, 0x14, 0xa1, 0x08, 0x00, + 0xd0, 0xa0, 0x08, 0x00, 0xe0, 0x58, 0x01, 0x00, 0x0c, 0x22, 0x21, 0x40, + 0x10, 0x22, 0x21, 0x40, 0x44, 0x28, 0x01, 0x00, 0xfc, 0x6d, 0x01, 0x00, + 0x74, 0xb7, 0x08, 0x00, 0x26, 0x21, 0x01, 0x00, 0x04, 0x08, 0x00, 0x40, + 0xb8, 0xe6, 0x08, 0x00, 0xb0, 0xb7, 0x08, 0x00, 0x2d, 0xe9, 0xf8, 0x43, + 0xc8, 0x48, 0x00, 0x68, 0x80, 0x47, 0xc8, 0x4d, 0x00, 0x28, 0x29, 0x78, + 0x00, 0xf0, 0xb9, 0x80, 0xc6, 0x4f, 0x01, 0xeb, 0x81, 0x00, 0xc6, 0x4a, + 0x07, 0xeb, 0xc0, 0x00, 0xc1, 0x69, 0x11, 0x60, 0x28, 0x21, 0xdf, 0xf7, + 0x8f, 0xf8, 0xc3, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x28, 0x00, 0xf0, + 0x9f, 0x80, 0xdf, 0xf8, 0x04, 0x83, 0x40, 0xf2, 0x99, 0x20, 0xd8, 0xf8, + 0x00, 0x10, 0x88, 0x47, 0xbe, 0x48, 0x00, 0x68, 0x80, 0x47, 0xbe, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x28, 0x78, 0xbd, 0x4e, 0x00, 0xeb, 0x00, 0x10, + 0x06, 0xeb, 0xc0, 0x00, 0x01, 0x69, 0x49, 0x68, 0x88, 0x47, 0x00, 0x28, + 0x00, 0xf0, 0x92, 0x80, 0x04, 0x46, 0x00, 0xf0, 0xa1, 0xf9, 0x00, 0x28, + 0x00, 0xf0, 0x91, 0x80, 0xd7, 0x48, 0x00, 0x68, 0x80, 0x05, 0x00, 0xf1, + 0x91, 0x80, 0x00, 0xf0, 0x9f, 0xf9, 0x40, 0xb1, 0xb3, 0x49, 0x20, 0x22, + 0x28, 0x78, 0x0a, 0x60, 0xb2, 0x49, 0x01, 0xeb, 0x40, 0x10, 0x00, 0x21, + 0x01, 0x75, 0xb1, 0x48, 0xb2, 0x49, 0xdf, 0xf8, 0xc4, 0x92, 0x44, 0x71, + 0x28, 0x78, 0x09, 0x68, 0xd9, 0xf8, 0x00, 0x70, 0x00, 0xeb, 0x00, 0x10, + 0x06, 0xeb, 0xc0, 0x00, 0x40, 0x68, 0x88, 0x47, 0x29, 0x78, 0x02, 0x22, + 0x01, 0xeb, 0x01, 0x11, 0x06, 0xeb, 0xc1, 0x01, 0x00, 0x91, 0xa9, 0x49, + 0x00, 0xea, 0x01, 0x03, 0x00, 0x20, 0x01, 0x21, 0xb8, 0x47, 0xa7, 0x48, + 0x90, 0xf8, 0x5f, 0x02, 0x10, 0xb1, 0xa6, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x20, 0x46, 0x00, 0xf0, 0x7d, 0xf9, 0x28, 0x78, 0x00, 0xeb, 0x00, 0x10, + 0x06, 0xeb, 0xc0, 0x00, 0x02, 0x6a, 0x01, 0x69, 0x02, 0xeb, 0x44, 0x02, + 0xd9, 0xf8, 0x00, 0x40, 0x22, 0xf0, 0x70, 0x43, 0x9d, 0x4a, 0x12, 0x68, + 0x00, 0x90, 0x00, 0x20, 0x91, 0x42, 0x4f, 0xf0, 0x01, 0x02, 0x14, 0xbf, + 0x00, 0x21, 0x01, 0x21, 0xa0, 0x47, 0xd8, 0xf8, 0x00, 0x10, 0x40, 0xf2, + 0xf1, 0x20, 0x88, 0x47, 0x28, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x56, 0xf8, + 0x30, 0x00, 0x90, 0xf8, 0xb0, 0x15, 0x00, 0x29, 0x18, 0xbf, 0x01, 0x21, + 0x4a, 0x00, 0x00, 0x21, 0x17, 0xf0, 0x32, 0xfb, 0x28, 0x78, 0x85, 0x49, + 0xc0, 0xeb, 0x40, 0x10, 0x01, 0xeb, 0xc0, 0x00, 0x01, 0x69, 0x49, 0x69, + 0x88, 0x47, 0x00, 0xf0, 0x31, 0xf9, 0x00, 0x28, 0x00, 0xf0, 0xd8, 0x80, + 0x88, 0x49, 0x28, 0x78, 0x88, 0x4a, 0x09, 0x68, 0x42, 0xf8, 0x20, 0x10, + 0xee, 0xf7, 0x10, 0xfa, 0x00, 0x28, 0x00, 0xf0, 0xc7, 0x80, 0x85, 0x48, + 0x00, 0x88, 0x40, 0xf0, 0x98, 0x00, 0xd5, 0xe0, 0x29, 0x78, 0x01, 0xeb, + 0x81, 0x00, 0x07, 0xeb, 0xc0, 0x00, 0xc2, 0x69, 0x42, 0xf4, 0x00, 0x22, + 0xc2, 0x61, 0xc1, 0xeb, 0x41, 0x10, 0x3a, 0xe0, 0x7f, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x28, 0x78, 0x33, 0xe0, 0x00, 0xf0, 0x13, 0xf9, 0x00, 0x28, + 0x3f, 0xf4, 0x6a, 0xaf, 0x6a, 0x48, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, + 0x28, 0x78, 0x00, 0xeb, 0x00, 0x11, 0x56, 0xf8, 0x31, 0x20, 0x06, 0xeb, + 0xc1, 0x01, 0x9a, 0xb1, 0x92, 0xf8, 0x85, 0x31, 0x01, 0x33, 0x82, 0xf8, + 0x85, 0x31, 0x0a, 0x68, 0x62, 0xb1, 0xd2, 0xf8, 0xcc, 0x31, 0x23, 0xf0, + 0x0f, 0x03, 0xc2, 0xf8, 0xcc, 0x31, 0x0a, 0x68, 0xd2, 0xf8, 0xcc, 0x31, + 0x43, 0xf0, 0x06, 0x03, 0xc2, 0xf8, 0xcc, 0x31, 0x89, 0x68, 0x21, 0xb1, + 0xb1, 0xf8, 0x72, 0x20, 0x01, 0x32, 0xa1, 0xf8, 0x72, 0x20, 0x00, 0xeb, + 0x80, 0x01, 0x07, 0xeb, 0xc1, 0x01, 0xca, 0x69, 0x42, 0xf4, 0x00, 0x12, + 0xca, 0x61, 0xc0, 0xeb, 0x40, 0x10, 0x53, 0x49, 0x01, 0xeb, 0xc0, 0x00, + 0x01, 0x69, 0x49, 0x69, 0x88, 0x47, 0x4c, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x4d, 0x48, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0x28, 0x78, 0x4a, 0x4c, + 0x00, 0xeb, 0x00, 0x10, 0x54, 0xf8, 0x30, 0x10, 0x21, 0xb1, 0xb1, 0xf8, + 0x46, 0x21, 0x01, 0x32, 0xa1, 0xf8, 0x46, 0x21, 0x04, 0xeb, 0xc0, 0x01, + 0x91, 0xf8, 0x45, 0x20, 0x08, 0x69, 0xd2, 0x07, 0x53, 0x4a, 0x12, 0x68, + 0x39, 0xd1, 0x90, 0x42, 0x42, 0xd0, 0x53, 0x4a, 0x12, 0x68, 0x82, 0x42, + 0x03, 0xd1, 0x52, 0x48, 0x82, 0x88, 0x01, 0x32, 0x82, 0x80, 0x48, 0x68, + 0x00, 0x69, 0x00, 0xf0, 0xd1, 0xf8, 0x4f, 0x48, 0x29, 0x78, 0x32, 0x4e, + 0x00, 0x22, 0x07, 0x68, 0x01, 0x20, 0x00, 0x90, 0x01, 0xeb, 0x81, 0x00, + 0x01, 0xeb, 0x01, 0x11, 0x04, 0xeb, 0xc1, 0x03, 0x06, 0xeb, 0xc0, 0x00, + 0x28, 0x21, 0xb8, 0x47, 0x47, 0x48, 0x2c, 0x78, 0x3c, 0x49, 0x00, 0x68, + 0x41, 0xf8, 0x24, 0x00, 0xee, 0xf7, 0x78, 0xf9, 0x30, 0xb1, 0x3a, 0x48, + 0x3a, 0x49, 0x00, 0x88, 0x40, 0xf0, 0x99, 0x00, 0x08, 0x60, 0x2c, 0x78, + 0x04, 0xeb, 0x84, 0x00, 0x06, 0xeb, 0xc0, 0x00, 0x80, 0x7f, 0x00, 0x07, + 0x15, 0xd4, 0x3d, 0x48, 0x00, 0x21, 0x03, 0x22, 0x1b, 0xe0, 0x90, 0x42, + 0x08, 0xd0, 0x91, 0xf8, 0x40, 0x00, 0x34, 0x49, 0x00, 0xf0, 0x0f, 0x00, + 0x01, 0xeb, 0xc0, 0x00, 0x00, 0x79, 0x00, 0xe0, 0x01, 0x20, 0x00, 0xf0, + 0x83, 0xf8, 0x2c, 0x48, 0x00, 0x68, 0x80, 0x47, 0x0c, 0xe0, 0x01, 0x20, + 0x00, 0xf0, 0x7c, 0xf8, 0x28, 0x78, 0x1c, 0x49, 0x01, 0x22, 0x01, 0xeb, + 0x40, 0x10, 0xc1, 0x68, 0x2d, 0x48, 0x03, 0x68, 0x00, 0x20, 0x98, 0x47, + 0x2c, 0x48, 0x01, 0x68, 0x01, 0x20, 0xbd, 0xe8, 0xf8, 0x43, 0x08, 0x47, + 0x20, 0x49, 0x28, 0x78, 0x1c, 0x4a, 0x09, 0x68, 0x42, 0xf8, 0x20, 0x10, + 0xee, 0xf7, 0x38, 0xf9, 0x00, 0x28, 0xef, 0xd0, 0x19, 0x48, 0x00, 0x88, + 0x40, 0xf0, 0x97, 0x00, 0x18, 0x49, 0x08, 0x60, 0xe8, 0xe7, 0x00, 0xbf, + 0xc0, 0xe1, 0x08, 0x00, 0x74, 0x87, 0x08, 0x00, 0x84, 0x71, 0x01, 0x00, + 0x0c, 0x36, 0x01, 0x00, 0x94, 0xb7, 0x08, 0x00, 0xa8, 0xb7, 0x08, 0x00, + 0x14, 0xa1, 0x08, 0x00, 0x9c, 0xb7, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, + 0xf8, 0xa0, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0xc4, 0x20, 0x21, 0x40, + 0xe0, 0x58, 0x01, 0x00, 0xfc, 0x20, 0x01, 0x00, 0xf0, 0xa0, 0x08, 0x00, + 0xac, 0xa0, 0x08, 0x00, 0xfe, 0xff, 0xff, 0x0f, 0x8c, 0x7e, 0x08, 0x00, + 0xc4, 0xe1, 0x08, 0x00, 0x64, 0xb7, 0x08, 0x00, 0xc8, 0xe1, 0x08, 0x00, + 0xc0, 0x5d, 0x01, 0x00, 0x26, 0x21, 0x01, 0x00, 0x04, 0x08, 0x00, 0x40, + 0xcc, 0xe1, 0x08, 0x00, 0xf4, 0xd6, 0x08, 0x00, 0x58, 0xb7, 0x08, 0x00, + 0x86, 0x71, 0x0d, 0x10, 0x50, 0xb7, 0x08, 0x00, 0x64, 0x5b, 0x01, 0x00, + 0x74, 0xb7, 0x08, 0x00, 0xb4, 0xb7, 0x08, 0x00, 0xdc, 0xa0, 0x08, 0x00, + 0x90, 0xb7, 0x08, 0x00, 0x24, 0x48, 0xf1, 0x49, 0x00, 0x78, 0x01, 0xeb, + 0x40, 0x10, 0x00, 0x7d, 0x70, 0x47, 0x00, 0xbf, 0x04, 0x48, 0x00, 0x68, + 0x80, 0x06, 0x4f, 0xbf, 0x01, 0x20, 0x03, 0x48, 0x00, 0x68, 0xc0, 0xf3, + 0x40, 0x50, 0x70, 0x47, 0xcc, 0x20, 0x21, 0x40, 0xec, 0x10, 0x21, 0x40, + 0x10, 0xb5, 0x19, 0x49, 0xe5, 0x4b, 0x09, 0x78, 0x4a, 0x01, 0x03, 0xeb, + 0x41, 0x11, 0x9c, 0x58, 0x04, 0xeb, 0x40, 0x04, 0x24, 0xf0, 0x70, 0x44, + 0x9c, 0x50, 0xca, 0x68, 0x40, 0xf2, 0x71, 0x23, 0x10, 0xfb, 0x03, 0x20, + 0xc8, 0x60, 0x10, 0xbd, 0x10, 0xb5, 0x0f, 0x4a, 0x0f, 0x4b, 0xd2, 0x4c, + 0x12, 0x78, 0x1b, 0x68, 0x02, 0xeb, 0x82, 0x02, 0x44, 0xf8, 0x32, 0x00, + 0x04, 0xeb, 0xc2, 0x00, 0x00, 0x22, 0xc2, 0x75, 0x03, 0x74, 0x0a, 0x68, + 0x62, 0xb1, 0x92, 0xf8, 0x4c, 0x24, 0x42, 0x74, 0x07, 0x4a, 0x09, 0x68, + 0x91, 0xf8, 0x35, 0x11, 0x01, 0xeb, 0xc1, 0x01, 0x02, 0xeb, 0x41, 0x01, + 0x49, 0x78, 0xc1, 0x73, 0x10, 0xbd, 0x00, 0xbf, 0x74, 0x87, 0x08, 0x00, + 0x9c, 0x21, 0x21, 0x40, 0x44, 0x28, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, + 0xbd, 0x4f, 0x4f, 0xf4, 0x54, 0x70, 0x39, 0x68, 0x88, 0x47, 0xbc, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x00, 0x28, 0x00, 0xf0, 0xd6, 0x80, 0xf0, 0x4d, + 0xdf, 0xf8, 0xe4, 0x82, 0xb9, 0x4a, 0x28, 0x78, 0x00, 0xeb, 0x80, 0x00, + 0x08, 0xeb, 0xc0, 0x00, 0xc1, 0x69, 0x11, 0x60, 0x28, 0x21, 0xde, 0xf7, + 0x61, 0xfe, 0xb5, 0x48, 0x00, 0x68, 0x80, 0x47, 0x29, 0x78, 0x00, 0x28, + 0x44, 0xd0, 0xe8, 0x4e, 0x01, 0xeb, 0x01, 0x10, 0x06, 0xeb, 0xc0, 0x00, + 0x01, 0x69, 0x49, 0x68, 0x88, 0x47, 0x04, 0x46, 0x00, 0xf0, 0x86, 0xf9, + 0x00, 0x28, 0x40, 0xd0, 0x00, 0xf0, 0x82, 0xf9, 0x00, 0x28, 0x00, 0xf0, + 0xad, 0x80, 0x28, 0x78, 0xdd, 0x4a, 0xc0, 0xeb, 0x40, 0x11, 0x02, 0xeb, + 0xc1, 0x01, 0x00, 0x22, 0x81, 0xf8, 0x93, 0x20, 0x00, 0xeb, 0x00, 0x11, + 0x56, 0xf8, 0x31, 0x20, 0x06, 0xeb, 0xc1, 0x01, 0x9a, 0xb1, 0xd2, 0xf8, + 0xcc, 0x31, 0x23, 0xf0, 0x0f, 0x03, 0xc2, 0xf8, 0xcc, 0x31, 0x0a, 0x68, + 0xd2, 0xf8, 0xcc, 0x31, 0x43, 0xf0, 0x06, 0x03, 0xc2, 0xf8, 0xcc, 0x31, + 0x0a, 0x68, 0x22, 0xb1, 0x92, 0xf8, 0x85, 0x31, 0x01, 0x33, 0x82, 0xf8, + 0x85, 0x31, 0x89, 0x68, 0x21, 0xb1, 0xb1, 0xf8, 0x72, 0x20, 0x01, 0x32, + 0xa1, 0xf8, 0x72, 0x20, 0x00, 0xeb, 0x80, 0x00, 0x08, 0xeb, 0xc0, 0x00, + 0xc1, 0x69, 0x41, 0xf4, 0x00, 0x11, 0x06, 0xe0, 0x01, 0xeb, 0x81, 0x00, + 0x08, 0xeb, 0xc0, 0x00, 0xc1, 0x69, 0x41, 0xf4, 0x00, 0x21, 0xc1, 0x61, + 0x73, 0xe0, 0x00, 0x2c, 0xbc, 0xd0, 0x8c, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x28, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x56, 0xf8, 0x30, 0x00, 0x90, 0xf8, + 0xb0, 0x15, 0x00, 0x29, 0x18, 0xbf, 0x01, 0x21, 0x4a, 0x00, 0x00, 0x21, + 0x17, 0xf0, 0x24, 0xf9, 0x84, 0x48, 0x86, 0x49, 0xdf, 0xf8, 0x10, 0x92, + 0x44, 0x71, 0x28, 0x78, 0x09, 0x68, 0xd9, 0xf8, 0x00, 0x70, 0x00, 0xeb, + 0x00, 0x10, 0x06, 0xeb, 0xc0, 0x00, 0x40, 0x68, 0x88, 0x47, 0x29, 0x78, + 0x02, 0x22, 0x01, 0xeb, 0x01, 0x11, 0x06, 0xeb, 0xc1, 0x01, 0x00, 0x91, + 0x7c, 0x49, 0x00, 0xea, 0x01, 0x03, 0x00, 0x20, 0x01, 0x21, 0xb8, 0x47, + 0x28, 0x78, 0xdf, 0xf8, 0xe8, 0xa1, 0x7a, 0x49, 0x40, 0x01, 0x8b, 0x46, + 0x5a, 0xf8, 0x00, 0x00, 0x00, 0xeb, 0x44, 0x00, 0x08, 0x40, 0x77, 0x49, + 0x0a, 0x68, 0x4f, 0xf4, 0xf0, 0x71, 0x90, 0x47, 0x28, 0x78, 0xd9, 0xf8, + 0x00, 0x70, 0x02, 0x21, 0x01, 0x22, 0x00, 0xeb, 0x00, 0x10, 0x06, 0xeb, + 0xc0, 0x00, 0x03, 0x6a, 0x00, 0x90, 0x00, 0x20, 0xb8, 0x47, 0x2a, 0x78, + 0x99, 0x4f, 0x50, 0x01, 0x02, 0xeb, 0x82, 0x01, 0x5a, 0xf8, 0x00, 0x00, + 0x48, 0xf8, 0x31, 0x00, 0xc2, 0xeb, 0x42, 0x11, 0x02, 0xeb, 0x02, 0x12, + 0x06, 0xeb, 0xc2, 0x02, 0x07, 0xeb, 0xc1, 0x01, 0x91, 0xf8, 0x49, 0x30, + 0x92, 0xf8, 0x49, 0x60, 0x9e, 0x42, 0x7a, 0xd1, 0x4b, 0x68, 0x56, 0x68, + 0x9e, 0x42, 0x76, 0xd1, 0x91, 0xf8, 0x84, 0x30, 0x92, 0xf8, 0x84, 0x20, + 0x9a, 0x42, 0x70, 0xd1, 0x00, 0x20, 0x81, 0xf8, 0x93, 0x00, 0x77, 0xe0, + 0x62, 0x48, 0x00, 0x68, 0x80, 0x47, 0x39, 0x68, 0x40, 0xf2, 0xbd, 0x30, + 0x88, 0x47, 0x60, 0x48, 0x00, 0x68, 0x80, 0x47, 0x81, 0x4c, 0xdf, 0xf8, + 0x38, 0x91, 0x20, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x59, 0xf8, 0x30, 0x00, + 0x20, 0xb1, 0xb0, 0xf8, 0x46, 0x11, 0x02, 0x31, 0xa0, 0xf8, 0x46, 0x11, + 0x58, 0x48, 0x4f, 0xf0, 0x00, 0x08, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, + 0x20, 0x78, 0x78, 0x4f, 0x4f, 0xf0, 0x01, 0x0a, 0xc0, 0xeb, 0x40, 0x10, + 0x07, 0xeb, 0xc0, 0x00, 0x01, 0x69, 0x80, 0xf8, 0x92, 0xa0, 0x49, 0x69, + 0x88, 0x47, 0x20, 0x78, 0x47, 0x4d, 0xf8, 0x21, 0x01, 0x22, 0xc0, 0xeb, + 0x40, 0x10, 0x2e, 0x68, 0xcd, 0xf8, 0x00, 0x80, 0x07, 0xeb, 0xc0, 0x00, + 0x03, 0x46, 0xb0, 0x47, 0x21, 0x78, 0x3d, 0x4a, 0x48, 0x01, 0x01, 0xeb, + 0x01, 0x11, 0x10, 0x58, 0x09, 0xeb, 0xc1, 0x01, 0xff, 0xf7, 0xb8, 0xfe, + 0x21, 0x78, 0x2f, 0x4a, 0x2d, 0x68, 0xcd, 0xf8, 0x00, 0xa0, 0x01, 0xeb, + 0x81, 0x00, 0x01, 0xeb, 0x01, 0x11, 0x02, 0xeb, 0xc0, 0x00, 0x09, 0xeb, + 0xc1, 0x03, 0x28, 0x21, 0x00, 0x22, 0xa8, 0x47, 0x3c, 0x49, 0x20, 0x78, + 0x35, 0x4a, 0x09, 0x68, 0x42, 0xf8, 0x20, 0x10, 0xed, 0xf7, 0x60, 0xff, + 0x28, 0xb1, 0x33, 0x48, 0x33, 0x49, 0x00, 0x88, 0x40, 0xf0, 0xb1, 0x00, + 0x08, 0x60, 0x36, 0x48, 0x00, 0x21, 0x03, 0x22, 0x03, 0x68, 0x00, 0x20, + 0x98, 0x47, 0x34, 0x48, 0x01, 0x68, 0x00, 0x20, 0xbd, 0xe8, 0xf8, 0x4f, + 0x08, 0x47, 0x61, 0x00, 0x08, 0x44, 0x25, 0x49, 0x00, 0xea, 0x0b, 0x00, + 0x09, 0x68, 0x88, 0x47, 0x10, 0xb1, 0x20, 0x46, 0xff, 0xf7, 0x6e, 0xfe, + 0x28, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, 0x01, 0x69, + 0x49, 0x69, 0x88, 0x47, 0x1d, 0x48, 0x01, 0x21, 0x01, 0x22, 0x04, 0x68, + 0x28, 0x78, 0x00, 0x91, 0xf8, 0x21, 0xc0, 0xeb, 0x40, 0x10, 0x07, 0xeb, + 0xc0, 0x00, 0x03, 0x46, 0xa0, 0x47, 0x18, 0x49, 0x28, 0x78, 0x18, 0x4a, + 0x09, 0x68, 0x42, 0xf8, 0x20, 0x10, 0xed, 0xf7, 0x25, 0xff, 0x00, 0x28, + 0xcf, 0xd0, 0x15, 0x48, 0x15, 0x49, 0x00, 0x88, 0x40, 0xf0, 0xb8, 0x00, + 0x08, 0x60, 0xc8, 0xe7, 0xa8, 0xb7, 0x08, 0x00, 0xd4, 0xe1, 0x08, 0x00, + 0x84, 0x71, 0x01, 0x00, 0x0c, 0x36, 0x01, 0x00, 0x94, 0xb7, 0x08, 0x00, + 0xfc, 0x6d, 0x01, 0x00, 0x9c, 0xb7, 0x08, 0x00, 0xfc, 0x20, 0x01, 0x00, + 0xf0, 0xa0, 0x08, 0x00, 0xac, 0xa0, 0x08, 0x00, 0xfe, 0xff, 0xff, 0x0f, + 0xe0, 0x58, 0x01, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xcc, 0xa0, 0x08, 0x00, + 0xd0, 0xe1, 0x08, 0x00, 0x74, 0xb7, 0x08, 0x00, 0xd8, 0xe1, 0x08, 0x00, + 0xc0, 0x5d, 0x01, 0x00, 0x26, 0x21, 0x01, 0x00, 0x04, 0x08, 0x00, 0x40, + 0xf4, 0xd6, 0x08, 0x00, 0x14, 0xa1, 0x08, 0x00, 0xf8, 0xa0, 0x08, 0x00, + 0xa4, 0xb7, 0x08, 0x00, 0xdc, 0xa0, 0x08, 0x00, 0x90, 0xb7, 0x08, 0x00, + 0x05, 0x48, 0x00, 0x68, 0x10, 0xf4, 0x08, 0x7f, 0x11, 0xbf, 0x01, 0x20, + 0x03, 0x48, 0x00, 0x68, 0xc0, 0xf3, 0x40, 0x50, 0x70, 0x47, 0x00, 0xbf, + 0xcc, 0x20, 0x21, 0x40, 0xec, 0x10, 0x21, 0x40, 0xb0, 0xb5, 0x06, 0x4c, + 0xa5, 0x88, 0x00, 0xf0, 0x5f, 0xf8, 0xa0, 0x88, 0x85, 0x42, 0x03, 0xd0, + 0x03, 0x48, 0x41, 0x68, 0x01, 0x31, 0x41, 0x60, 0xb0, 0xbd, 0x00, 0xbf, + 0x04, 0x78, 0x01, 0x00, 0x84, 0xf0, 0x05, 0x00, 0x80, 0xb5, 0x00, 0xf0, + 0x55, 0xf8, 0x0b, 0x48, 0x0b, 0x4a, 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x11, + 0x02, 0xeb, 0xc1, 0x01, 0x91, 0xf8, 0xee, 0x10, 0xc9, 0x06, 0x0a, 0xd5, + 0x07, 0x49, 0x00, 0xeb, 0x00, 0x10, 0x51, 0xf8, 0x30, 0x00, 0x20, 0xb1, + 0x90, 0xf8, 0x85, 0x11, 0x01, 0x31, 0x80, 0xf8, 0x85, 0x11, 0x80, 0xbd, + 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0xfc, 0x6d, 0x01, 0x00, + 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, 0x0a, 0x49, 0x81, 0x62, + 0x0a, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0b, 0x49, 0x01, 0x60, + 0x0b, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, 0x0c, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0xb8, 0xb7, 0x08, 0x00, 0x7d, 0x40, 0x04, 0x00, + 0x28, 0xd6, 0x08, 0x00, 0x51, 0x3e, 0x04, 0x00, 0xf8, 0xd6, 0x08, 0x00, + 0x01, 0x42, 0x04, 0x00, 0xa8, 0xe3, 0x08, 0x00, 0x51, 0x46, 0x04, 0x00, + 0xcc, 0xe1, 0x08, 0x00, 0xd5, 0x49, 0x04, 0x00, 0x9c, 0xe3, 0x08, 0x00, + 0xf9, 0x49, 0x04, 0x00, 0x4a, 0xf6, 0x5f, 0x0c, 0xc1, 0xf2, 0x0a, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf2, 0xc7, 0x1c, 0xc1, 0xf2, 0x0b, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf2, 0xb5, 0x7c, 0xc1, 0xf2, 0x0a, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xb0, 0xb5, 0x05, 0x46, 0x11, 0x48, 0x0c, 0x46, + 0x00, 0x21, 0x01, 0x60, 0x10, 0x48, 0x01, 0x60, 0x11, 0xf0, 0x7a, 0xf9, + 0x04, 0x2c, 0x12, 0xd8, 0x0e, 0x48, 0x0f, 0x49, 0x00, 0x5d, 0x0a, 0x68, + 0x40, 0x00, 0x22, 0xf0, 0x7f, 0x62, 0xc0, 0xb2, 0x42, 0xea, 0x00, 0x52, + 0x0a, 0x60, 0xd1, 0xf8, 0x90, 0x20, 0x22, 0xf0, 0x7f, 0x62, 0x42, 0xea, + 0x00, 0x50, 0xc1, 0xf8, 0x90, 0x00, 0x28, 0x46, 0x21, 0x46, 0xbd, 0xe8, + 0xb0, 0x40, 0x00, 0xf0, 0x1f, 0xba, 0x00, 0xbf, 0x10, 0xd6, 0x05, 0x30, + 0x10, 0xee, 0x05, 0x30, 0x75, 0x14, 0x01, 0x00, 0x00, 0xc2, 0x23, 0x40, + 0x10, 0xb5, 0x1c, 0x21, 0x04, 0x46, 0xde, 0xf7, 0x17, 0xfc, 0x2a, 0x48, + 0x00, 0x68, 0x60, 0x76, 0x27, 0x48, 0x00, 0x68, 0xc0, 0xf3, 0x40, 0x00, + 0x20, 0x76, 0x27, 0x48, 0x00, 0x68, 0x00, 0xf0, 0x08, 0x01, 0x20, 0x46, + 0x00, 0xf0, 0x02, 0xf8, 0x10, 0xbd, 0x00, 0xbf, 0xb0, 0xb5, 0x0e, 0x4c, + 0x00, 0x23, 0x22, 0x68, 0xd2, 0xb2, 0xc0, 0xe9, 0x01, 0x32, 0x1a, 0xb1, + 0x25, 0x68, 0xc5, 0xf3, 0x00, 0x65, 0x00, 0xe0, 0x00, 0x25, 0x05, 0x75, + 0x25, 0x6c, 0xed, 0xb2, 0xc0, 0xe9, 0x03, 0x35, 0x15, 0xb1, 0x23, 0x6c, + 0xc3, 0xf3, 0x00, 0x63, 0x43, 0x75, 0x19, 0xb1, 0xd1, 0x1c, 0x81, 0x60, + 0xe9, 0x1c, 0x01, 0x61, 0xb0, 0xbd, 0x00, 0xbf, 0xa8, 0xc2, 0x23, 0x40, + 0xb0, 0xb5, 0x0d, 0x46, 0x1c, 0x21, 0x04, 0x46, 0xde, 0xf7, 0xe0, 0xfb, + 0x6d, 0xb1, 0x0d, 0x48, 0x00, 0x68, 0xc0, 0xf3, 0x40, 0x00, 0x20, 0x76, + 0x95, 0xf8, 0xb0, 0x05, 0x01, 0x28, 0x05, 0xd1, 0x0b, 0x48, 0x00, 0x68, + 0x60, 0x76, 0x0b, 0x48, 0x04, 0xe0, 0xb0, 0xbd, 0x06, 0x48, 0x00, 0x68, + 0x60, 0x76, 0x06, 0x48, 0x00, 0x68, 0x00, 0xf0, 0x08, 0x01, 0x20, 0x46, + 0xff, 0xf7, 0xc0, 0xff, 0xb0, 0xbd, 0x00, 0xbf, 0xf8, 0x95, 0x23, 0x40, + 0x9c, 0x21, 0x21, 0x40, 0x3c, 0x20, 0x21, 0x40, 0x3c, 0x10, 0x21, 0x40, + 0x54, 0x10, 0x21, 0x40, 0xb0, 0xb5, 0x1c, 0x21, 0x04, 0x46, 0xde, 0xf7, + 0xb5, 0xfb, 0x13, 0x48, 0x15, 0x4b, 0x00, 0x22, 0x00, 0x68, 0x60, 0x76, + 0x11, 0x48, 0x00, 0x68, 0xc0, 0xf3, 0x40, 0x00, 0x20, 0x76, 0x10, 0x48, + 0x00, 0x68, 0x19, 0x68, 0xc9, 0xb2, 0xc4, 0xe9, 0x01, 0x21, 0x19, 0xb1, + 0x1d, 0x68, 0xc5, 0xf3, 0x00, 0x65, 0x00, 0xe0, 0x00, 0x25, 0x25, 0x75, + 0x1d, 0x6c, 0xed, 0xb2, 0xc4, 0xe9, 0x03, 0x25, 0x15, 0xb1, 0x1a, 0x6c, + 0xc2, 0xf3, 0x00, 0x62, 0x00, 0x07, 0x62, 0x75, 0x03, 0xd5, 0xc8, 0x1c, + 0xa0, 0x60, 0xe8, 0x1c, 0x20, 0x61, 0xb0, 0xbd, 0xa0, 0x21, 0x21, 0x40, + 0xfc, 0x95, 0x23, 0x40, 0x8c, 0x20, 0x21, 0x40, 0xc8, 0xc2, 0x23, 0x40, + 0x2d, 0xe9, 0xfe, 0x4f, 0x5d, 0x48, 0x01, 0x68, 0x5d, 0x48, 0x88, 0x47, + 0x84, 0x4f, 0x5d, 0x4a, 0x85, 0x4c, 0x5e, 0x4d, 0x38, 0x78, 0x00, 0xeb, + 0x00, 0x11, 0x02, 0xeb, 0xc1, 0x01, 0x5a, 0x4a, 0x49, 0x68, 0x16, 0x68, + 0xa2, 0x6a, 0x8a, 0x42, 0x2a, 0xd0, 0x59, 0x48, 0x01, 0x68, 0xa9, 0x60, + 0x41, 0x68, 0xe9, 0x60, 0x80, 0x68, 0x28, 0x61, 0x56, 0x48, 0x01, 0x68, + 0x56, 0x48, 0x00, 0x69, 0x14, 0x30, 0x88, 0x47, 0x02, 0x46, 0x02, 0x90, + 0x38, 0x78, 0x54, 0x49, 0x51, 0xf8, 0x20, 0x00, 0x80, 0x7d, 0x02, 0x28, + 0x29, 0xd1, 0x52, 0x48, 0x94, 0xf8, 0x32, 0x10, 0x00, 0x78, 0x89, 0x07, + 0x06, 0xd5, 0x50, 0x49, 0x50, 0x4b, 0x91, 0xf8, 0x0e, 0x13, 0x59, 0x5c, + 0x88, 0x42, 0x01, 0xd3, 0x01, 0x46, 0xa8, 0xb1, 0x4d, 0x48, 0x02, 0x68, + 0x02, 0xa8, 0x90, 0x47, 0x02, 0x9a, 0x14, 0xe0, 0x68, 0x49, 0x01, 0xeb, + 0x40, 0x10, 0x10, 0xf8, 0x16, 0x3f, 0x02, 0x46, 0x52, 0xf8, 0x06, 0x1d, + 0x9b, 0xb1, 0x00, 0x23, 0x03, 0x70, 0x48, 0x1c, 0x20, 0xf0, 0x70, 0x41, + 0x11, 0x60, 0x0c, 0xe0, 0x02, 0xf5, 0x80, 0x30, 0x20, 0xf0, 0x70, 0x42, + 0x02, 0x92, 0x41, 0x48, 0x11, 0x46, 0x03, 0x68, 0x40, 0x48, 0x98, 0x47, + 0x40, 0x49, 0x08, 0x40, 0x01, 0x1d, 0x40, 0x48, 0x02, 0x91, 0x02, 0x68, + 0x3f, 0x48, 0x08, 0x30, 0x90, 0x47, 0x4f, 0xf4, 0x80, 0x70, 0x20, 0xea, + 0x06, 0x21, 0x3d, 0x48, 0x29, 0x60, 0x00, 0x68, 0xc0, 0x07, 0x4f, 0xd0, + 0x3b, 0x48, 0x90, 0xf8, 0x06, 0xe0, 0xbe, 0xf1, 0x00, 0x0f, 0x49, 0xd0, + 0x38, 0x78, 0x01, 0x91, 0x4e, 0x49, 0x39, 0x4f, 0x3b, 0x4c, 0x4f, 0xf0, + 0x07, 0x0b, 0x00, 0x22, 0x40, 0x01, 0x0e, 0x58, 0x36, 0x49, 0x34, 0x48, + 0x88, 0x46, 0x36, 0x49, 0x90, 0xf8, 0x00, 0xa0, 0x00, 0x20, 0x89, 0x46, + 0x41, 0x46, 0x68, 0x60, 0x28, 0x60, 0x45, 0xf8, 0x08, 0x60, 0x45, 0xf8, + 0x09, 0xb0, 0x00, 0x23, 0x49, 0x46, 0xd5, 0xf8, 0x00, 0xc0, 0x5f, 0xea, + 0xcc, 0x31, 0x03, 0xd4, 0x01, 0x33, 0xb3, 0xf5, 0x16, 0x6f, 0xf6, 0xd1, + 0x21, 0x68, 0x3b, 0x68, 0x99, 0x42, 0x99, 0xbf, 0x39, 0x68, 0x23, 0x68, + 0x21, 0x68, 0x3b, 0x68, 0xcb, 0x1a, 0x73, 0x45, 0x02, 0xd3, 0x39, 0x68, + 0x51, 0x45, 0x0d, 0xd1, 0x35, 0x49, 0x36, 0x4b, 0x01, 0x32, 0x06, 0xf5, + 0x80, 0x56, 0x10, 0x2a, 0x09, 0x78, 0x03, 0xeb, 0x41, 0x11, 0x49, 0x88, + 0x61, 0xf3, 0x10, 0x46, 0xd2, 0xd1, 0x07, 0xe0, 0x2e, 0x48, 0x2f, 0x49, + 0x00, 0x78, 0x40, 0x01, 0x0e, 0x50, 0x17, 0x49, 0x38, 0x68, 0x08, 0x70, + 0x01, 0x98, 0x28, 0x60, 0xbd, 0xe8, 0xfe, 0x8f, 0x04, 0xba, 0x08, 0x00, + 0x8e, 0x58, 0x01, 0x00, 0xfc, 0x6d, 0x01, 0x00, 0x68, 0xf0, 0x05, 0x00, + 0x88, 0x21, 0x21, 0x40, 0xa0, 0x59, 0x01, 0x00, 0xec, 0xb9, 0x08, 0x00, + 0xfc, 0x73, 0x01, 0x00, 0xb8, 0x5d, 0x01, 0x00, 0x94, 0x58, 0x01, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0xb3, 0xd8, 0x01, 0x10, 0xd0, 0xb9, 0x08, 0x00, + 0xc0, 0xb9, 0x08, 0x00, 0xc8, 0x5d, 0x01, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0x00, 0xba, 0x08, 0x00, 0x60, 0x86, 0x01, 0x00, 0x04, 0x10, 0x00, 0x40, + 0x8c, 0x32, 0x06, 0x00, 0x20, 0xf0, 0x05, 0x00, 0x9c, 0x21, 0x11, 0x40, + 0x98, 0xfe, 0xff, 0xff, 0x88, 0xfe, 0xff, 0xff, 0x9c, 0x21, 0x01, 0x40, + 0x80, 0xb5, 0x00, 0xf0, 0x93, 0xf8, 0x02, 0x48, 0x02, 0x49, 0x00, 0x68, + 0x08, 0x60, 0x80, 0xbd, 0x24, 0x20, 0x00, 0x40, 0x24, 0xf0, 0x05, 0x00, + 0x70, 0xb5, 0x09, 0x4c, 0x09, 0x4d, 0x20, 0x78, 0x05, 0xeb, 0x40, 0x10, + 0x06, 0x69, 0x00, 0xf0, 0x87, 0xf8, 0x07, 0x48, 0x90, 0xf8, 0x30, 0x00, + 0x82, 0x28, 0x03, 0xd1, 0x20, 0x78, 0x05, 0xeb, 0x40, 0x10, 0x06, 0x61, + 0x70, 0xbd, 0x00, 0xbf, 0x74, 0x87, 0x08, 0x00, 0xe0, 0x58, 0x01, 0x00, + 0x38, 0x5d, 0x01, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x08, 0xf0, 0xa6, 0xfd, + 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x73, 0xb8, 0xb0, 0xb5, + 0x0c, 0x46, 0x05, 0x46, 0x08, 0xf0, 0x9c, 0xfd, 0x28, 0x46, 0x21, 0x46, + 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x6e, 0xb8, 0x10, 0xb5, 0x04, 0x46, + 0x08, 0xf0, 0x92, 0xfd, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, + 0x6b, 0xb8, 0xb0, 0xb5, 0x0c, 0x46, 0x05, 0x46, 0x08, 0xf0, 0x88, 0xfd, + 0x28, 0x46, 0x21, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x66, 0xb8, + 0x0e, 0x48, 0x0f, 0x49, 0x18, 0x4a, 0x01, 0x60, 0x0e, 0x48, 0x0f, 0x49, + 0x01, 0x60, 0x0f, 0x48, 0x0f, 0x49, 0x01, 0x60, 0x0f, 0x48, 0x10, 0x49, + 0x01, 0x60, 0x10, 0x48, 0x10, 0x49, 0x01, 0x61, 0x10, 0x49, 0x0a, 0x60, + 0x11, 0x49, 0x12, 0x4a, 0x0a, 0x60, 0x12, 0x49, 0x12, 0x4a, 0xc0, 0xe9, + 0x1f, 0x21, 0x12, 0x49, 0x12, 0x4a, 0xc0, 0xe9, 0x0e, 0x21, 0x70, 0x47, + 0x74, 0xbb, 0x08, 0x00, 0x11, 0x4b, 0x04, 0x00, 0xc0, 0xd6, 0x08, 0x00, + 0xb5, 0x4a, 0x04, 0x00, 0x78, 0xbb, 0x08, 0x00, 0xd5, 0x4b, 0x04, 0x00, + 0x24, 0xb8, 0x08, 0x00, 0x7d, 0x4b, 0x04, 0x00, 0x94, 0xd5, 0x08, 0x00, + 0x1d, 0x4e, 0x04, 0x00, 0xd8, 0xbc, 0x08, 0x00, 0x35, 0x4e, 0x04, 0x00, + 0x88, 0xd6, 0x08, 0x00, 0x3d, 0x4c, 0x04, 0x00, 0xa3, 0x4e, 0x04, 0x00, + 0x91, 0x4e, 0x04, 0x00, 0x7b, 0x4e, 0x04, 0x00, 0x69, 0x4e, 0x04, 0x00, + 0x4c, 0xf2, 0xe3, 0x5c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf2, 0x81, 0x1c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4a, 0xf6, 0x95, 0x0c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf2, 0x8b, 0x5c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf2, 0x25, 0x7c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf6, 0x31, 0x7c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4a, 0xf2, 0x17, 0x0c, 0xc1, 0xf2, 0x0a, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xf8, 0xb5, 0x04, 0x46, 0xc8, 0x06, 0x48, 0xbf, 0xf8, 0xbd, 0xc8, 0x48, + 0x0f, 0x46, 0x16, 0x46, 0x01, 0x68, 0x0c, 0x20, 0x88, 0x47, 0x88, 0xb1, + 0x05, 0x46, 0x07, 0x72, 0x00, 0x20, 0x28, 0x80, 0xb4, 0xf9, 0x8c, 0x00, + 0x6e, 0x80, 0x6c, 0x60, 0x00, 0x28, 0x0d, 0xd4, 0x16, 0x48, 0xc4, 0xf8, + 0x50, 0x53, 0x01, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x40, 0x08, 0x47, + 0x00, 0x20, 0x47, 0x21, 0xbd, 0xe8, 0xf8, 0x40, 0xe1, 0xf7, 0x74, 0xbe, + 0x10, 0x48, 0x01, 0x68, 0x51, 0xb1, 0x10, 0x4f, 0x0e, 0x4e, 0x48, 0x68, + 0xa0, 0x42, 0x0b, 0xd0, 0x3a, 0x68, 0x30, 0x46, 0x90, 0x47, 0x01, 0x46, + 0x00, 0x28, 0xf6, 0xd1, 0x09, 0x49, 0x28, 0x46, 0xbd, 0xe8, 0xf8, 0x40, + 0xde, 0xf7, 0xe6, 0xb9, 0x08, 0x46, 0x0c, 0x21, 0x2a, 0x46, 0x0c, 0x23, + 0xdc, 0xf7, 0x0a, 0xf8, 0x28, 0x46, 0xbd, 0xe8, 0xf8, 0x40, 0xe1, 0xf7, + 0x73, 0xbe, 0x00, 0xbf, 0x3c, 0xdd, 0x08, 0x00, 0xf4, 0x5a, 0x01, 0x00, + 0xec, 0xa0, 0x08, 0x00, 0xf0, 0xb5, 0xdf, 0xf8, 0x30, 0xc1, 0x9c, 0xf8, + 0xc3, 0x51, 0xa5, 0xb1, 0x4a, 0x4a, 0x00, 0x23, 0x00, 0x26, 0x12, 0x68, + 0x14, 0x46, 0x4a, 0xb1, 0x94, 0xf8, 0x9a, 0x70, 0x37, 0xb1, 0xd4, 0xf8, + 0x9c, 0x10, 0x19, 0xb1, 0xf1, 0xb2, 0x81, 0x42, 0x08, 0xd0, 0x01, 0x36, + 0x01, 0x33, 0x04, 0xf5, 0xf0, 0x74, 0xab, 0x42, 0xef, 0xd3, 0x00, 0x27, + 0xf8, 0xb2, 0xf0, 0xbd, 0x20, 0x78, 0xa8, 0xb3, 0x01, 0x28, 0xf9, 0xd1, + 0x04, 0xf5, 0xea, 0x71, 0x94, 0xf8, 0xd5, 0x01, 0x11, 0xf8, 0x02, 0x4b, + 0x44, 0xea, 0x00, 0x20, 0x0c, 0x78, 0x49, 0x78, 0x44, 0xea, 0x01, 0x21, + 0x40, 0xea, 0x01, 0x44, 0xc3, 0xeb, 0x03, 0x10, 0x02, 0xeb, 0x40, 0x10, + 0x00, 0xf5, 0xe8, 0x72, 0x94, 0x42, 0x5a, 0xd0, 0xbc, 0xf8, 0xb8, 0x11, + 0x00, 0x20, 0x14, 0xf8, 0x04, 0x3f, 0x40, 0x1a, 0xe5, 0x6a, 0x94, 0xf8, + 0x4a, 0x60, 0x94, 0xf8, 0x54, 0x70, 0xbe, 0x42, 0x88, 0xbf, 0x37, 0x46, + 0x0d, 0x44, 0x7e, 0x1c, 0x06, 0xfb, 0x05, 0x00, 0x65, 0x78, 0xa6, 0x78, + 0xe4, 0x78, 0x43, 0xea, 0x05, 0x23, 0x46, 0xea, 0x04, 0x24, 0x43, 0xea, + 0x04, 0x44, 0x94, 0x42, 0xe5, 0xd1, 0x3d, 0xe0, 0x04, 0xf5, 0xea, 0x71, + 0x94, 0xf8, 0xd5, 0x01, 0x11, 0xf8, 0x02, 0x4b, 0x44, 0xea, 0x00, 0x20, + 0x0c, 0x78, 0x49, 0x78, 0x44, 0xea, 0x01, 0x21, 0x40, 0xea, 0x01, 0x44, + 0xc3, 0xeb, 0x03, 0x10, 0x02, 0xeb, 0x40, 0x10, 0x00, 0xf5, 0xe8, 0x72, + 0x94, 0x42, 0x26, 0xd0, 0x00, 0x20, 0x00, 0x23, 0x14, 0xf8, 0x04, 0x1f, + 0x65, 0x6f, 0x9d, 0x42, 0x84, 0xbf, 0xa4, 0xf1, 0xfc, 0x00, 0x2b, 0x46, + 0x65, 0x78, 0xa6, 0x78, 0xe4, 0x78, 0x41, 0xea, 0x05, 0x21, 0x46, 0xea, + 0x04, 0x24, 0x41, 0xea, 0x04, 0x44, 0x94, 0x42, 0xec, 0xd1, 0x80, 0xb1, + 0xbc, 0xf8, 0xb8, 0x11, 0x5a, 0x1a, 0xd0, 0xf8, 0x28, 0x31, 0x19, 0x44, + 0x90, 0xf8, 0x46, 0x31, 0x90, 0xf8, 0x50, 0x01, 0x83, 0x42, 0x88, 0xbf, + 0x18, 0x46, 0x01, 0x30, 0x00, 0xfb, 0x01, 0x20, 0x00, 0xe0, 0x00, 0x20, + 0x40, 0xf2, 0xe2, 0x41, 0xb0, 0xfb, 0xf1, 0xf0, 0x47, 0x1c, 0x81, 0xe7, + 0xe8, 0x65, 0x08, 0x00, 0xe0, 0x35, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, + 0x06, 0x46, 0x55, 0x48, 0x0d, 0x46, 0x01, 0x68, 0xbc, 0x20, 0x88, 0x47, + 0x00, 0x28, 0x00, 0xf0, 0x87, 0x80, 0x80, 0x46, 0x51, 0x48, 0xd6, 0xf8, + 0xd4, 0x10, 0x2a, 0x46, 0x00, 0x23, 0x4f, 0xf0, 0x00, 0x0b, 0x04, 0x68, + 0x40, 0x46, 0xa0, 0x47, 0x98, 0xf8, 0x00, 0x50, 0x15, 0xb3, 0x00, 0x27, + 0x4f, 0xf0, 0x00, 0x09, 0x4f, 0xf0, 0x00, 0x0b, 0x08, 0xeb, 0xc7, 0x06, + 0xf4, 0x88, 0x20, 0x2c, 0x10, 0xd8, 0xb0, 0x7a, 0x05, 0x28, 0x03, 0xd0, + 0x01, 0x28, 0x08, 0xd1, 0x70, 0x7a, 0x05, 0xe0, 0x5f, 0xfa, 0x89, 0xf0, + 0xff, 0xf7, 0x34, 0xff, 0x09, 0xf1, 0x01, 0x09, 0x30, 0x72, 0xa3, 0x45, + 0x38, 0xbf, 0xa3, 0x46, 0x01, 0x37, 0xaf, 0x42, 0xe6, 0xd3, 0xbb, 0xf1, + 0x1f, 0x0f, 0x88, 0xbf, 0x4f, 0xf0, 0x20, 0x0b, 0x08, 0xf1, 0x04, 0x03, + 0x4f, 0xea, 0x4b, 0x00, 0x00, 0x21, 0x4f, 0xf0, 0x01, 0x0c, 0x00, 0x22, + 0x2c, 0x06, 0x26, 0xd0, 0x01, 0x3d, 0xec, 0xb2, 0x03, 0xeb, 0xc4, 0x06, + 0x77, 0x88, 0x20, 0x2f, 0xf6, 0xd8, 0x96, 0xf8, 0x04, 0xe0, 0x88, 0xf8, + 0x00, 0x50, 0xbe, 0xf1, 0x00, 0x0f, 0xef, 0xd0, 0x33, 0xf8, 0x34, 0x90, + 0x4f, 0xf0, 0x00, 0x0a, 0x0a, 0xeb, 0x09, 0x04, 0xb4, 0xfb, 0xf7, 0xf6, + 0x06, 0xfb, 0x17, 0x44, 0x84, 0x42, 0x07, 0xd2, 0x0c, 0xfa, 0x04, 0xf6, + 0x3c, 0x44, 0x42, 0xea, 0xe6, 0x72, 0x31, 0x43, 0xa4, 0xb2, 0xf5, 0xe7, + 0x0a, 0xf1, 0x01, 0x0a, 0xf2, 0x45, 0xeb, 0xd3, 0xd6, 0xe7, 0xff, 0x23, + 0x88, 0xf8, 0x00, 0x30, 0x51, 0xea, 0x02, 0x03, 0x21, 0xd0, 0xbb, 0xf1, + 0x00, 0x0f, 0x20, 0xd0, 0xa0, 0xf1, 0x01, 0x0c, 0x00, 0x25, 0x4f, 0xf0, + 0x01, 0x0e, 0x00, 0x27, 0x00, 0x24, 0x0e, 0xfa, 0x05, 0xf3, 0x02, 0xea, + 0xe3, 0x76, 0x0b, 0x40, 0x33, 0x43, 0x01, 0xd1, 0xac, 0x45, 0x09, 0xd1, + 0x63, 0xb2, 0xfe, 0xb2, 0x9e, 0x42, 0xc8, 0xbf, 0x3c, 0x46, 0x00, 0x27, + 0x01, 0x35, 0x85, 0x42, 0xed, 0xd3, 0x07, 0xe0, 0x01, 0x37, 0xf9, 0xe7, + 0x01, 0x20, 0xbd, 0xe8, 0xf8, 0x8f, 0x14, 0x24, 0x01, 0xe0, 0x00, 0x24, + 0x64, 0x00, 0x98, 0xf8, 0x01, 0x50, 0x40, 0x46, 0xe1, 0xf7, 0x30, 0xfd, + 0x00, 0x2d, 0x18, 0xbf, 0x02, 0x3c, 0x61, 0xb2, 0x05, 0x29, 0xc4, 0xbf, + 0x05, 0x20, 0xbd, 0xe8, 0xf8, 0x8f, 0x01, 0x20, 0x03, 0x29, 0xc8, 0xbf, + 0x03, 0x20, 0xbd, 0xe8, 0xf8, 0x8f, 0x00, 0xbf, 0xd4, 0x9b, 0x08, 0x00, + 0xc4, 0x9b, 0x08, 0x00, 0x2d, 0xe9, 0xf8, 0x43, 0xdf, 0xf8, 0x48, 0x80, + 0x98, 0xf8, 0x00, 0x10, 0xe9, 0xb1, 0x11, 0x4f, 0x11, 0x4d, 0xdf, 0xf8, + 0x48, 0x90, 0x04, 0x46, 0x00, 0x26, 0x57, 0xf8, 0x26, 0x00, 0x88, 0xb1, + 0x2a, 0x68, 0x0a, 0xb1, 0x82, 0x42, 0x0d, 0xd0, 0x90, 0xf8, 0x38, 0x20, + 0x02, 0xf0, 0xfe, 0x02, 0x4a, 0x2a, 0x07, 0xd0, 0xb0, 0xf8, 0x7e, 0x24, + 0xd9, 0xf8, 0x00, 0x30, 0x21, 0x46, 0x98, 0x47, 0x98, 0xf8, 0x00, 0x10, + 0x01, 0x36, 0x8e, 0x42, 0xe7, 0xd3, 0xbd, 0xe8, 0xf8, 0x83, 0x00, 0xbf, + 0x5c, 0x34, 0x01, 0x00, 0x10, 0x61, 0x01, 0x00, 0xe4, 0x5e, 0x01, 0x00, + 0x18, 0xc5, 0x08, 0x00, 0x04, 0x48, 0x05, 0x49, 0x01, 0x60, 0x05, 0x48, + 0x05, 0x49, 0x01, 0x60, 0x05, 0x48, 0x06, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xe4, 0xbf, 0x08, 0x00, 0x61, 0x51, 0x04, 0x00, 0xe0, 0xbf, 0x08, 0x00, + 0x91, 0x4f, 0x04, 0x00, 0xcc, 0xca, 0x08, 0x00, 0xc5, 0x52, 0x04, 0x00, + 0xf8, 0xb5, 0x04, 0x46, 0x40, 0x48, 0xd4, 0xf8, 0x88, 0x10, 0x00, 0x78, + 0x11, 0xf4, 0x00, 0x71, 0x84, 0xf8, 0x75, 0x00, 0x3d, 0x48, 0x00, 0x78, + 0x84, 0xf8, 0x76, 0x00, 0x03, 0xd0, 0x94, 0xf8, 0xdc, 0x24, 0x92, 0x07, + 0x03, 0xd5, 0x3a, 0x4a, 0x92, 0x78, 0x52, 0x07, 0x03, 0xd4, 0x39, 0x4a, + 0x12, 0x78, 0x84, 0xf8, 0x74, 0x20, 0x89, 0x4a, 0x92, 0xf8, 0xd5, 0x30, + 0xdb, 0x07, 0x07, 0xd1, 0x98, 0x4b, 0x1b, 0x78, 0x01, 0x2b, 0x18, 0xd0, + 0x42, 0x4b, 0x1b, 0x78, 0x01, 0x2b, 0x14, 0xd0, 0xd4, 0xf8, 0xd4, 0x30, + 0x5b, 0x7f, 0x1b, 0xb1, 0x79, 0xb1, 0x94, 0xf8, 0xe0, 0x14, 0x02, 0xe0, + 0x59, 0xb1, 0x94, 0xf8, 0xdf, 0x14, 0x11, 0xf0, 0x08, 0x01, 0x06, 0xd1, + 0x92, 0xf8, 0xd6, 0x10, 0x00, 0x29, 0x18, 0xbf, 0x08, 0x46, 0x84, 0xf8, + 0x76, 0x00, 0x27, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xc8, 0xb1, + 0x43, 0x79, 0x82, 0x79, 0x05, 0x46, 0x93, 0x42, 0x05, 0xd9, 0x00, 0x20, + 0x78, 0x21, 0xe1, 0xf7, 0x6d, 0xfc, 0x6b, 0x79, 0xaa, 0x79, 0x94, 0xf8, + 0x75, 0x00, 0x94, 0xf8, 0x76, 0x10, 0x83, 0x42, 0x88, 0xbf, 0x18, 0x46, + 0x84, 0xf8, 0x75, 0x00, 0x8a, 0x42, 0x38, 0xbf, 0x11, 0x46, 0x84, 0xf8, + 0x76, 0x10, 0x03, 0xe0, 0x94, 0xf8, 0x75, 0x00, 0x94, 0xf8, 0x76, 0x10, + 0x88, 0x42, 0x24, 0xbf, 0x84, 0xf8, 0x75, 0x10, 0x08, 0x46, 0x94, 0xf8, + 0x74, 0x20, 0x8a, 0x42, 0x8c, 0xbf, 0x0a, 0x46, 0x90, 0x42, 0x04, 0xd9, + 0x90, 0x42, 0x88, 0xbf, 0x02, 0x46, 0x84, 0xf8, 0x74, 0x20, 0x0e, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x0d, 0x4f, 0x04, 0xf1, 0x78, 0x05, + 0x00, 0x26, 0x94, 0xf8, 0x74, 0x00, 0x3a, 0x68, 0xf1, 0xb2, 0x90, 0x47, + 0x25, 0xf8, 0x16, 0x00, 0x01, 0x36, 0x04, 0x2e, 0xf5, 0xd1, 0xf8, 0xbd, + 0x6b, 0x34, 0x01, 0x00, 0x6a, 0x34, 0x01, 0x00, 0xa8, 0x52, 0x01, 0x00, + 0x6e, 0x34, 0x01, 0x00, 0x30, 0xea, 0x08, 0x00, 0x18, 0x9c, 0x08, 0x00, + 0x38, 0x9c, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x0a, 0x48, 0x00, 0x78, + 0x01, 0x28, 0x08, 0xbf, 0x10, 0xbd, 0x20, 0x46, 0xff, 0xf7, 0x64, 0xff, + 0x07, 0x49, 0x94, 0xf8, 0x35, 0x01, 0x09, 0x68, 0x88, 0x47, 0x06, 0x48, + 0x81, 0x21, 0x00, 0x22, 0x03, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, + 0x18, 0x47, 0x00, 0xbf, 0x63, 0x34, 0x01, 0x00, 0x54, 0x9c, 0x08, 0x00, + 0x48, 0x9c, 0x08, 0x00, 0x15, 0x28, 0x03, 0xd1, 0x13, 0x88, 0x43, 0xf0, + 0x08, 0x03, 0x13, 0x80, 0x00, 0xf0, 0xbe, 0xb8, 0x2d, 0xe9, 0xf0, 0x47, + 0x15, 0x46, 0x0c, 0x46, 0x11, 0x28, 0x1e, 0xd0, 0x2c, 0x28, 0x16, 0xd1, + 0x00, 0x2d, 0x5b, 0xd0, 0x21, 0x78, 0x01, 0x29, 0x11, 0xd1, 0x94, 0xf8, + 0x88, 0x14, 0x89, 0x07, 0x0d, 0xd5, 0x94, 0xf8, 0xa4, 0x14, 0x4a, 0x07, + 0x48, 0xbf, 0x5f, 0xea, 0x01, 0x71, 0x06, 0xd5, 0x69, 0x79, 0xc1, 0xf3, + 0xc3, 0x01, 0x05, 0x39, 0x02, 0x29, 0x00, 0xd2, 0x4e, 0xe0, 0x21, 0x46, + 0x2a, 0x46, 0xbd, 0xe8, 0xf0, 0x47, 0x00, 0xf0, 0x9f, 0xb8, 0x00, 0x2d, + 0x41, 0xd0, 0x94, 0xf8, 0x38, 0x00, 0x47, 0x28, 0x42, 0xd1, 0x24, 0x48, + 0x47, 0x21, 0x2a, 0x46, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x07, 0x46, + 0x2a, 0x28, 0x3a, 0xd1, 0xdf, 0xf8, 0x80, 0x90, 0x20, 0x48, 0x99, 0xf8, + 0xbc, 0x14, 0x40, 0x30, 0x01, 0xf0, 0x01, 0x01, 0xdf, 0xf7, 0xbc, 0xfe, + 0x90, 0xb3, 0xdf, 0xf8, 0x74, 0xa0, 0x80, 0x46, 0x04, 0xf5, 0x5b, 0x76, + 0x00, 0x27, 0xda, 0xf8, 0x00, 0x20, 0x30, 0x46, 0x39, 0x46, 0x90, 0x47, + 0x58, 0xb1, 0x07, 0x46, 0x00, 0x78, 0x47, 0x28, 0xf5, 0xd1, 0x16, 0x48, + 0x39, 0x46, 0x02, 0x68, 0x30, 0x46, 0x90, 0x47, 0x38, 0x46, 0xe1, 0xf7, + 0xc7, 0xfb, 0xb9, 0xf8, 0xbe, 0x14, 0x40, 0x46, 0x2a, 0x46, 0x0d, 0x23, + 0xdb, 0xf7, 0x52, 0xfd, 0x20, 0x46, 0x41, 0x46, 0x47, 0x22, 0x00, 0x23, + 0x00, 0x27, 0x00, 0xf0, 0x65, 0xf8, 0x08, 0xe0, 0x00, 0x20, 0xeb, 0x21, + 0x02, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x07, 0x11, 0xdb, 0xf7, 0x30, 0xfd, + 0x0c, 0x27, 0x38, 0x46, 0xbd, 0xe8, 0xf0, 0x87, 0x2a, 0x27, 0xfa, 0xe7, + 0xc4, 0xba, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x68, 0x8a, 0x01, 0x00, + 0xec, 0xa0, 0x08, 0x00, 0xe8, 0xa0, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, + 0x0c, 0x48, 0x00, 0x78, 0x08, 0xb9, 0x09, 0xf0, 0x75, 0xf8, 0x0b, 0x48, + 0x01, 0x68, 0x21, 0xf0, 0x01, 0x01, 0x01, 0x60, 0x20, 0x46, 0x00, 0xf0, + 0x43, 0xf8, 0x20, 0x68, 0x07, 0x49, 0x90, 0xf8, 0x35, 0x01, 0x00, 0xeb, + 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, 0x4f, 0xf0, 0xff, 0x31, 0x41, 0x65, + 0x10, 0xbd, 0x00, 0xbf, 0x54, 0x34, 0x01, 0x00, 0x68, 0xf0, 0x05, 0x00, + 0x54, 0xf1, 0x05, 0x00, 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, + 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0xb8, 0x9b, 0x08, 0x00, + 0xb1, 0x54, 0x04, 0x00, 0x90, 0xd7, 0x08, 0x00, 0x75, 0x54, 0x04, 0x00, + 0xf0, 0xcb, 0x08, 0x00, 0xc1, 0x54, 0x04, 0x00, 0xbc, 0xd8, 0x08, 0x00, + 0xbd, 0x55, 0x04, 0x00, 0x42, 0xf6, 0x35, 0x6c, 0xc1, 0xf2, 0x0b, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf2, 0xc1, 0x1c, 0xc1, 0xf2, 0x0b, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x44, 0xf2, 0xf1, 0x7c, 0xc1, 0xf2, 0x0b, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf6, 0x45, 0x3c, 0xc1, 0xf2, 0x0b, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x70, 0xb5, 0x14, 0x46, 0x0d, 0x46, 0x06, 0x46, + 0x00, 0xf0, 0xda, 0xf8, 0x28, 0x88, 0x03, 0x28, 0x18, 0xbf, 0x70, 0xbd, + 0x03, 0x48, 0x29, 0x46, 0x22, 0x46, 0x03, 0x68, 0x30, 0x46, 0xbd, 0xe8, + 0x70, 0x40, 0x18, 0x47, 0x40, 0xdb, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, + 0x00, 0xf0, 0xce, 0xf8, 0x01, 0x28, 0x0d, 0xd1, 0x0a, 0x49, 0x91, 0xf8, + 0x2d, 0x10, 0x49, 0x07, 0x08, 0xd4, 0x94, 0xf8, 0x88, 0x14, 0x89, 0x07, + 0x44, 0xbf, 0x94, 0xf8, 0xa4, 0x14, 0x5f, 0xea, 0x41, 0x72, 0x00, 0xd4, + 0x10, 0xbd, 0x08, 0x07, 0x4f, 0xf0, 0x03, 0x00, 0x58, 0xbf, 0x01, 0x20, + 0x10, 0xbd, 0x00, 0xbf, 0x10, 0x5a, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x41, + 0x1f, 0x4e, 0x88, 0x46, 0x04, 0x46, 0x90, 0xf8, 0x35, 0x51, 0x00, 0xf2, + 0xdb, 0x40, 0x31, 0x68, 0x88, 0x47, 0x07, 0x46, 0x31, 0x68, 0x1b, 0x48, + 0x88, 0x47, 0x06, 0x46, 0x1a, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0x08, 0xb1, 0x90, 0xf8, 0xb9, 0x50, 0x07, 0xea, 0x08, 0x00, 0x06, 0x40, + 0x16, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x06, 0xea, 0x00, 0x01, + 0x14, 0x48, 0x02, 0x68, 0x20, 0x78, 0x90, 0x47, 0x06, 0x46, 0x13, 0x48, + 0x29, 0x46, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x01, 0x28, 0x0e, 0xd1, + 0x94, 0xf8, 0x88, 0x04, 0x80, 0x07, 0x01, 0xd4, 0x01, 0x20, 0x08, 0xe0, + 0x94, 0xf8, 0xa4, 0x14, 0x48, 0x07, 0x4f, 0xf0, 0x01, 0x00, 0x02, 0xd5, + 0x09, 0x07, 0x58, 0xbf, 0x03, 0x20, 0x86, 0x42, 0x88, 0xbf, 0x06, 0x46, + 0x30, 0x46, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, 0xd4, 0xbf, 0x08, 0x00, + 0xa8, 0x52, 0x01, 0x00, 0xec, 0xbf, 0x08, 0x00, 0xf0, 0xbf, 0x08, 0x00, + 0xc4, 0xbf, 0x08, 0x00, 0xe4, 0xbf, 0x08, 0x00, 0x80, 0xb5, 0x01, 0x88, + 0x16, 0x29, 0x12, 0xd8, 0x0b, 0x4a, 0x01, 0xeb, 0x41, 0x03, 0x52, 0xf8, + 0x23, 0x30, 0x63, 0xb1, 0x01, 0xeb, 0x41, 0x01, 0x02, 0xeb, 0x81, 0x01, + 0x09, 0x79, 0x01, 0x29, 0x05, 0xd1, 0x00, 0xf0, 0x59, 0xf8, 0xbd, 0xe8, + 0x80, 0x40, 0x08, 0xf0, 0x8d, 0xbf, 0xbd, 0xe8, 0x80, 0x40, 0x00, 0xf0, + 0x51, 0xb8, 0x00, 0xbf, 0xe8, 0x72, 0x01, 0x00, 0xb0, 0xb5, 0x0c, 0x46, + 0x05, 0x46, 0x0b, 0xf0, 0xf3, 0xfe, 0x28, 0x46, 0x21, 0x46, 0xbd, 0xe8, + 0xb0, 0x40, 0x00, 0xf0, 0x49, 0xb8, 0x1c, 0xb5, 0x05, 0x9c, 0x41, 0xf0, + 0x08, 0x01, 0x01, 0x94, 0x04, 0x9c, 0x00, 0x94, 0x00, 0xf0, 0x46, 0xf8, + 0x1c, 0xbd, 0x00, 0xbf, 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, + 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, + 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, + 0x0c, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0xcc, 0xbf, 0x08, 0x00, + 0x95, 0x56, 0x04, 0x00, 0x3c, 0xdb, 0x08, 0x00, 0x6d, 0x56, 0x04, 0x00, + 0xc8, 0xbf, 0x08, 0x00, 0xd1, 0x56, 0x04, 0x00, 0x08, 0xca, 0x08, 0x00, + 0x6d, 0x57, 0x04, 0x00, 0xbc, 0xd4, 0x08, 0x00, 0xa9, 0x57, 0x04, 0x00, + 0xc8, 0xc0, 0x08, 0x00, 0xbf, 0x57, 0x04, 0x00, 0x46, 0xf6, 0xb9, 0x4c, + 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x47, 0xf6, 0xc1, 0x1c, + 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x47, 0xf2, 0x71, 0x4c, + 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x47, 0xf2, 0xc5, 0x0c, + 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x47, 0xf2, 0x9d, 0x6c, + 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x90, 0xf8, 0x38, 0x10, + 0x01, 0xf0, 0xfe, 0x01, 0x4a, 0x29, 0x18, 0xbf, 0x00, 0xf0, 0x0a, 0xb8, + 0x00, 0x20, 0x70, 0x47, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xf0, 0xdb, 0x08, 0x00, 0x69, 0x58, 0x04, 0x00, 0x4a, 0xf6, 0x2d, 0x3c, + 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0xfe, 0xb5, 0x05, 0x46, + 0x19, 0x48, 0x1c, 0x46, 0x16, 0x46, 0x0f, 0x46, 0x00, 0x68, 0x80, 0x47, + 0xbc, 0x48, 0x90, 0xf8, 0xbc, 0x14, 0x16, 0x48, 0x40, 0x30, 0x01, 0xf0, + 0x01, 0x01, 0xdf, 0xf7, 0xfd, 0xfc, 0x08, 0x99, 0x28, 0x60, 0x70, 0xb1, + 0x01, 0x31, 0x13, 0x2c, 0x81, 0x70, 0x08, 0xbf, 0x47, 0xf0, 0x20, 0x07, + 0x28, 0x68, 0xc7, 0x70, 0x06, 0xf0, 0x01, 0x00, 0x29, 0x68, 0x40, 0xea, + 0x44, 0x00, 0x08, 0x71, 0xfe, 0xbd, 0x00, 0x20, 0x8d, 0xf8, 0x09, 0x40, + 0x8d, 0xf8, 0x0a, 0x10, 0x02, 0xab, 0x00, 0x21, 0x00, 0x22, 0x8d, 0xf8, + 0x08, 0x00, 0x06, 0x48, 0x04, 0x68, 0x04, 0x20, 0x00, 0x90, 0x40, 0xf2, + 0x09, 0x20, 0xa0, 0x47, 0xfe, 0xbd, 0x00, 0xbf, 0xf8, 0xdc, 0x08, 0x00, + 0x68, 0x8a, 0x01, 0x00, 0xa0, 0xa0, 0x08, 0x00, 0x2d, 0xe9, 0xfe, 0x4f, + 0x9a, 0x4d, 0x28, 0x78, 0x00, 0x28, 0x00, 0xf0, 0x2e, 0x81, 0x99, 0x48, + 0x99, 0x4f, 0x9a, 0x4e, 0xdf, 0xf8, 0x68, 0xa2, 0xdf, 0xf8, 0x68, 0xb2, + 0x4f, 0xf0, 0x00, 0x08, 0x00, 0xf1, 0x04, 0x09, 0x57, 0xf8, 0x28, 0x40, + 0x44, 0xb1, 0x30, 0x68, 0x08, 0xb1, 0xa0, 0x42, 0x04, 0xd0, 0xda, 0xf8, + 0x00, 0x10, 0x20, 0x46, 0x88, 0x47, 0x28, 0xb1, 0x28, 0x78, 0x08, 0xf1, + 0x01, 0x08, 0x80, 0x45, 0xee, 0xd3, 0x10, 0xe1, 0xdb, 0xf8, 0x00, 0x10, + 0x20, 0x46, 0x88, 0x47, 0x00, 0x28, 0x70, 0xd0, 0x94, 0xf8, 0xdd, 0x04, + 0x40, 0x07, 0x19, 0xd4, 0x94, 0xf8, 0x75, 0x00, 0x94, 0xf8, 0x76, 0x10, + 0x81, 0x42, 0xe9, 0xd0, 0x88, 0x48, 0x90, 0xf8, 0xd5, 0x00, 0x40, 0x07, + 0xe4, 0xd5, 0x94, 0xf8, 0xdc, 0x04, 0x80, 0x07, 0xe0, 0xd4, 0x89, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x00, 0x28, 0xda, 0xd0, 0x87, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xd5, 0xe7, 0x7d, 0x49, 0x94, 0xf9, + 0x3a, 0x00, 0x91, 0xf9, 0x01, 0x10, 0x88, 0x42, 0x5b, 0xdb, 0xb9, 0xf8, + 0x00, 0x10, 0x89, 0x06, 0x57, 0xd4, 0x78, 0x49, 0x91, 0xf9, 0x00, 0x10, + 0x88, 0x42, 0x40, 0xf3, 0xac, 0x80, 0x94, 0xf8, 0xd8, 0x01, 0x75, 0x49, + 0x01, 0x30, 0x49, 0x7b, 0x84, 0xf8, 0xd8, 0x01, 0xc0, 0xb2, 0x88, 0x42, + 0xc0, 0xf0, 0xc3, 0x80, 0x00, 0x20, 0x84, 0xf8, 0xd8, 0x01, 0x94, 0xf8, + 0xfa, 0x02, 0x41, 0x06, 0x00, 0xf1, 0xbb, 0x80, 0x94, 0xf9, 0x80, 0x10, + 0x11, 0xf1, 0x0e, 0x0f, 0xc0, 0xf2, 0xb5, 0x80, 0x42, 0xb2, 0x00, 0x2a, + 0xa8, 0xd4, 0x00, 0xf0, 0x5f, 0x00, 0x01, 0x29, 0xa4, 0xbf, 0x00, 0x21, + 0x84, 0xf8, 0x80, 0x10, 0x80, 0x30, 0x01, 0x39, 0x84, 0xf8, 0xfa, 0x02, + 0x94, 0xf8, 0xe2, 0x04, 0x84, 0xf8, 0x80, 0x10, 0x40, 0x07, 0x04, 0xd5, + 0x60, 0x48, 0xc0, 0x79, 0x40, 0x07, 0x00, 0xf1, 0xa1, 0x80, 0x60, 0x48, + 0x20, 0x22, 0xd0, 0xf8, 0x00, 0xc0, 0xd4, 0xf8, 0xd4, 0x00, 0x41, 0x7f, + 0x00, 0x20, 0x00, 0x90, 0x80, 0x20, 0x01, 0x90, 0x00, 0x29, 0x18, 0xbf, + 0x01, 0x21, 0x20, 0x46, 0x62, 0xe0, 0x94, 0xf8, 0x38, 0x00, 0xa0, 0xf1, + 0x4a, 0x01, 0x02, 0x29, 0x5f, 0xd2, 0xb4, 0xf8, 0x54, 0x14, 0xb4, 0xf8, + 0x56, 0x04, 0x49, 0x08, 0x11, 0xeb, 0x50, 0x0f, 0x3f, 0xf4, 0x74, 0xaf, + 0x7e, 0xe7, 0x94, 0xf8, 0xd7, 0x01, 0xf9, 0x49, 0x01, 0x30, 0x09, 0x7b, + 0x84, 0xf8, 0xd7, 0x01, 0xc0, 0xb2, 0x88, 0x42, 0x04, 0xd2, 0xb9, 0xf8, + 0x00, 0x00, 0x80, 0x06, 0x7f, 0xf5, 0x64, 0xaf, 0x94, 0xf8, 0xfa, 0x12, + 0x00, 0x20, 0x84, 0xf8, 0xd7, 0x01, 0x88, 0x06, 0x0c, 0xd4, 0xf6, 0x48, + 0x04, 0x21, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x94, 0xf8, 0xfa, 0x12, + 0x01, 0x28, 0x04, 0xbf, 0x41, 0xf0, 0x20, 0x01, 0x84, 0xf8, 0xfa, 0x12, + 0x88, 0x06, 0x3f, 0xf5, 0x4d, 0xaf, 0x94, 0xf9, 0x80, 0x00, 0x0e, 0x28, + 0x3f, 0xf7, 0x48, 0xaf, 0x4a, 0xb2, 0x00, 0x2a, 0x4d, 0xd4, 0xb0, 0xf1, + 0xff, 0x3f, 0xdc, 0xbf, 0x00, 0x20, 0x84, 0xf8, 0x80, 0x00, 0x02, 0x22, + 0x01, 0x30, 0x62, 0xf3, 0x9f, 0x11, 0x84, 0xf8, 0x80, 0x00, 0x94, 0xf8, + 0xe2, 0x04, 0x84, 0xf8, 0xfa, 0x12, 0x40, 0x07, 0x03, 0xd5, 0x2e, 0x48, + 0xc0, 0x79, 0x40, 0x07, 0x1b, 0xd4, 0xdb, 0x48, 0xd0, 0xf8, 0x00, 0xc0, + 0xd4, 0xf8, 0xd4, 0x00, 0x41, 0x7f, 0x00, 0x20, 0x00, 0x90, 0x80, 0x20, + 0x01, 0x90, 0x20, 0x46, 0x1f, 0x22, 0x00, 0x29, 0x18, 0xbf, 0x01, 0x21, + 0x01, 0x23, 0xe0, 0x47, 0x1c, 0xe7, 0x47, 0x28, 0x7f, 0xf4, 0x1a, 0xaf, + 0x24, 0xe7, 0x00, 0x20, 0x84, 0xf8, 0xd8, 0x01, 0x84, 0xf8, 0xd7, 0x01, + 0x12, 0xe7, 0x1f, 0x48, 0x1f, 0x22, 0x01, 0x23, 0xd0, 0xf8, 0x00, 0xc0, + 0xd4, 0xf8, 0xd4, 0x00, 0x41, 0x7f, 0xb9, 0xf8, 0x00, 0x00, 0x80, 0x06, + 0x4f, 0xf0, 0x02, 0x00, 0x58, 0xbf, 0x01, 0x20, 0x00, 0x90, 0x00, 0x29, + 0x4f, 0xf0, 0x00, 0x00, 0x01, 0x90, 0x20, 0x46, 0x18, 0xbf, 0x01, 0x21, + 0xe0, 0x47, 0xb9, 0xf8, 0x00, 0x00, 0x80, 0x06, 0x00, 0xd4, 0xf5, 0xe6, + 0x12, 0x49, 0x01, 0x20, 0x88, 0x73, 0xf1, 0xe6, 0x0e, 0x48, 0xd0, 0xf8, + 0x00, 0xc0, 0xd4, 0xf8, 0xd4, 0x00, 0x41, 0x7f, 0x00, 0x20, 0x00, 0x90, + 0xc2, 0xe7, 0xbd, 0xe8, 0xfe, 0x8f, 0x00, 0xbf, 0x5c, 0x34, 0x01, 0x00, + 0xf0, 0x1e, 0x01, 0x00, 0x10, 0x61, 0x01, 0x00, 0xe4, 0x5e, 0x01, 0x00, + 0xb8, 0xc9, 0x08, 0x00, 0xcc, 0xba, 0x08, 0x00, 0x8a, 0x76, 0x01, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0xa8, 0x52, 0x01, 0x00, 0xa4, 0xdc, 0x08, 0x00, + 0xac, 0x9b, 0x08, 0x00, 0xfc, 0x1e, 0x01, 0x00, 0xb0, 0xdc, 0x08, 0x00, + 0xa8, 0xdc, 0x08, 0x00, 0x2d, 0xe9, 0xfc, 0x41, 0x0e, 0x68, 0x04, 0x46, + 0x03, 0x2a, 0x3e, 0xd0, 0x30, 0x79, 0x0f, 0x2a, 0x00, 0xf0, 0x01, 0x08, + 0x4c, 0xd0, 0x11, 0x2a, 0x60, 0xd0, 0x7f, 0x2a, 0x73, 0xd0, 0x26, 0x2a, + 0x00, 0xf0, 0x81, 0x80, 0x38, 0x2a, 0x00, 0xf0, 0xb1, 0x80, 0x42, 0x2a, + 0x00, 0xf0, 0xb9, 0x80, 0x25, 0x2a, 0x40, 0xf0, 0xc2, 0x80, 0x70, 0x79, + 0x1f, 0x21, 0x84, 0xf8, 0xd1, 0x01, 0xb0, 0x79, 0x84, 0xf8, 0xd2, 0x01, + 0xf0, 0x79, 0x84, 0xf8, 0xd3, 0x01, 0x30, 0x7a, 0x84, 0xf8, 0xd4, 0x01, + 0x70, 0x7a, 0x84, 0xf8, 0xd5, 0x01, 0xd4, 0xf8, 0x88, 0x00, 0x40, 0xf4, + 0x80, 0x70, 0xc4, 0xf8, 0x88, 0x00, 0x94, 0x48, 0x02, 0x68, 0x20, 0x46, + 0x90, 0x47, 0x10, 0xb1, 0x0b, 0x20, 0x84, 0xf8, 0xd6, 0x01, 0x94, 0x48, + 0x41, 0x46, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x90, 0x48, 0x21, 0x46, + 0x32, 0x46, 0x03, 0x68, 0x2d, 0x20, 0x98, 0x47, 0x95, 0xe0, 0x70, 0x79, + 0x11, 0x28, 0x49, 0xd1, 0x94, 0xf8, 0xf9, 0x02, 0x0a, 0x28, 0x05, 0xd1, + 0xd4, 0xf8, 0x88, 0x00, 0x40, 0xf4, 0xc0, 0x20, 0xc4, 0xf8, 0x88, 0x00, + 0x20, 0x46, 0x2e, 0x21, 0x32, 0x46, 0x00, 0xf0, 0xb7, 0xf9, 0x82, 0xe0, + 0xc6, 0x48, 0x00, 0x78, 0x40, 0x07, 0x40, 0xf1, 0x80, 0x80, 0x7d, 0x48, + 0x75, 0x79, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x00, 0x28, 0x78, 0xd1, + 0x00, 0x2d, 0x76, 0xd1, 0x94, 0xf8, 0x82, 0x04, 0x03, 0x28, 0x72, 0xd1, + 0x20, 0x46, 0x41, 0x46, 0x0f, 0x22, 0x69, 0xe0, 0xbb, 0x48, 0x00, 0x78, + 0x40, 0x07, 0x6a, 0xd5, 0xd4, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0x00, 0x28, + 0x65, 0xd0, 0x94, 0xf8, 0x8a, 0x00, 0x80, 0x07, 0x03, 0xd4, 0x94, 0xf8, + 0xa2, 0x02, 0x00, 0x28, 0x5d, 0xd1, 0x20, 0x46, 0x41, 0x46, 0x11, 0x22, + 0x54, 0xe0, 0x70, 0x79, 0x17, 0x28, 0x0b, 0xd1, 0x94, 0xf8, 0x8a, 0x00, + 0x80, 0x07, 0x07, 0xd4, 0x5b, 0x48, 0x41, 0x46, 0x17, 0x22, 0x24, 0x23, + 0x05, 0x68, 0x20, 0x46, 0xa8, 0x47, 0x48, 0xe0, 0x49, 0xe0, 0x70, 0x79, + 0x84, 0xf8, 0xd1, 0x01, 0xb0, 0x79, 0x84, 0xf8, 0xd2, 0x01, 0xf0, 0x79, + 0x84, 0xf8, 0xd3, 0x01, 0x30, 0x7a, 0x84, 0xf8, 0xd4, 0x01, 0x70, 0x7a, + 0x84, 0xf8, 0xd5, 0x01, 0x94, 0xf8, 0x89, 0x00, 0xc0, 0x07, 0x0c, 0xd1, + 0x59, 0x48, 0x1f, 0x21, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x30, 0xb1, + 0x0b, 0x20, 0x84, 0xf8, 0xd6, 0x01, 0x56, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0xd4, 0xf8, 0x88, 0x00, 0x00, 0x21, 0x00, 0x27, 0x40, 0xf4, + 0x80, 0x70, 0xc4, 0xf8, 0x88, 0x00, 0x51, 0x48, 0x02, 0x68, 0x20, 0x46, + 0x90, 0x47, 0x50, 0x48, 0x21, 0x46, 0x32, 0x46, 0x03, 0x68, 0x2e, 0x20, + 0x98, 0x47, 0x17, 0xe0, 0x3e, 0x4e, 0x30, 0x78, 0x01, 0x28, 0x02, 0xd1, + 0x3d, 0x4f, 0x38, 0x78, 0x98, 0xb1, 0x20, 0x46, 0x41, 0x46, 0x38, 0x22, + 0x06, 0xe0, 0x94, 0xf8, 0x8a, 0x00, 0x80, 0x07, 0x07, 0xd4, 0x20, 0x46, + 0x41, 0x46, 0x42, 0x22, 0x24, 0x23, 0x00, 0xf0, 0x39, 0xf9, 0x00, 0x27, + 0x00, 0xe0, 0x19, 0x27, 0x38, 0x46, 0xbd, 0xe8, 0xfc, 0x81, 0x01, 0x20, + 0x38, 0x70, 0x32, 0x48, 0x00, 0x68, 0x80, 0x47, 0x31, 0x48, 0x90, 0xf8, + 0xf7, 0x00, 0xc0, 0x07, 0x15, 0xd1, 0x30, 0x48, 0x90, 0xf8, 0xd5, 0x00, + 0xc0, 0x07, 0x05, 0xd1, 0x30, 0x78, 0x01, 0x28, 0x16, 0xd0, 0x38, 0x78, + 0x01, 0x28, 0x13, 0xd0, 0xd4, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0x10, 0xb1, + 0x94, 0xf8, 0xe0, 0x04, 0x01, 0xe0, 0x94, 0xf8, 0xdf, 0x04, 0x00, 0x07, + 0x08, 0xd4, 0x25, 0x49, 0x25, 0x48, 0x91, 0xf8, 0xd6, 0x10, 0x00, 0x78, + 0x00, 0x29, 0x18, 0xbf, 0x08, 0x46, 0x01, 0xe0, 0x21, 0x48, 0x00, 0x78, + 0x6d, 0x4e, 0x84, 0xf8, 0x76, 0x00, 0x84, 0xf8, 0x74, 0x00, 0xc0, 0xb2, + 0x00, 0x21, 0x32, 0x68, 0x90, 0x47, 0x01, 0x27, 0x3d, 0x25, 0xa4, 0xf8, + 0x78, 0x00, 0xa5, 0xf1, 0x3c, 0x01, 0x32, 0x68, 0x94, 0xf8, 0x74, 0x00, + 0xc9, 0xb2, 0x90, 0x47, 0x01, 0x37, 0x24, 0xf8, 0x15, 0x00, 0x01, 0x35, + 0x04, 0x2f, 0xf2, 0xd1, 0x14, 0x48, 0x01, 0x21, 0x00, 0x27, 0x03, 0x22, + 0x01, 0x23, 0x00, 0x68, 0x80, 0xf8, 0x83, 0x10, 0x80, 0xf8, 0x7f, 0x10, + 0x10, 0x48, 0x41, 0x46, 0x05, 0x68, 0x38, 0x20, 0xcd, 0xe9, 0x00, 0x07, + 0x20, 0x46, 0xa8, 0x47, 0x0d, 0x48, 0x00, 0x68, 0x80, 0x47, 0x0d, 0x49, + 0x94, 0xf8, 0x35, 0x01, 0x09, 0x68, 0x88, 0x47, 0x9c, 0xe7, 0x00, 0xbf, + 0xb0, 0x9b, 0x08, 0x00, 0x54, 0x34, 0x01, 0x00, 0x63, 0x34, 0x01, 0x00, + 0xac, 0xda, 0x08, 0x00, 0xe8, 0x65, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0x6a, 0x34, 0x01, 0x00, 0xf8, 0x35, 0x01, 0x00, 0xac, 0x9b, 0x08, 0x00, + 0xbc, 0xba, 0x08, 0x00, 0xc4, 0xc2, 0x08, 0x00, 0xa4, 0x9b, 0x08, 0x00, + 0x0c, 0xbb, 0x08, 0x00, 0x7c, 0xd8, 0x08, 0x00, 0xd4, 0xd8, 0x08, 0x00, + 0xb8, 0x9b, 0x08, 0x00, 0xd0, 0xda, 0x08, 0x00, 0x2d, 0xe9, 0xfe, 0x43, + 0x05, 0x46, 0x90, 0xf8, 0x74, 0x80, 0x3a, 0x48, 0x0e, 0x46, 0x01, 0x68, + 0x28, 0x46, 0x88, 0x47, 0x07, 0x46, 0x38, 0x48, 0x01, 0x68, 0x28, 0x46, + 0x88, 0x47, 0x04, 0x46, 0x95, 0xf8, 0x75, 0x00, 0x95, 0xf8, 0x76, 0x20, + 0x96, 0xf8, 0x04, 0x90, 0xb1, 0x79, 0x82, 0x42, 0x03, 0xd1, 0x02, 0x29, + 0x0a, 0xd1, 0x02, 0x20, 0x29, 0xe0, 0x02, 0x29, 0x0e, 0xd1, 0x95, 0xf8, + 0x74, 0x00, 0xa0, 0x42, 0x38, 0xbf, 0x85, 0xf8, 0x74, 0x40, 0x12, 0xe0, + 0x00, 0x20, 0x00, 0x29, 0x08, 0xbf, 0x03, 0x20, 0x01, 0x29, 0x08, 0xbf, + 0x02, 0x20, 0x18, 0xe0, 0x21, 0xb1, 0x01, 0x29, 0x07, 0xd1, 0x27, 0x48, + 0x21, 0x46, 0x01, 0xe0, 0x24, 0x48, 0x39, 0x46, 0x02, 0x68, 0x28, 0x46, + 0x90, 0x47, 0x95, 0xf8, 0x74, 0x10, 0xa1, 0x42, 0x04, 0xd2, 0x03, 0x20, + 0xb9, 0x42, 0x88, 0xbf, 0x01, 0x20, 0x04, 0xe0, 0xb1, 0x79, 0x02, 0x20, + 0x00, 0x29, 0x08, 0xbf, 0x01, 0x20, 0x1d, 0x49, 0x06, 0x46, 0x1d, 0x4c, + 0x09, 0xf0, 0x01, 0x09, 0x00, 0x27, 0xc9, 0x78, 0x8a, 0x07, 0x48, 0xbf, + 0x40, 0xea, 0x80, 0x06, 0x49, 0x07, 0x48, 0xbf, 0x46, 0xea, 0x00, 0x16, + 0x95, 0xf8, 0x74, 0x00, 0x22, 0x68, 0xf9, 0xb2, 0x90, 0x47, 0x05, 0xeb, + 0x47, 0x01, 0x01, 0x37, 0x04, 0x2f, 0xa1, 0xf8, 0x78, 0x00, 0xf3, 0xd1, + 0x11, 0x48, 0x49, 0x46, 0x20, 0x22, 0x01, 0x23, 0x04, 0x68, 0x00, 0x20, + 0xcd, 0xe9, 0x00, 0x60, 0x28, 0x46, 0xa0, 0x47, 0x0d, 0x49, 0x95, 0xf8, + 0x35, 0x01, 0x09, 0x68, 0x88, 0x47, 0x0c, 0x48, 0x00, 0x21, 0x42, 0x46, + 0x03, 0x68, 0x28, 0x46, 0x03, 0xb0, 0xbd, 0xe8, 0xf0, 0x43, 0x18, 0x47, + 0xcc, 0xdc, 0x08, 0x00, 0xd0, 0xdc, 0x08, 0x00, 0x40, 0x9c, 0x08, 0x00, + 0x44, 0x9c, 0x08, 0x00, 0xa8, 0x52, 0x01, 0x00, 0x38, 0x9c, 0x08, 0x00, + 0xa4, 0xdc, 0x08, 0x00, 0x54, 0x9c, 0x08, 0x00, 0x48, 0x9c, 0x08, 0x00, + 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x78, 0xca, 0x08, 0x00, 0x11, 0x59, 0x04, 0x00, + 0x50, 0xc5, 0x08, 0x00, 0x99, 0x58, 0x04, 0x00, 0xc0, 0xda, 0x08, 0x00, + 0xb9, 0x5b, 0x04, 0x00, 0xec, 0xda, 0x08, 0x00, 0x81, 0x5e, 0x04, 0x00, + 0x49, 0xf6, 0x31, 0x3c, 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4c, 0xf6, 0x89, 0x0c, 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x2d, 0xe9, 0xf0, 0x4f, 0x87, 0xb0, 0x52, 0x4f, 0x38, 0x78, 0x00, 0x28, + 0x00, 0xf0, 0x9a, 0x80, 0xdf, 0xf8, 0x40, 0xa1, 0xdf, 0xf8, 0x40, 0x91, + 0xdf, 0xf8, 0x40, 0x81, 0xdf, 0xf8, 0x4c, 0xb1, 0x00, 0x26, 0x59, 0xf8, + 0x26, 0x40, 0x00, 0x2c, 0x00, 0xf0, 0x82, 0x80, 0xd8, 0xf8, 0x00, 0x00, + 0x08, 0xb1, 0xa0, 0x42, 0x7c, 0xd0, 0xd4, 0xf8, 0x60, 0x53, 0xdd, 0xb1, + 0x94, 0xf8, 0xf9, 0x02, 0xc0, 0xb9, 0x47, 0x48, 0x29, 0x78, 0x00, 0x22, + 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x88, 0xb1, 0x9a, 0xf8, 0x2e, 0x00, + 0x38, 0xb1, 0xda, 0xf8, 0x00, 0x00, 0x40, 0x69, 0x84, 0x42, 0x02, 0xd1, + 0x28, 0x78, 0x6c, 0x28, 0x06, 0xd1, 0x29, 0x78, 0x20, 0x46, 0x2a, 0x46, + 0xc4, 0xf8, 0xe0, 0x52, 0xff, 0xf7, 0xba, 0xff, 0xd4, 0xf8, 0x6c, 0x53, + 0x05, 0xb3, 0x29, 0x78, 0x70, 0x29, 0x02, 0xd0, 0x94, 0xf8, 0xc8, 0x02, + 0xd0, 0xb9, 0x36, 0x48, 0x00, 0x22, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, + 0xa0, 0xb1, 0x9a, 0xf8, 0x2e, 0x00, 0x20, 0xb1, 0xda, 0xf8, 0x00, 0x00, + 0x40, 0x69, 0x84, 0x42, 0x0c, 0xd0, 0x30, 0x49, 0x04, 0xf5, 0x5b, 0x70, + 0x09, 0x68, 0x88, 0x47, 0x2e, 0x48, 0x29, 0x46, 0x02, 0x68, 0x20, 0x46, + 0x90, 0x47, 0x28, 0x46, 0xe0, 0xf7, 0x2a, 0xfe, 0xd4, 0xf8, 0x78, 0x53, + 0xb5, 0xb3, 0x94, 0xf8, 0x38, 0x03, 0x98, 0xbb, 0x9a, 0xf8, 0x2e, 0x00, + 0x20, 0xb1, 0xda, 0xf8, 0x00, 0x00, 0x40, 0x69, 0x84, 0x42, 0x2b, 0xd0, + 0x9b, 0xf8, 0x4a, 0x00, 0x70, 0xb3, 0x04, 0xf5, 0x5e, 0x70, 0x3a, 0x46, + 0x69, 0x69, 0xaf, 0x7a, 0xd5, 0xf8, 0x00, 0xe0, 0xeb, 0x7a, 0x95, 0xf8, + 0x08, 0xc0, 0x06, 0x90, 0x68, 0x7a, 0x05, 0x90, 0x1d, 0x48, 0x00, 0x68, + 0x04, 0x90, 0x58, 0x46, 0xd5, 0xf8, 0x04, 0xb0, 0xcd, 0xf8, 0x00, 0xb0, + 0xcd, 0xe9, 0x01, 0x17, 0xcd, 0xf8, 0x0c, 0xe0, 0x83, 0x46, 0x20, 0x46, + 0x19, 0x46, 0x17, 0x46, 0x62, 0x46, 0xdd, 0xe9, 0x04, 0x43, 0xa0, 0x47, + 0x10, 0x48, 0x01, 0x68, 0x06, 0x98, 0x88, 0x47, 0x28, 0x46, 0xe0, 0xf7, + 0xf1, 0xfd, 0xff, 0xe7, 0x38, 0x78, 0x01, 0x36, 0x86, 0x42, 0xff, 0xf4, + 0x74, 0xaf, 0x03, 0xe0, 0x0d, 0x48, 0x00, 0x68, 0x80, 0x47, 0xf5, 0xe7, + 0x0c, 0x48, 0x00, 0x68, 0x07, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0x00, 0x47, + 0x5c, 0x34, 0x01, 0x00, 0x10, 0x5a, 0x01, 0x00, 0x10, 0x61, 0x01, 0x00, + 0xe4, 0x5e, 0x01, 0x00, 0x24, 0xc5, 0x08, 0x00, 0x24, 0x9d, 0x08, 0x00, + 0xdc, 0xdc, 0x08, 0x00, 0x68, 0x8a, 0x01, 0x00, 0xd8, 0xdc, 0x08, 0x00, + 0x04, 0x9d, 0x08, 0x00, 0xe0, 0xdc, 0x08, 0x00, 0x19, 0x49, 0x09, 0x68, + 0x21, 0xb1, 0x49, 0x68, 0x81, 0x42, 0x04, 0xbf, 0x01, 0x20, 0x70, 0x47, + 0x16, 0x49, 0x49, 0x68, 0x29, 0xb1, 0x49, 0x68, 0x08, 0x1a, 0xb0, 0xfa, + 0x80, 0xf0, 0x40, 0x09, 0x70, 0x47, 0x00, 0x20, 0x70, 0x47, 0x00, 0xbf, + 0x70, 0xb5, 0x06, 0x46, 0x93, 0xf8, 0x2d, 0x00, 0x0f, 0x28, 0x16, 0xd0, + 0xb6, 0xf9, 0x88, 0x00, 0xb0, 0xf1, 0xff, 0x3f, 0x11, 0xdc, 0x0a, 0x48, + 0x14, 0x46, 0x0d, 0x46, 0x00, 0x68, 0x10, 0xb9, 0x08, 0x48, 0x40, 0x68, + 0x18, 0xb1, 0x30, 0x46, 0xff, 0xf7, 0xd6, 0xff, 0x28, 0xb1, 0x06, 0x48, + 0x29, 0x46, 0x22, 0x46, 0x03, 0x68, 0x30, 0x46, 0x98, 0x47, 0x00, 0x20, + 0x70, 0xbd, 0x00, 0xbf, 0xa0, 0x52, 0x01, 0x00, 0xd8, 0x5d, 0x01, 0x00, + 0x18, 0xdf, 0x08, 0x00, 0x29, 0x29, 0x05, 0xd1, 0x10, 0xb5, 0x00, 0x24, + 0x80, 0xf8, 0x22, 0x41, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x36, 0xb8, + 0xb0, 0xb5, 0x04, 0x46, 0x48, 0x79, 0x03, 0x28, 0x0c, 0xd3, 0x0d, 0x79, + 0x20, 0x46, 0x00, 0xf0, 0x33, 0xf8, 0x05, 0xf0, 0x01, 0x01, 0x20, 0x46, + 0x0f, 0x22, 0x20, 0x23, 0xbd, 0xe8, 0xb0, 0x40, 0xff, 0xf7, 0xe6, 0xbe, + 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x2b, 0xb8, 0x00, 0xbf, + 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0xcc, 0xde, 0x08, 0x00, 0x91, 0x61, 0x04, 0x00, + 0x50, 0xdb, 0x08, 0x00, 0xed, 0x5f, 0x04, 0x00, 0xf8, 0xde, 0x08, 0x00, + 0xdd, 0x61, 0x04, 0x00, 0xb4, 0xdc, 0x08, 0x00, 0xf1, 0x61, 0x04, 0x00, + 0x4b, 0xf6, 0x71, 0x1c, 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf2, 0x11, 0x1c, 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf6, 0x0d, 0x4c, 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xbc, 0xb5, 0x04, 0x46, 0x00, 0x68, 0x80, 0xb1, 0x0d, 0x46, 0xe1, 0x7b, + 0x01, 0x39, 0x01, 0x29, 0x0c, 0xd8, 0x41, 0x69, 0xd1, 0xf8, 0xd4, 0x10, + 0x49, 0x7f, 0x19, 0xb9, 0x58, 0x49, 0x40, 0x78, 0x09, 0x68, 0x88, 0x47, + 0x28, 0x78, 0x01, 0x28, 0x06, 0xd1, 0xbc, 0xbd, 0x20, 0x46, 0x29, 0x46, + 0xbd, 0xe8, 0xbc, 0x40, 0x00, 0xf0, 0xbc, 0xb9, 0x21, 0x68, 0x4c, 0x48, + 0xab, 0x78, 0xb1, 0xf8, 0xb0, 0x20, 0x05, 0x68, 0x48, 0x69, 0x02, 0xf0, + 0x04, 0x02, 0x00, 0x92, 0x02, 0x22, 0xa8, 0x47, 0x4c, 0x49, 0x20, 0x68, + 0x09, 0x68, 0xbd, 0xe8, 0xbc, 0x40, 0x08, 0x47, 0xf8, 0xb5, 0x04, 0x46, + 0xb0, 0xf8, 0xb0, 0x00, 0x16, 0x46, 0x0d, 0x46, 0xc0, 0x07, 0x02, 0xd0, + 0x22, 0x2d, 0x18, 0xbf, 0x16, 0x25, 0x3a, 0x49, 0x94, 0xf8, 0xb9, 0x00, + 0x0a, 0x68, 0x04, 0xf1, 0xcc, 0x01, 0x90, 0x47, 0xa0, 0x69, 0x18, 0xb1, + 0x36, 0x49, 0x4a, 0x69, 0x00, 0x21, 0x90, 0x47, 0x35, 0x4f, 0x97, 0xf8, + 0x2e, 0x00, 0x60, 0xb3, 0x39, 0x68, 0xa1, 0x42, 0x29, 0xd1, 0xb4, 0xf8, + 0xb0, 0x10, 0x8a, 0x07, 0x08, 0xd5, 0x31, 0x48, 0x01, 0xf0, 0x04, 0x02, + 0x29, 0x46, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x97, 0xf8, 0x2e, 0x00, + 0x19, 0x28, 0x01, 0xd0, 0x17, 0x28, 0x14, 0xd1, 0x39, 0x68, 0x60, 0x69, + 0x49, 0x69, 0x88, 0x42, 0x0f, 0xd1, 0x29, 0x49, 0xb4, 0xf8, 0xb0, 0x20, + 0x2b, 0x46, 0x0e, 0x68, 0x21, 0x78, 0x02, 0xf0, 0x04, 0x02, 0x00, 0x92, + 0x00, 0x29, 0x18, 0xbf, 0x01, 0x21, 0x4a, 0x00, 0x21, 0x46, 0xb0, 0x47, + 0x00, 0x26, 0x22, 0x48, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0x01, 0x2e, + 0x06, 0xd1, 0x20, 0x49, 0x94, 0xf8, 0xb9, 0x00, 0x2a, 0x46, 0x0b, 0x68, + 0x00, 0x21, 0x98, 0x47, 0x20, 0x78, 0x00, 0xf0, 0xfe, 0x00, 0x02, 0x28, + 0x18, 0xd1, 0x61, 0x69, 0x60, 0x78, 0x00, 0x22, 0xd1, 0xf8, 0xd4, 0x10, + 0x01, 0xeb, 0x80, 0x01, 0xc1, 0xf8, 0x94, 0x20, 0x61, 0x69, 0xd1, 0xf8, + 0xd4, 0x10, 0x4a, 0x7f, 0x8a, 0xb1, 0x80, 0x00, 0x01, 0x22, 0x02, 0xfa, + 0x00, 0xf0, 0xd1, 0xf8, 0x90, 0x20, 0x22, 0xea, 0x00, 0x00, 0xc1, 0xf8, + 0x90, 0x00, 0x09, 0xe0, 0x0e, 0x48, 0x04, 0xf1, 0x94, 0x01, 0x02, 0x68, + 0x0d, 0x48, 0x90, 0x47, 0x02, 0xe0, 0x0d, 0x49, 0x09, 0x68, 0x88, 0x47, + 0x0c, 0x48, 0x01, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x40, 0x08, 0x47, + 0x80, 0xc3, 0x08, 0x00, 0x18, 0xb1, 0x08, 0x00, 0x10, 0x5a, 0x01, 0x00, + 0x44, 0xda, 0x08, 0x00, 0x48, 0xda, 0x08, 0x00, 0x4c, 0xda, 0x08, 0x00, + 0x34, 0xc5, 0x08, 0x00, 0x50, 0xda, 0x08, 0x00, 0x08, 0x5a, 0x01, 0x00, + 0x9c, 0xda, 0x08, 0x00, 0x40, 0xda, 0x08, 0x00, 0xb0, 0xb5, 0x05, 0x46, + 0x27, 0x48, 0x0c, 0x46, 0x4f, 0xf0, 0xff, 0x31, 0x81, 0x60, 0x26, 0x48, + 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, 0x28, 0x46, 0x21, 0x46, 0xbd, 0xe8, + 0xb0, 0x40, 0x00, 0xf0, 0x09, 0xb9, 0x00, 0xbf, 0xb0, 0xb5, 0x05, 0x46, + 0x2d, 0x48, 0x0c, 0x46, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, 0x30, 0xb1, + 0x1b, 0x49, 0x4f, 0xf0, 0xff, 0x32, 0x8a, 0x60, 0x1a, 0x49, 0x09, 0x68, + 0x88, 0x47, 0x28, 0x46, 0x21, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, + 0xf9, 0xb8, 0x00, 0xbf, 0x10, 0xb5, 0x04, 0x46, 0x22, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x30, 0xb1, 0x11, 0x49, 0x4f, 0xf0, 0xff, 0x32, + 0x8a, 0x60, 0x10, 0x49, 0x09, 0x68, 0x88, 0x47, 0x20, 0x46, 0xbd, 0xe8, + 0x10, 0x40, 0x00, 0xf0, 0xeb, 0xb8, 0x00, 0xbf, 0xb0, 0xb5, 0x05, 0x46, + 0x18, 0x48, 0x0c, 0x46, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, 0x30, 0xb1, + 0x06, 0x49, 0x4f, 0xf0, 0xff, 0x32, 0x8a, 0x60, 0x05, 0x49, 0x09, 0x68, + 0x88, 0x47, 0x28, 0x46, 0x21, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, + 0xdb, 0xb8, 0x00, 0xbf, 0x34, 0x5e, 0x01, 0x00, 0x4c, 0xc3, 0x08, 0x00, + 0x80, 0xb5, 0x0c, 0x49, 0x09, 0x68, 0x88, 0x47, 0x90, 0xb1, 0x90, 0xf8, + 0xb9, 0x00, 0x16, 0x28, 0x0e, 0xd8, 0x09, 0x49, 0x00, 0xeb, 0x40, 0x02, + 0x51, 0xf8, 0x22, 0x20, 0x42, 0xb1, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, + 0x80, 0x00, 0x00, 0x79, 0x02, 0x28, 0x04, 0xbf, 0x01, 0x20, 0x80, 0xbd, + 0x00, 0x20, 0x80, 0xbd, 0xec, 0xbf, 0x08, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0x10, 0xb5, 0x04, 0x46, 0x0b, 0x48, 0x86, 0x45, 0x04, 0xd0, 0x20, 0x46, + 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0xb4, 0xb8, 0x00, 0x2c, 0xf8, 0xd0, + 0x20, 0x46, 0xff, 0xf7, 0xd3, 0xff, 0x08, 0xb1, 0x00, 0x20, 0x10, 0xbd, + 0x04, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x00, 0x28, 0xec, 0xd1, + 0xf6, 0xe7, 0x00, 0xbf, 0x57, 0x6e, 0x0a, 0x10, 0xa4, 0x9b, 0x08, 0x00, + 0xb0, 0xb5, 0xa1, 0xf1, 0xbc, 0x04, 0x02, 0x2c, 0x01, 0xd3, 0x21, 0x29, + 0x06, 0xd1, 0x1c, 0x68, 0xb4, 0xf8, 0xb0, 0x50, 0x25, 0xf0, 0x04, 0x05, + 0xa4, 0xf8, 0xb0, 0x50, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x94, 0xb8, + 0xfe, 0xb5, 0x0c, 0x46, 0x41, 0x88, 0x06, 0x23, 0x11, 0xf4, 0x4c, 0x75, + 0x08, 0xbf, 0x02, 0x23, 0x46, 0x78, 0x94, 0xf8, 0x35, 0x10, 0x36, 0xb1, + 0x0c, 0x26, 0x00, 0x2d, 0x08, 0xbf, 0x04, 0x26, 0x02, 0x29, 0x38, 0xbf, + 0x33, 0x46, 0x26, 0x68, 0x01, 0x29, 0x75, 0x69, 0x05, 0xd8, 0xd5, 0xf8, + 0xd4, 0x10, 0x49, 0x7f, 0x00, 0x29, 0x18, 0xbf, 0x02, 0x33, 0x01, 0x78, + 0x07, 0x48, 0x07, 0x68, 0x02, 0x20, 0xcd, 0xe9, 0x00, 0x06, 0x28, 0x46, + 0xb8, 0x47, 0x94, 0xf8, 0x35, 0x10, 0x01, 0x29, 0x02, 0xd8, 0x01, 0x28, + 0x08, 0xbf, 0x02, 0x20, 0xfe, 0xbd, 0x00, 0xbf, 0xec, 0xdd, 0x08, 0x00, + 0x0d, 0x48, 0x0e, 0x49, 0x01, 0x60, 0x0e, 0x48, 0x0e, 0x49, 0x01, 0x60, + 0x0e, 0x48, 0x0f, 0x49, 0x01, 0x60, 0x0f, 0x48, 0x0f, 0x49, 0x01, 0x60, + 0x0f, 0x48, 0x10, 0x49, 0x01, 0x60, 0x10, 0x48, 0x10, 0x49, 0x01, 0x60, + 0x10, 0x48, 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, 0x11, 0x49, 0x01, 0x60, + 0x11, 0x48, 0x12, 0x49, 0x01, 0x60, 0x70, 0x47, 0x3c, 0xd4, 0x08, 0x00, + 0xdd, 0x62, 0x04, 0x00, 0x14, 0xde, 0x08, 0x00, 0x81, 0x62, 0x04, 0x00, + 0x10, 0xde, 0x08, 0x00, 0x09, 0x64, 0x04, 0x00, 0x90, 0xc2, 0x08, 0x00, + 0x2d, 0x64, 0x04, 0x00, 0x94, 0xc2, 0x08, 0x00, 0x59, 0x64, 0x04, 0x00, + 0x98, 0xc2, 0x08, 0x00, 0x81, 0x64, 0x04, 0x00, 0xcc, 0xba, 0x08, 0x00, + 0xf1, 0x64, 0x04, 0x00, 0x60, 0xde, 0x08, 0x00, 0x2d, 0x65, 0x04, 0x00, + 0xec, 0xd9, 0x08, 0x00, 0x51, 0x65, 0x04, 0x00, 0x47, 0xf6, 0x01, 0x3c, + 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf2, 0x45, 0x5c, + 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf2, 0xe9, 0x5c, + 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf6, 0x25, 0x1c, + 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf6, 0x19, 0x2c, + 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf6, 0x75, 0x0c, + 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x47, 0xf6, 0x05, 0x5c, + 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x2d, 0xe9, 0xf0, 0x43, + 0x8b, 0xb0, 0x81, 0x46, 0x51, 0x48, 0x0e, 0x46, 0x01, 0x68, 0xbc, 0x20, + 0x88, 0x47, 0x04, 0x46, 0x78, 0xb1, 0x4f, 0x49, 0x30, 0x7c, 0x00, 0x23, + 0xd1, 0xf8, 0xb0, 0x11, 0x81, 0x42, 0x4d, 0x48, 0x38, 0xbf, 0x01, 0x23, + 0x99, 0xf8, 0x35, 0x21, 0xd9, 0xf8, 0xd4, 0x10, 0x05, 0x68, 0x20, 0x46, + 0xa8, 0x47, 0xb7, 0x88, 0x01, 0x2f, 0x03, 0xd1, 0xf0, 0x88, 0x00, 0x28, + 0x18, 0xbf, 0x01, 0x37, 0x88, 0x48, 0x99, 0xf8, 0x88, 0x24, 0x04, 0xab, + 0x05, 0x68, 0x30, 0x88, 0x12, 0x07, 0x4f, 0xf0, 0x00, 0x02, 0x4f, 0xea, + 0x50, 0x01, 0x70, 0x88, 0xcd, 0xe9, 0x00, 0x43, 0xfb, 0xb2, 0xcd, 0xe9, + 0x02, 0x22, 0x54, 0xbf, 0x00, 0x22, 0x03, 0x22, 0x40, 0x08, 0xa8, 0x47, + 0xbd, 0xf8, 0x1e, 0x10, 0xf8, 0xb2, 0x81, 0x42, 0x38, 0xbf, 0x0f, 0x46, + 0x1c, 0xb3, 0x20, 0x78, 0x08, 0xb3, 0x36, 0x48, 0x5f, 0xfa, 0x87, 0xf8, + 0x04, 0xa9, 0x42, 0x46, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0xc0, 0xb9, + 0xf1, 0x88, 0xbd, 0xf8, 0x1e, 0x00, 0x59, 0xb1, 0x04, 0x21, 0x51, 0xfa, + 0x87, 0xf1, 0x81, 0x42, 0x0f, 0xd2, 0x01, 0x38, 0xad, 0xf8, 0x1e, 0x00, + 0xbd, 0xf8, 0x1a, 0x00, 0x01, 0x30, 0x06, 0xe0, 0xbd, 0xf8, 0x1a, 0x10, + 0xa0, 0xeb, 0x08, 0x00, 0xad, 0xf8, 0x1e, 0x80, 0x08, 0x44, 0xad, 0xf8, + 0x1a, 0x00, 0x26, 0x48, 0x04, 0xab, 0x31, 0x46, 0x22, 0x46, 0x05, 0x68, + 0xf8, 0xb2, 0x00, 0x90, 0x48, 0x46, 0xa8, 0x47, 0x70, 0x89, 0xbd, 0xf8, + 0x1a, 0x20, 0xb0, 0xeb, 0x42, 0x0f, 0x05, 0xd1, 0x31, 0x89, 0xbd, 0xf8, + 0x1c, 0x30, 0xb1, 0xeb, 0x43, 0x0f, 0x0c, 0xd0, 0x31, 0x7c, 0x05, 0x29, + 0x06, 0xd2, 0xbd, 0xf8, 0x1c, 0x10, 0x50, 0x00, 0x70, 0x81, 0x49, 0x00, + 0x31, 0x81, 0x00, 0xe0, 0x31, 0x89, 0x00, 0x22, 0x72, 0x74, 0x4d, 0x4d, + 0x4b, 0x4e, 0x80, 0xb2, 0x89, 0xb2, 0x08, 0x23, 0x2f, 0x68, 0xc6, 0xe9, + 0x00, 0x10, 0x48, 0xf2, 0x08, 0x00, 0x00, 0x21, 0x32, 0x46, 0xb8, 0x47, + 0xd9, 0xf8, 0xd4, 0x00, 0x2d, 0x68, 0x32, 0x46, 0x08, 0x23, 0x41, 0x69, + 0x00, 0x8b, 0x00, 0x09, 0xc6, 0xe9, 0x00, 0x10, 0x48, 0xf2, 0x09, 0x00, + 0x00, 0x21, 0xa8, 0x47, 0x14, 0xb1, 0x20, 0x46, 0xe0, 0xf7, 0x98, 0xfa, + 0x0b, 0xb0, 0xbd, 0xe8, 0xf0, 0x83, 0x00, 0xbf, 0xd4, 0x9b, 0x08, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0xc4, 0x9b, 0x08, 0x00, 0x48, 0xce, 0x08, 0x00, + 0xe4, 0xdb, 0x08, 0x00, 0x04, 0x4b, 0x1b, 0x78, 0xff, 0x2b, 0x18, 0xbf, + 0x93, 0x42, 0x01, 0xd1, 0x00, 0xf0, 0x7e, 0xb8, 0x70, 0x47, 0x00, 0xbf, + 0x7f, 0xd3, 0x05, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x89, 0xb0, 0xdd, 0xf8, + 0x48, 0x90, 0x05, 0xac, 0x0f, 0xc4, 0xb9, 0xf1, 0x00, 0x0f, 0x46, 0xd0, + 0x99, 0xf8, 0x00, 0x00, 0x03, 0x28, 0x42, 0xd3, 0x28, 0x4c, 0xdf, 0xf8, + 0xa4, 0x80, 0x00, 0x27, 0x40, 0xf2, 0x8f, 0x1b, 0x09, 0xeb, 0xc7, 0x00, + 0x85, 0x1d, 0x17, 0x2f, 0x03, 0xd3, 0x00, 0x20, 0xd5, 0x21, 0xda, 0xf7, + 0xe1, 0xfb, 0x28, 0x88, 0x58, 0x45, 0x2b, 0xd1, 0x99, 0xf8, 0x00, 0x60, + 0xb7, 0x42, 0x15, 0xd2, 0xba, 0x46, 0xba, 0xf1, 0x16, 0x0f, 0x05, 0xd3, + 0x00, 0x20, 0xdd, 0x21, 0xda, 0xf7, 0xd2, 0xfb, 0x99, 0xf8, 0x00, 0x60, + 0x09, 0xeb, 0xca, 0x01, 0x08, 0x22, 0x08, 0x1d, 0x0c, 0x31, 0xee, 0xf7, + 0xc3, 0xfb, 0x0a, 0xf1, 0x01, 0x0a, 0xf0, 0xb2, 0x82, 0x45, 0xea, 0xd3, + 0xd8, 0xf8, 0x00, 0x60, 0x4f, 0xf4, 0x00, 0x40, 0x00, 0x21, 0x22, 0x46, + 0x04, 0x23, 0x27, 0x60, 0xb0, 0x47, 0x99, 0xf8, 0x00, 0x00, 0x01, 0x38, + 0x89, 0xf8, 0x00, 0x00, 0xc0, 0xb2, 0x87, 0x42, 0xcb, 0xd3, 0x04, 0xe0, + 0x99, 0xf8, 0x00, 0x00, 0x01, 0x37, 0x87, 0x42, 0xc2, 0xd3, 0x13, 0x98, + 0x05, 0xab, 0xcd, 0xf8, 0x00, 0x90, 0x01, 0x90, 0x14, 0x98, 0x02, 0x90, + 0x15, 0x98, 0x03, 0x90, 0x0f, 0xcb, 0x00, 0xf0, 0x23, 0xf8, 0x09, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0x8c, 0x34, 0x01, 0x00, 0x78, 0x9b, 0x08, 0x00, + 0x04, 0x48, 0x05, 0x49, 0x01, 0x60, 0x05, 0x48, 0x05, 0x49, 0x01, 0x60, + 0x05, 0x48, 0x06, 0x49, 0x01, 0x60, 0x70, 0x47, 0xbc, 0xc8, 0x08, 0x00, + 0xe9, 0x67, 0x04, 0x00, 0xa0, 0xdc, 0x08, 0x00, 0x85, 0x66, 0x04, 0x00, + 0xc8, 0x9b, 0x08, 0x00, 0x01, 0x68, 0x04, 0x00, 0x49, 0xf6, 0xb5, 0x2c, + 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf2, 0x01, 0x2c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x90, 0xf8, 0xeb, 0x04, + 0x81, 0x07, 0x48, 0xbf, 0x5f, 0xea, 0x00, 0x71, 0x01, 0xd4, 0x00, 0x20, + 0x70, 0x47, 0xc0, 0x06, 0x5c, 0xbf, 0x01, 0x20, 0x70, 0x47, 0xf8, 0xe7, + 0xb0, 0xb5, 0x04, 0x46, 0x5a, 0x48, 0x0d, 0x46, 0x90, 0xf8, 0xfe, 0x01, + 0x80, 0x07, 0x03, 0xd5, 0x20, 0x46, 0xff, 0xf7, 0xe7, 0xff, 0x28, 0xb1, + 0x20, 0x46, 0x29, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x38, 0xb9, + 0x03, 0x48, 0x0a, 0x21, 0x24, 0x22, 0x03, 0x68, 0x20, 0x46, 0xbd, 0xe8, + 0xb0, 0x40, 0x18, 0x47, 0x80, 0xcb, 0x08, 0x00, 0xb0, 0xb5, 0x04, 0x46, + 0xd0, 0xf8, 0xb4, 0x05, 0x50, 0xb3, 0x0d, 0x46, 0x90, 0xf8, 0x2c, 0x10, + 0x04, 0x29, 0x25, 0xd1, 0x90, 0xf8, 0x2e, 0x10, 0x11, 0xb3, 0x47, 0x49, + 0x91, 0xf8, 0xff, 0x21, 0xd2, 0x06, 0x1d, 0xd5, 0x91, 0xf8, 0x02, 0x22, + 0xd3, 0x07, 0x19, 0xd0, 0x12, 0x07, 0x17, 0xd5, 0x94, 0xf8, 0xb0, 0x25, + 0xaa, 0x42, 0x13, 0xd0, 0x90, 0xf8, 0x64, 0x30, 0x93, 0x42, 0x0f, 0xd1, + 0x94, 0xf8, 0x8b, 0x20, 0x52, 0x06, 0x0b, 0xd4, 0x90, 0xf8, 0x2f, 0x20, + 0xd2, 0x06, 0x05, 0xd5, 0x90, 0xf8, 0x32, 0x00, 0xc2, 0x07, 0x01, 0xd0, + 0x00, 0x07, 0x03, 0xd4, 0x1a, 0x20, 0xb0, 0xbd, 0x0c, 0x20, 0xb0, 0xbd, + 0x91, 0xf8, 0xfe, 0x01, 0x80, 0x07, 0x04, 0xd5, 0x20, 0x46, 0xff, 0xf7, + 0x9d, 0xff, 0x00, 0x28, 0xf2, 0xd0, 0x0c, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x88, 0xb1, 0x01, 0x46, 0xd4, 0xf8, 0xb4, 0x05, 0x01, 0x23, 0x90, 0xf8, + 0x6c, 0x20, 0x80, 0xf8, 0x64, 0x50, 0x42, 0xf0, 0x01, 0x02, 0x80, 0xf8, + 0x6c, 0x20, 0x20, 0x46, 0xa4, 0x22, 0x00, 0xf0, 0xe5, 0xf8, 0x00, 0x20, + 0xb0, 0xbd, 0x07, 0x20, 0xb0, 0xbd, 0x00, 0xbf, 0xe0, 0xc4, 0x08, 0x00, + 0xd0, 0xf8, 0xb4, 0x25, 0x0a, 0xb1, 0x00, 0xf0, 0xdf, 0xb8, 0x70, 0x47, + 0xf8, 0xb5, 0x0e, 0x46, 0x04, 0x46, 0x60, 0xb1, 0x94, 0xf8, 0x2c, 0x00, + 0x94, 0xf8, 0x2d, 0x70, 0x25, 0x68, 0x60, 0xb1, 0x03, 0x28, 0x0a, 0xd8, + 0x28, 0x46, 0x00, 0x21, 0x00, 0xf0, 0xd4, 0xf8, 0x05, 0xe0, 0x00, 0x20, + 0xab, 0x21, 0xda, 0xf7, 0xdd, 0xfa, 0x2d, 0x20, 0x07, 0x78, 0x20, 0x46, + 0x70, 0x21, 0xdd, 0xf7, 0x31, 0xf9, 0x12, 0x48, 0x84, 0xf8, 0x2d, 0x70, + 0x90, 0xf8, 0x7d, 0x02, 0x87, 0x42, 0x0a, 0xd2, 0x22, 0x2e, 0x08, 0xd1, + 0x78, 0x1c, 0x25, 0x60, 0x84, 0xf8, 0x2d, 0x00, 0xd5, 0xf8, 0xd4, 0x00, + 0x40, 0x7f, 0x60, 0xb1, 0xf8, 0xbd, 0xd5, 0xf8, 0xb4, 0x05, 0xe0, 0xf7, + 0x41, 0xf9, 0x00, 0x20, 0xc5, 0xf8, 0xb4, 0x05, 0x06, 0x48, 0x00, 0x68, + 0xbd, 0xe8, 0xf8, 0x40, 0x00, 0x47, 0x05, 0x48, 0x01, 0x68, 0x28, 0x46, + 0xbd, 0xe8, 0xf8, 0x40, 0x08, 0x47, 0x00, 0xbf, 0xe8, 0x65, 0x08, 0x00, + 0x04, 0x9d, 0x08, 0x00, 0x80, 0xdd, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, + 0x0b, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x60, 0xb1, 0xd4, 0xf8, + 0xe0, 0x02, 0x70, 0xb1, 0x08, 0x48, 0x01, 0x68, 0x04, 0xf5, 0x58, 0x70, + 0x88, 0x47, 0x40, 0xb1, 0xbd, 0xe8, 0x10, 0x40, 0xe0, 0xf7, 0x18, 0xb9, + 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0xff, 0xf7, 0xc9, 0xbb, 0x10, 0xbd, + 0xb8, 0xc9, 0x08, 0x00, 0x24, 0x9d, 0x08, 0x00, 0xbc, 0xb5, 0x06, 0x9d, + 0x1c, 0x46, 0x0c, 0x2a, 0x08, 0xd1, 0xff, 0xf7, 0xdb, 0xff, 0x4c, 0xb1, + 0x45, 0xb1, 0x20, 0x46, 0xbd, 0xe8, 0xbc, 0x40, 0xe0, 0xf7, 0x00, 0xb9, + 0x23, 0x46, 0x00, 0x95, 0x00, 0xf0, 0x74, 0xf8, 0xbc, 0xbd, 0x00, 0xbf, + 0x1c, 0xb5, 0x04, 0x46, 0x0a, 0x29, 0x19, 0xd1, 0x94, 0xf8, 0x35, 0x11, + 0x61, 0x20, 0xe0, 0xf7, 0xd9, 0xf8, 0x20, 0x46, 0xff, 0xf7, 0xc2, 0xff, + 0xd4, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0x90, 0xb1, 0x0c, 0x48, 0x94, 0xf8, + 0x35, 0x11, 0x47, 0xf2, 0xf8, 0x52, 0x47, 0xf2, 0xf8, 0x53, 0x04, 0x68, + 0x00, 0x20, 0xcd, 0xe9, 0x00, 0x00, 0x61, 0x20, 0xa0, 0x47, 0x1c, 0xbd, + 0x20, 0x46, 0xbd, 0xe8, 0x1c, 0x40, 0x00, 0xf0, 0x55, 0xb8, 0x04, 0x48, + 0x01, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0x1c, 0x40, 0x08, 0x47, 0x00, 0xbf, + 0xcc, 0x9b, 0x08, 0x00, 0x60, 0xcb, 0x08, 0x00, 0x09, 0x48, 0x0a, 0x49, + 0x01, 0x60, 0x0a, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, 0x0b, 0x49, + 0x01, 0x60, 0x0b, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0c, 0x49, + 0x01, 0x60, 0x0c, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x78, 0xcb, 0x08, 0x00, 0x61, 0x69, 0x04, 0x00, 0x9c, 0xcb, 0x08, 0x00, + 0x29, 0x69, 0x04, 0x00, 0x54, 0xdd, 0x08, 0x00, 0x0d, 0x6a, 0x04, 0x00, + 0x6c, 0xcb, 0x08, 0x00, 0x19, 0x6a, 0x04, 0x00, 0x50, 0xdd, 0x08, 0x00, + 0xe1, 0x6a, 0x04, 0x00, 0x90, 0xcb, 0x08, 0x00, 0x09, 0x6b, 0x04, 0x00, + 0x42, 0xf6, 0x11, 0x2c, 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x44, 0xf2, 0xcd, 0x7c, 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x42, 0xf6, 0xb9, 0x7c, 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x48, 0xf2, 0xf7, 0x4c, 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x42, 0xf2, 0xcd, 0x2c, 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x42, 0xf6, 0xd5, 0x5c, 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x10, 0xb5, 0x04, 0x46, 0x00, 0x78, 0x82, 0x28, 0x1f, 0xd1, 0x60, 0x68, + 0x10, 0xb3, 0x09, 0xf0, 0x77, 0xfe, 0x20, 0x48, 0x64, 0x68, 0x02, 0x68, + 0x94, 0xf8, 0x35, 0x11, 0x1e, 0x48, 0x90, 0x47, 0x1e, 0x48, 0x00, 0x21, + 0x80, 0xf8, 0x30, 0x10, 0x1d, 0x48, 0x21, 0x46, 0x02, 0x68, 0x04, 0xf5, + 0x80, 0x70, 0x90, 0x47, 0xc0, 0xb1, 0x01, 0x46, 0x90, 0xf8, 0x24, 0x01, + 0x07, 0x28, 0x0b, 0xd1, 0x19, 0x48, 0x02, 0x68, 0x13, 0x20, 0x90, 0x47, + 0x0e, 0xe0, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x3c, 0xb8, + 0x18, 0x48, 0x18, 0xe0, 0x08, 0x20, 0x00, 0x22, 0x81, 0xf8, 0x39, 0x00, + 0x10, 0x48, 0x03, 0x68, 0x3f, 0x20, 0x98, 0x47, 0x10, 0x48, 0x00, 0x22, + 0x01, 0x78, 0x40, 0x78, 0x84, 0xf8, 0x7a, 0x04, 0x0b, 0x48, 0x84, 0xf8, + 0x79, 0x14, 0x21, 0x46, 0x03, 0x68, 0x01, 0x20, 0x98, 0x47, 0x0b, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x0a, 0x48, 0x00, 0x68, 0xbd, 0xe8, 0x10, 0x40, + 0x00, 0x47, 0x00, 0xbf, 0xa4, 0xda, 0x08, 0x00, 0xc0, 0x52, 0x01, 0x00, + 0x38, 0x5d, 0x01, 0x00, 0xf0, 0xba, 0x08, 0x00, 0xb8, 0x9b, 0x08, 0x00, + 0x64, 0xd8, 0x08, 0x00, 0xbc, 0x58, 0x01, 0x00, 0xec, 0xba, 0x08, 0x00, + 0xfc, 0xba, 0x08, 0x00, 0x60, 0xc2, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0xdc, 0xdb, 0x08, 0x00, 0x05, 0x6c, 0x04, 0x00, + 0x48, 0xf6, 0xa5, 0x3c, 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x80, 0xb5, 0xd0, 0xf8, 0xfc, 0x22, 0x13, 0xb2, 0x00, 0x2b, 0x05, 0xd4, + 0x12, 0x07, 0x03, 0xd4, 0xbd, 0xe8, 0x80, 0x40, 0x00, 0xf0, 0x14, 0xb8, + 0x03, 0x48, 0x00, 0x68, 0x80, 0x47, 0x03, 0x48, 0x00, 0x68, 0xbd, 0xe8, + 0x80, 0x40, 0x00, 0x47, 0x84, 0xda, 0x08, 0x00, 0x88, 0xda, 0x08, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, 0x90, 0xdb, 0x08, 0x00, + 0xdd, 0x6c, 0x04, 0x00, 0x48, 0xf6, 0x51, 0x2c, 0xc1, 0xf2, 0x0b, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xd8, 0xb3, 0xb0, 0xb5, 0x86, 0xb0, 0x8d, 0xf8, + 0x10, 0x10, 0xad, 0xf8, 0x0e, 0x30, 0x90, 0xf8, 0x3a, 0x10, 0x90, 0xf8, + 0x35, 0x31, 0x0a, 0x9c, 0x8d, 0xf8, 0x06, 0x20, 0x90, 0xf8, 0x74, 0x20, + 0x8d, 0xf8, 0x04, 0x30, 0x15, 0x4b, 0x8d, 0xf8, 0x07, 0x10, 0xb0, 0xf8, + 0xde, 0x13, 0xad, 0xf8, 0x12, 0x40, 0x8d, 0xf8, 0x11, 0x20, 0x01, 0xac, + 0x1f, 0x4a, 0x1b, 0x78, 0xad, 0xf8, 0x08, 0x10, 0xb0, 0xf8, 0xe0, 0x13, + 0xb0, 0xf8, 0xe2, 0x03, 0x8d, 0xf8, 0x05, 0x30, 0xad, 0xf8, 0x0a, 0x10, + 0xad, 0xf8, 0x0c, 0x00, 0x04, 0xf1, 0x10, 0x00, 0x03, 0x21, 0x03, 0x23, + 0xda, 0xf7, 0x4c, 0xf9, 0x07, 0x48, 0x01, 0x21, 0x00, 0x22, 0x23, 0x46, + 0x05, 0x68, 0x14, 0x20, 0x00, 0x90, 0x40, 0xf2, 0x37, 0x20, 0xa8, 0x47, + 0x06, 0xb0, 0xbd, 0xe8, 0xb0, 0x40, 0x70, 0x47, 0x97, 0xca, 0x01, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0xc1, 0x78, 0xc2, 0x79, 0x0b, 0x4b, 0xc0, 0x7a, + 0x19, 0x70, 0x5a, 0x70, 0x98, 0x70, 0x70, 0x47, 0x08, 0x49, 0x00, 0x20, + 0x91, 0xf9, 0x00, 0x20, 0x4a, 0xb1, 0x12, 0xf1, 0x47, 0x0f, 0x06, 0xdd, + 0x01, 0x30, 0x01, 0x31, 0x03, 0x28, 0x04, 0xbf, 0x01, 0x20, 0x70, 0x47, + 0xf2, 0xe7, 0x00, 0x20, 0x70, 0x47, 0x00, 0xbf, 0x28, 0xf0, 0x05, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x87, 0xb0, 0xca, 0x48, 0x90, 0xf8, 0xd4, 0x12, + 0x00, 0x29, 0x00, 0xf0, 0x8c, 0x81, 0xc8, 0x49, 0x09, 0x78, 0x01, 0x29, + 0x00, 0xf0, 0x87, 0x81, 0xc6, 0x49, 0x09, 0x78, 0x01, 0x29, 0x00, 0xf0, + 0x82, 0x81, 0xc6, 0x4a, 0xc4, 0x4d, 0x92, 0xf8, 0x4d, 0xc0, 0x29, 0x78, + 0xbc, 0xf1, 0x00, 0x0f, 0x17, 0xd0, 0xc1, 0xb1, 0xc2, 0x4d, 0x00, 0x24, + 0x00, 0x22, 0x55, 0xf8, 0x24, 0x60, 0x66, 0xb1, 0x96, 0xf8, 0x88, 0x74, + 0xbf, 0x07, 0x08, 0xd5, 0x96, 0xf8, 0xa4, 0x74, 0x7b, 0x07, 0x01, 0xd5, + 0x3b, 0x07, 0x02, 0xd5, 0xd6, 0xf8, 0x0c, 0x35, 0x1a, 0x44, 0x01, 0x34, + 0x8c, 0x42, 0xec, 0xd3, 0x02, 0xe0, 0x00, 0x22, 0x0e, 0xe0, 0x00, 0x22, + 0xb6, 0x4b, 0x93, 0xf8, 0x7a, 0x30, 0x0b, 0xb1, 0xc2, 0x23, 0x01, 0xe0, + 0x40, 0xf2, 0x59, 0x13, 0xaf, 0x4d, 0x1c, 0xfb, 0x03, 0xf3, 0x9a, 0x42, + 0x38, 0xbf, 0x1a, 0x46, 0x00, 0x29, 0x00, 0xf0, 0x4e, 0x81, 0x00, 0xf5, + 0x35, 0x70, 0x40, 0xf2, 0x59, 0x11, 0xdf, 0xf8, 0xac, 0xb2, 0xac, 0x4f, + 0x4f, 0xf0, 0x00, 0x0a, 0x4f, 0xf0, 0x64, 0x08, 0x06, 0x90, 0x64, 0x20, + 0x50, 0x43, 0xb0, 0xfb, 0xf1, 0xf0, 0x4f, 0xf4, 0x48, 0x61, 0x03, 0x90, + 0x80, 0xb2, 0x48, 0x43, 0x02, 0x90, 0x00, 0x20, 0x05, 0x90, 0xdb, 0xf8, + 0x00, 0x40, 0xec, 0xb1, 0x94, 0xf8, 0x8d, 0x00, 0x40, 0x07, 0x19, 0xd5, + 0x94, 0xf8, 0x35, 0x11, 0x01, 0xeb, 0x41, 0x00, 0x07, 0xeb, 0x40, 0x10, + 0x40, 0x6d, 0x01, 0x30, 0x18, 0xd0, 0xda, 0xf7, 0xa7, 0xf8, 0x94, 0xf8, + 0x35, 0x11, 0x01, 0xeb, 0x41, 0x02, 0x07, 0xeb, 0x42, 0x12, 0x52, 0x6d, + 0x80, 0x1a, 0x97, 0x4a, 0x10, 0x44, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, + 0x00, 0x6f, 0x07, 0xd9, 0x28, 0x78, 0x0a, 0xf1, 0x01, 0x0a, 0x0b, 0xf1, + 0x04, 0x0b, 0x82, 0x45, 0xd7, 0xd3, 0x0c, 0xe1, 0x01, 0xeb, 0x41, 0x00, + 0x4f, 0xf0, 0xff, 0x31, 0x94, 0xf8, 0x74, 0x90, 0x07, 0xeb, 0x40, 0x10, + 0x41, 0x65, 0x94, 0xf8, 0x24, 0x01, 0x03, 0x28, 0x07, 0xd0, 0x94, 0xf8, + 0x24, 0x01, 0x84, 0x28, 0x03, 0xd0, 0x94, 0xf8, 0x24, 0x01, 0x85, 0x28, + 0x05, 0xd1, 0xd4, 0xf8, 0x88, 0x04, 0x01, 0x07, 0x01, 0xd4, 0x00, 0x23, + 0x37, 0xe0, 0x83, 0x48, 0x94, 0xf9, 0x3a, 0x50, 0xb4, 0xf8, 0xe0, 0x23, + 0xb4, 0xf8, 0xe2, 0x13, 0x90, 0xf9, 0x01, 0x30, 0xb4, 0xf8, 0xde, 0x03, + 0x9d, 0x42, 0x10, 0xda, 0xd4, 0xf8, 0xd4, 0x60, 0x76, 0x7f, 0x2e, 0xb1, + 0x06, 0x9e, 0x76, 0x7a, 0x71, 0x43, 0x64, 0x26, 0xb1, 0xfb, 0xf6, 0xf1, + 0x5d, 0x1b, 0x8e, 0xb2, 0x5b, 0x42, 0x75, 0x43, 0x95, 0xfb, 0xf3, 0xf3, + 0x00, 0xe0, 0x00, 0x23, 0x06, 0x9e, 0x15, 0x18, 0x9b, 0xb2, 0x13, 0xfa, + 0x85, 0xf2, 0xf6, 0x7a, 0xb2, 0x42, 0x40, 0xf2, 0x97, 0x80, 0xad, 0xb2, + 0x64, 0x26, 0x18, 0x44, 0x15, 0xfa, 0x81, 0xf5, 0x89, 0xb2, 0x70, 0x43, + 0x71, 0x43, 0xb0, 0xfb, 0xf2, 0xf3, 0xd4, 0xf8, 0x88, 0x04, 0xb1, 0xfb, + 0xf5, 0xf1, 0x89, 0xb2, 0x05, 0x91, 0x80, 0x07, 0x13, 0xd5, 0x94, 0xf8, + 0xa4, 0x04, 0x41, 0x07, 0x01, 0xd5, 0x00, 0x07, 0x0d, 0xd5, 0xb4, 0xf8, + 0xe4, 0x03, 0xdd, 0xf8, 0x0c, 0x80, 0x41, 0x09, 0x18, 0x29, 0x06, 0xd8, + 0x4f, 0xf4, 0x48, 0x61, 0xa1, 0xeb, 0x80, 0x00, 0x02, 0x99, 0x91, 0xfb, + 0xf0, 0xf8, 0x5e, 0x49, 0x72, 0xb6, 0x08, 0x68, 0x40, 0x00, 0x01, 0x30, + 0x08, 0x60, 0x1f, 0xfa, 0x88, 0xf0, 0x64, 0x28, 0x4f, 0xf0, 0x64, 0x00, + 0x98, 0xbf, 0x80, 0x46, 0x94, 0xf8, 0x74, 0x60, 0x06, 0x98, 0x47, 0x78, + 0xbe, 0x42, 0x49, 0xd3, 0x05, 0x98, 0x04, 0x93, 0x45, 0x28, 0x04, 0xd8, + 0xff, 0xf7, 0xe2, 0xfe, 0x04, 0x9b, 0x00, 0x28, 0x5a, 0xd0, 0x94, 0xf8, + 0x76, 0x50, 0x84, 0xf8, 0x74, 0x50, 0xbd, 0x42, 0x1e, 0xd9, 0x05, 0x98, + 0x45, 0x28, 0x1b, 0xd8, 0x06, 0x99, 0xc6, 0xf1, 0x0b, 0x02, 0xc8, 0x78, + 0xc9, 0x79, 0x12, 0xfb, 0x01, 0x00, 0x94, 0xf8, 0x3a, 0x10, 0x88, 0x42, + 0x10, 0xda, 0x06, 0x98, 0x64, 0x21, 0x40, 0x79, 0x10, 0xfb, 0x01, 0xf0, + 0x1f, 0xfa, 0x88, 0xf1, 0xb0, 0xfb, 0xf1, 0xf0, 0x99, 0xb2, 0x88, 0x42, + 0x04, 0xd9, 0xff, 0xf7, 0xbd, 0xfe, 0x04, 0x9b, 0x00, 0x28, 0x4e, 0xd0, + 0x00, 0x20, 0x84, 0xf8, 0xe6, 0x03, 0x98, 0xb2, 0x1f, 0xfa, 0x88, 0xf3, + 0x31, 0x46, 0x01, 0x22, 0x00, 0x90, 0x20, 0x46, 0xff, 0xf7, 0x64, 0xfe, + 0x3a, 0x4f, 0xb5, 0x42, 0x0c, 0xd0, 0x04, 0xf1, 0x78, 0x05, 0x00, 0x26, + 0x94, 0xf8, 0x74, 0x00, 0x3a, 0x68, 0xf1, 0xb2, 0x90, 0x47, 0x25, 0xf8, + 0x16, 0x00, 0x01, 0x36, 0x04, 0x2e, 0xf5, 0xd1, 0x2f, 0x49, 0x08, 0x68, + 0x40, 0x08, 0x08, 0x60, 0x08, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x2b, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x2e, 0x48, 0x85, 0x21, 0x4a, 0x46, + 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x1f, 0x4d, 0x22, 0x4f, 0x1d, 0xe7, + 0x24, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x1b, 0x4d, 0x17, 0xe7, + 0x06, 0x98, 0x64, 0x21, 0x35, 0x46, 0x00, 0x79, 0x10, 0xfb, 0x01, 0xf0, + 0x1f, 0xfa, 0x88, 0xf1, 0xb0, 0xfb, 0xf1, 0xf0, 0x99, 0xb2, 0x88, 0x42, + 0x9b, 0xd2, 0x1d, 0x48, 0x94, 0xf8, 0x76, 0x10, 0x02, 0x68, 0x20, 0x46, + 0x90, 0x47, 0x06, 0x98, 0x04, 0x9b, 0x94, 0xf8, 0x74, 0x50, 0x47, 0x78, + 0x8f, 0xe7, 0x94, 0xf8, 0xe6, 0x03, 0x01, 0x30, 0x84, 0xf8, 0xe6, 0x03, + 0xc0, 0xb2, 0x06, 0x28, 0xab, 0xd3, 0x00, 0x20, 0x39, 0x46, 0x84, 0xf8, + 0xe6, 0x03, 0x12, 0x48, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x04, 0x9b, + 0x94, 0xf8, 0x74, 0x50, 0x9f, 0xe7, 0x07, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0xe8, 0x65, 0x08, 0x00, 0x54, 0x34, 0x01, 0x00, 0x63, 0x34, 0x01, 0x00, + 0x5c, 0x34, 0x01, 0x00, 0x18, 0x74, 0x01, 0x00, 0x10, 0x61, 0x01, 0x00, + 0x4c, 0x49, 0x01, 0x00, 0x54, 0xf1, 0x05, 0x00, 0x80, 0xf3, 0xff, 0x0f, + 0x8a, 0x76, 0x01, 0x00, 0x18, 0x9c, 0x08, 0x00, 0x24, 0x36, 0x01, 0x00, + 0x44, 0x9c, 0x08, 0x00, 0x40, 0x9c, 0x08, 0x00, 0x38, 0x9c, 0x08, 0x00, + 0x48, 0x9c, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x08, 0xdc, 0x08, 0x00, 0xe5, 0x6d, 0x04, 0x00, 0x10, 0xb5, 0x0a, 0x49, + 0x09, 0x78, 0x69, 0xb1, 0x09, 0x4b, 0x00, 0x22, 0x53, 0xf8, 0x22, 0x40, + 0x2c, 0xb1, 0x84, 0x42, 0x03, 0xd0, 0xb4, 0xf9, 0xfc, 0x42, 0x00, 0x2c, + 0x04, 0xd4, 0x01, 0x32, 0x8a, 0x42, 0xf3, 0xd3, 0x00, 0x20, 0x10, 0xbd, + 0x01, 0x20, 0x10, 0xbd, 0x5c, 0x34, 0x01, 0x00, 0x10, 0x61, 0x01, 0x00, + 0x70, 0xb5, 0x0c, 0x46, 0x05, 0x46, 0x18, 0xb9, 0x00, 0x20, 0x41, 0x21, + 0xd9, 0xf7, 0x2a, 0xff, 0xd5, 0xf8, 0x88, 0x60, 0xb0, 0x03, 0x48, 0xbf, + 0x5f, 0xea, 0x46, 0x30, 0x30, 0xd4, 0x00, 0xf0, 0x39, 0xf8, 0x18, 0xb9, + 0x28, 0x46, 0xff, 0xf7, 0xd1, 0xff, 0x48, 0xb3, 0x30, 0xb2, 0x00, 0x28, + 0x0e, 0xd4, 0x95, 0xf8, 0x90, 0x00, 0x40, 0xf0, 0x04, 0x00, 0x85, 0xf8, + 0x90, 0x00, 0x28, 0x46, 0x00, 0xf0, 0xe4, 0xf8, 0xd5, 0xf8, 0x88, 0x00, + 0x40, 0xf4, 0x00, 0x40, 0xc5, 0xf8, 0x88, 0x00, 0xd5, 0xf8, 0xfc, 0x02, + 0x18, 0x21, 0x40, 0xf4, 0x00, 0x40, 0xc5, 0xf8, 0xfc, 0x02, 0x0b, 0x48, + 0xdc, 0xf7, 0xa6, 0xf8, 0x0a, 0x48, 0x04, 0x21, 0x00, 0x22, 0x03, 0x68, + 0x28, 0x46, 0x98, 0x47, 0x64, 0x48, 0x21, 0x46, 0x3a, 0x22, 0x03, 0x68, + 0x28, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0x18, 0x47, 0x28, 0x46, 0x21, 0x46, + 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, 0xc6, 0xb8, 0x1c, 0x7a, 0x01, 0x00, + 0xc0, 0x9b, 0x08, 0x00, 0x05, 0x48, 0x00, 0x68, 0x08, 0xb1, 0x01, 0x20, + 0x70, 0x47, 0x04, 0x48, 0x40, 0x68, 0x00, 0x28, 0x18, 0xbf, 0x01, 0x20, + 0x70, 0x47, 0x00, 0xbf, 0xa0, 0x52, 0x01, 0x00, 0xd8, 0x5d, 0x01, 0x00, + 0x70, 0xb5, 0xc0, 0xb3, 0x14, 0x46, 0x0d, 0x46, 0x06, 0x46, 0xff, 0xf7, + 0xe9, 0xff, 0x18, 0xb9, 0x28, 0x46, 0xff, 0xf7, 0x81, 0xff, 0xd0, 0xb3, + 0xd5, 0xf8, 0xd4, 0x00, 0x13, 0x22, 0x21, 0x23, 0x40, 0x7f, 0xb0, 0xfa, + 0x80, 0xf0, 0x41, 0x09, 0x28, 0x46, 0xfe, 0xf7, 0xb3, 0xfe, 0xd5, 0xf8, + 0xd4, 0x00, 0x40, 0x7f, 0x28, 0xb3, 0x19, 0x49, 0x94, 0xf8, 0x24, 0x00, + 0x09, 0x68, 0x88, 0x47, 0x94, 0xf8, 0x24, 0x10, 0x68, 0x78, 0x81, 0x42, + 0x1f, 0xd0, 0x00, 0x20, 0xff, 0x29, 0x11, 0xd0, 0x89, 0x00, 0x01, 0x22, + 0x02, 0xfa, 0x01, 0xf1, 0xd5, 0xf8, 0xd4, 0x20, 0xd2, 0xf8, 0x90, 0x30, + 0x23, 0xea, 0x01, 0x01, 0xc2, 0xf8, 0x90, 0x10, 0x94, 0xf8, 0x24, 0x10, + 0x02, 0xeb, 0x81, 0x01, 0xc1, 0xf8, 0x94, 0x00, 0x70, 0xbd, 0x00, 0x20, + 0x70, 0x21, 0xd9, 0xf7, 0x99, 0xfe, 0x0c, 0x20, 0x70, 0xbd, 0x07, 0x49, + 0xe0, 0x69, 0x09, 0x68, 0x88, 0x47, 0x00, 0x20, 0x70, 0xbd, 0x30, 0x46, + 0x29, 0x46, 0x22, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, 0x6a, 0xb8, + 0x9c, 0xda, 0x08, 0x00, 0xa0, 0xda, 0x08, 0x00, 0xb0, 0xb5, 0x0c, 0x46, + 0x05, 0x46, 0x09, 0xb9, 0x07, 0xf0, 0xdc, 0xf9, 0x28, 0x46, 0x21, 0x46, + 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x60, 0xb8, 0xf8, 0xb5, 0x06, 0x46, + 0x00, 0xf0, 0x62, 0xf8, 0x96, 0xf8, 0xf9, 0x02, 0x39, 0x28, 0x20, 0xd1, + 0x10, 0x4f, 0x06, 0xf5, 0x58, 0x74, 0x00, 0x25, 0x3a, 0x68, 0x20, 0x46, + 0x29, 0x46, 0x90, 0x47, 0xb8, 0xb1, 0x05, 0x46, 0x00, 0x78, 0x6d, 0x28, + 0xf6, 0xd1, 0x30, 0x46, 0x6d, 0x21, 0x2a, 0x46, 0xfe, 0xf7, 0x4c, 0xfe, + 0x08, 0x48, 0x12, 0x21, 0x00, 0x78, 0xd9, 0xf7, 0x73, 0xfe, 0x07, 0x48, + 0x29, 0x46, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x28, 0x46, 0xbd, 0xe8, + 0xf8, 0x40, 0xdf, 0xf7, 0xd1, 0xbc, 0xf8, 0xbd, 0xec, 0xa0, 0x08, 0x00, + 0x66, 0x34, 0x01, 0x00, 0xe8, 0xa0, 0x08, 0x00, 0x06, 0x48, 0x07, 0x49, + 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, + 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0xdc, 0xd4, 0x08, 0x00, 0x4d, 0x72, 0x04, 0x00, 0xd8, 0xd4, 0x08, 0x00, + 0x99, 0x71, 0x04, 0x00, 0x9c, 0xd8, 0x08, 0x00, 0xf1, 0x72, 0x04, 0x00, + 0x9c, 0xdb, 0x08, 0x00, 0x09, 0x73, 0x04, 0x00, 0x48, 0xf2, 0xcd, 0x4c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf6, 0xad, 0x2c, + 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf6, 0x49, 0x5c, + 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf2, 0x6d, 0x7c, + 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf2, 0xe1, 0x6c, + 0xc1, 0xf2, 0x0c, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0xfe, 0xb5, 0x05, 0x46, + 0x2f, 0x48, 0x0c, 0x46, 0x90, 0xf8, 0xff, 0x00, 0x98, 0xb1, 0x95, 0xf8, + 0x88, 0x04, 0x80, 0x07, 0x0f, 0xd5, 0x94, 0xf9, 0x00, 0x00, 0xb0, 0xf1, + 0xff, 0x3f, 0x0a, 0xdc, 0x29, 0x48, 0x2a, 0x49, 0x00, 0x78, 0xc0, 0xeb, + 0x40, 0x10, 0x01, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x00, 0x40, 0x07, + 0x02, 0xd4, 0x00, 0x20, 0x20, 0x70, 0xfe, 0xbd, 0x25, 0x48, 0x24, 0x4f, + 0x90, 0xf8, 0x3e, 0x06, 0x3e, 0x89, 0x01, 0x28, 0x2f, 0xd1, 0x23, 0x48, + 0x40, 0x79, 0x01, 0x28, 0x2b, 0xd1, 0x95, 0xf8, 0xda, 0x03, 0x00, 0x28, + 0xed, 0xd1, 0x01, 0x20, 0x85, 0xf8, 0xda, 0x03, 0x8d, 0xf8, 0x09, 0x00, + 0xd5, 0xf8, 0x88, 0x00, 0x41, 0x06, 0x09, 0xd4, 0x40, 0xf0, 0x40, 0x00, + 0x29, 0x46, 0x00, 0x22, 0xc5, 0xf8, 0x88, 0x00, 0x19, 0x48, 0x03, 0x68, + 0x9c, 0x20, 0x98, 0x47, 0xb5, 0xf8, 0xd8, 0x03, 0x01, 0xab, 0x01, 0x21, + 0x00, 0x22, 0x01, 0x90, 0x95, 0xf8, 0xdb, 0x03, 0x8d, 0xf8, 0x0a, 0x00, + 0x20, 0x78, 0x8d, 0xf8, 0x0b, 0x00, 0x12, 0x48, 0x05, 0x68, 0x08, 0x20, + 0x00, 0x90, 0x40, 0xf2, 0x12, 0x60, 0xa8, 0x47, 0xc5, 0xe7, 0x28, 0x46, + 0x21, 0x46, 0x00, 0xf0, 0x23, 0xf8, 0x38, 0x89, 0xb0, 0x42, 0x03, 0xd0, + 0x08, 0x48, 0x01, 0x68, 0x30, 0x46, 0x88, 0x47, 0xfe, 0xbd, 0x00, 0xbf, + 0xe8, 0x65, 0x08, 0x00, 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0xe8, 0x49, 0x01, 0x00, 0x64, 0xd4, 0x05, 0x00, 0x48, 0xdc, 0x05, 0x00, + 0x2c, 0xe2, 0x08, 0x00, 0xa8, 0xa0, 0x08, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, 0x50, 0xdc, 0x08, 0x00, + 0xe1, 0x73, 0x04, 0x00, 0x4b, 0xf2, 0xad, 0x5c, 0xc1, 0xf2, 0x0b, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xb0, 0xb5, 0x70, 0xb1, 0x04, 0x46, 0x90, 0xf8, + 0xc8, 0x02, 0x0d, 0x46, 0x13, 0x28, 0x0e, 0xd0, 0x11, 0x28, 0x18, 0xd1, + 0x4b, 0x2d, 0x16, 0xd1, 0x3a, 0xb9, 0x20, 0x46, 0x4b, 0x21, 0x00, 0x22, + 0x0d, 0xe0, 0x00, 0x20, 0x55, 0x21, 0xd9, 0xf7, 0x77, 0xfd, 0x0c, 0x20, + 0xb0, 0xbd, 0x4c, 0x2d, 0x09, 0xd1, 0x4d, 0x48, 0x90, 0xf8, 0x4a, 0x00, + 0x90, 0xb1, 0x20, 0x46, 0x4c, 0x21, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, + 0xb1, 0xb8, 0x20, 0x46, 0x29, 0x46, 0x00, 0xf0, 0xad, 0xf8, 0x47, 0x2d, + 0x05, 0xd1, 0x94, 0xf8, 0xc8, 0x12, 0x11, 0x29, 0x08, 0xbf, 0x00, 0x28, + 0x02, 0xd0, 0xb0, 0xbd, 0x07, 0x20, 0xb0, 0xbd, 0x94, 0xf8, 0xc0, 0x02, + 0x84, 0xf8, 0xc1, 0x02, 0x00, 0x20, 0xb0, 0xbd, 0x70, 0xb5, 0x05, 0x46, + 0xb0, 0xf8, 0xac, 0x02, 0x0c, 0x46, 0x80, 0x05, 0x08, 0xd4, 0xd5, 0xf8, + 0xd4, 0x10, 0xa0, 0x7b, 0x49, 0x7f, 0x00, 0x29, 0x18, 0xbf, 0x01, 0x21, + 0x88, 0x42, 0x0b, 0xd0, 0x20, 0x89, 0x20, 0xf0, 0x01, 0x01, 0x60, 0x89, + 0x21, 0x81, 0x20, 0xf0, 0x01, 0x00, 0x60, 0x81, 0xa0, 0x88, 0x08, 0xb1, + 0x06, 0x29, 0x01, 0xd2, 0x00, 0x20, 0x70, 0xbd, 0xd5, 0xf8, 0xd4, 0x30, + 0xa2, 0x7b, 0x01, 0x20, 0x60, 0x74, 0x5b, 0x7f, 0x00, 0x2b, 0x18, 0xbf, + 0x01, 0x23, 0x9a, 0x42, 0x0a, 0xd0, 0xd5, 0xf8, 0x88, 0x04, 0x21, 0x80, + 0x01, 0x07, 0x58, 0xbf, 0x5f, 0xea, 0x40, 0x70, 0x03, 0xd5, 0x20, 0x88, + 0x60, 0x80, 0x01, 0x20, 0x70, 0xbd, 0x18, 0x48, 0x00, 0x21, 0x02, 0x68, + 0x00, 0x20, 0x90, 0x47, 0x06, 0x46, 0x20, 0x7d, 0x00, 0x28, 0xf2, 0xd1, + 0x14, 0x49, 0x08, 0x78, 0xc2, 0x06, 0x0a, 0xd5, 0xd5, 0xf8, 0xf0, 0x20, + 0x3a, 0xb1, 0x05, 0x23, 0xb2, 0xfb, 0xf3, 0xf2, 0x23, 0x88, 0x9a, 0x42, + 0x3c, 0xbf, 0x22, 0x80, 0x08, 0x78, 0x00, 0x07, 0xe1, 0xd5, 0x0d, 0x48, + 0x1c, 0x21, 0x02, 0x68, 0x28, 0x46, 0x90, 0x47, 0x00, 0x28, 0xda, 0xd1, + 0x71, 0x00, 0x20, 0x88, 0x89, 0xb2, 0x88, 0x42, 0x38, 0xbf, 0x70, 0x00, + 0x82, 0xb2, 0xb2, 0xfb, 0xf1, 0xf3, 0x59, 0x43, 0x89, 0x1a, 0x08, 0x44, + 0x60, 0x80, 0x20, 0x80, 0xcb, 0xe7, 0x00, 0xbf, 0xc8, 0xc8, 0x08, 0x00, + 0x7f, 0x0f, 0x01, 0x00, 0x0c, 0xbb, 0x08, 0x00, 0x07, 0x49, 0x91, 0xf8, + 0x4a, 0x10, 0x09, 0xb1, 0x00, 0xf0, 0x30, 0xb8, 0x07, 0x20, 0x70, 0x47, + 0x03, 0x4b, 0x93, 0xf8, 0x4a, 0x30, 0x0b, 0xb1, 0x00, 0xf0, 0x2e, 0xb8, + 0x70, 0x47, 0x00, 0xbf, 0x68, 0x8a, 0x01, 0x00, 0x06, 0x48, 0x07, 0x49, + 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, + 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x38, 0xdd, 0x08, 0x00, 0x55, 0x75, 0x04, 0x00, 0xc4, 0xba, 0x08, 0x00, + 0xe5, 0x74, 0x04, 0x00, 0x68, 0xc5, 0x08, 0x00, 0x2d, 0x76, 0x04, 0x00, + 0x6c, 0xc5, 0x08, 0x00, 0x3d, 0x76, 0x04, 0x00, 0x4f, 0xf6, 0xe5, 0x6c, + 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf6, 0x8d, 0x5c, + 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf6, 0x19, 0x5c, + 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0xf8, 0xb5, 0x1c, 0x46, + 0x15, 0x46, 0x0e, 0x46, 0x07, 0x46, 0x60, 0xb1, 0x5d, 0xb9, 0xd7, 0xf8, + 0xd4, 0x00, 0xda, 0xf7, 0x0b, 0xf9, 0x97, 0xf8, 0x35, 0x11, 0x07, 0x4a, + 0x01, 0xeb, 0x41, 0x01, 0x02, 0xeb, 0x41, 0x11, 0xc8, 0x63, 0x38, 0x46, + 0x31, 0x46, 0x2a, 0x46, 0x23, 0x46, 0x01, 0xb0, 0xbd, 0xe8, 0xf0, 0x40, + 0x00, 0xf0, 0x0a, 0xb8, 0x54, 0xf1, 0x05, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0xf8, 0xc4, 0x08, 0x00, 0xb1, 0x76, 0x04, 0x00, + 0x45, 0xf6, 0x41, 0x6c, 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x2d, 0xe9, 0xf0, 0x41, 0x05, 0x68, 0xa5, 0xb3, 0xb5, 0xf8, 0x80, 0x71, + 0xb5, 0xf8, 0x7e, 0x61, 0x95, 0xf8, 0xc2, 0x80, 0x00, 0xf0, 0xcc, 0xfc, + 0x04, 0x46, 0xb5, 0xf8, 0x7e, 0x01, 0x86, 0x42, 0x09, 0xd0, 0x95, 0xf8, + 0x35, 0x01, 0x58, 0x49, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, + 0x41, 0x6a, 0x01, 0x31, 0x41, 0x62, 0xb5, 0xf8, 0x80, 0x01, 0x87, 0x42, + 0x09, 0xd0, 0x95, 0xf8, 0x35, 0x01, 0x51, 0x49, 0x00, 0xeb, 0x40, 0x00, + 0x01, 0xeb, 0x40, 0x10, 0x81, 0x69, 0x01, 0x31, 0x81, 0x61, 0x6a, 0x48, + 0x0b, 0x49, 0x00, 0x78, 0x00, 0xeb, 0x80, 0x00, 0x01, 0xeb, 0xc0, 0x00, + 0x01, 0x7b, 0x03, 0x29, 0x0a, 0xd1, 0x00, 0x7e, 0x01, 0x28, 0x08, 0xbf, + 0x85, 0xf8, 0xc2, 0x80, 0x04, 0xe0, 0x00, 0x20, 0xa6, 0x21, 0x00, 0x24, + 0xdf, 0xf7, 0x9e, 0xfa, 0x20, 0x46, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, + 0x84, 0x71, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, 0x00, 0x28, 0x6d, 0xd0, + 0x04, 0x68, 0x00, 0x2c, 0x6e, 0xd0, 0xb4, 0xf8, 0x74, 0x61, 0xb4, 0xf8, + 0x84, 0x50, 0x00, 0xf0, 0x8d, 0xfc, 0x81, 0x46, 0xb4, 0xf8, 0x74, 0x01, + 0x86, 0x42, 0x09, 0xd0, 0x94, 0xf8, 0x35, 0x01, 0x35, 0x49, 0x00, 0xeb, + 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, 0xc1, 0x69, 0x01, 0x31, 0xc1, 0x61, + 0xa8, 0x07, 0x5e, 0xd5, 0xb4, 0xf8, 0x84, 0x00, 0x80, 0x07, 0x5a, 0xd4, + 0x2f, 0x48, 0x00, 0x68, 0x00, 0x28, 0x56, 0xd1, 0xdf, 0xf8, 0xb8, 0xa0, + 0x2e, 0x48, 0x00, 0x21, 0x00, 0xf1, 0x60, 0x05, 0xda, 0xf8, 0x00, 0x20, + 0x28, 0x46, 0x90, 0x47, 0xda, 0xf8, 0x00, 0x20, 0xc8, 0xb1, 0xdf, 0xf8, + 0xa8, 0x80, 0x06, 0x46, 0x28, 0x46, 0x31, 0x46, 0x37, 0x46, 0x90, 0x47, + 0x06, 0x46, 0x38, 0x78, 0xa3, 0x28, 0x0a, 0xd1, 0x78, 0x68, 0xa0, 0x42, + 0x07, 0xd1, 0xd8, 0xf8, 0x00, 0x20, 0x28, 0x46, 0x39, 0x46, 0x90, 0x47, + 0x38, 0x46, 0xdf, 0xf7, 0x6d, 0xfa, 0xda, 0xf8, 0x00, 0x20, 0x00, 0x2e, + 0xe8, 0xd1, 0x1e, 0x48, 0x00, 0x21, 0x90, 0x47, 0x58, 0xb3, 0x1c, 0x4e, + 0xdf, 0xf8, 0x68, 0xb0, 0x05, 0x46, 0x04, 0xf5, 0x80, 0x78, 0xda, 0xf8, + 0x00, 0x20, 0x30, 0x46, 0x29, 0x46, 0x2f, 0x46, 0x90, 0x47, 0x05, 0x46, + 0x38, 0x68, 0x84, 0x42, 0x0d, 0xd1, 0x38, 0x1d, 0x41, 0x46, 0x06, 0x22, + 0xe9, 0xf7, 0xb2, 0xfd, 0x38, 0xb9, 0xdb, 0xf8, 0x00, 0x20, 0x30, 0x46, + 0x39, 0x46, 0x90, 0x47, 0x38, 0x46, 0xdf, 0xf7, 0x47, 0xfa, 0x00, 0x2d, + 0xe5, 0xd1, 0x0a, 0xe0, 0x00, 0x20, 0x4f, 0xf4, 0xd0, 0x71, 0x02, 0xe0, + 0x00, 0x20, 0x4f, 0xf4, 0xd1, 0x71, 0x4f, 0xf0, 0x00, 0x09, 0xdf, 0xf7, + 0x1b, 0xfa, 0x48, 0x46, 0xbd, 0xe8, 0xf8, 0x8f, 0x54, 0xf1, 0x05, 0x00, + 0x68, 0x52, 0x01, 0x00, 0xec, 0xa0, 0x08, 0x00, 0x2c, 0xba, 0x01, 0x00, + 0xe8, 0xa0, 0x08, 0x00, 0xe4, 0x5a, 0x01, 0x00, 0x80, 0xb5, 0x00, 0xf0, + 0x11, 0xfc, 0x11, 0x48, 0x90, 0xf8, 0xec, 0x12, 0xe9, 0xb1, 0x10, 0x49, + 0x91, 0xf8, 0xfe, 0x16, 0xc9, 0xb1, 0x0f, 0x49, 0x49, 0x78, 0x03, 0x29, + 0x15, 0xd1, 0x0e, 0x49, 0x4a, 0x7f, 0x3f, 0x2a, 0x11, 0xd1, 0x0d, 0x4a, + 0x0d, 0x4b, 0x12, 0x78, 0xc2, 0xeb, 0x42, 0x12, 0x53, 0xf8, 0x32, 0x20, + 0x92, 0xf8, 0xbc, 0x26, 0x01, 0x2a, 0x06, 0xd1, 0x90, 0xf8, 0x54, 0x02, + 0x40, 0x22, 0x4a, 0x77, 0x40, 0xf0, 0x80, 0x00, 0x88, 0x77, 0x80, 0xbd, + 0x8c, 0x7e, 0x08, 0x00, 0x38, 0x21, 0x01, 0x00, 0x50, 0x2e, 0x01, 0x00, + 0xfc, 0x20, 0x01, 0x00, 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0x7c, 0xb5, 0x04, 0x46, 0x00, 0x68, 0x00, 0x28, 0x00, 0xf0, 0x98, 0x81, + 0xcc, 0x48, 0x00, 0x21, 0xcc, 0x4d, 0x01, 0x60, 0x20, 0x68, 0x29, 0x68, + 0x09, 0x05, 0x65, 0xd4, 0xca, 0x49, 0x69, 0x58, 0x09, 0x01, 0x61, 0xd4, + 0x90, 0xf8, 0x29, 0x11, 0x41, 0xf0, 0x01, 0x01, 0x80, 0xf8, 0x29, 0x11, + 0x21, 0x68, 0xd1, 0xf8, 0xcc, 0x21, 0x22, 0xf0, 0x0f, 0x02, 0xc1, 0xf8, + 0xcc, 0x21, 0x21, 0x68, 0xd1, 0xf8, 0xcc, 0x21, 0x42, 0xf0, 0x03, 0x02, + 0xc1, 0xf8, 0xcc, 0x21, 0xdf, 0xf8, 0xe4, 0x13, 0x22, 0x68, 0x09, 0x78, + 0xd2, 0xf8, 0xd4, 0x20, 0x52, 0x7f, 0x7a, 0xb1, 0xdf, 0xf8, 0xdc, 0x33, + 0xc1, 0xeb, 0x41, 0x12, 0x03, 0xeb, 0xc2, 0x02, 0x92, 0xf8, 0x99, 0x20, + 0x01, 0x2a, 0x05, 0xd1, 0x90, 0xf8, 0x31, 0x21, 0x42, 0xf0, 0x01, 0x02, + 0x80, 0xf8, 0x31, 0x21, 0xdf, 0xf8, 0xb8, 0x23, 0x01, 0xeb, 0x81, 0x01, + 0x02, 0xeb, 0xc1, 0x02, 0x91, 0x7b, 0x4b, 0x1e, 0x01, 0x2b, 0x05, 0xd8, + 0x90, 0xf8, 0x30, 0x31, 0x43, 0xf0, 0x01, 0x03, 0x80, 0xf8, 0x30, 0x31, + 0x23, 0x68, 0xd3, 0xf8, 0xbc, 0x05, 0x80, 0xb1, 0x93, 0xf8, 0x6a, 0x61, + 0x01, 0x2e, 0x0c, 0xd1, 0x93, 0xf8, 0x69, 0x31, 0x0f, 0x2b, 0x08, 0xd8, + 0x01, 0x26, 0x06, 0xfa, 0x03, 0xf3, 0x13, 0xf4, 0x09, 0x4f, 0x1e, 0xbf, + 0xc3, 0x88, 0x01, 0x33, 0xc3, 0x80, 0x02, 0x29, 0x03, 0xd3, 0x10, 0x7b, + 0x03, 0x28, 0x40, 0xf0, 0xdb, 0x80, 0x20, 0x68, 0x90, 0xf8, 0xb0, 0x15, + 0x00, 0x20, 0x01, 0x29, 0xd9, 0x49, 0x08, 0xbf, 0x03, 0x20, 0x0a, 0x68, + 0x01, 0x21, 0xdd, 0xe0, 0x90, 0xf8, 0x28, 0x11, 0x41, 0xf0, 0x01, 0x01, + 0x80, 0xf8, 0x28, 0x11, 0x20, 0x68, 0xd0, 0xf8, 0xd4, 0x10, 0x49, 0x7f, + 0x21, 0xb1, 0xc7, 0x49, 0x09, 0x68, 0x39, 0xb1, 0x81, 0x42, 0x05, 0xd1, + 0xc5, 0x49, 0x00, 0x22, 0x0b, 0x68, 0x00, 0x21, 0x98, 0x47, 0x20, 0x68, + 0xe8, 0xb1, 0xd0, 0xf8, 0xcc, 0x11, 0x21, 0xf0, 0x0f, 0x01, 0xc0, 0xf8, + 0xcc, 0x11, 0x20, 0x68, 0xd0, 0xf8, 0xcc, 0x11, 0x41, 0xf0, 0x05, 0x01, + 0xc0, 0xf8, 0xcc, 0x11, 0x20, 0x68, 0x70, 0xb1, 0x90, 0xf8, 0x35, 0x11, + 0xba, 0x4a, 0x01, 0xeb, 0xc1, 0x01, 0x02, 0xeb, 0x41, 0x01, 0x49, 0x78, + 0x31, 0xb1, 0xb0, 0xf8, 0x78, 0x11, 0x01, 0x31, 0xa0, 0xf8, 0x78, 0x11, + 0x05, 0xe0, 0x55, 0xe0, 0xb0, 0xf8, 0x76, 0x11, 0x01, 0x31, 0xa0, 0xf8, + 0x76, 0x11, 0x20, 0x68, 0xb0, 0xf8, 0x40, 0x11, 0x01, 0x31, 0xa0, 0xf8, + 0x40, 0x11, 0xaf, 0x48, 0x00, 0x68, 0x01, 0x07, 0x18, 0xbf, 0x5f, 0xea, + 0xc0, 0x71, 0x6e, 0xd1, 0x10, 0xf0, 0xf0, 0x0f, 0x19, 0xd0, 0xc1, 0x06, + 0x17, 0xd5, 0x21, 0x68, 0xb1, 0xf8, 0x54, 0x21, 0x01, 0x32, 0xa1, 0xf8, + 0x54, 0x21, 0x21, 0x68, 0xb1, 0xf8, 0x56, 0x21, 0x01, 0x32, 0xa1, 0xf8, + 0x56, 0x21, 0x21, 0x68, 0xb1, 0xf8, 0x58, 0x21, 0x01, 0x32, 0xa1, 0xf8, + 0x58, 0x21, 0x21, 0x68, 0xb1, 0xf8, 0x5a, 0x21, 0x01, 0x32, 0xa1, 0xf8, + 0x5a, 0x21, 0x10, 0xf4, 0x70, 0x6f, 0x19, 0xd0, 0xc0, 0x05, 0x17, 0xd5, + 0x20, 0x68, 0xb0, 0xf8, 0x5c, 0x11, 0x01, 0x31, 0xa0, 0xf8, 0x5c, 0x11, + 0x20, 0x68, 0xb0, 0xf8, 0x5e, 0x11, 0x01, 0x31, 0xa0, 0xf8, 0x5e, 0x11, + 0x20, 0x68, 0xb0, 0xf8, 0x60, 0x11, 0x01, 0x31, 0xa0, 0xf8, 0x60, 0x11, + 0x20, 0x68, 0xb0, 0xf8, 0x62, 0x11, 0x01, 0x31, 0xa0, 0xf8, 0x62, 0x11, + 0x8f, 0x48, 0x00, 0x68, 0xc0, 0x01, 0x05, 0xd5, 0x20, 0x68, 0xb0, 0xf8, + 0x64, 0x11, 0x01, 0x31, 0xa0, 0xf8, 0x64, 0x11, 0x8b, 0x48, 0xc1, 0x68, + 0x01, 0x31, 0xc1, 0x60, 0xd0, 0x48, 0x8b, 0x49, 0x00, 0x78, 0x00, 0xeb, + 0x80, 0x00, 0x01, 0xeb, 0xc0, 0x00, 0xc1, 0x69, 0x41, 0xf4, 0x80, 0x11, + 0xc1, 0x61, 0x20, 0x68, 0xd0, 0xf8, 0xe0, 0x10, 0x01, 0x31, 0x0f, 0xd0, + 0x90, 0xf8, 0x35, 0x11, 0x7d, 0x4a, 0x01, 0xeb, 0xc1, 0x01, 0x02, 0xeb, + 0x41, 0x01, 0x49, 0x78, 0x01, 0x29, 0x06, 0xd1, 0xb0, 0xf8, 0xfa, 0x14, + 0x01, 0x31, 0xa0, 0xf8, 0xfa, 0x14, 0x20, 0x68, 0x90, 0xb3, 0xb0, 0xf8, + 0xe4, 0x13, 0x01, 0x31, 0xa0, 0xf8, 0xe4, 0x13, 0x2c, 0xe0, 0x21, 0x68, + 0xb1, 0xf8, 0x4c, 0x21, 0x01, 0x32, 0xa1, 0xf8, 0x4c, 0x21, 0x21, 0x68, + 0xb1, 0xf8, 0x4e, 0x21, 0x01, 0x32, 0xa1, 0xf8, 0x4e, 0x21, 0x21, 0x68, + 0xb1, 0xf8, 0x50, 0x21, 0x01, 0x32, 0xa1, 0xf8, 0x50, 0x21, 0x21, 0x68, + 0xb1, 0xf8, 0x52, 0x21, 0x01, 0x32, 0xa1, 0xf8, 0x52, 0x21, 0x77, 0xe7, + 0x20, 0x68, 0x90, 0xf8, 0xb0, 0x25, 0x01, 0x20, 0x01, 0x2a, 0x6b, 0x4a, + 0x08, 0xbf, 0x03, 0x20, 0x02, 0xeb, 0xc1, 0x01, 0x69, 0x4a, 0x91, 0xf8, + 0x84, 0x10, 0x12, 0x68, 0x90, 0x47, 0xd9, 0xf7, 0x2f, 0xfa, 0x21, 0x68, + 0xc1, 0xf8, 0xe4, 0x00, 0x20, 0x68, 0xd0, 0xf8, 0xd4, 0x10, 0x49, 0x7f, + 0x00, 0x29, 0x00, 0xf0, 0x9c, 0x80, 0x62, 0x49, 0x00, 0xf5, 0x94, 0x70, + 0x09, 0x68, 0x88, 0x47, 0x20, 0x68, 0x70, 0xb3, 0x90, 0xf8, 0x88, 0x14, + 0x89, 0x07, 0x2a, 0xd5, 0xd0, 0xf8, 0xbc, 0x05, 0x38, 0xb3, 0x5c, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x03, 0x28, 0x22, 0xd1, 0x28, 0x68, 0x00, 0x05, + 0x03, 0xd4, 0x4b, 0x48, 0x28, 0x58, 0x00, 0x01, 0x1b, 0xd5, 0x20, 0x68, + 0x4b, 0x4a, 0xd0, 0xf8, 0xbc, 0x05, 0x41, 0x6a, 0x02, 0x31, 0x41, 0x62, + 0x20, 0x68, 0x90, 0xf8, 0x35, 0x11, 0x01, 0xeb, 0xc1, 0x01, 0x02, 0xeb, + 0x41, 0x01, 0x49, 0x78, 0x59, 0xb9, 0x4f, 0x49, 0x91, 0xf8, 0x79, 0x10, + 0x0c, 0x29, 0x01, 0xd0, 0x0a, 0x29, 0x04, 0xd1, 0xd0, 0xf8, 0xbc, 0x05, + 0x41, 0x6a, 0x02, 0x39, 0x41, 0x62, 0x4a, 0x49, 0x20, 0x68, 0x09, 0x68, + 0x88, 0x47, 0x20, 0x68, 0x90, 0xf8, 0x88, 0x14, 0x89, 0x07, 0x07, 0xd4, + 0x7c, 0xbd, 0x00, 0xbf, 0xc0, 0x00, 0x21, 0x40, 0xcc, 0x20, 0x21, 0x40, + 0x20, 0xf0, 0xff, 0xff, 0x90, 0xf8, 0xa4, 0x04, 0x41, 0x07, 0x01, 0xd5, + 0x00, 0x07, 0xf1, 0xd5, 0x28, 0x68, 0x00, 0x05, 0x03, 0xd4, 0x2e, 0x48, + 0x28, 0x58, 0x00, 0x01, 0xea, 0xd5, 0x3c, 0x4e, 0xd9, 0xf7, 0xce, 0xf9, + 0x30, 0x60, 0x21, 0x68, 0xb1, 0xf8, 0x76, 0x11, 0x31, 0x81, 0x22, 0x68, + 0xb2, 0xf8, 0x78, 0x21, 0x11, 0x44, 0x72, 0x81, 0x01, 0x29, 0x08, 0xbf, + 0x70, 0x60, 0x31, 0x48, 0x00, 0x68, 0x80, 0x47, 0xb0, 0x81, 0x30, 0x68, + 0x21, 0x68, 0xd1, 0xf8, 0x70, 0x11, 0x40, 0x1a, 0x71, 0x89, 0x00, 0xeb, + 0x80, 0x00, 0x00, 0x09, 0xf0, 0x81, 0x30, 0x89, 0x08, 0x44, 0x33, 0x28, + 0xc8, 0xd3, 0x05, 0x21, 0xb0, 0xfb, 0xf1, 0xf1, 0x01, 0xeb, 0x81, 0x01, + 0x40, 0x1a, 0xc1, 0xd1, 0x28, 0x68, 0x27, 0x4b, 0x01, 0x21, 0x00, 0x22, + 0x30, 0x61, 0x26, 0x48, 0x00, 0x68, 0x70, 0x61, 0x25, 0x48, 0x00, 0x68, + 0xb0, 0x61, 0x25, 0x48, 0x00, 0x68, 0xf0, 0x61, 0x24, 0x48, 0x00, 0x68, + 0x30, 0x62, 0x24, 0x48, 0x00, 0x68, 0x70, 0x62, 0x11, 0x48, 0x00, 0x68, + 0xb0, 0x62, 0x22, 0x48, 0x04, 0x68, 0x2c, 0x20, 0x00, 0x90, 0x40, 0xf2, + 0x49, 0x60, 0xa0, 0x47, 0x7c, 0xbd, 0x09, 0x49, 0x09, 0x68, 0x11, 0xb1, + 0x81, 0x42, 0x3f, 0xf4, 0x5e, 0xaf, 0x29, 0x68, 0x09, 0x05, 0x3f, 0xf5, + 0x5a, 0xaf, 0x03, 0x49, 0x69, 0x58, 0x09, 0x01, 0x3f, 0xf5, 0x55, 0xaf, + 0x59, 0xe7, 0x00, 0xbf, 0x20, 0xf0, 0xff, 0xff, 0xe4, 0x5e, 0x01, 0x00, + 0xac, 0xbb, 0x08, 0x00, 0x44, 0x28, 0x01, 0x00, 0x14, 0x51, 0x00, 0x40, + 0x98, 0x60, 0x00, 0x40, 0xb0, 0xf0, 0x05, 0x00, 0x74, 0x87, 0x08, 0x00, + 0x84, 0x71, 0x01, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0x86, 0x71, 0x0d, 0x10, + 0xfc, 0xb9, 0x08, 0x00, 0x50, 0xd2, 0x08, 0x00, 0x3c, 0xe5, 0x08, 0x00, + 0x4c, 0x49, 0x01, 0x00, 0xc0, 0xbb, 0x08, 0x00, 0x2c, 0xf0, 0x05, 0x00, + 0xcc, 0x43, 0x05, 0x30, 0x40, 0x40, 0x05, 0x30, 0x1c, 0x50, 0x00, 0x40, + 0x64, 0x50, 0x00, 0x30, 0xe8, 0x43, 0x05, 0x30, 0xa0, 0xa0, 0x08, 0x00, + 0x2d, 0xe9, 0xf8, 0x43, 0xdf, 0xf8, 0xd0, 0x80, 0xa3, 0x4f, 0x98, 0xf8, + 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x10, 0x57, 0xf8, 0x30, 0x50, 0x00, 0x2d, + 0x4e, 0xd0, 0x07, 0xeb, 0xc0, 0x00, 0x6a, 0x78, 0x90, 0xf8, 0x9f, 0x10, + 0x91, 0x42, 0x50, 0xd1, 0xb5, 0xf8, 0x82, 0x10, 0xc9, 0x07, 0x0f, 0xd0, + 0x90, 0xf8, 0x99, 0x00, 0x01, 0x28, 0x0b, 0xd1, 0x95, 0xf8, 0xa3, 0x02, + 0x01, 0x07, 0x07, 0xd5, 0x95, 0xf8, 0x8a, 0x10, 0x89, 0x07, 0x5c, 0xbf, + 0x00, 0xf0, 0xf7, 0x00, 0x85, 0xf8, 0xa3, 0x02, 0xb5, 0xf8, 0x44, 0x91, + 0xb5, 0xf8, 0x82, 0x61, 0x00, 0xf0, 0x80, 0xf9, 0x04, 0x46, 0xb5, 0xf8, + 0x82, 0x01, 0x86, 0x42, 0x09, 0xd0, 0x95, 0xf8, 0x35, 0x01, 0x7b, 0x49, + 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, 0x01, 0x6a, 0x01, 0x31, + 0x01, 0x62, 0xb5, 0xf8, 0x44, 0x01, 0x81, 0x45, 0x20, 0xd0, 0x98, 0xf8, + 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x10, 0x57, 0xf8, 0x30, 0x00, 0xb0, 0xf8, + 0x82, 0x10, 0x09, 0x07, 0x16, 0xd4, 0x90, 0xf8, 0xa4, 0x04, 0x41, 0x07, + 0x12, 0xd5, 0x00, 0x07, 0x10, 0xd4, 0x95, 0xf8, 0x35, 0x01, 0x6c, 0x49, + 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, 0xc1, 0x6c, 0x01, 0x31, + 0xc1, 0x64, 0x05, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0xed, 0x11, 0x00, 0x24, + 0xde, 0xf7, 0x3e, 0xff, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x83, 0x8f, 0x49, + 0x51, 0xf8, 0x48, 0x2f, 0x41, 0x61, 0xbd, 0xe8, 0xf8, 0x43, 0x10, 0x47, + 0x74, 0x87, 0x08, 0x00, 0xfe, 0xb5, 0x05, 0x46, 0x08, 0x79, 0x0c, 0x46, + 0x00, 0xf0, 0xfe, 0x00, 0x26, 0x28, 0x43, 0xd1, 0x95, 0xf8, 0x88, 0x04, + 0xb5, 0xf8, 0x58, 0x24, 0x06, 0x21, 0x80, 0x07, 0x04, 0xd5, 0xb5, 0xf8, + 0x82, 0x00, 0xc0, 0x07, 0x08, 0xbf, 0x02, 0x21, 0x1e, 0x48, 0x20, 0x23, + 0x06, 0x68, 0x02, 0xa8, 0x00, 0x90, 0x28, 0x46, 0xb0, 0x47, 0x06, 0x46, + 0x60, 0x71, 0x00, 0x0e, 0x1a, 0x4f, 0x20, 0x72, 0x30, 0x0c, 0xe0, 0x71, + 0x30, 0x0a, 0xa0, 0x71, 0x72, 0xb6, 0x38, 0x68, 0x40, 0x00, 0x01, 0x30, + 0x38, 0x60, 0x16, 0x48, 0x00, 0x68, 0x80, 0x47, 0x39, 0x68, 0x4f, 0xea, + 0x51, 0x01, 0x39, 0x60, 0x39, 0x68, 0x81, 0xf3, 0x10, 0x88, 0x90, 0xb1, + 0x12, 0x4a, 0x04, 0x21, 0x45, 0x60, 0x01, 0x82, 0x2c, 0x21, 0x01, 0x75, + 0x0e, 0x49, 0x02, 0xea, 0x46, 0x02, 0x02, 0x60, 0x72, 0x00, 0x08, 0x60, + 0x4a, 0x60, 0x0d, 0x49, 0x0a, 0x68, 0xd5, 0xf8, 0xd4, 0x10, 0x90, 0x47, + 0x04, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x6e, 0x21, 0xd9, 0xf7, 0x84, 0xf8, + 0x28, 0x46, 0x21, 0x46, 0x00, 0xf0, 0xf6, 0xf8, 0xfe, 0xbd, 0x00, 0xbf, + 0xe8, 0xc4, 0x08, 0x00, 0x24, 0x36, 0x01, 0x00, 0xd8, 0xa0, 0x08, 0x00, + 0xa0, 0x52, 0x01, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xd4, 0xa0, 0x08, 0x00, + 0x10, 0xb5, 0x00, 0xf0, 0xeb, 0xf8, 0x3d, 0x49, 0x3d, 0x4b, 0x09, 0x78, + 0xc1, 0xeb, 0x41, 0x12, 0x53, 0xf8, 0x32, 0x10, 0xb1, 0xf8, 0x82, 0x40, + 0xe4, 0x07, 0x18, 0xbf, 0x00, 0x29, 0x00, 0xd1, 0x10, 0xbd, 0x03, 0xeb, + 0xc2, 0x02, 0x92, 0x68, 0x00, 0x2a, 0xf9, 0xd1, 0xb1, 0xf8, 0xe2, 0x23, + 0x01, 0x32, 0xa1, 0xf8, 0xe2, 0x23, 0x10, 0xbd, 0x70, 0xb5, 0x30, 0x48, + 0x30, 0x4a, 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x11, 0x52, 0xf8, 0x31, 0x40, + 0x64, 0xb3, 0x1a, 0x49, 0x94, 0xf8, 0x88, 0x61, 0x94, 0xf8, 0x9c, 0x52, + 0x18, 0x4a, 0x09, 0x68, 0x02, 0xf8, 0x10, 0x10, 0x17, 0x49, 0x02, 0xeb, + 0x40, 0x00, 0x09, 0x68, 0x41, 0x70, 0x00, 0xf0, 0xbf, 0xf8, 0x94, 0xf8, + 0x88, 0x01, 0x86, 0x42, 0x09, 0xd0, 0x94, 0xf8, 0x35, 0x01, 0x12, 0x49, + 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, 0x01, 0x6b, 0x01, 0x31, + 0x01, 0x63, 0x94, 0xf8, 0x9c, 0x02, 0x85, 0x42, 0x09, 0xd0, 0x94, 0xf8, + 0x35, 0x01, 0x0b, 0x49, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, + 0x41, 0x6b, 0x01, 0x31, 0x41, 0x63, 0x70, 0xbd, 0x00, 0x20, 0x4f, 0xf4, + 0x23, 0x71, 0xbd, 0xe8, 0x70, 0x40, 0xde, 0xf7, 0x7b, 0xbe, 0x00, 0xbf, + 0x34, 0xa1, 0x23, 0x40, 0x48, 0xf1, 0x05, 0x00, 0x30, 0xa1, 0x23, 0x40, + 0x54, 0xf1, 0x05, 0x00, 0x10, 0xb5, 0x00, 0xf0, 0x95, 0xf8, 0x0c, 0x49, + 0x0c, 0x4b, 0x09, 0x78, 0xc1, 0xeb, 0x41, 0x12, 0x53, 0xf8, 0x32, 0x10, + 0xb1, 0xf8, 0x82, 0x40, 0xe4, 0x07, 0x18, 0xbf, 0x00, 0x29, 0x00, 0xd1, + 0x10, 0xbd, 0x03, 0xeb, 0xc2, 0x02, 0x92, 0x68, 0x00, 0x2a, 0xf9, 0xd1, + 0xb1, 0xf8, 0xe2, 0x23, 0x01, 0x32, 0xa1, 0xf8, 0xe2, 0x23, 0x10, 0xbd, + 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0xb0, 0xb5, 0x04, 0x46, + 0x00, 0x68, 0xb0, 0xf8, 0x40, 0x51, 0x08, 0xf0, 0xc3, 0xf9, 0x20, 0x46, + 0x00, 0xf0, 0x74, 0xf8, 0x20, 0x68, 0xb0, 0xf8, 0x40, 0x01, 0x85, 0x42, + 0x03, 0xd0, 0x02, 0x48, 0xc1, 0x68, 0x01, 0x31, 0xc1, 0x60, 0xb0, 0xbd, + 0xb0, 0xf0, 0x05, 0x00, 0x0d, 0x48, 0x0e, 0x49, 0x11, 0x4a, 0x01, 0x60, + 0x0d, 0x48, 0x0e, 0x49, 0xc1, 0x60, 0x01, 0x60, 0x0d, 0x49, 0x0a, 0x60, + 0x0e, 0x49, 0x11, 0x4a, 0x81, 0x64, 0x0e, 0x49, 0xc1, 0x63, 0x0e, 0x49, + 0x0a, 0x60, 0x0f, 0x49, 0x01, 0x61, 0x41, 0x60, 0x0e, 0x48, 0x0f, 0x49, + 0x40, 0xf8, 0x10, 0x1f, 0x0e, 0x49, 0x41, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x78, 0xa2, 0x08, 0x00, 0x24, 0x81, 0x04, 0x00, 0x2c, 0xe9, 0x08, 0x00, + 0x81, 0x7d, 0x04, 0x00, 0xbc, 0xb9, 0x08, 0x00, 0x5d, 0x7e, 0x04, 0x00, + 0x19, 0x7f, 0x04, 0x00, 0xdd, 0x7f, 0x04, 0x00, 0x74, 0xa2, 0x08, 0x00, + 0x44, 0x81, 0x04, 0x00, 0x51, 0x7f, 0x04, 0x00, 0x9c, 0x0f, 0x01, 0x00, + 0x0d, 0x79, 0x04, 0x00, 0x1d, 0x80, 0x04, 0x00, 0x47, 0xf2, 0x9b, 0x4c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x47, 0xf6, 0xcb, 0x5c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf2, 0xc7, 0x4c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf2, 0x01, 0x2c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf6, 0xdf, 0x2c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4a, 0xf2, 0x2d, 0x4c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf6, 0xa7, 0x1c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4a, 0xf2, 0xb5, 0x2c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4a, 0xf2, 0xa9, 0x7c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0xc1, 0x8b, 0x0d, 0x10, + 0x09, 0x77, 0x04, 0x00, 0x0f, 0x7d, 0x0d, 0x10, 0x91, 0x77, 0x04, 0x00, + 0xc7, 0x84, 0x0d, 0x10, 0x5f, 0x8c, 0x0d, 0x10, 0xd1, 0x8c, 0x0d, 0x10, + 0x21, 0x00, 0x00, 0x00, 0x09, 0x74, 0x0d, 0x10, 0x09, 0x77, 0x04, 0x00, + 0x0f, 0x7d, 0x0d, 0x10, 0x91, 0x77, 0x04, 0x00, 0xa9, 0x78, 0x04, 0x00, + 0xf3, 0x84, 0x0d, 0x10, 0x91, 0x6a, 0x0f, 0x10, 0x20, 0x00, 0x00, 0x00, + 0x2d, 0xe9, 0xf0, 0x41, 0x04, 0x46, 0xd8, 0xf7, 0x53, 0xff, 0x05, 0x46, + 0x8e, 0x48, 0x90, 0xf8, 0x3e, 0x06, 0x01, 0x28, 0x55, 0xd1, 0x8d, 0x48, + 0x40, 0x79, 0x01, 0x28, 0x51, 0xd1, 0x8c, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x68, 0xb1, 0x8a, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0xb0, 0xb1, 0x89, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x01, 0x0e, + 0x03, 0x0c, 0x02, 0x0a, 0x06, 0x46, 0x17, 0xe0, 0x20, 0x6a, 0x58, 0xb1, + 0x84, 0x49, 0xb1, 0xf8, 0x1e, 0x15, 0x03, 0x31, 0x21, 0xf0, 0x03, 0x01, + 0x46, 0x18, 0x40, 0x5c, 0x72, 0x78, 0xb3, 0x78, 0xf1, 0x78, 0x03, 0xe0, + 0x00, 0x21, 0x00, 0x23, 0x00, 0x22, 0x00, 0x20, 0x1e, 0x04, 0x46, 0xea, + 0x01, 0x66, 0x46, 0xea, 0x02, 0x26, 0x06, 0x44, 0x2e, 0xb3, 0xdb, 0xb2, + 0xd2, 0xb2, 0xc0, 0xb2, 0x1b, 0x04, 0x43, 0xea, 0x01, 0x61, 0x41, 0xea, + 0x02, 0x21, 0x08, 0x44, 0xc5, 0xf5, 0xa0, 0x71, 0x08, 0x44, 0x20, 0xf0, + 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x14, 0xd9, 0x94, 0xf8, 0x35, 0x01, + 0x70, 0x4b, 0x00, 0xeb, 0x40, 0x02, 0x03, 0xeb, 0x42, 0x12, 0x52, 0xf8, + 0x14, 0x3f, 0x19, 0x44, 0x21, 0xf0, 0x70, 0x41, 0xb1, 0xf1, 0x00, 0x6f, + 0x05, 0xd9, 0x6b, 0x49, 0x15, 0x60, 0x0a, 0x68, 0x94, 0xf9, 0x3a, 0x10, + 0x90, 0x47, 0x94, 0xf8, 0x88, 0x04, 0x80, 0x07, 0x40, 0xf1, 0xbc, 0x80, + 0x94, 0xf8, 0x35, 0x01, 0xe3, 0x49, 0x00, 0xeb, 0xc0, 0x00, 0x01, 0xeb, + 0x40, 0x00, 0x47, 0x78, 0x94, 0xf8, 0xa4, 0x04, 0x41, 0x07, 0x01, 0xd5, + 0x00, 0x07, 0x0f, 0xd5, 0xd6, 0x4e, 0x96, 0xf8, 0x67, 0x02, 0x58, 0xb1, + 0xd8, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x01, 0x28, 0x0d, 0xd1, + 0xd6, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x05, 0x46, 0x08, 0xe0, + 0x00, 0x25, 0x01, 0x2f, 0x4f, 0xf0, 0x00, 0x08, 0x4f, 0xf0, 0x00, 0x06, + 0x18, 0xd0, 0x7e, 0xe0, 0x00, 0x25, 0xd0, 0x48, 0x01, 0x68, 0x04, 0xf1, + 0x20, 0x00, 0x88, 0x47, 0x00, 0xeb, 0x05, 0x08, 0x01, 0x2f, 0x73, 0xd1, + 0x96, 0xf8, 0x68, 0x02, 0x1f, 0xfa, 0x88, 0xf1, 0x81, 0x42, 0x07, 0xd8, + 0x4b, 0x49, 0x94, 0xf8, 0x35, 0x01, 0x01, 0x22, 0x4c, 0x23, 0x0e, 0x68, + 0x00, 0x21, 0xb0, 0x47, 0x94, 0xf8, 0xa4, 0x04, 0x41, 0x07, 0x61, 0xd5, + 0x00, 0x07, 0x5f, 0xd4, 0x45, 0x48, 0x46, 0x49, 0x00, 0x78, 0xc0, 0xeb, + 0x40, 0x10, 0x01, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x00, 0x40, 0x07, + 0x0b, 0xd5, 0x42, 0x48, 0x00, 0x68, 0x90, 0xf8, 0x24, 0x00, 0x01, 0x28, + 0x05, 0xd8, 0x3c, 0x49, 0x94, 0xf8, 0x35, 0x01, 0x01, 0x22, 0x02, 0x23, + 0x39, 0xe0, 0xd4, 0xf8, 0xe0, 0x00, 0x01, 0x30, 0x20, 0xd0, 0xae, 0x48, + 0xb4, 0xf8, 0xfa, 0x24, 0x90, 0xf8, 0x6c, 0x12, 0x90, 0xf8, 0x6d, 0x02, + 0x02, 0xeb, 0x42, 0x02, 0x00, 0xeb, 0x42, 0x00, 0x82, 0xb2, 0x8a, 0x42, + 0x88, 0xbf, 0x08, 0x46, 0xd4, 0xf8, 0x00, 0x15, 0x00, 0xeb, 0x51, 0x00, + 0x86, 0xb2, 0x31, 0x48, 0x00, 0x68, 0x80, 0x47, 0xd4, 0xf8, 0xe0, 0x10, + 0x40, 0x1a, 0xa0, 0xeb, 0x46, 0x00, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, + 0x00, 0x6f, 0x17, 0xd9, 0x2a, 0x48, 0x00, 0x68, 0x80, 0x47, 0x28, 0x49, + 0x89, 0x68, 0x40, 0x1a, 0x9a, 0x49, 0x91, 0xf8, 0x6e, 0x12, 0xa0, 0xeb, + 0x41, 0x00, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x13, 0xd8, + 0x1e, 0x49, 0x94, 0xf8, 0x35, 0x01, 0x01, 0x22, 0x4d, 0x23, 0x0e, 0x68, + 0x00, 0x21, 0x0a, 0xe0, 0xd8, 0xf7, 0x58, 0xfe, 0x1c, 0x49, 0x01, 0x22, + 0x49, 0x23, 0x48, 0x60, 0x17, 0x48, 0x00, 0x21, 0x06, 0x68, 0x94, 0xf8, + 0x35, 0x01, 0xb0, 0x47, 0x46, 0x46, 0x8f, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0xd4, 0xf8, 0xbc, 0x15, 0x01, 0x28, 0x07, 0xd1, 0x69, 0xb1, + 0x00, 0x2d, 0x18, 0xbf, 0x01, 0x25, 0x81, 0xf8, 0x40, 0x50, 0xbd, 0xe8, + 0xf0, 0x81, 0x29, 0xb1, 0xb0, 0xb2, 0x00, 0x28, 0x18, 0xbf, 0x01, 0x20, + 0x81, 0xf8, 0x40, 0x00, 0xbd, 0xe8, 0xf0, 0x81, 0x64, 0xd4, 0x05, 0x00, + 0x48, 0xdc, 0x05, 0x00, 0x54, 0x9d, 0x08, 0x00, 0x50, 0x9d, 0x08, 0x00, + 0x58, 0x9d, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x54, 0xf1, 0x05, 0x00, + 0x74, 0x9a, 0x08, 0x00, 0x04, 0xa1, 0x08, 0x00, 0x74, 0x87, 0x08, 0x00, + 0x0c, 0x6f, 0x01, 0x00, 0x14, 0xf0, 0x05, 0x00, 0xe0, 0xa0, 0x08, 0x00, + 0x2d, 0xe9, 0xf0, 0x41, 0x04, 0x46, 0x70, 0x48, 0x90, 0xf8, 0xec, 0x12, + 0x00, 0x29, 0x41, 0xd0, 0x6e, 0x49, 0x91, 0xf8, 0xfe, 0x16, 0xe9, 0xb3, + 0x6d, 0x4f, 0x17, 0xf8, 0x01, 0x1f, 0x03, 0x29, 0x38, 0xd1, 0x00, 0xf2, + 0x53, 0x28, 0xd7, 0xf8, 0x07, 0x00, 0x41, 0x1c, 0x05, 0xd1, 0xd7, 0xf8, + 0x0f, 0x00, 0x68, 0x49, 0x08, 0x44, 0x20, 0xf0, 0x70, 0x40, 0x00, 0xf0, + 0x03, 0x01, 0x01, 0x29, 0x88, 0xbf, 0x04, 0x30, 0x46, 0x1a, 0x20, 0x68, + 0x90, 0xf8, 0x88, 0x14, 0x89, 0x07, 0x23, 0xd4, 0x61, 0x68, 0x98, 0xf8, + 0x9c, 0x30, 0x0a, 0x69, 0x92, 0x1b, 0x22, 0xf0, 0x70, 0x42, 0xb2, 0xfb, + 0xf3, 0xf5, 0x05, 0xfb, 0x13, 0x25, 0x15, 0xf0, 0x03, 0x02, 0x1c, 0xbf, + 0xaa, 0x1a, 0x15, 0x1d, 0x49, 0x7f, 0x00, 0x29, 0x5d, 0xd0, 0x01, 0x6a, + 0x31, 0xb9, 0x81, 0x68, 0x21, 0xb9, 0x56, 0x49, 0x09, 0x68, 0x88, 0x47, + 0x00, 0x28, 0x58, 0xd0, 0x08, 0x2d, 0xc0, 0xf0, 0x96, 0x80, 0x14, 0x2d, + 0x55, 0xd3, 0x92, 0xe0, 0xbd, 0xe8, 0xf0, 0x81, 0x4f, 0x49, 0x09, 0x68, + 0x88, 0x47, 0x01, 0x28, 0x05, 0xd1, 0x4e, 0x49, 0x20, 0x68, 0x09, 0x68, + 0x88, 0x47, 0x05, 0x46, 0x00, 0xe0, 0x00, 0x25, 0x4b, 0x48, 0x01, 0x68, + 0x20, 0x68, 0x20, 0x30, 0x88, 0x47, 0x29, 0x18, 0x98, 0xf8, 0x9e, 0x20, + 0x88, 0xb2, 0x90, 0x42, 0x14, 0xd2, 0xd7, 0xf8, 0x07, 0x00, 0x42, 0x1c, + 0x10, 0xd0, 0x98, 0xf8, 0x9c, 0x20, 0x83, 0x18, 0x60, 0x68, 0x00, 0x69, + 0x1b, 0x1a, 0x1b, 0x01, 0x08, 0xd4, 0x83, 0x1b, 0x23, 0xf0, 0x70, 0x43, + 0xb3, 0xfb, 0xf2, 0xf5, 0x05, 0xfb, 0x12, 0x33, 0x14, 0x25, 0x0b, 0xe0, + 0x60, 0x68, 0x98, 0xf8, 0x9c, 0x30, 0x00, 0x69, 0x82, 0x1b, 0x22, 0xf0, + 0x70, 0x42, 0xb2, 0xfb, 0xf3, 0xf5, 0x05, 0xfb, 0x13, 0x23, 0x08, 0x25, + 0x26, 0x68, 0x96, 0xf8, 0xbc, 0x26, 0x01, 0x2a, 0x1c, 0xbf, 0xd7, 0xf8, + 0x0f, 0xc0, 0x1c, 0xf1, 0x01, 0x02, 0x15, 0xd1, 0xc7, 0xf8, 0x0f, 0x00, + 0x98, 0xf8, 0x01, 0x00, 0x32, 0x49, 0x40, 0x22, 0x40, 0xf0, 0x80, 0x00, + 0x4a, 0x77, 0x88, 0x77, 0x43, 0xe0, 0x90, 0xf8, 0xbc, 0x06, 0x01, 0x28, + 0xa6, 0xd0, 0x08, 0x2d, 0x3d, 0xd1, 0x2c, 0x48, 0x81, 0x7f, 0x41, 0xf0, + 0x80, 0x01, 0x37, 0xe0, 0x09, 0x04, 0x30, 0xd0, 0xab, 0x42, 0x14, 0xd0, + 0x08, 0x2b, 0x2c, 0xd3, 0x96, 0xf8, 0x35, 0x11, 0x22, 0x4a, 0x01, 0xeb, + 0xc1, 0x01, 0x02, 0xeb, 0x41, 0x01, 0x49, 0x78, 0x01, 0x29, 0x08, 0xd0, + 0x1f, 0x4a, 0xa0, 0xeb, 0x0c, 0x01, 0x11, 0x44, 0x21, 0xf0, 0x70, 0x41, + 0xb1, 0xf1, 0x00, 0x6f, 0x19, 0xd8, 0xd7, 0xf8, 0x0b, 0x10, 0x42, 0x1a, + 0x0c, 0x32, 0x22, 0xf0, 0x70, 0x42, 0xb2, 0xf1, 0x00, 0x6f, 0x07, 0xd8, + 0x4a, 0x1c, 0x05, 0xd0, 0x09, 0x1a, 0x21, 0xf0, 0x70, 0x41, 0xb1, 0xf1, + 0x00, 0x6f, 0x08, 0xd9, 0x13, 0x4a, 0xa0, 0xeb, 0x0c, 0x01, 0x11, 0x44, + 0x21, 0xf0, 0x70, 0x41, 0xb1, 0xf1, 0x00, 0x6f, 0xb6, 0xd9, 0x10, 0x48, + 0x3f, 0x21, 0x41, 0x77, 0x98, 0xf8, 0x00, 0x10, 0x81, 0x77, 0x20, 0x68, + 0x00, 0x21, 0x80, 0xf8, 0xbc, 0x16, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, + 0x8c, 0x7e, 0x08, 0x00, 0x38, 0x21, 0x01, 0x00, 0x50, 0x2e, 0x01, 0x00, + 0xf8, 0xff, 0xff, 0x0f, 0x4c, 0x9d, 0x08, 0x00, 0x50, 0x9d, 0x08, 0x00, + 0x28, 0x9d, 0x08, 0x00, 0x44, 0x28, 0x01, 0x00, 0xe0, 0xff, 0xff, 0x0f, + 0xe8, 0xff, 0xff, 0x0f, 0xfc, 0x20, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, + 0xdf, 0xf8, 0x68, 0x84, 0x04, 0x46, 0xdf, 0xf8, 0x60, 0x14, 0xd4, 0xf8, + 0x0c, 0x35, 0xb8, 0xf8, 0x76, 0x20, 0x91, 0xf8, 0x67, 0x02, 0x01, 0xf2, + 0x33, 0x2b, 0x93, 0x42, 0x07, 0xd9, 0x07, 0x46, 0x00, 0x28, 0x18, 0xbf, + 0x01, 0x3f, 0x9b, 0xf8, 0x3e, 0x60, 0x35, 0x46, 0x04, 0xe0, 0x91, 0xf8, + 0x6a, 0x52, 0xb1, 0xf8, 0x62, 0x62, 0x07, 0x46, 0xdf, 0xf8, 0x34, 0xa4, + 0x9a, 0xf8, 0x79, 0x10, 0x0c, 0x29, 0x01, 0xd0, 0x0a, 0x29, 0x0b, 0xd1, + 0xdf, 0xf8, 0x28, 0x14, 0x09, 0x78, 0x01, 0x29, 0x06, 0xd1, 0x00, 0x28, + 0x18, 0xbf, 0x02, 0x38, 0x9b, 0xf8, 0x3e, 0x60, 0x07, 0x46, 0x35, 0x46, + 0xdf, 0xf8, 0x14, 0x04, 0x00, 0x68, 0x80, 0x47, 0x81, 0x46, 0xd4, 0xf8, + 0x88, 0x04, 0x81, 0x07, 0x54, 0xd4, 0xbb, 0xf8, 0x31, 0x50, 0x00, 0x02, + 0x58, 0xbf, 0xa0, 0x25, 0x00, 0x26, 0xd4, 0xf8, 0xd4, 0x00, 0x40, 0x7f, + 0x48, 0xb1, 0x94, 0xf8, 0x88, 0x04, 0x80, 0x07, 0x44, 0xbf, 0x94, 0xf8, + 0xa4, 0x04, 0x5f, 0xea, 0x40, 0x71, 0x00, 0xf1, 0xe0, 0x80, 0x5a, 0x20, + 0x8b, 0xf8, 0x00, 0x00, 0x20, 0x6a, 0x60, 0xb1, 0xdf, 0xf8, 0x00, 0x14, + 0x09, 0x68, 0x88, 0x47, 0xa9, 0xb2, 0xa9, 0xeb, 0x41, 0x01, 0x08, 0x1a, + 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x4c, 0xd9, 0xdf, 0xf8, + 0xc8, 0x03, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x01, 0x28, 0x18, 0xd1, + 0xdf, 0xf8, 0xdc, 0x03, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x9a, 0xf8, + 0x79, 0x10, 0x31, 0xb9, 0x98, 0xf8, 0x79, 0x10, 0x49, 0x07, 0x44, 0xbf, + 0x20, 0x30, 0x20, 0xf0, 0x70, 0x40, 0xa9, 0xb2, 0xa9, 0xeb, 0x41, 0x01, + 0x08, 0x1a, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x40, 0xf2, + 0x90, 0x80, 0xd4, 0xe9, 0x35, 0x10, 0x49, 0x7f, 0x00, 0x29, 0x5f, 0xd0, + 0xd4, 0xf8, 0xe4, 0x70, 0xc1, 0x1b, 0x21, 0xf0, 0x70, 0x41, 0xb1, 0xf1, + 0x00, 0x6f, 0x88, 0xbf, 0x07, 0x46, 0x56, 0xe0, 0x94, 0xf8, 0xa4, 0x04, + 0x10, 0xf0, 0x04, 0x01, 0x01, 0xd0, 0x02, 0x07, 0x25, 0xd5, 0x9b, 0xf8, + 0x33, 0x20, 0x01, 0x2a, 0x20, 0xd1, 0x3a, 0x06, 0x1e, 0xd0, 0x20, 0x78, + 0x50, 0xb1, 0x9a, 0xf8, 0x7a, 0x00, 0x00, 0x28, 0x00, 0xf0, 0xe7, 0x80, + 0xcd, 0x48, 0x90, 0xf8, 0x4d, 0x00, 0x02, 0x28, 0xc0, 0xf0, 0xe1, 0x80, + 0x05, 0xeb, 0x85, 0x00, 0xc5, 0x08, 0x06, 0xe1, 0xd8, 0xf7, 0x70, 0xfc, + 0xd0, 0x49, 0x01, 0x22, 0x19, 0x23, 0x01, 0x26, 0x88, 0x60, 0xcb, 0x48, + 0x01, 0x21, 0x05, 0x68, 0x94, 0xf8, 0x35, 0x01, 0xa8, 0x47, 0x5d, 0xe0, + 0xd9, 0xb1, 0x00, 0x07, 0x19, 0xd4, 0x94, 0xf8, 0x35, 0x01, 0xc4, 0x4a, + 0x00, 0xeb, 0xc0, 0x01, 0x02, 0xeb, 0x41, 0x01, 0x4e, 0x78, 0x01, 0x2e, + 0x7a, 0xd1, 0xd4, 0xf8, 0xfc, 0x04, 0x41, 0x1c, 0x07, 0xd0, 0xa9, 0xeb, + 0x00, 0x00, 0x20, 0xf0, 0x70, 0x40, 0x0d, 0x28, 0x28, 0xbf, 0xc4, 0xf8, + 0x00, 0x05, 0xc4, 0xf8, 0xfc, 0x94, 0x01, 0x26, 0x40, 0xe0, 0xb4, 0xf8, + 0x3e, 0x04, 0x81, 0x04, 0x3f, 0xd4, 0x10, 0xf4, 0x90, 0x5f, 0x0c, 0xbf, + 0x06, 0xeb, 0x86, 0x00, 0xc6, 0xeb, 0xc6, 0x00, 0xc5, 0x08, 0x37, 0xe0, + 0x07, 0x46, 0xa8, 0xb2, 0xa9, 0xeb, 0x40, 0x00, 0xc0, 0x1b, 0x20, 0xf0, + 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x19, 0xd9, 0xb4, 0x48, 0x90, 0xf8, + 0x20, 0x00, 0xc0, 0x07, 0x14, 0xd1, 0xb3, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0xf8, 0xb1, 0xb1, 0x49, 0xa9, 0xeb, 0x07, 0x00, 0x08, 0x44, + 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x16, 0xd8, 0xa4, 0x49, + 0x94, 0xf8, 0x35, 0x01, 0x01, 0x26, 0x01, 0x22, 0x1b, 0x23, 0x0c, 0xe0, + 0xa0, 0x49, 0x94, 0xf8, 0x35, 0x01, 0x01, 0x26, 0x01, 0x22, 0x1e, 0x23, + 0x05, 0xe0, 0x9d, 0x49, 0x94, 0xf8, 0x35, 0x01, 0x01, 0x26, 0x01, 0x22, + 0x1d, 0x23, 0x0c, 0x68, 0x01, 0x21, 0xa0, 0x47, 0x30, 0x46, 0xbd, 0xe8, + 0xf8, 0x8f, 0x35, 0x46, 0xd4, 0xf8, 0xbc, 0x05, 0x00, 0x28, 0x3f, 0xf4, + 0x1d, 0xaf, 0x90, 0xf8, 0x3e, 0x00, 0x01, 0x28, 0x7f, 0xf4, 0x18, 0xaf, + 0xa8, 0xb2, 0x40, 0x00, 0x10, 0xfa, 0x85, 0xf0, 0xc0, 0xf3, 0x9c, 0x05, + 0x10, 0xe7, 0x00, 0x07, 0x3f, 0xf5, 0x1d, 0xaf, 0xe0, 0x78, 0x01, 0x28, + 0x7f, 0xf4, 0x19, 0xaf, 0xd4, 0xf8, 0xdc, 0x00, 0x8d, 0x49, 0xa9, 0xeb, + 0x00, 0x00, 0x08, 0x44, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, + 0x7f, 0xf6, 0x0d, 0xaf, 0xdd, 0x20, 0x0b, 0xe7, 0x00, 0x21, 0x4f, 0xf0, + 0xff, 0x32, 0x9b, 0xf8, 0x38, 0x30, 0xc4, 0xf8, 0x00, 0x15, 0xd4, 0xf8, + 0xdc, 0x10, 0xc4, 0xf8, 0xfc, 0x24, 0xc4, 0xf8, 0xe0, 0x20, 0xa9, 0xeb, + 0x01, 0x02, 0xa2, 0xeb, 0x43, 0x02, 0x22, 0xf0, 0x70, 0x42, 0xb2, 0xf1, + 0x00, 0x6f, 0xbf, 0xd8, 0x7b, 0x4d, 0x9b, 0xf8, 0x3c, 0x70, 0x55, 0xf8, + 0x04, 0x3f, 0xa9, 0xeb, 0x03, 0x03, 0xa3, 0xeb, 0x47, 0x03, 0x23, 0xf0, + 0x70, 0x43, 0xb3, 0xf1, 0x00, 0x6f, 0x2c, 0xd9, 0x00, 0x29, 0xaf, 0xd0, + 0xb2, 0xf1, 0x00, 0x6f, 0xac, 0xd8, 0x28, 0x68, 0x9b, 0xf8, 0x3c, 0x70, + 0xa9, 0xeb, 0x00, 0x08, 0x00, 0xf0, 0xba, 0xfa, 0xc1, 0x17, 0x00, 0xeb, + 0x51, 0x71, 0x21, 0xf0, 0x07, 0x01, 0x40, 0x1a, 0x38, 0x44, 0xa8, 0xeb, + 0x40, 0x00, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x97, 0xd8, + 0xd8, 0xf7, 0x9c, 0xfb, 0x68, 0x60, 0x63, 0x48, 0x01, 0x21, 0x01, 0x22, + 0x23, 0x23, 0x01, 0x26, 0x2b, 0xe7, 0xb4, 0xf8, 0x3e, 0x04, 0x81, 0x04, + 0x18, 0xd4, 0x10, 0xf4, 0x90, 0x5f, 0x0d, 0xd0, 0xc5, 0xeb, 0xc5, 0x00, + 0x11, 0xe0, 0x5b, 0x49, 0x01, 0x22, 0x1a, 0x23, 0x01, 0x26, 0x0c, 0x68, + 0x01, 0x21, 0xa0, 0x47, 0xd8, 0xf7, 0x82, 0xfb, 0x68, 0x60, 0x79, 0xe7, + 0x9b, 0xf8, 0x34, 0x70, 0x05, 0xeb, 0x85, 0x00, 0x00, 0x2f, 0x18, 0xbf, + 0x01, 0x3f, 0xc5, 0x08, 0xd4, 0xf8, 0xbc, 0x05, 0x48, 0xb1, 0x90, 0xf8, + 0x3e, 0x00, 0x01, 0x28, 0x05, 0xd1, 0xa8, 0xb2, 0x40, 0x00, 0x10, 0xfa, + 0x85, 0xf0, 0xc0, 0xf3, 0x9c, 0x05, 0x9b, 0xf8, 0xb9, 0x00, 0x58, 0xb1, + 0x44, 0x48, 0x90, 0xf8, 0xfe, 0x06, 0x38, 0xb1, 0x43, 0x48, 0x40, 0x78, + 0x03, 0x28, 0x03, 0xd1, 0xbb, 0xf8, 0xc3, 0x50, 0x9b, 0xf8, 0xbf, 0x70, + 0x40, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x01, 0x28, 0x17, 0xd1, + 0xf2, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x06, 0x46, 0x9b, 0xf8, + 0xb9, 0x00, 0x68, 0xb1, 0xf3, 0x48, 0x90, 0xf8, 0xfe, 0x06, 0x48, 0xb1, + 0x36, 0x48, 0x40, 0x78, 0x03, 0x28, 0x05, 0xd1, 0x9b, 0xf8, 0xc0, 0x00, + 0x86, 0x42, 0x28, 0xbf, 0x02, 0x2e, 0x4a, 0xd2, 0xb0, 0x46, 0x01, 0xe0, + 0x4f, 0xf0, 0x00, 0x08, 0xe7, 0x48, 0x01, 0x68, 0x04, 0xf1, 0x20, 0x00, + 0x88, 0x47, 0x08, 0xeb, 0x00, 0x01, 0x94, 0xf8, 0x35, 0x01, 0xe7, 0x4b, + 0x00, 0xeb, 0xc0, 0x02, 0x03, 0xeb, 0x42, 0x02, 0x56, 0x78, 0x01, 0x2e, + 0x24, 0xd1, 0x2c, 0x4a, 0x2c, 0x4b, 0x12, 0x78, 0xc2, 0xeb, 0x42, 0x12, + 0x53, 0xf8, 0x32, 0x60, 0xa6, 0x42, 0x0a, 0xd1, 0xd4, 0xf8, 0xd4, 0x60, + 0x76, 0x7f, 0x36, 0xb9, 0x03, 0xeb, 0xc2, 0x02, 0xd2, 0xf8, 0xc0, 0x20, + 0x52, 0x79, 0x02, 0x2a, 0x1c, 0xd2, 0x9b, 0xf8, 0x35, 0x20, 0x89, 0xb2, + 0x91, 0x42, 0x8f, 0xbf, 0x01, 0x26, 0x1e, 0x49, 0x0f, 0x68, 0x00, 0x26, + 0x9f, 0xbf, 0x00, 0x21, 0x01, 0x22, 0x4b, 0x23, 0xb8, 0x47, 0xdf, 0xf8, + 0x40, 0x80, 0x26, 0xe6, 0xfa, 0xb2, 0x89, 0xb2, 0xdf, 0xf8, 0x34, 0x80, + 0x91, 0x42, 0xff, 0xf4, 0x20, 0xae, 0x15, 0x49, 0x01, 0x26, 0x01, 0x22, + 0x18, 0x23, 0xf0, 0xe6, 0x12, 0x49, 0x01, 0x26, 0x01, 0x22, 0x17, 0x23, + 0xeb, 0xe6, 0x4f, 0xf0, 0x01, 0x08, 0x0d, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x01, 0x3e, 0xb0, 0xb2, 0x01, 0x28, 0xf7, 0xd8, 0xad, 0xe7, + 0x8c, 0x7e, 0x08, 0x00, 0x40, 0x86, 0x08, 0x00, 0x4c, 0x49, 0x01, 0x00, + 0x81, 0x4a, 0x01, 0x00, 0xe0, 0xa0, 0x08, 0x00, 0x18, 0x74, 0x01, 0x00, + 0x38, 0x21, 0x01, 0x00, 0x50, 0x2e, 0x01, 0x00, 0x4c, 0x9d, 0x08, 0x00, + 0xe8, 0xaf, 0x08, 0x00, 0x44, 0x28, 0x01, 0x00, 0x04, 0xa1, 0x08, 0x00, + 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0x14, 0xf0, 0x05, 0x00, + 0xf8, 0xff, 0xff, 0x0f, 0x0c, 0x9d, 0x08, 0x00, 0x58, 0x9d, 0x08, 0x00, + 0xd8, 0x5d, 0x01, 0x00, 0xcc, 0xba, 0x08, 0x00, 0x60, 0xff, 0xff, 0x0f, + 0x2d, 0xe9, 0xf8, 0x4f, 0x45, 0x68, 0x04, 0x46, 0x90, 0xf8, 0x12, 0x80, + 0x95, 0xf8, 0xc0, 0x00, 0x02, 0x28, 0x1b, 0xd1, 0x9e, 0x48, 0x07, 0x21, + 0x90, 0xf8, 0x58, 0x03, 0xa0, 0x74, 0xe2, 0x7c, 0x40, 0x45, 0x02, 0xf0, + 0xfb, 0x02, 0xe2, 0x74, 0x0e, 0xd0, 0x8d, 0xf8, 0x01, 0x00, 0x20, 0x7d, + 0x00, 0x22, 0x8d, 0xf8, 0x02, 0x10, 0x69, 0x46, 0x8d, 0xf8, 0x03, 0x20, + 0x8d, 0xf8, 0x00, 0x00, 0x9f, 0x48, 0x02, 0x68, 0x15, 0x20, 0x90, 0x47, + 0xbd, 0xe8, 0xf8, 0x8f, 0xd5, 0xf8, 0xd0, 0x00, 0x00, 0x78, 0x02, 0x28, + 0x17, 0xd2, 0xb5, 0xf8, 0x82, 0x10, 0xc8, 0x04, 0x3f, 0xd4, 0x8d, 0x48, + 0xb0, 0xf8, 0x7a, 0x10, 0xd5, 0xf8, 0xc8, 0x00, 0x42, 0x18, 0x8b, 0x49, + 0x89, 0x69, 0x09, 0x69, 0x52, 0x1a, 0x22, 0xf0, 0x70, 0x42, 0xb2, 0xf1, + 0x00, 0x6f, 0x4f, 0xd9, 0x84, 0x48, 0x0d, 0x21, 0x90, 0xf8, 0x5b, 0x03, + 0xca, 0xe7, 0x33, 0xd1, 0x84, 0x48, 0xd5, 0xf8, 0xc8, 0x70, 0x01, 0x68, + 0x28, 0x46, 0x88, 0x47, 0x4f, 0xea, 0x17, 0x69, 0x4f, 0xea, 0x17, 0x4a, + 0x4f, 0xea, 0x17, 0x2b, 0x00, 0x28, 0x4c, 0xd0, 0x7e, 0x4e, 0x28, 0x46, + 0x31, 0x68, 0x88, 0x47, 0x60, 0xb1, 0x7d, 0x48, 0x01, 0x68, 0x28, 0x46, + 0x88, 0x47, 0xd5, 0xf8, 0x10, 0x15, 0x0f, 0x18, 0xc7, 0xf3, 0x03, 0x69, + 0x4f, 0xea, 0x17, 0x4a, 0x4f, 0xea, 0x17, 0x2b, 0x31, 0x68, 0x28, 0x46, + 0x88, 0x47, 0x06, 0x46, 0x75, 0x48, 0x01, 0x68, 0x05, 0xf1, 0x20, 0x00, + 0x88, 0x47, 0x30, 0x44, 0x52, 0xe0, 0x6c, 0x48, 0x21, 0xf4, 0x80, 0x51, + 0xa5, 0xf8, 0x82, 0x10, 0x36, 0x21, 0x90, 0xf8, 0x93, 0x03, 0x95, 0xe7, + 0x69, 0x49, 0xd5, 0xf8, 0xc8, 0x00, 0x89, 0x69, 0x09, 0x69, 0x40, 0x1a, + 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x62, 0x48, 0x9d, 0xbf, + 0x90, 0xf8, 0x59, 0x03, 0xa0, 0x74, 0x0c, 0x21, 0x90, 0xf8, 0x5a, 0x03, + 0x84, 0xbf, 0xa0, 0x74, 0x0b, 0x21, 0x80, 0xe7, 0x40, 0x1a, 0x20, 0xf0, + 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x5a, 0x48, 0x9d, 0xbf, 0x90, 0xf8, + 0x59, 0x03, 0xa0, 0x74, 0x0f, 0x21, 0x90, 0xf8, 0x5a, 0x03, 0x84, 0xbf, + 0xa0, 0x74, 0x0e, 0x21, 0x6f, 0xe7, 0x28, 0x46, 0x50, 0xf8, 0x20, 0x1f, + 0xd9, 0xb1, 0x52, 0x4a, 0xb2, 0xf8, 0x1e, 0x25, 0x03, 0x32, 0x22, 0xf0, + 0x03, 0x02, 0x8b, 0x18, 0x89, 0x5c, 0x5a, 0x78, 0x9e, 0x78, 0xdb, 0x78, + 0x41, 0xea, 0x02, 0x21, 0xd5, 0xf8, 0x10, 0x25, 0x41, 0xea, 0x06, 0x41, + 0x41, 0xea, 0x03, 0x61, 0x11, 0x44, 0x21, 0xf0, 0x70, 0x47, 0x4f, 0xea, + 0x17, 0x69, 0x4f, 0xea, 0x17, 0x4a, 0x4f, 0xea, 0x17, 0x2b, 0x4a, 0x49, + 0x09, 0x68, 0x88, 0x47, 0x4f, 0xea, 0x09, 0x62, 0x4f, 0xea, 0x0b, 0x21, + 0xdf, 0xf8, 0x04, 0xb1, 0xdf, 0xf8, 0x04, 0x91, 0x6a, 0xf3, 0x17, 0x42, + 0x89, 0xb2, 0x0a, 0x44, 0xf9, 0xb2, 0x57, 0x18, 0xbb, 0xf8, 0x78, 0x10, + 0x7a, 0x18, 0xd9, 0xf8, 0x18, 0x10, 0x09, 0x69, 0x51, 0x1a, 0x21, 0xf0, + 0x70, 0x41, 0xb1, 0xf1, 0x00, 0x6f, 0x18, 0xd8, 0xdf, 0xf8, 0xf0, 0xa0, + 0x06, 0x46, 0xda, 0xf8, 0x00, 0x10, 0x88, 0x47, 0x32, 0x46, 0xa8, 0xb1, + 0x39, 0x48, 0x90, 0xf8, 0x79, 0x00, 0x0c, 0x28, 0x0b, 0xd0, 0xd9, 0xf8, + 0x18, 0x10, 0xbb, 0xf8, 0x7c, 0x00, 0x09, 0x69, 0x38, 0x44, 0x40, 0x1a, + 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x04, 0xd9, 0x29, 0x48, + 0x08, 0x21, 0x90, 0xf8, 0x57, 0x03, 0x13, 0xe7, 0x10, 0x06, 0x18, 0xd0, + 0x2e, 0x48, 0x90, 0xf8, 0x01, 0x17, 0x0a, 0x29, 0x13, 0xd1, 0x90, 0xf8, + 0x34, 0x12, 0x01, 0x29, 0x0f, 0xd1, 0x95, 0xf8, 0x35, 0x11, 0x2a, 0x4a, + 0x01, 0xeb, 0xc1, 0x01, 0x02, 0xeb, 0x41, 0x01, 0x49, 0x78, 0x01, 0x29, + 0x05, 0xd1, 0x90, 0xf8, 0x02, 0x07, 0x10, 0xb1, 0x1a, 0x48, 0x42, 0x21, + 0xe1, 0xe7, 0xd9, 0xf8, 0x18, 0x00, 0x00, 0x69, 0x38, 0x1a, 0x20, 0xf0, + 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0x0f, 0xd9, 0xda, 0xf8, 0x00, 0x00, + 0x80, 0x47, 0x01, 0x28, 0x12, 0x48, 0x1d, 0xbf, 0x90, 0xf8, 0x56, 0x03, + 0xa0, 0x74, 0x09, 0x21, 0x90, 0xf8, 0x95, 0x03, 0x04, 0xbf, 0xa0, 0x74, + 0x37, 0x21, 0xe0, 0xe6, 0x17, 0x48, 0x90, 0xf8, 0x4d, 0x00, 0x02, 0x28, + 0x01, 0xd3, 0x28, 0x6a, 0x48, 0xb9, 0x95, 0xf8, 0x35, 0x01, 0x12, 0x49, + 0x00, 0xeb, 0xc0, 0x00, 0x01, 0xeb, 0x40, 0x00, 0x40, 0x78, 0x01, 0x28, + 0x02, 0xd1, 0x28, 0x20, 0x41, 0x21, 0xcb, 0xe6, 0x02, 0x48, 0x0a, 0x21, + 0x90, 0xf8, 0x55, 0x03, 0xc6, 0xe6, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0xfc, 0x73, 0x01, 0x00, 0x54, 0x9d, 0x08, 0x00, + 0x50, 0x9d, 0x08, 0x00, 0x58, 0x9d, 0x08, 0x00, 0x28, 0x9d, 0x08, 0x00, + 0x74, 0xcf, 0x08, 0x00, 0x4c, 0x49, 0x01, 0x00, 0x38, 0x21, 0x01, 0x00, + 0x44, 0x28, 0x01, 0x00, 0x18, 0x74, 0x01, 0x00, 0x1c, 0xa1, 0x08, 0x00, + 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0x6e, 0xf8, 0xc0, 0xb1, 0x94, 0xf8, + 0xa4, 0x14, 0x4a, 0x07, 0x01, 0xd5, 0x09, 0x07, 0x12, 0xd5, 0xb4, 0xf8, + 0x3e, 0x14, 0x89, 0x07, 0x0e, 0xd5, 0x90, 0xf8, 0x20, 0x10, 0x01, 0xf0, + 0x0f, 0x01, 0x03, 0x29, 0x08, 0xd1, 0x81, 0x8a, 0x31, 0xb1, 0x21, 0x78, + 0x03, 0x4a, 0x51, 0x5c, 0x41, 0xf0, 0x04, 0x01, 0x80, 0xf8, 0x20, 0x10, + 0x10, 0xbd, 0x00, 0xbf, 0xfe, 0xca, 0x0a, 0x10, 0xa0, 0xb1, 0xb0, 0xb5, + 0x90, 0xf8, 0x8b, 0x51, 0x04, 0x46, 0x00, 0xf0, 0x4f, 0xf8, 0x94, 0xf8, + 0x8b, 0x01, 0x85, 0x42, 0x09, 0xd0, 0x94, 0xf8, 0x35, 0x01, 0x07, 0x49, + 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, 0x01, 0x6c, 0x01, 0x31, + 0x01, 0x64, 0xb0, 0xbd, 0x00, 0x20, 0x40, 0xf2, 0x1b, 0x51, 0xdd, 0xf7, + 0x77, 0xbf, 0x00, 0xbf, 0x54, 0xf1, 0x05, 0x00, 0x09, 0x48, 0x0a, 0x49, + 0x01, 0x60, 0x0a, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, 0x0b, 0x49, + 0x01, 0x60, 0x0b, 0x48, 0x0b, 0x49, 0xc0, 0xf8, 0x1c, 0x11, 0x0b, 0x48, + 0x0b, 0x49, 0x81, 0x60, 0x0b, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xac, 0xe2, 0x08, 0x00, 0xe1, 0x83, 0x04, 0x00, 0x58, 0xdc, 0x08, 0x00, + 0x65, 0x81, 0x04, 0x00, 0xa8, 0xe2, 0x08, 0x00, 0xd5, 0x85, 0x04, 0x00, + 0x98, 0xdf, 0x08, 0x00, 0x95, 0x8a, 0x04, 0x00, 0xc0, 0xe2, 0x08, 0x00, + 0x59, 0x8d, 0x04, 0x00, 0xd4, 0xe2, 0x08, 0x00, 0x9d, 0x8d, 0x04, 0x00, + 0x4a, 0xf2, 0x0d, 0x5c, 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x45, 0xf2, 0x6d, 0x3c, 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x47, 0xf2, 0x85, 0x1c, 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x60, 0x49, 0x91, 0xf8, 0x32, 0x10, 0x02, 0x29, 0x0b, 0xd1, 0x0e, 0x49, + 0x0e, 0x4a, 0x09, 0x78, 0x01, 0xeb, 0x01, 0x11, 0x02, 0xeb, 0xc1, 0x01, + 0x0c, 0x4a, 0x09, 0x69, 0x12, 0x68, 0x91, 0x42, 0x01, 0xd0, 0x00, 0xf0, + 0xc9, 0xb8, 0x0a, 0x49, 0x0a, 0x6a, 0x01, 0x68, 0x8a, 0x1a, 0x22, 0xf0, + 0x70, 0x42, 0xb2, 0xf1, 0x00, 0x6f, 0x82, 0xbf, 0x04, 0x31, 0x21, 0xf0, + 0x70, 0x41, 0x01, 0x60, 0x00, 0xf0, 0xba, 0xb8, 0x74, 0x87, 0x08, 0x00, + 0xfc, 0x6d, 0x01, 0x00, 0x10, 0xe4, 0x08, 0x00, 0xfc, 0x70, 0x01, 0x00, + 0x2d, 0xe9, 0xf8, 0x4f, 0x04, 0x46, 0x00, 0xf0, 0xb3, 0xf8, 0xd4, 0xf8, + 0x88, 0x00, 0x41, 0xb2, 0x00, 0x29, 0x00, 0xf1, 0x89, 0x80, 0x00, 0x01, + 0x00, 0xf1, 0x86, 0x80, 0x43, 0x48, 0x00, 0x68, 0x80, 0x47, 0xdf, 0xf8, + 0x0c, 0x91, 0x80, 0x46, 0x43, 0x4f, 0x72, 0xb6, 0x59, 0xf8, 0x0c, 0x0f, + 0xd9, 0xf8, 0x04, 0x10, 0x02, 0x46, 0x02, 0xf8, 0x04, 0x1f, 0x0b, 0x0e, + 0xd3, 0x70, 0x0b, 0x0c, 0x09, 0x0a, 0x41, 0x71, 0x93, 0x70, 0x01, 0x0e, + 0xd9, 0xf8, 0x04, 0x20, 0xd1, 0x70, 0x01, 0x0c, 0x10, 0x70, 0x91, 0x70, + 0x01, 0x0a, 0x37, 0x48, 0x51, 0x70, 0x81, 0x6b, 0x0a, 0x78, 0x4b, 0x78, + 0x8c, 0x78, 0xcd, 0x78, 0x44, 0xea, 0x05, 0x24, 0x42, 0xea, 0x03, 0x22, + 0x4f, 0xea, 0x19, 0x23, 0x4f, 0xea, 0x19, 0x45, 0x42, 0xea, 0x04, 0x42, + 0x4f, 0xea, 0x19, 0x64, 0xc9, 0xf8, 0x00, 0x20, 0x53, 0x71, 0x02, 0xf8, + 0x04, 0x9f, 0xd4, 0x70, 0x95, 0x70, 0x3a, 0x68, 0x52, 0x00, 0x01, 0x32, + 0x3a, 0x60, 0x8d, 0x70, 0x4b, 0x70, 0x81, 0xf8, 0x00, 0x90, 0xcc, 0x70, + 0x00, 0xf1, 0x34, 0x04, 0xc9, 0xf8, 0x04, 0x10, 0x86, 0x6b, 0xa6, 0x42, + 0x38, 0xd0, 0xdf, 0xf8, 0x90, 0xa0, 0x4f, 0xf0, 0x00, 0x0b, 0xb0, 0x69, + 0x00, 0x78, 0x05, 0x28, 0x09, 0xd0, 0x21, 0x28, 0x21, 0xd1, 0xb9, 0xf8, + 0x0c, 0x00, 0x08, 0xeb, 0x40, 0x00, 0x20, 0xf0, 0x70, 0x40, 0x30, 0x61, + 0x19, 0xe0, 0x72, 0xb6, 0x38, 0x68, 0x40, 0x00, 0x01, 0x30, 0x38, 0x60, + 0xda, 0xf8, 0x00, 0x50, 0x5d, 0xb1, 0x18, 0x48, 0x01, 0x68, 0x28, 0x46, + 0x88, 0x47, 0x28, 0x7d, 0xc5, 0xf8, 0x10, 0xb0, 0xca, 0xf8, 0x00, 0xb0, + 0x85, 0xf8, 0x14, 0xb0, 0xa8, 0x75, 0x38, 0x68, 0x40, 0x08, 0x38, 0x60, + 0x38, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x16, 0xf8, 0x04, 0x0f, 0x71, 0x78, + 0xb2, 0x78, 0xf3, 0x78, 0x40, 0xea, 0x01, 0x20, 0x42, 0xea, 0x03, 0x21, + 0x40, 0xea, 0x01, 0x46, 0xa6, 0x42, 0xca, 0xd1, 0x38, 0x68, 0x40, 0x08, + 0x38, 0x60, 0x38, 0x68, 0x80, 0xf3, 0x10, 0x88, 0xbd, 0xe8, 0xf8, 0x8f, + 0xe0, 0xa0, 0x08, 0x00, 0x7c, 0x5c, 0x01, 0x00, 0x18, 0x74, 0x01, 0x00, + 0x24, 0x36, 0x01, 0x00, 0x24, 0x5c, 0x01, 0x00, 0xc8, 0xa0, 0x08, 0x00, + 0x03, 0x48, 0x04, 0x49, 0x01, 0x60, 0x04, 0x48, 0x04, 0x49, 0xc0, 0xf8, + 0xb8, 0x10, 0x70, 0x47, 0x18, 0xaa, 0x08, 0x00, 0xa9, 0x8e, 0x04, 0x00, + 0x98, 0xdf, 0x08, 0x00, 0x55, 0x8e, 0x04, 0x00, 0x4c, 0xf6, 0x4f, 0x5c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4c, 0xf6, 0x51, 0x7c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x09, 0x49, 0x49, 0x68, + 0x81, 0x42, 0x08, 0xd0, 0x39, 0x49, 0x11, 0xf8, 0x30, 0x2f, 0x83, 0x2a, + 0x03, 0xd1, 0x0a, 0x79, 0x1a, 0xb1, 0x01, 0x3a, 0x0a, 0x71, 0x00, 0xf0, + 0x99, 0xb8, 0x85, 0x22, 0x0a, 0x70, 0x00, 0xf0, 0x9b, 0xb8, 0x00, 0xbf, + 0x18, 0x74, 0x01, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0x9a, 0xf8, + 0x07, 0x48, 0x80, 0x7d, 0x01, 0x28, 0x09, 0xd0, 0x13, 0x48, 0xa1, 0x7c, + 0x90, 0xf8, 0x5b, 0x23, 0x01, 0x32, 0x8a, 0x42, 0x04, 0xbf, 0x90, 0xf8, + 0x4a, 0x03, 0xa0, 0x74, 0x10, 0xbd, 0x00, 0xbf, 0xc8, 0x5c, 0x01, 0x00, + 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0x8a, 0xf8, 0x23, 0x48, 0x90, 0xf8, + 0x30, 0x10, 0x19, 0xb1, 0x90, 0xf8, 0x30, 0x10, 0x81, 0x29, 0x0c, 0xd1, + 0x80, 0x7d, 0x01, 0x28, 0x09, 0xd0, 0x05, 0x48, 0xa1, 0x7c, 0x90, 0xf8, + 0x5b, 0x23, 0x01, 0x32, 0x8a, 0x42, 0x04, 0xbf, 0x90, 0xf8, 0x4a, 0x03, + 0xa0, 0x74, 0x10, 0xbd, 0x8c, 0x7e, 0x08, 0x00, 0xb0, 0xb5, 0x17, 0x49, + 0x0c, 0x4d, 0x91, 0xf8, 0x30, 0x20, 0x6c, 0x8a, 0x85, 0x2a, 0x04, 0xd0, + 0x84, 0x2a, 0x06, 0xd1, 0x91, 0xf8, 0x35, 0x10, 0x19, 0xb9, 0x08, 0x49, + 0x0a, 0x88, 0x01, 0x32, 0x0a, 0x80, 0x00, 0xf0, 0x53, 0xf8, 0x69, 0x8a, + 0x8c, 0x42, 0x03, 0xd0, 0x12, 0x49, 0x0a, 0x69, 0x01, 0x32, 0x0a, 0x61, + 0xb0, 0xbd, 0x00, 0xbf, 0xc4, 0x79, 0x01, 0x00, 0x7e, 0xfa, 0x05, 0x00, + 0x06, 0x49, 0x91, 0xf8, 0x20, 0x10, 0x01, 0x29, 0x05, 0xd1, 0x05, 0x49, + 0x89, 0x7d, 0x02, 0x29, 0x04, 0xbf, 0x00, 0x20, 0x70, 0x47, 0x00, 0xf0, + 0x4b, 0xb8, 0x00, 0xbf, 0x3c, 0x88, 0x01, 0x00, 0x38, 0x5d, 0x01, 0x00, + 0x80, 0xb5, 0x00, 0xf0, 0x49, 0xf8, 0x01, 0x28, 0x03, 0xd1, 0x02, 0x49, + 0x8a, 0x68, 0x01, 0x32, 0x8a, 0x60, 0x80, 0xbd, 0x84, 0xf0, 0x05, 0x00, + 0x10, 0xb5, 0x08, 0x48, 0x08, 0x49, 0x09, 0x4a, 0x0a, 0x4c, 0x09, 0x4b, + 0xc0, 0xe9, 0x35, 0x24, 0xc0, 0xe9, 0x37, 0x31, 0x08, 0x49, 0x09, 0x4a, + 0x0a, 0x60, 0x09, 0x49, 0xc0, 0xf8, 0xcc, 0x10, 0x10, 0xbd, 0x00, 0xbf, + 0x98, 0xdf, 0x08, 0x00, 0x7d, 0x90, 0x04, 0x00, 0x51, 0x90, 0x04, 0x00, + 0x25, 0x90, 0x04, 0x00, 0xb5, 0x90, 0x04, 0x00, 0x04, 0xd3, 0x08, 0x00, + 0xf5, 0x90, 0x04, 0x00, 0x19, 0x91, 0x04, 0x00, 0x4e, 0xf2, 0x6f, 0x0c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf6, 0x45, 0x4c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf2, 0x21, 0x1c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf2, 0xa5, 0x1c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf6, 0x8f, 0x2c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf6, 0x7f, 0x1c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0xf8, 0xb5, 0x04, 0x46, + 0x58, 0x48, 0x81, 0x89, 0x01, 0x31, 0x81, 0x81, 0x57, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x56, 0x48, 0x05, 0x69, 0x56, 0x48, 0x01, 0x68, + 0x00, 0x20, 0x88, 0x47, 0x68, 0x6f, 0x55, 0x49, 0x08, 0x60, 0x55, 0x49, + 0xa8, 0x6f, 0x08, 0x60, 0x54, 0x48, 0x4f, 0xf4, 0x88, 0x41, 0x01, 0x60, + 0x53, 0x48, 0x00, 0x68, 0x20, 0xb1, 0xd0, 0xf8, 0xc0, 0x11, 0x01, 0x31, + 0xc0, 0xf8, 0xc0, 0x11, 0x50, 0x4e, 0x51, 0x4f, 0x30, 0x78, 0xc0, 0xeb, + 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0xe0, 0x00, 0x02, 0x28, + 0x7a, 0xd1, 0xa3, 0x49, 0x20, 0x68, 0x09, 0x68, 0x88, 0x47, 0x20, 0x68, + 0x00, 0x25, 0x4a, 0x4b, 0x05, 0x70, 0x20, 0x68, 0x41, 0x78, 0xd0, 0xf8, + 0xd4, 0x20, 0x02, 0xeb, 0x81, 0x01, 0x0f, 0x22, 0xc1, 0xf8, 0x94, 0x00, + 0x04, 0x21, 0x60, 0x68, 0x80, 0xf8, 0x55, 0x50, 0x60, 0x68, 0x80, 0xf8, + 0x54, 0x10, 0xd4, 0xe9, 0x00, 0x01, 0xd0, 0xf8, 0xd4, 0x00, 0x54, 0x30, + 0xc1, 0xf8, 0x94, 0x00, 0x20, 0x68, 0x41, 0x78, 0xd0, 0xf8, 0xd4, 0x00, + 0x89, 0x00, 0x02, 0xfa, 0x01, 0xf1, 0xd0, 0xf8, 0x90, 0x20, 0x22, 0xea, + 0x01, 0x01, 0xc0, 0xf8, 0x90, 0x10, 0x20, 0x68, 0x01, 0x78, 0x42, 0x78, + 0xd0, 0xf8, 0xd4, 0x00, 0x59, 0x5c, 0x92, 0x00, 0x41, 0xf0, 0x01, 0x01, + 0x91, 0x40, 0xd0, 0xf8, 0x90, 0x20, 0x11, 0x43, 0xc0, 0xf8, 0x90, 0x10, + 0x20, 0x68, 0xd0, 0xf8, 0xd4, 0x00, 0xd0, 0xf8, 0x90, 0x10, 0x21, 0xf0, + 0x0f, 0x01, 0xc0, 0xf8, 0x90, 0x10, 0x20, 0x68, 0x01, 0x78, 0xd0, 0xf8, + 0xd4, 0x00, 0x59, 0x5c, 0xd0, 0xf8, 0x90, 0x20, 0x11, 0x43, 0x41, 0xf0, + 0x01, 0x01, 0xc0, 0xf8, 0x90, 0x10, 0x26, 0x48, 0x01, 0x68, 0x20, 0x68, + 0xd0, 0xf8, 0xd4, 0x00, 0x14, 0x30, 0x88, 0x47, 0xe5, 0x48, 0x84, 0x21, + 0x80, 0xf8, 0x30, 0x10, 0x10, 0x21, 0x80, 0xf8, 0x35, 0x10, 0x30, 0x78, + 0x1f, 0x49, 0xc0, 0xeb, 0x40, 0x10, 0x09, 0x68, 0x57, 0xf8, 0x30, 0x00, + 0x00, 0xf5, 0x80, 0x70, 0x88, 0x47, 0x88, 0xb1, 0x1b, 0x48, 0x01, 0x21, + 0x00, 0x22, 0x80, 0xf8, 0x46, 0x10, 0x30, 0x78, 0x00, 0x21, 0xc0, 0xeb, + 0x40, 0x10, 0x07, 0xeb, 0xc0, 0x00, 0x80, 0xf8, 0x9e, 0x50, 0x6e, 0x48, + 0x03, 0x68, 0xbb, 0x20, 0x98, 0x47, 0x09, 0xe0, 0x13, 0x48, 0x02, 0x68, + 0x20, 0x68, 0xd0, 0xf8, 0xd4, 0x10, 0x00, 0xf5, 0x80, 0x70, 0x74, 0x31, + 0x90, 0x47, 0x01, 0x25, 0x28, 0x46, 0xf8, 0xbd, 0xc4, 0x79, 0x01, 0x00, + 0x78, 0xf2, 0x08, 0x00, 0xfc, 0x73, 0x01, 0x00, 0x64, 0xa1, 0x08, 0x00, + 0x0c, 0x23, 0x21, 0x40, 0x10, 0x23, 0x21, 0x40, 0x14, 0x23, 0x21, 0x40, + 0x08, 0x36, 0x01, 0x00, 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0x03, 0xcb, 0x0a, 0x10, 0x70, 0xf2, 0x08, 0x00, 0x6c, 0xf2, 0x08, 0x00, + 0x7c, 0x5c, 0x01, 0x00, 0x98, 0xda, 0x08, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, + 0xba, 0x4d, 0xbb, 0x4c, 0x28, 0x78, 0xc0, 0xeb, 0x40, 0x12, 0x04, 0xeb, + 0xc2, 0x01, 0x91, 0xf8, 0x9e, 0x30, 0x3b, 0xb1, 0x91, 0xf8, 0xe0, 0x30, + 0x02, 0x2b, 0x03, 0xd1, 0xb1, 0xf8, 0xdc, 0x30, 0x1b, 0x07, 0x2f, 0xd4, + 0x01, 0x22, 0x00, 0x26, 0x81, 0xf8, 0x92, 0x20, 0xb2, 0x4a, 0x81, 0xf8, + 0x94, 0x60, 0x92, 0xf8, 0x34, 0x30, 0x01, 0x3b, 0x82, 0xf8, 0x34, 0x30, + 0x1b, 0x06, 0x19, 0xd1, 0x30, 0x32, 0x85, 0x23, 0x13, 0x70, 0x42, 0x4b, + 0x09, 0x6a, 0x53, 0xf8, 0x20, 0x00, 0x03, 0x68, 0x59, 0x1a, 0x40, 0x4b, + 0x19, 0x44, 0x09, 0x01, 0x05, 0xd5, 0x51, 0x78, 0x19, 0xb1, 0x81, 0x8a, + 0x40, 0x31, 0x81, 0x81, 0x01, 0x81, 0x3c, 0x48, 0x00, 0x21, 0x00, 0x22, + 0x03, 0x68, 0x82, 0x20, 0x98, 0x47, 0x28, 0x78, 0xc0, 0xeb, 0x40, 0x10, + 0x04, 0xeb, 0xc0, 0x00, 0x80, 0xf8, 0xe0, 0x60, 0xbd, 0xe8, 0xf8, 0x8f, + 0x2e, 0x49, 0x54, 0xf8, 0x32, 0x00, 0x09, 0x68, 0x88, 0x47, 0x28, 0x78, + 0x01, 0x21, 0xc0, 0xeb, 0x40, 0x10, 0x04, 0xeb, 0xc0, 0x09, 0x09, 0xf8, + 0x94, 0x1f, 0x00, 0x21, 0xc8, 0x46, 0x08, 0xf8, 0x02, 0x1d, 0x27, 0x49, + 0x0e, 0x78, 0x00, 0x2e, 0xe8, 0xd0, 0x54, 0xf8, 0x30, 0x50, 0xdf, 0xf8, + 0x94, 0xb0, 0x00, 0x24, 0x05, 0xf5, 0x80, 0x7a, 0x5b, 0xf8, 0x24, 0x70, + 0xaf, 0x42, 0x06, 0xd0, 0x07, 0xf5, 0x80, 0x71, 0x50, 0x46, 0x06, 0x22, + 0xe7, 0xf7, 0xc6, 0xff, 0x20, 0xb1, 0x01, 0x34, 0xb4, 0x42, 0xf1, 0xd3, + 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x00, 0x2f, 0xce, 0xd0, 0x00, 0x28, + 0xcc, 0xd0, 0x97, 0xf8, 0x24, 0x01, 0x03, 0x28, 0x0b, 0xd0, 0x97, 0xf8, + 0x24, 0x01, 0x84, 0x28, 0x07, 0xd0, 0x97, 0xf8, 0x24, 0x01, 0x85, 0x28, + 0x03, 0xd0, 0x97, 0xf8, 0x24, 0x01, 0x81, 0x28, 0x14, 0xd1, 0xb7, 0xf8, + 0x84, 0x00, 0xc0, 0x06, 0x10, 0xd4, 0x97, 0xf8, 0x2c, 0x04, 0x10, 0xf0, + 0x26, 0x0f, 0x0b, 0xd0, 0x01, 0x20, 0x85, 0x21, 0x88, 0xf8, 0x00, 0x00, + 0x00, 0x20, 0x89, 0xf8, 0x00, 0x00, 0x74, 0x48, 0x80, 0xf8, 0x30, 0x10, + 0xbd, 0xe8, 0xf8, 0x8f, 0x06, 0x49, 0x07, 0xf1, 0xb8, 0x00, 0x0a, 0x68, + 0x00, 0x21, 0xbd, 0xe8, 0xf8, 0x4f, 0x10, 0x47, 0x74, 0xf2, 0x08, 0x00, + 0x5c, 0x34, 0x01, 0x00, 0x10, 0x61, 0x01, 0x00, 0xbc, 0xa0, 0x08, 0x00, + 0xb8, 0x5d, 0x01, 0x00, 0x80, 0xff, 0xff, 0x0f, 0xa8, 0xa0, 0x08, 0x00, + 0x10, 0xb5, 0x04, 0x46, 0x62, 0x48, 0x3e, 0x49, 0x00, 0x78, 0x00, 0xeb, + 0x00, 0x10, 0x01, 0xeb, 0xc0, 0x00, 0x4b, 0x49, 0x01, 0xf1, 0x0a, 0x02, + 0x08, 0x31, 0xc0, 0xe9, 0x1e, 0x12, 0x01, 0x20, 0x0f, 0xf0, 0x72, 0xfb, + 0x05, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x39, 0x48, 0x02, 0x21, + 0x02, 0x68, 0x01, 0x20, 0x90, 0x47, 0x01, 0x20, 0x10, 0xbd, 0x00, 0xbf, + 0x38, 0xd9, 0x08, 0x00, 0x70, 0xb5, 0x53, 0x49, 0x53, 0x4a, 0x3e, 0x4e, + 0x09, 0x78, 0x35, 0x89, 0xc1, 0xeb, 0x41, 0x11, 0x02, 0xeb, 0xc1, 0x01, + 0xb1, 0xf8, 0xdc, 0x10, 0xc9, 0x07, 0x0c, 0xd1, 0x0e, 0x49, 0xb1, 0xf8, + 0xb0, 0x17, 0x89, 0x07, 0x07, 0xd5, 0x4d, 0x49, 0x89, 0x7d, 0x02, 0x29, + 0x03, 0xd1, 0x0b, 0x49, 0x0a, 0x88, 0x01, 0x32, 0x0a, 0x80, 0x00, 0xf0, + 0xb5, 0xf8, 0x04, 0x46, 0x30, 0x89, 0xa8, 0x42, 0x04, 0xd9, 0x30, 0x49, + 0x40, 0x1b, 0x4a, 0x69, 0x10, 0x44, 0x48, 0x61, 0x00, 0x20, 0x0f, 0xf0, + 0x3b, 0xfb, 0x20, 0x46, 0x70, 0xbd, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, + 0x7e, 0xfa, 0x05, 0x00, 0x80, 0xb5, 0x3b, 0x48, 0x16, 0x4a, 0x00, 0x78, + 0x00, 0xeb, 0x00, 0x11, 0x02, 0xeb, 0xc1, 0x01, 0x23, 0x4a, 0x02, 0xf1, + 0x0e, 0x03, 0x0c, 0x32, 0xc1, 0xe9, 0x1e, 0x23, 0x11, 0x49, 0x89, 0x79, + 0xc9, 0x07, 0x09, 0xd0, 0x10, 0x49, 0x89, 0x8a, 0x31, 0xb1, 0x10, 0x49, + 0x01, 0xeb, 0x40, 0x10, 0x81, 0x7f, 0x41, 0xf0, 0x01, 0x01, 0x05, 0xe0, + 0x0c, 0x49, 0x01, 0xeb, 0x40, 0x10, 0x81, 0x7f, 0x01, 0xf0, 0xfe, 0x01, + 0x81, 0x77, 0x01, 0x20, 0x0f, 0xf0, 0x0e, 0xfb, 0x08, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x08, 0x48, 0x01, 0x21, 0x02, 0x68, 0x01, 0x20, 0x90, 0x47, + 0x01, 0x20, 0x80, 0xbd, 0xfc, 0x6d, 0x01, 0x00, 0xa8, 0x52, 0x01, 0x00, + 0x70, 0x5d, 0x01, 0x00, 0xe0, 0x58, 0x01, 0x00, 0x40, 0xd9, 0x08, 0x00, + 0x10, 0xd9, 0x08, 0x00, 0x70, 0xb5, 0x09, 0x4e, 0xb5, 0x89, 0x00, 0xf0, + 0x67, 0xf8, 0x04, 0x46, 0xb0, 0x89, 0xa8, 0x42, 0x04, 0xd9, 0x06, 0x49, + 0x40, 0x1b, 0xca, 0x68, 0x10, 0x44, 0xc8, 0x60, 0x00, 0x20, 0x0f, 0xf0, + 0xe7, 0xfa, 0x20, 0x46, 0x70, 0xbd, 0x00, 0xbf, 0xe4, 0x77, 0x01, 0x00, + 0x84, 0xf0, 0x05, 0x00, 0x11, 0x48, 0x12, 0x49, 0x00, 0x78, 0xc0, 0xeb, + 0x40, 0x10, 0x01, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x00, 0xc0, 0x07, + 0x17, 0xd0, 0x0e, 0x48, 0xc1, 0x8b, 0x01, 0x31, 0xc1, 0x83, 0x0e, 0x49, + 0x0c, 0x48, 0x89, 0x7d, 0x0a, 0x30, 0x02, 0x29, 0x4f, 0xf0, 0x00, 0x01, + 0x14, 0xbf, 0x01, 0x80, 0xc1, 0x81, 0xd0, 0xf8, 0x12, 0x10, 0x31, 0xb1, + 0x90, 0xf8, 0x26, 0x00, 0x82, 0x28, 0x02, 0xd1, 0x06, 0x48, 0x00, 0x68, + 0x00, 0x47, 0x70, 0x47, 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0xc4, 0x79, 0x01, 0x00, 0x38, 0x5d, 0x01, 0x00, 0x9c, 0x5d, 0x01, 0x00, + 0x28, 0xc0, 0x08, 0x00, 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, + 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x20, 0xe4, 0x08, 0x00, + 0xdc, 0x96, 0x04, 0x00, 0x24, 0xe4, 0x08, 0x00, 0xbc, 0x96, 0x04, 0x00, + 0x68, 0xe3, 0x08, 0x00, 0xfc, 0x96, 0x04, 0x00, 0xf8, 0xd8, 0x08, 0x00, + 0x09, 0x96, 0x04, 0x00, 0x4e, 0xf6, 0x19, 0x6c, 0xc1, 0xf2, 0x0d, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf2, 0x15, 0x7c, 0xc1, 0xf2, 0x0d, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xeb, 0xf1, 0x0d, 0x10, 0xbd, 0x91, 0x04, 0x00, + 0xc5, 0xf3, 0x0d, 0x10, 0xd7, 0xf3, 0x0d, 0x10, 0x61, 0x93, 0x04, 0x00, + 0x8f, 0x6a, 0x0f, 0x10, 0x91, 0x6a, 0x0f, 0x10, 0x2a, 0x00, 0x00, 0x00, + 0x71, 0xec, 0x0d, 0x10, 0xbb, 0xec, 0x0d, 0x10, 0xc1, 0x94, 0x04, 0x00, + 0x01, 0x95, 0x04, 0x00, 0x8d, 0x6a, 0x0f, 0x10, 0x8f, 0x6a, 0x0f, 0x10, + 0x91, 0x6a, 0x0f, 0x10, 0x29, 0x00, 0x00, 0x00, 0x6b, 0xf5, 0x0d, 0x10, + 0x77, 0xf5, 0x0d, 0x10, 0x61, 0x95, 0x04, 0x00, 0xd9, 0x95, 0x04, 0x00, + 0x8d, 0x6a, 0x0f, 0x10, 0x8f, 0x6a, 0x0f, 0x10, 0x91, 0x6a, 0x0f, 0x10, + 0x2c, 0x00, 0x00, 0x00, 0x02, 0x29, 0x04, 0xd0, 0x01, 0x29, 0x04, 0xd0, + 0x31, 0xb9, 0x06, 0x49, 0x02, 0xe0, 0x03, 0x49, 0x00, 0xe0, 0x03, 0x49, + 0x81, 0x61, 0x70, 0x47, 0x00, 0xf0, 0x1e, 0xbb, 0xf4, 0x9d, 0x04, 0x00, + 0xd8, 0x9d, 0x04, 0x00, 0xbc, 0x9d, 0x04, 0x00, 0x2d, 0xe9, 0xf8, 0x43, + 0x3d, 0x49, 0x05, 0x46, 0x2e, 0x6a, 0xa5, 0xf1, 0xb8, 0x04, 0x91, 0xf8, + 0x4c, 0x20, 0x91, 0xf8, 0x4d, 0x00, 0x01, 0xf1, 0x2c, 0x08, 0x22, 0xb1, + 0x01, 0x28, 0x02, 0xd1, 0x37, 0x48, 0x80, 0x8c, 0x0c, 0xe0, 0x36, 0x49, + 0x01, 0x28, 0x01, 0xf1, 0x22, 0x02, 0x88, 0xbf, 0x01, 0xf1, 0x24, 0x02, + 0x02, 0x28, 0x02, 0xd3, 0xb1, 0xf8, 0x26, 0x90, 0x04, 0xe0, 0x10, 0x88, + 0x40, 0x01, 0x0a, 0x21, 0xb0, 0xfb, 0xf1, 0xf9, 0x2e, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x18, 0xb1, 0x2d, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x03, 0xe0, 0x20, 0x6a, 0xb8, 0xb1, 0x2b, 0x49, 0x09, 0x68, 0x88, 0x47, + 0x07, 0x46, 0x01, 0x30, 0x11, 0xd0, 0xb8, 0x1b, 0x20, 0xf0, 0x70, 0x40, + 0xb0, 0xf1, 0x00, 0x6f, 0x0b, 0xd9, 0x26, 0x48, 0xb9, 0x44, 0x00, 0x68, + 0x80, 0x47, 0xa9, 0xeb, 0x00, 0x00, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, + 0x00, 0x6f, 0x98, 0xbf, 0x3e, 0x46, 0x98, 0xf8, 0x21, 0x00, 0x02, 0x28, + 0x03, 0xd3, 0x1e, 0x48, 0x00, 0x68, 0x80, 0x47, 0x06, 0x46, 0xea, 0x69, + 0xd5, 0xf8, 0x58, 0x14, 0x52, 0x7f, 0x88, 0x19, 0x20, 0xf0, 0x70, 0x40, + 0x28, 0x61, 0x0a, 0xb3, 0x50, 0x29, 0x1f, 0xd3, 0xd4, 0xf8, 0x24, 0x35, + 0xd4, 0xf8, 0xd8, 0x20, 0x5e, 0x1c, 0x18, 0xbf, 0x1a, 0x46, 0xb4, 0xf8, + 0x20, 0x35, 0x0a, 0x2b, 0x08, 0xd3, 0x12, 0x4b, 0x1b, 0x7d, 0x53, 0xb1, + 0x00, 0x20, 0xa5, 0xf8, 0x68, 0x04, 0x50, 0x18, 0x24, 0x30, 0x01, 0xe0, + 0x1b, 0xb9, 0x50, 0x18, 0x20, 0xf0, 0x70, 0x40, 0x28, 0x61, 0x4f, 0xf0, + 0xff, 0x31, 0xc4, 0xf8, 0x24, 0x15, 0x00, 0x21, 0xa4, 0xf8, 0x20, 0x15, + 0xc8, 0xf8, 0x00, 0x00, 0xbd, 0xe8, 0xf8, 0x83, 0x18, 0x74, 0x01, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x4c, 0x9d, 0x08, 0x00, 0x58, 0x9d, 0x08, 0x00, + 0x0c, 0x9d, 0x08, 0x00, 0xe0, 0xa0, 0x08, 0x00, 0x7c, 0x5c, 0x01, 0x00, + 0x30, 0xf8, 0x36, 0x1c, 0x89, 0x07, 0x03, 0xd5, 0x90, 0xf8, 0x7d, 0x13, + 0x49, 0x07, 0x01, 0xd5, 0x0f, 0x21, 0x81, 0x72, 0x00, 0xf0, 0x86, 0xba, + 0x10, 0xb5, 0x04, 0x46, 0xd7, 0xf7, 0xcc, 0xfb, 0x61, 0x7a, 0xc9, 0x06, + 0x44, 0xbf, 0x20, 0x61, 0x10, 0xbd, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, + 0x00, 0xf0, 0x7e, 0xba, 0x81, 0x7a, 0x0e, 0x29, 0x9c, 0xbf, 0x01, 0x31, + 0x81, 0x72, 0x70, 0x47, 0x2d, 0xe9, 0xf0, 0x47, 0x9a, 0x46, 0x17, 0x46, + 0x0e, 0x46, 0x05, 0x46, 0xd7, 0xf7, 0xb4, 0xfb, 0x95, 0xf8, 0x35, 0x11, + 0xad, 0x4a, 0x05, 0xf1, 0xb8, 0x08, 0x01, 0xeb, 0x41, 0x01, 0x02, 0xeb, + 0x41, 0x13, 0xd5, 0xf8, 0xd0, 0x10, 0x03, 0xf1, 0x10, 0x04, 0x0a, 0x78, + 0x02, 0x2a, 0x0a, 0xd1, 0x00, 0x20, 0x05, 0xf2, 0x35, 0x19, 0x20, 0x60, + 0x95, 0xf8, 0x90, 0x00, 0x00, 0xf0, 0xfb, 0x00, 0x85, 0xf8, 0x90, 0x00, + 0x13, 0xe0, 0x24, 0x68, 0x6c, 0xb1, 0x04, 0x1b, 0x24, 0xf0, 0x70, 0x44, + 0xb4, 0xf5, 0xc8, 0x5f, 0x07, 0xd9, 0x00, 0x24, 0x1c, 0x61, 0x95, 0xf8, + 0x90, 0x30, 0x03, 0xf0, 0xfb, 0x03, 0x85, 0xf8, 0x90, 0x30, 0x05, 0xf2, + 0x35, 0x19, 0x00, 0x2a, 0x7a, 0xd0, 0x56, 0xb1, 0x95, 0xf8, 0xc1, 0x00, + 0x40, 0xf0, 0x01, 0x00, 0x85, 0xf8, 0xc1, 0x00, 0x1f, 0xb1, 0x00, 0x20, + 0x85, 0xf8, 0xc2, 0x00, 0x02, 0xe0, 0x40, 0x46, 0xff, 0xf7, 0xb4, 0xff, + 0x90, 0x48, 0x31, 0x46, 0x3a, 0x46, 0x53, 0x46, 0x04, 0x68, 0x28, 0x46, + 0xa0, 0x47, 0xb5, 0xf8, 0xc4, 0x00, 0xb5, 0xf8, 0xc6, 0x10, 0x81, 0x42, + 0x01, 0xd2, 0xbd, 0xe8, 0xf0, 0x87, 0x95, 0xf8, 0xc1, 0x00, 0xc1, 0x07, + 0x1a, 0xd1, 0xd5, 0xf8, 0xd0, 0x00, 0x00, 0x78, 0x02, 0x28, 0x7b, 0xd1, + 0xac, 0x48, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, 0x01, 0x28, 0x68, 0xd1, + 0xc5, 0x48, 0x90, 0xf8, 0x4c, 0x10, 0x90, 0xf8, 0x4d, 0x20, 0xd5, 0xf8, + 0xd8, 0x00, 0x00, 0x29, 0x00, 0xf0, 0xaa, 0x80, 0x01, 0x2a, 0x40, 0xf0, + 0xa7, 0x80, 0x7d, 0x49, 0x24, 0x31, 0xaa, 0xe0, 0xba, 0xf1, 0x00, 0x0f, + 0x05, 0xd0, 0x00, 0x2e, 0x00, 0xf0, 0xe4, 0x80, 0x00, 0x2f, 0x00, 0xf0, + 0xe1, 0x80, 0x00, 0x21, 0x85, 0xf8, 0xc2, 0x10, 0xd5, 0xf8, 0xd0, 0x10, + 0x09, 0x78, 0x02, 0x29, 0x3f, 0xd1, 0xb5, 0x49, 0x91, 0xf8, 0x4d, 0x20, + 0x01, 0x2a, 0x00, 0xf2, 0xa8, 0x80, 0xb5, 0xf8, 0x82, 0x00, 0x80, 0x07, + 0x40, 0xf1, 0xba, 0x80, 0x95, 0xf8, 0x35, 0x04, 0x40, 0x07, 0x00, 0xf1, + 0xb5, 0x80, 0x08, 0x6d, 0x42, 0x1c, 0xba, 0xd0, 0x6a, 0x4a, 0x92, 0xf8, + 0x99, 0x20, 0x03, 0x2a, 0x03, 0xd1, 0x69, 0x4a, 0x92, 0x7c, 0x52, 0x2a, + 0xb1, 0xd0, 0x68, 0x4a, 0x92, 0x69, 0x12, 0x69, 0x80, 0x1a, 0x00, 0xf5, + 0xa0, 0x70, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, 0x00, 0x6f, 0xa6, 0xd9, + 0x91, 0xf8, 0x4c, 0x00, 0x00, 0x28, 0x40, 0xf0, 0x94, 0x80, 0xa0, 0xe7, + 0x9e, 0x4a, 0x92, 0xf8, 0x4d, 0x20, 0x00, 0x2a, 0x3f, 0xf4, 0x7f, 0xaf, + 0xd5, 0xf8, 0xc8, 0x20, 0x10, 0x1a, 0x20, 0xf0, 0x70, 0x40, 0xb0, 0xf1, + 0x00, 0x6f, 0x7f, 0xf6, 0x76, 0xaf, 0x49, 0x69, 0x40, 0x46, 0x88, 0x47, + 0x71, 0xe7, 0x52, 0x48, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, 0x00, 0x28, + 0x7f, 0xf4, 0x87, 0xaf, 0x77, 0xe0, 0x50, 0x48, 0x90, 0xf8, 0x28, 0x10, + 0x01, 0x29, 0x07, 0xd0, 0x90, 0xf8, 0x58, 0x00, 0x01, 0x28, 0x03, 0xd0, + 0x28, 0x6a, 0x00, 0x28, 0x7f, 0xf4, 0x8a, 0xaf, 0x95, 0xf8, 0xa4, 0x04, + 0x41, 0x07, 0x1c, 0xd5, 0x00, 0x07, 0x1a, 0xd4, 0x99, 0xf8, 0x00, 0x00, + 0x49, 0x49, 0x00, 0xeb, 0xc0, 0x00, 0x01, 0xeb, 0x40, 0x00, 0x40, 0x78, + 0x01, 0x28, 0x5a, 0xd0, 0x43, 0x49, 0xd5, 0xf8, 0xdc, 0x00, 0x89, 0x69, + 0x09, 0x69, 0x08, 0x1a, 0xd5, 0xf8, 0xa0, 0x14, 0x20, 0xf0, 0x70, 0x40, + 0xb0, 0xeb, 0x51, 0x0f, 0x03, 0xd9, 0x01, 0xeb, 0x81, 0x01, 0x88, 0x42, + 0x49, 0xd3, 0x38, 0x48, 0x90, 0xf8, 0x89, 0x00, 0x80, 0x07, 0x5d, 0xd5, + 0xd5, 0xf8, 0x88, 0x14, 0x95, 0xf8, 0x28, 0x01, 0x0a, 0x02, 0x58, 0xbf, + 0x5f, 0xea, 0x81, 0x52, 0x50, 0xd5, 0x05, 0x21, 0x01, 0xea, 0x50, 0x01, + 0x00, 0xf0, 0x05, 0x00, 0x08, 0x44, 0x00, 0xf0, 0x03, 0x01, 0x01, 0xeb, + 0x90, 0x00, 0x02, 0x28, 0x48, 0xd3, 0x52, 0x48, 0x02, 0x68, 0x17, 0xe0, + 0x29, 0x4b, 0x01, 0x2a, 0x03, 0xf1, 0x22, 0x01, 0x88, 0xbf, 0x03, 0xf1, + 0x24, 0x01, 0x09, 0x88, 0x0a, 0x22, 0x49, 0x01, 0xb1, 0xfb, 0xf2, 0xf1, + 0x26, 0x4a, 0x92, 0x69, 0x12, 0x69, 0x80, 0x1a, 0x08, 0x44, 0x48, 0x49, + 0x20, 0xf0, 0x70, 0x40, 0x0a, 0x68, 0xb0, 0xf1, 0x00, 0x6f, 0x16, 0xd9, + 0x40, 0x46, 0x02, 0x21, 0x2e, 0xe0, 0x86, 0xb1, 0x01, 0x07, 0x0e, 0xd4, + 0x1a, 0x49, 0x91, 0xf8, 0x4b, 0x10, 0x51, 0xb1, 0x00, 0x22, 0x40, 0xf0, + 0x08, 0x00, 0xa5, 0xf8, 0xc4, 0x10, 0xa5, 0xf8, 0xc6, 0x20, 0x85, 0xf8, + 0xc1, 0x00, 0xbd, 0xe8, 0xf0, 0x87, 0x3a, 0x48, 0x02, 0x68, 0x40, 0x46, + 0x03, 0x21, 0x17, 0xe0, 0x37, 0x48, 0x03, 0x21, 0x02, 0x68, 0x40, 0x46, + 0x90, 0x47, 0x12, 0x49, 0x99, 0xf8, 0x00, 0x00, 0x01, 0x22, 0x47, 0x23, + 0xd1, 0xf8, 0x00, 0xc0, 0x00, 0x21, 0xbd, 0xe8, 0xf0, 0x47, 0x60, 0x47, + 0x09, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, 0xaa, 0xdd, 0x2d, 0x48, 0x01, 0x21, + 0x02, 0x68, 0x40, 0x46, 0xbd, 0xe8, 0xf0, 0x47, 0x10, 0x47, 0x00, 0xbf, + 0x54, 0xf1, 0x05, 0x00, 0xec, 0xe1, 0x08, 0x00, 0xf0, 0xe1, 0x08, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x4c, 0x49, 0x01, 0x00, 0xac, 0x76, 0x01, 0x00, + 0xfc, 0x73, 0x01, 0x00, 0x04, 0xa1, 0x08, 0x00, 0x44, 0x28, 0x01, 0x00, + 0x70, 0xb5, 0x06, 0x46, 0x90, 0xf8, 0xc0, 0x00, 0x88, 0xb3, 0x30, 0x6a, + 0x14, 0x46, 0x0d, 0x46, 0x08, 0xb9, 0xb0, 0x68, 0x60, 0xb3, 0x00, 0x20, + 0x15, 0xb3, 0x01, 0x2c, 0x20, 0xd8, 0xf8, 0xb1, 0x96, 0xf8, 0x90, 0x00, + 0x40, 0x07, 0x1b, 0xd4, 0xd6, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0xb8, 0xb9, + 0x96, 0xf8, 0x2d, 0x11, 0x96, 0xf8, 0x2e, 0x21, 0x96, 0xf8, 0x29, 0x01, + 0x11, 0x43, 0x88, 0x43, 0x00, 0xf0, 0x06, 0x00, 0x06, 0x28, 0x0b, 0xd1, + 0x96, 0xf8, 0xc0, 0x00, 0x02, 0x28, 0x07, 0xd1, 0x0c, 0x49, 0x06, 0xf1, + 0xb8, 0x00, 0x0a, 0x68, 0x01, 0x21, 0xbd, 0xe8, 0x70, 0x40, 0x10, 0x47, + 0x30, 0x46, 0x29, 0x46, 0x22, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, + 0xcf, 0xb8, 0x70, 0xbd, 0x03, 0x48, 0x01, 0x68, 0x30, 0x46, 0x88, 0x47, + 0xb0, 0xfa, 0x80, 0xf0, 0x40, 0x09, 0xcb, 0xe7, 0x4c, 0x9d, 0x08, 0x00, + 0xbc, 0xa0, 0x08, 0x00, 0xb0, 0xb5, 0xd0, 0xf8, 0xd4, 0x40, 0xb4, 0xf8, + 0x6c, 0x40, 0x05, 0x2c, 0x0c, 0xd3, 0x59, 0xb9, 0xd0, 0xf8, 0xd0, 0x50, + 0x2d, 0x78, 0x01, 0x2d, 0x06, 0xd8, 0xb0, 0xf8, 0xc6, 0x50, 0x05, 0xeb, + 0x94, 0x04, 0x01, 0x3c, 0xa0, 0xf8, 0xc6, 0x40, 0xbd, 0xe8, 0xb0, 0x40, + 0x00, 0xf0, 0xb0, 0xb8, 0xe0, 0xb5, 0x00, 0xf0, 0xb3, 0xf8, 0x0c, 0x48, + 0x00, 0x6b, 0xa0, 0xb1, 0x00, 0x21, 0x08, 0x22, 0xcd, 0xe9, 0x00, 0x11, + 0x81, 0x69, 0x09, 0x78, 0x02, 0x29, 0x9c, 0xbf, 0x90, 0xf8, 0x7d, 0x10, + 0xad, 0xf8, 0x00, 0x10, 0x81, 0x89, 0x00, 0x69, 0xad, 0xf8, 0x02, 0x10, + 0x01, 0x90, 0x69, 0x46, 0x29, 0x20, 0xdd, 0xf7, 0xa3, 0xfa, 0x8c, 0xbd, + 0x18, 0x74, 0x01, 0x00, 0x10, 0xb5, 0x04, 0x46, 0xe1, 0xb3, 0x01, 0x2a, + 0x3a, 0xd8, 0xcb, 0xb3, 0xd4, 0xf8, 0xd0, 0x00, 0x00, 0x78, 0x02, 0x28, + 0x08, 0xd1, 0xd4, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0xe0, 0xb1, 0xd4, 0xf8, + 0x10, 0x05, 0x4f, 0x28, 0x18, 0xd9, 0x2b, 0xe0, 0x94, 0xf8, 0xc1, 0x00, + 0xc1, 0x06, 0x18, 0xd4, 0x94, 0xf8, 0x90, 0x00, 0x40, 0x07, 0x03, 0xd5, + 0xd4, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0xf8, 0xb9, 0x94, 0xf8, 0x2d, 0x11, + 0x94, 0xf8, 0x2e, 0x21, 0x94, 0xf8, 0x29, 0x01, 0x11, 0x43, 0x88, 0x43, + 0x00, 0xf0, 0x0e, 0x00, 0x0e, 0x28, 0x13, 0xd1, 0xb4, 0xf8, 0xc4, 0x00, + 0xa4, 0xf8, 0xc6, 0x00, 0x0e, 0xe0, 0x0c, 0x49, 0x8a, 0x68, 0xa2, 0x42, + 0x06, 0xd1, 0xd4, 0xf8, 0xd4, 0x20, 0x09, 0x69, 0x12, 0x69, 0x51, 0x1a, + 0x09, 0x01, 0x03, 0xd4, 0x00, 0xf0, 0xef, 0x00, 0x84, 0xf8, 0xc1, 0x00, + 0x05, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x18, 0xb1, 0xb4, 0xf8, + 0xc4, 0x00, 0xa4, 0xf8, 0xc6, 0x00, 0x10, 0xbd, 0xd8, 0x5d, 0x01, 0x00, + 0xf4, 0xe1, 0x08, 0x00, 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, + 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, + 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, + 0x0c, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x2c, 0xd3, 0x08, 0x00, + 0x9d, 0x98, 0x04, 0x00, 0xbc, 0xd2, 0x08, 0x00, 0x1d, 0x97, 0x04, 0x00, + 0xac, 0xbb, 0x08, 0x00, 0x8d, 0x9b, 0x04, 0x00, 0x30, 0xd3, 0x08, 0x00, + 0x15, 0x9c, 0x04, 0x00, 0x64, 0xeb, 0x08, 0x00, 0x45, 0x9c, 0x04, 0x00, + 0xec, 0xe1, 0x08, 0x00, 0x81, 0x9c, 0x04, 0x00, 0x40, 0xf6, 0x35, 0x7c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf2, 0xe7, 0x3c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf2, 0x29, 0x5c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf2, 0x8f, 0x7c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0xe9, 0x0c, + 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0xf9, 0x5c, + 0xc1, 0xf2, 0x10, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x00, 0x00, 0x00, 0x00, + 0xcb, 0x10, 0x0d, 0x10, 0x9d, 0x11, 0x0d, 0x10, 0xbf, 0x11, 0x0d, 0x10, + 0xd5, 0x16, 0x0d, 0x10, 0x75, 0x98, 0x04, 0x00, 0x05, 0x16, 0x0d, 0x10, + 0x01, 0x00, 0x00, 0x00, 0xcb, 0x10, 0x0d, 0x10, 0x9d, 0x11, 0x0d, 0x10, + 0xbf, 0x11, 0x0d, 0x10, 0x03, 0x15, 0x0d, 0x10, 0x75, 0x98, 0x04, 0x00, + 0x05, 0x16, 0x0d, 0x10, 0x02, 0x00, 0x00, 0x00, 0xcb, 0x10, 0x0d, 0x10, + 0x55, 0x12, 0x0d, 0x10, 0x69, 0x12, 0x0d, 0x10, 0x83, 0x12, 0x0d, 0x10, + 0x45, 0x97, 0x04, 0x00, 0x5d, 0x98, 0x04, 0x00, 0x70, 0xb5, 0x05, 0x46, + 0x00, 0xf0, 0x30, 0xf9, 0x04, 0x46, 0x01, 0x28, 0x20, 0xd1, 0x28, 0x68, + 0xc1, 0x78, 0x01, 0x29, 0x1c, 0xd1, 0x4e, 0x49, 0x09, 0x68, 0xc9, 0xb1, + 0x91, 0xf8, 0x88, 0x14, 0x09, 0x07, 0x15, 0xd5, 0x0b, 0x4a, 0x86, 0x6e, + 0x69, 0x68, 0xd0, 0xf8, 0xdc, 0x00, 0x12, 0x68, 0x90, 0x47, 0x30, 0x1a, + 0x00, 0x01, 0x0b, 0xd5, 0x28, 0x68, 0xb0, 0xf8, 0x82, 0x10, 0x21, 0xf4, + 0x80, 0x61, 0xa0, 0xf8, 0x82, 0x10, 0x43, 0x48, 0x22, 0x21, 0x02, 0x68, + 0x40, 0x48, 0x90, 0x47, 0x20, 0x46, 0x70, 0xbd, 0xe4, 0xe5, 0x08, 0x00, + 0xf8, 0xb5, 0x28, 0xb3, 0x06, 0x68, 0x05, 0x46, 0x2e, 0xb3, 0xb6, 0xf8, + 0x74, 0x71, 0x28, 0x46, 0x00, 0xf0, 0x04, 0xf9, 0x04, 0x46, 0x28, 0x68, + 0x90, 0xf8, 0x89, 0x10, 0xc9, 0x06, 0x08, 0xd5, 0xb0, 0xf8, 0x54, 0x14, + 0x82, 0x6e, 0x02, 0xeb, 0x41, 0x01, 0x21, 0xf0, 0x70, 0x41, 0xc0, 0xf8, + 0x88, 0x13, 0xb6, 0xf8, 0x74, 0x01, 0x87, 0x42, 0x12, 0xd0, 0x96, 0xf8, + 0x35, 0x01, 0x30, 0x49, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, + 0xc1, 0x69, 0x01, 0x31, 0xc1, 0x61, 0x07, 0xe0, 0x00, 0x20, 0xd9, 0x21, + 0x01, 0xe0, 0x00, 0x20, 0xdb, 0x21, 0x00, 0x24, 0xdc, 0xf7, 0xfc, 0xfe, + 0x20, 0x46, 0xf8, 0xbd, 0x70, 0xb5, 0x52, 0x4d, 0x22, 0x4e, 0x28, 0x78, + 0xc0, 0xeb, 0x40, 0x10, 0x56, 0xf8, 0x30, 0x40, 0xfe, 0xf7, 0xf8, 0xf8, + 0x28, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x06, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, + 0xdc, 0x00, 0x40, 0x07, 0x25, 0xd5, 0xe0, 0x78, 0x98, 0xb1, 0x01, 0x28, + 0x18, 0xd1, 0x28, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x06, 0xeb, 0xc0, 0x00, + 0x90, 0xf8, 0x91, 0x00, 0x80, 0xb9, 0x94, 0xf8, 0x35, 0x01, 0x16, 0x49, + 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, 0x81, 0x7b, 0x01, 0x31, + 0x0e, 0xe0, 0x10, 0x48, 0x00, 0x68, 0x18, 0xb1, 0x90, 0xf8, 0x88, 0x04, + 0x00, 0x07, 0x09, 0xd4, 0x94, 0xf8, 0x35, 0x01, 0x0d, 0x49, 0x00, 0xeb, + 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, 0x00, 0x21, 0x81, 0x73, 0x70, 0xbd, + 0xb4, 0xf8, 0x82, 0x00, 0x22, 0x21, 0x20, 0xf4, 0x80, 0x60, 0xa4, 0xf8, + 0x82, 0x00, 0x05, 0x48, 0x02, 0x68, 0x03, 0x48, 0x90, 0x47, 0xe0, 0x78, + 0xcd, 0xe7, 0x00, 0xbf, 0x0c, 0x6f, 0x01, 0x00, 0xfc, 0x70, 0x01, 0x00, + 0xf4, 0xa0, 0x08, 0x00, 0x54, 0xf1, 0x05, 0x00, 0x00, 0x68, 0x00, 0x28, + 0x4c, 0xd0, 0x90, 0xf8, 0x24, 0x11, 0x03, 0x29, 0x03, 0xd0, 0x90, 0xf8, + 0x24, 0x11, 0x85, 0x29, 0x01, 0xd1, 0x02, 0x21, 0x00, 0xe0, 0x01, 0x21, + 0x21, 0x4a, 0x12, 0x68, 0x12, 0x05, 0x0c, 0xd4, 0x20, 0x4a, 0x12, 0x68, + 0x12, 0x01, 0x08, 0xd4, 0x90, 0xf8, 0x29, 0x21, 0xd3, 0x07, 0x1c, 0xd1, + 0x42, 0xf0, 0x01, 0x02, 0x80, 0xf8, 0x29, 0x21, 0x1d, 0xe0, 0x90, 0xf8, + 0x28, 0x21, 0x05, 0x23, 0x0a, 0x43, 0x80, 0xf8, 0x28, 0x21, 0xd0, 0xf8, + 0xcc, 0x21, 0x63, 0xf3, 0x03, 0x02, 0x17, 0x4b, 0xc0, 0xf8, 0xcc, 0x21, + 0x14, 0x4a, 0x12, 0x78, 0x02, 0xeb, 0x82, 0x02, 0x03, 0xeb, 0xc2, 0x02, + 0xd3, 0x69, 0x43, 0xf4, 0x80, 0x13, 0xd3, 0x61, 0x10, 0xe0, 0x90, 0xf8, + 0x2a, 0x21, 0x42, 0xf0, 0x01, 0x02, 0x80, 0xf8, 0x2a, 0x21, 0xd0, 0xf8, + 0xd8, 0x20, 0xd0, 0xf8, 0xcc, 0x31, 0xc0, 0xf8, 0x8c, 0x23, 0x03, 0x22, + 0x62, 0xf3, 0x03, 0x03, 0xc0, 0xf8, 0xcc, 0x31, 0x02, 0x29, 0x05, 0xd1, + 0xd0, 0xf8, 0xb4, 0x03, 0x10, 0xb1, 0x06, 0x49, 0x09, 0x68, 0x08, 0x47, + 0x70, 0x47, 0x00, 0xbf, 0xcc, 0x20, 0x21, 0x40, 0xec, 0x10, 0x21, 0x40, + 0x74, 0x87, 0x08, 0x00, 0x84, 0x71, 0x01, 0x00, 0x58, 0xd2, 0x08, 0x00, + 0xb0, 0xb5, 0x80, 0xb1, 0x04, 0x46, 0x00, 0x68, 0x68, 0xb1, 0xb0, 0xf8, + 0x40, 0x51, 0x20, 0x46, 0x00, 0xf0, 0x2c, 0xf8, 0x20, 0x68, 0xb0, 0xf8, + 0x40, 0x01, 0x85, 0x42, 0x03, 0xd0, 0x02, 0x48, 0xc1, 0x68, 0x01, 0x31, + 0xc1, 0x60, 0xb0, 0xbd, 0xb0, 0xf0, 0x05, 0x00, 0x04, 0x48, 0x05, 0x49, + 0x01, 0x60, 0x05, 0x48, 0x05, 0x49, 0x40, 0xf8, 0x18, 0x1f, 0x05, 0x49, + 0x41, 0x60, 0x70, 0x47, 0x7c, 0xe4, 0x08, 0x00, 0x80, 0xd3, 0x05, 0x00, + 0x9c, 0x0f, 0x01, 0x00, 0x6d, 0x9f, 0x04, 0x00, 0x25, 0xa0, 0x04, 0x00, + 0x47, 0xf6, 0x0f, 0x5c, 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x40, 0xf6, 0x29, 0x7c, 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x41, 0xf2, 0x97, 0x1c, 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xb0, 0xb5, 0x04, 0x46, 0x00, 0x68, 0x00, 0x28, 0x6d, 0xd0, 0xa0, 0x68, + 0x00, 0x28, 0x6a, 0xd0, 0x52, 0x49, 0x00, 0x22, 0x52, 0x4d, 0x0a, 0x60, + 0xd5, 0xf8, 0xe0, 0x1f, 0x09, 0x05, 0x5c, 0xbf, 0x29, 0x68, 0x5f, 0xea, + 0x01, 0x11, 0x5f, 0xd5, 0x90, 0xf8, 0xbc, 0x10, 0x4d, 0x4a, 0x41, 0xf0, + 0x01, 0x01, 0x80, 0xf8, 0xbc, 0x10, 0x58, 0x49, 0x09, 0x78, 0xc1, 0xeb, + 0x41, 0x11, 0x02, 0xeb, 0xc1, 0x01, 0x89, 0x68, 0x89, 0x68, 0x09, 0x7d, + 0x21, 0x29, 0x09, 0xd1, 0x46, 0x49, 0x91, 0xf8, 0x4e, 0x11, 0x80, 0xf8, + 0xc8, 0x10, 0xc0, 0x68, 0x10, 0xb1, 0x44, 0x49, 0x09, 0x68, 0x88, 0x47, + 0x21, 0x68, 0xa0, 0x68, 0xd1, 0xf8, 0xcc, 0x21, 0x22, 0xf0, 0x0f, 0x02, + 0xc1, 0xf8, 0xcc, 0x21, 0x21, 0x68, 0xd1, 0xf8, 0xcc, 0x21, 0x42, 0xf0, + 0x05, 0x02, 0xc1, 0xf8, 0xcc, 0x21, 0x3c, 0x4a, 0x21, 0x68, 0x91, 0xf8, + 0x35, 0x11, 0x01, 0xeb, 0xc1, 0x01, 0x02, 0xeb, 0x41, 0x01, 0x49, 0x78, + 0x01, 0x29, 0x1d, 0xbf, 0xb0, 0xf8, 0x68, 0x10, 0x01, 0x31, 0xa0, 0xf8, + 0x68, 0x10, 0xb0, 0xf8, 0x66, 0x10, 0x04, 0xbf, 0x01, 0x31, 0xa0, 0xf8, + 0x66, 0x10, 0x94, 0xf8, 0x45, 0x00, 0x80, 0x07, 0x19, 0xd5, 0x20, 0x68, + 0xd0, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0x38, 0xb9, 0xd5, 0xf8, 0xe0, 0x0f, + 0x00, 0x05, 0x5c, 0xbf, 0x28, 0x68, 0x5f, 0xea, 0x00, 0x10, 0x0c, 0xd5, + 0x2a, 0x48, 0x01, 0x68, 0xa0, 0x68, 0xbc, 0x30, 0x88, 0x47, 0xa0, 0x68, + 0x80, 0x68, 0x20, 0xb1, 0x23, 0x49, 0x09, 0x68, 0xbd, 0xe8, 0xb0, 0x40, + 0x08, 0x47, 0xb0, 0xbd, 0x90, 0xf8, 0xbd, 0x10, 0xca, 0x07, 0x04, 0xd1, + 0x41, 0xf0, 0x01, 0x01, 0x80, 0xf8, 0xbd, 0x10, 0x05, 0xe0, 0x90, 0xf8, + 0xbe, 0x10, 0x41, 0xf0, 0x01, 0x01, 0x80, 0xf8, 0xbe, 0x10, 0x21, 0x68, + 0x61, 0xb1, 0xd1, 0xf8, 0xcc, 0x21, 0x22, 0xf0, 0x0f, 0x02, 0xc1, 0xf8, + 0xcc, 0x21, 0x21, 0x68, 0xd1, 0xf8, 0xcc, 0x21, 0x42, 0xf0, 0x03, 0x02, + 0xc1, 0xf8, 0xcc, 0x21, 0x90, 0xf8, 0xb9, 0x00, 0x16, 0x28, 0xbe, 0xd8, + 0x11, 0x49, 0x00, 0xeb, 0x40, 0x02, 0x51, 0xf8, 0x22, 0x20, 0x00, 0x2a, + 0xb7, 0xd0, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x80, 0x00, 0x00, 0x79, + 0x02, 0x28, 0xb0, 0xd1, 0xe0, 0x69, 0x00, 0x78, 0x01, 0x28, 0xac, 0xd8, + 0xd6, 0xf7, 0x12, 0xff, 0x21, 0x68, 0xc1, 0xf8, 0xe4, 0x00, 0xa6, 0xe7, + 0xc0, 0x00, 0x21, 0x40, 0xec, 0x10, 0x21, 0x40, 0x0c, 0x6f, 0x01, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x58, 0xd2, 0x08, 0x00, 0x44, 0x28, 0x01, 0x00, + 0xe8, 0x72, 0x01, 0x00, 0x50, 0xd2, 0x08, 0x00, 0x06, 0x48, 0x07, 0x49, + 0x07, 0x4a, 0x00, 0x78, 0x09, 0x68, 0x02, 0xf8, 0x10, 0x10, 0x06, 0x49, + 0x02, 0xeb, 0x40, 0x00, 0x09, 0x68, 0x41, 0x70, 0x00, 0xf0, 0x26, 0xb8, + 0x74, 0x87, 0x08, 0x00, 0x34, 0xa1, 0x23, 0x40, 0x48, 0xf1, 0x05, 0x00, + 0x30, 0xa1, 0x23, 0x40, 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, + 0x07, 0x49, 0x01, 0x62, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x44, 0xd2, 0x08, 0x00, + 0x8c, 0xa2, 0x04, 0x00, 0x9c, 0x0f, 0x01, 0x00, 0x9d, 0xa0, 0x04, 0x00, + 0x40, 0xd2, 0x08, 0x00, 0xac, 0xa2, 0x04, 0x00, 0x48, 0xd2, 0x08, 0x00, + 0xcc, 0xa2, 0x04, 0x00, 0x44, 0xf6, 0xcd, 0x3c, 0xc1, 0xf2, 0x0e, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x09, 0x74, 0x0d, 0x10, 0x1d, 0x3c, 0x0e, 0x10, + 0x0f, 0x7d, 0x0d, 0x10, 0x91, 0x77, 0x04, 0x00, 0xc7, 0x84, 0x0d, 0x10, + 0xf3, 0x84, 0x0d, 0x10, 0x91, 0x6a, 0x0f, 0x10, 0x33, 0x00, 0x00, 0x00, + 0x09, 0x74, 0x0d, 0x10, 0x5d, 0x44, 0x0e, 0x10, 0x07, 0x49, 0x0e, 0x10, + 0x91, 0x77, 0x04, 0x00, 0xc7, 0x84, 0x0d, 0x10, 0xf3, 0x84, 0x0d, 0x10, + 0x91, 0x6a, 0x0f, 0x10, 0x35, 0x00, 0x00, 0x00, 0x2f, 0x4a, 0x0e, 0x10, + 0x9b, 0x74, 0x0d, 0x10, 0x07, 0x49, 0x0e, 0x10, 0x91, 0x77, 0x04, 0x00, + 0xc7, 0x84, 0x0d, 0x10, 0x5f, 0x8c, 0x0d, 0x10, 0x11, 0x4a, 0x0e, 0x10, + 0x37, 0x00, 0x00, 0x00, 0x70, 0x47, 0x00, 0x00, 0x2d, 0xe9, 0xf0, 0x47, + 0x48, 0xb1, 0xd0, 0xf8, 0xdc, 0x11, 0xca, 0x07, 0x05, 0xd0, 0x8a, 0x06, + 0x03, 0xd5, 0x49, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, 0x01, 0xdd, 0xbd, 0xe8, + 0xf0, 0x87, 0x2e, 0x49, 0x00, 0xf5, 0xee, 0x70, 0x09, 0x68, 0x88, 0x47, + 0xdf, 0xf8, 0xb0, 0x90, 0x00, 0xf1, 0x04, 0x0a, 0xdf, 0xf8, 0xac, 0x80, + 0x99, 0xf8, 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x10, 0x08, 0xeb, 0xc0, 0x00, + 0xb0, 0xf8, 0xde, 0x50, 0x90, 0xf8, 0xa1, 0x00, 0x03, 0x28, 0x10, 0xd1, + 0x48, 0x48, 0x01, 0x68, 0x08, 0x46, 0x6f, 0xf3, 0x9f, 0x50, 0x00, 0x28, + 0xdf, 0xd0, 0xb5, 0xeb, 0x91, 0x5f, 0xdc, 0xd2, 0x89, 0x0d, 0x52, 0x46, + 0x2b, 0x46, 0xbd, 0xe8, 0xf0, 0x47, 0xd6, 0xf7, 0x61, 0xbe, 0x00, 0x2d, + 0xd3, 0xd0, 0x1c, 0x48, 0x00, 0x24, 0x00, 0xf1, 0x58, 0x07, 0x10, 0x2c, + 0xcd, 0xd0, 0x99, 0xf8, 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x11, 0x08, 0xeb, + 0xc1, 0x01, 0xb1, 0xf8, 0xdc, 0x10, 0x89, 0x06, 0x0b, 0xd4, 0x00, 0xeb, + 0x80, 0x01, 0x49, 0x01, 0x79, 0x58, 0x89, 0x02, 0x05, 0xd1, 0x00, 0x20, + 0x5b, 0x21, 0xd6, 0xf7, 0x33, 0xfe, 0x99, 0xf8, 0x00, 0x00, 0x00, 0xeb, + 0x80, 0x00, 0xae, 0xb2, 0x52, 0x46, 0x40, 0x01, 0x38, 0x58, 0xb6, 0xeb, + 0x90, 0x5f, 0x28, 0xbf, 0x86, 0x0d, 0x6f, 0xf3, 0x9f, 0x50, 0x31, 0x46, + 0x33, 0x46, 0xd6, 0xf7, 0x33, 0xfe, 0xad, 0x1b, 0xb2, 0x44, 0x04, 0x37, + 0x01, 0x34, 0x28, 0x04, 0xd1, 0xd1, 0xa0, 0xe7, 0xb4, 0xb5, 0x08, 0x00, + 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0xbc, 0x65, 0x01, 0x00, + 0x70, 0xb5, 0x1f, 0x4e, 0x04, 0x46, 0x1f, 0x4d, 0x30, 0x78, 0xc0, 0xeb, + 0x40, 0x10, 0x05, 0xeb, 0xc0, 0x01, 0xd1, 0xf8, 0xc0, 0x20, 0x52, 0x79, + 0x03, 0x2a, 0x2b, 0xd1, 0x91, 0xf8, 0x91, 0x10, 0x41, 0xb3, 0x55, 0xf8, + 0x30, 0x00, 0xff, 0xf7, 0x77, 0xff, 0x30, 0x78, 0xc0, 0xeb, 0x40, 0x10, + 0x05, 0xeb, 0xc0, 0x01, 0x91, 0xf8, 0x91, 0x20, 0xe2, 0xb1, 0x91, 0xf8, + 0xa1, 0x20, 0x03, 0x2a, 0x18, 0xd1, 0xb1, 0xf8, 0xde, 0x20, 0xaa, 0xb1, + 0x91, 0xf8, 0x9f, 0x10, 0x91, 0xb1, 0x0e, 0x4e, 0x31, 0x68, 0x6f, 0xf3, + 0x9f, 0x51, 0x61, 0xb1, 0x0b, 0x78, 0x03, 0xf0, 0xfe, 0x03, 0x78, 0x2b, + 0x08, 0xd1, 0x55, 0xf8, 0x30, 0x00, 0xd2, 0xb2, 0xdd, 0xf7, 0x10, 0xf8, + 0x10, 0xb1, 0x00, 0x20, 0x30, 0x60, 0x70, 0xbd, 0x20, 0x46, 0xbd, 0xe8, + 0x70, 0x40, 0x00, 0xf0, 0x21, 0xb8, 0x00, 0xbf, 0x74, 0x87, 0x08, 0x00, + 0x0c, 0x6f, 0x01, 0x00, 0x8c, 0x59, 0x01, 0x00, 0x70, 0x47, 0x00, 0xbf, + 0x05, 0x48, 0x06, 0x49, 0xc0, 0xf8, 0xc4, 0x10, 0x05, 0x48, 0x06, 0x49, + 0x01, 0x60, 0x06, 0x48, 0x06, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x98, 0xdf, 0x08, 0x00, 0x2f, 0xcd, 0x0d, 0x10, 0x48, 0xe4, 0x08, 0x00, + 0xd9, 0xa3, 0x04, 0x00, 0xfc, 0xb7, 0x08, 0x00, 0x65, 0xa4, 0x04, 0x00, + 0x40, 0xf6, 0x8b, 0x2c, 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xb0, 0xb5, 0x00, 0xf0, 0x8f, 0xf9, 0x24, 0x49, 0x08, 0x78, 0xa8, 0xb1, + 0xb1, 0x48, 0x90, 0xf8, 0xca, 0x01, 0x02, 0x28, 0x10, 0xd1, 0xaa, 0x48, + 0x08, 0x4d, 0x02, 0x31, 0x0a, 0x22, 0x00, 0x78, 0x00, 0xeb, 0x00, 0x14, + 0x55, 0xf8, 0x34, 0x00, 0x94, 0x30, 0xea, 0xf7, 0x8f, 0xfd, 0x55, 0xf8, + 0x34, 0x00, 0x01, 0x21, 0x80, 0xf8, 0x93, 0x10, 0xb0, 0xbd, 0x00, 0xbf, + 0xfc, 0x6d, 0x01, 0x00, 0x80, 0xb5, 0x00, 0xf0, 0x75, 0xf9, 0x14, 0x48, + 0x01, 0x21, 0x01, 0x73, 0x00, 0x21, 0x01, 0x70, 0x80, 0xbd, 0x00, 0xbf, + 0xb0, 0xb5, 0x00, 0xf0, 0x71, 0xf9, 0x04, 0x46, 0x98, 0x48, 0x99, 0x49, + 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x01, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, + 0xdc, 0x00, 0xc0, 0x07, 0x0f, 0xd0, 0x09, 0x4d, 0x00, 0x21, 0x00, 0x22, + 0xa8, 0x1c, 0x11, 0xf0, 0xf9, 0xf9, 0x10, 0xb1, 0x01, 0x20, 0x28, 0x70, + 0x05, 0xe0, 0x28, 0x78, 0x18, 0xb9, 0x00, 0x20, 0x11, 0xf0, 0xf4, 0xfa, + 0x28, 0x73, 0x20, 0x46, 0xb0, 0xbd, 0x00, 0xbf, 0x58, 0xf0, 0x05, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x99, 0xb0, 0x82, 0x48, 0x00, 0x68, 0x40, 0xb1, + 0x81, 0x49, 0x09, 0x68, 0x91, 0xf8, 0x6c, 0x10, 0xc1, 0xeb, 0xc1, 0x01, + 0x00, 0xeb, 0x81, 0x00, 0x00, 0xe0, 0x12, 0xa8, 0x7d, 0x49, 0x0a, 0x88, + 0x2a, 0xb1, 0x7d, 0x49, 0x0b, 0x68, 0x93, 0x42, 0x21, 0xd2, 0x5a, 0x1c, + 0x0a, 0x60, 0x78, 0x4c, 0x21, 0x68, 0xd1, 0xf8, 0xc4, 0x20, 0x2a, 0xb1, + 0x77, 0x4b, 0x1d, 0x68, 0x95, 0x42, 0x1b, 0xd2, 0x6a, 0x1c, 0x1a, 0x60, + 0xdf, 0xf8, 0xd8, 0x81, 0xdf, 0xf8, 0xd8, 0xa1, 0x98, 0xf8, 0x00, 0x20, + 0xc2, 0xeb, 0x42, 0x12, 0x0a, 0xeb, 0xc2, 0x03, 0xb3, 0xf8, 0xdc, 0x20, + 0xd7, 0x07, 0x01, 0xd0, 0x95, 0x07, 0x15, 0xd4, 0x87, 0xb9, 0x41, 0x68, + 0x01, 0x31, 0x41, 0x60, 0xc5, 0xe0, 0x93, 0x42, 0x09, 0xd1, 0x58, 0x1c, + 0x08, 0x60, 0x02, 0xe0, 0x05, 0xd1, 0x50, 0x1c, 0x18, 0x60, 0x67, 0x48, + 0x00, 0x68, 0x80, 0x47, 0xb9, 0xe0, 0xb8, 0xe0, 0x81, 0x68, 0x01, 0x31, + 0x81, 0x60, 0xb4, 0xe0, 0x93, 0xf8, 0xe0, 0x30, 0x02, 0x2b, 0x05, 0xd3, + 0x12, 0x07, 0x03, 0xd4, 0xc2, 0x68, 0x01, 0x32, 0xc2, 0x60, 0x02, 0xe0, + 0x02, 0x68, 0x01, 0x32, 0x02, 0x60, 0x08, 0x69, 0x00, 0x79, 0x18, 0xb3, + 0x98, 0xf8, 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x10, 0x0a, 0xeb, 0xc0, 0x00, + 0x00, 0xf1, 0xc0, 0x01, 0x59, 0x48, 0xd0, 0xf8, 0x00, 0x90, 0x59, 0x48, + 0xd0, 0xf8, 0x00, 0xb0, 0x58, 0x48, 0x02, 0x68, 0x0b, 0xa8, 0x90, 0x47, + 0x0b, 0xaf, 0xdd, 0xe9, 0x10, 0x65, 0x8f, 0xcf, 0xcd, 0xe9, 0x00, 0x76, + 0x02, 0x95, 0xd8, 0x47, 0x53, 0x49, 0xca, 0x78, 0x21, 0x68, 0x09, 0x69, + 0x02, 0x31, 0xc8, 0x47, 0x21, 0x68, 0x09, 0x69, 0x08, 0x70, 0x1e, 0xe0, + 0x98, 0xf8, 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x10, 0x0a, 0xeb, 0xc0, 0x00, + 0x00, 0xf1, 0xc0, 0x01, 0x48, 0x48, 0xd0, 0xf8, 0x00, 0x90, 0x48, 0x48, + 0x02, 0x68, 0x04, 0xa8, 0x90, 0x47, 0x04, 0xaf, 0x0a, 0x9d, 0xcf, 0xcf, + 0xcd, 0xe9, 0x00, 0x67, 0x02, 0x95, 0xc8, 0x47, 0x21, 0x68, 0x01, 0x22, + 0x09, 0x69, 0x0a, 0x71, 0x41, 0x4a, 0x08, 0x70, 0xd2, 0x78, 0x90, 0x40, + 0x48, 0x80, 0x98, 0xf8, 0x00, 0x00, 0xc0, 0xeb, 0x40, 0x10, 0x0a, 0xeb, + 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x10, 0x0a, 0x07, 0x28, 0xd5, 0x90, 0xf8, + 0xa1, 0x20, 0x03, 0x2a, 0x24, 0xd1, 0xd0, 0xf8, 0xc0, 0x20, 0x52, 0x79, + 0x03, 0x2a, 0x1f, 0xd1, 0x49, 0xb2, 0x00, 0x29, 0x1c, 0xd4, 0xb0, 0xf8, + 0xde, 0x00, 0x00, 0x28, 0x47, 0xd0, 0x33, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x00, 0x28, 0x45, 0xd0, 0x98, 0xf8, 0x00, 0x10, 0xc1, 0xeb, 0x41, 0x11, + 0x0a, 0xeb, 0xc1, 0x02, 0x92, 0xf8, 0xde, 0x20, 0x82, 0x70, 0x5a, 0xf8, + 0x31, 0x10, 0x14, 0x31, 0xd8, 0xf7, 0x7c, 0xfe, 0x2a, 0x48, 0x06, 0x21, + 0x00, 0x78, 0xd6, 0xf7, 0xa7, 0xfc, 0x07, 0xe0, 0x28, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x20, 0x68, 0x41, 0x69, 0x41, 0xf0, 0x80, 0x41, 0x41, 0x61, + 0x25, 0x48, 0x00, 0x68, 0x18, 0xb3, 0x98, 0xf8, 0x00, 0x10, 0xc1, 0xeb, + 0x41, 0x11, 0x0a, 0xeb, 0xc1, 0x01, 0x91, 0xf8, 0xe0, 0x10, 0x00, 0xeb, + 0x81, 0x01, 0xd1, 0xf8, 0xc8, 0x21, 0x01, 0x32, 0xc1, 0xf8, 0xc8, 0x21, + 0x21, 0x68, 0x91, 0xf8, 0x8e, 0x10, 0x03, 0x29, 0x88, 0xbf, 0x00, 0x21, + 0x00, 0xeb, 0x41, 0x10, 0x98, 0xf8, 0x00, 0x10, 0xc1, 0xeb, 0x41, 0x11, + 0x0a, 0xeb, 0xc1, 0x01, 0x91, 0xf8, 0xe0, 0x10, 0x00, 0xeb, 0x41, 0x00, + 0x01, 0x8f, 0x01, 0x31, 0x01, 0x87, 0x19, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x00, 0x20, 0x4f, 0xf4, 0xaf, 0x71, 0xdc, 0xf7, 0xb9, 0xfa, 0xf6, 0xe7, + 0x04, 0x36, 0x01, 0x00, 0xf8, 0x35, 0x01, 0x00, 0x88, 0x5a, 0x01, 0x00, + 0xec, 0x35, 0x01, 0x00, 0x00, 0xb8, 0x08, 0x00, 0x74, 0x87, 0x08, 0x00, + 0x0c, 0x6f, 0x01, 0x00, 0x10, 0xb8, 0x08, 0x00, 0x1c, 0xb8, 0x08, 0x00, + 0x18, 0xb8, 0x08, 0x00, 0x00, 0x69, 0x08, 0x00, 0x34, 0xb8, 0x08, 0x00, + 0x67, 0x34, 0x01, 0x00, 0xb8, 0xd6, 0x08, 0x00, 0x08, 0x36, 0x01, 0x00, + 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0xfc, 0xe3, 0x08, 0x00, 0x0c, 0xa8, 0x04, 0x00, + 0xe4, 0xb9, 0x08, 0x00, 0xec, 0xa7, 0x04, 0x00, 0x88, 0xd3, 0x08, 0x00, + 0x2c, 0xa8, 0x04, 0x00, 0xf4, 0xe3, 0x08, 0x00, 0x41, 0xa5, 0x04, 0x00, + 0x4a, 0xf6, 0x13, 0x3c, 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf2, 0x41, 0x7c, 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4b, 0xf6, 0x2d, 0x0c, 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xa5, 0xa4, 0x04, 0x00, 0xdd, 0xb8, 0x0d, 0x10, 0xf9, 0xbb, 0x0d, 0x10, + 0x47, 0xbc, 0x0d, 0x10, 0x99, 0xbc, 0x0d, 0x10, 0x3b, 0xbd, 0x0d, 0x10, + 0x91, 0x6a, 0x0f, 0x10, 0x4b, 0x00, 0x00, 0x00, 0xe5, 0xa4, 0x04, 0x00, + 0x93, 0xb7, 0x0d, 0x10, 0x0f, 0x7d, 0x0d, 0x10, 0xf9, 0xa4, 0x04, 0x00, + 0xf1, 0xb1, 0x0d, 0x10, 0xf1, 0xb4, 0x0d, 0x10, 0x91, 0x6a, 0x0f, 0x10, + 0x2e, 0x00, 0x00, 0x00, 0xc1, 0x8b, 0x0d, 0x10, 0xdd, 0xb9, 0x0d, 0x10, + 0xf9, 0xba, 0x0d, 0x10, 0xf9, 0xa4, 0x04, 0x00, 0x99, 0xbc, 0x0d, 0x10, + 0x4d, 0xbd, 0x0d, 0x10, 0x91, 0x6a, 0x0f, 0x10, 0x4c, 0x00, 0x00, 0x00, + 0x70, 0xb5, 0x82, 0x6e, 0x0c, 0x68, 0xd0, 0xf8, 0xd4, 0x30, 0xa2, 0x1a, + 0xc2, 0xf3, 0x99, 0x05, 0xb0, 0xf8, 0x54, 0x24, 0x54, 0x08, 0xb5, 0xeb, + 0x52, 0x0f, 0x07, 0xd3, 0x90, 0xf8, 0x88, 0x24, 0x12, 0x07, 0x44, 0xbf, + 0xca, 0x7c, 0x5f, 0xea, 0x82, 0x72, 0x15, 0xd4, 0x1d, 0xb1, 0xbd, 0xe8, + 0x70, 0x40, 0x00, 0xf0, 0x31, 0xb9, 0x5a, 0x7f, 0x00, 0x2a, 0xf8, 0xd0, + 0xb3, 0xf8, 0x6a, 0x30, 0x0b, 0x4a, 0x40, 0xf2, 0xe2, 0x45, 0x14, 0xfb, + 0x05, 0x22, 0x03, 0xf5, 0x9c, 0x73, 0x93, 0x42, 0xed, 0xd3, 0x02, 0x22, + 0x10, 0x46, 0x70, 0xbd, 0x01, 0x2c, 0xe7, 0xd1, 0xb0, 0xf8, 0x56, 0x64, + 0x05, 0x2e, 0xe3, 0xd8, 0x01, 0x22, 0x02, 0xeb, 0x56, 0x06, 0xb5, 0x42, + 0xde, 0xd2, 0xf1, 0xe7, 0x1e, 0xfb, 0xff, 0xff, 0x41, 0x68, 0x09, 0x4b, + 0x91, 0xf8, 0x35, 0x21, 0x02, 0xeb, 0x42, 0x02, 0x03, 0xeb, 0x42, 0x12, + 0x06, 0x4b, 0x92, 0x7b, 0x93, 0xf8, 0x57, 0x31, 0x9a, 0x42, 0x03, 0xd3, + 0x04, 0x4a, 0x12, 0x6a, 0xc1, 0xf8, 0x88, 0x23, 0x00, 0xf0, 0x04, 0xb9, + 0x54, 0xf1, 0x05, 0x00, 0xe8, 0x65, 0x08, 0x00, 0xfc, 0x70, 0x01, 0x00, + 0x2d, 0xe9, 0xf0, 0x47, 0x04, 0x46, 0x80, 0x6e, 0x89, 0x46, 0xd4, 0xf8, + 0xf8, 0x80, 0x41, 0x1a, 0x09, 0x01, 0x4f, 0xea, 0x48, 0x07, 0x15, 0xd5, + 0xdf, 0xf8, 0x94, 0xa1, 0x04, 0xf5, 0x94, 0x76, 0x01, 0x25, 0x38, 0x44, + 0xe9, 0xb2, 0x20, 0xf0, 0x70, 0x40, 0x02, 0x29, 0xa0, 0x66, 0x04, 0xd3, + 0xda, 0xf8, 0x00, 0x10, 0x30, 0x46, 0x88, 0x47, 0xa0, 0x6e, 0xa0, 0xeb, + 0x09, 0x01, 0x01, 0x35, 0x09, 0x01, 0xee, 0xd4, 0x5b, 0x49, 0x91, 0xf8, + 0xec, 0x22, 0x00, 0x2a, 0x57, 0xd0, 0x5a, 0x4a, 0x92, 0xf8, 0xfe, 0x26, + 0x00, 0x2a, 0x52, 0xd0, 0x91, 0xf8, 0xee, 0x12, 0x00, 0x29, 0x4e, 0xd0, + 0x94, 0xf8, 0x88, 0x14, 0x09, 0x07, 0x4a, 0xd5, 0xd4, 0xf8, 0xd4, 0x10, + 0x4a, 0x7f, 0x0a, 0xb3, 0xd4, 0xf8, 0xf8, 0x20, 0x0f, 0x2a, 0x14, 0xd8, + 0xb1, 0xf8, 0x6a, 0x10, 0x41, 0xf2, 0x88, 0x32, 0x02, 0xeb, 0x81, 0x01, + 0x40, 0xf2, 0xe2, 0x42, 0x08, 0xfb, 0x02, 0xf2, 0xb1, 0xeb, 0x52, 0x0f, + 0x07, 0xd3, 0x52, 0x08, 0xb1, 0xfb, 0xf2, 0xf1, 0x01, 0xfb, 0x07, 0x00, + 0x20, 0xf0, 0x70, 0x40, 0xa0, 0x66, 0x20, 0x6a, 0xf0, 0xb9, 0xa0, 0x68, + 0xe0, 0xb9, 0x44, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xb8, 0xb9, + 0xd4, 0xf8, 0xf8, 0x00, 0x0f, 0x28, 0x13, 0xd8, 0x40, 0x4a, 0xa0, 0x6e, + 0x52, 0x68, 0xa0, 0xeb, 0x88, 0x01, 0x89, 0x1a, 0x21, 0xf0, 0x70, 0x41, + 0xb1, 0xf1, 0x00, 0x6f, 0x08, 0xd9, 0x38, 0x44, 0x20, 0xf0, 0x70, 0x40, + 0xa0, 0x66, 0x35, 0x48, 0x01, 0x68, 0x04, 0xf5, 0x94, 0x70, 0x88, 0x47, + 0xd4, 0xf8, 0xd4, 0x20, 0xa0, 0x6e, 0x51, 0x7f, 0x00, 0x29, 0x01, 0x46, + 0x03, 0xd0, 0x51, 0x69, 0x41, 0x1a, 0x21, 0xf0, 0x70, 0x41, 0x31, 0x4a, + 0xd1, 0x60, 0xd4, 0xf8, 0xa8, 0x13, 0x01, 0x31, 0x4d, 0xd0, 0xd4, 0xe9, + 0x35, 0x16, 0x4f, 0x69, 0x94, 0xf8, 0xb2, 0x13, 0x0a, 0x07, 0x08, 0xd5, + 0xd4, 0xf8, 0xa0, 0x23, 0x80, 0x1a, 0x00, 0x01, 0x5c, 0xbf, 0x01, 0xf0, + 0xf7, 0x00, 0x84, 0xf8, 0xb2, 0x03, 0xb4, 0xf8, 0xa6, 0x03, 0x01, 0x28, + 0x14, 0xd1, 0x20, 0x6a, 0x90, 0xb9, 0x22, 0x48, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x68, 0xb9, 0xa0, 0x68, 0x58, 0xb9, 0x94, 0xf8, 0xb2, 0x03, + 0xc1, 0x07, 0x07, 0xd1, 0x01, 0x07, 0x5e, 0xbf, 0x5f, 0xea, 0x80, 0x60, + 0xb4, 0xf8, 0xa4, 0x03, 0xa4, 0xf8, 0xa6, 0x03, 0xd4, 0xf8, 0xa8, 0x03, + 0xa9, 0xeb, 0x00, 0x01, 0x09, 0x01, 0x0e, 0xd4, 0xb4, 0xf8, 0xa4, 0x13, + 0xd4, 0xf8, 0xf8, 0x20, 0x51, 0x43, 0x49, 0x00, 0x42, 0x18, 0x22, 0xf0, + 0x70, 0x40, 0xa9, 0xeb, 0x02, 0x02, 0x12, 0x01, 0xf8, 0xd5, 0xc4, 0xf8, + 0xa8, 0x03, 0xd4, 0xf8, 0xf0, 0x10, 0x39, 0xb1, 0xba, 0x19, 0x82, 0x1a, + 0x51, 0x1a, 0x21, 0xf0, 0x70, 0x41, 0xb1, 0xf1, 0x00, 0x6f, 0x06, 0xd9, + 0xb4, 0xf8, 0xa6, 0x13, 0x01, 0x29, 0x18, 0xbf, 0xa0, 0x66, 0xbd, 0xe8, + 0xf0, 0x87, 0x01, 0x20, 0xa4, 0xf8, 0xa6, 0x03, 0xbd, 0xe8, 0xf0, 0x87, + 0x50, 0xd2, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x38, 0x21, 0x01, 0x00, + 0x4c, 0x9d, 0x08, 0x00, 0x50, 0x2e, 0x01, 0x00, 0x04, 0x48, 0x05, 0x49, + 0x41, 0x66, 0x05, 0x48, 0x05, 0x49, 0x01, 0x60, 0x05, 0x48, 0x06, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x98, 0xdf, 0x08, 0x00, 0xc1, 0xa8, 0x04, 0x00, + 0xb0, 0xe4, 0x08, 0x00, 0x4d, 0xa8, 0x04, 0x00, 0x08, 0xc0, 0x08, 0x00, + 0xf5, 0xa8, 0x04, 0x00, 0x42, 0xf2, 0x5d, 0x0c, 0xc1, 0xf2, 0x0e, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0x4f, 0x7c, 0xc1, 0xf2, 0x0e, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x02, 0x49, 0x0a, 0x68, 0x01, 0x32, 0x0a, 0x60, + 0x00, 0xf0, 0x88, 0xb8, 0x84, 0xf0, 0x05, 0x00, 0x70, 0xb5, 0x34, 0x4c, + 0x34, 0x4d, 0x21, 0x78, 0xc1, 0xeb, 0x41, 0x11, 0x05, 0xeb, 0xc1, 0x01, + 0xb1, 0xf8, 0xdc, 0x10, 0xc9, 0x07, 0x09, 0xd1, 0x37, 0x48, 0x00, 0x68, + 0x20, 0xb1, 0xd0, 0xf8, 0x7c, 0x11, 0x01, 0x31, 0xc0, 0xf8, 0x7c, 0x11, + 0x00, 0x24, 0x51, 0xe0, 0x90, 0xf8, 0x84, 0x00, 0x2a, 0x49, 0x00, 0xeb, + 0x40, 0x00, 0x01, 0xeb, 0xc0, 0x00, 0x40, 0x68, 0x80, 0x47, 0x20, 0x78, + 0x27, 0x4b, 0xc0, 0xeb, 0x40, 0x11, 0x05, 0xeb, 0xc1, 0x01, 0x91, 0xf8, + 0xe0, 0x20, 0x03, 0xeb, 0xc2, 0x02, 0xc1, 0xf8, 0xc0, 0x20, 0x23, 0x49, + 0x01, 0xeb, 0x40, 0x11, 0x89, 0x7d, 0x21, 0xb3, 0x21, 0x4e, 0x00, 0xeb, + 0x00, 0x10, 0x27, 0x49, 0x06, 0xeb, 0xc0, 0x00, 0x09, 0x68, 0x00, 0x69, + 0x88, 0x42, 0x20, 0xd0, 0x1d, 0x49, 0x09, 0x68, 0x88, 0x42, 0x1c, 0xd0, + 0x1c, 0x48, 0x81, 0x6e, 0x21, 0xf4, 0x80, 0x71, 0x81, 0x66, 0x4f, 0xf4, + 0x80, 0x71, 0x41, 0x66, 0x00, 0x21, 0x01, 0x60, 0x20, 0x78, 0x01, 0x24, + 0xc0, 0xeb, 0x40, 0x10, 0x05, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x10, + 0x41, 0xf0, 0x40, 0x01, 0xa0, 0xf8, 0xdc, 0x10, 0x12, 0xe0, 0x12, 0x48, + 0x01, 0x24, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x0c, 0xe0, 0x0f, 0x48, + 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0x20, 0x78, 0x25, 0x21, 0x01, 0x24, + 0x00, 0xeb, 0x00, 0x10, 0x06, 0xeb, 0xc0, 0x00, 0x80, 0xf8, 0x49, 0x10, + 0x20, 0x46, 0x70, 0xbd, 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0x28, 0xd6, 0x08, 0x00, 0x86, 0x71, 0x0d, 0x10, 0xe0, 0x58, 0x01, 0x00, + 0xfc, 0x6d, 0x01, 0x00, 0x58, 0xb7, 0x08, 0x00, 0x60, 0x20, 0x21, 0x40, + 0x00, 0xe4, 0x08, 0x00, 0x08, 0x36, 0x01, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x54, 0xb7, 0x08, 0x00, 0xa0, 0xd3, 0x05, 0x00, + 0x4c, 0xf2, 0x99, 0x0c, 0xc1, 0xf2, 0x0d, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x70, 0xb5, 0x04, 0x46, 0x57, 0x48, 0x00, 0x68, 0x00, 0x01, 0x00, 0xf1, + 0x81, 0x80, 0x59, 0x48, 0x01, 0x68, 0x20, 0x68, 0x09, 0x05, 0x7c, 0xd4, + 0x60, 0xb1, 0xd0, 0xf8, 0xcc, 0x11, 0x21, 0xf0, 0x0f, 0x01, 0xc0, 0xf8, + 0xcc, 0x11, 0x20, 0x68, 0xd0, 0xf8, 0xcc, 0x11, 0x41, 0xf0, 0x03, 0x01, + 0xc0, 0xf8, 0xcc, 0x11, 0x50, 0x4d, 0x95, 0xf8, 0x21, 0x00, 0x01, 0x28, + 0x40, 0xf0, 0x86, 0x80, 0xa8, 0x68, 0x49, 0x49, 0xd0, 0xf8, 0xcc, 0x01, + 0x88, 0x60, 0x95, 0xf8, 0x20, 0x00, 0xc1, 0x07, 0x7c, 0xd0, 0x40, 0x07, + 0x7a, 0xd5, 0x45, 0x48, 0x48, 0x49, 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x10, + 0x01, 0xeb, 0xc0, 0x00, 0x46, 0x49, 0x00, 0x69, 0x09, 0x68, 0x88, 0x42, + 0x6e, 0xd1, 0x28, 0x68, 0x00, 0x26, 0x01, 0x7b, 0x80, 0x68, 0x00, 0xeb, + 0x81, 0x02, 0x89, 0x00, 0xc2, 0xf8, 0x94, 0x60, 0x01, 0x22, 0x02, 0xfa, + 0x01, 0xf1, 0xd0, 0xf8, 0x90, 0x20, 0x22, 0xea, 0x01, 0x01, 0xc0, 0xf8, + 0x90, 0x10, 0x3c, 0x48, 0x00, 0x68, 0x80, 0x47, 0x3b, 0x48, 0xa9, 0x68, + 0x01, 0x22, 0x03, 0x68, 0x88, 0x20, 0x98, 0x47, 0xa8, 0x68, 0x90, 0xf8, + 0x24, 0x11, 0x69, 0xb1, 0x90, 0xf8, 0xc0, 0x10, 0x51, 0xb9, 0x90, 0xf8, + 0xc1, 0x10, 0x41, 0xf0, 0x10, 0x01, 0x80, 0xf8, 0xc1, 0x10, 0x33, 0x49, + 0xb8, 0x30, 0x0a, 0x68, 0x03, 0x21, 0x90, 0x47, 0x95, 0xf8, 0x20, 0x00, + 0x00, 0xf0, 0xde, 0x00, 0x20, 0x30, 0x85, 0xf8, 0x20, 0x00, 0x20, 0x68, + 0xc0, 0xf8, 0x90, 0x62, 0x26, 0x68, 0xd6, 0xf8, 0xe8, 0x43, 0x54, 0xb1, + 0x2a, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x21, 0x7d, 0x00, 0x20, + 0x20, 0x61, 0x20, 0x75, 0xc6, 0xf8, 0xe8, 0x03, 0xa1, 0x75, 0xa8, 0x68, + 0x84, 0x68, 0x2c, 0xb3, 0x21, 0x79, 0x01, 0xf0, 0xfe, 0x01, 0x78, 0x29, + 0x21, 0xd0, 0x54, 0xf8, 0x04, 0x4c, 0xf6, 0xe7, 0x20, 0x68, 0x60, 0xb1, + 0xd0, 0xf8, 0xcc, 0x11, 0x21, 0xf0, 0x0f, 0x01, 0xc0, 0xf8, 0xcc, 0x11, + 0x20, 0x68, 0xd0, 0xf8, 0xcc, 0x11, 0x41, 0xf0, 0x05, 0x01, 0xc0, 0xf8, + 0xcc, 0x11, 0x0e, 0x48, 0x81, 0x7c, 0x01, 0x31, 0x81, 0x74, 0x0d, 0x48, + 0x0d, 0x49, 0x00, 0x78, 0x00, 0xeb, 0x80, 0x00, 0x01, 0xeb, 0xc0, 0x00, + 0xc1, 0x69, 0x41, 0xf4, 0x80, 0x11, 0xc1, 0x61, 0x70, 0xbd, 0x11, 0x49, + 0x08, 0x30, 0x0a, 0x68, 0x21, 0x46, 0x90, 0x47, 0x20, 0x46, 0xbd, 0xe8, + 0x70, 0x40, 0xdb, 0xf7, 0xbb, 0xbf, 0x00, 0xbf, 0xec, 0x10, 0x21, 0x40, + 0x1c, 0x7a, 0x01, 0x00, 0x74, 0x87, 0x08, 0x00, 0x84, 0x71, 0x01, 0x00, + 0xcc, 0x20, 0x21, 0x40, 0xd8, 0x5d, 0x01, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0x74, 0xe4, 0x08, 0x00, 0xb8, 0xa0, 0x08, 0x00, 0xa8, 0xa0, 0x08, 0x00, + 0xbc, 0xa0, 0x08, 0x00, 0xc8, 0xa0, 0x08, 0x00, 0xe8, 0xa0, 0x08, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x81, 0x62, 0x70, 0x47, 0x9c, 0x0f, 0x01, 0x00, + 0x25, 0xac, 0x04, 0x00, 0x80, 0xb5, 0x00, 0xf0, 0x17, 0xf8, 0x05, 0x48, + 0x90, 0xf8, 0x21, 0x00, 0x00, 0xb1, 0x80, 0xbd, 0x03, 0x48, 0x00, 0x68, + 0xbd, 0xe8, 0x80, 0x40, 0x00, 0x47, 0x00, 0xbf, 0xd8, 0x5d, 0x01, 0x00, + 0xb8, 0xa0, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x8c, 0xe4, 0x08, 0x00, 0xcd, 0xad, 0x04, 0x00, 0x40, 0xf2, 0xd5, 0x0c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x00, 0xf0, 0xa8, 0xb8, + 0xb0, 0xb5, 0x28, 0xb3, 0x04, 0x46, 0x90, 0xf8, 0x35, 0x01, 0x17, 0x4d, + 0x00, 0xeb, 0x40, 0x00, 0x40, 0x01, 0x28, 0x58, 0x40, 0xb1, 0xdb, 0xf7, + 0x69, 0xff, 0x94, 0xf8, 0x35, 0x01, 0x00, 0x21, 0x00, 0xeb, 0x40, 0x00, + 0x40, 0x01, 0x29, 0x50, 0x20, 0x46, 0x00, 0xf0, 0x97, 0xf8, 0x0f, 0x48, + 0x00, 0x21, 0x00, 0x22, 0x04, 0x30, 0x50, 0xf8, 0x04, 0x3c, 0x1b, 0xb1, + 0x03, 0x78, 0x01, 0x2b, 0x08, 0xbf, 0x1a, 0x46, 0x01, 0x31, 0x0c, 0x30, + 0x17, 0x29, 0xf4, 0xd1, 0x10, 0x06, 0x00, 0xd0, 0xb0, 0xbd, 0x07, 0x48, + 0x01, 0x68, 0x41, 0xf0, 0x01, 0x01, 0x01, 0x60, 0x05, 0x48, 0x00, 0x68, + 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0x47, 0x00, 0xbf, 0x54, 0xf1, 0x05, 0x00, + 0xe8, 0x72, 0x01, 0x00, 0x68, 0xf0, 0x05, 0x00, 0x40, 0xe4, 0x08, 0x00, + 0xb0, 0xb5, 0x0d, 0x46, 0x04, 0x46, 0x00, 0xf0, 0x73, 0xf8, 0x0f, 0x48, + 0x90, 0xf8, 0x3e, 0x00, 0xc0, 0x06, 0x17, 0xd5, 0x95, 0xf8, 0x31, 0x10, + 0x95, 0xf8, 0x30, 0x00, 0x6f, 0xf0, 0x02, 0x03, 0x6f, 0xf0, 0x02, 0x02, + 0xff, 0x29, 0x08, 0xbf, 0x4f, 0xf0, 0xff, 0x33, 0x00, 0x29, 0x08, 0xbf, + 0x0b, 0x46, 0xe3, 0x72, 0xff, 0x28, 0x08, 0xbf, 0x4f, 0xf0, 0xff, 0x32, + 0x00, 0x28, 0x08, 0xbf, 0x02, 0x46, 0xa2, 0x72, 0xb0, 0xbd, 0x00, 0xbf, + 0x40, 0x86, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0x54, 0xf8, + 0x94, 0xf8, 0x76, 0x10, 0x81, 0x42, 0x38, 0xbf, 0x08, 0x46, 0x10, 0xbd, + 0x0a, 0x69, 0xb2, 0xf1, 0xff, 0x3f, 0x00, 0xdd, 0x70, 0x47, 0x13, 0x1a, + 0x1b, 0x01, 0x0a, 0xd5, 0x22, 0xf0, 0x70, 0x42, 0x82, 0x1a, 0xb2, 0xf1, + 0x00, 0x6f, 0x04, 0xd9, 0x0a, 0x8b, 0x01, 0x32, 0x6f, 0xf3, 0xdf, 0x22, + 0x0a, 0x83, 0x40, 0xf0, 0x00, 0x42, 0x0a, 0x61, 0x70, 0x47, 0x00, 0xbf, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x08, 0x48, 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, 0x09, 0x49, 0x01, 0x60, + 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x70, 0x47, 0x8c, 0xda, 0x08, 0x00, + 0x11, 0xae, 0x04, 0x00, 0xa0, 0xce, 0x08, 0x00, 0x0d, 0xae, 0x04, 0x00, + 0x94, 0xda, 0x08, 0x00, 0x89, 0xae, 0x04, 0x00, 0xd0, 0xdc, 0x08, 0x00, + 0xd5, 0xae, 0x04, 0x00, 0xd8, 0xe5, 0x08, 0x00, 0xe9, 0xae, 0x04, 0x00, + 0x48, 0xf2, 0x11, 0x3c, 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x47, 0xf6, 0x41, 0x1c, 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x47, 0xf6, 0xcd, 0x3c, 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x4c, 0xf6, 0x61, 0x1c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x80, 0xb5, 0x01, 0xf0, 0x6d, 0xf9, 0x2c, 0x48, 0x00, 0x21, 0xc0, 0xe9, + 0x00, 0x11, 0x81, 0x60, 0x80, 0xbd, 0x00, 0xbf, 0x2d, 0xe9, 0xf0, 0x41, + 0x99, 0x4e, 0x04, 0x46, 0x30, 0x78, 0x40, 0x07, 0x44, 0xd5, 0x94, 0xf8, + 0x32, 0x54, 0xdf, 0xf8, 0x88, 0x80, 0x05, 0xeb, 0x45, 0x00, 0x08, 0xeb, + 0x80, 0x00, 0x80, 0x68, 0x01, 0x30, 0x0b, 0xd0, 0xd6, 0xf7, 0x24, 0xf8, + 0x94, 0xf8, 0x32, 0x54, 0x05, 0xeb, 0x45, 0x01, 0x08, 0xeb, 0x81, 0x01, + 0x89, 0x68, 0x40, 0x1a, 0x00, 0x01, 0x2d, 0xd4, 0x6e, 0x4f, 0xd7, 0xf8, + 0x94, 0x00, 0x50, 0xb1, 0x16, 0x48, 0x03, 0x21, 0x02, 0x68, 0x20, 0x46, + 0x90, 0x47, 0x00, 0x20, 0x94, 0xf8, 0x32, 0x54, 0x47, 0xf8, 0x90, 0x0f, + 0x78, 0x60, 0xf0, 0x88, 0x05, 0xeb, 0x45, 0x07, 0xd8, 0xf7, 0xd0, 0xf9, + 0x06, 0x46, 0x58, 0xf8, 0x27, 0x00, 0x31, 0x46, 0x01, 0xf0, 0x34, 0xf9, + 0x28, 0xb9, 0x0c, 0x48, 0x31, 0x46, 0x00, 0x68, 0x01, 0xf0, 0x2e, 0xf9, + 0x30, 0xb1, 0x08, 0x48, 0x03, 0x21, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, + 0x94, 0xf8, 0x32, 0x54, 0x06, 0x48, 0x01, 0x68, 0x28, 0x46, 0xbd, 0xe8, + 0xf0, 0x41, 0x08, 0x47, 0xbd, 0xe8, 0xf0, 0x81, 0x10, 0x5e, 0x01, 0x00, + 0xe8, 0xcd, 0x08, 0x00, 0x6c, 0xf0, 0x05, 0x00, 0xec, 0xcd, 0x08, 0x00, + 0xf8, 0xb5, 0x04, 0x46, 0x51, 0x48, 0x00, 0x22, 0x01, 0x46, 0x51, 0xf8, + 0x6c, 0x5f, 0x4e, 0x7b, 0x09, 0x2e, 0x65, 0xd8, 0x00, 0x23, 0xdf, 0xe8, + 0x06, 0xf0, 0x05, 0x64, 0x34, 0x64, 0x64, 0x64, 0x64, 0x64, 0x28, 0x48, + 0x0a, 0x7f, 0x03, 0x2a, 0x59, 0xd1, 0x4a, 0x7f, 0x03, 0x2a, 0x56, 0xd1, + 0x8a, 0x7f, 0x00, 0x2a, 0x53, 0xd1, 0xca, 0x7f, 0x01, 0x2a, 0x50, 0xd1, + 0x4a, 0xf6, 0x44, 0x43, 0x00, 0x22, 0x9d, 0x42, 0x76, 0xd0, 0x4b, 0xf6, + 0x80, 0x33, 0x9d, 0x42, 0x4f, 0xf0, 0x00, 0x03, 0x47, 0xd1, 0x91, 0xf8, + 0x20, 0x30, 0x00, 0x22, 0x33, 0x2b, 0x4f, 0xf0, 0x00, 0x03, 0x04, 0xbf, + 0x4a, 0xf6, 0x80, 0x43, 0x40, 0xf2, 0x0b, 0x42, 0x3b, 0xe0, 0x4b, 0xf6, + 0x80, 0x32, 0x95, 0x42, 0x27, 0xd0, 0x4a, 0xf6, 0x44, 0x42, 0x95, 0x42, + 0x31, 0xd1, 0x4a, 0xf6, 0xcc, 0x63, 0x8c, 0x22, 0x2f, 0xe0, 0x4a, 0xf6, + 0x44, 0x42, 0x95, 0x42, 0x1f, 0xd0, 0x4b, 0xf6, 0x80, 0x32, 0x95, 0x42, + 0x25, 0xd1, 0x8b, 0x69, 0x2f, 0x4d, 0x00, 0x22, 0xab, 0x42, 0x4f, 0xf0, + 0x00, 0x03, 0x04, 0xbf, 0x4f, 0xf4, 0xa5, 0x43, 0x4f, 0xf4, 0x96, 0x72, + 0x1b, 0xe0, 0x4b, 0xf6, 0x80, 0x32, 0x95, 0x42, 0x36, 0xd0, 0x4a, 0xf6, + 0x44, 0x42, 0x95, 0x42, 0x11, 0xd1, 0x25, 0x4b, 0x40, 0xf2, 0x91, 0x42, + 0x0f, 0xe0, 0x4f, 0xf4, 0x3e, 0x43, 0x60, 0x22, 0x0b, 0xe0, 0x8a, 0x69, + 0x21, 0x4b, 0x9a, 0x42, 0x2b, 0xd0, 0x21, 0x4b, 0x9a, 0x42, 0x02, 0xd1, + 0x4a, 0xf2, 0xbc, 0x13, 0x27, 0xe0, 0x00, 0x22, 0x00, 0x23, 0x4e, 0x6a, + 0x9e, 0x42, 0x94, 0xbf, 0x9d, 0x1b, 0xf5, 0x1a, 0xba, 0xb1, 0x9e, 0x42, + 0x15, 0xd2, 0x95, 0x42, 0x13, 0xd9, 0x8a, 0x6a, 0x00, 0xf1, 0x90, 0x03, + 0x40, 0xf6, 0x11, 0x10, 0x2a, 0x44, 0x8a, 0x62, 0x15, 0x49, 0x00, 0x22, + 0x0d, 0x68, 0x08, 0x21, 0x00, 0x91, 0x01, 0x21, 0xa8, 0x47, 0x13, 0x48, + 0x01, 0x68, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x40, 0x08, 0x47, 0xf8, 0xbd, + 0x4f, 0xf4, 0x90, 0x33, 0x4f, 0xf4, 0x8d, 0x62, 0xdb, 0xe7, 0x44, 0xf6, + 0xe6, 0x33, 0x40, 0xf6, 0xb8, 0x32, 0xd6, 0xe7, 0x91, 0xf8, 0x20, 0x30, + 0x35, 0x2b, 0x4f, 0xf0, 0x00, 0x03, 0x04, 0xbf, 0x49, 0xf6, 0xb3, 0x63, + 0x4f, 0xf4, 0xd6, 0x72, 0xcb, 0xe7, 0x00, 0xbf, 0x4c, 0x49, 0x01, 0x00, + 0xf5, 0x08, 0x01, 0x00, 0x88, 0x84, 0x02, 0x00, 0x00, 0xe2, 0x04, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0x2c, 0xe5, 0x08, 0x00, 0xbc, 0xb5, 0x16, 0x4a, + 0x12, 0x78, 0xd2, 0x07, 0x26, 0xd0, 0x01, 0x29, 0x24, 0xd1, 0x55, 0x49, + 0x00, 0xeb, 0x40, 0x00, 0x01, 0xaa, 0x51, 0xf8, 0x20, 0x40, 0x11, 0x48, + 0x49, 0x21, 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, 0x01, 0x98, 0xb8, 0xb1, + 0x0e, 0x49, 0x22, 0x46, 0x01, 0x23, 0x0d, 0x68, 0x49, 0x21, 0xa8, 0x47, + 0x01, 0x99, 0x20, 0x46, 0x00, 0xf0, 0x16, 0xf8, 0x01, 0x98, 0xdb, 0xf7, + 0x47, 0xfd, 0x94, 0xf8, 0x35, 0x01, 0x46, 0x49, 0x00, 0xeb, 0x40, 0x00, + 0x01, 0xeb, 0x40, 0x10, 0x20, 0x21, 0x18, 0x30, 0xd8, 0xf7, 0x9e, 0xf8, + 0xbc, 0xbd, 0x00, 0xbf, 0x28, 0x5e, 0x01, 0x00, 0x24, 0x9c, 0x08, 0x00, + 0x1c, 0x9c, 0x08, 0x00, 0xf8, 0xb5, 0x00, 0x28, 0x58, 0xd0, 0x05, 0x46, + 0x90, 0xf8, 0x74, 0x00, 0x3a, 0x4f, 0x0c, 0x46, 0x04, 0xf1, 0x3b, 0x06, + 0x81, 0xf8, 0x3a, 0x00, 0x95, 0xf8, 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, + 0x07, 0xeb, 0x40, 0x10, 0x00, 0xf1, 0x30, 0x01, 0x30, 0x46, 0x00, 0xf0, + 0x83, 0xf8, 0x95, 0xf8, 0x35, 0x01, 0x16, 0x28, 0x2e, 0xd8, 0x31, 0x4a, + 0x00, 0xeb, 0x40, 0x01, 0x52, 0xf8, 0x21, 0x30, 0x43, 0xb3, 0x02, 0xeb, + 0x81, 0x02, 0x12, 0x79, 0x03, 0x2a, 0x23, 0xd1, 0x07, 0xeb, 0x41, 0x10, + 0x00, 0xf1, 0x50, 0x01, 0x30, 0x46, 0x00, 0xf0, 0x6d, 0xf8, 0x95, 0xf8, + 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, 0x07, 0xeb, 0x40, 0x10, 0x00, 0xf1, + 0x34, 0x01, 0x04, 0xf1, 0x3f, 0x00, 0x00, 0xf0, 0x61, 0xf8, 0x95, 0xf8, + 0xf2, 0x02, 0x00, 0x21, 0x04, 0x28, 0x28, 0xbf, 0x04, 0x20, 0x05, 0xeb, + 0xc0, 0x00, 0x90, 0xf8, 0xbc, 0x03, 0x84, 0xf8, 0x47, 0x10, 0x84, 0xf8, + 0x43, 0x10, 0x84, 0xf8, 0x3a, 0x00, 0xf8, 0xbd, 0x00, 0xeb, 0x40, 0x00, + 0x07, 0xeb, 0x40, 0x10, 0x00, 0xf1, 0x34, 0x01, 0x04, 0xf1, 0x3f, 0x00, + 0x00, 0xf0, 0x46, 0xf8, 0xd5, 0xf8, 0x2c, 0x05, 0x58, 0xb1, 0x01, 0x69, + 0x08, 0x0e, 0x0a, 0x0c, 0x0b, 0x0a, 0x0a, 0xe0, 0x00, 0x20, 0x40, 0xf2, + 0x33, 0x31, 0xbd, 0xe8, 0xf8, 0x40, 0xdb, 0xf7, 0xef, 0xbc, 0x00, 0x20, + 0x00, 0x22, 0x00, 0x23, 0x00, 0x21, 0x84, 0xf8, 0x46, 0x00, 0x84, 0xf8, + 0x45, 0x20, 0x84, 0xf8, 0x44, 0x30, 0x84, 0xf8, 0x43, 0x10, 0x95, 0xf8, + 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, 0x07, 0xeb, 0x40, 0x10, 0x00, 0xf1, + 0x3c, 0x01, 0x04, 0xf1, 0x47, 0x00, 0xbd, 0xe8, 0xf8, 0x40, 0x1d, 0xe0, + 0x54, 0xf1, 0x05, 0x00, 0xe8, 0x72, 0x01, 0x00, 0x80, 0xb5, 0x02, 0x28, + 0x0b, 0xd0, 0x01, 0x28, 0x13, 0xd1, 0x01, 0xeb, 0x41, 0x00, 0xd6, 0x49, + 0x01, 0xeb, 0x40, 0x10, 0x20, 0x21, 0x18, 0x30, 0xd8, 0xf7, 0x08, 0xf8, + 0x80, 0xbd, 0x01, 0xeb, 0x41, 0x00, 0xd1, 0x49, 0x01, 0xeb, 0x40, 0x10, + 0x00, 0x21, 0xc0, 0xe9, 0x10, 0x11, 0xc0, 0xe9, 0x12, 0x11, 0x80, 0xbd, + 0x0a, 0x78, 0x02, 0x70, 0x4a, 0x78, 0x42, 0x70, 0x8a, 0x78, 0x82, 0x70, + 0xc9, 0x78, 0xc1, 0x70, 0x70, 0x47, 0x00, 0xbf, 0x62, 0xb1, 0xf8, 0xb5, + 0x04, 0x46, 0xd2, 0xf8, 0xd4, 0x00, 0x15, 0x46, 0x92, 0xf8, 0x35, 0x71, + 0x90, 0xf8, 0x71, 0x20, 0x1a, 0xb1, 0x00, 0xf1, 0x60, 0x06, 0x02, 0xe0, + 0x70, 0x47, 0x00, 0xf1, 0x14, 0x06, 0x20, 0x46, 0x2a, 0x46, 0x00, 0xf0, + 0x7d, 0xff, 0x95, 0xf8, 0x35, 0x01, 0x16, 0x28, 0x56, 0xd8, 0xba, 0x49, + 0x00, 0xeb, 0x40, 0x02, 0x51, 0xf8, 0x22, 0x20, 0x00, 0x2a, 0x4f, 0xd0, + 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x80, 0x00, 0x00, 0x79, 0x03, 0x28, + 0x11, 0xd0, 0x01, 0x28, 0x46, 0xd1, 0xd5, 0xf8, 0x6c, 0x01, 0x31, 0x68, + 0x08, 0x44, 0xe0, 0x77, 0xc0, 0xf3, 0x03, 0x61, 0x84, 0xf8, 0x22, 0x10, + 0x01, 0x0c, 0x00, 0x0a, 0x84, 0xf8, 0x21, 0x10, 0x84, 0xf8, 0x20, 0x00, + 0x36, 0xe0, 0x95, 0xf8, 0x68, 0x01, 0x00, 0x23, 0xe0, 0x77, 0x95, 0xf8, + 0x69, 0x01, 0x84, 0xf8, 0x20, 0x00, 0x95, 0xf8, 0xf2, 0x02, 0x03, 0x28, + 0x9a, 0xbf, 0x2b, 0x49, 0x09, 0x5c, 0xff, 0x21, 0xb5, 0xf8, 0x14, 0x23, + 0x21, 0x71, 0xa3, 0x74, 0x63, 0x74, 0x05, 0x28, 0x4f, 0xea, 0x12, 0x21, + 0xe2, 0x73, 0x4f, 0xf0, 0x04, 0x02, 0x21, 0x74, 0x4f, 0xf0, 0x03, 0x01, + 0x38, 0xbf, 0x02, 0x21, 0x04, 0x28, 0x28, 0xbf, 0x10, 0x46, 0x21, 0x4a, + 0x05, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0xbc, 0x03, 0x12, 0x68, 0x90, 0x47, + 0x04, 0xf1, 0x33, 0x06, 0x20, 0x72, 0x06, 0x21, 0x30, 0x46, 0xd8, 0xf7, + 0x3d, 0xfc, 0x05, 0xf5, 0x30, 0x72, 0x30, 0x46, 0x06, 0x21, 0x04, 0x23, + 0xd5, 0xf7, 0xee, 0xfd, 0x95, 0xf8, 0x35, 0x01, 0x8e, 0x4d, 0x16, 0x4e, + 0x00, 0xeb, 0x40, 0x00, 0x05, 0xeb, 0x40, 0x10, 0x00, 0xf1, 0x28, 0x01, + 0x04, 0xf1, 0x2b, 0x00, 0xb0, 0x47, 0x00, 0x20, 0x84, 0xf8, 0x2f, 0x00, + 0x07, 0xeb, 0x47, 0x00, 0x05, 0xeb, 0x40, 0x15, 0x04, 0xf1, 0x13, 0x00, + 0x05, 0xf1, 0x18, 0x01, 0xb0, 0x47, 0x05, 0xf1, 0x1c, 0x01, 0x04, 0xf1, + 0x17, 0x00, 0xb0, 0x47, 0x05, 0xf1, 0x20, 0x01, 0x04, 0xf1, 0x1b, 0x00, + 0xb0, 0x47, 0x05, 0xf1, 0x24, 0x01, 0x04, 0xf1, 0x23, 0x00, 0x32, 0x46, + 0xbd, 0xe8, 0xf8, 0x40, 0x10, 0x47, 0x00, 0xbf, 0xac, 0xc2, 0x04, 0x00, + 0x34, 0x9c, 0x08, 0x00, 0x51, 0xb3, 0x04, 0x00, 0x2d, 0xe9, 0xf8, 0x43, + 0x0d, 0x46, 0x73, 0x49, 0x09, 0x68, 0x8a, 0x07, 0x01, 0xd5, 0x02, 0x2d, + 0x05, 0xd0, 0xc9, 0x07, 0x00, 0xf0, 0xad, 0x80, 0x01, 0x2d, 0x40, 0xf0, + 0xaa, 0x80, 0xdf, 0xf8, 0xb8, 0x91, 0x00, 0xeb, 0x40, 0x00, 0x59, 0xf8, + 0x20, 0x40, 0x3c, 0xb1, 0xd4, 0xf8, 0xd4, 0x00, 0x90, 0xf8, 0x71, 0x10, + 0x49, 0xb1, 0x00, 0xf1, 0x60, 0x08, 0x08, 0xe0, 0x00, 0x20, 0x40, 0xf2, + 0xc1, 0x11, 0xbd, 0xe8, 0xf8, 0x43, 0xdb, 0xf7, 0xe7, 0xbb, 0x00, 0xf1, + 0x14, 0x08, 0xee, 0x48, 0x60, 0x26, 0x01, 0x2d, 0x6a, 0x46, 0x08, 0xbf, + 0x49, 0x26, 0x31, 0x46, 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, 0x00, 0x98, + 0x00, 0x28, 0x00, 0xf0, 0x84, 0x80, 0xe8, 0x49, 0x22, 0x46, 0x2b, 0x46, + 0x0f, 0x68, 0x31, 0x46, 0xb8, 0x47, 0x94, 0xf8, 0x35, 0x01, 0x16, 0x28, + 0x7b, 0xd8, 0x00, 0xeb, 0x40, 0x01, 0x59, 0xf8, 0x21, 0x10, 0x00, 0x29, + 0x75, 0xd0, 0x00, 0xeb, 0x40, 0x00, 0x09, 0xeb, 0x80, 0x00, 0x00, 0x79, + 0x01, 0x28, 0x6e, 0xd1, 0x02, 0x2d, 0x7c, 0xd1, 0x94, 0xf8, 0x24, 0x01, + 0x00, 0x99, 0xdd, 0x4d, 0x81, 0xf8, 0x3a, 0x00, 0x01, 0xf1, 0x3b, 0x00, + 0x04, 0xf5, 0xe6, 0x71, 0xa8, 0x47, 0x00, 0x98, 0x04, 0xf5, 0x9e, 0x71, + 0x3f, 0x30, 0xa8, 0x47, 0x94, 0xf8, 0x40, 0x01, 0x00, 0x99, 0x81, 0xf8, + 0x43, 0x00, 0x94, 0xf8, 0x41, 0x01, 0x81, 0xf8, 0x44, 0x00, 0x94, 0xf8, + 0x46, 0x01, 0x81, 0xf8, 0x45, 0x00, 0x94, 0xf8, 0x47, 0x01, 0x81, 0xf8, + 0x46, 0x00, 0x94, 0xf8, 0x48, 0x01, 0x81, 0xf8, 0x47, 0x00, 0x94, 0xf8, + 0x49, 0x01, 0x81, 0xf8, 0x48, 0x00, 0xd5, 0xf7, 0x3d, 0xfd, 0x00, 0x9a, + 0x01, 0x0e, 0x39, 0x4e, 0x82, 0xf8, 0x4c, 0x10, 0x01, 0x0c, 0x82, 0xf8, + 0x49, 0x00, 0x82, 0xf8, 0x4b, 0x10, 0x01, 0x0a, 0x82, 0xf8, 0x4a, 0x10, + 0xd4, 0xf8, 0xd8, 0x00, 0xd8, 0xf8, 0x00, 0x10, 0x08, 0x44, 0x01, 0x0a, + 0x82, 0xf8, 0x4d, 0x00, 0x82, 0xf8, 0x4e, 0x10, 0x01, 0x0c, 0x82, 0xf8, + 0x4f, 0x10, 0xc0, 0xf3, 0x03, 0x60, 0x82, 0xf8, 0x50, 0x00, 0x94, 0xf8, + 0x74, 0x00, 0x82, 0xf8, 0x51, 0x00, 0x94, 0xf8, 0x35, 0x01, 0x00, 0xeb, + 0x40, 0x00, 0x06, 0xeb, 0x40, 0x10, 0x00, 0xf1, 0x30, 0x01, 0x02, 0xf1, + 0x52, 0x00, 0xa8, 0x47, 0x94, 0xf8, 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, + 0x06, 0xeb, 0x40, 0x10, 0x00, 0xf1, 0x34, 0x01, 0x00, 0x98, 0x56, 0x30, + 0xa8, 0x47, 0xd4, 0xf8, 0x2c, 0x05, 0xd8, 0xb1, 0x01, 0x69, 0x08, 0x0e, + 0x0a, 0x0c, 0x0b, 0x0a, 0x1a, 0xe0, 0xbd, 0xe8, 0xf8, 0x83, 0x00, 0x98, + 0xdb, 0xf7, 0x30, 0xfb, 0x94, 0xf8, 0x35, 0x01, 0x16, 0x49, 0x00, 0xeb, + 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, 0x20, 0x21, 0x18, 0x30, 0xd7, 0xf7, + 0x87, 0xfe, 0xbd, 0xe8, 0xf8, 0x83, 0x00, 0x99, 0x20, 0x46, 0xff, 0xf7, + 0xeb, 0xfd, 0xea, 0xe7, 0x00, 0x20, 0x00, 0x22, 0x00, 0x23, 0x00, 0x21, + 0x00, 0x9d, 0x85, 0xf8, 0x5d, 0x00, 0x85, 0xf8, 0x5c, 0x20, 0x85, 0xf8, + 0x5b, 0x30, 0x85, 0xf8, 0x5a, 0x10, 0x94, 0xf8, 0x35, 0x01, 0x00, 0xeb, + 0x40, 0x00, 0x06, 0xeb, 0x40, 0x10, 0x00, 0xf1, 0x3c, 0x01, 0x05, 0xf1, + 0x5e, 0x00, 0xff, 0xf7, 0x6b, 0xfe, 0xd0, 0xe7, 0x28, 0x5e, 0x01, 0x00, + 0xe8, 0x72, 0x01, 0x00, 0x54, 0xf1, 0x05, 0x00, 0x2d, 0xe9, 0xfc, 0x47, + 0x78, 0xb3, 0x04, 0x46, 0x87, 0x48, 0x6a, 0x26, 0x01, 0x29, 0x0d, 0x46, + 0x01, 0xaa, 0x08, 0xbf, 0x49, 0x26, 0x31, 0x46, 0x03, 0x68, 0xff, 0x20, + 0x98, 0x47, 0x01, 0x98, 0x00, 0x28, 0x00, 0xf0, 0xff, 0x80, 0x81, 0x49, + 0x22, 0x46, 0x2b, 0x46, 0x0f, 0x68, 0x31, 0x46, 0xb8, 0x47, 0x03, 0x2d, + 0x1e, 0xd1, 0x7e, 0x4d, 0xd5, 0xf8, 0x94, 0x00, 0x00, 0xb3, 0x01, 0x9e, + 0x00, 0x20, 0x1c, 0x21, 0xb0, 0x72, 0x30, 0x71, 0x06, 0xf1, 0x13, 0x00, + 0xd8, 0xf7, 0xec, 0xfa, 0x06, 0xf1, 0x2f, 0x00, 0x05, 0xf1, 0x94, 0x01, + 0xff, 0xf7, 0x36, 0xfe, 0x01, 0x98, 0x01, 0x21, 0x80, 0xf8, 0x4b, 0x10, + 0xc6, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x1e, 0x21, 0xdb, 0xf7, 0xe4, 0xfa, + 0xbd, 0xe8, 0xfc, 0x87, 0x01, 0x99, 0x20, 0x46, 0xff, 0xf7, 0x8c, 0xfd, + 0x01, 0x98, 0xb9, 0xe0, 0x6c, 0x4d, 0x01, 0x98, 0xdf, 0xf8, 0xb0, 0x81, + 0xb5, 0xf8, 0x0c, 0x90, 0xb5, 0xf8, 0x0a, 0xa0, 0x2f, 0x8a, 0xee, 0x89, + 0x3a, 0x30, 0x05, 0xf1, 0x54, 0x01, 0xc0, 0x47, 0x01, 0x98, 0x05, 0xf1, + 0x58, 0x01, 0x3e, 0x30, 0xc0, 0x47, 0x01, 0x9a, 0xb8, 0x19, 0x01, 0x0a, + 0x82, 0xf8, 0x46, 0x00, 0x09, 0xeb, 0x0a, 0x00, 0x82, 0xf8, 0x47, 0x10, + 0x01, 0x0a, 0x82, 0xf8, 0x44, 0x00, 0x28, 0x7e, 0xe7, 0x4d, 0x82, 0xf8, + 0x45, 0x10, 0x82, 0xf8, 0x48, 0x00, 0x5c, 0x48, 0x80, 0x7b, 0x82, 0xf8, + 0x49, 0x00, 0x94, 0xf8, 0x74, 0x00, 0x82, 0xf8, 0x4a, 0x00, 0x94, 0xf8, + 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, 0x05, 0xeb, 0x40, 0x10, 0x00, 0xf1, + 0x30, 0x01, 0x02, 0xf1, 0x4c, 0x00, 0xc0, 0x47, 0x94, 0xf8, 0x35, 0x01, + 0x00, 0xeb, 0x40, 0x00, 0x05, 0xeb, 0x40, 0x10, 0x00, 0xf1, 0x34, 0x01, + 0x01, 0x98, 0x50, 0x30, 0xc0, 0x47, 0xd4, 0xf8, 0x2c, 0x05, 0x20, 0xb1, + 0x01, 0x69, 0x08, 0x0e, 0x0a, 0x0c, 0x0b, 0x0a, 0x03, 0xe0, 0x00, 0x20, + 0x00, 0x22, 0x00, 0x23, 0x00, 0x21, 0x01, 0x9e, 0x86, 0xf8, 0x57, 0x00, + 0x86, 0xf8, 0x56, 0x20, 0x86, 0xf8, 0x55, 0x30, 0x86, 0xf8, 0x54, 0x10, + 0x94, 0xf8, 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, 0x05, 0xeb, 0x40, 0x10, + 0x00, 0xf1, 0x3c, 0x01, 0x06, 0xf1, 0x58, 0x00, 0xff, 0xf7, 0xc0, 0xfd, + 0x94, 0xf8, 0xa4, 0x04, 0x41, 0x07, 0x2a, 0xd5, 0x00, 0x07, 0x28, 0xd4, + 0x01, 0x9e, 0x00, 0x20, 0x86, 0xf8, 0x5c, 0x00, 0x86, 0xf8, 0x4b, 0x00, + 0x37, 0x48, 0x00, 0x68, 0xd7, 0xf7, 0xe8, 0xfd, 0x86, 0xf8, 0x42, 0x00, + 0x00, 0x0a, 0x86, 0xf8, 0x43, 0x00, 0x94, 0xf8, 0x35, 0x01, 0x00, 0xeb, + 0x40, 0x00, 0x05, 0xeb, 0x40, 0x10, 0x00, 0xf1, 0x44, 0x01, 0x06, 0xf1, + 0x60, 0x00, 0xff, 0xf7, 0x9f, 0xfd, 0x94, 0xf8, 0x35, 0x01, 0x00, 0xeb, + 0x40, 0x00, 0x05, 0xeb, 0x40, 0x10, 0x00, 0xf1, 0x4c, 0x01, 0x01, 0x98, + 0x68, 0x30, 0xff, 0xf7, 0x93, 0xfd, 0x01, 0x98, 0x23, 0xe0, 0x94, 0xf8, + 0x32, 0x04, 0x26, 0x49, 0x01, 0x9e, 0x00, 0xeb, 0x40, 0x00, 0x51, 0xf8, + 0x20, 0x00, 0x01, 0x21, 0x86, 0xf8, 0x4b, 0x10, 0xd7, 0xf7, 0xbc, 0xfd, + 0x86, 0xf8, 0x42, 0x00, 0x00, 0x0a, 0x86, 0xf8, 0x43, 0x00, 0x94, 0xf8, + 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, 0x05, 0xeb, 0x40, 0x10, 0x00, 0xf1, + 0x40, 0x01, 0x06, 0xf1, 0x5c, 0x00, 0xff, 0xf7, 0x73, 0xfd, 0x01, 0x98, + 0x00, 0x21, 0x80, 0xf8, 0x68, 0x10, 0x80, 0xf8, 0x60, 0x10, 0x00, 0x21, + 0x80, 0xf8, 0x64, 0x10, 0xdb, 0xf7, 0x02, 0xfa, 0x94, 0xf8, 0x35, 0x01, + 0x98, 0x4d, 0x20, 0x21, 0x00, 0xeb, 0x40, 0x00, 0x05, 0xeb, 0x40, 0x10, + 0x18, 0x30, 0xd7, 0xf7, 0x59, 0xfd, 0x94, 0xf8, 0x35, 0x01, 0x00, 0x21, + 0x00, 0xeb, 0x40, 0x00, 0x05, 0xeb, 0x40, 0x10, 0xc0, 0xe9, 0x10, 0x11, + 0xc0, 0xe9, 0x12, 0x11, 0xbd, 0xe8, 0xfc, 0x87, 0x24, 0x9c, 0x08, 0x00, + 0x1c, 0x9c, 0x08, 0x00, 0x4c, 0x49, 0x01, 0x00, 0xe0, 0x76, 0x01, 0x00, + 0x51, 0xb3, 0x04, 0x00, 0xa4, 0x4a, 0x01, 0x00, 0x6c, 0xf0, 0x05, 0x00, + 0x10, 0x5e, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x43, 0x00, 0x28, 0x00, 0xf0, + 0xce, 0x80, 0xd0, 0xf8, 0x14, 0x90, 0x05, 0x46, 0xb9, 0xf1, 0x00, 0x0f, + 0x00, 0xf0, 0xc7, 0x80, 0x0e, 0x46, 0x01, 0x29, 0x00, 0xf0, 0xc3, 0x80, + 0x79, 0x48, 0x78, 0x4c, 0x6a, 0x46, 0x6a, 0x21, 0x03, 0x68, 0xd4, 0xf8, + 0x00, 0x80, 0xff, 0x20, 0x98, 0x47, 0x00, 0x98, 0x00, 0x28, 0x00, 0xf0, + 0xb6, 0x80, 0x74, 0x49, 0x4a, 0x46, 0x33, 0x46, 0x0f, 0x68, 0x6a, 0x21, + 0xb8, 0x47, 0x14, 0xf8, 0x04, 0x0f, 0x00, 0x9f, 0x04, 0x2e, 0x87, 0xf8, + 0x2b, 0x00, 0x60, 0x78, 0x87, 0xf8, 0x2c, 0x00, 0x40, 0xf0, 0xa7, 0x80, + 0x40, 0x46, 0xd7, 0xf7, 0x47, 0xfd, 0x87, 0xf8, 0x3a, 0x00, 0x00, 0x0a, + 0x87, 0xf8, 0x3b, 0x00, 0x95, 0xf8, 0xa0, 0x00, 0x87, 0xf8, 0x3c, 0x00, + 0x95, 0xf8, 0xa1, 0x00, 0x87, 0xf8, 0x3d, 0x00, 0x64, 0x48, 0x01, 0x68, + 0x95, 0xf8, 0xa8, 0x00, 0x88, 0x47, 0x00, 0x9a, 0x82, 0xf8, 0x3e, 0x00, + 0x61, 0x48, 0x01, 0x78, 0x43, 0x78, 0x82, 0xf8, 0x3f, 0x10, 0x01, 0x46, + 0x82, 0xf8, 0x40, 0x30, 0x11, 0xf8, 0x02, 0x3f, 0x82, 0xf8, 0x41, 0x30, + 0x03, 0x46, 0x49, 0x78, 0x13, 0xf8, 0x04, 0x4f, 0x82, 0xf8, 0x42, 0x10, + 0x82, 0xf8, 0x43, 0x40, 0x04, 0x46, 0x59, 0x78, 0x14, 0xf8, 0x06, 0x5f, + 0x82, 0xf8, 0x44, 0x10, 0x61, 0x78, 0x82, 0xf8, 0x45, 0x50, 0x00, 0x25, + 0x82, 0xf8, 0x4c, 0x50, 0x82, 0xf8, 0x4b, 0x50, 0x82, 0xf8, 0x46, 0x10, + 0x01, 0x46, 0x11, 0xf8, 0x08, 0x3f, 0x82, 0xf8, 0x47, 0x30, 0x03, 0x46, + 0x49, 0x78, 0x13, 0xf8, 0x0a, 0x4f, 0x82, 0xf8, 0x48, 0x10, 0x82, 0xf8, + 0x49, 0x40, 0x04, 0x46, 0x59, 0x78, 0x14, 0xf8, 0x0c, 0x6f, 0x82, 0xf8, + 0x4a, 0x10, 0x82, 0xf8, 0x4d, 0x60, 0x06, 0x46, 0x61, 0x78, 0x16, 0xf8, + 0x0e, 0x7f, 0x82, 0xf8, 0x4e, 0x10, 0x71, 0x78, 0x82, 0xf8, 0x4f, 0x70, + 0x41, 0x4e, 0x82, 0xf8, 0x50, 0x10, 0x01, 0x46, 0x11, 0xf8, 0x10, 0x3f, + 0x49, 0x78, 0x82, 0xf8, 0x51, 0x30, 0x82, 0xf8, 0x52, 0x10, 0x10, 0xf8, + 0x18, 0x1f, 0x82, 0xf8, 0x59, 0x10, 0x10, 0xf8, 0x02, 0x1d, 0x82, 0xf8, + 0x57, 0x10, 0x10, 0xf8, 0x02, 0x1d, 0x82, 0xf8, 0x55, 0x10, 0x10, 0xf8, + 0x02, 0x1d, 0x82, 0xf8, 0x53, 0x10, 0x41, 0x78, 0xc3, 0x78, 0x44, 0x79, + 0xc0, 0x79, 0x82, 0xf8, 0x54, 0x10, 0x82, 0xf8, 0x56, 0x30, 0x82, 0xf8, + 0x58, 0x40, 0x82, 0xf8, 0x5a, 0x00, 0x99, 0xf8, 0x74, 0x00, 0x82, 0xf8, + 0x5b, 0x00, 0x99, 0xf8, 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, 0x06, 0xeb, + 0x40, 0x10, 0x00, 0xf1, 0x30, 0x01, 0x02, 0xf1, 0x5c, 0x00, 0xff, 0xf7, + 0x81, 0xfc, 0x99, 0xf8, 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, 0x06, 0xeb, + 0x40, 0x10, 0x00, 0xf1, 0x34, 0x01, 0x00, 0x98, 0x60, 0x30, 0xff, 0xf7, + 0x75, 0xfc, 0xd9, 0xf8, 0x2c, 0x05, 0x58, 0xb1, 0x00, 0x69, 0x05, 0x0e, + 0x01, 0x0c, 0x02, 0x0a, 0x09, 0xe0, 0xbd, 0xe8, 0xf8, 0x83, 0x48, 0x46, + 0x39, 0x46, 0xff, 0xf7, 0xcd, 0xfb, 0x17, 0xe0, 0x00, 0x21, 0x00, 0x22, + 0x00, 0x20, 0x00, 0x9b, 0x83, 0xf8, 0x67, 0x50, 0x83, 0xf8, 0x66, 0x10, + 0x83, 0xf8, 0x65, 0x20, 0x83, 0xf8, 0x64, 0x00, 0x99, 0xf8, 0x35, 0x01, + 0x00, 0xeb, 0x40, 0x00, 0x06, 0xeb, 0x40, 0x10, 0x00, 0xf1, 0x3c, 0x01, + 0x03, 0xf1, 0x68, 0x00, 0xff, 0xf7, 0x4e, 0xfc, 0x00, 0x98, 0xdb, 0xf7, + 0xe5, 0xf8, 0x99, 0xf8, 0x35, 0x01, 0x0a, 0x49, 0x00, 0xeb, 0x40, 0x00, + 0x01, 0xeb, 0x40, 0x10, 0x20, 0x21, 0x18, 0x30, 0xd7, 0xf7, 0x3c, 0xfc, + 0xbd, 0xe8, 0xf8, 0x83, 0x34, 0x5e, 0x01, 0x00, 0x24, 0x9c, 0x08, 0x00, + 0x1c, 0x9c, 0x08, 0x00, 0x80, 0xc5, 0x08, 0x00, 0x40, 0x5e, 0x01, 0x00, + 0x54, 0xf1, 0x05, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x87, 0xb0, 0x82, 0x78, + 0xc1, 0x78, 0x07, 0x2a, 0x04, 0xd0, 0x0f, 0x2a, 0x1d, 0xd1, 0x00, 0x26, + 0x0d, 0x24, 0x01, 0xe0, 0x01, 0x26, 0x05, 0x24, 0x02, 0x29, 0x1a, 0xd0, + 0x01, 0x29, 0x24, 0xd0, 0x91, 0xbb, 0x01, 0x79, 0x90, 0xf8, 0x06, 0xe0, + 0x02, 0x7a, 0x47, 0x7a, 0x90, 0xf9, 0x07, 0xc0, 0x90, 0xf9, 0x05, 0x50, + 0xcd, 0xe9, 0x05, 0x27, 0x46, 0xb3, 0x00, 0x23, 0x4f, 0xf0, 0x00, 0x08, + 0x4f, 0xf0, 0x00, 0x0a, 0x4f, 0xf0, 0x00, 0x0b, 0x65, 0xe0, 0x12, 0x25, + 0x00, 0x26, 0x0d, 0x24, 0xea, 0xe0, 0x9a, 0x48, 0x00, 0x21, 0x00, 0x25, + 0x02, 0x68, 0x05, 0x20, 0x90, 0x47, 0x99, 0x48, 0xc0, 0xe9, 0x01, 0x55, + 0x96, 0x48, 0x05, 0x60, 0xde, 0xe0, 0x90, 0xf9, 0x07, 0x80, 0x90, 0xf8, + 0x04, 0xc0, 0x90, 0xf8, 0x06, 0xe0, 0x90, 0xf9, 0x05, 0x50, 0xb6, 0xb1, + 0x4f, 0xf0, 0x00, 0x09, 0x00, 0x21, 0x00, 0x22, 0x00, 0x23, 0xb4, 0xe0, + 0x12, 0x25, 0xcd, 0xe0, 0x8d, 0x4f, 0x01, 0x23, 0xb5, 0xf1, 0xff, 0x3f, + 0x3b, 0x70, 0x11, 0xdd, 0x4f, 0xf0, 0x00, 0x09, 0x4f, 0xf0, 0x00, 0x08, + 0x4f, 0xf0, 0x00, 0x0a, 0x4f, 0xf0, 0x00, 0x0b, 0x1c, 0xe0, 0xb5, 0xf1, + 0xff, 0x3f, 0x76, 0xdd, 0x4f, 0xf0, 0x00, 0x09, 0x00, 0x21, 0x00, 0x22, + 0x00, 0x23, 0x83, 0xe0, 0x90, 0xf8, 0x0a, 0xb0, 0x90, 0xf8, 0x0b, 0xa0, + 0x90, 0xf8, 0x0c, 0x80, 0x7b, 0x70, 0x43, 0x7b, 0x4b, 0xea, 0x0a, 0x22, + 0x42, 0xea, 0x08, 0x49, 0x7a, 0x68, 0x42, 0xea, 0x09, 0x02, 0x99, 0x46, + 0x42, 0xea, 0x03, 0x62, 0x7a, 0x60, 0x05, 0x9a, 0xbc, 0xf1, 0xff, 0x3f, + 0x13, 0xdc, 0x01, 0x22, 0x03, 0x7c, 0xba, 0x70, 0x82, 0x7b, 0x03, 0x92, + 0xc2, 0x7b, 0x40, 0x7c, 0x04, 0x90, 0x03, 0x98, 0x40, 0xea, 0x02, 0x22, + 0xb8, 0x68, 0x42, 0xea, 0x03, 0x42, 0x10, 0x43, 0xdd, 0xe9, 0x04, 0x32, + 0x40, 0xea, 0x03, 0x60, 0xb8, 0x60, 0x06, 0x9f, 0x4b, 0x46, 0xe8, 0xb2, + 0xdf, 0xf8, 0x54, 0x91, 0x11, 0xf0, 0x0c, 0x0f, 0x41, 0xea, 0x00, 0x20, + 0x40, 0xea, 0x0e, 0x40, 0x40, 0xea, 0x0c, 0x65, 0x0f, 0xd1, 0x4f, 0xea, + 0x08, 0x40, 0x1f, 0x46, 0x40, 0xea, 0x03, 0x60, 0x40, 0xea, 0x0a, 0x20, + 0x00, 0xeb, 0x0b, 0x01, 0x28, 0x46, 0x00, 0xf0, 0x97, 0xf8, 0x3b, 0x46, + 0xdd, 0xe9, 0x05, 0x27, 0x30, 0xb1, 0x42, 0xea, 0x07, 0x20, 0x0a, 0x28, + 0x98, 0xbf, 0x0a, 0x20, 0xa9, 0xf8, 0x04, 0x00, 0x01, 0x20, 0x89, 0xf8, + 0x0a, 0x00, 0xd9, 0xf8, 0x00, 0x00, 0x28, 0x43, 0xc9, 0xf8, 0x00, 0x00, + 0x4f, 0xea, 0x08, 0x40, 0x40, 0xea, 0x03, 0x60, 0x40, 0xea, 0x0a, 0x20, + 0x00, 0xeb, 0x0b, 0x01, 0x28, 0x46, 0x00, 0xf0, 0x79, 0xf8, 0x00, 0x25, + 0x00, 0x28, 0x4f, 0xd0, 0xb1, 0x48, 0xb9, 0xf8, 0x04, 0x20, 0x00, 0x21, + 0x07, 0x68, 0x05, 0x20, 0x13, 0x46, 0xcd, 0xe9, 0x00, 0x55, 0xb8, 0x47, + 0x44, 0xe0, 0x83, 0x7a, 0xc2, 0x7a, 0x01, 0x7b, 0x90, 0xf8, 0x0d, 0x90, + 0xdf, 0xf8, 0xc0, 0xa0, 0x43, 0xea, 0x02, 0x27, 0x47, 0xea, 0x01, 0x47, + 0x47, 0xea, 0x09, 0x6b, 0xda, 0xf8, 0x04, 0x70, 0x27, 0xea, 0x0b, 0x07, + 0xca, 0xf8, 0x04, 0x70, 0xb8, 0xf1, 0xff, 0x3f, 0x13, 0xdc, 0x90, 0xf8, + 0x0e, 0xa0, 0xc7, 0x7b, 0x90, 0xf8, 0x10, 0xb0, 0x40, 0x7c, 0x4a, 0xea, + 0x07, 0x27, 0xdf, 0xf8, 0x90, 0xa0, 0x47, 0xea, 0x0b, 0x47, 0x47, 0xea, + 0x00, 0x60, 0xda, 0xf8, 0x08, 0x70, 0x27, 0xea, 0x00, 0x00, 0xca, 0xf8, + 0x08, 0x00, 0xe8, 0xb2, 0x4c, 0xea, 0x00, 0x20, 0x40, 0xea, 0x0e, 0x40, + 0x40, 0xea, 0x08, 0x65, 0x08, 0x04, 0x40, 0xea, 0x09, 0x60, 0x40, 0xea, + 0x02, 0x20, 0xc1, 0x18, 0x28, 0x46, 0x00, 0xf0, 0x31, 0xf8, 0x20, 0xb1, + 0x29, 0x48, 0x00, 0x21, 0x02, 0x68, 0x05, 0x20, 0x90, 0x47, 0x28, 0x48, + 0x01, 0x68, 0xa9, 0x43, 0x00, 0x25, 0x01, 0x60, 0x20, 0x46, 0x4f, 0xf6, + 0x5e, 0x51, 0x2a, 0x46, 0xda, 0xf7, 0xda, 0xff, 0xb8, 0xb1, 0x22, 0x49, + 0x04, 0x46, 0x06, 0x30, 0xff, 0xf7, 0x10, 0xfb, 0x5e, 0xb9, 0x20, 0x4d, + 0x04, 0xf1, 0x0a, 0x00, 0x29, 0x1d, 0xff, 0xf7, 0x09, 0xfb, 0x04, 0xf1, + 0x0e, 0x00, 0x05, 0xf1, 0x08, 0x01, 0xff, 0xf7, 0x03, 0xfb, 0x20, 0x46, + 0x07, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0xda, 0xf7, 0x97, 0xbf, 0x07, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0x78, 0xf0, 0x05, 0x00, 0x28, 0x5e, 0x01, 0x00, + 0xc0, 0x07, 0x1c, 0xbf, 0x01, 0x20, 0x70, 0x47, 0x11, 0xf0, 0x03, 0x00, + 0x18, 0xbf, 0x01, 0x20, 0x70, 0x47, 0x00, 0xbf, 0x10, 0xb5, 0x0c, 0x48, + 0x00, 0x21, 0x00, 0x24, 0x02, 0x68, 0x05, 0x20, 0x90, 0x47, 0x0a, 0x48, + 0x2c, 0x21, 0xc0, 0xe9, 0x00, 0x44, 0x84, 0x60, 0x08, 0x48, 0xc0, 0xe9, + 0x00, 0x44, 0x84, 0x60, 0x9c, 0x48, 0xd7, 0xf7, 0xd5, 0xfa, 0xb7, 0x48, + 0xc0, 0xe9, 0x00, 0x44, 0xc0, 0xe9, 0x02, 0x44, 0x10, 0xbd, 0x00, 0xbf, + 0xf8, 0xcd, 0x08, 0x00, 0x28, 0x5e, 0x01, 0x00, 0x78, 0xf0, 0x05, 0x00, + 0x2d, 0xe9, 0xfc, 0x47, 0xf7, 0x4d, 0x04, 0x46, 0x90, 0xf8, 0x35, 0x81, + 0x16, 0x46, 0x89, 0x46, 0x28, 0x78, 0x48, 0xb1, 0x68, 0x78, 0x00, 0x28, + 0x41, 0xd0, 0x28, 0x79, 0x40, 0x07, 0x3e, 0xd5, 0x4f, 0xf0, 0x10, 0x0a, + 0x09, 0x27, 0x06, 0xe0, 0xed, 0x48, 0xc0, 0x78, 0x40, 0x06, 0x36, 0xd5, + 0x4f, 0xf0, 0x1f, 0x0a, 0x08, 0x27, 0xec, 0x48, 0x01, 0xaa, 0x39, 0x46, + 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, 0x01, 0x98, 0x58, 0xb3, 0x02, 0x30, + 0x39, 0x46, 0xd7, 0xf7, 0x55, 0xff, 0x01, 0x99, 0x58, 0x20, 0x88, 0x70, + 0x29, 0x78, 0x01, 0x98, 0x80, 0xf8, 0x03, 0xa0, 0x01, 0x98, 0x79, 0xb1, + 0x00, 0x21, 0x06, 0x72, 0x80, 0xf8, 0x07, 0x90, 0x80, 0xf8, 0x05, 0x80, + 0x81, 0x71, 0x03, 0x21, 0x01, 0x71, 0x94, 0xf8, 0x74, 0x10, 0x41, 0x72, + 0x94, 0xf8, 0x3a, 0x10, 0x81, 0x72, 0x0c, 0xe0, 0x00, 0x21, 0xc6, 0x71, + 0x80, 0xf8, 0x06, 0x90, 0x80, 0xf8, 0x04, 0x80, 0x41, 0x71, 0x94, 0xf8, + 0x74, 0x10, 0x01, 0x72, 0x94, 0xf8, 0x3a, 0x10, 0x41, 0x72, 0xda, 0xf7, + 0x17, 0xff, 0xbd, 0xe8, 0xfc, 0x87, 0x00, 0xbf, 0x2d, 0xe9, 0xfc, 0x41, + 0x0c, 0x46, 0xce, 0x49, 0x05, 0x46, 0xcc, 0x48, 0x95, 0xf8, 0x35, 0x61, + 0x09, 0x78, 0x00, 0x68, 0x21, 0xb1, 0x40, 0xb2, 0x00, 0x28, 0x07, 0xd4, + 0xbd, 0xe8, 0xfc, 0x81, 0xb0, 0xf1, 0xff, 0x3f, 0xfa, 0xdc, 0x4f, 0xf0, + 0x20, 0x08, 0x01, 0xe0, 0x4f, 0xf0, 0x08, 0x08, 0xc4, 0x48, 0x01, 0xaa, + 0x39, 0x21, 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, 0x01, 0x9f, 0x00, 0x2f, + 0xec, 0xd0, 0xf8, 0x1c, 0x38, 0x21, 0xd7, 0xf7, 0x05, 0xff, 0x58, 0x20, + 0xb8, 0x70, 0x01, 0x98, 0x80, 0xf8, 0x03, 0x80, 0x00, 0x20, 0x01, 0x99, + 0x88, 0x71, 0x4e, 0x71, 0xd5, 0xf8, 0xd4, 0x00, 0x40, 0x7f, 0xc8, 0x71, + 0x95, 0xf8, 0x3a, 0x00, 0x08, 0x72, 0x95, 0xf8, 0xf0, 0x00, 0x48, 0x73, + 0x95, 0xf8, 0xf1, 0x00, 0x88, 0x73, 0xd5, 0xf8, 0xd4, 0x00, 0xd5, 0xf7, + 0x01, 0xfd, 0x01, 0x9b, 0x01, 0x0e, 0x05, 0xf5, 0x80, 0x72, 0x99, 0x74, + 0x01, 0x0c, 0xd8, 0x73, 0x59, 0x74, 0x01, 0x0a, 0x03, 0xf1, 0x33, 0x00, + 0x19, 0x74, 0x06, 0x21, 0x06, 0x23, 0xd5, 0xf7, 0x93, 0xf8, 0xae, 0x49, + 0x01, 0x98, 0x09, 0x78, 0x80, 0xf8, 0x3a, 0x40, 0x80, 0xf8, 0x39, 0x10, + 0xda, 0xf7, 0xbc, 0xfe, 0xbd, 0xe8, 0xfc, 0x81, 0x1c, 0xb5, 0x00, 0xf0, + 0x17, 0xf8, 0x00, 0xf0, 0x7b, 0xf8, 0x9f, 0x48, 0x01, 0x78, 0xc9, 0x07, + 0x0a, 0xd1, 0x82, 0x88, 0x06, 0x48, 0x00, 0x21, 0x04, 0x68, 0x00, 0x20, + 0x13, 0x46, 0xcd, 0xe9, 0x00, 0x00, 0x05, 0x20, 0xa0, 0x47, 0x1c, 0xbd, + 0xbd, 0xe8, 0x1c, 0x40, 0x00, 0xf0, 0xaa, 0xb9, 0x00, 0xce, 0x08, 0x00, + 0xbc, 0xb5, 0x00, 0x20, 0x01, 0x90, 0x94, 0x48, 0x41, 0x78, 0x11, 0xb1, + 0x00, 0x79, 0xc0, 0x07, 0x00, 0xd1, 0xbc, 0xbd, 0x91, 0x48, 0x01, 0xaa, + 0x2b, 0x21, 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, 0x01, 0x9c, 0x00, 0x2c, + 0xf5, 0xd0, 0xe0, 0x1c, 0x2a, 0x21, 0xd7, 0xf7, 0x9f, 0xfe, 0x58, 0x20, + 0x8e, 0x4d, 0xa0, 0x70, 0x10, 0x20, 0x24, 0x4c, 0x01, 0x99, 0xc8, 0x70, + 0x01, 0x20, 0x01, 0x9a, 0x10, 0x71, 0xd4, 0xe9, 0x00, 0x01, 0x40, 0x1a, + 0x38, 0xbf, 0x4f, 0xf0, 0xff, 0x30, 0x01, 0x0c, 0x50, 0x71, 0xd1, 0x71, + 0x01, 0x0a, 0x00, 0x0e, 0x91, 0x71, 0x10, 0x72, 0x04, 0xf1, 0x08, 0x01, + 0x02, 0xf1, 0x09, 0x00, 0xa8, 0x47, 0x01, 0x98, 0x04, 0xf1, 0x0c, 0x01, + 0x0d, 0x30, 0xa8, 0x47, 0x01, 0x98, 0x04, 0xf1, 0x10, 0x01, 0x11, 0x30, + 0xa8, 0x47, 0x01, 0x98, 0x04, 0xf1, 0x14, 0x01, 0x15, 0x30, 0xa8, 0x47, + 0x01, 0x98, 0x04, 0xf1, 0x18, 0x01, 0x19, 0x30, 0xa8, 0x47, 0x01, 0x98, + 0x04, 0xf1, 0x1c, 0x01, 0x1d, 0x30, 0xa8, 0x47, 0x01, 0x98, 0x04, 0xf1, + 0x20, 0x01, 0x21, 0x30, 0xa8, 0x47, 0x01, 0x98, 0x04, 0xf1, 0x24, 0x01, + 0x25, 0x30, 0xa8, 0x47, 0x01, 0x98, 0x04, 0xf1, 0x28, 0x01, 0x29, 0x30, + 0xa8, 0x47, 0x01, 0x98, 0xda, 0xf7, 0x42, 0xfe, 0x20, 0x46, 0x2c, 0x21, + 0xd7, 0xf7, 0xa0, 0xf9, 0xbc, 0xbd, 0x00, 0xbf, 0x84, 0xf0, 0x05, 0x00, + 0x7c, 0xb5, 0x00, 0x20, 0x01, 0x90, 0x61, 0x48, 0x41, 0x78, 0x69, 0xb3, + 0x00, 0x79, 0x80, 0x07, 0x2a, 0xd5, 0x5f, 0x48, 0x01, 0xaa, 0x13, 0x21, + 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, 0x01, 0x9c, 0x14, 0xb3, 0xe0, 0x1c, + 0x12, 0x21, 0xd7, 0xf7, 0x3b, 0xfe, 0x58, 0x20, 0x5c, 0x4d, 0xa0, 0x70, + 0x10, 0x20, 0x0e, 0x4c, 0x01, 0x99, 0xc8, 0x70, 0x02, 0x20, 0x01, 0x99, + 0x08, 0x71, 0x48, 0x1d, 0x21, 0x46, 0xa8, 0x47, 0x01, 0x98, 0x21, 0x1d, + 0x09, 0x30, 0xa8, 0x47, 0x01, 0x98, 0x00, 0x26, 0x04, 0xf1, 0x0c, 0x01, + 0x46, 0x73, 0x11, 0x30, 0xa8, 0x47, 0x01, 0x98, 0xda, 0xf7, 0x0a, 0xfe, + 0xc4, 0xe9, 0x00, 0x66, 0xc4, 0xe9, 0x02, 0x66, 0x7c, 0xbd, 0x00, 0xbf, + 0xb0, 0xf0, 0x05, 0x00, 0x04, 0x29, 0x38, 0xbf, 0x00, 0x20, 0x00, 0xf0, + 0x0b, 0xb9, 0x00, 0xbf, 0x2d, 0xe9, 0xfc, 0x47, 0x88, 0x46, 0x42, 0x49, + 0x05, 0x46, 0x40, 0x48, 0x95, 0xf8, 0x35, 0xa1, 0x09, 0x78, 0x00, 0x68, + 0x21, 0xb1, 0x40, 0xb2, 0x00, 0x28, 0x07, 0xd4, 0xbd, 0xe8, 0xfc, 0x87, + 0xb0, 0xf1, 0xff, 0x3f, 0xfa, 0xdc, 0x4f, 0xf0, 0x20, 0x09, 0x01, 0xe0, + 0x4f, 0xf0, 0x08, 0x09, 0x38, 0x48, 0x01, 0xaa, 0x39, 0x21, 0xff, 0x27, + 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, 0x95, 0xf8, 0xf2, 0x42, 0x03, 0x2c, + 0x01, 0xd8, 0x34, 0x48, 0x07, 0x5d, 0x01, 0x9e, 0x00, 0x2e, 0xe5, 0xd0, + 0xf0, 0x1c, 0x38, 0x21, 0xd7, 0xf7, 0xe6, 0xfd, 0x58, 0x20, 0x37, 0x71, + 0x00, 0x27, 0x05, 0x2c, 0x2e, 0x4a, 0xb0, 0x70, 0x01, 0x98, 0x80, 0xf8, + 0x03, 0x90, 0x01, 0x98, 0x87, 0x71, 0x80, 0xf8, 0x05, 0xa0, 0xd5, 0xf8, + 0xd4, 0x10, 0x49, 0x7f, 0xc1, 0x71, 0x4f, 0xf0, 0x03, 0x01, 0x4f, 0xf0, + 0x04, 0x00, 0x38, 0xbf, 0x02, 0x21, 0x04, 0x2c, 0x28, 0xbf, 0x04, 0x46, + 0x05, 0xeb, 0xc4, 0x00, 0x12, 0x68, 0x90, 0xf8, 0xbc, 0x03, 0x90, 0x47, + 0x01, 0x9a, 0x21, 0x49, 0x21, 0x4e, 0x10, 0x72, 0x95, 0xf8, 0x3a, 0x00, + 0x50, 0x72, 0x95, 0xf8, 0xf0, 0x00, 0x50, 0x73, 0x95, 0xf8, 0xf1, 0x00, + 0x90, 0x73, 0xb5, 0xf8, 0x14, 0x03, 0x57, 0x74, 0x97, 0x74, 0xd0, 0x73, + 0x00, 0x0a, 0x10, 0x74, 0x0a, 0xeb, 0x4a, 0x00, 0x01, 0xeb, 0x40, 0x14, + 0x02, 0xf1, 0x13, 0x00, 0x04, 0xf1, 0x18, 0x01, 0xb0, 0x47, 0x01, 0x98, + 0x04, 0xf1, 0x1c, 0x01, 0x17, 0x30, 0xb0, 0x47, 0x01, 0x98, 0x04, 0xf1, + 0x20, 0x01, 0x1b, 0x30, 0xb0, 0x47, 0x01, 0x98, 0x05, 0xf5, 0x30, 0x72, + 0x06, 0x21, 0x04, 0x23, 0x33, 0x30, 0xd4, 0xf7, 0x4f, 0xff, 0x0c, 0x49, + 0x01, 0x98, 0x09, 0x78, 0x80, 0xf8, 0x3a, 0x80, 0x80, 0xf8, 0x39, 0x10, + 0xda, 0xf7, 0x78, 0xfd, 0xbd, 0xe8, 0xfc, 0x87, 0x28, 0x5e, 0x01, 0x00, + 0x78, 0xf0, 0x05, 0x00, 0x24, 0x9c, 0x08, 0x00, 0xac, 0xc2, 0x04, 0x00, + 0x34, 0x9c, 0x08, 0x00, 0x54, 0xf1, 0x05, 0x00, 0x51, 0xb3, 0x04, 0x00, + 0xb6, 0x35, 0x01, 0x00, 0x13, 0x48, 0x14, 0x49, 0x01, 0x60, 0x14, 0x48, + 0x14, 0x49, 0x01, 0x60, 0x14, 0x48, 0x15, 0x49, 0x01, 0x60, 0x15, 0x48, + 0x15, 0x49, 0x01, 0x60, 0x15, 0x48, 0x16, 0x49, 0x01, 0x60, 0x16, 0x48, + 0x16, 0x49, 0x01, 0x60, 0x16, 0x48, 0x17, 0x49, 0x01, 0x60, 0x17, 0x48, + 0x17, 0x49, 0x01, 0x60, 0x17, 0x48, 0x18, 0x49, 0x01, 0x60, 0x18, 0x48, + 0x18, 0x49, 0x01, 0x60, 0x18, 0x48, 0x19, 0x49, 0x01, 0x60, 0x19, 0x48, + 0x19, 0x49, 0x01, 0x60, 0x19, 0x48, 0x1a, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x2c, 0xe5, 0x08, 0x00, 0xa5, 0xaf, 0x04, 0x00, 0xec, 0xcd, 0x08, 0x00, + 0x91, 0xaf, 0x04, 0x00, 0xfc, 0xa1, 0x08, 0x00, 0x51, 0xb0, 0x04, 0x00, + 0xf0, 0xcd, 0x08, 0x00, 0xb5, 0xb1, 0x04, 0x00, 0x1c, 0x9c, 0x08, 0x00, + 0x65, 0xb3, 0x04, 0x00, 0x48, 0xc3, 0x08, 0x00, 0xa9, 0xb4, 0x04, 0x00, + 0xe8, 0xcd, 0x08, 0x00, 0x89, 0xb6, 0x04, 0x00, 0xe0, 0xcd, 0x08, 0x00, + 0xd1, 0xb8, 0x04, 0x00, 0xc4, 0x8d, 0x08, 0x00, 0x79, 0xbd, 0x04, 0x00, + 0xc8, 0xdc, 0x08, 0x00, 0xb9, 0xbd, 0x04, 0x00, 0xac, 0xe5, 0x08, 0x00, + 0x5d, 0xbe, 0x04, 0x00, 0x90, 0xa8, 0x08, 0x00, 0x11, 0xbf, 0x04, 0x00, + 0x14, 0xc0, 0x08, 0x00, 0x81, 0xc0, 0x04, 0x00, 0x45, 0xf2, 0xb9, 0x3c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0x1d, 0x0c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf2, 0x37, 0x4c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x46, 0xf2, 0x6d, 0x2c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf2, 0x15, 0x4c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x52, 0x53, 0x54, 0x55, + 0xf0, 0xb5, 0x33, 0x4c, 0x4f, 0xf0, 0x00, 0x0c, 0x22, 0x78, 0xc2, 0xb1, + 0x31, 0x4d, 0x00, 0x22, 0x8a, 0x42, 0x16, 0xd0, 0x55, 0xf8, 0x22, 0x60, + 0x02, 0xeb, 0x42, 0x03, 0x01, 0x32, 0x03, 0x44, 0x96, 0xf8, 0x35, 0x71, + 0x83, 0xf8, 0x39, 0xc0, 0x83, 0xf8, 0x38, 0x70, 0xd6, 0xf8, 0xd4, 0x60, + 0x76, 0x7f, 0x83, 0xf8, 0x3a, 0x60, 0x23, 0x78, 0x9a, 0x42, 0xe9, 0xd3, + 0x02, 0xe0, 0x00, 0x22, 0x00, 0xe0, 0x0a, 0x46, 0x24, 0x4c, 0x00, 0x26, + 0x8a, 0x42, 0x18, 0xda, 0x35, 0x46, 0x26, 0x68, 0x8e, 0xb1, 0xb3, 0x68, + 0x7b, 0xb1, 0x02, 0xeb, 0x42, 0x03, 0x96, 0xf8, 0xb9, 0x70, 0x01, 0x32, + 0x03, 0x44, 0x83, 0xf8, 0x39, 0xc0, 0x83, 0xf8, 0x38, 0x70, 0x76, 0x69, + 0xd6, 0xf8, 0xd4, 0x60, 0x76, 0x7f, 0x83, 0xf8, 0x3a, 0x60, 0x04, 0x34, + 0x01, 0x26, 0x00, 0x2d, 0xe4, 0xd0, 0xdf, 0xf8, 0x5c, 0xc0, 0x9c, 0xf8, + 0x00, 0x40, 0x04, 0xb3, 0x02, 0xeb, 0x42, 0x04, 0x14, 0x4e, 0x4f, 0xf0, + 0x00, 0x0e, 0x00, 0x25, 0x20, 0x44, 0x57, 0x19, 0x8f, 0x42, 0x17, 0xda, + 0x56, 0xf8, 0x25, 0x70, 0x05, 0xeb, 0x45, 0x04, 0x01, 0x35, 0x04, 0x44, + 0x97, 0xf8, 0x35, 0x31, 0x84, 0xf8, 0x39, 0xe0, 0x84, 0xf8, 0x38, 0x30, + 0xd7, 0xf8, 0xd4, 0x30, 0x5b, 0x7f, 0x84, 0xf8, 0x3a, 0x30, 0x9c, 0xf8, + 0x00, 0x30, 0x9d, 0x42, 0xe7, 0xd3, 0x57, 0x19, 0x00, 0xe0, 0x17, 0x46, + 0xf8, 0xb2, 0xf0, 0xbd, 0x5c, 0x34, 0x01, 0x00, 0x10, 0x61, 0x01, 0x00, + 0x98, 0x52, 0x01, 0x00, 0x53, 0x34, 0x01, 0x00, 0xb8, 0x57, 0x01, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, 0xc8, 0xe5, 0x08, 0x00, + 0xb1, 0xc2, 0x04, 0x00, 0x70, 0x47, 0x00, 0x00, 0xf8, 0xb5, 0x04, 0x46, + 0x25, 0x48, 0x80, 0x79, 0xc8, 0xb1, 0x25, 0x4d, 0x95, 0xf8, 0x3c, 0x00, + 0x00, 0xf0, 0x81, 0x01, 0x81, 0x29, 0x03, 0xd1, 0x22, 0x49, 0x89, 0x78, + 0x01, 0x29, 0x31, 0xd1, 0x00, 0xf0, 0x82, 0x00, 0x82, 0x28, 0x2d, 0xd0, + 0x1f, 0x48, 0x00, 0x68, 0x80, 0x47, 0x10, 0xb1, 0x1e, 0x48, 0xc0, 0x78, + 0x30, 0xb3, 0x95, 0xf8, 0x56, 0x00, 0xc0, 0x07, 0x22, 0xd1, 0xe5, 0x78, + 0x01, 0x2d, 0x21, 0xd8, 0x1a, 0x48, 0x26, 0x1d, 0x29, 0x46, 0x02, 0x68, + 0x30, 0x46, 0x90, 0x47, 0xff, 0x28, 0x04, 0xd0, 0x17, 0x48, 0x29, 0x46, + 0x02, 0x68, 0x30, 0x46, 0x90, 0x47, 0x16, 0x48, 0x04, 0xf1, 0x0a, 0x01, + 0x32, 0x46, 0x2b, 0x46, 0x07, 0x68, 0x04, 0xf1, 0x1a, 0x00, 0xb8, 0x47, + 0x04, 0x46, 0x12, 0x48, 0x01, 0x68, 0x12, 0x48, 0x88, 0x47, 0x00, 0x20, + 0xff, 0x2c, 0x08, 0xbf, 0x07, 0x20, 0x02, 0xe0, 0x0c, 0x20, 0x00, 0xe0, + 0x12, 0x20, 0x42, 0xf2, 0x27, 0x01, 0xda, 0xf7, 0x2b, 0xfc, 0x0c, 0x48, + 0x00, 0x68, 0xbd, 0xe8, 0xf8, 0x40, 0x00, 0x47, 0x20, 0x54, 0x01, 0x00, + 0x90, 0x01, 0x00, 0x00, 0x9c, 0x55, 0x01, 0x00, 0x48, 0x9e, 0x08, 0x00, + 0xa8, 0x56, 0x01, 0x00, 0x48, 0xc9, 0x08, 0x00, 0x30, 0x9e, 0x08, 0x00, + 0x28, 0x9e, 0x08, 0x00, 0x24, 0x9e, 0x08, 0x00, 0x30, 0x54, 0x01, 0x00, + 0x38, 0x9e, 0x08, 0x00, 0x10, 0xb5, 0xc1, 0x78, 0x00, 0x79, 0x60, 0xf3, + 0x0b, 0x21, 0x16, 0x29, 0x15, 0xd8, 0x15, 0x4a, 0x01, 0xeb, 0x41, 0x00, + 0x52, 0xf8, 0x20, 0x10, 0x79, 0xb1, 0x02, 0xeb, 0x80, 0x00, 0x00, 0x79, + 0x03, 0x28, 0x0a, 0xd1, 0x10, 0x48, 0xc0, 0x78, 0x40, 0x07, 0x44, 0xbf, + 0x91, 0xf8, 0x4d, 0x03, 0x5f, 0xea, 0x40, 0x70, 0x09, 0xd4, 0x1a, 0x20, + 0x00, 0xe0, 0x02, 0x20, 0x0c, 0x49, 0x0a, 0x68, 0x42, 0xf2, 0x6d, 0x01, + 0xbd, 0xe8, 0x10, 0x40, 0x10, 0x47, 0xd1, 0xf8, 0x30, 0x03, 0x00, 0x22, + 0x01, 0x23, 0x40, 0xf0, 0x80, 0x00, 0xc1, 0xf8, 0x30, 0x03, 0x04, 0x48, + 0x04, 0x68, 0x3d, 0x20, 0xa0, 0x47, 0xeb, 0xe7, 0xe8, 0x72, 0x01, 0x00, + 0x70, 0x52, 0x01, 0x00, 0x80, 0x9b, 0x08, 0x00, 0xbc, 0x9b, 0x08, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x8b, 0xb0, 0xdf, 0xf8, 0x90, 0xb4, 0x82, 0x46, + 0x00, 0x21, 0x0b, 0xf1, 0x04, 0x00, 0x50, 0xf8, 0x04, 0x2c, 0x7a, 0xb1, + 0x03, 0x78, 0x05, 0x2b, 0x0c, 0xd1, 0xd2, 0xf8, 0x00, 0x31, 0xd3, 0xf8, + 0xd4, 0x30, 0x5b, 0x7f, 0x33, 0xb9, 0x92, 0xf8, 0x1c, 0x21, 0x02, 0x2a, + 0x18, 0xbf, 0x04, 0x2a, 0x00, 0xf0, 0xa2, 0x80, 0x01, 0x31, 0x0c, 0x30, + 0x17, 0x29, 0xe8, 0xd1, 0x9a, 0xf8, 0x03, 0x60, 0x0e, 0xb1, 0x1f, 0x2e, + 0x01, 0xd9, 0x12, 0x20, 0x97, 0xe0, 0xdf, 0xf8, 0x4c, 0x04, 0xdf, 0xf8, + 0x4c, 0x94, 0x00, 0x22, 0x90, 0xf8, 0x04, 0xe0, 0xd9, 0xf8, 0x00, 0xc0, + 0x0a, 0xeb, 0x82, 0x00, 0x05, 0x79, 0x40, 0x79, 0x60, 0xf3, 0x0b, 0x25, + 0x16, 0x2d, 0x00, 0xf2, 0x8e, 0x80, 0x05, 0xeb, 0x45, 0x00, 0x5b, 0xf8, + 0x20, 0x30, 0x00, 0x2b, 0x00, 0xf0, 0x87, 0x80, 0x0b, 0xeb, 0x80, 0x00, + 0x00, 0x79, 0x05, 0x28, 0x40, 0xf0, 0x81, 0x80, 0x90, 0x00, 0x00, 0xeb, + 0x0a, 0x01, 0x88, 0x79, 0xc9, 0x79, 0x61, 0xf3, 0x0b, 0x20, 0x16, 0x28, + 0x77, 0xd8, 0x00, 0xeb, 0x40, 0x00, 0x5b, 0xf8, 0x20, 0x70, 0x00, 0x2f, + 0x71, 0xd0, 0x0b, 0xeb, 0x80, 0x00, 0x00, 0x79, 0x03, 0x28, 0x6c, 0xd1, + 0x10, 0x46, 0x41, 0x1c, 0xb1, 0x42, 0x09, 0xd2, 0x0a, 0xeb, 0x80, 0x00, + 0x04, 0x7a, 0x40, 0x7a, 0x60, 0xf3, 0x0b, 0x24, 0x08, 0x46, 0xac, 0x42, + 0xf3, 0xd1, 0xbc, 0xe7, 0x93, 0xf8, 0x1d, 0x01, 0xc0, 0xeb, 0x00, 0x10, + 0x40, 0x01, 0x1c, 0xf8, 0x00, 0x00, 0x00, 0x28, 0x4c, 0xd1, 0xd7, 0xf8, + 0xd4, 0x00, 0x40, 0x7f, 0x00, 0x28, 0x47, 0xd1, 0x97, 0xf8, 0x4e, 0x03, + 0x00, 0xea, 0x0e, 0x00, 0xc0, 0x07, 0x41, 0xd0, 0x97, 0xf8, 0x38, 0x00, + 0x03, 0x28, 0x3d, 0xd1, 0x93, 0xf8, 0x1c, 0x01, 0x00, 0x28, 0x44, 0xd1, + 0x01, 0x32, 0xb2, 0x42, 0xa8, 0xd1, 0x9a, 0xf8, 0x04, 0x00, 0x9a, 0xf8, + 0x05, 0x10, 0x61, 0xf3, 0x0b, 0x20, 0x00, 0xeb, 0x40, 0x00, 0x5b, 0xf8, + 0x20, 0x00, 0x90, 0xf8, 0x1d, 0x01, 0xc0, 0xeb, 0x00, 0x10, 0x0c, 0xeb, + 0x40, 0x14, 0xe0, 0x68, 0x88, 0xb3, 0xdf, 0xf8, 0x90, 0x83, 0x00, 0x27, + 0x0a, 0xeb, 0x87, 0x00, 0x01, 0x79, 0x42, 0x79, 0x62, 0xf3, 0x0b, 0x21, + 0x01, 0xeb, 0x41, 0x01, 0x5b, 0xf8, 0x21, 0x50, 0x8d, 0xb1, 0x81, 0x79, + 0xc0, 0x79, 0x60, 0xf3, 0x0b, 0x21, 0x01, 0xeb, 0x41, 0x00, 0x5b, 0xf8, + 0x20, 0x00, 0x40, 0xb1, 0xd8, 0xf8, 0x00, 0x20, 0x29, 0x46, 0x90, 0x47, + 0x48, 0xb9, 0x28, 0x6c, 0x40, 0xf4, 0x80, 0x70, 0x28, 0x64, 0x01, 0x37, + 0x00, 0x20, 0xb7, 0x42, 0xde, 0xd3, 0x00, 0xe0, 0x0c, 0x20, 0xd2, 0x49, + 0x0a, 0x68, 0x42, 0xf2, 0x64, 0x01, 0x0b, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, + 0x10, 0x47, 0x02, 0x20, 0xf5, 0xe7, 0x0b, 0x20, 0xf3, 0xe7, 0x9a, 0xf8, + 0x06, 0x00, 0x9a, 0xf8, 0x07, 0x10, 0x61, 0xf3, 0x0b, 0x20, 0x00, 0xeb, + 0x40, 0x00, 0x5b, 0xf8, 0x20, 0x70, 0xd7, 0xf8, 0x1c, 0x14, 0xf1, 0xb1, + 0x08, 0x7e, 0x05, 0x28, 0x10, 0xd1, 0x88, 0x79, 0x40, 0x06, 0x0d, 0xd5, + 0xb9, 0x4a, 0x92, 0xf8, 0xa6, 0x02, 0x40, 0x06, 0x08, 0xd5, 0x92, 0xf8, + 0xa7, 0x02, 0x00, 0x07, 0x44, 0xbf, 0xc8, 0x79, 0x5f, 0xea, 0x00, 0x70, + 0x00, 0xf1, 0xa3, 0x80, 0x08, 0x7e, 0x05, 0x28, 0x07, 0xd1, 0x88, 0x79, + 0x40, 0x06, 0x04, 0xd5, 0xaf, 0x48, 0x90, 0xf8, 0xa6, 0x02, 0x40, 0x06, + 0x46, 0xd4, 0x60, 0x78, 0xc0, 0xeb, 0x00, 0x10, 0x0c, 0xeb, 0x40, 0x10, + 0x00, 0xf5, 0xea, 0x72, 0x90, 0xf8, 0xd5, 0x11, 0x00, 0xf5, 0xe8, 0x70, + 0x12, 0xf8, 0x02, 0x3b, 0x43, 0xea, 0x01, 0x21, 0x13, 0x78, 0x52, 0x78, + 0x43, 0xea, 0x02, 0x22, 0x41, 0xea, 0x02, 0x41, 0x81, 0x42, 0x4a, 0xd0, + 0x91, 0xf9, 0x42, 0x20, 0xb2, 0xf1, 0xff, 0x3f, 0x0c, 0xdc, 0xd2, 0xb2, + 0x12, 0xf0, 0x7f, 0x02, 0x81, 0xf8, 0x42, 0x20, 0x06, 0xd1, 0x8a, 0x68, + 0x92, 0xf8, 0x81, 0x23, 0x02, 0xf0, 0x7f, 0x02, 0x81, 0xf8, 0x42, 0x20, + 0x91, 0xf9, 0x43, 0x20, 0xb2, 0xf1, 0xff, 0x3f, 0x0c, 0xdc, 0xd2, 0xb2, + 0x12, 0xf0, 0x7f, 0x02, 0x81, 0xf8, 0x43, 0x20, 0x06, 0xd1, 0x8a, 0x68, + 0x92, 0xf8, 0x82, 0x23, 0x02, 0xf0, 0x7f, 0x02, 0x81, 0xf8, 0x43, 0x20, + 0x11, 0xf8, 0x04, 0x2f, 0x4b, 0x78, 0x8d, 0x78, 0xc9, 0x78, 0x42, 0xea, + 0x03, 0x22, 0x45, 0xea, 0x01, 0x21, 0x42, 0xea, 0x01, 0x41, 0xcd, 0xe7, + 0x60, 0x78, 0xc0, 0xeb, 0x00, 0x10, 0x0c, 0xeb, 0x40, 0x11, 0x01, 0xf5, + 0xe8, 0x70, 0xd1, 0xf8, 0xd4, 0x11, 0x81, 0x42, 0x0f, 0xd0, 0x48, 0xf2, + 0x80, 0x02, 0x11, 0xf8, 0x04, 0x3f, 0x4d, 0x78, 0xca, 0x87, 0x8f, 0x78, + 0xc9, 0x78, 0x43, 0xea, 0x05, 0x23, 0x47, 0xea, 0x01, 0x21, 0x43, 0xea, + 0x01, 0x41, 0x81, 0x42, 0xf1, 0xd1, 0x7f, 0x48, 0xd4, 0xe9, 0x05, 0xc5, + 0xa7, 0x8b, 0xb4, 0xf8, 0x1e, 0x80, 0x94, 0xf8, 0x20, 0x30, 0xe2, 0x78, + 0x94, 0xf8, 0x21, 0x10, 0xd0, 0xf8, 0x00, 0xe0, 0x01, 0x20, 0xcd, 0xe9, + 0x00, 0xc5, 0xcd, 0xe9, 0x02, 0x78, 0x04, 0x90, 0x20, 0x46, 0xf0, 0x47, + 0x98, 0xb1, 0x75, 0x4d, 0x01, 0x20, 0x28, 0x70, 0x74, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x38, 0xb1, 0x73, 0x48, 0xe1, 0x78, 0x02, 0x68, + 0x20, 0x46, 0x90, 0x47, 0x21, 0x89, 0x81, 0x42, 0x05, 0xd2, 0x12, 0x20, + 0x00, 0x21, 0x29, 0x70, 0x3b, 0xe7, 0x11, 0x20, 0x39, 0xe7, 0x6d, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x10, 0xb1, 0x00, 0x20, 0x28, 0x70, + 0x0b, 0xe7, 0x07, 0x20, 0xf0, 0xe7, 0x05, 0x94, 0x14, 0xf8, 0x01, 0xef, + 0xce, 0xeb, 0x0e, 0x10, 0x07, 0x94, 0x0c, 0xeb, 0x40, 0x10, 0x00, 0xf5, + 0xea, 0x73, 0x90, 0xf8, 0xd5, 0x21, 0x00, 0xf5, 0xe8, 0x70, 0x13, 0xf8, + 0x02, 0x5b, 0x45, 0xea, 0x02, 0x22, 0x1d, 0x78, 0x5b, 0x78, 0x45, 0xea, + 0x03, 0x23, 0x42, 0xea, 0x03, 0x48, 0x80, 0x45, 0x00, 0xf0, 0x94, 0x80, + 0x05, 0x98, 0x00, 0x21, 0x08, 0x30, 0x06, 0x90, 0xd8, 0xf8, 0x44, 0x00, + 0x00, 0x28, 0x71, 0xd0, 0x90, 0xf8, 0x21, 0x20, 0x00, 0x2a, 0x6d, 0xd0, + 0x0a, 0x91, 0x98, 0xf8, 0xf4, 0x10, 0x85, 0x1c, 0x08, 0xf1, 0x50, 0x02, + 0x08, 0xf1, 0x4e, 0x03, 0x28, 0x46, 0x09, 0x91, 0x01, 0x21, 0xee, 0xf7, + 0x2b, 0xfe, 0x98, 0xf8, 0x4e, 0x00, 0x08, 0xf1, 0x58, 0x03, 0x08, 0xf1, + 0x5a, 0x02, 0x00, 0x21, 0x2c, 0x46, 0x08, 0x93, 0x88, 0xf8, 0xd4, 0x00, + 0x28, 0x46, 0xee, 0xf7, 0x1d, 0xfe, 0x41, 0x49, 0x09, 0x9d, 0x2a, 0x23, + 0x98, 0xf8, 0x4e, 0x20, 0x98, 0xf8, 0x58, 0x00, 0x15, 0xfb, 0x03, 0x11, + 0x06, 0x9d, 0x88, 0xf8, 0xd5, 0x00, 0xcb, 0x8b, 0x2b, 0x80, 0x91, 0xf8, + 0x20, 0x30, 0x91, 0xf8, 0x21, 0x50, 0x91, 0xf8, 0x22, 0x10, 0x88, 0xf8, + 0x4f, 0x30, 0xb8, 0xf8, 0x50, 0x30, 0x88, 0xf8, 0x59, 0x50, 0x88, 0xf8, + 0x28, 0x10, 0x02, 0xfb, 0x03, 0xf3, 0xa8, 0xf8, 0x3c, 0x30, 0xb8, 0xf8, + 0x5a, 0x30, 0x00, 0xfb, 0x03, 0xf3, 0xa8, 0xf8, 0x3e, 0x30, 0x2d, 0x4b, + 0x93, 0xf8, 0xc8, 0x32, 0x03, 0xf1, 0x05, 0x03, 0x88, 0xf8, 0x5c, 0x30, + 0x88, 0xf8, 0x52, 0x30, 0x4a, 0xb1, 0xb1, 0xfb, 0xf2, 0xf3, 0x03, 0xfb, + 0x12, 0x12, 0x88, 0xf8, 0x54, 0x30, 0x1a, 0x44, 0x01, 0x3a, 0x88, 0xf8, + 0x53, 0x20, 0x40, 0xb1, 0xb1, 0xfb, 0xf0, 0xf2, 0x08, 0x9b, 0x02, 0xfb, + 0x10, 0x10, 0x9a, 0x71, 0x10, 0x44, 0x01, 0x38, 0x58, 0x71, 0x20, 0x48, + 0x01, 0x21, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0xc8, 0xf8, 0x30, 0x00, + 0x07, 0x98, 0x0a, 0x99, 0xd9, 0xf8, 0x00, 0xc0, 0x90, 0xf8, 0x00, 0xe0, + 0x01, 0x31, 0xff, 0xe7, 0x18, 0xf8, 0x04, 0x0f, 0x98, 0xf8, 0x01, 0x20, + 0x98, 0xf8, 0x02, 0x30, 0x98, 0xf8, 0x03, 0x50, 0x40, 0xea, 0x02, 0x20, + 0x43, 0xea, 0x05, 0x22, 0x40, 0xea, 0x02, 0x48, 0x5f, 0xfa, 0x8e, 0xf0, + 0xc0, 0xeb, 0x00, 0x10, 0x0c, 0xeb, 0x40, 0x10, 0x00, 0xf5, 0xe8, 0x70, + 0x80, 0x45, 0x7f, 0xf4, 0x71, 0xaf, 0x00, 0xe0, 0x00, 0x21, 0x05, 0x9c, + 0xc9, 0xb2, 0x94, 0xf8, 0xc0, 0x00, 0x81, 0x42, 0x3f, 0xf4, 0x29, 0xaf, + 0xd7, 0xf8, 0x1c, 0x14, 0x00, 0x29, 0x7f, 0xf4, 0xa1, 0xae, 0xaa, 0xe6, + 0xe8, 0x72, 0x01, 0x00, 0x70, 0x52, 0x01, 0x00, 0xe0, 0x35, 0x01, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0xa4, 0x32, 0x06, 0x00, 0x58, 0xce, 0x08, 0x00, + 0xb8, 0x8e, 0x08, 0x00, 0xc0, 0xf0, 0x05, 0x00, 0xb4, 0x8e, 0x08, 0x00, + 0x04, 0xb6, 0x08, 0x00, 0x88, 0xb8, 0x08, 0x00, 0xc4, 0x8e, 0x08, 0x00, + 0xbc, 0x9b, 0x08, 0x00, 0xb0, 0xb5, 0xc4, 0x78, 0x00, 0x79, 0x4f, 0xf4, + 0x70, 0x61, 0x01, 0xea, 0x00, 0x25, 0x28, 0x19, 0x16, 0x28, 0x0c, 0xd8, + 0xd3, 0x49, 0x00, 0xeb, 0x40, 0x00, 0x51, 0xf8, 0x20, 0x20, 0x32, 0xb1, + 0x01, 0xeb, 0x80, 0x00, 0x00, 0x79, 0x03, 0x28, 0x04, 0xbf, 0x01, 0x20, + 0xb0, 0xbd, 0x03, 0x20, 0x42, 0xf2, 0x7a, 0x01, 0x02, 0x22, 0xda, 0xf7, + 0x77, 0xf9, 0x20, 0xb1, 0x29, 0x0a, 0x84, 0x71, 0xc1, 0x71, 0xda, 0xf7, + 0x47, 0xf9, 0x00, 0x20, 0xb0, 0xbd, 0x00, 0xbf, 0x10, 0xb5, 0x08, 0x20, + 0x41, 0xf2, 0x05, 0x01, 0x00, 0x22, 0xda, 0xf7, 0x67, 0xf9, 0xf0, 0xb1, + 0x04, 0x46, 0x0f, 0x48, 0x00, 0x68, 0x80, 0x47, 0xa0, 0x71, 0x00, 0x0a, + 0x00, 0x23, 0x00, 0x21, 0xe0, 0x71, 0xe6, 0x48, 0xb0, 0xf8, 0x56, 0x25, + 0x04, 0x2a, 0x28, 0xbf, 0x13, 0x1f, 0x23, 0x72, 0x90, 0xf8, 0x1d, 0x25, + 0x01, 0x3a, 0x62, 0x72, 0x12, 0x0a, 0xa2, 0x72, 0x90, 0xf8, 0x55, 0x05, + 0x21, 0x73, 0xe0, 0x72, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0xda, 0xf7, + 0x1d, 0xb9, 0x10, 0xbd, 0xc8, 0xc9, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x87, 0xb0, 0x00, 0x24, 0x07, 0x46, 0x4f, 0xf4, 0x70, 0x61, 0x06, 0x94, + 0xcd, 0xe9, 0x04, 0x44, 0xcd, 0xe9, 0x02, 0x44, 0x90, 0xf8, 0x07, 0xb0, + 0xc3, 0x78, 0x00, 0x79, 0x97, 0xf8, 0x05, 0x90, 0x97, 0xf8, 0x06, 0x80, + 0x01, 0xea, 0x00, 0x25, 0xb9, 0xf1, 0x01, 0x0f, 0x8d, 0xf8, 0x15, 0xb0, + 0xcd, 0xe9, 0x00, 0x53, 0x0a, 0xd8, 0x79, 0x7b, 0xba, 0x7b, 0x38, 0x7b, + 0x09, 0x02, 0x41, 0xea, 0x02, 0x41, 0x08, 0x44, 0x9d, 0x49, 0x88, 0x42, + 0x02, 0xd9, 0x00, 0x24, 0x12, 0x25, 0x39, 0xe0, 0x45, 0xea, 0x03, 0x00, + 0x16, 0x28, 0x33, 0xd8, 0x99, 0x49, 0x00, 0xeb, 0x40, 0x00, 0x51, 0xf8, + 0x20, 0x40, 0x6c, 0xb3, 0x01, 0xeb, 0x80, 0x00, 0x00, 0x79, 0x05, 0x38, + 0x01, 0x28, 0x27, 0xd8, 0x94, 0x48, 0x94, 0xf8, 0x1d, 0x11, 0xc1, 0xeb, + 0x01, 0x11, 0x00, 0x68, 0x49, 0x01, 0x40, 0x5c, 0x40, 0xf0, 0x02, 0x01, + 0x02, 0x29, 0x19, 0xbf, 0x04, 0xf5, 0x9b, 0x72, 0x04, 0xf5, 0x9a, 0x71, + 0x04, 0xf5, 0x9b, 0x71, 0x04, 0xf5, 0x9a, 0x72, 0x09, 0x88, 0x12, 0x88, + 0x19, 0xb9, 0xb9, 0xf1, 0x01, 0x0f, 0x00, 0xf0, 0x08, 0x81, 0x1a, 0xb9, + 0xb9, 0xf1, 0x00, 0x0f, 0x00, 0xf0, 0x03, 0x81, 0x20, 0xb1, 0x94, 0xf8, + 0x1c, 0x01, 0x01, 0x28, 0x40, 0xf0, 0xfd, 0x80, 0x00, 0x25, 0x01, 0xe0, + 0x00, 0x24, 0x02, 0x25, 0x80, 0x4e, 0x81, 0x4a, 0x48, 0x21, 0x43, 0x46, + 0x30, 0x46, 0xd7, 0xf7, 0xa5, 0xfc, 0xa4, 0x48, 0x00, 0xf5, 0x96, 0x7a, + 0x90, 0xf8, 0x2c, 0x01, 0x80, 0x07, 0x05, 0xd5, 0x7b, 0x48, 0x01, 0x21, + 0x32, 0x46, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x79, 0x4a, 0x30, 0x46, + 0x48, 0x21, 0x4b, 0x46, 0xd7, 0xf7, 0x92, 0xfc, 0x9a, 0xf8, 0x00, 0x00, + 0x80, 0x07, 0x05, 0xd5, 0x73, 0x48, 0x01, 0x21, 0x32, 0x46, 0x03, 0x68, + 0x02, 0x20, 0x98, 0x47, 0x7d, 0xb1, 0x78, 0x48, 0x03, 0x21, 0x02, 0x68, + 0x42, 0xf2, 0x6e, 0x00, 0x90, 0x47, 0x28, 0xb3, 0x01, 0x99, 0x45, 0x71, + 0x81, 0x71, 0x00, 0x99, 0x09, 0x0a, 0xc1, 0x71, 0xda, 0xf7, 0x82, 0xf8, + 0x26, 0xe0, 0x65, 0x4d, 0x94, 0xf8, 0x1d, 0x11, 0x28, 0x68, 0xc1, 0xeb, + 0x01, 0x11, 0x00, 0xeb, 0x41, 0x10, 0x66, 0x49, 0x40, 0x78, 0x49, 0x68, + 0xc0, 0xeb, 0xc0, 0x00, 0x01, 0xeb, 0x80, 0x00, 0xff, 0x21, 0x41, 0x73, + 0x20, 0x6b, 0xb0, 0xb1, 0x60, 0x6b, 0xa0, 0xb1, 0xb9, 0xf1, 0x01, 0x0f, + 0x69, 0xd0, 0xb9, 0xf1, 0x00, 0x0f, 0x4e, 0xd1, 0x00, 0x78, 0x65, 0xe0, + 0x9a, 0xf8, 0x00, 0x00, 0x80, 0x07, 0x05, 0xd5, 0x57, 0x48, 0x60, 0x4a, + 0x00, 0x21, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x07, 0xb0, 0xbd, 0xe8, + 0xf0, 0x8f, 0xbb, 0xf1, 0xff, 0x0f, 0x0b, 0xd1, 0x38, 0x7a, 0x79, 0x7a, + 0xba, 0x7a, 0xfb, 0x7a, 0x8d, 0xf8, 0x16, 0x00, 0x8d, 0xf8, 0x17, 0x10, + 0x8d, 0xf8, 0x18, 0x20, 0x8d, 0xf8, 0x19, 0x30, 0xfb, 0x7b, 0x8d, 0xf8, + 0x14, 0x30, 0x13, 0xb3, 0x4e, 0x4a, 0x30, 0x46, 0x48, 0x21, 0xd7, 0xf7, + 0x35, 0xfc, 0x9a, 0xf8, 0x00, 0x00, 0x80, 0x07, 0x05, 0xd5, 0x45, 0x48, + 0x01, 0x21, 0x32, 0x46, 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0xb9, 0xf1, + 0x00, 0x0f, 0x08, 0xbf, 0xbb, 0xf1, 0xff, 0x0f, 0x34, 0xd0, 0x45, 0x48, + 0x9d, 0xf8, 0x14, 0x50, 0x01, 0x68, 0x28, 0x46, 0x88, 0x47, 0x04, 0x90, + 0x28, 0xb3, 0x07, 0xf1, 0x10, 0x02, 0x29, 0x46, 0x2b, 0x46, 0xd4, 0xf7, + 0xef, 0xf9, 0x3b, 0x48, 0x04, 0xab, 0x42, 0x46, 0x10, 0xf8, 0x09, 0x10, + 0x39, 0x48, 0x05, 0x68, 0x20, 0x46, 0xa8, 0x47, 0x78, 0xb1, 0x3a, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x05, 0x46, 0x00, 0x28, 0x7f, 0xf4, + 0x7e, 0xaf, 0x60, 0x6b, 0x18, 0xb1, 0x90, 0xf8, 0x2a, 0x00, 0xc0, 0x07, + 0xae, 0xd1, 0x00, 0x25, 0x75, 0xe7, 0x04, 0x98, 0x00, 0x28, 0x44, 0xd0, + 0xda, 0xf7, 0x3e, 0xf8, 0x41, 0xe0, 0x07, 0x25, 0x6d, 0xe7, 0x40, 0x78, + 0xff, 0x28, 0x31, 0xd0, 0x0c, 0x25, 0x68, 0xe7, 0x94, 0xf8, 0x1d, 0x11, + 0x28, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0x49, 0x01, 0x40, 0x5c, 0x00, 0x28, + 0xc1, 0xd1, 0x07, 0xf1, 0x10, 0x02, 0x04, 0xa8, 0x02, 0xa9, 0xe4, 0xf7, + 0x9f, 0xfe, 0x41, 0x07, 0x10, 0xd5, 0x94, 0xf8, 0x1d, 0x21, 0x29, 0x68, + 0xc2, 0xeb, 0x02, 0x12, 0x01, 0xeb, 0x42, 0x11, 0x1a, 0x4a, 0x49, 0x78, + 0x52, 0x68, 0xc1, 0xeb, 0xc1, 0x01, 0x02, 0xeb, 0x81, 0x01, 0x9d, 0xf8, + 0x0f, 0x20, 0x4a, 0x73, 0x07, 0x28, 0xa6, 0xd1, 0xbd, 0xf8, 0x0a, 0x00, + 0x01, 0x28, 0xa2, 0xd1, 0xdd, 0xe9, 0x02, 0x01, 0x22, 0x46, 0xee, 0xf7, + 0xb5, 0xfb, 0x00, 0x28, 0x9b, 0xd1, 0x0a, 0xe0, 0x0f, 0x48, 0x42, 0x46, + 0x00, 0x23, 0x10, 0xf8, 0x09, 0x10, 0x0e, 0x48, 0x05, 0x68, 0x20, 0x46, + 0xa8, 0x47, 0x00, 0x28, 0xa7, 0xd1, 0x1f, 0x25, 0x2b, 0xe7, 0x0c, 0x25, + 0x04, 0xe7, 0x00, 0xbf, 0x00, 0x09, 0x3d, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0xe0, 0x35, 0x01, 0x00, 0x04, 0x86, 0x01, 0x00, 0x70, 0xd7, 0x04, 0x00, + 0x70, 0x9b, 0x08, 0x00, 0x83, 0xd7, 0x04, 0x00, 0xec, 0xe5, 0x05, 0x00, + 0xb4, 0x42, 0x06, 0x10, 0x68, 0xb6, 0x08, 0x00, 0x97, 0xd7, 0x04, 0x00, + 0x4c, 0x9c, 0x08, 0x00, 0x6c, 0xb6, 0x08, 0x00, 0x28, 0x9c, 0x08, 0x00, + 0xb1, 0xd7, 0x04, 0x00, 0xb0, 0xb5, 0x07, 0x20, 0x42, 0xf2, 0x60, 0x01, + 0x00, 0x22, 0xd9, 0xf7, 0xbf, 0xff, 0x60, 0xb3, 0x16, 0x4d, 0x04, 0x46, + 0xb5, 0xf8, 0x32, 0x05, 0xa0, 0x71, 0x00, 0x0a, 0xe0, 0x71, 0x14, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x20, 0x72, 0x13, 0x48, 0xb5, 0xf8, 0x5e, 0x25, + 0xb0, 0xf8, 0xc0, 0x11, 0x0c, 0x3a, 0x8a, 0x42, 0xb8, 0xbf, 0x11, 0x46, + 0x61, 0x72, 0x09, 0x0a, 0xa1, 0x72, 0x0e, 0x49, 0x91, 0xf8, 0x20, 0x20, + 0xd2, 0x07, 0x07, 0xd0, 0x90, 0xf9, 0xba, 0x01, 0xb0, 0xf1, 0xff, 0x3f, + 0x02, 0xdd, 0x01, 0xf1, 0x21, 0x00, 0x01, 0xe0, 0x05, 0xf2, 0x5d, 0x50, + 0x00, 0x78, 0xe0, 0x72, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0xd9, 0xf7, + 0x67, 0xbf, 0xb0, 0xbd, 0x8c, 0x7e, 0x08, 0x00, 0xe8, 0xb3, 0x08, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x50, 0x32, 0x06, 0x00, 0x7f, 0xb5, 0x84, 0x79, + 0x0c, 0xb1, 0x04, 0x2c, 0x01, 0xd9, 0x11, 0x20, 0x0f, 0xe0, 0xc1, 0x78, + 0x02, 0x79, 0x43, 0x79, 0x29, 0x48, 0x01, 0x3c, 0x00, 0x26, 0xe4, 0xb2, + 0x05, 0x68, 0x24, 0x48, 0x00, 0x78, 0xcd, 0xe9, 0x00, 0x64, 0xcd, 0xe9, + 0x02, 0x06, 0x00, 0x20, 0xa8, 0x47, 0x42, 0xf2, 0x34, 0x01, 0x04, 0xb0, + 0xbd, 0xe8, 0x70, 0x40, 0xd9, 0xf7, 0x46, 0xbf, 0x7f, 0xb5, 0x04, 0x46, + 0x40, 0x7a, 0x20, 0x44, 0x80, 0x7a, 0x7e, 0x28, 0x03, 0xd0, 0x7f, 0x28, + 0x04, 0xd1, 0x18, 0x48, 0x00, 0xe0, 0x16, 0x48, 0x05, 0x78, 0x07, 0xe0, + 0x16, 0x49, 0x40, 0xb2, 0x00, 0x22, 0x02, 0x23, 0x0d, 0x68, 0x02, 0x21, + 0xa8, 0x47, 0x05, 0x46, 0xa0, 0x79, 0x08, 0xb1, 0x04, 0x28, 0x01, 0xd9, + 0x11, 0x20, 0x13, 0xe0, 0x10, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, + 0x70, 0xb9, 0x0f, 0x48, 0xe1, 0x78, 0x22, 0x79, 0x63, 0x79, 0x06, 0x68, + 0xa0, 0x79, 0x00, 0x24, 0x01, 0x38, 0xc0, 0xb2, 0xcd, 0xe9, 0x00, 0x40, + 0x00, 0x20, 0xcd, 0xe9, 0x02, 0x54, 0xb0, 0x47, 0x42, 0xf2, 0x7b, 0x01, + 0x04, 0xb0, 0xbd, 0xe8, 0x70, 0x40, 0xd9, 0xf7, 0x0f, 0xbf, 0x00, 0xbf, + 0x6b, 0x34, 0x01, 0x00, 0x6a, 0x34, 0x01, 0x00, 0x3c, 0x9c, 0x08, 0x00, + 0x7c, 0xbe, 0x08, 0x00, 0x54, 0xbe, 0x08, 0x00, 0x10, 0xb5, 0x0e, 0x48, + 0x90, 0xf8, 0x3c, 0x10, 0x01, 0xf0, 0x82, 0x01, 0x82, 0x29, 0x0d, 0xd1, + 0xd0, 0xf8, 0xac, 0x40, 0x00, 0x20, 0x42, 0xf2, 0x0e, 0x01, 0xd9, 0xf7, + 0xf5, 0xfe, 0x08, 0x48, 0x21, 0x46, 0x02, 0x68, 0x02, 0x20, 0xbd, 0xe8, + 0x10, 0x40, 0x10, 0x47, 0x0c, 0x20, 0x42, 0xf2, 0x0e, 0x01, 0xbd, 0xe8, + 0x10, 0x40, 0xd9, 0xf7, 0xe7, 0xbe, 0x00, 0xbf, 0x90, 0x01, 0x00, 0x00, + 0x9c, 0xba, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0xaf, 0xb0, 0xdf, 0xf8, + 0x5c, 0x16, 0x9d, 0x4b, 0x8a, 0x80, 0x1b, 0x68, 0x0b, 0x60, 0x40, 0xf6, + 0x7c, 0x41, 0x8a, 0x42, 0x44, 0xd0, 0x41, 0xf2, 0x05, 0x01, 0x8a, 0x42, + 0x00, 0xf0, 0x92, 0x80, 0x41, 0xf2, 0x0e, 0x01, 0x8a, 0x42, 0x00, 0xf0, + 0x90, 0x80, 0x41, 0xf2, 0x0f, 0x01, 0x8a, 0x42, 0x00, 0xf0, 0xa6, 0x80, + 0x42, 0xf2, 0x0e, 0x01, 0x8a, 0x42, 0x00, 0xf0, 0xba, 0x80, 0x42, 0xf2, + 0x7b, 0x01, 0x8a, 0x42, 0x00, 0xf0, 0xb8, 0x80, 0x42, 0xf2, 0x34, 0x01, + 0x8a, 0x42, 0x00, 0xf0, 0xb7, 0x80, 0x42, 0xf2, 0x60, 0x01, 0x8a, 0x42, + 0x00, 0xf0, 0xb6, 0x80, 0x42, 0xf2, 0x62, 0x01, 0x8a, 0x42, 0x00, 0xf0, + 0xb4, 0x80, 0x42, 0xf2, 0x64, 0x01, 0x8a, 0x42, 0x00, 0xf0, 0xdd, 0x80, + 0x42, 0xf2, 0x6d, 0x01, 0x8a, 0x42, 0x00, 0xf0, 0xdc, 0x80, 0x42, 0xf2, + 0x6e, 0x01, 0x8a, 0x42, 0x00, 0xf0, 0xdb, 0x80, 0x42, 0xf2, 0x7a, 0x01, + 0x8a, 0x42, 0x00, 0xf0, 0xda, 0x80, 0x42, 0xf2, 0x27, 0x01, 0x8a, 0x42, + 0x40, 0xf0, 0xdb, 0x80, 0x00, 0x68, 0xff, 0xf7, 0x1d, 0xfa, 0xcb, 0xe0, + 0x05, 0x68, 0x00, 0x20, 0x03, 0x21, 0x1f, 0x90, 0xdf, 0xf8, 0xe0, 0x05, + 0x2e, 0x79, 0xef, 0x78, 0x02, 0x68, 0x40, 0xf6, 0x7c, 0x40, 0x90, 0x47, + 0x00, 0x28, 0x00, 0xf0, 0xd5, 0x80, 0x04, 0x46, 0x87, 0x71, 0x30, 0x02, + 0xc0, 0xf3, 0x03, 0x20, 0xe0, 0x71, 0x4f, 0xf4, 0x70, 0x60, 0x00, 0xea, + 0x06, 0x20, 0x38, 0x44, 0x16, 0x28, 0x00, 0xf2, 0xbc, 0x80, 0xdf, 0xf8, + 0xb4, 0x15, 0x00, 0xeb, 0x40, 0x02, 0x51, 0xf8, 0x22, 0x20, 0x00, 0x2a, + 0x00, 0xf0, 0xb3, 0x80, 0x00, 0xeb, 0x40, 0x02, 0x01, 0xeb, 0x82, 0x01, + 0x09, 0x79, 0x03, 0x29, 0x40, 0xf0, 0xab, 0x80, 0xdf, 0xf8, 0x94, 0x15, + 0x0a, 0x68, 0x1f, 0xa9, 0x90, 0x47, 0x06, 0x46, 0x00, 0x28, 0x40, 0xf0, + 0x15, 0x82, 0x68, 0x79, 0xa9, 0x79, 0x40, 0xea, 0x01, 0x20, 0x00, 0x28, + 0x00, 0xf0, 0xf6, 0x81, 0x1f, 0x99, 0x00, 0x29, 0x00, 0xf0, 0x04, 0x82, + 0xb1, 0xf8, 0xe4, 0x32, 0xb1, 0xf8, 0xdc, 0x22, 0x01, 0x33, 0x5a, 0x43, + 0xb1, 0xf8, 0x40, 0x34, 0x5a, 0x43, 0x03, 0x01, 0xb3, 0xeb, 0x42, 0x0f, + 0x80, 0xf0, 0xef, 0x81, 0x12, 0x26, 0xf4, 0xe1, 0xff, 0xf7, 0xf2, 0xfc, + 0x93, 0xe0, 0x00, 0x68, 0x05, 0x21, 0x05, 0x23, 0xc2, 0x1c, 0x1f, 0xa8, + 0xd3, 0xf7, 0xfc, 0xff, 0xdf, 0xf8, 0x30, 0x05, 0x05, 0x21, 0x02, 0x68, + 0x41, 0xf2, 0x0e, 0x00, 0x90, 0x47, 0x00, 0x28, 0x66, 0xd0, 0x12, 0x21, + 0x41, 0x72, 0x34, 0x21, 0x01, 0x72, 0x02, 0x21, 0xc1, 0x71, 0x01, 0x21, + 0x81, 0x71, 0x00, 0x21, 0x41, 0x71, 0x51, 0xe0, 0x00, 0x68, 0x05, 0x21, + 0x05, 0x23, 0xc2, 0x1c, 0x1f, 0xa8, 0xd3, 0xf7, 0xe1, 0xff, 0x07, 0x20, + 0x41, 0xf2, 0x0f, 0x01, 0x00, 0x22, 0x00, 0x24, 0xd9, 0xf7, 0x36, 0xfe, + 0x00, 0x28, 0x4b, 0xd0, 0x01, 0x21, 0xc4, 0x72, 0x84, 0x72, 0x04, 0x72, + 0xc4, 0x71, 0x44, 0x71, 0x41, 0x72, 0x81, 0x71, 0x38, 0xe0, 0xff, 0xf7, + 0x01, 0xff, 0x5c, 0xe0, 0x00, 0x68, 0xff, 0xf7, 0xbb, 0xfe, 0x58, 0xe0, + 0x00, 0x68, 0xff, 0xf7, 0x99, 0xfe, 0x54, 0xe0, 0xff, 0xf7, 0x58, 0xfe, + 0x51, 0xe0, 0x06, 0x68, 0x75, 0x7c, 0x96, 0xf8, 0x03, 0xa0, 0x1f, 0x2d, + 0x98, 0xbf, 0xba, 0xf1, 0xef, 0x0f, 0x4f, 0xd9, 0x00, 0x25, 0x12, 0x27, + 0x03, 0x20, 0x00, 0xeb, 0x45, 0x00, 0xc1, 0xb2, 0xdf, 0xf8, 0x9c, 0x04, + 0x02, 0x68, 0x42, 0xf2, 0x62, 0x00, 0x90, 0x47, 0xd8, 0xb3, 0xc5, 0x71, + 0x80, 0xf8, 0x06, 0xa0, 0x47, 0x71, 0x7d, 0xb1, 0x00, 0x22, 0x01, 0x21, + 0x1f, 0xab, 0x13, 0xf8, 0x12, 0x60, 0x00, 0xeb, 0x42, 0x04, 0x03, 0xeb, + 0x42, 0x02, 0x26, 0x72, 0x52, 0x78, 0x62, 0x72, 0x4a, 0xb2, 0x01, 0x31, + 0xaa, 0x42, 0xf2, 0xdb, 0xd9, 0xf7, 0xc6, 0xfd, 0x23, 0xe0, 0x00, 0x68, + 0xff, 0xf7, 0xf2, 0xf9, 0x1f, 0xe0, 0x00, 0x68, 0xff, 0xf7, 0xb4, 0xf9, + 0x1b, 0xe0, 0x00, 0x68, 0xff, 0xf7, 0xa0, 0xfc, 0x17, 0xe0, 0x00, 0x68, + 0x2f, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0xff, 0xf7, 0x49, 0xbc, 0x01, 0x20, + 0x10, 0xe0, 0x20, 0x46, 0xd9, 0xf7, 0xea, 0xfd, 0xdf, 0xf8, 0x40, 0x04, + 0x40, 0xf6, 0x7c, 0x41, 0x02, 0x68, 0x28, 0x46, 0x90, 0x47, 0x04, 0xe0, + 0x00, 0x20, 0x40, 0xf2, 0x53, 0x11, 0xd9, 0xf7, 0xbf, 0xfd, 0x00, 0x20, + 0x2f, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0xbf, 0x24, 0x20, 0x00, 0x40, + 0x96, 0xf8, 0x0a, 0xb0, 0xbb, 0xf1, 0x07, 0x0f, 0xaa, 0xd8, 0xf4, 0x7a, + 0x01, 0x2c, 0xa7, 0xd8, 0x37, 0x7b, 0x01, 0x2f, 0xa4, 0xd8, 0x30, 0x7a, + 0x96, 0xf8, 0x09, 0x80, 0x96, 0xf8, 0x06, 0x90, 0x51, 0x46, 0x00, 0x22, + 0x1a, 0x90, 0x30, 0x79, 0x1c, 0x90, 0x70, 0x79, 0x1b, 0x90, 0xf0, 0x79, + 0x19, 0x90, 0x30, 0x7c, 0x18, 0x90, 0xf0, 0x7b, 0x16, 0x90, 0xb0, 0x7b, + 0x17, 0x90, 0x70, 0x7b, 0x15, 0x90, 0xe8, 0x48, 0x03, 0x68, 0x00, 0x20, + 0x98, 0x47, 0x00, 0x28, 0x00, 0xf0, 0x1e, 0x81, 0x90, 0xf8, 0x06, 0x11, + 0x01, 0x29, 0x40, 0xf0, 0x1c, 0x81, 0x10, 0x90, 0x08, 0x97, 0x00, 0x27, + 0x00, 0x2d, 0xcd, 0xe9, 0x06, 0x98, 0x00, 0xf0, 0x2a, 0x81, 0x18, 0x98, + 0x16, 0x99, 0x4f, 0xf0, 0x00, 0x0e, 0x4f, 0xf0, 0x00, 0x0c, 0x41, 0xea, + 0x00, 0x20, 0x40, 0xf6, 0x9c, 0x71, 0x05, 0x38, 0x80, 0xb2, 0x88, 0x42, + 0x4f, 0xf0, 0x00, 0x00, 0x38, 0xbf, 0x01, 0x20, 0xdd, 0xe9, 0x19, 0x32, + 0x43, 0xea, 0x02, 0x22, 0xd5, 0x4b, 0x42, 0xea, 0x08, 0x42, 0xff, 0x3a, + 0x9a, 0x42, 0x4f, 0xf0, 0x00, 0x02, 0x38, 0xbf, 0x01, 0x22, 0x10, 0x40, + 0x09, 0x90, 0x17, 0x98, 0x15, 0x9a, 0x42, 0xea, 0x00, 0x20, 0x05, 0x38, + 0x80, 0xb2, 0x88, 0x42, 0x4f, 0xf0, 0x00, 0x00, 0x38, 0xbf, 0x01, 0x20, + 0xdd, 0xe9, 0x1b, 0x21, 0x41, 0xea, 0x02, 0x21, 0x41, 0xea, 0x09, 0x41, + 0x4f, 0xf0, 0x00, 0x09, 0xff, 0x39, 0x99, 0x42, 0x4f, 0xf0, 0x00, 0x01, + 0x4f, 0xf0, 0x00, 0x03, 0x38, 0xbf, 0x01, 0x21, 0x08, 0x40, 0x0a, 0x90, + 0x00, 0x20, 0x0b, 0x90, 0x0e, 0xeb, 0xce, 0x00, 0x30, 0x44, 0x81, 0x7c, + 0xef, 0x29, 0x1d, 0x91, 0x00, 0xf2, 0x3a, 0x81, 0xc1, 0x7c, 0x02, 0x7d, + 0x41, 0xea, 0x02, 0x21, 0xb7, 0xeb, 0x11, 0x3f, 0x1e, 0x91, 0x40, 0xf0, + 0x31, 0x81, 0x41, 0x7d, 0x82, 0x7d, 0x41, 0xea, 0x02, 0x28, 0xb7, 0xeb, + 0x18, 0x3f, 0x40, 0xf0, 0x29, 0x81, 0x81, 0x7e, 0x42, 0x7e, 0x90, 0xf9, + 0x17, 0x70, 0x11, 0x91, 0x90, 0xf9, 0x18, 0x10, 0x14, 0x91, 0x1e, 0x98, + 0x68, 0xb1, 0x01, 0x20, 0xbc, 0xf1, 0x00, 0x0f, 0x1c, 0xbf, 0x60, 0x46, + 0x4f, 0xf0, 0x01, 0x0c, 0x0a, 0x99, 0x41, 0xea, 0x0c, 0x01, 0x01, 0x29, + 0x40, 0xf0, 0x12, 0x81, 0x84, 0x46, 0xb8, 0xf1, 0x00, 0x0f, 0x0a, 0xd0, + 0x01, 0x20, 0x00, 0x2b, 0x1c, 0xbf, 0x18, 0x46, 0x01, 0x23, 0x09, 0x99, + 0x19, 0x43, 0x01, 0x29, 0x40, 0xf0, 0x04, 0x81, 0x03, 0x46, 0x1e, 0x98, + 0x50, 0xea, 0x08, 0x00, 0x00, 0xf0, 0x00, 0x81, 0x9f, 0x48, 0x00, 0x78, + 0x03, 0x28, 0x06, 0xd0, 0x00, 0x2f, 0x00, 0xf1, 0xf9, 0x80, 0x14, 0x99, + 0x00, 0x29, 0x00, 0xf1, 0xf5, 0x80, 0x00, 0x2f, 0xcd, 0xe9, 0x0d, 0xc2, + 0xcd, 0xe9, 0x12, 0xe3, 0x00, 0xf0, 0xee, 0x80, 0x97, 0x49, 0x03, 0x38, + 0xb0, 0xfa, 0x80, 0xf0, 0x09, 0x68, 0x40, 0x09, 0x88, 0x47, 0x38, 0x40, + 0xf9, 0xb2, 0x81, 0x42, 0x40, 0xf0, 0xe2, 0x80, 0xcd, 0xf8, 0x3c, 0x90, + 0x14, 0x9f, 0x00, 0x2f, 0x00, 0xf0, 0xe0, 0x80, 0x8e, 0x48, 0x0c, 0x91, + 0x01, 0x68, 0x8c, 0x48, 0x00, 0x78, 0x03, 0x38, 0xb0, 0xfa, 0x80, 0xf0, + 0x40, 0x09, 0x88, 0x47, 0x38, 0x40, 0x5f, 0xfa, 0x87, 0xf9, 0x81, 0x45, + 0x40, 0xf0, 0xd0, 0x80, 0x87, 0x48, 0x1d, 0x9a, 0x51, 0x46, 0x00, 0x23, + 0x07, 0x68, 0x00, 0x20, 0xb8, 0x47, 0x70, 0xb1, 0x1e, 0x99, 0x10, 0x9a, + 0x00, 0x29, 0x40, 0xd0, 0xb8, 0xf1, 0x00, 0x0f, 0x0e, 0xd1, 0x01, 0x6b, + 0x61, 0xb1, 0x40, 0x6b, 0x50, 0xb1, 0x40, 0x78, 0xff, 0x28, 0x07, 0xd0, + 0x3e, 0xe0, 0x12, 0x99, 0x01, 0x20, 0x88, 0x40, 0x0b, 0x99, 0x01, 0x43, + 0x0b, 0x91, 0x10, 0x9a, 0x79, 0x48, 0x00, 0x21, 0x00, 0x23, 0x07, 0x68, + 0x0c, 0x98, 0xcd, 0xe9, 0x00, 0x09, 0x0e, 0x98, 0x02, 0x90, 0x11, 0x98, + 0x03, 0x90, 0x1e, 0x98, 0xcd, 0xe9, 0x04, 0x08, 0x10, 0x46, 0x1d, 0x9a, + 0xb8, 0x47, 0x00, 0x28, 0x00, 0xf0, 0xa0, 0x80, 0x90, 0xf8, 0x44, 0x10, + 0x12, 0x9b, 0x1f, 0xaa, 0x07, 0x46, 0x90, 0xf8, 0x1e, 0x01, 0x22, 0xf8, + 0x13, 0x10, 0x6c, 0x49, 0x09, 0x68, 0x88, 0x47, 0xdd, 0xf8, 0x3c, 0x90, + 0x13, 0x9b, 0xdd, 0xf8, 0x34, 0xc0, 0xf8, 0x62, 0x00, 0x27, 0x09, 0xf1, + 0x01, 0x09, 0x4f, 0xfa, 0x89, 0xfe, 0xae, 0x45, 0xff, 0xf6, 0x3c, 0xaf, + 0x2c, 0xe0, 0x01, 0x6b, 0x00, 0x29, 0xbb, 0xd0, 0x41, 0x6b, 0x00, 0x29, + 0xb8, 0xd0, 0x09, 0x78, 0xff, 0x29, 0xb5, 0xd0, 0x0c, 0x27, 0x7a, 0xe0, + 0x12, 0x26, 0x15, 0xe0, 0x07, 0x27, 0x00, 0x25, 0x68, 0xe6, 0x55, 0x49, + 0x09, 0x68, 0x88, 0x47, 0x00, 0x25, 0x0c, 0x27, 0x62, 0xe6, 0xa1, 0xf8, + 0x78, 0x02, 0xd3, 0xf7, 0x0f, 0xfe, 0x1f, 0x99, 0xc1, 0xf8, 0x7c, 0x02, + 0x00, 0x26, 0x5a, 0x48, 0x09, 0x21, 0x00, 0x78, 0xd3, 0xf7, 0x12, 0xfe, + 0x66, 0x71, 0x20, 0x46, 0x72, 0xe6, 0x00, 0x20, 0x4f, 0xf0, 0xff, 0x09, + 0x00, 0x23, 0x4f, 0xf0, 0x00, 0x0c, 0x0b, 0x90, 0x10, 0x98, 0x00, 0x27, + 0x90, 0xf8, 0xc0, 0x00, 0x00, 0x28, 0x3f, 0xf4, 0x45, 0xae, 0x4a, 0x48, + 0xbc, 0xf1, 0x00, 0x0f, 0x9e, 0x46, 0x00, 0x68, 0x1e, 0x90, 0x04, 0x97, + 0xdd, 0xe9, 0x17, 0x10, 0x08, 0xbf, 0x01, 0x46, 0x00, 0x2b, 0x08, 0xbf, + 0x08, 0x46, 0x16, 0x9a, 0x13, 0x93, 0xbc, 0xf1, 0x00, 0x0f, 0x15, 0x9b, + 0x08, 0xbf, 0x13, 0x46, 0xbe, 0xf1, 0x00, 0x0f, 0x08, 0xbf, 0x1a, 0x46, + 0x42, 0xea, 0x00, 0x20, 0x03, 0x90, 0x43, 0xea, 0x01, 0x20, 0xbc, 0xf1, + 0x00, 0x0f, 0x02, 0x90, 0xdd, 0xe9, 0x1a, 0x81, 0x08, 0xbf, 0x41, 0x46, + 0x1c, 0x9b, 0xdd, 0xf8, 0x64, 0xc0, 0x08, 0xbf, 0x63, 0x46, 0xdd, 0xe9, + 0x06, 0x2e, 0x43, 0xea, 0x01, 0x20, 0x08, 0xbf, 0x72, 0x46, 0x40, 0xea, + 0x02, 0x40, 0x00, 0x90, 0x13, 0x98, 0x00, 0x28, 0x1c, 0xbf, 0x41, 0x46, + 0x63, 0x46, 0x43, 0xea, 0x01, 0x20, 0x18, 0xbf, 0x72, 0x46, 0x40, 0xea, + 0x02, 0x40, 0x22, 0x46, 0x5b, 0x46, 0x01, 0x90, 0x10, 0x98, 0x08, 0x99, + 0x1e, 0x9c, 0xa0, 0x47, 0x00, 0x28, 0x7f, 0xf4, 0xfd, 0xad, 0x01, 0xe0, + 0x12, 0x27, 0x00, 0xe0, 0x11, 0x27, 0xdd, 0xf8, 0x2c, 0xb0, 0x06, 0xe0, + 0x11, 0x27, 0x00, 0xe0, 0x09, 0x27, 0xdd, 0xf8, 0x2c, 0xb0, 0xdd, 0xf8, + 0x3c, 0x90, 0x4f, 0xfa, 0x89, 0xf0, 0x00, 0x28, 0x3f, 0xf5, 0x7f, 0xaf, + 0x19, 0x4c, 0x06, 0xf1, 0x12, 0x08, 0x5f, 0xfa, 0x89, 0xf6, 0x4f, 0xf0, + 0x01, 0x09, 0xbb, 0xf1, 0x00, 0x0f, 0x3f, 0xf4, 0x74, 0xaf, 0x09, 0xfa, + 0x06, 0xf5, 0x15, 0xea, 0x0b, 0x0f, 0x0f, 0xd0, 0x06, 0xeb, 0xc6, 0x00, + 0xd4, 0xf8, 0x00, 0xc0, 0x51, 0x46, 0x00, 0x23, 0x18, 0xf8, 0x00, 0x20, + 0x00, 0x20, 0xe0, 0x47, 0x10, 0xb1, 0x10, 0x49, 0x09, 0x68, 0x88, 0x47, + 0x2b, 0xea, 0x05, 0x0b, 0x70, 0x1e, 0x00, 0x2e, 0x4f, 0xf0, 0x00, 0x05, + 0x06, 0x46, 0xe0, 0xdc, 0xc2, 0xe5, 0x00, 0xbf, 0x5c, 0xdc, 0x05, 0x00, + 0xcc, 0x8e, 0x08, 0x00, 0x84, 0xb8, 0x08, 0x00, 0x01, 0xff, 0x0f, 0x00, + 0x95, 0x53, 0x01, 0x00, 0xdc, 0x8e, 0x08, 0x00, 0xf8, 0x9b, 0x08, 0x00, + 0x90, 0xb8, 0x08, 0x00, 0x7c, 0xb6, 0x08, 0x00, 0xb8, 0x8e, 0x08, 0x00, + 0xb0, 0x8e, 0x08, 0x00, 0x28, 0x9c, 0x08, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0x0c, 0x9c, 0x08, 0x00, 0x67, 0x34, 0x01, 0x00, 0x14, 0xe6, 0x08, 0x00, + 0x1c, 0xb5, 0x00, 0xf0, 0xf1, 0xf8, 0xdc, 0xf7, 0x5b, 0xfd, 0x0c, 0x48, + 0x00, 0x78, 0x01, 0x28, 0x0b, 0xd1, 0x0b, 0x48, 0x00, 0x21, 0x4f, 0xf4, + 0x7a, 0x72, 0x4f, 0xf4, 0x7a, 0x73, 0x04, 0x68, 0x00, 0x20, 0xcd, 0xe9, + 0x00, 0x00, 0x29, 0x20, 0xa0, 0x47, 0xdb, 0xf7, 0x2f, 0xfb, 0xde, 0xf7, + 0xe9, 0xf8, 0xbd, 0xe8, 0x1c, 0x40, 0x04, 0xf0, 0x2f, 0xb8, 0x00, 0xbf, + 0xf8, 0xdd, 0x05, 0x00, 0xcc, 0x9b, 0x08, 0x00, 0x80, 0xb5, 0x60, 0xb1, + 0x1c, 0x48, 0x00, 0x68, 0x80, 0x47, 0x1c, 0x48, 0x00, 0x78, 0x89, 0x28, + 0x20, 0xd1, 0xd9, 0xf7, 0xdb, 0xfb, 0x90, 0xb1, 0x34, 0x48, 0x01, 0x21, + 0x19, 0xe0, 0xd9, 0xf7, 0xd5, 0xfb, 0x30, 0xb9, 0x36, 0x48, 0x90, 0xf8, + 0x00, 0x04, 0x10, 0xb1, 0x15, 0x48, 0x02, 0x21, 0x01, 0x70, 0x15, 0x48, + 0x00, 0x68, 0x40, 0x68, 0x60, 0xb1, 0x80, 0x47, 0x0a, 0xe0, 0xd9, 0xf7, + 0xc5, 0xfb, 0x20, 0xb9, 0x0e, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x28, + 0xe4, 0xd0, 0x27, 0x48, 0x02, 0x21, 0x01, 0x70, 0x0d, 0x48, 0x01, 0x21, + 0x02, 0x68, 0x06, 0x20, 0x90, 0x47, 0x0c, 0x48, 0x4f, 0xf4, 0x7a, 0x71, + 0x4f, 0xf4, 0x7a, 0x72, 0x00, 0x23, 0xd0, 0xf8, 0x00, 0xc0, 0x01, 0x20, + 0xbd, 0xe8, 0x80, 0x40, 0x60, 0x47, 0x00, 0xbf, 0xd8, 0x8f, 0x08, 0x00, + 0xe8, 0x2e, 0x01, 0x00, 0xdc, 0x8f, 0x08, 0x00, 0x98, 0x58, 0x01, 0x00, + 0x48, 0x36, 0x01, 0x00, 0x18, 0x9d, 0x08, 0x00, 0x20, 0x9d, 0x08, 0x00, + 0xb0, 0xb5, 0x00, 0xf0, 0x8b, 0xf8, 0x14, 0x4c, 0x20, 0x78, 0x01, 0x28, + 0x06, 0xd1, 0x04, 0x20, 0x20, 0x70, 0x12, 0x48, 0x01, 0x68, 0x12, 0x48, + 0x00, 0x78, 0x88, 0x47, 0x11, 0x4d, 0x72, 0xb6, 0x28, 0x68, 0x40, 0x00, + 0x01, 0x30, 0x28, 0x60, 0x20, 0x78, 0x02, 0x28, 0x0a, 0xd0, 0x03, 0x28, + 0x0a, 0xd1, 0x04, 0x20, 0x20, 0x70, 0x0c, 0x48, 0x02, 0x68, 0x0c, 0x48, + 0x00, 0xf1, 0x2c, 0x01, 0x90, 0x47, 0x01, 0xe0, 0x04, 0x20, 0x20, 0x70, + 0x28, 0x68, 0x40, 0x08, 0x28, 0x60, 0x28, 0x68, 0x80, 0xf3, 0x10, 0x88, + 0xb0, 0xbd, 0x00, 0xbf, 0xc1, 0xf0, 0x05, 0x00, 0xf0, 0xa4, 0x08, 0x00, + 0xde, 0xf1, 0x01, 0x00, 0x24, 0x36, 0x01, 0x00, 0xa4, 0xa6, 0x08, 0x00, + 0xf8, 0xf5, 0x01, 0x00, 0x70, 0xb5, 0x04, 0x46, 0x00, 0x68, 0x08, 0xb3, + 0x11, 0x4d, 0x12, 0x4e, 0x02, 0x78, 0x16, 0x2a, 0x14, 0xd8, 0x02, 0xeb, + 0x42, 0x01, 0x55, 0xf8, 0x21, 0x10, 0x79, 0xb1, 0x02, 0xeb, 0x42, 0x02, + 0x05, 0xeb, 0x82, 0x02, 0x12, 0x79, 0x42, 0xf0, 0x02, 0x02, 0x03, 0x2a, + 0x06, 0xd1, 0x91, 0xf8, 0x24, 0x21, 0x1a, 0xb1, 0x91, 0xf8, 0x24, 0x11, + 0x46, 0x29, 0x08, 0xd1, 0x31, 0x68, 0x20, 0x46, 0x88, 0x47, 0xd9, 0xf7, + 0xff, 0xfa, 0x20, 0x68, 0x00, 0x28, 0xdf, 0xd1, 0x00, 0x20, 0x70, 0xbd, + 0xe8, 0x72, 0x01, 0x00, 0x24, 0x9d, 0x08, 0x00, 0x07, 0x48, 0x08, 0x49, + 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x09, 0x49, + 0x01, 0x60, 0x09, 0x48, 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, 0x0a, 0x49, + 0x01, 0x60, 0x70, 0x47, 0xa0, 0x9d, 0x08, 0x00, 0x71, 0xd5, 0x04, 0x00, + 0x1c, 0xe6, 0x08, 0x00, 0xcd, 0xce, 0x04, 0x00, 0xc8, 0x8d, 0x08, 0x00, + 0xb5, 0xd5, 0x04, 0x00, 0x88, 0xaa, 0x08, 0x00, 0x49, 0xd6, 0x04, 0x00, + 0x44, 0xd5, 0x08, 0x00, 0xb9, 0xd6, 0x04, 0x00, 0x49, 0xf2, 0x1d, 0x2c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf6, 0x8d, 0x5c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x64, 0x61, 0x74, 0x61, + 0x50, 0x61, 0x74, 0x68, 0x49, 0x44, 0x3a, 0x20, 0x30, 0x78, 0x25, 0x30, + 0x32, 0x78, 0x00, 0x64, 0x61, 0x74, 0x61, 0x50, 0x61, 0x74, 0x68, 0x44, + 0x69, 0x72, 0x3a, 0x20, 0x30, 0x78, 0x25, 0x30, 0x32, 0x78, 0x00, 0x63, + 0x6f, 0x64, 0x65, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x63, 0x66, 0x67, + 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x20, 0x69, 0x73, 0x20, 0x25, 0x64, + 0x00, 0x53, 0x65, 0x74, 0x75, 0x70, 0x49, 0x53, 0x4f, 0x44, 0x61, 0x74, + 0x61, 0x70, 0x61, 0x74, 0x68, 0x3a, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x00, 0x00, 0x00, 0x10, 0xb5, 0x01, 0x79, 0x02, 0x29, 0x05, 0xd1, + 0x40, 0x79, 0x41, 0x1e, 0x02, 0x29, 0x05, 0xd2, 0x12, 0x24, 0x10, 0xe0, + 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x9e, 0xb8, 0x04, 0x28, 0x07, 0xd1, + 0x0c, 0x48, 0x90, 0xf8, 0x7c, 0x12, 0x01, 0xf0, 0xfe, 0x01, 0x80, 0xf8, + 0x7c, 0x12, 0x01, 0xe0, 0x09, 0x49, 0x08, 0x70, 0x00, 0x24, 0x09, 0x48, + 0x02, 0x21, 0x02, 0x68, 0x4f, 0xf6, 0x51, 0x40, 0x90, 0x47, 0x30, 0xb1, + 0x01, 0x21, 0x44, 0x71, 0x81, 0x71, 0xbd, 0xe8, 0x10, 0x40, 0xd9, 0xf7, + 0x2d, 0xba, 0x10, 0xbd, 0xe8, 0x65, 0x08, 0x00, 0x95, 0x53, 0x01, 0x00, + 0x28, 0x9c, 0x08, 0x00, 0xb0, 0xb5, 0x04, 0x46, 0x31, 0x48, 0x4f, 0xf6, + 0x51, 0x41, 0x00, 0x22, 0x25, 0x23, 0x05, 0x68, 0x02, 0x20, 0xa8, 0x47, + 0x90, 0xb1, 0xa1, 0x78, 0x06, 0x29, 0x09, 0xd1, 0xa1, 0x79, 0xe2, 0x79, + 0x91, 0x42, 0x05, 0xd8, 0x23, 0x79, 0x65, 0x79, 0x43, 0xea, 0x05, 0x23, + 0x06, 0x2b, 0x06, 0xd2, 0x12, 0x21, 0x41, 0x71, 0xbd, 0xe8, 0xb0, 0x40, + 0xd9, 0xf7, 0x08, 0xba, 0xb0, 0xbd, 0x04, 0x4d, 0x29, 0x70, 0x21, 0x7a, + 0xab, 0x80, 0x6a, 0x70, 0xa9, 0x70, 0x00, 0x21, 0xf1, 0xe7, 0x00, 0xbf, + 0x4c, 0xf1, 0x05, 0x00, 0x70, 0xb5, 0x04, 0x46, 0x1c, 0x48, 0x4f, 0xf6, + 0x51, 0x41, 0x00, 0x22, 0x26, 0x23, 0x05, 0x68, 0x04, 0x20, 0xa8, 0x47, + 0x20, 0xb3, 0xa1, 0x78, 0x04, 0x29, 0x22, 0xd1, 0x21, 0x79, 0x62, 0x79, + 0x41, 0xea, 0x02, 0x23, 0x16, 0x2b, 0x1e, 0xd8, 0x14, 0x4e, 0x03, 0xeb, + 0x43, 0x05, 0x56, 0xf8, 0x25, 0x30, 0xc3, 0xb1, 0x06, 0xeb, 0x85, 0x05, + 0x2d, 0x79, 0x03, 0x2d, 0x13, 0xd1, 0x93, 0xf8, 0xd1, 0x51, 0x0b, 0x2d, + 0x0a, 0xd3, 0xa4, 0x79, 0x93, 0xf8, 0x35, 0x31, 0x0c, 0x4d, 0x68, 0x26, + 0x13, 0xfb, 0x06, 0x53, 0x04, 0xf0, 0x03, 0x04, 0x83, 0xf8, 0x50, 0x40, + 0x00, 0x23, 0x03, 0xe0, 0x70, 0xbd, 0x12, 0x23, 0x00, 0xe0, 0x02, 0x23, + 0x02, 0x72, 0xc1, 0x71, 0x43, 0x71, 0xbd, 0xe8, 0x70, 0x40, 0xd9, 0xf7, + 0xc1, 0xb9, 0x00, 0xbf, 0x2c, 0x9c, 0x08, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0xb0, 0xe6, 0x05, 0x00, 0xc1, 0x78, 0x26, 0x29, 0x08, 0xbf, 0xff, 0xf7, + 0xb9, 0xbf, 0x25, 0x29, 0x05, 0xd0, 0x01, 0x29, 0x18, 0xbf, 0x00, 0xf0, + 0x0b, 0xb8, 0xff, 0xf7, 0x57, 0xbf, 0xff, 0xf7, 0x85, 0xbf, 0x70, 0x47, + 0x49, 0xf6, 0x4d, 0x1c, 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf6, 0xf9, 0x2c, 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x80, 0xb5, 0x00, 0xf0, 0x8b, 0xf8, 0x03, 0x48, 0x01, 0x68, 0x41, 0xf0, + 0x00, 0x51, 0x01, 0x60, 0x80, 0xbd, 0x00, 0xbf, 0x28, 0x60, 0x21, 0x40, + 0xb0, 0xb5, 0x00, 0xf0, 0x85, 0xf8, 0x09, 0x49, 0x09, 0x4a, 0x0a, 0x4b, + 0x0a, 0x4c, 0x01, 0x20, 0x0d, 0x68, 0x25, 0xf0, 0x01, 0x05, 0x05, 0x43, + 0x0d, 0x60, 0x10, 0x70, 0x1d, 0x68, 0x44, 0xf8, 0x20, 0x50, 0x01, 0x38, + 0xc5, 0xb2, 0x02, 0x2d, 0xf2, 0xd3, 0xb0, 0xbd, 0x04, 0x10, 0x00, 0x40, + 0x74, 0x87, 0x08, 0x00, 0x84, 0x00, 0x21, 0x40, 0xc4, 0xf0, 0x05, 0x00, + 0xb0, 0xb5, 0x05, 0x46, 0x05, 0x48, 0x0c, 0x46, 0x00, 0x68, 0x80, 0x47, + 0xd4, 0xf8, 0xd8, 0x10, 0x40, 0x1a, 0xa5, 0xeb, 0x90, 0x10, 0x40, 0xb2, + 0xb0, 0xbd, 0x00, 0xbf, 0xe0, 0xa0, 0x08, 0x00, 0x80, 0xb5, 0x1e, 0x49, + 0x91, 0xf8, 0x3e, 0x26, 0x01, 0x2a, 0x29, 0xd1, 0x1c, 0x4a, 0x52, 0x79, + 0x01, 0x2a, 0x25, 0xd1, 0x91, 0xf8, 0x3f, 0x16, 0x02, 0x29, 0x21, 0xd1, + 0x01, 0x68, 0x91, 0xf9, 0x3a, 0x00, 0xff, 0xf7, 0xdd, 0xff, 0x42, 0x21, + 0x10, 0xf1, 0x46, 0x0f, 0x06, 0xdb, 0x6f, 0xf0, 0x19, 0x02, 0x10, 0x1a, + 0xc0, 0xb2, 0x42, 0x28, 0x38, 0xbf, 0x01, 0x46, 0x11, 0x4a, 0x41, 0xea, + 0x01, 0x40, 0x40, 0xea, 0x01, 0x60, 0x13, 0x68, 0x40, 0xea, 0x01, 0x20, + 0x23, 0xf0, 0x7f, 0x33, 0x18, 0x43, 0x10, 0x60, 0x10, 0x68, 0x20, 0xf0, + 0x7f, 0x00, 0x08, 0x43, 0x10, 0x60, 0x80, 0xbd, 0x08, 0x48, 0x42, 0x22, + 0x01, 0x68, 0x21, 0xf0, 0x7f, 0x31, 0x01, 0xf1, 0x42, 0x31, 0x01, 0x60, + 0x01, 0x68, 0x62, 0xf3, 0x06, 0x01, 0x01, 0x60, 0x80, 0xbd, 0x00, 0xbf, + 0x64, 0xd4, 0x05, 0x00, 0x48, 0xdc, 0x05, 0x00, 0x08, 0xc2, 0x23, 0x40, + 0x03, 0x48, 0x04, 0x49, 0x01, 0x60, 0x04, 0x48, 0x04, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0xb4, 0x9f, 0x08, 0x00, 0x61, 0xd9, 0x04, 0x00, + 0xd0, 0xbc, 0x08, 0x00, 0x49, 0xd9, 0x04, 0x00, 0x49, 0xf6, 0xbd, 0x7c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4a, 0xf6, 0x69, 0x6c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x80, 0xb5, 0x19, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x18, 0xb9, 0x00, 0x20, 0x46, 0x21, 0xd9, 0xf7, + 0x19, 0xf9, 0x16, 0x48, 0x00, 0x21, 0x01, 0x60, 0x15, 0x48, 0x01, 0x60, + 0x15, 0x48, 0x00, 0x68, 0x80, 0x0f, 0x02, 0x28, 0x03, 0xd8, 0x00, 0x20, + 0x4f, 0x21, 0xd3, 0xf7, 0xa9, 0xfa, 0x12, 0x48, 0x00, 0x68, 0x80, 0x0f, + 0x02, 0x28, 0x03, 0xd8, 0x00, 0x20, 0x50, 0x21, 0xd3, 0xf7, 0xa0, 0xfa, + 0x0e, 0x48, 0x0f, 0x49, 0x0f, 0x4a, 0x00, 0x78, 0x09, 0x68, 0x42, 0xf8, + 0x20, 0x10, 0x0e, 0x48, 0x00, 0x78, 0x28, 0xb9, 0x0d, 0x48, 0x0e, 0x49, + 0x00, 0x88, 0x40, 0xf0, 0x8a, 0x00, 0x08, 0x60, 0x0c, 0x48, 0x01, 0x21, + 0x41, 0x70, 0x80, 0xbd, 0x18, 0xbb, 0x08, 0x00, 0xc0, 0x10, 0x21, 0x40, + 0xb0, 0x20, 0x21, 0x40, 0xcc, 0x20, 0x21, 0x40, 0xec, 0x10, 0x21, 0x40, + 0x74, 0x87, 0x08, 0x00, 0x04, 0xe7, 0x08, 0x00, 0xc0, 0x5d, 0x01, 0x00, + 0x6f, 0x34, 0x01, 0x00, 0x26, 0x21, 0x01, 0x00, 0x04, 0x08, 0x00, 0x40, + 0x3c, 0x88, 0x01, 0x00, 0x10, 0xb5, 0x0d, 0x48, 0x0d, 0x4c, 0x00, 0x21, + 0x01, 0x60, 0x21, 0x60, 0x0b, 0xf0, 0x2a, 0xf8, 0x4f, 0xf4, 0x80, 0x30, + 0x20, 0x60, 0x0a, 0x48, 0x00, 0x68, 0x80, 0x47, 0x09, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x09, 0x48, 0x00, 0x68, 0xc0, 0x07, 0x14, 0xbf, 0x08, 0x48, + 0x08, 0x48, 0x00, 0x68, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0x47, 0x00, 0xbf, + 0xd4, 0x10, 0x21, 0x40, 0xe4, 0x10, 0x21, 0x40, 0x5c, 0xbb, 0x08, 0x00, + 0xb0, 0xa0, 0x08, 0x00, 0x04, 0x10, 0x00, 0x40, 0x28, 0xbb, 0x08, 0x00, + 0x2c, 0xbb, 0x08, 0x00, 0x80, 0xb5, 0x00, 0xf0, 0x29, 0xf8, 0xbd, 0xe8, + 0x80, 0x40, 0x0b, 0xf0, 0x09, 0xb8, 0x80, 0xb5, 0x00, 0xf0, 0x28, 0xf8, + 0xbd, 0xe8, 0x80, 0x40, 0x0b, 0xf0, 0x02, 0xb8, 0x06, 0x48, 0x07, 0x49, + 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, + 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0xfc, 0xe6, 0x08, 0x00, 0x15, 0xdb, 0x04, 0x00, 0x08, 0xe7, 0x08, 0x00, + 0x7d, 0xda, 0x04, 0x00, 0xd0, 0xe6, 0x08, 0x00, 0x69, 0xdb, 0x04, 0x00, + 0xe8, 0xe6, 0x08, 0x00, 0x77, 0xdb, 0x04, 0x00, 0x4b, 0xf6, 0x1b, 0x5c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0xad, 0x6c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x70, 0xb5, 0x00, 0xf0, + 0x1f, 0xf8, 0x04, 0x46, 0x78, 0xb1, 0x94, 0xf8, 0x35, 0x01, 0x08, 0x4d, + 0x68, 0x26, 0x68, 0x21, 0x10, 0xfb, 0x06, 0x50, 0xd5, 0xf7, 0xaa, 0xfb, + 0x94, 0xf8, 0x35, 0x01, 0x4f, 0xf0, 0xff, 0x31, 0x10, 0xfb, 0x06, 0x50, + 0x01, 0x66, 0x20, 0x46, 0x70, 0xbd, 0x00, 0xbf, 0xb0, 0xe6, 0x05, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, 0xcc, 0xc9, 0x08, 0x00, + 0xd9, 0xdb, 0x04, 0x00, 0x4e, 0xf6, 0x9d, 0x3c, 0xc1, 0xf2, 0x0e, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x70, 0xb5, 0x04, 0x46, 0x00, 0x78, 0x65, 0x78, + 0x0f, 0x28, 0x06, 0xd0, 0x0e, 0x28, 0x07, 0xbf, 0xe1, 0x78, 0x20, 0x79, + 0xff, 0x20, 0xff, 0x21, 0x01, 0xe0, 0x21, 0x79, 0x60, 0x79, 0x13, 0x4a, + 0x92, 0x6a, 0x32, 0xb1, 0x12, 0x4b, 0x52, 0xf8, 0x08, 0x2c, 0x03, 0xf5, + 0x00, 0x73, 0x9a, 0x42, 0x01, 0xd0, 0x00, 0x20, 0x70, 0xbd, 0x41, 0xea, + 0x00, 0x20, 0xda, 0xf7, 0x03, 0xfe, 0x00, 0x28, 0xf7, 0xd0, 0x0c, 0x48, + 0x02, 0x35, 0x04, 0x22, 0x29, 0x46, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, + 0x09, 0x48, 0x00, 0x21, 0x22, 0x46, 0x2b, 0x46, 0x06, 0x68, 0x40, 0xf2, + 0x24, 0x70, 0xb0, 0x47, 0x20, 0x46, 0xd9, 0xf7, 0x37, 0xf8, 0x01, 0x20, + 0x70, 0xbd, 0x00, 0xbf, 0x1c, 0x3b, 0x01, 0x00, 0x68, 0x8a, 0x01, 0x00, + 0xa8, 0xa2, 0x08, 0x00, 0x4c, 0xa2, 0x08, 0x00, 0xf8, 0xb5, 0x14, 0x46, + 0x0d, 0x46, 0x00, 0xeb, 0x40, 0x01, 0x09, 0x4a, 0x06, 0x46, 0x48, 0x01, + 0x10, 0x58, 0x28, 0xb1, 0x02, 0xeb, 0x41, 0x17, 0xd9, 0xf7, 0x1e, 0xf8, + 0x00, 0x20, 0x38, 0x60, 0x30, 0x46, 0x29, 0x46, 0x22, 0x46, 0xbd, 0xe8, + 0xf8, 0x40, 0x00, 0xf0, 0x37, 0xba, 0x00, 0xbf, 0x54, 0xf1, 0x05, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x8b, 0xb0, 0x01, 0x90, 0x00, 0x20, 0xdf, 0xf8, + 0x34, 0x92, 0x0a, 0x90, 0xcd, 0xe9, 0x06, 0x00, 0xcd, 0xe9, 0x04, 0x00, + 0xcd, 0xe9, 0x08, 0x00, 0xcd, 0xe9, 0x02, 0x00, 0x72, 0xb6, 0xd9, 0xf8, + 0x00, 0x00, 0x40, 0x00, 0x01, 0x30, 0xc9, 0xf8, 0x00, 0x00, 0x85, 0x48, + 0xc6, 0x68, 0x56, 0xb3, 0x83, 0x48, 0x84, 0x4f, 0xdf, 0xf8, 0x10, 0xb2, + 0x0d, 0xf1, 0x14, 0x08, 0x0d, 0xf1, 0x20, 0x0a, 0x00, 0xf1, 0x0c, 0x04, + 0x3a, 0x68, 0x20, 0x46, 0x31, 0x46, 0x35, 0x46, 0x90, 0x47, 0x06, 0x46, + 0x28, 0x78, 0x3e, 0x28, 0x15, 0xd1, 0xa8, 0x78, 0x0d, 0x28, 0x09, 0xd0, + 0x07, 0x28, 0x10, 0xd1, 0xdb, 0xf8, 0x00, 0x20, 0x20, 0x46, 0x29, 0x46, + 0x90, 0x47, 0x28, 0x46, 0x51, 0x46, 0x06, 0xe0, 0xdb, 0xf8, 0x00, 0x20, + 0x20, 0x46, 0x29, 0x46, 0x90, 0x47, 0x28, 0x46, 0x41, 0x46, 0xd5, 0xf7, + 0x37, 0xfb, 0x00, 0x2e, 0xde, 0xd1, 0xd9, 0xf8, 0x00, 0x00, 0x4f, 0xf0, + 0x00, 0x08, 0x40, 0x08, 0xc9, 0xf8, 0x00, 0x00, 0xd9, 0xf8, 0x00, 0x00, + 0x80, 0xf3, 0x10, 0x88, 0x08, 0x9d, 0x00, 0x2d, 0x40, 0xd0, 0xdf, 0xf8, + 0xa0, 0xb1, 0xdf, 0xf8, 0xa0, 0xa1, 0x08, 0xae, 0xdb, 0xf8, 0x00, 0x20, + 0x2f, 0x79, 0x95, 0xf8, 0x03, 0x90, 0x55, 0xf8, 0x08, 0x4c, 0x30, 0x46, + 0x29, 0x46, 0x90, 0x47, 0x78, 0xb1, 0x01, 0x46, 0x49, 0xea, 0x07, 0x27, + 0xc8, 0x78, 0x0b, 0x79, 0xdb, 0xf8, 0x00, 0x20, 0x40, 0xea, 0x03, 0x20, + 0x87, 0x42, 0x0b, 0xd0, 0x30, 0x46, 0x90, 0x47, 0x01, 0x46, 0x00, 0x28, + 0xf2, 0xd1, 0xdb, 0xf8, 0x00, 0x20, 0x30, 0x46, 0x29, 0x46, 0x90, 0x47, + 0x05, 0x46, 0x14, 0xe0, 0x30, 0x46, 0x29, 0x46, 0x90, 0x47, 0xda, 0xf8, + 0x00, 0x20, 0x07, 0x46, 0x30, 0x46, 0x29, 0x46, 0x90, 0x47, 0xb8, 0xf1, + 0x00, 0x0f, 0x03, 0xd1, 0x20, 0x89, 0x01, 0x99, 0x88, 0x42, 0x07, 0xd2, + 0x28, 0x46, 0x02, 0xa9, 0xd5, 0xf7, 0xec, 0xfa, 0x3d, 0x46, 0x00, 0x2d, + 0xc6, 0xd1, 0x01, 0xe0, 0xa8, 0x46, 0xf9, 0xe7, 0x05, 0x9f, 0xc7, 0xb3, + 0x46, 0x4c, 0xdf, 0xf8, 0x1c, 0xb1, 0xdf, 0xf8, 0x0c, 0x91, 0x05, 0xad, + 0x22, 0x68, 0x7e, 0x78, 0x57, 0xf8, 0x08, 0xac, 0x28, 0x46, 0x39, 0x46, + 0x90, 0x47, 0x48, 0xb1, 0x01, 0x46, 0x48, 0x78, 0x22, 0x68, 0x86, 0x42, + 0x0a, 0xd0, 0x28, 0x46, 0x90, 0x47, 0x01, 0x46, 0x00, 0x28, 0xf6, 0xd1, + 0x22, 0x68, 0x28, 0x46, 0x39, 0x46, 0x90, 0x47, 0x07, 0x46, 0x15, 0xe0, + 0x28, 0x46, 0x39, 0x46, 0x90, 0x47, 0xdb, 0xf8, 0x00, 0x20, 0x06, 0x46, + 0x28, 0x46, 0x39, 0x46, 0x90, 0x47, 0xb8, 0xf1, 0x00, 0x0f, 0x04, 0xd1, + 0xba, 0xf8, 0x08, 0x00, 0x01, 0x99, 0x88, 0x42, 0x07, 0xd2, 0x38, 0x46, + 0x02, 0xa9, 0xd5, 0xf7, 0xb1, 0xfa, 0x37, 0x46, 0x00, 0x2f, 0xcf, 0xd1, + 0x03, 0xe0, 0xb8, 0x46, 0xf9, 0xe7, 0xdf, 0xf8, 0xa0, 0x90, 0xb8, 0xf1, + 0x00, 0x0f, 0x1b, 0xd1, 0xdd, 0xf8, 0x14, 0x80, 0xb8, 0xf1, 0x00, 0x0f, + 0x0e, 0xd0, 0x25, 0x4c, 0x05, 0xad, 0x58, 0xf8, 0x08, 0x0c, 0x01, 0x99, + 0x00, 0x89, 0x88, 0x42, 0x09, 0xd2, 0x22, 0x68, 0x28, 0x46, 0x41, 0x46, + 0x90, 0x47, 0x80, 0x46, 0x00, 0x28, 0xf2, 0xd1, 0x4f, 0xf0, 0x00, 0x08, + 0x04, 0xe0, 0x1d, 0x48, 0x41, 0x46, 0x02, 0x68, 0x05, 0xa8, 0x90, 0x47, + 0x1b, 0x4c, 0x08, 0xa9, 0x72, 0xb6, 0xd9, 0xf8, 0x00, 0x00, 0x40, 0x00, + 0x01, 0x30, 0xc9, 0xf8, 0x00, 0x00, 0x14, 0x48, 0x22, 0x68, 0x00, 0xf1, + 0x0c, 0x05, 0x28, 0x46, 0x90, 0x47, 0x22, 0x68, 0x05, 0xa9, 0x28, 0x46, + 0x90, 0x47, 0xd9, 0xf8, 0x00, 0x00, 0x40, 0x08, 0xc9, 0xf8, 0x00, 0x00, + 0xd9, 0xf8, 0x00, 0x00, 0x80, 0xf3, 0x10, 0x88, 0x02, 0x98, 0x60, 0xb1, + 0x0d, 0x4c, 0x02, 0xa8, 0x21, 0x68, 0x88, 0x47, 0x38, 0xb1, 0x02, 0xad, + 0xd8, 0xf7, 0xfc, 0xfe, 0x21, 0x68, 0x28, 0x46, 0x88, 0x47, 0x00, 0x28, + 0xf8, 0xd1, 0x40, 0x46, 0x0b, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0xbf, + 0x24, 0x36, 0x01, 0x00, 0x2c, 0xba, 0x01, 0x00, 0xec, 0xa0, 0x08, 0x00, + 0xe8, 0xa0, 0x08, 0x00, 0x24, 0xfa, 0x08, 0x00, 0x24, 0x9d, 0x08, 0x00, + 0xb0, 0xb5, 0x14, 0x46, 0x0d, 0x46, 0x00, 0xf0, 0x09, 0xf9, 0x20, 0x68, + 0x00, 0xb1, 0xb0, 0xbd, 0xa8, 0x1c, 0x80, 0xb2, 0xff, 0xf7, 0xc8, 0xfe, + 0x20, 0x60, 0xb0, 0xbd, 0x02, 0x78, 0x0e, 0x2a, 0x0c, 0xd1, 0x0a, 0x4a, + 0x12, 0x68, 0x4a, 0xb1, 0xc2, 0x78, 0x03, 0x79, 0x42, 0xea, 0x03, 0x22, + 0x4f, 0xf6, 0x70, 0x53, 0x9a, 0x42, 0x01, 0xd1, 0x82, 0x79, 0x0a, 0xb1, + 0x00, 0xf0, 0xf4, 0xb8, 0x02, 0x7a, 0x42, 0xf0, 0x04, 0x02, 0x02, 0x72, + 0x00, 0xf0, 0xee, 0xb8, 0x64, 0x52, 0x01, 0x00, 0x10, 0xb5, 0x03, 0x4c, + 0x24, 0x68, 0xa0, 0x47, 0x08, 0xb1, 0x02, 0x99, 0xc1, 0x71, 0x10, 0xbd, + 0x2c, 0x9c, 0x08, 0x00, 0xf8, 0xb5, 0x07, 0x46, 0x00, 0x20, 0x1c, 0x46, + 0x15, 0x46, 0x0e, 0x46, 0x6a, 0x46, 0x00, 0x90, 0x60, 0x48, 0x39, 0x46, + 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, 0x00, 0x98, 0x00, 0x28, 0x3f, 0xd0, + 0x02, 0x30, 0x39, 0x46, 0xd5, 0xf7, 0x7a, 0xfe, 0x00, 0x98, 0xa1, 0x1c, + 0x86, 0x70, 0x1d, 0x4e, 0x00, 0x98, 0xc5, 0x70, 0x20, 0x78, 0x00, 0x9a, + 0x10, 0x71, 0x60, 0x78, 0x50, 0x71, 0x90, 0x1d, 0xb0, 0x47, 0xa0, 0x79, + 0x00, 0x9a, 0xe1, 0x1d, 0x90, 0x72, 0x02, 0xf1, 0x0b, 0x00, 0xb0, 0x47, + 0xe0, 0x7a, 0x00, 0x99, 0x04, 0xf1, 0x0c, 0x05, 0xc8, 0x73, 0x01, 0xf1, + 0x10, 0x00, 0x29, 0x46, 0xb0, 0x47, 0x15, 0xf8, 0x02, 0x1b, 0x60, 0x7b, + 0x41, 0xea, 0x00, 0x20, 0x29, 0x78, 0x6a, 0x78, 0x41, 0xea, 0x02, 0x21, + 0x40, 0xea, 0x01, 0x40, 0xc5, 0xb2, 0x05, 0x28, 0x88, 0xbf, 0x05, 0x25, + 0x75, 0xb1, 0x00, 0x21, 0x01, 0x26, 0x00, 0x98, 0x00, 0xeb, 0x81, 0x00, + 0x04, 0xeb, 0x81, 0x01, 0x14, 0x30, 0x10, 0x31, 0xfd, 0xf7, 0x92, 0xf9, + 0xf1, 0xb2, 0x01, 0x36, 0x8d, 0x42, 0xf2, 0xd8, 0x00, 0x98, 0xf8, 0xbd, + 0x51, 0xb3, 0x04, 0x00, 0x2d, 0xe9, 0xfc, 0x41, 0x05, 0x46, 0x00, 0x20, + 0x98, 0x46, 0x16, 0x46, 0x0f, 0x46, 0x01, 0xaa, 0x01, 0x90, 0x36, 0x48, + 0x29, 0x46, 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, 0x01, 0x98, 0x20, 0xb3, + 0x08, 0x9c, 0x02, 0x30, 0x29, 0x46, 0xd5, 0xf7, 0x25, 0xfe, 0x01, 0x98, + 0x21, 0x46, 0x87, 0x70, 0x01, 0x98, 0xc6, 0x70, 0x01, 0x98, 0x80, 0xf8, + 0x04, 0x80, 0x05, 0x30, 0xfd, 0xf7, 0x6a, 0xf9, 0x20, 0x68, 0x08, 0x25, + 0x08, 0x28, 0x38, 0xbf, 0xc5, 0xb2, 0x75, 0xb1, 0x00, 0x21, 0x01, 0x26, + 0x01, 0x98, 0x00, 0xeb, 0x81, 0x00, 0x04, 0xeb, 0x81, 0x01, 0x09, 0x30, + 0x04, 0x31, 0xfd, 0xf7, 0x59, 0xf9, 0xf1, 0xb2, 0x01, 0x36, 0x8d, 0x42, + 0xf2, 0xd8, 0x01, 0x98, 0xbd, 0xe8, 0xfc, 0x81, 0xb0, 0xb5, 0x1d, 0x46, + 0x04, 0x46, 0x00, 0xf0, 0x57, 0xf8, 0x05, 0xb1, 0xb0, 0xbd, 0x0c, 0x48, + 0x90, 0xf8, 0xd4, 0x0d, 0x00, 0x28, 0xf9, 0xd0, 0x94, 0xf8, 0x35, 0x01, + 0x09, 0x4d, 0x00, 0xeb, 0x40, 0x00, 0x40, 0x01, 0x28, 0x58, 0x00, 0x28, + 0xf0, 0xd1, 0x07, 0x48, 0x01, 0x68, 0x14, 0x20, 0x88, 0x47, 0x94, 0xf8, + 0x35, 0x11, 0x01, 0xeb, 0x41, 0x01, 0x49, 0x01, 0x68, 0x50, 0xb0, 0xbd, + 0x00, 0x69, 0x08, 0x00, 0x54, 0xf1, 0x05, 0x00, 0x4c, 0x9c, 0x08, 0x00, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x08, 0x48, 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, 0x09, 0x49, 0x01, 0x60, + 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x70, 0x47, 0x34, 0xc5, 0x08, 0x00, + 0xa5, 0xdc, 0x04, 0x00, 0x04, 0xe8, 0x08, 0x00, 0x29, 0xdc, 0x04, 0x00, + 0x24, 0x9c, 0x08, 0x00, 0x31, 0xdf, 0x04, 0x00, 0x08, 0xe8, 0x08, 0x00, + 0x4d, 0xdf, 0x04, 0x00, 0x34, 0xda, 0x08, 0x00, 0xad, 0xe0, 0x04, 0x00, + 0x40, 0xf6, 0xe9, 0x6c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x40, 0xf6, 0x21, 0x3c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x40, 0xf6, 0xa1, 0x4c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x45, 0xf2, 0x45, 0x7c, 0xc1, 0xf2, 0x0b, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x70, 0xb5, 0x04, 0x46, 0x19, 0x48, 0x01, 0x21, 0x02, 0x68, 0x02, 0x20, + 0x90, 0x47, 0x18, 0x48, 0x00, 0x68, 0x80, 0x47, 0x17, 0x48, 0x65, 0x79, + 0xa6, 0x79, 0x00, 0x68, 0x80, 0x47, 0x16, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x15, 0x48, 0xff, 0x21, 0x01, 0x70, 0x20, 0x79, 0x40, 0xb9, 0x14, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x13, 0x48, 0x31, 0x46, 0x02, 0x68, 0x28, 0x46, + 0x90, 0x47, 0x20, 0x79, 0x01, 0x28, 0x0c, 0xd1, 0x0e, 0x48, 0x00, 0x68, + 0x80, 0x47, 0xe2, 0x79, 0x09, 0x2a, 0x01, 0xd9, 0x12, 0x20, 0x05, 0xe0, + 0x0c, 0x48, 0x31, 0x46, 0x03, 0x68, 0x28, 0x46, 0x98, 0x47, 0x00, 0x20, + 0x4f, 0xf6, 0x04, 0x41, 0xbd, 0xe8, 0x70, 0x40, 0xd8, 0xf7, 0x5a, 0xbd, + 0x18, 0x9d, 0x08, 0x00, 0x48, 0x9d, 0x08, 0x00, 0x84, 0xda, 0x08, 0x00, + 0x88, 0xda, 0x08, 0x00, 0x55, 0x34, 0x01, 0x00, 0x80, 0xbe, 0x08, 0x00, + 0xc0, 0xd6, 0x08, 0x00, 0x20, 0xbe, 0x08, 0x00, 0xb0, 0xb5, 0x10, 0x4c, + 0x03, 0x20, 0x4f, 0xf6, 0x04, 0x41, 0x00, 0x22, 0x25, 0x78, 0x00, 0x2d, + 0x18, 0xbf, 0x04, 0x20, 0xd8, 0xf7, 0x62, 0xfd, 0x30, 0xb1, 0x2d, 0x21, + 0x81, 0x71, 0x5d, 0xb1, 0xa1, 0x78, 0x01, 0x72, 0x00, 0x21, 0x08, 0xe0, + 0x07, 0x48, 0x4f, 0xf6, 0x04, 0x41, 0x02, 0x68, 0x07, 0x20, 0xbd, 0xe8, + 0xb0, 0x40, 0x10, 0x47, 0x21, 0x7b, 0xc1, 0x71, 0xbd, 0xe8, 0xb0, 0x40, + 0xd8, 0xf7, 0x22, 0xbd, 0x58, 0xf0, 0x05, 0x00, 0xbc, 0x9b, 0x08, 0x00, + 0x80, 0xb5, 0x00, 0x79, 0x50, 0xb1, 0x01, 0x28, 0x0c, 0xd1, 0x0f, 0x48, + 0xc0, 0x7a, 0xc0, 0x07, 0x08, 0xd1, 0x01, 0x20, 0x03, 0xf0, 0x60, 0xf9, + 0x02, 0x46, 0x08, 0xe0, 0x0a, 0x48, 0xc0, 0x7a, 0xc0, 0x07, 0x01, 0xd1, + 0x12, 0x22, 0x02, 0xe0, 0x03, 0xf0, 0x92, 0xf9, 0x00, 0x22, 0x02, 0x20, + 0x4f, 0xf6, 0x04, 0x41, 0xd8, 0xf7, 0x2c, 0xfd, 0x28, 0xb1, 0x2e, 0x21, + 0x81, 0x71, 0xbd, 0xe8, 0x80, 0x40, 0xd8, 0xf7, 0xfb, 0xbc, 0x80, 0xbd, + 0x90, 0xfb, 0x05, 0x00, 0x80, 0xb5, 0x4c, 0x48, 0x00, 0x68, 0x28, 0xb3, + 0x01, 0x68, 0x19, 0xb3, 0x91, 0xf8, 0x38, 0x20, 0x01, 0x2a, 0x1f, 0xd1, + 0x16, 0x22, 0x81, 0xf8, 0x39, 0x20, 0x91, 0xf8, 0xfa, 0x22, 0x02, 0xf0, + 0xfd, 0x02, 0x81, 0xf8, 0xfa, 0x22, 0x1d, 0x4a, 0x12, 0x78, 0x32, 0xb3, + 0x1c, 0x4a, 0x1d, 0x4b, 0x12, 0x68, 0x1b, 0x88, 0x9a, 0x42, 0x07, 0xd0, + 0xd0, 0xf8, 0xc4, 0x30, 0x9a, 0x42, 0x03, 0xd0, 0xd0, 0xf8, 0xc8, 0x00, + 0x98, 0x42, 0x18, 0xd1, 0x17, 0x48, 0x08, 0x22, 0x03, 0x68, 0x83, 0x20, + 0x98, 0x47, 0x04, 0xe0, 0x0c, 0x20, 0x4f, 0xf6, 0x04, 0x41, 0xd8, 0xf7, + 0xcf, 0xfc, 0x02, 0x20, 0x4f, 0xf6, 0x04, 0x41, 0x00, 0x22, 0xd8, 0xf7, + 0xed, 0xfc, 0x28, 0xb1, 0x2f, 0x21, 0x81, 0x71, 0xbd, 0xe8, 0x80, 0x40, + 0xd8, 0xf7, 0xbc, 0xbc, 0x80, 0xbd, 0x23, 0x48, 0x01, 0x22, 0x72, 0xb6, + 0x01, 0x68, 0x49, 0x00, 0x01, 0x31, 0x01, 0x60, 0x20, 0x49, 0x0a, 0x70, + 0x01, 0x68, 0x49, 0x08, 0x01, 0x60, 0x00, 0x68, 0x80, 0xf3, 0x10, 0x88, + 0xe1, 0xe7, 0x00, 0xbf, 0x5f, 0x34, 0x01, 0x00, 0xec, 0x35, 0x01, 0x00, + 0x88, 0x5a, 0x01, 0x00, 0xa8, 0xa0, 0x08, 0x00, 0xc1, 0x78, 0x2f, 0x29, + 0x09, 0xd0, 0x2e, 0x29, 0x0d, 0xd0, 0x2d, 0x29, 0x15, 0xd1, 0x80, 0x78, + 0x01, 0x28, 0x08, 0xbf, 0xff, 0xf7, 0x52, 0xbf, 0x0a, 0xe0, 0x80, 0x78, + 0x01, 0x28, 0x08, 0xbf, 0xff, 0xf7, 0x98, 0xbf, 0x04, 0xe0, 0x81, 0x78, + 0x02, 0x29, 0x08, 0xbf, 0xff, 0xf7, 0x6c, 0xbf, 0x12, 0x20, 0x4f, 0xf6, + 0x04, 0x41, 0xd8, 0xf7, 0x8b, 0xbc, 0x08, 0x49, 0x00, 0x23, 0x72, 0xb6, + 0x0a, 0x68, 0x52, 0x00, 0x01, 0x32, 0x0a, 0x60, 0x05, 0x4a, 0x13, 0x70, + 0x0a, 0x68, 0x52, 0x08, 0x0a, 0x60, 0x09, 0x68, 0x81, 0xf3, 0x10, 0x88, + 0x00, 0xf0, 0x28, 0xb8, 0x24, 0x36, 0x01, 0x00, 0xcc, 0xf0, 0x05, 0x00, + 0x10, 0xb5, 0x04, 0x46, 0x00, 0xf0, 0x26, 0xf8, 0xa0, 0x7a, 0x0a, 0x28, + 0x07, 0xd3, 0x04, 0x49, 0x09, 0x78, 0x88, 0x42, 0x03, 0xd8, 0x03, 0x49, + 0x09, 0x68, 0x81, 0xf8, 0x78, 0x00, 0x10, 0xbd, 0x6a, 0x34, 0x01, 0x00, + 0xf8, 0x35, 0x01, 0x00, 0x03, 0x48, 0x04, 0x49, 0x01, 0x60, 0x04, 0x48, + 0x04, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x94, 0xd3, 0x08, 0x00, + 0xa5, 0xe3, 0x04, 0x00, 0x74, 0xd3, 0x08, 0x00, 0x71, 0xe1, 0x04, 0x00, + 0x4e, 0xf6, 0x99, 0x5c, 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x49, 0xf2, 0x95, 0x3c, 0xc1, 0xf2, 0x07, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0xf0, 0xb5, 0x10, 0x48, 0x01, 0x68, 0xd1, 0xb1, 0x0f, 0x4a, 0x48, 0x1c, + 0x00, 0x24, 0x05, 0x46, 0x92, 0xf8, 0x2d, 0x30, 0x43, 0xf0, 0x18, 0x03, + 0x2d, 0x2c, 0x05, 0xd1, 0x91, 0xf8, 0x2e, 0x60, 0x1e, 0x40, 0x81, 0xf8, + 0x2e, 0x60, 0x03, 0xe0, 0x16, 0x78, 0x2f, 0x78, 0x3e, 0x40, 0x2e, 0x70, + 0x01, 0x34, 0x01, 0x35, 0x01, 0x32, 0x2f, 0x2c, 0x08, 0xbf, 0xf0, 0xbd, + 0xec, 0xe7, 0x02, 0x48, 0xf0, 0xbd, 0x00, 0xbf, 0xf4, 0x68, 0x08, 0x00, + 0x68, 0xed, 0x0e, 0x10, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xd4, 0xc9, 0x08, 0x00, 0x05, 0xe4, 0x04, 0x00, 0x1c, 0xb5, 0x10, 0x4c, + 0x20, 0x78, 0x78, 0xb1, 0x0f, 0x48, 0x00, 0x68, 0x80, 0x47, 0x0f, 0x48, + 0x00, 0x68, 0xc0, 0xb2, 0x52, 0x28, 0x08, 0xd1, 0x01, 0x20, 0x5a, 0x21, + 0x60, 0x70, 0x00, 0x20, 0xbd, 0xe8, 0x1c, 0x40, 0xd2, 0xf7, 0xba, 0xbd, + 0x1c, 0xbd, 0x09, 0x48, 0x00, 0x21, 0x4f, 0xf4, 0x7a, 0x72, 0x4f, 0xf4, + 0x7a, 0x73, 0x04, 0x68, 0x00, 0x20, 0xcd, 0xe9, 0x00, 0x00, 0x29, 0x20, + 0xa0, 0x47, 0x1c, 0xbd, 0xf8, 0xdd, 0x05, 0x00, 0x80, 0xf2, 0x08, 0x00, + 0x80, 0x10, 0x01, 0x30, 0xcc, 0x9b, 0x08, 0x00, 0x80, 0xb5, 0x41, 0x4b, + 0x01, 0x46, 0x00, 0xeb, 0x40, 0x00, 0x13, 0xf8, 0x10, 0x20, 0x03, 0xeb, + 0x40, 0x00, 0x2e, 0x2a, 0x0a, 0xd0, 0x2d, 0x2a, 0x0e, 0xd0, 0x29, 0x2a, + 0x18, 0xd1, 0x06, 0x21, 0xd5, 0xf7, 0xec, 0xfb, 0xbd, 0xe8, 0x80, 0x40, + 0xff, 0xf7, 0xc0, 0xbf, 0x06, 0x21, 0xd5, 0xf7, 0xe5, 0xfb, 0x0a, 0x48, + 0x03, 0x21, 0x04, 0xe0, 0x06, 0x21, 0xd5, 0xf7, 0xdf, 0xfb, 0x07, 0x48, + 0x02, 0x21, 0x80, 0xf8, 0x5e, 0x10, 0xc0, 0x7d, 0xbd, 0xe8, 0x80, 0x40, + 0xdb, 0xf7, 0x9c, 0xbb, 0x08, 0x46, 0xbd, 0xe8, 0x80, 0x40, 0x00, 0xf0, + 0x83, 0xb8, 0x00, 0xbf, 0xd0, 0xe2, 0x05, 0x00, 0x80, 0xb5, 0x0a, 0x48, + 0x00, 0x7f, 0x02, 0x28, 0x06, 0xd0, 0x58, 0xb9, 0x08, 0x48, 0x00, 0x78, + 0x40, 0xb9, 0xed, 0xf7, 0x07, 0xff, 0x05, 0xe0, 0x05, 0x48, 0x00, 0x78, + 0x01, 0x28, 0x08, 0xbf, 0xed, 0xf7, 0x3a, 0xff, 0xbd, 0xe8, 0x80, 0x40, + 0x00, 0xf0, 0x70, 0xb8, 0x18, 0x74, 0x01, 0x00, 0xa1, 0x58, 0x01, 0x00, + 0xb0, 0xb5, 0x50, 0xb1, 0x04, 0x46, 0x00, 0x78, 0xcb, 0x28, 0x0c, 0xd0, + 0xca, 0x28, 0x17, 0xd1, 0x21, 0x7a, 0x60, 0x68, 0xdb, 0xf7, 0x34, 0xff, + 0x0d, 0xe0, 0x00, 0x20, 0x9c, 0x21, 0xbd, 0xe8, 0xb0, 0x40, 0xd8, 0xf7, + 0xa9, 0xbb, 0x09, 0x48, 0x00, 0x21, 0x00, 0x22, 0x00, 0x23, 0x05, 0x68, + 0x40, 0xf2, 0x3a, 0x70, 0xa8, 0x47, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, + 0xd8, 0xf7, 0xba, 0xbb, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, + 0x4d, 0xb8, 0x00, 0xbf, 0x78, 0x9b, 0x08, 0x00, 0x80, 0xb5, 0x00, 0xf0, + 0x4d, 0xf8, 0xbd, 0xe8, 0x80, 0x40, 0x00, 0xf0, 0x05, 0xbe, 0x00, 0xbf, + 0x80, 0xb5, 0x04, 0x48, 0x78, 0x21, 0xd5, 0xf7, 0x7f, 0xfb, 0xbd, 0xe8, + 0x80, 0x40, 0x00, 0xf0, 0x45, 0xb8, 0x00, 0xbf, 0x80, 0x6b, 0x01, 0x00, + 0x0a, 0x48, 0x0b, 0x4a, 0x0d, 0x21, 0xd8, 0x30, 0x01, 0x31, 0x40, 0xf8, + 0x10, 0x2b, 0x21, 0x29, 0xfa, 0xd1, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x08, 0x48, 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, 0x09, 0x49, 0x01, 0x60, + 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x70, 0x47, 0xc0, 0xf5, 0x08, 0x00, + 0xb5, 0xe4, 0x04, 0x00, 0x58, 0xe8, 0x08, 0x00, 0x49, 0xe5, 0x04, 0x00, + 0x9c, 0xcc, 0x08, 0x00, 0x15, 0xe5, 0x04, 0x00, 0xb4, 0xcc, 0x08, 0x00, + 0x99, 0xe5, 0x04, 0x00, 0x8c, 0xcc, 0x08, 0x00, 0xa9, 0xe5, 0x04, 0x00, + 0x42, 0xf6, 0x55, 0x4c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x42, 0xf6, 0xd5, 0x1c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x42, 0xf6, 0xbd, 0x2c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x42, 0xf6, 0x09, 0x4c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x42, 0xf6, 0xd1, 0x0c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x0f, 0x49, 0x90, 0xf8, 0x1d, 0x21, 0xc2, 0xeb, 0x02, 0x12, 0x09, 0x68, + 0x52, 0x01, 0x89, 0x5c, 0x01, 0x29, 0x88, 0xbf, 0x00, 0xf0, 0x20, 0xb8, + 0x90, 0xf8, 0x20, 0x11, 0x90, 0xf8, 0x51, 0x21, 0x90, 0xf8, 0xcd, 0x01, + 0x11, 0xfb, 0x02, 0xf1, 0xb1, 0xfb, 0xf0, 0xf0, 0xc1, 0xb2, 0x05, 0x48, + 0x90, 0xf8, 0xd3, 0x22, 0x00, 0x20, 0x91, 0x42, 0x98, 0xbf, 0x01, 0x20, + 0x70, 0x47, 0x00, 0xbf, 0xe0, 0x35, 0x01, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, 0x44, 0xe8, 0x08, 0x00, + 0x51, 0xe6, 0x04, 0x00, 0x42, 0xf2, 0x15, 0x2c, 0xc1, 0xf2, 0x0f, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xf0, 0xb5, 0x17, 0x48, 0x00, 0x78, 0x40, 0x06, + 0x22, 0xd5, 0x16, 0x48, 0x00, 0x78, 0xf8, 0xb1, 0x15, 0x49, 0x16, 0x4c, + 0x00, 0x23, 0x00, 0x25, 0x0a, 0x68, 0x01, 0x21, 0x54, 0xf8, 0x23, 0x60, + 0x86, 0xb1, 0x0a, 0xb1, 0xb2, 0x42, 0x0d, 0xd0, 0x96, 0xf8, 0xeb, 0x74, + 0xd6, 0xf8, 0xd4, 0x60, 0x76, 0x7f, 0x07, 0xf0, 0x40, 0x07, 0x0e, 0xb1, + 0x27, 0xb1, 0x0d, 0xe0, 0x01, 0x25, 0x00, 0x2f, 0x08, 0xbf, 0x39, 0x46, + 0x01, 0x33, 0x83, 0x42, 0xe8, 0xd3, 0x0d, 0xb1, 0x8c, 0x48, 0x01, 0xe0, + 0x8b, 0x48, 0x00, 0x21, 0x01, 0x71, 0xf0, 0xbd, 0x89, 0x48, 0x01, 0x21, + 0xfa, 0xe7, 0x00, 0xbf, 0xb8, 0x52, 0x01, 0x00, 0x5c, 0x34, 0x01, 0x00, + 0xe4, 0x5e, 0x01, 0x00, 0x10, 0x61, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x8d, 0xb0, 0x04, 0x93, 0x82, 0x4b, 0x01, 0x90, 0x80, 0x48, 0x00, 0x24, + 0xdd, 0xf8, 0x58, 0xb0, 0x4f, 0xf0, 0x01, 0x08, 0x0d, 0xf1, 0x14, 0x0a, + 0x07, 0x94, 0xcd, 0xe9, 0x05, 0x44, 0x00, 0x79, 0x1b, 0x68, 0x53, 0xea, + 0x00, 0x0c, 0x7b, 0x48, 0x18, 0xbf, 0x4f, 0xf0, 0x01, 0x0c, 0x43, 0x78, + 0x90, 0xf8, 0x00, 0x90, 0x80, 0x78, 0x02, 0x90, 0x4f, 0x20, 0x03, 0x93, + 0xbb, 0xf1, 0x00, 0x0f, 0x17, 0xd0, 0xbc, 0xf1, 0x00, 0x0f, 0x0c, 0xd0, + 0x04, 0x9b, 0x25, 0x46, 0x00, 0x2b, 0x18, 0xbf, 0x05, 0xf0, 0x7e, 0x05, + 0x4d, 0x45, 0x02, 0xd0, 0x03, 0x9b, 0x9d, 0x42, 0x20, 0xd1, 0x01, 0x27, + 0x08, 0xe0, 0x04, 0x9b, 0x2b, 0xb1, 0x04, 0xf0, 0x7e, 0x05, 0xb5, 0xfa, + 0x85, 0xf5, 0x6f, 0x09, 0x00, 0xe0, 0x00, 0x27, 0x7f, 0xb9, 0x04, 0xf0, + 0x1f, 0x05, 0x08, 0xfa, 0x05, 0xf7, 0x65, 0x09, 0x51, 0xf8, 0x25, 0xe0, + 0x1e, 0xea, 0x07, 0x06, 0x05, 0xd0, 0x5a, 0xf8, 0x25, 0x60, 0x3e, 0x43, + 0x4a, 0xf8, 0x25, 0x60, 0x00, 0xe0, 0x01, 0x38, 0x01, 0x34, 0x4f, 0x2c, + 0xce, 0xd1, 0x0a, 0xe0, 0x02, 0x9b, 0xed, 0x1a, 0xb5, 0xfa, 0x85, 0xf5, + 0x4f, 0xea, 0x55, 0x17, 0xe2, 0xd0, 0x04, 0x9b, 0x00, 0x2b, 0xd8, 0xd1, + 0xde, 0xe7, 0x58, 0x4f, 0x00, 0x21, 0x07, 0xeb, 0x81, 0x05, 0xec, 0x78, + 0x9c, 0xb1, 0x17, 0xf8, 0x21, 0x40, 0x6d, 0x78, 0xac, 0x42, 0x0e, 0xd8, + 0xc4, 0xf3, 0x42, 0x16, 0x04, 0xf0, 0x1f, 0x03, 0x01, 0x34, 0x5a, 0xf8, + 0x26, 0x60, 0x26, 0xfa, 0x03, 0xf3, 0xdb, 0x07, 0x18, 0xbf, 0x01, 0x38, + 0xe3, 0xb2, 0xab, 0x42, 0xf0, 0xd9, 0x01, 0x31, 0x03, 0x29, 0xe4, 0xd1, + 0x04, 0x99, 0x41, 0xb3, 0x79, 0x1c, 0x00, 0x24, 0x8b, 0x78, 0x03, 0xb3, + 0x0d, 0x78, 0x4d, 0x2d, 0x0d, 0xd8, 0xeb, 0x07, 0x0b, 0xd1, 0xc5, 0xf3, + 0x42, 0x13, 0x05, 0xf0, 0x1f, 0x05, 0x5a, 0xf8, 0x23, 0x30, 0x85, 0xf0, + 0x01, 0x05, 0xeb, 0x40, 0xdb, 0x07, 0x18, 0xbf, 0x01, 0x32, 0x11, 0xf8, + 0x01, 0x5c, 0xeb, 0x07, 0x0b, 0xd0, 0xc5, 0xf3, 0x42, 0x13, 0x05, 0xf0, + 0x1f, 0x05, 0x5a, 0xf8, 0x23, 0x30, 0x85, 0xf0, 0x01, 0x05, 0xeb, 0x40, + 0xdb, 0x07, 0x18, 0xbf, 0x01, 0x32, 0x01, 0x34, 0x04, 0x31, 0x03, 0x2c, + 0xd8, 0xd1, 0x5f, 0xfa, 0x82, 0xfb, 0x5f, 0xfa, 0x80, 0xf9, 0xd9, 0x45, + 0x53, 0xd2, 0x00, 0x20, 0x0d, 0xf1, 0x31, 0x01, 0x0d, 0xf1, 0x2e, 0x0e, + 0x4f, 0xf0, 0x01, 0x0c, 0x8d, 0xf8, 0x30, 0x00, 0xad, 0xf8, 0x2e, 0x00, + 0xff, 0x24, 0x7f, 0x23, 0x00, 0x25, 0x0c, 0x70, 0x07, 0xeb, 0x85, 0x06, + 0xf2, 0x78, 0x52, 0xb1, 0x96, 0xf9, 0x02, 0x60, 0x5a, 0xb2, 0x96, 0x42, + 0x05, 0xda, 0x1e, 0xf8, 0x05, 0x20, 0x12, 0xb9, 0xec, 0xb2, 0x33, 0x46, + 0x0d, 0x70, 0x01, 0x35, 0x03, 0x2d, 0xed, 0xd1, 0xff, 0x2c, 0x00, 0xf1, + 0x01, 0x00, 0x18, 0xbf, 0x0e, 0xf8, 0x04, 0xc0, 0x01, 0x31, 0x03, 0x28, + 0xe0, 0xd1, 0x00, 0x25, 0x08, 0xac, 0x0d, 0xf1, 0x31, 0x06, 0x4f, 0xf0, + 0x00, 0x08, 0x30, 0x78, 0x02, 0x28, 0x06, 0xd8, 0x07, 0xeb, 0x80, 0x01, + 0x20, 0x46, 0x04, 0x22, 0xe6, 0xf7, 0x82, 0xfb, 0x02, 0xe0, 0x65, 0x70, + 0x25, 0x70, 0xe5, 0x70, 0x08, 0xf1, 0x01, 0x08, 0x04, 0x34, 0x01, 0x36, + 0xb8, 0xf1, 0x03, 0x0f, 0xeb, 0xd1, 0x9d, 0xf8, 0x31, 0x00, 0x02, 0x28, + 0x08, 0xd8, 0x0f, 0x48, 0x08, 0xa9, 0x4a, 0x46, 0x5b, 0x46, 0x04, 0x68, + 0x04, 0x98, 0x00, 0x90, 0x05, 0xa8, 0xa0, 0x47, 0x09, 0x48, 0x08, 0xa9, + 0x01, 0xe0, 0x08, 0x48, 0x06, 0x49, 0x03, 0x68, 0x01, 0x98, 0x5a, 0x46, + 0x98, 0x47, 0x0d, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x48, 0xdc, 0x05, 0x00, + 0x04, 0x5b, 0x01, 0x00, 0x30, 0x0f, 0x01, 0x00, 0xd8, 0x6a, 0x01, 0x00, + 0x68, 0xe7, 0x08, 0x00, 0x64, 0xe7, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x43, + 0x4f, 0xf0, 0x00, 0x0e, 0x4f, 0xf0, 0x01, 0x0c, 0x4f, 0xf0, 0x01, 0x08, + 0x00, 0x2b, 0x52, 0xd0, 0x00, 0x26, 0x00, 0x27, 0xd4, 0x5d, 0x4e, 0x2f, + 0x04, 0xd0, 0xd3, 0x19, 0x5b, 0x78, 0x9c, 0x42, 0x98, 0xbf, 0x1c, 0x46, + 0x7b, 0x09, 0x07, 0xf0, 0x1e, 0x05, 0x51, 0xf8, 0x23, 0x30, 0xeb, 0x40, + 0xdb, 0x07, 0x02, 0xd1, 0x44, 0x45, 0x08, 0xbf, 0x02, 0x36, 0xbb, 0x1c, + 0x4d, 0x2f, 0x1f, 0x46, 0xe8, 0xd3, 0x33, 0x06, 0x28, 0xd0, 0x00, 0x24, + 0x26, 0x46, 0x14, 0x5d, 0x4e, 0x2e, 0x04, 0xd0, 0x93, 0x19, 0x5b, 0x78, + 0x9c, 0x42, 0x98, 0xbf, 0x1c, 0x46, 0x4f, 0xea, 0x56, 0x19, 0x06, 0xf0, + 0x1e, 0x03, 0x51, 0xf8, 0x29, 0x70, 0x0c, 0xfa, 0x03, 0xf5, 0x2f, 0x42, + 0x08, 0xbf, 0x44, 0x45, 0x03, 0xd0, 0xb4, 0x1c, 0x4d, 0x2e, 0xe7, 0xd3, + 0x0e, 0xe0, 0x43, 0xf0, 0x01, 0x03, 0x47, 0xea, 0x05, 0x04, 0x0e, 0xf1, + 0x02, 0x0e, 0x0c, 0xfa, 0x03, 0xf3, 0x23, 0x43, 0x41, 0xf8, 0x29, 0x30, + 0x5f, 0xfa, 0x8e, 0xf3, 0x83, 0x42, 0xec, 0xd3, 0x5f, 0xfa, 0x8e, 0xf3, + 0x83, 0x42, 0x3a, 0xd2, 0x08, 0xf1, 0x01, 0x08, 0xb8, 0xf1, 0x10, 0x0f, + 0xb2, 0xd1, 0x34, 0xe0, 0x08, 0xf1, 0x01, 0x08, 0xb8, 0xf1, 0x10, 0x0f, + 0x2f, 0xd0, 0x00, 0x26, 0x00, 0x27, 0x73, 0x09, 0x06, 0xf0, 0x1f, 0x04, + 0x51, 0xf8, 0x23, 0x30, 0xe3, 0x40, 0xdb, 0x07, 0x03, 0xd1, 0x93, 0x5d, + 0x98, 0x45, 0x08, 0xbf, 0x01, 0x37, 0x01, 0x36, 0x4f, 0x2e, 0xf0, 0xd1, + 0x3b, 0x06, 0x18, 0xd0, 0x00, 0x26, 0x77, 0x09, 0x06, 0xf0, 0x1f, 0x03, + 0x51, 0xf8, 0x27, 0x40, 0x0c, 0xfa, 0x03, 0xf3, 0x1c, 0x42, 0x0b, 0xd1, + 0x95, 0x5d, 0xa8, 0x45, 0x08, 0xd1, 0x23, 0x43, 0x0e, 0xf1, 0x01, 0x0e, + 0x41, 0xf8, 0x27, 0x30, 0x5f, 0xfa, 0x8e, 0xf3, 0x83, 0x42, 0x02, 0xd2, + 0x01, 0x36, 0x4f, 0x2e, 0xe7, 0xd1, 0x5f, 0xfa, 0x8e, 0xf3, 0x83, 0x42, + 0xca, 0xd3, 0x5f, 0xfa, 0x8e, 0xf0, 0xbd, 0xe8, 0xf0, 0x83, 0x00, 0xbf, + 0x2d, 0xe9, 0xf0, 0x4f, 0x8d, 0xb0, 0x02, 0x90, 0xdf, 0xf8, 0x88, 0x03, + 0x0d, 0xf1, 0x24, 0x0b, 0x0c, 0x46, 0x1e, 0x46, 0x00, 0x68, 0x0c, 0x90, + 0xdf, 0xf8, 0x7c, 0x03, 0x04, 0x92, 0x05, 0x93, 0x05, 0x68, 0x01, 0x20, + 0x00, 0x90, 0x58, 0x46, 0xa8, 0x47, 0xdc, 0x4d, 0x0b, 0xf1, 0x01, 0x02, + 0x0a, 0x21, 0x0a, 0x23, 0x05, 0xf1, 0x1e, 0x00, 0xd2, 0xf7, 0xba, 0xfa, + 0xdf, 0xf8, 0x60, 0x93, 0x4f, 0xf6, 0xff, 0x70, 0x4f, 0x21, 0x68, 0x86, + 0x00, 0x25, 0x48, 0x46, 0xcd, 0xe9, 0x06, 0x55, 0x08, 0x95, 0xd5, 0xf7, + 0xf5, 0xf8, 0xd3, 0x4e, 0xdf, 0xf8, 0x4c, 0xa3, 0xd5, 0x4f, 0xdf, 0xf8, + 0x50, 0x83, 0x0b, 0xeb, 0xd5, 0x00, 0x05, 0xf0, 0x07, 0x01, 0x40, 0x78, + 0xc8, 0x40, 0xc0, 0x07, 0x05, 0xd1, 0x19, 0xf8, 0x05, 0x00, 0x40, 0xf0, + 0x04, 0x00, 0x09, 0xf8, 0x05, 0x00, 0x31, 0x68, 0xe8, 0xb2, 0x88, 0x47, + 0x05, 0xf0, 0x1f, 0x00, 0x01, 0x21, 0x01, 0xfa, 0x00, 0xf0, 0x69, 0x09, + 0x54, 0xf8, 0x21, 0x20, 0x02, 0x42, 0x05, 0xd1, 0x19, 0xf8, 0x05, 0x20, + 0x42, 0xf0, 0x08, 0x02, 0x09, 0xf8, 0x05, 0x20, 0xda, 0xf8, 0x00, 0x20, + 0x12, 0xb9, 0xc0, 0x4a, 0x12, 0x79, 0x8a, 0xb1, 0x05, 0x9a, 0x00, 0x2a, + 0x2a, 0x46, 0x18, 0xbf, 0x02, 0xf0, 0x7e, 0x02, 0x98, 0xf8, 0x00, 0x30, + 0x9a, 0x42, 0x0c, 0xd0, 0x98, 0xf8, 0x01, 0x30, 0x9a, 0x42, 0x08, 0xd0, + 0x98, 0xf8, 0x02, 0x30, 0x9a, 0x42, 0x04, 0xd0, 0x05, 0x9a, 0x42, 0xb1, + 0x15, 0xf0, 0x7e, 0x0f, 0x05, 0xd1, 0x19, 0xf8, 0x05, 0x20, 0x42, 0xf0, + 0x10, 0x02, 0x09, 0xf8, 0x05, 0x20, 0x57, 0xf8, 0x21, 0x10, 0x01, 0x42, + 0x0e, 0xd1, 0xb1, 0x48, 0x90, 0xf8, 0x3e, 0x06, 0x01, 0x28, 0x09, 0xd1, + 0xab, 0x48, 0x40, 0x79, 0x01, 0x28, 0x05, 0xd1, 0x19, 0xf8, 0x05, 0x00, + 0x40, 0xf0, 0x01, 0x00, 0x09, 0xf8, 0x05, 0x00, 0x01, 0x35, 0x4f, 0x2d, + 0xa5, 0xd1, 0x05, 0x98, 0x00, 0x28, 0x00, 0xf0, 0xa0, 0x80, 0xa8, 0x48, + 0xdd, 0xf8, 0x10, 0xc0, 0x4f, 0xf0, 0x00, 0x0b, 0x4f, 0xf0, 0x01, 0x0a, + 0x06, 0xac, 0x4f, 0xf0, 0x00, 0x08, 0x50, 0x30, 0x03, 0x90, 0x00, 0x21, + 0x00, 0x22, 0x00, 0x20, 0x19, 0xf8, 0x01, 0x30, 0x5f, 0xea, 0x08, 0x65, + 0x08, 0xbf, 0x00, 0x2b, 0x1c, 0xd0, 0x4e, 0x29, 0x01, 0xd1, 0x1d, 0x46, + 0x05, 0xe0, 0x01, 0xeb, 0x09, 0x05, 0x6d, 0x78, 0xab, 0x42, 0x88, 0xbf, + 0x1d, 0x46, 0x4b, 0x09, 0x02, 0xf0, 0x1f, 0x02, 0x54, 0xf8, 0x23, 0x30, + 0x23, 0xfa, 0x02, 0xf2, 0xd2, 0x07, 0x04, 0xd1, 0x5f, 0xfa, 0x88, 0xf2, + 0x95, 0x42, 0x08, 0xbf, 0x02, 0x30, 0x8a, 0x1c, 0xd1, 0xb2, 0x4f, 0x29, + 0xdc, 0xd3, 0x1f, 0xe0, 0x4e, 0x29, 0x05, 0xd0, 0x01, 0xeb, 0x09, 0x03, + 0x5d, 0x78, 0x0d, 0xb1, 0x00, 0x23, 0xe1, 0xe7, 0x4b, 0x09, 0x02, 0xf0, + 0x1f, 0x02, 0x0b, 0xf1, 0x02, 0x0b, 0x54, 0xf8, 0x23, 0x50, 0x0a, 0xfa, + 0x02, 0xf2, 0x2a, 0x43, 0x44, 0xf8, 0x23, 0x20, 0x4a, 0x1c, 0x02, 0xf0, + 0x1f, 0x03, 0x52, 0x09, 0x54, 0xf8, 0x22, 0x50, 0x0a, 0xfa, 0x03, 0xf3, + 0x2b, 0x43, 0x44, 0xf8, 0x22, 0x30, 0xda, 0xe7, 0x5f, 0xfa, 0x8b, 0xf1, + 0x61, 0x45, 0x80, 0xf0, 0xaa, 0x80, 0x02, 0x06, 0x3d, 0xd0, 0xac, 0xeb, + 0x01, 0x01, 0xc0, 0xb2, 0x81, 0x42, 0x0d, 0xda, 0x77, 0x48, 0x03, 0x9a, + 0x5f, 0xfa, 0x88, 0xf3, 0xcd, 0xe9, 0x00, 0x9a, 0x05, 0x68, 0xc8, 0xb2, + 0x21, 0x46, 0xa8, 0x47, 0xdd, 0xf8, 0x10, 0xc0, 0x83, 0x44, 0x26, 0xe0, + 0x00, 0x21, 0x08, 0x46, 0x19, 0xf8, 0x01, 0x10, 0x4e, 0x28, 0x05, 0xd0, + 0x09, 0xeb, 0x00, 0x02, 0x52, 0x78, 0x91, 0x42, 0x98, 0xbf, 0x11, 0x46, + 0x42, 0x09, 0x00, 0xf0, 0x1e, 0x03, 0x54, 0xf8, 0x22, 0x60, 0x0a, 0xfa, + 0x03, 0xf5, 0x2e, 0x42, 0x0e, 0xd1, 0x5f, 0xfa, 0x88, 0xf7, 0xb9, 0x42, + 0x0a, 0xd1, 0x43, 0xf0, 0x01, 0x03, 0x46, 0xea, 0x05, 0x01, 0x0b, 0xf1, + 0x02, 0x0b, 0x0a, 0xfa, 0x03, 0xf3, 0x19, 0x43, 0x44, 0xf8, 0x22, 0x10, + 0x81, 0x1c, 0x4d, 0x28, 0xd9, 0xd3, 0x5f, 0xfa, 0x8b, 0xf0, 0x60, 0x45, + 0x69, 0xd2, 0x08, 0xf1, 0x01, 0x08, 0x5f, 0xfa, 0x88, 0xf0, 0x10, 0x28, + 0x7f, 0xf4, 0x6d, 0xaf, 0x61, 0xe0, 0x58, 0x48, 0xdd, 0xf8, 0x10, 0xc0, + 0x4f, 0xf0, 0x00, 0x0a, 0x01, 0x25, 0x06, 0xac, 0x4f, 0xf0, 0x00, 0x0b, + 0x4f, 0xf0, 0x00, 0x08, 0x00, 0xf1, 0x50, 0x06, 0x00, 0x21, 0x00, 0x20, + 0x19, 0xf8, 0x01, 0x20, 0x5f, 0xea, 0x08, 0x63, 0x08, 0xbf, 0x00, 0x2a, + 0x08, 0xd0, 0x5f, 0xfa, 0x88, 0xf3, 0x93, 0x42, 0x08, 0xbf, 0x01, 0x30, + 0x01, 0x31, 0x4f, 0x29, 0xf0, 0xd1, 0x0c, 0xe0, 0x4b, 0x09, 0x01, 0xf0, + 0x1f, 0x02, 0x0b, 0xf1, 0x01, 0x0b, 0x54, 0xf8, 0x23, 0x70, 0x05, 0xfa, + 0x02, 0xf2, 0x3a, 0x43, 0x44, 0xf8, 0x23, 0x20, 0xee, 0xe7, 0x01, 0x06, + 0x29, 0xd0, 0xac, 0xeb, 0x0b, 0x01, 0xc0, 0xb2, 0x4a, 0xb2, 0x90, 0x42, + 0x0d, 0xdd, 0x3d, 0x48, 0x5f, 0xfa, 0x88, 0xf3, 0x32, 0x46, 0xcd, 0xe9, + 0x00, 0x9a, 0x07, 0x68, 0xc8, 0xb2, 0x21, 0x46, 0xb8, 0x47, 0xdd, 0xf8, + 0x10, 0xc0, 0x83, 0x44, 0x15, 0xe0, 0x00, 0x20, 0x19, 0xf8, 0x00, 0x10, + 0x5f, 0xfa, 0x88, 0xf2, 0x8a, 0x42, 0x0b, 0xd1, 0x42, 0x09, 0x00, 0xf0, + 0x1f, 0x01, 0x0b, 0xf1, 0x01, 0x0b, 0x54, 0xf8, 0x22, 0x30, 0x05, 0xfa, + 0x01, 0xf1, 0x19, 0x43, 0x44, 0xf8, 0x22, 0x10, 0x01, 0x30, 0x4f, 0x28, + 0xea, 0xd1, 0x5f, 0xfa, 0x8b, 0xf0, 0x60, 0x45, 0x05, 0xd2, 0x08, 0xf1, + 0x01, 0x08, 0x5f, 0xfa, 0x88, 0xf0, 0x10, 0x28, 0xaa, 0xd1, 0x5f, 0xfa, + 0x8b, 0xf0, 0x60, 0x45, 0x07, 0xd2, 0xac, 0xeb, 0x0b, 0x00, 0x05, 0x9b, + 0x06, 0xa9, 0x4a, 0x46, 0xc0, 0xb2, 0xff, 0xf7, 0xd1, 0xfd, 0x02, 0x9c, + 0x06, 0x99, 0x20, 0x68, 0x81, 0x42, 0x09, 0xd1, 0x60, 0x68, 0x07, 0x99, + 0x81, 0x42, 0x05, 0xd1, 0xa0, 0x68, 0x08, 0x99, 0x81, 0x42, 0x01, 0xd1, + 0x00, 0x20, 0x13, 0xe0, 0x06, 0xaa, 0x20, 0x46, 0x0c, 0x21, 0x0c, 0x23, + 0xd2, 0xf7, 0x26, 0xf9, 0x0d, 0x48, 0x0a, 0x21, 0x22, 0x46, 0x0a, 0x23, + 0x28, 0x30, 0xd2, 0xf7, 0x1f, 0xf9, 0x14, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x13, 0x48, 0x00, 0x68, 0x80, 0x47, 0x01, 0x20, 0x04, 0x49, 0x09, 0x68, + 0x0c, 0x9a, 0x89, 0x1a, 0x04, 0xbf, 0x0d, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0xd7, 0xf7, 0x4c, 0xff, 0x38, 0xec, 0x01, 0x00, 0x28, 0xd7, 0x08, 0x00, + 0x7c, 0x78, 0x01, 0x00, 0xdc, 0x68, 0x01, 0x00, 0x2c, 0xd7, 0x08, 0x00, + 0x04, 0x5b, 0x01, 0x00, 0x48, 0xdc, 0x05, 0x00, 0x30, 0x0f, 0x01, 0x00, + 0x28, 0xf1, 0x05, 0x00, 0x64, 0xd4, 0x05, 0x00, 0x30, 0xd7, 0x08, 0x00, + 0x30, 0x69, 0x01, 0x00, 0x34, 0xd7, 0x08, 0x00, 0x38, 0xd7, 0x08, 0x00, + 0x2d, 0xe9, 0xf0, 0x47, 0xa3, 0x4e, 0xdf, 0xf8, 0xa0, 0x80, 0x82, 0x46, + 0x0a, 0x21, 0xff, 0x22, 0x96, 0xf8, 0xbe, 0x50, 0x08, 0xf1, 0x01, 0x00, + 0xe2, 0xf7, 0xa8, 0xfa, 0x96, 0xf9, 0xcc, 0x00, 0x96, 0xf8, 0xd5, 0xc0, + 0x4f, 0xf0, 0x01, 0x0e, 0x00, 0x23, 0x81, 0x1c, 0x00, 0x20, 0x1a, 0xf9, + 0x00, 0x20, 0x91, 0x42, 0x31, 0xda, 0x5e, 0x19, 0x01, 0x27, 0xf2, 0xb2, + 0x4e, 0x2a, 0x0b, 0xd8, 0xf2, 0xb2, 0x1a, 0xf9, 0x02, 0x20, 0x91, 0x42, + 0x04, 0xda, 0x2e, 0x44, 0x01, 0x37, 0xf2, 0xb2, 0x4f, 0x2a, 0xf5, 0xd3, + 0x3a, 0x06, 0x20, 0xd0, 0xfa, 0xb2, 0x12, 0xfb, 0x05, 0xf2, 0x62, 0x45, + 0x18, 0xd2, 0x1e, 0x06, 0x16, 0xd0, 0x02, 0xeb, 0x00, 0x09, 0xb9, 0xf1, + 0x4e, 0x0f, 0x11, 0xd8, 0xde, 0xb2, 0xb1, 0x45, 0x0e, 0xd9, 0x5a, 0x1c, + 0x06, 0xf0, 0x07, 0x00, 0x08, 0xeb, 0xd6, 0x06, 0x74, 0x78, 0x0e, 0xfa, + 0x00, 0xf0, 0x24, 0xea, 0x00, 0x00, 0x70, 0x70, 0xd6, 0xb2, 0x01, 0x32, + 0xb1, 0x45, 0xf1, 0xd8, 0x78, 0x1e, 0x00, 0xfb, 0x05, 0x33, 0x2b, 0x44, + 0xd8, 0xb2, 0x4f, 0x28, 0x28, 0xbf, 0xbd, 0xe8, 0xf0, 0x87, 0xc2, 0xe7, + 0xcd, 0xf0, 0x05, 0x00, 0x2d, 0xe9, 0xfe, 0x4f, 0x78, 0x49, 0x04, 0x46, + 0x76, 0x48, 0x91, 0xf8, 0xcc, 0x20, 0x01, 0xf1, 0xae, 0x0b, 0x91, 0xf8, + 0xd4, 0x10, 0x02, 0x30, 0x95, 0x1c, 0x00, 0x22, 0x43, 0x78, 0x33, 0xb1, + 0x03, 0x78, 0x6f, 0xb2, 0x0b, 0x44, 0x5e, 0xb2, 0xbe, 0x42, 0xc8, 0xbf, + 0x1d, 0x46, 0x01, 0x32, 0x04, 0x30, 0x03, 0x2a, 0xf2, 0xd1, 0x6d, 0x48, + 0x90, 0xf8, 0x38, 0x01, 0xc0, 0x07, 0x03, 0xd0, 0x6b, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x20, 0x46, 0xff, 0xf7, 0x83, 0xff, 0x6b, 0x4f, + 0x6b, 0x4e, 0x00, 0x20, 0x4f, 0xf0, 0x00, 0x08, 0x4f, 0xf0, 0x00, 0x0a, + 0x01, 0x90, 0x14, 0xf9, 0x08, 0x90, 0x19, 0xf1, 0x7f, 0x00, 0x72, 0xd0, + 0x62, 0x48, 0x0d, 0xf1, 0x0b, 0x01, 0x0d, 0xf1, 0x0a, 0x02, 0x03, 0x68, + 0x5f, 0xfa, 0x8a, 0xf0, 0x98, 0x47, 0x9d, 0xf9, 0x0b, 0x00, 0x9b, 0xf8, + 0x26, 0x10, 0x20, 0x56, 0x08, 0x44, 0x48, 0x45, 0x05, 0xdc, 0x9d, 0xf9, + 0x0a, 0x00, 0x20, 0x56, 0x08, 0x44, 0x48, 0x45, 0x5b, 0xdd, 0x08, 0xf0, + 0x07, 0x00, 0x01, 0x22, 0x02, 0xfa, 0x00, 0xf3, 0x55, 0x48, 0x00, 0xeb, + 0xd8, 0x00, 0x40, 0x78, 0x03, 0x42, 0x50, 0xd0, 0x07, 0xeb, 0x08, 0x00, + 0xb6, 0x46, 0x6e, 0xb2, 0x10, 0xf9, 0x01, 0xcf, 0xb4, 0x45, 0x11, 0xdd, + 0x3a, 0x46, 0x14, 0xf9, 0x08, 0x70, 0xb7, 0x42, 0x0b, 0xdd, 0x4f, 0xea, + 0xd8, 0x06, 0x17, 0x46, 0x16, 0x44, 0x01, 0x9a, 0x96, 0xf8, 0x3f, 0x61, + 0x33, 0x42, 0x18, 0xbf, 0x01, 0x32, 0x01, 0x92, 0x00, 0xe0, 0x17, 0x46, + 0x1e, 0xf9, 0x08, 0x30, 0x72, 0x46, 0x5e, 0x18, 0x4e, 0x45, 0x12, 0xdd, + 0x99, 0x45, 0xd4, 0xbf, 0xa3, 0xeb, 0x09, 0x06, 0xa9, 0xeb, 0x03, 0x06, + 0x8e, 0x42, 0x16, 0xda, 0x48, 0x49, 0x00, 0x22, 0x4b, 0x45, 0x76, 0x46, + 0x01, 0xf8, 0x08, 0x20, 0xc8, 0xbf, 0x99, 0x46, 0x0e, 0xf8, 0x08, 0x90, + 0x1b, 0xe0, 0x43, 0x49, 0x00, 0x26, 0x4b, 0x45, 0x01, 0xf8, 0x08, 0x60, + 0xc8, 0xbf, 0x99, 0x46, 0x02, 0xf8, 0x08, 0x90, 0x03, 0x70, 0x16, 0x46, + 0x11, 0xe0, 0x3d, 0x4a, 0x76, 0x46, 0x12, 0xf8, 0x08, 0x10, 0x02, 0x29, + 0x9c, 0xbf, 0x01, 0x31, 0x02, 0xf8, 0x08, 0x10, 0x4b, 0x45, 0xd8, 0xbf, + 0x4b, 0x46, 0x0e, 0xf8, 0x08, 0x30, 0xe1, 0x45, 0x01, 0xdd, 0x80, 0xf8, + 0x00, 0x90, 0x9b, 0xf8, 0x25, 0x00, 0x82, 0x44, 0x5f, 0xfa, 0x8a, 0xf8, + 0xb8, 0xf1, 0x4f, 0x0f, 0xff, 0xf4, 0x7f, 0xaf, 0x01, 0x99, 0x9b, 0xf8, + 0x27, 0x00, 0x81, 0x22, 0xc9, 0xb2, 0x81, 0x42, 0x24, 0xbf, 0x00, 0x20, + 0xa7, 0xf8, 0x54, 0x01, 0x4f, 0x21, 0x20, 0x46, 0xe2, 0xf7, 0xa2, 0xf9, + 0xbb, 0xf8, 0x00, 0x00, 0xb7, 0xf8, 0x54, 0x11, 0x81, 0x42, 0x17, 0xd1, + 0x25, 0x48, 0x1e, 0x49, 0x00, 0x22, 0x10, 0xf8, 0x08, 0x00, 0x09, 0x78, + 0x01, 0x30, 0xc0, 0xb2, 0x11, 0xfb, 0x00, 0xf0, 0x9b, 0xf8, 0x25, 0x10, + 0xb3, 0x56, 0x1b, 0x1a, 0x13, 0xf1, 0x7f, 0x0f, 0xd8, 0xbf, 0x6f, 0xf0, + 0x7e, 0x03, 0xb3, 0x54, 0x0a, 0x44, 0xd2, 0xb2, 0x4f, 0x2a, 0xf3, 0xd3, + 0x0c, 0x48, 0x90, 0xf8, 0x38, 0x01, 0xc0, 0x07, 0x0d, 0xd0, 0x11, 0x48, + 0x07, 0xf5, 0xaa, 0x72, 0x00, 0x21, 0x02, 0x23, 0x04, 0x68, 0x40, 0xf2, + 0x21, 0x20, 0xa0, 0x47, 0x0d, 0x48, 0x12, 0x21, 0x00, 0x78, 0xd1, 0xf7, + 0xb3, 0xff, 0xbd, 0xe8, 0xfe, 0x8f, 0x00, 0xbf, 0xd8, 0x6a, 0x01, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x60, 0xe7, 0x08, 0x00, + 0x5c, 0xe7, 0x08, 0x00, 0xcd, 0xf0, 0x05, 0x00, 0x30, 0x69, 0x01, 0x00, + 0x88, 0x6a, 0x01, 0x00, 0x7d, 0x0f, 0x01, 0x00, 0x78, 0x9b, 0x08, 0x00, + 0x66, 0x34, 0x01, 0x00, 0x80, 0xb5, 0x00, 0xf0, 0x25, 0xf8, 0x02, 0x48, + 0x4f, 0x21, 0xd4, 0xf7, 0x21, 0xf9, 0x80, 0xbd, 0xd8, 0xf0, 0x05, 0x00, + 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x44, 0xd7, 0x08, 0x00, 0x71, 0xea, 0x04, 0x00, + 0x28, 0xd7, 0x08, 0x00, 0x25, 0xe7, 0x04, 0x00, 0x58, 0xe7, 0x08, 0x00, + 0xe9, 0xee, 0x04, 0x00, 0xb4, 0xb3, 0x08, 0x00, 0xf9, 0xf0, 0x04, 0x00, + 0x4c, 0xf6, 0xd1, 0x2c, 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x08, 0x49, 0x90, 0xf9, 0x3a, 0x00, 0x91, 0xf9, 0x01, 0x20, 0x90, 0x42, + 0xc2, 0xbf, 0x80, 0x1a, 0x40, 0xb2, 0x70, 0x47, 0x91, 0xf9, 0x00, 0x10, + 0x40, 0x1a, 0xa8, 0xbf, 0x00, 0x20, 0x40, 0xb2, 0x70, 0x47, 0x00, 0xbf, + 0x00, 0x69, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xfc, 0xe7, 0x08, 0x00, 0x55, 0xf1, 0x04, 0x00, 0x10, 0xb5, 0x4f, 0x4c, + 0x4d, 0x48, 0x0c, 0x21, 0x0c, 0x23, 0x22, 0x46, 0xd1, 0xf7, 0x42, 0xff, + 0x50, 0x48, 0x0c, 0x21, 0x22, 0x46, 0x0c, 0x23, 0xd1, 0xf7, 0x3c, 0xff, + 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0xa2, 0xb8, 0xf8, 0xb5, 0x45, 0x4c, + 0x45, 0x4a, 0x0c, 0x21, 0x0c, 0x23, 0x20, 0x46, 0xd1, 0xf7, 0x30, 0xff, + 0x43, 0x4a, 0x00, 0x21, 0x48, 0x09, 0x01, 0xf0, 0x1f, 0x05, 0x02, 0xeb, + 0x80, 0x03, 0xd8, 0x68, 0xe8, 0x40, 0xc0, 0x07, 0x03, 0xd0, 0x01, 0x31, + 0x4f, 0x29, 0xf3, 0xd1, 0x5a, 0xe0, 0xc8, 0xb2, 0x4f, 0x28, 0x05, 0xd2, + 0xdb, 0x68, 0xeb, 0x40, 0xdb, 0x07, 0x03, 0xd0, 0x0a, 0x46, 0x14, 0xe0, + 0x0a, 0x46, 0x14, 0xe0, 0x4b, 0x1c, 0x0d, 0x46, 0x01, 0x35, 0x4f, 0x2d, + 0x0c, 0xd0, 0x5e, 0x09, 0x03, 0xf0, 0x1f, 0x07, 0x01, 0x33, 0x02, 0xeb, + 0x86, 0x06, 0xf6, 0x68, 0xfe, 0x40, 0xf6, 0x07, 0xf2, 0xd0, 0x03, 0xf1, + 0xfe, 0x02, 0x00, 0xe0, 0x4e, 0x22, 0x09, 0x06, 0x19, 0xd0, 0x2d, 0x49, + 0x91, 0xf8, 0xc1, 0x10, 0x0b, 0x46, 0x88, 0x42, 0x88, 0xbf, 0x03, 0x46, + 0x59, 0x1a, 0xc9, 0xb2, 0x81, 0x42, 0x0e, 0xd2, 0x01, 0x23, 0x4e, 0x09, + 0x01, 0xf0, 0x1f, 0x05, 0x01, 0x31, 0x54, 0xf8, 0x26, 0x70, 0x03, 0xfa, + 0x05, 0xf5, 0x81, 0x42, 0x27, 0xea, 0x05, 0x05, 0x44, 0xf8, 0x26, 0x50, + 0xf1, 0xd1, 0xd0, 0xb2, 0x4d, 0x28, 0x1d, 0xd8, 0x1e, 0x48, 0x90, 0xf8, + 0xc1, 0x00, 0x50, 0xfa, 0x82, 0xf1, 0x4e, 0x20, 0x4e, 0x29, 0x38, 0xbf, + 0xc8, 0xb2, 0x51, 0x1c, 0xc9, 0xb2, 0x88, 0x42, 0x10, 0xd3, 0x02, 0x32, + 0x01, 0x23, 0x01, 0xf0, 0x1f, 0x05, 0x49, 0x09, 0x54, 0xf8, 0x21, 0x60, + 0x03, 0xfa, 0x05, 0xf5, 0x26, 0xea, 0x05, 0x05, 0x44, 0xf8, 0x21, 0x50, + 0xd1, 0xb2, 0x01, 0x32, 0x88, 0x42, 0xf0, 0xd2, 0x10, 0x48, 0x90, 0xf8, + 0x3e, 0x16, 0x01, 0x29, 0x0a, 0xd1, 0x0f, 0x49, 0x49, 0x79, 0x01, 0x29, + 0x06, 0xd1, 0x90, 0xf8, 0x3f, 0x06, 0x02, 0x28, 0x02, 0xd1, 0x0c, 0x48, + 0x05, 0x4a, 0x01, 0xe0, 0x0a, 0x48, 0x05, 0x4a, 0x0c, 0x21, 0x0c, 0x23, + 0x01, 0xb0, 0xbd, 0xe8, 0xf0, 0x40, 0xd1, 0xf7, 0xad, 0xbe, 0x00, 0xbf, + 0x28, 0xf1, 0x05, 0x00, 0x78, 0xc9, 0x0e, 0x10, 0xb8, 0x68, 0x01, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x64, 0xd4, 0x05, 0x00, 0x48, 0xdc, 0x05, 0x00, + 0x34, 0xf1, 0x05, 0x00, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xf8, 0xc7, 0x08, 0x00, 0x8d, 0xf1, 0x04, 0x00, 0x4c, 0xf2, 0x75, 0x2c, + 0xc1, 0xf2, 0x0e, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x10, 0xb5, 0x00, 0x2a, + 0xb0, 0xf8, 0x00, 0x32, 0x14, 0xbf, 0x23, 0xea, 0x01, 0x04, 0x43, 0xea, + 0x01, 0x04, 0xa0, 0xf8, 0x00, 0x42, 0x09, 0x4b, 0x90, 0xf8, 0x35, 0x01, + 0xa4, 0xb2, 0xc3, 0xe9, 0x00, 0x02, 0x07, 0x48, 0xc3, 0xe9, 0x02, 0x14, + 0x1a, 0x46, 0x00, 0x21, 0x10, 0x23, 0xd0, 0xf8, 0x00, 0xc0, 0x40, 0xf2, + 0x2b, 0x20, 0xbd, 0xe8, 0x10, 0x40, 0x60, 0x47, 0x8c, 0x34, 0x01, 0x00, + 0xa4, 0x8e, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xc0, 0x9b, 0x08, 0x00, 0x01, 0xf3, 0x04, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x85, 0xb0, 0x05, 0x46, 0x17, 0x48, 0x0f, 0x46, 0x9b, 0x46, 0x90, 0x46, + 0x01, 0x68, 0xbc, 0x20, 0x88, 0x47, 0x00, 0xb3, 0x04, 0x46, 0x14, 0x48, + 0x10, 0x9a, 0xdd, 0xe9, 0x0e, 0xa9, 0x29, 0x46, 0x00, 0x23, 0x06, 0x68, + 0x20, 0x46, 0xb0, 0x47, 0x10, 0x48, 0x39, 0x46, 0x00, 0x22, 0x43, 0x46, + 0x05, 0x68, 0x38, 0x46, 0xcd, 0xe9, 0x00, 0x4b, 0xcd, 0xe9, 0x02, 0xa9, + 0xa8, 0x47, 0x20, 0xb9, 0x0b, 0x48, 0x01, 0x78, 0x09, 0xb1, 0x01, 0x21, + 0x41, 0x70, 0x20, 0x46, 0x05, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0xd7, 0xf7, + 0xa7, 0xbc, 0x4f, 0xf6, 0xff, 0x70, 0xab, 0xf8, 0x0a, 0x00, 0x05, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0xd4, 0x9b, 0x08, 0x00, 0xc4, 0x9b, 0x08, 0x00, + 0xc8, 0x9b, 0x08, 0x00, 0x2a, 0xe6, 0x05, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x64, 0xe8, 0x08, 0x00, 0x55, 0xf3, 0x04, 0x00, + 0xb0, 0xb5, 0x80, 0xb3, 0x0d, 0x46, 0x01, 0x79, 0x04, 0x46, 0x7f, 0x22, + 0x48, 0x08, 0xb2, 0xeb, 0x51, 0x0f, 0x0c, 0xbf, 0x61, 0x79, 0x00, 0x21, + 0x85, 0xf8, 0xab, 0x15, 0x85, 0xf8, 0xac, 0x05, 0x94, 0xf9, 0x03, 0x00, + 0xb0, 0xf1, 0xff, 0x3f, 0x04, 0xdd, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, + 0xd7, 0xf7, 0x76, 0xbc, 0x0c, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x28, + 0xf5, 0xd0, 0x4f, 0xf4, 0xc3, 0x71, 0x01, 0x80, 0x21, 0x79, 0xc0, 0xe9, + 0x01, 0x54, 0x81, 0x70, 0x07, 0x49, 0x60, 0x31, 0xd3, 0xf7, 0xce, 0xff, + 0x06, 0x48, 0x05, 0x21, 0x00, 0x78, 0xd1, 0xf7, 0xf9, 0xfd, 0xe0, 0x78, + 0x00, 0xf0, 0x7f, 0x00, 0xe0, 0x70, 0xb0, 0xbd, 0xe8, 0xb9, 0x08, 0x00, + 0x2c, 0xba, 0x01, 0x00, 0x67, 0x34, 0x01, 0x00, 0x09, 0xb1, 0x00, 0xf0, + 0x4d, 0xb8, 0x00, 0x20, 0x70, 0x47, 0x80, 0xb5, 0x00, 0xf0, 0x4e, 0xf8, + 0x00, 0x28, 0x08, 0xbf, 0x01, 0x20, 0x80, 0xbd, 0xb0, 0xf5, 0x33, 0x7f, + 0x08, 0xd0, 0x40, 0xf2, 0xdf, 0x11, 0x88, 0x42, 0x08, 0xd1, 0x05, 0x48, + 0x05, 0x49, 0x00, 0x68, 0x08, 0x60, 0x70, 0x47, 0x02, 0x48, 0x03, 0x49, + 0x00, 0x68, 0x48, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x24, 0x20, 0x00, 0x40, + 0x40, 0xf1, 0x05, 0x00, 0x70, 0x47, 0x00, 0xbf, 0x09, 0x48, 0x0a, 0x49, + 0x01, 0x60, 0x0a, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, 0x0b, 0x49, + 0x01, 0x60, 0x0b, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0c, 0x49, + 0x81, 0x62, 0xc1, 0x61, 0x0b, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x24, 0xc0, 0x08, 0x00, 0x51, 0xf4, 0x04, 0x00, 0x14, 0x9d, 0x08, 0x00, + 0xdd, 0xf3, 0x04, 0x00, 0x80, 0xe9, 0x08, 0x00, 0x5b, 0xf4, 0x04, 0x00, + 0xb4, 0xa0, 0x08, 0x00, 0x69, 0xf4, 0x04, 0x00, 0x2c, 0xe9, 0x08, 0x00, + 0x19, 0xa2, 0x04, 0x00, 0x14, 0xe3, 0x08, 0x00, 0x95, 0xf4, 0x04, 0x00, + 0x46, 0xf6, 0xb1, 0x7c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x47, 0xf2, 0x2b, 0x0c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x2d, 0xe9, 0xf8, 0x4f, 0x48, 0x48, 0x00, 0x78, 0x08, 0xb1, 0xbd, 0xe8, + 0xf8, 0x8f, 0x47, 0x48, 0x90, 0xf8, 0xb8, 0x14, 0x46, 0x48, 0x30, 0x30, + 0x01, 0xf0, 0x01, 0x01, 0xd5, 0xf7, 0xc6, 0xfe, 0x00, 0x28, 0xf2, 0xd0, + 0x13, 0x21, 0x05, 0x46, 0xdf, 0xf8, 0x08, 0x91, 0x00, 0x90, 0x00, 0x24, + 0x05, 0xf8, 0x03, 0x1b, 0x99, 0xf8, 0x00, 0x00, 0x00, 0x28, 0x3e, 0xd0, + 0xdf, 0xf8, 0xf8, 0xa0, 0x3e, 0x4f, 0x4f, 0xf0, 0x00, 0x0b, 0x00, 0x26, + 0x57, 0xf8, 0x2b, 0x80, 0xb8, 0xf1, 0x00, 0x0f, 0x1a, 0xd0, 0x98, 0xf8, + 0x23, 0x11, 0xb9, 0xb1, 0xda, 0xf8, 0x00, 0x10, 0x09, 0xb1, 0x41, 0x45, + 0x19, 0xd0, 0x98, 0xf8, 0x35, 0x01, 0x36, 0x49, 0x28, 0x70, 0x98, 0xf9, + 0xa5, 0x00, 0x09, 0x68, 0x88, 0x47, 0x68, 0x70, 0x01, 0x36, 0x98, 0xf8, + 0x23, 0x01, 0xec, 0x70, 0xa8, 0x70, 0x99, 0xf8, 0x00, 0x00, 0x04, 0x35, + 0x88, 0xf8, 0x23, 0x41, 0x0b, 0xf1, 0x01, 0x0b, 0x5f, 0xfa, 0x8b, 0xf1, + 0x81, 0x42, 0xd9, 0xd3, 0x12, 0xe0, 0x9a, 0xf8, 0x06, 0x10, 0x00, 0x29, + 0xf2, 0xd0, 0x9a, 0xf8, 0x04, 0x10, 0x01, 0x36, 0x29, 0x70, 0x9a, 0xf8, + 0x05, 0x10, 0x69, 0x70, 0x9a, 0xf8, 0x06, 0x10, 0xec, 0x70, 0xa9, 0x70, + 0x8a, 0xf8, 0x06, 0x40, 0xe3, 0xe7, 0x00, 0x26, 0x21, 0x48, 0x00, 0x78, + 0xc0, 0xb1, 0x21, 0x4a, 0x00, 0x21, 0x00, 0x23, 0x52, 0xf8, 0x23, 0x40, + 0x74, 0xb1, 0x94, 0xf8, 0x23, 0x71, 0x4f, 0xb1, 0x94, 0xf8, 0x35, 0x71, + 0x69, 0x70, 0x01, 0x36, 0x2f, 0x70, 0x94, 0xf8, 0x23, 0x71, 0xe9, 0x70, + 0xaf, 0x70, 0x04, 0x35, 0x84, 0xf8, 0x23, 0x11, 0x01, 0x33, 0xdc, 0xb2, + 0x84, 0x42, 0xe9, 0xd3, 0x30, 0x06, 0x12, 0xd0, 0x14, 0x4a, 0x00, 0x21, + 0x00, 0x98, 0x11, 0x70, 0xb1, 0x00, 0x86, 0x70, 0x01, 0x31, 0x41, 0x70, + 0x11, 0x49, 0x0c, 0x31, 0xd3, 0xf7, 0xda, 0xfe, 0x10, 0x48, 0x0a, 0x21, + 0x00, 0x78, 0xbd, 0xe8, 0xf8, 0x4f, 0xd1, 0xf7, 0x03, 0xbd, 0x00, 0x98, + 0xbd, 0xe8, 0xf8, 0x4f, 0xd7, 0xf7, 0x66, 0xbb, 0xa3, 0x58, 0x01, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x68, 0x8a, 0x01, 0x00, 0x5c, 0x34, 0x01, 0x00, + 0xe4, 0x5e, 0x01, 0x00, 0x10, 0x61, 0x01, 0x00, 0x18, 0xea, 0x08, 0x00, + 0x53, 0x34, 0x01, 0x00, 0xb8, 0x57, 0x01, 0x00, 0x60, 0x34, 0x01, 0x00, + 0x2c, 0xba, 0x01, 0x00, 0x66, 0x34, 0x01, 0x00, 0xb0, 0xb5, 0x05, 0x46, + 0x09, 0x48, 0x0c, 0x46, 0xc0, 0x68, 0x48, 0xb1, 0x08, 0x49, 0x09, 0x4a, + 0x3c, 0x30, 0x02, 0x23, 0x09, 0x78, 0x02, 0xeb, 0x41, 0x02, 0x02, 0x21, + 0xd1, 0xf7, 0xd0, 0xfc, 0x28, 0x46, 0x21, 0x46, 0xbd, 0xe8, 0xb0, 0x40, + 0x00, 0xf0, 0x72, 0xb8, 0x4c, 0x76, 0x01, 0x00, 0x74, 0x87, 0x08, 0x00, + 0x48, 0xf1, 0x05, 0x00, 0xb0, 0xb5, 0x04, 0x46, 0x90, 0xf8, 0x35, 0x01, + 0x16, 0x28, 0x16, 0xd8, 0x14, 0x49, 0x00, 0xeb, 0x40, 0x02, 0x51, 0xf8, + 0x22, 0x20, 0x82, 0xb1, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x80, 0x00, + 0x00, 0x79, 0x01, 0x28, 0x09, 0xd1, 0xd4, 0xf8, 0x88, 0x50, 0x28, 0xb2, + 0xb0, 0xf1, 0xff, 0x3f, 0x03, 0xdc, 0x20, 0x46, 0xf6, 0xf7, 0x4c, 0xfd, + 0x20, 0xb1, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x50, 0xb8, + 0x25, 0xf4, 0x00, 0x40, 0xc4, 0xf8, 0x88, 0x00, 0x20, 0x46, 0x00, 0xf0, + 0x49, 0xf8, 0xd4, 0xf8, 0x88, 0x00, 0x40, 0xf4, 0x00, 0x40, 0xc4, 0xf8, + 0x88, 0x00, 0xb0, 0xbd, 0xe8, 0x72, 0x01, 0x00, 0x80, 0xb5, 0x00, 0xf0, + 0x43, 0xf8, 0x0a, 0x49, 0x91, 0xf8, 0x4d, 0x20, 0x02, 0x2a, 0x06, 0xd3, + 0xc9, 0x6a, 0x01, 0x31, 0x04, 0xd0, 0x10, 0x28, 0x28, 0xbf, 0x10, 0x20, + 0x00, 0xe0, 0x32, 0xb1, 0x04, 0x49, 0x09, 0x78, 0x01, 0x29, 0x02, 0xd1, + 0x10, 0x28, 0x28, 0xbf, 0x10, 0x20, 0x80, 0xbd, 0x18, 0x74, 0x01, 0x00, + 0x7e, 0x2c, 0x06, 0x00, 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, + 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x08, 0x9d, 0x08, 0x00, + 0x09, 0xf5, 0x04, 0x00, 0xcc, 0xa1, 0x08, 0x00, 0x61, 0xf6, 0x04, 0x00, + 0x58, 0xa0, 0x08, 0x00, 0x99, 0xf6, 0x04, 0x00, 0x58, 0xcf, 0x08, 0x00, + 0xfd, 0xf6, 0x04, 0x00, 0x46, 0xf2, 0x53, 0x2c, 0xc1, 0xf2, 0x0f, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf6, 0xc7, 0x7c, 0xc1, 0xf2, 0x0f, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x45, 0xf6, 0x9f, 0x4c, 0xc1, 0xf2, 0x0f, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xb0, 0xb5, 0x05, 0x46, 0x00, 0xf0, 0x7a, 0xf8, + 0x04, 0x46, 0x01, 0x28, 0x07, 0xd1, 0x05, 0x48, 0x02, 0x68, 0x28, 0x68, + 0x90, 0xf8, 0xb0, 0x15, 0x4f, 0xf4, 0x00, 0x70, 0x90, 0x47, 0x20, 0x46, + 0xb0, 0xbd, 0x00, 0xbf, 0xf8, 0xb9, 0x08, 0x00, 0x10, 0xb5, 0x01, 0x68, + 0x04, 0x46, 0x79, 0xb1, 0x26, 0x48, 0x27, 0x4a, 0x00, 0x78, 0xc0, 0xeb, + 0x40, 0x10, 0x02, 0xeb, 0xc0, 0x00, 0xb0, 0xf8, 0xdc, 0x00, 0xc0, 0x07, + 0x04, 0xd0, 0x05, 0x4a, 0x94, 0xf8, 0x84, 0x00, 0x12, 0x68, 0x90, 0x47, + 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, 0x57, 0xb8, 0x00, 0xbf, + 0xfc, 0xbb, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0x8a, 0xb0, 0x04, 0x46, + 0x00, 0xf0, 0x54, 0xf8, 0x20, 0x68, 0x40, 0xb3, 0x15, 0x49, 0x90, 0xf8, + 0xb0, 0x05, 0x09, 0x68, 0x88, 0x47, 0x20, 0x68, 0x08, 0xb3, 0x13, 0x48, + 0x13, 0x49, 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x01, 0xeb, 0xc0, 0x00, + 0xb0, 0xf8, 0xdc, 0x10, 0x49, 0x07, 0x16, 0xd5, 0x00, 0xf1, 0xc0, 0x01, + 0x0e, 0x48, 0x02, 0x68, 0x03, 0xa8, 0x90, 0x47, 0x0d, 0x48, 0x03, 0xaf, + 0x09, 0x9d, 0x9d, 0xf8, 0x25, 0x80, 0x04, 0x68, 0xcf, 0xcf, 0xcd, 0xe9, + 0x00, 0x67, 0x02, 0x95, 0xa0, 0x47, 0x01, 0x46, 0xa8, 0xf1, 0x02, 0x00, + 0xc0, 0xb2, 0x01, 0xf0, 0xe9, 0xfe, 0x0a, 0xb0, 0xbd, 0xe8, 0xf0, 0x81, + 0x68, 0xd2, 0x08, 0x00, 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, + 0x18, 0xb8, 0x08, 0x00, 0x1c, 0xb8, 0x08, 0x00, 0x03, 0x48, 0x04, 0x49, + 0x01, 0x60, 0x04, 0x48, 0x04, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0xf4, 0xbb, 0x08, 0x00, 0xd4, 0xf8, 0x04, 0x00, 0xb4, 0xe2, 0x08, 0x00, + 0xb4, 0xf8, 0x04, 0x00, 0x49, 0xf2, 0xe1, 0x1c, 0xc1, 0xf2, 0x0f, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf2, 0x6b, 0x2c, 0xc1, 0xf2, 0x0f, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf6, 0x99, 0x2c, 0xc1, 0xf2, 0x0f, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x8d, 0x91, 0x0d, 0x10, 0xfb, 0x91, 0x0d, 0x10, + 0x95, 0xf7, 0x04, 0x00, 0xbd, 0xf7, 0x04, 0x00, 0x41, 0x99, 0x0f, 0x10, + 0xf5, 0xf7, 0x04, 0x00, 0x91, 0x6a, 0x0f, 0x10, 0x49, 0x00, 0x00, 0x00, + 0x8d, 0x91, 0x0d, 0x10, 0xf7, 0x95, 0x0f, 0x10, 0x95, 0xf7, 0x04, 0x00, + 0xbd, 0xf7, 0x04, 0x00, 0x41, 0x99, 0x0f, 0x10, 0xf5, 0xf7, 0x04, 0x00, + 0x91, 0x6a, 0x0f, 0x10, 0x4a, 0x00, 0x00, 0x00, 0xb0, 0xb5, 0x16, 0x49, + 0x09, 0x68, 0xc9, 0x07, 0x24, 0xd0, 0x15, 0x49, 0x15, 0x4a, 0x13, 0x78, + 0x09, 0x7c, 0x15, 0x4a, 0x8b, 0x42, 0x94, 0xbf, 0xcc, 0x1a, 0x5c, 0x1a, + 0x92, 0x79, 0xe4, 0xb2, 0x94, 0x42, 0x15, 0xd3, 0x11, 0x4c, 0x24, 0x79, + 0x02, 0x2c, 0x13, 0xd1, 0x10, 0x4c, 0x94, 0xf8, 0xbe, 0x50, 0x94, 0xf8, + 0xbf, 0x40, 0x2b, 0x44, 0xdd, 0xb2, 0xa5, 0x42, 0x28, 0xbf, 0x1b, 0x1b, + 0xdc, 0xb2, 0x8c, 0x42, 0x94, 0xbf, 0xc9, 0x1a, 0x59, 0x1a, 0xc9, 0xb2, + 0x91, 0x42, 0x01, 0xd2, 0x00, 0x20, 0xb0, 0xbd, 0xbd, 0xe8, 0xb0, 0x40, + 0x00, 0xf0, 0x14, 0xb8, 0x04, 0x10, 0x00, 0x40, 0x84, 0x71, 0x01, 0x00, + 0xf4, 0x6d, 0x01, 0x00, 0x8c, 0x32, 0x06, 0x00, 0xc8, 0x6d, 0x01, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x4c, 0xbb, 0x08, 0x00, 0x84, 0xf9, 0x04, 0x00, 0x45, 0xf2, 0x07, 0x4c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0xf1, 0x52, 0x0f, 0x10, + 0x55, 0x6a, 0x0f, 0x10, 0xf5, 0xf8, 0x04, 0x00, 0x47, 0x54, 0x0f, 0x10, + 0x8d, 0x6a, 0x0f, 0x10, 0x8f, 0x6a, 0x0f, 0x10, 0x91, 0x6a, 0x0f, 0x10, + 0x01, 0x00, 0x00, 0x00, 0x2d, 0xe9, 0xf8, 0x43, 0x26, 0x4f, 0x14, 0x46, + 0x00, 0x28, 0x41, 0xd0, 0x06, 0x46, 0xb8, 0x68, 0x00, 0x28, 0x3d, 0xd1, + 0x23, 0x48, 0x0d, 0x46, 0xb0, 0xf8, 0x30, 0x03, 0x88, 0x42, 0x37, 0xd9, + 0xdf, 0xf8, 0x84, 0x90, 0x72, 0xb6, 0xd9, 0xf8, 0x00, 0x00, 0x40, 0x00, + 0x01, 0x30, 0xc9, 0xf8, 0x00, 0x00, 0x1e, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x80, 0x46, 0xd9, 0xf8, 0x00, 0x00, 0xb8, 0xf1, 0x00, 0x0f, 0x4f, 0xea, + 0x50, 0x00, 0xc9, 0xf8, 0x00, 0x00, 0xd9, 0xf8, 0x00, 0x00, 0x80, 0xf3, + 0x10, 0x88, 0x1a, 0xd0, 0xd1, 0xf7, 0x0c, 0xfb, 0x03, 0x21, 0x04, 0x30, + 0xc7, 0xf8, 0x0c, 0x80, 0x3c, 0x74, 0xbe, 0x60, 0x88, 0xf8, 0x14, 0x10, + 0x69, 0x1c, 0xa8, 0xf8, 0x10, 0x10, 0x1a, 0x49, 0x08, 0x40, 0x79, 0x68, + 0x38, 0x60, 0xc8, 0xf8, 0x00, 0x00, 0x0d, 0x48, 0x01, 0x31, 0x02, 0x68, + 0x0c, 0x48, 0x79, 0x60, 0x81, 0x69, 0x40, 0x46, 0x90, 0x47, 0x01, 0x20, + 0xbd, 0xe8, 0xf8, 0x83, 0x38, 0x7c, 0xa0, 0x42, 0x4f, 0xf0, 0x00, 0x00, + 0x38, 0xbf, 0x3c, 0x74, 0xbd, 0xe8, 0xf8, 0x83, 0xf4, 0x71, 0x01, 0x00, + 0x00, 0x69, 0x08, 0x00, 0x24, 0x36, 0x01, 0x00, 0xd8, 0xa0, 0x08, 0x00, + 0xd4, 0xa0, 0x08, 0x00, 0xfc, 0x73, 0x01, 0x00, 0x80, 0xb5, 0x06, 0x4a, + 0x06, 0x4b, 0x51, 0x68, 0x12, 0x6a, 0x82, 0x60, 0x04, 0x32, 0x1a, 0x40, + 0x02, 0x60, 0x04, 0x4a, 0x12, 0x68, 0x90, 0x47, 0x00, 0x20, 0x80, 0xbd, + 0xfc, 0x70, 0x01, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc4, 0xa0, 0x08, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x81, 0x62, 0x70, 0x47, 0x90, 0xe8, 0x08, 0x00, + 0x5d, 0xfa, 0x04, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x16, 0x48, 0x01, 0x78, + 0x61, 0xb1, 0x00, 0x21, 0x08, 0x22, 0x01, 0x70, 0x14, 0x48, 0x61, 0x68, + 0x03, 0x68, 0x83, 0x20, 0x98, 0x47, 0x20, 0x46, 0xdf, 0xf7, 0x08, 0xf9, + 0x00, 0x20, 0x10, 0xbd, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, + 0x29, 0xb8, 0x00, 0xbf, 0x10, 0xb5, 0x04, 0x46, 0x0a, 0x48, 0x01, 0x78, + 0x61, 0xb1, 0x00, 0x21, 0x08, 0x22, 0x01, 0x70, 0x08, 0x48, 0x61, 0x68, + 0x03, 0x68, 0x83, 0x20, 0x98, 0x47, 0x20, 0x46, 0xdf, 0xf7, 0xf0, 0xf8, + 0x00, 0x20, 0x10, 0xbd, 0x20, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, + 0x17, 0xb8, 0x00, 0xbf, 0xcc, 0xf0, 0x05, 0x00, 0xa8, 0xa0, 0x08, 0x00, + 0x02, 0x48, 0x03, 0x49, 0x81, 0x61, 0x03, 0x49, 0xc1, 0x60, 0x70, 0x47, + 0xf4, 0xe0, 0x08, 0x00, 0x95, 0xfa, 0x04, 0x00, 0xc5, 0xfa, 0x04, 0x00, + 0x47, 0xf2, 0xc3, 0x6c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x47, 0xf2, 0xd3, 0x5c, 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x2d, 0xe9, 0xfe, 0x4f, 0xc6, 0x4c, 0xdf, 0xf8, 0x1c, 0x93, 0x20, 0x78, + 0xc0, 0xeb, 0x40, 0x10, 0x09, 0xeb, 0xc0, 0x02, 0x92, 0xf8, 0x91, 0x10, + 0x31, 0xb1, 0xb2, 0xf8, 0xdc, 0x10, 0xcb, 0x06, 0x48, 0xbf, 0x5f, 0xea, + 0x01, 0x71, 0x01, 0xd4, 0xbd, 0xe8, 0xfe, 0x8f, 0x59, 0xf8, 0x30, 0x60, + 0xb2, 0xf8, 0xde, 0xb0, 0x92, 0xf8, 0x9f, 0x30, 0xdf, 0xf8, 0xec, 0x82, + 0x31, 0x6f, 0xb3, 0xfa, 0x83, 0xf3, 0x5b, 0x09, 0x59, 0x44, 0x31, 0x67, + 0x00, 0x21, 0x82, 0xf8, 0x9e, 0x10, 0x92, 0xf8, 0xa1, 0x10, 0x59, 0xf8, + 0x30, 0x00, 0x18, 0xf8, 0x01, 0x10, 0x90, 0xf8, 0x35, 0x71, 0x41, 0xea, + 0x83, 0x03, 0x82, 0xf8, 0x95, 0x70, 0x1b, 0x01, 0x82, 0xf8, 0x96, 0x30, + 0xaf, 0x4a, 0x12, 0x78, 0x12, 0xb1, 0x00, 0xf1, 0x20, 0x02, 0x0d, 0xe0, + 0xad, 0x4a, 0x12, 0x78, 0x42, 0xf0, 0x02, 0x02, 0x02, 0x2a, 0x03, 0xd1, + 0x90, 0xf8, 0x88, 0x20, 0x52, 0x07, 0x02, 0xd4, 0x00, 0xf1, 0x2c, 0x02, + 0x00, 0xe0, 0xa8, 0x4a, 0x4f, 0xea, 0x1b, 0x27, 0xbb, 0xf1, 0x00, 0x0f, + 0x00, 0x92, 0x05, 0xd0, 0xbb, 0xf1, 0x03, 0x0f, 0x24, 0xd8, 0x02, 0x29, + 0x2e, 0xd0, 0x21, 0xe0, 0x02, 0x29, 0x1f, 0xd1, 0xa2, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x00, 0x28, 0xb6, 0xd0, 0x21, 0x78, 0xc1, 0xeb, 0x41, 0x11, + 0x09, 0xeb, 0xc1, 0x01, 0x91, 0xf8, 0x95, 0x10, 0x01, 0x70, 0x21, 0x78, + 0xc1, 0xeb, 0x41, 0x11, 0x09, 0xeb, 0xc1, 0x01, 0x91, 0xf8, 0x96, 0x10, + 0xc7, 0x70, 0x80, 0xf8, 0x02, 0xb0, 0x41, 0x70, 0x00, 0x99, 0xd3, 0xf7, + 0xdd, 0xfb, 0x01, 0x20, 0x4f, 0xf0, 0x00, 0x0b, 0x00, 0x27, 0xa2, 0xe0, + 0x90, 0xf8, 0x35, 0x01, 0x90, 0x49, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, + 0x40, 0x10, 0x90, 0xf8, 0x5d, 0x00, 0x01, 0x28, 0x40, 0xf0, 0x96, 0x80, + 0x8c, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x28, 0x3f, 0xf4, 0x8a, 0xaf, + 0x05, 0x46, 0x96, 0xf8, 0x35, 0x01, 0x4f, 0xf0, 0x01, 0x0a, 0x02, 0xa9, + 0xad, 0xf8, 0x0a, 0xb0, 0x8d, 0xf8, 0x08, 0xa0, 0x8d, 0xf8, 0x09, 0x00, + 0x84, 0x48, 0x02, 0x68, 0x42, 0x20, 0x90, 0x47, 0x20, 0x78, 0xc0, 0xeb, + 0x40, 0x10, 0x09, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0xa1, 0x00, 0x18, 0xf8, + 0x00, 0x10, 0x96, 0xf8, 0x35, 0x01, 0x02, 0x29, 0x06, 0xd1, 0x7a, 0x4a, + 0x00, 0xeb, 0x40, 0x01, 0x02, 0xeb, 0x41, 0x11, 0x81, 0xf8, 0x5d, 0xa0, + 0x76, 0x4c, 0x00, 0xeb, 0x40, 0x00, 0x04, 0xeb, 0x40, 0x10, 0x90, 0xf8, + 0x5c, 0x20, 0x02, 0xeb, 0x0b, 0x01, 0x03, 0x29, 0x12, 0xd8, 0x10, 0x44, + 0x2a, 0x1d, 0x59, 0x46, 0x5b, 0x46, 0x58, 0x30, 0xd1, 0xf7, 0xba, 0xf9, + 0x96, 0xf8, 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, 0x04, 0xeb, 0x40, 0x10, + 0x90, 0xf8, 0x5c, 0x10, 0x59, 0x44, 0x80, 0xf8, 0x5c, 0x10, 0x4c, 0xe0, + 0x6a, 0x48, 0x00, 0x88, 0x81, 0x42, 0x48, 0xd2, 0x69, 0x48, 0x00, 0x21, + 0x4f, 0xf0, 0x00, 0x0a, 0x00, 0xf5, 0xe8, 0x70, 0xd5, 0xf7, 0xec, 0xfa, + 0x00, 0x28, 0x3e, 0xd0, 0x80, 0x46, 0x96, 0xf8, 0x35, 0x01, 0x00, 0xeb, + 0x40, 0x00, 0x04, 0xeb, 0x40, 0x10, 0x90, 0xf8, 0x5c, 0x10, 0x00, 0xf1, + 0x58, 0x02, 0x08, 0xf1, 0x04, 0x00, 0x0b, 0x46, 0xd1, 0xf7, 0x90, 0xf9, + 0x96, 0xf8, 0x35, 0x01, 0x2a, 0x1d, 0x59, 0x46, 0x5b, 0x46, 0x00, 0xeb, + 0x40, 0x00, 0x04, 0xeb, 0x40, 0x10, 0x90, 0xf8, 0x5c, 0x00, 0x40, 0x44, + 0x04, 0x30, 0xd1, 0xf7, 0x81, 0xf9, 0x4b, 0x48, 0x00, 0x78, 0xc0, 0xeb, + 0x40, 0x10, 0x09, 0xeb, 0xc0, 0x00, 0x90, 0xf8, 0x96, 0x10, 0x01, 0xf0, + 0xcf, 0x01, 0x20, 0x31, 0x80, 0xf8, 0x96, 0x10, 0x28, 0x46, 0xd6, 0xf7, + 0xdf, 0xff, 0x96, 0xf8, 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, 0x04, 0xeb, + 0x40, 0x10, 0x90, 0xf8, 0x5c, 0x10, 0x80, 0xf8, 0x5d, 0xa0, 0x80, 0xf8, + 0x5c, 0xa0, 0x8b, 0x44, 0x1f, 0xfa, 0x8b, 0xf0, 0x07, 0x0a, 0x3b, 0x4c, + 0x00, 0x20, 0x01, 0x90, 0xdf, 0xf8, 0x10, 0x81, 0x5f, 0xfa, 0x8b, 0xf0, + 0x40, 0xea, 0x07, 0x25, 0x28, 0x04, 0x60, 0xd0, 0x3c, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x00, 0x28, 0x3f, 0xf4, 0xea, 0xae, 0x06, 0x46, 0x20, 0x78, + 0x3a, 0x49, 0xc0, 0xeb, 0x40, 0x10, 0x09, 0x88, 0x09, 0xeb, 0xc0, 0x00, + 0x90, 0xf8, 0x95, 0x00, 0x30, 0x70, 0xa8, 0xb2, 0x88, 0x42, 0x98, 0xbf, + 0x29, 0x46, 0x22, 0x78, 0x08, 0x0a, 0xa5, 0xeb, 0x01, 0x0b, 0xc2, 0xeb, + 0x42, 0x12, 0x09, 0xeb, 0xc2, 0x03, 0x93, 0xf8, 0x96, 0x70, 0xf0, 0x70, + 0xb1, 0x70, 0x77, 0x70, 0x93, 0xf8, 0x96, 0x00, 0x59, 0xf8, 0x32, 0x10, + 0x00, 0xf0, 0xcf, 0x00, 0x10, 0x30, 0x83, 0xf8, 0x96, 0x00, 0x1f, 0xfa, + 0x8b, 0xf0, 0x07, 0x0a, 0x91, 0xf8, 0xd0, 0x01, 0xff, 0x28, 0x27, 0xd0, + 0x72, 0x78, 0x02, 0xf0, 0x30, 0x02, 0x10, 0x2a, 0x03, 0xd1, 0x08, 0xeb, + 0x00, 0x12, 0x92, 0x7b, 0x0c, 0xe0, 0x08, 0xeb, 0x00, 0x13, 0xb4, 0x79, + 0xf5, 0x79, 0x9a, 0x89, 0x44, 0xea, 0x05, 0x24, 0xa2, 0x1a, 0x14, 0x4c, + 0xb2, 0xfa, 0x82, 0xf2, 0x52, 0x09, 0x9a, 0x73, 0x01, 0x2a, 0x0f, 0xd1, + 0x02, 0x01, 0x08, 0xeb, 0x00, 0x1a, 0x91, 0xf8, 0x35, 0x11, 0x58, 0xf8, + 0x02, 0x30, 0xba, 0xf8, 0x0c, 0x00, 0x32, 0x46, 0x98, 0x47, 0x01, 0x28, + 0xa2, 0xd0, 0x00, 0x20, 0x8a, 0xf8, 0x0e, 0x00, 0x00, 0x99, 0x30, 0x46, + 0xd3, 0xf7, 0xce, 0xfa, 0x01, 0x20, 0x01, 0x90, 0x98, 0xe7, 0x01, 0x98, + 0x00, 0x28, 0x3f, 0xf4, 0x8b, 0xae, 0x0f, 0x48, 0x04, 0x21, 0x00, 0x78, + 0xd1, 0xf7, 0xf2, 0xf8, 0xbd, 0xe8, 0xfe, 0x8f, 0x74, 0x87, 0x08, 0x00, + 0x0c, 0x6f, 0x01, 0x00, 0xd8, 0x69, 0x0f, 0x10, 0x70, 0x59, 0x01, 0x00, + 0x5d, 0x34, 0x01, 0x00, 0xf4, 0x61, 0x01, 0x00, 0x54, 0xf1, 0x05, 0x00, + 0xc4, 0xa1, 0x08, 0x00, 0x1c, 0xa1, 0x08, 0x00, 0xc6, 0x58, 0x01, 0x00, + 0x68, 0x8a, 0x01, 0x00, 0xd4, 0x71, 0x01, 0x00, 0x66, 0x34, 0x01, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, 0x0c, 0xb8, 0x08, 0x00, + 0x2d, 0xfb, 0x04, 0x00, 0x05, 0x48, 0x06, 0x4a, 0x41, 0x89, 0x03, 0x7a, + 0x91, 0x80, 0xc1, 0x79, 0x40, 0x7a, 0x53, 0x70, 0x11, 0x70, 0x90, 0x70, + 0x70, 0x47, 0x00, 0xbf, 0x98, 0x32, 0x06, 0x00, 0x4c, 0xf1, 0x05, 0x00, + 0xf8, 0xb5, 0x0c, 0x46, 0x05, 0x46, 0x00, 0xf0, 0x97, 0xf9, 0x06, 0x46, + 0x05, 0x48, 0x06, 0x49, 0x0a, 0x22, 0x23, 0x46, 0x07, 0x68, 0x28, 0x46, + 0xb8, 0x47, 0x01, 0x28, 0x08, 0xbf, 0x06, 0x46, 0x30, 0x46, 0xf8, 0xbd, + 0x20, 0xea, 0x08, 0x00, 0xc0, 0xd3, 0x05, 0x00, 0x80, 0xb5, 0x07, 0x49, + 0x09, 0x68, 0x88, 0x47, 0x4f, 0x49, 0x91, 0xf8, 0x2e, 0x10, 0x40, 0x1a, + 0x00, 0xb2, 0x10, 0xf1, 0x80, 0x0f, 0xd8, 0xbf, 0x6f, 0xf0, 0x7f, 0x00, + 0x40, 0xb2, 0x80, 0xbd, 0x1c, 0xea, 0x08, 0x00, 0xb0, 0xb5, 0x48, 0x4b, + 0x01, 0x24, 0xb1, 0xf9, 0x00, 0x50, 0x04, 0xfa, 0x02, 0xf2, 0xdb, 0x78, + 0xd2, 0xb2, 0x98, 0x40, 0x90, 0xfb, 0xf2, 0xf0, 0x95, 0xfb, 0xf2, 0xf2, + 0xaa, 0x1a, 0x10, 0x44, 0x08, 0x80, 0x00, 0xb2, 0x04, 0xfa, 0x03, 0xf1, + 0x90, 0xfb, 0xf1, 0xf0, 0x40, 0xb2, 0xb0, 0xbd, 0xfe, 0xb5, 0xa8, 0xb1, + 0x3a, 0x4d, 0x04, 0x46, 0xdd, 0xe9, 0x0a, 0x60, 0xdd, 0xe9, 0x08, 0xc7, + 0x2d, 0x68, 0xcd, 0xe9, 0x00, 0x76, 0x02, 0x90, 0x08, 0x46, 0x11, 0x46, + 0x1a, 0x46, 0x63, 0x46, 0xa8, 0x47, 0x14, 0x28, 0x84, 0xf8, 0xa5, 0x00, + 0x02, 0xdc, 0x05, 0x46, 0x80, 0x30, 0x00, 0xd1, 0xfe, 0xbd, 0xb4, 0xf8, + 0x84, 0x00, 0x40, 0x07, 0x1d, 0xd4, 0x30, 0x48, 0x72, 0xb6, 0x01, 0x68, + 0x49, 0x00, 0x01, 0x31, 0x01, 0x60, 0xb4, 0xf8, 0x84, 0x10, 0x41, 0xf0, + 0x04, 0x01, 0xa4, 0xf8, 0x84, 0x10, 0x01, 0x68, 0x49, 0x08, 0x01, 0x60, + 0x00, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x25, 0x48, 0x84, 0xf8, 0x3a, 0x50, + 0x84, 0xf8, 0xa6, 0x50, 0xc0, 0x78, 0x05, 0xfa, 0x00, 0xf0, 0xa0, 0x87, + 0xa4, 0xf8, 0xa8, 0x00, 0xfe, 0xbd, 0x1f, 0x49, 0x94, 0xf8, 0x35, 0x01, + 0xce, 0x78, 0x16, 0x28, 0x0c, 0xd8, 0x1d, 0x49, 0x00, 0xeb, 0x40, 0x02, + 0x51, 0xf8, 0x22, 0x20, 0x32, 0xb1, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, + 0x80, 0x00, 0x00, 0x79, 0x03, 0x28, 0x0b, 0xd0, 0x94, 0xf8, 0x24, 0x01, + 0x03, 0x28, 0x07, 0xd0, 0x94, 0xf8, 0x24, 0x01, 0x84, 0x28, 0x03, 0xd0, + 0x94, 0xf8, 0x24, 0x01, 0x85, 0x28, 0x08, 0xd1, 0xd4, 0xf8, 0xf8, 0x00, + 0xc9, 0x28, 0x04, 0xd3, 0x02, 0x26, 0xb0, 0xf5, 0x48, 0x7f, 0x88, 0xbf, + 0x01, 0x26, 0x72, 0x4f, 0x04, 0xf1, 0x3c, 0x01, 0x28, 0x46, 0x32, 0x46, + 0x3b, 0x68, 0x98, 0x47, 0x84, 0xf8, 0x3a, 0x00, 0x00, 0x2e, 0x18, 0xbf, + 0x01, 0x3e, 0x3b, 0x68, 0xf2, 0xb2, 0x04, 0xf1, 0xa8, 0x01, 0x28, 0x46, + 0x98, 0x47, 0x84, 0xf8, 0xa6, 0x00, 0xfe, 0xbd, 0x1c, 0xb8, 0x08, 0x00, + 0x00, 0x69, 0x08, 0x00, 0xe8, 0x72, 0x01, 0x00, 0x24, 0x36, 0x01, 0x00, + 0x10, 0xb5, 0x00, 0xf0, 0xdf, 0xf8, 0x18, 0x48, 0x18, 0x4c, 0x40, 0xf2, + 0xf3, 0x11, 0x81, 0x80, 0x20, 0x68, 0x40, 0xb9, 0x60, 0x79, 0x34, 0x21, + 0x10, 0xfb, 0x01, 0xf0, 0x14, 0x49, 0x09, 0x68, 0x88, 0x47, 0x20, 0x60, + 0xa0, 0xb1, 0x13, 0x4c, 0x20, 0x68, 0x30, 0xb9, 0x10, 0x48, 0x01, 0x68, + 0x20, 0x7a, 0xc0, 0x00, 0x88, 0x47, 0x20, 0x60, 0x70, 0xb1, 0xff, 0xf7, + 0x11, 0xff, 0x0e, 0x48, 0x00, 0x21, 0x01, 0x70, 0x0d, 0x48, 0x01, 0x78, + 0x41, 0xf0, 0x08, 0x01, 0x01, 0x70, 0x10, 0xbd, 0x00, 0x20, 0x40, 0xf2, + 0x71, 0x11, 0x02, 0xe0, 0x00, 0x20, 0x40, 0xf2, 0x7b, 0x11, 0xbd, 0xe8, + 0x10, 0x40, 0xd6, 0xf7, 0x15, 0xbe, 0x00, 0xbf, 0x70, 0x58, 0x01, 0x00, + 0x20, 0x54, 0x01, 0x00, 0xdc, 0x9b, 0x08, 0x00, 0x30, 0x54, 0x01, 0x00, + 0x52, 0xf1, 0x05, 0x00, 0x7f, 0x0f, 0x01, 0x00, 0x80, 0xb5, 0x00, 0xf0, + 0xa5, 0xf8, 0x09, 0x4a, 0x07, 0x48, 0x12, 0x78, 0x01, 0x78, 0x12, 0xb1, + 0x49, 0xb9, 0x01, 0x21, 0x01, 0xe0, 0x31, 0xb1, 0x00, 0x21, 0x01, 0x70, + 0x04, 0x48, 0x00, 0x68, 0xbd, 0xe8, 0x80, 0x40, 0x00, 0x47, 0x80, 0xbd, + 0x53, 0xf1, 0x05, 0x00, 0xd5, 0x58, 0x01, 0x00, 0x18, 0xc3, 0x08, 0x00, + 0x10, 0xb5, 0x04, 0x46, 0x09, 0x48, 0x90, 0xf8, 0x5f, 0x01, 0x01, 0x28, + 0x06, 0xd1, 0x08, 0x49, 0x20, 0x46, 0x04, 0x22, 0x00, 0xf0, 0x88, 0xf8, + 0x10, 0xb1, 0x10, 0xbd, 0x00, 0x20, 0x10, 0xbd, 0x20, 0x46, 0xbd, 0xe8, + 0x10, 0x40, 0x00, 0xf0, 0x85, 0xb8, 0x00, 0xbf, 0xe8, 0x65, 0x08, 0x00, + 0x24, 0xd4, 0x05, 0x00, 0xbc, 0xb5, 0x04, 0x46, 0x48, 0x78, 0x00, 0xf0, + 0x30, 0x00, 0x10, 0x28, 0x2b, 0xd0, 0x0d, 0x46, 0x0a, 0x1d, 0x68, 0x46, + 0x05, 0x21, 0x05, 0x23, 0xd0, 0xf7, 0x76, 0xff, 0xbd, 0xf8, 0x02, 0x00, + 0x04, 0x28, 0x20, 0xd1, 0xbd, 0xf8, 0x00, 0x00, 0x38, 0x28, 0x1c, 0xd1, + 0x9d, 0xf8, 0x04, 0x00, 0x1b, 0x28, 0x18, 0xd1, 0x68, 0x7a, 0xa9, 0x7a, + 0x40, 0xea, 0x01, 0x20, 0x15, 0x28, 0x12, 0xd1, 0xe8, 0x7a, 0x10, 0xf0, + 0x03, 0x01, 0x0e, 0xd0, 0x03, 0x29, 0x0c, 0xd0, 0x10, 0xf0, 0xfc, 0x0f, + 0x09, 0xd0, 0xb4, 0xf8, 0x38, 0x03, 0x40, 0xf4, 0x00, 0x50, 0xa4, 0xf8, + 0x38, 0x03, 0x02, 0x48, 0x01, 0x68, 0x32, 0x20, 0x88, 0x47, 0xbc, 0xbd, + 0xe0, 0x9c, 0x08, 0x00, 0x0a, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, + 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, + 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, 0x0d, 0x49, 0x01, 0x60, 0x0d, 0x48, + 0x0d, 0x49, 0x01, 0x60, 0x0d, 0x48, 0x0e, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x24, 0xea, 0x08, 0x00, 0xdd, 0xfe, 0x04, 0x00, 0x0c, 0xbb, 0x08, 0x00, + 0xb1, 0xfe, 0x04, 0x00, 0x10, 0xb8, 0x08, 0x00, 0x01, 0xff, 0x04, 0x00, + 0x14, 0xb8, 0x08, 0x00, 0x31, 0xff, 0x04, 0x00, 0x34, 0xc8, 0x08, 0x00, + 0x31, 0x00, 0x05, 0x00, 0xb8, 0xa0, 0x08, 0x00, 0xb1, 0x00, 0x05, 0x00, + 0x30, 0xea, 0x08, 0x00, 0xe5, 0x00, 0x05, 0x00, 0x4c, 0xf2, 0x2d, 0x6c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf2, 0x11, 0x3c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0xbf, 0x0c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4c, 0xf2, 0xf7, 0x6c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4c, 0xf2, 0x87, 0x7c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x7c, 0xb5, 0x04, 0x46, + 0x2a, 0x48, 0x0d, 0x46, 0x00, 0x68, 0x80, 0x47, 0x16, 0x2d, 0x4d, 0xd8, + 0x28, 0x49, 0x05, 0xeb, 0x45, 0x00, 0x51, 0xf8, 0x20, 0x00, 0x00, 0x28, + 0x46, 0xd0, 0x05, 0xeb, 0x45, 0x02, 0x01, 0xeb, 0x82, 0x01, 0x09, 0x79, + 0x04, 0x29, 0x3f, 0xd8, 0x01, 0x22, 0x8a, 0x40, 0x12, 0xf0, 0x1a, 0x0f, + 0x3a, 0xd0, 0x90, 0xf8, 0x35, 0x21, 0x03, 0x29, 0xad, 0xf8, 0x00, 0x20, + 0xd0, 0xf8, 0xd8, 0x20, 0xa4, 0xeb, 0x02, 0x02, 0xad, 0xf8, 0x02, 0x20, + 0x03, 0xd0, 0x90, 0xf8, 0xb0, 0x15, 0x01, 0x29, 0x01, 0xd1, 0x03, 0x21, + 0x04, 0xe0, 0x01, 0x78, 0x01, 0x39, 0xb1, 0xfa, 0x81, 0xf1, 0x49, 0x09, + 0x14, 0x4a, 0x90, 0xf8, 0x74, 0x00, 0x12, 0x68, 0x90, 0x47, 0x8d, 0xf8, + 0x06, 0x00, 0x12, 0x48, 0x00, 0x22, 0x04, 0x23, 0x6c, 0x46, 0x90, 0xf8, + 0x5f, 0x10, 0x01, 0x29, 0x11, 0xbf, 0xff, 0x25, 0x00, 0xeb, 0x42, 0x05, + 0xb5, 0xf9, 0x58, 0x50, 0x95, 0xfb, 0xf3, 0xf5, 0xa6, 0x18, 0x00, 0x2a, + 0x4f, 0xf0, 0x01, 0x02, 0x35, 0x71, 0xf0, 0xd0, 0x08, 0x48, 0x6a, 0x46, + 0x00, 0x21, 0x08, 0x23, 0x04, 0x68, 0x4f, 0xf4, 0xc1, 0x60, 0xa0, 0x47, + 0x7c, 0xbd, 0x00, 0xbf, 0x3c, 0xc5, 0x08, 0x00, 0xe8, 0x72, 0x01, 0x00, + 0x34, 0x9c, 0x08, 0x00, 0xd0, 0xe2, 0x05, 0x00, 0x78, 0x9b, 0x08, 0x00, + 0x10, 0xb5, 0x40, 0xf2, 0x71, 0x23, 0xc1, 0xf3, 0x0b, 0x11, 0xa0, 0xfb, + 0x03, 0x03, 0x5f, 0xea, 0x53, 0x03, 0x4f, 0xea, 0x30, 0x00, 0x08, 0x44, + 0x90, 0x42, 0x01, 0xd2, 0x14, 0x1a, 0x07, 0xe0, 0xc1, 0x0e, 0x10, 0x29, + 0x87, 0xbf, 0xc0, 0x43, 0x84, 0x18, 0x10, 0x1a, 0x00, 0xf1, 0x08, 0x44, + 0x08, 0x48, 0x84, 0x42, 0x07, 0xd2, 0x44, 0xf6, 0x37, 0x20, 0x84, 0x42, + 0x08, 0xd8, 0x00, 0x20, 0x40, 0xf2, 0x13, 0x11, 0x02, 0xe0, 0x00, 0x20, + 0x4f, 0xf4, 0x89, 0x71, 0xd6, 0xf7, 0xc4, 0xfc, 0x20, 0x46, 0x10, 0xbd, + 0xe9, 0xe5, 0x04, 0x00, 0xf0, 0xb5, 0x85, 0xb0, 0x14, 0x46, 0x0f, 0x46, + 0x06, 0x46, 0xde, 0xf7, 0x43, 0xfa, 0x00, 0x25, 0x28, 0xbb, 0x14, 0x48, + 0x6a, 0x46, 0x02, 0x97, 0xad, 0xf8, 0x0c, 0x50, 0x03, 0x68, 0xd6, 0xf8, + 0xd4, 0x00, 0x00, 0xf1, 0x14, 0x01, 0x02, 0xa8, 0x98, 0x47, 0x96, 0xf8, + 0x32, 0x04, 0x0e, 0x49, 0x04, 0x22, 0x0a, 0x23, 0x00, 0xeb, 0x80, 0x00, + 0x01, 0xeb, 0xc0, 0x00, 0x0b, 0x49, 0x04, 0x30, 0x0e, 0x68, 0x04, 0xa9, + 0xb0, 0x47, 0x04, 0x9a, 0xdd, 0xe9, 0x00, 0x01, 0x12, 0xba, 0xff, 0xf7, + 0xab, 0xff, 0x41, 0xf2, 0x70, 0x71, 0x40, 0x1a, 0xa0, 0x42, 0x38, 0xbf, + 0x01, 0x25, 0x28, 0x46, 0x05, 0xb0, 0xf0, 0xbd, 0x48, 0xa1, 0x08, 0x00, + 0x40, 0x01, 0x00, 0x00, 0x34, 0xe5, 0x08, 0x00, 0x7c, 0xb5, 0x58, 0xb1, + 0x04, 0x46, 0xd0, 0xf8, 0xd4, 0x00, 0x38, 0xb1, 0x01, 0x7f, 0x04, 0x29, + 0x04, 0xd8, 0x25, 0x4a, 0x52, 0xf8, 0x21, 0x10, 0x88, 0x42, 0x00, 0xd0, + 0x7c, 0xbd, 0x90, 0xf8, 0xe6, 0x10, 0x31, 0xb9, 0x90, 0xf8, 0xe7, 0x10, + 0x19, 0xb9, 0x90, 0xf8, 0xe8, 0x00, 0x00, 0x28, 0xf4, 0xd0, 0x94, 0xf8, + 0xa4, 0x04, 0x41, 0x07, 0x01, 0xd5, 0x00, 0x07, 0xee, 0xd5, 0xb4, 0xf8, + 0x82, 0x00, 0x41, 0x06, 0x2b, 0xd5, 0x19, 0x48, 0x9f, 0x4d, 0x01, 0x21, + 0x00, 0x22, 0x06, 0x68, 0x80, 0x20, 0x2b, 0x46, 0x00, 0x90, 0x40, 0xf2, + 0xa9, 0x60, 0xb0, 0x47, 0xb4, 0xf8, 0x82, 0x00, 0x40, 0x06, 0x15, 0xd5, + 0x28, 0x6d, 0xe9, 0x6d, 0x11, 0x4a, 0x40, 0x1a, 0x20, 0xf0, 0x70, 0x40, + 0x01, 0x09, 0x32, 0x29, 0x9a, 0xbf, 0x00, 0xeb, 0x80, 0x00, 0xc0, 0xf3, + 0x1a, 0x11, 0xff, 0x21, 0xab, 0x6c, 0x68, 0x78, 0x15, 0x68, 0x00, 0x22, + 0xc9, 0xb2, 0x00, 0x92, 0x00, 0x22, 0xa8, 0x47, 0x08, 0x48, 0x12, 0x21, + 0x00, 0x78, 0xd0, 0xf7, 0xf1, 0xfd, 0xb4, 0xf8, 0x82, 0x00, 0x20, 0xf0, + 0x40, 0x00, 0xa4, 0xf8, 0x82, 0x00, 0x7c, 0xbd, 0xfc, 0x73, 0x01, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0x7c, 0xe5, 0x08, 0x00, 0x66, 0x34, 0x01, 0x00, + 0x2d, 0xe9, 0xfe, 0x4f, 0x00, 0x28, 0x44, 0xd0, 0x04, 0x46, 0x90, 0xf8, + 0x88, 0x04, 0x80, 0x07, 0x3f, 0xd5, 0xd0, 0xf7, 0xcb, 0xfd, 0xc4, 0xf8, + 0x70, 0x01, 0x73, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xb8, 0xb1, + 0x71, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x06, 0x46, 0x4f, 0xea, + 0x10, 0x6a, 0x4f, 0xea, 0x10, 0x4b, 0x05, 0x0a, 0x6d, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x07, 0x46, 0x4f, 0xea, 0x10, 0x68, 0x4f, 0xea, + 0x10, 0x49, 0x01, 0x0a, 0x00, 0x20, 0x02, 0x90, 0x30, 0x46, 0x1b, 0xe0, + 0x94, 0x48, 0x27, 0x6a, 0xb0, 0xf8, 0x1e, 0x05, 0x3b, 0x46, 0x02, 0x97, + 0x03, 0x30, 0x20, 0xf0, 0x03, 0x01, 0x7a, 0x18, 0x7f, 0x5c, 0x55, 0x7a, + 0x16, 0x7a, 0x92, 0xf8, 0x0a, 0xb0, 0x92, 0xf8, 0x0b, 0xa0, 0x51, 0x78, + 0x92, 0xf8, 0x02, 0x90, 0x92, 0xf8, 0x03, 0x80, 0x46, 0xea, 0x05, 0x20, + 0x40, 0xea, 0x0b, 0x40, 0x40, 0xea, 0x0a, 0x60, 0x01, 0x30, 0x02, 0x28, + 0x01, 0xd2, 0xbd, 0xe8, 0xfe, 0x8f, 0x57, 0x48, 0x01, 0x91, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x5f, 0xfa, 0x8b, 0xf0, 0xe9, 0xb2, 0x00, 0x04, + 0x40, 0xea, 0x0a, 0x60, 0x40, 0xea, 0x01, 0x20, 0xf1, 0xb2, 0x08, 0x44, + 0xd4, 0xf8, 0x70, 0x11, 0x08, 0x1a, 0x01, 0x99, 0x20, 0xf0, 0x70, 0x4a, + 0x5f, 0xfa, 0x89, 0xf0, 0x00, 0x04, 0xc9, 0xb2, 0x40, 0xea, 0x08, 0x60, + 0x40, 0xea, 0x01, 0x20, 0xf9, 0xb2, 0x47, 0x18, 0xd0, 0xf7, 0x6a, 0xfd, + 0xc0, 0x1b, 0x94, 0xf8, 0x32, 0x94, 0x20, 0xf0, 0x70, 0x46, 0x41, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x30, 0xb1, 0x42, 0x49, 0x09, 0xeb, + 0x49, 0x00, 0x01, 0xeb, 0x00, 0x10, 0x80, 0x8c, 0x48, 0xbb, 0x3b, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x30, 0xb1, 0x3c, 0x49, 0x09, 0xeb, + 0x49, 0x00, 0x01, 0xeb, 0x00, 0x10, 0x80, 0x68, 0xe8, 0xb9, 0x3a, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x18, 0xb1, 0x39, 0x48, 0x00, 0x68, 0x86, 0x42, + 0x15, 0xd8, 0xd4, 0xf8, 0xa0, 0x04, 0x82, 0x45, 0x03, 0xd9, 0x20, 0x46, + 0xde, 0xf7, 0x1e, 0xf9, 0x68, 0xb9, 0x40, 0xf2, 0x71, 0x20, 0x39, 0x46, + 0x70, 0x43, 0x42, 0x08, 0x20, 0x46, 0xff, 0xf7, 0xcb, 0xfe, 0x20, 0xb9, + 0x58, 0x48, 0xb0, 0xf8, 0x3c, 0x01, 0xc0, 0x04, 0xa1, 0xd5, 0x2c, 0x48, + 0x01, 0x68, 0x8e, 0x42, 0x88, 0xbf, 0x06, 0x60, 0x94, 0xf8, 0xf3, 0x04, + 0xd0, 0xb9, 0x50, 0x46, 0xd2, 0xf7, 0xee, 0xfe, 0x06, 0x46, 0xd4, 0xf8, + 0xa0, 0x04, 0xd2, 0xf7, 0xe9, 0xfe, 0x01, 0x46, 0x30, 0x46, 0xd2, 0xf7, + 0xeb, 0xfe, 0x23, 0x49, 0xd2, 0xf7, 0xdc, 0xfe, 0x01, 0x46, 0x94, 0xf8, + 0x32, 0x04, 0x21, 0x4e, 0x00, 0xeb, 0x40, 0x05, 0x56, 0xf8, 0x25, 0x00, + 0xd2, 0xf7, 0xd2, 0xfe, 0x46, 0xf8, 0x25, 0x00, 0xb4, 0xf8, 0x82, 0x00, + 0x17, 0x4b, 0x09, 0xeb, 0x49, 0x02, 0xb2, 0x49, 0x00, 0x26, 0x40, 0xf0, + 0x40, 0x00, 0x03, 0xeb, 0x02, 0x15, 0xa4, 0xf8, 0x82, 0x00, 0x94, 0xf8, + 0x35, 0x01, 0xea, 0x68, 0xeb, 0x6a, 0x00, 0xeb, 0x40, 0x00, 0x1a, 0x44, + 0x01, 0xeb, 0x40, 0x10, 0x81, 0x6a, 0x11, 0x44, 0x00, 0x22, 0x81, 0x62, + 0x10, 0x48, 0x21, 0x46, 0x03, 0x68, 0x02, 0x98, 0x98, 0x47, 0x0f, 0x48, + 0xee, 0x62, 0xae, 0x84, 0xc5, 0xe9, 0x02, 0x66, 0x81, 0x79, 0x41, 0xf0, + 0x08, 0x01, 0x81, 0x71, 0xbd, 0xe8, 0xfe, 0x8f, 0x54, 0x9d, 0x08, 0x00, + 0x78, 0xcf, 0x08, 0x00, 0x58, 0x9d, 0x08, 0x00, 0x50, 0xcf, 0x08, 0x00, + 0x4c, 0x49, 0x01, 0x00, 0x74, 0xcf, 0x08, 0x00, 0xe0, 0x77, 0x01, 0x00, + 0x00, 0x00, 0x80, 0xbf, 0x10, 0x5e, 0x01, 0x00, 0x5c, 0xcf, 0x08, 0x00, + 0xe0, 0x76, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0xdf, 0xf8, 0x68, 0x80, + 0x80, 0x21, 0x40, 0x46, 0xd2, 0xf7, 0x5e, 0xfe, 0x18, 0x4c, 0x65, 0x69, + 0x28, 0x46, 0x00, 0xf0, 0xf3, 0xfc, 0x06, 0x46, 0x40, 0x46, 0x7f, 0x21, + 0x2a, 0x46, 0xf7, 0xb2, 0x00, 0xf8, 0x01, 0x6b, 0x3b, 0x46, 0xd0, 0xf7, + 0xbb, 0xfc, 0x12, 0x4d, 0x58, 0xfa, 0x86, 0xf6, 0x28, 0x46, 0x00, 0xf0, + 0xe3, 0xfc, 0x72, 0x1c, 0xc3, 0xb2, 0xc7, 0xf1, 0x7f, 0x01, 0x10, 0x46, + 0x2a, 0x46, 0xd0, 0xf7, 0xad, 0xfc, 0x65, 0x69, 0xc4, 0xf8, 0x14, 0x80, + 0x00, 0xf0, 0xdc, 0xfc, 0x8a, 0x48, 0x65, 0x61, 0x08, 0x4a, 0x00, 0x21, + 0x48, 0x23, 0x04, 0x68, 0x40, 0xf2, 0x35, 0x70, 0xa0, 0x47, 0x06, 0x48, + 0x00, 0x68, 0xbd, 0xe8, 0xf0, 0x41, 0x00, 0x47, 0xf4, 0xf9, 0x05, 0x00, + 0xe0, 0xfe, 0x00, 0x00, 0x8c, 0x2c, 0x06, 0x00, 0xe4, 0xfe, 0x05, 0x00, + 0x8c, 0x8e, 0x08, 0x00, 0x03, 0x49, 0xb1, 0xf8, 0x3c, 0x11, 0x49, 0x04, + 0x48, 0xbf, 0x00, 0xf0, 0xc3, 0xbc, 0x70, 0x47, 0x8c, 0x7e, 0x08, 0x00, + 0x2d, 0xe9, 0xff, 0x41, 0x15, 0x46, 0x0e, 0x46, 0x80, 0xb3, 0x04, 0x46, + 0xa6, 0xb9, 0x94, 0xf8, 0x74, 0x00, 0xa8, 0x42, 0x10, 0xd0, 0x67, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x66, 0x48, 0x00, 0x68, 0x80, 0x47, + 0xd0, 0xf7, 0x6c, 0xfc, 0x94, 0xf8, 0x35, 0x11, 0x63, 0x4a, 0x01, 0xeb, + 0x41, 0x01, 0x02, 0xeb, 0x41, 0x11, 0x48, 0x65, 0x94, 0xf8, 0x74, 0x00, + 0xa8, 0x42, 0x19, 0xd0, 0x20, 0x46, 0x31, 0x46, 0xd5, 0xf7, 0xc0, 0xfd, + 0x5d, 0x48, 0x31, 0x46, 0x2a, 0x46, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, + 0x94, 0xf8, 0x35, 0x01, 0x94, 0xf8, 0xdd, 0x14, 0x8d, 0xf8, 0x02, 0x60, + 0xad, 0xf8, 0x00, 0x00, 0x48, 0x07, 0x07, 0xd4, 0x00, 0x20, 0x0a, 0xe0, + 0x80, 0x2e, 0x08, 0xbf, 0x00, 0x2d, 0x35, 0xd0, 0xbd, 0xe8, 0xff, 0x81, + 0x52, 0x48, 0x08, 0x22, 0x80, 0x78, 0x02, 0xea, 0x40, 0x00, 0x94, 0xf8, + 0xe2, 0x24, 0x8d, 0xf8, 0x03, 0x00, 0xdf, 0xf8, 0x3c, 0x81, 0x53, 0x07, + 0x51, 0xbf, 0x00, 0x23, 0x4b, 0x4b, 0xdb, 0x79, 0x03, 0xf0, 0x04, 0x03, + 0x94, 0xf8, 0x75, 0x50, 0x94, 0xf8, 0x76, 0x60, 0x18, 0x43, 0x98, 0xf8, + 0xd5, 0x72, 0x73, 0x1b, 0xb3, 0xfa, 0x83, 0xf3, 0x5b, 0x09, 0x40, 0xea, + 0x43, 0x00, 0x45, 0x4b, 0x8d, 0xf8, 0x03, 0x00, 0x1b, 0x78, 0xbb, 0x42, + 0x28, 0xd9, 0x98, 0xf8, 0xd4, 0x32, 0x2b, 0xb3, 0x41, 0x4b, 0x94, 0xf8, + 0xdd, 0xc3, 0x1b, 0x78, 0x8b, 0xb1, 0x00, 0x23, 0xbc, 0xf1, 0x02, 0x0f, + 0x1d, 0xd0, 0xae, 0x42, 0x11, 0xd1, 0x1a, 0xe0, 0x40, 0x4a, 0x42, 0x49, + 0x50, 0x89, 0x0b, 0x88, 0x83, 0x42, 0x4c, 0xd1, 0x92, 0x89, 0x4b, 0x88, + 0x93, 0x42, 0xbf, 0xd0, 0x48, 0xe0, 0x00, 0x23, 0xae, 0x42, 0x0c, 0xd0, + 0xbc, 0xf1, 0x01, 0x0f, 0x09, 0xd1, 0x11, 0x43, 0x49, 0x07, 0x05, 0xd5, + 0xbe, 0x42, 0x03, 0xd9, 0x31, 0x49, 0x09, 0x78, 0x01, 0x29, 0x49, 0xd1, + 0x00, 0x23, 0x18, 0x43, 0x8d, 0xf8, 0x03, 0x00, 0x2f, 0x48, 0x01, 0x68, + 0x20, 0x46, 0x88, 0x47, 0x8d, 0xf8, 0x04, 0x00, 0x94, 0xf8, 0x76, 0x00, + 0x2c, 0x4d, 0x94, 0xf8, 0x74, 0x10, 0x8d, 0xf8, 0x05, 0x00, 0x98, 0xf8, + 0xd5, 0x02, 0x2a, 0x68, 0x8d, 0xf8, 0x07, 0x10, 0x8d, 0xf8, 0x06, 0x00, + 0x00, 0x20, 0x90, 0x47, 0x2a, 0x68, 0x94, 0xf8, 0x74, 0x10, 0x8d, 0xf8, + 0x08, 0x00, 0x01, 0x20, 0x90, 0x47, 0x8d, 0xf8, 0x09, 0x00, 0x22, 0x48, + 0x10, 0xf8, 0x0a, 0x1f, 0x8d, 0xf8, 0x0a, 0x10, 0x94, 0xf8, 0x3a, 0x10, + 0x80, 0x78, 0x8d, 0xf8, 0x0c, 0x10, 0x8d, 0xf8, 0x0b, 0x00, 0x1d, 0x48, + 0x6a, 0x46, 0x00, 0x21, 0x0e, 0x23, 0x04, 0x68, 0x40, 0xf2, 0x3b, 0x20, + 0xa0, 0x47, 0xbd, 0xe8, 0xff, 0x81, 0x92, 0x89, 0x4a, 0x80, 0x08, 0x80, + 0x00, 0x21, 0x02, 0x91, 0xad, 0xf8, 0x0c, 0x10, 0x8d, 0xf8, 0x0a, 0x00, + 0x88, 0x20, 0x00, 0x91, 0x01, 0x91, 0x8d, 0xf8, 0x0b, 0x20, 0x8d, 0xf8, + 0x02, 0x00, 0xe4, 0xe7, 0x0b, 0x49, 0x09, 0x78, 0x4b, 0x1e, 0x18, 0xbf, + 0x01, 0x23, 0xb0, 0xe7, 0x18, 0x9c, 0x08, 0x00, 0x7c, 0xca, 0x08, 0x00, + 0x54, 0xf1, 0x05, 0x00, 0xc8, 0xdc, 0x08, 0x00, 0xa8, 0x52, 0x01, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x6a, 0x34, 0x01, 0x00, 0xe0, 0x0e, 0x01, 0x00, + 0x54, 0x34, 0x01, 0x00, 0x63, 0x34, 0x01, 0x00, 0xcc, 0xdc, 0x08, 0x00, + 0xd4, 0xdc, 0x08, 0x00, 0x5c, 0xca, 0x01, 0x00, 0x78, 0x9b, 0x08, 0x00, + 0x44, 0xd4, 0x05, 0x00, 0xf8, 0xb5, 0x18, 0x4c, 0x18, 0x4d, 0x19, 0x4e, + 0x00, 0x22, 0x20, 0x88, 0x69, 0x8a, 0x23, 0x46, 0x08, 0x1a, 0xe9, 0x8a, + 0x20, 0x80, 0xa0, 0x88, 0x08, 0x1a, 0x69, 0x8b, 0xa0, 0x80, 0x60, 0x88, + 0x08, 0x1a, 0xe9, 0x8b, 0x60, 0x80, 0xe0, 0x88, 0x08, 0x1a, 0x31, 0x88, + 0xe0, 0x80, 0x20, 0x89, 0x08, 0x1a, 0x01, 0x21, 0x20, 0x81, 0x0e, 0x48, + 0x07, 0x68, 0x0a, 0x20, 0x00, 0x90, 0x40, 0xf2, 0x39, 0x60, 0xb8, 0x47, + 0x0b, 0x48, 0x12, 0x21, 0x00, 0x78, 0xd0, 0xf7, 0x6d, 0xfb, 0x68, 0x8a, + 0x20, 0x80, 0xe8, 0x8a, 0xa0, 0x80, 0x68, 0x8b, 0x60, 0x80, 0xe8, 0x8b, + 0xe0, 0x80, 0x30, 0x88, 0x20, 0x81, 0xf8, 0xbd, 0x74, 0xfa, 0x05, 0x00, + 0xc4, 0x79, 0x01, 0x00, 0x7e, 0xfa, 0x05, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0x66, 0x34, 0x01, 0x00, 0xf8, 0xb5, 0x90, 0xf8, 0x02, 0x12, 0x01, 0x29, + 0x88, 0xbf, 0xf8, 0xbd, 0x90, 0xf8, 0x35, 0x21, 0x66, 0x4c, 0x84, 0xf8, + 0x4e, 0x20, 0x66, 0x4a, 0x52, 0xf8, 0x21, 0x50, 0xb5, 0xf8, 0x4c, 0x10, + 0xaa, 0x7f, 0xb5, 0xf8, 0x4e, 0x70, 0xab, 0x6b, 0x2e, 0x6c, 0xa1, 0x85, + 0x95, 0xf8, 0x58, 0x10, 0x84, 0xf8, 0x45, 0x20, 0xaa, 0x69, 0x27, 0x86, + 0x84, 0xf8, 0x4a, 0x10, 0x95, 0xf8, 0x5a, 0x10, 0x84, 0xf8, 0x4c, 0x10, + 0x95, 0xf8, 0x35, 0x10, 0x84, 0xf8, 0x28, 0x10, 0x95, 0xf8, 0x37, 0x10, + 0x84, 0xf8, 0x48, 0x10, 0xa9, 0x79, 0x84, 0xf8, 0x44, 0x10, 0x29, 0x68, + 0xc4, 0xe9, 0x02, 0x31, 0xc4, 0xe9, 0x04, 0x26, 0xb5, 0xf8, 0x50, 0x10, + 0xe1, 0x85, 0xb5, 0xf8, 0x46, 0x10, 0x61, 0x86, 0x95, 0xf8, 0x5b, 0x10, + 0x84, 0xf8, 0x29, 0x10, 0x95, 0xf8, 0x59, 0x10, 0x84, 0xf8, 0x4d, 0x10, + 0xb5, 0xf8, 0x44, 0x10, 0x61, 0x85, 0xa9, 0x88, 0xa1, 0x84, 0xa9, 0x8b, + 0xe1, 0x84, 0x49, 0x49, 0x91, 0xf8, 0xb4, 0x26, 0x91, 0xf8, 0x30, 0x32, + 0x84, 0xf8, 0x52, 0x20, 0x91, 0xf8, 0x2f, 0x22, 0x91, 0xf8, 0x34, 0x12, + 0x84, 0xf8, 0x55, 0x30, 0x84, 0xf8, 0x53, 0x10, 0x95, 0xf8, 0x5d, 0x10, + 0x84, 0xf8, 0x54, 0x20, 0x84, 0xf8, 0x56, 0x10, 0x3f, 0x49, 0x09, 0x78, + 0x01, 0xf0, 0x01, 0x02, 0x84, 0xf8, 0x50, 0x20, 0xc1, 0xf3, 0x40, 0x01, + 0xd0, 0xf8, 0xd4, 0x00, 0x84, 0xf8, 0x51, 0x10, 0xd0, 0xf7, 0x46, 0xff, + 0x20, 0x60, 0x95, 0xf8, 0x36, 0x00, 0x29, 0x7d, 0x95, 0xf8, 0x2b, 0x20, + 0x95, 0xf8, 0x2c, 0x30, 0x84, 0xf8, 0x47, 0x00, 0x95, 0xf8, 0x5e, 0x00, + 0x84, 0xf8, 0x5c, 0x20, 0x84, 0xf8, 0x5a, 0x30, 0x84, 0xf8, 0x59, 0x10, + 0x05, 0xf1, 0x68, 0x02, 0x04, 0xf1, 0x18, 0x03, 0x84, 0xf8, 0x57, 0x00, + 0xe8, 0x7c, 0x84, 0xf8, 0x5b, 0x00, 0xe8, 0x89, 0xa0, 0x87, 0xe8, 0x8c, + 0xe0, 0x87, 0x07, 0xca, 0x07, 0xc3, 0x22, 0x46, 0xb5, 0xf8, 0x74, 0x00, + 0x95, 0xf8, 0x81, 0x10, 0x64, 0x23, 0xe0, 0x86, 0xb5, 0xf8, 0x76, 0x00, + 0x84, 0xf8, 0x5f, 0x10, 0x95, 0xf8, 0x82, 0x10, 0x20, 0x87, 0xb5, 0xf8, + 0x78, 0x00, 0x84, 0xf8, 0x60, 0x10, 0x95, 0xf8, 0x83, 0x10, 0x60, 0x87, + 0x95, 0xf8, 0x7e, 0x00, 0x84, 0xf8, 0x4b, 0x10, 0x95, 0xf8, 0x84, 0x10, + 0x84, 0xf8, 0x58, 0x00, 0x95, 0xf8, 0x7a, 0x00, 0x84, 0xf8, 0x61, 0x10, + 0x95, 0xf8, 0x34, 0x10, 0x84, 0xf8, 0x5d, 0x00, 0x95, 0xf8, 0x7b, 0x00, + 0x84, 0xf8, 0x4f, 0x10, 0x00, 0x21, 0x84, 0xf8, 0x5e, 0x00, 0x28, 0x8a, + 0xa4, 0xf8, 0x40, 0x00, 0x28, 0x8d, 0xa4, 0xf8, 0x42, 0x00, 0xb5, 0xf8, + 0x7c, 0x00, 0xa0, 0x86, 0x95, 0xf8, 0x7f, 0x00, 0x84, 0xf8, 0x49, 0x00, + 0x95, 0xf8, 0x80, 0x00, 0x84, 0xf8, 0x46, 0x00, 0x01, 0x30, 0x85, 0xf8, + 0x80, 0x00, 0x28, 0x6b, 0x60, 0x60, 0xce, 0x48, 0xd0, 0xf8, 0x00, 0xc0, + 0x40, 0xf2, 0x19, 0x60, 0x01, 0xb0, 0xbd, 0xe8, 0xf0, 0x40, 0x60, 0x47, + 0x10, 0x79, 0x01, 0x00, 0x20, 0x72, 0x01, 0x00, 0x38, 0x21, 0x01, 0x00, + 0xf2, 0xda, 0x05, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0x00, 0xf0, 0xb0, 0xfa, + 0xdf, 0xf8, 0x4c, 0x80, 0x00, 0x26, 0x00, 0x27, 0x58, 0xf8, 0x0c, 0x4b, + 0xf5, 0xb2, 0x29, 0x46, 0x20, 0x46, 0x00, 0xf0, 0x23, 0xf8, 0x20, 0x46, + 0x29, 0x46, 0x00, 0xf0, 0x57, 0xf8, 0x20, 0x46, 0x29, 0x46, 0x00, 0xf0, + 0x9b, 0xf8, 0x01, 0x37, 0x01, 0x36, 0x17, 0x2f, 0xec, 0xd1, 0x09, 0x48, + 0x40, 0x88, 0x50, 0xb1, 0x08, 0x48, 0x07, 0x4a, 0x00, 0x21, 0x08, 0x23, + 0xd0, 0xf8, 0x00, 0xc0, 0x40, 0xf2, 0x4f, 0x60, 0xbd, 0xe8, 0xf0, 0x41, + 0x60, 0x47, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, 0xe8, 0x72, 0x01, 0x00, + 0xb6, 0xfc, 0x05, 0x00, 0xa8, 0x8e, 0x08, 0x00, 0x1c, 0xb5, 0x16, 0x29, + 0x32, 0xd8, 0x71, 0x4a, 0x01, 0xeb, 0x41, 0x03, 0x52, 0xf8, 0x23, 0x30, + 0x63, 0xb3, 0x01, 0xeb, 0x41, 0x01, 0x02, 0xeb, 0x81, 0x01, 0x09, 0x79, + 0x04, 0x29, 0x25, 0xd8, 0x01, 0x22, 0x02, 0xfa, 0x01, 0xf1, 0x11, 0xf0, + 0x1a, 0x0f, 0x1f, 0xd0, 0x90, 0xf8, 0x24, 0x11, 0x08, 0x29, 0x1b, 0xd0, + 0x90, 0xf8, 0x24, 0x11, 0xc1, 0xb1, 0xb0, 0xf8, 0x84, 0x10, 0x49, 0x07, + 0x14, 0xd5, 0x90, 0xf8, 0x3a, 0x10, 0x90, 0xf8, 0x35, 0x21, 0x80, 0x8f, + 0x01, 0xab, 0xad, 0xf8, 0x06, 0x00, 0xd4, 0x48, 0x8d, 0xf8, 0x04, 0x20, + 0x8d, 0xf8, 0x05, 0x10, 0x01, 0x21, 0x00, 0x22, 0x04, 0x68, 0x04, 0x20, + 0x00, 0x90, 0x40, 0xf2, 0x47, 0x60, 0xa0, 0x47, 0x1c, 0xbd, 0x00, 0xbf, + 0x7f, 0xb5, 0x22, 0x4a, 0x32, 0xf8, 0x31, 0x30, 0x00, 0x2b, 0x3d, 0xd0, + 0x16, 0x29, 0x17, 0xd8, 0x52, 0x4c, 0x01, 0xeb, 0x41, 0x03, 0x54, 0xf8, + 0x23, 0x50, 0x8d, 0xb1, 0x04, 0xeb, 0x83, 0x03, 0x1b, 0x79, 0x04, 0x2b, + 0x0c, 0xd8, 0x01, 0x24, 0x04, 0xfa, 0x03, 0xf3, 0x13, 0xf0, 0x1a, 0x0f, + 0x06, 0xd0, 0x90, 0xf8, 0x24, 0x31, 0x08, 0x2b, 0x26, 0xd0, 0x90, 0xf8, + 0x24, 0x01, 0x18, 0xb3, 0x02, 0xeb, 0xc1, 0x05, 0x02, 0xac, 0x08, 0x21, + 0x08, 0x23, 0x08, 0x26, 0x20, 0x46, 0x2a, 0x46, 0xd0, 0xf7, 0xe0, 0xf9, + 0x42, 0x48, 0x00, 0x22, 0x23, 0x46, 0x72, 0xb6, 0x01, 0x68, 0x49, 0x00, + 0x01, 0x31, 0x01, 0x60, 0x00, 0x21, 0x29, 0x80, 0x69, 0x80, 0xa9, 0x80, + 0xe9, 0x80, 0x01, 0x68, 0x49, 0x08, 0x01, 0x60, 0x01, 0x21, 0x00, 0x68, + 0x80, 0xf3, 0x10, 0x88, 0xad, 0x48, 0x00, 0x96, 0x05, 0x68, 0x40, 0xf2, + 0x56, 0x60, 0xa8, 0x47, 0x7f, 0xbd, 0x00, 0xbf, 0x80, 0xfa, 0x05, 0x00, + 0x70, 0xb5, 0x86, 0xb0, 0x16, 0x29, 0x39, 0xd8, 0x30, 0x4c, 0x01, 0xeb, + 0x41, 0x02, 0x54, 0xf8, 0x22, 0x30, 0x9b, 0xb3, 0x01, 0xeb, 0x41, 0x02, + 0x04, 0xeb, 0x82, 0x04, 0x24, 0x79, 0xe5, 0x1e, 0x02, 0x2d, 0x03, 0xd3, + 0x05, 0x2c, 0x2b, 0xd0, 0x01, 0x2c, 0x27, 0xd1, 0x29, 0x4c, 0x53, 0x01, + 0xe3, 0x58, 0x1b, 0xb3, 0x90, 0xf8, 0x24, 0x51, 0x08, 0x2d, 0x1f, 0xd0, + 0x90, 0xf8, 0x24, 0x01, 0xe0, 0xb1, 0x04, 0xeb, 0x42, 0x15, 0x01, 0xac, + 0xad, 0xf8, 0x04, 0x10, 0x9a, 0x1c, 0x12, 0x21, 0x12, 0x23, 0xa0, 0x1c, + 0xd0, 0xf7, 0x96, 0xf9, 0x1d, 0x4e, 0x12, 0x21, 0x72, 0xb6, 0x30, 0x68, + 0x40, 0x00, 0x01, 0x30, 0x30, 0x60, 0x28, 0x68, 0x02, 0x30, 0xd2, 0xf7, + 0xd3, 0xff, 0x30, 0x68, 0x40, 0x08, 0x30, 0x60, 0x30, 0x68, 0x80, 0xf3, + 0x10, 0x88, 0x1c, 0xe0, 0x06, 0xb0, 0x70, 0xbd, 0x03, 0xf5, 0xdd, 0x75, + 0x01, 0xac, 0xad, 0xf8, 0x04, 0x10, 0x12, 0x21, 0x12, 0x23, 0xa0, 0x1c, + 0x2a, 0x46, 0xd0, 0xf7, 0x77, 0xf9, 0x0e, 0x4e, 0x12, 0x21, 0x72, 0xb6, + 0x30, 0x68, 0x40, 0x00, 0x01, 0x30, 0x30, 0x60, 0x28, 0x46, 0xd2, 0xf7, + 0xb5, 0xff, 0x30, 0x68, 0x40, 0x08, 0x30, 0x60, 0x30, 0x68, 0x80, 0xf3, + 0x10, 0x88, 0x7b, 0x48, 0x01, 0x21, 0x00, 0x22, 0x23, 0x46, 0x05, 0x68, + 0x14, 0x20, 0x00, 0x90, 0x4f, 0xf4, 0xc9, 0x60, 0xa8, 0x47, 0xd7, 0xe7, + 0xe8, 0x72, 0x01, 0x00, 0x24, 0x36, 0x01, 0x00, 0x54, 0xf1, 0x05, 0x00, + 0xbf, 0xb5, 0x04, 0x46, 0x04, 0x29, 0x4f, 0xf0, 0x04, 0x05, 0x4f, 0xf0, + 0x04, 0x00, 0x38, 0xbf, 0x0d, 0x46, 0xcc, 0xb3, 0x04, 0xeb, 0xc5, 0x00, + 0x90, 0xf8, 0xbc, 0x03, 0x98, 0x42, 0x55, 0xd0, 0x94, 0xf8, 0x35, 0x01, + 0x8d, 0xf8, 0x06, 0x20, 0x8d, 0xf8, 0x08, 0x50, 0xad, 0xf8, 0x04, 0x00, + 0x27, 0x48, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x26, 0x49, 0x00, 0x28, + 0x18, 0xbf, 0x01, 0x20, 0x0a, 0x23, 0x4a, 0x7a, 0x62, 0xf3, 0x82, 0x00, + 0x94, 0xf8, 0x4e, 0x23, 0x8d, 0xf8, 0x07, 0x00, 0x92, 0x07, 0x51, 0xbf, + 0x00, 0x22, 0x20, 0x4a, 0x12, 0x79, 0x02, 0xf0, 0x02, 0x02, 0x10, 0x43, + 0x04, 0x2d, 0x8d, 0xf8, 0x07, 0x00, 0xa8, 0xbf, 0x04, 0x25, 0x48, 0x19, + 0x01, 0xaa, 0x00, 0x21, 0x80, 0x7a, 0x8d, 0xf8, 0x09, 0x00, 0x04, 0xeb, + 0xc5, 0x00, 0x90, 0xf8, 0xbc, 0x03, 0x8d, 0xf8, 0x0a, 0x00, 0x16, 0x48, + 0x04, 0x68, 0x1e, 0xe0, 0x4f, 0xf6, 0xff, 0x71, 0x8d, 0xf8, 0x06, 0x20, + 0x8d, 0xf8, 0x0a, 0x30, 0x8d, 0xf8, 0x08, 0x50, 0x04, 0x2d, 0x01, 0xab, + 0xad, 0xf8, 0x04, 0x10, 0x0c, 0x49, 0x11, 0xf8, 0x09, 0x2f, 0x00, 0xea, + 0x82, 0x02, 0x8d, 0xf8, 0x07, 0x20, 0xb8, 0xbf, 0x28, 0x46, 0x00, 0x22, + 0x08, 0x44, 0x01, 0x21, 0x40, 0x78, 0x8d, 0xf8, 0x09, 0x00, 0x43, 0x48, + 0x04, 0x68, 0x0a, 0x20, 0x00, 0x90, 0x40, 0xf2, 0xfb, 0x20, 0xa0, 0x47, + 0xbf, 0xbd, 0x00, 0xbf, 0xe8, 0xc7, 0x08, 0x00, 0xcc, 0x2c, 0x06, 0x00, + 0x70, 0x52, 0x01, 0x00, 0x78, 0x9b, 0x08, 0x00, 0x10, 0xb5, 0x04, 0x46, + 0x00, 0xf0, 0x28, 0xf9, 0x00, 0xb1, 0x10, 0xbd, 0x0a, 0x48, 0x90, 0xf9, + 0x3c, 0x01, 0xb0, 0xf1, 0xff, 0x3f, 0xc4, 0xbf, 0x00, 0x20, 0x10, 0xbd, + 0xb4, 0xf8, 0x8e, 0x00, 0x07, 0x49, 0x01, 0x38, 0xa4, 0xf8, 0x8e, 0x00, + 0x04, 0x4c, 0x20, 0x68, 0xd2, 0xf7, 0x8c, 0xfa, 0x20, 0x60, 0x01, 0x20, + 0x10, 0xbd, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, 0x34, 0x5e, 0x01, 0x00, + 0x00, 0x00, 0x80, 0xbf, 0x10, 0xb5, 0x88, 0xb0, 0x07, 0x91, 0x90, 0xf8, + 0x44, 0x10, 0x8d, 0xf8, 0x04, 0x10, 0xd0, 0xf8, 0x40, 0x12, 0x02, 0x91, + 0x90, 0xf8, 0xb0, 0x11, 0x8d, 0xf8, 0x05, 0x10, 0x90, 0xf8, 0xb2, 0x11, + 0x8d, 0xf8, 0x06, 0x10, 0x90, 0xf8, 0xb1, 0x11, 0x8d, 0xf8, 0x07, 0x10, + 0xd0, 0xf8, 0x34, 0x12, 0x04, 0x91, 0xd0, 0xe9, 0x93, 0x12, 0xcd, 0xe9, + 0x05, 0x21, 0xd0, 0xf8, 0xac, 0x01, 0xd9, 0xf7, 0x09, 0xfd, 0x03, 0x90, + 0x18, 0x48, 0x01, 0xab, 0x01, 0x21, 0x00, 0x22, 0x04, 0x68, 0x1c, 0x20, + 0x00, 0x90, 0x40, 0xf2, 0x4d, 0x60, 0xa0, 0x47, 0x03, 0x48, 0x12, 0x21, + 0x00, 0x78, 0xd0, 0xf7, 0x99, 0xf8, 0x08, 0xb0, 0x10, 0xbd, 0x00, 0xbf, + 0x66, 0x34, 0x01, 0x00, 0xb0, 0xb5, 0x9a, 0xb0, 0x04, 0x46, 0x00, 0xf0, + 0xd5, 0xf8, 0x01, 0xad, 0x04, 0xf1, 0x78, 0x02, 0x54, 0x21, 0x54, 0x23, + 0x28, 0x46, 0xd0, 0xf7, 0x81, 0xf8, 0x04, 0xf5, 0x15, 0x73, 0x16, 0xac, + 0x0f, 0xcb, 0x0f, 0xc4, 0x05, 0x48, 0x01, 0x21, 0x00, 0x22, 0x2b, 0x46, + 0x04, 0x68, 0x64, 0x20, 0x00, 0x90, 0x40, 0xf2, 0xfd, 0x60, 0xa0, 0x47, + 0x1a, 0xb0, 0xb0, 0xbd, 0xa0, 0xa0, 0x08, 0x00, 0xb0, 0xb5, 0x04, 0x46, + 0x88, 0xb3, 0xd4, 0xf8, 0xd4, 0x00, 0x70, 0xb3, 0x01, 0x7f, 0x04, 0x29, + 0x2b, 0xd8, 0x18, 0x4a, 0x52, 0xf8, 0x21, 0x10, 0x88, 0x42, 0x26, 0xd1, + 0x90, 0xf8, 0xe6, 0x10, 0x29, 0xb9, 0x90, 0xf8, 0xe7, 0x10, 0x11, 0xb9, + 0x90, 0xf8, 0xe8, 0x00, 0xe8, 0xb1, 0x94, 0xf8, 0xa4, 0x04, 0x41, 0x07, + 0x19, 0xd5, 0x00, 0x07, 0x17, 0xd4, 0x0f, 0x48, 0x00, 0x68, 0x41, 0x1c, + 0x13, 0xd0, 0xd4, 0xf8, 0xdc, 0x10, 0x08, 0x1a, 0xd4, 0xf8, 0xa0, 0x14, + 0x20, 0xf0, 0x70, 0x40, 0x88, 0x42, 0x0a, 0xd9, 0x09, 0x4d, 0x4f, 0xf0, + 0x7e, 0x51, 0x28, 0x68, 0xd2, 0xf7, 0xfc, 0xf9, 0x28, 0x60, 0x07, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, + 0x00, 0xf0, 0x86, 0xb8, 0xfc, 0x73, 0x01, 0x00, 0xbc, 0x11, 0x01, 0x00, + 0x6c, 0xf0, 0x05, 0x00, 0x2c, 0xe5, 0x08, 0x00, 0x80, 0xb5, 0x00, 0xf0, + 0x81, 0xf8, 0x03, 0x48, 0x4f, 0x30, 0xbd, 0xe8, 0x80, 0x40, 0xf5, 0xf7, + 0xe9, 0xbe, 0x00, 0xbf, 0x20, 0x78, 0x01, 0x00, 0x10, 0x48, 0x11, 0x49, + 0x01, 0x60, 0x11, 0x48, 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, 0x12, 0x49, + 0x01, 0x60, 0x12, 0x48, 0x12, 0x49, 0x01, 0x60, 0x12, 0x48, 0x13, 0x49, + 0x01, 0x60, 0x13, 0x48, 0x13, 0x49, 0x01, 0x60, 0x13, 0x48, 0x14, 0x49, + 0x01, 0x60, 0x14, 0x48, 0x14, 0x49, 0x01, 0x60, 0x14, 0x48, 0x15, 0x49, + 0x01, 0x60, 0x15, 0x48, 0x15, 0x49, 0x01, 0x60, 0x15, 0x48, 0x16, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x9c, 0xc3, 0x08, 0x00, 0x25, 0x02, 0x05, 0x00, + 0x48, 0x9c, 0x08, 0x00, 0x15, 0x07, 0x05, 0x00, 0x28, 0xe3, 0x08, 0x00, + 0x69, 0x04, 0x05, 0x00, 0x3c, 0xc5, 0x08, 0x00, 0x7d, 0x06, 0x05, 0x00, + 0x90, 0xc3, 0x08, 0x00, 0x01, 0x07, 0x05, 0x00, 0x38, 0xc8, 0x08, 0x00, + 0x7d, 0x09, 0x05, 0x00, 0x8c, 0xca, 0x08, 0x00, 0x39, 0x0b, 0x05, 0x00, + 0x9c, 0xa2, 0x08, 0x00, 0x55, 0x0e, 0x05, 0x00, 0x94, 0xc3, 0x08, 0x00, + 0x05, 0x0f, 0x05, 0x00, 0xec, 0xe3, 0x08, 0x00, 0x45, 0x0f, 0x05, 0x00, + 0x84, 0xe7, 0x08, 0x00, 0xc9, 0x0f, 0x05, 0x00, 0x4b, 0xf2, 0x99, 0x7c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf2, 0xd7, 0x1c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf6, 0x3d, 0x1c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf2, 0xad, 0x7c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf6, 0x03, 0x4c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf6, 0x53, 0x0c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf6, 0xdf, 0x6c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf2, 0x39, 0x5c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x40, 0xb1, 0xc1, 0x78, + 0x20, 0x29, 0x01, 0xd0, 0x10, 0x29, 0x01, 0xd1, 0x00, 0x21, 0x41, 0x71, + 0xd5, 0xf7, 0xca, 0xbd, 0x70, 0x47, 0x00, 0xbf, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x30, 0x9c, 0x08, 0x00, 0xdd, 0x10, 0x05, 0x00, + 0x04, 0x28, 0x18, 0xbf, 0x00, 0xf0, 0xfa, 0xb8, 0x00, 0x20, 0x70, 0x47, + 0x2d, 0xe9, 0xf8, 0x4f, 0xdf, 0xf8, 0x84, 0x90, 0xdf, 0xf8, 0x84, 0xa0, + 0x83, 0x46, 0x00, 0x26, 0x00, 0x25, 0x00, 0x24, 0xcd, 0xf8, 0x00, 0xe0, + 0x59, 0xf8, 0x24, 0x00, 0xa8, 0xb1, 0x01, 0x89, 0x59, 0x45, 0x0e, 0xd3, + 0x0a, 0xeb, 0x84, 0x08, 0x00, 0x2d, 0x08, 0xbf, 0x27, 0x46, 0x98, 0xf8, + 0x6c, 0x14, 0x01, 0xf0, 0x01, 0x01, 0xd4, 0xf7, 0xb5, 0xf8, 0x00, 0x2d, + 0x08, 0xbf, 0x01, 0x25, 0x30, 0xb9, 0x01, 0x34, 0x10, 0x36, 0x10, 0x2c, + 0xe6, 0xd1, 0x00, 0x20, 0xbd, 0xe8, 0xf8, 0x8f, 0x98, 0xf8, 0x6c, 0x14, + 0x09, 0x07, 0x05, 0xd5, 0x50, 0xf8, 0x08, 0x1c, 0x00, 0x9a, 0x09, 0x89, + 0x01, 0x44, 0x4a, 0x60, 0xf9, 0xb2, 0x8c, 0x42, 0xf0, 0xd0, 0x01, 0xf0, + 0x0f, 0x01, 0x0a, 0x4c, 0x41, 0xea, 0x06, 0x02, 0x07, 0x49, 0x0b, 0x78, + 0xe2, 0x54, 0x5a, 0x1c, 0x0a, 0x70, 0xd2, 0xb2, 0x32, 0x2a, 0xe3, 0xd3, + 0x00, 0x22, 0x0a, 0x70, 0xbd, 0xe8, 0xf8, 0x8f, 0x28, 0x8a, 0x01, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x5c, 0xfb, 0x05, 0x00, 0x5d, 0xfb, 0x05, 0x00, + 0xb0, 0xb5, 0x20, 0x4d, 0x04, 0x46, 0x01, 0x88, 0x28, 0x68, 0x88, 0x42, + 0x06, 0xd2, 0x00, 0x20, 0xa4, 0x21, 0xd5, 0xf7, 0x7f, 0xfd, 0x20, 0x88, + 0x01, 0x46, 0x28, 0x60, 0x40, 0x1a, 0x28, 0x60, 0x20, 0x46, 0xbd, 0xe8, + 0xb0, 0x40, 0xf2, 0xf7, 0xcd, 0xb9, 0x00, 0xbf, 0xb0, 0xb5, 0x15, 0x4d, + 0x04, 0x46, 0x01, 0x88, 0x28, 0x68, 0x88, 0x42, 0x06, 0xd2, 0x00, 0x20, + 0xb5, 0x21, 0xd5, 0xf7, 0x69, 0xfd, 0x20, 0x88, 0x01, 0x46, 0x28, 0x60, + 0x40, 0x1a, 0x28, 0x60, 0x20, 0x46, 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, + 0x85, 0xb8, 0x00, 0xbf, 0xb0, 0xb5, 0x0b, 0x4b, 0x09, 0x4d, 0x14, 0x46, + 0x2a, 0x68, 0xd3, 0xf8, 0xc4, 0x30, 0x9a, 0x1a, 0xa2, 0x42, 0x08, 0xd3, + 0x22, 0x46, 0x00, 0xf0, 0x7d, 0xf8, 0x20, 0xb1, 0x28, 0x68, 0x20, 0x44, + 0x28, 0x60, 0x01, 0x20, 0xb0, 0xbd, 0x00, 0x20, 0xb0, 0xbd, 0x00, 0xbf, + 0x08, 0xf0, 0x05, 0x00, 0xd0, 0x32, 0x06, 0x00, 0xf8, 0xb5, 0x16, 0x4e, + 0x74, 0x46, 0xb6, 0x45, 0x05, 0xd1, 0x15, 0x48, 0x00, 0x78, 0x05, 0x28, + 0x01, 0xd1, 0x00, 0x25, 0x1a, 0xe0, 0x13, 0x48, 0x13, 0x4f, 0x90, 0xf8, + 0xc4, 0x14, 0x07, 0xf1, 0x60, 0x00, 0x01, 0xf0, 0x01, 0x01, 0xd4, 0xf7, + 0x29, 0xf8, 0x05, 0x46, 0x30, 0xb9, 0x0f, 0x49, 0xb7, 0xf8, 0x68, 0x00, + 0x09, 0x68, 0x88, 0x47, 0x05, 0x46, 0x48, 0xb1, 0x08, 0x48, 0x01, 0x78, + 0x04, 0x29, 0x03, 0xd8, 0xb4, 0x42, 0x04, 0xbf, 0x01, 0x31, 0x01, 0x70, + 0x28, 0x46, 0xf8, 0xbd, 0x00, 0x20, 0xf0, 0x21, 0x00, 0x25, 0xd5, 0xf7, + 0x17, 0xfd, 0xf7, 0xe7, 0x0b, 0xec, 0x08, 0x10, 0x52, 0xf1, 0x05, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x68, 0x8a, 0x01, 0x00, 0x4c, 0x9c, 0x08, 0x00, + 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x0a, 0x48, 0x0a, 0x49, 0x01, 0x60, + 0x0a, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0b, 0x49, 0x01, 0x60, + 0x0b, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, 0x0c, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0xd4, 0x9b, 0x08, 0x00, 0x11, 0x11, 0x05, 0x00, + 0xd0, 0xdb, 0x08, 0x00, 0x05, 0x11, 0x05, 0x00, 0x8c, 0xec, 0x08, 0x00, + 0xad, 0x11, 0x05, 0x00, 0xac, 0xec, 0x08, 0x00, 0xd9, 0x11, 0x05, 0x00, + 0xb0, 0xec, 0x08, 0x00, 0x05, 0x12, 0x05, 0x00, 0xe8, 0xb9, 0x08, 0x00, + 0x39, 0x12, 0x05, 0x00, 0x46, 0xf6, 0x69, 0x2c, 0xc1, 0xf2, 0x10, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x46, 0xf6, 0xa7, 0x2c, 0xc1, 0xf2, 0x10, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x46, 0xf6, 0xc3, 0x2c, 0xc1, 0xf2, 0x10, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x88, 0xb3, 0xf0, 0xb5, 0x89, 0xb0, 0x02, 0xac, + 0x0e, 0x46, 0x05, 0x46, 0x1c, 0x21, 0x1c, 0x27, 0x20, 0x46, 0xd2, 0xf7, + 0x07, 0xf8, 0x95, 0xf8, 0x35, 0x11, 0x68, 0x78, 0x05, 0xf5, 0x01, 0x72, + 0x10, 0x23, 0x8d, 0xf8, 0x10, 0x60, 0x8d, 0xf8, 0x08, 0x10, 0x95, 0xf8, + 0x5c, 0x12, 0x8d, 0xf8, 0x11, 0x00, 0x04, 0xf1, 0x0c, 0x00, 0x8d, 0xf8, + 0x09, 0x10, 0x95, 0xf8, 0x5d, 0x12, 0x8d, 0xf8, 0x0a, 0x10, 0xd5, 0xf8, + 0x58, 0x12, 0x03, 0x91, 0x10, 0x21, 0xcf, 0xf7, 0x57, 0xfe, 0x06, 0x48, + 0x01, 0x21, 0x00, 0x22, 0x23, 0x46, 0x00, 0x97, 0x05, 0x68, 0x40, 0xf2, + 0x31, 0x60, 0xa8, 0x47, 0x09, 0xb0, 0xbd, 0xe8, 0xf0, 0x40, 0x70, 0x47, + 0xa0, 0xa0, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x6c, 0xea, 0x08, 0x00, 0x25, 0x13, 0x05, 0x00, 0x10, 0xb5, 0x04, 0x46, + 0x5a, 0x48, 0x90, 0xf8, 0x48, 0x15, 0x5a, 0x48, 0x00, 0xf5, 0x1c, 0x70, + 0x01, 0xf0, 0x01, 0x01, 0xd3, 0xf7, 0x7e, 0xff, 0x38, 0xb1, 0x01, 0x21, + 0x01, 0x71, 0x0e, 0x21, 0x41, 0x70, 0xd2, 0x21, 0x01, 0x70, 0x05, 0x21, + 0x21, 0x80, 0x10, 0xbd, 0x70, 0xb1, 0x80, 0xb5, 0x81, 0x70, 0x09, 0x0a, + 0xc1, 0x70, 0x06, 0x49, 0x18, 0x31, 0xd1, 0xf7, 0xf7, 0xff, 0x05, 0x48, + 0x15, 0x21, 0x00, 0x78, 0xbd, 0xe8, 0x80, 0x40, 0xcf, 0xf7, 0x20, 0xbe, + 0x70, 0x47, 0x00, 0xbf, 0x2c, 0xba, 0x01, 0x00, 0x66, 0x34, 0x01, 0x00, + 0x2d, 0xe9, 0xf8, 0x4f, 0xdf, 0xf8, 0x10, 0x91, 0x44, 0x49, 0x05, 0x46, + 0x99, 0xf8, 0xb0, 0x04, 0x01, 0xf1, 0x10, 0x06, 0x00, 0xf0, 0x01, 0x01, + 0x30, 0x46, 0xd3, 0xf7, 0x4f, 0xff, 0x00, 0x28, 0x5c, 0xd0, 0xdf, 0xf8, + 0xfc, 0xa0, 0x04, 0x46, 0x4f, 0xf0, 0x00, 0x0b, 0x4f, 0xf0, 0x00, 0x08, + 0x00, 0x27, 0x9a, 0xf8, 0x0b, 0x00, 0x10, 0xf0, 0x02, 0x00, 0x4f, 0xf0, + 0x01, 0x00, 0x08, 0xbf, 0x04, 0x20, 0xe0, 0x70, 0x6f, 0xf0, 0x2d, 0x00, + 0x08, 0xbf, 0x0c, 0x20, 0xa0, 0x70, 0x28, 0x88, 0x90, 0xb1, 0xf8, 0xb2, + 0x40, 0x00, 0x50, 0xfa, 0x87, 0xf0, 0x01, 0x37, 0x04, 0xeb, 0x40, 0x00, + 0x80, 0xf8, 0x05, 0xb0, 0x29, 0x78, 0x81, 0x71, 0x69, 0x78, 0xc1, 0x71, + 0xa9, 0x78, 0x01, 0x72, 0xe9, 0x78, 0x41, 0x72, 0x29, 0x79, 0x81, 0x72, + 0xf8, 0xb2, 0x29, 0x28, 0x24, 0xd3, 0x29, 0x48, 0xff, 0x21, 0x27, 0x71, + 0x03, 0x68, 0x07, 0xeb, 0x47, 0x00, 0x40, 0x00, 0x01, 0x30, 0x02, 0x30, + 0xc2, 0xb2, 0x20, 0x46, 0x98, 0x47, 0x20, 0x46, 0xd5, 0xf7, 0xf8, 0xfb, + 0x99, 0xf8, 0xb0, 0x04, 0x00, 0xf0, 0x01, 0x01, 0x30, 0x46, 0xd3, 0xf7, + 0x09, 0xff, 0x29, 0x3f, 0xc0, 0xb1, 0x04, 0x46, 0x9a, 0xf8, 0x0b, 0x00, + 0x80, 0x07, 0x03, 0xd4, 0x04, 0x20, 0xe0, 0x70, 0x0c, 0x20, 0x02, 0xe0, + 0x01, 0x20, 0xe0, 0x70, 0xd2, 0x20, 0xa0, 0x70, 0x08, 0xf1, 0x01, 0x08, + 0x06, 0x35, 0x0b, 0xf1, 0x01, 0x0b, 0xb8, 0xf1, 0x4f, 0x0f, 0xba, 0xd1, + 0x00, 0x25, 0x03, 0xe0, 0x07, 0x25, 0x18, 0xe0, 0x00, 0x24, 0x07, 0x25, + 0x38, 0x06, 0x10, 0xd0, 0x9c, 0xb1, 0x0e, 0x48, 0xff, 0x21, 0x27, 0x71, + 0x03, 0x68, 0x07, 0xeb, 0x47, 0x00, 0x40, 0x00, 0x01, 0x30, 0x02, 0x30, + 0xc2, 0xb2, 0x20, 0x46, 0x98, 0x47, 0x20, 0x46, 0xd5, 0xf7, 0xc2, 0xfb, + 0x03, 0xe0, 0x14, 0xb1, 0x20, 0x46, 0xd5, 0xf7, 0xf9, 0xfb, 0x28, 0x46, + 0xbd, 0xe8, 0xf8, 0x8f, 0x8c, 0x7e, 0x08, 0x00, 0x68, 0x8a, 0x01, 0x00, + 0x90, 0xfb, 0x05, 0x00, 0x04, 0xb8, 0x08, 0x00, 0x10, 0xb5, 0x6d, 0x4c, + 0xe1, 0x7a, 0xc9, 0x07, 0x03, 0xd1, 0x01, 0x28, 0x0a, 0xd0, 0x12, 0x21, + 0x2d, 0xe0, 0x41, 0x1e, 0x18, 0xbf, 0x12, 0x21, 0xa2, 0x7a, 0x82, 0x42, + 0x14, 0xbf, 0x0c, 0x21, 0x01, 0x28, 0x24, 0xd1, 0xa0, 0x72, 0x20, 0x68, + 0x30, 0xb9, 0x12, 0x48, 0x01, 0x68, 0x4f, 0xf4, 0xed, 0x70, 0x88, 0x47, + 0x20, 0x60, 0xc8, 0xb1, 0x60, 0x68, 0x28, 0xb1, 0xe0, 0x7a, 0x00, 0x21, + 0x40, 0xf0, 0x01, 0x00, 0xe0, 0x72, 0x12, 0xe0, 0xe0, 0x7a, 0x81, 0x07, + 0x07, 0xd5, 0x04, 0xf1, 0x08, 0x00, 0xff, 0xf7, 0x15, 0xff, 0x00, 0x28, + 0x60, 0x60, 0xef, 0xd1, 0xe0, 0x7a, 0x80, 0x07, 0xec, 0xd5, 0x20, 0x68, + 0xd5, 0xf7, 0xba, 0xfb, 0x00, 0x20, 0x20, 0x60, 0x07, 0x21, 0xc8, 0xb2, + 0x10, 0xbd, 0x00, 0xbf, 0x4c, 0x9c, 0x08, 0x00, 0xb0, 0xb5, 0x4f, 0x4c, + 0xe0, 0x7a, 0xc1, 0x07, 0x04, 0xbf, 0x00, 0x20, 0xb0, 0xbd, 0x00, 0xf0, + 0xfe, 0x01, 0x80, 0x07, 0xe1, 0x72, 0x15, 0xd5, 0x14, 0x4d, 0x72, 0xb6, + 0x28, 0x68, 0x40, 0x00, 0x01, 0x30, 0x28, 0x60, 0x20, 0x89, 0x01, 0x1f, + 0x08, 0x04, 0x05, 0xd0, 0x60, 0x68, 0x89, 0xb2, 0xff, 0xf7, 0x00, 0xff, + 0x00, 0x20, 0x60, 0x60, 0x28, 0x68, 0x40, 0x08, 0x28, 0x60, 0x28, 0x68, + 0x80, 0xf3, 0x10, 0x88, 0x20, 0x68, 0xff, 0xf7, 0x0b, 0xff, 0x08, 0x4d, + 0x04, 0x46, 0x72, 0xb6, 0x28, 0x68, 0x40, 0x00, 0x01, 0x30, 0x28, 0x60, + 0x00, 0xf0, 0x0a, 0xf8, 0x28, 0x68, 0x40, 0x08, 0x28, 0x60, 0x28, 0x68, + 0x80, 0xf3, 0x10, 0x88, 0x20, 0x46, 0xb0, 0xbd, 0x24, 0x36, 0x01, 0x00, + 0x10, 0xb5, 0x33, 0x4c, 0x60, 0x68, 0x08, 0xb1, 0xd5, 0xf7, 0x74, 0xfb, + 0x20, 0x68, 0x08, 0xb1, 0xd5, 0xf7, 0x70, 0xfb, 0x00, 0x20, 0xc4, 0xe9, + 0x00, 0x00, 0xa0, 0x60, 0x10, 0xbd, 0x00, 0xbf, 0xf8, 0xb5, 0x2b, 0x4c, + 0xe2, 0x7a, 0xd3, 0x07, 0x50, 0xd0, 0x4e, 0x28, 0x4e, 0xd8, 0x23, 0x68, + 0x83, 0xb3, 0x00, 0xeb, 0x40, 0x06, 0x4f, 0xf6, 0xff, 0x77, 0x33, 0xf8, + 0x16, 0x50, 0xbd, 0x42, 0x28, 0xd0, 0x03, 0xeb, 0x46, 0x06, 0x4d, 0xb9, + 0x01, 0x25, 0x35, 0x80, 0x00, 0xeb, 0x40, 0x05, 0x03, 0xeb, 0x45, 0x03, + 0x19, 0x71, 0xd9, 0x70, 0x99, 0x70, 0x1b, 0xe0, 0x01, 0x35, 0x35, 0x80, + 0x00, 0xeb, 0x40, 0x06, 0xad, 0xb2, 0x03, 0xeb, 0x46, 0x03, 0x1e, 0x46, + 0x16, 0xf9, 0x02, 0x7f, 0x8f, 0x42, 0xb8, 0xbf, 0x31, 0x70, 0x1e, 0x46, + 0x16, 0xf9, 0x03, 0x7f, 0x8f, 0x42, 0xc8, 0xbf, 0x31, 0x70, 0x93, 0xf9, + 0x04, 0x60, 0x96, 0xfb, 0xf5, 0xf7, 0x91, 0xfb, 0xf5, 0xf5, 0xf6, 0x1b, + 0x35, 0x44, 0x1d, 0x71, 0x92, 0x07, 0x19, 0xd5, 0x62, 0x68, 0xba, 0xb1, + 0x23, 0x89, 0x5d, 0x1c, 0x25, 0x81, 0xd0, 0x54, 0x20, 0x89, 0x42, 0x1c, + 0x22, 0x81, 0x62, 0x68, 0x11, 0x54, 0x40, 0xf2, 0x9a, 0x30, 0x21, 0x89, + 0x81, 0x42, 0x09, 0xd3, 0x04, 0x39, 0x60, 0x68, 0x89, 0xb2, 0xff, 0xf7, + 0x81, 0xfe, 0x04, 0xf1, 0x08, 0x00, 0xff, 0xf7, 0x67, 0xfe, 0x60, 0x60, + 0xf8, 0xbd, 0x00, 0xbf, 0x90, 0xfb, 0x05, 0x00, 0xb0, 0xb5, 0x68, 0xb1, + 0x0d, 0x46, 0x59, 0xb1, 0x29, 0x46, 0x04, 0x46, 0x00, 0xf0, 0x2e, 0xf8, + 0x28, 0x68, 0x00, 0xb3, 0x90, 0xf8, 0xb0, 0x15, 0x01, 0x29, 0x07, 0xd1, + 0x03, 0x21, 0x0a, 0xe0, 0x00, 0x20, 0x34, 0x21, 0xbd, 0xe8, 0xb0, 0x40, + 0xd5, 0xf7, 0xdc, 0xba, 0x00, 0x78, 0x01, 0x38, 0xb0, 0xfa, 0x80, 0xf0, + 0x41, 0x09, 0x08, 0x4a, 0x94, 0xf8, 0x40, 0x00, 0x12, 0x68, 0x90, 0x47, + 0x29, 0x68, 0x84, 0xf8, 0x40, 0x00, 0x94, 0xf8, 0x42, 0x00, 0x91, 0xf8, + 0x74, 0x10, 0x40, 0xea, 0x01, 0x10, 0x84, 0xf8, 0x42, 0x00, 0xb0, 0xbd, + 0x34, 0x9c, 0x08, 0x00, 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x10, 0xeb, 0x08, 0x00, 0xdd, 0x16, 0x05, 0x00, 0x4f, 0xf6, 0xbb, 0x2c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x2d, 0xe9, 0xf0, 0x41, + 0x29, 0xb3, 0x20, 0xb3, 0x03, 0x78, 0x44, 0x78, 0x11, 0x2b, 0x04, 0xd0, + 0x09, 0x2b, 0x04, 0xd1, 0x01, 0x2c, 0x02, 0xd8, 0x1d, 0xe0, 0x04, 0x2c, + 0x1b, 0xd3, 0x16, 0x2c, 0x19, 0xd2, 0x02, 0x39, 0x54, 0x70, 0xb1, 0xfb, + 0xf4, 0xf1, 0x5f, 0xfa, 0x81, 0xf8, 0x11, 0x70, 0xb8, 0xf1, 0x00, 0x0f, + 0x0d, 0xd0, 0xd5, 0x1c, 0x86, 0x1c, 0x00, 0x27, 0x28, 0x46, 0x21, 0x46, + 0x32, 0x46, 0x23, 0x46, 0xcf, 0xf7, 0x42, 0xfc, 0x01, 0x37, 0x26, 0x44, + 0x16, 0x35, 0x47, 0x45, 0xf4, 0xd3, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0x20, + 0x10, 0x70, 0xbd, 0xe8, 0xf0, 0x81, 0xff, 0xf7, 0xcf, 0xbf, 0xff, 0xf7, + 0xfc, 0xbf, 0x00, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0xc7, 0xb0, 0xcf, 0x4e, + 0x0f, 0x46, 0x04, 0xad, 0x10, 0x46, 0x2a, 0x46, 0x31, 0x68, 0x46, 0x91, + 0x19, 0x46, 0xff, 0xf7, 0xee, 0xff, 0x9d, 0xf8, 0x10, 0x00, 0x00, 0x22, + 0x00, 0x28, 0x50, 0xd0, 0x02, 0x97, 0x73, 0x4f, 0x04, 0x35, 0x00, 0x26, + 0x4f, 0xf0, 0x16, 0x0b, 0x4f, 0xf0, 0x02, 0x08, 0x39, 0x78, 0xca, 0xb2, + 0x2c, 0x78, 0x15, 0xf8, 0x01, 0x3c, 0x95, 0xf8, 0x01, 0x90, 0x95, 0xf8, + 0x02, 0xa0, 0x12, 0xfb, 0x0b, 0x72, 0x14, 0x75, 0x9d, 0xf8, 0x11, 0x40, + 0xd3, 0x74, 0x53, 0x1c, 0x82, 0xf8, 0x16, 0xa0, 0x82, 0xf8, 0x15, 0x90, + 0x07, 0x2c, 0x0b, 0xd3, 0x10, 0x20, 0x10, 0x21, 0x18, 0x70, 0x90, 0x1c, + 0xea, 0x1c, 0x10, 0x23, 0xcf, 0xf7, 0xfa, 0xfb, 0x39, 0x78, 0x9d, 0xf8, + 0x10, 0x00, 0x05, 0xe0, 0x83, 0xf8, 0x00, 0x80, 0xeb, 0x78, 0x2c, 0x79, + 0xd4, 0x70, 0x93, 0x70, 0x01, 0x36, 0x01, 0x31, 0x16, 0x35, 0x86, 0x42, + 0x39, 0x70, 0xd2, 0xd3, 0x49, 0xea, 0x0a, 0x20, 0x4f, 0xf6, 0xff, 0x72, + 0xaa, 0x4e, 0x02, 0x9f, 0x81, 0xb2, 0x91, 0x42, 0x4f, 0xf0, 0x00, 0x02, + 0x10, 0xd1, 0x00, 0x20, 0x0d, 0xf2, 0x01, 0x11, 0x8d, 0xf8, 0x01, 0x01, + 0xa8, 0x48, 0x02, 0x68, 0x38, 0x46, 0x90, 0x47, 0x1a, 0x48, 0x4e, 0x49, + 0x02, 0x68, 0x9d, 0xf8, 0x01, 0x01, 0x90, 0x47, 0x25, 0xe0, 0x00, 0x20, + 0x28, 0x21, 0x01, 0x30, 0x8d, 0xf8, 0x0f, 0x20, 0x3c, 0xaa, 0x0d, 0xf2, + 0x01, 0x13, 0x8d, 0xf8, 0xf2, 0x10, 0x02, 0x21, 0x80, 0xb2, 0xad, 0xf8, + 0xf0, 0x10, 0x11, 0x49, 0x0c, 0x68, 0x17, 0x21, 0x00, 0x91, 0x4f, 0xf6, + 0xff, 0x71, 0xa0, 0x47, 0x05, 0x46, 0x98, 0x48, 0x0d, 0xf1, 0x0f, 0x01, + 0x02, 0x68, 0x38, 0x46, 0x90, 0x47, 0x40, 0xb1, 0x01, 0x46, 0x95, 0x48, + 0x0d, 0xf2, 0x01, 0x12, 0x2b, 0x46, 0x04, 0x68, 0x9d, 0xf8, 0x0f, 0x00, + 0xa0, 0x47, 0x30, 0x68, 0x46, 0x99, 0x40, 0x1a, 0x04, 0xbf, 0x47, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0xd5, 0xf7, 0xde, 0xf9, 0x78, 0xf0, 0x08, 0x00, + 0xac, 0xf0, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x47, 0xba, 0xb0, 0x02, 0xad, + 0x88, 0x46, 0xde, 0x21, 0x1e, 0x46, 0x17, 0x46, 0x28, 0x46, 0xd1, 0xf7, + 0x25, 0xfd, 0x00, 0x24, 0x38, 0x46, 0x31, 0x46, 0x2a, 0x46, 0x8d, 0xf8, + 0x07, 0x40, 0xff, 0xf7, 0x52, 0xff, 0x26, 0x48, 0x04, 0x70, 0x9d, 0xf8, + 0x08, 0x00, 0xc0, 0xb3, 0x24, 0x4f, 0x25, 0x4c, 0x05, 0x35, 0x00, 0x26, + 0x4f, 0xf0, 0x02, 0x09, 0x4f, 0xf0, 0x10, 0x0a, 0x39, 0x78, 0x15, 0xf8, + 0x01, 0x3c, 0x15, 0xf8, 0x02, 0x2c, 0x01, 0xeb, 0x41, 0x01, 0x07, 0xeb, + 0xc1, 0x01, 0x0b, 0x76, 0x6b, 0x78, 0xca, 0x75, 0x2a, 0x78, 0x0b, 0x75, + 0xeb, 0x78, 0xca, 0x74, 0xaa, 0x78, 0x8b, 0x75, 0x9d, 0xf8, 0x09, 0x30, + 0x4a, 0x75, 0x4a, 0x1c, 0x08, 0x2b, 0x06, 0xd1, 0x82, 0xf8, 0x00, 0x90, + 0x2a, 0x79, 0x6b, 0x79, 0xcb, 0x70, 0x8a, 0x70, 0x09, 0xe0, 0x82, 0xf8, + 0x00, 0xa0, 0x88, 0x1c, 0x2a, 0x1d, 0x10, 0x21, 0x10, 0x23, 0xcf, 0xf7, + 0x55, 0xfb, 0x9d, 0xf8, 0x08, 0x00, 0x21, 0x78, 0x01, 0x36, 0x16, 0x35, + 0x86, 0x42, 0x01, 0xf1, 0x01, 0x01, 0x21, 0x70, 0xce, 0xd3, 0x61, 0x48, + 0x0d, 0xf1, 0x07, 0x01, 0x02, 0x68, 0x40, 0x46, 0x90, 0x47, 0x07, 0x48, + 0x04, 0x49, 0x02, 0x68, 0x9d, 0xf8, 0x07, 0x00, 0x90, 0x47, 0x3a, 0xb0, + 0xbd, 0xe8, 0xf0, 0x87, 0xd5, 0x9b, 0x01, 0x00, 0xac, 0x93, 0x01, 0x00, + 0xf0, 0x91, 0x01, 0x00, 0x7c, 0xf0, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0xc7, 0xb0, 0xdf, 0xf8, 0x40, 0xa1, 0x03, 0xad, 0x0c, 0x46, 0xde, 0x21, + 0x1e, 0x46, 0x17, 0x46, 0xda, 0xf8, 0x00, 0x00, 0x46, 0x90, 0x28, 0x46, + 0xd1, 0xf7, 0xb8, 0xfc, 0x38, 0x46, 0x31, 0x46, 0x2a, 0x46, 0xff, 0xf7, + 0xe8, 0xfe, 0x9d, 0xf8, 0x0c, 0x00, 0x00, 0x28, 0x3e, 0xd0, 0x46, 0x4e, + 0x04, 0x35, 0x00, 0x27, 0x4f, 0xf0, 0x16, 0x0a, 0x4f, 0xf0, 0x02, 0x0b, + 0x01, 0x94, 0x31, 0x78, 0xca, 0xb2, 0x15, 0xf8, 0x01, 0x3c, 0x2c, 0x78, + 0x95, 0xf8, 0x02, 0x80, 0x95, 0xf8, 0x03, 0x90, 0x12, 0xfb, 0x0a, 0x62, + 0xd4, 0x74, 0x93, 0x74, 0x6b, 0x78, 0x9d, 0xf8, 0x0d, 0x40, 0x82, 0xf8, + 0x16, 0x90, 0x82, 0xf8, 0x15, 0x80, 0x13, 0x75, 0x53, 0x1c, 0x08, 0x2c, + 0x0b, 0xd3, 0x10, 0x20, 0x10, 0x21, 0x18, 0x70, 0x90, 0x1c, 0x2a, 0x1d, + 0x10, 0x23, 0xcf, 0xf7, 0xf3, 0xfa, 0x31, 0x78, 0x9d, 0xf8, 0x0c, 0x00, + 0x05, 0xe0, 0x83, 0xf8, 0x00, 0xb0, 0x2b, 0x79, 0x6c, 0x79, 0xd4, 0x70, + 0x93, 0x70, 0x01, 0x37, 0x01, 0x31, 0x16, 0x35, 0x87, 0x42, 0x31, 0x70, + 0xd0, 0xd3, 0x48, 0xea, 0x09, 0x20, 0xdf, 0xf8, 0xa0, 0xa0, 0x01, 0x9c, + 0x80, 0xb2, 0x00, 0xe0, 0x00, 0x20, 0x27, 0x49, 0x0d, 0x88, 0xa8, 0x42, + 0x2e, 0xd0, 0x46, 0x1c, 0xae, 0x42, 0x2b, 0xd2, 0x0d, 0xf1, 0xec, 0x09, + 0x17, 0x21, 0x4f, 0xf0, 0x17, 0x08, 0x48, 0x46, 0xd1, 0xf7, 0x60, 0xfc, + 0x28, 0x20, 0x41, 0xaa, 0x29, 0x46, 0x4b, 0x46, 0xcd, 0xf8, 0x00, 0x80, + 0x8d, 0xf8, 0x06, 0x01, 0x40, 0xf2, 0x02, 0x30, 0xad, 0xf8, 0x04, 0x01, + 0x00, 0x20, 0x8d, 0xf8, 0x0b, 0x00, 0x19, 0x48, 0x07, 0x68, 0xb0, 0xb2, + 0xb8, 0x47, 0xe8, 0xb1, 0x05, 0x46, 0x17, 0x48, 0x0d, 0xf1, 0x0b, 0x01, + 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0xa8, 0xb1, 0x01, 0x46, 0x14, 0x48, + 0x3b, 0xaa, 0x2b, 0x46, 0x06, 0x68, 0x00, 0x20, 0xb0, 0x47, 0x0d, 0xe0, + 0x00, 0x20, 0x3b, 0xa9, 0x8d, 0xf8, 0xec, 0x00, 0x0d, 0x48, 0x02, 0x68, + 0x20, 0x46, 0x90, 0x47, 0x0d, 0x48, 0x08, 0x49, 0x02, 0x68, 0x9d, 0xf8, + 0xec, 0x00, 0x90, 0x47, 0xda, 0xf8, 0x00, 0x00, 0x46, 0x99, 0x40, 0x1a, + 0x04, 0xbf, 0x47, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0xd5, 0xf7, 0xce, 0xf8, + 0x38, 0xec, 0x01, 0x00, 0x90, 0x95, 0x01, 0x00, 0x8e, 0x95, 0x01, 0x00, + 0xb0, 0xf0, 0x08, 0x00, 0x98, 0xf0, 0x08, 0x00, 0x9c, 0xf0, 0x08, 0x00, + 0x80, 0xf0, 0x08, 0x00, 0x04, 0x48, 0x05, 0x49, 0x01, 0x60, 0x05, 0x48, + 0x05, 0x49, 0x01, 0x60, 0x05, 0x48, 0x06, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x0c, 0xf0, 0x08, 0x00, 0xe9, 0x18, 0x05, 0x00, 0x00, 0xf0, 0x08, 0x00, + 0xbd, 0x17, 0x05, 0x00, 0x10, 0xf0, 0x08, 0x00, 0xb9, 0x19, 0x05, 0x00, + 0x70, 0x47, 0x00, 0x00, 0x2d, 0xe9, 0xf8, 0x43, 0x04, 0x46, 0x01, 0x01, + 0x35, 0x48, 0x45, 0x58, 0xe9, 0x88, 0xc9, 0x07, 0x50, 0xd1, 0x34, 0x49, + 0x91, 0xf8, 0x9c, 0x15, 0xc9, 0x07, 0x4b, 0xd1, 0x00, 0xeb, 0x04, 0x16, + 0x56, 0xf8, 0x04, 0x1f, 0x00, 0x29, 0x4a, 0xd0, 0xdf, 0xf8, 0xbc, 0x80, + 0xd8, 0xf8, 0x00, 0x00, 0x78, 0xb9, 0x2e, 0x48, 0x01, 0x68, 0x2c, 0x20, + 0x88, 0x47, 0xc8, 0xf8, 0x00, 0x00, 0xc8, 0xb3, 0x2b, 0x4a, 0x2c, 0x21, + 0x2c, 0x23, 0xcf, 0xf7, 0x45, 0xfa, 0xd8, 0xf8, 0x00, 0x00, 0x88, 0xb3, + 0x31, 0x68, 0x0e, 0x68, 0x4f, 0xf6, 0xff, 0x77, 0x31, 0x88, 0x61, 0xb1, + 0x31, 0x88, 0xb9, 0x42, 0x09, 0xd0, 0x00, 0x20, 0x6f, 0x21, 0x4f, 0xf0, + 0x00, 0x09, 0xd5, 0xf7, 0x83, 0xf8, 0xa6, 0xf8, 0x00, 0x90, 0xb8, 0xf8, + 0x00, 0x00, 0xe9, 0x88, 0x41, 0xf0, 0x01, 0x01, 0xe9, 0x80, 0x00, 0x21, + 0xb5, 0x80, 0xb7, 0x81, 0xb7, 0x82, 0xb1, 0x83, 0x30, 0x80, 0x31, 0x88, + 0xb9, 0x42, 0x05, 0xd1, 0x00, 0x20, 0x84, 0x21, 0xd5, 0xf7, 0x6e, 0xf8, + 0xb8, 0xf8, 0x00, 0x00, 0x31, 0x88, 0x80, 0xb2, 0x88, 0x42, 0x16, 0xd3, + 0x05, 0x21, 0x0a, 0x04, 0x0f, 0xd0, 0x32, 0x88, 0x01, 0x39, 0x90, 0x42, + 0xf9, 0xd2, 0x0e, 0xe0, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x43, 0x00, 0xf0, + 0x3d, 0xb8, 0x00, 0x20, 0x5f, 0x21, 0xbd, 0xe8, 0xf8, 0x43, 0xd5, 0xf7, + 0x55, 0xb8, 0x00, 0x20, 0x84, 0x21, 0xd5, 0xf7, 0x51, 0xf8, 0xe8, 0x88, + 0xc0, 0x07, 0xfc, 0xd1, 0x00, 0x20, 0x30, 0x80, 0xea, 0xe7, 0x00, 0xbf, + 0x64, 0xaa, 0x01, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x9c, 0xfb, 0x05, 0x00, + 0xd4, 0x9c, 0x08, 0x00, 0x9c, 0x1c, 0x05, 0x00, 0x10, 0xb5, 0x07, 0x4b, + 0xb3, 0xf8, 0x5c, 0x40, 0xc4, 0x86, 0xb3, 0xf8, 0x5e, 0x40, 0x04, 0x87, + 0xb3, 0xf8, 0x5a, 0x30, 0x83, 0x80, 0xbd, 0xe8, 0x10, 0x40, 0x00, 0xf0, + 0x19, 0xb8, 0x00, 0xbf, 0x40, 0x86, 0x08, 0x00, 0x03, 0x48, 0x04, 0x49, + 0x01, 0x60, 0x04, 0x48, 0x04, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0xf8, 0x9c, 0x08, 0x00, 0x41, 0x1c, 0x05, 0x00, 0xac, 0xf2, 0x08, 0x00, + 0x4d, 0x1b, 0x05, 0x00, 0x41, 0xf2, 0xfd, 0x6c, 0xc1, 0xf2, 0x11, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf2, 0x45, 0x6c, 0xc1, 0xf2, 0x11, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x84, 0x36, 0xa6, 0x10, 0x82, 0x02, 0xa6, 0x11, + 0x84, 0x37, 0xa6, 0x13, 0x84, 0x38, 0xa6, 0x14, 0x84, 0x39, 0xa6, 0x15, + 0xb6, 0x20, 0xa6, 0x12, 0xb6, 0x21, 0xa6, 0x1b, 0x0a, 0xa6, 0x1c, 0xc1, + 0xa6, 0x1d, 0x80, 0x03, 0xb5, 0x01, 0x1c, 0xc1, 0x88, 0x03, 0xc0, 0xc0, + 0x2d, 0xe9, 0xf0, 0x41, 0xb0, 0x4c, 0x20, 0x68, 0xd0, 0xb3, 0x01, 0x79, + 0x2f, 0x4a, 0x52, 0xf8, 0x21, 0x70, 0xf9, 0x88, 0xc9, 0x07, 0x4d, 0xd1, + 0x2d, 0x4d, 0x29, 0x68, 0x79, 0xb9, 0x2d, 0x48, 0x01, 0x68, 0x4f, 0xf4, + 0xd0, 0x70, 0x88, 0x47, 0x00, 0x28, 0x28, 0x60, 0x4b, 0xd0, 0x2a, 0x4a, + 0x4f, 0xf4, 0xd0, 0x71, 0x4f, 0xf4, 0xd0, 0x73, 0xcf, 0xf7, 0x8e, 0xf9, + 0x20, 0x68, 0x06, 0x68, 0x30, 0x88, 0x58, 0xb1, 0x4f, 0xf6, 0xff, 0x71, + 0x88, 0x42, 0x07, 0xd0, 0x00, 0x20, 0x87, 0x21, 0x4f, 0xf0, 0x00, 0x08, + 0xd4, 0xf7, 0xd0, 0xff, 0xa6, 0xf8, 0x00, 0x80, 0xf8, 0x88, 0x4f, 0xf6, + 0xff, 0x71, 0x40, 0xf0, 0x01, 0x00, 0xf8, 0x80, 0x00, 0x20, 0xb7, 0x80, + 0xb1, 0x81, 0xb1, 0x82, 0xb0, 0x83, 0x28, 0x68, 0x30, 0x80, 0x32, 0x88, + 0x8a, 0x42, 0x07, 0xd0, 0x80, 0xb2, 0x0a, 0xe0, 0x00, 0x20, 0x64, 0x21, + 0xbd, 0xe8, 0xf0, 0x41, 0xd4, 0xf7, 0xb6, 0xbf, 0x00, 0x20, 0x9d, 0x21, + 0xd4, 0xf7, 0xb2, 0xff, 0x28, 0x88, 0x31, 0x88, 0x88, 0x42, 0x0b, 0xd3, + 0x05, 0x21, 0x0a, 0x04, 0x04, 0xd0, 0x32, 0x88, 0x01, 0x39, 0x90, 0x42, + 0xf9, 0xd2, 0x03, 0xe0, 0x00, 0x20, 0x9d, 0x21, 0xd4, 0xf7, 0xa2, 0xff, + 0x09, 0x48, 0x01, 0x21, 0x03, 0x68, 0x20, 0x68, 0x02, 0x79, 0x01, 0x20, + 0xbd, 0xe8, 0xf0, 0x41, 0x18, 0x47, 0x00, 0x20, 0x7b, 0x21, 0xdb, 0xe7, + 0x54, 0xab, 0x01, 0x00, 0xa0, 0xfb, 0x05, 0x00, 0xd4, 0x9c, 0x08, 0x00, + 0xc0, 0x20, 0x05, 0x00, 0xec, 0x9c, 0x08, 0x00, 0x1c, 0xb5, 0x05, 0x9c, + 0x01, 0x94, 0x04, 0x9c, 0x00, 0x94, 0x00, 0xf0, 0x79, 0xf9, 0x04, 0x49, + 0x04, 0x4a, 0x0a, 0x60, 0x04, 0x49, 0x00, 0x22, 0x8a, 0x80, 0x4a, 0x80, + 0x0a, 0x80, 0x1c, 0xbd, 0x7c, 0xab, 0x01, 0x00, 0xc9, 0x1c, 0x05, 0x00, + 0x76, 0xe5, 0x05, 0x00, 0x2d, 0xe9, 0xfe, 0x4f, 0xdf, 0xf8, 0xb4, 0x91, + 0x80, 0x46, 0xd9, 0xf8, 0x00, 0x00, 0x00, 0x28, 0x00, 0xf0, 0xcc, 0x80, + 0x6a, 0x4d, 0x0f, 0x46, 0x00, 0x79, 0x92, 0x46, 0x69, 0x68, 0x01, 0x31, + 0x69, 0x60, 0x00, 0xf0, 0x5d, 0xf9, 0x04, 0x28, 0x28, 0x60, 0x15, 0xd3, + 0xa8, 0x68, 0x64, 0x4b, 0x00, 0x21, 0x00, 0x22, 0x01, 0x30, 0xa8, 0x60, + 0x6a, 0x48, 0x04, 0x68, 0x0c, 0x20, 0x00, 0x90, 0x40, 0xf6, 0x0d, 0x10, + 0xa0, 0x47, 0x69, 0x48, 0x01, 0x68, 0xd9, 0xf8, 0x00, 0x00, 0x00, 0x79, + 0x03, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0x08, 0x47, 0x5b, 0x48, 0x5a, 0x4c, + 0x51, 0x46, 0x00, 0x22, 0x03, 0x68, 0x94, 0xf8, 0x78, 0x50, 0x38, 0x46, + 0x98, 0x47, 0x05, 0xf0, 0x0f, 0x01, 0x02, 0x29, 0x56, 0x49, 0x08, 0xbf, + 0x50, 0x44, 0x86, 0xb2, 0x01, 0xf5, 0x96, 0x65, 0xb1, 0xf8, 0xb2, 0x14, + 0x8e, 0x42, 0x03, 0xd3, 0x00, 0x20, 0xf0, 0x21, 0xcf, 0xf7, 0xce, 0xf8, + 0x68, 0x8c, 0x86, 0x42, 0x03, 0xd9, 0x4f, 0x48, 0x29, 0x78, 0x10, 0x30, + 0x03, 0xe0, 0x4d, 0x48, 0x95, 0xf8, 0x20, 0x10, 0x90, 0x30, 0x01, 0xf0, + 0x01, 0x01, 0xd3, 0xf7, 0x1b, 0xfa, 0x83, 0x46, 0xd0, 0xb3, 0xba, 0xf1, + 0x00, 0x0f, 0x3e, 0xd0, 0x47, 0x48, 0x01, 0x68, 0x0a, 0xeb, 0x4a, 0x00, + 0x80, 0x00, 0x88, 0x47, 0x00, 0x28, 0x45, 0xd0, 0x81, 0x46, 0xa6, 0x46, + 0x00, 0xeb, 0x8a, 0x00, 0x00, 0x21, 0x4f, 0xf0, 0x02, 0x0c, 0x00, 0x23, + 0x00, 0x25, 0xec, 0xb2, 0x01, 0x33, 0x00, 0xeb, 0x81, 0x02, 0x3c, 0x5d, + 0x53, 0x45, 0x00, 0xf8, 0x21, 0x40, 0x57, 0xfa, 0x85, 0xf4, 0x5c, 0xfa, + 0x85, 0xf5, 0x64, 0x78, 0x07, 0xeb, 0x05, 0x06, 0x49, 0xf8, 0x11, 0x20, + 0x01, 0xf1, 0x02, 0x01, 0x56, 0x60, 0x25, 0x44, 0x54, 0x80, 0xe8, 0xd1, + 0x9e, 0xf8, 0x78, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x02, 0x28, 0x25, 0xd1, + 0x32, 0x48, 0xd9, 0xf8, 0x00, 0x20, 0x3f, 0x21, 0x04, 0x68, 0x00, 0x20, + 0xcd, 0xe9, 0x00, 0x00, 0x02, 0x90, 0x27, 0xe0, 0x00, 0x20, 0xfc, 0x21, + 0x03, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0xd4, 0xf7, 0xdd, 0xbe, 0x2b, 0x48, + 0x00, 0x22, 0x00, 0x23, 0x04, 0x68, 0x00, 0x20, 0x00, 0x90, 0x4f, 0xea, + 0xc8, 0x20, 0x00, 0xf5, 0x7f, 0x70, 0x81, 0xb2, 0x58, 0x46, 0xa0, 0x47, + 0x04, 0x46, 0x1a, 0xe0, 0x00, 0x20, 0x4f, 0xf4, 0x89, 0x71, 0xd4, 0xf7, + 0xc9, 0xfe, 0x29, 0xe0, 0x1e, 0x48, 0x4a, 0x46, 0x04, 0x68, 0x00, 0x20, + 0xcd, 0xe9, 0x00, 0x00, 0x02, 0x90, 0x4f, 0xea, 0x48, 0x20, 0x00, 0xf2, + 0xf9, 0x10, 0x81, 0xb2, 0x58, 0x46, 0x53, 0x46, 0xa0, 0x47, 0x04, 0x46, + 0x48, 0x46, 0xd4, 0xf7, 0xd3, 0xfe, 0xdf, 0xf8, 0x38, 0x90, 0x17, 0x48, + 0x03, 0x21, 0x00, 0x22, 0x5b, 0x46, 0x05, 0x68, 0x40, 0xf6, 0x14, 0x10, + 0x00, 0x94, 0xa8, 0x47, 0x13, 0x48, 0x59, 0x46, 0x22, 0x46, 0x03, 0x68, + 0xd9, 0xf8, 0x00, 0x00, 0x00, 0x79, 0x98, 0x47, 0x01, 0x28, 0x01, 0xd1, + 0xbd, 0xe8, 0xfe, 0x8f, 0x58, 0x46, 0xbd, 0xe8, 0xfe, 0x4f, 0xd4, 0xf7, + 0xb7, 0xbe, 0x00, 0xbf, 0xc0, 0xab, 0x01, 0x00, 0x8c, 0xab, 0x01, 0x00, + 0x40, 0x86, 0x08, 0x00, 0xb8, 0xaf, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0x68, 0x8a, 0x01, 0x00, 0xd4, 0x9b, 0x08, 0x00, 0xbc, 0xaf, 0x08, 0x00, + 0xc0, 0xaf, 0x08, 0x00, 0xb4, 0xaf, 0x08, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0xd4, 0xaf, 0x08, 0x00, 0xd8, 0xaf, 0x08, 0x00, 0x2d, 0xe9, 0xf8, 0x43, + 0xdd, 0xe9, 0x08, 0x75, 0x0e, 0x46, 0xdd, 0xf8, 0x28, 0x90, 0xe9, 0x19, + 0xb1, 0x42, 0x0c, 0xd9, 0x90, 0x46, 0xbe, 0x42, 0x0e, 0xd9, 0xf4, 0x1b, + 0xc2, 0x19, 0x48, 0x46, 0x21, 0x46, 0x23, 0x46, 0xcf, 0xf7, 0x1a, 0xf8, + 0x27, 0x44, 0xa1, 0xb2, 0x05, 0xe0, 0xc2, 0x19, 0x48, 0x46, 0x29, 0x46, + 0x2b, 0x46, 0x07, 0xe0, 0x00, 0x21, 0xba, 0xb2, 0x09, 0xeb, 0x01, 0x00, + 0x69, 0x1a, 0x92, 0x1b, 0x0b, 0x46, 0x42, 0x44, 0x01, 0xb0, 0xbd, 0xe8, + 0xf0, 0x43, 0xcf, 0xf7, 0x05, 0xb8, 0x00, 0xbf, 0xbf, 0xb5, 0x04, 0x46, + 0x14, 0x48, 0x0d, 0xf1, 0x0e, 0x01, 0x01, 0xaa, 0x03, 0xab, 0x05, 0x68, + 0x02, 0xa8, 0xa8, 0x47, 0xbd, 0xf8, 0x0e, 0x00, 0xbd, 0xf8, 0x0c, 0x10, + 0x0a, 0x18, 0xa1, 0x1c, 0x8a, 0x42, 0x01, 0xd2, 0x00, 0x20, 0x14, 0xe0, + 0x81, 0x42, 0x03, 0xd9, 0x01, 0x9a, 0x21, 0x1a, 0x11, 0x44, 0x01, 0xe0, + 0x02, 0x99, 0x21, 0x44, 0x01, 0x31, 0xa0, 0x42, 0x09, 0x78, 0x02, 0xd9, + 0x02, 0x98, 0x20, 0x44, 0x02, 0xe0, 0x01, 0x9a, 0x20, 0x1a, 0x10, 0x44, + 0x00, 0x78, 0x40, 0xea, 0x01, 0x20, 0x04, 0xb0, 0xb0, 0xbd, 0x00, 0xbf, + 0x78, 0x9d, 0x08, 0x00, 0x03, 0x49, 0x09, 0x68, 0x09, 0xb1, 0xff, 0xf7, + 0xcd, 0xbf, 0x00, 0x20, 0x70, 0x47, 0x00, 0xbf, 0xc8, 0xab, 0x01, 0x00, + 0x03, 0x48, 0x04, 0x49, 0x01, 0x60, 0x04, 0x48, 0x04, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0xe8, 0xc2, 0x08, 0x00, 0xd5, 0x1d, 0x05, 0x00, + 0x9c, 0xd4, 0x08, 0x00, 0xa9, 0x1d, 0x05, 0x00, 0x42, 0xf6, 0x0d, 0x4c, + 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf6, 0x25, 0x1c, + 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x84, 0x36, 0xa6, 0x10, + 0x82, 0x02, 0xa6, 0x11, 0x84, 0x37, 0xa6, 0x13, 0x84, 0x38, 0xa6, 0x14, + 0x84, 0x39, 0xa6, 0x15, 0x84, 0x3a, 0xa6, 0x12, 0x84, 0x3b, 0xa6, 0x1b, + 0x84, 0x3c, 0xa6, 0x1c, 0x0a, 0xa6, 0x16, 0xc1, 0xa6, 0x17, 0x8c, 0x3d, + 0x9a, 0x9a, 0xb4, 0x02, 0x10, 0x80, 0xa4, 0xfd, 0xa0, 0x10, 0x10, 0x01, + 0xa4, 0x10, 0xc1, 0xc1, 0xc0, 0x9a, 0xa3, 0x90, 0x8f, 0x00, 0xa0, 0xfe, + 0x20, 0x80, 0xbc, 0x45, 0x83, 0x13, 0x93, 0xc1, 0x8b, 0x13, 0x85, 0x3e, + 0x2f, 0x05, 0xbc, 0x47, 0xa3, 0xf0, 0xb9, 0x14, 0x80, 0x0d, 0x38, 0x02, + 0x88, 0x0d, 0xbd, 0xdc, 0x85, 0x3d, 0x27, 0x04, 0xe2, 0xcb, 0x27, 0x02, + 0xe2, 0x5e, 0x5a, 0x56, 0x2a, 0x03, 0xbc, 0x16, 0x83, 0x0e, 0x8b, 0x07, + 0x83, 0x1a, 0x93, 0xc1, 0x8b, 0x1a, 0xb4, 0x08, 0xa4, 0xff, 0x0f, 0xc1, + 0x8d, 0x3e, 0xbb, 0xb8, 0x80, 0x03, 0x10, 0x10, 0x88, 0x03, 0xd0, 0xc1, + 0xa0, 0xfc, 0xa4, 0xfc, 0x80, 0x03, 0xb5, 0x01, 0x1c, 0x88, 0x03, 0xc1, + 0xc0, 0x2f, 0x00, 0xc1, 0xbc, 0x18, 0xb3, 0xf7, 0x17, 0x82, 0x2e, 0xc1, + 0xbc, 0x0e, 0x83, 0x19, 0x93, 0x8b, 0x19, 0x0f, 0x93, 0x8d, 0x3e, 0x0f, + 0x8b, 0x16, 0xbb, 0x88, 0x2f, 0x01, 0xbc, 0x10, 0xb3, 0x41, 0x17, 0xef, + 0x2e, 0xbd, 0xc1, 0xc1, 0xb7, 0x02, 0x8d, 0x3e, 0xbb, 0x76, 0x2f, 0x02, + 0xbc, 0x52, 0x2a, 0x00, 0xe3, 0xbb, 0xb1, 0xc1, 0xb7, 0x03, 0x03, 0xc1, + 0x2f, 0x01, 0xbc, 0x0a, 0x80, 0x03, 0x10, 0x02, 0x88, 0x03, 0xbb, 0x9c, + 0x8a, 0x0c, 0x80, 0x07, 0x88, 0x0e, 0x0a, 0xc1, 0x8c, 0x3d, 0x86, 0x00, + 0xa3, 0xf0, 0xb8, 0x7c, 0x5e, 0x5e, 0xa3, 0x91, 0x4f, 0x16, 0xa3, 0xf0, + 0xb8, 0x72, 0x5e, 0x5e, 0xa3, 0xf0, 0xb8, 0x6c, 0x82, 0x0c, 0xa3, 0xf0, + 0xb8, 0x66, 0xb7, 0x03, 0x03, 0x2f, 0x00, 0xe5, 0x0a, 0xb7, 0x03, 0xc5, + 0xb6, 0x04, 0xb7, 0x04, 0x8c, 0x3d, 0x8d, 0x3e, 0xbb, 0x22, 0x2f, 0x03, + 0xbc, 0x18, 0x2a, 0x01, 0x8a, 0x15, 0x8a, 0x0b, 0xbc, 0x08, 0xb7, 0x04, + 0x8d, 0x3e, 0xbb, 0x10, 0x80, 0x03, 0x10, 0x04, 0x88, 0x03, 0xbb, 0x48, + 0x2f, 0x04, 0xbd, 0x48, 0x2a, 0x00, 0xbc, 0x0a, 0x80, 0x03, 0x10, 0x08, + 0x88, 0x03, 0xbb, 0x38, 0x85, 0x3d, 0x1f, 0x03, 0x22, 0x01, 0xe2, 0xc3, + 0x17, 0x02, 0x8d, 0x3d, 0xb7, 0x02, 0x33, 0x93, 0x1f, 0x01, 0x8b, 0x0d, + 0x81, 0x16, 0x80, 0x0d, 0x31, 0x89, 0x16, 0xc1, 0xa3, 0xf0, 0xc8, 0xc1, + 0xb7, 0x05, 0x8d, 0x3e, 0xba, 0xd2, 0x88, 0x0f, 0x89, 0x10, 0x8b, 0x11, + 0x85, 0x3d, 0x27, 0x01, 0xbc, 0x26, 0x80, 0x0e, 0x81, 0x06, 0x30, 0x02, + 0x2c, 0xe3, 0x80, 0x05, 0x81, 0x08, 0x2c, 0xc1, 0xbc, 0x10, 0x17, 0x01, + 0x8d, 0x3d, 0x80, 0x07, 0x88, 0x0e, 0x80, 0x09, 0x90, 0x88, 0x09, 0xc7, + 0x81, 0x0e, 0x7a, 0xc1, 0x88, 0x0e, 0x80, 0x0f, 0x81, 0x10, 0x83, 0x11, + 0xb8, 0x03, 0xc0, 0xc0, 0x52, 0x48, 0x53, 0x4a, 0x53, 0x4d, 0x54, 0x4c, + 0x01, 0x68, 0xc2, 0xf8, 0x58, 0x11, 0x01, 0x6a, 0xc2, 0xf8, 0x5c, 0x11, + 0x41, 0x6a, 0xc2, 0xf8, 0x60, 0x11, 0x81, 0x6a, 0xc2, 0xf8, 0x64, 0x11, + 0xc1, 0x6a, 0xc2, 0xf8, 0x68, 0x11, 0x01, 0x6b, 0xc2, 0xf8, 0x6c, 0x11, + 0x41, 0x6b, 0xc2, 0xf8, 0x70, 0x11, 0x80, 0x6b, 0xc2, 0xf8, 0x74, 0x01, + 0xef, 0xf3, 0x14, 0x80, 0x90, 0x64, 0xef, 0xf3, 0x10, 0x80, 0x50, 0x64, + 0x00, 0x20, 0x82, 0xf8, 0x7c, 0x01, 0xd5, 0xf8, 0x80, 0x0e, 0xc2, 0xf8, + 0x78, 0x01, 0x10, 0x6c, 0xa0, 0x60, 0x41, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x20, 0x61, 0x40, 0x48, 0x00, 0x68, 0x80, 0x47, 0xa0, 0x61, 0x3f, 0x4f, + 0xdf, 0xf8, 0xfc, 0x80, 0x40, 0x4e, 0x41, 0x4c, 0xe8, 0x69, 0x47, 0xf8, + 0x8c, 0x0f, 0x98, 0xf8, 0x2e, 0x01, 0x80, 0x06, 0x44, 0xbf, 0xd5, 0xf8, + 0x20, 0x01, 0xb8, 0x66, 0x39, 0x48, 0x01, 0x68, 0x21, 0xf4, 0x80, 0x61, + 0x01, 0x60, 0x01, 0x68, 0x41, 0xf4, 0x00, 0x71, 0x01, 0x60, 0x01, 0x68, + 0x41, 0xf4, 0x00, 0x61, 0x01, 0x60, 0x70, 0x69, 0x20, 0x60, 0x35, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x28, 0x68, 0x80, 0x07, 0x09, 0xd0, 0x68, 0x68, + 0x01, 0x21, 0x00, 0x22, 0x40, 0xf0, 0x01, 0x00, 0x68, 0x60, 0x30, 0x48, + 0x03, 0x68, 0x8d, 0x20, 0x98, 0x47, 0x2f, 0x48, 0x01, 0x68, 0xc9, 0x07, + 0x18, 0xd0, 0xc1, 0x68, 0xc9, 0x07, 0x0b, 0xd0, 0x41, 0x69, 0x82, 0x69, + 0x7a, 0x67, 0xc2, 0x69, 0xba, 0x67, 0x2a, 0x4a, 0x12, 0x68, 0xa7, 0xf8, + 0x80, 0x10, 0x01, 0x21, 0x62, 0x60, 0x01, 0x61, 0x01, 0x6a, 0x00, 0x22, + 0xf9, 0x67, 0x01, 0x21, 0x41, 0x60, 0x22, 0x48, 0x01, 0x21, 0x03, 0x68, + 0x8a, 0x20, 0x98, 0x47, 0xe8, 0x69, 0x40, 0x07, 0x08, 0xd5, 0x01, 0x20, + 0x01, 0x21, 0x00, 0x22, 0xc5, 0xf8, 0x78, 0x01, 0x1b, 0x48, 0x03, 0x68, + 0x9b, 0x20, 0x98, 0x47, 0x70, 0x69, 0xc0, 0x07, 0x0d, 0xd0, 0x30, 0x68, + 0x01, 0x21, 0x00, 0x22, 0x40, 0xf0, 0x02, 0x00, 0x30, 0x60, 0x01, 0x20, + 0x70, 0x61, 0x00, 0x20, 0xb0, 0x61, 0x13, 0x48, 0x03, 0x68, 0x8c, 0x20, + 0x98, 0x47, 0x98, 0xf8, 0x34, 0x03, 0x28, 0xb1, 0x0f, 0x48, 0x01, 0x21, + 0x00, 0x22, 0x03, 0x68, 0x84, 0x20, 0x98, 0x47, 0xfe, 0xe7, 0x00, 0xbf, + 0x04, 0xed, 0x00, 0xe0, 0x90, 0xfe, 0x01, 0x00, 0xa4, 0x11, 0x00, 0x40, + 0xe0, 0xfe, 0x00, 0x00, 0xcc, 0x9d, 0x08, 0x00, 0x84, 0x9c, 0x08, 0x00, + 0xf0, 0x2e, 0x01, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0xb0, 0x50, 0x00, 0x30, + 0x04, 0x00, 0x03, 0x30, 0xa4, 0xfb, 0x05, 0x00, 0x64, 0xa0, 0x08, 0x00, + 0x60, 0xa0, 0x08, 0x00, 0x14, 0x30, 0x00, 0x40, 0xd0, 0x40, 0x05, 0x30, + 0x02, 0x48, 0x03, 0x49, 0xc0, 0xe9, 0x02, 0x11, 0x70, 0x47, 0x00, 0xbf, + 0x00, 0x00, 0x00, 0x00, 0xfd, 0x23, 0x05, 0x00, 0x04, 0x20, 0x71, 0x46, + 0x08, 0x42, 0x03, 0xd0, 0x01, 0x20, 0xef, 0xf3, 0x09, 0x82, 0x02, 0xe0, + 0x00, 0x20, 0xef, 0xf3, 0x08, 0x82, 0x0f, 0x49, 0x08, 0x65, 0x0b, 0x46, + 0x54, 0x33, 0x80, 0x33, 0x80, 0x33, 0x70, 0x46, 0x18, 0x60, 0x0b, 0x46, + 0x10, 0x33, 0xf0, 0xc3, 0x44, 0x46, 0x4d, 0x46, 0x56, 0x46, 0x5f, 0x46, + 0xf0, 0xc3, 0x64, 0x46, 0x10, 0xc3, 0xef, 0xf3, 0x08, 0x84, 0xef, 0xf3, + 0x09, 0x85, 0x56, 0x69, 0x97, 0x69, 0xf0, 0xc3, 0xd7, 0x69, 0x12, 0x1d, + 0x70, 0xca, 0xf0, 0xc1, 0xff, 0xf7, 0x08, 0xff, 0x90, 0xfe, 0x01, 0x00, + 0xf0, 0xb5, 0x3d, 0x4d, 0x95, 0xf8, 0x2f, 0x41, 0x64, 0x07, 0x53, 0xd5, + 0x3e, 0x4c, 0x00, 0x2b, 0x20, 0x60, 0x20, 0x46, 0x40, 0xf8, 0x04, 0x2f, + 0x4f, 0xf0, 0x00, 0x02, 0xc2, 0x80, 0x81, 0x80, 0x48, 0xd0, 0x59, 0xb3, + 0x01, 0x29, 0x43, 0xd1, 0xb9, 0x4b, 0x04, 0xf1, 0x0f, 0x01, 0x00, 0x22, + 0x40, 0xcb, 0x01, 0x32, 0x10, 0x2a, 0x77, 0x89, 0x21, 0xf8, 0x03, 0x7c, + 0xb6, 0x89, 0x21, 0xf8, 0x01, 0x6c, 0x01, 0xf1, 0x04, 0x01, 0xf3, 0xd1, + 0xcd, 0x49, 0x05, 0xf2, 0xac, 0x43, 0x00, 0x25, 0x01, 0xf1, 0x0d, 0x02, + 0x10, 0x21, 0x1e, 0x78, 0xf6, 0x07, 0x09, 0xd0, 0x8e, 0xb2, 0x32, 0xf8, + 0x03, 0x7c, 0x01, 0x31, 0x04, 0xeb, 0x86, 0x06, 0xb7, 0x81, 0x32, 0xf8, + 0x01, 0x7c, 0xf7, 0x81, 0x01, 0x35, 0x04, 0x33, 0x10, 0x32, 0x2e, 0x2d, + 0xed, 0xd1, 0x1a, 0xe0, 0xc0, 0x49, 0x05, 0xf2, 0xac, 0x43, 0x00, 0x25, + 0x01, 0xf1, 0x0d, 0x02, 0x00, 0x21, 0x1e, 0x78, 0xf6, 0x07, 0x09, 0xd1, + 0x8e, 0xb2, 0x32, 0xf8, 0x03, 0x7c, 0x01, 0x31, 0x04, 0xeb, 0x86, 0x06, + 0xb7, 0x81, 0x32, 0xf8, 0x01, 0x7c, 0xf7, 0x81, 0x01, 0x35, 0x04, 0x33, + 0x10, 0x32, 0x2e, 0x2d, 0xed, 0xd1, 0x00, 0xe0, 0x00, 0x21, 0xc1, 0x80, + 0xf0, 0xbd, 0x00, 0xbf, 0x1c, 0xb5, 0x0f, 0x48, 0x90, 0xf8, 0x2f, 0x01, + 0x40, 0x07, 0x17, 0xd5, 0x0d, 0x48, 0x0e, 0x49, 0x02, 0x68, 0x0b, 0x68, + 0xd2, 0x1a, 0x0d, 0x4b, 0x9a, 0x42, 0x0f, 0xd3, 0x00, 0x68, 0x0c, 0x4b, + 0x00, 0x22, 0x08, 0x60, 0x58, 0x89, 0x0c, 0x21, 0x01, 0xeb, 0x80, 0x00, + 0x09, 0x49, 0x80, 0xb2, 0x0c, 0x68, 0x00, 0x90, 0x40, 0xf2, 0x33, 0x70, + 0x00, 0x21, 0xa0, 0x47, 0x1c, 0xbd, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, + 0x24, 0x20, 0x00, 0x40, 0xb0, 0xfc, 0x05, 0x00, 0xa0, 0x86, 0x01, 0x00, + 0xac, 0xfb, 0x05, 0x00, 0xa0, 0xa0, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x47, + 0xdf, 0xf8, 0xf4, 0x91, 0x05, 0x46, 0x99, 0x4c, 0x90, 0x46, 0x72, 0xb6, + 0xd9, 0xf8, 0x00, 0x00, 0x40, 0x00, 0x01, 0x30, 0xc9, 0xf8, 0x00, 0x00, + 0x04, 0xf5, 0xf8, 0x70, 0x85, 0x42, 0x04, 0xd0, 0x04, 0xf5, 0x00, 0x70, + 0x8a, 0x46, 0x85, 0x42, 0x01, 0xd1, 0x4f, 0xf0, 0x01, 0x0a, 0x2f, 0x68, + 0xff, 0xb1, 0x57, 0xf8, 0x08, 0x0c, 0x58, 0xb9, 0xe4, 0x4a, 0x28, 0x89, + 0x39, 0x5a, 0x12, 0x88, 0x91, 0x42, 0x05, 0xd1, 0xe2, 0x49, 0x38, 0x44, + 0x80, 0x78, 0x09, 0x78, 0x88, 0x42, 0x04, 0xd0, 0x00, 0x20, 0x40, 0xf2, + 0x03, 0x11, 0xce, 0xf7, 0x1d, 0xfd, 0x57, 0xf8, 0x04, 0x0c, 0x69, 0x7b, + 0x28, 0x60, 0xa8, 0x7a, 0x01, 0x38, 0xc2, 0xb2, 0xa8, 0x72, 0x8a, 0x42, + 0x6f, 0xd2, 0x68, 0x73, 0x6d, 0xe0, 0xe8, 0x7a, 0x00, 0x28, 0x00, 0xf0, + 0x95, 0x80, 0xa9, 0x7a, 0xae, 0x7b, 0x2f, 0x89, 0x81, 0x42, 0x04, 0xd0, + 0x00, 0x20, 0x40, 0xf2, 0x21, 0x11, 0xce, 0xf7, 0x03, 0xfd, 0xf0, 0x07, + 0x07, 0xf1, 0x03, 0x01, 0x4f, 0xf0, 0x10, 0x00, 0x21, 0xf0, 0x03, 0x01, + 0x08, 0xbf, 0x0c, 0x20, 0xba, 0xf1, 0x01, 0x0f, 0x08, 0x44, 0x13, 0xd0, + 0xba, 0xf1, 0x00, 0x0f, 0x2f, 0xd1, 0x55, 0x49, 0x80, 0xb2, 0x0b, 0x68, + 0x54, 0x49, 0x0a, 0x68, 0xd3, 0x1a, 0x83, 0x42, 0x30, 0xda, 0x28, 0x7b, + 0x40, 0xf2, 0x37, 0x11, 0x01, 0x30, 0x28, 0x73, 0x00, 0x20, 0xd4, 0xf7, + 0x45, 0xfb, 0x6c, 0xe0, 0x04, 0xf5, 0xc8, 0x71, 0x8d, 0x42, 0x45, 0xd0, + 0x48, 0x49, 0x0a, 0x68, 0xaa, 0x42, 0x1a, 0xd0, 0x4a, 0x68, 0xaa, 0x42, + 0x17, 0xd0, 0x8a, 0x68, 0xaa, 0x42, 0x14, 0xd0, 0xca, 0x68, 0xaa, 0x42, + 0x11, 0xd0, 0x0a, 0x69, 0xaa, 0x42, 0x0e, 0xd0, 0x4a, 0x69, 0xaa, 0x42, + 0x0b, 0xd0, 0x8a, 0x69, 0xaa, 0x42, 0x08, 0xd0, 0xc9, 0x69, 0xa9, 0x42, + 0x05, 0xd0, 0x3d, 0x49, 0x00, 0xe0, 0x3f, 0x49, 0x09, 0x68, 0x80, 0xb2, + 0x2e, 0xe0, 0x87, 0xb2, 0x38, 0x46, 0x00, 0xf0, 0x2f, 0xfd, 0x25, 0xe0, + 0x10, 0x1a, 0xaa, 0x4a, 0x2b, 0x89, 0x08, 0x60, 0xe9, 0x7a, 0x00, 0xf1, + 0x08, 0x07, 0xa8, 0x7a, 0x12, 0x88, 0x01, 0x39, 0x01, 0x38, 0xfa, 0x52, + 0xe9, 0x72, 0xf9, 0x18, 0xa4, 0x4b, 0x6a, 0x7b, 0xa8, 0x72, 0x1b, 0x78, + 0x8b, 0x70, 0xc1, 0xb2, 0x91, 0x42, 0xff, 0xf4, 0x90, 0xaf, 0x00, 0x20, + 0x47, 0xe9, 0x02, 0x50, 0xa8, 0x7b, 0xc0, 0x07, 0x39, 0xd0, 0x28, 0x89, + 0x38, 0x44, 0xc0, 0xf8, 0x04, 0x80, 0x34, 0xe0, 0x87, 0xb2, 0x38, 0x46, + 0x00, 0xf0, 0xe8, 0xfc, 0x20, 0xb9, 0x24, 0x48, 0x01, 0x68, 0x38, 0x46, + 0x88, 0x47, 0xa8, 0xb1, 0x94, 0x49, 0x2a, 0x89, 0x00, 0xf1, 0x08, 0x07, + 0xa8, 0x7a, 0x6b, 0x7b, 0x09, 0x88, 0x01, 0x38, 0xa8, 0x72, 0xb9, 0x52, + 0xe9, 0x7a, 0x01, 0x39, 0xe9, 0x72, 0xb9, 0x18, 0x8e, 0x4a, 0x12, 0x78, + 0x8a, 0x70, 0xc1, 0xb2, 0x99, 0x42, 0xff, 0xf4, 0x66, 0xaf, 0xd4, 0xe7, + 0x28, 0x7b, 0x01, 0x30, 0x28, 0x73, 0x19, 0x4c, 0x20, 0x78, 0x68, 0xb9, + 0xa8, 0x7b, 0x80, 0x07, 0x0a, 0xd5, 0xeb, 0x7a, 0x28, 0x46, 0x51, 0x46, + 0x42, 0x46, 0x00, 0x2b, 0x18, 0xbf, 0x01, 0x23, 0xff, 0xf7, 0x92, 0xfe, + 0x01, 0x20, 0x20, 0x70, 0x00, 0x27, 0xd9, 0xf8, 0x00, 0x00, 0x4f, 0xea, + 0x50, 0x00, 0xc9, 0xf8, 0x00, 0x00, 0xd9, 0xf8, 0x00, 0x00, 0x80, 0xf3, + 0x10, 0x88, 0x37, 0xb9, 0x0a, 0x4c, 0x20, 0x78, 0x18, 0xb1, 0xff, 0xf7, + 0xdb, 0xfe, 0x00, 0x20, 0x20, 0x70, 0x38, 0x46, 0xbd, 0xe8, 0xf0, 0x87, + 0x24, 0x36, 0x01, 0x00, 0x28, 0x8a, 0x01, 0x00, 0xdc, 0x9b, 0x08, 0x00, + 0x2c, 0x36, 0x01, 0x00, 0x30, 0x36, 0x01, 0x00, 0x6c, 0xfa, 0x08, 0x00, + 0xb4, 0xfc, 0x05, 0x00, 0xb0, 0xb5, 0x1c, 0x46, 0x12, 0x4b, 0x98, 0x42, + 0x0f, 0xd0, 0x12, 0x4b, 0x98, 0x42, 0x0c, 0xd0, 0x11, 0x4b, 0x03, 0xf5, + 0xe8, 0x75, 0xa8, 0x42, 0x07, 0xd0, 0x03, 0xf5, 0x04, 0x75, 0xa8, 0x42, + 0x03, 0xd0, 0x03, 0xf5, 0x18, 0x73, 0x98, 0x42, 0x01, 0xd1, 0x44, 0xf0, + 0x10, 0x04, 0x0a, 0x4b, 0x03, 0xf5, 0xa8, 0x73, 0x98, 0x42, 0x23, 0x46, + 0x08, 0xbf, 0x40, 0x21, 0x00, 0xf0, 0x32, 0xf9, 0xe1, 0x06, 0x03, 0xd5, + 0x81, 0x7b, 0x41, 0xf0, 0x02, 0x01, 0x81, 0x73, 0xb0, 0xbd, 0x00, 0xbf, + 0xa8, 0xab, 0x01, 0x00, 0x98, 0xab, 0x01, 0x00, 0x68, 0x8a, 0x01, 0x00, + 0xf8, 0xb5, 0x21, 0x4f, 0x00, 0x26, 0x84, 0x4d, 0x04, 0x46, 0x72, 0xb6, + 0x3e, 0x70, 0x28, 0x68, 0x40, 0x00, 0x01, 0x30, 0x28, 0x60, 0x1d, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x1c, 0x49, 0x20, 0x01, 0x01, 0x22, + 0x08, 0x58, 0x1b, 0x49, 0x00, 0x78, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, + 0xc0, 0x00, 0x10, 0xf8, 0x08, 0x1c, 0x50, 0xf8, 0x0c, 0x0c, 0x61, 0x1a, + 0x16, 0x4c, 0x02, 0xfa, 0x01, 0xf1, 0x02, 0x68, 0x22, 0xea, 0x01, 0x01, + 0x01, 0x60, 0x20, 0x78, 0x80, 0xb1, 0x38, 0x78, 0x98, 0xb1, 0x12, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x11, 0x49, 0x0a, 0x68, 0x10, 0x44, 0x08, 0x60, + 0x20, 0x78, 0x10, 0x49, 0x51, 0xf8, 0x30, 0x00, 0x0f, 0x49, 0x09, 0x68, + 0x88, 0x47, 0x04, 0xe0, 0x0e, 0x48, 0x00, 0x68, 0x80, 0x47, 0x0a, 0x48, + 0x06, 0x60, 0x28, 0x68, 0x40, 0x08, 0x28, 0x60, 0x28, 0x68, 0x80, 0xf3, + 0x10, 0x88, 0xf8, 0xbd, 0x41, 0xbe, 0x01, 0x00, 0xbc, 0x9c, 0x08, 0x00, + 0xc0, 0xf5, 0x08, 0x00, 0x30, 0xf5, 0x08, 0x00, 0x40, 0xbe, 0x01, 0x00, + 0xd0, 0x9c, 0x08, 0x00, 0x20, 0x36, 0x01, 0x00, 0xd0, 0xbb, 0x01, 0x00, + 0xc0, 0x9c, 0x08, 0x00, 0xc8, 0x9c, 0x08, 0x00, 0x2d, 0xe9, 0xf8, 0x43, + 0x00, 0x28, 0x44, 0xd0, 0x08, 0x9e, 0x00, 0x2e, 0x41, 0xd0, 0x03, 0x31, + 0x04, 0x46, 0x42, 0x73, 0x00, 0x20, 0x21, 0xf0, 0x03, 0x07, 0x99, 0x07, + 0xa2, 0x72, 0x20, 0x73, 0x60, 0x60, 0xc3, 0xf3, 0xc0, 0x05, 0x02, 0xea, + 0xe1, 0x71, 0xa5, 0x73, 0x27, 0x81, 0x52, 0x1a, 0x00, 0x29, 0xe2, 0x72, + 0x0a, 0x46, 0x18, 0xbf, 0x06, 0xf1, 0x08, 0x02, 0x22, 0x60, 0x91, 0xb3, + 0x07, 0xf1, 0x0c, 0x03, 0x4f, 0xf6, 0xfc, 0x76, 0xdf, 0xf8, 0x60, 0xc0, + 0xdf, 0xf8, 0x60, 0x80, 0x4f, 0xf0, 0x08, 0x0e, 0x03, 0xea, 0x06, 0x09, + 0xbc, 0xf8, 0x00, 0x60, 0xbb, 0xb2, 0xd6, 0x52, 0x02, 0xeb, 0x09, 0x06, + 0x12, 0xfa, 0x87, 0xf3, 0x42, 0xe9, 0x02, 0x06, 0x98, 0xf8, 0x00, 0x70, + 0x9f, 0x70, 0xeb, 0x07, 0x06, 0xd0, 0xbe, 0xf8, 0x00, 0x30, 0x13, 0x44, + 0xd8, 0x71, 0x98, 0x71, 0x58, 0x71, 0x18, 0x71, 0x01, 0x39, 0x0b, 0x06, + 0x0a, 0xd0, 0xa5, 0x7b, 0x27, 0x89, 0x32, 0x46, 0xe2, 0xe7, 0x00, 0x20, + 0x4f, 0xf4, 0x13, 0x71, 0x00, 0x24, 0xce, 0xf7, 0x6b, 0xfb, 0x02, 0xe0, + 0x00, 0x20, 0x42, 0xf8, 0x04, 0x0c, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x83, + 0x2a, 0xba, 0x01, 0x00, 0x3e, 0xbe, 0x01, 0x00, 0x00, 0x28, 0x43, 0xd0, + 0x2d, 0xe9, 0xf0, 0x41, 0x05, 0x46, 0x50, 0xf8, 0x08, 0x0c, 0x90, 0x46, + 0x0c, 0x46, 0x06, 0x89, 0x20, 0xb9, 0x00, 0x20, 0x40, 0xf2, 0xaa, 0x21, + 0xce, 0xf7, 0x50, 0xfb, 0x21, 0x49, 0xa8, 0x5b, 0xaf, 0x19, 0x09, 0x88, + 0x88, 0x42, 0x04, 0xd0, 0x00, 0x20, 0x40, 0xf2, 0xad, 0x21, 0xce, 0xf7, + 0x45, 0xfb, 0x1d, 0x48, 0xb9, 0x78, 0x00, 0x78, 0x81, 0x42, 0x04, 0xd0, + 0x00, 0x20, 0x4f, 0xf4, 0x2c, 0x71, 0xce, 0xf7, 0x3b, 0xfb, 0x19, 0x48, + 0x00, 0x78, 0xb8, 0x70, 0x18, 0x4f, 0x72, 0xb6, 0x38, 0x68, 0x40, 0x00, + 0x01, 0x30, 0x38, 0x60, 0x20, 0x46, 0xc0, 0x47, 0xc8, 0xb1, 0x50, 0xf8, + 0x04, 0x1c, 0x45, 0xf8, 0x04, 0x1c, 0x61, 0x68, 0x40, 0xf8, 0x04, 0x5c, + 0x81, 0x42, 0x00, 0xd1, 0x65, 0x60, 0x20, 0x7a, 0x01, 0x30, 0x20, 0x72, + 0x38, 0x68, 0x40, 0x08, 0x38, 0x60, 0x38, 0x68, 0x80, 0xf3, 0x10, 0x88, + 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0x20, 0x40, 0xf2, 0xa5, 0x21, 0xd4, 0xf7, + 0x77, 0xb9, 0xd4, 0xe9, 0x00, 0x01, 0x25, 0x60, 0x00, 0x29, 0x45, 0xf8, + 0x04, 0x0c, 0xe8, 0xd1, 0xe6, 0xe7, 0x00, 0xbf, 0x2a, 0xba, 0x01, 0x00, + 0x3e, 0xbe, 0x01, 0x00, 0x3f, 0xbe, 0x01, 0x00, 0x24, 0x36, 0x01, 0x00, + 0x04, 0x48, 0x05, 0x49, 0x01, 0x60, 0x05, 0x48, 0x05, 0x49, 0x01, 0x60, + 0x05, 0x48, 0x06, 0x49, 0x01, 0x60, 0x70, 0x47, 0x10, 0xfa, 0x08, 0x00, + 0x65, 0x25, 0x05, 0x00, 0xd4, 0xdb, 0x08, 0x00, 0x7d, 0x27, 0x05, 0x00, + 0x30, 0x9d, 0x08, 0x00, 0xd9, 0x27, 0x05, 0x00, 0x49, 0xf6, 0x21, 0x3c, + 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x80, 0xb5, 0x09, 0x48, + 0x09, 0x4a, 0x01, 0x68, 0x92, 0xf8, 0x6d, 0x21, 0x6f, 0xea, 0x12, 0x12, + 0x52, 0x08, 0x62, 0xf3, 0x41, 0x01, 0x01, 0x60, 0x0a, 0xf0, 0x00, 0xf8, + 0x00, 0xf0, 0x10, 0xf8, 0xbd, 0xe8, 0x80, 0x40, 0xd8, 0xf7, 0x90, 0xbe, + 0xb8, 0x11, 0x00, 0x40, 0x50, 0xec, 0x01, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x30, 0x9f, 0x08, 0x00, 0x2d, 0x2a, 0x05, 0x00, + 0x42, 0xf6, 0x21, 0x3c, 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x80, 0xb5, 0x18, 0x48, 0x90, 0xf8, 0x3c, 0x10, 0x11, 0xf0, 0x1e, 0x0f, + 0x19, 0xd1, 0x38, 0x30, 0x42, 0x78, 0x01, 0x78, 0x02, 0xf0, 0x03, 0x02, + 0x42, 0xea, 0x91, 0x11, 0x89, 0xb9, 0x41, 0x79, 0x80, 0x79, 0x00, 0xf0, + 0x01, 0x00, 0x40, 0xea, 0x51, 0x10, 0x50, 0xb9, 0x0e, 0x48, 0x85, 0x21, + 0xa0, 0xf8, 0x28, 0x11, 0x84, 0x21, 0xa0, 0xf8, 0x1a, 0x11, 0x42, 0xf2, + 0xa8, 0x31, 0xc0, 0xf8, 0x14, 0x11, 0x00, 0xf0, 0x87, 0xfa, 0x09, 0x48, + 0x01, 0x68, 0x30, 0x20, 0x88, 0x47, 0x08, 0x48, 0x08, 0x49, 0x02, 0x68, + 0x30, 0x20, 0x90, 0x47, 0x07, 0x48, 0x01, 0x68, 0x30, 0x20, 0xbd, 0xe8, + 0x80, 0x40, 0x08, 0x47, 0x50, 0xec, 0x01, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0xb4, 0x9c, 0x08, 0x00, 0xac, 0x9c, 0x08, 0x00, 0xf5, 0x2a, 0x05, 0x00, + 0xb0, 0x9c, 0x08, 0x00, 0x0a, 0x49, 0x0b, 0x48, 0x42, 0xf2, 0x30, 0x03, + 0x0a, 0x68, 0x1a, 0x42, 0x02, 0xd0, 0x42, 0x68, 0x01, 0x32, 0x42, 0x60, + 0x09, 0x68, 0x42, 0xf2, 0xb4, 0x02, 0x11, 0x42, 0x01, 0xd0, 0x00, 0xf0, + 0x61, 0xba, 0x01, 0x68, 0x01, 0x31, 0x01, 0x60, 0x00, 0xf0, 0x5c, 0xba, + 0x28, 0x40, 0x01, 0x30, 0xb0, 0xf0, 0x05, 0x00, 0x80, 0xb5, 0x00, 0xf0, + 0x5b, 0xfa, 0xe4, 0x48, 0xb0, 0xf8, 0x6c, 0x15, 0x49, 0x06, 0x03, 0xd5, + 0x90, 0xf8, 0x72, 0x05, 0xff, 0x28, 0x00, 0xd0, 0x80, 0xbd, 0x05, 0x48, + 0x00, 0x78, 0x00, 0x28, 0xfa, 0xd0, 0x04, 0x48, 0x04, 0x49, 0x00, 0x68, + 0x09, 0x68, 0xbd, 0xe8, 0x80, 0x40, 0x08, 0x47, 0x54, 0x3b, 0x01, 0x00, + 0x34, 0x02, 0x01, 0x00, 0x20, 0x9f, 0x08, 0x00, 0x05, 0x48, 0x01, 0x68, + 0x41, 0xf0, 0x18, 0x01, 0x01, 0x60, 0xd0, 0xf8, 0xe8, 0x10, 0x41, 0xf0, + 0x80, 0x71, 0xc0, 0xf8, 0xe8, 0x10, 0x70, 0x47, 0x14, 0xed, 0x00, 0xe0, + 0x2d, 0xe9, 0xfe, 0x4f, 0x80, 0x46, 0x00, 0x20, 0x02, 0x21, 0x00, 0x25, + 0x00, 0xf0, 0xda, 0xf9, 0xc2, 0x48, 0x00, 0x68, 0x80, 0x47, 0xc2, 0x4e, + 0x70, 0x60, 0x30, 0x68, 0x40, 0xf0, 0x01, 0x00, 0x30, 0x60, 0xc0, 0x48, + 0x00, 0x68, 0x80, 0x47, 0xbf, 0x48, 0x00, 0x68, 0x80, 0x47, 0xbf, 0x48, + 0x00, 0x68, 0x80, 0x69, 0x00, 0xb1, 0x80, 0x47, 0xbd, 0x48, 0x00, 0x68, + 0x80, 0x47, 0xbd, 0x48, 0xbd, 0x4f, 0x00, 0x68, 0x01, 0x90, 0xc7, 0xf8, + 0xfc, 0x50, 0xc7, 0xf8, 0x00, 0x51, 0xb8, 0x68, 0x40, 0xf0, 0x80, 0x00, + 0xb8, 0x60, 0x30, 0x68, 0x40, 0xf0, 0x02, 0x00, 0x30, 0x60, 0xb7, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x30, 0x68, 0xb7, 0x4a, 0x40, 0xf0, 0x04, 0x00, + 0x30, 0x60, 0xb4, 0x48, 0xd0, 0xf8, 0x10, 0x11, 0x11, 0x60, 0xb4, 0x4a, + 0x31, 0x68, 0x41, 0xf0, 0x08, 0x01, 0x31, 0x60, 0x01, 0x21, 0xf9, 0x61, + 0x13, 0x68, 0x43, 0xf0, 0x04, 0x03, 0x13, 0x60, 0x79, 0x60, 0xf9, 0x6d, + 0x41, 0xf0, 0x01, 0x01, 0xf9, 0x65, 0x31, 0x68, 0x41, 0xf0, 0x10, 0x01, + 0x31, 0x60, 0x90, 0xf8, 0x74, 0x12, 0x19, 0xb1, 0xa9, 0x4a, 0x12, 0x88, + 0x51, 0x43, 0x8d, 0x1e, 0x00, 0xf5, 0x82, 0x74, 0xa7, 0x48, 0x41, 0x1c, + 0x28, 0x46, 0x88, 0x47, 0xa6, 0x48, 0x00, 0x68, 0x80, 0x47, 0xa6, 0x48, + 0x00, 0x78, 0x20, 0xb1, 0x00, 0x20, 0x4f, 0xf4, 0xb7, 0x71, 0xce, 0xf7, + 0xd7, 0xf9, 0xa3, 0x48, 0x00, 0x7f, 0x02, 0x28, 0x04, 0xd0, 0x00, 0x20, + 0x40, 0xf2, 0x6f, 0x11, 0xce, 0xf7, 0xce, 0xf9, 0x20, 0x68, 0x02, 0x94, + 0x78, 0x63, 0x9e, 0x48, 0xd8, 0xf8, 0x00, 0x10, 0x02, 0x68, 0xd8, 0xf8, + 0x08, 0x00, 0x00, 0x29, 0x18, 0xbf, 0x01, 0x21, 0x90, 0x47, 0x9a, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x30, 0x68, 0x02, 0x21, 0x4f, 0xf0, 0x01, 0x0b, + 0x40, 0xf0, 0x20, 0x00, 0x30, 0x60, 0x01, 0x20, 0x00, 0xf0, 0x58, 0xf9, + 0x87, 0x49, 0xdf, 0xf8, 0x50, 0x92, 0xb8, 0x46, 0x93, 0x4d, 0x94, 0x4f, + 0xdf, 0xf8, 0x50, 0xa2, 0xd1, 0xf8, 0x9c, 0x00, 0x20, 0xf0, 0x04, 0x00, + 0xc1, 0xf8, 0x9c, 0x00, 0x72, 0xb6, 0xd9, 0xf8, 0x00, 0x00, 0x40, 0x00, + 0x01, 0x30, 0xc9, 0xf8, 0x00, 0x00, 0x78, 0x59, 0x79, 0x59, 0x21, 0xf0, + 0x01, 0x01, 0x79, 0x51, 0x8b, 0x49, 0xca, 0xf8, 0x04, 0x10, 0x78, 0x51, + 0xd9, 0xf8, 0x00, 0x00, 0x40, 0x08, 0xc9, 0xf8, 0x00, 0x00, 0xd9, 0xf8, + 0x00, 0x00, 0x80, 0xf3, 0x10, 0x88, 0x86, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x04, 0x46, 0x72, 0xb6, 0xd9, 0xf8, 0x00, 0x00, 0x40, 0x00, 0x01, 0x30, + 0xc9, 0xf8, 0x00, 0x00, 0x78, 0x59, 0x79, 0x59, 0x21, 0xf0, 0x01, 0x01, + 0x79, 0x51, 0x7f, 0x49, 0xca, 0xf8, 0x04, 0x10, 0x78, 0x51, 0xd9, 0xf8, + 0x00, 0x00, 0x40, 0x08, 0xc9, 0xf8, 0x00, 0x00, 0xd9, 0xf8, 0x00, 0x00, + 0x80, 0xf3, 0x10, 0x88, 0x00, 0xf0, 0x68, 0xf9, 0x00, 0x2c, 0xc2, 0x46, + 0x4c, 0xd0, 0x30, 0x68, 0x60, 0x4c, 0x40, 0xf4, 0x80, 0x70, 0x30, 0x60, + 0x00, 0x20, 0xc8, 0xf8, 0x00, 0x00, 0xc7, 0xf8, 0x08, 0xb0, 0xc7, 0xf8, + 0x00, 0xb0, 0xc7, 0xf8, 0x04, 0xb0, 0x20, 0x68, 0xc0, 0x69, 0x00, 0xb1, + 0x80, 0x47, 0x6e, 0x48, 0x00, 0x68, 0x80, 0x47, 0x9a, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x6c, 0x48, 0x00, 0x68, 0x80, 0x47, 0x6b, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x6b, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x6a, 0x48, + 0xd0, 0xf8, 0x00, 0x80, 0x69, 0x48, 0x00, 0x68, 0x80, 0x47, 0x69, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x68, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x20, + 0x08, 0x21, 0x00, 0x25, 0x00, 0xf0, 0xdc, 0xf8, 0x65, 0x48, 0x01, 0x68, + 0x30, 0x20, 0x88, 0x47, 0x47, 0x48, 0x01, 0x99, 0x01, 0x60, 0x21, 0x68, + 0x30, 0x68, 0x02, 0x9c, 0x09, 0x6a, 0x40, 0xf4, 0x80, 0x30, 0x30, 0x60, + 0x11, 0xb1, 0x01, 0x20, 0x88, 0x47, 0x30, 0x68, 0xb1, 0x68, 0x35, 0x82, + 0x40, 0xf4, 0x00, 0x70, 0x01, 0x27, 0x01, 0x31, 0xb1, 0x60, 0x33, 0xe0, + 0x7a, 0x48, 0x00, 0x68, 0x80, 0x47, 0x30, 0x68, 0x08, 0x21, 0x40, 0xf4, + 0x80, 0x50, 0x30, 0x60, 0x00, 0x20, 0x00, 0xf0, 0xb7, 0xf8, 0x35, 0x4c, + 0x20, 0x68, 0xc0, 0x69, 0x00, 0xb1, 0x80, 0x47, 0x48, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x48, 0x48, 0x00, 0x68, 0x80, 0x47, 0x48, 0x48, 0x01, 0x68, + 0x00, 0x20, 0x88, 0x47, 0x4c, 0x48, 0x00, 0x68, 0x80, 0x47, 0x4c, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x21, 0x68, 0x30, 0x68, 0x02, 0x9c, 0x09, 0x6a, + 0x40, 0xf4, 0x80, 0x30, 0x30, 0x60, 0x11, 0xb1, 0x00, 0x20, 0x88, 0x47, + 0x30, 0x68, 0xf1, 0x68, 0x40, 0xf4, 0x00, 0x50, 0x00, 0x27, 0x01, 0x31, + 0xf1, 0x60, 0x31, 0x8a, 0x01, 0x31, 0x31, 0x82, 0x30, 0x60, 0x41, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x00, 0x20, 0xca, 0xf8, 0x5c, 0x00, 0x60, 0x68, + 0xca, 0xf8, 0x34, 0x00, 0x30, 0x68, 0x40, 0xf4, 0xc0, 0x20, 0x30, 0x60, + 0x3b, 0x48, 0x00, 0x68, 0x80, 0x47, 0x01, 0x20, 0x08, 0x21, 0x00, 0xf0, + 0x79, 0xf8, 0x39, 0x48, 0x00, 0x68, 0x80, 0x47, 0xaf, 0xb1, 0x38, 0x4d, + 0x41, 0x46, 0x28, 0x88, 0x01, 0x30, 0x28, 0x80, 0x36, 0x48, 0x02, 0x68, + 0x2a, 0x48, 0x00, 0x68, 0x90, 0x47, 0xa2, 0x8a, 0x81, 0xb2, 0xa8, 0x80, + 0x91, 0x42, 0x02, 0xd9, 0x6a, 0x88, 0x01, 0x32, 0x6a, 0x80, 0xea, 0x88, + 0x8a, 0x42, 0x38, 0xbf, 0xe8, 0x80, 0xd9, 0xf8, 0x00, 0x00, 0x40, 0x08, + 0xc9, 0xf8, 0x00, 0x00, 0xd9, 0xf8, 0x00, 0x00, 0x80, 0xf3, 0x10, 0x88, + 0xbd, 0xe8, 0xfe, 0x8f, 0x84, 0x9c, 0x08, 0x00, 0xc8, 0xbf, 0x01, 0x00, + 0x24, 0x9f, 0x08, 0x00, 0x64, 0x36, 0x01, 0x00, 0x48, 0x36, 0x01, 0x00, + 0x78, 0x9f, 0x08, 0x00, 0x98, 0x60, 0x01, 0x30, 0x04, 0x40, 0x01, 0x30, + 0x88, 0x9f, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x1c, 0xf0, 0x00, 0x30, + 0x10, 0xed, 0x00, 0xe0, 0x34, 0xec, 0x01, 0x00, 0x40, 0xec, 0x01, 0x00, + 0x8c, 0x9f, 0x08, 0x00, 0xdb, 0xb8, 0x01, 0x00, 0x18, 0x74, 0x01, 0x00, + 0x34, 0x9f, 0x08, 0x00, 0x44, 0x9f, 0x08, 0x00, 0x24, 0x36, 0x01, 0x00, + 0xc8, 0xfe, 0xff, 0xff, 0x00, 0x13, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, + 0xfd, 0x29, 0x01, 0x10, 0xb8, 0x12, 0x01, 0x00, 0xe1, 0x0e, 0x00, 0x10, + 0x64, 0x9f, 0x08, 0x00, 0x48, 0x9f, 0x08, 0x00, 0x24, 0xbc, 0x08, 0x00, + 0x38, 0x9f, 0x08, 0x00, 0x24, 0x20, 0x00, 0x40, 0x30, 0x9f, 0x08, 0x00, + 0x1c, 0xa3, 0x08, 0x00, 0x7c, 0x9f, 0x08, 0x00, 0x40, 0x9f, 0x08, 0x00, + 0x68, 0x36, 0x01, 0x00, 0x84, 0x9f, 0x08, 0x00, 0x80, 0x9f, 0x08, 0x00, + 0x28, 0x9f, 0x08, 0x00, 0x4c, 0x9f, 0x08, 0x00, 0xb6, 0xfc, 0x05, 0x00, + 0x1c, 0x9d, 0x08, 0x00, 0x0b, 0x4a, 0x12, 0x78, 0x0a, 0x2a, 0x11, 0xd1, + 0x0a, 0x4a, 0x09, 0x02, 0x38, 0xb1, 0x10, 0x68, 0x88, 0x43, 0x10, 0x60, + 0x08, 0x48, 0x02, 0x88, 0x22, 0xea, 0x01, 0x01, 0x05, 0xe0, 0x10, 0x68, + 0x08, 0x43, 0x10, 0x60, 0x04, 0x48, 0x02, 0x88, 0x11, 0x43, 0x01, 0x80, + 0x70, 0x47, 0x00, 0xbf, 0x8c, 0x01, 0x01, 0x00, 0x04, 0x08, 0x00, 0x40, + 0x26, 0x21, 0x01, 0x00, 0x01, 0x68, 0x02, 0x4a, 0x11, 0x60, 0xff, 0xf7, + 0xfb, 0xbd, 0x00, 0xbf, 0x0c, 0xdb, 0x05, 0x00, 0x06, 0x48, 0x07, 0x49, + 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, + 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x68, 0x9f, 0x08, 0x00, 0x29, 0x2b, 0x05, 0x00, 0x04, 0x8e, 0x08, 0x00, + 0x79, 0x2a, 0x05, 0x00, 0xbc, 0x12, 0x01, 0x00, 0x65, 0x2b, 0x05, 0x00, + 0x88, 0x8e, 0x08, 0x00, 0x81, 0x2f, 0x05, 0x00, 0x42, 0xf6, 0x39, 0x5c, + 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x42, 0xf6, 0xbd, 0x6c, + 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x43, 0xf2, 0x01, 0x2c, + 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf2, 0xc9, 0x2c, + 0xc1, 0xf2, 0x02, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x2d, 0xe9, 0xf0, 0x41, + 0x24, 0x48, 0x00, 0x78, 0x08, 0xb1, 0xbd, 0xe8, 0xf0, 0x81, 0x89, 0x4c, + 0x20, 0x68, 0xa0, 0xf5, 0x20, 0x50, 0x20, 0x60, 0x00, 0xf0, 0x3c, 0xf9, + 0xdf, 0xf8, 0x80, 0x80, 0x1e, 0x4d, 0x41, 0x4f, 0x98, 0xf8, 0xc3, 0x11, + 0x28, 0x68, 0xc1, 0xeb, 0x01, 0x11, 0xa0, 0xeb, 0x41, 0x12, 0x49, 0x01, + 0xb2, 0xf5, 0x00, 0x2f, 0x1d, 0xd9, 0x42, 0x1a, 0x4f, 0xf4, 0xda, 0x63, + 0x18, 0x4e, 0x38, 0x60, 0xa2, 0xf5, 0x00, 0x22, 0xb2, 0xfb, 0xf3, 0xf2, + 0x96, 0xf8, 0x11, 0x65, 0x01, 0x32, 0xd2, 0xb2, 0xb2, 0x42, 0x38, 0xbf, + 0x16, 0x46, 0x16, 0xfb, 0x03, 0x11, 0x41, 0x1a, 0xb1, 0xf5, 0x00, 0x2f, + 0x29, 0x60, 0x79, 0x60, 0x09, 0xd9, 0x00, 0x20, 0xc7, 0x21, 0xcd, 0xf7, + 0xc7, 0xff, 0x29, 0x68, 0x03, 0xe0, 0x41, 0x1a, 0x29, 0x60, 0xc7, 0xe9, + 0x00, 0x01, 0x98, 0xf8, 0x7f, 0x01, 0xa1, 0xeb, 0x00, 0x22, 0x20, 0x68, + 0xc7, 0xe9, 0x02, 0x12, 0x2a, 0x60, 0x11, 0x1a, 0xbd, 0xe8, 0xf0, 0x41, + 0x00, 0xf0, 0x65, 0xb9, 0x70, 0xc0, 0x01, 0x00, 0x74, 0xc0, 0x01, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x10, 0xb5, 0x3a, 0x4a, + 0x01, 0x46, 0x10, 0x78, 0x28, 0xb1, 0x39, 0x48, 0x72, 0xb6, 0x03, 0x68, + 0x5b, 0x00, 0x01, 0x33, 0x03, 0x60, 0x1a, 0x4b, 0x07, 0x31, 0x21, 0xf0, + 0x07, 0x01, 0xd3, 0xe9, 0x00, 0x40, 0x01, 0x44, 0xa1, 0x42, 0x94, 0xbf, + 0x59, 0x60, 0x00, 0x20, 0x11, 0x78, 0x31, 0xb1, 0x2f, 0x49, 0x0a, 0x68, + 0x52, 0x08, 0x0a, 0x60, 0x09, 0x68, 0x81, 0xf3, 0x10, 0x88, 0x10, 0xbd, + 0x10, 0xb5, 0x2a, 0x4a, 0x01, 0x46, 0x10, 0x78, 0x28, 0xb1, 0x29, 0x48, + 0x72, 0xb6, 0x03, 0x68, 0x5b, 0x00, 0x01, 0x33, 0x03, 0x60, 0x0a, 0x4b, + 0x07, 0x31, 0x21, 0xf0, 0x07, 0x01, 0xd3, 0xe9, 0x02, 0x40, 0x01, 0x44, + 0xa1, 0x42, 0x94, 0xbf, 0xd9, 0x60, 0x00, 0x20, 0x11, 0x78, 0x31, 0xb1, + 0x1f, 0x49, 0x0a, 0x68, 0x52, 0x08, 0x0a, 0x60, 0x09, 0x68, 0x81, 0xf3, + 0x10, 0x88, 0x10, 0xbd, 0xc0, 0xfc, 0x05, 0x00, 0x10, 0xb5, 0x19, 0x4c, + 0x01, 0x46, 0x20, 0x78, 0x28, 0xb1, 0x18, 0x48, 0x72, 0xb6, 0x02, 0x68, + 0x52, 0x00, 0x01, 0x32, 0x02, 0x60, 0x3c, 0x48, 0x00, 0x68, 0x00, 0xf0, + 0x2d, 0xf9, 0x21, 0x78, 0x31, 0xb1, 0x12, 0x49, 0x0a, 0x68, 0x52, 0x08, + 0x0a, 0x60, 0x09, 0x68, 0x81, 0xf3, 0x10, 0x88, 0x10, 0xbd, 0x00, 0xbf, + 0x10, 0xb5, 0x0c, 0x4c, 0x01, 0x46, 0x20, 0x78, 0x28, 0xb1, 0x0b, 0x48, + 0x72, 0xb6, 0x02, 0x68, 0x52, 0x00, 0x01, 0x32, 0x02, 0x60, 0x2f, 0x48, + 0x00, 0x68, 0x00, 0xf0, 0xd1, 0xf9, 0x20, 0x78, 0x30, 0xb1, 0x05, 0x48, + 0x01, 0x68, 0x49, 0x08, 0x01, 0x60, 0x00, 0x68, 0x80, 0xf3, 0x10, 0x88, + 0x10, 0xbd, 0x00, 0xbf, 0xde, 0xb8, 0x01, 0x00, 0x24, 0x36, 0x01, 0x00, + 0x2d, 0xe9, 0xf0, 0x41, 0x86, 0xb0, 0x24, 0x48, 0x01, 0xa9, 0x01, 0x22, + 0x00, 0x68, 0x00, 0xf0, 0x2d, 0xfa, 0x01, 0xad, 0xdf, 0xf8, 0x84, 0x80, + 0x04, 0x98, 0x21, 0x4c, 0x26, 0xcd, 0x8e, 0x1a, 0xd8, 0xf8, 0x00, 0x20, + 0x05, 0x99, 0xaa, 0x42, 0x03, 0xd1, 0x1e, 0x4a, 0x12, 0x68, 0xb2, 0x42, + 0x0f, 0xd0, 0xc4, 0xe9, 0x00, 0x61, 0xc4, 0xe9, 0x02, 0x50, 0x1b, 0x48, + 0x18, 0x4a, 0x00, 0x21, 0x10, 0x23, 0x07, 0x68, 0x40, 0xf2, 0x0c, 0x70, + 0xb8, 0x47, 0x16, 0x48, 0xc8, 0xf8, 0x00, 0x50, 0x06, 0x60, 0x16, 0x4d, + 0x16, 0x4e, 0x28, 0x68, 0x31, 0x68, 0x81, 0x42, 0x02, 0xd0, 0x15, 0x49, + 0x09, 0x68, 0x05, 0xe0, 0x13, 0x49, 0x14, 0x4a, 0x09, 0x68, 0x12, 0x68, + 0x8a, 0x42, 0x0f, 0xd0, 0x42, 0x1a, 0x07, 0xc4, 0x0c, 0x48, 0x00, 0x21, + 0x0c, 0x23, 0x09, 0x4a, 0x04, 0x68, 0x40, 0xf2, 0x0b, 0x70, 0xa0, 0x47, + 0x28, 0x68, 0x0c, 0x49, 0x30, 0x60, 0x0a, 0x48, 0x00, 0x68, 0x08, 0x60, + 0x06, 0xb0, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, 0x78, 0xc0, 0x01, 0x00, + 0x8c, 0xc0, 0x01, 0x00, 0x8c, 0x34, 0x01, 0x00, 0x90, 0xc0, 0x01, 0x00, + 0x78, 0x9b, 0x08, 0x00, 0x30, 0x36, 0x01, 0x00, 0x94, 0xc0, 0x01, 0x00, + 0x2c, 0x36, 0x01, 0x00, 0x98, 0xc0, 0x01, 0x00, 0x06, 0x48, 0x07, 0x49, + 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x08, 0x49, + 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0xdc, 0x9b, 0x08, 0x00, 0x29, 0x31, 0x05, 0x00, 0xd8, 0x9d, 0x08, 0x00, + 0xfd, 0x2f, 0x05, 0x00, 0xe0, 0x9b, 0x08, 0x00, 0x5d, 0x31, 0x05, 0x00, + 0x8c, 0x8e, 0x08, 0x00, 0x99, 0x31, 0x05, 0x00, 0x4c, 0xf6, 0x21, 0x1c, + 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0xb0, 0xb5, 0x05, 0x46, + 0xc0, 0x68, 0x0c, 0x46, 0x88, 0x42, 0x04, 0xd1, 0x00, 0x20, 0xa8, 0x21, + 0xcd, 0xf7, 0xa6, 0xfe, 0xe8, 0x68, 0x20, 0xb9, 0x00, 0x20, 0xa9, 0x21, + 0xcd, 0xf7, 0xa0, 0xfe, 0xe8, 0x68, 0x80, 0xb1, 0x05, 0x46, 0x80, 0x88, + 0x68, 0xb1, 0x05, 0xeb, 0x80, 0x00, 0xa0, 0x42, 0xf7, 0xd1, 0x81, 0x88, + 0x00, 0x29, 0x0f, 0xbf, 0x00, 0x20, 0x00, 0xeb, 0x81, 0x00, 0x40, 0x1b, + 0x80, 0x08, 0xa8, 0x80, 0x04, 0xe0, 0x00, 0x20, 0xd2, 0x21, 0x00, 0x25, + 0xcd, 0xf7, 0x88, 0xfe, 0x28, 0x46, 0xb0, 0xbd, 0x2d, 0xe9, 0xf0, 0x41, + 0xc7, 0x68, 0x0c, 0x46, 0x80, 0x46, 0x9f, 0xb1, 0xa7, 0x42, 0x15, 0xd2, + 0xb8, 0x88, 0x3e, 0x46, 0x78, 0xb1, 0x01, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, + 0x04, 0xdc, 0x00, 0x20, 0xf4, 0x21, 0xcd, 0xf7, 0x73, 0xfe, 0xb0, 0x88, + 0x06, 0xeb, 0x80, 0x07, 0xa7, 0x42, 0xef, 0xd3, 0x01, 0x25, 0x05, 0xe0, + 0x00, 0x26, 0x00, 0x27, 0x00, 0x25, 0x01, 0xe0, 0x01, 0x25, 0x00, 0x26, + 0xa6, 0x42, 0x18, 0xbf, 0xa7, 0x42, 0x03, 0xd1, 0x00, 0x20, 0xff, 0x21, + 0xcd, 0xf7, 0x5e, 0xfe, 0x1e, 0xb1, 0xa0, 0x1b, 0x80, 0x08, 0xb0, 0x80, + 0x01, 0xe0, 0xc8, 0xf8, 0x0c, 0x40, 0x15, 0xb1, 0x38, 0x1b, 0x80, 0x08, + 0x00, 0xe0, 0x00, 0x20, 0xa0, 0x80, 0xbd, 0xe8, 0xf0, 0x81, 0xb0, 0xb5, + 0x38, 0xb1, 0x19, 0x29, 0x05, 0xd3, 0x04, 0x46, 0x80, 0x07, 0x4f, 0xf0, + 0x00, 0x00, 0x02, 0xd0, 0xb0, 0xbd, 0x00, 0x20, 0xb0, 0xbd, 0xa1, 0xf1, + 0x10, 0x05, 0xb0, 0xeb, 0x55, 0x4f, 0xf7, 0xd1, 0x20, 0x46, 0x18, 0x21, + 0xcf, 0xf7, 0xe0, 0xff, 0xa8, 0x08, 0x00, 0x21, 0x24, 0xf8, 0x10, 0x0f, + 0x60, 0x80, 0x04, 0xeb, 0x80, 0x00, 0xa1, 0x80, 0x44, 0xe9, 0x02, 0x04, + 0x01, 0x20, 0xb0, 0xbd, 0x2d, 0xe9, 0xf8, 0x4f, 0x80, 0x46, 0xc8, 0x1c, + 0x00, 0x24, 0xb4, 0xeb, 0x90, 0x0f, 0x63, 0xd0, 0x59, 0x49, 0x88, 0x42, + 0x5f, 0xd8, 0xd8, 0xf8, 0x0c, 0x60, 0x00, 0x2e, 0x5b, 0xd0, 0x34, 0x46, + 0x85, 0x08, 0x34, 0xf8, 0x04, 0x0f, 0x18, 0xb3, 0x00, 0x27, 0xb6, 0xf9, + 0x02, 0x10, 0xb3, 0x46, 0xb1, 0xf1, 0xff, 0x3f, 0x05, 0xdc, 0x00, 0x20, + 0x40, 0xf2, 0x6f, 0x11, 0xcd, 0xf7, 0x0e, 0xfe, 0x20, 0x88, 0x00, 0xb2, + 0xb0, 0xf1, 0xff, 0x3f, 0x04, 0xdc, 0x00, 0x20, 0x4f, 0xf4, 0xb9, 0x71, + 0xcd, 0xf7, 0x04, 0xfe, 0xbb, 0xf8, 0x02, 0x00, 0x85, 0x42, 0x0c, 0xd3, + 0x20, 0x88, 0x5f, 0x46, 0x0b, 0xeb, 0x80, 0x06, 0x34, 0x46, 0x34, 0xf8, + 0x04, 0x0f, 0x00, 0x28, 0xdd, 0xd1, 0x04, 0xe0, 0x4f, 0xf0, 0x00, 0x0b, + 0x01, 0xe0, 0x5e, 0x46, 0xbb, 0x46, 0xb6, 0xf8, 0x02, 0x90, 0x4d, 0x45, + 0x29, 0xd2, 0x01, 0x35, 0xa9, 0xeb, 0x05, 0x0a, 0x1f, 0xfa, 0x8a, 0xf1, + 0x02, 0x29, 0x2d, 0xd3, 0x45, 0xf4, 0x00, 0x40, 0x06, 0xeb, 0x85, 0x07, + 0x26, 0xf8, 0x25, 0x50, 0x89, 0x46, 0x70, 0x80, 0x20, 0x88, 0xa7, 0xf8, + 0x02, 0xa0, 0x00, 0x28, 0x18, 0xbf, 0x40, 0x1b, 0xb8, 0x80, 0xbb, 0xf1, + 0x00, 0x0f, 0x29, 0xd0, 0xbb, 0xf8, 0x04, 0x00, 0x28, 0x44, 0xab, 0xf8, + 0x04, 0x00, 0x80, 0xb2, 0x0b, 0xeb, 0x80, 0x00, 0xb8, 0x42, 0x2b, 0xd0, + 0x00, 0x20, 0x40, 0xf2, 0xab, 0x11, 0xcd, 0xf7, 0xc5, 0xfd, 0x49, 0x46, + 0x24, 0xe0, 0x00, 0x24, 0xa0, 0x07, 0x04, 0xd0, 0x00, 0x20, 0x40, 0xf2, + 0xf5, 0x11, 0xcd, 0xf7, 0xbb, 0xfd, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x8f, + 0x49, 0xf4, 0x00, 0x40, 0xbb, 0xf1, 0x00, 0x0f, 0x70, 0x80, 0x20, 0x88, + 0x1e, 0xd0, 0x58, 0xb3, 0x06, 0xeb, 0x80, 0x00, 0xa0, 0xeb, 0x0b, 0x00, + 0x80, 0x08, 0x26, 0xe0, 0xd8, 0xf8, 0x0c, 0x00, 0xb0, 0x42, 0x05, 0xd0, + 0x00, 0x20, 0x4f, 0xf4, 0xce, 0x71, 0xcd, 0xf7, 0xa1, 0xfd, 0x49, 0x46, + 0xc8, 0xf8, 0x0c, 0x70, 0x07, 0xeb, 0x81, 0x00, 0xd8, 0xf8, 0x08, 0x10, + 0xa9, 0x46, 0x81, 0x42, 0x0c, 0xbf, 0xa8, 0xf8, 0x10, 0xa0, 0xa0, 0xf8, + 0x00, 0xa0, 0x14, 0xe0, 0x80, 0xb1, 0x01, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, + 0x05, 0xdc, 0x00, 0x20, 0x40, 0xf2, 0xcd, 0x11, 0xcd, 0xf7, 0x88, 0xfd, + 0x20, 0x88, 0x06, 0xeb, 0x80, 0x00, 0x04, 0xe0, 0x00, 0x20, 0xab, 0xf8, + 0x04, 0x00, 0x02, 0xe0, 0x00, 0x20, 0xc8, 0xf8, 0x0c, 0x00, 0xd8, 0xe9, + 0x00, 0x01, 0x48, 0x44, 0xc8, 0xf8, 0x00, 0x00, 0x81, 0x42, 0x38, 0xbf, + 0xc8, 0xf8, 0x04, 0x00, 0xb0, 0xe7, 0x00, 0xbf, 0xfb, 0xff, 0x01, 0x00, + 0x70, 0xb5, 0x04, 0x46, 0x14, 0x30, 0x88, 0x42, 0x07, 0xd8, 0xa2, 0x68, + 0x8a, 0x42, 0x04, 0xd9, 0x31, 0xf9, 0x02, 0x3c, 0xb3, 0xf1, 0xff, 0x3f, + 0x00, 0xdd, 0x70, 0xbd, 0x25, 0x68, 0x6f, 0xf3, 0xdf, 0x33, 0x26, 0x46, + 0x00, 0x20, 0x08, 0x80, 0x21, 0xf8, 0x02, 0x3c, 0xed, 0x1a, 0x46, 0xf8, + 0x10, 0x5b, 0x0d, 0x1f, 0xb5, 0x42, 0x0c, 0xd0, 0x28, 0x88, 0xa5, 0xeb, + 0x80, 0x01, 0xb1, 0xf9, 0x02, 0x00, 0x00, 0x28, 0x04, 0xd4, 0x18, 0x44, + 0x0d, 0x46, 0x48, 0x80, 0x01, 0x20, 0x00, 0xe0, 0x00, 0x20, 0x6b, 0x88, + 0x19, 0x46, 0x6f, 0xf3, 0xdf, 0x31, 0x05, 0xeb, 0x81, 0x01, 0x8a, 0x42, + 0x0c, 0xd9, 0xb1, 0xf9, 0x02, 0x20, 0x00, 0x2a, 0x08, 0xd4, 0x1a, 0x44, + 0x6a, 0x80, 0x8a, 0x88, 0x00, 0x2a, 0x18, 0xbf, 0x1a, 0x44, 0xaa, 0x80, + 0x80, 0xb1, 0x01, 0x20, 0x69, 0x88, 0xa3, 0x68, 0x05, 0xeb, 0x81, 0x02, + 0x93, 0x42, 0x0c, 0xbf, 0x31, 0x80, 0x11, 0x80, 0x00, 0x28, 0xc4, 0xd1, + 0x20, 0x46, 0x29, 0x46, 0xbd, 0xe8, 0x70, 0x40, 0xff, 0xf7, 0x9c, 0xbe, + 0xe0, 0x68, 0x88, 0x42, 0x10, 0xd0, 0x20, 0x46, 0xff, 0xf7, 0x6c, 0xfe, + 0x29, 0x1a, 0x8a, 0x08, 0x82, 0x80, 0x0d, 0x4a, 0x11, 0x40, 0x08, 0x44, + 0x85, 0x42, 0xe0, 0xd0, 0x00, 0x20, 0x40, 0xf2, 0x63, 0x21, 0xcd, 0xf7, + 0x0f, 0xfd, 0xda, 0xe7, 0x88, 0x88, 0x58, 0xb1, 0x01, 0xeb, 0x80, 0x00, + 0x91, 0xb2, 0x05, 0xeb, 0x81, 0x01, 0x88, 0x42, 0x04, 0xd0, 0x00, 0x20, + 0x40, 0xf2, 0x56, 0x21, 0xcd, 0xf7, 0x00, 0xfd, 0xe5, 0x60, 0xca, 0xe7, + 0xfc, 0xff, 0x03, 0x00, 0x70, 0xb5, 0x03, 0x46, 0x00, 0x20, 0x41, 0xb3, + 0xc1, 0xe9, 0x03, 0x00, 0x03, 0xf1, 0x10, 0x00, 0xd3, 0xe9, 0x00, 0x45, + 0x9b, 0x68, 0x4f, 0xea, 0x84, 0x04, 0xa3, 0xeb, 0x00, 0x06, 0x4c, 0x60, + 0x4f, 0xea, 0x85, 0x04, 0x0e, 0x60, 0x8c, 0x60, 0xb2, 0xb1, 0x00, 0x22, + 0x83, 0x42, 0x11, 0xd9, 0x00, 0x24, 0xb0, 0xf9, 0x02, 0x50, 0x00, 0x2d, + 0x06, 0xd4, 0x01, 0x34, 0xae, 0xb2, 0xcc, 0x60, 0xb2, 0x42, 0x3c, 0xbf, + 0x0e, 0x61, 0x32, 0x46, 0x6f, 0xf3, 0xdf, 0x35, 0x00, 0xeb, 0x85, 0x00, + 0x83, 0x42, 0xee, 0xd8, 0x90, 0x00, 0x08, 0x61, 0x01, 0x20, 0x70, 0xbd, + 0x00, 0x22, 0x00, 0xf0, 0x09, 0xb8, 0x00, 0xbf, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x84, 0xd4, 0x08, 0x00, 0x61, 0x36, 0x05, 0x00, + 0x42, 0xf2, 0x9d, 0x5c, 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x70, 0xb5, 0x04, 0x46, 0x22, 0x48, 0x15, 0x46, 0x03, 0x26, 0x02, 0x68, + 0x03, 0x20, 0x90, 0x47, 0x20, 0x48, 0x01, 0x68, 0x03, 0x20, 0x88, 0x47, + 0x1f, 0x48, 0x81, 0x2d, 0x1a, 0xd0, 0x01, 0x2d, 0x2d, 0xd1, 0xd0, 0xf8, + 0x14, 0x11, 0x03, 0x22, 0x62, 0xf3, 0x07, 0x11, 0xc0, 0xf8, 0x14, 0x11, + 0xd0, 0xf8, 0x18, 0x11, 0x62, 0xf3, 0x07, 0x11, 0xc0, 0xf8, 0x18, 0x11, + 0xd0, 0xf8, 0xf4, 0x11, 0x41, 0xf0, 0x20, 0x01, 0xc0, 0xf8, 0xf4, 0x11, + 0x01, 0x21, 0xc0, 0xf8, 0x80, 0x10, 0xc0, 0xf8, 0x84, 0x40, 0x14, 0xe0, + 0xd0, 0xf8, 0x0c, 0x11, 0x66, 0xf3, 0x07, 0x11, 0xc0, 0xf8, 0x0c, 0x11, + 0xd0, 0xf8, 0x10, 0x11, 0x66, 0xf3, 0x07, 0x11, 0xc0, 0xf8, 0x10, 0x11, + 0xd0, 0xf8, 0xf4, 0x11, 0x41, 0xf0, 0x02, 0x01, 0xc0, 0xf8, 0xf4, 0x11, + 0x01, 0x21, 0x01, 0x60, 0x84, 0x60, 0x01, 0x21, 0x00, 0x22, 0xc0, 0xf8, + 0xec, 0x11, 0xc0, 0xf8, 0xf0, 0x21, 0xc0, 0xf8, 0x6c, 0x11, 0x70, 0xbd, + 0xac, 0x9c, 0x08, 0x00, 0xb0, 0x9c, 0x08, 0x00, 0x14, 0x21, 0x00, 0x40, + 0x70, 0x47, 0x00, 0x00, 0xb0, 0xb5, 0x05, 0x4c, 0x25, 0x68, 0x23, 0x68, + 0x23, 0xf4, 0x7c, 0x13, 0x23, 0x60, 0x00, 0xf0, 0x05, 0xf8, 0x25, 0x60, + 0xb0, 0xbd, 0x00, 0xbf, 0x04, 0x00, 0x21, 0x40, 0x45, 0xf2, 0x61, 0x0c, + 0xc1, 0xf2, 0x11, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x03, 0x49, 0x09, 0x68, + 0x01, 0xb9, 0x03, 0x49, 0x01, 0xeb, 0x80, 0x00, 0x70, 0x47, 0x00, 0xbf, + 0xd8, 0xab, 0x01, 0x00, 0x48, 0xd4, 0x05, 0x00, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x90, 0xf3, 0x08, 0x00, 0x4d, 0x37, 0x05, 0x00, + 0x2d, 0xe9, 0xf0, 0x47, 0xdf, 0xf8, 0xb4, 0xa0, 0x80, 0x46, 0x0c, 0x46, + 0x0b, 0x26, 0xba, 0xf8, 0xc4, 0x00, 0xf1, 0xb2, 0x20, 0xfa, 0x01, 0xf1, + 0xc9, 0x07, 0x03, 0xd1, 0x01, 0x3e, 0x31, 0x06, 0xf7, 0xd1, 0x00, 0x26, + 0x00, 0x27, 0x20, 0xfa, 0x07, 0xf1, 0xc9, 0x07, 0x03, 0xd1, 0x01, 0x37, + 0x0b, 0x2f, 0xf8, 0xd1, 0x0b, 0x27, 0xf5, 0xb2, 0x5f, 0xfa, 0x87, 0xf9, + 0xa9, 0x45, 0x03, 0xd9, 0x00, 0x20, 0x5a, 0x21, 0xd3, 0xf7, 0x82, 0xfa, + 0xb8, 0xf1, 0x01, 0x0f, 0x14, 0xd0, 0xb8, 0xf1, 0x00, 0x0f, 0x18, 0xd1, + 0xa5, 0x42, 0x30, 0x46, 0x16, 0xd9, 0xa1, 0x45, 0x11, 0xd8, 0xba, 0xf8, + 0xc4, 0x10, 0x20, 0x46, 0xc2, 0xb2, 0x21, 0xfa, 0x02, 0xf2, 0xd2, 0x07, + 0x0c, 0xd1, 0x01, 0x38, 0xc2, 0xb2, 0x4a, 0x45, 0xf6, 0xd2, 0x07, 0xe0, + 0xa1, 0x45, 0x38, 0x46, 0x04, 0xd2, 0xa5, 0x42, 0x0d, 0xd2, 0x20, 0x46, + 0x00, 0xe0, 0x00, 0x20, 0xc1, 0xb2, 0x8d, 0x42, 0x28, 0xbf, 0x06, 0x46, + 0xf0, 0xb2, 0x81, 0x45, 0x38, 0xbf, 0x37, 0x46, 0xf8, 0xb2, 0xbd, 0xe8, + 0xf0, 0x87, 0xba, 0xf8, 0xc4, 0x10, 0x70, 0x1c, 0x22, 0x46, 0x21, 0xfa, + 0x04, 0xf3, 0xdb, 0x07, 0xe9, 0xd1, 0x53, 0x1c, 0xd2, 0xb2, 0x01, 0x34, + 0xaa, 0x42, 0x1a, 0x46, 0xf5, 0xd1, 0xe5, 0xe7, 0x8c, 0x7e, 0x08, 0x00, + 0x10, 0xb5, 0x00, 0xf0, 0x2d, 0xf8, 0x0c, 0x4c, 0x5a, 0x21, 0x20, 0x46, + 0xcf, 0xf7, 0x82, 0xfd, 0x04, 0xf1, 0x0a, 0x00, 0x00, 0x21, 0x4f, 0xf6, + 0x80, 0x72, 0x00, 0x23, 0x04, 0x46, 0x01, 0x33, 0x24, 0xf8, 0x02, 0x2b, + 0x04, 0x2b, 0xfa, 0xd1, 0x01, 0x31, 0x12, 0x30, 0x05, 0x29, 0xf4, 0xd1, + 0x02, 0x48, 0x00, 0x21, 0xc1, 0x72, 0x10, 0xbd, 0xd8, 0xdb, 0x05, 0x00, + 0x48, 0xdc, 0x05, 0x00, 0x03, 0x48, 0x04, 0x49, 0x01, 0x60, 0x04, 0x48, + 0x04, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, 0x08, 0x8e, 0x08, 0x00, + 0x35, 0x38, 0x05, 0x00, 0x50, 0xfb, 0x08, 0x00, 0x75, 0x37, 0x05, 0x00, + 0x46, 0xf6, 0x9f, 0x5c, 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x10, 0xb5, 0x0a, 0x4b, 0x42, 0xf6, 0x0b, 0x34, 0x1c, 0x60, 0x09, 0x4b, + 0x4f, 0xf0, 0x06, 0x04, 0x1c, 0x60, 0x08, 0x4b, 0x19, 0x60, 0x3a, 0xb1, + 0x07, 0x4b, 0x00, 0x21, 0x1c, 0x68, 0x01, 0x31, 0x91, 0x42, 0x20, 0xf8, + 0x02, 0x4b, 0xf9, 0xd1, 0x10, 0xbd, 0x00, 0xbf, 0x00, 0x08, 0x00, 0x40, + 0x10, 0xa0, 0x23, 0x40, 0xa8, 0x01, 0x23, 0x40, 0x08, 0x08, 0x00, 0x40, + 0x02, 0x48, 0x00, 0x68, 0x00, 0x28, 0x18, 0xbf, 0x01, 0x20, 0x70, 0x47, + 0xf8, 0x35, 0x01, 0x00, 0x01, 0x78, 0x01, 0x29, 0x06, 0xd1, 0x40, 0x78, + 0xc0, 0x07, 0x0c, 0xbf, 0x01, 0x21, 0x00, 0x21, 0x01, 0x48, 0x01, 0x70, + 0x70, 0x47, 0x00, 0xbf, 0x5c, 0xd4, 0x05, 0x00, 0xf8, 0xb5, 0x92, 0x4f, + 0x04, 0x46, 0x10, 0x4e, 0x38, 0x78, 0x06, 0xeb, 0x80, 0x00, 0x80, 0x78, + 0xa0, 0x42, 0x18, 0xbf, 0xf8, 0xbd, 0x0d, 0x46, 0x04, 0x20, 0x21, 0x46, + 0xd4, 0xf7, 0xe0, 0xfc, 0x38, 0x78, 0x3d, 0xb1, 0x36, 0xf8, 0x20, 0x10, + 0x01, 0x31, 0x26, 0xf8, 0x20, 0x10, 0x06, 0xeb, 0x80, 0x01, 0xcd, 0x70, + 0x06, 0xeb, 0x80, 0x00, 0xff, 0x21, 0x81, 0x70, 0x05, 0x20, 0x21, 0x46, + 0xbd, 0xe8, 0xf8, 0x40, 0xd4, 0xf7, 0xcc, 0xbc, 0x54, 0xd4, 0x05, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x8b, 0xb0, 0x02, 0x90, 0x01, 0x20, 0x00, 0xf0, + 0x19, 0xf9, 0x7b, 0x4b, 0x79, 0x4f, 0x9a, 0x46, 0xe8, 0xb1, 0xdf, 0xf8, + 0xe8, 0x81, 0x00, 0x24, 0x0d, 0xf1, 0x14, 0x09, 0x0d, 0xf1, 0x24, 0x0b, + 0x03, 0xad, 0x07, 0xae, 0x38, 0x68, 0x98, 0xf8, 0x00, 0x10, 0x49, 0xf8, + 0x21, 0x00, 0x18, 0x68, 0x4b, 0xf8, 0x21, 0x00, 0x38, 0x6d, 0x45, 0xf8, + 0x21, 0x00, 0x18, 0x6d, 0x46, 0xf8, 0x21, 0x00, 0xe0, 0xb2, 0x00, 0xf0, + 0xfb, 0xf8, 0x53, 0x46, 0x01, 0x3c, 0x00, 0x28, 0xea, 0xd1, 0x02, 0x98, + 0x08, 0xb1, 0x03, 0x28, 0x33, 0xd1, 0x6a, 0x4a, 0x92, 0xf8, 0x5a, 0x11, + 0x09, 0x07, 0x13, 0xd4, 0x92, 0xf8, 0x9c, 0x13, 0x11, 0xb9, 0x92, 0xf8, + 0x9d, 0x13, 0x69, 0xb1, 0x65, 0x4c, 0x66, 0x4a, 0x61, 0x6b, 0x62, 0xf3, + 0x1f, 0x31, 0x61, 0x63, 0x21, 0x68, 0x41, 0xf0, 0x01, 0x01, 0x21, 0x60, + 0x61, 0x68, 0x41, 0xf0, 0x00, 0x41, 0x61, 0x60, 0x08, 0xb1, 0x03, 0x28, + 0x17, 0xd1, 0x5f, 0x4d, 0x5f, 0x49, 0x60, 0x4a, 0x60, 0x4b, 0x61, 0x4c, + 0xc5, 0xe9, 0x01, 0x43, 0xc5, 0xe9, 0x03, 0x21, 0x04, 0x21, 0x53, 0x46, + 0x29, 0x70, 0x21, 0x68, 0x45, 0xf8, 0xf4, 0x1f, 0x01, 0x21, 0x2c, 0x1d, + 0x54, 0xf8, 0xf0, 0x2c, 0x01, 0x31, 0x04, 0x29, 0x12, 0x68, 0x04, 0xc4, + 0xf8, 0xd1, 0x1e, 0x46, 0x06, 0xf0, 0xd8, 0xfb, 0x56, 0x48, 0xbe, 0x4b, + 0x40, 0xf2, 0x1f, 0x32, 0x01, 0x68, 0x93, 0xf8, 0xd2, 0x41, 0x93, 0xf8, + 0xd3, 0x51, 0x44, 0xea, 0x05, 0x24, 0x91, 0x43, 0x22, 0x40, 0x11, 0x44, + 0x01, 0x60, 0x03, 0xf2, 0xcd, 0x10, 0x01, 0x90, 0x01, 0x20, 0x00, 0xf0, + 0xa7, 0xf8, 0x00, 0xb3, 0x5a, 0x4c, 0x3d, 0x46, 0x00, 0x27, 0x0d, 0xf1, + 0x14, 0x0a, 0x0d, 0xf1, 0x24, 0x0b, 0x0d, 0xf1, 0x0c, 0x08, 0x0d, 0xf1, + 0x1c, 0x09, 0x20, 0x78, 0x5a, 0xf8, 0x20, 0x00, 0x28, 0x60, 0x20, 0x78, + 0x5b, 0xf8, 0x20, 0x00, 0x30, 0x60, 0x20, 0x78, 0x58, 0xf8, 0x20, 0x00, + 0x28, 0x65, 0x20, 0x78, 0x59, 0xf8, 0x20, 0x00, 0x30, 0x65, 0xf8, 0xb2, + 0x00, 0xf0, 0x88, 0xf8, 0x01, 0x3f, 0x00, 0x28, 0xe9, 0xd1, 0x02, 0x9c, + 0x0c, 0xb1, 0x01, 0x2c, 0x02, 0xd1, 0x20, 0x46, 0x00, 0xf0, 0x90, 0xf8, + 0x01, 0x9e, 0x9d, 0x49, 0x30, 0x78, 0x4d, 0x1d, 0x00, 0x28, 0x4d, 0xd0, + 0x01, 0x20, 0x28, 0x70, 0x28, 0x78, 0x00, 0xf0, 0xdb, 0xf8, 0x28, 0x78, + 0x00, 0xf0, 0x38, 0xf9, 0x01, 0x2c, 0x15, 0xd1, 0x96, 0xf8, 0x68, 0x00, + 0x40, 0x07, 0x11, 0xd5, 0x00, 0x20, 0x00, 0x24, 0x00, 0xf0, 0xce, 0xf8, + 0x00, 0x20, 0x00, 0xf0, 0x2b, 0xf9, 0x00, 0x20, 0x00, 0xf0, 0x60, 0xf9, + 0x29, 0x48, 0x6c, 0x70, 0x2c, 0x70, 0x00, 0x68, 0x80, 0x47, 0x28, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x27, 0x48, 0x00, 0x68, 0x80, 0x47, 0x30, 0xbb, + 0x26, 0x48, 0x01, 0x68, 0x21, 0xf0, 0x70, 0x41, 0x01, 0x60, 0x41, 0x68, + 0x21, 0xf0, 0x40, 0x41, 0x41, 0x60, 0x23, 0x48, 0xc1, 0x69, 0x21, 0xf4, + 0xc0, 0x61, 0xc1, 0x61, 0x01, 0x68, 0x21, 0xf4, 0x40, 0x71, 0x01, 0x60, + 0x1f, 0x49, 0x0a, 0x68, 0x22, 0xf0, 0x70, 0x42, 0x0a, 0x60, 0x4a, 0x68, + 0x22, 0xf0, 0x40, 0x42, 0x4a, 0x60, 0xc1, 0x69, 0x21, 0xf4, 0xc0, 0x71, + 0xc1, 0x61, 0x41, 0x6a, 0x21, 0xf4, 0x40, 0x71, 0x41, 0x62, 0x01, 0x20, + 0xfe, 0x21, 0xcf, 0xf7, 0x87, 0xfe, 0x0b, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x02, 0x2c, 0xb1, 0xd0, 0x00, 0x28, 0xb5, 0xd0, 0xae, 0xe7, 0x00, 0xbf, + 0x50, 0x10, 0x21, 0x40, 0x38, 0x20, 0x21, 0x40, 0x74, 0x87, 0x08, 0x00, + 0x50, 0xec, 0x01, 0x00, 0x84, 0x48, 0x05, 0x30, 0x94, 0x52, 0x0a, 0x00, + 0xd0, 0xfc, 0x05, 0x00, 0x90, 0x78, 0x23, 0x40, 0x94, 0x78, 0x23, 0x40, + 0xc0, 0x78, 0x03, 0x40, 0xc4, 0x78, 0x03, 0x40, 0xdc, 0xf0, 0x00, 0x30, + 0x68, 0xfc, 0x08, 0x00, 0x84, 0xfe, 0x08, 0x00, 0x90, 0xe5, 0x08, 0x00, + 0x28, 0xd8, 0x05, 0x30, 0x5c, 0xc0, 0x05, 0x30, 0x28, 0xf0, 0x05, 0x30, + 0x01, 0x28, 0x84, 0xbf, 0x00, 0x20, 0x70, 0x47, 0x04, 0x49, 0x0a, 0x68, + 0x22, 0xf0, 0x01, 0x02, 0x02, 0x43, 0x0a, 0x60, 0x02, 0x49, 0x08, 0x70, + 0x01, 0x20, 0x70, 0x47, 0x04, 0x10, 0x00, 0x40, 0x74, 0x87, 0x08, 0x00, + 0xf8, 0xb5, 0x27, 0x4d, 0x05, 0xf1, 0x1e, 0x04, 0x10, 0xb3, 0x01, 0x28, + 0x44, 0xd1, 0x00, 0x26, 0x00, 0x27, 0x28, 0x46, 0x08, 0x21, 0x22, 0x46, + 0x08, 0x23, 0x2e, 0x72, 0xcd, 0xf7, 0x24, 0xfa, 0x01, 0x37, 0x0a, 0x35, + 0x03, 0x2f, 0xf4, 0xd1, 0x20, 0x88, 0x4d, 0x49, 0x1d, 0x4a, 0xa3, 0x79, + 0xa1, 0xf8, 0x7c, 0x06, 0x60, 0x88, 0x81, 0xf8, 0xf6, 0x3e, 0xa2, 0xf8, + 0xb0, 0x07, 0x1a, 0x4a, 0x90, 0x80, 0x20, 0x79, 0x62, 0x79, 0x81, 0xf8, + 0xca, 0x01, 0x81, 0xf8, 0xc9, 0x21, 0x23, 0xe0, 0x43, 0x4d, 0x14, 0x4e, + 0x4f, 0xf0, 0x00, 0x0c, 0x00, 0x27, 0xb5, 0xf8, 0x7c, 0x06, 0x41, 0x06, + 0x44, 0xbf, 0x40, 0xf4, 0x00, 0x70, 0xa5, 0xf8, 0x7c, 0x06, 0x0d, 0x49, + 0x95, 0xf8, 0xf6, 0x2e, 0x95, 0xf8, 0xc9, 0x31, 0x95, 0xf8, 0xca, 0x51, + 0xb6, 0xf8, 0xb0, 0x67, 0x04, 0x31, 0x01, 0x37, 0x8a, 0x70, 0x4b, 0x70, + 0x0d, 0x70, 0x21, 0xf8, 0x02, 0x6c, 0x21, 0xf8, 0x04, 0x0c, 0x81, 0xf8, + 0x04, 0xc0, 0x0a, 0x31, 0x04, 0x2f, 0xf2, 0xd1, 0x01, 0x20, 0x20, 0x72, + 0xf8, 0xbd, 0x00, 0xbf, 0xbc, 0xfe, 0x05, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0x8c, 0x32, 0x06, 0x00, 0x70, 0xb5, 0x28, 0x4b, 0x29, 0x4a, 0x28, 0x49, + 0x01, 0x28, 0x02, 0xf1, 0x08, 0x04, 0x5d, 0x68, 0x27, 0x4a, 0x01, 0xf1, + 0x03, 0x01, 0x1e, 0xd1, 0x45, 0xf0, 0x01, 0x00, 0x58, 0x60, 0x18, 0x68, + 0x40, 0xf0, 0x08, 0x00, 0x18, 0x60, 0x50, 0x68, 0x40, 0xf0, 0x38, 0x00, + 0x50, 0x60, 0x50, 0x68, 0x20, 0xf0, 0x07, 0x00, 0x50, 0x60, 0x10, 0x68, + 0x40, 0xf0, 0x08, 0x00, 0x10, 0x60, 0x10, 0x68, 0x20, 0xf0, 0x40, 0x00, + 0x10, 0x60, 0x48, 0x78, 0x28, 0xb3, 0x08, 0x78, 0x1b, 0x49, 0x09, 0x68, + 0x88, 0x47, 0x00, 0x20, 0x24, 0xe0, 0x17, 0x48, 0x90, 0xf8, 0xcd, 0x61, + 0x90, 0xf8, 0xce, 0x01, 0x66, 0xf3, 0x01, 0x05, 0xc0, 0x08, 0x5d, 0x60, + 0x1d, 0x68, 0x60, 0xf3, 0xc4, 0x05, 0x1d, 0x60, 0x50, 0x68, 0x20, 0xf0, + 0x38, 0x00, 0x50, 0x60, 0x50, 0x68, 0x40, 0xf0, 0x07, 0x00, 0x50, 0x60, + 0x10, 0x68, 0x20, 0xf0, 0x08, 0x00, 0x10, 0x60, 0x10, 0x68, 0x40, 0xf0, + 0x40, 0x00, 0x10, 0x60, 0x48, 0x78, 0x00, 0x28, 0xd9, 0xd0, 0x08, 0x78, + 0x07, 0x49, 0x09, 0x68, 0x88, 0x47, 0x01, 0x20, 0x20, 0x70, 0x70, 0xbd, + 0x94, 0xc0, 0x05, 0x30, 0xad, 0x2f, 0x06, 0x00, 0x48, 0xdc, 0x05, 0x00, + 0x08, 0xd6, 0x05, 0x30, 0x00, 0x69, 0x08, 0x00, 0x08, 0xff, 0x08, 0x00, + 0x0c, 0xff, 0x08, 0x00, 0x11, 0x49, 0x01, 0x28, 0x11, 0xd1, 0x4f, 0xf0, + 0x80, 0x50, 0x08, 0x60, 0x12, 0x48, 0x08, 0x61, 0x12, 0x48, 0xc8, 0x64, + 0x12, 0x48, 0x08, 0x65, 0x12, 0x48, 0x48, 0x65, 0x12, 0x48, 0x88, 0x66, + 0x4a, 0xf2, 0xcf, 0x00, 0xc8, 0x66, 0x11, 0x48, 0x0c, 0xe0, 0x08, 0x4a, + 0x00, 0x20, 0x08, 0x60, 0x08, 0x61, 0xca, 0x64, 0x06, 0x4a, 0x08, 0x65, + 0x4a, 0x65, 0x06, 0x4a, 0x8a, 0x66, 0xc8, 0x66, 0x45, 0xf2, 0x6b, 0x00, + 0x08, 0x67, 0x70, 0x47, 0xd8, 0xc8, 0x23, 0x40, 0x5f, 0xd9, 0x0f, 0x00, + 0x36, 0xff, 0x0f, 0x00, 0x34, 0x31, 0x02, 0x00, 0x02, 0x00, 0x00, 0x03, + 0xc1, 0x87, 0x0e, 0x00, 0xd8, 0xfc, 0x0f, 0x00, 0x4c, 0xb1, 0x0f, 0x00, + 0xd5, 0xb2, 0x06, 0x00, 0x17, 0x1f, 0x03, 0x00, 0x2d, 0xe9, 0xfe, 0x4f, + 0x01, 0x28, 0x02, 0x90, 0x40, 0xf0, 0xce, 0x80, 0xdf, 0xf8, 0x48, 0x93, + 0xd0, 0x49, 0x99, 0xf8, 0x00, 0x00, 0xc8, 0x71, 0x49, 0x79, 0x01, 0x29, + 0x14, 0xd0, 0xcf, 0x4a, 0x00, 0x21, 0x01, 0xeb, 0x41, 0x03, 0x00, 0x24, + 0x02, 0xeb, 0x83, 0x03, 0x03, 0xf5, 0xca, 0x73, 0x1d, 0x78, 0x01, 0x34, + 0x0b, 0x2c, 0x05, 0x44, 0x03, 0xf8, 0x01, 0x5b, 0xf8, 0xd1, 0x01, 0x31, + 0x04, 0x29, 0xee, 0xd1, 0x00, 0xf0, 0xa4, 0xf9, 0x00, 0xf0, 0xc2, 0xf9, + 0xdf, 0xf8, 0x10, 0x83, 0x98, 0xf8, 0x00, 0x00, 0xe8, 0xb1, 0xdf, 0xf8, + 0x0c, 0xb3, 0x00, 0x27, 0x4f, 0xf0, 0x01, 0x0a, 0x00, 0x24, 0x5b, 0xf8, + 0x24, 0x50, 0x8d, 0xb1, 0x95, 0xf8, 0x74, 0x60, 0x28, 0x46, 0x85, 0xf8, + 0x9e, 0xa0, 0xc5, 0xf8, 0xa0, 0x70, 0xa5, 0xf8, 0x92, 0x70, 0xf1, 0xf7, + 0x9f, 0xfa, 0x28, 0x46, 0x80, 0x21, 0x32, 0x46, 0xd2, 0xf7, 0x9e, 0xfa, + 0x98, 0xf8, 0x00, 0x00, 0x01, 0x34, 0x84, 0x42, 0xe7, 0xd3, 0xb6, 0x48, + 0x00, 0x78, 0x00, 0x28, 0x56, 0xd0, 0xb5, 0x4e, 0xdf, 0xf8, 0xe0, 0xb2, + 0x00, 0x24, 0x4f, 0xf0, 0x00, 0x08, 0xd6, 0xf8, 0x00, 0xa0, 0xba, 0xf1, + 0x00, 0x0f, 0x46, 0xd0, 0x01, 0x20, 0x9a, 0xf8, 0x74, 0x10, 0xaa, 0xf8, + 0x92, 0x40, 0xca, 0xf8, 0xa0, 0x40, 0x8a, 0xf8, 0x9e, 0x00, 0x99, 0xf8, + 0x02, 0x00, 0x81, 0x42, 0x18, 0xd9, 0x8a, 0xf8, 0x74, 0x00, 0xa9, 0x48, + 0x01, 0x68, 0x9a, 0xf8, 0x35, 0x01, 0x88, 0x47, 0x9a, 0xf8, 0x74, 0x00, + 0x9a, 0xf8, 0x35, 0x11, 0xa5, 0x4b, 0x00, 0x22, 0xc3, 0xe9, 0x00, 0x10, + 0xa4, 0x48, 0x01, 0x21, 0x07, 0x68, 0x08, 0x20, 0x00, 0x90, 0x40, 0xf2, + 0x13, 0x20, 0xb8, 0x47, 0x99, 0xf8, 0x02, 0x00, 0x0a, 0xf5, 0x6f, 0x71, + 0x00, 0x22, 0x0b, 0x78, 0x01, 0x32, 0x83, 0x42, 0x88, 0xbf, 0x08, 0x70, + 0x08, 0x31, 0x05, 0x2a, 0xf7, 0xd1, 0x4d, 0x46, 0x0a, 0xf1, 0x78, 0x07, + 0x4f, 0xf0, 0x00, 0x09, 0x9a, 0xf8, 0x74, 0x00, 0xdb, 0xf8, 0x00, 0x20, + 0x5f, 0xfa, 0x89, 0xf1, 0x90, 0x47, 0x27, 0xf8, 0x19, 0x00, 0x09, 0xf1, + 0x01, 0x09, 0xb9, 0xf1, 0x04, 0x0f, 0xf1, 0xd1, 0x8c, 0x48, 0xa9, 0x46, + 0x00, 0x78, 0x08, 0xf1, 0x01, 0x08, 0x04, 0x36, 0x80, 0x45, 0xae, 0xd3, + 0xdf, 0xf8, 0x38, 0x82, 0x98, 0xf8, 0x00, 0x00, 0x48, 0xb3, 0x8d, 0x4e, + 0xdf, 0xf8, 0x34, 0xb2, 0x00, 0x25, 0x4f, 0xf0, 0x01, 0x0a, 0x00, 0x27, + 0x56, 0xf8, 0x27, 0x40, 0xe4, 0xb1, 0x99, 0xf8, 0x02, 0x20, 0x94, 0xf8, + 0x40, 0x01, 0x94, 0xf8, 0x4a, 0x11, 0x84, 0xf8, 0xdc, 0xa1, 0xa4, 0xf8, + 0xd0, 0x51, 0xc4, 0xf8, 0xe0, 0x51, 0x90, 0x42, 0x84, 0xbf, 0x84, 0xf8, + 0x40, 0x21, 0x10, 0x46, 0x05, 0x29, 0x4f, 0xf0, 0x03, 0x01, 0x38, 0xbf, + 0x02, 0x21, 0xdb, 0xf8, 0x00, 0x20, 0x90, 0x47, 0x84, 0xf8, 0x41, 0x01, + 0x98, 0xf8, 0x00, 0x00, 0x01, 0x37, 0x87, 0x42, 0xdc, 0xd3, 0xcf, 0xe0, + 0x6a, 0x48, 0x00, 0x21, 0xdf, 0xf8, 0xa8, 0xb1, 0xc1, 0x71, 0x40, 0x79, + 0xb8, 0xb1, 0x9b, 0xf8, 0x00, 0x00, 0xf6, 0x4a, 0x00, 0x21, 0x01, 0xeb, + 0x41, 0x03, 0x00, 0x24, 0x02, 0xeb, 0x83, 0x03, 0x03, 0xf5, 0xca, 0x73, + 0x1d, 0x78, 0x01, 0x34, 0x0b, 0x2c, 0xa5, 0xeb, 0x00, 0x05, 0x03, 0xf8, + 0x01, 0x5b, 0xf7, 0xd1, 0x01, 0x31, 0x04, 0x29, 0xed, 0xd1, 0x00, 0xf0, + 0x1f, 0xf9, 0x00, 0xf0, 0x5d, 0xf9, 0xdf, 0xf8, 0x74, 0x91, 0x99, 0xf8, + 0x00, 0x00, 0x28, 0xb3, 0x5b, 0x4f, 0x5c, 0x4c, 0x4f, 0xf0, 0x00, 0x08, + 0x4f, 0xf0, 0x00, 0x0a, 0x57, 0xf8, 0x2a, 0x50, 0xc5, 0xb1, 0x94, 0xf8, + 0xca, 0x01, 0x95, 0xf8, 0x74, 0x60, 0x85, 0xf8, 0x9e, 0x80, 0x85, 0xf8, + 0x92, 0x00, 0x9b, 0xf8, 0x02, 0x00, 0x86, 0x42, 0x04, 0xbf, 0x0b, 0x20, + 0x85, 0xf8, 0x74, 0x00, 0x28, 0x46, 0xf1, 0xf7, 0xc9, 0xf9, 0x28, 0x46, + 0x80, 0x21, 0x32, 0x46, 0xd2, 0xf7, 0xc8, 0xf9, 0x99, 0xf8, 0x00, 0x00, + 0x0a, 0xf1, 0x01, 0x0a, 0x82, 0x45, 0xdf, 0xd3, 0x4a, 0x48, 0x00, 0x78, + 0x00, 0x28, 0x51, 0xd0, 0x49, 0x4c, 0xdf, 0xf8, 0x34, 0x81, 0x0b, 0x26, + 0x4f, 0xf0, 0x00, 0x09, 0xd4, 0xf8, 0x00, 0xa0, 0xba, 0xf1, 0x00, 0x0f, + 0x41, 0xd0, 0x00, 0x20, 0x9a, 0xf8, 0x74, 0x10, 0x8a, 0xf8, 0x9e, 0x00, + 0x3f, 0x48, 0x90, 0xf8, 0xca, 0x01, 0x8a, 0xf8, 0x92, 0x00, 0x9b, 0xf8, + 0x02, 0x00, 0x81, 0x42, 0x18, 0xd1, 0x3e, 0x48, 0x8a, 0xf8, 0x74, 0x60, + 0x01, 0x68, 0x9a, 0xf8, 0x35, 0x01, 0x88, 0x47, 0x9a, 0xf8, 0x74, 0x00, + 0x9a, 0xf8, 0x35, 0x11, 0x39, 0x4b, 0x00, 0x22, 0xc3, 0xe9, 0x00, 0x10, + 0xc0, 0x48, 0x01, 0x21, 0x05, 0x68, 0x08, 0x20, 0x00, 0x90, 0x40, 0xf2, + 0x13, 0x20, 0xa8, 0x47, 0x9b, 0xf8, 0x02, 0x00, 0x0a, 0xf5, 0x6f, 0x71, + 0x00, 0x22, 0x0b, 0x78, 0x01, 0x32, 0x83, 0x42, 0x08, 0xbf, 0x0e, 0x70, + 0x08, 0x31, 0x05, 0x2a, 0xf7, 0xd1, 0x0a, 0xf1, 0x78, 0x07, 0x00, 0x25, + 0x9a, 0xf8, 0x74, 0x00, 0xd8, 0xf8, 0x00, 0x20, 0xe9, 0xb2, 0x90, 0x47, + 0x27, 0xf8, 0x15, 0x00, 0x01, 0x35, 0x04, 0x2d, 0xf4, 0xd1, 0x23, 0x48, + 0x00, 0x78, 0x09, 0xf1, 0x01, 0x09, 0x04, 0x34, 0x81, 0x45, 0xb3, 0xd3, + 0xdf, 0xf8, 0x94, 0x90, 0x99, 0xf8, 0x00, 0x00, 0x40, 0xb3, 0x24, 0x4e, + 0xdf, 0xf8, 0x6c, 0xa0, 0x23, 0x4d, 0x4f, 0xf0, 0x00, 0x08, 0x00, 0x24, + 0x56, 0xf8, 0x24, 0x70, 0xdf, 0xb1, 0x9a, 0xf8, 0xca, 0x01, 0x9b, 0xf8, + 0x02, 0x20, 0x97, 0xf8, 0x4a, 0x11, 0x87, 0xf8, 0xdc, 0x81, 0x87, 0xf8, + 0xd0, 0x01, 0x97, 0xf8, 0x40, 0x01, 0x90, 0x42, 0x04, 0xbf, 0x0b, 0x20, + 0x87, 0xf8, 0x40, 0x01, 0x05, 0x29, 0x4f, 0xf0, 0x03, 0x01, 0x38, 0xbf, + 0x02, 0x21, 0x2a, 0x68, 0x90, 0x47, 0x87, 0xf8, 0x41, 0x01, 0x99, 0xf8, + 0x00, 0x00, 0x01, 0x34, 0x84, 0x42, 0xdd, 0xd3, 0x02, 0x98, 0xbd, 0xe8, + 0xfe, 0x4f, 0xd5, 0xf7, 0x6b, 0xbf, 0x00, 0xbf, 0x48, 0xdc, 0x05, 0x00, + 0xad, 0x2f, 0x06, 0x00, 0x8c, 0x7e, 0x08, 0x00, 0x5c, 0x34, 0x01, 0x00, + 0x10, 0x61, 0x01, 0x00, 0x00, 0x69, 0x08, 0x00, 0x53, 0x34, 0x01, 0x00, + 0xb8, 0x57, 0x01, 0x00, 0x54, 0x9c, 0x08, 0x00, 0x8c, 0x34, 0x01, 0x00, + 0xa0, 0xa0, 0x08, 0x00, 0x38, 0x9c, 0x08, 0x00, 0xd4, 0x58, 0x01, 0x00, + 0x14, 0x58, 0x01, 0x00, 0x34, 0x9c, 0x08, 0x00, 0x7c, 0xb5, 0x50, 0x4e, + 0x00, 0x25, 0x00, 0x21, 0x00, 0x22, 0x00, 0x23, 0xb0, 0x79, 0xcd, 0xe9, + 0x00, 0x50, 0x02, 0x20, 0x00, 0xf0, 0xfc, 0xf8, 0x3b, 0x48, 0x05, 0x21, + 0x05, 0x23, 0x00, 0xf1, 0x0a, 0x04, 0x3a, 0x48, 0x22, 0x46, 0xcc, 0xf7, + 0x69, 0xff, 0xb0, 0x78, 0x21, 0x78, 0x01, 0x35, 0x81, 0x42, 0x28, 0xbf, + 0x01, 0x46, 0x04, 0xf8, 0x01, 0x1b, 0x05, 0x2d, 0xf6, 0xd1, 0x7c, 0xbd, + 0xb0, 0xb5, 0x40, 0x4c, 0x41, 0x4d, 0xa1, 0x78, 0x28, 0x78, 0x88, 0x42, + 0x07, 0xd9, 0x3e, 0x4a, 0x10, 0x70, 0x0f, 0x48, 0x02, 0x68, 0x00, 0x20, + 0x90, 0x47, 0xa1, 0x78, 0x28, 0x70, 0x3c, 0x4d, 0x28, 0x78, 0x88, 0x42, + 0x07, 0xd9, 0x38, 0x4a, 0x50, 0x70, 0x09, 0x48, 0x02, 0x68, 0x00, 0x20, + 0x90, 0x47, 0xa1, 0x78, 0x28, 0x70, 0x37, 0x4c, 0x20, 0x78, 0x88, 0x42, + 0x06, 0xd9, 0x32, 0x4a, 0x90, 0x70, 0x03, 0x48, 0x02, 0x68, 0x00, 0x20, + 0x90, 0x47, 0x20, 0x70, 0xb0, 0xbd, 0x00, 0xbf, 0x50, 0xfb, 0x08, 0x00, + 0x80, 0xb5, 0x02, 0x20, 0x00, 0xf0, 0x5e, 0xf8, 0x1a, 0x48, 0x1b, 0x4a, + 0x05, 0x21, 0x05, 0x23, 0x0a, 0x30, 0xcc, 0xf7, 0x29, 0xff, 0x56, 0x48, + 0xb0, 0xf8, 0xb0, 0x17, 0x49, 0xb3, 0x90, 0xf8, 0xf9, 0x12, 0x16, 0x48, + 0x02, 0x68, 0x61, 0xf3, 0x00, 0x02, 0x02, 0x60, 0x4a, 0x08, 0x03, 0x68, + 0x62, 0xf3, 0x41, 0x03, 0x8a, 0x08, 0x03, 0x60, 0x03, 0x68, 0x62, 0xf3, + 0x82, 0x03, 0xca, 0x08, 0x03, 0x60, 0x03, 0x68, 0x62, 0xf3, 0xc3, 0x03, + 0x0a, 0x09, 0x03, 0x60, 0x43, 0x68, 0x62, 0xf3, 0x00, 0x03, 0x4a, 0x09, + 0x43, 0x60, 0x43, 0x68, 0x62, 0xf3, 0x41, 0x03, 0x8a, 0x09, 0xc9, 0x09, + 0x43, 0x60, 0x43, 0x68, 0x62, 0xf3, 0x82, 0x03, 0x43, 0x60, 0x42, 0x68, + 0x61, 0xf3, 0xc3, 0x02, 0x42, 0x60, 0x80, 0xbd, 0xcc, 0x2c, 0x06, 0x00, + 0xb7, 0xfe, 0x05, 0x00, 0x64, 0x50, 0x00, 0x40, 0x0b, 0x48, 0x81, 0x78, + 0x0b, 0x48, 0x02, 0x78, 0x8a, 0x42, 0x84, 0xbf, 0x0a, 0x4b, 0x1a, 0x70, + 0x42, 0x78, 0x8a, 0x42, 0x84, 0xbf, 0x09, 0x4b, 0x1a, 0x70, 0x82, 0x78, + 0x8a, 0x42, 0x84, 0xbf, 0x07, 0x49, 0x0a, 0x70, 0x00, 0x21, 0x81, 0x70, + 0x41, 0x70, 0x01, 0x70, 0x70, 0x47, 0x00, 0xbf, 0xad, 0x2f, 0x06, 0x00, + 0xb4, 0xfe, 0x05, 0x00, 0x6a, 0x34, 0x01, 0x00, 0x6c, 0x34, 0x01, 0x00, + 0x6d, 0x34, 0x01, 0x00, 0x03, 0x28, 0x14, 0xd2, 0x4f, 0x49, 0x00, 0xeb, + 0x80, 0x00, 0x72, 0xb6, 0x0a, 0x68, 0x52, 0x00, 0x01, 0x32, 0x0a, 0x60, + 0x4a, 0x4a, 0x02, 0xeb, 0x40, 0x00, 0x00, 0x22, 0x02, 0x72, 0x08, 0x68, + 0x40, 0x08, 0x08, 0x60, 0x08, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x00, 0xf0, + 0x05, 0xb8, 0x00, 0x20, 0x42, 0xf2, 0x68, 0x61, 0xd2, 0xf7, 0x06, 0xbd, + 0xbc, 0xb5, 0x41, 0x4b, 0x00, 0x20, 0x19, 0x7a, 0x51, 0xb9, 0x01, 0x30, + 0x0a, 0x33, 0x04, 0x28, 0xf9, 0xd1, 0x00, 0x20, 0x42, 0xf2, 0x8b, 0x61, + 0xbd, 0xe8, 0xbc, 0x40, 0xd2, 0xf7, 0xf6, 0xbc, 0x3a, 0x48, 0xa0, 0x4a, + 0x13, 0x4c, 0x72, 0xb6, 0x01, 0x68, 0x49, 0x00, 0x01, 0x31, 0x01, 0x60, + 0x19, 0x88, 0x9d, 0x79, 0xa2, 0xf8, 0x7c, 0x16, 0x59, 0x88, 0x82, 0xf8, + 0xf6, 0x5e, 0xa4, 0xf8, 0xb0, 0x17, 0x0d, 0x4c, 0xa1, 0x80, 0x19, 0x79, + 0x5c, 0x79, 0x82, 0xf8, 0xca, 0x11, 0x82, 0xf8, 0xc9, 0x41, 0x00, 0x22, + 0x01, 0x68, 0x49, 0x08, 0x01, 0x60, 0x01, 0x21, 0x00, 0x68, 0x80, 0xf3, + 0x10, 0x88, 0x06, 0x48, 0x04, 0x68, 0x08, 0x20, 0x00, 0x90, 0x40, 0xf2, + 0xfe, 0x70, 0xa0, 0x47, 0xbc, 0xbd, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, + 0x8c, 0x32, 0x06, 0x00, 0xa0, 0xa0, 0x08, 0x00, 0x04, 0x28, 0x21, 0xd2, + 0xf0, 0xb5, 0xdf, 0xf8, 0x80, 0xe0, 0xdd, 0xe9, 0x05, 0xc7, 0x00, 0xeb, + 0x80, 0x04, 0x02, 0x28, 0x72, 0xb6, 0x0e, 0xeb, 0x44, 0x05, 0x4f, 0xf0, + 0x01, 0x04, 0x2c, 0x72, 0x1a, 0x4c, 0x26, 0x68, 0x4f, 0xea, 0x46, 0x06, + 0x06, 0xf1, 0x01, 0x06, 0x26, 0x60, 0x10, 0xd0, 0x01, 0x28, 0x18, 0xd0, + 0xe8, 0xb9, 0x00, 0xeb, 0x80, 0x00, 0x29, 0x80, 0x0e, 0xeb, 0x40, 0x00, + 0x80, 0xf8, 0x05, 0xc0, 0x03, 0x71, 0x14, 0xe0, 0x00, 0x20, 0x42, 0xf2, + 0x3f, 0x61, 0xd2, 0xf7, 0x9d, 0xbc, 0x00, 0xeb, 0x80, 0x00, 0x29, 0x80, + 0x0e, 0xeb, 0x40, 0x00, 0x87, 0x71, 0x80, 0xf8, 0x05, 0xc0, 0x03, 0x71, + 0x04, 0xe0, 0x00, 0xeb, 0x80, 0x00, 0x29, 0x80, 0x0e, 0xeb, 0x40, 0x00, + 0x42, 0x80, 0x20, 0x68, 0x40, 0x08, 0x20, 0x60, 0x20, 0x68, 0x80, 0xf3, + 0x10, 0x88, 0xbd, 0xe8, 0xf0, 0x40, 0xff, 0xf7, 0x7d, 0xbf, 0x00, 0xbf, + 0xbc, 0xfe, 0x05, 0x00, 0x24, 0x36, 0x01, 0x00, 0x10, 0xb5, 0x05, 0xf0, + 0x07, 0xff, 0x63, 0x48, 0xb0, 0xf8, 0x2a, 0x03, 0xc0, 0x06, 0x21, 0xd5, + 0x12, 0x4a, 0x11, 0x48, 0x41, 0x69, 0xb2, 0xf8, 0x5c, 0x20, 0x8a, 0x42, + 0x1a, 0xd2, 0x10, 0x49, 0x10, 0x4b, 0x0a, 0x68, 0x1c, 0x78, 0x04, 0x5d, + 0x64, 0xf3, 0x18, 0x62, 0x0a, 0x60, 0x1a, 0x78, 0x02, 0x44, 0x54, 0x79, + 0xd2, 0x7b, 0x52, 0x06, 0x42, 0xea, 0x04, 0x62, 0x4c, 0x68, 0x12, 0x0e, + 0x62, 0xf3, 0x1d, 0x64, 0x4c, 0x60, 0x8a, 0x68, 0x1b, 0x78, 0x18, 0x44, + 0x80, 0x7a, 0x60, 0xf3, 0x18, 0x62, 0x8a, 0x60, 0x10, 0xbd, 0x00, 0xbf, + 0xe4, 0x2d, 0x06, 0x00, 0x50, 0xec, 0x01, 0x00, 0x00, 0xf9, 0x05, 0x30, + 0xb4, 0xe9, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, 0x42, 0x48, 0x43, 0x49, + 0x43, 0x4e, 0x45, 0x4a, 0x45, 0x4c, 0x00, 0x25, 0x46, 0x4f, 0x00, 0x68, + 0x00, 0xf0, 0x02, 0x00, 0x08, 0x60, 0x40, 0x49, 0x30, 0x68, 0x08, 0x60, + 0xd6, 0xf8, 0xe0, 0x01, 0x48, 0x60, 0x10, 0x68, 0xe5, 0x76, 0x65, 0x70, + 0x84, 0xf8, 0x4f, 0x50, 0x84, 0xf8, 0x35, 0x50, 0xa5, 0x76, 0x25, 0x70, + 0x88, 0x60, 0x3b, 0x48, 0x83, 0x46, 0x00, 0x68, 0xc8, 0x60, 0x97, 0xf8, + 0x34, 0x02, 0x10, 0xf0, 0x1e, 0x0f, 0x40, 0xd0, 0x38, 0x48, 0x92, 0x46, + 0x00, 0x68, 0x80, 0x47, 0x05, 0x46, 0xd0, 0xbb, 0xdf, 0xf8, 0xd8, 0x80, + 0x04, 0x20, 0x07, 0xf5, 0x0d, 0x75, 0xd8, 0xf8, 0x00, 0x10, 0x88, 0x47, + 0x28, 0x68, 0xdf, 0xf8, 0xcc, 0x90, 0x5f, 0x46, 0x81, 0x07, 0x0b, 0xd5, + 0xd9, 0xf8, 0x04, 0x00, 0x00, 0x21, 0x38, 0x60, 0xd9, 0xf8, 0x0c, 0x00, + 0x30, 0x60, 0x2e, 0x48, 0x02, 0x68, 0x00, 0x20, 0x90, 0x47, 0x28, 0x68, + 0x41, 0x07, 0x0c, 0xd5, 0xd9, 0xf8, 0x00, 0x00, 0x01, 0x21, 0x38, 0x60, + 0xd9, 0xf8, 0x08, 0x00, 0xc6, 0xf8, 0xe0, 0x01, 0x26, 0x48, 0x02, 0x68, + 0x00, 0x20, 0x90, 0x47, 0x28, 0x68, 0xc0, 0x06, 0x0a, 0xd5, 0x24, 0x48, + 0x01, 0x68, 0x39, 0x60, 0x01, 0x21, 0x40, 0x68, 0xca, 0xf8, 0x00, 0x00, + 0x1f, 0x48, 0x02, 0x68, 0x01, 0x20, 0x90, 0x47, 0xd8, 0xf8, 0x00, 0x10, + 0x00, 0x20, 0x00, 0x25, 0x88, 0x47, 0x1d, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x1c, 0x48, 0x00, 0x78, 0xff, 0x28, 0x01, 0xd0, 0x05, 0x28, 0x13, 0xd1, + 0x1a, 0x48, 0x01, 0x68, 0x68, 0x20, 0x88, 0x47, 0x70, 0xb1, 0x68, 0x21, + 0x22, 0x46, 0x68, 0x23, 0x06, 0x46, 0xcc, 0xf7, 0x7f, 0xfd, 0x16, 0x48, + 0x31, 0x46, 0x68, 0x22, 0x03, 0x68, 0x05, 0x20, 0x98, 0x47, 0x30, 0x46, + 0xd2, 0xf7, 0xe4, 0xfb, 0x28, 0x46, 0xbd, 0xe8, 0xf8, 0x8f, 0x00, 0xbf, + 0x48, 0x80, 0x22, 0x40, 0x0c, 0xe7, 0x01, 0x00, 0x58, 0xd6, 0x05, 0x30, + 0x10, 0xe7, 0x01, 0x00, 0x38, 0xf0, 0x05, 0x30, 0x58, 0xe2, 0x01, 0x00, + 0x78, 0xc0, 0x05, 0x30, 0x00, 0x69, 0x08, 0x00, 0x84, 0x9a, 0x08, 0x00, + 0xc0, 0xbd, 0x08, 0x00, 0x74, 0x32, 0x06, 0x00, 0xc4, 0xbd, 0x08, 0x00, + 0x84, 0x32, 0x06, 0x00, 0x8c, 0xbd, 0x08, 0x00, 0x64, 0x8d, 0x08, 0x00, + 0xd4, 0x9b, 0x08, 0x00, 0xe4, 0x9b, 0x08, 0x00, 0x0d, 0x48, 0x01, 0x21, + 0x81, 0x71, 0x01, 0x70, 0x0c, 0x49, 0xb1, 0xf8, 0x00, 0x21, 0x91, 0xf8, + 0xfc, 0x30, 0x6f, 0xf3, 0x5f, 0x22, 0x03, 0xf0, 0x7f, 0x03, 0x82, 0x80, + 0x91, 0xf8, 0xf4, 0x20, 0xb1, 0xf8, 0xf8, 0x10, 0xc3, 0x70, 0x6f, 0xf3, + 0x5f, 0x21, 0x41, 0x81, 0x02, 0xf0, 0x7f, 0x01, 0x41, 0x72, 0x05, 0xf0, + 0x17, 0xbe, 0x00, 0xbf, 0x90, 0xe4, 0x01, 0x00, 0xd0, 0xfc, 0x05, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x87, 0xb0, 0xdf, 0xf8, 0x18, 0x4a, 0xdf, 0xf8, + 0x18, 0xba, 0x07, 0x46, 0x01, 0x20, 0x48, 0x21, 0x84, 0xf8, 0x4d, 0x06, + 0x58, 0x46, 0xce, 0xf7, 0xb5, 0xfe, 0xdb, 0x4e, 0x04, 0xf2, 0x4c, 0x68, + 0xdf, 0xf8, 0x04, 0x4a, 0xd6, 0xf8, 0x00, 0xa0, 0x20, 0x78, 0x01, 0x28, + 0x18, 0xbf, 0x03, 0x2f, 0x40, 0xf0, 0xd5, 0x83, 0x00, 0xf0, 0x68, 0xfd, + 0x20, 0x78, 0x01, 0x28, 0x04, 0xbf, 0x01, 0x2f, 0xff, 0xf7, 0xbc, 0xff, + 0xdf, 0xf8, 0xe4, 0x19, 0x00, 0x20, 0x00, 0x22, 0x01, 0x97, 0x88, 0x71, + 0x08, 0x70, 0xdf, 0xf8, 0xdc, 0x19, 0x40, 0x31, 0x01, 0x32, 0x08, 0x70, + 0x01, 0xf8, 0x40, 0x0c, 0x04, 0x31, 0x10, 0x2a, 0xf8, 0xd1, 0xdf, 0xf8, + 0xcc, 0x09, 0x00, 0x24, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0xdf, 0xf8, + 0xc4, 0x09, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0xdf, 0xf8, 0xbc, 0x09, + 0x00, 0x21, 0x00, 0x22, 0xff, 0x23, 0x05, 0x68, 0x00, 0x20, 0xa8, 0x47, + 0xdf, 0xf8, 0xb0, 0x09, 0x09, 0x21, 0x6f, 0xf0, 0x7e, 0x02, 0x03, 0x68, + 0xff, 0x20, 0x98, 0x47, 0xdf, 0xf8, 0xa4, 0x09, 0x09, 0x21, 0x6f, 0xf0, + 0x7e, 0x02, 0x03, 0x68, 0xff, 0x20, 0x98, 0x47, 0xdf, 0xf8, 0x98, 0x09, + 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0xdf, 0xf8, 0x94, 0x09, 0x00, 0x68, + 0x80, 0x47, 0xdf, 0xf8, 0x90, 0x09, 0x01, 0x68, 0x40, 0xf2, 0x2e, 0x50, + 0x88, 0x47, 0xdf, 0xf8, 0x88, 0x09, 0xdf, 0xf8, 0x8c, 0x99, 0x04, 0x60, + 0xdf, 0xf8, 0x80, 0x09, 0x09, 0xf8, 0x02, 0x4f, 0x89, 0xf8, 0x01, 0x40, + 0x84, 0x70, 0xdf, 0xf8, 0x7c, 0x09, 0x34, 0x68, 0x00, 0x68, 0x80, 0x47, + 0x28, 0xb9, 0xdf, 0xf8, 0x64, 0x19, 0x08, 0x68, 0x40, 0xf0, 0x01, 0x00, + 0x08, 0x60, 0x30, 0x68, 0x00, 0x1b, 0xcb, 0xf8, 0x18, 0x00, 0xdf, 0xf8, + 0x60, 0x09, 0x34, 0x68, 0x00, 0x68, 0x80, 0x47, 0x28, 0xb9, 0xdf, 0xf8, + 0x44, 0x19, 0x08, 0x68, 0x40, 0xf0, 0x04, 0x00, 0x08, 0x60, 0xcd, 0xf8, + 0x0c, 0x80, 0x30, 0x68, 0x00, 0x1b, 0xcb, 0xf8, 0x1c, 0x00, 0xdf, 0xf8, + 0x40, 0x09, 0x34, 0x68, 0x00, 0x68, 0x80, 0x47, 0x28, 0xb9, 0xdf, 0xf8, + 0x20, 0x19, 0x08, 0x68, 0x40, 0xf0, 0x08, 0x00, 0x08, 0x60, 0x30, 0x68, + 0x00, 0x1b, 0xcb, 0xf8, 0x20, 0x00, 0xdf, 0xf8, 0x24, 0x09, 0x00, 0xf5, + 0x37, 0x71, 0x11, 0xf9, 0x08, 0x0f, 0x00, 0x28, 0x05, 0x91, 0x2d, 0xd4, + 0x05, 0x98, 0xc0, 0x7a, 0xc1, 0x07, 0x14, 0xd0, 0x8a, 0x4c, 0x21, 0x68, + 0x49, 0x05, 0x10, 0xd4, 0xdf, 0xf8, 0x08, 0x09, 0xdf, 0xf8, 0x00, 0x69, + 0x19, 0x25, 0x47, 0x1c, 0x28, 0x06, 0x06, 0xd0, 0x30, 0x88, 0x02, 0x38, + 0xb8, 0x47, 0x20, 0x68, 0x01, 0x3d, 0x40, 0x05, 0xf6, 0xd5, 0x05, 0x98, + 0xc0, 0x7a, 0x80, 0x07, 0x12, 0xd5, 0x80, 0x4c, 0x20, 0x68, 0x40, 0x05, + 0x0e, 0xd4, 0xdf, 0xf8, 0xdc, 0x08, 0xdf, 0xf8, 0xd4, 0x68, 0x19, 0x25, + 0x47, 0x1c, 0x28, 0x06, 0x06, 0xd0, 0x30, 0x88, 0x02, 0x38, 0xb8, 0x47, + 0x20, 0x68, 0x01, 0x3d, 0x40, 0x05, 0xf6, 0xd5, 0xdf, 0xf8, 0xc0, 0x08, + 0xcd, 0xf8, 0x08, 0xa0, 0x00, 0x68, 0x80, 0x47, 0xdf, 0xf8, 0xb8, 0x08, + 0x00, 0x68, 0x80, 0x47, 0xdf, 0xf8, 0xb4, 0x08, 0x00, 0x68, 0x80, 0x47, + 0x6d, 0x4d, 0xdf, 0xf8, 0xb0, 0x08, 0x2c, 0x68, 0x00, 0x68, 0x80, 0x47, + 0x28, 0xb9, 0xdf, 0xf8, 0x74, 0x18, 0x08, 0x68, 0x40, 0xf4, 0x80, 0x70, + 0x08, 0x60, 0x28, 0x68, 0xdf, 0xf8, 0x98, 0x68, 0xdf, 0xf8, 0x98, 0x88, + 0x00, 0x27, 0x00, 0x1b, 0x00, 0x24, 0xcb, 0xf8, 0x04, 0x00, 0xd5, 0xf8, + 0x00, 0xa0, 0x00, 0x25, 0x30, 0x68, 0x80, 0x47, 0x38, 0xb1, 0x98, 0xf8, + 0x00, 0x00, 0x02, 0x28, 0x01, 0xd1, 0x01, 0x2c, 0x0d, 0xd9, 0x01, 0x37, + 0x13, 0xe0, 0xdf, 0xf8, 0x38, 0x18, 0x08, 0x68, 0x40, 0xf4, 0x00, 0x70, + 0x08, 0x60, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x1f, 0xd1, 0x01, 0x2c, + 0x1d, 0xd8, 0x99, 0xf8, 0x01, 0x00, 0x88, 0xf8, 0x00, 0x50, 0x01, 0x34, + 0x01, 0x30, 0x89, 0xf8, 0x01, 0x00, 0x03, 0x2f, 0xde, 0xd3, 0x01, 0x20, + 0xcd, 0xf7, 0xe4, 0xfd, 0xdf, 0xf8, 0xe8, 0x07, 0x01, 0x68, 0x01, 0x20, + 0x88, 0x47, 0x01, 0x20, 0x05, 0xf0, 0xe8, 0xfc, 0xdf, 0xf8, 0x30, 0x08, + 0x00, 0x68, 0x80, 0x47, 0x00, 0x20, 0x40, 0xf2, 0xd6, 0x51, 0xcc, 0xf7, + 0xe5, 0xfb, 0x46, 0x49, 0x08, 0x68, 0xa0, 0xeb, 0x0a, 0x00, 0xcb, 0xf8, + 0x24, 0x00, 0x08, 0x68, 0x60, 0x21, 0x04, 0x90, 0xdf, 0xf8, 0x10, 0x08, + 0xcf, 0xf7, 0x32, 0xfa, 0x05, 0x98, 0xdf, 0xf8, 0x0c, 0xb8, 0x00, 0x27, + 0x00, 0x26, 0x00, 0x24, 0x90, 0xf8, 0x60, 0x03, 0xc0, 0x07, 0x4f, 0xf0, + 0x02, 0x00, 0x08, 0xbf, 0x01, 0x20, 0x00, 0xeb, 0x40, 0x05, 0x06, 0x90, + 0xdb, 0xf8, 0x00, 0x00, 0x80, 0x47, 0xa0, 0xb9, 0xdf, 0xf8, 0xa0, 0x17, + 0x04, 0xf1, 0x01, 0x0a, 0x08, 0x68, 0x40, 0xf0, 0x10, 0x00, 0x08, 0x60, + 0x06, 0x99, 0x5f, 0xfa, 0x8a, 0xf0, 0x81, 0x42, 0x06, 0xd1, 0x98, 0xf8, + 0x00, 0x00, 0x02, 0x28, 0x37, 0xd1, 0x01, 0x2e, 0x08, 0xd9, 0x34, 0xe0, + 0x54, 0x46, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x17, 0xd1, 0x01, 0x2e, + 0x15, 0xd8, 0xa2, 0x46, 0x00, 0x20, 0x60, 0x21, 0x88, 0xf8, 0x00, 0x00, + 0x99, 0xf8, 0x01, 0x00, 0x01, 0x30, 0x89, 0xf8, 0x01, 0x00, 0xdf, 0xf8, + 0x98, 0x07, 0xcf, 0xf7, 0xf5, 0xf9, 0x5f, 0xfa, 0x8a, 0xf4, 0x01, 0x36, + 0x00, 0x2c, 0x18, 0xbf, 0xaa, 0xf1, 0x01, 0x04, 0x00, 0xe0, 0x01, 0x37, + 0xf8, 0xb2, 0x85, 0x42, 0xc6, 0xd8, 0x01, 0x20, 0xcd, 0xf7, 0x7a, 0xfd, + 0xdf, 0xf8, 0x14, 0x07, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x01, 0x20, + 0x05, 0xf0, 0x7e, 0xfc, 0xdf, 0xf8, 0x5c, 0x07, 0x00, 0x68, 0x80, 0x47, + 0x00, 0x20, 0x40, 0xf2, 0x13, 0x61, 0xcc, 0xf7, 0x7b, 0xfb, 0x05, 0x98, + 0x90, 0xf8, 0x60, 0x03, 0xc0, 0x07, 0x03, 0xd0, 0xdf, 0xf8, 0x4c, 0x07, + 0x00, 0x68, 0x80, 0x47, 0x0c, 0x49, 0xdf, 0xf8, 0xc8, 0xb6, 0xdf, 0xf8, + 0x44, 0x67, 0x00, 0x25, 0x00, 0x27, 0x00, 0x24, 0x08, 0x68, 0x04, 0x9a, + 0x80, 0x1a, 0xcb, 0xf8, 0x0c, 0x00, 0xd1, 0xf8, 0x00, 0xa0, 0x30, 0x68, + 0x80, 0x47, 0x68, 0xb1, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x01, 0xd1, + 0x01, 0x2c, 0x13, 0xd9, 0x01, 0x37, 0x19, 0xe0, 0x24, 0x20, 0x00, 0x40, + 0x14, 0xd6, 0x05, 0x30, 0x14, 0xee, 0x05, 0x30, 0xdf, 0xf8, 0xbc, 0x16, + 0x08, 0x68, 0x40, 0xf0, 0x40, 0x00, 0x08, 0x60, 0x98, 0xf8, 0x00, 0x00, + 0x02, 0x28, 0x1f, 0xd1, 0x01, 0x2c, 0x1d, 0xd8, 0x99, 0xf8, 0x01, 0x00, + 0x88, 0xf8, 0x00, 0x50, 0x01, 0x34, 0x01, 0x30, 0x89, 0xf8, 0x01, 0x00, + 0x03, 0x2f, 0xd8, 0xd3, 0x01, 0x20, 0xcd, 0xf7, 0x27, 0xfd, 0xdf, 0xf8, + 0x70, 0x06, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x01, 0x20, 0x05, 0xf0, + 0x2b, 0xfc, 0xdf, 0xf8, 0xb8, 0x06, 0x00, 0x68, 0x80, 0x47, 0x00, 0x20, + 0x40, 0xf2, 0x4d, 0x61, 0xcc, 0xf7, 0x28, 0xfb, 0xc2, 0x49, 0xdf, 0xf8, + 0xb8, 0x66, 0x08, 0x68, 0xa0, 0xeb, 0x0a, 0x00, 0xcb, 0xf8, 0x28, 0x00, + 0x30, 0x46, 0xd1, 0xf8, 0x00, 0xa0, 0xc0, 0x21, 0xcf, 0xf7, 0x74, 0xf9, + 0xdf, 0xf8, 0xa0, 0x56, 0x00, 0x24, 0x00, 0x27, 0x4f, 0xf0, 0x00, 0x0b, + 0x28, 0x68, 0x80, 0x47, 0x40, 0xb1, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, + 0x02, 0xd1, 0xbb, 0xf1, 0x01, 0x0f, 0x0e, 0xd9, 0x01, 0x37, 0x19, 0xe0, + 0xdf, 0xf8, 0x28, 0x16, 0x08, 0x68, 0x40, 0xf0, 0x20, 0x00, 0x08, 0x60, + 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x25, 0xd1, 0xbb, 0xf1, 0x01, 0x0f, + 0x22, 0xd8, 0x99, 0xf8, 0x01, 0x00, 0xc0, 0x21, 0x88, 0xf8, 0x00, 0x40, + 0x01, 0x30, 0x89, 0xf8, 0x01, 0x00, 0x30, 0x46, 0xcf, 0xf7, 0x4a, 0xf9, + 0x0b, 0xf1, 0x01, 0x0b, 0x03, 0x2f, 0xd7, 0xd3, 0x01, 0x20, 0xcd, 0xf7, + 0xd7, 0xfc, 0xdf, 0xf8, 0xd0, 0x05, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, + 0x01, 0x20, 0x05, 0xf0, 0xdb, 0xfb, 0xdf, 0xf8, 0x18, 0x06, 0x00, 0x68, + 0x80, 0x47, 0x00, 0x20, 0x40, 0xf2, 0x85, 0x61, 0xcc, 0xf7, 0xd8, 0xfa, + 0x9a, 0x49, 0xdf, 0xf8, 0x94, 0xb5, 0xdf, 0xf8, 0x1c, 0x66, 0x00, 0x25, + 0x00, 0x27, 0x00, 0x24, 0x08, 0x68, 0xa0, 0xeb, 0x0a, 0x00, 0xcb, 0xf8, + 0x2c, 0x00, 0xd1, 0xf8, 0x00, 0xa0, 0x30, 0x68, 0x80, 0x47, 0x38, 0xb1, + 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x01, 0xd1, 0x01, 0x2c, 0x0d, 0xd9, + 0x01, 0x37, 0x13, 0xe0, 0xdf, 0xf8, 0x94, 0x15, 0x08, 0x68, 0x40, 0xf0, + 0x80, 0x00, 0x08, 0x60, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x1f, 0xd1, + 0x01, 0x2c, 0x1d, 0xd8, 0x99, 0xf8, 0x01, 0x00, 0x88, 0xf8, 0x00, 0x50, + 0x01, 0x34, 0x01, 0x30, 0x89, 0xf8, 0x01, 0x00, 0x03, 0x2f, 0xde, 0xd3, + 0x01, 0x20, 0xcd, 0xf7, 0x93, 0xfc, 0xdf, 0xf8, 0x48, 0x05, 0x01, 0x68, + 0x01, 0x20, 0x88, 0x47, 0x01, 0x20, 0x05, 0xf0, 0x97, 0xfb, 0xdf, 0xf8, + 0x90, 0x05, 0x00, 0x68, 0x80, 0x47, 0x00, 0x20, 0x40, 0xf2, 0xbd, 0x61, + 0xcc, 0xf7, 0x94, 0xfa, 0x78, 0x49, 0xdf, 0xf8, 0x9c, 0x65, 0x00, 0x25, + 0x00, 0x27, 0x00, 0x24, 0x08, 0x68, 0xa0, 0xeb, 0x0a, 0x00, 0xcb, 0xf8, + 0x30, 0x00, 0xd1, 0xf8, 0x00, 0xa0, 0x30, 0x68, 0x80, 0x47, 0x38, 0xb1, + 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x01, 0xd1, 0x01, 0x2c, 0x0d, 0xd9, + 0x01, 0x37, 0x13, 0xe0, 0xdf, 0xf8, 0x10, 0x15, 0x08, 0x68, 0x40, 0xf0, + 0x02, 0x00, 0x08, 0x60, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x1f, 0xd1, + 0x01, 0x2c, 0x1d, 0xd8, 0x99, 0xf8, 0x01, 0x00, 0x88, 0xf8, 0x00, 0x50, + 0x01, 0x34, 0x01, 0x30, 0x89, 0xf8, 0x01, 0x00, 0x03, 0x2f, 0xde, 0xd3, + 0x01, 0x20, 0xcd, 0xf7, 0x51, 0xfc, 0xdf, 0xf8, 0xc4, 0x04, 0x01, 0x68, + 0x01, 0x20, 0x88, 0x47, 0x01, 0x20, 0x05, 0xf0, 0x55, 0xfb, 0xdf, 0xf8, + 0x0c, 0x05, 0x00, 0x68, 0x80, 0x47, 0x00, 0x20, 0x40, 0xf2, 0xf2, 0x61, + 0xcc, 0xf7, 0x52, 0xfa, 0x57, 0x4d, 0x28, 0x68, 0xa0, 0xeb, 0x0a, 0x00, + 0xcb, 0xf8, 0x14, 0x00, 0xdf, 0xf8, 0x10, 0x05, 0x2c, 0x68, 0x00, 0x68, + 0x80, 0x47, 0x28, 0x68, 0x00, 0x1b, 0xcb, 0xf8, 0x34, 0x00, 0x05, 0xf0, + 0xb5, 0xff, 0xdf, 0xf8, 0x00, 0x05, 0xd5, 0xf8, 0x00, 0xa0, 0x60, 0x21, + 0xce, 0xf7, 0xe0, 0xfb, 0xdf, 0xf8, 0xf4, 0x54, 0x00, 0x24, 0x00, 0x27, + 0x00, 0x26, 0x28, 0x68, 0x80, 0x47, 0x38, 0xb1, 0x98, 0xf8, 0x00, 0x00, + 0x02, 0x28, 0x01, 0xd1, 0x01, 0x2e, 0x0d, 0xd9, 0x01, 0x37, 0x13, 0xe0, + 0xdf, 0xf8, 0x6c, 0x14, 0x08, 0x68, 0x40, 0xf4, 0x80, 0x50, 0x08, 0x60, + 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x22, 0xd1, 0x01, 0x2e, 0x20, 0xd8, + 0x99, 0xf8, 0x01, 0x00, 0x88, 0xf8, 0x00, 0x40, 0x01, 0x36, 0x01, 0x30, + 0x89, 0xf8, 0x01, 0x00, 0x03, 0x2f, 0xde, 0xd3, 0x01, 0x20, 0x00, 0xf0, + 0xc3, 0xfa, 0x01, 0x20, 0xcd, 0xf7, 0xfc, 0xfb, 0xdf, 0xf8, 0x18, 0x04, + 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x01, 0x20, 0x05, 0xf0, 0x00, 0xfb, + 0xdf, 0xf8, 0x60, 0x04, 0x00, 0x68, 0x80, 0x47, 0x00, 0x20, 0x40, 0xf2, + 0x44, 0x71, 0xcc, 0xf7, 0xfd, 0xf9, 0x2d, 0x49, 0xdf, 0xf8, 0x7c, 0x64, + 0x00, 0x25, 0x00, 0x27, 0x00, 0x24, 0x08, 0x68, 0xa0, 0xeb, 0x0a, 0x00, + 0xcb, 0xf8, 0x08, 0x00, 0xd1, 0xf8, 0x00, 0xa0, 0x30, 0x68, 0x80, 0x47, + 0x38, 0xb1, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x01, 0xd1, 0x01, 0x2c, + 0x0d, 0xd9, 0x01, 0x37, 0x13, 0xe0, 0xdf, 0xf8, 0xe4, 0x13, 0x08, 0x68, + 0x40, 0xf4, 0x00, 0x60, 0x08, 0x60, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, + 0x1f, 0xd1, 0x01, 0x2c, 0x1d, 0xd8, 0x99, 0xf8, 0x01, 0x00, 0x88, 0xf8, + 0x00, 0x50, 0x01, 0x34, 0x01, 0x30, 0x89, 0xf8, 0x01, 0x00, 0x03, 0x2f, + 0xde, 0xd3, 0x01, 0x20, 0xcd, 0xf7, 0xba, 0xfb, 0xdf, 0xf8, 0x94, 0x03, + 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x01, 0x20, 0x05, 0xf0, 0xbe, 0xfa, + 0xdf, 0xf8, 0xdc, 0x03, 0x00, 0x68, 0x80, 0x47, 0x00, 0x20, 0x4f, 0xf4, + 0xef, 0x61, 0xcc, 0xf7, 0xbb, 0xf9, 0xd8, 0x49, 0xdf, 0xf8, 0xfc, 0x63, + 0x00, 0x25, 0x00, 0x27, 0x00, 0x24, 0x08, 0x68, 0xa0, 0xeb, 0x0a, 0x00, + 0xcb, 0xf8, 0x38, 0x00, 0xd1, 0xf8, 0x00, 0xa0, 0x30, 0x68, 0x80, 0x47, + 0x50, 0xb1, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x01, 0xd1, 0x01, 0x2c, + 0x0f, 0xd9, 0x01, 0x37, 0x15, 0xe0, 0x00, 0xbf, 0x24, 0x20, 0x00, 0x40, + 0xd6, 0x49, 0x08, 0x68, 0x40, 0xf4, 0x80, 0x60, 0x08, 0x60, 0x98, 0xf8, + 0x00, 0x00, 0x02, 0x28, 0x1d, 0xd1, 0x01, 0x2c, 0x1b, 0xd8, 0x99, 0xf8, + 0x01, 0x00, 0x88, 0xf8, 0x00, 0x50, 0x01, 0x34, 0x01, 0x30, 0x89, 0xf8, + 0x01, 0x00, 0x03, 0x2f, 0xdc, 0xd3, 0x01, 0x20, 0xcd, 0xf7, 0x76, 0xfb, + 0xc3, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x01, 0x20, 0x05, 0xf0, + 0x7b, 0xfa, 0xd6, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x20, 0x40, 0xf2, + 0xac, 0x71, 0xcc, 0xf7, 0x79, 0xf9, 0xb7, 0x49, 0x08, 0x68, 0xa0, 0xeb, + 0x0a, 0x00, 0xcb, 0xf8, 0x3c, 0x00, 0xdd, 0x48, 0xd1, 0xf8, 0x00, 0xa0, + 0x00, 0x78, 0x01, 0x28, 0x03, 0xd0, 0xdb, 0x48, 0x00, 0x78, 0x01, 0x28, + 0x3d, 0xd1, 0xda, 0x48, 0xda, 0x4d, 0x40, 0xf2, 0x01, 0x11, 0x4f, 0xf0, + 0x00, 0x0b, 0x00, 0x27, 0x00, 0x24, 0xa0, 0xf8, 0xb4, 0x12, 0x28, 0x68, + 0x80, 0x47, 0x06, 0x46, 0x20, 0xb3, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, + 0x0a, 0xd1, 0x01, 0x2c, 0x08, 0xd8, 0x99, 0xf8, 0x01, 0x00, 0x88, 0xf8, + 0x00, 0xb0, 0x01, 0x34, 0x01, 0x30, 0x89, 0xf8, 0x01, 0x00, 0x00, 0xe0, + 0x01, 0x37, 0x03, 0x2f, 0xe9, 0xd3, 0x01, 0x20, 0xcd, 0xf7, 0x34, 0xfb, + 0xa2, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x01, 0x20, 0x05, 0xf0, + 0x39, 0xfa, 0xb5, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x20, 0x40, 0xf2, + 0xe4, 0x71, 0xcc, 0xf7, 0x37, 0xf9, 0x02, 0xe0, 0xc2, 0x48, 0x00, 0x68, + 0x80, 0x47, 0xc2, 0x48, 0xdf, 0xf8, 0x48, 0xb2, 0x01, 0x21, 0x01, 0x70, + 0x05, 0xe0, 0x00, 0x26, 0xac, 0xe0, 0xbb, 0x48, 0x00, 0x26, 0xa0, 0xf8, + 0xb4, 0x62, 0x8e, 0x4c, 0x00, 0x25, 0x20, 0x68, 0xa0, 0xeb, 0x0a, 0x00, + 0xcb, 0xf8, 0x44, 0x00, 0x00, 0x20, 0xcd, 0xf7, 0x0b, 0xfb, 0xa4, 0x48, + 0x00, 0x68, 0x80, 0x47, 0xd4, 0xf8, 0x00, 0xb0, 0xb5, 0x4f, 0x00, 0x24, + 0x4f, 0xf0, 0x00, 0x0a, 0x38, 0x68, 0x80, 0x47, 0x40, 0xb1, 0x98, 0xf8, + 0x00, 0x00, 0x02, 0x28, 0x02, 0xd1, 0xba, 0xf1, 0x01, 0x0f, 0x0d, 0xd9, + 0x01, 0x34, 0x14, 0xe0, 0x8a, 0x49, 0x08, 0x68, 0x40, 0xf4, 0x00, 0x50, + 0x08, 0x60, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x1f, 0xd1, 0xba, 0xf1, + 0x01, 0x0f, 0x1c, 0xd8, 0x99, 0xf8, 0x01, 0x00, 0x88, 0xf8, 0x00, 0x50, + 0x0a, 0xf1, 0x01, 0x0a, 0x01, 0x30, 0x89, 0xf8, 0x01, 0x00, 0x03, 0x2c, + 0xdc, 0xd3, 0x01, 0x20, 0xcd, 0xf7, 0xdc, 0xfa, 0x76, 0x48, 0x01, 0x68, + 0x01, 0x20, 0x88, 0x47, 0x01, 0x20, 0x05, 0xf0, 0xe1, 0xf9, 0x89, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x00, 0x20, 0x40, 0xf6, 0x33, 0x01, 0xcc, 0xf7, + 0xdf, 0xf8, 0xec, 0x4c, 0x68, 0x49, 0x20, 0x68, 0xa0, 0xeb, 0x0b, 0x00, + 0x08, 0x64, 0x82, 0x48, 0x00, 0x68, 0x80, 0x47, 0x20, 0x68, 0x95, 0x4f, + 0x4f, 0xf0, 0x00, 0x0b, 0x00, 0x24, 0x00, 0x25, 0x06, 0x90, 0x38, 0x68, + 0x80, 0x47, 0x38, 0xb1, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, 0x01, 0xd1, + 0x01, 0x2d, 0x0c, 0xd9, 0x01, 0x34, 0x12, 0xe0, 0x68, 0x49, 0x08, 0x68, + 0x40, 0xf4, 0x80, 0x40, 0x08, 0x60, 0x98, 0xf8, 0x00, 0x00, 0x02, 0x28, + 0x22, 0xd1, 0x01, 0x2d, 0x20, 0xd8, 0x99, 0xf8, 0x01, 0x00, 0x88, 0xf8, + 0x00, 0xb0, 0x01, 0x35, 0x01, 0x30, 0x89, 0xf8, 0x01, 0x00, 0x03, 0x2c, + 0xdf, 0xd3, 0x83, 0x48, 0x90, 0xf8, 0x73, 0x01, 0xcd, 0xf7, 0x98, 0xfa, + 0x54, 0x4d, 0x01, 0x20, 0x01, 0x26, 0x29, 0x68, 0x88, 0x47, 0xdf, 0xf8, + 0xa0, 0xa1, 0xda, 0xf8, 0x00, 0x00, 0x80, 0x47, 0xdd, 0xf8, 0x0c, 0x80, + 0xdf, 0xf8, 0x20, 0xb1, 0xdd, 0xe9, 0x01, 0x79, 0x48, 0x4c, 0x09, 0xe0, + 0xdd, 0xf8, 0x0c, 0x80, 0xdf, 0xf8, 0x10, 0xb1, 0xdd, 0xe9, 0x01, 0x79, + 0x44, 0x4c, 0x48, 0x4d, 0xdf, 0xf8, 0x74, 0xa1, 0xc3, 0x48, 0x00, 0x68, + 0x06, 0x99, 0x40, 0x1a, 0x29, 0x68, 0xcb, 0xf8, 0x10, 0x00, 0x01, 0x20, + 0x88, 0x47, 0xda, 0xf8, 0x00, 0x00, 0x80, 0x47, 0x6d, 0x48, 0x00, 0x68, + 0x80, 0x47, 0xca, 0x46, 0x00, 0x20, 0x4f, 0xf0, 0x00, 0x09, 0xcd, 0xf7, + 0x67, 0xfa, 0x44, 0x48, 0x04, 0x21, 0x00, 0x22, 0x00, 0x23, 0x81, 0x70, + 0x3a, 0x48, 0x00, 0x21, 0x05, 0x68, 0x00, 0x20, 0xa8, 0x47, 0x39, 0x48, + 0x00, 0x21, 0x6f, 0xf0, 0x7e, 0x02, 0x03, 0x68, 0x00, 0x20, 0x98, 0x47, + 0x36, 0x48, 0x00, 0x21, 0x6f, 0xf0, 0x7e, 0x02, 0x03, 0x68, 0x00, 0x20, + 0x98, 0x47, 0x03, 0x2f, 0x84, 0xf8, 0x00, 0x90, 0x02, 0xd0, 0x5c, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x30, 0x46, 0x05, 0xf0, 0x51, 0xf9, 0x5a, 0x48, + 0x00, 0x68, 0x80, 0x47, 0xa6, 0x48, 0x23, 0x4a, 0x00, 0x21, 0x48, 0x23, + 0x00, 0x68, 0xa0, 0xeb, 0x0a, 0x00, 0xcb, 0xf8, 0x00, 0x00, 0x55, 0x48, + 0x05, 0x68, 0x40, 0xf2, 0x35, 0x70, 0xa8, 0x47, 0x98, 0xf8, 0x00, 0x00, + 0x88, 0xf8, 0x01, 0x90, 0x01, 0x28, 0x2d, 0xd1, 0x50, 0x48, 0x01, 0x68, + 0x41, 0xf0, 0x70, 0x41, 0x01, 0x60, 0x41, 0x68, 0x41, 0xf0, 0x40, 0x41, + 0x41, 0x60, 0x4d, 0x48, 0xc1, 0x69, 0x41, 0xf4, 0xc0, 0x61, 0xc1, 0x61, + 0x01, 0x68, 0x41, 0xf4, 0x40, 0x71, 0x01, 0x60, 0x49, 0x49, 0x0a, 0x68, + 0x42, 0xf0, 0x70, 0x42, 0x0a, 0x60, 0x4a, 0x68, 0x42, 0xf0, 0x40, 0x42, + 0x4a, 0x60, 0xc1, 0x69, 0x41, 0xf4, 0xc0, 0x71, 0xc1, 0x61, 0x41, 0x6a, + 0x41, 0xf4, 0x40, 0x71, 0x41, 0x62, 0x01, 0x20, 0x03, 0x21, 0xce, 0xf7, + 0x3f, 0xfc, 0x01, 0x20, 0x03, 0x21, 0xcc, 0xf7, 0x0f, 0xff, 0x00, 0x20, + 0x88, 0xf8, 0x00, 0x00, 0x00, 0x20, 0x07, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x64, 0xd4, 0x05, 0x00, 0xe4, 0xfe, 0x05, 0x00, 0x24, 0x20, 0x00, 0x40, + 0xa6, 0x58, 0x01, 0x00, 0x90, 0xe4, 0x01, 0x00, 0xf0, 0xe2, 0x01, 0x00, + 0x9c, 0xfd, 0x08, 0x00, 0x88, 0xe5, 0x08, 0x00, 0x04, 0x99, 0x08, 0x00, + 0x48, 0x97, 0x08, 0x00, 0x4c, 0x97, 0x08, 0x00, 0x40, 0xbc, 0x08, 0x00, + 0x54, 0xbc, 0x08, 0x00, 0x4c, 0xfd, 0x08, 0x00, 0x98, 0xe9, 0x01, 0x00, + 0x74, 0x2a, 0x01, 0x00, 0x9c, 0xe9, 0x01, 0x00, 0x50, 0xfd, 0x08, 0x00, + 0x44, 0xbc, 0x08, 0x00, 0x54, 0xfd, 0x08, 0x00, 0x00, 0x69, 0x08, 0x00, + 0x34, 0xec, 0x01, 0x00, 0x40, 0xec, 0x01, 0x00, 0x3c, 0xfc, 0x08, 0x00, + 0x50, 0xbc, 0x08, 0x00, 0x34, 0xbc, 0x08, 0x00, 0x58, 0xfd, 0x08, 0x00, + 0x5c, 0xfd, 0x08, 0x00, 0x60, 0x14, 0x01, 0x00, 0x60, 0xfd, 0x08, 0x00, + 0x30, 0xe4, 0x01, 0x00, 0x64, 0xfd, 0x08, 0x00, 0x68, 0xfd, 0x08, 0x00, + 0x6c, 0xfd, 0x08, 0x00, 0x70, 0xe3, 0x01, 0x00, 0x70, 0xfd, 0x08, 0x00, + 0x74, 0xfd, 0x08, 0x00, 0x78, 0xfd, 0x08, 0x00, 0x4c, 0xbc, 0x08, 0x00, + 0x58, 0xe1, 0x01, 0x00, 0x7c, 0xfd, 0x08, 0x00, 0x80, 0xfd, 0x08, 0x00, + 0x84, 0xfd, 0x08, 0x00, 0xa8, 0x58, 0x01, 0x00, 0xa9, 0x58, 0x01, 0x00, + 0x98, 0xca, 0x01, 0x00, 0x84, 0x9a, 0x08, 0x00, 0x98, 0xfd, 0x08, 0x00, + 0xa7, 0x58, 0x01, 0x00, 0x88, 0xfd, 0x08, 0x00, 0x8c, 0xfd, 0x08, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x24, 0xbc, 0x08, 0x00, 0xa4, 0xfd, 0x08, 0x00, + 0x90, 0xfd, 0x08, 0x00, 0x78, 0x9b, 0x08, 0x00, 0x28, 0xd8, 0x05, 0x30, + 0x5c, 0xc0, 0x05, 0x30, 0x28, 0xf0, 0x05, 0x30, 0x10, 0xb5, 0x1f, 0x48, + 0x90, 0xf8, 0xef, 0x12, 0xca, 0x07, 0x02, 0xd1, 0x1d, 0x4a, 0x00, 0x23, + 0x16, 0xe0, 0x1c, 0x4a, 0x44, 0xf2, 0x24, 0x14, 0x13, 0x68, 0x23, 0x43, + 0x13, 0x60, 0x90, 0xf9, 0xe4, 0x22, 0x00, 0x2a, 0x0d, 0xd4, 0x18, 0x4a, + 0x13, 0x68, 0x43, 0xf0, 0x02, 0x03, 0x13, 0x60, 0x16, 0x4a, 0x13, 0x68, + 0x23, 0xf0, 0x30, 0x03, 0x13, 0x60, 0x13, 0x68, 0x43, 0xf0, 0x30, 0x03, + 0x13, 0x60, 0x89, 0x07, 0x02, 0xd4, 0x12, 0x48, 0x00, 0x21, 0x16, 0xe0, + 0x10, 0x49, 0x44, 0xf2, 0x24, 0x13, 0x0a, 0x68, 0x1a, 0x43, 0x0a, 0x60, + 0x90, 0xf9, 0xe4, 0x02, 0x00, 0x28, 0x0d, 0xd4, 0x09, 0x48, 0x01, 0x68, + 0x41, 0xf0, 0x02, 0x01, 0x01, 0x60, 0x08, 0x48, 0x01, 0x68, 0x21, 0xf0, + 0xc0, 0x01, 0x01, 0x60, 0x01, 0x68, 0x41, 0xf0, 0xc0, 0x01, 0x01, 0x60, + 0x10, 0xbd, 0x00, 0xbf, 0x00, 0x69, 0x08, 0x00, 0x10, 0xd6, 0x05, 0x30, + 0x48, 0x80, 0x02, 0x40, 0x54, 0xc0, 0x05, 0x30, 0x10, 0xee, 0x05, 0x30, + 0x00, 0x28, 0x41, 0xd0, 0xf8, 0xb5, 0x21, 0x4c, 0x41, 0xf2, 0x3c, 0x01, + 0x20, 0x46, 0xce, 0xf7, 0xeb, 0xf8, 0x1f, 0x48, 0x41, 0xf2, 0x34, 0x02, + 0x1e, 0x4e, 0x04, 0xf6, 0x1c, 0x03, 0x00, 0x25, 0x01, 0x68, 0xa1, 0x50, + 0x41, 0xf2, 0x14, 0x01, 0x1b, 0x4a, 0x21, 0x44, 0x9e, 0x50, 0x01, 0x35, + 0x80, 0xce, 0xff, 0x2d, 0x80, 0xc3, 0xf9, 0xd1, 0xff, 0x23, 0x18, 0x4e, + 0x00, 0x25, 0x84, 0xf8, 0x20, 0x30, 0x04, 0xf6, 0x18, 0x43, 0x9e, 0x50, + 0x01, 0x35, 0x80, 0xce, 0xff, 0x2d, 0x80, 0xc3, 0xf9, 0xd1, 0x13, 0x4a, + 0x8a, 0x60, 0x12, 0x68, 0xca, 0x60, 0x12, 0x4a, 0x0a, 0x60, 0x12, 0x68, + 0x4a, 0x60, 0x11, 0x4a, 0x0a, 0x61, 0x13, 0x68, 0x4b, 0x61, 0x02, 0xf5, + 0x20, 0x63, 0x8b, 0x61, 0xd2, 0xf8, 0x00, 0x2a, 0xca, 0x61, 0xff, 0x22, + 0x84, 0xf8, 0x21, 0x20, 0x00, 0x68, 0x0a, 0x6a, 0x80, 0x1a, 0x48, 0x62, + 0xbd, 0xe8, 0xf8, 0x40, 0x70, 0x47, 0x00, 0xbf, 0x2c, 0xff, 0x05, 0x00, + 0x24, 0x20, 0x00, 0x40, 0x04, 0xd2, 0x00, 0x40, 0x08, 0xf8, 0xff, 0xff, + 0x04, 0xdc, 0x00, 0x40, 0x04, 0x0e, 0x03, 0x40, 0x00, 0x0e, 0x23, 0x40, + 0x00, 0x72, 0x23, 0x40, 0x2d, 0xe9, 0xf0, 0x47, 0x82, 0x46, 0x54, 0x48, + 0xdf, 0xf8, 0x50, 0x81, 0x0c, 0x46, 0x06, 0x68, 0xd8, 0xf8, 0x00, 0x10, + 0x43, 0x20, 0x88, 0x47, 0x51, 0x4a, 0x00, 0x21, 0x51, 0x4f, 0x10, 0x68, + 0x00, 0xf0, 0x0f, 0x00, 0x01, 0x38, 0x02, 0x28, 0x38, 0xbf, 0x01, 0x21, + 0x87, 0xf8, 0xc2, 0x12, 0x4c, 0xb1, 0xc6, 0xf3, 0x80, 0x70, 0xba, 0xf1, + 0x01, 0x0f, 0x14, 0xbf, 0x4a, 0x49, 0x4b, 0x49, 0x09, 0x68, 0x09, 0x0c, + 0x06, 0xe0, 0xba, 0xf1, 0x01, 0x0f, 0x14, 0xbf, 0x46, 0x49, 0x47, 0x49, + 0xf0, 0x0f, 0x09, 0x68, 0x70, 0xb3, 0x01, 0xf0, 0x0f, 0x06, 0x21, 0x46, + 0x15, 0x46, 0x30, 0x46, 0x05, 0xf0, 0x80, 0xf9, 0x01, 0x28, 0x25, 0xd1, + 0x41, 0x48, 0x29, 0x46, 0x07, 0xf5, 0x2f, 0x79, 0x27, 0x44, 0x00, 0x68, + 0x29, 0x68, 0x89, 0xf8, 0x03, 0x10, 0x87, 0xf8, 0xb8, 0x62, 0x07, 0xf5, + 0x2e, 0x76, 0xec, 0xb1, 0x81, 0x03, 0x54, 0xbf, 0x00, 0xf0, 0x7f, 0x00, + 0xc0, 0xf3, 0x05, 0x20, 0x87, 0xf8, 0xbc, 0x02, 0x38, 0x49, 0x37, 0x48, + 0x0a, 0x68, 0x20, 0x44, 0xc2, 0xf3, 0x00, 0x62, 0x80, 0xf8, 0xa0, 0x20, + 0x09, 0x68, 0x80, 0xf8, 0xa2, 0x10, 0x34, 0x48, 0x00, 0x68, 0x87, 0xf8, + 0xc0, 0x02, 0x1b, 0xe0, 0xd8, 0xf8, 0x00, 0x10, 0x44, 0x20, 0xbd, 0xe8, + 0xf0, 0x47, 0x08, 0x47, 0xc1, 0x03, 0x54, 0xbf, 0x00, 0xf0, 0x7f, 0x00, + 0xc0, 0xf3, 0x05, 0x20, 0x89, 0xf8, 0x00, 0x00, 0x28, 0x4a, 0x2b, 0x48, + 0x01, 0x68, 0xc1, 0xf3, 0x00, 0x61, 0x82, 0xf8, 0xa0, 0x10, 0x00, 0x68, + 0x82, 0xf8, 0xa2, 0x00, 0x27, 0x48, 0x00, 0x68, 0x89, 0xf8, 0x04, 0x00, + 0xfe, 0xf7, 0xf0, 0xfa, 0x28, 0xb1, 0xd4, 0x48, 0x90, 0xf8, 0xe4, 0x02, + 0x00, 0xf0, 0x0f, 0x00, 0x02, 0xe0, 0xd2, 0x48, 0x20, 0x44, 0x40, 0x7b, + 0xd0, 0x4b, 0x04, 0xeb, 0x84, 0x02, 0x31, 0x78, 0xba, 0xf1, 0x00, 0x0f, + 0x03, 0xeb, 0x82, 0x12, 0x02, 0xeb, 0x40, 0x10, 0x08, 0x44, 0x14, 0xbf, + 0x00, 0xf5, 0x3b, 0x70, 0x00, 0xf5, 0x37, 0x70, 0x97, 0xf8, 0xc0, 0x12, + 0x00, 0x78, 0x08, 0x1a, 0x99, 0xf8, 0x06, 0x10, 0x89, 0xf8, 0x09, 0x00, + 0x40, 0xb2, 0x01, 0x29, 0xc2, 0x49, 0x14, 0xbf, 0x91, 0xf8, 0x11, 0x13, + 0x91, 0xf8, 0x12, 0x13, 0x49, 0x42, 0x88, 0x42, 0xb4, 0xda, 0x0a, 0x48, + 0x00, 0x21, 0x20, 0x44, 0x80, 0xf8, 0xa0, 0x10, 0xae, 0xe7, 0x00, 0xbf, + 0x10, 0xc0, 0x05, 0x30, 0x00, 0x9d, 0x08, 0x00, 0x20, 0x00, 0x23, 0x40, + 0x98, 0xca, 0x01, 0x00, 0x24, 0x20, 0x21, 0x40, 0x40, 0x10, 0x21, 0x40, + 0x14, 0xc0, 0x05, 0x30, 0xd8, 0x21, 0x06, 0x00, 0x08, 0x54, 0x05, 0x30, + 0x70, 0x7a, 0x23, 0x40, 0x08, 0x50, 0x05, 0x30, 0x90, 0x71, 0x23, 0x40, + 0xf8, 0xb5, 0xfe, 0xf7, 0xa1, 0xfa, 0x40, 0xb1, 0xac, 0x48, 0xad, 0x49, + 0x90, 0xf8, 0xe4, 0x02, 0x00, 0xf0, 0x0f, 0x00, 0x01, 0xf8, 0x0d, 0x0f, + 0x48, 0x70, 0x04, 0xf0, 0x25, 0xff, 0x21, 0x48, 0x40, 0x79, 0x01, 0x28, + 0x2f, 0xd1, 0xad, 0x48, 0x00, 0x21, 0xae, 0x4a, 0x20, 0x4b, 0xa0, 0xf8, + 0xb4, 0x12, 0xa3, 0x48, 0x40, 0x7b, 0x02, 0xeb, 0x40, 0x10, 0x42, 0x1c, + 0x12, 0xf8, 0x01, 0x4c, 0x15, 0x78, 0x56, 0x78, 0x97, 0x78, 0x01, 0x31, + 0x04, 0x32, 0x03, 0x29, 0x44, 0xea, 0x05, 0x24, 0x44, 0xea, 0x06, 0x44, + 0x44, 0xea, 0x07, 0x64, 0x10, 0xc3, 0xef, 0xd1, 0x15, 0x4a, 0x00, 0x21, + 0x00, 0x23, 0x44, 0x18, 0x01, 0x33, 0x25, 0x7c, 0x66, 0x7c, 0xa7, 0x7c, + 0xe4, 0x7c, 0x03, 0x2b, 0x45, 0xea, 0x06, 0x25, 0x45, 0xea, 0x07, 0x45, + 0x45, 0xea, 0x04, 0x64, 0x54, 0x50, 0x01, 0xf1, 0x04, 0x01, 0xee, 0xd1, + 0xf8, 0xbd, 0x08, 0x48, 0x00, 0x78, 0x01, 0x28, 0x03, 0xd0, 0x07, 0x48, + 0x00, 0x78, 0x01, 0x28, 0xf6, 0xd1, 0x91, 0x48, 0x40, 0xf2, 0x01, 0x11, + 0xa0, 0xf8, 0xb4, 0x12, 0xf8, 0xbd, 0x00, 0xbf, 0x48, 0xdc, 0x05, 0x00, + 0xa8, 0x58, 0x01, 0x00, 0xa9, 0x58, 0x01, 0x00, 0xc0, 0xe2, 0x01, 0x00, + 0xd8, 0xe2, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x93, 0xb0, 0x7f, 0x4b, + 0x7f, 0x4d, 0x86, 0x4c, 0x4f, 0xf0, 0x00, 0x08, 0xb3, 0xf8, 0x06, 0x03, + 0x29, 0x46, 0x08, 0x95, 0x93, 0xf8, 0x04, 0x23, 0x93, 0xf8, 0x03, 0x13, + 0x25, 0xf8, 0x04, 0x0f, 0x93, 0xf8, 0xdc, 0x02, 0x93, 0xf8, 0x05, 0x33, + 0xa9, 0x70, 0xea, 0x70, 0x0c, 0x95, 0x00, 0xf0, 0x80, 0x00, 0x2b, 0x71, + 0x68, 0x71, 0x74, 0x48, 0x07, 0x90, 0x74, 0x48, 0x06, 0x90, 0x74, 0x48, + 0x05, 0x90, 0x74, 0x48, 0x04, 0x90, 0xb8, 0xf1, 0x07, 0x0f, 0x03, 0xd3, + 0xb8, 0xf1, 0x0c, 0x0f, 0x40, 0x46, 0x00, 0xd3, 0x07, 0x20, 0xc1, 0x1f, + 0x69, 0x48, 0x00, 0x22, 0xcd, 0xf8, 0x28, 0x80, 0x08, 0x44, 0x00, 0xf2, + 0xe6, 0x20, 0xcd, 0xe9, 0x01, 0x01, 0x48, 0x00, 0x03, 0x90, 0x64, 0x48, + 0x03, 0x99, 0xb0, 0xf8, 0xde, 0x02, 0xc8, 0x40, 0x00, 0xf0, 0x03, 0x00, + 0x41, 0x1e, 0x02, 0x29, 0x06, 0xd2, 0x65, 0x49, 0x02, 0xeb, 0x82, 0x00, + 0x08, 0x44, 0x02, 0x99, 0x47, 0x56, 0x05, 0xe0, 0x03, 0x28, 0x12, 0xbf, + 0x00, 0x27, 0x01, 0x98, 0x90, 0xf9, 0x00, 0x70, 0x08, 0x99, 0x02, 0xeb, + 0x82, 0x00, 0x4f, 0xf0, 0x00, 0x0b, 0x4f, 0xf0, 0x00, 0x0a, 0x09, 0x92, + 0x01, 0xeb, 0x80, 0x11, 0x0b, 0x91, 0x04, 0x99, 0x01, 0xeb, 0xc0, 0x11, + 0x10, 0x91, 0x05, 0x99, 0x01, 0xeb, 0xc0, 0x11, 0x0f, 0x91, 0x06, 0x99, + 0x01, 0xeb, 0xc0, 0x11, 0x0e, 0x91, 0x07, 0x99, 0x01, 0xeb, 0xc0, 0x10, + 0x0d, 0x90, 0x4b, 0x48, 0x00, 0xf2, 0x1d, 0x39, 0x0c, 0x98, 0x80, 0x78, + 0x80, 0x45, 0x08, 0xd9, 0xb8, 0xf1, 0x0b, 0x0f, 0x48, 0x46, 0x05, 0xd8, + 0x45, 0x48, 0x50, 0x44, 0x00, 0xf2, 0x13, 0x30, 0x00, 0xe0, 0x48, 0x46, + 0x0d, 0x9d, 0x49, 0x4a, 0x55, 0xf8, 0x1b, 0x10, 0xc1, 0xf3, 0x44, 0x31, + 0x90, 0xf9, 0x00, 0x00, 0x13, 0x68, 0x12, 0xaa, 0x38, 0x1a, 0x80, 0x00, + 0x98, 0x47, 0x06, 0x46, 0x0f, 0x98, 0x10, 0x9a, 0x12, 0x99, 0xb8, 0xf1, + 0x0b, 0x0f, 0xa4, 0xf8, 0xee, 0x62, 0x50, 0xf8, 0x1b, 0x00, 0x84, 0xf8, + 0xf0, 0x12, 0x42, 0xf8, 0x1b, 0x00, 0x55, 0xf8, 0x1b, 0x00, 0x0e, 0x9a, + 0x20, 0xf4, 0x78, 0x30, 0x40, 0xea, 0x41, 0x30, 0x42, 0xf8, 0x1b, 0x00, + 0x2a, 0xd8, 0x0b, 0x98, 0xdf, 0xf8, 0xe0, 0x80, 0x3c, 0x46, 0x11, 0xaf, + 0x31, 0x46, 0x3a, 0x46, 0x00, 0xeb, 0x0b, 0x05, 0xd8, 0xf8, 0x00, 0x30, + 0x95, 0xf8, 0x5c, 0x00, 0x98, 0x47, 0x95, 0xf8, 0x5c, 0x10, 0x9d, 0xf8, + 0x44, 0x20, 0x95, 0xf8, 0x6c, 0x00, 0xd8, 0xf8, 0x00, 0x30, 0x11, 0x44, + 0x3a, 0x46, 0x27, 0x46, 0x85, 0xf8, 0x5c, 0x10, 0x85, 0xf8, 0xdc, 0x12, + 0x31, 0x46, 0x98, 0x47, 0x95, 0xf8, 0x6c, 0x00, 0x9d, 0xf8, 0x44, 0x10, + 0xdd, 0xf8, 0x28, 0x80, 0x25, 0x4c, 0x08, 0x44, 0x85, 0xf8, 0xec, 0x02, + 0x85, 0xf8, 0x6c, 0x00, 0x0a, 0xf1, 0x01, 0x0a, 0x09, 0xf1, 0x01, 0x09, + 0x0b, 0xf1, 0x20, 0x0b, 0xba, 0xf1, 0x0a, 0x0f, 0x98, 0xd1, 0x09, 0x98, + 0x01, 0x22, 0x00, 0x28, 0x3f, 0xf4, 0x5f, 0xaf, 0x08, 0x98, 0x08, 0xf1, + 0x01, 0x08, 0xb8, 0xf1, 0x10, 0x0f, 0x00, 0xf1, 0x01, 0x00, 0x08, 0x90, + 0x04, 0x98, 0x00, 0xf1, 0x04, 0x00, 0x04, 0x90, 0x05, 0x98, 0x00, 0xf1, + 0x04, 0x00, 0x05, 0x90, 0x06, 0x98, 0x00, 0xf1, 0x04, 0x00, 0x06, 0x90, + 0x07, 0x98, 0x00, 0xf1, 0x04, 0x00, 0x07, 0x90, 0x7f, 0xf4, 0x31, 0xaf, + 0x0c, 0x98, 0x4f, 0xf4, 0xa0, 0x71, 0x4f, 0xf4, 0xa0, 0x73, 0x00, 0xf5, + 0x36, 0x72, 0x0d, 0x48, 0xcb, 0xf7, 0xec, 0xfc, 0x13, 0xb0, 0xbd, 0xe8, + 0xf0, 0x8f, 0x00, 0xbf, 0x00, 0x69, 0x08, 0x00, 0xf0, 0xd1, 0x01, 0x00, + 0x58, 0xd7, 0x01, 0x00, 0x58, 0xdc, 0x01, 0x00, 0xb4, 0x10, 0x06, 0x00, + 0xb4, 0x15, 0x06, 0x00, 0xa8, 0x10, 0x06, 0x00, 0xac, 0xfb, 0x08, 0x00, + 0x98, 0xca, 0x01, 0x00, 0xb0, 0xfb, 0x08, 0x00, 0x68, 0x0f, 0x06, 0x00, + 0x2d, 0xe9, 0xf0, 0x4f, 0x9f, 0xb0, 0xdf, 0xf8, 0xa4, 0x14, 0x00, 0x20, + 0xcd, 0xe9, 0x1d, 0x00, 0x91, 0xf8, 0xca, 0x02, 0x80, 0x07, 0x00, 0xf1, + 0x45, 0x82, 0xdf, 0xf8, 0x94, 0x04, 0x01, 0xf5, 0x25, 0x78, 0x01, 0x68, + 0x41, 0x20, 0x88, 0x47, 0x1d, 0xa8, 0xdf, 0xf8, 0x80, 0x14, 0xcd, 0xf8, + 0x60, 0x80, 0x04, 0x30, 0x15, 0x90, 0xdf, 0xf8, 0x7c, 0x04, 0x04, 0x30, + 0x12, 0x90, 0xdf, 0xf8, 0x78, 0x04, 0xc4, 0x30, 0x11, 0x90, 0x09, 0x20, + 0x1a, 0x90, 0x05, 0x20, 0x14, 0x90, 0x00, 0x20, 0x06, 0x90, 0x00, 0x20, + 0x0c, 0x18, 0x07, 0x46, 0x94, 0xf8, 0xbc, 0x02, 0x90, 0xb1, 0x94, 0xf8, + 0xb4, 0x02, 0x78, 0xb1, 0x94, 0xf8, 0xb6, 0x02, 0xa8, 0xb1, 0xfe, 0xf7, + 0xf9, 0xf8, 0x50, 0xb1, 0xdf, 0xf8, 0x50, 0x04, 0x90, 0xf8, 0xe4, 0x02, + 0x00, 0xf0, 0x0f, 0x00, 0x06, 0x90, 0x1a, 0x90, 0x14, 0x90, 0x08, 0xe0, + 0xe8, 0xe1, 0xdf, 0xf8, 0x2c, 0x04, 0x38, 0x44, 0x41, 0x7b, 0x08, 0x46, + 0x06, 0x91, 0x1a, 0x91, 0x14, 0x91, 0x04, 0xf5, 0x2d, 0x70, 0x01, 0x90, + 0x12, 0x98, 0x40, 0x78, 0x0f, 0x28, 0x00, 0xf2, 0x88, 0x81, 0x04, 0xf5, + 0x2f, 0x71, 0x00, 0x2f, 0x07, 0xeb, 0x87, 0x02, 0x0c, 0x91, 0xd4, 0x49, + 0x04, 0xbf, 0x4d, 0xf2, 0x14, 0x61, 0xc3, 0xf2, 0x05, 0x01, 0x0b, 0x91, + 0xd1, 0x49, 0x04, 0xbf, 0x4c, 0xf2, 0xa4, 0x01, 0xc3, 0xf2, 0x05, 0x01, + 0x0a, 0x91, 0xcf, 0x49, 0x04, 0xbf, 0x47, 0xf2, 0x1c, 0x11, 0xc4, 0xf2, + 0x23, 0x01, 0x04, 0x91, 0xcc, 0x49, 0x04, 0xbf, 0x47, 0xf2, 0x2c, 0x11, + 0xc4, 0xf2, 0x23, 0x01, 0x05, 0x91, 0x06, 0x9b, 0x09, 0x92, 0x0d, 0x94, + 0x16, 0x97, 0xdf, 0xf8, 0xb8, 0x13, 0x01, 0xeb, 0x42, 0x01, 0x03, 0x91, + 0x04, 0xf5, 0x30, 0x71, 0x08, 0x91, 0xdf, 0xf8, 0xc4, 0x13, 0x39, 0x44, + 0xa2, 0x31, 0x07, 0x91, 0x91, 0x01, 0x12, 0x9a, 0x01, 0xeb, 0x43, 0x11, + 0x01, 0x44, 0x11, 0x44, 0x01, 0xf5, 0x3a, 0x71, 0x13, 0x91, 0x59, 0x1e, + 0x02, 0x91, 0x05, 0x46, 0x0b, 0x28, 0x11, 0x98, 0x8c, 0xbf, 0x80, 0x78, + 0x00, 0x88, 0xe8, 0x40, 0xc0, 0x07, 0x00, 0xf0, 0x36, 0x81, 0x12, 0x98, + 0x40, 0x78, 0x10, 0xb1, 0x0b, 0x2d, 0x00, 0xf2, 0x30, 0x81, 0x12, 0x98, + 0x00, 0x78, 0x85, 0x42, 0x02, 0xd3, 0x0c, 0x2d, 0x2e, 0x46, 0x00, 0xd3, + 0x06, 0x46, 0x30, 0x46, 0x39, 0x46, 0x04, 0xf0, 0xcd, 0xfe, 0x00, 0x28, + 0x00, 0xf0, 0x21, 0x81, 0x1a, 0x98, 0x06, 0x99, 0x81, 0x42, 0x00, 0xf3, + 0x1c, 0x81, 0x03, 0x99, 0x06, 0xeb, 0x86, 0x00, 0xdd, 0xf8, 0x4c, 0x90, + 0x02, 0x9c, 0xdd, 0xf8, 0x18, 0xa0, 0x01, 0xeb, 0x80, 0x00, 0x10, 0x90, + 0xca, 0x48, 0x00, 0xeb, 0x46, 0x00, 0x38, 0x44, 0x00, 0xf5, 0x25, 0x70, + 0x17, 0x90, 0xf0, 0x1f, 0x0f, 0x90, 0x06, 0xf0, 0xfc, 0x00, 0x0e, 0x90, + 0xcc, 0x48, 0xa3, 0x46, 0x01, 0x34, 0x39, 0x46, 0x22, 0x46, 0x03, 0x68, + 0x30, 0x46, 0x98, 0x47, 0x80, 0x00, 0x0b, 0x2d, 0x1c, 0x94, 0x1b, 0x90, + 0x38, 0xd8, 0x19, 0xf8, 0x10, 0x1c, 0xc6, 0x4f, 0x1b, 0x9c, 0x1d, 0xaa, + 0x19, 0x91, 0xc5, 0x49, 0x19, 0xf8, 0x07, 0x00, 0x0b, 0x68, 0x21, 0x46, + 0x98, 0x47, 0xdf, 0xf8, 0xfc, 0x82, 0x9d, 0xf8, 0x74, 0x10, 0x15, 0x9a, + 0x48, 0xf8, 0xa4, 0x0f, 0x19, 0xf8, 0x07, 0x00, 0xbe, 0x4f, 0x08, 0x44, + 0xbc, 0x49, 0x09, 0xf8, 0x10, 0x0c, 0x19, 0xf8, 0x07, 0x00, 0x0b, 0x68, + 0x21, 0x46, 0x98, 0x47, 0xc8, 0xf8, 0x04, 0x00, 0x9d, 0xf8, 0x78, 0x10, + 0xdd, 0xf8, 0x60, 0x80, 0x1c, 0x9c, 0x19, 0xf8, 0x07, 0x00, 0x16, 0x9f, + 0x08, 0x44, 0x17, 0x99, 0x89, 0xf8, 0x00, 0x00, 0x09, 0x78, 0x01, 0x29, + 0x08, 0xd1, 0x19, 0x99, 0xc0, 0xb2, 0x81, 0x42, 0x04, 0xd0, 0x10, 0x98, + 0x58, 0x44, 0x41, 0x7d, 0x80, 0xf8, 0x55, 0x11, 0x98, 0xf9, 0x3a, 0x00, + 0x87, 0x42, 0x15, 0xd1, 0x98, 0xf9, 0x39, 0x00, 0x86, 0x42, 0x11, 0xd1, + 0x14, 0x98, 0x82, 0x45, 0x0e, 0xd1, 0x98, 0xf8, 0x3b, 0xc0, 0xbc, 0xf1, + 0x00, 0x0f, 0x11, 0xd0, 0x9d, 0x48, 0x83, 0x46, 0x00, 0xf1, 0x60, 0x08, + 0x00, 0xf1, 0x50, 0x0e, 0x00, 0xf1, 0x10, 0x04, 0x05, 0x98, 0x10, 0xe0, + 0x1a, 0x98, 0x09, 0xf1, 0x20, 0x09, 0x0a, 0xf1, 0x01, 0x0a, 0x84, 0x42, + 0x98, 0xdb, 0x9c, 0xe0, 0x95, 0x48, 0x83, 0x46, 0x00, 0xf1, 0x64, 0x08, + 0x00, 0xf1, 0x54, 0x0e, 0x00, 0xf1, 0x14, 0x04, 0x04, 0x98, 0x0e, 0x99, + 0x08, 0x58, 0x18, 0x9b, 0x19, 0x46, 0x02, 0x0e, 0x01, 0xf8, 0x3c, 0x0f, + 0xca, 0x70, 0x02, 0x0c, 0x00, 0x0a, 0x8a, 0x70, 0x83, 0xf8, 0x3d, 0x00, + 0x19, 0x46, 0x20, 0x68, 0x0a, 0x24, 0x01, 0xf8, 0x44, 0x0f, 0x02, 0x0e, + 0xca, 0x70, 0x02, 0x0c, 0x00, 0x0a, 0x8a, 0x70, 0x83, 0xf8, 0x45, 0x00, + 0x19, 0x46, 0xd8, 0xf8, 0x00, 0x00, 0x98, 0x46, 0x01, 0xf8, 0x48, 0x0f, + 0x02, 0x0e, 0xca, 0x70, 0x02, 0x0c, 0x00, 0x0a, 0x8a, 0x70, 0x83, 0xf8, + 0x49, 0x00, 0x19, 0x46, 0xdb, 0xf8, 0x00, 0x00, 0x01, 0xf8, 0x4c, 0x0f, + 0x02, 0x0e, 0xca, 0x70, 0x02, 0x0c, 0x00, 0x0a, 0x8a, 0x70, 0x83, 0xf8, + 0x4d, 0x00, 0x19, 0x46, 0xde, 0xf8, 0x00, 0x00, 0x01, 0xf8, 0x50, 0x0f, + 0x02, 0x0e, 0xca, 0x70, 0x02, 0x0c, 0x00, 0x0a, 0x83, 0xf8, 0x51, 0x00, + 0x0a, 0x98, 0x8a, 0x70, 0x19, 0x46, 0x73, 0x4b, 0x50, 0xf8, 0x26, 0x00, + 0x01, 0xf8, 0x40, 0x0f, 0x02, 0x0e, 0xca, 0x70, 0x02, 0x0c, 0x00, 0x0a, + 0x48, 0x70, 0x0b, 0x98, 0x8a, 0x70, 0x00, 0x68, 0x08, 0x75, 0xc0, 0xf3, + 0x00, 0x20, 0x1b, 0x9a, 0x48, 0x75, 0x0c, 0x98, 0x00, 0x78, 0x0a, 0x76, + 0x12, 0x0a, 0x4a, 0x76, 0x0f, 0x9a, 0x02, 0x38, 0x03, 0xeb, 0x42, 0x12, + 0x90, 0xfb, 0xf4, 0xf0, 0x09, 0x9c, 0x02, 0xeb, 0x07, 0x12, 0x32, 0xf8, + 0x10, 0x00, 0x1d, 0xaa, 0x88, 0x75, 0x00, 0x0a, 0xc8, 0x75, 0x11, 0xf8, + 0x0f, 0x0c, 0xc8, 0x77, 0x07, 0x98, 0x00, 0x78, 0x81, 0xf8, 0x22, 0x00, + 0x4f, 0xfa, 0x8c, 0xf0, 0x52, 0xf8, 0x20, 0x20, 0x4a, 0x77, 0x03, 0xeb, + 0x80, 0x02, 0x14, 0x9b, 0xd2, 0xf8, 0xa4, 0x20, 0x81, 0xf8, 0x23, 0x30, + 0x8a, 0x77, 0x08, 0x9a, 0x12, 0x78, 0x81, 0xf8, 0x20, 0x20, 0x4f, 0x4a, + 0x02, 0xeb, 0x84, 0x12, 0x02, 0xeb, 0x43, 0x12, 0x02, 0xeb, 0x00, 0x10, + 0x30, 0x44, 0x90, 0xf8, 0xdc, 0x02, 0x40, 0x42, 0x81, 0xf8, 0x21, 0x00, + 0x52, 0x48, 0x28, 0x21, 0x02, 0x68, 0x45, 0x48, 0x00, 0xf5, 0x34, 0x70, + 0x90, 0x47, 0x1c, 0x9c, 0x5a, 0xe7, 0x13, 0x98, 0x0d, 0x9c, 0x0f, 0x2d, + 0x00, 0xf1, 0x01, 0x00, 0x13, 0x90, 0x05, 0xf1, 0x01, 0x00, 0xff, 0xf4, + 0xb6, 0xae, 0x11, 0x98, 0x49, 0x49, 0x00, 0x88, 0x09, 0x68, 0x88, 0x47, + 0x9f, 0x49, 0x0a, 0x78, 0x32, 0xbb, 0x01, 0x99, 0x09, 0x78, 0x01, 0x29, + 0x22, 0xd1, 0x12, 0x99, 0x09, 0x78, 0x0b, 0x29, 0x3f, 0xd8, 0x11, 0x9b, + 0x08, 0xeb, 0x07, 0x02, 0x1b, 0x88, 0x23, 0xfa, 0x01, 0xf4, 0xe4, 0x07, + 0x37, 0xd0, 0x12, 0xf8, 0x11, 0x40, 0x01, 0x2c, 0x33, 0xd1, 0x81, 0x42, + 0x02, 0xd1, 0x01, 0x9d, 0x00, 0x24, 0x2c, 0x70, 0x4c, 0x1c, 0x0b, 0x29, + 0x21, 0x46, 0xee, 0xd3, 0x29, 0xe0, 0x00, 0xbf, 0x14, 0xee, 0x05, 0x30, + 0xe4, 0xc0, 0x05, 0x30, 0x04, 0x7a, 0x23, 0x40, 0x10, 0x7a, 0x23, 0x40, + 0x04, 0xf2, 0xb6, 0x21, 0x0b, 0x78, 0xe3, 0xb9, 0x01, 0x2a, 0x1a, 0xd1, + 0x01, 0x9a, 0x12, 0x78, 0xba, 0xb1, 0x12, 0x9a, 0x12, 0x78, 0x0b, 0x2a, + 0x13, 0xd8, 0x11, 0x9c, 0x08, 0xeb, 0x07, 0x03, 0x24, 0x88, 0x24, 0xfa, + 0x02, 0xf5, 0xed, 0x07, 0x0b, 0xd0, 0x13, 0xf8, 0x12, 0x50, 0x01, 0x2d, + 0x07, 0xd1, 0x82, 0x42, 0x04, 0xbf, 0x01, 0x25, 0x0d, 0x70, 0x55, 0x1c, + 0x0b, 0x2a, 0x2a, 0x46, 0xef, 0xd3, 0x15, 0x49, 0x01, 0x20, 0x00, 0x2f, + 0x3f, 0xf4, 0xfa, 0xad, 0xb8, 0xf8, 0x36, 0x00, 0x40, 0x07, 0x19, 0xd5, + 0x1e, 0x48, 0x01, 0x78, 0x91, 0xb1, 0x1e, 0x4c, 0x72, 0xb6, 0x21, 0x68, + 0x49, 0x00, 0x01, 0x31, 0x21, 0x60, 0xa0, 0x21, 0x05, 0x78, 0x12, 0x48, + 0xcd, 0xf7, 0x24, 0xfc, 0x55, 0xb1, 0x20, 0x68, 0x40, 0x08, 0x20, 0x60, + 0x20, 0x68, 0x80, 0xf3, 0x10, 0x88, 0x03, 0xe0, 0x0c, 0x48, 0xa0, 0x21, + 0xcd, 0xf7, 0x18, 0xfc, 0x04, 0x48, 0x01, 0x68, 0x42, 0x20, 0x88, 0x47, + 0x1f, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0xbf, 0x98, 0xca, 0x01, 0x00, + 0x00, 0x9d, 0x08, 0x00, 0xf0, 0xd1, 0x01, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0x40, 0x10, 0x21, 0x40, 0x24, 0x20, 0x21, 0x40, 0x00, 0x69, 0x08, 0x00, + 0xd8, 0x21, 0x06, 0x00, 0xa4, 0xfb, 0x08, 0x00, 0x70, 0xfd, 0xff, 0xff, + 0xb0, 0xfb, 0x08, 0x00, 0x80, 0xfd, 0xff, 0xff, 0xa8, 0xfb, 0x08, 0x00, + 0xa0, 0xfb, 0x08, 0x00, 0xde, 0xb8, 0x01, 0x00, 0x24, 0x36, 0x01, 0x00, + 0xb0, 0xb5, 0x04, 0xf0, 0x4d, 0xfb, 0x0e, 0x4d, 0x0e, 0x4c, 0x05, 0x21, + 0x05, 0x23, 0x6a, 0x1d, 0x20, 0x46, 0xcb, 0xf7, 0x51, 0xfa, 0x60, 0x1d, + 0x05, 0xf1, 0x0f, 0x02, 0x05, 0x21, 0x05, 0x23, 0xcb, 0xf7, 0x4a, 0xfa, + 0x08, 0x48, 0x00, 0x68, 0x6f, 0xf3, 0x9f, 0x20, 0x45, 0x28, 0x06, 0xd1, + 0x20, 0x79, 0x61, 0x7a, 0x1c, 0x30, 0x20, 0x71, 0x01, 0xf1, 0x11, 0x00, + 0x60, 0x72, 0xb0, 0xbd, 0x0d, 0x13, 0x01, 0x00, 0xa8, 0x10, 0x06, 0x00, + 0x80, 0x70, 0x00, 0x30, 0x41, 0x48, 0x00, 0x78, 0x01, 0x28, 0x18, 0xbf, + 0x70, 0x47, 0x01, 0x48, 0x00, 0x68, 0x00, 0x47, 0xe4, 0xfb, 0x08, 0x00, + 0xf8, 0xb5, 0x04, 0x46, 0x00, 0x78, 0x01, 0x28, 0x05, 0xd1, 0x37, 0x48, + 0x00, 0x68, 0x00, 0x01, 0x11, 0xd4, 0x36, 0x48, 0x04, 0xe0, 0x32, 0x48, + 0x00, 0x68, 0x00, 0x05, 0x0b, 0xd4, 0x31, 0x48, 0x01, 0x68, 0x00, 0x68, + 0x49, 0xb2, 0x00, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, 0x04, 0xdd, 0x00, 0x28, + 0x05, 0xd5, 0x01, 0x25, 0x04, 0xe0, 0x4b, 0xe0, 0xb0, 0xf1, 0xff, 0x3f, + 0x49, 0xdd, 0x00, 0x25, 0xfd, 0xf7, 0x68, 0xfe, 0x08, 0xb1, 0x2a, 0x48, + 0x00, 0xe0, 0x2a, 0x48, 0x00, 0x78, 0x40, 0xb1, 0x29, 0x49, 0x20, 0x78, + 0x0a, 0x68, 0x29, 0x46, 0x90, 0x47, 0x28, 0x48, 0x01, 0x68, 0x28, 0x46, + 0x88, 0x47, 0x27, 0x48, 0x90, 0xf8, 0x5f, 0x00, 0x01, 0x28, 0x31, 0xd1, + 0x25, 0x48, 0x00, 0xeb, 0x45, 0x07, 0xd3, 0xf7, 0x07, 0xff, 0x06, 0x46, + 0x20, 0x78, 0x7f, 0x8b, 0xb8, 0xb9, 0xd4, 0xf7, 0x1b, 0xfb, 0x06, 0x46, + 0x20, 0x48, 0x21, 0x49, 0x00, 0x78, 0x00, 0xeb, 0x00, 0x10, 0x01, 0xeb, + 0xc0, 0x00, 0x1f, 0x49, 0x00, 0x69, 0x09, 0x68, 0x88, 0x42, 0x07, 0xd0, + 0x1d, 0x49, 0x09, 0x68, 0x88, 0x42, 0x03, 0xd0, 0x1c, 0x49, 0x09, 0x68, + 0x88, 0x42, 0x00, 0xd1, 0x76, 0x00, 0x38, 0xb2, 0x04, 0x21, 0x90, 0xfb, + 0xf1, 0xf0, 0x29, 0x46, 0x47, 0xb2, 0x30, 0x46, 0x3a, 0x46, 0xd4, 0xf7, + 0x09, 0xfb, 0x22, 0x78, 0x30, 0x46, 0x39, 0x46, 0xbd, 0xe8, 0xf8, 0x40, + 0xd3, 0xf7, 0xf0, 0xbe, 0xf8, 0xbd, 0x07, 0x48, 0x41, 0x78, 0x4d, 0x1e, + 0x18, 0xbf, 0x01, 0x25, 0x45, 0x70, 0xaf, 0xe7, 0xcc, 0x20, 0x21, 0x40, + 0x38, 0x20, 0x21, 0x40, 0xec, 0x10, 0x21, 0x40, 0x50, 0x10, 0x21, 0x40, + 0x5c, 0xd4, 0x05, 0x00, 0xa9, 0x58, 0x01, 0x00, 0xe8, 0xfb, 0x08, 0x00, + 0x14, 0xfc, 0x08, 0x00, 0xd0, 0xe2, 0x05, 0x00, 0x1c, 0x1f, 0x01, 0x00, + 0x74, 0x87, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, 0x54, 0xb7, 0x08, 0x00, + 0x58, 0xb7, 0x08, 0x00, 0x0c, 0xe4, 0x08, 0x00, 0xf8, 0xb5, 0x00, 0xf0, + 0x0f, 0x06, 0x15, 0x46, 0x0c, 0x46, 0x07, 0x46, 0x07, 0x2e, 0x0e, 0xd3, + 0x0b, 0x2e, 0x0c, 0xd8, 0xa9, 0x49, 0x6f, 0xf0, 0x0d, 0x00, 0x00, 0xeb, + 0x46, 0x00, 0xb1, 0xf8, 0xde, 0x22, 0x22, 0xfa, 0x00, 0xf0, 0x00, 0xf0, + 0x03, 0x00, 0x81, 0xf8, 0xe5, 0x02, 0x21, 0x48, 0x01, 0x68, 0x28, 0x46, + 0x88, 0x47, 0xa1, 0x49, 0x91, 0xf8, 0xf6, 0x1e, 0xca, 0x07, 0x02, 0xd1, + 0x47, 0xf6, 0xff, 0x72, 0x09, 0xe0, 0x44, 0xf0, 0x02, 0x02, 0x03, 0x2a, + 0x1a, 0xbf, 0x47, 0xf6, 0xff, 0x72, 0x42, 0xea, 0x41, 0x32, 0x4f, 0xf6, + 0xff, 0x72, 0x4f, 0xf6, 0xdf, 0x73, 0x43, 0xea, 0x40, 0x10, 0x38, 0x40, + 0x10, 0x40, 0x07, 0xb2, 0x00, 0x2f, 0x01, 0xd4, 0x48, 0x06, 0x14, 0xd5, + 0x48, 0x06, 0x07, 0xd4, 0x10, 0x48, 0x31, 0x46, 0x02, 0x68, 0x28, 0x46, + 0x90, 0x47, 0x20, 0xb1, 0x01, 0x2c, 0x04, 0xd1, 0x4f, 0xf4, 0x80, 0x40, + 0x06, 0xe0, 0x00, 0x20, 0x04, 0xe0, 0xe0, 0x1e, 0xb0, 0xfa, 0x80, 0xf0, + 0x40, 0x09, 0x80, 0x03, 0x07, 0x43, 0x44, 0xf0, 0x02, 0x00, 0x03, 0x28, + 0x06, 0x48, 0x14, 0xbf, 0x4f, 0xf4, 0xc0, 0x41, 0x00, 0x21, 0x01, 0x60, + 0x04, 0x48, 0x01, 0x60, 0xb8, 0xb2, 0xf8, 0xbd, 0x00, 0xfc, 0x08, 0x00, + 0xe0, 0xfb, 0x08, 0x00, 0x34, 0xc0, 0x05, 0x30, 0x4c, 0xc0, 0x05, 0x30, + 0x02, 0x48, 0x00, 0x21, 0x01, 0x60, 0x02, 0x48, 0x01, 0x60, 0x70, 0x47, + 0x10, 0xd6, 0x05, 0x30, 0x10, 0xee, 0x05, 0x30, 0x05, 0x48, 0x02, 0x22, + 0x01, 0x68, 0x62, 0xf3, 0x9f, 0x71, 0x01, 0x60, 0x41, 0x6a, 0x62, 0xf3, + 0x9f, 0x71, 0x41, 0x62, 0x70, 0x47, 0x00, 0xbf, 0x5c, 0xc0, 0x05, 0x30, + 0x2d, 0xe9, 0xf8, 0x43, 0x70, 0x48, 0x42, 0x4d, 0x90, 0xf8, 0xef, 0x22, + 0x00, 0xf5, 0x37, 0x79, 0xd0, 0x07, 0x10, 0xd0, 0x3f, 0x48, 0x01, 0x68, + 0x49, 0x05, 0x5c, 0xbf, 0x99, 0xf8, 0x00, 0x10, 0x5f, 0xea, 0x01, 0x71, + 0x07, 0xd5, 0x00, 0x68, 0x6f, 0xf3, 0x5f, 0x20, 0x18, 0xb1, 0x29, 0x88, + 0x08, 0x44, 0x01, 0x21, 0x01, 0xe0, 0x00, 0x21, 0x00, 0x20, 0x92, 0x07, + 0x11, 0xd5, 0x36, 0x4a, 0x13, 0x68, 0x5b, 0x05, 0x5c, 0xbf, 0x99, 0xf8, + 0x00, 0x30, 0x5f, 0xea, 0x03, 0x73, 0x08, 0xd5, 0x12, 0x68, 0x6f, 0xf3, + 0x5f, 0x22, 0x22, 0xb1, 0x6b, 0x88, 0x01, 0x27, 0x03, 0xeb, 0x02, 0x08, + 0x02, 0xe0, 0x00, 0x27, 0x4f, 0xf0, 0x00, 0x08, 0x59, 0xb1, 0xe9, 0x7b, + 0x59, 0xb1, 0x2b, 0x4c, 0x99, 0xf8, 0x10, 0x20, 0x99, 0xf8, 0x11, 0x30, + 0x69, 0x8a, 0x00, 0xb2, 0x24, 0x68, 0xa0, 0x47, 0x04, 0xe0, 0x00, 0x24, + 0x10, 0xe0, 0x01, 0x21, 0xc0, 0x00, 0xe9, 0x73, 0x04, 0x21, 0x68, 0x82, + 0xec, 0x7a, 0x11, 0xfa, 0x80, 0xf0, 0x22, 0x49, 0xc0, 0x08, 0x0a, 0x68, + 0x00, 0x21, 0x90, 0x47, 0xe8, 0x7a, 0x24, 0x1a, 0x18, 0xbf, 0x01, 0x24, + 0xff, 0xb1, 0x28, 0x7c, 0x50, 0xb1, 0x1b, 0x48, 0x99, 0xf8, 0x10, 0x20, + 0x99, 0xf8, 0x11, 0x30, 0xa9, 0x8a, 0x07, 0x68, 0x0f, 0xfa, 0x88, 0xf0, + 0xb8, 0x47, 0x03, 0xe0, 0x01, 0x20, 0x28, 0x74, 0x4f, 0xea, 0xc8, 0x00, + 0x04, 0x21, 0xa8, 0x82, 0x2f, 0x7b, 0x01, 0x26, 0x11, 0xfa, 0x80, 0xf0, + 0x11, 0x49, 0xc0, 0x08, 0x0a, 0x68, 0x01, 0x21, 0x90, 0x47, 0x28, 0x7b, + 0x87, 0x42, 0x18, 0xbf, 0x34, 0x46, 0x99, 0xf8, 0x13, 0x00, 0x02, 0x28, + 0x06, 0xd0, 0x01, 0x28, 0x08, 0xd1, 0xe8, 0x7a, 0x69, 0x7b, 0x28, 0x73, + 0xa9, 0x73, 0x03, 0xe0, 0x28, 0x7b, 0xa9, 0x7b, 0xe8, 0x72, 0x69, 0x73, + 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x83, 0x00, 0xbf, 0xf0, 0xd1, 0x01, 0x00, + 0x14, 0xd6, 0x05, 0x30, 0x14, 0xee, 0x05, 0x30, 0x74, 0xfe, 0x08, 0x00, + 0x78, 0xfe, 0x08, 0x00, 0x80, 0xb5, 0x04, 0xf0, 0x89, 0xf9, 0x27, 0x48, + 0x90, 0xf8, 0xca, 0x01, 0x00, 0x28, 0x18, 0xbf, 0x01, 0x20, 0x00, 0xf0, + 0x0d, 0xf8, 0xff, 0xf7, 0xdb, 0xf8, 0x05, 0xf0, 0xbb, 0xf8, 0x00, 0xf0, + 0x37, 0xf8, 0x04, 0xf0, 0xbd, 0xfd, 0xbd, 0xe8, 0x80, 0x40, 0x04, 0xf0, + 0xab, 0xbd, 0x00, 0xbf, 0xf0, 0xb5, 0x1c, 0x49, 0x91, 0xf8, 0xd8, 0x12, + 0x89, 0x07, 0x23, 0xd5, 0x00, 0xeb, 0x40, 0x00, 0x11, 0x4b, 0x12, 0x4c, + 0x00, 0x22, 0x00, 0xf1, 0x6c, 0x01, 0x04, 0xeb, 0x40, 0x06, 0x65, 0x5c, + 0x01, 0x32, 0x01, 0x31, 0x01, 0x30, 0xb6, 0xf8, 0x60, 0x70, 0x03, 0x2a, + 0x6f, 0xf3, 0x5f, 0x27, 0x47, 0xea, 0x45, 0x25, 0x5f, 0x69, 0x6f, 0xf3, + 0x10, 0x07, 0x3d, 0x44, 0x5d, 0x61, 0x1d, 0x68, 0xb6, 0xf8, 0x48, 0x50, + 0xb6, 0xf8, 0x54, 0x60, 0x46, 0xea, 0x05, 0x45, 0x1d, 0x60, 0x03, 0xf1, + 0x04, 0x03, 0xe2, 0xd1, 0xf0, 0xbd, 0x00, 0xbf, 0x24, 0x0e, 0x03, 0x40, + 0xb4, 0x1a, 0x06, 0x00, 0x04, 0x48, 0x05, 0x49, 0x90, 0xf8, 0xd2, 0x0f, + 0x0a, 0x68, 0x60, 0xf3, 0x04, 0x02, 0x0a, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x00, 0x69, 0x08, 0x00, 0x00, 0x0e, 0x23, 0x40, 0x2d, 0xe9, 0xf0, 0x4f, + 0x91, 0xb0, 0xdf, 0xf8, 0xc8, 0x04, 0x00, 0xf2, 0x3c, 0x6b, 0x1b, 0xf9, + 0x02, 0x0f, 0x9b, 0xf9, 0x01, 0x10, 0x00, 0x28, 0x00, 0xd5, 0x40, 0x42, + 0x01, 0x44, 0xe2, 0x48, 0xdf, 0xf8, 0xb0, 0x54, 0x02, 0x91, 0x00, 0xea, + 0x41, 0x04, 0xdb, 0xf8, 0x32, 0x00, 0x29, 0x68, 0x06, 0x90, 0x20, 0x46, + 0x88, 0x47, 0x29, 0x68, 0x82, 0x46, 0x20, 0x46, 0x03, 0x94, 0x88, 0x47, + 0xba, 0xf1, 0x00, 0x0f, 0x00, 0xf0, 0x28, 0x82, 0x05, 0x46, 0x00, 0x28, + 0x00, 0xf0, 0x24, 0x82, 0xdf, 0xf8, 0x7c, 0x04, 0x90, 0xf8, 0x36, 0x02, + 0x80, 0x07, 0x00, 0xf0, 0x2c, 0x82, 0xdf, 0xf8, 0x78, 0x04, 0x2c, 0x46, + 0x9b, 0xf8, 0x03, 0x50, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0xdf, 0xf8, + 0x6c, 0x04, 0x00, 0x68, 0x80, 0x47, 0xdf, 0xf8, 0x68, 0x04, 0x0c, 0x94, + 0x01, 0x24, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0xdf, 0xf8, 0x5c, 0x04, + 0x00, 0x68, 0x80, 0x47, 0xdf, 0xf8, 0x58, 0x04, 0x01, 0x68, 0x01, 0x20, + 0x88, 0x47, 0xdf, 0xf8, 0x54, 0x04, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, + 0x03, 0x99, 0x65, 0x20, 0x01, 0x2d, 0xc1, 0x4f, 0x00, 0xeb, 0x41, 0x00, + 0xdf, 0xf8, 0x40, 0x14, 0x07, 0x90, 0x98, 0xbf, 0x25, 0x46, 0x06, 0x98, + 0x0a, 0x95, 0xcd, 0xf8, 0x24, 0xa0, 0x0c, 0x9d, 0x00, 0xf0, 0x0f, 0x00, + 0x01, 0x90, 0xdf, 0xf8, 0x40, 0x04, 0x01, 0x30, 0x00, 0x90, 0x00, 0x20, + 0x0f, 0x90, 0xdf, 0xf8, 0x20, 0x04, 0x08, 0x91, 0x00, 0x68, 0x80, 0x47, + 0xdf, 0xf8, 0x18, 0x24, 0x80, 0x46, 0xb8, 0xf1, 0x00, 0x0f, 0x10, 0x78, + 0x00, 0xf1, 0x01, 0x01, 0x11, 0x70, 0xdf, 0xf8, 0x0c, 0x14, 0x02, 0xd0, + 0x03, 0x22, 0x0a, 0x54, 0x6b, 0xe1, 0x04, 0x22, 0x00, 0x23, 0x0a, 0x54, + 0xdf, 0xf8, 0xfc, 0x03, 0x06, 0x9a, 0x04, 0x68, 0x0f, 0x98, 0x5f, 0xfa, + 0x80, 0xf9, 0x01, 0x20, 0x49, 0x46, 0xa0, 0x47, 0xdf, 0xf8, 0xb8, 0x03, + 0xb0, 0xf8, 0x4e, 0x02, 0x28, 0xb1, 0xdf, 0xf8, 0xe4, 0x13, 0x09, 0x88, + 0x48, 0x43, 0x02, 0x38, 0x00, 0xe0, 0x00, 0x20, 0x00, 0x99, 0x88, 0x47, + 0x00, 0x21, 0x00, 0x20, 0x4f, 0xf0, 0x00, 0x08, 0x39, 0x60, 0x0e, 0x90, + 0xc7, 0xf8, 0xe0, 0x11, 0x00, 0x20, 0x00, 0x21, 0x0d, 0x90, 0x9b, 0xf9, + 0x01, 0x00, 0x9b, 0xf9, 0x00, 0x50, 0x0b, 0x91, 0x85, 0x42, 0x4d, 0xda, + 0x6e, 0x00, 0x00, 0x24, 0x0f, 0x98, 0x00, 0x28, 0x40, 0xf6, 0xfe, 0x70, + 0x00, 0xea, 0x06, 0x00, 0x1f, 0xbf, 0xd7, 0xf8, 0xe0, 0x11, 0x40, 0xf6, + 0xff, 0x72, 0x91, 0x43, 0x08, 0x44, 0x11, 0xbf, 0xc7, 0xf8, 0xe0, 0x01, + 0x39, 0x68, 0x40, 0xf6, 0xff, 0x72, 0x91, 0x43, 0x04, 0xbf, 0x08, 0x44, + 0x38, 0x60, 0xdf, 0xf8, 0x84, 0x03, 0x10, 0xa9, 0x4a, 0x46, 0x03, 0x68, + 0x0d, 0xf1, 0x42, 0x00, 0x98, 0x47, 0xd8, 0x4a, 0x80, 0x46, 0xb8, 0xf1, + 0x00, 0x0f, 0x10, 0x78, 0x00, 0xf1, 0x01, 0x01, 0x11, 0x70, 0xd5, 0x49, + 0x2b, 0xd1, 0x05, 0x22, 0x0a, 0x54, 0xbd, 0xf8, 0x42, 0x00, 0x40, 0xf3, + 0x0c, 0x01, 0xc0, 0x04, 0xad, 0xf8, 0x42, 0x10, 0x9b, 0xf8, 0x0c, 0x10, + 0xc1, 0xeb, 0xe0, 0x40, 0x00, 0x28, 0x00, 0xd5, 0x40, 0x42, 0x0e, 0x99, + 0x29, 0xb1, 0x3a, 0xf9, 0x14, 0x10, 0x08, 0x44, 0x02, 0x21, 0x90, 0xfb, + 0xf1, 0xf0, 0x2a, 0xf8, 0x14, 0x00, 0x01, 0x34, 0x02, 0x36, 0x9b, 0xf9, + 0x01, 0x00, 0x29, 0x19, 0x81, 0x42, 0xb5, 0xdb, 0xc0, 0xb2, 0x03, 0xe0, + 0x00, 0x24, 0xb8, 0xf1, 0x00, 0x0f, 0x08, 0xd1, 0x01, 0x21, 0x4f, 0xf0, + 0x00, 0x08, 0x0e, 0x91, 0x03, 0xe0, 0x06, 0x22, 0x0a, 0x54, 0x9b, 0xf8, + 0x01, 0x00, 0x00, 0x21, 0x40, 0xb2, 0x39, 0x60, 0xc7, 0xf8, 0xe0, 0x11, + 0x9b, 0xf9, 0x00, 0xa0, 0x82, 0x45, 0x52, 0xda, 0x4f, 0xea, 0x4a, 0x46, + 0x00, 0x25, 0x0f, 0x98, 0x4a, 0x46, 0x00, 0x28, 0xb9, 0x48, 0x00, 0xea, + 0x06, 0x00, 0x1f, 0xbf, 0xd7, 0xf8, 0xe0, 0x11, 0x6f, 0xf3, 0x1b, 0x41, + 0x08, 0x44, 0xc7, 0xf8, 0xe0, 0x01, 0x01, 0xbf, 0x39, 0x68, 0x6f, 0xf3, + 0x1b, 0x41, 0x08, 0x44, 0x38, 0x60, 0xb0, 0x48, 0x10, 0xa9, 0x03, 0x68, + 0x0d, 0xf1, 0x42, 0x00, 0x98, 0x47, 0xa8, 0x4a, 0x80, 0x46, 0xb8, 0xf1, + 0x00, 0x0f, 0x10, 0x78, 0x00, 0xf1, 0x01, 0x01, 0x11, 0x70, 0xa5, 0x49, + 0x37, 0xd1, 0x05, 0x22, 0x0a, 0x54, 0xbd, 0xf8, 0x42, 0x00, 0x40, 0xf3, + 0x0c, 0x01, 0xc0, 0x04, 0xad, 0xf8, 0x42, 0x10, 0x9b, 0xf8, 0x0c, 0x10, + 0xc1, 0xeb, 0xe0, 0x40, 0x00, 0x28, 0x00, 0xd5, 0x40, 0x42, 0x0d, 0x99, + 0x49, 0xb1, 0x0c, 0x9a, 0x32, 0xf9, 0x15, 0x10, 0x08, 0x44, 0x02, 0x21, + 0x90, 0xfb, 0xf1, 0xf0, 0x22, 0xf8, 0x15, 0x00, 0x02, 0xe0, 0x0c, 0x99, + 0x21, 0xf8, 0x15, 0x00, 0x01, 0x35, 0x9b, 0xf9, 0x01, 0x10, 0x06, 0xf5, + 0x00, 0x36, 0x0a, 0xeb, 0x05, 0x00, 0x88, 0x42, 0xb3, 0xdb, 0xdd, 0xf8, + 0x24, 0xa0, 0x0b, 0x99, 0x06, 0xe0, 0xdd, 0xf8, 0x24, 0xa0, 0x0b, 0x99, + 0x00, 0x25, 0xb8, 0xf1, 0x00, 0x0f, 0x09, 0xd1, 0x01, 0x20, 0x4f, 0xf0, + 0x00, 0x08, 0x0d, 0x90, 0x04, 0xe0, 0x07, 0x22, 0xdd, 0xf8, 0x24, 0xa0, + 0x0a, 0x54, 0x0b, 0x99, 0x00, 0x20, 0x01, 0x31, 0x38, 0x60, 0xc7, 0xf8, + 0xe0, 0x01, 0x0a, 0x98, 0x81, 0x42, 0xff, 0xf4, 0x28, 0xaf, 0x87, 0x4e, + 0xe1, 0xb2, 0x50, 0x46, 0x01, 0x22, 0x33, 0x68, 0x98, 0x47, 0x33, 0x68, + 0x0c, 0x9e, 0x0b, 0x90, 0xe9, 0xb2, 0x01, 0x22, 0x30, 0x46, 0x98, 0x47, + 0x05, 0x90, 0x0b, 0x98, 0xa1, 0xb2, 0xc2, 0xb2, 0x7f, 0x48, 0x03, 0x68, + 0x50, 0x46, 0x98, 0x47, 0x04, 0x90, 0x7d, 0x48, 0x05, 0x9c, 0xa9, 0xb2, + 0x03, 0x68, 0xe2, 0xb2, 0x30, 0x46, 0x98, 0x47, 0x9b, 0xf8, 0x00, 0x10, + 0x0b, 0x9b, 0x04, 0x9a, 0x01, 0xeb, 0x03, 0x0e, 0x64, 0x4b, 0x01, 0xeb, + 0x04, 0x0c, 0x08, 0x99, 0x00, 0x24, 0xb3, 0xf8, 0x3c, 0x36, 0x23, 0xfa, + 0x04, 0xf5, 0xed, 0x07, 0x34, 0xd0, 0x11, 0xf8, 0x24, 0x50, 0x05, 0x2d, + 0x30, 0xd0, 0x0e, 0x9d, 0x4d, 0xb1, 0x04, 0x2a, 0x01, 0xf8, 0x24, 0x20, + 0x01, 0xd0, 0x02, 0x2a, 0x06, 0xd1, 0x01, 0xeb, 0x84, 0x05, 0x00, 0x26, + 0x07, 0xe0, 0x4f, 0xf0, 0x01, 0x08, 0x05, 0xe0, 0x01, 0xeb, 0x84, 0x05, + 0xae, 0x78, 0xa6, 0xeb, 0x0e, 0x06, 0xae, 0x70, 0x0d, 0x9d, 0x5d, 0xb1, + 0x90, 0x42, 0x88, 0xbf, 0x01, 0xf8, 0x24, 0x00, 0x04, 0x28, 0x01, 0xd0, + 0x02, 0x28, 0x0b, 0xd1, 0x01, 0xeb, 0x84, 0x05, 0x00, 0x26, 0x0c, 0xe0, + 0x4f, 0xf0, 0x01, 0x08, 0x0a, 0xe0, 0x00, 0xbf, 0xfe, 0xff, 0x01, 0x00, + 0xa0, 0x78, 0x03, 0x40, 0x01, 0xeb, 0x84, 0x05, 0xee, 0x78, 0xa6, 0xeb, + 0x0c, 0x06, 0xee, 0x70, 0x01, 0x34, 0x0c, 0x2c, 0xc3, 0xd1, 0x4f, 0x48, + 0x06, 0x9a, 0x49, 0x46, 0x00, 0x23, 0x04, 0x68, 0x00, 0x20, 0xa0, 0x47, + 0x0c, 0x9d, 0x52, 0x48, 0x00, 0x78, 0xff, 0x28, 0x01, 0xd0, 0x02, 0x28, + 0x34, 0xd1, 0x3d, 0x48, 0x01, 0x68, 0x07, 0x98, 0x88, 0x47, 0x78, 0xb3, + 0x81, 0x46, 0x60, 0x20, 0x40, 0x4a, 0x4c, 0x4d, 0x60, 0x21, 0x60, 0x23, + 0x89, 0xf8, 0x02, 0x00, 0x01, 0x98, 0x89, 0xf8, 0x01, 0x00, 0x0f, 0x98, + 0x89, 0xf8, 0x00, 0x00, 0x09, 0xf1, 0x03, 0x00, 0xa8, 0x47, 0x03, 0x9e, + 0x02, 0x9d, 0x44, 0x4c, 0x09, 0xf1, 0x64, 0x00, 0x52, 0x46, 0x0e, 0x90, + 0x31, 0x46, 0x33, 0x46, 0x89, 0xf8, 0x63, 0x50, 0xa0, 0x47, 0x0e, 0x98, + 0x3e, 0x4c, 0x31, 0x46, 0x33, 0x46, 0x30, 0x44, 0x00, 0xf8, 0x01, 0x5b, + 0x0c, 0x9d, 0x2a, 0x46, 0xa0, 0x47, 0x3b, 0x48, 0x07, 0x9a, 0x49, 0x46, + 0x03, 0x68, 0x02, 0x20, 0x98, 0x47, 0x48, 0x46, 0xd0, 0xf7, 0x86, 0xfc, + 0x0f, 0x98, 0x08, 0x99, 0x01, 0x30, 0x30, 0x31, 0x02, 0x28, 0x0f, 0x90, + 0x7f, 0xf4, 0x3d, 0xae, 0x33, 0x48, 0x00, 0x68, 0x80, 0x47, 0x20, 0x48, + 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0x21, 0x48, 0x01, 0x68, 0x00, 0x20, + 0x88, 0x47, 0x1e, 0x48, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0xb8, 0xf1, + 0x00, 0x0f, 0x09, 0xd1, 0x1e, 0x4a, 0x1f, 0x4b, 0x08, 0x21, 0x10, 0x78, + 0x19, 0x54, 0x01, 0x30, 0x10, 0x70, 0x16, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x26, 0x48, 0x00, 0x68, 0x80, 0x47, 0x10, 0xe0, 0x00, 0x20, 0x40, 0xf6, + 0x26, 0x61, 0xd0, 0xf7, 0x3b, 0xfc, 0x15, 0x48, 0x15, 0x4a, 0x4f, 0xf0, + 0x01, 0x08, 0x01, 0x78, 0x02, 0xf8, 0x01, 0x80, 0x01, 0x31, 0x01, 0x70, + 0x07, 0xe0, 0x4f, 0xf0, 0x00, 0x08, 0x50, 0x46, 0xd0, 0xf7, 0x4a, 0xfc, + 0x28, 0x46, 0xd0, 0xf7, 0x47, 0xfc, 0x5f, 0xfa, 0x88, 0xf0, 0x11, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0x69, 0x08, 0x00, 0xd4, 0x9b, 0x08, 0x00, + 0xd0, 0xfc, 0x08, 0x00, 0x04, 0xfd, 0x08, 0x00, 0x14, 0xfd, 0x08, 0x00, + 0x80, 0xbd, 0x08, 0x00, 0x18, 0xfd, 0x08, 0x00, 0x0c, 0xfd, 0x08, 0x00, + 0x30, 0xe4, 0x01, 0x00, 0x84, 0x9a, 0x08, 0x00, 0x28, 0x1b, 0x06, 0x00, + 0x29, 0x1b, 0x06, 0x00, 0xd8, 0xfc, 0x08, 0x00, 0x34, 0xec, 0x01, 0x00, + 0x40, 0xec, 0x01, 0x00, 0xfc, 0xfc, 0x08, 0x00, 0x00, 0x00, 0xfe, 0x0f, + 0x28, 0xfd, 0x08, 0x00, 0x2c, 0xfd, 0x08, 0x00, 0x64, 0x8d, 0x08, 0x00, + 0x4d, 0xcd, 0x11, 0x10, 0xe4, 0x9b, 0x08, 0x00, 0x30, 0xfd, 0x08, 0x00, + 0xdc, 0xfc, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x89, 0xb0, 0x07, 0x46, + 0x00, 0x20, 0x90, 0x46, 0x8b, 0x46, 0xcd, 0xe9, 0x07, 0x00, 0xcd, 0xe9, + 0x05, 0x00, 0x80, 0x48, 0x00, 0x78, 0xc0, 0x07, 0x06, 0xd0, 0xbb, 0xf1, + 0x00, 0x0f, 0x03, 0xd1, 0x7d, 0x48, 0x00, 0x21, 0xa0, 0xf8, 0xb4, 0x12, + 0xb8, 0x06, 0x44, 0xbf, 0x07, 0xf0, 0x03, 0x00, 0x80, 0xf0, 0x0f, 0x07, + 0x3e, 0x46, 0x78, 0xb2, 0x0c, 0x28, 0x03, 0xdb, 0x3e, 0x46, 0x10, 0x28, + 0xb8, 0xbf, 0x10, 0x3e, 0x75, 0x48, 0xdf, 0xf8, 0xd8, 0x91, 0x03, 0xaa, + 0x00, 0xeb, 0x4b, 0x10, 0x99, 0xf9, 0x07, 0x10, 0x30, 0xf8, 0x17, 0x00, + 0x08, 0x44, 0x59, 0x46, 0x0f, 0xfa, 0x80, 0xfa, 0x70, 0x48, 0x03, 0x68, + 0x50, 0x46, 0x98, 0x47, 0x6f, 0x48, 0xdb, 0x4c, 0x01, 0x68, 0x94, 0xf8, + 0xca, 0x51, 0x01, 0x20, 0x88, 0x47, 0x28, 0xb1, 0x99, 0xf8, 0x05, 0x00, + 0xb0, 0xfa, 0x80, 0xf0, 0x40, 0x09, 0x00, 0xe0, 0x00, 0x20, 0x94, 0xf8, + 0xd4, 0x1d, 0x59, 0xb1, 0x94, 0xf8, 0xf3, 0x2d, 0x73, 0xb2, 0x00, 0x21, + 0x93, 0x42, 0x06, 0xdb, 0xb4, 0xf9, 0xe4, 0x2d, 0x92, 0x45, 0xa8, 0xbf, + 0x01, 0x21, 0x00, 0xe0, 0x00, 0x21, 0xbb, 0xf1, 0x02, 0x0f, 0x16, 0xd1, + 0x5f, 0x4a, 0x60, 0x4b, 0x12, 0x78, 0x02, 0xeb, 0x02, 0x12, 0x03, 0xeb, + 0xc2, 0x02, 0x12, 0x69, 0x12, 0x7f, 0x63, 0x2a, 0x0b, 0xd3, 0x66, 0x2a, + 0x07, 0xd3, 0x6c, 0x2a, 0x05, 0xd0, 0x73, 0x2a, 0x05, 0xd3, 0x78, 0x2a, + 0x01, 0xd3, 0xa0, 0x2a, 0x01, 0xd1, 0x99, 0xf8, 0x03, 0x50, 0x00, 0x2d, + 0x51, 0xd0, 0x01, 0x2d, 0x44, 0xd1, 0x00, 0x28, 0x4d, 0xd0, 0x53, 0x48, + 0x05, 0xa9, 0x5a, 0x46, 0x00, 0x23, 0x01, 0x25, 0x0c, 0x31, 0x04, 0x68, + 0xbd, 0xf9, 0x0e, 0x00, 0x00, 0x91, 0x01, 0x21, 0xa0, 0x47, 0xbd, 0xf9, + 0x0e, 0x10, 0xbd, 0xf9, 0x20, 0x20, 0x51, 0x1a, 0x21, 0xea, 0xe1, 0x71, + 0x8d, 0xf8, 0x19, 0x10, 0x49, 0x49, 0x0a, 0x68, 0x59, 0x46, 0x90, 0x47, + 0x48, 0x49, 0x80, 0xb2, 0x01, 0x22, 0x0b, 0x68, 0x59, 0x46, 0x98, 0x47, + 0x46, 0x49, 0x91, 0xf8, 0x71, 0x11, 0xc1, 0xb1, 0x45, 0x49, 0x9d, 0xf8, + 0x19, 0x20, 0x4f, 0xf4, 0x00, 0x43, 0x51, 0xf8, 0x28, 0x10, 0x62, 0xf3, + 0x0c, 0x23, 0x0b, 0x60, 0xa4, 0x49, 0x4f, 0xf6, 0xff, 0x73, 0x51, 0xf8, + 0x28, 0x10, 0x0a, 0x68, 0xc2, 0xea, 0x00, 0x42, 0x6f, 0xf3, 0xdf, 0x30, + 0x0a, 0x60, 0x0a, 0x68, 0x9a, 0x43, 0x10, 0x44, 0x08, 0x60, 0x9d, 0xf8, + 0x19, 0x00, 0xbd, 0xf8, 0x20, 0x10, 0x8d, 0xf8, 0x15, 0x50, 0x48, 0xe0, + 0x48, 0xb1, 0x41, 0xb1, 0x03, 0xaa, 0x05, 0xab, 0x50, 0x46, 0x39, 0x46, + 0xcd, 0xe9, 0x00, 0xb8, 0x05, 0xf0, 0xb8, 0xfd, 0x40, 0xe0, 0x2c, 0x48, + 0x05, 0xa9, 0x5a, 0x46, 0x00, 0x23, 0x0a, 0x31, 0x04, 0x68, 0xbd, 0xf9, + 0x0c, 0x00, 0x00, 0x91, 0x00, 0x21, 0xa0, 0x47, 0xbd, 0xf9, 0x0c, 0x10, + 0xbd, 0xf9, 0x1e, 0x20, 0x51, 0x1a, 0x21, 0xea, 0xe1, 0x71, 0x8d, 0xf8, + 0x18, 0x10, 0x23, 0x49, 0x0a, 0x68, 0x59, 0x46, 0x90, 0x47, 0x22, 0x49, + 0x80, 0xb2, 0x00, 0x22, 0x0b, 0x68, 0x59, 0x46, 0x98, 0x47, 0x20, 0x49, + 0x91, 0xf8, 0x71, 0x11, 0xa1, 0xb1, 0x1f, 0x49, 0x9d, 0xf8, 0x18, 0x30, + 0x04, 0x22, 0x51, 0xf8, 0x28, 0x10, 0x62, 0xf3, 0x5f, 0x13, 0x0b, 0x60, + 0x7e, 0x49, 0x4f, 0xf6, 0xff, 0x73, 0x51, 0xf8, 0x28, 0x10, 0x0a, 0x68, + 0x9a, 0x43, 0x10, 0x44, 0x08, 0x60, 0x08, 0x68, 0x80, 0xb2, 0x08, 0x60, + 0x01, 0x20, 0xbd, 0xf8, 0x1e, 0x10, 0x8d, 0xf8, 0x14, 0x00, 0x9d, 0xf8, + 0x18, 0x00, 0x08, 0x1a, 0xad, 0xf8, 0x22, 0x00, 0x10, 0x48, 0x59, 0x46, + 0x02, 0x68, 0x05, 0xa8, 0x90, 0x47, 0x09, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x8c, 0x32, 0x06, 0x00, 0x98, 0xca, 0x01, 0x00, 0xb2, 0xd0, 0x01, 0x00, + 0x48, 0xdc, 0x05, 0x00, 0x98, 0xbd, 0x08, 0x00, 0xcc, 0xbd, 0x08, 0x00, + 0x74, 0x87, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, 0x68, 0xbd, 0x08, 0x00, + 0x9c, 0xbd, 0x08, 0x00, 0xa0, 0xbd, 0x08, 0x00, 0x8c, 0x7e, 0x08, 0x00, + 0xc8, 0x15, 0x01, 0x10, 0xa4, 0xbd, 0x08, 0x00, 0xfe, 0xb5, 0x35, 0x4c, + 0x0a, 0x46, 0x00, 0x26, 0xe1, 0x8b, 0x94, 0xf8, 0x22, 0x30, 0x94, 0xf8, + 0x23, 0x50, 0x00, 0x24, 0x17, 0x06, 0x09, 0xd0, 0x02, 0xf0, 0x01, 0x07, + 0x01, 0x34, 0xd2, 0xb2, 0x3e, 0x44, 0xe7, 0xb2, 0x52, 0x08, 0x08, 0x2f, + 0xf4, 0xd1, 0x08, 0x24, 0xf2, 0xb2, 0x02, 0x2a, 0x05, 0xd0, 0x01, 0x2a, + 0x41, 0xd1, 0x21, 0xf0, 0x01, 0x01, 0x65, 0x1e, 0x02, 0xe0, 0x41, 0xf0, + 0x01, 0x01, 0x00, 0x25, 0x00, 0x22, 0x00, 0x24, 0x06, 0x06, 0x09, 0xd0, + 0x00, 0xf0, 0x01, 0x06, 0x01, 0x34, 0xc0, 0xb2, 0x32, 0x44, 0xe6, 0xb2, + 0x40, 0x08, 0x08, 0x2e, 0xf4, 0xd1, 0x08, 0x24, 0xd0, 0xb2, 0x02, 0x28, + 0x02, 0xd0, 0x01, 0x28, 0x27, 0xd1, 0x62, 0x1e, 0x1b, 0x48, 0x1c, 0x4c, + 0x00, 0x23, 0x04, 0x30, 0x50, 0xf8, 0x04, 0x6c, 0x8e, 0xb1, 0x07, 0x78, + 0x47, 0xf0, 0x02, 0x07, 0x03, 0x2f, 0x0c, 0xd1, 0x72, 0xb6, 0x27, 0x68, + 0x7f, 0x00, 0x01, 0x37, 0x27, 0x60, 0x86, 0xf8, 0x92, 0x20, 0x26, 0x68, + 0x76, 0x08, 0x26, 0x60, 0x26, 0x68, 0x86, 0xf3, 0x10, 0x88, 0x01, 0x33, + 0x0c, 0x30, 0x17, 0x2b, 0xe6, 0xd1, 0x00, 0x24, 0xe8, 0xb2, 0xd3, 0xb2, + 0x00, 0x22, 0xcd, 0xe9, 0x00, 0x04, 0x00, 0x20, 0xfd, 0xf7, 0xaa, 0xfd, + 0x0b, 0xe0, 0x00, 0x20, 0xea, 0xb2, 0xcd, 0xe9, 0x00, 0x20, 0x00, 0x20, + 0x00, 0x22, 0xfd, 0xf7, 0xa1, 0xfd, 0x06, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x12, 0x24, 0x20, 0x46, 0xfe, 0xbd, 0x00, 0xbf, 0xbc, 0xfe, 0x05, 0x00, + 0xe8, 0x72, 0x01, 0x00, 0x24, 0x36, 0x01, 0x00, 0xa0, 0xd7, 0x08, 0x00, + 0x00, 0x20, 0xfd, 0xf7, 0x33, 0xbd, 0x00, 0xbf, 0xb0, 0xb5, 0x24, 0x4c, + 0x00, 0x25, 0x25, 0x60, 0x98, 0xb1, 0xd3, 0xb1, 0x22, 0x48, 0x01, 0x29, + 0x40, 0x68, 0x03, 0x68, 0x9b, 0xb2, 0x1d, 0xd1, 0x43, 0xea, 0x02, 0x41, + 0x4f, 0xf4, 0x80, 0x42, 0x41, 0xf0, 0x00, 0x41, 0x01, 0x60, 0x01, 0x68, + 0x62, 0xf3, 0x0f, 0x01, 0x01, 0x60, 0xa0, 0x6a, 0x0d, 0xe0, 0x1e, 0x48, + 0xa5, 0x61, 0xa5, 0x62, 0x00, 0x68, 0x80, 0x47, 0x1c, 0x48, 0x05, 0x60, + 0xb0, 0xbd, 0x22, 0xf4, 0x80, 0x40, 0x01, 0x29, 0xa0, 0x61, 0xa0, 0x6a, + 0x0a, 0xd1, 0x40, 0xf4, 0x00, 0x40, 0x09, 0xe0, 0x03, 0x60, 0x01, 0x68, + 0xc2, 0xea, 0x01, 0x01, 0x41, 0xf4, 0x40, 0x41, 0x01, 0x60, 0xa0, 0x6a, + 0x40, 0xf0, 0x80, 0x00, 0xa0, 0x62, 0x0c, 0x48, 0x01, 0x21, 0x00, 0x22, + 0x90, 0xf8, 0x5a, 0x02, 0x02, 0x30, 0x61, 0xf3, 0x1f, 0x20, 0x09, 0x49, + 0x08, 0x60, 0x09, 0x48, 0x00, 0x21, 0x03, 0x68, 0x05, 0x20, 0x98, 0x47, + 0x07, 0x48, 0x00, 0x68, 0x80, 0x47, 0x0b, 0x20, 0x20, 0x60, 0xb0, 0xbd, + 0x60, 0x20, 0x01, 0x40, 0xd8, 0x15, 0x01, 0x10, 0x00, 0x69, 0x08, 0x00, + 0x74, 0x20, 0x21, 0x40, 0x0c, 0x99, 0x08, 0x00, 0x14, 0xa1, 0x08, 0x00, + 0xf4, 0xd6, 0x08, 0x00, 0x04, 0x28, 0x21, 0x40, 0xfe, 0xb5, 0x03, 0x46, + 0x14, 0x46, 0x00, 0x20, 0x0a, 0x46, 0x99, 0x42, 0xad, 0xf8, 0x0a, 0x00, + 0x20, 0xd9, 0xd8, 0x07, 0x59, 0x08, 0x00, 0x23, 0x00, 0x26, 0xd0, 0xf7, + 0x39, 0xfa, 0x23, 0x4f, 0x0f, 0x22, 0x0f, 0x23, 0x00, 0x92, 0x1f, 0x22, + 0x3d, 0x68, 0xa8, 0x47, 0x05, 0x46, 0x00, 0xb2, 0x0d, 0xf1, 0x0a, 0x01, + 0x03, 0xf0, 0x8e, 0xfc, 0xa8, 0xbb, 0xbd, 0xf8, 0x0a, 0x20, 0x00, 0x20, + 0x4f, 0xf0, 0x80, 0x41, 0x00, 0x23, 0xd0, 0xf7, 0x23, 0xfa, 0x3e, 0x68, + 0x10, 0x22, 0x00, 0x92, 0x2f, 0x22, 0x1d, 0xe0, 0x20, 0xd2, 0xd0, 0x07, + 0x51, 0x08, 0x1a, 0x46, 0x00, 0x23, 0x00, 0x26, 0xd0, 0xf7, 0x16, 0xfa, + 0x11, 0x4a, 0x0f, 0x23, 0x15, 0x68, 0x0f, 0x22, 0x00, 0x92, 0x1f, 0x22, + 0xa8, 0x47, 0x05, 0x46, 0x00, 0xb2, 0x0d, 0xf1, 0x0a, 0x01, 0x03, 0xf0, + 0x6b, 0xfc, 0x90, 0xb9, 0x0b, 0x48, 0x10, 0x21, 0x0f, 0x22, 0x00, 0x91, + 0x00, 0x21, 0x06, 0x68, 0xbd, 0xf8, 0x0a, 0x00, 0x0f, 0x23, 0xb0, 0x47, + 0x20, 0x80, 0x00, 0xe0, 0x00, 0x25, 0x2c, 0x48, 0xbd, 0xf8, 0x0a, 0x10, + 0x01, 0x26, 0x45, 0x84, 0x81, 0x84, 0x30, 0x46, 0xfe, 0xbd, 0x00, 0xbf, + 0xc0, 0xfb, 0x08, 0x00, 0xc8, 0xfb, 0x08, 0x00, 0x2d, 0xe9, 0xfc, 0x47, + 0x4f, 0xf4, 0x00, 0x45, 0x98, 0x46, 0x92, 0x46, 0x0f, 0x46, 0x06, 0x46, + 0x88, 0x42, 0xad, 0xf8, 0x02, 0x50, 0x09, 0xd0, 0x0d, 0xf1, 0x02, 0x02, + 0x30, 0x46, 0x39, 0x46, 0xff, 0xf7, 0x94, 0xff, 0x01, 0x28, 0x34, 0xd1, + 0xbd, 0xf8, 0x02, 0x50, 0x1b, 0x48, 0xdf, 0xf8, 0x68, 0x90, 0x0d, 0xf1, + 0x06, 0x03, 0x39, 0x46, 0x32, 0x46, 0x04, 0x68, 0x50, 0x46, 0xa9, 0xf8, + 0x1e, 0x50, 0xa0, 0x47, 0x01, 0x28, 0x24, 0xd1, 0x15, 0x49, 0xbd, 0xf9, + 0x06, 0x00, 0x09, 0xf1, 0x14, 0x04, 0x0a, 0x68, 0x01, 0xa9, 0x20, 0x81, + 0x90, 0x47, 0x01, 0x28, 0x19, 0xd1, 0x11, 0x48, 0xbd, 0xf8, 0x04, 0x10, + 0x0a, 0x9e, 0x02, 0x68, 0x28, 0x46, 0xa1, 0x81, 0x90, 0x47, 0xa8, 0xf8, + 0x00, 0x00, 0x0d, 0x48, 0xbd, 0xf8, 0x04, 0x10, 0x02, 0x68, 0xbd, 0xf9, + 0x06, 0x00, 0x90, 0x47, 0x30, 0x70, 0xb8, 0xf8, 0x00, 0x00, 0x20, 0x80, + 0x30, 0x78, 0xa0, 0x70, 0x00, 0x20, 0xbd, 0xe8, 0xfc, 0x87, 0x01, 0x20, + 0xbd, 0xe8, 0xfc, 0x87, 0x28, 0x1d, 0x06, 0x00, 0x58, 0xfe, 0x08, 0x00, + 0x60, 0xfe, 0x08, 0x00, 0x64, 0xfe, 0x08, 0x00, 0x68, 0xfe, 0x08, 0x00, + 0x68, 0xb1, 0x01, 0x28, 0x16, 0xd1, 0x0c, 0x48, 0x01, 0x22, 0x01, 0x68, + 0x62, 0xf3, 0x01, 0x01, 0x14, 0x22, 0x01, 0x60, 0xd0, 0xf8, 0x24, 0x11, + 0x62, 0xf3, 0x8b, 0x11, 0x08, 0xe0, 0x06, 0x48, 0x01, 0x68, 0x21, 0xf0, + 0x03, 0x01, 0x01, 0x60, 0xd0, 0xf8, 0x24, 0x11, 0x21, 0xf4, 0x7c, 0x61, + 0xc0, 0xf8, 0x24, 0x11, 0x70, 0x47, 0x00, 0xbf, 0x1c, 0x00, 0x03, 0x40, + 0x2d, 0xe9, 0xf0, 0x4f, 0x8f, 0xb0, 0x9b, 0x4e, 0x96, 0xf8, 0xd8, 0x02, + 0x80, 0x07, 0x02, 0xd4, 0x4f, 0xf0, 0x00, 0x08, 0x28, 0xe1, 0x98, 0x4d, + 0x01, 0x20, 0x00, 0x21, 0x00, 0x24, 0x2a, 0x68, 0x90, 0x47, 0x2a, 0x68, + 0x01, 0x20, 0x01, 0x21, 0x90, 0x47, 0xc6, 0x48, 0x6f, 0xf0, 0x01, 0x01, + 0x00, 0x88, 0x00, 0xeb, 0x80, 0x00, 0x01, 0xeb, 0x40, 0x00, 0xc3, 0x49, + 0x01, 0xf1, 0x01, 0x0b, 0xd8, 0x47, 0x8e, 0x48, 0x01, 0x68, 0x00, 0x20, + 0x88, 0x47, 0x8d, 0x48, 0x0c, 0x22, 0x8d, 0x4f, 0x01, 0x68, 0x62, 0xf3, + 0x8a, 0x11, 0x01, 0x60, 0x38, 0x46, 0x74, 0x21, 0xcc, 0xf7, 0x40, 0xfc, + 0x07, 0xf1, 0x66, 0x00, 0x4f, 0xf4, 0x80, 0x71, 0x01, 0x34, 0x01, 0x80, + 0x20, 0xf8, 0x06, 0x1c, 0x02, 0x30, 0x03, 0x2c, 0xf8, 0xd1, 0xff, 0xf7, + 0x55, 0xfa, 0x83, 0x49, 0x83, 0x4c, 0xdf, 0xf8, 0x14, 0x82, 0x6c, 0x27, + 0x4f, 0xf0, 0x30, 0x0a, 0x2a, 0x22, 0x4f, 0xf0, 0x00, 0x09, 0x60, 0x58, + 0xcd, 0xf8, 0x18, 0xb0, 0x04, 0x90, 0x00, 0x20, 0x09, 0x90, 0x60, 0x58, + 0x62, 0xf3, 0x0f, 0x20, 0x60, 0x50, 0x01, 0x20, 0xff, 0xf7, 0x8e, 0xff, + 0xd8, 0xf8, 0x00, 0x00, 0x80, 0x47, 0x00, 0x28, 0x40, 0xf0, 0xde, 0x80, + 0xcd, 0xf8, 0x2c, 0xa0, 0xcd, 0xe9, 0x01, 0x9a, 0x03, 0x97, 0xba, 0x46, + 0xdd, 0xf8, 0x18, 0xb0, 0x9f, 0x4f, 0xdf, 0xf8, 0xd4, 0x81, 0x00, 0x20, + 0x09, 0x21, 0x32, 0x25, 0xcd, 0xe9, 0x07, 0x0a, 0x70, 0x48, 0x0a, 0x91, + 0x00, 0x24, 0x02, 0x68, 0xc8, 0xb2, 0x00, 0x21, 0x90, 0x47, 0xd8, 0xf8, + 0x00, 0x10, 0x82, 0x46, 0x01, 0x20, 0x88, 0x47, 0x01, 0x20, 0x00, 0xf0, + 0xd9, 0xf8, 0x38, 0x88, 0x68, 0x43, 0x02, 0x38, 0xd8, 0x47, 0x09, 0x98, + 0x52, 0x46, 0x01, 0x23, 0xc5, 0xb2, 0x01, 0x20, 0x29, 0x46, 0xff, 0xf7, + 0x53, 0xfe, 0x41, 0xf2, 0x78, 0x50, 0x30, 0x5a, 0x10, 0xb1, 0x39, 0x88, + 0x48, 0x43, 0x84, 0x1e, 0x20, 0x46, 0xd8, 0x47, 0x0e, 0xa8, 0x0c, 0xa9, + 0x0d, 0xaa, 0x00, 0xf0, 0xcf, 0xf8, 0x00, 0x28, 0x40, 0xf0, 0x8e, 0x80, + 0x05, 0x95, 0x55, 0x4d, 0x05, 0xeb, 0x09, 0x08, 0x08, 0xf1, 0x48, 0x00, + 0x08, 0xf1, 0x54, 0x01, 0x00, 0xf0, 0xc2, 0xf9, 0xdf, 0xf8, 0x4c, 0xb1, + 0x28, 0x21, 0x58, 0x46, 0xcc, 0xf7, 0xca, 0xfb, 0x0c, 0x98, 0x40, 0xf3, + 0x16, 0x04, 0x0b, 0x99, 0x0e, 0x9e, 0x0d, 0x9f, 0xcb, 0xf8, 0x18, 0xa0, + 0x0c, 0x94, 0x6c, 0x50, 0x29, 0x44, 0x41, 0xf8, 0x30, 0x6c, 0x09, 0x99, + 0x8b, 0xf8, 0x00, 0x10, 0x0a, 0x99, 0xa1, 0xf1, 0x09, 0x01, 0x8b, 0xf8, + 0x17, 0x10, 0xcb, 0xe9, 0x01, 0x67, 0xcb, 0xe9, 0x03, 0x04, 0x05, 0xeb, + 0x49, 0x00, 0x87, 0x61, 0x06, 0xb1, 0x27, 0xb9, 0x00, 0x20, 0x41, 0xf2, + 0x3d, 0x31, 0xca, 0xf7, 0x01, 0xfa, 0x43, 0x49, 0x3b, 0x48, 0xdd, 0xf8, + 0x20, 0xa0, 0x08, 0xf1, 0x60, 0x03, 0x22, 0x46, 0x50, 0x44, 0x0d, 0x68, + 0x39, 0x46, 0x00, 0x90, 0x30, 0x46, 0xa8, 0x47, 0xdf, 0xf8, 0xec, 0xb0, + 0x00, 0x28, 0x4c, 0xd1, 0xdb, 0xf8, 0x00, 0x10, 0x00, 0x20, 0xd8, 0x46, + 0x88, 0x47, 0xb9, 0x4c, 0x60, 0x4f, 0x32, 0x25, 0x20, 0x68, 0x20, 0xf0, + 0x70, 0x00, 0x20, 0x60, 0x38, 0x88, 0xdd, 0xf8, 0x18, 0xb0, 0x68, 0x43, + 0x02, 0x38, 0xd8, 0x47, 0xb4, 0x48, 0x00, 0x26, 0x06, 0x60, 0xb4, 0x48, + 0x06, 0x60, 0xb4, 0x48, 0x06, 0x60, 0xb4, 0x48, 0x00, 0x68, 0x80, 0x47, + 0xb3, 0x48, 0x09, 0xf1, 0x02, 0x09, 0x0a, 0xf1, 0x01, 0x0a, 0x06, 0x60, + 0xef, 0x4e, 0x0b, 0x98, 0x0a, 0x99, 0x04, 0x30, 0x01, 0x31, 0x0b, 0x90, + 0x07, 0x98, 0x01, 0x30, 0x03, 0x28, 0x7f, 0xf4, 0x61, 0xaf, 0x04, 0x99, + 0x01, 0x20, 0x00, 0xf0, 0x15, 0xf9, 0x09, 0x98, 0xdd, 0xf8, 0x08, 0xa0, + 0xdd, 0xf8, 0x04, 0x90, 0x03, 0x9f, 0xa7, 0x49, 0xdf, 0xf8, 0x6c, 0x80, + 0x2a, 0x22, 0x01, 0x30, 0x0a, 0xf1, 0x0c, 0x0a, 0x09, 0xf1, 0x06, 0x09, + 0x03, 0x37, 0x02, 0x28, 0x09, 0x90, 0x7f, 0xf4, 0x2e, 0xaf, 0x96, 0xf8, + 0xca, 0x01, 0xff, 0xf7, 0x3f, 0xf9, 0xe3, 0xe6, 0x80, 0x46, 0x28, 0x46, + 0x01, 0xe0, 0x80, 0x46, 0x05, 0x98, 0x00, 0xf0, 0x7b, 0xf8, 0x93, 0x49, + 0x08, 0x68, 0x20, 0xf0, 0x70, 0x00, 0x08, 0x60, 0x04, 0x99, 0x00, 0x20, + 0x00, 0xf0, 0xec, 0xf8, 0x40, 0x46, 0x0f, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x80, 0x46, 0xf5, 0xe7, 0x00, 0x69, 0x08, 0x00, 0x34, 0xfe, 0x08, 0x00, + 0xd0, 0xfc, 0x08, 0x00, 0x48, 0x0e, 0x23, 0x40, 0xb4, 0x1a, 0x06, 0x00, + 0x00, 0xf2, 0xff, 0xff, 0x04, 0x0e, 0x03, 0x40, 0x28, 0x1d, 0x06, 0x00, + 0x84, 0x9a, 0x08, 0x00, 0x9c, 0xbd, 0x08, 0x00, 0x70, 0xfc, 0x08, 0x00, + 0xb8, 0xbd, 0x08, 0x00, 0x7f, 0x4a, 0x6f, 0xf0, 0x70, 0x01, 0x01, 0x28, + 0x08, 0xbf, 0x6f, 0xf0, 0xf0, 0x01, 0x01, 0x28, 0x13, 0x68, 0x01, 0xea, + 0x03, 0x01, 0x08, 0xbf, 0x41, 0xf0, 0xe0, 0x01, 0x11, 0x60, 0x70, 0x47, + 0x2d, 0xe9, 0xfe, 0x4f, 0x82, 0x46, 0x1d, 0x48, 0xba, 0x4e, 0xdf, 0xf8, + 0x74, 0x80, 0x00, 0x24, 0x41, 0xf2, 0x76, 0x55, 0x41, 0xf2, 0x74, 0x5b, + 0xcd, 0xe9, 0x01, 0x21, 0x81, 0x46, 0x19, 0x48, 0x47, 0x1c, 0x70, 0x5b, + 0xe1, 0xb2, 0x88, 0x42, 0x24, 0xd9, 0x36, 0xf8, 0x0b, 0x00, 0x20, 0xb1, + 0xb8, 0xf8, 0x00, 0x10, 0x48, 0x43, 0x02, 0x38, 0x00, 0xe0, 0x00, 0x20, + 0xb8, 0x47, 0x48, 0x46, 0x01, 0x34, 0xd9, 0xf8, 0x08, 0x00, 0x00, 0x02, + 0xeb, 0xd5, 0xd9, 0xf8, 0x00, 0x00, 0x6f, 0xf3, 0x9f, 0x50, 0xca, 0xf8, + 0x00, 0x00, 0xd9, 0xf8, 0x04, 0x00, 0x01, 0x99, 0x6f, 0xf3, 0x9f, 0x50, + 0x08, 0x60, 0xd9, 0xf8, 0x08, 0x00, 0x02, 0x99, 0x6f, 0xf3, 0xdf, 0x50, + 0x08, 0x60, 0x00, 0x20, 0xbd, 0xe8, 0xfe, 0x8f, 0x01, 0x20, 0xbd, 0xe8, + 0xfe, 0x8f, 0x00, 0xbf, 0x54, 0x0e, 0x03, 0x40, 0x34, 0xec, 0x01, 0x00, + 0x40, 0xec, 0x01, 0x00, 0xf8, 0xb5, 0x34, 0x4d, 0x34, 0x4e, 0x04, 0x46, + 0x1d, 0x21, 0x0a, 0x22, 0x28, 0x46, 0xb0, 0x47, 0x05, 0xf1, 0x14, 0x00, + 0x21, 0x21, 0x0a, 0x22, 0xb0, 0x47, 0x05, 0xf1, 0x28, 0x00, 0x24, 0x21, + 0x0a, 0x22, 0xb0, 0x47, 0x05, 0xf1, 0x3c, 0x00, 0x28, 0x21, 0x0a, 0x22, + 0xb0, 0x47, 0x05, 0xf1, 0x50, 0x00, 0x2d, 0x21, 0x0a, 0x22, 0xb0, 0x47, + 0x05, 0xf1, 0x64, 0x00, 0x5c, 0xb1, 0x56, 0x21, 0x0a, 0x22, 0xb0, 0x47, + 0x05, 0xf1, 0x78, 0x00, 0x5c, 0x21, 0x0a, 0x22, 0xb0, 0x47, 0x05, 0xf1, + 0x8c, 0x00, 0x5f, 0x21, 0x0a, 0xe0, 0x4a, 0x21, 0x0a, 0x22, 0xb0, 0x47, + 0x05, 0xf1, 0x78, 0x00, 0x50, 0x21, 0x0a, 0x22, 0xb0, 0x47, 0x05, 0xf1, + 0x8c, 0x00, 0x53, 0x21, 0x0a, 0x22, 0xb0, 0x47, 0x1a, 0x4a, 0x05, 0xf1, + 0xa0, 0x00, 0x00, 0x21, 0x08, 0xca, 0x01, 0x31, 0x69, 0x29, 0x08, 0xc0, + 0xfa, 0xd1, 0x17, 0x4e, 0x01, 0x20, 0x31, 0x68, 0x88, 0x47, 0x16, 0x4f, + 0x01, 0x20, 0x39, 0x68, 0x88, 0x47, 0x15, 0x4d, 0x41, 0xf2, 0x3c, 0x01, + 0x28, 0x46, 0xcc, 0xf7, 0x7b, 0xfa, 0x13, 0x4a, 0x05, 0xeb, 0x44, 0x00, + 0x01, 0x1d, 0x13, 0x68, 0x22, 0x46, 0x98, 0x47, 0x10, 0x4b, 0x05, 0xeb, + 0x84, 0x02, 0x02, 0xf1, 0x08, 0x00, 0x02, 0xf1, 0x18, 0x01, 0x10, 0x32, + 0x1d, 0x68, 0x23, 0x46, 0xa8, 0x47, 0x39, 0x68, 0x00, 0x20, 0x88, 0x47, + 0x31, 0x68, 0x00, 0x20, 0xbd, 0xe8, 0xf8, 0x40, 0x08, 0x47, 0x00, 0xbf, + 0x50, 0x1d, 0x06, 0x00, 0xa1, 0x38, 0x05, 0x00, 0x00, 0xc0, 0x05, 0x30, + 0x14, 0xfd, 0x08, 0x00, 0x0c, 0xfd, 0x08, 0x00, 0x2c, 0xff, 0x05, 0x00, + 0xfc, 0xfc, 0x08, 0x00, 0x30, 0xfe, 0x08, 0x00, 0x70, 0xb5, 0x18, 0x4d, + 0x0c, 0x46, 0x50, 0xb1, 0x00, 0x20, 0xff, 0xf7, 0xbb, 0xfd, 0x16, 0x48, + 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, 0x28, 0x68, 0x20, 0xf0, 0x80, 0x00, + 0x16, 0xe0, 0x13, 0x48, 0x00, 0x26, 0x06, 0x60, 0x12, 0x48, 0x06, 0x60, + 0x12, 0x48, 0x06, 0x60, 0x12, 0x48, 0x00, 0x68, 0x80, 0x47, 0x12, 0x48, + 0x06, 0x60, 0x00, 0x20, 0xff, 0xf7, 0xa4, 0xfd, 0x0a, 0x48, 0x01, 0x68, + 0x00, 0x20, 0x88, 0x47, 0x2e, 0x60, 0x28, 0x68, 0x40, 0xf0, 0x80, 0x00, + 0x28, 0x60, 0x0c, 0x48, 0x22, 0x0a, 0x29, 0x58, 0x62, 0xf3, 0x0f, 0x21, + 0x29, 0x50, 0xca, 0x48, 0x00, 0x68, 0xbd, 0xe8, 0x70, 0x40, 0x00, 0x47, + 0x04, 0x0e, 0x03, 0x40, 0x70, 0xfc, 0x08, 0x00, 0x60, 0x20, 0x01, 0x40, + 0x78, 0x20, 0x01, 0x40, 0x88, 0x20, 0x01, 0x40, 0xf4, 0xd6, 0x08, 0x00, + 0x04, 0x28, 0x21, 0x40, 0x00, 0xf2, 0xff, 0xff, 0x03, 0x4a, 0x13, 0x68, + 0x1b, 0x0c, 0x03, 0x80, 0x10, 0x68, 0x08, 0x80, 0x70, 0x47, 0x00, 0xbf, + 0x50, 0x0e, 0x03, 0x40, 0x00, 0xb1, 0x70, 0x47, 0x08, 0x48, 0x36, 0x49, + 0xd0, 0xf8, 0x34, 0x22, 0xd1, 0xf8, 0x34, 0x32, 0x93, 0x42, 0x05, 0xd1, + 0xd0, 0xf8, 0xd8, 0x02, 0xd1, 0xf8, 0xd8, 0x12, 0x81, 0x42, 0xf0, 0xd0, + 0x02, 0x48, 0x01, 0x21, 0x01, 0x70, 0x70, 0x47, 0x98, 0x62, 0x00, 0x10, + 0xa6, 0x58, 0x01, 0x00, 0x70, 0xb5, 0x2a, 0x49, 0x00, 0x22, 0x01, 0x24, + 0x00, 0x25, 0x00, 0x23, 0x09, 0x68, 0x21, 0xfa, 0x05, 0xf6, 0x01, 0x35, + 0xf6, 0x07, 0x1c, 0xbf, 0x04, 0xfa, 0x02, 0xf6, 0x33, 0x43, 0x02, 0x32, + 0x10, 0x2d, 0xf4, 0xd1, 0x22, 0x49, 0x4f, 0xf4, 0x00, 0x65, 0xd1, 0xf8, + 0x34, 0x22, 0xd4, 0x07, 0x05, 0xea, 0x92, 0x45, 0x1f, 0x4c, 0x04, 0xbf, + 0xa0, 0x24, 0xc0, 0xf2, 0x8a, 0x04, 0x23, 0x43, 0x12, 0xf4, 0x40, 0x3f, + 0x4f, 0xf4, 0x00, 0x54, 0x18, 0xbf, 0x43, 0xf4, 0x00, 0x73, 0x04, 0xea, + 0x52, 0x14, 0x2c, 0x44, 0x23, 0x43, 0x14, 0x03, 0x58, 0xbf, 0x5f, 0xea, + 0xc2, 0x24, 0x01, 0xd5, 0x43, 0xf4, 0x00, 0x43, 0x14, 0x4c, 0x12, 0xf0, + 0x1e, 0x0f, 0x25, 0x78, 0xa6, 0x78, 0xe4, 0x78, 0xc4, 0x70, 0x4f, 0xf4, + 0x00, 0x14, 0x05, 0x70, 0x86, 0x70, 0x18, 0xbf, 0x43, 0xf0, 0x08, 0x03, + 0x04, 0xea, 0x52, 0x22, 0x1a, 0x43, 0xd1, 0xf8, 0xd8, 0x32, 0x91, 0xf8, + 0xf6, 0x1e, 0x03, 0xf0, 0x02, 0x04, 0x03, 0xf0, 0x01, 0x03, 0x01, 0xf0, + 0x01, 0x01, 0x42, 0xea, 0x04, 0x62, 0x42, 0xea, 0x43, 0x72, 0x42, 0xea, + 0xc1, 0x61, 0x41, 0x60, 0x70, 0xbd, 0x00, 0xbf, 0x98, 0xe9, 0x01, 0x00, + 0x00, 0x69, 0x08, 0x00, 0xa2, 0x00, 0x8a, 0x00, 0x9c, 0xe9, 0x01, 0x00, + 0xb0, 0xb5, 0x05, 0x46, 0x12, 0x48, 0x0c, 0x46, 0x01, 0x68, 0x20, 0x46, + 0x88, 0x47, 0x7d, 0x48, 0x41, 0x6b, 0x21, 0xf0, 0x3f, 0x11, 0x45, 0xb1, + 0x0e, 0x4a, 0x52, 0xf8, 0x24, 0x20, 0x02, 0xf0, 0x3f, 0x12, 0x11, 0x43, + 0x41, 0x63, 0x78, 0x49, 0x07, 0xe0, 0x0b, 0x4a, 0x52, 0xf8, 0x24, 0x20, + 0x02, 0xf0, 0x3f, 0x12, 0x11, 0x43, 0x41, 0x63, 0x75, 0x49, 0x0a, 0x68, + 0x42, 0xf4, 0x70, 0x52, 0x0a, 0x60, 0x01, 0x22, 0x01, 0x68, 0x62, 0xf3, + 0x05, 0x11, 0x01, 0x60, 0xb0, 0xbd, 0x00, 0xbf, 0xd0, 0xfc, 0x08, 0x00, + 0xac, 0xa2, 0x05, 0x00, 0xa4, 0xa2, 0x05, 0x00, 0xf0, 0xb5, 0x00, 0x28, + 0x04, 0x46, 0x05, 0x46, 0x67, 0x4e, 0x1c, 0xbf, 0x03, 0x24, 0x01, 0x25, + 0x6b, 0x00, 0x89, 0xb3, 0xf1, 0x6c, 0x46, 0x4a, 0x00, 0x28, 0x01, 0xf0, + 0xfc, 0x21, 0x18, 0xbf, 0x11, 0x43, 0xf1, 0x64, 0x30, 0x68, 0x01, 0x21, + 0x61, 0xf3, 0x05, 0x10, 0x41, 0x49, 0x30, 0x60, 0x18, 0x01, 0x41, 0x4e, + 0xd1, 0xf8, 0xf4, 0x21, 0x40, 0xea, 0x83, 0x10, 0x22, 0xf0, 0xf0, 0x02, + 0x10, 0x44, 0xc1, 0xf8, 0xf4, 0x01, 0x43, 0xea, 0x84, 0x40, 0x0a, 0x68, + 0x40, 0xea, 0x83, 0x70, 0x32, 0x40, 0x10, 0x43, 0x08, 0x60, 0x39, 0x49, + 0x45, 0xea, 0x04, 0x30, 0x38, 0x4c, 0x40, 0xea, 0xc3, 0x30, 0x0a, 0x68, + 0x22, 0x40, 0x10, 0x43, 0x08, 0x60, 0x08, 0x69, 0x20, 0xf0, 0xc0, 0x70, + 0x40, 0xea, 0xc3, 0x50, 0x08, 0x61, 0xf0, 0xbd, 0x99, 0x01, 0x96, 0x46, + 0x31, 0x4a, 0x00, 0x28, 0x31, 0x4f, 0x01, 0xf1, 0xa0, 0x51, 0x08, 0xbf, + 0x99, 0x01, 0x41, 0xea, 0x03, 0x1c, 0x00, 0x28, 0x4f, 0xea, 0x84, 0x70, + 0x91, 0x69, 0x01, 0xea, 0x07, 0x01, 0x61, 0x44, 0x94, 0x46, 0x91, 0x61, + 0x2a, 0x49, 0x0f, 0x68, 0x27, 0xf0, 0x01, 0x07, 0x2f, 0x44, 0x0f, 0x60, + 0x28, 0x4f, 0xf1, 0x6c, 0x01, 0xf0, 0xfc, 0x21, 0x18, 0xbf, 0x39, 0x43, + 0xbe, 0xf1, 0x00, 0x0f, 0xf1, 0x64, 0x0a, 0xd0, 0x40, 0xea, 0x44, 0x60, + 0x40, 0xea, 0xc4, 0x50, 0x40, 0xea, 0x84, 0x40, 0x40, 0xea, 0x83, 0x20, + 0x40, 0xea, 0x03, 0x20, 0x09, 0xe0, 0x40, 0xea, 0x43, 0x60, 0x40, 0xea, + 0xc3, 0x50, 0x40, 0xea, 0x84, 0x40, 0x40, 0xea, 0x84, 0x20, 0x40, 0xea, + 0x04, 0x20, 0xdc, 0xf8, 0x0c, 0x10, 0x19, 0x4a, 0x11, 0x40, 0x19, 0x4a, + 0x10, 0x40, 0x18, 0x43, 0x08, 0x44, 0xcc, 0xf8, 0x0c, 0x00, 0x17, 0x48, + 0x01, 0x69, 0x21, 0xf0, 0xc0, 0x71, 0x41, 0xea, 0xc3, 0x51, 0x01, 0x61, + 0xdc, 0xf8, 0x00, 0x10, 0x21, 0xf0, 0x01, 0x01, 0x29, 0x44, 0xcc, 0xf8, + 0x00, 0x10, 0x45, 0xea, 0x04, 0x31, 0x41, 0xea, 0xc3, 0x31, 0x02, 0x68, + 0x06, 0x4b, 0x1a, 0x40, 0x11, 0x43, 0x01, 0x60, 0xf0, 0xbd, 0x00, 0xbf, + 0xff, 0x00, 0x8a, 0x00, 0x24, 0xee, 0x05, 0x30, 0xfc, 0xff, 0xf3, 0x3f, + 0x10, 0xe2, 0x05, 0x30, 0xfe, 0x4f, 0xfe, 0xff, 0x18, 0xd6, 0x05, 0x30, + 0x0f, 0xff, 0xff, 0xe0, 0x98, 0xc0, 0x05, 0x30, 0xff, 0x00, 0x45, 0x00, + 0xfc, 0xf0, 0x73, 0x38, 0x03, 0x0f, 0x8c, 0xc7, 0x10, 0xca, 0x05, 0x30, + 0x10, 0xb5, 0x04, 0x46, 0x0f, 0x48, 0x00, 0x68, 0x80, 0x47, 0x0f, 0x48, + 0x01, 0x22, 0x41, 0x6b, 0x21, 0xf0, 0x3f, 0x11, 0x41, 0x63, 0x01, 0x68, + 0x62, 0xf3, 0x05, 0x11, 0x01, 0x60, 0x2c, 0xb1, 0x0a, 0x48, 0x0b, 0x4a, + 0x01, 0x68, 0xd2, 0xf8, 0x2c, 0x21, 0x04, 0xe0, 0x09, 0x48, 0x08, 0x4a, + 0x01, 0x68, 0xd2, 0xf8, 0x28, 0x21, 0x21, 0xf0, 0x3f, 0x11, 0x02, 0xf0, + 0x3f, 0x12, 0x11, 0x44, 0x01, 0x60, 0x10, 0xbd, 0xdc, 0xfc, 0x08, 0x00, + 0x00, 0xc0, 0x00, 0x40, 0x28, 0xee, 0x05, 0x30, 0x28, 0xe5, 0x01, 0x00, + 0x28, 0xd6, 0x05, 0x30, 0xf0, 0xb5, 0x02, 0x28, 0x14, 0xd0, 0x01, 0x28, + 0x18, 0xd1, 0xfb, 0x48, 0x77, 0x4a, 0x90, 0xf8, 0x90, 0x32, 0x90, 0xf8, + 0x91, 0x42, 0x55, 0x68, 0x00, 0xf5, 0x1f, 0x70, 0x64, 0xf3, 0x43, 0x05, + 0x55, 0x60, 0x54, 0x68, 0x63, 0xf3, 0x47, 0x14, 0x54, 0x60, 0x59, 0xb1, + 0x70, 0x4b, 0x0a, 0xe0, 0x6d, 0x48, 0x01, 0x68, 0x21, 0xf4, 0x58, 0x71, + 0x60, 0x31, 0xd2, 0xe0, 0x00, 0x29, 0x6f, 0xd0, 0x6b, 0x48, 0x6e, 0xe0, + 0x6b, 0x4b, 0x1c, 0x68, 0x40, 0xf2, 0xf3, 0x35, 0x00, 0x29, 0x6e, 0x49, + 0x24, 0xea, 0x05, 0x04, 0x04, 0xf1, 0x03, 0x04, 0x1c, 0x60, 0x67, 0x4c, + 0xd2, 0xf8, 0xec, 0x33, 0x05, 0x78, 0x86, 0x7b, 0xc7, 0x7b, 0x04, 0xea, + 0x03, 0x04, 0x05, 0xf0, 0x1f, 0x05, 0x03, 0x7c, 0x44, 0xea, 0x05, 0x24, + 0x4f, 0xf0, 0x01, 0x05, 0x04, 0xf1, 0x80, 0x74, 0xc2, 0xf8, 0xec, 0x43, + 0x5e, 0x4a, 0x14, 0x6b, 0x65, 0xf3, 0x01, 0x04, 0x14, 0x63, 0x44, 0x88, + 0x6f, 0xf3, 0xdf, 0x34, 0x44, 0xea, 0x06, 0x45, 0x16, 0x68, 0x5a, 0x4c, + 0x06, 0xea, 0x04, 0x06, 0x35, 0x44, 0x15, 0x60, 0x85, 0x88, 0x56, 0x68, + 0x6f, 0xf3, 0xdf, 0x35, 0x06, 0xea, 0x04, 0x06, 0x45, 0xea, 0x07, 0x45, + 0x35, 0x44, 0x55, 0x60, 0xc5, 0x88, 0x6f, 0xf3, 0xdf, 0x35, 0x45, 0xea, + 0x03, 0x43, 0xd5, 0x68, 0x05, 0xea, 0x04, 0x05, 0x2b, 0x44, 0xd3, 0x60, + 0x05, 0x89, 0x43, 0x7c, 0x6f, 0xf3, 0xdf, 0x35, 0x45, 0xea, 0x03, 0x43, + 0x15, 0x69, 0x05, 0xea, 0x04, 0x05, 0x2b, 0x44, 0x13, 0x61, 0x53, 0x69, + 0x03, 0xea, 0x04, 0x03, 0x84, 0x7c, 0x40, 0x89, 0x6f, 0xf3, 0xdf, 0x30, + 0x40, 0xea, 0x04, 0x40, 0x18, 0x44, 0x50, 0x61, 0x3c, 0x48, 0x02, 0x68, + 0x22, 0xf4, 0x58, 0x72, 0x02, 0xf5, 0x18, 0x72, 0x02, 0x60, 0x40, 0x4a, + 0x04, 0xbf, 0x00, 0x22, 0xc0, 0xf2, 0x01, 0x42, 0x04, 0xbf, 0x4f, 0xf6, + 0xff, 0x71, 0xcf, 0xf6, 0xfc, 0x31, 0x83, 0x68, 0x19, 0x40, 0x11, 0x43, + 0x81, 0x60, 0xf0, 0xbd, 0x34, 0x48, 0x01, 0x68, 0x40, 0xf2, 0xf3, 0x32, + 0x39, 0x4c, 0x91, 0x43, 0x32, 0x4a, 0x03, 0x31, 0x01, 0x60, 0x36, 0x48, + 0x03, 0x21, 0x01, 0x60, 0xdf, 0x48, 0xd0, 0xf8, 0xec, 0x13, 0x0a, 0x40, + 0xd5, 0x49, 0xd1, 0xf8, 0x04, 0x31, 0x23, 0x40, 0x1a, 0x44, 0xc0, 0xf8, + 0xec, 0x23, 0xd9, 0x4a, 0x13, 0x6b, 0xd1, 0xf8, 0x08, 0x41, 0x5b, 0x08, + 0x63, 0xf3, 0x5f, 0x04, 0x28, 0x4b, 0x14, 0x63, 0x14, 0x68, 0xd1, 0xf8, + 0x0c, 0x61, 0x04, 0xea, 0x03, 0x05, 0x2a, 0x4c, 0x26, 0x40, 0x35, 0x44, + 0x15, 0x60, 0x55, 0x68, 0xd1, 0xf8, 0x10, 0x61, 0x1d, 0x40, 0x26, 0x40, + 0x35, 0x44, 0x55, 0x60, 0xd5, 0x68, 0xd1, 0xf8, 0x14, 0x61, 0x1d, 0x40, + 0x26, 0x40, 0x35, 0x44, 0xd5, 0x60, 0x15, 0x69, 0xd1, 0xf8, 0x18, 0x61, + 0x1d, 0x40, 0x26, 0x40, 0x35, 0x44, 0x15, 0x61, 0x55, 0x69, 0x2b, 0x40, + 0xd1, 0xf8, 0x1c, 0x51, 0x2c, 0x40, 0x23, 0x44, 0x53, 0x61, 0x0f, 0x4a, + 0x13, 0x68, 0xd1, 0xf8, 0xfc, 0x40, 0x23, 0xf4, 0x58, 0x73, 0x04, 0xf4, + 0x58, 0x74, 0x23, 0x44, 0x13, 0x60, 0x02, 0x68, 0xd1, 0xf8, 0x00, 0x31, + 0x1b, 0x0a, 0x63, 0xf3, 0x08, 0x22, 0x02, 0x60, 0x42, 0x68, 0xd1, 0xf8, + 0x30, 0x11, 0x22, 0xf0, 0xee, 0x02, 0x01, 0xf0, 0xee, 0x01, 0x11, 0x44, + 0x41, 0x60, 0x0e, 0x48, 0x00, 0x21, 0x01, 0x60, 0xf0, 0xbd, 0x00, 0xbf, + 0x00, 0xc0, 0x03, 0x40, 0x14, 0xc4, 0x03, 0x40, 0x28, 0xf9, 0x03, 0x40, + 0x28, 0xf5, 0x03, 0x40, 0xfa, 0xe0, 0xff, 0xfe, 0x18, 0xc8, 0x03, 0x40, + 0x00, 0x80, 0x00, 0xff, 0x00, 0x00, 0x01, 0x0c, 0xff, 0xff, 0xfc, 0xf3, + 0x94, 0x1f, 0x06, 0x00, 0x05, 0x1f, 0x00, 0x01, 0xff, 0x7f, 0xff, 0x00, + 0x08, 0xc0, 0x03, 0x40, 0xb0, 0xb5, 0x0d, 0x46, 0x04, 0x46, 0x02, 0xf0, + 0xe3, 0xfe, 0x0b, 0x48, 0x2d, 0xb1, 0x41, 0x68, 0x01, 0x22, 0x62, 0xf3, + 0x01, 0x01, 0x41, 0x60, 0x05, 0xe0, 0x08, 0x49, 0x01, 0x23, 0x0a, 0x68, + 0x63, 0xf3, 0x01, 0x02, 0x0a, 0x60, 0x04, 0xb1, 0xb0, 0xbd, 0x00, 0x21, + 0xc0, 0xf8, 0x14, 0x12, 0x41, 0x60, 0x01, 0x60, 0xb0, 0xbd, 0x00, 0xbf, + 0x20, 0xec, 0x05, 0x30, 0x24, 0xd4, 0x05, 0x30, 0xb0, 0xb5, 0x29, 0x48, + 0x00, 0x22, 0x00, 0x23, 0x0c, 0x46, 0x05, 0x68, 0x00, 0x20, 0xa8, 0x47, + 0x26, 0x48, 0x21, 0x46, 0x02, 0x68, 0x00, 0x20, 0x90, 0x47, 0x25, 0x48, + 0x21, 0x46, 0x02, 0x68, 0x00, 0x20, 0x90, 0x47, 0x00, 0x20, 0x21, 0x46, + 0x00, 0x22, 0xff, 0xf7, 0xdf, 0xfd, 0x21, 0x48, 0x21, 0x46, 0x02, 0x68, + 0x00, 0x20, 0x90, 0x47, 0x1f, 0x48, 0x21, 0x46, 0x02, 0x68, 0x00, 0x20, + 0x90, 0x47, 0x1e, 0x48, 0x21, 0x46, 0x00, 0x22, 0x03, 0x68, 0x00, 0x20, + 0x98, 0x47, 0x2c, 0xb1, 0xe3, 0x48, 0x7a, 0x4a, 0x01, 0x68, 0xd2, 0xf8, + 0x24, 0x21, 0x04, 0xe0, 0xe2, 0x48, 0x77, 0x4a, 0x01, 0x68, 0xd2, 0xf8, + 0x20, 0x21, 0xd2, 0x08, 0x62, 0xf3, 0xc5, 0x01, 0x01, 0x60, 0x73, 0x48, + 0x75, 0x49, 0xd0, 0xf8, 0x34, 0x01, 0x08, 0x60, 0x20, 0x46, 0xff, 0xf7, + 0x67, 0xfe, 0x10, 0x48, 0x00, 0x78, 0xff, 0x28, 0x01, 0xd0, 0x04, 0x28, + 0x0c, 0xd1, 0x0e, 0x4c, 0x21, 0x68, 0x49, 0xb1, 0x0d, 0x48, 0xdc, 0x22, + 0x03, 0x68, 0x04, 0x20, 0x98, 0x47, 0x20, 0x68, 0xcf, 0xf7, 0xe0, 0xfb, + 0x00, 0x20, 0x20, 0x60, 0xb0, 0xbd, 0x00, 0xbf, 0xd8, 0xfc, 0x08, 0x00, + 0xec, 0xfc, 0x08, 0x00, 0xd4, 0xfc, 0x08, 0x00, 0xe4, 0xfc, 0x08, 0x00, + 0xf0, 0xfc, 0x08, 0x00, 0xe8, 0xfc, 0x08, 0x00, 0x64, 0x8d, 0x08, 0x00, + 0x20, 0xe7, 0x01, 0x00, 0xe4, 0x9b, 0x08, 0x00, 0x2d, 0xe9, 0xfe, 0x4f, + 0x31, 0x4c, 0xcd, 0xe9, 0x01, 0x12, 0x06, 0x46, 0x00, 0x20, 0x9b, 0x46, + 0x00, 0x25, 0x21, 0x68, 0x88, 0x47, 0x21, 0x68, 0x01, 0x20, 0x88, 0x47, + 0x2c, 0x48, 0x2d, 0x4c, 0xdf, 0xf8, 0xb4, 0x90, 0x6f, 0xf0, 0x01, 0x08, + 0x00, 0xf5, 0x2b, 0x77, 0x2b, 0x48, 0x00, 0xf1, 0x01, 0x0a, 0x64, 0x2d, + 0x24, 0xd0, 0xb9, 0xf8, 0x00, 0x00, 0x00, 0xeb, 0x80, 0x00, 0x08, 0xeb, + 0x40, 0x00, 0xd0, 0x47, 0x38, 0x78, 0xc0, 0x07, 0x1c, 0xd1, 0x20, 0x68, + 0x01, 0x35, 0x80, 0x05, 0xef, 0xd5, 0x23, 0x4f, 0xbb, 0xf1, 0x00, 0x0f, + 0x1d, 0xd0, 0x22, 0x48, 0x22, 0x49, 0x00, 0x68, 0x38, 0x40, 0x30, 0x60, + 0x07, 0xf5, 0x80, 0x00, 0x09, 0x68, 0x01, 0x9c, 0x08, 0x40, 0x1f, 0x49, + 0x20, 0x60, 0x0a, 0x68, 0x17, 0x21, 0x90, 0x47, 0x20, 0x60, 0x1d, 0x48, + 0x00, 0x68, 0x19, 0xe0, 0x01, 0x24, 0x1b, 0xe0, 0x78, 0x78, 0xb9, 0x78, + 0xfa, 0x78, 0x30, 0x60, 0x02, 0x98, 0x01, 0x60, 0x01, 0x98, 0x02, 0x60, + 0x11, 0xe0, 0xe0, 0x68, 0x38, 0x40, 0x30, 0x60, 0x07, 0xf5, 0x80, 0x00, + 0x61, 0x69, 0x01, 0x9d, 0x08, 0x40, 0x11, 0x49, 0x28, 0x60, 0x0a, 0x68, + 0x17, 0x21, 0x90, 0x47, 0x28, 0x60, 0x20, 0x69, 0x02, 0x99, 0x38, 0x40, + 0x08, 0x60, 0x00, 0x24, 0x03, 0x48, 0x01, 0x68, 0x00, 0x20, 0x88, 0x47, + 0x20, 0x46, 0xbd, 0xe8, 0xfe, 0x8f, 0x00, 0xbf, 0x0c, 0xfe, 0x08, 0x00, + 0x00, 0x69, 0x08, 0x00, 0x18, 0xc4, 0x23, 0x40, 0x34, 0xec, 0x01, 0x00, + 0x40, 0xec, 0x01, 0x00, 0xff, 0xff, 0x3f, 0x00, 0x04, 0xcc, 0x23, 0x40, + 0x0c, 0xcc, 0x23, 0x40, 0x10, 0xfe, 0x08, 0x00, 0x08, 0xcc, 0x23, 0x40, + 0x2d, 0xe9, 0xf0, 0x4f, 0x1d, 0x48, 0x20, 0x4b, 0x24, 0x4d, 0x87, 0x4a, + 0x21, 0x4f, 0x84, 0x4c, 0x1c, 0x49, 0x1f, 0x4e, 0x43, 0x64, 0x20, 0x4b, + 0xab, 0x46, 0x01, 0xf5, 0xa0, 0x4e, 0x01, 0xf1, 0x08, 0x08, 0x03, 0xf1, + 0x14, 0x09, 0x03, 0xf1, 0x10, 0x0a, 0x03, 0xf1, 0x0c, 0x05, 0x03, 0xf1, + 0x30, 0x0c, 0xc0, 0xe9, 0x09, 0x5a, 0xc0, 0xe9, 0x0b, 0x92, 0x14, 0x4a, + 0xc0, 0xe9, 0x0d, 0x47, 0x04, 0x1d, 0xc6, 0x63, 0x02, 0x64, 0x84, 0xe8, + 0x02, 0x41, 0x0d, 0x4c, 0x1a, 0x1d, 0xc0, 0xf8, 0x10, 0xb0, 0xc0, 0xe9, + 0x05, 0x4c, 0xc0, 0xe9, 0x07, 0x32, 0x11, 0x22, 0x02, 0x70, 0x09, 0x68, + 0x40, 0xf8, 0xf4, 0x1f, 0x01, 0x21, 0x04, 0x30, 0x50, 0xf8, 0xf0, 0x2c, + 0x01, 0x31, 0x11, 0x29, 0x12, 0x68, 0x04, 0xc0, 0xf8, 0xd1, 0xbd, 0xe8, + 0xf0, 0x8f, 0x00, 0xbf, 0x28, 0xe5, 0x01, 0x00, 0x00, 0xc8, 0x03, 0x40, + 0x00, 0x70, 0x03, 0x40, 0x98, 0xc0, 0x05, 0x30, 0x18, 0xc4, 0x03, 0x40, + 0x28, 0xee, 0x05, 0x30, 0x28, 0xd6, 0x05, 0x30, 0x18, 0xc8, 0x03, 0x40, + 0x14, 0xc4, 0x03, 0x40, 0x2d, 0xe9, 0xfc, 0x47, 0x1d, 0x46, 0x83, 0x1a, + 0x89, 0x46, 0x17, 0x18, 0x03, 0xf0, 0x00, 0x41, 0x3e, 0x46, 0x41, 0xea, + 0x53, 0x01, 0x4f, 0xea, 0xc3, 0x73, 0x08, 0xbf, 0x01, 0x26, 0x32, 0x46, + 0x18, 0x46, 0x00, 0x23, 0x02, 0xf0, 0x8a, 0xfd, 0xdf, 0xf8, 0x3c, 0x80, + 0x4f, 0xf0, 0x20, 0x0a, 0x1f, 0x22, 0x1f, 0x23, 0xcd, 0xf8, 0x00, 0xa0, + 0xd8, 0xf8, 0x00, 0x40, 0xa0, 0x47, 0x28, 0x60, 0x00, 0x20, 0x49, 0x46, + 0x32, 0x46, 0x00, 0x23, 0x02, 0xf0, 0x78, 0xfd, 0xd8, 0xf8, 0x00, 0x40, + 0x20, 0x22, 0x20, 0x23, 0xcd, 0xf8, 0x00, 0xa0, 0xa0, 0x47, 0x0a, 0x99, + 0x08, 0x60, 0xb7, 0xfa, 0x87, 0xf0, 0x40, 0x09, 0xbd, 0xe8, 0xfc, 0x87, + 0x94, 0xfb, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0xa1, 0xb0, 0x4f, 0xf4, + 0x80, 0x70, 0x00, 0x21, 0xad, 0xf8, 0x76, 0x00, 0x4f, 0xf4, 0x00, 0x40, + 0x8d, 0xf8, 0x75, 0x10, 0xad, 0xf8, 0x70, 0x10, 0xad, 0xf8, 0x72, 0x00, + 0xdf, 0xf8, 0xfc, 0x05, 0xb0, 0xf8, 0x56, 0x12, 0xd0, 0xf8, 0x78, 0x82, + 0x0d, 0x91, 0xd0, 0xf8, 0x34, 0x12, 0x0a, 0x03, 0x58, 0xbf, 0x5f, 0xea, + 0xc1, 0x21, 0x40, 0xf1, 0xec, 0x82, 0x00, 0xf5, 0x0d, 0x70, 0x0e, 0x90, + 0xdf, 0xf8, 0xdc, 0x05, 0x00, 0x68, 0x80, 0x47, 0x0d, 0x98, 0xdf, 0xf8, + 0xd8, 0x35, 0xdf, 0xf8, 0xe4, 0x55, 0xdf, 0xf8, 0x18, 0x66, 0x4f, 0xf4, + 0x80, 0x72, 0x4f, 0xf0, 0x04, 0x0a, 0x00, 0x24, 0x00, 0x27, 0x40, 0x42, + 0x0c, 0x90, 0x13, 0xa8, 0x00, 0xf1, 0x0c, 0x01, 0x08, 0x91, 0x00, 0xf1, + 0x08, 0x01, 0x04, 0x30, 0x09, 0x90, 0xdf, 0xf8, 0xdc, 0x05, 0x07, 0x91, + 0x01, 0x30, 0x0a, 0x90, 0x00, 0x20, 0x05, 0x90, 0x0e, 0x98, 0x00, 0x68, + 0x01, 0x03, 0x02, 0xd4, 0x00, 0x2c, 0x00, 0xf0, 0xb4, 0x82, 0xc0, 0x02, + 0x02, 0xd4, 0x01, 0x2c, 0x00, 0xf0, 0xbc, 0x82, 0x04, 0xeb, 0x44, 0x00, + 0x13, 0xf8, 0x10, 0x10, 0x21, 0xb1, 0x03, 0xeb, 0x40, 0x00, 0x82, 0x88, + 0xc0, 0x78, 0x05, 0x90, 0x4f, 0xf0, 0x00, 0x09, 0x03, 0x92, 0x04, 0x94, + 0xdf, 0xf8, 0x6c, 0x05, 0xcd, 0xf8, 0x2c, 0x90, 0x00, 0x78, 0xff, 0x28, + 0x01, 0xd0, 0x04, 0x28, 0x1e, 0xd1, 0xdf, 0xf8, 0x60, 0x05, 0x00, 0x68, + 0x50, 0xb9, 0xdf, 0xf8, 0x5c, 0x05, 0x01, 0x68, 0xdc, 0x20, 0x88, 0x47, + 0xdf, 0xf8, 0x4c, 0x15, 0xdd, 0xf8, 0x2c, 0x90, 0x08, 0x60, 0x78, 0xb1, + 0xdc, 0x21, 0xcc, 0xf7, 0x2b, 0xfa, 0xdf, 0xf8, 0x3c, 0x15, 0xdd, 0xf8, + 0x2c, 0x90, 0x09, 0x68, 0x4f, 0xea, 0x19, 0x20, 0xc8, 0x70, 0x20, 0x0a, + 0x81, 0xf8, 0x02, 0x90, 0x0c, 0x70, 0x48, 0x70, 0x24, 0xb1, 0x01, 0x49, + 0x06, 0xe0, 0x00, 0xbf, 0x0c, 0xee, 0x05, 0x30, 0x00, 0x49, 0x01, 0xe0, + 0x0c, 0xd6, 0x05, 0x30, 0x08, 0x68, 0x5f, 0xfa, 0x84, 0xfb, 0x6a, 0xf3, + 0xc5, 0x00, 0x08, 0x60, 0x58, 0x46, 0x2a, 0x68, 0x5f, 0xfa, 0x89, 0xf5, + 0x29, 0x46, 0x90, 0x47, 0xdf, 0xf8, 0x00, 0x05, 0x59, 0x46, 0x02, 0x68, + 0x01, 0x20, 0x90, 0x47, 0x01, 0x20, 0x59, 0x46, 0x2a, 0x46, 0xff, 0xf7, + 0xe9, 0xfb, 0xdf, 0xf8, 0xf0, 0x04, 0x59, 0x46, 0x02, 0x68, 0x01, 0x20, + 0x90, 0x47, 0xdf, 0xf8, 0xe8, 0x04, 0x59, 0x46, 0x2a, 0x46, 0x03, 0x68, + 0x01, 0x20, 0x98, 0x47, 0xdf, 0xf8, 0xdc, 0x04, 0x00, 0x68, 0x80, 0x47, + 0x00, 0x28, 0x40, 0xf0, 0x49, 0x82, 0x1f, 0xfa, 0x89, 0xf0, 0xb2, 0x46, + 0x0e, 0x9e, 0x00, 0x23, 0x00, 0x25, 0x01, 0x28, 0xdf, 0xf8, 0xc8, 0x04, + 0x31, 0x6c, 0x08, 0xbf, 0x88, 0x46, 0x42, 0x46, 0x04, 0x68, 0x01, 0x20, + 0x59, 0x46, 0xa0, 0x47, 0x70, 0x8b, 0x20, 0xb1, 0xdf, 0xf8, 0xb4, 0x14, + 0x09, 0x88, 0x48, 0x43, 0x85, 0x1e, 0x0a, 0x99, 0x28, 0x46, 0x88, 0x47, + 0xdf, 0xf8, 0xac, 0x04, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0xdf, 0xf8, + 0xa8, 0x04, 0x1f, 0xa9, 0x1e, 0xaa, 0x5b, 0x46, 0x04, 0x68, 0x20, 0xa8, + 0xa0, 0x47, 0x00, 0x28, 0x40, 0xf0, 0x1e, 0x82, 0x09, 0x9b, 0xdd, 0xe9, + 0x1e, 0x21, 0x20, 0x98, 0x56, 0x46, 0x00, 0x93, 0x13, 0xab, 0xff, 0xf7, + 0xdb, 0xfe, 0x00, 0x28, 0x40, 0xf0, 0x12, 0x82, 0xdf, 0xf8, 0x44, 0x04, + 0x00, 0x78, 0xff, 0x28, 0x01, 0xd0, 0x04, 0x28, 0x3a, 0xd1, 0xdf, 0xf8, + 0x3c, 0x04, 0x00, 0x68, 0xb0, 0xb3, 0xdd, 0xe9, 0x13, 0x21, 0x20, 0x9b, + 0x1e, 0x9c, 0x1f, 0x9d, 0x00, 0xf8, 0x20, 0x1f, 0x1e, 0x0e, 0x00, 0xf8, + 0x1c, 0x3d, 0x00, 0xf8, 0x08, 0x4f, 0x00, 0xf8, 0x04, 0x5d, 0x00, 0xf8, + 0x14, 0x2f, 0x00, 0xf8, 0x15, 0x6c, 0x1e, 0x0c, 0x1b, 0x0a, 0x00, 0xf8, + 0x17, 0x3c, 0x23, 0x0e, 0x00, 0xf8, 0x16, 0x6c, 0x56, 0x46, 0x00, 0xf8, + 0x0d, 0x3c, 0x23, 0x0c, 0x00, 0xf8, 0x0e, 0x3c, 0x23, 0x0a, 0x00, 0xf8, + 0x0f, 0x3c, 0x2b, 0x0e, 0x00, 0xf8, 0x11, 0x3c, 0x2b, 0x0c, 0x00, 0xf8, + 0x12, 0x3c, 0x2b, 0x0a, 0x00, 0xf8, 0x13, 0x3c, 0x13, 0x0e, 0xc3, 0x70, + 0x13, 0x0c, 0x12, 0x0a, 0x42, 0x70, 0x0a, 0x0e, 0x83, 0x70, 0xc2, 0x71, + 0x0a, 0x0c, 0x09, 0x0a, 0x82, 0x71, 0x41, 0x71, 0xdf, 0xf8, 0xf8, 0x03, + 0x59, 0x46, 0x02, 0x68, 0x01, 0x20, 0x90, 0x47, 0xdf, 0xf8, 0xe8, 0x03, + 0x1f, 0xa9, 0x1e, 0xaa, 0x5b, 0x46, 0x04, 0x68, 0x20, 0xa8, 0xa0, 0x47, + 0x00, 0x28, 0x40, 0xf0, 0xbf, 0x81, 0xdf, 0xf8, 0xd0, 0x03, 0x01, 0x68, + 0x00, 0x20, 0x88, 0x47, 0x08, 0x9b, 0xdd, 0xe9, 0x1e, 0x21, 0x20, 0x98, + 0x00, 0x93, 0x07, 0x9b, 0xff, 0xf7, 0x78, 0xfe, 0x00, 0x28, 0x40, 0xf0, + 0xaf, 0x81, 0xe0, 0x48, 0xcd, 0xf8, 0x18, 0x80, 0x00, 0x78, 0xff, 0x28, + 0x01, 0xd0, 0x04, 0x28, 0x33, 0xd1, 0xdd, 0x48, 0x00, 0x68, 0x80, 0xb3, + 0xdd, 0xe9, 0x15, 0x21, 0x20, 0x9b, 0x1e, 0x9c, 0x1f, 0x9d, 0x00, 0xf8, + 0x28, 0x1f, 0x1e, 0x0e, 0x00, 0xf8, 0x04, 0x2d, 0x00, 0xf8, 0x14, 0x3d, + 0x00, 0xf8, 0x08, 0x4f, 0x00, 0xf8, 0x04, 0x5d, 0x00, 0xf8, 0x01, 0x6c, + 0x1e, 0x0c, 0x1b, 0x0a, 0x00, 0xf8, 0x03, 0x3c, 0x23, 0x0e, 0x00, 0xf8, + 0x02, 0x6c, 0x56, 0x46, 0xc3, 0x71, 0x23, 0x0c, 0x83, 0x71, 0x23, 0x0a, + 0x43, 0x71, 0x2b, 0x0e, 0xc3, 0x70, 0x2b, 0x0c, 0x83, 0x70, 0x2b, 0x0a, + 0x43, 0x70, 0x13, 0x0e, 0xc3, 0x74, 0x13, 0x0c, 0x12, 0x0a, 0x42, 0x74, + 0x0a, 0x0e, 0x83, 0x74, 0xc2, 0x75, 0x0a, 0x0c, 0x09, 0x0a, 0x82, 0x75, + 0x41, 0x75, 0xc6, 0x48, 0x59, 0x46, 0x02, 0x68, 0x02, 0x20, 0x90, 0x47, + 0xc4, 0x48, 0x59, 0x46, 0x02, 0x68, 0x02, 0x20, 0x90, 0x47, 0xcc, 0x48, + 0x59, 0x46, 0x02, 0x68, 0x02, 0x20, 0x90, 0x47, 0x0e, 0x98, 0x90, 0xf8, + 0x62, 0x00, 0x00, 0x28, 0x00, 0xf0, 0xfe, 0x80, 0x4f, 0xf0, 0x00, 0x09, + 0xc6, 0x48, 0x9d, 0xf9, 0x75, 0x10, 0x00, 0x22, 0x5b, 0x46, 0x04, 0x68, + 0xbd, 0xf8, 0x76, 0x00, 0xa0, 0x47, 0xc0, 0x48, 0x59, 0x46, 0x02, 0x68, + 0x00, 0x20, 0x90, 0x47, 0x0d, 0x98, 0x34, 0x68, 0x0d, 0xf1, 0x6a, 0x01, + 0x1a, 0xaa, 0x5b, 0x46, 0x05, 0xb2, 0x28, 0x46, 0xa0, 0x47, 0x00, 0x28, + 0x40, 0xf0, 0x42, 0x81, 0xbd, 0xf8, 0x6a, 0x00, 0x0d, 0xf1, 0x66, 0x01, + 0x19, 0xaa, 0x5b, 0x46, 0x40, 0xf3, 0x0c, 0x00, 0xad, 0xf8, 0x6a, 0x00, + 0xbd, 0xf8, 0x68, 0x00, 0x40, 0xf3, 0x0c, 0x00, 0x34, 0x68, 0xad, 0xf8, + 0x68, 0x00, 0x0c, 0x98, 0x0f, 0xfa, 0x80, 0xf8, 0x40, 0x46, 0xa0, 0x47, + 0x00, 0x28, 0x40, 0xf0, 0x29, 0x81, 0xbd, 0xf8, 0x66, 0x10, 0x41, 0xf3, + 0x0c, 0x00, 0xbd, 0xf8, 0x64, 0x40, 0xc9, 0x04, 0xad, 0xf8, 0x66, 0x00, + 0x44, 0xf3, 0x0c, 0x03, 0xe6, 0x04, 0xbd, 0xf8, 0x68, 0x40, 0xbd, 0xf8, + 0x6a, 0x20, 0xad, 0xf8, 0x64, 0x30, 0xa4, 0xeb, 0xe6, 0x47, 0x93, 0x4e, + 0xa2, 0xeb, 0xe1, 0x41, 0xad, 0xf8, 0x5c, 0x10, 0xad, 0xf8, 0x5e, 0x70, + 0x36, 0x78, 0xff, 0x2e, 0x01, 0xd0, 0x04, 0x2e, 0x20, 0xd1, 0x8e, 0x4e, + 0x36, 0x68, 0xee, 0xb1, 0x86, 0xf8, 0x34, 0x30, 0x86, 0xf8, 0x2e, 0x20, + 0x1b, 0x0a, 0x12, 0x0a, 0x86, 0xf8, 0x3e, 0x10, 0x86, 0xf8, 0x32, 0x00, + 0x09, 0x0a, 0x00, 0x0a, 0x86, 0xf8, 0x30, 0x40, 0x86, 0xf8, 0x40, 0x70, + 0x86, 0xf8, 0x35, 0x30, 0x23, 0x0a, 0x86, 0xf8, 0x2f, 0x20, 0x3a, 0x0a, + 0x86, 0xf8, 0x3f, 0x10, 0x86, 0xf8, 0x33, 0x00, 0x86, 0xf8, 0x31, 0x30, + 0x86, 0xf8, 0x41, 0x20, 0x8a, 0x48, 0x59, 0x46, 0x02, 0x68, 0x01, 0x20, + 0x90, 0x47, 0xda, 0xf8, 0x00, 0x40, 0x28, 0x46, 0x0d, 0xf1, 0x6a, 0x01, + 0x1a, 0xaa, 0x5b, 0x46, 0x56, 0x46, 0xa0, 0x47, 0x00, 0x28, 0x40, 0xf0, + 0xd7, 0x80, 0xbd, 0xf8, 0x6a, 0x00, 0x0d, 0xf1, 0x66, 0x01, 0x19, 0xaa, + 0x5b, 0x46, 0x40, 0xf3, 0x0c, 0x00, 0xad, 0xf8, 0x6a, 0x00, 0xbd, 0xf8, + 0x68, 0x00, 0x40, 0xf3, 0x0c, 0x00, 0x34, 0x68, 0xad, 0xf8, 0x68, 0x00, + 0x40, 0x46, 0xa0, 0x47, 0x00, 0x28, 0x40, 0xf0, 0xc1, 0x80, 0xbd, 0xf8, + 0x66, 0x10, 0x68, 0x4e, 0x41, 0xf3, 0x0c, 0x00, 0xbd, 0xf8, 0x64, 0x40, + 0xc9, 0x04, 0xad, 0xf8, 0x66, 0x00, 0x44, 0xf3, 0x0c, 0x03, 0xbd, 0xf8, + 0x6a, 0x20, 0xe5, 0x04, 0xbd, 0xf8, 0x68, 0x40, 0x36, 0x78, 0xad, 0xf8, + 0x64, 0x30, 0xa2, 0xeb, 0xe1, 0x41, 0xa4, 0xeb, 0xe5, 0x45, 0xff, 0x2e, + 0xad, 0xf8, 0x60, 0x10, 0xad, 0xf8, 0x62, 0x50, 0x01, 0xd0, 0x04, 0x2e, + 0x20, 0xd1, 0x5a, 0x4e, 0x36, 0x68, 0xee, 0xb1, 0x86, 0xf8, 0x3c, 0x30, + 0x86, 0xf8, 0x36, 0x20, 0x1b, 0x0a, 0x12, 0x0a, 0x86, 0xf8, 0x42, 0x10, + 0x86, 0xf8, 0x3a, 0x00, 0x09, 0x0a, 0x00, 0x0a, 0x86, 0xf8, 0x38, 0x40, + 0x86, 0xf8, 0x44, 0x50, 0x86, 0xf8, 0x3d, 0x30, 0x23, 0x0a, 0x86, 0xf8, + 0x37, 0x20, 0x2a, 0x0a, 0x86, 0xf8, 0x43, 0x10, 0x86, 0xf8, 0x3b, 0x00, + 0x86, 0xf8, 0x39, 0x30, 0x86, 0xf8, 0x45, 0x20, 0x00, 0x20, 0x0f, 0xa9, + 0xcd, 0xe9, 0x11, 0x00, 0xcd, 0xe9, 0x0f, 0x00, 0x57, 0x48, 0x02, 0x68, + 0x13, 0xa8, 0x90, 0x47, 0x00, 0x28, 0x73, 0xd1, 0x55, 0x48, 0x11, 0x99, + 0x0d, 0xf1, 0x76, 0x02, 0x0d, 0xf1, 0x75, 0x03, 0x04, 0x68, 0x0f, 0x98, + 0xa0, 0x47, 0x00, 0x28, 0x68, 0xd1, 0x0e, 0x98, 0x09, 0xf1, 0x01, 0x09, + 0x56, 0x46, 0x90, 0xf8, 0x62, 0x00, 0x81, 0x45, 0xff, 0xf4, 0x04, 0xaf, + 0x0b, 0x98, 0x00, 0x04, 0x15, 0xd0, 0x47, 0x48, 0x9d, 0xf9, 0x75, 0x10, + 0x00, 0x22, 0x5b, 0x46, 0x00, 0x27, 0x04, 0x68, 0xbd, 0xf8, 0x76, 0x00, + 0xa0, 0x47, 0x3a, 0x48, 0x59, 0x46, 0x02, 0x68, 0x01, 0x20, 0x90, 0x47, + 0xdd, 0xf8, 0x2c, 0x90, 0xdd, 0xf8, 0x18, 0x80, 0x30, 0x4d, 0x04, 0x9c, + 0x36, 0xe0, 0x0e, 0x98, 0x90, 0xf8, 0x60, 0x00, 0x30, 0xb3, 0x3e, 0x48, + 0x12, 0x99, 0x0d, 0xf1, 0x72, 0x02, 0x1c, 0xab, 0x04, 0x68, 0x10, 0x98, + 0xa0, 0x47, 0xdd, 0xf8, 0x18, 0x80, 0x28, 0x4d, 0x04, 0x9c, 0x07, 0x46, + 0xe8, 0xb9, 0x38, 0x48, 0x05, 0x99, 0xbd, 0xf9, 0x70, 0x30, 0xbd, 0xf8, + 0x72, 0x20, 0x07, 0x68, 0x1b, 0xa8, 0x49, 0xb2, 0x00, 0x90, 0x0d, 0xf1, + 0x6f, 0x00, 0x01, 0x90, 0x03, 0x98, 0x80, 0xb2, 0xb8, 0x47, 0x31, 0x48, + 0x9d, 0xf9, 0x6f, 0x10, 0x5a, 0x46, 0x03, 0x68, 0xbd, 0xf8, 0x6c, 0x00, + 0x98, 0x47, 0x03, 0xe0, 0xdd, 0xf8, 0x18, 0x80, 0x18, 0x4d, 0x04, 0x9c, + 0x00, 0x27, 0x1c, 0x48, 0x59, 0x46, 0x02, 0x68, 0x00, 0x20, 0x90, 0x47, + 0xdd, 0xf8, 0x2c, 0x90, 0x4f, 0xf0, 0x04, 0x0a, 0x09, 0xf1, 0x01, 0x09, + 0x1f, 0xfa, 0x89, 0xf0, 0x02, 0x28, 0x7f, 0xf4, 0x61, 0xad, 0x03, 0x9a, + 0x0a, 0x4b, 0x01, 0x34, 0x02, 0x2c, 0x7f, 0xf4, 0x41, 0xad, 0x07, 0xe0, + 0x07, 0x46, 0x10, 0x48, 0x59, 0x46, 0x02, 0x68, 0x00, 0x20, 0x90, 0x47, + 0x00, 0xe0, 0x00, 0x27, 0xf8, 0xb2, 0x21, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0x00, 0x69, 0x08, 0x00, 0xcc, 0xfc, 0x08, 0x00, 0x90, 0xe4, 0x01, 0x00, + 0x64, 0x8d, 0x08, 0x00, 0x20, 0xe7, 0x01, 0x00, 0xd4, 0x9b, 0x08, 0x00, + 0x2c, 0xfe, 0x08, 0x00, 0xd4, 0xfc, 0x08, 0x00, 0xe4, 0xfc, 0x08, 0x00, + 0xe8, 0xfc, 0x08, 0x00, 0x84, 0x9a, 0x08, 0x00, 0x34, 0xfe, 0x08, 0x00, + 0xd8, 0xfc, 0x08, 0x00, 0x34, 0xec, 0x01, 0x00, 0x40, 0xec, 0x01, 0x00, + 0x08, 0xfe, 0x08, 0x00, 0x30, 0xfe, 0x08, 0x00, 0xec, 0xfc, 0x08, 0x00, + 0xf0, 0xfc, 0x08, 0x00, 0x3c, 0xfe, 0x08, 0x00, 0x40, 0xfe, 0x08, 0x00, + 0x44, 0xfe, 0x08, 0x00, 0x48, 0xfe, 0x08, 0x00, 0xf4, 0xfc, 0x08, 0x00, + 0xf8, 0xfc, 0x08, 0x00, 0x28, 0xfe, 0x08, 0x00, 0xf0, 0xb5, 0xc0, 0x48, + 0x90, 0xf8, 0xd7, 0x1d, 0x01, 0x29, 0x3c, 0xd1, 0x41, 0xf2, 0xca, 0x0c, + 0x10, 0xf8, 0x0c, 0x20, 0xba, 0xb3, 0x1c, 0x4b, 0x1c, 0x4c, 0x00, 0x22, + 0x04, 0xeb, 0x82, 0x05, 0x1e, 0x68, 0x2d, 0x6a, 0x56, 0xf8, 0x22, 0x70, + 0x69, 0x08, 0x61, 0xf3, 0x41, 0x07, 0x46, 0xf8, 0x22, 0x70, 0xaf, 0x08, + 0x19, 0x68, 0x51, 0xf8, 0x22, 0x60, 0x67, 0xf3, 0x82, 0x06, 0x2f, 0x09, + 0x41, 0xf8, 0x22, 0x60, 0x19, 0x68, 0x51, 0xf8, 0x22, 0x60, 0x67, 0xf3, + 0x07, 0x16, 0x2f, 0x0c, 0x41, 0xf8, 0x22, 0x60, 0x2e, 0x0a, 0xad, 0x0f, + 0x19, 0x68, 0x01, 0xeb, 0x82, 0x01, 0x4e, 0x70, 0x19, 0x68, 0x51, 0xf8, + 0x22, 0x60, 0x67, 0xf3, 0x1d, 0x46, 0x41, 0xf8, 0x22, 0x60, 0x19, 0x68, + 0x51, 0xf8, 0x22, 0x60, 0x65, 0xf3, 0x9f, 0x76, 0x41, 0xf8, 0x22, 0x60, + 0x01, 0x32, 0x10, 0xf8, 0x0c, 0x10, 0x8a, 0x42, 0xca, 0xd3, 0xf0, 0xbd, + 0x24, 0xe5, 0x01, 0x00, 0xfc, 0x2d, 0x06, 0x00, 0x70, 0xb5, 0x28, 0x49, + 0x0b, 0x68, 0x03, 0xeb, 0x80, 0x04, 0x33, 0xf8, 0x20, 0x20, 0x65, 0x88, + 0x42, 0xea, 0x05, 0x45, 0x24, 0x4a, 0x02, 0xeb, 0x80, 0x02, 0x52, 0x68, + 0x62, 0xf3, 0x00, 0x05, 0x23, 0xf8, 0x20, 0x50, 0x2b, 0x0c, 0x63, 0x80, + 0x0b, 0x68, 0x03, 0xeb, 0x80, 0x05, 0x33, 0xf8, 0x20, 0x40, 0x6e, 0x88, + 0x44, 0xea, 0x06, 0x44, 0x16, 0x09, 0x66, 0xf3, 0x06, 0x14, 0x23, 0xf8, + 0x20, 0x40, 0x23, 0x0c, 0x6b, 0x80, 0x0b, 0x68, 0x03, 0xeb, 0x80, 0x05, + 0x33, 0xf8, 0x20, 0x40, 0x6e, 0x88, 0x44, 0xea, 0x06, 0x44, 0x16, 0x0a, + 0x66, 0xf3, 0x0d, 0x24, 0x23, 0xf8, 0x20, 0x40, 0x23, 0x0c, 0x6b, 0x80, + 0x0b, 0x68, 0x03, 0xeb, 0x80, 0x05, 0x33, 0xf8, 0x20, 0x40, 0x6e, 0x88, + 0x44, 0xea, 0x06, 0x44, 0x16, 0x0c, 0x12, 0x0e, 0x66, 0xf3, 0x15, 0x44, + 0x23, 0xf8, 0x20, 0x40, 0x23, 0x0c, 0x6b, 0x80, 0x09, 0x68, 0x01, 0xeb, + 0x80, 0x04, 0x31, 0xf8, 0x20, 0x30, 0x65, 0x88, 0x43, 0xea, 0x05, 0x43, + 0x62, 0xf3, 0x1d, 0x63, 0x21, 0xf8, 0x20, 0x30, 0x18, 0x0c, 0x60, 0x80, + 0x70, 0xbd, 0x00, 0xbf, 0x98, 0x1f, 0x06, 0x00, 0x9c, 0x2e, 0x06, 0x00, + 0x2d, 0xe9, 0xf8, 0x4f, 0xd4, 0x4e, 0x05, 0x46, 0x89, 0x46, 0x70, 0x78, + 0x00, 0x28, 0x00, 0xf0, 0x80, 0x80, 0xd2, 0x4f, 0xdf, 0xf8, 0xa8, 0xb1, + 0x4f, 0xf0, 0x00, 0x08, 0x0f, 0x24, 0x4f, 0xf0, 0x00, 0x0a, 0x4f, 0xfa, + 0x8a, 0xf0, 0xff, 0xf7, 0x95, 0xff, 0x38, 0x68, 0x30, 0xf8, 0x28, 0x10, + 0x00, 0xeb, 0x88, 0x00, 0x40, 0x88, 0x41, 0xea, 0x00, 0x42, 0xc2, 0xf3, + 0x05, 0x40, 0x6b, 0x68, 0x33, 0xf8, 0x20, 0x10, 0xc2, 0xf3, 0x05, 0x20, + 0xd2, 0x07, 0x33, 0xf8, 0x20, 0x00, 0x05, 0xd1, 0x5c, 0x4a, 0x00, 0xb2, + 0x09, 0xb2, 0x12, 0x68, 0x90, 0x47, 0x05, 0xe0, 0xdb, 0xf8, 0x00, 0x20, + 0x00, 0xb2, 0x09, 0xb2, 0x90, 0x47, 0x28, 0x80, 0x39, 0x68, 0x31, 0xf8, + 0x28, 0x20, 0x01, 0xeb, 0x88, 0x01, 0x49, 0x88, 0x42, 0xea, 0x01, 0x42, + 0xc2, 0xf3, 0x05, 0x61, 0xc2, 0xf3, 0x02, 0x12, 0xdf, 0xe8, 0x02, 0xf0, + 0x0c, 0x15, 0x04, 0x04, 0x1d, 0x25, 0x2d, 0x36, 0x0f, 0x29, 0x28, 0xbf, + 0x21, 0x46, 0x09, 0xeb, 0x41, 0x01, 0xa1, 0xf8, 0xe4, 0x00, 0x32, 0xe0, + 0x32, 0x78, 0x91, 0x42, 0x28, 0xbf, 0x51, 0x1e, 0x6a, 0x68, 0x89, 0xb2, + 0x22, 0xf8, 0x21, 0x00, 0x29, 0xe0, 0x00, 0x29, 0x18, 0xbf, 0x01, 0x21, + 0xd9, 0xf8, 0x00, 0x20, 0x22, 0xf8, 0x11, 0x00, 0x21, 0xe0, 0x0f, 0x29, + 0x28, 0xbf, 0x21, 0x46, 0x09, 0xeb, 0x41, 0x01, 0xa1, 0xf8, 0xa4, 0x00, + 0x19, 0xe0, 0x0f, 0x29, 0x28, 0xbf, 0x21, 0x46, 0x09, 0xeb, 0x41, 0x01, + 0xa1, 0xf8, 0xc4, 0x00, 0x11, 0xe0, 0x27, 0x29, 0x4f, 0xf0, 0x27, 0x02, + 0x28, 0xbf, 0x11, 0x46, 0x09, 0xeb, 0x41, 0x01, 0x88, 0x80, 0x08, 0xe0, + 0x27, 0x29, 0x4f, 0xf0, 0x27, 0x02, 0x28, 0xbf, 0x11, 0x46, 0x09, 0xeb, + 0x41, 0x01, 0xa1, 0xf8, 0x54, 0x00, 0x0a, 0xf1, 0x01, 0x0a, 0x70, 0x78, + 0x4f, 0xfa, 0x8a, 0xf8, 0x80, 0x45, 0xff, 0xf6, 0x88, 0xaf, 0xdf, 0xf8, + 0xb4, 0x80, 0x98, 0xf8, 0xd7, 0x0d, 0x01, 0x28, 0x27, 0xd1, 0x41, 0xf2, + 0x2c, 0x10, 0xdf, 0xf8, 0xa0, 0xa0, 0x09, 0xf1, 0xa4, 0x05, 0x00, 0x24, + 0x08, 0xeb, 0x00, 0x06, 0x85, 0x48, 0x00, 0xf1, 0xc0, 0x07, 0x36, 0xf9, + 0x20, 0x1c, 0xb5, 0xf9, 0x00, 0x00, 0xda, 0xf8, 0x00, 0xb0, 0xd8, 0x47, + 0xd9, 0xf8, 0x00, 0x10, 0xb1, 0xf9, 0x02, 0x10, 0xd8, 0x47, 0x27, 0xf8, + 0x20, 0x0c, 0xda, 0xf8, 0x00, 0x20, 0xb6, 0xf9, 0x00, 0x10, 0xb5, 0xf9, + 0x20, 0x00, 0x90, 0x47, 0x01, 0x34, 0x38, 0x80, 0x02, 0x36, 0x02, 0x37, + 0x02, 0x35, 0x10, 0x2c, 0xe3, 0xd1, 0x41, 0xf2, 0x9c, 0x10, 0x09, 0xf1, + 0x54, 0x07, 0xdf, 0xf8, 0x4c, 0x90, 0x00, 0x24, 0x08, 0xeb, 0x00, 0x05, + 0xdf, 0xf8, 0x48, 0x80, 0x08, 0xf1, 0x50, 0x06, 0x35, 0xf9, 0x50, 0x1c, + 0x37, 0xf9, 0x50, 0x0c, 0xd9, 0xf8, 0x00, 0x20, 0x90, 0x47, 0x26, 0xf8, + 0x50, 0x0c, 0xd9, 0xf8, 0x00, 0x20, 0xb5, 0xf9, 0x00, 0x10, 0xb7, 0xf9, + 0x00, 0x00, 0x90, 0x47, 0x01, 0x34, 0x30, 0x80, 0x02, 0x35, 0x02, 0x36, + 0x02, 0x37, 0x28, 0x2c, 0xe8, 0xd1, 0x01, 0x20, 0x88, 0xf8, 0x20, 0x01, + 0xbd, 0xe8, 0xf8, 0x8f, 0x6c, 0xfe, 0x08, 0x00, 0x70, 0xfe, 0x08, 0x00, + 0x00, 0x69, 0x08, 0x00, 0x90, 0xcf, 0x01, 0x00, 0x70, 0xb5, 0x17, 0x48, + 0x00, 0x78, 0xff, 0x28, 0x01, 0xd0, 0x0c, 0x28, 0x27, 0xd1, 0x5e, 0x48, + 0x00, 0x78, 0x86, 0x00, 0x4f, 0xf4, 0x91, 0x70, 0x50, 0xfa, 0x86, 0xf4, + 0x58, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0xd8, 0xb1, 0x05, 0x46, + 0x54, 0x48, 0xf6, 0xb2, 0x21, 0x46, 0x33, 0x46, 0x42, 0x68, 0x28, 0x46, + 0xc8, 0xf7, 0x76, 0xff, 0x4f, 0x4a, 0xa8, 0x19, 0x4f, 0xf4, 0x91, 0x71, + 0x4f, 0xf4, 0x91, 0x73, 0xc8, 0xf7, 0x6e, 0xff, 0x06, 0x48, 0x29, 0x46, + 0x22, 0x46, 0x03, 0x68, 0x0c, 0x20, 0x98, 0x47, 0x28, 0x46, 0xbd, 0xe8, + 0x70, 0x40, 0xce, 0xf7, 0xd1, 0xbd, 0x70, 0xbd, 0x64, 0x8d, 0x08, 0x00, + 0xe4, 0x9b, 0x08, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, 0x9d, 0x4f, 0xdf, 0xf8, + 0x08, 0xb1, 0x00, 0x24, 0x97, 0xf8, 0xd8, 0x02, 0x8b, 0xf8, 0x20, 0x41, + 0xc0, 0x07, 0x77, 0xd0, 0x41, 0xf2, 0xca, 0x00, 0x3e, 0x4e, 0x3d, 0x4d, + 0x38, 0x5c, 0x31, 0x68, 0xc5, 0xe9, 0x00, 0x44, 0x80, 0x00, 0x88, 0x47, + 0xdf, 0xf8, 0xec, 0xa0, 0x3b, 0x4c, 0x31, 0x68, 0xca, 0xf8, 0x00, 0x00, + 0x60, 0x78, 0x80, 0x00, 0x88, 0x47, 0xdf, 0xf8, 0xe4, 0x90, 0x31, 0x68, + 0xc9, 0xf8, 0x00, 0x00, 0x20, 0x78, 0x80, 0x00, 0x88, 0x47, 0x31, 0x68, + 0x68, 0x60, 0x04, 0x20, 0x88, 0x47, 0xdf, 0xf8, 0xd0, 0x80, 0x01, 0x46, + 0xc8, 0xf8, 0x00, 0x00, 0x68, 0x68, 0xd8, 0xb3, 0xda, 0xf8, 0x00, 0x20, + 0xc2, 0xb3, 0xd9, 0xf8, 0x00, 0x20, 0xaa, 0xb3, 0xa1, 0xb3, 0x21, 0x78, + 0x89, 0x00, 0xcb, 0xf7, 0x69, 0xfd, 0x41, 0xf2, 0xca, 0x06, 0xb8, 0x5d, + 0x81, 0x00, 0xda, 0xf8, 0x00, 0x00, 0xcb, 0xf7, 0x61, 0xfd, 0xff, 0xf7, + 0xff, 0xfd, 0x27, 0x48, 0x00, 0x68, 0x80, 0x47, 0x26, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x26, 0x48, 0x00, 0x68, 0x80, 0x47, 0x04, 0x46, 0xb8, 0xb9, + 0x24, 0x4b, 0xba, 0x5d, 0x69, 0x68, 0xda, 0xf8, 0x00, 0x00, 0x1b, 0x68, + 0x98, 0x47, 0x04, 0x46, 0x01, 0x28, 0x03, 0xd1, 0x16, 0x48, 0x1b, 0x49, + 0xff, 0xf7, 0x84, 0xfe, 0x1e, 0x48, 0x14, 0x49, 0x9b, 0xf8, 0x20, 0x61, + 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0xb6, 0xfa, 0x86, 0xf0, 0x44, 0x09, + 0x1a, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0xe0, 0x01, 0x24, 0xff, 0xf7, + 0x5b, 0xff, 0xda, 0xf8, 0x00, 0x00, 0x08, 0xb1, 0xce, 0xf7, 0x56, 0xfd, + 0xd9, 0xf8, 0x00, 0x00, 0x08, 0xb1, 0xce, 0xf7, 0x51, 0xfd, 0x68, 0x68, + 0x08, 0xb1, 0xce, 0xf7, 0x4d, 0xfd, 0xd8, 0xf8, 0x00, 0x00, 0x08, 0xb1, + 0xce, 0xf7, 0x48, 0xfd, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x8f, 0x00, 0xbf, + 0x90, 0xcf, 0x01, 0x00, 0x1c, 0xe5, 0x01, 0x00, 0xd4, 0x9b, 0x08, 0x00, + 0x24, 0xe5, 0x01, 0x00, 0x9c, 0x2e, 0x06, 0x00, 0x98, 0x1f, 0x06, 0x00, + 0x9c, 0x1f, 0x06, 0x00, 0xe8, 0xfd, 0x08, 0x00, 0xe4, 0xfd, 0x08, 0x00, + 0x84, 0x9a, 0x08, 0x00, 0xf0, 0xfd, 0x08, 0x00, 0xdc, 0xfd, 0x08, 0x00, + 0xec, 0xfd, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0x01, 0xf0, 0xca, 0xff, + 0x4b, 0x4d, 0x04, 0x46, 0x95, 0xf8, 0xdc, 0x02, 0x80, 0x07, 0x21, 0xd5, + 0x12, 0x49, 0xd5, 0xf8, 0xc4, 0x0d, 0xdf, 0xf8, 0x4c, 0x80, 0x11, 0x4f, + 0x01, 0xf1, 0x48, 0x06, 0xd8, 0xf8, 0x00, 0x20, 0x31, 0x18, 0x30, 0x5c, + 0x49, 0x78, 0x40, 0xea, 0x01, 0x20, 0x09, 0x21, 0x38, 0x80, 0x00, 0xb2, + 0x90, 0x47, 0x38, 0x80, 0xd5, 0xf8, 0xc8, 0x0d, 0xd8, 0xf8, 0x00, 0x20, + 0x31, 0x18, 0x30, 0x5c, 0x49, 0x78, 0x40, 0xea, 0x01, 0x20, 0x09, 0x21, + 0x78, 0x80, 0x00, 0xb2, 0x90, 0x47, 0x78, 0x80, 0x20, 0x46, 0xbd, 0xe8, + 0xf0, 0x81, 0x00, 0xbf, 0x50, 0xec, 0x01, 0x00, 0xf0, 0xd1, 0x01, 0x00, + 0x10, 0xfe, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x89, 0xb0, 0x31, 0x48, + 0xdf, 0xf8, 0xc8, 0xb0, 0x32, 0x4f, 0x33, 0x4e, 0xdf, 0xf8, 0xcc, 0x80, + 0x00, 0x21, 0x08, 0xac, 0x00, 0xf5, 0x04, 0x60, 0x04, 0x90, 0x2c, 0x48, + 0x03, 0x90, 0x00, 0x20, 0x02, 0x91, 0xcd, 0xe9, 0x00, 0x7b, 0xdd, 0xe9, + 0x03, 0xa9, 0x00, 0x25, 0x07, 0x90, 0xcd, 0xe9, 0x05, 0xb7, 0x5a, 0xf8, + 0x04, 0x0b, 0x59, 0xf8, 0x04, 0x1b, 0x33, 0x68, 0x22, 0x46, 0xcb, 0xf8, + 0x00, 0x00, 0x98, 0xf9, 0xbe, 0x02, 0x39, 0x60, 0xc1, 0xf3, 0x44, 0x31, + 0x80, 0x00, 0x98, 0x47, 0x38, 0x68, 0x08, 0x99, 0x33, 0x68, 0x22, 0x46, + 0x20, 0xf4, 0x78, 0x30, 0x40, 0xea, 0x41, 0x30, 0xdb, 0xf8, 0x00, 0x10, + 0x01, 0xc7, 0x98, 0xf9, 0xbe, 0x02, 0xc1, 0xf3, 0x44, 0x31, 0x80, 0x00, + 0x98, 0x47, 0xdb, 0xf8, 0x00, 0x00, 0x08, 0x99, 0x01, 0x35, 0x10, 0x2d, + 0x20, 0xf4, 0x78, 0x30, 0x40, 0xea, 0x41, 0x30, 0x4b, 0xf8, 0x04, 0x0b, + 0xd3, 0xd1, 0x07, 0x98, 0x06, 0x9f, 0xdd, 0xf8, 0x14, 0xb0, 0x01, 0x30, + 0x40, 0x37, 0x0b, 0xf1, 0x40, 0x0b, 0x0a, 0x28, 0xc3, 0xd1, 0x0b, 0x48, + 0x02, 0x99, 0x00, 0x9f, 0xdd, 0xf8, 0x04, 0xb0, 0x40, 0x30, 0x01, 0x31, + 0x07, 0xf5, 0x20, 0x77, 0x0b, 0xf5, 0x20, 0x7b, 0x03, 0x90, 0x04, 0x48, + 0x02, 0x29, 0x00, 0xf5, 0x08, 0x60, 0x04, 0x90, 0xad, 0xd1, 0x09, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0x69, 0x08, 0x00, 0x20, 0x2f, 0x06, 0x00, + 0xb4, 0x10, 0x06, 0x00, 0x58, 0xd7, 0x01, 0x00, 0xac, 0xfb, 0x08, 0x00, + 0x98, 0xca, 0x01, 0x00, 0x04, 0x48, 0x00, 0x68, 0x00, 0xf0, 0x0f, 0x00, + 0x41, 0x1e, 0x00, 0x20, 0x02, 0x29, 0x38, 0xbf, 0x01, 0x20, 0x70, 0x47, + 0x20, 0x00, 0x23, 0x40, 0x2d, 0xe9, 0xf8, 0x4f, 0xdf, 0xf8, 0xc4, 0x74, + 0xdf, 0xf8, 0xc4, 0x14, 0xa2, 0x4c, 0x00, 0x28, 0x07, 0xf5, 0x31, 0x78, + 0x01, 0xf1, 0xd5, 0x09, 0x69, 0xd0, 0x4f, 0xf0, 0x01, 0x0a, 0xff, 0xf7, + 0xe3, 0xff, 0xdf, 0xf8, 0xb8, 0x14, 0xdf, 0xf8, 0xb8, 0x54, 0x00, 0x28, + 0xdf, 0xf8, 0xb8, 0x64, 0x4f, 0xf0, 0x10, 0x02, 0x08, 0xbf, 0x0d, 0x46, + 0xdf, 0xf8, 0xa8, 0x14, 0x33, 0x68, 0x11, 0xf8, 0x0d, 0x0f, 0x4c, 0x78, + 0x94, 0x49, 0x05, 0xeb, 0x80, 0x10, 0x8b, 0x46, 0xa4, 0x31, 0x98, 0x47, + 0x05, 0xeb, 0x84, 0x10, 0x33, 0x68, 0x0b, 0xf1, 0xe4, 0x01, 0x10, 0x22, + 0x00, 0xf5, 0x20, 0x70, 0x98, 0x47, 0x8e, 0x4c, 0x33, 0x68, 0x07, 0xf6, + 0xc4, 0x40, 0x05, 0x22, 0x04, 0xf1, 0x24, 0x01, 0x98, 0x47, 0x8b, 0x4d, + 0x33, 0x68, 0x07, 0xf6, 0x14, 0x50, 0x05, 0x22, 0x05, 0xf1, 0x24, 0x01, + 0x98, 0x47, 0x33, 0x68, 0x07, 0xf6, 0xd8, 0x40, 0x04, 0xf1, 0x3c, 0x01, + 0x05, 0x22, 0x98, 0x47, 0x33, 0x68, 0x07, 0xf6, 0x28, 0x50, 0x05, 0xf1, + 0x3c, 0x01, 0x05, 0x22, 0x98, 0x47, 0x33, 0x68, 0x07, 0xf6, 0xec, 0x40, + 0x04, 0xf1, 0x54, 0x01, 0x05, 0x22, 0x98, 0x47, 0x33, 0x68, 0x07, 0xf6, + 0x3c, 0x50, 0x05, 0xf1, 0x54, 0x01, 0x05, 0x22, 0x98, 0x47, 0x33, 0x68, + 0x07, 0xf5, 0x50, 0x60, 0x04, 0xf1, 0x6c, 0x01, 0x05, 0x22, 0x98, 0x47, + 0x33, 0x68, 0x07, 0xf5, 0x55, 0x60, 0x05, 0xf1, 0x6c, 0x01, 0x05, 0x22, + 0x98, 0x47, 0xd7, 0xf8, 0x64, 0x0d, 0xba, 0xf1, 0x00, 0x0f, 0x20, 0x60, + 0xd7, 0xf8, 0x68, 0x0d, 0x28, 0x60, 0x0c, 0xd0, 0x6b, 0x4c, 0x01, 0x26, + 0x10, 0xe0, 0xd8, 0xf8, 0x00, 0x00, 0x00, 0x28, 0x00, 0xf0, 0xe8, 0x81, + 0xc1, 0x07, 0x05, 0xd0, 0x4f, 0xf0, 0x00, 0x0a, 0x8d, 0xe7, 0xd8, 0xf8, + 0x00, 0x00, 0x64, 0x4c, 0x81, 0x07, 0x40, 0xf1, 0xcd, 0x80, 0x00, 0x26, + 0xd7, 0xf8, 0xc8, 0x08, 0xdf, 0xf8, 0xd0, 0x53, 0x04, 0xf1, 0x20, 0x01, + 0x03, 0x22, 0xe0, 0x61, 0xd7, 0xf8, 0xc0, 0x08, 0x20, 0x60, 0xd7, 0xf8, + 0xc4, 0x08, 0xa0, 0x61, 0xd7, 0xf8, 0xd8, 0x08, 0xc4, 0xf8, 0x9c, 0x00, + 0x07, 0xf6, 0xcc, 0x00, 0x2b, 0x68, 0x98, 0x47, 0x00, 0x2e, 0x00, 0xf0, + 0xb1, 0x80, 0xea, 0x4e, 0x2b, 0x68, 0x07, 0xf6, 0x0c, 0x10, 0x20, 0x22, + 0x06, 0xf1, 0x18, 0x01, 0x98, 0x47, 0xe1, 0x49, 0x2b, 0x68, 0x07, 0xf6, + 0x34, 0x40, 0x20, 0x22, 0x8b, 0x46, 0x01, 0xf5, 0x84, 0x61, 0x98, 0x47, + 0x2b, 0x68, 0x07, 0xf6, 0x8c, 0x10, 0x04, 0xf5, 0x00, 0x61, 0x02, 0x22, + 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf6, 0x94, 0x10, 0x31, 0x46, 0x02, 0x22, + 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf6, 0xb4, 0x40, 0x0b, 0xf5, 0x80, 0x61, + 0x02, 0x22, 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf6, 0xbc, 0x40, 0x0b, 0xf5, + 0x81, 0x61, 0x02, 0x22, 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf6, 0x9c, 0x10, + 0x06, 0xf5, 0x0d, 0x71, 0x04, 0x22, 0x98, 0x47, 0xd1, 0x4c, 0x2b, 0x68, + 0x07, 0xf5, 0x22, 0x60, 0x04, 0x22, 0x21, 0x46, 0x98, 0x47, 0x2b, 0x68, + 0x07, 0xf6, 0xac, 0x10, 0x06, 0xf5, 0x11, 0x71, 0x10, 0x22, 0x98, 0x47, + 0x2b, 0x68, 0x07, 0xf5, 0x23, 0x60, 0x04, 0xf1, 0x10, 0x01, 0x10, 0x22, + 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf6, 0xec, 0x10, 0x06, 0xf5, 0x83, 0x61, + 0x04, 0x22, 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf5, 0x27, 0x60, 0x04, 0xf5, + 0xf2, 0x71, 0x04, 0x22, 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf6, 0xfc, 0x10, + 0x06, 0xf5, 0x85, 0x61, 0x04, 0x22, 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf5, + 0x28, 0x60, 0x04, 0xf5, 0xfa, 0x71, 0x04, 0x22, 0x98, 0x47, 0x2b, 0x68, + 0x07, 0xf6, 0x0c, 0x20, 0x06, 0xf5, 0xfc, 0x71, 0x03, 0x22, 0x98, 0x47, + 0x2b, 0x68, 0x07, 0xf6, 0x18, 0x20, 0x06, 0xf5, 0x7e, 0x71, 0x02, 0x22, + 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf5, 0x29, 0x60, 0x0b, 0xf5, 0xc0, 0x61, + 0x03, 0x22, 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf6, 0x9c, 0x20, 0x04, 0xf5, + 0xe2, 0x71, 0x02, 0x22, 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf6, 0xa4, 0x20, + 0x06, 0xf5, 0x21, 0x71, 0x10, 0x22, 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf6, + 0x44, 0x30, 0x04, 0xf1, 0x50, 0x01, 0x10, 0x22, 0x98, 0x47, 0x2b, 0x68, + 0x07, 0xf6, 0xe4, 0x20, 0x06, 0xf5, 0x31, 0x71, 0x10, 0x22, 0x98, 0x47, + 0x2b, 0x68, 0x07, 0xf6, 0x84, 0x30, 0x04, 0xf1, 0x90, 0x01, 0x10, 0x22, + 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf6, 0x24, 0x30, 0x06, 0xf5, 0x41, 0x71, + 0x08, 0x22, 0x98, 0x47, 0x2b, 0x68, 0x07, 0xf6, 0xc4, 0x30, 0x04, 0xf1, + 0xd0, 0x01, 0x08, 0x22, 0x98, 0x47, 0xea, 0xe0, 0x00, 0xc0, 0x05, 0x30, + 0x00, 0xdc, 0x05, 0x30, 0x00, 0xf4, 0x05, 0x30, 0xd8, 0xf8, 0x00, 0x00, + 0x90, 0x4e, 0x01, 0x07, 0x12, 0xd5, 0x8e, 0x4c, 0x07, 0xf6, 0x0c, 0x10, + 0x06, 0xf1, 0x18, 0x01, 0x20, 0x22, 0x23, 0x68, 0x98, 0x47, 0x86, 0x49, + 0x23, 0x68, 0x84, 0x4c, 0x07, 0xf6, 0x34, 0x40, 0x20, 0x22, 0x01, 0xf5, + 0x84, 0x61, 0x98, 0x47, 0xd8, 0xf8, 0x00, 0x00, 0xc1, 0x06, 0x1f, 0xd5, + 0x21, 0x46, 0x83, 0x4c, 0x07, 0xf6, 0x8c, 0x10, 0x02, 0x22, 0x01, 0xf5, + 0x00, 0x61, 0x23, 0x68, 0x98, 0x47, 0x23, 0x68, 0x07, 0xf6, 0x94, 0x10, + 0x31, 0x46, 0x02, 0x22, 0x98, 0x47, 0x78, 0x4d, 0x23, 0x68, 0x07, 0xf6, + 0xb4, 0x40, 0x02, 0x22, 0x05, 0xf5, 0x80, 0x61, 0x98, 0x47, 0x23, 0x68, + 0x07, 0xf6, 0xbc, 0x40, 0x05, 0xf5, 0x81, 0x61, 0x02, 0x22, 0x98, 0x47, + 0xd8, 0xf8, 0x00, 0x00, 0x75, 0x4d, 0x81, 0x06, 0x0f, 0xd5, 0x72, 0x4c, + 0x07, 0xf6, 0x9c, 0x10, 0x06, 0xf5, 0x0d, 0x71, 0x04, 0x22, 0x23, 0x68, + 0x98, 0x47, 0x23, 0x68, 0x07, 0xf5, 0x22, 0x60, 0x29, 0x46, 0x04, 0x22, + 0x98, 0x47, 0xd8, 0xf8, 0x00, 0x00, 0x41, 0x06, 0x10, 0xd5, 0x69, 0x4c, + 0x07, 0xf6, 0xac, 0x10, 0x06, 0xf5, 0x11, 0x71, 0x10, 0x22, 0x23, 0x68, + 0x98, 0x47, 0x23, 0x68, 0x07, 0xf5, 0x23, 0x60, 0x05, 0xf1, 0x10, 0x01, + 0x10, 0x22, 0x98, 0x47, 0xd8, 0xf8, 0x00, 0x00, 0x41, 0xb2, 0xb1, 0xf1, + 0xff, 0x3f, 0x10, 0xdc, 0x5e, 0x4c, 0x07, 0xf6, 0xec, 0x10, 0x06, 0xf5, + 0x83, 0x61, 0x04, 0x22, 0x23, 0x68, 0x98, 0x47, 0x23, 0x68, 0x07, 0xf5, + 0x27, 0x60, 0x05, 0xf5, 0xf2, 0x71, 0x04, 0x22, 0x98, 0x47, 0xd8, 0xf8, + 0x00, 0x00, 0xc1, 0x05, 0x10, 0xd5, 0x55, 0x4c, 0x07, 0xf6, 0xfc, 0x10, + 0x06, 0xf5, 0x85, 0x61, 0x04, 0x22, 0x23, 0x68, 0x98, 0x47, 0x23, 0x68, + 0x07, 0xf5, 0x28, 0x60, 0x05, 0xf5, 0xfa, 0x71, 0x04, 0x22, 0x98, 0x47, + 0xd8, 0xf8, 0x00, 0x00, 0x81, 0x05, 0x1f, 0xd5, 0x4b, 0x4c, 0x07, 0xf6, + 0x0c, 0x20, 0x06, 0xf5, 0xfc, 0x71, 0x03, 0x22, 0x23, 0x68, 0x98, 0x47, + 0x23, 0x68, 0x07, 0xf6, 0x18, 0x20, 0x06, 0xf5, 0x7e, 0x71, 0x02, 0x22, + 0x98, 0x47, 0x40, 0x49, 0x23, 0x68, 0x07, 0xf5, 0x29, 0x60, 0x03, 0x22, + 0x01, 0xf5, 0xc0, 0x61, 0x98, 0x47, 0x23, 0x68, 0x07, 0xf6, 0x9c, 0x20, + 0x05, 0xf5, 0xe2, 0x71, 0x02, 0x22, 0x98, 0x47, 0xd8, 0xf8, 0x00, 0x00, + 0x41, 0x05, 0x10, 0xd5, 0x3a, 0x4c, 0x07, 0xf6, 0xa4, 0x20, 0x06, 0xf5, + 0x21, 0x71, 0x10, 0x22, 0x23, 0x68, 0x98, 0x47, 0x23, 0x68, 0x07, 0xf6, + 0x44, 0x30, 0x05, 0xf1, 0x50, 0x01, 0x10, 0x22, 0x98, 0x47, 0xd8, 0xf8, + 0x00, 0x00, 0x01, 0x05, 0x10, 0xd5, 0x31, 0x4c, 0x07, 0xf6, 0xe4, 0x20, + 0x06, 0xf5, 0x31, 0x71, 0x10, 0x22, 0x23, 0x68, 0x98, 0x47, 0x23, 0x68, + 0x07, 0xf6, 0x84, 0x30, 0x05, 0xf1, 0x90, 0x01, 0x10, 0x22, 0x98, 0x47, + 0xd8, 0xf8, 0x00, 0x00, 0xc0, 0x04, 0x0e, 0xd5, 0x27, 0x4c, 0x07, 0xf6, + 0x24, 0x30, 0x06, 0xf5, 0x41, 0x71, 0x08, 0x22, 0x23, 0x68, 0x98, 0x47, + 0x23, 0x68, 0x07, 0xf6, 0xc4, 0x30, 0x05, 0xf1, 0xd0, 0x01, 0x08, 0x22, + 0x98, 0x47, 0x99, 0xf8, 0x00, 0x00, 0x00, 0x07, 0x2c, 0xd5, 0xd9, 0xf8, + 0x03, 0x10, 0x20, 0x48, 0x01, 0x60, 0xd9, 0xf8, 0x07, 0x10, 0x81, 0x60, + 0xd9, 0xf8, 0x0b, 0x10, 0xc1, 0x60, 0x81, 0x6a, 0xd9, 0xf8, 0x0f, 0x20, + 0x09, 0x09, 0x61, 0xf3, 0x1f, 0x12, 0x82, 0x62, 0x41, 0x6b, 0xd9, 0xf8, + 0x13, 0x20, 0x09, 0x09, 0x61, 0xf3, 0x1f, 0x12, 0x42, 0x63, 0xc1, 0x6a, + 0xd9, 0xf8, 0x17, 0x20, 0x61, 0xf3, 0x13, 0x02, 0xc2, 0x62, 0xd9, 0xf8, + 0x1b, 0x10, 0x01, 0x63, 0x81, 0x6b, 0xd9, 0xf8, 0x1f, 0x20, 0x61, 0xf3, + 0x13, 0x02, 0x82, 0x63, 0xd9, 0xf8, 0x23, 0x10, 0xc1, 0x63, 0xd9, 0xf8, + 0x27, 0x10, 0x01, 0x66, 0xbd, 0xe8, 0xf8, 0x8f, 0x00, 0x69, 0x08, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x00, 0xc0, 0x05, 0x30, 0x00, 0xdc, 0x05, 0x30, + 0x58, 0xdc, 0x01, 0x00, 0xb4, 0x15, 0x06, 0x00, 0xf0, 0xd1, 0x01, 0x00, + 0x88, 0xfe, 0x08, 0x00, 0x08, 0xc8, 0x05, 0x30, 0x3c, 0xe2, 0x05, 0x30, + 0x00, 0x43, 0x05, 0x30, 0x2d, 0xe9, 0xfe, 0x4f, 0x4a, 0x48, 0x01, 0x68, + 0x30, 0x20, 0x88, 0x47, 0x00, 0x28, 0x77, 0xd0, 0xdf, 0xf8, 0x20, 0x81, + 0x04, 0x46, 0xdf, 0xf8, 0x20, 0x91, 0x98, 0xf8, 0x00, 0x00, 0x09, 0xeb, + 0x80, 0x00, 0x81, 0x78, 0x00, 0x20, 0xcf, 0xf7, 0xdb, 0xfc, 0x98, 0xf8, + 0x00, 0x00, 0x09, 0xeb, 0x80, 0x03, 0xd9, 0x78, 0x51, 0xb1, 0x41, 0x48, + 0x00, 0x21, 0x00, 0x22, 0x05, 0x68, 0x04, 0x20, 0x00, 0x90, 0x4f, 0xf4, + 0xe6, 0x60, 0xa8, 0x47, 0x98, 0xf8, 0x00, 0x00, 0x09, 0xeb, 0x80, 0x00, + 0x81, 0x78, 0xff, 0x29, 0x10, 0xd0, 0x01, 0x20, 0xcf, 0xf7, 0xc2, 0xfc, + 0x98, 0xf8, 0x00, 0x00, 0x00, 0x21, 0x09, 0xeb, 0x80, 0x00, 0x80, 0x78, + 0xcf, 0xf7, 0x90, 0xfc, 0x98, 0xf8, 0x00, 0x00, 0xff, 0x21, 0x09, 0xeb, + 0x80, 0x00, 0x81, 0x70, 0xff, 0xf7, 0x3a, 0xfd, 0x30, 0x49, 0xdf, 0xf8, + 0xc4, 0xb0, 0x4f, 0xf0, 0x00, 0x0a, 0x31, 0x4f, 0x00, 0x28, 0x20, 0x46, + 0x4f, 0xf0, 0x10, 0x03, 0x11, 0xf8, 0x0d, 0x2f, 0xdb, 0xf8, 0x00, 0x60, + 0x4d, 0x78, 0x2b, 0x49, 0xcd, 0xe9, 0x00, 0xaa, 0x08, 0xbf, 0x0f, 0x46, + 0x07, 0xeb, 0x82, 0x11, 0x29, 0x4a, 0xb0, 0x47, 0xdb, 0xf8, 0x00, 0x60, + 0x07, 0xeb, 0x85, 0x10, 0x27, 0x4a, 0x10, 0x23, 0xcd, 0xe9, 0x00, 0xaa, + 0x00, 0xf5, 0x20, 0x71, 0x04, 0xf1, 0x18, 0x00, 0xb0, 0x47, 0x24, 0x48, + 0x02, 0x21, 0x00, 0x22, 0x03, 0x68, 0x20, 0x46, 0x98, 0x47, 0x05, 0x46, + 0xff, 0x28, 0x1b, 0xd0, 0x20, 0x48, 0x4f, 0xf0, 0x01, 0x11, 0x00, 0x22, + 0x03, 0x68, 0x1f, 0x48, 0x06, 0x68, 0x28, 0x46, 0xb0, 0x47, 0x98, 0xf8, + 0x00, 0x00, 0x09, 0xeb, 0x80, 0x00, 0x80, 0xf8, 0x03, 0xa0, 0x85, 0x70, + 0x20, 0x46, 0xce, 0xf7, 0x7b, 0xf9, 0x0f, 0xe0, 0x00, 0x20, 0x41, 0xf6, + 0x1d, 0x51, 0x03, 0xb0, 0xbd, 0xe8, 0xf0, 0x4f, 0xce, 0xf7, 0x54, 0xb9, + 0x20, 0x46, 0xce, 0xf7, 0x6f, 0xf9, 0x00, 0x20, 0x41, 0xf6, 0x5f, 0x51, + 0xce, 0xf7, 0x4c, 0xf9, 0x03, 0x20, 0x29, 0x46, 0x03, 0xb0, 0xbd, 0xe8, + 0xf0, 0x4f, 0xcf, 0xf7, 0x59, 0xbc, 0x00, 0xbf, 0x4c, 0x9c, 0x08, 0x00, + 0x74, 0x87, 0x08, 0x00, 0x54, 0xd4, 0x05, 0x00, 0xa0, 0xa0, 0x08, 0x00, + 0xf0, 0xd1, 0x01, 0x00, 0x14, 0xf4, 0x08, 0x00, 0x58, 0xdc, 0x01, 0x00, + 0xb4, 0x15, 0x06, 0x00, 0xa4, 0xc0, 0x05, 0x30, 0xe4, 0xc0, 0x05, 0x30, + 0x10, 0xf4, 0x08, 0x00, 0x18, 0xf4, 0x08, 0x00, 0x0c, 0xf4, 0x08, 0x00, + 0x7d, 0x4a, 0x92, 0xf8, 0x64, 0x21, 0x52, 0x06, 0x23, 0xd5, 0xea, 0x4a, + 0x01, 0x29, 0x12, 0x78, 0x05, 0xd1, 0x11, 0x49, 0x5c, 0x23, 0x12, 0xfb, + 0x03, 0x11, 0x52, 0x31, 0x03, 0xe0, 0x0d, 0x49, 0x01, 0xeb, 0x42, 0x11, + 0x1d, 0x31, 0x09, 0x78, 0x31, 0xb1, 0x00, 0x28, 0x18, 0xbf, 0x01, 0x20, + 0x41, 0x01, 0x4f, 0xf0, 0x20, 0x10, 0x05, 0xe0, 0x00, 0x28, 0x18, 0xbf, + 0x01, 0x20, 0x01, 0x01, 0x4f, 0xf0, 0x10, 0x10, 0x05, 0x4a, 0x01, 0x40, + 0x13, 0x68, 0x23, 0xea, 0x00, 0x00, 0x08, 0x43, 0x10, 0x60, 0x70, 0x47, + 0xe0, 0x58, 0x01, 0x00, 0x44, 0x4f, 0x01, 0x00, 0x4c, 0xc0, 0x00, 0x40, + 0x64, 0x48, 0x90, 0xf8, 0x3e, 0x16, 0x3c, 0x48, 0x01, 0x29, 0x06, 0xd1, + 0x9a, 0x49, 0x49, 0x79, 0x01, 0x29, 0x02, 0xd1, 0x76, 0x49, 0xc9, 0x79, + 0xc9, 0xb1, 0x5f, 0x49, 0x08, 0x22, 0x91, 0xf9, 0x64, 0x11, 0x02, 0xea, + 0x91, 0x02, 0x00, 0x29, 0x4f, 0xf0, 0x01, 0x01, 0x48, 0xbf, 0x02, 0x21, + 0x11, 0x44, 0x02, 0x6d, 0x22, 0xf0, 0x0b, 0x02, 0x0a, 0x44, 0x02, 0x65, + 0x02, 0x68, 0x22, 0xf0, 0x0b, 0x02, 0x11, 0x44, 0x01, 0x60, 0x01, 0x20, + 0x01, 0x21, 0xff, 0xf7, 0xa9, 0xbf, 0x52, 0x49, 0x91, 0xf8, 0x64, 0x11, + 0xc1, 0xf3, 0xc1, 0x01, 0x02, 0x6d, 0x22, 0xf0, 0x0b, 0x02, 0x0a, 0x44, + 0x02, 0x65, 0x02, 0x68, 0x22, 0xf0, 0x0b, 0x02, 0x11, 0x44, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x49, 0x48, 0x90, 0xf8, 0x64, 0x11, 0x88, 0x07, + 0x05, 0xd4, 0x08, 0x20, 0x00, 0xea, 0x91, 0x02, 0xc1, 0xf3, 0x80, 0x10, + 0x01, 0xe0, 0x00, 0x22, 0x00, 0x20, 0xc1, 0xf3, 0xc1, 0x01, 0x11, 0x43, + 0x19, 0x4a, 0x13, 0x6d, 0x23, 0xf0, 0x0b, 0x03, 0x0b, 0x43, 0x13, 0x65, + 0x13, 0x68, 0x23, 0xf0, 0x0b, 0x03, 0x19, 0x43, 0x11, 0x60, 0x01, 0x21, + 0xff, 0xf7, 0x7a, 0xbf, 0x3a, 0x48, 0x90, 0xf8, 0x64, 0x01, 0x40, 0x07, + 0x48, 0xbf, 0xff, 0xf7, 0xa3, 0xbf, 0x70, 0x47, 0x36, 0x48, 0x90, 0xf8, + 0x64, 0x11, 0x48, 0x07, 0x05, 0xd4, 0x08, 0x20, 0x00, 0xea, 0x91, 0x02, + 0xc1, 0xf3, 0x80, 0x10, 0x01, 0xe0, 0x00, 0x22, 0x00, 0x20, 0xc1, 0xf3, + 0xc1, 0x01, 0x11, 0x43, 0x06, 0x4a, 0x13, 0x6d, 0x23, 0xf0, 0x0b, 0x03, + 0x0b, 0x43, 0x13, 0x65, 0x13, 0x68, 0x23, 0xf0, 0x0b, 0x03, 0x19, 0x43, + 0x11, 0x60, 0x01, 0x21, 0xff, 0xf7, 0x54, 0xbf, 0x54, 0x10, 0x21, 0x40, + 0x25, 0x49, 0x91, 0xf8, 0x3e, 0x16, 0x01, 0x29, 0x06, 0xd1, 0x5c, 0x49, + 0x49, 0x79, 0x01, 0x29, 0x02, 0xd1, 0x38, 0x49, 0xc9, 0x79, 0x00, 0xe0, + 0x01, 0x21, 0x01, 0x28, 0x1d, 0xd1, 0xe1, 0xb1, 0x1e, 0x48, 0x90, 0xf8, + 0x64, 0x01, 0xc1, 0x07, 0x08, 0xbf, 0x70, 0x47, 0x08, 0x21, 0x01, 0xea, + 0x90, 0x01, 0x40, 0xb2, 0x00, 0x28, 0x4f, 0xf0, 0x01, 0x00, 0x48, 0xbf, + 0x02, 0x20, 0x08, 0x44, 0x17, 0x49, 0x0a, 0x68, 0x22, 0xf0, 0x0b, 0x02, + 0x02, 0x44, 0x0a, 0x60, 0x0a, 0x6d, 0x22, 0xf0, 0x0b, 0x02, 0x10, 0x44, + 0x08, 0x65, 0x01, 0x20, 0x1a, 0xe0, 0x10, 0x48, 0x90, 0xf8, 0x64, 0x11, + 0xc8, 0x07, 0x05, 0xd1, 0x08, 0x20, 0x00, 0xea, 0x91, 0x02, 0xc1, 0xf3, + 0x80, 0x10, 0x01, 0xe0, 0x00, 0x20, 0x00, 0x22, 0xc1, 0xf3, 0xc1, 0x01, + 0x11, 0x43, 0x09, 0x4a, 0x13, 0x68, 0x23, 0xf0, 0x0b, 0x03, 0x0b, 0x43, + 0x13, 0x60, 0x13, 0x6d, 0x23, 0xf0, 0x0b, 0x03, 0x19, 0x43, 0x11, 0x65, + 0x00, 0x21, 0xff, 0xf7, 0x07, 0xbf, 0x00, 0xbf, 0x64, 0xd4, 0x05, 0x00, + 0xe8, 0x65, 0x08, 0x00, 0x3c, 0x20, 0x21, 0x40, 0x35, 0x48, 0x80, 0x79, + 0x70, 0x47, 0x00, 0xbf, 0x80, 0xb5, 0xc8, 0x4a, 0x92, 0xf8, 0x35, 0x22, + 0x52, 0x07, 0x5c, 0xbf, 0x0c, 0x20, 0x80, 0xbd, 0x01, 0x28, 0x08, 0xbf, + 0x01, 0x29, 0x13, 0xd0, 0x2d, 0x49, 0x8a, 0x79, 0x0a, 0xb1, 0x17, 0x20, + 0x80, 0xbd, 0x4a, 0x79, 0x82, 0x42, 0x09, 0xd0, 0x01, 0x20, 0x88, 0x71, + 0x06, 0x49, 0x05, 0x48, 0x4a, 0x78, 0x06, 0x49, 0x00, 0x68, 0x09, 0x79, + 0xf6, 0xf7, 0x7a, 0xfe, 0x00, 0x20, 0x80, 0xbd, 0x12, 0x20, 0x80, 0xbd, + 0x88, 0xe9, 0x08, 0x00, 0xad, 0x2f, 0x06, 0x00, 0x4c, 0xd7, 0x01, 0x00, + 0x2d, 0xe9, 0xf8, 0x43, 0x1d, 0x4d, 0x1e, 0x4e, 0xdf, 0xf8, 0x78, 0x90, + 0x1e, 0x4f, 0x4f, 0xf0, 0x00, 0x08, 0x28, 0x68, 0x78, 0xb3, 0x41, 0x05, + 0x1b, 0xd5, 0x70, 0x79, 0xb0, 0xfa, 0x80, 0xf0, 0x44, 0x09, 0x20, 0x46, + 0xfa, 0xf7, 0xbc, 0xff, 0x20, 0x46, 0xfb, 0xf7, 0x19, 0xf8, 0x20, 0x46, + 0xfb, 0xf7, 0x4e, 0xf8, 0x28, 0x68, 0x86, 0xf8, 0x06, 0x80, 0x74, 0x71, + 0x20, 0xf4, 0x80, 0x60, 0x28, 0x60, 0xd9, 0xf8, 0x00, 0x00, 0x80, 0x47, + 0x38, 0x68, 0x80, 0x47, 0xc8, 0xf7, 0xa6, 0xfe, 0x28, 0x68, 0xb0, 0xf1, + 0xff, 0x3f, 0xdd, 0xdc, 0x0c, 0x48, 0x00, 0x68, 0x80, 0x47, 0x02, 0xf0, + 0xaf, 0xf9, 0x20, 0xb1, 0x0a, 0x48, 0x00, 0x68, 0xbd, 0xe8, 0xf8, 0x43, + 0x00, 0x47, 0x28, 0x68, 0x20, 0xf0, 0x00, 0x40, 0x28, 0x60, 0xbd, 0xe8, + 0xf8, 0x83, 0x00, 0xbf, 0x54, 0xd7, 0x01, 0x00, 0x48, 0xdc, 0x05, 0x00, + 0x68, 0xfc, 0x08, 0x00, 0x84, 0xfe, 0x08, 0x00, 0x40, 0xfc, 0x08, 0x00, + 0x44, 0xfc, 0x08, 0x00, 0x7c, 0xb5, 0x31, 0x49, 0x31, 0x4a, 0x09, 0x78, + 0xc1, 0xeb, 0x41, 0x11, 0x02, 0xeb, 0xc1, 0x03, 0xdc, 0x68, 0x14, 0xb1, + 0x04, 0xf1, 0x44, 0x01, 0x0a, 0xe0, 0x52, 0xf8, 0x31, 0x20, 0x99, 0x68, + 0x1a, 0xb1, 0x21, 0xb9, 0x02, 0xf2, 0x35, 0x11, 0x02, 0xe0, 0x00, 0x29, + 0x4a, 0xd0, 0xb9, 0x31, 0x27, 0x4a, 0x00, 0x28, 0x27, 0x4c, 0x29, 0x4b, + 0x04, 0xbf, 0x49, 0xf2, 0xf8, 0x52, 0xc4, 0xf2, 0x23, 0x02, 0x09, 0x78, + 0x00, 0x28, 0x12, 0x68, 0xa1, 0x80, 0x22, 0x60, 0x22, 0x4a, 0x22, 0xf8, + 0x31, 0x10, 0x04, 0xbf, 0x42, 0xf2, 0x34, 0x03, 0xc4, 0xf2, 0x21, 0x03, + 0x1b, 0x68, 0x13, 0xf0, 0x01, 0x00, 0xa0, 0x71, 0x12, 0xd1, 0xc3, 0xf3, + 0x40, 0x03, 0x83, 0xf0, 0x01, 0x05, 0x23, 0x72, 0xe5, 0x71, 0x23, 0xb9, + 0x02, 0xeb, 0xc1, 0x05, 0xae, 0x88, 0x01, 0x36, 0xae, 0x80, 0x6b, 0xb1, + 0x02, 0xeb, 0xc1, 0x01, 0xca, 0x88, 0x01, 0x32, 0xca, 0x80, 0x07, 0xe0, + 0x02, 0xeb, 0xc1, 0x01, 0x01, 0x23, 0x4a, 0x88, 0xe3, 0x71, 0x23, 0x72, + 0x01, 0x32, 0x4a, 0x80, 0x61, 0x7a, 0x88, 0x42, 0x10, 0xd0, 0x67, 0x49, + 0xb1, 0xf8, 0x7c, 0x16, 0x09, 0x05, 0x0a, 0xd5, 0x9d, 0x48, 0x09, 0x4b, + 0x01, 0x21, 0x00, 0x22, 0x05, 0x68, 0x0c, 0x20, 0x00, 0x90, 0x40, 0xf2, + 0x32, 0x70, 0xa8, 0x47, 0xa0, 0x79, 0x60, 0x72, 0x7c, 0xbd, 0x00, 0xbf, + 0x74, 0x87, 0x08, 0x00, 0x0c, 0x6f, 0x01, 0x00, 0xfc, 0x95, 0x23, 0x40, + 0xc0, 0x20, 0x06, 0x00, 0x80, 0xfa, 0x05, 0x00, 0x88, 0x10, 0x21, 0x40, + 0xf8, 0xb5, 0x54, 0x48, 0x00, 0x78, 0x10, 0xb1, 0x53, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x53, 0x48, 0xc2, 0x7a, 0x05, 0x2a, 0x02, 0xd3, 0x5c, 0x49, + 0x00, 0x20, 0x06, 0xe0, 0x0a, 0x30, 0x83, 0x78, 0x05, 0x2b, 0x06, 0xd3, + 0x58, 0x49, 0x00, 0x20, 0x1a, 0x46, 0xbd, 0xe8, 0xf8, 0x40, 0xe6, 0xf7, + 0x4b, 0xb8, 0xdf, 0xf8, 0x2c, 0xc1, 0x4b, 0x4d, 0x4b, 0x4e, 0x00, 0x24, + 0x62, 0x44, 0x0c, 0xf5, 0xac, 0x63, 0x92, 0xf9, 0xac, 0x24, 0x12, 0x03, + 0x1f, 0x68, 0x01, 0x34, 0x08, 0x2c, 0x07, 0xf4, 0x70, 0x41, 0x11, 0x44, + 0x4f, 0xea, 0x11, 0x31, 0x61, 0xf3, 0x0f, 0x37, 0xaf, 0x51, 0x80, 0xcb, + 0x61, 0xf3, 0x0f, 0x37, 0x80, 0xc5, 0xef, 0xd1, 0x81, 0x78, 0x40, 0x4d, + 0x0c, 0xf2, 0x64, 0x73, 0x00, 0x24, 0x61, 0x44, 0x91, 0xf9, 0xac, 0x14, + 0x0a, 0x03, 0x02, 0xcb, 0x01, 0x34, 0x08, 0x2c, 0x01, 0xf4, 0x70, 0x46, + 0x16, 0x44, 0x4f, 0xea, 0x16, 0x36, 0x66, 0xf3, 0x0f, 0x31, 0x02, 0xc5, + 0xf3, 0xd1, 0x41, 0x78, 0xdc, 0xf8, 0xc8, 0x45, 0x0c, 0xf2, 0xb6, 0x43, + 0x43, 0xf6, 0x3f, 0x0e, 0x5a, 0x56, 0x04, 0xf0, 0x38, 0x05, 0x04, 0xf0, + 0x07, 0x07, 0x04, 0xf4, 0x60, 0x54, 0x05, 0xeb, 0xc2, 0x02, 0x0c, 0xf2, + 0xbb, 0x45, 0x6e, 0x56, 0x3e, 0x44, 0x2d, 0x4f, 0x32, 0x43, 0x0c, 0xf2, + 0xb1, 0x46, 0x71, 0x5c, 0x04, 0xeb, 0xc1, 0x21, 0x3c, 0x68, 0x11, 0x43, + 0x29, 0x4a, 0x01, 0xea, 0x0e, 0x01, 0x14, 0x40, 0x21, 0x44, 0x39, 0x60, + 0x81, 0x78, 0xdc, 0xf8, 0xcc, 0x47, 0x5b, 0x56, 0x04, 0xf0, 0x38, 0x07, + 0x6d, 0x56, 0x71, 0x5c, 0x07, 0xeb, 0xc3, 0x03, 0x04, 0xf0, 0x07, 0x07, + 0x04, 0xf4, 0x60, 0x54, 0x3d, 0x44, 0x04, 0xeb, 0xc1, 0x21, 0x2b, 0x43, + 0x1f, 0x4d, 0x19, 0x43, 0x1d, 0x4b, 0x01, 0xea, 0x0e, 0x01, 0x1c, 0x68, + 0x22, 0x40, 0x11, 0x44, 0x19, 0x60, 0x00, 0x21, 0x01, 0x70, 0x28, 0x78, + 0xff, 0x28, 0x01, 0xd0, 0x07, 0x28, 0x19, 0xd1, 0x18, 0x48, 0x01, 0x68, + 0x40, 0xf2, 0x5c, 0x50, 0x88, 0x47, 0x98, 0xb1, 0x0c, 0x4a, 0x40, 0xf2, + 0x5c, 0x51, 0x40, 0xf2, 0x5c, 0x53, 0x04, 0x46, 0xc8, 0xf7, 0x58, 0xf8, + 0x12, 0x48, 0x21, 0x46, 0x40, 0xf2, 0x5c, 0x52, 0x03, 0x68, 0x28, 0x78, + 0x98, 0x47, 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x40, 0xcd, 0xf7, 0xba, 0xbe, + 0xf8, 0xbd, 0x00, 0xbf, 0xa7, 0x58, 0x01, 0x00, 0x68, 0xfc, 0x08, 0x00, + 0xf0, 0xd1, 0x01, 0x00, 0x00, 0x69, 0x08, 0x00, 0x40, 0xd8, 0x05, 0x30, + 0x20, 0xfe, 0xff, 0xff, 0x40, 0xf0, 0x05, 0x30, 0x00, 0xd6, 0x05, 0x30, + 0xc0, 0xc7, 0xff, 0xff, 0x00, 0xee, 0x05, 0x30, 0x64, 0x8d, 0x08, 0x00, + 0xd4, 0x9b, 0x08, 0x00, 0xe4, 0x9b, 0x08, 0x00, 0xb4, 0xa2, 0x05, 0x00, + 0x2d, 0xe9, 0xfc, 0x47, 0x68, 0xb3, 0x27, 0x49, 0xc8, 0x6c, 0x8a, 0x46, + 0x40, 0xf0, 0x00, 0x40, 0xc8, 0x64, 0x25, 0x48, 0x00, 0xf5, 0x05, 0x75, + 0x35, 0xf8, 0xea, 0x0f, 0xc8, 0xb1, 0x24, 0x48, 0xdf, 0xf8, 0x88, 0x80, + 0x00, 0x26, 0x6f, 0xf0, 0x01, 0x09, 0x64, 0x24, 0x47, 0x1c, 0x50, 0x46, + 0xda, 0xf8, 0x50, 0x00, 0xb0, 0xf1, 0xff, 0x3f, 0x1e, 0xdd, 0xb8, 0xf8, + 0x00, 0x00, 0x00, 0xeb, 0x80, 0x00, 0x09, 0xeb, 0x40, 0x00, 0xb8, 0x47, + 0x28, 0x88, 0x01, 0x36, 0x60, 0x43, 0x86, 0x42, 0xed, 0xd3, 0xda, 0xf8, + 0x4c, 0x10, 0x00, 0x20, 0xb1, 0xf1, 0xff, 0x3f, 0x16, 0xdd, 0xbd, 0xe8, + 0xfc, 0x87, 0x10, 0x48, 0x01, 0x22, 0x01, 0x68, 0x01, 0xf0, 0x7f, 0x41, + 0x01, 0x60, 0xc1, 0x6c, 0x62, 0xf3, 0x9f, 0x71, 0xc1, 0x64, 0x06, 0xe0, + 0xda, 0xf8, 0x00, 0x00, 0x0d, 0x49, 0x61, 0xf3, 0x17, 0x00, 0xca, 0xf8, + 0x00, 0x00, 0x00, 0x20, 0xbd, 0xe8, 0xfc, 0x87, 0x0a, 0x49, 0x00, 0x90, + 0x40, 0xf2, 0x31, 0x70, 0x06, 0x22, 0x00, 0x23, 0x0c, 0x68, 0x00, 0x21, + 0xa0, 0x47, 0x01, 0x20, 0xbd, 0xe8, 0xfc, 0x87, 0xc0, 0x43, 0x05, 0x30, + 0x8c, 0x7e, 0x08, 0x00, 0x34, 0xec, 0x01, 0x00, 0x40, 0xec, 0x01, 0x00, + 0xff, 0xaa, 0xfa, 0x00, 0xa0, 0xa0, 0x08, 0x00, 0x70, 0xb5, 0x14, 0x46, + 0x0d, 0x46, 0x01, 0xf0, 0xe3, 0xf8, 0x41, 0x48, 0x90, 0xf8, 0x5f, 0x10, + 0x79, 0xb1, 0xb4, 0xf9, 0x00, 0x10, 0xb0, 0xf9, 0x58, 0x30, 0xb4, 0xf9, + 0x02, 0x20, 0x99, 0x42, 0xb8, 0xbf, 0x0b, 0x46, 0x23, 0x80, 0xb0, 0xf9, + 0x5a, 0x00, 0x82, 0x42, 0xb8, 0xbf, 0x10, 0x46, 0x60, 0x80, 0x38, 0x48, + 0x90, 0xf8, 0x34, 0x02, 0x01, 0x28, 0x1a, 0xd1, 0x36, 0x48, 0x90, 0xf8, + 0x54, 0x06, 0x7f, 0x28, 0x15, 0xd0, 0xb4, 0xf9, 0x04, 0x30, 0xb4, 0xf9, + 0x00, 0x10, 0xb4, 0xf9, 0x02, 0x20, 0x86, 0x00, 0xb3, 0xeb, 0x80, 0x0f, + 0xa8, 0xbf, 0x33, 0x46, 0xa3, 0x80, 0xb1, 0xeb, 0x80, 0x0f, 0xa8, 0xbf, + 0x31, 0x46, 0x21, 0x80, 0xb2, 0xeb, 0x80, 0x0f, 0xb8, 0xbf, 0x16, 0x46, + 0x66, 0x80, 0x2a, 0x48, 0x40, 0x79, 0x01, 0x28, 0x16, 0xd1, 0x2a, 0x49, + 0x28, 0x48, 0xb4, 0xf9, 0x00, 0x30, 0xb4, 0xf9, 0x02, 0x60, 0x89, 0x78, + 0x00, 0xeb, 0x45, 0x10, 0x30, 0xf9, 0x11, 0x20, 0x00, 0xeb, 0x41, 0x00, + 0x93, 0x42, 0xb8, 0xbf, 0x1a, 0x46, 0x22, 0x80, 0xb0, 0xf9, 0x80, 0x00, + 0x86, 0x42, 0xb8, 0xbf, 0x30, 0x46, 0x60, 0x80, 0x1f, 0x48, 0x03, 0x2d, + 0x05, 0xd1, 0xb0, 0xf8, 0x48, 0x10, 0x03, 0x25, 0x09, 0x07, 0x58, 0xbf, + 0x01, 0x25, 0x01, 0x21, 0x02, 0x88, 0xa9, 0x40, 0x11, 0x42, 0x09, 0xd0, + 0x00, 0xeb, 0x45, 0x02, 0xb4, 0xf9, 0x00, 0x30, 0xb2, 0xf9, 0x0a, 0x20, + 0x93, 0x42, 0xb8, 0xbf, 0x1a, 0x46, 0x22, 0x80, 0x42, 0x8a, 0x11, 0x42, + 0x09, 0xd0, 0x00, 0xeb, 0x45, 0x02, 0xb4, 0xf9, 0x02, 0x30, 0xb2, 0xf9, + 0x1c, 0x20, 0x93, 0x42, 0xb8, 0xbf, 0x1a, 0x46, 0x62, 0x80, 0xb0, 0xf8, + 0x48, 0x20, 0x11, 0x42, 0x09, 0xd0, 0x00, 0xeb, 0x45, 0x00, 0xb4, 0xf9, + 0x04, 0x10, 0xb0, 0xf9, 0x52, 0x00, 0x81, 0x42, 0xb8, 0xbf, 0x08, 0x46, + 0xa0, 0x80, 0x70, 0xbd, 0xd0, 0xe2, 0x05, 0x00, 0x38, 0x21, 0x01, 0x00, + 0x64, 0xd4, 0x05, 0x00, 0x48, 0xdc, 0x05, 0x00, 0xb2, 0xd0, 0x01, 0x00, + 0xad, 0x2f, 0x06, 0x00, 0xd8, 0xdb, 0x05, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, + 0x87, 0xb0, 0x72, 0x4e, 0xdf, 0xf8, 0xc8, 0xa1, 0x72, 0x4f, 0x0c, 0x22, + 0x0a, 0xf2, 0xdc, 0x55, 0x33, 0x68, 0x07, 0xf1, 0x60, 0x01, 0x28, 0x46, + 0x98, 0x47, 0x0a, 0xf2, 0x0c, 0x69, 0x07, 0xf1, 0x90, 0x04, 0x33, 0x68, + 0x0c, 0x22, 0x48, 0x46, 0x21, 0x46, 0x98, 0x47, 0x33, 0x68, 0x07, 0xf5, + 0x07, 0x71, 0x28, 0x46, 0x0c, 0x22, 0x98, 0x47, 0x07, 0xf5, 0x13, 0x78, + 0x33, 0x68, 0x48, 0x46, 0x0c, 0x22, 0x41, 0x46, 0x98, 0x47, 0x64, 0x4d, + 0x33, 0x68, 0x0a, 0xf5, 0xfc, 0x60, 0x0c, 0x22, 0x05, 0xf1, 0x38, 0x01, + 0x98, 0x47, 0x05, 0xf1, 0x68, 0x0b, 0x33, 0x68, 0x0a, 0xf5, 0x01, 0x60, + 0x0c, 0x22, 0x59, 0x46, 0x04, 0x90, 0x98, 0x47, 0xda, 0xf8, 0x34, 0x02, + 0x81, 0x07, 0x5b, 0x49, 0x37, 0xd5, 0xcd, 0xf8, 0x18, 0xb0, 0xdf, 0xf8, + 0x68, 0xb1, 0x01, 0xf1, 0x1c, 0x05, 0x4f, 0xf0, 0x00, 0x0a, 0x4e, 0x46, + 0x53, 0x4b, 0x55, 0x48, 0x56, 0xf8, 0x30, 0x2c, 0x15, 0xf8, 0x1a, 0x1c, + 0xdb, 0xf8, 0x00, 0x70, 0x00, 0x93, 0x4f, 0xf0, 0x40, 0x43, 0x00, 0x78, + 0x01, 0x93, 0x1e, 0x23, 0x02, 0x93, 0xa4, 0xf1, 0x30, 0x03, 0xb8, 0x47, + 0x4a, 0x4b, 0x4c, 0x48, 0x32, 0x68, 0x29, 0x78, 0xdb, 0xf8, 0x00, 0x70, + 0x04, 0x33, 0x80, 0x7e, 0x00, 0x93, 0x4f, 0xf0, 0x40, 0x43, 0x01, 0x93, + 0x1e, 0x23, 0x02, 0x93, 0x23, 0x46, 0xb8, 0x47, 0x0a, 0xf1, 0x01, 0x0a, + 0x04, 0x34, 0x01, 0x35, 0x04, 0x36, 0xba, 0xf1, 0x0c, 0x0f, 0xd5, 0xd1, + 0x3d, 0x48, 0xdd, 0xf8, 0x18, 0xb0, 0xd0, 0xf8, 0x34, 0x02, 0x41, 0x07, + 0x39, 0xd5, 0xdf, 0xf8, 0xf4, 0xa0, 0x3a, 0x48, 0x3c, 0x4e, 0x00, 0x25, + 0x0a, 0xf1, 0x28, 0x04, 0xdf, 0xf8, 0xe4, 0xa0, 0x00, 0xf5, 0xf2, 0x71, + 0x00, 0xf5, 0xf4, 0x70, 0x06, 0x91, 0x05, 0x90, 0x06, 0x9b, 0x59, 0xf8, + 0x30, 0x2c, 0x14, 0xf8, 0x1a, 0x1c, 0x9a, 0xf8, 0x01, 0x00, 0x37, 0x68, + 0x00, 0x93, 0x4f, 0xf0, 0x40, 0x43, 0x01, 0x93, 0x1e, 0x23, 0x02, 0x93, + 0xa8, 0xf1, 0x30, 0x03, 0xb8, 0x47, 0x05, 0x9b, 0xd9, 0xf8, 0x00, 0x20, + 0x21, 0x78, 0x9a, 0xf8, 0x1b, 0x00, 0x37, 0x68, 0x00, 0x93, 0x4f, 0xf0, + 0x40, 0x43, 0x01, 0x93, 0x1e, 0x23, 0x02, 0x93, 0x43, 0x46, 0xb8, 0x47, + 0x01, 0x35, 0x08, 0xf1, 0x04, 0x08, 0x01, 0x34, 0x09, 0xf1, 0x04, 0x09, + 0x0c, 0x2d, 0xd7, 0xd1, 0xdf, 0x48, 0xd0, 0xf8, 0x34, 0x02, 0x1f, 0x4b, + 0xdd, 0xf8, 0x10, 0xa0, 0xc0, 0x06, 0x30, 0xd5, 0x1d, 0x49, 0x1d, 0x4f, + 0xdf, 0xf8, 0x74, 0x80, 0x00, 0x25, 0x4f, 0xf0, 0x40, 0x49, 0x01, 0xf1, + 0x5c, 0x04, 0x19, 0x1d, 0x06, 0x91, 0xcd, 0xe9, 0x00, 0x39, 0x1e, 0x23, + 0x5a, 0xf8, 0x30, 0x2c, 0x14, 0xf8, 0x1a, 0x1c, 0x97, 0xf8, 0x35, 0x00, + 0xd8, 0xf8, 0x00, 0x60, 0x02, 0x93, 0xab, 0xf1, 0x30, 0x03, 0xb0, 0x47, + 0x06, 0x9b, 0xda, 0xf8, 0x00, 0x20, 0x21, 0x78, 0x97, 0xf8, 0x4f, 0x00, + 0xd8, 0xf8, 0x00, 0x60, 0xcd, 0xe9, 0x00, 0x39, 0x1e, 0x23, 0x02, 0x93, + 0x5b, 0x46, 0xb0, 0x47, 0x01, 0x35, 0x08, 0x4b, 0x0b, 0xf1, 0x04, 0x0b, + 0x01, 0x34, 0x0a, 0xf1, 0x04, 0x0a, 0x0c, 0x2d, 0xd9, 0xd1, 0x07, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0x88, 0xfe, 0x08, 0x00, 0x00, 0x69, 0x08, 0x00, + 0x44, 0xd6, 0x05, 0x30, 0x28, 0xf0, 0x05, 0x30, 0x58, 0xe2, 0x01, 0x00, + 0x8c, 0xfe, 0x08, 0x00, 0x10, 0xb5, 0x14, 0x46, 0x00, 0xf0, 0x60, 0xff, + 0x03, 0x49, 0x04, 0xeb, 0x44, 0x00, 0x01, 0x22, 0x01, 0xf8, 0x10, 0x20, + 0x10, 0xbd, 0x00, 0xbf, 0x90, 0xe4, 0x01, 0x00, 0xbc, 0xb5, 0x04, 0x46, + 0x10, 0x48, 0x0d, 0x46, 0x01, 0xa9, 0x02, 0x68, 0x28, 0x46, 0x90, 0x47, + 0x1e, 0x2d, 0x04, 0xd3, 0x00, 0x20, 0x42, 0xf2, 0x12, 0x31, 0xc7, 0xf7, + 0x17, 0xfe, 0x0b, 0x49, 0x05, 0xeb, 0x05, 0x10, 0x01, 0x9a, 0x01, 0xeb, + 0x80, 0x00, 0x00, 0x21, 0x25, 0x88, 0x63, 0x88, 0x01, 0x31, 0x0c, 0x34, + 0x11, 0x29, 0x6f, 0xf3, 0x1f, 0x35, 0x63, 0xf3, 0x17, 0x35, 0x20, 0xc2, + 0x20, 0xc0, 0xf3, 0xd1, 0xbc, 0xbd, 0x00, 0xbf, 0xc4, 0xfc, 0x08, 0x00, + 0xc4, 0x22, 0x06, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x91, 0xb0, 0x9f, 0x48, + 0x90, 0xf8, 0x37, 0x12, 0x49, 0x06, 0x01, 0xd4, 0x00, 0x24, 0x32, 0xe1, + 0x9c, 0x4a, 0x00, 0xf5, 0x0d, 0x75, 0x9c, 0x4b, 0x01, 0x21, 0x10, 0x78, + 0x19, 0x54, 0x01, 0x30, 0x9a, 0x49, 0x10, 0x70, 0xc0, 0xb2, 0xff, 0x28, + 0x04, 0xbf, 0x00, 0x20, 0x10, 0x70, 0x05, 0xaa, 0x00, 0x20, 0x08, 0xc9, + 0x01, 0x30, 0x0c, 0x28, 0x1b, 0x68, 0x08, 0xc2, 0xf9, 0xd1, 0x94, 0x49, + 0x96, 0x4e, 0xdf, 0xf8, 0x48, 0x82, 0xdf, 0xf8, 0x58, 0x92, 0x08, 0x68, + 0x40, 0xf0, 0x00, 0x70, 0x08, 0x60, 0x90, 0x49, 0xb5, 0xf8, 0x94, 0x00, + 0x01, 0xea, 0x80, 0x50, 0xb5, 0xf8, 0x96, 0x10, 0x40, 0xea, 0x41, 0x30, + 0x01, 0x90, 0x8f, 0x48, 0x00, 0xf1, 0x01, 0x0b, 0x00, 0x20, 0x02, 0x90, + 0x00, 0x20, 0x04, 0x90, 0x30, 0x68, 0x80, 0x47, 0x04, 0x46, 0x00, 0x28, + 0x40, 0xf0, 0xbf, 0x80, 0x80, 0x49, 0x81, 0x4a, 0x03, 0x23, 0x08, 0x78, + 0x13, 0x54, 0x01, 0x30, 0x08, 0x70, 0xc0, 0xb2, 0xff, 0x28, 0x04, 0xbf, + 0x00, 0x20, 0x08, 0x70, 0x04, 0x9c, 0x04, 0xeb, 0x44, 0x0c, 0x00, 0x2c, + 0x08, 0xeb, 0xcc, 0x01, 0x58, 0xf8, 0x3c, 0xa0, 0xd1, 0xe9, 0x03, 0xe6, + 0xd1, 0xe9, 0x01, 0x32, 0x37, 0x68, 0x01, 0x98, 0x6f, 0xf3, 0x5e, 0x37, + 0x47, 0xea, 0x00, 0x07, 0x4f, 0xf0, 0xe0, 0x00, 0x37, 0x60, 0x75, 0x4f, + 0x1e, 0x68, 0x60, 0xf3, 0x1f, 0x66, 0x1e, 0x60, 0x4f, 0xf0, 0xcc, 0x03, + 0x08, 0xbf, 0x33, 0x23, 0x7e, 0x68, 0x43, 0xea, 0x06, 0x03, 0x4f, 0xf0, + 0x0e, 0x06, 0x7b, 0x60, 0x4f, 0xf0, 0xe0, 0x03, 0x08, 0xbf, 0xb0, 0x23, + 0x00, 0x2c, 0x08, 0xbf, 0x0b, 0x26, 0x02, 0x98, 0x00, 0x28, 0x08, 0xbf, + 0x0a, 0x26, 0x33, 0x44, 0x3b, 0x60, 0x4f, 0xf4, 0x4c, 0x53, 0x00, 0x2c, + 0x4e, 0x69, 0x08, 0xbf, 0x4f, 0xf4, 0x4c, 0x43, 0x3b, 0x62, 0x00, 0x27, + 0x13, 0x68, 0x43, 0xf4, 0x40, 0x53, 0x13, 0x60, 0xde, 0xf8, 0x00, 0x20, + 0xcd, 0xf8, 0x0c, 0xe0, 0x42, 0xf0, 0x10, 0x02, 0xce, 0xf8, 0x00, 0x20, + 0x03, 0x99, 0x08, 0x68, 0x20, 0xf0, 0x0f, 0x00, 0x38, 0x43, 0x08, 0x60, + 0x30, 0x68, 0x40, 0xf4, 0x00, 0x30, 0x30, 0x60, 0xda, 0xf8, 0x00, 0x00, + 0x40, 0x00, 0x13, 0xd4, 0x01, 0x20, 0x80, 0x46, 0xb5, 0xf8, 0x98, 0x00, + 0xa8, 0xf1, 0x01, 0x01, 0x89, 0xb2, 0x81, 0x42, 0x0c, 0xd2, 0xb9, 0xf8, + 0x00, 0x00, 0x02, 0x38, 0xd8, 0x47, 0xda, 0xf8, 0x00, 0x10, 0x08, 0xf1, + 0x01, 0x00, 0x49, 0x00, 0xed, 0xd5, 0x01, 0xe0, 0x4f, 0xf0, 0x00, 0x08, + 0xb5, 0xf8, 0x98, 0x00, 0x1f, 0xfa, 0x88, 0xf1, 0x81, 0x42, 0x30, 0xd2, + 0x42, 0x4a, 0x43, 0x4b, 0x04, 0x24, 0x11, 0x78, 0x5c, 0x54, 0x01, 0x31, + 0x11, 0x70, 0xc9, 0xb2, 0xff, 0x29, 0x04, 0xbf, 0x00, 0x21, 0x11, 0x70, + 0xb9, 0xf8, 0x00, 0x10, 0x48, 0x43, 0x02, 0x38, 0xd8, 0x47, 0xda, 0xf8, + 0x00, 0x00, 0x42, 0x4b, 0xc0, 0xf3, 0x46, 0x50, 0xda, 0xf8, 0x00, 0x10, + 0xc1, 0xf3, 0x04, 0x41, 0x02, 0x9a, 0x00, 0x2a, 0x04, 0x9a, 0x02, 0xeb, + 0x82, 0x02, 0x03, 0xeb, 0x02, 0x12, 0x1d, 0xbf, 0x02, 0xeb, 0x87, 0x02, + 0xd1, 0x63, 0x90, 0x62, 0x42, 0xf8, 0x27, 0x00, 0x04, 0xbf, 0x02, 0xeb, + 0x87, 0x00, 0x41, 0x61, 0x01, 0x37, 0x05, 0x2f, 0xa6, 0xd1, 0x00, 0x24, + 0x0e, 0xe0, 0x03, 0xf0, 0x31, 0xf8, 0x29, 0x49, 0x29, 0x4a, 0x05, 0x23, + 0x08, 0x78, 0x13, 0x54, 0x01, 0x30, 0x08, 0x70, 0xc0, 0xb2, 0xff, 0x28, + 0x01, 0xd1, 0x00, 0x20, 0x08, 0x70, 0x01, 0x24, 0xdf, 0xf8, 0x90, 0x80, + 0x27, 0x4e, 0x04, 0x98, 0x01, 0x30, 0x02, 0x28, 0x04, 0x90, 0x7f, 0xf4, + 0x35, 0xaf, 0x02, 0x98, 0x01, 0x30, 0x02, 0x28, 0x02, 0x90, 0x7f, 0xf4, + 0x2d, 0xaf, 0x14, 0xb9, 0x24, 0x48, 0x00, 0x68, 0x80, 0x47, 0x24, 0x4e, + 0x30, 0x78, 0xff, 0x28, 0x01, 0xd0, 0x0d, 0x28, 0x13, 0xd1, 0x22, 0x48, + 0x01, 0x68, 0xa0, 0x20, 0x88, 0x47, 0x70, 0xb1, 0x1c, 0x4a, 0xa0, 0x21, + 0xa0, 0x23, 0x05, 0x46, 0xc7, 0xf7, 0xee, 0xfc, 0x1d, 0x48, 0x29, 0x46, + 0xa0, 0x22, 0x03, 0x68, 0x30, 0x78, 0x98, 0x47, 0x28, 0x46, 0xcd, 0xf7, + 0x53, 0xfb, 0x11, 0x49, 0x00, 0x20, 0x48, 0x60, 0x08, 0x60, 0x08, 0x62, + 0x05, 0xa9, 0x01, 0x30, 0x58, 0xf8, 0x04, 0x2b, 0x08, 0xc9, 0x0c, 0x28, + 0x13, 0x60, 0xf8, 0xd1, 0x08, 0x49, 0x08, 0x68, 0x40, 0xf0, 0x00, 0x70, + 0x08, 0x60, 0x20, 0x46, 0x11, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0x00, 0xbf, + 0x00, 0x69, 0x08, 0x00, 0xcc, 0x20, 0x06, 0x00, 0xcd, 0x20, 0x06, 0x00, + 0xe8, 0xa2, 0x05, 0x00, 0x80, 0x54, 0x05, 0x30, 0x00, 0x00, 0xc0, 0x7f, + 0x54, 0xc0, 0x05, 0x30, 0x84, 0x9a, 0x08, 0x00, 0x34, 0xec, 0x01, 0x00, + 0x40, 0xec, 0x01, 0x00, 0xb8, 0xe1, 0x01, 0x00, 0x90, 0xbd, 0x08, 0x00, + 0x64, 0x8d, 0x08, 0x00, 0xd4, 0x9b, 0x08, 0x00, 0xe4, 0x9b, 0x08, 0x00, + 0x95, 0x49, 0x89, 0x79, 0x21, 0xb1, 0x03, 0x49, 0x0a, 0x68, 0x42, 0xf4, + 0x80, 0x62, 0x0a, 0x60, 0x00, 0xf0, 0xca, 0xbd, 0x54, 0xd7, 0x01, 0x00, + 0x2d, 0xe9, 0xf0, 0x47, 0x8e, 0x48, 0x90, 0xf8, 0x05, 0x90, 0xb9, 0xf1, + 0x01, 0x0f, 0x0c, 0xd0, 0xb9, 0xf1, 0x00, 0x0f, 0x40, 0xf0, 0x0d, 0x81, + 0x8b, 0x4b, 0x41, 0xf2, 0xb0, 0x31, 0x03, 0xeb, 0x01, 0x08, 0x41, 0xf2, + 0xec, 0x11, 0x5e, 0x18, 0x02, 0xe0, 0x86, 0x4e, 0x4f, 0xf0, 0x00, 0x08, + 0xdf, 0xf8, 0x14, 0xc2, 0x86, 0x4d, 0x85, 0x4a, 0x9c, 0xf8, 0xc6, 0x12, + 0x0c, 0xf5, 0x31, 0x7e, 0xaa, 0x46, 0x09, 0x07, 0x06, 0xd4, 0xb9, 0xf1, + 0x01, 0x0f, 0x3b, 0xd0, 0xb9, 0xf1, 0x00, 0x0f, 0x2f, 0xd0, 0x3b, 0xe0, + 0x05, 0xf5, 0x18, 0x77, 0x00, 0x23, 0x5c, 0x1c, 0x10, 0x46, 0xb9, 0xf1, + 0x00, 0x0f, 0x36, 0xf8, 0x14, 0x10, 0x02, 0xea, 0x01, 0x41, 0x36, 0xf8, + 0x13, 0x20, 0x6f, 0xf3, 0x9f, 0x32, 0x11, 0x44, 0x29, 0x60, 0x09, 0xd1, + 0x38, 0xf8, 0x14, 0x10, 0x38, 0xf8, 0x13, 0x20, 0x00, 0xea, 0x01, 0x41, + 0x6f, 0xf3, 0x9f, 0x32, 0x11, 0x44, 0x02, 0xc7, 0x99, 0x1c, 0x02, 0x46, + 0x04, 0x35, 0xcb, 0xb2, 0x42, 0x2b, 0xe0, 0xd3, 0xb6, 0xf8, 0x84, 0x10, + 0xb9, 0xf1, 0x01, 0x0f, 0x29, 0x60, 0x11, 0xd0, 0xb9, 0xf1, 0x00, 0x0f, + 0x55, 0x46, 0x0f, 0xd1, 0xb8, 0xf8, 0x84, 0x10, 0x39, 0x60, 0x41, 0xf2, + 0x36, 0x41, 0x0c, 0xeb, 0x01, 0x08, 0x41, 0xf2, 0x72, 0x21, 0x0c, 0xeb, + 0x01, 0x06, 0x03, 0xe0, 0x63, 0x4e, 0x01, 0xe0, 0x62, 0x4e, 0x55, 0x46, + 0xde, 0xf8, 0x00, 0x30, 0xd9, 0x02, 0x03, 0xd4, 0xb9, 0xf1, 0x00, 0x0f, + 0x6e, 0xd1, 0x2f, 0xe0, 0x05, 0xf5, 0x3a, 0x77, 0x05, 0xf1, 0x88, 0x03, + 0x00, 0x25, 0x6c, 0x1c, 0x10, 0x46, 0xb9, 0xf1, 0x00, 0x0f, 0x36, 0xf8, + 0x14, 0x10, 0x02, 0xea, 0x01, 0x41, 0x36, 0xf8, 0x15, 0x20, 0x6f, 0xf3, + 0x9f, 0x32, 0x11, 0x44, 0x19, 0x60, 0x09, 0xd1, 0x38, 0xf8, 0x14, 0x10, + 0x38, 0xf8, 0x15, 0x20, 0x00, 0xea, 0x01, 0x41, 0x6f, 0xf3, 0x9f, 0x32, + 0x11, 0x44, 0x02, 0xc7, 0xa9, 0x1c, 0x02, 0x46, 0x04, 0x33, 0xcd, 0xb2, + 0x42, 0x2d, 0xe0, 0xd3, 0xb6, 0xf8, 0x84, 0x10, 0xb9, 0xf1, 0x00, 0x0f, + 0x19, 0x60, 0x42, 0xd1, 0xb8, 0xf8, 0x84, 0x10, 0x55, 0x46, 0x39, 0x60, + 0xde, 0xf8, 0x00, 0x30, 0x99, 0x02, 0x41, 0xd5, 0x28, 0x46, 0x14, 0x46, + 0x41, 0xf2, 0xbe, 0x41, 0x6f, 0xf0, 0x01, 0x06, 0x00, 0xf5, 0x5c, 0x72, + 0x00, 0xf5, 0x88, 0x73, 0x40, 0x48, 0x0c, 0xeb, 0x01, 0x05, 0x80, 0x46, + 0x3f, 0x48, 0x41, 0x46, 0x07, 0x46, 0x02, 0x36, 0x35, 0xf8, 0x08, 0x10, + 0x2f, 0x5a, 0x3a, 0x2e, 0x04, 0xea, 0x01, 0x41, 0x6f, 0xf3, 0x9f, 0x37, + 0x39, 0x44, 0x02, 0xc3, 0x29, 0x88, 0x35, 0xf8, 0x02, 0x7c, 0x05, 0xf1, + 0x04, 0x05, 0x04, 0xea, 0x01, 0x41, 0x6f, 0xf3, 0x9f, 0x37, 0x39, 0x44, + 0x02, 0xc2, 0xe6, 0xd3, 0x41, 0xf2, 0x70, 0x31, 0x3c, 0xf8, 0x01, 0x10, + 0x19, 0x60, 0x41, 0xf2, 0x34, 0x51, 0x3c, 0xf8, 0x01, 0x10, 0x11, 0x60, + 0x41, 0xf2, 0xbc, 0x41, 0x22, 0x46, 0x0c, 0xeb, 0x01, 0x08, 0x41, 0xf2, + 0xf8, 0x21, 0x0c, 0xeb, 0x01, 0x06, 0x55, 0x46, 0xb9, 0xf1, 0x01, 0x0f, + 0x0b, 0xd0, 0xb9, 0xf1, 0x00, 0x0f, 0x09, 0xd1, 0x41, 0xf2, 0x36, 0x51, + 0x0c, 0xeb, 0x01, 0x08, 0x41, 0xf2, 0x72, 0x31, 0x0c, 0xeb, 0x01, 0x06, + 0x00, 0xe0, 0x22, 0x4e, 0x9e, 0xf8, 0x02, 0x10, 0x49, 0x06, 0x28, 0xd5, + 0x05, 0xf5, 0x7b, 0x74, 0x05, 0xf5, 0xc6, 0x73, 0x00, 0x25, 0x6f, 0x1c, + 0x10, 0x46, 0xb9, 0xf1, 0x00, 0x0f, 0x36, 0xf8, 0x17, 0x10, 0x02, 0xea, + 0x01, 0x41, 0x36, 0xf8, 0x15, 0x20, 0x6f, 0xf3, 0x9f, 0x32, 0x11, 0x44, + 0x19, 0x60, 0x09, 0xd1, 0x38, 0xf8, 0x17, 0x10, 0x38, 0xf8, 0x15, 0x20, + 0x00, 0xea, 0x01, 0x41, 0x6f, 0xf3, 0x9f, 0x32, 0x11, 0x44, 0x02, 0xc4, + 0xa9, 0x1c, 0x02, 0x46, 0x04, 0x33, 0xcd, 0xb2, 0x1e, 0x2d, 0xe0, 0xd3, + 0xb1, 0x8f, 0xb9, 0xf1, 0x00, 0x0f, 0x19, 0x60, 0x01, 0xd0, 0xbd, 0xe8, + 0xf0, 0x87, 0xb8, 0xf8, 0x3c, 0x00, 0x20, 0x60, 0xbd, 0xe8, 0xf0, 0x87, + 0x48, 0xdc, 0x05, 0x00, 0xb8, 0x2f, 0x06, 0x00, 0x00, 0x69, 0x08, 0x00, + 0x00, 0x00, 0xff, 0x3f, 0x00, 0xe1, 0x00, 0x40, 0x3e, 0x30, 0x06, 0x00, + 0x3c, 0xfe, 0xff, 0xff, 0x3a, 0xfe, 0xff, 0xff, 0xc4, 0x30, 0x06, 0x00, + 0xb0, 0xb5, 0x0d, 0x4a, 0x58, 0xb1, 0x0d, 0x4d, 0xd2, 0xf8, 0x00, 0x34, + 0x40, 0xf2, 0xf3, 0x34, 0x2d, 0x68, 0xa3, 0x43, 0x2c, 0x40, 0x23, 0x44, + 0xc2, 0xf8, 0x00, 0x34, 0x08, 0xe0, 0x07, 0x4d, 0x13, 0x68, 0x40, 0xf2, + 0xf3, 0x34, 0x2d, 0x68, 0xa3, 0x43, 0x2c, 0x40, 0x23, 0x44, 0x13, 0x60, + 0xbd, 0xe8, 0xb0, 0x40, 0x00, 0xf0, 0x80, 0xbc, 0x28, 0xf5, 0x03, 0x40, + 0x94, 0x1f, 0x06, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x87, 0xb0, 0x03, 0x2a, + 0x01, 0xd9, 0x00, 0x20, 0xe5, 0xe0, 0x0d, 0x46, 0x73, 0x49, 0x14, 0x46, + 0x0a, 0x68, 0x22, 0xf0, 0x01, 0x02, 0x0a, 0x60, 0x71, 0x49, 0x0a, 0x68, + 0x02, 0x21, 0x90, 0x47, 0x70, 0x49, 0x5d, 0xb1, 0x0a, 0x68, 0x00, 0xf4, + 0xfc, 0x52, 0x42, 0xea, 0x00, 0x40, 0x08, 0x60, 0x08, 0x69, 0x40, 0xf4, + 0x00, 0x40, 0x20, 0xf0, 0x80, 0x00, 0x06, 0xe0, 0x0a, 0x68, 0x08, 0x60, + 0x08, 0x69, 0x48, 0xf2, 0x80, 0x02, 0x90, 0x43, 0x80, 0x30, 0x67, 0x4d, + 0x08, 0x61, 0x00, 0x26, 0x40, 0xf2, 0xff, 0x30, 0xee, 0x4f, 0xdf, 0xf8, + 0x98, 0xa1, 0x02, 0x21, 0xc5, 0xf8, 0xb4, 0x60, 0xc5, 0xf8, 0xc4, 0x60, + 0x2e, 0x60, 0x2e, 0x65, 0xc5, 0xf8, 0xb0, 0x00, 0x5f, 0x48, 0xc5, 0xf8, + 0xc0, 0x00, 0x38, 0x78, 0x00, 0xeb, 0x80, 0x00, 0x0a, 0xeb, 0x40, 0x10, + 0x80, 0xf8, 0x54, 0x10, 0x5c, 0x48, 0xcd, 0xe9, 0x01, 0x00, 0x5c, 0x48, + 0x01, 0x68, 0x01, 0xa8, 0x88, 0x47, 0x38, 0x78, 0xdf, 0xf8, 0x68, 0x81, + 0x4f, 0xf0, 0x5c, 0x09, 0x01, 0x99, 0x10, 0xfb, 0x09, 0x80, 0x81, 0x60, + 0xc5, 0xf8, 0xcc, 0x12, 0x56, 0x48, 0x57, 0x49, 0xc5, 0xf8, 0xac, 0x62, + 0x00, 0x5d, 0x09, 0x68, 0x88, 0x47, 0x55, 0x48, 0x00, 0x21, 0x00, 0x22, + 0x06, 0x23, 0x00, 0x96, 0x4f, 0xf0, 0x06, 0x0b, 0x04, 0x68, 0x02, 0x20, + 0xa0, 0x47, 0x51, 0x4c, 0x51, 0x4a, 0x06, 0x21, 0x06, 0x23, 0x20, 0x68, + 0x00, 0xf2, 0x3f, 0x10, 0xc7, 0xf7, 0xe4, 0xfa, 0x38, 0x78, 0x23, 0x68, + 0x00, 0xeb, 0x80, 0x00, 0x03, 0xf2, 0x3f, 0x13, 0x0a, 0xeb, 0x40, 0x10, + 0x90, 0xf8, 0x54, 0x10, 0x50, 0xf8, 0x21, 0x20, 0x6b, 0xf3, 0x9f, 0x52, + 0x40, 0xf8, 0x21, 0x20, 0x90, 0xf8, 0x54, 0x10, 0x4a, 0x1c, 0x80, 0xf8, + 0x54, 0x20, 0x50, 0xf8, 0x21, 0x20, 0x63, 0xf3, 0x15, 0x02, 0x40, 0xf8, + 0x21, 0x20, 0xd5, 0xf8, 0xd0, 0x02, 0x20, 0xf4, 0x7c, 0x50, 0xc5, 0xf8, + 0xd0, 0x02, 0x38, 0x78, 0x00, 0xeb, 0x80, 0x00, 0x0a, 0xeb, 0x40, 0x10, + 0x90, 0xf8, 0x54, 0x10, 0x50, 0xf8, 0x21, 0x20, 0x6f, 0xf3, 0x9f, 0x52, + 0x40, 0xf8, 0x21, 0x20, 0x90, 0xf8, 0x54, 0x10, 0x50, 0xf8, 0x21, 0x20, + 0x6f, 0xf3, 0x15, 0x02, 0x40, 0xf8, 0x21, 0x20, 0x90, 0xf8, 0x54, 0x00, + 0x0e, 0x28, 0x04, 0xd3, 0x00, 0x20, 0x40, 0xf2, 0x3e, 0x51, 0xc7, 0xf7, + 0x93, 0xfa, 0x2f, 0x49, 0x6e, 0x60, 0x6e, 0x65, 0xae, 0x60, 0xae, 0x65, + 0x2e, 0x4c, 0x38, 0x78, 0x0a, 0x78, 0x4b, 0x78, 0x89, 0x78, 0x10, 0xfb, + 0x09, 0x80, 0x42, 0xea, 0x03, 0x22, 0x42, 0xea, 0x01, 0x41, 0x2a, 0x4a, + 0x41, 0x60, 0x4f, 0xf0, 0x01, 0x10, 0x69, 0x61, 0x28, 0x60, 0x57, 0x1c, + 0xd5, 0xf8, 0xbc, 0x10, 0xd5, 0xf8, 0xcc, 0x00, 0x49, 0x00, 0x04, 0xd5, + 0x00, 0xf4, 0xa0, 0x40, 0xb0, 0xf5, 0xa0, 0x4f, 0x0f, 0xd0, 0x20, 0x88, + 0x02, 0x38, 0xb8, 0x47, 0xd5, 0xf8, 0xbc, 0x10, 0x01, 0x36, 0xd5, 0xf8, + 0xcc, 0x00, 0xb6, 0xf5, 0xfa, 0x7f, 0xed, 0xd1, 0x19, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x00, 0x20, 0x03, 0xe0, 0x17, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x01, 0x20, 0x18, 0x49, 0x09, 0x78, 0x31, 0xb9, 0xd5, 0xf8, 0xbc, 0x10, + 0x16, 0x4a, 0x11, 0x60, 0xd5, 0xf8, 0xcc, 0x10, 0x51, 0x60, 0x07, 0xb0, + 0xbd, 0xe8, 0xf0, 0x8f, 0x04, 0x10, 0x00, 0x40, 0x9c, 0xbd, 0x08, 0x00, + 0x40, 0x10, 0x01, 0x40, 0x20, 0x10, 0x21, 0x40, 0xf3, 0xf3, 0xff, 0x1f, + 0xbc, 0x65, 0x01, 0x00, 0xd6, 0xbe, 0x89, 0x8e, 0x18, 0x8f, 0x08, 0x00, + 0x44, 0x4f, 0x01, 0x00, 0x18, 0xa3, 0x05, 0x00, 0xac, 0xb9, 0x08, 0x00, + 0x58, 0xbd, 0x08, 0x00, 0xdc, 0x35, 0x01, 0x00, 0x8e, 0x58, 0x01, 0x00, + 0x08, 0x32, 0x0a, 0x10, 0x18, 0xbb, 0x08, 0x00, 0x34, 0xec, 0x01, 0x00, + 0x40, 0xec, 0x01, 0x00, 0x88, 0x22, 0x06, 0x00, 0xcc, 0x21, 0x06, 0x00, + 0xb0, 0xb5, 0x04, 0x46, 0x68, 0xb1, 0x03, 0x2c, 0x0b, 0xd0, 0x01, 0x2c, + 0x14, 0xd1, 0x38, 0x48, 0x00, 0x68, 0x80, 0x47, 0x32, 0x48, 0x00, 0x68, + 0x80, 0x47, 0x32, 0x48, 0x00, 0x68, 0x80, 0x47, 0x0a, 0xe0, 0x2f, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x2e, 0x48, 0x00, 0x68, 0x80, 0x47, 0x2c, 0xb1, + 0x03, 0x2c, 0x01, 0xd1, 0x00, 0x25, 0x02, 0xe0, 0x00, 0x25, 0x0a, 0xe0, + 0x01, 0x25, 0x2a, 0x48, 0x00, 0x68, 0x80, 0x47, 0xa9, 0x48, 0x29, 0x49, + 0x90, 0xf8, 0xc4, 0x02, 0x00, 0xf0, 0x04, 0x00, 0x08, 0x70, 0x28, 0x48, + 0x00, 0x78, 0x10, 0xb1, 0x27, 0x48, 0x01, 0x21, 0x01, 0x70, 0xa3, 0x48, + 0x90, 0xf8, 0xf6, 0x0e, 0xc0, 0x07, 0x09, 0xd0, 0x2d, 0xb9, 0x03, 0x2c, + 0x03, 0xd0, 0x22, 0x48, 0x00, 0x78, 0x01, 0x28, 0x08, 0xd1, 0x21, 0x48, + 0x00, 0x68, 0x80, 0x47, 0x03, 0x2c, 0x03, 0xd1, 0x1f, 0x48, 0x01, 0x68, + 0x00, 0x20, 0x88, 0x47, 0x1e, 0x48, 0xf4, 0x30, 0x10, 0xf8, 0x0e, 0x1f, + 0x21, 0xb3, 0x1d, 0x49, 0x42, 0x78, 0x0b, 0x68, 0x23, 0xf0, 0xff, 0x03, + 0x1a, 0x44, 0x0a, 0x60, 0x02, 0x89, 0x43, 0x88, 0x4d, 0x68, 0x43, 0xea, + 0x02, 0x43, 0x18, 0x4a, 0x03, 0xea, 0x02, 0x04, 0x17, 0x4b, 0x1d, 0x40, + 0x2c, 0x44, 0x4c, 0x60, 0x44, 0x89, 0x85, 0x88, 0x45, 0xea, 0x04, 0x44, + 0x8d, 0x68, 0x14, 0x40, 0x1d, 0x40, 0x2c, 0x44, 0x8c, 0x60, 0x84, 0x89, + 0xc0, 0x88, 0x40, 0xea, 0x04, 0x40, 0x10, 0x40, 0xca, 0x68, 0x1a, 0x40, + 0x10, 0x44, 0xc8, 0x60, 0xb0, 0xbd, 0x00, 0xbf, 0x24, 0xbc, 0x08, 0x00, + 0x30, 0xbc, 0x08, 0x00, 0x3c, 0xbc, 0x08, 0x00, 0xa7, 0x58, 0x01, 0x00, + 0x38, 0xbc, 0x08, 0x00, 0x64, 0x8d, 0x08, 0x00, 0xa6, 0x58, 0x01, 0x00, + 0x2c, 0xbc, 0x08, 0x00, 0x40, 0xbc, 0x08, 0x00, 0xe8, 0x65, 0x08, 0x00, + 0x50, 0x94, 0x23, 0x40, 0xff, 0x07, 0xff, 0x3f, 0x00, 0xf8, 0x00, 0xc0, + 0x10, 0xb5, 0x75, 0x4a, 0xb2, 0xf8, 0x7c, 0x26, 0xd3, 0x07, 0x36, 0xd0, + 0x2f, 0x4b, 0x5b, 0x78, 0x9b, 0xb3, 0x80, 0x28, 0x14, 0xd1, 0x2e, 0x4b, + 0x2e, 0x4c, 0x1b, 0x78, 0x03, 0xeb, 0x03, 0x13, 0x54, 0xf8, 0x33, 0x30, + 0x63, 0xb1, 0x93, 0xf8, 0x3e, 0x33, 0xdb, 0x07, 0x08, 0xd0, 0x53, 0x06, + 0x58, 0xbf, 0x5f, 0xea, 0x82, 0x63, 0x03, 0xd5, 0x27, 0x4b, 0x1b, 0x78, + 0x00, 0x2b, 0x41, 0xd0, 0x02, 0x42, 0x01, 0xd1, 0x93, 0x06, 0x02, 0xd5, + 0x23, 0x4b, 0x1b, 0x78, 0x2b, 0xb1, 0x53, 0x05, 0x13, 0xd5, 0x21, 0x4b, + 0x1b, 0x78, 0x01, 0x2b, 0x0f, 0xd1, 0x02, 0x28, 0x1c, 0xd0, 0x04, 0x28, + 0x27, 0xd0, 0x20, 0x28, 0x12, 0xd0, 0x40, 0x28, 0x10, 0xd0, 0xb0, 0xf5, + 0x00, 0x7f, 0x0d, 0xd0, 0xb0, 0xf5, 0x80, 0x7f, 0x26, 0xd0, 0x80, 0x28, + 0x24, 0xd0, 0x1b, 0x4c, 0x00, 0x20, 0x21, 0x68, 0x88, 0x47, 0x21, 0x68, + 0x01, 0x20, 0xbd, 0xe8, 0x10, 0x40, 0x08, 0x47, 0x13, 0x48, 0x02, 0x68, + 0x08, 0x46, 0xbd, 0xe8, 0x10, 0x40, 0x10, 0x47, 0x11, 0x48, 0x00, 0x68, + 0x80, 0x07, 0x04, 0xd0, 0xd0, 0x06, 0x58, 0xbf, 0x5f, 0xea, 0x82, 0x60, + 0x0f, 0xd5, 0x0c, 0x48, 0x01, 0x68, 0x00, 0x20, 0xe9, 0xe7, 0x0c, 0x48, + 0x00, 0x68, 0x80, 0x07, 0x04, 0xd0, 0xd0, 0x06, 0x58, 0xbf, 0x5f, 0xea, + 0x82, 0x60, 0x02, 0xd5, 0x05, 0x48, 0x01, 0x68, 0xdc, 0xe7, 0x10, 0xbd, + 0x3c, 0x88, 0x01, 0x00, 0x74, 0x87, 0x08, 0x00, 0xfc, 0x6d, 0x01, 0x00, + 0x08, 0x72, 0x01, 0x00, 0x6c, 0xe3, 0x08, 0x00, 0x3c, 0x20, 0x21, 0x40, + 0xa4, 0x10, 0x21, 0x40, 0x70, 0xe3, 0x08, 0x00, 0x1f, 0xb5, 0x14, 0x46, + 0x08, 0x9a, 0x02, 0x92, 0x07, 0x9a, 0x01, 0x92, 0x06, 0x9a, 0x00, 0x92, + 0x22, 0x46, 0x00, 0xf0, 0x5f, 0xfa, 0x10, 0xf1, 0x80, 0x01, 0x0b, 0xd1, + 0x06, 0x49, 0x91, 0xf8, 0x3e, 0x16, 0x01, 0x29, 0x06, 0xd1, 0x05, 0x48, + 0x40, 0x79, 0x01, 0x28, 0x18, 0xbf, 0x6f, 0xf0, 0x7f, 0x04, 0x60, 0xb2, + 0x04, 0xb0, 0x10, 0xbd, 0x64, 0xd4, 0x05, 0x00, 0x48, 0xdc, 0x05, 0x00, + 0xf3, 0x48, 0x00, 0x68, 0x00, 0x47, 0x00, 0xbf, 0x80, 0xb5, 0x00, 0xf0, + 0x49, 0xfa, 0x08, 0x48, 0x01, 0x68, 0x21, 0xf0, 0x01, 0x01, 0x01, 0x60, + 0x80, 0xbd, 0x00, 0xbf, 0x80, 0xb5, 0x00, 0xf0, 0x45, 0xfa, 0x03, 0x48, + 0x01, 0x68, 0x41, 0xf0, 0x01, 0x01, 0x01, 0x60, 0x80, 0xbd, 0x00, 0xbf, + 0x08, 0x00, 0x00, 0x40, 0x2d, 0xe9, 0xf0, 0x41, 0x1c, 0x48, 0x90, 0xf8, + 0xf6, 0x1e, 0xc9, 0x07, 0x08, 0xd0, 0xd0, 0xf8, 0x34, 0x02, 0xb0, 0xf1, + 0xff, 0x3f, 0x03, 0xdc, 0x18, 0x48, 0x90, 0xf8, 0x35, 0x10, 0x19, 0xb1, + 0x00, 0x24, 0x20, 0x46, 0xbd, 0xe8, 0xf0, 0x81, 0x15, 0x4e, 0xdf, 0xf8, + 0x58, 0x80, 0x16, 0x4f, 0x00, 0xf1, 0x33, 0x05, 0x28, 0x78, 0x00, 0x28, + 0xf2, 0xd0, 0x30, 0x68, 0x80, 0x47, 0xc0, 0xb9, 0x28, 0x78, 0x69, 0x78, + 0x47, 0x28, 0x03, 0xd3, 0x46, 0x31, 0x46, 0x38, 0x69, 0x70, 0x02, 0xe0, + 0x08, 0x44, 0x68, 0x70, 0x00, 0x20, 0x28, 0x70, 0xd8, 0xf8, 0x00, 0x00, + 0x80, 0x47, 0x00, 0x20, 0x00, 0x24, 0xc8, 0xf7, 0xa9, 0xfa, 0x38, 0x68, + 0x80, 0x47, 0xa8, 0x78, 0x00, 0x28, 0xe1, 0xd0, 0xd7, 0xe7, 0x04, 0x46, + 0xd5, 0xe7, 0x00, 0xbf, 0x00, 0x69, 0x08, 0x00, 0x8c, 0x22, 0x06, 0x00, + 0x84, 0x9a, 0x08, 0x00, 0x34, 0xfc, 0x08, 0x00, 0x60, 0xfd, 0x08, 0x00, + 0x55, 0x48, 0x56, 0x49, 0x01, 0x60, 0x56, 0x48, 0x56, 0x49, 0x01, 0x60, + 0x56, 0x48, 0x57, 0x49, 0x01, 0x60, 0x57, 0x48, 0x57, 0x49, 0x01, 0x60, + 0x57, 0x48, 0x58, 0x49, 0x01, 0x60, 0x58, 0x48, 0x58, 0x49, 0x01, 0x60, + 0x58, 0x48, 0x59, 0x49, 0x01, 0x60, 0x59, 0x48, 0x59, 0x49, 0x01, 0x60, + 0x59, 0x48, 0x5a, 0x49, 0x01, 0x60, 0x5a, 0x48, 0x5a, 0x49, 0x01, 0x60, + 0x5a, 0x48, 0x5b, 0x49, 0x01, 0x60, 0x5b, 0x48, 0x5b, 0x49, 0x01, 0x60, + 0x5b, 0x48, 0x5c, 0x49, 0x01, 0x60, 0x5c, 0x48, 0x5c, 0x49, 0x01, 0x60, + 0x5c, 0x48, 0x5d, 0x49, 0x01, 0x60, 0x5d, 0x48, 0x5d, 0x49, 0x01, 0x60, + 0x5d, 0x48, 0x5e, 0x49, 0x01, 0x60, 0x5e, 0x48, 0x5e, 0x49, 0x01, 0x60, + 0x5e, 0x48, 0x5f, 0x49, 0x01, 0x60, 0x5f, 0x48, 0x5f, 0x49, 0x01, 0x60, + 0x5f, 0x48, 0x60, 0x49, 0x01, 0x60, 0x60, 0x48, 0x60, 0x49, 0x01, 0x60, + 0x60, 0x48, 0x61, 0x49, 0x01, 0x60, 0x61, 0x48, 0x61, 0x49, 0x01, 0x60, + 0x61, 0x48, 0x62, 0x49, 0x01, 0x60, 0x62, 0x48, 0x62, 0x49, 0x01, 0x60, + 0x62, 0x48, 0x63, 0x49, 0x01, 0x60, 0x63, 0x48, 0x63, 0x49, 0x01, 0x60, + 0x63, 0x48, 0x64, 0x49, 0x01, 0x60, 0x64, 0x48, 0x64, 0x49, 0x01, 0x60, + 0x64, 0x48, 0x65, 0x49, 0x01, 0x60, 0x65, 0x48, 0x65, 0x49, 0x01, 0x60, + 0x65, 0x48, 0x66, 0x49, 0x01, 0x60, 0x66, 0x48, 0x66, 0x49, 0x01, 0x60, + 0x66, 0x48, 0x67, 0x49, 0x01, 0x60, 0x67, 0x48, 0x67, 0x49, 0x01, 0x60, + 0x67, 0x48, 0x68, 0x49, 0x01, 0x60, 0x68, 0x48, 0x68, 0x49, 0x01, 0x60, + 0x68, 0x48, 0x69, 0x49, 0x01, 0x60, 0x69, 0x48, 0x69, 0x49, 0x01, 0x60, + 0x69, 0x48, 0x6a, 0x49, 0x01, 0x60, 0x6a, 0x48, 0x6a, 0x49, 0x01, 0x60, + 0x6a, 0x48, 0x6b, 0x49, 0x01, 0x60, 0x6b, 0x48, 0x6b, 0x49, 0x01, 0x60, + 0x6b, 0x48, 0x6c, 0x49, 0x01, 0x60, 0x6c, 0x48, 0x6c, 0x49, 0x01, 0x60, + 0x6c, 0x48, 0x6d, 0x49, 0x01, 0x60, 0x6d, 0x48, 0x6d, 0x49, 0x01, 0x60, + 0x6d, 0x48, 0x6e, 0x49, 0x01, 0x60, 0x6e, 0x48, 0x6e, 0x49, 0x01, 0x60, + 0x6e, 0x48, 0x6f, 0x49, 0x01, 0x60, 0x6f, 0x48, 0x6f, 0x49, 0x01, 0x60, + 0x6f, 0x48, 0x70, 0x49, 0x01, 0x60, 0x70, 0x48, 0x70, 0x49, 0x01, 0x60, + 0x70, 0x48, 0x71, 0x49, 0x01, 0x60, 0x71, 0x48, 0x71, 0x49, 0x01, 0x60, + 0x71, 0x48, 0x72, 0x49, 0x01, 0x60, 0x70, 0x47, 0x50, 0x14, 0x01, 0x00, + 0x85, 0xb0, 0x05, 0x00, 0x88, 0xfd, 0x08, 0x00, 0x21, 0x9e, 0x05, 0x00, + 0x60, 0xfc, 0x08, 0x00, 0xc5, 0x8c, 0x05, 0x00, 0x78, 0xfd, 0x08, 0x00, + 0x2d, 0x44, 0x05, 0x00, 0x14, 0x8e, 0x08, 0x00, 0x55, 0x39, 0x05, 0x00, + 0xa4, 0xca, 0x08, 0x00, 0xc1, 0x45, 0x05, 0x00, 0xe8, 0xfb, 0x08, 0x00, + 0x0d, 0x52, 0x05, 0x00, 0xcc, 0xfd, 0x08, 0x00, 0x4d, 0x54, 0x05, 0x00, + 0xe4, 0xfb, 0x08, 0x00, 0x7d, 0x56, 0x05, 0x00, 0xc0, 0xfd, 0x08, 0x00, + 0x69, 0x5b, 0x05, 0x00, 0x8c, 0xb7, 0x08, 0x00, 0xc9, 0x5b, 0x05, 0x00, + 0xf8, 0xfb, 0x08, 0x00, 0xb5, 0x5b, 0x05, 0x00, 0xa0, 0xbd, 0x08, 0x00, + 0xe5, 0x5c, 0x05, 0x00, 0x3c, 0xfc, 0x08, 0x00, 0xd9, 0x5d, 0x05, 0x00, + 0x98, 0xfe, 0x08, 0x00, 0xfd, 0x5e, 0x05, 0x00, 0x64, 0xfd, 0x08, 0x00, + 0xa9, 0x5f, 0x05, 0x00, 0x6c, 0xa1, 0x08, 0x00, 0xd9, 0x64, 0x05, 0x00, + 0x84, 0xfc, 0x08, 0x00, 0x29, 0x67, 0x05, 0x00, 0x7c, 0xfd, 0x08, 0x00, + 0x69, 0x6a, 0x05, 0x00, 0x80, 0xfe, 0x08, 0x00, 0xc5, 0x43, 0x05, 0x00, + 0xa4, 0xd7, 0x08, 0x00, 0x41, 0x6f, 0x05, 0x00, 0x74, 0xfd, 0x08, 0x00, + 0x69, 0x77, 0x05, 0x00, 0x34, 0xfe, 0x08, 0x00, 0x9d, 0x74, 0x05, 0x00, + 0x2c, 0xfe, 0x08, 0x00, 0x2d, 0x70, 0x05, 0x00, 0xe4, 0xfc, 0x08, 0x00, + 0x41, 0x72, 0x05, 0x00, 0x30, 0xfe, 0x08, 0x00, 0x69, 0x75, 0x05, 0x00, + 0xe0, 0xfd, 0x08, 0x00, 0xfd, 0x80, 0x05, 0x00, 0xd4, 0xfd, 0x08, 0x00, + 0xf1, 0x7d, 0x05, 0x00, 0x8c, 0xfd, 0x08, 0x00, 0x65, 0x81, 0x05, 0x00, + 0xe8, 0xfc, 0x08, 0x00, 0x5d, 0x74, 0x05, 0x00, 0xcc, 0xfc, 0x08, 0x00, + 0x5d, 0x76, 0x05, 0x00, 0x50, 0xfd, 0x08, 0x00, 0xa9, 0x82, 0x05, 0x00, + 0xc8, 0xfd, 0x08, 0x00, 0x15, 0x83, 0x05, 0x00, 0x40, 0xbc, 0x08, 0x00, + 0x11, 0x84, 0x05, 0x00, 0x94, 0xfd, 0x08, 0x00, 0x09, 0x89, 0x05, 0x00, + 0x68, 0xd2, 0x08, 0x00, 0x59, 0x8d, 0x05, 0x00, 0xb8, 0xbd, 0x08, 0x00, + 0x81, 0x69, 0x05, 0x00, 0x50, 0xbc, 0x08, 0x00, 0x39, 0x8e, 0x05, 0x00, + 0xa8, 0xfd, 0x08, 0x00, 0xc5, 0x8f, 0x05, 0x00, 0x98, 0xbd, 0x08, 0x00, + 0x81, 0x90, 0x05, 0x00, 0x90, 0xfe, 0x08, 0x00, 0x95, 0x53, 0x05, 0x00, + 0x18, 0xf4, 0x08, 0x00, 0x09, 0x39, 0x05, 0x00, 0x8c, 0xbd, 0x08, 0x00, + 0xad, 0x91, 0x05, 0x00, 0x28, 0xfe, 0x08, 0x00, 0x95, 0x93, 0x05, 0x00, + 0x88, 0xcd, 0x08, 0x00, 0xb1, 0x93, 0x05, 0x00, 0x84, 0xfd, 0x08, 0x00, + 0x01, 0x94, 0x05, 0x00, 0x88, 0xe9, 0x08, 0x00, 0xc1, 0x96, 0x05, 0x00, + 0x84, 0xfe, 0x08, 0x00, 0xd9, 0x96, 0x05, 0x00, 0x88, 0xbd, 0x08, 0x00, + 0x3d, 0x99, 0x05, 0x00, 0xfc, 0xfb, 0x08, 0x00, 0x7d, 0x99, 0x05, 0x00, + 0xa4, 0xfe, 0x08, 0x00, 0xad, 0x9b, 0x05, 0x00, 0xf8, 0xb9, 0x08, 0x00, + 0xc1, 0x9c, 0x05, 0x00, 0x1c, 0xb8, 0x08, 0x00, 0xad, 0x9d, 0x05, 0x00, + 0xa0, 0xd7, 0x08, 0x00, 0x11, 0x68, 0x05, 0x00, 0x70, 0xa1, 0x08, 0x00, + 0xed, 0x9d, 0x05, 0x00, 0x00, 0xfe, 0x08, 0x00, 0xf5, 0x9d, 0x05, 0x00, + 0x04, 0xfe, 0x08, 0x00, 0x09, 0x9e, 0x05, 0x00, 0x48, 0xf6, 0x7b, 0x7c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4a, 0xf2, 0x77, 0x3c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf6, 0xb5, 0x7c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4e, 0xf6, 0x41, 0x1c, + 0xc1, 0xf2, 0x0f, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf6, 0x7d, 0x4c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf6, 0xfd, 0x1c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf2, 0x59, 0x5c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4a, 0xf6, 0xe5, 0x4c, + 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4d, 0xf6, 0x27, 0x5c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4b, 0xf6, 0x45, 0x0c, + 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4f, 0xf6, 0x97, 0x5c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4a, 0xf6, 0x5d, 0x2c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x4a, 0xf2, 0x2d, 0x0c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x47, 0xf6, 0x95, 0x6c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf6, 0xe9, 0x5c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf6, 0xcb, 0x5c, + 0xc1, 0xf2, 0x00, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf2, 0x1d, 0x2c, + 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x40, 0xf2, 0xc5, 0x1c, + 0xc1, 0xf2, 0x01, 0x0c, 0x60, 0x47, 0xfe, 0xde, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, + 0x50, 0x46, 0x41, 0x4c, 0x5f, 0x52, 0x4d, 0x5f, 0x48, 0x57, 0x5f, 0x57, + 0x72, 0x69, 0x74, 0x65, 0x5f, 0x54, 0x65, 0x6d, 0x70, 0x43, 0x61, 0x6c, + 0x5f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x20, + 0x77, 0x72, 0x6f, 0x6e, 0x67, 0x20, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, + 0x00, 0x00, 0x00, 0x00, 0xe4, 0x50, 0x05, 0x30, 0xcc, 0x50, 0x05, 0x30, + 0x98, 0x50, 0x05, 0x30, 0x1c, 0xdc, 0x05, 0x30, 0x44, 0x50, 0x05, 0x30, + 0x80, 0x50, 0x05, 0x30, 0xe4, 0x54, 0x05, 0x30, 0xcc, 0x54, 0x05, 0x30, + 0x98, 0x54, 0x05, 0x30, 0x1c, 0xf4, 0x05, 0x30, 0x44, 0x54, 0x05, 0x30, + 0x80, 0x54, 0x05, 0x30, 0x25, 0x26, 0x27, 0x00, 0x2d, 0xe9, 0xf8, 0x43, + 0x37, 0x4a, 0x00, 0x26, 0x8a, 0x4c, 0x8c, 0x4d, 0x72, 0xb6, 0x27, 0x18, + 0x11, 0x68, 0x49, 0x00, 0x01, 0x31, 0x11, 0x60, 0x8a, 0x49, 0x0b, 0x18, + 0x93, 0xf8, 0xa0, 0x10, 0x83, 0xf8, 0xa0, 0x60, 0x93, 0xf8, 0xa2, 0xe0, + 0x13, 0x68, 0x5b, 0x08, 0x13, 0x60, 0x97, 0xf8, 0xb8, 0x32, 0x97, 0xf8, + 0xbc, 0x92, 0x94, 0xf8, 0xc2, 0xc2, 0x94, 0xf8, 0xc5, 0x82, 0x12, 0x68, + 0x82, 0xf3, 0x10, 0x88, 0x07, 0xf5, 0x2f, 0x72, 0x2d, 0x79, 0xab, 0x42, + 0x07, 0xd3, 0x0b, 0x2b, 0x05, 0xd8, 0x21, 0xb1, 0x11, 0x78, 0x02, 0x29, + 0x01, 0xd3, 0x51, 0x29, 0x08, 0xd3, 0x07, 0xf5, 0x2e, 0x70, 0x16, 0x70, + 0x87, 0xf8, 0xc0, 0x62, 0x06, 0x70, 0x00, 0x20, 0xbd, 0xe8, 0xf8, 0x83, + 0x1d, 0x49, 0xa9, 0xf1, 0x02, 0x02, 0x14, 0x25, 0xde, 0x1f, 0xb2, 0xfb, + 0xf5, 0xf2, 0x01, 0xeb, 0x80, 0x01, 0x89, 0x56, 0xd2, 0x4a, 0x02, 0xeb, + 0x00, 0x22, 0x00, 0xeb, 0x80, 0x00, 0x12, 0xf8, 0x0e, 0x20, 0x11, 0x44, + 0x15, 0x4a, 0x02, 0x44, 0x32, 0x44, 0x92, 0xf9, 0xd8, 0x20, 0x89, 0x18, + 0x03, 0xd4, 0xff, 0x29, 0xa8, 0xbf, 0xff, 0x21, 0x00, 0xe0, 0x00, 0x21, + 0xc6, 0x4a, 0x02, 0xeb, 0x40, 0x00, 0x0c, 0xeb, 0x8c, 0x02, 0x10, 0x44, + 0x80, 0x57, 0x01, 0xeb, 0x40, 0x00, 0x0c, 0x49, 0x0a, 0x68, 0x09, 0x21, + 0x90, 0x47, 0x0b, 0x49, 0x89, 0x5d, 0x40, 0x1a, 0x94, 0xf9, 0xbe, 0x12, + 0x41, 0xfa, 0x88, 0xf1, 0x00, 0xeb, 0x41, 0x00, 0x5d, 0x49, 0x0a, 0x68, + 0x01, 0x21, 0xbd, 0xe8, 0xf8, 0x43, 0x10, 0x47, 0x24, 0x36, 0x01, 0x00, + 0x05, 0x13, 0x01, 0x00, 0x00, 0x2d, 0x06, 0x00, 0xd8, 0xfb, 0x08, 0x00, + 0x44, 0x14, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, 0xdf, 0xf8, 0x34, 0x91, + 0x04, 0x46, 0x21, 0x46, 0x09, 0xeb, 0x00, 0x07, 0x97, 0xf8, 0xb8, 0x52, + 0x28, 0x46, 0x00, 0xf0, 0xa1, 0xf8, 0x78, 0xb3, 0xdf, 0xf8, 0x20, 0x81, + 0x45, 0x20, 0xd8, 0xf8, 0x00, 0x10, 0x88, 0x47, 0xdf, 0xf8, 0x18, 0xa1, + 0x9a, 0xf8, 0x09, 0x00, 0x10, 0xb1, 0x45, 0x48, 0x00, 0x68, 0x80, 0x47, + 0x6d, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x97, 0xf8, 0xbc, 0x12, + 0x00, 0x29, 0x72, 0xd0, 0x02, 0x39, 0x0a, 0x22, 0x91, 0xfb, 0xf2, 0xf1, + 0x3e, 0x4a, 0x02, 0xeb, 0x45, 0x12, 0x02, 0xeb, 0x04, 0x1b, 0x0b, 0xeb, + 0x41, 0x01, 0xa1, 0xf1, 0xe0, 0x06, 0xb9, 0xf8, 0xca, 0x12, 0xc9, 0x07, + 0x0a, 0xd1, 0x76, 0x49, 0x38, 0x4f, 0x8a, 0x78, 0xcb, 0x78, 0xb6, 0xf9, + 0x00, 0x10, 0x3f, 0x68, 0xb8, 0x47, 0x02, 0xe0, 0xbd, 0xe8, 0xf8, 0x8f, + 0x40, 0x00, 0x30, 0x80, 0xf9, 0xf7, 0x20, 0xfa, 0x28, 0xb1, 0x32, 0x48, + 0x90, 0xf8, 0xe4, 0x02, 0x00, 0xf0, 0x0f, 0x06, 0x02, 0xe0, 0x0a, 0xeb, + 0x04, 0x00, 0x46, 0x7b, 0xab, 0xf1, 0xe0, 0x02, 0x00, 0x21, 0x00, 0x23, + 0x00, 0x20, 0x32, 0xf8, 0x02, 0x7b, 0x01, 0x33, 0x00, 0x2f, 0x18, 0xbf, + 0x01, 0x31, 0x00, 0xfa, 0x87, 0xf0, 0x08, 0x2b, 0xf5, 0xd1, 0x09, 0xb1, + 0x90, 0xfb, 0xf1, 0xf0, 0x25, 0x49, 0x0a, 0x68, 0x01, 0x21, 0x90, 0x47, + 0xe9, 0x49, 0x08, 0x60, 0x09, 0xeb, 0x45, 0x01, 0x21, 0x44, 0x91, 0xf8, + 0x94, 0x12, 0x01, 0x29, 0x0b, 0xd1, 0xe6, 0x49, 0x91, 0xf8, 0x0f, 0x13, + 0x88, 0x42, 0x0d, 0xda, 0x4a, 0x42, 0x00, 0x21, 0x90, 0x42, 0xd8, 0xbf, + 0x4f, 0xf0, 0xff, 0x31, 0x07, 0xe0, 0x40, 0x49, 0x22, 0x46, 0x33, 0x46, + 0x0f, 0x68, 0x29, 0x46, 0xb8, 0x47, 0x16, 0xe0, 0x01, 0x21, 0x05, 0xeb, + 0x85, 0x00, 0x04, 0xeb, 0x84, 0x02, 0x09, 0xeb, 0x80, 0x00, 0x00, 0xeb, + 0x42, 0x00, 0x30, 0x44, 0x90, 0xf9, 0x54, 0x21, 0x11, 0x44, 0x7f, 0x29, + 0x01, 0xdd, 0x7f, 0x21, 0x04, 0xe0, 0x11, 0xf1, 0x80, 0x0f, 0xd8, 0xbf, + 0x6f, 0xf0, 0x7f, 0x01, 0x01, 0x75, 0xd8, 0xf8, 0x00, 0x10, 0x46, 0x20, + 0xbd, 0xe8, 0xf8, 0x4f, 0x08, 0x47, 0x00, 0xbf, 0x98, 0xca, 0x01, 0x00, + 0x00, 0x9d, 0x08, 0x00, 0xf0, 0xd1, 0x01, 0x00, 0xf0, 0xfb, 0x08, 0x00, + 0xd8, 0x21, 0x06, 0x00, 0x10, 0xfc, 0x08, 0x00, 0x00, 0x69, 0x08, 0x00, + 0xd4, 0xfb, 0x08, 0x00, 0x23, 0x4a, 0x12, 0x79, 0x82, 0x42, 0x16, 0xdc, + 0x0b, 0x28, 0x14, 0xd8, 0x0b, 0x4a, 0x11, 0x44, 0x91, 0xf8, 0xb4, 0x12, + 0x01, 0x29, 0x0e, 0xd1, 0x6f, 0xf0, 0x0d, 0x01, 0x01, 0xeb, 0x40, 0x00, + 0xbd, 0x49, 0xb1, 0xf8, 0xde, 0x12, 0x21, 0xfa, 0x00, 0xf0, 0x01, 0x21, + 0x00, 0xf0, 0x02, 0x00, 0x81, 0xea, 0x50, 0x00, 0x70, 0x47, 0x00, 0x20, + 0x70, 0x47, 0x00, 0xbf, 0x98, 0xca, 0x01, 0x00, 0xf8, 0xb5, 0x05, 0x46, + 0xf1, 0x48, 0x47, 0x18, 0x97, 0xf8, 0xb4, 0x02, 0x01, 0x28, 0x1d, 0xd1, + 0x0f, 0x4e, 0x0c, 0x46, 0x70, 0x7a, 0x10, 0xb1, 0xeb, 0x48, 0x00, 0x68, + 0x80, 0x47, 0xac, 0x48, 0x21, 0x46, 0x02, 0x68, 0x01, 0x20, 0x90, 0x47, + 0x0a, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x97, 0xf8, 0xbc, 0x12, + 0x51, 0xb1, 0x31, 0x19, 0x22, 0x46, 0x4b, 0x7b, 0x06, 0x49, 0xd1, 0xf8, + 0x00, 0xc0, 0x29, 0x46, 0x01, 0xb0, 0xbd, 0xe8, 0xf0, 0x40, 0x60, 0x47, + 0xf8, 0xbd, 0x00, 0xbf, 0xf0, 0xd1, 0x01, 0x00, 0x04, 0xfc, 0x08, 0x00, + 0x08, 0xfc, 0x08, 0x00, 0x70, 0xb5, 0xdb, 0x4d, 0x96, 0x4c, 0x0a, 0x26, + 0x15, 0x44, 0x04, 0xeb, 0x41, 0x14, 0x95, 0xf8, 0xbc, 0x52, 0x04, 0xeb, + 0x02, 0x14, 0x02, 0x3d, 0x95, 0xfb, 0xf6, 0xf5, 0x04, 0xeb, 0x45, 0x04, + 0x45, 0x00, 0x24, 0xf8, 0xe0, 0x5c, 0xbd, 0xe8, 0x70, 0x40, 0x00, 0xf0, + 0x17, 0xba, 0x00, 0xbf, 0x80, 0xb5, 0x8b, 0x48, 0xac, 0x21, 0xc8, 0xf7, + 0x81, 0xfe, 0x04, 0x48, 0xcc, 0x49, 0x40, 0x78, 0xa1, 0xf8, 0xca, 0x02, + 0xbd, 0xe8, 0x80, 0x40, 0x00, 0xf0, 0x0e, 0xba, 0x8c, 0x32, 0x06, 0x00, + 0xf0, 0xb5, 0x8a, 0x48, 0x90, 0xf8, 0x29, 0x13, 0x02, 0x29, 0x24, 0xd1, + 0x1e, 0x49, 0x1f, 0x4a, 0x1f, 0x4c, 0x00, 0x23, 0x02, 0x25, 0x0a, 0x31, + 0x0a, 0x32, 0x11, 0xf9, 0x0a, 0x6c, 0x12, 0xf9, 0x0a, 0x7c, 0x01, 0x33, + 0x05, 0x2b, 0xa6, 0x5d, 0xc6, 0xeb, 0x47, 0x06, 0x92, 0xf9, 0x00, 0x70, + 0x02, 0xf1, 0x01, 0x02, 0x96, 0xfb, 0xf5, 0xf6, 0x01, 0xf8, 0x0a, 0x6c, + 0x91, 0xf9, 0x00, 0x60, 0x26, 0x44, 0x96, 0xf8, 0x00, 0x61, 0xc6, 0xeb, + 0x47, 0x06, 0x96, 0xfb, 0xf5, 0xf6, 0x0e, 0x70, 0x01, 0xf1, 0x01, 0x01, + 0xe1, 0xd1, 0x0c, 0x49, 0x00, 0xf5, 0x58, 0x60, 0x00, 0x22, 0x0f, 0x31, + 0x11, 0xf8, 0x0f, 0x3c, 0x05, 0x78, 0x86, 0x7a, 0x11, 0xf8, 0x05, 0x4c, + 0x01, 0x32, 0x01, 0x30, 0x05, 0x2a, 0x2b, 0x44, 0x01, 0xf8, 0x0a, 0x3c, + 0x06, 0xeb, 0x04, 0x03, 0x0b, 0x70, 0x01, 0xf1, 0x01, 0x01, 0xed, 0xd1, + 0xf0, 0xbd, 0x00, 0xbf, 0x0d, 0x13, 0x01, 0x00, 0x21, 0x14, 0x01, 0x00, + 0x90, 0xcd, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x8f, 0xb0, 0x0d, 0x90, + 0xa0, 0x48, 0x89, 0x46, 0x0c, 0x92, 0xb0, 0xf8, 0xca, 0x12, 0xc1, 0xf3, + 0xc4, 0x01, 0x00, 0x29, 0x0b, 0x91, 0x00, 0xf0, 0xac, 0x80, 0x0d, 0x9d, + 0x18, 0x21, 0x01, 0xea, 0xc5, 0x02, 0xff, 0x21, 0x91, 0x40, 0x0a, 0x92, + 0x09, 0x91, 0xc9, 0x43, 0x08, 0x91, 0x05, 0xeb, 0x85, 0x01, 0x00, 0xeb, + 0x81, 0x00, 0x09, 0xeb, 0x89, 0x01, 0x00, 0xeb, 0x41, 0x00, 0x18, 0x44, + 0x00, 0xf5, 0xaa, 0x72, 0x00, 0xf1, 0x14, 0x04, 0x05, 0xf0, 0xfc, 0x00, + 0x07, 0x92, 0xaa, 0x4a, 0x02, 0x90, 0x00, 0x20, 0x01, 0x94, 0x02, 0xeb, + 0x81, 0x11, 0x01, 0xeb, 0x43, 0x11, 0x29, 0x44, 0x01, 0xf5, 0x3b, 0x72, + 0x06, 0x92, 0x01, 0xf1, 0x6c, 0x02, 0x05, 0x92, 0x01, 0xf5, 0x37, 0x72, + 0x5c, 0x31, 0x04, 0x92, 0x03, 0x91, 0x01, 0x21, 0xdd, 0xe9, 0x04, 0xba, + 0x00, 0x06, 0x78, 0xd1, 0x0e, 0x46, 0x94, 0xf9, 0x00, 0x10, 0xb9, 0x48, + 0x03, 0x9d, 0x0d, 0xf1, 0x38, 0x08, 0x42, 0x46, 0x8c, 0x00, 0x03, 0x68, + 0x28, 0x78, 0x21, 0x46, 0x98, 0x47, 0x29, 0x78, 0x9d, 0xf8, 0x38, 0x20, + 0x4f, 0x46, 0xdf, 0xf8, 0xd4, 0x90, 0x11, 0x44, 0x49, 0xf8, 0xa4, 0x0f, + 0x9a, 0xf8, 0x00, 0x00, 0x42, 0x46, 0x8b, 0xf8, 0x00, 0x10, 0xad, 0x49, + 0x0b, 0x68, 0x21, 0x46, 0x98, 0x47, 0xc9, 0xf8, 0x04, 0x00, 0x9a, 0xf8, + 0x00, 0x00, 0x9d, 0xf8, 0x38, 0x10, 0x0a, 0x9a, 0xb9, 0x46, 0x08, 0x44, + 0x06, 0x99, 0x08, 0x70, 0x9b, 0xf8, 0x00, 0x10, 0xc0, 0xb2, 0x00, 0xfa, + 0x02, 0xf0, 0x01, 0xfa, 0x02, 0xf1, 0x5f, 0xb1, 0x02, 0x9d, 0x25, 0x4f, + 0x09, 0x9b, 0xea, 0x59, 0x08, 0x9c, 0x19, 0x40, 0x18, 0x40, 0x22, 0x40, + 0x11, 0x43, 0x22, 0x4a, 0xe9, 0x51, 0x0c, 0xe0, 0x21, 0x4a, 0x02, 0x9d, + 0x09, 0x9b, 0x94, 0x46, 0xaa, 0x58, 0x08, 0x9c, 0x19, 0x40, 0x18, 0x40, + 0x22, 0x40, 0x11, 0x43, 0x1d, 0x4a, 0x45, 0xf8, 0x0c, 0x10, 0xa9, 0x58, + 0x21, 0x40, 0x08, 0x43, 0xa8, 0x50, 0x01, 0x9c, 0x07, 0x99, 0x0c, 0x9a, + 0x20, 0x78, 0x08, 0x70, 0x58, 0x48, 0x49, 0x46, 0x03, 0x68, 0x0d, 0x98, + 0x98, 0x47, 0x80, 0xb1, 0x15, 0x48, 0x49, 0x46, 0x02, 0x68, 0x01, 0x20, + 0x90, 0x47, 0x7d, 0x48, 0x01, 0x68, 0x48, 0x46, 0x88, 0x47, 0x13, 0x49, + 0x11, 0x48, 0x91, 0xf8, 0x0f, 0x13, 0x00, 0x68, 0x4a, 0x42, 0x90, 0x42, + 0x01, 0xda, 0x00, 0x20, 0x04, 0xe0, 0x88, 0x42, 0x4f, 0xf0, 0x00, 0x00, + 0xd8, 0xbf, 0x01, 0x20, 0x0b, 0x9b, 0xf2, 0xb2, 0x71, 0x1c, 0x93, 0x42, + 0x3f, 0xf6, 0x86, 0xaf, 0xff, 0xe7, 0x0f, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, + 0xd8, 0x21, 0x06, 0x00, 0x04, 0x7a, 0x23, 0x40, 0x10, 0x7a, 0x23, 0x40, + 0x1c, 0x71, 0x23, 0x40, 0x2c, 0x71, 0x23, 0x40, 0xe8, 0xfb, 0x08, 0x00, + 0x84, 0x22, 0x06, 0x00, 0x00, 0x69, 0x08, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, + 0x36, 0x48, 0x00, 0x78, 0x00, 0x28, 0x66, 0xd0, 0xdf, 0xf8, 0xd4, 0x90, + 0x01, 0x20, 0x89, 0xf8, 0x00, 0x00, 0x34, 0x48, 0x01, 0x68, 0x01, 0x20, + 0x88, 0x47, 0x33, 0x48, 0x00, 0x68, 0x80, 0x47, 0x32, 0x48, 0x00, 0x24, + 0x00, 0xf2, 0xc6, 0x27, 0x99, 0xf8, 0x00, 0x00, 0x00, 0x28, 0x43, 0xd0, + 0x4a, 0x48, 0x90, 0xf8, 0x04, 0xa0, 0xba, 0xf1, 0x0b, 0x0f, 0x3a, 0xd8, + 0x47, 0x48, 0x20, 0x44, 0x00, 0xf1, 0x0d, 0x08, 0x78, 0x88, 0x20, 0xfa, + 0x0a, 0xf0, 0xc0, 0x07, 0x28, 0xd0, 0x4f, 0xf0, 0x00, 0x0b, 0x38, 0x78, + 0x20, 0xfa, 0x0b, 0xf0, 0xc0, 0x07, 0x18, 0xd0, 0x24, 0x48, 0x5f, 0xfa, + 0x8b, 0xf5, 0x5f, 0xfa, 0x8a, 0xf6, 0x21, 0x46, 0x2a, 0x46, 0x03, 0x68, + 0x30, 0x46, 0x98, 0x47, 0x89, 0xf8, 0x00, 0x00, 0x58, 0xb1, 0x4c, 0x48, + 0x21, 0x46, 0x02, 0x68, 0x30, 0x46, 0x90, 0x47, 0x98, 0xf8, 0x00, 0x30, + 0xe1, 0xb2, 0x30, 0x46, 0x2a, 0x46, 0xff, 0xf7, 0xe9, 0xfe, 0x0b, 0xf1, + 0x01, 0x0b, 0xbb, 0xf1, 0x03, 0x0f, 0x03, 0xd0, 0x99, 0xf8, 0x00, 0x00, + 0x00, 0x28, 0xd8, 0xd1, 0x0a, 0xf1, 0x01, 0x0a, 0xba, 0xf1, 0x0c, 0x0f, + 0x03, 0xd0, 0x99, 0xf8, 0x00, 0x00, 0x00, 0x28, 0xc8, 0xd1, 0x01, 0x34, + 0x02, 0x2c, 0xb7, 0xd1, 0x78, 0x88, 0x18, 0xb1, 0x38, 0x78, 0x08, 0xb1, + 0x01, 0x20, 0xb8, 0x71, 0x0b, 0x48, 0x00, 0x68, 0x80, 0x47, 0x06, 0x48, + 0x01, 0x68, 0x00, 0x20, 0xbd, 0xe8, 0xf8, 0x4f, 0x08, 0x47, 0xbd, 0xe8, + 0xf8, 0x8f, 0x00, 0xbf, 0xa8, 0x58, 0x01, 0x00, 0x88, 0x22, 0x06, 0x00, + 0xf4, 0xfb, 0x08, 0x00, 0xf0, 0xfb, 0x08, 0x00, 0x98, 0xca, 0x01, 0x00, + 0xfc, 0xfb, 0x08, 0x00, 0xe4, 0xfb, 0x08, 0x00, 0x2d, 0xe9, 0xf0, 0x41, + 0x07, 0x46, 0x0c, 0x46, 0x48, 0x42, 0x16, 0x49, 0x90, 0x46, 0x91, 0xf9, + 0x07, 0x20, 0xb0, 0xeb, 0x82, 0x0f, 0x02, 0xdd, 0x90, 0x00, 0x46, 0x42, + 0x08, 0xe0, 0x91, 0xf9, 0x08, 0x10, 0x26, 0x46, 0x00, 0x22, 0xb0, 0xeb, + 0x81, 0x0f, 0xb8, 0xbf, 0xa2, 0xeb, 0x81, 0x06, 0x0d, 0x4d, 0x30, 0x46, + 0x02, 0x21, 0x2a, 0x68, 0x90, 0x47, 0x38, 0x44, 0xb0, 0xf1, 0xff, 0x3f, + 0x03, 0xdd, 0x30, 0x28, 0x04, 0xdb, 0xbc, 0x20, 0x00, 0xe0, 0x00, 0x20, + 0xa0, 0xeb, 0x87, 0x06, 0x2a, 0x68, 0x30, 0x46, 0x02, 0x21, 0x90, 0x47, + 0xc8, 0xf8, 0x00, 0x00, 0xa0, 0x1b, 0xbd, 0xe8, 0xf0, 0x81, 0x00, 0xbf, + 0xf0, 0xd1, 0x01, 0x00, 0xd4, 0xfb, 0x08, 0x00, 0x0c, 0x48, 0x0d, 0x49, + 0x01, 0x60, 0x0d, 0x48, 0x0d, 0x49, 0x01, 0x60, 0x0d, 0x48, 0x0e, 0x49, + 0x01, 0x60, 0x0e, 0x48, 0x0e, 0x49, 0x01, 0x60, 0x0e, 0x48, 0x0f, 0x49, + 0x01, 0x60, 0x0f, 0x48, 0x0f, 0x49, 0x01, 0x60, 0x0f, 0x48, 0x10, 0x49, + 0x01, 0x60, 0x10, 0x48, 0x10, 0x49, 0x01, 0x60, 0x70, 0x47, 0x00, 0xbf, + 0x14, 0xfc, 0x08, 0x00, 0x15, 0xa4, 0x05, 0x00, 0x04, 0xfc, 0x08, 0x00, + 0x1d, 0xa3, 0x05, 0x00, 0x0c, 0xfc, 0x08, 0x00, 0xb1, 0xa5, 0x05, 0x00, + 0x08, 0xfc, 0x08, 0x00, 0x0d, 0xa6, 0x05, 0x00, 0xd0, 0xfd, 0x08, 0x00, + 0x3d, 0xa6, 0x05, 0x00, 0x24, 0xfc, 0x08, 0x00, 0x5d, 0xa6, 0x05, 0x00, + 0x98, 0xfd, 0x08, 0x00, 0x8d, 0xa8, 0x05, 0x00, 0xb0, 0xfb, 0x08, 0x00, + 0x89, 0xa9, 0x05, 0x00, 0x47, 0xf6, 0x55, 0x3c, 0xc1, 0xf2, 0x12, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf2, 0x07, 0x1c, 0xc1, 0xf2, 0x12, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x05, 0x48, 0x02, 0x22, 0x01, 0x68, 0x62, 0xf3, + 0x87, 0x11, 0x01, 0x60, 0x01, 0x68, 0x62, 0xf3, 0x09, 0x21, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x38, 0xc0, 0x05, 0x30, 0x10, 0xb5, 0x9c, 0x49, + 0x60, 0x48, 0x91, 0xf8, 0xc7, 0x2f, 0x91, 0xf8, 0xd3, 0x3f, 0x04, 0x68, + 0x63, 0xf3, 0xcd, 0x14, 0x04, 0x60, 0x03, 0x68, 0x62, 0xf3, 0x06, 0x03, + 0x03, 0x60, 0xb1, 0xf8, 0xee, 0x1e, 0xd0, 0xf8, 0x00, 0x3a, 0x01, 0xf0, + 0x7f, 0x02, 0x23, 0xf4, 0x7e, 0x53, 0x09, 0x0a, 0x43, 0xea, 0xc2, 0x12, + 0xc0, 0xf8, 0x00, 0x2a, 0xd0, 0xf8, 0x00, 0x2a, 0x61, 0xf3, 0x06, 0x02, + 0xc0, 0xf8, 0x00, 0x2a, 0x10, 0xbd, 0x00, 0xbf, 0x70, 0xb5, 0x8a, 0x4a, + 0xbb, 0x4b, 0x15, 0x49, 0xb2, 0xf9, 0xf0, 0x2e, 0x58, 0x7b, 0x04, 0x31, + 0x02, 0xf0, 0x0f, 0x04, 0x84, 0x42, 0x09, 0xd2, 0xc2, 0xf3, 0x03, 0x15, + 0x85, 0x42, 0x05, 0xd9, 0x0d, 0x68, 0x47, 0xf6, 0xff, 0x76, 0x35, 0x43, + 0x0d, 0x60, 0x02, 0xe0, 0x01, 0x25, 0x81, 0xf8, 0x2e, 0x50, 0x9b, 0x7b, + 0x9c, 0x42, 0x08, 0xd2, 0xc2, 0xf3, 0x03, 0x12, 0x9a, 0x42, 0x04, 0xd9, + 0x0a, 0x68, 0x07, 0x4c, 0x22, 0x43, 0x0a, 0x60, 0x02, 0xe0, 0x01, 0x22, + 0x81, 0xf8, 0x2e, 0x20, 0x81, 0xf8, 0x2d, 0x30, 0x03, 0x49, 0x81, 0xf8, + 0x28, 0x00, 0x70, 0xbd, 0x8c, 0x22, 0x06, 0x00, 0x00, 0x80, 0xff, 0x3f, + 0xb4, 0xd1, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, 0x6f, 0x48, 0x4f, 0xf0, + 0x00, 0x09, 0xeb, 0x46, 0x00, 0x25, 0x00, 0xf6, 0xf8, 0x5a, 0x6c, 0x49, + 0x05, 0xeb, 0xc5, 0x00, 0x02, 0x2d, 0x01, 0xeb, 0xc0, 0x00, 0x8c, 0xbf, + 0x00, 0xf6, 0x64, 0x60, 0x00, 0xf6, 0x3c, 0x60, 0x04, 0x68, 0x4c, 0xb3, + 0x4f, 0xf0, 0x00, 0x08, 0xe0, 0x07, 0x1e, 0xd0, 0x26, 0x48, 0x59, 0x46, + 0x02, 0x68, 0x5f, 0xfa, 0x88, 0xf0, 0x90, 0x47, 0x24, 0x49, 0x08, 0xeb, + 0x08, 0x10, 0x00, 0x9a, 0x53, 0x46, 0x01, 0xeb, 0x80, 0x00, 0x00, 0x21, + 0x02, 0x2d, 0x87, 0xbf, 0x5e, 0x8d, 0x1f, 0x8d, 0x5e, 0x88, 0x1f, 0x88, + 0x01, 0x31, 0x04, 0x33, 0x6f, 0xf3, 0x1f, 0x37, 0x11, 0x29, 0x66, 0xf3, + 0x17, 0x37, 0x80, 0xc2, 0x80, 0xc0, 0xef, 0xd1, 0x00, 0x92, 0x60, 0x08, + 0xb9, 0xeb, 0x54, 0x0f, 0x08, 0xf1, 0x01, 0x08, 0x04, 0x46, 0xd7, 0xd1, + 0x01, 0x35, 0x0a, 0xf1, 0x48, 0x0a, 0x05, 0x2d, 0xc3, 0xd1, 0x4e, 0x4c, + 0x12, 0x48, 0x94, 0xf8, 0xc7, 0x1f, 0x94, 0xf8, 0xd3, 0x2f, 0x03, 0x68, + 0x62, 0xf3, 0xcd, 0x13, 0x03, 0x60, 0x02, 0x68, 0x61, 0xf3, 0x06, 0x02, + 0x02, 0x60, 0xb4, 0xf8, 0xee, 0x1e, 0xd0, 0xf8, 0x00, 0x3a, 0x01, 0xf0, + 0x7f, 0x02, 0x23, 0xf4, 0x7e, 0x53, 0x09, 0x0a, 0x43, 0xea, 0xc2, 0x12, + 0xc0, 0xf8, 0x00, 0x2a, 0xd0, 0xf8, 0x00, 0x2a, 0x61, 0xf3, 0x06, 0x02, + 0xc0, 0xf8, 0x00, 0x2a, 0xbd, 0xe8, 0xf8, 0x8f, 0xc4, 0xfc, 0x08, 0x00, + 0xc4, 0x22, 0x06, 0x00, 0x00, 0x72, 0x23, 0x40, 0x2d, 0xe9, 0xf8, 0x4f, + 0xdf, 0xf8, 0xe0, 0xa0, 0x04, 0x46, 0x00, 0x20, 0x0e, 0x2c, 0x88, 0xbf, + 0x01, 0x20, 0x0a, 0xf5, 0xe4, 0x75, 0x0e, 0x2c, 0x15, 0xf8, 0x02, 0x8f, + 0x28, 0x70, 0x09, 0xd9, 0x28, 0x70, 0x20, 0x46, 0x00, 0xf0, 0xd6, 0xfc, + 0x32, 0x48, 0x00, 0x68, 0x00, 0xf0, 0x0f, 0x00, 0x0f, 0x30, 0x3a, 0xe0, + 0x9a, 0xf8, 0xf2, 0x2e, 0x7a, 0xb3, 0x03, 0x23, 0x05, 0x26, 0x3f, 0x27, + 0xb4, 0xfb, 0xf3, 0xf3, 0xb3, 0xfb, 0xf6, 0xf6, 0x06, 0xeb, 0x86, 0x06, + 0x9b, 0x1b, 0x18, 0x26, 0x07, 0x33, 0x06, 0xea, 0xc3, 0x0e, 0x9a, 0xf8, + 0xda, 0x6f, 0x03, 0xf0, 0x0c, 0x03, 0x07, 0xfa, 0x0e, 0xf7, 0x02, 0xfa, + 0x0e, 0xf2, 0xa6, 0xf1, 0x04, 0x0c, 0x20, 0x4e, 0xbc, 0xf1, 0x0c, 0x0f, + 0x3c, 0xbf, 0x47, 0xf2, 0x1c, 0x16, 0xc4, 0xf2, 0x23, 0x06, 0x56, 0xf8, + 0x03, 0xb0, 0x06, 0xeb, 0x03, 0x09, 0x2b, 0xea, 0x07, 0x0c, 0x07, 0xea, + 0x0b, 0x07, 0x97, 0x42, 0x84, 0xbf, 0xba, 0x1a, 0x4c, 0xea, 0x02, 0x0c, + 0xc9, 0xf8, 0x00, 0xc0, 0xff, 0xe7, 0x28, 0x70, 0x20, 0x46, 0x00, 0xf0, + 0x99, 0xfc, 0x13, 0x48, 0x00, 0x68, 0x00, 0xf0, 0x0f, 0x00, 0xe9, 0x49, + 0xa0, 0x42, 0x01, 0xeb, 0x04, 0x02, 0x13, 0x7b, 0x03, 0xf1, 0x01, 0x03, + 0x13, 0x73, 0x0a, 0xd1, 0x0e, 0x2c, 0x04, 0xd8, 0x9a, 0xf8, 0xf2, 0x0e, + 0x08, 0xb1, 0xc9, 0xf8, 0x00, 0xb0, 0x85, 0xf8, 0x00, 0x80, 0xbd, 0xe8, + 0xf8, 0x8f, 0xc2, 0x4a, 0x01, 0x20, 0xa0, 0x40, 0x53, 0x68, 0x18, 0x43, + 0x50, 0x60, 0xc8, 0x8d, 0x01, 0x30, 0xc8, 0x85, 0xbd, 0xe8, 0xf8, 0x8f, + 0x00, 0x69, 0x08, 0x00, 0x2c, 0x71, 0x23, 0x40, 0x04, 0x72, 0x03, 0x40, + 0x04, 0x7c, 0x03, 0x40, 0xf0, 0xb5, 0xb8, 0x48, 0x01, 0x68, 0x00, 0x29, + 0x54, 0xd0, 0x8a, 0x49, 0x91, 0xf8, 0xf6, 0x2e, 0x92, 0x07, 0x4f, 0xd5, + 0x01, 0xf5, 0x6f, 0x63, 0x27, 0x49, 0x04, 0x7e, 0x01, 0xf1, 0x0d, 0x02, + 0xcd, 0x49, 0x91, 0xf8, 0x32, 0x50, 0x3d, 0xb3, 0x3c, 0xbb, 0xb3, 0xf9, + 0x00, 0x50, 0x14, 0x78, 0xc5, 0xf3, 0x03, 0x26, 0xa6, 0x42, 0x03, 0xd8, + 0xc5, 0xf3, 0x03, 0x37, 0xa7, 0x42, 0x06, 0xd2, 0x57, 0x78, 0xbe, 0x42, + 0x26, 0xd8, 0xc5, 0xf3, 0x03, 0x35, 0xbd, 0x42, 0x22, 0xd3, 0x00, 0x25, + 0xd3, 0xf8, 0xe4, 0x30, 0x81, 0xf8, 0x32, 0x50, 0xd1, 0xe9, 0x00, 0x56, + 0x65, 0xea, 0x03, 0x03, 0x33, 0x43, 0x43, 0x60, 0x01, 0x33, 0x25, 0xd0, + 0x01, 0x23, 0x80, 0xf8, 0x28, 0x40, 0x03, 0x76, 0x50, 0x78, 0x81, 0xf8, + 0x31, 0x00, 0xf0, 0xbd, 0x64, 0xb1, 0xb3, 0xf9, 0x00, 0x30, 0x14, 0x78, + 0x03, 0xf0, 0x0f, 0x05, 0xa5, 0x42, 0x10, 0xd2, 0xc3, 0xf3, 0x03, 0x15, + 0xa5, 0x42, 0x0c, 0xd9, 0x9b, 0xb2, 0x00, 0xe0, 0x1b, 0x88, 0x1b, 0xb2, + 0x52, 0x78, 0x03, 0xf0, 0x0f, 0x04, 0x94, 0x42, 0x03, 0xd2, 0xc3, 0xf3, + 0x03, 0x13, 0x93, 0x42, 0x04, 0xd8, 0x01, 0x22, 0x81, 0xf8, 0x32, 0x20, + 0x00, 0x21, 0x01, 0x76, 0xf0, 0xbd, 0x00, 0xbf, 0xf0, 0xd1, 0x01, 0x00, + 0x70, 0xb5, 0x89, 0x48, 0xa5, 0x4c, 0x00, 0x68, 0x20, 0xb9, 0x5b, 0x48, + 0x90, 0xf8, 0xd1, 0x0f, 0x84, 0xf8, 0x33, 0x00, 0x00, 0xf0, 0x0a, 0xfc, + 0x57, 0x48, 0x13, 0x49, 0x07, 0x23, 0x90, 0xf8, 0xd2, 0x0f, 0x0a, 0x68, + 0x60, 0xf3, 0x04, 0x02, 0x10, 0x48, 0x0a, 0x60, 0x07, 0x21, 0x0f, 0x22, + 0x5c, 0x30, 0x05, 0x68, 0x06, 0x6b, 0x35, 0x43, 0x2d, 0xb2, 0x00, 0x2d, + 0x09, 0xd4, 0xa2, 0xf1, 0x0f, 0x06, 0x01, 0xfa, 0x02, 0xf5, 0x01, 0xfa, + 0x06, 0xf6, 0x35, 0x43, 0x26, 0x68, 0x35, 0x43, 0x25, 0x60, 0x01, 0x33, + 0x04, 0x30, 0x03, 0x32, 0x0c, 0x2b, 0xea, 0xd1, 0x20, 0x68, 0x40, 0xf0, + 0x40, 0x40, 0x20, 0x60, 0x70, 0xbd, 0x00, 0xbf, 0x00, 0x0e, 0x23, 0x40, + 0x8c, 0x7e, 0x08, 0x00, 0xfe, 0xb5, 0x6d, 0x4d, 0x3e, 0x4f, 0x00, 0x20, + 0xcd, 0xe9, 0x01, 0x00, 0x29, 0x68, 0x38, 0x78, 0x91, 0xf8, 0xcc, 0x60, + 0xff, 0x28, 0x01, 0xd0, 0x09, 0x28, 0x04, 0xd1, 0x00, 0x20, 0x00, 0x21, + 0x00, 0x22, 0x00, 0xf0, 0x79, 0xf8, 0x00, 0xf0, 0xcd, 0xf8, 0x20, 0xb3, + 0x35, 0x48, 0x01, 0xa9, 0x02, 0x68, 0x02, 0xa8, 0x90, 0x47, 0x38, 0x78, + 0xff, 0x28, 0x01, 0xd0, 0x09, 0x28, 0x04, 0xd1, 0xdd, 0xe9, 0x01, 0x21, + 0x01, 0x20, 0x00, 0xf0, 0x67, 0xf8, 0x2f, 0x48, 0x00, 0xf6, 0xf8, 0x54, + 0x14, 0xf8, 0xfe, 0x0f, 0x00, 0x07, 0x11, 0xd5, 0x28, 0x6a, 0x08, 0xb9, + 0x69, 0x6a, 0x69, 0xb1, 0x02, 0x99, 0x81, 0x42, 0x0a, 0xd9, 0x68, 0x6a, + 0x01, 0x99, 0x81, 0x42, 0x06, 0xd9, 0x6f, 0x48, 0x81, 0x8d, 0x01, 0x31, + 0x81, 0x85, 0x01, 0x20, 0x00, 0x24, 0x22, 0xe0, 0xdd, 0xe9, 0x01, 0x01, + 0xd4, 0xf8, 0xd2, 0x20, 0x91, 0x42, 0xc5, 0xe9, 0x08, 0x10, 0x05, 0xd2, + 0xd4, 0xf8, 0xd6, 0x10, 0x88, 0x42, 0x01, 0xd2, 0x01, 0x24, 0x09, 0xe0, + 0x1c, 0x48, 0x00, 0x68, 0x80, 0x47, 0x94, 0xf8, 0xda, 0x00, 0x10, 0xb1, + 0x1a, 0x48, 0x00, 0x68, 0x80, 0x47, 0x00, 0x24, 0x38, 0x78, 0xff, 0x28, + 0x01, 0xd0, 0x09, 0x28, 0x04, 0xd1, 0x02, 0x20, 0x21, 0x46, 0x22, 0x46, + 0x00, 0xf0, 0x2c, 0xf8, 0x20, 0x46, 0x14, 0x49, 0x72, 0xb6, 0x0a, 0x68, + 0x4f, 0xea, 0x42, 0x02, 0x02, 0xf1, 0x01, 0x02, 0x0a, 0x60, 0x44, 0xb1, + 0x01, 0x22, 0x6b, 0x68, 0xb2, 0x40, 0x1a, 0x43, 0x6a, 0x60, 0x01, 0x32, + 0x04, 0xbf, 0x00, 0x22, 0x2a, 0x76, 0x02, 0x22, 0x00, 0x28, 0x08, 0xbf, + 0x04, 0x22, 0x2a, 0x72, 0x08, 0x68, 0x40, 0x08, 0x08, 0x60, 0x08, 0x68, + 0x80, 0xf3, 0x10, 0x88, 0xfe, 0xbd, 0x00, 0xbf, 0x64, 0x8d, 0x08, 0x00, + 0x54, 0xfc, 0x08, 0x00, 0x00, 0x69, 0x08, 0x00, 0x58, 0xfc, 0x08, 0x00, + 0x5c, 0xfc, 0x08, 0x00, 0x24, 0x36, 0x01, 0x00, 0x2d, 0xe9, 0xf8, 0x43, + 0x07, 0x46, 0xeb, 0x48, 0x0e, 0x46, 0x90, 0x46, 0x01, 0x68, 0x4f, 0xf4, + 0x9c, 0x70, 0x88, 0x47, 0x18, 0xb3, 0x04, 0x46, 0x38, 0x20, 0xdf, 0xf8, + 0x84, 0x90, 0x21, 0x4d, 0x2c, 0x21, 0x2c, 0x23, 0xe0, 0x70, 0xd0, 0x20, + 0x27, 0x70, 0xa0, 0x70, 0x2c, 0x20, 0x4a, 0x46, 0x60, 0x70, 0x20, 0x1d, + 0xa8, 0x47, 0xd9, 0xf8, 0x00, 0x20, 0x04, 0xf1, 0x30, 0x00, 0xd0, 0x21, + 0xd0, 0x23, 0xa8, 0x47, 0x33, 0x4a, 0x04, 0xf5, 0x80, 0x70, 0x38, 0x21, + 0x38, 0x23, 0xa8, 0x47, 0x02, 0x2f, 0x06, 0xd0, 0x01, 0x2f, 0x08, 0xbf, + 0xc4, 0xe9, 0x09, 0x68, 0x13, 0xe0, 0xbd, 0xe8, 0xf8, 0x83, 0x04, 0x20, + 0x01, 0x2e, 0x08, 0xbf, 0x02, 0x20, 0xb8, 0xf1, 0x01, 0x0f, 0x20, 0x73, + 0x09, 0xd1, 0xd9, 0xf8, 0x00, 0x00, 0x01, 0x21, 0x90, 0xf8, 0xcc, 0x00, + 0x01, 0xfa, 0x00, 0xf0, 0xa1, 0x68, 0x08, 0x43, 0xa0, 0x60, 0x08, 0x48, + 0x21, 0x46, 0x4f, 0xf4, 0x9c, 0x72, 0x03, 0x68, 0x09, 0x20, 0x98, 0x47, + 0x20, 0x46, 0xbd, 0xe8, 0xf8, 0x43, 0xcb, 0xf7, 0x7d, 0xbe, 0x00, 0xbf, + 0xb4, 0xd1, 0x01, 0x00, 0x4d, 0xcd, 0x11, 0x10, 0xe4, 0x9b, 0x08, 0x00, + 0xf0, 0xb5, 0xdf, 0xf8, 0x60, 0xe0, 0xdf, 0xf8, 0x60, 0xc0, 0xff, 0x21, + 0x00, 0x23, 0x00, 0x26, 0x00, 0x27, 0xde, 0xf8, 0x00, 0x40, 0x8e, 0xf8, + 0x16, 0x10, 0x8c, 0xf8, 0x30, 0x30, 0x04, 0xf1, 0x08, 0x05, 0x2a, 0x68, + 0x8a, 0xb1, 0x06, 0xeb, 0x46, 0x02, 0xff, 0x29, 0x04, 0xbf, 0x8e, 0xf8, + 0x16, 0x30, 0x19, 0x46, 0x8e, 0xf8, 0x17, 0x30, 0x04, 0xeb, 0x82, 0x02, + 0x28, 0x68, 0x92, 0x68, 0x90, 0x42, 0x84, 0xbf, 0x8c, 0xf8, 0x30, 0x30, + 0x1e, 0x46, 0x01, 0x37, 0x0c, 0x35, 0x01, 0x33, 0x11, 0x2f, 0xe6, 0xd1, + 0xef, 0x48, 0x80, 0xf8, 0xf3, 0x6e, 0xb1, 0xf1, 0xff, 0x00, 0x18, 0xbf, + 0x01, 0x20, 0xf0, 0xbd, 0xb4, 0xd1, 0x01, 0x00, 0x8c, 0x22, 0x06, 0x00, + 0x70, 0x47, 0x00, 0xf0, 0xc9, 0xba, 0x00, 0xbf, 0x88, 0x48, 0x00, 0x7e, + 0x00, 0x28, 0x18, 0xbf, 0x01, 0x20, 0x70, 0x47, 0xf8, 0xb5, 0xe4, 0x49, + 0x00, 0x20, 0x00, 0x90, 0x91, 0xf8, 0xf6, 0x0e, 0xc2, 0x07, 0x1d, 0xd0, + 0xd1, 0xf8, 0x34, 0x12, 0x00, 0x29, 0x01, 0xd4, 0x80, 0x07, 0x17, 0xd5, + 0x0c, 0x4e, 0x0d, 0x4f, 0x00, 0x25, 0x6c, 0x46, 0xc5, 0xeb, 0x05, 0x10, + 0x32, 0x68, 0x21, 0x46, 0xc0, 0xb2, 0x90, 0x47, 0x68, 0x42, 0x00, 0x9a, + 0x00, 0x21, 0xc0, 0xb2, 0x07, 0xeb, 0x80, 0x00, 0x08, 0xc8, 0x01, 0x31, + 0xff, 0x29, 0x08, 0xc2, 0xfa, 0xd1, 0x01, 0x35, 0x02, 0x2d, 0xeb, 0xd1, + 0xf8, 0xbd, 0x00, 0xbf, 0xc4, 0xfc, 0x08, 0x00, 0xc4, 0x22, 0x06, 0x00, + 0x2d, 0xe9, 0xf8, 0x4f, 0xcb, 0x4e, 0xdf, 0xf8, 0xb8, 0x91, 0x30, 0x68, + 0x20, 0xf0, 0xc0, 0x00, 0x30, 0x60, 0x30, 0x68, 0x20, 0xf4, 0x40, 0x70, + 0x30, 0x60, 0xd9, 0xf8, 0x00, 0x00, 0x00, 0x28, 0x00, 0xf0, 0x91, 0x80, + 0x67, 0x4c, 0xdf, 0xf8, 0xa0, 0xb1, 0x20, 0x78, 0x60, 0xbb, 0x00, 0xf0, + 0xd1, 0xf8, 0xd9, 0xf8, 0x1c, 0x00, 0x20, 0xb3, 0x7d, 0x48, 0x01, 0x68, + 0xf0, 0x20, 0x88, 0x47, 0xcb, 0xf8, 0x08, 0x00, 0x98, 0xb1, 0x01, 0x25, + 0xf0, 0x21, 0x25, 0x70, 0xc8, 0xf7, 0xbc, 0xfd, 0x00, 0x20, 0x24, 0x21, + 0x89, 0xf8, 0x18, 0x50, 0x8b, 0xf8, 0x36, 0x00, 0xdb, 0xf8, 0x00, 0x00, + 0xc9, 0xf8, 0x04, 0x00, 0x0b, 0xf1, 0x0c, 0x00, 0xc8, 0xf7, 0xfa, 0xf8, + 0x09, 0xe0, 0x01, 0x20, 0x8b, 0xf8, 0x35, 0x00, 0xd9, 0xf8, 0x1c, 0x00, + 0xcb, 0xf7, 0xcc, 0xfd, 0x00, 0x20, 0xc9, 0xf8, 0x1c, 0x00, 0x20, 0x78, + 0x01, 0x28, 0x5e, 0xd1, 0x9b, 0xf8, 0x36, 0x60, 0xab, 0x4d, 0xf0, 0xb2, + 0x3b, 0x28, 0x59, 0xd8, 0x4f, 0xf0, 0x00, 0x0a, 0x55, 0xfa, 0x86, 0xf0, + 0x90, 0xf8, 0x88, 0x4f, 0xff, 0x2c, 0x3b, 0xd0, 0x9b, 0xf8, 0x34, 0x00, + 0xbb, 0xf8, 0x2a, 0x10, 0x81, 0x42, 0x3c, 0xd2, 0xf7, 0xb2, 0x0f, 0x2c, + 0x03, 0xd3, 0x95, 0xf8, 0xce, 0x01, 0x08, 0x28, 0x26, 0xd0, 0xd9, 0xf8, + 0x04, 0x00, 0xe0, 0x40, 0xc0, 0x07, 0x21, 0xd1, 0xdb, 0xf8, 0x08, 0x00, + 0x04, 0xf1, 0x1e, 0x08, 0x4f, 0xf0, 0x01, 0x0a, 0x50, 0xf8, 0x24, 0x10, + 0xc9, 0xf8, 0x20, 0x10, 0x01, 0x21, 0x50, 0xf8, 0x28, 0x00, 0xc9, 0xf8, + 0x24, 0x00, 0x39, 0x48, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0xd9, 0xf8, + 0x20, 0x00, 0xdb, 0xf8, 0x08, 0x10, 0x41, 0xf8, 0x24, 0x00, 0xd9, 0xf8, + 0x24, 0x00, 0x41, 0xf8, 0x28, 0x00, 0xbb, 0xf8, 0x2a, 0x00, 0x01, 0x30, + 0xab, 0xf8, 0x2a, 0x00, 0x78, 0x19, 0x90, 0xf8, 0x89, 0x0f, 0x30, 0x44, + 0x86, 0x1c, 0xf0, 0xb2, 0x3c, 0x28, 0xbd, 0xd3, 0x00, 0x26, 0xba, 0xf1, + 0x00, 0x0f, 0x8b, 0xf8, 0x36, 0x60, 0x02, 0xd1, 0x11, 0xe0, 0x8b, 0xf8, + 0x36, 0x60, 0xba, 0xf1, 0x01, 0x0f, 0xac, 0xd0, 0x9b, 0xf8, 0x35, 0x00, + 0x7e, 0x4e, 0x01, 0x28, 0x0a, 0xd0, 0x9b, 0xf8, 0x33, 0x00, 0x90, 0xbb, + 0x06, 0xe0, 0x30, 0xe0, 0x00, 0x20, 0x8b, 0xf8, 0x36, 0x00, 0x01, 0x20, + 0x8b, 0xf8, 0x35, 0x00, 0x1e, 0x4c, 0x00, 0x20, 0x00, 0x26, 0x2f, 0x18, + 0x97, 0xf8, 0x88, 0x0f, 0xff, 0x28, 0x12, 0xd0, 0xdb, 0xf8, 0x00, 0x10, + 0x21, 0xfa, 0x00, 0xf0, 0xc0, 0x07, 0x05, 0xd1, 0x97, 0xf8, 0x89, 0x0f, + 0x10, 0xb1, 0x21, 0x68, 0xf0, 0xb2, 0x88, 0x47, 0x97, 0xf8, 0x89, 0x0f, + 0x30, 0x44, 0x86, 0x1c, 0xf0, 0xb2, 0x3b, 0x28, 0xe7, 0xd3, 0xdb, 0xf8, + 0x08, 0x00, 0xcb, 0xf7, 0x41, 0xfd, 0xd9, 0xf8, 0x1c, 0x00, 0x00, 0x24, + 0xcb, 0xf8, 0x08, 0x40, 0xcb, 0xf7, 0x3a, 0xfd, 0x64, 0x4e, 0x89, 0xf8, + 0x18, 0x40, 0xc9, 0xf8, 0x1c, 0x40, 0x30, 0x68, 0x02, 0x21, 0x61, 0xf3, + 0x87, 0x10, 0x30, 0x60, 0x30, 0x68, 0x61, 0xf3, 0x09, 0x20, 0x30, 0x60, + 0xbd, 0xe8, 0xf8, 0x8f, 0xb4, 0xd1, 0x01, 0x00, 0xbc, 0x2a, 0x06, 0x00, + 0x8c, 0x22, 0x06, 0x00, 0x48, 0xfc, 0x08, 0x00, 0x4c, 0xfc, 0x08, 0x00, + 0xbc, 0xb5, 0x16, 0x48, 0x01, 0x68, 0x40, 0xf2, 0xfd, 0x30, 0x88, 0x47, + 0x03, 0x46, 0x55, 0x48, 0xc3, 0x61, 0x55, 0x48, 0x90, 0xf8, 0xdb, 0x1f, + 0xb0, 0xf8, 0xd8, 0x0f, 0x71, 0xb1, 0x00, 0x22, 0xb2, 0xeb, 0x90, 0x0f, + 0x09, 0xd0, 0x0e, 0x4c, 0x80, 0x08, 0x01, 0x39, 0x00, 0x22, 0x54, 0xf8, + 0x21, 0x50, 0x01, 0x32, 0x82, 0x42, 0x20, 0xc3, 0xf9, 0xd1, 0xbc, 0xbd, + 0x40, 0xf2, 0xff, 0x11, 0x20, 0xf0, 0x03, 0x00, 0x04, 0x22, 0xad, 0xf8, + 0x06, 0x10, 0x06, 0x49, 0x00, 0x90, 0x0d, 0xf1, 0x06, 0x00, 0x0c, 0x68, + 0x08, 0x21, 0xa0, 0x47, 0xbc, 0xbd, 0x00, 0xbf, 0xd4, 0x9b, 0x08, 0x00, + 0xa0, 0x9f, 0x12, 0x10, 0x34, 0xea, 0x08, 0x00, 0x2d, 0xe9, 0xf8, 0x4f, + 0x3c, 0x4c, 0xdf, 0xf8, 0xf4, 0xa0, 0x20, 0x68, 0x20, 0xf0, 0xc0, 0x00, + 0x20, 0x60, 0x20, 0x68, 0x20, 0xf4, 0x40, 0x70, 0x20, 0x60, 0xda, 0xf8, + 0x00, 0x00, 0x00, 0x28, 0x54, 0xd0, 0xff, 0xf7, 0xb9, 0xff, 0xda, 0xf8, + 0x1c, 0x00, 0x00, 0x28, 0x4e, 0xd0, 0x35, 0x48, 0xdf, 0xf8, 0xcc, 0x90, + 0xa3, 0x46, 0xdf, 0xf8, 0xd0, 0x80, 0x01, 0x78, 0x99, 0xf8, 0xce, 0x41, + 0x01, 0x29, 0x04, 0xd1, 0xda, 0xf8, 0x00, 0x00, 0x90, 0xf8, 0xcc, 0x70, + 0x0d, 0xe0, 0x01, 0x21, 0x00, 0x27, 0x01, 0x70, 0xda, 0xf8, 0x00, 0x00, + 0x24, 0x21, 0x80, 0xf8, 0xcc, 0x70, 0x08, 0xf1, 0x0c, 0x00, 0xc7, 0xf7, + 0xdf, 0xff, 0xca, 0xe9, 0x08, 0x77, 0x1e, 0x26, 0x08, 0x2c, 0x08, 0xbf, + 0x0f, 0x26, 0xbe, 0x42, 0x1b, 0xd9, 0xd8, 0xf8, 0x00, 0xc0, 0x99, 0xf8, + 0xf7, 0xee, 0xda, 0xf8, 0x04, 0x30, 0x01, 0x20, 0x00, 0x24, 0x3a, 0x46, + 0x00, 0xfa, 0x07, 0xf1, 0x0b, 0x42, 0x08, 0xd1, 0x08, 0xeb, 0x07, 0x05, + 0x2d, 0x7b, 0x75, 0x45, 0x03, 0xd2, 0x1c, 0xea, 0x01, 0x0f, 0x02, 0xd1, + 0x1f, 0xe0, 0xca, 0xe9, 0x08, 0x44, 0x01, 0x32, 0xd7, 0xb2, 0xbe, 0x42, + 0xec, 0xd8, 0xbe, 0x42, 0x02, 0xbf, 0x00, 0x20, 0x88, 0xf8, 0x32, 0x00, + 0x8a, 0xf8, 0x18, 0x00, 0xda, 0xf8, 0x1c, 0x00, 0xcb, 0xf7, 0x8a, 0xfc, + 0x00, 0x20, 0x5c, 0x46, 0xca, 0xf8, 0x1c, 0x00, 0x20, 0x68, 0x02, 0x21, + 0x61, 0xf3, 0x87, 0x10, 0x20, 0x60, 0x20, 0x68, 0x61, 0xf3, 0x09, 0x20, + 0x20, 0x60, 0xbd, 0xe8, 0xf8, 0x8f, 0x73, 0x48, 0x01, 0x21, 0x03, 0x68, + 0xd0, 0xb2, 0x98, 0x47, 0xb8, 0xf8, 0x2a, 0x00, 0x01, 0x30, 0xa8, 0xf8, + 0x2a, 0x00, 0xda, 0xe7, 0x38, 0xc0, 0x05, 0x30, 0xb4, 0xd1, 0x01, 0x00, + 0x00, 0x69, 0x08, 0x00, 0xbd, 0x2a, 0x06, 0x00, 0x8c, 0x22, 0x06, 0x00, + 0xb0, 0xb5, 0x02, 0x28, 0x14, 0xd0, 0x01, 0x28, 0x24, 0xd0, 0xa8, 0xbb, + 0x47, 0x48, 0x00, 0xf6, 0xe2, 0x64, 0x99, 0xb3, 0xb4, 0xf9, 0x06, 0x00, + 0xc0, 0xeb, 0x10, 0x20, 0x01, 0x30, 0xc5, 0xb2, 0xed, 0xf7, 0xee, 0xfc, + 0x90, 0xfb, 0xf5, 0xf1, 0x01, 0xfb, 0x15, 0x00, 0xe1, 0x88, 0x4e, 0xe0, + 0x3e, 0x48, 0x00, 0xf6, 0xe2, 0x64, 0x79, 0xb3, 0xb4, 0xf9, 0x0a, 0x00, + 0xc0, 0xeb, 0x10, 0x20, 0x01, 0x30, 0xc5, 0xb2, 0xed, 0xf7, 0xdc, 0xfc, + 0x90, 0xfb, 0xf5, 0xf1, 0x01, 0xfb, 0x15, 0x00, 0x61, 0x89, 0x3c, 0xe0, + 0x35, 0x48, 0x00, 0xf6, 0xe2, 0x64, 0x59, 0xb3, 0xb4, 0xf9, 0x08, 0x00, + 0xc0, 0xeb, 0x10, 0x20, 0x01, 0x30, 0xc5, 0xb2, 0xed, 0xf7, 0xca, 0xfc, + 0x90, 0xfb, 0xf5, 0xf1, 0x01, 0xfb, 0x15, 0x00, 0x21, 0x89, 0x2a, 0xe0, + 0x02, 0x20, 0x29, 0xe0, 0xb4, 0xf9, 0x00, 0x00, 0xc0, 0xeb, 0x10, 0x20, + 0x01, 0x30, 0xc5, 0xb2, 0xed, 0xf7, 0xba, 0xfc, 0x90, 0xfb, 0xf5, 0xf1, + 0x01, 0xfb, 0x15, 0x00, 0x21, 0x88, 0x1a, 0xe0, 0xb4, 0xf9, 0x04, 0x00, + 0xc0, 0xeb, 0x10, 0x20, 0x01, 0x30, 0xc5, 0xb2, 0xed, 0xf7, 0xac, 0xfc, + 0x90, 0xfb, 0xf5, 0xf1, 0x01, 0xfb, 0x15, 0x00, 0xa1, 0x88, 0x0c, 0xe0, + 0xb4, 0xf9, 0x02, 0x00, 0xc0, 0xeb, 0x10, 0x20, 0x01, 0x30, 0xc5, 0xb2, + 0xed, 0xf7, 0x9e, 0xfc, 0x90, 0xfb, 0xf5, 0xf1, 0x01, 0xfb, 0x15, 0x00, + 0x61, 0x88, 0x08, 0x44, 0xc0, 0xb2, 0xb0, 0xbd, 0x10, 0xb5, 0x8a, 0xb0, + 0x00, 0xf0, 0x8a, 0xf8, 0x00, 0x20, 0x08, 0xac, 0xad, 0xf8, 0x24, 0x00, + 0x08, 0x90, 0x0d, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x0c, 0x48, + 0x01, 0xa9, 0x02, 0x68, 0x20, 0x46, 0x90, 0x47, 0x0a, 0x48, 0xdd, 0xe9, + 0x01, 0x12, 0x01, 0x60, 0x09, 0x48, 0x01, 0x21, 0x02, 0x60, 0x09, 0x48, + 0x00, 0x22, 0xb0, 0xf8, 0xd8, 0x0f, 0x20, 0xf0, 0x03, 0x00, 0x00, 0xf0, + 0x73, 0xf8, 0x0a, 0xb0, 0x10, 0xbd, 0x00, 0xbf, 0x04, 0xba, 0x08, 0x00, + 0x98, 0xda, 0x08, 0x00, 0x0c, 0x23, 0x21, 0x40, 0x10, 0x23, 0x21, 0x40, + 0x00, 0x69, 0x08, 0x00, 0x10, 0x48, 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, + 0x11, 0x49, 0x01, 0x60, 0x11, 0x48, 0x12, 0x49, 0x01, 0x60, 0x12, 0x48, + 0x12, 0x49, 0x01, 0x60, 0x12, 0x48, 0x13, 0x49, 0x01, 0x60, 0x13, 0x48, + 0x13, 0x49, 0x01, 0x60, 0x13, 0x48, 0x14, 0x49, 0x01, 0x60, 0x14, 0x48, + 0x14, 0x49, 0x01, 0x60, 0x14, 0x48, 0x15, 0x49, 0x01, 0x60, 0x15, 0x48, + 0x15, 0x49, 0x01, 0x60, 0x15, 0x48, 0x16, 0x49, 0x01, 0x60, 0x70, 0x47, + 0x60, 0xcd, 0x08, 0x00, 0x05, 0xb5, 0x05, 0x00, 0xf4, 0xb9, 0x08, 0x00, + 0x31, 0xb4, 0x05, 0x00, 0x34, 0xfc, 0x08, 0x00, 0xe9, 0xb0, 0x05, 0x00, + 0x40, 0xfc, 0x08, 0x00, 0x25, 0xb3, 0x05, 0x00, 0xe0, 0xfb, 0x08, 0x00, + 0x7f, 0xb0, 0x05, 0x00, 0x2c, 0xbc, 0x08, 0x00, 0x4d, 0xab, 0x05, 0x00, + 0x48, 0xfc, 0x08, 0x00, 0x29, 0xac, 0x05, 0x00, 0x30, 0xbc, 0x08, 0x00, + 0xdd, 0xad, 0x05, 0x00, 0x80, 0xcd, 0x08, 0x00, 0x4d, 0xae, 0x05, 0x00, + 0xdc, 0xfb, 0x08, 0x00, 0x7d, 0xb0, 0x05, 0x00, 0x38, 0xfc, 0x08, 0x00, + 0x21, 0xad, 0x05, 0x00, 0x49, 0xf2, 0xcb, 0x7c, 0xc1, 0xf2, 0x12, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf2, 0xaf, 0x4c, 0xc1, 0xf2, 0x12, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf2, 0xd7, 0x5c, 0xc1, 0xf2, 0x12, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf6, 0x23, 0x5c, 0xc1, 0xf2, 0x12, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x49, 0xf2, 0x85, 0x3c, 0xc1, 0xf2, 0x0a, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x2d, 0xe9, 0xf0, 0x43, 0x27, 0x4c, 0xdd, 0xf8, + 0x1c, 0xc0, 0x4f, 0xf0, 0x0b, 0x0e, 0x04, 0xeb, 0xc1, 0x11, 0x01, 0xeb, + 0x42, 0x19, 0x00, 0x22, 0x0b, 0x21, 0xb9, 0xf8, 0x16, 0x60, 0xb0, 0x46, + 0xb4, 0xb2, 0x7f, 0x2c, 0x07, 0xd0, 0x35, 0xb2, 0x85, 0x42, 0x12, 0xdd, + 0xcf, 0xb2, 0x0c, 0x2f, 0x11, 0xd0, 0xb0, 0x46, 0x8e, 0x46, 0x01, 0x32, + 0x10, 0x2a, 0x29, 0xd0, 0x4c, 0x1e, 0x65, 0xb2, 0x00, 0x2d, 0x48, 0xbf, + 0x01, 0xf1, 0x0f, 0x04, 0x61, 0xb2, 0x39, 0xf8, 0x11, 0x60, 0x21, 0x46, + 0xe6, 0xe7, 0x01, 0x22, 0x00, 0xe0, 0x00, 0x22, 0x02, 0x2b, 0x0f, 0xd0, + 0x01, 0x2b, 0x1b, 0xd0, 0x1f, 0xfa, 0x88, 0xf3, 0x7f, 0x2b, 0x17, 0xd0, + 0x80, 0xb2, 0x84, 0x42, 0x14, 0xd0, 0xc8, 0xb2, 0x0c, 0x38, 0x18, 0xbf, + 0x01, 0x20, 0x10, 0x43, 0x0a, 0xd1, 0x0d, 0xe0, 0x1f, 0xfa, 0x88, 0xf2, + 0x7f, 0x2a, 0x09, 0xd0, 0x0f, 0xfa, 0x88, 0xf3, 0x2a, 0x1a, 0xc0, 0x1a, + 0x90, 0x42, 0x03, 0xda, 0xac, 0xf8, 0x00, 0x80, 0x71, 0x46, 0x01, 0xe0, + 0xac, 0xf8, 0x00, 0x60, 0xc8, 0xb2, 0xbd, 0xe8, 0xf0, 0x83, 0x00, 0xbf, + 0xb2, 0xd0, 0x01, 0x00, 0x7c, 0xb5, 0x0c, 0x46, 0x05, 0x46, 0x00, 0xf0, + 0x31, 0xfe, 0x94, 0xf8, 0x93, 0x00, 0x00, 0x28, 0x3e, 0xd0, 0x94, 0xf8, + 0x35, 0x01, 0x16, 0x28, 0x16, 0xd8, 0x39, 0x49, 0x00, 0xeb, 0x40, 0x02, + 0x51, 0xf8, 0x22, 0x20, 0x82, 0xb1, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, + 0x80, 0x00, 0x00, 0x79, 0x05, 0x28, 0x01, 0xd0, 0x03, 0x28, 0x07, 0xd1, + 0x32, 0x48, 0x00, 0x68, 0x6f, 0xf3, 0x9f, 0x30, 0xa4, 0xf8, 0x98, 0x00, + 0x30, 0x48, 0x06, 0xe0, 0x9a, 0x48, 0x00, 0x68, 0x6f, 0xf3, 0x9f, 0x30, + 0xa4, 0xf8, 0x98, 0x00, 0x2d, 0x48, 0x00, 0x68, 0x6f, 0xf3, 0x9f, 0x30, + 0xa4, 0xf8, 0x9a, 0x00, 0x6f, 0x48, 0x40, 0x79, 0x01, 0x28, 0x13, 0xd1, + 0x29, 0x48, 0x01, 0xab, 0x00, 0x22, 0x50, 0xf8, 0x25, 0x00, 0x01, 0x68, + 0x8d, 0xf8, 0x04, 0x10, 0x00, 0x21, 0x00, 0x68, 0x00, 0x0a, 0x8d, 0xf8, + 0x05, 0x00, 0xed, 0x48, 0x06, 0x68, 0x02, 0x20, 0x00, 0x90, 0x40, 0xf2, + 0x3b, 0x70, 0xb0, 0x47, 0x1f, 0x4a, 0x94, 0xf8, 0x35, 0x01, 0x1f, 0x49, + 0x52, 0xf8, 0x25, 0x20, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, + 0x13, 0x68, 0x83, 0x72, 0x61, 0x4b, 0x94, 0xf8, 0x35, 0x01, 0x12, 0x68, + 0x00, 0xeb, 0x40, 0x00, 0x12, 0x0a, 0x01, 0xeb, 0x40, 0x10, 0xc2, 0x72, + 0x5b, 0x4a, 0x94, 0xf8, 0x35, 0x01, 0x12, 0x78, 0x00, 0xeb, 0x40, 0x00, + 0xc2, 0xeb, 0x42, 0x12, 0x01, 0xeb, 0x40, 0x10, 0x03, 0xeb, 0xc2, 0x02, + 0xd2, 0xf8, 0xcc, 0x30, 0xd2, 0xf8, 0xd4, 0x50, 0x03, 0x72, 0x94, 0xf8, + 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, 0x45, 0x72, + 0x94, 0xf8, 0x35, 0x01, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, + 0x92, 0xf8, 0xe8, 0x10, 0x01, 0x73, 0x7c, 0xbd, 0xe8, 0x72, 0x01, 0x00, + 0xd0, 0xc2, 0x23, 0x40, 0x10, 0xc3, 0x23, 0x40, 0xf0, 0xc2, 0x23, 0x40, + 0x7c, 0x8c, 0x12, 0x10, 0x54, 0xf1, 0x05, 0x00, 0xfe, 0xb5, 0x04, 0x46, + 0x3f, 0x48, 0x0d, 0x46, 0x11, 0x46, 0x1e, 0x46, 0x2a, 0x46, 0x07, 0x68, + 0xa0, 0x1c, 0x00, 0xf0, 0x83, 0xf8, 0xc8, 0xb1, 0x3b, 0x48, 0x27, 0x61, + 0x40, 0x79, 0x01, 0x28, 0x14, 0xd1, 0xcf, 0x48, 0x02, 0xab, 0x00, 0x22, + 0x50, 0xf8, 0x25, 0x00, 0x01, 0x68, 0x8d, 0xf8, 0x08, 0x10, 0x00, 0x21, + 0x00, 0x68, 0x00, 0x0a, 0x8d, 0xf8, 0x09, 0x00, 0xb8, 0x48, 0xd0, 0xf8, + 0x00, 0xc0, 0x02, 0x20, 0x00, 0x90, 0x40, 0xf2, 0x3b, 0x70, 0xe0, 0x47, + 0x2f, 0x48, 0x21, 0x69, 0x02, 0x68, 0x38, 0x46, 0x90, 0x47, 0xb1, 0x4a, + 0x02, 0xf6, 0xd4, 0x51, 0xd2, 0xf8, 0xec, 0x2d, 0x90, 0x42, 0x03, 0xd8, + 0x22, 0x69, 0x0a, 0xb1, 0x01, 0x22, 0x00, 0xe0, 0x00, 0x22, 0x62, 0x70, + 0x0a, 0x78, 0x32, 0xb1, 0xdc, 0x4a, 0x92, 0xf8, 0x20, 0x21, 0x00, 0x2a, + 0x18, 0xbf, 0x01, 0x22, 0x00, 0xe0, 0x00, 0x22, 0x36, 0xb9, 0x22, 0xb1, + 0x4a, 0x78, 0x00, 0x2a, 0x18, 0xbf, 0x01, 0x22, 0x00, 0xe0, 0x00, 0x22, + 0x4b, 0x69, 0x98, 0x42, 0x01, 0xd2, 0x20, 0x69, 0x20, 0xb9, 0x88, 0x7c, + 0x10, 0xb1, 0x0a, 0xb1, 0x01, 0x20, 0x00, 0xe0, 0x00, 0x20, 0x20, 0x75, + 0x18, 0x48, 0x01, 0x2d, 0x04, 0xbf, 0x41, 0xf2, 0x8c, 0x00, 0xc4, 0xf2, + 0x21, 0x00, 0x00, 0x68, 0x60, 0x76, 0xa8, 0x48, 0x50, 0xf8, 0x25, 0x00, + 0x01, 0x68, 0xe1, 0x75, 0x13, 0x49, 0x00, 0x68, 0x00, 0x0a, 0x20, 0x76, + 0x10, 0x48, 0x00, 0x78, 0xc0, 0xeb, 0x40, 0x10, 0x01, 0xeb, 0xc0, 0x00, + 0x90, 0xf8, 0xd8, 0x10, 0x11, 0xb1, 0xd0, 0xf8, 0xcc, 0x10, 0x00, 0xe0, + 0x7f, 0x21, 0x61, 0x75, 0x90, 0xf8, 0xd9, 0x10, 0x11, 0xb1, 0xd0, 0xf8, + 0xd4, 0x10, 0x00, 0xe0, 0x7f, 0x21, 0xa1, 0x75, 0x90, 0xf8, 0xe8, 0x00, + 0x60, 0x76, 0xfe, 0xbd, 0x24, 0x20, 0x00, 0x40, 0x48, 0xdc, 0x05, 0x00, + 0xd0, 0xf3, 0x08, 0x00, 0x9c, 0x21, 0x21, 0x40, 0x74, 0x87, 0x08, 0x00, + 0x0c, 0x6f, 0x01, 0x00, 0xf0, 0xb5, 0x91, 0x4b, 0x1c, 0x68, 0xb4, 0xf1, + 0xff, 0x3f, 0x13, 0xdc, 0x8d, 0x4c, 0x4f, 0xf0, 0x7f, 0x47, 0x54, 0xf8, + 0x22, 0x40, 0x25, 0x68, 0x26, 0x68, 0x24, 0x68, 0x07, 0xea, 0x06, 0x46, + 0xb6, 0xeb, 0x05, 0x6f, 0x76, 0x4d, 0xd8, 0xbf, 0x24, 0x0a, 0x64, 0xb2, + 0x95, 0xf9, 0xd8, 0x5d, 0xac, 0x42, 0x01, 0xda, 0x00, 0x20, 0xf0, 0xbd, + 0x11, 0x4c, 0x01, 0x29, 0x4f, 0xf0, 0x40, 0x07, 0x25, 0x46, 0x08, 0xbf, + 0x20, 0x35, 0x1e, 0x68, 0x1b, 0x68, 0x01, 0x29, 0x2d, 0x68, 0x08, 0xbf, + 0x60, 0x27, 0x39, 0x59, 0x6f, 0xf3, 0x9f, 0x35, 0x6f, 0xf3, 0x9f, 0x31, + 0x85, 0x80, 0xc1, 0x80, 0x46, 0xf3, 0x06, 0x61, 0x01, 0x70, 0x43, 0xf3, + 0x0a, 0x31, 0x41, 0x80, 0x05, 0x49, 0x51, 0xf8, 0x22, 0x10, 0x09, 0x68, + 0x01, 0xf0, 0x03, 0x01, 0x01, 0x72, 0x01, 0x20, 0xf0, 0xbd, 0x00, 0xbf, + 0xb0, 0xc2, 0x23, 0x40, 0x84, 0x8c, 0x12, 0x10, 0xf0, 0xb5, 0x87, 0xb0, + 0x0d, 0x46, 0x04, 0x46, 0x01, 0xa8, 0x16, 0x21, 0x16, 0x46, 0xc7, 0xf7, + 0xcd, 0xfc, 0x57, 0x48, 0x57, 0x49, 0x50, 0xf8, 0x26, 0x00, 0x51, 0xf8, + 0x26, 0x10, 0x00, 0x68, 0x0e, 0x68, 0x55, 0x49, 0x91, 0xf8, 0xf4, 0x1d, + 0x00, 0x29, 0x62, 0xd0, 0x71, 0xb2, 0xb1, 0xf1, 0xff, 0x3f, 0x01, 0xdd, + 0x02, 0x21, 0x0b, 0xe0, 0x01, 0x21, 0x8d, 0xf8, 0x0a, 0x10, 0x06, 0xf0, + 0x1f, 0x01, 0x8d, 0xf8, 0x06, 0x10, 0x00, 0xf0, 0x0f, 0x01, 0x8d, 0xf8, + 0x05, 0x10, 0x03, 0x21, 0x32, 0xb2, 0xb2, 0xf1, 0xff, 0x3f, 0x09, 0xdc, + 0x8d, 0xf8, 0x0a, 0x10, 0xc6, 0xf3, 0x04, 0x21, 0x8d, 0xf8, 0x08, 0x10, + 0xc0, 0xf3, 0x03, 0x40, 0x8d, 0xf8, 0x07, 0x00, 0x46, 0xf3, 0x0a, 0x40, + 0xad, 0xf8, 0x0c, 0x00, 0x64, 0xb1, 0x94, 0xf8, 0x35, 0x01, 0x9c, 0x49, + 0x8d, 0xf8, 0x04, 0x00, 0x00, 0xeb, 0x40, 0x00, 0x01, 0xeb, 0x40, 0x10, + 0x04, 0xf1, 0x94, 0x01, 0x08, 0x30, 0x08, 0xe0, 0x2d, 0xb3, 0x95, 0xf8, + 0x44, 0x00, 0x05, 0xf5, 0xe9, 0x71, 0x8d, 0xf8, 0x04, 0x00, 0x05, 0xf2, + 0xe5, 0x10, 0x0a, 0x78, 0x83, 0x78, 0xc7, 0x78, 0x8d, 0xf8, 0x09, 0x20, + 0x4a, 0x88, 0x8d, 0xf8, 0x16, 0x30, 0x8d, 0xf8, 0x17, 0x70, 0xad, 0xf8, + 0x0e, 0x20, 0x8a, 0x88, 0xc9, 0x88, 0xad, 0xf8, 0x12, 0x10, 0x01, 0x79, + 0xad, 0xf8, 0x10, 0x20, 0x42, 0x78, 0x8d, 0xf8, 0x0b, 0x10, 0x01, 0x78, + 0x40, 0x79, 0x8d, 0xf8, 0x15, 0x20, 0x8d, 0xf8, 0x14, 0x10, 0x8d, 0xf8, + 0x18, 0x00, 0x27, 0x48, 0x01, 0xab, 0x01, 0x21, 0x00, 0x22, 0x07, 0x68, + 0x16, 0x20, 0x00, 0x90, 0x40, 0xf2, 0x34, 0x70, 0xb8, 0x47, 0x5c, 0xb1, + 0x94, 0xf8, 0x35, 0x01, 0x7c, 0x49, 0x00, 0xeb, 0x40, 0x00, 0x40, 0x01, + 0x08, 0x58, 0x90, 0xb3, 0x02, 0x30, 0x04, 0xf1, 0x74, 0x01, 0x05, 0xe0, + 0x6d, 0xb3, 0xd5, 0xf8, 0x00, 0x11, 0x05, 0xf5, 0xdd, 0x70, 0x74, 0x31, + 0x0a, 0x78, 0xa2, 0xf1, 0x0b, 0x01, 0x0a, 0x2a, 0x72, 0xb2, 0xb1, 0xfa, + 0x81, 0xf1, 0x4f, 0xea, 0x51, 0x11, 0x4f, 0xea, 0x41, 0x01, 0x08, 0xbf, + 0x01, 0x21, 0xb2, 0xf1, 0xff, 0x3f, 0x07, 0xdd, 0x01, 0xeb, 0x41, 0x01, + 0x00, 0xeb, 0x41, 0x00, 0x81, 0x88, 0x01, 0x31, 0x81, 0x80, 0x10, 0xe0, + 0x32, 0xb2, 0x01, 0xeb, 0x41, 0x01, 0xb2, 0xf1, 0xff, 0x3f, 0xdd, 0xbf, + 0x30, 0xf8, 0x11, 0x20, 0x01, 0x32, 0x20, 0xf8, 0x11, 0x20, 0x00, 0xeb, + 0x41, 0x00, 0xc2, 0xbf, 0x41, 0x88, 0x01, 0x31, 0x41, 0x80, 0x07, 0xb0, + 0xf0, 0xbd, 0x00, 0xbf, 0xd8, 0x15, 0x01, 0x10, 0xc8, 0x15, 0x01, 0x10, + 0x00, 0x69, 0x08, 0x00, 0xa0, 0xa0, 0x08, 0x00, 0x0e, 0x49, 0x0f, 0x4a, + 0x51, 0xf8, 0x20, 0x10, 0x08, 0x68, 0x09, 0x68, 0x12, 0x68, 0xb2, 0xf1, + 0xff, 0x3f, 0xc4, 0xbf, 0x02, 0x20, 0x70, 0x47, 0xc5, 0x4a, 0x41, 0xf3, + 0x07, 0x21, 0x40, 0xb2, 0x92, 0xf9, 0xd8, 0x2d, 0x90, 0x42, 0x04, 0xda, + 0x03, 0x20, 0x91, 0x42, 0xb8, 0xbf, 0x05, 0x20, 0x70, 0x47, 0x01, 0x20, + 0x91, 0x42, 0xb8, 0xbf, 0x04, 0x20, 0x70, 0x47, 0x7c, 0x8c, 0x12, 0x10, + 0x58, 0x95, 0x23, 0x40, 0x2d, 0xe9, 0xf8, 0x4f, 0xdf, 0xf8, 0x74, 0x80, + 0x0d, 0x7a, 0xc4, 0x78, 0x90, 0xf8, 0x06, 0xa0, 0xc0, 0x79, 0x1b, 0x4e, + 0xb1, 0xf9, 0x02, 0xb0, 0xb1, 0xf8, 0x06, 0x90, 0x89, 0x88, 0xd8, 0xf8, + 0x00, 0x30, 0x00, 0x90, 0x30, 0x46, 0x2a, 0x46, 0x98, 0x47, 0xd8, 0xf8, + 0x00, 0x30, 0x07, 0x46, 0x06, 0xf1, 0x50, 0x00, 0x49, 0x46, 0x2a, 0x46, + 0x98, 0x47, 0x07, 0xeb, 0x0b, 0x01, 0x00, 0x2c, 0xa0, 0xeb, 0x01, 0x00, + 0x06, 0xf1, 0xe0, 0x01, 0x08, 0xbf, 0x06, 0xf1, 0xa0, 0x01, 0x00, 0x2c, + 0x31, 0xf9, 0x1a, 0x10, 0x08, 0x44, 0x06, 0xf5, 0x80, 0x71, 0x08, 0xbf, + 0x06, 0xf1, 0xc0, 0x01, 0x00, 0x9a, 0x31, 0xf9, 0x12, 0x10, 0x40, 0x1a, + 0xc1, 0x17, 0x00, 0xeb, 0x51, 0x51, 0x01, 0xf4, 0x78, 0x41, 0x40, 0x1a, + 0x00, 0xb2, 0xbd, 0xe8, 0xf8, 0x8f, 0x00, 0xbf, 0x2c, 0xfc, 0x08, 0x00, + 0x90, 0xcf, 0x01, 0x00, 0x70, 0xb5, 0x8f, 0x4b, 0x04, 0x46, 0x21, 0x48, + 0x5d, 0x1d, 0x21, 0x4b, 0x00, 0x68, 0x1b, 0x78, 0x9b, 0x07, 0x02, 0xd5, + 0x10, 0xf4, 0xfc, 0x4f, 0x0e, 0xd0, 0x28, 0x78, 0x01, 0x28, 0x0f, 0xd0, + 0x1d, 0x48, 0x00, 0x78, 0x01, 0x28, 0x03, 0xd0, 0x1c, 0x48, 0x00, 0x78, + 0x01, 0x28, 0x07, 0xd1, 0x18, 0x48, 0x40, 0xf2, 0x01, 0x13, 0x01, 0xe0, + 0x16, 0x48, 0x00, 0x23, 0xa0, 0xf8, 0xb4, 0x32, 0x94, 0xf8, 0x74, 0x00, + 0x83, 0x06, 0x44, 0xbf, 0x00, 0xf0, 0x03, 0x00, 0x80, 0xf0, 0x0f, 0x00, + 0x28, 0x71, 0x69, 0x71, 0xa8, 0x79, 0x28, 0xb1, 0x94, 0xf8, 0x93, 0x60, + 0x01, 0x20, 0x84, 0xf8, 0x93, 0x00, 0xff, 0xe7, 0x20, 0x46, 0x00, 0xf0, + 0x85, 0xfb, 0x0d, 0x48, 0x01, 0x68, 0x01, 0x20, 0x88, 0x47, 0x94, 0xf8, + 0x35, 0x11, 0x0b, 0x4a, 0x01, 0xeb, 0x41, 0x01, 0x02, 0xeb, 0x41, 0x11, + 0x48, 0x73, 0xa8, 0x79, 0x08, 0xb1, 0x84, 0xf8, 0x93, 0x60, 0x70, 0xbd, + 0x14, 0x23, 0x21, 0x40, 0x8c, 0x32, 0x06, 0x00, 0x98, 0xca, 0x01, 0x00, + 0xa8, 0x58, 0x01, 0x00, 0xa9, 0x58, 0x01, 0x00, 0xcc, 0xbd, 0x08, 0x00, + 0x54, 0xf1, 0x05, 0x00, 0x70, 0xb5, 0x12, 0x4c, 0x94, 0xf8, 0x5f, 0x50, + 0xf5, 0xb1, 0x56, 0x34, 0x25, 0x78, 0x66, 0x78, 0xb5, 0x42, 0x19, 0xd1, + 0x65, 0x88, 0x01, 0x2a, 0x04, 0xd8, 0xa0, 0x88, 0xa5, 0xf1, 0x0c, 0x02, + 0x0c, 0x38, 0x03, 0xe0, 0x2a, 0x1a, 0x18, 0x1a, 0xa3, 0x88, 0x18, 0x44, + 0xb1, 0xf9, 0x00, 0x40, 0x13, 0xb2, 0xb1, 0xf9, 0x02, 0x50, 0x9c, 0x42, + 0xb8, 0xbf, 0x22, 0x46, 0x0a, 0x80, 0x02, 0xb2, 0x95, 0x42, 0xb8, 0xbf, + 0x28, 0x46, 0x48, 0x80, 0x70, 0xbd, 0x00, 0xbf, 0xd0, 0xe2, 0x05, 0x00, + 0xf0, 0xb5, 0x05, 0x46, 0x90, 0xf9, 0x02, 0x40, 0x15, 0x48, 0xb1, 0xf9, + 0x04, 0x60, 0x02, 0x2a, 0xb5, 0xf9, 0x00, 0x50, 0x20, 0x5c, 0x04, 0xd0, + 0x01, 0x2a, 0x04, 0xd0, 0x62, 0xb9, 0xb5, 0x42, 0x04, 0xe0, 0xb5, 0x42, + 0x0f, 0xe0, 0x0c, 0x3d, 0x2f, 0xb2, 0xb7, 0x42, 0xb8, 0xbf, 0x2e, 0x46, + 0xa6, 0xf1, 0x0c, 0x05, 0x2f, 0x46, 0x0a, 0xe0, 0x24, 0xea, 0xe4, 0x77, + 0xff, 0xb2, 0x3f, 0x1a, 0x3d, 0x44, 0x2f, 0xb2, 0xb7, 0x42, 0xb8, 0xbf, + 0x2e, 0x46, 0x37, 0x1a, 0x3d, 0x19, 0xde, 0x81, 0x9d, 0x81, 0x5f, 0x81, + 0x23, 0x46, 0xbd, 0xe8, 0xf0, 0x40, 0xff, 0xf7, 0xa9, 0xbf, 0x00, 0xbf, + 0x10, 0x8c, 0x12, 0x10, 0x2d, 0xe9, 0xf0, 0x47, 0xdf, 0xf8, 0xdc, 0xe0, + 0xdd, 0xe9, 0x08, 0xc9, 0x9e, 0xf9, 0x09, 0x50, 0x0c, 0x2d, 0x03, 0xdb, + 0xb5, 0xf1, 0x10, 0x04, 0xb8, 0xbf, 0x25, 0x46, 0x3b, 0x4c, 0x04, 0xf6, + 0xda, 0x54, 0x49, 0xb1, 0x04, 0xf1, 0x0a, 0x01, 0x94, 0xf9, 0x19, 0xa0, + 0x66, 0x78, 0xa7, 0x7d, 0x94, 0xf8, 0x17, 0x80, 0x0c, 0x46, 0x06, 0xe0, + 0x14, 0xf8, 0x08, 0x7b, 0x4f, 0xf0, 0x00, 0x0a, 0x4f, 0xf0, 0x00, 0x08, + 0x7e, 0x42, 0x28, 0xb1, 0xb4, 0xf9, 0x00, 0x10, 0xb2, 0xf9, 0x00, 0x40, + 0x8c, 0x42, 0x02, 0xda, 0x00, 0x27, 0x00, 0x26, 0x04, 0xe0, 0x69, 0xb2, + 0x8a, 0x45, 0xc4, 0xbf, 0x00, 0x26, 0x00, 0x27, 0x92, 0xf9, 0x02, 0x10, + 0x74, 0xb2, 0xa1, 0x42, 0x02, 0xdd, 0x7d, 0xb2, 0xa9, 0x42, 0x03, 0xdb, + 0x10, 0xb3, 0x9e, 0xf8, 0x0b, 0x00, 0xf8, 0xb1, 0xd0, 0x78, 0xe8, 0xb1, + 0x10, 0x79, 0xd8, 0xb1, 0x40, 0xf2, 0x01, 0x10, 0x19, 0x46, 0x4b, 0x46, + 0xa9, 0xf8, 0x00, 0x00, 0x01, 0x20, 0x89, 0xf8, 0x02, 0x00, 0x92, 0xf9, + 0x02, 0x00, 0xa0, 0xeb, 0x08, 0x00, 0x10, 0xf1, 0x3f, 0x0f, 0xd8, 0xbf, + 0x6f, 0xf0, 0x3e, 0x00, 0x3f, 0x28, 0xa8, 0xbf, 0x3f, 0x20, 0x90, 0x70, + 0x10, 0x46, 0x62, 0x46, 0xbd, 0xe8, 0xf0, 0x47, 0xff, 0xf7, 0x70, 0xbf, + 0xa1, 0x42, 0x09, 0xdd, 0x10, 0x79, 0x38, 0xb1, 0x01, 0x20, 0x89, 0xf8, + 0x01, 0x00, 0x58, 0x88, 0xa9, 0xf8, 0x0c, 0x00, 0xbd, 0xe8, 0xf0, 0x87, + 0x01, 0x20, 0x89, 0xf8, 0x00, 0x00, 0x18, 0x88, 0xa9, 0xf8, 0x0a, 0x00, + 0xbd, 0xe8, 0xf0, 0x87, 0x48, 0xdc, 0x05, 0x00, 0x08, 0x49, 0x91, 0xf8, + 0xf2, 0x1d, 0x59, 0xb1, 0x0c, 0x28, 0x04, 0xbf, 0x0c, 0x20, 0x70, 0x47, + 0x41, 0x1e, 0x4a, 0xb2, 0x00, 0x2a, 0x48, 0xbf, 0x00, 0xf1, 0x0f, 0x01, + 0x48, 0xb2, 0x70, 0x47, 0x0b, 0x20, 0x70, 0x47, 0x00, 0x69, 0x08, 0x00, + 0xf8, 0xb5, 0xd9, 0x4f, 0x04, 0x46, 0x15, 0x46, 0x0e, 0x46, 0x78, 0x7a, + 0xff, 0xf7, 0xe4, 0xff, 0x00, 0x28, 0x11, 0xd4, 0x0f, 0x28, 0x0f, 0xdc, + 0xb9, 0x7a, 0x1f, 0x4a, 0x02, 0xeb, 0x41, 0x11, 0x31, 0xf9, 0x10, 0x20, + 0x01, 0xeb, 0x40, 0x00, 0xb2, 0x42, 0xd8, 0xbf, 0x16, 0x46, 0xb0, 0xf9, + 0x80, 0x00, 0xa8, 0x42, 0xd8, 0xbf, 0x05, 0x46, 0xb9, 0x7a, 0x18, 0x4a, + 0x01, 0x20, 0x00, 0xfa, 0x01, 0xf3, 0x90, 0x8c, 0x03, 0x42, 0x08, 0xd0, + 0x02, 0xeb, 0x41, 0x00, 0x37, 0xb2, 0xb0, 0xf9, 0x2e, 0x00, 0x87, 0x42, + 0xb8, 0xbf, 0x30, 0x46, 0x00, 0xe0, 0x30, 0x46, 0xd6, 0x8e, 0x33, 0x42, + 0x08, 0xd0, 0x02, 0xeb, 0x41, 0x01, 0x2a, 0xb2, 0xb1, 0xf9, 0x40, 0x10, + 0x8a, 0x42, 0xb8, 0xbf, 0x29, 0x46, 0x00, 0xe0, 0x29, 0x46, 0xb4, 0xf9, + 0x0a, 0x30, 0x02, 0xb2, 0x93, 0x42, 0xc6, 0xbf, 0x60, 0x81, 0x01, 0x20, + 0x00, 0x20, 0x0a, 0xb2, 0xb4, 0xf9, 0x0c, 0x30, 0x93, 0x42, 0xc4, 0xbf, + 0xa1, 0x81, 0x01, 0x20, 0xf8, 0xbd, 0x00, 0xbf, 0xb2, 0xd0, 0x01, 0x00, + 0xd8, 0xdb, 0x05, 0x00, 0x2d, 0xe9, 0xf0, 0x4f, 0x8b, 0xb0, 0x80, 0x46, + 0x00, 0x20, 0xdf, 0xf8, 0xbc, 0xb2, 0x9a, 0x46, 0xcd, 0xe9, 0x06, 0x00, + 0xad, 0xf8, 0x2a, 0x00, 0xad, 0xf8, 0x28, 0x00, 0xcd, 0xe9, 0x04, 0x00, + 0x90, 0x06, 0x44, 0xbf, 0x02, 0xf0, 0x03, 0x00, 0x80, 0xf0, 0x0f, 0x02, + 0xad, 0xf8, 0x20, 0x10, 0x4f, 0xf4, 0x7f, 0x40, 0x8b, 0xf8, 0x09, 0x20, + 0x02, 0xaa, 0x8b, 0xf8, 0x0a, 0xa0, 0xad, 0xf8, 0x1a, 0x00, 0xad, 0xf8, + 0x1c, 0x00, 0xa1, 0x48, 0x03, 0x68, 0x08, 0x46, 0x51, 0x46, 0x98, 0x47, + 0xe8, 0x48, 0x00, 0xf6, 0xd4, 0x54, 0x90, 0xf8, 0xd4, 0x0d, 0x18, 0xb1, + 0x98, 0xf8, 0x0c, 0x00, 0x00, 0x28, 0x5b, 0xd0, 0x4f, 0xf0, 0x00, 0x09, + 0x9a, 0x4f, 0x46, 0x46, 0xbd, 0xf8, 0x0c, 0x00, 0x16, 0xf9, 0x02, 0x5f, + 0x39, 0x68, 0xad, 0xf8, 0x1e, 0x00, 0x00, 0x20, 0x8d, 0xf8, 0x22, 0x50, + 0x88, 0x47, 0x39, 0x68, 0x8d, 0xf8, 0x23, 0x00, 0x01, 0x20, 0x88, 0x47, + 0x8d, 0xf8, 0x24, 0x00, 0x16, 0xf8, 0x01, 0x0c, 0x18, 0xb9, 0x9b, 0xf8, + 0x0b, 0x00, 0x00, 0x28, 0x58, 0xd0, 0x94, 0xf9, 0x05, 0x00, 0x85, 0x42, + 0x04, 0xda, 0x40, 0x42, 0x85, 0x42, 0x04, 0xdc, 0x00, 0x20, 0x00, 0xe0, + 0x01, 0x20, 0x88, 0xf8, 0x00, 0x00, 0xa0, 0x78, 0xe8, 0xb1, 0x01, 0x20, + 0x04, 0xa9, 0x08, 0xaa, 0x02, 0xab, 0x8d, 0xf8, 0x13, 0x00, 0xe1, 0x48, + 0x05, 0x68, 0x60, 0x7a, 0xcd, 0xe9, 0x00, 0x01, 0x48, 0x46, 0x00, 0x21, + 0xa8, 0x47, 0xb4, 0xf9, 0x0a, 0x00, 0xbd, 0xf9, 0x1a, 0x10, 0x81, 0x42, + 0x05, 0xdc, 0xb4, 0xf9, 0x0c, 0x00, 0xbd, 0xf9, 0x1c, 0x10, 0x81, 0x42, + 0x03, 0xdd, 0xe0, 0x78, 0x08, 0xb1, 0x00, 0x20, 0x04, 0x90, 0x9d, 0xf8, + 0x13, 0x00, 0x00, 0x28, 0x4d, 0xd1, 0xe0, 0x78, 0x00, 0x28, 0x4a, 0xd0, + 0xd1, 0x48, 0x04, 0xa9, 0x08, 0xaa, 0x02, 0xab, 0x05, 0x68, 0x20, 0x7a, + 0xcd, 0xe9, 0x00, 0x01, 0x48, 0x46, 0x01, 0x21, 0xa8, 0x47, 0x3e, 0xe0, + 0x15, 0x99, 0x6c, 0x48, 0x0a, 0x46, 0x00, 0x29, 0x18, 0xbf, 0x01, 0x22, + 0x90, 0xf8, 0x20, 0x01, 0x00, 0x28, 0x03, 0x46, 0x18, 0xbf, 0x01, 0x23, + 0x02, 0xea, 0x03, 0x09, 0x00, 0x29, 0x95, 0xd1, 0x00, 0x28, 0x93, 0xd0, + 0x94, 0xf8, 0x01, 0x90, 0xb9, 0xf1, 0x00, 0x0f, 0x18, 0xbf, 0x4f, 0xf0, + 0x01, 0x09, 0x8b, 0xe7, 0x98, 0xf8, 0x00, 0x00, 0x70, 0xb1, 0x01, 0x20, + 0xa1, 0x78, 0x8d, 0xf8, 0x11, 0x00, 0xbd, 0xf9, 0x0a, 0x00, 0xad, 0xf8, + 0x1c, 0x00, 0xc1, 0xb1, 0xa3, 0x49, 0x01, 0xeb, 0x4a, 0x11, 0xb1, 0xf9, + 0x96, 0x10, 0x0d, 0xe0, 0x01, 0x20, 0xa1, 0x78, 0x8d, 0xf8, 0x10, 0x00, + 0xbd, 0xf9, 0x08, 0x00, 0xad, 0xf8, 0x1a, 0x00, 0x49, 0xb1, 0x9c, 0x49, + 0x01, 0xeb, 0x4a, 0x11, 0xb1, 0xf9, 0x16, 0x10, 0x88, 0x42, 0xdc, 0xbf, + 0x01, 0x20, 0x8d, 0xf8, 0x13, 0x00, 0x9d, 0xf8, 0x12, 0x00, 0xc0, 0xb1, + 0x95, 0x48, 0xbd, 0xf9, 0x08, 0x10, 0xbd, 0xf9, 0x0a, 0x20, 0x00, 0xeb, + 0x4a, 0x10, 0xb0, 0xf9, 0x16, 0x30, 0xb0, 0xf9, 0x96, 0x00, 0x8b, 0x42, + 0xb8, 0xbf, 0x19, 0x46, 0x90, 0x42, 0xb8, 0xbf, 0x02, 0x46, 0xa4, 0x48, + 0x03, 0x68, 0x04, 0xa8, 0x98, 0x47, 0x9d, 0xf8, 0x10, 0x00, 0x40, 0xb9, + 0x0f, 0xe0, 0x9d, 0xf8, 0x10, 0x00, 0x00, 0x28, 0x71, 0xd0, 0xbd, 0xf8, + 0x08, 0x00, 0xad, 0xf8, 0x1e, 0x00, 0x86, 0x48, 0x04, 0xaa, 0x0d, 0xf1, + 0x2a, 0x03, 0x00, 0x21, 0x04, 0x68, 0x50, 0x46, 0xa0, 0x47, 0x9d, 0xf8, + 0x11, 0x00, 0x70, 0xb1, 0x80, 0x48, 0x04, 0xaa, 0x0a, 0xab, 0x01, 0x21, + 0x04, 0x68, 0x50, 0x46, 0xa0, 0x47, 0x9d, 0xf8, 0x12, 0x00, 0x38, 0xb9, + 0xbd, 0xf8, 0x28, 0x00, 0x6f, 0xf3, 0xdf, 0x30, 0x0f, 0xe0, 0x9d, 0xf8, + 0x12, 0x00, 0x70, 0xb1, 0x04, 0xa8, 0x31, 0x46, 0xff, 0xf7, 0x26, 0xfd, + 0xad, 0xf8, 0x18, 0x00, 0x75, 0x48, 0xbd, 0xf8, 0x28, 0x10, 0x02, 0x68, + 0xbd, 0xf8, 0x2a, 0x00, 0x90, 0x47, 0xad, 0xf8, 0x2a, 0x00, 0x72, 0x48, + 0x90, 0xf8, 0x71, 0x01, 0x88, 0xb3, 0xbd, 0xf8, 0x18, 0x10, 0x70, 0x4a, + 0x9d, 0xf8, 0x14, 0x50, 0x9d, 0xf8, 0x11, 0x30, 0x14, 0x98, 0x9d, 0xf8, + 0x12, 0x40, 0x02, 0xea, 0x01, 0x41, 0x9d, 0xf8, 0x10, 0x20, 0x05, 0xf0, + 0x1f, 0x05, 0x45, 0xea, 0xc2, 0x12, 0x9d, 0xf8, 0x15, 0x50, 0x05, 0xf0, + 0x1f, 0x05, 0x42, 0xea, 0x05, 0x22, 0x42, 0xea, 0xc3, 0x32, 0x11, 0x43, + 0x64, 0x4a, 0x41, 0xea, 0xc4, 0x71, 0x52, 0xf8, 0x20, 0x20, 0x11, 0x60, + 0x62, 0x49, 0x4f, 0xf6, 0xff, 0x72, 0x51, 0xf8, 0x20, 0x00, 0x01, 0x68, + 0x91, 0x43, 0xbd, 0xf8, 0x2a, 0x20, 0x11, 0x44, 0x01, 0x60, 0x01, 0x68, + 0xbd, 0xf8, 0x28, 0x20, 0xc1, 0xea, 0x02, 0x41, 0x01, 0x60, 0x0c, 0x48, + 0x51, 0x46, 0x02, 0x68, 0x04, 0xa8, 0x90, 0x47, 0x9d, 0xf8, 0x24, 0x00, + 0x88, 0xf8, 0x1a, 0x00, 0x0b, 0xb0, 0xbd, 0xe8, 0xf0, 0x8f, 0xbd, 0xf8, + 0x0a, 0x00, 0xad, 0xf8, 0x1e, 0x00, 0x94, 0xe7, 0x48, 0xdc, 0x05, 0x00, + 0x98, 0xbd, 0x08, 0x00, 0x90, 0xcf, 0x01, 0x00, 0xcc, 0xbd, 0x08, 0x00, + 0xa4, 0xbd, 0x08, 0x00, 0x2d, 0xe9, 0xff, 0x41, 0x16, 0x46, 0x43, 0x4a, + 0xdd, 0xf8, 0x28, 0x80, 0x4f, 0xf0, 0x01, 0x0c, 0x4f, 0xf4, 0x7f, 0x45, + 0x1c, 0x46, 0xad, 0xf8, 0x08, 0x00, 0x02, 0xa8, 0x8d, 0xf8, 0x0c, 0xc0, + 0x51, 0x72, 0x82, 0xf8, 0x0a, 0x80, 0x00, 0x21, 0x3b, 0x4a, 0x83, 0xf8, + 0x02, 0xc0, 0xb7, 0x88, 0x19, 0x81, 0x9d, 0x81, 0x40, 0xf2, 0x01, 0x13, + 0xad, 0xf8, 0x06, 0x10, 0xad, 0xf8, 0x04, 0x10, 0x31, 0x46, 0x65, 0x81, + 0x92, 0xf8, 0xe7, 0x2d, 0x23, 0x80, 0x4f, 0xf4, 0x80, 0x73, 0xad, 0xf8, + 0x0a, 0x30, 0x23, 0x46, 0xe7, 0x81, 0xff, 0xf7, 0x5b, 0xfd, 0x30, 0x48, + 0xb6, 0xf9, 0x00, 0x10, 0xb6, 0xf9, 0x02, 0x20, 0x00, 0xeb, 0x48, 0x10, + 0xb0, 0xf9, 0x16, 0x30, 0xb0, 0xf9, 0x96, 0x00, 0x8b, 0x42, 0xb8, 0xbf, + 0x19, 0x46, 0x90, 0x42, 0xb8, 0xbf, 0x02, 0x46, 0x3e, 0x48, 0x03, 0x68, + 0x20, 0x46, 0x98, 0x47, 0x26, 0x4d, 0x0d, 0xf1, 0x06, 0x03, 0x40, 0x46, + 0x00, 0x21, 0x22, 0x46, 0x2e, 0x68, 0xb0, 0x47, 0x2d, 0x68, 0x01, 0xab, + 0x40, 0x46, 0x01, 0x21, 0x22, 0x46, 0xa8, 0x47, 0x20, 0x48, 0xbd, 0xf8, + 0x04, 0x10, 0x02, 0x68, 0xbd, 0xf8, 0x06, 0x00, 0x90, 0x47, 0x1e, 0x49, + 0xad, 0xf8, 0x06, 0x00, 0x91, 0xf8, 0x71, 0x11, 0x49, 0xb3, 0x22, 0x89, + 0x1b, 0x4b, 0x27, 0x79, 0x65, 0x78, 0xa6, 0x78, 0x0b, 0x99, 0x03, 0xea, + 0x02, 0x42, 0x23, 0x78, 0x64, 0x79, 0x07, 0xf0, 0x1f, 0x07, 0x47, 0xea, + 0xc3, 0x13, 0x04, 0xf0, 0x1f, 0x04, 0x43, 0xea, 0x04, 0x23, 0x43, 0xea, + 0xc5, 0x33, 0x1a, 0x43, 0x12, 0x4b, 0x42, 0xea, 0xc6, 0x72, 0x53, 0xf8, + 0x21, 0x30, 0x1a, 0x60, 0x10, 0x4a, 0x4f, 0xf6, 0xff, 0x73, 0x52, 0xf8, + 0x21, 0x10, 0x0a, 0x68, 0x9a, 0x43, 0x10, 0x44, 0x08, 0x60, 0x08, 0x68, + 0xbd, 0xf8, 0x04, 0x20, 0xc0, 0xea, 0x02, 0x40, 0x08, 0x60, 0xbd, 0xe8, + 0xff, 0x81, 0x00, 0xbf, 0x48, 0xdc, 0x05, 0x00, 0x00, 0x69, 0x08, 0x00, + 0xb2, 0xd0, 0x01, 0x00, 0x74, 0xbd, 0x08, 0x00, 0xc8, 0xbd, 0x08, 0x00, + 0x8c, 0x7e, 0x08, 0x00, 0x00, 0x00, 0xff, 0x07, 0xc8, 0x15, 0x01, 0x10, + 0xd8, 0x15, 0x01, 0x10, 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, + 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, + 0x09, 0x49, 0x01, 0x60, 0x09, 0x48, 0x0a, 0x49, 0x01, 0x60, 0x70, 0x47, + 0xfc, 0xbb, 0x08, 0x00, 0xe1, 0xb6, 0x05, 0x00, 0x68, 0xbd, 0x08, 0x00, + 0x39, 0xb6, 0x05, 0x00, 0xa0, 0xa2, 0x08, 0x00, 0xe5, 0xbb, 0x05, 0x00, + 0x6c, 0xbd, 0x08, 0x00, 0x41, 0xbd, 0x05, 0x00, 0x70, 0xbd, 0x08, 0x00, + 0x51, 0xbe, 0x05, 0x00, 0x48, 0xf2, 0xdb, 0x7c, 0xc1, 0xf2, 0x12, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x48, 0xf6, 0xf7, 0x0c, 0xc1, 0xf2, 0x12, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x0b, 0x48, 0x05, 0x49, 0x00, 0x68, 0x08, 0x60, + 0x00, 0xf0, 0x56, 0xb9, 0x02, 0x48, 0x08, 0x49, 0x00, 0x68, 0x08, 0x60, + 0x00, 0xf0, 0x56, 0xb9, 0xc0, 0x2a, 0x06, 0x00, 0x8a, 0x48, 0x04, 0x49, + 0x90, 0xf8, 0x2f, 0x01, 0x0a, 0x68, 0x60, 0xf3, 0x05, 0x02, 0x0a, 0x60, + 0x00, 0xf0, 0x50, 0xb9, 0x0c, 0x90, 0x23, 0x40, 0x70, 0xb5, 0x25, 0x48, + 0x25, 0x4c, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x01, 0x28, 0x42, 0xd1, + 0x23, 0x49, 0x20, 0x68, 0x01, 0x24, 0x40, 0xf6, 0xf8, 0x76, 0x4a, 0x6b, + 0x48, 0x63, 0x41, 0xf2, 0xae, 0x00, 0x7c, 0x4a, 0x10, 0x5c, 0x0b, 0x68, + 0x23, 0xf0, 0xff, 0x03, 0x03, 0x44, 0x0b, 0x60, 0x0b, 0x68, 0x64, 0xf3, + 0x11, 0x23, 0x1b, 0x4c, 0x0b, 0x60, 0x41, 0xf2, 0xad, 0x03, 0xd3, 0x5c, + 0x25, 0x68, 0xb5, 0x43, 0x45, 0xea, 0x03, 0x13, 0x23, 0x60, 0x41, 0xf2, + 0xbc, 0x03, 0xd2, 0x58, 0x52, 0x07, 0x15, 0x4a, 0x13, 0x68, 0x06, 0xd4, + 0x23, 0xf0, 0x02, 0x03, 0x13, 0x60, 0x13, 0x68, 0xc1, 0xf2, 0x00, 0x03, + 0x01, 0xe0, 0x43, 0xf0, 0x02, 0x03, 0x13, 0x60, 0x00, 0x22, 0x10, 0x4b, + 0x4a, 0x61, 0x0e, 0x49, 0x09, 0x78, 0x01, 0xeb, 0x81, 0x01, 0x03, 0xeb, + 0x41, 0x11, 0x01, 0xf8, 0x38, 0x0f, 0x03, 0x20, 0x08, 0x77, 0x01, 0x20, + 0x48, 0x70, 0x0a, 0x48, 0x08, 0x40, 0x00, 0xf5, 0x00, 0x00, 0x41, 0xe9, + 0x0c, 0x02, 0x70, 0xbd, 0xc0, 0xd3, 0x08, 0x00, 0xb8, 0xe9, 0x01, 0x00, + 0xb8, 0x12, 0x21, 0x40, 0x58, 0x00, 0x21, 0x40, 0x90, 0x01, 0x23, 0x40, + 0x74, 0x87, 0x08, 0x00, 0xbc, 0x65, 0x01, 0x00, 0xfc, 0xff, 0x3f, 0x00, + 0x10, 0xb5, 0x04, 0x46, 0x10, 0x48, 0x02, 0x21, 0x02, 0x68, 0xc4, 0xf3, + 0x03, 0x10, 0x90, 0x47, 0x43, 0xf6, 0xdf, 0x71, 0x4f, 0xf6, 0xff, 0x73, + 0x08, 0x40, 0x0c, 0x49, 0xc9, 0x68, 0x0a, 0x68, 0x9a, 0x43, 0x02, 0x44, + 0x0a, 0x60, 0x0a, 0x68, 0xc2, 0xea, 0x00, 0x40, 0xa2, 0x07, 0x08, 0x60, + 0x07, 0x48, 0x4f, 0xf0, 0x00, 0x01, 0x01, 0x60, 0x01, 0x68, 0x4c, 0xbf, + 0x41, 0xf4, 0x00, 0x41, 0x41, 0xf0, 0x80, 0x01, 0x01, 0x60, 0x10, 0xbd, + 0x9c, 0xbd, 0x08, 0x00, 0xd8, 0x15, 0x01, 0x10, 0xa0, 0x10, 0x21, 0x40, + 0x2d, 0xe9, 0xfe, 0x4f, 0x8d, 0xe8, 0x07, 0x00, 0x00, 0xeb, 0x81, 0x00, + 0x24, 0x4e, 0x3e, 0x4f, 0xdf, 0xf8, 0x90, 0x80, 0x4f, 0xf0, 0xff, 0x35, + 0x41, 0xf2, 0xc9, 0x04, 0x00, 0xf1, 0x02, 0x0b, 0x21, 0x48, 0x00, 0xf1, + 0x01, 0x09, 0x38, 0x5d, 0x01, 0x35, 0x85, 0x42, 0x35, 0xd2, 0x30, 0x69, + 0xb0, 0xf1, 0xff, 0x3f, 0x02, 0xdd, 0x4f, 0xf0, 0x00, 0x0a, 0x24, 0xe0, + 0x30, 0x68, 0x02, 0x99, 0x01, 0x29, 0x04, 0xd1, 0xc0, 0xf3, 0xc0, 0x51, + 0x30, 0x68, 0xc0, 0xb2, 0x02, 0xe0, 0xc1, 0x0f, 0x30, 0x68, 0x00, 0x0a, + 0x41, 0xf2, 0xbc, 0x02, 0xba, 0x5c, 0x92, 0x07, 0x08, 0xd5, 0x21, 0xb1, + 0x97, 0xf9, 0xd8, 0x1d, 0x42, 0xb2, 0x8a, 0x42, 0x02, 0xda, 0x4f, 0xf0, + 0x00, 0x0a, 0x08, 0xe0, 0x31, 0x69, 0x4f, 0xf0, 0x01, 0x0a, 0x41, 0xf3, + 0x0a, 0x01, 0xdd, 0xe9, 0x00, 0x32, 0x23, 0xf8, 0x22, 0x10, 0x8b, 0xf8, + 0x00, 0x00, 0xb8, 0xf8, 0x00, 0x00, 0x02, 0x38, 0xc8, 0x47, 0xba, 0xf1, + 0x00, 0x0f, 0xc8, 0xd0, 0x01, 0x20, 0xbd, 0xe8, 0xfe, 0x8f, 0x00, 0x20, + 0xbd, 0xe8, 0xfe, 0x8f, 0x48, 0x95, 0x23, 0x40, 0x34, 0xec, 0x01, 0x00, + 0x40, 0xec, 0x01, 0x00, 0x2d, 0xe9, 0xf0, 0x41, 0xec, 0xf7, 0x6c, 0xfc, + 0x25, 0x24, 0x14, 0x4e, 0x41, 0xf2, 0xb3, 0x08, 0x90, 0xfb, 0xf4, 0xf1, + 0x01, 0xfb, 0x14, 0x00, 0x16, 0xf8, 0x08, 0x10, 0xa9, 0xb1, 0x41, 0xf2, + 0xb4, 0x07, 0x00, 0x22, 0xb3, 0x18, 0xc5, 0xb2, 0xdb, 0x5d, 0xab, 0x42, + 0x03, 0xd0, 0x01, 0x32, 0x8a, 0x42, 0xf7, 0xd3, 0x09, 0xe0, 0xec, 0xf7, + 0x53, 0xfc, 0x90, 0xfb, 0xf4, 0xf1, 0x01, 0xfb, 0x14, 0x00, 0x16, 0xf8, + 0x08, 0x10, 0x00, 0x29, 0xeb, 0xd1, 0x01, 0x21, 0x61, 0xf3, 0x1f, 0x20, + 0x03, 0x49, 0x08, 0x60, 0x03, 0x49, 0x08, 0x60, 0xbd, 0xe8, 0xf0, 0x81, + 0x00, 0x69, 0x08, 0x00, 0x30, 0x10, 0x21, 0x40, 0x80, 0x10, 0x21, 0x40, + 0x0a, 0x48, 0x0b, 0x49, 0x01, 0x60, 0x0b, 0x48, 0x0b, 0x49, 0x01, 0x60, + 0x0b, 0x48, 0x0c, 0x49, 0x01, 0x60, 0x0c, 0x48, 0x0c, 0x49, 0x01, 0x60, + 0x0c, 0x48, 0x0d, 0x49, 0x01, 0x60, 0x0d, 0x48, 0x0d, 0x49, 0x01, 0x60, + 0x0d, 0x48, 0x0e, 0x49, 0x01, 0x60, 0x70, 0x47, 0xe8, 0xfd, 0x08, 0x00, + 0x65, 0xc3, 0x05, 0x00, 0xbc, 0xfe, 0x08, 0x00, 0x81, 0xc3, 0x05, 0x00, + 0xec, 0xfd, 0x08, 0x00, 0x71, 0xc3, 0x05, 0x00, 0xb8, 0xfe, 0x08, 0x00, + 0x99, 0xc3, 0x05, 0x00, 0x44, 0xfd, 0x08, 0x00, 0xa5, 0xc4, 0x05, 0x00, + 0x34, 0xfd, 0x08, 0x00, 0x51, 0xc5, 0x05, 0x00, 0x38, 0xfd, 0x08, 0x00, + 0x51, 0xc4, 0x05, 0x00, 0x41, 0xf6, 0xe3, 0x5c, 0xc1, 0xf2, 0x01, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0x0b, 0x6c, 0xc1, 0xf2, 0x01, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x41, 0xf6, 0x01, 0x1c, 0xc1, 0xf2, 0x01, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0x0c, 0x90, 0x23, 0x40, 0x70, 0xb5, 0x2c, 0x4d, + 0x2c, 0x4c, 0x2d, 0x4e, 0x0c, 0x21, 0x0c, 0x23, 0x28, 0x46, 0x22, 0x46, + 0xb0, 0x47, 0x05, 0xf1, 0x0c, 0x00, 0x04, 0xf1, 0x40, 0x02, 0x14, 0x21, + 0x14, 0x23, 0xb0, 0x47, 0x05, 0xf1, 0x20, 0x00, 0x04, 0xf1, 0x80, 0x02, + 0x68, 0x21, 0x68, 0x23, 0xb0, 0x47, 0xd4, 0xf8, 0x00, 0x01, 0x04, 0xf5, + 0xa0, 0x72, 0x14, 0x21, 0x14, 0x23, 0xc5, 0xf8, 0x88, 0x00, 0xd4, 0xf8, + 0x04, 0x01, 0xc5, 0xf8, 0x8c, 0x00, 0x05, 0xf1, 0x90, 0x00, 0xb0, 0x47, + 0x05, 0xf1, 0xa4, 0x00, 0x04, 0xf5, 0xc0, 0x72, 0x38, 0x21, 0x38, 0x23, + 0xb0, 0x47, 0x19, 0x4d, 0x04, 0xf5, 0x80, 0x62, 0x0c, 0x21, 0x0c, 0x23, + 0x28, 0x46, 0xb0, 0x47, 0x05, 0xf1, 0x0c, 0x00, 0x04, 0xf5, 0x88, 0x62, + 0x14, 0x21, 0x14, 0x23, 0xb0, 0x47, 0x05, 0xf1, 0x20, 0x00, 0x04, 0xf5, + 0x90, 0x62, 0x68, 0x21, 0x68, 0x23, 0xb0, 0x47, 0xd4, 0xf8, 0x00, 0x05, + 0x0f, 0x4a, 0x14, 0x21, 0x14, 0x23, 0xc5, 0xf8, 0x88, 0x00, 0x0c, 0x48, + 0x00, 0x68, 0xc5, 0xf8, 0x8c, 0x00, 0x05, 0xf1, 0x90, 0x00, 0xb0, 0x47, + 0x0a, 0x4a, 0x05, 0xf1, 0xa4, 0x00, 0x38, 0x21, 0x38, 0x23, 0xb4, 0x46, + 0xbd, 0xe8, 0x70, 0x40, 0x60, 0x47, 0x00, 0xbf, 0xc4, 0x2a, 0x06, 0x00, + 0x00, 0x50, 0x05, 0x30, 0x4d, 0xcd, 0x11, 0x10, 0xa0, 0x2b, 0x06, 0x00, + 0x04, 0x55, 0x05, 0x30, 0x40, 0x55, 0x05, 0x30, 0x80, 0x55, 0x05, 0x30, + 0xb0, 0xb5, 0x10, 0x49, 0x02, 0x68, 0x00, 0x23, 0x04, 0x31, 0x51, 0xf8, + 0x04, 0x4c, 0xa2, 0x42, 0x03, 0xd1, 0x0c, 0x68, 0x45, 0x68, 0xa5, 0x42, + 0x07, 0xd0, 0x01, 0x33, 0x08, 0x31, 0x10, 0x2b, 0xf3, 0xd1, 0x1c, 0x48, + 0x80, 0x68, 0xc0, 0x69, 0xb0, 0xbd, 0x07, 0x48, 0x90, 0xf8, 0xc5, 0x11, + 0x90, 0xf8, 0xc6, 0x21, 0x90, 0xf8, 0xc7, 0x01, 0x41, 0xea, 0x02, 0x21, + 0x41, 0xea, 0x00, 0x40, 0xb0, 0xbd, 0x00, 0xbf, 0xc8, 0xc7, 0x05, 0x00, + 0x00, 0x69, 0x08, 0x00, 0xf8, 0xb5, 0x0c, 0x46, 0x20, 0xb1, 0x21, 0x46, + 0xbd, 0xe8, 0xf8, 0x40, 0x00, 0xf0, 0x26, 0xb8, 0x0c, 0x4d, 0x72, 0xb6, + 0x28, 0x68, 0x40, 0x00, 0x01, 0x30, 0x28, 0x60, 0x0a, 0x48, 0x86, 0x68, + 0x20, 0x46, 0xf7, 0x69, 0xff, 0xf7, 0xc6, 0xff, 0xf0, 0x61, 0x00, 0x20, + 0x21, 0x46, 0x00, 0xf0, 0x15, 0xf8, 0xf7, 0x61, 0x28, 0x68, 0x40, 0x08, + 0x28, 0x60, 0x28, 0x68, 0x80, 0xf3, 0x10, 0x88, 0xf8, 0xbd, 0x00, 0xbf, + 0x24, 0x36, 0x01, 0x00, 0x24, 0x75, 0x12, 0x10, 0x01, 0x48, 0x02, 0x49, + 0x01, 0x60, 0x70, 0x47, 0x64, 0xfb, 0x08, 0x00, 0x61, 0xc7, 0x05, 0x00, + 0x47, 0xf2, 0x99, 0x1c, 0xc1, 0xf2, 0x12, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x42, 0x22, 0xa4, 0x44, 0x4a, 0x64, 0x04, 0x4e, 0xd5, 0x7f, 0x15, 0x54, + 0xb5, 0x8a, 0xaa, 0x4e, 0x6b, 0xbd, 0x03, 0x00, 0x30, 0x42, 0x4a, 0xb1, + 0x6b, 0x8c, 0x63, 0xa4, 0x95, 0x52, 0x4b, 0xb1, 0x97, 0x1e, 0x29, 0x73, + 0x66, 0xac, 0x58, 0xb1, 0x46, 0xa3, 0xf5, 0x7a, 0xbd, 0x40, 0x24, 0xb0, + 0xff, 0xeb, 0x39, 0x63, 0x8c, 0x21, 0xa4, 0xb1, 0x32, 0xd5, 0xa1, 0x4c, + 0x65, 0x28, 0xc3, 0xb1, 0x35, 0xaa, 0x5a, 0x45, 0xa4, 0x23, 0xd3, 0xb1, + 0x06, 0x34, 0xb0, 0xc1, 0x45, 0x3c, 0xe2, 0xb1, 0x72, 0xf9, 0x62, 0xc6, + 0x88, 0x13, 0x27, 0x4e, 0x85, 0xaa, 0x54, 0x35, 0xaa, 0x44, 0x2d, 0x4e, + 0x54, 0x08, 0xc4, 0x76, 0xf9, 0x3c, 0x9c, 0x4e, 0xe5, 0x7b, 0xf2, 0x39, + 0x69, 0x9c, 0xb4, 0x4e, 0x83, 0x98, 0xa4, 0xa1, 0x2d, 0x6d, 0x69, 0x4f, + 0xdc, 0x9d, 0xb3, 0x73, 0xf4, 0x84, 0x9f, 0xb0, 0x70, 0xb5, 0x08, 0x4d, + 0x0e, 0x4e, 0x00, 0x24, 0x28, 0x68, 0xe0, 0x40, 0xc0, 0x07, 0x03, 0xd0, + 0x56, 0xf8, 0x24, 0x00, 0x00, 0xb1, 0x80, 0x47, 0x01, 0x34, 0x0e, 0x2c, + 0x08, 0xbf, 0x70, 0xbd, 0xf2, 0xe7, 0x00, 0xbf, 0x40, 0xf4, 0x00, 0x30, + 0x0d, 0x28, 0x88, 0xbf, 0x70, 0x47, 0x04, 0x4a, 0x42, 0xf8, 0x20, 0x10, + 0x03, 0x48, 0x04, 0x49, 0x02, 0x68, 0x01, 0x20, 0x10, 0x47, 0x00, 0xbf, + 0xb4, 0xeb, 0x01, 0x00, 0xc4, 0x9c, 0x08, 0x00, 0x49, 0xc8, 0x05, 0x00, + 0x70, 0x47, 0x00, 0x00, 0x1b, 0x48, 0xc1, 0x7d, 0x05, 0x29, 0x01, 0xd0, + 0x03, 0x29, 0x0b, 0xd1, 0x41, 0x7f, 0x0d, 0x29, 0x02, 0xd8, 0x18, 0x4a, + 0x2a, 0x23, 0x53, 0x54, 0x81, 0x7f, 0x0d, 0x29, 0x02, 0xd8, 0x15, 0x4a, + 0x29, 0x23, 0x53, 0x54, 0x90, 0xf8, 0xa0, 0x15, 0xd1, 0xb1, 0x90, 0xf8, + 0x9c, 0x05, 0xc0, 0x07, 0x17, 0xd1, 0x10, 0x48, 0x05, 0x22, 0x02, 0x29, + 0x00, 0xf8, 0x04, 0x2f, 0x4f, 0xf0, 0x08, 0x02, 0xc2, 0x70, 0x4f, 0xf0, + 0x07, 0x02, 0x82, 0x70, 0x4f, 0xf0, 0x06, 0x02, 0x42, 0x70, 0x07, 0xd3, + 0x2e, 0x21, 0x01, 0x72, 0x2d, 0x21, 0x41, 0x71, 0x30, 0x21, 0x41, 0x72, + 0x2f, 0x21, 0x81, 0x71, 0x70, 0x47, 0x04, 0x48, 0x0f, 0x21, 0xc1, 0x71, + 0x10, 0x21, 0x01, 0x71, 0x70, 0x47, 0x00, 0xbf, 0x8c, 0x7e, 0x08, 0x00, + 0x80, 0x14, 0x01, 0x00, 0x10, 0xb5, 0x04, 0x46, 0x07, 0x48, 0x01, 0x68, + 0x80, 0x20, 0x88, 0x47, 0x06, 0x48, 0x1c, 0x21, 0x02, 0x68, 0x20, 0x46, + 0x90, 0x47, 0x05, 0x48, 0x4f, 0xf4, 0x66, 0x71, 0x40, 0xf8, 0x24, 0x10, + 0x10, 0xbd, 0x00, 0xbf, 0xc0, 0xfe, 0x08, 0x00, 0xd0, 0xfe, 0x08, 0x00, + 0x00, 0xf4, 0x00, 0x30, 0x30, 0x28, 0x05, 0xd8, 0x08, 0x4a, 0x10, 0x5c, + 0x0e, 0x28, 0x08, 0x70, 0x05, 0xd3, 0x06, 0xe0, 0x32, 0x28, 0x04, 0xd1, + 0x03, 0x48, 0x00, 0x78, 0x08, 0x70, 0x01, 0x20, 0x70, 0x47, 0x00, 0x20, + 0x70, 0x47, 0x00, 0xbf, 0x94, 0x32, 0x06, 0x00, 0x4c, 0xeb, 0x01, 0x00, + 0x03, 0x48, 0x04, 0x49, 0x01, 0x60, 0x04, 0x48, 0x04, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0xf4, 0xfe, 0x08, 0x00, 0x41, 0xc9, 0x05, 0x00, + 0xec, 0xfe, 0x08, 0x00, 0x99, 0xc8, 0x05, 0x00, 0x05, 0x28, 0x0e, 0xd8, + 0xb0, 0xb5, 0x07, 0x4c, 0x00, 0x25, 0x44, 0xf8, 0x20, 0x50, 0x06, 0x4d, + 0x45, 0xf8, 0x20, 0x20, 0x0b, 0x4a, 0x42, 0xf8, 0x20, 0x10, 0x44, 0xf8, + 0x20, 0x30, 0xbd, 0xe8, 0xb0, 0x40, 0x70, 0x47, 0x60, 0x10, 0x00, 0x40, + 0xa0, 0x10, 0x00, 0x40, 0x05, 0x48, 0x00, 0x21, 0x01, 0x64, 0x05, 0x49, + 0xc0, 0xf8, 0x80, 0x10, 0x04, 0x49, 0x01, 0x60, 0x04, 0x21, 0x01, 0x64, + 0x70, 0x47, 0x00, 0xbf, 0x20, 0x10, 0x00, 0x40, 0x60, 0xca, 0x05, 0x00, + 0x7c, 0xb4, 0x12, 0x10, 0x05, 0x48, 0x00, 0x21, 0x01, 0x64, 0x05, 0x49, + 0xc0, 0xf8, 0x80, 0x10, 0x04, 0x49, 0x01, 0x60, 0x08, 0x21, 0x01, 0x64, + 0x70, 0x47, 0x00, 0xbf, 0x24, 0x10, 0x00, 0x40, 0x64, 0xca, 0x05, 0x00, + 0xc8, 0xb4, 0x12, 0x10, 0x05, 0x48, 0x00, 0x21, 0x01, 0x64, 0x05, 0x49, + 0xc0, 0xf8, 0x80, 0x10, 0x04, 0x49, 0x01, 0x60, 0x10, 0x21, 0x01, 0x64, + 0x70, 0x47, 0x00, 0xbf, 0x28, 0x10, 0x00, 0x40, 0x6c, 0xca, 0x05, 0x00, + 0x7c, 0xa0, 0x12, 0x10, 0x05, 0x48, 0x00, 0x21, 0x01, 0x64, 0x05, 0x49, + 0xc0, 0xf8, 0x80, 0x10, 0x04, 0x49, 0x01, 0x60, 0x10, 0x21, 0x01, 0x64, + 0x70, 0x47, 0x00, 0xbf, 0x2c, 0x10, 0x00, 0x40, 0x7c, 0xca, 0x05, 0x00, + 0x4c, 0xa3, 0x12, 0x10, 0x80, 0xb5, 0xff, 0xf7, 0xb5, 0xff, 0xff, 0xf7, + 0xc5, 0xff, 0xff, 0xf7, 0xd5, 0xff, 0xbd, 0xe8, 0x80, 0x40, 0xff, 0xf7, + 0xe3, 0xbf, 0x00, 0x00, 0x70, 0x47, 0x2b, 0xe0, 0x04, 0xb4, 0x0a, 0x46, + 0x02, 0xbc, 0xf9, 0xe0, 0x06, 0xb5, 0x02, 0x4a, 0x11, 0x68, 0x88, 0x47, + 0x06, 0xbd, 0x00, 0x00, 0xdc, 0x9b, 0x08, 0x00, 0x06, 0xb5, 0x02, 0x4a, + 0x11, 0x68, 0x88, 0x47, 0x06, 0xbd, 0x00, 0x00, 0xe0, 0x9b, 0x08, 0x00, + 0x30, 0x32, 0x30, 0x30, 0x38, 0x35, 0x36, 0x37, 0x00, 0x00, 0x00, 0x00, + 0xb0, 0xb5, 0x00, 0xf0, 0x71, 0xf9, 0x2d, 0x48, 0x2d, 0x49, 0x6f, 0xf0, + 0x02, 0x02, 0x03, 0x78, 0x03, 0xeb, 0x03, 0x10, 0x01, 0xeb, 0xc0, 0x00, + 0x90, 0xf8, 0x49, 0x10, 0x02, 0xeb, 0x51, 0x11, 0x02, 0x29, 0x9c, 0xbf, + 0x01, 0x21, 0x80, 0xf8, 0x84, 0x10, 0x90, 0xf8, 0x24, 0x00, 0x25, 0x49, + 0xc8, 0x54, 0xa0, 0xf1, 0x31, 0x05, 0x0a, 0x78, 0x4c, 0x78, 0x01, 0x21, + 0x02, 0x2d, 0x08, 0xd3, 0xa0, 0xf1, 0x63, 0x05, 0x02, 0x2d, 0x04, 0xd3, + 0xa0, 0xf1, 0x33, 0x01, 0xb1, 0xfa, 0x81, 0xf1, 0x49, 0x09, 0x00, 0x2b, + 0x08, 0xbf, 0x22, 0x46, 0xa2, 0xf1, 0x31, 0x04, 0x01, 0x23, 0x02, 0x2c, + 0x0b, 0xd3, 0xa2, 0xf1, 0x63, 0x04, 0x02, 0x2c, 0x07, 0xd3, 0xa2, 0xf1, + 0x33, 0x03, 0xb3, 0xfa, 0x83, 0xf3, 0x4f, 0xea, 0x53, 0x13, 0x02, 0xb9, + 0x70, 0xb1, 0x01, 0xb1, 0x32, 0xb1, 0x0b, 0xb1, 0x20, 0xb1, 0x19, 0xb9, + 0xbd, 0xe8, 0xb0, 0x40, 0xf8, 0xf7, 0xd4, 0xba, 0x10, 0x48, 0x00, 0x21, + 0x01, 0x60, 0x10, 0x48, 0x01, 0x60, 0xb0, 0xbd, 0x26, 0x4c, 0xe4, 0x69, + 0x00, 0x2c, 0xfa, 0xd1, 0x23, 0x4c, 0xe4, 0x69, 0x00, 0x2c, 0xf6, 0xd1, + 0x07, 0x4c, 0x24, 0x68, 0x00, 0x2c, 0xf2, 0xd1, 0x06, 0x4c, 0x24, 0x68, + 0x00, 0x2c, 0xee, 0xd1, 0xdf, 0xe7, 0x00, 0xbf, 0x74, 0x87, 0x08, 0x00, + 0xfc, 0x6d, 0x01, 0x00, 0x7c, 0x2c, 0x06, 0x00, 0x90, 0x01, 0x00, 0x00, + 0xc8, 0x6d, 0x01, 0x00, 0x10, 0xd6, 0x05, 0x30, 0x10, 0xee, 0x05, 0x30, + 0x01, 0x48, 0x00, 0x21, 0xc1, 0x70, 0x70, 0x47, 0x3c, 0x88, 0x01, 0x00, + 0xb0, 0xb5, 0x12, 0x4d, 0x04, 0x46, 0x95, 0xf8, 0x6d, 0x00, 0x58, 0xb1, + 0x11, 0x48, 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x01, 0x28, 0x01, 0xd1, + 0x01, 0x20, 0xb0, 0xbd, 0x0c, 0x48, 0xc0, 0x69, 0x20, 0xb9, 0x10, 0xe0, + 0x0a, 0x48, 0xc0, 0x69, 0x00, 0x28, 0xef, 0xd0, 0x08, 0x48, 0x90, 0xf8, + 0x33, 0x00, 0x40, 0xb9, 0xa8, 0x7d, 0x01, 0x28, 0x05, 0xd1, 0x07, 0x48, + 0x01, 0x68, 0x20, 0x46, 0x88, 0x47, 0x01, 0x28, 0xe8, 0xd0, 0x00, 0x20, + 0xb0, 0xbd, 0x00, 0xbf, 0xc8, 0x5c, 0x01, 0x00, 0x38, 0x5d, 0x01, 0x00, + 0x08, 0xd3, 0x08, 0x00, 0x04, 0xd3, 0x08, 0x00, 0x2d, 0xe9, 0xfe, 0x4f, + 0x04, 0x46, 0x51, 0x48, 0x00, 0x68, 0x80, 0x47, 0xa0, 0x46, 0x06, 0x46, + 0xdf, 0xf8, 0x3c, 0xb1, 0x18, 0xf8, 0x14, 0x0f, 0xdb, 0xf8, 0x00, 0x20, + 0x18, 0xf8, 0x02, 0x1c, 0x47, 0x46, 0x8d, 0xf8, 0x04, 0x00, 0x18, 0xf8, + 0x0b, 0x0c, 0x8d, 0xf8, 0x05, 0x10, 0x17, 0xf8, 0x0c, 0x1d, 0x8d, 0xf8, + 0x07, 0x00, 0x0a, 0x20, 0x8d, 0xf8, 0x06, 0x10, 0x01, 0xa9, 0x90, 0x47, + 0x44, 0x48, 0x00, 0x78, 0x01, 0x28, 0x06, 0xd1, 0x43, 0x49, 0x98, 0xf8, + 0x00, 0x00, 0x09, 0x88, 0x08, 0x43, 0x42, 0x49, 0x08, 0x60, 0x42, 0x48, + 0x00, 0x2e, 0x00, 0xf1, 0x28, 0x05, 0x4b, 0xd0, 0xe9, 0x46, 0x0d, 0xf1, + 0x04, 0x0a, 0xb2, 0x7c, 0x30, 0x7a, 0x71, 0x7a, 0x33, 0x7d, 0x8d, 0xf8, + 0x01, 0x20, 0xdb, 0xf8, 0x00, 0x20, 0x8d, 0xf8, 0x02, 0x00, 0x8d, 0xf8, + 0x03, 0x10, 0x0b, 0x20, 0x49, 0x46, 0x8d, 0xf8, 0x00, 0x30, 0x90, 0x47, + 0xa0, 0x7c, 0xb1, 0x7c, 0x81, 0x42, 0x2d, 0xd9, 0x41, 0xf2, 0x38, 0x30, + 0x51, 0x46, 0x52, 0x46, 0xad, 0xf8, 0x08, 0x00, 0x20, 0x8a, 0x01, 0x38, + 0x01, 0x90, 0x30, 0x48, 0x03, 0x68, 0x38, 0x46, 0x98, 0x47, 0x30, 0x8a, + 0x20, 0xb9, 0xf1, 0x7c, 0x49, 0x07, 0x01, 0xd4, 0xb1, 0x68, 0x0c, 0xe0, + 0xb1, 0x68, 0x01, 0x9a, 0x8b, 0x1a, 0x1b, 0x01, 0x1f, 0xd4, 0x91, 0x42, + 0x04, 0xd1, 0xb2, 0x89, 0xbd, 0xf8, 0x08, 0x30, 0x93, 0x42, 0x18, 0xd8, + 0x10, 0xb9, 0x3a, 0x68, 0x91, 0x42, 0x14, 0xd0, 0x69, 0x68, 0x21, 0xb9, + 0x10, 0xb9, 0xf0, 0x7c, 0x40, 0x07, 0x00, 0xd5, 0x6e, 0x60, 0xf0, 0x7c, + 0x40, 0x07, 0x06, 0xd4, 0x17, 0x48, 0x00, 0x68, 0x80, 0x47, 0x06, 0x46, + 0x00, 0x28, 0xb6, 0xd1, 0x00, 0x26, 0x2e, 0x60, 0x20, 0x46, 0xbd, 0xe8, + 0xfe, 0x8f, 0x27, 0x48, 0x01, 0x68, 0x30, 0x46, 0x88, 0x47, 0x06, 0x46, + 0x80, 0x68, 0x01, 0x99, 0x42, 0x1a, 0x12, 0x01, 0x06, 0xd4, 0x88, 0x42, + 0x0c, 0xd1, 0xb0, 0x89, 0xbd, 0xf8, 0x08, 0x10, 0x81, 0x42, 0x07, 0xd9, + 0x10, 0x48, 0x06, 0xf1, 0x14, 0x01, 0x02, 0x68, 0x0c, 0x20, 0x90, 0x47, + 0x34, 0x46, 0xe3, 0xe7, 0x6e, 0x60, 0x41, 0x46, 0xf0, 0x7c, 0x40, 0x07, + 0x48, 0xbf, 0x2e, 0x60, 0x09, 0x48, 0x02, 0x68, 0x0d, 0x20, 0x90, 0x47, + 0xd8, 0xe7, 0x00, 0xbf, 0xe0, 0xa1, 0x08, 0x00, 0x1c, 0xa1, 0x08, 0x00, + 0x6f, 0x34, 0x01, 0x00, 0x26, 0x21, 0x01, 0x00, 0x04, 0x08, 0x00, 0x40, + 0xfc, 0x70, 0x01, 0x00, 0x48, 0xa1, 0x08, 0x00, 0x98, 0xa1, 0x08, 0x00, + 0x06, 0x48, 0x07, 0x49, 0x01, 0x60, 0x07, 0x48, 0x07, 0x49, 0x01, 0x60, + 0x07, 0x48, 0x08, 0x49, 0x01, 0x60, 0x08, 0x48, 0x08, 0x49, 0x01, 0x60, + 0x70, 0x47, 0x00, 0xbf, 0x84, 0xb7, 0x08, 0x00, 0x71, 0xcb, 0x05, 0x00, + 0xd0, 0xa0, 0x08, 0x00, 0x99, 0xca, 0x05, 0x00, 0x98, 0xeb, 0x08, 0x00, + 0x7d, 0xcb, 0x05, 0x00, 0xe8, 0xa1, 0x08, 0x00, 0xd9, 0xcb, 0x05, 0x00, + 0x42, 0xf6, 0x49, 0x4c, 0xc1, 0xf2, 0x10, 0x0c, 0x60, 0x47, 0xfe, 0xde, + 0x70, 0xb5, 0x05, 0x46, 0x80, 0x69, 0x0c, 0x46, 0x00, 0x78, 0x02, 0x28, + 0x13, 0xd1, 0x0e, 0x48, 0x00, 0x68, 0x80, 0x47, 0x01, 0x28, 0x0b, 0xd0, + 0x0c, 0x48, 0xa5, 0xf1, 0xb8, 0x06, 0x01, 0x68, 0x30, 0x46, 0x88, 0x47, + 0x01, 0x28, 0x03, 0xd0, 0x30, 0x6a, 0x08, 0xb9, 0xb0, 0x68, 0x40, 0xb1, + 0x07, 0x48, 0x01, 0x21, 0x01, 0x70, 0x28, 0x46, 0x21, 0x46, 0xbd, 0xe8, + 0x70, 0x40, 0x00, 0xf0, 0x11, 0xb8, 0x03, 0x48, 0x00, 0x21, 0xf5, 0xe7, + 0x74, 0xcf, 0x08, 0x00, 0x4c, 0x9d, 0x08, 0x00, 0x7e, 0x2c, 0x06, 0x00, + 0x01, 0x48, 0x02, 0x49, 0x01, 0x60, 0x70, 0x47, 0xbc, 0xa0, 0x08, 0x00, + 0x8d, 0xcd, 0x05, 0x00, 0x41, 0xf6, 0x09, 0x4c, 0xc1, 0xf2, 0x10, 0x0c, + 0x60, 0x47, 0xfe, 0xde, 0xa5, 0x00, 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, + 0xde, 0x03, 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, + 0x59, 0x01, 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, + 0xc0, 0x03, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, + 0x96, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, + 0x96, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, + 0x96, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x19, 0x02, 0x00, 0xcd, 0x19, 0x02, 0x00, + 0x09, 0x1a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x79, 0x1b, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x22, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0x48, 0x02, 0x00, 0xb8, 0x4a, 0x02, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xb8, 0x4a, 0x02, 0x00, 0x58, 0xe3, 0x01, 0x10, + 0x50, 0x61, 0x74, 0x63, 0x68, 0x20, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x20, 0x50, 0x46, 0x3d, 0x57, 0x43, 0x4e, 0x37, 0x38, 0x35, 0x30, + 0x52, 0x4f, 0x4d, 0x3d, 0x20, 0x30, 0x32, 0x30, 0x30, 0x20, 0x42, 0x55, + 0x49, 0x4c, 0x44, 0x3d, 0x42, 0x54, 0x46, 0x57, 0x2e, 0x48, 0x41, 0x4d, + 0x49, 0x4c, 0x54, 0x4f, 0x4e, 0x2e, 0x32, 0x2e, 0x30, 0x2e, 0x30, 0x2d, + 0x30, 0x30, 0x37, 0x39, 0x39, 0x2d, 0x55, 0x53, 0x42, 0x5f, 0x50, 0x41, + 0x54, 0x43, 0x48, 0x5a, 0x2d, 0x35, 0x00, 0x00, 0x04, 0x00, 0xff, 0x00, + 0x41, 0xe3, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0xc9, 0x5c, 0x02, 0x00, + 0x0a, 0x00, 0xff, 0x00, 0xed, 0xc4, 0x02, 0x00, 0x0c, 0x00, 0xff, 0x01, + 0xc5, 0x64, 0x02, 0x00, 0x17, 0x00, 0xff, 0x00, 0x01, 0x5a, 0x02, 0x00, + 0x19, 0x00, 0xff, 0x02, 0xe9, 0x5c, 0x02, 0x00, 0x1a, 0x00, 0xff, 0x00, + 0x45, 0x5b, 0x02, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x95, 0x5e, 0x02, 0x00, + 0x24, 0x00, 0x02, 0x00, 0x95, 0x5a, 0x02, 0x00, 0x3a, 0x00, 0xff, 0x00, + 0x31, 0x5f, 0x02, 0x00, 0x3b, 0x00, 0xff, 0x00, 0xc1, 0x61, 0x02, 0x00, + 0x51, 0x00, 0xff, 0x00, 0x11, 0xd9, 0x04, 0x00, 0x59, 0x00, 0xff, 0x00, + 0xb1, 0x61, 0x02, 0x00, 0xda, 0x00, 0xff, 0x00, 0x2d, 0x54, 0x02, 0x00, + 0xdd, 0x00, 0xff, 0x00, 0xc1, 0x52, 0x02, 0x00, 0x57, 0x01, 0xff, 0x00, + 0x5d, 0x08, 0x03, 0x00, 0x5e, 0x01, 0xff, 0x00, 0xed, 0xba, 0x04, 0x00, + 0x5f, 0x01, 0xff, 0x00, 0xa9, 0xc5, 0x02, 0x00, 0x70, 0x01, 0xff, 0x00, + 0xb5, 0x0c, 0x03, 0x00, 0x91, 0x01, 0xff, 0x00, 0x5d, 0x6a, 0x02, 0x00, + 0xf1, 0x01, 0xff, 0x00, 0x29, 0x54, 0x02, 0x00, 0xff, 0x03, 0xff, 0x00, + 0x75, 0x5f, 0x02, 0x00, 0x01, 0x02, 0x0f, 0x00, 0x10, 0x00, 0x72, 0x00, + 0x5f, 0x00, 0x4c, 0x00, 0x39, 0x00, 0x26, 0x00, 0x29, 0x1e, 0x14, 0x33, + 0x1e, 0x1e, 0x3d, 0x1e, 0x2d, 0x47, 0x1e, 0x46, 0x51, 0x1e, 0x78, 0x5b, + 0x1c, 0x96, 0x64, 0x1c, 0xfa, 0x00, 0x03, 0x00, 0x08, 0x00, 0x04, 0x00, + 0x02, 0x00, 0x08, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0b, 0x00, + 0x00, 0x02, 0x0e, 0x00, 0x00, 0x10, 0x0f, 0x00, 0x00, 0x20, 0x03, 0x00, + 0x08, 0x00, 0x04, 0x00, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x04, 0x0b, 0x00, + 0x00, 0x08, 0x0e, 0x00, 0x00, 0x40, 0x0f, 0x00, 0x00, 0x80, 0x00, 0x00, + 0x18, 0x00, 0x02, 0x00, 0x75, 0xef, 0x02, 0x00, 0x19, 0x00, 0x03, 0x00, + 0xc1, 0xef, 0x02, 0x00, 0xff, 0xff, 0x07, 0x08, 0x09, 0x08, 0x07, 0x06, + 0x05, 0x06, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xbd, 0xf0, 0x03, 0x00, 0x5b, 0x2a, 0x09, 0x10, + 0xd7, 0x2c, 0x09, 0x10, 0x8f, 0x2d, 0x09, 0x10, 0xa5, 0xf1, 0x03, 0x00, + 0x1b, 0x30, 0x09, 0x10, 0x35, 0xf2, 0x03, 0x00, 0x67, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x96, 0x00, 0x03, 0xff, 0x09, 0x74, 0x0d, 0x10, + 0x9b, 0x74, 0x0d, 0x10, 0x11, 0x9e, 0x04, 0x00, 0x69, 0x9e, 0x04, 0x00, + 0xcd, 0x9e, 0x04, 0x00, 0xf3, 0x84, 0x0d, 0x10, 0x91, 0x6a, 0x0f, 0x10, + 0x24, 0x00, 0x00, 0x00, 0x8d, 0xc0, 0x0d, 0x10, 0xfd, 0xaa, 0x04, 0x00, + 0x29, 0xc1, 0x0d, 0x10, 0x0d, 0xab, 0x04, 0x00, 0x3d, 0xc7, 0x0d, 0x10, + 0x1f, 0xc8, 0x0d, 0x10, 0x91, 0x6a, 0x0f, 0x10, 0x23, 0x00, 0x00, 0x00, + 0x46, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0d, 0x00, + 0x66, 0x2b, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x74, 0x2b, + 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x75, 0x2b, 0x06, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x0a, 0x00, 0xc9, 0x24, 0x05, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x0d, 0x00, 0x1c, 0xb1, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, + 0x42, 0x06, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x10, 0x00, 0x0a, 0x00, + 0xdd, 0x05, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x1d, 0x00, 0x92, 0x3c, + 0x0b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x94, 0x00, 0x00, 0x00, 0x0c, 0x00, + 0x00, 0x00, 0x80, 0x00, 0x0a, 0x00, 0xc8, 0x21, 0x07, 0x0a, 0x0b, 0x00, + 0x39, 0x00, 0x03, 0x22, 0x08, 0x09, 0x0b, 0x00, 0x0a, 0x00, 0xbb, 0x22, + 0x06, 0x0a, 0x0b, 0x00, 0x0a, 0x00, 0x61, 0x32, 0x09, 0x09, 0x0b, 0x00, + 0x80, 0xff, 0x80, 0xff, 0x61, 0x4f, 0x11, 0x10, 0x25, 0x37, 0x05, 0x00, + 0x15, 0x51, 0x11, 0x10, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, + 0x01, 0x01, 0x00, 0x00, 0x56, 0x04, 0x71, 0x0b, 0x3e, 0x22, 0x9e, 0x00, + 0xa9, 0xa6, 0x56, 0x1f, 0x25, 0xfa, 0x3e, 0x0e, 0x85, 0x45, 0xab, 0x53, + 0xa7, 0x2b, 0x4b, 0xe6, 0xd7, 0x8f, 0xfe, 0x8e, 0xe4, 0x33, 0x99, 0xbc, + 0xcb, 0x6c, 0x5e, 0xe4 +}; +unsigned int rampatch_usb_00190200_bin_len = 250276; +unsigned char nvm_usb_00190200_bin[] = { + 0x02, 0xfa, 0x24, 0x00, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x42, 0x54, 0x46, 0x57, 0x2e, 0x48, 0x41, 0x4d, + 0x49, 0x4c, 0x54, 0x4f, 0x4e, 0x2e, 0x32, 0x2e, 0x30, 0x2e, 0x30, 0x2d, + 0x30, 0x30, 0x37, 0x39, 0x39, 0x2d, 0x55, 0x53, 0x42, 0x5f, 0x50, 0x41, + 0x54, 0x43, 0x48, 0x5a, 0x2d, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x5a, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xfe, 0x0f, 0xfe, 0xd8, 0x3f, 0x7b, 0x87, 0x08, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x7d, 0x7f, 0xfc, 0x01, 0x01, + 0x11, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x15, 0x11, 0x22, 0x00, 0x2e, 0x00, 0x16, 0x00, 0x72, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x06, 0xb8, 0x0b, 0x00, 0x00, + 0x06, 0x08, 0x08, 0x20, 0xf4, 0x01, 0xc8, 0x00, 0x0a, 0x00, 0x80, 0x0c, + 0x14, 0x00, 0x10, 0x00, 0x1f, 0x06, 0x14, 0x08, 0x14, 0x04, 0x14, 0x06, + 0x00, 0x10, 0x00, 0x08, 0xd0, 0x02, 0x00, 0x02, 0x68, 0x01, 0x06, 0x16, + 0x08, 0x18, 0x0c, 0x1c, 0x03, 0x01, 0x68, 0x01, 0x12, 0x02, 0x04, 0x06, + 0x28, 0x00, 0x50, 0x00, 0x28, 0x00, 0x50, 0x00, 0x50, 0x00, 0x03, 0x00, + 0x3c, 0x00, 0x28, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x50, 0x00, 0x40, 0x01, + 0x50, 0x00, 0x0a, 0x00, 0x40, 0x00, 0x2c, 0x00, 0x30, 0x00, 0x26, 0x00, + 0x20, 0x00, 0x16, 0x00, 0x00, 0x04, 0x50, 0x00, 0xf0, 0x00, 0x20, 0x00, + 0x02, 0x50, 0x00, 0x05, 0xa0, 0x00, 0x64, 0x5a, 0x46, 0x32, 0x1e, 0x02, + 0x1b, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x02, 0x0a, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x1c, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x2c, 0x01, 0x00, 0x10, 0x00, 0x00, 0x14, 0xf4, 0x00, 0x00, + 0x33, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1f, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, + 0x0a, 0x23, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x02, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0x82, 0x02, 0x00, + 0x00, 0x83, 0x02, 0x00, 0x00, 0x84, 0x02, 0x00, 0x00, 0x85, 0x02, 0x00, + 0x00, 0x86, 0x02, 0x00, 0x00, 0x27, 0x03, 0x00, 0x00, 0x28, 0x03, 0x00, + 0x00, 0x29, 0x03, 0x00, 0x00, 0xaa, 0x03, 0x00, 0x00, 0xab, 0x87, 0x00, + 0x00, 0x80, 0x0a, 0x00, 0x00, 0x81, 0x0a, 0x00, 0x00, 0x82, 0x0a, 0x00, + 0x00, 0x83, 0x0a, 0x00, 0x00, 0x84, 0x0a, 0x00, 0x00, 0x85, 0x0a, 0x00, + 0x00, 0x86, 0x0a, 0x00, 0x00, 0x27, 0x0b, 0x00, 0x00, 0x28, 0x0b, 0x00, + 0x00, 0x29, 0x0b, 0x00, 0x00, 0xaa, 0x0b, 0x00, 0x00, 0xab, 0x0f, 0x00, + 0x00, 0x8f, 0x0a, 0x00, 0x00, 0x8e, 0x0a, 0x00, 0x00, 0x8d, 0x0a, 0x00, + 0x00, 0x8c, 0x0a, 0x00, 0x00, 0x0b, 0x0b, 0x0b, 0x02, 0x08, 0x00, 0x00, + 0x0b, 0x00, 0x0b, 0x0b, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x13, + 0x00, 0x24, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0x07, 0x00, 0x09, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x09, 0x08, + 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0c, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x66, 0x16, 0x91, 0xa7, + 0x02, 0x00, 0x00, 0x40, 0x66, 0x16, 0x91, 0xa7, 0x02, 0x54, 0x01, 0x00, + 0x00, 0x25, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x01, 0x01, 0x03, 0x03, 0x03, 0x00, 0x03, 0x03, + 0x03, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x14, 0x00, + 0x00, 0xef, 0x02, 0x3d, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0xf4, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x0a, 0x00, 0x26, 0x00, 0x5c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x30, + 0x17, 0x68, 0x09, 0x70, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3a, 0x08, 0x00, 0x01, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, + 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xc8, 0x03, 0x80, + 0x82, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x00, 0x08, 0x32, 0x32, 0x00, 0x00, 0x60, 0xea, 0x2c, + 0x01, 0x05, 0x0f, 0x03, 0x00, 0xff, 0x01, 0x00, 0x00, 0x40, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0xe8, + 0x03, 0x14, 0x14, 0x00, 0x00, 0x27, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe5, 0xea, 0xef, 0xf4, 0xf9, 0xfe, + 0x03, 0x08, 0x0c, 0x10, 0x14, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, + 0xf3, 0xf3, 0xf3, 0xf3, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, + 0xf3, 0xf3, 0xf3, 0xf3, 0xf4, 0x00, 0x2a, 0x00, 0x38, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0xdd, 0xb2, 0x03, 0x00, 0x01, + 0x1f, 0x01, 0x42, 0x01, 0x69, 0x01, 0x95, 0x01, 0xc7, 0x01, 0xfe, 0x01, + 0x3d, 0x02, 0x83, 0x02, 0xd1, 0x02, 0x29, 0x03, 0x00, 0x0a, 0x10, 0x00, + 0x1f, 0x00, 0x3f, 0x00, 0x7f, 0x00, 0xfd, 0x00, 0xf9, 0x01, 0xf1, 0x03, + 0xde, 0x07, 0x00, 0x00, 0x9f, 0x01, 0x03, 0x07, 0x00, 0x00, 0x22, 0x02, + 0x00, 0x02, 0x2c, 0x00, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf4, 0x01, 0x34, 0x08, 0x00, 0x50, 0xff, 0x58, 0x02, 0x00, + 0x22, 0x00, 0x00, 0x00, 0x00, 0x28, 0xa0, 0x62, 0x03, 0x64, 0x01, 0x01, + 0x0a, 0x00, 0x00, 0x10, 0x00, 0x00, 0xdc, 0x05, 0x28, 0x0a, 0x00, 0xa0, + 0xff, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x90, 0x01, 0x58, 0x02, 0x8f, 0x01, 0x0a, 0x01, 0x00, 0x02, + 0x03, 0x00, 0x02, 0x03, 0x0c, 0x00, 0x03, 0x00, 0x36, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0xfa, 0x00, + 0x39, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0a, 0x0a, 0x02, 0x4f, 0x03, 0x0d, 0x01, 0x10, 0x03, 0x05, + 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0xb0, 0x03, 0x06, 0x00, 0x58, 0x02, + 0x03, 0x01, 0x0a, 0x06, 0x10, 0x01, 0x01, 0x0f, 0x0a, 0x05, 0x28, 0x00, + 0x40, 0x1f, 0x0a, 0x03, 0x01, 0x05, 0x0c, 0x01, 0x3c, 0x00, 0xa4, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfa, 0x02, 0x32, + 0xc0, 0xa3, 0x00, 0x1e, 0xc0, 0xa3, 0x00, 0x0f, 0xc0, 0xa3, 0x00, 0x12, + 0x7f, 0xbe, 0xfe, 0x00, 0x3b, 0xfb, 0xfd, 0x00, 0xba, 0x53, 0xff, 0x00, + 0x6c, 0xac, 0xe6, 0xff, 0x29, 0xea, 0xdf, 0xff, 0x41, 0x73, 0xed, 0xff, + 0x19, 0x94, 0x15, 0x00, 0xcc, 0xcc, 0xcc, 0x00, 0x0e, 0x00, 0x00, 0x10, + 0xf7, 0xb0, 0xfe, 0x00, 0x25, 0xd9, 0xfc, 0x00, 0xf3, 0xbc, 0xff, 0x00, + 0x46, 0xda, 0x19, 0x00, 0x17, 0x0c, 0x28, 0x00, 0xc5, 0x93, 0x0b, 0x00, + 0x24, 0xec, 0xa7, 0xff, 0x66, 0x66, 0x66, 0x00, 0x09, 0x00, 0x00, 0x10, + 0xf7, 0xb0, 0xfe, 0x00, 0x25, 0xd9, 0xfc, 0x00, 0xf3, 0xbc, 0xff, 0x00, + 0x46, 0xda, 0x19, 0x00, 0x17, 0x0c, 0x28, 0x00, 0xc5, 0x93, 0x0b, 0x00, + 0x24, 0xec, 0xa7, 0xff, 0x66, 0x66, 0x66, 0x00, 0x09, 0x00, 0x00, 0x10, + 0x7f, 0xbe, 0xfe, 0x00, 0x3b, 0xfb, 0xfd, 0x00, 0xba, 0x53, 0xff, 0x00, + 0x6c, 0xac, 0xe6, 0xff, 0x29, 0xea, 0xdf, 0xff, 0x41, 0x73, 0xed, 0xff, + 0x19, 0x94, 0x15, 0x00, 0xcd, 0xcc, 0x4c, 0x00, 0x05, 0x00, 0x60, 0x0f, + 0x00, 0x99, 0x99, 0x99, 0x3e, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x59, 0x1f, 0x0f, 0x0f, 0x02, 0x00, + 0x02, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd0, 0x07, 0x00, 0x34, 0x1a, 0x04, + 0xe8, 0x03, 0x07, 0x05, 0x03, 0x03, 0x05, 0x00, 0xf4, 0x01, 0x01, 0x05, + 0xa0, 0x19, 0x20, 0x10, 0x20, 0x1c, 0xe0, 0x2e, 0x30, 0x2a, 0x00, 0x32, + 0x80, 0x25, 0xd4, 0x30, 0x32, 0x1e, 0x64, 0x00, 0x40, 0x00, 0xf8, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08, 0x0a, + 0x0c, 0x0e, 0x10, 0x40, 0x12, 0x14, 0x16, 0x1e, 0x20, 0x22, 0x24, 0x28, + 0x2e, 0x32, 0x34, 0x38, 0x3a, 0x3c, 0x3e, 0x40, 0x42, 0x44, 0x48, 0x4a, + 0x4c, 0x4e, 0x50, 0x5a, 0x60, 0x66, 0x6e, 0x70, 0x72, 0x74, 0x76, 0x78, + 0x7a, 0xe6, 0x00, 0x13, 0x5e, 0x6b, 0x6b, 0x6b, 0x3e, 0xbe, 0x7b, 0x6d, + 0x7c, 0x7c, 0x7e, 0x46, 0x7a, 0x74, 0x76, 0x7a, 0x78, 0x76, 0x6e, 0x5a, + 0x5a, 0x01, 0x38, 0x00, 0xd0, 0x07, 0xe0, 0x2e, 0x00, 0x00, 0x05, 0x01, + 0x38, 0x00, 0x41, 0x00, 0x10, 0x01, 0x01, 0x04, 0x00, 0x61, 0x3c, 0x30, + 0x30, 0x20, 0x70, 0x30, 0x00, 0x30, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, + 0x00, 0x12, 0x12, 0x01, 0xdf, 0xf7, 0xd7, 0xff, 0xff, 0x4f, 0xdd, 0xff, + 0xff, 0x5f, 0xfd, 0x5f, 0x55, 0x5f, 0x7f, 0xd5, 0xd7, 0xd7, 0x7f, 0x55, + 0x57, 0x75, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0xe7, + 0x00, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0xfc, 0xff, 0x07, 0x0f, 0xff, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0x03, 0x00, 0x00, 0x00, 0x56, 0x05, 0x00, 0x00, 0x01, 0x01, 0x01, 0x18, + 0x30, 0x02, 0x04, 0x07, 0x90, 0x01, 0x60, 0x00, 0x0a, 0xff, 0x64, 0x32, + 0x50, 0x28, 0xdc, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc6, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0x00, 0x01, 0x04, 0x00, 0x02, 0x96, 0x01, 0x32, 0x32, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x55, 0xa9, 0xaa, 0xaa, 0xaa, 0xaa, 0x96, 0xaa, + 0x55, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0x00, 0x8a, 0xaa, 0x02, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x50, 0xc3, 0x00, 0x00, 0x48, 0x00, 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x3f, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x17, 0xe0, 0xef, 0xff, 0xff, 0xff, 0xff, 0x03, 0x49, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf3, 0x01, 0x00, + 0x31, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x12, 0x30, 0x12, 0x94, 0x44, 0x94, 0x7c, 0x30, + 0x08, 0x02, 0x22, 0x3e, 0x3e, 0x02, 0x1e, 0x44, 0xe2, 0x30, 0x26, 0x54, + 0x1b, 0x1c, 0x9e, 0xff, 0xff, 0x44, 0xd6, 0xff, 0x08, 0x1a, 0x4e, 0x9a, + 0x08, 0x16, 0x4e, 0x9a, 0x30, 0x0c, 0x7c, 0x82, 0x36, 0x86, 0xae, 0x9e, + 0xd0, 0x68, 0x68, 0x68, 0x0c, 0x82, 0x8c, 0x3a, 0xbc, 0xc0, 0xd0, 0xb8, + 0xc8, 0x0e, 0x30, 0xaa, 0x5d, 0xaa, 0x58, 0x22, 0x90, 0x90, 0xcc, 0xda, + 0x12, 0x1e, 0x30, 0x12, 0x1e, 0x0c, 0x40, 0x8c, 0xae, 0xd0, 0x30, 0x04, + 0x48, 0xaa, 0xdc, 0xde, 0xdc, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0xd4, + 0xff, 0x24, 0x62, 0xa4, 0xb8, 0xc4, 0x0a, 0xe0, 0x0a, 0x0d, 0x5e, 0x6e, + 0x6e, 0x74, 0x78, 0x28, 0x2a, 0x2a, 0x2a, 0x2a, 0xa4, 0xc8, 0x50, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x53, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x01, 0x03, 0x05, 0x08, 0x01, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x55, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x02, 0xfb, 0x53, 0x21, 0x00, 0x57, + 0x00, 0x5d, 0x00, 0x6a, 0x00, 0x6f, 0x00, 0x01, 0x02, 0x28, 0x23, 0x40, + 0x1f, 0x70, 0x17, 0xa0, 0x0f, 0x0a, 0x02, 0x7f, 0x00, 0x84, 0x03, 0x83, + 0x03, 0x02, 0x1e, 0xde, 0x00, 0x00, 0x00, 0x27, 0x00, 0x07, 0x05, 0x00, + 0x06, 0x05, 0x00, 0x07, 0x05, 0x00, 0x06, 0x05, 0x00, 0x07, 0x04, 0x00, + 0x06, 0x05, 0x00, 0x07, 0x05, 0x00, 0x06, 0x05, 0x00, 0xa9, 0x03, 0xa9, + 0x03, 0xa9, 0x03, 0xa9, 0x03, 0x14, 0x00, 0x68, 0x27, 0x24, 0x70, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x79, 0x80, 0x20, 0x00, 0x00, 0x00, + 0x64, 0x07, 0x02, 0x00, 0x00, 0x00, 0x04, 0x01, 0xe6, 0x05, 0x00, 0x56, + 0x00, 0x5c, 0x00, 0x65, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x01, 0x64, 0x85, + 0x00, 0x6e, 0x69, 0x5f, 0x55, 0x00, 0x20, 0x30, 0x40, 0x10, 0x02, 0x01, + 0x01, 0x01, 0x02, 0x25, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x00, 0x40, 0x00, 0x40, + 0x00, 0x78, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf4, 0x01, 0x0a, 0x00, 0x64, + 0x00, 0x03, 0x00, 0x00, 0x00, 0x56, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x02, 0x00, 0x00, 0x80, 0x0f, 0x00, + 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x09, 0x03, + 0x01, 0x04, 0x01, 0x12, 0x01, 0x21, 0x01, 0x2f, 0x01, 0x3e, 0x01, 0x4c, + 0x01, 0x5b, 0x01, 0x69, 0x01, 0x78, 0x01, 0x00, 0x06, 0x14, 0xec, 0x08, + 0x00, 0x0c, 0xf4, 0x08, 0x1f, 0x02, 0x08, 0xf8, 0x02, 0x0c, 0x14, 0x1f, + 0xf9, 0xfa, 0xfc, 0xfe, 0x00, 0x00, 0x02, 0x03, 0x04, 0x05, 0xf9, 0xfa, + 0xfc, 0xfe, 0x00, 0x00, 0x02, 0x03, 0x04, 0x05, 0x02, 0x01, 0x02, 0x0f, + 0x00, 0x40, 0x01, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x57, 0x00, 0xa0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x58, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x34, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x2a, 0x3b, 0x50, 0x66, 0x78, + 0x80, 0x84, 0x87, 0x8c, 0x90, 0x95, 0x99, 0x9b, 0xa0, 0xa4, 0xa9, 0xad, + 0xb0, 0xb5, 0xb8, 0xbd, 0xc1, 0xc5, 0xc9, 0xcd, 0xd1, 0xd4, 0xd9, 0xdd, + 0xe0, 0x5f, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x4f, 0x02, 0x00, 0x00, 0x10, 0x33, 0x73, 0x33, 0x33, 0x07, + 0x01, 0x02, 0x00, 0x01, 0x22, 0xd7, 0x03, 0xec, 0x01, 0xda, 0x00, 0x66, + 0x06, 0x33, 0x13, 0x90, 0x00, 0x00, 0x13, 0x36, 0x00, 0x21, 0x00, 0x07, + 0x40, 0x00, 0x28, 0x00, 0x00, 0x10, 0x01, 0x1e, 0x64, 0x0a, 0x00, 0x72, + 0x01, 0x2b, 0x2b, 0x44, 0x4a, 0x47, 0x45, 0x45, 0x45, 0x43, 0x44, 0x58, + 0x57, 0x55, 0x54, 0x5a, 0x59, 0x25, 0x40, 0x28, 0x28, 0x39, 0x3d, 0x39, + 0x3a, 0x3a, 0x3a, 0x38, 0x39, 0x44, 0x44, 0x43, 0x42, 0x45, 0x45, 0x24, + 0x36, 0x19, 0x48, 0x40, 0x00, 0x20, 0x40, 0x0a, 0x00, 0x72, 0x06, 0x2c, + 0x01, 0x03, 0x40, 0x06, 0x05, 0x00, 0x04, 0x00, 0x00, 0x05, 0x03, 0x01, + 0x01, 0x10, 0x00, 0x10, 0x00, 0x77, 0x04, 0x01, 0x01, 0x00, 0x00, 0x00, + 0xc0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x14, 0x35, 0x09, + 0x01, 0x00, 0x00, 0x00, 0x90, 0x32, 0x38, 0x0a, 0x28, 0xff, 0x03, 0x00, + 0x28, 0x00, 0x02, 0x04, 0x03, 0x03, 0x06, 0x00, 0x01, 0x51, 0x32, 0xd0, + 0x0d, 0xb2, 0x26, 0xf2, 0x08, 0x0e, 0x05, 0x84, 0x06, 0x8e, 0x12, 0xdb, + 0x06, 0x5e, 0x01, 0xd6, 0x03, 0xb0, 0x02, 0x2e, 0x00, 0x45, 0x00, 0x67, + 0x00, 0x9a, 0x00, 0xe7, 0x00, 0x14, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x6f, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x13, + 0x00, 0x07, 0x17, 0x12, 0x00, 0x08, 0x15, 0x10, 0x00, 0x09, 0x13, 0x0f, + 0x00, 0x0a, 0x11, 0x0e, 0x00, 0x0b, 0x0f, 0x0c, 0x00, 0x0c, 0x0d, 0x0b, + 0x00, 0x0d, 0x0b, 0x09, 0x00, 0x0e, 0x09, 0x08, 0x00, 0x0f, 0x07, 0x07, + 0x00, 0x10, 0x05, 0x05, 0x00, 0x11, 0x03, 0x04, 0x00, 0x12, 0x01, 0x02, + 0x00, 0x13, 0x00, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, + 0x00, 0x70, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x06, 0x19, 0x13, 0x00, 0x07, 0x17, 0x12, 0x00, 0x08, 0x15, 0x10, + 0x00, 0x09, 0x13, 0x0f, 0x00, 0x0a, 0x11, 0x0e, 0x00, 0x0b, 0x0f, 0x0c, + 0x00, 0x0c, 0x0d, 0x0b, 0x00, 0x0d, 0x0b, 0x09, 0x00, 0x0e, 0x09, 0x08, + 0x00, 0x0f, 0x07, 0x07, 0x00, 0x10, 0x05, 0x05, 0x00, 0x11, 0x03, 0x04, + 0x00, 0x12, 0x01, 0x02, 0x00, 0x13, 0x00, 0x01, 0x00, 0x14, 0x00, 0x00, + 0x00, 0x15, 0x00, 0x00, 0x00, 0x71, 0x00, 0xec, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2a, 0x65, 0x60, 0x40, 0x3e, 0xa1, + 0x60, 0x40, 0x12, 0x21, 0x61, 0x87, 0x21, 0x09, 0x60, 0x8c, 0x41, 0x07, + 0x60, 0x9c, 0x11, 0x01, 0x60, 0xbf, 0x01, 0x01, 0x00, 0xbf, 0x31, 0x01, + 0x00, 0x07, 0x9f, 0x01, 0x00, 0x05, 0x8b, 0x01, 0x00, 0x07, 0x9f, 0x01, + 0x00, 0x0b, 0x9f, 0x02, 0x00, 0x0f, 0x9f, 0x03, 0x00, 0x13, 0x9f, 0x04, + 0x00, 0x17, 0x9f, 0x05, 0x00, 0x1b, 0x9f, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1c, 0x0f, 0x0e, 0x00, 0x1d, 0x0b, 0x0a, 0x00, 0x1f, 0x0a, 0x08, + 0x00, 0x1f, 0x0a, 0x08, 0x00, 0x18, 0x40, 0x50, 0x0a, 0x04, 0x00, 0x00, + 0x68, 0x1c, 0x00, 0x81, 0x11, 0x06, 0x02, 0x06, 0x00, 0x01, 0x00, 0x00, + 0x60, 0x07, 0x02, 0x48, 0x06, 0x52, 0xc0, 0xc3, 0x02, 0x40, 0x00, 0xff, + 0x00, 0xc7, 0x31, 0x00, 0x00, 0x07, 0x02, 0x88, 0x00, 0x60, 0xc5, 0x02, + 0x00, 0x56, 0xc5, 0x02, 0x00, 0x4a, 0x64, 0x02, 0x00, 0x39, 0x64, 0x02, + 0x00, 0x52, 0x4c, 0x02, 0x00, 0x3e, 0xeb, 0x01, 0x00, 0x21, 0xeb, 0x01, + 0x00, 0x3e, 0x72, 0x01, 0x00, 0x24, 0x72, 0x01, 0x00, 0x32, 0x3a, 0x01, + 0x00, 0x24, 0xb9, 0x00, 0x00, 0x20, 0x99, 0x00, 0x00, 0x60, 0xc5, 0x02, + 0x00, 0x56, 0xc5, 0x02, 0x00, 0x4a, 0x64, 0x02, 0x00, 0x39, 0x64, 0x02, + 0x00, 0x52, 0x4c, 0x02, 0x00, 0x3e, 0xeb, 0x01, 0x00, 0x21, 0xeb, 0x01, + 0x00, 0x3e, 0x72, 0x01, 0x00, 0x24, 0x72, 0x01, 0x00, 0x32, 0x3a, 0x01, + 0x00, 0x24, 0xb9, 0x00, 0x00, 0x20, 0x99, 0x00, 0x00, 0xe4, 0x07, 0x00, + 0x00, 0x05, 0x06, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, + 0x00, 0x72, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0x0f, 0xc0, 0x3f, 0x01, 0x01, 0xff, 0x0f, 0x01, 0x00, 0x07, + 0x08, 0x09, 0x0b, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x10, 0x32, 0x00, + 0x00, 0x43, 0x55, 0x55, 0x55, 0x04, 0x06, 0x08, 0x0a, 0x0e, 0x10, 0x10, + 0x10, 0x0a, 0x0b, 0x0c, 0x0d, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x07, + 0x08, 0x08, 0x09, 0x0a, 0x0f, 0x86, 0x03, 0x86, 0x03, 0x74, 0x00, 0x24, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, 0x1b, + 0x02, 0x05, 0x00, 0xd0, 0x07, 0xfb, 0x03, 0x08, 0x04, 0x10, 0x08, 0x01, + 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x00, 0x60, 0x06, 0x06, 0x00, + 0x00, 0x14, 0x00, 0x01, 0x00, 0x01, 0x16, 0x0f, 0x00, 0x92, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x06, 0x05, + 0x04, 0x02, 0x00, 0x5a, 0x01, 0x30, 0x20, 0x30, 0x20, 0x10, 0x38, 0x01, + 0x01, 0x9a, 0x00, 0x00, 0x00, 0x97, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0f, 0x00, 0x01, 0x01, 0x14, + 0xba, 0x05, 0x01, 0x1e, 0x00, 0xff, 0x00, 0x10, 0xff, 0x14, 0x0a, 0x64, + 0x00, 0x03, 0x18, 0xbc, 0x01, 0x09, 0x0f, 0x98, 0x00, 0x7c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x14, 0xe4, 0x00, 0x92, + 0x24, 0x09, 0x00, 0x00, 0x21, 0x54, 0x00, 0x40, 0x60, 0x02, 0x00, 0x40, + 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x18, 0x08, 0x00, 0x00, 0x00, + 0x06, 0x32, 0x00, 0x00, 0x21, 0x54, 0x00, 0x00, 0x08, 0x22, 0x00, 0x40, + 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x18, 0x08, 0x00, 0x00, 0x00, + 0x06, 0x32, 0x00, 0x00, 0x21, 0x54, 0x00, 0x40, 0x02, 0x60, 0x20, 0x40, + 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x18, 0x00, 0x18, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, + 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, + 0x00, 0x5d, 0x00, 0x8b, 0x8b, 0x06, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, + 0x00, 0x0d, 0x21, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x07, + 0x22, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x55, 0x23, 0x0b, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x4c, 0x00, 0xff, 0xff, 0x00, 0x84, 0x00, + 0x04, 0x00, 0x00, 0x9a, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0x32, 0x10, 0x00, 0x19, 0x32, 0x20, 0x00, 0x19, + 0x32, 0x30, 0x00, 0x19, 0x32, 0x40, 0x00, 0x19, 0x32, 0x80, 0x00, 0x19, + 0x32, 0xc0, 0x00, 0x19, 0x32, 0x00, 0x01, 0x19, 0x32, 0x80, 0x01, 0x19, + 0x32, 0x00, 0x02, 0x19, 0x32, 0x00, 0x03, 0x19, 0x32, 0x08, 0x04, 0x19, + 0x32, 0x00, 0x05, 0x19, 0x32, 0x00, 0x06, 0x19, 0x32, 0x80, 0x06, 0x18, + 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x10, 0x04, 0x04, 0x01, 0x10, + 0x0b, 0x04, 0x01, 0x10, 0x0c, 0x24, 0x00, 0x10, 0x24, 0x24, 0x00, 0x10, + 0x28, 0x40, 0x00, 0x10, 0x15, 0x40, 0x00, 0x01, 0x00, 0x14, 0x00, 0x11, + 0x08, 0x08, 0x00, 0x11, 0x32, 0x18, 0x00, 0x12, 0x0c, 0x32, 0x00, 0x00, + 0x07, 0x38, 0x00, 0x00, 0x02, 0x14, 0x00, 0x10, 0x03, 0x14, 0x00, 0x00, + 0x05, 0xb4, 0x00, 0x10, 0x05, 0x28, 0x00, 0x00, 0x28, 0x10, 0x00, 0x00, + 0x04, 0x00, 0x02, 0x00, 0x02, 0x04, 0x00, 0x00, 0x04, 0x00, 0x02, 0x01, + 0x0f, 0x18, 0x00, 0x01, 0x04, 0x4c, 0x00, 0x11, 0x05, 0x20, 0x00, 0x11, + 0x14, 0x20, 0x00, 0x11, 0x02, 0x00, 0x00, 0x11, 0x19, 0x00, 0x00, 0x11, + 0x15, 0x00, 0x00, 0x01, 0x0a, 0x33, 0x00, 0x11, 0x10, 0x00, 0x00, 0x02, + 0x08, 0x0c, 0x04, 0x12, 0x08, 0x02, 0x04, 0x11, 0x08, 0x00, 0x00, 0x11, + 0x04, 0x04, 0x01, 0x11, 0x01, 0x04, 0x01, 0x12, 0x10, 0xfb, 0x00, 0x11, + 0x02, 0x28, 0x00, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x01, 0x00, 0x04, 0x01, 0x0a, 0xaa, 0x02, 0x00, 0x08, 0xf4, 0x00, 0x10, + 0x08, 0xf4, 0x00, 0x00, 0x04, 0x00, 0x02, 0x10, 0x04, 0x00, 0x02, 0x9b, + 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x0e, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x48, 0x00, 0x48, + 0x00, 0xff, 0x08, 0x10, 0x10, 0x00, 0xff, 0x0c, 0x02, 0x60, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x9d, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa1, + 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xf0, 0x0f, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, + 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, + 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, + 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, + 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, + 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x64, 0x00, 0x7c, 0x15, 0x64, 0x00, 0x02, 0x0d, 0x64, 0x00, 0xc4, + 0x09, 0x88, 0x13, 0x64, 0x00, 0xd0, 0x07, 0xa0, 0x0f, 0x40, 0x1f, 0x86, + 0x06, 0x02, 0x0d, 0x40, 0x1f, 0x9e, 0xa1, 0xa8, 0xab, 0xad, 0x00, 0x00, + 0x00, 0x02, 0x01, 0xa2, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x05, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x0c, 0x00, + 0x00, 0x00, 0x00, 0x64, 0x00, 0x64, 0x00, 0x02, 0x0d, 0x64, 0x00, 0xc4, + 0x09, 0x88, 0x13, 0x64, 0x00, 0xd0, 0x07, 0xa0, 0x0f, 0x40, 0x1f, 0x86, + 0x06, 0x02, 0x0d, 0x40, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x00, 0x7d, 0x01, 0x36, 0x32, 0x00, 0xa8, 0x00, 0x0c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0xad, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0xb0, 0x00, 0xf4, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x58, 0x00, 0x60, 0x01, 0x20, 0x01, 0x00, 0x01, 0x5c, + 0x00, 0x60, 0x03, 0x60, 0x00, 0x00, 0x05, 0x00, 0x06, 0xfa, 0x80, 0x0b, + 0x00, 0x00, 0x05, 0x00, 0x04, 0xfa, 0x06, 0x12, 0x55, 0x00, 0x05, 0xe0, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x0b, 0x0f, 0x0c, + 0x0f, 0x00, 0x05, 0x04, 0x03, 0x0d, 0x0f, 0x0a, 0x10, 0x00, 0x05, 0x08, + 0x03, 0x17, 0x00, 0x02, 0x11, 0x00, 0x05, 0x00, 0x16, 0xfa, 0x80, 0x0b, + 0x00, 0x00, 0x05, 0x00, 0x14, 0x0a, 0x07, 0x0a, 0x15, 0x00, 0x05, 0x04, + 0x06, 0x12, 0x80, 0x0a, 0x00, 0x00, 0x05, 0x0c, 0x03, 0x01, 0x01, 0x02, + 0x01, 0x00, 0x05, 0x10, 0x03, 0x03, 0x01, 0x00, 0x02, 0x00, 0x05, 0x14, + 0x03, 0x19, 0x00, 0x00, 0x00, 0x00, 0x05, 0x04, 0x16, 0x0a, 0x80, 0x0a, + 0x00, 0x00, 0x05, 0x3c, 0x00, 0x10, 0x00, 0x55, 0x03, 0x00, 0x05, 0x34, + 0x00, 0x02, 0x18, 0x02, 0x37, 0x00, 0x00, 0x78, 0x01, 0x7f, 0x61, 0x15, + 0x04, 0x00, 0x00, 0x7c, 0x01, 0x14, 0x0a, 0x07, 0x00, 0x00, 0x00, 0x74, + 0x01, 0x18, 0x13, 0x08, 0x04, 0x00, 0x0e, 0x14, 0x00, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x0f, 0x14, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x68, + 0x86, 0x28, 0x60, 0x60, 0x01, 0x00, 0x00, 0x10, 0x91, 0x9a, 0x4b, 0x23, + 0x2c, 0x00, 0x20, 0x18, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x08, 0x28, + 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x09, 0x28, 0x00, 0x00, 0x0c, 0x00, + 0x00, 0x00, 0x15, 0x00, 0x00, 0x98, 0xf9, 0xd7, 0x09, 0x00, 0x1e, 0x20, + 0x00, 0x00, 0x00, 0x40, 0x64, 0x00, 0x27, 0xc8, 0x08, 0xb8, 0x9b, 0x20, + 0x97, 0xb1, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x27, 0x20, 0x0c, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x0e, 0x10, 0x00, 0x00, 0xa0, 0x03, 0x00, 0x00, 0x0f, 0x10, + 0x00, 0x00, 0xa0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x20, 0x02, + 0x00, 0x00, 0x00, 0x08, 0x70, 0x00, 0x20, 0x02, 0x00, 0x00, 0x16, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x18, 0x00, 0xf0, 0x7f, 0x00, + 0x58, 0x00, 0x17, 0x00, 0x00, 0x00, 0x4c, 0x49, 0x00, 0x00, 0x17, 0x04, + 0x00, 0x00, 0x32, 0xb5, 0x7f, 0x00, 0x17, 0x14, 0x00, 0x14, 0x30, 0x08, + 0xc0, 0x00, 0x17, 0x18, 0x00, 0x18, 0x20, 0x40, 0x82, 0x00, 0x17, 0x1c, + 0x00, 0x00, 0xe0, 0x07, 0xa0, 0x00, 0x17, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x1b, 0x1c, 0x00, 0x20, 0x17, 0x62, 0x03, 0x00, 0x1c, 0x00, + 0x00, 0x00, 0x83, 0x00, 0x38, 0x00, 0x1c, 0x80, 0x00, 0x9a, 0xff, 0xaf, + 0x00, 0x00, 0x1c, 0x84, 0x00, 0xba, 0x5e, 0xaf, 0x00, 0x00, 0x27, 0x5c, + 0x11, 0x90, 0x00, 0x74, 0x01, 0x00, 0x27, 0x5c, 0x15, 0x90, 0x00, 0x74, + 0x01, 0x00, 0x17, 0x40, 0x00, 0xf9, 0x34, 0x8d, 0xb0, 0x00, 0x17, 0x44, + 0x00, 0xf9, 0x34, 0x0d, 0x60, 0x00, 0x17, 0x4c, 0x00, 0xf9, 0x34, 0xcd, + 0xf1, 0x00, 0x17, 0x48, 0x00, 0xf9, 0x34, 0xcd, 0xe0, 0x00, 0x02, 0x70, + 0x03, 0x58, 0x00, 0x00, 0x00, 0x00, 0x02, 0x74, 0x03, 0x58, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x78, 0x03, 0x58, 0x00, 0x00, 0x00, 0x00, 0x02, 0x7c, + 0x03, 0x58, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x03, 0x58, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x3c, 0x03, 0x46, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, + 0x04, 0x7a, 0x00, 0x00, 0x00, 0xb2, 0x00, 0xac, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x08, 0x84, + 0x00, 0x05, 0x8b, 0x01, 0x00, 0x00, 0x09, 0x84, 0x00, 0x05, 0x8b, 0x01, + 0x00, 0x00, 0x0b, 0x44, 0x00, 0x40, 0x4e, 0x81, 0x60, 0x00, 0x0b, 0x48, + 0x00, 0x40, 0x12, 0x01, 0x61, 0x00, 0x0b, 0x4c, 0x00, 0x86, 0x21, 0x05, + 0x60, 0x00, 0x0b, 0x54, 0x00, 0x9a, 0x11, 0x01, 0x60, 0x00, 0x02, 0x4c, + 0x01, 0x06, 0x06, 0x0e, 0x60, 0x00, 0x27, 0x6c, 0x11, 0xff, 0x7f, 0xc2, + 0x27, 0x00, 0x27, 0x6c, 0x15, 0xff, 0x7f, 0xc2, 0x27, 0x00, 0x00, 0x14, + 0x91, 0x50, 0x13, 0x0a, 0x05, 0x00, 0x00, 0x0c, 0xf4, 0x14, 0x1e, 0x28, + 0x36, 0x00, 0x00, 0x10, 0xf4, 0x79, 0x1c, 0x14, 0x00, 0x00, 0x00, 0x14, + 0xf4, 0x79, 0x1c, 0x14, 0x00, 0x00, 0x00, 0x0c, 0xc2, 0x42, 0x42, 0x31, + 0x00, 0x00, 0x00, 0x00, 0xf4, 0x18, 0x9c, 0x03, 0x40, 0x00, 0x00, 0x04, + 0xf4, 0x18, 0x9c, 0x03, 0x40, 0x00, 0x02, 0x5c, 0x03, 0x14, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x08, 0x04, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c, + 0x04, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x02, 0x10, 0x04, 0x7a, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x14, 0x04, 0x6a, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x44, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x04, + 0x00, 0x28, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x03, + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x32, 0x00, 0x02, + 0x00, 0x19, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x28, 0x00, 0x01, + 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, + 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, + 0x03, 0x64, 0x01, 0x01, 0x00, 0xc5, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2a, 0x65, 0x60, 0x40, 0x4e, 0x81, + 0x60, 0x40, 0x12, 0x01, 0x61, 0x86, 0x21, 0x05, 0x60, 0x8c, 0x41, 0x07, + 0x60, 0x9a, 0x11, 0x01, 0x60, 0xbf, 0x01, 0x01, 0x00, 0xbf, 0x31, 0x01, + 0x00, 0x07, 0x9f, 0x01, 0x00, 0x05, 0x8b, 0x01, 0x00, 0x07, 0x9f, 0x01, + 0x00, 0x0b, 0x9f, 0x02, 0x00, 0x0f, 0x9f, 0x03, 0x00, 0x13, 0x9f, 0x04, + 0x00, 0x17, 0x9f, 0x05, 0x00, 0x1b, 0x9f, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1c, 0x0f, 0x0e, 0x00, 0x1d, 0x0b, 0x0a, 0x00, 0x1f, 0x0a, 0x08, + 0x00, 0x1f, 0x0a, 0x08, 0x00, 0x18, 0x40, 0x50, 0x0a, 0x04, 0x00, 0x00, + 0x68, 0x1c, 0x00, 0x81, 0x11, 0x06, 0x02, 0x06, 0x00, 0x01, 0x00, 0x00, + 0x60, 0x07, 0x02, 0x48, 0x06, 0x52, 0xc0, 0xc3, 0x02, 0x40, 0x05, 0xff, + 0x00, 0xc7, 0x31, 0x00, 0x00, 0x07, 0x02, 0x88, 0x00, 0x60, 0xc5, 0x02, + 0x00, 0x56, 0xc5, 0x02, 0x00, 0x4a, 0x64, 0x02, 0x00, 0x39, 0x64, 0x02, + 0x00, 0x52, 0x4c, 0x02, 0x00, 0x3e, 0xeb, 0x01, 0x00, 0x21, 0xeb, 0x01, + 0x00, 0x3e, 0x72, 0x01, 0x00, 0x24, 0x72, 0x01, 0x00, 0x32, 0x3a, 0x01, + 0x00, 0x24, 0xb9, 0x00, 0x00, 0x20, 0x99, 0x00, 0x00, 0x60, 0xc5, 0x02, + 0x00, 0x56, 0xc5, 0x02, 0x00, 0x4a, 0x64, 0x02, 0x00, 0x39, 0x64, 0x02, + 0x00, 0x52, 0x4c, 0x02, 0x00, 0x3e, 0xeb, 0x01, 0x00, 0x21, 0xeb, 0x01, + 0x00, 0x3e, 0x72, 0x01, 0x00, 0x24, 0x72, 0x01, 0x00, 0x32, 0x3a, 0x01, + 0x00, 0x24, 0xb9, 0x00, 0x00, 0x20, 0x99, 0x00, 0x00, 0xe4, 0x07, 0x00, + 0x00, 0x00, 0x20, 0x04, 0x00, 0xc6, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0xc7, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x08, + 0x04, 0xf4, 0x01, 0xcd, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x09, 0xa8, 0xab, 0x2d, 0x19, 0x19, 0x04, 0xa8, + 0x50, 0xfa, 0x14, 0x01, 0x09, 0x05, 0x05, 0x12, 0x08, 0x1e, 0x0f, 0x05, + 0xa9, 0xb1, 0x00, 0x64, 0x00, 0x14, 0x00, 0x0a, 0x00, 0x00, 0x00, 0xce, + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, + 0x80, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, + 0xd0, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x04, 0x00, 0x00, 0x07, 0x04, 0x08, 0x08, 0x00, 0x0f, 0x00, + 0xa7, 0x18, 0x04, 0x0b, 0x0b, 0x00, 0x0a, 0x00, 0xbf, 0x2a, 0x07, 0x09, + 0x0b, 0x00, 0x0a, 0x00, 0x25, 0x35, 0x09, 0x06, 0x0b, 0x00, 0x0f, 0x00, + 0x03, 0x41, 0x06, 0x08, 0x0b, 0x00, 0x48, 0x00, 0xad, 0x75, 0x08, 0x06, + 0x0b, 0x00, 0x0a, 0x00, 0x5f, 0x04, 0x01, 0x08, 0x0b, 0x00, 0xd1, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x78, 0xff, 0x03, 0x00, 0xd3, 0x00, 0xcc, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x05, 0x00, 0x03, 0xc0, + 0x06, 0x00, 0x07, 0xc0, 0x06, 0x00, 0x0b, 0xc0, 0x06, 0x00, 0x0f, 0xc0, + 0x06, 0x00, 0x17, 0xc0, 0x06, 0x00, 0x1f, 0xc0, 0x0a, 0x00, 0x23, 0xc0, + 0x0e, 0x00, 0x27, 0xc0, 0x12, 0x09, 0x2b, 0xc0, 0x9a, 0x11, 0x3f, 0xc0, + 0xbe, 0x19, 0x01, 0xc1, 0x82, 0x24, 0x3f, 0xc0, 0xbe, 0x01, 0x3b, 0xc0, + 0x3a, 0x00, 0x03, 0x60, 0x04, 0x00, 0x03, 0xa0, 0x04, 0x00, 0x03, 0x80, + 0x05, 0x00, 0x03, 0xc0, 0x06, 0x00, 0x07, 0xc0, 0x06, 0x00, 0x0b, 0xc0, + 0x06, 0x00, 0x0f, 0xc0, 0x06, 0x00, 0x17, 0xc0, 0x06, 0x00, 0x1f, 0xc0, + 0x0a, 0x00, 0x23, 0xc0, 0x0e, 0x00, 0x27, 0xc0, 0x12, 0x09, 0x2b, 0xc0, + 0x9a, 0x11, 0x3f, 0xc0, 0xbe, 0x19, 0x01, 0xc1, 0x82, 0x24, 0x3f, 0xc0, + 0xbe, 0x01, 0x3b, 0xc0, 0x3a, 0x00, 0x03, 0x60, 0x04, 0x00, 0x03, 0xa0, + 0x04, 0x00, 0x44, 0x04, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x0f, 0x0f, + 0x00, 0x00, 0x00, 0x0d, 0xc0, 0x0b, 0x00, 0x00, 0x48, 0x0b, 0x00, 0x00, + 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x90, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x03, + 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x09, 0x02, 0x00, 0x00, 0x0b, 0x02, + 0x00, 0x00, 0x0a, 0x03, 0x00, 0x00, 0x0a, 0x04, 0x00, 0x00, 0x17, 0x02, + 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x0d, 0x04, 0x00, 0x00, 0x0b, 0x05, + 0x00, 0x00, 0x14, 0x03, 0x00, 0x00, 0x09, 0x07, 0x00, 0x00, 0x0b, 0x06, + 0x00, 0x00, 0x0e, 0x05, 0x00, 0x00, 0x0f, 0x05, 0x00, 0x00, 0x0a, 0x08, + 0x00, 0x00, 0x07, 0x0c, 0x00, 0x00, 0x0f, 0x06, 0x00, 0x00, 0x0c, 0x08, + 0x00, 0x00, 0x1a, 0x04, 0x00, 0x00, 0x0c, 0x09, 0x00, 0x00, 0x0d, 0x09, + 0x00, 0x00, 0x19, 0x05, 0x00, 0x00, 0x16, 0x06, 0x00, 0x00, 0x14, 0x07, + 0x00, 0x00, 0x15, 0x07, 0x00, 0x00, 0x16, 0x07, 0x00, 0x00, 0x1b, 0x06, + 0x00, 0x00, 0x19, 0x07, 0x00, 0x00, 0x1a, 0x07, 0x00, 0x00, 0x1c, 0x07, + 0x00, 0x00, 0x00, 0x49, 0x07, 0x00, 0x27, 0x9d, 0x74, 0x12, 0xc0, 0x8e, + 0xaa, 0x4c, 0xe7, 0x06, 0x00, 0x00, 0xd5, 0x00, 0x84, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x04, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x82, + 0x30, 0x00, 0x71, 0x82, 0x10, 0x00, 0x7d, 0x82, 0x00, 0x00, 0x71, 0x84, + 0x00, 0x00, 0x7d, 0x86, 0x00, 0x00, 0x79, 0x86, 0x00, 0x00, 0x7d, 0x8a, + 0x00, 0x00, 0x7c, 0x8a, 0x00, 0x00, 0x75, 0x8c, 0x00, 0x00, 0x71, 0x8e, + 0x10, 0x00, 0x71, 0xcc, 0x00, 0x00, 0x7d, 0x9a, 0x01, 0x00, 0x75, 0xca, + 0x00, 0x00, 0x7d, 0xf6, 0x00, 0x00, 0x71, 0x96, 0x00, 0x00, 0x71, 0x92, + 0x00, 0x00, 0x23, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x30, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0e, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x40, 0x01, 0x80, 0x00, + 0x00, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x84, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x04, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x82, + 0x30, 0x00, 0x71, 0x82, 0x10, 0x00, 0x7d, 0x82, 0x00, 0x00, 0x71, 0x84, + 0x00, 0x00, 0x7d, 0x86, 0x00, 0x00, 0x79, 0x86, 0x00, 0x00, 0x7d, 0x8a, + 0x00, 0x00, 0x7c, 0x8a, 0x00, 0x00, 0x75, 0x8c, 0x00, 0x00, 0x71, 0x8e, + 0x00, 0x00, 0x71, 0xcc, 0x00, 0x00, 0x7d, 0x9a, 0x01, 0x00, 0x75, 0xca, + 0x00, 0x00, 0x7d, 0xf6, 0x00, 0x00, 0x71, 0x96, 0x00, 0x00, 0x71, 0x92, + 0x00, 0x00, 0x28, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x30, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0e, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x40, 0x01, 0x80, 0x00, + 0x00, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0xd7, 0x00, 0xa0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0x69, 0x02, 0x03, 0x3f, + 0x69, 0x02, 0x03, 0x3f, 0x69, 0x02, 0x03, 0x3f, 0xa9, 0x02, 0x07, 0x3f, + 0xa9, 0x04, 0x0f, 0x3f, 0xa9, 0x02, 0x1f, 0x3f, 0xe9, 0x04, 0x3f, 0x3f, + 0xa9, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x3f, 0xa9, 0x02, 0x3f, 0x3f, 0xe9, 0x02, 0x08, 0x04, + 0x00, 0x00, 0x88, 0x04, 0x00, 0x00, 0x98, 0x04, 0x00, 0x00, 0xa0, 0x04, + 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x18, 0x04, 0x00, 0x00, 0x28, 0x04, + 0x00, 0x00, 0xc8, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, + 0x00, 0x00, 0x0a, 0x66, 0x00, 0x00, 0x0b, 0x66, 0x00, 0x00, 0x12, 0x66, + 0x00, 0x00, 0x1c, 0x66, 0x00, 0x00, 0x1e, 0x66, 0x00, 0x00, 0x13, 0x66, + 0x00, 0x00, 0x1d, 0x66, 0x00, 0x00, 0x1f, 0x66, 0x00, 0x00, 0xd8, 0x00, + 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, + 0x69, 0x02, 0x03, 0x3f, 0x69, 0x02, 0x03, 0x3f, 0x69, 0x02, 0x03, 0x3f, + 0xa9, 0x02, 0x07, 0x3f, 0xa9, 0x04, 0x0f, 0x3f, 0xa9, 0x02, 0x1f, 0x3f, + 0xe9, 0x04, 0x3f, 0x3f, 0xa9, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x3f, 0xa9, 0x02, 0x3f, 0x3f, + 0xe9, 0x02, 0x08, 0x04, 0x00, 0x00, 0x88, 0x04, 0x00, 0x00, 0x98, 0x04, + 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x18, 0x04, + 0x00, 0x00, 0x28, 0x04, 0x00, 0x00, 0xd8, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x04, + 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x0a, 0x66, 0x00, 0x00, 0x0b, 0x66, + 0x00, 0x00, 0x12, 0x66, 0x00, 0x00, 0x1c, 0x66, 0x00, 0x00, 0x1e, 0x66, + 0x00, 0x00, 0x13, 0x66, 0x00, 0x00, 0x1d, 0x66, 0x00, 0x00, 0x1f, 0x66, + 0x00, 0x00, 0xd9, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x00, + 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x01, + 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x09, 0x02, + 0x00, 0x00, 0x0b, 0x02, 0x00, 0x00, 0x0a, 0x03, 0x00, 0x00, 0x0a, 0x04, + 0x00, 0x00, 0x17, 0x02, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x0d, 0x04, + 0x00, 0x00, 0x0b, 0x05, 0x00, 0x00, 0x14, 0x03, 0x00, 0x00, 0x09, 0x07, + 0x00, 0x00, 0x0b, 0x06, 0x00, 0x00, 0x0e, 0x05, 0x00, 0x00, 0x0f, 0x05, + 0x00, 0x00, 0x0a, 0x08, 0x00, 0x00, 0x07, 0x0c, 0x00, 0x00, 0x0f, 0x06, + 0x00, 0x00, 0x0c, 0x08, 0x00, 0x00, 0x1a, 0x04, 0x00, 0x00, 0x0c, 0x09, + 0x00, 0x00, 0x0d, 0x09, 0x00, 0x00, 0x19, 0x05, 0x00, 0x00, 0x16, 0x06, + 0x00, 0x00, 0x14, 0x07, 0x00, 0x00, 0x15, 0x07, 0x00, 0x00, 0x16, 0x07, + 0x00, 0x00, 0x1b, 0x06, 0x00, 0x00, 0x19, 0x07, 0x00, 0x00, 0x1a, 0x07, + 0x00, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x00, 0x49, 0x07, 0x00, 0x27, 0x9d, + 0x74, 0x12, 0xc0, 0x8e, 0xaa, 0x4c, 0xe7, 0x06, 0x00, 0x00, 0xdc, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, + 0x25, 0x00, 0x84, 0x80, 0x1c, 0x00, 0x44, 0x82, 0x18, 0x00, 0x44, 0x86, + 0x18, 0x00, 0x44, 0x8a, 0x18, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, + 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, + 0x10, 0x00, 0xc4, 0x00, 0x25, 0x00, 0x84, 0x00, 0x1d, 0x00, 0x84, 0x80, + 0x14, 0x00, 0x44, 0x82, 0x18, 0x00, 0x44, 0x86, 0x18, 0x00, 0x14, 0x00, + 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, + 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x84, 0x00, 0x25, 0x00, 0x84, 0x80, + 0x1c, 0x00, 0x44, 0x82, 0x18, 0x00, 0x44, 0x86, 0x18, 0x00, 0x44, 0x8a, + 0x18, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, + 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0xc4, 0x00, + 0x25, 0x00, 0x84, 0x00, 0x1d, 0x00, 0x84, 0x80, 0x14, 0x00, 0x44, 0x82, + 0x18, 0x00, 0x44, 0x86, 0x18, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, + 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x14, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, + 0x90, 0xa0, 0xb0, 0x0b, 0x11, 0x1b, 0x2b, 0x45, 0x0b, 0x11, 0x1b, 0x2b, + 0x45, 0xc4, 0xd6, 0xea, 0xf6, 0x00, 0xf5, 0xf5, 0xf5, 0xf5, 0xf5, 0xc4, + 0xd6, 0xea, 0xf6, 0x00, 0xf5, 0xf5, 0xf5, 0xf5, 0xf5, 0x20, 0x46, 0x62, + 0x84, 0xaa, 0x00, 0x00, 0xfc, 0xf8, 0x00, 0x00, 0xfc, 0xf8, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdd, 0x00, + 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x08, 0x10, 0x08, 0x04, 0x02, 0x00, 0x90, 0x01, 0x03, 0x00, 0xde, 0x00, + 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x16, 0x00, + 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2c, 0x00, + 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x34, 0x00, + 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x80, 0x28, + 0x1e, 0xe2, 0x00, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xff, + 0x01, 0x00, 0x28, 0x23, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x1e, 0x00, + 0x01, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x10, 0x00, 0xe2, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x03, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x38, 0x00, 0x1c, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0xc0, 0x01, 0xe0, 0x00, 0x34, 0x10, + 0x03, 0x00, 0xee, 0x18, 0x00, 0x00, 0x34, 0x10, 0x03, 0x00, 0xee, 0x18, + 0x00, 0x00, 0x28, 0x00, 0x02, 0x0b, 0x0c, 0x3b, 0x3c, 0x50, 0x02, 0x0b, + 0x0c, 0x3b, 0x3c, 0x50, 0x0b, 0x3c, 0x72, 0x54, 0x00, 0x0a, 0x00, 0x06, + 0x88, 0x10, 0xe3, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0e, + 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x38, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, + 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08, 0x00, 0x09, 0x00, 0x0a, 0x00, + 0x0b, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0e, 0x00, 0x0f, 0x00, 0x10, 0x00, + 0x11, 0x00, 0x12, 0x00, 0x13, 0x00, 0x14, 0x00, 0x15, 0x00, 0x16, 0x00, + 0x17, 0x00, 0x18, 0x00, 0x19, 0x00, 0x1a, 0x00, 0x1b, 0x00, 0x1c, 0x00, + 0x1d, 0x00, 0x10, 0x10, 0xb4, 0x3c, 0x08, 0xcd, 0x02, 0x00, 0xed, 0x16, + 0x00, 0x00, 0x00, 0xc8, 0x14, 0x0b, 0xff, 0xff, 0xff, 0x3f, 0x90, 0x01, + 0x0f, 0x00, 0xe4, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, + 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x93, 0x00, + 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, + 0x1a, 0x00, 0x69, 0x00, 0x1b, 0x00, 0x69, 0x00, 0x1b, 0x00, 0x69, 0x00, + 0x1a, 0x00, 0x69, 0x00, 0x1a, 0x00, 0x60, 0x01, 0x00, 0x00, 0x44, 0x01, + 0x00, 0x00, 0x4c, 0x01, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x54, 0x01, + 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x4c, 0x01, + 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x80, 0x01, + 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x70, 0x01, + 0x00, 0x00, 0x74, 0x01, 0x00, 0x00, 0xe5, 0x00, 0xa0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x32, 0xaa, 0x02, 0x05, 0x20, + 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xc8, + 0x04, 0x32, 0xa0, 0x00, 0xc0, 0x14, 0xa2, 0x00, 0xc0, 0x14, 0xa0, 0x00, + 0x80, 0x30, 0xa2, 0x00, 0x80, 0x30, 0xb0, 0x00, 0xc0, 0x14, 0xb2, 0x00, + 0xc0, 0x14, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, + 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, + 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, + 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, + 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, + 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, + 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, + 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, + 0xea, 0x00, 0xb0, 0x00, 0xea, 0x00, 0xb2, 0x00, 0xea, 0x00, 0xe6, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0xa0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0x00, + 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc9, 0x04, + 0xcb, 0x04, 0x01, 0x05, 0x03, 0x05, 0x05, 0x05, 0x07, 0x05, 0x09, 0x05, + 0x0b, 0x05, 0x41, 0x05, 0x43, 0x05, 0x45, 0x05, 0x47, 0x05, 0x49, 0x05, + 0x4b, 0x05, 0x81, 0x05, 0x83, 0x05, 0x85, 0x05, 0x87, 0x05, 0x89, 0x05, + 0x80, 0x09, 0x82, 0x09, 0x84, 0x09, 0x86, 0x09, 0x88, 0x09, 0x8a, 0x09, + 0xc1, 0x09, 0xc3, 0x09, 0xc5, 0x09, 0xc7, 0x09, 0xc9, 0x09, 0xcb, 0x09, + 0xc1, 0x0d, 0xc3, 0x0d, 0xc5, 0x0d, 0xc7, 0x0d, 0xc9, 0x0d, 0xcb, 0x0d, + 0xc0, 0x11, 0xc2, 0x11, 0xc4, 0x11, 0xc6, 0x11, 0xc8, 0x11, 0xca, 0x11, + 0xc1, 0x15, 0xc3, 0x15, 0xc5, 0x15, 0xc7, 0x15, 0xc9, 0x15, 0xcb, 0x15, + 0xc4, 0x19, 0xc6, 0x19, 0xc8, 0x19, 0xca, 0x19, 0xcc, 0x19, 0xce, 0x19, + 0xd5, 0x19, 0xd7, 0x19, 0xd9, 0x19, 0xdb, 0x19, 0xdd, 0x19, 0xdf, 0x19, + 0xd3, 0x1d, 0xd5, 0x1d, 0xd7, 0x1d, 0xd9, 0x1d, 0xdb, 0x1d, 0xc6, 0x39, + 0xea, 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x09, 0x01, 0x0b, 0x01, 0x41, 0x01, 0x43, 0x01, 0x45, 0x01, 0x47, 0x01, + 0x49, 0x01, 0x4b, 0x01, 0x81, 0x01, 0x83, 0x01, 0x85, 0x01, 0x87, 0x01, + 0x89, 0x01, 0x8b, 0x01, 0xc2, 0x01, 0xc4, 0x01, 0xc6, 0x01, 0xc8, 0x01, + 0xca, 0x01, 0xcc, 0x01, 0xd2, 0x01, 0xd4, 0x01, 0xd6, 0x01, 0xd8, 0x01, + 0xda, 0x01, 0xdc, 0x01, 0xd2, 0x05, 0xd4, 0x05, 0xd6, 0x05, 0xd8, 0x05, + 0xda, 0x05, 0xdc, 0x05, 0xd3, 0x09, 0xd5, 0x09, 0xd7, 0x09, 0xd9, 0x09, + 0xdb, 0x09, 0xdd, 0x09, 0xd3, 0x0d, 0xd5, 0x0d, 0xd7, 0x0d, 0xd9, 0x0d, + 0xdb, 0x0d, 0xdd, 0x0d, 0xd2, 0x11, 0xd4, 0x11, 0xd6, 0x11, 0xd8, 0x11, + 0xda, 0x11, 0xdc, 0x11, 0xd3, 0x15, 0xd5, 0x15, 0xd7, 0x15, 0xd9, 0x15, + 0xdb, 0x15, 0xd4, 0x19, 0xd6, 0x19, 0xd8, 0x19, 0xda, 0x19, 0xdc, 0x19, + 0xde, 0x19, 0xa2, 0x31, 0xa4, 0x31, 0xa6, 0x31, 0xa8, 0x31, 0xaa, 0x31, + 0xac, 0x31, 0xeb, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x81, 0x00, 0x83, 0x00, 0x85, 0x00, 0x87, 0x00, 0x89, 0x00, + 0x8b, 0x00, 0x91, 0x00, 0x93, 0x00, 0x95, 0x00, 0x97, 0x00, 0x99, 0x00, + 0x9b, 0x00, 0xa1, 0x00, 0xa3, 0x00, 0xa5, 0x00, 0xa7, 0x00, 0xa9, 0x00, + 0xab, 0x00, 0xe1, 0x00, 0xe3, 0x00, 0xe5, 0x00, 0xe7, 0x00, 0xe9, 0x00, + 0xeb, 0x00, 0x21, 0x01, 0x23, 0x01, 0x25, 0x01, 0x27, 0x01, 0x29, 0x01, + 0x2b, 0x01, 0x61, 0x01, 0x63, 0x01, 0x65, 0x01, 0x67, 0x01, 0x69, 0x01, + 0x6b, 0x01, 0xa1, 0x01, 0xa3, 0x01, 0xa5, 0x01, 0xa7, 0x01, 0xa9, 0x01, + 0xab, 0x01, 0xe1, 0x01, 0xe3, 0x01, 0xe5, 0x01, 0xe7, 0x01, 0xe9, 0x01, + 0xeb, 0x01, 0xed, 0x01, 0xef, 0x01, 0xb2, 0x01, 0xb4, 0x01, 0xb6, 0x01, + 0xb8, 0x01, 0xba, 0x01, 0xf1, 0x01, 0xf3, 0x01, 0xf5, 0x01, 0xf7, 0x01, + 0xf9, 0x01, 0xfb, 0x01, 0xcb, 0x0d, 0xc0, 0x11, 0xc2, 0x11, 0xc4, 0x11, + 0xc6, 0x11, 0xc8, 0x11, 0xca, 0x11, 0xc1, 0x15, 0xc3, 0x15, 0xc5, 0x15, + 0xc7, 0x15, 0xc9, 0x15, 0xcb, 0x15, 0xc4, 0x19, 0xc6, 0x19, 0xc8, 0x19, + 0xca, 0x19, 0xcc, 0x19, 0xce, 0x19, 0xd5, 0x19, 0xd7, 0x19, 0xd9, 0x19, + 0xdb, 0x19, 0xdd, 0x19, 0xdf, 0x19, 0xd3, 0x1d, 0xd5, 0x1d, 0xd7, 0x1d, + 0xd9, 0x1d, 0xdb, 0x1d, 0xdd, 0x1d, 0xec, 0x00, 0x86, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x02, 0x05, 0x04, 0x05, + 0x06, 0x05, 0x08, 0x05, 0x0a, 0x05, 0x40, 0x05, 0x42, 0x05, 0x44, 0x05, + 0x46, 0x05, 0x48, 0x05, 0x4a, 0x05, 0x80, 0x05, 0x82, 0x05, 0x84, 0x05, + 0x86, 0x05, 0x88, 0x05, 0x8a, 0x05, 0x80, 0x09, 0x82, 0x09, 0x84, 0x09, + 0x86, 0x09, 0x88, 0x09, 0x8a, 0x09, 0xc1, 0x09, 0xc3, 0x09, 0xc5, 0x09, + 0xc7, 0x09, 0xc9, 0x09, 0xcb, 0x09, 0xc1, 0x0d, 0xc3, 0x0d, 0xc5, 0x0d, + 0xc7, 0x0d, 0xc9, 0x0d, 0xcb, 0x0d, 0xc0, 0x11, 0xc2, 0x11, 0xc4, 0x11, + 0xc6, 0x11, 0xc8, 0x11, 0xca, 0x11, 0xc1, 0x15, 0xc3, 0x15, 0xc5, 0x15, + 0xc7, 0x15, 0xc9, 0x15, 0xcb, 0x15, 0xc2, 0x19, 0xc4, 0x19, 0xc6, 0x19, + 0xc8, 0x19, 0xca, 0x19, 0xcc, 0x19, 0xd2, 0x19, 0xd4, 0x19, 0xd6, 0x19, + 0xd8, 0x19, 0xda, 0x19, 0xdc, 0x19, 0xd0, 0x1d, 0xd2, 0x1d, 0xd4, 0x1d, + 0xd6, 0x1d, 0xd8, 0x1d, 0xda, 0x1d, 0xc4, 0x39, 0xed, 0x00, 0x86, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x01, 0x43, 0x01, + 0x45, 0x01, 0x47, 0x01, 0x49, 0x01, 0x4b, 0x01, 0x81, 0x01, 0x83, 0x01, + 0x85, 0x01, 0x87, 0x01, 0x89, 0x01, 0x8b, 0x01, 0xc2, 0x01, 0xc4, 0x01, + 0xc6, 0x01, 0xc8, 0x01, 0xca, 0x01, 0xcc, 0x01, 0xd2, 0x01, 0xd4, 0x01, + 0xd6, 0x01, 0xd8, 0x01, 0xda, 0x01, 0xdc, 0x01, 0xd2, 0x05, 0xd4, 0x05, + 0xd6, 0x05, 0xd8, 0x05, 0xda, 0x05, 0xdc, 0x05, 0xd3, 0x09, 0xd5, 0x09, + 0xd7, 0x09, 0xd9, 0x09, 0xdb, 0x09, 0xdd, 0x09, 0xd3, 0x0d, 0xd5, 0x0d, + 0xd7, 0x0d, 0xd9, 0x0d, 0xdb, 0x0d, 0xdd, 0x0d, 0xd2, 0x11, 0xd4, 0x11, + 0xd6, 0x11, 0xd8, 0x11, 0xda, 0x11, 0xdc, 0x11, 0xd3, 0x15, 0xd5, 0x15, + 0xd7, 0x15, 0xd9, 0x15, 0xdb, 0x15, 0xdd, 0x15, 0xd6, 0x19, 0xd8, 0x19, + 0xda, 0x19, 0xdc, 0x19, 0xde, 0x19, 0xa1, 0x31, 0xa3, 0x31, 0xa5, 0x31, + 0xa7, 0x31, 0xa9, 0x31, 0xab, 0x31, 0xad, 0x31, 0xa4, 0x35, 0xee, 0x00, + 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, + 0x83, 0x00, 0x85, 0x00, 0x87, 0x00, 0x89, 0x00, 0x8b, 0x00, 0x91, 0x00, + 0x93, 0x00, 0x95, 0x00, 0x97, 0x00, 0x99, 0x00, 0x9b, 0x00, 0xa1, 0x00, + 0xa3, 0x00, 0xa5, 0x00, 0xa7, 0x00, 0xa9, 0x00, 0xab, 0x00, 0xe1, 0x00, + 0xe3, 0x00, 0xe5, 0x00, 0xe7, 0x00, 0xe9, 0x00, 0xeb, 0x00, 0x21, 0x01, + 0x23, 0x01, 0x25, 0x01, 0x27, 0x01, 0x29, 0x01, 0x2b, 0x01, 0x61, 0x01, + 0x63, 0x01, 0x65, 0x01, 0x67, 0x01, 0x69, 0x01, 0x6b, 0x01, 0xa1, 0x01, + 0xa3, 0x01, 0xa5, 0x01, 0xa7, 0x01, 0xa9, 0x01, 0xab, 0x01, 0xe1, 0x01, + 0xe3, 0x01, 0xe5, 0x01, 0xe7, 0x01, 0xe9, 0x01, 0xeb, 0x01, 0xed, 0x01, + 0xef, 0x01, 0xb2, 0x01, 0xb4, 0x01, 0xb6, 0x01, 0xb8, 0x01, 0xba, 0x01, + 0xf1, 0x01, 0xf3, 0x01, 0xf5, 0x01, 0xf7, 0x01, 0xf9, 0x01, 0xfb, 0x01, + 0xc0, 0x11, 0xc2, 0x11, 0xc4, 0x11, 0xc6, 0x11, 0xc8, 0x11, 0xca, 0x11, + 0xc1, 0x15, 0xc3, 0x15, 0xc5, 0x15, 0xc7, 0x15, 0xc9, 0x15, 0xcb, 0x15, + 0xc2, 0x19, 0xc4, 0x19, 0xc6, 0x19, 0xc8, 0x19, 0xca, 0x19, 0xcc, 0x19, + 0xd2, 0x19, 0xd4, 0x19, 0xd6, 0x19, 0xd8, 0x19, 0xda, 0x19, 0xdc, 0x19, + 0xd0, 0x1d, 0xd2, 0x1d, 0xd4, 0x1d, 0xd6, 0x1d, 0xd8, 0x1d, 0xda, 0x1d, + 0xda, 0x1d, 0xef, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x96, 0x00, 0xf1, 0x00, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x0e, + 0x0e, 0x10, 0x10, 0x10, 0x70, 0x17, 0x00, 0x00, 0xf2, 0x00, 0x84, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, + 0x11, 0x00, 0x01, 0x01, 0x71, 0x02, 0x00, 0x26, 0x61, 0x03, 0x01, 0x26, + 0x71, 0x02, 0x00, 0x27, 0x61, 0x03, 0x01, 0x27, 0x91, 0x04, 0x00, 0x00, + 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, + 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, + 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, + 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, + 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, + 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, + 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, + 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, + 0x91, 0x04, 0x00, 0x00, 0x91, 0x04, 0x00, 0x00, 0xf5, 0x00, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x05, 0x00, + 0x03, 0xc0, 0x06, 0x00, 0x07, 0xc0, 0x06, 0x00, 0x0b, 0xc0, 0x06, 0x00, + 0x0f, 0xc0, 0x06, 0x00, 0x17, 0xc0, 0x06, 0x00, 0x1f, 0xc0, 0x0a, 0x00, + 0x23, 0xc0, 0x0e, 0x00, 0x27, 0xc0, 0x12, 0x09, 0x2b, 0xc0, 0x9a, 0x11, + 0x33, 0xc0, 0x9e, 0x19, 0x01, 0xc1, 0x82, 0x24, 0x3f, 0xc0, 0xbe, 0x01, + 0x3b, 0xc0, 0x3a, 0x00, 0x03, 0x60, 0x04, 0x00, 0x03, 0xa0, 0x04, 0x00, + 0x03, 0x80, 0x05, 0x00, 0x03, 0xc0, 0x06, 0x00, 0x07, 0xc0, 0x06, 0x00, + 0x0b, 0xc0, 0x06, 0x00, 0x0f, 0xc0, 0x06, 0x00, 0x17, 0xc0, 0x06, 0x00, + 0x1f, 0xc0, 0x0a, 0x00, 0x23, 0xc0, 0x0e, 0x00, 0x27, 0xc0, 0x12, 0x09, + 0x2b, 0xc0, 0x9a, 0x11, 0x33, 0xc0, 0x9e, 0x19, 0x01, 0xc1, 0x82, 0x24, + 0x3f, 0xc0, 0xbe, 0x01, 0x3b, 0xc0, 0x3a, 0x00, 0x03, 0x60, 0x04, 0x00, + 0x03, 0xa0, 0x04, 0x00, 0xf6, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x03, 0x09, 0xfe, 0x00, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0f, 0x0f, + 0x10, 0x00 +}; +unsigned int nvm_usb_00190200_bin_len = 9470; diff --git a/QualcommWireless/Firmware_WCN7850_Wifi.h b/QualcommWireless/Firmware_WCN7850_Wifi.h new file mode 100644 index 0000000..d8c86b4 --- /dev/null +++ b/QualcommWireless/Firmware_WCN7850_Wifi.h @@ -0,0 +1,36 @@ +#ifndef _FIRMWARE_WCN7850_WIFI_H +#define _FIRMWARE_WCN7850_WIFI_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern const uint8_t wcn7850_amss_bin[]; +extern const uint8_t wcn7850_amss_bin_end[]; + +extern const uint8_t wcn7850_board2_bin[]; +extern const uint8_t wcn7850_board2_bin_end[]; + +extern const uint8_t wcn7850_m3_bin[]; +extern const uint8_t wcn7850_m3_bin_end[]; + +static inline size_t get_wcn7850_amss_size(void) { + return (size_t)(wcn7850_amss_bin_end - wcn7850_amss_bin); +} + +static inline size_t get_wcn7850_board2_size(void) { + return (size_t)(wcn7850_board2_bin_end - wcn7850_board2_bin); +} + +static inline size_t get_wcn7850_m3_size(void) { + return (size_t)(wcn7850_m3_bin_end - wcn7850_m3_bin); +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/QualcommWireless/Firmware_WCN7850_Wifi.s b/QualcommWireless/Firmware_WCN7850_Wifi.s new file mode 100644 index 0000000..595de1d --- /dev/null +++ b/QualcommWireless/Firmware_WCN7850_Wifi.s @@ -0,0 +1,18 @@ +.section __TEXT,__const +.globl _wcn7850_amss_bin +.globl _wcn7850_amss_bin_end +_wcn7850_amss_bin: + .incbin "/Users/erwan/Documents/QualcommWireless/firmware/amss.bin" +_wcn7850_amss_bin_end: + +.globl _wcn7850_board2_bin +.globl _wcn7850_board2_bin_end +_wcn7850_board2_bin: + .incbin "/Users/erwan/Documents/QualcommWireless/firmware/board-2.bin" +_wcn7850_board2_bin_end: + +.globl _wcn7850_m3_bin +.globl _wcn7850_m3_bin_end +_wcn7850_m3_bin: + .incbin "/Users/erwan/Documents/QualcommWireless/firmware/m3.bin" +_wcn7850_m3_bin_end: diff --git a/QualcommWireless/Info.plist b/QualcommWireless/Info.plist new file mode 100644 index 0000000..6c437f8 --- /dev/null +++ b/QualcommWireless/Info.plist @@ -0,0 +1,84 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + KEXT + CFBundleShortVersionString + 1.0.2 + CFBundleVersion + 1.0.2 + IOKitPersonalities + + QualcommWireless_BT + + CFBundleIdentifier + com.nawrhehe.QualcommWireless + IOClass + QualcommWireless + IOMatchCategory + QualcommWireless + IOProviderClass + IOUSBHostDevice + idVendor + 1161 + idProduct + 57613 + IOProbeScore + 5000 + + QualcommWireless_WiFi + + CFBundleIdentifier + com.nawrhehe.QualcommWireless + IOClass + QualcommWifi + IOMatchCategory + IODefaultMatchCategory + IONameMatch + pci17cb,1107 + IOPCIPrimaryMatch + 0x110717cb + IOProbeScore + 20000 + IOProviderClass + IOPCIDevice + + + OSBundleLibraries + + com.apple.kpi.libkern + 15.0 + com.apple.kpi.iokit + 15.0 + com.apple.kpi.mach + 15.0 + com.apple.iokit.IOUSBHostFamily + 1.2 + com.apple.iokit.IOPCIFamily + 2.9 + com.apple.iokit.IONetworkingFamily + 3.2 + com.apple.iokit.IO80211Family + 1200.12.2b1 + com.apple.iokit.IOSkywalkFamily + 1.0 + com.apple.driver.corecapture + 1.0.0 + com.apple.kpi.bsd + 15.0 + + OSBundleRequired + Root + + diff --git a/QualcommWireless/QualcommWifi.cpp b/QualcommWireless/QualcommWifi.cpp new file mode 100644 index 0000000..57f544d --- /dev/null +++ b/QualcommWireless/QualcommWifi.cpp @@ -0,0 +1,918 @@ +#include "QualcommWifi.hpp" +#include +#include +#include +#include + +#define super IO80211Controller +OSDefineMetaClassAndStructors(QualcommWifi, IO80211Controller) + +bool QualcommWifi::init(OSDictionary *dictionary) { + if (!super::init(dictionary)) { + return false; + } + fPciDevice = nullptr; + fBar0Map = nullptr; + fBar0Virt = nullptr; + fCurrWindow = 0xFFFFFFFF; + fInterruptSource = nullptr; + fNetif = nullptr; + bzero(&fMacAddress, sizeof(fMacAddress)); + fLinkActive = false; + fCurrentChannel = 1; + fLastRssi = -50; + fSsidLen = 0; + bzero(fSsid, sizeof(fSsid)); + bzero(fBssid, sizeof(fBssid)); + fScanInProgress = false; + fDmaBuf = nullptr; + fDmaPhysAddr = 0; + fDmaVirtAddr = nullptr; + fDmaPrepared = false; + return true; +} + +void QualcommWifi::free(void) { + super::free(); +} + +IOService *QualcommWifi::probe(IOService *provider, SInt32 *score) { + return super::probe(provider, score); +} + +UInt32 QualcommWifi::read32(UInt32 offset) { + if (!fBar0Virt || offset >= 0x200000) { + return 0xFFFFFFFF; + } + return OSReadLittleInt32(fBar0Virt, offset); +} + +void QualcommWifi::write32(UInt32 offset, UInt32 value) { + if (!fBar0Virt || offset >= 0x200000) { + return; + } + OSWriteLittleInt32(fBar0Virt, offset, value); +} + +void QualcommWifi::selectWindow(UInt32 offset) { + UInt32 window = (offset >> ATH12K_PCI_WINDOW_SHIFT) & ATH12K_PCI_WINDOW_VALUE_MASK; + if (window != fCurrWindow) { + write32(ATH12K_PCI_WINDOW_REG_ADDRESS, ATH12K_PCI_WINDOW_ENABLE_BIT | window); + (void)read32(ATH12K_PCI_WINDOW_REG_ADDRESS); + fCurrWindow = window; + } +} + +UInt32 QualcommWifi::socRead32(UInt32 offset) { + if (offset < ATH12K_PCI_WINDOW_START) { + return read32(offset); + } + selectWindow(offset); + return read32(ATH12K_PCI_WINDOW_START + (offset & ATH12K_PCI_WINDOW_RANGE_MASK)); +} + +void QualcommWifi::socWrite32(UInt32 offset, UInt32 value) { + if (offset < ATH12K_PCI_WINDOW_START) { + write32(offset, value); + return; + } + selectWindow(offset); + write32(ATH12K_PCI_WINDOW_START + (offset & ATH12K_PCI_WINDOW_RANGE_MASK), value); +} + +// Équivalent de dma_alloc_coherent() avec DMA_BIT_MASK(36) sous Linux +bool QualcommWifi::allocDmaContext(IOByteCount size) { + fDmaBuf = IOBufferMemoryDescriptor::inTaskWithPhysicalMask( + kernel_task, + static_cast(kIODirectionInOut) | static_cast(kIOMemoryPhysicallyContiguous), + size, + ATH12K_DMA_MASK_36BIT_PAGE + ); + + if (!fDmaBuf) { + IOLog("QualcommWifi: Erreur - Impossible d'allouer le descripteur DMA 36-bit.\n"); + return false; + } + + if (fDmaBuf->prepare(kIODirectionInOut) != kIOReturnSuccess) { + IOLog("QualcommWifi: Erreur - Impossible de verrouiller (prepare) les pages DMA.\n"); + OSSafeReleaseNULL(fDmaBuf); + return false; + } + fDmaPrepared = true; + + fDmaVirtAddr = fDmaBuf->getBytesNoCopy(); + IOByteCount segLen = 0; + fDmaPhysAddr = fDmaBuf->getPhysicalSegment(0, &segLen); + + if (!fDmaVirtAddr || !fDmaPhysAddr || segLen < size) { + IOLog("QualcommWifi: Erreur - Segment physique DMA invalide (segLen=%llu).\n", (uint64_t)segLen); + freeDmaContext(); + return false; + } + + // Remise à zéro de la zone DMA (comme kzalloc / dma_alloc_coherent) + bzero(fDmaVirtAddr, size); + + IOLog("QualcommWifi: Tampon DMA 36-bit pret ! Phys: 0x%llx, Taille: %llu octets (Contigu: %llu)\n", + (uint64_t)fDmaPhysAddr, (uint64_t)size, (uint64_t)segLen); + return true; +} + +void QualcommWifi::freeDmaContext(void) { + if (fDmaBuf) { + if (fDmaPrepared) { + fDmaBuf->complete(kIODirectionInOut); + fDmaPrepared = false; + } + OSSafeReleaseNULL(fDmaBuf); + } + fDmaVirtAddr = nullptr; + fDmaPhysAddr = 0; +} + +void QualcommWifi::interruptOccurred(OSObject *owner, IOInterruptEventSource *src, int count) { + IOLog("QualcommWifi: Interruption materielle MSI recue (count=%d) !\n", count); +} + +bool QualcommWifi::loadBhiFirmware(void) { + if (!fBar0Virt || !fPciDevice) { + return false; + } + + UInt32 bhiOff = read32(ATH12K_MHI_BHIOFF); + UInt32 bhieOff = read32(ATH12K_MHI_BHIEOFF); + if (bhiOff == 0xFFFFFFFF || bhiOff >= 0x200000 || bhieOff == 0xFFFFFFFF || bhieOff >= 0x200000) { + IOLog("QualcommWifi: Erreur - BHI/BHIe Offsets invalides (BHI: 0x%08x, BHIe: 0x%08x)\n", bhiOff, bhieOff); + setProperty("BHI_Load_Error", "Invalid_Offsets"); + return false; + } + + // Désactivation d'ASPM PCIe pour stabiliser le transfert firmware (recommandation ath12k) + UInt8 pciCapOffset = 0; + if (fPciDevice->findPCICapability(kIOPCIPCIExpressCapability, &pciCapOffset) && pciCapOffset != 0) { + UInt16 linkCtrl = fPciDevice->configRead16(pciCapOffset + 0x10); + linkCtrl &= ~0x3; // Désactive ASPM L0s / L1 + fPciDevice->configWrite16(pciCapOffset + 0x10, linkCtrl); + IOLog("QualcommWifi: ASPM PCIe désactivé pour stabilité du transfert firmware (LinkCtrl: 0x%04x)\n", linkCtrl); + } + + // Étape 1 : Réinitialisation MHI et effacement des vecteurs BHIe (ath12k_mhi_clear_vector) + write32(bhieOff + ATH12K_BHIE_TXVECDB, 0); + write32(bhieOff + ATH12K_BHIE_TXVECSTATUS, 0); + write32(bhieOff + ATH12K_BHIE_RXVECDB, 0); + write32(bhieOff + ATH12K_BHIE_RXVECSTATUS, 0); + + write32(ATH12K_MHI_MHICTRL, ATH12K_MHICTRL_RESET_MASK); // MHICTRL_RESET + IODelay(10000); // 10 ms + + size_t fwSize = get_wcn7850_amss_size(); + size_t sblSize = 0x80000; // 512 Ko pour le Secondary Boot Loader (SBL) + if (fwSize < sblSize) { + IOLog("QualcommWifi: Erreur - Taille AMSS trop petite (%lu < 512 Ko)\n", fwSize); + return false; + } + + IOLog("QualcommWifi: Initialisation du chargeur FBC 2-étapes (SBL: 512 Ko, Image totale: %lu octets)...\n", fwSize); + + // Étape 2 : Allocation DMA contigu pour l'image AMSS complète + IOBufferMemoryDescriptor *fwDma = IOBufferMemoryDescriptor::inTaskWithPhysicalMask( + kernel_task, + static_cast(kIODirectionInOut) | static_cast(kIOMemoryPhysicallyContiguous), + fwSize, + ATH12K_DMA_MASK_36BIT_PAGE + ); + + if (!fwDma || fwDma->prepare(kIODirectionInOut) != kIOReturnSuccess) { + IOLog("QualcommWifi: Erreur - Echec allocation/prepare DMA AMSS\n"); + setProperty("BHI_Load_Error", "DMA_Alloc_Failed"); + if (fwDma) OSSafeReleaseNULL(fwDma); + return false; + } + + void *virt = fwDma->getBytesNoCopy(); + IOByteCount segLen = 0; + IOPhysicalAddress phys = fwDma->getPhysicalSegment(0, &segLen); + + if (!virt || !phys || segLen < fwSize) { + IOLog("QualcommWifi: Erreur - Segment DMA AMSS incomplet\n"); + fwDma->complete(kIODirectionInOut); + OSSafeReleaseNULL(fwDma); + return false; + } + + memcpy(virt, wcn7850_amss_bin, fwSize); + setProperty("AMSS_DMA_Phys", (uint64_t)phys, 64); + + // Étape 3 : Chargement du SBL (512 Ko) via BHI en mode PBL + write32(bhiOff + ATH12K_BHI_STATUS, 0); + write32(bhiOff + ATH12K_BHI_IMGADDR_LOW, (UInt32)(phys & 0xFFFFFFFF)); + write32(bhiOff + ATH12K_BHI_IMGADDR_HIGH, (UInt32)((phys >> 32) & 0xFFFFFFFF)); + write32(bhiOff + ATH12K_BHI_IMGSIZE, (UInt32)sblSize); + + // Déclenchement de la sonnette PBL avec Session ID = 1 (NON-NUL exigé par PBL) + write32(bhiOff + ATH12K_BHI_IMGTXDB, 0x1); + IOLog("QualcommWifi: Sonnette BHI_IMGTXDB déclenchée (Session ID = 1, SBL 512 Ko)...\n"); + + UInt32 bhiStatus = 0; + UInt32 timeoutMs = 3000; + bool sblSuccess = false; + + while (timeoutMs > 0) { + bhiStatus = read32(bhiOff + ATH12K_BHI_STATUS); + UInt32 state = (bhiStatus & ATH12K_BHI_STATUS_MASK) >> ATH12K_BHI_STATUS_SHIFT; + if (state == ATH12K_BHI_STATUS_SUCCESS) { + sblSuccess = true; + break; + } else if (state == ATH12K_BHI_STATUS_ERROR) { + UInt32 err = read32(bhiOff + ATH12K_BHI_ERRCODE); + IOLog("QualcommWifi: Erreur BHI SBL (code=0x%08x)\n", err); + setProperty("BHI_ErrorCode", err, 32); + break; + } + IODelay(1000); // 1 ms + timeoutMs--; + } + + setProperty("BHI_FinalStatus", bhiStatus, 32); + setProperty("BHI_Status_Raw", bhiStatus, 32); + setProperty("BHI_Status_State", (bhiStatus & ATH12K_BHI_STATUS_MASK) >> ATH12K_BHI_STATUS_SHIFT, 32); + + // Attente de l'exécution du SBL (BHI_EXECENV == 1) et de la disponibilité MHI (READY) + timeoutMs = 2000; + UInt32 ee = 0; + while (timeoutMs > 0) { + ee = read32(bhiOff + ATH12K_BHI_EXECENV); + UInt32 mhiStat = read32(ATH12K_MHI_MHISTATUS); + if (ee == ATH12K_MHI_EE_SBL || ee == ATH12K_MHI_EE_AMSS || (mhiStat & ATH12K_MHISTATUS_READY_MASK)) { + break; + } + IODelay(1000); + timeoutMs--; + } + + setProperty("BHI_ExecEnv_AfterLoad", ee, 32); + setProperty("MHI_Status_After_SBL", read32(ATH12K_MHI_MHISTATUS), 32); + setProperty("MHI_Ctrl_After_SBL", read32(ATH12K_MHI_MHICTRL), 32); + IOLog("QualcommWifi: SBL BHI terminé (Status=0x%08x, State=%u, ExecEnv=0x%x, SBL_Succes=%d)\n", + bhiStatus, (bhiStatus & ATH12K_BHI_STATUS_MASK) >> ATH12K_BHI_STATUS_SHIFT, ee, sblSuccess); + + // Étape 4 : Configuration des contextes MHI MMIO et transition vers M0 (mhi_ready_state_transition selon Linux ath12k) + bool inM0 = false; + bool amssSuccess = false; + uint32_t processedEvents = 0; + + if (sblSuccess && fDmaPhysAddr != 0) { + // Attente de la confirmation READY dans MHISTATUS + timeoutMs = 3000; + while (timeoutMs > 0) { + UInt32 mstat = read32(ATH12K_MHI_MHISTATUS); + if (mstat & ATH12K_MHISTATUS_READY_MASK) { + break; + } + IODelay(1000); + timeoutMs--; + } + + uint64_t chan_ctxt_phys = fDmaPhysAddr + 0x0000; + uint64_t er_ctxt_phys = fDmaPhysAddr + 0x1000; + uint64_t cmd_ctxt_phys = fDmaPhysAddr + 0x2000; + uint64_t cmd_ring_phys = fDmaPhysAddr + 0x3000; + uint64_t er0_ring_phys = fDmaPhysAddr + 0x4000; + uint64_t er1_ring_phys = fDmaPhysAddr + 0x5000; + + uint32_t cmd_ring_len = 64 * sizeof(struct mhi_ring_element); // 1024 octets (64 TREs) + uint32_t er0_ring_len = 32 * sizeof(struct mhi_ring_element); // 512 octets (32 TREs) selon ath12k WCN7850 + uint32_t er1_ring_len = 256 * sizeof(struct mhi_ring_element); // 4096 octets (256 TREs) + + // 1. Initialisation des 64 contextes de canaux (désactivés au départ) + struct mhi_chan_ctxt *chan_ctxt = (struct mhi_chan_ctxt *)((uint8_t *)fDmaVirtAddr + 0x0000); + bzero(chan_ctxt, 64 * sizeof(struct mhi_chan_ctxt)); + + // 2. Initialisation du contexte d'anneau de commandes + struct mhi_cmd_ctxt *cmd_ctxt = (struct mhi_cmd_ctxt *)((uint8_t *)fDmaVirtAddr + 0x2000); + bzero(cmd_ctxt, sizeof(struct mhi_cmd_ctxt)); + cmd_ctxt[0].rbase = OSSwapHostToLittleInt64(cmd_ring_phys); + cmd_ctxt[0].rlen = OSSwapHostToLittleInt64(cmd_ring_len); + cmd_ctxt[0].rp = OSSwapHostToLittleInt64(cmd_ring_phys); + cmd_ctxt[0].wp = OSSwapHostToLittleInt64(cmd_ring_phys); + + // 3. Initialisation des contextes d'anneau d'événements (2 anneaux selon WCN7850 ath12k) + struct mhi_event_ctxt *evCtxt = (struct mhi_event_ctxt *)((uint8_t *)fDmaVirtAddr + 0x1000); + bzero(evCtxt, 2 * sizeof(struct mhi_event_ctxt)); + + // Event Ring 0: CTRL ring, 32 TREs + evCtxt[0].intmod = 0; + evCtxt[0].ertype = OSSwapHostToLittleInt32(1); // MHI_ER_TYPE_VALID + evCtxt[0].msivec = 0; + evCtxt[0].rbase = OSSwapHostToLittleInt64(er0_ring_phys); + evCtxt[0].rlen = OSSwapHostToLittleInt64(er0_ring_len); + evCtxt[0].rp = OSSwapHostToLittleInt64(er0_ring_phys); + evCtxt[0].wp = OSSwapHostToLittleInt64(er0_ring_phys); + + // Event Ring 1: DATA ring, 256 TREs + evCtxt[1].intmod = OSSwapHostToLittleInt32(1); + evCtxt[1].ertype = OSSwapHostToLittleInt32(1); // MHI_ER_TYPE_VALID + evCtxt[1].msivec = 0; + evCtxt[1].rbase = OSSwapHostToLittleInt64(er1_ring_phys); + evCtxt[1].rlen = OSSwapHostToLittleInt64(er1_ring_len); + evCtxt[1].rp = OSSwapHostToLittleInt64(er1_ring_phys); + evCtxt[1].wp = OSSwapHostToLittleInt64(er1_ring_phys); + + bzero((uint8_t *)fDmaVirtAddr + 0x3000, cmd_ring_len); + bzero((uint8_t *)fDmaVirtAddr + 0x4000, er0_ring_len); + bzero((uint8_t *)fDmaVirtAddr + 0x5000, er1_ring_len); + + // 4. Programmation des registres MMIO MHI + write32(ATH12K_MHI_CCABAP_HIGHER, (UInt32)((chan_ctxt_phys >> 32) & 0xFFFFFFFF)); + write32(ATH12K_MHI_CCABAP_LOWER, (UInt32)(chan_ctxt_phys & 0xFFFFFFFF)); + write32(ATH12K_MHI_ECABAP_HIGHER, (UInt32)((er_ctxt_phys >> 32) & 0xFFFFFFFF)); + write32(ATH12K_MHI_ECABAP_LOWER, (UInt32)(er_ctxt_phys & 0xFFFFFFFF)); + write32(ATH12K_MHI_CRCBAP_HIGHER, (UInt32)((cmd_ctxt_phys >> 32) & 0xFFFFFFFF)); + write32(ATH12K_MHI_CRCBAP_LOWER, (UInt32)(cmd_ctxt_phys & 0xFFFFFFFF)); + + // MHICFG (0x10): total_ev_rings = 2, hw_ev_rings = 0 (tous logiciels pour WCN7850) + write32(ATH12K_MHI_MHICFG, (2 << 16) | (0 << 24)); + + write32(ATH12K_MHI_MHICTRLBASE_HIGHER, 0); + write32(ATH12K_MHI_MHICTRLBASE_LOWER, 0); + write32(ATH12K_MHI_MHIDATABASE_HIGHER, 0); + write32(ATH12K_MHI_MHIDATABASE_LOWER, 0); + + write32(ATH12K_MHI_MHICTRLLIMIT_HIGHER, 0x0F); + write32(ATH12K_MHI_MHICTRLLIMIT_LOWER, 0xFFFFFFFF); + write32(ATH12K_MHI_MHIDATALIMIT_HIGHER, 0x0F); + write32(ATH12K_MHI_MHIDATALIMIT_LOWER, 0xFFFFFFFF); + + // 5. Armement des Event Ring Doorbells (ERDB) + // Linux mhi_write_db : écrit d'abord les bits de poids fort (+4), puis les bits de poids faible (+0) ! + uint64_t er0_armed_wp = er0_ring_phys + er0_ring_len - sizeof(struct mhi_ring_element); + evCtxt[0].wp = OSSwapHostToLittleInt64(er0_armed_wp); + + uint64_t er1_armed_wp = er1_ring_phys + er1_ring_len - sizeof(struct mhi_ring_element); + evCtxt[1].wp = OSSwapHostToLittleInt64(er1_armed_wp); + + UInt32 erdbOff = read32(ATH12K_MHI_ERDBOFF); + if (erdbOff != 0 && erdbOff < 0x200000) { + // Sonnette ER0 (erdbOff + 0) + write32(erdbOff + 4, (UInt32)((er0_armed_wp >> 32) & 0xFFFFFFFF)); + write32(erdbOff + 0, (UInt32)(er0_armed_wp & 0xFFFFFFFF)); + + // Sonnette ER1 (erdbOff + 8) + write32(erdbOff + 8 + 4, (UInt32)((er1_armed_wp >> 32) & 0xFFFFFFFF)); + write32(erdbOff + 8 + 0, (UInt32)(er1_armed_wp & 0xFFFFFFFF)); + + IOLog("QualcommWifi: Event Ring Doorbells armées (ER0 @ 0x%08x WP=0x%llx, ER1 @ 0x%08x WP=0x%llx) !\n", + erdbOff, er0_armed_wp, erdbOff + 8, er1_armed_wp); + setProperty("ERDB_Offset", erdbOff, 32); + } + + // 6. Bascule vers l'état M0 + UInt32 mhiCtrlVal = read32(ATH12K_MHI_MHICTRL); + mhiCtrlVal &= ~ATH12K_MHICTRL_MHISTATE_MASK; + mhiCtrlVal |= (ATH12K_MHI_STATE_M0 << ATH12K_MHICTRL_MHISTATE_SHIFT); + write32(ATH12K_MHI_MHICTRL, mhiCtrlVal); + IOLog("QualcommWifi: Transition MHI vers M0 demandée (MHICTRL: 0x%08x)...\n", mhiCtrlVal); + } + + // Étape 5 : Téléversement FBC complet du firmware via BHIe (mhi_download_amss_image sous SBL actif) + const size_t segSize = 0x80000; // Segments de 512 Ko (SZ_512K exigé par ath12k) + int numVecEntries = (int)((fwSize + segSize - 1) / segSize); // 12 segments pour l'image complète + + IOBufferMemoryDescriptor *vecDma = IOBufferMemoryDescriptor::inTaskWithPhysicalMask( + kernel_task, + static_cast(kIODirectionInOut) | static_cast(kIOMemoryPhysicallyContiguous), + numVecEntries * sizeof(struct bhi_vec_entry), + ATH12K_DMA_MASK_36BIT_PAGE + ); + + if (vecDma) { + if (vecDma->prepare(kIODirectionInOut) == kIOReturnSuccess) { + struct bhi_vec_entry *vecTable = (struct bhi_vec_entry *)vecDma->getBytesNoCopy(); + IOByteCount vecLen = 0; + IOPhysicalAddress vecPhys = vecDma->getPhysicalSegment(0, &vecLen); + + if (vecTable && vecPhys) { + size_t curRem = fwSize; + + for (int i = 0; i < numVecEntries; i++) { + size_t chunk = (curRem > segSize) ? segSize : curRem; + vecTable[i].dma_addr = OSSwapHostToLittleInt64((uint64_t)phys + (uint64_t)i * segSize); + vecTable[i].size = OSSwapHostToLittleInt64(chunk); + curRem -= chunk; + } + + IOLog("QualcommWifi: Table vectorielle BHIe FBC prête (%d segments, Phys: 0x%llx). Programmation BHIe...\n", + numVecEntries, (uint64_t)vecPhys); + + write32(bhieOff + ATH12K_BHIE_TXVECADDR_LOW, (UInt32)(vecPhys & 0xFFFFFFFF)); + write32(bhieOff + ATH12K_BHIE_TXVECADDR_HIGH, (UInt32)((vecPhys >> 32) & 0xFFFFFFFF)); + write32(bhieOff + ATH12K_BHIE_TXVECSIZE, (UInt32)(numVecEntries * sizeof(struct bhi_vec_entry))); + write32(bhieOff + ATH12K_BHIE_TXVECSTATUS, 0); + + // Sonnette BHIe avec Sequence ID = 1 + write32(bhieOff + ATH12K_BHIE_TXVECDB, 0x1); + + UInt32 bhieStatus = 0; + timeoutMs = 10000; // 10 secondes pour le transfert DMA complet de 6 Mo + while (timeoutMs > 0) { + bhieStatus = read32(bhieOff + ATH12K_BHIE_TXVECSTATUS); + UInt32 bhieState = (bhieStatus & ATH12K_BHIE_TXVECSTATUS_STATUS_MASK) >> ATH12K_BHIE_TXVECSTATUS_STATUS_SHIFT; + if (bhieState == ATH12K_BHIE_TXVECSTATUS_XFER_COMPL) { + amssSuccess = true; + break; + } + IODelay(1000); + timeoutMs--; + } + + setProperty("BHIE_FinalStatus", bhieStatus, 32); + setProperty("BHIE_Status_Raw", bhieStatus, 32); + setProperty("BHIE_Status_State", (bhieStatus & ATH12K_BHIE_TXVECSTATUS_STATUS_MASK) >> ATH12K_BHIE_TXVECSTATUS_STATUS_SHIFT, 32); + IOLog("QualcommWifi: BHIe DMA terminé (Status=0x%08x) ! Dépouillement des événements MHI...\n", bhieStatus); + + // Étape 6 : Dépouillement des événements MHI émis par SBL / AMSS sur l'anneau 0 + struct mhi_ring_element *erElements = (struct mhi_ring_element *)((uint8_t *)fDmaVirtAddr + 0x4000); + + timeoutMs = 5000; + while (timeoutMs > 0) { + UInt32 mstat = read32(ATH12K_MHI_MHISTATUS); + UInt32 mstate = (mstat & ATH12K_MHISTATUS_MHISTATE_MASK) >> ATH12K_MHISTATUS_MHISTATE_SHIFT; + + while (processedEvents < 32) { + struct mhi_ring_element *el = &erElements[processedEvents]; + UInt32 dw1 = OSSwapLittleToHostInt32(el->dword[1]); + UInt32 dw0 = OSSwapLittleToHostInt32(el->dword[0]); + if (dw1 == 0 && dw0 == 0) { + break; + } + + UInt8 evType = (dw1 >> 16) & 0xFF; + UInt8 evCode = (dw0 >> 24) & 0xFF; + IOLog("QualcommWifi: Événement MHI reçu #%u: Type=0x%02x, Code=0x%02x, PTR=0x%llx\n", + processedEvents, evType, evCode, OSSwapLittleToHostInt64(el->ptr)); + + char evKey[32]; + snprintf(evKey, sizeof(evKey), "MHI_Event_%u_Type", processedEvents); + setProperty(evKey, evType, 8); + snprintf(evKey, sizeof(evKey), "MHI_Event_%u_Code", processedEvents); + setProperty(evKey, evCode, 8); + snprintf(evKey, sizeof(evKey), "MHI_Event_%u_PTR", processedEvents); + setProperty(evKey, OSSwapLittleToHostInt64(el->ptr), 64); + + if (evType == ATH12K_MHI_PKT_TYPE_STATE_CHANGE_EVENT) { + IOLog("QualcommWifi: -> Notification changement d'état MHI: State=%u\n", evCode); + if (evCode == ATH12K_MHI_STATE_M0) { + inM0 = true; + } + } else if (evType == ATH12K_MHI_PKT_TYPE_EE_EVENT) { + IOLog("QualcommWifi: -> Notification environnement d'exécution (EE): 0x%x\n", evCode); + ee = evCode; + if (ee == ATH12K_MHI_EE_AMSS || ee == ATH12K_MHI_EE_WFW) { + amssSuccess = true; + } + } + processedEvents++; + } + + if (mstate == ATH12K_MHI_STATE_M0 || inM0 || ee == ATH12K_MHI_EE_AMSS || ee == ATH12K_MHI_EE_WFW) { + inM0 = true; + IOLog("QualcommWifi: MHI en mode Mission M0 (MHISTATUS: 0x%08x, EE: 0x%x) !\n", mstat, ee); + break; + } + + IODelay(1000); + timeoutMs--; + } + + setProperty("MHI_Events_Processed", processedEvents, 32); + setProperty("MHI_Status_In_M0", read32(ATH12K_MHI_MHISTATUS), 32); + setProperty("MHI_In_M0", inM0); + setProperty("BHI_ExecEnv_Final", ee, 32); + } + + vecDma->complete(kIODirectionInOut); + } + OSSafeReleaseNULL(vecDma); + } + + if (inM0 || ee == ATH12K_MHI_EE_AMSS || ee == ATH12K_MHI_EE_WFW) { + IOLog("QualcommWifi: SUCCÈS MAJEUR ! Firmware WCN7850 actif en mode Mission (ExecEnv=0x%x, M0=%d) !\n", ee, inM0); + setProperty("Driver_Status", "AMSS_Loaded_Success"); + } else if (sblSuccess) { + IOLog("QualcommWifi: SBL actif (ExecEnv=0x%x, BHIe=0x%x)\n", ee, read32(bhieOff + ATH12K_BHIE_TXVECSTATUS)); + setProperty("Driver_Status", "SBL_Loaded_Success"); + } else { + IOLog("QualcommWifi: Échec chargement complet (BHI=0x%x, ExecEnv=0x%x)\n", bhiStatus, ee); + setProperty("Driver_Status", "AMSS_Load_Timeout_Or_Error"); + } + + fwDma->complete(kIODirectionInOut); + OSSafeReleaseNULL(fwDma); + + return (sblSuccess || amssSuccess); +} + +bool QualcommWifi::start(IOService *provider) { + if (!super::start(provider)) { + return false; + } + + fPciDevice = OSDynamicCast(IOPCIDevice, provider); + if (!fPciDevice) { + return false; + } + fPciDevice->retain(); + + if (!fPciDevice->open(this)) { + OSSafeReleaseNULL(fPciDevice); + return false; + } + + UInt16 pciCommand = fPciDevice->configRead16(kIOPCIConfigCommand); + pciCommand |= (kIOPCICommandMemorySpace | kIOPCICommandBusMaster); + fPciDevice->configWrite16(kIOPCIConfigCommand, pciCommand); + + fBar0Map = fPciDevice->mapDeviceMemoryWithRegister(kIOPCIConfigBaseAddress0); + if (!fBar0Map) { + fPciDevice->close(this); + OSSafeReleaseNULL(fPciDevice); + return false; + } + fBar0Virt = (volatile void *)fBar0Map->getVirtualAddress(); + + UInt32 socHwVer = socRead32(TCSR_SOC_HW_VERSION); + UInt32 major = (socHwVer & TCSR_SOC_HW_VERSION_MAJOR_MASK) >> TCSR_SOC_HW_VERSION_MAJOR_SHIFT; + UInt32 minor = (socHwVer & TCSR_SOC_HW_VERSION_MINOR_MASK); + IOLog("QualcommWifi: WCN7850 HW v%u.%u detecte (0x%08x)\n", major, minor, socHwVer); + + setProperty("SoC_Version", socHwVer, 32); + setProperty("SoC_Major", major, 32); + setProperty("SoC_Minor", minor, 32); + + // Lecture des registres de contrôle MHI et pointeurs BHI + UInt32 mhiStatus = read32(ATH12K_MHI_MHISTATUS); + UInt32 mhiCtrl = read32(ATH12K_MHI_MHICTRL); + UInt32 bhiOff = read32(ATH12K_MHI_BHIOFF); + UInt32 bhieOff = read32(ATH12K_MHI_BHIEOFF); + IOLog("QualcommWifi: MHI STATUS=0x%08x, CTRL=0x%08x, BHIOFF=0x%08x, BHIEOFF=0x%08x\n", + mhiStatus, mhiCtrl, bhiOff, bhieOff); + + setProperty("MHI_Status", mhiStatus, 32); + setProperty("MHI_Ctrl", mhiCtrl, 32); + setProperty("BHI_Offset", bhiOff, 32); + setProperty("BHIE_Offset", bhieOff, 32); + + if (bhiOff != 0xFFFFFFFF && bhiOff < 0x200000) { + UInt32 bhiMajor = read32(bhiOff + ATH12K_BHI_BHIVERSION_MAJOR); + UInt32 bhiMinor = read32(bhiOff + ATH12K_BHI_BHIVERSION_MINOR); + UInt32 bhiEe = read32(bhiOff + ATH12K_BHI_EXECENV); + UInt32 bhiStat = read32(bhiOff + ATH12K_BHI_STATUS); + UInt32 bhiSerial = read32(bhiOff + ATH12K_BHI_SERIALNU); + IOLog("QualcommWifi: BHI v%u.%u: ExecEnv=0x%x, Status=0x%x, Serial=0x%08x\n", + bhiMajor, bhiMinor, bhiEe, bhiStat, bhiSerial); + + setProperty("BHI_Major", bhiMajor, 32); + setProperty("BHI_Minor", bhiMinor, 32); + setProperty("BHI_ExecEnv", bhiEe, 32); + setProperty("BHI_Status", bhiStat, 32); + setProperty("BHI_Serial", bhiSerial, 32); + } + + // Allocation du tampon DMA 36-bit pour les anneaux MHI / BHI + if (!allocDmaContext(ATH12K_DMA_TEST_RING_SIZE)) { + OSSafeReleaseNULL(fBar0Map); + fPciDevice->close(this); + OSSafeReleaseNULL(fPciDevice); + return false; + } + + setProperty("DMA_PhysAddr", (uint64_t)fDmaPhysAddr, 64); + setProperty("Driver_Status", "Hardware_Initialized"); + + int msiIndex = -1; + for (int i = 0; ; i++) { + int intrType = 0; + if (fPciDevice->getInterruptType(i, &intrType) != kIOReturnSuccess) { + break; + } + if (intrType & kIOInterruptTypePCIMessaged) { + msiIndex = i; + break; + } + } + + IOWorkLoop *workLoop = getWorkLoop(); + if (msiIndex >= 0 && workLoop) { + fInterruptSource = IOInterruptEventSource::interruptEventSource( + this, &QualcommWifi::interruptOccurred, fPciDevice, msiIndex); + if (fInterruptSource && workLoop->addEventSource(fInterruptSource) == kIOReturnSuccess) { + fInterruptSource->enable(); + IOLog("QualcommWifi: MSI index %d actif.\n", msiIndex); + } + } + + // Chargement du firmware radio AMSS via le protocole BHI + (void)loadBhiFirmware(); + + // Configuration de l'adresse MAC (OUI Qualcomm 00:03:7F + BHI serial) + UInt32 bhiSerial = read32(bhiOff + ATH12K_BHI_SERIALNU); + fMacAddress.bytes[0] = 0x00; + fMacAddress.bytes[1] = 0x03; + fMacAddress.bytes[2] = 0x7F; + fMacAddress.bytes[3] = (bhiSerial >> 16) & 0xFF; + fMacAddress.bytes[4] = (bhiSerial >> 8) & 0xFF; + fMacAddress.bytes[5] = (bhiSerial) & 0xFF; + + IOLog("QualcommWifi: Adresse MAC physique : %02x:%02x:%02x:%02x:%02x:%02x\n", + fMacAddress.bytes[0], fMacAddress.bytes[1], fMacAddress.bytes[2], + fMacAddress.bytes[3], fMacAddress.bytes[4], fMacAddress.bytes[5]); + + // Configuration des propriétés Wi-Fi AirPort pour macOS et airportd + setProperty("IO80211AirPort", true); + setProperty("AirPort", true); + setProperty("IO80211Locale", "ETSI"); + setProperty("IO80211CountryCode", "FR"); + setProperty("IO80211ScanCache", true); + setProperty("IO80211RadioState", (UInt64)1, 32); + + // Configuration et publication des médias supportés (Auto / 1Gbps) + OSDictionary *mediumDict = OSDictionary::withCapacity(1); + if (mediumDict) { + IONetworkMedium *medium = IONetworkMedium::medium(kIOMediumEthernetAuto, 1000000000ULL); + if (medium) { + IONetworkMedium::addMedium(mediumDict, medium); + publishMediumDictionary(mediumDict); + setSelectedMedium(medium); + medium->release(); + } + mediumDict->release(); + } + + // Attachement de l'interface Wi-Fi native (IO80211Interface) + if (attachInterface((IONetworkInterface **)&fNetif, true)) { + IOLog("QualcommWifi: Interface Wi-Fi native (IO80211Interface) attachee avec succes !\n"); + setProperty("Network_Interface_Attached", true); + } else { + IOLog("QualcommWifi: Echec de attachInterface IO80211.\n"); + setProperty("Network_Interface_Attached", false); + } + + registerService(); + return true; +} + +void QualcommWifi::stop(IOService *provider) { + IOLog("QualcommWifi: Arret du pilote, liberation interface reseau, MSI, DMA et BAR0.\n"); + + if (fNetif) { + detachInterface(fNetif); + OSSafeReleaseNULL(fNetif); + } + + IOWorkLoop *workLoop = getWorkLoop(); + if (fInterruptSource) { + fInterruptSource->disable(); + if (workLoop) { + workLoop->removeEventSource(fInterruptSource); + } + OSSafeReleaseNULL(fInterruptSource); + } + + // Déverrouillage et libération du tampon DMA avant la fermeture PCIe + freeDmaContext(); + + fBar0Virt = nullptr; + if (fBar0Map) { + OSSafeReleaseNULL(fBar0Map); + } + + if (fPciDevice) { + fPciDevice->close(this); + OSSafeReleaseNULL(fPciDevice); + } + + super::stop(provider); +} + +IOReturn QualcommWifi::getHardwareAddress(IOEthernetAddress *addrP) { + if (!addrP) return kIOReturnBadArgument; + bcopy(&fMacAddress, addrP, sizeof(IOEthernetAddress)); + return kIOReturnSuccess; +} + +IOReturn QualcommWifi::enable(IONetworkInterface *netif) { + IOLog("QualcommWifi: Interface reseau activee par macOS.\n"); + const IONetworkMedium *medium = getSelectedMedium(); + setLinkStatus(kIONetworkLinkValid | kIONetworkLinkActive, medium); + return kIOReturnSuccess; +} + +IOReturn QualcommWifi::disable(IONetworkInterface *netif) { + IOLog("QualcommWifi: Interface reseau desactivee par macOS.\n"); + setLinkStatus(kIONetworkLinkValid, nullptr); + return kIOReturnSuccess; +} + +UInt32 QualcommWifi::outputPacket(mbuf_t m, void *param) { + if (m) { + freePacket(m); + } + return kIOReturnOutputDropped; +} + +SInt32 QualcommWifi::apple80211Request(unsigned int req_type, int req_val, IO80211Interface* iface, void* req_data) { + switch (req_type) { + case APPLE80211_IOC_CARD_CAPABILITIES: { + apple80211_capability_data *cap = (apple80211_capability_data *)req_data; + if (cap) { + bzero(cap, sizeof(*cap)); + cap->version = APPLE80211_VERSION; + #define SET_CAP(c) (cap->capabilities[(c) / 8] |= (1 << ((c) % 8))) + SET_CAP(APPLE80211_CAP_WEP); + SET_CAP(APPLE80211_CAP_TKIP); + SET_CAP(APPLE80211_CAP_AES_CCM); + SET_CAP(APPLE80211_CAP_WPA1); + SET_CAP(APPLE80211_CAP_WPA2); + SET_CAP(APPLE80211_CAP_WPA); + SET_CAP(APPLE80211_CAP_SHORT_GI_20MHZ); + SET_CAP(APPLE80211_CAP_SHORT_GI_40MHZ); + #undef SET_CAP + return 0; + } + break; + } + case APPLE80211_IOC_STATE: { + apple80211_state_data *state = (apple80211_state_data *)req_data; + if (state) { + state->version = APPLE80211_VERSION; + state->state = fLinkActive ? APPLE80211_S_RUN : APPLE80211_S_INIT; + return 0; + } + break; + } + case APPLE80211_IOC_PHY_MODE: { + apple80211_phymode_data *pm = (apple80211_phymode_data *)req_data; + if (pm) { + pm->version = APPLE80211_VERSION; + pm->phy_mode = APPLE80211_MODE_11AX; + pm->active_phy_mode = APPLE80211_MODE_11AX; + return 0; + } + break; + } + case APPLE80211_IOC_OP_MODE: { + apple80211_opmode_data *om = (apple80211_opmode_data *)req_data; + if (om) { + om->version = APPLE80211_VERSION; + om->op_mode = APPLE80211_M_STA; + return 0; + } + break; + } + case APPLE80211_IOC_CHANNEL: { + apple80211_channel_data *cd = (apple80211_channel_data *)req_data; + if (cd) { + cd->version = APPLE80211_VERSION; + cd->channel.version = APPLE80211_VERSION; + cd->channel.channel = fCurrentChannel > 0 ? fCurrentChannel : 1; + cd->channel.flags = APPLE80211_C_FLAG_2GHZ | APPLE80211_C_FLAG_20MHZ; + return 0; + } + break; + } + case APPLE80211_IOC_RSSI: { + apple80211_rssi_data *rd = (apple80211_rssi_data *)req_data; + if (rd) { + rd->version = APPLE80211_VERSION; + rd->num_radios = 1; + rd->rssi_unit = APPLE80211_UNIT_DBM; + rd->rssi[0] = fLastRssi ? fLastRssi : -50; + rd->aggregate_rssi = rd->rssi[0]; + return 0; + } + break; + } + case APPLE80211_IOC_NOISE: { + apple80211_noise_data *nd = (apple80211_noise_data *)req_data; + if (nd) { + nd->version = APPLE80211_VERSION; + nd->num_radios = 1; + nd->noise_unit = APPLE80211_UNIT_DBM; + nd->noise[0] = -95; + nd->aggregate_noise = -95; + return 0; + } + break; + } + case APPLE80211_IOC_SSID: { + apple80211_ssid_data *sd = (apple80211_ssid_data *)req_data; + if (sd) { + sd->version = APPLE80211_VERSION; + sd->ssid_len = fSsidLen; + memcpy(sd->ssid_bytes, fSsid, fSsidLen); + return 0; + } + break; + } + case APPLE80211_IOC_BSSID: { + apple80211_bssid_data *bd = (apple80211_bssid_data *)req_data; + if (bd) { + bd->version = APPLE80211_VERSION; + memcpy(bd->bssid.octet, fBssid, 6); + return 0; + } + break; + } + case APPLE80211_IOC_RATE: { + apple80211_rate_data *rate = (apple80211_rate_data *)req_data; + if (rate) { + rate->version = APPLE80211_VERSION; + rate->num_radios = 1; + rate->rate[0] = 1200; + return 0; + } + break; + } + case APPLE80211_IOC_SUPPORTED_CHANNELS: { + apple80211_sup_channel_data *sc = (apple80211_sup_channel_data *)req_data; + if (sc) { + sc->version = APPLE80211_VERSION; + static const UInt16 chs[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165 }; + sc->num_channels = sizeof(chs)/sizeof(chs[0]); + for (int i = 0; i < sc->num_channels; i++) { + sc->supported_channels[i].version = APPLE80211_VERSION; + sc->supported_channels[i].channel = chs[i]; + sc->supported_channels[i].flags = (chs[i] <= 14) ? (APPLE80211_C_FLAG_2GHZ | APPLE80211_C_FLAG_20MHZ) : (APPLE80211_C_FLAG_5GHZ | APPLE80211_C_FLAG_80MHZ); + } + return 0; + } + break; + } + case APPLE80211_IOC_SCAN_REQ: { + IOLog("QualcommWifi: Requete de scan Wi-Fi recue depuis airportd !\n"); + fScanInProgress = true; + return 0; + } + case APPLE80211_IOC_SCAN_RESULT: { + return 0; + } + case APPLE80211_IOC_ASSOCIATE: { + apple80211_assoc_data *assoc = (apple80211_assoc_data *)req_data; + if (assoc) { + IOLog("QualcommWifi: Demande d'association au reseau Wi-Fi : %.*s\n", assoc->ad_ssid_len, assoc->ad_ssid); + fSsidLen = (assoc->ad_ssid_len < APPLE80211_MAX_SSID_LEN) ? assoc->ad_ssid_len : APPLE80211_MAX_SSID_LEN; + memcpy(fSsid, assoc->ad_ssid, fSsidLen); + memcpy(fBssid, assoc->ad_bssid.octet, 6); + fLinkActive = true; + return 0; + } + break; + } + case APPLE80211_IOC_DISASSOCIATE: { + IOLog("QualcommWifi: Deconnexion Wi-Fi demandee par macOS.\n"); + fLinkActive = false; + fSsidLen = 0; + return 0; + } + default: + break; + } + return 0; +} + +SInt32 QualcommWifi::apple80211SkywalkRequest(UInt req_type, int req_val, IO80211SkywalkInterface *iface, void *req_data) { + return apple80211Request(req_type, req_val, nullptr, req_data); +} + +SInt32 QualcommWifi::stopDMA() { + IOLog("QualcommWifi: stopDMA appele.\n"); + return 0; +} + +UInt32 QualcommWifi::hardwareOutputQueueDepth(IO80211Interface *iface) { + return 0; +} + +SInt32 QualcommWifi::performCountryCodeOperation(IO80211Interface *iface, IO80211CountryCodeOp op) { + IOLog("QualcommWifi: performCountryCodeOperation op=%d.\n", op); + return 0; +} + +SInt32 QualcommWifi::enableFeature(IO80211FeatureCode code, void *arg) { + IOLog("QualcommWifi: enableFeature code=%d.\n", code); + return 0; +} + +IOReturn QualcommWifi::enable(IO80211SkywalkInterface *netif) { + IOLog("QualcommWifi: Skywalk Interface activee par macOS.\n"); + fLinkActive = true; + return kIOReturnSuccess; +} + +IOReturn QualcommWifi::disable(IO80211SkywalkInterface *netif) { + IOLog("QualcommWifi: Skywalk Interface desactivee par macOS.\n"); + fLinkActive = false; + return kIOReturnSuccess; +} diff --git a/QualcommWireless/QualcommWifi.hpp b/QualcommWireless/QualcommWifi.hpp new file mode 100644 index 0000000..696e53d --- /dev/null +++ b/QualcommWireless/QualcommWifi.hpp @@ -0,0 +1,255 @@ +#ifndef _QUALCOMMWIFI_HPP +#define _QUALCOMMWIFI_HPP + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#include +#include +#include +#include +#include + +// Registres PCIe et constantes de fenêtrage (ath12k/pci.h) +#define ATH12K_PCI_SOC_GLOBAL_RESET 0x3008 +#define ATH12K_PCI_WINDOW_REG_ADDRESS 0x310c +#define ATH12K_PCI_WINDOW_ENABLE_BIT 0x40000000 +#define ATH12K_PCI_WINDOW_START 0x80000 +#define ATH12K_PCI_WINDOW_RANGE_MASK 0x7FFFF +#define ATH12K_PCI_WINDOW_SHIFT 19 +#define ATH12K_PCI_WINDOW_VALUE_MASK 0x3F + +// Registre de révision matérielle du SoC Qualcomm WCN7850 +#define TCSR_SOC_HW_VERSION 0x1B00000 +#define TCSR_SOC_HW_VERSION_MAJOR_MASK 0x0F00 +#define TCSR_SOC_HW_VERSION_MAJOR_SHIFT 8 +#define TCSR_SOC_HW_VERSION_MINOR_MASK 0x00FF + +// Masque DMA 36-bit aligné sur 4 Ko (4096 octets) exigé par WCN7850 +#define ATH12K_DMA_MASK_36BIT_PAGE 0x0000000FFFFFF000ULL +#define ATH12K_DMA_TEST_RING_SIZE 65536 // 64 Ko pour le contexte MHI + +// Registres MHI MMIO (bar0 direct) +#define ATH12K_MHI_MHIREGLEN 0x00 +#define ATH12K_MHI_MHIVER 0x08 +#define ATH12K_MHI_MHICFG 0x10 +#define ATH12K_MHI_CHDBOFF 0x18 +#define ATH12K_MHI_ERDBOFF 0x20 +#define ATH12K_MHI_BHIOFF 0x28 +#define ATH12K_MHI_BHIEOFF 0x2c +#define ATH12K_MHI_DEBUGOFF 0x30 +#define ATH12K_MHI_MHICTRL 0x38 +#define ATH12K_MHI_MHISTATUS 0x48 +#define ATH12K_MHI_CCABAP_LOWER 0x58 +#define ATH12K_MHI_CCABAP_HIGHER 0x5c +#define ATH12K_MHI_ECABAP_LOWER 0x60 +#define ATH12K_MHI_ECABAP_HIGHER 0x64 +#define ATH12K_MHI_CRCBAP_LOWER 0x68 +#define ATH12K_MHI_CRCBAP_HIGHER 0x6c +#define ATH12K_MHI_CRDB_LOWER 0x70 +#define ATH12K_MHI_CRDB_HIGHER 0x74 +#define ATH12K_MHI_MHICTRLBASE_LOWER 0x80 +#define ATH12K_MHI_MHICTRLBASE_HIGHER 0x84 +#define ATH12K_MHI_MHICTRLLIMIT_LOWER 0x88 +#define ATH12K_MHI_MHICTRLLIMIT_HIGHER 0x8c +#define ATH12K_MHI_MHIDATABASE_LOWER 0x98 +#define ATH12K_MHI_MHIDATABASE_HIGHER 0x9c +#define ATH12K_MHI_MHIDATALIMIT_LOWER 0xa0 +#define ATH12K_MHI_MHIDATALIMIT_HIGHER 0xa4 + +// États MHI +#define ATH12K_MHI_STATE_RESET 0x0 +#define ATH12K_MHI_STATE_READY 0x1 +#define ATH12K_MHI_STATE_M0 0x2 +#define ATH12K_MHI_STATE_M1 0x3 +#define ATH12K_MHI_STATE_M2 0x4 +#define ATH12K_MHI_STATE_M3 0x5 + +// Environnements d'exécution MHI (EE) +#define ATH12K_MHI_EE_PBL 0x00 +#define ATH12K_MHI_EE_SBL 0x01 +#define ATH12K_MHI_EE_AMSS 0x02 +#define ATH12K_MHI_EE_RDDM 0x03 +#define ATH12K_MHI_EE_WFW 0x04 + +#define ATH12K_MHISTATUS_READY_MASK 0x00000001 +#define ATH12K_MHICTRL_RESET_MASK 0x00000002 +#define ATH12K_MHICTRL_MHISTATE_SHIFT 8 +#define ATH12K_MHICTRL_MHISTATE_MASK 0x0000FF00 +#define ATH12K_MHISTATUS_MHISTATE_SHIFT 8 +#define ATH12K_MHISTATUS_MHISTATE_MASK 0x0000FF00 +#define ATH12K_MHICFG_NER_MASK 0x00FF0000 +#define ATH12K_MHICFG_NHWER_MASK 0xFF000000 + +// Types de paquets d'événements MHI +#define ATH12K_MHI_PKT_TYPE_STATE_CHANGE_EVENT 0x20 +#define ATH12K_MHI_PKT_TYPE_EE_EVENT 0x40 + +// Registres BHI (Boot Host Interface) +#define ATH12K_BHI_BHIVERSION_MINOR 0x00 +#define ATH12K_BHI_BHIVERSION_MAJOR 0x04 +#define ATH12K_BHI_IMGADDR_LOW 0x08 +#define ATH12K_BHI_IMGADDR_HIGH 0x0c +#define ATH12K_BHI_IMGSIZE 0x10 +#define ATH12K_BHI_IMGTXDB 0x18 +#define ATH12K_BHI_EXECENV 0x28 +#define ATH12K_BHI_STATUS 0x2c +#define ATH12K_BHI_ERRCODE 0x30 +#define ATH12K_BHI_SERIALNU 0x40 + +#define ATH12K_BHI_STATUS_RESET 0x00 +#define ATH12K_BHI_STATUS_MASK 0xC0000000 +#define ATH12K_BHI_STATUS_SHIFT 30 +#define ATH12K_BHI_STATUS_SUCCESS 0x02 +#define ATH12K_BHI_STATUS_ERROR 0x03 + +// Registres BHIe (Boot Host Interface extension) - offsets relatifs à bhieOff (0x224 sur WCN7850) +#define ATH12K_BHIE_MSMSOCID 0x00 +#define ATH12K_BHIE_TXVECADDR_LOW 0x2c +#define ATH12K_BHIE_TXVECADDR_HIGH 0x30 +#define ATH12K_BHIE_TXVECSIZE 0x34 +#define ATH12K_BHIE_TXVECDB 0x3c +#define ATH12K_BHIE_TXVECSTATUS 0x44 +#define ATH12K_BHIE_RXVECADDR_LOW 0x60 +#define ATH12K_BHIE_RXVECADDR_HIGH 0x64 +#define ATH12K_BHIE_RXVECSIZE 0x68 +#define ATH12K_BHIE_RXVECDB 0x70 +#define ATH12K_BHIE_RXVECSTATUS 0x78 + +#define ATH12K_BHIE_TXVECSTATUS_STATUS_MASK 0xC0000000 +#define ATH12K_BHIE_TXVECSTATUS_STATUS_SHIFT 30 +#define ATH12K_BHIE_TXVECSTATUS_XFER_COMPL 0x02 + +struct bhi_vec_entry { + uint64_t dma_addr; + uint64_t size; +} __attribute__((packed)); + +struct mhi_chan_ctxt { + UInt32 chcfg; + UInt32 chtype; + UInt32 erindex; + UInt64 rbase __attribute__((packed, aligned(4))); + UInt64 rlen __attribute__((packed, aligned(4))); + UInt64 rp __attribute__((packed, aligned(4))); + UInt64 wp __attribute__((packed, aligned(4))); +} __attribute__((packed)); + +struct mhi_event_ctxt { + UInt32 intmod; + UInt32 ertype; + UInt32 msivec; + UInt64 rbase __attribute__((packed, aligned(4))); + UInt64 rlen __attribute__((packed, aligned(4))); + UInt64 rp __attribute__((packed, aligned(4))); + UInt64 wp __attribute__((packed, aligned(4))); +} __attribute__((packed)); + +struct mhi_cmd_ctxt { + UInt32 reserved0; + UInt32 reserved1; + UInt32 reserved2; + UInt64 rbase __attribute__((packed, aligned(4))); + UInt64 rlen __attribute__((packed, aligned(4))); + UInt64 rp __attribute__((packed, aligned(4))); + UInt64 wp __attribute__((packed, aligned(4))); +} __attribute__((packed)); + +struct mhi_ring_element { + UInt64 ptr; + UInt32 dword[2]; +} __attribute__((packed)); + +#define MHI_TRE_GET_EV_TYPE(tre) (((tre)->dword[1] >> 16) & 0xFF) +#define MHI_TRE_GET_EV_STATE(tre) (((tre)->dword[0] >> 24) & 0xFF) +#define MHI_TRE_GET_EV_EXECENV(tre) (((tre)->dword[0] >> 24) & 0xFF) + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "Firmware_WCN7850_Wifi.h" + +class QualcommWifi : public IO80211Controller { + OSDeclareDefaultStructors(QualcommWifi) + +private: + IOPCIDevice *fPciDevice; + IOMemoryMap *fBar0Map; + volatile void *fBar0Virt; + UInt32 fCurrWindow; + + IOInterruptEventSource *fInterruptSource; + IO80211Interface *fNetif; + IOEthernetAddress fMacAddress; + + // État réseau Wi-Fi + bool fLinkActive; + UInt16 fCurrentChannel; + SInt32 fLastRssi; + UInt8 fSsid[APPLE80211_MAX_SSID_LEN]; + UInt32 fSsidLen; + UInt8 fBssid[6]; + bool fScanInProgress; + + // Tampon DMA physiquement contigu + IOBufferMemoryDescriptor *fDmaBuf; + IOPhysicalAddress fDmaPhysAddr; + void *fDmaVirtAddr; + bool fDmaPrepared; + + UInt32 read32(UInt32 offset); + void write32(UInt32 offset, UInt32 value); + + void selectWindow(UInt32 offset); + UInt32 socRead32(UInt32 offset); + void socWrite32(UInt32 offset, UInt32 value); + + bool allocDmaContext(IOByteCount size); + void freeDmaContext(void); + + bool loadBhiFirmware(void); + + static void interruptOccurred(OSObject *owner, IOInterruptEventSource *src, int count); + +public: + virtual bool init(OSDictionary *dictionary = 0) override; + virtual void free(void) override; + virtual IOService *probe(IOService *provider, SInt32 *score) override; + virtual bool start(IOService *provider) override; + virtual void stop(IOService *provider) override; + + // IOEthernetController / IONetworkController interface + virtual IOReturn getHardwareAddress(IOEthernetAddress *addrP) override; + virtual IOReturn enable(IONetworkInterface *netif) override; + virtual IOReturn disable(IONetworkInterface *netif) override; + virtual UInt32 outputPacket(mbuf_t m, void *param) override; + + // IO80211Controller interface + virtual SInt32 apple80211Request(unsigned int req_type, int req_val, IO80211Interface* iface, void* req_data) override; + virtual SInt32 apple80211SkywalkRequest(UInt req_type, int req_val, IO80211SkywalkInterface *iface, void *req_data) override; + virtual SInt32 stopDMA() override; + virtual UInt32 hardwareOutputQueueDepth(IO80211Interface* iface) override; + virtual SInt32 performCountryCodeOperation(IO80211Interface* iface, IO80211CountryCodeOp op) override; + virtual SInt32 enableFeature(IO80211FeatureCode code, void* arg) override; + + // Skywalk interface + virtual IOReturn enable(IO80211SkywalkInterface *netif) override; + virtual IOReturn disable(IO80211SkywalkInterface *netif) override; + + // Compatibilité symboles virtuels IONetworkController sous macOS 15 + virtual void _RESERVEDIONetworkController2() override {} + virtual void _RESERVEDIONetworkController3() override {} + virtual void _RESERVEDIONetworkController4() override {} + virtual void _RESERVEDIONetworkController5() override {} + virtual void _RESERVEDIONetworkController6() override {} + virtual void _RESERVEDIONetworkController7() override {} +}; + +#endif diff --git a/QualcommWireless/QualcommWireless.cpp b/QualcommWireless/QualcommWireless.cpp new file mode 100644 index 0000000..0e9b61a --- /dev/null +++ b/QualcommWireless/QualcommWireless.cpp @@ -0,0 +1,375 @@ +#include "QualcommWireless.hpp" +#include "Firmware_WCN7850.h" + +#include +#include +#include + +#define super IOService +OSDefineMetaClassAndStructors(QualcommWireless, IOService) + +bool QualcommWireless::init(OSDictionary *dictionary) { + if (!super::init(dictionary)) return false; + fDevice = nullptr; + fInterface = nullptr; + fBulkOutPipe = nullptr; + fIntrInPipe = nullptr; + fBulkBuffer = nullptr; + return true; +} + +void QualcommWireless::free(void) { + super::free(); +} + +IOService *QualcommWireless::probe(IOService *provider, SInt32 *score) { + if (!super::probe(provider, score)) return nullptr; + + IOUSBHostDevice *dev = OSDynamicCast(IOUSBHostDevice, provider); + if (!dev) return nullptr; + + const StandardUSB::DeviceDescriptor *desc = dev->getDeviceDescriptor(); + if (!desc) return nullptr; + + UInt16 vid = OSSwapLittleToHostInt16(desc->idVendor); + UInt16 pid = OSSwapLittleToHostInt16(desc->idProduct); + + if (vid == 0x0489 && pid == 0xe10d) { + IOLog("QualcommWireless: Detecte controleur Bluetooth Foxconn/Qualcomm (0x%04x:0x%04x) !\n", vid, pid); + *score += 10000; + return this; + } + + return nullptr; +} + +uint8_t QualcommWireless::checkStatus(void) { + uint8_t status = 0; + uint32_t transferred = 0; + + StandardUSB::DeviceRequest req; + req.bmRequestType = makeDeviceRequestbmRequestType(kRequestDirectionIn, + kRequestTypeVendor, + kRequestRecipientDevice); + req.bRequest = QCA_CHECK_STATUS; + req.wValue = 0; + req.wIndex = 0; + req.wLength = sizeof(status); + + IOReturn kr = fDevice->deviceRequest(this, req, &status, transferred, 2000); + if (kr != kIOReturnSuccess) { + IOLog("QualcommWireless: Erreur checkStatus (0x%08x)\n", kr); + return 0; + } + return status; +} + +bool QualcommWireless::queryTargetVersion(struct qca_version *verOut) { + uint32_t transferred = 0; + + StandardUSB::DeviceRequest req; + req.bmRequestType = makeDeviceRequestbmRequestType(kRequestDirectionIn, + kRequestTypeVendor, + kRequestRecipientDevice); + req.bRequest = QCA_GET_TARGET_VERSION; + req.wValue = 0; + req.wIndex = 0; + req.wLength = sizeof(struct qca_version); + + IOReturn kr = fDevice->deviceRequest(this, req, verOut, transferred, 2000); + if (kr != kIOReturnSuccess || transferred < sizeof(struct qca_version)) { + IOLog("QualcommWireless: Erreur queryTargetVersion (0x%08x, transferred=%u)\n", kr, transferred); + return false; + } + return true; +} + +bool QualcommWireless::downloadFirmware(const uint8_t *data, size_t size, size_t hdrSize) { + if (!fDevice || !fBulkOutPipe || !fBulkBuffer || size < hdrSize) return false; + + // 1. Envoi du header via requête de contrôle vendeur DFU + uint32_t transferred = 0; + StandardUSB::DeviceRequest req; + req.bmRequestType = makeDeviceRequestbmRequestType(kRequestDirectionOut, + kRequestTypeVendor, + kRequestRecipientDevice); + req.bRequest = QCA_DFU_DOWNLOAD; + req.wValue = 0; + req.wIndex = 0; + req.wLength = (uint16_t)hdrSize; + + IOReturn kr = fDevice->deviceRequest(this, req, (void *)data, transferred, 2000); + if (kr != kIOReturnSuccess) { + IOLog("QualcommWireless: Erreur envoi header DFU (0x%08x)\n", kr); + return false; + } + + // Délai de 20ms pour permettre au contrôleur d'activer le mode DFU sur ep2 + IOSleep(20); + + // 2. Envoi du corps par paquets de 4096 octets max sur le pipe Bulk OUT + size_t sent = hdrSize; + size_t remaining = size - hdrSize; + void *bufPtr = fBulkBuffer->getBytesNoCopy(); + + while (remaining > 0) { + uint32_t chunk = (remaining > QCA_DFU_PACKET_LEN) ? QCA_DFU_PACKET_LEN : (uint32_t)remaining; + memcpy(bufPtr, data + sent, chunk); + + uint32_t bytesWritten = 0; + kr = fBulkOutPipe->io(fBulkBuffer, chunk, bytesWritten, 3000); + if (kr != kIOReturnSuccess || bytesWritten != chunk) { + IOLog("QualcommWireless: Erreur io pipe bulk (offset %zu/%zu, kr=0x%08x)\n", sent, size, kr); + return false; + } + + sent += chunk; + remaining -= chunk; + } + + return true; +} + +bool QualcommWireless::sendHciReset(void) { + uint8_t cmd[3] = {0x03, 0x0c, 0x00}; // HCI Reset + uint32_t transferred = 0; + + StandardUSB::DeviceRequest req; + req.bmRequestType = makeDeviceRequestbmRequestType(kRequestDirectionOut, + kRequestTypeClass, + kRequestRecipientInterface); + req.bRequest = 0; + req.wValue = 0; + req.wIndex = 0; + req.wLength = sizeof(cmd); + + IOReturn kr = fDevice->deviceRequest(this, req, cmd, transferred, 2000); + if (kr != kIOReturnSuccess) { + IOLog("QualcommWireless: Erreur envoi HCI Reset (0x%08x)\n", kr); + return false; + } + + if (fIntrInPipe && fBulkBuffer) { + uint32_t bytesRead = 0; + kr = fIntrInPipe->io(fBulkBuffer, 256, bytesRead, 2000); + if (kr == kIOReturnSuccess && bytesRead > 0) { + uint8_t *evt = (uint8_t *)fBulkBuffer->getBytesNoCopy(); + if (evt[0] == 0x0E && evt[5] == 0) { + IOLog("QualcommWireless: HCI Reset acquitte avec succes par le controleur !\n"); + return true; + } + } + } + + return true; +} + +bool QualcommWireless::start(IOService *provider) { + if (!super::start(provider)) return false; + + fDevice = OSDynamicCast(IOUSBHostDevice, provider); + if (!fDevice) return false; + fDevice->retain(); + + if (!fDevice->open(this)) { + IOLog("QualcommWireless: Impossible d'ouvrir le peripherique USB.\n"); + OSSafeReleaseNULL(fDevice); + return false; + } + + // Configuration 1 + IOReturn kr = fDevice->setConfiguration(1); + if (kr != kIOReturnSuccess) { + IOLog("QualcommWireless: Erreur setConfiguration(1) -> 0x%08x\n", kr); + fDevice->close(this); + OSSafeReleaseNULL(fDevice); + return false; + } + + struct qca_version ver; + memset(&ver, 0, sizeof(ver)); + if (queryTargetVersion(&ver)) { + IOLog("QualcommWireless: QCA Version ROM=0x%08x Patch=0x%08x RAM=0x%08x\n", + OSSwapLittleToHostInt32(ver.rom_version), + OSSwapLittleToHostInt32(ver.patch_version), + OSSwapLittleToHostInt32(ver.ram_version)); + } + + uint8_t status = checkStatus(); + IOLog("QualcommWireless: Statut initial QCA: 0x%02x (Patch: %s, Syscfg: %s)\n", + status, (status & 0x80) ? "OUI" : "NON", (status & 0x40) ? "OUI" : "NON"); + + bool needPatch = !(status & 0x80); + bool needNvm = !(status & 0x40); + + if (needPatch || needNvm) { + // Recherche de l'interface 0 (avec réessais si l'énumération est en cours) + for (int retry = 0; retry < 10 && !fInterface; retry++) { + OSIterator *iterator = fDevice->getChildIterator(gIOServicePlane); + if (iterator) { + OSObject *candidate; + while ((candidate = iterator->getNextObject())) { + IOUSBHostInterface *intf = OSDynamicCast(IOUSBHostInterface, candidate); + if (intf && intf->getInterfaceDescriptor() && intf->getInterfaceDescriptor()->bInterfaceNumber == 0) { + fInterface = intf; + fInterface->retain(); + break; + } + } + OSSafeReleaseNULL(iterator); + } + if (!fInterface) { + IOSleep(30); + } + } + + if (!fInterface) { + IOLog("QualcommWireless: Erreur - Interface 0 non trouvee.\n"); + fDevice->close(this); + OSSafeReleaseNULL(fDevice); + return false; + } + + if (!fInterface->open(this)) { + IOLog("QualcommWireless: Impossible d'ouvrir l'interface 0.\n"); + OSSafeReleaseNULL(fInterface); + fDevice->close(this); + OSSafeReleaseNULL(fDevice); + return false; + } + + // Recherche des pipes (Bulk OUT 0x02 et Interrupt IN 0x81) + const StandardUSB::ConfigurationDescriptor *configDescriptor = fInterface->getConfigurationDescriptor(); + const StandardUSB::InterfaceDescriptor *interfaceDescriptor = fInterface->getInterfaceDescriptor(); + const EndpointDescriptor *endpointDescriptor = nullptr; + + while ((endpointDescriptor = StandardUSB::getNextEndpointDescriptor(configDescriptor, interfaceDescriptor, endpointDescriptor))) { + uint8_t epDirection = StandardUSB::getEndpointDirection(endpointDescriptor); + uint8_t epType = StandardUSB::getEndpointType(endpointDescriptor); + uint8_t epAddress = StandardUSB::getEndpointAddress(endpointDescriptor); + + if (epDirection == kEndpointDirectionOut && epType == kEndpointTypeBulk) { + fBulkOutPipe = fInterface->copyPipe(epAddress); + } else if (epDirection == kEndpointDirectionIn && epType == kEndpointTypeInterrupt) { + fIntrInPipe = fInterface->copyPipe(epAddress); + } + } + + fBulkBuffer = fInterface->createIOBuffer(kIODirectionOut, QCA_DFU_PACKET_LEN); + + if (fBulkOutPipe && fBulkBuffer) { + if (needPatch) { + IOLog("QualcommWireless: Televersement du RAMPATCH WCN7850 (%u octets)...\n", rampatch_usb_00190200_bin_len); + if (downloadFirmware(rampatch_usb_00190200_bin, rampatch_usb_00190200_bin_len, 40)) { + IOLog("QualcommWireless: RAMPATCH televerse avec succes !\n"); + } else { + IOLog("QualcommWireless: Echec du televersement RAMPATCH !\n"); + } + } + + status = checkStatus(); + if (needNvm) { + IOLog("QualcommWireless: Televersement du NVM WCN7850 (%u octets)...\n", nvm_usb_00190200_bin_len); + if (downloadFirmware(nvm_usb_00190200_bin, nvm_usb_00190200_bin_len, 4)) { + IOLog("QualcommWireless: NVM televerse avec succes !\n"); + } else { + IOLog("QualcommWireless: Echec du televersement NVM !\n"); + } + IOSleep(100); + } + + sendHciReset(); + + // Délai de stabilisation post-reset (150 ms) pour permettre au processeur Bluetooth + // et aux tampons FIFO USB de re-calibrer leur état avant que bluetoothd n'initialise la pile. + IOSleep(150); + } else { + IOLog("QualcommWireless: Erreur initialisation pipes ou buffer.\n"); + } + + if (fIntrInPipe) { + fIntrInPipe->clearStall(false); + } + if (fBulkOutPipe) { + fBulkOutPipe->clearStall(false); + } + + OSSafeReleaseNULL(fBulkBuffer); + OSSafeReleaseNULL(fBulkOutPipe); + OSSafeReleaseNULL(fIntrInPipe); + + if (fInterface->isOpen(this)) { + fInterface->close(this); + } + OSSafeReleaseNULL(fInterface); + } + + uint8_t finalStatus = checkStatus(); + IOLog("QualcommWireless: Statut FINAL: 0x%02x (Patch: %s, Syscfg: %s) -> Pret pour macOS !\n", + finalStatus, (finalStatus & 0x80) ? "OUI" : "NON", (finalStatus & 0x40) ? "OUI" : "NON"); + + // 1. Propriétés sur le périphérique USB pour bluetoothd (macOS Monterey / Ventura / Sonoma / Sequoia) + // IMPORTANT: Ne JAMAIS nommer "Bluetooth USB Host Controller" sinon Found_USB_Dongle ignore le périphérique. + fDevice->setProperty("USB Product Name", "Qualcomm WCN7850 Bluetooth"); + fDevice->setProperty("USB Vendor Name", "Qualcomm"); + fDevice->setProperty("FirmwareLoaded", true); + fDevice->setProperty("kUSBHostPortType", (uint32_t)255, 32); + fDevice->setProperty("builtin", (uint32_t)1, 32); + + // Spoof idVendor à 0x0a12 (CSR) dans IORegistry pour que bluetoothd le valide dans sa liste + // blanche de dongles tiers et active le chipset générique THIRD_PARTY_DONGLE (HCI Transport: USB). + fDevice->setProperty("idVendor", (uint32_t)0x0a12, 32); + fDevice->setName("Qualcomm WCN7850 Bluetooth"); + + // 2. Propriétés sur le port parent + IOService *hubPort = fDevice->getProvider(); + if (hubPort) { + hubPort->setProperty("USBPortType", (uint32_t)255, 32); + hubPort->setProperty("port-type", (uint32_t)255, 32); + } + + // 3. Injection sur toutes les interfaces enfants (HCI & SCO) + OSIterator *intfIter = fDevice->getChildIterator(gIOServicePlane); + if (intfIter) { + OSObject *candidate; + while ((candidate = intfIter->getNextObject())) { + IOUSBHostInterface *intf = OSDynamicCast(IOUSBHostInterface, candidate); + if (intf) { + intf->setProperty("USB Product Name", "Qualcomm WCN7850 Bluetooth"); + intf->setProperty("USB Vendor Name", "Qualcomm"); + intf->setProperty("idVendor", (uint32_t)0x0a12, 32); + } + } + OSSafeReleaseNULL(intfIter); + } + + // Délai de 100ms avant de relâcher l'accès exclusif pour garantir que bluetoothd + // trouve le contrôleur dans un état parfaitement calme et stabilisé au démarrage. + IOSleep(100); + + // Libération de l'accès exclusif afin que bluetoothd puisse ouvrir le contrôleur + fDevice->close(this); + + registerService(); + return true; +} + +void QualcommWireless::stop(IOService *provider) { + IOLog("QualcommWireless: Arret du service.\n"); + + if (fInterface) { + if (fInterface->isOpen(this)) { + fInterface->close(this); + } + OSSafeReleaseNULL(fInterface); + } + + if (fDevice) { + if (fDevice->isOpen(this)) { + fDevice->close(this); + } + OSSafeReleaseNULL(fDevice); + } + + super::stop(provider); +} diff --git a/QualcommWireless/QualcommWireless.hpp b/QualcommWireless/QualcommWireless.hpp new file mode 100644 index 0000000..9bda298 --- /dev/null +++ b/QualcommWireless/QualcommWireless.hpp @@ -0,0 +1,51 @@ +#ifndef _QUALCOMMWIRELESS_HPP +#define _QUALCOMMWIRELESS_HPP + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#include +#include +#include +#include +#include + +#define QCA_GET_TARGET_VERSION 0x09 +#define QCA_CHECK_STATUS 0x05 +#define QCA_DFU_DOWNLOAD 0x01 +#define QCA_DFU_PACKET_LEN 4096 + +struct qca_version { + uint32_t rom_version; + uint32_t patch_version; + uint32_t ram_version; + uint8_t chip_id; + uint8_t platform_id; + uint16_t flag; + uint8_t reserved[4]; +} __attribute__((packed)); + +class QualcommWireless : public IOService { + OSDeclareDefaultStructors(QualcommWireless) + +private: + IOUSBHostDevice *fDevice; + IOUSBHostInterface *fInterface; + IOUSBHostPipe *fBulkOutPipe; + IOUSBHostPipe *fIntrInPipe; + IOBufferMemoryDescriptor *fBulkBuffer; + + uint8_t checkStatus(void); + bool queryTargetVersion(struct qca_version *verOut); + bool downloadFirmware(const uint8_t *data, size_t size, size_t hdrSize); + bool sendHciReset(void); + +public: + virtual bool init(OSDictionary *dictionary = 0) override; + virtual void free(void) override; + virtual IOService *probe(IOService *provider, SInt32 *score) override; + virtual bool start(IOService *provider) override; + virtual void stop(IOService *provider) override; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/80211/Apple80211.h b/QualcommWireless/include/IOKit/80211/Apple80211.h new file mode 100644 index 0000000..f29a815 --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/Apple80211.h @@ -0,0 +1,23 @@ +// +// Apple80211.h +// itlwm +// +// Created by qcwap on 2020/9/4. +// Copyright © 2020 钟先耀. All rights reserved. +// + +#ifndef Apple80211_h +#define Apple80211_h + +#include +#include +#include +#include +#include +#include +#include +#if __IO80211_TARGET >= __MAC_10_15 +#include +#endif + +#endif /* Apple80211_h */ diff --git a/QualcommWireless/include/IOKit/80211/IO80211Controller.h b/QualcommWireless/include/IOKit/80211/IO80211Controller.h new file mode 100644 index 0000000..9b7fd78 --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/IO80211Controller.h @@ -0,0 +1,358 @@ +// +// IO80211Controller.h +// IO80211Family +// + +#ifndef _IO80211CONTROLLER_H +#define _IO80211CONTROLLER_H + +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include + +// This is necessary, because even the latest Xcode does not support properly targeting 11.0. +#ifndef __IO80211_TARGET +#error "Please define __IO80211_TARGET to the requested version" +#endif + +#if VERSION_MAJOR > 8 +#define _MODERN_BPF +#endif + +#include + +#include + +#include +#include + +#include "apple80211_ioctl.h" +#include "IO80211SkywalkInterface.h" +#include "IO80211WorkLoop.h" + +#define AUTH_TIMEOUT 15 // seconds + +/*! @enum LinkSpeed. + @abstract ???. + @discussion ???. + @constant LINK_SPEED_80211A 54 Mbps + @constant LINK_SPEED_80211B 11 Mbps. + @constant LINK_SPEED_80211G 54 Mbps. + */ +enum { + LINK_SPEED_80211A = 54000000ul, // 54 Mbps + LINK_SPEED_80211B = 11000000ul, // 11 Mbps + LINK_SPEED_80211G = 54000000ul, // 54 Mbps + LINK_SPEED_80211N = 300000000ul, // 300 Mbps (MCS index 15, 400ns GI, 40 MHz channel) +}; + +enum IO80211CountryCodeOp +{ + kIO80211CountryCodeReset, // Reset country code to world wide default, and start + // searching for 802.11d beacon +}; +typedef enum IO80211CountryCodeOp IO80211CountryCodeOp; + +enum IO80211SystemPowerState +{ + kIO80211SystemPowerStateUnknown, + kIO80211SystemPowerStateAwake, + kIO80211SystemPowerStateSleeping, +}; +typedef enum IO80211SystemPowerState IO80211SystemPowerState; + +enum IO80211FeatureCode +{ + kIO80211Feature80211n = 1, +}; +typedef enum IO80211FeatureCode IO80211FeatureCode; + + +class IOSkywalkInterface; +class IO80211ScanManager; +enum CCStreamLogLevel +{ + LEVEL_1, +}; + +enum scanSource +{ + SOURCE_1, +}; + +enum joinStatus +{ + STATUS_1, +}; + +class IO80211Controller; +class IO80211Interface; +class IO82110WorkLoop; +class IO80211VirtualInterface; +class IO80211ControllerMonitor; +class CCLogPipe; +class CCIOReporterLogStream; +class CCLogStream; +class IO80211VirtualInterface; +class IO80211RangingManager; +class IO80211FlowQueue; +class IO80211FlowQueueLegacy; +class FlowIdMetadata; +class IOReporter; +extern void IO80211VirtualInterfaceNamerRetain(); + + +struct apple80211_hostap_state; + +struct apple80211_awdl_sync_channel_sequence; +struct ieee80211_ht_capability_ie; +struct apple80211_channel_switch_announcement; +struct apple80211_beacon_period_data; +struct apple80211_power_debug_sub_info; +struct apple80211_stat_report; +struct apple80211_frame_counters; +struct apple80211_leaky_ap_event; +struct apple80211_chip_stats; +struct apple80211_extended_stats; +struct apple80211_ampdu_stat_report; +struct apple80211_btCoex_report; +struct apple80211_cca_report; +class CCPipe; +struct apple80211_lteCoex_report; + +//typedef int scanSource; +//typedef int joinStatus; +//typedef int CCStreamLogLevel; +typedef IOReturn (*IOCTL_FUNC)(IO80211Controller*, IO80211Interface*, IO80211VirtualInterface*, apple80211req*, bool); +extern IOCTL_FUNC gGetHandlerTable[]; +extern IOCTL_FUNC gSetHandlerTable[]; + +class IO80211Controller : public IOEthernetController { + OSDeclareAbstractStructors(IO80211Controller) + +public: + + virtual void free() APPLE_KEXT_OVERRIDE; +#if __IO80211_TARGET <= __MAC_10_15 + virtual bool terminate(unsigned int) APPLE_KEXT_OVERRIDE; +#endif + virtual bool init(OSDictionary *) APPLE_KEXT_OVERRIDE; + virtual IOReturn configureReport(IOReportChannelList *,UInt,void *,void *) APPLE_KEXT_OVERRIDE; + virtual IOReturn updateReport(IOReportChannelList *,UInt,void *,void *) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService *) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService *) APPLE_KEXT_OVERRIDE; + virtual IOService* getProvider(void) const APPLE_KEXT_OVERRIDE { return IOEthernetController::getProvider(); } + virtual IOWorkLoop* getWorkLoop(void) const APPLE_KEXT_OVERRIDE; + virtual const char* stringFromReturn(int) APPLE_KEXT_OVERRIDE; + virtual int errnoFromReturn(int) APPLE_KEXT_OVERRIDE; + virtual IOOutputQueue* getOutputQueue(void) const APPLE_KEXT_OVERRIDE { return NULL; } + virtual bool createWorkLoop(void) APPLE_KEXT_OVERRIDE; + virtual IOReturn enable(IONetworkInterface *) APPLE_KEXT_OVERRIDE; + virtual IOReturn disable(IONetworkInterface *) APPLE_KEXT_OVERRIDE; + virtual bool attachInterface(IONetworkInterface **iface, bool attach = true) APPLE_KEXT_OVERRIDE { return IOEthernetController::attachInterface(iface, attach); } +#if __IO80211_TARGET >= __MAC_10_15 + virtual void detachInterface(IONetworkInterface *iface, bool sync = false) APPLE_KEXT_OVERRIDE { IOEthernetController::detachInterface(iface, sync); } +#endif + virtual IONetworkInterface* createInterface(void) APPLE_KEXT_OVERRIDE { return IOEthernetController::createInterface(); } + virtual bool configureInterface(IONetworkInterface *iface) APPLE_KEXT_OVERRIDE { return IOEthernetController::configureInterface(iface); } +#ifdef __PRIVATE_SPI__ + virtual IOReturn outputStart(IONetworkInterface *,UInt) APPLE_KEXT_OVERRIDE; +#endif + virtual IOReturn getHardwareAddress(IOEthernetAddress *) APPLE_KEXT_OVERRIDE; + virtual void requestPacketTx(void*, UInt) {} + virtual IOReturn getHardwareAddressForInterface(IO80211Interface *,IOEthernetAddress *) { return kIOReturnSuccess; } + virtual void inputMonitorPacket(mbuf_t,UInt,void *,unsigned long) {} + virtual int outputRaw80211Packet(IO80211Interface *,mbuf_t) { return 0; } + virtual int outputActionFrame(IO80211Interface *,mbuf_t) { return 0; } + virtual int bpfOutputPacket(OSObject *,UInt,mbuf_t m) { return 0; } + virtual SInt32 monitorModeSetEnabled(IO80211Interface*, bool, UInt) { return 0; } + virtual IO80211Interface* getNetworkInterface(void) { return NULL; } +#if __IO80211_TARGET >= __MAC_10_15 + virtual IO80211SkywalkInterface* getPrimarySkywalkInterface(void) { return NULL; } +#endif + virtual SInt32 apple80211_ioctl(IO80211Interface *, IO80211VirtualInterface*, ifnet_t,unsigned long,void *) { return 0; } +#if __IO80211_TARGET >= __MAC_10_15 + virtual SInt32 apple80211_ioctl(IO80211SkywalkInterface *,unsigned long,void *) { return 0; } +#endif + virtual SInt32 apple80211_ioctl(IO80211Interface *interface, ifnet_t net,unsigned long id,void *data) { + return apple80211_ioctl(interface, NULL, net, id, data); + } + virtual SInt32 apple80211Request(unsigned int, int, IO80211Interface*, void*) = 0; + virtual SInt32 apple80211VirtualRequest(UInt,int,IO80211VirtualInterface *,void *) { return 0; } +#if __IO80211_TARGET >= __MAC_10_15 + virtual SInt32 apple80211SkywalkRequest(UInt,int,IO80211SkywalkInterface *,void *) { return 0; } +#endif + virtual SInt32 stopDMA() = 0; + virtual UInt32 hardwareOutputQueueDepth(IO80211Interface*) = 0; + virtual SInt32 performCountryCodeOperation(IO80211Interface*, IO80211CountryCodeOp) = 0; + virtual bool useAppleRSNSupplicant(IO80211Interface *) { return false; } + virtual bool useAppleRSNSupplicant(IO80211VirtualInterface *) { return false; } + virtual void dataLinkLayerAttachComplete(IO80211Interface *) {} + virtual SInt32 enableFeature(IO80211FeatureCode, void*) = 0; + virtual SInt32 setVirtualHardwareAddress(IO80211VirtualInterface *,ether_addr *) { return 0; } + virtual SInt32 enableVirtualInterface(IO80211VirtualInterface *) { return 0; } + virtual SInt32 disableVirtualInterface(IO80211VirtualInterface *) { return 0; } + virtual bool requiresExplicitMBufRelease() { + return false; + } + virtual bool flowIdSupported() { + return false; + } + virtual IO80211FlowQueueLegacy* requestFlowQueue(FlowIdMetadata const*) { return NULL; } + virtual void releaseFlowQueue(IO80211FlowQueue *) {} +#if __IO80211_TARGET >= __MAC_10_15 + virtual void getLogPipes(CCPipe**, CCPipe**, CCPipe**) {}; +#endif + virtual IOReturn enablePacketTimestamping(void) { + return kIOReturnUnsupported; + } + virtual IOReturn disablePacketTimestamping(void) { + return kIOReturnUnsupported; + } + virtual UInt32 selfDiagnosticsReport(int,char const*,UInt); + virtual UInt32 getDataQueueDepth(OSObject *); +#if __IO80211_TARGET >= __MAC_11_0 + virtual bool isAssociatedToMovingNetwork(void) { return false; } +#endif + virtual mbuf_flags_t inputPacket(mbuf_t) { return 0; } + virtual SInt32 apple80211_ioctl_get(IO80211Interface *,IO80211VirtualInterface *,ifnet_t,void *) { return 0; } + + +#if __IO80211_TARGET >= __MAC_10_15 + virtual SInt32 apple80211_ioctl_get(IO80211SkywalkInterface *,void *) { return 0; } + virtual SInt32 apple80211_ioctl_set(IO80211Interface *,IO80211VirtualInterface *,IO80211SkywalkInterface *,void *) { return 0; } + virtual SInt32 apple80211_ioctl_set(IO80211SkywalkInterface *,void*) { return 0; } + virtual bool attachInterface(IOSkywalkInterface *,IOService *) { return false; } +#else + virtual SInt32 apple80211_ioctl_set(IO80211Interface *,IO80211VirtualInterface *,ifnet_t,void *) { return 0; } +#endif + + +#if __IO80211_TARGET >= __MAC_11_0 + virtual bool detachInterface(IOSkywalkInterface *, bool) { return false; } +#endif + virtual IO80211VirtualInterface* createVirtualInterface(ether_addr *,UInt) { return NULL; } + virtual bool attachVirtualInterface(IO80211VirtualInterface **,ether_addr *,UInt,bool) { return false; } + virtual bool detachVirtualInterface(IO80211VirtualInterface *,bool) { return false; } +#if __IO80211_TARGET >= __MAC_10_15 + virtual IOReturn enable(IO80211SkywalkInterface *) { return kIOReturnSuccess; } + virtual IOReturn disable(IO80211SkywalkInterface *) { return kIOReturnSuccess; } +#endif + +//public: +// IO80211SkywalkInterface* getInfraInterface(void); +// IO80211ScanManager* getPrimaryInterfaceScanManager(void); +// IO80211ControllerMonitor* getInterfaceMonitor(void); +// IOReturn addReporterLegend(IOService *,IOReporter *,char const*,char const*); +// IOReturn removeReporterFromLegend(IOService *,IOReporter *,char const*,char const*); +// IOReturn unlockIOReporterLegend(void); +// void lockIOReporterLegend(void);// Suspected return type - int +// IOReturn logIOReportLogStreamSubscription(unsigned long long); +// IOReturn addIOReportLogStreamForProvider(IOService *,unsigned long long *); +// IOReturn addSubscriptionForThisReporterFetchedOnTimer(IOReporter *,char const*,char const*,IOService *) ; +// IOReturn addSubscriptionForProviderFetchedOnTimer(IOService *); +// void handleIOReporterTimer(IOTimerEventSource *); +// void setIOReportersStreamFlags(unsigned long long); +// void updateIOReportersStreamFrequency(void); // Suspected return type - int +// void setIOReportersStreamLevel(CCStreamLogLevel); +// void powerChangeGated(OSObject *,void *,void *,void *,void *); +// int copyOut(void const*,unsigned long long,unsigned long); +// SInt32 getASSOCIATE_RESULT(IO80211Interface *,IO80211VirtualInterface *,IO80211SkywalkInterface *,apple80211_assoc_result_data *); +// IOReturn copyIn(unsigned long long,void *,unsigned long); +// void logIOCTL(apple80211req *); +// bool isIOCTLLoggingRestricted(apple80211req *); +// IOReturn setChanNoiseFloorLTE(apple80211_stat_report *,int); +// IOReturn setChanNoiseFloor(apple80211_stat_report *,int); +// IOReturn setChanCCA(apple80211_stat_report *,int); +// IOReturn setChanExtendedCCA(apple80211_stat_report *,apple80211_cca_report *); +// bool setLTECoexstat(apple80211_stat_report *,apple80211_lteCoex_report *); +// bool setBTCoexstat(apple80211_stat_report *,apple80211_btCoex_report *); +// bool setAMPDUstat(apple80211_stat_report *,apple80211_ampdu_stat_report *,apple80211_channel *); +// UInt32 getCountryCode(apple80211_country_code_data *); +// IOReturn setCountryCode(apple80211_country_code_data *); +// bool getInfraExtendedStats(apple80211_extended_stats *); +// bool getChipCounterStats(apple80211_chip_stats *); +// bool setExtendedChipCounterStats(apple80211_stat_report *,void *); +// bool setChipCounterStats(apple80211_stat_report *,apple80211_chip_stats *,apple80211_channel *); +// virtual bool setLeakyAPStats(apple80211_leaky_ap_event *); +// bool setFrameStats(apple80211_stat_report *,apple80211_frame_counters *,apple80211_channel *); +// bool setPowerStats(apple80211_stat_report *,apple80211_power_debug_sub_info *); +// bool getBeaconPeriod(apple80211_beacon_period_data *); + SInt32 apple80211VirtualRequestIoctl(unsigned int,int,IO80211VirtualInterface *,void *); +// bool getBSSIDData(OSObject *,apple80211_bssid_data *); +// bool getSSIDData(apple80211_ssid_data *); +// bool inputInfraPacket(mbuf_t); +// void notifyHostapState(apple80211_hostap_state *); +// bool isAwdlAssistedDiscoveryEnabled(void); +// void joinDone(scanSource,joinStatus); +// void joinStarted(scanSource,joinStatus); +// void handleChannelSwitchAnnouncement(apple80211_channel_switch_announcement *); +// void scanDone(scanSource,int); +// void scanStarted(scanSource,apple80211_scan_data *); +// void printChannels(void); +// void updateInterfaceCoexRiskPct(unsigned long long); +// SInt32 getInfraChannel(apple80211_channel_data *); +// void calculateInterfacesAvaiability(void); // Suspected return type - int +// void setChannelSequenceList(apple80211_awdl_sync_channel_sequence *); // Suspected return type - int +// void setPrimaryInterfaceDatapathState(bool); +// UInt32 getPrimaryInterfaceLinkState(void); +// void setCurrentChannel(apple80211_channel *); // Suspected return type - int +// void setHtCapability(ieee80211_ht_capability_ie *); +// UInt32 getHtCapability(void); +// UInt32 getHtCapabilityLength(void); +// bool io80211isDebuggable(bool* enable); +// void logDebug(unsigned long long,char const*,...); // Suspected return type - int +// void vlogDebug(unsigned long long,char const*,va_list); // Suspected return type - char +// void logDebug(char const*,...); // Suspected return type - int +// bool calculateInterfacesCoex(void); +// void setInfraChannel(apple80211_channel *); +// void configureAntennae(void); + SInt32 apple80211RequestIoctl(unsigned int,int,IO80211Interface *,void *); + UInt32 radioCountForInterface(IO80211Interface *); +// void releaseIOReporters(void); +// bool findAndAttachToFaultReporter(void); +// UInt32 setupControlPathLogging(void); +// IOReturn createIOReporters(IOService *); +// IOReturn powerChangeHandler(void *,void *,unsigned int,IOService *,void *,unsigned long); + + OSMetaClassDeclareReservedUnused( IO80211Controller, 0); + OSMetaClassDeclareReservedUnused( IO80211Controller, 1); + OSMetaClassDeclareReservedUnused( IO80211Controller, 2); + OSMetaClassDeclareReservedUnused( IO80211Controller, 3); + OSMetaClassDeclareReservedUnused( IO80211Controller, 4); + OSMetaClassDeclareReservedUnused( IO80211Controller, 5); + OSMetaClassDeclareReservedUnused( IO80211Controller, 6); + OSMetaClassDeclareReservedUnused( IO80211Controller, 7); + OSMetaClassDeclareReservedUnused( IO80211Controller, 8); + OSMetaClassDeclareReservedUnused( IO80211Controller, 9); + OSMetaClassDeclareReservedUnused( IO80211Controller, 10); + OSMetaClassDeclareReservedUnused( IO80211Controller, 11); + OSMetaClassDeclareReservedUnused( IO80211Controller, 12); + OSMetaClassDeclareReservedUnused( IO80211Controller, 13); + OSMetaClassDeclareReservedUnused( IO80211Controller, 14); + OSMetaClassDeclareReservedUnused( IO80211Controller, 15); + +protected: + uint8_t filler[0x500]; +}; + +// 0x215: 1 byte, length of channel sequence, should be 16 +// 0x21c: channel sequence, should contain 16 elements of length 12, possibly apple80211_channel (but why 16?) +// struct of three ints, last looks like flags, first unused + +/* + void __thiscall +setChannelSequenceList(IO80211Controller *this,apple80211_awdl_sync_channel_sequence *param_1) + +{ + _memcpy(this + 0x210,param_1,400); + calculateInterfacesAvaiability(this); + return; +} +*/ + + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* !_IO80211CONTROLLER_H */ diff --git a/QualcommWireless/include/IOKit/80211/IO80211Interface.h b/QualcommWireless/include/IOKit/80211/IO80211Interface.h new file mode 100644 index 0000000..e2ab249 --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/IO80211Interface.h @@ -0,0 +1,144 @@ +// +// IO80211SkywalkInterface.h +// IO80211Family +// + +#ifndef _IO80211INTERFACE_H +#define _IO80211INTERFACE_H + +/* + * Kernel + */ +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include + +// This is necessary, because even the latest Xcode does not support properly targeting 11.0. +#ifndef __IO80211_TARGET +#error "Please define __IO80211_TARGET to the requested version" +#endif + +#if VERSION_MAJOR > 8 + #define _MODERN_BPF +#endif + +#include +#include +#include + +enum IO80211LinkState +{ + kIO80211NetworkLinkUndefined, // Starting link state when an interface is created + kIO80211NetworkLinkDown, // Interface not capable of transmitting packets + kIO80211NetworkLinkUp, // Interface capable of transmitting packets +}; +typedef enum IO80211LinkState IO80211LinkState; + +/*! @defined kIO80211InterfaceClass + @abstract The name of the IO80211Interface class. + */ +#define kIO80211InterfaceClass "IO80211Interface" + +typedef UInt64 IO80211FlowQueueHash; +class RSNSupplicant; +class IOTimerEventSource; +class IOGatedOutputQueue; +class IO80211Controller; +class IO80211Workloop; +class IO80211ScanManager; +class IO80211PeerManager; +class IO80211FlowQueueDatabase; +class IO80211InterfaceMonitor; +class IO80211AssociationJoinSnapshot; + +struct apple80211_debug_command; +struct apple80211_txstats; +struct apple80211_chip_counters_tx; +struct apple80211_chip_error_counters_tx; +struct apple80211_chip_counters_rx; +struct apple80211_ManagementInformationBasedot11_counters; +struct apple80211_leaky_ap_stats; +struct apple80211_leaky_ap_ssid_metrics; +struct apple80211_interface_availability; +struct apple80211_pmk_cache_data; +struct apple80211_ap_cmp_data; +struct TxPacketRequest; +struct AWSRequest; +struct packet_info_tx; +struct userPrintCtx; + +typedef int apple80211_postMessage_tlv_types; + +class IO80211Interface : public IOEthernetInterface +{ + OSDeclareDefaultStructors( IO80211Interface ); + +public: + virtual void free() APPLE_KEXT_OVERRIDE; + virtual IOReturn configureReport(IOReportChannelList *,uint,void *,void *) APPLE_KEXT_OVERRIDE; + virtual IOReturn updateReport(IOReportChannelList *,uint,void *,void *) APPLE_KEXT_OVERRIDE; + virtual bool terminate(unsigned int) APPLE_KEXT_OVERRIDE; + virtual bool attach(IOService*) APPLE_KEXT_OVERRIDE; + virtual void detach(IOService*) APPLE_KEXT_OVERRIDE; +#if __IO80211_TARGET >= __MAC_10_15 + virtual IOReturn newUserClient(task_t, void*, UInt32 type, OSDictionary*, IOUserClient**) APPLE_KEXT_OVERRIDE; +#endif + virtual const char* stringFromReturn(int) APPLE_KEXT_OVERRIDE; + virtual int errnoFromReturn(int) APPLE_KEXT_OVERRIDE; + virtual bool init(IONetworkController*) APPLE_KEXT_OVERRIDE; + virtual UInt32 inputPacket(mbuf_t packet, + UInt32 length = 0, + IOOptionBits options = 0, + void * param = 0) APPLE_KEXT_OVERRIDE; + virtual bool inputEvent(unsigned int, void*) APPLE_KEXT_OVERRIDE; + virtual SInt32 performCommand(IONetworkController*, unsigned long, void*, void*) APPLE_KEXT_OVERRIDE; + virtual IOReturn attachToDataLinkLayer(IOOptionBits, void*) APPLE_KEXT_OVERRIDE; + virtual void detachFromDataLinkLayer(unsigned int, void*) APPLE_KEXT_OVERRIDE; + + virtual void setPoweredOnByUser(bool); + virtual void setEnabledBySystem(bool); + + virtual bool setLinkState(IO80211LinkState, unsigned int); + virtual bool setLinkState(IO80211LinkState, int, unsigned int); + virtual UInt32 outputPacket(mbuf_t, void*); + + virtual bool setLinkQualityMetric(int); + virtual void handleDebugCmd(apple80211_debug_command*); + OSMetaClassDeclareReservedUnused( IO80211Interface, 0); + OSMetaClassDeclareReservedUnused( IO80211Interface, 1); + OSMetaClassDeclareReservedUnused( IO80211Interface, 2); + OSMetaClassDeclareReservedUnused( IO80211Interface, 3); + OSMetaClassDeclareReservedUnused( IO80211Interface, 4); + OSMetaClassDeclareReservedUnused( IO80211Interface, 5); + OSMetaClassDeclareReservedUnused( IO80211Interface, 6); + OSMetaClassDeclareReservedUnused( IO80211Interface, 7); + OSMetaClassDeclareReservedUnused( IO80211Interface, 8); + OSMetaClassDeclareReservedUnused( IO80211Interface, 9); + OSMetaClassDeclareReservedUnused( IO80211Interface, 10); + OSMetaClassDeclareReservedUnused( IO80211Interface, 11); + OSMetaClassDeclareReservedUnused( IO80211Interface, 12); + OSMetaClassDeclareReservedUnused( IO80211Interface, 13); + OSMetaClassDeclareReservedUnused( IO80211Interface, 14); + OSMetaClassDeclareReservedUnused( IO80211Interface, 15); +public: + IO80211FlowQueue * findOrCreateFlowQueue(IO80211FlowQueueHash); + void dropTxPacket(mbuf_t); + void logDebug(unsigned long long, char const*, ...); + void vlogDebug(unsigned long long, char const*, va_list); + const char * getBSDName(); + bool setLeakyAPStatsMode(unsigned int); + void stopOutputQueues(); + void startOutputQueues(); + bool updateLinkSpeed(); + bool reportDataTransferRatesStatic(void*); + void logDebug(char const*, ...); + void postMessage(unsigned int, void* data = NULL, unsigned long dataLen = 0); +protected: + u_int8_t dat[0x500]; +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* ! _IO80211INTERFACE_H */ + diff --git a/QualcommWireless/include/IOKit/80211/IO80211P2PInterface.h b/QualcommWireless/include/IOKit/80211/IO80211P2PInterface.h new file mode 100644 index 0000000..fbf71c2 --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/IO80211P2PInterface.h @@ -0,0 +1,87 @@ +#ifndef IO80211P2PInterface_h +#define IO80211P2PInterface_h + +#include "IO80211VirtualInterface.h" + +class IO80211P2PInterface : public IO80211VirtualInterface { + OSDeclareDefaultStructors(IO80211P2PInterface) + +public: + virtual void free(void) APPLE_KEXT_OVERRIDE; +#if __IO80211_TARGET >= __MAC_11_0 + virtual bool willTerminate(IOService *,uint) APPLE_KEXT_OVERRIDE; +#endif + virtual IOReturn configureReport(IOReportChannelList *channels, + IOReportConfigureAction action, + void *result, + void *destination) APPLE_KEXT_OVERRIDE; + virtual IOReturn updateReport(IOReportChannelList *channels, + IOReportUpdateAction action, + void *result, + void *destination) APPLE_KEXT_OVERRIDE; + + virtual bool terminate( IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; + virtual bool attach(IOService *) APPLE_KEXT_OVERRIDE; + virtual void detach(IOService *) APPLE_KEXT_OVERRIDE; +#if __IO80211_TARGET >= __MAC_10_15 + virtual IOReturn newUserClient(task_t,void *,UInt,OSDictionary *,IOUserClient **) APPLE_KEXT_OVERRIDE; +#endif + virtual const char * stringFromReturn( IOReturn rtn ) APPLE_KEXT_OVERRIDE; + virtual int errnoFromReturn( IOReturn rtn ) APPLE_KEXT_OVERRIDE; + virtual IOReturn powerStateWillChangeTo( + IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService * whatDevice ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn powerStateDidChangeTo( + IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService * whatDevice ) APPLE_KEXT_OVERRIDE; + virtual bool init(IO80211Controller *,ether_addr *,uint,char const*) APPLE_KEXT_OVERRIDE; + virtual bool createPeerManager(ether_addr *,IO80211PeerManager **) APPLE_KEXT_OVERRIDE; + virtual UInt getMediumType() APPLE_KEXT_OVERRIDE; + virtual void setLinkState(IO80211LinkState,uint) APPLE_KEXT_OVERRIDE; + virtual bool dequeueOutputPacketsWithServiceClass(uint,IOMbufServiceClass,mbuf_t*,mbuf_t*,UInt *,unsigned long long *) APPLE_KEXT_OVERRIDE; + virtual UInt32 outputPacket (mbuf_t m, void* param) APPLE_KEXT_OVERRIDE; + virtual void setEnabledBySystem(bool) APPLE_KEXT_OVERRIDE; + virtual void handleIoctl(unsigned long,void *) APPLE_KEXT_OVERRIDE; + virtual UInt32 inputPacket(mbuf_t,packet_info_tag *) APPLE_KEXT_OVERRIDE; + virtual IOReturn controllerWillChangePowerState(IO80211Controller *,unsigned long,UInt,IOService *) APPLE_KEXT_OVERRIDE; + virtual IOReturn controllerDidChangePowerState(IO80211Controller *,unsigned long,UInt,IOService *) APPLE_KEXT_OVERRIDE; + virtual bool handleDebugCmd(apple80211_debug_command *) APPLE_KEXT_OVERRIDE; + virtual IOReturn postPeerPresence(ether_addr *,int,int,int,char *) APPLE_KEXT_OVERRIDE; + virtual IOReturn postPeerAbsence(ether_addr *) APPLE_KEXT_OVERRIDE; +#if __IO80211_TARGET >= __MAC_10_15 + virtual IOReturn postPeerPresenceIPv6(ether_addr *,int,int,int,char *,unsigned char *) APPLE_KEXT_OVERRIDE; +#endif + virtual void signalOutputThread() APPLE_KEXT_OVERRIDE; + virtual bool isOutputFlowControlled() APPLE_KEXT_OVERRIDE; + virtual void setOutputFlowControlled() APPLE_KEXT_OVERRIDE; + virtual void clearOutputFlowControlled() APPLE_KEXT_OVERRIDE; + virtual void outputStart(uint) APPLE_KEXT_OVERRIDE; + virtual UInt32 configureAQMOutput() APPLE_KEXT_OVERRIDE; + virtual void setUnitNumber(char const*) APPLE_KEXT_OVERRIDE; + virtual bool initIfnetEparams(ifnet_init_eparams *) APPLE_KEXT_OVERRIDE; + virtual bool attachToBpf() APPLE_KEXT_OVERRIDE; + virtual bool configureIfnet() APPLE_KEXT_OVERRIDE; + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 0); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 1); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 2); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 3); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 4); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 5); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 6); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 7); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 8); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 9); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 10); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 11); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 12); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 13); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 14); + OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 15); +public: + char buf[0x300]; +}; + +#endif /* IO80211P2PInterface_h */ diff --git a/QualcommWireless/include/IOKit/80211/IO80211SkywalkInterface.h b/QualcommWireless/include/IOKit/80211/IO80211SkywalkInterface.h new file mode 100644 index 0000000..82dc191 --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/IO80211SkywalkInterface.h @@ -0,0 +1,27 @@ +// +// IO80211SkywalkInterface.h +// IO80211Family +// +// Created by 钟先耀 on 2019/10/18. +// Copyright © 2019 钟先耀. All rights reserved. +// + +#ifndef _IO80211SKYWALK_H +#define _IO80211SKYWALK_H + +#include +#include + +// This is necessary, because even the latest Xcode does not support properly targeting 11.0. +#ifndef __IO80211_TARGET +#error "Please define __IO80211_TARGET to the requested version" +#endif + +class IO80211SkywalkInterface : IOSkywalkEthernetInterface { + OSDeclareAbstractStructors(IO80211SkywalkInterface) + +public: + +}; + +#endif /* _IO80211SKYWALK_H */ diff --git a/QualcommWireless/include/IOKit/80211/IO80211VirtualInterface.h b/QualcommWireless/include/IOKit/80211/IO80211VirtualInterface.h new file mode 100644 index 0000000..f405498 --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/IO80211VirtualInterface.h @@ -0,0 +1,101 @@ +#ifndef IO80211VirtualInterface_h +#define IO80211VirtualInterface_h + +#include "IO80211Interface.h" +#include "apple_private_spi.h" + +class IO80211PeerManager; + +class IO80211VirtualInterface : public IOService { + OSDeclareDefaultStructors(IO80211VirtualInterface) + +public: + virtual void free(void) APPLE_KEXT_OVERRIDE; +#if __IO80211_TARGET >= __MAC_11_0 + virtual bool willTerminate( IOService * provider, IOOptionBits options ) APPLE_KEXT_OVERRIDE; +#endif + virtual IOReturn configureReport(IOReportChannelList *channels, + IOReportConfigureAction action, + void *result, + void *destination) APPLE_KEXT_OVERRIDE; + virtual IOReturn updateReport(IOReportChannelList *channels, + IOReportUpdateAction action, + void *result, + void *destination) APPLE_KEXT_OVERRIDE; + virtual bool terminate( IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; + virtual bool attach(IOService *) APPLE_KEXT_OVERRIDE; + virtual void detach(IOService *) APPLE_KEXT_OVERRIDE; +#if __IO80211_TARGET >= __MAC_10_15 + virtual IOReturn newUserClient(task_t,void *,UInt,OSDictionary *,IOUserClient **) APPLE_KEXT_OVERRIDE; +#endif + virtual const char * stringFromReturn( IOReturn rtn ) APPLE_KEXT_OVERRIDE; + virtual int errnoFromReturn( IOReturn rtn ) APPLE_KEXT_OVERRIDE; + virtual IOReturn powerStateWillChangeTo( + IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService * whatDevice ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn powerStateDidChangeTo( + IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService * whatDevice ) APPLE_KEXT_OVERRIDE; + virtual bool init(IO80211Controller *,ether_addr *,uint,char const*); + virtual bool createPeerManager(ether_addr *,IO80211PeerManager **); + virtual UInt getMediumType(); + virtual void setLinkState(IO80211LinkState,uint); + virtual bool dequeueOutputPacketsWithServiceClass(uint,IOMbufServiceClass,mbuf_t*,mbuf_t*,UInt *,unsigned long long *); + virtual UInt32 outputPacket (mbuf_t m, void* param); + virtual void setEnabledBySystem(bool); + virtual void handleIoctl(unsigned long,void *); + virtual UInt32 inputPacket(mbuf_t,packet_info_tag *); + virtual IOReturn controllerWillChangePowerState(IO80211Controller *,unsigned long,UInt,IOService *); + virtual IOReturn controllerDidChangePowerState(IO80211Controller *,unsigned long,UInt,IOService *); + virtual bool handleDebugCmd(apple80211_debug_command *); + virtual IOReturn postPeerPresence(ether_addr *,int,int,int,char *); + virtual IOReturn postPeerAbsence(ether_addr *); +#if __IO80211_TARGET >= __MAC_10_15 + virtual IOReturn postPeerPresenceIPv6(ether_addr *,int,int,int,char *,unsigned char *); +#endif + virtual void signalOutputThread(); + virtual bool isOutputFlowControlled(); + virtual void setOutputFlowControlled(); + virtual void clearOutputFlowControlled(); + virtual void outputStart(uint); + virtual UInt32 configureAQMOutput(); + virtual void setUnitNumber(char const*); + virtual bool initIfnetEparams(ifnet_init_eparams *); + virtual bool attachToBpf(); + virtual bool configureIfnet(); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 0); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 1); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 2); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 3); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 4); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 5); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 6); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 7); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 8); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 9); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 10); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 11); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 12); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 13); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 14); + OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 15); +public: + + static void startOutputQueues(); + + static void stopOutputQueues(); + + static void postMessage(unsigned int, void* data = NULL, unsigned long dataLen = 0); + + static int getInterfaceRole(); + + const char *getBSDName(); +public: + char buf[0x300]; +}; + + +#endif /* IO80211VirtualInterface_h */ diff --git a/QualcommWireless/include/IOKit/80211/IO80211VirtualInterfaceNamer.h b/QualcommWireless/include/IOKit/80211/IO80211VirtualInterfaceNamer.h new file mode 100644 index 0000000..4327a55 --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/IO80211VirtualInterfaceNamer.h @@ -0,0 +1,64 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + #ifndef _IO80211VIRTUALINTERFACENAMER_H + #define _IO80211VIRTUALINTERFACENAMER_H + +#include + +class IO80211VirtualInterfaceNamer : public IOService +{ + OSDeclareDefaultStructors(IO80211VirtualInterfaceNamer) + +public: + virtual bool init() APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + bool arrayContainsUnitNumber( OSArray * array, OSNumber * unitNumber ); + bool markInterfaceUnitUsed( char const * name, UInt32 unitNumber ); + void markInterfaceUnitUnused( char const * name, UInt32 unitNumber ); + UInt32 nextAvailableUnitNumberForName( char const * name, bool markUsed ); + + IORecursiveLock * _lock; + OSDictionary * _interfaceUnits; // all OSArrays +}; + +static IO80211VirtualInterfaceNamer * _interfaceNamer; + +bool IO80211VirtualInterfaceNamerRetain(); +void IO80211VirtualInterfaceNamerRelease(); +bool IO80211VirtualInterfaceNamerMarkInterfaceUnitUsed( char const * name, UInt32 unitNumber ); +void IO80211VirtualInterfaceNamerMarkInterfaceUnitUnused( char const * name, UInt32 unitNumber ); +UInt32 IO80211VirtualInterfaceNamerNextAvailableUnitNumberForName( char const * name, bool markUsed ); + +#endif diff --git a/QualcommWireless/include/IOKit/80211/IO80211WorkLoop.h b/QualcommWireless/include/IOKit/80211/IO80211WorkLoop.h new file mode 100644 index 0000000..bf33bfd --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/IO80211WorkLoop.h @@ -0,0 +1,37 @@ +/* + * IO80211WorkLoop.h + * IO80211Family + * + * Created by Pete on 5/31/06. + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#ifndef _IO80211WORKLOOP_H +#define _IO80211WORKLOOP_H + +#include +#include + +// This is necessary, because even the latest Xcode does not support properly targeting 11.0. +#ifndef __IO80211_TARGET +#error "Please define __IO80211_TARGET to the requested version" +#endif + +class IO80211WorkLoop : public IOWorkLoop +{ + OSDeclareDefaultStructors( IO80211WorkLoop ) + +public: + + static IO80211WorkLoop * workLoop(); + + virtual void openGate() APPLE_KEXT_OVERRIDE; + virtual void closeGate() APPLE_KEXT_OVERRIDE; + virtual int sleepGate( void * event, UInt32 interuptibleType ) APPLE_KEXT_OVERRIDE; + virtual int sleepGateDeadline( void * event, UInt32 interuptibleType, AbsoluteTime deadline ); + virtual void wakeupGate( void * event, bool oneThread ) APPLE_KEXT_OVERRIDE; + +}; + +#endif diff --git a/QualcommWireless/include/IOKit/80211/IOSkywalkEthernetInterface.h b/QualcommWireless/include/IOKit/80211/IOSkywalkEthernetInterface.h new file mode 100644 index 0000000..6670ff6 --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/IOSkywalkEthernetInterface.h @@ -0,0 +1,13 @@ +#ifndef IOSkywalkEthernetInterface_h +#define IOSkywalkEthernetInterface_h + +#include + +class IOSkywalkEthernetInterface : public IOEthernetController { + OSDeclareAbstractStructors( IOSkywalkEthernetInterface ) + +public: + +}; + +#endif /* IOSkywalkEthernetInterface_h */ diff --git a/QualcommWireless/include/IOKit/80211/apple80211_ioctl.h b/QualcommWireless/include/IOKit/80211/apple80211_ioctl.h new file mode 100644 index 0000000..55fb450 --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/apple80211_ioctl.h @@ -0,0 +1,850 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _APPLE80211_IOCTL_H_ +#define _APPLE80211_IOCTL_H_ + +#include +#include +#include +#include +#include +#include + +// This is necessary, because even the latest Xcode does not support properly targeting 11.0. +#ifndef __IO80211_TARGET +#error "Please define __IO80211_TARGET to the requested version" +#endif + +#include + +struct apple80211req +{ + char req_if_name[IFNAMSIZ]; // 16 bytes + int req_type; // 4 bytes + int req_val; // 4 bytes + u_int32_t req_len; // 4 bytes + void *req_data; // 4 bytes +}; + +#define SIOCSA80211 2150656456 +#define SIOCGA80211 3224398281 + +// req_type + +#define APPLE80211_IOC_SSID 1 // req_type + +#define APPLE80211_IOC_AUTH_TYPE 2 // req_type +#define APPLE80211_AUTH_TYPE_UNICAST 1 // req_val, SIOCGA80211 only +#define APPLE80211_AUTH_TYPE_MULTICAST 2 // req_val, SIOCGA80211 only + +#define APPLE80211_IOC_CIPHER_KEY 3 // req_type +#define APPLE80211_CIPHER_KEY_UNICAST 1 // req_val +#define APPLE80211_CIPHER_KEY_MULICAST 2 // req_val + +#define APPLE80211_IOC_CHANNEL 4 // req_type + +#define APPLE80211_IOC_POWERSAVE 5 // req_type + +#define APPLE80211_IOC_PROTMODE 6 // req_type + +#define APPLE80211_IOC_TXPOWER 7 // req_type +#define APPLE80211_IOC_RATE 8 // req_type +#define APPLE80211_IOC_BSSID 9 // req_type + +#define APPLE80211_IOC_SCAN_REQ 10 // req_type + +#define APPLE80211_IOC_SCAN_RESULT 11 // req_type + +#define APPLE80211_IOC_CARD_CAPABILITIES 12 // req_type + +#define APPLE80211_IOC_STATE 13 // req_type (apple80211_state) +#define APPLE80211_IOC_PHY_MODE 14 // req_type (apple80211_phymode) + +#define APPLE80211_IOC_OP_MODE 15 // req_type (apple80211_opmode) +#define APPLE80211_IOC_RSSI 16 // req_type +#define APPLE80211_IOC_NOISE 17 // req_type + +#define APPLE80211_IOC_INT_MIT 18 +#define APPLE80211_IOC_INT_MIT_OFF 1 // req_val +#define APPLE80211_IOC_INT_MIT_ON 2 // req_val + +// card power +#define APPLE80211_IOC_POWER 19 // req_type + +#define APPLE80211_IOC_ASSOCIATE 20 // req_type +#define APPLE80211_IOC_ASSOCIATE_RESULT 21 // req_type +#define APPLE80211_IOC_DISASSOCIATE 22 // req_type +#define APPLE80211_IOC_STATUS_DEV_NAME 23 // req_type + +#define APPLE80211_IOC_IBSS_MODE 24 // req_type +#define APPLE80211_IOC_IBSS_MODE_START 1 // req_val +#define APPLE80211_IOC_IBSS_MODE_STOP 2 // req_val + +#define APPLE80211_IOC_HOST_AP_MODE 25 // req_type +#define APPLE80211_IOC_HOST_AP_MODE_START 1 // req_val +#define APPLE80211_IOC_HOST_AP_MODE_STOP 2 // req_val + +#define APPLE80211_IOC_AP_MODE 26 // req_type (apple80211_apmode) +#define APPLE80211_IOC_SUPPORTED_CHANNELS 27 // req_type +#define APPLE80211_IOC_LOCALE 28 // req_type +#define APPLE80211_IOC_DEAUTH 29 // req_type +#define APPLE80211_IOC_COUNTERMEASURES 30 // req_type +#define APPLE80211_IOC_FRAG_THRESHOLD 31 // req_type +#define APPLE80211_IOC_RATE_SET 32 // req_type +#define APPLE80211_IOC_SHORT_SLOT 33 // req_type +#define APPLE80211_IOC_MULTICAST_RATE 34 // req_type +#define APPLE80211_IOC_SHORT_RETRY_LIMIT 35 // req_type +#define APPLE80211_IOC_LONG_RETRY_LIMIT 36 // req_type +#define APPLE80211_IOC_TX_ANTENNA 37 // req_type +#define APPLE80211_IOC_RX_ANTENNA 38 // req_type +#define APPLE80211_IOC_ANTENNA_DIVERSITY 39 // req_type +#define APPLE80211_IOC_ROM 40 // req_type +#define APPLE80211_IOC_DTIM_INT 41 // req_type +#define APPLE80211_IOC_STATION_LIST 42 // req_type +#define APPLE80211_IOC_DRIVER_VERSION 43 // req_type +#define APPLE80211_IOC_HARDWARE_VERSION 44 // req_type +#define APPLE80211_IOC_RAND 45 // req_type +#define APPLE80211_IOC_RSN_IE 46 // req_type +#define APPLE80211_IOC_BACKGROUND_SCAN 47 // req_type +#define APPLE80211_IOC_AP_IE_LIST 48 // req_type +#define APPLE80211_IOC_STATS 49 // req_type +#define APPLE80211_IOC_ASSOCIATION_STATUS 50 // req_type +#define APPLE80211_IOC_COUNTRY_CODE 51 // req_type +#define APPLE80211_IOC_DEBUG_FLAGS 52 // req_type +#define APPLE80211_IOC_LAST_RX_PKT_DATA 53 // req_type +#define APPLE80211_IOC_RADIO_INFO 54 // req_type +#define APPLE80211_IOC_GUARD_INTERVAL 55 // req_type +#define APPLE80211_IOC_MIMO_POWERSAVE 56 // req_type +#define APPLE80211_IOC_MCS 57 // req_type +#define APPLE80211_IOC_RIFS 58 // req_type +#define APPLE80211_IOC_LDPC 59 // req_type +#define APPLE80211_IOC_MSDU 60 // req_type +#define APPLE80211_IOC_MPDU 61 // req_type +#define APPLE80211_IOC_BLOCK_ACK 62 // req_type +#define APPLE80211_IOC_PLS 63 // req_type +#define APPLE80211_IOC_PSMP 64 // req_type +#define APPLE80211_IOC_PHY_SUB_MODE 65 // req_type +#define APPLE80211_IOC_MCS_INDEX_SET 66 // req_type +#define APPLE80211_IOC_CACHE_THRESH_BCAST 67 // req_type +#define APPLE80211_IOC_CACHE_THRESH_DIRECT 68 // req_type +#define APPLE80211_IOC_WOW_PARAMETERS 69 // req_type +#define APPLE80211_IOC_WOW_ENABLED 70 // req_type +#define APPLE80211_IOC_40MHZ_INTOLERANT 71 // req_type +#define APPLE80211_IOC_PID_LOCK 72 +#define APPLE80211_IOC_STA_IE_LIST 73 +#define APPLE80211_IOC_STA_AUTHORIZE 74 +#define APPLE80211_IOC_STA_DISASSOCIATE 75 +#define APPLE80211_IOC_STA_DEAUTH 76 +#define APPLE80211_IOC_RSN_CONF 77 +#define APPLE80211_IOC_KEY_RSC 78 +#define APPLE80211_IOC_STA_STATS 79 +#define APPLE80211_IOC_ROAM_THRESH 80 +#define APPLE80211_IOC_VENDOR_DBG_FLAGS 81 +#define APPLE80211_IOC_CACHE_AGE_THRESH 82 +#define APPLE80211_IOC_PMK_CACHE 83 +#define APPLE80211_IOC_LINK_QUAL_EVENT_PARAMS 84 +#define APPLE80211_IOC_IE 85 +#define APPLE80211_IOC_SCAN_REQ_MULTIPLE 86 +#define APPLE80211_IOC_BTCOEX_MODE 87 +#define APPLE80211_IOC_WOW_TEST 88 +#define APPLE80211_IOC_CLEAR_PMK_CACHE 89 +#define APPLE80211_IOC_SCANCACHE_CLEAR 90 +#define APPLE80211_IOC_P2P_ENABLE 91 +#define APPLE80211_IOC_P2P_LISTEN 92 +#define APPLE80211_IOC_P2P_SCAN 93 +#define APPLE80211_IOC_VIRTUAL_IF_CREATE 94 +#define APPLE80211_IOC_VIRTUAL_IF_DELETE 95 +#define APPLE80211_IOC_VIRTUAL_IF_ROLE 96 +#define APPLE80211_IOC_VIRTUAL_IF_PARENT 97 +#define APPLE80211_IOC_P2P_GO_CONF 98 +#define APPLE80211_IOC_P2P_NOA_LIST 99 +#define APPLE80211_IOC_P2P_OPP_PS 100 +#define APPLE80211_IOC_P2P_CT_WINDOW 101 +#define APPLE80211_IOC_BT_COEX_FLAGS 102 +#define APPLE80211_IOC_CURRENT_NETWORK 103 +#define APPLE80211_IOC_BT_POWER 104 +#define APPLE80211_IOC_AVAILABILITY 105 +#define APPLE80211_IOC_RSSI_BOUNDS 106 +#define APPLE80211_IOC_ROAM 107 +#define APPLE80211_IOC_TX_CHAIN_POWER 108 +#define APPLE80211_IOC_CDD_MODE 109 +#define APPLE80211_IOC_LAST_BCAST_SCAN_TIME 110 +#define APPLE80211_IOC_THERMAL_THROTTLING 111 +#define APPLE80211_IOC_FACTORY_MODE 112 +#define APPLE80211_IOC_REASSOCIATE 113 + +#define APPLE80211_IOC_POWER_DEBUG_INFO 115 +#define APPLE80211_IOC_AWDL_SYNC_PARAMS 116 +#define APPLE80211_IOC_AWDL_SYNC_ENABLED 117 +#define APPLE80211_IOC_AWDL_EXTENSION_STATE_MACHINE_PARAMETERS 118 +#define APPLE80211_IOC_AWDL_SERVICE_PARAMS 119 +#define APPLE80211_IOC_AWDL_PEER_SERVICE_REQUEST 120 +#define APPLE80211_IOC_AWDL_ELECTION_ALGORITHM_ENABLED 121 +#define APPLE80211_IOC_AWDL_ELECTION_ID 122 +#define APPLE80211_IOC_AWDL_MAX_TREE_DEPTH 123 +#define APPLE80211_IOC_AWDL_GUARD_TIME 124 +#define APPLE80211_IOC_AWDL_BSSID 125 +#define APPLE80211_IOC_AWDL_ELECTION_METRIC 126 +#define APPLE80211_IOC_AWDL_AVAILABILITY_WINDOW_AP_ALIGNMENT 127 +#define APPLE80211_IOC_AWDL_SYNC_FRAME_AP_BEACON_ALIGNMENT 128 +#define APPLE80211_IOC_AWDL_SYNCHRONIZATION_CHANNEL_SEQUENCE 129 +#define APPLE80211_IOC_PEER_CACHE_MAXIMUM_SIZE 130 +#define APPLE80211_IOC_AWDL_OUI 131 +#define APPLE80211_IOC_AWDL_MASTER_CHANNEL 132 +#define APPLE80211_IOC_AWDL_TOP_MASTER 133 +#define APPLE80211_IOC_AWDL_SYNC_STATE 134 +#define APPLE80211_IOC_AWDL_ELECTION_RSSI_THRESHOLDS 135 +#define APPLE80211_IOC_AWDL_PRESENCE_MODE 136 +#define APPLE80211_IOC_AWDL_ELECTION_MASTER_COUNTS 137 +#define APPLE80211_IOC_AWDL_PERIODIC_SYNC_FRAME_PACKET_LIFETIME 138 +#define APPLE80211_IOC_AWDL_MASTER_MODE_SYNC_FRAME_PERIOD 139 +#define APPLE80211_IOC_AWDL_NON_ELECTION_MASTER_MODE_SYNC_FRAME_PERIOD 140 +#define APPLE80211_IOC_AWDL_EXPLICIT_AVAILABILITY_WINDOW_EXTENSION_OPT_OUT 141 +#define APPLE80211_IOC_AWDL_GET_AWDL_MASTER_DATABASE 142 +#define APPLE80211_IOC_PEER_CACHE_CONTROL 143 +#define APPLE80211_IOC_AWDL_BATTERY_LEVEL 144 +#define APPLE80211_IOC_AWDL_BT_COEX_AW_PROTECTED_PERIOD_LENGTH 145 +#define APPLE80211_IOC_AWDL_BT_COEX_AGREEMENT 146 +#define APPLE80211_IOC_AWDL_BT_COEX_AGREEMENT_ENABLED 147 +#define APPLE80211_IOC_AWDL_STRATEGY 148 +#define APPLE80211_IOC_AWDL_OOB_REQUEST 149 +#define APPLE80211_IOC_AWDL_MAX_NO_MASTER_PERIODS 150 +#define APPLE80211_IOC_AWDL_SYNC_FRAME_TEMPLATE 151 +#define APPLE80211_IOC_LOG_FLAGS 152 +#define APPLE80211_IOC_PEER_STATS 153 +#define APPLE80211_IOC_HT_CAPABILITY 154 +#define APPLE80211_IOC_AWDL_ELECTION_PARAMS 155 +#define APPLE80211_IOC_LINK_CHANGED_EVENT_DATA 156 +#define APPLE80211_IOC_GET_DEBUG_INFO 157 +#define APPLE80211_IOC_AWDL_DEVICE_CAPABILITIES 158 +#define APPLE80211_IOC_AWDL_RSSI_MEASUREMENT_REQUEST 159 +#define APPLE80211_IOC_AWDL_AES_KEY 160 +#define APPLE80211_IOC_AWDL_SCAN_RESERVED_TIME 161 +#define APPLE80211_IOC_AWDL_CTL 162 +#define APPLE80211_IOC_AWDL_SOCIAL_TIME_SLOTS 163 +#define APPLE80211_IOC_AWDL_PEER_TRAFFIC_REGISTRATION 164 +#define APPLE80211_IOC_EXTENDED_STATS 165 +#define APPLE80211_IOC_BEACON_PERIOD 166 +#define APPLE80211_IOC_AWDL_FORCED_ROAM_CONFIG 167 +#define APPLE80211_IOC_AWDL_QUIET 168 +#define APPLE80211_IOC_ACL_POLICY 169 +#define APPLE80211_IOC_ACL_ADD 170 +#define APPLE80211_IOC_ACL_REMOVE 171 +#define APPLE80211_IOC_ACL_FLUSH 172 +#define APPLE80211_IOC_ACL_LIST 173 +#define APPLE80211_IOC_CHAIN_ACK 174 +#define APPLE80211_IOC_DESENSE 175 +#define APPLE80211_IOC_OFFLOAD_SCANNING 176 +#define APPLE80211_IOC_OFFLOAD_RSN 177 +#define APPLE80211_IOC_OFFLOAD_COUNTRY_CODE 178 +#define APPLE80211_IOC_OFFLOAD_KEEPALIVE_L2 179 +#define APPLE80211_IOC_OFFLOAD_ARP_NDP 180 +#define APPLE80211_IOC_VHT_MCS_INDEX_SET 181 +#define APPLE80211_IOC_DWDS 182 +#define APPLE80211_IOC_INTERRUPT_STATS 183 +#define APPLE80211_IOC_INTERRUPT_STATS_RESET 184 +#define APPLE80211_IOC_TIMER_STATS 185 +#define APPLE80211_IOC_TIMER_STATS_RESET 186 +#define APPLE80211_IOC_OFFLOAD_STATS 187 +#define APPLE80211_IOC_OFFLOAD_STATS_RESET 188 +#define APPLE80211_IOC_OFFLOAD_BEACONS 189 +#define APPLE80211_IOC_ROAMING 190 +#define APPLE80211_IOC_OFFLOAD_ARP 191 +#define APPLE80211_IOC_OFFLOAD_NDP 192 +#define APPLE80211_IOC_OFFLOAD_SCAN 193 +#define APPLE80211_IOC_DESENSE_LEVEL 194 +#define APPLE80211_IOC_MCS_VHT 195 +#define APPLE80211_IOC_TX_NSS 196 +#define APPLE80211_IOC_GAS_REQ 197 +#define APPLE80211_IOC_GAS_START 198 +#define APPLE80211_IOC_GAS_SET_PEER 199 +#define APPLE80211_IOC_GAS_RESULTS 200 +#define APPLE80211_IOC_AWDL_BTLE_PEER_INDICATION 201 +#define APPLE80211_IOC_AWDL_BTLE_STATE_PARAMS 202 +#define APPLE80211_IOC_AWDL_PEER_DATABASE 203 +#define APPLE80211_IOC_AWDL_BTLE_ENABLE_SYNC_WITH_PARAMS 204 +#define APPLE80211_IOC_AWDL_SECONDARY_MASTER_CHANNEL 205 +#define APPLE80211_IOC_PHY_STATS 206 +#define APPLE80211_IOC_CHANNELS_INFO 207 +#define APPLE80211_IOC_AWDL_AF_TX_MODE 208 +#define APPLE80211_IOC_ERROR_STRING 209 +#define APPLE80211_IOC_ERROR_NO 210 +#define APPLE80211_IOC_AWDL_PIGGYBACK_SCAN_REQ 211 +#define APPLE80211_IOC_AWDL_PRIVATE_ELECTION_ID 212 +#define APPLE80211_IOC_AWDL_MIN_RATE 213 +#define APPLE80211_IOC_VHT_CAPABILITY 214 +#define APPLE80211_IOC_BGSCAN_CACHE_RESULTS 215 +#define APPLE80211_IOC_ROAM_PROFILE 216 +#define APPLE80211_IOC_AWDL_OPER_MODE 217 +#define APPLE80211_IOC_RESTORE_DEFAULTS 218 +#define APPLE80211_IOC_AWDL_ENCRYPTION_KEYS 219 +#define APPLE80211_IOC_AWDL_ENCRYPTION_TYPE 220 +#define APPLE80211_IOC_BTCOEX_PROFILES 221 +#define APPLE80211_IOC_BTCOEX_CONFIG 222 +#define APPLE80211_IOC_AWDL_STATISTICS 223 +#define APPLE80211_IOC_AWDL_ENABLE_ROAMING 224 +#define APPLE80211_IOC_AWDL_OOB_AUTO_REQUEST 225 +#define APPLE80211_IOC_AWDL_TXCAL_PERIOD 226 +#define APPLE80211_IOC_CHIP_COUNTER_STATS 227 +#define APPLE80211_IOC_DBG_GUARD_TIME_PARAMS 228 +#define APPLE80211_IOC_AWDL_AWDL_ADVERTISERS 229 +#define APPLE80211_IOC_LEAKY_AP_STATS_MODE 230 +#define APPLE80211_IOC_CAPTURE 231 +#define APPLE80211_IOC_LEAKY_AP_STATS 232 +#define APPLE80211_IOC_AWDL_BLOCK_SET_COMMANDS 233 +#define APPLE80211_IOC_LEAKY_AP_AWD_MODE 234 +#define APPLE80211_IOC_BTCOEX_OPTIONS 235 +#define APPLE80211_IOC_FORCE_SYNC_TO_PEER 236 +#define APPLE80211_IOC_COUNTRY_CHANNELS 237 +#define APPLE80211_IOC_PRIVATE_MAC 238 +#define APPLE80211_IOC_RESET_CHIP 239 +#define APPLE80211_IOC_CRASH 240 +#define APPLE80211_IOC_RANGING_ENABLE 241 +#define APPLE80211_IOC_RANGING_START 242 +#define APPLE80211_IOC_RANGING_AUTHENTICATE 243 +#define APPLE80211_IOC_AWDL_PREFERRED_CHANNELS 244 +#define APPLE80211_IOC_LEAKY_AP_SSID_STATS 245 +#define APPLE80211_IOC_AWDL_RSDB_CAPS 246 +#define APPLE80211_IOC_AWDL_DEV_STATS 247 +#define APPLE80211_IOC_LAST_ASSOC_HISTORY 248 +#define APPLE80211_IOC_AWDL_COMMON_CHANNEL 249 +#define APPLE80211_IOC_AWDL_PEERS_INFO 250 +#define APPLE80211_IOC_TKO_PARAMS 251 +#define APPLE80211_IOC_TKO_DUMP 252 +#define APPLE80211_IOC_AWDL_NEARBY_LOG_TRIGGER 253 +#define APPLE80211_IOC_HW_SUPPORTED_CHANNELS 254 +#define APPLE80211_IOC_BTCOEX_PROFILE 255 +#define APPLE80211_IOC_BTCOEX_PROFILE_ACTIVE 256 +#define APPLE80211_IOC_TRAP_INFO 257 +#define APPLE80211_IOC_THERMAL_INDEX 258 +#define APPLE80211_IOC_MAX_NSS_FOR_AP 259 +#define APPLE80211_IOC_BTCOEX_2G_CHAIN_DISABLE 260 +#define APPLE80211_IOC_POWER_BUDGET 261 +#define APPLE80211_IOC_AWDL_DFSP_CONFIG 262 +#define APPLE80211_IOC_AWDL_DFSP_UCSA_CONFIG 263 +#define APPLE80211_IOC_SCAN_BACKOFF_REPORT 264 +#define APPLE80211_IOC_OFFLOAD_TCPKA_ENABLE 265 +#define APPLE80211_IOC_RANGING_CAPS 266 +#define APPLE80211_IOC_PER_CORE_RSSI_REPORT 267 +#define APPLE80211_IOC_NSS 353 + +#define APPLE80211_IOC_CARD_SPECIFIC 0xffffffff // req_type + +// Kernel interface + +// Bump this value when structures change +#define APPLE80211_VERSION 1 + +struct apple80211_ssid_data +{ + u_int32_t version; + u_int32_t ssid_len; + u_int8_t ssid_bytes[APPLE80211_MAX_SSID_LEN]; +}; + +struct apple80211_virt_if_create_data { + uint32_t version; + uint8_t mac[APPLE80211_ADDR_LEN]; + uint16_t unk1; + uint32_t role; + uint8_t bsd_name[15]; +} __attribute__((packed)); + +struct apple80211_virt_if_delete_data { + uint32_t version; + uint8_t bsd_name[15]; +} __attribute__((packed)); + +struct apple80211_ht_capability { + uint32_t version; + uint8_t unk1; + uint8_t unk2; + uint16_t unk3; + uint8_t unk4; + uint8_t unk5[16]; + uint16_t unk6; + uint unk7; + uint8_t unk8; +} __attribute__((packed)); + +struct apple80211_channel_data +{ + u_int32_t version; + struct apple80211_channel channel; +}; + +struct apple80211_bssid_data +{ + u_int32_t version; + struct ether_addr bssid; +}; + +struct apple80211_capability_data +{ + u_int32_t version; + u_int8_t capabilities[11]; +}; + +struct apple80211_state_data +{ + u_int32_t version; + u_int32_t state; +}; + +struct apple80211_rssi_data +{ + u_int32_t version; + u_int32_t num_radios; + u_int32_t rssi_unit; + int32_t rssi[APPLE80211_MAX_RADIO]; // control channel + int32_t aggregate_rssi; // aggregate control channel rssi + int32_t rssi_ext[APPLE80211_MAX_RADIO]; // extension channel rssi + int32_t aggregate_rssi_ext; // aggregate extension channel rssi +}; + +struct apple80211_power_data +{ + u_int32_t version; + u_int32_t num_radios; + u_int32_t power_state[APPLE80211_MAX_RADIO]; +}; + +struct apple80211_assoc_result_data +{ + u_int32_t version; + u_int32_t result; +}; + +struct apple80211_assoc_status_data +{ + u_int32_t version; + u_int32_t status; +}; + +struct apple80211_rate_data +{ + u_int32_t version; + u_int32_t num_radios; + u_int32_t rate[APPLE80211_MAX_RADIO]; +}; + +struct apple80211_status_dev_data +{ + u_int32_t version; + u_int8_t dev_name[MAXPATHLEN]; +}; + +struct apple80211_powersave_data +{ + u_int32_t version; + u_int32_t powersave_level; +}; + +struct apple80211_protmode_data +{ + u_int32_t version; + u_int32_t protmode; + u_int32_t threshold; // bytes +}; + +struct apple80211_txpower_data +{ + u_int32_t version; + u_int32_t txpower_unit; + int32_t txpower; +}; + +struct apple80211_phymode_data +{ + u_int32_t version; + u_int32_t phy_mode; // vector of supported phy modes + u_int32_t active_phy_mode; // current active phy mode +}; + +struct apple80211_opmode_data +{ + u_int32_t version; + u_int32_t op_mode; +}; + +struct apple80211_noise_data +{ + u_int32_t version; + u_int32_t num_radios; + u_int32_t noise_unit; + int32_t noise[APPLE80211_MAX_RADIO]; // control channel + int32_t aggregate_noise; // aggregate control channel noise + int32_t noise_ext[APPLE80211_MAX_RADIO]; // extension channel noise + int32_t aggregate_noise_ext; // aggregate extension channel noise +}; + +struct apple80211_intmit_data +{ + u_int32_t version; + u_int32_t int_mit; +}; + +struct apple80211_authtype_data +{ + u_int32_t version; + u_int32_t authtype_lower; // apple80211_authtype_lower + u_int32_t authtype_upper; // apple80211_authtype_upper +}; + +struct apple80211_sup_channel_data +{ + u_int32_t version; + u_int32_t num_channels; + struct apple80211_channel supported_channels[APPLE80211_MAX_CHANNELS]; +}; + + +struct apple80211_roam_threshold_data +{ + u_int32_t threshold; + u_int32_t count; +}; + +struct apple80211_locale_data +{ + u_int32_t version; + u_int32_t locale; +}; + +struct apple80211_scan_data +{ + u_int32_t version; + u_int32_t bss_type; // apple80211_apmode + struct ether_addr bssid; // target BSSID + u_int32_t ssid_len; // length of the SSID + u_int8_t ssid[APPLE80211_MAX_SSID_LEN]; // direct scan ssid or AirDrop scan ssid like "Air-xxxx" + u_int32_t scan_type; // apple80211_scan_type + u_int32_t phy_mode; // apple80211_phymode vector + u_int16_t dwell_time; // time to spend on each channel (ms) + u_int32_t rest_time; // time between scanning each channel (ms) + u_int32_t num_channels; // 0 if not passing in channels + struct apple80211_channel channels[APPLE80211_MAX_CHANNELS]; // channel list +}; + +struct apple80211_scan_multiple_data +{ + uint32_t version; + uint32_t ap_mode; // apple80211_apmode + uint32_t ssid_count; + apple80211_ssid_data ssids[16]; + uint32_t bssid_count; + ether_addr bssids[16]; + uint32_t scan_type; + uint32_t phy_mode; + uint32_t dwell_time; + uint32_t rest_time; + uint32_t num_channels; + struct apple80211_channel channels[128]; + uint16_t unk_2; +}; + +struct apple80211_link_changed_event_data +{ + bool isLinkDown; // 0 + uint32_t rssi; // 4 + uint16_t snr; // 8 + uint16_t nf; // 10 + char cca; // 12 + bool voluntary; // 16 + uint32_t reason; // 20 +}; + +struct apple80211_apmode_data +{ + u_int32_t version; + u_int32_t apmode; +}; + +struct apple80211_assoc_data +{ + u_int32_t version; + u_int16_t ad_mode; // apple80211_apmode + u_int16_t ad_auth_lower; // apple80211_authtype_lower + u_int16_t ad_auth_upper; // apple80211_authtype_upper + u_int32_t ad_ssid_len; + u_int8_t ad_ssid[ APPLE80211_MAX_SSID_LEN ]; + struct ether_addr ad_bssid; // prefer over ssid if not zeroed + struct apple80211_key ad_key; + uint16_t pad; + u_int8_t ad_rsn_ie[ APPLE80211_MAX_RSN_IE_LEN ]; + u_int32_t ad_flags; // apple80211_assoc_flags +}; + +static_assert(offsetof(apple80211_assoc_data, ad_rsn_ie) == 206, "offsetof(apple80211_assoc_data, ad_rsn_ie)"); + +struct apple80211_deauth_data +{ + u_int32_t version; + u_int32_t deauth_reason; // reason code + struct ether_addr deauth_ea; // BSSID of AP +}; + +struct apple80211_countermeasures_data +{ + u_int32_t version; + u_int32_t enabled; +}; + +struct apple80211_frag_threshold_data +{ + u_int32_t version; + u_int32_t threshold; // bytes +}; + +struct apple80211_rate_set_data +{ + u_int32_t version; + u_int16_t num_rates; + struct apple80211_rate rates[APPLE80211_MAX_RATES]; +}; + +struct apple80211_short_slot_data +{ + u_int32_t version; + u_int8_t mode; +}; + +struct apple80211_retry_limit_data +{ + u_int32_t version; + u_int32_t limit; +}; + +struct apple80211_antenna_data +{ + u_int32_t version; + u_int32_t num_radios; + int32_t antenna_index[APPLE80211_MAX_RADIO]; +}; + +struct apple80211_dtim_int_data +{ + u_int32_t version; + u_int32_t interval; +}; + +struct apple80211_sta_data +{ + u_int32_t version; + u_int32_t num_stations; + struct apple80211_station station_list[APPLE80211_MAX_STATIONS]; +}; + +struct apple80211_version_data +{ + u_int32_t version; + u_int16_t string_len; + char string[APPLE80211_MAX_VERSION_LEN]; +}; + +struct apple80211_rom_data +{ + u_int32_t version; + u_int32_t rom_len; + u_int8_t rom[1]; // variable length +}; + +struct apple80211_rand_data +{ + u_int32_t version; + u_int32_t rand; +}; + +struct apple80211_rsn_ie_data +{ + u_int32_t version; + u_int16_t len; + u_int8_t ie[ APPLE80211_MAX_RSN_IE_LEN ]; +}; + +struct apple80211_ap_ie_data +{ + u_int32_t version; + u_int32_t len; + u_int8_t *ie_data; +}; + +struct apple80211_stats_data +{ + u_int32_t version; + u_int32_t tx_frame_count; + u_int32_t tx_errors; + u_int32_t rx_frame_count; + u_int32_t rx_errors; +}; + +struct apple80211_country_code_data +{ + u_int32_t version; + u_int8_t cc[APPLE80211_MAX_CC_LEN]; +}; + +struct apple80211_last_rx_pkt_data +{ + u_int32_t version; + u_int32_t rate; + int32_t rssi; + u_int32_t num_streams; // number of spatial streams + struct ether_addr sa; // source address +}; + +struct apple80211_radio_info_data +{ + u_int32_t version; + u_int32_t count; // number of rf chains +}; + +struct apple80211_guard_interval_data +{ + u_int32_t version; + u_int32_t interval; // apple80211_guard_interval +}; + +struct apple80211_mcs_data +{ + u_int32_t version; + u_int32_t index; // 0 to APPLE80211_MAX_MCS_INDEX +}; + +struct apple80211_rifs_data +{ + u_int32_t version; + u_int32_t enabled; +}; + +struct apple80211_ldpc_data +{ + u_int32_t version; + u_int32_t enabled; +}; + +struct apple80211_msdu_data +{ + u_int32_t version; + u_int32_t max_length; // 3839 or 7935 bytes +}; + +struct apple80211_mpdu_data +{ + u_int32_t version; + u_int32_t max_factor; // 0 - APPLE80211_MAX_MPDU_FACTOR + u_int32_t max_density; // 0 - APPLE80211_MAX_MPDU_DENSITY +}; + +struct apple80211_block_ack_data +{ + u_int32_t version; + u_int8_t ba_enabled; // block ack enabled + u_int8_t immediate_ba_enabled; // immediate block ack enabled + u_int8_t cbba_enabled; // compressed bitmap block ack enabled + u_int8_t implicit_ba_enabled; // implicit block ack enabled +}; + +struct apple80211_pls_data +{ + u_int32_t version; + u_int32_t enabled; // phy level spoofing enabled +}; + +struct apple80211_psmp_data +{ + u_int32_t version; + u_int32_t enabled; +}; + +struct apple80211_physubmode_data +{ + u_int32_t version; + u_int32_t phy_mode; // one apple80211_phymode + u_int32_t phy_submode; // one apple80211_physubmode + u_int32_t flags; // apple80211_channel_flag vector +}; + +struct apple80211_mcs_index_set_data +{ + u_int32_t version; + u_int8_t mcs_set_map[APPLE80211_MAP_SIZE( APPLE80211_MAX_MCS_INDEX + 1 )]; +}; + +struct apple80211_wow_parameter_data +{ + u_int32_t version; + u_int8_t wake_cond_map[APPLE80211_MAP_SIZE( APPLE80211_MAX_WAKE_COND + 1 )]; + u_int32_t beacon_loss_time; + u_int32_t pattern_count; + struct apple80211_wow_pattern patterns[APPLE80211_MAX_WOW_PATTERNS]; +}; + +struct apple80211_40mhz_intolerant_data +{ + u_int32_t version; + u_int32_t enabled; // bit enabled or not +}; + +struct apple80211_tx_nss_data +{ + uint32_t version; + uint8_t nss; +}; + +struct apple80211_nss_data +{ + uint32_t version; + uint8_t nss; +}; + +struct apple80211_awdl_peer_traffic_registration +{ + uint32_t version; + void *addr; + uint32_t name_len; + char name[152]; + uint32_t active; +} __attribute__((packed)); + +struct apple80211_awdl_election_metric +{ + uint32_t version; + uint32_t metric; +} __attribute__((packed)); + +struct apple80211_awdl_sync_enabled +{ + uint32_t version; + uint32_t unk1; + uint32_t enabled; +} __attribute__((packed)); + +struct apple80211_awdl_sync_frame_template +{ + uint32_t version; + uint32_t payload_len; + void *payload; +} __attribute__((packed)); + +#endif // _APPLE80211_IOCTL_H_ + diff --git a/QualcommWireless/include/IOKit/80211/apple80211_var.h b/QualcommWireless/include/IOKit/80211/apple80211_var.h new file mode 100644 index 0000000..186760b --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/apple80211_var.h @@ -0,0 +1,645 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _APPLE80211_VAR_H_ +#define _APPLE80211_VAR_H_ + +#include +#include +#include +#include + +// This is necessary, because even the latest Xcode does not support properly targeting 11.0. +#ifndef __IO80211_TARGET +#error "Please define __IO80211_TARGET to the requested version" +#endif + +// Sizes and limits +#define APPLE80211_ADDR_LEN 6 +#define APPLE80211_MAX_RATES 15 +#define APPLE80211_MAX_SSID_LEN 32 +#define APPLE80211_MAX_ANTENNAE 4 +#define APPLE80211_MAX_RADIO 4 +#define APPLE80211_MAX_CHANNELS 64 +#define APPLE80211_MAX_STATIONS 128 +#define APPLE80211_MAX_VERSION_LEN 256 +#define APPLE80211_MAX_ROM_SIZE 32768 // 32 KB +#define APPLE80211_MAX_RSN_IE_LEN 257 // 255 + type and length bytes +#define APPLE80211_MAX_CC_LEN 3 +#define APPLE80211_MAX_MCS_INDEX 76 +#define APPLE80211_MAX_MPDU_FACTOR 3 +#define APPLE80211_MAX_MPDU_DENSITY 7 +#define APPLE80211_MAX_WOW_PAT_LEN 1500 // Max wake on wireless pattern length +#define APPLE80211_MAX_WOW_PATTERNS 12 // Arbitrary..this can change + +#define APPLE80211_MAP_SIZE( _bits ) (roundup( _bits, NBBY )/NBBY) + +enum apple80211_phymode { + APPLE80211_MODE_UNKNOWN = 0, + APPLE80211_MODE_AUTO = 1, // autoselect + APPLE80211_MODE_11A = 2 << (1 - 1), // 5GHz, OFDM + APPLE80211_MODE_11B = 2 << (2 - 1), // 2GHz, CCK + APPLE80211_MODE_11G = 2 << (3 - 1), // 2GHz, OFDM + APPLE80211_MODE_11N = 2 << (4 - 1), // 2GHz/5GHz, OFDM + APPLE80211_MODE_TURBO_A = 2 << (5 - 1), // 5GHz, OFDM, 2x clock + APPLE80211_MODE_TURBO_G = 2 << (6 - 1), // 2GHz, OFDM, 2x clock + APPLE80211_MODE_11AC = 2 << (7 - 1), + APPLE80211_MODE_11AX = 2 << (8 - 1), +}; + +enum apple80211_physubmode { + APPLE80211_SUBMODE_UNKNOWN = 0x0, + APPLE80211_SUBMODE_11N_AUTO = 0x1, // 11n mode determined by AP capabilities + APPLE80211_SUBMODE_11N_LEGACY = 0x2, // legacy + APPLE80211_SUBMODE_11N_LEGACY_DUP = 0x4, // legacy duplicate + APPLE80211_SUBMODE_11N_HT = 0x8, // high throughput + APPLE80211_SUBMODE_11N_HT_DUP = 0x10, // high throughput duplicate + APPLE80211_SUBMODE_11N_GF = 0x20, // green field +}; + +// flags +enum apple80211_opmode { + APPLE80211_M_NONE = 0x0, + APPLE80211_M_STA = 0x1, // infrastructure station + APPLE80211_M_IBSS = 0x2, // IBSS (adhoc) station + APPLE80211_M_AHDEMO = 0x4, // Old lucent compatible adhoc demo + APPLE80211_M_HOSTAP = 0x8, // Software Access Point + APPLE80211_M_MONITOR = 0x10 // Monitor mode +}; + +enum apple80211_apmode { + APPLE80211_AP_MODE_UNKNOWN = 0, + APPLE80211_AP_MODE_IBSS = 1, // IBSS (adhoc) station + APPLE80211_AP_MODE_INFRA = 2, // Access Point + APPLE80211_AP_MODE_ANY = 3, // Any supported mode +}; + +enum apple80211_state { + APPLE80211_S_INIT = 0, // default state + APPLE80211_S_SCAN = 1, // scanning + APPLE80211_S_AUTH = 2, // try to authenticate + APPLE80211_S_ASSOC = 3, // try to assoc + APPLE80211_S_RUN = 4, // associated +}; + +enum apple80211_protmode { + APPLE80211_PROTMODE_OFF = 0, // no protection + APPLE80211_PROTMODE_AUTO = 1, // auto + APPLE80211_PROTMODE_CTS = 2, // CTS to self + APPLE80211_PROTMODE_RTSCTS = 3, // RTS-CTS + APPLE80211_PROTMODE_DUAL_CTS = 4, // dual CTS +}; + +enum apple80211_cipher_type { + APPLE80211_CIPHER_NONE = 0, // open network + APPLE80211_CIPHER_WEP_40 = 1, // 40 bit WEP + APPLE80211_CIPHER_WEP_104 = 2, // 104 bit WEP + APPLE80211_CIPHER_TKIP = 3, // TKIP (WPA) + APPLE80211_CIPHER_AES_OCB = 4, // AES (OCB) + APPLE80211_CIPHER_AES_CCM = 5, // AES (CCM) + APPLE80211_CIPHER_PMK = 6, // PMK + APPLE80211_CIPHER_PMKSA = 7, // PMK obtained from pre-authentication +}; + +enum apple80211_cipher_key_type +{ + APPLE80211_CIPHER_KEY_TYPE_UNICAST = 0, // unicast cipher key + APPLE80211_CIPHER_KEY_TYPE_MULTICAST = 1 // multicast cipher key +}; + +// Low level 802.11 authentication types + +enum apple80211_authtype_lower +{ + APPLE80211_AUTHTYPE_OPEN = 1, // open + APPLE80211_AUTHTYPE_SHARED = 2, // shared key + APPLE80211_AUTHTYPE_CISCO = 3, // cisco net eap +}; + +// Higher level authentication used after 802.11 association complete + +enum apple80211_authtype_upper +{ + APPLE80211_AUTHTYPE_NONE = 0, // No upper auth + APPLE80211_AUTHTYPE_WPA = 1 << 0, // WPA + APPLE80211_AUTHTYPE_WPA_PSK = 1 << 1, // WPA PSK + APPLE80211_AUTHTYPE_WPA2 = 1 << 2, // WPA2 + APPLE80211_AUTHTYPE_WPA2_PSK = 1 << 3, // WPA2 PSK + APPLE80211_AUTHTYPE_LEAP = 1 << 4, // LEAP + APPLE80211_AUTHTYPE_8021X = 1 << 5, // 802.1x + APPLE80211_AUTHTYPE_WPS = 1 << 6, // WiFi Protected Setup + APPLE80211_AUTHTYPE_SHA256_PSK = 1 << 7, + APPLE80211_AUTHTYPE_SHA256_8021X = 1 << 8, + APPLE80211_AUTHTYPE_WPA3_SAE = 1 << 9 +}; + +// Unify association status code and deauth reason codes into a single enum describing +// common error conditions +enum apple80211_associate_result +{ + APPLE80211_RESULT_UNAVAILABLE = 0, // No association/authentication result ready + APPLE80211_RESULT_SUCCESS = 1, // APPLE80211_STATUS_SUCCESS and no deauth + APPLE80211_RESULT_UNSPECIFIED_FAILURE = 2, // APPLE80211_STATUS_UNSPECIFIED_FAILURE + APPLE80211_RESULT_UNSUPPORTED_CAPAPBILITIES = 3, // APPLE80211_STATUS_UNSUPPORTED_CAPABILITIES + APPLE80211_RESULT_REASSOCIATION_DENIED = 4, // APPLE80211_STATUS_REASSOCIATION_DENIED + APPLE80211_RESULT_ASSOCIATION_DENIED = 5, // APPLE80211_STATUS_ASSOCIATION_DENIED + APPLE80211_RESULT_AUTH_ALG_UNSUPPORTED = 6, // APPLE80211_STATUS_AUTH_ALG_UNSUPPORTED + APPLE80211_RESULT_INVALID_AUTH_SEQ_NUM = 7, // APPLE80211_STATUS_INVALID_AUTH_SEQ_NUM + APPLE80211_RESULT_CHALLENGE_FAILURE = 8, // APPLE80211_STATUS_CHALLENGE_FAILURE + APPLE80211_RESULT_TIMEOUT = 9, // APPLE80211_STATUS_TIMEOUT + APPLE80211_RESULT_AP_FULL = 10, // APPLE80211_STATUS_AP_FULL + APPLE80211_RESULT_UNSUPPORTED_RATE_SET = 11, // APPLE80211_STATUS_UNSUPPORTED_RATE_SET + APPLE80211_RESULT_SHORT_SLOT_UNSUPPORTED = 12, // APPLE80211_STATUS_SHORT_SLOT_UNSUPPORTED + APPLE80211_RESULT_DSSS_OFDM_UNSUPPORTED = 13, // APPLE80211_STATUS_DSSS_OFDM_UNSUPPORTED + APPLE80211_RESULT_INVALID_IE = 14, // APPLE80211_STATUS_INVALID_IE + APPLE80211_RESULT_INVALID_GROUP_CIPHER = 15, // APPLE80211_STATUS_INVALID_GROUP_CIPHER + APPLE80211_RESULT_INVALID_PAIRWISE_CIPHER = 16, // APPLE80211_STATUS_INVALID_PAIRWISE_CIPHER + APPLE80211_RESULT_INVALID_AKMP = 17, // APPLE80211_STATUS_INVALID_AKMP + APPLE80211_RESULT_UNSUPPORTED_RSN_VERSION = 18, // APPLE80211_STATUS_UNSUPPORTED_RSN_VERSION + APPLE80211_RESULT_INVALID_RSN_CAPABILITIES = 19, // APPLE80211_STATUS_INVALID_RSN_CAPABILITIES + APPLE80211_RESULT_CIPHER_SUITE_REJECTED = 20, // APPLE80211_STATUS_CIPHER_SUIT_REJECTED + APPLE80211_RESULT_INVALID_PMK = 21, // APPLE80211_REASON_PREV_AUTH_EXPIRED received + APPLE80211_RESULT_SUPPLICANT_TIMEOUT = 22, // RSNSupplicant did not finish handshake + APPLE80211_RESULT_UNKNOWN = 0xffff // Unrecognized error condition +}; + +enum apple80211_link_down_reason +{ + APPLE80211_LINK_DOWN_REASON_INTERNAL_ERROR = 0, + APPLE80211_LINK_DOWN_REASON_BEACONLOST = 1, + APPLE80211_LINK_DOWN_REASON_DEAUTH = 2, + APPLE80211_LINK_DOWN_REASON_INTERNAL_ERROR_2 = 3 +}; + +enum apple80211_unit +{ + APPLE80211_UNIT_DBM = 0, // dBm + APPLE80211_UNIT_MW = 1, // milliwatts + APPLE80211_UNIT_PERCENT = 2, // value expressed as a percentage +}; + +enum apple80211_power_state +{ + APPLE80211_POWER_OFF = 0, // Chain disabled + APPLE80211_POWER_ON = 1, // Chain powered on for tx and rx + APPLE80211_POWER_TX = 2, // Chain powered on for tx only + APPLE80211_POWER_RX = 3, // Chain powered on for rx only +}; + +enum apple80211_locale +{ + APPLE80211_LOCALE_UNKNOWN = 0, + APPLE80211_LOCALE_FCC = 1, + APPLE80211_LOCALE_ETSI = 2, + APPLE80211_LOCALE_JAPAN = 3, + APPLE80211_LOCALE_KOREA = 4, + APPLE80211_LOCALE_APAC = 5, + APPLE80211_LOCALE_ROW = 6, + APPLE80211_LOCALE_INDONESIA = 7 +}; + +enum apple80211_scan_type +{ + APPLE80211_SCAN_TYPE_NONE = 0, + APPLE80211_SCAN_TYPE_ACTIVE = 1, + APPLE80211_SCAN_TYPE_PASSIVE = 2, + APPLE80211_SCAN_TYPE_FAST = 3, // Ok to return cached scan results + APPLE80211_SCAN_TYPE_BACKGROUND = 4, // Initiate background scanning +}; + +enum apple80211_int_mit { + APPLE80211_INT_MIT_OFF = 0, + APPLE80211_INT_MIT_AUTO = 1, +}; + +enum apple80211_channel_flag +{ + APPLE80211_C_FLAG_NONE = 0x0, // no flags + APPLE80211_C_FLAG_10MHZ = 0x1, // 10 MHz wide + APPLE80211_C_FLAG_20MHZ = 0x2, // 20 MHz wide + APPLE80211_C_FLAG_40MHZ = 0x4, // 40 MHz wide + APPLE80211_C_FLAG_2GHZ = 0x8, // 2.4 GHz + APPLE80211_C_FLAG_5GHZ = 0x10, // 5 GHz + APPLE80211_C_FLAG_IBSS = 0x20, // IBSS supported + APPLE80211_C_FLAG_HOST_AP = 0x40, // HOST AP mode supported + APPLE80211_C_FLAG_ACTIVE = 0x80, // active scanning supported + APPLE80211_C_FLAG_DFS = 0x100, // DFS required + APPLE80211_C_FLAG_EXT_ABV = 0x200, // If 40 Mhz, extension channel above. + // If this flag is not set, then the + // extension channel is below. + APPLE80211_C_FLAG_80MHZ = 0x400 // name made up - set if channelWidth == 80 && 5ghz && AC +}; + +enum apple80211_rate_flag +{ + APPLE80211_RATE_FLAG_NONE = 0x0, // no flags + APPLE80211_RATE_FLAG_BASIC = 0x1, // basic rate + APPLE80211_RATE_FLAG_HT = 0x2, // HT rate computed from MCS index +}; + +enum apple80211_short_slot_mode +{ + APPLE80211_SHORT_SLOT_MODE_AUTO = 1, // Default behavior + APPLE80211_SHORT_SLOT_MODE_LONG = 2, // long - short slot timing mode + APPLE80211_SHORT_SLOT_MODE_SHORT = 3, // short - short slot timing mode +}; + +enum apple80211_powersave_mode +{ + // Standard modes + APPLE80211_POWERSAVE_MODE_DISABLED = 0, + APPLE80211_POWERSAVE_MODE_80211 = 1, + APPLE80211_POWERSAVE_MODE_VENDOR = 2, // Vendor specific mode, there should be + // more general apple modes in the future. + // Vendor modes also likely require more info. + // Mimo modes + APPLE80211_POWERSAVE_MODE_MIMO_STATIC = 3, + APPLE80211_POWERSAVE_MODE_MIMO_DYNAMIC = 4, + APPLE80211_POWERSAVE_MODE_MIMO_MIMO = 5, + + // WOW + APPLE80211_POWERSAVE_MODE_WOW = 6, + + // Vendor specific powersave mode, throughput is maximized + APPLE80211_POWERSAVE_MODE_MAX_THROUGHPUT = 7, + + // Vendor specific powersave mode, power savings are maximized, possibly + // at the expense of throughput/latency. + APPLE80211_POWERSAVE_MODE_MAX_POWERSAVE = 8, +}; + +enum apple80211_debug_flag +{ + APPLE80211_DEBUG_FLAG_NONE = 0x0, // No logging + APPLE80211_DEBUG_FLAG_INFORMATIVE = 0x1, // Log "interesting" events + APPLE80211_DEBUG_FLAG_ERROR = 0x2, // Log errors + APPLE80211_DEBUG_FLAG_RSN = 0x4, // Full RSN supplicant logging + APPLE80211_DEBUG_FLAG_SCAN = 0x8, // Scan events and information +}; + +enum apple80211_guard_interval +{ + APPLE80211_GI_SHORT = 400, // ns + APPLE80211_GI_LONG = 800, // ns +}; + +#define APPLE80211_RSC_LEN 8 +#define APPLE80211_KEY_BUFF_LEN 32 + +#define APPLE80211_KEY_FLAG_UNICAST 0x1 +#define APPLE80211_KEY_FLAG_MULTICAST 0x2 +#define APPLE80211_KEY_FLAG_TX 0x4 +#define APPLE80211_KEY_FLAG_RX 0x8 + +struct apple80211_key +{ + u_int32_t version; + u_int32_t key_len; + u_int32_t key_cipher_type; // apple80211_cipher_type + u_int16_t key_flags; + u_int16_t key_index; + u_int8_t key[ APPLE80211_KEY_BUFF_LEN ]; + u_int8_t pad[30]; + u_int32_t key_rsc_len; + u_int8_t key_rsc[ APPLE80211_RSC_LEN ]; // receive sequence counter + struct ether_addr key_ea; // key applies to this bssid + uint wowl_kck_len; + uint8_t wowl_kck_key[16]; + uint wowl_kek_len; + u_int8_t wowl_kek_key[24]; +}; + +// Changing this affects any structure that contains a channel +struct apple80211_channel +{ + u_int32_t version; + u_int32_t channel; // channel number + u_int32_t flags; // apple80211_channel_flag vector +}; + +struct apple80211_rate +{ + u_int32_t version; + u_int32_t rate; // rate mbps + u_int32_t flags; // apple80211_rate_flag vector +}; + +// Probe response capability flags, IEEE 7.3.1.4 +#define APPLE80211_CAPINFO_ESS 0x0001 +#define APPLE80211_CAPINFO_IBSS 0x0002 +#define APPLE80211_CAPINFO_CF_POLLABLE 0x0004 +#define APPLE80211_CAPINFO_CF_POLLREQ 0x0008 +#define APPLE80211_CAPINFO_PRIVACY 0x0010 +#define APPLE80211_CAPINFO_SHORT_PREAMBLE 0x0020 +#define APPLE80211_CAPINFO_PBCC 0x0040 +#define APPLE80211_CAPINFO_AGILITY 0x0080 +// 0x0100, 0x0200 reserved +#define APPLE80211_CAPINFO_SHORT_SLOT_TIME 0x0400 +// 0x0800, 0x1000 reserved +#define APPLE80211_CAPINFO_DSSS_OFDM 0x2000 +// 0x4000, 0x8000 reserved + +// Reason codes IEEE 7.3.1.7 +#define APPLE80211_REASON_UNSPECIFIED 1 +#define APPLE80211_REASON_PREV_AUTH_EXPIRED 2 +#define APPLE80211_REASON_AUTH_LEAVING 3 +#define APPLE80211_REASON_INACTIVE 4 +#define APPLE80211_REASON_AP_OVERLOAD 5 +#define APPLE80211_REASON_NOT_AUTHED 6 +#define APPLE80211_REASON_NOT_ASSOCED 7 +#define APPLE80211_REASON_ASSOC_LEAVING 8 +#define APPLE80211_REASON_ASSOC_NOT_AUTHED 9 +#define APPLE80211_REASON_POWER_CAP 10 +#define APPLE80211_REASON_SUPPORTED_CHANS 11 + +#define APPLE80211_REASON_INVALID_IE 13 +#define APPLE80211_REASON_MIC_FAILURE 14 +#define APPLE80211_REASON_4_WAY_TIMEOUT 15 +#define APPLE80211_REASON_GROUP_KEY_TIMEOUT 16 +#define APPLE80211_REASON_DIFF_IE 17 +#define APPLE80211_REASON_INVALID_GROUP_KEY 18 +#define APPLE80211_REASON_INVALID_PAIR_KEY 19 +#define APPLE80211_REASON_INVALID_AKMP 20 +#define APPLE80211_REASON_UNSUPP_RSN_VER 21 +#define APPLE80211_REASON_INVALID_RSN_CAPS 22 +#define APPLE80211_REASON_8021X_AUTH_FAILED 23 + +// Status codes IEEE 7.3.1.9 +#define APPLE80211_STATUS_SUCCESS 0 +#define APPLE80211_STATUS_UNSPECIFIED_FAILURE 1 +// 2-9 reserved +#define APPLE80211_STATUS_UNSUPPORTED_CAPABILITIES 10 +#define APPLE80211_STATUS_REASSOCIATION_DENIED 11 +#define APPLE80211_STATUS_ASSOCIATION_DENIED 12 +#define APPLE80211_STATUS_AUTH_ALG_UNSUPPORTED 13 +#define APPLE80211_STATUS_INVALID_AUTH_SEQ_NUM 14 +#define APPLE80211_STATUS_CHALLENGE_FAILURE 15 +#define APPLE80211_STATUS_TIMEOUT 16 +#define APPLE80211_STATUS_AP_FULL 17 +#define APPLE80211_STATUS_UNSUPPORTED_RATE_SET 18 +// 22-24 reserved +#define APPLE80211_STATUS_SHORT_SLOT_UNSUPPORTED 25 +#define APPLE80211_STATUS_DSSS_OFDM_UNSUPPORTED 26 +// 27-39 reserved +#define APPLE80211_STATUS_INVALID_IE 40 +#define APPLE80211_STATUS_INVALID_GROUP_CIPHER 41 +#define APPLE80211_STATUS_INVALID_PAIRWISE_CIPHER 42 +#define APPLE80211_STATUS_INVALID_AKMP 43 +#define APPLE80211_STATUS_UNSUPPORTED_RSN_VERSION 44 +#define APPLE80211_STATUS_INVALID_RSN_CAPABILITIES 45 +#define APPLE80211_STATUS_CIPHER_SUITE_REJECTED 46 +// 47 - 65535 reserved +#define APPLE80211_STATUS_UNAVAILABLE 0xffff + +// If mcs index is set to APPLE80211_MCS_INDEX_AUTO, the interface +// should go to auto rate selection, and abandon any previously +// configured static MCS indices +#define APPLE80211_MCS_INDEX_AUTO 0xffffffff + +/* + DSCP TOS/Traffic class values for WME access categories taken from + WiFi WMM Test Plan v 1.3.1 Appendix C. + + TOS/Traffic class field looks like: + + 0 1 2 3 4 5 6 7 + +---+---+---+---+---+---+---+---+ + | DSCP | ECN | + +---+---+---+---+---+---+---+---+ + + These bits are numbered according to rfc 2474, but might be misleading. + It looks like bit 0 is actually the high order bit. + */ + +#define APPLE80211_DSCP_WME_BE 0x00 +#define APPLE80211_DSCP_WME_BK 0x08 +#define APPLE80211_DSCP_WME_VI 0x28 +#define APPLE80211_DSCP_WME_VO 0x38 + +// Access category values set in the mbuf +#define APPLE80211_WME_AC_BE 0 +#define APPLE80211_WME_AC_BK 1 +#define APPLE80211_WME_AC_VI 2 +#define APPLE80211_WME_AC_VO 3 + +// Working within the limitations of the kpi mbuf routines, the receive interface pointer +// is the best place to put this for now since it is not used on the output path. The mbuf +// kpi doesn't allow us to access unused flags, or I would put the WME AC in there like +// everyone else. + +#define APPLE80211_MBUF_SET_WME_AC( m, ac ) mbuf_pkthdr_setrcvif( m, (ifnet_t)ac ) +#define APPLE80211_MBUF_WME_AC( m ) (int)mbuf_pkthdr_rcvif( m ) + +// FIXME: seems that rates array starts at 0x24, immediately after +struct apple80211_scan_result +{ + u_int32_t version; // 0x00 - 0x03 + apple80211_channel asr_channel; // 0x04 - 0x0f + + int16_t asr_unk; // 0x10 - 0x11 + + int16_t asr_noise; // 0x12 - 0x13 + int16_t asr_snr; // 0x14 - 0x15 + int16_t asr_rssi; // 0x16 - 0x17 + int16_t asr_beacon_int; // 0x18 - 0x19 + + int16_t asr_cap; // 0x1a - 0x1b (capabilities) + + u_int8_t asr_bssid[ APPLE80211_ADDR_LEN ]; // 0x1c 0x1d 0x1e 0x1f 0x20 0x21 + u_int8_t asr_nrates; // 0x22 + u_int8_t asr_nr_unk; // 0x23 + u_int32_t asr_rates[ APPLE80211_MAX_RATES ]; // 0x24 - 0x5f + u_int8_t asr_ssid_len; // 0x60 + u_int8_t asr_ssid[ APPLE80211_MAX_SSID_LEN ]; // 0x61 - 0x80 + __attribute__((packed)) __attribute__((aligned(1))) int16_t unk; + uint8_t unk2; + u_int32_t asr_age; // (ms) non-zero for cached scan result // 0x84 + + u_int16_t unk3; + int16_t asr_ie_len; + uint32_t asr_unk3; + void* asr_ie_data; +}; + +struct apple80211_network_data +{ + u_int32_t version; + u_int16_t nd_mode; // apple80211_apmode + u_int16_t nd_auth_lower; // apple80211_authtype_lower + u_int16_t nd_auth_upper; // apple80211_authtype_upper + struct apple80211_channel nd_channel; + u_int32_t nd_ssid_len; + u_int8_t nd_ssid[ APPLE80211_MAX_SSID_LEN ]; + struct apple80211_key nd_key; + u_int32_t nd_ie_len; + void *nd_ie_data; +}; + +#define APPLE80211_NETWORK_DATA_MAX_IE_LEN 1024 + +// As hostap support improves, this will grow +struct apple80211_station +{ + u_int32_t version; + struct ether_addr sta_mac; + int32_t sta_rssi; +}; + +// WOW structures and defines + +struct apple80211_wow_pattern +{ + size_t len; + u_int8_t *pattern; +}; + +enum apple80211_wake_condition +{ + APPLE80211_WAKE_COND_MAGIC_PATTERN = 0, + APPLE80211_WAKE_COND_NET_PATTERN = 1, + APPLE80211_WAKE_COND_DISASSOCIATED = 2, + APPLE80211_WAKE_COND_DEAUTHED = 3, + APPLE80211_WAKE_COND_RETROGRADE_TSF = 4, + APPLE80211_WAKE_COND_BEACON_LOSS = 5, +}; + +#define APPLE80211_MAX_WAKE_COND 5 + +enum apple80211_card_capability +{ + APPLE80211_CAP_WEP = 0, // CAPABILITY: WEP available + APPLE80211_CAP_TKIP = 1, // CAPABILITY: TKIP available + APPLE80211_CAP_AES = 2, // CAPABILITY: AES OCB avail + APPLE80211_CAP_AES_CCM = 3, // CAPABILITY: AES CCM avail + APPLE80211_CAP_CKIP = 4, // CAPABILITY: CKIP available + APPLE80211_CAP_IBSS = 5, // CAPABILITY: IBSS available + APPLE80211_CAP_PMGT = 6, // CAPABILITY: Power mgmt + APPLE80211_CAP_HOSTAP = 7, // CAPABILITY: HOSTAP avail + APPLE80211_CAP_TXPMGT = 8, // CAPABILITY: tx power mgmt + APPLE80211_CAP_SHSLOT = 9, // CAPABILITY: short slottime + APPLE80211_CAP_SHPREAMBLE = 10, // CAPABILITY: short preamble + APPLE80211_CAP_MONITOR = 11, // CAPABILITY: monitor mode + APPLE80211_CAP_TKIPMIC = 12, // CAPABILITY: TKIP MIC avail + APPLE80211_CAP_WPA1 = 13, // CAPABILITY: WPA1 avail + APPLE80211_CAP_WPA2 = 14, // CAPABILITY: WPA2 avail + APPLE80211_CAP_WPA = 15, // CAPABILITY: WPA1+WPA2 avail + APPLE80211_CAP_BURST = 16, // CAPABILITY: frame bursting + APPLE80211_CAP_WME = 17, // CAPABILITY: WME avail + APPLE80211_CAP_SHORT_GI_40MHZ = 18, // CAPABILITY: Short guard interval in 40 MHz + APPLE80211_CAP_SHORT_GI_20MHZ = 19, // CAPABILITY: Short guard interval in 20 MHz + APPLE80211_CAP_WOW = 20, // CAPABILITY: Wake on wireless + APPLE80211_CAP_TSN = 21, // CAPABILITY: WPA with WEP group key +}; +#define APPLE80211_CAP_MAX 63 + +enum apple80211_virtual_interface_type +{ + APPLE80211_VIF_P2P_DEVICE = 1, + APPLE80211_VIF_P2P_CLIENT = 2, + APPLE80211_VIF_P2P_GO = 3, + APPLE80211_VIF_AWDL = 4, + APPLE80211_VIF_SOFT_AP = 5, + + APPLE80211_VIF_MAX +}; + +enum apple80211_assoc_flags { + APPLE80211_ASSOC_F_CLOSED = 1, // flag: scan was directed, needed to remember closed networks +}; + +// Kernel messages + +struct apple80211_status_msg_hdr +{ + u_int32_t msg_type; // type of message + u_int32_t msg_len; // length of data (not including msg_type and msg_len) + + // data follows +}; + +#define APPLE80211_M_MAX_LEN 2048 + +#define APPLE80211_M_POWER_CHANGED 1 +#define APPLE80211_M_SSID_CHANGED 2 +#define APPLE80211_M_BSSID_CHANGED 3 +#define APPLE80211_M_LINK_CHANGED 4 +#define APPLE80211_M_MIC_ERROR_UCAST 5 +#define APPLE80211_M_MIC_ERROR_MCAST 6 +#define APPLE80211_M_INT_MIT_CHANGED 7 +#define APPLE80211_M_MODE_CHANGED 8 +#define APPLE80211_M_ASSOC_DONE 9 +#define APPLE80211_M_SCAN_DONE 10 +#define APPLE80211_M_COUNTRY_CODE_CHANGED 11 +#define APPLE80211_M_STA_ARRIVE 12 +#define APPLE80211_M_STA_LEAVE 13 +#define APPLE80211_M_DECRYPTION_FAILURE 14 +#define APPLE80211_M_SCAN_CACHE_UPDATED 15 +#define APPLE80211_M_INTERNAL_SCAN_DONE 16 +#define APPLE80211_M_LINK_QUALITY 17 +#define APPLE80211_M_IBSS_PEER_ARRIVED 18 +#define APPLE80211_M_IBSS_PEER_LEFT 19 +#define APPLE80211_M_RSN_HANDSHAKE_DONE 20 +#define APPLE80211_M_BT_COEX_CHANGED 21 +#define APPLE80211_M_P2P_PEER_DETECTED 22 +#define APPLE80211_M_P2P_LISTEN_COMPLETE 23 +#define APPLE80211_M_P2P_SCAN_COMPLETE 24 +#define APPLE80211_M_P2P_LISTEN_STARTED 25 +#define APPLE80211_M_P2P_SCAN_STARTED 26 +#define APPLE80211_M_P2P_INTERFACE_CREATED 27 +#define APPLE80211_M_P2P_GROUP_STARTED 28 +#define APPLE80211_M_BGSCAN_NET_DISCOVERED 29 +#define APPLE80211_M_ROAMED 30 +#define APPLE80211_M_ACT_FRM_TX_COMPLETE 31 +#define APPLE80211_M_DEAUTH_RECEIVED 32 +#define APPLE80211_M_DRIVER_AVAILABLE 0x37 +#define APPLE80211_M_LINK_ADDRESS_CHANGED 0x3B +#define APPLE80211_M_ROAM_START 0x46 +#define APPLE80211_M_ROAM_END 0x47 +#define APPLE80211_M_INTERFACE_STATE 0x3A + +#define APPLE80211_M_MAX 0x3A +#define APPLE80211_M_BUFF_SIZE APPLE80211_MAP_SIZE( APPLE80211_M_MAX ) + +// Registry Information +#define APPLE80211_REGKEY_HARDWARE_VERSION "IO80211HardwareVersion" +// #define APPLE80211_REG_FIRMWARE_VERSION "IO80211FirmwareVersion" +#define APPLE80211_REGKEY_DRIVER_VERSION "IO80211DriverVersion" +#define APPLE80211_REGKEY_LOCALE "IO80211Locale" +#define APPLE80211_REGKEY_SSID "IO80211SSID" +#define APPLE80211_REGKEY_CHANNEL "IO80211Channel" +#define APPLE80211_REGKEY_EXT_CHANNEL "IO80211ExtensionChannel" +#define APPLE80211_REGKEY_BAND "IO80211Band" +#define APPLE80211_BAND_2GHZ "2 GHz" +#define APPLE80211_BAND_5GHZ "5 GHz" +#define APPLE80211_REGKEY_COUNTRY_CODE "IO80211CountryCode" + +// Userland messages +#define APPLE80211_M_RSN_AUTH_SUCCESS 254 +#define APPLE80211_M_RSN_AUTH_SUCCESS_TEMPLATE "com.apple.rsn.%s.auth.success" // string is interface name + +#define APPLE80211_M_RSN_AUTH_TIMEOUT 255 +#define APPLE80211_M_RSN_AUTH_TIMEOUT_TEMPLATE "com.apple.rsn.%s.auth.timeout" // string is interface name + +#define APPLE80211_M_RSN_MSG_MAX 2 + +#endif // _APPLE80211_VAR_H_ + diff --git a/QualcommWireless/include/IOKit/80211/apple80211_wps.h b/QualcommWireless/include/IOKit/80211/apple80211_wps.h new file mode 100644 index 0000000..0204b14 --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/apple80211_wps.h @@ -0,0 +1,537 @@ +// +// wps_eap.h +// IO80211Family +// +// Created by Pete on 6/20/06. +// Copyright 2006 Apple Computer, Inc. All rights reserved. +// + +#ifndef _APPLE80211_WPS_H_ +#define _APPLE80211_WPS_H_ + +#include +#include +#include + +// This is necessary, because even the latest Xcode does not support properly targeting 11.0. +#ifndef __IO80211_TARGET +#error "Please define __IO80211_TARGET to the requested version" +#endif + +#define WPS_HANDSHAKE_TIMEOUT 120 /* seconds */ +#define WPS_RETRANSMIT_TIMEOUT 5 +#define WPS_MAX_RETRIES 3 + +#define WPS_IDENTITY_STR "WFA-SimpleConfig-Enrollee-1-0" +#define WPS_IDENTITY_STR_LEN 29 +#define WPS_PERSONALIZATION_STRING "Wi-Fi Easy and Secure Key Derivation" +#define WPS_PERSONALIZATION_STRING_LEN ( sizeof( WPS_PERSONALIZATION_STRING ) - 1 ) +#define WPS_KDF_KEY_BITS 640 + +#define WPS_DISPLAY_PIN_LEN 8 + +#define EAP_TYPE_ID 1 +#define WPS_EAP_METHOD_TYPE 254 + +#define WPS_VENDOR_ID_BYTES 0x00, 0x37, 0x2A +#define WPS_VENDOR_TYPE 0x00000001 + +#define WPS_OP_START 0x01 +#define WPS_OP_ACK 0x02 +#define WPS_OP_NACK 0x03 +#define WPS_OP_MSG 0x04 +#define WPS_OP_DONE 0x05 + +#define WPS_FLAG_MF 0x01 /* more fragments */ +#define WPS_FLAG_LF 0x02 /* length field in use */ + +#define WPS_MAX_MSG_LEN UINT16_MAX /* max frag len, my limit */ + +#define PACKED __attribute__((packed)) + +struct wps_eap_hdr +{ + u_int8_t code; + u_int8_t identifier; + u_int16_t length; + u_int8_t type; + u_int8_t vendor_id[3]; + u_int32_t vendor_type; + u_int8_t op_code; + u_int8_t flags; + u_int16_t msg_length; + // u_int8_t msg[1]; /* data follows */ +} PACKED; + +#define WPS_EAP_HDR_LEN( _whdr ) ( ( _whdr->flags & WPS_FLAG_LF ) ? sizeof( struct wps_eap_hdr ) : sizeof( struct wps_eap_hdr ) - sizeof( u_int16_t ) ) + +// Messages elements + +#define BUF_SIZE_64_BITS 8 +#define BUF_SIZE_128_BITS 16 +#define BUF_SIZE_160_BITS 20 +#define BUF_SIZE_256_BITS 32 +#define BUF_SIZE_512_BITS 64 +#define BUF_SIZE_1024_BITS 128 +#define BUF_SIZE_1536_BITS 192 + +struct wps_msg_elem_hdr +{ + u_int16_t elem_id; + u_int16_t elem_len; +} PACKED; + +#define WPS_ELEM_SET_HEADER( elem, id, len ) (elem)->hdr.elem_id = htons( id ); (elem)->hdr.elem_len = htons( len ) + +struct wps_dev_type +{ + u_int16_t category; + u_int8_t oui[4]; + u_int16_t sub_category; +} PACKED; + +#define WIFI_DEV_TYPE_OUI_BYTES 0x00, 0x50, 0xf2, 0x04 + +#define DEFINE_WPS_ELEMENT( name, param ) \ +typedef struct { \ + struct wps_msg_elem_hdr hdr; \ + param; \ +} PACKED name + + +#define WPS_VERSION 0x10 +DEFINE_WPS_ELEMENT( wps_elem_ap_channel_t, u_int16_t channel ); +DEFINE_WPS_ELEMENT( wps_elem_assoc_state_t, u_int16_t assoc_state ); +DEFINE_WPS_ELEMENT( wps_elem_auth_type_t, u_int16_t auth_type ); +DEFINE_WPS_ELEMENT( wps_elem_auth_type_flags_t, u_int16_t auth_flags ); +#define AUTHENTICATOR_MSG_SIZE ( sizeof( struct wps_msg_elem_hdr ) + 8 ) +DEFINE_WPS_ELEMENT( wps_elem_authenticator_t, u_int8_t authenticator[8] ); +DEFINE_WPS_ELEMENT( wps_elem_config_methods_t, u_int16_t config_methods ); +DEFINE_WPS_ELEMENT( wps_elem_config_error_t, u_int16_t error ); +DEFINE_WPS_ELEMENT( wps_elem_confirm_url4_t, u_int16_t url4[1] ); // <= 64B +DEFINE_WPS_ELEMENT( wps_elem_confirm_url6_t, u_int16_t url6[1] ); // <= 76B +DEFINE_WPS_ELEMENT( wps_elem_conn_type_t, u_int8_t conn_type ); +DEFINE_WPS_ELEMENT( wps_elem_conn_type_flags_t, u_int8_t conn_type_flags ); +DEFINE_WPS_ELEMENT( wps_elem_credential_t, u_int8_t cred[1] ); // <= ??? +DEFINE_WPS_ELEMENT( wps_elem_dev_name_t, u_int8_t dev_name[1] ); // <= 32B +DEFINE_WPS_ELEMENT( wps_elem_dev_pw_id_t, u_int16_t dev_pw_id ); +DEFINE_WPS_ELEMENT( wps_elem_e_hash1_t, u_int8_t e_hash1[BUF_SIZE_256_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_e_hash2_t, u_int8_t e_hash2[BUF_SIZE_256_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_e_snonce1_t, u_int8_t e_snonce1[BUF_SIZE_128_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_e_snonce2_t, u_int8_t e_snonce2[BUF_SIZE_128_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_ecrypt_settings_t, u_int8_t settings[1] ); // no limit defined +DEFINE_WPS_ELEMENT( wps_elem_encrypt_type_t, u_int16_t encrypt_type ); +DEFINE_WPS_ELEMENT( wps_elem_encrypt_type_flags_t, u_int16_t encrypt_type_flags ); +DEFINE_WPS_ELEMENT( wps_elem_enrl_nonce_t, u_int8_t nonce[BUF_SIZE_128_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_feature_id_t, u_int32_t feature_id ); +DEFINE_WPS_ELEMENT( wps_elem_identity_t, u_int8_t identity[1] ); // <= 80 +// identity proof? +DEFINE_WPS_ELEMENT( wps_elem_iv_t, u_int8_t iv[BUF_SIZE_256_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_key_wrap_authenticator_t, u_int8_t key_wrap_authenticator[8] ); +DEFINE_WPS_ELEMENT( wps_elem_key_id_t, u_int8_t key_id[16] ); +DEFINE_WPS_ELEMENT( wps_elem_mac_addr_t, u_int8_t mac[ETHER_ADDR_LEN] ); +DEFINE_WPS_ELEMENT( wps_elem_manufacturer_t, u_int8_t manufacturer[1] ); // <= 64 +DEFINE_WPS_ELEMENT( wps_elem_msg_type_t, u_int8_t msg_type ); +DEFINE_WPS_ELEMENT( wps_elem_model_name_t, u_int8_t model_name[1] ); // <= 32B +DEFINE_WPS_ELEMENT( wps_elem_model_number_t, u_int8_t model_number[1] ); // <= 32B +DEFINE_WPS_ELEMENT( wps_elem_network_index_t, u_int8_t network_index ); +DEFINE_WPS_ELEMENT( wps_elem_network_key_t, u_int8_t network_key[1] ); // <= 64B +DEFINE_WPS_ELEMENT( wps_elem_network_key_index_t, u_int8_t network_key_index ); +DEFINE_WPS_ELEMENT( wps_elem_new_dev_name_t, u_int8_t new_dev_name[1] ); // <= 32B +DEFINE_WPS_ELEMENT( wps_elem_new_pw_t, u_int8_t new_pw[1] ); // <= 64 +// oob device password? +DEFINE_WPS_ELEMENT( wps_elem_os_version_t, u_int32_t os_version ); +DEFINE_WPS_ELEMENT( wps_elem_power_level_t, u_int8_t power_level ); +DEFINE_WPS_ELEMENT( wps_elem_psk_current_t, u_int8_t psk_current ); +DEFINE_WPS_ELEMENT( wps_elem_psk_max_t, u_int8_t psk_max ); +DEFINE_WPS_ELEMENT( wps_elem_public_key_t, u_int8_t key[BUF_SIZE_1536_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_radio_enabled_t, u_int8_t radio_enabled ); // bool? +DEFINE_WPS_ELEMENT( wps_elem_reboot_t, u_int8_t reboot ); // bool? +DEFINE_WPS_ELEMENT( wps_elem_reg_current_t, u_int8_t reg_current ); +DEFINE_WPS_ELEMENT( wps_elem_reg_established_t, u_int8_t reg_established ); // bool? +DEFINE_WPS_ELEMENT( wps_elem_reg_list_t, u_int8_t reg_list[1] ); // <= 512B +DEFINE_WPS_ELEMENT( wps_elem_reg_max_t, u_int8_t reg_max ); +DEFINE_WPS_ELEMENT( wps_elem_reg_nonce_t, u_int8_t nonce[BUF_SIZE_128_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_req_type_t, u_int8_t req_type ); +DEFINE_WPS_ELEMENT( wps_elem_resp_type_t, u_int8_t resp_type ); +DEFINE_WPS_ELEMENT( wps_elem_rf_band_t, u_int8_t rf_band ); +DEFINE_WPS_ELEMENT( wps_elem_r_hash1, u_int8_t r_hash1[BUF_SIZE_256_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_r_hash2, u_int8_t r_hash2[BUF_SIZE_256_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_r_snonce1, u_int8_t r_snonce1[BUF_SIZE_128_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_r_snonce2, u_int8_t r_snonce2[BUF_SIZE_128_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_selected_reg_t, u_int8_t selected_reg ); // bool? +DEFINE_WPS_ELEMENT( wps_elem_serial_number_t, u_int8_t serial_number[1] ); // <= 32B +DEFINE_WPS_ELEMENT( wps_elem_simple_config_state_t, u_int8_t simple_config_state ); +DEFINE_WPS_ELEMENT( wps_elem_ssid_t, u_int8_t ssid[32] ); +DEFINE_WPS_ELEMENT( wps_elem_total_networks_t, u_int8_t total_networks ); +DEFINE_WPS_ELEMENT( wps_elem_uuid_e_t, u_int8_t uuid_e[16] ); +DEFINE_WPS_ELEMENT( wps_elem_uuid_r_t, u_int8_t uuid_r[16] ); +DEFINE_WPS_ELEMENT( wps_elem_vendor_ext_t, u_int8_t vendor_ext[1] ); // <= 1024 +DEFINE_WPS_ELEMENT( wps_elem_version_t, u_int8_t version ); // int? +DEFINE_WPS_ELEMENT( wps_elem_x_509_cert_req_t, u_int8_t cert_req[1] ); // limit? +DEFINE_WPS_ELEMENT( wps_elem_x_509_cert_t, u_int8_t cert[1] ); // limit? +DEFINE_WPS_ELEMENT( wps_elem_eap_id_t, u_int8_t eap_id[1] ); // <= 64 +DEFINE_WPS_ELEMENT( wps_elem_msg_counter_t, u_int8_t msg_counter[8] ); +DEFINE_WPS_ELEMENT( wps_elem_public_key_hash_t, u_int8_t public_key_hash[BUF_SIZE_160_BITS] ); +DEFINE_WPS_ELEMENT( wps_elem_rekey_key_t, u_int8_t rekey_key[32] ); +DEFINE_WPS_ELEMENT( wps_elem_key_lifetime_t, u_int32_t key_lifetime ); +DEFINE_WPS_ELEMENT( wps_elem_permitted_config_methods_t, u_int16_t permitted_config_methods ); +DEFINE_WPS_ELEMENT( wps_elem_sel_reg_config_methods_t, u_int8_t sel_reg_config_methods ); +DEFINE_WPS_ELEMENT( wps_elem_primary_dev_type_t, struct wps_dev_type prime_dev_type ); +DEFINE_WPS_ELEMENT( wps_elem_secondary_dev_type_list_t, u_int8_t secondary_dev_type_list[1] ); // <= 128B +DEFINE_WPS_ELEMENT( wps_elem_portable_dev_t, u_int8_t portable_dev ); // bool? +DEFINE_WPS_ELEMENT( wps_elem_ap_setup_locked_t, u_int8_t ap_setup_locked ); // bool? +DEFINE_WPS_ELEMENT( wps_elem_app_list_t, u_int8_t app_list[1] ); // <= 512B +DEFINE_WPS_ELEMENT( wps_elem_eap_type_t, u_int8_t eap_type[1] ); // <= 8B + +#define WPS_NEXT_ELEMENT( cast, cur_elm, len ) (cast)( (UInt8 *)(cur_elm) + sizeof( struct wps_msg_elem_hdr ) + ntohs( cur_elm->hdr.elem_len ) ); \ +len+=( sizeof( struct wps_msg_elem_hdr ) + ntohs( cur_elm->hdr.elem_len ) ) +#define WPS_NEXT_ELEMENT_IE( cast, cur_elm, len ) (cast)( (UInt8 *)(cur_elm) + sizeof( struct wps_msg_elem_hdr ) + ntohs( cur_elm->hdr.elem_len ) ); \ +len-=( sizeof( struct wps_msg_elem_hdr ) + ntohs( cur_elm->hdr.elem_len ) ); +#define WPS_ELEMENT_IS( elem, id ) ( ntohs( elem->hdr.elem_id ) == id ) +#define WPS_ELEMENT_LEN_VAR( elem ) ( sizeof( struct wps_msg_elem_hdr ) + ntohs( elem->hdr.elem_len ) ) +#define WPS_ELEMENT_LEN_FIXED( fixed ) ( sizeof( struct wps_msg_elem_hdr ) + sizeof( fixed ) ) +#define WPS_ELEMENT_PARAM_LEN( elem ) ( ntohs( elem->hdr.elem_len ) ) + +// Messages +#define WPS_MBUF_GET_MSG_PTR( m, type ) (type *)( (UInt8 *)mbuf_data( m ) + sizeof( struct ether_header ) + sizeof( struct wps_eap_hdr ) ) + +struct wps_msg_nack +{ + wps_elem_version_t version; + wps_elem_msg_type_t msg_type; + wps_elem_enrl_nonce_t enrl_nonce; + wps_elem_reg_nonce_t reg_nonce; + wps_elem_config_error_t error; +}PACKED; + +struct wps_msg_ack +{ + wps_elem_version_t version; + wps_elem_msg_type_t msg_type; + wps_elem_enrl_nonce_t enrl_nonce; + wps_elem_reg_nonce_t reg_nonce; +}PACKED; + +struct wps_msg_done +{ + wps_elem_version_t version; + wps_elem_msg_type_t msg_type; +}; + +// From RFC 3748 section 4.1 for identity +struct wps_identity_msg +{ + u_int8_t code; + u_int8_t id; + u_int16_t length; + u_int8_t type; + // u_int8_t type_data[1]; /* data follows */ +} PACKED; + +#define WPS_EAP_TYPE_IDENTITY 1 + +// Data Element Definitions +#define WPS_ID_AP_CHANNEL 0x1001 +#define WPS_ID_ASSOC_STATE 0x1002 +#define WPS_ID_AUTH_TYPE 0x1003 +#define WPS_ID_AUTH_TYPE_FLAGS 0x1004 +#define WPS_ID_AUTHENTICATOR 0x1005 +#define WPS_ID_CONFIG_METHODS 0x1008 +#define WPS_ID_CONFIG_ERROR 0x1009 +#define WPS_ID_CONF_URL4 0x100A +#define WPS_ID_CONF_URL6 0x100B +#define WPS_ID_CONN_TYPE 0x100C +#define WPS_ID_CONN_TYPE_FLAGS 0x100D +#define WPS_ID_CREDENTIAL 0x100E +#define WPS_ID_DEVICE_NAME 0x1011 +#define WPS_ID_DEVICE_PWD_ID 0x1012 +#define WPS_ID_E_HASH1 0x1014 +#define WPS_ID_E_HASH2 0x1015 +#define WPS_ID_E_SNONCE1 0x1016 +#define WPS_ID_E_SNONCE2 0x1017 +#define WPS_ID_ENCR_SETTINGS 0x1018 +#define WPS_ID_ENCR_TYPE 0x100F +#define WPS_ID_ENCR_TYPE_FLAGS 0x1010 +#define WPS_ID_ENROLLEE_NONCE 0x101A +#define WPS_ID_FEATURE_ID 0x101B +#define WPS_ID_IDENTITY 0x101C +#define WPS_ID_IDENTITY_PROOF 0x101D +#define WPS_ID_INIT_VECTOR 0x104B //this becomes 0x1060 later +//#define WPS_ID_KEY_WRAP_AUTH WPS_ID_AUTHENTICATOR //this becomes 0x101E later +#define WPS_ID_KEY_WRAP_AUTH 0x101E // HH changed for MS beta 2 testing +#define WPS_ID_KEY_IDENTIFIER 0x101F +#define WPS_ID_MAC_ADDR 0x1020 +#define WPS_ID_MANUFACTURER 0x1021 +#define WPS_ID_MSG_TYPE 0x1022 +#define WPS_ID_MODEL_NAME 0x1023 +#define WPS_ID_MODEL_NUMBER 0x1024 +#define WPS_ID_NW_INDEX 0x1026 +#define WPS_ID_NW_KEY 0x1027 +#define WPS_ID_NW_KEY_INDEX 0x1028 +#define WPS_ID_NEW_DEVICE_NAME 0x1029 +#define WPS_ID_NEW_PWD 0x102A +#define WPS_ID_OOB_DEV_PWD 0x102C +#define WPS_ID_OS_VERSION 0x102D +#define WPS_ID_POWER_LEVEL 0x102F +#define WPS_ID_PSK_CURRENT 0x1030 +#define WPS_ID_PSK_MAX 0x1031 +#define WPS_ID_PUBLIC_KEY 0x1032 +#define WPS_ID_RADIO_ENABLED 0x1033 +#define WPS_ID_REBOOT 0x1034 +#define WPS_ID_REGISTRAR_CURRENT 0x1035 +#define WPS_ID_REGISTRAR_ESTBLSHD 0x1036 +#define WPS_ID_REGISTRAR_LIST 0x1037 +#define WPS_ID_REGISTRAR_MAX 0x1038 +#define WPS_ID_REGISTRAR_NONCE 0x1039 +#define WPS_ID_REQ_TYPE 0x103A +#define WPS_ID_RESP_TYPE 0x103B +#define WPS_ID_RF_BAND 0x103C +#define WPS_ID_R_HASH1 0x103D +#define WPS_ID_R_HASH2 0x103E +#define WPS_ID_R_SNONCE1 0x103F +#define WPS_ID_R_SNONCE2 0x1040 +#define WPS_ID_SEL_REGISTRAR 0x1041 +#define WPS_ID_SERIAL_NUM 0x1042 +#define WPS_ID_SC_STATE 0x1044 +#define WPS_ID_SSID 0x1045 +#define WPS_ID_TOT_NETWORKS 0x1046 +#define WPS_ID_UUID_E 0x1047 +#define WPS_ID_UUID_R 0x1048 +#define WPS_ID_VENDOR_EXT 0x1049 +#define WPS_ID_VERSION 0x104A +#define WPS_ID_X509_CERT_REQ 0x104B +#define WPS_ID_X509_CERT 0x104C +#define WPS_ID_EAP_IDENTITY 0x104D +#define WPS_ID_MSG_COUNTER 0x104E +#define WPS_ID_PUBKEY_HASH 0x104F +#define WPS_ID_REKEY_KEY 0x1050 +#define WPS_ID_KEY_LIFETIME 0x1051 +#define WPS_ID_PERM_CFG_METHODS 0x1052 +#define WPS_ID_SEL_REG_CFG_METHODS_ORIGINAL 0x0153 // This was the original val in the spec, we must support both +#define WPS_ID_SEL_REG_CFG_METHODS 0x1053 +#define WPS_ID_PRIM_DEV_TYPE 0x1054 +#define WPS_ID_SEC_DEV_TYPE_LIST 0x1055 +#define WPS_ID_PORTABLE_DEVICE 0x1056 +#define WPS_ID_AP_SETUP_LOCKED 0x1057 +#define WPS_ID_APP_LIST 0x1058 +#define WPS_ID_EAP_TYPE 0x1059 + +// Association states +#define WPS_ASSOC_NOT_ASSOCIATED 0 +#define WPS_ASSOC_CONN_SUCCESS 1 +#define WPS_ASSOC_CONFIG_FAIL 2 +#define WPS_ASSOC_ASSOC_FAIL 3 +#define WPS_ASSOC_IP_FAIL 4 + +// Authentication types +#define WPS_AUTHTYPE_OPEN 0x0001 +#define WPS_AUTHTYPE_WPAPSK 0x0002 +#define WPS_AUTHTYPE_SHARED 0x0004 +#define WPS_AUTHTYPE_WPA 0x0008 +#define WPS_AUTHTYPE_WPA2 0x0010 +#define WPS_AUTHTYPE_WPA2PSK 0x0020 + +// Config methods +#define WPS_CONFMET_USBA 0x0001 +#define WPS_CONFMET_ETHERNET 0x0002 +#define WPS_CONFMET_LABEL 0x0004 +#define WPS_CONFMET_DISPLAY 0x0008 +#define WPS_CONFMET_EXT_NFC_TOK 0x0010 +#define WPS_CONFMET_INT_NFC_TOK 0x0020 +#define WPS_CONFMET_NFC_INTF 0x0040 +#define WPS_CONFMET_PBC 0x0080 +#define WPS_CONFMET_KEYPAD 0x0100 + +// WPS error messages +#define WPS_ERROR_NO_ERROR 0 +#define WPS_ERROR_OOB_INT_READ_ERR 1 +#define WPS_ERROR_DECRYPT_CRC_FAIL 2 +#define WPS_ERROR_CHAN24_NOT_SUPP 3 +#define WPS_ERROR_CHAN50_NOT_SUPP 4 +#define WPS_ERROR_SIGNAL_WEAK 5 +#define WPS_ERROR_NW_AUTH_FAIL 6 +#define WPS_ERROR_NW_ASSOC_FAIL 7 +#define WPS_ERROR_NO_DHCP_RESP 8 +#define WPS_ERROR_FAILED_DHCP_CONF 9 +#define WPS_ERROR_IP_ADDR_CONFLICT 10 +#define WPS_ERROR_FAIL_CONN_REGISTRAR 11 +#define WPS_ERROR_MULTI_PBC_DETECTED 12 +#define WPS_ERROR_ROGUE_SUSPECTED 13 +#define WPS_ERROR_DEVICE_BUSY 14 +#define WPS_ERROR_SETUP_LOCKED 15 +#define WPS_ERROR_MSG_TIMEOUT 16 +#define WPS_ERROR_REG_SESSION_TIMEOUT 17 +#define WPS_ERROR_DEV_PWD_AUTH_FAIL 18 + +#define WPS_ERROR_MAX WPS_ERROR_DEV_PWD_AUTH_FAIL + +// Connection types +#define WPS_CONNTYPE_ESS 0x01 +#define WPS_CONNTYPE_IBSS 0x02 + +// Device password ID +#define WPS_DEVICEPWDID_DEFAULT 0x0000 +#define WPS_DEVICEPWDID_USER_SPEC 0x0001 +#define WPS_DEVICEPWDID_MACHINE_SPEC 0x0002 +#define WPS_DEVICEPWDID_REKEY 0x0003 +#define WPS_DEVICEPWDID_PUSH_BTN 0x0004 +#define WPS_DEVICEPWDID_REG_SPEC 0x0005 + +/* + // Device type + #define WPS_DEVICETYPE_COMPUTER "Computer" + #define WPS_DEVICETYPE_AP "Access_Point" + #define WPS_DEVICETYPE_ROUTER_AP "Router_AP" + #define WPS_DEVICETYPE_PRINTER "Printer" + #define WPS_DEVICETYPE_PRINTER_BRIDGE "Printer_Brigde" + #define WPS_DEVICETYPE_ELECT_PIC_FRAME "Electronic_Picture_Frame" + #define WPS_DEVICETYPE_DIG_AUDIO_RECV "Digital_Audio_Receiver" + #define WPS_DEVICETYPE_WIN_MCE "Windows_Media_Center_Extender" + #define WPS_DEVICETYPE_WIN_MOBILE "Windows_Mobile" + #define WPS_DEVICETYPE_PVR "Personal_Video_Recorder" + #define WPS_DEVICETYPE_VIDEO_STB "Video_STB" + #define WPS_DEVICETYPE_PROJECTOR "Projector" + #define WPS_DEVICETYPE_IP_TV "IP_TV" + #define WPS_DEVICETYPE_DIG_STILL_CAM "Digital_Still_Camera" + #define WPS_DEVICETYPE_PHONE "Phone" + #define WPS_DEVICETYPE_VOID_PHONE "VoIP_Phone" + #define WPS_DEVICETYPE_GAME_CONSOLE "Game_console" + #define WPS_DEVICETYPE_OTHER "Other" + */ + +// Encryption type +#define WPS_ENCRTYPE_NONE 0x0001 +#define WPS_ENCRTYPE_WEP 0x0002 +#define WPS_ENCRTYPE_TKIP 0x0004 +#define WPS_ENCRTYPE_AES 0x0008 + + +// WPS Message Types +#define WPS_ID_BEACON 0x01 +#define WPS_ID_PROBE_REQ 0x02 +#define WPS_ID_PROBE_RESP 0x03 +#define WPS_ID_MESSAGE_M1 0x04 +#define WPS_ID_MESSAGE_M2 0x05 +#define WPS_ID_MESSAGE_M2D 0x06 +#define WPS_ID_MESSAGE_M3 0x07 +#define WPS_ID_MESSAGE_M4 0x08 +#define WPS_ID_MESSAGE_M5 0x09 +#define WPS_ID_MESSAGE_M6 0x0A +#define WPS_ID_MESSAGE_M7 0x0B +#define WPS_ID_MESSAGE_M8 0x0C +#define WPS_ID_MESSAGE_ACK 0x0D +#define WPS_ID_MESSAGE_NACK 0x0E +#define WPS_ID_MESSAGE_DONE 0x0F + +//Device Type categories for primary and secondary device types +#define WPS_DEVICE_TYPE_CAT_COMPUTER 1 +#define WPS_DEVICE_TYPE_CAT_INPUT_DEVICE 2 +#define WPS_DEVICE_TYPE_CAT_PRINTER 3 +#define WPS_DEVICE_TYPE_CAT_CAMERA 4 +#define WPS_DEVICE_TYPE_CAT_STORAGE 5 +#define WPS_DEVICE_TYPE_CAT_NW_INFRA 6 +#define WPS_DEVICE_TYPE_CAT_DISPLAYS 7 +#define WPS_DEVICE_TYPE_CAT_MM_DEVICES 8 +#define WPS_DEVICE_TYPE_CAT_GAME_DEVICES 9 +#define WPS_DEVICE_TYPE_CAT_TELEPHONE 10 + +//Device Type sub categories for primary and secondary device types +#define WPS_DEVICE_TYPE_SUB_CAT_COMP_PC 1 +#define WPS_DEVICE_TYPE_SUB_CAT_COMP_SERVER 2 +#define WPS_DEVICE_TYPE_SUB_CAT_COMP_MEDIA_CTR 3 +#define WPS_DEVICE_TYPE_SUB_CAT_PRTR_PRINTER 1 +#define WPS_DEVICE_TYPE_SUB_CAT_PRTR_SCANNER 2 +#define WPS_DEVICE_TYPE_SUB_CAT_CAM_DGTL_STILL 1 +#define WPS_DEVICE_TYPE_SUB_CAT_STOR_NAS 1 +#define WPS_DEVICE_TYPE_SUB_CAT_NW_AP 1 +#define WPS_DEVICE_TYPE_SUB_CAT_NW_ROUTER 2 +#define WPS_DEVICE_TYPE_SUB_CAT_NW_SWITCH 3 +#define WPS_DEVICE_TYPE_SUB_CAT_DISP_TV 1 +#define WPS_DEVICE_TYPE_SUB_CAT_DISP_PIC_FRAME 2 +#define WPS_DEVICE_TYPE_SUB_CAT_DISP_PROJECTOR 3 +#define WPS_DEVICE_TYPE_SUB_CAT_MM_DAR 1 +#define WPS_DEVICE_TYPE_SUB_CAT_MM_PVR 2 +#define WPS_DEVICE_TYPE_SUB_CAT_MM_MCX 3 +#define WPS_DEVICE_TYPE_SUB_CAT_GAM_XBOX 1 +#define WPS_DEVICE_TYPE_SUB_CAT_GAM_XBOX_360 2 +#define WPS_DEVICE_TYPE_SUB_CAT_GAM_PS 3 +#define WPS_DEVICE_TYPE_SUB_CAT_PHONE_WM 1 + +// Device request/response type +#define WPS_MSGTYPE_ENROLLEE_INFO_ONLY 0x00 +#define WPS_MSGTYPE_ENROLLEE_OPEN_8021X 0x01 +#define WPS_MSGTYPE_REGISTRAR 0x02 +#define WPS_MSGTYPE_AP_WLAN_MGR 0x03 + +// RF Band +#define WPS_RFBAND_24GHZ 0x01 +#define WPS_RFBAND_50GHZ 0x02 + +// Simple Config state +#define WPS_SCSTATE_UNCONFIGURED 0x01 +#define WPS_SCSTATE_CONFIGURED 0x02 + +// State business +#define WPS_RETRY_INTERVAL 5 /* seconds */ +#define WPS_PACKET_TIMEOUT 15 /* seconds */ + +#define WPS_TIMEOUT_SECS 1 + +enum WPSSupplicantState +{ + WPS_S_INIT, + WPS_S_EAPOL_START_TX, + WPS_S_EAPOL_START_RX, + WPS_S_IDENT_REQ_TX, + WPS_S_IDENT_REQ_RX, + WPS_S_IDENT_RESP_TX, + WPS_S_IDENT_RESP_RX, + WPS_S_START_TX, + WPS_S_START_RX, + WPS_S_M1_TX, + WPS_S_M1_RX, + WPS_S_M2_TX, + WPS_S_M2_RX, + WPS_S_M3_TX, + WPS_S_M3_RX, + WPS_S_M4_TX, + WPS_S_M4_RX, + WPS_S_M5_TX, + WPS_S_M5_RX, + WPS_S_M6_TX, + WPS_S_M6_RX, + WPS_S_M7_TX, + WPS_S_M7_RX, + WPS_S_M8_TX, + WPS_S_M8_RX, + WPS_S_DONE_TX, + WPS_S_DONE_RX, + WPS_S_FAIL_TX, + WPS_S_FAIL_RX, + WPS_S_MSG_TIMEOUT, + WPS_S_SESSION_TIMEOUT, +}; +typedef enum WPSSupplicantState WPSSupplicantState; + +// Apple specific error codes + +#define WPSE_NOERR 0 // no error +#define WPSE_ERR -1 // general error code +#define WPSE_PROTO_ERR -2 // Problem with EAPOL handshake +#define WPSE_IE_NOT_PRESENT -3 // No WPS IE present in IE list for ssid +#define WPSE_IE_MALFORMED -4 // WPS IS missing required (for Apple) fields +#define WPSE_SCAN_ERR -5 // Scan failed +#define WPSE_NO_PIN_AT_REG -6 // No PIN configured at registrar +#define WPSE_NO_PIN_AT_CLIENT -7 // No PIN configured at client +#define WPSE_SSID_NOT_FOUND -8 // Scan did not find SSID +#define WPSE_UNSUPPORTED_PW_ID -9 // Registrar reports that it is using an unsupported PW ID +#define WPSE_ASSOC_FAILED -10 // Association attempt failed +#define WPSE_API_REQ -11 // An apple80211 ioctl request failed +#define WPSE_NOMEM -12 // memory error +#define WPSE_WPA_RSN_NOT_SUP -13 // WPA/RSN not supported +#define WPSE_TIMEOUT -14 // EAPOL timed out +#define WPSE_NACKED -15 // NACKED by registrar +#define WPSE_FAIL -16 // unexpected EAP-FAIL received + +#endif /* _APPLE80211_WPS_H_ */ diff --git a/QualcommWireless/include/IOKit/80211/apple_private_spi.h b/QualcommWireless/include/IOKit/80211/apple_private_spi.h new file mode 100644 index 0000000..a644de6 --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/apple_private_spi.h @@ -0,0 +1,74 @@ +/* +* Copyright (c) 1998-2016 Apple Inc. All rights reserved. +* +* @APPLE_OSREFERENCE_LICENSE_HEADER_START@ +* +* This file contains Original Code and/or Modifications of Original Code +* as defined in and that are subject to the Apple Public Source License +* Version 2.0 (the 'License'). You may not use this file except in +* compliance with the License. The rights granted to you under the License +* may not be used to create, or enable the creation or redistribution of, +* unlawful or unlicensed copies of an Apple operating system, or to +* circumvent, violate, or enable the circumvention or violation of, any +* terms of an Apple operating system software license agreement. +* +* Please obtain a copy of the License at +* http://www.opensource.apple.com/apsl/ and read it before using this file. +* +* The Original Code and all software distributed under the License are +* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +* Please see the License for the specific language governing rights and +* limitations under the License. +* +* @APPLE_OSREFERENCE_LICENSE_HEADER_END@ +*/ + +#ifndef apple_private_spi_h +#define apple_private_spi_h + +#ifndef __PRIVATE_SPI__ + +/*! @enum IOMbufServiceClass + @discussion Service class of a mbuf packet. + @constant kIOMbufServiceClassBKSYS Background System-Initiated. + @constant kIOMbufServiceClassBK Background. + @constant kIOMbufServiceClassBE Best Effort. + @constant kIOMbufServiceClassRD Responsive Data. + @constant kIOMbufServiceClassOAM Operations, Administration, and Management. + @constant kIOMbufServiceClassAV Multimedia Audio/Video Streaming. + @constant kIOMbufServiceClassRV Responsive Multimedia Audio/Video. + @constant kIOMbufServiceClassVI Interactive Video. + @constant kIOMbufServiceClassVO Interactive Voice. + @constant kIOMbufServiceClassCTL Network Control. +*/ +enum IOMbufServiceClass { + kIOMbufServiceClassBKSYS = 100, + kIOMbufServiceClassBK = 200, + kIOMbufServiceClassBE = 0, + kIOMbufServiceClassRD = 300, + kIOMbufServiceClassOAM = 400, + kIOMbufServiceClassAV = 500, + kIOMbufServiceClassRV = 600, + kIOMbufServiceClassVI = 700, + kIOMbufServiceClassVO = 800, + kIOMbufServiceClassCTL = 900 +}; + +#endif + +struct packet_info_tag { + +}; + +struct apple80211_debug_command { + +}; + +struct ifnet_init_eparams { + +}; + +#endif /* apple_private_spi_h */ diff --git a/QualcommWireless/include/IOKit/80211/debug.h b/QualcommWireless/include/IOKit/80211/debug.h new file mode 100644 index 0000000..8093704 --- /dev/null +++ b/QualcommWireless/include/IOKit/80211/debug.h @@ -0,0 +1,283 @@ +// +// debug.h +// Black80211_HighSierra +// +// Created by Roman Peshkov on 05/07/2018. +// Copyright © 2018 Roman Peshkov. All rights reserved. +// + +#ifndef debug_h +#define debug_h + +static const char* IOCTL_NAMES[] = { + "UNKNOWN", + "SSID", + "AUTH_TYPE", + "CIPHER_KEY", + "CHANNEL", + "POWERSAVE", + "PROTMODE", + "TXPOWER", + "RATE", + "BSSID", + "SCAN_REQ", + "SCAN_RESULT", + "CARD_CAPABILITIES", + "STATE", + "PHY_MODE", + "OP_MODE", + "RSSI", + "NOISE", + "INT_MIT", + "POWER", + "ASSOCIATE", + "ASSOCIATE_RESULT", + "DISASSOCIATE", + "STATUS_DEV_NAME", + "IBSS_MODE", + "HOST_AP_MODE", + "AP_MODE", + "SUPPORTED_CHANNELS", + "LOCALE", + "DEAUTH", + "COUNTERMEASURES", + "FRAG_THRESHOLD", + "RATE_SET", + "SHORT_SLOT", + "MULTICAST_RATE", + "SHORT_RETRY_LIMIT", + "LONG_RETRY_LIMIT", + "TX_ANTENNA", + "RX_ANTENNA", + "ANTENNA_DIVERSITY", + "ROM", + "DTIM_INT", + "STATION_LIST", + "DRIVER_VERSION", + "HARDWARE_VERSION", + "RAND", + "RSN_IE", + "BACKGROUND_SCAN", + "AP_IE_LIST", + "STATS", + "ASSOCIATION_STATUS", + "COUNTRY_CODE", + "DEBUG_FLAGS", + "LAST_RX_PKT_DATA", + "RADIO_INFO", + "GUARD_INTERVAL", + "MIMO_POWERSAVE", + "MCS", + "RIFS", + "LDPC", + "MSDU", + "MPDU", + "BLOCK_ACK", + "PLS", + "PSMP", + "PHY_SUB_MODE", + "MCS_INDEX_SET", + "CACHE_THRESH_BCAST", + "CACHE_THRESH_DIRECT", + "WOW_PARAMETERS", + "WOW_ENABLED", + "40MHZ_INTOLERANT", + "PID_LOCK", + "STA_IE_LIST", + "STA_AUTHORIZE", + "STA_DISASSOCIATE", + "STA_DEAUTH", + "RSN_CONF", + "KEY_RSC", + "STA_STATS", + "ROAM_THRESH", + "VENDOR_DBG_FLAGS", + "CACHE_AGE_THRESH", + "PMK_CACHE", + "LINK_QUAL_EVENT_PARAMS", + "IE", + "SCAN_REQ_MULTIPLE", + "BTCOEX_MODE", + "WOW_TEST", + "CLEAR_PMK_CACHE", + "SCANCACHE_CLEAR", + "P2P_ENABLE", + "P2P_LISTEN", + "P2P_SCAN", + "VIRTUAL_IF_CREATE", + "VIRTUAL_IF_DELETE", + "VIRTUAL_IF_ROLE", + "VIRTUAL_IF_PARENT", + "P2P_GO_CONF", + "P2P_NOA_LIST", + "P2P_OPP_PS", + "P2P_CT_WINDOW", + "BT_COEX_FLAGS", + "CURRENT_NETWORK", + "BT_POWER", + "AVAILABILITY", + "RSSI_BOUNDS", + "ROAM", + "TX_CHAIN_POWER", + "CDD_MODE", + "LAST_BCAST_SCAN_TIME", + "THERMAL_THROTTLING", + "FACTORY_MODE", + "REASSOCIATE", + "???MISSING???", + "POWER_DEBUG_INFO", + "AWDL_SYNC_PARAMS", + "AWDL_SYNC_ENABLED", + "AWDL_EXTENSION_STATE_MACHINE_PARAMETERS", + "AWDL_SERVICE_PARAMS", + "AWDL_PEER_SERVICE_REQUEST", + "AWDL_ELECTION_ALGORITHM_ENABLED", + "AWDL_ELECTION_ID", + "AWDL_MAX_TREE_DEPTH", + "AWDL_GUARD_TIME", + "AWDL_BSSID", + "AWDL_ELECTION_METRIC", + "AWDL_AVAILABILITY_WINDOW_AP_ALIGNMENT", + "AWDL_SYNC_FRAME_AP_BEACON_ALIGNMENT", + "AWDL_SYNCHRONIZATION_CHANNEL_SEQUENCE", + "PEER_CACHE_MAXIMUM_SIZE", + "AWDL_OUI", + "AWDL_MASTER_CHANNEL", + "AWDL_TOP_MASTER", + "AWDL_SYNC_STATE", + "AWDL_ELECTION_RSSI_THRESHOLDS", + "AWDL_PRESENCE_MODE", + "AWDL_ELECTION_MASTER_COUNTS", + "AWDL_PERIODIC_SYNC_FRAME_PACKET_LIFETIME", + "AWDL_MASTER_MODE_SYNC_FRAME_PERIOD", + "AWDL_NON_ELECTION_MASTER_MODE_SYNC_FRAME_PERIOD", + "AWDL_EXPLICIT_AVAILABILITY_WINDOW_EXTENSION_OPT_OUT", + "AWDL_GET_AWDL_MASTER_DATABASE", + "PEER_CACHE_CONTROL", + "AWDL_BATTERY_LEVEL", + "AWDL_BT_COEX_AW_PROTECTED_PERIOD_LENGTH", + "AWDL_BT_COEX_AGREEMENT", + "AWDL_BT_COEX_AGREEMENT_ENABLED", + "AWDL_STRATEGY", + "AWDL_OOB_REQUEST", + "AWDL_MAX_NO_MASTER_PERIODS", + "AWDL_SYNC_FRAME_TEMPLATE", + "LOG_FLAGS", + "PEER_STATS", + "HT_CAPABILITY", + "AWDL_ELECTION_PARAMS", + "LINK_CHANGED_EVENT_DATA", + "GET_DEBUG_INFO", + "AWDL_DEVICE_CAPABILITIES", + "AWDL_RSSI_MEASUREMENT_REQUEST", + "AWDL_AES_KEY", + "AWDL_SCAN_RESERVED_TIME", + "AWDL_CTL", + "AWDL_SOCIAL_TIME_SLOTS", + "AWDL_PEER_TRAFFIC_REGISTRATION", + "EXTENDED_STATS", + "BEACON_PERIOD", + "AWDL_FORCED_ROAM_CONFIG", + "AWDL_QUIET", + "ACL_POLICY", + "ACL_ADD", + "ACL_REMOVE", + "ACL_FLUSH", + "ACL_LIST", + "CHAIN_ACK", + "DESENSE", + "OFFLOAD_SCANNING", + "OFFLOAD_RSN", + "OFFLOAD_COUNTRY_CODE", + "OFFLOAD_KEEPALIVE_L2", + "OFFLOAD_ARP_NDP", + "VHT_MCS_INDEX_SET", + "DWDS", + "INTERRUPT_STATS", + "INTERRUPT_STATS_RESET", + "TIMER_STATS", + "TIMER_STATS_RESET", + "OFFLOAD_STATS", + "OFFLOAD_STATS_RESET", + "OFFLOAD_BEACONS", + "ROAMING", + "OFFLOAD_ARP", + "OFFLOAD_NDP", + "OFFLOAD_SCAN", + "DESENSE_LEVEL", + "MCS_VHT", + "TX_NSS", + "GAS_REQ", + "GAS_START", + "GAS_SET_PEER", + "GAS_RESULTS", + "AWDL_BTLE_PEER_INDICATION", + "AWDL_BTLE_STATE_PARAMS", + "AWDL_PEER_DATABASE", + "AWDL_BTLE_ENABLE_SYNC_WITH_PARAMS", + "AWDL_SECONDARY_MASTER_CHANNEL", + "PHY_STATS", + "CHANNELS_INFO", + "AWDL_AF_TX_MODE", + "ERROR_STRING", + "ERROR_NO", + "AWDL_PIGGYBACK_SCAN_REQ", + "AWDL_PRIVATE_ELECTION_ID", + "AWDL_MIN_RATE", + "VHT_CAPABILITY", + "BGSCAN_CACHE_RESULTS", + "ROAM_PROFILE", + "AWDL_OPER_MODE", + "RESTORE_DEFAULTS", + "AWDL_ENCRYPTION_KEYS", + "AWDL_ENCRYPTION_TYPE", + "BTCOEX_PROFILES", + "BTCOEX_CONFIG", + "AWDL_STATISTICS", + "AWDL_ENABLE_ROAMING", + "AWDL_OOB_AUTO_REQUEST", + "AWDL_TXCAL_PERIOD", + "CHIP_COUNTER_STATS", + "DBG_GUARD_TIME_PARAMS", + "AWDL_AWDL_ADVERTISERS", + "LEAKY_AP_STATS_MODE", + "CAPTURE", + "LEAKY_AP_STATS", + "AWDL_BLOCK_SET_COMMANDS", + "LEAKY_AP_AWD_MODE", + "BTCOEX_OPTIONS", + "FORCE_SYNC_TO_PEER", + "COUNTRY_CHANNELS", + "PRIVATE_MAC", + "RESET_CHIP", + "CRASH", + "RANGING_ENABLE", + "RANGING_START", + "RANGING_AUTHENTICATE", + "AWDL_PREFERRED_CHANNELS", + "LEAKY_AP_SSID_STATS", + "AWDL_RSDB_CAPS", + "AWDL_DEV_STATS", + "LAST_ASSOC_HISTORY", + "AWDL_COMMON_CHANNEL", + "AWDL_PEERS_INFO", + "TKO_PARAMS", + "TKO_DUMP", + "AWDL_NEARBY_LOG_TRIGGER", + "HW_SUPPORTED_CHANNELS", + "BTCOEX_PROFILE", + "BTCOEX_PROFILE_ACTIVE", + "TRAP_INFO", + "THERMAL_INDEX", + "MAX_NSS_FOR_AP", + "BTCOEX_2G_CHAIN_DISABLE", + "POWER_BUDGET", + "AWDL_DFSP_CONFIG", + "AWDL_DFSP_UCSA_CONFIG", + "SCAN_BACKOFF_REPORT", + "OFFLOAD_TCPKA_ENABLE", + "RANGING_CAPS", + "PER_CORE_RSSI_REPORT", +}; + +#endif /* debug_h */ diff --git a/QualcommWireless/include/IOKit/IOBSD.h b/QualcommWireless/include/IOKit/IOBSD.h new file mode 100644 index 0000000..1359f4b --- /dev/null +++ b/QualcommWireless/include/IOKit/IOBSD.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOBSD_H +#define _IOBSD_H + +/* + * bsd-related registry properties + */ + +#define kIOBSDKey "IOBSD" // (BSD subsystem resource) +#define kIOBSDNameKey "BSD Name" // (an OSString) +#define kIOBSDNamesKey "BSD Names" // (an OSDictionary of OSString's, for links) +#define kIOBSDMajorKey "BSD Major" // (an OSNumber) +#define kIOBSDMinorKey "BSD Minor" // (an OSNumber) +#define kIOBSDUnitKey "BSD Unit" // (an OSNumber) + + + +#endif /* !_IOBSD_H */ diff --git a/QualcommWireless/include/IOKit/IOBufferMemoryDescriptor.h b/QualcommWireless/include/IOKit/IOBufferMemoryDescriptor.h new file mode 100644 index 0000000..e95644d --- /dev/null +++ b/QualcommWireless/include/IOKit/IOBufferMemoryDescriptor.h @@ -0,0 +1,314 @@ +/* + * Copyright (c) 1998-2016 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOBUFFERMEMORYDESCRIPTOR_H +#define _IOBUFFERMEMORYDESCRIPTOR_H + +#include +#include + +enum { + kIOMemoryPhysicallyContiguous = 0x00000010, + kIOMemoryPageable = 0x00000020, + kIOMemoryPurgeable = 0x00000040, + kIOMemoryHostPhysicallyContiguous = 0x00000080, + kIOMemorySharingTypeMask = 0x000f0000, + kIOMemoryUnshared = 0x00000000, + kIOMemoryKernelUserShared = 0x00010000, + // shared IOMemoryDescriptor options for IOBufferMemoryDescriptor: + kIOBufferDescriptorMemoryFlags = kIOMemoryDirectionMask + | kIOMemoryThreadSafe + | kIOMemoryClearEncrypt + | kIOMemoryMapperNone + | kIOMemoryUseReserve +}; + +#define _IOBUFFERMEMORYDESCRIPTOR_INTASKWITHOPTIONS_ 1 +#define _IOBUFFERMEMORYDESCRIPTOR_HOSTPHYSICALLYCONTIGUOUS_ 1 +#define IOBUFFERMEMORYDESCRIPTOR_SUPPORTS_INTASKWITHOPTIONS_TAGS 1 +/*! + * @class IOBufferMemoryDescriptor + * @abstract Provides a simple memory descriptor that allocates its own buffer memory. + */ + +class IOBufferMemoryDescriptor : public IOGeneralMemoryDescriptor +{ + OSDeclareDefaultStructorsWithDispatch(IOBufferMemoryDescriptor); + +private: +/*! @struct ExpansionData + * @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { + IOMemoryMap * map; + }; + +/*! @var reserved + * Reserved for future use. (Internal use only) */ + APPLE_KEXT_WSHADOW_PUSH; + ExpansionData * reserved; + +protected: + void * _buffer; + vm_size_t _capacity; + vm_offset_t _alignment; + IOOptionBits _options; +private: + uintptr_t _internalReserved; + unsigned _internalFlags; + APPLE_KEXT_WSHADOW_POP; + +private: +#ifndef __LP64__ + virtual bool initWithOptions( + IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment, + task_t inTask) APPLE_KEXT_DEPRECATED; /* use withOptions() instead */ +#endif /* !__LP64__ */ + +public: + virtual bool initWithPhysicalMask( + task_t inTask, + IOOptionBits options, + mach_vm_size_t capacity, + mach_vm_address_t alignment, + mach_vm_address_t physicalMask); + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 0); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 1); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IOBufferMemoryDescriptor, 0); + OSMetaClassDeclareReservedUsed(IOBufferMemoryDescriptor, 1); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 2); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 3); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 4); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 5); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 6); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 7); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 8); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 9); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 10); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 11); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 12); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 13); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 14); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 15); + +protected: + virtual void free() APPLE_KEXT_OVERRIDE; + +public: + +/* + * withOptions: + * + * Returns a new IOBufferMemoryDescriptor with a buffer large enough to + * hold capacity bytes. The descriptor's length is initially set to the + * capacity. + */ +#ifndef __LP64__ + virtual bool initWithOptions( IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment) APPLE_KEXT_DEPRECATED; /* use withOptions() instead */ +#endif /* !__LP64__ */ + + static IOBufferMemoryDescriptor * withCopy( + task_t inTask, + IOOptionBits options, + vm_map_t sourceMap, + mach_vm_address_t source, + mach_vm_size_t size); + + static IOBufferMemoryDescriptor * withOptions( IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment = 1); + +/*! @function inTaskWithOptions + * @abstract Creates a memory buffer with memory descriptor for that buffer. + * @discussion Added in Mac OS X 10.2, this method allocates a memory buffer with a given size and alignment in the task's address space specified, and returns a memory descriptor instance representing the memory. It is recommended that memory allocated for I/O or sharing via mapping be created via IOBufferMemoryDescriptor. Options passed with the request specify the kind of memory to be allocated - pageablity and sharing are specified with option bits. This function may block and so should not be called from interrupt level or while a simple lock is held. + * @param inTask The task the buffer will be allocated in. + * @param options Options for the allocation:
+ * kIODirectionOut, kIODirectionIn - set the direction of the I/O transfer.
+ * kIOMemoryPhysicallyContiguous - pass to request memory be physically contiguous. This option is heavily discouraged. The request may fail if memory is fragmented, may cause large amounts of paging activity, and may take a very long time to execute.
+ * kIOMemoryPageable - pass to request memory be non-wired - the default for kernel allocated memory is wired.
+ * kIOMemoryPurgeable - pass to request memory that may later have its purgeable state set with IOMemoryDescriptor::setPurgeable. Only supported for kIOMemoryPageable allocations.
+ * kIOMemoryKernelUserShared - pass to request memory that will be mapped into both the kernel and client applications.
+ * kIOMapInhibitCache - allocate memory with inhibited cache setting.
+ * kIOMapWriteThruCache - allocate memory with writethru cache setting.
+ * kIOMapCopybackCache - allocate memory with copyback cache setting.
+ * kIOMapWriteCombineCache - allocate memory with writecombined cache setting. + * @param capacity The number of bytes to allocate. + * @param alignment The minimum required alignment of the buffer in bytes - 1 is the default for no required alignment. For example, pass 256 to get memory allocated at an address with bits 0-7 zero. + * @result Returns an instance of class IOBufferMemoryDescriptor to be released by the caller, which will free the memory desriptor and associated buffer. */ + + static IOBufferMemoryDescriptor * inTaskWithOptions( + task_t inTask, + IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment = 1); + +/*! @function inTaskWithOptions + * @abstract Creates a memory buffer with memory descriptor for that buffer. + * @discussion Added in Mac OS X 10.2, this method allocates a memory buffer with a given size and alignment in the task's address space specified, and returns a memory descriptor instance representing the memory. It is recommended that memory allocated for I/O or sharing via mapping be created via IOBufferMemoryDescriptor. Options passed with the request specify the kind of memory to be allocated - pageablity and sharing are specified with option bits. This function may block and so should not be called from interrupt level or while a simple lock is held. + * @param inTask The task the buffer will be allocated in. + * @param options Options for the allocation:
+ * kIODirectionOut, kIODirectionIn - set the direction of the I/O transfer.
+ * kIOMemoryPhysicallyContiguous - pass to request memory be physically contiguous. This option is heavily discouraged. The request may fail if memory is fragmented, may cause large amounts of paging activity, and may take a very long time to execute.
+ * kIOMemoryPageable - pass to request memory be non-wired - the default for kernel allocated memory is wired.
+ * kIOMemoryPurgeable - pass to request memory that may later have its purgeable state set with IOMemoryDescriptor::setPurgeable. Only supported for kIOMemoryPageable allocations.
+ * kIOMemoryKernelUserShared - pass to request memory that will be mapped into both the kernel and client applications.
+ * kIOMapInhibitCache - allocate memory with inhibited cache setting.
+ * kIOMapWriteThruCache - allocate memory with writethru cache setting.
+ * kIOMapCopybackCache - allocate memory with copyback cache setting.
+ * kIOMapWriteCombineCache - allocate memory with writecombined cache setting. + * @param capacity The number of bytes to allocate. + * @param alignment The minimum required alignment of the buffer in bytes - 1 is the default for no required alignment. For example, pass 256 to get memory allocated at an address with bits 0-7 zero. + * @param kernTag The kernel memory tag + * @param userTag The user memory tag + * @result Returns an instance of class IOBufferMemoryDescriptor to be released by the caller, which will free the memory desriptor and associated buffer. */ + + static IOBufferMemoryDescriptor * inTaskWithOptions( + task_t inTask, + IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment, + uint32_t kernTag, + uint32_t userTag); + +/*! @function inTaskWithPhysicalMask + * @abstract Creates a memory buffer with memory descriptor for that buffer. + * @discussion Added in Mac OS X 10.5, this method allocates a memory buffer with a given size and alignment in the task's address space specified, and returns a memory descriptor instance representing the memory. It is recommended that memory allocated for I/O or sharing via mapping be created via IOBufferMemoryDescriptor. Options passed with the request specify the kind of memory to be allocated - pageablity and sharing are specified with option bits. This function may block and so should not be called from interrupt level or while a simple lock is held. + * @param inTask The task the buffer will be mapped in. Pass NULL to create memory unmapped in any task (eg. for use as a DMA buffer). + * @param options Options for the allocation:
+ * kIODirectionOut, kIODirectionIn - set the direction of the I/O transfer.
+ * kIOMemoryPhysicallyContiguous - pass to request memory be physically contiguous. This option is heavily discouraged. The request may fail if memory is fragmented, may cause large amounts of paging activity, and may take a very long time to execute.
+ * kIOMemoryKernelUserShared - pass to request memory that will be mapped into both the kernel and client applications.
+ * kIOMapInhibitCache - allocate memory with inhibited cache setting.
+ * kIOMapWriteThruCache - allocate memory with writethru cache setting.
+ * kIOMapCopybackCache - allocate memory with copyback cache setting.
+ * kIOMapWriteCombineCache - allocate memory with writecombined cache setting. + * @param capacity The number of bytes to allocate. + * @param physicalMask The buffer will be allocated with pages such that physical addresses will only have bits set present in physicalMask. For example, pass 0x00000000FFFFFFFFULL for a buffer to be accessed by hardware that has 32 address bits. + * @result Returns an instance of class IOBufferMemoryDescriptor to be released by the caller, which will free the memory desriptor and associated buffer. */ + + static IOBufferMemoryDescriptor * inTaskWithPhysicalMask( + task_t inTask, + IOOptionBits options, + mach_vm_size_t capacity, + mach_vm_address_t physicalMask); + +/* + * withCapacity: + * + * Returns a new IOBufferMemoryDescriptor with a buffer large enough to + * hold capacity bytes. The descriptor's length is initially set to the + * capacity. + */ + static IOBufferMemoryDescriptor * withCapacity( + vm_size_t capacity, + IODirection withDirection, + bool withContiguousMemory = false); +#ifndef __LP64__ + virtual bool initWithBytes(const void * bytes, + vm_size_t withLength, + IODirection withDirection, + bool withContiguousMemory = false) APPLE_KEXT_DEPRECATED; /* use withBytes() instead */ +#endif /* !__LP64__ */ + +/* + * withBytes: + * + * Returns a new IOBufferMemoryDescriptor preloaded with bytes (copied). + * The descriptor's length and capacity are set to the input buffer's size. + */ + static IOBufferMemoryDescriptor * withBytes( + const void * bytes, + vm_size_t withLength, + IODirection withDirection, + bool withContiguousMemory = false); + +/* + * setLength: + * + * Change the buffer length of the memory descriptor. When a new buffer + * is created, the initial length of the buffer is set to be the same as + * the capacity. The length can be adjusted via setLength for a shorter + * transfer (there is no need to create more buffer descriptors when you + * can reuse an existing one, even for different transfer sizes). Note + * that the specified length must not exceed the capacity of the buffer. + */ + virtual void setLength(vm_size_t length); + +/* + * setDirection: + * + * Change the direction of the transfer. This method allows one to redirect + * the descriptor's transfer direction. This eliminates the need to destroy + * and create new buffers when different transfer directions are needed. + */ + virtual void setDirection(IODirection direction); + +/* + * getCapacity: + * + * Get the buffer capacity + */ + virtual vm_size_t getCapacity() const; + +/* + * getBytesNoCopy: + * + * Return the virtual address of the beginning of the buffer + */ + virtual void *getBytesNoCopy(); + +/* + * getBytesNoCopy: + * + * Return the virtual address of an offset from the beginning of the buffer + */ + virtual void *getBytesNoCopy(vm_size_t start, vm_size_t withLength); + +/* + * appendBytes: + * + * Add some data to the end of the buffer. This method automatically + * maintains the memory descriptor buffer length. Note that appendBytes + * will not copy past the end of the memory descriptor's current capacity. + */ + virtual bool appendBytes(const void *bytes, vm_size_t withLength); + +#ifndef __LP64__ + virtual void * getVirtualSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_OVERRIDE APPLE_KEXT_DEPRECATED; /* use getBytesNoCopy() instead */ +#endif /* !__LP64__ */ +}; + +#endif /* !_IOBUFFERMEMORYDESCRIPTOR_H */ diff --git a/QualcommWireless/include/IOKit/IOCatalogue.h b/QualcommWireless/include/IOKit/IOCatalogue.h new file mode 100644 index 0000000..55035bc --- /dev/null +++ b/QualcommWireless/include/IOKit/IOCatalogue.h @@ -0,0 +1,236 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOCATALOGUE_H +#define _IOKIT_IOCATALOGUE_H + +#include +#include +#include +#include +#include +#include + +#include + +class IOService; + +extern const OSSymbol * gIOModuleIdentifierKey; +extern const OSSymbol * gIOModuleIdentifierKernelKey; + + +/*! + * @class IOCatalogue + * @abstract In-kernel database for IOKit driver personalities. + * @discussion The IOCatalogue is a database which contains all IOKit driver personalities. IOService uses this resource when matching devices to their associated drivers. + */ +class IOCatalogue : public OSObject +{ + OSDeclareDefaultStructors(IOCatalogue); + +private: + IORWLock * lock; + SInt32 generation; + OSDictionary * personalities; + OSArray * arrayForPersonality(OSDictionary * dict); + void addPersonality(OSDictionary * dict); + +public: +/*! + * @function initialize + * @abstract Creates and initializes the database object and poputates it with in-kernel driver personalities. + */ + static void initialize( void ); + +/*! + * @function init + * @abstract Initializes the database object. + * @param initArray The initial array of driver personalities to populate the database. + */ + bool init( OSArray * initArray ); + +/*! + * @function free + * @abstract Cleans up the database and deallocates memory allocated at initialization. This is never called in normal operation of the system. + */ + void free( void ) APPLE_KEXT_OVERRIDE; + +/*! + * @function findDrivers + * @abstract This is the primary entry point for IOService. + * @param service The service + * @param generationCount Returns a reference to the generation count of the database. The generation count increases only when personalities are added to the database *and* IOService matching has been initiated. + * @result Returns an ordered set of driver personalities ranked on probe-scores. The ordered set must be released by the receiver. + */ + OSOrderedSet * findDrivers( IOService * service, SInt32 * generationCount ); + +/*! + * @function findDrivers + * @abstract A more general purpose interface which allows one to retreive driver personalities based the intersection of the 'matching' dictionary and the personality's own property list. + * @param matching A dictionary containing only keys and values which are to be used for matching. For example, a matching dictionary containing 'IOProviderClass'='IOPCIDevice' will return all personalities with an IOProviderClass key and a value of IOPCIDevice. + * @param generationCount Returns a reference to the current generation of the database. The generation count increases only when personalities are added to the database *and* IOService matching has been initiated. + * @result Returns an ordered set of driver personalities ranked on probe-scores. The ordered set must be released by the receiver. + */ + OSOrderedSet * findDrivers( OSDictionary * matching, SInt32 * generationCount ); + +/*! + * @function addDrivers + * @abstract Adds an array of driver personalities to the database. + * @param array Array of driver personalities to be added to the database. + * @param doNubMatching Start matching process after personalities have been added. + * @result Returns true if driver personality was added to the database successfully. Failure is due to a memory allocation failure. + */ + bool addDrivers( OSArray * array, bool doNubMatching = true ); + +/*! + * @function removeDrivers + * @abstract Remove driver personalities from the database based on matching information provided. + * @param matching A dictionary whose keys and values are used for matching personalities in the database. For example, a matching dictionary containing a 'IOProviderClass' key with the value 'IOPCIDevice' will remove all personalities which have the key 'IOProviderClass' equal to 'IOPCIDevice'. + * @param doNubMatching Start matching process after personalities have been removed. Matching criteria is based on IOProviderClass of those personalities which were removed. This is to allow drivers which haven't been matched to match against NUB's which were blocked by the previous personalities. + * @result Returns true if personality was removed successfully. Failure is due to a memory allocation failure. + */ + bool removeDrivers( OSDictionary * matching, bool doNubMatching = true ); + +/*! + * @function getGenerationCount + * @abstract Get the current generation count of the database. + */ + SInt32 getGenerationCount( void ) const; + +/*! + * @function isModuleLoaded + * @abstract Reports if a kernel module has been loaded for a particular personality. + * @param driver A driver personality's property list. + * @param kextRef A reference to the kext getting loaded. + * @result Returns true if the associated kernel module has been loaded into the kernel for a particular driver personality on which it depends. + */ + bool isModuleLoaded( OSDictionary * driver, OSObject ** kextRef ) const; + +/*! + * @function moduleHasLoaded + * @abstract Callback function called after a IOKit dependent kernel module is loaded. + * @param name Name of the kernel module. + */ + void moduleHasLoaded( const OSSymbol * name ); + +/*! + * @function moduleHasLoaded + * @abstract Callback function called after a IOKit dependent kernel module is loaded. + * @param name Name of the kernel module. + */ + void moduleHasLoaded( const char * name ); + +/*! + * @function terminateDrivers + * @abstract Terminates all instances of a driver which match the contents of the matching dictionary. Does not unload module. + * @param matching A dictionary whose keys and values are used for matching personalities in the database. For example, a matching dictionary containing a 'IOProviderClass' key with the value 'IOPCIDevice' will cause termination for all instances whose personalities have the key 'IOProviderClass' equal to 'IOPCIDevice'. + */ + IOReturn terminateDrivers( OSDictionary * matching ); + +/*! + * @function terminateDriversForModule + * @abstract Terminates all instances of a driver which depends on a particular module and unloads the module. + * @param moduleName Name of the module which is used to determine which driver instances to terminate and unload. + * @param unload Flag to cause the actual unloading of the module. + */ + IOReturn terminateDriversForModule( OSString * moduleName, bool unload = true); + +/*! + * @function terminateDriversForModule + * @abstract Terminates all instances of a driver which depends on a particular module and unloads the module. + * @param moduleName Name of the module which is used to determine which driver instances to terminate and unload. + * @param unload Flag to cause the actual unloading of the module. + */ + IOReturn terminateDriversForModule( const char * moduleName, bool unload = true); + +/*! + * @function startMatching + * @abstract Restarts IOService matching. + * @param identifier All IOService objects with this bundle indentifier are rematched. + */ + bool startMatching( const OSSymbol * identifier ); + + // deprecated, for bin compat +#if defined(__i386__) || defined(__x86_64__) + bool startMatching( OSDictionary * matching ); +#endif + +/*! + * @function reset + * @abstract Return the Catalogue to its initial state. + * @discussion + * Should only be used by kextd just before it sends all kext personalities down during a rescan. + */ + void reset(void); + +/*! + * @function resetAndAddDrivers + * @abstract Replace personalities in IOCatalog with those provided. + * @discussion + * Resets the catalogue with a new set of drivers, preserving matching originals to keep wired memory usage down. + */ + bool resetAndAddDrivers(OSArray * drivers, bool doNubMatching = true); + +/*! + * @function serialize + * @abstract Serializes the catalog for transport to the user. + * @param s The serializer object. + * @result Returns false if unable to serialize database, most likely due to memory shortage. + */ + virtual bool serialize(OSSerialize * s) const APPLE_KEXT_OVERRIDE; + + bool serializeData(IOOptionBits kind, OSSerialize * s) const; + +/* This stuff is no longer used at all we keep it around for i386 + * binary compatibility only. Symbols are no longer exported. + */ + +private: + +/*! + * @function unloadModule + * @abstract Unloads the reqested module if no driver instances are currently depending on it. + * @param moduleName An OSString containing the name of the module to unload. + */ + IOReturn unloadModule( OSString * moduleName ) const; + + IOReturn _removeDrivers(OSDictionary * matching); +}; + +extern const OSSymbol * gIOClassKey; +extern const OSSymbol * gIOProbeScoreKey; +extern IOCatalogue * gIOCatalogue; + +#endif /* ! _IOKIT_IOCATALOGUE_H */ diff --git a/QualcommWireless/include/IOKit/IOCommand.h b/QualcommWireless/include/IOKit/IOCommand.h new file mode 100644 index 0000000..6cfd848 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOCommand.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + * 2001-01-18 gvdl Made the primary queue pointer public, to be used when + * Ownership is clear. + * 11/13/2000 CJS Created IOCommand class and implementation + * + */ + +/*! + * @header IOCommand + * @abstract + * This header contains the IOCommand class definition. + */ + +#ifndef _IOKIT_IO_COMMAND_H_ +#define _IOKIT_IO_COMMAND_H_ + +/* + * Kernel + */ + +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include + +/*! + * @class IOCommand + * @abstract + * This class is an abstract class which represents an I/O command. + * @discussion + * This class is an abstract class which represents an I/O command passed + * from a device driver to a controller. All controller commands (e.g. IOATACommand) + * should inherit from this class. + */ + +class IOCommand : public OSObject +{ + OSDeclareDefaultStructors(IOCommand); + +public: + virtual bool init(void) APPLE_KEXT_OVERRIDE; + +/*! @var fCommandChain + * This variable is used by the current 'owner' to queue the command. During the life cycle of a command it moves through a series of queues. This is the queue pointer for it. Only valid while 'ownership' is clear. For instance a IOCommandPool uses this pointer to maintain its list of free commands. May be manipulated using the kern/queue.h macros */ + queue_chain_t fCommandChain; /* used to queue commands */ +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_COMMAND_H_ */ diff --git a/QualcommWireless/include/IOKit/IOCommandGate.h b/QualcommWireless/include/IOKit/IOCommandGate.h new file mode 100644 index 0000000..2a1d2f2 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOCommandGate.h @@ -0,0 +1,254 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/*[ + * 1999-8-10 Godfrey van der Linden(gvdl) + * Created. + * ]*/ +/*! @language embedded-c++ */ + +#ifndef _IOKIT_IOCOMMANDGATE_H +#define _IOKIT_IOCOMMANDGATE_H + +#include + +/*! + * @class IOCommandGate : public IOEventSource + * @abstract Single-threaded work loop client request mechanism. + * @discussion An IOCommandGate instance is an extremely lightweight mechanism + * that executes an action on the driver's work loop. Although the code does not + * technically execute on the work loop itself, a single-threaded work loop semantic + * is maintained for this event source using the work loop gate. The command gate + * tests for a potential self dead lock by checking if the runCommand request is + * made from the work loop's thread, it doesn't check for a mutual dead lock though + * where a pair of work loop's dead lock each other. + *

+ * The IOCommandGate is a lighter weight version of the IOCommandQueue and + * should be used in preference. Generally use a command queue whenever you need a + * client to submit a request to a work loop. A typical command gate action would + * check if the hardware is active, if so it will add the request to a pending + * queue internal to the device or the device's family. Otherwise if the hardware + * is inactive then this request can be acted upon immediately. + *

+ * CAUTION: The runAction, runCommand, and attemptCommand functions cannot be called from an interrupt context. + * + */ +class IOCommandGate : public IOEventSource +{ + OSDeclareDefaultStructors(IOCommandGate); + +public: +/*! + * @typedef Action + * @discussion Type and arguments of callout C function that is used when + * a runCommand is executed by a client. Cast to this type when you want a C++ + * member function to be used. Note the arg1 - arg3 parameters are straight pass + * through from the runCommand to the action callout. + * @param owner + * Target of the function, can be used as a refcon. The owner is set + * during initialisation of the IOCommandGate instance. Note if a C++ function + * was specified this parameter is implicitly the first paramter in the target + * member function's parameter list. + * @param arg0 Argument to action from run operation. + * @param arg1 Argument to action from run operation. + * @param arg2 Argument to action from run operation. + * @param arg3 Argument to action from run operation. + */ + typedef IOReturn (*Action)(OSObject *owner, + void *arg0, void *arg1, + void *arg2, void *arg3); + +protected: + +/*! @struct ExpansionData + * @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + * Reserved for future use. (Internal use only) */ + APPLE_KEXT_WSHADOW_PUSH; + ExpansionData *reserved; + APPLE_KEXT_WSHADOW_POP; + +public: +/*! @function commandGate + * @abstract Factory method to create and initialise an IOCommandGate, See $link init. + * @result Returns a pointer to the new command gate if sucessful, 0 otherwise. */ + static IOCommandGate *commandGate(OSObject *owner, Action action = NULL); + +/*! @function init + * @abstract Class initialiser. + * @discussion Initialiser for IOCommandGate operates only on newly 'newed' + * objects. Shouldn't be used to re-init an existing instance. + * @param owner Owner of this, newly created, instance of the IOCommandGate. This argument will be used as the first parameter in the action callout. + * @param action + * Pointer to a C function that is called whenever a client of the + * IOCommandGate calls runCommand. NB Can be a C++ member function but caller + * must cast the member function to $link IOCommandGate::Action and they will get a + * compiler warning. Defaults to zero, see $link IOEventSource::setAction. + * @result True if inherited classes initialise successfully. */ + virtual bool init(OSObject *owner, Action action = NULL); + +// Superclass overrides + virtual void free() APPLE_KEXT_OVERRIDE; + virtual void setWorkLoop(IOWorkLoop *inWorkLoop) APPLE_KEXT_OVERRIDE; + +/*! @function runCommand + * @abstract Single thread a command with the target work loop. + * @discussion Client function that causes the current action to be called in + * a single threaded manner. Beware the work loop's gate is recursive and command + * gates can cause direct or indirect re-entrancy. When the executing on a + * client's thread runCommand will sleep until the work loop's gate opens for + * execution of client actions, the action is single threaded against all other + * work loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called. + * @param arg0 Parameter for action of command gate, defaults to 0. + * @param arg1 Parameter for action of command gate, defaults to 0. + * @param arg2 Parameter for action of command gate, defaults to 0. + * @param arg3 Parameter for action of command gate, defaults to 0. + * @result kIOReturnSuccess if successful. kIOReturnAborted if a disabled command gate is free()ed before being reenabled, kIOReturnNoResources if no action available. + */ + virtual IOReturn runCommand(void *arg0 = NULL, void *arg1 = NULL, + void *arg2 = NULL, void *arg3 = NULL); + +/*! @function runAction + * @abstract Single thread a call to an action with the target work loop. + * @discussion Client function that causes the given action to be called in + * a single threaded manner. Beware the work loop's gate is recursive and command + * gates can cause direct or indirect re-entrancy. When the executing on a + * client's thread runAction will sleep until the work loop's gate opens for + * execution of client actions, the action is single threaded against all other + * work loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called. + * @param action Pointer to function to be executed in the context of the work loop. + * @param arg0 Parameter for action parameter, defaults to 0. + * @param arg1 Parameter for action parameter, defaults to 0. + * @param arg2 Parameter for action parameter, defaults to 0. + * @param arg3 Parameter for action parameter, defaults to 0. + * @result The return value of action if it was called, kIOReturnBadArgument if action is not defined, kIOReturnAborted if a disabled command gate is free()ed before being reenabled. + */ + virtual IOReturn runAction(Action action, + void *arg0 = NULL, void *arg1 = NULL, + void *arg2 = NULL, void *arg3 = NULL); + +#ifdef __BLOCKS__ +/*! @function runActionBlock + * @abstract Single thread a call to an action with the target work loop. + * @discussion Client function that causes the given action to be called in + * a single threaded manner. Beware the work loop's gate is recursive and command + * gates can cause direct or indirect re-entrancy. When the executing on a + * client's thread runAction will sleep until the work loop's gate opens for + * execution of client actions, the action is single threaded against all other + * work loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called. + * @param action Block to be executed in the context of the work loop. + * @result The return value of action if it was called, kIOReturnBadArgument if action is not defined, kIOReturnAborted if a disabled command gate is free()ed before being reenabled. + */ + IOReturn runActionBlock(ActionBlock action); +#endif /* __BLOCKS__ */ + +/*! @function attemptCommand + * @abstract Single thread a command with the target work loop. + * @discussion Client function that causes the current action to be called in + * a single threaded manner. When the executing on a client's thread attemptCommand will fail if the work loop's gate is closed. + * @param arg0 Parameter for action of command gate, defaults to 0. + * @param arg1 Parameter for action of command gate, defaults to 0. + * @param arg2 Parameter for action of command gate, defaults to 0. + * @param arg3 Parameter for action of command gate, defaults to 0. + * @result kIOReturnSuccess if successful. kIOReturnNotPermitted if this event source is currently disabled, kIOReturnNoResources if no action available, kIOReturnCannotLock if lock attempt fails. + */ + virtual IOReturn attemptCommand(void *arg0 = NULL, void *arg1 = NULL, + void *arg2 = NULL, void *arg3 = NULL); + +/*! @function attemptAction + * @abstract Single thread a call to an action with the target work loop. + * @discussion Client function that causes the given action to be called in + * a single threaded manner. Beware the work loop's gate is recursive and command + * gates can cause direct or indirect re-entrancy. When the executing on a + * client's thread attemptCommand will fail if the work loop's gate is closed. + * @param action Pointer to function to be executed in context of the work loop. + * @param arg0 Parameter for action parameter, defaults to 0. + * @param arg1 Parameter for action parameter, defaults to 0. + * @param arg2 Parameter for action parameter, defaults to 0. + * @param arg3 Parameter for action parameter, defaults to 0. + * @result kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnNotPermitted if this event source is currently disabled, kIOReturnCannotLock if lock attempt fails. + * + */ + virtual IOReturn attemptAction(Action action, + void *arg0 = NULL, void *arg1 = NULL, + void *arg2 = NULL, void *arg3 = NULL); + +/*! @function commandSleep + * @abstract Put a thread that is currently holding the command gate to sleep. + * @discussion Put a thread to sleep waiting for an event but release the gate first. If the event occurs then the commandGate is closed before the function returns. If the thread does not hold the gate, panic. + * @param event Pointer to an address. + * @param interruptible THREAD_UNINT, THREAD_INTERRUPTIBLE or THREAD_ABORTSAFE. THREAD_UNINT specifies that the sleep cannot be interrupted by a signal. THREAD_INTERRUPTIBLE specifies that the sleep may be interrupted by a "kill -9" signal. THREAD_ABORTSAFE (the default value) specifies that the sleep may be interrupted by any user signal. + * @result THREAD_AWAKENED - normal wakeup, THREAD_TIMED_OUT - timeout expired, THREAD_INTERRUPTED - interrupted, THREAD_RESTART - restart operation entirely. */ + virtual IOReturn commandSleep(void *event, + UInt32 interruptible = THREAD_ABORTSAFE); + +/*! @function commandWakeup + * @abstract Wakeup one or more threads that are asleep on an event. + * @param event Pointer to an address. + * @param oneThread true to only wake up at most one thread, false otherwise. */ + virtual void commandWakeup(void *event, bool oneThread = false); + +/*! @function disable + * @abstract Disable the command gate + * @discussion When a command gate is disabled all future calls to runAction and runCommand will stall until the gate is enable()d later. This can be used to block client threads when a system sleep is requested. The IOWorkLoop thread itself will never stall, even when making runAction/runCommand calls. This call must be made from a gated context, to clear potential race conditions. */ + virtual void disable() APPLE_KEXT_OVERRIDE; + +/*! @function enable + * @abstract Enable command gate, this will unblock any blocked Commands and Actions. + * @discussion Enable the command gate. The attemptAction/attemptCommand calls will now be enabled and can succeeed. Stalled runCommand/runAction calls will be woken up. */ + virtual void enable() APPLE_KEXT_OVERRIDE; + +/*! @function commandSleep + * @abstract Put a thread that is currently holding the command gate to sleep. + * @discussion Put a thread to sleep waiting for an event but release the gate first. If the event occurs or timeout occurs then the commandGate is closed before the function returns. If the thread does not hold the gate, panic. + * @param event Pointer to an address. + * @param deadline Clock deadline to timeout the sleep. + * @param interruptible THREAD_UNINT, THREAD_INTERRUPTIBLE or THREAD_ABORTSAFE. THREAD_UNINT specifies that the sleep cannot be interrupted by a signal. THREAD_INTERRUPTIBLE specifies that the sleep may be interrupted by a "kill -9" signal. THREAD_ABORTSAFE specifies that the sleep may be interrupted by any user signal. + * @result THREAD_AWAKENED - normal wakeup, THREAD_TIMED_OUT - timeout expired, THREAD_INTERRUPTED - interrupted, THREAD_RESTART - restart operation entirely. */ + virtual IOReturn commandSleep(void *event, + AbsoluteTime deadline, + UInt32 interruptible); + +private: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IOCommandGate, 0); +#else + OSMetaClassDeclareReservedUsed(IOCommandGate, 0); +#endif + OSMetaClassDeclareReservedUnused(IOCommandGate, 1); + OSMetaClassDeclareReservedUnused(IOCommandGate, 2); + OSMetaClassDeclareReservedUnused(IOCommandGate, 3); + OSMetaClassDeclareReservedUnused(IOCommandGate, 4); + OSMetaClassDeclareReservedUnused(IOCommandGate, 5); + OSMetaClassDeclareReservedUnused(IOCommandGate, 6); + OSMetaClassDeclareReservedUnused(IOCommandGate, 7); +}; + +#endif /* !_IOKIT_IOCOMMANDGATE_H */ diff --git a/QualcommWireless/include/IOKit/IOCommandPool.h b/QualcommWireless/include/IOKit/IOCommandPool.h new file mode 100644 index 0000000..ee30bb4 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOCommandPool.h @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2000-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + * 2001-01-17 gvdl Re-implement on IOCommandGate::commandSleep + * 11/13/2000 CJS Created IOCommandPool class and implementation + * + */ + +/*! + * @header IOCommandPool + * @abstract + * This header contains the IOCommandPool class definition. + */ + +#ifndef _IOKIT_IO_COMMAND_POOL_H_ +#define _IOKIT_IO_COMMAND_POOL_H_ + +/* + * Kernel + */ + +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include +#include +#include +#include +#include + +/*! + * @class IOCommandPool + * @abstract Manipulates a pool of commands which inherit from IOCommand. + * @discussion + * The IOCommandPool class is used to manipulate a pool of commands which + * inherit from IOCommand. It includes a factory method to create a pool + * of a certain size. Once the factory method is invoked, the semaphore + * is set to zero. The caller must then put commands in the pool by creating + * the command (via the controller's factory method or a memory allocation) + * and calling the returnCommand method with the newly created command as its + * argument. + */ + +class IOCommandPool : public OSObject +{ + OSDeclareDefaultStructors(IOCommandPool); + + +protected: + + queue_head_t fQueueHead; /* head of the queue of elements available */ + UInt32 fSleepers; /* Count of threads sleeping on this pool */ + IOCommandGate *fSerializer; /* command gate used for serializing pool access */ + +/*! @struct ExpansionData + * @discussion This structure will be used to expand the capablilties of the IOEventSource in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + * Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +/*! + * @const kIOCommandPoolDefaultSize + * @abstract The default size of any command pool. + * @discussion + * kIOCommandPoolDefaultSize is the default size of any command pool. + * The default size was determined to be the smallest size for which + * a pool makes sense. + */ + + static const UInt32 kIOCommandPoolDefaultSize = 2; + +/* + * Free all of this object's outstanding resources. + */ + + virtual void free(void) APPLE_KEXT_OVERRIDE; + + +public: + +/*! + * @function initWithWorkLoop + * @abstract Primary initializer for an IOCommandPool object. + * @discussion Primary initializer for an IOCommandPool. + * Should probably use IOCommandPool::withWorkLoop() as it is easier to use. + * @param workLoop + * The workloop that this command pool should synchronize with. + * @result Returns true if command pool was successfully initialized. + */ + virtual bool initWithWorkLoop(IOWorkLoop *workLoop); + +/*! + * @function withWorkLoop + * @abstract Primary factory method for the IOCommandPool class + * @discussion + * The withWorkLoop method is what is known as a factory method. It creates + * a new instance of an IOCommandPool and returns a pointer to that object. + * @param inWorkLoop + * The workloop that this command pool should synchronize with. + * @result + * Returns a pointer to an instance of IOCommandPool if successful, + * otherwise NULL. + */ + + static IOCommandPool *withWorkLoop(IOWorkLoop *inWorkLoop); + +/*! + * @function init + * @abstract Should never be used, obsolete. See initWithWorkLoop. + */ + virtual bool init(IOService *inOwner, + IOWorkLoop *inWorkLoop, + UInt32 inSize = kIOCommandPoolDefaultSize); + +/*! + * @function withWorkLoop + * @abstract Should never be used, obsolete. See IOCommandPool::withWorkLoop. + */ + static IOCommandPool *commandPool(IOService *inOwner, + IOWorkLoop *inWorkLoop, + UInt32 inSize = kIOCommandPoolDefaultSize); + + +/*! + * @function getCommand + * @discussion The getCommand method is used to get a pointer to an object of type IOCommand from the pool. + * @param blockForCommand + * If the caller would like to have its thread slept until a command is + * available, it should pass true, else false. + * @result + * If the caller passes true in blockForCommand, getCommand guarantees that + * the result will be a pointer to an IOCommand object from the pool. If + * the caller passes false, s/he is responsible for checking whether a non-NULL + * pointer was returned. + */ + + virtual IOCommand *getCommand(bool blockForCommand = true); + +/*! + * @function returnCommand + * @discussion + * The returnCommand method is used to place an object of type IOCommand + * into the pool, whether it be the first time, or the 1000th time. + * @param command + * The command to place in the pool. + */ + + virtual void returnCommand(IOCommand *command); + +protected: + +/*! + * @function gatedGetCommand + * @discussion + * The gatedGetCommand method is used to serialize the extraction of a + * command from the pool behind a command gate, runAction-ed by getCommand. + * @param command + * A pointer to a pointer to an IOCommand object where the returned + * command will be stored. + * @param blockForCommand + * A bool that indicates whether to block the request until a command + * becomes available. + * @result + * Returns kIOReturnNoResources if no command is available and the client + * doesn't wish to block until one does become available. + * kIOReturnSuccess if the vCommand argument is valid. + */ + virtual IOReturn gatedGetCommand( + LIBKERN_RETURNS_NOT_RETAINED IOCommand **command, bool blockForCommand); + +/*! + * @function gatedReturnCommand + * @discussion + * The gatedReturnCommand method is used to serialize the return of a + * command to the pool behind a command gate, runAction-ed by returnCommand. + * @param command + * A pointer to the IOCommand object to be returned to the pool. + * @result + * Always returns kIOReturnSuccess if the vCommand argument is valid. + */ + virtual IOReturn gatedReturnCommand(IOCommand *command); + +private: + OSMetaClassDeclareReservedUnused(IOCommandPool, 0); + OSMetaClassDeclareReservedUnused(IOCommandPool, 1); + OSMetaClassDeclareReservedUnused(IOCommandPool, 2); + OSMetaClassDeclareReservedUnused(IOCommandPool, 3); + OSMetaClassDeclareReservedUnused(IOCommandPool, 4); + OSMetaClassDeclareReservedUnused(IOCommandPool, 5); + OSMetaClassDeclareReservedUnused(IOCommandPool, 6); + OSMetaClassDeclareReservedUnused(IOCommandPool, 7); +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_COMMAND_POOL_H_ */ diff --git a/QualcommWireless/include/IOKit/IOConditionLock.h b/QualcommWireless/include/IOKit/IOConditionLock.h new file mode 100644 index 0000000..52dd502 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOConditionLock.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * Copyright (c) 1994-1996 NeXT Software, Inc. All rights reserved. + */ + +#ifndef _IOKIT_IOCONDITIONLOCK_H +#define _IOKIT_IOCONDITIONLOCK_H + +#include +#include +#include + +#include + +class IOConditionLock : public OSObject +{ + OSDeclareDefaultStructors(IOConditionLock); + +private: + IOLock * cond_interlock; // condition var Simple lock + volatile int condition; + + IOLock * sleep_interlock; // sleep lock Simple lock + unsigned char interruptible; + volatile bool want_lock; + volatile bool waiting; + +public: + static IOConditionLock *withCondition(int condition, bool inIntr = true); + virtual bool initWithCondition(int condition, bool inIntr = true); + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual bool tryLock(); // acquire lock, no waiting + virtual int lock(); // acquire lock (enter critical section) + virtual void unlock(); // release lock (leave critical section) + + virtual bool getInterruptible() const; + virtual int getCondition() const; + virtual int setCondition(int condition); + + virtual int lockWhen(int condition);// acquire lock when condition + virtual void unlockWith(int condition); // set condition & release lock +}; + +#endif /* _IOKIT_IOCONDITIONLOCK_H */ diff --git a/QualcommWireless/include/IOKit/IODMACommand.h b/QualcommWireless/include/IOKit/IODMACommand.h new file mode 100644 index 0000000..2188f95 --- /dev/null +++ b/QualcommWireless/include/IOKit/IODMACommand.h @@ -0,0 +1,649 @@ +/* + * Copyright (c) 2005-2016 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IODMACOMMAND_H +#define _IODMACOMMAND_H + +#include +#include +#include +class IOMapper; +class IOBufferMemoryDescriptor; + +enum{ + kIODMAMapOptionMapped = 0x00000000, + kIODMAMapOptionBypassed = 0x00000001, + kIODMAMapOptionNonCoherent = 0x00000002, + kIODMAMapOptionUnmapped = 0x00000003, + kIODMAMapOptionTypeMask = 0x0000000f, + + kIODMAMapOptionNoCacheStore = 0x00000010, // Memory in descriptor + kIODMAMapOptionOnChip = 0x00000020,// Indicates DMA is on South Bridge + kIODMAMapOptionIterateOnly = 0x00000040// DMACommand will be used as a cursor only +}; + +/**************************** class IODMACommand ***************************/ + +/*! + * @class IODMACommand + * @abstract A mechanism to convert memory references to I/O bus addresses. + * @discussion The IODMACommand is supersedes the IOMemoryCursor and greatly enhances the functionality and power of it. The command can be specified to output 64 bit physical addresses and also allows driver writers bypass mapping hardware or get addresses suitable for non-snooped DMA. + *

+ * The command is designed to be very easily subclassable. Most driver writers need to associate some DMA operations with their memory descriptor and usually use a C structure for that purpose. This structure is often kept in a linked list. This IODMACommand has built it linkage and can be derived and 'public:' variables added, giving the developer a structure that can associate a memory descriptor with a particular dma command but will also allow the developer to generate that command and keep the state necessary for tracking it. + *

+ * It is envisaged that a pool of IODMACommands will be created at driver initialisation and each command will be kept in an IOCommandPool while not in use. However if developers wishes to maintain their own free lists that is certainly possible. See the and for sample code on manipulating the command's doubly linked list entries. + *

+ * The IODMACommand can be used in a 'weak-linked' manner. To do this you must avoid using any static member functions. Use the, much slower but safe, weakWithSpecification function. On success a dma command instance will be returned. This instance can then be used to clone as many commands as is needed. Remember deriving from this class can not be done weakly, that is no weak subclassing! + */ + +class IODMACommand : public IOCommand +{ + OSDeclareDefaultStructorsWithDispatch(IODMACommand); + + friend class IODMAEventSource; + +public: + +/*! + * @typedef Segment32 + * @discussion A 32 bit I/O bus address/length pair + */ + struct Segment32 { + UInt32 fIOVMAddr, fLength; + }; + +/*! + * @typedef Segment64 + * @discussion A 64 bit I/O bus address/length pair + */ + struct Segment64 { + UInt64 fIOVMAddr, fLength; + }; + +/*! @enum MappingOptions + * @abstract Mapping types to indicate the desired mapper type for translating memory descriptors into I/O DMA Bus addresses. + * @constant kNonCoherent Used by drivers for non-coherent transfers, implies unmapped memmory + * @constant kMapped Allow a driver to define addressing size + * @constant kBypassed Allow drivers to bypass any mapper + * @constant kMaxMappingOptions Internal use only + */ + enum MappingOptions { + kMapped = kIODMAMapOptionMapped, + kBypassed = kIODMAMapOptionBypassed, + kNonCoherent = kIODMAMapOptionNonCoherent, + kUnmapped = kIODMAMapOptionUnmapped, + kTypeMask = kIODMAMapOptionTypeMask, + + kNoCacheStore = kIODMAMapOptionNoCacheStore, // Memory in descriptor + kOnChip = kIODMAMapOptionOnChip, // Indicates DMA is on South Bridge + kIterateOnly = kIODMAMapOptionIterateOnly// DMACommand will be used as a cursor only + }; + + struct SegmentOptions { + uint8_t fStructSize; + uint8_t fNumAddressBits; + uint64_t fMaxSegmentSize; + uint64_t fMaxTransferSize; + uint32_t fAlignment; + uint32_t fAlignmentLength; + uint32_t fAlignmentInternalSegments; + }; + +/*! @enum SynchronizeOptions + * @abstract Options for the synchronize method. + * @constant kForceDoubleBuffer Copy the entire prepared range to a new page aligned buffer. + */ + enum SynchronizeOptions { + kForceDoubleBuffer = 0x01000000 + }; + +/*! + * @typedef SegmentFunction + * @discussion Pointer to a C function that translates a 64 segment and outputs a single desired segment to the array at the requested index. There are a group of pre-implemented SegmentFunctions that may be usefull to the developer below. + * @param segment The 64Bit I/O bus address and length. + * @param segments Base of the output vector of DMA address length pairs. + * @param segmentIndex Index to output 'segment' in the 'segments' array. + * @result Returns true if segment encoding succeeded. false may be returned if the current segment does not fit in an output segment, i.e. a 38bit address wont fit into a 32 encoding. + */ + typedef bool (*SegmentFunction)(IODMACommand *target, + Segment64 segment, + void *segments, + UInt32 segmentIndex); + +// -------------- Preimplemented output functions ---------------- + +/*! @function OutputHost32 + * @abstract Output host natural Segment32 output segment function. + */ + static bool OutputHost32(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputHost32 + * @abstract Output host natural Segment32 output segment function. + */ +#define kIODMACommandOutputHost32 (IODMACommand::OutputHost32) + +/*! @function OutputBig32 + * @abstract Output big-endian Segment32 output segment function. + */ + static bool OutputBig32(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputBig32 + * @abstract Output big-endian Segment32 output segment function. + */ +#define kIODMACommandOutputBig32 (IODMACommand::OutputBig32) + +/*! @function OutputLittle32 + * @abstract Output little-endian Segment32 output segment function. + */ + static bool OutputLittle32(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputLittle32 + * @abstract Output little-endian Segment32 output segment function. + */ +#define kIODMACommandOutputLittle32 (IODMACommand::OutputLittle32) + +/*! @function OutputHost64 + * @abstract Output host natural Segment64 output segment function. + */ + static bool OutputHost64(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputHost64 + * @abstract Output host natural Segment64 output segment function. + */ +#define kIODMACommandOutputHost64 (IODMACommand::OutputHost64) + +/*! @function OutputBig64 + * @abstract Output big-endian Segment64 output segment function. + */ + static bool OutputBig64(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputBig64 + * @abstract Output big-endian Segment64 output segment function. + */ +#define kIODMACommandOutputBig64 (IODMACommand::OutputBig64) + +/*! @function OutputLittle64 + * @abstract Output little-endian Segment64 output segment function. + */ + static bool OutputLittle64(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputLittle64 + * @abstract Output little-endian Segment64 output segment function. + */ +#define kIODMACommandOutputLittle64 (IODMACommand::OutputLittle64) + +/*! @function withSpecification + * @abstract Creates and initializes an IODMACommand in one operation. + * @discussion Factory function to create and initialize an IODMACommand in one operation. + * @param outSegFunc SegmentFunction to call to output one physical segment. A set of nine commonly required segment functions are provided. + * @param numAddressBits Number of bits that the hardware uses on its internal address bus. Typically 32 but may be more on modern hardware. A 0 implies no-restriction other than that implied by the output segment function. + * @param maxSegmentSize Maximum allowable size for one segment. If 0 is passed the maximum segment size is unlimited. + * @param mappingOptions is the type of mapping that is required to translate an IOMemoryDescriptor into the desired number of bits. For instance if your hardware only supports 32 bits but must run on machines with > 4G of RAM some mapping will be required. Number of bits will be specified in numAddressBits, see below.This parameter can take 3 values:- kNonCoherent - used for non-coherent hardware transfers, Mapped - Validate that all I/O bus generated addresses are within the number of addressing bits specified, Bypassed indicates that bypassed addressing is required, this is used when the hardware transferes are into coherent memory but no mapping is required. See also prepare() for failure cases. + * @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + * @param alignment Alignment restriction, in bytes, on I/O bus addresses. Defaults to single byte alignment. + * @param mapper For mapping types kMapped & kBypassed mapper is used to define the hardware that will perform the mapping, defaults to the system mapper. + * @param refCon Reference Constant + * @result Returns a new IODMACommand if successfully created and initialized, 0 otherwise. + */ + static IODMACommand * + withSpecification(SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mappingOptions = kMapped, + UInt64 maxTransferSize = 0, + UInt32 alignment = 1, + IOMapper *mapper = NULL, + void *refCon = NULL); + +/*! @function weakWithSpecification + * @abstract Creates and initialises an IODMACommand in one operation if this version of the operating system supports it. + * @discussion Factory function to create and initialise an IODMACommand in one operation. The function allows a developer to 'weak' link with IODMACommand. This function will return kIOReturnUnsupported if the IODMACommand is unavailable. This function is actually fairly slow so it will be better to call it once then clone the successfully create command using cloneCommand (q.v.). + * @param newCommand Output reference variable of the newly created IODMACommand. + * @param outSegFunc SegmentFunction to call to output one physical segment. A set of nine commonly required segment functions are provided. + * @param numAddressBits Number of bits that the hardware uses on its internal address bus. Typically 32 but may be more on modern hardware. A 0 implies no-restriction other than that implied by the output segment function. + * @param maxSegmentSize Maximum allowable size for one segment. Zero is treated as an unlimited segment size. + * @param mapType is the type of mapping that is required to translate an IOMemoryDescriptor into the desired number of bits. For instance if your hardware only supports 32 bits but must run on machines with > 4G of RAM some mapping will be required. Number of bits will be specified in numAddressBits, see below. This parameter can take 3 values:- kNonCoherent - used for non-coherent hardware transfers, Mapped - Validate that all I/O bus generated addresses are within the number of addressing bits specified, Bypassed indicates that bypassed addressing is required, this is used when the hardware transfers are into coherent memory but no mapping is required. See also prepare() for failure cases. + * @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + * @param alignment Alignment restriction, in bytes, on I/O bus addresses. Defaults to single byte alignment. + * @param mapper For mapping types kMapped & kBypassed mapper is used to define the hardware that will perform the mapping, defaults to the system mapper. + * @param refCon Reference Constant + * @result kIOReturnSuccess if everything is OK, otherwise kIOReturnBadArgument if newCommand is NULL, kIOReturnUnsupported if the kernel doesn't export IODMACommand or IOReturnError if the new command fails to init, q.v. initWithSpecification. + */ +// Note that the function has the attribute always_inline. +// The point of this function is to make a call into the kernel +// without generating an undefined symbol. If the client could call +// the code as a function then the goal of no undefined symbols +// would be lost thus defeating the purpose. + static inline IOReturn weakWithSpecification + (IODMACommand **newCommand, + SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mapType = kMapped, + UInt64 maxTransferSize = 0, + UInt32 alignment = 1, + IOMapper *mapper = NULL, + void *refCon = NULL) __attribute__((always_inline)); + + static IODMACommand * + withSpecification(SegmentFunction outSegFunc, + const SegmentOptions * segmentOptions, + uint32_t mappingOptions, + IOMapper * mapper, + void * refCon); + + +/*! @function withRefCon + * @abstract Creates and initializes an unspecified IODMACommand. + * @discussion Factory function to create and initialize an unspecified IODMACommand. prepareWithSpecification() must be used to prepare the IODMACommand before use. + * @param refCon Reference Constant + * @result Returns a new IODMACommand if successfully created and initialized, 0 otherwise. + */ + static IODMACommand * withRefCon(void * refCon); + +/*! + * @function cloneCommand + * @abstract Creates a new command based on the specification of the current one. + * @discussion Factory function to create and initialise an IODMACommand in one operation. The current command's specification will be duplicated in the new object, but however none of its state will be duplicated. This means that it is safe to clone a command even if it is currently active and running, however you must be certain that the command to be duplicated does have a valid reference for the duration. + * @result Returns a new IODMACommand if successfully created and initialised, 0 otherwise. + */ + virtual IODMACommand *cloneCommand(void *refCon = NULL); + +/*! @function initWithSpecification + * @abstract Primary initializer for the IODMACommand class. + * @param outSegFunc SegmentFunction to call to output one physical segment. A set of nine commonly required segment functions are provided. + * @param numAddressBits Number of bits that the hardware uses on its internal address bus. Typically 32 but may be more on modern hardware. A 0 implies no-restriction other than that implied by the output segment function. + * @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0 which means any size. + * @param mappingOptions is the type of mapping that is required to translate an IOMemoryDescriptor into the desired number of bits. For instance if your hardware only supports 32 bits but must run on machines with > 4G of RAM some mapping will be required. Number of bits will be specified in numAddressBits, see below.This parameter can take 3 values:- kNonCoherent - used for non-coherent hardware transfers, Mapped - Validate that all I/O bus generated addresses are within the number of addressing bits specified, Bypassed indicates that bypassed addressing is required, this is used when the hardware transferes are into coherent memory but no mapping is required. See also prepare() for failure cases. + * @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + * @param alignment Alignment restriction, in bytes, on I/O bus addresses. Defaults to single byte alignment. + * @param mapper For mapping types kMapped & kBypassed mapper is used to define the hardware that will perform the mapping, defaults to the system mapper. + * @param refCon Reference Constant + * @result Can fail if the mapping type is not recognised, if one of the 3 mandatory parameters are set to 0, if a 32 bit output function is selected when more than 32 bits of address is required or, if kBypassed is requested on a machine that doesn't support bypassing. Returns true otherwise. + */ + virtual bool initWithSpecification( SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mappingOptions = kMapped, + UInt64 maxTransferSize = 0, + UInt32 alignment = 1, + IOMapper *mapper = NULL, + void *refCon = NULL); + +/*! @function setMemoryDescriptor + * @abstract Sets and resets the DMACommand's current memory descriptor + * @discussion The DMA command will configure itself based on the information that it finds in the memory descriptor. It looks for things like the direction of the memory descriptor and whether the current memory descriptor is already mapped into some IOMMU. As a programmer convenience it can also prepare the DMA command immediately. See prepare(). Note the IODMACommand is designed to used multiple times with a succession of memory descriptors, making the pooling of commands possible. It is an error though to attempt to reset a currently prepared() DMA command. Warning: This routine may block so never try to autoprepare an IODMACommand while in a gated context, i.e. one of the WorkLoops action call outs. + * @param mem A pointer to the current I/Os memory descriptor. + * @param autoPrepare An optional boolean variable that will call the prepare() function automatically after the memory descriptor is processed. Defaults to true. + * @result Returns kIOReturnSuccess, kIOReturnBusy if currently prepared, kIOReturnNoSpace if the length(mem) >= Maximum Transfer Size or the error codes returned by prepare() (qv). + */ + virtual IOReturn setMemoryDescriptor(const IOMemoryDescriptor *mem, + bool autoPrepare = true); + +/*! @function clearMemoryDescriptor + * @abstract Clears the DMACommand's current memory descriptor + * @discussion completes and invalidates the cache if the DMA command is currently active, copies all data from bounce buffers if necessary and releases all resources acquired during setMemoryDescriptor. + * @param autoComplete An optional boolean variable that will call the complete() function automatically before the memory descriptor is processed. Defaults to true. + */ + virtual IOReturn clearMemoryDescriptor(bool autoComplete = true); + +/*! @function getMemoryDescriptor + * @abstract Get the current memory descriptor + */ + virtual const IOMemoryDescriptor *getMemoryDescriptor() const; + +/*! @function getIOMemoryDescriptor + * @abstract Get the memory descriptor to be used for DMA + */ + IOMemoryDescriptor * getIOMemoryDescriptor() const; + +/*! @function prepare + * @abstract Prepare the memory for an I/O transfer. + * @discussion Allocate the mapping resources neccessary for this transfer, specifying a sub range of the IOMemoryDescriptor that will be the target of the I/O. The complete() method frees these resources. Data may be copied to buffers for kIODirectionOut memory descriptors, depending on hardware mapping resource availabilty or alignment restrictions. It should be noted that the this function may block and should only be called on the clients context, i.e never call this routine while gated; also the call itself is not thread safe though this should be an issue as each IODMACommand is independant. + * @param offset defines the starting offset in the memory descriptor the DMA command will operate on. genIOVMSegments will produce its results based on the offset and length passed to the prepare method. + * @param length defines the ending position in the memory descriptor the DMA command will operate on. genIOVMSegments will produce its results based on the offset and length passed to the prepare method. + * @param flushCache Flush the caches for the memory descriptor and make certain that the memory cycles are complete. Defaults to true for kNonCoherent and is ignored by the other types. + * @param synchronize Copy any buffered data back from the target IOMemoryDescriptor. Defaults to true, if synchronize() is being used to explicitly copy data, passing false may avoid an unneeded copy. + * @result An IOReturn code. */ + + virtual IOReturn prepare(UInt64 offset = 0, UInt64 length = 0, bool flushCache = true, bool synchronize = true); + +/*! @function complete + * @abstract Complete processing of DMA mappings after an I/O transfer is finished. + * @discussion This method should not be called unless a prepare was previously issued; the prepare() and complete() must occur in pairs, before and after an I/O transfer + * @param invalidateCache Invalidate the caches for the memory descriptor. Defaults to true for kNonCoherent and is ignored by the other types. + * @param synchronize Copy any buffered data back to the target IOMemoryDescriptor. Defaults to true, if synchronize() is being used to explicitly copy data, passing false may avoid an unneeded copy. + * @result kIOReturnNotReady if not prepared, kIOReturnSuccess otherwise. */ + + virtual IOReturn complete(bool invalidateCache = true, bool synchronize = true); + +/*! @function synchronize + * @abstract Bring IOMemoryDescriptor and IODMACommand buffers into sync. + * @discussion This method should not be called unless a prepare was previously issued. If needed a caller may synchronize any IODMACommand buffers with the original IOMemoryDescriptor buffers. + * @param options Specifies the direction of the copy: + * kIODirectionOut copy IOMemoryDesciptor memory to any IODMACommand buffers. By default this action takes place automatically at prepare(). + * kIODirectionIn copy any IODMACommand buffers back to the IOMemoryDescriptor. By default this action takes place automatically at complete(). + * kForceDoubleBuffer copy the entire prepared range to a new page aligned buffer. + * @result kIOReturnNotReady if not prepared, kIOReturnBadArgument if invalid options are passed, kIOReturnSuccess otherwise. */ + + virtual IOReturn synchronize(IOOptionBits options); + +/*! @function genIOVMSegments + * @abstract Generates a physical scatter/gather for the current DMA command + * @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. The constraints that are set during initialisation will be respected. This function maintains the state across multiple calls for efficiency. However the state is discarded if the new offset is not the expected one. + * @param offset input/output parameter, defines the starting and ending offset in the memory descriptor, relative to any offset passed to the prepare() method. + * @param segments Void pointer to base of output physical scatter/gather list. Always passed directly onto the SegmentFunction. + * @param numSegments Input/output parameter Number of segments that can fit in the segment array and returns number of segments generated. + * @result kIOReturnSuccess on success, kIOReturnOverrun if the memory descriptor is exhausted, kIOReturnMessageTooLarge if the output segment function's address bits has insufficient resolution for a segment, kIOReturnNotReady if the DMA command has not be prepared, kIOReturnBadArgument if the DMA command doesn't have a memory descriptor yet or some of the parameters are NULL and kIOReturnNotReady if the DMA command is not prepared. + */ + virtual IOReturn genIOVMSegments(UInt64 *offset, + void *segments, + UInt32 *numSegments); + +private: + virtual UInt64 transfer( IOOptionBits transferOp, UInt64 offset, void * buffer, UInt64 length ); + +public: + +/*! @function writeBytes + * @abstract Copy data to the IODMACommand's buffer from the specified buffer. + * @discussion This method copies data to the IODMACommand's memory at the given offset, from the caller's buffer. The IODMACommand must be prepared, and the offset is relative to the prepared offset. + * @param offset A byte offset into the IODMACommand's memory, relative to the prepared offset. + * @param bytes The caller supplied buffer to copy the data from. + * @param length The length of the data to copy. + * @result The number of bytes copied, zero will be returned if the specified offset is beyond the prepared length of the IODMACommand. */ + + UInt64 writeBytes(UInt64 offset, const void *bytes, UInt64 length); + +/*! @function readBytes + * @abstract Copy data from the IODMACommand's buffer to the specified buffer. + * @discussion This method copies data from the IODMACommand's memory at the given offset, to the caller's buffer. The IODMACommand must be prepared, and the offset is relative to the prepared offset. + * @param offset A byte offset into the IODMACommand's memory, relative to the prepared offset. + * @param bytes The caller supplied buffer to copy the data to. + * @param length The length of the data to copy. + * @result The number of bytes copied, zero will be returned if the specified offset is beyond the prepared length of the IODMACommand. */ + + UInt64 readBytes(UInt64 offset, void *bytes, UInt64 length); + +/*! @function gen32IOVMSegments + * @abstract Helper function for a type checked call to genIOVMSegments(qv), for use with an IODMACommand set up with the output function kIODMACommandOutputHost32, kIODMACommandOutputBig32, or kIODMACommandOutputLittle32. If the output function of the IODMACommand is not a 32 bit function, results will be incorrect. + */ + inline IOReturn + gen32IOVMSegments(UInt64 *offset, + Segment32 *segments, + UInt32 *numSegments) + { + return genIOVMSegments(offset, segments, numSegments); + } + +/*! @function gen64IOVMSegments + * @abstract Helper function for a type checked call to genIOVMSegments(qv), for use with an IODMACommand set up with the output function kIODMACommandOutputHost64, kIODMACommandOutputBig64, or kIODMACommandOutputLittle64. If the output function of the IODMACommand is not a 64 bit function, results will be incorrect. + */ + inline IOReturn + gen64IOVMSegments(UInt64 *offset, + Segment64 *segments, + UInt32 *numSegments) + { + return genIOVMSegments(offset, segments, numSegments); + } + + IOReturn + genIOVMSegments(SegmentFunction segmentFunction, + UInt64 *offsetP, + void *segmentsP, + UInt32 *numSegmentsP); + + virtual void free() APPLE_KEXT_OVERRIDE; + +private: + IOReturn setSpecification(SegmentFunction outSegFunc, + const SegmentOptions * segmentOptions, + uint32_t mappingOptions, + IOMapper * mapper); + + typedef IOReturn (*InternalSegmentFunction)( + void *reference, + IODMACommand *target, + Segment64 segment, + void *segments, + UInt32 segmentIndex); + + IOReturn genIOVMSegments(uint32_t op, + InternalSegmentFunction outSegFunc, + void *reference, + UInt64 *offsetP, + void *segmentsP, + UInt32 *numSegmentsP); + + static IOReturn clientOutputSegment( + void *reference, IODMACommand *target, + Segment64 segment, void *vSegList, UInt32 outSegIndex); + + static IOReturn segmentOp( + void *reference, + IODMACommand *target, + Segment64 segment, + void *segments, + UInt32 segmentIndex); + IOReturn walkAll(UInt8 op); + +public: + +/*! @function prepareWithSpecification + * @abstract Prepare the memory for an I/O transfer with a new specification. + * @discussion Allocate the mapping resources neccessary for this transfer, specifying a sub range of the IOMemoryDescriptor that will be the target of the I/O. The complete() method frees these resources. Data may be copied to buffers for kIODirectionOut memory descriptors, depending on hardware mapping resource availabilty or alignment restrictions. It should be noted that the this function may block and should only be called on the clients context, i.e never call this routine while gated; also the call itself is not thread safe though this should be an issue as each IODMACommand is independant. + * @param outSegFunc SegmentFunction to call to output one physical segment. A set of nine commonly required segment functions are provided. + * @param numAddressBits Number of bits that the hardware uses on its internal address bus. Typically 32 but may be more on modern hardware. A 0 implies no-restriction other than that implied by the output segment function. + * @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0 which means any size. + * @param mappingOptions is the type of mapping that is required to translate an IOMemoryDescriptor into the desired number of bits. For instance if your hardware only supports 32 bits but must run on machines with > 4G of RAM some mapping will be required. Number of bits will be specified in numAddressBits, see below.This parameter can take 3 values:- kNonCoherent - used for non-coherent hardware transfers, Mapped - Validate that all I/O bus generated addresses are within the number of addressing bits specified, Bypassed indicates that bypassed addressing is required, this is used when the hardware transferes are into coherent memory but no mapping is required. See also prepare() for failure cases. + * @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + * @param alignment Alignment restriction, in bytes, on I/O bus addresses. Defaults to single byte alignment. + * @param mapper For mapping types kMapped & kBypassed mapper is used to define the hardware that will perform the mapping, defaults to the system mapper. + * @param offset defines the starting offset in the memory descriptor the DMA command will operate on. genIOVMSegments will produce its results based on the offset and length passed to the prepare method. + * @param length defines the ending position in the memory descriptor the DMA command will operate on. genIOVMSegments will produce its results based on the offset and length passed to the prepare method. + * @param flushCache Flush the caches for the memory descriptor and make certain that the memory cycles are complete. Defaults to true for kNonCoherent and is ignored by the other types. + * @param synchronize Copy any buffered data back from the target IOMemoryDescriptor. Defaults to true, if synchronize() is being used to explicitly copy data, passing false may avoid an unneeded copy. + * @result An IOReturn code. Can fail if the mapping type is not recognised, if one of the 3 mandatory parameters are set to 0, if a 32 bit output function is selected when more than 32 bits of address is required or, if kBypassed is requested on a machine that doesn't support bypassing. + */ + + virtual IOReturn prepareWithSpecification(SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mappingOptions = kMapped, + UInt64 maxTransferSize = 0, + UInt32 alignment = 1, + IOMapper *mapper = NULL, + UInt64 offset = 0, + UInt64 length = 0, + bool flushCache = true, + bool synchronize = true); + + static IOReturn transferSegment(void *reference, + IODMACommand *target, + Segment64 segment, + void *segments, + UInt32 segmentIndex); + +/*! @function getPreparedOffsetAndLength + * @abstract Returns the offset and length into the target IOMemoryDescriptor of a prepared IODDMACommand. + * @discussion If successfully prepared, returns the offset and length into the IOMemoryDescriptor. Will fail for an unprepared IODMACommand. + * @param offset returns the starting offset in the memory descriptor the DMA command was prepared with. Pass NULL for don't care. + * @param length returns the length in the memory descriptor the DMA command was prepared with. Pass NULL for don't care. + * @result An IOReturn code. kIOReturnNotReady if the IODMACommand is not prepared. */ + + virtual IOReturn getPreparedOffsetAndLength(UInt64 * offset, UInt64 * length); + + UInt8 getNumAddressBits(void); + UInt32 getAlignment(void); + uint32_t getAlignmentLength(void); + uint32_t getAlignmentInternalSegments(void); + + +/*! @function initWithRefCon + * @abstract Secondary initializer for the IODMACommand class. + * @param refCon Reference Constant + * @result Can fail if super init fails. Returns true otherwise. + */ + + virtual + bool initWithRefCon(void * refCon = NULL); + + virtual + bool initWithSpecification(SegmentFunction outSegFunc, + const SegmentOptions * segmentOptions, + uint32_t mappingOptions, + IOMapper * mapper, + void * refCon); + + virtual + IOReturn prepareWithSpecification(SegmentFunction outSegFunc, + const SegmentOptions * segmentOptions, + uint32_t mappingOptions, + IOMapper * mapper, + uint64_t offset, + uint64_t length, + bool flushCache = true, + bool synchronize = true); + + virtual + IOBufferMemoryDescriptor * createCopyBuffer(IODirection direction, UInt64 length); + +private: + OSMetaClassDeclareReservedUsed(IODMACommand, 0); + OSMetaClassDeclareReservedUsed(IODMACommand, 1); + OSMetaClassDeclareReservedUsed(IODMACommand, 2); + OSMetaClassDeclareReservedUsed(IODMACommand, 3); + OSMetaClassDeclareReservedUsed(IODMACommand, 4); + OSMetaClassDeclareReservedUsed(IODMACommand, 5); + OSMetaClassDeclareReservedUsed(IODMACommand, 6); + OSMetaClassDeclareReservedUnused(IODMACommand, 7); + OSMetaClassDeclareReservedUnused(IODMACommand, 8); + OSMetaClassDeclareReservedUnused(IODMACommand, 9); + OSMetaClassDeclareReservedUnused(IODMACommand, 10); + OSMetaClassDeclareReservedUnused(IODMACommand, 11); + OSMetaClassDeclareReservedUnused(IODMACommand, 12); + OSMetaClassDeclareReservedUnused(IODMACommand, 13); + OSMetaClassDeclareReservedUnused(IODMACommand, 14); + OSMetaClassDeclareReservedUnused(IODMACommand, 15); + +public: +/*! @var fRefCon Reference Constant, client defined publicly avialable */ + void *fRefCon; + +protected: + +/*! @var fMaxSegmentSize Maximum size of one segment in a scatter/gather list */ + UInt64 fMaxSegmentSize; + +/*! @var fMaxTransferSize + * Maximum size of a transfer that this memory cursor is allowed to generate */ + UInt64 fMaxTransferSize; + + UInt32 fAlignMaskLength; + UInt32 fAlignMaskInternalSegments; + +/*! @var fMapper + * Client defined mapper. */ + IOMapper *fMapper; + +/*! @var fMemory + * memory descriptor for current I/O. */ + const IOMemoryDescriptor *fMemory; + +/*! @var fOutSeg The action method called when an event has been delivered */ + SegmentFunction fOutSeg; + +/*! @var fAlignMask + * Alignment restriction mask. */ + UInt32 fAlignMask; + +/*! @var fNumAddressBits + * Number of bits that the hardware can address */ + UInt32 fNumAddressBits; + +/*! @var fNumSegments + * Number of contiguous segments required for the current memory descriptor and desired mapping */ + UInt32 fNumSegments; + +/*! @var fMappingOptions + * What type of I/O virtual address mapping is required for this command */ + uint32_t fMappingOptions; + +/*! @var fActive + * fActive indicates that this DMA command is currently prepared and ready to go */ + UInt32 fActive; + +/*! @var reserved + * Reserved for future use. (Internal use only) */ + struct IODMACommandInternal * reserved; +}; + +IOReturn +IODMACommand:: +weakWithSpecification(IODMACommand **newCommand, + SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mapType, + UInt64 maxTransferSize, + UInt32 alignment, + IOMapper *mapper, + void *refCon) +{ + if (!newCommand) { + return kIOReturnBadArgument; + } + + IODMACommand *self = (IODMACommand *) + OSMetaClass::allocClassWithName("IODMACommand"); + if (!self) { + return kIOReturnUnsupported; + } + + IOReturn ret; + bool inited = self-> + initWithSpecification(outSegFunc, + numAddressBits, maxSegmentSize, mapType, + maxTransferSize, alignment, mapper, refCon); + if (inited) { + ret = kIOReturnSuccess; + } else { + self->release(); + self = NULL; + ret = kIOReturnError; + } + + *newCommand = self; + return ret; +}; +#endif /* !_IODMACOMMAND_H */ diff --git a/QualcommWireless/include/IOKit/IODMAController.h b/QualcommWireless/include/IOKit/IODMAController.h new file mode 100644 index 0000000..2d8682c --- /dev/null +++ b/QualcommWireless/include/IOKit/IODMAController.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODMACONTROLLER_H +#define _IOKIT_IODMACONTROLLER_H + +#include +#include +#include + +class IODMAEventSource; + +class IODMAController : public IOService +{ + OSDeclareAbstractStructors(IODMAController); + + friend class IODMAEventSource; + +private: + IOService *_provider; + const OSSymbol *_dmaControllerName; + +protected: + virtual void registerDMAController(IOOptionBits options = 0); + virtual IOReturn initDMAChannel(IOService *provider, IODMAEventSource *dmaES, UInt32 *dmaIndex, UInt32 reqIndex) = 0; + virtual IOReturn startDMACommand(UInt32 dmaIndex, IODMACommand *dmaCommand, IODirection direction, + IOByteCount byteCount = 0, IOByteCount byteOffset = 0) = 0; + virtual IOReturn stopDMACommand(UInt32 dmaIndex, bool flush = false, uint64_t timeout = UINT64_MAX) = 0; + virtual void completeDMACommand(IODMAEventSource *dmaES, IODMACommand *dmaCommand); + virtual void notifyDMACommand(IODMAEventSource *dmaES, IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount, AbsoluteTime timeStamp); + virtual IOReturn queryDMACommand(UInt32 dmaIndex, IODMACommand **dmaCommand, IOByteCount *transferCount, bool waitForIdle = false) = 0; + virtual IOByteCount getFIFODepth(UInt32 dmaIndex, IODirection direction) = 0; + virtual IOReturn setFIFODepth(UInt32 dmaIndex, IOByteCount depth) = 0; + virtual IOByteCount validFIFODepth(UInt32 dmaIndex, IOByteCount depth, IODirection direction) = 0; + virtual IOReturn setFrameSize(UInt32 dmaIndex, UInt8 byteCount) = 0; + virtual IOReturn setDMAConfig(UInt32 dmaIndex, IOService *provider, UInt32 reqIndex) = 0; + virtual bool validDMAConfig(UInt32 dmaIndex, IOService *provider, UInt32 reqIndex) = 0; + +public: + static const OSSymbol *createControllerName(UInt32 phandle); + static IODMAController *getController(IOService *provider, UInt32 dmaIndex); + + virtual bool start(IOService *provider) APPLE_KEXT_OVERRIDE; +}; + + +#endif /* _IOKIT_IODMACONTROLLER_H */ diff --git a/QualcommWireless/include/IOKit/IODMAEventSource.h b/QualcommWireless/include/IOKit/IODMAEventSource.h new file mode 100644 index 0000000..5b26e08 --- /dev/null +++ b/QualcommWireless/include/IOKit/IODMAEventSource.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODMAEVENTSOURCE_H +#define _IOKIT_IODMAEVENTSOURCE_H + +#include +#include +#include +#include + +class IODMAController; + +class IODMAEventSource : public IOEventSource +{ + OSDeclareDefaultStructors(IODMAEventSource); + + friend class IODMAController; + +public: + typedef void (*Action)(OSObject *owner, IODMAEventSource *dmaES, IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount, AbsoluteTime timeStamp); +#define IODMAEventAction IODMAEventSource::Action + +protected: + virtual void completeDMACommand(IODMACommand *dmaCommand); + virtual void notifyDMACommand(IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount, AbsoluteTime timeStamp); + +public: + static IODMAEventSource *dmaEventSource(OSObject *owner, + IOService *provider, + Action completion = NULL, + Action notification = NULL, + UInt32 dmaIndex = 0); + + virtual IOReturn startDMACommand(IODMACommand *dmaCommand, IODirection direction, IOByteCount byteCount = 0, IOByteCount byteOffset = 0); + virtual IOReturn stopDMACommand(bool flush = false, uint64_t timeout = UINT64_MAX); + + virtual IOReturn queryDMACommand(IODMACommand **dmaCommand, IOByteCount *transferCount, bool waitForIdle = false); + + virtual IOByteCount getFIFODepth(IODirection direction = kIODirectionNone); + virtual IOReturn setFIFODepth(IOByteCount depth); + virtual IOByteCount validFIFODepth(IOByteCount depth, IODirection direction); + + virtual IOReturn setFrameSize(UInt8 byteCount); + + virtual IOReturn setDMAConfig(UInt32 dmaIndex); + virtual bool validDMAConfig(UInt32 dmaIndex); + +private: + IOService *dmaProvider; + IODMAController *dmaController; + UInt32 dmaIndex; + queue_head_t dmaCommandsCompleted; + IOSimpleLock *dmaCommandsCompletedLock; + Action dmaCompletionAction; + Action dmaNotificationAction; + bool dmaSynchBusy; + + virtual bool init(OSObject *owner, + IOService *provider, + Action completion = NULL, + Action notification = NULL, + UInt32 dmaIndex = 0); + virtual bool checkForWork(void) APPLE_KEXT_OVERRIDE; + virtual void free(void) APPLE_KEXT_OVERRIDE; +}; + +#endif /* _IOKIT_IODMAEVENTSOURCE_H */ diff --git a/QualcommWireless/include/IOKit/IODataQueue.h b/QualcommWireless/include/IOKit/IODataQueue.h new file mode 100644 index 0000000..c16d03f --- /dev/null +++ b/QualcommWireless/include/IOKit/IODataQueue.h @@ -0,0 +1,158 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODATAQUEUE_H +#define _IOKIT_IODATAQUEUE_H + +#ifndef DISABLE_DATAQUEUE_WARNING +#warning "IODataQueue is deprecated due to security issues in its interfaces, please use IOSharedDataQueue instead" +#endif + + +#include +#include +#include +#include + +typedef struct _IODataQueueMemory IODataQueueMemory; +class IOMemoryDescriptor; + +struct _notifyMsg { + mach_msg_header_t h; +}; + + +#ifdef dequeue +#undef dequeue +#endif +#ifdef enqueue +#undef enqueue +#endif + +/*! + * @class IODataQueue : public OSObject + * @abstract A generic queue designed to pass data from the kernel to a user process. + * @discussion The IODataQueue class is designed to allow kernel code to queue data to a user process. IODataQueue objects are designed to be used in a single producer / single consumer situation. As such, there are no locks on the data itself. Because the kernel enqueue and user-space dequeue methods follow a strict set of guidelines, no locks are necessary to maintain the integrity of the data struct. + * + *
Each data entry can be variable sized, but the entire size of the queue data region (including overhead for each entry) must be specified up front. + * + *
In order for the IODataQueue instance to notify the user process that data is available, a notification mach port must be set. When the queue is empty and a new entry is added, a message is sent to the specified port. + * + *
User client code exists in the IOKit framework that facilitates the creation of the receive notification port as well as the listen process for new data available notifications. + * + *
In order to make the data queue memory available to a user process, the method getMemoryDescriptor() must be used to get an IOMemoryDescriptor instance that can be mapped into a user process. Typically, the clientMemoryForType() method on an IOUserClient instance will be used to request the IOMemoryDescriptor and then return it to be mapped into the user process. + */ +#ifndef DISABLE_DATAQUEUE_WARNING +class __attribute__((deprecated)) IODataQueue: public OSObject +#else +class IODataQueue : public OSObject +#endif +{ + OSDeclareDefaultStructors(IODataQueue); + +protected: + IODataQueueMemory * dataQueue; + + void * notifyMsg; + + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! + * @function sendDataAvailableNotification + * @abstract Sends a dataAvailableNotification message to the specified mach port. + * @discussion This method sends a message to the mach port passed to setNotificationPort(). It is used to indicate that data is available in the queue. + */ + virtual void sendDataAvailableNotification(); + +public: +/*! + * @function withCapacity + * @abstract Static method that creates a new IODataQueue instance with the capacity specified in the size parameter. + * @discussion The actual size of the entire data queue memory region (to be shared into a user process) is equal to the capacity plus the IODataQueueMemory overhead. This overhead value can be determined from the DATA_QUEUE_MEMORY_HEADER_SIZE macro in . The size of the data queue memory region must include space for the overhead of each IODataQueueEntry. This entry overhead can be determined from the DATA_QUEUE_ENTRY_HEADER_SIZE macro in .
This method allocates a new IODataQueue instance and then calls initWithCapacity() with the given size parameter. If the initWithCapacity() fails, the new instance is released and zero is returned. + * @param size The size of the data queue memory region. + * @result Returns the newly allocated IODataQueue instance. Zero is returned on failure. + */ + static IODataQueue *withCapacity(UInt32 size); + +/*! + * @function withEntries + * @abstract Static method that creates a new IODataQueue instance with the specified number of entries of the given size. + * @discussion This method will create a new IODataQueue instance with enough capacity for numEntries of entrySize. It does account for the IODataQueueEntry overhead for each entry. Note that the numEntries and entrySize are simply used to determine the data region size. They do not actually restrict the size of number of entries that can be added to the queue.
This method allocates a new IODataQueue instance and then calls initWithEntries() with the given numEntries and entrySize parameters. If the initWithEntries() fails, the new instance is released and zero is returned. + * @param numEntries Number of entries to allocate space for. + * @param entrySize Size of each entry. + * @result Reeturns the newly allocated IODataQueue instance. Zero is returned on failure. + */ + static IODataQueue *withEntries(UInt32 numEntries, UInt32 entrySize); + +/*! + * @function initWithCapacity + * @abstract Initializes an IODataQueue instance with the capacity specified in the size parameter. + * @discussion The actual size of the entire data queue memory region (to be shared into a user process) is equal to the capacity plus the IODataQueueMemory overhead. This overhead value can be determined from the DATA_QUEUE_MEMORY_HEADER_SIZE macro in . The size of the data queue memory region must include space for the overhead of each IODataQueueEntry. This entry overhead can be determined from the DATA_QUEUE_ENTRY_HEADER_SIZE macro in . + * @param size The size of the data queue memory region. + * @result Returns true on success and false on failure. + */ + virtual Boolean initWithCapacity(UInt32 size); + +/*! + * @function initWithEntries + * @abstract Initializes an IODataQueue instance with the specified number of entries of the given size. + * @discussion This method will initialize an IODataQueue instance with enough capacity for numEntries of entrySize. It does account for the IODataQueueEntry overhead for each entry. Note that the numEntries and entrySize are simply used to determine the data region size. They do not actually restrict the size of number of entries that can be added to the queue.
This method allocates a new IODataQueue instance and then calls initWithEntries() with the given numEntries and entrySize parameters. + * @param numEntries Number of entries to allocate space for. + * @param entrySize Size of each entry. + * @result Reeturns true on success and false on failure. + */ + virtual Boolean initWithEntries(UInt32 numEntries, UInt32 entrySize); + +/*! + * @function enqueue + * @abstract Enqueues a new entry on the queue. + * @discussion This method adds a new data entry of dataSize to the queue. It sets the size parameter of the entry pointed to by the tail value and copies the memory pointed to by the data parameter in place in the queue. Once that is done, it moves the tail to the next available location. When attempting to add a new entry towards the end of the queue and there isn't enough space at the end, it wraps back to the beginning.
If the queue is empty when a new entry is added, sendDataAvailableNotification() is called to send a message to the user process that data is now available. + * @param data Pointer to the data to be added to the queue. + * @param dataSize Size of the data pointed to by data. + * @result Returns true on success and false on failure. Typically failure means that the queue is full. + */ + virtual Boolean enqueue(void *data, UInt32 dataSize); + +/*! + * @function setNotificationPort + * @abstract Creates a simple mach message targeting the mach port specified in port. + * @discussion This message is sent when data is added to an empty queue. It is to notify a user process that new data has become available. + * @param port The mach port to target with the notification message. + */ + virtual void setNotificationPort(mach_port_t port); + +/*! + * @function getMemoryDescriptor + * @abstract Returns a memory descriptor covering the IODataQueueMemory region. + * @discussion The IOMemoryDescriptor instance returned by this method is intended to be mapped into a user process. This is the memory region that the IODataQueueClient code operates on. + * @result Returns a newly allocated IOMemoryDescriptor for the IODataQueueMemory region. Returns zero on failure. + */ + virtual IOMemoryDescriptor *getMemoryDescriptor(); +}; + +#endif /* _IOKIT_IODATAQUEUE_H */ diff --git a/QualcommWireless/include/IOKit/IODataQueueShared.h b/QualcommWireless/include/IOKit/IODataQueueShared.h new file mode 100644 index 0000000..0e8c7b4 --- /dev/null +++ b/QualcommWireless/include/IOKit/IODataQueueShared.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODATAQUEUESHARED_H +#define _IOKIT_IODATAQUEUESHARED_H + +#include +#include +#include + +/*! + * @typedef IODataQueueEntry + * @abstract Represents an entry within the data queue + * @discussion This is a variable sized struct. The data field simply represents the start of the data region. The size of the data region is stored in the size field. The whole size of the specific entry is the size of a UInt32 plus the size of the data region. + * @field size The size of the following data region. + * @field data Represents the beginning of the data region. The address of the data field is a pointer to the start of the data region. + */ +typedef struct _IODataQueueEntry { + UInt32 size; + UInt8 data[4]; +} IODataQueueEntry; + +/*! + * @typedef IODataQueueMemory + * @abstract A struct mapping to the header region of a data queue. + * @discussion This struct is variable sized. The struct represents the data queue header information plus a pointer to the actual data queue itself. The size of the struct is the combined size of the header fields (3 * sizeof(UInt32)) plus the actual size of the queue region. This size is stored in the queueSize field. + * @field queueSize The size of the queue region pointed to by the queue field. + * @field head The location of the queue head. This field is represented as a byte offset from the beginning of the queue memory region. + * @field tail The location of the queue tail. This field is represented as a byte offset from the beginning of the queue memory region. + * @field queue Represents the beginning of the queue memory region. The size of the region pointed to by queue is stored in the queueSize field. + */ +typedef struct _IODataQueueMemory { + UInt32 queueSize; + volatile UInt32 head; + volatile UInt32 tail; + IODataQueueEntry queue[1]; +} IODataQueueMemory; + +/*! + * @typedef IODataQueueAppendix + * @abstract A struct mapping to the appendix region of a data queue. + * @discussion This struct is variable sized dependent on the version. The struct represents the data queue appendix information. + * @field version The version of the queue appendix. + * @field msgh Mach message header containing the notification mach port associated with this queue. + */ +typedef struct _IODataQueueAppendix { + UInt32 version; + mach_msg_header_t msgh; +} IODataQueueAppendix; + +/*! + * @defined DATA_QUEUE_ENTRY_HEADER_SIZE Represents the size of the data queue entry header independent of the actual size of the data in the entry. This is the overhead of each entry in the queue. The total size of an entry is equal to this value plus the size stored in the entry's size field (in IODataQueueEntry). + */ +#define DATA_QUEUE_ENTRY_HEADER_SIZE (sizeof(IODataQueueEntry) - 4) + +/*! + * @defined DATA_QUEUE_MEMORY_HEADER_SIZE Represents the size of the data queue memory header independent of the actual size of the queue data itself. The total size of the queue memory is equal to this value plus the size of the queue appendix and the size of the queue data region which is stored in the queueSize field of IODataQueueMeory. + */ +#define DATA_QUEUE_MEMORY_HEADER_SIZE (sizeof(IODataQueueMemory) - sizeof(IODataQueueEntry)) + +/*! + * @defined DATA_QUEUE_MEMORY_APPENDIX_SIZE Represents the size of the data queue memory appendix independent of the actual size of the queue data itself. The total size of the queue memory is equal to this value plus the size of queue header and size of the queue data region which is stored in the queueSize field of IODataQueueMeory. + */ +#define DATA_QUEUE_MEMORY_APPENDIX_SIZE (sizeof(IODataQueueAppendix)) + +#endif /* _IOKIT_IODATAQUEUESHARED_H */ diff --git a/QualcommWireless/include/IOKit/IODeviceMemory.h b/QualcommWireless/include/IOKit/IODeviceMemory.h new file mode 100644 index 0000000..dadc043 --- /dev/null +++ b/QualcommWireless/include/IOKit/IODeviceMemory.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _IOKIT_IODEVICEMEMORY_H +#define _IOKIT_IODEVICEMEMORY_H + +#include + +/*! @class IODeviceMemory + * @abstract An IOMemoryDescriptor used for device physical memory ranges. + * @discussion The IODeviceMemory class is a simple subclass of IOMemoryDescriptor that uses its methods to describe a single range of physical memory on a device. IODeviceMemory objects are usually looked up with IOService or IOPCIDevice accessors, and are created by memory-mapped bus families. IODeviceMemory implements only some factory methods in addition to the methods of IOMemoryDescriptor. + */ + +class IODeviceMemory : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IODeviceMemory); + +public: + +/*! @struct InitElement + * @field start First physical address in the range. + * @field length Length of the range. + * @field tag 32-bit value not interpreted by IODeviceMemory or IOMemoryDescriptor, for use by the bus family. */ + + struct InitElement { + IOPhysicalAddress start; + IOPhysicalLength length; + IOOptionBits tag; + }; + +/*! @function arrayFromList + * @abstract Constructs an OSArray of IODeviceMemory instances, each describing one physical range, and a tag value. + * @discussion This method creates IODeviceMemory instances for each physical range passed in an IODeviceMemory::InitElement array. Each element consists of a physical address, length and tag value for the IODeviceMemory. The instances are returned as a created OSArray. + * @param list An array of IODeviceMemory::InitElement structures. + * @param count The number of elements in the list. + * @result Returns a created OSArray of IODeviceMemory objects, to be released by the caller, or zero on failure. */ + + static OSArray * arrayFromList( + InitElement list[], + IOItemCount count ); + +/*! @function withRange + * @abstract Constructs an IODeviceMemory instance, describing one physical range. + * @discussion This method creates an IODeviceMemory instance for one physical range passed as a physical address and length. It just calls IOMemoryDescriptor::withPhysicalAddress. + * @param start The physical address of the first byte in the memory. + * @param length The length of memory. + * @result Returns the created IODeviceMemory on success, to be released by the caller, or zero on failure. */ + + static IODeviceMemory * withRange( + IOPhysicalAddress start, + IOPhysicalLength length ); + +/*! @function withSubRange + * @abstract Constructs an IODeviceMemory instance, describing a subset of an existing IODeviceMemory range. + * @discussion This method creates an IODeviceMemory instance for a subset of an existing IODeviceMemory range, passed as a physical address offset and length. It just calls IOMemoryDescriptor::withSubRange. + * @param of The parent IODeviceMemory of which a subrange is to be used for the new descriptor, which will be retained by the subrange IODeviceMemory. + * @param offset A byte offset into the parent's memory. + * @param length The length of the subrange. + * @result Returns the created IODeviceMemory on success, to be released by the caller, or zero on failure. */ + + static IODeviceMemory * withSubRange( + IODeviceMemory * of, + IOPhysicalAddress offset, + IOPhysicalLength length ); +}; + +#endif /* ! _IOKIT_IODEVICEMEMORY_H */ diff --git a/QualcommWireless/include/IOKit/IODeviceTreeSupport.h b/QualcommWireless/include/IOKit/IODeviceTreeSupport.h new file mode 100644 index 0000000..105b86b --- /dev/null +++ b/QualcommWireless/include/IOKit/IODeviceTreeSupport.h @@ -0,0 +1,134 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _IOKIT_IODEVICETREE_H +#define _IOKIT_IODEVICETREE_H + +#include +#include + +class IODeviceMemory; +class IOService; + +extern const IORegistryPlane * gIODTPlane; + +extern const OSSymbol * gIODTPHandleKey; + +extern const OSSymbol * gIODTCompatibleKey; +extern const OSSymbol * gIODTTypeKey; +extern const OSSymbol * gIODTModelKey; +extern const OSSymbol * gIODTTargetTypeKey; + +extern const OSSymbol * gIODTAAPLInterruptsKey; +extern const OSSymbol * gIODTDefaultInterruptController; +extern const OSSymbol * gIODTNWInterruptMappingKey; + +LIBKERN_RETURNS_NOT_RETAINED IORegistryEntry * IODeviceTreeAlloc( void * dtTop ); + + +bool IODTMatchNubWithKeys( IORegistryEntry * nub, + const char * keys ); + +bool IODTCompareNubName( const IORegistryEntry * regEntry, + OSString * name, + LIBKERN_RETURNS_RETAINED_ON_NONZERO OSString ** matchingName ); + +enum { + kIODTRecursive = 0x00000001, + kIODTExclusive = 0x00000002 +}; + +OSCollectionIterator * IODTFindMatchingEntries( IORegistryEntry * from, + IOOptionBits options, const char * keys ); + +typedef SInt32 (*IODTCompareAddressCellFunc) +(UInt32 cellCount, UInt32 left[], UInt32 right[]); + +typedef void (*IODTNVLocationFunc) +(IORegistryEntry * entry, + UInt8 * busNum, UInt8 * deviceNum, UInt8 * functionNum ); + +void IODTSetResolving( IORegistryEntry * regEntry, + IODTCompareAddressCellFunc compareFunc, + IODTNVLocationFunc locationFunc ); + +void IODTGetCellCounts( IORegistryEntry * regEntry, + UInt32 * sizeCount, UInt32 * addressCount); + +bool IODTResolveAddressCell( IORegistryEntry * regEntry, + UInt32 cellsIn[], + IOPhysicalAddress * phys, IOPhysicalLength * len ); + +LIBKERN_RETURNS_NOT_RETAINED OSArray * +IODTResolveAddressing( IORegistryEntry * regEntry, + const char * addressPropertyName, + IODeviceMemory * parent ); + +struct IONVRAMDescriptor { + unsigned int format:4; + unsigned int marker:1; + unsigned int bridgeCount:3; + unsigned int busNum:2; + unsigned int bridgeDevices:6 * 5; + unsigned int functionNum:3; + unsigned int deviceNum:5; +} __attribute__((aligned(2), packed)); + +IOReturn IODTMakeNVDescriptor( IORegistryEntry * regEntry, + IONVRAMDescriptor * hdr ); + +LIBKERN_RETURNS_NOT_RETAINED OSData * +IODTFindSlotName( IORegistryEntry * regEntry, UInt32 deviceNumber ); + +const OSSymbol * IODTInterruptControllerName( + IORegistryEntry * regEntry ); + +bool IODTMapInterrupts( IORegistryEntry * regEntry ); + +enum { + kIODTInterruptShared = 0x00000001 +}; +IOReturn IODTGetInterruptOptions( IORegistryEntry * regEntry, int source, IOOptionBits * options ); + +#ifdef __cplusplus +extern "C" { +#endif + +IOReturn IONDRVLibrariesInitialize( IOService * provider ); + +#ifdef __cplusplus +} +#endif + +#endif /* _IOKIT_IODEVICETREE_H */ diff --git a/QualcommWireless/include/IOKit/IOEventSource.h b/QualcommWireless/include/IOKit/IOEventSource.h new file mode 100644 index 0000000..c57fbfb --- /dev/null +++ b/QualcommWireless/include/IOKit/IOEventSource.h @@ -0,0 +1,285 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * HISTORY + * 1998-7-13 Godfrey van der Linden(gvdl) + * Created. + * 1998-10-30 Godfrey van der Linden(gvdl) + * Converted to C++ + */ +#ifndef _IOKIT_IOEVENTSOURCE_H +#define _IOKIT_IOEVENTSOURCE_H + +#include + +#include + +#include +#include +#include + +#if IOKITSTATS +#include +#endif + +__BEGIN_DECLS +#include +#include +__END_DECLS + +/*! + * @class IOEventSource : public OSObject + * @abstract Abstract class for all work-loop event sources. + * @discussion The IOEventSource declares the abstract super class that all + * event sources must inherit from if an IOWorkLoop is to receive events from them. + *

+ * An event source can represent any event that should cause the work-loop of a + * device to wake up and perform work. Two examples of event sources are the + * IOInterruptEventSource which delivers interrupt notifications and IOCommandGate + * which delivers command requests. + *

+ * A kernel module can always use the work-loop model for serialising access to + * anything at all. The IOEventSource is used for communicating events to the + * work-loop, and the chain of event sources should be used to walk the possible + * event sources and demultipex them. Note a particular instance of an event + * source may only be a member of 1 linked list chain. If you need to move it + * between chains than make sure it is removed from the original chain before + * attempting to move it. + *

+ * The IOEventSource makes no attempt to maintain the consistency of its internal data across multi-threading. It is assumed that the user of these basic tools will protect the data that these objects represent in some sort of device wide instance lock. For example the IOWorkLoop maintains the event chain by using an IOCommandGate and thus single threading access to its state. + *

+ * All subclasses of IOEventSource that wish to perform work on the work-loop thread are expected to implement the checkForWork() member function. As of Mac OS X, 10.7 (Darwin 11), checkForWork is no longer pure virtual, and should not be overridden if there is no work to be done. + * + *

+ * checkForWork() is the key method in this class. It is called by some work-loop when convienient and is expected to evaluate its internal state and determine if an event has occurred since the last call. In the case of an event having occurred then the instance defined target(owner)/action will be called. The action is stored as an ordinary C function pointer but the first parameter is always the owner. This means that a C++ member function can be used as an action function though this depends on the ABI. + *

+ * Although the eventChainNext variable contains a reference to the next event source in the chain this reference is not retained. The list 'owner' i.e. the client that creates the event, not the work-loop, is expected to retain the source. + */ +class IOEventSource : public OSObject +{ + OSDeclareAbstractStructors(IOEventSource); + friend class IOWorkLoop; +#if IOKITSTATS + friend class IOStatistics; +#endif + +public: +/*! + * @typedef Action + * @discussion Placeholder type for C++ function overloading discrimination. + * As the all event sources require an action and it has to be stored somewhere + * and be of some type, this is that type. + * @param owner + * Target of the function, can be used as a refcon. The owner is set + * during initialisation. Note if a C++ function was specified this parameter + * is implicitly the first paramter in the target member function's parameter list. + */ + typedef void (*Action)(OSObject *owner, ...); + +/*! @defined IOEventSourceAction + * @discussion Backward compatibilty define for the old non-class scoped type definition. See $link IOEventSource::Action */ + #define IOEventSourceAction IOEventSource::Action + +#ifdef __BLOCKS__ + typedef IOReturn (^ActionBlock)(); +#endif /* __BLOCKS__ */ + +protected: +/*! @var eventChainNext + * The next event source in the event chain. nil at end of chain. */ + IOEventSource *eventChainNext; + +/*! @var owner The owner object called when an event has been delivered. */ + OSObject *owner; + +/*! @var action + * The action method called when an event has been delivered */ + + Action action; + +/*! @var enabled + * Is this event source enabled to deliver requests to the work-loop. */ + bool enabled; + + +/*! @var workLoop What is the work-loop for this event source. */ + IOWorkLoop *workLoop; + +/*! @var refcon What ever the client wants to do, see $link setRefcon. */ + void *refcon; + +/*! @struct ExpansionData + * @discussion This structure will be used to expand the capablilties of the IOEventSource in the future. + */ + struct ExpansionData { +#if IOKITSTATS + struct IOEventSourceCounter *counter; +#else + void *iokitstatsReserved; +#endif + }; + +/*! @var reserved + * Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +/*! @function init + * @abstract Primary initialiser for the IOEventSource class. + * @param owner + * Owner of this instance of an event source. Used as the first parameter + * of the action callout. Owner must be an OSObject. + * @param action + * Pointer to C call out function. Action is a pointer to a C function + * that gets called when this event source has outstanding work. It will usually + * be called by the checkForWork member function. The first parameter of the + * action call out will always be the owner, this allows C++ member functions to + * be used as actions. Defaults to 0. + * @result true if the inherited classes and this instance initialise + * successfully. + */ + virtual bool init(OSObject *owner, IOEventSource::Action action = NULL); + + virtual void free( void ) APPLE_KEXT_OVERRIDE; + +/*! @function checkForWork + * @abstract Virtual member function used by IOWorkLoop for work + * scheduling. + * @discussion This function will be called to request a subclass to check + * its internal state for any work to do and then to call out the owner/action. + * If this event source never performs any work (e.g. IOCommandGate), this + * method should not be overridden. NOTE: This method is no longer declared pure + * virtual. A default implementation is provided in IOEventSource. + * @result Return true if this function needs to be called again before all its outstanding events have been processed. + */ + virtual bool checkForWork(); + +/*! @function setWorkLoop + * @abstract Set'ter for $link workLoop variable. + * @param workLoop + * Target work-loop of this event source instance. A subclass of + * IOWorkLoop that at least reacts to signalWorkAvailable() and onThread functions. + */ + virtual void setWorkLoop(IOWorkLoop *workLoop); + +/*! @function setNext + * @abstract Set'ter for $link eventChainNext variable. + * @param next + * Pointer to another IOEventSource instance. + */ + virtual void setNext(IOEventSource *next); + +/*! @function getNext + * @abstract Get'ter for $link eventChainNext variable. + * @result value of eventChainNext. + */ + virtual IOEventSource *getNext() const; + + +protected: +// Methods to access the IOWorkLoop exported fields + void signalWorkAvailable(); + void openGate(); + void closeGate(); + bool tryCloseGate(); + int sleepGate(void *event, UInt32 type); + int sleepGate(void *event, AbsoluteTime deadline, UInt32 type); + void wakeupGate(void *event, bool oneThread); + +public: +/*! @function setAction + * @abstract Set'ter for $link action variable. + * @param action Pointer to a C function of type IOEventSource::Action. */ + virtual void setAction(IOEventSource::Action action); + +/*! @function getAction + * @abstract Get'ter for $link action variable. + * @result value of action. */ + virtual IOEventSource::Action getAction() const; + +#ifdef __BLOCKS__ +/*! @function setActionBlock + * @abstract Setter for action ivar. The current block is released, & the new block is retained. + * @param block Block pointer of type IOEventSource::ActionBlock. */ + void setActionBlock(ActionBlock block); +/*! @function getActionBlock + * @abstract Getter for action ivar. + * @result Block pointer of type IOEventSource::ActionBlock, if set, or NULL. */ + ActionBlock getActionBlock(ActionBlock) const; +#endif /* __BLOCKS__ */ + +/*! @function setRefcon + * @abstract Setter for refcon ivar. This function will assert if a block action has been set. + * @param refcon Refcon. */ + void setRefcon(void *refcon); +/*! @function getRefcon + * @abstract Getter for refcon ivar. + * @result The refcon. This function will assert if a block action has been set. */ + void * getRefcon() const; + +/*! @function enable + * @abstract Enable event source. + * @discussion A subclass implementation is expected to respect the enabled + * state when checkForWork is called. Calling this function will cause the + * work-loop to be signalled so that a checkForWork is performed. */ + virtual void enable(); + +/*! @function disable + * @abstract Disable event source. + * @discussion A subclass implementation is expected to respect the enabled + * state when checkForWork is called. */ + virtual void disable(); + +/*! @function isEnabled + * @abstract Get'ter for $link enable variable. + * @result true if enabled. */ + virtual bool isEnabled() const; + +/*! @function getWorkLoop + * @abstract Get'ter for $link workLoop variable. + * @result value of workLoop. */ + virtual IOWorkLoop *getWorkLoop() const; + +/*! @function onThread + * @abstract Convenience function for workLoop->onThread. + * @result true if called on the work-loop thread. + */ + virtual bool onThread() const; + +private: + OSMetaClassDeclareReservedUnused(IOEventSource, 0); + OSMetaClassDeclareReservedUnused(IOEventSource, 1); + OSMetaClassDeclareReservedUnused(IOEventSource, 2); + OSMetaClassDeclareReservedUnused(IOEventSource, 3); + OSMetaClassDeclareReservedUnused(IOEventSource, 4); + OSMetaClassDeclareReservedUnused(IOEventSource, 5); + OSMetaClassDeclareReservedUnused(IOEventSource, 6); + OSMetaClassDeclareReservedUnused(IOEventSource, 7); +}; + +#endif /* !_IOKIT_IOEVENTSOURCE_H */ diff --git a/QualcommWireless/include/IOKit/IOFilterInterruptEventSource.h b/QualcommWireless/include/IOKit/IOFilterInterruptEventSource.h new file mode 100644 index 0000000..2719cc1 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOFilterInterruptEventSource.h @@ -0,0 +1,189 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * 1999-4-15 Godfrey van der Linden(gvdl) + * Created. + */ +#ifndef _IOKIT_IOFILTERINTERRUPTEVENTSOURCE_H +#define _IOKIT_IOFILTERINTERRUPTEVENTSOURCE_H + +#include + +class IOService; + +/*! @class IOFilterInterruptEventSource : public IOInterruptEventSource + * @abstract Filtering varient of the $link IOInterruptEventSource. + * @discussion An interrupt event source that calls the client to determine if a interrupt event needs to be scheduled on the work loop. A filter interrupt event source call's the client in the primary interrupt context, the client can then interrogate its hardware and determine if the interrupt needs to be processed yet. + *

+ * As the routine is called in the primary interrupt context great care must be taken in the writing of this routine. In general none of the generic IOKit environment is safe to call in this context. We intend this routine to be used by hardware that can interrogate its registers without destroying state. Primarily this variant of event sources will be used by drivers that share interrupts. The filter routine will determine if the interrupt is a real interrupt or a ghost and thus optimise the work thread context switch away. + *

+ * If you are implementing 'SoftDMA' (or pseudo-DMA), you may not want the I/O Kit to automatically start your interrupt handler routine on your work loop when your filter routine returns true. In this case, you may choose to have your filter routine schedule the work on the work loop itself and then return false. If you do this, the interrupt will not be disabled in hardware and you could receive additional primary interrupts before your work loop–level service routine completes. Because this scheme has implications for synchronization between your filter routine and your interrupt service routine, you should avoid doing this unless your driver requires SoftDMA. + *

+ * CAUTION: Called in primary interrupt context, if you need to disable interrupt to guard you registers against an unexpected call then it is better to use a straight IOInterruptEventSource and its secondary interrupt delivery mechanism. + */ +class IOFilterInterruptEventSource : public IOInterruptEventSource +{ + OSDeclareDefaultStructors(IOFilterInterruptEventSource); + +public: +/*! + * @typedef Filter + * @discussion C Function pointer to a routine to call when an interrupt occurs. + * @param owner Pointer to the owning/client instance. + * @param sender Where is the interrupt comming from. + * @result false if this interrupt can be ignored. */ + typedef bool (*Filter)(OSObject *owner, IOFilterInterruptEventSource *sender); + +/*! @defined IOFilterInterruptAction + * @discussion Backward compatibilty define for the old non-class scoped type definition. See $link IOFilterInterruptSource::Filter */ +#define IOFilterInterruptAction IOFilterInterruptEventSource::Filter + +#ifdef __BLOCKS__ + typedef bool (^FilterBlock)(IOFilterInterruptEventSource *sender); +#endif /* __BLOCKS__ */ + +private: +// Hide the superclass initializers + virtual bool init(OSObject *inOwner, + IOInterruptEventSource::Action inAction = NULL, + IOService *inProvider = NULL, + int inIntIndex = 0) APPLE_KEXT_OVERRIDE; + + static IOInterruptEventSource * + interruptEventSource(OSObject *inOwner, + IOInterruptEventSource::Action inAction = NULL, + IOService *inProvider = NULL, + int inIntIndex = 0); + +protected: +/*! @var filterAction Filter callout */ + + Filter filterAction; + +/*! @struct ExpansionData + * @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + * Reserved for future use. (Internal use only) */ + APPLE_KEXT_WSHADOW_PUSH; + ExpansionData *reserved; + APPLE_KEXT_WSHADOW_POP; + +public: +/*! @function filterInterruptEventSource + * @abstract Factor method to create and initialise an IOFilterInterruptEventSource. See $link init. + * @param owner Owner/client of this event source. + * @param action 'C' Function to call when something happens. + * @param filter 'C' Function to call when interrupt occurs. + * @param provider Service that provides interrupts. + * @param intIndex Defaults to 0. + * @result a new event source if succesful, 0 otherwise. */ + static IOFilterInterruptEventSource * + filterInterruptEventSource(OSObject *owner, + IOInterruptEventSource::Action action, + Filter filter, + IOService *provider, + int intIndex = 0); + +#ifdef __BLOCKS__ +/*! @function filterInterruptEventSource + * @abstract Factor method to create and initialise an IOFilterInterruptEventSource. See $link init. + * @param owner Owner/client of this event source. + * @param provider Service that provides interrupts. + * @param intIndex The index of the interrupt within the provider's interrupt sources. + * @param action Block for the callout routine of this event source. + * @param filter Block to invoke when HW interrupt occurs. + * @result a new event source if succesful, 0 otherwise. */ + static IOFilterInterruptEventSource * + filterInterruptEventSource(OSObject *owner, + IOService *provider, + int intIndex, + IOInterruptEventSource::ActionBlock action, + FilterBlock filter); +#endif /* __BLOCKS__ */ + + +/*! @function init + * @abstract Primary initialiser for the IOFilterInterruptEventSource class. + * @param owner Owner/client of this event source. + * @param action 'C' Function to call when something happens. + * @param filter 'C' Function to call in primary interrupt context. + * @param provider Service that provides interrupts. + * @param intIndex Interrupt source within provider. Defaults to 0. + * @result true if the inherited classes and this instance initialise + * successfully. */ + virtual bool init(OSObject *owner, + IOInterruptEventSource::Action action, + Filter filter, + IOService *provider, + int intIndex = 0); + + virtual void free( void ) APPLE_KEXT_OVERRIDE; + +/*! @function signalInterrupt + * @abstract Cause the work loop to schedule the action. + * @discussion Cause the work loop to schedule the interrupt action even if the filter routine returns 'false'. Note well the interrupting condition MUST be cleared from the hardware otherwise an infinite process interrupt loop will occur. Use this function when SoftDMA is desired. See $link IOFilterInterruptSource::Filter */ + virtual void signalInterrupt(); + +/*! @function getFilterAction + * @abstract Get'ter for filterAction variable. + * @result value of filterAction. */ + virtual Filter getFilterAction() const; + +#ifdef __BLOCKS__ +/*! @function getFilterActionBlock + * @abstract Get'ter for filterAction variable. + * @result value of filterAction. */ + FilterBlock getFilterActionBlock() const; +#endif /* __BLOCKS__ */ + +/*! @function normalInterruptOccurred + * @abstract Override $link IOInterruptEventSource::normalInterruptOccured to make a filter callout. */ + virtual void normalInterruptOccurred(void *self, IOService *prov, int ind) APPLE_KEXT_OVERRIDE; + +/*! @function disableInterruptOccurred + * @abstract Override $link IOInterruptEventSource::disableInterruptOccurred to make a filter callout. */ + virtual void disableInterruptOccurred(void *self, IOService *prov, int ind) APPLE_KEXT_OVERRIDE; + +private: + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 0); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 1); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 2); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 3); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 4); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 5); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 6); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 7); +}; + +#endif /* !_IOKIT_IOFILTERINTERRUPTEVENTSOURCE_H */ diff --git a/QualcommWireless/include/IOKit/IOInterleavedMemoryDescriptor.h b/QualcommWireless/include/IOKit/IOInterleavedMemoryDescriptor.h new file mode 100644 index 0000000..5221ab1 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOInterleavedMemoryDescriptor.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOINTERLEAVEDMEMORYDESCRIPTOR_H +#define _IOINTERLEAVEDMEMORYDESCRIPTOR_H + +#include + +/*! @class IOInterleavedMemoryDescriptor : public IOMemoryDescriptor + * @abstract The IOInterleavedMemoryDescriptor object describes a memory area made up of portions of several other IOMemoryDescriptors. + * @discussion The IOInterleavedMemoryDescriptor object represents interleaved ranges of memory, specified as an ordered list of portions of individual IOMemoryDescriptors. The portions are chained end-to-end to make up a single contiguous buffer. */ + +class IOInterleavedMemoryDescriptor : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IOInterleavedMemoryDescriptor); + +protected: + + IOByteCount _descriptorCapacity; + UInt32 _descriptorCount; + IOMemoryDescriptor ** _descriptors; + IOByteCount * _descriptorOffsets; + IOByteCount * _descriptorLengths; + bool _descriptorPrepared; + + virtual void free() APPLE_KEXT_OVERRIDE; + +public: + +/*! @function withCapacity + * @abstract Create an IOInterleavedMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors. + * @discussion This method creates and initializes an IOInterleavedMemoryDescriptor for memory consisting of portions of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer. + * @param capacity The maximum number of IOMemoryDescriptors that may be subsequently added to this IOInterleavedMemoryDescriptor. + * @param direction An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + * @result The created IOInterleavedMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOInterleavedMemoryDescriptor * withCapacity( IOByteCount capacity, + IODirection direction); + +/*! @function initWithCapacity + * @abstract Initialize an IOInterleavedMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors. + * @discussion This method initializes an IOInterleavedMemoryDescriptor for memory consisting of portions of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer. + * @param capacity The maximum number of IOMemoryDescriptors that may be subsequently added to this IOInterleavedMemoryDescriptor. + * @param direction An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + * @result The created IOInterleavedMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + virtual bool initWithCapacity( IOByteCount capacity, + IODirection direction ); + +/*! @function clearMemoryDescriptors + * @abstract Clear all of the IOMemoryDescriptors currently contained in and reset the IOInterleavedMemoryDescriptor. + * @discussion Clears each IOMemoryDescriptor by completing (if needed) and releasing. The IOInterleavedMemoryDescriptor is then reset and may accept new descriptors up to the capacity specified when it was created. + * @param direction An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. */ + + virtual void clearMemoryDescriptors( IODirection direction = kIODirectionNone ); + +/*! @function setMemoryDescriptor + * @abstract Add a portion of an IOMemoryDescriptor to the IOInterleavedMemoryDescriptor. + * @discussion This method adds the portion of an IOMemoryDescriptor described by the offset and length parameters to the end of the IOInterleavedMemoryDescriptor. A single IOMemoryDescriptor may be added as many times as there is room for it. The offset and length must describe a portion entirely within the IOMemoryDescriptor. + * @param descriptor An IOMemoryDescriptor to be added to the IOInterleavedMemoryDescriptor. Its direction must be compatible with that of the IOInterleavedMemoryDescriptor. + * @param offset The offset into the IOMemoryDescriptor of the portion that will be added to the virtualized buffer. + * @param length The length of the portion of the IOMemoryDescriptor to be added to the virtualized buffer. + * @result Returns true the portion was successfully added. */ + + virtual bool setMemoryDescriptor( IOMemoryDescriptor * descriptor, + IOByteCount offset, + IOByteCount length ); + +/*! @function getPhysicalSegment + * @abstract Break a memory descriptor into its physically contiguous segments. + * @discussion This method returns the physical address of the byte at the given offset into the memory, and optionally the length of the physically contiguous segment from that offset. + * @param offset A byte offset into the memory whose physical address to return. + * @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset. + * @result A physical address, or zero if the offset is beyond the length of the memory. */ + + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; + +/*! @function prepare + * @abstract Prepare the memory for an I/O transfer. + * @discussion This involves paging in the memory, if necessary, and wiring it down for the duration of the transfer. The complete() method completes the processing of the memory after the I/O transfer finishes. This method need not called for non-pageable memory. + * @param forDirection The direction of the I/O to be performed, or kIODirectionNone for the direction specified by the memory descriptor. + * @result An IOReturn code. */ + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone) APPLE_KEXT_OVERRIDE; + +/*! @function complete + * @abstract Complete processing of the memory after an I/O transfer finishes. + * @discussion This method should not be called unless a prepare was previously issued; the prepare() and complete() must occur in pairs, before and after an I/O transfer involving pageable memory. + * @param forDirection The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + * @result An IOReturn code. */ + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone) APPLE_KEXT_OVERRIDE; +}; + +#endif /* !_IOINTERLEAVEDMEMORYDESCRIPTOR_H */ diff --git a/QualcommWireless/include/IOKit/IOInterruptController.h b/QualcommWireless/include/IOKit/IOInterruptController.h new file mode 100644 index 0000000..53bdcf5 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOInterruptController.h @@ -0,0 +1,165 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * DRI: Josh de Cesare + * + */ + + +#ifndef _IOKIT_IOINTERRUPTCONTROLLER_H +#define _IOKIT_IOINTERRUPTCONTROLLER_H + +#include +#include +#include + + +class IOSharedInterruptController; + +struct IOInterruptVector { + volatile char interruptActive; + volatile char interruptDisabledSoft; + volatile char interruptDisabledHard; + volatile char interruptRegistered; + IOLock * interruptLock; + IOService * nub; + int source; + void * target; + IOInterruptHandler handler; + void * refCon; + IOSharedInterruptController *sharedController; +}; + +typedef struct IOInterruptVector IOInterruptVector; + +#if __LP64__ +typedef int32_t IOInterruptVectorNumber; +#else +typedef long IOInterruptVectorNumber; +#endif + +class IOInterruptController : public IOService +{ + OSDeclareAbstractStructors(IOInterruptController); + +protected: + IOInterruptVector *vectors; + IOSimpleLock *controllerLock; + + struct ExpansionData { }; + ExpansionData *ioic_reserved; + +public: + virtual IOReturn registerInterrupt(IOService *nub, int source, + void *target, + IOInterruptHandler handler, + void *refCon); + virtual IOReturn unregisterInterrupt(IOService *nub, int source); + + virtual IOReturn getInterruptType(IOService *nub, int source, + int *interruptType); + + virtual IOReturn enableInterrupt(IOService *nub, int source); + virtual IOReturn disableInterrupt(IOService *nub, int source); + virtual IOReturn causeInterrupt(IOService *nub, int source); + + virtual IOInterruptAction getInterruptHandlerAddress(void); + virtual IOReturn handleInterrupt(void *refCon, IOService *nub, + int source); + +// Methods to be overridden for simplifed interrupt controller subclasses. + + virtual bool vectorCanBeShared(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual void initVector(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual int getVectorType(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual void disableVectorHard(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual void enableVector(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual void causeVector(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + + OSMetaClassDeclareReservedUnused(IOInterruptController, 0); + OSMetaClassDeclareReservedUnused(IOInterruptController, 1); + OSMetaClassDeclareReservedUnused(IOInterruptController, 2); + OSMetaClassDeclareReservedUnused(IOInterruptController, 3); + OSMetaClassDeclareReservedUnused(IOInterruptController, 4); + OSMetaClassDeclareReservedUnused(IOInterruptController, 5); + +public: +// Generic methods (not to be overriden). + + void timeStampSpuriousInterrupt(void); + void timeStampInterruptHandlerStart(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + void timeStampInterruptHandlerEnd(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + +private: + void timeStampInterruptHandlerInternal(bool isStart, IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); +}; + + +class IOSharedInterruptController : public IOInterruptController +{ + OSDeclareDefaultStructors(IOSharedInterruptController); + +private: + IOService *provider; + int numVectors; + int vectorsRegistered; + int vectorsEnabled; + volatile int controllerDisabled; + bool sourceIsLevel; + + struct ExpansionData { }; + ExpansionData *iosic_reserved __unused; + +public: + virtual IOReturn initInterruptController(IOInterruptController *parentController, OSData *parentSource); + + virtual IOReturn registerInterrupt(IOService *nub, int source, + void *target, + IOInterruptHandler handler, + void *refCon) APPLE_KEXT_OVERRIDE; + virtual IOReturn unregisterInterrupt(IOService *nub, int source) APPLE_KEXT_OVERRIDE; + + virtual IOReturn getInterruptType(IOService *nub, int source, + int *interruptType) APPLE_KEXT_OVERRIDE; + + virtual IOReturn enableInterrupt(IOService *nub, int source) APPLE_KEXT_OVERRIDE; + virtual IOReturn disableInterrupt(IOService *nub, int source) APPLE_KEXT_OVERRIDE; + + virtual IOInterruptAction getInterruptHandlerAddress(void) APPLE_KEXT_OVERRIDE; + virtual IOReturn handleInterrupt(void *refCon, IOService *nub, int source) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(IOSharedInterruptController, 0); + OSMetaClassDeclareReservedUnused(IOSharedInterruptController, 1); + OSMetaClassDeclareReservedUnused(IOSharedInterruptController, 2); + OSMetaClassDeclareReservedUnused(IOSharedInterruptController, 3); +}; + + +#endif /* ! _IOKIT_IOINTERRUPTCONTROLLER_H */ diff --git a/QualcommWireless/include/IOKit/IOInterruptEventSource.h b/QualcommWireless/include/IOKit/IOInterruptEventSource.h new file mode 100644 index 0000000..d18d41e --- /dev/null +++ b/QualcommWireless/include/IOKit/IOInterruptEventSource.h @@ -0,0 +1,260 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * 1998-7-13 Godfrey van der Linden(gvdl) + * Created. + * 1998-10-30 Godfrey van der Linden(gvdl) + * Converted to C++ + */ + +#ifndef _IOKIT_IOINTERRUPTEVENTSOURCE_H +#define _IOKIT_IOINTERRUPTEVENTSOURCE_H + +#include + +class IOService; + +struct IOInterruptAccountingData; + +/*! @class IOInterruptEventSource : public IOEventSource + * @abstract Event source for interrupt delivery to work-loop based drivers. + * @discussion The IOInterruptEventSource is a generic object that delivers calls interrupt routines in it's client in a guaranteed single-threaded manner. IOInterruptEventSource is part of the IOKit $link IOWorkLoop infrastructure where the semantic that one and only one action method is executing within a work-loops event chain. + *

+ * When the action method is called in the client member function will receive 2 arguments, (IOEventSource *) sender and (int) count, See $link IOInterruptEventSource::Action. Where sender will be reference to the interrupt that occurred and the count will be computed by the difference between the $link producerCount and $link consumerCount. This number may not be reliable as no attempt is made to adjust for around the world type problems but is provided for general information and statistic gathering. + *

+ * In general a client will use the factory member function to create and initialise the event source and then add it to their work-loop. It is the work loop's responsiblity to maintain the new event source in it's event chain. See $link IOWorkLoop. + *

+ * An interrupt event source attaches itself to the given provider's interrupt source at initialisation time. At this time it determines if it is connected to a level or edge triggered interrupt. If the interrupt is an level triggered interrupt the event source automatically disables the interrupt source at primary interrupt time and after it call's the client it automatically reenables the interrupt. This action is fairly expensive but it is 100% safe and defaults sensibly so that the driver writer does not have to implement type dependant interrupt routines. So to repeat, the driver writer does not have to be concerned by the actual underlying interrupt mechanism as the event source hides the complexity. + *

+ * Saying this if the hardware is a multi-device card, for instance a 4 port NIC, where all of the devices are sharing one level triggered interrupt AND it is possible to determine each port's interrupt state non-destructively then the $link IOFilterInterruptEventSource would be a better choice. + *

+ * Warning: All IOInterruptEventSources are created in the disabled state. If you want to actually schedule interrupt delivery do not forget to enable the source. + */ +class IOInterruptEventSource : public IOEventSource +{ + OSDeclareDefaultStructors(IOInterruptEventSource); + +public: +/*! @typedef Action + * @discussion 'C' pointer prototype of functions that are called in a single threaded context when an interrupt occurs. + * @param owner Pointer to client instance. + * @param sender Pointer to generation interrupt event source. + * @param count Number of interrupts seen before delivery. */ + typedef void (*Action)(OSObject *owner, IOInterruptEventSource *sender, int count); + +#ifdef __BLOCKS__ + typedef void (^ActionBlock)(IOInterruptEventSource *sender, int count); +#endif /* __BLOCKS__ */ + +/*! @defined IOInterruptEventAction + * @discussion Backward compatibilty define for the old non-class scoped type definition. See $link IOInterruptEventSource::Action */ +#define IOInterruptEventAction IOInterruptEventSource::Action + +protected: +/*! @var provider IOService that provides interrupts for delivery. */ + IOService *provider; + +/*! @var intIndex */ + int intIndex; + +/*! @var producerCount + * Current count of produced interrupts that have been received. */ + volatile unsigned int producerCount; + +/*! @var consumerCount + * Current count of produced interrupts that the owner has been informed of. */ + unsigned int consumerCount; + +/*! @var autoDisable Do we need to automatically disable the interrupt source when we take an interrupt, i.e. we are level triggered. */ + bool autoDisable; + +/*! @var explicitDisable Has the user expicitly disabled this event source, if so then do not overide their request when returning from the callout */ + bool explicitDisable; + +/*! @struct ExpansionData + * @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { + IOInterruptAccountingData * statistics; + }; + +/*! @var reserved + * Reserved for future use. (Internal use only) */ + APPLE_KEXT_WSHADOW_PUSH; + ExpansionData *reserved; + APPLE_KEXT_WSHADOW_POP; + +/*! @function free + * @abstract Sub-class implementation of free method, disconnects from the interrupt source. */ + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! @function checkForWork + * @abstract Pure Virtual member function used by IOWorkLoop for issueing a client calls. + * @discussion This function called when the work-loop is ready to check for any work to do and then to call out the owner/action. + * @result Return true if this function needs to be called again before all its outstanding events have been processed. */ + virtual bool checkForWork() APPLE_KEXT_OVERRIDE; + +/*! @function setWorkLoop + * @abstract Sub-class implementation of setWorkLoop method. */ + virtual void setWorkLoop(IOWorkLoop *inWorkLoop) APPLE_KEXT_OVERRIDE; + +public: + +/*! @function interruptEventSource + * @abstract Factory function for IOInterruptEventSources creation and initialisation. + * @param owner Owning client of the new event source. + * @param action 'C' Function to call when something happens. + * @param provider IOService that represents the interrupt source. Defaults to 0. When no provider is defined the event source assumes that the client will in some manner call the interruptOccured method explicitly. This will start the ball rolling for safe delivery of asynchronous event's into the driver. + * @param intIndex The index of the interrupt within the provider's interrupt sources. Defaults to 0, i.e. the first interrupt in the provider. + * @result A new interrupt event source if successfully created and initialised, 0 otherwise. */ + static IOInterruptEventSource * + interruptEventSource(OSObject *owner, + Action action, + IOService *provider = NULL, + int intIndex = 0); + + +#ifdef __BLOCKS__ +/*! @function interruptEventSource + * @abstract Factory function for IOInterruptEventSources creation and initialisation. + * @param owner Owning client of the new event source. + * @param provider IOService that represents the interrupt source. When no provider is defined the event source assumes that the client will in some manner call the interruptOccured method explicitly. This will start the ball rolling for safe delivery of asynchronous event's into the driver. + * @param intIndex The index of the interrupt within the provider's interrupt sources. + * @param action Block for the callout routine of this event source.. + * @result A new interrupt event source if successfully created and initialised, 0 otherwise. */ + static IOInterruptEventSource * + interruptEventSource(OSObject *owner, + IOService *provider, + int intIndex, + ActionBlock action); +#endif /* __BLOCKS__ */ + + +/*! @function init + * @abstract Primary initialiser for the IOInterruptEventSource class. + * @param owner Owning client of the new event source. + * @param action 'C' Function to call when something happens. + * @param provider IOService that represents the interrupt source. Defaults to 0. When no provider is defined the event source assumes that the client will in some manner call the interruptOccured method explicitly. This will start the ball rolling for safe delivery of asynchronous event's into the driver. + * @param intIndex The index of the interrupt within the provider's interrupt sources. Defaults to 0, i.e. the first interrupt in the provider. + * @result true if the inherited classes and this instance initialise + * successfully. */ + virtual bool init(OSObject *owner, + Action action, + IOService *provider = NULL, + int intIndex = 0); + +/*! @function enable + * @abstract Enable event source. + * @discussion A subclass implementation is expected to respect the enabled + * state when checkForWork is called. Calling this function will cause the + * work-loop to be signalled so that a checkForWork is performed. */ + virtual void enable() APPLE_KEXT_OVERRIDE; + +/*! @function disable + * @abstract Disable event source. + * @discussion A subclass implementation is expected to respect the enabled + * state when checkForWork is called. */ + virtual void disable() APPLE_KEXT_OVERRIDE; + +/*! @function getProvider + * @abstract Get'ter for $link provider variable. + * @result value of provider. */ + virtual const IOService *getProvider() const; + +/*! @function getIntIndex + * @abstract Get'ter for $link intIndex interrupt index variable. + * @result value of intIndex. */ + virtual int getIntIndex() const; + +/*! @function getAutoDisable + * @abstract Get'ter for $link autoDisable variable. + * @result value of autoDisable. */ + virtual bool getAutoDisable() const; + +/*! @function interruptOccurred + * @abstract Functions that get called by the interrupt controller. See $link IOService::registerInterrupt + * @param nub Where did the interrupt originate from + * @param ind What is this interrupts index within 'nub'. */ + virtual void interruptOccurred(void *, IOService *nub, int ind); + +/*! @function normalInterruptOccurred + * @abstract Functions that get called by the interrupt controller.See $link IOService::registerInterrupt + * @param nub Where did the interrupt originate from + * @param ind What is this interrupts index within 'nub'. */ + virtual void normalInterruptOccurred(void *, IOService *nub, int ind); + +/*! @function disableInterruptOccurred + * @abstract Functions that get called by the interrupt controller.See $link IOService::registerInterrupt + * @param nub Where did the interrupt originate from + * @param ind What is this interrupts index within 'nub'. */ + virtual void disableInterruptOccurred(void *, IOService *nub, int ind); + +/*! @function warmCPU + * @abstract Tries to reduce latency for an interrupt which will be received near a specified time. + * @discussion Warms up a CPU in advance of an interrupt so that the interrupt may be serviced with predictable latency. + * The warm-up is not periodic; callers should call warmCPU once in advance of each interrupt. It is recommended that + * requests be issues in serial (i.e. each after the target for the previous call has elapsed), as there is a systemwide + * cap on the number of outstanding requests. This routine may be disruptive to the system if used with very small intervals + * between requests; it should be used only in cases where interrupt latency is absolutely critical, and tens or hundreds of + * milliseconds between targets is the expected time scale. NOTE: it is not safe to call this method with interrupts disabled. + * @param abstime Time at which interrupt is expected. */ + IOReturn warmCPU(uint64_t abstime); + +/*! @function enablePrimaryInterruptTimestamp + * @abstract Enables collection of mach_absolute_time at primary interrupt. + * @discussion Enables collection of mach_absolute_time at primary interrupt. + * @param enable True to enable timestamp. */ + + void enablePrimaryInterruptTimestamp(bool enable); + +/*! @function getPimaryInterruptTimestamp + * @abstract Returns mach_absolute_time timestamp of primary interrupt. + * @discussion Returns mach_absolute_time timestamp of primary interrupt. + * @result Value of the timestamp. Zero if never interrupted, or -1ULL if timestamp collection has not been enabled. */ + + uint64_t getPimaryInterruptTimestamp(); + +private: + IOReturn registerInterruptHandler(IOService *inProvider, int inIntIndex); + void unregisterInterruptHandler(IOService *inProvider, int inIntIndex); + +private: + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 0); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 1); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 2); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 3); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 4); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 5); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 6); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 7); +}; + +#endif /* !_IOKIT_IOINTERRUPTEVENTSOURCE_H */ diff --git a/QualcommWireless/include/IOKit/IOInterrupts.h b/QualcommWireless/include/IOKit/IOInterrupts.h new file mode 100644 index 0000000..86e737d --- /dev/null +++ b/QualcommWireless/include/IOKit/IOInterrupts.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * DRI: Josh de Cesare + * + */ + + +#ifndef _IOKIT_IOINTERRUPTS_H +#define _IOKIT_IOINTERRUPTS_H + +#define kIOInterruptTypeEdge (0) +#define kIOInterruptTypeLevel (1) + +#ifdef __cplusplus + +class OSData; +class IOInterruptController; + +struct IOInterruptSource { + IOInterruptController *interruptController; + OSData *vectorData; +}; +typedef struct IOInterruptSource IOInterruptSource; + + + +#endif /* __cplusplus */ + +typedef void (*IOInterruptHandler)(void *target, void *refCon, + void *nub, int source); + +#endif /* ! _IOKIT_IOINTERRUPTS_H */ diff --git a/QualcommWireless/include/IOKit/IOKernelReportStructs.h b/QualcommWireless/include/IOKit/IOKernelReportStructs.h new file mode 100644 index 0000000..162ac55 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOKernelReportStructs.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2012-2014 Apple Computer, Inc. All Rights Reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +// Internal data structures to be used by IOReporters and User Space Observers + + +#ifndef _IOKERNELREPORTSTRUCTS_H_ +#define _IOKERNELREPORTSTRUCTS_H_ + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// Drivers participating in IOReporting can advertise channels by +// publishing properties in the I/O Kit registry. Various helper +// mechanisms exist to produce correctly-formatted legends. +// 12836893 tracks advertising channels in user space. +#define kIOReportLegendPublicKey "IOReportLegendPublic" // bool +#define kIOReportLegendKey "IOReportLegend" // arr +#define kIOReportLegendChannelsKey "IOReportChannels" // arr +#define kIOReportLegendGroupNameKey "IOReportGroupName" // str +#define kIOReportLegendSubGroupNameKey "IOReportSubGroupName" // str +#define kIOReportLegendInfoKey "IOReportChannelInfo" // dict +#define kIOReportLegendUnitKey "IOReportChannelUnit" // num +#define kIOReportLegendConfigKey "IOReportChannelConfig" // data +#define kIOReportLegendStateNamesKey "IOReportChannelStateNames" // str[] + +// in an I/O Kit registry legend, a small "array struct" represents a channel +#define kIOReportChannelIDIdx 0 // required +#define kIOReportChannelTypeIdx 1 // required +#define kIOReportChannelNameIdx 2 // optional + +/* Histogram Segment Configuration + * Currently supports 2 types of scaling to compute bucket upper bounds, + * linear or exponential. + * scale_flag = 0 -> linear scale + * 1 -> exponential scale + * upper_bound[n] = (scale_flag) ? pow(base,(n+1)) : base * (n+1); + */ +#define kIOHistogramScaleLinear 0 +#define kIOHistogramScaleExponential 1 +typedef struct { + uint32_t base_bucket_width;// segment[0].bucket[0] = [0, base_width] + uint32_t scale_flag; // bit 0 only in current use (see #defs) + uint32_t segment_idx; // for multiple segments histograms + uint32_t segment_bucket_count;// number of buckets in this segment +} __attribute((packed)) IOHistogramSegmentConfig; + +// "normalized distribution"(FIXME?) internal format (unused?) +typedef struct { + uint64_t samples; + uint64_t mean; + uint64_t variance; + uint64_t reserved; +} __attribute((packed)) IONormDistReportValues; + +#ifdef __cplusplus +} +#endif + +#endif // _IOKERNELREPORTSTRUCTS_H_ diff --git a/QualcommWireless/include/IOKit/IOKitDebug.h b/QualcommWireless/include/IOKit/IOKitDebug.h new file mode 100644 index 0000000..082d1b2 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOKitDebug.h @@ -0,0 +1,227 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOKITDEBUG_H +#define _IOKIT_IOKITDEBUG_H + +#include + + +#ifdef __cplusplus + +#include +#include +#include + +class IOKitDiagnostics : public OSObject +{ + OSDeclareDefaultStructors(IOKitDiagnostics); + +public: + static OSObject * diagnostics( void ); + virtual bool serialize(OSSerialize *s) const APPLE_KEXT_OVERRIDE; +private: + static void updateOffset( OSDictionary * dict, + UInt64 value, const char * name ); +}; + +#endif /* __cplusplus */ + +enum { + // loggage + kIOLogAttach = 0x00000001ULL, + kIOLogProbe = 0x00000002ULL, + kIOLogStart = 0x00000004ULL, + kIOLogRegister = 0x00000008ULL, + kIOLogMatch = 0x00000010ULL, + kIOLogConfig = 0x00000020ULL, + kIOLogYield = 0x00000040ULL, + kIOLogPower = 0x00000080ULL, + kIOLogMapping = 0x00000100ULL, + kIOLogCatalogue = 0x00000200ULL, + kIOLogTracePower = 0x00000400ULL, // Obsolete: Use iotrace=0x00000400ULL to enable now + kIOLogDebugPower = 0x00000800ULL, + kIOLogServiceTree = 0x00001000ULL, + kIOLogDTree = 0x00002000ULL, + kIOLogMemory = 0x00004000ULL, + kIOLogKextMemory = 0x00008000ULL, + kOSLogRegistryMods = 0x00010000ULL,// Log attempts to modify registry collections + kIOLogPMRootDomain = 0x00020000ULL, + kOSRegistryModsMode = 0x00040000ULL,// Change default registry modification handling - panic vs. log +// kIOTraceIOService = 0x00080000ULL, // Obsolete: Use iotrace=0x00080000ULL to enable now + kIOLogHibernate = 0x00100000ULL, + kIOStatistics = 0x04000000ULL, + kIOSleepWakeWdogOff = 0x40000000ULL, + kIOKextSpinDump = 0x80000000ULL, + + // debug aids - change behaviour + kIONoFreeObjects = 0x00100000ULL, +// kIOLogSynchronous = 0x00200000ULL, // IOLog completes synchronously -- obsolete + kIOTracking = 0x00400000ULL, + kIOWaitQuietPanics = 0x00800000ULL, + kIOWaitQuietBeforeRoot = 0x01000000ULL, + kIOTrackingBoot = 0x02000000ULL, + + _kIODebugTopFlag = 0x8000000000000000ULL// force enum to be 64 bits +}; + +enum { + kIOKitDebugUserOptions = 0 + | kIOLogAttach + | kIOLogProbe + | kIOLogStart + | kIOLogRegister + | kIOLogMatch + | kIOLogConfig + | kIOLogYield + | kIOLogPower + | kIOLogMapping + | kIOLogCatalogue + | kIOLogTracePower + | kIOLogDebugPower + | kOSLogRegistryMods + | kIOLogPMRootDomain + | kOSRegistryModsMode + | kIOLogHibernate + | kIOSleepWakeWdogOff + | kIOKextSpinDump + | kIOWaitQuietPanics +}; + +enum { + kIOTraceInterrupts = 0x00000001ULL, // Trace primary interrupts + kIOTraceWorkLoops = 0x00000002ULL, // Trace workloop activity + kIOTraceEventSources = 0x00000004ULL, // Trace non-passive event sources + kIOTraceIntEventSource = 0x00000008ULL, // Trace IOIES and IOFIES sources + kIOTraceCommandGates = 0x00000010ULL, // Trace command gate activity + kIOTraceTimers = 0x00000020ULL, // Trace timer event source activity + + kIOTracePowerMgmt = 0x00000400ULL, // Trace power management changes + + kIOTraceIOService = 0x00080000ULL, // registerService/termination + + kIOTraceCompatBootArgs = kIOTraceIOService | kIOTracePowerMgmt +}; + +enum { + kIODKEnable = 0x00000001ULL, + kIODKLogSetup = 0x00000002ULL, + kIODKLogIPC = 0x00000004ULL, + kIODKLogPM = 0x00000008ULL, + kIODKLogMessages = 0x00000010ULL, + + kIODKDisablePM = 0x000000100ULL, + kIODKDisableDextLaunch = 0x00001000ULL, + kIODKDisableDextTag = 0x00002000ULL, + kIODKDisableCDHashChecking = 0x00004000ULL, + kIODKDisableEntitlementChecking = 0x00008000ULL, +}; + + +extern SInt64 gIOKitDebug; +extern SInt64 gIOKitTrace; +extern SInt64 gIODKDebug; + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +class IORegistryPlane; +#endif + +extern void IOPrintPlane( +#ifdef __cplusplus + const IORegistryPlane * plane +#else + const struct IORegistryPlane * plane +#endif + ); +#ifndef _OSCPPDEBUG_H +extern void OSPrintMemory( void ); +#endif +#define IOPrintMemory OSPrintMemory + + + +#define kIOKitDiagnosticsClientClassName "IOKitDiagnosticsClient" + +enum{ + kIOKitDiagnosticsClientType = 0x99000002 +}; + + +struct IOKitDiagnosticsParameters { + size_t size; + uint64_t value; + uint32_t options; + uint32_t tag; + uint32_t zsize; + uint32_t reserved[8]; +}; +typedef struct IOKitDiagnosticsParameters IOKitDiagnosticsParameters; + +enum{ + kIOTrackingCallSiteBTs = 16, +}; + +struct IOTrackingCallSiteInfo { + uint32_t count; + pid_t addressPID; + mach_vm_address_t address; + mach_vm_size_t size[2]; + pid_t btPID; + mach_vm_address_t bt[2][kIOTrackingCallSiteBTs]; +}; + +#define kIOMallocTrackingName "IOMalloc" +#define kIOWireTrackingName "IOWire" +#define kIOMapTrackingName "IOMap" + + +enum{ + kIOTrackingExcludeNames = 0x00000001, +}; + +enum{ + kIOTrackingGetTracking = 0x00000001, + kIOTrackingGetMappings = 0x00000002, + kIOTrackingResetTracking = 0x00000003, + kIOTrackingStartCapture = 0x00000004, + kIOTrackingStopCapture = 0x00000005, + kIOTrackingSetMinCaptureSize = 0x00000006, + kIOTrackingLeaks = 0x00000007, + kIOTrackingInvalid = 0xFFFFFFFE, +}; + + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* ! _IOKIT_IOKITDEBUG_H */ diff --git a/QualcommWireless/include/IOKit/IOKitDiagnosticsUserClient.h b/QualcommWireless/include/IOKit/IOKitDiagnosticsUserClient.h new file mode 100644 index 0000000..f78c45c --- /dev/null +++ b/QualcommWireless/include/IOKit/IOKitDiagnosticsUserClient.h @@ -0,0 +1,17 @@ +/* * Copyright (c) 2019 Apple Inc. All rights reserved. */ + +#include +#include + + +class IOKitDiagnosticsClient : public IOUserClient +{ + OSDeclareDefaultStructors(IOKitDiagnosticsClient); + +public: + static IOUserClient * withTask(task_t owningTask); + virtual IOReturn clientClose(void) APPLE_KEXT_OVERRIDE; + virtual IOReturn setProperties(OSObject * properties) APPLE_KEXT_OVERRIDE; + virtual IOReturn externalMethod(uint32_t selector, IOExternalMethodArguments * args, + IOExternalMethodDispatch * dispatch, OSObject * target, void * reference) APPLE_KEXT_OVERRIDE; +}; diff --git a/QualcommWireless/include/IOKit/IOKitKeys.h b/QualcommWireless/include/IOKit/IOKitKeys.h new file mode 100644 index 0000000..3b5c96b --- /dev/null +++ b/QualcommWireless/include/IOKit/IOKitKeys.h @@ -0,0 +1,220 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * Common symbol definitions for IOKit. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOKITKEYS_H +#define _IOKIT_IOKITKEYS_H + +// properties found in the registry root +#define kIOKitBuildVersionKey "IOKitBuildVersion" +#define kIOKitDiagnosticsKey "IOKitDiagnostics" +// a dictionary keyed by plane name +#define kIORegistryPlanesKey "IORegistryPlanes" +#define kIOCatalogueKey "IOCatalogue" + +// registry plane names +#define kIOServicePlane "IOService" +#define kIOPowerPlane "IOPower" +#define kIODeviceTreePlane "IODeviceTree" +#define kIOAudioPlane "IOAudio" +#define kIOFireWirePlane "IOFireWire" +#define kIOUSBPlane "IOUSB" + +// registry ID number +#define kIORegistryEntryIDKey "IORegistryEntryID" +// property name to get array of property names +#define kIORegistryEntryPropertyKeysKey "IORegistryEntryPropertyKeys" + +// IOService class name +#define kIOServiceClass "IOService" + +// IOResources class name +#define kIOResourcesClass "IOResources" + +// IOService driver probing property names +#define kIOClassKey "IOClass" +#define kIOProbeScoreKey "IOProbeScore" +#define kIOKitDebugKey "IOKitDebug" + +// Properties to be supported as API +#define kIOSupportedPropertiesKey "IOSupportedProperties" +// Properties writable by dexts +#define kIOUserServicePropertiesKey "IOUserServiceProperties" + + +// IOService matching property names +#define kIOProviderClassKey "IOProviderClass" +#define kIONameMatchKey "IONameMatch" +#define kIOPropertyMatchKey "IOPropertyMatch" +#define kIOPropertyExistsMatchKey "IOPropertyExistsMatch" +#define kIOPathMatchKey "IOPathMatch" +#define kIOLocationMatchKey "IOLocationMatch" +#define kIOParentMatchKey "IOParentMatch" +#define kIOResourceMatchKey "IOResourceMatch" +#define kIOResourceMatchedKey "IOResourceMatched" +#define kIOMatchedServiceCountKey "IOMatchedServiceCountMatch" + +#define kIONameMatchedKey "IONameMatched" + +#define kIOMatchCategoryKey "IOMatchCategory" +#define kIODefaultMatchCategoryKey "IODefaultMatchCategory" + +#define kIOMatchedPersonalityKey "IOMatchedPersonality" +#define kIORematchPersonalityKey "IORematchPersonality" +#define kIORematchCountKey "IORematchCount" +#define kIODEXTMatchCountKey "IODEXTMatchCount" + +// Entitlements to check against dext process +// Property is an array, one or more of which may match, of: +// an array of entitlement strings, all must be present +// Any array can be a single string. +#define kIOServiceDEXTEntitlementsKey "IOServiceDEXTEntitlements" + +// Entitlement required to open dext connection +#define kIODriverKitEntitlementKey "com.apple.developer.driverkit" + +// Entitlements required to open dext IOUserClient +// Property is an array of strings containing CFBundleIdentifiers of service being opened +#define kIODriverKitUserClientEntitlementsKey "com.apple.developer.driverkit.userclient-access" + +// Entitlement of a dext that allows any task to open one of its IOUserClients +#define kIODriverKitUserClientEntitlementAllowAnyKey "com.apple.developer.driverkit.allow-any-userclient-access" + +// Other DriverKit entitlements +#define kIODriverKitUSBTransportEntitlementKey "com.apple.developer.driverkit.transport.usb" +#define kIODriverKitHIDTransportEntitlementKey "com.apple.developer.driverkit.transport.hid" +#define kIODriverKitHIDFamilyDeviceEntitlementKey "com.apple.developer.driverkit.family.hid.device" +#define kIODriverKitHIDFamilyEventServiceEntitlementKey "com.apple.developer.driverkit.family.hid.eventservice" +#define kIODriverKitTransportBuiltinEntitlementKey "com.apple.developer.driverkit.builtin" + + +// When possible, defer matching of this driver until kextd has started. +#define kIOMatchDeferKey "IOMatchDefer" + +// IOService default user client class, for loadable user clients +#define kIOUserClientClassKey "IOUserClientClass" + +// key to find IOMappers +#define kIOMapperIDKey "IOMapperID" + +#define kIOUserClientCrossEndianKey "IOUserClientCrossEndian" +#define kIOUserClientCrossEndianCompatibleKey "IOUserClientCrossEndianCompatible" +#define kIOUserClientSharedInstanceKey "IOUserClientSharedInstance" +// diagnostic string describing the creating task +#define kIOUserClientCreatorKey "IOUserClientCreator" +// the expected cdhash value of the userspace driver executable +#define kIOUserServerCDHashKey "IOUserServerCDHash" + +#define kIOUserUserClientKey "IOUserUserClient" + + +// IOService notification types +#define kIOPublishNotification "IOServicePublish" +#define kIOFirstPublishNotification "IOServiceFirstPublish" +#define kIOMatchedNotification "IOServiceMatched" +#define kIOFirstMatchNotification "IOServiceFirstMatch" +#define kIOTerminatedNotification "IOServiceTerminate" +#define kIOWillTerminateNotification "IOServiceWillTerminate" + +// IOService interest notification types +#define kIOGeneralInterest "IOGeneralInterest" +#define kIOBusyInterest "IOBusyInterest" +#define kIOAppPowerStateInterest "IOAppPowerStateInterest" +#define kIOPriorityPowerStateInterest "IOPriorityPowerStateInterest" + +#define kIOPlatformDeviceMessageKey "IOPlatformDeviceMessage" + +// IOService interest notification types +#define kIOCFPlugInTypesKey "IOCFPlugInTypes" + +// properties found in services that implement command pooling +#define kIOCommandPoolSizeKey "IOCommandPoolSize" // (OSNumber) + +// properties found in services that implement priority +#define kIOMaximumPriorityCountKey "IOMaximumPriorityCount" // (OSNumber) + +// properties found in services that have transfer constraints +#define kIOMaximumBlockCountReadKey "IOMaximumBlockCountRead" // (OSNumber) +#define kIOMaximumBlockCountWriteKey "IOMaximumBlockCountWrite" // (OSNumber) +#define kIOMaximumByteCountReadKey "IOMaximumByteCountRead" // (OSNumber) +#define kIOMaximumByteCountWriteKey "IOMaximumByteCountWrite" // (OSNumber) +#define kIOMaximumSegmentCountReadKey "IOMaximumSegmentCountRead" // (OSNumber) +#define kIOMaximumSegmentCountWriteKey "IOMaximumSegmentCountWrite" // (OSNumber) +#define kIOMaximumSegmentByteCountReadKey "IOMaximumSegmentByteCountRead" // (OSNumber) +#define kIOMaximumSegmentByteCountWriteKey "IOMaximumSegmentByteCountWrite" // (OSNumber) +#define kIOMinimumSegmentAlignmentByteCountKey "IOMinimumSegmentAlignmentByteCount" // (OSNumber) +#define kIOMaximumSegmentAddressableBitCountKey "IOMaximumSegmentAddressableBitCount" // (OSNumber) +#define kIOMinimumSaturationByteCountKey "IOMinimumSaturationByteCount" // (OSNumber) +#define kIOMaximumSwapWriteKey "IOMaximumSwapWrite" // (OSNumber) + +// properties found in services that wish to describe an icon +// +// IOIcon = +// { +// CFBundleIdentifier = "com.example.driver.example"; +// IOBundleResourceFile = "example.icns"; +// }; +// +// where IOBundleResourceFile is the filename of the resource + +#define kIOIconKey "IOIcon" // (OSDictionary) +#define kIOBundleResourceFileKey "IOBundleResourceFile" // (OSString) + +#define kIOBusBadgeKey "IOBusBadge" // (OSDictionary) +#define kIODeviceIconKey "IODeviceIcon" // (OSDictionary) + +// property of root that describes the machine's serial number as a string +#define kIOPlatformSerialNumberKey "IOPlatformSerialNumber" // (OSString) + +// property of root that describes the machine's UUID as a string +#define kIOPlatformUUIDKey "IOPlatformUUID" // (OSString) + +// IODTNVRAM property keys +#define kIONVRAMBootArgsKey "boot-args" +#define kIONVRAMDeletePropertyKey "IONVRAM-DELETE-PROPERTY" +#define kIONVRAMSyncNowPropertyKey "IONVRAM-SYNCNOW-PROPERTY" +#define kIONVRAMActivateCSRConfigPropertyKey "IONVRAM-ARMCSR-PROPERTY" +#define kIODTNVRAMPanicInfoKey "aapl,panic-info" + +// keys for complex boot information +#define kIOBootDeviceKey "IOBootDevice" // dict | array of dicts +#define kIOBootDevicePathKey "IOBootDevicePath" // arch-neutral OSString +#define kIOBootDeviceSizeKey "IOBootDeviceSize" // OSNumber of bytes + +// keys for OS Version information +#define kOSBuildVersionKey "OS Build Version" + +#endif /* ! _IOKIT_IOKITKEYS_H */ diff --git a/QualcommWireless/include/IOKit/IOKitServer.h b/QualcommWireless/include/IOKit/IOKitServer.h new file mode 100644 index 0000000..4b12abf --- /dev/null +++ b/QualcommWireless/include/IOKit/IOKitServer.h @@ -0,0 +1,118 @@ +/* + * Copyright (c) 1998-2011 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +/* + * Internal definitions used between the iokit user library and + * server routines. + */ + +#ifndef _IOKIT_IOKITSERVER_H +#define _IOKIT_IOKITSERVER_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif +#include +#ifdef __cplusplus +} +#endif + +// IOCatalogueSendData +/*! + * @enum IOCatalogueSendData user-client flags. + * @constant kIOCatalogAddDrivers Signals a call to the addDrivers function in IOCatalogue. + * @constant kIOCatalogAddDriversNoMatch Signals a call to the addDrivers function in IOCatalogue but does not start a matching thread. + * @constant kIOCatalogRemoveDrivers Signals a call to the removeDrivers function in IOCatalogue. + * @constant kIOCatalogRemoveDriversNoMatch Signals a call to the removedrivers function in IOCatalogue but does not start a matching thread. + * @constant kIOCatalogStartMatching Signals the IOCatalogue to start an IOService matching thread. + * @constant kIOCatalogRemoveKernelLinker Deprecated; does nothing. + * @constant kIOCatalogKextdActive Signals the kernel that kextd is running. + * @constant kIOCatalogKextdFinishedLaunching Signals the IOCatalogue that kextd has finished sending it information at startup. + * @constant kIOCatalogResetDrivers Resets the IOCatalogue with a new set of personalities. + * @constant kIOCatalogResetDriversNoMatch Resets the IOCatalogue with a new set of personalities but does not start a matching thread. + */ +enum { + kIOCatalogAddDrivers = 1, + kIOCatalogAddDriversNoMatch, + kIOCatalogRemoveDrivers, + kIOCatalogRemoveDriversNoMatch, + kIOCatalogStartMatching__Removed, + kIOCatalogRemoveKernelLinker__Removed, + kIOCatalogKextdActive, + kIOCatalogKextdFinishedLaunching, + kIOCatalogResetDrivers, + kIOCatalogResetDriversNoMatch +}; + +// IOCatalogueGetData +/*! + * @enum IOCatalogueGetData user-client flags + * @constant kIOCatalogGetContents Returns a snapshot of the database to the caller. + */ +enum { + kIOCatalogGetContents = 1, + kIOCatalogGetModuleDemandList = 2, + kIOCatalogGetCacheMissList = 3, + kIOCatalogGetROMMkextList = 4 +}; + +// IOCatalogueReset +/*! + * @enum IOCatalogueReset user-client flag + * @constant kIOCatalogResetDefault Removes all entries from IOCatalogue except those used for booting the system. + */ +enum { + kIOCatalogResetDefault = 1 +}; + +// IOCatalogueTerminate +/*! + * @enum IOCatalogueTerminate user-client flags. + * @constant kIOCatalogModuleUnload Terminates all services which depend on a particular module and unloads the module. + * @constant kIOCatalogModuleTerminate Terminates all services which depend on a particular module but does not unload the module. + * @constant kIOCatalogServiceTerminate Terminates a particular service by name. + */ +enum { + kIOCatalogModuleUnload = 1, + kIOCatalogModuleTerminate, + kIOCatalogServiceTerminate +}; + + + +#endif /* ! _IOKIT_IOKITSERVER_H */ diff --git a/QualcommWireless/include/IOKit/IOLib.h b/QualcommWireless/include/IOKit/IOLib.h new file mode 100644 index 0000000..9775c1d --- /dev/null +++ b/QualcommWireless/include/IOKit/IOLib.h @@ -0,0 +1,450 @@ +/* + * Copyright (c) 1998-2016 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef __IOKIT_IOLIB_H +#define __IOKIT_IOLIB_H + + +#include +#include +#include + +#include + +#include + +#include +#include +#include + +#include + +__BEGIN_DECLS + +#include +#include + +/* + * min/max macros. + */ + +#define min(a, b) ((a) < (b) ? (a) : (b)) +#define max(a, b) ((a) > (b) ? (a) : (b)) + +/* + * These are opaque to the user. + */ +typedef thread_t IOThread; +typedef void (*IOThreadFunc)(void *argument); + +/* + * Memory allocation functions. + */ + +/*! @function IOMalloc + * @abstract Allocates general purpose, wired memory in the kernel map. + * @discussion This is a general purpose utility to allocate memory in the kernel. There are no alignment guarantees given on the returned memory, and alignment may vary depending on the kernel configuration. This function may block and so should not be called from interrupt level or while a simple lock is held. + * @param size Size of the memory requested. + * @result Pointer to the allocated memory, or zero on failure. */ + +void * IOMalloc(vm_size_t size) __attribute__((alloc_size(1))); +void * IOMallocZero(vm_size_t size) __attribute__((alloc_size(1))); + +/*! @function IOFree + * @abstract Frees memory allocated with IOMalloc. + * @discussion This function frees memory allocated with IOMalloc, it may block and so should not be called from interrupt level or while a simple lock is held. + * @param address Pointer to the allocated memory. Must be identical to result + * @of a prior IOMalloc. + * @param size Size of the memory allocated. Must be identical to size of + * @the corresponding IOMalloc */ + +void IOFree(void * address, vm_size_t size); + +/*! @function IOMallocAligned + * @abstract Allocates wired memory in the kernel map, with an alignment restriction. + * @discussion This is a utility to allocate memory in the kernel, with an alignment restriction which is specified as a byte count. This function may block and so should not be called from interrupt level or while a simple lock is held. + * @param size Size of the memory requested. + * @param alignment Byte count of the alignment for the memory. For example, pass 256 to get memory allocated at an address with bit 0-7 zero. + * @result Pointer to the allocated memory, or zero on failure. */ + +void * IOMallocAligned(vm_size_t size, vm_offset_t alignment) __attribute__((alloc_size(1))); + +/*! @function IOFreeAligned + * @abstract Frees memory allocated with IOMallocAligned. + * @discussion This function frees memory allocated with IOMallocAligned, it may block and so should not be called from interrupt level or while a simple lock is held. + * @param address Pointer to the allocated memory. + * @param size Size of the memory allocated. */ + +void IOFreeAligned(void * address, vm_size_t size); + +/*! @function IOMallocContiguous + * @abstract Deprecated - use IOBufferMemoryDescriptor. Allocates wired memory in the kernel map, with an alignment restriction and physically contiguous. + * @discussion This is a utility to allocate memory in the kernel, with an alignment restriction which is specified as a byte count, and will allocate only physically contiguous memory. The request may fail if memory is fragmented, and may cause large amounts of paging activity. This function may block and so should not be called from interrupt level or while a simple lock is held. + * @param size Size of the memory requested. + * @param alignment Byte count of the alignment for the memory. For example, pass 256 to get memory allocated at an address with bits 0-7 zero. + * @param physicalAddress IOMallocContiguous returns the physical address of the allocated memory here, if physicalAddress is a non-zero pointer. The physicalAddress argument is deprecated and should be passed as NULL. To obtain the physical address for a memory buffer, use the IODMACommand class in conjunction with the IOMemoryDescriptor or IOBufferMemoryDescriptor classes. + * @result Virtual address of the allocated memory, or zero on failure. */ + +void * IOMallocContiguous(vm_size_t size, vm_size_t alignment, + IOPhysicalAddress * physicalAddress) __attribute__((deprecated)) __attribute__((alloc_size(1))); + +/*! @function IOFreeContiguous + * @abstract Deprecated - use IOBufferMemoryDescriptor. Frees memory allocated with IOMallocContiguous. + * @discussion This function frees memory allocated with IOMallocContiguous, it may block and so should not be called from interrupt level or while a simple lock is held. + * @param address Virtual address of the allocated memory. + * @param size Size of the memory allocated. */ + +void IOFreeContiguous(void * address, vm_size_t size) __attribute__((deprecated)); + + +/*! @function IOMallocPageable + * @abstract Allocates pageable memory in the kernel map. + * @discussion This is a utility to allocate pageable memory in the kernel. This function may block and so should not be called from interrupt level or while a simple lock is held. + * @param size Size of the memory requested. + * @param alignment Byte count of the alignment for the memory. For example, pass 256 to get memory allocated at an address with bits 0-7 zero. + * @result Pointer to the allocated memory, or zero on failure. */ + +void * IOMallocPageable(vm_size_t size, vm_size_t alignment) __attribute__((alloc_size(1))); + +/*! @function IOFreePageable + * @abstract Frees memory allocated with IOMallocPageable. + * @discussion This function frees memory allocated with IOMallocPageable, it may block and so should not be called from interrupt level or while a simple lock is held. + * @param address Virtual address of the allocated memory. + * @param size Size of the memory allocated. */ + +void IOFreePageable(void * address, vm_size_t size); + +/* + * Typed memory allocation macros. All may block. + */ + +#define IONew(type, count) \ +({ \ + size_t __size; \ + (os_mul_overflow(sizeof(type), (count), &__size) \ + ? ((type *) NULL) \ + : ((type *) IOMalloc(__size))); \ +}) + +#define IONewZero(type, count) \ +({ \ + size_t __size; \ + (os_mul_overflow(sizeof(type), (count), &__size) \ + ? ((type *) NULL) \ + : ((type *) IOMallocZero(__size))); \ +}) + +#define IODelete(ptr, type, count) \ +({ \ + size_t __size; \ + if (!os_mul_overflow(sizeof(type), (count), &__size)) { \ + IOFree(ptr, __size); \ + } \ +}) + +#define IOSafeDeleteNULL(ptr, type, count) \ + do { \ + if (NULL != (ptr)) { \ + IODelete((ptr), type, count); \ + (ptr) = NULL; \ + } \ + } while (0) \ + +///////////////////////////////////////////////////////////////////////////// +// +// +// These functions are now implemented in IOMapper.cpp +// +// +///////////////////////////////////////////////////////////////////////////// + +/*! @function IOMappedRead8 + * @abstract Read one byte from the desired "Physical" IOSpace address. + * @discussion Read one byte from the desired "Physical" IOSpace address. This function allows the developer to read an address returned from any memory descriptor's getPhysicalSegment routine. It can then be used by segmenting a physical page slightly to tag the physical page with its kernel space virtual address. + * @param address The desired address, as returned by IOMemoryDescriptor::getPhysicalSegment. + * @result Data contained at that location */ + +UInt8 IOMappedRead8(IOPhysicalAddress address); + +/*! @function IOMappedRead16 + * @abstract Read two bytes from the desired "Physical" IOSpace address. + * @discussion Read two bytes from the desired "Physical" IOSpace address. This function allows the developer to read an address returned from any memory descriptor's getPhysicalSegment routine. It can then be used by segmenting a physical page slightly to tag the physical page with its kernel space virtual address. + * @param address The desired address, as returned by IOMemoryDescriptor::getPhysicalSegment. + * @result Data contained at that location */ + +UInt16 IOMappedRead16(IOPhysicalAddress address); + +/*! @function IOMappedRead32 + * @abstract Read four bytes from the desired "Physical" IOSpace address. + * @discussion Read four bytes from the desired "Physical" IOSpace address. This function allows the developer to read an address returned from any memory descriptor's getPhysicalSegment routine. It can then be used by segmenting a physical page slightly to tag the physical page with its kernel space virtual address. + * @param address The desired address, as returned by IOMemoryDescriptor::getPhysicalSegment. + * @result Data contained at that location */ + +UInt32 IOMappedRead32(IOPhysicalAddress address); + +/*! @function IOMappedRead64 + * @abstract Read eight bytes from the desired "Physical" IOSpace address. + * @discussion Read eight bytes from the desired "Physical" IOSpace address. This function allows the developer to read an address returned from any memory descriptor's getPhysicalSegment routine. It can then be used by segmenting a physical page slightly to tag the physical page with its kernel space virtual address. + * @param address The desired address, as returned by IOMemoryDescriptor::getPhysicalSegment. + * @result Data contained at that location */ + +UInt64 IOMappedRead64(IOPhysicalAddress address); + +/*! @function IOMappedWrite8 + * @abstract Write one byte to the desired "Physical" IOSpace address. + * @discussion Write one byte to the desired "Physical" IOSpace address. This function allows the developer to write to an address returned from any memory descriptor's getPhysicalSegment routine. + * @param address The desired address, as returned by IOMemoryDescriptor::getPhysicalSegment. + * @param value Data to be writen to the desired location */ + +void IOMappedWrite8(IOPhysicalAddress address, UInt8 value); + +/*! @function IOMappedWrite16 + * @abstract Write two bytes to the desired "Physical" IOSpace address. + * @discussion Write two bytes to the desired "Physical" IOSpace address. This function allows the developer to write to an address returned from any memory descriptor's getPhysicalSegment routine. + * @param address The desired address, as returned by IOMemoryDescriptor::getPhysicalSegment. + * @param value Data to be writen to the desired location */ + +void IOMappedWrite16(IOPhysicalAddress address, UInt16 value); + +/*! @function IOMappedWrite32 + * @abstract Write four bytes to the desired "Physical" IOSpace address. + * @discussion Write four bytes to the desired "Physical" IOSpace address. This function allows the developer to write to an address returned from any memory descriptor's getPhysicalSegment routine. + * @param address The desired address, as returned by IOMemoryDescriptor::getPhysicalSegment. + * @param value Data to be writen to the desired location */ + +void IOMappedWrite32(IOPhysicalAddress address, UInt32 value); + +/*! @function IOMappedWrite64 + * @abstract Write eight bytes to the desired "Physical" IOSpace address. + * @discussion Write eight bytes to the desired "Physical" IOSpace address. This function allows the developer to write to an address returned from any memory descriptor's getPhysicalSegment routine. + * @param address The desired address, as returned by IOMemoryDescriptor::getPhysicalSegment. + * @param value Data to be writen to the desired location */ + +void IOMappedWrite64(IOPhysicalAddress address, UInt64 value); + +/* This function is deprecated. Cache settings may be set for allocated memory with the IOBufferMemoryDescriptor api. */ + +IOReturn IOSetProcessorCacheMode( task_t task, IOVirtualAddress address, + IOByteCount length, IOOptionBits cacheMode ) __attribute__((deprecated)); + +/*! @function IOFlushProcessorCache + * @abstract Flushes the processor cache for mapped memory. + * @discussion This function flushes the processor cache of an already mapped memory range. Note in most cases it is preferable to use IOMemoryDescriptor::prepare and complete to manage cache coherency since they are aware of the architecture's requirements. Flushing the processor cache is not required for coherency in most situations. + * @param task Task the memory is mapped into. + * @param address Virtual address of the memory. + * @param length Length of the range to set. + * @result An IOReturn code. */ + +IOReturn IOFlushProcessorCache( task_t task, IOVirtualAddress address, + IOByteCount length ); + +/*! @function IOThreadSelf + * @abstract Returns the osfmk identifier for the currently running thread. + * @discussion This function returns the current thread (a pointer to the currently active osfmk thread_shuttle). */ + +#define IOThreadSelf() (current_thread()) + +/*! @function IOCreateThread + * @abstract Deprecated function - use kernel_thread_start(). Create a kernel thread. + * @discussion This function creates a kernel thread, and passes the caller supplied argument to the new thread. Warning: the value returned by this function is not 100% reliable. There is a race condition where it is possible that the new thread has already terminated before this call returns. Under that circumstance the IOThread returned will be invalid. In general there is little that can be done with this value except compare it against 0. The thread itself can call IOThreadSelf() 100% reliably and that is the prefered mechanism to manipulate the IOThreads state. + * @param function A C-function pointer where the thread will begin execution. + * @param argument Caller specified data to be passed to the new thread. + * @result An IOThread identifier for the new thread, equivalent to an osfmk thread_t. */ + +IOThread IOCreateThread(IOThreadFunc function, void *argument) __attribute__((deprecated)); + +/*! @function IOExitThread + * @abstract Deprecated function - use thread_terminate(). Terminate execution of current thread. + * @discussion This function destroys the currently running thread, and does not return. */ + +void IOExitThread(void) __attribute__((deprecated)); + +/*! @function IOSleep + * @abstract Sleep the calling thread for a number of milliseconds. + * @discussion This function blocks the calling thread for at least the number of specified milliseconds, giving time to other processes. + * @param milliseconds The integer number of milliseconds to wait. */ + +void IOSleep(unsigned milliseconds); + +/*! @function IOSleepWithLeeway + * @abstract Sleep the calling thread for a number of milliseconds, with a specified leeway the kernel may use for timer coalescing. + * @discussion This function blocks the calling thread for at least the number of specified milliseconds, giving time to other processes. The kernel may also coalesce any timers involved in the delay, using the leeway given as a guideline. + * @param intervalMilliseconds The integer number of milliseconds to wait. + * @param leewayMilliseconds The integer number of milliseconds to use as a timer coalescing guideline. */ + +void IOSleepWithLeeway(unsigned intervalMilliseconds, unsigned leewayMilliseconds); + +/*! @function IODelay + * @abstract Spin delay for a number of microseconds. + * @discussion This function spins to delay for at least the number of specified microseconds. Since the CPU is busy spinning no time is made available to other processes; this method of delay should be used only for short periods. Also, the AbsoluteTime based APIs of kern/clock.h provide finer grained and lower cost delays. + * @param microseconds The integer number of microseconds to spin wait. */ + +void IODelay(unsigned microseconds); + +/*! @function IOPause + * @abstract Spin delay for a number of nanoseconds. + * @discussion This function spins to delay for at least the number of specified nanoseconds. Since the CPU is busy spinning no time is made available to other processes; this method of delay should be used only for short periods. + * @param nanoseconds The integer number of nanoseconds to spin wait. */ + +void IOPause(unsigned nanoseconds); + +/*! @function IOLog + * @abstract Log a message to console in text mode, and /var/log/system.log. + * @discussion This function allows a driver to log diagnostic information to the screen during verbose boots, and to a log file found at /var/log/system.log. IOLog should not be called from interrupt context. + * @param format A printf() style format string (see printf(3) documentation). + */ + +void IOLog(const char *format, ...) +__attribute__((format(printf, 1, 2))); + +/*! @function IOLogv + * @abstract Log a message to console in text mode, and /var/log/system.log. + * @discussion This function allows a driver to log diagnostic information to the screen during verbose boots, and to a log file found at /var/log/system.log. IOLogv should not be called from interrupt context. + * @param format A printf() style format string (see printf(3) documentation). + * @param ap stdarg(3) style variable arguments. */ + +void IOLogv(const char *format, va_list ap) +__attribute__((format(printf, 1, 0))); + +#ifndef _FN_KPRINTF +#define _FN_KPRINTF +void kprintf(const char *format, ...); +#endif +#ifndef _FN_KPRINTF_DECLARED +#define _FN_KPRINTF_DECLARED +#endif + +/* + * Convert a integer constant (typically a #define or enum) to a string + * via an array of IONamedValue. + */ +const char *IOFindNameForValue(int value, + const IONamedValue *namedValueArray); + +/* + * Convert a string to an int via an array of IONamedValue. Returns + * kIOReturnSuccess of string found, else returns kIOReturnBadArgument. + */ +IOReturn IOFindValueForName(const char *string, + const IONamedValue *regValueArray, + int *value); /* RETURNED */ + +/*! @function Debugger + * @abstract Enter the kernel debugger. + * @discussion This function freezes the kernel and enters the builtin debugger. It may not be possible to exit the debugger without a second machine. + * @param reason A C-string to describe why the debugger is being entered. */ + +void Debugger(const char * reason); +#if __LP64__ +#define IOPanic(reason) panic("%s", reason) +#else +void IOPanic(const char *reason) __attribute__((deprecated)) __abortlike; +#endif + +#ifdef __cplusplus +class OSDictionary; +#endif + +#ifdef __cplusplus +OSDictionary * +#else +struct OSDictionary * +#endif +IOBSDNameMatching( const char * name ); + +#ifdef __cplusplus +OSDictionary * +#else +struct OSDictionary * +#endif +IOOFPathMatching( const char * path, char * buf, int maxLen ) __attribute__((deprecated)); + +/* + * Convert between size and a power-of-two alignment. + */ +IOAlignment IOSizeToAlignment(unsigned int size); +unsigned int IOAlignmentToSize(IOAlignment align); + +/* + * Multiply and divide routines for IOFixed datatype. + */ + +static inline IOFixed +IOFixedMultiply(IOFixed a, IOFixed b) +{ + return (IOFixed)((((SInt64) a) * ((SInt64) b)) >> 16); +} + +static inline IOFixed +IOFixedDivide(IOFixed a, IOFixed b) +{ + return (IOFixed)((((SInt64) a) << 16) / ((SInt64) b)); +} + +/* + * IORound and IOTrunc convenience functions, in the spirit + * of vm's round_page() and trunc_page(). + */ +#define IORound(value, multiple) \ + ((((value) + (multiple) - 1) / (multiple)) * (multiple)) + +#define IOTrunc(value, multiple) \ + (((value) / (multiple)) * (multiple)); + + +#if defined(__APPLE_API_OBSOLETE) + +/* The following API is deprecated */ + +/* The API exported by kern/clock.h + * should be used for high resolution timing. */ + +void IOGetTime( mach_timespec_t * clock_time) __attribute__((deprecated)); + +#if !defined(__LP64__) + +#undef eieio +#define eieio() \ + OSSynchronizeIO() + +extern mach_timespec_t IOZeroTvalspec; + +#endif /* !defined(__LP64__) */ + +#endif /* __APPLE_API_OBSOLETE */ + + +__END_DECLS + +#endif /* !__IOKIT_IOLIB_H */ diff --git a/QualcommWireless/include/IOKit/IOLocks.h b/QualcommWireless/include/IOKit/IOLocks.h new file mode 100644 index 0000000..aa4951e --- /dev/null +++ b/QualcommWireless/include/IOKit/IOLocks.h @@ -0,0 +1,440 @@ +/* + * Copyright (c) 1998-2012 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * + */ + +#ifndef __IOKIT_IOLOCKS_H +#define __IOKIT_IOLOCKS_H + + +#include +#include + +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/*! @var IOLockGroup + * Global lock group used by all IOKit locks. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + */ +extern lck_grp_t *IOLockGroup; + + +/* + * Mutex lock operations + */ + +#ifdef IOLOCKS_INLINE +typedef lck_mtx_t IOLock; +#else +typedef struct _IOLock IOLock; +#endif /* IOLOCKS_INLINE */ + + +/*! @function IOLockAlloc + * @abstract Allocates and initializes a mutex. + * @discussion Allocates a mutex in general purpose memory, and initializes it. Mutexes are general purpose blocking mutual exclusion locks, supplied by libkern/locks.h. This function may block and so should not be called from interrupt level or while a spin lock is held. IOLocks use the global IOKit lock group, IOLockGroup. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + * @result Pointer to the allocated lock, or zero on failure. */ + +IOLock * IOLockAlloc( void ); + +/*! @function IOLockFree + * @abstract Frees a mutex. + * @discussion Frees a lock allocated with IOLockAlloc. Mutex should be unlocked with no waiters. + * @param lock Pointer to the allocated lock. */ + +void IOLockFree( IOLock * lock); + +/*! @function IOLockGetMachLock + * @abstract Accessor to a Mach mutex. + * @discussion Accessor to the Mach mutex. + * @param lock Pointer to the allocated lock. */ + +lck_mtx_t * IOLockGetMachLock( IOLock * lock); + +/*! @function IOLockLock + * @abstract Lock a mutex. + * @discussion Lock the mutex. If the lock is held by any thread, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. Locking the mutex recursively from one thread will result in deadlock. + * @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IOLockLock(l) lck_mtx_lock(l) +#else +void IOLockLock( IOLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IOLockTryLock + * @abstract Attempt to lock a mutex. + * @discussion Lock the mutex if it is currently unlocked, and return true. If the lock is held by any thread, return false. + * @param lock Pointer to the allocated lock. + * @result True if the mutex was unlocked and is now locked by the caller, otherwise false. */ + +#ifdef IOLOCKS_INLINE +#define IOLockTryLock(l) lck_mtx_try_lock(l) +#else +boolean_t IOLockTryLock( IOLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IOLockUnlock + * @abstract Unlock a mutex. + * @discussion Unlock the mutex and wake any blocked waiters. Results are undefined if the caller has not locked the mutex. This function may block and so should not be called from interrupt level or while a spin lock is held. + * @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IOLockUnlock(l) lck_mtx_unlock(l) +#else +void IOLockUnlock( IOLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IOLockSleep + * @abstract Sleep with mutex unlock and relock + * @discussion Prepare to sleep,unlock the mutex, and re-acquire it on wakeup. Results are undefined if the caller has not locked the mutex. This function may block and so should not be called from interrupt level or while a spin lock is held. + * @param lock Pointer to the locked lock. + * @param event The event to sleep on. Must be non-NULL. + * @param interType How can the sleep be interrupted. + * @result The wait-result value indicating how the thread was awakened.*/ +int IOLockSleep( IOLock * lock, void *event, UInt32 interType) __DARWIN14_ALIAS(IOLockSleep); + +int IOLockSleepDeadline( IOLock * lock, void *event, + AbsoluteTime deadline, UInt32 interType) __DARWIN14_ALIAS(IOLockSleepDeadline); + +void IOLockWakeup(IOLock * lock, void *event, bool oneThread) __DARWIN14_ALIAS(IOLockWakeup); + + +#ifdef __APPLE_API_OBSOLETE + +/* The following API is deprecated */ + +typedef enum { + kIOLockStateUnlocked = 0, + kIOLockStateLocked = 1 +} IOLockState; + +void IOLockInitWithState( IOLock * lock, IOLockState state); +#define IOLockInit( l ) IOLockInitWithState( l, kIOLockStateUnlocked); + +static __inline__ void +IOTakeLock( IOLock * lock) +{ + IOLockLock(lock); +} +static __inline__ boolean_t +IOTryLock( IOLock * lock) +{ + return IOLockTryLock(lock); +} +static __inline__ void +IOUnlock( IOLock * lock) +{ + IOLockUnlock(lock); +} + +#endif /* __APPLE_API_OBSOLETE */ + +/* + * Recursive lock operations + */ + +typedef struct _IORecursiveLock IORecursiveLock; + +/*! @function IORecursiveLockAlloc + * @abstract Allocates and initializes an recursive lock. + * @discussion Allocates a recursive lock in general purpose memory, and initializes it. Recursive locks function identically to mutexes but allow one thread to lock more than once, with balanced unlocks. IORecursiveLocks use the global IOKit lock group, IOLockGroup. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + * @result Pointer to the allocated lock, or zero on failure. */ + +IORecursiveLock * IORecursiveLockAlloc( void ); + +/*! @function IORecursiveLockFree + * @abstract Frees a recursive lock. + * @discussion Frees a lock allocated with IORecursiveLockAlloc. Lock should be unlocked with no waiters. + * @param lock Pointer to the allocated lock. */ + +void IORecursiveLockFree( IORecursiveLock * lock); + +/*! @function IORecursiveLockGetMachLock + * @abstract Accessor to a Mach mutex. + * @discussion Accessor to the Mach mutex. + * @param lock Pointer to the allocated lock. */ + +lck_mtx_t * IORecursiveLockGetMachLock( IORecursiveLock * lock); + +/*! @function IORecursiveLockLock + * @abstract Lock a recursive lock. + * @discussion Lock the recursive lock. If the lock is held by another thread, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. The lock may be taken recursively by the same thread, with a balanced number of calls to IORecursiveLockUnlock. + * @param lock Pointer to the allocated lock. */ + +void IORecursiveLockLock( IORecursiveLock * lock); + +/*! @function IORecursiveLockTryLock + * @abstract Attempt to lock a recursive lock. + * @discussion Lock the lock if it is currently unlocked, or held by the calling thread, and return true. If the lock is held by another thread, return false. Successful calls to IORecursiveLockTryLock should be balanced with calls to IORecursiveLockUnlock. + * @param lock Pointer to the allocated lock. + * @result True if the lock is now locked by the caller, otherwise false. */ + +boolean_t IORecursiveLockTryLock( IORecursiveLock * lock); + +/*! @function IORecursiveLockUnlock + * @abstract Unlock a recursive lock. + * @discussion Undo one call to IORecursiveLockLock, if the lock is now unlocked wake any blocked waiters. Results are undefined if the caller does not balance calls to IORecursiveLockLock with IORecursiveLockUnlock. This function may block and so should not be called from interrupt level or while a spin lock is held. + * @param lock Pointer to the allocated lock. */ + +void IORecursiveLockUnlock( IORecursiveLock * lock); + +/*! @function IORecursiveLockHaveLock + * @abstract Check if a recursive lock is held by the calling thread. + * @discussion If the lock is held by the calling thread, return true, otherwise the lock is unlocked, or held by another thread and false is returned. + * @param lock Pointer to the allocated lock. + * @result True if the calling thread holds the lock otherwise false. */ + +boolean_t IORecursiveLockHaveLock( const IORecursiveLock * lock); + +extern int IORecursiveLockSleep( IORecursiveLock *_lock, + void *event, UInt32 interType); +extern int IORecursiveLockSleepDeadline( IORecursiveLock * _lock, void *event, + AbsoluteTime deadline, UInt32 interType); +extern void IORecursiveLockWakeup( IORecursiveLock *_lock, + void *event, bool oneThread); + +/* + * Complex (read/write) lock operations + */ + +#ifdef IOLOCKS_INLINE +typedef lck_rw_t IORWLock; +#else +typedef struct _IORWLock IORWLock; +#endif /* IOLOCKS_INLINE */ + +/*! @function IORWLockAlloc + * @abstract Allocates and initializes a read/write lock. + * @discussion Allocates and initializes a read/write lock in general purpose memory. Read/write locks provide for multiple readers, one exclusive writer, and are supplied by libkern/locks.h. This function may block and so should not be called from interrupt level or while a spin lock is held. IORWLocks use the global IOKit lock group, IOLockGroup. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + * @result Pointer to the allocated lock, or zero on failure. */ + +IORWLock * IORWLockAlloc( void ); + +/*! @function IORWLockFree + * @abstract Frees a read/write lock. + * @discussion Frees a lock allocated with IORWLockAlloc. Lock should be unlocked with no waiters. + * @param lock Pointer to the allocated lock. */ + +void IORWLockFree( IORWLock * lock); + +/*! @function IORWLockGetMachLock + * @abstract Accessor to a Mach read/write lock. + * @discussion Accessor to the Mach read/write lock. + * @param lock Pointer to the allocated lock. */ + +lck_rw_t * IORWLockGetMachLock( IORWLock * lock); + +/*! @function IORWLockRead + * @abstract Lock a read/write lock for read. + * @discussion Lock the lock for read, allowing multiple readers when there are no writers. If the lock is held for write, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. Locking the lock recursively from one thread, for read or write, can result in deadlock. + * @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IORWLockRead(l) lck_rw_lock_shared(l) +#else +void IORWLockRead(IORWLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IORWLockWrite + * @abstract Lock a read/write lock for write. + * @discussion Lock the lock for write, allowing one writer exlusive access. If the lock is held for read or write, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. Locking the lock recursively from one thread, for read or write, can result in deadlock. + * @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IORWLockWrite(l) lck_rw_lock_exclusive(l) +#else +void IORWLockWrite( IORWLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IORWLockUnlock + * @abstract Unlock a read/write lock. + * @discussion Undo one call to IORWLockRead or IORWLockWrite. Results are undefined if the caller has not locked the lock. This function may block and so should not be called from interrupt level or while a spin lock is held. + * @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IORWLockUnlock(l) lck_rw_done(l) +#else +void IORWLockUnlock( IORWLock * lock); +#endif /* !IOLOCKS_INLINE */ + + +#ifdef __APPLE_API_OBSOLETE + +/* The following API is deprecated */ + +static __inline__ void +IOReadLock( IORWLock * lock) +{ + IORWLockRead(lock); +} +static __inline__ void +IOWriteLock( IORWLock * lock) +{ + IORWLockWrite(lock); +} +static __inline__ void +IORWUnlock( IORWLock * lock) +{ + IORWLockUnlock(lock); +} + +#endif /* __APPLE_API_OBSOLETE */ + + +/* + * Simple locks. Cannot block while holding a simple lock. + */ + +#ifdef IOLOCKS_INLINE +typedef lck_spin_t IOSimpleLock; +#else +typedef struct _IOSimpleLock IOSimpleLock; +#endif /* IOLOCKS_INLINE */ + +/*! @function IOSimpleLockAlloc + * @abstract Allocates and initializes a spin lock. + * @discussion Allocates and initializes a spin lock in general purpose memory. Spin locks provide non-blocking mutual exclusion for synchronization between thread context and interrupt context, or for multiprocessor synchronization, and are supplied by libkern/locks.h. This function may block and so should not be called from interrupt level or while a spin lock is held. IOSimpleLocks use the global IOKit lock group, IOLockGroup. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + * @result Pointer to the allocated lock, or zero on failure. */ + +IOSimpleLock * IOSimpleLockAlloc( void ); + +/*! @function IOSimpleLockFree + * @abstract Frees a spin lock. + * @discussion Frees a lock allocated with IOSimpleLockAlloc. + * @param lock Pointer to the lock. */ + +void IOSimpleLockFree( IOSimpleLock * lock ); + +/*! @function IOSimpleLockGetMachLock + * @abstract Accessor to a Mach spin lock. + * @discussion Accessor to the Mach spin lock. + * @param lock Pointer to the allocated lock. */ + +lck_spin_t * IOSimpleLockGetMachLock( IOSimpleLock * lock); + +/*! @function IOSimpleLockInit + * @abstract Initialize a spin lock. + * @discussion Initialize a non heap allocated spin lock to the unlocked state. Use this function when your lock is, for example, a member variable. You will need to call IOSimpleLockDestroy when you are finished with the lock to avoid lock group refcount leaks. + * @param lock Pointer to the lock. */ + +void IOSimpleLockInit( IOSimpleLock * lock ); + +/*! @function IOSimpleLockDestroy + * @abstract De-initializes (destroys) a spin lock initialized with IOSimpleLockInit + * @discussion Destroy / De-initialize a non heap allocated spin lock, releasing any system resources such as lock group refcounts. + * @param lock Pointer to the lock. */ + +void IOSimpleLockDestroy( IOSimpleLock * lock ); + +/*! @function IOSimpleLockLock + * @abstract Lock a spin lock. + * @discussion Lock the spin lock. If the lock is held, spin waiting for its unlock. Spin locks disable preemption, cannot be held across any blocking operation, and should be held for very short periods. When used to synchronize between interrupt context and thread context they should be locked with interrupts disabled - IOSimpleLockLockDisableInterrupt() will do both. Locking the lock recursively from one thread will result in deadlock. + * @param lock Pointer to the lock. */ + +#ifdef IOLOCKS_INLINE +#define IOSimpleLockLock(l) lck_spin_lock(l) +#else +void IOSimpleLockLock( IOSimpleLock * lock ); +#endif /* !IOLOCKS_INLINE */ + + +/*! @function IOSimpleLockTryLock + * @abstract Attempt to lock a spin lock. + * @discussion Lock the spin lock if it is currently unlocked, and return true. If the lock is held, return false. Successful calls to IOSimpleLockTryLock should be balanced with calls to IOSimpleLockUnlock. + * @param lock Pointer to the lock. + * @result True if the lock was unlocked and is now locked by the caller, otherwise false. */ + +#ifdef IOLOCKS_INLINE +#define IOSimpleLockTryLock(l) lck_spin_try_lock(l) +#else +boolean_t IOSimpleLockTryLock( IOSimpleLock * lock ); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IOSimpleLockUnlock + * @abstract Unlock a spin lock. + * @discussion Unlock the lock, and restore preemption. Results are undefined if the caller has not locked the lock. + * @param lock Pointer to the lock. */ + +#ifdef IOLOCKS_INLINE +#define IOSimpleLockUnlock(l) lck_spin_unlock(l) +#else +void IOSimpleLockUnlock( IOSimpleLock * lock ); +#endif /* !IOLOCKS_INLINE */ + + +#if __LP64__ +typedef boolean_t IOInterruptState; +#else +typedef long int IOInterruptState; +#endif + +/*! @function IOSimpleLockLockDisableInterrupt + * @abstract Lock a spin lock. + * @discussion Lock the spin lock. If the lock is held, spin waiting for its unlock. Simple locks disable preemption, cannot be held across any blocking operation, and should be held for very short periods. When used to synchronize between interrupt context and thread context they should be locked with interrupts disabled - IOSimpleLockLockDisableInterrupt() will do both. Locking the lock recursively from one thread will result in deadlock. + * @param lock Pointer to the lock. */ + +static __inline__ +IOInterruptState +IOSimpleLockLockDisableInterrupt( IOSimpleLock * lock ) +{ + IOInterruptState state = ml_set_interrupts_enabled( false ); + IOSimpleLockLock( lock ); + return state; +} + +/*! @function IOSimpleLockUnlockEnableInterrupt + * @abstract Unlock a spin lock, and restore interrupt state. + * @discussion Unlock the lock, and restore preemption and interrupts to the state as they were when the lock was taken. Results are undefined if the caller has not locked the lock. + * @param lock Pointer to the lock. + * @param state The interrupt state returned by IOSimpleLockLockDisableInterrupt() */ + +static __inline__ +void +IOSimpleLockUnlockEnableInterrupt( IOSimpleLock * lock, + IOInterruptState state ) +{ + IOSimpleLockUnlock( lock ); + ml_set_interrupts_enabled( state ); +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !__IOKIT_IOLOCKS_H */ diff --git a/QualcommWireless/include/IOKit/IOMapper.h b/QualcommWireless/include/IOKit/IOMapper.h new file mode 100644 index 0000000..c44c0a6 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOMapper.h @@ -0,0 +1,148 @@ +/* + * Copyright (c) 1998-2016 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IOMAPPER_H +#define __IOKIT_IOMAPPER_H + +#include + +__BEGIN_DECLS +#include +#include + +// These are C accessors to the system mapper for non-IOKit clients +ppnum_t IOMapperIOVMAlloc(unsigned pages); +void IOMapperIOVMFree(ppnum_t addr, unsigned pages); +ppnum_t IOMapperInsertPage(ppnum_t addr, unsigned offset, ppnum_t page); + +__END_DECLS + +#if __cplusplus + +#include +#include +#include + +class OSData; + +extern const OSSymbol * gIOMapperIDKey; + +class IOMapper : public IOService +{ + OSDeclareAbstractStructors(IOMapper); + +// Give the platform expert access to setMapperRequired(); + friend class IOPlatformExpert; + friend class IOMemoryDescriptor; + friend class IOGeneralMemoryDescriptor; + +private: + enum SystemMapperState { + kNoMapper = 0, + kUnknown = 1, + kHasMapper = 2, // Any other value is pointer to a live mapper + kWaitMask = 3, + }; +protected: + uint64_t __reserved[8]; + bool fIsSystem; + + static void setMapperRequired(bool hasMapper); + static void waitForSystemMapper(); + + virtual bool initHardware(IOService *provider) = 0; + +public: + virtual bool start(IOService *provider) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + +// To get access to the system mapper IOMapper::gSystem + static IOMapper *gSystem; + + static void + checkForSystemMapper() + { + if ((uintptr_t) gSystem & kWaitMask) { + waitForSystemMapper(); + } + } + + static IOMapper * copyMapperForDevice(IOService * device); + static IOMapper * copyMapperForDeviceWithIndex(IOService * device, unsigned int index); + +// { subclasses + + virtual uint64_t getPageSize(void) const = 0; + + virtual IOReturn iovmMapMemory(IOMemoryDescriptor * memory, + uint64_t descriptorOffset, + uint64_t length, + uint32_t mapOptions, + const IODMAMapSpecification * mapSpecification, + IODMACommand * dmaCommand, + const IODMAMapPageList * pageList, + uint64_t * mapAddress, + uint64_t * mapLength) = 0; + + virtual IOReturn iovmUnmapMemory(IOMemoryDescriptor * memory, + IODMACommand * dmaCommand, + uint64_t mapAddress, + uint64_t mapLength) = 0; + + virtual IOReturn iovmInsert(uint32_t options, + uint64_t mapAddress, + uint64_t offset, + uint64_t physicalAddress, + uint64_t length) = 0; + + virtual uint64_t mapToPhysicalAddress(uint64_t mappedAddress) = 0; + +// } + +private: + OSMetaClassDeclareReservedUnused(IOMapper, 0); + OSMetaClassDeclareReservedUnused(IOMapper, 1); + OSMetaClassDeclareReservedUnused(IOMapper, 2); + OSMetaClassDeclareReservedUnused(IOMapper, 3); + OSMetaClassDeclareReservedUnused(IOMapper, 4); + OSMetaClassDeclareReservedUnused(IOMapper, 5); + OSMetaClassDeclareReservedUnused(IOMapper, 6); + OSMetaClassDeclareReservedUnused(IOMapper, 7); + OSMetaClassDeclareReservedUnused(IOMapper, 8); + OSMetaClassDeclareReservedUnused(IOMapper, 9); + OSMetaClassDeclareReservedUnused(IOMapper, 10); + OSMetaClassDeclareReservedUnused(IOMapper, 11); + OSMetaClassDeclareReservedUnused(IOMapper, 12); + OSMetaClassDeclareReservedUnused(IOMapper, 13); + OSMetaClassDeclareReservedUnused(IOMapper, 14); + OSMetaClassDeclareReservedUnused(IOMapper, 15); +}; + +#endif /* __cplusplus */ + +#endif /* !__IOKIT_IOMAPPER_H */ diff --git a/QualcommWireless/include/IOKit/IOMemoryCursor.h b/QualcommWireless/include/IOKit/IOMemoryCursor.h new file mode 100644 index 0000000..3b81e6d --- /dev/null +++ b/QualcommWireless/include/IOKit/IOMemoryCursor.h @@ -0,0 +1,383 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOMEMORYCURSOR_H +#define _IOMEMORYCURSOR_H + +#include +#include + +class IOMemoryDescriptor; + +/**************************** class IOMemoryCursor ***************************/ + +/*! + * @class IOMemoryCursor + * @abstract A mechanism to convert memory references to physical addresses. + * @discussion The IOMemoryCursor declares the super class that all + * specific memory cursors must inherit from, but a memory cursor can be created without a specific format subclass by just providing a segment function to the initializers. This class does the difficult stuff of dividing a memory descriptor into a physical scatter/gather list appropriate for the target hardware. + *

+ * A driver is expected to create a memory cursor and configure it to the limitations of its DMA hardware; for instance the memory cursor used by the FireWire SBP-2 protocol has a maximum physical segment size of 2^16 - 1 but the actual transfer size is unlimited. Thus it would create a cursor with a maxSegmentSize of 65535 and a maxTransfer size of UINT_MAX. It would also provide a SegmentFunction that can output a pagelist entry. + *

+ * Below is the simplest example of a SegmentFunction:
+ * void IONaturalMemoryCursor::outputSegment(PhysicalSegment segment,
+ * void * outSegments,
+ * UInt32 outSegmentIndex)
+ * {
+ * ((PhysicalSegment *) outSegments)[outSegmentIndex] = segment;
+ * } + * + */ +class IOMemoryCursor : public OSObject +{ + OSDeclareDefaultStructors(IOMemoryCursor); + +public: +/*! + * @typedef PhysicalSegment + * @discussion A physical address/length pair. + */ + struct PhysicalSegment { + IOPhysicalAddress location; + IOPhysicalLength length; + }; + +/*! @defined IOPhysicalSegment + * @discussion Backward compatibility define for the old non-class scoped type definition. See IOMemoryCursor::PhysicalSegment + */ +#define IOPhysicalSegment IOMemoryCursor::PhysicalSegment + +/*! + * @typedef SegmentFunction + * @discussion Pointer to a C function that outputs a single physical segment to an element in the array as defined by the segments and segmentIndex parameters. + * @param segment The physical address and length that is next to be output. + * @param segments Base of the output vector of DMA address length pairs. + * @param segmentIndex Index to output 'segment' in the 'segments' array. + */ + typedef void (*SegmentFunction)(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined OutputSegmentFunc + * @discussion Backward compatibility define for the old non-class scoped type definition. See IOMemoryCursor::SegmentFunction */ +#define OutputSegmentFunc IOMemoryCursor::SegmentFunction + +protected: +/*! @var outSeg The action method called when an event has been delivered */ + SegmentFunction outSeg; + +/*! @var maxSegmentSize Maximum size of one segment in a scatter/gather list */ + IOPhysicalLength maxSegmentSize; + +/*! @var maxTransferSize + * Maximum size of a transfer that this memory cursor is allowed to generate */ + IOPhysicalLength maxTransferSize; + +/*! @var alignMask + * Currently unused. Reserved for automated aligment restriction code. */ + IOPhysicalLength alignMask; + +public: +/*! @function withSpecification + * @abstract Creates and initializes an IOMemoryCursor in one operation. + * @discussion Factory function to create and initialize an IOMemoryCursor in one operation. For more information, see IOMemoryCursor::initWithSpecification. + * @param outSegFunc SegmentFunction to call to output one physical segment. + * @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + * @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + * @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + * @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. + */ + static IOMemoryCursor * + withSpecification(SegmentFunction outSegFunc, + IOPhysicalLength maxSegmentSize = 0, + IOPhysicalLength maxTransferSize = 0, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + * @abstract Primary initializer for the IOMemoryCursor class. + * @param outSegFunc SegmentFunction to call to output one physical segment. + * @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + * @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + * @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + * @result Returns true if the inherited classes and this instance initialize + * successfully. + */ + virtual bool initWithSpecification(SegmentFunction outSegFunc, + IOPhysicalLength maxSegmentSize = 0, + IOPhysicalLength maxTransferSize = 0, + IOPhysicalLength alignment = 1); + +/*! @function genPhysicalSegments + * @abstract Generates a physical scatter/gather list given a memory descriptor. + * @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. + * @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + * @param fromPosition Starting location of the I/O within a memory descriptor. + * @param segments Void pointer to base of output physical scatter/gather list. Always passed directly onto the SegmentFunction without interpretation by the cursor. + * @param maxSegments Maximum number of segments that can be written to segments array. + * @param maxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + * @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + * @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. + */ + virtual UInt32 genPhysicalSegments( + IOMemoryDescriptor *descriptor, + IOByteCount fromPosition, + void * segments, + UInt32 maxSegments, + UInt32 maxTransferSize = 0, + IOByteCount *transferSize = NULL); +}; + +/************************ class IONaturalMemoryCursor ************************/ + + +/*! + * @class IONaturalMemoryCursor + * @abstract An IOMemoryCursor subclass that outputs a vector of PhysicalSegments in the natural byte orientation for the CPU. + * @discussion The IONaturalMemoryCursor would be used when it is too difficult to safely describe a SegmentFunction that is more appropriate for your hardware. This cursor just outputs an array of PhysicalSegments. + */ +class IONaturalMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IONaturalMemoryCursor); + +public: +/*! @function outputSegment + * @abstract Outputs the given segment into the output segments array in natural byte order. + * @param segment The physical address and length that is next to be output. + * @param segments Base of the output vector of DMA address length pairs. + * @param segmentIndex Index to output 'segment' in the 'segments' array. + */ + static void outputSegment(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined naturalOutputSegment + * @discussion Backward compatibility define for the old global function definition. See IONaturalMemoryCursor::outputSegment. + */ +#define naturalOutputSegment IONaturalMemoryCursor::outputSegment + +/*! @function withSpecification + * @abstract Creates and initializes an IONaturalMemoryCursor in one operation. + * @discussion Factory function to create and initialize an IONaturalMemoryCursor in one operation. For more information, see IONaturalMemoryCursor::initWithSpecification. + * @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + * @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + * @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + * @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. + */ + static IONaturalMemoryCursor * + withSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + * @abstract Primary initializer for the IONaturalMemoryCursor class. + * @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + * @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + * @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + * @result Returns true if the inherited classes and this instance initialize successfully. + */ + virtual bool initWithSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + + +/*! @function getPhysicalSegments + * @abstract Generates a CPU natural physical scatter/gather list given a memory descriptor. + * @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. Wraps IOMemoryCursor::genPhysicalSegments. + * @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + * @param fromPosition Starting location of the I/O within a memory descriptor. + * @param segments Pointer to an array of IOMemoryCursor::PhysicalSegments for the output physical scatter/gather list. + * @param maxSegments Maximum number of segments that can be written to segments array. + * @param inMaxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + * @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + * @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. + */ + virtual UInt32 + getPhysicalSegments(IOMemoryDescriptor *descriptor, + IOByteCount fromPosition, + PhysicalSegment *segments, + UInt32 maxSegments, + UInt32 inMaxTransferSize = 0, + IOByteCount *transferSize = NULL) + { + return genPhysicalSegments(descriptor, fromPosition, segments, + maxSegments, inMaxTransferSize, transferSize); + } +}; + +/************************** class IOBigMemoryCursor **************************/ + +/*! + * @class IOBigMemoryCursor + * @abstract An IOMemoryCursor subclass that outputs a vector of PhysicalSegments in the big endian byte order. + * @discussion The IOBigMemoryCursor would be used when the DMA hardware requires a big endian address and length pair. This cursor outputs an array of PhysicalSegments that are encoded in big-endian format. + */ +class IOBigMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IOBigMemoryCursor); + +public: +/*! @function outputSegment + * @abstract Outputs the given segment into the output segments array in big endian byte order. + * @param segment The physical address and length that is next to be output. + * @param segments Base of the output vector of DMA address length pairs. + * @param segmentIndex Index to output 'segment' in the 'segments' array. + */ + static void outputSegment(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined bigOutputSegment + * @discussion Backward compatibility define for the old global function definition. See IOBigMemoryCursor::outputSegment + */ +#define bigOutputSegment IOBigMemoryCursor::outputSegment + +/*! @function withSpecification + * @abstract Creates and initializes an IOBigMemoryCursor in one operation. + * @discussion Factory function to create and initialize an IOBigMemoryCursor in one operation. See also IOBigMemoryCursor::initWithSpecification. + * @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + * @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + * @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + * @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. + */ + static IOBigMemoryCursor * + withSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + * @abstract Primary initializer for the IOBigMemoryCursor class. + * @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + * @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + * @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + * @result Returns true if the inherited classes and this instance initialize + * successfully. + */ + virtual bool initWithSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + + +/*! @function getPhysicalSegments + * @abstract Generates a big endian physical scatter/gather list given a memory descriptor. + * @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. Wraps IOMemoryCursor::genPhysicalSegments. + * @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + * @param fromPosition Starting location of the I/O within a memory descriptor. + * @param segments Pointer to an array of IOMemoryCursor::PhysicalSegments for the output physical scatter/gather list. + * @param maxSegments Maximum number of segments that can be written to segments array. + * @param inMaxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + * @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + * @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. + */ + virtual UInt32 + getPhysicalSegments(IOMemoryDescriptor * descriptor, + IOByteCount fromPosition, + PhysicalSegment * segments, + UInt32 maxSegments, + UInt32 inMaxTransferSize = 0, + IOByteCount * transferSize = NULL) + { + return genPhysicalSegments(descriptor, fromPosition, segments, + maxSegments, inMaxTransferSize, transferSize); + } +}; + +/************************* class IOLittleMemoryCursor ************************/ + +/*! + * @class IOLittleMemoryCursor + * @abstract An IOMemoryCursor subclass that outputs a vector of PhysicalSegments in the little endian byte order. + * @discussion The IOLittleMemoryCursor would be used when the DMA hardware requires a little endian address and length pair. This cursor outputs an array of PhysicalSegments that are encoded in little endian format. + */ +class IOLittleMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IOLittleMemoryCursor); + +public: +/*! @function outputSegment + * @abstract Outputs the given segment into the output segments array in little endian byte order. + * @param segment The physical address and length that is next to be output. + * @param segments Base of the output vector of DMA address length pairs. + * @param segmentIndex Index to output 'segment' in the 'segments' array. + */ + static void outputSegment(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined littleOutputSegment + * @discussion Backward compatibility define for the old global function definition. See also IOLittleMemoryCursor::outputSegment. */ +#define littleOutputSegment IOLittleMemoryCursor::outputSegment + +/*! @function withSpecification + * @abstract Creates and initializes an IOLittleMemoryCursor in one operation. + * @discussion Factory function to create and initialize an IOLittleMemoryCursor in one operation. See also IOLittleMemoryCursor::initWithSpecification. + * @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + * @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + * @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + * @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. + */ + static IOLittleMemoryCursor * + withSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + * @abstract Primary initializer for the IOLittleMemoryCursor class. + * @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + * @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + * @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + * @result Returns true if the inherited classes and this instance initialize successfully. + */ + virtual bool initWithSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + + +/*! @function getPhysicalSegments + * @abstract Generates a little endian physical scatter/gather list given a memory descriptor. + * @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. Wraps IOMemoryCursor::genPhysicalSegments. + * @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + * @param fromPosition Starting location of the I/O within a memory descriptor. + * @param segments Pointer to an array of IOMemoryCursor::PhysicalSegments for the output physical scatter/gather list. + * @param maxSegments Maximum number of segments that can be written to segments array. + * @param inMaxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + * @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + * @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. + */ + virtual UInt32 + getPhysicalSegments(IOMemoryDescriptor * descriptor, + IOByteCount fromPosition, + PhysicalSegment * segments, + UInt32 maxSegments, + UInt32 inMaxTransferSize = 0, + IOByteCount * transferSize = NULL) + { + return genPhysicalSegments(descriptor, fromPosition, segments, + maxSegments, inMaxTransferSize, transferSize); + } +}; + +#endif /* !_IOMEMORYCURSOR_H */ diff --git a/QualcommWireless/include/IOKit/IOMemoryDescriptor.h b/QualcommWireless/include/IOKit/IOMemoryDescriptor.h new file mode 100644 index 0000000..8f92bd2 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOMemoryDescriptor.h @@ -0,0 +1,1036 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOMEMORYDESCRIPTOR_H +#define _IOMEMORYDESCRIPTOR_H + +#include + +#include +#include +#include +#include +#include + +#include + +class IOMemoryMap; +class IOMapper; +class IOService; +class IODMACommand; + +/* + * Direction of transfer, with respect to the described memory. + */ +#ifdef __LP64__ +enum +#else /* !__LP64__ */ +enum IODirection +#endif /* !__LP64__ */ +{ + kIODirectionNone = 0x0,// same as VM_PROT_NONE + kIODirectionIn = 0x1,// User land 'read', same as VM_PROT_READ + kIODirectionOut = 0x2,// User land 'write', same as VM_PROT_WRITE + kIODirectionOutIn = kIODirectionOut | kIODirectionIn, + kIODirectionInOut = kIODirectionIn | kIODirectionOut, + + // these flags are valid for the prepare() method only + kIODirectionPrepareToPhys32 = 0x00000004, + kIODirectionPrepareNoFault = 0x00000008, + kIODirectionPrepareReserved1 = 0x00000010, +#define IODIRECTIONPREPARENONCOHERENTDEFINED 1 + kIODirectionPrepareNonCoherent = 0x00000020, + + // these flags are valid for the complete() method only +#define IODIRECTIONCOMPLETEWITHERRORDEFINED 1 + kIODirectionCompleteWithError = 0x00000040, +#define IODIRECTIONCOMPLETEWITHDATAVALIDDEFINED 1 + kIODirectionCompleteWithDataValid = 0x00000080, +}; + +#ifdef __LP64__ +typedef IOOptionBits IODirection; +#endif /* __LP64__ */ + +/* + * IOOptionBits used in the withOptions variant + */ +enum { + kIOMemoryDirectionMask = 0x00000007, + + kIOMemoryTypeVirtual = 0x00000010, + kIOMemoryTypePhysical = 0x00000020, + kIOMemoryTypeUPL = 0x00000030, + kIOMemoryTypePersistentMD = 0x00000040,// Persistent Memory Descriptor + kIOMemoryTypeUIO = 0x00000050, +#ifdef __LP64__ + kIOMemoryTypeVirtual64 = kIOMemoryTypeVirtual, + kIOMemoryTypePhysical64 = kIOMemoryTypePhysical, +#else /* !__LP64__ */ + kIOMemoryTypeVirtual64 = 0x00000060, + kIOMemoryTypePhysical64 = 0x00000070, +#endif /* !__LP64__ */ + kIOMemoryTypeMask = 0x000000f0, + + kIOMemoryAsReference = 0x00000100, + kIOMemoryBufferPageable = 0x00000400, + kIOMemoryMapperNone = 0x00000800,// Shared with Buffer MD + kIOMemoryHostOnly = 0x00001000,// Never DMA accessible + kIOMemoryPersistent = 0x00010000, + kIOMemoryMapCopyOnWrite = 0x00020000, + kIOMemoryRemote = 0x00040000, + kIOMemoryThreadSafe = 0x00100000,// Shared with Buffer MD + kIOMemoryClearEncrypt = 0x00200000,// Shared with Buffer MD + kIOMemoryUseReserve = 0x00800000,// Shared with Buffer MD +#define IOMEMORYUSERESERVEDEFINED 1 + +}; + +#define kIOMapperSystem ((IOMapper *) NULL) + +enum{ + kIOMemoryLedgerTagDefault = VM_LEDGER_TAG_DEFAULT, + kIOmemoryLedgerTagNetwork = VM_LEDGER_TAG_NETWORK, + kIOMemoryLedgerTagMedia = VM_LEDGER_TAG_MEDIA, + kIOMemoryLedgerTagGraphics = VM_LEDGER_TAG_GRAPHICS, + kIOMemoryLedgerTagNeural = VM_LEDGER_TAG_NEURAL, +}; +enum{ + kIOMemoryLedgerFlagNoFootprint = VM_LEDGER_FLAG_NO_FOOTPRINT, +}; + +enum{ + kIOMemoryPurgeableKeepCurrent = 1, + + kIOMemoryPurgeableNonVolatile = 2, + kIOMemoryPurgeableVolatile = 3, + kIOMemoryPurgeableEmpty = 4, + + // modifiers for kIOMemoryPurgeableVolatile behavior + kIOMemoryPurgeableVolatileGroup0 = VM_VOLATILE_GROUP_0, + kIOMemoryPurgeableVolatileGroup1 = VM_VOLATILE_GROUP_1, + kIOMemoryPurgeableVolatileGroup2 = VM_VOLATILE_GROUP_2, + kIOMemoryPurgeableVolatileGroup3 = VM_VOLATILE_GROUP_3, + kIOMemoryPurgeableVolatileGroup4 = VM_VOLATILE_GROUP_4, + kIOMemoryPurgeableVolatileGroup5 = VM_VOLATILE_GROUP_5, + kIOMemoryPurgeableVolatileGroup6 = VM_VOLATILE_GROUP_6, + kIOMemoryPurgeableVolatileGroup7 = VM_VOLATILE_GROUP_7, + kIOMemoryPurgeableVolatileBehaviorFifo = VM_PURGABLE_BEHAVIOR_FIFO, + kIOMemoryPurgeableVolatileBehaviorLifo = VM_PURGABLE_BEHAVIOR_LIFO, + kIOMemoryPurgeableVolatileOrderingObsolete = VM_PURGABLE_ORDERING_OBSOLETE, + kIOMemoryPurgeableVolatileOrderingNormal = VM_PURGABLE_ORDERING_NORMAL, + kIOMemoryPurgeableFaultOnAccess = VM_PURGABLE_DEBUG_FAULT, +}; +enum{ + kIOMemoryIncoherentIOFlush = 1, + kIOMemoryIncoherentIOStore = 2, + + kIOMemoryClearEncrypted = 50, + kIOMemorySetEncrypted = 51, +}; + +#define IOMEMORYDESCRIPTOR_SUPPORTS_DMACOMMAND 1 + +struct IODMAMapSpecification { + uint64_t alignment; + IOService * device; + uint32_t options; + uint8_t numAddressBits; + uint8_t resvA[3]; + uint32_t resvB[4]; +}; + +struct IODMAMapPageList { + uint32_t pageOffset; + uint32_t pageListCount; + const upl_page_info_t * pageList; +}; + +// mapOptions for iovmMapMemory +enum{ + kIODMAMapReadAccess = 0x00000001, + kIODMAMapWriteAccess = 0x00000002, + kIODMAMapPhysicallyContiguous = 0x00000010, + kIODMAMapDeviceMemory = 0x00000020, + kIODMAMapPagingPath = 0x00000040, + kIODMAMapIdentityMap = 0x00000080, + + kIODMAMapPageListFullyOccupied = 0x00000100, + kIODMAMapFixedAddress = 0x00000200, +}; + + +enum{ + kIOPreparationIDUnprepared = 0, + kIOPreparationIDUnsupported = 1, + kIOPreparationIDAlwaysPrepared = 2, +}; + + + +/*! @class IOMemoryDescriptor : public OSObject + * @abstract An abstract base class defining common methods for describing physical or virtual memory. + * @discussion The IOMemoryDescriptor object represents a buffer or range of memory, specified as one or more physical or virtual address ranges. It contains methods to return the memory's physically contiguous segments (fragments), for use with the IOMemoryCursor, and methods to map the memory into any address space with caching and placed mapping options. */ + +class IOMemoryDescriptor : public OSObject +{ + friend class IOMemoryMap; + friend class IOMultiMemoryDescriptor; + + OSDeclareDefaultStructorsWithDispatch(IOMemoryDescriptor); + +protected: + +/*! @var reserved + * Reserved for future use. (Internal use only) */ + struct IOMemoryDescriptorReserved * reserved; + +protected: + OSSet * _mappings; + IOOptionBits _flags; + + + void * __iomd_reserved5; + uint16_t __iomd_reserved1[4]; + uintptr_t __iomd_reserved2; + + uintptr_t __iomd_reserved3; + uintptr_t __iomd_reserved4; + +#ifndef __LP64__ + IODirection _direction; /* use _flags instead */ +#endif /* !__LP64__ */ + IOByteCount _length; /* length of all ranges */ + IOOptionBits _tag; + +public: + typedef IOOptionBits DMACommandOps; +#ifndef __LP64__ + virtual IOPhysicalAddress getSourceSegment( IOByteCount offset, + IOByteCount * length ) APPLE_KEXT_DEPRECATED; +#endif /* !__LP64__ */ + +/*! @function initWithOptions + * @abstract Master initialiser for all variants of memory descriptors. For a more complete description see IOMemoryDescriptor::withOptions. + * @discussion Note this function can be used to re-init a previously created memory descriptor. + * @result true on success, false on failure. */ + virtual bool initWithOptions(void * buffers, + UInt32 count, + UInt32 offset, + task_t task, + IOOptionBits options, + IOMapper * mapper = kIOMapperSystem); + +#ifndef __LP64__ + virtual addr64_t getPhysicalSegment64( IOByteCount offset, + IOByteCount * length ) APPLE_KEXT_DEPRECATED; /* use getPhysicalSegment() and kIOMemoryMapperNone instead */ +#endif /* !__LP64__ */ + +/*! @function setPurgeable + * @abstract Control the purgeable status of a memory descriptors memory. + * @discussion Buffers may be allocated with the ability to have their purgeable status changed - IOBufferMemoryDescriptor with the kIOMemoryPurgeable option, VM_FLAGS_PURGEABLE may be passed to vm_allocate() in user space to allocate such buffers. The purgeable status of such a buffer may be controlled with setPurgeable(). The process of making a purgeable memory descriptor non-volatile and determining its previous state is atomic - if a purgeable memory descriptor is made nonvolatile and the old state is returned as kIOMemoryPurgeableVolatile, then the memory's previous contents are completely intact and will remain so until the memory is made volatile again. If the old state is returned as kIOMemoryPurgeableEmpty then the memory was reclaimed while it was in a volatile state and its previous contents have been lost. + * @param newState - the desired new purgeable state of the memory:
+ * kIOMemoryPurgeableKeepCurrent - make no changes to the memory's purgeable state.
+ * kIOMemoryPurgeableVolatile - make the memory volatile - the memory may be reclaimed by the VM system without saving its contents to backing store.
+ * kIOMemoryPurgeableNonVolatile - make the memory nonvolatile - the memory is treated as with usual allocations and must be saved to backing store if paged.
+ * kIOMemoryPurgeableEmpty - make the memory volatile, and discard any pages allocated to it. + * @param oldState - if non-NULL, the previous purgeable state of the memory is returned here:
+ * kIOMemoryPurgeableNonVolatile - the memory was nonvolatile.
+ * kIOMemoryPurgeableVolatile - the memory was volatile but its content has not been discarded by the VM system.
+ * kIOMemoryPurgeableEmpty - the memory was volatile and has been discarded by the VM system.
+ * @result An IOReturn code. */ + + virtual IOReturn setPurgeable( IOOptionBits newState, + IOOptionBits * oldState ); + +/*! @function setOwnership + * @abstract Control the ownership of a memory descriptors memory. + * @discussion IOBufferMemoryDescriptor are owned by a specific task. The ownership of such a buffer may be controlled with setOwnership(). + * @param newOwner - the task to be the new owner of the memory. + * @param newLedgerTag - the ledger this memory should be accounted in. + * @param newLedgerOptions - accounting options + * @result An IOReturn code. */ + + IOReturn setOwnership( task_t newOwner, + int newLedgerTag, + IOOptionBits newLedgerOptions ); + +/*! @function getPageCounts + * @abstract Retrieve the number of resident and/or dirty pages encompassed by an IOMemoryDescriptor. + * @discussion This method returns the number of resident and/or dirty pages encompassed by an IOMemoryDescriptor. + * @param residentPageCount - If non-null, a pointer to a byte count that will return the number of resident pages encompassed by this IOMemoryDescriptor. + * @param dirtyPageCount - If non-null, a pointer to a byte count that will return the number of dirty pages encompassed by this IOMemoryDescriptor. + * @result An IOReturn code. */ + + IOReturn getPageCounts( IOByteCount * residentPageCount, + IOByteCount * dirtyPageCount); + +/*! @function performOperation + * @abstract Perform an operation on the memory descriptor's memory. + * @discussion This method performs some operation on a range of the memory descriptor's memory. When a memory descriptor's memory is not mapped, it should be more efficient to use this method than mapping the memory to perform the operation virtually. + * @param options The operation to perform on the memory:
+ * kIOMemoryIncoherentIOFlush - pass this option to store to memory and flush any data in the processor cache for the memory range, with synchronization to ensure the data has passed through all levels of processor cache. It may not be supported on all architectures. This type of flush may be used for non-coherent I/O such as AGP - it is NOT required for PCI coherent operations. The memory descriptor must have been previously prepared.
+ * kIOMemoryIncoherentIOStore - pass this option to store to memory any data in the processor cache for the memory range, with synchronization to ensure the data has passed through all levels of processor cache. It may not be supported on all architectures. This type of flush may be used for non-coherent I/O such as AGP - it is NOT required for PCI coherent operations. The memory descriptor must have been previously prepared. + * @param offset A byte offset into the memory descriptor's memory. + * @param length The length of the data range. + * @result An IOReturn code. */ + + virtual IOReturn performOperation( IOOptionBits options, + IOByteCount offset, IOByteCount length ); + +// Used for dedicated communications for IODMACommand + virtual IOReturn dmaCommandOperation(DMACommandOps op, void *vData, UInt dataSize) const; + +/*! @function getPhysicalSegment + * @abstract Break a memory descriptor into its physically contiguous segments. + * @discussion This method returns the physical address of the byte at the given offset into the memory, and optionally the length of the physically contiguous segment from that offset. + * @param offset A byte offset into the memory whose physical address to return. + * @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset. + * @result A physical address, or zero if the offset is beyond the length of the memory. */ + +#ifdef __LP64__ + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0 ) = 0; +#else /* !__LP64__ */ + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options ); +#endif /* !__LP64__ */ + + virtual uint64_t getPreparationID( void ); + void setPreparationID( void ); + + void setVMTags(uint32_t kernelTag, uint32_t userTag); + uint32_t getVMTag(vm_map_t map); + + +private: + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 0); +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 1); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 2); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 3); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 4); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 5); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 6); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 7); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 1); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 2); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 3); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 4); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 5); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 6); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 7); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 8); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 9); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 10); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 11); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 12); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 13); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 14); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 15); + +protected: + virtual void free(void) APPLE_KEXT_OVERRIDE; +public: + static void initialize( void ); + +public: +/*! @function withAddress + * @abstract Create an IOMemoryDescriptor to describe one virtual range of the kernel task. + * @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of a single virtual memory range mapped into the kernel map. This memory descriptor needs to be prepared before it can be used to extract data from the memory described. + * @param address The virtual address of the first byte in the memory. + * @param withLength The length of memory. + * @param withDirection An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + * @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor * withAddress(void * address, + IOByteCount withLength, + IODirection withDirection); + +#ifndef __LP64__ + static IOMemoryDescriptor * withAddress(IOVirtualAddress address, + IOByteCount withLength, + IODirection withDirection, + task_t withTask) APPLE_KEXT_DEPRECATED; /* use withAddressRange() and prepare() instead */ +#endif /* !__LP64__ */ + +/*! @function withPhysicalAddress + * @abstract Create an IOMemoryDescriptor to describe one physical range. + * @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of a single physical memory range. + * @param address The physical address of the first byte in the memory. + * @param withLength The length of memory. + * @param withDirection An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + * @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor * withPhysicalAddress( + IOPhysicalAddress address, + IOByteCount withLength, + IODirection withDirection ); + +#ifndef __LP64__ + static IOMemoryDescriptor * withRanges(IOVirtualRange * ranges, + UInt32 withCount, + IODirection withDirection, + task_t withTask, + bool asReference = false) APPLE_KEXT_DEPRECATED; /* use withAddressRanges() instead */ +#endif /* !__LP64__ */ + +/*! @function withAddressRange + * @abstract Create an IOMemoryDescriptor to describe one virtual range of the specified map. + * @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of a single virtual memory range mapped into the specified map. This memory descriptor needs to be prepared before it can be used to extract data from the memory described. + * @param address The virtual address of the first byte in the memory. + * @param length The length of memory. + * @param options + * kIOMemoryDirectionMask (options:direction) This nibble indicates the I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + * @param task The task the virtual ranges are mapped into. Note that unlike IOMemoryDescriptor::withAddress(), kernel_task memory must be explicitly prepared when passed to this api. The task argument may be NULL to specify memory by physical address. + * @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor * withAddressRange( + mach_vm_address_t address, + mach_vm_size_t length, + IOOptionBits options, + task_t task); + +/*! @function withAddressRanges + * @abstract Create an IOMemoryDescriptor to describe one or more virtual ranges. + * @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of an array of virtual memory ranges each mapped into a specified source task. This memory descriptor needs to be prepared before it can be used to extract data from the memory described. + * @param ranges An array of IOAddressRange structures which specify the virtual ranges in the specified map which make up the memory to be described. IOAddressRange is the 64bit version of IOVirtualRange. + * @param rangeCount The member count of the ranges array. + * @param options + * kIOMemoryDirectionMask (options:direction) This nibble indicates the I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + * kIOMemoryAsReference For options:type = Virtual or Physical this indicate that the memory descriptor need not copy the ranges array into local memory. This is an optimisation to try to minimise unnecessary allocations. + * @param task The task each of the virtual ranges are mapped into. Note that unlike IOMemoryDescriptor::withAddress(), kernel_task memory must be explicitly prepared when passed to this api. The task argument may be NULL to specify memory by physical address. + * @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor * withAddressRanges( + IOAddressRange * ranges, + UInt32 rangeCount, + IOOptionBits options, + task_t task); + +/*! @function withOptions + * @abstract Master initialiser for all variants of memory descriptors. + * @discussion This method creates and initializes an IOMemoryDescriptor for memory it has three main variants: Virtual, Physical & mach UPL. These variants are selected with the options parameter, see below. This memory descriptor needs to be prepared before it can be used to extract data from the memory described. + * + * + * @param buffers A pointer to an array of IOAddressRange when options:type is kIOMemoryTypeVirtual64 or kIOMemoryTypePhysical64 or a 64bit kernel. For type UPL it is a upl_t returned by the mach/memory_object_types.h apis, primarily used internally by the UBC. IOVirtualRanges or IOPhysicalRanges are 32 bit only types for use when options:type is kIOMemoryTypeVirtual or kIOMemoryTypePhysical on 32bit kernels. + * + * @param count options:type = Virtual or Physical count contains a count of the number of entires in the buffers array. For options:type = UPL this field contains a total length. + * + * @param offset Only used when options:type = UPL, in which case this field contains an offset for the memory within the buffers upl. + * + * @param task Only used options:type = Virtual, The task each of the virtual ranges are mapped into. + * + * @param options + * kIOMemoryDirectionMask (options:direction) This nibble indicates the I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + * kIOMemoryTypeMask (options:type) kIOMemoryTypeVirtual64, kIOMemoryTypeVirtual, kIOMemoryTypePhysical64, kIOMemoryTypePhysical, kIOMemoryTypeUPL Indicates that what type of memory basic memory descriptor to use. This sub-field also controls the interpretation of the buffers, count, offset & task parameters. + * kIOMemoryAsReference For options:type = Virtual or Physical this indicate that the memory descriptor need not copy the ranges array into local memory. This is an optimisation to try to minimise unnecessary allocations. + * kIOMemoryBufferPageable Only used by the IOBufferMemoryDescriptor as an indication that the kernel virtual memory is in fact pageable and we need to use the kernel pageable submap rather than the default map. + * + * @param mapper Which IOMapper should be used to map the in-memory physical addresses into I/O space addresses. Defaults to 0 which indicates that the system mapper is to be used, if present. + * + * @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor *withOptions(void * buffers, + UInt32 count, + UInt32 offset, + task_t task, + IOOptionBits options, + IOMapper * mapper = kIOMapperSystem); + +#ifndef __LP64__ + static IOMemoryDescriptor * withPhysicalRanges( + IOPhysicalRange * ranges, + UInt32 withCount, + IODirection withDirection, + bool asReference = false) APPLE_KEXT_DEPRECATED; /* use withOptions() and kIOMemoryTypePhysical instead */ +#endif /* !__LP64__ */ + +#ifndef __LP64__ + static IOMemoryDescriptor * withSubRange(IOMemoryDescriptor *of, + IOByteCount offset, + IOByteCount length, + IODirection withDirection) APPLE_KEXT_DEPRECATED; /* use IOSubMemoryDescriptor::withSubRange() and kIOMemoryThreadSafe instead */ +#endif /* !__LP64__ */ + +/*! @function withPersistentMemoryDescriptor + * @abstract Copy constructor that generates a new memory descriptor if the backing memory for the same task's virtual address and length has changed. + * @discussion If the original memory descriptor's address and length is still backed by the same real memory, i.e. the user hasn't deallocated and the reallocated memory at the same address then the original memory descriptor is returned with a additional reference. Otherwise we build a totally new memory descriptor with the same characteristics as the previous one but with a new view of the vm. Note not legal to call this function with anything except an IOGeneralMemoryDescriptor that was created with the kIOMemoryPersistent option. + * @param originalMD The memory descriptor to be duplicated. + * @result Either the original memory descriptor with an additional retain or a new memory descriptor, 0 for a bad original memory descriptor or some other resource shortage. */ + static IOMemoryDescriptor * + withPersistentMemoryDescriptor(IOMemoryDescriptor *originalMD); + +#ifndef __LP64__ +// obsolete initializers +// - initWithOptions is the designated initializer + virtual bool initWithAddress(void * address, + IOByteCount withLength, + IODirection withDirection) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ + virtual bool initWithAddress(IOVirtualAddress address, + IOByteCount withLength, + IODirection withDirection, + task_t withTask) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ + virtual bool initWithPhysicalAddress( + IOPhysicalAddress address, + IOByteCount withLength, + IODirection withDirection ) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ + virtual bool initWithRanges(IOVirtualRange * ranges, + UInt32 withCount, + IODirection withDirection, + task_t withTask, + bool asReference = false) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ + virtual bool initWithPhysicalRanges(IOPhysicalRange * ranges, + UInt32 withCount, + IODirection withDirection, + bool asReference = false) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ +#endif /* __LP64__ */ + +/*! @function getDirection + * @abstract Accessor to get the direction the memory descriptor was created with. + * @discussion This method returns the direction the memory descriptor was created with. + * @result The direction. */ + + virtual IODirection getDirection() const; + +/*! @function getLength + * @abstract Accessor to get the length of the memory descriptor (over all its ranges). + * @discussion This method returns the total length of the memory described by the descriptor, ie. the sum of its ranges' lengths. + * @result The byte count. */ + + virtual IOByteCount getLength() const; + +/*! @function setTag + * @abstract Set the tag for the memory descriptor. + * @discussion This method sets the tag for the memory descriptor. Tag bits are not interpreted by IOMemoryDescriptor. + * @param tag The tag. */ + + virtual void setTag( IOOptionBits tag ); + +/*! @function getTag + * @abstract Accessor to the retrieve the tag for the memory descriptor. + * @discussion This method returns the tag for the memory descriptor. Tag bits are not interpreted by IOMemoryDescriptor. + * @result The tag. */ + + virtual IOOptionBits getTag( void ); + +/*! @function getFlags + * @abstract Accessor to the retrieve the options the memory descriptor was created with. + * @discussion Accessor to the retrieve the options the memory descriptor was created with, and flags with its state. These bits are defined by the kIOMemory* enum. + * @result The flags bitfield. */ + + uint64_t getFlags(void); + +/*! @function readBytes + * @abstract Copy data from the memory descriptor's buffer to the specified buffer. + * @discussion This method copies data from the memory descriptor's memory at the given offset, to the caller's buffer. The memory descriptor MUST have the kIODirectionOut direcction bit set and be prepared. kIODirectionOut means that this memory descriptor will be output to an external device, so readBytes is used to get memory into a local buffer for a PIO transfer to the device. + * @param offset A byte offset into the memory descriptor's memory. + * @param bytes The caller supplied buffer to copy the data to. + * @param withLength The length of the data to copy. + * @result The number of bytes copied, zero will be returned if the specified offset is beyond the length of the descriptor. Development/debug kernel builds will assert if the offset is beyond the length of the descriptor. */ + + virtual IOByteCount readBytes(IOByteCount offset, + void * bytes, IOByteCount withLength); + +/*! @function writeBytes + * @abstract Copy data to the memory descriptor's buffer from the specified buffer. + * @discussion This method copies data to the memory descriptor's memory at the given offset, from the caller's buffer. The memory descriptor MUST have the kIODirectionIn direcction bit set and be prepared. kIODirectionIn means that this memory descriptor will be input from an external device, so writeBytes is used to write memory into the descriptor for PIO drivers. + * @param offset A byte offset into the memory descriptor's memory. + * @param bytes The caller supplied buffer to copy the data from. + * @param withLength The length of the data to copy. + * @result The number of bytes copied, zero will be returned if the specified offset is beyond the length of the descriptor. Development/debug kernel builds will assert if the offset is beyond the length of the descriptor. */ + + virtual IOByteCount writeBytes(IOByteCount offset, + const void * bytes, IOByteCount withLength); + +#ifndef __LP64__ + virtual IOPhysicalAddress getPhysicalSegment(IOByteCount offset, + IOByteCount * length); +#endif /* !__LP64__ */ + +/*! @function getPhysicalAddress + * @abstract Return the physical address of the first byte in the memory. + * @discussion This method returns the physical address of the first byte in the memory. It is most useful on memory known to be physically contiguous. + * @result A physical address. */ + + IOPhysicalAddress getPhysicalAddress(); + +#ifndef __LP64__ + virtual void * getVirtualSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_DEPRECATED; /* use map() and getVirtualAddress() instead */ +#endif /* !__LP64__ */ + +/*! @function prepare + * @abstract Prepare the memory for an I/O transfer. + * @discussion This involves paging in the memory, if necessary, and wiring it down for the duration of the transfer. The complete() method completes the processing of the memory after the I/O transfer finishes. Note that the prepare call is not thread safe and it is expected that the client will more easily be able to guarantee single threading a particular memory descriptor. + * @param forDirection The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + * @result An IOReturn code. */ + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone) = 0; + +/*! @function complete + * @abstract Complete processing of the memory after an I/O transfer finishes. + * @discussion This method should not be called unless a prepare was previously issued; the prepare() and complete() must occur in pairs, before and after an I/O transfer involving pageable memory. In 10.3 or greater systems the direction argument to complete is not longer respected. The direction is totally determined at prepare() time. + * @param forDirection DEPRECATED The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + * @result An IOReturn code. */ + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone) = 0; + +/* + * Mapping functions. + */ + +/*! @function createMappingInTask + * @abstract Maps a IOMemoryDescriptor into a task. + * @discussion This is the general purpose method to map all or part of the memory described by a memory descriptor into a task at any available address, or at a fixed address if possible. Caching & read-only options may be set for the mapping. The mapping is represented as a returned reference to a IOMemoryMap object, which may be shared if the mapping is compatible with an existing mapping of the IOMemoryDescriptor. The IOMemoryMap object returned should be released only when the caller has finished accessing the mapping, as freeing the object destroys the mapping. + * @param intoTask Sets the target task for the mapping. Pass kernel_task for the kernel address space. + * @param atAddress If a placed mapping is requested, atAddress specifies its address, and the kIOMapAnywhere should not be set. Otherwise, atAddress is ignored. + * @param options Mapping options are defined in IOTypes.h,
+ * kIOMapAnywhere should be passed if the mapping can be created anywhere. If not set, the atAddress parameter sets the location of the mapping, if it is available in the target map.
+ * kIOMapDefaultCache to inhibit the cache in I/O areas, kIOMapCopybackCache in general purpose RAM.
+ * kIOMapInhibitCache, kIOMapWriteThruCache, kIOMapCopybackCache to set the appropriate caching.
+ * kIOMapReadOnly to allow only read only accesses to the memory - writes will cause and access fault.
+ * kIOMapReference will only succeed if the mapping already exists, and the IOMemoryMap object is just an extra reference, ie. no new mapping will be created.
+ * kIOMapUnique allows a special kind of mapping to be created that may be used with the IOMemoryMap::redirect() API. These mappings will not be shared as is the default - there will always be a unique mapping created for the caller, not an existing mapping with an extra reference.
+ * kIOMapPrefault will try to prefault the pages corresponding to the mapping. This must not be done on the kernel task, and the memory must have been wired via prepare(). Otherwise, the function will fail.
+ * @param offset Is a beginning offset into the IOMemoryDescriptor's memory where the mapping starts. Zero is the default to map all the memory. + * @param length Is the length of the mapping requested for a subset of the IOMemoryDescriptor. Zero is the default to map all the memory. + * @result A reference to an IOMemoryMap object representing the mapping, which can supply the virtual address of the mapping and other information. The mapping may be shared with multiple callers - multiple maps are avoided if a compatible one exists. The IOMemoryMap object returned should be released only when the caller has finished accessing the mapping, as freeing the object destroys the mapping. The IOMemoryMap instance also retains the IOMemoryDescriptor it maps while it exists. */ + + IOMemoryMap * createMappingInTask( + task_t intoTask, + mach_vm_address_t atAddress, + IOOptionBits options, + mach_vm_size_t offset = 0, + mach_vm_size_t length = 0 ); + +#ifndef __LP64__ + virtual IOMemoryMap * map( + task_t intoTask, + IOVirtualAddress atAddress, + IOOptionBits options, + IOByteCount offset = 0, + IOByteCount length = 0 ) APPLE_KEXT_DEPRECATED;/* use createMappingInTask() instead */ +#endif /* !__LP64__ */ + +/*! @function map + * @abstract Maps a IOMemoryDescriptor into the kernel map. + * @discussion This is a shortcut method to map all the memory described by a memory descriptor into the kernel map at any available address. See the full version of the createMappingInTask method for further details. + * @param options Mapping options as in the full version of the createMappingInTask method, with kIOMapAnywhere assumed. + * @result See the full version of the createMappingInTask method. */ + + virtual IOMemoryMap * map( + IOOptionBits options = 0 ); + +/*! @function setMapping + * @abstract Establishes an already existing mapping. + * @discussion This method tells the IOMemoryDescriptor about a mapping that exists, but was created elsewhere. It allows later callers of the map method to share this externally created mapping. The IOMemoryMap object returned is created to represent it. This method is not commonly needed. + * @param task Address space in which the mapping exists. + * @param mapAddress Virtual address of the mapping. + * @param options Caching and read-only attributes of the mapping. + * @result A IOMemoryMap object created to represent the mapping. */ + + virtual IOMemoryMap * setMapping( + task_t task, + IOVirtualAddress mapAddress, + IOOptionBits options = 0 ); + +// Following methods are private implementation + +#ifdef __LP64__ + virtual +#endif /* __LP64__ */ + IOReturn redirect( task_t safeTask, bool redirect ); + + IOReturn handleFault( + void * _pager, + mach_vm_size_t sourceOffset, + mach_vm_size_t length); + + IOReturn populateDevicePager( + void * pager, + vm_map_t addressMap, + mach_vm_address_t address, + mach_vm_size_t sourceOffset, + mach_vm_size_t length, + IOOptionBits options ); + + virtual IOMemoryMap * makeMapping( + IOMemoryDescriptor * owner, + task_t intoTask, + IOVirtualAddress atAddress, + IOOptionBits options, + IOByteCount offset, + IOByteCount length ); + +protected: + virtual void addMapping( + IOMemoryMap * mapping ); + + virtual void removeMapping( + IOMemoryMap * mapping ); + + virtual IOReturn doMap( + vm_map_t addressMap, + IOVirtualAddress * atAddress, + IOOptionBits options, + IOByteCount sourceOffset = 0, + IOByteCount length = 0 ); + + virtual IOReturn doUnmap( + vm_map_t addressMap, + IOVirtualAddress logical, + IOByteCount length ); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @class IOMemoryMap : public OSObject + * @abstract A class defining common methods for describing a memory mapping. + * @discussion The IOMemoryMap object represents a mapped range of memory, described by a IOMemoryDescriptor. The mapping may be in the kernel or a non-kernel task and has processor cache mode attributes. IOMemoryMap instances are created by IOMemoryDescriptor when it creates mappings in its map method, and returned to the caller. */ + +class IOMemoryMap : public OSObject +{ + OSDeclareDefaultStructorsWithDispatch(IOMemoryMap); + +protected: + virtual void taggedRelease(const void *tag = NULL) const APPLE_KEXT_OVERRIDE; + virtual void free(void) APPLE_KEXT_OVERRIDE; + +public: +/*! @function getVirtualAddress + * @abstract Accessor to the virtual address of the first byte in the mapping. + * @discussion This method returns the virtual address of the first byte in the mapping. Since the IOVirtualAddress is only 32bit in 32bit kernels, the getAddress() method should be used for compatibility with 64bit task mappings. + * @result A virtual address. */ + + virtual IOVirtualAddress getVirtualAddress(void); + +/*! @function getPhysicalSegment + * @abstract Break a mapping into its physically contiguous segments. + * @discussion This method returns the physical address of the byte at the given offset into the mapping, and optionally the length of the physically contiguous segment from that offset. It functions similarly to IOMemoryDescriptor::getPhysicalSegment. + * @param offset A byte offset into the mapping whose physical address to return. + * @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset. + * @result A physical address, or zero if the offset is beyond the length of the mapping. */ + +#ifdef __LP64__ + virtual IOPhysicalAddress getPhysicalSegment(IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0); +#else /* !__LP64__ */ + virtual IOPhysicalAddress getPhysicalSegment(IOByteCount offset, + IOByteCount * length); +#endif /* !__LP64__ */ + +/*! @function getPhysicalAddress + * @abstract Return the physical address of the first byte in the mapping. + * @discussion This method returns the physical address of the first byte in the mapping. It is most useful on mappings known to be physically contiguous. + * @result A physical address. */ + + IOPhysicalAddress getPhysicalAddress(void); + +/*! @function getLength + * @abstract Accessor to the length of the mapping. + * @discussion This method returns the length of the mapping. + * @result A byte count. */ + + virtual IOByteCount getLength(void); + +/*! @function getAddressTask + * @abstract Accessor to the task of the mapping. + * @discussion This method returns the mach task the mapping exists in. + * @result A mach task_t. */ + + virtual task_t getAddressTask(); + +/*! @function getMemoryDescriptor + * @abstract Accessor to the IOMemoryDescriptor the mapping was created from. + * @discussion This method returns the IOMemoryDescriptor the mapping was created from. + * @result An IOMemoryDescriptor reference, which is valid while the IOMemoryMap object is retained. It should not be released by the caller. */ + + virtual IOMemoryDescriptor * getMemoryDescriptor(); + +/*! @function getMapOptions + * @abstract Accessor to the options the mapping was created with. + * @discussion This method returns the options to IOMemoryDescriptor::map the mapping was created with. + * @result Options for the mapping, including cache settings. */ + + virtual IOOptionBits getMapOptions(); + +/*! @function unmap + * @abstract Force the IOMemoryMap to unmap, without destroying the object. + * @discussion IOMemoryMap instances will unmap themselves upon free, ie. when the last client with a reference calls release. This method forces the IOMemoryMap to destroy the mapping it represents, regardless of the number of clients. It is not generally used. + * @result An IOReturn code. */ + + virtual IOReturn unmap(); + + virtual void taskDied(); + +/*! @function redirect + * @abstract Replace the memory mapped in a process with new backing memory. + * @discussion An IOMemoryMap created with the kIOMapUnique option to IOMemoryDescriptor::map() can remapped to a new IOMemoryDescriptor backing object. If the new IOMemoryDescriptor is specified as NULL, client access to the memory map is blocked until a new backing object has been set. By blocking access and copying data, the caller can create atomic copies of the memory while the client is potentially reading or writing the memory. + * @param newBackingMemory The IOMemoryDescriptor that represents the physical memory that is to be now mapped in the virtual range the IOMemoryMap represents. If newBackingMemory is NULL, any access to the mapping will hang (in vm_fault()) until access has been restored by a new call to redirect() with non-NULL newBackingMemory argument. + * @param options Mapping options are defined in IOTypes.h, and are documented in IOMemoryDescriptor::map() + * @param offset As with IOMemoryDescriptor::map(), a beginning offset into the IOMemoryDescriptor's memory where the mapping starts. Zero is the default. + * @result An IOReturn code. */ + +#ifndef __LP64__ +// For 32 bit XNU, there is a 32 bit (IOByteCount) and a 64 bit (mach_vm_size_t) interface; +// for 64 bit, these fall together on the 64 bit one. + virtual IOReturn redirect(IOMemoryDescriptor * newBackingMemory, + IOOptionBits options, + IOByteCount offset = 0); +#endif + virtual IOReturn redirect(IOMemoryDescriptor * newBackingMemory, + IOOptionBits options, + mach_vm_size_t offset = 0); + +#ifdef __LP64__ +/*! @function getAddress + * @abstract Accessor to the virtual address of the first byte in the mapping. + * @discussion This method returns the virtual address of the first byte in the mapping. + * @result A virtual address. */ + inline mach_vm_address_t getAddress() __attribute__((always_inline)); +/*! @function getSize + * @abstract Accessor to the length of the mapping. + * @discussion This method returns the length of the mapping. + * @result A byte count. */ + inline mach_vm_size_t getSize() __attribute__((always_inline)); +#else /* !__LP64__ */ +/*! @function getAddress + * @abstract Accessor to the virtual address of the first byte in the mapping. + * @discussion This method returns the virtual address of the first byte in the mapping. + * @result A virtual address. */ + virtual mach_vm_address_t getAddress(); +/*! @function getSize + * @abstract Accessor to the length of the mapping. + * @discussion This method returns the length of the mapping. + * @result A byte count. */ + virtual mach_vm_size_t getSize(); +#endif /* !__LP64__ */ + + + IOReturn wireRange( + uint32_t options, + mach_vm_size_t offset, + mach_vm_size_t length); + + OSMetaClassDeclareReservedUnused(IOMemoryMap, 0); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 1); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 2); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 3); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 4); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 5); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 6); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 7); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// The following classes are private implementation of IOMemoryDescriptor - they +// should not be referenced directly, just through the public API's in the +// IOMemoryDescriptor class. For example, an IOGeneralMemoryDescriptor instance +// might be created by IOMemoryDescriptor::withAddressRange(), but there should be +// no need to reference as anything but a generic IOMemoryDescriptor *. + +class IOGeneralMemoryDescriptor : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IOGeneralMemoryDescriptor); + +public: + union Ranges { + IOVirtualRange *v; + IOAddressRange *v64; + IOPhysicalRange *p; + void *uio; + }; +protected: + Ranges _ranges; + unsigned _rangesCount; /* number of address ranges in list */ +#ifndef __LP64__ + bool _rangesIsAllocated;/* is list allocated by us? */ +#endif /* !__LP64__ */ + + task_t _task; /* task where all ranges are mapped to */ + + union { + IOVirtualRange v; + IOPhysicalRange p; + } _singleRange; /* storage space for a single range */ + + unsigned _wireCount; /* number of outstanding wires */ + +#ifndef __LP64__ + uintptr_t _cachedVirtualAddress; + + IOPhysicalAddress _cachedPhysicalAddress; +#endif /* !__LP64__ */ + + bool _initialized; /* has superclass been initialized? */ + +public: + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual IOReturn dmaCommandOperation(DMACommandOps op, void *vData, UInt dataSize) const APPLE_KEXT_OVERRIDE; + + virtual uint64_t getPreparationID( void ) APPLE_KEXT_OVERRIDE; + + +private: + +#ifndef __LP64__ + virtual void setPosition(IOByteCount position); + virtual void mapIntoKernel(unsigned rangeIndex); + virtual void unmapFromKernel(); +#endif /* !__LP64__ */ + +// Internal + OSData * _memoryEntries; + unsigned int _pages; + ppnum_t _highestPage; + uint32_t __iomd_reservedA; + uint32_t __iomd_reservedB; + + IOLock * _prepareLock; + +public: +/* + * IOMemoryDescriptor required methods + */ + +// Master initaliser + virtual bool initWithOptions(void * buffers, + UInt32 count, + UInt32 offset, + task_t task, + IOOptionBits options, + IOMapper * mapper = kIOMapperSystem) APPLE_KEXT_OVERRIDE; + +#ifndef __LP64__ +// Secondary initialisers + virtual bool initWithAddress(void * address, + IOByteCount withLength, + IODirection withDirection) APPLE_KEXT_OVERRIDE APPLE_KEXT_DEPRECATED; + + virtual bool initWithAddress(IOVirtualAddress address, + IOByteCount withLength, + IODirection withDirection, + task_t withTask) APPLE_KEXT_OVERRIDE APPLE_KEXT_DEPRECATED; + + virtual bool initWithPhysicalAddress( + IOPhysicalAddress address, + IOByteCount withLength, + IODirection withDirection ) APPLE_KEXT_OVERRIDE APPLE_KEXT_DEPRECATED; + + virtual bool initWithRanges( IOVirtualRange * ranges, + UInt32 withCount, + IODirection withDirection, + task_t withTask, + bool asReference = false) APPLE_KEXT_OVERRIDE APPLE_KEXT_DEPRECATED; + + virtual bool initWithPhysicalRanges(IOPhysicalRange * ranges, + UInt32 withCount, + IODirection withDirection, + bool asReference = false) APPLE_KEXT_OVERRIDE APPLE_KEXT_DEPRECATED; + + virtual addr64_t getPhysicalSegment64( IOByteCount offset, + IOByteCount * length ) APPLE_KEXT_OVERRIDE APPLE_KEXT_DEPRECATED; + + virtual IOPhysicalAddress getPhysicalSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_OVERRIDE; + + virtual IOPhysicalAddress getSourceSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_OVERRIDE APPLE_KEXT_DEPRECATED; + + virtual void * getVirtualSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_OVERRIDE APPLE_KEXT_DEPRECATED; +#endif /* !__LP64__ */ + + virtual IOReturn setPurgeable( IOOptionBits newState, + IOOptionBits * oldState ) APPLE_KEXT_OVERRIDE; + + IOReturn setOwnership( task_t newOwner, + int newLedgerTag, + IOOptionBits newLedgerOptions ); + + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, +#ifdef __LP64__ + IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; +#else /* !__LP64__ */ + IOOptionBits options)APPLE_KEXT_OVERRIDE; +#endif /* !__LP64__ */ + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone) APPLE_KEXT_OVERRIDE; + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doMap( + vm_map_t addressMap, + IOVirtualAddress * atAddress, + IOOptionBits options, + IOByteCount sourceOffset = 0, + IOByteCount length = 0 ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doUnmap( + vm_map_t addressMap, + IOVirtualAddress logical, + IOByteCount length ) APPLE_KEXT_OVERRIDE; + + virtual bool serialize(OSSerialize *s) const APPLE_KEXT_OVERRIDE; + +// Factory method for cloning a persistent IOMD, see IOMemoryDescriptor + static IOMemoryDescriptor * + withPersistentMemoryDescriptor(IOGeneralMemoryDescriptor *originalMD); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifdef __LP64__ +mach_vm_address_t +IOMemoryMap::getAddress() +{ + return getVirtualAddress(); +} + +mach_vm_size_t +IOMemoryMap::getSize() +{ + return getLength(); +} +#else /* !__LP64__ */ +#include +#endif /* !__LP64__ */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +extern boolean_t iokit_iomd_setownership_enabled; + +#endif /* !_IOMEMORYDESCRIPTOR_H */ diff --git a/QualcommWireless/include/IOKit/IOMessage.h b/QualcommWireless/include/IOKit/IOMessage.h new file mode 100644 index 0000000..cdd5393 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOMessage.h @@ -0,0 +1,220 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IOMESSAGE_H +#define __IOKIT_IOMESSAGE_H + +#include +#include + +/*! + * @header IOMessage.h + * + * Defines message type constants for several IOKit messaging API's. + * + */ + +typedef UInt32 IOMessage; + +#define iokit_common_msg(message) (UInt32)(sys_iokit|sub_iokit_common|message) +#define iokit_family_msg(sub, message) (UInt32)(sys_iokit|sub|message) + +/*! + * @defined iokit_vendor_specific_msg + * @discussion iokit_vendor_specific_msg passes messages in the sub_iokit_vendor_specific + * subsystem. It can be used to generate messages that are used for private + * communication between vendor specific code with the IOService::message() etc. APIs. + */ +#define iokit_vendor_specific_msg(message) (UInt32)(sys_iokit|sub_iokit_vendor_specific|message) + +#define kIOMessageServiceIsTerminated iokit_common_msg(0x010) +#define kIOMessageServiceIsSuspended iokit_common_msg(0x020) +#define kIOMessageServiceIsResumed iokit_common_msg(0x030) + +#define kIOMessageServiceIsRequestingClose iokit_common_msg(0x100) +#define kIOMessageServiceIsAttemptingOpen iokit_common_msg(0x101) +#define kIOMessageServiceWasClosed iokit_common_msg(0x110) + +#define kIOMessageServiceBusyStateChange iokit_common_msg(0x120) + +#define kIOMessageConsoleSecurityChange iokit_common_msg(0x128) + +#define kIOMessageServicePropertyChange iokit_common_msg(0x130) + +#define kIOMessageCopyClientID iokit_common_msg(0x330) + +#define kIOMessageSystemCapabilityChange iokit_common_msg(0x340) +#define kIOMessageDeviceSignaledWakeup iokit_common_msg(0x350) + + +/*! + * @defined kIOMessageDeviceWillPowerOff + * @discussion Indicates the device is about to move to a lower power state. + * Sent to IOKit interest notification clients of type kIOAppPowerStateInterest + * and kIOGeneralInterest. + */ +#define kIOMessageDeviceWillPowerOff iokit_common_msg(0x210) + +/*! + * @defined kIOMessageDeviceHasPoweredOn + * @discussion Indicates the device has just moved to a higher power state. + * Sent to IOKit interest notification clients of type kIOAppPowerStateInterest + * and kIOGeneralInterest. + */ +#define kIOMessageDeviceHasPoweredOn iokit_common_msg(0x230) + +/*! @group In-kernel system shutdown and restart notifications + */ + +/*! + * @defined kIOMessageSystemWillPowerOff + * @discussion Indicates an imminent system shutdown. Recipients have a limited + * amount of time to respond, otherwise the system will timeout and + * shutdown even without a response. + * Delivered to in-kernel IOKit drivers via IOService::systemWillShutdown(), + * and to clients of registerPrioritySleepWakeInterest(). + * Never delivered to user space notification clients. + */ +#define kIOMessageSystemWillPowerOff iokit_common_msg(0x250) + +/*! + * @defined kIOMessageSystemWillRestart + * @discussion Indicates an imminent system restart. Recipients have a limited + * amount of time to respond, otherwise the system will timeout and + * restart even without a response. + * Delivered to in-kernel IOKit drivers via IOService::systemWillShutdown(), + * and to clients of registerPrioritySleepWakeInterest(). + * Never delivered to user space notification clients. + */ +#define kIOMessageSystemWillRestart iokit_common_msg(0x310) + +/*! + * @defined kIOMessageSystemPagingOff + * @discussion Indicates an imminent system shutdown, paging device now unavailable. + * Recipients have a limited amount of time to respond, otherwise the + * system will timeout and shutdown even without a response. + * Delivered to clients of registerPrioritySleepWakeInterest(). + * Never delivered to user space notification clients. + */ +#define kIOMessageSystemPagingOff iokit_common_msg(0x255) + + +/*! @group System sleep and wake notifications + */ + +/*! + * @defined kIOMessageCanSystemSleep + * @discussion Announces/Requests permission to proceed to system sleep. + * Delivered to in-kernel IOKit drivers via kIOGeneralInterest + * and kIOPriorityPowerStateInterest. + * Delivered to user clients of IORegisterForSystemPower. + */ +#define kIOMessageCanSystemSleep iokit_common_msg(0x270) + +/*! + * @defined kIOMessageSystemWillNotSleep + * @discussion Announces that the system has retracted a previous attempt to sleep; + * it follows kIOMessageCanSystemSleep. + * Delivered to in-kernel IOKit drivers via kIOGeneralInterest + * and kIOPriorityPowerStateInterest. + * Delivered to user clients of IORegisterForSystemPower. + */ +#define kIOMessageSystemWillNotSleep iokit_common_msg(0x290) + +/*! + * @defined kIOMessageSystemWillSleep + * @discussion Announces that sleep is beginning. + * Delivered to in-kernel IOKit drivers via kIOGeneralInterest + * and kIOPriorityPowerStateInterest. + * Delivered to user clients of IORegisterForSystemPower. + */ +#define kIOMessageSystemWillSleep iokit_common_msg(0x280) + +/*! + * @defined kIOMessageSystemWillPowerOn + * @discussion Announces that the system is beginning to power the device tree; most + * devices are unavailable at this point.. + * Delivered to in-kernel IOKit drivers via kIOGeneralInterest + * and kIOPriorityPowerStateInterest. + * Delivered to user clients of IORegisterForSystemPower. + */ +#define kIOMessageSystemWillPowerOn iokit_common_msg(0x320) + +/*! + * @defined kIOMessageSystemHasPoweredOn + * @discussion Announces that the system and its devices have woken up. + * Delivered to in-kernel IOKit drivers via kIOGeneralInterest + * and kIOPriorityPowerStateInterest. + * Delivered to user clients of IORegisterForSystemPower. + */ +#define kIOMessageSystemHasPoweredOn iokit_common_msg(0x300) + +/*! @group Unused and deprecated notifications + */ + +/*! + * @defined kIOMessageCanDevicePowerOff + * @discussion Delivered to kIOAppPowerStateInterest clients of + * devices that implement their own idle timeouts. + * This message type is almost never used. + */ +#define kIOMessageCanDevicePowerOff iokit_common_msg(0x200) + +/*! + * @defined kIOMessageDeviceWillNotPowerOff + * @discussion This IOKit interest notification is largely unused; + * it's not very interesting. + */ +#define kIOMessageDeviceWillNotPowerOff iokit_common_msg(0x220) + +/*! + * @defined kIOMessageSystemWillNotPowerOff + * @deprecated This IOKit message is unused. + */ +#define kIOMessageSystemWillNotPowerOff iokit_common_msg(0x260) + +/*! + * @defined kIOMessageCanSystemPowerOff + * @deprecated This IOKit message is unused. + */ +#define kIOMessageCanSystemPowerOff iokit_common_msg(0x240) + +/*! + * @defined kIOMessageDeviceWillPowerOn + * @discussion IOService power mgt does not send kIOMessageDeviceWillPowerOn. + */ +#define kIOMessageDeviceWillPowerOn iokit_common_msg(0x215) + +/*! + * @defined kIOMessageDeviceHasPoweredOff + * @discussion IOService power mgt does not send kIOMessageDeviceHasPoweredOff. + */ +#define kIOMessageDeviceHasPoweredOff iokit_common_msg(0x225) + + +#endif /* ! __IOKIT_IOMESSAGE_H */ diff --git a/QualcommWireless/include/IOKit/IOMultiMemoryDescriptor.h b/QualcommWireless/include/IOKit/IOMultiMemoryDescriptor.h new file mode 100644 index 0000000..f7ede4a --- /dev/null +++ b/QualcommWireless/include/IOKit/IOMultiMemoryDescriptor.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOMULTIMEMORYDESCRIPTOR_H +#define _IOMULTIMEMORYDESCRIPTOR_H + +#include + +/*! @class IOMultiMemoryDescriptor : public IOMemoryDescriptor + * @abstract The IOMultiMemoryDescriptor object describes a memory area made up of several other IOMemoryDescriptors. + * @discussion The IOMultiMemoryDescriptor object represents multiple ranges of memory, specified as an ordered list of IOMemoryDescriptors. The descriptors are chained end-to-end to make up a single contiguous buffer. */ + +class IOMultiMemoryDescriptor : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IOMultiMemoryDescriptor); + +protected: + + IOMemoryDescriptor ** _descriptors; + UInt32 _descriptorsCount; + bool _descriptorsIsAllocated; + + virtual void free() APPLE_KEXT_OVERRIDE; + +public: + +/*! @function withDescriptors + * @abstract Create an IOMultiMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors. + * @discussion This method creates and initializes an IOMultiMemoryDescriptor for memory consisting of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer. Passing the descriptor array as a reference will avoid an extra allocation. + * @param descriptors An array of IOMemoryDescriptors which make up the memory to be described. + * @param withCount The object count for the descriptors array. + * @param withDirection An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + * @param asReference If false, the IOMultiMemoryDescriptor object will make a copy of the descriptors array, otherwise, the array will be used in situ, avoiding an extra allocation. + * @result The created IOMultiMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMultiMemoryDescriptor * withDescriptors( + IOMemoryDescriptor ** descriptors, + UInt32 withCount, + IODirection withDirection, + bool asReference = false ); + +/*! @function withDescriptors + * @abstract Initialize an IOMultiMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors. + * @discussion This method initializes an IOMultiMemoryDescriptor for memory consisting of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer. Passing the descriptor array as a reference will avoid an extra allocation. + * @param descriptors An array of IOMemoryDescriptors which make up the memory to be described. + * @param withCount The object count for the descriptors array. + * @param withDirection An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + * @param asReference If false, the IOMultiMemoryDescriptor object will make a copy of the descriptors array, otherwise, the array will be used in situ, avoiding an extra allocation. + * @result The created IOMultiMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + virtual bool initWithDescriptors( + IOMemoryDescriptor ** descriptors, + UInt32 withCount, + IODirection withDirection, + bool asReference = false ); + +/*! @function getPhysicalSegment + * @abstract Break a memory descriptor into its physically contiguous segments. + * @discussion This method returns the physical address of the byte at the given offset into the memory, and optionally the length of the physically contiguous segment from that offset. + * @param offset A byte offset into the memory whose physical address to return. + * @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset. + * @result A physical address, or zero if the offset is beyond the length of the memory. */ + + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; + +/*! @function prepare + * @abstract Prepare the memory for an I/O transfer. + * @discussion This involves paging in the memory, if necessary, and wiring it down for the duration of the transfer. The complete() method completes the processing of the memory after the I/O transfer finishes. This method needn't called for non-pageable memory. + * @param forDirection The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + * @result An IOReturn code. */ + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone) APPLE_KEXT_OVERRIDE; + +/*! @function complete + * @abstract Complete processing of the memory after an I/O transfer finishes. + * @discussion This method should not be called unless a prepare was previously issued; the prepare() and complete() must occur in pairs, before and after an I/O transfer involving pageable memory. + * @param forDirection The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + * @result An IOReturn code. */ + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setPurgeable(IOOptionBits newState, IOOptionBits * oldState) APPLE_KEXT_OVERRIDE; + + IOReturn setOwnership(task_t newOwner, int newLedgerTag, IOOptionBits newOptions); + +/*! @function getPageCounts + * @abstract Retrieve the number of resident and/or dirty pages encompassed by an IOMemoryDescriptor. + * @discussion This method returns the number of resident and/or dirty pages encompassed by an IOMemoryDescriptor. + * @param residentPageCount - If non-null, a pointer to a byte count that will return the number of resident pages encompassed by this IOMemoryDescriptor. + * @param dirtyPageCount - If non-null, a pointer to a byte count that will return the number of dirty pages encompassed by this IOMemoryDescriptor. + * @result An IOReturn code. */ + + IOReturn getPageCounts(IOByteCount * residentPageCount, + IOByteCount * dirtyPageCount); + + virtual uint64_t getPreparationID( void ) APPLE_KEXT_OVERRIDE; + +#define IOMULTIMEMORYDESCRIPTOR_SUPPORTS_GETPAGECOUNTS 1 + +private: + virtual IOReturn doMap(vm_map_t addressMap, + IOVirtualAddress * atAddress, + IOOptionBits options, + IOByteCount sourceOffset = 0, + IOByteCount length = 0 ) APPLE_KEXT_OVERRIDE; +}; + +#endif /* !_IOMULTIMEMORYDESCRIPTOR_H */ diff --git a/QualcommWireless/include/IOKit/IONVRAM.h b/QualcommWireless/include/IOKit/IONVRAM.h new file mode 100644 index 0000000..ef2e533 --- /dev/null +++ b/QualcommWireless/include/IOKit/IONVRAM.h @@ -0,0 +1,188 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2007-2012 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IONVRAM_H +#define _IOKIT_IONVRAM_H + +#ifdef __cplusplus +#include +#include +#include +#include +#endif /* __cplusplus */ + +#define kIODTNVRAMOFPartitionName "common" +#define kIODTNVRAMXPRAMPartitionName "APL,MacOS75" +#define kIODTNVRAMPanicInfoPartitonName "APL,OSXPanic" +#define kIODTNVRAMFreePartitionName "wwwwwwwwwwww" + +#define MIN_SYNC_NOW_INTERVAL 15*60 /* Minimum 15 Minutes interval mandated */ + +enum { + kIODTNVRAMImageSize = 0x2000, + kIODTNVRAMXPRAMSize = 0x0100, + kIODTNVRAMNameRegistrySize = 0x0400 +}; + +enum { + kOFVariableTypeBoolean = 1, + kOFVariableTypeNumber, + kOFVariableTypeString, + kOFVariableTypeData +}; + +enum { + kOFVariablePermRootOnly = 0, + kOFVariablePermUserRead, + kOFVariablePermUserWrite, + kOFVariablePermKernelOnly +}; + +#ifdef __cplusplus + +class IODTNVRAM : public IOService +{ + OSDeclareDefaultStructors(IODTNVRAM); + +private: + IONVRAMController *_nvramController; + const OSSymbol *_registryPropertiesKey; + UInt8 *_nvramImage; + __unused bool _nvramImageDirty; + UInt32 _ofPartitionOffset; + UInt32 _ofPartitionSize; + UInt8 *_ofImage; + __unused bool _ofImageDirty; + OSDictionary *_ofDict; + OSDictionary *_nvramPartitionOffsets; + OSDictionary *_nvramPartitionLengths; + UInt32 _resv0 __unused; + UInt32 _resv1 __unused; + IOLock *_ofLock; + UInt32 _resv2 __unused; + UInt32 _resv3 __unused; + UInt8 *_resv4 __unused; + UInt32 _piPartitionOffset; + UInt32 _piPartitionSize; + UInt8 *_piImage; + bool _systemPaniced; + SInt32 _lastDeviceSync; + bool _freshInterval; + bool _isProxied; + + virtual UInt8 calculatePartitionChecksum(UInt8 *partitionHeader); + virtual IOReturn initOFVariables(void); +public: + virtual IOReturn syncOFVariables(void); +private: + virtual UInt32 getOFVariableType(const OSSymbol *propSymbol) const; + virtual UInt32 getOFVariablePerm(const OSSymbol *propSymbol) const; + virtual bool getOWVariableInfo(UInt32 variableNumber, const OSSymbol **propSymbol, + UInt32 *propType, UInt32 *propOffset); + virtual bool convertPropToObject(UInt8 *propName, UInt32 propNameLength, + UInt8 *propData, UInt32 propDataLength, + LIBKERN_RETURNS_RETAINED const OSSymbol **propSymbol, + LIBKERN_RETURNS_RETAINED OSObject **propObject); + virtual bool convertObjectToProp(UInt8 *buffer, UInt32 *length, + const OSSymbol *propSymbol, OSObject *propObject); + virtual UInt16 generateOWChecksum(UInt8 *buffer); + virtual bool validateOWChecksum(UInt8 *buffer); + virtual void updateOWBootArgs(const OSSymbol *key, OSObject *value); + virtual bool searchNVRAMProperty(struct IONVRAMDescriptor *hdr, + UInt32 *where); + + virtual IOReturn readNVRAMPropertyType0(IORegistryEntry *entry, + const OSSymbol **name, + OSData **value); + virtual IOReturn writeNVRAMPropertyType0(IORegistryEntry *entry, + const OSSymbol *name, + OSData * value); + + virtual OSData *unescapeBytesToData(const UInt8 *bytes, UInt32 length); + virtual OSData *escapeDataToData(OSData * value); + + virtual IOReturn readNVRAMPropertyType1(IORegistryEntry *entry, + const OSSymbol **name, + OSData **value); + virtual IOReturn writeNVRAMPropertyType1(IORegistryEntry *entry, + const OSSymbol *name, + OSData *value); + + void initNVRAMImage(void); + void initProxyData(void); + IOReturn syncVariables(void); + IOReturn setPropertyInternal(const OSSymbol *aKey, OSObject *anObject); + + +public: + virtual bool init(IORegistryEntry *old, const IORegistryPlane *plane) APPLE_KEXT_OVERRIDE; + + virtual void registerNVRAMController(IONVRAMController *nvram); + + virtual void sync(void); + + virtual bool serializeProperties(OSSerialize *s) const APPLE_KEXT_OVERRIDE; + virtual OSObject *copyProperty(const OSSymbol *aKey) const APPLE_KEXT_OVERRIDE; + virtual OSObject *copyProperty(const char *aKey) const APPLE_KEXT_OVERRIDE; + virtual OSObject *getProperty(const OSSymbol *aKey) const APPLE_KEXT_OVERRIDE; + virtual OSObject *getProperty(const char *aKey) const APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const OSSymbol *aKey, OSObject *anObject) APPLE_KEXT_OVERRIDE; + virtual void removeProperty(const OSSymbol *aKey) APPLE_KEXT_OVERRIDE; + virtual IOReturn setProperties(OSObject *properties) APPLE_KEXT_OVERRIDE; + + virtual IOReturn readXPRAM(IOByteCount offset, UInt8 *buffer, + IOByteCount length); + virtual IOReturn writeXPRAM(IOByteCount offset, UInt8 *buffer, + IOByteCount length); + + virtual IOReturn readNVRAMProperty(IORegistryEntry *entry, + const OSSymbol **name, + OSData **value); + virtual IOReturn writeNVRAMProperty(IORegistryEntry *entry, + const OSSymbol *name, + OSData *value); + + virtual OSDictionary *getNVRAMPartitions(void); + + virtual IOReturn readNVRAMPartition(const OSSymbol *partitionID, + IOByteCount offset, UInt8 *buffer, + IOByteCount length); + + virtual IOReturn writeNVRAMPartition(const OSSymbol *partitionID, + IOByteCount offset, UInt8 *buffer, + IOByteCount length); + + virtual IOByteCount savePanicInfo(UInt8 *buffer, IOByteCount length); + virtual bool safeToSync(void); + void syncInternal(bool rateLimit); +}; + +#endif /* __cplusplus */ + +#endif /* !_IOKIT_IONVRAM_H */ diff --git a/QualcommWireless/include/IOKit/IONotifier.h b/QualcommWireless/include/IOKit/IONotifier.h new file mode 100644 index 0000000..3324fc7 --- /dev/null +++ b/QualcommWireless/include/IOKit/IONotifier.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _IOKIT_IONOTIFIER_H +#define _IOKIT_IONOTIFIER_H + +#include + +/*! @class IONotifier : public OSObject + * @abstract An abstract base class defining common methods for controlling a notification request. + * @discussion IOService notification requests are represented as implementations of the IONotifier object. It defines methods to enable, disable and remove notification requests. These actions are synchronized with invocations of the notification handler, so removing a notification request will guarantee the handler is not being executed. */ + +class IONotifier : public OSObject +{ + OSDeclareAbstractStructors(IONotifier); + +public: + +/*! @function remove + * @abstract Removes the notification request and releases it. + * @discussion Removes the notification request and release it. Since creating an IONotifier instance will leave it with a retain count of one, creating an IONotifier and then removing it will destroy it. This method is synchronous with any handler invocations, so when this method returns its guaranteed the handler will not be in entered. */ + + virtual void remove() = 0; + +/*! @function disable + * @abstract Disables the notification request. + * @discussion Disables the notification request. This method is synchronous with any handler invocations, so when this method returns its guaranteed the handler will not be in entered. + * @result Returns the previous enable state of the IONotifier. */ + + virtual bool disable() = 0; + +/*! @function enable + * @abstract Sets the enable state of the notification request. + * @discussion Restores the enable state of the notification request, given the previous state passed in. + * @param was The enable state of the notifier to restore. */ + + virtual void enable( bool was ) = 0; +}; + +#endif /* ! _IOKIT_IONOTIFIER_H */ diff --git a/QualcommWireless/include/IOKit/IOPlatformExpert.h b/QualcommWireless/include/IOKit/IOPlatformExpert.h new file mode 100644 index 0000000..9fdfd87 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOPlatformExpert.h @@ -0,0 +1,428 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOPLATFORMEXPERT_H +#define _IOKIT_IOPLATFORMEXPERT_H + +#ifdef __cplusplus +#include +#include +#include +#include + +extern "C" { +#endif + +#include + +typedef enum { + kCoprocessorVersionNone = 0x00000000, + kCoprocessorVersion1 = 0x00010000, + kCoprocessorVersion2 = 0x00020000, +} coprocessor_type_t; + + +extern boolean_t PEGetMachineName( char * name, int maxLength ); +extern boolean_t PEGetModelName( char * name, int maxLength ); +extern int PEGetPlatformEpoch( void ); + +enum { + kPEHaltCPU, + kPERestartCPU, + kPEHangCPU, + kPEUPSDelayHaltCPU, + kPEPanicRestartCPU, + kPEPanicSync, + kPEPagingOff, + kPEPanicBegin, + kPEPanicEnd, + kPEPanicDiskShutdown, + kPEPanicRestartCPUNoPanicEndCallouts, + kPEPanicRestartCPUNoCallouts +}; +extern int (*PE_halt_restart)(unsigned int type); +extern int PEHaltRestart(unsigned int type); + + + +// Save the Panic Info. Returns the number of bytes saved. +extern UInt32 PESavePanicInfo(UInt8 *buffer, UInt32 length); +extern void PESavePanicInfoAction(void *buffer, UInt32 offset, UInt32 length); + +/* + * SMC requires that all data is flushed in multiples of 16 bytes at 16 byte + * boundaries. + */ +#define PANIC_FLUSH_BOUNDARY 16 + +extern long PEGetGMTTimeOfDay( void ); +extern void PESetGMTTimeOfDay( long secs ); +extern void PEGetUTCTimeOfDay( clock_sec_t * secs, clock_usec_t * usecs ); +extern void PESetUTCTimeOfDay( clock_sec_t secs, clock_usec_t usecs ); + +/* unless it's a "well-known" property, these will read/write out the value as raw data */ + +extern boolean_t PEWriteNVRAMBooleanProperty(const char *symbol, boolean_t value); +extern boolean_t PEWriteNVRAMProperty(const char *symbol, const void *value, const unsigned int len); +extern boolean_t PEWriteNVRAMPropertyWithCopy(const char *symbol, const void *value, const unsigned int len); + +extern boolean_t PEReadNVRAMProperty(const char *symbol, void *value, unsigned int *len); + +extern boolean_t PERemoveNVRAMProperty(const char *symbol); + +extern coprocessor_type_t PEGetCoprocessorVersion( void ); + +#ifdef __cplusplus +} /* extern "C" */ + +#define kIOPlatformMapperPresentKey "IOPlatformMapperPresent" + + + + +extern OSSymbol * gPlatformInterruptControllerName; + +/* + * IOPlatformSleepAction + * + * Sleep is called after power management has finished all of the power plane + * driver power management notifications and state transitions and has + * committed to sleep, but before the other CPUs are powered off. + * The scheduler is still active. + */ +extern const OSSymbol *gIOPlatformSleepActionKey; + +/* + * IOPlatformWakeAction + * + * Wake is called with the scheduler enabled, but before + * powering on other CPUs, so try to minimize work done in this path to speed + * up wake time. + */ +extern const OSSymbol *gIOPlatformWakeActionKey; + +/* + * IOPlatformQuiesceAction + * + * Quiesce is called after all CPUs are off, scheduling is disabled, + * and the boot CPU is about to pull the plug. + * Mutexes and blocking are disallowed in this context and will panic. + * Do not pass this action to super() (incl. IOService, IOPlatformExpert) + */ +extern const OSSymbol *gIOPlatformQuiesceActionKey; + +/* + * IOPlatformActiveAction + * + * Active is called very early in the wake path before enabling the scheduler + * on the boot CPU. + * Mutexes and blocking are disallowed in this context and will panic. + * Do not pass this action to super() (incl. IOService, IOPlatformExpert) + */ +extern const OSSymbol *gIOPlatformActiveActionKey; + +/* + * IOPlatformHaltRestartAction + * + * Halt/Restart is called after the kernel finishes shutting down the + * system and is ready to power off or reboot. + * + * It is not guaranteed to be called in non-graceful shutdown scenarios. + */ +extern const OSSymbol *gIOPlatformHaltRestartActionKey; + +/* + * IOPlatformPanicAction + * + * Panic is called when the system is panicking before it records a core file + * (if it is configured to do so) + * + * It can be called at any time, in any context, in any state. Don't depend + * on anything being powered on in a useful state. + * + * Mutexes and blocking are disallowed in this context and will fail. + * + * If you hang or panic again in this callout, the panic log may not be recorded, + * leading to the loss of field reports about customer issues. + */ +extern const OSSymbol *gIOPlatformPanicActionKey; + +class IORangeAllocator; +class IONVRAMController; +class IOPMrootDomain; + +class IOPlatformExpert : public IOService +{ + OSDeclareDefaultStructors(IOPlatformExpert); + +private: + long _peBootROMType; + long _peChipSetType; + long _peMachineType; + +protected: + IOPMrootDomain * root; + int _pePMFeatures; + int _pePrivPMFeatures; + int _peNumBatteriesSupported; + OSArray * thePowerTree; + + bool searchingForAdditionalParents; + OSNumber * multipleParentKeyValue; + int numInstancesRegistered; + + struct ExpansionData { }; + ExpansionData *iope_reserved __unused; + + virtual void setBootROMType(long peBootROMType); + virtual void setChipSetType(long peChipSetType); + virtual void setMachineType(long peMachineType); + + virtual bool CheckSubTree(OSArray * inSubTree, IOService * theNub, IOService * theDevice, OSDictionary * theParent); + virtual bool RegisterServiceInTree(IOService * theService, OSDictionary * theTreeNode, OSDictionary * theTreeParentNode, IOService * theProvider); + + virtual void PMInstantiatePowerDomains( void ); + +public: + virtual bool attach( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool configure( IOService * provider ); + virtual IOService * createNub( OSDictionary * from ); + + virtual bool compareNubName( const IOService * nub, OSString * name, + OSString ** matched = NULL ) const; + virtual IOReturn getNubResources( IOService * nub ); + + virtual long getBootROMType(void); + virtual long getChipSetType(void); + virtual long getMachineType(void); + + virtual bool getModelName( char * name, int maxLength ); + virtual bool getMachineName( char * name, int maxLength ); + + virtual int haltRestart(unsigned int type); + virtual void sleepKernel(void); + + virtual long getGMTTimeOfDay( void ); + virtual void setGMTTimeOfDay( long secs ); + + virtual IOReturn getConsoleInfo( PE_Video * consoleInfo ); + virtual IOReturn setConsoleInfo( PE_Video * consoleInfo, unsigned int op ); + + virtual void registerNVRAMController( IONVRAMController * nvram ); + + virtual IOReturn registerInterruptController(OSSymbol *name, IOInterruptController *interruptController); + virtual LIBKERN_RETURNS_NOT_RETAINED IOInterruptController * + lookUpInterruptController(OSSymbol *name); + + virtual void setCPUInterruptProperties(IOService *service); + virtual bool atInterruptLevel(void); + + virtual IOReturn callPlatformFunction(const OSSymbol *functionName, + bool waitForFunction, + void *param1, void *param2, + void *param3, void *param4) APPLE_KEXT_OVERRIDE; + + virtual IORangeAllocator * getPhysicalRangeAllocator(void); + + virtual bool platformAdjustService(IOService *service); + + virtual void PMRegisterDevice(IOService * theNub, IOService * theDevice); + virtual void PMLog( const char *, unsigned long, unsigned long, unsigned long ); + + virtual bool hasPMFeature(unsigned long featureMask); + virtual bool hasPrivPMFeature(unsigned long privFeatureMask); + virtual int numBatteriesSupported(void); + + virtual IOByteCount savePanicInfo(UInt8 *buffer, IOByteCount length); + + virtual OSString* createSystemSerialNumberString(OSData* myProperty); + + virtual IOReturn deregisterInterruptController(OSSymbol *name); + + virtual void getUTCTimeOfDay( clock_sec_t * secs, clock_nsec_t * nsecs ); + virtual void setUTCTimeOfDay( clock_sec_t secs, clock_nsec_t nsecs ); + + OSMetaClassDeclareReservedUsed(IOPlatformExpert, 0); + OSMetaClassDeclareReservedUsed(IOPlatformExpert, 1); + OSMetaClassDeclareReservedUsed(IOPlatformExpert, 2); + OSMetaClassDeclareReservedUsed(IOPlatformExpert, 3); + OSMetaClassDeclareReservedUsed(IOPlatformExpert, 4); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 5); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 6); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 7); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 8); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 9); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 10); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 11); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +class IODTNVRAM; + +class IODTPlatformExpert : public IOPlatformExpert +{ + OSDeclareAbstractStructors(IODTPlatformExpert); + +private: + IODTNVRAM *dtNVRAM; + + struct ExpansionData { }; + ExpansionData *iodtpe_reserved; + +public: + virtual IOService * probe( IOService * provider, + SInt32 * score ) APPLE_KEXT_OVERRIDE; + virtual bool configure( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual void processTopLevel( IORegistryEntry * root ); + virtual const char * deleteList( void ) = 0; + virtual const char * excludeList( void ) = 0; + virtual IOService * createNub( IORegistryEntry * from ); + virtual bool createNubs( IOService * parent, LIBKERN_CONSUMED OSIterator * iter ); + + virtual bool compareNubName( const IOService * nub, OSString * name, + OSString ** matched = NULL ) const APPLE_KEXT_OVERRIDE; + + virtual IOReturn getNubResources( IOService * nub ) APPLE_KEXT_OVERRIDE; + + virtual bool getModelName( char * name, int maxLength ) APPLE_KEXT_OVERRIDE; + virtual bool getMachineName( char * name, int maxLength ) APPLE_KEXT_OVERRIDE; + + virtual void registerNVRAMController( IONVRAMController * nvram ) APPLE_KEXT_OVERRIDE; + + virtual int haltRestart(unsigned int type) APPLE_KEXT_OVERRIDE; + +/* virtual */ IOReturn readXPRAM(IOByteCount offset, UInt8 * buffer, + IOByteCount length); + +/* virtual */ IOReturn writeXPRAM(IOByteCount offset, UInt8 * buffer, + IOByteCount length); + + virtual IOReturn readNVRAMProperty( + IORegistryEntry * entry, + const OSSymbol ** name, OSData ** value ); + + virtual IOReturn writeNVRAMProperty( + IORegistryEntry * entry, + const OSSymbol * name, OSData * value ); + +// This returns a dictionary describing all the NVRAM partitions. +// The keys will be the partitionIDs of the form "0x52,nvram". +// The values will be OSNumbers of the partition's byte count. +/* virtual */ OSDictionary *getNVRAMPartitions(void); + +/* virtual */ IOReturn readNVRAMPartition(const OSSymbol * partitionID, + IOByteCount offset, UInt8 * buffer, + IOByteCount length); + +/* virtual */ IOReturn writeNVRAMPartition(const OSSymbol * partitionID, + IOByteCount offset, UInt8 * buffer, + IOByteCount length); + + virtual IOByteCount savePanicInfo(UInt8 *buffer, IOByteCount length) APPLE_KEXT_OVERRIDE; + virtual OSString* createSystemSerialNumberString(OSData* myProperty) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 0); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 1); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 2); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 3); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 4); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 5); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 6); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 7); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* generic root nub of service tree */ + +class IOPlatformExpertDevice : public IOService +{ + OSDeclareDefaultStructors(IOPlatformExpertDevice); + +private: + IOWorkLoop *workLoop; + + struct ExpansionData { }; + ExpansionData *ioped_reserved __unused; + +public: + virtual bool initWithArgs( void * p1, void * p2, + void * p3, void *p4 ); + virtual bool compareName( OSString * name, OSString ** matched = NULL ) const APPLE_KEXT_OVERRIDE; + + virtual IOWorkLoop *getWorkLoop() const APPLE_KEXT_OVERRIDE; + virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE; + + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, OSDictionary * properties, + IOUserClient ** handler) APPLE_KEXT_OVERRIDE; + + + OSMetaClassDeclareReservedUnused(IOPlatformExpertDevice, 0); + OSMetaClassDeclareReservedUnused(IOPlatformExpertDevice, 1); + OSMetaClassDeclareReservedUnused(IOPlatformExpertDevice, 2); + OSMetaClassDeclareReservedUnused(IOPlatformExpertDevice, 3); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* generic nub for motherboard devices */ + +class IOPlatformDevice : public IOService +{ + OSDeclareDefaultStructors(IOPlatformDevice); + + struct ExpansionData { }; + ExpansionData *iopd_reserved; + +public: + virtual bool compareName( OSString * name, OSString ** matched = NULL ) const APPLE_KEXT_OVERRIDE; + virtual IOService * matchLocation( IOService * client ) APPLE_KEXT_OVERRIDE; + virtual IOReturn getResources( void ) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(IOPlatformDevice, 0); + OSMetaClassDeclareReservedUnused(IOPlatformDevice, 1); + OSMetaClassDeclareReservedUnused(IOPlatformDevice, 2); + OSMetaClassDeclareReservedUnused(IOPlatformDevice, 3); +}; + +#endif /* __cplusplus */ + +#endif /* ! _IOKIT_IOPLATFORMEXPERT_H */ diff --git a/QualcommWireless/include/IOKit/IORPC.h b/QualcommWireless/include/IOKit/IORPC.h new file mode 100644 index 0000000..bb729c8 --- /dev/null +++ b/QualcommWireless/include/IOKit/IORPC.h @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2018 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + + +#ifndef _IORPC_H +#define _IORPC_H + +#include + + +#include + + +class IOUserServer; + +typedef uint64_t OSObjectRef; + +enum { + kIORPCVersion190615 = (mach_msg_id_t) 0x4da2b68c, + kIORPCVersion190615Reply = (mach_msg_id_t) 0x4da2b68d, + +#if DRIVERKIT_PRIVATE + kIORPCVersion190501 = (mach_msg_id_t) 0xfe316a7a, + kIORPCVersion190501Reply = (mach_msg_id_t) 0xfe316a7b, + + kIORPCVersionCurrent = kIORPCVersion190615, + kIORPCVersionCurrentReply = kIORPCVersion190615Reply +#endif /* DRIVERKIT_PRIVATE */ +}; + +enum{ + kIORPCMessageRemote = 0x00000001, + kIORPCMessageLocalHost = 0x00000002, + kIORPCMessageKernel = 0x00000004, + kIORPCMessageOneway = 0x00000008, + kIORPCMessageObjectRefs = 0x00000010, + kIORPCMessageOnqueue = 0x00000020, + kIORPCMessageError = 0x00000040, + kIORPCMessageSimpleReply = 0x00000080, +}; + +enum{ + kIORPCMessageIDKernel = (1ULL << 63), +}; + +struct IORPCMessageMach { + mach_msg_header_t msgh; + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t objects[0]; +}; +typedef struct IORPCMessageMach IORPCMessageMach; + +struct IORPCMessage { + uint64_t msgid; + uint64_t flags; + uint64_t objectRefs; + OSObjectRef objects[0]; +}; +typedef struct IORPCMessage IORPCMessage; + +extern "C" IORPCMessage * +IORPCMessageFromMach(IORPCMessageMach * msg, bool reply); + +struct IORPCMessageErrorReturnContent { + IORPCMessage hdr; + kern_return_t result; + uint32_t pad; +}; + +#pragma pack(4) +struct IORPCMessageErrorReturn { + IORPCMessageMach mach; + IORPCMessageErrorReturnContent content; +}; +#pragma pack() + + +class OSMetaClassBase; +struct IORPC; +typedef kern_return_t (*OSDispatchMethod)(OSMetaClassBase * self, const IORPC rpc); + +struct IORPC { + IORPCMessageMach * message; + IORPCMessageMach * reply; + uint32_t sendSize; + uint32_t replySize; +}; +typedef struct IORPC IORPC; + +enum { + kOSClassCanRemote = 0x00000001, +}; + +struct OSClassDescription { + uint32_t descriptionSize; + + char name[96]; + char superName[96]; + + uint32_t methodOptionsSize; + uint32_t methodOptionsOffset; + uint32_t metaMethodOptionsSize; + uint32_t metaMethodOptionsOffset; + uint32_t queueNamesSize; + uint32_t queueNamesOffset; + uint32_t methodNamesSize; + uint32_t methodNamesOffset; + uint32_t metaMethodNamesSize; + uint32_t metaMethodNamesOffset; + + uint64_t flags; + + uint64_t resv1[8]; + + uint64_t methodOptions[0]; + uint64_t metaMethodOptions[0]; + + char dispatchNames[0]; + char methodNames[0]; + char metaMethodNames[0]; +}; + +#endif /* _IORPC_H */ diff --git a/QualcommWireless/include/IOKit/IORangeAllocator.h b/QualcommWireless/include/IOKit/IORangeAllocator.h new file mode 100644 index 0000000..e7b0472 --- /dev/null +++ b/QualcommWireless/include/IOKit/IORangeAllocator.h @@ -0,0 +1,170 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. + * + * + * HISTORY + * + * sdouglas 05 Nov 99 - created. + */ + +#ifndef _IOKIT_IORANGEALLOCATOR_H +#define _IOKIT_IORANGEALLOCATOR_H + +#include +#include + +typedef IOByteCount IORangeScalar; + +/*! @class IORangeAllocator + * @abstract A utility class to manage allocations from a range. + * @discussion The IORangeAllocator class provides functions for allocating ranges, at a fixed or any offset, and freeing them back to a free list. It is useful for describing ranges of memory or address space without requiring storage in the memory - information describing the free elements is kept elsewhere. Ranges are described by a start offset and a size. IORangeAllocator is optionally protected against multithreaded access. + */ + +class IORangeAllocator : public OSObject { + OSDeclareDefaultStructors(IORangeAllocator); + +protected: + UInt32 numElements; + UInt32 capacity; + UInt32 capacityIncrement; + IORangeScalar defaultAlignmentMask; + IOOptionBits options; + + struct IORangeAllocatorElement * elements; + +private: + virtual bool allocElement( UInt32 index ); + + virtual void deallocElement( UInt32 index ); + +public: + enum { + kLocking = 0x00000001 + }; + +/*! @function init + * @abstract Standard initializer for IORangeAllocator. + * @discussion This method initializes an IORangeAllocator and optionally sets the free list to contain one fragment, from zero to an endOfRange parameter. The capacity in terms of free fragments and locking options are set for the instance. + * @param endOfRange If the free list is to contain an initial fragment, set endOfRange to the last offset in the range, ie. size - 1, to create a free fragment for the range zero to endOfRange inclusive. If zero is passed, the free list will be initialized empty, and can be populated with calls to the deallocate method. + * @param defaultAlignment If this parameter is non-zero it specifies a required alignment for all allocations, for example pass 256 to align allocations on 256 byte boundaries. Zero or one specify unaligned allocations. + * @param capacity Sets the initial size of the free list in number of noncontiguous fragments. This value is also used for the capacityIncrement. + * @param options Pass kLocking if the instance can be used by multiple threads. + * @result Returns true if the instance is successfully initialized, false on failure. */ + + virtual bool init( IORangeScalar endOfRange, + IORangeScalar defaultAlignment, + UInt32 capacity, + IOOptionBits options ); + +/*! @function withRange + * @abstract Standard factory method for IORangeAllocator. + * @discussion This method allocates and initializes an IORangeAllocator and optionally sets the free list to contain one fragment, from zero to an endOfRange parameter. The capacity in terms of free fragments and locking options are set for the instance. + * @param endOfRange If the free list is to contain an initial fragment, set endOfRange to the last offset in the range, ie. size - 1, to create a free fragment for the range zero to endOfRange inclusive. If zero is passed the free list will be initialized empty, and can be populated with calls to the deallocate method. + * @param defaultAlignment If this parameter is non-zero it specifies a required alignment for all allocations, for example pass 256 to align allocations on 256 byte boundaries. Zero or one specify unaligned allocations. + * @param capacity Sets the initial size of the free list in number of non-contiguous fragments. This value is also used for the capacityIncrement. + * @param options Pass kLocking if the instance can be used by multiple threads. + * @result Returns the new IORangeAllocator instance, to be released by the caller, or zero on failure. */ + + static IORangeAllocator * withRange( IORangeScalar endOfRange, + IORangeScalar defaultAlignment = 0, + UInt32 capacity = 0, + IOOptionBits options = 0 ); + + virtual void free() APPLE_KEXT_OVERRIDE; + virtual bool serialize(OSSerialize *s) const APPLE_KEXT_OVERRIDE; + +/*! @function getFragmentCount + * @abstract Accessor to return the number of free fragments in the range. + * @discussion This method returns a count of free fragments. Each fragment describes a non-contiguous free range - deallocations will merge contiguous fragments together. + * @result Returns the count of free fragments. + */ + + virtual UInt32 getFragmentCount( void ); + +/*! @function getFragmentCapacity + * @abstract Accessor to return the number of free fragments in the range. + * @discussion This method returns the current capacity of the free fragment list. + * @result Returns the current capacity of free fragment list. + */ + + virtual UInt32 getFragmentCapacity( void ); + +/*! @function setFragmentCapacityIncrement + * @abstract Sets the count of fragments the free list will increase by when full. + * @discussion This method sets the number of extra fragments the free list will expand to when full. It defaults to the initial capacity. + * @param count The number of fragments to increment the capacity by when the free list is full. + */ + + virtual void setFragmentCapacityIncrement( UInt32 count ); + +/*! @function getFreeCount + * @abstract Totals the sizes of the free fragments. + * @discussion This method returns the total of the sizes of the fragments on the free list. + * @result Returns the total of the free fragments sizes. + */ + + virtual IORangeScalar getFreeCount( void ); + +/*! @function allocate + * @abstract Allocates from the free list, at any offset. + * @discussion This method allocates a range from the free list. The alignment will default to the alignment set when the allocator was created or may be set here. + * @param size The size of the range requested. + * @param result The beginning of the range allocated is returned here on success. + * @param alignment If zero is passed, default to the allocators alignment, otherwise pass an alignment required for the allocation, for example 4096 to page align. + * @result Returns true if the allocation was successful, else false. + */ + + virtual bool allocate( IORangeScalar size, + IORangeScalar * result, + IORangeScalar alignment = 0 ); + +/*! @function allocateRange + * @abstract Allocates from the free list, at a set offset. + * @discussion This method allocates a range from the free list, given a set offset passed in. + * @param start The beginning of the range requested. + * @param size The size of the range requested. + * @result Returns true if the allocation was successful, else false. + */ + + virtual bool allocateRange( IORangeScalar start, + IORangeScalar size ); + +/*! @function deallocate + * @abstract Deallocates a range to the free list. + * @discussion This method deallocates a range to the free list, given a the start offset and length passed in. + * @param start The beginning of the range requested. + * @param size Returns the size of the range requested. + */ + + virtual void deallocate( IORangeScalar start, + IORangeScalar size ); +}; + +#endif /* _IOKIT_IORANGEALLOCATOR_H */ diff --git a/QualcommWireless/include/IOKit/IORegistryEntry.h b/QualcommWireless/include/IOKit/IORegistryEntry.h new file mode 100644 index 0000000..a590e92 --- /dev/null +++ b/QualcommWireless/include/IOKit/IORegistryEntry.h @@ -0,0 +1,955 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOREGISTRYENTRY_H +#define _IOKIT_IOREGISTRYENTRY_H + +#include +#include + + +extern const OSSymbol * gIONameKey; +extern const OSSymbol * gIOLocationKey; +extern const OSSymbol * gIORegistryEntryIDKey; +extern const OSSymbol * gIORegistryEntryPropertyKeysKey; + +class IORegistryEntry; +class IORegistryPlane; +class IORegistryIterator; + +typedef void (*IORegistryEntryApplierFunction)(IORegistryEntry * entry, + void * context); + +enum { + kIORegistryIterateRecursively = 0x00000001, + kIORegistryIterateParents = 0x00000002, +}; + + +/*! @class IORegistryEntry : public OSObject + * @abstract The base class for all objects in the registry. + * @discussion The IORegistryEntry base class provides functions for describing graphs of connected registry entries, each with a dictionary-based property table. Entries may be connected in different planes, with differing topologies. Access to the registry is protected against multiple threads. Inside the kernel planes are specified with plane objects and are published by the creator - IOService exports the gIOServicePlane plane object for example. Non kernel clients specify planes by their name. + */ + +class IORegistryEntry : public OSObject +{ + friend class IORegistryIterator; + + OSDeclareDefaultStructors(IORegistryEntry); + +protected: +/*! @struct ExpansionData + * @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData; + +/*! @var reserved + * Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +private: + + OSDictionary * fRegistryTable; + OSDictionary * fPropertyTable; + +public: +/* methods available in Mac OS X 10.1 or later */ + +/*! @function copyProperty + * @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. Available in Mac OS X 10.1 or later. + * @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + * @param aKey The property's name as a C-string. + * @param plane The plane to iterate over, eg. gIOServicePlane. + * @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + * @result The property value found, or zero. A reference on any found property is returned to caller, which should be released. */ + + virtual OSObject * copyProperty( const char * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function copyProperty + * @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. Available in Mac OS X 10.1 or later. + * @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + * @param aKey The property's name as an OSString. + * @param plane The plane to iterate over, eg. gIOServicePlane. + * @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + * @result The property value found, or zero. A reference on any found property is returned to caller, which should be released. */ + + virtual OSObject * copyProperty( const OSString * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function copyProperty + * @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. Available in Mac OS X 10.1 or later. + * @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + * @param aKey The property's name as an OSSymbol. + * @param plane The plane to iterate over, eg. gIOServicePlane. + * @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + * @result The property value found, or zero. A reference on any found property is returned to caller, which should be released. */ + + virtual OSObject * copyProperty( const OSSymbol * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function copyParentEntry + * @abstract Returns an registry entry's first parent entry in a plane. Available in Mac OS X 10.1 or later. + * @discussion This function will return the parent to which a registry entry was first attached. Since the majority of registry entrys have only one provider, this is a useful simplification. + * @param plane The plane object. + * @result Returns the first parent of the registry entry, or zero if the entry is not attached into the registry in that plane. A reference on the entry is returned to caller, which should be released. */ + + virtual IORegistryEntry * copyParentEntry( const IORegistryPlane * plane ) const; + +/*! @function copyChildEntry + * @abstract Returns an registry entry's first child entry in a plane. Available in Mac OS X 10.1 or later. + * @discussion This function will return the child which first attached to a registry entry. + * @param plane The plane object. + * @result Returns the first child of the registry entry, or zero if the entry is not attached into the registry in that plane. A reference on the entry is returned to caller, which should be released. */ + + virtual IORegistryEntry * copyChildEntry( const IORegistryPlane * plane ) const; + +/* method available in Mac OS X 10.4 or later */ +/*! + * @typedef Action + * @discussion Type and arguments of callout C function that is used when + * a runCommand is executed by a client. Cast to this type when you want a C++ + * member function to be used. Note the arg1 - arg3 parameters are passed straight pass through to the action callout. + * @param target + * Target of the function, can be used as a refcon. Note if a C++ function + * was specified, this parameter is implicitly the first parameter in the target + * member function's parameter list. + * @param arg0 Argument to action from run operation. + * @param arg1 Argument to action from run operation. + * @param arg2 Argument to action from run operation. + * @param arg3 Argument to action from run operation. + */ + typedef IOReturn (*Action)(OSObject *target, + void *arg0, void *arg1, + void *arg2, void *arg3); + +/*! @function runPropertyAction + * @abstract Single thread a call to an action w.r.t. the property lock + * @discussion Client function that causes the given action to be called in a manner that syncrhonises with the registry iterators and serialisers. This functin can be used to synchronously manipulate the property table of this nub + * @param action Pointer to function to be executed in work-loop context. + * @param arg0 Parameter for action parameter, defaults to 0. + * @param arg1 Parameter for action parameter, defaults to 0. + * @param arg2 Parameter for action parameter, defaults to 0. + * @param arg3 Parameter for action parameter, defaults to 0. + * @result Returns the value of the Action callout. + */ + virtual IOReturn runPropertyAction(Action action, OSObject *target, + void *arg0 = NULL, void *arg1 = NULL, + void *arg2 = NULL, void *arg3 = NULL); + +#ifdef __BLOCKS__ + typedef IOReturn (^ActionBlock)(void); + IOReturn runPropertyActionBlock(ActionBlock block); +#endif /* __BLOCKS__ */ + +private: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IORegistryEntry, 0); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 1); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 2); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 3); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 4); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 5); +#else + OSMetaClassDeclareReservedUsed(IORegistryEntry, 0); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 1); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 2); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 3); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 4); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 5); +#endif + OSMetaClassDeclareReservedUnused(IORegistryEntry, 6); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 7); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 8); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 9); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 10); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 11); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 12); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 13); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 14); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 15); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 16); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 17); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 18); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 19); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 20); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 21); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 22); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 23); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 24); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 25); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 26); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 27); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 28); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 29); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 30); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 31); + +public: + +/* Registry accessors */ + +/*! @function getRegistryRoot + * @abstract Returns a pointer to the root instance of the registry. + * @discussion This method provides an accessor to the root of the registry for the machine. The root may be passed to a registry iterator when iterating a plane, and contains properties that describe the available planes, and diagnostic information for IOKit. Keys for these properties are in IOKitKeys.h. + * @result A pointer to the IORegistryEntry root instance. It should not be released by the caller. */ + + static IORegistryEntry * getRegistryRoot( void ); + +/*! @function getGenerationCount + * @abstract Returns an generation count for all registry changing operations. + * @discussion This method provides an accessor to the current generation count (or seed) of the registry which changes when any topology change occurs in the registry - this does not include property table changes. It may be used to invalidate any caching of the results from IORegistryEntry methods. + * @result An integer generation count. */ + + static SInt32 getGenerationCount( void ); + +/*! @function getPlane + * @abstract Looks up the plane object by a C-string name. + * @discussion Planes are usually provided as globals by the creator, eg. gIOServicePlane, gIODeviceTreePlane, or gIOAudioPlane, however they may also be looked up by name with this method. + * @result A pointer to the plane object, or zero if no such plane exists. The returned plane should not be released. */ + + static const IORegistryPlane * getPlane( const char * name ); + +/* Registry Entry allocation & init */ + +/*! @function init + * @abstract Standard init method for all IORegistryEntry subclasses. + * @discussion A registry entry must be initialized with this method before it can be used. A property dictionary may passed and will be retained by this method for use as the registry entry's property table, or an empty one will be created. + * @param dictionary A dictionary that will become the registry entry's property table (retaining it), or zero which will cause an empty property table to be created. + * @result true on success, or false on a resource failure. */ + + virtual bool init( OSDictionary * dictionary = NULL ); + +/*! @function free + * @abstract Standard free method for all IORegistryEntry subclasses. + * @discussion This method will release any resources of the entry, in particular its property table. Note that the registry entry must always be detached from the registry before free may be called, and subclasses (namely IOService) will have additional protocols for removing registry entries. free should never need be called directly. */ + + virtual void free( void ) APPLE_KEXT_OVERRIDE; + +/*! @function setPropertyTable + * @abstract Replace a registry entry's property table. + * @discussion This method will release the current property table of a the entry and replace it with another, retaining the new property table. + * @param dict The new dictionary to be used as the entry's property table. */ + + virtual void setPropertyTable( OSDictionary * dict ); + +/* Synchronized property accessors; wrappers to OSDictionary + * plus property creation helpers */ + +/*! @function setProperty + * @abstract Synchronized method to add a property to a registry entry's property table. + * @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + * @param aKey The properties name as an OSSymbol. + * @param anObject The property value. + * @result true on success or false on a resource failure. */ + + virtual bool setProperty(const OSSymbol * aKey, + OSObject * anObject); + + +/*! @function setProperty + * @abstract Synchronized method to add a property to a registry entry's property table. + * @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + * @param aKey The property's name as an OSString. + * @param anObject The property value. + * @result true on success or false on a resource failure. */ + + virtual bool setProperty(const OSString * aKey, OSObject * anObject); + +/*! @function setProperty + * @abstract Synchronized method to add a property to a registry entry's property table. + * @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + * @param aKey The property's name as a C-string. + * @param anObject The property value. + * @result true on success or false on a resource failure. */ + + virtual bool setProperty(const char * aKey, OSObject * anObject); + +/*! @function setProperty + * @abstract Synchronized method to construct and add a OSString property to a registry entry's property table. + * @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSString from the supplied C-string, set in the property table with the given name, and released. + * @param aKey The property's name as a C-string. + * @param aString The property value as a C-string. + * @result true on success or false on a resource failure. */ + + virtual bool setProperty(const char * aKey, const char * aString); + +/*! @function setProperty + * @abstract Synchronized method to construct and add an OSBoolean property to a registry entry's property table. + * @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSBoolean from the supplied value, set in the property table with the given name, and released. + * @param aKey The property's name as a C-string. + * @param aBoolean The property's boolean value. + * @result true on success or false on a resource failure. */ + + virtual bool setProperty(const char * aKey, bool aBoolean); + +/*! @function setProperty + * @abstract Synchronized method to construct and add an OSNumber property to a registry entry's property table. + * @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSNumber from the supplied value and size, set in the property table with the given name, and released. + * @param aKey The property's name as a C-string. + * @param aValue The property's numeric value. + * @param aNumberOfBits The property's size in bits, for OSNumber. + * @result true on success or false on a resource failure. */ + + virtual bool setProperty( const char * aKey, + unsigned long long aValue, + unsigned int aNumberOfBits); + +/*! @function setProperty + * @abstract Synchronized method to construct and add an OSData property to a registry entry's property table. + * @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSData copied from the supplied data and length, set in the property table with the given name, and released. + * @param aKey The property's name as a C-string. + * @param bytes The property's value as a pointer. OSData will copy this data. + * @param length The property's size in bytes, for OSData. + * @result true on success or false on a resource failure. */ + + virtual bool setProperty( const char * aKey, + void * bytes, + unsigned int length); + +/*! @function removeProperty + * @abstract Synchronized method to remove a property from a registry entry's property table. + * @discussion This method will remove a property from a registry entry's property table, using the OSDictionary::removeObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + * @param aKey The property's name as an OSSymbol. */ + + virtual void removeProperty( const OSSymbol * aKey); + +/*! @function removeProperty + * @abstract Synchronized method to remove a property from a registry entry's property table. + * @discussion This method will remove a property from a registry entry's property table, using the OSDictionary::removeObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + * @param aKey The property's name as an OSString. */ + + virtual void removeProperty( const OSString * aKey); + +/*! @function removeProperty + * @abstract Synchronized method to remove a property from a registry entry's property table. + * @discussion This method will remove a property from a registry entry's property table, using the OSDictionary::removeObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + * @param aKey The property's name as a C-string. */ + + virtual void removeProperty( const char * aKey); + +/*! @function getProperty + * @abstract Synchronized method to obtain a property from a registry entry's property table. + * @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + * @param aKey The property's name as an OSSymbol. + * @result The property value found, or zero. */ + + virtual OSObject * getProperty( const OSSymbol * aKey) const; + +/*! @function getProperty + * @abstract Synchronized method to obtain a property from a registry entry's property table. + * @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + * @param aKey The property's name as an OSString. + * @result The property value found, or zero. */ + + virtual OSObject * getProperty( const OSString * aKey) const; + +/*! @function getProperty + * @abstract Synchronized method to obtain a property from a registry entry's property table. + * @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + * @param aKey The property's name as a C-string. + * @result The property value found, or zero. */ + + virtual OSObject * getProperty( const char * aKey) const; + +/*! @function getProperty + * @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. + * @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + * @param aKey The property's name as an OSSymbol. + * @param plane The plane to iterate over, eg. gIOServicePlane. + * @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + * @result The property value found, or zero. */ + + virtual OSObject * getProperty( const OSSymbol * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function getProperty + * @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. + * @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + * @param aKey The property's name as an OSString. + * @param plane The plane to iterate over, eg. gIOServicePlane. + * @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + * @result The property value found, or zero. */ + + virtual OSObject * getProperty( const OSString * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function getProperty + * @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. + * @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + * @param aKey The property's name as a C-string. + * @param plane The plane to iterate over, eg. gIOServicePlane. + * @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + * @result The property value found, or zero. */ + + virtual OSObject * getProperty( const char * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function copyProperty + * @abstract Synchronized method to obtain a property from a registry entry's property table. + * @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics, and return a reference to the caller. This method is synchronized with other IORegistryEntry accesses to the property table. + * @param aKey The property's name as an OSSymbol. + * @result The property value found, or zero. It should be released by the caller. */ + + virtual OSObject * copyProperty( const OSSymbol * aKey) const; + +/*! @function copyProperty + * @abstract Synchronized method to obtain a property from a registry entry's property table. + * @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics, and return a reference to the caller. This method is synchronized with other IORegistryEntry accesses to the property table. + * @param aKey The property's name as an OSString. + * @result The property value found, or zero. It should be released by the caller. */ + + virtual OSObject * copyProperty( const OSString * aKey) const; + +/*! @function copyProperty + * @abstract Synchronized method to obtain a property from a registry entry's property table. + * @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics, and return a reference to the caller. This method is synchronized with other IORegistryEntry accesses to the property table. + * @param aKey The property's name as a C-string. + * @result The property value found, or zero. It should be released by the caller. */ + + virtual OSObject * copyProperty( const char * aKey) const; + +/*! @function dictionaryWithProperties + * @abstract Synchronized method to obtain copy a registry entry's property table. + * @discussion This method will copy a registry entry's property table, using the OSDictionary::withDictionary semantics. This method is synchronized with other IORegistryEntry accesses to the property table. Since OSDictionary will only copy property values by reference, synchronization is not guaranteed to any collection values. + * @result The created dictionary, or zero on a resource value. It should be released by the caller. */ + + virtual OSDictionary * dictionaryWithProperties( void ) const; + +/*! @function serializeProperties + * @abstract Synchronized method to serialize a registry entry's property table. + * @discussion This method will serialize a registry entry's property table, using the OSDictionary::serialize semantics. This method is synchronized with other IORegistryEntry accesses to the property table. Many non-kernel clients of IOKit read information from the registry via properties, and will invoke this method in a registry entry to create a serialization of all the entry's properties, which is then reconstructed in the client's task as a CFDictionary. This method may be intercepted by subclasses to update their properties or implement a different serialization method, though it is usually better to implement such functionality by creating objects in the property table and implementing their serialize methods, avoiding any need to implement serializeProperties. + * @param serialize The OSSerialize instance representing the serialization request. + * @result True on success, false otherwise. */ + + virtual bool serializeProperties( OSSerialize * serialize ) const; + +/* Unsynchronized(!) property table access */ + +/*! @function getPropertyTable + * @abstract Unsynchronized accessor to a registry entry's property table. + * @discussion This method will return a pointer to the live property table as an OSDictionery. Its use is not recommended in most cases, instead use the synchronized accessors and helper functions of IORegistryEntry to access properties. It can only safely be used by one thread, which usually means it can only be used before a registry entry is entered into the registry. + * @result A pointer to the property table as an OSDictionary. The pointer is valid while the registry entry is retained, and should not be released by the caller. */ + +/* inline */ OSDictionary * getPropertyTable( void ) const; +/* { return(fPropertyTable); } */ + +/* Set properties from user level, to be overridden if supported */ + +/*! @function setProperties + * @abstract Optionally supported external method to set properties in a registry entry. + * @discussion This method is not implemented by IORegistryEntry, but is available to kernel and non-kernel clients to set properties in a registry entry. IOUserClient provides connection based, more controlled access to this functionality and may be more appropriate for many uses, since there is no differentiation between clients available to this method. + * @param properties Any OSObject subclass, to be interpreted by the implementing method - for example an OSDictionary, OSData etc. may all be appropriate. + * @result An IOReturn code to be returned to the caller. */ + + virtual IOReturn setProperties( OSObject * properties ); + +/* Topology */ + +/*! @function getParentIterator + * @abstract Returns an iterator over an registry entry's parent entries in a specified plane. + * @param plane The plane object. + * @result Returns an iterator over the parents of the registry entry, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, though they may no longer be attached during the iteration. */ + + virtual OSIterator * getParentIterator( const IORegistryPlane * plane ) + const; + virtual void applyToParents( IORegistryEntryApplierFunction applier, + void * context, + const IORegistryPlane * plane ) const; + +/*! @function getParentEntry + * @abstract Returns an registry entry's first parent entry in a plane. + * @discussion This function will return the parent to which a registry entry was first attached. Since the majority of registry entrys have only one provider, this is a useful simplification. + * @param plane The plane object. + * @result Returns the first parent of the registry entry, or zero if the entry is not attached into the registry in that plane. The parent is retained while the entry is attached, and should not be released by the caller. */ + + virtual IORegistryEntry * getParentEntry( const IORegistryPlane * plane ) const; + +/*! @function getChildIterator + * @abstract Returns an iterator over an registry entry's child entries in a plane. + * @discussion This method creates an iterator which will return each of a registry entry's child entries in a specified plane. + * @param plane The plane object. + * @result Returns an iterator over the children of the entry, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, though they may no longer be attached during the iteration. */ + + virtual OSIterator * getChildIterator( const IORegistryPlane * plane ) + const; + + + virtual void applyToChildren( IORegistryEntryApplierFunction applier, + void * context, + const IORegistryPlane * plane ) const; + +/*! @function getChildEntry + * @abstract Returns an registry entry's first child entry in a plane. + * @discussion This function will return the child which first attached to a registry entry. + * @param plane The plane object. + * @result Returns the first child of the registry entry, or zero if the entry is not attached into the registry in that plane. The child is retained while the entry is attached, and should not be released by the caller. */ + + virtual IORegistryEntry * getChildEntry( const IORegistryPlane * plane ) const; + +/*! @function isChild + * @abstract Determines whether a registry entry is the child of another in a plane. + * @discussion This method called in the parent entry determines if the specified entry is a child, in a plane. Additionally, it can check if the child is the only child of the parent entry. + * @param child The possible child registry entry. + * @param plane The plane object. + * @param onlyChild If true, check also if the child is the only child. + * @result If the child argument is not a child of the registry entry, false is returned. If onlyChild is true and the child is not the only child of the entry, false is returned, otherwise true is returned. */ + + virtual bool isChild( IORegistryEntry * child, + const IORegistryPlane * plane, + bool onlyChild = false ) const; + +/*! @function isParent + * @abstract Determines whether a registry entry is the parent of another in a plane. + * @discussion This method called in the child entry determines if the specified entry is a parent, in a plane. Additionally, it can check if the parent is the only parent of the child entry. + * @param parent The possible parent registry entry. + * @param plane The plane object. + * @param onlyParent If true, check also if the parent is the only parent. + * @result If the parent argument is not a parent of the registry entry, false is returned. If onlyParent is true and the parent is not the only parent of the entry, false is returned, otherwise true is returned. */ + + virtual bool isParent( IORegistryEntry * parent, + const IORegistryPlane * plane, + bool onlyParent = false ) const; + +/*! @function inPlane + * @abstract Determines whether a registry entry is attached in a plane. + * @discussion This method determines if the entry is attached in a plane to any other entry. It can also be used to determine if the entry is a member of any plane. + * @param plane The plane object, 0 indicates any plane. + * @result If the entry has a parent in the given plane or if plane = 0 then if entry has any parent; return true, otherwise false. */ + + virtual bool inPlane( const IORegistryPlane * plane = NULL) const; + +/*! @function getDepth + * @abstract Counts the maximum number of entries between an entry and the registry root, in a plane. + * @discussion This method counts the number of entries between and entry and the registry root, in a plane, for each parent of the entry and returns the maximum value. + * @param plane The plane object. + * @result The maximum number of entries between the entry and the root. Zero is returned if the entry is not attached in the plane. */ + + virtual unsigned int getDepth( const IORegistryPlane * plane ) const; + +/* Attach / detach */ + +/*! @function attachToParent + * @abstract Attaches a entry to a parent entry in a plane. + * @discussion This is the usual method of entering an entry into the registry. It is a no-op and success if the entry is already attached to the parent. Attaching the entry into the registry retains both the child and parent while they are attached. This method will call attachToChild in the parent entry if it is not being called from attachToChild. + * @param parent The registry entry to attach to. + * @param plane The plane object. + * @result true on success, or false on a resource failure, or if the parent is the same as the child. */ + + virtual bool attachToParent( IORegistryEntry * parent, + const IORegistryPlane * plane ); + +/*! @function detachFromParent + * @abstract Detaches an entry from a parent entry in a plane. + * @discussion This is the usual method of removing an entry from the registry. It is a no-op if the entry is not attached to the parent. Detaching the entry will release both the child and parent. This method will call detachFromChild in the parent entry if it is not being called from detachFromChild. + * @param parent The registry entry to detach from. + * @param plane The plane object. */ + + virtual void detachFromParent( IORegistryEntry * parent, + const IORegistryPlane * plane ); + +/*! @function attachToChild + * @abstract Method called in the parent entry when a child attaches. + * @discussion This method is called in the parent entry when a child attaches, to make overrides possible. This method will also call attachToParent in the child entry if it is not being called from attachToParent. It is a no-op and success if the entry is already a child. Attaching the entry into the registry retains both the child and parent while they are attached. + * @param child The registry entry being attached. + * @param plane The plane object. + * @result true on success, or false on a resource failure, or if the parent is the same as the child. */ + + virtual bool attachToChild( IORegistryEntry * child, + const IORegistryPlane * plane ); + +/*! @function detachFromChild + * @abstract Detaches a child entry from its parent in a plane. + * @discussion This method is called in the parent entry when a child detaches, to make overrides possible. It is a no-op if the entry is not a child of the parent. Detaching the entry will release both the child and parent. This method will call detachFromParent in the child entry if it is not being called from detachFromParent. + * @param child The registry entry to detach. + * @param plane The plane object. */ + + virtual void detachFromChild( IORegistryEntry * child, + const IORegistryPlane * plane ); + +/*! @function detachAbove + * @abstract Detaches an entry from all its parent entries in a plane. + * @discussion This method calls detachFromParent in the entry for each of its parent entries in the plane. + * @param plane The plane object. */ + + virtual void detachAbove( const IORegistryPlane * plane ); + +/*! @function detachAll + * @abstract Detaches an entry and all its children recursively in a plane. + * @discussion This method breaks the registry connections for a subtree. detachAbove is called in the entry, and all child entries and their children in the plane. + * @param plane The plane object. */ + + virtual void detachAll( const IORegistryPlane * plane ); + +/* Name, location and path accessors */ + +/*! @function getName + * @abstract Returns the name assigned to the registry entry as a C-string. + * @discussion Entries can be named in a particular plane, or globally. If the entry is named in plane and the plane is specified that name will be returned, otherwise the global name is returned. The global name defaults to the entry's meta class name if it has not been named. + * @param plane The plane object, or zero for the global name. + * @result A C-string name, valid while the entry is retained. */ + + virtual const char * getName( const IORegistryPlane * plane = NULL ) const; + +/*! @function copyName + * @abstract Returns the name assigned to the registry entry as an OSSymbol. + * @discussion Entries can be named in a particular plane, or globally. If the entry is named in plane and the plane is specified that name will be returned, otherwise the global name is returned. The global name defaults to the entry's meta class name if it has not been named. + * @param plane The plane object, or zero for the global name. + * @result A reference to an OSSymbol for the name, which should be released by the caller. */ + + virtual const OSSymbol * copyName( + const IORegistryPlane * plane = NULL ) const; + +/*! @function compareNames + * @abstract Compares the name of the entry with one or more names, and optionally returns the matching name. + * @discussion This method is called during IOService name matching and elsewhere to compare the entry's global name with a list of names, or a single name. A list of names may be passed as any OSCollection of OSStrings, while a single name may be passed an OSString, in the name parameter. compareNames will call the compareName method for each name, for overrides. + * @param name The name or names to compare with as any OSCollection (eg. OSArray, OSSet, OSDictionary) of OSStrings, or a single name may be passed an OSString. + * @param matched If the caller wants the successfully matched name returned, pass a non-zero pointer for the matched parameter and an OSString will be returned here. It should be released by the caller. + * @result True if one of the names compared true with the entry's global name. */ + + virtual bool compareNames( OSObject * name, OSString ** matched = NULL ) const; + +/*! @function compareName + * @abstract Compares the name of the entry with one name, and optionally returns the matching name. + * @discussion This method is called during IOService name matching and elsewhere from the compareNames method. It should be overridden to provide non-standard name matching. + * @param name The name to compare with as an OSString. + * @param matched If the caller wants the successfully matched name returned, pass a non-zero pointer for the matched parameter and an OSString will be returned here. It should be released by the caller. Generally, this will be the same as the name parameter, but may not be if wildcards are used. + * @result True if the name compared true with the entry's global name. */ + + virtual bool compareName( OSString * name, OSString ** matched = NULL ) const; + +/*! @function setName + * @abstract Sets a name for the registry entry, in a particular plane, or globally. + * @discussion Entries can be named in a particular plane, or globally. If the plane is specified the name applies only to that plane, otherwise the global name is set. The global name defaults to the entry's meta class name if it has not been named. + * @param name An OSSymbol which will be retained. + * @param plane The plane object, or zero to set the global name. */ + + virtual void setName( const OSSymbol * name, + const IORegistryPlane * plane = NULL ); + +/*! @function setName + * @abstract Sets a name for the registry entry, in a particular plane, or globally. + * @discussion Entries can be named in a particular plane, or globally. If the plane is specified the name applies only to that plane, otherwise the global name is set. The global name defaults to the entry's meta class name if it has not been named. + * @param name A const C-string name which will be copied. + * @param plane The plane object, or zero to set the global name. */ + + virtual void setName( const char * name, + const IORegistryPlane * plane = NULL ); + +/*! @function getLocation + * @abstract Returns the location string assigned to the registry entry as a C-string. + * @discussion Entries can given a location string in a particular plane, or globally. If the entry has had a location set in a plane and the plane is specified that location string will be returned, otherwise the global location string is returned. If no global location string has been set, zero is returned. + * @param plane The plane object, or zero for the global name. + * @result A C-string location string, valid while the entry is retained, or zero. */ + + virtual const char * getLocation( const IORegistryPlane * plane = NULL ) const; + +/*! @function copyLocation + * @abstract Returns the location string assigned to the registry entry as an OSSymbol. + * @discussion Entries can given a location string in a particular plane, or globally. If the entry has had a location set in a plane and the plane is specified that location string will be returned, otherwise the global location string is returned. If no global location string has been set, zero is returned. + * @param plane The plane object, or zero for the global name. + * @result A reference to an OSSymbol for the location if one exists, which should be released by the caller, or zero. */ + + virtual const OSSymbol * copyLocation( + const IORegistryPlane * plane = NULL ) const; + +/*! @function setLocation + * @abstract Sets a location string for the registry entry, in a particular plane, or globally. + * @discussion Entries can be given a location string in a particular plane, or globally. If the plane is specified the location applies only to that plane, otherwise the global location is set. The location string may be used during path lookups of registry entries, to distinguish between sibling entries with the same name. The default IORegistryEntry parsing of location strings expects a list of hex numbers separated by commas, though subclasses of IORegistryEntry might do their own parsing. + * @param location A C-string location string which will be copied, or an OSSymbol which will be retained. + * @param plane The plane object, or zero to set the global location string. */ + + virtual void setLocation( const OSSymbol * location, + const IORegistryPlane * plane = NULL ); + virtual void setLocation( const char * location, + const IORegistryPlane * plane = NULL ); + +/*! @function getPath + * @abstract Create a path for a registry entry. + * @discussion The path for a registry entry is copied to the caller's buffer. The path describes the entry's attachment in a particular plane, which must be specified. The path begins with the plane name followed by a colon, and then followed by '/' separated path components for each of the entries between the root and the registry entry. Each component is constructed with the getPathComponent method called in each entry. An alias may also exist for the entry, which are described as properties in a registry entry found at /aliases in the plane. If a property value interpreted as a path in a call to IORegistryEntry::fromPath yields the entry, then the property name is used as the entry's path. + * @param path A char buffer allocated by the caller. + * @param length An in/out parameter - the caller sets the length of the buffer available, and getPath returns the total length of the path copied to the buffer. + * @param plane The plane object. + * @result getPath will fail if the entry is not attached in the plane, or if the buffer is not large enough to contain the path. */ + + virtual bool getPath( char * path, int * length, + const IORegistryPlane * plane) const; + +/*! @function getPathComponent + * @abstract Create a path component for a registry entry. + * @discussion Each component of a path created with getPath is created with getPathComponent. The default implementation concatenates the entry's name in the the plane, with the "at" symbol and the location string of the entry in the plane if it has been set. + * @param path A char buffer allocated by the caller. + * @param length An in/out parameter - the caller sets the length of the buffer available, and getPathComponent returns the total length of the path component copied to the buffer. + * @param plane The plane object. + * @result true if the path fits into the supplied buffer or false on a overflow. */ + + virtual bool getPathComponent( char * path, int * length, + const IORegistryPlane * plane ) const; + +/*! @function fromPath + * @abstract Looks up a registry entry by path. + * @discussion This function parses paths to lookup registry entries. The path may begin with the : created by getPath, or the plane may be set by the caller. If there are characters remaining unparsed after an entry has been looked up, this may be considered an invalid lookup, or those characters may be passed back to the caller and the lookup successful. + * @param path A C-string path. + * @param plane The plane to lookup up the path, or zero, in which case the path must begin with the plane name. + * @param residualPath If the path may contain residual characters after the last path component, the residual will be copied back to the caller's residualPath buffer. If there are residual characters and no residual buffer is specified, fromPath will fail. + * @param residualLength An in/out parameter - the caller sets the length of the residual buffer available, and fromPath returns the total length of the residual path copied to the buffer. If there is no residualBuffer (residualPath = 0) then residualLength may be zero also. + * @param fromEntry The lookup will proceed rooted at this entry if non-zero, otherwise it proceeds from the root of the plane. + * @result A retained registry entry is returned on success, or zero on failure. The caller should release the entry. */ + + static IORegistryEntry * fromPath( const char * path, + const IORegistryPlane * plane = NULL, + char * residualPath = NULL, + int * residualLength = NULL, + IORegistryEntry * fromEntry = NULL ); + +/*! @function fromPath + * @abstract Looks up a registry entry by relative path. + * @discussion This function looks up a entry below the called entry by a relative path. It is just a convenience that calls IORegistryEntry::fromPath with this as the fromEntry parameter. + * @param path See IORegistryEntry::fromPath. + * @param plane See IORegistryEntry::fromPath. + * @param residualPath See IORegistryEntry::fromPath. + * @param residualLength See IORegistryEntry::fromPath. + * @result See IORegistryEntry::fromPath. */ + + virtual IORegistryEntry * childFromPath( const char * path, + const IORegistryPlane * plane = NULL, + char * residualPath = NULL, + int * residualLength = NULL ); + +/*! @function dealiasPath + * @abstract Strips any aliases from the head of path and returns the full path. + * @discussion If the path specified begins with an alias found in the /aliases entry, the value of the alias is returned, and a pointer into the passed in path after the alias is passed back to the caller. If an alias is not found, zero is returned and the path parameter is unchanged. + * @param opath An in/out paramter - the caller passes in a pointer to a C-string pointer to a path. If an alias is found, dealiasPath returns a pointer into the path just beyond the end of the alias. + * @param plane A plane object must be specified. + * @result A C-string pointer to the value of the alias if one is found, or zero if not. */ + + static const char * dealiasPath( const char ** opath, + const IORegistryPlane * plane ); + +/*! @function makePlane + * @abstract Constructs an IORegistryPlane object. + * @discussion Most planes in IOKit are created by the OS, although other planes may be created. + * @param name A C-string name for the new plane, to be copied. + * @result A new instance of an IORegistryPlane, or zero on failure. */ + + static const IORegistryPlane * makePlane( const char * name ); + +/*! @abstract Returns an ID for the registry entry that is global to all tasks. + * @discussion The entry ID returned by getRegistryEntryID can be used to identify a registry entry across all tasks. A registry entry may be looked up by its entry ID by creating a matching dictionary with IORegistryEntryIDMatching() in user space, or IOService::registryEntryIDMatching() in the kernel, to be used with the IOKit matching functions. The ID is valid only until the machine reboots. + * @result An ID for the registry entry, assigned when the entry is first attached in the registry. */ + + uint64_t getRegistryEntryID( void ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* * * * * * * * * * * * internals * * * * * * * * * * * */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + virtual bool init( IORegistryEntry * from, + const IORegistryPlane * inPlane ); + +private: + static LIBKERN_RETURNS_NOT_RETAINED IORegistryEntry * initialize( void ); + + +private: + inline bool arrayMember( OSArray * set, + const IORegistryEntry * member, + unsigned int * index = NULL ) const; + + bool makeLink( IORegistryEntry * to, + unsigned int relation, + const IORegistryPlane * plane ) const; + void breakLink( IORegistryEntry * to, + unsigned int relation, + const IORegistryPlane * plane ) const; + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + OSArray * getParentSetReference( const IORegistryPlane * plane ) + const; + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + OSArray * getChildSetReference( const IORegistryPlane * plane ) + const; + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IORegistryEntry * getChildFromComponent( const char ** path, + const IORegistryPlane * plane ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + LIBKERN_RETURNS_NOT_RETAINED const OSSymbol * hasAlias( + const IORegistryPlane * plane, + char * opath = NULL, int * length = NULL ) const; + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + const char * matchPathLocation( const char * cmp, + const IORegistryPlane * plane ); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @class IORegistryIterator : public OSIterator + * @abstract An iterator over the registry. + * @discussion An iterator that can traverse the children or parents of a registry entry in a plane, and recurse. Access to the registry is protected against multiple threads, but an IORegistryIterator instance is for use by one thread only. */ + +class IORegistryIterator : public OSIterator +{ + OSDeclareAbstractStructors(IORegistryIterator); + +private: + struct IORegCursor { + IORegCursor * next; + IORegistryEntry * current; + OSIterator * iter; + }; + IORegCursor start; + IORegCursor * where; + IORegistryEntry * root; + OSOrderedSet * done; + const IORegistryPlane * plane; + IOOptionBits options; + + virtual void free( void ) APPLE_KEXT_OVERRIDE; + +public: +/*! @function iterateOver + * @abstract Create an iterator rooted at a given registry entry. + * @discussion This method creates an IORegistryIterator that is set up with options to iterate children or parents of a root entry, and to recurse automatically into entries as they are returned, or only when instructed. The iterator object keeps track of entries that have been recursed into previously to avoid loops. + * @param start The root entry to begin the iteration at. + * @param plane A plane object must be specified. + * @param options kIORegistryIterateRecursively may be set to recurse automatically into each entry as it is returned. This option affects the behaviour of the getNextObject method, which is defined in the OSIterator superclass. Other methods will override this behaviour. kIORegistryIterateParents may be set to iterate the parents of each entry, by default the children are iterated. + * @result A created IORegistryIterator instance, to be released by the caller when it has finished with it. */ + + static IORegistryIterator * iterateOver( IORegistryEntry * start, + const IORegistryPlane * plane, + IOOptionBits options = 0 ); + +/*! @function iterateOver + * @abstract Create an iterator rooted at the registry root. + * @discussion This method creates an IORegistryIterator that is set up with options to iterate children of the registry root entry, and to recurse automatically into entries as they are returned, or only when instructed. The iterator object keeps track of entries that have been recursed into previously to avoid loops. + * @param plane A plane object must be specified. + * @param options kIORegistryIterateRecursively may be set to recurse automatically into each entry as it is returned. This option affects the behaviour of the getNextObject method, which is defined in the OSIterator superclass. Other methods will override this behaviour. kIORegistryIterateParents may be set to iterate the parents of each entry, by default the children are iterated. + * @result A created IORegistryIterator instance, to be released by the caller when it has finished with it. */ + + static IORegistryIterator * iterateOver( const IORegistryPlane * plane, + IOOptionBits options = 0 ); + +/*! @function getNextObject + * @abstract Return the next object in the registry iteration. + * @discussion This method calls either getNextObjectFlat or getNextObjectRecursive depending on the options the iterator was created with. This implements the OSIterator defined getNextObject method. The object returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. + * @result The next registry entry in the iteration (the current entry), or zero if the iteration has finished at this level of recursion. The entry returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. */ + + virtual IORegistryEntry * getNextObject( void ) APPLE_KEXT_OVERRIDE; + +/*! @function getNextObjectFlat + * @abstract Return the next object in the registry iteration, ignoring the kIORegistryIterateRecursively option. + * @discussion This method returns the next child, or parent if the kIORegistryIterateParents option was used to create the iterator, of the current root entry. The object returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. + * @result The next registry entry in the iteration (the current entry), or zero if the iteration has finished at this level of recursion, or the iteration is invalid (see isValid). The entry returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. */ + + virtual IORegistryEntry * getNextObjectFlat( void ); + +/*! @function getNextObjectRecursive + * @abstract Return the next object in the registry iteration, and enter it. + * @discussion If the iterator has a current entry, and the iterator has not already entered previously, enterEntry is called to recurse into it, ie. make it the new root, and the next child, or parent if the kIORegistryIterateParents option was used to create the iterator, at this new level of recursion is returned. If there is no current entry at this level of recursion, exitEntry is called and the process repeats, until the iteration returns to the entry the iterator was created with and zero is returned. The object returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. + * @result The next registry entry in the iteration (the current entry), or zero if its finished, or the iteration is invalid (see isValid). The entry returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. */ + + virtual IORegistryEntry * getNextObjectRecursive( void ); + +/*! @function getCurrentEntry + * @abstract Return the current entry in the registry iteration. + * @discussion This method returns the current entry, last returned by getNextObject et al. The object returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. If the iteration is no longer valid (see isValid), the current entry is zero. + * @result The current registry entry in the iteration, or zero if the last iteration returned zero, or the iteration is invalid (see isValid). The entry returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. */ + + virtual IORegistryEntry * getCurrentEntry( void ); + +/*! @function enterEntry + * @abstract Recurse into the current entry in the registry iteration. + * @discussion This method makes the current entry, ie. the last entry returned by getNextObject et al., the root in a new level of recursion. */ + + virtual void enterEntry( void ); + +/*! @function enterEntry + * @abstract Recurse into the current entry in the registry iteration. + * @discussion This method recurses into an entry as with enterEntry, but also switches from the current plane to a new one set by the caller. + * @param plane The new plane to switch into. */ + + virtual void enterEntry( const IORegistryPlane * plane ); + +/*! @function exitEntry + * @abstract Exits a level of recursion, restoring the current entry. + * @discussion This method undoes an enterEntry, restoring the current entry. If there are no more levels of recursion to exit false is returned, otherwise true is returned. + * @result true if a level of recursion was undone, false if no recursive levels are left in the iteration. */ + + virtual bool exitEntry( void ); + +/*! @function reset + * @abstract Exits all levels of recursion, restoring the iterator to its state at creation. + * @discussion This method exits all levels of recursion, and restores the iterator to its state at creation. */ + + virtual void reset( void ) APPLE_KEXT_OVERRIDE; + +/*! @function isValid + * @abstract Checks that no registry changes have invalidated the iteration. + * @discussion If a registry iteration is invalidated by changes to the registry, it will be made invalid, the currentEntry will be considered zero, and further calls to getNextObject et al. will return zero. The iterator should be reset to restart the iteration when this happens. + * @result false if the iterator has been invalidated by changes to the registry, true otherwise. */ + + virtual bool isValid( void ) APPLE_KEXT_OVERRIDE; + +/*! @function iterateAll + * @abstract Iterates all entries (with getNextObject) and returns a set of all returned entries. + * @discussion This method will reset, then iterate all entries in the iteration (with getNextObject). + * @result A set of entries returned by the iteration. The caller should release the set when it has finished with it. Zero is returned on a resource failure. */ + + virtual OSOrderedSet * iterateAll( void ); +}; + +#endif /* _IOKIT_IOREGISTRYENTRY_H */ diff --git a/QualcommWireless/include/IOKit/IOReportHub.h b/QualcommWireless/include/IOKit/IOReportHub.h new file mode 100644 index 0000000..7cbbd5b --- /dev/null +++ b/QualcommWireless/include/IOKit/IOReportHub.h @@ -0,0 +1,54 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOREPORTHUB_H +#define _IOKIT_IOREPORTHUB_H + +#include +#include + +extern IOReturn _getInterests(OSDictionary *, OSArray **, OSArray **, OSArray **); +extern IOReturn _copyServiceGetChannels(OSArray *, OSArray *, OSArray *, UInt32, IOService **, IOReportChannelList **, OSNumber **); + +class IOReportHub : public IOService +{ + OSDeclareDefaultStructors(IOReportHub) + +public: + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual IOReturn getReportBufferSize( OSDictionary * dict, int * size ); + virtual IOReturn getValues( OSDictionary * dict, IOBufferMemoryDescriptor * buffer ); + IOReturn callConfigureReport(OSDictionary *, UInt32, int *); +}; + +#endif diff --git a/QualcommWireless/include/IOKit/IOReportMacros.h b/QualcommWireless/include/IOKit/IOReportMacros.h new file mode 100644 index 0000000..db8e8ae --- /dev/null +++ b/QualcommWireless/include/IOKit/IOReportMacros.h @@ -0,0 +1,705 @@ +/* + * Copyright (c) 2012-2014 Apple Computer, Inc. All Rights Reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOREPORT_MACROS_H_ +#define _IOREPORT_MACROS_H_ + +#include "IOReportTypes.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef IOREPORT_ABORT +#define IOREPORT_ABORT panic +#endif + +/* + * Background + * + * These macros allow non-I/O Kit software to generate IOReporting + * reports. Clients must prevent concurrent access to any given + * report buffer from multiple threads. + * + * While these macros allow non-I/O Kit software to participate + * in IOReporting, an IOService instance must lend its driver ID, + * respond to the appropriate IOService overrides, and shuttle + * data back and forth. In some cases, it may be useful to have + * the I/O Kit driver initialize the report buffer with the + * appropriate macro. + */ + + +/* ----- Reporting Single Integers (SimpleReport) ----- */ + +/* + * The buffer size required for a SimpleReport. + */ + +#define SIMPLEREPORT_BUFSIZE (sizeof(IOReportElement)) + + +/* + * Initialize a buffer to hold a SimpleReport. + * + * void* buffer - ptr to SIMPLEREPORT_BUFSIZE bytes + * size_t bufSize - sanity check of buffer's size + * uint64_t providerID - registry Entry ID of the reporting service + * uint64_t channelID - the report's channel ID + * IOReportCategories categories - categories of this channel + * + * If the buffer is not of sufficient size, the macro calls IOREPORT_ABORT(). + * If that returns, the buffer is left full of '&'. + */ + +#define SIMPLEREPORT_INIT(buf, bufSize, providerID, channelID, cats) \ +do { \ + memset((buf), '&', (bufSize)); \ + IOReportElement *__elem = (IOReportElement *)(buf); \ + IOSimpleReportValues *__vals; \ + if ((bufSize) >= SIMPLEREPORT_BUFSIZE) { \ + __elem->provider_id = (providerID); \ + __elem->channel_id = (channelID); \ + __elem->channel_type.report_format = kIOReportFormatSimple; \ + __elem->channel_type.reserved = 0; \ + __elem->channel_type.categories = (cats); \ + __elem->channel_type.nelements = 1; \ + __elem->channel_type.element_idx = 0; \ + __elem->timestamp = 0; \ + __vals = (IOSimpleReportValues*)&__elem->values; \ + __vals->simple_value = kIOReportInvalidIntValue; \ + } \ + else { \ + IOREPORT_ABORT("bufSize is smaller than the required size\n"); \ + } \ +} while(0) + + +/* + * Set a SimpleReport to a new value. + * + * void* simp_buf - ptr to memory initialized by SIMPLEREPORT_INIT() + * int64_t new_value - new value for the report + */ + +#define SIMPLEREPORT_SETVALUE(simp_buf, new_value) \ +do { \ + IOReportElement *__elem = (IOReportElement *)(simp_buf); \ + IOSimpleReportValues *__vals; \ + __vals = (IOSimpleReportValues*)&__elem->values; \ + __vals->simple_value = (new_value); \ +} while(0) + + +/* + * Increment the value of a SimpleReport. + * + * void* simp_buf - ptr to memory initialized by SIMPLEREPORT_INIT() + * int64_t increment - amount by which to increment the value + */ +#define SIMPLEREPORT_INCREMENTVALUE(simp_buf, new_value) \ +do { \ + IOReportElement *__elem = (IOReportElement *)(simp_buf); \ + IOSimpleReportValues *__vals; \ + __vals = (IOSimpleReportValues*)&__elem->values; \ + __vals->simple_value += (new_value); \ +} while(0) + + +/* + * Prepare a SimpleReport for + * IOService::updateReport(kIOReportCopyChannelData...) + * + * void* simp_buf - Ptr to memory updated by SIMPLEREPORT_SETVALUE() + * void* ptr2cpy - On return, 'ptr2cpy' points to the memory that needs to be + * copied for kIOReportCopyChannelData. + * size_t size2cpy - On return, 'size2cpy' is set to the size of the report + * data that needs to be copied for kIOReportCopyChannelData. + */ + +#define SIMPLEREPORT_UPDATEPREP(simp_buf, ptr2cpy, size2cpy) \ +do { \ + (ptr2cpy) = (simp_buf); \ + (size2cpy) = sizeof(IOReportElement); \ +} while(0) + + +/* + * Update the result field received as a parameter for + * kIOReportGetDimensions & kIOReportCopyChannelData actions. + * + * IOReportConfigureAction action - configure/updateReport() 'action' param + * void* result - configure/updateReport() 'result' param + */ + +#define SIMPLEREPORT_UPDATERES(action, result) \ +do { \ + if (((action) == kIOReportGetDimensions) || ((action) == kIOReportCopyChannelData)) { \ + int *__nElements = (int *)(result); \ + *__nElements += 1; \ + } \ +} while (0) + + +/* + * Get the 64-bit channel ID of a SimpleReport. + * + * void* simp_buf - ptr to memory initialized by SIMPLEREPORT_INIT() + */ + +#define SIMPLEREPORT_GETCHID(simp_buf) \ + (((IOReportElement *)(simp_buf))->channel_id) + +/* + * Get the IOReportChannelType of a SimpleReport. + * + * void* simp_buf - ptr to memory initialized by SIMPLEREPORT_INIT() + */ + +#define SIMPLEREPORT_GETCHTYPE(simp_buf) \ + (*(uint64_t*)&(((IOReportElement *)(simp_buf))->channel_type)) + + +/* + * Get the integer value of a SimpleReport. + * + * void* simp_buf - memory initialized by SIMPLEREPORT_INIT() + */ + +#define SIMPLEREPORT_GETVALUE(simp_buf) \ + (((IOSimpleReportValues*)&(((IOReportElement*)(simp_buf))->values)) \ + ->simple_value) + + +/* ----- State Machine Reporting (StateReport) ----- */ + +// Internal struct for StateReport +typedef struct { + uint16_t curr_state; + uint64_t update_ts; + IOReportElement elem[]; // Array of elements +} IOStateReportInfo; + +/* + * Determine the size required for a StateReport buffer. + * + * int nstates - number of states to be reported + */ +#define STATEREPORT_BUFSIZE(nstates) \ + (sizeof(IOStateReportInfo) + (nstates) * sizeof(IOReportElement)) + + +/* + * Initialize a StateReport buffer. + * + * int nstates - number of states to be reported + * void* buffer - ptr to STATEREPORT_BUFSIZE(nstates) bytes + * size_t bufSize - sanity check of buffer's size + * uint64_t providerID - registry Entry ID of the reporting service + * uint64_t channelID - ID of this channel, see IOREPORT_MAKEID() + * IOReportCategories categories - categories of this channel + * + * If the buffer is not of sufficient size, the macro invokes IOREPORT_ABORT. + * If that returns, the buffer is left full of '&'. + */ +#define STATEREPORT_INIT(nstates, buf, bufSize, providerID, channelID, cats) \ +do { \ + memset((buf), '&', (bufSize)); \ + IOStateReportInfo *__info = (IOStateReportInfo *)(buf); \ + IOStateReportValues *__rep; \ + IOReportElement *__elem; \ + if ((bufSize) >= STATEREPORT_BUFSIZE(nstates)) { \ + for (unsigned __no = 0; __no < (nstates); __no++) { \ + __elem = &(__info->elem[__no]); \ + __rep = (IOStateReportValues *) &(__elem->values); \ + __elem->provider_id = (providerID); \ + __elem->channel_id = (channelID); \ + __elem->channel_type.report_format = kIOReportFormatState; \ + __elem->channel_type.reserved = 0; \ + __elem->channel_type.categories = (cats); \ + __elem->channel_type.nelements = (nstates); \ + __elem->channel_type.element_idx = __no; \ + __elem->timestamp = 0; \ + __rep->state_id = __no; \ + __rep->intransitions = 0; \ + __rep->upticks = 0; \ + __rep->last_intransition = 0; \ + } \ + __info->curr_state = 0; \ + __info->update_ts = 0; \ + } \ + else { \ + IOREPORT_ABORT("bufSize is smaller than the required size\n"); \ + } \ +} while(0) + +/* + * Initialize the state id field of a state with the specified value. By + * default, STATEREPORT_INIT() initializes the state IDs with the index of + * that state. This macro can be used to provide a more descriptive state id. + * + * void* state_buf - ptr to memory initialized by STATEREPORT_INIT() + * unsigned stateIdx - index of the state, out of bounds -> no-op + * uint64_t stateID - new state id, see IOREPORT_MAKEID() + */ +#define STATEREPORT_SETSTATEID(state_buf, stateIdx, stateID) \ +do { \ + IOStateReportInfo *__info = (IOStateReportInfo *)(state_buf); \ + IOStateReportValues *__rep; \ + if ((stateIdx) < __info->elem[0].channel_type.nelements) { \ + __rep = (IOStateReportValues*) &(__info->elem[(stateIdx)].values); \ + __rep->state_id = (stateID); \ + } \ +} while (0) + + +/* + * Set the state of a StateReport. + * + * void* state_buf - pointer to memory initialized by STATEREPORT_INIT() + * unsigned newStateIdx - index of new state, out of bounds -> no-op + * uint64_t changeTime - time at which the transition occurred + */ +#define STATEREPORT_SETSTATE(state_buf, newStateIdx, changeTime) \ +do { \ + IOStateReportInfo *__info = (IOStateReportInfo *)(state_buf); \ + IOStateReportValues *__rep; \ + if ((newStateIdx) < __info->elem[0].channel_type.nelements ) { \ + __rep = (IOStateReportValues*) &(__info->elem[__info->curr_state].values); \ + if (__info->update_ts) \ + __rep->upticks += (changeTime) - __info->update_ts; \ + __info->elem[(newStateIdx)].timestamp = (changeTime); \ + __rep = (IOStateReportValues*) &(__info->elem[(newStateIdx)].values); \ + __rep->intransitions++; \ + __info->curr_state = (newStateIdx); \ + __info->update_ts = (changeTime); \ + } \ +} while(0) + +/* + * Prepare a StateReport for + * IOService::updateReport(kIOReportCopyChannelData...) + * + * void* state_buf - ptr to memory initialized by STATEREPORT_INIT() + * uint64_t currentTime - current timestamp + * void* ptr2cpy - filled in with pointer to buffer to be copied out + * size_t size2cpy - filled in with the size of the buffer to copy out + */ +#define STATEREPORT_UPDATEPREP(state_buf, currentTime, ptr2cpy, size2cpy) \ +do { \ + IOStateReportInfo *__info = (IOStateReportInfo *)(state_buf); \ + IOReportElement *__elem; \ + IOStateReportValues *__state; \ + (size2cpy) = __info->elem[0].channel_type.nelements * sizeof(IOReportElement); \ + (ptr2cpy) = (void *) &__info->elem[0]; \ + if (__info->update_ts) { \ + __elem = &__info->elem[__info->curr_state]; \ + __state = (IOStateReportValues *)&__elem->values; \ + __elem->timestamp = (currentTime); \ + __state->upticks += (currentTime) - __info->update_ts; \ + __info->update_ts = (currentTime); \ + } \ +} while(0) + +/* + * Update the result field received as a parameter for kIOReportGetDimensions & + * kIOReportCopyChannelData actions. + * + * void* state_buf - memory initialized by STATEREPORT_INIT() + * IOReportConfigureAction action - configure/updateReport() 'action' + * void* result - configure/updateReport() 'result' + */ + +#define STATEREPORT_UPDATERES(state_buf, action, result) \ +do { \ + IOStateReportInfo *__info = (IOStateReportInfo *)(state_buf); \ + IOReportElement *__elem; \ + int *__nElements = (int *)(result); \ + if (((action) == kIOReportGetDimensions) || ((action) == kIOReportCopyChannelData)) { \ + __elem = &(__info->elem[0]); \ + *__nElements += __elem->channel_type.nelements; \ + } \ +} while (0) + + +/* + * Get the 64-bit channel ID of a StateReport. + * + * void* state_buf - ptr to memory initialized by STATEREPORT_INIT() + */ +#define STATEREPORT_GETCHID(state_buf) \ + (((IOStateReportInfo *)(state_buf))->elem[0].channel_id) + +/* + * Get the IOReportChannelType of a StateReport. + * + * void* state_buf - ptr to memory initialized by STATEREPORT_INIT() + */ +#define STATEREPORT_GETCHTYPE(state_buf) \ + (*(uint64_t*)&(((IOStateReportInfo *)(state_buf))->elem[0].channel_type)) + +/* + * Get the number of transitions into a given state. + * + * void* state_buf - ptr to memory initialized by STATEREPORT_INIT() + * unsigned stateIdx - index of state, out of bounds -> kIOReportInvalidValue + * + */ +#define STATEREPORT_GETTRANSITIONS(state_buf, stateIdx) \ + (((stateIdx) < ((IOStateReportInfo *)(state_buf))->elem[0].channel_type.nelements) \ + ? ((IOStateReportValues*)&(((IOStateReportInfo*)(state_buf))->elem[(stateIdx)].values))->intransitions \ + : kIOReportInvalidValue) + +/* + * Get the total number of ticks spent in a given state. + * + * void* state_buf - ptr to memory initialized by STATEREPORT_INIT() + * unsigned stateIdx - index of state, out of bounds -> kIOReportInvalidValue + */ +#define STATEREPORT_GETTICKS(state_buf, stateIdx) \ + (((stateIdx) < ((IOStateReportInfo*)(state_buf))->elem[0].channel_type.nelements) \ + ? ((IOStateReportValues*)&(((IOStateReportInfo*)(state_buf))->elem[(stateIdx)].values))->upticks \ + : kIOReportInvalidValue) + + +/* ----- Reporting an Array of Integers (SimpleArrayReport) ----- */ + +/* + * Determine the buffer size for a SimpleArrayReport. + * + * int nValues - number of values to be reported + */ + +#define SIMPLEARRAY_BUFSIZE(nValues) \ + ((((nValues)/IOR_VALUES_PER_ELEMENT) + (((nValues) % IOR_VALUES_PER_ELEMENT) ? 1:0)) \ + * sizeof(IOReportElement)) + +/* + * Initialize a buffer for use as a SimpleArrayReport. + * + * int nValues - number of elements to be reported + * void* buf - ptr to SIMPLEARRAY_BUFSIZE(nValues) bytes + * size_t bufSize - sanity check of buffer's size + * uint64_t providerID - registry Entry ID of the reporting service + * uint64_t channelID - ID of this channel, see IOREPORT_MAKEID() + * IOReportCategories categories - categories of this channel + * + * If the buffer is not of sufficient size, the macro invokes IOREPORT_ABORT(). + * If that returns, the buffer is left full of '&'. + */ + +#define SIMPLEARRAY_INIT(nValues, buf, bufSize, providerID, channelID, cats) \ +do { \ + memset((buf), '&', (bufSize)); \ + IOSimpleArrayReportValues *__rep; \ + IOReportElement *__elem; \ + uint32_t __nElems = (((nValues) / IOR_VALUES_PER_ELEMENT) + \ + (((nValues) % IOR_VALUES_PER_ELEMENT) ? 1 : 0)); \ + if ((bufSize) >= SIMPLEARRAY_BUFSIZE(nValues)) { \ + for (unsigned __no = 0; __no < __nElems; __no++) { \ + __elem = &(((IOReportElement *)(buf))[__no]); \ + __rep = (IOSimpleArrayReportValues *) &(__elem->values); \ + __elem->provider_id = (providerID); \ + __elem->channel_id = (channelID); \ + __elem->channel_type.report_format = kIOReportFormatSimpleArray; \ + __elem->channel_type.reserved = 0; \ + __elem->channel_type.categories = (cats); \ + __elem->channel_type.nelements = (__nElems); \ + __elem->channel_type.element_idx = __no; \ + __elem->timestamp = 0; \ + __rep->simple_values[0] = kIOReportInvalidIntValue; \ + __rep->simple_values[1] = kIOReportInvalidIntValue; \ + __rep->simple_values[2] = kIOReportInvalidIntValue; \ + __rep->simple_values[3] = kIOReportInvalidIntValue; \ + } \ + } \ + else { \ + IOREPORT_ABORT("bufSize is smaller than the required size\n"); \ + } \ +} while(0) + + +/* SimpleArrayReport helpers */ + + #define __SA_FINDREP(array_buf, idx) \ + IOSimpleArrayReportValues *__rep; \ + IOReportElement *__elem; \ + unsigned __elemIdx = (idx) / IOR_VALUES_PER_ELEMENT; \ + unsigned __valueIdx = (idx) % IOR_VALUES_PER_ELEMENT; \ + __elem = &(((IOReportElement *)(array_buf))[0]); \ + if (__elemIdx < __elem->channel_type.nelements) { \ + __elem = &(((IOReportElement *)(array_buf))[__elemIdx]); \ + __rep = (IOSimpleArrayReportValues *) &(__elem->values); \ + + #define __SA_MAXINDEX(array_buf) \ + ((((IOReportElement*)(array_buf))->channel_type.nelements) \ + * IOR_VALUES_PER_ELEMENT) - 1 + +/* + * Set a value at a specified index in a SimpleArrayReport. + * + * void* array_bufbuf - ptr to memory initialized by SIMPLEARRAY_INIT() + * unsigned idx - array index, out of bounds -> no-op + * uint64_t newValue - new value to be stored at array[idx] + */ +#define SIMPLEARRAY_SETVALUE(array_buf, idx, newValue) \ +do { \ + __SA_FINDREP((array_buf), (idx)) \ + __rep->simple_values[__valueIdx] = (newValue); \ + } \ +} while(0) + +/* + * Increment an array value within a SimpleArrayReport. + * + * void* array_buf - ptr to memory initialized by SIMPLEARRAY_INIT() + * unsigned idx - array index to increment, out of bounds -> no-op + * int64_t value - amount by which to increment array[idx] + */ +#define SIMPLEARRAY_INCREMENTVALUE(array_buf, idx, value) \ +do { \ + __SA_FINDREP((array_buf), (idx)) \ + __rep->simple_values[__valueIdx] += (value); \ + } \ +} while(0) + + +/* + * Prepare a SimpleArrayReport for + * IOService::updateReport(kIOReportCopyChannelData...) + * + * void* array_buf - ptr to memory initialized by SIMPLEARRAY_INIT() + * void* ptr2cpy - filled in with pointer to buffer to be copied out + * size_t size2cpy - filled in with the size of the buffer to copy out + */ + +#define SIMPLEARRAY_UPDATEPREP(array_buf, ptr2cpy, size2cpy) \ +do { \ + IOReportElement *__elem; \ + __elem = &(((IOReportElement *)(array_buf))[0]); \ + (ptr2cpy) = (void *) (array_buf); \ + (size2cpy) = __elem->channel_type.nelements * sizeof(IOReportElement); \ +} while(0) + + +/* + * Update the result field received as a parameter for kIOReportGetDimensions & + * kIOReportCopyChannelData actions. + * + * void* array_buf - memory initialized by SIMPLEARRAY_INIT() + * IOReportConfigureAction action - configure/updateReport() 'action' + * void* result - configure/updateReport() 'result' + */ + +#define SIMPLEARRAY_UPDATERES(array_buf, action, result) \ +do { \ + IOReportElement *__elem; \ + int *__nElements = (int *)(result); \ + __elem = &(((IOReportElement *)(array_buf))[0]); \ + if (((action) == kIOReportGetDimensions) || ((action) == kIOReportCopyChannelData)) { \ + *__nElements += __elem->channel_type.nelements; \ + } \ +} while (0) + + +/* + * Get the 64-bit channel ID of a SimpleArrayReport. + * + * void* array_buf - ptr to memory initialized by SIMPLEARRAY_INIT() + */ +#define SIMPLEARRAY_GETCHID(array_buf) \ + (((IOReportElement *)(array_buf))->channel_id) + + +/* + * Get the IOReportChannelType of a SimpleArrayReport. + * + * void* simp_buf - ptr to memory initialized by SIMPLEREPORT_INIT() + */ +#define SIMPLEARRAY_GETCHTYPE(array_buf) \ + (*(uint64_t*)&(((IOReportElement *)(array_buf))->channel_type)) + +/* + * Get a value from a SimpleArrayReport. + * + * void* array_buf - ptr to memory initialized by SIMPLEARRAY_INIT() + * unsigned idx - index of the value, out of bounds -> kIOReportInvalidValue + */ +#define SIMPLEARRAY_GETVALUE(array_buf, idx) \ + (((idx) > __SA_MAXINDEX(array_buf) || (idx) < 0) ? kIOReportInvalidIntValue : \ + ((IOSimpleArrayReportValues*)&( \ + ((IOReportElement*)(array_buf))[(idx) / IOR_VALUES_PER_ELEMENT].values)) \ + ->simple_values[(idx) % IOR_VALUES_PER_ELEMENT]) + + +/* ----- Histogram Reporting (HistogramReport) ----- */ + +// Internal struct for HistogramReport +typedef struct { + int bucketWidth; + IOReportElement elem[]; // Array of elements +} IOHistReportInfo; + +/* + * Determine the size required for a HistogramReport buffer. + * + * int nbuckets - number of buckets in the histogram + */ +#define HISTREPORT_BUFSIZE(nbuckets) \ + (sizeof(IOHistReportInfo) + ((nbuckets) * sizeof(IOReportElement))) + +/* + * Initialize a HistogramReport buffer. Supports only linear scale histogram. + * + * int nbuckets - number of buckets data is combined into + * uint32_t bucketWidth - size of each bucket + * void* buffer - ptr to HISTREPORT_BUFSIZE(nbuckets) bytes + * size_t bufSize - sanity check of buffer's size + * uint64_t providerID - registry Entry ID of the reporting service + * uint64_t channelID - ID of this channel, see IOREPORT_MAKEID() + * IOReportCategories categories - categories of this channel + * + * If the buffer is not of sufficient size, the macro invokes IOREPORT_ABORT. + * If that returns, the buffer is left full of '&'. + */ +#define HISTREPORT_INIT(nbuckets, bktSize, buf, bufSize, providerID, channelID, cats) \ +do { \ + memset((buf), '&', (bufSize)); \ + IOHistReportInfo *__info = (IOHistReportInfo *)(buf); \ + IOReportElement *__elem; \ + IOHistogramReportValues *__rep; \ + if ((bufSize) >= HISTREPORT_BUFSIZE(nbuckets)) { \ + __info->bucketWidth = (bktSize); \ + for (unsigned __no = 0; __no < (nbuckets); __no++) { \ + __elem = &(__info->elem[__no]); \ + __rep = (IOHistogramReportValues *) &(__elem->values); \ + __elem->provider_id = (providerID); \ + __elem->channel_id = (channelID); \ + __elem->channel_type.report_format = kIOReportFormatHistogram; \ + __elem->channel_type.reserved = 0; \ + __elem->channel_type.categories = (cats); \ + __elem->channel_type.nelements = (nbuckets); \ + __elem->channel_type.element_idx = __no; \ + __elem->timestamp = 0; \ + memset(__rep, '\0', sizeof(IOHistogramReportValues)); \ + } \ + } \ + else { \ + IOREPORT_ABORT("bufSize is smaller than the required size\n"); \ + } \ +} while (0) + +/* + * Update histogram with a new value. + * + * + * void* hist_buf - pointer to memory initialized by HISTREPORT_INIT() + * int64_t value - new value to add to the histogram + */ +#define HISTREPORT_TALLYVALUE(hist_buf, value) \ +do { \ + IOHistReportInfo *__info = (IOHistReportInfo *)(hist_buf); \ + IOReportElement *__elem; \ + IOHistogramReportValues *__rep; \ + for (unsigned __no = 0; __no < __info->elem[0].channel_type.nelements; __no++) { \ + if ((value) <= __info->bucketWidth * (__no+1)) { \ + __elem = &(__info->elem[__no]); \ + __rep = (IOHistogramReportValues *) &(__elem->values); \ + if (__rep->bucket_hits == 0) { \ + __rep->bucket_min = __rep->bucket_max = (value); \ + } \ + else if ((value) < __rep->bucket_min) { \ + __rep->bucket_min = (value); \ + } \ + else if ((value) > __rep->bucket_max) { \ + __rep->bucket_max = (value); \ + } \ + __rep->bucket_sum += (value); \ + __rep->bucket_hits++; \ + break; \ + } \ + } \ +} while (0) + +/* + * Prepare a HistogramReport for + * IOService::updateReport(kIOReportCopyChannelData...) + * + * void* array_buf - ptr to memory initialized by HISTREPORT_INIT() + * void* ptr2cpy - filled in with pointer to buffer to be copied out + * size_t size2cpy - filled in with the size of the buffer to copy out + */ + +#define HISTREPORT_UPDATEPREP(hist_buf, ptr2cpy, size2cpy) \ +do { \ + IOHistReportInfo *__info = (IOHistReportInfo *)(hist_buf); \ + (size2cpy) = __info->elem[0].channel_type.nelements * sizeof(IOReportElement); \ + (ptr2cpy) = (void *) &__info->elem[0]; \ +} while(0) + + +/* + * Update the result field received as a parameter for kIOReportGetDimensions & + * kIOReportCopyChannelData actions. + * + * void* array_buf - memory initialized by HISTREPORT_INIT() + * IOReportConfigureAction action - configure/updateReport() 'action' + * void* result - configure/updateReport() 'result' + */ + +#define HISTREPORT_UPDATERES(hist_buf, action, result) \ +do { \ + IOHistReportInfo *__info = (IOHistReportInfo *)(hist_buf); \ + int *__nElements = (int *)(result); \ + if (((action) == kIOReportGetDimensions) || ((action) == kIOReportCopyChannelData)) { \ + *__nElements += __info->elem[0].channel_type.nelements; \ + } \ +} while (0) + +/* + * Get the 64-bit channel ID of a HistogramReport. + * + * void* hist_buf - ptr to memory initialized by HISTREPORT_INIT() + */ +#define HISTREPORT_GETCHID(hist_buf) \ + (((IOHistReportInfo *)(hist_buf))->elem[0].channel_id) + +/* + * Get the IOReportChannelType of a HistogramReport. + * + * void* hist_buf - ptr to memory initialized by HISTREPORT_INIT() + */ +#define HISTREPORT_GETCHTYPE(hist_buf) \ + (*(uint64_t*)&(((IOHistReportInfo *)(hist_buf))->elem[0].channel_type)) + +#ifdef __cplusplus +} +#endif + +#endif // _IOREPORT_MACROS_H_ diff --git a/QualcommWireless/include/IOKit/IOReportTypes.h b/QualcommWireless/include/IOKit/IOReportTypes.h new file mode 100644 index 0000000..dd81759 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOReportTypes.h @@ -0,0 +1,411 @@ +/* + * Copyright (c) 2012-2014 Apple Computer, Inc. All Rights Reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOREPORT_TYPES_H_ +#define _IOREPORT_TYPES_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define IOR_VALUES_PER_ELEMENT 4 + +/*! @const kIOReportInvalidValue + * @const kIOReportInvalidIntValue + * @abstract cardinal value used to indicate data errors + * + * @discussion + * kIOReportInvalidValue and kIOReportInvalidIntValue have the + * same bit pattern so that clients checking for one or the other + * don't have to worry about getting the signedness right. + */ +#define kIOReportInvalidIntValue INT64_MIN +#define kIOReportInvalidValue (uint64_t)kIOReportInvalidIntValue + +/*! @typedef IOReportCategories + * @abstract encapsulate important, multi-purpose "tags" for channels + * + * @discussion + * IOReportCategories is the type for the .categories field of + * IOReportChanelType. These categories are inteded to empower a + * limited number of clients to retrieve a broad range of channels + * without knowing much about them. They can be OR'd together as + * needed. Groups and subgroups are a more extensible mechanism + * for aggregating channels produced by different drivers. + */ +typedef uint16_t IOReportCategories; +#define kIOReportCategoryPower (1 << 1) // and energy +#define kIOReportCategoryTraffic (1 << 2) // I/O at any level +#define kIOReportCategoryPerformance (1 << 3) // e.g. cycles/byte +#define kIOReportCategoryPeripheral (1 << 4) // not built-in + +#define kIOReportCategoryField (1 << 8) // consider logging + +// future categories TBD +#define kIOReportCategoryDebug (1 << 15) +#define kIOReportInvalidCategory UINT16_MAX + + +// IOReportChannelType.report_format +typedef uint8_t IOReportFormat; +enum { + kIOReportInvalidFormat = 0, + kIOReportFormatSimple = 1, + kIOReportFormatState = 2, + kIOReportFormatHistogram = 3, + kIOReportFormatSimpleArray = 4 +}; + +// simple report values +typedef struct { + int64_t simple_value; + uint64_t reserved1; + uint64_t reserved2; + uint64_t reserved3; +} __attribute((packed)) IOSimpleReportValues; + +// simple value array +typedef struct { + int64_t simple_values[IOR_VALUES_PER_ELEMENT]; +} __attribute((packed)) IOSimpleArrayReportValues; + +// state report values +typedef struct { + uint64_t state_id; // 0..N-1 or 8-char code (see MAKEID()) + uint64_t intransitions; // number of transitions into this state + uint64_t upticks; // ticks spent in state (local timebase) + uint64_t last_intransition;// ticks at last in-transition +} __attribute((packed)) IOStateReportValues; + +// histogram report values +typedef struct { + uint64_t bucket_hits; + int64_t bucket_min; + int64_t bucket_max; + int64_t bucket_sum; +} __attribute((packed)) IOHistogramReportValues; + + + +// configuration actions generally change future behavior +typedef uint32_t IOReportConfigureAction; +enum { + // basics (in common operational order) + kIOReportEnable = 0x01, + kIOReportGetDimensions = 0x02, + kIOReportDisable = 0x00, + + // Enable/disable modifiers + kIOReportNotifyHubOnChange = 0x10, // triggered polling + + kIOReportTraceOnChange = 0x20 // kdebug.h tracing +}; + +// update actions should not have observable side effects +typedef uint32_t IOReportUpdateAction; +enum { + kIOReportCopyChannelData = 1, + kIOReportTraceChannelData = 2 +}; + +typedef struct { + uint8_t report_format; // Histogram, StateResidency, etc. + uint8_t reserved; // must be zero + uint16_t categories; // power, traffic, etc (omnibus obs.) + uint16_t nelements; // internal size of channel + + // only meaningful in the data pipeline + int16_t element_idx; // 0..nelements-1 + // -1..-(nelements) = invalid (13127884) +} __attribute((packed)) IOReportChannelType; + +/*! + * @define IOREPORT_MAKECHID + * @abstract convert up to 8 printable characters into a 64-bit channel ID + * @param - printable chars to be packed into a channel ID + * @result a 64-bit channel ID with an implicit ASCII name + * @discussion A simple example: + * IOREPORT_MAKECHID('H', 'i', ' ', 'w', 'o', 'r', 'l', 'd'); + * will evaluate to 0x686920776f726c64. Any NUL bytes are + * ignored (by libIOReport) for naming purposes, but will + * appear in the channel ID. Using a non-NUL non-printable + * character will disable the implicit name. Putting NUL + * bytes first eliminates trailing zeros when the channel + * ID is printed as hex. For example: + * IORERPORT_MAKECHID('\0','\0','n','x','f','e','r','s'); + * To see the text, use xxd -r -p # not -rp; see 12976241 + */ +#define __IOR_lshiftchr(c, chshift) ((uint64_t)(c) << (8*(chshift))) +#define IOREPORT_MAKEID(A, B, C, D, E, F, G, H) \ + (__IOR_lshiftchr(A, 7) | __IOR_lshiftchr(B, 6) | __IOR_lshiftchr(C, 5) \ + | __IOR_lshiftchr(D, 4) | __IOR_lshiftchr(E, 3) | __IOR_lshiftchr(F, 2) \ + | __IOR_lshiftchr(G, 1) | __IOR_lshiftchr(H, 0)) + +typedef struct { + uint64_t channel_id; + IOReportChannelType channel_type; +} IOReportChannel; + +typedef struct { + uint32_t nchannels; + IOReportChannel channels[]; +} IOReportChannelList; + +typedef struct { + uint64_t provider_id; + IOReportChannel channel; +} IOReportInterest; + +typedef struct { + uint32_t ninterests; + IOReportInterest interests[]; +} IOReportInterestList; + +typedef struct { + uint64_t v[IOR_VALUES_PER_ELEMENT]; +} __attribute((packed)) IOReportElementValues; + +typedef struct { + uint64_t provider_id; + uint64_t channel_id; + IOReportChannelType channel_type; + uint64_t timestamp;// mach_absolute_time() + IOReportElementValues values; +} __attribute((packed)) IOReportElement; + + + +/* + * IOReporting unit type and constants + */ + +// 1. Mechanism + +// Assume encoded units could be stored in binary format: don't +// change existing values. + +typedef uint64_t IOReportUnit; +typedef uint64_t IOReportUnits; // deprecated typo, please switch +#define __IOR_MAKEUNIT(quantity, scale) \ + (((IOReportUnit)quantity << 56) | (uint64_t)scale) +#define IOREPORT_GETUNIT_QUANTITY(unit) \ + ((IOReportQuantity)((uint64_t)unit >> 56) & 0xff) +#define IOREPORT_GETUNIT_SCALE(unit) \ + ((IOReportScaleFactor)unit & 0x00ffffffffffffff) + +// 8b quantity ID | 32b const val + 8b*2^10 + 8b*2^n | 8b cardinal | 8b unused +typedef uint8_t IOReportQuantity; // SI "quantity" is what's measured +typedef uint64_t IOReportScaleFactor; + +// See for a list +// of quantities and their symbols. +enum { + // used by state reports, etc + kIOReportQuantityUndefined = 0, + + kIOReportQuantityTime = 1,// Seconds + kIOReportQuantityPower = 2,// Watts + kIOReportQuantityEnergy = 3,// Joules + kIOReportQuantityCurrent = 4,// Amperes + kIOReportQuantityVoltage = 5,// Volts + kIOReportQuantityCapacitance = 6,// Farad + kIOReportQuantityInductance = 7,// Henry + kIOReportQuantityFrequency = 8,// Hertz + kIOReportQuantityData = 9,// bits/bytes (see scale) + kIOReportQuantityTemperature = 10,// Celsius (not Kelvin :) + + kIOReportQuantityEventCount = 100, + kIOReportQuantityPacketCount = 101, + kIOReportQuantityCPUInstrs = 102 +}; + + +/* A number of units end up with both IEC (2^n) and SI (10^n) scale factors. + * For example, the "MB" of a 1.44 MB floppy or a 1024MHz clock. We + * thus support separate 2^n and 10^n factors. The exponent encoding + * scheme is modeled loosely on single-precision IEEE 754. + */ +#define kIOReportScaleConstMask 0x000000007fffffff // constant ("uint31") +#define kIOReportScaleOneOver (1LL << 31) // 1/constant +#define kIOReportExpBase (-127) // support base^(-n) +#define kIOReportExpZeroOffset -(kIOReportExpBase) // max exponent = 128 +#define kIOReportScaleSIShift 32 // * 10^n +#define kIOReportScaleSIMask 0x000000ff00000000 +#define kIOReportScaleIECShift 40 // * 2^n +#define kIOReportScaleIECMask 0x0000ff0000000000 +#define kIOReportCardinalShift 48 // placeholders +#define kIOReportCardinalMask 0x00ff000000000000 + + +/* + * Scales are described as a factor times unity: + * 1ms = kIOReportScaleMilli * s + * + * A value expressed in a scaled unit can be scaled to unity via + * multiplication by the constant: + * 100ms * kIOReportScaleMilli [1e-3] = 0.1s. + */ + +// SI / decimal +#define kIOReportScalePico ((-12LL + kIOReportExpZeroOffset) \ + << kIOReportScaleSIShift) +#define kIOReportScaleNano ((-9LL + kIOReportExpZeroOffset) \ + << kIOReportScaleSIShift) +#define kIOReportScaleMicro ((-6LL + kIOReportExpZeroOffset) \ + << kIOReportScaleSIShift) +#define kIOReportScaleMilli ((-3LL + kIOReportExpZeroOffset) \ + << kIOReportScaleSIShift) +#define kIOReportScaleUnity 0 // 10^0 = 2^0 = 1 +// unity = 0 is a special case for which we give up exp = -127 +#define kIOReportScaleKilo ((3LL + kIOReportExpZeroOffset) \ + << kIOReportScaleSIShift) +#define kIOReportScaleMega ((6LL + kIOReportExpZeroOffset) \ + << kIOReportScaleSIShift) +#define kIOReportScaleGiga ((9LL + kIOReportExpZeroOffset) \ + << kIOReportScaleSIShift) +#define kIOReportScaleTera ((12LL + kIOReportExpZeroOffset) \ + << kIOReportScaleSIShift) + +// IEC / computer / binary +// It's not clear we'll ever use 2^(-n), but 1..2^~120 should suffice. +#define kIOReportScaleBits kIOReportScaleUnity +#define kIOReportScaleBytes ((3LL + kIOReportExpZeroOffset) \ + << kIOReportScaleIECShift) +// (bytes have to be added to the exponents up front, can't just OR in) +#define kIOReportScaleKibi ((10LL + kIOReportExpZeroOffset) \ + << kIOReportScaleIECShift) +#define kIOReportScaleKiBytes ((13LL + kIOReportExpZeroOffset) \ + << kIOReportScaleIECShift) +#define kIOReportScaleMebi ((20LL + kIOReportExpZeroOffset) \ + << kIOReportScaleIECShift) +#define kIOReportScaleMiBytes ((23LL + kIOReportExpZeroOffset) \ + << kIOReportScaleIECShift) +#define kIOReportScaleGibi ((30LL + kIOReportExpZeroOffset) \ + << kIOReportScaleIECShift) +#define kIOReportScaleGiBytes ((33LL + kIOReportExpZeroOffset) \ + << kIOReportScaleIECShift) +#define kIOReportScaleTebi ((40LL + kIOReportExpZeroOffset) \ + << kIOReportScaleIECShift) +#define kIOReportScaleTiBytes ((43LL + kIOReportExpZeroOffset) \ + << kIOReportScaleIECShift) +// can't encode more than 2^125 (keeping bits & bytes inside -126..128) +// Also, IOReportScaleValue() is currently limited internally by uint64_t. + + +// Cardinal values, to be filled in appropriately. +// Add values in increasing order. +#define kIOReportScaleMachHWTicks (1LL << kIOReportCardinalShift) +#define kIOReportScaleHWPageSize (2LL << kIOReportCardinalShift) + +// page scales: 2 pages * 4ikB/page = 8096 bytes +#define kIOReportScale4KiB (4 | kIOReportScaleKiBytes) +#define kIOReportScale8KiB (8 | kIOReportScaleKiBytes) +#define kIOReportScale16KiB (16 | kIOReportScaleKiBytes) + +// Clock frequency scales (units add seconds). +// 1 GHz ticks are 1 ns: 1000 ticks * 1e-6 = 1e-3s +// This '1' is a no-op for scaling, but allows a custom label. +#define kIOReportScale1GHz (1 | kIOReportScaleNano) +// 24MHz ticks are 1/24 of a microsecond: (1/24 * kIOReportScaleMicro [1e-6])s +// So for example, 240 24Mticks * 1/24 * 1e-6 = .00001s [1e-5]s +#define kIOReportScale24MHz (kIOReportScaleOneOver|24 |kIOReportScaleMicro) + +// --- END: units mechanism + + +// 2. Unit constants +#define kIOReportUnitNone __IOR_MAKEUNIT(kIOReportQuantityUndefined, \ + kIOReportScaleUnity) + +#define kIOReportUnit_s __IOR_MAKEUNIT(kIOReportQuantityTime, \ + kIOReportScaleUnity) +#define kIOReportUnit_ms __IOR_MAKEUNIT(kIOReportQuantityTime, \ + kIOReportScaleMilli) +#define kIOReportUnit_us __IOR_MAKEUNIT(kIOReportQuantityTime, \ + kIOReportScaleMicro) +#define kIOReportUnit_ns __IOR_MAKEUNIT(kIOReportQuantityTime, \ + kIOReportScaleNano) + +#define kIOReportUnit_J __IOR_MAKEUNIT(kIOReportQuantityEnergy, \ + kIOReportScaleUnity) +#define kIOReportUnit_mJ __IOR_MAKEUNIT(kIOReportQuantityEnergy, \ + kIOReportScaleMilli) +#define kIOReportUnit_uJ __IOR_MAKEUNIT(kIOReportQuantityEnergy, \ + kIOReportScaleMicro) +#define kIOReportUnit_nJ __IOR_MAKEUNIT(kIOReportQuantityEnergy, \ + kIOReportScaleNano) +#define kIOReportUnit_pJ __IOR_MAKEUNIT(kIOReportQuantityEnergy, \ + kIOReportScalePico) + +#define kIOReportUnitHWTicks __IOR_MAKEUNIT(kIOReportQuantityTime, \ + kIOReportScaleMachHWTicks) +#define kIOReportUnit24MHzTicks __IOR_MAKEUNIT(kIOReportQuantityTime, \ + kIOReportScale24MHz) +#define kIOReportUnit1GHzTicks __IOR_MAKEUNIT(kIOReportQuantityTime, \ + kIOReportScale1GHz) + +#define kIOReportUnitBits __IOR_MAKEUNIT(kIOReportQuantityData, \ + kIOReportScaleBits) +#define kIOReportUnitBytes __IOR_MAKEUNIT(kIOReportQuantityData, \ + kIOReportScaleBytes) +#define kIOReportUnit_KiB __IOR_MAKEUNIT(kIOReportQuantityData, \ + kIOReportScaleKiBytes) +#define kIOReportUnit_MiB __IOR_MAKEUNIT(kIOReportQuantityData, \ + kIOReportScaleMiBytes) +#define kIOReportUnit_GiB __IOR_MAKEUNIT(kIOReportQuantityData, \ + kIOReportScaleGiBytes) +#define kIOReportUnit_TiB __IOR_MAKEUNIT(kIOReportQuantityData, \ + kIOReportScaleTiBytes) + +#define kIOReportUnitEvents __IOR_MAKEUNIT(kIOReportQuantityEventCount, \ + kIOReportScaleUnity) + +#define kIOReportUnitPackets __IOR_MAKEUNIT(kIOReportQuantityPacketCount, \ + kIOReportScaleUnity) + +#define kIOReportUnitInstrs __IOR_MAKEUNIT(kIOReportQuantityCPUInstrs, \ + kIOReportScaleUnity) +#define kIOReportUnit_KI __IOR_MAKEUNIT(kIOReportQuantityCPUInstrs, \ + kIOReportScaleKilo) +#define kIOReportUnit_MI __IOR_MAKEUNIT(kIOReportQuantityCPUInstrs, \ + kIOReportScaleMega) +#define kIOReportUnit_GI __IOR_MAKEUNIT(kIOReportQuantityCPUInstrs, \ + kIOReportScaleGiga) + +// Please file bugs (xnu | IOReporting) for additional units. + +// --- END: unit constants + + +#ifdef __cplusplus +} +#endif + +#endif // _IOREPORT_TYPES_H_ diff --git a/QualcommWireless/include/IOKit/IOReportUserClient.h b/QualcommWireless/include/IOKit/IOReportUserClient.h new file mode 100644 index 0000000..5aca281 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOReportUserClient.h @@ -0,0 +1,79 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOREPORTUSERCLIENT_H +#define _IOKIT_IOREPORTUSERCLIENT_H + +#include +#include + +class IOReportUserClient : public IOUserClient +{ + OSDeclareDefaultStructors(IOReportUserClient) + +public: +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_5 + virtual IOReturn externalMethod(uint32_t selector, IOExternalMethodArguments * arguments, IOExternalMethodDispatch * dispatch = NULL, OSObject * target = NULL, void * reference = NULL) APPLE_KEXT_OVERRIDE; +#endif + + virtual bool init( OSDictionary * dictionary ) APPLE_KEXT_OVERRIDE; + virtual bool initWithTask( task_t owningTask, void * securityToken, UInt32 type ) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool stop( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn clientClose() APPLE_KEXT_OVERRIDE; + virtual IOService * getService() APPLE_KEXT_OVERRIDE; + virtual IOReturn clientMemoryForType( UInt32 type, IOOptionBits * options, IOMemoryDescriptor ** memory ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn open( IOOptionBits options ); + virtual IOReturn close(); + + static IOReturn _open( IOReportUserClient *, void *, IOExternalMethodArguments * ); + static IOReturn _close( IOReportUserClient *, void *, IOExternalMethodArguments * ); + static IOReturn goto_configureInterests( IOReportUserClient *, void *, IOExternalMethodArguments * ); + static IOReturn goto_getValues( IOReportUserClient *, void *, IOExternalMethodArguments * ); + IOReturn _configureInterests( IOReportInterestList *, IOByteCount * ); + IOReturn _getInterests( IOByteCount, OSDictionary **, IOBufferMemoryDescriptor ** ); + IOReturn _getValues( IOByteCount ); + +protected: + IOOptionBits mHubOptions; + task_t mOwningTask; + IOReportHub * mHub; + IOLock * mHubLock; + OSArray * mReportDictionaryArray; + OSArray * mSubscriptionBufferArray; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/IOReturn.h b/QualcommWireless/include/IOKit/IOReturn.h new file mode 100644 index 0000000..f0c0d2e --- /dev/null +++ b/QualcommWireless/include/IOKit/IOReturn.h @@ -0,0 +1,158 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * HISTORY + */ + +/* + * Core IOReturn values. Others may be family defined. + */ + +#ifndef __IOKIT_IORETURN_H +#define __IOKIT_IORETURN_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#include + + +typedef kern_return_t IOReturn; + +#ifndef sys_iokit +#define sys_iokit err_system(0x38) +#endif /* sys_iokit */ +#define sub_iokit_common err_sub(0) +#define sub_iokit_usb err_sub(1) +#define sub_iokit_firewire err_sub(2) +#define sub_iokit_block_storage err_sub(4) +#define sub_iokit_graphics err_sub(5) +#define sub_iokit_networking err_sub(6) +#define sub_iokit_bluetooth err_sub(8) +#define sub_iokit_pmu err_sub(9) +#define sub_iokit_acpi err_sub(10) +#define sub_iokit_smbus err_sub(11) +#define sub_iokit_ahci err_sub(12) +#define sub_iokit_powermanagement err_sub(13) +#define sub_iokit_hidsystem err_sub(14) +#define sub_iokit_scsi err_sub(16) +#define sub_iokit_usbaudio err_sub(17) +#define sub_iokit_wirelesscharging err_sub(18) +//#define sub_iokit_pccard err_sub(21) +#define sub_iokit_thunderbolt err_sub(29) +#define sub_iokit_graphics_acceleration err_sub(30) +#define sub_iokit_keystore err_sub(31) +#define sub_iokit_apfs err_sub(33) +#define sub_iokit_acpiec err_sub(34) +#define sub_iokit_timesync_avb err_sub(35) + +#define sub_iokit_platform err_sub(0x2A) +#define sub_iokit_audio_video err_sub(0x45) +#define sub_iokit_cec err_sub(0x46) +#define sub_iokit_baseband err_sub(0x80) +#define sub_iokit_HDA err_sub(0xFE) +#define sub_iokit_hsic err_sub(0x147) +#define sub_iokit_sdio err_sub(0x174) +#define sub_iokit_wlan err_sub(0x208) +#define sub_iokit_appleembeddedsleepwakehandler err_sub(0x209) +#define sub_iokit_appleppm err_sub(0x20A) + +#define sub_iokit_vendor_specific err_sub(-2) +#define sub_iokit_reserved err_sub(-1) + +#define iokit_common_err(return ) (sys_iokit|sub_iokit_common|return) +#define iokit_family_err(sub, return ) (sys_iokit|sub|return) +#define iokit_vendor_specific_err(return ) (sys_iokit|sub_iokit_vendor_specific|return) + +#define kIOReturnSuccess KERN_SUCCESS // OK +#define kIOReturnError iokit_common_err(0x2bc) // general error +#define kIOReturnNoMemory iokit_common_err(0x2bd) // can't allocate memory +#define kIOReturnNoResources iokit_common_err(0x2be) // resource shortage +#define kIOReturnIPCError iokit_common_err(0x2bf) // error during IPC +#define kIOReturnNoDevice iokit_common_err(0x2c0) // no such device +#define kIOReturnNotPrivileged iokit_common_err(0x2c1) // privilege violation +#define kIOReturnBadArgument iokit_common_err(0x2c2) // invalid argument +#define kIOReturnLockedRead iokit_common_err(0x2c3) // device read locked +#define kIOReturnLockedWrite iokit_common_err(0x2c4) // device write locked +#define kIOReturnExclusiveAccess iokit_common_err(0x2c5) // exclusive access and + // device already open +#define kIOReturnBadMessageID iokit_common_err(0x2c6) // sent/received messages + // had different msg_id +#define kIOReturnUnsupported iokit_common_err(0x2c7) // unsupported function +#define kIOReturnVMError iokit_common_err(0x2c8) // misc. VM failure +#define kIOReturnInternalError iokit_common_err(0x2c9) // internal error +#define kIOReturnIOError iokit_common_err(0x2ca) // General I/O error +//#define kIOReturn???Error iokit_common_err(0x2cb) // ??? +#define kIOReturnCannotLock iokit_common_err(0x2cc) // can't acquire lock +#define kIOReturnNotOpen iokit_common_err(0x2cd) // device not open +#define kIOReturnNotReadable iokit_common_err(0x2ce) // read not supported +#define kIOReturnNotWritable iokit_common_err(0x2cf) // write not supported +#define kIOReturnNotAligned iokit_common_err(0x2d0) // alignment error +#define kIOReturnBadMedia iokit_common_err(0x2d1) // Media Error +#define kIOReturnStillOpen iokit_common_err(0x2d2) // device(s) still open +#define kIOReturnRLDError iokit_common_err(0x2d3) // rld failure +#define kIOReturnDMAError iokit_common_err(0x2d4) // DMA failure +#define kIOReturnBusy iokit_common_err(0x2d5) // Device Busy +#define kIOReturnTimeout iokit_common_err(0x2d6) // I/O Timeout +#define kIOReturnOffline iokit_common_err(0x2d7) // device offline +#define kIOReturnNotReady iokit_common_err(0x2d8) // not ready +#define kIOReturnNotAttached iokit_common_err(0x2d9) // device not attached +#define kIOReturnNoChannels iokit_common_err(0x2da) // no DMA channels left +#define kIOReturnNoSpace iokit_common_err(0x2db) // no space for data +//#define kIOReturn???Error iokit_common_err(0x2dc) // ??? +#define kIOReturnPortExists iokit_common_err(0x2dd) // port already exists +#define kIOReturnCannotWire iokit_common_err(0x2de) // can't wire down + // physical memory +#define kIOReturnNoInterrupt iokit_common_err(0x2df) // no interrupt attached +#define kIOReturnNoFrames iokit_common_err(0x2e0) // no DMA frames enqueued +#define kIOReturnMessageTooLarge iokit_common_err(0x2e1) // oversized msg received + // on interrupt port +#define kIOReturnNotPermitted iokit_common_err(0x2e2) // not permitted +#define kIOReturnNoPower iokit_common_err(0x2e3) // no power to device +#define kIOReturnNoMedia iokit_common_err(0x2e4) // media not present +#define kIOReturnUnformattedMedia iokit_common_err(0x2e5)// media not formatted +#define kIOReturnUnsupportedMode iokit_common_err(0x2e6) // no such mode +#define kIOReturnUnderrun iokit_common_err(0x2e7) // data underrun +#define kIOReturnOverrun iokit_common_err(0x2e8) // data overrun +#define kIOReturnDeviceError iokit_common_err(0x2e9) // the device is not working properly! +#define kIOReturnNoCompletion iokit_common_err(0x2ea) // a completion routine is required +#define kIOReturnAborted iokit_common_err(0x2eb) // operation aborted +#define kIOReturnNoBandwidth iokit_common_err(0x2ec) // bus bandwidth would be exceeded +#define kIOReturnNotResponding iokit_common_err(0x2ed) // device not responding +#define kIOReturnIsoTooOld iokit_common_err(0x2ee) // isochronous I/O request for distant past! +#define kIOReturnIsoTooNew iokit_common_err(0x2ef) // isochronous I/O request for distant future +#define kIOReturnNotFound iokit_common_err(0x2f0) // data was not found +#define kIOReturnInvalid iokit_common_err(0x1) // should never be seen + +#ifdef __cplusplus +} +#endif + +#endif /* ! __IOKIT_IORETURN_H */ diff --git a/QualcommWireless/include/IOKit/IOSMBusController.h b/QualcommWireless/include/IOKit/IOSMBusController.h new file mode 100644 index 0000000..814c73f --- /dev/null +++ b/QualcommWireless/include/IOKit/IOSMBusController.h @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2018 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef RE_APPLE_IOSMBUSCONTROLLER_H +#define RE_APPLE_IOSMBUSCONTROLLER_H + +// This header represents a mostly valid IOSMBusController class implementation useful for our needs. +// Compatible with macOS 10.13.5. Based on PureDarwin header: +// https://raw.githubusercontent.com/PureDarwin/PureDarwin/master/patches/PowerManagement-158.10.9.IOSmbusController.p1.patch + +#include +#include +#include + +// SMBus Status register type +typedef uint8_t IOSMBusStatus; + +// Status Register (SMB_STS) Codes +// See section 12.9.1.1 of ACPI 4.0a specification +enum : IOSMBusStatus { + kIOSMBusStatusOK = 0x00, + kIOSMBusStatusUnknownFailure = 0x07, + kIOSMBusStatusDeviceAddressNotAcknowledged = 0x10, + kIOSMBusStatusDeviceError = 0x11, + kIOSMBusStatusDeviceCommandAccessDenied = 0x12, + kIOSMBusStatusUnknownHostError = 0x13, + kIOSMBusStatusDeviceAccessDenied = 0x17, + kIOSMBusStatusTimeout = 0x18, + kIOSMBusStatusHostUnsupportedProtocol = 0x19, + kIOSMBusStatusBusy = 0x1A, + kIOSMBusStatusPECError = 0x1F, +}; + +// Protocol Register (SMB_PRTCL) Types +// See section 12.9.1.2 of ACPI 4.0a specification +enum { + kIOSMBusProtocolControllerNotInUse = 0x00, + kIOSMBusProtocolReserved = 0x01, + kIOSMBusProtocolWriteQuickCommand = 0x02, + kIOSMBusProtocolReadQuickCommand = 0x03, + kIOSMBusProtocolSendByte = 0x04, + kIOSMBusProtocolReceiveByte = 0x05, + kIOSMBusProtocolWriteByte = 0x06, + kIOSMBusProtocolReadByte = 0x07, + kIOSMBusProtocolWriteWord = 0x08, + kIOSMBusProtocolReadWord = 0x09, + kIOSMBusProtocolWriteBlock = 0x0A, + kIOSMBusProtocolReadBlock = 0x0B, + kIOSMBusProtocolProcessCall = 0x0C, + kIOSMBusProtocolBlockWriteBlockReadProcessCall = 0x0D, + + // Same as above but with (P)acket (E)rror (C)hecking enabled + kIOSMBusProtocolPECControllerNotInUse = 0x80, + kIOSMBusProtocolPECReserved = 0x81, + kIOSMBusProtocolPECWriteQuickCommand = 0x82, + kIOSMBusProtocolPECReadQuickCommand = 0x83, + kIOSMBusProtocolPECSendByte = 0x84, + kIOSMBusProtocolPECReceiveByte = 0x85, + kIOSMBusProtocolPECWriteByte = 0x86, + kIOSMBusProtocolPECReadByte = 0x87, + kIOSMBusProtocolPECWriteWord = 0x88, + kIOSMBusProtocolPECReadWord = 0x89, + kIOSMBusProtocolPECWriteBlock = 0x8A, + kIOSMBusProtocolPECReadBlock = 0x8B, + kIOSMBusProtocolPECProcessCall = 0x8C, + kIOSMBusProtocolPECBlockWriteBlockReadProcessCall = 0x8D, +}; + +// SMBus alarm message type +enum { + kIOMessageSMBusAlarm = iokit_family_msg(sub_iokit_smbus, 0x10), +}; + +static_assert(kIOMessageSMBusAlarm == 0xE002C010, "Invalid kIOMessageSMBusAlarm value"); + +// See section 12.9.1.7 of ACPI 4.0a specification +static constexpr size_t kSMBusAlarmDataSize = 2; + +struct IOSMBusAlarmMessage { + uint8_t fromAddress; + uint8_t data[kSMBusAlarmDataSize]; +}; + +// Maximum size of SMBus Data Register Array (SMB_DATA) +// See section 12.9.1.5 of ACPI 4.0a specification +static constexpr size_t kSMBusMaximumDataSize = 32; + +// Holds data related to a SMBus transaction +// Padding required for 32-bit as 64-bit integers are normally not aligned to 8 bytes +struct IOSMBusTransaction { + uint8_t address; + uint8_t command; + uint8_t protocol; + uint8_t pad1[5]; + uint64_t timeout; + uint32_t sendDataCount; + uint8_t sendData[kSMBusMaximumDataSize]; + IOSMBusStatus status; + uint32_t receiveDataCount; + uint8_t receiveData[kSMBusMaximumDataSize]; + uint32_t pad2; +}; + +static_assert(sizeof(IOSMBusTransaction) == 0x60, "Invalid IOSMBusTransaction size"); +#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 || __GNUC__ > 3) +static_assert(offsetof(IOSMBusTransaction, timeout) == 0x08, "Invalid IOSMBusTransaction::timeout offset"); +static_assert(offsetof(IOSMBusTransaction, sendDataCount) == 0x10, "Invalid IOSMBusTransaction::sendDataCount offset"); +static_assert(offsetof(IOSMBusTransaction, sendData) == 0x14, "Invalid IOSMBusTransaction::sendData offset"); +static_assert(offsetof(IOSMBusTransaction, receiveDataCount) == 0x38, "Invalid IOSMBusTransaction::receiveDataCount offset"); +static_assert(offsetof(IOSMBusTransaction, receiveData) == 0x3C, "Invalid IOSMBusTransaction::receiveData offset"); +#endif + +// Transaction completion callback +typedef void (*IOSMBusTransactionCompletion)(OSObject *target, void *reference, IOSMBusTransaction *transaction); + +// Transaction request for later execution. +//TODO: complete the fields. +class IOSMBusRequest : public IOCommand { + OSDeclareDefaultStructors(IOSMBusRequest) +public: + queue_chain_t requestChain; + IOSMBusTransaction *transaction; + IOSMBusTransactionCompletion completionHandler; + OSObject *completionHandlerInstance; + void *completionHandlerArgument; + void *unknown[6]; +}; + +static_assert(sizeof(IOSMBusRequest) == (0x10 * sizeof(uintptr_t)), "Invalid IOSMBusRequest size"); // 0x80 on 64-bit + +// Main SMBus controller base class. +class IOACPIPlatformDevice; +class IOSMBusController : public IOService { + OSDeclareDefaultStructors(IOSMBusController) +public: + virtual IOReturn performTransaction(IOSMBusTransaction *transaction, IOSMBusTransactionCompletion completion = 0, + OSObject *target = 0, void *reference = 0); + virtual IOSMBusRequest *createRequest(); + virtual IOSMBusStatus startRequest(IOSMBusRequest *request); + virtual IOSMBusStatus completeRequest(IOSMBusRequest *request); + virtual IOSMBusStatus sendAlarm(IOSMBusAlarmMessage *alarmMessage); + + OSMetaClassDeclareReservedUnused(IOSMBusController, 0); + OSMetaClassDeclareReservedUnused(IOSMBusController, 1); + OSMetaClassDeclareReservedUnused(IOSMBusController, 2); + OSMetaClassDeclareReservedUnused(IOSMBusController, 3); + OSMetaClassDeclareReservedUnused(IOSMBusController, 4); + OSMetaClassDeclareReservedUnused(IOSMBusController, 5); + OSMetaClassDeclareReservedUnused(IOSMBusController, 6); + OSMetaClassDeclareReservedUnused(IOSMBusController, 7); + OSMetaClassDeclareReservedUnused(IOSMBusController, 8); + OSMetaClassDeclareReservedUnused(IOSMBusController, 9); + OSMetaClassDeclareReservedUnused(IOSMBusController, 10); + OSMetaClassDeclareReservedUnused(IOSMBusController, 11); + OSMetaClassDeclareReservedUnused(IOSMBusController, 12); + OSMetaClassDeclareReservedUnused(IOSMBusController, 13); + OSMetaClassDeclareReservedUnused(IOSMBusController, 14); + OSMetaClassDeclareReservedUnused(IOSMBusController, 15); + +public: + //FIXME: This is roughly unknown and incomplete. + void *fPrivateUnknown; + IOCommandGate *fPrivateCommandGate; + queue_chain_t fPrivateCommandQueue; + void *fPrivateUnknown2[5]; +}; + +#if defined(__i386__) +static_assert(sizeof(IOSMBusController) == 0x74, "Invalid 32-bit IOSMBusController size"); +#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 || __GNUC__ > 3) +static_assert(offsetof(IOSMBusController, fPrivateCommandGate) == 0x54, "Invalid 32-bit IOSMBusController::fCommandGate offset"); +static_assert(offsetof(IOSMBusController, fPrivateCommandQueue) == 0x58, "Invalid 32-bit IOSMBusController::fCommandQueue offset"); +#endif + +#elif defined(__x86_64__) +static_assert(sizeof(IOSMBusController) == 0xD0, "Invalid 64-bit IOSMBusController size"); +#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 || __GNUC__ > 3) +static_assert(offsetof(IOSMBusController, fPrivateCommandGate) == 0x90, "Invalid 64-bit IOSMBusController::fCommandGate offset"); +static_assert(offsetof(IOSMBusController, fPrivateCommandQueue) == 0x98, "Invalid 64-bit IOSMBusController::fCommandQueue offset"); +#endif + +#else +#error Unsupported arch +#endif + +#endif /* RE_APPLE_IOSMBUSCONTROLLER_H */ diff --git a/QualcommWireless/include/IOKit/IOService.h b/QualcommWireless/include/IOKit/IOService.h new file mode 100644 index 0000000..00d4cee --- /dev/null +++ b/QualcommWireless/include/IOKit/IOService.h @@ -0,0 +1,1907 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998,1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ +/*! + * @header + * This header contains the definition of the IOService class. IOService is the sole direct subclass of IORegistryEntry and is the base class of almost all I/O Kit family superclasses. IOService defines methods that support the life cycle of I/O Kit drivers. For more information on IOService, see {@linkdoc //apple_ref/doc/uid/TP0000011 I/O Kit Fundamentals}. + * + * @seealso //apple_ref/doc/header/IORegistryEntry.h IORegistryEntry + */ + +#ifndef _IOKIT_IOSERVICE_H +#define _IOKIT_IOSERVICE_H + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +extern "C" { +#include +} + +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +#ifndef UINT64_MAX +#define UINT64_MAX 18446744073709551615ULL +#endif + + +enum { + kIODefaultProbeScore = 0 +}; + +// masks for getState() +enum { + kIOServiceInactiveState = 0x00000001, + kIOServiceRegisteredState = 0x00000002, + kIOServiceMatchedState = 0x00000004, + kIOServiceFirstPublishState = 0x00000008, + kIOServiceFirstMatchState = 0x00000010 +}; + +enum { + // options for registerService() + kIOServiceExclusive = 0x00000001, + + // options for terminate() + kIOServiceRequired = 0x00000001, + kIOServiceTerminate = 0x00000004, + kIOServiceTerminateWithRematch = 0x00000010, + + // options for registerService() & terminate() + kIOServiceSynchronous = 0x00000002, + // options for registerService() + kIOServiceAsynchronous = 0x00000008 +}; + +// options for open() +enum { + kIOServiceSeize = 0x00000001, + kIOServiceFamilyOpenOptions = 0xffff0000 +}; + +// options for close() +enum { + kIOServiceFamilyCloseOptions = 0xffff0000 +}; + +typedef void * IONotificationRef; + +extern const IORegistryPlane * gIOServicePlane; +extern const IORegistryPlane * gIOPowerPlane; + +extern const OSSymbol * gIOResourcesKey; +extern const OSSymbol * gIOResourceMatchKey; +extern const OSSymbol * gIOResourceMatchedKey; +extern const OSSymbol * gIOResourceIOKitKey; + +extern const OSSymbol * gIOProviderClassKey; +extern const OSSymbol * gIONameMatchKey; +extern const OSSymbol * gIONameMatchedKey; +extern const OSSymbol * gIOPropertyMatchKey; +extern const OSSymbol * gIOPropertyExistsMatchKey; +extern const OSSymbol * gIOLocationMatchKey; +extern const OSSymbol * gIOParentMatchKey; +extern const OSSymbol * gIOPathMatchKey; +extern const OSSymbol * gIOMatchCategoryKey; +extern const OSSymbol * gIODefaultMatchCategoryKey; +extern const OSSymbol * gIOMatchedServiceCountKey; +extern const OSSymbol * gIOMatchedPersonalityKey; +extern const OSSymbol * gIORematchPersonalityKey; +extern const OSSymbol * gIORematchCountKey; +extern const OSSymbol * gIODEXTMatchCountKey; + +extern const OSSymbol * gIOUserClientClassKey; + +extern const OSSymbol * gIOUserClassKey; +extern const OSSymbol * gIOUserServerClassKey; +extern const OSSymbol * gIOUserServerNameKey; +extern const OSSymbol * gIOUserServerTagKey; +extern const OSSymbol * gIOUserServerCDHashKey; +extern const OSSymbol * gIOUserUserClientKey; + +extern const OSSymbol * gIOKitDebugKey; +extern const OSSymbol * gIOServiceKey; + +extern const OSSymbol * gIOCommandPoolSizeKey; + +extern const OSSymbol * gIOPublishNotification; +extern const OSSymbol * gIOFirstPublishNotification; +extern const OSSymbol * gIOMatchedNotification; +extern const OSSymbol * gIOFirstMatchNotification; +extern const OSSymbol * gIOTerminatedNotification; +extern const OSSymbol * gIOWillTerminateNotification; + +extern const OSSymbol * gIOGeneralInterest; +extern const OSSymbol * gIOBusyInterest; +extern const OSSymbol * gIOOpenInterest; +extern const OSSymbol * gIOAppPowerStateInterest; +extern const OSSymbol * gIOPriorityPowerStateInterest; +extern const OSSymbol * gIOConsoleSecurityInterest; + +extern const OSSymbol * gIODeviceMemoryKey; +extern const OSSymbol * gIOInterruptControllersKey; +extern const OSSymbol * gIOInterruptSpecifiersKey; + +extern const OSSymbol * gIOSupportedPropertiesKey; +extern const OSSymbol * gIOUserServicePropertiesKey; + +extern const OSSymbol * gIOBSDKey; +extern const OSSymbol * gIOBSDNameKey; +extern const OSSymbol * gIOBSDMajorKey; +extern const OSSymbol * gIOBSDMinorKey; +extern const OSSymbol * gIOBSDUnitKey; + +extern const OSSymbol * gIODriverKitEntitlementKey; +extern const OSSymbol * gIOServiceDEXTEntitlementsKey; +extern const OSSymbol * gIODriverKitUserClientEntitlementsKey; +extern const OSSymbol * gIODriverKitUserClientEntitlementAllowAnyKey; +extern const OSSymbol * gIOMatchDeferKey; + +extern SInt32 IOServiceOrdering( const OSMetaClassBase * inObj1, const OSMetaClassBase * inObj2, void * ref ); + +typedef void (*IOInterruptAction)( OSObject * target, void * refCon, + IOService * nub, int source ); + +#ifdef __BLOCKS__ +typedef void (^IOInterruptActionBlock)(IOService * nub, int source); +#endif /* __BLOCKS__ */ + +/*! @typedef IOServiceNotificationHandler + * @param target Reference supplied when the notification was registered. + * @param refCon Reference constant supplied when the notification was registered. + * @param newService The IOService object the notification is delivering. It is retained for the duration of the handler's invocation and doesn't need to be released by the handler. */ + +typedef bool (*IOServiceNotificationHandler)( void * target, void * refCon, + IOService * newService ); + +typedef bool (*IOServiceMatchingNotificationHandler)( void * target, void * refCon, + IOService * newService, + IONotifier * notifier ); + +#ifdef __BLOCKS__ +typedef bool (^IOServiceMatchingNotificationHandlerBlock)(IOService * newService, + IONotifier * notifier ); +#endif /* __BLOCKS__ */ + + +/*! @typedef IOServiceInterestHandler + * @param target Reference supplied when the notification was registered. + * @param refCon Reference constant supplied when the notification was registered. + * @param messageType Type of the message - IOKit defined in IOKit/IOMessage.h or family specific. + * @param provider The IOService object who is delivering the notification. It is retained for the duration of the handler's invocation and doesn't need to be released by the handler. + * @param messageArgument An argument for message, dependent on its type. + * @param argSize Non zero if the argument represents a struct of that size, used when delivering messages outside the kernel. */ + +typedef IOReturn (*IOServiceInterestHandler)( void * target, void * refCon, + UInt32 messageType, IOService * provider, + void * messageArgument, vm_size_t argSize ); + +#ifdef __BLOCKS__ +typedef IOReturn (^IOServiceInterestHandlerBlock)( uint32_t messageType, IOService * provider, + void * messageArgument, size_t argSize ); +#endif /* __BLOCKS__ */ + +typedef void (*IOServiceApplierFunction)(IOService * service, void * context); +typedef void (*OSObjectApplierFunction)(OSObject * object, void * context); + +class IOUserClient; +class IOPlatformExpert; + +/*! @class IOService + * @abstract The base class for most I/O Kit families, devices, and drivers. + * @discussion The IOService base class defines APIs used to publish services, instantiate other services based on the existance of a providing service (ie. driver stacking), destroy a service and its dependent stack, notify interested parties of service state changes, and general utility functions useful across all families. + * + * Types of service are specified with a matching dictionary that describes properties of the service. For example, a matching dictionary might describe any IOUSBDevice (or subclass), an IOUSBDevice with a certain class code, or a IOPCIDevice with a set of matching names or device & vendor IDs. Since the matching dictionary is interpreted by the family which created the service, as well as generically by IOService, the list of properties considered for matching depends on the familiy. + * + * Matching dictionaries are associated with IOService classes by the catalogue, as driver property tables, and also supplied by clients of the notification APIs. + * + * IOService provides matching based on C++ class (via OSMetaClass dynamic casting), registry entry name, a registry path to the service (which includes device tree paths), a name assigned by BSD, or by its location (its point of attachment). + * + *

Driver Instantiation by IOService

+ * + * Drivers are subclasses of IOService, and their availability is managed through the catalogue. They are instantiated based on the publication of an IOService they use (for example, an IOPCIDevice or IOUSBDevice), or when they are added to the catalogue and the IOService(s) they use are already available. + * + * When an IOService (the "provider") is published with the @link registerService registerService@/link method, the matching and probing process begins, which is always single threaded per provider. A list of matching dictionaries from the catalog and installed publish notification requests, that successfully match the IOService, is constructed, with ordering supplied by kIOProbeScoreKey ("IOProbeScore") property in the dictionary, or supplied with the notification. + * + * Each entry in the list is then processed in order - for notifications, the notification is delivered, for driver property tables a lot more happens. + * + * The driver class is instantiated and init() called with its property table. The new driver instance is then attached to the provider, and has its @link probe probe@/link method called with the provider as an argument. The default probe method does nothing but return success, but a driver may implement this method to interrogate the provider to make sure it can work with it. It may also modify its probe score at this time. After probe, the driver is detached and the next in the list is considered (ie. attached, probed, and detached). + * + * When the probing phase is complete, the list consists of successfully probed drivers, in order of their probe score (after adjustment during the @link probe probe@/link call). The list is then divided into categories based on the kIOMatchCategoryKey property ("IOMatchCategory"); drivers without a match category are all considered in one default category. Match categories allow multiple clients of a provider to be attached and started, though the provider may also enforce open/close semantics to gain active access to it. + * + * For each category, the highest scoring driver in that category is attached to the provider, and its @link start start@/link method called. If start is successful, the rest of the drivers in the same match category are discarded, otherwise the next highest scoring driver is started, and so on. + * + * The driver should only consider itself in action when the start method is called, meaning it has been selected for use on the provider, and consuming that particular match category. It should also be prepared to be allocated, probed and freed even if the probe was successful. + * + * After the drivers have all synchronously been started, the installed "matched" notifications that match the registered IOService are delivered. + * + *

Properties used by IOService

+ * + * kIOClassKey, extern const OSSymbol * gIOClassKey, "IOClass" + *
+ *
+ * Class of the driver to instantiate on matching providers. + *
+ *
+ * kIOProviderClassKey, extern const OSSymbol * gIOProviderClassKey, "IOProviderClass" + *
+ *
+ * Class of the provider(s) to be considered for matching, checked with OSDynamicCast so subclasses will also match. + *
+ *
+ * kIOProbeScoreKey, extern const OSSymbol * gIOProbeScoreKey, "IOProbeScore" + *
+ *
+ * The probe score initially used to order multiple matching drivers. + *
+ *
+ * kIOMatchCategoryKey, extern const OSSymbol * gIOMatchCategoryKey, "IOMatchCategory" + *
+ *
+ * A string defining the driver category for matching purposes. All drivers with no IOMatchCategory property are considered to be in the same default category. Only one driver in a category can be started on each provider. + *
+ *
+ * kIONameMatchKey, extern const OSSymbol * gIONameMatchKey, "IONameMatch" + *
+ * A string or collection of strings that match the provider's name. The comparison is implemented with the @link //apple_ref/cpp/instm/IORegistryEntry/compareNames/virtualbool/(OSObject*,OSString**) IORegistryEntry::compareNames@/link method, which supports a single string, or any collection (OSArray, OSSet, OSDictionary etc.) of strings. IOService objects with device tree properties (eg. IOPCIDevice) will also be matched based on that standard's "compatible", "name", "device_type" properties. The matching name will be left in the driver's property table in the kIONameMatchedKey property. + *
+ * Examples + *
+ *  @textblock
+ *   IONameMatch
+ *   pci106b,7
+ *  @/textblock
+ *  
+ * + * For a list of possible matching names, a serialized array of strings should used, eg. + *
+ *  @textblock
+ *   IONameMatch
+ *   
+ *       APPL,happy16
+ *       pci106b,7
+ *   
+ *  @/textblock
+ *  
+ * + *
+ * kIONameMatchedKey, extern const OSSymbol * gIONameMatchedKey, "IONameMatched" + *
+ * The name successfully matched name from the kIONameMatchKey property will be left in the driver's property table as the kIONameMatchedKey property. + *
+ *
+ * kIOPropertyMatchKey, extern const OSSymbol * gIOPropertyMatchKey, "IOPropertyMatch" + *
+ * A dictionary of properties that each must exist in the matching IOService and compare successfully with the isEqualTo method. + * + *
+ *  @textblock
+ *   IOPropertyMatch
+ *   
+ *       APPL,happy16
+ *       APPL,meek8
+ *   
+ *  @/textblock
+ *  
+ * + *
+ * kIOUserClientClassKey, extern const OSSymbol * gIOUserClientClassKey, "IOUserClientClass" + *
+ * The class name that the service will attempt to allocate when a user client connection is requested. First the device nub is queried, then the nub's provider is queried by default. + *
+ *
+ * kIOKitDebugKey, extern const OSSymbol * gIOKitDebugKey, "IOKitDebug" + *
+ * Set some debug flags for logging the driver loading process. Flags are defined in IOKit/IOKitDebug.h, but 65535 works well.*/ + +struct IOInterruptAccountingData; +struct IOInterruptAccountingReporter; +struct OSObjectUserVars; + +class IOService : public IORegistryEntry +{ + OSDeclareDefaultStructorsWithDispatch(IOService); + +protected: +/*! @struct ExpansionData + * @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { + uint64_t authorizationID; + /* + * Variables associated with interrupt accounting. Consists of an array + * (that pairs reporters with opaque "statistics" objects), the count for + * the array, and a lock to guard both of the former variables. The lock + * is necessary as IOReporting will not update reports in a manner that is + * synchonized with the service (i.e, on a workloop). + */ + IOLock * interruptStatisticsLock; + IOInterruptAccountingReporter * interruptStatisticsArray; + int interruptStatisticsArrayCount; + + OSObjectUserVars * uvars; + }; + +/*! @var reserved + * Reserved for future use. (Internal use only) */ + APPLE_KEXT_WSHADOW_PUSH; + ExpansionData * reserved; + APPLE_KEXT_WSHADOW_POP; + +private: + IOService * __provider; + SInt32 __providerGeneration; + IOService * __owner; + IOOptionBits __state[2]; + uint64_t __timeBusy; + uint64_t __accumBusy; + IOServicePM * pwrMgt; + +protected: +// TRUE once PMinit has been called + bool initialized; + +public: +// DEPRECATED + void * pm_vars; + +public: +/* methods available in Mac OS X 10.1 or later */ +/*! @function requestTerminate + * @abstract Passes a termination up the stack. + * @discussion When an IOService is made inactive the default behavior is to also make any of its clients that have it as their only provider also inactive, in this way recursing the termination up the driver stack. This method allows an IOService object to override this behavior. Returning true from this method when passed a just terminated provider will cause the client to also be terminated. + * @param provider The terminated provider of this object. + * @param options Options originally passed to terminate, plus kIOServiceRecursing. + * @result true if this object should be terminated now that its provider has been. */ + + virtual bool requestTerminate( IOService * provider, IOOptionBits options ); + +/*! @function willTerminate + * @abstract Passes a termination up the stack. + * @discussion Notification that a provider has been terminated, sent before recursing up the stack, in root-to-leaf order. + * @param provider The terminated provider of this object. + * @param options Options originally passed to terminate. + * @result true. */ + + virtual bool willTerminate( IOService * provider, IOOptionBits options ); + +/*! @function didTerminate + * @abstract Passes a termination up the stack. + * @discussion Notification that a provider has been terminated, sent after recursing up the stack, in leaf-to-root order. + * @param provider The terminated provider of this object. + * @param options Options originally passed to terminate. + * @param defer If there is pending I/O that requires this object to persist, and the provider is not opened by this object set defer to true and call the IOService::didTerminate() implementation when the I/O completes. Otherwise, leave defer set to its default value of false. + * @result true. */ + + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ); + +/*! @function nextIdleTimeout + * @availability Mac OS X v10.4 and later + * @abstract Allows subclasses to customize idle power management behavior. + * @discussion Returns the next time that the device should idle into its next lower power state. Subclasses may override for custom idle behavior. + * + * A power managed driver might override this method to provide a more sophisticated idle power off algorithm than the one defined by power management. + * @param currentTime The current time + * @param lastActivity The time of last activity on this device + * @param powerState The device's current power state. + * @result Returns the next time the device should idle off (in seconds, relative to the current time). */ + + virtual SInt32 nextIdleTimeout(AbsoluteTime currentTime, + AbsoluteTime lastActivity, unsigned int powerState); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_5 +/*! @function systemWillShutdown + * @availability Mac OS X v10.5 and later + * @abstract Notifies members of the power plane of system shutdown and restart. + * @discussion This function is called for all members of the power plane in leaf-to-root order. If a subclass needs to wait for a pending I/O, then the call to systemWillShutdown should be postponed until the I/O completes. + * + * Any power managed driver (which has called @link joinPMtree joinPMtree@/link to join the power plane) interested in taking action at system shutdown or restart should override this method. + * @param specifier kIOMessageSystemWillPowerOff or kIOMessageSystemWillRestart. */ + + virtual void systemWillShutdown( IOOptionBits specifier ); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 +/*! @function copyClientWithCategory + * @availability Mac OS X v10.6 and later + * @param category An OSSymbol corresponding to an IOMatchCategory matching property. + * @result Returns a reference to the IOService child with the given category. The result should be released by the caller. + */ + + virtual IOService * copyClientWithCategory( const OSSymbol * category ); +#endif + +public: + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9 + +/*! @function configureReport + * @abstract configure IOReporting channels + * @availability SPI on OS X v10.9 / iOS 7 and later + * + * @param channels - channels to configure + * @param action - enable/disable/size, etc + * @param result - action-specific returned value + * @param destination - action-specific default destination + */ + virtual IOReturn configureReport(IOReportChannelList *channels, + IOReportConfigureAction action, + void *result, + void *destination); + +/*! @function updateReport + * @abstract request current data for the specified channels + * @availability SPI on OS X 10.9 / iOS 7 and later + * + * @param channels - channels to be updated + * @param action - type/style of update + * @param result - returned details about what was updated + * @param destination - destination for this update (action-specific) + */ + virtual IOReturn updateReport(IOReportChannelList *channels, + IOReportUpdateAction action, + void *result, + void *destination); + +#endif + +private: +#if __LP64__ + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9 + OSMetaClassDeclareReservedUsed(IOService, 0); + OSMetaClassDeclareReservedUsed(IOService, 1); +#else + OSMetaClassDeclareReservedUnused(IOService, 0); + OSMetaClassDeclareReservedUnused(IOService, 1); +#endif + + OSMetaClassDeclareReservedUnused(IOService, 2); + OSMetaClassDeclareReservedUnused(IOService, 3); + OSMetaClassDeclareReservedUnused(IOService, 4); + OSMetaClassDeclareReservedUnused(IOService, 5); + OSMetaClassDeclareReservedUnused(IOService, 6); + OSMetaClassDeclareReservedUnused(IOService, 7); +#else + OSMetaClassDeclareReservedUsed(IOService, 0); + OSMetaClassDeclareReservedUsed(IOService, 1); + OSMetaClassDeclareReservedUsed(IOService, 2); + OSMetaClassDeclareReservedUsed(IOService, 3); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_5 + OSMetaClassDeclareReservedUsed(IOService, 4); +#else + OSMetaClassDeclareReservedUnused(IOService, 4); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 + OSMetaClassDeclareReservedUsed(IOService, 5); +#else + OSMetaClassDeclareReservedUnused(IOService, 5); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9 + OSMetaClassDeclareReservedUsed(IOService, 6); + OSMetaClassDeclareReservedUsed(IOService, 7); +#else + OSMetaClassDeclareReservedUnused(IOService, 6); + OSMetaClassDeclareReservedUnused(IOService, 7); +#endif + +#endif + + OSMetaClassDeclareReservedUnused(IOService, 8); + OSMetaClassDeclareReservedUnused(IOService, 9); + OSMetaClassDeclareReservedUnused(IOService, 10); + OSMetaClassDeclareReservedUnused(IOService, 11); + OSMetaClassDeclareReservedUnused(IOService, 12); + OSMetaClassDeclareReservedUnused(IOService, 13); + OSMetaClassDeclareReservedUnused(IOService, 14); + OSMetaClassDeclareReservedUnused(IOService, 15); + OSMetaClassDeclareReservedUnused(IOService, 16); + OSMetaClassDeclareReservedUnused(IOService, 17); + OSMetaClassDeclareReservedUnused(IOService, 18); + OSMetaClassDeclareReservedUnused(IOService, 19); + OSMetaClassDeclareReservedUnused(IOService, 20); + OSMetaClassDeclareReservedUnused(IOService, 21); + OSMetaClassDeclareReservedUnused(IOService, 22); + OSMetaClassDeclareReservedUnused(IOService, 23); + OSMetaClassDeclareReservedUnused(IOService, 24); + OSMetaClassDeclareReservedUnused(IOService, 25); + OSMetaClassDeclareReservedUnused(IOService, 26); + OSMetaClassDeclareReservedUnused(IOService, 27); + OSMetaClassDeclareReservedUnused(IOService, 28); + OSMetaClassDeclareReservedUnused(IOService, 29); + OSMetaClassDeclareReservedUnused(IOService, 30); + OSMetaClassDeclareReservedUnused(IOService, 31); + OSMetaClassDeclareReservedUnused(IOService, 32); + OSMetaClassDeclareReservedUnused(IOService, 33); + OSMetaClassDeclareReservedUnused(IOService, 34); + OSMetaClassDeclareReservedUnused(IOService, 35); + OSMetaClassDeclareReservedUnused(IOService, 36); + OSMetaClassDeclareReservedUnused(IOService, 37); + OSMetaClassDeclareReservedUnused(IOService, 38); + OSMetaClassDeclareReservedUnused(IOService, 39); + OSMetaClassDeclareReservedUnused(IOService, 40); + OSMetaClassDeclareReservedUnused(IOService, 41); + OSMetaClassDeclareReservedUnused(IOService, 42); + OSMetaClassDeclareReservedUnused(IOService, 43); + OSMetaClassDeclareReservedUnused(IOService, 44); + OSMetaClassDeclareReservedUnused(IOService, 45); + OSMetaClassDeclareReservedUnused(IOService, 46); + OSMetaClassDeclareReservedUnused(IOService, 47); + +public: +/*! @function getState + * @abstract Accessor for IOService state bits, not normally needed or used outside IOService. + * @result State bits for the IOService, eg. kIOServiceInactiveState, kIOServiceRegisteredState. */ + + virtual IOOptionBits getState( void ) const; + +/*! @function isInactive + * @abstract Checks if the IOService object has been terminated, and is in the process of being destroyed. + * @discussion When an IOService object is successfully terminated, it is immediately made inactive, which blocks further attach()es, matching or notifications occuring on the object. It remains inactive until the last client closes, and is then finalized and destroyed. + * @result true if the IOService object has been terminated. */ + + bool isInactive( void ) const; + +/* Stack creation */ + +/*! @function registerService + * @abstract Starts the registration process for a newly discovered IOService object. + * @discussion This function allows an IOService subclass to be published and made available to possible clients, by starting the registration process and delivering notifications to registered clients. The object should be completely setup and ready to field requests from clients before registerService is called. + * @param options The default zero options mask is recommended and should be used in most cases. The registration process is usually asynchronous, with possible driver probing and notification occurring some time later. kIOServiceSynchronous may be passed to carry out the matching and notification process for currently registered clients before returning to the caller. */ + + virtual void registerService( IOOptionBits options = 0 ); + +/*! @function probe + * @abstract During an IOService object's instantiation, probes a matched service to see if it can be used. + * @discussion The registration process for an IOService object (the provider) includes instantiating possible driver clients. The probe method is called in the client instance to check the matched service can be used before the driver is considered to be started. Since matching screens many possible providers, in many cases the probe method can be left unimplemented by IOService subclasses. The client is already attached to the provider when probe is called. + * @param provider The registered IOService object that matches a driver personality's matching dictionary. + * @param score Pointer to the current driver's probe score, which is used to order multiple matching drivers in the same match category. It defaults to the value of the IOProbeScore property in the drivers property table, or kIODefaultProbeScore if none is specified. The probe method may alter the score to affect start order. + * @result An IOService instance or zero when the probe is unsuccessful. In almost all cases the value of this is returned on success. If another IOService object is returned, the probed instance is detached and freed, and the returned instance is used in its stead for start. */ + + virtual LIBKERN_RETURNS_NOT_RETAINED IOService * probe( IOService * provider, + SInt32 * score ); + +/*! @function start + * @abstract During an IOService object's instantiation, starts the IOService object that has been selected to run on the provider. + * @discussion The start method of an IOService instance is called by its provider when it has been selected (due to its probe score and match category) as the winning client. The client is already attached to the provider when start is called.
Implementations of start must call start on their superclass at an appropriate point. If an implementation of start has already called super::start but subsequently determines that it will fail, it must call super::stop to balance the prior call to super::start and prevent reference leaks. + * @result true if the start was successful; false otherwise (which will cause the instance to be detached and usually freed). */ + + virtual bool start( IOService * provider ); + +/*! @function stop + * @abstract During an IOService termination, the stop method is called in its clients before they are detached & it is destroyed. + * @discussion The termination process for an IOService (the provider) will call stop in each of its clients, after they have closed the provider if they had it open, or immediately on termination. */ + + virtual void stop( IOService * provider ); + +/* Open / Close */ + +/*! @function open + * @abstract Requests active access to a provider. + * @discussion IOService provides generic open and close semantics to track clients of a provider that have established an active datapath. The use of open and @link close close@/link, and rules regarding ownership are family defined, and defined by the @link handleOpen handleOpen@/link and @link handleClose handleClose@/link methods in the provider. Some families will limit access to a provider based on its open state. + * @param forClient Designates the client of the provider requesting the open. + * @param options Options for the open. The provider family may implement options for open; IOService defines only kIOServiceSeize to request the device be withdrawn from its current owner. + * @param arg Family specific arguments which are ignored by IOService. + * @result true if the open was successful; false otherwise. */ + + virtual bool open( IOService * forClient, + IOOptionBits options = 0, + void * arg = NULL ); + +/*! @function close + * @abstract Releases active access to a provider. + * @discussion IOService provides generic open and close semantics to track clients of a provider that have established an active datapath. The use of @link open open@/link and close, and rules regarding ownership are family defined, and defined by the @link handleOpen handleOpen@/link and @link handleClose handleClose@/link methods in the provider. + * @param forClient Designates the client of the provider requesting the close. + * @param options Options available for the close. The provider family may implement options for close; IOService defines none. */ + + virtual void close( IOService * forClient, + IOOptionBits options = 0 ); + +/*! @function isOpen + * @abstract Determines whether a specific, or any, client has an IOService object open. + * @discussion Returns the open state of an IOService object with respect to the specified client, or when it is open by any client. + * @param forClient If non-zero, isOpen returns the open state for that client. If zero is passed, isOpen returns the open state for all clients. + * @result true if the specific, or any, client has the IOService object open. */ + + virtual bool isOpen( const IOService * forClient = NULL ) const; + +/*! @function handleOpen + * @abstract Controls the open / close behavior of an IOService object (overrideable by subclasses). + * @discussion IOService calls this method in its subclasses in response to the @link open open@/link method, so the subclass may implement the request. The default implementation provides single owner access to an IOService object via open. The object is locked via @link lockForArbitration lockForArbitration@/link before handleOpen is called. + * @param forClient Designates the client of the provider requesting the open. + * @param options Options for the open, may be interpreted by the implementor of handleOpen. + * @result trueif the open was successful; false otherwise. */ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + +/*! @function handleClose + * @abstract Controls the open / close behavior of an IOService object (overrideable by subclasses). + * @discussion IOService calls this method in its subclasses in response to the @link close close@/link method, so the subclass may implement the request. The default implementation provides single owner access to an IOService object via @link open open@/link. The object is locked via @link lockForArbitration lockForArbitration@/link before handleClose is called. + * @param forClient Designates the client of the provider requesting the close. + * @param options Options for the close, may be interpreted by the implementor of @link handleOpen handleOpen@/link. */ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + +/*! @function handleIsOpen + * @abstract Controls the open / close behavior of an IOService object (overrideable by subclasses). + * @discussion IOService calls this method in its subclasses in response to the @link open open@/link method, so the subclass may implement the request. The default implementation provides single owner access to an IOService object via @link open open@/link. The object is locked via @link lockForArbitration lockForArbitration@/link before handleIsOpen is called. + * @param forClient If non-zero, isOpen returns the open state for that client. If zero is passed, isOpen returns the open state for all clients. + * @result true if the specific, or any, client has the IOService object open. */ + + virtual bool handleIsOpen( const IOService * forClient ) const; + +/* Stacking change */ + +/*! @function terminate + * @abstract Makes an IOService object inactive and begins its destruction. + * @discussion Registering an IOService object informs possible clients of its existance and instantiates drivers that may be used with it; terminate involves the opposite process of informing clients that an IOService object is no longer able to be used and will be destroyed. By default, if any client has the service open, terminate fails. If the kIOServiceRequired flag is passed however, terminate will be successful though further progress in the destruction of the IOService object will not proceed until the last client has closed it. The service will be made inactive immediately upon successful termination, and all its clients will be notified via their @link message message@/link method with a message of type kIOMessageServiceIsTerminated. Both these actions take place on the caller's thread. After the IOService object is made inactive, further matching or attach calls will fail on it. Each client has its @link stop stop@/link method called upon their close of an inactive IOService object , or on its termination if they do not have it open. After stop, @link detach detach@/link is called in each client. When all clients have been detached, the @link finalize finalize@/link method is called in the inactive service. The termination process is inherently asynchronous because it will be deferred until all clients have chosen to close. + * @param options In most cases no options are needed. kIOServiceSynchronous may be passed to cause terminate to not return until the service is finalized. */ + + virtual bool terminate( IOOptionBits options = 0 ); + +/*! @function finalize + * @abstract Finalizes the destruction of an IOService object. + * @discussion The finalize method is called in an inactive (ie. terminated) IOService object after the last client has detached. IOService's implementation will call @link stop stop@/link, @link close close@/link, and @link detach detach@/link on each provider. When finalize returns, the object's retain count will have no references generated by IOService's registration process. + * @param options The options passed to the @link terminate terminate@/link method of the IOService object are passed on to finalize. + * @result true. */ + + virtual bool finalize( IOOptionBits options ); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 +/*! @function init + * @abstract Initializes generic IOService data structures (expansion data, etc). */ + virtual bool init( OSDictionary * dictionary = NULL ) APPLE_KEXT_OVERRIDE; + +/*! @function init + * @abstract Initializes generic IOService data structures (expansion data, etc). */ + virtual bool init( IORegistryEntry * from, + const IORegistryPlane * inPlane ) APPLE_KEXT_OVERRIDE; +#endif + +/*! @function free + * @abstract Frees data structures that were allocated when power management was initialized on this service. */ + + virtual void free( void ) APPLE_KEXT_OVERRIDE; + +/*! @function lockForArbitration + * @abstract Locks an IOService object against changes in state or ownership. + * @discussion The registration, termination and open / close functions of IOService use lockForArbtration to single-thread access to an IOService object. lockForArbitration grants recursive access to the same thread. + * @param isSuccessRequired If a request for access to an IOService object should be denied if it is terminated, pass false, otherwise pass true. */ + + virtual bool lockForArbitration( bool isSuccessRequired = true ); + +/*! @function unlockForArbitration + * @abstract Unlocks an IOService obkect after a successful @link lockForArbitration lockForArbitration@/link. + * @discussion A thread granted exclusive access to an IOService object should release it with unlockForArbitration. */ + + virtual void unlockForArbitration( void ); + + + +/*! @function terminateClient + * @abstract Passes a termination up the stack. + * @discussion When an IOService object is made inactive the default behavior is to also make any of its clients that have it as their only provider inactive, in this way recursing the termination up the driver stack. This method allows a terminated IOService object to override this behavior. Note the client may also override this behavior by overriding its @link terminate terminate@/link method. + * @param client The client of the terminated provider. + * @param options Options originally passed to @link terminate terminate@/link, plus kIOServiceRecursing. + * @result result of the terminate request on the client. */ + + virtual bool terminateClient( IOService * client, IOOptionBits options ); + +/* Busy state indicates discovery, matching or termination is in progress */ + +/*! @function getBusyState + * @abstract Returns the busyState of an IOService object. + * @discussion Many activities in IOService are asynchronous. When registration, matching, or termination is in progress on an IOService object, its busyState is increased by one. Change in busyState to or from zero also changes the IOService object's provider's busyState by one, which means that an IOService object is marked busy when any of the above activities is ocurring on it or any of its clients. + * @result The busyState value. */ + + virtual UInt32 getBusyState( void ); + +/*! @function adjustBusy + * @abstract Adjusts the busyState of an IOService object. + * @discussion Applies a delta to an IOService object's busyState. A change in the busyState to or from zero will change the IOService object's provider's busyState by one (in the same direction). + * @param delta The delta to be applied to the IOService object's busyState. */ + + virtual void adjustBusy( SInt32 delta ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn waitQuiet(mach_timespec_t * timeout) + APPLE_KEXT_DEPRECATED; + +/*! @function waitQuiet + * @abstract Waits for an IOService object's busyState to be zero. + * @discussion Blocks the caller until an IOService object is non busy. + * @param timeout The maximum time to wait in nanoseconds. Default is to wait forever. + * @result Returns an error code if Mach synchronization primitives fail, kIOReturnTimeout, or kIOReturnSuccess. */ + + IOReturn waitQuiet(uint64_t timeout = UINT64_MAX); + +/* Matching */ + +/*! @function matchPropertyTable + * @abstract Allows a registered IOService object to implement family specific matching. + * @discussion All matching on an IOService object will call this method to allow a family writer to implement matching in addition to the generic methods provided by IOService. The implementer should examine the matching dictionary passed to see if it contains properties the family understands for matching, and use them to match with the IOService object if so. Note that since matching is also carried out by other parts of the I/O Kit, the matching dictionary may contain properties the family does not understand - these should not be considered matching failures. + * @param table The dictionary of properties to be matched against. + * @param score Pointer to the current driver's probe score, which is used to order multiple matching drivers in the same match category. It defaults to the value of the IOProbeScore property in the drivers property table, or kIODefaultProbeScore if none is specified. + * @result false if the family considers the matching dictionary does not match in properties it understands; true otherwise. */ + + virtual bool matchPropertyTable( OSDictionary * table, + SInt32 * score ); + + virtual bool matchPropertyTable( OSDictionary * table ); + +/*! @function matchLocation + * @abstract Allows a registered IOService object to direct location matching. + * @discussion By default, a location matching property will be applied to an IOService object's provider. This method allows that behavior to be overridden by families. + * @param client The IOService object at which matching is taking place. + * @result Returns the IOService instance to be used for location matching. */ + + virtual LIBKERN_RETURNS_NOT_RETAINED IOService * matchLocation( IOService * client ); + +/* Resource service */ + +/*! @function publishResource + * @abstract Uses the resource service to publish a property. + * @discussion The resource service uses IOService's matching and notification to allow objects to be published and found by any I/O Kit client by a global name. publishResource makes an object available to anyone waiting for it or looking for it in the future. + * @param key An OSSymbol key that globally identifies the object. + * @param value The object to be published. */ + + static void publishResource( const OSSymbol * key, OSObject * value = NULL ); + static void publishUserResource( const OSSymbol * key, OSObject * value = NULL ); + +/*! @function publishResource + * @abstract Uses the resource service to publish a property. + * @discussion The resource service uses IOService object's matching and notification to allow objects to be published and found by any I/O Kit client by a global name. publishResource makes an object available to anyone waiting for it or looking for it in the future. + * @param key A C string key that globally identifies the object. + * @param value The object to be published. */ + + static void publishResource( const char * key, OSObject * value = NULL ); + virtual bool addNeededResource( const char * key ); + +/* Notifications */ + +/*! @function addNotification + * @abstract Deprecated use addMatchingNotification(). Adds a persistant notification handler to be notified of IOService events. + * @discussion IOService will deliver notifications of changes in state of an IOService object to registered clients. The type of notification is specified by a symbol, for example gIOMatchedNotification or gIOTerminatedNotification, and notifications will only include IOService objects that match the supplied matching dictionary. Notifications are ordered by a priority set with addNotification. When the notification is installed, its handler will be called with each of any currently existing IOService objects that are in the correct state (eg. registered) and match the supplied matching dictionary, avoiding races between finding preexisting and new IOService events. The notification request is identified by an instance of an IONotifier object, through which it can be enabled, disabled, or removed. addNotification consumes a retain count on the matching dictionary when the notification is removed. + * @param type An OSSymbol identifying the type of notification and IOService state: + *
gIOPublishNotification Delivered when an IOService object is registered. + *
gIOFirstPublishNotification Delivered when an IOService object is registered, but only once per IOService instance. Some IOService objects may be reregistered when their state is changed. + *
gIOMatchedNotification Delivered when an IOService object has been matched with all client drivers, and they have been probed and started. + *
gIOFirstMatchNotification Delivered when an IOService object has been matched with all client drivers, but only once per IOService instance. Some IOService objects may be reregistered when their state is changed. + *
gIOWillTerminateNotification Delivered after an IOService object has been terminated, during its finalize stage. Delivered after any matching on the service has finished. + *
gIOTerminatedNotification Delivered immediately when an IOService object has been terminated, making it inactive. + * @param matching A matching dictionary to restrict notifications to only matching IOService objects. The dictionary will be released when the notification is removed, consuming the passed-in reference. + * @param handler A C function callback to deliver notifications. + * @param target An instance reference for the callback's use. + * @param ref A reference constant for the callback's use. + * @param priority A constant ordering all notifications of a each type. + * @result An instance of an IONotifier object that can be used to control or destroy the notification request. */ + + static IONotifier * addNotification( + const OSSymbol * type, OSDictionary * matching, + IOServiceNotificationHandler handler, + void * target, void * ref = NULL, + SInt32 priority = 0 ) + APPLE_KEXT_DEPRECATED; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 +/*! @function addMatchingNotification + * @abstract Adds a persistant notification handler to be notified of IOService events. + * @discussion IOService will deliver notifications of changes in state of an IOService object to registered clients. The type of notification is specified by a symbol, for example gIOMatchedNotification or gIOTerminatedNotification, and notifications will only include IOService objects that match the supplied matching dictionary. Notifications are ordered by a priority set with addNotification. When the notification is installed, its handler will be called with each of any currently existing IOService objects that are in the correct state (eg. registered) and match the supplied matching dictionary, avoiding races between finding preexisting and new IOService events. The notification request is identified by an instance of an IONotifier object, through which it can be enabled, disabled, or removed. addMatchingNotification does not consume a reference on the matching dictionary when the notification is removed, unlike addNotification. + * @param type An OSSymbol identifying the type of notification and IOService state: + *
gIOPublishNotification Delivered when an IOService object is registered. + *
gIOFirstPublishNotification Delivered when an IOService object is registered, but only once per IOService instance. Some IOService objects may be reregistered when their state is changed. + *
gIOMatchedNotification Delivered when an IOService object has been matched with all client drivers, and they have been probed and started. + *
gIOFirstMatchNotification Delivered when an IOService object has been matched with all client drivers, but only once per IOService instance. Some IOService objects may be reregistered when their state is changed. + *
gIOWillTerminateNotification Delivered after an IOService object has been terminated, during its finalize stage. Delivered after any matching on the service has finished. + *
gIOTerminatedNotification Delivered immediately when an IOService object has been terminated, making it inactive. + * @param matching A matching dictionary to restrict notifications to only matching IOService objects. The dictionary is retained while the notification is installed. (Differs from addNotification). + * @param handler A C function callback to deliver notifications. + * @param target An instance reference for the callback's use. + * @param ref A reference constant for the callback's use. + * @param priority A constant ordering all notifications of a each type. + * @result An instance of an IONotifier object that can be used to control or destroy the notification request. */ + + static IONotifier * addMatchingNotification( + const OSSymbol * type, OSDictionary * matching, + IOServiceMatchingNotificationHandler handler, + void * target, void * ref = NULL, + SInt32 priority = 0 ); +#endif + + +#ifdef __BLOCKS__ + static IONotifier * addMatchingNotification( + const OSSymbol * type, OSDictionary * matching, + SInt32 priority, + IOServiceMatchingNotificationHandlerBlock handler); +#endif /* __BLOCKS__ */ + +/*! @function waitForService + * @abstract Deprecated use waitForMatchingService(). Waits for a matching to service to be published. + * @discussion Provides a method of waiting for an IOService object matching the supplied matching dictionary to be registered and fully matched. + * @param matching The matching dictionary describing the desired IOService object. waitForService consumes one reference of the matching dictionary. + * @param timeout The maximum time to wait. + * @result A published IOService object matching the supplied dictionary. */ + + static LIBKERN_RETURNS_NOT_RETAINED IOService * waitForService( + LIBKERN_CONSUMED OSDictionary * matching, + mach_timespec_t * timeout = NULL); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 +/*! @function waitForMatchingService + * @abstract Waits for a matching to service to be published. + * @discussion Provides a method of waiting for an IOService object matching the supplied matching dictionary to be registered and fully matched. + * @param matching The matching dictionary describing the desired IOService object. (Does not consume a reference of the matching dictionary - differs from waitForService() which does consume a reference on the matching dictionary.) + * @param timeout The maximum time to wait in nanoseconds. Default is to wait forever. + * @result A published IOService object matching the supplied dictionary. waitForMatchingService returns a reference to the IOService which should be released by the caller. (Differs from waitForService() which does not retain the returned object.) */ + + static IOService * waitForMatchingService( OSDictionary * matching, + uint64_t timeout = UINT64_MAX); +#endif + +/*! @function getMatchingServices + * @abstract Finds the set of current published IOService objects matching a matching dictionary. + * @discussion Provides a method of finding the current set of published IOService objects matching the supplied matching dictionary. + * @param matching The matching dictionary describing the desired IOService objects. + * @result An instance of an iterator over a set of IOService objects. To be released by the caller. */ + + static OSIterator * getMatchingServices( OSDictionary * matching ); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9 +/*! @function copyMatchingService + * @abstract Finds one of the current published IOService objects matching a matching dictionary. + * @discussion Provides a method to find one member of the set of published IOService objects matching the supplied matching dictionary. + * @param matching The matching dictionary describing the desired IOService object. + * @result The IOService object or NULL. To be released by the caller. */ + + static IOService * copyMatchingService( OSDictionary * matching ); +#endif + +public: +/* Helpers to make matching dictionaries for simple cases, + * they add keys to an existing dictionary, or create one. */ + +/*! @function serviceMatching + * @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService class match. + * @discussion A very common matching criteria for IOService object is based on its class. serviceMatching creates a matching dictionary that specifies any IOService object of a class, or its subclasses. The class is specified by name, and an existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + * @param className The class name, as a const C string. Class matching is successful on IOService objects of this class or any subclass. + * @param table If zero, serviceMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + * @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * serviceMatching( const char * className, + OSDictionary * table = NULL ); + +/*! @function serviceMatching + * @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService class match. + * @discussion A very common matching criteria for IOService object is based on its class. serviceMatching creates a matching dictionary that specifies any IOService of a class, or its subclasses. The class is specified by name, and an existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + * @param className The class name, as an OSString (which includes OSSymbol). Class matching is successful on IOService objects of this class or any subclass. + * @param table If zero, serviceMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + * @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * serviceMatching( const OSString * className, + OSDictionary * table = NULL ); + +/*! @function nameMatching + * @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService name match. + * @discussion A very common matching criteria for IOService object is based on its name. nameMatching creates a matching dictionary that specifies any IOService object which responds successfully to the @link //apple_ref/cpp/instm/IORegistryEntry/compareName/virtualbool/(OSString*,OSString**) IORegistryEntry::compareName@/link method. An existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + * @param name The service's name, as a const C string. Name matching is successful on IOService objects that respond successfully to the IORegistryEntry::compareName method. + * @param table If zero, nameMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + * @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * nameMatching( const char * name, + OSDictionary * table = NULL ); + +/*! @function nameMatching + * @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService name match. + * @discussion A very common matching criteria for IOService object is based on its name. nameMatching creates a matching dictionary that specifies any IOService object which responds successfully to the @link //apple_ref/cpp/instm/IORegistryEntry/compareName/virtualbool/(OSString*,OSString**) IORegistryEntry::compareName@/link method. An existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + * @param name The service's name, as an OSString (which includes OSSymbol). Name matching is successful on IOService objects that respond successfully to the IORegistryEntry::compareName method. + * @param table If zero, nameMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + * @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * nameMatching( const OSString* name, + OSDictionary * table = NULL ); + +/*! @function resourceMatching + * @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify a resource service match. + * @discussion IOService maintains a resource service IOResources that allows objects to be published and found globally in the I/O Kit based on a name, using the standard IOService matching and notification calls. + * @param name The resource name, as a const C string. Resource matching is successful when an object by that name has been published with the publishResource method. + * @param table If zero, resourceMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + * @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * resourceMatching( const char * name, + OSDictionary * table = NULL ); + +/*! @function resourceMatching + * @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify a resource service match. + * @discussion IOService maintains a resource service IOResources that allows objects to be published and found globally in the I/O Kit based on a name, using the standard IOService matching and notification calls. + * @param name The resource name, as an OSString (which includes OSSymbol). Resource matching is successful when an object by that name has been published with the publishResource method. + * @param table If zero, resourceMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + * @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * resourceMatching( const OSString * name, + OSDictionary * table = NULL ); + + +/*! @function propertyMatching + * @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService phandle match. + * @discussion TODO A very common matching criteria for IOService is based on its name. nameMatching will create a matching dictionary that specifies any IOService which respond successfully to the IORegistryEntry method compareName. An existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + * @param key The service's phandle, as a const UInt32. PHandle matching is successful on IOService objects that respond successfully to the IORegistryEntry method compareName. + * @param value The service's phandle, as a const UInt32. PHandle matching is successful on IOService's which respond successfully to the IORegistryEntry method compareName. + * @param table If zero, nameMatching will create a matching dictionary and return a reference to it, otherwise the matching properties are added to the specified dictionary. + * @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * propertyMatching( const OSSymbol * key, const OSObject * value, + OSDictionary * table = NULL ); + +/*! @function registryEntryIDMatching + * @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify a IORegistryEntryID match. + * @discussion registryEntryIDMatching creates a matching dictionary that specifies the IOService object with the assigned registry entry ID (returned by IORegistryEntry::getRegistryEntryID()). An existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + * @param entryID The service's ID. Matching is successful on the IOService object that return that ID from the IORegistryEntry::getRegistryEntryID() method. + * @param table If zero, registryEntryIDMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + * @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * registryEntryIDMatching( uint64_t entryID, + OSDictionary * table = NULL ); + + +/*! @function addLocation + * @abstract Adds a location matching property to an existing dictionary. + * @discussion This function creates matching properties that specify the location of a IOService object, as an embedded matching dictionary. This matching will be successful on an IOService object that attached to an IOService object which matches this location matching dictionary. + * @param table The matching properties are added to the specified dictionary, which must be non-zero. + * @result The location matching dictionary created is returned on success, or zero on failure. */ + + static OSDictionary * addLocation( OSDictionary * table ); + +/* Helpers for matching dictionaries. */ + +/*! @function compareProperty + * @abstract Compares a property in a matching dictionary with an IOService object's property table. + * @discussion This is a helper function to aid in implementing @link matchPropertyTable matchPropertyTable@/link. If the property specified by key exists in the matching dictionary, it is compared with a property of the same name in the IOService object's property table. The comparison is performed with the isEqualTo method. If the property does not exist in the matching table, success is returned. If the property exists in the matching dictionary but not the IOService property table, failure is returned. + * @param matching The matching dictionary, which must be non-zero. + * @param key The dictionary key specifying the property to be compared, as a C string. + * @result true if the property does not exist in the matching table. If the property exists in the matching dictionary but not the IOService property table, failure is returned. Otherwise the result of calling the property from the matching dictionary's isEqualTo method with the IOService property as an argument is returned. */ + + virtual bool compareProperty( OSDictionary * matching, + const char * key ); +/*! @function compareProperty + * @abstract Compares a property in a matching dictionary with an IOService object's property table. + * @discussion This is a helper function to aid in implementing @link matchPropertyTable matchPropertyTable@/link. If the property specified by key exists in the matching dictionary, it is compared with a property of the same name in the IOService object's property table. The comparison is performed with the isEqualTo method. If the property does not exist in the matching table, success is returned. If the property exists in the matching dictionary but not the IOService property table, failure is returned. + * @param matching The matching dictionary, which must be non-zero. + * @param key The dictionary key specifying the property to be compared, as an OSString (which includes OSSymbol). + * @result true if the property does not exist in the matching table. If the property exists in the matching dictionary but not the IOService property table, failure is returned. Otherwise the result of calling the property from the matching dictionary's isEqualTo method with the IOService property as an argument is returned. */ + + virtual bool compareProperty( OSDictionary * matching, + const OSString * key ); + +/*! @function compareProperties + * @abstract Compares a set of properties in a matching dictionary with an IOService object's property table. + * @discussion This is a helper function to aid in implementing @link matchPropertyTable matchPropertyTable@/link. A collection of dictionary keys specifies properties in a matching dictionary to be compared, with compareProperty, with an IOService object's property table, if compareProperty returns true for each key, success is returned; otherwise failure. + * @param matching The matching dictionary, which must be non-zero. + * @param keys A collection (eg. OSSet, OSArray, OSDictionary) which should contain OSStrings (or OSSymbols) that specify the property keys to be compared. + * @result Success if compareProperty returns true for each key in the collection; otherwise failure. */ + + virtual bool compareProperties( OSDictionary * matching, + OSCollection * keys ); + +/* Client / provider accessors */ + +/*! @function attach + * @abstract Attaches an IOService client to a provider in the I/O Registry. + * @discussion This function called in an IOService client enters the client into the I/O Registry as a child of the provider in the service plane. The provider must be active or the attach will fail. Multiple attach calls to the same provider are no-ops and return success. A client may be attached to multiple providers. Entering an object into the I/O Registry retains both the client and provider until they are detached. + * @param provider The IOService object which will serve as this object's provider. + * @result false if the provider is inactive or on a resource failure; otherwise true. */ + + virtual bool attach( IOService * provider ); + +/*! @function detach + * @abstract Detaches an IOService client from a provider in the I/O Registry. + * @discussion This function called in an IOService client removes the client as a child of the provider in the service plane of the I/O Registry. If the provider is not a parent of the client this is a no-op, otherwise the I/O Registry releases both the client and provider. + * @param provider The IOService object to detach from. */ + + virtual void detach( IOService * provider ); + +/*! @function getProvider + * @abstract Returns an IOService object's primary provider. + * @discussion This function called in an IOService client will return the provider to which it was first attached. Because the majority of IOService objects have only one provider, this is a useful simplification and also supports caching of the provider when the I/O Registry is unchanged. + * @result The first provider of the client, or zero if the IOService object is not attached into the I/O Registry. The provider is retained while the client is attached, and should not be released by the caller. */ + + virtual IOService * getProvider( void ) const; + +/*! @function getWorkLoop + * @abstract Returns the current work loop or provider->getWorkLoop. + * @discussion This function returns a valid work loop that a client can use to add an IOCommandGate to. The intention is that an IOService client has data that needs to be protected but doesn't want to pay the cost of a dedicated thread. This data has to be accessed from a provider's call-out context as well. So to achieve both of these goals the client creates an IOCommandGate to lock access to his data but he registers it with the provider's work loop, i.e. the work loop which will make the completion call-outs. This avoids a potential deadlock because the work loop gate uses a recursive lock, which allows the same lock to be held multiple times by a single thread. + * @result A work loop, either the current work loop or it walks up the @link getProvider getProvider@/link chain calling getWorkLoop. Eventually it will reach a valid work loop-based driver or the root of the I/O tree, where it will return a system-wide work loop. Returns 0 if it fails to find (or create) a work loop.*/ + + virtual IOWorkLoop * getWorkLoop() const; + +/*! @function getProviderIterator + * @abstract Returns an iterator over an IOService object's providers. + * @discussion For those few IOService objects that obtain service from multiple providers, this method supplies an iterator over a client's providers. + * @result An iterator over the providers of the client, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, though they may no longer be attached during the iteration. */ + + virtual OSIterator * getProviderIterator( void ) const; + +/*! @function getOpenProviderIterator + * @abstract Returns an iterator over an client's providers that are currently opened by the client. + * @discussion For those few IOService objects that obtain service from multiple providers, this method supplies an iterator over a client's providers, locking each in turn with @link lockForArbitration lockForArbitration@/link and returning those that have been opened by the client. + * @result An iterator over the providers the client has open, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, and the current entry in the iteration is locked with lockForArbitration, protecting it from state changes. */ + + virtual OSIterator * getOpenProviderIterator( void ) const; + +/*! @function getClient + * @abstract Returns an IOService object's primary client. + * @discussion This function called in an IOService provider will return the first client to attach to it. For IOService objects which have only only one client, this may be a useful simplification. + * @result The first client of the provider, or zero if the IOService object is not attached into the I/O Registry. The client is retained while it is attached, and should not be released by the caller. */ + + virtual IOService * getClient( void ) const; + +/*! @function getClientIterator + * @abstract Returns an iterator over an IOService object's clients. + * @discussion For IOService objects that may have multiple clients, this method supplies an iterator over a provider's clients. + * @result An iterator over the clients of the provider, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, though they may no longer be attached during the iteration. */ + + virtual OSIterator * getClientIterator( void ) const; + +/*! @function getOpenClientIterator + * @abstract Returns an iterator over a provider's clients that currently have opened the provider. + * @discussion For IOService objects that may have multiple clients, this method supplies an iterator over a provider's clients, locking each in turn with @link lockForArbitration lockForArbitration@/link and returning those that have opened the provider. + * @result An iterator over the clients that have opened the provider, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, and the current entry in the iteration is locked with lockForArbitration, protecting it from state changes. */ + + virtual OSIterator * getOpenClientIterator( void ) const; + +/*! @function callPlatformFunction + * @abstract Calls the platform function with the given name. + * @discussion The platform expert or other drivers may implement various functions to control hardware features. callPlatformFunction allows any IOService object to access these functions. Normally callPlatformFunction is called on a service's provider. The provider services the request or passes it to its provider. The system's IOPlatformExpert subclass catches functions it knows about and redirects them into other parts of the service plane. If the IOPlatformExpert subclass cannot execute the function, the base class is called. The IOPlatformExpert base class attempts to find a service to execute the function by looking up the function name in an IOResources name space. A service may publish a service using publishResource(functionName, this). If no service can be found to execute the function an error is returned. + * @param functionName Name of the function to be called. When functionName is a C string, callPlatformFunction converts the C string to an OSSymbol and calls the OSSymbol version of callPlatformFunction. This process can block and should not be used from an interrupt context. + * @param waitForFunction If true, callPlatformFunction will not return until the function has been called. + * @result An IOReturn code; kIOReturnSuccess if the function was successfully executed, kIOReturnUnsupported if a service to execute the function could not be found. Other return codes may be returned by the function.*/ + + virtual IOReturn callPlatformFunction( const OSSymbol * functionName, + bool waitForFunction, + void *param1, void *param2, + void *param3, void *param4 ); + + virtual IOReturn callPlatformFunction( const char * functionName, + bool waitForFunction, + void *param1, void *param2, + void *param3, void *param4 ); + + +/* Some accessors */ + +/*! @function getPlatform + * @abstract Returns a pointer to the platform expert instance for the computer. + * @discussion This method provides an accessor to the platform expert instance for the computer. + * @result A pointer to the IOPlatformExpert instance. It should not be released by the caller. */ + + static IOPlatformExpert * getPlatform( void ); + +/*! @function getPMRootDomain + * @abstract Returns a pointer to the power management root domain instance for the computer. + * @discussion This method provides an accessor to the power management root domain instance for the computer. + * @result A pointer to the power management root domain instance. It should not be released by the caller. */ + + static class IOPMrootDomain * getPMRootDomain( void ); + +/*! @function getServiceRoot + * @abstract Returns a pointer to the root of the service plane. + * @discussion This method provides an accessor to the root of the service plane for the computer. + * @result A pointer to the IOService instance at the root of the service plane. It should not be released by the caller. */ + + static IOService * getServiceRoot( void ); + +/*! @function getResourceService + * @abstract Returns a pointer to the IOResources service. + * @discussion IOService maintains a resource service IOResources that allows objects to be published and found globally in the I/O Kit based on a name, using the standard IOService matching and notification calls. + * @result A pointer to the IOResources instance. It should not be released by the caller. */ + + static IOService * getResourceService( void ); + +/* Allocate resources for a matched service */ + +/*! @function getResources + * @abstract Allocates any needed resources for a published IOService object before clients attach. + * @discussion This method is called during the registration process for an IOService object if there are successful driver matches, before any clients attach. It allows for lazy allocation of resources to an IOService object when a matching driver is found. + * @result An IOReturn code; kIOReturnSuccess is necessary for the IOService object to be successfully used, otherwise the registration process for the object is halted. */ + + virtual IOReturn getResources( void ); + +/* Device memory accessors */ + +/*! @function getDeviceMemoryCount + * @abstract Returns a count of the physical memory ranges available for a device. + * @discussion This method returns the count of physical memory ranges, each represented by an IODeviceMemory instance, that have been allocated for a memory mapped device. + * @result An integer count of the number of ranges available. */ + + virtual IOItemCount getDeviceMemoryCount( void ); + +/*! @function getDeviceMemoryWithIndex + * @abstract Returns an instance of IODeviceMemory representing one of a device's memory mapped ranges. + * @discussion This method returns a pointer to an instance of IODeviceMemory for the physical memory range at the given index for a memory mapped device. + * @param index An index into the array of ranges assigned to the device. + * @result A pointer to an instance of IODeviceMemory, or zero if the index is beyond the count available. The IODeviceMemory is retained by the provider, so is valid while attached, or while any mappings to it exist. It should not be released by the caller. See also @link mapDeviceMemoryWithIndex mapDeviceMemoryWithIndex@/link, which creates a device memory mapping. */ + + virtual IODeviceMemory * getDeviceMemoryWithIndex( unsigned int index ); + +/*! @function mapDeviceMemoryWithIndex + * @abstract Maps a physical range of a device. + * @discussion This method creates a mapping for the IODeviceMemory at the given index, with IODeviceMemory::map(options). The mapping is represented by the returned instance of IOMemoryMap, which should not be released until the mapping is no longer required. + * @param index An index into the array of ranges assigned to the device. + * @result An instance of IOMemoryMap, or zero if the index is beyond the count available. The mapping should be released only when access to it is no longer required. */ + + virtual IOMemoryMap * mapDeviceMemoryWithIndex( unsigned int index, + IOOptionBits options = 0 ); + +/*! @function getDeviceMemory + * @abstract Returns the array of IODeviceMemory objects representing a device's memory mapped ranges. + * @discussion This method returns an array of IODeviceMemory objects representing the physical memory ranges allocated to a memory mapped device. + * @result An OSArray of IODeviceMemory objects, or zero if none are available. The array is retained by the provider, so is valid while attached. */ + + virtual OSArray * getDeviceMemory( void ); + +/*! @function setDeviceMemory + * @abstract Sets the array of IODeviceMemory objects representing a device's memory mapped ranges. + * @discussion This method sets an array of IODeviceMemory objects representing the physical memory ranges allocated to a memory mapped device. + * @param array An OSArray of IODeviceMemory objects, or zero if none are available. The array will be retained by the object. */ + + virtual void setDeviceMemory( OSArray * array ); + +/* Interrupt accessors */ + +/*! @function registerInterrupt + * @abstract Registers a C function interrupt handler for a device supplying interrupts. + * @discussion This method installs a C function interrupt handler to be called at primary interrupt time for a device's interrupt. Only one handler may be installed per interrupt source. IOInterruptEventSource provides a work loop based abstraction for interrupt delivery that may be more appropriate for work loop based drivers. + * @param source The index of the interrupt source in the device. + * @param target An object instance to be passed to the interrupt handler. + * @param handler The C function to be called at primary interrupt time when the interrupt occurs. The handler should process the interrupt by clearing the interrupt, or by disabling the source. + * @param refCon A reference constant for the handler's use. + * @result An IOReturn code.
kIOReturnNoInterrupt is returned if the source is not valid; kIOReturnNoResources is returned if the interrupt already has an installed handler. */ + + virtual IOReturn registerInterrupt(int source, OSObject *target, + IOInterruptAction handler, + void *refCon = NULL); + +#ifdef __BLOCKS__ +/*! @function registerInterrupt + * @abstract Registers a block handler for a device supplying interrupts. + * @discussion This method installs a C function interrupt handler to be called at primary interrupt time for a device's interrupt. Only one handler may be installed per interrupt source. IOInterruptEventSource provides a work loop based abstraction for interrupt delivery that may be more appropriate for work loop based drivers. + * @param source The index of the interrupt source in the device. + * @param target An object instance to be passed to the interrupt handler. + * @param handler The block to be invoked at primary interrupt time when the interrupt occurs. The handler should process the interrupt by clearing the interrupt, or by disabling the source. + * @result An IOReturn code.
kIOReturnNoInterrupt is returned if the source is not valid; kIOReturnNoResources is returned if the interrupt already has an installed handler. */ + + IOReturn registerInterruptBlock(int source, OSObject *target, + IOInterruptActionBlock handler); +#endif /* __BLOCKS__ */ + +/*! @function unregisterInterrupt + * @abstract Removes a C function interrupt handler for a device supplying hardware interrupts. + * @discussion This method removes a C function interrupt handler previously installed with @link registerInterrupt registerInterrupt@/link. + * @param source The index of the interrupt source in the device. + * @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn unregisterInterrupt(int source); + +/*! @function addInterruptStatistics + * @abstract Adds a statistics object to the IOService for the given interrupt. + * @discussion This method associates a set of statistics and a reporter for those statistics with an interrupt for this IOService, so that we can interrogate the IOService for statistics pertaining to that interrupt. + * @param statistics The IOInterruptAccountingData container we wish to associate the IOService with. + * @param source The index of the interrupt source in the device. */ + IOReturn addInterruptStatistics(IOInterruptAccountingData * statistics, int source); + +/*! @function removeInterruptStatistics + * @abstract Removes any statistics from the IOService for the given interrupt. + * @discussion This method disassociates any IOInterruptAccountingData container we may have for the given interrupt from the IOService; this indicates that the the interrupt target (at the moment, likely an IOInterruptEventSource) is being destroyed. + * @param source The index of the interrupt source in the device. */ + IOReturn removeInterruptStatistics(int source); + +/*! @function getInterruptType + * @abstract Returns the type of interrupt used for a device supplying hardware interrupts. + * @param source The index of the interrupt source in the device. + * @param interruptType The interrupt type for the interrupt source will be stored here by getInterruptType.
kIOInterruptTypeEdge will be returned for edge-trigggered sources.
kIOInterruptTypeLevel will be returned for level-trigggered sources. + * @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn getInterruptType(int source, int *interruptType); + +/*! @function enableInterrupt + * @abstract Enables a device interrupt. + * @discussion It is the caller's responsiblity to keep track of the enable state of the interrupt source. + * @param source The index of the interrupt source in the device. + * @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn enableInterrupt(int source); + +/*! @function disableInterrupt + * @abstract Synchronously disables a device interrupt. + * @discussion If the interrupt routine is running, the call will block until the routine completes. It is the caller's responsiblity to keep track of the enable state of the interrupt source. + * @param source The index of the interrupt source in the device. + * @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn disableInterrupt(int source); + +/*! @function causeInterrupt + * @abstract Causes a device interrupt to occur. + * @discussion Emulates a hardware interrupt, to be called from task level. + * @param source The index of the interrupt source in the device. + * @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn causeInterrupt(int source); + +/*! @function requestProbe + * @abstract Requests that hardware be re-scanned for devices. + * @discussion For bus families that do not usually detect device addition or removal, this method represents an external request (eg. from a utility application) to rescan and publish or remove found devices. + * @param options Family defined options, not interpreted by IOService. + * @result An IOReturn code. */ + + virtual IOReturn requestProbe( IOOptionBits options ); + +/* Generic API for non-data-path upstream calls */ + +/*! @function message + * @abstract Receives a generic message delivered from an attached provider. + * @discussion A provider may deliver messages via the message method to its clients informing them of state changes, such as kIOMessageServiceIsTerminated or kIOMessageServiceIsSuspended. Certain messages are defined by the I/O Kit in IOMessage.h while others may be family dependent. This method is implemented in the client to receive messages. + * @param type A type defined in IOMessage.h or defined by the provider family. + * @param provider The provider from which the message originates. + * @param argument An argument defined by the provider family, not used by IOService. + * @result An IOReturn code defined by the message type. */ + + virtual IOReturn message( UInt32 type, IOService * provider, + void * argument = NULL ); + +/*! @function messageClient + * @abstract Sends a generic message to an attached client. + * @discussion A provider may deliver messages via the @link message message@/link method to its clients informing them of state changes, such as kIOMessageServiceIsTerminated or kIOMessageServiceIsSuspended. Certain messages are defined by the I/O Kit in IOMessage.h while others may be family dependent. This method may be called in the provider to send a message to the specified client, which may be useful for overrides. + * @param messageType A type defined in IOMessage.h or defined by the provider family. + * @param client A client of the IOService to send the message. + * @param messageArgument An argument defined by the provider family, not used by IOService. + * @param argSize Specifies the size of messageArgument, in bytes. If argSize is non-zero, messageArgument is treated as a pointer to argSize bytes of data. If argSize is 0 (the default), messageArgument is treated as an ordinal and passed by value. + * @result The return code from the client message call. */ + + virtual IOReturn messageClient( UInt32 messageType, OSObject * client, + void * messageArgument = NULL, vm_size_t argSize = 0 ); + +/*! @function messageClients + * @abstract Sends a generic message to all attached clients. + * @discussion A provider may deliver messages via the @link message message@/link method to its clients informing them of state changes, such as kIOMessageServiceIsTerminated or kIOMessageServiceIsSuspended. Certain messages are defined by the I/O Kit in IOMessage.h while others may be family dependent. This method may be called in the provider to send a message to all the attached clients, via the @link messageClient messageClient@/link method. + * @param type A type defined in IOMessage.h or defined by the provider family. + * @param argument An argument defined by the provider family, not used by IOService. + * @param argSize Specifies the size of argument, in bytes. If argSize is non-zero, argument is treated as a pointer to argSize bytes of data. If argSize is 0 (the default), argument is treated as an ordinal and passed by value. + * @result Any non-kIOReturnSuccess return codes returned by the clients, or kIOReturnSuccess if all return kIOReturnSuccess. */ + + virtual IOReturn messageClients( UInt32 type, + void * argument = NULL, vm_size_t argSize = 0 ); + + virtual IONotifier * registerInterest( const OSSymbol * typeOfInterest, + IOServiceInterestHandler handler, + void * target, void * ref = NULL ); + +#ifdef __BLOCKS__ + IONotifier * registerInterest(const OSSymbol * typeOfInterest, + IOServiceInterestHandlerBlock handler); +#endif /* __BLOCKS__ */ + + virtual void applyToProviders( IOServiceApplierFunction applier, + void * context ); + + virtual void applyToClients( IOServiceApplierFunction applier, + void * context ); + + virtual void applyToInterested( const OSSymbol * typeOfInterest, + OSObjectApplierFunction applier, + void * context ); + + virtual IOReturn acknowledgeNotification( IONotificationRef notification, + IOOptionBits response ); + +/* User client create */ + +/*! @function newUserClient + * @abstract Creates a connection for a non kernel client. + * @discussion A non kernel client may request a connection be opened via the @link //apple_ref/c/func/IOServiceOpen IOServiceOpen@/link library function, which will call this method in an IOService object. The rules and capabilities of user level clients are family dependent, and use the functions of the IOUserClient class for support. IOService's implementation returns kIOReturnUnsupported, so any family supporting user clients must implement this method. + * @param owningTask The Mach task of the client thread in the process of opening the user client. Note that in Mac OS X, each process is based on a Mach task and one or more Mach threads. For more information on the composition of a Mach task and its relationship with Mach threads, see {@linkdoc //apple_ref/doc/uid/TP30000905-CH209-TPXREF103 "Tasks and Threads"}. + * @param securityID A token representing the access level for the task. + * @param type A constant specifying the type of connection to be created, specified by the caller of @link //apple_ref/c/func/IOServiceOpen IOServiceOpen@/link and interpreted only by the family. + * @param handler An instance of an IOUserClient object to represent the connection, which will be released when the connection is closed, or zero if the connection was not opened. + * @param properties A dictionary of additional properties for the connection. + * @result A return code to be passed back to the caller of IOServiceOpen. */ + + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, OSDictionary * properties, + LIBKERN_RETURNS_RETAINED IOUserClient ** handler ); + + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, + LIBKERN_RETURNS_RETAINED IOUserClient ** handler ); + +/* Return code utilities */ + +/*! @function stringFromReturn + * @abstract Supplies a programmer-friendly string from an IOReturn code. + * @discussion Strings are available for the standard return codes in IOReturn.h in IOService, while subclasses may implement this method to interpret family dependent return codes. + * @param rtn The IOReturn code. + * @result A pointer to a constant string, or zero if the return code is unknown. */ + + virtual const char * stringFromReturn( IOReturn rtn ); + +/*! @function errnoFromReturn + * @abstract Translates an IOReturn code to a BSD errno. + * @discussion BSD defines its own return codes for its functions in sys/errno.h, and I/O Kit families may need to supply compliant results in BSD shims. Results are available for the standard return codes in IOReturn.h in IOService, while subclasses may implement this method to interpret family dependent return codes. + * @param rtn The IOReturn code. + * @result The BSD errno or EIO if unknown. */ + + virtual int errnoFromReturn( IOReturn rtn ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* * * * * * * * * * end of IOService API * * * * * * * */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* for IOInterruptController implementors */ + + int _numInterruptSources; + IOInterruptSource *_interruptSources; + +/* overrides */ + virtual bool serializeProperties( OSSerialize * s ) const APPLE_KEXT_OVERRIDE; + + void requireMaxBusStall(UInt32 ns); + void requireMaxInterruptDelay(uint32_t ns); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* * * * * * * * * * * * Internals * * * * * * * * * * * */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +private: + APPLE_KEXT_COMPATIBILITY_VIRTUAL + bool checkResources( void ); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + bool checkResource( OSObject * matching ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void probeCandidates( OSOrderedSet * matches ); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + bool startCandidate( IOService * candidate ); + +public: + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOService * getClientWithCategory( const OSSymbol * category ) + APPLE_KEXT_DEPRECATED; +// copyClientWithCategory is the public replacement + +private: + APPLE_KEXT_COMPATIBILITY_VIRTUAL + bool passiveMatch( OSDictionary * matching, bool changesOK = false); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void startMatching( IOOptionBits options = 0 ); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void doServiceMatch( IOOptionBits options ); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void doServiceTerminate( IOOptionBits options ); + +private: + + bool matchPassive(OSDictionary * table, uint32_t options); + bool matchInternal(OSDictionary * table, uint32_t options, unsigned int * did); + static bool instanceMatch(const OSObject * entry, void * context); + + static OSObject * copyExistingServices( OSDictionary * matching, + IOOptionBits inState, IOOptionBits options = 0 ); + + static IONotifier * setNotification( + const OSSymbol * type, OSDictionary * matching, + IOServiceMatchingNotificationHandler handler, + void * target, void * ref, + SInt32 priority = 0 ); + + static IONotifier * doInstallNotification( + const OSSymbol * type, OSDictionary * matching, + IOServiceMatchingNotificationHandler handler, + void * target, void * ref, + SInt32 priority, OSIterator ** existing ); + + static bool syncNotificationHandler( void * target, void * ref, + IOService * newService, IONotifier * notifier ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void deliverNotification( const OSSymbol * type, + IOOptionBits orNewState, IOOptionBits andNewState ); + + OSArray * copyNotifiers(const OSSymbol * type, + IOOptionBits orNewState, IOOptionBits andNewState); + + bool invokeNotifiers(OSArray * willSend[]); + bool invokeNotifier( class _IOServiceNotifier * notify ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void unregisterAllInterest( void ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn waitForState( UInt32 mask, UInt32 value, + mach_timespec_t * timeout = NULL ); + + IOReturn waitForState( UInt32 mask, UInt32 value, uint64_t timeout ); + + UInt32 _adjustBusy( SInt32 delta ); + + bool terminatePhase1( IOOptionBits options = 0 ); + void scheduleTerminatePhase2( IOOptionBits options = 0 ); + void scheduleStop( IOService * provider ); + + static void waitToBecomeTerminateThread( void ); + static void __attribute__((__noreturn__)) terminateThread( void * arg, wait_result_t unused ); + static void terminateWorker( IOOptionBits options ); + static void actionWillTerminate( IOService * victim, IOOptionBits options, + OSArray * doPhase2List, bool, void * ); + static void actionDidTerminate( IOService * victim, IOOptionBits options, + void *, void *, void *); + + static void actionWillStop( IOService * victim, IOOptionBits options, + void *, void *, void *); + static void actionDidStop( IOService * victim, IOOptionBits options, + void *, void *, void *); + + static void actionFinalize( IOService * victim, IOOptionBits options, + void *, void *, void *); + static void actionStop( IOService * client, IOService * provider, + void *, void *, void *); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn resolveInterrupt(IOService *nub, int source); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn lookupInterrupt( + int source, bool resolve, + LIBKERN_RETURNS_NOT_RETAINED IOInterruptController * + *interruptController); + + +/* power management */ +public: + +/*! @function PMinit + * @abstract Initializes power management for a driver. + * @discussion PMinit allocates and initializes the power management instance variables, and it should be called before accessing those variables or calling the power management methods. This method should be called inside the driver's start routine and must be paired with a call to @link PMstop PMstop@/link. + * Most calls to PMinit are followed by calls to @link joinPMtree joinPMtree@/link and @link registerPowerDriver registerPowerDriver@/link. */ + + virtual void PMinit( void ); + +/*! @function PMstop + * @abstract Stop power managing the driver. + * @discussion Removes the driver from the power plane and stop its power management. This method is synchronous against any power management method invocations (e.g. setPowerState or setAggressiveness), so when this method returns it is guaranteed those power management methods will not be entered. Driver should not call any power management methods after this call. + * Calling PMstop cleans up for the three power management initialization calls: @link PMinit PMinit@/link, @link joinPMtree joinPMtree@/link, and @link registerPowerDriver registerPowerDriver@/link. */ + + virtual void PMstop( void ); + +/*! @function joinPMtree + * @abstract Joins the driver into the power plane of the I/O Registry. + * @discussion A driver uses this method to call its nub when initializing (usually in its start routine after calling @link PMinit PMinit@/link), to be attached into the power management hierarchy (i.e., the power plane). A driver usually calls this method on the driver for the device that provides it power (this is frequently the nub). + * Before this call returns, the caller will probably be called at @link setPowerParent setPowerParent@/link and @link setAggressiveness setAggressiveness@/link and possibly at @link addPowerChild addPowerChild@/link as it is added to the hierarchy. This method may be overridden by a nub subclass. + * @param driver The driver to be added to the power plane, usually this. */ + + virtual void joinPMtree( IOService * driver ); + +/*! @function registerPowerDriver + * @abstract Registers a set of power states that the driver supports. + * @discussion A driver defines its array of supported power states with power management in its power management initialization (its start routine). If successful, power management will call the driver to instruct it to change its power state through @link setPowerState setPowerState@/link. + * Most drivers do not need to override registerPowerDriver. A nub may override registerPowerDriver if it needs to arrange its children in the power plane differently than the default placement, but this is uncommon. + * @param controllingDriver A pointer to the calling driver, usually this. + * @param powerStates A driver-defined array of power states that the driver and device support. Power states are defined in pwr_mgt/IOPMpowerState.h. + * @param numberOfStates The number of power states in the array. + * @result IOPMNoErr. All errors are logged via kprintf. */ + + virtual IOReturn registerPowerDriver( + IOService * controllingDriver, + IOPMPowerState * powerStates, + unsigned long numberOfStates ); + +/*! @function registerInterestedDriver + * @abstract Allows an IOService object to register interest in the changing power state of a power-managed IOService object. + * @discussion Call registerInterestedDriver on the IOService object you are interested in receiving power state messages from, and pass a pointer to the interested driver (this) as an argument. + * The interested driver is retained until the power interest is removed by calling deRegisterInterestedDriver. + * The interested driver should override @link powerStateWillChangeTo powerStateWillChangeTo@/link and @link powerStateDidChangeTo powerStateDidChangeTo@/link to receive these power change messages. + * Interested drivers must acknowledge power changes in powerStateWillChangeTo or powerStateDidChangeTo, either via return value or later calls to @link acknowledgePowerChange acknowledgePowerChange@/link. + * @param theDriver The driver of interest adds this pointer to the list of interested drivers. It informs drivers on this list before and after the power change. + * @result Flags describing the capability of the device in its current power state. If the current power state is not yet defined, zero is returned (this is the case when the driver is not yet in the power domain hierarchy or hasn't fully registered with power management yet). */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOPMPowerFlags registerInterestedDriver( IOService * theDriver ); + +/*! @function deRegisterInterestedDriver + * @abstract De-registers power state interest from a previous call to registerInterestedDriver. + * @discussion The retain from registerInterestedDriver is released. This method is synchronous against any powerStateWillChangeTo or powerStateDidChangeTo call targeting the interested driver, so when this method returns it is guaranteed those interest handlers will not be entered. + * Most drivers do not need to override deRegisterInterestedDriver. + * @param theDriver The interested driver previously passed into @link registerInterestedDriver registerInterestedDriver@/link. + * @result A return code that can be ignored by the caller. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn deRegisterInterestedDriver( IOService * theDriver ); + +/*! @function acknowledgePowerChange + * @abstract Acknowledges an in-progress power state change. + * @discussion When power management informs an interested object (via @link powerStateWillChangeTo powerStateWillChangeTo@/link or @link powerStateDidChangeTo powerStateDidChangeTo@/link), the object can return an immediate acknowledgement via a return code, or it may return an indication that it will acknowledge later by calling acknowledgePowerChange. + * Interested objects are those that have registered as interested drivers, as well as power plane children of the power changing driver. A driver that calls @link registerInterestedDriver registerInterestedDriver@/link must call acknowledgePowerChange, or use an immediate acknowledgement return from powerStateWillChangeTo or powerStateDidChangeTo. + * @param whichDriver A pointer to the calling driver. The called object tracks all interested parties to ensure that all have acknowledged the power state change. + * @result IOPMNoErr. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn acknowledgePowerChange( IOService * whichDriver ); + +/*! @function acknowledgeSetPowerState +* @abstract Acknowledges the belated completion of a driver's setPowerState power state change. +* @discussion After power management instructs a driver to change its state via @link setPowerState setPowerState@/link, that driver must acknowledge the change when its device has completed its transition. The acknowledgement may be immediate, via a return code from setPowerState, or delayed, via this call to acknowledgeSetPowerState. +* Any driver that does not return kIOPMAckImplied from its setPowerState implementation must later call acknowledgeSetPowerState. +* @result IOPMNoErr. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn acknowledgeSetPowerState( void ); + +/*! @function requestPowerDomainState + * @abstract Tells a driver to adjust its power state. + * @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn requestPowerDomainState( + IOPMPowerFlags desiredState, + IOPowerConnection * whichChild, + unsigned long specificationFlags ); + +/*! @function makeUsable + * @abstract Requests that a device become usable. + * @discussion This method is called when some client of a device (or the device's own driver) is asking for the device to become usable. Power management responds by telling the object upon which this method is called to change to its highest power state. + * makeUsable is implemented using @link changePowerStateToPriv changePowerStateToPriv@/link. Subsequent requests for lower power, such as from changePowerStateToPriv, will pre-empt this request. + * @result A return code that can be ignored by the caller. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn makeUsable( void ); + +/*! @function temporaryPowerClampOn + * @abstract A driver calls this method to hold itself in the highest power state until it has children. + * @discussion Use temporaryPowerClampOn to hold your driver in its highest power state while waiting for child devices to attach. After children have attached, the clamp is released and the device's power state is controlled by the children's requirements. + * @result A return code that can be ignored by the caller. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn temporaryPowerClampOn( void ); + +/*! @function changePowerStateTo + * @abstract Sets a driver's power state. + * @discussion This function is one of several that are used to set a driver's power state. In most circumstances, however, you should call @link changePowerStateToPriv changePowerStateToPriv@/link instead. + * Calls to changePowerStateTo, changePowerStateToPriv, and a driver's power children all affect the power state of a driver. For legacy design reasons, they have overlapping functionality. Although you should call changePowerStateToPriv to change your device's power state, you might need to call changePowerStateTo in the following circumstances: + *
  • If a driver will be using changePowerStateToPriv to change its power state, it should call changePowerStateTo(0) in its start routine to eliminate the influence changePowerStateTo has on power state calculations. + *
  • Call changePowerStateTo in conjunction with @link setIdleTimerPeriod setIdleTimerPeriod@/link and @link activityTickle activityTickle@/link to idle a driver into a low power state. For a driver with 3 power states, for example, changePowerStateTo(1) sets a minimum level of power state 1, such that the idle timer period may not set your device's power any lower than state 1.
+ * @param ordinal The number of the desired power state in the power state array. + * @result A return code that can be ignored by the caller. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn changePowerStateTo( unsigned long ordinal ); + +/*! @function currentCapability + * @abstract Finds out the capability of a device's current power state. + * @result A copy of the capabilityFlags field for the current power state in the power state array. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOPMPowerFlags currentCapability( void ); + +/*! @function currentPowerConsumption + * @abstract Finds out the current power consumption of a device. + * @discussion Most Mac OS X power managed drivers do not report their power consumption via the staticPower field. Thus this call will not accurately reflect power consumption for most drivers. + * @result A copy of the staticPower field for the current power state in the power state array. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + unsigned long currentPowerConsumption( void ); + +/*! @function activityTickle + * @abstract Informs power management when a power-managed device is in use, so that power management can track when it is idle and adjust its power state accordingly. + * @discussion The activityTickle method is provided for objects in the system (or for the driver itself) to tell a driver that its device is being used. + * The IOService superclass can manage idleness determination with a simple idle timer mechanism and this activityTickle call. To start this up, the driver calls its superclass's setIdleTimerPeriod. This starts a timer for the time interval specified in the call. When the timer expires, the superclass checks to see if there has been any activity since the last timer expiration. (It checks to see if activityTickle has been called). If there has been activity, it restarts the timer, and this process continues. When the timer expires, and there has been no device activity, the superclass lowers the device power state to the next lower state. This can continue until the device is in state zero. + * After the device has been powered down by at least one power state, a subsequent call to activityTickle causes the device to be switched to a higher state required for the activity. + * If the driver is managing the idleness determination totally on its own, the value of the type parameter should be kIOPMSubclassPolicy, and the driver should override the activityTickle method. The superclass IOService implementation of activityTickle does nothing with the kIOPMSubclassPolicy argument. + * @param type When type is kIOPMSubclassPolicy, activityTickle is not handled in IOService and should be intercepted by the subclass. When type is kIOPMSuperclassPolicy1, an activity flag is set and the device state is checked. If the device has been powered down, it is powered up again. + * @param stateNumber When type is kIOPMSuperclassPolicy1, stateNumber contains the desired power state ordinal for the activity. If the device is in a lower state, the superclass will switch it to this state. This is for devices that can handle some accesses in lower power states; the device is powered up only as far as it needs to be for the activity. + * @result When type is kIOPMSuperclassPolicy1, the superclass returns true if the device is currently in the state specified by stateNumber. If the device is in a lower state and must be powered up, the superclass returns false; in this case the superclass will initiate a power change to power the device up. */ + + virtual bool activityTickle( + unsigned long type, + unsigned long stateNumber = 0 ); + +/*! @function setAggressiveness + * @abstract Broadcasts an aggressiveness factor from the parent of a driver to the driver. + * @discussion Implement setAggressiveness to receive a notification when an "aggressiveness Aggressiveness factors are a loose set of power management variables that contain values for system sleep timeout, display sleep timeout, whether the system is on battery or AC, and other power management features. There are several aggressiveness factors that can be broadcast and a driver may take action on whichever factors apply to it. + * A driver that has joined the power plane via @link joinPMtree joinPMtree@/link will receive setAgressiveness calls when aggressiveness factors change. + * A driver may override this call if it needs to do something with the new factor (such as change its idle timeout). If overridden, the driver must call its superclass's setAgressiveness method in its own setAgressiveness implementation. + * Most drivers do not need to implement setAgressiveness. + * @param type The aggressiveness factor type, such as kPMMinutesToDim, kPMMinutesToSpinDown, kPMMinutesToSleep, and kPMPowerSource. (Aggressiveness factors are defined in pwr_mgt/IOPM.h.) + * @param newLevel The aggressiveness factor's new value. + * @result IOPMNoErr. */ + + virtual IOReturn setAggressiveness( + unsigned long type, + unsigned long newLevel ); + +/*! @function getAggressiveness + * @abstract Returns the current aggressiveness value for the given type. + * @param type The aggressiveness factor to query. + * @param currentLevel Upon successful return, contains the value of aggressiveness factor type. + * @result kIOReturnSuccess upon success; an I/O Kit error code otherwise. */ + + virtual IOReturn getAggressiveness( + unsigned long type, + unsigned long * currentLevel ); + +#ifndef __LP64__ +/*! @function systemWake + * @abstract Tells every driver in the power plane that the system is waking up. + * @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn systemWake( void ) + APPLE_KEXT_DEPRECATED; + +/*! @function temperatureCriticalForZone + * @abstract Alerts a driver to a critical temperature in some thermal zone. + * @discussion This call is unused by power management. It is not intended to be called or overridden. */ + + virtual IOReturn temperatureCriticalForZone( IOService * whichZone ) + APPLE_KEXT_DEPRECATED; + +/*! @function youAreRoot + * @abstract Informs power management which IOService object is the power plane root. + * @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn youAreRoot( void ) + APPLE_KEXT_DEPRECATED; + +/*! @function setPowerParent + * @abstract This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn setPowerParent( + IOPowerConnection * parent, + bool stateKnown, + IOPMPowerFlags currentState ) + APPLE_KEXT_DEPRECATED; +#endif /* !__LP64__ */ + +/*! @function addPowerChild + * @abstract Informs a driver that it has a new child. + * @discussion The Platform Expert uses this method to call a driver and introduce it to a new child. This call is handled internally by power management. It is not intended to be overridden or called by drivers. + * @param theChild A pointer to the child IOService object. */ + + virtual IOReturn addPowerChild( IOService * theChild ); + +/*! @function removePowerChild + * @abstract Informs a power managed driver that one of its power plane childen is disappearing. + * @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn removePowerChild( IOPowerConnection * theChild ); + +#ifndef __LP64__ +/*! @function command_received + * @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual void command_received( void *, void *, void *, void * ); +#endif + +/*! @function start_PM_idle_timer + * @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void start_PM_idle_timer( void ); + +#ifndef __LP64__ +/*! @function PM_idle_timer_expiration + * @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual void PM_idle_timer_expiration( void ) + APPLE_KEXT_DEPRECATED; + +/*! @function PM_Clamp_Timer_Expired + * @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual void PM_Clamp_Timer_Expired( void ) + APPLE_KEXT_DEPRECATED; +#endif + +/*! @function setIdleTimerPeriod + * @abstract Sets or changes the idle timer period. + * @discussion A driver using the idleness determination provided by IOService calls its superclass with this method to set or change the idle timer period. See @link activityTickle activityTickle@/link for a description of this type of idleness determination. + * @param period The desired idle timer period in seconds. + * @result kIOReturnSuccess upon success; an I/O Kit error code otherwise. */ + + virtual IOReturn setIdleTimerPeriod( unsigned long period ); + +#ifndef __LP64__ +/*! @function getPMworkloop + * @abstract Returns a pointer to the system-wide power management work loop. + * @availability Deprecated in Mac OS X version 10.6. + * @discussion Most drivers should create their own work loops to synchronize their code; drivers should not run arbitrary code on the power management work loop. */ + + virtual IOWorkLoop * getPMworkloop( void ) + APPLE_KEXT_DEPRECATED; +#endif + +/*! @function getPowerState + * @abstract Determines a device's power state. + * @discussion A device's "current power state" is updated at the end of each power state transition (e.g. transition from state 1 to state 0, or state 0 to state 2). This transition includes the time spent powering on or off any power plane children. Thus, if a child calls getPowerState on its power parent during system wake from sleep, the call will return the index to the device's off state rather than its on state. + * @result The current power state's index into the device's power state array. */ + + UInt32 getPowerState( void ); + +/*! @function setPowerState + * @abstract Requests a power managed driver to change the power state of its device. + * @discussion A power managed driver must override setPowerState to take part in system power management. After a driver is registered with power management, the system uses setPowerState to power the device off and on for system sleep and wake. + * Calls to @link PMinit PMinit@/link and @link registerPowerDriver registerPowerDriver@/link enable power management to change a device's power state using setPowerState. setPowerState is called in a clean and separate thread context. + * @param powerStateOrdinal The number in the power state array of the state the driver is being instructed to switch to. + * @param whatDevice A pointer to the power management object which registered to manage power for this device. In most cases, whatDevice will be equal to your driver's own this pointer. + * @result The driver must return IOPMAckImplied if it has complied with the request when it returns. Otherwise if it has started the process of changing power state but not finished it, the driver should return a number of microseconds which is an upper limit of the time it will need to finish. Then, when it has completed the power switch, it should call @link acknowledgeSetPowerState acknowledgeSetPowerState@/link. */ + + virtual IOReturn setPowerState( + unsigned long powerStateOrdinal, + IOService * whatDevice ); + +#ifndef __LP64__ +/*! @function clampPowerOn + * @abstract Deprecated. Do not use. */ + + virtual void clampPowerOn( unsigned long duration ); +#endif + +/*! @function maxCapabilityForDomainState + * @abstract Determines a driver's highest power state possible for a given power domain state. + * @discussion This happens when the power domain is changing state and power management needs to determine which state the device is capable of in the new domain state. + * Most drivers do not need to implement this method, and can rely upon the default IOService implementation. The IOService implementation scans the power state array looking for the highest state whose inputPowerRequirement field exactly matches the value of the domainState parameter. If more intelligent determination is required, the driver itself should implement the method and override the superclass's implementation. + * @param domainState Flags that describe the character of "domain power"; they represent the outputPowerCharacter field of a state in the power domain's power state array. + * @result A state number. */ + + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags domainState ); + +/*! @function initialPowerStateForDomainState + * @abstract Determines which power state a device is in, given the current power domain state. + * @discussion Power management calls this method once, when the driver is initializing power management. + * Most drivers do not need to implement this method, and can rely upon the default IOService implementation. The IOService implementation scans the power state array looking for the highest state whose inputPowerRequirement field exactly matches the value of the domainState parameter. If more intelligent determination is required, the power managed driver should implement the method and override the superclass's implementation. + * @param domainState Flags that describe the character of "domain power"; they represent the outputPowerCharacter field of a state in the power domain's power state array. + * @result A state number. */ + + virtual unsigned long initialPowerStateForDomainState( IOPMPowerFlags domainState ); + +/*! @function powerStateForDomainState + * @abstract Determines what power state the device would be in for a given power domain state. + * @discussion This call is unused by power management. Drivers should override initialPowerStateForDomainState and/or maxCapabilityForDomainState instead to change the default mapping of domain state to driver power state. + * @param domainState Flags that describe the character of "domain power"; they represent the outputPowerCharacter field of a state in the power domain's power state array. + * @result A state number. */ + + virtual unsigned long powerStateForDomainState( IOPMPowerFlags domainState ); + +/*! @function powerStateWillChangeTo + * @abstract Informs interested parties that a device is about to change its power state. + * @discussion Power management informs interested parties that a device is about to change to a different power state. Interested parties are those that have registered for this notification via @link registerInterestedDriver registerInterestedDriver@/link. If you have called registerInterestedDriver on a power managed driver, you must implement powerStateWillChangeTo and @link powerStateDidChangeTo powerStateDidChangeTo@/link to receive the notifications. + * powerStateWillChangeTo is called in a clean and separate thread context. powerStateWillChangeTo is called before a power state transition takes place; powerStateDidChangeTo is called after the transition has completed. + * @param capabilities Flags that describe the capability of the device in the new power state (they come from the capabilityFlags field of the new state in the power state array). + * @param stateNumber The number of the state in the state array that the device is switching to. + * @param whatDevice A pointer to the driver that is changing. It can be used by a driver that is receiving power state change notifications for multiple devices to distinguish between them. + * @result The driver returns IOPMAckImplied if it has prepared for the power change when it returns. If it has started preparing but not finished, it should return a number of microseconds which is an upper limit of the time it will need to finish preparing. Then, when it has completed its preparations, it should call @link acknowledgePowerChange acknowledgePowerChange@/link. */ + + virtual IOReturn powerStateWillChangeTo( + IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService * whatDevice ); + +/*! @function powerStateDidChangeTo + * @abstract Informs interested parties that a device has changed to a different power state. + * @discussion Power management informs interested parties that a device has changed to a different power state. Interested parties are those that have registered for this notification via @link registerInterestedDriver registerInterestedDriver@/link. If you have called registerInterestedDriver on a power managed driver, you must implemnt @link powerStateWillChangeTo powerStateWillChangeTo@/link and powerStateDidChangeTo to receive the notifications. + * powerStateDidChangeTo is called in a clean and separate thread context. powerStateWillChangeTo is called before a power state transition takes place; powerStateDidChangeTo is called after the transition has completed. + * @param capabilities Flags that describe the capability of the device in the new power state (they come from the capabilityFlags field of the new state in the power state array). + * @param stateNumber The number of the state in the state array that the device is switching to. + * @param whatDevice A pointer to the driver that is changing. It can be used by a driver that is receiving power state change notifications for multiple devices to distinguish between them. + * @result The driver returns IOPMAckImplied if it has prepared for the power change when it returns. If it has started preparing but not finished, it should return a number of microseconds which is an upper limit of the time it will need to finish preparing. Then, when it has completed its preparations, it should call @link acknowledgePowerChange acknowledgePowerChange@/link. */ + + virtual IOReturn powerStateDidChangeTo( + IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService * whatDevice ); + +#ifndef __LP64__ +/*! @function didYouWakeSystem + * @abstract Asks a driver if its device is the one that just woke the system from sleep. + * @availability Deprecated in Mac OS X version 10.6. + * @discussion Power management calls a power managed driver with this method to ask if its device is the one that just woke the system from sleep. If a device is capable of waking the system from sleep, its driver should implement didYouWakeSystem and return true if its device was responsible for waking the system. + * @result true if the driver's device woke the system and false otherwise. */ + + virtual bool didYouWakeSystem( void ) + APPLE_KEXT_DEPRECATED; + +/*! @function newTemperature + * @abstract Tells a power managed driver that the temperature in the thermal zone has changed. + * @discussion This call is unused by power management. It is not intended to be called or overridden. */ + + virtual IOReturn newTemperature( long currentTemp, IOService * whichZone ) + APPLE_KEXT_DEPRECATED; +#endif + + virtual bool askChangeDown( unsigned long ); + virtual bool tellChangeDown( unsigned long ); + virtual void tellNoChangeDown( unsigned long ); + virtual void tellChangeUp( unsigned long ); + virtual IOReturn allowPowerChange( unsigned long refcon ); + virtual IOReturn cancelPowerChange( unsigned long refcon ); + +protected: +/*! @function changePowerStateToPriv + * @abstract Tells a driver's superclass to change the power state of its device. + * @discussion A driver uses this method to tell its superclass to change the power state of the device. This is the recommended way to change the power state of a device. + * Three things affect driver power state: @link changePowerStateTo changePowerStateTo@/link, changePowerStateToPriv, and the desires of the driver's power plane children. Power management puts the device into the maximum state governed by those three entities. + * Drivers may eliminate the influence of the changePowerStateTo method on power state one of two ways. See @link powerOverrideOnPriv powerOverrideOnPriv@/link to ignore the method's influence, or call changePowerStateTo(0) in the driver's start routine to remove the changePowerStateTo method's power request. + * @param ordinal The number of the desired power state in the power state array. + * @result A return code that can be ignored by the caller. */ +public: + IOReturn changePowerStateToPriv( unsigned long ordinal ); + +/*! @function powerOverrideOnPriv + * @abstract Allows a driver to ignore its children's power management requests and only use changePowerStateToPriv to define its own power state. + * @discussion Power management normally keeps a device at the highest state required by its requests via @link changePowerStateTo changePowerStateTo@/link, @link changePowerStateToPriv changePowerStateToPriv@/link, and its children. However, a driver may ensure a lower power state than otherwise required by itself and its children using powerOverrideOnPriv. When the override is on, power management keeps the device's power state in the state specified by changePowerStateToPriv. Turning on the override will initiate a power change if the driver's changePowerStateToPriv desired power state is different from the maximum of the changePowerStateTo desired power state and the children's desires. + * @result A return code that can be ignored by the caller. */ + + IOReturn powerOverrideOnPriv( void ); + +/*! @function powerOverrideOffPriv + * @abstract Allows a driver to disable a power override. + * @discussion When a driver has enabled an override via @link powerOverrideOnPriv powerOverrideOnPriv@/link, it can disable it again by calling this method in its superclass. Disabling the override reverts to the default algorithm for determining a device's power state. The superclass will now keep the device at the highest state required by changePowerStateTo, changePowerStateToPriv, and its children. Turning off the override will initiate a power change if the driver's desired power state is different from the maximum of the power managed driver's desire and the children's desires. + * @result A return code that can be ignored by the caller. */ + + IOReturn powerOverrideOffPriv( void ); + +/*! @function powerChangeDone + * @abstract Tells a driver when a power state change is complete. + * @discussion Power management uses this method to inform a driver when a power change is completely done, when all interested parties have acknowledged the @link powerStateDidChangeTo powerStateDidChangeTo@/link call. The default implementation of this method is null; the method is meant to be overridden by subclassed power managed drivers. A driver should use this method to find out if a power change it initiated is complete. + * @param stateNumber The number of the state in the state array that the device has switched from. */ + + virtual void powerChangeDone( unsigned long stateNumber ); +}; + +#endif /* ! _IOKIT_IOSERVICE_H */ diff --git a/QualcommWireless/include/IOKit/IOServicePM.h b/QualcommWireless/include/IOKit/IOServicePM.h new file mode 100644 index 0000000..e4a928f --- /dev/null +++ b/QualcommWireless/include/IOKit/IOServicePM.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOSERVICEPM_H +#define _IOKIT_IOSERVICEPM_H + +#include + +class IOService; +class IOServicePM; +class IOPowerConnection; +class IOWorkLoop; +class IOCommandGate; +class IOTimerEventSource; +class IOPlatformExpert; + +#endif /* !_IOKIT_IOSERVICEPM_H */ diff --git a/QualcommWireless/include/IOKit/IOSharedDataQueue.h b/QualcommWireless/include/IOKit/IOSharedDataQueue.h new file mode 100644 index 0000000..f4cd156 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOSharedDataQueue.h @@ -0,0 +1,160 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOSHAREDDATAQUEUE_H +#define _IOKIT_IOSHAREDDATAQUEUE_H + +#define DISABLE_DATAQUEUE_WARNING /* IODataQueue is deprecated, please use IOSharedDataQueue instead */ + +#include + +#undef DISABLE_DATAQUEUE_WARNING + +typedef struct _IODataQueueEntry IODataQueueEntry; + +/*! + * @class IOSharedDataQueue : public IODataQueue + * @abstract A generic queue designed to pass data both from the kernel to a user process and from a user process to the kernel. + * @discussion The IOSharedDataQueue class is designed to also allow a user process to queue data to kernel code. IOSharedDataQueue objects are designed to be used in a single producer / single consumer situation. As such, there are no locks on the data itself. Because the kernel enqueue and user-space dequeue methods follow a strict set of guidelines, no locks are necessary to maintain the integrity of the data struct. + * + *
Each data entry can be variable sized, but the entire size of the queue data region (including overhead for each entry) must be specified up front. + * + *
In order for the IODataQueue instance to notify the user process that data is available, a notification mach port must be set. When the queue is empty and a new entry is added, a message is sent to the specified port. + * + *
In order to make the data queue memory available to a user process, the method getMemoryDescriptor() must be used to get an IOMemoryDescriptor instance that can be mapped into a user process. Typically, the clientMemoryForType() method on an IOUserClient instance will be used to request the IOMemoryDescriptor and then return it to be mapped into the user process. + */ +class IOSharedDataQueue : public IODataQueue +{ + OSDeclareDefaultStructors(IOSharedDataQueue); + + struct ExpansionData { + UInt32 queueSize; + }; +/*! @var reserved + * Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + +protected: + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! + * @function getQueueSize + * @abstract Returns the size of the data queue. + * @discussion Use this method to access the size of the data queue. Do not access the value of size directly, as it can get modified from userspace and is not reliable. + * @result Returns the size of the data queue, or zero in case of failure. + */ + UInt32 getQueueSize(); + +/*! + * @function setQueueSize + * @abstract Stores the value of the size of the data queue. + * @discussion Use this method to store the value of the size of the data queue. Do not access the value of size directly, as it can get modified from userspace and is not reliable. + * @param size The size of the data queue. + * @result Returns true in case of success, false otherwise. + */ + Boolean setQueueSize(UInt32 size); + +public: +/*! + * @function withCapacity + * @abstract Static method that creates a new IOSharedDataQueue instance with the capacity specified in the size parameter. + * @discussion The actual size of the entire data queue memory region (to be shared into a user process) is equal to the capacity plus the IODataQueueMemory overhead. This overhead value can be determined from the DATA_QUEUE_MEMORY_HEADER_SIZE macro in . The size of the data queue memory region must include space for the overhead of each IODataQueueEntry. This entry overhead can be determined from the DATA_QUEUE_ENTRY_HEADER_SIZE macro in .
This method allocates a new IODataQueue instance and then calls initWithCapacity() with the given size parameter. If the initWithCapacity() fails, the new instance is released and zero is returned. + * @param size The size of the data queue memory region. + * @result Returns the newly allocated IOSharedDataQueue instance. Zero is returned on failure. + */ + static IOSharedDataQueue *withCapacity(UInt32 size); + +/*! + * @function withEntries + * @abstract Static method that creates a new IOSharedDataQueue instance with the specified number of entries of the given size. + * @discussion This method will create a new IOSharedDataQueue instance with enough capacity for numEntries of entrySize. It does account for the IODataQueueEntry overhead for each entry. Note that the numEntries and entrySize are simply used to determine the data region size. They do not actually restrict the size of number of entries that can be added to the queue.
This method allocates a new IODataQueue instance and then calls initWithEntries() with the given numEntries and entrySize parameters. If the initWithEntries() fails, the new instance is released and zero is returned. + * @param numEntries Number of entries to allocate space for. + * @param entrySize Size of each entry. + * @result Reeturns the newly allocated IOSharedDataQueue instance. Zero is returned on failure. + */ + static IOSharedDataQueue *withEntries(UInt32 numEntries, UInt32 entrySize); + +/*! + * @function initWithCapacity + * @abstract Initializes an IOSharedDataQueue instance with the capacity specified in the size parameter. + * @discussion The actual size of the entire data queue memory region (to be shared into a user process) is equal to the capacity plus the IODataQueueMemory overhead. This overhead value can be determined from the DATA_QUEUE_MEMORY_HEADER_SIZE and DATA_QUEUE_MEMORY_APPENDIX_SIZE macro in . The size of the data queue memory region must include space for the overhead of each IODataQueueEntry. This entry overhead can be determined from the DATA_QUEUE_ENTRY_HEADER_SIZE macro in . + * @param size The size of the data queue memory region. + * @result Returns true on success and false on failure. + */ + virtual Boolean initWithCapacity(UInt32 size) APPLE_KEXT_OVERRIDE; + +/*! + * @function getMemoryDescriptor + * @abstract Returns a memory descriptor covering the IODataQueueMemory region. + * @discussion The IOMemoryDescriptor instance returned by this method is intended to be mapped into a user process. This is the memory region that the IODataQueueClient code operates on. + * @result Returns a newly allocated IOMemoryDescriptor for the IODataQueueMemory region. Returns zero on failure. + */ + virtual IOMemoryDescriptor *getMemoryDescriptor() APPLE_KEXT_OVERRIDE; + +/*! + * @function peek + * @abstract Used to peek at the next entry on the queue. + * @discussion This function can be used to look at the next entry which allows the entry to be received without having to copy it with dequeue. In order to do this, call peek to get the entry. Then call dequeue with a NULL data pointer. That will cause the head to be moved to the next entry, but no memory to be copied. + * @result Returns a pointer to the next IODataQueueEntry if one is available. 0 (NULL) is returned if the queue is empty. + */ + virtual IODataQueueEntry * peek(); + +/*! + * @function dequeue + * @abstract Dequeues the next available entry on the queue and copies it into the given data pointer. + * @discussion This function will dequeue the next available entry on the queue. If a data pointer is provided, it will copy the data into the memory region if there is enough space available as specified in the dataSize parameter. If no data pointer is provided, it will simply move the head value past the current entry. + * @param data A pointer to the data memory region in which to copy the next entry data on the queue. If this parameter is 0 (NULL), it will simply move to the next entry. + * @param dataSize A pointer to the size of the data parameter. On return, this contains the size of the actual entry data - even if the original size was not large enough. + * @result Returns true on success and false on failure. Typically failure means that the queue is empty. + */ + virtual Boolean dequeue(void *data, UInt32 *dataSize); + +/*! + * @function enqueue + * @abstract Enqueues a new entry on the queue. + * @discussion This method adds a new data entry of dataSize to the queue. It sets the size parameter of the entry pointed to by the tail value and copies the memory pointed to by the data parameter in place in the queue. Once that is done, it moves the tail to the next available location. When attempting to add a new entry towards the end of the queue and there isn't enough space at the end, it wraps back to the beginning.
If the queue is empty when a new entry is added, sendDataAvailableNotification() is called to send a message to the user process that data is now available. + * @param data Pointer to the data to be added to the queue. + * @param dataSize Size of the data pointed to by data. + * @result Returns true on success and false on failure. Typically failure means that the queue is full. + */ + virtual Boolean enqueue(void *data, UInt32 dataSize) APPLE_KEXT_OVERRIDE; + + +#if APPLE_KEXT_VTABLE_PADDING + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 0); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 1); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 2); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 3); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 4); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 5); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 6); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 7); +#endif +}; + +#endif /* _IOKIT_IOSHAREDDATAQUEUE_H */ diff --git a/QualcommWireless/include/IOKit/IOSharedLock.h b/QualcommWireless/include/IOKit/IOSharedLock.h new file mode 100644 index 0000000..306b406 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOSharedLock.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOSHAREDLOCK_H +#define _IOKIT_IOSHAREDLOCK_H + +#include + +#define IOSharedLockData OSSpinLock +#define ev_lock_data_t OSSpinLock + +#define ev_unlock(l) OSSpinLockUnlock(l) +#define ev_try_lock(l) OSSpinLockTry(l) + +#endif /* ! _IOKIT_IOSHAREDLOCK_H */ diff --git a/QualcommWireless/include/IOKit/IOSubMemoryDescriptor.h b/QualcommWireless/include/IOKit/IOSubMemoryDescriptor.h new file mode 100644 index 0000000..42b10d9 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOSubMemoryDescriptor.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOSUBMEMORYDESCRIPTOR_H +#define _IOSUBMEMORYDESCRIPTOR_H + +#include + +/*! @class IOSubMemoryDescriptor : public IOMemoryDescriptor + * @abstract The IOSubMemoryDescriptor object describes a memory area made up of a portion of another IOMemoryDescriptor. + * @discussion The IOSubMemoryDescriptor object represents a subrange of memory, specified as a portion of another IOMemoryDescriptor. */ + +class IOSubMemoryDescriptor : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IOSubMemoryDescriptor); + +protected: + IOMemoryDescriptor * _parent; + IOByteCount _start; + + virtual void free() APPLE_KEXT_OVERRIDE; + +public: +/*! @function withSubRange + * @abstract Create an IOMemoryDescriptor to describe a subrange of an existing descriptor. + * @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of a subrange of the specified memory descriptor. The parent memory descriptor is retained by the new descriptor. + * @param of The parent IOMemoryDescriptor of which a subrange is to be used for the new descriptor, which will be retained by the subrange IOMemoryDescriptor. + * @param offset A byte offset into the parent memory descriptor's memory. + * @param length The length of the subrange. + * @param options + * kIOMemoryDirectionMask (options:direction) This nibble indicates the I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + * @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOSubMemoryDescriptor * withSubRange(IOMemoryDescriptor *of, + IOByteCount offset, + IOByteCount length, + IOOptionBits options); + +/* + * Initialize or reinitialize an IOSubMemoryDescriptor to describe + * a subrange of an existing descriptor. + * + * An IOSubMemoryDescriptor can be re-used by calling initSubRange + * again on an existing instance -- note that this behavior is not + * commonly supported in other IOKit classes, although it is here. + */ + virtual bool initSubRange( IOMemoryDescriptor * parent, + IOByteCount offset, IOByteCount length, + IODirection withDirection ); + +/* + * IOMemoryDescriptor required methods + */ + + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone) APPLE_KEXT_OVERRIDE; + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone) APPLE_KEXT_OVERRIDE; + +#ifdef __LP64__ + virtual IOReturn redirect( task_t safeTask, bool redirect ) APPLE_KEXT_OVERRIDE; +#else + IOReturn redirect( task_t safeTask, bool redirect ); +#endif /* __LP64__ */ + + virtual IOReturn setPurgeable( IOOptionBits newState, + IOOptionBits * oldState ) APPLE_KEXT_OVERRIDE; + + IOReturn setOwnership( task_t newOwner, + int newLedgerTag, + IOOptionBits newLedgerOptions ); + +// support map() on kIOMemoryTypeVirtual without prepare() + virtual IOMemoryMap * makeMapping( + IOMemoryDescriptor * owner, + task_t intoTask, + IOVirtualAddress atAddress, + IOOptionBits options, + IOByteCount offset, + IOByteCount length ) APPLE_KEXT_OVERRIDE; + + virtual uint64_t getPreparationID( void ) APPLE_KEXT_OVERRIDE; + +/*! @function getPageCounts + * @abstract Retrieve the number of resident and/or dirty pages encompassed by an IOMemoryDescriptor. + * @discussion This method returns the number of resident and/or dirty pages encompassed by an IOMemoryDescriptor. + * @param residentPageCount - If non-null, a pointer to a byte count that will return the number of resident pages encompassed by this IOMemoryDescriptor. + * @param dirtyPageCount - If non-null, a pointer to a byte count that will return the number of dirty pages encompassed by this IOMemoryDescriptor. + * @result An IOReturn code. */ + + IOReturn getPageCounts(IOByteCount * residentPageCount, + IOByteCount * dirtyPageCount); +}; + +#endif /* !_IOSUBMEMORYDESCRIPTOR_H */ diff --git a/QualcommWireless/include/IOKit/IOTimeStamp.h b/QualcommWireless/include/IOKit/IOTimeStamp.h new file mode 100644 index 0000000..95d0819 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOTimeStamp.h @@ -0,0 +1,210 @@ +/* + * Copyright (c) 1998-2010 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef IOKIT_IOTIMESTAMP_H +#define IOKIT_IOTIMESTAMP_H + +#include + +static inline void +IOTimeStampStartConstant(unsigned int csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG_CONSTANT(((uint32_t)csc) | DBG_FUNC_START, a, b, c, d, 0); +} + +static inline void +IOTimeStampEndConstant(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG_CONSTANT(((uint32_t)csc) | DBG_FUNC_END, a, b, c, d, 0); +} + +static inline void +IOTimeStampConstant(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG_CONSTANT(((uint32_t)csc) | DBG_FUNC_NONE, a, b, c, d, 0); +} + +#if KDEBUG + +static inline void +IOTimeStampStart(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG(((uint32_t)csc) | DBG_FUNC_START, a, b, c, d, 0); +} + +static inline void +IOTimeStampEnd(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG(((uint32_t)csc) | DBG_FUNC_END, a, b, c, d, 0); +} + +static inline void +IOTimeStamp(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG(((uint32_t)csc) | DBG_FUNC_NONE, a, b, c, d, 0); +} + +#endif /* KDEBUG */ + +#define IODBG_STORAGE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSTORAGE, code)) +#define IODBG_NETWORK(code) (KDBG_CODE(DBG_IOKIT, DBG_IONETWORK, code)) +#define IODBG_KEYBOARD(code) (KDBG_CODE(DBG_IOKIT, DBG_IOKEYBOARD, code)) +#define IODBG_HID(code) (KDBG_CODE(DBG_IOKIT, DBG_IOHID, code)) +#define IODBG_AUDIO(code) (KDBG_CODE(DBG_IOKIT, DBG_IOAUDIO, code)) +#define IODBG_SERIAL(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSERIAL, code)) +#define IODBG_TTY(code) (KDBG_CODE(DBG_IOKIT, DBG_IOTTY, code)) +#define IODBG_SAM(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSAM, code)) +#define IODBG_PARALLELATA(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPARALLELATA, code)) +#define IODBG_PARALLELSCSI(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPARALLELSCSI, code)) +#define IODBG_SATA(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSATA, code)) +#define IODBG_SAS(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSAS, code)) +#define IODBG_FIBRECHANNEL(code) (KDBG_CODE(DBG_IOKIT, DBG_IOFIBRECHANNEL, code)) +#define IODBG_USB(code) (KDBG_CODE(DBG_IOKIT, DBG_IOUSB, code)) +#define IODBG_BLUETOOTH(code) (KDBG_CODE(DBG_IOKIT, DBG_IOBLUETOOTH, code)) +#define IODBG_FIREWIRE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOFIREWIRE, code)) +#define IODBG_INFINIBAND(code) (KDBG_CODE(DBG_IOKIT, DBG_IOINFINIBAND, code)) + + +/* Backwards compatibility */ +#define IODBG_DISK(code) IODBG_STORAGE(code) +#define IODBG_POINTING(code) IODBG_HID(code) + + +/* IOKit infrastructure subclasses */ +#define IODBG_INTC(code) (KDBG_CODE(DBG_IOKIT, DBG_IOINTC, code)) +#define IODBG_WORKLOOP(code) (KDBG_CODE(DBG_IOKIT, DBG_IOWORKLOOP, code)) +#define IODBG_INTES(code) (KDBG_CODE(DBG_IOKIT, DBG_IOINTES, code)) +#define IODBG_TIMES(code) (KDBG_CODE(DBG_IOKIT, DBG_IOCLKES, code)) +#define IODBG_CMDQ(code) (KDBG_CODE(DBG_IOKIT, DBG_IOCMDQ, code)) +#define IODBG_MCURS(code) (KDBG_CODE(DBG_IOKIT, DBG_IOMCURS, code)) +#define IODBG_MDESC(code) (KDBG_CODE(DBG_IOKIT, DBG_IOMDESC, code)) +#define IODBG_POWER(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPOWER, code)) +#define IODBG_IOSERVICE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSERVICE, code)) +#define IODBG_IOREGISTRY(code) (KDBG_CODE(DBG_IOKIT, DBG_IOREGISTRY, code)) + +/* IOKit specific codes - within each subclass */ + +/* DBG_IOKIT/DBG_IODISK codes */ + +/* DBG_IOKIT/DBG_IONETWORK codes */ + +/* DBG_IOKIT/DBG_IOKEYBOARD codes */ + +/* DBG_IOKIT/DBG_IOHID codes */ + +/* DBG_IOKIT/DBG_IOAUDIO codes */ + +/* DBG_IOKIT/DBG_IOSERIAL codes */ + +/* DBG_IOKIT/DBG_IOTTY codes */ + +/* DBG_IOKIT/DBG_IOINTC codes */ +#define IOINTC_HANDLER 1 /* 0x05000004 */ +#define IOINTC_SPURIOUS 2 /* 0x05000008 */ + +/* DBG_IOKIT/DBG_IOWORKLOOP codes */ +#define IOWL_CLIENT 1 /* 0x05010004 */ +#define IOWL_WORK 2 /* 0x05010008 */ + +/* DBG_IOKIT/DBG_IOINTES codes */ +#define IOINTES_CLIENT 1 /* 0x05020004 */ +#define IOINTES_LAT 2 /* 0x05020008 */ +#define IOINTES_SEMA 3 /* 0x0502000c */ +#define IOINTES_INTCTXT 4 /* 0x05020010 */ +#define IOINTES_INTFLTR 5 /* 0x05020014 */ +#define IOINTES_ACTION 6 /* 0x05020018 */ +#define IOINTES_FILTER 7 /* 0x0502001c */ + +/* DBG_IOKIT/DBG_IOTIMES codes */ +#define IOTIMES_CLIENT 1 /* 0x05030004 */ +#define IOTIMES_LAT 2 /* 0x05030008 */ +#define IOTIMES_SEMA 3 /* 0x0503000c */ +#define IOTIMES_ACTION 4 /* 0x05030010 */ + +/* DBG_IOKIT/DBG_IOCMDQ codes */ +#define IOCMDQ_CLIENT 1 /* 0x05040004 */ +#define IOCMDQ_LAT 2 /* 0x05040008 */ +#define IOCMDQ_SEMA 3 /* 0x0504000c */ +#define IOCMDQ_PSEMA 4 /* 0x05040010 */ +#define IOCMDQ_PLOCK 5 /* 0x05040014 */ +#define IOCMDQ_ACTION 6 /* 0x05040018 */ + +/* DBG_IOKIT/DBG_IOMCURS codes */ + +/* DBG_IOKIT/DBG_IOMDESC codes */ + +/* DBG_IOKIT/DBG_IOPOWER codes */ +// See IOKit/pwr_mgt/IOPMlog.h for the power management codes + +/* DBG_IOKIT/DBG_IOSERVICE codes */ +#define IOSERVICE_BUSY 1 /* 0x05080004 */ +#define IOSERVICE_NONBUSY 2 /* 0x05080008 */ +#define IOSERVICE_MODULESTALL 3 /* 0x0508000C */ +#define IOSERVICE_MODULEUNSTALL 4 /* 0x05080010 */ + +#define IOSERVICE_TERMINATE_PHASE1 5 /* 0x05080014 */ +#define IOSERVICE_TERMINATE_REQUEST_OK 6 /* 0x05080018 */ +#define IOSERVICE_TERMINATE_REQUEST_FAIL 7 /* 0x0508001C */ +#define IOSERVICE_TERMINATE_SCHEDULE_STOP 8 /* 0x05080020 */ +#define IOSERVICE_TERMINATE_SCHEDULE_FINALIZE 9 /* 0x05080024 */ +#define IOSERVICE_TERMINATE_WILL 10 /* 0x05080028 */ +#define IOSERVICE_TERMINATE_DID 11 /* 0x0508002C */ +#define IOSERVICE_TERMINATE_DID_DEFER 12 /* 0x05080030 */ +#define IOSERVICE_TERMINATE_FINALIZE 13 /* 0x05080034 */ +#define IOSERVICE_TERMINATE_STOP 14 /* 0x05080038 */ +#define IOSERVICE_TERMINATE_STOP_NOP 15 /* 0x0508003C */ +#define IOSERVICE_TERMINATE_STOP_DEFER 16 /* 0x05080040 */ +#define IOSERVICE_TERMINATE_DONE 17 /* 0x05080044 */ + +#define IOSERVICE_KEXTD_ALIVE 18 /* 0x05080048 */ +#define IOSERVICE_KEXTD_READY 19 /* 0x0508004C */ +#define IOSERVICE_REGISTRY_QUIET 20 /* 0x05080050 */ + +#define IOSERVICE_TERM_SET_INACTIVE 21 /* 0x05080054 */ +#define IOSERVICE_TERM_SCHED_PHASE2 22 /* 0x05080058 */ +#define IOSERVICE_TERM_START_PHASE2 23 /* 0x0508005C */ +#define IOSERVICE_TERM_TRY_PHASE2 24 /* 0x05080060 */ +#define IOSERVICE_TERM_UC_DEFER 25 /* 0x05080064 */ +#define IOSERVICE_DETACH 26 /* 0x05080068 */ + +/* DBG_IOKIT/DBG_IOREGISTRY codes */ +#define IOREGISTRYENTRY_NAME_STRING 1 /* 0x05090004 */ +#define IOREGISTRYENTRY_NAME 2 /* 0x05090008 */ + +#endif /* ! IOKIT_IOTIMESTAMP_H */ diff --git a/QualcommWireless/include/IOKit/IOTimerEventSource.h b/QualcommWireless/include/IOKit/IOTimerEventSource.h new file mode 100644 index 0000000..e4dddac --- /dev/null +++ b/QualcommWireless/include/IOKit/IOTimerEventSource.h @@ -0,0 +1,325 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * IOTimerEventSource.h + * + * HISTORY + * 2-Feb-1999 Joe Liu (jliu) created. + * + */ + +#ifndef _IOTIMEREVENTSOURCE +#define _IOTIMEREVENTSOURCE + +#include + +__BEGIN_DECLS +#include +__END_DECLS + +#include +#include + +/*! + * @enum IOTimerEventSource constructor options + * @abstract Constants defining behavior of the IOTimerEventSource. + * @constant kIOTimerEventSourceOptionsPriorityHigh Importance above everything but realtime. + * Thread calls allocated with this priority execute at extremely high priority, + * above everything but realtime threads. They are generally executed in serial. + * Though they may execute concurrently under some circumstances, no fan-out is implied. + * These work items should do very small amounts of work or risk disrupting system + * responsiveness. + * @constant kIOTimerEventSourceOptionsPriorityKernelHigh Importance higher than most kernel + * threads. + * @constant kIOTimerEventSourceOptionsPriorityKernel Importance similar to that of normal kernel + * threads. + * @constant kIOTimerEventSourceOptionsPriorityUser Importance similar to that of normal user threads. + * @constant kIOTimerEventSourceOptionsPriorityLow Very low importance. + * @constant kIOTimerEventSourceOptionsPriorityWorkLoop Run the callout on the thread of the IOWorkLoop + * the event source has been added to. + * @constant kIOTimerEventSourceOptionsAllowReenter Allow the callout to be rescheduled and potentially + * re-entered, if the IOWorkLoop lock has been released (eg. with commandSleep) during its invocation. + * @constant kIOTimerEventSourceOptionsDefault Recommended default options. + */ +enum{ + kIOTimerEventSourceOptionsPriorityMask = 0x000000ff, + kIOTimerEventSourceOptionsPriorityHigh = 0x00000000, + kIOTimerEventSourceOptionsPriorityKernelHigh = 0x00000001, + kIOTimerEventSourceOptionsPriorityKernel = 0x00000002, + kIOTimerEventSourceOptionsPriorityUser = 0x00000003, + kIOTimerEventSourceOptionsPriorityLow = 0x00000004, + kIOTimerEventSourceOptionsPriorityWorkLoop = 0x000000ff, + + kIOTimerEventSourceOptionsAllowReenter = 0x00000100, + + kIOTimerEventSourceOptionsDefault = kIOTimerEventSourceOptionsPriorityKernelHigh +}; + +#define IOTIMEREVENTSOURCEOPTIONS_DEFINED 1 + +/*! + * @enum IOTimerEventSource setTimeout/wakeAtTime options + * @abstract Constants defining behavior of a scheduled call from IOTimerEventSource. + * @constant kIOTimeOptionsWithLeeway Use the leeway parameter to the call. + * @constant kIOTimeOptionsContinuous Use mach_continuous_time() to generate the callback. + */ +enum{ + kIOTimeOptionsWithLeeway = 0x00000020, + kIOTimeOptionsContinuous = 0x00000100, +}; + +/*! + * @class IOTimerEventSource : public IOEventSource + * @abstract Time based event source mechanism. + * @discussion An event source that implements a simple timer. A timeout handler is called once the timeout period expires. This timeout handler will be called by the work-loop that this event source is attached to. + *

+ * Usually a timer event source will be used to implement a timeout. In general when a driver makes a request it will need to setup a call to keep track of when the I/O doesn't complete. This class is designed to make that somewhat easier. + *

+ * Remember the system doesn't guarantee the accuracy of the callout. It is possible that a higher priority thread is running which will delay the execution of the action routine. In fact the thread will be made runable at the exact requested time, within the accuracy of the CPU's decrementer based interrupt, but the scheduler will then control execution. + */ + +class IOTimerEventSource : public IOEventSource +{ + OSDeclareDefaultStructors(IOTimerEventSource); + +protected: +/*! @var calloutEntry thread_call entry for preregistered thread callouts */ + void *calloutEntry; + +/*! @var abstime time to wake up next, see enable. */ + AbsoluteTime abstime; + +/*! @struct ExpansionData + * @discussion This structure is private to the IOTimerEventSource implementation. + */ + struct ExpansionData { + SInt32 calloutGeneration; + SInt32 calloutGenerationSignaled; + IOWorkLoop * workLoop; + }; + +/*! @var reserved + * Reserved for future use. (Internal use only) */ + APPLE_KEXT_WSHADOW_PUSH; + ExpansionData *reserved; + APPLE_KEXT_WSHADOW_POP; + +/*! @function timeout + * @abstract Function that routes the call from the OS' timeout mechanism into a work-loop context. + * @discussion timeout will normally not be called nor overridden by a subclass. If the event source is enabled then close the work-loop's gate and call the action routine. + * @param self This argument will be cast to an IOTimerEventSource. */ + static void timeout(void *self); + +/*! @function setTimeoutFunc + * @abstract Set's timeout as the function of calloutEntry. + * @discussion IOTimerEventSource is based upon the kern/thread_call.h APIs currently. This function allocates the calloutEntry member variable by using thread_call_allocate(timeout, this). If you need to write your own subclass of IOTimerEventSource you probably should override this method to allocate an entry that points to your own timeout routine. */ + virtual void setTimeoutFunc(); + +/*! @function free + * @abstract Sub-class implementation of free method, frees calloutEntry */ + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual void setWorkLoop(IOWorkLoop *workLoop) APPLE_KEXT_OVERRIDE; + +public: + +/*! @typedef Action + * @discussion 'C' Function pointer defining the callout routine of this event source. + * @param owner Owning target object. Note by a startling coincidence the first parameter in a C callout is currently used to define the target of a C++ member function. + * @param sender The object that timed out. */ + typedef void (*Action)(OSObject *owner, IOTimerEventSource *sender); + +#ifdef __BLOCKS__ + typedef void (^ActionBlock)(IOTimerEventSource *sender); +#endif /* __BLOCKS__ */ + + static IOTimerEventSource * + timerEventSource(OSObject *owner, Action action = NULL); + +/*! @function timerEventSource + * @abstract Allocates and returns an initialized timer instance. + * @param options Mask of kIOTimerEventSourceOptions* options. + * @param owner The object that that will be passed to the Action callback. + * @param action 'C' Function pointer for the callout routine of this event source. + */ + static IOTimerEventSource * + timerEventSource(uint32_t options, OSObject *owner, Action action = NULL); + +#ifdef __BLOCKS__ +/*! @function timerEventSource + * @abstract Allocates and returns an initialized timer instance. + * @param options Mask of kIOTimerEventSourceOptions* options. + * @param inOwner The object that that will be passed to the Action callback. + * @param action Block for the callout routine of this event source. + */ + static IOTimerEventSource * + timerEventSource(uint32_t options, OSObject *inOwner, ActionBlock action); +#endif /* __BLOCKS__ */ + + +/*! @function init + * @abstract Initializes the timer with an owner, and a handler to call when the timeout expires. + */ + virtual bool init(OSObject *owner, Action action = NULL); + +/*! @function enable + * @abstract Enables a call to the action. + * @discussion Allows the action function to be called. If the timer event source was disabled while a call was outstanding and the call wasn't cancelled then it will be rescheduled. So a disable/enable pair will disable calls from this event source. */ + virtual void enable() APPLE_KEXT_OVERRIDE; + +/*! @function disable + * @abstract Disable a timed callout. + * @discussion When disable returns the action will not be called until the next time enable(qv) is called. */ + virtual void disable() APPLE_KEXT_OVERRIDE; + +/*! @function checkForWork + * @abstract Pure Virtual member function used by IOWorkLoop for issuing a client calls. + * @discussion This function called when the work-loop is ready to check for any work to do and then to call out the owner/action. + * @result Return true if this function needs to be called again before all its outstanding events have been processed. */ + virtual bool checkForWork() APPLE_KEXT_OVERRIDE; + +/*! @function setTimeoutTicks + * @abstract Setup a callback at after the delay in scheduler ticks. See wakeAtTime(AbsoluteTime). + * @param ticks Delay from now to wake up, in scheduler ticks, whatever that may be. + * @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeoutTicks(UInt32 ticks); + +/*! @function setTimeoutMS + * @abstract Setup a callback at after the delay in milliseconds. See wakeAtTime(AbsoluteTime). + * @param ms Delay from now to wake up, time in milliseconds. + * @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeoutMS(UInt32 ms); + +/*! @function setTimeoutUS + * @abstract Setup a callback at after the delay in microseconds. See wakeAtTime(AbsoluteTime). + * @param us Delay from now to wake up, time in microseconds. + * @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeoutUS(UInt32 us); + +/*! @function setTimeout + * @abstract Setup a callback at after the delay in some unit. See wakeAtTime(AbsoluteTime). + * @param interval Delay from now to wake up in some defined unit. + * @param scale_factor Define the unit of interval, default to nanoseconds. + * @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeout(UInt32 interval, + UInt32 scale_factor = kNanosecondScale); + +#if !defined(__LP64__) + virtual IOReturn setTimeout(mach_timespec_t interval) + APPLE_KEXT_DEPRECATED; +#endif + +/*! @function setTimeout + * @abstract Setup a callback at after the delay in decrementer ticks. See wakeAtTime(AbsoluteTime). + * @param interval Delay from now to wake up in decrementer ticks. + * @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeout(AbsoluteTime interval); + +/*! @function wakeAtTimeTicks + * @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). + * @param ticks Time to wake up in scheduler quantums, whatever that is? + * @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn wakeAtTimeTicks(UInt32 ticks); + +/*! @function wakeAtTimeMS + * @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). + * @param ms Time to wake up in milliseconds. + * @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn wakeAtTimeMS(UInt32 ms); + +/*! @function wakeAtTimeUS + * @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). + * @param us Time to wake up in microseconds. + * @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn wakeAtTimeUS(UInt32 us); + +/*! @function wakeAtTime + * @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). + * @param abstime Time to wake up in some unit. + * @param scale_factor Define the unit of abstime, default to nanoseconds. + * @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn wakeAtTime(UInt32 abstime, + UInt32 scale_factor = kNanosecondScale); + +#if !defined(__LP64__) + virtual IOReturn wakeAtTime(mach_timespec_t abstime) + APPLE_KEXT_DEPRECATED; +#endif + +/*! @function wakeAtTime + * @abstract Setup a callback at this absolute time. + * @discussion Starts the timer, which will expire at abstime. After it expires, the timer will call the 'action' registered in the init() function. This timer is not periodic, a further call is needed to reset and restart the timer after it expires. + * @param abstime Absolute Time when to wake up, counted in 'decrementer' units and starts at zero when system boots. + * @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared by init or IOEventSource::setAction (qqv). */ + virtual IOReturn wakeAtTime(AbsoluteTime abstime); + +/*! @function cancelTimeout + * @abstract Disable any outstanding calls to this event source. + * @discussion Clear down any oustanding calls. By the time this function completes it is guaranteed that the action will not be called again. */ + virtual void cancelTimeout(); + +/*! @function init + * @abstract Initializes the timer with an owner, and a handler to call when the timeout expires. + */ + virtual bool init(uint32_t options, OSObject *inOwner, Action inAction); + +/*! @function setTimeout + * @abstract Setup a callback at after the delay in decrementer ticks. See wakeAtTime(AbsoluteTime). + * @param options see kIOTimeOptionsWithLeeway and kIOTimeOptionsContinuous + * @param interval Delay from now to wake up in decrementer ticks. + * @param leeway Allowable leeway to wake time, if the kIOTimeOptionsWithLeeway option is set + * @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeout(uint32_t options, AbsoluteTime interval, AbsoluteTime leeway); + +/*! @function wakeAtTime + * @abstract Setup a callback at this absolute time. + * @discussion Starts the timer, which will expire at abstime. After it expires, the timer will call the 'action' registered in the init() function. This timer is not periodic, a further call is needed to reset and restart the timer after it expires. + * @param options see kIOTimeOptionsWithLeeway and kIOTimeOptionsContinuous + * @param abstime Absolute Time when to wake up, counted in 'decrementer' units and starts at zero when system boots. + * @param leeway Allowable leeway to wake time, if the kIOTimeOptionsWithLeeway option is set + * @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared by init or IOEventSource::setAction (qqv). */ + virtual IOReturn wakeAtTime(uint32_t options, AbsoluteTime abstime, AbsoluteTime leeway); + +private: + static void timeoutAndRelease(void *self, void *c); + static void timeoutSignaled(void *self, void *c); + +private: + OSMetaClassDeclareReservedUsed(IOTimerEventSource, 0); + OSMetaClassDeclareReservedUsed(IOTimerEventSource, 1); + OSMetaClassDeclareReservedUsed(IOTimerEventSource, 2); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 3); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 4); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 5); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 6); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 7); +}; + +#endif /* !_IOTIMEREVENTSOURCE */ diff --git a/QualcommWireless/include/IOKit/IOTypes.h b/QualcommWireless/include/IOKit/IOTypes.h new file mode 100644 index 0000000..22f8942 --- /dev/null +++ b/QualcommWireless/include/IOKit/IOTypes.h @@ -0,0 +1,250 @@ +/* + * Copyright (c) 1998-2012 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef __IOKIT_IOTYPES_H +#define __IOKIT_IOTYPES_H + + +#ifndef IOKIT +#define IOKIT 1 +#endif /* !IOKIT */ + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef NULL +#if defined (__cplusplus) +#if __cplusplus >= 201103L +#define NULL nullptr +#else +#define NULL 0 +#endif +#else +#define NULL ((void *)0) +#endif +#endif + +/* + * Simple data types. + */ +#include +#include + +#include + +typedef UInt32 IOOptionBits; +typedef SInt32 IOFixed; +typedef UInt32 IOVersion; +typedef UInt32 IOItemCount; +typedef UInt32 IOCacheMode; + +typedef UInt32 IOByteCount32; +typedef UInt64 IOByteCount64; + +typedef UInt32 IOPhysicalAddress32; +typedef UInt64 IOPhysicalAddress64; +typedef UInt32 IOPhysicalLength32; +typedef UInt64 IOPhysicalLength64; + +#if !defined(__arm__) && !defined(__i386__) +typedef mach_vm_address_t IOVirtualAddress; +#else +typedef vm_address_t IOVirtualAddress; +#endif + +#if !defined(__arm__) && !defined(__i386__) && !(defined(__x86_64__) && !defined(KERNEL)) && !(defined(__arm64__) && !defined(__LP64__)) +typedef IOByteCount64 IOByteCount; +#else +typedef IOByteCount32 IOByteCount; +#endif + +typedef IOVirtualAddress IOLogicalAddress; + +#if !defined(__arm__) && !defined(__i386__) && !(defined(__x86_64__) && !defined(KERNEL)) + +typedef IOPhysicalAddress64 IOPhysicalAddress; +typedef IOPhysicalLength64 IOPhysicalLength; +#define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32)) +#define IOPhysSize 64 + +#else + +typedef IOPhysicalAddress32 IOPhysicalAddress; +typedef IOPhysicalLength32 IOPhysicalLength; +#define IOPhysical32( hi, lo ) (lo) +#define IOPhysSize 32 + +#endif + + +typedef struct{ + IOPhysicalAddress address; + IOByteCount length; +} IOPhysicalRange; + +typedef struct{ + IOVirtualAddress address; + IOByteCount length; +} IOVirtualRange; + +#if !defined(__arm__) && !defined(__i386__) +typedef IOVirtualRange IOAddressRange; +#else +typedef struct{ + mach_vm_address_t address; + mach_vm_size_t length; +} IOAddressRange; +#endif + +/* + * Map between #defined or enum'd constants and text description. + */ +typedef struct { + int value; + const char *name; +} IONamedValue; + + +/* + * Memory alignment -- specified as a power of two. + */ +typedef unsigned int IOAlignment; + +#define IO_NULL_VM_TASK ((vm_task_t)0) + + +/* + * Pull in machine specific stuff. + */ + +//#include + +#ifndef MACH_KERNEL + +#ifndef __IOKIT_PORTS_DEFINED__ +#define __IOKIT_PORTS_DEFINED__ +#ifdef __cplusplus +class OSObject; +typedef OSObject * io_object_t; +#else +typedef struct OSObject * io_object_t; +#endif +#endif /* __IOKIT_PORTS_DEFINED__ */ + +#include + +typedef io_object_t io_connect_t; +typedef io_object_t io_enumerator_t; +typedef io_object_t io_iterator_t; +typedef io_object_t io_registry_entry_t; +typedef io_object_t io_service_t; +typedef io_object_t uext_object_t; + +#define IO_OBJECT_NULL ((io_object_t) 0) + +#endif /* MACH_KERNEL */ + +// IOConnectMapMemory memoryTypes +enum { + kIODefaultMemoryType = 0 +}; + +enum { + kIODefaultCache = 0, + kIOInhibitCache = 1, + kIOWriteThruCache = 2, + kIOCopybackCache = 3, + kIOWriteCombineCache = 4, + kIOCopybackInnerCache = 5, + kIOPostedWrite = 6, + kIORealTimeCache = 7, + kIOPostedReordered = 8, + kIOPostedCombinedReordered = 9, +}; + +// IOMemory mapping options +enum { + kIOMapAnywhere = 0x00000001, + + kIOMapCacheMask = 0x00000f00, + kIOMapCacheShift = 8, + kIOMapDefaultCache = kIODefaultCache << kIOMapCacheShift, + kIOMapInhibitCache = kIOInhibitCache << kIOMapCacheShift, + kIOMapWriteThruCache = kIOWriteThruCache << kIOMapCacheShift, + kIOMapCopybackCache = kIOCopybackCache << kIOMapCacheShift, + kIOMapWriteCombineCache = kIOWriteCombineCache << kIOMapCacheShift, + kIOMapCopybackInnerCache = kIOCopybackInnerCache << kIOMapCacheShift, + kIOMapPostedWrite = kIOPostedWrite << kIOMapCacheShift, + kIOMapRealTimeCache = kIORealTimeCache << kIOMapCacheShift, + kIOMapPostedReordered = kIOPostedReordered << kIOMapCacheShift, + kIOMapPostedCombinedReordered = kIOPostedCombinedReordered << kIOMapCacheShift, + + kIOMapUserOptionsMask = 0x00000fff, + + kIOMapReadOnly = 0x00001000, + + kIOMapStatic = 0x01000000, + kIOMapReference = 0x02000000, + kIOMapUnique = 0x04000000, + kIOMapPrefault = 0x10000000, + kIOMapOverwrite = 0x20000000 +}; + +/*! @enum Scale Factors + * @discussion Used when a scale_factor parameter is required to define a unit of time. + * @constant kNanosecondScale Scale factor for nanosecond based times. + * @constant kMicrosecondScale Scale factor for microsecond based times. + * @constant kMillisecondScale Scale factor for millisecond based times. + * @constant kTickScale Scale factor for the standard (100Hz) tick. + * @constant kSecondScale Scale factor for second based times. */ + +enum { + kNanosecondScale = 1, + kMicrosecondScale = 1000, + kMillisecondScale = 1000 * 1000, + kSecondScale = 1000 * 1000 * 1000, + kTickScale = (kSecondScale / 100) +}; + +enum { + kIOConnectMethodVarOutputSize = -3 +}; + +/* compatibility types */ + + +#ifdef __cplusplus +} +#endif + + +#endif /* ! __IOKIT_IOTYPES_H */ diff --git a/QualcommWireless/include/IOKit/IOUserClient.h b/QualcommWireless/include/IOKit/IOUserClient.h new file mode 100644 index 0000000..4deedea --- /dev/null +++ b/QualcommWireless/include/IOKit/IOUserClient.h @@ -0,0 +1,440 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * Changes to this API are expected. + */ + +#ifndef _IOKIT_IOUSERCLIENT_H +#define _IOKIT_IOUSERCLIENT_H + +#include +#include +#include +#include + +#if IOKITSTATS +#include +#endif + +#define _IOUSERCLIENT_SENDASYNCRESULT64WITHOPTIONS_ 1 + +enum { + kIOUCTypeMask = 0x0000000f, + kIOUCScalarIScalarO = 0, + kIOUCScalarIStructO = 2, + kIOUCStructIStructO = 3, + kIOUCScalarIStructI = 4, + + kIOUCForegroundOnly = 0x00000010, +}; + +/*! @enum + * @abstract Constant to denote a variable length structure argument to IOUserClient. + * @constant kIOUCVariableStructureSize Use in the structures IOExternalMethod, IOExternalAsyncMethod, IOExternalMethodDispatch to specify the size of the structure is variable. + */ +enum { + kIOUCVariableStructureSize = 0xffffffff +}; + + +typedef IOReturn (IOService::*IOMethod)(void * p1, void * p2, void * p3, + void * p4, void * p5, void * p6 ); + +typedef IOReturn (IOService::*IOAsyncMethod)(OSAsyncReference asyncRef, + void * p1, void * p2, void * p3, + void * p4, void * p5, void * p6 ); + +typedef IOReturn (IOService::*IOTrap)(void * p1, void * p2, void * p3, + void * p4, void * p5, void * p6 ); + +typedef IOReturn (*IOMethodACID32)(IOService * svc, void * p1, void * p2, void * p3, + void * p4, void * p5, void * p6 ); + +typedef IOReturn (*IOAsyncMethodACID32)(IOService * svc, OSAsyncReference asyncRef, + void * p1, void * p2, void * p3, + void * p4, void * p5, void * p6 ); + +typedef IOReturn (*IOTrapACID32)(IOService * svc, void * p1, void * p2, void * p3, + void * p4, void * p5, void * p6 ); + +// +// When building for i386, clang does not emit code that is compatible with GCC-built code for the below structs. +// The below struct modifications are workarounds to have the correct positioning of the function pointer. +// +// padding must be set to kIOExternalMethodACIDClangPadding +// +#if (defined(__i386__) && defined(__clang__)) +#define kIOExternalMethodACID32Padding 0xFFFF0000 +#endif + +struct IOExternalMethod { + IOService * object; +#if (defined(__i386__) && defined(__clang__)) + uint32_t padding; + IOMethodACID32 func; +#else + IOMethod func; +#endif + IOOptionBits flags; + IOByteCount count0; + IOByteCount count1; +}; + +struct IOExternalAsyncMethod { + IOService * object; +#if (defined(__i386__) && defined(__clang__)) + uint32_t padding; + IOAsyncMethodACID32 func; +#else + IOAsyncMethod func; +#endif + IOOptionBits flags; + IOByteCount count0; + IOByteCount count1; +}; + +struct IOExternalTrap { + IOService * object; +#if (defined(__i386__) && defined(__clang__)) + uint32_t padding; + IOTrapACID32 func; +#else + IOTrap func; +#endif +}; + +enum { + kIOUserNotifyMaxMessageSize = 64 +}; + +enum { + kIOUserNotifyOptionCanDrop = 0x1 /* Fail if queue is full, rather than infinitely queuing. */ +}; + +// keys for clientHasPrivilege +#define kIOClientPrivilegeAdministrator "root" +#define kIOClientPrivilegeLocalUser "local" +#define kIOClientPrivilegeForeground "foreground" + +/*! @enum + * @abstract Constants to specify the maximum number of scalar arguments in the IOExternalMethodArguments structure. These constants are documentary since the scalarInputCount, scalarOutputCount fields reflect the actual number passed. + * @constant kIOExternalMethodScalarInputCountMax The maximum number of scalars able to passed on input. + * @constant kIOExternalMethodScalarOutputCountMax The maximum number of scalars able to passed on output. + */ +enum { + kIOExternalMethodScalarInputCountMax = 16, + kIOExternalMethodScalarOutputCountMax = 16, +}; + + +struct IOExternalMethodArguments { + uint32_t version; + + uint32_t selector; + + mach_port_t asyncWakePort; + io_user_reference_t * asyncReference; + uint32_t asyncReferenceCount; + + const uint64_t * scalarInput; + uint32_t scalarInputCount; + + const void * structureInput; + uint32_t structureInputSize; + + IOMemoryDescriptor * structureInputDescriptor; + + uint64_t * scalarOutput; + uint32_t scalarOutputCount; + + void * structureOutput; + uint32_t structureOutputSize; + + IOMemoryDescriptor * structureOutputDescriptor; + uint32_t structureOutputDescriptorSize; + + uint32_t __reservedA; + + OSObject ** structureVariableOutputData; + + uint32_t __reserved[30]; +}; + +typedef IOReturn (*IOExternalMethodAction)(OSObject * target, void * reference, + IOExternalMethodArguments * arguments); +struct IOExternalMethodDispatch { + IOExternalMethodAction function; + uint32_t checkScalarInputCount; + uint32_t checkStructureInputSize; + uint32_t checkScalarOutputCount; + uint32_t checkStructureOutputSize; +}; + +enum { +#define IO_EXTERNAL_METHOD_ARGUMENTS_CURRENT_VERSION 2 + kIOExternalMethodArgumentsCurrentVersion = IO_EXTERNAL_METHOD_ARGUMENTS_CURRENT_VERSION +}; + + +/*! + * @class IOUserClient + * @abstract Provides a basis for communication between client applications and I/O Kit objects. + */ + +class IOUserClient : public IOService +{ + OSDeclareAbstractStructorsWithDispatch(IOUserClient); +#if IOKITSTATS + friend class IOStatistics; +#endif + +protected: +/*! @struct ExpansionData + * @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { +#if IOKITSTATS + IOUserClientCounter *counter; +#else + void *iokitstatsReserved; +#endif + }; + +/*! @var reserved + * Reserved for future use. (Internal use only) + */ + APPLE_KEXT_WSHADOW_PUSH; + ExpansionData * reserved; + APPLE_KEXT_WSHADOW_POP; + + bool reserve(); + +private: + void * __reserved[9]; + +public: +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_5 + MIG_SERVER_ROUTINE virtual IOReturn + externalMethod(uint32_t selector, IOExternalMethodArguments *arguments, + IOExternalMethodDispatch *dispatch = NULL, + OSObject *target = NULL, void *reference = NULL); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 + MIG_SERVER_ROUTINE virtual IOReturn registerNotificationPort( + mach_port_t port, UInt32 type, io_user_reference_t refCon); +#endif + +private: +#if __LP64__ + + OSMetaClassDeclareReservedUnused(IOUserClient, 0); + OSMetaClassDeclareReservedUnused(IOUserClient, 1); + +#else + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_5 + OSMetaClassDeclareReservedUsed(IOUserClient, 0); +#else + OSMetaClassDeclareReservedUnused(IOUserClient, 0); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 + OSMetaClassDeclareReservedUsed(IOUserClient, 1); +#else + OSMetaClassDeclareReservedUnused(IOUserClient, 1); +#endif + +#endif + OSMetaClassDeclareReservedUnused(IOUserClient, 2); + OSMetaClassDeclareReservedUnused(IOUserClient, 3); + OSMetaClassDeclareReservedUnused(IOUserClient, 4); + OSMetaClassDeclareReservedUnused(IOUserClient, 5); + OSMetaClassDeclareReservedUnused(IOUserClient, 6); + OSMetaClassDeclareReservedUnused(IOUserClient, 7); + OSMetaClassDeclareReservedUnused(IOUserClient, 8); + OSMetaClassDeclareReservedUnused(IOUserClient, 9); + OSMetaClassDeclareReservedUnused(IOUserClient, 10); + OSMetaClassDeclareReservedUnused(IOUserClient, 11); + OSMetaClassDeclareReservedUnused(IOUserClient, 12); + OSMetaClassDeclareReservedUnused(IOUserClient, 13); + OSMetaClassDeclareReservedUnused(IOUserClient, 14); + OSMetaClassDeclareReservedUnused(IOUserClient, 15); + + +protected: + static IOReturn sendAsyncResult(OSAsyncReference reference, + IOReturn result, void *args[], UInt32 numArgs); + static void setAsyncReference(OSAsyncReference asyncRef, + mach_port_t wakePort, + void *callback, void *refcon); + + static IOReturn sendAsyncResult64(OSAsyncReference64 reference, + IOReturn result, io_user_reference_t args[], UInt32 numArgs); + +/*! + * @function sendAsyncResult64WithOptions + * @abstract Send a notification as with sendAsyncResult, but with finite queueing. + * @discussion IOUserClient::sendAsyncResult64() will infitely queue messages if the client + * is not processing them in a timely fashion. This variant will not, for simple + * handling of situations where clients may be expected to stop processing messages. + */ + static IOReturn sendAsyncResult64WithOptions(OSAsyncReference64 reference, + IOReturn result, io_user_reference_t args[], UInt32 numArgs, + IOOptionBits options); + + static void setAsyncReference64(OSAsyncReference64 asyncRef, + mach_port_t wakePort, + mach_vm_address_t callback, io_user_reference_t refcon); + + static void setAsyncReference64(OSAsyncReference64 asyncRef, + mach_port_t wakePort, + mach_vm_address_t callback, io_user_reference_t refcon, + task_t task); + +public: + + static IOReturn clientHasAuthorization( task_t task, + IOService * service ); + + static IOReturn clientHasPrivilege( void * securityToken, + const char * privilegeName ); + + static OSObject * copyClientEntitlement( task_t task, + const char * entitlement ); + + static OSDictionary * copyClientEntitlements(task_t task); + +/*! + * @function releaseAsyncReference64 + * @abstract Release the mach_port_t reference held within the OSAsyncReference64 structure. + * @discussion The OSAsyncReference64 structure passed to async methods holds a reference to the wakeup mach port, which should be released to balance each async method call. Behavior is undefined if these calls are not correctly balanced. + * @param reference The reference passed to the subclass IOAsyncMethod, or externalMethod() in the IOExternalMethodArguments.asyncReference field. + * @result A return code. + */ + static IOReturn releaseAsyncReference64(OSAsyncReference64 reference); +/*! + * @function releaseNotificationPort + * @abstract Release the mach_port_t passed to registerNotificationPort(). + * @discussion The mach_port_t passed to the registerNotificationPort() methods should be released to balance each call to registerNotificationPort(). Behavior is undefined if these calls are not correctly balanced. + * @param port The mach_port_t argument previously passed to the subclass implementation of registerNotificationPort(). + * @result A return code. + */ + static IOReturn releaseNotificationPort(mach_port_t port); + + virtual bool init() APPLE_KEXT_OVERRIDE; + virtual bool init( OSDictionary * dictionary ) APPLE_KEXT_OVERRIDE; +// Currently ignores the all args, just passes up to IOService::init() + virtual bool initWithTask( + task_t owningTask, void * securityToken, UInt32 type, + OSDictionary * properties); + + virtual bool initWithTask( + task_t owningTask, void * securityToken, UInt32 type); + + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual IOReturn clientClose( void ); + virtual IOReturn clientDied( void ); + + virtual IOService * getService( void ); + + MIG_SERVER_ROUTINE virtual IOReturn registerNotificationPort( + mach_port_t port, UInt32 type, UInt32 refCon ); + + MIG_SERVER_ROUTINE virtual IOReturn getNotificationSemaphore( UInt32 notification_type, + semaphore_t * semaphore ); + + virtual IOReturn connectClient( IOUserClient * client ); + +// memory will be released by user client when last map is destroyed + virtual IOReturn clientMemoryForType( UInt32 type, + IOOptionBits * options, + IOMemoryDescriptor ** memory ); + +#if !__LP64__ +private: + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOMemoryMap * mapClientMemory( IOOptionBits type, + task_t task, + IOOptionBits mapFlags = kIOMapAnywhere, + IOVirtualAddress atAddress = 0 ); +#endif + + static IOReturn _sendAsyncResult64(OSAsyncReference64 reference, + IOReturn result, io_user_reference_t args[], UInt32 numArgs, IOOptionBits options); +public: + +/*! + * @function removeMappingForDescriptor + * Remove the first mapping created from the memory descriptor returned by clientMemoryForType() from IOUserClient's list of mappings. If such a mapping exists, it is retained and the reference currently held by IOUserClient is returned to the caller. + * @param memory The memory descriptor instance previously returned by the implementation of clientMemoryForType(). + * @result A reference to the first IOMemoryMap instance found in the list of mappings created by IOUserClient from that passed memory descriptor is returned, or zero if none exist. The caller should release this reference. + */ + IOMemoryMap * removeMappingForDescriptor(IOMemoryDescriptor * memory); + +/*! + * @function exportObjectToClient + * Make an arbitrary OSObject available to the client task. + * @param task The task. + * @param obj The object we want to export to the client. + * @param clientObj Returned value is the client's port name. + */ + virtual IOReturn exportObjectToClient(task_t task, + OSObject *obj, io_object_t *clientObj); + + +// Old methods for accessing method vector backward compatiblility only + virtual IOExternalMethod * + getExternalMethodForIndex( UInt32 index ) + APPLE_KEXT_DEPRECATED; + virtual IOExternalAsyncMethod * + getExternalAsyncMethodForIndex( UInt32 index ) + APPLE_KEXT_DEPRECATED; + +// Methods for accessing method vector. + virtual IOExternalMethod * + getTargetAndMethodForIndex( + LIBKERN_RETURNS_NOT_RETAINED IOService ** targetP, UInt32 index ); + virtual IOExternalAsyncMethod * + getAsyncTargetAndMethodForIndex( + LIBKERN_RETURNS_NOT_RETAINED IOService ** targetP, UInt32 index ); + +// Methods for accessing trap vector - old and new style + virtual IOExternalTrap * + getExternalTrapForIndex( UInt32 index ) + APPLE_KEXT_DEPRECATED; + + virtual IOExternalTrap * + getTargetAndTrapForIndex( + LIBKERN_RETURNS_NOT_RETAINED IOService **targetP, UInt32 index ); +}; + + +#endif /* ! _IOKIT_IOUSERCLIENT_H */ diff --git a/QualcommWireless/include/IOKit/IOUserServer.h b/QualcommWireless/include/IOKit/IOUserServer.h new file mode 100644 index 0000000..66003db --- /dev/null +++ b/QualcommWireless/include/IOKit/IOUserServer.h @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOUSERSERVER_H +#define _IOUSERSERVER_H + +#include + +#define kIOUserClassKey "IOUserClass" +#define kIOUserServerClassKey "IOUserServer" +#define kIOUserServerNameKey "IOUserServerName" +#define kIOUserServerTagKey "IOUserServerTag" +// the expected cdhash value of the userspace driver executable +#define kIOUserServerCDHashKey "IOUserServerCDHash" + +#if DRIVERKIT_PRIVATE + +enum{ + kIOKitUserServerClientType = 0x99000003, +}; + +enum{ + kIOUserServerMethodRegisterClass = 0x0001000, + kIOUserServerMethodStart = 0x0001001, + kIOUserServerMethodRegister = 0x0001002, +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +class OSObject; + +#define OSObject_Instantiate_ID 0x0000000100000001ULL + +enum { + kOSObjectRPCRemote = 0x00000001, + kOSObjectRPCKernel = 0x00000002, +}; + +struct OSObject_Instantiate_Msg_Content { + IORPCMessage __hdr; + OSObjectRef __object; +}; + +struct OSObject_Instantiate_Rpl_Content { + IORPCMessage __hdr; + kern_return_t __result; + uint32_t __pad; + uint64_t flags; + char classname[64]; + uint64_t methods[0]; +}; + +#pragma pack(4) +struct OSObject_Instantiate_Msg { + IORPCMessageMach mach; + mach_msg_port_descriptor_t __object__descriptor; + OSObject_Instantiate_Msg_Content content; +}; +struct OSObject_Instantiate_Rpl { + IORPCMessageMach mach; + OSObject_Instantiate_Rpl_Content content; +}; +#pragma pack() + +typedef uint64_t IOTrapMessageBuffer[256]; + +#endif /* DRIVERKIT_PRIVATE */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#endif /* _IOUSERSERVER_H */ diff --git a/QualcommWireless/include/IOKit/IOWorkLoop.h b/QualcommWireless/include/IOKit/IOWorkLoop.h new file mode 100644 index 0000000..f0dd49b --- /dev/null +++ b/QualcommWireless/include/IOKit/IOWorkLoop.h @@ -0,0 +1,361 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IOWORKLOOP_H +#define __IOKIT_IOWORKLOOP_H + +#include +#include +#include +#include + +#include + +#if IOKITSTATS +#include +#endif + +class IOEventSource; +class IOTimerEventSource; +class IOCommandGate; + +/*! @class IOWorkLoop + * @discussion An IOWorkLoop is a thread of control that is intended to be used to provide single threaded access to hardware. This class has no knowledge of the nature and type of the events that it marshals and forwards. When a device driver successfully starts (see IOService::start), it is expected to create the event sources it will need to receive events. Then a work loop is initialized and the events are added to the work loop for monitoring. In general this set up will be automated by the family superclass of the specific device. + *

+ * The thread main method walks the event source linked list and messages each one requesting a work check. At this point each event source is expected to notify its registered owner that the event has occurred. After each event has been walked and each indicates that another loop isn't required (by setting the 'more' flag to false) the thread will go to sleep on a signaling semaphore. + *

+ * When an event source is registered with a work loop it is informed of the semaphore to use to wake up the loop. + */ + +class IOWorkLoop : public OSObject +{ + OSDeclareDefaultStructors(IOWorkLoop); + +public: +/*! + * @typedef Action + * @discussion Type and arguments of callout C function that is used when + * a runCommand is executed by a client. Cast to this type when you want a C++ + * member function to be used. Note the arg1 - arg3 parameters are straight pass + * through from the runCommand to the action callout. + * @param target + * Target of the function, can be used as a refcon. Note if a C++ function + * was specified, this parameter is implicitly the first parameter in the target + * member function's parameter list. + * @param arg0 Argument to action from run operation. + * @param arg1 Argument to action from run operation. + * @param arg2 Argument to action from run operation. + * @param arg3 Argument to action from run operation. + */ + typedef IOReturn (*Action)(OSObject *target, + void *arg0, void *arg1, + void *arg2, void *arg3); + +#ifdef __BLOCKS__ + typedef IOReturn (^ActionBlock)(); +#endif /* __BLOCKS__ */ + + enum { + kPreciousStack = 0x00000001, + kTimeLockPanics = 0x00000002, + }; + +private: +/*! @function threadMainContinuation + * @abstract Static function that calls the threadMain function. + */ + static void threadMainContinuation(IOWorkLoop *self); + +/*! @function eventSourcePerformsWork + * @abstract Checks if the event source passed in overrides checkForWork() to perform any work. + * IOWorkLoop uses this to determine if the event source should be polled in runEventSources() or not. + * @param inEventSource The event source to check. + */ + bool eventSourcePerformsWork(IOEventSource *inEventSource); + +protected: + +/*! @typedef maintCommandEnum + * @discussion Enumeration of commands that _maintCommand can deal with. + * @constant mAddEvent Used to tag a Remove event source command. + * @constant mRemoveEvent Used to tag a Remove event source command. + */ + typedef enum { mAddEvent, mRemoveEvent } maintCommandEnum; + +/*! @var gateLock + * Mutual exclusion lock that is used by close and open Gate functions. + * This is a recursive lock, which allows multiple layers of code to share a single IOWorkLoop without deadlock. This is common in IOKit since threads of execution tend to follow the service plane in the IORegistry, and multiple objects along the call path may acquire the gate for the same (shared) workloop. + */ + IORecursiveLock *gateLock; + +/*! @var eventChain + * Pointer to first event source in linked list. + */ + IOEventSource *eventChain; + +/*! @var controlG + * Internal control gate to maintain event system. + */ + IOCommandGate *controlG; + +/*! @var workToDoLock + * The spin lock that is used to guard the 'workToDo' variable. + */ + IOSimpleLock *workToDoLock; + +/*! @var workThread + * Work loop thread. + */ + IOThread workThread; + +/*! @var workToDo + * Used to to indicate that an interrupt has fired and needs to be processed. + */ + volatile bool workToDo; + +/*! @var loopRestart + * Set if an event chain has been changed and the system has to be rechecked from start. (Internal use only) + */ + bool loopRestart; + +/*! @struct ExpansionData + * @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { + IOOptionBits options; + IOEventSource *passiveEventChain; +#if IOKITSTATS + struct IOWorkLoopCounter *counter; +#else + void *iokitstatsReserved; +#endif + uint64_t lockInterval; + uint64_t lockTime; + }; + +/*! @var reserved + * Reserved for future use. (Internal use only) + */ + ExpansionData *reserved; + +/*! @function _maintRequest + * @abstract Synchronous implementation of addEventSource and removeEventSource functions. + * @discussion This function implements the commands as defined in the maintCommandEnum. It can be subclassed but it isn't an external API in the usual sense. A subclass implementation of _maintRequest would be called synchronously with respect to the work loop and it should be implemented in the usual way that an ioctl would be. + * @return kIOReturnUnsupported if the command given is not implemented, kIOReturnSuccess otherwise. + */ + virtual IOReturn _maintRequest(void *command, void *data, void *, void *); + +/*! @function free + * @discussion Mandatory free of the object independent of the current retain count. If the work loop is running, this method will not return until the thread has successfully terminated. Each event source in the chain will be released and the working semaphore will be destroyed. + *

+ * If the client has some outstanding requests on an event they will never be informed of completion. If an external thread is blocked on any of the event sources they will be awakened with a KERN_INTERUPTED status. + */ + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! @function threadMain + * @discussion Work loop threads main function. This function consists of 3 + * loops: the outermost loop is the semaphore clear and wait loop, the middle + * loop terminates when there is no more work, and the inside loop walks the + * event list calling the checkForWork method in each event source. If an + * event source has more work to do, it can set the more flag and the middle + * loop will repeat. When no more work is outstanding the outermost will + * sleep until an event is signalled. + */ + virtual void threadMain(); + +public: + +/*! @function workLoop + * @abstract Factory member function to construct and intialize a work loop. + * @result Returns a workLoop instance if constructed successfully, 0 otherwise. + */ + static IOWorkLoop *workLoop(); + +/*! @function workLoopWithOptions(IOOptionBits options) + * @abstract Factory member function to constuct and intialize a work loop. + * @param options Options - kPreciousStack to avoid stack deallocation on paging path. + * @result Returns a workLoop instance if constructed successfully, 0 otherwise. + */ + static IOWorkLoop *workLoopWithOptions(IOOptionBits options); + +/*! @function init + * @discussion Initializes an instance of the workloop. This method creates and initializes the signaling semaphore, the controller gate lock, and spawns the thread that will continue executing. + * @result Returns true if initialized successfully, false otherwise. + */ + virtual bool init() APPLE_KEXT_OVERRIDE; + +/*! @function getThread + * @abstract Gets the workThread. + * @result Returns workThread. + */ + virtual IOThread getThread() const; + +/*! @function onThread + * @abstract Is the current execution context on the work thread? + * @result Returns true if IOThreadSelf() == workThread. + */ + virtual bool onThread() const; + +/*! @function inGate + * @abstract Is the current execution context holding the work-loop's gate? + * @result Returns true if IOThreadSelf() is gate holder. + */ + virtual bool inGate() const; + +/*! @function addEventSource + * @discussion Add an event source to be monitored by the work loop. This function does not return until the work loop has acknowledged the arrival of the new event source. When a new event has been added the threadMain will always restart its loop and check all outstanding events. The event source is retained by the work loop. + * @param newEvent Pointer to IOEventSource subclass to add. + * @result Always returns kIOReturnSuccess. + */ + virtual IOReturn addEventSource(IOEventSource *newEvent); + +/*! @function removeEventSource + * @discussion Remove an event source from the work loop. This function does not return until the work loop has acknowledged the removal of the event source. When an event has been removed the threadMain will always restart its loop and check all outstanding events. The event source will be released before return. + * @param toRemove Pointer to IOEventSource subclass to remove. + * @result Returns kIOReturnSuccess if successful, kIOReturnBadArgument if toRemove couldn't be found. + */ + virtual IOReturn removeEventSource(IOEventSource *toRemove); + +/*! @function enableAllEventSources + * @abstract Calls enable() in all event sources. + * @discussion For all event sources in eventChain, call enable() function. See IOEventSource::enable(). + */ + virtual void enableAllEventSources() const; + +/*! @function disableAllEventSources + * @abstract Calls disable() in all event sources. + * @discussion For all event sources in eventChain, call disable() function. See IOEventSource::disable(). + */ + virtual void disableAllEventSources() const; + +/*! @function enableAllInterrupts + * @abstract Calls enable() in all interrupt event sources. + * @discussion For all event sources (ES) for which OSDynamicCast(IOInterruptEventSource, ES) is valid, in eventChain call enable() function. See IOEventSource::enable(). + */ + virtual void enableAllInterrupts() const; + +/*! @function disableAllInterrupts + * @abstract Calls disable() in all interrupt event sources. + * @discussion For all event sources (ES) for which OSDynamicCast(IOInterruptEventSource, ES) is valid, in eventChain call disable() function. See IOEventSource::disable(). + */ + virtual void disableAllInterrupts() const; + + +protected: +// Internal APIs used by event sources to control the thread + friend class IOEventSource; + friend class IOTimerEventSource; + friend class IOCommandGate; +#if IOKITSTATS + friend class IOStatistics; +#endif + virtual void signalWorkAvailable(); + virtual void openGate(); + virtual void closeGate(); + virtual bool tryCloseGate(); + virtual int sleepGate(void *event, UInt32 interuptibleType); + virtual void wakeupGate(void *event, bool oneThread); + +public: +/* methods available in Mac OS X 10.1 or later */ + +/*! @function runAction + * @abstract Single thread a call to an action with the work-loop. + * @discussion Client function that causes the given action to be called in a single threaded manner. Beware: the work-loop's gate is recursive and runAction can cause direct or indirect re-entrancy. When executing on a client's thread, runAction will sleep until the work-loop's gate opens for execution of client actions, the action is single threaded against all other work-loop event sources. + * @param action Pointer to function to be executed in work-loop context. + * @param arg0 Parameter for action parameter, defaults to 0. + * @param arg1 Parameter for action parameter, defaults to 0. + * @param arg2 Parameter for action parameter, defaults to 0. + * @param arg3 Parameter for action parameter, defaults to 0. + * @result Returns the value of the Action callout. + */ + virtual IOReturn runAction(Action action, OSObject *target, + void *arg0 = NULL, void *arg1 = NULL, + void *arg2 = NULL, void *arg3 = NULL); + +#ifdef __BLOCKS__ +/*! @function runAction + * @abstract Single thread a call to an action with the work-loop. + * @discussion Client function that causes the given action to be called in a single threaded manner. Beware: the work-loop's gate is recursive and runAction can cause direct or indirect re-entrancy. When executing on a client's thread, runAction will sleep until the work-loop's gate opens for execution of client actions, the action is single threaded against all other work-loop event sources. + * @param action Block to be executed in work-loop context. + * @result Returns the result of the action block. + */ + IOReturn runActionBlock(ActionBlock action); +#endif /* __BLOCKS__ */ + +/*! @function runEventSources + * @discussion Consists of the inner 2 loops of the threadMain function(qv). + * The outer loop terminates when there is no more work, and the inside loop + * walks the event list calling the checkForWork method in each event source. + * If an event source has more work to do, it can set the more flag and the + * outer loop will repeat. + *

+ * This function can be used to clear a priority inversion between the normal + * workloop thread and multimedia's real time threads. The problem is that + * the interrupt action routine is often held off by high priority threads. + * So if they want to get their data now they will have to call us and ask if + * any data is available. The multi-media user client will arrange for this + * function to be called, which causes any pending interrupts to be processed + * and the completion routines called. By the time the function returns all + * outstanding work will have been completed at the real time threads + * priority. + * + * @result Return false if the work loop is shutting down, true otherwise. + */ + virtual bool runEventSources(); + +/*! @function setMaximumLockTime + * @discussion For diagnostics use in DEVELOPMENT kernels, set a time interval which if the work loop lock is held for this time or greater, IOWorkLoop will panic or log a backtrace. + * @param interval An absolute time interval, eg. created with clock_interval_to_absolutetime_interval(). + * @param options Pass IOWorkLoop::kTimeLockPanics to panic when the time is exceeded, otherwise a log will be generated with OSReportWithBacktrace(). + */ + void setMaximumLockTime(uint64_t interval, uint32_t options); + +protected: +// Internal APIs used by event sources to control the thread + virtual int sleepGate(void *event, AbsoluteTime deadline, UInt32 interuptibleType); + + +protected: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IOWorkLoop, 0); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 1); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 2); +#else + OSMetaClassDeclareReservedUsed(IOWorkLoop, 0); + OSMetaClassDeclareReservedUsed(IOWorkLoop, 1); + OSMetaClassDeclareReservedUsed(IOWorkLoop, 2); +#endif + OSMetaClassDeclareReservedUnused(IOWorkLoop, 3); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 4); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 5); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 6); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 7); +}; + +#endif /* !__IOKIT_IOWORKLOOP_H */ diff --git a/QualcommWireless/include/IOKit/OSMessageNotification.h b/QualcommWireless/include/IOKit/OSMessageNotification.h new file mode 100644 index 0000000..42f1bc8 --- /dev/null +++ b/QualcommWireless/include/IOKit/OSMessageNotification.h @@ -0,0 +1,162 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef __OS_OSMESSAGENOTIFICATION_H +#define __OS_OSMESSAGENOTIFICATION_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +enum { + kFirstIOKitNotificationType = 100, + kIOServicePublishNotificationType = 100, + kIOServiceMatchedNotificationType = 101, + kIOServiceTerminatedNotificationType = 102, + kIOAsyncCompletionNotificationType = 150, + kIOServiceMessageNotificationType = 160, + kLastIOKitNotificationType = 199, + + // reserved bits + kIOKitNoticationTypeMask = 0x00000FFF, + kIOKitNoticationTypeSizeAdjShift = 30, + kIOKitNoticationMsgSizeMask = 3, +}; + +enum { + kOSNotificationMessageID = 53, + kOSAsyncCompleteMessageID = 57, + kMaxAsyncArgs = 16 +}; + +enum { + kIOAsyncReservedIndex = 0, + kIOAsyncReservedCount, + + kIOAsyncCalloutFuncIndex = kIOAsyncReservedCount, + kIOAsyncCalloutRefconIndex, + kIOAsyncCalloutCount, + + kIOMatchingCalloutFuncIndex = kIOAsyncReservedCount, + kIOMatchingCalloutRefconIndex, + kIOMatchingCalloutCount, + + kIOInterestCalloutFuncIndex = kIOAsyncReservedCount, + kIOInterestCalloutRefconIndex, + kIOInterestCalloutServiceIndex, + kIOInterestCalloutCount +}; + + + +// -------------- +enum { + kOSAsyncRef64Count = 8, + kOSAsyncRef64Size = kOSAsyncRef64Count * ((int) sizeof(io_user_reference_t)) +}; +typedef io_user_reference_t OSAsyncReference64[kOSAsyncRef64Count]; + +struct OSNotificationHeader64 { + mach_msg_size_t size; /* content size */ + natural_t type; + OSAsyncReference64 reference; + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + unsigned char content[]; +#else + unsigned char content[0]; +#endif +}; + +#pragma pack(4) +struct IOServiceInterestContent64 { + natural_t messageType; + io_user_reference_t messageArgument[1]; +}; +#pragma pack() +// -------------- + +#if !KERNEL_USER32 + +enum { + kOSAsyncRefCount = 8, + kOSAsyncRefSize = 32 +}; +typedef natural_t OSAsyncReference[kOSAsyncRefCount]; + +struct OSNotificationHeader { + mach_msg_size_t size; /* content size */ + natural_t type; + OSAsyncReference reference; + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + unsigned char content[]; +#else + unsigned char content[0]; +#endif +}; + +#pragma pack(4) +struct IOServiceInterestContent { + natural_t messageType; + void * messageArgument[1]; +}; +#pragma pack() + +#endif /* KERNEL_USER32 */ + +struct IOAsyncCompletionContent { + IOReturn result; +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + void * args[] __attribute__ ((packed)); +#else + void * args[0] __attribute__ ((packed)); +#endif +}; + +#ifndef __cplusplus +typedef struct OSNotificationHeader OSNotificationHeader; +typedef struct IOServiceInterestContent IOServiceInterestContent; +typedef struct IOAsyncCompletionContent IOAsyncCompletionContent; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __OS_OSMESSAGENOTIFICATION_H */ diff --git a/QualcommWireless/include/IOKit/acpi/IOACPIPlatformDevice.h b/QualcommWireless/include/IOKit/acpi/IOACPIPlatformDevice.h new file mode 100644 index 0000000..b521a30 --- /dev/null +++ b/QualcommWireless/include/IOKit/acpi/IOACPIPlatformDevice.h @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOACPIPLATFORMDEVICE_H +#define _IOKIT_IOACPIPLATFORMDEVICE_H + +#include +#include +#include + +class IOACPIPlatformExpert; + +class IOACPIPlatformDevice : public IOPlatformDevice +{ + OSDeclareDefaultStructors( IOACPIPlatformDevice ) + +protected: + void * _deviceHandle; + UInt32 _deviceType; + UInt32 _powerFlags; + UInt32 * _powerStateFlags; + UInt32 _sleepPowerState; + IOService * _acpiParent; + IOACPIPlatformExpert * _platform; + + /* + * This structure will be used to expand the capablilties + * of the class in the future. + */ + struct ExpansionData { }; + + /* + * Reserved for future use. (Internal use only) + */ + ExpansionData * reserved; + + virtual bool initACPIPowerManagement( IOService * powerParent ); + virtual void stopACPIPowerManagement( IOService * powerParent ); + +public: + virtual bool init( IOService * platform, + void * handle, + OSDictionary * properties ); + + virtual void free( void ) APPLE_KEXT_OVERRIDE; + + virtual bool attachToParent( IORegistryEntry * parent, + const IORegistryPlane * plane ) APPLE_KEXT_OVERRIDE; + + virtual void detachFromParent( IORegistryEntry * parent, + const IORegistryPlane * plane ) APPLE_KEXT_OVERRIDE; + + virtual bool getPathComponent( char * path, int * length, + const IORegistryPlane * plane ) const APPLE_KEXT_OVERRIDE; + + virtual bool compareName( OSString * name, + OSString ** matched ) const APPLE_KEXT_OVERRIDE; + + virtual IOReturn getResources( void ) APPLE_KEXT_OVERRIDE; + + virtual void * getDeviceHandle( void ) const; + + virtual UInt32 getDeviceStatus( void ) const; + + enum { + kTypeDevice = 0, + kTypeProcessor = 1, + kTypePowerResource = 2 + }; + + virtual UInt32 getDeviceType( void ) const; + + virtual void setDeviceType( UInt32 deviceType ); + + // Method (object) evaluation + + virtual IOReturn validateObject( const OSSymbol * objectName ); + + virtual IOReturn validateObject( const char * objectName ); + + virtual IOReturn evaluateObject( const OSSymbol * objectName, + OSObject ** result = 0, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateObject( const char * objectName, + OSObject ** result = 0, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateInteger( const OSSymbol * objectName, + UInt32 * resultInt32, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateInteger( const char * objectName, + UInt32 * resultInt32, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateInteger( const OSSymbol * objectName, + UInt64 * resultInt64, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateInteger( const char * objectName, + UInt64 * resultInt64, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + // ACPI table access + + virtual const OSData * getACPITableData( const char * tableName, + UInt32 tableInstance = 0 ) const; + + // Map ACPI event to interrupt event source index + + virtual SInt32 installInterruptForFixedEvent( UInt32 fixedEvent ); + + virtual SInt32 installInterruptForGPE( UInt32 gpeNumber, + void * gpeBlockDevice = 0, + IOOptionBits options = 0 ); + + // ACPI global lock acquire/release + + virtual IOReturn acquireGlobalLock( UInt32 * lockToken, + const mach_timespec_t * timeout = 0 ); + + virtual void releaseGlobalLock( UInt32 lockToken ); + + // Address space handler registration + + virtual IOReturn registerAddressSpaceHandler( + IOACPIAddressSpaceID spaceID, + IOACPIAddressSpaceHandler handler, + void * context, + IOOptionBits options = 0 ); + + virtual void unregisterAddressSpaceHandler( + IOACPIAddressSpaceID spaceID, + IOACPIAddressSpaceHandler handler, + IOOptionBits options = 0 ); + + // Address space access + + virtual IOReturn readAddressSpace( UInt64 * value, + IOACPIAddressSpaceID spaceID, + IOACPIAddress address, + UInt32 bitWidth, + UInt32 bitOffset = 0, + IOOptionBits options = 0 ); + + virtual IOReturn writeAddressSpace( UInt64 value, + IOACPIAddressSpaceID spaceID, + IOACPIAddress address, + UInt32 bitWidth, + UInt32 bitOffset = 0, + IOOptionBits options = 0 ); + + // Power management + + virtual bool hasSystemWakeCapability( void ) const; + + virtual IOReturn setSystemWakeCapabilityEnable( bool enable ); + + virtual bool hasACPIPowerStateSupport( UInt32 powerState ) const; + + virtual IOReturn setACPIPowerManagementEnable( + bool enable, + UInt32 powerState = kIOACPIDevicePowerStateD3, + IOOptionBits options = 0 ); + + virtual IOReturn setPowerState( unsigned long powerState, + IOService * whatDevice ) APPLE_KEXT_OVERRIDE; + + // I/O space helpers + + virtual void ioWrite32( UInt16 offset, UInt32 value, + IOMemoryMap * map = 0 ); + + virtual void ioWrite16( UInt16 offset, UInt16 value, + IOMemoryMap * map = 0 ); + + virtual void ioWrite8( UInt16 offset, UInt8 value, + IOMemoryMap * map = 0 ); + + virtual UInt32 ioRead32( UInt16 offset, IOMemoryMap * map = 0 ); + + virtual UInt16 ioRead16( UInt16 offset, IOMemoryMap * map = 0 ); + + virtual UInt8 ioRead8( UInt16 offset, IOMemoryMap * map = 0 ); + + // vtable padding + + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 0 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 1 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 2 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 3 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 4 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 5 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 6 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 7 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 8 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 9 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 10 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 11 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 12 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 13 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 14 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 15 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 16 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 17 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 18 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 19 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 20 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 21 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 22 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 23 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 24 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 25 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 26 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 27 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 28 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 29 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 30 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 31 ); +}; + +#endif /* !_IOKIT_IOACPIPLATFORMDEVICE_H */ diff --git a/QualcommWireless/include/IOKit/acpi/IOACPIPlatformExpert.h b/QualcommWireless/include/IOKit/acpi/IOACPIPlatformExpert.h new file mode 100644 index 0000000..3abbb39 --- /dev/null +++ b/QualcommWireless/include/IOKit/acpi/IOACPIPlatformExpert.h @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOACPIPLATFORMEXPERT_H +#define _IOKIT_IOACPIPLATFORMEXPERT_H + +#include // superclass +#include // children + +class IOACPIPlatformExpert : public IODTPlatformExpert +{ + OSDeclareAbstractStructors( IOACPIPlatformExpert ) + + friend class IOACPIPlatformDevice; + +protected: + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties + of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) + */ + ExpansionData * reserved; + +public: + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + +protected: + // Map ACPI event to interrupt event source index + + virtual SInt32 installDeviceInterruptForFixedEvent( + IOService * device, + UInt32 fixedEvent ) = 0; + + virtual SInt32 installDeviceInterruptForGPE( + IOService * device, + UInt32 gpeNumber, + void * gpeBlockDevice, + IOOptionBits options ) = 0; + + // ACPI global lock acquisition + + virtual IOReturn acquireGlobalLock( IOService * client, + UInt32 * lockToken, + const mach_timespec_t * timeout ) = 0; + + virtual void releaseGlobalLock( IOService * client, + UInt32 lockToken ) = 0; + + // ACPI method and object evaluation + + virtual IOReturn validateObject( IOACPIPlatformDevice * device, + const OSSymbol * objectName ) = 0; + + virtual IOReturn validateObject( IOACPIPlatformDevice * device, + const char * objectName ); + + virtual IOReturn evaluateObject( IOACPIPlatformDevice * device, + const OSSymbol * objectName, + OSObject ** result, + OSObject * params[], + IOItemCount paramCount, + IOOptionBits options ) = 0; + + virtual IOReturn evaluateObject( IOACPIPlatformDevice * device, + const char * objectName, + OSObject ** result, + OSObject * params[], + IOItemCount paramCount, + IOOptionBits options ); + + // ACPI table + + virtual const OSData * getACPITableData( + const char * tableName, + UInt32 tableInstance ) = 0; + + // Address space handler + + virtual IOReturn registerAddressSpaceHandler( + IOACPIPlatformDevice * device, + IOACPIAddressSpaceID spaceID, + IOACPIAddressSpaceHandler handler, + void * context, + IOOptionBits options ) = 0; + + virtual void unregisterAddressSpaceHandler( + IOACPIPlatformDevice * device, + IOACPIAddressSpaceID spaceID, + IOACPIAddressSpaceHandler handler, + IOOptionBits options ) = 0; + + // Address space read/write + + virtual IOReturn readAddressSpace( UInt64 * value, + IOACPIAddressSpaceID spaceID, + IOACPIAddress address, + UInt32 bitWidth, + UInt32 bitOffset, + IOOptionBits options ) = 0; + + virtual IOReturn writeAddressSpace( UInt64 value, + IOACPIAddressSpaceID spaceID, + IOACPIAddress address, + UInt32 bitWidth, + UInt32 bitOffset, + IOOptionBits options ) = 0; + + // Device power management + + virtual IOReturn setDevicePowerState( IOACPIPlatformDevice * device, + UInt32 powerState ) = 0; + + virtual IOReturn getDevicePowerState( IOACPIPlatformDevice * device, + UInt32 * powerState ) = 0; + + virtual IOReturn setDeviceWakeEnable( IOACPIPlatformDevice * device, + bool enable ) = 0; + + // vtable padding + + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 0 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 1 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 2 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 3 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 4 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 5 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 6 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 7 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 8 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 9 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 10 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 11 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 12 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 13 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 14 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 15 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 16 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 17 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 18 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 19 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 20 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 21 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 22 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 23 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 24 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 25 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 26 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 27 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 28 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 29 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 30 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 31 ); +}; + +#endif /* !_IOKIT_IOACPIPLATFORMEXPERT_H */ diff --git a/QualcommWireless/include/IOKit/acpi/IOACPITypes.h b/QualcommWireless/include/IOKit/acpi/IOACPITypes.h new file mode 100644 index 0000000..4e36211 --- /dev/null +++ b/QualcommWireless/include/IOKit/acpi/IOACPITypes.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IOACPITYPES_H +#define __IOKIT_IOACPITYPES_H + +#include + +extern const IORegistryPlane * gIOACPIPlane; +extern const OSSymbol * gIOACPIHardwareIDKey; +extern const OSSymbol * gIOACPIUniqueIDKey; +extern const OSSymbol * gIOACPIAddressKey; +extern const OSSymbol * gIOACPIDeviceStatusKey; + +#define kIOACPIInterruptTypeValid (1 << 1) +#pragma pack(1) + +struct IOACPIAddressSpaceDescriptor { + UInt32 resourceType; + UInt32 generalFlags; + UInt32 typeSpecificFlags; + UInt32 reserved1; + UInt64 granularity; + UInt64 minAddressRange; + UInt64 maxAddressRange; + UInt64 translationOffset; + UInt64 addressLength; + UInt64 reserved2; + UInt64 reserved3; + UInt64 reserved4; +}; + +enum { + kIOACPIMemoryRange = 0, + kIOACPIIORange = 1, + kIOACPIBusNumberRange = 2 +}; + +typedef UInt32 IOACPIAddressSpaceID; + +enum { + kIOACPIAddressSpaceIDSystemMemory = 0, + kIOACPIAddressSpaceIDSystemIO = 1, + kIOACPIAddressSpaceIDPCIConfiguration = 2, + kIOACPIAddressSpaceIDEmbeddedController = 3, + kIOACPIAddressSpaceIDSMBus = 4 +}; + +/* + * Address space operation + */ +enum { + kIOACPIAddressSpaceOpRead = 0, + kIOACPIAddressSpaceOpWrite = 1 +}; + +/* + * 64-bit ACPI address + */ +union IOACPIAddress { + UInt64 addr64; + struct { + unsigned int offset :16; + unsigned int function :3; + unsigned int device :5; + unsigned int bus :8; + unsigned int segment :16; + unsigned int reserved :16; + } pci; +}; + +/* + * Address space handler + */ +typedef IOReturn (*IOACPIAddressSpaceHandler)( UInt32 operation, + IOACPIAddress address, + UInt64 * value, + UInt32 bitWidth, + UInt32 bitOffset, + void * context ); + +/* + * ACPI fixed event types + */ +enum { + kIOACPIFixedEventPMTimer = 0, + kIOACPIFixedEventPowerButton = 2, + kIOACPIFixedEventSleepButton = 3, + kIOACPIFixedEventRealTimeClock = 4 +}; + +#pragma pack() + +/* + * FIXME: Move to xnu/iokit to reserve the ACPI family code. + */ +#ifndef sub_iokit_acpi +#define sub_iokit_acpi err_sub(10) +#endif + +/* + * ACPI notify message sent to all clients and interested parties. + * The notify code can be read from the argument as an UInt32. + */ +#define kIOACPIMessageDeviceNotification iokit_family_msg(sub_iokit_acpi, 0x10) + +/* + * ACPI device power states + */ +enum { + kIOACPIDevicePowerStateD0 = 0, + kIOACPIDevicePowerStateD1 = 1, + kIOACPIDevicePowerStateD2 = 2, + kIOACPIDevicePowerStateD3 = 3, + kIOACPIDevicePowerStateCount = 4 +}; + +#endif /* !__IOKIT_IOACPITYPES_H */ diff --git a/QualcommWireless/include/IOKit/assert.h b/QualcommWireless/include/IOKit/assert.h new file mode 100644 index 0000000..cb02129 --- /dev/null +++ b/QualcommWireless/include/IOKit/assert.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IO_ASSERT_H_ +#define _IO_ASSERT_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if IOASSERT +#undef MACH_ASSERT +#define MACH_ASSERT 1 +#endif +#include + +#ifdef __cplusplus +} +#endif + + +#if(!defined(OSCompileAssert)) +# define OSCompileAssert( TEST ) \ + extern int OSCompileAssertFailed[ ( TEST ) ? 1 : -1 ] __unused; +#endif + +#endif /* _IO_ASSERT_H_ */ diff --git a/QualcommWireless/include/IOKit/ata/ATADeviceNub.h b/QualcommWireless/include/IOKit/ata/ATADeviceNub.h new file mode 100644 index 0000000..db14182 --- /dev/null +++ b/QualcommWireless/include/IOKit/ata/ATADeviceNub.h @@ -0,0 +1,164 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header ATADeviceNub.h + @abstract A concrete implementation of IOATADevice. + */ + +#ifndef _ATADEVICENUB_H +#define _ATADEVICENUB_H + +#include +#include "IOATATypes.h" +#include "IOATADevice.h" +#include "IOATAController.h" + +#include "IOATABusCommand.h" + + +/*! +@class ATADeviceNub +@abstract ATADeviceNub is a concrete implementation of IOATADevice. +@discussion clients of IOATA (disk drivers) should use the interface presented +by IOATADevice. Concrete nubs are private to the IOATA family and +specific subclasses of IOATADevice are instantiated by controller +drivers to provide the abstract interface to clients. + +*/ +class ATADeviceNub : public IOATADevice +{ + OSDeclareDefaultStructors(ATADeviceNub); + +public: + + /*!@function ataDeviceNub + @abstract static creator function - used by IOATAControllers to create nubs. + */ + static ATADeviceNub* ataDeviceNub( IOATAController* provider, ataUnitID unit, ataDeviceType devType); + + /*!@function attach + @abstract override of IOService method. + */ + virtual bool attach(IOService* provider ); + + + // overrides from IOATADevice to provide actual client interface + + + /*!@function executeCommand + @abstract Submit IO requests + */ + virtual IOReturn executeCommand(IOATACommand* command); + + // create and destroy IOATACommands + /*!@function allocCommand + @abstract create command objects for clients. + */ + virtual IOATACommand* allocCommand( void ); + + /*!@function freeCommand + @abstract Clients use this method to dispose of command objects. + */ + virtual void freeCommand( IOATACommand* inCommand); + + +protected: + + /*!@function init + @abstract used after creating the nub. + */ + virtual bool init(IOATAController* provider, ataUnitID unit, ataDeviceType devType); + + /*!@function publishProperties + @abstract publish the nub's properties in the device tree. + */ + virtual void publishProperties( void ); + + /*!@function publishBusProperties + @abstract puts info about this device's bus capability in the device tree. + */ + virtual void publishBusProperties(void); + + /*!@function publishVendorProperties + @abstract will be deprecated. + */ + virtual void publishVendorProperties( void ); + + /*!@function getDeviceID + @abstract get the unit id of this drive (0 or 1) + */ + virtual IOReturn getDeviceID(void); + + /*!@function MyATACallback + @abstract to be deprecated. + */ + static void MyATACallback(IOATACommand* command ); + + /*!@function processCallback + @abstract to be deprecated. + */ + void processCallback(IOATACommand* command ); + + /*!@function swapBytes16 + @abstract to be deprecated. + */ + void swapBytes16( UInt8* dataBuffer, IOByteCount length); + + UInt8* buffer; + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the ATADeviceNub in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(ATADeviceNub, 0); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 1); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 2); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 3); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 4); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 5); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 6); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 7); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 8); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 9); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 10); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 11); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 12); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 13); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 14); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 15); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 16); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 17); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 18); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 19); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 20); + +}; + +#endif /* !_IOATABUSNUB_H */ diff --git a/QualcommWireless/include/IOKit/ata/ATATimerEventSource.h b/QualcommWireless/include/IOKit/ata/ATATimerEventSource.h new file mode 100644 index 0000000..c6afe36 --- /dev/null +++ b/QualcommWireless/include/IOKit/ata/ATATimerEventSource.h @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2001-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _ATATIMEREVENTSOURCE_H +#define _ATATIMEREVENTSOURCE_H + + +#include +#include +#include +#include +#include +#include + + +/*! +@class ATATimerEventSource + +@discussion +Extend the timer event source to allow checking for timer expiration +from behind the workloop. +*/ + +class ATATimerEventSource : public IOTimerEventSource +{ + OSDeclareDefaultStructors(ATATimerEventSource); + + public: + + /*!@function ataTimerEventSource + @abstract allocate an instance of this type. + */ + static ATATimerEventSource * + ataTimerEventSource(OSObject *owner, Action action = 0); + + /*!@function hasTimedOut + @abstract returns true if the timer has expired since the last enable/disable or setTimeout() or wakeAtTime() call. + */ + virtual bool hasTimedOut( void ); + + // override to initialize the time out flag. + /*!@function + @abstract + */ + virtual bool init(OSObject *owner, Action action = 0); + + /*!@function enable + @abstract overrides in order to set/clear the timed out flag + */ + virtual void enable(); + + /*!@function disable + @abstract overrides in order to set/clear the timed out flag + */ + virtual void disable(); + + /*!@function wakeAtTime + @abstract overrides in order to set/clear the timed out flag + */ + virtual IOReturn wakeAtTime(UnsignedWide abstime); + + /*!@function cancelTimeout + @abstract overrides in order to set/clear the timed out flag + */ + virtual void cancelTimeout(); + +protected: + + enum{ kTimedOutTrue = 'true', + kTimedOutFalse = 'fals' + }; + + UInt32 hasExpired; + + + /*!@function myTimeout + @abstract my timeout function which sets the timedOut flag atomically. + */ + static void myTimeout(void *self); + + /*!@function setTimeoutFunc + @abstract override to install my timeout function instead of the super's. + */ + virtual void setTimeoutFunc(); + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 0); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 1); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 2); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 3); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 4); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 5); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 6); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 7); + +}; + + +#endif /*_ATATIMEREVENTSOURCE_H*/ diff --git a/QualcommWireless/include/IOKit/ata/IOATABusCommand.h b/QualcommWireless/include/IOKit/ata/IOATABusCommand.h new file mode 100644 index 0000000..94b3bca --- /dev/null +++ b/QualcommWireless/include/IOKit/ata/IOATABusCommand.h @@ -0,0 +1,250 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * + * IOATABusCommand.h + * + */ + +#ifndef _IOATABUSCOMMAND_H +#define _IOATABUSCOMMAND_H + +#include +#include "IOATATypes.h" +#include "IOATACommand.h" + + +class IOSyncer; + + +/*! + +@class IOATABusCommand + +@discussion ATA Device (disk) drivers should use the superclass, IOATACommand +and may not derive or use any subclass of IOATACommand. + +IOATABusCommand is the subclass of IOATACommand used by +IOATAControllers. Controller classes may override this class to +provide additional fields as their needs dictate or may use this +as a concrete class if it is sufficient. + +IOATAControllers are always paired with specific IOATADevices +and each specific subclass of IOATADevice is in turn the factory method +for IOATACommands for use by disk drivers. + +In this manner, mass-storage device drivers (disk drivers, clients of +ATA bus controllers) see only the generalized interface of IOATADevice +and the generalized interface of IOATACommand. This provides isolation +from specific bus details for disk drivers and offers flexibility to +controllers to add per-command fields and state variables for their own +internal use. + +*/ + +class IOATABusCommand : public IOATACommand { + + OSDeclareDefaultStructors( IOATABusCommand ); + + public: + + // data items for use by IOATAController + + /*! @var queueChain queue header for use by IOATAController. */ + queue_chain_t queueChain; + + /*! @var state state-semaphore for use by IOATAController */ + UInt32 state; + + /*! @var syncer IOSyncer for use by IOATAController */ + IOSyncer* syncer; + + + + /*!@function allocateCmd + @abstract factory method to create an instance of this class used by subclasses of IOATADevice + */ + static IOATABusCommand* allocateCmd(void); + + /*!@function zeroCommand + @abstract set to blank state, call prior to re-use of this object + */ + virtual void zeroCommand(void); + + /*!@function getOpcode + @abstract return the command opcode + */ + virtual ataOpcode getOpcode( void ); + + /*!@function getFlags + @abstract return the flags for this command. + */ + virtual ataFlags getFlags ( void ); + + /*!@function getRegMask + @abstract get the register mask for desired regs + */ + virtual ataRegMask getRegMask( void ); + + /*!@function getUnit + @abstract return the unit id (0 master, 1 slave) + */ + virtual ataUnitID getUnit( void ); + + /*!@function getTimeoutMS + @abstract return the timeout value for this command + */ + virtual UInt32 getTimeoutMS (void ); + + /*!@function setResult + @abstract set the result code + */ + virtual void setResult( IOReturn ); + + /*!@function getCallbackPtr + @abstract return the callback pointer + */ + virtual IOATACompletionFunction* getCallbackPtr (void ); + + + /*!@function executeCallback + @abstract call the completion callback function + */ + virtual void executeCallback(void); + + /*!@function getTaskFilePtr + @abstract return the taskfile structure pointer. + */ + virtual ataTaskFile* getTaskFilePtr(void); + + /*!@function getPacketSize + @abstract return the size of atapi packet if any. + */ + virtual UInt16 getPacketSize(void); + + /*!@function getPacketData + @abstract return pointer to the array of packet data. + */ + virtual UInt16* getPacketData(void); + + /*!@function getTransferChunkSize + @abstract number of bytes between interrupts. + */ + virtual IOByteCount getTransferChunkSize(void); + + /*!@function setActualTransfer + @abstract set the byte count of bytes actually transferred. + */ + virtual void setActualTransfer ( IOByteCount bytesTransferred ); + + /*!@function getBuffer + @abstract get pointer to the memory descriptor for this transaction + */ + virtual IOMemoryDescriptor* getBuffer ( void); + + /*!@function getPosition + @abstract the position within the memory buffer for the transaction. + */ + virtual IOByteCount getPosition (void); + + /*!@function getByteCount + @abstract return the byte count for this transaction to transfer. + */ + virtual IOByteCount getByteCount (void); + + /*!@function setCommandInUse + @abstract mark the command as being in progress. + */ + virtual void setCommandInUse( bool inUse = true); + + + protected: + + // + /*!@function init + @abstract Zeroes all data, returns false if allocation fails. protected. + */ + virtual bool init(); + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOATABusCommand, 0); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 1); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 2); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 3); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 4); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 5); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 6); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 7); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 8); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 9); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 10); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 11); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 12); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 13); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 14); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 15); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 16); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 17); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 18); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 19); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 20); +}; + +#include + +class IOATABusCommand64 : public IOATABusCommand +{ + + OSDeclareDefaultStructors( IOATABusCommand64 ); + + public: + + // new features + static IOATABusCommand64* allocateCmd32(void); + virtual IODMACommand* GetDMACommand( void ); + + + + // overrides for IODMACommand setup + virtual void zeroCommand(void); + virtual void setBuffer ( IOMemoryDescriptor* inDesc); + virtual void setCommandInUse( bool inUse = true); + virtual void executeCallback(void); + + + protected: + IODMACommand* _dmaCmd; + virtual bool init(); + virtual void free(); +}; + +#endif /*_IOATABUSCOMMAND_H*/ diff --git a/QualcommWireless/include/IOKit/ata/IOATABusInfo.h b/QualcommWireless/include/IOKit/ata/IOATABusInfo.h new file mode 100644 index 0000000..6faec4c --- /dev/null +++ b/QualcommWireless/include/IOKit/ata/IOATABusInfo.h @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOATABUSINFO_H +#define _IOATABUSINFO_H + +#include +#include +#include "IOATATypes.h" + +/*! +@class IOATABusInfo +@discussion used to indicate the capabilities of the bus the device is connected to, PIO and DMA modes supported, etc. +*/ + +class IOATABusInfo : public OSObject +{ + OSDeclareDefaultStructors( IOATABusInfo ); + + public: + + /*!@function atabusinfo + @abstract factory method + */ + static IOATABusInfo* atabusinfo(void); + + /*!@function zeroData + @abstract set this object to a blank state. + */ + virtual void zeroData(void); + + // Used by clients of ATAControllers to find out about the bus + // capability. + + /*!@function getSocketType + @abstract returns the socket type, internal fixed, media-bay, PC-Card + Used by clients of ATAControllers to find out about the bus + */ + ataSocketType getSocketType( void ); + + /*!@function getPIOModes + @abstract returns the bit-significant map of PIO mode(s) supported on the bus. + Used by clients of ATAControllers to find out about the bus. + */ + UInt8 getPIOModes( void ); + + /*!@function getDMAModes + @abstract bit-significant map of DMA mode(s) supported on the bus. + Used by clients of ATAControllers to find out about the bus. + */ + UInt8 getDMAModes( void ); + + /*!@function getUltraModes + @abstract bit-significant map of Ultra mode(s) supported on the bus. + Used by clients of ATAControllers to find out about the bus. + */ + UInt8 getUltraModes( void ); + + /*!@function getUnits + @abstract How many devices are present on bus. + Used by clients of ATAControllers to find out about the bus. + */ + UInt8 getUnits( void ); + + /*!@function supportsDMA + @abstract True = DMA supported on bus - inferred by looking at the DMA mode bits. + Used by clients of ATAControllers to find out about the bus. + */ + bool supportsDMA( void ); + + /*!@function supportsExtendedLBA + @abstract Supports 48-bit LBA if true. + Used by clients of ATAControllers to find out about the bus. + */ + bool supportsExtendedLBA( void ); + + /*!@function maxBlocksExtended + @abstract The maximum number of 512-byte blocks this controller supports + in a single Extended LBA transfer. Some controllers may be limited to less than + the maximum sector count allowed under extended LBA protocol. + */ + UInt16 maxBlocksExtended(void); + + /*!@function supportsOverlapped + @abstract Supports overlapped packet feature set if true. + Used by clients of ATAControllers to find out about the bus. + */ + bool supportsOverlapped( void ); + + /*!@function supportsDMAQueued + @abstract Supports DMA Queued Feature set if true. + Used by clients of ATAControllers to find out about the bus. + */ + bool supportsDMAQueued( void ); + + + // Used by ATAControllers to generate an information object. + // Would not be used by disk device drivers normally. + // Bus controllers should set these items everytime. + + /*!@function setSocketType + @abstract internal fixed, media-bay, PC-Card. Set by ATAControllers. + */ + void setSocketType( ataSocketType inSocketType ); + + /*!@function setPIOModes + @abstract Bit significant map of supported transfer modes. Set by ATAControllers. + */ + void setPIOModes( UInt8 inModeBitMap); + + /*!@function setDMAModes + @abstract Bit significant map of supported transfer modes. Set by ATAControllers. + */ + void setDMAModes( UInt8 inModeBitMap ); + + /*!@function setUltraModes + @abstract Bit significant map of supported transfer modes. Set by ATAControllers. + */ + void setUltraModes( UInt8 inModeBitMap ); + + /*!@function setUnits + @abstract set to indicate how many devices are on this bus. Set by ATAControllers. + */ + void setUnits( UInt8 inNumUnits ); + + // Optional bus protocols some busses may support + /*!@function setExtendedLBA + @abstract Set true for supports 48-bit LBA. Set by ATAControllers. + */ + void setExtendedLBA( bool inState ); + + /*!function setMaxBlocksExtended + @abstract value set by controllers to indicate the maximum number of blocks + allowed in a single transfer of data. Some dma engines may not be capable of supporting the full + 16-bit worth of sector count allowed under 48 bit extended LBA. Default is 256 blocks, same as + standard ATA. + */ + void setMaxBlocksExtended( UInt16 inMaxBlocks); + + /*!@function setOverlapped + @abstract Set true for supports overlapped packet feature set. Set by ATAControllers. + */ + void setOverlapped( bool inState); + + /*!@function setDMAQueued + @abstract Set true if supports DMA Queued Feature. Set by ATAControllers. + */ + void setDMAQueued( bool inState); // + + protected: + + UInt8 _PIOModes; /* PIO modes supported (bit-significant) */ + UInt8 _MultiDMAModes; /* <--: Multiword DMA modes supported (b-sig) */ + UInt8 _UltraDMAModes; /* <--: Ultra DMA modes supported (b-sig) */ + bool _ExtendedLBA; /* <--: Suppports 48-bit LBA protocol */ + bool _Overlapped; /* <--: Supports overlapped packet feature set */ + bool _DMAQueued; /* <--: Supports DMA Queued Feature set */ + ataSocketType _SocketType; /* <--: Indicates bus is fixed internal, removable media-bay, removable PC-Card or unknown type */ + UInt8 _numUnits; /* <--: How many devices on this bus */ + UInt16 _maxBlocksExtended; + + protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool init(); + +private: + OSMetaClassDeclareReservedUnused(IOATABusInfo, 0); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 1); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 2); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 3); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 4); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 5); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 6); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 7); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 8); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 9); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 10); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 11); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 12); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 13); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 14); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 15); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 16); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 17); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 18); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 19); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 20); +}; + + +#endif /* !_IOATABUSINFO_H */ diff --git a/QualcommWireless/include/IOKit/ata/IOATACommand.h b/QualcommWireless/include/IOKit/ata/IOATACommand.h new file mode 100644 index 0000000..773f28a --- /dev/null +++ b/QualcommWireless/include/IOKit/ata/IOATACommand.h @@ -0,0 +1,478 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * + * IOATACommand.h + * + */ + +#ifndef _IOATACOMMAND_H +#define _IOATACOMMAND_H + +#include +#include +#include +#include +#include "IOATATypes.h" + + +class IOExtendedLBA; +class IOATACommand; + + +/*! @typedef IOATACompletionFunction callback function for ATA disk devices. +*/ +typedef void (IOATACompletionFunction)(IOATACommand* command ); + + +/*! +@class IOATACommand + +@discussion +Command structure superclass, created and freed only by IOATADevice objects +populated by disk device drivers with command parameters +then submitted for operation to their IOATADevice provider for execution. + +IOATACommand is a virtual class, a concrete subclass contains the methods and fields needed +by IOATAControllers. Subclasses may be specific to particular controller hardware. +Disk device drivers will only have visibility to this interface and may not subclass this object. +Disk device drivers should instead make use of the void* refcon field which the controllers will not +touch +*/ + +class IOATACommand : public IOCommand { + + OSDeclareAbstractStructors( IOATACommand ); + + public: + + /*!@function zeroCommand + @abstract set to blank state, MUST call prior to re-use of this object + */ + virtual void zeroCommand(void); + + /*!@function setOpcode + @abstract command opcode as defined in IOATATypes. + */ + virtual void setOpcode( ataOpcode inCode); + + /*!@function setFlags + @abstract set the flags for this command, as defined in IOATATypes. + */ + virtual void setFlags( UInt32 inFlags); + + /*!@function setUnit + @abstract set the unit number for this command. + */ + virtual void setUnit( ataUnitID inUnit); + + /*!@function setTimeoutMS + @abstract how long to allow this command to complete, in milliseconds, once issued to + the hardware. if the time period expires, this command will return with a timeout error. + */ + virtual void setTimeoutMS( UInt32 inMs); + + /*!@function setCallbackPtr + @abstract set the function pointer to call when this command completes. + */ + virtual void setCallbackPtr (IOATACompletionFunction* inCompletion); + + /*!@function setRegMask + @abstract used when accessing registers or reading registers on an error result. Mask is defined + in IOATATypes.h + */ + virtual void setRegMask( ataRegMask mask); + + // memory information + // Since ATA hardware is limited in the amount of bytes + // that can be transfered in a command, the disk driver shall supply + // a seperate offset and byte count per transfer. + // the offset may be any amount. The byte count must be a multiple of the + // sector size of the device, ie, N * 512 bytes for ata hard drives. + /*!@function setBuffer + @abstract set the IIOMemoryDescriptor for this transaction. + */ + virtual void setBuffer ( IOMemoryDescriptor* inDesc); + + /*!@function setPosition + @abstract used to set an offset into the memory descriptor for this transfer. + */ + virtual void setPosition (IOByteCount fromPosition); + + /*!@function setByteCount + @abstract set the byte count for this transaction. Should agree with the device command and the + memory descriptor in use. + */ + virtual void setByteCount (IOByteCount numBytes); + + /*!@function setTransferChunkSize + @abstract set the size of transfer between intervening interrupts. necessary when doing PIO Read/Write Multiple, etc. so the controller knows when to expect an interrupt during multi-sector data transfers. + */ + virtual void setTransferChunkSize( IOByteCount chunk = kATADefaultSectorSize); + + /*!@function setFeatures + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setFeatures( UInt8 in); + + /*!@function getErrorReg + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getErrorReg (void ); + + /*!@function setSectorCount + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setSectorCount( UInt8 in); + + /*!@function getSectorCount + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getSectorCount (void ); + + /*!@function setSectorNumber + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setSectorNumber( UInt8 in); + + /*!@function getSectorNumber + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getSectorNumber (void ); + + /*!@function setCylLo + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setCylLo ( UInt8 in); + + /*!@function getCylLo + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getCylLo (void ); + + /*!@function setCylHi + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setCylHi( UInt8 in); + + /*!@function getCylHi + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getCylHi (void ); + + /*!@function setDevice_Head + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setDevice_Head( UInt8 in); + + /*!@function getDevice_Head + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getDevice_Head (void ); + + /*!@function setCommand + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setCommand ( UInt8 in); + + /*!@function getStatus + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getStatus (void ); + + /*!@function setLBA28 + @abstract convenience method that sets the taskfile registers into a 28-bit LBA address, with unit selected and LBA bit set. return err if param out of range, return kIOSuccess (kATANoErr) = 0 on return if successful + */ + virtual IOReturn setLBA28( UInt32 lba, ataUnitID inUnit); + + /*!@function setPacketCommand + @abstract ATAPI command packet max size is 16 bytes. Makes deep copy of data. + */ + virtual IOReturn setPacketCommand( UInt16 packetSizeBytes, UInt8* command); + + // the following registers are only accessed by register access + // commands. Not by normal command dispatch where they are handled + // by the controller. + + // not part of task file params. not written to device when sending commands. + virtual void setDataReg ( UInt16 in); + virtual UInt16 getDataReg (void ); + + // not part of taskfile. Not usually used except by controller. + virtual void setControl ( UInt8 in); + virtual UInt8 getAltStatus (void ); + + // return values + /*!@function getResult + @abstract IOReturn value of the result of this command. ATA family errors are defined in IOATATypes.h + */ + virtual IOReturn getResult (void); + + /*!@function getBuffer + @abstract the IOMemoryDescriptor used in this transaction. + */ + virtual IOMemoryDescriptor* getBuffer ( void ); + + /*!@function getActualTransfer + @abstract The byte count on the ending result, as best as can be determined by the controller. May be zero, but partial transfer may have occurred on error in some cases. + */ + virtual IOByteCount getActualTransfer ( void ); + + /*!@function getEndStatusReg + @abstract the value of the status register on the end of the command. + */ + virtual UInt8 getEndStatusReg (void); // always returned + + /*!@function getEndErrorReg + @abstract If the error bit was set in the status register, the value of the error register is returned at the end of a command. + */ + virtual UInt8 getEndErrorReg( void ); + + /*!@function getCommandInUse + @abstract returns true if IOATAController is still in control of the command. + */ + virtual bool getCommandInUse( void ); // returns true if IOATAController is using the command. + + // for use by disk drivers, clients of IOATADevice only. + // IOATADevice and IOATAControllers shall not use this field in any manner + /*!@var refCon + @abstract for use by disk drivers, clients of IOATADevice only. IOATADevice and IOATAControllers shall not use this field in any manner. + */ + void* refCon; + + /*!@var refCon2 + @abstract for use by disk drivers, clients of IOATADevice only. IOATADevice and IOATAControllers shall not use this field in any manner. + */ + void* refCon2; + + protected: + // < return from ATA controllers to disk drivers + // > sent to ATA controllers from disk drivers + ataOpcode _opCode; // > Command code for the controller. + UInt32 _flags; // > Flags for this command + ataRegisterImage _taskFile; // <> Taskfile + data and control registers. + ATAPICmdPacket _packet; // > ATAPI packet + ataUnitID _unit; // > Unit number + UInt32 _timeoutMS; // > timeout command in ms. + IOMemoryDescriptor* _desc; // > Buffer for data may be nil if command transfer no data + IOByteCount _position; // > Position within the descriptor for this command + IOByteCount _byteCount; // > How many bytes to transfer. + IOByteCount _logicalChunkSize; // > How many bytes between intervening interrupts (R/W Multiple) + ataRegMask _regMask; // > Which registers to write or read for reg access commands + IOATACompletionFunction* _callback; // > if nil, command is synchronous + + IOReturn _result; // < result + IOByteCount _actualByteCount; // < actual bytes transfered. + UInt8 _status; // < Status register at end of command + UInt8 _errReg; // < Error register at end of command if error bit set. + bool _inUse; // < true while IOATAController has possesion of the command + + + virtual bool init(); +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData {IOExtendedLBA* extLBA; }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *fExpansionData; + + // overrides + virtual void free(); + + +private: + OSMetaClassDeclareReservedUsed(IOATACommand, 0); // set end result + OSMetaClassDeclareReservedUsed(IOATACommand, 1); // get extendedLBAPtr + OSMetaClassDeclareReservedUnused(IOATACommand, 2); + OSMetaClassDeclareReservedUnused(IOATACommand, 3); + OSMetaClassDeclareReservedUnused(IOATACommand, 4); + OSMetaClassDeclareReservedUnused(IOATACommand, 5); + OSMetaClassDeclareReservedUnused(IOATACommand, 6); + OSMetaClassDeclareReservedUnused(IOATACommand, 7); + OSMetaClassDeclareReservedUnused(IOATACommand, 8); + OSMetaClassDeclareReservedUnused(IOATACommand, 9); + OSMetaClassDeclareReservedUnused(IOATACommand, 10); + OSMetaClassDeclareReservedUnused(IOATACommand, 11); + OSMetaClassDeclareReservedUnused(IOATACommand, 12); + OSMetaClassDeclareReservedUnused(IOATACommand, 13); + OSMetaClassDeclareReservedUnused(IOATACommand, 14); + OSMetaClassDeclareReservedUnused(IOATACommand, 15); + OSMetaClassDeclareReservedUnused(IOATACommand, 16); + OSMetaClassDeclareReservedUnused(IOATACommand, 17); + OSMetaClassDeclareReservedUnused(IOATACommand, 18); + OSMetaClassDeclareReservedUnused(IOATACommand, 19); + OSMetaClassDeclareReservedUnused(IOATACommand, 20); + +public: + virtual void setEndResult(UInt8 inStatus, UInt8 endError ); + virtual IOExtendedLBA* getExtendedLBA(void); + + +}; + + +/*! +@class IOExtendedLBA + +@discussion +If 48-bit LBAs are supported, IOExtendedLBA is used to represent a 48-bit LBA. +The driver examines the ATA identify data to determine if 48-bit addressing is +supported. +*/ + +class IOExtendedLBA : public OSObject +{ + OSDeclareDefaultStructors( IOExtendedLBA ); + + public: + static IOExtendedLBA* createIOExtendedLBA(IOATACommand* owner); + + // terminology as established in ATA/ATAPI-6. + // for the extended LBA address + + /*!@function setLBALow16 + @abstract convenience method that sets the lower 16 bits of a 48-bit LBA + */ + virtual void setLBALow16( UInt16 lbaLow); + + /*!@function getLBALow16 + @abstract convenience method that gets the lower 16 bits of a 48-bit LBA + */ + virtual UInt16 getLBALow16 (void); + + /*!@function setLBAMid16 + @abstract convenience method that sets the middle 16 bits of a 48-bit LBA + */ + virtual void setLBAMid16 (UInt16 lbaMid); + + /*!@function getLBAMid16 + @abstract convenience method that gets the middle 16 bits of a 48-bit LBA + */ + virtual UInt16 getLBAMid16( void ); + + /*!@function setLBAHigh16 + @abstract convenience method that sets the high 16 bits of a 48-bit LBA + */ + virtual void setLBAHigh16( UInt16 lbaHigh ); + + /*!@function getLBAHigh16 + @abstract convenience method that gets the high 16 bits of a 48-bit LBA + */ + virtual UInt16 getLBAHigh16( void ); + + /*!@function setSectorCount16 + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setSectorCount16( UInt16 sectorCount ); + + /*!@function getSectorCount16 + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt16 getSectorCount16( void ); + + /*!@function setFeatures16 + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setFeatures16( UInt16 features ); + + /*!@function getFeatures16 + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt16 getFeatures16( void ); + + /*!@function setDevice + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setDevice( UInt8 inDevice ); + + /*!@function getDevice + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getDevice( void ); + + /*!@function setCommand + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setCommand( UInt8 inCommand ); + + /*!@function getCommand + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getCommand( void ); + + /*!@function setExtendedLBA + @abstract convenience method that sets the taskfile registers into a 48-bit LBA address, along with sector count, and unit selected and LBA bit set + */ + virtual void setExtendedLBA( UInt32 inLBAHi, UInt32 inLBALo, ataUnitID inUnit, UInt16 extendedCount, UInt8 extendedCommand); + + /*!@function getExtendedLBA + @abstract convenience method that gets a 48-bit LBA + */ + virtual void getExtendedLBA( UInt32* outLBAHi, UInt32* outLBALo ); + + /*!@function zeroData + @abstract convenience method that zeros out the lba, sector count, features, device, and command member variables + */ + virtual void zeroData(void); + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + + protected: + + IOATACommand* owner; + UInt16 lbaLow; + UInt16 lbaMid; + UInt16 lbaHigh; + UInt16 sectorCount; + UInt16 features; + UInt16 device; + UInt16 command; + + private: + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 0); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 1); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 2); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 3); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 4); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 5); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 6); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 7); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 8); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 9); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 10); + + +}; + +#endif diff --git a/QualcommWireless/include/IOKit/ata/IOATAController.h b/QualcommWireless/include/IOKit/ata/IOATAController.h new file mode 100644 index 0000000..3758941 --- /dev/null +++ b/QualcommWireless/include/IOKit/ata/IOATAController.h @@ -0,0 +1,314 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOATACONTROLLER_H +#define _IOATACONTROLLER_H + +#include +#include +#include +#include +#include +#include "ATATimerEventSource.h" + +class IOATADevice; +class IOATABusCommand; +class IOATABusInfo; +class IOATADevConfig; + +/*! @class IOATAController + @abstract The base class for ata controller family. Provides the interface common to all ata bus controllers. + @discussion Subclasses of IOATAController implement drivers for specific bus hardware. Disk devices are clients of + IOATAController and communicate via the IOATABusNub instantiated for each device discovered by the specific IOATAController + subclass when it probes hardware. Via the nub, the ATA Controller provides standard information about bus capability, accepts + requests for transfer mode configuration (timing), accepts requests for IO and bus operations, notifies the device driver about + bus events which may affect the device, such as soft-resets or device removal (ie, media-bay and PC-card) and removal of queued + IO requests which have not been dispatched into the hardware. + + @discussion The header doc for this class is incomplete. The source however is heavily commented and should be consulted until + such time as complete header doc is available. +*/ + + + +class IOATAController : public IOService +{ + OSDeclareDefaultStructors(IOATAController); + +public: + + + /*--- Common ATA Controller Interface ---*/ + // find out bus capability + virtual IOReturn provideBusInfo( IOATABusInfo* infoOut); + + // set and get bus timing configuration for a specific unit + virtual IOReturn selectConfig( IOATADevConfig* configRequest, UInt32 unitNumber); + virtual IOReturn getConfig( IOATADevConfig* configRequest, UInt32 unitNumber); + + // The main call puts something on the work loop + virtual IOReturn executeCommand( IOATADevice* nub, IOATABusCommand* cmd); + + + + /*-- Power Management ---*/ + + // TBD + + + /*--- Overrides from IOService ---*/ + virtual bool init(OSDictionary * properties); + + virtual IOService* probe( IOService* provider, SInt32* score ); + virtual bool start( IOService* provider ); + + +protected: + + enum { + kBusFree = 'free', // bus is available + kBusBusy = 'busy', // bus is busy with request + kQueueOpen = '!lck', // queue is not locked + kQueueLocked = 'LOCK', // queue is frozen and not + kImmediateLocked = '!Imd', // immediate commands may not be processed + kImmediateOK = 'Immd' // immediate commands allowed. + }; + + /* Transaction State indicator definition - indicates what action is next*/ + enum transState { + kATAInitial = 0x00, // in queue + kATAStarted = 0x01, // issue taskfile + kATAPICmd = 0x02, // issue packet + kATADataTx = 0x03, // data transfer phase + kATAStatus = 0x04, // read status + kATAComplete = 0x05, // io complete + kATADone = 0x06 // completion callout called + }; + + struct ataDevInfo { + ataDeviceType type; // ata, atapi, unknown + atapiConfig packetSend; // slow DRQ, IRQ, or fast DRQ for packet + }; + + + struct ataDoubleBuffer + { + IOPhysicalAddress physicalBuffer; + IOLogicalAddress logicalBuffer; + IOByteCount bufferSize; + + }; + + + IOService* _provider; + IOWorkLoop* _workLoop; + IOCommandGate* _cmdGate; + ATATimerEventSource* _timer; + queue_head_t _commandQueue; + IOATABusCommand* _currentCommand; + UInt32 _busState; + UInt32 _queueState; + UInt32 _immediateGate; + ataUnitID _selectedUnit; + ataDevInfo _devInfo[2]; + IOATADevice* _nub[2]; + ataDoubleBuffer _doubleBuffer; + + IOATARegPtr8 _tfFeatureReg; + IOATARegPtr8 _tfSCountReg; + IOATARegPtr8 _tfSectorNReg; + IOATARegPtr8 _tfCylLoReg; + IOATARegPtr8 _tfCylHiReg; + IOATARegPtr8 _tfSDHReg; + IOATARegPtr8 _tfStatusCmdReg; + IOATARegPtr16 _tfDataReg; + IOATARegPtr8 _tfAltSDevCReg; + + + // false if couldn't allocate the per-bus double buffer. + // controllers should provide implementation where needed + // for DMA hardware compatibility. The default method provides + // a 4K buffer for PIO since MemoryDescriptors do not by default have + // logical addresses in the kernel space. + virtual bool allocateDoubleBuffer( void ); + + // perform 2-byte endian swap. Only useful on PIO transfers and identify data + virtual void swapBytes16( UInt8* dataBuffer, IOByteCount length); + +/*! @function handleCommand + @abstract Called by executeCommand() to handle the client command + from the workloop context. + @param command The command code. + @param param1 Command parameter. + @param param2 Command parameter. + @param param3 Command parameter. + @result kIOReturnSuccess on success, or an error code otherwise. */ + + virtual IOReturn handleCommand( void * command, + void * param1 = 0, + void * param2 = 0, + void * param3 = 0); + + +/*! @function busCanDispatch + @abstract answers whether the bus is in state such that the next command + can be dispatched. + @result true - bus is free to issue commands. false - bus cannot issue + commands at this time. */ + virtual bool busCanDispatch( void ); + + +/*! @function dispatchNext + @abstract Causes the command at the front of the queue to dequeue, made the + current command and begin execution. + @result noErr indicates successful dispatch. */ + virtual IOReturn dispatchNext( void ); + + // sets the result code, free's the bus state, dispatch next command and execute completion + virtual void completeIO( IOReturn commandResult ); + + // Command queue handlers. + virtual IOReturn enqueueCommand( IOATABusCommand* command); + virtual IOATABusCommand* dequeueFirstCommand( void ); + + // event notifier for clients + virtual void executeEventCallouts( ataEventCode event, ataUnitID unit); + + // default handler for device interrupts. + virtual IOReturn handleDeviceInterrupt( void ); + + + // timer functions + // starts the timeout on the current command + virtual IOReturn startTimer( UInt32 inMS); + //disable and clear a running timer. + virtual void stopTimer( void ); + // called when a timeout occurs. + virtual void handleTimeout( void ); + // true if the timer has expired + virtual bool checkTimeout( void ); + + // handle IO opcodes + virtual IOReturn handleExecIO( void ); + virtual IOReturn handleRegAccess( void ); + virtual IOReturn handleBusReset(void); + virtual IOReturn handleQueueFlush( void ); + + // various protocol phases + virtual IOReturn asyncData(void); + virtual IOReturn asyncStatus(void); + virtual IOReturn asyncIO(void); + virtual IOReturn asyncCommand(void); + virtual IOReturn synchronousIO(void); + + // hardware access + virtual IOReturn selectDevice( ataUnitID unit ); + virtual IOReturn issueCommand( void ); + virtual IOReturn writePacket( void ); + virtual IOReturn softResetBus( bool doATAPI = false ); + + virtual IOReturn startDMA( void ); + virtual IOReturn stopDMA( void ); + + virtual bool ATAPISlaveExists( void ); + virtual UInt32 scanForDrives( void ); + + virtual bool waitForU8Status (UInt8 mask, UInt8 value); + + virtual IOByteCount readATAPIByteCount( void ); + virtual void handleOverrun( IOByteCount length); + virtual IOReturn registerAccess(bool isWrite); + + // PIO data transfers + virtual IOReturn txDataIn (IOLogicalAddress buf, IOByteCount length); + virtual IOReturn txDataOut (IOLogicalAddress buf, IOByteCount length); + + virtual IOATAController::transState determineATAPIState(void); + + // device should set the controller to the config for this device + virtual void selectIOTiming( ataUnitID unit ); + + // subclasses MUST implement this function in order to initialize + // the pointers to the ATA task file registers during start() time. + virtual bool configureTFPointers(void); + + // convert a bit-significant indicator to a numeric value. + virtual UInt16 bitSigToNumeric( UInt16 binary); + + // for 48 bit register reading and writing + UInt16 readExtRegister( IOATARegPtr8 inRegister ); + void writeExtRegister( IOATARegPtr8 inRegister, UInt16 inValue ); + + // overrides + virtual void free(); + +private: + + // used called by the commandgate in executeCommand. + static void executeCommandAction(OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3); + + // callout used by the timer to indicate the timeout failure. + static void timeoutOccured( OSObject *owner, + IOTimerEventSource *sender); + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOATAController in the future. + */ + typedef struct ExpansionData + { + IOBufferMemoryDescriptor* _doubleBufferDesc; + } ExpansionData; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOATAController, 0); + OSMetaClassDeclareReservedUnused(IOATAController, 1); + OSMetaClassDeclareReservedUnused(IOATAController, 2); + OSMetaClassDeclareReservedUnused(IOATAController, 3); + OSMetaClassDeclareReservedUnused(IOATAController, 4); + OSMetaClassDeclareReservedUnused(IOATAController, 5); + OSMetaClassDeclareReservedUnused(IOATAController, 6); + OSMetaClassDeclareReservedUnused(IOATAController, 7); + OSMetaClassDeclareReservedUnused(IOATAController, 8); + OSMetaClassDeclareReservedUnused(IOATAController, 9); + OSMetaClassDeclareReservedUnused(IOATAController, 10); + OSMetaClassDeclareReservedUnused(IOATAController, 11); + OSMetaClassDeclareReservedUnused(IOATAController, 12); + OSMetaClassDeclareReservedUnused(IOATAController, 13); + OSMetaClassDeclareReservedUnused(IOATAController, 14); + OSMetaClassDeclareReservedUnused(IOATAController, 15); + OSMetaClassDeclareReservedUnused(IOATAController, 16); + OSMetaClassDeclareReservedUnused(IOATAController, 17); + OSMetaClassDeclareReservedUnused(IOATAController, 18); + OSMetaClassDeclareReservedUnused(IOATAController, 19); + OSMetaClassDeclareReservedUnused(IOATAController, 20); +}; +#endif /* !_IOATACONTROLLER_H */ diff --git a/QualcommWireless/include/IOKit/ata/IOATADevConfig.h b/QualcommWireless/include/IOKit/ata/IOATADevConfig.h new file mode 100644 index 0000000..e5714c3 --- /dev/null +++ b/QualcommWireless/include/IOKit/ata/IOATADevConfig.h @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOATADEVCONFIG_H +#define _IOATADEVCONFIG_H + +#include +#include +#include "IOATATypes.h" +#include "IOATABusInfo.h" + + +/*! + @class IOATADevConfig + @abstract used for configuring and communicating the desired transfer modes of a device. + A disk driver would typically use this object in conjunction with the 512-bytes of identification + data from the drive and the IOATABusInfo object for the bus it is connected to. + This object will determine the best matching transfer speeds available. + the device driver will then send a series of Set Features commands to configure the drive + and this object to the bus through the IOATADevice nub in order to configure the optimum transfer mode. + The driver for the disk drive may choose to populate this object with whatever transfer mode + desired, in the event that a different mode is required. + @discussion usually use the initWithBestSelection to make a best mode match. + The Mode accessors use bit significance to indicate a selected mode or supported modes(s) + ie, 00000001b indicates Mode-0, 00000010b indicates mode 1, etc. + Selected mode is indicated by a single set bit. No bit set indicates no mode in that class is selected. + ie, a bus will support multiple possible modes, but will only have one mode selected at that time. + +*/ + +class IOATADevConfig : public OSObject { + + OSDeclareDefaultStructors( IOATADevConfig ); + + public: + + /*!@function atadevconfig + @abstract static creator function. + */ + static IOATADevConfig* atadevconfig(void); + + /*!@function initWithBestSelection + @abstract Handy initializer: pass the 512-byte result of the Identify Device or + Identify Packet Device in endian-order for your platform (byte-swapped on PPC) + and the IOATABusInfo object for the bus. The object will initialize all fields + and select the best transfer modes that match on bus and device. + If the return value was 0 (success or noErr), then a matching mode is supported. + Examine the PIO and UDMA/DMA fields and to generate the apropriate SET FEATURES + parameters for your drive and send this initialised object to the IOATAController + when requesting a speed configuration. + failure means no supported transfer modes matched between bus and device info. + + @param identifyData 512 bytes of data obtained from the device via IDENTIFY DEVICE or IDENTIFY PACKET DEVICE command. + @param busInfo pointer to an IOATAbusInfo object obtained from a previous atanub->provideBusInfo() call. + @result kIOSuccess (0) when a matching transfer mode is available between the device and controller. + */ + IOReturn initWithBestSelection( const UInt16* identifyData, IOATABusInfo* busInfo); + + // intitialize with the 512 byte data from an ATA device identify command + IOReturn assignFromData( const UInt16* identifyData ); + + /*!@function setPacketConfig + @param packetConfig + @abstract For ATAPI devices, if the device asserts interrupt after the Packet Command when it is ready to accept the packet, set this value to true (mostly older devices). If the device accepts the packet only by asserting DRQ bit in status, then set this value false. Tells the bus controller whether to wait for packet acceptance or set pending interrupt. + */ + void setPacketConfig ( atapiConfig packetConfig); + + /*!@function getPacketConfig + @result atapiConfig as defined in IOATATypes.h + */ + atapiConfig getPacketConfig( void ); + + // The following Mode accessors use bit significance to indicate a selected mode or supported modes(s) + // ie, 00000001b indicates Mode-0, 00000010b indicates mode 1, etc. + // Selected mode is indicated by a single set bit. No bit set indicates no mode in that class is selected. + // ie, a bus will support multiple possible modes, but will only have one mode selected at that time. + + /*!@function setPIOMode + @param inModeBitMap bit-significant map of PIO mode + */ + void setPIOMode( UInt8 inModeBitMap); // bit-significant map of PIO mode(s) + + /*!@function getPIOMode + @result bit-significant map of PIO mode + */ + UInt8 getPIOMode( void ); + + /*!@function setDMAMode + @param inModeBitMap bit-significant map of DMA mode + */ + void setDMAMode( UInt8 inModeBitMap ); // bit-significant map of DMA mode(s) + + /*!@function getDMAMode + @result bit-significant map of DMA mode + */ + UInt8 getDMAMode( void ); + + /*!@function setUltraMode + @param inModeBitMap bit-significant map of Ultra mode + */ + void setUltraMode( UInt8 inModeBitMap ); // bit-significant map of Ultra mode(s) + + /*!@function getUltraMode + @result bit-significant map of Ultra mode + */ + UInt8 getUltraMode( void ); + + // The following cycle time accessors report cycle times in nanoseconds. + // A device requesting a mode should also request a cycle time as reported in the device's identification page. + // A bus controller will configure the bus not to exceed (go faster than) the minimum time requested. + // When a bus controller reports a mode configuration, the cycle time indicates the busses contract not to go + // faster than. However an actual cycle time may be slower than the indicated time. + /*!@function setPIOCycleTime + @param inNS PIO cycle time in nanoseconds. + */ + void setPIOCycleTime( UInt16 inNS ); + + /*!@function getPIOCycleTime + @result reported PIO CycleTime in nanoseconds. + */ + UInt16 getPIOCycleTime( void ); + + /*!@function setDMACycleTime + @param inNS reported multiword DMA Cycle time in nanoseconds. + */ + void setDMACycleTime( UInt16 inNS ); + + /*!@function getDMACycleTime + @result Reported multiword DMA cycle time in nanoseconds. + */ + UInt16 getDMACycleTime( void ); + + // Ultra ATA defines cycle times a device must meet to comply with standards. + // No cycle time field is needed. + + // convert bit-significant to numeric value + /*!@function bitSigToNumeric + @abstract converts a bit-significant field to a numerical value. Note that a bit field of 0x00 has no defined result. + @param binary the bit significant field. + @result the numerical value of the highest bit set in the field. + */ + virtual UInt8 bitSigToNumeric( UInt16 binary); + + + protected: + + atapiConfig _atapiIRQForPacket; // enum for bits 5 and 6 of word zero of + // the identify packet device info data for PACKET devices ONLY. + // shift word-0 5-bits left, mask 0x03 and these enums apply. + // values are: + + // kATAPIDRQSlow = 0x00 - wait up to 3MS for packet on DRQ + // kATAPIIRQPacket = 0x01, - device asserts IRQ for packet + // kATAPIDRQFast = 0x10, - packet on DRQ within 50us + // kATAPIUnknown = 0x11 - reserved as of ATA/ATAPI-5 + + + + + UInt8 _ataPIOMode; /* <->: PIO Mode Timing class bit-significant */ + UInt16 _ataPIOCycleTime; /* <->: Cycle time in ns for PIO mode */ + UInt8 _ataMultiDMAMode; /* <->: Multiple Word DMA Timing Class bit-significant*/ + UInt16 _ataMultiCycleTime; /* <->: Cycle time in ns for Multiword DMA mode */ + UInt8 _ataUltraDMAMode; /* <->: Ultra DMA timing class bit-significant */ + + IOReturn _AssignPIOData( const UInt16* identifyData); + IOReturn _AssignDMAData(const UInt16* identifyData); + IOReturn _AssignUltraData(const UInt16* identifyData); + UInt8 _MostSignificantBit( UInt8 inByte); + + + virtual bool init(); +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOATADevConfig, 0); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 1); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 2); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 3); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 4); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 5); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 6); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 7); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 8); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 9); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 10); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 11); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 12); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 13); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 14); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 15); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 16); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 17); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 18); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 19); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 20); + +public: + +//some static utility functions to parse the identify data for feature support + + static bool sDriveSupports48BitLBA( const UInt16* identifyData ); + static UInt32 sDriveExtendedLBASize( UInt32* lbaHi, UInt32* lbaLo, const UInt16* identifyData); // result returned is same as lbaLo. + +}; + + +// header doc info goes here. I find putting it within the delcarations more confusing than putting it all in the bottom of the header. + + +#endif /* !_IOATADEVCONFIG_H */ diff --git a/QualcommWireless/include/IOKit/ata/IOATADevice.h b/QualcommWireless/include/IOKit/ata/IOATADevice.h new file mode 100644 index 0000000..78be513 --- /dev/null +++ b/QualcommWireless/include/IOKit/ata/IOATADevice.h @@ -0,0 +1,179 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOATADevice.h + * + * This object implements a relay to an ATA Bus where a drive is attached. + */ + + +#ifndef _IOATADEVICE_H +#define _IOATADEVICE_H + +#include +#include +#include "IOATATypes.h" +#include "IOATACommand.h" +#include "IOATABusInfo.h" +#include "IOATADevConfig.h" + +class IOATAController; + + +/*! + @class IOATADevice + @abstract This object implements a relay to an ATA Bus where a drive is attached. + @discussion IOATADevice is the superclass which represents a particular device attached to a particular IOATAController (bus). IOATADevice is the provider for ATA mass-storage device drivers.IOATADevice is the factory for all IOATACommand objects and is responsible for creating and freeing IOATACommands. IOATAControllers will create an instance of IOATADevice for each device physically connected to the ata bus. IOATADevice is virtual and specific subclass should be implemented for particular types of IOATAController. In this manner, controller-specifc IOATACommands may be paired with the proper type of controller. +*/ + +class IOATADevice : public IOService +{ + OSDeclareDefaultStructors(IOATADevice); + +public: + + // + /*!@function getUnitID + @abstract Determine whether this device is number 0 or 1 (ie, master/slave) + @result ataUnitID - 0 or 1. + */ + virtual ataUnitID getUnitID( void ); + + // + /*!@function getDeviceType + @abstract Find out what kind of device this nub is (ata or atapi) + @result ataDeviceType as defined in IOATATypes.h + */ + virtual ataDeviceType getDeviceType( void ); + + // + /*!@function provideBusInfo + @abstract Find out the bus capability so the client can choose the features to set and commands to run. + @param getInfo a pointer to a valid IOATABusInfo object. + @result kIOSuccess (0) and the getInfo object will be filled out by the bus controller with information about the bus. + */ + virtual IOReturn provideBusInfo( IOATABusInfo* getInfo); + + // + /*!@function selectConfig + @abstract Tell the bus what speed to use for your device. + @param configRequest pointer to a valid and initialized IOATADevConfig object. + @result kIOSuccess (0) if the configuration was succesfully selected. + @discussion This should only be called once during a disk drivers start method before registering its availability, and must be called prior to issuing any data IO transactions. + */ + virtual IOReturn selectConfig( IOATADevConfig* configRequest); + + // + /*!@function provideConfig + @abstract Find out what speed the bus has configured for this unit. + @param configRequest pointer to a valid IOATADevConfig object. + @result kIOSuccess (0) on successful completion and configRequest will contain the configuration information. + */ + virtual IOReturn provideConfig( IOATADevConfig* configRequest); + + // Submit IO requests + /*! + @function executeCommand + @abstract Submit IO requests + @param command pointer to a valid IOATACommand with the command to be executed. + @result kIOSuccess (0) if the command was successfully queued in the controller. + */ + virtual IOReturn executeCommand(IOATACommand* command); + + // create and destroy IOATACommands + /*! + @function allocCommand + @abstract create IOATACommands. Device drivers should allocate command objects only through this method. + @result null if allocation failed. Retain count is one. + */ + virtual IOATACommand* allocCommand( void ); + + /*! + @function freeCommand + @abstract release a command object that is no longer needed. Do not free an object in use and do not release the object anymore times than you have retained it. + @param inCommand the command to be released. + */ + virtual void freeCommand( IOATACommand* inCommand); + + // matching stuff for IOBSDInit and so on. + /*!@function matchPropertyTable + @abstract matching stuff for IOBSDInit and so on. + */ + virtual bool matchPropertyTable(OSDictionary * table); + + /*!@function matchLocation + @abstract matching stuff for IOBSDInit and so on. + */ + virtual IOService* matchLocation(IOService * client); + + /*!@function matchPropertyTable + @abstract matching stuff for IOBSDInit and so on. + */ + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + // called by controllers when they need to send a message to client drivers. + /*! + @function notifyEvent + @abstract called by controllers when they need to send a message to client (disk) drivers. + */ + virtual void notifyEvent( UInt32 event ); + + +protected: + IOATAController* _provider; + ataUnitID _unitNumber; // 0 - master, 1 - slave, -1 = not Valid + ataDeviceType _deviceType; // ata, atapi, unknown +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOATADevice, 0); + OSMetaClassDeclareReservedUnused(IOATADevice, 1); + OSMetaClassDeclareReservedUnused(IOATADevice, 2); + OSMetaClassDeclareReservedUnused(IOATADevice, 3); + OSMetaClassDeclareReservedUnused(IOATADevice, 4); + OSMetaClassDeclareReservedUnused(IOATADevice, 5); + OSMetaClassDeclareReservedUnused(IOATADevice, 6); + OSMetaClassDeclareReservedUnused(IOATADevice, 7); + OSMetaClassDeclareReservedUnused(IOATADevice, 8); + OSMetaClassDeclareReservedUnused(IOATADevice, 9); + OSMetaClassDeclareReservedUnused(IOATADevice, 10); + OSMetaClassDeclareReservedUnused(IOATADevice, 11); + OSMetaClassDeclareReservedUnused(IOATADevice, 12); + OSMetaClassDeclareReservedUnused(IOATADevice, 13); + OSMetaClassDeclareReservedUnused(IOATADevice, 14); + OSMetaClassDeclareReservedUnused(IOATADevice, 15); + OSMetaClassDeclareReservedUnused(IOATADevice, 16); + OSMetaClassDeclareReservedUnused(IOATADevice, 17); + OSMetaClassDeclareReservedUnused(IOATADevice, 18); + OSMetaClassDeclareReservedUnused(IOATADevice, 19); + OSMetaClassDeclareReservedUnused(IOATADevice, 20); +}; + +#endif /* !_IOATABUSNUB_H */ diff --git a/QualcommWireless/include/IOKit/ata/IOATARegI386.h b/QualcommWireless/include/IOKit/ata/IOATARegI386.h new file mode 100644 index 0000000..73016ba --- /dev/null +++ b/QualcommWireless/include/IOKit/ata/IOATARegI386.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOATAREGI386_H +#define _IOATAREGI386_H + +#include + +/* + * IOATAReg: ATA register abstract base class. + */ +#define DefineIOATAReg(w) \ +class IOATAReg##w : public OSObject \ +{ \ + OSDeclareAbstractStructors( IOATAReg##w ) \ + \ +public: \ + virtual void operator = (UInt##w rhs) = 0; \ + virtual operator UInt##w() const = 0; \ +} + +DefineIOATAReg( 8 ); +DefineIOATAReg( 16 ); +DefineIOATAReg( 32 ); + +typedef IOATAReg8 * IOATARegPtr8; +typedef IOATAReg16 * IOATARegPtr16; +typedef IOATAReg32 * IOATARegPtr32; + +#define IOATARegPtr8Cast(x) (x) + +/* + * IOATAIOReg: I/O mapped ATA registers. + */ +#define DefineIOATAIOReg(w) \ +class IOATAIOReg##w : public IOATAReg##w \ +{ \ + OSDeclareDefaultStructors( IOATAIOReg##w ) \ + \ +protected: \ + UInt16 _address; \ + \ +public: \ + static IOATAIOReg##w * withAddress( UInt16 address ); \ + \ + virtual bool initWithAddress( UInt16 address ); \ + virtual UInt16 getAddress() const; \ + \ + virtual void operator = (UInt##w rhs); \ + virtual operator UInt##w() const; \ +} + +DefineIOATAIOReg( 8 ); +DefineIOATAIOReg( 16 ); +DefineIOATAIOReg( 32 ); + +#endif /* !_IOATAREGI386_H */ diff --git a/QualcommWireless/include/IOKit/ata/IOATATypes.h b/QualcommWireless/include/IOKit/ata/IOATATypes.h new file mode 100644 index 0000000..a3be9dc --- /dev/null +++ b/QualcommWireless/include/IOKit/ata/IOATATypes.h @@ -0,0 +1,393 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOATATYPES_H +#define _IOATATYPES_H + +#include + + +/*! + +@header IOATAtypes.h +@discussion contains various definitions and constants for use in the IOATAFamily and clients. Header Doc is incomplete at this point, but file is heavily commented. + +*/ +// property strings +#define kATADevPropertyKey "ata device type" +#define kATATypeATAString "ata" +#define kATATypeATAPIString "atapi" +#define kATATypeUnknownString "unknown" + +#define kATAVendorPropertyKey "device model" +#define kATARevisionPropertyKey "device revision" +#define kATASerialNumPropertyKey "device serial" + +#define kATAUnitNumberKey "unit number" + +#define kATASocketKey "socket type" +#define kATAInternalSocketString "internal" +#define kATAMediaBaySocketString "media-bay" +#define kATAPCCardSocketString "pccard" +#define kATAInternalSATAString "serial-ata" +#define kATASATABayString "sata-bay" +#define kATAInternalSATA2 "serial-ata-2" +#define kATASATA2BayString "sata-2-bay" +#define kATAUnkownSocketString "unknown" + +#define kATANotifyOnChangeKey "media-notify" + +// allows for porting to non-memory-mapped IO systems, such as x86. +// for such a platform, create a class and overload the assignment operators +// so that the correct IO operation is performed and define the type for that architecture port. +#ifdef __ppc__ +#define IOATARegPtr8 volatile UInt8* +#define IOATARegPtr16 volatile UInt16* +#define IOATARegPtr32 volatile UInt32* +#define IOATARegPtr8Cast(x) ((IOATARegPtr8)(x)) +#elif defined( __i386__ ) || defined( __x86_64__ ) +#include +#else +#error Unknown machine architecture +#endif + +enum ataSocketType{ + + kUnknownSocket = 0, + kInternalATASocket, + kMediaBaySocket , + kPCCardSocket, + kInternalSATA, + kSATABay, + kInternalSATA2, + kSATA2Bay + +} ; + + +enum ataDeviceType { + + kUnknownATADeviceType = 0, + kATADeviceType, + kATAPIDeviceType + +} ; + +// enum for bits 5 and 6 of word zero of +// the identify packet device info data. +// shift word-0 5-bits left, mask 0x03 and these enums apply. +enum atapiConfig { + + kATAPIDRQSlow = 0x00, + kATAPIIRQPacket = 0x01, + kATAPIDRQFast = 0x10, + kATAPIUnknown = 0x11 + +}; + + +enum ataUnitID { + + kATAInvalidDeviceID = -1, + kATADevice0DeviceID = 0, /* aka, Master. Device 0 is the correct terminology */ + kATADevice1DeviceID = 1 /* aka, Slave. Device 1 is the correct terminology */ + +} ; + +enum { + + kATADefaultSectorSize = 512 +}; + +/* Task file definition *** Error Register *** */ +enum { + bATABadBlock = 7, /* bit number of bad block error bit*/ + bATAUncorrectable = 6, /* bit number of uncorrectable error bit*/ + bATAMediaChanged = 5, /* bit number of media changed indicator*/ + bATAIDNotFound = 4, /* bit number of ID not found error bit*/ + bATAMediaChangeReq = 3, /* bit number of media changed request*/ + bATACommandAborted = 2, /* bit number of command abort bit*/ + bATATrack0NotFound = 1, /* bit number of track not found*/ + bATAAddressNotFound = 0, /* bit number of address mark not found*/ + mATABadBlock = 1 << bATABadBlock, /* Bad Block Detected*/ + mATAUncorrectable = 1 << bATAUncorrectable, /* Uncorrectable Data Error*/ + mATAMediaChanged = 1 << bATAMediaChanged, /* Media Changed Indicator (for removable)*/ + mATAIDNotFound = 1 << bATAIDNotFound, /* ID Not Found*/ + mATAMediaChangeReq = 1 << bATAMediaChangeReq, /* Media Change Requested (NOT IMPLEMENTED)*/ + mATACommandAborted = 1 << bATACommandAborted, /* Aborted Command*/ + mATATrack0NotFound = 1 << bATATrack0NotFound, /* Track 0 Not Found*/ + mATAAddressNotFound = 1 << bATAAddressNotFound /* Address Mark Not Found*/ +}; + +/* Task file definition *** Features register *** */ +enum { + bATAPIuseDMA = 0, /* bit number of useDMA bit (ATAPI)*/ + mATAPIuseDMA = 1 << bATAPIuseDMA +}; + +/* Task file definition *** ataTFSDH Register *** */ +enum { + mATAHeadNumber = 0x0F, /* Head Number (bits 0-3) */ + mATASectorSize = 0xA0, /* bit 7=1; bit 5 = 01 (512 sector size) */ + mATADriveSelect = 0x10, /* Drive (0 = master, 1 = slave) */ + mATALBASelect = 0x40 /* LBA mode bit (0 = chs, 1 = LBA)*/ +}; + +/* Task file definition *** Status Register *** */ +enum { + bATABusy = 7, /* bit number of BSY bit*/ + bATADriveReady = 6, /* bit number of drive ready bit*/ + bATAWriteFault = 5, /* bit number of write fault bit*/ + bATASeekComplete = 4, /* bit number of seek complete bit*/ + bATADataRequest = 3, /* bit number of data request bit*/ + bATADataCorrected = 2, /* bit number of data corrected bit*/ + bATAIndex = 1, /* bit number of index mark*/ + bATAError = 0, /* bit number of error bit*/ + mATABusy = 1 << bATABusy, /* Unit is busy*/ + mATADriveReady = 1 << bATADriveReady, /* Unit is ready*/ + mATAWriteFault = 1 << bATAWriteFault, /* Unit has a write fault condition*/ + mATASeekComplete = 1 << bATASeekComplete, /* Unit seek complete*/ + mATADataRequest = 1 << bATADataRequest, /* Unit data request*/ + mATADataCorrected = 1 << bATADataCorrected, /* Data corrected*/ + mATAIndex = 1 << bATAIndex, /* Index mark - NOT USED*/ + mATAError = 1 << bATAError /* Error condition - see error register*/ +}; + +/* Task file definition *** Device Control Register *** */ +enum { + bATADCROne = 3, /* bit number of always one bit*/ + bATADCRReset = 2, /* bit number of reset bit*/ + bATADCRnIntEnable = 1, /* bit number of interrupt disable*/ + mATADCROne = 1 << bATADCROne, /* always one bit*/ + mATADCRReset = 1 << bATADCRReset, /* Reset (1 = reset)*/ + mATADCRnIntEnable = 1 << bATADCRnIntEnable /* Interrupt Disable(0 = enabled)*/ +}; + + +/* 'ataRegMask' field of the ataRegAccess definition*/ +enum ataRegMask{ + + bATAAltSDevCValid = 14, /* bit number of alternate status/device cntrl valid bit*/ + bATAStatusCmdValid = 7, /* bit number of status/command valid bit*/ + bATASDHValid = 6, /* bit number of ataTFSDH valid bit*/ + bATACylinderHiValid = 5, /* bit number of cylinder high valid bit*/ + bATACylinderLoValid = 4, /* bit number of cylinder low valid bit*/ + bATASectorNumValid = 3, /* bit number of sector number valid bit*/ + bATASectorCntValid = 2, /* bit number of sector count valid bit*/ + bATAErrFeaturesValid = 1, /* bit number of error/features valid bit*/ + bATADataValid = 0, /* bit number of data valid bit*/ + mATAAltSDevCValid = 1 << bATAAltSDevCValid, /* alternate status/device control valid*/ + mATAStatusCmdValid = 1 << bATAStatusCmdValid, /* status/command valid*/ + mATASDHValid = 1 << bATASDHValid, /* ataTFSDH valid*/ + mATACylinderHiValid = 1 << bATACylinderHiValid, /* cylinder high valid*/ + mATACylinderLoValid = 1 << bATACylinderLoValid, /* cylinder low valid*/ + mATASectorNumValid = 1 << bATASectorNumValid, /* sector number valid*/ + mATASectorCntValid = 1 << bATASectorCntValid, /* sector count valid*/ + mATAErrFeaturesValid = 1 << bATAErrFeaturesValid, /* error/features valid*/ + mATADataValid = 1 << bATADataValid /* data valid*/ + +} ; + + +enum ataFlags{ + bATAFlagQuiesce = 20, + bATAFlagNoIRQ = 19, /* bit Number of no IRQ protocol flag*/ + bATAFlag48BitLBA = 18, + bATAFlagDMAQueued = 17, + bATAFlagOverlapped = 16, + bATAFlagUseConfigSpeed = 15, /* bit number of use configured speed flag*/ + bATAFlagByteSwap = 14, /* bit number of byte swap flag*/ + bATAFlagIORead = 13, /* bit number of I/O read flag*/ + bATAFlagIOWrite = 12, /* bit number of I/O write flag*/ + bATAFlagTFAccessResult = 8, /* bit number of get register results on command completion.*/ + bATAFlagUseDMA = 7, /* bit number of use DMA flag*/ + bATAFlagProtocolATAPI = 5, /* bit number of ATAPI protocol*/ + bATAFlagImmediate = 1, /* bit number of immediate flag */ + bATAFlagTFAccess = 0, /* bit number of TF access */ + + mATAFlagQuiesce = 1 << bATAFlagQuiesce, + mATAFlagUseNoIRQ = 1 << bATAFlagNoIRQ, /* Special purpose! Avoid using! No-IRQ, polled synchronous protocol valid only for PIO commands*/ + mATAFlag48BitLBA = 1 << bATAFlag48BitLBA, /* Use 48 bit extended LBA protocol on this command. Requires support from the controller.*/ + mATAFlagDMAQueued = 1 << bATAFlagDMAQueued, /* Use tagged dma queuing protocol on this command. Requires support from the controller.*/ + mATAFlagOverlapped = 1 << bATAFlagOverlapped, /* Use overllaped protocol on this command. Requires support from the controller.*/ + mATAFlagUseConfigSpeed = 1 << bATAFlagUseConfigSpeed, /* Use the configured interface speed = true. False = use default PIO (slow) speed. valid only for PIO commands*/ + mATAFlagByteSwap = 1 << bATAFlagByteSwap, /* Swap data bytes (read - after; write - before)*/ + mATAFlagIORead = 1 << bATAFlagIORead, /* Read (in) operation*/ + mATAFlagIOWrite = 1 << bATAFlagIOWrite, /* Write (out) operation*/ + mATAFlagTFAccessResult = 1 << bATAFlagTFAccessResult, /* get contents of TaskFile registers indicated in TFMask on command completion, even if no error*/ + mATAFlagUseDMA = 1 << bATAFlagUseDMA, + mATAFlagProtocolATAPI = 1 << bATAFlagProtocolATAPI, /* ATAPI protocol indicator*/ + mATAFlagImmediate = 1 << bATAFlagImmediate, /* Put command at head of queue */ + mATAFlagTFAccess = 1 << bATAFlagTFAccess, /* Return Taskfile on error status*/ + +} ; + +/* The Function codes sent to controllers*/ +enum ataOpcode { + + kATANoOp = 0, + kATAFnExecIO , /* Execute ATA I/O */ + kATAPIFnExecIO, /* ATAPI I/O */ + kATAFnRegAccess , /* Register Access */ + + kATAFnQFlush , /* I/O Queue flush requests for your unit number */ + kATAFnBusReset /* Reset ATA bus */ + +} ; + + +/* The ATA Event codes */ +/* sent when calling the device driver's event handler*/ +enum ataEventCode { + kATANullEvent = 0x00, /* Just kidding -- nothing happened*/ + kATAOnlineEvent = 0x01, /* An ATA device has come online*/ + kATAOfflineEvent = 0x02, /* An ATA device has gone offline*/ + kATARemovedEvent = 0x03, /* An ATA device has been removed from the bus*/ + kATAResetEvent = 0x04, /* Someone gave a hard reset to the drive*/ + kATAOfflineRequest = 0x05, /* Someone requesting to offline the drive*/ + kATAEjectRequest = 0x06, /* Someone requesting to eject the drive*/ + kATAPIResetEvent = 0x07, /* Someone gave a ATAPI reset to the drive*/ + kATAReservedEvent = 0x80 /* RESERVED*/ +}; + + +// These need to be combined with a new enumeration of the current ATA/ATAPI command set. +// Some opcodes are of interest to ATA controllers, since they imply special protocols +// or handling. Device Reset, Execute Device Diagnostics have subtle side effects that +// controllers need to be aware of, so we snoop for those commands being issued. +// the rest are here for informational purposes. + +// BUG make new enum for all current ATA commands. + +enum { + kSOFTRESET = 0x008, // ATAPI Soft Reset command + kPACKET = 0x0A0, // ATAPI Packet command + kID_DRIVE = 0x0A1 // ATAPI Identify drive command +}; +/* ATA Command Opcode definition*/ +enum { + kATAcmdWORetry = 0x01, /* Without I/O retry option*/ + kATAcmdNOP = 0x0000, /* NOP operation - media detect*/ + kATAcmdRecal = 0x0010, /* Recalibrate command */ + kATAcmdRead = 0x0020, /* Read command */ + kATAcmdReadLong = 0x0022, /* Read Long command*/ + kATAcmdReadExtended = 0x0024, /* Read Extended (with retries)*/ + kATAcmdReadDMAExtended = 0x0025, /* Read DMA Extended (with retries)*/ + kATAcmdWrite = 0x0030, /* Write command */ + kATAcmdWriteLong = 0x0032, /* Write Long*/ + kATAcmdWriteExtended = 0x0034, /* Write Extended (with retries)*/ + kATAcmdWriteDMAExtended = 0x0035, /* Write DMA Extended (with retries)*/ + kATAcmdWriteVerify = 0x003C, /* Write verify*/ + kATAcmdReadVerify = 0x0040, /* Read Verify command */ + kATAcmdFormatTrack = 0x0050, /* Format Track command */ + kATAcmdSeek = 0x0070, /* Seek command */ + kATAcmdDiagnostic = 0x0090, /* Drive Diagnostic command */ + kATAcmdInitDrive = 0x0091, /* Init drive parameters command */ + kATAcmdReadMultiple = 0x00C4, /* Read multiple*/ + kATAcmdWriteMultiple = 0x00C5, /* Write multiple*/ + kATAcmdSetRWMultiple = 0x00C6, /* Set Multiple for Read/Write Multiple*/ + kATAcmdReadDMA = 0x00C8, /* Read DMA (with retries)*/ + kATAcmdWriteDMA = 0x00CA, /* Write DMA (with retries)*/ + kATAcmdMCAcknowledge = 0x00DB, /* Acknowledge media change - removable*/ + kATAcmdDoorLock = 0x00DE, /* Door lock*/ + kATAcmdDoorUnlock = 0x00DF, /* Door unlock*/ + kATAcmdStandbyImmed = 0x00E0, /* Standby Immediate*/ + kATAcmdIdleImmed = 0x00E1, /* Idle Immediate*/ + kATAcmdStandby = 0x00E2, /* Standby*/ + kATAcmdIdle = 0x00E3, /* Idle*/ + kATAcmdReadBuffer = 0x00E4, /* Read sector buffer command */ + kATAcmdCheckPowerMode = 0x00E5, /* Check power mode command <04/04/94>*/ + kATAcmdSleep = 0x00E6, /* Sleep*/ + kATAcmdFlushCache = 0x00E7, /* Flush Cache */ + kATAcmdWriteBuffer = 0x00E8, /* Write sector buffer command */ + kATAcmdWriteSame = 0x00E9, /* Write same data to multiple sectors*/ + kATAcmdFlushCacheExtended = 0x00EA, /* Flush Cache Extended */ + kATAcmdDriveIdentify = 0x00EC, /* Identify Drive command */ + kATAcmdMediaEject = 0x00ED, /* Media Eject*/ + kATAcmdSetFeatures = 0x00EF /* Set Features*/ +}; + +/* Set feature command opcodes*/ +enum { + kATAEnableWriteCache = 0x02, /* Enable write cache*/ + kATASetTransferMode = 0x03, /* Set transfer mode*/ + kATAEnableAPM = 0x05, /* Enable Advanced Power Management*/ + kATASetPIOMode = 0x08, /* PIO Flow Control Tx Mode bit*/ + kATADisableWriteCache = 0x82, /* disable write cache*/ + kATAEnableReadAhead = 0xAA /* Read look-ahead enable*/ +}; + +// revisit the opcode enumerations. + +////////////////////// + + +/* task file for ata */ +typedef struct ataTaskFile { + + UInt8 ataTFFeatures; /* <-> Error(R) or ataTFFeatures(W) register image */ + UInt8 ataTFCount; /* <-> Sector count/remaining */ + UInt8 ataTFSector; /* <-> Sector start/finish */ + UInt8 ataTFCylLo; /* <-> ataTFCylLo */ + UInt8 ataTFCylHigh; /* <-> ataTFCylHigh */ + UInt8 ataTFSDH; /* <-> ataTFSDH register image*/ + UInt8 ataTFCommand; /* <-> Status(R) or Command(W) register image */ + +} ataTaskFile; + + +typedef struct ataRegisterImage { + + ataTaskFile taskFile; + UInt16 ataDataRegister; /* <-> Data register. */ + UInt8 ataAltSDevCReg; /* <->: Alternate status(R) or Device Control(W) register image*/ + +} ataRegisterImage ; + + +typedef struct ATAPICmdPacket{ + + UInt16 atapiPacketSize; /* Size of command packet in bytes */ + UInt16 atapiCommandByte[8]; /* The command packet itself*/ + +}ATAPICmdPacket; + + + +// Error and result codes: TBD +enum { + kATAErrUnknownType = -1, + kATANoErr = 0, + kATAQueueEmpty = 1, + kATAUnknownOpcode, + kATATimeoutErr, + kATAInvalidDevID, + kATAErrDevBusy, + kATAModeNotSupported, + kATADevIntNoCmd, + kATADeviceError, + kATADMAErr +}; + + +#endif /* !_IOATATYPES_H */ diff --git a/QualcommWireless/include/IOKit/ata/IOPCIATA.h b/QualcommWireless/include/IOKit/ata/IOPCIATA.h new file mode 100644 index 0000000..62067b2 --- /dev/null +++ b/QualcommWireless/include/IOKit/ata/IOPCIATA.h @@ -0,0 +1,200 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _DRV_PCI_ATA_H +#define _DRV_PCI_ATA_H + +#include +#include +#include "IOATAController.h" +#include +#include + +#include + +/*! @class IOPCIATA + @abstract The base class for PCI-IDE ata controller family. + @discussion class defining the common elements of bus-mastering PCI ATA controllers which meet or at least loosely follow the pci bus mastering pci-ide controller spec. Header doc is incomplete, but source is heavily commented. + +*/ + + + +class IOPCIATA : public IOATAController +{ + OSDeclareDefaultStructors(IOPCIATA); + +public: + + /*--- Overrides from IOATAController ---*/ + virtual bool init(OSDictionary * properties); + virtual bool start( IOService* provider ); + +protected: + + // The DMA states: not in use, in use and running with additional passes needed, + // in use on final pass, transfer complete, and failure + enum ATADMAState + { + // DMA state flags + kATADMAInactive, + kATADMAStarting, + kATADMAActive, + kATADMAStatus, + kATADMAComplete, + kATADMAError, + + }; + + enum { + // PRD flags + kLast_PRD = 0x8000, + kContinue_PRD = 0, + + }; + + + enum { + mBMCmdStartOutput = 0x01, // start engine to transfer from memory to device. + mBMCmdStartInput = (1 << 3 ) | 0x01, // start engine to transfer from device to memory + mBMCmdStop = 0x00, // halt engine. + }; + + enum { + // bus master status register definitions. + bBMStatusSimplex = 7, // 0 = simultaneous transactions allowed. 1 = primary and secondary busses may not be active at same time. + bBMStatusDrv1 = 6, // 1 = device 1 and bus are already configured by some other software/firmware + bBMStatusDrv0 = 5, // 1 = device 0 and bus are already configured by some other software/firmware + bBMStatusInt = 2, // 1 = device has asserted INTRQ and all data is flushed to/from memory. + bBMStatusError = 1, // 1 = an error in the DMA has occured. Software clears by writing 1 to this bit. + bBMStatusActive = 0, // 1 = DMA engine is active. + }; + + enum{ + + mBMStatusSimplex = 1 << 7, + mBMStatusDrv1 = 1 << 6, + mBMStatusDrv0 = 1 << 5, + mBMStatusInt = 1 << 2, + mBMStatusError = 1 << 1, + mBMStatusActive = 1 + }; + + // the physical region descriptor used for the dma engine. + struct PRD + { + UInt32 bufferPtr; // address + UInt16 byteCount; // 16 bit byte count where 0x0000 = 64K + UInt16 flags; // 0 in flags means contine, 0x80 means stop + }; + + + // descendants of this class MUST initialize these values + // prior to activating any DMA command. + IOATARegPtr8 _bmCommandReg; + IOATARegPtr8 _bmStatusReg; + IOATARegPtr32 _bmPRDAddresReg; + + // semaphore for DMA state + UInt32 _dmaState; + + // table of PRD descriptors + PRD* _prdTable; + IOPhysicalAddress _prdTablePhysical; + + IONaturalMemoryCursor* _DMACursor; + + // override from IOATAController + // activate the DMA engine as per the current command + virtual IOReturn startDMA( void ); + + // override from IOATAController + // safely halt the DMA engine regardless of state + virtual IOReturn stopDMA( void ); + + // allocate memory for the PRD descriptors. + virtual bool allocDMAChannel(void); + + // fill CC with stop commands. + virtual void initATADMAChains (PRD* descPtr); + + // fill out a PRD, respecting endianess + virtual void setPRD(UInt8 *bffr, UInt16 count, PRD *tableElement, UInt16 end); + + // setup the CC with IO commands + virtual IOReturn createChannelCommands(void); + + // deallocate memory for the DMA engine + virtual bool freeDMAChannel(void); + + // clean up on device interrupt + virtual IOReturn handleDeviceInterrupt(void); + + // activate the DMA engine + virtual void activateDMAEngine(void); + + // shutdown the DMA engine + virtual void stopDMAEngine(void); + + // safely suspend the DMA engine + virtual void shutDownATADMA (void); + + // overrides + virtual void free(); +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOPCIATA class in the future. + */ + typedef struct ExpansionData + { + IOBufferMemoryDescriptor* _prdBuffer; + } ExpansionData; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOPCIATA, 0); + OSMetaClassDeclareReservedUnused(IOPCIATA, 1); + OSMetaClassDeclareReservedUnused(IOPCIATA, 2); + OSMetaClassDeclareReservedUnused(IOPCIATA, 3); + OSMetaClassDeclareReservedUnused(IOPCIATA, 4); + OSMetaClassDeclareReservedUnused(IOPCIATA, 5); + OSMetaClassDeclareReservedUnused(IOPCIATA, 6); + OSMetaClassDeclareReservedUnused(IOPCIATA, 7); + OSMetaClassDeclareReservedUnused(IOPCIATA, 8); + OSMetaClassDeclareReservedUnused(IOPCIATA, 9); + OSMetaClassDeclareReservedUnused(IOPCIATA, 10); + OSMetaClassDeclareReservedUnused(IOPCIATA, 11); + OSMetaClassDeclareReservedUnused(IOPCIATA, 12); + OSMetaClassDeclareReservedUnused(IOPCIATA, 13); + OSMetaClassDeclareReservedUnused(IOPCIATA, 14); + OSMetaClassDeclareReservedUnused(IOPCIATA, 15); + OSMetaClassDeclareReservedUnused(IOPCIATA, 16); + OSMetaClassDeclareReservedUnused(IOPCIATA, 17); + OSMetaClassDeclareReservedUnused(IOPCIATA, 18); + OSMetaClassDeclareReservedUnused(IOPCIATA, 19); + OSMetaClassDeclareReservedUnused(IOPCIATA, 20); +}; + +#endif // _DRV_PCI_ATA_H diff --git a/QualcommWireless/include/IOKit/audio/BigNum128.h b/QualcommWireless/include/IOKit/audio/BigNum128.h new file mode 100644 index 0000000..ebeaba9 --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/BigNum128.h @@ -0,0 +1,154 @@ +/* + * Copyright (c) 1998-2012 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __BIGNUM128_H__ +#define __BIGNUM128_H__ + +#include +#include + +class U128 +{ +public: + U128(uint64_t _lo = 0) : lo(_lo), hi(0) { }; + U128(uint64_t _hi, uint64_t _lo) : lo(_lo), hi(_hi) { }; + inline bool operator==( const U128 &A ) const { return ( A.hi == hi ) && ( A.lo == lo ); } + inline bool operator>( const U128 &A ) const { return ( ( A.hi > hi ) || ( ( A.hi == hi ) && ( A.lo > lo ) ) ); } + inline bool operator<( const U128 &A ) const { return !( ( A.hi > hi ) || ( ( A.hi == hi ) && ( A.lo > lo ) ) ); } + + U128 operator++( int ) + { + if ( ++lo==0 ) + hi++; + + return *this; + } + + U128 operator--( int ) + { + if ( 0 == lo-- ) + { + hi--; + } + return *this; + } + + U128& operator=( const U128 &A ) + { + hi = A.hi; + lo = A.lo; + + return *this; + } + + U128 operator+( const U128 &A ) const + { + U128 result(A.hi + hi, A.lo + lo); + + if ( ( result.lo < A.lo ) || ( result.lo < lo ) ) + { + result.hi++; + } + + return result; + } + + U128& operator+=( const U128 &A ) + { + U128 result(A.hi + hi, A.lo + lo); + + if ( ( result.lo < A.lo ) || ( result.lo < lo ) ) + { + result.hi++; + } + + *this = result; + + return *this; + } + + friend U128 operator-( const U128 &A, const U128 &B ) // assumes A >= B + { + U128 C = A; + + C.hi -= B.hi; + C.lo -= B.lo; + + if ( C.lo > A.lo ) // borrow ? + { + C.hi--; + } + + return C; + } + + + friend U128 operator<<( const U128& A, int n ) + { + U128 res = A; + + while ( n-- ) + { + res.hi <<= 1; + res.hi |= ( ( res.lo & MSB64 ) ? 1 : 0 ); + res.lo <<= 1; + } + + return res; + } + + friend U128 operator>>( const U128& A, int n ) + { + U128 res = A; + + while ( n-- ) + { + res.lo >>= 1; + res.lo |= ( ( res.hi & 0x1 ) ? MSB64 : 0 ); + res.hi >>= 1; + } + + return res; + } + +public: + +#ifdef __BIG_ENDIAN__ + uint64_t hi; + uint64_t lo; +#else + uint64_t lo; + uint64_t hi; +#endif + +private: + enum { MSB64 = 0x8000000000000000ULL }; +}; + +extern U128 UInt64mult(const uint64_t A, const uint64_t B); + +#endif //__BIGNUM128_H__ + + + + + diff --git a/QualcommWireless/include/IOKit/audio/IOAudioBlitterLibDispatch.h b/QualcommWireless/include/IOKit/audio/IOAudioBlitterLibDispatch.h new file mode 100644 index 0000000..08293e2 --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioBlitterLibDispatch.h @@ -0,0 +1,235 @@ +/* Copyright: © Copyright 2011 Apple Computer, Inc. All rights reserved. + + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. + ("Apple") in consideration of your agreement to the following terms, and your + use, installation, modification or redistribution of this Apple software + constitutes acceptance of these terms. If you do not agree with these terms, + please do not use, install, modify or redistribute this Apple software. + + In consideration of your agreement to abide by the following terms, and subject + to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs + copyrights in this original Apple software (the "Apple Software"), to use, + reproduce, modify and redistribute the Apple Software, with or without + modifications, in source and/or binary forms; provided that if you redistribute + the Apple Software in its entirety and without modifications, you must retain + this notice and the following text and disclaimers in all such redistributions of + the Apple Software. Neither the name, trademarks, service marks or logos of + Apple Computer, Inc. may be used to endorse or promote products derived from the + Apple Software without specific prior written permission from Apple. Except as + expressly stated in this notice, no other rights or licenses, express or implied, + are granted by Apple herein, including but not limited to any patent rights that + may be infringed by your derivative works or by other works in which the Apple + Software may be incorporated. + + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO + WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED + WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN + COMBINATION WITH YOUR PRODUCTS. + + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION + OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT + (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +/*! + * @header IOAudioBlitterLibDispatch + */ + +#ifndef __IOAudioBlitterLibDispatch_h__ +#define __IOAudioBlitterLibDispatch_h__ + +#include + + +#pragma mark - +#pragma mark Alternate names + +// Alternate names for the functions below: these explicitly specify the endianness of the integer format instead of "native"/"swap" +#if TARGET_RT_BIG_ENDIAN +#define IOAF_BEInt16ToFloat32 IOAF_NativeInt16ToFloat32 +#define IOAF_LEInt16ToFloat32 IOAF_SwapInt16ToFloat32 +#define IOAF_BEInt24ToFloat32 IOAF_NativeInt24ToFloat32 +#define IOAF_LEInt24ToFloat32 IOAF_SwapInt24ToFloat32 +#define IOAF_BEInt32ToFloat32 IOAF_NativeInt32ToFloat32 +#define IOAF_LEInt32ToFloat32 IOAF_SwapInt32ToFloat32 + +#define IOAF_Float32ToBEInt16 IOAF_Float32ToNativeInt16 +#define IOAF_Float32ToLEInt16 IOAF_Float32ToSwapInt16 +#define IOAF_Float32ToBEInt24 IOAF_Float32ToNativeInt24 +#define IOAF_Float32ToLEInt24 IOAF_Float32ToSwapInt24 +#define IOAF_Float32ToBEInt32 IOAF_Float32ToNativeInt32 +#define IOAF_Float32ToLEInt32 IOAF_Float32ToSwapInt32 +#else +#define IOAF_LEInt16ToFloat32 IOAF_NativeInt16ToFloat32 +#define IOAF_BEInt16ToFloat32 IOAF_SwapInt16ToFloat32 +#define IOAF_LEInt24ToFloat32 IOAF_NativeInt24ToFloat32 +#define IOAF_BEInt24ToFloat32 IOAF_SwapInt24ToFloat32 +#define IOAF_LEInt32ToFloat32 IOAF_NativeInt32ToFloat32 +#define IOAF_BEInt32ToFloat32 IOAF_SwapInt32ToFloat32 + +#define IOAF_Float32ToLEInt16 IOAF_Float32ToNativeInt16 +#define IOAF_Float32ToBEInt16 IOAF_Float32ToSwapInt16 +#define IOAF_Float32ToLEInt24 IOAF_Float32ToNativeInt24 +#define IOAF_Float32ToBEInt24 IOAF_Float32ToSwapInt24 +#define IOAF_Float32ToLEInt32 IOAF_Float32ToNativeInt32 +#define IOAF_Float32ToBEInt32 IOAF_Float32ToSwapInt32 +#endif + +/*! + * @typedef Float32 + * @abstract Convenience type that represent a 32-bit floating point number + */ +typedef float Float32; + +/*! + * @typedef Float64 + * @abstract Convenience type that represent a 64-bit floating point number + */ +typedef double Float64; + +#ifndef __OPEN_SOURCE__ +/*! + * @function IOAF_Int8ToFloat32 + * @abstract Converts 8-bit integer float to 32-bit float + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_Int8ToFloat32( const SInt8 *src, Float32 *dest, unsigned int count ); +#endif + +/*! + * @function IOAF_NativeInt16ToFloat32 + * @abstract Converts native 16-bit integer float to 32-bit float + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_NativeInt16ToFloat32( const SInt16 *src, Float32 *dest, unsigned int count ); + +/*! + * @function IOAF_SwapInt16ToFloat32 + * @abstract Converts non-native 16-bit integer float to 32-bit float + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_SwapInt16ToFloat32( const SInt16 *src, Float32 *dest, unsigned int count ); + +/*! + * @function IOAF_NativeInt24ToFloat32 + * @abstract Converts native 24-bit integer float to 32-bit float + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_NativeInt24ToFloat32( const UInt8 *src, Float32 *dest, unsigned int count ); + +/*! + * @function IOAF_SwapInt24ToFloat32 + * @abstract Converts non-native 24-bit integer float to 32-bit float + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_SwapInt24ToFloat32( const UInt8 *src, Float32 *dest, unsigned int count ); + +/*! + * @function IOAF_NativeInt32ToFloat32 + * @abstract Converts native 32-bit integer float to 32-bit float + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_NativeInt32ToFloat32( const SInt32 *src, Float32 *dest, unsigned int count ); + +/*! + * @function IOAF_SwapInt32ToFloat32 + * @abstract Converts non-native 32-bit integer float to 32-bit float + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_SwapInt32ToFloat32( const SInt32 *src, Float32 *dest, unsigned int count ); + +#ifndef __OPEN_SOURCE__ +/*! + * @function IOAF_Float32ToInt8 + * @abstract Converts 32-bit floating point to 8-bit integer + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_Float32ToInt8( const Float32 *src, SInt8 *dest, unsigned int count ); +#endif + +/*! + * @function IOAF_Float32ToNativeInt16 + * @abstract Converts 32-bit floating point to native 16-bit integer + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_Float32ToNativeInt16( const Float32 *src, SInt16 *dest, unsigned int count ); + +/*! + * @function IOAF_Float32ToSwapInt16 + * @abstract Converts 32-bit floating point to non-native 16-bit integer + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_Float32ToSwapInt16( const Float32 *src, SInt16 *dest, unsigned int count ); + +/*! + * @function IOAF_Float32ToNativeInt24 + * @abstract Converts 32-bit floating point to native 24-bit integer + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_Float32ToNativeInt24( const Float32 *src, UInt8 *dest, unsigned int count ); + +/*! + * @function IOAF_Float32ToSwapInt24 + * @abstract Converts 32-bit floating point to non-native 24-bit integer + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_Float32ToSwapInt24( const Float32 *src, UInt8 *dest, unsigned int count ); + +/*! + * @function IOAF_Float32ToNativeInt32 + * @abstract Converts 32-bit floating point to native 32-bit integer + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_Float32ToNativeInt32( const Float32 *src, SInt32 *dest, unsigned int count ); + +/*! + * @function IOAF_Float32ToSwapInt32 + * @abstract Converts 32-bit floating point to non-native 32-bit integer + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_Float32ToSwapInt32( const Float32 *src, SInt32 *dest, unsigned int count ); + +/*! + * @function IOAF_bcopy_WriteCombine + * @abstract An efficient bcopy from "write combine" memory to regular memory. It is safe to assume that all memory has been copied when the function has completed + * @param src Pointer to the data to convert + * @param dest Pointer to the converted data + * @param count The number of items to convert + */ +extern void IOAF_bcopy_WriteCombine(const void *src, void *dest, unsigned int count ); + +#endif // __IOAudioBlitterLibDispatch_h__ diff --git a/QualcommWireless/include/IOKit/audio/IOAudioControl.h b/QualcommWireless/include/IOKit/audio/IOAudioControl.h new file mode 100644 index 0000000..3063cfc --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioControl.h @@ -0,0 +1,600 @@ +/* + * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOCONTROL_H +#define _IOKIT_IOAUDIOCONTROL_H + +#include +#include +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioEngine.h" +#endif + +class IOAudioPort; +class OSDictionary; +class OSSet; +class IOAudioUserClient; +class IOAudioControlUserClient; +class IOWorkLoop; +class IOCommandGate; + +/*! + * @class IOAudioControl + * @abstract Represents any controllable attribute of an IOAudioDevice. + * @discussion An IOAudioControl instance may belong to one IOAudioPort. Additionally, it may associated + * with an IOAudioEngine as a default control for that IOAudioEngine. + * + * When its value changes, it sends a notification to the CoreAudio.framework (HAL). It also makes a call + * to the ValueChangeHandler. + * + * The base IOAudioControl class contains a type, a value and a channel ID representing the channel(s) which + * the control acts on. It may also contain a readable format for the name of the channel as well as a + * control ID that can be used to identify unique controls. Additionally it may contain a subType and a usage. + * Each type has its own set of possible subTypes. There currently four different control types defined: + * kIOAudioControlTypeLevel, kIOAudioControlTypeToggle, kIOAudioControlTypeSelector. + * Each one is represented by a subclass of IOAudioControl: IOAudioLevelControl, IOAudioToggleControl, + * IOAudioSelectorControl. The level control defines a range of allowed values and has + * a defined subtype of kIOAudioLevelControlSubTypeVolume used to define a volume control. The toggle control + * allows for a boolean value and has a defined subtype kIOAudioToggleControlSubTypeMute for a mute control. The + * selector control has a list of allowed selections with a value and description for each allowed selection and + * has the following sub types: kIOAudioSelectorControlSubTypeOutput for an output selector and + * kIOAudioSelectorControlSubTypeInput for an input selector. See the subclass documentation for a more + * complete description of each + * + * There are enums for default channel ID values and common channel names in IOAudioTypes.h. The channel ID + * values are prefixed with 'kIOAudioControlChannelID' and the common channel names are prefixed with + * 'kIOAudioControlChannelName'. All of the attributes of the IOAudioControl are stored in the registry. + * The key used for each attribute is defined in IOAudioTypes.h with the define matching the following + * pattern: 'kIOAudioControlKey'. For example: kIOAudioControlChannelIDKey. + * + * In addition to the existing defined control types, drivers can define their own as well for other purposes. + * + * Changes to the IOAudioControl's value made by the CoreAudio.framework are done through the IORegistry. + * When the CoreAudio.framework initiates a value change, the control receives a setProperties() message. + * The setProperties() implementation looks for the property 'IOAudioControlValue' and if present, calls + * setValue() on the driver's IOWorkLoop with the new value. The setValue() function first checks to see + * if the new value is different. If so, it calls performValueChange() to call through to the driver + * to make the change in the hardware. If that call succeeds the value is changed and the new value is set + * in the registry. Additionally notifications are sent to all clients that have registered for them. + */ +class IOAudioControl : public IOService +{ + friend class IOAudioPort; + friend class IOAudioDevice; + friend class IOAudioEngine; + + OSDeclareDefaultStructors(IOAudioControl) + +public: + + /*! + * @typedef IntValueChangeHandler + * @abstract Handler function used to make a notification when a value is to be changed. + * @param target Reference supplied when the handler was registered. + * @param audioControl The IOAudioControl that is changing. + * @param oldValue The old value of the control. + * @param newValue The new value the control is being changed to. + * @result Must return kIOReturnSuccess when the hardware is successfully updated. + */ + typedef IOReturn (*IntValueChangeHandler)(OSObject *target, IOAudioControl *audioControl, SInt32 oldValue, SInt32 newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + typedef IOReturn (*DataValueChangeHandler)(OSObject *target, IOAudioControl *audioControl, const void *oldData, UInt32 oldDataSize, const void *newData, UInt32 newDataSize ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + typedef IOReturn (*ObjectValueChangeHandler)(OSObject *target, IOAudioControl *audioControl, OSObject *oldValue, OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +protected: + /*! @var workLoop + The IOWorkLoop for the audio driver - shared from the IOAudioDevice. + */ + IOWorkLoop *workLoop; + /*! @var commandGate + The IOCommandGate for this control - attached to the driver's IOWorkLoop. + */ + IOCommandGate *commandGate; + + /*! @var isStarted + Internal state keeping track of when the IOAudioControl has been started. + */ + bool isStarted; + + /*! @var controlID + An optional identifier that can be used to identify the control. + */ + UInt32 controlID; + /*! @var channelID + The ID of the channel this control affects - may be kIOAudioControlChannelIDAll if it represents all channels. + */ + UInt32 channelID; + + UInt32 type; + UInt32 subType; + UInt32 usage; + + OSObject *value; + + typedef enum { + kIntValueChangeHandler, + kDataValueChangeHandler, + kObjectValueChangeHandler + } ValueChangeHandlerType; + + ValueChangeHandlerType valueChangeHandlerType; + + union { + IntValueChangeHandler intHandler; + DataValueChangeHandler dataHandler; + ObjectValueChangeHandler objectHandler; + } valueChangeHandler; + + OSObject *valueChangeTarget; + + /*! @var clients + A list of user clients that have requested value change notifications. + */ + OSSet *userClients; + +protected: + struct ExpansionData { + IOAudioEngine * providerEngine; + OSArray * notificationQueue; + UInt32 commandGateStatus; // + SInt32 commandGateUsage; // + }; + + ExpansionData *reserved; + +public: + // OSMetaClassDeclareReservedUsed(IOAudioControl, 0); + virtual void sendChangeNotification(UInt32 notificationType ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioControl, 1); + /*! + * @function setReadOnlyFlag + * @abstract Call this function to say that a control is read only. + * This call cannot be undone, so if a control is only temporarily unsetable, + * do not use this call but instead return an error from the control handler. + */ + virtual void setReadOnlyFlag( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioControl, 2); + virtual void sendQueuedNotifications(void ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioControl, 3); + /*! + * @function createUserClient + * @abstract Creates a new IOAudioControlUserClient instance. + * @discussion This function is called by newUserClient() to create a new IOAudioControlUserClient instance. This function may be overridden by subclasses that need to add functionality + * to the IOAudioControlUserClient. In that case, they must subclass IOAudioControlUserClient + * and return a new, initialized instance of that subclass. + * A derived class that requires overriding of createUserClient should override the version with the properties + * parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive + * can be used to select between the two behaviors. + * @param task The task requesting the new user client. + * @param securityID Optional security paramater passed in by the client - ignored. + * @param type Optional user client type passed in by the client. + * @param newUserClient The IOAudioControlUserClient * must be stored in this param on a successful + * completion. + * @param properties A dictionary of additional properties for the connection. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 taskType, IOAudioControlUserClient **newUserClient, OSDictionary *properties) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +private: + OSMetaClassDeclareReservedUsed(IOAudioControl, 0); + OSMetaClassDeclareReservedUsed(IOAudioControl, 1); + OSMetaClassDeclareReservedUsed(IOAudioControl, 2); + OSMetaClassDeclareReservedUsed(IOAudioControl, 3); + + OSMetaClassDeclareReservedUnused(IOAudioControl, 4); + OSMetaClassDeclareReservedUnused(IOAudioControl, 5); + OSMetaClassDeclareReservedUnused(IOAudioControl, 6); + OSMetaClassDeclareReservedUnused(IOAudioControl, 7); + OSMetaClassDeclareReservedUnused(IOAudioControl, 8); + OSMetaClassDeclareReservedUnused(IOAudioControl, 9); + OSMetaClassDeclareReservedUnused(IOAudioControl, 10); + OSMetaClassDeclareReservedUnused(IOAudioControl, 11); + OSMetaClassDeclareReservedUnused(IOAudioControl, 12); + OSMetaClassDeclareReservedUnused(IOAudioControl, 13); + OSMetaClassDeclareReservedUnused(IOAudioControl, 14); + OSMetaClassDeclareReservedUnused(IOAudioControl, 15); + OSMetaClassDeclareReservedUnused(IOAudioControl, 16); + OSMetaClassDeclareReservedUnused(IOAudioControl, 17); + OSMetaClassDeclareReservedUnused(IOAudioControl, 18); + OSMetaClassDeclareReservedUnused(IOAudioControl, 19); + OSMetaClassDeclareReservedUnused(IOAudioControl, 20); + OSMetaClassDeclareReservedUnused(IOAudioControl, 21); + OSMetaClassDeclareReservedUnused(IOAudioControl, 22); + OSMetaClassDeclareReservedUnused(IOAudioControl, 23); + +public: + + /*! + * @function withAttributes + * @abstract Static function that allocates a new IOAudioControl with the given attributes. + * @param type The type of the control. Common, known types are defined in IOAudioTypes.h. They currently + * consist of kIOAudioControlTypeLevel, kIOAudioControlTypeToggle, kIOAudioControlTypeSelector. + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioDefines.h. Any name not + * defined in IOAudioDefines.h must be localized in order to be properly displayed in multiple languages. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @param subType An optional subType specific to the given type + * @param usage An optional value specifying how the control will be used. Currently defined usages are kIOAudioControlUsageInput, + * kIOAudioControlUsageOutput and kIOAudioControlUsagePassThru. This value is used when a control is set as a default control + * on an IOAudioEngine. + * @result Returns a newly allocated and initialized IOAudioControl. + */ + static IOAudioControl *withAttributes(UInt32 type, + OSObject *initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 ; + + /*! + * @function init + * @abstract Initializes a newly allocated IOAudioControl with the given attributes. + * @param type The type of the control. Common, known types are defined in IOAudioTypes.h. They currently + * consist of kIOAudioControlTypeLevel, kIOAudioControlTypeToggle, kIOAudioControlTypeSelector. + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioDefines.h. Any name not + * defined in IOAudioDefines.h must be localized in order to be properly displayed in multiple languages. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @param subType An optional subType specific to the given type + * @param usage An optional value specifying how the control will be used. Currently defined usages are kIOAudioControlUsageInput, + * kIOAudioControlUsageOutput and kIOAudioControlUsagePassThru. This value is used when a control is set as a default control + * on an IOAudioEngine. + * @param properties Standard property list passed to the init() function of any new IOService. This dictionary + * gets stored in the registry entry for this instance. + * @result Returns true on success. + */ + virtual bool init(UInt32 type, + OSObject *initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0, + OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 ; + + /*! + * @function free + * @abstract Frees all of the resources allocated by the IOAudioControl. + * @discussion Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + virtual void free( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function start + * @abstract Starts a newly created IOAudioControl. + * @discussion This is called automatically by IOAudioPort when addAudioControl() is called or by IOAudioEngine + * when addDefaultAudioControl() is called. It will only be called by the first call to either addAudioControl() or + * addDefaultAudioControl(). + * @param provider The IOAudioPort or IOAudioEngine that owns this control. + * @result Returns true on success. + */ + virtual bool start(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual bool attachAndStart(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getIsStarted + * @abstract Returns true after start() has been called. + * @discussion Used by IOAudioPort and IOAudioEngine to decide if the control needs to be started. + */ + virtual bool getIsStarted() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function stop + * @abstract Stops the control when the provider is going away. + * @param provider The IOAudioPort or IOAudioEngine that owns this control. + */ + virtual void stop(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getWorkLoop + * @abstract Returns the IOWorkLoop for the whole audio driver. + */ + virtual IOWorkLoop *getWorkLoop() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getCommandGate + * @abstract Returns the IOCommandGate for this IOAudioControl. + */ + virtual IOCommandGate *getCommandGate() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 ; + + /*! + * @function newUserClient + * @abstract Creates a new user client object for this IOAudioControl instance. + * @discussion This is called automatically by I/O Kit when a user process opens a connection to this + * IOAudioControl. This is typically done when the user process needs to register for value change + * notifications. This implementation allocates a new IOAudioControlUserClient object. There is no + * need to call this directly. + * A derived class that requires overriding of newUserClient should override the version with the properties + * parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive + * can be used to select between the two behaviors. + * @param task The task requesting the new user client. + * @param securityID Optional security paramater passed in by the client - ignored. + * @param type Optional user client type passed in by the client - 0 for the default user client type. + * @param handler The new IOUserClient * must be stored in this param on a successful completion. + * @param properties A dictionary of additional properties for the connection. + * @result Returns kIOReturnSuccess on success. May also result kIOReturnError or kIOReturnNoMemory. + */ + virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, IOUserClient **handler) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, OSDictionary *properties, IOUserClient **handler) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function createUserClient + * @abstract Creates a new IOAudioControlUserClient instance. + * @discussion This function is called by newUserClient() to create a new IOAudioControlUserClient instance. This function may be overridden by subclasses that need to add functionality + * to the IOAudioControlUserClient. In that case, they must subclass IOAudioControlUserClient + * and return a new, initialized instance of that subclass. + * A derived class that requires overriding of createUserClient should override the version with the properties + * parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive + * can be used to select between the two behaviors. + * @param task The task requesting the new user client. + * @param securityID Optional security paramater passed in by the client - ignored. + * @param type Optional user client type passed in by the client. + * @param newUserClient The IOAudioControlUserClient * must be stored in this param on a successful + * completion. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioControlUserClient **newUserClient) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 ; + + /*! + * @function clientClosed + * @abstract Called automatically by the IOAudioControlUserClient when a user client closes its + * connection to the control. + * @param client The user client object that has disconnected. + */ + virtual void clientClosed(IOAudioControlUserClient *client) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setProperties + * @abstract Changes a property of this IOService. + * @discussion This is called when the user client changes a property of this + * IOAudioControl. In this case it is used to change the value. This function + * looks for that property and then calls setValue() through the IOCommandGate and + * setValueAction(). + * @param properties An OSDictionary containing the properties to change. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn setProperties(OSObject *properties) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void setValueChangeHandler(IntValueChangeHandler intValueChangeHandler, OSObject *target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void setValueChangeHandler(DataValueChangeHandler dataValueChangeHandler, OSObject *target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void setValueChangeHandler(ObjectValueChangeHandler objectValueChangeHandler, OSObject *target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void setValueChangeTarget(OSObject *target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function flushValue + * @abstract Forces the control to be flushed out to the hardware. + * @discussion This function calls performValueChange() directly with the current value of the IOAudioControl. + * @result Returns the result of performValueChange() - kIOReturnSuccess on success. + */ + virtual IOReturn flushValue() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setValueAction + * @abstract IOCommandGate Action which calls setValue() while holding the IOCommandGate. + * @discussion This is needed to allow setValue() to be called on the IOWorkLoop. + * @param owner The owner of the IOCommandGate (the IOAudioControl in this case). + * @param arg1 The new value for the IOAudioControl. + * @result Returns the result of setValue() - kIOReturnSuccess on success. + */ + static IOReturn setValueAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOReturn _setValueAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + + /*! + * @function setValue + * @abstract Sets the value for this control. + * @discussion When the control's value is changed, a call is made to performValueChange(). If that call + * succeeds, the value is set and sendValueChangeNotification() is called to send a notification to the + * user clients. This function must be called on the IOWorkLoop. + * @param newValue The new value for this control. + * @result Returns kIOReturnSuccess if the value is successfully set. + */ + virtual IOReturn setValue(OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn setValue(SInt32 intValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function hardwareValueChanged + * @abstract Updates the value for this control and sends out the value changed notification. + * @discussion This is designed to be called by the driver when it detects that the hardware's value has + * changed without driver intervention (e.g. when an external event causes the change). The difference between + * hardwareValueChanged() and setValue() is that hardwareValueChanged() doesn't call performValueChange() which + * sends a message back to the driver to cause it to change the hardware with the new value. This function must + * be called on the IOWorkLoop. + * @param newValue The new value for this control. + * @result Returns kIOReturnSuccess if the value is successfully updated. + */ + virtual IOReturn hardwareValueChanged(OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getValue + * @abstract Returns the current value of the control. + */ + virtual OSObject *getValue( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual SInt32 getIntValue( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual const void *getDataBytes( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual UInt32 getDataLength( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getControlID + * @abstract Returns the control ID for the control. + */ + virtual UInt32 getControlID( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getChannelID + * @abstract Returns the channel ID for the control. + */ + virtual UInt32 getChannelID( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual UInt32 getType( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual UInt32 getSubType( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual UInt32 getUsage( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void setCoreAudioPropertyID(UInt32 propertyID ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + void setWorkLoop(IOWorkLoop *wl ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +protected: + /*! + * @function sendValueChangeNotification + * @abstract Called when the value has changed for the control. + * @discussion This function sends out the value change notification to the user clients. + */ + virtual void sendValueChangeNotification( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setChannelName + * @abstract Called at init time to set the channel name for this IOAudioControl. + */ + virtual void setChannelName(const char *channelName ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setChannelID + * @abstract Called at init time to set the channel ID for this IOAudioControl. + */ + virtual void setChannelID(UInt32 newChannelID ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void setChannelNumber(SInt32 channelNumber ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setSubType + * @abstract Called at init time to set the control subType. + */ + virtual void setType(UInt32 type ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setType + * @abstract Called at init time to set the control type. + */ + virtual void setSubType(UInt32 subType ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setUsage + * @abstract Called at init time to set the control usage. + */ + virtual void setUsage(UInt32 usage ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setControlID + * @abstract Sets the controlID for this control. + * @discussion The control ID is an optional attribute that can be used to track IOAudioControls. A typical + * use is for the IOAudioDevice to assign a unique controlID to each control that it creates and then + * do a switch statement on the id of the control when it gets an audioControlValueChanged() notification. + * Typically the control ID is set when the object is created and doesn't need to be called again. + * @param cntrlID The control ID for the control. + */ + virtual void setControlID(UInt32 cntrlID ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function validateValue + * @abstract Called by setValue() to verify that the value is valid. + * @param newValue The new value to be verified. + * @result Returns kIOReturnSuccess if the value is valid. + */ + virtual IOReturn validateValue(OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function updateValue + * @abstract Called by setValue() in order to update the value and the registry. + * @discussion It also calls + * sendValueChangedNotification() to send notifications to the user clients. + * @param newValue The new value to b updated. + * @result Returns kIOReturnSuccess if the value is successfully updated. + */ + virtual IOReturn updateValue(OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn _setValue(OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function performValueChange + * @abstract Called by setValue() to make the call to the valueChangeHandler + * to update the hardware. + * @result Returns the result of the handler call (or kIOReturnError on an error). + */ + virtual IOReturn performValueChange(OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function addUserClientAction + * @abstract IOCommandGate Action which calls addUserClient() while holding the IOCommandGate. + * @discussion This is needed to allow addUserClient() to be called on the IOWorkLoop. + * @param owner The owner of the IOCommandGate (the IOAudioControl in this case). + * @param arg1 The IOAudioControlUserClient to be added. + * @result Returns the result of addUserClient() - kIOReturnSuccess on success. + */ + static IOReturn addUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOReturn _addUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + + /*! + * @function removeUserClientAction + * @abstract IOCommandGate Action which calls removeUserClient() while holding the IOCommandGate. + * @discussion This is needed to allow removeUserClient() to be called on the IOWorkLoop. + * @param owner The owner of the IOCommandGate (the IOAudioControl in this case). + * @param arg1 The IOAudioControlUserClient to be removed. + * @result Returns the result of removeUserClient() - kIOReturnSuccess on success. + */ + static IOReturn removeUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOReturn _removeUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + + /*! + * @function detachUserClientsAction + */ + static IOReturn detachUserClientsAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function addUserClient + * @abstract Called on the IOWorkLoop to add a new IOAudioControlUserClient. + * @discussion There is no need to call this directly. It is called on the workLoop + * by newUserClient() through addUserClientAction(). + * @param newUserClient The IOAudioControlUserClientto be added. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn addUserClient(IOAudioControlUserClient *newUserClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function removeUserClient + * @abstract Called on the IOWorkLoop to remove an IOAudioControlUserClient. + * @discussion This is called on the IOWorkLoop by clientClosed() through + * removeUserClientAction() when the user client is going away. It should + * not be called directly. + * @param userClient The IOAudioControlUserClient to be removed. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn removeUserClient(IOAudioControlUserClient *userClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn detachUserClients( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static void setCommandGateUsage(IOAudioControl *control, bool increment ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + +}; + +#endif /* _IOKIT_IOAUDIOCONTROL_H */ + diff --git a/QualcommWireless/include/IOKit/audio/IOAudioControlUserClient.h b/QualcommWireless/include/IOKit/audio/IOAudioControlUserClient.h new file mode 100644 index 0000000..c4afaf8 --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioControlUserClient.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOCONTROLUSERCLIENT_H +#define _IOKIT_IOAUDIOCONTROLUSERCLIENT_H + +#include +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioTypes.h" +#endif + +class IOAudioControl; + +class IOAudioControlUserClient : public IOUserClient +{ + OSDeclareDefaultStructors(IOAudioControlUserClient) + +protected: + task_t clientTask; + IOAudioControl * audioControl; + IOAudioNotificationMessage * notificationMessage; + + virtual IOReturn clientClose( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn clientDied( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +public: + virtual void sendChangeNotification(UInt32 notificationType ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 1); + virtual bool initWithAudioControl(IOAudioControl *control, task_t owningTask, void *securityID, UInt32 type, OSDictionary *properties ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +private: + OSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 0); + OSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 1); + + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 2); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 3); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 4); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 5); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 6); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 7); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 8); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 9); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 10); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 11); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 12); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 13); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 14); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 15); + +public: + static IOAudioControlUserClient *withAudioControl(IOAudioControl *control, task_t clientTask, void *securityID, UInt32 type ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + static IOAudioControlUserClient *withAudioControl(IOAudioControl *control, task_t clientTask, void *securityID, UInt32 type, OSDictionary *properties ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual bool initWithAudioControl(IOAudioControl *control, task_t owningTask, void *securityID, UInt32 type ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void free( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 type, UInt32 refCon ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void sendValueChangeNotification( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; +}; + +#endif /* _IOKIT_IOAUDIOCONTROLUSERCLIENT_H */ diff --git a/QualcommWireless/include/IOKit/audio/IOAudioDebug.h b/QualcommWireless/include/IOKit/audio/IOAudioDebug.h new file mode 100644 index 0000000..e9a728c --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioDebug.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOAUDIODEBUG_H +#define _IOAUDIODEBUG_H + +#include +#include + + +#ifdef DEBUG + #define DEBUG_LEVEL 4 // + //#define DEBUG_USE_FIRELOG 1 + #define DEBUG_USE_FIREWIRE_KPRINTF 1 + + #ifdef DEBUG_USE_FIRELOG + #include + #define audioDebugIOLog( level, message... ) \ + do {FireLog( message ); FireLog("\n");} while (0) + #define audioErrorIOLog( message... ) \ + do { FireLog( message ); FireLog("\n"); IOLog( message );} while (0) + #endif + + #ifdef DEBUG_USE_IOUSBLOG + #include + #define audioDebugIOLog( level, message... ) \ + do {USBLog( level, message );} while (0) + #define audioErrorIOLog( level, message... ) \ + do { USBLog( DEBUG_LEVEL_BETA, message ); IOLog( message );} while (0) + #endif + + #ifdef DEBUG_USE_FIREWIRE_KPRINTF + #define audioDebugIOLog( level, message... ) \ + do { if (level <= DEBUG_LEVEL) kprintf( message );} while (0) + #define audioErrorIOLog( message... ) \ + do { kprintf( message ); IOLog( message );} while (0) + #endif + + #ifdef assert + #undef assert + + #define AssertionMessage( cond, file, line ) \ + "assert \"" #cond "\" failed in " #file " at line " #line + + #define AssertionFailed( cond, file, line ) \ + panic(AssertionMessage( cond, file, line )); + + #define assert( cond ) \ + if( !(cond) ) { \ + AssertionFailed( cond, __FILE__, __LINE__ ) \ + } + #endif +#else + #define DEBUG_LEVEL 3 + + #include + #define audioDebugIOLog( level, message... ) \ + do { if ( __builtin_expect(level <= DEBUG_LEVEL, 0) ) { os_log( OS_LOG_DEFAULT, message ); } } while (0) + + #define audioErrorIOLog( message... ) \ + do { os_log_error( OS_LOG_DEFAULT, message ); IOLog( message );} while (0) + +#endif + + +#endif /* _IOAUDIODEBUG_H */ diff --git a/QualcommWireless/include/IOKit/audio/IOAudioDefines.h b/QualcommWireless/include/IOKit/audio/IOAudioDefines.h new file mode 100644 index 0000000..0f8f617 --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioDefines.h @@ -0,0 +1,478 @@ +/* + * Copyright (c) 1998-2013 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOAUDIODEFINES_H +#define _IOAUDIODEFINES_H + +#define kIOAudioDeviceClassName "IOAudioDevice" +#define kIOAudioEngineClassName "IOAudioEngine" +#define kIOAudioStreamClassName "IOAudioStream" +#define kIOAudioPortClassName "IOAudioPort" +#define kIOAudioControlClassName "IOAudioControl" + +/*! + * @defined kIOAudioSampleRateKey + * @abstract The key in the IORegistry for the IOAudioEngine sample rate attribute + * @discussion This value is represented as an integer in samples per second. + */ +#define kIOAudioSampleRateKey "IOAudioSampleRate" + +#define kIOAudioSampleRateWholeNumberKey "IOAudioSampleRateWholeNumber" +#define kIOAudioSampleRateFractionKey "IOAudioSampleRateFraction" + + + +/****** + * + * IOAudioDevice defines + * + *****/ + + +/*! + * @defined kIOAudioDeviceNameKey + * @abstract The key in the IORegistry for the IOAudioDevice name attribute. + */ +#define kIOAudioDeviceNameKey "IOAudioDeviceName" + +#define kIOAudioDeviceShortNameKey "IOAudioDeviceShortName" + +/*! + * @defined kIOAudioDeviceManufacturerNameKey + * @abstract The key in the IORegistry for the IOAudioDevice manufacturer name attribute. + */ +#define kIOAudioDeviceManufacturerNameKey "IOAudioDeviceManufacturerName" + +#define kIOAudioDeviceLocalizedBundleKey "IOAudioDeviceLocalizedBundle" + +#define kIOAudioDeviceTransportTypeKey "IOAudioDeviceTransportType" + +#define kIOAudioDeviceConfigurationAppKey "IOAudioDeviceConfigurationApplication" + +#define kIOAudioDeviceCanBeDefaults "IOAudioDeviceCanBeDefaults" + +#define kIOAudioDeviceModelIDKey "IOAudioDeviceModelID" + + +/*! + * @defined kIOAudioDeviceIconName + * @abstract The key in the IORegistry for the IOAudioDevice icon name attribute. + */ +#define kIOAudioDeviceIconNameKey "IOAudioDeviceIconName" + +#define kIOAudioDeviceIconTypeKey "IOAudioDeviceIconType" + +#define kIOAudioDeviceIconSubDirKey "IOAudioDeviceIconSubDir" + +/***** + * + * IOAudioEngine defines + * + *****/ + + + /*! + * @defined kIOAudioEngineStateKey + * @abstract The key in the IORegistry for the IOAudioEngine state atrribute + * @discussion The value for this key may be one of: "Running", "Stopped" or "Paused". Currently the "Paused" + * state is unimplemented. + */ +#define kIOAudioEngineStateKey "IOAudioEngineState" + +/*! + * @defined kIOAudioEngineOutputSampleLatencyKey + * @abstract The key in the IORegistry for the IOAudioEngine output sample latency key + * @discussion + */ +#define kIOAudioEngineOutputSampleLatencyKey "IOAudioEngineOutputSampleLatency" + +/*! + * @defined kIOAudioStreamSampleLatencyKey + * @abstract The key in the IORegistry for the IOAudioStream output sample latency key + * @discussion Tells the HAL how much latency is on a particular stream. If two streams + * on the same engine have different latencies (e.g. one is analog, one is digital), then + * set this property on both streams to inform the HAL of the latency differences. Alternately, + * you can set the engine latency, and just include the latency additional to that for the particular + * stream. The HAL will add the engine and stream latency numbers together to get the total latency. + */ +#define kIOAudioStreamSampleLatencyKey "IOAudioStreamSampleLatency" + +#define kIOAudioEngineInputSampleLatencyKey "IOAudioEngineInputSampleLatency" + +#define kIOAudioEngineSampleOffsetKey "IOAudioEngineSampleOffset" + +#define kIOAudioEngineInputSampleOffsetKey "IOAudioEngineInputSampleOffset" + +#define kIOAudioEngineNumSampleFramesPerBufferKey "IOAudioEngineNumSampleFramesPerBuffer" + +#define kIOAudioEngineCoreAudioPlugInKey "IOAudioEngineCoreAudioPlugIn" + +#define kIOAudioEngineNumActiveUserClientsKey "IOAudioEngineNumActiveUserClients" + +#define kIOAudioEngineUserClientActiveKey "IOAudioEngineUserClientActive" + +#define kIOAudioEngineGlobalUniqueIDKey "IOAudioEngineGlobalUniqueID" + +#define kIOAudioEngineDescriptionKey "IOAudioEngineDescription" + +#define kIOAudioEngineClockIsStableKey "IOAudioEngineClockIsStable" + +#define kIOAudioEngineClockDomainKey "IOAudioEngineClockDomain" + +#define kIOAudioEngineIsHiddenKey "IOAudioEngineIsHidden" + +#define kIOAudioEngineOutputAutoRouteKey "NoAutoRoute" +/*! + * @defined kIOAudioEngineFullChannelNamesKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary of fully constructed names for each channel keyed by the device channel + * @discussion + */ +#define kIOAudioEngineFullChannelNamesKey "IOAudioEngineChannelNames" + +/*! + * @defined kIOAudioEngineFullChannelCategoryNamesKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary of category names for each channel keyed by the device channel + * @discussion + */ +#define kIOAudioEngineFullChannelCategoryNamesKey "IOAudioEngineChannelCategoryNames" + +/*! + * @defined kIOAudioEngineFullChannelNamesKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary of number names for each channel keyed by the device channel + * @discussion + */ +#define kIOAudioEngineFullChannelNumberNamesKey "IOAudioEngineChannelNumberNames" + +#define kIOAudioEngineFullChannelNameKeyInputFormat "InputChannel%u" + +#define kIOAudioEngineFullChannelNameKeyOutputFormat "OutputChannel%u" + +#define kIOAudioEngineFlavorKey "IOAudioEngineFlavor" + +#define kIOAudioEngineAlwaysLoadCoreAudioPlugInKey "IOAudioEngineAlwaysLoadCoreAudioPlugIn" + +/*! + * @defined kIOAudioEngineInputChannelLayoutKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary describes an array of OSNumber data that describe the spatial position of each channel. See IOAudioTypes.h. + * @discussion + */ + +#ifndef __OPEN_SOURCE__ +// +#endif +#define kIOAudioEngineInputChannelLayoutKey "IOAudioEngineInputChannelLayout" + +/*! + * @defined kIOAudioEngineOutputChannelLayoutKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary describes an array of OSNumber data that describe the spatial position of each channel. See IOAudioTypes.h. + * @discussion + */ + +#ifndef __OPEN_SOURCE__ +// +#endif +#define kIOAudioEngineOutputChannelLayoutKey "IOAudioEngineOutputChannelLayout" + +/*! + * @defined kIOAudioEngineDisableClockBoundsCheck + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary implemented as an OSBoolean that is used to disable the bounds checking on timestamps being passed to the HAL. + * @discussion By using this key and setting the value to true the driver is asserting that it guarantees that all zero timestamps passed to the HAL increment appropriately at the + correct period. This key is used to disable the HAL test that the timestamp is within 1ms of the current time, so that a driver may pass a timestamp that is more than + 1ms in the future. This may be useful when a timestamp is based on a large DMA read/write which encompasses the wrap point but occurs many samples before the end of that point. + */ +#define kIOAudioEngineDisableClockBoundsCheck "IOAudioEngineDisableClockBoundsCheck" + +/***** + * + * IOAudioStream defines + * + *****/ + + +#define kIOAudioStreamIDKey "IOAudioStreamID" +#define kIOAudioStreamDescriptionKey "IOAudioStreamDescription" +#define kIOAudioStreamNumClientsKey "IOAudioStreamNumClients" + +/*! + * @defined kIOAudioStreamDirectionKey + * @abstract The key in the IORegistry for the IOAudioStream direction attribute. + * @discussion The value for this key may be either "Output" or "Input". + */ +#define kIOAudioStreamDirectionKey "IOAudioStreamDirection" + +#define kIOAudioStreamStartingChannelIDKey "IOAudioStreamStartingChannelID" +#define kIOAudioStreamStartingChannelNumberKey "IOAudioStreamStartingChannelNumber" +#define kIOAudioStreamAvailableKey "IOAudioStreamAvailable" + +#define kIOAudioStreamFormatKey "IOAudioStreamFormat" +#define kIOAudioStreamAvailableFormatsKey "IOAudioStreamAvailableFormats" + +#define kIOAudioStreamNumChannelsKey "IOAudioStreamNumChannels" +#define kIOAudioStreamSampleFormatKey "IOAudioStreamSampleFormat" + +#define kIOAudioStreamNumericRepresentationKey "IOAudioStreamNumericRepresentation" + +#define kIOAudioStreamFormatFlagsKey "IOAudioStreamFormatFlags" +#define kIOAudioStreamFramesPerPacketKey "IOAudioStreamFramesPerPacket" +#define kIOAudioStreamBytesPerPacketKey "IOAudioStreamBytesPerPacket" + + +#define kIOAudioStreamBitDepthKey "IOAudioStreamBitDepth" +#define kIOAudioStreamBitWidthKey "IOAudioStreamBitWidth" + +#define kIOAudioStreamAlignmentKey "IOAudioStreamAlignment" + +#define kIOAudioStreamByteOrderKey "IOAudioStreamByteOrder" + +#define kIOAudioStreamIsMixableKey "IOAudioStreamIsMixable" + +#define kIOAudioStreamMinimumSampleRateKey "IOAudioStreamMinimumSampleRate" +#define kIOAudioStreamMaximumSampleRateKey "IOAudioStreamMaximumSampleRate" + +#define kIOAudioStreamDriverTagKey "IOAudioStreamDriverTag" + +#define kIOAudioStreamTerminalTypeKey "IOAudioStreamTerminalType" + +/***** + * + * IOAudioPort defines + * + *****/ + + + /*! + * @defined kIOAudioPortTypeKey + * @abstract The key in the IORegistry for the IOAudioPort type attribute. + * @discussion This is a driver-defined text attribute that may contain any type. + * Common types are defined as: "Speaker", "Headphones", "Microphone", "CD", "Line", "Digital", "Mixer", "PassThru". + */ +#define kIOAudioPortTypeKey "IOAudioPortType" + +/*! + * @defined kIOAudioPortSubTypeKey + * @abstract The key in the IORegistry for the IOAudioPort subtype attribute. + * @discussion The IOAudioPort subtype is a driver-defined text attribute designed to complement the type + * attribute. + */ +#define kIOAudioPortSubTypeKey "IOAudioPortSubType" + +/*! + * @defined kIOAudioPortNameKey + * @abstract The key in the IORegistry for the IOAudioPort name attribute. + */ +#define kIOAudioPortNameKey "IOAudioPortName" + + + +/***** + * + * IOAudioControl defines + * + *****/ + + + /*! + * @defined kIOAudioControlTypeKey + * @abstract The key in the IORegistry for the IOAudioCntrol type attribute. + * @discussion The value of this text attribute may be defined by the driver, however system-defined + * types recognized by the upper-level software are "Level", "Mute", "Selector". + */ +#define kIOAudioControlTypeKey "IOAudioControlType" + +#define kIOAudioControlSubTypeKey "IOAudioControlSubType" + +#define kIOAudioControlUsageKey "IOAudioControlUsage" + +#define kIOAudioControlIDKey "IOAudioControlID" + +/*! + * @defined kIOAudioControlChannelIDKey + * @abstract The key in the IORegistry for the IOAudioControl channel ID attribute + * @discussion The value for this key is an integer which may be driver defined. Default values for + * common channel types are provided in the following defines. + */ +#define kIOAudioControlChannelIDKey "IOAudioControlChannelID" + +#define kIOAudioControlChannelNumberKey "IOAudioControlChannelNumber" + +#define kIOAudioControlCoreAudioPropertyIDKey "IOAudioControlCoreAudioPropertyID" +/*! + * @defined kIOAudioControlChannelNameKey + * @abstract The key in the IORegistry for the IOAudioControl name attribute. + * @discussion This name should be a human-readable name for the channel(s) represented by the port. + * *** NOTE *** We really need to make all of the human-readable attributes that have potential to + * be used in a GUI localizable. There will need to be localized strings in the kext bundle matching + * the text. + */ +#define kIOAudioControlChannelNameKey "IOAudioControlChannelName" + +/*! + * @defined kIOAudioControlChannelNameAll + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for all channels. + */ +#define kIOAudioControlChannelNameAll "All Channels" + +/*! + * @defined kIOAudioControlChannelNameLeft + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the left channel. + */ +#define kIOAudioControlChannelNameLeft "Left" + +/*! + * @defined kIOAudioControlChannelNameRight + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the right channel. + */ +#define kIOAudioControlChannelNameRight "Right" + +/*! + * @defined kIOAudioControlChannelNameCenter + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the center channel. + */ +#define kIOAudioControlChannelNameCenter "Center" + +/*! + * @defined kIOAudioControlChannelNameLeftRear + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the left rear channel. + */ +#define kIOAudioControlChannelNameLeftRear "LeftRear" + +/*! + * @defined kIOAudioControlChannelNameRightRear + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the right rear channel. + */ +#define kIOAudioControlChannelNameRightRear "RightRear" + +/*! + * @defined kIOAudioControlChannelNameSub + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the sub/LFE channel. + */ +#define kIOAudioControlChannelNameSub "Sub" + +/*! + * @defined kIOAudioControlChannelNameFrontLeftCenter + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the FrontLeftCenter channel. + */ +#define kIOAudioControlChannelNameFrontLeftCenter "FrontLeftCenter" + +/*! + * @defined kIOAudioControlChannelNameFrontRightCenter + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the FrontRightCenter channel. + */ +#define kIOAudioControlChannelNameFrontRightCenter "FrontRightCenter" + +/*! + * @defined kIOAudioControlChannelNameRearCenter + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the RearCenter channel. + */ +#define kIOAudioControlChannelNameRearCenter "RearCenter" + +/*! + * @defined kIOAudioControlChannelNameSurroundLeft + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the SurroundLeft channel. + */ +#define kIOAudioControlChannelNameSurroundLeft "SurroundLeft" + +/*! + * @defined kIOAudioControlChannelNameSurroundRight + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the SurroundRight channel. + */ +#define kIOAudioControlChannelNameSurroundRight "SurroundRight" + + +/*! + * @defined kIOAudioControlValueKey + * @abstract The key in the IORegistry for the IOAudioControl value attribute. + * @discussion The value returned by this key is a 32-bit integer representing the current value of the IOAudioControl. + */ +#define kIOAudioControlValueKey "IOAudioControlValue" + +/*! + * @defined kIOAudioControlValueIsReadOnlyKey + * @abstract The key in the IORegistry for the IOAudioControl value-is-read-only attribute. + * @discussion The value returned by this key is a 32-bit integer but the value doesn't have any direct meaning. + * Instead, the presence of this key indicates that the value for the control is read-only + */ +#define kIOAudioControlValueIsReadOnlyKey "IOAudioControlValueIsReadOnly" + +/*! + * @defined kIOAudioLevelControlMinValueKey + * @abstract The key in the IORegistry for the IOAudioControl minimum value attribute. + * @discussion The value returned by this key is a 32-bit integer representing the minimum value for the IOAudioControl. + * This is currently only valid for Level controls or other driver-defined controls that have a minimum and maximum + * value. + */ +#define kIOAudioLevelControlMinValueKey "IOAudioLevelControlMinValue" + +/*! + * @defined kIOAudioLevelControlMaxValueKey + * @abstract The key in the IORegistry for the IOAudioControl maximum value attribute. + * @discussion The value returned by this key is a 32-bit integer representing the maximum value for the IOAudioControl. + * This is currently only valid for Level controls or other driver-defined controls that have a minimum and maximum + * value. + */ +#define kIOAudioLevelControlMaxValueKey "IOAudioLevelControlMaxValue" + +/*! + * @defined kIOAudioLevelControlMinDBKey + * @abstract The key in the IORgistry for the IOAudioControl minimum db value attribute. + * @discussion The value returned by this key is a fixed point value in 16.16 format represented as a 32-bit + * integer. It represents the minimum value in db for the IOAudioControl. This value matches the minimum + * value attribute. This is currently valid for Level controls or other driver-defined controls that have a + * minimum and maximum db value. + */ +#define kIOAudioLevelControlMinDBKey "IOAudioLevelControlMinDB" + +/*! + * @defined kIOAudioLevelControlMaxDBKey + * @abstract The key in the IORgistry for the IOAudioControl maximum db value attribute. + * @discussion The value returned by this key is a fixed point value in 16.16 format represented as a 32-bit + * integer. It represents the maximum value in db for the IOAudioControl. This value matches the maximum + * value attribute. This is currently valid for Level controls or other driver-defined controls that have a + * minimum and maximum db value. + */ +#define kIOAudioLevelControlMaxDBKey "IOAudioLevelControlMaxDB" + +#define kIOAudioLevelControlRangesKey "IOAudioLevelControlRanges" + +#define kIOAudioLevelControlUseLinearScale "IOAudioLevelControlUseLinearScale" + +#define kIOAudioSelectorControlAvailableSelectionsKey "IOAudioSelectorControlAvailableSelections" +#define kIOAudioSelectorControlSelectionValueKey "IOAudioSelectorControlSelectionValue" +#define kIOAudioSelectorControlSelectionDescriptionKey "IOAudioSelectorControlSelectionDescriptionKey" +#define kIOAudioSelectorControlTransportValueKey "IOAudioSelectorControlTransportValue" // + +#define kIOAudioSelectorControlClockSourceKey "IOAudioSelectorControlClockSourceKey" + + +#endif /* _IOAUDIODEFINES_H */ diff --git a/QualcommWireless/include/IOKit/audio/IOAudioDevice.h b/QualcommWireless/include/IOKit/audio/IOAudioDevice.h new file mode 100644 index 0000000..8e73e5b --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioDevice.h @@ -0,0 +1,771 @@ +/* + * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOAudioDevice + */ + +#ifndef _IOKIT_IOAUDIODEVICE_H +#define _IOKIT_IOAUDIODEVICE_H + +#include +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#include +#else +#include "IOAudioTypes.h" +#include "IOAudioStream.h" +#endif + +class IOAudioEngine; +class IOAudioStream; +class IOAudioPort; +class IOAudioControl; +class OSDictionary; +class OSSet; +class OSArray; +class IOTimerEventSource; +class IOCommandGate; + +/*! + * @enum IOAudioDevicePowerState + * @abstract Identifies the power state of the audio device + * @discussion A newly created IOAudioDevices defaults to the idle state. + * @constant kIOAudioDeviceSleep State set when the system is going to sleep + * @constant kIOAudioDeviceIdle State when the system is awake but none of the IOAudioEngines are in use + * @constant kIOAudioDeviceActive State when one ore more IOAudioEngines are in use. This state transition must complete before the system will begin playing audio. + */ +typedef enum _IOAudioDevicePowerState { + kIOAudioDeviceSleep = 0, // When sleeping + kIOAudioDeviceIdle = 1, // When no audio engines running + kIOAudioDeviceActive = 2 // audio engines running +} IOAudioDevicePowerState; + +/*! + * @class IOAudioDevice + * @abstract Abstract base class for a single piece of audio hardware. The IOAudioDevice provides + * the central coordination point for an audio driver. + * @discussion An audio driver is required to subclass IOAudioDevice in order to provide + * working audio to the system. A single driver instance will contain a single instance of the + * driver's IOAudioDevice subclass. The subclass is responsible for mapping all hardware device + * resources from the service provider nub. It must control access to the hardware so that the + * hardware doesn't get into an inconsistent state. It is possible that different threads may make + * requests of the hardware at the same time. The IOAudioDevice superclass provides an IOWorkLoop + * and IOCommandGate on the IOWorkLoop through which all hardware accesses may be synchronized. + * All entry points to all parts of the driver controlled by the IOAudioFamily will be synchronized + * through this one IOWorkLoop. + * + * The IOAudioDevice subclass is responsible for creating the rest of the pieces of the driver. + * It must identify and create all IOAudioEngines that are not automatically created by the system + * (i.e. those that are not matched and instantiated by IOKit directly). + * + * The IOAudioDevice subclass must enumerate and create all IOAudioControls to match + * the device capabilities. + * + * It must also execute control value chages when requested by the system (i.e. volume adjustments). + * + * In order to allow sleep and wake to work on the system, the IOAudioDevice subclass is responsible + * for performing the necessary actions to sleep and wake its hardware (and restore necessary state + * on wake). + * + * The IOAudioDevice class provides timer services that allow different elements in the audio driver + * to receive timer notifications as needed. These services were designed with the idea that most + * timed events in a typical audio driver need to be done at least as often as a certain interval. + * Further, it is designed with the idea that being called more often than the specified interval + * doesn't hurt anything - and in fact may help. With this in mind, the timer services provided + * by the IOAudioDevice class allow different targets to register for timer callbacks at least as + * often as the specified interval. The actual interval will be the smallest of the intervals of + * all of the callbacks. This way, we avoid the overhead of having many timers in a single audio + * device. As an example, each output IOAudioEngine has a timer to run the erase head. It doesn't hurt + * to have the erase head run more often. Also, a typical IOAudioDevice subclass may need to run a timer + * to check for device state changes (e.g. jack insertions). + * + * There are a number of strings passed from the driver to the CoreAudio.framework and then into + * applications. All of those strings should be localized by the driver. In order to do that + * the kext bundle should have localized string files following the Mac OS X localization + * instructions. The IOAudioDevice should contain a property with the name of the bundle/kext + * that contains the localized string resources. To do that, the driver's personality in + * the bundle resources could have a property named 'IOAudioDeviceLocalizedBundle' with the path + * of the bundle/kext relative to '/System/Library/Extensions'. It could also be set by the + * IOAudioDevice subclass in its initHardware() function. To do so, call + * setProperty(kIOAudioDeviceLocalizedBundleKey, "Driver.kext"). + * + * In a typical driver, the IOAudioDevice subclass will implement initHardware() to perform the + * hardware initialization and driver construction. Within that initialization it must create at + * least one IOAudioEngine instance and activate it. In order to activate a new IOAudioEngine + * activateAudioEngine() should be called for each one. It must create the IOAudioControls + * matching the hardware capabilities to allow the system to set volume, mute and input selection. + * To add those controls to the driver, each control should be attached to the IOAudioEngine to + * which it applies by calling addDefaultAudioControl() on the IOAudioEngine. + * During initialization it should also call setDeviceName(), setDeviceShortName() and + * setManufacturerName() with localized strings representing each of the attributes. + * + * If the driver is to work properly after sleep/wake, it must implement performPowerStateChange() + * and deal with the sleep and wake transitions. It may also deal with the idle state transitions + * to turn off device power when it isn't in use (especially useful for devices attached to a + * portable running on battery power). + */ + +#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED + #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 + #warning IOAudioDevice is deprecated use instead. + #endif +#endif + +class IOAudioDevice : public IOService +{ + friend class IOAudioEngine; + + OSDeclareDefaultStructors(IOAudioDevice) + +protected: + /*! @var workLoop The IOWorkLoop for the driver - this is shared with the other objects in the driver */ + IOWorkLoop *workLoop; + /*! @var commandGate The IOCommandGate for this IOAudioDevice. It is attached to workLoop */ + IOCommandGate *commandGate; + /*! @var timerEventSource An IOTimerEventSource attached to workLoop used for the timer services */ + IOTimerEventSource *timerEventSource; + + /*! @var duringStartup State variable set to true while the driver is starting up and false all other times */ + bool duringStartup; + /*! @var familyManagePower Set to true if the family is supposed to manage power - this is the default state. It can be changed early in the initialization process with a call to setFamilyManagePower(). */ + bool familyManagePower; + /*! @var asyncPowerStateChangeInProgress Set to true while an asynchronous power change is pending and false all other times. */ + bool asyncPowerStateChangeInProgress; + + /*! @var numRunningAudioEngines The number of running IOAudioEngines. This is used to maintain idle vs active power state. */ + UInt32 numRunningAudioEngines; + + /*! @var currentPowerState Used to track the existing power state - can be fetched by calling getPowerState() */ + IOAudioDevicePowerState currentPowerState; + /*! @var pendingPowerState If a power state change is in progress, this represents the pending power state. All other times this is the same as the currentPowerState. */ + IOAudioDevicePowerState pendingPowerState; + + /*! @var audioEngines The set of IOAudioEngine objects vended by the IOAudioDevice. */ + OSArray * audioEngines; + /*! @var timerEvents + * @abstract The set of timer events in use by the device. + * @discussion The key for the dictionary is the target of the event. This means that a single target may + * have only a single event associated with it. + */ + OSDictionary * timerEvents; + /*! @var audioPorts The set of IOAudioPort objects associated with the IOAudioDevice */ + OSSet * audioPorts; + + /*! @var minimumInterval The smallest timer interval requested by all timer event targets. */ + AbsoluteTime minimumInterval; + /*! @var previousTimerFire The time of the last timer event. + * @discussion This is used to schedule the next timer event. + */ + AbsoluteTime previousTimerFire; + +public: + /*! @var gIOAudioPlane + * A static IORegistryPlane representing the new IOAudioPlane that the IOAudioFamily uses + * to represent the signal chain of the device. + */ + static const IORegistryPlane *gIOAudioPlane; + +protected: + struct ExpansionData { + unsigned long long idleSleepDelayTime; + IOTimerEventSource * idleTimer; + }; + + ExpansionData *reserved; + +public: + static void idleAudioSleepHandlerTimer(OSObject *owner, IOTimerEventSource *sender ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn setAggressiveness(unsigned long type, unsigned long newLevel ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 0); + virtual void setDeviceTransportType(const UInt32 transportType ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 1); + /*! + * @function setIdleAudioSleepTime + * @abstract This function is to be called by a driver that doesn't want to be told about the audio + * going idle immediately, but at some point in the future. + * @discussion This is useful if the device will want to power down its hardware into an idle sleep + * state, but doesn't want to do that unless audio hasn't been used for a while. Calling this function + * immediately changes the idle sleep timer and queues it up if the idle is different from the previous + * idle time. The idle time defaults to 0, which means be called immediately (backwards compatible with + * previous versions of IOAudioFamily). A value of 0xffffffffffffffffULL means don't ever tell the + * driver about going idle. + * @param sleepDelay The amount of time, in nanoseconds, before the hardware should be told to go idle. + */ + virtual void setIdleAudioSleepTime(unsigned long long sleepDelay ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 2); + virtual void scheduleIdleAudioSleep(void ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 3); + /*! + * @function setConfigurationApplicationBundle + * @abstract This function is to be called if an external configuration application is available to set + * which application to launch. + * @discussion This is useful for device drivers that are too complex to be represented by the Sound Preferences + * panel. The bundle ID is a more flexible way of specifying where the application is than a hard coded path. + * @param bundleID The bundle ID of the application to be launched by the HAL for configuration of the device and its engine(s). + */ + virtual void setConfigurationApplicationBundle(const char *bundleID ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 4); + /*! + * @function setDeviceCanBeDefault + * @abstract This function is to be called to tell CoreAudio if this device shouldn't be a default device. + * @discussion This is useful for device drivers that don't want to be a default device. Can be called with + * kIOAudioDeviceCanBeDefaultNothing to prevent CoreAudio from allowing this device to be any default device, or it + * can be called with any combination of kIOAudioDeviceCanBeDefaultInput, kIOAudioDeviceCanBeDefaultOutput, or + * kIOAudioDeviceCanBeSystemOutput. The default is + * (kIOAudioDeviceCanBeDefaultInput | kIOAudioDeviceCanBeDefaultOutput | kIOAudioDeviceCanBeSystemOutput). + * @param defaultsFlags The flags to instruct CoreAudio to allow this device to be only the indicated default devices. + */ + virtual void setDeviceCanBeDefault(UInt32 defaultsFlags ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 5); + virtual void setDeviceModelName(const char * modelName ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +private: + OSMetaClassDeclareReservedUsed(IOAudioDevice, 0); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 1); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 2); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 3); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 4); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 5); + + OSMetaClassDeclareReservedUnused(IOAudioDevice, 6); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 7); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 8); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 9); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 10); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 11); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 12); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 13); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 14); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 15); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 16); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 17); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 18); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 19); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 20); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 21); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 22); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 23); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 24); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 25); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 26); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 27); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 28); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 29); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 30); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 31); + + +public: + // Initialization + + /*! + * @function init + * @abstract Initialize a newly created instance of IOAudioDevice. + * @discussion This implementation initializes all of the data structures and variables used by the + * IOAudioDevice. The currentPowerState and pendingPowerState variables are set to kIOAudioDeviceIdle. + * A subclass that overrides this method must call the superclass' implementation. + * @param properties + * An OSDictionary of the device properties that gets passed to super::init and set + * in the IORegistry. + * @result true if initialization was successful + */ + virtual bool init(OSDictionary *properties ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function free + * @abstract Frees resources used by the IOAudioDevice instance + * @discussion This method will deactivate all audio audio engines and release the audioEngines OSSet. + * It will also deactivate all of the audio ports and release the audioPorts OSSet. It will release + * the timerEvents OSDictionary as well as cancel any outstanding timer callbacks. It will clean up + * all of the event sources and the workLoop. + * + * Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + + virtual void free( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function start + * @abstract This function is called automatically by the system to tell the driver to start vending + * services to the rest of the system. + * @discussion The start() implementation in IOAudioDevice starts by calling start() on its superclass. + * It then calls initHardware() which the subclass should override to properly initialize itself and + * the hardware. If that call succeeds, it sets up power management if the family is supposed to + * manage power (checking the familyManagePower variable). Then finally it calls registerService() + * to make the IOAudioDevice visible in the IORegistry. + * @param provider + * This is the service provider nub that provides access to the hardware resources. + * @result Returns true on success + */ + virtual bool start(IOService *provider ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function stop + * @abstract This is responsible for stopping the device after the system is done with it (or + * if the device is removed from the system). + * @discussion The IOAudioDevice implentation of stop() disables the timer services, deactivates + * all of the audio audio engines and audio ports and stops power management of the device. + * The audio engine and port deactivation causes all of the audio engines to get stopped and + * all of the audio engine and port resources and objects to be released. A subclass' implementation + * may could shut down hardware here if necessary. If this function is overridden by a subclass, + * the superclass' implementation must be called. + * @param provider + * The service provider nub for the device. + */ + virtual void stop(IOService *provider ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual bool willTerminate(IOService *provider, IOOptionBits options ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function initHardware + * @abstract This function is called by start() to provide a convenient place for the subclass to + * perform its initialization. + * @discussion In a typical implementation, a driver would implementation this function and perform + * a number of tasks. Those include mapping hardware resources, initializing the hardware to a known + * state, creating the IOAudioEngines, IOAudioControls and IOAudioStreams. Additionally it + * should also call setDeviceName(), setDeviceShortName(), setManufacturerName(). Upon return of + * this function, the device should be ready to begin vending services to the system. + * @param provider + * The service provider nub for the device. + * @result This function should return true on a successful initialization. + */ + virtual bool initHardware(IOService *provider ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setDeviceName + * @abstract Sets the name of the device + * @discussion This method should be called during initialization or startup. It should + * be set by the time initHardware() completes. The device name is used by the + * CoreAudio.framework to identify the particular piece of hardware. This string should + * should be localized by the driver. + */ + virtual void setDeviceName(const char *deviceName ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setDeviceShortName + * @abstract Sets the short name of the device + * @discussion The short name is a shorter representation of the device name. It may be used + * by applications when the device name is too long. It should be set by the time initHardware() + * completes. The string should be localized by the driver. + */ + virtual void setDeviceShortName(const char *shortName ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setManufacturerName + * @abstract Sets the manufacturer name of the device + * @discussion This method should be called during initialization or startup. This should be + * called by the time initHardware() completes. The string should be localized by the driver. + */ + virtual void setManufacturerName(const char *manufacturerName ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + + // IOWorkLoop, IOCommandGate management + + /*! + * @function getWorkLoop + * @abstract Returns the IOWorkLoop for the driver + * @discussion The IOWorkLoop is used to synchronized all critical aspects of the driver. This + * includes all entry points to the driver as well as power management. + */ + virtual IOWorkLoop *getWorkLoop() const AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getCommandGate + * @abstract Returns the IOCommandGate for this IOAudioDevice + * @discussion This IOCommandGate allows calls into this IOAudioDevice to be synchronized on + * the IOWorkLoop. + */ + virtual IOCommandGate *getCommandGate() const AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + + // IOAudioEngine management + + /*! + * @function activateAudioEngine + * @abstract This simply calls activateAudioEngine(IOAudioEngine *audioEngine, + * bool shouldStartAudioEngine) with a value of true for shouldStartAudioEngine. + * @param audioEngine + * The IOAudioEngine instance to be activated. It is treated as a newly + * allocated instance. + * @result Returns true if the audio engine was successfully activated. + */ + virtual IOReturn activateAudioEngine(IOAudioEngine *audioEngine ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function activateAudioEngine + * @abstract This is called to add a new IOAudioEngine object to the IOAudioDevice. + * @discussion Once the IOAudioEngine has been activated by this function, it is ready + * to begin moving audio data. This should be called either during the subclass' initHardware() + * implementation for each IOAudioEngine the device creates. Or it should be called by + * the IOAudioEngine itself if the audio engine was automatically created by IOKit's matching + * process. The system won't be able to properly track and control IOAudioEngines if + * they are not activated though this function. + * This implementation will retain the IOAudioEngine while it maintains control of it. + * When the audio engine is deactivated, the IOAudioEngine will be released. If the + * IOAudioDevice subclass is passing a newly instantiated IOAudioEngine, it will need to release + * the audio engine after it has been activated. This will insure that the refCount on the audio engine + * is correct when it gets deactivated when the driver is stopped. That allows the audio engine to be + * freed when it is no longer needed. + * @param audioEngine + * The IOAudioEngine instance to be activated. + * @param shouldStartAudioEngine + * If true, the audio engine is treated as a newly allocated IOAudioEngine + * instance and is appropriately attached and started according to IOKit convention. If it is false + * it is assumed that some other process (possibly the IOKit matching process) has started the + * IOAudioEngine and will skip that step. + * @result Returns true if the audio engine was successfully activated. + */ + virtual IOReturn activateAudioEngine(IOAudioEngine *audioEngine, bool shouldStartAudioEngine ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function deactivateAllAudioEngines + * @abstract Deactivates all of the audio engines in the device. + * @discussion This is called by the stop() and free() methods in IOAudioDevice to completely + * shut down all audio engines as the driver is being shut down. + */ + virtual void deactivateAllAudioEngines( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + + // Power management + + /*! + * @function setFamilyManagePower + * @abstract Called set whether or not the family should manage the device power throught the + * IOService power management APIs. + * @discussion The default behavior is for the family to manage power. It is only necessary to + * call this function if the driver does not want the family to manage power. It is not + * recommended that this function be called because it makes power management much more + * difficult for the driver. If this function is to be called, it must be called before + * initHardware() completes. Immediately after initHardware() is called by start(), + * the power management system is initialized if the family is to manage power. + * @param manage Set to false if it is not desired that the family does the power management + */ + virtual void setFamilyManagePower(bool manage ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setPowerState + * @abstract Called by the power management system in IOService when the power state of this + * service needs to change. + * @discussion The default implementation of IOAudioDevice sets up two power states for IOService + * to use. State 0 is sleep and state 1 is wake. This function should not be called directly. + * It is only supposed to be used by the IOService power management services. + * @param powerStateOrdinal + * The number of the power state as defined by the IOAudioDevice - + * 0 for sleep, 1 for wake. + * @param device The power management policy maker. + * @result Returns kIOPMAckImplied (0) when the power state change is complete. Otherwise the an + * upper bound on the number of microseconds until the state change is complete is returned. + */ + virtual IOReturn setPowerState(unsigned long powerStateOrdinal, IOService *device ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setPowerStateAction + * @abstract IOCommandGate Action which calls protectedSetPowerState() while holding the IOCommandGate + * @discussion This is needed to allow protectedSetPowerState() to be called on the IOWorkLoop + * @param owner The owner of the IOCommandGate (the IOAudioDevice in this case) + * @param arg1 The powerStateOrdinal to be passed to protectedSetPowerState() + * @param arg2 The device to be passed to protectedSetPowerState() + * @result Returns the result of protectedSetPowerState() + */ + static IOReturn setPowerStateAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOReturn _setPowerStateAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + + /*! + * @function protectedSetPowerState + * @abstract Called by setPowerStateAction() to deal with a power state change from the IOService + * power management facility. + * @discussion This function is responsible for performing the necessary sleep and wake tasks + * when the system is sleeping or waking. If an outstanding power state change is in progress, + * it will wait until the state changes has completed. While sleeping, all audio engines are + * stopped before calling initiatePowerStateChange() to call performPowerStateChange() to let + * the driver deal with the sleep request. When waking, it determines if the device should be + * idle or active and continues to call initiatePowerStateChange(). If initiatePowerStateChange() + * indicates that the power state change is occuring asynchronously, it returns the number of + * microseconds. This function must be called on the IOWorkLoop, but should not be called + * directly. + * @param powerStateOrdinal Param passed to setPowerState() - 0 for sleep, 1 for wake + * @param device Param passed to setPowerState - the device initiating the power state change + * @result Returns 0 if the power state change is complete - the number of microseconds until + * complete if its asynchronous. + */ + virtual IOReturn protectedSetPowerState(unsigned long powerStateOrdinal, IOService *device ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function performPowerStateChange + * @abstract This function is called by the IOAudioDevice when a power state change is needed. + * @discussion In order to deal with power state changes, a subclass must override this function. + * Any combination of old and new power states may be passed to this function. If work is to + * be performed while transitioning to sleep, check for a newPowerState of kIOAudioDeviceSleep. + * If work is to be performed while transitioning from sleep, check for an oldPowerState of + * kIOAudioDeviceSleep. A power state of kIOAudioDeviceIdle means the system is awake, but + * no clients are currently playing or recording audio (i.e. no IOAudioEngines are active). + * A power state of kIOAudioDeviceActive means that at least one IOAudioEngine is active. + * It is possible for a power state change to be performed synchronously or asynchronously. + * In the case of a synchronous power state change, simple leave microsecondsUntilComplete + * alone and return kIOReturnSuccess. If an asynchronous power state change is needed the + * driver should do whatever needed to schedule another thread to finish the state change + * and set the microsecondsUntilComplete to an upper bound on the amount of time it will + * take to complete the power state change. Then when the power state change is complete, + * a call must be made to completePowerStateChange(). During an asynchronous power state + * change, the current power state will remain the same as before the transition began, + * and the pendingPowerState is set to the new power state that will be set when the + * change is complete. + * @param oldPowerState The power state before the power state change + * @param newPowerState The power state being transitioned to + * @param microsecondsUntilComplete + * A pointer to a value representing an upper bound on + * the number of microseconds to complete an asynchronous power state change. It points + * to a value of zero at the start and if it remains zero, the state change is complete + * upon a successful return from the function. + * @result Returns kIOReturnSuccess on a successful completion + */ + virtual IOReturn performPowerStateChange(IOAudioDevicePowerState oldPowerState, + IOAudioDevicePowerState newPowerState, + UInt32 *microsecondsUntilComplete ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function completePowerStateChange + * @abstract Called when a power state change is complete + * @discussion In the case of an asynchronous power state change, a subclass is responsible + * for calling this function. It is safe to call this function if not on the IOWorkLoop. + * This function calls protectedCompletePowerStateChange() through the IOCommandGate and + * completePowerStateChangeAction(). If the call is already on the IOWorkLoop, it is safe + * to call protectedCompletePowerStateChange() directly. + * @result Returns kIOReturnSuccess on a successful completion + */ + virtual IOReturn completePowerStateChange( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function completePowerStateChangeAction + * @abstract IOCommandGate Action which calls protectedCompletePowerStateChange() while holding the + * IOCommandGate. + * @discussion This is needed to allow protectedCompletePowerStateChange() to be called on the IOWorkLoop. + * @param owner The owner of the IOCommandGate (the IOAudioDevice in this case) + * @result Returns the result of protectedCompletePowerStateChange() + */ + static IOReturn completePowerStateChangeAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function protectedCompletePowerStateChange + * @abstract Called on the IOWorkLoop when a power state change is complete. + * @discussion This function does the work to complete a power state change (both synchronous and + * asynchronous). If the system is waking from sleep, the timer system is restarted and the + * audio engines are resumed. If this was called as a result of an asynchronous power state changed + * it makes the IOService power management call acknowledgePowerChange() and resets the + * asyncPowerStateChangeInProgress variable. Finally it sets the currentPowerState to the + * pendingPowerState. This function must be called on the IOWorkLoop. If a subclass is not + * on the IOWorkLoop (e.g. holding the IOCommandGate), call completePowerStateChange() instead. + * @result Returns kIOReturnSuccess on success + */ + virtual IOReturn protectedCompletePowerStateChange( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getPowerState + * @abstract Returns the current power state (the old power state if a change is in progress). + * @result The current power state + */ + virtual IOAudioDevicePowerState getPowerState( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getPendingPowerState + * @abstract Returns the pending power state if a state change is in progress. Otherwise it + * returns the current power state change. + * @result The pending power state + */ + virtual IOAudioDevicePowerState getPendingPowerState( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function waitForPendingPowerStateChange + * @abstract Called internally to wait until a pending power state change is complete. + * @discussion This is only used by internal functions to wait during pending power + * state changes. It is used to prevent multiple power state changes at the same time. + * This function must be called while holding the IOCommandGate. If an asynchronous + * power state change is in progress this function will block until the state change + * if complete. Once complete, it will return while still holding the IOCommandGate. + */ + virtual void waitForPendingPowerStateChange( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function initiatePowerStateChange + * @abstract Called internally to execute a power state change + * @discussion This function must be called on the IOWorkLoop. It calls performPowerStateChange() + * to let the driver process the state change. If the state change is completed synchronously + * by the driver (subclass) it calls protectedCompletePowerStateChange(). If done asynchronously + * it returns the microsecondsUntilComplete that was set by performPowerStateChange(). This + * function should not be called directly. + * @param microsecondsUntilComplete + * Pointer to the microsecondsUntilComplete that should be set + * by performPowerStateChange if an asynchronous power state change was started. + * @result Returns kIOReturnSuccess on success + */ + virtual IOReturn initiatePowerStateChange(UInt32 *microsecondsUntilComplete = NULL ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + + // IOAudioControl management + + /*! + * @function flushAudioControls + * @abstract Forces each IOAudioControl in the driver to have its value flushed out to the hardware. + * That will cause either the IOAudioControl's ValueChangeHandler to be called. + * @discussion This can be used to force the hardware to get updated with the current value + * of each control. It may be useful during wake for example. + */ + virtual void flushAudioControls( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + + // Timer services + + /*! + * @typedef TimerEvent + * @abstract Generic timer event callback for IOAudioDevice timer targets + * @discussion TimerEvent callback function takes two arguments; the target of + * the timer event and the IOAudioDevice sending the event. + * @param target The target of the timer event - passed in when the timer event was registered + * @param audioDevice The IOAudioDevice sending the event + */ + typedef void (*TimerEvent)(OSObject *target, IOAudioDevice *audioDevice ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function addTimerEvent + * @abstract Adds a TimerEvent callback for the given target called at least as often + * as specified in interval. + * @discussion The frequency of the timer event callbacks will be the smallest interval + * specified by all targets. Only one interval and callback may be specified per target. + * If a addTimerEvent is called twice with the same target, the second one overrides the + * first. There is currently a bug triggered if the first call had the smallest interval. + * In that case, that smallest interval would still be used. + * @param target This parameter is the target object of the TimerEvent. + * @param event The callback function called each time the timer fires. + * @param interval The callback will be called at least this often. + * @result Returns kIOReturnSuccess if the timer event was successfully added. + */ + virtual IOReturn addTimerEvent(OSObject *target, TimerEvent event, AbsoluteTime interval ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function removeTimerEvent + * @abstract Removes the timer event for the given target. + * @discussion If the interval for the target to be removed is the smallest interval, + * the timer interval is recalculated based on the remaining targets. The next fire + * time is readjusted based on the new interval compared to the last fire time. + * @param target The target whose timer event will be removed. + */ + virtual void removeTimerEvent(OSObject *target ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function removeAllTimerEvents + * @abstract Removes all timer events and stops the timer + * @discussion Called during teardown of the driver + */ + virtual void removeAllTimerEvents( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + + // IOAudioPort management + + /*! + * @function attachAudioPort + * @abstract Adds the port to the IOAudioDevice's list of ports and attaches the port to its parent + * and attaches the child to the port. + * @discussion This function provides the functionality to represent the device's signal chain in the + * IOAudioPlane in the IORegistry. An IOAudioPort's parent(s) are before it in the signal chain + * and its children are after it. This method may be called multiple times for a single IOAudioPort. + * This is necessary when there are many children or parents. Once a relationship is made, it is not + * necessary to make the reverse relationship. A NULL value may be passed in for either the parent + * or child or both. + * The IOAudioPort passed in should be a newly allocated IOAudioPort instance. This function will + * appropriately attach and start the port object. NOTE: It is not necessary to use IOAudioPorts + * in a fully functional audio driver. + * @param port The newly created IOAudioPort instance to be activated. + * @param parent A parent IOAudioPort or IOAudioEngine of the given port. + * @param child A child IOAudioPort or IOAudioEngine of the given port. + * @result Returns true when the port has been successfully added and attached. + */ + virtual IOReturn attachAudioPort(IOAudioPort *port, IORegistryEntry *parent, IORegistryEntry *child ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function detachAllAudioPorts + * @abstract Deactivates all of the ports in the device. + * @discussion This is called by the stop() and free() methods in IOAudioDevice to completely + * shut down all ports as the driver is being shut down. + */ + virtual void detachAllAudioPorts( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +protected: + /*! + * @function timerFired + * @abstract Internal static function called when the timer fires. + * @discussion This function simply calls dispatchTimerEvents() on the IOAudioDevice to do just that. + * @param target The IOAudioDevice instance that initiated the timer callback. + * @param sender The IOTimerEventSources calling this callback + */ + static void timerFired(OSObject *target, IOTimerEventSource *sender ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function dispatchTimerEvents + * @abstract Called by timerFired() to cause the timer event callbacks to be called. + * @discussion This method iterates through all of the timer event targets and calls + * the callback on each. Unless the force flag is set to true, the timer events will + * only be dispatched if the power state is not kIOAudioDeviceSleep. This prevents + * unexpected timer firings while making wake->sleep->wake transitions. This function must + * be called on the IOWorkLoop. + * @param force + * A bool param to allow the timer events to be dispatched even if the + * device is in the kIOAudioDeviceSleep power state. + */ + virtual void dispatchTimerEvents(bool force ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function audioEngineStarting + * @abstract Called by IOAudioEngine when it is starting up + * @discussion This should only be called while on the IOWorkLoop. It is not intended to be called + * directly. It is called when an IOAudioEngine is starting up to allow the IOAudioDevice + * to keep track of running audio engines and change the power state from kIOAudioDeviceIdle to + * kIOAudioDeviceActive when the first audio engine starts up. If the state change is done + * asynchronously, it waits for the state change to complete. This is to ensure that the + * system doesn't start playing audio until the IOAudioDevice has completed its transition + * to kIOAudioDeviceActive. + */ + virtual void audioEngineStarting( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function audioEngineStopped + * @abstract Called by IOAudioEngine when it has stopped + * @discussion This should only be called while on the IOWorkLoop. It is not intended to be called + * directly. It is called when an IOAudioEngine has stopped to allow the IOAudioDevice + * to keep track of running audio engines and change the power state from kIOAudioDeviceActive + * to kIOAudioDeviceIdle when the last audio engine stops. If the state change is done + * asynchronously, it waits for the state change to complete. + */ + virtual void audioEngineStopped( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +}; + +#endif /* _IOKIT_IOAUDIODEVICE_H */ diff --git a/QualcommWireless/include/IOKit/audio/IOAudioEngine.h b/QualcommWireless/include/IOKit/audio/IOAudioEngine.h new file mode 100644 index 0000000..29015ce --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioEngine.h @@ -0,0 +1,878 @@ +/* + * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOAudioEngine + */ + +#ifndef _IOKIT_IOAUDIOENGINE_H +#define _IOKIT_IOAUDIOENGINE_H + +#include +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioTypes.h" +#endif +#include + +class OSDictionary; +class OSCollection; +class OSOrderedSet; +class IOAudioEngineUserClient; +class IOAudioDevice; +class IOAudioStream; +class IOAudioControl; +class IOCommandGate; + +#define IOAUDIOENGINE_DEFAULT_NUM_ERASES_PER_BUFFER 4 + +/*! + * @typedef IOAudioEnginePosition + * @abstract Represents a position in an audio audio engine. + * @discussion This position is based on the sample frame within a + * loop around the sample buffer, and the loop count which starts at 0 when the audio engine + * begins playback. + * @field fSampleFrame The sample frame within the buffer - starts at 0. + * @field fLoopCount The number of times the ring buffer has looped. + */ +typedef struct { + UInt32 fSampleFrame; + UInt32 fLoopCount; +} IOAudioEnginePosition; + +#define CMP_IOAUDIOENGINEPOSITION(p1, p2) \ + (((p1)->fLoopCount > (p2)->fLoopCount) ? 1 : \ + ((p1)->fLoopCount == (p2)->fLoopCount) && ((p1)->fSampleFrame > (p2)->fSampleFrame) ? 1 : \ + ((p1)->fLoopCount == (p2)->fLoopCount) && ((p1)->fSampleFrame == (p2)->fSampleFrame) ? 0 : -1) + +#define IOAUDIOENGINEPOSITION_IS_ZERO(p1) (((p1)->fLoopCount == 0) && ((p1)->fSampleFrame == 0)) + +/*! + * @class IOAudioEngine + * @abstract Abstract base class for a single audio audio / I/O engine. + * @discussion An IOAudioEngine is defined by a single I/O engine to transfer data to + * or from one or more sample buffers. Each sample buffer is represented by a single IOAudioStream + * instance. A single IOAudioEngine must contain at least one IOAudioStream, but has no upper + * limit on the number of IOAudioStreams it may contain. An IOAudioEngine instance may contain + * both input and output IOAudioStreams. + * + * An audio driver must subclass IOAudioEngine in order to provide certain services. An + * IOAudioEngine subclass must start and stop the I/O engine when requested. The I/O + * engine should be continuously running and loop around from end to beginning. While the audio + * engine is running, it must take a timestamp as the sample buffer(s) wrap around and start at + * the beginning. The CoreAudio.framework uses the timestamp to calculate the exact position of + * the audio engine. An IOAudioEngine subclass must implement getCurrentSampleFrame() to provide + * a sample position on demand. Finally, an IOAudioEngine subclass must provide clipping and + * format conversion routines to go to/from the CoreAudio.framework's native float format. + * + * If multiple stream formats or sample rates are allowed, the IOAudioEngine + * subclass must provide support for changing the hardware when a format or sample rate is + * changed. + * + * There are several attributes associated with a single IOAudioEngine: + * + * The IOAudioEngine superclass provides a shared status buffer that contains all of the dynamic pieces + * of information about the audio engine (type IOAudioEngineStatus). It runs an erase process on + * all of the output streams. The erase head is used to zero out the mix and sample buffers after + * the samples have been played. Additionally, the IOAudioEngine superclass handles the + * communication with the CoreAudio.framework and makes the decision to start and stop the + * audio engine when it detects it is in use. + * + * In order for an audio device to play back or record sound, an IOAudioEngine subclass must be created. + * The subclass must initialize all of the necessary hardware resources to prepare for starting the + * audio I/O engine. It typically will perform these tasks in the initHardware() method. A subclass + * may also implement a stop() method which is called as the driver is being torn down. This is + * typically called in preparation of removing the device from the system for removable devices. + * + * In addition to initializing the necessary hardware, there are a number of other tasks an + * IOAudioEngine must do during initHardware(). It must create the necessary IOAudioStream objects + * to match the device capabilities. Each IOAudioStream must be added using addAudioStream(). It + * also should create the IOAudioControls needed to control the various attributes of the audio engine: + * output volume, mute, input gain, input selection, analog passthru. To do that, addDefaultAudioControl() + * should be called with each IOAudioControl to be attached to the IOAudioEngine. In order to provide + * for proper synchronization, the latency of the audio engine should be specified with setSampleLatency(). + * This value represents the latency between the timestamp taken at the beginning of the buffer and + * when the audio is actually played (or recorded) by the device. If a device is block based or if + * there is a need to keep the CoreAudio.framework a certain number of samples ahead of (or behind for + * input) the I/O head, that value should be specified using setSampleOffset(). If this is not specified + * the CoreAudio.framework may attempt to get as close to the I/O head as possible. + * + * The following fields in the shared IOAudioEngineStatus struct must be maintained by the subclass + * implementation: + *
+ *    fCurrentLoopCount - the number of times the sample buffer has wrapped around to the beginning
+ *    fLastLoopTime - timestamp of the most recent time that the I/O engine looped back to the 
+ *  beginning of the sample buffer
+ *  
+ * It is critically important that the fLastLoopTime field be as accurate as possible. It is + * the basis for the entire timer and synchronization mechanism used by the audio system. + * + * At init time, the IOAudioEngine subclass must call setNumSampleFramesPerBuffer() to indicate how large + * each of the sample buffers are (measured in sample frames). Within a single IOAudioEngine, all sample + * buffers must be the same size and be running at the same sample rate. If different buffers/streams can + * be run at different rates, separate IOAudioEngines should be used. The IOAudioEngine subclass must + * also call setSampleRate() at init time to indicate the starting sample rate of the device. + * + */ + +#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED + #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 + #warning IOAudioEngine is deprecated use instead. + #endif +#endif + +class IOAudioEngine : public IOService +{ + OSDeclareAbstractStructors(IOAudioEngine) + + friend class IOAudioEngineUserClient; + friend class IOAudioDevice; + friend class IOAudioStream; + +public: + /*! @var gSampleRateWholeNumberKey */ + static const OSSymbol *gSampleRateWholeNumberKey; + /*! @var gSampleRateFractionKey */ + static const OSSymbol *gSampleRateFractionKey; + + /*! @var numSampleFramesPerBuffer */ + UInt32 numSampleFramesPerBuffer; + + /*! @var sampleRate + * The current sample rate of the audio engine in samples per second. */ + IOAudioSampleRate sampleRate; + + /*! @var numErasesPerBuffer + * The number of times the erase head get scheduled to run for each + * cycle of the audio engine. */ + UInt32 numErasesPerBuffer; + /*! @var runEraseHead + * Set to true if the erase head is to run when the audio engine is running. This is the case if there are any output streams. */ + bool runEraseHead; + + /*! @var audioEngineStopPosition + * When all clients have disconnected, this is set to one buffer length past the + * current audio engine position at the time. Then when the stop position is reached, the audio engine + * is stopped */ + IOAudioEnginePosition audioEngineStopPosition; + + /*! @var isRegistered + * Internal state variable to keep track or whether registerService() has been called. */ + bool isRegistered; + /*! @var configurationChangeInProgress + * Set to true after beginConfigurationChange() and false upon a + * subsequent call to completeConfigurationChange() or cancelConfigurationChange(). */ + bool configurationChangeInProgress; + + /*! @var state + * The current state of the IOAudioEngine - running, stopped, paused. */ + IOAudioEngineState state; + + /*! @var status + * Status struct shared with the CoreAudio.framework. */ + IOAudioEngineStatus * status; + + /*! @var audioDevice + * The IOAudioDevice instance to which the IOAudioEngine belongs. */ + IOAudioDevice * audioDevice; + + /*! @var workLoop + * The IOWorkLoop for the audio driver - shared with the IOAudioDevice. */ + IOWorkLoop *workLoop; + /*! @var commandGate + * The IOCommandGate for this audio engine - attached to the driver's IOWorkLoop. */ + IOCommandGate *commandGate; + + /*! @var inputStreams + * An OSSet of all of the input IOAudioStreams attached to this IOAudioEngine. */ + OSOrderedSet *inputStreams; + UInt32 maxNumInputChannels; + /*! @var outputStreams + * An OSSet of all of the output IOAudioStreams attached to this IOAudioEngine. */ + OSOrderedSet *outputStreams; + UInt32 maxNumOutputChannels; + /*! @var userClients + * An OSSet of all of the currently connected user clients. */ + OSSet *userClients; + /*! @var defaultAudioControls + * All of the IOAudioControls that affect this audio engine. */ + OSSet *defaultAudioControls; + + /*! @var numActiveUserClients + * A total of the active user clients - those that are currently playing or + * recording audio. */ + UInt32 numActiveUserClients; + UInt32 sampleOffset; // used for input and output if inputSampleOffset is not set, if inputSampleOffset is set used as output only + + UInt32 index; + bool duringStartup; + +protected: + + /*! + * @var deviceStartedAudioEngine + * Used by the IOAudioDevice to determine responsibility for shutting + * the audio engine down when it is no longer needed. + */ + bool deviceStartedAudioEngine; + +protected: + struct ExpansionData { + UInt32 pauseCount; + IOBufferMemoryDescriptor *statusDescriptor; + IOBufferMemoryDescriptor *bytesInInputBufferArrayDescriptor; + IOBufferMemoryDescriptor *bytesInOutputBufferArrayDescriptor; + UInt32 mixClipOverhead; + OSArray *streams; + UInt32 inputSampleOffset; + UInt32 commandGateStatus; // + SInt32 commandGateUsage; // + }; + + ExpansionData *reserved; + +// static UInt32 sInstanceCount; + +public: + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 0 ); + virtual IOReturn performFormatChange(IOAudioStream *audioStream, const IOAudioStreamFormat *newFormat, const IOAudioStreamFormatExtension *formatExtension, const IOAudioSampleRate *newSampleRate ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 1 ); + virtual IOBufferMemoryDescriptor * getStatusDescriptor( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 2 ); + virtual IOReturn getNearestStartTime(IOAudioStream *audioStream, IOAudioTimeStamp *ioTimeStamp, bool isInput ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 3); + virtual IOBufferMemoryDescriptor * getBytesInInputBufferArrayDescriptor( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 4); + virtual IOBufferMemoryDescriptor * getBytesInOutputBufferArrayDescriptor( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 5); + /*! + * @function eraseOutputSamples + * @abstract This function allows for the actual erasing of the mix and sample buffer to be overridden by + * a child class. + * @param mixBuf Pointer to the IOAudioFamily allocated mix buffer. + * @param sampleBuf Pointer to the child class' sample buffer. + * @param firstSampleFrame Index to the first sample frame to erase. + * @param numSampleFrames Number of sample frames to erase. + * @param streamFormat Format of the data to be erased. + * @param audioStream Pointer to stream object that corresponds to the sample buffer being erased. + * @result Must return kIOReturnSuccess if the samples have been erased. + */ + virtual IOReturn eraseOutputSamples(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 6); + /*! + * @function setClockIsStable + * @abstract This function sets a flag that CoreAudio uses to select its sample rate tracking algorithm. Set + * this to TRUE unless that results in dropped audio. If the driver is experiencing unexplained dropouts + * setting this FALSE might help. + * @param clockIsStable TRUE tells CoreAudio to use an agressive PLL to quickly lock to the engine's sample rate + * while FALSE tells CoreAudio to adjust more slowly to perceived sample rate changes that might just be the + * result of an unstable clock. + */ + virtual void setClockIsStable(bool clockIsStable ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 7); + /*! + * @function setMixClipOverhead + * @abstract Used to tell IOAudioFamily when the watchdog timer must fire by. + * @discussion setMixClipOverhead allows an audio engine to tell IOAudioFamily how much time + * an engine will take to mix and clip its samples, in percent. + * The default value is 10, meaning 10%. This will cause IOAudioFamily to make + * the watchdog timer fire when there is just over 10% of the time to complete + * a buffer set left (e.g. 51 samples when the HAL is using a buffer size of 512 + * samples). + * @param newMixClipOverhead How much time per buffer should be made available for the + * mix and clip routines to run. Valid values are 1 through 99, inclusive. + * @result return no error + */ + virtual void setMixClipOverhead(UInt32 newMixClipOverhead ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 8); + /*! + * @function setClockDomain + * @abstract Sets a property that CoreAudio uses to determine how devices are synchronized. If an audio device can tell that it is + * synchronized to another engine, it should set this value to that engine's clock domain. If an audio device can be a clock master, it may publish + * its own clock domain for other devices to use. + * @param clockDomain is the unique ID of another engine that this engine realizes it is synchronized to, use the default value kIOAudioNewClockDomain + * to have IOAudioEngine create a unique clock domain. + */ + virtual void setClockDomain(UInt32 clockDomain = kIOAudioNewClockDomain ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 9); + /*! + * @function convertInputSamplesVBR + * @abstract Override this method if you want to return a different number of sample frames than was requested. + */ + virtual IOReturn convertInputSamplesVBR(const void *sampleBuf, void *destBuf, UInt32 firstSampleFrame, UInt32 &numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 10); + /*! + * @function setInputSampleOffset + * @abstract set the offset CoreAudio will read from off the current read pointer + * @param numSamples size of offset in sample + */ + virtual void setInputSampleOffset(UInt32 numSamples ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 11); + /*! + * @function setOutputSampleOffset + * @abstract set the offset CoreAudio will write at off the current write pointer + * @param numSamples size of offset in sample + */ + virtual void setOutputSampleOffset(UInt32 numSamples ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +protected: + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 12); + virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioEngineUserClient **newUserClient, OSDictionary *properties ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +public: + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 13); + /*! + * @function setAttributeForConnection + * @abstract Generic method to set some attribute of the audio engine, specific to one connection. + * @discussion IOAudioEngine subclasses may implement this method to allow arbitrary attribute/value pairs to be set, specific to one connection. + * @param attribute Defines the attribute to be set. + * @param value The new value for the attribute. + * @result an IOReturn code. + */ + + virtual IOReturn setAttributeForConnection( SInt32 connectIndex, UInt32 attribute, uintptr_t value ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 14); + /*! @function getAttributeForConnection + * @abstract Generic method to retrieve some attribute of the audio engine, specific to one connection. + * @discussion IOAudioEngine subclasses may implement this method to allow arbitrary attribute/value pairs to be returned, specific to one connection. + * @param attribute Defines the attribute to be returned. Some defined attributes are:
+ * @param value Returns the value for the attribute. + * @result an IOReturn code. + */ + + virtual IOReturn getAttributeForConnection( SInt32 connectIndex, UInt32 attribute, uintptr_t * value ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +private: + OSMetaClassDeclareReservedUsed(IOAudioEngine, 0); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 1); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 2); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 3); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 4); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 5); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 6); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 7); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 8); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 9); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 10); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 11); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 12); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 13); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 14); + + OSMetaClassDeclareReservedUnused(IOAudioEngine, 15); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 16); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 17); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 18); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 19); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 20); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 21); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 22); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 23); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 24); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 25); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 26); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 27); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 28); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 29); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 30); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 31); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 32); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 33); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 34); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 35); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 36); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 37); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 38); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 39); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 40); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 41); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 42); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 43); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 44); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 45); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 46); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 47); + +public: + /*! + * @function createDictionaryFromSampleRate + * @abstract Generates a dictionary matching the given sample rate. + * @discussion This is an internal routine used to generate a dictionary matching the given sample rate. It is used to generate a sample rate dictionary for the I/O Registry - used by the + * CoreAudio.framework. + * @result Returns the newly create OSDictionary. + */ + static OSDictionary *createDictionaryFromSampleRate(const IOAudioSampleRate *sampleRate, OSDictionary *rateDict = 0 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function createSampleRateFromDictionary + * @abstract Generates a sample rate from an OSDictionary. + * @discussion This is an internal routine used to generate a sample rate from an OSDictionary. It is used to generate a sample rate give a new OSDictionary from the IORegistry - coming + * from the CoreAudio.framework. + * @result Returns the sample rate. + */ + static IOAudioSampleRate *createSampleRateFromDictionary(const OSDictionary *rateDict, IOAudioSampleRate *sampleRate = 0 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function init + * @abstract Performs initialization of a newly allocated IOAudioEngine. + * @discussion This function is responsible for initialization of all of the general attributes of + * a new IOAudioEngine. It initializes instance variables to their default + * values and allocates the shared status buffer. Subclasses will likely want to override this method + * and do all of their common initialization in their implementation. They do need to be sure to call + * IOAudioEngine's implementation of init and pay attention to the return value. + * @param properties The default properties for the IOAudioEngine. + * @result Returns true if initialization was successful. + */ + virtual bool init(OSDictionary *properties ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function free + * @abstract Frees all of the resources allocated by the IOAudioEngine. + * @discussion Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + virtual void free( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getWorkLoop + * @abstract Returns the IOWorkLoop for the driver. + */ + virtual IOWorkLoop *getWorkLoop() const; + + /*! + * @function getCommandGate + * @abstract Returns the IOCommandGate for this IOAudioEngine. + */ + virtual IOCommandGate *getCommandGate() const; + + /*! + * @function start + * @abstract A simple cover function for start(IOService *, IOAudioDevice *) that assumes the provider + * is the IOAudioDevice. + * @discussion Subclasses will want to override start(IOService *, IOAudioDevice *) rather than this + * one. + * @param provider The service provider for the IOAudioEngine (the IOAudioDevice in this case). + * @result Returns true if the IOAudioEngine was successfully started. + */ + virtual bool start(IOService *provider ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function start + * @abstract Standard IOKit start() routine called to start an IOService. + * @discussion This function is called in order to prepare the IOAudioEngine for use. It does NOT + * mean that the audio I/O engine itself should be started. This implementation gets the IOWorkLoop + * from the IOAudioDevice and allocates an IOCommandGate. Finally it calls initHardware() in which + * all of the subclass-specific device initialization should be done. Upon return from initHardware() + * all IOAudioStreams should be created and added to the audio engine. Also, all IOAudioControls + * for this IOAudioEngine should be created and attached. + * @param provider The service provider for the IOAudioEngine. + * @param device The IOAudioDevice to which this IOAudioEngine belongs. + * @result Returns true if the service was successfully started. + */ + virtual bool start(IOService *provider, IOAudioDevice *device ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function initHardware + * @abstract This function is called by start() to provide a convenient place for the subclass to + * perform its hardware initialization. + * @discussion Upon return from this function, all IOAudioStreams and IOAudioControls should be created + * and the audio engine should be ready to be started when a client requests that playback begin. + * @function provider The service provider numb for this audio engine - typically the IOAudioDevice. + * @result Returns true if the hardware was successfully initialized. + */ + virtual bool initHardware(IOService *provider ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function stop + * @abstract Stops the service and prepares for the driver to be terminated. + * @discussion This function is called before the driver is terminated and usually means that the device + * has been removed from the system. + * @param provider The service provider for the IOAudioEngine. + */ + virtual void stop(IOService *provider ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function registerService + * @abstract Called when this audio engine is ready to begin vending services. + * @discussion This function is called by IOAudioDevice::activateAudioEngine() once the audio engine + * has been fully initialized and is ready to begin audio playback. + * @param options + */ + virtual void registerService(IOOptionBits options = 0 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void setAudioDevice(IOAudioDevice *device ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void setIndex(UInt32 index ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void setDescription(const char *description ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function newUserClient + * @abstract Requests a new user client object for this service. + * @discussion This function is called automatically by I/O Kit when a user process attempts + * to connect to this service. It allocates a new IOAudioEngineUserClient object and increments + * the number of connections for this audio engine. If this is the first user client for this IOAudioEngine, + * it calls startAudioEngine(). There is no need to call this function directly. + * A derived class that requires overriding of newUserClient should override the version with the properties + * parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive + * can be used to select between the two behaviors. + * @param task The task requesting the new user client. + * @param securityID Optional security paramater passed in by the client - ignored. + * @param type Optional user client type passed in by the client - ignored. + * @param handler The new IOUserClient * must be stored in this param on a successful completion. + * @param properties A dictionary of additional properties for the connection. + * @result Returns kIOReturnSuccess on success. May also result kIOReturnError or kIOReturnNoMemory. + */ + virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, IOUserClient **handler ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, OSDictionary *properties, IOUserClient **handler ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function addAudioStream + * @abstract Adds an IOAudioStream to the audio engine. + * @discussion This function is called by the driver to add an IOAudioStream to the audio engine. This must be called at least once to make sure the audio engine has at least one IOAudioStream. + * @param stream The IOAudioStream to be added. + * @result Returns kIOReturnSuccess if the stream was successfully added. + */ + virtual IOReturn addAudioStream(IOAudioStream *stream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOAudioStream *getAudioStream(IOAudioStreamDirection direction, UInt32 channelID ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void lockAllStreams( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void unlockAllStreams( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void updateChannelNumbers( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function resetStatusBuffer + * @abstract Resets the status buffer to its default values. + * @discussion This is called during startAudioEngine() and resumeAudioEngine() to clear out the status buffer + * in preparation of starting up the I/O engine. There is no need to call this directly. + */ + virtual void resetStatusBuffer( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function clearAllSampleBuffers + * @abstract Zeros out all of the sample and mix buffers associated with the IOAudioEngine + * @discussion This is called during resumeAudioEngine() since the audio engine gets started back at the + * beginning of the sample buffer. + */ + virtual void clearAllSampleBuffers( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getCurrentSampleFrame + * @abstract Gets the current sample frame from the IOAudioEngine subclass. + * @result + */ + virtual UInt32 getCurrentSampleFrame() = 0; + + /*! + * @function startAudioEngine + * @abstract Starts the audio I/O engine. + * @discussion This method is called automatically when the audio engine is placed into use the first time. + * This must be overridden by the subclass. No call to the superclass's implementation is + * necessary. The subclass's implementation must start up the audio I/O engine. This includes any audio + * engine that needs to be started as well as any interrupts that need to be enabled. Upon successfully + * starting the engine, the subclass's implementation must call setState(kIOAudioEngineRunning). If + * it has also checked the state using getState() earlier in the implementation, the stateLock must be + * acquired for the entire initialization process (using IORecursiveLockLock(stateLock) and + * IORecursiveLockUnlock(stateLock)) to ensure that the state remains consistent. See the general class + * comments for an example. + * @result Must return kIOReturnSuccess on a successful start of the engine. + */ + virtual IOReturn startAudioEngine( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function stopAudioEngine + * @abstract Stops the audio I/O engine. + * @discussion This method is called automatically when the last client disconnects from this audio engine. + * It must be overridden by the subclass. No call to the superclass's implementation is necessary. + * The subclass's implementation must stop the audio I/O engine. The audio engine (if it exists) should + * be stopped and any interrupts disabled. Upon successfully stopping the engine, the subclass must call + * setState(kAudioEngineStopped). If it has also checked the state using getState() earlier in the + * implementation, the stateLock must be acquired for the entire initialization process (using + * IORecursiveLockLock(stateLock) and IORecursiveLockUnlock(stateLock)) to ensure that the state remains + * consistent. + * @result Must return kIOReturnSuccess on a successful stop of the engine. + */ + virtual IOReturn stopAudioEngine( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn pauseAudioEngine( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn resumeAudioEngine( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function performAudioEngineStart + * @abstract Called to start the audio I/O engine + * @discussion This method is called by startAudioEngine(). This must be overridden by the subclass. + * No call to the superclass' implementation is necessary. The subclass' implementation must start up the + * audio I/O engine. This includes any audio engine that needs to be started as well as any interrupts + * that need to be enabled. + * @result Must return kIOReturnSuccess on a successful start of the engine. + */ + virtual IOReturn performAudioEngineStart( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function performAudioEngineStop + * @abstract Called to stop the audio I/O engine + * @discussion This method is called by stopAudioEngine() and pauseAudioEngine. + * This must be overridden by the subclass. No call to the superclass' implementation is + * necessary. The subclass' implementation must stop the audio I/O engine. This includes any audio + * engine that needs to be stopped as well as any interrupts that need to be disabled. + * @result Must return kIOReturnSuccess on a successful stop of the engine. + */ + virtual IOReturn performAudioEngineStop( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getState + * @abstract Returns the current state of the IOAudioEngine. + * @discussion If this method is called in preparation for calling setState(), the stateLock must + * be acquired before the first call to getState() and held until after the last call to setState(). + * Be careful not to return from the code acquiring the lock while the lock is being held. That + * will cause a deadlock situation. + * @result The current state of the IOAudioEngine: kIOAudioEngineRunning, kIOAudioEngineStopped. + */ + virtual IOAudioEngineState getState( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getSampleRate + * @abstract Returns the sample rate of the IOAudioEngine in samples per second. + */ + virtual const IOAudioSampleRate *getSampleRate( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn hardwareSampleRateChanged(const IOAudioSampleRate *sampleRate ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getRunEraseHead + * @abstract Returns true if the audio engine will run the erase head when the audio engine is running. + */ + virtual bool getRunEraseHead( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getStatus + * @abstract Returns a pointer to the shared status buffer. + */ + virtual const IOAudioEngineStatus *getStatus( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function timerCallback + * @abstract A static method used as a callback for the IOAudioDevice timer services. + * @discussion This method implements the IOAudioDevice::TimerEvent type. + * @param arg1 The IOAudioEngine that is the target of the event. + * @param device The IOAudioDevice that sent the timer event. + */ + static void timerCallback(OSObject *arg1, IOAudioDevice *device ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function timerFired + * @abstract Indicates the timer has fired. + * @discussion This method is called by timerCallback to indicate the timer has fired. This method calls performErase() and performFlush() to do erase head processing and + * audio engine flushing each time the timer event fires. + */ + virtual void timerFired( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function getTimerInterval + * @abstract Gets the timer interval for use by the timer event. + * @discussion This method is called each time the timer event is enabled through addTimer(). The default + * implementation is set to return a value such that the timer event runs n times each cycle of the audio + * engine through the sample buffer. The value n is stored as the instance variable: numErasesPerBuffer. + * The default value of numErasesPerBuffer is set to IOAUDIOENGINE_DEFAULT_NUM_ERASES_PER_BUFFER which is 4. + * A subclass may change the value of numErasesPerBuffer or override getTimerInterval. If it is overridden, + * the subclass should call the superclass's implementation, compare its interval with the superclass's and + * return the smaller of the two. + * @result Returns the interval for the timer event. + */ + virtual AbsoluteTime getTimerInterval( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function performErase + * @abstract Performs erase head processing. + * @discussion This method is called automatically each time the timer event fires and erases the sample + * buffer and mix buffer from the previous location up to the current location of the audio engine. + */ + virtual void performErase( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function performFlush + * @abstract Performs the flush operation. + * @discussion This method is called automatically each time the timer event fires. It stops the audio engine + * if there are no more clients and the audio engine is passed the latest flush ending position. + */ + virtual void performFlush( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void stopEngineAtPosition(IOAudioEnginePosition *endingPosition ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn mixOutputSamples(const void *sourceBuf, void *mixBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn clipOutputSamples(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void resetClipPosition(IOAudioStream *audioStream, UInt32 clipSampleFrame ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn convertInputSamples(const void *sampleBuf, void *destBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void takeTimeStamp(bool incrementLoopCount = true, AbsoluteTime *timestamp = NULL ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn getLoopCountAndTimeStamp(UInt32 *loopCount, AbsoluteTime *timestamp ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn calculateSampleTimeout(AbsoluteTime *sampleInterval, UInt32 numSampleFrames, IOAudioEnginePosition *startingPosition, AbsoluteTime *wakeupTime ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn performFormatChange(IOAudioStream *audioStream, const IOAudioStreamFormat *newFormat, const IOAudioSampleRate *newSampleRate ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void beginConfigurationChange( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void completeConfigurationChange( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void cancelConfigurationChange( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn addDefaultAudioControl(IOAudioControl *defaultAudioControl ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn removeDefaultAudioControl(IOAudioControl *defaultAudioControl ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void removeAllDefaultAudioControls( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual OSString *getGlobalUniqueID( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual OSString *getLocalUniqueID( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +protected: + + /*! + * @function initKeys + * @abstract Generates the OSSymbols with the keys. + * @discussion Do not call this directly. This is an internal initialization routine. + */ + static void initKeys( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void setNumSampleFramesPerBuffer(UInt32 numSampleFrames ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual UInt32 getNumSampleFramesPerBuffer( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setState + * @abstract Indicates that the audio engine is in the specified state. + * @discussion This method simply sets the internal state of the audio engine to the specified state. It does not + * affect a change to the state. It does however keep other internal state-related attributes consistent. + * For example, it enables or disables the timer as needed when the state changes to running or stopped. + * @param newState The state the audio engine is in. + * @result Returns the old state. + */ + virtual IOAudioEngineState setState(IOAudioEngineState newState ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setSampleRate + * @abstract Records the sample rate of the audio engine. + * @discussion This method must be called during initialization of a new audio engine to record the audio engine's + * initial sample rate. It also is intended to be used to record changes to the sample rate during use. + * Currently changing sample rates after the audio engine has been started is not supported. + * It may require that the sample buffers be re-sized. This will be available in an upcoming release. + * @param newSampleRate The sample rate of the audio engine in samples per second. + */ + virtual void setSampleRate(const IOAudioSampleRate *newSampleRate ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setSampleLatency + * @abstract Sets the sample latency for the audio engine. + * @discussion The sample latency represents the number of samples ahead of the playback head + * that it is safe to write into the sample buffer. The audio device API will never write + * closer to the playback head than the number of samples specified. For input audio engines + * the number of samples is behind the record head. + */ + virtual void setSampleLatency(UInt32 numSamples ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void setOutputSampleLatency(UInt32 numSamples ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void setInputSampleLatency(UInt32 numSamples ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void setSampleOffset(UInt32 numSamples ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setRunEraseHead + * @abstract Tells the audio engine whether or not to run the erase head. + * @discussion By default, output audio engines run the erase head and input audio engines do not. This method can + * be called after setDirection() is called in order to change the default behavior. + * @param runEraseHead The audio engine will run the erase head if this value is true. + */ + virtual void setRunEraseHead(bool runEraseHead ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function clientClosed + * @abstract Called automatically when a user client closes its connection to the audio engine. + * @discussion This method decrements the number of connections to the audio engine and if they reach + * zero, the audio engine is called with a call to stopAudioEngine(). This method should not be called directly. + * @param client The user client that has disconnected. + */ + virtual void clientClosed(IOAudioEngineUserClient *client ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function addTimer + * @abstract Enables the timer event for the audio engine. + * @discussion There is a timer event needed by the IOAudioEngine for processing the erase head + * and performing flushing operations. When the timer fires, the method timerFired() is ultimately + * called which in turn calls performErase() and performFlush(). This is called automatically + * to enable the timer event for this audio engine. It is called by setState() when the audio engine state + * is set to kIOAudioEngineRunning. When the timer is no longer needed, removeTimer() is called. + * There is no need to call this directly. + */ + virtual void addTimer( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function removeTimer + * @abstract Disables the timer event for the audio engine. + * @discussion This method is called automatically to disable the timer event for this audio engine. + * There is need to call it directly. This method is called by setState() when the audio engine state + * is changed from kIOAudioEngineRunning to one of the stopped states. + */ + virtual void removeTimer( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void sendFormatChangeNotification(IOAudioStream *audioStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void sendNotification(UInt32 notificationType ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioEngineUserClient **newUserClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOReturn _addUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + static IOReturn addUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + static IOReturn _removeUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + static IOReturn removeUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + static IOReturn detachUserClientsAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn addUserClient(IOAudioEngineUserClient *newUserClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn removeUserClient(IOAudioEngineUserClient *userClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn detachUserClients( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn startClient(IOAudioEngineUserClient *userClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn stopClient(IOAudioEngineUserClient *userClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn incrementActiveUserClients( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn decrementActiveUserClients( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void detachAudioStreams( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + void setWorkLoopOnAllAudioControls(IOWorkLoop *wl ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static inline void lockStreamForIO(IOAudioStream *stream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + static inline void unlockStreamForIO(IOAudioStream *stream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // These aren't virtual by design + UInt32 getNextStreamID(IOAudioStream * newStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + IOAudioStream * getStreamForID(UInt32 streamID ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + IOReturn waitForEngineResume ( void ); // + + static void setCommandGateUsage(IOAudioEngine *engine, bool increment ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + +}; + +#endif /* _IOKIT_IOAUDIOENGINE_H */ diff --git a/QualcommWireless/include/IOKit/audio/IOAudioEngineUserClient.h b/QualcommWireless/include/IOKit/audio/IOAudioEngineUserClient.h new file mode 100644 index 0000000..e8a80ef --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioEngineUserClient.h @@ -0,0 +1,287 @@ +/* + * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOENGINEUSERCLIENT_H +#define _IOKIT_IOAUDIOENGINEUSERCLIENT_H + +#include +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#include +#else +#include "IOAudioEngine.h" +#include "IOAudioTypes.h" +#endif +#include + +class IOAudioEngine; +class IOAudioStream; +class IOMemoryDescriptor; +class IOCommandGate; +class IOWorkLoop; + +class IOAudioEngineUserClient; +class IOAudioClientBufferSet; +struct IOAudioFormatNotification; + + +#define kDriverHelper_DriverHostEntitlement "com.apple.private.audio.driver-host" // XXX copied from AudioHAL/DriverHelper/DriverHelper.h + +typedef struct IOAudioClientBuffer +{ + IOAudioEngineUserClient *userClient; + IOAudioStream *audioStream; + void *sourceBuffer; + IOMemoryDescriptor *sourceBufferDescriptor; + IOMemoryMap *sourceBufferMap; + void *unmappedSourceBuffer; + UInt32 numSampleFrames; + UInt32 numChannels; + IOAudioEnginePosition mixedPosition; + struct IOAudioClientBuffer *mNextBuffer32; + struct IOAudioClientBuffer *nextClip; + struct IOAudioClientBuffer *previousClip; + struct IOAudioClientBuffer *nextClient; + IOAudioBufferDataDescriptor *bufferDataDescriptor; +} IOAudioClientBuffer; + +/* IOAudioClientBuffer64 added for binary compatibility with old PPC drivers covered by */ +typedef struct IOAudioClientBuffer64 +{ + IOAudioClientBuffer mAudioClientBuffer32; + mach_vm_address_t mUnmappedSourceBuffer64; + struct IOAudioClientBuffer64 *mNextBuffer64; +} IOAudioClientBuffer64; + +typedef struct IOAudioClientBufferExtendedInfo +{ + // Added stuff for registerClientParameterBuffer + UInt32 bufferSetID; + void *paramBuffer; + IOMemoryDescriptor *paramBufferDescriptor; + IOMemoryMap *paramBufferMap; + void *unmappedParamBuffer; + struct IOAudioClientBufferExtendedInfo *mNextExtended; +} IOAudioClientBufferExtendedInfo; + +/* IOAudioClientBufferExtendedInfo64 added for binary compatibility with old PPC drivers covered by */ +typedef struct IOAudioClientBufferExtendedInfo64 +{ + IOAudioClientBufferExtendedInfo mAudioClientBufferExtended32; + mach_vm_address_t mUnmappedParamBuffer64; + struct IOAudioClientBufferExtendedInfo64 *mNextExtended64; +} IOAudioClientBufferExtendedInfo64; + + +class IOAudioEngineUserClient : public IOUserClient +{ + OSDeclareDefaultStructors(IOAudioEngineUserClient) + + friend class IOAudioEngine; + friend class IOAudioClientBufferSet; + friend class IOAudioStream; + +protected: + IOAudioEngine *audioEngine; + + IOWorkLoop *workLoop; + IOCommandGate *commandGate; + + IOExternalMethod old_methods[5]; // It's size can't be changed for binary compatibility reasons, no longer used. + IOExternalTrap trap; + + task_t clientTask; + UInt32 numSampleFrames; // Never used... + + IOAudioClientBufferSet *clientBufferSetList; + IORecursiveLock *clientBufferLock; + + IOAudioNotificationMessage *notificationMessage; + + bool online; + +protected: + struct ExpansionData { + IOAudioClientBufferExtendedInfo64 *extendedInfo; + UInt32 classicMode; + UInt32 commandGateStatus; // + SInt32 commandGateUsage; // + UInt32 connectionID; + }; + +// START + ExpansionData *reserved; + +public: + virtual IOReturn externalMethod( uint32_t selector, IOExternalMethodArguments * arguments, IOExternalMethodDispatch * dispatch, + OSObject * target, void * reference) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // New code added here... + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 0); + virtual IOReturn registerClientParameterBuffer (void * parameterBuffer, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // unused function + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 1); + virtual IOAudioClientBufferExtendedInfo * findExtendedInfo(UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 2); + virtual IOReturn getNearestStartTime(IOAudioStream *audioStream, IOAudioTimeStamp *ioTimeStamp, UInt32 isInput) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 3); + virtual IOReturn getClientNearestStartTime(IOAudioStream *audioStream, IOAudioTimeStamp *ioTimeStamp, UInt32 isInput) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 4); + virtual IOReturn safeRegisterClientBuffer(UInt32 audioStreamIndex, void * sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 5); + virtual bool initWithAudioEngine(IOAudioEngine *engine, task_t task, void *securityToken, UInt32 type, OSDictionary *properties) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 6); + virtual IOReturn safeRegisterClientBuffer64(UInt32 audioStreamIndex, mach_vm_address_t * sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 7); + virtual IOReturn registerClientBuffer64(IOAudioStream *audioStream, mach_vm_address_t sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 8); + virtual IOReturn registerBuffer64(IOAudioStream *audioStream, mach_vm_address_t sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 9); + virtual IOReturn unregisterBuffer64(mach_vm_address_t sourceBuffer, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 10); + virtual IOReturn unregisterClientBuffer64(mach_vm_address_t * sourceBuffer, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 11); + virtual IOAudioClientBufferExtendedInfo64 * findExtendedInfo64(UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + + +private: + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 0); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 1); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 2); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 3); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 4); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 5); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 6); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 7); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 8); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 9); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 10); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 11); + + + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 12); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 13); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 14); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 15); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 16); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 17); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 18); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 19); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 20); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 21); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 22); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 23); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 24); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 25); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 26); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 27); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 28); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 29); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 30); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 31); + +protected: + virtual IOReturn clientClose() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn clientDied() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOReturn _closeClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + static IOReturn closeClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn closeClient() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + + virtual IOReturn clientMemoryForType(UInt32 type, UInt32 *flags, IOMemoryDescriptor **memory) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOExternalMethod *getExternalMethodForIndex(UInt32 index) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOExternalTrap *getExternalTrapForIndex(UInt32 index) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 type, UInt32 refCon) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOReturn _registerNotificationAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + static IOReturn registerNotificationAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn registerNotification(mach_port_t port, UInt32 refCon) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void setOnline(bool newOnline) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn performClientOutput(UInt32 firstSampleFrame, UInt32 loopCount, IOAudioClientBufferSet *bufferSet, UInt32 sampleIntervalHi, UInt32 sampleIntervalLo) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn performClientInput(UInt32 firstSampleFrame, IOAudioClientBufferSet *bufferSet) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void performWatchdogOutput(IOAudioClientBufferSet *clientBufferSet, UInt32 generationCount) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void lockBuffers() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void unlockBuffers() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static void setCommandGateUsage(IOAudioEngineUserClient *userClient, bool increment) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + +public: + + static IOAudioEngineUserClient *withAudioEngine(IOAudioEngine *engine, task_t clientTask, void *securityToken, UInt32 type) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + static IOAudioEngineUserClient *withAudioEngine(IOAudioEngine *engine, task_t clientTask, void *securityToken, UInt32 type, OSDictionary *properties) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual bool initWithAudioEngine(IOAudioEngine *engine, task_t task, void *securityToken, UInt32 type) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void free() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void freeClientBufferSetList() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void freeClientBuffer(IOAudioClientBuffer64 *clientBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void stop(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual bool isOnline() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn registerBuffer(IOAudioStream *audioStream, void* sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn unregisterBuffer( void * sourceBuffer, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOReturn _registerBufferAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + static IOReturn registerBufferAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + static IOReturn _unregisterBufferAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + static IOReturn unregisterBufferAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn registerClientBuffer(IOAudioStream *audioStream, void * sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn unregisterClientBuffer(void * sourceBuffer, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOReturn _getNearestStartTimeAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + static IOReturn getNearestStartTimeAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOAudioClientBufferSet *findBufferSet(UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void removeBufferSet(IOAudioClientBufferSet *bufferSet) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn getConnectionID(UInt32 *connectionID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn clientStart() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn clientStop() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOReturn _startClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + static IOReturn startClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + static IOReturn _stopClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + static IOReturn stopClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn startClient() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn stopClient() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn performClientIO(UInt32 firstSampleFrame, UInt32 loopCount, bool inputIO, UInt32 bufferSetID, UInt32 sampleIntervalHi, UInt32 sampleIntervalLo) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void sendFormatChangeNotification(IOAudioStream *audioStream) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn sendNotification(UInt32 notificationType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +}; + +// END + + +#endif /* _IOKIT_IOAUDIOENGINEUSERCLIENT_H */ diff --git a/QualcommWireless/include/IOKit/audio/IOAudioLevelControl.h b/QualcommWireless/include/IOKit/audio/IOAudioLevelControl.h new file mode 100644 index 0000000..2209594 --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioLevelControl.h @@ -0,0 +1,207 @@ +/* + * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOLEVELCONTROL_H +#define _IOKIT_IOAUDIOLEVELCONTROL_H + +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioControl.h" +#endif + +class OSArray; + +/*! + * @class IOAudioLevelControl + * @abstract + * @discussion + */ + +class IOAudioLevelControl : public IOAudioControl +{ + OSDeclareDefaultStructors(IOAudioLevelControl) + +protected: + SInt32 minValue; + SInt32 maxValue; + IOFixed minDB; + IOFixed maxDB; + + OSArray *ranges; + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +public: + static IOAudioLevelControl *createPassThruVolumeControl (SInt32 initialValue, + SInt32 minValue, + SInt32 maxValue, + IOFixed minDB, + IOFixed maxDB, + UInt32 channelID, + const char *channelName, + UInt32 cntrlID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDefineReservedUnused(IOAudioLevelControl, 0); + /*! + * @function setLinearScale + * @abstract This function tells CoreAudio if it should apply a curve to the scaler representation of the volume. + * @param useLinearScale TRUE instructs CoreAudio to not apply a curve to the scaler representation of the volume, + * FALSE instructs CoreAudio to apply a curve, which is CoreAudio's default behavior. + */ + virtual void setLinearScale(bool useLinearScale) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +private: + OSMetaClassDeclareReservedUsed(IOAudioLevelControl, 0); + + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 1); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 2); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 3); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 4); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 5); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 6); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 7); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 8); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 9); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 10); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 11); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 12); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 13); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 14); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 15); + +public: + /*! + * @function create + * @abstract Allocates a new level control with the given attributes + * @param initialValue The initial value of the control + * @param minValue The lowest possible value the control may have + * @param maxValue The highest possible value the control may have + * @param minDB A fixed point representation of the db value matching minValue + * @param maxDB A fixed point representation of the db value matching maxValue + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioTypes.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls. + * @result Returns a newly allocted and initialized level IOAudioControl + */ + static IOAudioLevelControl *create(SInt32 initialValue, + SInt32 minValue, + SInt32 maxValue, + IOFixed minDB, + IOFixed maxDB, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOAudioLevelControl *createVolumeControl(SInt32 initialValue, + SInt32 minValue, + SInt32 maxValue, + IOFixed minDB, + IOFixed maxDB, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 usage = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function init + * @abstract Initializes a newly allocated IOAudioLevelControl with the given attributes + * @param initialValue The initial value of the control + * @param minValue The lowest possible value the control may have + * @param maxValue The highest possible value the control may have + * @param minDB A fixed point representation of the db value matching minValue + * @param maxDB A fixed point representation of the db value matching maxValue + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioTypes.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls. + * @param properties Standard property list passed to the init() function of any new IOService. This dictionary + * gets stored in the registry entry for this service. + * @result Returns true on success + */ + virtual bool init(SInt32 initialValue, + SInt32 minValue, + SInt32 maxValue, + IOFixed minDB, + IOFixed maxDB, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0, + OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void free() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setMinValue + * @abstract Sets the minimum value the control may have + * @param minValue The minimum value for the control + */ + virtual void setMinValue(SInt32 minValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual SInt32 getMinValue() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setMaxValue + * @abstract Sets the maximum value the control may have + * @param maxValue The maximum value for the control + */ + virtual void setMaxValue(SInt32 maxValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual SInt32 getMaxValue() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setMinDB + * @abstract Sets the minimum value in db that the control may have + * @discussion This value is represented as an IOFixed value which is a fixed point number. The IOFixed + * type is a 16.16 fixed point value. + * @param minDB The minimum value in db for the control + */ + virtual void setMinDB(IOFixed minDB) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOFixed getMinDB() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function setMaxDB + * @abstract Sets the maximum value in db that the control may have + * @discussion This value is represented as an IOFixed value which is a fixed point number. The IOFixed + * type is a 16.16 fixed point value. + * @param maxDB The maximum value in db for the control + */ + virtual void setMaxDB(IOFixed maxDB) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOFixed getMaxDB() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn addRange(SInt32 minValue, SInt32 maxValue, IOFixed minDB, IOFixed maxDB) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn addNegativeInfinity(SInt32 negativeInfinityValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn validateValue(OSObject *newValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; +}; + +#endif /* _IOKIT_IOAUDIOLEVELCONTROL_H */ diff --git a/QualcommWireless/include/IOKit/audio/IOAudioPort.h b/QualcommWireless/include/IOKit/audio/IOAudioPort.h new file mode 100644 index 0000000..a8be7ac --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioPort.h @@ -0,0 +1,185 @@ +/* + * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOPORT_H +#define _IOKIT_IOAUDIOPORT_H + +#include +#include + +class IOAudioDevice; +class IOAudioControl; +class OSDictionary; + +/*! + * @class IOAudioPort + * @abstract Represents a logical or physical port or functional unit in an audio device. + * @discussion An IOAudioPort represents an element in the signal chain in the audio device. It may contain + * one or more controls (represented by IOAudioControl) by which different attributes of the port may be + * represented and adjusted. + * + * IOAudioPort objects are connected up in the IORegistry in the IOAudioPlane to represent the signal chain of + * the device. They may be connected to other IOAudioPorts as well as IOAudioEngines to indicate they either + * feed into or are fed by one of the audio engines (i.e. they provide input to or take output from the computer). + */ +class IOAudioPort : public IOService +{ + friend class IOAudioDevice; + + OSDeclareDefaultStructors(IOAudioPort) + +public: + /* @var audioDevice The IOAudioDevice that this IOAudioPort belongs to. */ + IOAudioDevice * audioDevice; + /* @var audioControls A set containg all of the IOAudioControl instances that belong to the port. */ + OSSet * audioControls; + bool isRegistered; + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOAudioPort, 0); + OSMetaClassDeclareReservedUnused(IOAudioPort, 1); + OSMetaClassDeclareReservedUnused(IOAudioPort, 2); + OSMetaClassDeclareReservedUnused(IOAudioPort, 3); + OSMetaClassDeclareReservedUnused(IOAudioPort, 4); + OSMetaClassDeclareReservedUnused(IOAudioPort, 5); + OSMetaClassDeclareReservedUnused(IOAudioPort, 6); + OSMetaClassDeclareReservedUnused(IOAudioPort, 7); + OSMetaClassDeclareReservedUnused(IOAudioPort, 8); + OSMetaClassDeclareReservedUnused(IOAudioPort, 9); + OSMetaClassDeclareReservedUnused(IOAudioPort, 10); + OSMetaClassDeclareReservedUnused(IOAudioPort, 11); + OSMetaClassDeclareReservedUnused(IOAudioPort, 12); + OSMetaClassDeclareReservedUnused(IOAudioPort, 13); + OSMetaClassDeclareReservedUnused(IOAudioPort, 14); + OSMetaClassDeclareReservedUnused(IOAudioPort, 15); + OSMetaClassDeclareReservedUnused(IOAudioPort, 16); + OSMetaClassDeclareReservedUnused(IOAudioPort, 17); + OSMetaClassDeclareReservedUnused(IOAudioPort, 18); + OSMetaClassDeclareReservedUnused(IOAudioPort, 19); + OSMetaClassDeclareReservedUnused(IOAudioPort, 20); + OSMetaClassDeclareReservedUnused(IOAudioPort, 21); + OSMetaClassDeclareReservedUnused(IOAudioPort, 22); + OSMetaClassDeclareReservedUnused(IOAudioPort, 23); + OSMetaClassDeclareReservedUnused(IOAudioPort, 24); + OSMetaClassDeclareReservedUnused(IOAudioPort, 25); + OSMetaClassDeclareReservedUnused(IOAudioPort, 26); + OSMetaClassDeclareReservedUnused(IOAudioPort, 27); + OSMetaClassDeclareReservedUnused(IOAudioPort, 28); + OSMetaClassDeclareReservedUnused(IOAudioPort, 29); + OSMetaClassDeclareReservedUnused(IOAudioPort, 30); + OSMetaClassDeclareReservedUnused(IOAudioPort, 31); + +public: + /*! + * @function withAttributes + * @abstract Allocates a new IOAudioPort instance with the given attributes + * @discussion This static method allocates a new IOAudioPort and calls initWithAttributes() on it with + * the parameters passed in to it. + * @param portType A readable string representing the type of port. Common port types are defined in + * IOAudioTypes.h and are prefixed with 'kIOAudioPortType'. Please provide feedback if there are + * other common port types that should be included. + * @param portName A readable string representing the name of the port. For example: 'Internal Speaker', + * 'Line Out'. This field is optional, but useful for providing information to the application/user. + * @param subType Developer defined readable string representing a subtype for the port. (optional) + * @param properties Standard property list passed to the init of any new IOService. This dictionary + * gets stored in the registry for this instance. (optional) + * @result Returns the newly allocated and initialized IOAudioPort instance. + */ + static IOAudioPort *withAttributes(UInt32 portType, const char *portName = 0, UInt32 subType = 0, OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function initWithAttributes + * @abstract Initializes a newly allocated IOAudioPort instance with the given attributes + * @discussion The properties parameter is passed on the superclass' init(). The portType, subType + * and properties parameters are optional, however portType is recommended. + * @param portType A readable string representing the type of port. Common port types are defined in + * IOAudioTypes.h and are prefixed with 'kIOAudioPortType'. Please provide feedback if there are + * other common port types that should be included. + * @param portName A readable string representing the name of the port. For example: 'Internal Speaker', + * 'Line Out'. This field is optional, but useful for providing information to the application/user. + * @param subType Developer defined readable string representing a subtype for the port. (optional) + * @param properties Standard property list passed to the init of any new IOService. This dictionary + * gets stored in the registry for this instance. (optional) + * @result Returns true on success. + */ + virtual bool initWithAttributes(UInt32 portType, const char *portName = 0, UInt32 subType = 0, OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function free + * @abstract Frees all of the resources allocated by the IOAudioPort. + * @discussion Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + virtual void free() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function start + * @abstract Called to start a newly created IOAudioPort. + * @discussion This is called automatically by IOAudioDevice when attachAudioPort() is called. + * @param provider The IOAudioDevice that owns this port + * @result Returns true on success + */ + virtual bool start(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function stop + * @abstract Called when the IOAudioDevice is stopping when it is no longer available. + * @discussion This method calls deactivateAudioControls() to shut down all of the controls associated with + * this port. + * @param provider The IOAudioDevice that owns this port + */ + virtual void stop(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void registerService(IOOptionBits options = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOAudioDevice *getAudioDevice() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function addAudioControl + * @abstract Adds a newly created IOAudioControl instance to the port. + * @discussion This method is responsible for starting the new IOAudioControl and adding it to the internal + * audioControls array. + * @param control A newly created IOAudioControl instance that should belong to this port. + * @result Returns true on successfully staring the IOAudioControl. + */ + virtual IOReturn addAudioControl(IOAudioControl *control) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function deactivateAudioControls + * @abstract Called to shut down all of the audio controls for this port. + * @discussion This will stop all of the audio controls and release them so that the instances may be + * freed. This is called from the free() method. + */ + virtual void deactivateAudioControls() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +protected: + virtual void setType(UInt32 portType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void setSubType(UInt32 subType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void setName(const char *name) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; +}; + +#endif /* _IOKIT_IOAUDIOPORT_H */ diff --git a/QualcommWireless/include/IOKit/audio/IOAudioSelectorControl.h b/QualcommWireless/include/IOKit/audio/IOAudioSelectorControl.h new file mode 100644 index 0000000..94f553f --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioSelectorControl.h @@ -0,0 +1,127 @@ +/* + * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOSELECTORCONTROL_H +#define _IOKIT_IOAUDIOSELECTORCONTROL_H + +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioControl.h" +#endif + +class OSString; +class OSArray; + +class IOAudioSelectorControl : public IOAudioControl +{ + OSDeclareDefaultStructors(IOAudioSelectorControl) + +protected: + + OSArray *availableSelections; + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +public: + static IOAudioSelectorControl *createOutputSelector(SInt32 initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + static IOAudioSelectorControl *createOutputClockSelector(SInt32 initialValue, + UInt32 channelID, + UInt32 clockSource, + const char *channelName = 0, + UInt32 cntrlID = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + static IOAudioSelectorControl *createInputClockSelector(SInt32 initialValue, + UInt32 channelID, + UInt32 clockSource, + const char *channelName = 0, + UInt32 cntrlID = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + // OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 0); + virtual IOReturn removeAvailableSelection(SInt32 selectionValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 1); + virtual IOReturn replaceAvailableSelection(SInt32 selectionValue, const char *selectionDescription) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 2); + virtual IOReturn replaceAvailableSelection(SInt32 selectionValue, OSString *selectionDescription) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 3); + virtual IOReturn addAvailableSelection(SInt32 selectionValue, OSString *selectionDescription, const char* pszName, OSObject* tag) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + +private: + OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 0); + OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 1); + OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 2); + OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 3); // + + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 4); // + + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 5); // + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 6); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 7); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 8); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 9); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 10); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 11); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 12); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 13); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 14); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 15); + +public: + static IOAudioSelectorControl *create(SInt32 initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOAudioSelectorControl *createInputSelector(SInt32 initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual bool init(SInt32 initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0, + OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void free() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn addAvailableSelection(SInt32 selectionValue, const char *selectionDescription) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn addAvailableSelection(SInt32 selectionValue, OSString *selectionDescription) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual bool valueExists(SInt32 selectorValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn validateValue(OSObject *newValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +}; + +#endif /* _IOKIT_IOAUDIOSELECTORCONTROL_H */ diff --git a/QualcommWireless/include/IOKit/audio/IOAudioStream.h b/QualcommWireless/include/IOKit/audio/IOAudioStream.h new file mode 100644 index 0000000..aa2fd9b --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioStream.h @@ -0,0 +1,307 @@ +/* + * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOSTREAM_H +#define _IOKIT_IOAUDIOSTREAM_H + +#include +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#include +#else +#include "IOAudioEngine.h" +#include "IOAudioTypes.h" +#endif + +class OSSymbol; +class OSArray; +class OSDictionary; +class OSSet; + +class IOCommandGate; +class IOAudioControl; + +struct IOAudioClientBuffer; +struct IOAudioStreamFormatDesc; + +/*! + * @class IOAudioStream + * @abstract This class wraps a single sample buffer in an audio driver. + * @discussion An IOAudioStream represents one hardware sample buffer as well as the direction + * of that buffer, the mix buffer that multiple clients mix into as well as a list of + * all of the formats to which this buffer can be set. + * + * When an IOAudioEngine is created during init time in the driver, an IOAudioStream must be + * created for each sample buffer in the device. Typically, the sample buffer will be interleaved + * (or single channel), as a non-interleaved buffer should be divided into multiple single-channel + * buffers (and multiple IOAudioStreams). + * + * Additionally, when an IOAudioStream is created it must have all of the possible formats (and + * allowed sample rates for each format) set and must have the currently set format specified + * (addAvailableFormat() and setFormat()). + */ + +class IOAudioStream : public IOService +{ + OSDeclareDefaultStructors(IOAudioStream) + + friend class IOAudioEngine; + friend class IOAudioEngineUserClient; + +public: + + typedef IOReturn (*AudioIOFunction)(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static const OSSymbol *gDirectionKey; + static const OSSymbol *gNumChannelsKey; + static const OSSymbol *gSampleFormatKey; + static const OSSymbol *gNumericRepresentationKey; + static const OSSymbol *gBitDepthKey; + static const OSSymbol *gBitWidthKey; + static const OSSymbol *gAlignmentKey; + static const OSSymbol *gByteOrderKey; + static const OSSymbol *gIsMixableKey; + static const OSSymbol *gDriverTagKey; + static const OSSymbol *gMinimumSampleRateKey; + static const OSSymbol *gMaximumSampleRateKey; + + static void initKeys() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static OSDictionary *createDictionaryFromFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, OSDictionary *formatDict = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + static IOAudioStreamFormat *createFormatFromDictionary(const OSDictionary *formatDict, IOAudioStreamFormat *streamFormat = 0, IOAudioStreamFormatExtension *formatExtension = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + IOAudioEngine *audioEngine; + IOWorkLoop *workLoop; + IOCommandGate *commandGate; + IORecursiveLock *streamIOLock; + + UInt32 numClients; + + IOAudioStreamDirection direction; + + IOAudioStreamFormat format; + IOAudioStreamFormatDesc *availableFormats; + OSArray *availableFormatDictionaries; + UInt32 numAvailableFormats; + + UInt32 startingChannelID; + UInt32 maxNumChannels; + + void *sampleBuffer; + UInt32 sampleBufferSize; + + void *mixBuffer; + UInt32 mixBufferSize; + bool streamAllocatedMixBuffer; + + AudioIOFunction *audioIOFunctions; + UInt32 numIOFunctions; + + bool streamAvailable; + + OSSet *defaultAudioControls; + + IOAudioEnginePosition startingPosition; + IOAudioEnginePosition clippedPosition; + + IOAudioClientBuffer *clientBufferListStart; + IOAudioClientBuffer *clientBufferListEnd; + + IOAudioClientBuffer *userClientList; + +protected: + + enum { + kErrorLogClipMoreThanOneBufferAhead = 0, + kErrorLogClipMoreThanOneBufferAheadPart2, + kErrorLogClipPositionIsOff, + kErrorLogAlreadyClipped, + kErrorLogClipBuffersAreNULL, + kErrorLogClipReturnsAnError, + kErrorLogNumberOfCounters, // needs to be after the last counter + kErrorLogDumpCounters = 0xFFFF + }; + + struct ExpansionData { + IOAudioStreamFormatExtension streamFormatExtension; + UInt32 mSampleFramesReadByEngine; + IOReturn mClipOutputStatus; + unsigned int mStreamErrorCounts[kErrorLogNumberOfCounters]; + bool mStreamErrorCountsUpdated; + }; + + ExpansionData *reserved; + +public: +// New code added here: + // OSMetaClassDeclareReservedUsed(IOAudioStream, 0); + virtual const IOAudioStreamFormatExtension *getFormatExtension() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioStream, 1); + virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, bool callDriver = true) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioStream, 2); + virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, OSDictionary *formatDict, bool callDriver = true) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioStream, 3); + virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, const AudioIOFunction *ioFunctionList = NULL, UInt32 numFunctions = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioStream, 4); + virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, AudioIOFunction ioFunction) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioStream, 5); + virtual bool validateFormat(IOAudioStreamFormat *streamFormat, IOAudioStreamFormatExtension *formatExtension, IOAudioStreamFormatDesc *formatDesc) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioStream, 6); + virtual void setTerminalType(const UInt32 terminalType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioStream, 7); + virtual IOReturn mixOutputSamples(const void *sourceBuf, void *mixBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioStream, 8); + virtual void setSampleLatency(UInt32 numSamples) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioStream, 9); + virtual bool validateFormat(IOAudioStreamFormat *streamFormat, IOAudioStreamFormatExtension *formatExtension, IOAudioStreamFormatDesc *formatDesc, const IOAudioSampleRate *sampleRate) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioStream, 10); + virtual UInt32 getNumSampleFramesRead() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + // OSMetaClassDeclareReservedUsed(IOAudioStream, 11); + virtual void setDefaultNumSampleFramesRead(UInt32) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +private: + OSMetaClassDeclareReservedUsed(IOAudioStream, 0); + OSMetaClassDeclareReservedUsed(IOAudioStream, 1); + OSMetaClassDeclareReservedUsed(IOAudioStream, 2); + OSMetaClassDeclareReservedUsed(IOAudioStream, 3); + OSMetaClassDeclareReservedUsed(IOAudioStream, 4); + OSMetaClassDeclareReservedUsed(IOAudioStream, 5); + OSMetaClassDeclareReservedUsed(IOAudioStream, 6); + OSMetaClassDeclareReservedUsed(IOAudioStream, 7); + OSMetaClassDeclareReservedUsed(IOAudioStream, 8); + OSMetaClassDeclareReservedUsed(IOAudioStream, 9); + OSMetaClassDeclareReservedUsed(IOAudioStream, 10); + OSMetaClassDeclareReservedUsed(IOAudioStream, 11); + + OSMetaClassDeclareReservedUnused(IOAudioStream, 12); + OSMetaClassDeclareReservedUnused(IOAudioStream, 13); + OSMetaClassDeclareReservedUnused(IOAudioStream, 14); + OSMetaClassDeclareReservedUnused(IOAudioStream, 15); + OSMetaClassDeclareReservedUnused(IOAudioStream, 16); + OSMetaClassDeclareReservedUnused(IOAudioStream, 17); + OSMetaClassDeclareReservedUnused(IOAudioStream, 18); + OSMetaClassDeclareReservedUnused(IOAudioStream, 19); + OSMetaClassDeclareReservedUnused(IOAudioStream, 20); + OSMetaClassDeclareReservedUnused(IOAudioStream, 21); + OSMetaClassDeclareReservedUnused(IOAudioStream, 22); + OSMetaClassDeclareReservedUnused(IOAudioStream, 23); + OSMetaClassDeclareReservedUnused(IOAudioStream, 24); + OSMetaClassDeclareReservedUnused(IOAudioStream, 25); + OSMetaClassDeclareReservedUnused(IOAudioStream, 26); + OSMetaClassDeclareReservedUnused(IOAudioStream, 27); + OSMetaClassDeclareReservedUnused(IOAudioStream, 28); + OSMetaClassDeclareReservedUnused(IOAudioStream, 29); + OSMetaClassDeclareReservedUnused(IOAudioStream, 30); + OSMetaClassDeclareReservedUnused(IOAudioStream, 31); + OSMetaClassDeclareReservedUnused(IOAudioStream, 32); + OSMetaClassDeclareReservedUnused(IOAudioStream, 33); + OSMetaClassDeclareReservedUnused(IOAudioStream, 34); + OSMetaClassDeclareReservedUnused(IOAudioStream, 35); + OSMetaClassDeclareReservedUnused(IOAudioStream, 36); + OSMetaClassDeclareReservedUnused(IOAudioStream, 37); + OSMetaClassDeclareReservedUnused(IOAudioStream, 38); + OSMetaClassDeclareReservedUnused(IOAudioStream, 39); + OSMetaClassDeclareReservedUnused(IOAudioStream, 40); + OSMetaClassDeclareReservedUnused(IOAudioStream, 41); + OSMetaClassDeclareReservedUnused(IOAudioStream, 42); + OSMetaClassDeclareReservedUnused(IOAudioStream, 43); + OSMetaClassDeclareReservedUnused(IOAudioStream, 44); + OSMetaClassDeclareReservedUnused(IOAudioStream, 45); + OSMetaClassDeclareReservedUnused(IOAudioStream, 46); + OSMetaClassDeclareReservedUnused(IOAudioStream, 47); + +public: + virtual bool initWithAudioEngine(IOAudioEngine *engine, IOAudioStreamDirection dir, UInt32 startChannelID, const char *streamDescription = NULL, OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void free() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void stop(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOWorkLoop *getWorkLoop() const; + + virtual IOReturn setProperties(OSObject *properties) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOAudioStreamDirection getDirection() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void setSampleBuffer(void *buffer, UInt32 size) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void *getSampleBuffer() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual UInt32 getSampleBufferSize() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void setMixBuffer(void *buffer, UInt32 size) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void *getMixBuffer() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual UInt32 getMixBufferSize() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void numSampleFramesPerBufferChanged() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void clearSampleBuffer() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void setIOFunction(AudioIOFunction ioFunction) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void setIOFunctionList(const AudioIOFunction *ioFunctionList, UInt32 numFunctions) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual const IOAudioStreamFormat *getFormat() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + static IOReturn setFormatAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + static IOReturn _setFormatAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // + virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, bool callDriver = true) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn setFormat(OSDictionary *formatDict) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, OSDictionary *formatDict, bool callDriver = true) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn hardwareFormatChanged(const IOAudioStreamFormat *streamFormat) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, const AudioIOFunction *ioFunctionList = NULL, UInt32 numFunctions = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, AudioIOFunction ioFunction) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void clearAvailableFormats() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual bool validateFormat(IOAudioStreamFormat *streamFormat, IOAudioStreamFormatDesc *formatDesc) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual UInt32 getStartingChannelID() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual UInt32 getMaxNumChannels() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void setStreamAvailable(bool available) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual bool getStreamAvailable() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn addDefaultAudioControl(IOAudioControl *defaultAudioControl) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void removeDefaultAudioControls() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +protected: + virtual void lockStreamForIO() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void unlockStreamForIO() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void updateNumClients() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn addClient(IOAudioClientBuffer *clientBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void removeClient(IOAudioClientBuffer *clientBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual UInt32 getNumClients() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual IOReturn processOutputSamples(IOAudioClientBuffer *clientBuffer, UInt32 firstSampleFrame, UInt32 loopCount, bool samplesAvailable) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual IOReturn readInputSamples(IOAudioClientBuffer *clientBuffer, UInt32 firstSampleFrame) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void resetClipInfo() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void clipIfNecessary() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + virtual void clipOutputSamples(UInt32 startingSampleFrame, UInt32 numSampleFrames) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + virtual void setStartingChannelNumber(UInt32 channelNumber) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +private: + virtual void setDirection(IOAudioStreamDirection dir) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + void safeLogError(int error , long unsigned int arg1 , long unsigned int arg2 , long unsigned int arg3 , long unsigned int arg4 , void* arg5, void* arg6) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +}; + +#endif /* _IOKIT_IOAUDIOSTREAM_H */ diff --git a/QualcommWireless/include/IOKit/audio/IOAudioTimeIntervalFilter.h b/QualcommWireless/include/IOKit/audio/IOAudioTimeIntervalFilter.h new file mode 100644 index 0000000..4f2e045 --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioTimeIntervalFilter.h @@ -0,0 +1,245 @@ +/* + * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOAUDIOTIMEINTERVALFILTER_H +#define _IOAUDIOTIMEINTERVALFILTER_H + +#include "BigNum128.h" + +/*! + @class IOAudioTimeIntervalFilter + @abstract An abstract class that provides a filtered timeline based on snapshots from jittery time captures + */ +class IOAudioTimeIntervalFilter : public OSObject +{ + OSDeclareAbstractStructors(IOAudioTimeIntervalFilter) + +public: + /*! + @function reInitialiseFilter + @abstract Restart a new timeline sequence, with a new expected interval spacing + @param expectedInterval Expected interval of time captures. Pass zero to use the results from previous runs. + @param multiIntervalCount Count of multiple intervals to return from getMultiIntervalTime. + */ + virtual IOReturn reInitialiseFilter(uint32_t expectedInterval = 0, uint32_t multiIntervalCount = 1 ); + + /*! + * @function free + * @abstract Frees all of the resources allocated by the IOAudioTimeIntervalFilter. + * @discussion Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + virtual void free(); + + + + /*! + @function newTimePosition + @abstract Pass in the raw measured time position + @param rawSnapshot The raw time position. These should be approximately occurring every ExpectedInterval + @result A filtered time position + */ + + virtual AbsoluteTime newTimePosition(AbsoluteTime rawSnapshot); + + /*! + @function getMultiIntervalTime + @abstract Return the time between the last MultiIntervalCount intervals of the filtered timeline + @result Return the time between the last MultiIntervalCount intervals of the filtered timeline + */ + virtual uint64_t getMultiIntervalTime(void); + + + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 0 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 1 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 2 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 3 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 4 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 5 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 6 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 7 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 8 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 9 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 10 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 11 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 12 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 13 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 14 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 15 ); + +protected: + /* */ + struct ExpansionData + { + }; + + ExpansionData *reserved; + + /*! + @function initFilter + @abstract Construct a new instance of the TimeFilter class + @param ExpectedInterval Expected interval of time captures + @param MultiIntervalCount Optionally calculate the count between ExpectedInterval + */ + virtual bool initFilter(uint32_t expectedInterval, uint32_t multiIntervalCount = 1); + + /*! + @function calculateNewTimePosition + @abstract abstract method to calculate the new time position based on the raw snapshot + @param rawSnapshot Raw filter value + @result filtered time value + */ + virtual uint64_t calculateNewTimePosition(uint64_t rawSnapshot) = 0; + + inline int decCircularBufferPosition(int n, int dec = 1) { return (n + mMultiIntervalCount - dec) % mMultiIntervalCount; } + inline int incCircularBufferPosition(int n, int inc = 1) { return (n + mMultiIntervalCount + inc) % mMultiIntervalCount; } + + uint32_t mExpectedInterval; + uint32_t mMultiIntervalCount; + + uint64_t* mIntervalTimeHistory; + + /*! + * @var mIntervalTimeHistoryPointer + * Points to the next time interval to be updated + */ + int mIntervalTimeHistoryPointer; + + /*! + * @var mFilterCount + * How many times the filter has been called since re-init + */ + uint64_t mFilterCount; + + IOLock* timeIntervalLock; +}; + + + +/*! + @class IOAudioTimeIntervalFilterIIR + @abstract A concrete IOAudioTimeIntervalFilter class that provides an IIR-based filtered timeline based on snapshots from jittery time captures + */ + +class IOAudioTimeIntervalFilterIIR : public IOAudioTimeIntervalFilter +{ + OSDeclareDefaultStructors(IOAudioTimeIntervalFilterIIR) + +public: + /*! + @function initFilter + @abstract Construct a new instance of the IIR TimeFilter class + @param ExpectedInterval Expected interval of time captures + @param MultiIntervalCount Optionally calculate the count between ExpectedInterval + @param filterCoef IIR filter coefficient. Increase this number for more aggressive smoothing + */ + virtual bool initFilter(uint32_t expectedInterval, uint32_t multiIntervalCount = 1, uint16_t filterCoef = 4); + + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 0 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 1 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 2 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 3 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 4 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 5 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 6 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 7 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 8 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 9 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 10 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 11 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 12 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 13 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 14 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 15 ); + +protected: + virtual void IIR(U128* filterVal, U128 input, int shiftAmount); + virtual uint64_t calculateNewTimePosition(uint64_t rawSnapshot); + + U128 mFilteredSnapshot; + U128 mFilteredOffset; + uint16_t mIIRCoef; +}; + + + +/*! + @class IOAudioTimeIntervalFilterFIR + @abstract A concrete IOAudioTimeIntervalFilter class that provides an FIR-based filtered timeline based on snapshots from jittery time captures + */ + +class IOAudioTimeIntervalFilterFIR : public IOAudioTimeIntervalFilter +{ + OSDeclareDefaultStructors(IOAudioTimeIntervalFilterFIR) + +public: + /*! + @function initFilter + @abstract Construct a new instance of the IIR TimeFilter class + @param ExpectedInterval Expected interval of time captures + @param MultiIntervalCount Optionally calculate the count between ExpectedInterval + */ + virtual bool initFilter(uint32_t expectedInterval, uint32_t multiIntervalCount = 1); + + /*! + * @function free + * @abstract Frees all of the resources allocated by the IOAudioTimeIntervalFilter. + * @discussion Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + virtual void free(); + + IOReturn reInitialiseFilter(uint32_t expectedInterval = 0, uint32_t multiIntervalCount = 1 ); + + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 0 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 1 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 2 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 3 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 4 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 5 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 6 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 7 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 8 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 9 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 10 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 11 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 12 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 13 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 14 ); + OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 15 ); +protected: + + virtual uint64_t calculateNewTimePosition(uint64_t rawSnapshot); + virtual IOReturn setNewFilter(uint32_t numCoeffs, const uint64_t* filterCoefficients, uint32_t scale); + + U128 FIR(uint64_t *history, uint64_t input); + + uint64_t* mCoeffs; + uint64_t* mDataOffsetHistory; + uint64_t* mDataHistory; + uint32_t mNumCoeffs; + uint32_t mFilterScale; + uint32_t mFilterWritePointer; +}; + +#endif // _IOAUDIOTIMEINTERVALFILTER_H + diff --git a/QualcommWireless/include/IOKit/audio/IOAudioToggleControl.h b/QualcommWireless/include/IOKit/audio/IOAudioToggleControl.h new file mode 100644 index 0000000..a840013 --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioToggleControl.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOTOGGLECONTROL_H +#define _IOKIT_IOAUDIOTOGGLECONTROL_H + +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioControl.h" +#endif + +/*! + * @class IOAudioToggleControl + */ + +class IOAudioToggleControl : public IOAudioControl +{ + OSDeclareDefaultStructors(IOAudioToggleControl) + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +// New code added here +public: + /*! + * @function createPassThruMuteControl + * @abstract Allocates a new pass through mute control with the given attributes + * @param initialValue The initial value of the control + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioPort.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @result Returns a newly allocated and initialized mute IOAudioControl + */ + static IOAudioToggleControl *createPassThruMuteControl (bool initialValue, + UInt32 channelID, + const char *channelName, + UInt32 cntrlID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +private: + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 0); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 1); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 2); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 3); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 4); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 5); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 6); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 7); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 8); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 9); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 10); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 11); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 12); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 13); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 14); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 15); + +public: + /*! + * @function create + * @abstract Allocates a new mute control with the given attributes + * @param initialValue The initial value of the control + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioPort.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @result Returns a newly allocated and initialized mute IOAudioControl + */ + static IOAudioToggleControl *create(bool initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + static IOAudioToggleControl *createMuteControl(bool initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 usage = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + + /*! + * @function init + * @abstract Initializes a newly allocated IOAudioToggleControl with the given attributes + * @param initialValue The initial value of the control + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioPort.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @result Returns truen on success + */ + virtual bool init(bool initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0, + OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; + +}; + +#endif /* _IOKIT_IOAUDIOTOGGLECONTROL_H */ diff --git a/QualcommWireless/include/IOKit/audio/IOAudioTypes.h b/QualcommWireless/include/IOKit/audio/IOAudioTypes.h new file mode 100644 index 0000000..bf60ddb --- /dev/null +++ b/QualcommWireless/include/IOKit/audio/IOAudioTypes.h @@ -0,0 +1,675 @@ +/* + * Copyright (c) 1998-2013 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOTYPES_H +#define _IOKIT_IOAUDIOTYPES_H + +#include +#include + + +/*! + * @enum IOAudioEngineMemory + * @abstract Used to identify the type of memory requested by a client process to be mapped into its process space + * @discussion This is the parameter to the type field of IOMapMemory when called on an IOAudioEngine. This is + * only intended for use by the Audio Device API library. + * @constant kIOAudioSampleBuffer This requests the IOAudioEngine's sample buffer + * @constant kIOAudioStatusBuffer This requests the IOAudioEngine's status buffer. It's type is IOAudioEngineStatus. + * @constant kIOAudioMixBuffer This requests the IOAudioEngine's mix buffer +*/ +typedef enum _IOAudioEngineMemory { + kIOAudioStatusBuffer = 0, + kIOAudioSampleBuffer = 1, + kIOAudioMixBuffer = 2, + kIOAudioBytesInInputBuffer = 3, + kIOAudioBytesInOutputBuffer = 4 +} IOAudioEngineMemory; + +/*! + * @enum IOAudioEngineCalls + * @abstract The set of constants passed to IOAudioEngineUserClient::getExternalMethodForIndex() when making calls + * from the IOAudioFamily user client code. + */ +typedef enum _IOAudioEngineCalls { + kIOAudioEngineCallRegisterClientBuffer = 0, + kIOAudioEngineCallUnregisterClientBuffer = 1, + kIOAudioEngineCallGetConnectionID = 2, + kIOAudioEngineCallStart = 3, + kIOAudioEngineCallStop = 4, + kIOAudioEngineCallGetNearestStartTime = 5 +} IOAudioEngineCalls; + +/*! @defined kIOAudioEngineNumCalls The number of elements in the IOAudioEngineCalls enum. */ +#define kIOAudioEngineNumCalls 6 + +typedef enum _IOAudioEngineTraps { + kIOAudioEngineTrapPerformClientIO = 0 +} IOAudioEngineTraps; + +typedef enum _IOAudioEngineNotifications { + kIOAudioEngineAllNotifications = 0, + kIOAudioEngineStreamFormatChangeNotification = 1, + kIOAudioEngineChangeNotification = 2, + kIOAudioEngineStartedNotification = 3, + kIOAudioEngineStoppedNotification = 4, + kIOAudioEnginePausedNotification = 5, + kIOAudioEngineResumedNotification = 6 +} IOAudioEngineNotifications; + +/*! + * @enum IOAudioEngineState + * @abstract Represents the state of an IOAudioEngine + * @constant kIOAudioEngineRunning The IOAudioEngine is currently running - it is transferring data to or + * from the device. + * @constant kIOAudioEngineStopped The IOAudioEngine is currently stopped - no activity is occurring. + */ + +typedef enum _IOAudioEngineState { + kIOAudioEngineStopped = 0, + kIOAudioEngineRunning = 1, + kIOAudioEnginePaused = 2, + kIOAudioEngineResumed = 3 +} IOAudioEngineState; + + +/*! + * @typedef IOAudioEngineStatus + * @abstract Shared-memory structure giving audio engine status + * @discussion + * @field fVersion Indicates version of this structure + * @field fCurrentLoopCount Number of times around the ring buffer since the audio engine started + * @field fLastLoopTime Timestamp of the last time the ring buffer wrapped + * @field fEraseHeadSampleFrame Location of the erase head in sample frames - erased up to but not + * including the given sample frame + */ + +typedef struct _IOAudioEngineStatus { + UInt32 fVersion; + volatile UInt32 fCurrentLoopCount; + volatile AbsoluteTime fLastLoopTime; + volatile UInt32 fEraseHeadSampleFrame; +} IOAudioEngineStatus; + +#define kIOAudioEngineCurrentStatusStructVersion 2 + +typedef struct _IOAudioStreamFormat { + UInt32 fNumChannels; + UInt32 fSampleFormat; + UInt32 fNumericRepresentation; + UInt8 fBitDepth; + UInt8 fBitWidth; + UInt8 fAlignment; + UInt8 fByteOrder; + UInt8 fIsMixable; + UInt32 fDriverTag; +} IOAudioStreamFormat; + +#define kFormatExtensionInvalidVersion 0 +#define kFormatExtensionCurrentVersion 1 + +typedef struct _IOAudioStreamFormatExtension { + UInt32 fVersion; + UInt32 fFlags; + UInt32 fFramesPerPacket; + UInt32 fBytesPerPacket; +} IOAudioStreamFormatExtension; + +typedef struct _IOAudioBufferDataDescriptor { + UInt32 fActualDataByteSize; + UInt32 fActualNumSampleFrames; + UInt32 fTotalDataByteSize; + UInt32 fNominalDataByteSize; + UInt8 fData[1]; +} IOAudioBufferDataDescriptor; + +#define kStreamDataDescriptorInvalidVersion 0 +#define kStreamDataDescriptorCurrentVersion 1 + +typedef struct _IOAudioStreamDataDescriptor { + UInt32 fVersion; + UInt32 fNumberOfStreams; + UInt32 fStreamLength[1]; // Array with fNumberOfStreams number of entries +} IOAudioStreamDataDescriptor; + +typedef struct _IOAudioSampleIntervalDescriptor { + UInt32 sampleIntervalHi; + UInt32 sampleIntervalLo; +} IOAudioSampleIntervalDescriptor; + +/*! + @struct SMPTETime + @abstract A structure for holding a SMPTE time. + @field fSubframes + The number of subframes in the full message. + @field fSubframeDivisor + The number of subframes per frame (typically 80). + @field fCounter + The total number of messages received. + @field fType + The kind of SMPTE time using the SMPTE time type constants. + @field fFlags + A set of flags that indicate the SMPTE state. + @field fHours + The number of hourse in the full message. + @field fMinutes + The number of minutes in the full message. + @field fSeconds + The number of seconds in the full message. + @field fFrames + The number of frames in the full message. +*/ +typedef struct _IOAudioSMPTETime +{ + SInt16 fSubframes; + SInt16 fSubframeDivisor; + UInt32 fCounter; + UInt32 fType; + UInt32 fFlags; + SInt16 fHours; + SInt16 fMinutes; + SInt16 fSeconds; + SInt16 fFrames; + +} IOAudioSMPTETime; + +// constants describing SMPTE types (taken from the MTC spec), +enum +{ + kIOAudioSMPTETimeType24 = 0, + kIOAudioSMPTETimeType25 = 1, + kIOAudioSMPTETimeType30Drop = 2, + kIOAudioSMPTETimeType30 = 3, + kIOAudioSMPTETimeType2997 = 4, + kIOAudioSMPTETimeType2997Drop = 5, + kIOAudioSMPTETimeType60 = 6, + kIOAudioSMPTETimeType5994 = 7, + kIOAudioSMPTETimeType60Drop = 8, + kIOAudioSMPTETimeType5994Drop = 9, + kIOAudioSMPTETimeType50 = 10, + kIOAudioSMPTETimeType2398 = 11 +}; + +// flags describing a SMPTE time stamp +enum +{ + kIOAudioSMPTETimeValid = (1L << 0), // the full time is valid + kIOAudioSMPTETimeRunning = (1L << 1) // time is running +}; + +// A struct for encapsulating the parts of a time stamp. The flags +// say which fields are valid. +typedef struct _IOAudioTimeStamp +{ + UInt64 fSampleTime; // the absolute sample time, was a Float64 + UInt64 fHostTime; // the host's root timebase's time + UInt64 fRateScalar; // the system rate scalar, was a Float64 + UInt64 fWordClockTime; // the word clock time + IOAudioSMPTETime fSMPTETime; // the SMPTE time + UInt32 fFlags; // the flags indicate which fields are valid + UInt32 fReserved; // reserved, pads the structure out to force 8 byte alignment +} IOAudioTimeStamp; + +// flags for the AudioTimeStamp sturcture +enum +{ + kIOAudioTimeStampSampleTimeValid = (1L << 0), + kIOAudioTimeStampHostTimeValid = (1L << 1), + kIOAudioTimeStampRateScalarValid = (1L << 2), + kIOAudioTimeStampWordClockTimeValid = (1L << 3), + kIOAudioTimeStampSMPTETimeValid = (1L << 4) +}; + +// Some commonly used combinations of timestamp flags +enum +{ + kIOAudioTimeStampSampleHostTimeValid = (kIOAudioTimeStampSampleTimeValid | kIOAudioTimeStampHostTimeValid) +}; + +/*! +* @enum IOAudioStreamDirection + * @abstract Represents the direction of an IOAudioStream + * @constant kIOAudioStreamDirectionOutput Output buffer + * @constant kIOAudioStreamDirectionInput Input buffer + */ + +typedef enum _IOAudioStreamDirection { + kIOAudioStreamDirectionOutput = 0, + kIOAudioStreamDirectionInput = 1 +} IOAudioStreamDirection; + +enum { + kIOAudioDeviceCanBeDefaultNothing = 0, + kIOAudioDeviceCanBeDefaultInput = (1L << 0), + kIOAudioDeviceCanBeDefaultOutput = (1L << 1), + kIOAudioDeviceCanBeSystemOutput = (1L << 2) +}; + +/*! + * @defined kIOAudioEngineDefaultMixBufferSampleSize + */ + +#define kIOAudioEngineDefaultMixBufferSampleSize sizeof(float) + +/* The following are for use only by the IOKit.framework audio family code */ + +/*! + * @enum IOAudioControlCalls + * @abstract The set of constants passed to IOAudioControlUserClient::getExternalMethodForIndex() when making calls + * from the IOAudioFamily user client code. + * @constant kIOAudioControlCallSetValue Used to set the value of an IOAudioControl. + * @constant kIOAudioControlCallGetValue Used to get the value of an IOAudioControl. + */ +typedef enum _IOAudioControlCalls { + kIOAudioControlCallSetValue = 0, + kIOAudioControlCallGetValue = 1 +} IOAudioControlCalls; + +/*! @defined kIOAudioControlNumCalls The number of elements in the IOAudioControlCalls enum. */ +#define kIOAudioControlNumCalls 2 + +/*! + * @enum IOAudioControlNotifications + * @abstract The set of constants passed in the type field of IOAudioControlUserClient::registerNotificaitonPort(). + * @constant kIOAudioControlValueChangeNotification Used to request value change notifications. + * @constant kIOAudioControlRangeChangeNotification Used to request range change notifications. + */ +typedef enum _IOAudioControlNotifications { + kIOAudioControlValueChangeNotification = 0, + kIOAudioControlRangeChangeNotification = 1 +} IOAudioControlNotifications; + +/*! + * @struct IOAudioNotificationMessage + * @abstract Used in the mach message for IOAudio notifications. + * @field messageHeader Standard mach message header + * @field ref The param passed to registerNotificationPort() in refCon. + */ +typedef struct _IOAudioNotificationMessage { + mach_msg_header_t messageHeader; + UInt32 type; + UInt32 ref; + void * sender; +} IOAudioNotificationMessage; + +typedef struct _IOAudioSampleRate { + UInt32 whole; + UInt32 fraction; +} IOAudioSampleRate; + +#define kNoIdleAudioPowerDown 0xffffffffffffffffULL + +enum { + kIOAudioPortTypeOutput = 'outp', + kIOAudioPortTypeInput = 'inpt', + kIOAudioPortTypeMixer = 'mixr', + kIOAudioPortTypePassThru = 'pass', + kIOAudioPortTypeProcessing = 'proc' +}; + +enum { + kIOAudioOutputPortSubTypeInternalSpeaker = 'ispk', + kIOAudioOutputPortSubTypeExternalSpeaker = 'espk', + kIOAudioOutputPortSubTypeHeadphones = 'hdpn', + kIOAudioOutputPortSubTypeLine = 'line', + kIOAudioOutputPortSubTypeSPDIF = 'spdf', + + kIOAudioInputPortSubTypeInternalMicrophone = 'imic', + kIOAudioInputPortSubTypeExternalMicrophone = 'emic', + kIOAudioInputPortSubTypeCD = 'cd ', + kIOAudioInputPortSubTypeLine = 'line', + kIOAudioInputPortSubTypeSPDIF = 'spdf' +}; + +enum { + kIOAudioControlTypeLevel = 'levl', + kIOAudioControlTypeToggle = 'togl', + kIOAudioControlTypeJack = 'jack', + kIOAudioControlTypeSelector = 'slct' +}; + +// Added kIOAudioToggleControlSubTypePhantomPower, kIOAudioToggleControlSubTypePhaseInvert & +// kIOAudioSelectorControlSubTypeChannelHighPassFilter +enum { + kIOAudioLevelControlSubTypeVolume = 'vlme', + kIOAudioLevelControlSubTypeLFEVolume = 'subv', + kIOAudioLevelControlSubTypePRAMVolume = 'pram', + kIOAudioToggleControlSubTypeMute = 'mute', + kIOAudioToggleControlSubTypeSolo = 'solo', + kIOAudioToggleControlSubTypeLFEMute = 'subm', + kIOAudioToggleControlSubTypeiSubAttach = 'atch', + kIOAudioToggleControlSubTypePhantomPower = 'phan', + kIOAudioToggleControlSubTypePhaseInvert = 'phsi', + kIOAudioSelectorControlSubTypeOutput = 'outp', + kIOAudioSelectorControlSubTypeInput = 'inpt', + kIOAudioSelectorControlSubTypeClockSource = 'clck', + kIOAudioSelectorControlSubTypeDestination = 'dest', + kIOAudioSelectorControlSubTypeChannelNominalLineLevel = 'nlev', + kIOAudioSelectorControlSubTypeChannelLevelPlus4dBu = '4dbu', + kIOAudioSelectorControlSubTypeChannelLevelMinus10dBV = '10db', + kIOAudioSelectorControlSubTypeChannelLevelMinus20dBV = '20db', + kIOAudioSelectorControlSubTypeChannelLevelMicLevel = 'micl', + kIOAudioSelectorControlSubTypeChannelLevelInstrumentLevel = 'istl', + kIOAudioSelectorControlSubTypeChannelHighPassFilter = 'hipf' +}; + +enum { + kIOAudioControlUsageOutput = 'outp', + kIOAudioControlUsageInput = 'inpt', + kIOAudioControlUsagePassThru = 'pass', + kIOAudioControlUsageCoreAudioProperty = 'prop' +}; + +enum { + kIOAudioControlChannelNumberInactive = -1, + kIOAudioControlChannelIDAll = 0, + kIOAudioControlChannelIDDefaultLeft = 1, + kIOAudioControlChannelIDDefaultRight = 2, + kIOAudioControlChannelIDDefaultCenter = 3, + kIOAudioControlChannelIDDefaultLeftRear = 4, + kIOAudioControlChannelIDDefaultRightRear = 5, + kIOAudioControlChannelIDDefaultSub = 6, + kIOAudioControlChannelIDDefaultFrontLeftCenter = 7, + kIOAudioControlChannelIDDefaultFrontRightCenter = 8, + kIOAudioControlChannelIDDefaultRearCenter = 9, + kIOAudioControlChannelIDDefaultSurroundLeft = 10, + kIOAudioControlChannelIDDefaultSurroundRight = 11 +}; + +enum { + kIOAudioSelectorControlSelectionValueNone = 'none', + + // Output-specific selection IDs + kIOAudioSelectorControlSelectionValueInternalSpeaker = 'ispk', + kIOAudioSelectorControlSelectionValueExternalSpeaker = 'espk', + kIOAudioSelectorControlSelectionValueHeadphones = 'hdpn', + + // Input-specific selection IDs + kIOAudioSelectorControlSelectionValueInternalMicrophone = 'imic', + kIOAudioSelectorControlSelectionValueExternalMicrophone = 'emic', + kIOAudioSelectorControlSelectionValueCD = 'cd ', + + // Common selection IDs + kIOAudioSelectorControlSelectionValueLine = 'line', + kIOAudioSelectorControlSelectionValueSPDIF = 'spdf' +}; + +enum { + kIOAudioStreamSampleFormatLinearPCM = 'lpcm', + kIOAudioStreamSampleFormatIEEEFloat = 'ieee', + kIOAudioStreamSampleFormatALaw = 'alaw', + kIOAudioStreamSampleFormatMuLaw = 'ulaw', + kIOAudioStreamSampleFormatMPEG = 'mpeg', + kIOAudioStreamSampleFormatAC3 = 'ac-3', + kIOAudioStreamSampleFormat1937AC3 = 'cac3', + kIOAudioStreamSampleFormat1937MPEG1 = 'mpg1', + kIOAudioStreamSampleFormat1937MPEG2 = 'mpg2', + kIOAudioStreamSampleFormatTimeCode = 'time' // a stream of IOAudioTimeStamp structures that capture any incoming time code information +}; + +enum { + kIOAudioStreamNumericRepresentationSignedInt = 'sint', + kIOAudioStreamNumericRepresentationUnsignedInt = 'uint', + kIOAudioStreamNumericRepresentationIEEE754Float = 'flot' +}; + +enum { + kIOAudioClockSelectorTypeInternal = 'int ', + kIOAudioClockSelectorTypeExternal = 'ext ', + kIOAudioClockSelectorTypeAESEBU = 'asbu', + kIOAudioClockSelectorTypeTOSLink = 'tosl', + kIOAudioClockSelectorTypeSPDIF = 'spdf', + kIOAudioClockSelectorTypeADATOptical = 'adto', + kIOAudioClockSelectorTypeADAT9Pin = 'adt9', + kIOAudioClockSelectorTypeSMPTE = 'smpt', + kIOAudioClockSelectorTypeVideo = 'vdeo', + kIOAudioClockSelectorTypeControl = 'cnrl', + kIOAudioClockSelectorTypeOther = 'othr', +}; + +enum { + kIOAudioStreamAlignmentLowByte = 0, + kIOAudioStreamAlignmentHighByte = 1 +}; + +enum { + kIOAudioStreamByteOrderBigEndian = 0, + kIOAudioStreamByteOrderLittleEndian = 1 +}; + +enum { + kIOAudioLevelControlNegativeInfinity = 0xffffffff +}; + +enum { +#ifndef __OPEN_SOURCE__ + kIOAudioBuiltInSystemClockDomain = 0x737973, +#endif + kIOAudioNewClockDomain = 0xffffffff +}; + +// Device connection types +#ifndef __OPEN_SOURCE__ +// Added kIOAudioDeviceTransportTypeDisplayPort +#endif +enum { + kIOAudioDeviceTransportTypeBuiltIn = 'bltn', + kIOAudioDeviceTransportTypePCI = 'pci ', + kIOAudioDeviceTransportTypeUSB = 'usb ', + kIOAudioDeviceTransportTypeFireWire = '1394', + kIOAudioDeviceTransportTypeNetwork = 'ntwk', + kIOAudioDeviceTransportTypeWireless = 'wrls', + kIOAudioDeviceTransportTypeOther = 'othr', + kIOAudioDeviceTransportTypeBluetooth = 'blue', + kIOAudioDeviceTransportTypeVirtual = 'virt', + kIOAudioDeviceTransportTypeDisplayPort = 'dprt', + kIOAudioDeviceTransportTypeHdmi = 'hdmi', + kIOAudioDeviceTransportTypeAVB = 'eavb', // + kIOAudioDeviceTransportTypeThunderbolt = 'thun' // +}; + +// types that go nowhere +enum { + OUTPUT_NULL = 0x0100, + INPUT_NULL = 0x0101 +}; + +// Input terminal types +enum { + INPUT_UNDEFINED = 0x0200, + INPUT_MICROPHONE = 0x0201, + INPUT_DESKTOP_MICROPHONE = 0x0202, + INPUT_PERSONAL_MICROPHONE = 0x0203, + INPUT_OMNIDIRECTIONAL_MICROPHONE = 0x0204, + INPUT_MICROPHONE_ARRAY = 0x0205, + INPUT_PROCESSING_MICROPHONE_ARRAY = 0x0206, + INPUT_MODEM_AUDIO = 0x207 +}; + +// Output terminal types +enum { + OUTPUT_UNDEFINED = 0x0300, + OUTPUT_SPEAKER = 0x0301, + OUTPUT_HEADPHONES = 0x0302, + OUTPUT_HEAD_MOUNTED_DISPLAY_AUDIO = 0x0303, + OUTPUT_DESKTOP_SPEAKER = 0x0304, + OUTPUT_ROOM_SPEAKER = 0x0305, + OUTPUT_COMMUNICATION_SPEAKER = 0x0306, + OUTPUT_LOW_FREQUENCY_EFFECTS_SPEAKER = 0x0307 +}; + +// Bi-directional terminal types +enum { + BIDIRECTIONAL_UNDEFINED = 0x0400, + BIDIRECTIONAL_HANDSET = 0x0401, + BIDIRECTIONAL_HEADSET = 0x0402, + BIDIRECTIONAL_SPEAKERPHONE_NO_ECHO_REDX = 0x0403, + BIDIRECTIONAL_ECHO_SUPPRESSING_SPEAKERPHONE = 0x0404, + BIDIRECTIONAL_ECHO_CANCELING_SPEAKERPHONE = 0x0405 +}; + +// Telephony terminal types +enum { + TELEPHONY_UNDEFINED = 0x0500, + TELEPHONY_PHONE_LINE = 0x0501, + TELEPHONY_TELEPHONE = 0x0502, + TELEPHONY_DOWN_LINE_PHONE = 0x0503 +}; + +// External terminal types +enum { + EXTERNAL_UNDEFINED = 0x0600, + EXTERNAL_ANALOG_CONNECTOR = 0x0601, + EXTERNAL_DIGITAL_AUDIO_INTERFACE = 0x0602, + EXTERNAL_LINE_CONNECTOR = 0x0603, + EXTERNAL_LEGACY_AUDIO_CONNECTOR = 0x0604, + EXTERNAL_SPDIF_INTERFACE = 0x0605, + EXTERNAL_1394_DA_STREAM = 0x0606, + EXTERNAL_1394_DV_STREAM_SOUNDTRACK = 0x0607, + EXTERNAL_ADAT = 0x0608, + EXTERNAL_TDIF = 0x0609, + EXTERNAL_MADI = 0x060A +}; + +// Embedded terminal types +enum { + EMBEDDED_UNDEFINED = 0x0700, + EMBEDDED_LEVEL_CALIBRATION_NOISE_SOURCE = 0x0701, + EMBEDDED_EQUALIZATION_NOISE = 0x0702, + EMBEDDED_CD_PLAYER = 0x0703, + EMBEDDED_DAT = 0x0704, + EMBEDDED_DCC = 0x0705, + EMBEDDED_MINIDISK = 0x0706, + EMBEDDED_ANALOG_TAPE = 0x0707, + EMBEDDED_PHONOGRAPH = 0x0708, + EMBEDDED_VCR_AUDIO = 0x0709, + EMBEDDED_VIDEO_DISC_AUDIO = 0x070A, + EMBEDDED_DVD_AUDIO = 0x070B, + EMBEDDED_TV_TUNER_AUDIO = 0x070C, + EMBEDDED_SATELLITE_RECEIVER_AUDIO = 0x070D, + EMBEDDED_CABLE_TUNER_AUDIO = 0x070E, + EMBEDDED_DSS_AUDIO = 0x070F, + EMBEDDED_RADIO_RECEIVER = 0x0710, + EMBEDDED_RADIO_TRANSMITTER = 0x0711, + EMBEDDED_MULTITRACK_RECORDER = 0x0712, + EMBEDDED_SYNTHESIZER = 0x0713 +}; + +// Processing terminal types +enum { + PROCESSOR_UNDEFINED = 0x0800, + PROCESSOR_GENERAL = 0x0801 +}; + +// Channel spatial position types + +#ifndef __OPEN_SOURCE__ +// NOTE: the following are derived from CoreAudioTypes.h +#endif + +#define kIOAudioChannelLabel_Discrete_field_ba 16 +enum { + kIOAudioChannelLabel_Unknown = 0xFFFFFFFF, // unknown or unspecified other use + kIOAudioChannelLabel_Unused = 0, // channel is present, but has no intended use or destination + kIOAudioChannelLabel_UseCoordinates = 100, // channel is described by the mCoordinates fields. + + kIOAudioChannelLabel_Left = 1, + kIOAudioChannelLabel_Right = 2, + kIOAudioChannelLabel_Center = 3, + kIOAudioChannelLabel_LFEScreen = 4, + kIOAudioChannelLabel_LeftSurround = 5, // WAVE: "Back Left" + kIOAudioChannelLabel_RightSurround = 6, // WAVE: "Back Right" + kIOAudioChannelLabel_LeftCenter = 7, + kIOAudioChannelLabel_RightCenter = 8, + kIOAudioChannelLabel_CenterSurround = 9, // WAVE: "Back Center" or plain "Rear Surround" + kIOAudioChannelLabel_LeftSurroundDirect = 10, // WAVE: "Side Left" + kIOAudioChannelLabel_RightSurroundDirect = 11, // WAVE: "Side Right" + kIOAudioChannelLabel_TopCenterSurround = 12, + kIOAudioChannelLabel_VerticalHeightLeft = 13, // WAVE: "Top Front Left" + kIOAudioChannelLabel_VerticalHeightCenter = 14, // WAVE: "Top Front Center" + kIOAudioChannelLabel_VerticalHeightRight = 15, // WAVE: "Top Front Right" + + kIOAudioChannelLabel_TopBackLeft = 16, + kIOAudioChannelLabel_TopBackCenter = 17, + kIOAudioChannelLabel_TopBackRight = 18, + + kIOAudioChannelLabel_RearSurroundLeft = 33, + kIOAudioChannelLabel_RearSurroundRight = 34, + kIOAudioChannelLabel_LeftWide = 35, + kIOAudioChannelLabel_RightWide = 36, + kIOAudioChannelLabel_LFE2 = 37, + kIOAudioChannelLabel_LeftTotal = 38, // matrix encoded 4 channels + kIOAudioChannelLabel_RightTotal = 39, // matrix encoded 4 channels + kIOAudioChannelLabel_HearingImpaired = 40, + kIOAudioChannelLabel_Narration = 41, + kIOAudioChannelLabel_Mono = 42, + kIOAudioChannelLabel_DialogCentricMix = 43, + + kIOAudioChannelLabel_CenterSurroundDirect = 44, // back center, non diffuse + + kIOAudioChannelLabel_Haptic = 45, + + // first order ambisonic channels + kIOAudioChannelLabel_Ambisonic_W = 200, + kIOAudioChannelLabel_Ambisonic_X = 201, + kIOAudioChannelLabel_Ambisonic_Y = 202, + kIOAudioChannelLabel_Ambisonic_Z = 203, + + // Mid/Side Recording + kIOAudioChannelLabel_MS_Mid = 204, + kIOAudioChannelLabel_MS_Side = 205, + + // X-Y Recording + kIOAudioChannelLabel_XY_X = 206, + kIOAudioChannelLabel_XY_Y = 207, + + // other + kIOAudioChannelLabel_HeadphonesLeft = 301, + kIOAudioChannelLabel_HeadphonesRight = 302, + kIOAudioChannelLabel_ClickTrack = 304, + kIOAudioChannelLabel_ForeignLanguage = 305, + + // generic discrete channel + kIOAudioChannelLabel_Discrete = 400, + + // numbered discrete channel + kIOAudioChannelLabel_Discrete_0 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 0, + kIOAudioChannelLabel_Discrete_1 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 1, + kIOAudioChannelLabel_Discrete_2 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 2, + kIOAudioChannelLabel_Discrete_3 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 3, + kIOAudioChannelLabel_Discrete_4 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 4, + kIOAudioChannelLabel_Discrete_5 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 5, + kIOAudioChannelLabel_Discrete_6 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 6, + kIOAudioChannelLabel_Discrete_7 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 7, + kIOAudioChannelLabel_Discrete_8 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 8, + kIOAudioChannelLabel_Discrete_9 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 9, + kIOAudioChannelLabel_Discrete_10 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 10, + kIOAudioChannelLabel_Discrete_11 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 11, + kIOAudioChannelLabel_Discrete_12 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 12, + kIOAudioChannelLabel_Discrete_13 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 13, + kIOAudioChannelLabel_Discrete_14 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 14, + kIOAudioChannelLabel_Discrete_15 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 15, + kIOAudioChannelLabel_Discrete_65535 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 65535 +}; + + + +#endif /* _IOKIT_IOAUDIOTYPES_H */ diff --git a/QualcommWireless/include/IOKit/avc/IOFireWireAVCCommand.h b/QualcommWireless/include/IOKit/avc/IOFireWireAVCCommand.h new file mode 100644 index 0000000..ff9850d --- /dev/null +++ b/QualcommWireless/include/IOKit/avc/IOFireWireAVCCommand.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOFireWireAVCCommand_H +#define _IOKIT_IOFireWireAVCCommand_H + +#include + +/*! @class IOFireWireAVCCommand +*/ +class IOFireWireAVCCommand : public IOFWCommand +{ + OSDeclareDefaultStructors(IOFireWireAVCCommand) + +protected: + IOFWCommand *fWriteCmd; + IOMemoryDescriptor *fMem; + const UInt8 *fCommand; + + UInt32 fCmdLen; + UInt8 *fResponse; + UInt32 *fResponseLen; + int fCurRetries; + int fMaxRetries; + + UInt32 fWriteGen; + UInt16 fWriteNodeID; + bool bypassRobustCommandResponseMatching; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { + bool fStarted; + bool fSyncWakeupSignaled; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *fIOFireWireAVCCommandExpansion; + + static void writeDone(void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd); + + virtual IOReturn complete(IOReturn status); + virtual IOReturn execute(); + virtual void free(); + +public: + virtual bool init(IOFireWireNub *device, const UInt8 * command, UInt32 cmdLen, + UInt8 * response, UInt32 * responseLen); + virtual IOReturn reinit(IOFireWireNub *device, const UInt8 * command, UInt32 cmdLen, + UInt8 * response, UInt32 * responseLen); + + static IOFireWireAVCCommand *withNub(IOFireWireNub *device, const UInt8 * command, UInt32 cmdLen, + UInt8 * response, UInt32 * responseLen); + + static IOFireWireAVCCommand *withNub(IOFireWireNub *device, UInt32 generation, + const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 * responseLen); + + virtual UInt32 handleResponse(UInt16 nodeID, UInt32 len, const void *buf); + + virtual IOReturn resetInterimTimeout(); + + virtual UInt32 handleResponseWithSimpleMatching(UInt16 nodeID, UInt32 len, const void *buf); + + virtual IOReturn submit(bool queue = false); + +private: + OSMetaClassDeclareReservedUsed(IOFireWireAVCCommand, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCCommand, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCCommand, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCCommand, 3); +}; + +#endif // _IOKIT_IOFireWireAVCCommand_H + diff --git a/QualcommWireless/include/IOKit/avc/IOFireWireAVCConsts.h b/QualcommWireless/include/IOKit/avc/IOFireWireAVCConsts.h new file mode 100644 index 0000000..ae7a12c --- /dev/null +++ b/QualcommWireless/include/IOKit/avc/IOFireWireAVCConsts.h @@ -0,0 +1,259 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOFIREWIREAVCCONSTS_H +#define _IOKIT_IOFIREWIREAVCCONSTS_H + +// Fields of AVC frame +typedef enum { + kAVCCommandResponse = 0, + kAVCAddress = 1, + kAVCOpcode = 2, + kAVCOperand0 = 3, + kAVCOperand1 = 4, + kAVCOperand2 = 5, + kAVCOperand3 = 6, + kAVCOperand4 = 7, + kAVCOperand5 = 8, + kAVCOperand6 = 9, + kAVCOperand7 = 10, + kAVCOperand8 = 11 +} IOAVCFrameFields; + +// Command/Response values +typedef enum { + kAVCControlCommand = 0x00, + kAVCStatusInquiryCommand = 0x01, + kAVCSpecificInquiryCommand = 0x02, + kAVCNotifyCommand = 0x03, + kAVCGeneralInquiryCommand = 0x04, + kAVCNotImplementedStatus = 0x08, + kAVCAcceptedStatus = 0x09, + kAVCRejectedStatus = 0x0a, + kAVCInTransitionStatus = 0x0b, + kAVCImplementedStatus = 0x0c, + kAVCChangedStatus = 0x0d, + kAVCInterimStatus = 0x0f +} IOAVCCommandResponse; + +// Opcodes +typedef enum { + + // Unit commands + kAVCPlugInfoOpcode = 0x02, + kAVCOutputPlugSignalFormatOpcode = 0x18, + kAVCInputPlugSignalFormatOpcode = 0x19, + kAVCUnitInfoOpcode = 0x30, + kAVCSubunitInfoOpcode = 0x31, + kAVCConnectionsOpcode = 0x22, + kAVCConnectOpcode = 0x24, + kAVCDisconnectOpcode = 0x25, + kAVCPowerOpcode = 0xB2, + kAVCSignalSourceOpcode = 0x1A, + + // Vendor dependent commands + kAVCVendorDependentOpcode = 0x00, + + // Subunit commands + kAVCOutputSignalModeOpcode = 0x78, + kAVCInputSignalModeOpcode = 0x79, + kAVCSignalModeSD525_60 = 0x00, + kAVCSignalModeSDL525_60 = 0x04, + kAVCSignalModeHD1125_60 = 0x08, + kAVCSignalModeSD625_50 = 0x80, + kAVCSignalModeSDL625_50 = 0x84, + kAVCSignalModeHD1250_50 = 0x88, + kAVCSignalModeDVCPro525_60 = 0x78, + kAVCSignalModeDVCPro625_50 = 0xf8, + + kAVCSignalModeDummyOperand = 0xff, + kAVCSignalModeMask_50 = 0x80, + kAVCSignalModeMask_STYPE = 0x7c, + kAVCSignalModeMask_SDL = 0x04, + kAVCSignalModeMask_DVCPro25 = 0x78 + +} IOAVCOpcodes; + +// Unit/Subunit types +typedef enum { + kAVCVideoMonitor = 0x00, + kAVCAudio = 0x01, + kAVCPrinter = 0x02, + kAVCDiskRecorder = 0x03, + kAVCTapeRecorder = 0x04, + kAVCTuner = 0x05, + kAVCVideoCamera = 0x07, + kAVCCameraStorage = 0x0b, + kAVCVendorUnique = 0x1c, + kAVCNumSubUnitTypes = 0x20 +} IOAVCUnitTypes; + +#define kAVCAllOpcodes 0xFF +#define kAVCAllSubunitsAndUnit 0xEE +#define kAVCMaxNumPlugs 31 +#define kAVCAnyAvailableIsochPlug 0x7F +#define kAVCAnyAvailableExternalPlug 0xFF +#define kAVCAnyAvailableSubunitPlug 0xFF +#define kAVCMultiplePlugs 0xFD +#define kAVCInvalidPlug 0xFE + + +#define IOAVCAddress(type, id) (((type) << 3) | (id)) +#define kAVCUnitAddress 0xff +#define IOAVCType(address) ((address) >> 3) +#define IOAVCId(address) ((address) & 0x7) + +// Macros for Plug Control Register field manipulation + +// Master control registers +#define kIOFWPCRDataRate FWBitRange(0,1) +#define kIOFWPCRDataRatePhase FWBitRangePhase(0,1) +#define kIOFWPCRExtension FWBitRange(8,15) +#define kIOFWPCRExtensionPhase FWBitRangePhase(8,15) +#define kIOFWPCRNumPlugs FWBitRange(27,31) +#define kIOFWPCRNumPlugsPhase FWBitRangePhase(27,31) + +// master output register +#define kIOFWPCRBroadcastBase FWBitRange(2,7) +#define kIOFWPCRBroadcastBasePhase FWBitRangePhase(2,7) + +// plug registers +#define kIOFWPCROnline FWBitRange(0,0) +#define kIOFWPCROnlinePhase FWBitRangePhase(0,0) +#define kIOFWPCRBroadcast FWBitRange(1,1) +#define kIOFWPCRBroadcastPhase FWBitRangePhase(1,1) +#define kIOFWPCRP2PCount FWBitRange(2,7) +#define kIOFWPCRP2PCountPhase FWBitRangePhase(2,7) +#define kIOFWPCRChannel FWBitRange(10,15) +#define kIOFWPCRChannelPhase FWBitRangePhase(10,15) + +// Extra fields for output plug registers +#define kIOFWPCROutputDataRate FWBitRange(16,17) +#define kIOFWPCROutputDataRatePhase FWBitRangePhase(16,17) +#define kIOFWPCROutputOverhead FWBitRange(18,21) +#define kIOFWPCROutputOverheadPhase FWBitRangePhase(18,21) +#define kIOFWPCROutputPayload FWBitRange(22,31) +#define kIOFWPCROutputPayloadPhase FWBitRangePhase(22,31) + +// async plug numbers + +enum +{ + kFWAVCAsyncPlug0 = 0xa0, + kFWAVCAsyncPlug1 = 0xa1, + kFWAVCAsyncPlug2 = 0xa2, + kFWAVCAsyncPlug3 = 0xa3, + kFWAVCAsyncPlug4 = 0xa4, + kFWAVCAsyncPlug5 = 0xa5, + kFWAVCAsyncPlug6 = 0xa6, + kFWAVCAsyncPlug7 = 0xa7, + kFWAVCAsyncPlug8 = 0xa8, + kFWAVCAsyncPlug9 = 0xa9, + kFWAVCAsyncPlug10 = 0xa1, + kFWAVCAsyncPlug11 = 0xab, + kFWAVCAsyncPlug12 = 0xac, + kFWAVCAsyncPlug13 = 0xad, + kFWAVCAsyncPlug14 = 0xae, + kFWAVCAsyncPlug15 = 0xaf, + kFWAVCAsyncPlug16 = 0xb0, + kFWAVCAsyncPlug17 = 0xb1, + kFWAVCAsyncPlug18 = 0xb2, + kFWAVCAsyncPlug19 = 0xb3, + kFWAVCAsyncPlug20 = 0xb4, + kFWAVCAsyncPlug21 = 0xb5, + kFWAVCAsyncPlug22 = 0xb6, + kFWAVCAsyncPlug23 = 0xb7, + kFWAVCAsyncPlug24 = 0xb8, + kFWAVCAsyncPlug25 = 0xb9, + kFWAVCAsyncPlug26 = 0xba, + kFWAVCAsyncPlug27 = 0xbb, + kFWAVCAsyncPlug28 = 0xbc, + kFWAVCAsyncPlug29 = 0xbd, + kFWAVCAsyncPlug30 = 0xbe, + kFWAVCAsyncPlugAny = 0xbf +}; + +enum +{ + kFWAVCStateBusSuspended = 0, + kFWAVCStateBusResumed = 1, + kFWAVCStatePlugReconnected = 2, + kFWAVCStatePlugDisconnected = 3, + kFWAVCStateDeviceRemoved = 4 +}; + +enum +{ + kFWAVCConsumerMode_MORE = 1, + kFWAVCConsumerMode_LAST = 4, + kFWAVCConsumerMode_LESS = 5, + kFWAVCConsumerMode_JUNK = 6, + kFWAVCConsumerMode_LOST = 7 +}; + +enum +{ + kFWAVCProducerMode_SEND = 5, + kFWAVCProducerMode_TOSS = 7 +}; + + +typedef enum +{ + IOFWAVCPlugSubunitSourceType, + IOFWAVCPlugSubunitDestType, + IOFWAVCPlugIsochInputType, + IOFWAVCPlugIsochOutputType, + IOFWAVCPlugAsynchInputType, + IOFWAVCPlugAsynchOutputType, + IOFWAVCPlugExternalInputType, + IOFWAVCPlugExternalOutputType +} IOFWAVCPlugTypes; + +typedef enum +{ + kIOFWAVCSubunitPlugMsgConnected, + kIOFWAVCSubunitPlugMsgDisconnected, + kIOFWAVCSubunitPlugMsgConnectedPlugModified, + kIOFWAVCSubunitPlugMsgSignalFormatModified +} IOFWAVCSubunitPlugMessages; + +// Some plug signal formats +#define kAVCPlugSignalFormatNTSCDV 0x80000000 +#define kAVCPlugSignalFormatPalDV 0x80800000 +#define kAVCPlugSignalFormatMPEGTS 0xA0000000 + +// Possible states of an AVCAsynchronousCommand +typedef enum +{ + kAVCAsyncCommandStatePendingRequest, + kAVCAsyncCommandStateRequestSent, + kAVCAsyncCommandStateRequestFailed, + kAVCAsyncCommandStateWaitingForResponse, + kAVCAsyncCommandStateReceivedInterimResponse, + kAVCAsyncCommandStateReceivedFinalResponse, + kAVCAsyncCommandStateTimeOutBeforeResponse, + kAVCAsyncCommandStateBusReset, + kAVCAsyncCommandStateOutOfMemory, + kAVCAsyncCommandStateCanceled +} IOFWAVCAsyncCommandState; + +#endif // _IOKIT_IOFIREWIREAVCCONSTS_H diff --git a/QualcommWireless/include/IOKit/avc/IOFireWireAVCRequestSpace.h b/QualcommWireless/include/IOKit/avc/IOFireWireAVCRequestSpace.h new file mode 100644 index 0000000..c02797f --- /dev/null +++ b/QualcommWireless/include/IOKit/avc/IOFireWireAVCRequestSpace.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFireWirePCRSpace.h + * + * Class to multiplex access to the FCP request address. + */ +#ifndef _IOKIT_IOFIREWIREAVCREQUESTSPACE_H +#define _IOKIT_IOFIREWIREAVCREQUESTSPACE_H + +#endif /* _IOKIT_IOFIREWIREAVCREQUESTSPACE_H */ diff --git a/QualcommWireless/include/IOKit/avc/IOFireWireAVCTargetSpace.h b/QualcommWireless/include/IOKit/avc/IOFireWireAVCTargetSpace.h new file mode 100644 index 0000000..4f3cdb0 --- /dev/null +++ b/QualcommWireless/include/IOKit/avc/IOFireWireAVCTargetSpace.h @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * + * IOFireWireAVCTargetSpace.h + * + * Class to centralize the AVC Target mode support + * + */ + +#ifndef _IOKIT_IOFIREWIREAVCTARGETSPACE_H +#define _IOKIT_IOFIREWIREAVCTARGETSPACE_H + +#include +#include + +#include +#include +#include +#include + +class IOFireWireAVCProtocolUserClient; +class AVCCommandHandlerInfo; +class AVCSubunitInfo; + +typedef void (*IOFireWireAVCTargetCommandHandlerCallback)(const AVCCommandHandlerInfo *pCmdInfo, + UInt32 generation, + UInt16 nodeID, + const void *command, + UInt32 cmdLen, + IOFWSpeed &speed, + UInt32 handlerSearchIndex); + +typedef void (*IOFireWireAVCSubunitPlugHandlerCallback)(const AVCSubunitInfo *pSubunitInfo, + IOFWAVCSubunitPlugMessages plugMessage, + IOFWAVCPlugTypes plugType, + UInt32 plugNum, + UInt32 messageParams, + UInt32 generation, + UInt16 nodeID); + +/*! +@class AVCCommandHandlerInfo +@abstract internal class to manage installed command handlers +*/ +class AVCCommandHandlerInfo : public OSObject +{ + OSDeclareDefaultStructors(AVCCommandHandlerInfo) +public: + IOFireWireAVCProtocolUserClient * userClient; + IOFireWireAVCTargetCommandHandlerCallback callBack; + OSAsyncReference64 asyncRef; + UInt32 subUnitTypeAndID; + UInt32 opCode; + uint64_t userCallBack; + uint64_t userRefCon; +}; + +typedef struct _AVCSubunitPlugRecord +{ + UInt32 plugSignalFormat; + UInt32 connectionCount; +}AVCSubunitPlugRecord; + +/*! +@class AVCSubunitInfo +@abstract internal class to manage installed subunits +*/ +class AVCSubunitInfo : public OSObject +{ + OSDeclareDefaultStructors(AVCSubunitInfo) + bool init(); + void free(); +public: + static AVCSubunitInfo *create(); + IOFireWireAVCProtocolUserClient * userClient; + IOFireWireAVCSubunitPlugHandlerCallback callBack; + OSAsyncReference64 asyncRef; + UInt32 subunitTypeAndID; + UInt32 numSourcePlugs; + UInt32 numDestPlugs; + uint64_t userCallBack; + uint64_t userRefCon; + AVCSubunitPlugRecord *sourcePlugRecords; + AVCSubunitPlugRecord *destPlugRecords; +}; + +typedef struct _AVCUnitPlugRecord +{ + UInt32 connectionCount; +}AVCUnitPlugRecord; + +typedef struct _AVCUnitPlugs +{ + UInt32 numIsochInPlugs; + UInt32 numIsochOutPlugs; + UInt32 numExternalInPlugs; + UInt32 numExternalOutPlugs; + AVCUnitPlugRecord isochInPlugRecord[kAVCMaxNumPlugs]; + AVCUnitPlugRecord isochOutPlugRecord[kAVCMaxNumPlugs]; + AVCUnitPlugRecord externalInPlugRecord[kAVCMaxNumPlugs]; + AVCUnitPlugRecord externalOutPlugRecord[kAVCMaxNumPlugs]; +}AVCUnitPlugs; + +/*! +@class UCInfo +@abstract internal class to manage multiple protocol user clients +*/ +class UCInfo : public OSObject +{ + OSDeclareDefaultStructors(UCInfo) +public: + IOFireWireAVCProtocolUserClient *fUserClient; +}; + +/*! +@class AVCConnectionRecord +@abstract internal class to manage AVC connections +*/ +class AVCConnectionRecord : public OSObject +{ + OSDeclareDefaultStructors(AVCConnectionRecord) +public: + UInt32 sourceSubunitTypeAndID; + IOFWAVCPlugTypes sourcePlugType; + UInt32 sourcePlugNum; + UInt32 destSubunitTypeAndID; + IOFWAVCPlugTypes destPlugType; + UInt32 destPlugNum; + bool lockConnection; + bool permConnection; +}; + +/*! +@class IOFireWireAVCTargetSpace +@abstract object to centralize the AVC Target mode support +*/ +class IOFireWireAVCTargetSpace : public IOFWPseudoAddressSpace +{ + OSDeclareDefaultStructors(IOFireWireAVCTargetSpace) + +protected: + UInt32 fBuf[512]; + UInt32 fActivations; + IOFireWireController *fController; + IOLocalConfigDirectory * fAVCLocalConfigDirectory; + OSArray * fUserClients; + OSArray * fCommandHandlers; + OSArray * fSubunits; + OSArray * fConnectionRecords; + AVCUnitPlugs fUnitPlugs; + IORecursiveLock * fLock; + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual UInt32 doWrite(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon); + + + IOReturn targetSendAVCResponse(UInt32 generation, UInt16 nodeID, IOBufferMemoryDescriptor *pBufMemDesc, UInt32 size); + + // Internal AVC Target Command Handlers + IOReturn handleUnitInfoCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleSubUnitInfoCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handlePlugInfoCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handlePowerCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleConnectCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleDisconnectCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleInputPlugSignalFormatCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleOutputPlugSignalFormatCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleConnectionsCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleSignalSourceCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + + UInt32 subUnitOfTypeCount(UInt32 type); + AVCSubunitInfo *getSubunitInfo(UInt32 subunitTypeAndID); + bool canConnectDestPlug(UInt32 destSubunitTypeAndID, + IOFWAVCPlugTypes destPlugType, + UInt32 *destPlugNum); + +public: + + // Activate/Deactivate Functions + virtual IOReturn activateWithUserClient(IOFireWireAVCProtocolUserClient *userClient); + virtual void deactivateWithUserClient(IOFireWireAVCProtocolUserClient *userClient); + + /*! + @function init + @abstract initializes the IOFireWireAVCTargetSpace object + */ + virtual bool init(IOFireWireController *controller); + + /*! + @function getAVCTargetSpace + @abstract returns the IOFireWireAVCTargetSpace object for the given FireWire bus + @param bus The FireWire bus + */ + static IOFireWireAVCTargetSpace *getAVCTargetSpace(IOFireWireController *controller); + + /*! + @function publishAVCUnitDirectory + @abstract Creates a local AVC Unit directory if it doesn't already exist + */ + virtual IOReturn publishAVCUnitDirectory(void); + + virtual IOReturn installAVCCommandHandler(IOFireWireAVCProtocolUserClient *userClient, + IOFireWireAVCTargetCommandHandlerCallback callBack, + OSAsyncReference64 asyncRef, + UInt32 subUnitTypeAndID, + UInt32 opCode, + uint64_t userCallBack, + uint64_t userRefCon); + + virtual IOReturn addSubunit(IOFireWireAVCProtocolUserClient *userClient, + IOFireWireAVCSubunitPlugHandlerCallback callBack, + OSAsyncReference64 asyncRef, + UInt32 subunitType, + UInt32 numSourcePlugs, + UInt32 numDestPlugs, + uint64_t userCallBack, + uint64_t userRefCon, + UInt32 *subUnitID); + + virtual IOReturn setSubunitPlugSignalFormat(IOFireWireAVCProtocolUserClient *userClient, + UInt32 subunitTypeAndID, + IOFWAVCPlugTypes plugType, + UInt32 plugNum, + UInt32 signalFormat); + + virtual IOReturn getSubunitPlugSignalFormat(IOFireWireAVCProtocolUserClient *userClient, + UInt32 subunitTypeAndID, + IOFWAVCPlugTypes plugType, + UInt32 plugNum, + UInt32 *pSignalFormat); + + virtual IOReturn connectTargetPlugs(IOFireWireAVCProtocolUserClient *userClient, + AVCConnectTargetPlugsInParams *inParams, + AVCConnectTargetPlugsOutParams *outParams); + + virtual IOReturn disconnectTargetPlugs(IOFireWireAVCProtocolUserClient *userClient, + UInt32 sourceSubunitTypeAndID, + IOFWAVCPlugTypes sourcePlugType, + UInt32 sourcePlugNum, + UInt32 destSubunitTypeAndID, + IOFWAVCPlugTypes destPlugType, + UInt32 destPlugNum); + + virtual IOReturn getTargetPlugConnection(IOFireWireAVCProtocolUserClient *userClient, + AVCGetTargetPlugConnectionInParams *inParams, + AVCGetTargetPlugConnectionOutParams *outParams); + + virtual IOReturn findAVCRequestHandler(IOFireWireAVCProtocolUserClient *userClient, + UInt32 generation, + UInt16 nodeID, + IOFWSpeed speed, + UInt32 handlerSearchIndex, + const char *pCmdBuf, + UInt32 cmdLen); + + virtual void pcrModified(IOFWAVCPlugTypes plugType, + UInt32 plugNum, + UInt32 newValue); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireAVCTargetSpace, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCTargetSpace, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCTargetSpace, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCTargetSpace, 3); +}; + +#endif /*_IOKIT_IOFIREWIREAVCTARGETSPACE_H */ \ No newline at end of file diff --git a/QualcommWireless/include/IOKit/avc/IOFireWireAVCUnit.h b/QualcommWireless/include/IOKit/avc/IOFireWireAVCUnit.h new file mode 100644 index 0000000..0abf1cd --- /dev/null +++ b/QualcommWireless/include/IOKit/avc/IOFireWireAVCUnit.h @@ -0,0 +1,408 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREAVCUNIT_H +#define _IOKIT_IOFIREWIREAVCUNIT_H + +#include +#include +#include +#include +#include + +extern const OSSymbol *gIOAVCUnitType; + +class IOFireWireNub; +class IOFireWireAVCCommand; +class IOFireWirePCRSpace; +class IOFireWireAVCUnit; +class IOFireWireAVCSubUnit; +class IOFireWireAVCAsynchronousCommand; +class IOFireWireAVCNub; + +// The callback prototype for AVC Asynchronous Commands +typedef void (*IOFireWireAVCAsynchronousCommandCallback)(void *pRefCon, IOFireWireAVCAsynchronousCommand *pCommandObject); + +const UInt16 kIOFWAVCAsyncCmdFreed = 0xdead; + +/*! +@class IOFireWireAVCAsynchronousCommand +*/ +class IOFireWireAVCAsynchronousCommand : public IOCommand +{ + OSDeclareDefaultStructors(IOFireWireAVCAsynchronousCommand) + void free(void); + + friend class IOFireWireAVCUnit; + +protected: + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +public: + IOReturn init(const UInt8 * command, UInt32 len, IOFireWireAVCAsynchronousCommandCallback completionCallback, void *pClientRefCon); + IOReturn submit(IOFireWireAVCNub *pAVCNub); + IOReturn cancel(void); + IOReturn reinit(const UInt8 * command, UInt32 cmdLen); + + // This function returns true if this command is currently waiting for a response + bool isPending(void); + + IOFWAVCAsyncCommandState cmdState; + void *pRefCon; + UInt8 *pCommandBuf; + UInt32 cmdLen; + UInt8 *pInterimResponseBuf; + UInt32 interimResponseLen; + UInt8 *pFinalResponseBuf; + UInt32 finalResponseLen; + +protected: + IOFireWireAVCAsynchronousCommandCallback fCallback; + IOFireWireAVCUnit *fAVCUnit; + IOMemoryDescriptor *fMem; + IOFWCommand *fWriteCmd; + IOFWDelayCommand *fDelayCmd; + UInt16 fWriteNodeID; + UInt32 fWriteGen; + +private: + OSMetaClassDeclareReservedUnused(IOFireWireAVCAsynchronousCommand, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCAsynchronousCommand, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCAsynchronousCommand, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCAsynchronousCommand, 3); +}; + +/*! + @class IOFireWireAVCNub + @abstract nub for AVC devices +*/ +class IOFireWireAVCNub : public IOService +{ + OSDeclareDefaultStructors(IOFireWireAVCNub) + +protected: + IOFireWireNub * fDevice; + +public: + // execute AVC command +/*! + @function AVCCommand + @abstract Sends an AVC command to the device and stores the response. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommand(const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen) = 0; + +/*! + @function AVCCommandInGeneration + @abstract Sends an AVC command to the device and stores the response. The command must complete in the specified + FireWire bus generation otherwise kIOFireWireBusReset is returned. + @param generation The bus generation that the command must execute in. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommandInGeneration(UInt32 generation, + const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen) = 0; + +/*! + @function getDevice + @abstract Returns the FireWire device nub that is this object's provider . +*/ + IOFireWireNub* getDevice() const + {return fDevice;}; + +/*! + @function updateAVCCommandTimeout + @abstract By default, AVCCommands timeout 10 seconds after receiving an Interim response. + This function resets the timeout of the current command to 10 seconds from the current time. + Call this repeatedly for AVC commands that take a very long time to execute to prevent premature + timeout. +*/ + virtual IOReturn updateAVCCommandTimeout() = 0; + +private: + OSMetaClassDeclareReservedUsed(IOFireWireAVCNub, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCNub, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCNub, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCNub, 3); +}; + +/*! + @class IOFireWireAVCUnit + @abstract nub for AVC devices +*/ +class IOFireWireAVCUnit : public IOFireWireAVCNub +{ + OSDeclareDefaultStructors(IOFireWireAVCUnit) + + friend class IOFireWireAVCAsynchronousCommand; + +protected: + IOFWPseudoAddressSpace *fFCPResponseSpace; + IOLock *avcLock; + IOFireWireAVCCommand *fCommand; + + UInt8 fSubUnitCount[kAVCNumSubUnitTypes]; + + bool fStarted; + IOLock *cmdLock; + +/*! @struct ExpansionData + @discussion This structure is used to expand the capablilties of the class in a binary compatible way + */ + struct ExpansionData + { + OSArray * fAVCAsyncCommands; + IOFireWireController *fControl; + bool enableRobustAVCCommandResponseMatching; + }; + +/*! @var fIOFireWireAVCUnitExpansion + */ + ExpansionData *fIOFireWireAVCUnitExpansion; + + static UInt32 AVCResponse(void *refcon, UInt16 nodeID, IOFWSpeed &speed, + FWAddress addr, UInt32 len, const void *buf, IOFWRequestRefCon requestRefcon); + + static void rescanSubUnits(void *arg); + + virtual void free(void); + + virtual void updateSubUnits(bool firstTime); + + static void AVCAsynchRequestWriteDone(void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd); + static void AVCAsynchDelayDone(void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd); + +public: + // IOService overrides + virtual bool start(IOService *provider); + virtual IOReturn message(UInt32 type, IOService *provider, void *argument); + virtual IOReturn setProperties (OSObject * properties ); + +/*! @function handleOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result Return true if the open was successful, false otherwise. +*/ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); +/*! + @function handleClose + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of handleOpen. +*/ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + +/*! + @function matchPropertyTable + @abstract Matching language support + Match on the following properties of the unit: + Vendor_ID + GUID + Unit_Type + and available sub-units, match if the device has at least the requested number of a sub-unit type: + AVCSubUnit_0 -> AVCSubUnit_1f +*/ + virtual bool matchPropertyTable(OSDictionary * table); + + // execute AVC command +/*! + @function AVCCommand + @abstract Sends an AVC command to the device and stores the response. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommand(const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen); + +/*! + @function AVCCommandInGeneration + @abstract Sends an AVC command to the device and stores the response. The command must complete in the specified + FireWire bus generation otherwise kIOFireWireBusReset is returned. + @param generation The bus generation that the command must execute in. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommandInGeneration(UInt32 generation, + const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen); + +/*! + @function updateAVCCommandTimeout + @abstract By default, AVCCommands timeout 10 seconds after receiving an Interim response. + This function resets the timeout of the current command to 10 seconds from the current time. + Call this repeatedly for AVC commands that take a very long time to execute to prevent premature + timeout. +*/ + virtual IOReturn updateAVCCommandTimeout(); + +protected: + UInt32 indexOfAVCAsynchronousCommandObject(IOFireWireAVCAsynchronousCommand *pCommandObject); + void removeAVCAsynchronousCommandObjectAtIndex(UInt32 index); + + void lockAVCAsynchronousCommandLock(); + + void unlockAVCAsynchronousCommandLock(); + + bool available(); + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireAVCUnit, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCUnit, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCUnit, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCUnit, 3); + +}; + +/*! + @class IOFireWireAVCSubUnit + @abstract nub for sub unit of AVC devices. Just for matching, calls the AVC unit for all functions. +*/ +class IOFireWireAVCSubUnit : public IOFireWireAVCNub +{ + OSDeclareDefaultStructors(IOFireWireAVCSubUnit) + + friend class IOFireWireAVCAsynchronousCommand; + +protected: + IOFireWireAVCUnit *fAVCUnit; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +public: + virtual bool init(OSDictionary *propTable, IOFireWireAVCUnit *provider); + + // IOService overrides + virtual IOReturn message(UInt32 type, IOService *provider, void *argument); + +/*! @function handleOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result Return true if the open was successful, false otherwise. +*/ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); +/*! + @function handleClose + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of handleOpen. +*/ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + +/*! + @function matchPropertyTable + @abstract Matching language support + Match on the following properties of the sub unit: + Vendor_ID + GUID + SubUnit_Type +*/ + virtual bool matchPropertyTable(OSDictionary * table); + + // execute AVC command +/*! + @function AVCCommand + @abstract Sends an AVC command to the device and stores the response. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommand(const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen); + +/*! + @function AVCCommandInGeneration + @abstract Sends an AVC command to the device and stores the response. The command must complete in the specified + FireWire bus generation otherwise kIOFireWireBusReset is returned. + @param generation The bus generation that the command must execute in. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommandInGeneration(UInt32 generation, + const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen); + +/*! + @function updateAVCCommandTimeout + @abstract By default, AVCCommands timeout 10 seconds after receiving an Interim response. + This function resets the timeout of the current command to 10 seconds from the current time. + Call this repeatedly for AVC commands that take a very long time to execute to prevent premature + timeout. +*/ + virtual IOReturn updateAVCCommandTimeout(); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireAVCSubUnit, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCSubUnit, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCSubUnit, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCSubUnit, 3); + +}; + +#endif // _IOKIT_IOFIREWIREAVCUNIT_H + diff --git a/QualcommWireless/include/IOKit/avc/IOFireWireAVCUserClientCommon.h b/QualcommWireless/include/IOKit/avc/IOFireWireAVCUserClientCommon.h new file mode 100644 index 0000000..cecf812 --- /dev/null +++ b/QualcommWireless/include/IOKit/avc/IOFireWireAVCUserClientCommon.h @@ -0,0 +1,124 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREAVCUSERCLIENTCOMMON_H_ +#define _IOKIT_IOFIREWIREAVCUSERCLIENTCOMMON_H_ + +#include + +#define kIOFireWireAVCLibConnection 13 + +enum IOFWAVCUserClientCommandCodes { + kIOFWAVCUserClientOpen, // kIOUCScalarIScalarO 0,0 + kIOFWAVCUserClientClose, // kIOUCScalarIScalarO 0,0 + kIOFWAVCUserClientOpenWithSessionRef, // kIOUCScalarIScalarO 1,0 + kIOFWAVCUserClientGetSessionRef, // kIOUCScalarIScalarO 0,1 + kIOFWAVCUserClientAVCCommand, // kIOUCStructIStructO -1,-1 + kIOFWAVCUserClientAVCCommandInGen, // kIOUCStructIStructO -1,-1 + kIOFWAVCUserClientUpdateAVCCommandTimeout, // kIOUCScalarIScalarO 0,0 + kIOFWAVCUserClientMakeP2PInputConnection, // KIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientBreakP2PInputConnection, // KIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientMakeP2POutputConnection, // KIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientBreakP2POutputConnection, // KIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientCreateAsyncAVCCommand, // kIOUCStructIStructO -1,-1 + kIOFWAVCUserClientSubmitAsyncAVCCommand, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientCancelAsyncAVCCommand, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientReleaseAsyncAVCCommand, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientReinitAsyncAVCCommand, // // kIOUCScalarIStructI 1, -1 + kIOFWAVCUserClientNumCommands +}; + +enum IOFWAVCUserClientAsyncCommandCodes { + kIOFWAVCUserClientInstallAsyncAVCCommandCallback = kIOFWAVCUserClientNumCommands, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCUserClientNumAsyncCommands +}; + + +enum IOFWAVCProtocolUserClientCommandCodes { + kIOFWAVCProtocolUserClientSendAVCResponse, // kIOUCScalarIStructI 2, -1 + kIOFWAVCProtocolUserClientFreeInputPlug, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCProtocolUserClientReadInputPlug, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCProtocolUserClientUpdateInputPlug, // kIOUCScalarIScalarO 3, 0 + kIOFWAVCProtocolUserClientFreeOutputPlug, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCProtocolUserClientReadOutputPlug, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCProtocolUserClientUpdateOutputPlug, // kIOUCScalarIScalarO 3, 0 + kIOFWAVCProtocolUserClientReadOutputMasterPlug, // kIOUCScalarIScalarO 0, 1 + kIOFWAVCProtocolUserClientUpdateOutputMasterPlug, // kIOUCScalarIScalarO 2, 0 + kIOFWAVCProtocolUserClientReadInputMasterPlug, // kIOUCScalarIScalarO 0, 1 + kIOFWAVCProtocolUserClientUpdateInputMasterPlug, // kIOUCScalarIScalarO 2, 0 + kIOFWAVCProtocolUserClientPublishAVCUnitDirectory, // kIOUCScalarIScalarO 0, 0 + kIOFWAVCProtocolUserClientSetSubunitPlugSignalFormat, // kIOUCScalarIScalarO 4, 0 + kIOFWAVCProtocolUserClientGetSubunitPlugSignalFormat, // kIOUCScalarIScalarO 3, 1 + kIOFWAVCProtocolUserClientConnectTargetPlugs, // kIOUCStructIStructO + kIOFWAVCProtocolUserClientDisconnectTargetPlugs, // kIOUCScalarIScalarO 6, 0 + kIOFWAVCProtocolUserClientGetTargetPlugConnection, // kIOUCStructIStructO + kIOFWAVCProtocolUserClientAVCRequestNotHandled, // kIOUCScalarIStructI 4, -1 + kIOFWAVCProtocolUserClientNumCommands +}; + +enum IOFWAVCProtocolUserClientAsyncCommandCodes { + kIOFWAVCProtocolUserClientSetAVCRequestCallback = kIOFWAVCProtocolUserClientNumCommands, // kIOUCScalarIScalarO 2, 0 + kIOFWAVCProtocolUserClientAllocateInputPlug, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCProtocolUserClientAllocateOutputPlug, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCProtocolUserClientInstallAVCCommandHandler, // kIOUCScalarIScalarO 4, 0 + kIOFWAVCProtocolUserClientAddSubunit, // kIOUCScalarIScalarO 5, 1 + kIOFWAVCProtocolUserClientNumAsyncCommands +}; + +typedef struct _AVCConnectTargetPlugsInParams +{ + UInt32 sourceSubunitTypeAndID; + IOFWAVCPlugTypes sourcePlugType; + UInt32 sourcePlugNum; + UInt32 destSubunitTypeAndID; + IOFWAVCPlugTypes destPlugType; + UInt32 destPlugNum; + Boolean lockConnection; + Boolean permConnection; +}AVCConnectTargetPlugsInParams; + +typedef struct _AVCConnectTargetPlugsOutParams +{ + UInt32 sourcePlugNum; + UInt32 destPlugNum; +}AVCConnectTargetPlugsOutParams; + +typedef struct _AVCGetTargetPlugConnectionInParams +{ + UInt32 subunitTypeAndID; + IOFWAVCPlugTypes plugType; + UInt32 plugNum; +}AVCGetTargetPlugConnectionInParams; + +typedef struct _AVCGetTargetPlugConnectionOutParams +{ + UInt32 connectedSubunitTypeAndID; + IOFWAVCPlugTypes connectedPlugType; + UInt32 connectedPlugNum; + Boolean lockConnection; + Boolean permConnection; +}AVCGetTargetPlugConnectionOutParams; + +#define kAsyncCmdSharedBufInterimRespOffset 0 +#define kAsyncCmdSharedBufFinalRespOffset 512 + +#endif // _IOKIT_IOFIREWIREAVCUSERCLIENTCOMMON_H_ \ No newline at end of file diff --git a/QualcommWireless/include/IOKit/avc/IOFireWirePCRSpace.h b/QualcommWireless/include/IOKit/avc/IOFireWirePCRSpace.h new file mode 100644 index 0000000..9f31176 --- /dev/null +++ b/QualcommWireless/include/IOKit/avc/IOFireWirePCRSpace.h @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFireWirePCRSpace.h + * + * Class to multiplex access to the PCR addresses. + */ +#ifndef _IOKIT_IOFIREWIREPCRSPACE_H +#define _IOKIT_IOFIREWIREPCRSPACE_H + +#include +#include + +/*! + @typedef IOFireWirePCRCallback + @abstract Callback called after a successful lock transaction to a plug. + @param refcon refcon supplied to the IOFireWireFCPSpace when a client is registered + @param nodeID is the node originating the request + @param plugNo is the plug number + @param oldVal is the value the plug used to contain + @param newVal is the quad written into the plug + + */ +typedef void (*IOFireWirePCRCallback)(void *refcon, UInt16 nodeID, UInt32 plug, UInt32 oldVal, UInt32 newVal); + +class IOFireWireBus; + +/*! + @class IOFireWirePCRSpace + @abstract object to multiplex users of the PCR plug registers +*/ +class IOFireWirePCRSpace : public IOFWPseudoAddressSpace +{ + OSDeclareDefaultStructors(IOFireWirePCRSpace) + +protected: + struct Client { + IOFireWirePCRCallback func; + void * refcon; + }; + UInt32 fBuf[64]; + + Client fClients[64]; + UInt32 fActivations; + IOFireWireAVCTargetSpace * fAVCTargetSpace; + IONotifier *fNotifier; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + // Override to notify client of each plug seperately + virtual UInt32 doWrite(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon); + + virtual IOReturn allocatePlug(void *refcon, IOFireWirePCRCallback func, UInt32 &plug, Client* head); + virtual void freePlug(UInt32 plug, Client* head); + virtual UInt32 readPlug(UInt32 plug); + virtual IOReturn updatePlug(UInt32 plug, UInt32 oldVal, UInt32 newVal); + +public: + + // Override to handle multiple activations (one per client) + virtual IOReturn activate(); + virtual void deactivate(); + +/*! + @function init + @abstract initializes the IOFireWirePCRSpace object +*/ + virtual bool init(IOFireWireBus *bus); +/*! + @function getPCRAddressSpace + @abstract returns the IOFireWirePCRSpace object for the given FireWire bus + @param bus The FireWire bus +*/ + static IOFireWirePCRSpace *getPCRAddressSpace(IOFireWireBus *bus); +/*! + @function allocateInputPlug + @abstract allocates an input plug. + @param refcon arbitrary value passed back as first argument of callback. + @param func callback function when a successful lock transaction to the plug has been performed + @param plug set to the plug number if a plug is successfully allocated +*/ + virtual IOReturn allocateInputPlug(void *refcon, IOFireWirePCRCallback func, UInt32 &plug); +/*! + @function freeInputPlug + @abstract deallocates an input plug. + @param plug value returned by allocateInputPlug. +*/ + virtual void freeInputPlug(UInt32 plug); +/*! + @function readInputPlug + @abstract returns the current value of an input plug. + @param plug value returned by allocateInputPlug. +*/ + virtual UInt32 readInputPlug(UInt32 plug); +/*! + @function updateInputPlug + @abstract updates the value of an input plug (simulating a lock transaction). + @param plug value returned by allocateInputPlug. + @param oldVal value returned by readInputPlug. + @param newVal new value to store in plug if it's current value is oldVal. +*/ + virtual IOReturn updateInputPlug(UInt32 plug, UInt32 oldVal, UInt32 newVal); +/*! + @function allocateOutputPlug + @abstract allocates an output plug. + @param refcon arbitrary value passed back as first argument of callback. + @param func callback function when a successful lock transaction to the plug has been performed + @param plug set to the plug number if a plug is successfully allocated +*/ + virtual IOReturn allocateOutputPlug(void *refcon, IOFireWirePCRCallback func, UInt32 &plug); +/*! + @function freeOutputPlug + @abstract deallocates an output plug. + @param plug value returned by allocateOutputPlug. +*/ + virtual void freeOutputPlug(UInt32 plug); +/*! + @function readOutputPlug + @abstract returns the current value of an output plug. + @param plug value returned by allocateOutputPlug. +*/ + virtual UInt32 readOutputPlug(UInt32 plug); +/*! + @function updateOutputPlug + @abstract updates the value of an output plug (simulating a lock transaction). + @param plug value returned by allocateOutputPlug. + @param oldVal value returned by readOutputPlug. + @param newVal new value to store in plug if it's current value is oldVal. +*/ + virtual IOReturn updateOutputPlug(UInt32 plug, UInt32 oldVal, UInt32 newVal); +/*! + @function readOutputMasterPlug + @abstract returns the current value of the output master plug. +*/ + virtual UInt32 readOutputMasterPlug(); +/*! + @function updateOutputMasterPlug + @abstract updates the value of the master output plug (simulating a lock transaction). + @param oldVal value returned by readOutputMasterPlug. + @param newVal new value to store in plug if it's current value is oldVal. +*/ + virtual IOReturn updateOutputMasterPlug(UInt32 oldVal, UInt32 newVal); +/*! + @function readInputMasterPlug + @abstract returns the current value of the input master plug. +*/ + virtual UInt32 readInputMasterPlug(); +/*! + @function updateInputMasterPlug + @abstract updates the value of the master input plug (simulating a lock transaction). + @param oldVal value returned by readInputMasterPlug. + @param newVal new value to store in plug if it's current value is oldVal. +*/ + virtual IOReturn updateInputMasterPlug(UInt32 oldVal, UInt32 newVal); + + /*! + @function setAVCTargetSpacePointer + */ + virtual void setAVCTargetSpacePointer(IOFireWireAVCTargetSpace *pAVCTargetSpace); + + /*! + @function clearAllP2PConnections + */ + virtual void clearAllP2PConnections(void); + +private: + OSMetaClassDeclareReservedUnused(IOFireWirePCRSpace, 0); + OSMetaClassDeclareReservedUnused(IOFireWirePCRSpace, 1); + OSMetaClassDeclareReservedUnused(IOFireWirePCRSpace, 2); + OSMetaClassDeclareReservedUnused(IOFireWirePCRSpace, 3); + +}; + +#endif /* _IOKIT_IOFIREWIREPCRSPACE_H */ diff --git a/QualcommWireless/include/IOKit/battery/AppleSmartBatteryCommands.h b/QualcommWireless/include/IOKit/battery/AppleSmartBatteryCommands.h new file mode 100644 index 0000000..83e4535 --- /dev/null +++ b/QualcommWireless/include/IOKit/battery/AppleSmartBatteryCommands.h @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2018 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef RE_APPLE_APPLESMARTBATTERYCOMMANDS_H +#define RE_APPLE_APPLESMARTBATTERYCOMMANDS_H + +/* SMBus Device addresses */ +enum { + kSMBusAppleDoublerAddr = 0xd, + kSMBusBatteryAddr = 0xb, + kSMBusManagerAddr = 0xa, + kSMBusChargerAddr = 0x9 +}; + +/* System Manager Commands */ +/* Smart Battery System Manager spec - rev 1.1 */ +/* Section 5 SBSM Interface */ +enum { + kMStateCmd = 0x01, + kMStateContCmd = 0x02 +}; + +/* SBSM BatterySystemState bitfields */ +/* Smart Battery System Manager spec - rev 1.1 */ +/* Section 5.1 */ +enum { + kMChargingBatt_A_Bit = 0x0010, + kMPresentBatt_A_Bit = 0x0001 +}; + +/* SBSM BatterySystemStateCont bitfields */ +/* Smart Battery System Manager spec - rev 1.1 */ +/* Section 5.2 */ +enum { + kMACPresentBit = 0x0001, + kMPowerNotGoodBit = 0x0002, + kMCalibrateBit = 0x0040, +}; + +/* Smart Battery Commands */ +/* Smart Battery Data Specification - rev 1.1 */ +/* Section 5.1 SMBus Host to Smart Battery Messages */ + +/* kBManufactureDateCmd + * Date is published in a bitfield per the Smart Battery Data spec rev 1.1 + * in section 5.1.26 + * Bits 0...4 => day (value 1-31; 5 bits) + * Bits 5...8 => month (value 1-12; 4 bits) + * Bits 9...15 => years since 1980 (value 0-127; 7 bits) + * + * Custom commands not specific to 'Smart Battery Data spec' are defined + * with lower 16-bits set to 0. + */ +enum { + kBManufacturerAccessCmd = 0x00, // READ/WRITE WORD + kBRemainingCapacityAlarmCmd = 0x01, // READ/WRITE WORD, not used by Apple + kBRemainingTimeAlarmCmd = 0x02, // READ/WRITE WORD, not used by Apple + kBTemperatureCmd = 0x08, // READ WORD + kBVoltageCmd = 0x09, // READ WORD aka B0AV + kBCurrentCmd = 0x0a, // READ WORD aka B0AC + kBAverageCurrentCmd = 0x0b, // READ WORD + kBMaxErrorCmd = 0x0c, // READ WORD + kBRemainingCapacityCmd = 0x0f, // READ WORD aka B0RM + kBFullChargeCapacityCmd = 0x10, // READ WORD aka B0FC + kBRunTimeToEmptyCmd = 0x11, // READ WORD + kBAverageTimeToEmptyCmd = 0x12, // READ WORD + kBAverageTimeToFullCmd = 0x13, // READ WORD aka B0TF + kBChargingCurrentCmd = 0x14, // READ/WRITE WORD + kBBatteryStatusCmd = 0x16, // READ WORD aka B0St + kBCycleCountCmd = 0x17, // READ WORD aka B0CT + kBDesignCapacityCmd = 0x18, // READ WORD + kBManufactureDateCmd = 0x1b, // READ WORD + kBSerialNumberCmd = 0x1c, // READ WORD + kBManufacturerNameCmd = 0x20, // READ BLOCK + kBDeviceNameCmd = 0x21, // READ BLOCK + kBManufacturerDataCmd = 0x23, // READ BLOCK + kBReadCellVoltage4Cmd = 0x3c, // READ WORD aka NOOP, should be BC4V (bug?) + kBReadCellVoltage3Cmd = 0x3d, // READ WORD BC3V + kBReadCellVoltage2Cmd = 0x3e, // READ WORD BC2V + kBReadCellVoltage1Cmd = 0x3f, // READ WORD BC1V + kBManufacturerInfoCmd = 0x70, // READ BLOCK + kBDesignCycleCount9CCmd = 0x9C, // READ WORD + kBPackReserveCmd = 0x8B, // READ WORD +}; + +/* Smart Battery Extended Registers */ +/* bq20z90-V110 + bq29330 Chipset Technical Reference Manual */ +/* TI Literature SLUU264 */ +enum { + kBExtendedPFStatusCmd = 0x53, // READ WORD aka B0PS + kBExtendedOperationStatusCmd = 0x54 // READ WORD aka B0OS +}; + +/* Apple Hardware Serial Number */ +enum { + kBAppleHardwareSerialCmd = 0x76 // READ BLOCK +}; + +/* Smart Battery Status Message Bits */ +/* Smart Battery Data Specification - rev 1.1 */ +/* Section 5.4 page 42 */ +enum { + kBOverChargedAlarmBit = 0x8000, + kBTerminateChargeAlarmBit = 0x4000, + kBOverTempAlarmBit = 0x1000, + kBTerminateDischargeAlarmBit = 0x0800, + kBRemainingCapacityAlarmBit = 0x0200, + kBRemainingTimeAlarmBit = 0x0100, + kBInitializedStatusBit = 0x0080, + kBDischargingStatusBit = 0x0040, + kBFullyChargedStatusBit = 0x0020, + kBFullyDischargedStatusBit = 0x0010 +}; + +/* message command for battery status refresh */ +/* word in big endian, second byte respresents battery presence */ +enum { + kBMessageStatusCmd = 0x0A +}; + +/* default value used for kBReadCellVoltage1Cmd and keys BC1V/BC2V/BC3V */ +static constexpr uint16_t defaultBatteryCellVoltage = 16000; + +#endif /* RE_APPLE_APPLESMARTBATTERYCOMMANDS_H */ diff --git a/QualcommWireless/include/IOKit/bluetooth/AppleCSRBluetoothHostController.h b/QualcommWireless/include/IOKit/bluetooth/AppleCSRBluetoothHostController.h new file mode 100644 index 0000000..b436588 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/AppleCSRBluetoothHostController.h @@ -0,0 +1,86 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _APPLE_APPLECSRBLUETOOTHHOSTCONTROLLER_H +#define _APPLE_APPLECSRBLUETOOTHHOSTCONTROLLER_H + +#include + +class AppleCSRBluetoothHostController : public CSRBluetoothHostController +{ + OSDeclareDefaultStructors(AppleCSRBluetoothHostController) + +public: + virtual bool init(IOBluetoothHCIController * family, IOBluetoothHostControllerTransport * transport) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual IOReturn CleanUpBeforeTransportTerminate(IOBluetoothHostControllerTransport * transport) APPLE_KEXT_OVERRIDE; + virtual IOReturn setPropertiesWL(OSObject * properties) APPLE_KEXT_OVERRIDE; + virtual bool GetCompleteCodeForCommand(BluetoothHCICommandOpCode inOpCode, BluetoothHCIEventCode * outEventCode) APPLE_KEXT_OVERRIDE; + virtual bool SetHCIRequestRequireEvents(UInt16, IOBluetoothHCIRequest * request) APPLE_KEXT_OVERRIDE; + virtual bool NeedToIncreaseInactivityTime() APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 0); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 1); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 2); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 3); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 4); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 5); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 6); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 7); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 8); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 9); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 10); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 11); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 12); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 13); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 14); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 15); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 16); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 17); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 18); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 19); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 20); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 21); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 22); + OSMetaClassDeclareReservedUnused(AppleCSRBluetoothHostController, 23); + +protected: + struct ExpansionData + { + void * mRefCon; + }; + ExpansionData * mExpansionData; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/Bluetooth.h b/QualcommWireless/include/IOKit/bluetooth/Bluetooth.h new file mode 100644 index 0000000..ae31787 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/Bluetooth.h @@ -0,0 +1,2955 @@ +/* + * Copyright (c) 2021 Apple Inc. All rights reserved. + * Copyright (c) 2021 cjiang. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/*! + * @header Bluetooth.h + * This header contains public interfaces for Bluetooth technology used by IOBluetooth. + */ + +#pragma once + +#ifdef KERNEL +#import +#else +#import +#import +#endif + +#import +#import + +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +#ifdef __cplusplus +#define IOBLUETOOTH_EXPORT extern "C" +#else +#define IOBLUETOOTH_EXPORT extern +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if 0 +#pragma mark === Baseband === +#endif + +typedef uint16_t BluetoothConnectionHandle; // Upper 4 bits are reserved. +typedef uint8_t BluetoothLMPHandle; +enum +{ + kBluetoothConnectionHandleNone = 0xffff +}; + +typedef uint8_t BluetoothReasonCode; +typedef uint8_t BluetoothEncryptionEnable; +enum +{ + kBluetoothEncryptionEnableOff = 0x00, + kBluetoothEncryptionEnableOn = 0x01, + + kBluetoothEncryptionEnableBREDRE0 = 0x01, + kBluetoothEncryptionEnableLEAESCCM = 0x01, + kBluetoothEncryptionEnableBREDRAESCCM = 0x02 +}; + +typedef uint8_t BluetoothKeyFlag; +enum +{ + kBluetoothKeyFlagSemiPermanent = 0x00, + kBluetoothKeyFlagTemporary = 0x01 +}; + +typedef uint8_t BluetoothKeyType; +enum +{ + kBluetoothKeyTypeCombination = 0x00, + kBluetoothKeyTypeLocalUnit = 0x01, + kBluetoothKeyTypeRemoteUnit = 0x02, + kBluetoothKeyTypeDebugCombination = 0x03, + kBluetoothKeyTypeUnauthenticatedCombination = 0x04, + kBluetoothKeyTypeAuthenticatedCombination = 0x05, + kBluetoothKeyTypeChangedCombination = 0x06, + kBluetoothKeyTypeUnauthenticatedCombinationP256 = 0x07, + kBluetoothKeyTypeAuthenticatedCombinationP256 = 0x08 +}; + +// Packet types (Bluetooth spec section 7.1.5 - Create Connection) + +typedef uint16_t BluetoothPacketType; +enum +{ + kBluetoothPacketTypeReserved1 = 0x0001, + kBluetoothPacketType2DH1Omit = 0x0002, // Masks OUT this packet type + kBluetoothPacketType3DH1Omit = 0x0004, // Masks OUT this packet type + + kBluetoothPacketTypeDM1 = 0x0008, + kBluetoothPacketTypeDH1 = 0x0010, + kBluetoothPacketTypeHV1 = 0x0020, // Reserved + kBluetoothPacketTypeHV2 = 0x0040, // Reserved + kBluetoothPacketTypeHV3 = 0x0080, // Reserved + kBluetoothPacketTypeDV = 0x0100, // Reserved + kBluetoothPacketType2DH3Omit = 0x0100, // Masks OUT this packet type + kBluetoothPacketType3DH3Omit = 0x0200, // Masks OUT this packet type + kBluetoothPacketTypeAUX = 0x0200, // Deprecated + + kBluetoothPacketTypeDM3 = 0x0400, + kBluetoothPacketTypeDH3 = 0x0800, + + kBluetoothPacketType2DH5Omit = 0x1000, // Masks OUT this packet type + kBluetoothPacketType3DM5Omit = 0x2000, // Masks OUT this packet type + + kBluetoothPacketTypeDM5 = 0x4000, + kBluetoothPacketTypeDH5 = 0x8000, + + kBluetoothPacketTypeEnd +}; + +// Setup Synchronous Packet types (Bluetooth 2.1 spec section 7.1.26 - Setup Synchronous Command) + +enum +{ + kBluetoothSynchronousConnectionPacketTypeNone = 0x0000, + kBluetoothSynchronousConnectionPacketTypeHV1 = 0x0001, + kBluetoothSynchronousConnectionPacketTypeHV2 = 0x0002, + kBluetoothSynchronousConnectionPacketTypeHV3 = 0x0004, + kBluetoothSynchronousConnectionPacketTypeEV3 = 0x0008, + kBluetoothSynchronousConnectionPacketTypeEV4 = 0x0010, + kBluetoothSynchronousConnectionPacketTypeEV5 = 0x0020, + + // masking out certain types: + + kBluetoothSynchronousConnectionPacketType2EV3Omit = 0x0040, + kBluetoothSynchronousConnectionPacketType3EV3Omit = 0x0080, + kBluetoothSynchronousConnectionPacketType2EV5Omit = 0x0100, + kBluetoothSynchronousConnectionPacketType3EV5Omit = 0x0200, + + kBluetoothSynchronousConnectionPacketTypeFutureUse = 0xFC00, + + kBluetoothSynchronousConnectionPacketTypeAll = 0xFFFF, + + kBluetoothSynchronousConnectionPacketTypeEnd +}; + +// LAP/Inquiry Access Codes + +typedef uint32_t BluetoothLAP; +enum +{ + kBluetoothGeneralInquiryAccessCodeIndex = 0, // General/Unlimited Inquiry Access Code (GIAC) + kBluetoothGeneralInquiryAccessCodeLAPValue = 0x9E8B33, // General/Unlimited Inquiry Access Code (GIAC) + + kBluetoothLimitedInquiryAccessCodeIndex = 1, // Limited Dedicated Inquiry Access Code (LIAC) + kBluetoothLimitedInquiryAccessCodeLAPValue = 0x9E8B00, // Limited Dedicated Inquiry Access Code (LIAC) + + // All other access codes are reserved for future use (indices 2-63, LAP values 0x9E8B01-0x9E8B32 and 0x9E8B34-0x9E8B3F). + + kBluetoothLimitedInquiryAccessCodeEnd +}; + +// PageScanRepetitionMode + +typedef uint8_t BluetoothPageScanRepetitionMode; +enum +{ + kBluetoothPageScanRepetitionModeR0 = 0x00, + kBluetoothPageScanRepetitionModeR1 = 0x01, + kBluetoothPageScanRepetitionModeR2 = 0x02 + + // All other values are reserved for future use. +}; + +// PageScanPeriodMode + +typedef uint8_t BluetoothPageScanPeriodMode; +enum +{ + kBluetoothPageScanPeriodModeP0 = 0x00, + kBluetoothPageScanPeriodModeP1 = 0x01, + kBluetoothPageScanPeriodModeP2 = 0x02 + + // All other values are reserved for future use. +}; + +// PageScanMode + +typedef uint8_t BluetoothPageScanMode; +enum +{ + kBluetoothPageScanModeMandatory = 0x00, + kBluetoothPageScanModeOptional1 = 0x01, + kBluetoothPageScanModeOptional2 = 0x02, + kBluetoothPageScanModeOptional3 = 0x03 + + // All other values are reserved for future use. +}; + +// PageScanType + +typedef uint8_t BluetoothHCIPageScanType; +enum BluetoothHCIPageScanTypes +{ + kBluetoothHCIPageScanTypeStandard = 0x00, + kBluetoothHCIPageScanTypeInterlaced = 0x01, + + kBluetoothHCIPageScanTypeReservedStart = 0x02, + kBluetoothHCIPageScanTypeReservedEnd = 0xFF +}; + +// Erroneous Data Reporting +typedef uint8_t BluetoothHCIErroneousDataReporting; +enum +{ + kBluetoothHCIErroneousDataReportingDisabled = 0x00, + kBluetoothHCIErroneousDataReportingEnabled = 0x01, + + kBluetoothHCIErroneousDataReportingReservedStart = 0x02, + kBluetoothHCIErroneousDataReportingReservedEnd = 0xFF +}; + +#if 0 +#pragma mark - +#pragma mark === Devices === +#endif + +typedef struct BluetoothDeviceAddress +{ + uint8_t data[6]; +} BluetoothDeviceAddress; + +typedef struct BluetoothKey +{ + uint8_t data[16]; +} BluetoothKey; + +typedef struct BluetoothIRK +{ + uint8_t data[16]; +} BluetoothIRK; + +typedef struct BluetoothPINCode +{ + uint8_t data[16]; // PIN codes may be up to 128 bits. +} BluetoothPINCode; + +// Physical layout of the "class of device/service" field (see Bluetooth Assigned Numbers section 1.2): +// +// 2 2 2 2 1 1 1 1 1 1 1 1 1 1 +// 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 <- Bit Transmission Order +// +---------------+---------------+---------------+ +// | octet 3 | octet 2 | octet 1 | <- Octet Transmission Order +// +---------------+---------------+---------------+ +// <------ 11 bits ----->< 5 bits ><- 6 bits -> +// +---------------------+---------+-----------+-+-+ +// | Service Classes | Major | Minor | | | +// +-+-+-+-+-+-+-+-+-+-+-+ Device | Device |0|0| +// | | | | | | | |*|*|*| | Class | Class | | | +// +-+-+-+-+-+-+-+-+-+-+-+---------+-----------+-+-+ +// | | | | | | | | | +// | | | | | | | + Limited Discoverable +- Format Type +// | | | | | | +- Networking +// | | | | | +- Rendering +// | | | | +- Capturing +// | | | +- Object Transfer +// | | +- Audio +// | +- Telephony +// +- Information + +typedef uint32_t BluetoothClassOfDevice; + +#define BluetoothGetDeviceClassMajor(inCOD) ((inCOD & 0x00001F00) >> 8) +#define BluetoothGetDeviceClassMinor(inCOD) ((inCOD & 0x000000FC) >> 2) +#define BluetoothGetServiceClassMajor(inCOD) ((inCOD & 0x00FFE000) >> 13) +#define BluetoothMakeClassOfDevice(inServiceClassMajor, inDeviceClassMajor, inDeviceClassMinor) \ + (((inServiceClassMajor << 13) & 0x00FFE000) | ((inDeviceClassMajor << 8) & 0x00001F00) | ((inDeviceClassMinor << 2) & 0x000000FC)) + +/// +/// Major Service Classes (11-bit value - bits 13-23 of Device/Service field) +/// + +typedef uint32_t BluetoothServiceClassMajor; +// Service Class Major enum in BluetoothAssignedNumbers.h + +/// +/// Major Device Classes (5-bit value - bits 8-12 of Device/Service field) +/// + +typedef uint32_t BluetoothDeviceClassMajor; +// Device Class Major enum in BluetoothAssignedNumbers.h + +/// +/// Minor Device Classes (6-bit value - bits 2-7 of Device/Service field) +/// + +typedef uint32_t BluetoothDeviceClassMinor; +// Device Class Minor enum in BluetoothAssignedNumbers.h + +// Misc Device Types + +enum +{ + kBluetoothDeviceNameMaxLength = 248 +}; + +typedef uint8_t BluetoothDeviceName[kBluetoothDeviceNameMaxLength]; // Max 248 bytes of UTF-8 encoded Unicode. +typedef uint16_t BluetoothClockOffset; // Bits 14-0 come from bits 16-2 of CLKslav-CLKmaster. +typedef uint8_t BluetoothRole; // +typedef uint8_t BluetoothAllowRoleSwitch; // 0x00-0x01 valid, 0x02-0xFF reserved. +enum +{ + kBluetoothDontAllowRoleSwitch = 0x00, + kBluetoothAllowRoleSwitch = 0x01 +}; + +enum +{ + kBluetoothRoleBecomeMaster = 0x00, + kBluetoothRoleRemainSlave = 0x01 +}; + +typedef struct BluetoothSetEventMask +{ + uint8_t data[8]; +} BluetoothSetEventMask; + +typedef uint8_t BluetoothPINType; + +#if 0 +#pragma mark - +#pragma mark === L2CAP === +#endif + +//=========================================================================================================================== +// Logical Link Control and Adaptation Protocol (L2CAP) +//=========================================================================================================================== + +// ACL Packet values (Bluetooth L2CAP spec section 1). + +enum +{ + kBluetoothL2CAPMaxPacketSize = 65535, // Max number of data bytes in an L2CAP packet. + + kBluetoothACLLogicalChannelReserved = 0, // [00] Reserved for future use + kBluetoothACLLogicalChannelL2CAPContinue = 1, // [01] Continuation of L2CAP packet. + kBluetoothACLLogicalChannelL2CAPStart = 2, // [10] Start of L2CAP packet. + kBluetoothACLLogicalChannelLMP = 3 // [11] Link Manager Protocol packet. +}; + +// Channel Identifiers (Bluetooth L2CAP spec section 2.1). + +typedef uint16_t BluetoothL2CAPChannelID; +enum +{ + kBluetoothL2CAPChannelNull = 0x0000, // Illegal, should not be used + kBluetoothL2CAPChannelSignalling = 0x0001, // L2CAP signalling channel + kBluetoothL2CAPChannelConnectionLessData = 0x0002, // L2CAP connection less data + kBluetoothL2CAPChannelAMPManagerProtocol = 0x0003, // AMP Manager Protocol + kBluetoothL2CAPChannelAttributeProtocol = 0x0004, + kBluetoothL2CAPChannelLESignalling = 0x0005, + kBluetoothL2CAPChannelSecurityManager = 0x0006, + kBluetoothL2CAPChannelBREDRSecurityManager = 0x0007, + // Range 0x0008 to 0x003E reserved for future use. + kBluetoothL2CAPChannelReservedStart = 0x0008, + kBluetoothL2CAPChannelLEAP = 0x002A, + kBluetoothL2CAPChannelLEAS = 0x002B, + kBluetoothL2CAPChannelMagicPairing = 0x0030, + kBluetoothL2CAPChannelMagnet = 0x003A, + kBluetoothL2CAPChannelReservedEnd = 0x003E, + + kBluetoothL2CAPChannelAMPTestManager = 0x003F, + + // Range 0x0040 to 0xFFFF are dynamically allocated. + kBluetoothL2CAPChannelDynamicStart = 0x0040, + kBluetoothL2CAPChannelDynamicEnd = 0xffff, + kBluetoothL2CAPChannelEnd = 0xffff +}; + +typedef BluetoothL2CAPChannelID BluetoothL2CAPGroupID; + +// Protocol/Service Multiplexor (PSM) values (Bluetooth L2CAP spec section 5.2). + +typedef uint16_t BluetoothL2CAPPSM; +// PSM enum in BluetoothAssignedNumbers.h + +// Command Codes + +typedef enum +{ + kBluetoothL2CAPCommandCodeReserved = 0x00, + kBluetoothL2CAPCommandCodeCommandReject = 0x01, + kBluetoothL2CAPCommandCodeConnectionRequest = 0x02, + kBluetoothL2CAPCommandCodeConnectionResponse = 0x03, + kBluetoothL2CAPCommandCodeConfigureRequest = 0x04, + kBluetoothL2CAPCommandCodeConfigureResponse = 0x05, + kBluetoothL2CAPCommandCodeDisconnectionRequest = 0x06, + kBluetoothL2CAPCommandCodeDisconnectionResponse = 0x07, + kBluetoothL2CAPCommandCodeEchoRequest = 0x08, + kBluetoothL2CAPCommandCodeEchoResponse = 0x09, + kBluetoothL2CAPCommandCodeInformationRequest = 0x0A, + kBluetoothL2CAPCommandCodeInformationResponse = 0x0B, + kBluetoothL2CAPCommandCodeCreateChannelRequest = 0x0C, + kBluetoothL2CAPCommandCodeCreateChannelResponse = 0x0D, + kBluetoothL2CAPCommandCodeMoveChannelRequest = 0x0E, + kBluetoothL2CAPCommandCodeMoveChannelResponse = 0x0F, + kBluetoothL2CAPCommandCodeMoveChannelConfirmation = 0x10, + kBluetoothL2CAPCommandCodeMoveChannelConfirmationResponse = 0x11, + kBluetoothL2CAPCommandCodeConnectionParameterUpdateRequest = 0x12, + kBluetoothL2CAPCommandCodeConnectionParameterUpdateResponse = 0x13, + kBluetoothL2CAPCommandCodeLECreditBasedConnectionRequest = 0x14, + kBluetoothL2CAPCommandCodeLECreditBasedConnectionResponse = 0x15, + kBluetoothL2CAPCommandCodeLEFlowControlCredit = 0x16 +} BluetoothL2CAPCommandCode; + +// Command Reject + +typedef enum +{ + kBluetoothL2CAPCommandRejectReasonCommandNotUnderstood = 0x0000, + kBluetoothL2CAPCommandRejectReasonSignallingMTUExceeded = 0x0001, + kBluetoothL2CAPCommandRejectReasonInvalidCIDInRequest = 0x0002 +} BluetoothL2CAPCommandRejectReason; + +typedef uint16_t BluetoothL2CAPMTU; +typedef uint16_t BluetoothL2CAPLinkTimeout; +typedef uint16_t BluetoothL2CAPFlushTimeout; +enum +{ + kBluetoothL2CAPFlushTimeoutUseExisting = 0x0000, + kBluetoothL2CAPFlushTimeoutImmediate = 0x0001, + kBluetoothL2CAPFlushTimeoutForever = 0xFFFF, + + kBluetoothL2CAPFlushTimeoutEnd +}; + +typedef struct BluetoothL2CAPQualityOfServiceOptions +{ + uint8_t flags; + uint8_t serviceType; + uint32_t tokenRate; + uint32_t tokenBucketSize; + uint32_t peakBandwidth; + uint32_t latency; + uint32_t delayVariation; +} BluetoothL2CAPQualityOfServiceOptions; + +typedef struct BluetoothL2CAPRetransmissionAndFlowControlOptions +{ + uint8_t flags; + uint8_t txWindowSize; + uint8_t maxTransmit; + uint16_t retransmissionTimeout; + uint16_t monitorTimeout; + uint16_t maxPDUPayloadSize; +} BluetoothL2CAPRetransmissionAndFlowControlOptions; + +typedef enum BluetoothL2CAPSegmentationAndReassembly +{ + kBluetoothL2CAPSegmentationAndReassemblyUnsegmentedSDU = 0x00, + kBluetoothL2CAPSegmentationAndReassemblyStartOfSDU = 0x01, + kBluetoothL2CAPSegmentationAndReassemblyEndOfSDU = 0x02, + kBluetoothL2CAPSegmentationAndReassemblyContinuationOfSDU = 0x03 +} BluetoothL2CAPSegmentationAndReassembly; + +enum +{ + kBluetoothL2CAPInfoTypeMaxConnectionlessMTUSize = 0x0001 +}; + +// Packets + +enum +{ + kBluetoothL2CAPPacketHeaderSize = 4 +}; + +typedef uint16_t BluetoothL2CAPByteCount; +typedef uint8_t BluetoothL2CAPCommandID; +typedef uint16_t BluetoothL2CAPCommandByteCount; + +typedef enum +{ + kBluetoothL2CAPConnectionResultSuccessful = 0x0000, + kBluetoothL2CAPConnectionResultPending = 0x0001, + kBluetoothL2CAPConnectionResultRefusedPSMNotSupported = 0x0002, + kBluetoothL2CAPConnectionResultRefusedSecurityBlock = 0x0003, + kBluetoothL2CAPConnectionResultRefusedNoResources = 0x0004, + kBluetoothL2CAPConnectionResultRefusedReserved = 0x0005, + kBluetoothL2CAPConnectionResultRefusedInvalidSourceCID = 0x0006, + kBluetoothL2CAPConnectionResultRefusedSourceCIDAlreadyAllocated = 0x0007 +} BluetoothL2CAPConnectionResult; + +typedef enum +{ + kBluetoothL2CAPConnectionStatusNoInfoAvailable = 0x0000, + kBluetoothL2CAPConnectionStatusAuthenticationPending = 0x0001, + kBluetoothL2CAPConnectionStatusAuthorizationPending = 0x0002 +} BluetoothL2CAPConnectionStatus; + +typedef enum +{ + kBluetoothL2CAPConfigurationResultSuccess = 0x0000, + kBluetoothL2CAPConfigurationResultUnacceptableParams = 0x0001, + kBluetoothL2CAPConfigurationResultRejected = 0x0002, + kBluetoothL2CAPConfigurationResultUnknownOptions = 0x0003 +} BluetoothL2CAPConfigurationResult; + +typedef enum +{ + kBluetoothL2CAPConfigurationOptionMTU = 0x01, + kBluetoothL2CAPConfigurationOptionFlushTimeout = 0x02, + kBluetoothL2CAPConfigurationOptionQoS = 0x03, + kBluetoothL2CAPConfigurationOptionRetransmissionAndFlowControl = 0x04, + kBluetoothL2CAPConfigurationOptionFrameCheckSequence = 0x05, + kBluetoothL2CAPConfigurationOptionExtendedFlowSpecification = 0x06, + kBluetoothL2CAPConfigurationOptionExtendedWindowSize = 0x07 +} BluetoothL2CAPConfigurationOption; + +enum +{ + kBluetoothL2CAPConfigurationOptionMTULength = 2, + kBluetoothL2CAPConfigurationOptionFlushTimeoutLength = 2, + kBluetoothL2CAPConfigurationOptionQoSLength = 22, + kBluetoothL2CAPConfigurationOptionRetransmissionAndFlowControlLength = 9 +}; + +typedef enum +{ + kBluetoothL2CAPConfigurationBasicL2CAPModeFlag = 0x00, + kBluetoothL2CAPConfigurationRetransmissionModeFlag = 0x01, + kBluetoothL2CAPConfigurationFlowControlModeFlag = 0x02, + kBluetoothL2CAPConfigurationEnhancedRetransmissionMode = 0x03, + kBluetoothL2CAPConfigurationStreamingMode = 0x04 +} BluetoothL2CAPConfigurationRetransmissionAndFlowControlFlags; + +typedef enum +{ + kBluetoothL2CAPInformationTypeConnectionlessMTU = 0x0001, + kBluetoothL2CAPInformationTypeExtendedFeatures = 0x0002, + kBluetoothL2CAPInformationTypeFixedChannelsSupported = 0x0003 +} BluetoothL2CAPInformationType; + +typedef enum +{ + kBluetoothL2CAPInformationResultSuccess = 0x0000, + kBluetoothL2CAPInformationResultNotSupported = 0x0001 +} BluetoothL2CAPInformationResult; + +typedef enum +{ + kBluetoothL2CAPInformationNoExtendedFeatures = 0x00000000, + kBluetoothL2CAPInformationFlowControlMode = 0x00000001, + kBluetoothL2CAPInformationRetransmissionMode = 0x00000002, + kBluetoothL2CAPInformationBidirectionalQoS = 0x00000004, + kBluetoothL2CAPInformationEnhancedRetransmissionMode = 0x00000008, + kBluetoothL2CAPInformationStreamingMode = 0x00000010, + kBluetoothL2CAPInformationFCSOption = 0x00000020, + kBluetoothL2CAPInformationExtendedFlowSpecification = 0x00000040, + kBluetoothL2CAPInformationFixedChannels = 0x00000080, + kBluetoothL2CAPInformationExtendedWindowSize = 0x00000100, + kBluetoothL2CAPUnicastConnectionlessDataReception = 0x00000200 +} BluetoothL2CAPInformationExtendedFeaturesMask; + +typedef enum BluetoothL2CAPQoSType +{ + kBluetoothL2CAPQoSTypeNoTraffic = 0x00, + kBluetoothL2CAPQoSTypeBestEffort = 0x01, + kBluetoothL2CAPQoSTypeGuaranteed = 0x02 +} BluetoothL2CAPQoSType; + +typedef enum BluetoothL2CAPSupervisoryFuctionType +{ + kBluetoothL2CAPSupervisoryFuctionTypeReceiverReady = 0x0, + kBluetoothL2CAPSupervisoryFuctionTypeReject = 0x1, + kBluetoothL2CAPSupervisoryFuctionTypeReceiverNotReady = 0x2, + kBluetoothL2CAPSupervisoryFuctionTypeSelectiveReject = 0x3 +} BluetoothL2CAPSupervisoryFuctionType; + +enum +{ + kBluetoothLETXTimeMin = 0x0148, // 328 us / 41 octets / 27 (0x1B) byte PDU + kBluetoothLETXTimeDefault = 0x0148, // 328 us + kBluetoothLETXTimeMax = 0x0848, // 2120 us / 265 octets / 251 (0xFB) byte PDU + kBluetoothLETXOctetsMin = 0x001b, // 27 bytes pre-LE DPLE size + kBluetoothLETXOctetsDefault = 0x001b, // 27 bytes + kBluetoothLETXOctetsMax = 0x00fb, // 251 bytes 4.2 LE DPLE feature +}; + +enum +{ + // kBluetoothL2CAPMTULowEnergyDefault = 0x0080, // 128 bytes - DPLE feature + kBluetoothL2CAPMTULowEnergyDefault = kBluetoothLETXOctetsMin, // 27 bytes + kBluetoothL2CAPMTULowEnergyMax = kBluetoothLETXOctetsMax, // 251 bytes + kBluetoothL2CAPMTUMinimum = 0x0030, // 48 bytes + kBluetoothL2CAPMTUDefault = 0x03F9, // 11.10.08 - dropped back to 1017 from 1021 (don't aggravate the 3DH5 problem between CSR<->BRCM just yet) + kBluetoothL2CAPMTUMaximum = 0xffff, + kBluetoothL2CAPMTUStart = 0x7fff, + kBluetoothL2CAPMTUSIG = 0x0030, // 48 bytes + kBluetoothL2CAPFlushTimeoutDefault = kBluetoothL2CAPFlushTimeoutForever, // 0xffff + kBluetoothL2CAPQoSFlagsDefault = 0, + kBluetoothL2CAPQoSTypeDefault = kBluetoothL2CAPQoSTypeBestEffort, // 0x01 + kBluetoothL2CAPQoSTokenRateDefault = 0x00000000, + kBluetoothL2CAPQoSTokenBucketSizeDefault = 0x00000000, + kBluetoothL2CAPQoSPeakBandwidthDefault = 0x00000000, + kBluetoothL2CAPQoSLatencyDefault = 0xffffffff, + kBluetoothL2CAPQoSDelayVariationDefault = 0xffffffff +}; + +enum +{ + kBluetoothLEMaxTXTimeMin = 0x0148, + kBluetoothLEMaxTXTimeDefault = kBluetoothL2CAPMTULowEnergyDefault, + kBluetoothLEMaxTXTimeMax = 0x0848, + kBluetoothLEMaxTXOctetsMin = 0x001b, // 27 bytes + kBluetoothLEMaxTXOctetsDefault = 0x0080, // 128 bytes - DPLE feature + kBluetoothLEMaxTXOctetsMax = 0x00fb // 251 bytes - DPLE feature +}; + +#pragma mark === LE Security Manager === + +#define kBluetoothLESMPTimeout 30 + +#define kBluetoothLESMPMinEncryptionKeySize 7 +#define kBluetoothLESMPMaxEncryptionKeySize 16 + +enum BluetoothLESecurityManagerKeyDistributionFormat +{ + kBluetoothLESecurityManagerEncryptionKey = (1 << 0L), // LTK, EDIV, RAND + kBluetoothLESecurityManagerIDKey = (1 << 1L), // IRK + kBluetoothLESecurityManagerSignKey = (1 << 2L), // CSRK + kBluetoothLESecurityManagerLinkKey = (1 << 3L), // LinkKey +}; + +typedef enum BluetoothLESecurityManagerCommandCode +{ + kBluetoothLESecurityManagerCommandCodeReserved = 0x00, + kBluetoothLESecurityManagerCommandCodePairingRequest = 0x01, + kBluetoothLESecurityManagerCommandCodePairingResponse = 0x02, + kBluetoothLESecurityManagerCommandCodePairingConfirm = 0x03, + kBluetoothLESecurityManagerCommandCodePairingRandom = 0x04, + kBluetoothLESecurityManagerCommandCodePairingFailed = 0x05, + kBluetoothLESecurityManagerCommandCodeEncryptionInfo = 0x06, + kBluetoothLESecurityManagerCommandCodeMasterIdentification = 0x07, + kBluetoothLESecurityManagerCommandCodeIdentityInfo = 0x08, + kBluetoothLESecurityManagerCommandCodeIdentityAddressInfo = 0x09, + kBluetoothLESecurityManagerCommandCodeSigningInfo = 0x0A, + kBluetoothLESecurityManagerCommandCodeSecurityRequest = 0x0B, + kBluetoothLESecurityManagerCommandCodePairingPublicKey = 0x0C, + kBluetoothLESecurityManagerCommandCodePairingDHKeyCheck = 0x0D, + kBluetoothLESecurityManagerCommandCodePairingKeypressNotification = 0x0E, + + // 0x0F - 0xFF reserved + kBluetoothLESecurityManagerCommandCodeReservedStart = 0x0F, + kBluetoothLESecurityManagerCommandCodeReservedEnd = 0xFF +} BluetoothLESecurityManagerCommandCode; + +typedef enum BluetoothLESecurityManagerUserInputCapability +{ + kBluetoothLESecurityManagerUserInputCapabilityNoInput = 0x01, + kBluetoothLESecurityManagerUserInputCapabilityYesNo = 0x02, + kBluetoothLESecurityManagerUserInputCapabilityKeyboard = 0x03 +} BluetoothLESecurityManagerUserInputCapability; + +typedef enum BluetoothLESecurityManagerUserOutputCapability +{ + kBluetoothLESecurityManagerUserOutputCapabilityNoOutput = 0x01, + kBluetoothLESecurityManagerUserOutputCapabilityNumericOutput = 0x02 +} BluetoothLESecurityManagerUserOutputCapability; + +typedef enum BluetoothLESecurityManagerIOCapability +{ + kBluetoothLESecurityManagerIOCapabilityDisplayOnly = 0x00, + kBluetoothLESecurityManagerIOCapabilityDisplayYesNo = 0x01, + kBluetoothLESecurityManagerIOCapabilityKeyboardOnly = 0x02, + kBluetoothLESecurityManagerIOCapabilityNoInputNoOutput = 0x03, + kBluetoothLESecurityManagerIOCapabilityKeyboardDisplay = 0x04, + + // 0x05 - 0xFF reserved + kBluetoothLESecurityManagerIOCapabilityReservedStart = 0x05, + kBluetoothLESecurityManagerIOCapabilityReservedEnd = 0xFF +} BluetoothLESecurityManagerIOCapability; + +typedef enum BluetoothLESecurityManagerOOBData +{ + kBluetoothLESecurityManagerOOBAuthenticationDataNotPresent = 0x00, + kBluetoothLESecurityManagerOOBAuthenticationDataPresent = 0x01, + + // 0x02 - 0xFF reserved + kBluetoothLESecurityManagerOOBDataReservedStart = 0x02, + kBluetoothLESecurityManagerOOBDataReservedEnd = 0xFF +} BluetoothLESecurityManagerOOBData; + +enum +{ + kBluetoothLESecurityManagerNoBonding = 0, // [00] + kBluetoothLESecurityManagerBonding = 1, // [01] + kBluetoothLESecurityManagerReservedStart = 2, // [10] + kBluetoothLESecurityManagerReservedEnd = 3 // [11] +}; + +typedef enum BluetoothLESecurityManagerPairingFailedReasonCode +{ + kBluetoothLESecurityManagerReasonCodeReserved = 0x00, + kBluetoothLESecurityManagerReasonCodePasskeyEntryFailed = 0x01, + kBluetoothLESecurityManagerReasonCodeOOBNotAvailbale = 0x02, + kBluetoothLESecurityManagerReasonCodeAuthenticationRequirements = 0x03, + kBluetoothLESecurityManagerReasonCodeConfirmValueFailed = 0x04, + kBluetoothLESecurityManagerReasonCodePairingNotSupported = 0x05, + kBluetoothLESecurityManagerReasonCodeEncryptionKeySize = 0x06, + kBluetoothLESecurityManagerReasonCodeCommandNotSupported = 0x07, + kBluetoothLESecurityManagerReasonCodeUnspecifiedReason = 0x08, + kBluetoothLESecurityManagerReasonCodeRepeatedAttempts = 0x09, + kBluetoothLESecurityManagerReasonCodeInvalidParameters = 0x0A, + kBluetoothLESecurityManagerReasonCodeDHKeyCheckFailed = 0x0B, + kBluetoothLESecurityManagerReasonCodeNumericComparisonFailed = 0x0C, + kBluetoothLESecurityManagerReasonCodeBREDRPairingInProgress = 0x0D, + kBluetoothLESecurityManagerReasonCodeCrossTransportKeyDerivationGenerationNotAllowed = 0x0E, + + kBluetoothLESecurityManagerReasonCodeReservedStart = 0x0F, + kBluetoothLESecurityManagerReasonCodeReservedEnd = 0xFF +} BluetoothLESecurityManagerPairingFailedReasonCode; + +typedef enum BluetoothLESecurityManagerKeypressNotificationType +{ + kBluetoothLESecurityManagerNotificationTypePasskeyEntryStarted = 0, + kBluetoothLESecurityManagerNotificationTypePasskeyDigitEntered = 1, + kBluetoothLESecurityManagerNotificationTypePasskeyDigitErased = 2, + kBluetoothLESecurityManagerNotificationTypePasskeyCleared = 3, + kBluetoothLESecurityManagerNotificationTypePasskeyEntryCompleted = 4, + + kBluetoothLESecurityManagerNotificationTypeReservedStart = 5, + kBluetoothLESecurityManagerNotificationTypeReservedEnd = 255 +} BluetoothLESecurityManagerKeypressNotificationType; + +#pragma mark === AMP Manager === +typedef enum BluetoothAMPManagerCode +{ + kBluetoothAMPManagerCodeReserved = 0x00, + kBluetoothAMPManagerCodeAMPCommandReject = 0x01, + kBluetoothAMPManagerCodeAMPDiscoverRequest = 0x02, + kBluetoothAMPManagerCodeAMPDiscoverResponse = 0x03, + kBluetoothAMPManagerCodeAMPChangeNotify = 0x04, + kBluetoothAMPManagerCodeAMPChangeResponse = 0x05, + kBluetoothAMPManagerCodeAMPGetInfoRequest = 0x06, + kBluetoothAMPManagerCodeAMPGetInfoResponse = 0x07, + kBluetoothAMPManagerCodeAMPGetAssocRequest = 0x08, + kBluetoothAMPManagerCodeAMPGetAssocResponse = 0x09, + kBluetoothAMPManagerCodeAMPCreatePhysicalLinkRequest = 0x0A, + kBluetoothAMPManagerCodeAMPCreatePhysicalLinkResponse = 0x0B, + kBluetoothAMPManagerCodeAMPDisconnectPhysicalLinkRequest = 0x0C, + kBluetoothAMPManagerCodeAMPDisconnectPhysicalLinkResponse = 0x0D +} BluetoothAMPManagerCode; + +typedef enum BluetoothAMPCommandRejectReason +{ + kBluetoothAMPManagerCommandRejectReasonCommandNotRecognized = 0x0000 +} BluetoothAMPCommandRejectReason; + +typedef enum BluetoothAMPDiscoverResponseControllerStatus +{ + kBluetoothAMPManagerDiscoverResponseControllerStatusPoweredDown = 0x00, + kBluetoothAMPManagerDiscoverResponseControllerStatusBluetoothOnly = 0x01, + kBluetoothAMPManagerDiscoverResponseControllerStatusNoCapacity = 0x02, + kBluetoothAMPManagerDiscoverResponseControllerStatusLowCapacity = 0x03, + kBluetoothAMPManagerDiscoverResponseControllerStatusMediumCapacity = 0x04, + kBluetoothAMPManagerDiscoverResponseControllerStatusHighCapacity = 0x05, + kBluetoothAMPManagerDiscoverResponseControllerStatusFullCapacity = 0x06 +} BluetoothAMPDiscoverResponseControllerStatus; + +typedef enum BluetoothAMPGetInfoResponseStatus +{ + kBluetoothAMPManagerGetInfoResponseSuccess = 0x00, + kBluetoothAMPManagerGetInfoResponseInvalidControllerID = 0x01 +} BluetoothAMPGetInfoResponseStatus; + +typedef enum BluetoothAMPGetAssocResponseStatus +{ + kBluetoothAMPManagerGetAssocResponseSuccess = 0x00, + kBluetoothAMPManagerGetAssocResponseInvalidControllerID = 0x01 +} BluetoothAMPGetAssocResponseStatus; + +typedef enum BluetoothAMPCreatePhysicalLinkResponseStatus +{ + kBluetoothAMPManagerCreatePhysicalLinkResponseSuccess = 0x00, + kBluetoothAMPManagerCreatePhysicalLinkResponseInvalidControllerID = 0x01, + kBluetoothAMPManagerCreatePhysicalLinkResponseUnableToStartLinkCreation = 0x02, + kBluetoothAMPManagerCreatePhysicalLinkResponseCollisionOccurred = 0x03, + kBluetoothAMPManagerCreatePhysicalLinkResponseAMPDisconnectedPhysicalLinkRequestReceived = 0x04, + kBluetoothAMPManagerCreatePhysicalLinkResponsePhysicalLinkAlreadyExists = 0x05, + kBluetoothAMPManagerCreatePhysicalLinkResponseSecurityViolation = 0x06 +} BluetoothAMPCreatePhysicalLinkResponseStatus; + +typedef enum BluetoothAMPDisconnectPhysicalLinkResponseStatus +{ + kBluetoothAMPManagerDisconnectPhysicalLinkResponseSuccess = 0x00, + kBluetoothAMPManagerDisconnectPhysicalLinkResponseInvalidControllerID = 0x01, + kBluetoothAMPManagerDisconnectPhysicalLinkResponseNoPhysicalLink = 0x02 +} BluetoothAMPDisconnectPhysicalLinkResponseStatus; + +#if 0 +#pragma mark - +#pragma mark === HCI === +#endif + +//=========================================================================================================================== +// Host Controller Interface (HCI) +//=========================================================================================================================== + +// HCI Command Packet +// ------------------ +// +// 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 +// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +// +--------------------------------+---------------+--------------+ +// | OpCode | | | +// +--------------------+-----------| Param Length | Params... | +// | OCF | OGF | | | +// +--------------------+-----------+---------------+--------------+ +// | | +// | Params... | +// | | +// +---------------------------------------------------------------+ + +// Commands + +typedef uint8_t BluetoothHCICommandOpCodeGroup; +typedef uint16_t BluetoothHCICommandOpCodeCommand; +typedef uint16_t BluetoothHCICommandOpCode; +typedef uint32_t BluetoothHCIVendorCommandSelector; + +#define BluetoothHCIMakeCommandOpCode(GROUP, CMD) ((((GROUP)&0x003F) << 10) | ((CMD)&0x03FF)) +#define BluetoothHCIMakeCommandOpCodeEndianSwap(GROUP, CMD) CFSwapInt16HostToLittle(BluetoothHCIMakeCommandOpCode(GROUP, CMD)) +#define BluetoothHCIMakeCommandOpCodeHostOrder(GROUP, CMD) OSSwapLittleToHostConstInt16((((GROUP)&0x003F) << 10) | ((CMD)&0x03FF)) + +#define BluetoothHCIExtractCommandOpCodeGroup(OPCODE) (((OPCODE) >> 10) & 0x003F) +#define BluetoothHCIExtractCommandOpCodeCommand(OPCODE) ((OPCODE)&0x03FF) + +enum +{ + // Command Group: NoOp + + kBluetoothHCIOpCodeNoOp = 0, + kBluetoothHCICommandGroupNoOp = 0x00, + kBluetoothHCICommandNoOp = 0x0000, + + // Command Group: Link Control + + kBluetoothHCICommandGroupLinkControl = 0x01, + kBluetoothHCICommandInquiry = 0x0001, + kBluetoothHCICommandInquiryCancel = 0x0002, + kBluetoothHCICommandPeriodicInquiryMode = 0x0003, + kBluetoothHCICommandExitPeriodicInquiryMode = 0x0004, + kBluetoothHCICommandCreateConnection = 0x0005, + kBluetoothHCICommandDisconnect = 0x0006, + kBluetoothHCICommandAddSCOConnection = 0x0007, // DEPRECATED + kBluetoothHCICommandCreateConnectionCancel = 0x0008, + kBluetoothHCICommandAcceptConnectionRequest = 0x0009, + kBluetoothHCICommandRejectConnectionRequest = 0x000A, + kBluetoothHCICommandLinkKeyRequestReply = 0x000B, + kBluetoothHCICommandLinkKeyRequestNegativeReply = 0x000C, + kBluetoothHCICommandPINCodeRequestReply = 0x000D, + kBluetoothHCICommandPINCodeRequestNegativeReply = 0x000E, + kBluetoothHCICommandChangeConnectionPacketType = 0x000F, + kBluetoothHCICommandAuthenticationRequested = 0x0011, + kBluetoothHCICommandSetConnectionEncryption = 0x0013, + kBluetoothHCICommandChangeConnectionLinkKey = 0x0015, + kBluetoothHCICommandMasterLinkKey = 0x0017, + kBluetoothHCICommandRemoteNameRequest = 0x0019, + kBluetoothHCICommandReadRemoteSupportedFeatures = 0x001B, + kBluetoothHCICommandReadRemoteExtendedFeatures = 0x001C, + kBluetoothHCICommandReadRemoteVersionInformation = 0x001D, + kBluetoothHCICommandReadClockOffset = 0x001F, + kBluetoothHCICommandRemoteNameRequestCancel = 0x001A, + kBluetoothHCICommandReadLMPHandle = 0x0020, + kBluetoothHCICommandSetupSynchronousConnection = 0x0028, + kBluetoothHCICommandAcceptSynchronousConnectionRequest = 0x0029, + kBluetoothHCICommandRejectSynchronousConnectionRequest = 0x002A, + kBluetoothHCICommandIOCapabilityRequestReply = 0x002B, + kBluetoothHCICommandUserConfirmationRequestReply = 0x002C, + kBluetoothHCICommandUserConfirmationRequestNegativeReply = 0x002D, + kBluetoothHCICommandUserPasskeyRequestReply = 0x002E, + kBluetoothHCICommandUserPasskeyRequestNegativeReply = 0x002F, + kBluetoothHCICommandRemoteOOBDataRequestReply = 0x0030, + kBluetoothHCICommandRemoteOOBDataRequestNegativeReply = 0x0033, + kBluetoothHCICommandIOCapabilityRequestNegativeReply = 0x0034, + kBluetoothHCICommandEnhancedSetupSynchronousConnection = 0x003D, + kBluetoothHCICommandEnhancedAcceptSynchronousConnectionRequest = 0x003E, + kBluetoothHCICommandTruncatedPage = 0x003F, + kBluetoothHCICommandTruncatedPageCancel = 0x0040, + kBluetoothHCICommandSetConnectionlessSlaveBroadcast = 0x0041, + kBluetoothHCICommandSetConnectionlessSlaveBroadcastReceive = 0x0042, + kBluetoothHCICommandStartSynchronizationTrain = 0x0043, + kBluetoothHCICommandReceiveSynchronizationTrain = 0x0044, + kBluetoothHCICommandRemoteOOBExtendedDataRequestReply = 0x0045, + + // Command Group: Link Policy + + kBluetoothHCICommandGroupLinkPolicy = 0x02, + kBluetoothHCICommandHoldMode = 0x0001, + kBluetoothHCICommandSniffMode = 0x0003, + kBluetoothHCICommandExitSniffMode = 0x0004, + kBluetoothHCICommandParkMode = 0x0005, + kBluetoothHCICommandExitParkMode = 0x0006, + kBluetoothHCICommandQoSSetup = 0x0007, + kBluetoothHCICommandRoleDiscovery = 0x0009, + kBluetoothHCICommandSwitchRole = 0x000B, + kBluetoothHCICommandReadLinkPolicySettings = 0x000C, + kBluetoothHCICommandWriteLinkPolicySettings = 0x000D, + kBluetoothHCICommandReadDefaultLinkPolicySettings = 0x000E, + kBluetoothHCICommandWriteDefaultLinkPolicySettings = 0x000F, + kBluetoothHCICommandFlowSpecification = 0x0010, + kBluetoothHCICommandSniffSubrating = 0x0011, + kBluetoothHCICommandAcceptSniffRequest = 0x0031, + kBluetoothHCICommandRejectSniffRequest = 0x0032, + + // Command Group: Host Controller & Baseband + + kBluetoothHCICommandGroupHostController = 0x03, + kBluetoothHCICommandSetEventMask = 0x0001, + kBluetoothHCICommandReset = 0x0003, + kBluetoothHCICommandSetEventFilter = 0x0005, + kBluetoothHCICommandFlush = 0x0008, + kBluetoothHCICommandReadPINType = 0x0009, + kBluetoothHCICommandWritePINType = 0x000A, + kBluetoothHCICommandCreateNewUnitKey = 0x000B, + kBluetoothHCICommandReadStoredLinkKey = 0x000D, + kBluetoothHCICommandWriteStoredLinkKey = 0x0011, + kBluetoothHCICommandDeleteStoredLinkKey = 0x0012, + kBluetoothHCICommandChangeLocalName = 0x0013, + kBluetoothHCICommandReadLocalName = 0x0014, + kBluetoothHCICommandReadConnectionAcceptTimeout = 0x0015, + kBluetoothHCICommandWriteConnectionAcceptTimeout = 0x0016, + kBluetoothHCICommandReadPageTimeout = 0x0017, + kBluetoothHCICommandWritePageTimeout = 0x0018, + kBluetoothHCICommandReadScanEnable = 0x0019, + kBluetoothHCICommandWriteScanEnable = 0x001A, + kBluetoothHCICommandReadPageScanActivity = 0x001B, + kBluetoothHCICommandWritePageScanActivity = 0x001C, + kBluetoothHCICommandReadInquiryScanActivity = 0x001D, + kBluetoothHCICommandWriteInquiryScanActivity = 0x001E, + kBluetoothHCICommandReadAuthenticationEnable = 0x001F, + kBluetoothHCICommandWriteAuthenticationEnable = 0x0020, + kBluetoothHCICommandReadEncryptionMode = 0x0021, // DEPRECATED + kBluetoothHCICommandWriteEncryptionMode = 0x0022, // DEPRECATED + kBluetoothHCICommandReadClassOfDevice = 0x0023, + kBluetoothHCICommandWriteClassOfDevice = 0x0024, + kBluetoothHCICommandReadVoiceSetting = 0x0025, + kBluetoothHCICommandWriteVoiceSetting = 0x0026, + kBluetoothHCICommandReadAutomaticFlushTimeout = 0x0027, + kBluetoothHCICommandWriteAutomaticFlushTimeout = 0x0028, + kBluetoothHCICommandReadNumberOfBroadcastRetransmissions = 0x0029, + kBluetoothHCICommandWriteNumberOfBroadcastRetransmissions = 0x002A, + kBluetoothHCICommandReadHoldModeActivity = 0x002B, + kBluetoothHCICommandWriteHoldModeActivity = 0x002C, + kBluetoothHCICommandReadTransmitPowerLevel = 0x002D, + kBluetoothHCICommandReadSCOFlowControlEnable = 0x002E, + kBluetoothHCICommandWriteSCOFlowControlEnable = 0x002F, + kBluetoothHCICommandSetHostControllerToHostFlowControl = 0x0031, + kBluetoothHCICommandHostBufferSize = 0x0033, + kBluetoothHCICommandHostNumberOfCompletedPackets = 0x0035, + kBluetoothHCICommandReadLinkSupervisionTimeout = 0x0036, + kBluetoothHCICommandWriteLinkSupervisionTimeout = 0x0037, + kBluetoothHCICommandReadNumberOfSupportedIAC = 0x0038, + kBluetoothHCICommandReadCurrentIACLAP = 0x0039, + kBluetoothHCICommandWriteCurrentIACLAP = 0x003A, + kBluetoothHCICommandReadPageScanPeriodMode = 0x003B, // DEPRECATED + kBluetoothHCICommandWritePageScanPeriodMode = 0x003C, // DEPRECATED + kBluetoothHCICommandReadPageScanMode = 0x003D, // DEPRECATED + kBluetoothHCICommandWritePageScanMode = 0x003E, // DEPRECATED + kBluetoothHCICommandSetAFHClassification = 0x003F, + kBluetoothHCICommandReadInquiryScanType = 0x0042, + kBluetoothHCICommandWriteInquiryScanType = 0x0043, + kBluetoothHCICommandReadInquiryMode = 0x0044, + kBluetoothHCICommandWriteInquiryMode = 0x0045, + kBluetoothHCICommandReadPageScanType = 0x0046, + kBluetoothHCICommandWritePageScanType = 0x0047, + kBluetoothHCICommandReadAFHChannelAssessmentMode = 0x0048, + kBluetoothHCICommandWriteAFHChannelAssessmentMode = 0x0049, + kBluetoothHCICommandReadExtendedInquiryResponse = 0x0051, + kBluetoothHCICommandWriteExtendedInquiryResponse = 0x0052, + kBluetoothHCICommandRefreshEncryptionKey = 0x0053, + kBluetoothHCICommandReadSimplePairingMode = 0x0055, + kBluetoothHCICommandWriteSimplePairingMode = 0x0056, + kBluetoothHCICommandReadLocalOOBData = 0x0057, + kBluetoothHCICommandReadInquiryResponseTransmitPower = 0x0058, + kBluetoothHCICommandWriteInquiryResponseTransmitPower = 0x0059, + kBluetoothHCICommandSendKeypressNotification = 0x0060, + kBluetoothHCICommandReadDefaultErroneousDataReporting = 0x005A, + kBluetoothHCICommandWriteDefaultErroneousDataReporting = 0x005B, + kBluetoothHCICommandEnhancedFlush = 0x005F, + kBluetoothHCICommandReadLogicalLinkAcceptTimeout = 0x0061, + kBluetoothHCICommandWriteLogicalLinkAcceptTimeout = 0x0062, + kBluetoothHCICommandSetEventMaskPageTwo = 0x0063, + kBluetoothHCICommandReadLocationData = 0x0064, + kBluetoothHCICommandWriteLocationData = 0x0065, + kBluetoothHCICommandReadFlowControlMode = 0x0066, + kBluetoothHCICommandWriteFlowControlMode = 0x0067, + kBluetoothHCICommandReadEnhancedTransmitPowerLevel = 0x0068, + kBluetoothHCICommandReadBestEffortFlushTimeout = 0x0069, + kBluetoothHCICommandWriteBestEffortFlushTimeout = 0x006A, + kBluetoothHCICommandShortRangeMode = 0x006B, + kBluetoothHCICommandReadLEHostSupported = 0x006C, + kBluetoothHCICommandWriteLEHostSupported = 0x006D, + kBluetoothHCICommandSetMWSChannelParameters = 0x006E, + kBluetoothHCICommandSetExternalFrameConfiguration = 0x006F, + kBluetoothHCICommandSetMWSSignaling = 0x0070, + kBluetoothHCICommandSetMWSTransportLayer = 0x0071, + kBluetoothHCICommandSetMWSScanFrequencyTable = 0x0072, + kBluetoothHCICommandSetMWSPATTERNConfiguration = 0x0073, + kBluetoothHCICommandSetReservedLTADDR = 0x0074, + kBluetoothHCICommandDeleteReservedLTADDR = 0x0075, + kBluetoothHCICommandSetConnectionlessSlaveBroadcastData = 0x0076, + kBluetoothHCICommandReadSynchronizationTrainParameters = 0x0077, + kBluetoothHCICommandWriteSynchronizationTrainParameters = 0x0078, + kBluetoothHCICommandReadSecureConnectionsHostSupport = 0x0079, + kBluetoothHCICommandWriteSecureConnectionsHostSupport = 0x007A, + kBluetoothHCICommandReadAuthenticatedPayloadTimeout = 0x007B, + kBluetoothHCICommandWriteAuthenticatedPayloadTimeout = 0x007C, + kBluetoothHCICommandReadLocalOOBExtendedData = 0x007D, + kBluetoothHCICommandReadExtendedPageTimeout = 0x007E, + kBluetoothHCICommandWriteExtendedPageTimeout = 0x007F, + kBluetoothHCICommandReadExtendedInquiryLength = 0x0080, + kBluetoothHCICommandWriteExtendedInquiryLength = 0x0081, + + // Command Group: Informational + + kBluetoothHCICommandGroupInformational = 0x04, + kBluetoothHCICommandReadLocalVersionInformation = 0x0001, + kBluetoothHCICommandReadLocalSupportedCommands = 0x0002, + kBluetoothHCICommandReadLocalSupportedFeatures = 0x0003, + kBluetoothHCICommandReadLocalExtendedFeatures = 0x0004, + kBluetoothHCICommandReadBufferSize = 0x0005, + kBluetoothHCICommandReadCountryCode = 0x0007, // DEPRECATED + kBluetoothHCICommandReadDeviceAddress = 0x0009, + kBluetoothHCICommandReadDataBlockSize = 0x000A, + kBluetoothHCICommandReadLocalSupportedCodecs = 0x000B, + + // Command Group: Status + + kBluetoothHCICommandGroupStatus = 0x05, + kBluetoothHCICommandReadFailedContactCounter = 0x0001, + kBluetoothHCICommandResetFailedContactCounter = 0x0002, + kBluetoothHCICommandGetLinkQuality = 0x0003, + kBluetoothHCICommandReadRSSI = 0x0005, + kBluetoothHCICommandReadAFHMappings = 0x0006, + kBluetoothHCICommandReadClock = 0x0007, + kBluetoothHCICommandReadEncryptionKeySize = 0x0008, + kBluetoothHCICommandReadLocalAMPInfo = 0x0009, + kBluetoothHCICommandReadLocalAMPASSOC = 0x000A, + kBluetoothHCICommandWriteRemoteAMPASSOC = 0x000B, + kBluetoothHCICommandGetMWSTransportLayerConfiguration = 0x000C, + kBluetoothHCICommandSetTriggeredClockCapture = 0x000D, + + // Command Group: Testing + + kBluetoothHCICommandGroupTesting = 0x06, + kBluetoothHCICommandReadLoopbackMode = 0x0001, + kBluetoothHCICommandWriteLoopbackMode = 0x0002, + kBluetoothHCICommandEnableDeviceUnderTestMode = 0x0003, + kBluetoothHCICommandWriteSimplePairingDebugMode = 0x0004, + kBluetoothHCICommandEnableAMPReceiverReports = 0x0007, + kBluetoothHCICommandAMPTestEnd = 0x0008, + kBluetoothHCICommandAMPTest = 0x0009, + + // Command Group: Low Energy + + kBluetoothHCICommandGroupLowEnergy = 0x08, + kBluetoothHCICommandLESetEventMask = 0x0001, + kBluetoothHCICommandLEReadBufferSize = 0x0002, + kBluetoothHCICommandLEReadLocalSupportedFeatures = 0x0003, + kBluetoothHCICommandLESetRandomAddress = 0x0005, + kBluetoothHCICommandLESetAdvertisingParameters = 0x0006, + kBluetoothHCICommandLEReadAdvertisingChannelTxPower = 0x0007, + kBluetoothHCICommandLESetAdvertisingData = 0x0008, + kBluetoothHCICommandLESetScanResponseData = 0x0009, + kBluetoothHCICommandLESetAdvertiseEnable = 0x000A, + kBluetoothHCICommandLESetScanParameters = 0x000B, + kBluetoothHCICommandLESetScanEnable = 0x000C, + kBluetoothHCICommandLECreateConnection = 0x000D, + kBluetoothHCICommandLECreateConnectionCancel = 0x000E, + kBluetoothHCICommandLEReadWhiteListSize = 0x000F, + kBluetoothHCICommandLEClearWhiteList = 0x0010, + kBluetoothHCICommandLEAddDeviceToWhiteList = 0x0011, + kBluetoothHCICommandLERemoveDeviceFromWhiteList = 0x0012, + kBluetoothHCICommandLEConnectionUpdate = 0x0013, + kBluetoothHCICommandLESetHostChannelClassification = 0x0014, + kBluetoothHCICommandLEReadChannelMap = 0x0015, + kBluetoothHCICommandLEReadRemoteUsedFeatures = 0x0016, + kBluetoothHCICommandLEEncrypt = 0x0017, + kBluetoothHCICommandLERand = 0x0018, + kBluetoothHCICommandLEStartEncryption = 0x0019, + kBluetoothHCICommandLELongTermKeyRequestReply = 0x001A, + kBluetoothHCICommandLELongTermKeyRequestNegativeReply = 0x001B, + kBluetoothHCICommandLEReadSupportedStates = 0x001C, + kBluetoothHCICommandLEReceiverTest = 0x001D, + kBluetoothHCICommandLETransmitterTest = 0x001E, + kBluetoothHCICommandLETestEnd = 0x001F, + kBluetoothHCICommandLERemoteConnectionParameterRequestReply = 0x0020, + kBluetoothHCICommandLERemoteConnectionParameterRequestNegativeReply = 0x0021, + kBluetoothHCICommandLESetDataLength = 0x0022, + kBluetoothHCICommandLEReadSuggestedDefaultDataLength = 0x0023, + kBluetoothHCICommandLEWriteSuggestedDefaultDataLength = 0x0024, + kBluetoothHCICommandLEReadLocalP256PublicKey = 0x0025, + kBluetoothHCICommandLEGenerateDHKey = 0x0026, + kBluetoothHCICommandLEAddDeviceToResolvingList = 0x0027, + kBluetoothHCICommandLERemoveDeviceFromResolvingList = 0x0028, + kBluetoothHCICommandLEClearResolvingList = 0x0029, + kBluetoothHCICommandLEReadResolvingListSize = 0x002A, + kBluetoothHCICommandLEReadPeerResolvableAddress = 0x002B, + kBluetoothHCICommandLEReadLocalResolvableAddress = 0x002C, + kBluetoothHCICommandLESetAddressResolutionEnable = 0x002D, + kBluetoothHCICommandLESetResolvablePrivateAddressTimeout = 0x002E, + kBluetoothHCICommandLEReadMaximumDataLength = 0x002F, + kBluetoothHCICommandLEReadPhy = 0x0030, + kBluetoothHCICommandLESetDefaultPhy = 0x0031, + kBluetoothHCICommandLESetPhy = 0x0032, + kBluetoothHCICommandLEEnhancedReceiverTest = 0x0033, + kBluetoothHCICommandLEEnhancedTransmitterTest = 0x0034, + kBluetoothHCICommandLESetAdvertisingSetRandomAddress = 0x0035, + kBluetoothHCICommandLESetExtendedAdvertisingParameters = 0x0036, + kBluetoothHCICommandLESetExtendedAdvertisingData = 0x0037, + kBluetoothHCICommandLESetExtendedScanResponseData = 0x0038, + kBluetoothHCICommandLESetExtendedAdvertisingEnableCommand = 0x0039, + kBluetoothHCICommandLEReadMaximumAdvertisingDataLength = 0x003A, + kBluetoothHCICommandLEReadNumberofSupportedAdvertisingSets = 0x003B, + kBluetoothHCICommandLERemoveAdvertisingSet = 0x003C, + kBluetoothHCICommandLEClearAdvertisingSets = 0x003D, + kBluetoothHCICommandLESetPeriodicAdvertisingParameters = 0x003E, + kBluetoothHCICommandLESetPeriodicAdvertisingData = 0x003F, + kBluetoothHCICommandLESetPeriodicAdvertisingEnable = 0x0040, + kBluetoothHCICommandLESetExtendedScanParameters = 0x0041, + kBluetoothHCICommandLESetExtendedScanEnable = 0x0042, + kBluetoothHCICommandLEExtendedCreateConnection = 0x0043, + kBluetoothHCICommandLEPeriodicAdvertisingCreateSync = 0x0044, + kBluetoothHCICommandLEPeriodicAdvertisingCreateSyncCancel = 0x0045, + kBluetoothHCICommandLEPeriodicAdvertisingTerminateSync = 0x0046, + kBluetoothHCICommandLEAddDeviceToPeriodicAdvertiserList = 0x0047, + kBluetoothHCICommandLERemoveDeviceFromPeriodicAdvertiserList = 0x0048, + kBluetoothHCICommandLEClearPeriodicAdvertiserList = 0x0049, + kBluetoothHCICommandLEReadPeriodicAdvertiserListSize = 0x004A, + kBluetoothHCICommandLEReadTransmitPower = 0x004B, + kBluetoothHCICommandLEReadRFPathCompensation = 0x004C, + kBluetoothHCICommandLEWriteRFPathCompensation = 0x004D, + kBluetoothHCICommandLESetPrivacyMode = 0x004E, + + // Command Group: Logo Testing (no commands yet) + + kBluetoothHCICommandGroupLogoTesting = 0x3E, + + // Command Group: Vendor Specific + kBluetoothHCICommandGroupVendorSpecific = 0x3F, + + kBluetoothHCICommandGroupMax = 0x40, + kBluetoothHCICommandMax = 0x03FF +}; + +// HCI Data Types + +typedef uint8_t BluetoothHCIQoSFlags; +typedef uint8_t BluetoothHCIParamByteCount; +typedef uint16_t BluetoothHCIACLDataByteCount; +typedef uint8_t BluetoothHCISCODataByteCount; +typedef uint8_t BluetoothHCIInquiryLength; +typedef uint8_t BluetoothHCIResponseCount; +typedef uint8_t BluetoothHCICountryCode; +typedef uint16_t BluetoothHCIModeInterval; +typedef uint16_t BluetoothHCISniffAttemptCount; +typedef uint16_t BluetoothHCISniffTimeout; +typedef uint16_t BluetoothHCIParkModeBeaconInterval; + +typedef uint8_t BluetoothMaxSlots; +typedef uint16_t BluetoothManufacturerName; +typedef uint8_t BluetoothLMPVersion; +typedef uint16_t BluetoothLMPSubversion; + +typedef uint8_t BluetoothHCIConnectionMode; +enum BluetoothHCIConnectionModes +{ + kConnectionActiveMode = 0, + kConnectionHoldMode = 1, + kConnectionSniffMode = 2, + kConnectionParkMode = 3, + kConnectionModeReservedForFutureUse = 4 +}; + +typedef struct BluetoothHCISupportedCommands +{ + uint8_t data[64]; +} BluetoothHCISupportedCommands; + +typedef struct BluetoothHCISupportedFeatures +{ + uint8_t data[8]; +} BluetoothHCISupportedFeatures; + +typedef struct BluetoothHCISupportedFeatures BluetoothHCILESupportedFeatures; +typedef struct BluetoothHCISupportedFeatures BluetoothHCILEUsedFeatures; + +typedef uint8_t BluetoothHCIPageNumber; + +typedef struct BluetoothHCIExtendedFeaturesInfo +{ + BluetoothHCIPageNumber page; + BluetoothHCIPageNumber maxPage; + uint8_t data[8]; +} BluetoothHCIExtendedFeaturesInfo; + +enum BluetoothLEFeatureBits +{ + kBluetoothLEFeatureLEEncryption = (1 << 0L), + kBluetoothLEFeatureConnectionParamsRequestProcedure = (1 << 1L), + kBluetoothLEFeatureExtendedRejectIndication = (1 << 2L), + kBluetoothLEFeatureSlaveInitiatedFeaturesExchange = (1 << 3L), + kBluetoothLEFeatureLEPing = (1 << 4L), + kBluetoothLEFeatureLEDataPacketLengthExtension = (1 << 5L), + kBluetoothLEFeatureLLPrivacy = (1 << 6L), + kBluetoothLEFeatureExtendedScannerFilterPolicies = (1 << 7L) + // Three other bytes are RFU +}; + +enum BluetoothFeatureBits +{ + // Byte 0 of the support features data structure. + + kBluetoothFeatureThreeSlotPackets = (1 << 0L), + kBluetoothFeatureFiveSlotPackets = (1 << 1L), + kBluetoothFeatureEncryption = (1 << 2L), + kBluetoothFeatureSlotOffset = (1 << 3L), + kBluetoothFeatureTimingAccuracy = (1 << 4L), + kBluetoothFeatureSwitchRoles = (1 << 5L), + kBluetoothFeatureHoldMode = (1 << 6L), + kBluetoothFeatureSniffMode = (1 << 7L), + + // Byte 1 of the support features data structure. + + kBluetoothFeatureParkMode = (1 << 0L), + kBluetoothFeatureRSSI = (1 << 1L), + kBluetoothFeaturePowerControlRequests = (1 << 1L), + kBluetoothFeatureChannelQuality = (1 << 2L), + kBluetoothFeatureSCOLink = (1 << 3L), + kBluetoothFeatureHV2Packets = (1 << 4L), + kBluetoothFeatureHV3Packets = (1 << 5L), + kBluetoothFeatureULawLog = (1 << 6L), + kBluetoothFeatureALawLog = (1 << 7L), + + // Byte 2 of the support features data structure. + + kBluetoothFeatureCVSD = (1 << 0L), + kBluetoothFeaturePagingScheme = (1 << 1L), + kBluetoothFeaturePowerControl = (1 << 2L), + kBluetoothFeatureTransparentSCOData = (1 << 3L), + kBluetoothFeatureFlowControlLagBit0 = (1 << 4L), + kBluetoothFeatureFlowControlLagBit1 = (1 << 5L), + kBluetoothFeatureFlowControlLagBit2 = (1 << 6L), + kBluetoothFeatureBroadcastEncryption = (1 << 7L), + + // Byte 3 of the support features data structure. + + kBluetoothFeatureScatterMode = (1 << 0L), + kBluetoothFeatureEnhancedDataRateACL2MbpsMode = (1 << 1L), + kBluetoothFeatureEnhancedDataRateACL3MbpsMode = (1 << 2L), + kBluetoothFeatureEnhancedInquiryScan = (1 << 3L), + kBluetoothFeatureInterlacedInquiryScan = (1 << 4L), + kBluetoothFeatureInterlacedPageScan = (1 << 5L), + kBluetoothFeatureRSSIWithInquiryResult = (1 << 6L), + kBluetoothFeatureExtendedSCOLink = (1 << 7L), + + // Byte 4 of the support features data structure. + + kBluetoothFeatureEV4Packets = (1 << 0L), + kBluetoothFeatureEV5Packets = (1 << 1L), + kBluetoothFeatureAbsenceMasks = (1 << 2L), + kBluetoothFeatureAFHCapableSlave = (1 << 3L), + kBluetoothFeatureAFHClassificationSlave = (1 << 4L), + kBluetoothFeatureAliasAuhentication = (1 << 5L), + kBluetoothFeatureLESupportedController = (1 << 6L), + kBluetoothFeature3SlotEnhancedDataRateACLPackets = (1 << 7L), + + // Byte 5 of the support features data structure. + + kBluetoothFeature5SlotEnhancedDataRateACLPackets = (1 << 0L), // 2.0 version of this header had this at the wrong bit location + kBluetoothFeatureSniffSubrating = (1 << 1L), + kBluetoothFeaturePauseEncryption = (1 << 2L), + kBluetoothFeatureAFHCapableMaster = (1 << 3L), + kBluetoothFeatureAFHClassificationMaster = (1 << 4L), + kBluetoothFeatureEnhancedDataRateeSCO2MbpsMode = (1 << 5L), + kBluetoothFeatureEnhancedDataRateeSCO3MbpsMode = (1 << 6L), + kBluetoothFeature3SlotEnhancedDataRateeSCOPackets = (1 << 7L), + + // Byte 6 of the support features data structure. + + kBluetoothFeatureExtendedInquiryResponse = (1 << 0L), + kBluetoothFeatureSecureSimplePairing = (1 << 3L), + kBluetoothFeatureEncapsulatedPDU = (1 << 4L), + kBluetoothFeatureErroneousDataReporting = (1 << 5L), + kBluetoothFeatureNonFlushablePacketBoundaryFlag = (1 << 6L), + + // Byte 7 of the support features data structure. + + kBluetoothFeatureLinkSupervisionTimeoutChangedEvent = (1 << 0L), + kBluetoothFeatureInquiryTransmissionPowerLevel = (1 << 1L), + kBluetoothFeatureExtendedFeatures = (1 << 7L), + + // Byte 8 of the support features data structure (extended) page 1 + + kBluetoothExtendedFeatureSimpleSecurePairingHostMode = (1 << 0L), + kBluetoothExtendedFeatureLESupportedHostMode = (1 << 1L), + kBluetoothExtendedFeatureLEAndBREDRToSameDeviceHostMode = (1 << 2L), + KBluetoothExtendedFeatureSecureConnectionsHostMode = (1 << 3L), + + // Byte 16 of supported features data structure (extended) page 2 + + kBluetoothExtendedFeatureSecureConnectionsControllerSupport = (1 << 0L), + kBluetoothExtendedFeaturePing = (1 << 1L), + kBluetoothExtendedFeatureReserved = (1 << 2L), + kBluetoothExtendedFeatureTrainNudging = (1 << 3L), + kBluetoothExtendedFeatureSlotAvailabilityMask = (1 << 4L) +}; + +typedef struct BluetoothEventFilterCondition +{ + uint8_t data[7]; +} BluetoothEventFilterCondition; + +typedef uint16_t BluetoothHCIFailedContactCount; +typedef struct BluetoothHCIFailedContactInfo +{ + BluetoothHCIFailedContactCount count; + BluetoothConnectionHandle handle; +} BluetoothHCIFailedContactInfo; + +typedef SInt8 BluetoothHCIRSSIValue; /* Valid Range: -127 to +20 */ +typedef struct BluetoothHCIRSSIInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCIRSSIValue RSSIValue; +} BluetoothHCIRSSIInfo; + +typedef uint8_t BluetoothHCILinkQuality; +typedef struct BluetoothHCILinkQualityInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCILinkQuality qualityValue; +} BluetoothHCILinkQualityInfo; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 +typedef uint8_t BluetoothHCIEncryptionKeySize; +typedef struct BluetoothHCIEncryptionKeySizeInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCIEncryptionKeySize keySize; +} BluetoothHCIEncryptionKeySizeInfo; +#endif + +typedef uint8_t BluetoothHCIRole; +typedef struct BluetoothHCIRoleInfo +{ + uint8_t role; + BluetoothConnectionHandle handle; +} BluetoothHCIRoleInfo; + +enum BluetoothHCIRoles +{ + kBluetoothHCIMasterRole = 0x00, + kBluetoothHCISlaveRole = 0x01 +}; + +typedef uint16_t BluetoothHCILinkPolicySettings; +enum BluetoothHCILinkPolicySettingsValues +{ + kDisableAllLMModes = 0x0000, + kEnableMasterSlaveSwitch = 0x0001, + kEnableHoldMode = 0x0002, + kEnableSniffMode = 0x0004, + kEnableParkMode = 0x0008, + kReservedForFutureUse = 0x0010 +}; + +typedef struct BluetoothHCILinkPolicySettingsInfo +{ + BluetoothHCILinkPolicySettings settings; + BluetoothConnectionHandle handle; +} BluetoothHCILinkPolicySettingsInfo; + +typedef struct BluetoothHCIQualityOfServiceSetupParams +{ + uint8_t flags; + uint8_t serviceType; + uint32_t tokenRate; + uint32_t peakBandwidth; + uint32_t latency; + uint32_t delayVariation; +} BluetoothHCIQualityOfServiceSetupParams; + +typedef struct BluetoothHCISetupSynchronousConnectionParams +{ + uint32_t transmitBandwidth; + uint32_t receiveBandwidth; + uint16_t maxLatency; + uint16_t voiceSetting; + uint8_t retransmissionEffort; + uint16_t packetType; +} BluetoothHCISetupSynchronousConnectionParams; + +typedef struct BluetoothHCIAcceptSynchronousConnectionRequestParams +{ + uint32_t transmitBandwidth; + uint32_t receiveBandwidth; + uint16_t maxLatency; + uint16_t contentFormat; + uint8_t retransmissionEffort; + uint16_t packetType; +} BluetoothHCIAcceptSynchronousConnectionRequestParams; + +// Add for EnhancedSetup +typedef struct BluetoothHCIEnhancedSetupSynchronousConnectionParams +{ + uint32_t transmitBandwidth; + uint32_t receiveBandwidth; + uint64_t transmitCodingFormat; + uint64_t receiveCodingFormat; +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + uint16_t transmitCodecFrameSize; + uint16_t receiveCodecFrameSize; + uint32_t inputBandwidth; + uint32_t outputBandwidth; +#else + uint8_t transmitCodecFrameSize; + uint8_t receiveCodecFrameSize; + uint16_t inputBandwidth; + uint16_t outputBandwidth; +#endif + uint64_t inputCodingFormat; + uint64_t outputCodingFormat; + uint16_t inputCodedDataSize; + uint16_t outputCodedDataSize; + uint8_t inputPCMDataFormat; + uint8_t outputPCMDataFormat; + uint8_t inputPCMSamplePayloadMSBPosition; + uint8_t outputPCMSamplePayloadMSBPosition; + uint8_t inputDataPath; + uint8_t outputDataPath; + uint8_t inputTransportUnitSize; + uint8_t outputTransportUnitSize; + uint16_t maxLatency; +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_14 + uint16_t voiceSetting; + uint8_t retransmissionEffort; +#endif + uint16_t packetType; +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + uint8_t retransmissionEffort; +#endif +} BluetoothHCIEnhancedSetupSynchronousConnectionParams; + +// Add for EnhancedAccept +typedef struct BluetoothHCIEnhancedAcceptSynchronousConnectionRequestParams +{ + uint32_t transmitBandwidth; + uint32_t receiveBandwidth; + uint64_t transmitCodingFormat; + uint64_t receiveCodingFormat; +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + uint16_t transmitCodecFrameSize; + uint16_t receiveCodecFrameSize; + uint32_t inputBandwidth; + uint32_t outputBandwidth; +#else + uint8_t transmitCodecFrameSize; + uint8_t receiveCodecFrameSize; + uint16_t inputBandwidth; + uint16_t outputBandwidth; +#endif + uint64_t inputCodingFormat; + uint64_t outputCodingFormat; + uint16_t inputCodedDataSize; + uint16_t outputCodedDataSize; + uint8_t inputPCMDataFormat; + uint8_t outputPCMDataFormat; + uint8_t inputPCMSamplePayloadMSBPosition; + uint8_t outputPCMSamplePayloadMSBPosition; + uint8_t inputDataPath; + uint8_t outputDataPath; + uint8_t inputTransportUnitSize; + uint8_t outputTransportUnitSize; + uint16_t maxLatency; +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_14 + uint16_t voiceSetting; + uint8_t retransmissionEffort; +#endif + uint16_t packetType; +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + uint8_t retransmissionEffort; +#endif +} BluetoothHCIEnhancedAcceptSynchronousConnectionRequestParams; + +typedef uint8_t BluetoothHCILoopbackMode; +enum +{ + kBluetoothHCILoopbackModeOff = 0x00, + kBluetoothHCILoopbackModeLocal = 0x01, + kBluetoothHCILoopbackModeRemote = 0x02 +}; + +typedef struct BluetoothReadClockInfo +{ + BluetoothConnectionHandle handle; + uint32_t clock; + uint16_t accuracy; +} BluetoothReadClockInfo; + +typedef struct BluetoothHCIEventFlowSpecificationData +{ + BluetoothConnectionHandle connectionHandle; + uint8_t flags; + uint8_t flowDirection; + uint8_t serviceType; + uint32_t tokenRate; + uint32_t tokenBucketSize; + uint32_t peakBandwidth; + uint32_t accessLatency; +} BluetoothHCIEventFlowSpecificationData; + +typedef uint32_t BluetoothHCIOperationID; +typedef uint32_t BluetoothHCIEventID; +typedef uint32_t BluetoothHCIDataID; +typedef uint32_t BluetoothHCISignalID; +typedef uint32_t BluetoothHCITransportID; +typedef uint32_t BluetoothHCITransportCommandID; +typedef uint32_t BluetoothHCIRequestID; + +// Version Information +typedef struct BluetoothHCIVersionInfo +{ + // Local & Remote information + BluetoothManufacturerName manufacturerName; + BluetoothLMPVersion lmpVersion; + BluetoothLMPSubversion lmpSubVersion; + + // Local information only + uint8_t hciVersion; + uint16_t hciRevision; +} BluetoothHCIVersionInfo; + +// HCI buffer sizes +typedef struct BluetoothHCIBufferSize +{ + uint16_t ACLDataPacketLength; + uint8_t SCODataPacketLength; + uint16_t totalNumACLDataPackets; + uint16_t totalNumSCODataPackets; +} BluetoothHCIBufferSize; + +typedef struct BluetoothHCILEBufferSize +{ + uint16_t ACLDataPacketLength; + uint8_t totalNumACLDataPackets; +} BluetoothHCILEBufferSize; + +// Timeouts +typedef uint16_t BluetoothHCIConnectionAcceptTimeout; +typedef uint16_t BluetoothHCIPageTimeout; +enum BluetoothHCITimeoutValues +{ + kDefaultPageTimeout = 0x2710 +}; + +#define BluetoothGetSlotsFromSeconds(inSeconds) ((inSeconds / .000625)) +#define BluetoothGetSecondsFromSlots(inSlots) ((inSlots * .000625)) + +// Link Keys +typedef uint16_t BluetoothHCINumLinkKeysDeleted; +typedef uint8_t BluetoothHCINumLinkKeysToWrite; +typedef uint8_t BluetoothHCIDeleteStoredLinkKeyFlag; +enum BluetoothHCIDeleteStoredLinkKeyFlags +{ + kDeleteKeyForSpecifiedDeviceOnly = 0x00, + kDeleteAllStoredLinkKeys = 0x01 +}; + +typedef uint8_t BluetoothHCIReadStoredLinkKeysFlag; +enum BluetoothHCIReadStoredLinkKeysFlags +{ + kReturnLinkKeyForSpecifiedDeviceOnly = 0x00, + kReadAllStoredLinkKeys = 0x01 +}; + +typedef struct BluetoothHCIStoredLinkKeysInfo +{ + uint16_t numLinkKeysRead; + uint16_t maxNumLinkKeysAllowedInDevice; +} BluetoothHCIStoredLinkKeysInfo; + +// Page Scan +typedef uint8_t BluetoothHCIPageScanMode; +enum BluetoothHCIPageScanModes +{ + kMandatoryPageScanMode = 0x00, + kOptionalPageScanMode1 = 0x01, + kOptionalPageScanMode2 = 0x02, + kOptionalPageScanMode3 = 0x03 +}; + +typedef uint8_t BluetoothHCIPageScanPeriodMode; +enum BluetoothHCIPageScanPeriodModes +{ + kP0Mode = 0x00, + kP1Mode = 0x01, + kP2Mode = 0x02 +}; + +typedef uint8_t BluetoothHCIPageScanEnableState; +enum BluetoothHCIPageScanEnableStates +{ + kNoScansEnabled = 0x00, + kInquiryScanEnabledPageScanDisabled = 0x01, + kInquiryScanDisabledPageScanEnabled = 0x02, + kInquiryScanEnabledPageScanEnabled = 0x03 +}; + +typedef struct BluetoothHCIScanActivity +{ + uint16_t scanInterval; + uint16_t scanWindow; +} BluetoothHCIScanActivity; + +typedef struct BluetoothHCIInquiryAccessCode +{ + uint8_t data[3]; +} BluetoothHCIInquiryAccessCode; + +typedef uint8_t BluetoothHCIInquiryAccessCodeCount; +typedef struct BluetoothHCICurrentInquiryAccessCodes +{ + BluetoothHCIInquiryAccessCodeCount count; // Number of codes in array. + BluetoothHCIInquiryAccessCode * codes; // Ptr to array of codes. +} BluetoothHCICurrentInquiryAccessCodes; + +enum +{ + kMaximumNumberOfInquiryAccessCodes = 0x40 +}; + +typedef struct BluetoothHCICurrentInquiryAccessCodesForWrite +{ + BluetoothHCIInquiryAccessCodeCount count; // Number of codes in array (Range 0x01 to 0x40) + uint8_t codes[kMaximumNumberOfInquiryAccessCodes * sizeof(BluetoothHCIInquiryAccessCode)]; // Array of bytes (maximum 192 bytes -- 64 * 3). +} BluetoothHCICurrentInquiryAccessCodesForWrite; + +typedef struct BluetoothHCILinkSupervisionTimeout +{ + BluetoothConnectionHandle handle; + uint16_t timeout; +} BluetoothHCILinkSupervisionTimeout; + +typedef uint8_t BluetoothHCIFlowControlState; +enum BluetoothHCISCOFlowControlStates +{ + kSCOFlowControlDisabled = 0x00, + kSCOFlowControlEnabled = 0x01 +}; + +enum BluetoothHCIGeneralFlowControlStates +{ + kHostControllerToHostFlowControlOff = 0x00, + kHCIACLDataPacketsOnHCISCODataPacketsOff = 0x01, + kHCIACLDataPacketsOffHCISCODataPacketsOn = 0x02, + kHCIACLDataPacketsOnHCISCODataPacketsOn = 0x03 +}; + +typedef SInt8 BluetoothHCITransmitPowerLevel; +typedef uint8_t BluetoothHCITransmitPowerLevelType; +enum BluetoothHCITransmitReadPowerLevelTypes +{ + kReadCurrentTransmitPowerLevel = 0x00, + kReadMaximumTransmitPowerLevel = 0x01 +}; + +typedef uint8_t BluetoothHCIAFHChannelAssessmentMode; +enum BluetoothHCIAFHChannelAssessmentModes +{ + kAFHChannelAssessmentModeDisabled = 0x00, + kAFHChannelAssessmentModeEnabled = 0x01 +}; + +typedef struct BluetoothHCITransmitPowerLevelInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCITransmitPowerLevel level; // Range: -70 <= N <= 20 (units are dBm) +} BluetoothHCITransmitPowerLevelInfo; + +typedef uint8_t BluetoothHCINumBroadcastRetransmissions; +typedef uint8_t BluetoothHCIHoldModeActivity; +enum BluetoothHCIHoldModeActivityStates +{ + kMaintainCurrentPowerState = 0x00, + kSuspendPageScan = 0x01, + kSuspendInquiryScan = 0x02, + kSuspendPeriodicInquiries = 0x03 +}; + +typedef uint8_t BluetoothHCIAuthenticationEnable; +enum BluetoothHCIAuthentionEnableModes +{ + kAuthenticationDisabled = 0x00, + kAuthenticationEnabled = 0x01 +}; + +typedef uint8_t BluetoothHCIEncryptionMode; +enum BluetoothHCIEncryptionModes +{ + kEncryptionDisabled = 0x00, // Default. + kEncryptionOnlyForPointToPointPackets = 0x01, + kEncryptionForBothPointToPointAndBroadcastPackets = 0x02 +}; + +typedef uint16_t BluetoothHCIAutomaticFlushTimeout; +typedef struct BluetoothHCIAutomaticFlushTimeoutInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCIAutomaticFlushTimeout timeout; +} BluetoothHCIAutomaticFlushTimeoutInfo; + +enum +{ + kInfoStringMaxLength = 35 +}; + +typedef struct BluetoothTransportInfo +{ + uint32_t productID; + uint32_t vendorID; + uint32_t type; + char productName[kInfoStringMaxLength]; + char vendorName[kInfoStringMaxLength]; + + uint64_t totalDataBytesSent; + uint64_t totalSCOBytesSent; + uint64_t totalDataBytesReceived; + uint64_t totalSCOBytesReceived; +} BluetoothTransportInfo; +typedef BluetoothTransportInfo * BluetoothTransportInfoPtr; + +enum BluetoothTransportTypes +{ + kBluetoothTransportTypeUSB = 0x01, + kBluetoothTransportTypePCCard = 0x02, + kBluetoothTransportTypePCICard = 0x03, + kBluetoothTransportTypeUART = 0x04, + kBluetoothTransportTypePCIe = 0x05 +}; + +// Inquiries +typedef struct BluetoothHCIInquiryResult +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanRepetitionMode pageScanRepetitionMode; + BluetoothHCIPageScanPeriodMode pageScanPeriodMode; + BluetoothHCIPageScanMode pageScanMode; + BluetoothClassOfDevice classOfDevice; + BluetoothClockOffset clockOffset; +} BluetoothHCIInquiryResult; + +enum +{ + kBluetoothHCIInquiryResultsMaxResults = 50 +}; + +typedef struct BluetoothHCIInquiryResults +{ + BluetoothHCIInquiryResult results[kBluetoothHCIInquiryResultsMaxResults]; + IOItemCount count; +} BluetoothHCIInquiryResults; + +// Inquiries with RSSI (v1.2 specification) +typedef struct BluetoothHCIInquiryWithRSSIResult +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanRepetitionMode pageScanRepetitionMode; + uint8_t reserved; + BluetoothClassOfDevice classOfDevice; + BluetoothClockOffset clockOffset; + BluetoothHCIRSSIValue RSSIValue; +} BluetoothHCIInquiryWithRSSIResult; + +typedef struct BluetoothHCIInquiryWithRSSIResults +{ + BluetoothHCIInquiryWithRSSIResult results[kBluetoothHCIInquiryResultsMaxResults]; + IOItemCount count; +} BluetoothHCIInquiryWithRSSIResults; + +// Inquiries with 'Extended Inquiry Response' (v2.1 specification) +typedef uint8_t BluetoothHCIFECRequired; +enum BluetoothHCIFECRequiredValues +{ + kBluetoothHCIFECRequired = 0x00, + kBluetoothHCIFECNotRequired = 0x01 +}; + +typedef uint8_t BluetoothHCIInquiryMode; +enum BluetoothHCIInquiryModes +{ + kBluetoothHCIInquiryModeResultFormatStandard = 0x00, + kBluetoothHCIInquiryModeResultFormatWithRSSI = 0x01, + kBluetoothHCIInquiryModeResultFormatWithRSSIOrExtendedInquiryResultFormat = 0x02 +}; + +typedef uint8_t BluetoothHCIInquiryScanType; +enum BluetoothHCIInquiryScanTypes +{ + kBluetoothHCIInquiryScanTypeStandard = 0x00, + kBluetoothHCIInquiryScanTypeInterlaced = 0x01, + + kBluetoothHCIInquiryScanTypeReservedStart = 0x02, + kBluetoothHCIInquiryScanTypeReservedEnd = 0xFF +}; + +typedef uint8_t BluetoothHCIExtendedInquiryResponseDataType; +/* Extended Inquiry Response [EIR] data, consisting of a sequence of data structures in this format: [length(1byte)][data type(1byte)][data(e.g. device name)] */ +typedef struct BluetoothHCIExtendedInquiryResponse +{ + uint8_t data[240]; +} BluetoothHCIExtendedInquiryResponse; + +typedef struct BluetoothHCIReadExtendedInquiryResponseResults +{ + BluetoothHCIFECRequired outFECRequired; + BluetoothHCIExtendedInquiryResponse extendedInquiryResponse; +} BluetoothHCIReadExtendedInquiryResponseResults; + +typedef struct BluetoothHCIExtendedInquiryResult +{ + uint8_t numberOfReponses; /* always a value of 1 */ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanRepetitionMode pageScanRepetitionMode; + uint8_t reserved; + BluetoothClassOfDevice classOfDevice; + BluetoothClockOffset clockOffset; + BluetoothHCIRSSIValue RSSIValue; + BluetoothHCIExtendedInquiryResponse extendedInquiryResponse; +} BluetoothHCIExtendedInquiryResult; + +typedef struct BluetoothHCIReadLMPHandleResults +{ + BluetoothConnectionHandle handle; + BluetoothLMPHandle lmpHandle; + uint32_t reserved; +} BluetoothHCIReadLMPHandleResults; + +// 'Simple Pairing' (v2.1 specification) +typedef uint8_t BluetoothHCISimplePairingMode; +enum BluetoothHCISimplePairingModes +{ + kBluetoothHCISimplePairingModeNotSet = 0x00, + kBluetoothHCISimplePairingModeEnabled = 0x01 +}; + +typedef uint8_t BluetoothSimplePairingDebugMode; +enum BluetoothSimplePairingDebugModes +{ + kBluetoothHCISimplePairingDebugModeDisabled = 0x00, + kBluetoothHCISimplePairingDebugModeEnabled = 0x01 +}; + +typedef struct BluetoothHCISimplePairingOOBData +{ + uint8_t data[16]; +} BluetoothHCISimplePairingOOBData; + +typedef struct BluetoothHCIReadLocalOOBDataResults +{ + BluetoothHCISimplePairingOOBData hash; + BluetoothHCISimplePairingOOBData randomizer; +} BluetoothHCIReadLocalOOBDataResults; + +typedef uint8_t BluetoothIOCapability; +enum BluetoothIOCapabilities +{ + kBluetoothCapabilityTypeDisplayOnly = 0x00, + kBluetoothCapabilityTypeDisplayYesNo = 0x01, + kBluetoothCapabilityTypeKeyboardOnly = 0x02, + kBluetoothCapabilityTypeNoInputNoOutput = 0x03 +}; + +typedef uint8_t BluetoothOOBDataPresence; +enum BluetoothOOBDataPresenceValues +{ + kBluetoothOOBAuthenticationDataNotPresent = 0x00, + kBluetoothOOBAuthenticationDataFromRemoteDevicePresent = 0x01 +}; + +typedef uint8_t BluetoothAuthenticationRequirements; +enum BluetoothAuthenticationRequirementsValues +{ + kBluetoothAuthenticationRequirementsMITMProtectionNotRequired = 0x00, /* Numeric comparison with automatic accept allowed */ + kBluetoothAuthenticationRequirementsMITMProtectionRequired = 0x01, /* Refer to BluetoothIOCapabilities to determine authentication procedure */ + kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredNoBonding = 0x00, + kBluetoothAuthenticationRequirementsMITMProtectionRequiredNoBonding = 0x01, + kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredDedicatedBonding = 0x02, + kBluetoothAuthenticationRequirementsMITMProtectionRequiredDedicatedBonding = 0x03, + kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredGeneralBonding = 0x04, + kBluetoothAuthenticationRequirementsMITMProtectionRequiredGeneralBonding = 0x05 +}; + +typedef struct BluetoothIOCapabilityResponse +{ + BluetoothDeviceAddress deviceAddress; + BluetoothIOCapability ioCapability; /* possible values from BluetoothIOCapabilities above */ + BluetoothOOBDataPresence OOBDataPresence; + BluetoothAuthenticationRequirements authenticationRequirements; +} BluetoothIOCapabilityResponse; + +typedef uint32_t BluetoothPasskey; +typedef struct BluetoothUserPasskeyNotification +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPasskey passkey; /* passkey for display. valid values are 000000 - 999999 */ +} BluetoothUserPasskeyNotification; + +typedef uint8_t BluetoothKeypressNotificationType; +enum BluetoothKeypressNotificationTypes +{ + kBluetoothKeypressNotificationTypePasskeyEntryStarted = 0, + kBluetoothKeypressNotificationTypePasskeyDigitEntered = 1, + kBluetoothKeypressNotificationTypePasskeyDigitErased = 2, + kBluetoothKeypressNotificationTypePasskeyCleared = 3, + kBluetoothKeypressNotificationTypePasskeyEntryCompleted = 4 +}; + +typedef struct BluetoothKeypressNotification +{ + BluetoothDeviceAddress deviceAddress; + BluetoothKeypressNotificationType notificationType; +} BluetoothKeypressNotification; + +typedef struct BluetoothRemoteHostSupportedFeaturesNotification +{ + BluetoothDeviceAddress deviceAddress; + BluetoothHCISupportedFeatures hostSupportedFeatures; +} BluetoothRemoteHostSupportedFeaturesNotification; + +typedef SInt8 TransmissionPower; + +typedef struct BluetoothAFHHostChannelClassification +{ + uint8_t data[10]; /* 79 bits meaningful */ +} BluetoothAFHHostChannelClassification; + +typedef uint8_t BluetoothAFHMode; +typedef struct BluetoothAFHResults +{ + BluetoothConnectionHandle handle; + BluetoothAFHMode mode; + uint8_t afhMap[10]; +} BluetoothAFHResults; + +typedef uint32_t BluetoothNumericValue; + +typedef struct BluetoothUserConfirmationRequest +{ + BluetoothDeviceAddress deviceAddress; + BluetoothNumericValue numericValue; /* numeric value for display. valid values are 000000 - 999999 */ +} BluetoothUserConfirmationRequest; + +typedef struct BluetoothHCIEventSimplePairingCompleteResults +{ + BluetoothDeviceAddress deviceAddress; +} BluetoothHCIEventSimplePairingCompleteResults; + +// Packet Sizes +enum +{ + kBluetoothHCICommandPacketHeaderSize = 3, + kBluetoothHCICommandPacketMaxDataSize = 255, + kBluetoothHCIMaxCommandPacketSize = kBluetoothHCICommandPacketHeaderSize + kBluetoothHCICommandPacketMaxDataSize, + + kBluetoothHCIEventPacketHeaderSize = 2, + kBluetoothHCIEventPacketMaxDataSize = 255, + kBluetoothHCIMaxEventPacketSize = kBluetoothHCIEventPacketHeaderSize + kBluetoothHCIEventPacketMaxDataSize, + + kBluetoothHCIDataPacketHeaderSize = 4, + kBluetoothHCIDataPacketMaxDataSize = 65535, + kBluetoothHCIMaxDataPacketSize = kBluetoothHCIDataPacketHeaderSize + kBluetoothHCIDataPacketMaxDataSize +}; + +typedef struct BluetoothHCICommandPacket +{ + BluetoothHCICommandOpCode opCode; + UInt8 dataSize; + UInt8 data[ kBluetoothHCIMaxCommandPacketSize ]; +} BluetoothHCICommandPacket; + +typedef uint8_t BluetoothHCIEventCode; + +typedef struct BluetoothHCIEventPacketHeader +{ + BluetoothHCIEventCode eventCode; + UInt8 dataSize; +} BluetoothHCIEventPacketHeader; + +typedef uint8_t BluetoothLinkType; +enum BluetoothLinkTypes +{ + kBluetoothSCOConnection = 0, + kBluetoothACLConnection = 1, + kBluetoothESCOConnection = 2, + kBluetoothLinkTypeNone = 0xff +}; + +typedef uint16_t BluetoothHCIContentFormat; // 10 bits meaningful + +typedef uint16_t BluetoothHCIVoiceSetting; // 10 bits meaningful +enum +{ + // Input Coding + kBluetoothVoiceSettingInputCodingMask = 0x300, + kBluetoothVoiceSettingInputCodingLinearInputCoding = 0x000, + kBluetoothVoiceSettingInputCodingULawInputCoding = 0x100, + kBluetoothVoiceSettingInputCodingALawInputCoding = 0x200 +}; + +enum +{ + // Input Data Format + kBluetoothVoiceSettingInputDataFormatMask = 0x0C0, + kBluetoothVoiceSettingInputDataFormat1sComplement = 0x000, + kBluetoothVoiceSettingInputDataFormat2sComplement = 0x040, + kBluetoothVoiceSettingInputDataFormatSignMagnitude = 0x080, + kBluetoothVoiceSettingInputDataFormatUnsigned = 0x0C0 +}; + +enum +{ + // Input Sample Size + kBluetoothVoiceSettingInputSampleSizeMask = 0x020, + kBluetoothVoiceSettingInputSampleSize8Bit = 0x000, + kBluetoothVoiceSettingInputSampleSize16Bit = 0x020 +}; + +enum +{ + // Linear PCM Bit Position + kBluetoothVoiceSettingPCMBitPositionMask = 0x01C +}; + +enum +{ + // Air Coding Format + kBluetoothVoiceSettingAirCodingFormatMask = 0x003, + kBluetoothVoiceSettingAirCodingFormatCVSD = 0x000, + kBluetoothVoiceSettingAirCodingFormatULaw = 0x001, + kBluetoothVoiceSettingAirCodingFormatALaw = 0x002, + kBluetoothVoiceSettingAirCodingFormatTransparentData = 0x003 +}; + +typedef uint8_t BluetoothHCISupportedIAC; +typedef uint32_t BluetoothHCITransmitBandwidth; +typedef uint32_t BluetoothHCIReceiveBandwidth; +typedef uint64_t BluetoothHCITransmitCodingFormat; +typedef uint64_t BluetoothHCIReceiveCodingFormat; +typedef uint16_t BluetoothHCITransmitCodecFrameSize; +typedef uint16_t BluetoothHCIReceiveCodecFrameSize; +typedef uint32_t BluetoothHCIInputBandwidth; +typedef uint32_t BluetoothHCIOutputBandwidth; +typedef uint64_t BluetoothHCIInputCodingFormat; +typedef uint64_t BluetoothHCIOutputCodingFormat; +typedef uint16_t BluetoothHCIInputCodedDataSize; +typedef uint16_t BluetoothHCIOutputCodedDataSize; +typedef uint8_t BluetoothHCIInputPCMDataFormat; +typedef uint8_t BluetoothHCIOutputPCMDataFormat; +typedef uint8_t BluetoothHCIInputPCMSamplePayloadMSBPosition; +typedef uint8_t BluetoothHCIOutputPCMSamplePayloadMSBPosition; +typedef uint8_t BluetoothHCIInputDataPath; +typedef uint8_t BluetoothHCIOutputDataPath; +typedef uint8_t BluetoothHCIInputTransportUnitSize; +typedef uint8_t BluetoothHCIOutputTransportUnitSize; +typedef uint16_t BluetoothHCIMaxLatency; +typedef uint8_t BluetoothHCIRetransmissionEffort; +enum BluetoothHCIRetransmissionEffortTypes +{ + kHCIRetransmissionEffortTypeNone = 0x00, + kHCIRetransmissionEffortTypeAtLeastOneAndOptimizeForPower = 0x01, + kHCIRetransmissionEffortTypeAtLeastOneAndOptimizeLinkQuality = 0x02, + kHCIRetransmissionEffortTypeDontCare = 0xFF +}; + +// Setup Synchronous Packet types (Bluetooth 2.1 spec section 7.7.35 - Setup Synchronous Command Complete Event) +typedef uint8_t BluetoothAirMode; +enum +{ + kBluetoothAirModeULawLog = 0x00, + kBluetoothAirModeALawLog = 0x01, + kBluetoothAirModeCVSD = 0x02, + kBluetoothAirModeTransparentData = 0x03 +}; + +typedef struct BluetoothSynchronousConnectionInfo +{ + BluetoothHCITransmitBandwidth transmitBandWidth; + BluetoothHCIReceiveBandwidth receiveBandWidth; + BluetoothHCIMaxLatency maxLatency; + BluetoothHCIVoiceSetting voiceSetting; + BluetoothHCIRetransmissionEffort retransmissionEffort; + BluetoothPacketType packetType; +} BluetoothSynchronousConnectionInfo; + +typedef struct BluetoothEnhancedSynchronousConnectionInfo +{ + BluetoothHCITransmitBandwidth transmitBandWidth; + BluetoothHCIReceiveBandwidth receiveBandWidth; + BluetoothHCITransmitCodingFormat transmitCodingFormat; + BluetoothHCIReceiveCodingFormat receiveCodingFormat; + BluetoothHCITransmitCodecFrameSize transmitCodecFrameSize; + BluetoothHCIReceiveCodecFrameSize receiveCodecFrameSize; + BluetoothHCIInputBandwidth inputBandwidth; + BluetoothHCIOutputBandwidth outputBandwidth; + BluetoothHCIInputCodingFormat inputCodingFormat; + BluetoothHCIOutputCodingFormat outputCodingFormat; + BluetoothHCIInputCodedDataSize inputCodedDataSize; + BluetoothHCIOutputCodedDataSize outputCodedDataSize; + BluetoothHCIInputPCMDataFormat inputPCMDataFormat; + BluetoothHCIOutputPCMDataFormat outputPCMDataFormat; + BluetoothHCIInputPCMSamplePayloadMSBPosition inputPCMSampelPayloadMSBPosition; + BluetoothHCIOutputPCMSamplePayloadMSBPosition outputPCMSampelPayloadMSBPosition; + BluetoothHCIInputDataPath inputDataPath; + BluetoothHCIOutputDataPath outputDataPath; + BluetoothHCIInputTransportUnitSize inputTransportUnitSize; + BluetoothHCIOutputTransportUnitSize outputTransportUnitSize; + BluetoothHCIMaxLatency maxLatency; + BluetoothHCIVoiceSetting voiceSetting; + BluetoothHCIRetransmissionEffort retransmissionEffort; + BluetoothPacketType packetType; +} BluetoothEnhancedSynchronousConnectionInfo; + +typedef struct BluetoothHCIEventSynchronousConnectionCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothDeviceAddress deviceAddress; + BluetoothLinkType linkType; + uint8_t transmissionInterval; + uint8_t retransmissionWindow; + uint16_t receivePacketLength; + uint16_t transmitPacketLength; + BluetoothAirMode airMode; +} BluetoothHCIEventSynchronousConnectionCompleteResults; + +typedef struct BluetoothHCIEventSynchronousConnectionChangedResults +{ + BluetoothConnectionHandle connectionHandle; + uint8_t transmissionInterval; + uint8_t retransmissionWindow; + uint16_t receivePacketLength; + uint16_t transmitPacketLength; +} BluetoothHCIEventSynchronousConnectionChangedResults; + +typedef uint8_t BluetoothHCIStatus; +typedef uint8_t BluetoothHCIEventStatus; + +// Events +enum +{ + kBluetoothHCIEventInquiryComplete = 0x01, + kBluetoothHCIEventInquiryResult = 0x02, + kBluetoothHCIEventConnectionComplete = 0x03, + kBluetoothHCIEventConnectionRequest = 0x04, + kBluetoothHCIEventDisconnectionComplete = 0x05, + kBluetoothHCIEventAuthenticationComplete = 0x06, + kBluetoothHCIEventRemoteNameRequestComplete = 0x07, + kBluetoothHCIEventEncryptionChange = 0x08, + kBluetoothHCIEventChangeConnectionLinkKeyComplete = 0x09, + kBluetoothHCIEventMasterLinkKeyComplete = 0x0A, + kBluetoothHCIEventReadRemoteSupportedFeaturesComplete = 0x0B, + kBluetoothHCIEventReadRemoteVersionInformationComplete = 0x0C, + kBluetoothHCIEventQoSSetupComplete = 0x0D, + kBluetoothHCIEventCommandComplete = 0x0E, + kBluetoothHCIEventCommandStatus = 0x0F, + kBluetoothHCIEventHardwareError = 0x10, + kBluetoothHCIEventFlushOccurred = 0x11, + kBluetoothHCIEventRoleChange = 0x12, + kBluetoothHCIEventNumberOfCompletedPackets = 0x13, + kBluetoothHCIEventModeChange = 0x14, + kBluetoothHCIEventReturnLinkKeys = 0x15, + kBluetoothHCIEventPINCodeRequest = 0x16, + kBluetoothHCIEventLinkKeyRequest = 0x17, + kBluetoothHCIEventLinkKeyNotification = 0x18, + kBluetoothHCIEventLoopbackCommand = 0x19, + kBluetoothHCIEventDataBufferOverflow = 0x1A, + kBluetoothHCIEventMaxSlotsChange = 0x1B, + kBluetoothHCIEventReadClockOffsetComplete = 0x1C, + kBluetoothHCIEventConnectionPacketType = 0x1D, + kBluetoothHCIEventQoSViolation = 0x1E, + kBluetoothHCIEventPageScanModeChange = 0x1F, // DEPRECATED + kBluetoothHCIEventPageScanRepetitionModeChange = 0x20, + + // [v1.2] + + kBluetoothHCIEventFlowSpecificationComplete = 0x21, + kBluetoothHCIEventInquiryResultWithRSSI = 0x22, + kBluetoothHCIEventReadRemoteExtendedFeaturesComplete = 0x23, + kBluetoothHCIEventSynchronousConnectionComplete = 0x2C, + kBluetoothHCIEventSynchronousConnectionChanged = 0x2D, + + // [v2.1] + + kBluetoothHCIEventSniffSubrating = 0x2E, + kBluetoothHCIEventExtendedInquiryResult = 0x2F, + kBluetoothHCIEventEncryptionKeyRefreshComplete = 0x30, + kBluetoothHCIEventIOCapabilityRequest = 0x31, + kBluetoothHCIEventIOCapabilityResponse = 0x32, + kBluetoothHCIEventUserConfirmationRequest = 0x33, + kBluetoothHCIEventUserPasskeyRequest = 0x34, + kBluetoothHCIEventRemoteOOBDataRequest = 0x35, + kBluetoothHCIEventSimplePairingComplete = 0x36, + kBluetoothHCIEventLinkSupervisionTimeoutChanged = 0x38, + kBluetoothHCIEventEnhancedFlushComplete = 0x39, + kBluetoothHCIEventUserPasskeyNotification = 0x3B, + kBluetoothHCIEventKeypressNotification = 0x3C, + kBluetoothHCIEventRemoteHostSupportedFeaturesNotification = 0x3D, + + // [v4.0] (All LE Events come through this event, and the first following byte is the subevent + + kBluetoothHCIEventLEMetaEvent = 0x3E, + kBluetoothHCISubEventLEConnectionComplete = 0x01, + kBluetoothHCISubEventLEAdvertisingReport = 0x02, + kBluetoothHCISubEventLEConnectionUpdateComplete = 0x03, + kBluetoothHCISubEventLEReadRemoteUsedFeaturesComplete = 0x04, + kBluetoothHCISubEventLELongTermKeyRequest = 0x05, + kBluetoothHCISubEventLERemoteConnectionParameterRequest = 0x06, + kBluetoothHCISubEventLEDataLengthChange = 0x07, + kBluetoothHCISubEventLEReadLocalP256PublicKeyComplete = 0x08, + kBluetoothHCISubEventLEGenerateDHKeyComplete = 0x09, + kBluetoothHCISubEventLEEnhancedConnectionComplete = 0x0A, + kBluetoothHCISubEventLEDirectAdvertisingReport = 0x0B, + kBluetoothHCISubEventLEPhyUpdateComplete = 0x0C, + kBluetoothHCISubEventLEExtendedAdvertising = 0x0D, + kBluetoothHCISubEventLEPeriodicAdvertisingSyncEstablished = 0x0E, + kBluetoothHCISubEventLEPeriodicAdvertisingReport = 0x0F, + kBluetoothHCISubEventLEPeriodicAdvertisingSyncLost = 0x10, + kBluetoothHCISubEventLEScanTimeout = 0x11, + kBluetoothHCISubEventLEAdvertisingSetTerminated = 0x12, + kBluetoothHCISubEventLEScanRequestReceived = 0x13, + kBluetoothHCISubEventLEChannelSelectionAlgorithm = 0x14, + + // [v3.0] + kBluetoothHCIEventPhysicalLinkComplete = 0x40, + kBluetoothHCIEventChannelSelected = 0x41, + kBluetoothHCIEventDisconnectionPhysicalLinkComplete = 0x42, + kBluetoothHCIEventPhysicalLinkLossEarlyWarning = 0x43, + kBluetoothHCIEventPhysicalLinkRecovery = 0x44, + kBluetoothHCIEventLogicalLinkComplete = 0x45, + kBluetoothHCIEventDisconnectionLogicalLinkComplete = 0x46, + kBluetoothHCIEventFlowSpecModifyComplete = 0x47, + kBluetoothHCIEventNumberOfCompletedDataBlocks = 0x48, + kBluetoothHCIEventShortRangeModeChangeComplete = 0x4C, + kBluetoothHCIEventAMPStatusChange = 0x4D, + kBluetoothHCIEventAMPStartTest = 0x49, + kBluetoothHCIEventAMPTestEnd = 0x4A, + kBluetoothHCIEventAMPReceiverReport = 0x4B, + + kBluetoothHCIEventLogoTesting = 0xFE, + kBluetoothHCIEventVendorSpecific = 0xFF +}; + +// HCI Event Masks + +// Event masks are 8 octets according to the spec. v2.1 introduces some event masks that +// actually exceed 32 bits so the 4 byte enum we had before Bluetooth 2.0 will still work for old +// the masks, but the new masks need to be defined as 64 bits. + +typedef uint64_t BluetoothHCIEventMask; + +enum +{ + kBluetoothHCIEventMaskLEDefault64Bit = 0x000000000000001FLL, + kBluetoothHCIEventMaskDefault64Bit = 0x00001FFFFFFFFFFFLL, + kBluetoothHCIEventMaskAll64Bit = 0xFFFFFFFFFFFFFFFFLL, + + // [v1.2] + kBluetoothHCIEventMaskFlowSpecificationCompleteEvent = 0x0000000100000000LL, + kBluetoothHCIEventMaskInquiryResultWithRSSIEvent = 0x0000000200000000LL, + kBluetoothHCIEventMaskReadRemoteExtendedFeaturesCompleteEvent = 0x0000000400000000LL, + kBluetoothHCIEventMaskSynchronousConnectionCompleteEvent = 0x0000080000000000LL, + kBluetoothHCIEventMaskSynchronousConnectionChangedEvent = 0x0000100000000000LL, + + // [v2.1] + kBluetoothHCIEventMaskSniffSubratingEvent = 0x0000200000000000LL, + kBluetoothHCIEventMaskExtendedInquiryResultEvent = 0x0000400000000000LL, + kBluetoothHCIEventMaskEncryptionChangeEvent = 0x0000000000000080LL, + kBluetoothHCIEventMaskEncryptionKeyRefreshCompleteEvent = 0x0000800000000000LL, + kBluetoothHCIEventMaskLinkSupervisionTimeoutChangedEvent = 0x0080000000000000LL, + kBluetoothHCIEventMaskEnhancedFlushCompleteEvent = 0x0100000000000000LL, + + // [v2.1 Secure Simple Pairing] + kBluetoothHCIEventMaskIOCapabilityRequestEvent = 0x0001000000000000LL, + kBluetoothHCIEventMaskIOCapabilityRequestReplyEvent = 0x0002000000000000LL, + kBluetoothHCIEventMaskUserConfirmationRequestEvent = 0x0004000000000000LL, + kBluetoothHCIEventMaskUserPasskeyRequestEvent = 0x0008000000000000LL, + kBluetoothHCIEventMaskRemoteOOBDataRequestEvent = 0x0010000000000000LL, + kBluetoothHCIEventMaskSimplePairingCompleteEvent = 0x0020000000000000LL, + kBluetoothHCIEvnetMaskLinkSupervisionTimeoutChangedEvent = 0x0080000000000000LL, + kBluetoothHCIEvnetMaskEnhancedFlushCompleteEvent = 0x0100000000000000LL, + kBluetoothHCIEventMaskUserPasskeyNotificationEvent = 0x0400000000000000LL, + kBluetoothHCIEventMaskKeypressNotificationEvent = 0x0800000000000000LL, + kBluetoothHCIEventMaskRemoteHostSupportedFeaturesNotificationEvent = 0x1000000000000000LL, + kBluetoothHCIEventMaskLEMetaEvent = 0x2000000000000000LL, + + kBluetoothHCIEventMaskNone = 0x00000000, + kBluetoothHCIEventMaskInquiryComplete = 0x00000001, + kBluetoothHCIEventMaskInquiryResult = 0x00000002, + kBluetoothHCIEventMaskConnectionComplete = 0x00000004, + kBluetoothHCIEventMaskConnectionRequest = 0x00000008, + kBluetoothHCIEventMaskDisconnectionComplete = 0x00000010, + kBluetoothHCIEventMaskAuthenticationComplete = 0x00000020, + kBluetoothHCIEventMaskRemoteNameRequestComplete = 0x00000040, + kBluetoothHCIEventMaskEncryptionChange = 0x00000080, + kBluetoothHCIEventMaskChangeConnectionLinkKeyComplete = 0x00000100, + kBluetoothHCIEventMaskMasterLinkKeyComplete = 0x00000200, + kBluetoothHCIEventMaskReadRemoteSupportedFeaturesComplete = 0x00000400, + kBluetoothHCIEventMaskReadRemoteVersionInformationComplete = 0x00000800, + kBluetoothHCIEventMaskQoSSetupComplete = 0x00001000, + kBluetoothHCIEventMaskCommandComplete = 0x00002000, + kBluetoothHCIEventMaskCommandStatus = 0x00004000, + kBluetoothHCIEventMaskHardwareError = 0x00008000, + kBluetoothHCIEventMaskFlushOccurred = 0x00010000, + kBluetoothHCIEventMaskRoleChange = 0x00020000, + + kBluetoothHCIEventMaskNumberOfCompletedPackets = 0x00040000, + kBluetoothHCIEventMaskModeChange = 0x00080000, + kBluetoothHCIEventMaskReturnLinkKeys = 0x00100000, + kBluetoothHCIEventMaskPINCodeRequest = 0x00200000, + kBluetoothHCIEventMaskLinkKeyRequest = 0x00400000, + kBluetoothHCIEventMaskLinkKeyNotification = 0x00800000, + kBluetoothHCIEventMaskLoopbackCommand = 0x01000000, + kBluetoothHCIEventMaskDataBufferOverflow = 0x02000000, + kBluetoothHCIEventMaskMaxSlotsChange = 0x04000000, + kBluetoothHCIEventMaskReadClockOffsetComplete = 0x08000000, + kBluetoothHCIEventMaskConnectionPacketTypeChanged = 0x10000000, + kBluetoothHCIEventMaskQoSViolation = 0x20000000, + kBluetoothHCIEventMaskPageScanModeChange = 0x40000000, + kBluetoothHCIEventMaskPageScanRepetitionModeChange = 0x80000000, + + kBluetoothHCIEventMaskAll = 0xFFFFFFFF, + kBluetoothHCIEventMaskDefault = kBluetoothHCIEventMaskAll /* Use kBluetoothHCIEventMaskDefault64Bit above! */ +}; + +// Event results structures. +typedef struct BluetoothHCIEventCommandCompleteResults +{ + uint8_t numCommands; + BluetoothHCICommandOpCode opCode; +} __attribute__((packed)) BluetoothHCIEventCommandCompleteResults; + +typedef struct BluetoothHCIEventConnectionCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothDeviceAddress deviceAddress; + BluetoothLinkType linkType; + BluetoothHCIEncryptionMode encryptionMode; +} BluetoothHCIEventConnectionCompleteResults; + +typedef struct BluetoothHCIEventLEConnectionCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + uint8_t role; + uint8_t peerAddressType; + BluetoothDeviceAddress peerAddress; + uint16_t connInterval; + uint16_t connLatency; + uint16_t supervisionTimeout; + uint8_t masterClockAccuracy; +} __attribute__((packed)) BluetoothHCIEventLEConnectionCompleteResults; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 +typedef struct BluetoothHCIEventLEEnhancedConnectionCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + uint8_t role; + uint8_t peerAddressType; + BluetoothDeviceAddress peerAddress; + BluetoothDeviceAddress localResolvablePrivateAddress; + BluetoothDeviceAddress peerResolvablePrivateAddress; + uint16_t connInterval; + uint16_t connLatency; + uint16_t supervisionTimeout; + uint8_t masterClockAccuracy; +} __attribute__((packed)) BluetoothHCIEventLEEnhancedConnectionCompleteResults; +#endif + +typedef struct BluetoothHCIEventLEConnectionUpdateCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + uint16_t connInterval; + uint16_t connLatency; + uint16_t supervisionTimeout; +} __attribute__((packed)) BluetoothHCIEventLEConnectionUpdateCompleteResults; + +typedef struct BluetoothHCIEventLEReadRemoteUsedFeaturesCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCISupportedFeatures usedFeatures; +} BluetoothHCIEventLEReadRemoteUsedFeaturesCompleteResults; + +typedef struct BluetoothHCIEventDisconnectionCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothReasonCode reason; +} BluetoothHCIEventDisconnectionCompleteResults; + +typedef struct BluetoothHCIEventReadSupportedFeaturesResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCISupportedFeatures supportedFeatures; +} BluetoothHCIEventReadSupportedFeaturesResults; + +typedef struct BluetoothHCIEventReadExtendedFeaturesResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCIExtendedFeaturesInfo supportedFeaturesInfo; +} BluetoothHCIEventReadExtendedFeaturesResults; + +typedef struct BluetoothHCIEventReadRemoteVersionInfoResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothLMPVersion lmpVersion; + BluetoothManufacturerName manufacturerName; + BluetoothLMPSubversion lmpSubversion; +} BluetoothHCIEventReadRemoteVersionInfoResults; + +typedef struct BluetoothHCIEventRemoteNameRequestResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothDeviceName deviceName; +} BluetoothHCIEventRemoteNameRequestResults; + +typedef struct BluetoothHCIEventReadClockOffsetResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothClockOffset clockOffset; +} BluetoothHCIEventReadClockOffsetResults; + +typedef struct BluetoothHCIEventConnectionRequestResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothClassOfDevice classOfDevice; + BluetoothLinkType linkType; +} BluetoothHCIEventConnectionRequestResults; + +typedef struct BluetoothHCIEventLinkKeyNotificationResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothKey linkKey; + BluetoothKeyType keyType; +} BluetoothHCIEventLinkKeyNotificationResults; + +typedef struct BluetoothHCIEventMaxSlotsChangeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothMaxSlots maxSlots; +} BluetoothHCIEventMaxSlotsChangeResults; + +typedef struct BluetoothHCIEventModeChangeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCIConnectionMode mode; + BluetoothHCIModeInterval modeInterval; +} BluetoothHCIEventModeChangeResults; + +typedef struct BluetoothHCIEventReturnLinkKeysResults +{ + uint8_t numLinkKeys; + struct + { + BluetoothDeviceAddress deviceAddress; + BluetoothKey linkKey; + } linkKeys[1]; +} BluetoothHCIEventReturnLinkKeysResults; + +typedef struct BluetoothHCIEventAuthenticationCompleteResults +{ + BluetoothConnectionHandle connectionHandle; +} BluetoothHCIEventAuthenticationCompleteResults; + +typedef struct BluetoothHCIEventEncryptionChangeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothEncryptionEnable enable; +} BluetoothHCIEventEncryptionChangeResults; + +typedef struct BluetoothHCIEventChangeConnectionLinkKeyCompleteResults +{ + BluetoothConnectionHandle connectionHandle; +} BluetoothHCIEventChangeConnectionLinkKeyCompleteResults; + +typedef struct BluetoothHCIEventMasterLinkKeyCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothKeyFlag keyFlag; +} BluetoothHCIEventMasterLinkKeyCompleteResults; + +typedef struct BluetoothHCIEventQoSSetupCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCIQualityOfServiceSetupParams setupParams; +} BluetoothHCIEventQoSSetupCompleteResults; + +typedef struct BluetoothHCIEventHardwareErrorResults +{ + BluetoothHCIStatus error; +} BluetoothHCIEventHardwareErrorResults; + +typedef struct BluetoothHCIEventFlushOccurredResults +{ + BluetoothConnectionHandle connectionHandle; +} BluetoothHCIEventFlushOccurredResults; + +typedef struct BluetoothHCIEventRoleChangeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothDeviceAddress deviceAddress; + BluetoothRole role; +} BluetoothHCIEventRoleChangeResults; + +typedef struct BluetoothHCIEventDataBufferOverflowResults +{ + BluetoothLinkType linkType; +} BluetoothHCIEventDataBufferOverflowResults; + +typedef struct BluetoothHCIEventConnectionPacketTypeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothPacketType packetType; +} BluetoothHCIEventConnectionPacketTypeResults; + +typedef struct BluetoothHCIEventReadRemoteSupportedFeaturesResults +{ + BluetoothHCIStatus error; + BluetoothConnectionHandle connectionHandle; + BluetoothHCISupportedFeatures lmpFeatures; +} BluetoothHCIEventReadRemoteSupportedFeaturesResults; + +typedef struct BluetoothHCIEventReadRemoteExtendedFeaturesResults +{ + BluetoothHCIStatus error; + BluetoothConnectionHandle connectionHandle; + BluetoothHCIPageNumber page; + BluetoothHCIPageNumber maxPage; + BluetoothHCISupportedFeatures lmpFeatures; +} BluetoothHCIEventReadRemoteExtendedFeaturesResults; + +typedef struct BluetoothHCIEventQoSViolationResults +{ + BluetoothConnectionHandle connectionHandle; +} BluetoothHCIEventQoSViolationResults; + +typedef struct BluetoothHCIEventPageScanModeChangeResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanMode pageScanMode; +} BluetoothHCIEventPageScanModeChangeResults; + +typedef struct BluetoothHCIEventPageScanRepetitionModeChangeResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanRepetitionMode pageScanRepetitionMode; +} BluetoothHCIEventPageScanRepetitionModeChangeResults; + +typedef struct BluetoothHCIEventVendorSpecificResults +{ + uint8_t length; + uint8_t data[255]; +} BluetoothHCIEventVendorSpecificResults; + +typedef struct BluetoothHCIEventEncryptionKeyRefreshCompleteResults +{ + BluetoothConnectionHandle connectionHandle; +} BluetoothHCIEventEncryptionKeyRefreshCompleteResults; + +typedef struct BluetoothHCIEventSniffSubratingResults +{ + BluetoothConnectionHandle connectionHandle; + uint16_t maxTransmitLatency; + uint16_t maxReceiveLatency; + uint16_t minRemoteTimeout; + uint16_t minLocalTimeout; +} BluetoothHCIEventSniffSubratingResults; + +// LE Meta Events +typedef struct BluetoothHCIEventLEMetaResults +{ + uint8_t length; + uint8_t data[255]; +} BluetoothHCIEventLEMetaResults; + +typedef struct BluetoothHCIEventLELongTermKeyRequestResults +{ + BluetoothConnectionHandle connectionHandle; + uint8_t randomNumber[8]; + uint16_t ediv; +} BluetoothHCIEventLELongTermKeyRequestResults; + +#define kNoNotifyProc NULL +#define kNoUserRefCon NULL + +typedef struct BluetoothHCIRequestCallbackInfo +{ + mach_vm_address_t userCallback; // Proc to call when async handler is called. + mach_vm_address_t userRefCon; // For user's info. + mach_vm_address_t internalRefCon; // For our purposes. + mach_vm_address_t asyncIDRefCon; // For our aync calls. + mach_vm_address_t reserved; // For the future. Currently Unused. +} BluetoothHCIRequestCallbackInfo; + +// Error codes + +enum +{ + kBluetoothHCIErrorSuccess = 0x00, + kBluetoothHCIErrorUnknownHCICommand = 0x01, + kBluetoothHCIErrorNoConnection = 0x02, + kBluetoothHCIErrorHardwareFailure = 0x03, + kBluetoothHCIErrorPageTimeout = 0x04, + kBluetoothHCIErrorAuthenticationFailure = 0x05, + kBluetoothHCIErrorKeyMissing = 0x06, + kBluetoothHCIErrorMemoryFull = 0x07, + kBluetoothHCIErrorConnectionTimeout = 0x08, + kBluetoothHCIErrorMaxNumberOfConnections = 0x09, + kBluetoothHCIErrorMaxNumberOfSCOConnectionsToADevice = 0x0A, + kBluetoothHCIErrorACLConnectionAlreadyExists = 0x0B, + kBluetoothHCIErrorCommandDisallowed = 0x0C, + kBluetoothHCIErrorHostRejectedLimitedResources = 0x0D, + kBluetoothHCIErrorHostRejectedSecurityReasons = 0x0E, + kBluetoothHCIErrorHostRejectedRemoteDeviceIsPersonal = 0x0F, + kBluetoothHCIErrorHostTimeout = 0x10, + kBluetoothHCIErrorUnsupportedFeatureOrParameterValue = 0x11, + kBluetoothHCIErrorInvalidHCICommandParameters = 0x12, + kBluetoothHCIErrorOtherEndTerminatedConnectionUserEnded = 0x13, + kBluetoothHCIErrorOtherEndTerminatedConnectionLowResources = 0x14, + kBluetoothHCIErrorOtherEndTerminatedConnectionAboutToPowerOff = 0x15, + kBluetoothHCIErrorConnectionTerminatedByLocalHost = 0x16, + kBluetoothHCIErrorRepeatedAttempts = 0x17, + kBluetoothHCIErrorPairingNotAllowed = 0x18, + kBluetoothHCIErrorUnknownLMPPDU = 0x19, + kBluetoothHCIErrorUnsupportedRemoteFeature = 0x1A, + kBluetoothHCIErrorSCOOffsetRejected = 0x1B, + kBluetoothHCIErrorSCOIntervalRejected = 0x1C, + kBluetoothHCIErrorSCOAirModeRejected = 0x1D, + kBluetoothHCIErrorInvalidLMPParameters = 0x1E, + kBluetoothHCIErrorUnspecifiedError = 0x1F, + kBluetoothHCIErrorUnsupportedLMPParameterValue = 0x20, + kBluetoothHCIErrorRoleChangeNotAllowed = 0x21, + kBluetoothHCIErrorLMPResponseTimeout = 0x22, + kBluetoothHCIErrorLMPErrorTransactionCollision = 0x23, + kBluetoothHCIErrorLMPPDUNotAllowed = 0x24, + kBluetoothHCIErrorEncryptionModeNotAcceptable = 0x25, // Added Core Spec, v1.1 + kBluetoothHCIErrorUnitKeyUsed = 0x26, // 1.1 + kBluetoothHCIErrorQoSNotSupported = 0x27, // 1.1 + kBluetoothHCIErrorInstantPassed = 0x28, // 1.1 + kBluetoothHCIErrorPairingWithUnitKeyNotSupported = 0x29, // 1.1 + kBluetoothHCIErrorHostRejectedUnacceptableDeviceAddress = 0x0F, // 2.0+ + kBluetoothHCIErrorDifferentTransactionCollision = 0x2A, // 1.2 + kBluetoothHCIErrorQoSUnacceptableParameter = 0x2C, // 1.2 + kBluetoothHCIErrorQoSRejected = 0x2D, // 1.2 + kBluetoothHCIErrorChannelClassificationNotSupported = 0x2E, // 1.2 + kBluetoothHCIErrorInsufficientSecurity = 0x2F, // 1.2 + kBluetoothHCIErrorParameterOutOfMandatoryRange = 0x30, // 1.2 + kBluetoothHCIErrorRoleSwitchPending = 0x31, // 1.2 + kBluetoothHCIErrorReservedSlotViolation = 0x34, // 1.2 + kBluetoothHCIErrorRoleSwitchFailed = 0x35, // 1.2 + kBluetoothHCIErrorExtendedInquiryResponseTooLarge = 0x36, // 2.1 + kBluetoothHCIErrorSecureSimplePairingNotSupportedByHost = 0x37, // 2.1 + kBluetoothHCIErrorHostBusyPairing = 0x38, + kBluetoothHCIErrorConnectionRejectedDueToNoSuitableChannelFound = 0x39, + kBluetoothHCIErrorControllerBusy = 0x3A, + kBluetoothHCIErrorUnacceptableConnectionInterval = 0x3B, + kBluetoothHCIErrorDirectedAdvertisingTimeout = 0x3C, + kBluetoothHCIErrorConnectionTerminatedDueToMICFailure = 0x3D, + kBluetoothHCIErrorConnectionFailedToBeEstablished = 0x3E, + kBluetoothHCIErrorMACConnectionFailed = 0x3F, + kBluetoothHCIErrorCoarseClockAdjustmentRejected = 0x40, + kBluetoothHCIErrorType0SubmapNotDefined = 0x41, + kBluetoothHCIErrorUnknownAdvertisingIdentifier = 0x42, + kBluetoothHCIErrorLimitReached = 0x43, + kBluetoothHCIErrorOperationCancelledByHost = 0x44, + kBluetoothHCIErrorPacketTooLong = 0x45, + + kBluetoothHCIErrorMax = 0x45 +}; + +enum +{ + kBluetoothSyncHCIRequestTimedOutAfterSent = 0xFF01, + kBluetoothSyncHCIRequestTimedOutWaitingToBeSent = 0xFF02, + kBluetoothControllerTransportInactive = 0xFF03, + kBluetoothControllerTransportSuspended = 0xFF04 +}; + +#if 0 +#pragma mark === HCI Power Mode === +#endif + +//=========================================================================================================================== +// HCI Power Mode +//=========================================================================================================================== + +typedef enum +{ + kBluetoothHCIPowerStateON = 0x01, + kBluetoothHCIPowerStateOFF = 0x00, + kBluetoothHCIPowerStateUnintialized = 0xFF +} BluetoothHCIPowerState; + +enum +{ + kBluetoothHCIErrorPowerIsOFF = (kBluetoothHCIErrorMax + 1) +}; + +#if 0 +#pragma mark === HCI USB Transport === +#endif + +//=========================================================================================================================== +// HCI USB Transport +//=========================================================================================================================== + +//--------------------------------------------------------------------------------------------------------------------------- +/*! @enum BluetoothHCIUSBDeviceMatchingConstants + @abstract Bluetooth USB device matching constants + @constant kBluetoothHCITransportUSBClassCode Wireless Controller + @constant kBluetoothHCITransportUSBSubClassCode RF Controller + @constant kBluetoothHCITransportUSBProtocolCode Bluetooth Programming +*/ + +enum +{ + kBluetoothHCITransportUSBClassCode = 0xE0, + kBluetoothHCITransportUSBSubClassCode = 0x01, + kBluetoothHCITransportUSBProtocolCode = 0x01 +}; + +#if 0 +#pragma mark === TCI - L2CAP === +#endif + +//=========================================================================================================================== +// TCI - L2CAP +//=========================================================================================================================== + +enum +{ + kBluetoothL2CAPTCIEventIDReserved = 0x00, + kBluetoothL2CAPTCIEventIDL2CA_ConnectInd = 0x01, + kBluetoothL2CAPTCIEventIDL2CA_ConfigInd = 0x02, + kBluetoothL2CAPTCIEventIDL2CA_DisconnectInd = 0x03, + kBluetoothL2CAPTCIEventIDL2CA_QoSViolationInd = 0x04, + kBluetoothL2CAPTCIEventIDL2CA_TimeOutInd = 0x05 +}; + +enum +{ + kBluetoothL2CAPTCICommandReserved = 0x0000, + kBluetoothL2CAPTCICommandL2CA_ConnectReq = 0x0001, + kBluetoothL2CAPTCICommandL2CA_DisconnectReq = 0x0002, + kBluetoothL2CAPTCICommandL2CA_ConfigReq = 0x0003, + kBluetoothL2CAPTCICommandL2CA_DisableCLT = 0x0004, + kBluetoothL2CAPTCICommandL2CA_EnableCLT = 0x0005, + kBluetoothL2CAPTCICommandL2CA_GroupCreate = 0x0006, + kBluetoothL2CAPTCICommandL2CA_GroupClose = 0x0007, + kBluetoothL2CAPTCICommandL2CA_GroupAddMember = 0x0008, + kBluetoothL2CAPTCICommandL2CA_GroupRemoveMember = 0x0009, + kBluetoothL2CAPTCICommandL2CA_GroupMembership = 0x000A, + kBluetoothL2CAPTCICommandL2CA_WriteData = 0x000B, + kBluetoothL2CAPTCICommandL2CA_ReadData = 0x000C, + kBluetoothL2CAPTCICommandL2CA_Ping = 0x000D, + kBluetoothL2CAPTCICommandL2CA_GetInfo = 0x000E, + kBluetoothL2CAPTCICommandL2CA_Reserved1 = 0x000F, + kBluetoothL2CAPTCICommandL2CA_Reserved2 = 0x0010, + kBluetoothL2CAPTCICommandL2CA_ConnectResp = 0x0011, + kBluetoothL2CAPTCICommandL2CA_DisconnectResp = 0x0012, + kBluetoothL2CAPTCICommandL2CA_ConfigResp = 0x0013 +}; + +#if 0 +#pragma mark - +#pragma mark === RFCOMM === +#endif + +//=========================================================================================================================== +// RFCOMM +//=========================================================================================================================== +#define kMaxChannelIDPerSide 31 + +typedef uint8_t BluetoothRFCOMMChannelID; + +#define RFCOMM_CHANNEL_ID_IS_VALID(CHANNEL) ((CHANNEL >= 1) && (CHANNEL <= 30)) + +typedef uint16_t BluetoothRFCOMMMTU; + +typedef enum BluetoothRFCOMMParityType +{ + kBluetoothRFCOMMParityTypeNoParity = 0, + kBluetoothRFCOMMParityTypeOddParity, + kBluetoothRFCOMMParityTypeEvenParity, + kBluetoothRFCOMMParityTypeMaxParity +} BluetoothRFCOMMParityType; + +typedef enum BluetoothRFCOMMLineStatus +{ + BluetoothRFCOMMLineStatusNoError = 0, + BluetoothRFCOMMLineStatusOverrunError, + BluetoothRFCOMMLineStatusParityError, + BluetoothRFCOMMLineStatusFramingError +} BluetoothRFCOMMLineStatus; + +#if 0 +#pragma mark - +#pragma mark === SDP === +#endif + +//=========================================================================================================================== +// SDP +//=========================================================================================================================== + +typedef uint8_t BluetoothSDPPDUID; +enum +{ + kBluetoothSDPPDUIDReserved = 0, + kBluetoothSDPPDUIDErrorResponse, + kBluetoothSDPPDUIDServiceSearchRequest, + kBluetoothSDPPDUIDServiceSearchResponse, + kBluetoothSDPPDUIDServiceAttributeRequest, + kBluetoothSDPPDUIDServiceAttributeResponse, + kBluetoothSDPPDUIDServiceSearchAttributeRequest, + kBluetoothSDPPDUIDServiceSearchAttributeResponse +}; + +#define IS_REQUEST_PDU(_pduID) \ + ((_pduID == kBluetoothSDPPDUIDServiceSearchRequest) || (_pduID == kBluetoothSDPPDUIDServiceAttributeRequest) || (_pduID == kBluetoothSDPPDUIDServiceSearchAttributeRequest)) + +#define IS_RESPONSE_PDU(_pduID) \ + ((_pduID == kBluetoothSDPPDUIDErrorResponse) || (_pduID == kBluetoothSDPPDUIDServiceSearchResponse) || (_pduID == kBluetoothSDPPDUIDServiceAttributeResponse) \ + || (_pduID == kBluetoothSDPPDUIDServiceSearchAttributeResponse)) + +typedef uint16_t BluetoothSDPErrorCode; +enum +{ + kBluetoothSDPErrorCodeSuccess = 0x0000, + kBluetoothSDPErrorCodeReserved = 0x0000, + kBluetoothSDPErrorCodeInvalidSDPVersion = 0x0001, + kBluetoothSDPErrorCodeInvalidServiceRecordHandle = 0x0002, + kBluetoothSDPErrorCodeInvalidRequestSyntax = 0x0003, + kBluetoothSDPErrorCodeInvalidPDUSize = 0x0004, + kBluetoothSDPErrorCodeInvalidContinuationState = 0x0005, + kBluetoothSDPErrorCodeInsufficientResources = 0x0006, + + kBluetoothSDPErrorCodeReservedStart = 0x0007, + kBluetoothSDPErrorCodeReservedEnd = 0xFFFF +}; + +typedef uint16_t BluetoothSDPTransactionID; + +typedef uint32_t BluetoothSDPServiceRecordHandle; + +enum +{ + kBluetoothSDPDataElementTypeNil = 0, + kBluetoothSDPDataElementTypeUnsignedInt = 1, + kBluetoothSDPDataElementTypeSignedInt = 2, + kBluetoothSDPDataElementTypeUUID = 3, + kBluetoothSDPDataElementTypeString = 4, + kBluetoothSDPDataElementTypeBoolean = 5, + kBluetoothSDPDataElementTypeDataElementSequence = 6, + kBluetoothSDPDataElementTypeDataElementAlternative = 7, + kBluetoothSDPDataElementTypeURL = 8, + kBluetoothSDPDataElementTypeReservedStart = 9, + kBluetoothSDPDataElementTypeReservedEnd = 31 +}; + +typedef uint16_t BluetoothSDPUUID16; +typedef uint32_t BluetoothSDPUUID32; + +typedef uint8_t BluetoothSDPDataElementTypeDescriptor; +typedef uint8_t BluetoothSDPDataElementSizeDescriptor; + +typedef uint16_t BluetoothSDPServiceAttributeID; + +#if 0 +#pragma mark - +#pragma mark === LE === +#endif + +typedef enum +{ + BluetoothLEScanTypePassive = 0x00, + BluetoothLEScanTypeActive = 0x01 +} BluetoothLEScanType; + +typedef enum +{ + BluetoothLEAddressTypePublic = 0x00, + BluetoothLEAddressTypeRandom = 0x01 +} BluetoothLEAddressType; + +typedef enum +{ + BluetoothLEScanFilterNone = 0x00, + BluetoothLEScanFilterWhitelist = 0x01 +} BluetoothLEScanFilter; + +typedef enum +{ + BluetoothLEScanDisable = 0x00, + BluetoothLEScanEnable = 0x01 +} BluetoothLEScan; + +typedef enum +{ + BluetoothLEConnectionIntervalMin = 0x06, + BluetoothLEConnectionIntervalMax = 0x0C80 +} BluetoothLEConnectionInterval; + +typedef enum +{ + BluetoothLEScanDuplicateFilterDisable = 0x00, + BluetoothLEScanDuplicateFilterEnable = 0x01 +} BluetoothLEScanDuplicateFilter; + +typedef enum +{ + BluetoothLEAdvertisingTypeConnectableUndirected = 0x00, + BluetoothLEAdvertisingTypeConnectableDirected = 0x01, + BluetoothLEAdvertisingTypeDiscoverableUndirected = 0x02, + BluetoothLEAdvertisingTypeNonConnectableUndirected = 0x03, + BluetoothLEAdvertisingTypeScanResponse = 0x04 +} BluetoothLEAdvertisingType; + +#ifdef __cplusplus +} +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/BluetoothAssignedNumbers.h b/QualcommWireless/include/IOKit/bluetooth/BluetoothAssignedNumbers.h new file mode 100644 index 0000000..0b0778f --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/BluetoothAssignedNumbers.h @@ -0,0 +1,897 @@ +/* + * Copyright (c) 2021 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/*! + * @header BluetoothAssignedNumbers.h + * This header contains assigned numbers for IOBluetooth. + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#pragma mark - +#pragma mark === General === + +/*! + * @enum BluetoothCompanyIdentifers + * @seealso https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers + */ + +enum BluetoothCompanyIdentifers +{ + kBluetoothCompanyIdentiferEricssonTechnologyLicensing = 0, + kBluetoothCompanyIdentiferNokiaMobilePhones = 1, + kBluetoothCompanyIdentiferIntel = 2, + kBluetoothCompanyIdentiferIBM = 3, + kBluetoothCompanyIdentiferToshiba = 4, + kBluetoothCompanyIdentifer3Com = 5, + kBluetoothCompanyIdentiferMicrosoft = 6, + kBluetoothCompanyIdentiferLucent = 7, + kBluetoothCompanyIdentiferMotorola = 8, + kBluetoothCompanyIdentiferInfineonTechnologiesAG = 9, + kBluetoothCompanyIdentiferCambridgeSiliconRadio = 10, + kBluetoothCompanyIdentiferSiliconWave = 11, + kBluetoothCompanyIdentiferDigianswerAS = 12, + kBluetoothCompanyIdentiferTexasInstruments = 13, + kBluetoothCompanyIdentiferParthusTechnologies = 14, + kBluetoothCompanyIdentiferBroadcom = 15, + kBluetoothCompanyIdentiferMitelSemiconductor = 16, + kBluetoothCompanyIdentiferWidcomm = 17, + kBluetoothCompanyIdentiferZeevo = 18, + kBluetoothCompanyIdentiferAtmel = 19, + kBluetoothCompanyIdentiferMistubishiElectric = 20, + kBluetoothCompanyIdentiferRTXTelecom = 21, + kBluetoothCompanyIdentiferKCTechnology = 22, + kBluetoothCompanyIdentiferNewlogic = 23, + kBluetoothCompanyIdentiferTransilica = 24, + kBluetoothCompanyIdentiferRohdeandSchwarz = 25, + kBluetoothCompanyIdentiferTTPCom = 26, + kBluetoothCompanyIdentiferSigniaTechnologies = 27, + kBluetoothCompanyIdentiferConexantSystems = 28, + kBluetoothCompanyIdentiferQualcomm = 29, + kBluetoothCompanyIdentiferInventel = 30, + kBluetoothCompanyIdentiferAVMBerlin = 31, + kBluetoothCompanyIdentiferBandspeed = 32, + kBluetoothCompanyIdentiferMansella = 33, + kBluetoothCompanyIdentiferNEC = 34, + kBluetoothCompanyIdentiferWavePlusTechnology = 35, + kBluetoothCompanyIdentiferAlcatel = 36, + kBluetoothCompanyIdentiferPhilipsSemiconductor = 37, + kBluetoothCompanyIdentiferCTechnologies = 38, + kBluetoothCompanyIdentiferOpenInterface = 39, + kBluetoothCompanyIdentiferRFCMicroDevices = 40, + kBluetoothCompanyIdentiferHitachi = 41, + kBluetoothCompanyIdentiferSymbolTechnologies = 42, + kBluetoothCompanyIdentiferTenovis = 43, + kBluetoothCompanyIdentiferMacronixInternational = 44, + kBluetoothCompanyIdentiferGCTSemiconductor = 45, + kBluetoothCompanyIdentiferNorwoodSystems = 46, + kBluetoothCompanyIdentiferMewTelTechnology = 47, + kBluetoothCompanyIdentiferSTMicroelectronics = 48, + kBluetoothCompanyIdentiferSynopsys = 49, + kBluetoothCompanyIdentiferRedMCommunications = 50, + kBluetoothCompanyIdentiferCommil = 51, + kBluetoothCompanyIdentiferCATC = 52, + kBluetoothCompanyIdentiferEclipse = 53, + kBluetoothCompanyIdentiferRenesasTechnology = 54, + kBluetoothCompanyIdentiferMobilian = 55, + kBluetoothCompanyIdentiferTerax = 56, + kBluetoothCompanyIdentiferIntegratedSystemSolution = 57, + kBluetoothCompanyIdentiferMatsushitaElectricIndustrial = 58, + kBluetoothCompanyIdentiferGennum = 59, + kBluetoothCompanyIdentiferResearchInMotion = 60, + kBluetoothCompanyIdentiferIPextreme = 61, + kBluetoothCompanyIdentiferSystemsAndChips = 62, + kBluetoothCompanyIdentiferBluetoothSIG = 63, + kBluetoothCompanyIdentiferSeikoEpson = 64, + kBluetoothCompanyIdentiferIntegratedSiliconSolution = 65, + kBluetoothCompanyIdentiferCONWISETechnology = 66, + kBluetoothCompanyIdentiferParrotSA = 67, + kBluetoothCompanyIdentiferSocketCommunications = 68, + kBluetoothCompanyIdentiferAtherosCommunications = 69, + kBluetoothCompanyIdentiferMediaTek = 70, + kBluetoothCompanyIdentiferBluegiga = 71, + kBluetoothCompanyIdentiferMarvellTechnologyGroup = 72, + kBluetoothCompanyIdentifer3DSP = 73, + kBluetoothCompanyIdentiferAccelSemiconductor = 74, + kBluetoothCompanyIdentiferContinentialAutomotiveSystems = 75, + kBluetoothCompanyIdentiferApple = 76, + kBluetoothCompanyIdentiferStaccatoCommunications = 77, + kBluetoothCompanyIdentiferAvagoTechnologies = 78, + kBluetoothCompanyIdentiferAPT = 79, + kBluetoothCompanyIdentiferSiRFTechnology = 80, + kBluetoothCompanyIdentiferTZeroTechnologies = 81, + kBluetoothCompanyIdentiferJandM = 82, + kBluetoothCompanyIdentiferFree2Move = 83, + kBluetoothCompanyIdentifer3DiJoy = 84, + kBluetoothCompanyIdentiferPlantronics = 85, + kBluetoothCompanyIdentiferSonyEricssonMobileCommunications = 86, + kBluetoothCompanyIdentiferHarmonInternational = 87, + kBluetoothCompanyIdentiferVisio = 88, + kBluetoothCompanyIdentiferNordicSemiconductor = 89, + kBluetoothCompanyIdentiferEMMicroElectronicMarin = 90, + kBluetoothCompanyIdentiferRalinkTechnology = 91, + kBluetoothCompanyIdentiferBelkinInternational = 92, + kBluetoothCompanyIdentiferRealtekSemiconductor = 93, + kBluetoothCompanyIdentiferStonestreetOne = 94, + kBluetoothCompanyIdentiferWicentric = 95, + kBluetoothCompanyIdentiferRivieraWaves = 96, + kBluetoothCompanyIdentiferRDAMicroelectronics = 97, + kBluetoothCompanyIdentiferGibsonGuitars = 98, + kBluetoothCompanyIdentiferMiCommand = 99, + kBluetoothCompanyIdentiferBandXIInternational = 100, + kBluetoothCompanyIdentiferHewlettPackard = 101, + kBluetoothCompanyIdentifer9SolutionsOy = 102, + kBluetoothCompanyIdentiferGNNetcom = 103, + kBluetoothCompanyIdentiferGeneralMotors = 104, + kBluetoothCompanyIdentiferAAndDEngineering = 105, + kBluetoothCompanyIdentiferMindTree = 106, + kBluetoothCompanyIdentiferPolarElectroOY = 107, + kBluetoothCompanyIdentiferBeautifulEnterprise = 108, + kBluetoothCompanyIdentiferBriarTek = 109, + kBluetoothCompanyIdentiferSummitDataCommunications = 110, + kBluetoothCompanyIdentiferSoundID = 111, + kBluetoothCompanyIdentiferMonster = 112, + kBluetoothCompanyIdentiferConnectBlueAB = 113, + kBluetoothCompanyIdentiferShangHaiSuperSmartElectronics = 114, + kBluetoothCompanyIdentiferGroupSense = 115, + kBluetoothCompanyIdentiferZomm = 116, + kBluetoothCompanyIdentiferSamsungElectronics = 117, + kBluetoothCompanyIdentiferCreativeTechnology = 118, + kBluetoothCompanyIdentiferLairdTechnologies = 119, + kBluetoothCompanyIdentiferNike = 120, + kBluetoothCompanyIdentiferLessWire = 121, + kBluetoothCompanyIdentiferMStarTechnologies = 122, + kBluetoothCompanyIdentiferHanlynnTechnologies = 123, + kBluetoothCompanyIdentiferAAndRCambridge = 124, + kBluetoothCompanyIdentiferSeersTechnology = 125, + kBluetoothCompanyIdentiferSportsTrackingTechnologies = 126, + kBluetoothCompanyIdentiferAutonetMobile = 127, + kBluetoothCompanyIdentiferDeLormePublishingCompany = 128, + kBluetoothCompanyIdentiferWuXiVimicro = 129, + kBluetoothCompanyIdentiferSennheiserCommunications = 130, + kBluetoothCompanyIdentiferTimeKeepingSystems = 131, + kBluetoothCompanyIdentiferLudusHelsinki = 132, + kBluetoothCompanyIdentiferBlueRadios = 133, + kBluetoothCompanyIdentiferEquinux = 134, + kBluetoothCompanyIdentiferGarminInternational = 135, + kBluetoothCompanyIdentiferEcotest = 136, + kBluetoothCompanyIdentiferGNResound = 137, + kBluetoothCompanyIdentiferJawbone = 138, + kBluetoothCompanyIdentiferTopconPositioningSystems = 139, + kBluetoothCompanyIdentiferGimbal = 140, + kBluetoothCompanyIdentiferZscanSoftware = 141, + kBluetoothCompanyIdentiferQuintic = 142, + kBluetoothCompanyIdentiferTelitWirelessSolutions = 143, + kBluetoothCompanyIdentiferFunaiElectric = 144, + kBluetoothCompanyIdentiferAdvancedPANMOBILSystems = 145, + kBluetoothCompanyIdentiferThinkOptics = 146, + kBluetoothCompanyIdentiferUniversalElectriconics = 147, + kBluetoothCompanyIdentiferAirohaTechnology = 148, + kBluetoothCompanyIdentiferNECLightning = 149, + kBluetoothCompanyIdentiferODMTechnology = 150, + kBluetoothCompanyIdentiferConnecteDevice = 151, + kBluetoothCompanyIdentiferZero1TV = 152, + kBluetoothCompanyIdentiferITechDynamicGlobalDistribution = 153, + kBluetoothCompanyIdentiferAlpwise = 154, + kBluetoothCompanyIdentiferJiangsuToppowerAutomotiveElectronics = 155, + kBluetoothCompanyIdentiferColorfy = 156, + kBluetoothCompanyIdentiferGeoforce = 157, + kBluetoothCompanyIdentiferBose = 158, + kBluetoothCompanyIdentiferSuuntoOy = 159, + kBluetoothCompanyIdentiferKensingtonComputerProductsGroup = 160, + kBluetoothCompanyIdentiferSRMedizinelektronik = 161, + kBluetoothCompanyIdentiferVertu = 162, + kBluetoothCompanyIdentiferMetaWatch = 163, + kBluetoothCompanyIdentiferLinak = 164, + kBluetoothCompanyIdentiferOTLDynamics = 165, + kBluetoothCompanyIdentiferPandaOcean = 166, + kBluetoothCompanyIdentiferVisteon = 167, + kBluetoothCompanyIdentiferARPDevicesUnlimited = 168, + kBluetoothCompanyIdentiferMagnetiMarelli = 169, + kBluetoothCompanyIdentiferCaenRFID = 170, + kBluetoothCompanyIdentiferIngenieurSystemgruppeZahn = 171, + kBluetoothCompanyIdentiferGreenThrottleGames = 172, + kBluetoothCompanyIdentiferPeterSystemtechnik = 173, + kBluetoothCompanyIdentiferOmegawave = 174, + kBluetoothCompanyIdentiferCinetix = 175, + kBluetoothCompanyIdentiferPassifSemiconductor = 176, + kBluetoothCompanyIdentiferSarisCyclingGroup = 177, + kBluetoothCompanyIdentiferBekey = 178, + kBluetoothCompanyIdentiferClarinoxTechnologies = 179, + kBluetoothCompanyIdentiferBDETechnology = 180, + kBluetoothCompanyIdentiferSwirlNetworks = 181, + kBluetoothCompanyIdentiferMesoInternational = 182, + kBluetoothCompanyIdentiferTreLab = 183, + kBluetoothCompanyIdentiferQualcommInnovationCenter = 184, + kBluetoothCompanyIdentiferJohnsonControls = 185, + kBluetoothCompanyIdentiferStarkeyLaboratories = 186, + kBluetoothCompanyIdentiferSPowerElectronics = 187, + kBluetoothCompanyIdentiferAceSensor = 188, + kBluetoothCompanyIdentiferAplix = 189, + kBluetoothCompanyIdentiferAAMPofAmerica = 190, + kBluetoothCompanyIdentiferStalmartTechnology = 191, + kBluetoothCompanyIdentiferAMICCOMElectronics = 192, + kBluetoothCompanyIdentiferShenzhenExcelsecuDataTechnology = 193, + kBluetoothCompanyIdentiferGeneq = 194, + kBluetoothCompanyIdentiferAdidas = 195, + kBluetoothCompanyIdentiferLGElectronics = 196, + kBluetoothCompanyIdentiferOnsetComputer = 197, + kBluetoothCompanyIdentiferSelflyBV = 198, + kBluetoothCompanyIdentiferQuupa = 199, + kBluetoothCompanyIdentiferGeLo = 200, + kBluetoothCompanyIdentiferEvluma = 201, + kBluetoothCompanyIdentiferMC10 = 202, + kBluetoothCompanyIdentiferBinauricSE = 203, + kBluetoothCompanyIdentiferBeatsElectronics = 204, + kBluetoothCompanyIdentiferMicrochipTechnology = 205, + kBluetoothCompanyIdentiferElgatoSystems = 206, + kBluetoothCompanyIdentiferARCHOS = 207, + kBluetoothCompanyIdentiferDexcom = 208, + kBluetoothCompanyIdentiferPolarElectroEurope = 209, + kBluetoothCompanyIdentiferDialogSemiconductor = 210, + kBluetoothCompanyIdentiferTaixingbangTechnology = 211, + kBluetoothCompanyIdentiferKawantech = 212, + kBluetoothCompanyIdentiferAustcoCommunicationsSystems = 213, + kBluetoothCompanyIdentiferTimexGroup = 214, + kBluetoothCompanyIdentiferQualcommTechnologies = 215, + kBluetoothCompanyIdentiferQualcommConnectedExperiences = 216, + kBluetoothCompanyIdentiferVoyetraTurtleBeach = 217, + kBluetoothCompanyIdentifertxtrGMBH = 218, + kBluetoothCompanyIdentiferBiosentronics = 219, + kBluetoothCompanyIdentiferProctorAndGamble = 220, + kBluetoothCompanyIdentiferHosiden = 221, + kBluetoothCompanyIdentiferMusik = 222, + kBluetoothCompanyIdentiferMisfitWearables = 223, + kBluetoothCompanyIdentiferGoogle = 224, + kBluetoothCompanyIdentiferDanlers = 225, + kBluetoothCompanyIdentiferSemilink = 226, + kBluetoothCompanyIdentiferInMusicBrands = 227, + kBluetoothCompanyIdentiferLSResearch = 228, + kBluetoothCompanyIdentiferEdenSoftwareConsultants = 229, + kBluetoothCompanyIdentiferFreshtemp = 230, + kBluetoothCompanyIdentiferKSTechnologies = 231, + kBluetoothCompanyIdentiferACTSTechnologies = 232, + kBluetoothCompanyIdentiferVtrackSystems = 233, + kBluetoothCompanyIdentiferNielsenKellerman = 234, + kBluetoothCompanyIdentiferServerTechnology = 235, + kBluetoothCompanyIdentiferBioResearchAssociates = 236, + kBluetoothCompanyIdentiferJollyLogic = 237, + kBluetoothCompanyIdentiferAboveAverageOutcomes = 238, + kBluetoothCompanyIdentiferBitsplitters = 239, + kBluetoothCompanyIdentiferPayPal = 240, + kBluetoothCompanyIdentiferWitronTechnology = 241, + kBluetoothCompanyIdentiferMorseProject = 242, + kBluetoothCompanyIdentiferKentDisplays = 243, + kBluetoothCompanyIdentiferNautilus = 244, + kBluetoothCompanyIdentiferSmartifier = 245, + kBluetoothCompanyIdentiferElcometer = 246, + kBluetoothCompanyIdentiferVSNTechnologies = 247, + kBluetoothCompanyIdentiferAceUni = 248, + kBluetoothCompanyIdentiferStickNFind = 249, + kBluetoothCompanyIdentiferCrystalCode = 250, + kBluetoothCompanyIdentiferKOUKAMM = 251, + kBluetoothCompanyIdentiferDelphi = 252, + kBluetoothCompanyIdentiferValenceTech = 253, + kBluetoothCompanyIdentiferStanleyBlackAndDecker = 254, + kBluetoothCompanyIdentiferTypeProducts = 255, + kBluetoothCompanyIdentiferTomTomInternational = 256, + kBluetoothCompanyIdentiferFuGoo = 257, + kBluetoothCompanyIdentiferKeiser = 258, + kBluetoothCompanyIdentiferBangAndOlufson = 259, + kBluetoothCompanyIdentiferPLUSLocationSystems = 260, + kBluetoothCompanyIdentiferUbiquitousComputingTechnology = 261, + kBluetoothCompanyIdentiferInnovativeYachtterSolutions = 262, + kBluetoothCompanyIdentiferWilliamDemantHolding = 263, + + kBluetoothCompanyIdentiferInteropIdentifier = 65535 +}; + +#pragma mark - +#pragma mark === Baseband === + +// +// Service Class Major +// + +enum +{ + kBluetoothServiceClassMajorLimitedDiscoverableMode = 0x001, // Bit 13 - Limited Discoverable Mode + kBluetoothServiceClassMajorReserved1 = 0x002, // Bit 14 - Reserved for future use. + kBluetoothServiceClassMajorReserved2 = 0x004, // Bit 15 - Reserved for future use. + kBluetoothServiceClassMajorPositioning = 0x008, // Bit 16 - Positioning (Location ID) + kBluetoothServiceClassMajorNetworking = 0x010, // Bit 17 - LAN, Ad hoc, etc... + kBluetoothServiceClassMajorRendering = 0x020, // Bit 18 - Printing, Speaker, etc... + kBluetoothServiceClassMajorCapturing = 0x040, // Bit 19 - Scanner, Microphone, etc... + kBluetoothServiceClassMajorObjectTransfer = 0x080, // Bit 20 - v-Inbox, v-Folder, etc... + kBluetoothServiceClassMajorAudio = 0x100, // Bit 21 - Speaker, Microphone, Headset, etc... + kBluetoothServiceClassMajorTelephony = 0x200, // Bit 22 - Cordless telephony, Modem, Headset, etc... + kBluetoothServiceClassMajorInformation = 0x400, // Bit 23 - Web server, WAP server, etc... + + kBluetoothServiceClassMajorAny = '****', // Pseudo-class - means anything acceptable. + kBluetoothServiceClassMajorNone = 'none', // Pseudo-class - means no matching. + + kBluetoothServiceClassMajorEnd +}; + +// +// Device Class Major +// + +enum +{ + kBluetoothDeviceClassMajorMiscellaneous = 0x00, // [00000] Miscellaneous + kBluetoothDeviceClassMajorComputer = 0x01, // [00001] Desktop, Notebook, PDA, Organizers, etc... + kBluetoothDeviceClassMajorPhone = 0x02, // [00010] Cellular, Cordless, Payphone, Modem, etc... + kBluetoothDeviceClassMajorLANAccessPoint = 0x03, // [00011] LAN Access Point + kBluetoothDeviceClassMajorAudio = 0x04, // [00100] Headset, Speaker, Stereo, etc... + kBluetoothDeviceClassMajorPeripheral = 0x05, // [00101] Mouse, Joystick, Keyboards, etc... + kBluetoothDeviceClassMajorImaging = 0x06, // [00110] Printing, scanner, camera, display, etc... + kBluetoothDeviceClassMajorWearable = 0x07, // [00111] Wearable + kBluetoothDeviceClassMajorToy = 0x08, // [01000] Toy + kBluetoothDeviceClassMajorHealth = 0x09, // [01001] Health devices + kBluetoothDeviceClassMajorUnclassified = 0x1F, // [11111] Specific device code not assigned + + // Range 0x06 to 0x1E Reserved for future use. + + kBluetoothDeviceClassMajorAny = '****', // Pseudo-class - means anything acceptable. + kBluetoothDeviceClassMajorNone = 'none', // Pseudo-class - means no matching. + + kBluetoothDeviceClassMajorEnd +}; + +// +// Device Class Minor +// + +enum +{ + /// + /// Computer Minor Class + /// + + kBluetoothDeviceClassMinorComputerUnclassified = 0x00, // [000000] Specific device code not assigned + kBluetoothDeviceClassMinorComputerDesktopWorkstation = 0x01, // [000001] Desktop workstation + kBluetoothDeviceClassMinorComputerServer = 0x02, // [000010] Server-class computer + kBluetoothDeviceClassMinorComputerLaptop = 0x03, // [000011] Laptop + kBluetoothDeviceClassMinorComputerHandheld = 0x04, // [000100] Handheld PC/PDA (clam shell) + kBluetoothDeviceClassMinorComputerPalmSized = 0x05, // [000101] Palm-sized PC/PDA + kBluetoothDeviceClassMinorComputerWearable = 0x06, // [000110] Wearable computer (watch sized) + + // Range 0x06 to 0x7F Reserved for future use. + + /// + /// Phone Minor Class + /// + + kBluetoothDeviceClassMinorPhoneUnclassified = 0x00, // [000000] Specific device code not assigned + kBluetoothDeviceClassMinorPhoneCellular = 0x01, // [000001] Cellular + kBluetoothDeviceClassMinorPhoneCordless = 0x02, // [000010] Cordless + kBluetoothDeviceClassMinorPhoneSmartPhone = 0x03, // [000011] Smart phone + kBluetoothDeviceClassMinorPhoneWiredModemOrVoiceGateway = 0x04, // [000100] Wired modem or voice gateway + kBluetoothDeviceClassMinorPhoneCommonISDNAccess = 0x05, // [000101] Common ISDN Access + + // Range 0x05 to 0x7F Reserved for future use. + + /// + /// LAN Access Point Minor Class + /// + + // See the Bluetooth specification for LAN Access Point minor classes, which are broken into bits 5-7 for utilization and bits 2-4 for class. + + /// + /// Audio Minor Class + /// + + kBluetoothDeviceClassMinorAudioUnclassified = 0x00, // [000000] Specific device code not assigned + kBluetoothDeviceClassMinorAudioHeadset = 0x01, // [000001] Device conforms to the Headset profile + kBluetoothDeviceClassMinorAudioHandsFree = 0x02, // [000010] Hands-free + kBluetoothDeviceClassMinorAudioReserved1 = 0x03, // [000011] Reserved + kBluetoothDeviceClassMinorAudioMicrophone = 0x04, // [000100] Microphone + kBluetoothDeviceClassMinorAudioLoudspeaker = 0x05, // [000101] Loudspeaker + kBluetoothDeviceClassMinorAudioHeadphones = 0x06, // [000110] Headphones + kBluetoothDeviceClassMinorAudioPortable = 0x07, // [000111] Portable Audio + kBluetoothDeviceClassMinorAudioCar = 0x08, // [001000] Car Audio + kBluetoothDeviceClassMinorAudioSetTopBox = 0x09, // [001001] Set-top box + kBluetoothDeviceClassMinorAudioHiFi = 0x0a, // [001010] HiFi Audio Device + kBluetoothDeviceClassMinorAudioVCR = 0x0b, // [001011] VCR + kBluetoothDeviceClassMinorAudioVideoCamera = 0x0c, // [001100] Video Camera + kBluetoothDeviceClassMinorAudioCamcorder = 0x0d, // [001101] Camcorder + kBluetoothDeviceClassMinorAudioVideoMonitor = 0x0e, // [001110] Video Monitor + kBluetoothDeviceClassMinorAudioVideoDisplayAndLoudspeaker = 0x0f, // [001111] Video Display and Loudspeaker + kBluetoothDeviceClassMinorAudioVideoConferencing = 0x10, // [010000] Video Conferencing + kBluetoothDeviceClassMinorAudioReserved2 = 0x11, // [010001] Reserved + kBluetoothDeviceClassMinorAudioGamingToy = 0x12, // [010010] Gaming/Toy + + // Range 0x13 to 0x7F Reserved for future use. + + /// + /// Peripheral Minor Class + /// + + // Peripheral1 subclass is bits 7 & 6 + + kBluetoothDeviceClassMinorPeripheral1Keyboard = 0x10, // [01XXXX] Keyboard + kBluetoothDeviceClassMinorPeripheral1Pointing = 0x20, // [10XXXX] Pointing device + kBluetoothDeviceClassMinorPeripheral1Combo = 0x30, // [11XXXX] Combo keyboard/pointing device + + // Peripheral2 subclass is bits 5-2 + + kBluetoothDeviceClassMinorPeripheral2Unclassified = 0x00, // [XX0000] Uncategorized device + kBluetoothDeviceClassMinorPeripheral2Joystick = 0x01, // [XX0001] Joystick + kBluetoothDeviceClassMinorPeripheral2Gamepad = 0x02, // [XX0010] Gamepad + kBluetoothDeviceClassMinorPeripheral2RemoteControl = 0x03, // [XX0011] Remote control + kBluetoothDeviceClassMinorPeripheral2SensingDevice = 0x04, // [XX0100] Sensing device + kBluetoothDeviceClassMinorPeripheral2DigitizerTablet = 0x05, // [XX0101] Digitizer Tablet + kBluetoothDeviceClassMinorPeripheral2CardReader = 0x06, // [XX0110] Card Reader + kBluetoothDeviceClassMinorPeripheral2DigitalPen = 0x07, // [XX0111] Digital Pen + kBluetoothDeviceClassMinorPeripheral2HandheldScanner = 0x08, // [XX1000] Handheld scanner for bar-codes, RFID, etc. + kBluetoothDeviceClassMinorPeripheral2GesturalInputDevice = 0x09, // [XX1001] Handheld gestural input device (e.g., "wand" form factor) + + kBluetoothDeviceClassMinorPeripheral2AnyPointing = 'poin', // Anything under MinorPeripheral1Pointing + + // Range 0x05 to 0x0f reserved for future use + + /// + /// Imaging Minor Class + /// + + // Imaging1 subclass is bits 7 - 4 + + kBluetoothDeviceClassMinorImaging1Display = 0x04, // [XXX1XX] Display + kBluetoothDeviceClassMinorImaging1Camera = 0x08, // [XX1XXX] Camera + kBluetoothDeviceClassMinorImaging1Scanner = 0x10, // [X1XXXX] Scanner + kBluetoothDeviceClassMinorImaging1Printer = 0x20, // [1XXXXX] Printer + + // Imaging2 subclass is bits 3 - 2 + + kBluetoothDeviceClassMinorImaging2Unclassified = 0x00, // [XXXX00] Uncategorized, default + + // Range 0x01 - 0x03 reserved for future use + + /// + /// Wearable Minor Class + /// + + kBluetoothDeviceClassMinorWearableWristWatch = 0x01, // [000001] Watch + kBluetoothDeviceClassMinorWearablePager = 0x02, // [000010] Pager + kBluetoothDeviceClassMinorWearableJacket = 0x03, // [000011] Jacket + kBluetoothDeviceClassMinorWearableHelmet = 0x04, // [000100] Helmet + kBluetoothDeviceClassMinorWearableGlasses = 0x05, // [000101] Glasses + + /// + /// Toy Minor Class + /// + + kBluetoothDeviceClassMinorToyRobot = 0x01, // [000001] Robot + kBluetoothDeviceClassMinorToyVehicle = 0x02, // [000010] Vehicle + kBluetoothDeviceClassMinorToyDollActionFigure = 0x03, // [000011] Doll / Action Figure + kBluetoothDeviceClassMinorToyController = 0x04, // [000100] Controller + kBluetoothDeviceClassMinorToyGame = 0x05, // [000101] Game + + /// + /// Health Minor Class + /// + + kBluetoothDeviceClassMinorHealthUndefined = 0x00, // [000000] Undefined + kBluetoothDeviceClassMinorHealthBloodPressureMonitor = 0x01, // [000001] Blood Pressure Monitor + kBluetoothDeviceClassMinorHealthThermometer = 0x02, // [000010] Thermometer + kBluetoothDeviceClassMinorHealthScale = 0x03, // [000011] Scale + kBluetoothDeviceClassMinorHealthGlucoseMeter = 0x04, // [000100] Glucose Meter + kBluetoothDeviceClassMinorHealthPulseOximeter = 0x05, // [000101] Pulse Oximeter + kBluetoothDeviceClassMinorHealthHeartRateMonitor = 0x06, // [000111] Heart Rate Monitor + kBluetoothDeviceClassMinorHealthDataDisplay = 0x07, // [001000] Display + + /// + /// Misc + /// + + kBluetoothDeviceClassMinorAny = '****', // Pseudo-class - means anything acceptable. + kBluetoothDeviceClassMinorNone = 'none', // Pseudo-class - means no matching. + + kBluetoothDeviceClassMinorEnd +}; + +// Peripheral devices bits 7 & 6 +#define BluetoothCoDMinorPeripheral1(minorClass) (minorClass & 0x30) + +// Peripheral devices bits 5 - 2 +#define BluetoothCoDMinorPeripheral2(minorClass) (minorClass & 0x0f) + +#pragma mark - LE Appearance +enum +{ + kBluetoothGAPAppearanceUnknown = 0, + kBluetoothGAPAppearanceGenericPhone = 64, + kBluetoothGAPAppearanceGenericComputer = 128, + kBluetoothGAPAppearanceGenericWatch = 192, + kBluetoothGAPAppearanceGenericClock = 256, + kBluetoothGAPAppearanceGenericDisplay = 320, + kBluetoothGAPAppearanceGenericRemoteControl = 384, + kBluetoothGAPAppearanceGenericEyeGlasses = 448, + kBluetoothGAPAppearanceGenericTag = 512, + kBluetoothGAPAppearanceGenericKeyring = 576, + kBluetoothGAPAppearanceGenericMediaPlayer = 640, + kBluetoothGAPAppearanceGenericBarcodeScanner = 704, + kBluetoothGAPAppearanceGenericThermometer = 768, + kBluetoothGAPAppearanceGenericHeartrateSensor = 832, + kBluetoothGAPAppearanceGenericBloodPressure = 896, + kBluetoothGAPAppearanceGenericHumanInterfaceDevice = 960, + kBluetoothGAPAppearanceHumanInterfaceDeviceKeyboard = 961, + kBluetoothGAPAppearanceHumanInterfaceDeviceMouse = 962, + kBluetoothGAPAppearanceHumanInterfaceDeviceJoystick = 963, + kBluetoothGAPAppearanceHumanInterfaceDeviceGamepad = 964, + kBluetoothGAPAppearanceHumanInterfaceDeviceDigitizerTablet = 965, + kBluetoothGAPAppearanceHumanInterfaceDeviceCardReader = 966, + kBluetoothGAPAppearanceHumanInterfaceDeviceDigitalPen = 967, + kBluetoothGAPAppearanceHumanInterfaceDeviceBarcodeScanner = 968, + kBluetoothGAPAppearanceGenericGlucoseMeter = 1024, + kBluetoothGAPAppearanceGenericRunningWalkingSensor = 1088, + kBluetoothGAPAppearanceGenericCycling = 1152 +}; + +#pragma mark - +#pragma mark === L2CAP === + +enum +{ + kBluetoothL2CAPPSMSDP = 0x0001, + kBluetoothL2CAPPSMRFCOMM = 0x0003, + kBluetoothL2CAPPSMTCS_BIN = 0x0005, // Telephony Control Specifictation / TCS Binary + kBluetoothL2CAPPSMTCS_BIN_Cordless = 0x0007, // Telephony Control Specifictation / TCS Binary + kBluetoothL2CAPPSMBNEP = 0x000F, // Bluetooth Network Encapsulation Protocol + kBluetoothL2CAPPSMHIDControl = 0x0011, // HID profile - control interface + kBluetoothL2CAPPSMHIDInterrupt = 0x0013, // HID profile - interrupt interface + kBluetoothL2CAPPSMAVCTP = 0x0017, // Audio/Video Control Transport Protocol + kBluetoothL2CAPPSMAVDTP = 0x0019, // Audio/Video Distribution Transport Protocol + kBluetoothL2CAPPSMAVCTP_Browsing = 0x001B, // AVTCP (AVRCP) Browsing + kBluetoothL2CAPPSMUID_C_Plane = 0x001D, // Unrestricted Digital Information Profile (UDI) + kBluetoothL2CAPPSMATT = 0x001F, // Attribute Protocol + + // Range < 0x1000 reserved. + kBluetoothL2CAPPSMReservedStart = 0x0001, + kBluetoothL2CAPPSMReservedEnd = 0x1000, + + // Range 0x1001-0xFFFF dynamically assigned. + kBluetoothL2CAPPSMDynamicStart = 0x1001, + // AACP + kBluetoothL2CAPPSMAACP = 0x1001, + kBluetoothL2CAPPSMD2D = 0x100F, + kBluetoothL2CAPPSMDynamicEnd = 0xFFFF, + + kBluetoothL2CAPPSMNone = 0x0000 +}; + +#pragma mark - +#pragma mark === SDP === + +enum +{ + // General + + kBluetoothSDPUUID16Base = 0x0000, // 00000000-0000-1000-8000-00805f9b34fb + + // Protocols + + kBluetoothSDPUUID16SDP = 0x0001, // 00000001-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16UDP = 0x0002, // 00000002-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16RFCOMM = 0x0003, // 00000003-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16TCP = 0x0004, // 00000004-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16TCSBIN = 0x0005, // 00000005-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16TCSAT = 0x0006, // 00000006-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ATT = 0x0007, + kBluetoothSDPUUID16OBEX = 0x0008, // 00000008-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16IP = 0x0009, // 00000009-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16FTP = 0x000A, // 0000000A-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16HTTP = 0x000C, // 0000000C-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16WSP = 0x000E, // 0000000E-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16BNEP = 0x000F, + kBluetoothSDPUUID16UPNP = 0x0010, + kBluetoothSDPUUID16HIDP = 0x0011, + kBluetoothSDPUUID16HardcopyControlChannel = 0x0012, + kBluetoothSDPUUID16HardcopyDataChannel = 0x0014, + kBluetoothSDPUUID16HardcopyNotification = 0x0016, + kBluetoothSDPUUID16AVCTP = 0x0017, + kBluetoothSDPUUID16AVDTP = 0x0019, + kBluetoothSDPUUID16CMPT = 0x001B, + kBluetoothSDPUUID16UDI_C_Plane = 0x001D, + kBluetoothSDPUUID16MCAPControlChannel = 0x001E, + kBluetoothSDPUUID16MCAPDataChannel = 0x001F, + kBluetoothSDPUUID16L2CAP = 0x0100 // 00000100-0000-1000-8000-00805f9b34fb +}; + +enum SDPServiceClasses +{ + kBluetoothSDPUUID16ServiceClassServiceDiscoveryServer = 0x1000, // 00001000-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassBrowseGroupDescriptor = 0x1001, // 00001001-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassPublicBrowseGroup = 0x1002, // 00001002-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassSerialPort = 0x1101, // 00001101-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassLANAccessUsingPPP = 0x1102, // 00001102-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassDialupNetworking = 0x1103, // 00001103-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassIrMCSync = 0x1104, // 00001104-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassOBEXObjectPush = 0x1105, // 00001105-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassOBEXFileTransfer = 0x1106, // 00001106-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassIrMCSyncCommand = 0x1107, // 00001107-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassHeadset = 0x1108, // 00001108-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassCordlessTelephony = 0x1109, // 00001109-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassAudioSource = 0x110A, + kBluetoothSDPUUID16ServiceClassAudioSink = 0x110B, + kBluetoothSDPUUID16ServiceClassAVRemoteControlTarget = 0x110C, + kBluetoothSDPUUID16ServiceClassAdvancedAudioDistribution = 0x110D, + kBluetoothSDPUUID16ServiceClassAVRemoteControl = 0x110E, + kBluetoothSDPUUID16ServiceClassAVRemoteControlController = 0x110F, + kBluetoothSDPUUID16ServiceClassIntercom = 0x1110, // 00001110-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassFax = 0x1111, // 00001111-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassHeadsetAudioGateway = 0x1112, // 00001112-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassWAP = 0x1113, + kBluetoothSDPUUID16ServiceClassWAPClient = 0x1114, + kBluetoothSDPUUID16ServiceClassPANU = 0x1115, + kBluetoothSDPUUID16ServiceClassNAP = 0x1116, + kBluetoothSDPUUID16ServiceClassGN = 0x1117, + kBluetoothSDPUUID16ServiceClassDirectPrinting = 0x1118, + kBluetoothSDPUUID16ServiceClassReferencePrinting = 0x1119, + kBluetoothSDPUUID16ServiceClassImaging = 0x111A, + kBluetoothSDPUUID16ServiceClassImagingResponder = 0x111B, + kBluetoothSDPUUID16ServiceClassImagingAutomaticArchive = 0x111C, + kBluetoothSDPUUID16ServiceClassImagingReferencedObjects = 0x111D, + kBluetoothSDPUUID16ServiceClassHandsFree = 0x111E, + kBluetoothSDPUUID16ServiceClassHandsFreeAudioGateway = 0x111F, + kBluetoothSDPUUID16ServiceClassDirectPrintingReferenceObjectsService = 0x1120, + kBluetoothSDPUUID16ServiceClassReflectedUI = 0x1121, + kBluetoothSDPUUID16ServiceClassBasicPrinting = 0x1122, + kBluetoothSDPUUID16ServiceClassPrintingStatus = 0x1123, + kBluetoothSDPUUID16ServiceClassHumanInterfaceDeviceService = 0x1124, + kBluetoothSDPUUID16ServiceClassHardcopyCableReplacement = 0x1125, + kBluetoothSDPUUID16ServiceClassHCR_Print = 0x1126, + kBluetoothSDPUUID16ServiceClassHCR_Scan = 0x1127, + kBluetoothSDPUUID16ServiceClassCommonISDNAccess = 0x1128, + kBluetoothSDPUUID16ServiceClassVideoConferencingGW = 0x1129, + kBluetoothSDPUUID16ServiceClassUDI_MT = 0x112A, + kBluetoothSDPUUID16ServiceClassUDI_TA = 0x112B, + kBluetoothSDPUUID16ServiceClassAudioVideo = 0x112C, + kBluetoothSDPUUID16ServiceClassSIM_Access = 0x112D, + kBluetoothSDPUUID16ServiceClassPhonebookAccess_PCE = 0x112E, + kBluetoothSDPUUID16ServiceClassPhonebookAccess_PSE = 0x112F, + kBluetoothSDPUUID16ServiceClassPhonebookAccess = 0x1130, + kBluetoothSDPUUID16ServiceClassHeadset_HS = 0x1131, + kBluetoothSDPUUID16ServiceClassMessageAccessServer = 0x1132, + kBluetoothSDPUUID16ServiceClassMessageNotificationServer = 0x1133, + kBluetoothSDPUUID16ServiceClassMessageAccessProfile = 0x1134, + kBluetoothSDPUUID16ServiceClassGlobalNavigationSatelliteSystem = 0x1135, + kBluetoothSDPUUID16ServiceClassGlobalNavigationSatelliteSystemServer = 0x1136, + kBluetoothSDPUUID16ServiceClassPnPInformation = 0x1200, // 00001200-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassGenericNetworking = 0x1201, // 00001201-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassGenericFileTransfer = 0x1202, // 00001202-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassGenericAudio = 0x1203, // 00001203-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassGenericTelephony = 0x1204, // 00001204-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassVideoSource = 0x1303, + kBluetoothSDPUUID16ServiceClassVideoSink = 0x1304, + kBluetoothSDPUUID16ServiceClassVideoDistribution = 0x1305, + kBluetoothSDPUUID16ServiceClassHealthDevice = 0x1400, + kBluetoothSDPUUID16ServiceClassHealthDeviceSource = 0x1401, + kBluetoothSDPUUID16ServiceClassHealthDeviceSink = 0x1402, + kBluetoothSDPUUID16ServiceClassGATT = 0x1801 +}; + +enum SDPAttributeIdentifierCodes +{ + kBluetoothSDPAttributeIdentifierServiceRecordHandle = 0x0000, + kBluetoothSDPAttributeIdentifierServiceClassIDList = 0x0001, + kBluetoothSDPAttributeIdentifierServiceRecordState = 0x0002, + kBluetoothSDPAttributeIdentifierServiceID = 0x0003, + kBluetoothSDPAttributeIdentifierProtocolDescriptorList = 0x0004, + kBluetoothSDPAttributeIdentifierBrowseGroupList = 0x0005, + kBluetoothSDPAttributeIdentifierLanguageBaseAttributeIDList = 0x0006, + kBluetoothSDPAttributeIdentifierServiceInfoTimeToLive = 0x0007, + kBluetoothSDPAttributeIdentifierServiceAvailability = 0x0008, + kBluetoothSDPAttributeIdentifierBluetoothProfileDescriptorList = 0x0009, + kBluetoothSDPAttributeIdentifierDocumentationURL = 0x000A, + kBluetoothSDPAttributeIdentifierClientExecutableURL = 0x000B, + kBluetoothSDPAttributeIdentifierIconURL = 0x000C, + kBluetoothSDPAttributeIdentifierAdditionalProtocolsDescriptorList = 0x000D, + + // Service Discovery Server + kBluetoothSDPAttributeIdentifierVersionNumberList = 0x0200, + kBluetoothSDPAttributeIdentifierServiceDatabaseState = 0x0201, + + // Browse Group Descriptor + kBluetoothSDPAttributeIdentifierGroupID = 0x0200, + + // PAN + kBluetoothSDPAttributeIdentifierIPSubnet = 0x0200, + + // HID Required Type Notes + kBluetoothSDPAttributeIdentifierHIDReleaseNumber = 0x0200, // O uint16 + kBluetoothSDPAttributeIdentifierHIDParserVersion = 0x0201, // M uint16 + kBluetoothSDPAttributeIdentifierHIDDeviceSubclass = 0x0202, // M uint8 Should match the low order 8 bits of CoD unless a combo device + kBluetoothSDPAttributeIdentifierHIDCountryCode = 0x0203, // M uint8 + kBluetoothSDPAttributeIdentifierHIDVirtualCable = 0x0204, // M bool + kBluetoothSDPAttributeIdentifierHIDReconnectInitiate = 0x0205, // M bool + kBluetoothSDPAttributeIdentifierHIDDescriptorList = 0x0206, // M sequence Layout is defined in Section 6.2 of the HID Specification + kBluetoothSDPAttributeIdentifierHIDLangIDBaseList = 0x0207, // M sequence + kBluetoothSDPAttributeIdentifierHIDSDPDisable = 0x0208, // O bool + kBluetoothSDPAttributeIdentifierHIDBatteryPower = 0x0209, // O bool + kBluetoothSDPAttributeIdentifierHIDRemoteWake = 0x020A, // O bool + kBluetoothSDPAttributeIdentifierHIDProfileVersion = 0x020B, // M uint16 + kBluetoothSDPAttributeIdentifierHIDSupervisionTimeout = 0x020C, // O uint16 Default to 5 seconds or longer if not defined + kBluetoothSDPAttributeIdentifierHIDNormallyConnectable = 0x020D, // O bool + kBluetoothSDPAttributeIdentifierHIDBootDevice = 0x020E, // M bool Only defined for mice and keyboards as of HID 1.0 + kBluetoothSDPAttributeIdentifierHIDSSRHostMaxLatency = 0x020F, // O uint16 + kBluetoothSDPAttributeIdentifierHIDSSRHostMinTimeout = 0x0210, // O uint16 + + kBluetoothSDPAttributeIdentifierServiceVersion = 0x0300, + kBluetoothSDPAttributeIdentifierExternalNetwork = 0x0301, // Cordless telephony + kBluetoothSDPAttributeIdentifierNetwork = 0x0301, // Handsfree Profile (HFP) + kBluetoothSDPAttributeIdentifierSupportedDataStoresList = 0x0301, // Sync Profile + kBluetoothSDPAttributeIdentifierFaxClass1Support = 0x0302, // Fax Profile + kBluetoothSDPAttributeIdentifierRemoteAudioVolumeControl = 0x0302, // GAP??? + kBluetoothSDPAttributeIdentifierFaxClass2_0Support = 0x0303, + kBluetoothSDPAttributeIdentifierSupporterFormatsList = 0x0303, + kBluetoothSDPAttributeIdentifierFaxClass2Support = 0x0304, + kBluetoothSDPAttributeIdentifierAudioFeedbackSupport = 0x0305, + kBluetoothSDPAttributeIdentifierNetworkAddress = 0x0306, // WAP + kBluetoothSDPAttributeIdentifierWAPGateway = 0x0307, // WAP + kBluetoothSDPAttributeIdentifierHomepageURL = 0x0308, // WAP + kBluetoothSDPAttributeIdentifierWAPStackType = 0x0309, // WAP + kBluetoothSDPAttributeIdentifierSecurityDescription = 0x030A, // PAN + kBluetoothSDPAttributeIdentifierNetAccessType = 0x030B, // PAN + kBluetoothSDPAttributeIdentifierMaxNetAccessRate = 0x030C, // PAN + kBluetoothSDPAttributeIdentifierSupportedCapabilities = 0x0310, // Imaging + kBluetoothSDPAttributeIdentifierSupportedFeatures = 0x0311, // Imaging & HFP + kBluetoothSDPAttributeIdentifierSupportedFunctions = 0x0312, // Imaging + kBluetoothSDPAttributeIdentifierTotalImagingDataCapacity = 0x0313, // Imaging + + kBluetoothSDPAttributeIdentifierServiceName = 0x0000, /* +language base offset */ + kBluetoothSDPAttributeIdentifierServiceDescription = 0x0001, /* +language base offset */ + kBluetoothSDPAttributeIdentifierProviderName = 0x0002 /* +language base offset */ +}; + +enum SDPAttributeDeviceIdentificationRecord +{ + // DeviceID v1.3 Required Type Section Notes + kBluetoothSDPAttributeDeviceIdentifierServiceDescription = 0x0001, // O string - + kBluetoothSDPAttributeDeviceIdentifierDocumentationURL = 0x000A, // O url - + kBluetoothSDPAttributeDeviceIdentifierClientExecutableURL = 0x000B, // O url - + kBluetoothSDPAttributeDeviceIdentifierSpecificationID = 0x0200, // M uint16 5.1 + kBluetoothSDPAttributeDeviceIdentifierVendorID = 0x0201, // M uint16 5.2 + kBluetoothSDPAttributeDeviceIdentifierProductID = 0x0202, // M uint16 5.3 + kBluetoothSDPAttributeDeviceIdentifierVersion = 0x0203, // M uint16 5.4 + kBluetoothSDPAttributeDeviceIdentifierPrimaryRecord = 0x0204, // M bool 5.5 + kBluetoothSDPAttributeDeviceIdentifierVendorIDSource = 0x0205, // M uint16 5.6 + kBluetoothSDPAttributeDeviceIdentifierReservedRangeStart = 0x0206, + kBluetoothSDPAttributeDeviceIdentifierReservedRangeEnd = 0x02FF + +}; + +enum ProtocolParameters +{ + kBluetoothSDPProtocolParameterL2CAPPSM = 1, + kBluetoothSDPProtocolParameterRFCOMMChannel = 1, + kBluetoothSDPProtocolParameterTCPPort = 1, + kBluetoothSDPProtocolParameterUDPPort = 1, + kBluetoothSDPProtocolParameterBNEPVersion = 1, + kBluetoothSDPProtocolParameterBNEPSupportedNetworkPacketTypeList = 2 +}; + +/*! + * @enum BluetoothHCIExtendedInquiryResponseDataTypes + * @brief Inquiries with 'Extended Inquiry Response' + * @seealso Bluetooth v2.1 specification + */ + +enum BluetoothHCIExtendedInquiryResponseDataTypes +{ + kBluetoothHCIExtendedInquiryResponseDataTypeFlags = 0x01, + kBluetoothHCIExtendedInquiryResponseDataType16BitServiceClassUUIDsWithMoreAvailable = 0x02, + kBluetoothHCIExtendedInquiryResponseDataType16BitServiceClassUUIDsCompleteList = 0x03, + kBluetoothHCIExtendedInquiryResponseDataType32BitServiceClassUUIDsWithMoreAvailable = 0x04, + kBluetoothHCIExtendedInquiryResponseDataType32BitServiceClassUUIDsCompleteList = 0x05, + kBluetoothHCIExtendedInquiryResponseDataType128BitServiceClassUUIDsWithMoreAvailable = 0x06, + kBluetoothHCIExtendedInquiryResponseDataType128BitServiceClassUUIDsCompleteList = 0x07, + kBluetoothHCIExtendedInquiryResponseDataTypeShortenedLocalName = 0x08, + kBluetoothHCIExtendedInquiryResponseDataTypeCompleteLocalName = 0x09, + kBluetoothHCIExtendedInquiryResponseDataTypeTransmitPowerLevel = 0x0A, + kBluetoothHCIExtendedInquiryResponseDataTypeSSPOOBClassOfDevice = 0x0D, + kBluetoothHCIExtendedInquiryResponseDataTypeSSPOOBSimplePairingHashC = 0x0E, + kBluetoothHCIExtendedInquiryResponseDataTypeSSPOOBSimplePairingRandomizerR = 0x0F, + kBluetoothHCIExtendedInquiryResponseDataTypeDeviceID = 0x10, + kBluetoothHCIExtendedInquiryResponseDataTypeSecurityManagerTKValue = 0x10, + kBluetoothHCIExtendedInquiryResponseDataTypeSecurityManagerOOBFlags = 0x11, + kBluetoothHCIExtendedInquiryResponseDataTypeSlaveConnectionIntervalRange = 0x12, + kBluetoothHCIExtendedInquiryResponseDataTypeServiceSolicitation16BitUUIDs = 0x14, + kBluetoothHCIExtendedInquiryResponseDataTypeServiceSolicitation128BitUUIDs = 0x15, + kBluetoothHCIExtendedInquiryResponseDataTypeServiceData = 0x16, + kBluetoothHCIExtendedInquiryResponseDataTypePublicTargetAddress = 0x17, + kBluetoothHCIExtendedInquiryResponseDataTypeRandomTargetAddress = 0x18, + kBluetoothHCIExtendedInquiryResponseDataTypeAppearance = 0x19, + kBluetoothHCIExtendedInquiryResponseDataTypeAdvertisingInterval = 0x1A, + kBluetoothHCIExtendedInquiryResponseDataTypeLEBluetoothDeviceAddress = 0x1B, + kBluetoothHCIExtendedInquiryResponseDataTypeLERole = 0x1C, + kBluetoothHCIExtendedInquiryResponseDataTypeSimplePairingHash = 0x1D, + kBluetoothHCIExtendedInquiryResponseDataTypeSimplePairingRandomizer = 0x1E, + kBluetoothHCIExtendedInquiryResponseDataTypeServiceSolicitation32BitUUIDs = 0x1F, + kBluetoothHCIExtendedInquiryResponseDataTypeServiceData32BitUUID = 0x20, + kBluetoothHCIExtendedInquiryResponseDataTypeServiceData128BitUUID = 0x21, + kBluetoothHCIExtendedInquiryResponseDataTypeSecureConnectionsConfirmationValue = 0x22, + kBluetoothHCIExtendedInquiryResponseDataTypeSecureConnectionsRandomValue = 0x23, + kBluetoothHCIExtendedInquiryResponseDataTypeURI = 0x24, + kBluetoothHCIExtendedInquiryResponseDataTypeIndoorPositioning = 0x25, + kBluetoothHCIExtendedInquiryResponseDataTypeTransportDiscoveryData = 0x26, + kBluetoothHCIExtendedInquiryResponseDataType3DInformationData = 0x3D, + kBluetoothHCIExtendedInquiryResponseDataTypeManufacturerSpecificData = 0xFF +}; + +/*! + * @enum BluetoothHCIVersions + * @seealso https://www.bluetooth.com/specifications/assigned-numbers/host-controller-interface + */ + +typedef enum BluetoothHCIVersions +{ + kBluetoothHCIVersionCoreSpecification1_0b = 0x00, + kBluetoothHCIVersionCoreSpecification1_1 = 0x01, + kBluetoothHCIVersionCoreSpecification1_2 = 0x02, + kBluetoothHCIVersionCoreSpecification2_0EDR = 0x03, + kBluetoothHCIVersionCoreSpecification2_1EDR = 0x04, + kBluetoothHCIVersionCoreSpecification3_0HS = 0x05, + kBluetoothHCIVersionCoreSpecification4_0 = 0x06, + kBluetoothHCIVersionCoreSpecification4_1 = 0x07, + kBluetoothHCIVersionCoreSpecification4_2 = 0x08, + kBluetoothHCIVersionCoreSpecification5_0 = 0x09, + kBluetoothHCIVersionCoreSpecification5_1 = 0x0A, + kBluetoothHCIVersionCoreSpecification5_2 = 0x0B, + kBluetoothHCIVersionCoreSpecification5_3 = 0x0C +} BluetoothHCIVersions; + +/*! + * @enum BluetoothLMPVersions + * @seealso https://www.bluetooth.com/specifications/assigned-numbers/link-manager + */ + +typedef enum BluetoothLMPVersions +{ + kBluetoothLMPVersionCoreSpecification1_0b = 0x00, + kBluetoothLMPVersionCoreSpecification1_1 = 0x01, + kBluetoothLMPVersionCoreSpecification1_2 = 0x02, + kBluetoothLMPVersionCoreSpecification2_0EDR = 0x03, + kBluetoothLMPVersionCoreSpecification2_1EDR = 0x04, + kBluetoothLMPVersionCoreSpecification3_0HS = 0x05, + kBluetoothLMPVersionCoreSpecification4_0 = 0x06, + kBluetoothLMPVersionCoreSpecification4_1 = 0x07, + kBluetoothLMPVersionCoreSpecification4_2 = 0x08, + kBluetoothLMPVersionCoreSpecification5_0 = 0x09, + kBluetoothLMPVersionCoreSpecification5_1 = 0x0A, + kBluetoothLMPVersionCoreSpecification5_2 = 0x0B, + kBluetoothLMPVersionCoreSpecification5_3 = 0x0C +} BluetoothLMPVersions; + +#ifdef __cplusplus +} +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/CSRBluetoothHostController.h b/QualcommWireless/include/IOKit/bluetooth/CSRBluetoothHostController.h new file mode 100644 index 0000000..6372431 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/CSRBluetoothHostController.h @@ -0,0 +1,88 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_CSRBLUETOOTHHOSTCONTROLLER_H +#define _IOKIT_CSRBLUETOOTHHOSTCONTROLLER_H + +#include + +class CSRBluetoothHostController : public IOBluetoothHostController +{ + OSDeclareDefaultStructors(CSRBluetoothHostController) + +public: + virtual bool init(IOBluetoothHCIController * family, IOBluetoothHostControllerTransport * transport) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + virtual bool InitializeController(); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual IOReturn SetupController(bool * hardReset) APPLE_KEXT_OVERRIDE; +#else + virtual IOReturn SetupController() APPLE_KEXT_OVERRIDE; +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual IOReturn GetOpCodeAndEventCode(UInt8 * inDataPtr, UInt32 inDataSize, BluetoothHCICommandOpCode * outOpCode, BluetoothHCIEventCode * eventCode, BluetoothHCIEventStatus * outStatus, UInt8 *, BluetoothDeviceAddress * outDeviceAddress, BluetoothConnectionHandle * outConnectionHandle, bool *) APPLE_KEXT_OVERRIDE; +#else + virtual IOReturn GetOpCodeAndEventCode(UInt8 * inDataPtr, BluetoothHCICommandOpCode * outOpCode, BluetoothHCIEventCode * eventCode, BluetoothHCIEventStatus * outStatus, UInt8 *, BluetoothDeviceAddress * outDeviceAddress, BluetoothConnectionHandle * outConnectionHandle) APPLE_KEXT_OVERRIDE; +#endif + virtual void ProcessEventDataWL(UInt8 * inDataPtr, UInt32 inDataSize, UInt32 sequenceNumber) APPLE_KEXT_OVERRIDE; + + virtual IOReturn TransportRadioPowerOff(BluetoothHCICommandOpCode opCode, char * processName, int processID, IOBluetoothHCIRequest * request) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 0); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 1); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 2); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 3); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 4); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 5); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 6); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 7); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 8); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 9); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 10); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 11); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 12); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 13); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 14); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 15); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 16); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 17); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 18); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 19); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 20); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 21); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 22); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostController, 23); +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothACPIMethods.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothACPIMethods.h new file mode 100644 index 0000000..b3e81da --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothACPIMethods.h @@ -0,0 +1,125 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/*! + * @header IOBluetoothACPIMethods.h + * This header contains the definition of the IOBluetoothACPIMethods class. + */ + +#ifndef _IOKIT_IOBLUETOOTHACPIMETHODS_H +#define _IOKIT_IOBLUETOOTHACPIMETHODS_H + +#include +#include + +class IOBluetoothHCIController; +class IOACPIPlatformDevice; + +class IOBluetoothACPIMethods : public IOService +{ + OSDeclareDefaultStructors(IOBluetoothACPIMethods) + + friend class IOBluetoothHCIController; + friend class IOBluetoothHostControllerTransport; + +public: + bool init(IOService * provider); + virtual void free() APPLE_KEXT_OVERRIDE; + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + + /*! @function SetBluetoothFamily + * @abstract Sets the mBluetoothFamily member variable. + * @param controller mBluetoothFamily is set to this IOBluetoothHCIController instance. */ + + virtual void SetBluetoothFamily(IOBluetoothHCIController * controller); + + virtual void CheckSpecialGPIO(); + virtual IOReturn SetBTRS(); + virtual IOReturn SetBTPU(); + virtual IOReturn SetBTPD(); + virtual IOReturn SetBTRB(bool, bool *); + virtual IOReturn SetBTLP(bool); + + /*! @function ResetMethodIsAvailable + * @abstract Determines if the Bluetooth ACPI reset method (BTRS) is available. + * @discussion This function is implemented by returning mResetMethodAvailable. + * @result mResetMethodAvailable is returned. */ + + virtual bool ResetMethodIsAvailable(); + + /*! @function ROMBootMethodIsAvailable + * @abstract Determines if the Bluetooth ACPI ROM boot method (BTRB) is available. + * @discussion This function is implemented by returning mROMBootMethodAvailable. + * @result mROMBootMethodAvailable is returned. */ + + virtual bool ROMBootMethodIsAvailable(); + + /*! @function PowerUpMethodIsAvailable + * @abstract Determines if the Bluetooth ACPI power up method (BTPU) is available. + * @discussion This function is implemented by returning mPowerUpMethodAvailable. + * @result mPowerUpMethodAvailable is returned. */ + + virtual bool PowerUpMethodIsAvailable(); + + /*! @function PowerUpMethodIsAvailable + * @abstract Determines if the Bluetooth ACPI power down method (BTPD) is available. + * @discussion This function is implemented by returning mPowerDownMethodAvailable. + * @result mPowerDownMethodAvailable is returned. */ + + virtual bool PowerDownMethodIsAvailable(); + + /*! @function LowPowerMethodIsAvailable + * @abstract Determines if the Bluetooth ACPI low power method (BTLP) is available. + * @discussion This function is implemented by returning mLowPowerMethodAvailable. + * @result mLowPowerMethodAvailable is returned. */ + + virtual bool LowPowerMethodIsAvailable(); + + virtual UInt32 GetCurrentTime(); + + virtual void ConvertErrorCodeToString(UInt32 errorCode, char * outStringLong, char * outStringShort); + +protected: + IOBluetoothHCIController * mBluetoothFamily; // 136 + IOACPIPlatformDevice * mACPIDevice; // 144 + IOService * mProvider; // 152 + + bool mResetMethodAvailable; // 160 BTRS + bool mROMBootMethodAvailable; // 161 BTRB + bool mPowerUpMethodAvailable; // 162 BTPU + bool mPowerDownMethodAvailable; // 163 BTPD + bool mLowPowerMethodAvailable; // 164 BTLP + os_log_t mInternalOSLogObject; // 168 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothDataQueue.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothDataQueue.h new file mode 100644 index 0000000..4623523 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothDataQueue.h @@ -0,0 +1,82 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOBLUETOOTHDATAQUEUE_H +#define _IOKIT_IOBLUETOOTHDATAQUEUE_H + +#include +#include + +#ifdef enqueue +#undef enqueue +#endif + +/*! + * @class IOBluetoothDataQueue : public IOSharedDataQueue + * @abstract A generic data queue providing utilities specific to the IOBluetoothFamily. + * @discussion The IOBluetoothDataQueue is a subclass of IOSharedDataQueue that provides some functions that would be used by other IOBluetoothFamily classes. It should be used and only used in this + * family. + */ + +class IOBluetoothDataQueue : public IOSharedDataQueue +{ + OSDeclareDefaultStructors(IOBluetoothDataQueue) + +public: + static IOBluetoothDataQueue * withCapacity(UInt32 size); + static IOBluetoothDataQueue * withEntries(UInt32 numEntries, UInt32 entrySize); + static IOBluetoothDataQueue * withBuffer(void * buffer, UInt32 size); + static IOBluetoothDataQueue * withClientBuffer(mach_vm_address_t address, UInt32 length, task_t task); + + virtual void free() APPLE_KEXT_OVERRIDE; + virtual void sendDataAvailableNotification() APPLE_KEXT_OVERRIDE; + virtual void setNotificationPort(mach_port_t port) APPLE_KEXT_OVERRIDE; + virtual bool setQueueSize(UInt32 size, bool isWithBuffer); + virtual bool initWithCapacity(UInt32 size) APPLE_KEXT_OVERRIDE; + virtual bool initWithBuffer(void * buffer, UInt32 size); + virtual bool initWithClientBuffer(mach_vm_address_t address, UInt32 length, task_t task); + virtual bool enqueue(void * data, UInt32 dataSize) APPLE_KEXT_OVERRIDE; + virtual UInt32 numberOfFreeBlocks(UInt64 offset); + virtual UInt32 freeSpaceInQueue(); + virtual void setDataQueueOwnerName(char * name); + +protected: + bool mInitializedWithBuffer; // 40, determines if the data queue should be freed + char mDataQueueOwnerName[0x30]; // 41 + IOMemoryMap * mMemoryMap; // 96 + IOMemoryDescriptor * mMemoryDescriptor; // 104 + bool mInitializedWithClientBuffer; // 112, will setTag(3) in free if it is true, set to true in initWithClientBuffer + UInt32 mNotifyMsgSize; // 116 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHCIController.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHCIController.h new file mode 100644 index 0000000..ce54dde --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHCIController.h @@ -0,0 +1,500 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOBLUETOOTHHCICONTROLLER_H +#define _IOKIT_IOBLUETOOTHHCICONTROLLER_H + +#include +#include +#include +#include + +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +class IOACPIPlatformDevice; +class IOWorkQueue; +class IODisplayWrangler; +class IOBluetoothACPIMethods; +class IOBluetoothPacketLogger; +class IOBluetoothHCIPacketLogUserClient; +class IOBluetoothHostController; +class IOBluetoothHostControllerTransport; +class IOBluetoothHostControllerUSBTransport; +class IOBluetoothHostControllerUARTTransport; + +struct BluetoothHardwareListType +{ + IOBluetoothHostControllerTransport * mBluetoothTransport; // 0 + IOBluetoothHostController * mBluetoothHostController; // 8 + bool mFoundWithTransport; // 16 + bool mCreated; // 17 + bool unknown3; // 18 + UInt8 mHardResetCounter; // 19 + UInt8 unknown4; // 20 + BluetoothHardwareListType * mNextHardware; // 24 + BluetoothHardwareListType * mPreviousHardware; // 32 +}; + +struct HCIEventNotificationListener +{ + task_t owningTask; + mach_port_t port; + void * refCon; + UInt64 unknown; // All set to 1 +}; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15 +struct BluetoothPacketLogData +{ + UInt32 creationTime; + UInt32 packetSize; + UInt8 packetType; +}; +#endif + +IOBLUETOOTH_EXPORT UInt32 IOBluetoothRingBufferRead(UInt32 *, void * outBuffer, UInt32, UInt32); +IOBLUETOOTH_EXPORT UInt32 IOBluetoothRingBufferReadAtOffset(UInt32 *, void *, UInt32, IOByteCount offset, UInt32); +IOBLUETOOTH_EXPORT UInt32 IOBluetoothRingBufferWrite(UInt32 *, void *, UInt32, UInt32); +IOBLUETOOTH_EXPORT UInt32 IOBluetoothRingBufferWriteAtOffset(UInt32 *, void *, UInt32, IOByteCount offset, UInt32); + +extern bool SearchForTransportEventTimeOutOccurred(OSObject * owner, IOTimerEventSource * timer); +extern void FullWakeTimeOutOccurred(OSObject * owner, IOTimerEventSource * timer); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 +extern void RecoveryTimeOutOccurred(OSObject * owner, IOTimerEventSource * timer); +#endif + +class IOBluetoothHCIController : public IOService +{ + OSDeclareDefaultStructors(IOBluetoothHCIController) + + friend class IOBluetoothHostController; + friend class IOBluetoothHostControllerTransport; + friend class IOBluetoothHostControllerUSBTransport; + friend class IOBluetoothHostControllerUARTTransport; + +public: + virtual bool init(OSDictionary * dictionary = NULL) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + static IOReturn stopAction(OSObject * owner, void * arg0, void * arg1, void * arg2, void * arg3); + virtual IOReturn stopWL(IOService * provider); + virtual bool terminate(IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + static IOReturn terminateAction(OSObject * owner, void * arg0, void * arg1, void * arg2, void * arg3); + virtual IOReturn terminateWL(IOOptionBits options = 0); + + virtual IOReturn newUserClient(task_t owningTask, void * securityID, UInt32 type, LIBKERN_RETURNS_RETAINED IOUserClient ** handler) APPLE_KEXT_OVERRIDE; +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15 + virtual IOReturn AddPacketLogUserClient(IOBluetoothHCIPacketLogUserClient * client); +#endif + virtual IOReturn AddCommandUserClient(void * userClient); + virtual void DetachUserClients(); + + virtual IOReturn setProperties(OSObject * properties) APPLE_KEXT_OVERRIDE; + static IOReturn setPropertiesAction(OSObject *, void *, void *, void *, void *); + virtual IOReturn setPropertiesWL(OSObject * properties); + virtual bool ValidProperty(OSSymbol *); + + virtual void terminateServiceNubs(); + virtual bool terminateServiceNubsComplete(); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + static void USBHardResetEntry(OSObject * owner); + static bool PacketLoggerPublishNotificationHandler(void *, void *, IOService *, IONotifier *); + static bool HandlePacketLoggerPublishNotification(void *, IOService *); +#else + static void HardwareResetEntry(OSObject * owner); +#endif + static bool DisplayManagerPublishNotificationHandler(void *, void *, IOService *, IONotifier *); + static bool HandleDisplayManagerPublishNotification(void *, IOService *); + static bool ExternalDisplayTerminateNotificationHandler(void *, void *, IOService *, IONotifier *); + static bool HandleExternalDisplayTerminateNotification(void *, IOService *); + static bool ExternalDisplayPublishNotificationHandler(void *, void *, IOService *, IONotifier *); + static bool HandleExternalDisplayPublishNotification(void *, IOService *); + static bool staticBluetoothTransportGoesAway(void *, void *, IOService *, IONotifier *); + static bool staticBluetoothTransportShowsUp(void *, void *, IOService *, IONotifier *); + + virtual IOReturn AddHCIEventNotification(task_t inOwningTask, mach_port_t inPort, void * refCon); + virtual IOReturn RemoveHCIEventNotification(task_t inOwningTask); + + virtual bool GetNvramPacketLoggerBufferSize(UInt32 *); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + virtual bool NeedToWaitForControllerToShowUp(); +#endif + + virtual IOWorkLoop * getWorkLoop() const APPLE_KEXT_OVERRIDE; + virtual IOCommandGate * getCommandGate() const; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual IOWorkLoop * getUSBHardResetWorkLoop() const; + virtual IOCommandGate * getUSBHardResetCommandGate() const; +#else + virtual bool PacketLogFillBufferedData(IOBluetoothHCIPacketLogUserClient * client); + virtual void PacketLogSetBufferEmptiedFlag(); + virtual void PacketLogClientClosed(IOBluetoothHCIPacketLogUserClient * client); +#endif + virtual void LogPacket(UInt8 packetType, void * packetData, size_t packetSize); +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15 + static IOReturn LogPacketAction(OSObject * owner, void * arg0, void * arg1, void * arg2, void * arg3, void * arg4, void * arg5); + virtual void LogPacketData(UInt8 packetType, void * packetData, size_t packetSize); +#endif + + virtual bool shouldOverrideExistingController(IOBluetoothHCIController *, BluetoothHardwareListType *); + virtual IOReturn SwitchToSelectedHostController(UInt32 locationID); + + static IOReturn ProcessBluetoothTransportGoesAwayAction(IOBluetoothHCIController *, UInt8 *, UInt32); + virtual IOReturn ProcessBluetoothTransportGoesAwayActionWL(IOBluetoothHostControllerTransport *); + static IOReturn ProcessBluetoothTransportShowsUpAction(IOBluetoothHCIController *, UInt8 *, UInt32); + virtual IOReturn ProcessBluetoothTransportShowsUpActionWL(IOBluetoothHostControllerTransport *); + + virtual IOReturn SetBluetoothTransportTerminateState(IOBluetoothHostControllerTransport *, UInt8); + virtual IOReturn GetControllerDeviceAddress(IOBluetoothHostController *, BluetoothDeviceAddress *); + + virtual BluetoothHardwareListType * FindFirstBluetoothHardwareHasTransport(); + virtual BluetoothHardwareListType * FindBluetoothHardware(BluetoothDeviceAddress *); + virtual BluetoothHardwareListType * FindBluetoothHardware(UInt16 vendorID, UInt16 productID, UInt32 locationID); + virtual BluetoothHardwareListType * FindBluetoothHardware(IOBluetoothHostController *); + virtual BluetoothHardwareListType * FindBluetoothHardware(IOBluetoothHostControllerTransport *); + virtual BluetoothHardwareListType * FindBluetoothHardware(BluetoothHardwareListType *); + virtual BluetoothHardwareListType * FindBluetoothHardware(UInt32); + + virtual BluetoothHardwareListType * FindInternalBluetoothController(); + + virtual IOReturn AddBluetoothHardware(BluetoothHardwareListType *); + virtual IOReturn RemoveBluetoothHardware(BluetoothHardwareListType *, bool); + virtual IOReturn SwitchBluetoothHardware(BluetoothHardwareListType *); + virtual void PrintBluetoothHardwareList(bool); + + virtual void SearchForTransportEventTimeOutHandler(); + virtual bool WriteActiveControllerInfoToNVRAM(UInt16 productID, UInt16 vendorID, UInt8 * deviceAddress, UInt32 locationID, UInt16 activeConnections); + virtual bool ReadActiveControllerInfoFromNVRAM(UInt16 * productID, UInt16 * vendorID, UInt8 * deviceAddress, UInt32 * locationID, UInt16 * activeConnections); + virtual IOReturn UpdateNVRAMControllerInfo(); + virtual bool WriteInternalControllerInfoToNVRAM(UInt16, UInt16, UInt8 *, UInt32); + virtual bool ReadInternalControllerInfoFromNVRAM(UInt16 *, UInt16 *, UInt8 *, UInt32 *); + virtual IOReturn CreateBluetoothHostControllerObject(BluetoothHardwareListType *); + virtual IOReturn RemoveBluetoothHostControllerObject(BluetoothHardwareListType *); + virtual IOReturn DisableBluetoothHostControllerObject(BluetoothHardwareListType *); + virtual IOReturn EnableBluetoothHostControllerObject(BluetoothHardwareListType *); + + virtual void WakeUpDisplay(); + virtual void FullWakeTimeOutHandler(); + virtual IOReturn StartFullWakeTimer(); + virtual void CancelFullWakeTimer(); + + virtual bool IsTBFCSupported(); + virtual bool IsAnyDevicesTBFCPageCapable(); + virtual bool SupportDeepIdle(); + virtual bool isSystemPortable(); + virtual void SetIdlePolicy(void *, bool); + virtual bool BluetoothRemoteWakeEnabled(); + virtual bool G3StandbySleepWithFileVaultOn(); + + virtual bool SetActiveControllerInfoToPropertyList(UInt16 productID, UInt16 vendorID, UInt8 * deviceAddress, UInt32 locationID, UInt16 activeConnections); + virtual bool AllControllersFinishedSettingUp(); + virtual IOReturn FamilyCommandSleep(void * event, UInt32 milliseconds, char * calledByFunction, bool panicMachine); + virtual UInt32 GetCurrentTime(); + virtual UInt32 ConvertAddressToUInt32(void *); + virtual bool ActiveControllerOnline(); + virtual bool SpecialWakeReason(); + + virtual bool setProperty(const OSSymbol * aKey, OSObject * anObject) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const OSString * aKey, OSObject * anObject) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char * aKey, OSObject * anObject) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char * aKey, const char * aString) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char * aKey, bool aBoolean) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char * aKey, unsigned long long aValue, unsigned int aNumberOfBits) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char * aKey, void * bytes, unsigned int length) APPLE_KEXT_OVERRIDE; + + virtual bool SetBluetoothFamilyProperty(const OSSymbol * aKey, OSObject * anObject); + virtual bool SetBluetoothFamilyProperty(const OSString * aKey, OSObject * anObject); + virtual bool SetBluetoothFamilyProperty(const char * aKey, OSObject * anObject); + virtual bool SetBluetoothFamilyProperty(const char * aKey, const char * aString); + virtual bool SetBluetoothFamilyProperty(const char * aKey, bool aBoolean); + virtual bool SetBluetoothFamilyProperty(const char * aKey, unsigned long long aValue, unsigned int aNumberOfBits); + virtual bool SetBluetoothFamilyProperty(const char * aKey, void * bytes, unsigned int length); + + virtual bool UpdateActiveControllerProperties(char *); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual UInt32 GetNextBluetoothObjectID(); + virtual IOReturn FreeBluetoothObjectID(UInt32); + virtual void CheckACPIMethodsAvailabilities(); +#else + virtual void CheckSpecialGPIO(); + virtual IOReturn SetBTRS(); + virtual IOReturn SetBTPU(); + virtual IOReturn SetBTPD(); + virtual IOReturn SetBTRB(bool); + virtual IOReturn SetBTLP(bool); +#endif + virtual IOReturn CallRegisterService(); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual bool ReachHardResetLimit(IOBluetoothHostController *); + virtual void IncrementHardResetCounter(IOBluetoothHostController *); + virtual void ResetHardResetCounter(IOBluetoothHostController *); + virtual UInt8 GetHardResetCounter(IOBluetoothHostController *); + + virtual IOReturn USBHardReset(); + static IOReturn USBHardResetAction(OSObject * owner, void * arg0, void * arg1, void * arg2, void * arg3); + virtual void USBHardResetWL(); +#else + virtual IOReturn PerformHardwareReset(); + static IOReturn HardwareResetAction(OSObject * owner, void * arg0, void * arg1, void * arg2, void * arg3); + virtual void HardwareResetWL(); +#endif + virtual void ReleaseAllHardResetObjects(); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual bool FindBroadcomUSBHostDevice(); + virtual bool USBBluetoothModuleWithROMBootCapability(); + virtual IOReturn RecoverX238EModule(BluetoothHardwareListType *); +#else + virtual bool FindBroadcomUSBHostController(); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + virtual void RecoveryTimeOutHandler(); + virtual IOReturn StartRecoveryTimer(); + virtual void CancelRecoveryTimer(); +#endif + + virtual IOReturn DumpStats(); + virtual void BeginSignPost(); + virtual void EndSignPost(); + + virtual void ConvertErrorCodeToString(UInt32 errorCode, char * outStringLong, char * outStringShort); + virtual void ConvertOpCodeToString(UInt16 opCode, char * outString); + virtual void ConvertEventCodeToString(UInt8 eventCode, char * outString); + virtual void ConvertVendorSpecificEventCodeToString(UInt8 eventCode, char * outString); + virtual void ConvertEventStatusToString(UInt8 eventStatus, char * outString); + + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 0); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 1); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 2); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 3); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 4); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 5); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 6); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 7); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 8); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 9); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 10); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 11); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 12); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 13); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 14); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 15); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 16); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 17); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 18); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 19); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 20); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 21); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 22); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 23); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 24); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 25); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 26); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 27); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 28); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 29); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 30); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 31); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 32); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 33); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 34); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 35); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 36); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 37); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 38); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 39); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 40); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 41); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 42); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 43); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 44); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 45); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 46); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 47); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 48); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 49); + OSMetaClassDeclareReservedUnused(IOBluetoothHCIController, 50); + +public: + IOWorkLoop * mWorkLoop; // 136 + IOCommandGate * mCommandGate; // 144 +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + IOWorkLoop * mUSBHardResetWorkLoop; // 152 + IOCommandGate * mUSBHardResetCommandGate; // 160 +#else + OSSet * mPacketLoggerUserClientSet; /// 152 +#endif + OSSet * mCommandUserClientSet; // 168 + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + IOBluetoothPacketLogger * mPacketLogger; // 176 + IONotifier * mPacketLoggerPublishNotifier; // 184 +#else + BluetoothPacketLogData * mPacketLogBuffer; /// 168 + UInt32 mPacketLogBufferSize; /// 176 + OSArray * mLogPackets; /// 184 + UInt32 mMaxNumberOfPreStoredPackets; /// 192 + UInt32 mLogPacketIndex; /// 196 + UInt32 mPacketLogFillDataIndex; /// 200 + bool mNewPacketLogUserClient; /// 204 + bool mPacketLogBufferEmptied; /// 205 +#endif + + IODisplayWrangler * mDisplayManager; // 192 + IONotifier * mDisplayManagerPublishNotifier; // 200 + IONotifier * mExternalDisplayPublishNotifier; // 208 + IONotifier * mExternalDisplayTerminateNotifier; // 216 + + bool mSearchForTransportEventTimerHasTimeout; // 224 + IOTimerEventSource * mSearchForTransportEventTimer; // 232 + bool mFullWakeWithAppleExternalDisplay; // 240 + bool mExternalDisplayPublished; // 241 + + HCIEventNotificationListener * mHCIEventListenersList; // 248 + IOByteCount mHCIEventListenersListSize; // 256 + bool mDebugMode; // 264 + + IOWorkQueue * mFamilyWorkQueue; // 272 + IOWorkQueue * mExternalControllerWorkQueue; // 280 +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15 + IOWorkQueue * mLogPacketWorkQueue; /// 304 +#endif + + BluetoothHardwareListType * mBluetoothHardwareListHead; // 288 + BluetoothHardwareListType * mBluetoothHardwareListTail; // 296 + BluetoothHardwareListType * mActiveBluetoothHardware; // 304 + BluetoothHardwareListType * mActiveControllerBluetoothHardware; // 312 + BluetoothHardwareListType * mActiveTransportBluetoothHardware; // 320 + + IONotifier * mBluetoothTransportShowsUpNotifier; // 328 + IONotifier * mBluetoothTransportGoesAwayNotifier; // 336 + bool mReceivedTransportNotification; // 344 + + UInt16 mActiveControllerProductID; // 346 + UInt16 mActiveControllerVendorID; // 348 + BluetoothDeviceAddress mActiveControllerAddress; // 350 + UInt32 mActiveControllerLocationID; // 356 + UInt16 mActiveControllerActiveConnections; // 360 + bool mActiveControllerValid; // 362 + + UInt16 mInternalControllerProductID; // 364 + UInt16 mInternalControllerVendorID; // 366 + BluetoothDeviceAddress mInternalControllerAddress; // 368 + UInt32 mInternalControllerLocationID; // 376 + bool mInternalControllerValid; // 380 + + bool mControllersFinishedSettingUp; // 381 + bool __reserved; // 382, never used + bool mSwitchingHostController; // 383 + bool mNVRAMControllerInfoUpdated; // 384 + UInt32 mCheckACPIMethodsAvailabilitiesCallTime; // 388 + bool mUserClientsAttached; // 392 + IOOptionBits mTransportPowerStateOptions; // 396 + UInt16 mNumCommandSleepsInWorkLoop; // 400, +1 when commandSleep is called in FamilyCommandSleep and -1 when it's done + + UInt32 mActivityTickleCallTime; // 404 + IOTimerEventSource * mFullWakeTimer; // 408 + bool mFullWakeTimerHasTimeout; // 416 + bool mFullWakeTimerStarted; // 417 + bool mSignPostSupported; // 418 + bool mSignPostStarted; // 419 + + os_log_t mInternalOSLogObject; // 424 + bool mCanPowerOn; // 432 + +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_14 + IOACPIPlatformDevice * mACPIDevice; /// 464 + bool SupportBTRS; /// 472 + bool SupportBTRB; /// 473 + bool mSupportBTPU; /// 474 + bool mSupportBTPD; /// 475 + bool mSupportBTLP; /// 476 +#endif + + bool mBootFromROM; // 433 + bool mBTGPIOResult; // 434, BTRB result + bool mRegisterServiceCalled; // 435 + + thread_call_t mHardResetThreadCall; // 440 + UInt32 mUSBHardResetWLCallTime; // 448 + + bool mTestNotRespondingHardReset; // 452 + bool mTestHCICommandTimeoutHardReset; // 453 +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + bool unknown1; // 454, see DispatchHardwareResetTest + bool mTestNoHardResetWhenSleepCommandTimeout; // 455 + bool mTestHCICommandTimeoutWhenWake; // 456 + bool unknown2; // 457 +#endif + UInt8 mNumHardResetRetries; // 458 + IOBluetoothHostControllerUSBTransport * mHardResetUSBTransport; // 464 + IOUSBHostDevice * mHardResetUSBHostDevice; // 472 + IOUSBHostDevice * mHardResetUSBHub; // 480 + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + IOBluetoothACPIMethods * mACPIMethods; // 488 +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + IOTimerEventSource * mRecoveryTimer; // 496 + bool mRecoveryTimerHasTimeout; // 504 +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + UInt16 mCurrentBluetoothObjectID; // 506 + bool mBluetoothObjects[0xFFFF]; // 508 + IOLock * mBluetoothObjectsLock; // 66048 + UInt8 mNumHCIEventListeners; // 66056 +#endif +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + bool mNotTriedToRecoverX238EModule; // 66057 +#endif + + struct ExpansionData + { + void * mUnusedPointer1; + void * mUnusedPointer2; + }; + ExpansionData * mExpansionData; // 66064 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHCIRequest.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHCIRequest.h new file mode 100644 index 0000000..d391141 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHCIRequest.h @@ -0,0 +1,176 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __IOKIT_IOBLUETOOTHHCIREQUEST_H +#define __IOKIT_IOBLUETOOTHHCIREQUEST_H + +#include +#include +#include +#include +#import + +// Forward declaration to avoid the need to include IOBluetoothHCIUserLibShared.h +typedef struct BluetoothHCINotificationMessage BluetoothHCINotificationMessage; + +enum +{ + kMaxHCIBufferLength = 512 +}; + +typedef UInt8 BluetoothHCIRequestState; + +/*! @enum BluetoothHCIRequestStates + @abstract States of Bluetooth HCI Requests + @constant kHCIRequestStateIdle Doing nothing - neither waiting nor busy. usually waiting for deletion. + @constant kHCIRequestStateWaiting On the wait queue - request has not been processed in any way. + @constant kHCIRequestStateBusy On the busy queue - request is sent and is currently processing +*/ + +enum BluetoothHCIRequestStates +{ + kHCIRequestStateIdle = 0, + kHCIRequestStateWaiting = 1, + kHCIRequestStateBusy = 2, + kHCIRequestStateEnd +}; + +IOBLUETOOTH_EXPORT IOReturn ParseHCIEvent(UInt8 * inData, UInt32 inDataSize, UInt8 * outData, UInt32 * outDataSize, UInt8 * outStatus); +IOBLUETOOTH_EXPORT IOReturn DecodeHCICommandResult(UInt16 opCode, UInt8 * inData, UInt32 inDataSize, UInt8 * outData, UInt32 * outDataSize, UInt8 * outStatus); +IOBLUETOOTH_EXPORT IOReturn ParseLinkControlGroupCommand(UInt16 ocf, UInt8 * inData, UInt32 inDataSize, UInt8 * outData, UInt32 * outDataSize, UInt8 * outStatus); +IOBLUETOOTH_EXPORT IOReturn ParseLinkPolicyGroupCommand(UInt16 ocf, UInt8 * inData, UInt32 inDataSize, UInt8 * outData, UInt32 * outDataSize, UInt8 * outStatus); +IOBLUETOOTH_EXPORT IOReturn ParseHostControllerGroupCommand(UInt16 ocf, UInt8 * inData, UInt32 inDataSize, UInt8 * outData, UInt32 * outDataSize, UInt8 * outStatus); +IOBLUETOOTH_EXPORT IOReturn ParseInformationalGroupCommand(UInt16 ocf, UInt8 * inData, UInt32 inDataSize, UInt8 * outData, UInt32 * outDataSize, UInt8 * outStatus); +IOBLUETOOTH_EXPORT IOReturn ParseStatusGroupCommand(UInt16 ocf, UInt8 * inData, UInt32 inDataSize, UInt8 * outData, UInt32 * outDataSize, UInt8 * outStatus); +IOBLUETOOTH_EXPORT IOReturn ParseTestingGroupCommand(UInt16 ocf, UInt8 * inData, UInt32 inDataSize, UInt8 * outData, UInt32 * outDataSize, UInt8 * outStatus); +IOBLUETOOTH_EXPORT IOReturn ParseVendorSpecificCommand(UInt16 ocf, UInt8 * inData, UInt32 inDataSize, UInt8 * outData, UInt32 * outDataSize, UInt8 * outStatus); + +class IOBluetoothHCIRequest : public OSObject +{ + OSDeclareDefaultStructors(IOBluetoothHCIRequest) + +public: + static IOBluetoothHCIRequest * Create(IOCommandGate * commandGate, IOBluetoothHostController * hostController, bool async = true, UInt32 timeout = 5, UInt32 controlFlags = 0); + static IOReturn Dispose(IOBluetoothHCIRequest * inObject); + IOReturn DisposeRequest(); + + bool init(IOCommandGate * commandGate, IOBluetoothHostController * hostController); + void InitializeRequest(); + virtual void free() APPLE_KEXT_OVERRIDE; + virtual void retain() const APPLE_KEXT_OVERRIDE; + void RetainRequest(char * name); + virtual void release() const APPLE_KEXT_OVERRIDE; + void ReleaseRequest(char * name); + + const char * RequestDescription(const char * name); + + IOReturn Start(); // Called when a request is started on a transport + void Complete(); // Called when a request is completed on a transport + + void SetState(BluetoothHCIRequestState inState); + + void SetCallbackInfo(BluetoothHCIRequestCallbackInfo * inInfo); + void SetCallbackInfoToZero(); + + void SetResultsDataSize(IOByteCount inCount); + void SetResultsBufferPtrAndSize(UInt8 * resultsBuffer, IOByteCount inSize); + void CopyDataIntoResultsPtr(UInt8 * inDataPtr, IOByteCount inSize); + UInt8 * GetResultsBuffer(); + IOByteCount GetResultsBufferSize(); + + BluetoothHCICommandOpCode GetCommandOpCode(); + + void StartTimer(); + + static void timerFired(OSObject * owner, IOTimerEventSource * sender); + void handleTimeout(); + + UInt32 GetCurrentTime(); + void SetStartTimeForDelete(); + + bool CompareDeviceAddress(const BluetoothDeviceAddress * inDeviceAddress); + +protected: + UInt8 mPrivateResultsBuffer[kMaxHCIBufferLength * 4]; // Just in case they didn't give a results ptr. 12 + IOByteCount mPrivateResultsSize; // Result size. 2064 + BluetoothHCITransportID mTransportID; // Transport ID to use for this request. 2072 + +public: + BluetoothHCIRequestState mState; // Busy, waiting, idle. 2076 + bool mAsyncNotify; // 2077 + task_t mOwningTaskID; // 2080 + BluetoothHCIRequestCallbackInfo mCallbackInfo; // When this request is complete, call this. 2088 + BluetoothHCICommandOpCode mOpCode; // 2128 + BluetoothDeviceAddress mDeviceAddress; // 2130 + BluetoothConnectionHandle mConnectionHandle; // 2136 + BluetoothHCINotificationMessage * mNotificationMessage; // 2144 + IOByteCount mNotificationMessageSize; // 2152 + + IOBluetoothHCIRequest * mNextBusy; // Points to next request element on busy queue. 2160 + IOBluetoothHCIRequest * mNextWait; // Points to next request element on wait queue. 2168 + IOBluetoothHCIRequest * mNextAllocated; // Points to next allocated request element. 2176 + IOBluetoothHCIRequest * mPreviousAllocated; // Points to next allocated request element. 2184 + BluetoothHCIRequestID mID; // For internal identification. 2192 + UInt8 mCommandBuffer[kMaxHCIBufferLength]; // Built-up HCI Command to send to the transport. 2196 + IOByteCount mCommandBufferSize; // Size of command buffer. 2712 + + UInt8 * mResultsPtr; // Result ptr, provided by object creator. 2720 + IOByteCount mResultsSize; // Result size. 2728 + + IOCommandGate * mCommandGate; // 2736 + IOTimerEventSource * mTimer; // 2744 + IOBluetoothHostController * mHostController; // 2752 + + IOReturn mStatus; // Success/failure code of request. 2760 + UInt32 mTimeout; // Timeout for request to complete, in milliseconds. 2764 + UInt32 mOriginalTimeout; // 2768 + UInt32 mControlFlags; // 2772 + int mPID; // Creating Task 2776 + bool mHCIRequestDeleteWasCalled; // Fixed rdar://problem/7044168 2780 + UInt32 mStartTimeForDelete; // 2784 + + // Require and Receive Events + + bool unknown; // 2788 + UInt32 mExpectedEvent; // 2792 + UInt8 mNumberOfExpectedExplicitCompleteEvents; // 2796 + UInt32 mExpectedExplicitCompleteEvents[5]; // 2800 + + UInt32 mReceivedEvent; // 2820 + UInt8 mExplictCompleteEvent; // 2824 + UInt32 mNumberOfPossibleIntermediateEvents; // 2828 + UInt32 mPossibleIntermediateEvents[5]; // 2832 + UInt32 mReceivedIntermediateEvents[5]; // 2852 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHIDDriver.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHIDDriver.h new file mode 100644 index 0000000..b27f7fa --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHIDDriver.h @@ -0,0 +1,296 @@ +/* + * Copyright (c) 2021 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/*! + * @header IOBluetoothHIDDriver.h + * This header contains the definition of the IOBluetoothHIDDriver class, which is the driver for generic Bluetooth HID devices. It is a direct subclass of IOHIDDevice. + */ + +#ifndef _IOKIT_IOBLUETOOTHHIDDRIVER_H +#define _IOKIT_IOBLUETOOTHHIDDRIVER_H + +#import +#import + +#import + +#define kBSKernelMonitor2Notification 'bsk2' + +class IOTimerEventSource; +class IOWorkLoop; + +class IOBluetoothL2CAPChannel; +class IOBluetoothDevice; +class IOWorkQueue; + +class IOBluetoothHIDDriver : public IOHIDDevice +{ + OSDeclareDefaultStructors(IOBluetoothHIDDriver) + +protected: + IOWorkLoop * _workLoop; + IOCommandGate * _commandGate; + + IOWorkQueue * _desyncWorkQueue; + + IOBluetoothL2CAPChannel * _controlChannel; + IOBluetoothL2CAPChannel * _interruptChannel; + + IOBluetoothDevice * _device; + + IOMemoryDescriptor * _memDescriptor; + IOMemoryDescriptor * _getReportDescriptor; + IONotifier * _interruptOpenNotification; + IOTimerEventSource * _timer; + IONotifier * _sleepWakeNotifier; + + bool _deviceReady; + + UInt8 _expectedReportID; + UInt8 _expectedReportType; + UInt8 _handshake; + + OSDictionary * _deviceProperties; + + UInt16 _vendorIDSource; + UInt16 _vendorID; + UInt16 _productID; + UInt16 _deviceVersion; + uint32_t _classOfDevice; + UInt16 _countryCode; + + BluetoothDeviceAddress _deviceAddress; + char _deviceAddressString[20]; + + uint32_t _outstandingIO; + bool _sendOutstanding; + + // Debug / Behavior Modifiers + UInt8 _verboseLevel; + bool _logPackets; + bool _decodePackets; + bool _logOutstandingIO; + bool _suppressDisconnectNotifications; + bool _suppressSetProtocol; + bool _driverIsAwake; + bool _reservedFlag4; + UInt8 _reservedByte; + + struct ExpansionData + { + OSArray * _sendQueue; + + uint8_t * interruptBuffer; + uint32_t interruptBufferUsed; + + uint8_t * controlBuffer; + uint32_t controlBufferUsed; + + uint8_t deviceSupportsSuspend; + + uint32_t getReportTimeoutMS; + uint32_t setReportTimeoutMS; + + uint32_t outstandingMemoryBlockCount; + bool waitingForMemoryBlockCount; + + IOPMrootDomain * fRootDomain; + IOPMDriverAssertionID fNoDeepSleepAssertionId; + + bool mCommandGateCreated; + bool mCommandGateAdded; + bool mControlChannelRetained; + bool mWorkLoopRetained; + + bool mCloseDownServicesCalled; + + bool mGotNoDeepSleepAssertionID; + + OSString * disconnectionNotificationString; + OSString * connectionNotificationString; + + IOTimerEventSource * deviceConnectTimer; + + bool mNeedToDropData; + + UInt32 mWakeTime; + + UInt32 mDriverLoadTime; + + IOTimerEventSource * mReadyToSleepTimer; + + bool mHandleStopBeingCalled; + + bool mHandleStartCompleted; + + bool mHIDSuspendSent; + + IOReturn mExitHIDSuspendResult; + }; + ExpansionData * _expansionData; + +public: + // Standard IOService Methods + virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE; + virtual bool init(OSDictionary * properties) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + virtual bool willTerminate(IOService * provider, IOOptionBits options) APPLE_KEXT_OVERRIDE; + + // Starting & Stopping + virtual bool handleStart(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void handleStop(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void deviceReady(); + virtual void closeDownServices(); + + // Power Management + virtual void handleSleep(); + virtual void handleWake(); + virtual void handleShutdown(); // Does nothing + virtual void handleRestart(); // Does nothing + + // HID Properties + virtual OSString * newTransportString() const APPLE_KEXT_OVERRIDE; + virtual OSString * newManufacturerString() const APPLE_KEXT_OVERRIDE; + virtual OSString * newProductString() const APPLE_KEXT_OVERRIDE; + virtual OSNumber * newVendorIDSourceNumber() const APPLE_KEXT_OVERRIDE; + virtual OSNumber * newVendorIDNumber() const APPLE_KEXT_OVERRIDE; + virtual OSNumber * newProductIDNumber() const APPLE_KEXT_OVERRIDE; + virtual OSNumber * newVersionNumber() const APPLE_KEXT_OVERRIDE; + virtual IOReturn newReportDescriptor(IOMemoryDescriptor ** descriptor) const APPLE_KEXT_OVERRIDE; + virtual OSString * newSerialNumberString() const APPLE_KEXT_OVERRIDE; + virtual OSNumber * newLocationIDNumber() const APPLE_KEXT_OVERRIDE; + virtual OSNumber * newCountryCodeNumber() const APPLE_KEXT_OVERRIDE; + virtual OSNumber * newReportIntervalNumber() const APPLE_KEXT_OVERRIDE; + + // Main UserLand Entry Points + virtual IOReturn getReport(IOMemoryDescriptor * report, IOHIDReportType reportType, IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + virtual IOReturn setReport(IOMemoryDescriptor * report, IOHIDReportType reportType, IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + virtual IOReturn setProperties(OSObject * properties) APPLE_KEXT_OVERRIDE; + + // General IO + virtual IOReturn sendData(IOBluetoothL2CAPChannel * theChannel, void * theData, IOByteCount theSize); + virtual void processControlData(UInt8 * buffer, UInt16 length); + virtual void processInterruptData(UInt8 * buffer, UInt16 length); + virtual IOReturn waitForData(IOMemoryDescriptor * report, UInt8 btReportType, UInt8 reportID); + virtual IOReturn waitForHandshake(); + + // HID Transaction Methods + virtual IOReturn hidControl(UInt8 controlOperation); + virtual int getProtocol(); + virtual IOReturn setProtocol(UInt8 protocol); + virtual int getIdle(); + virtual IOReturn setIdle(UInt8 idleRate); + + // Device Introspection + virtual bool isKeyboard(); + virtual bool isMouse(); + + // Misc + virtual IOReturn setPowerState(unsigned long powerStateOrdinal, IOService * whatDevice) APPLE_KEXT_OVERRIDE; + virtual IOReturn createCommandGate(IOService * provider); + virtual IOReturn getDeviceProperties(IOService * provider); + virtual bool readDeviceName(); + + // Command Gate Actions + static IOReturn staticCloseDownServicesAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + static IOReturn staticSendToAction(OSObject * owner, void * theChannel, void * theData, void * theSize, void *); + static IOReturn staticPrepControlChannelAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + static IOReturn staticInterruptChannelOpeningAction(OSObject * owner, void * newService, void * arg2, void * arg3, void * arg4); + static IOReturn staticWillTerminateAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + + // Work Loop Methods + virtual void closeDownServicesWL(); + virtual IOReturn prepInterruptChannelWL(); + virtual IOReturn getReportWL(IOMemoryDescriptor * report, IOHIDReportType reportType, IOOptionBits options); + virtual IOReturn setReportWL(IOMemoryDescriptor * report, IOHIDReportType reportType, IOOptionBits options); + virtual IOReturn processCommandWL(OSString * command, OSNumber * commandParameter); + virtual IOReturn getDevicePropertiesWL(IOService * provider); + virtual IOReturn interruptChannelOpeningWL(IOBluetoothL2CAPChannel * theChannel); + + // Timeout Handler + static void deviceConnectTimerFired(OSObject * owner, IOTimerEventSource * sender); + static void timerFired(OSObject * owner, IOTimerEventSource * sender); + virtual void handleTimeout(); + + // IO Counting + virtual void incrementOutstandingIO(); + virtual void decrementOutstandingIO(); + + // ReadyToSleepTimeout Handler + static void ReadyToSleepTimerFired(OSObject * owner, IOTimerEventSource * sender); + +private: + // Lazy Interrupt Channel Methods + static bool interruptChannelOpeningCallback(void * me, void * ignoreMe, IOService * newService, IONotifier * notifier); + static IOReturn powerStateHandler(void * target, void * refCon, UInt32 messageType, IOService * service, void * messageArgument, vm_size_t argSize); + +public: + OSMetaClassDeclareReservedUsed(IOBluetoothHIDDriver, 0); + virtual void sendDeviceDisconnectNotifications(); + + OSMetaClassDeclareReservedUsed(IOBluetoothHIDDriver, 1); + virtual IOReturn setPowerStateWL(unsigned long powerStateOrdinal, IOService * whatDevice); + + OSMetaClassDeclareReservedUsed(IOBluetoothHIDDriver, 2); + virtual void sendDeviceConnectNotifications(); + + OSMetaClassDeclareReservedUsed(IOBluetoothHIDDriver, 3); + virtual void decrementOutstandingMemoryBlockCount(); + + OSMetaClassDeclareReservedUsed(IOBluetoothHIDDriver, 4); + virtual IOReturn willTerminateWL(); + + OSMetaClassDeclareReservedUsed(IOBluetoothHIDDriver, 5); + virtual void messageClientsWithString(UInt32 type, OSString * message); + + OSMetaClassDeclareReservedUsed(IOBluetoothHIDDriver, 6); + virtual void waitForInterruptChannel(); + + OSMetaClassDeclareReservedUsed(IOBluetoothHIDDriver, 7); + virtual void handleStopWL(IOService * provider); + + OSMetaClassDeclareReservedUsed(IOBluetoothHIDDriver, 8); + virtual UInt32 GetCurrentTime(); + + OSMetaClassDeclareReservedUsed(IOBluetoothHIDDriver, 9); + virtual void handleReadyToSleepTimerFired(); + + OSMetaClassDeclareReservedUsed(IOBluetoothHIDDriver, 10); + virtual IOReturn HIDCommandSleep(void * event, UInt32 milliseconds, char * calledByFunction, bool panicMachine); + + OSMetaClassDeclareReservedUnused(IOBluetoothHIDDriver, 11); + OSMetaClassDeclareReservedUnused(IOBluetoothHIDDriver, 12); + OSMetaClassDeclareReservedUnused(IOBluetoothHIDDriver, 13); + OSMetaClassDeclareReservedUnused(IOBluetoothHIDDriver, 14); + OSMetaClassDeclareReservedUnused(IOBluetoothHIDDriver, 15); + OSMetaClassDeclareReservedUnused(IOBluetoothHIDDriver, 16); + OSMetaClassDeclareReservedUnused(IOBluetoothHIDDriver, 17); + OSMetaClassDeclareReservedUnused(IOBluetoothHIDDriver, 18); + OSMetaClassDeclareReservedUnused(IOBluetoothHIDDriver, 19); +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHIDDriverTypes.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHIDDriverTypes.h new file mode 100644 index 0000000..43f5f48 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHIDDriverTypes.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2021 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/*! + * @header IOBluetoothHIDDriverTypes.h + * This header contains enumerations for IOBluetoothHIDDriver. + */ + +#pragma once + +// Vendor ID Sources +enum +{ + kVendorIDSourceBluetoothSIG = 0x1, + kVendorIDSourceUSBIF = 0x2 +}; + +// Bluetooth HID Transaction Headers +enum +{ + kBluetoothHIDTransactionHandshakeHeader = 0x00, + kBluetoothHIDTransactionHIDControlHeader = 0x10, + kBluetoothHIDTransactionGetReportHeader = 0x40, + kBluetoothHIDTransactionSetReportHeader = 0x50, + kBluetoothHIDTransactionGetProtocolHeader = 0x60, + kBluetoothHIDTransactionSetProtocolHeader = 0x70, + kBluetoothHIDTransactionGetIdleHeader = 0x80, + kBluetoothHIDTransactionSetIdleHeader = 0x90, + kBluetoothHIDTransactionDataHeader = 0xA0, + kBluetoothHIDTransactionDatcHeader = 0xB0 +}; + +// Handshake Types +enum +{ + kBluetoothHandshakeTypeSuccessful = 0x0, + kBluetoothHandshakeTypeNotReady = 0x1, + kBluetoothHandshakeTypeInvalidReportID = 0x2, + kBluetoothHandshakeTypeUnsupportedRequest = 0x3, + kBluetoothHandshakeTypeInvalidParameter = 0x4, + kBluetoothHandshakeTypeErrorUnknown = 0xD, + kBluetoothHandshakeTypeErrorFatal = 0xF +}; + +// HID Control Types +enum +{ + kBluetoothHIDControlTypeNoOperation = 0x0, + kBluetoothHIDControlTypeHardReset = 0x1, + kBluetoothHIDControlTypeSoftRest = 0x2, + kBluetoothHIDControlTypeSuspend = 0x3, + kBluetoothHIDControlTypeExitSuspend = 0x4, + kBluetoothHIDControlTypeVCUnplug = 0x5 +}; + +// Report Types +enum +{ + kBluetoothReportTypeReserved = 0x0, + kBluetoothReportTypeOther = 0x0, + kBluetoothReportTypeInput = 0x1, + kBluetoothReportTypeOutput = 0x2, + kBluetoothReportTypeFeature = 0x3 +}; + +// Protocol Types +enum +{ + kBluetoothProtocolTypeBoot = 0x0, + kBluetoothProtocolTypeReport = 0x1 +}; diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHostController.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHostController.h new file mode 100644 index 0000000..ee94d0a --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothHostController.h @@ -0,0 +1,1089 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOBLUETOOTHHOSTCONTROLLER_H +#define _IOKIT_IOBLUETOOTHHOSTCONTROLLER_H + +#include +#include +#include +#include +#include + +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +class IOBluetoothHostControllerUserClient; +class IOBluetoothHostControllerTransport; +class IOBluetoothHCIController; +class IOBluetoothHCIRequest; +class IOWorkQueue; +class IOReportLegend; +class IOStateReporter; +class IOSimpleReporter; +class IOBluetoothDevice; +class IOBluetoothInactivityTimerEventSource; +class IOBluetoothACLMemoryDescriptor; +class IOBluetoothSCOMemoryDescriptorRetainer; + +struct BluetoothDeviceReporter; +struct BluetoothBroadcomBFCReconnectData; +struct BluetoothBroadcomBFCParams; +struct BluetoothBroadcomBFCRemoteBPCSFeatures; +struct BluetoothBroadcomLocalFirmwareInfo; +struct BluetoothBroadcomSetEventMask; +struct BluetoothBroadcomBFCConnectionTBFCSuspendedInfo; +struct BluetoothBroadcomVerboseConfigVersionInfo; + +enum +{ + kRadioPowerInitialState = 0, + kRadioPoweringOff = 1, + kRadioPoweringOn = 2, + kRadioPoweredOff = 3, + kRadioPoweredOn = 4, + kRadioPowerError = 5 +}; + +typedef uint16_t DevicePublishNotificationStateType; +enum DevicePublishNotificationStateTypes +{ + kHasNotRegisteredForDevicePublishNotification = 0x0001, + kHasRegisteredForDevicePublishNotification = 0x0002, + kDevicePublishNotificationCalled = 0x0004, + kDevicePublishNotificationProcessed = 0x0008 +}; + +typedef UInt32 HCIDataHandlerType; +enum HCIDataHandlerTypes +{ + kTransportDataTypeHCIEvents, + kTransportDataTypeACL, + kTransportDataTypeSCO +}; + +typedef struct HearingDeviceListType +{ + BluetoothDeviceAddress mDeviceAddress; + bool mRemoveDeviceCalled; + DevicePublishNotificationStateType mDevicePublishNotificationState; + HearingDeviceListType * mNextDevice; + HearingDeviceListType * mPreviousDevice; +} HearingDeviceListType; + +typedef struct LEDeviceListType +{ + BluetoothConnectionHandle mConnectionHandle; + bool unknown; + LEDeviceListType * mNextDevice; + LEDeviceListType * mPreviousDevice; +} BluetoothLEDevice; + +struct BluetoothHCIACLPacket +{ + IOMemoryDescriptor * descriptor; + IOBluetoothDevice * device; + BluetoothHCIACLPacket * nextPacket; +}; + +IOBLUETOOTH_EXPORT long PackData( void * inBuffer, UInt32 inDataSize, const char * inFormat, ... ); +IOBLUETOOTH_EXPORT long PackDataList( void * inBuffer, UInt32 inDataSize, const char * inFormat, va_list inArgs ); +IOBLUETOOTH_EXPORT long UnpackData( IOByteCount inBufferSize, const void * inBuffer, const char * inFormat, ... ); +IOBLUETOOTH_EXPORT long UnpackDataList( IOByteCount inBufferSize, const void * inBuffer, const char * inFormat, va_list inArgs ); + +class IOBluetoothHostController : public IOService +{ + OSDeclareDefaultStructors(IOBluetoothHostController) + + typedef IOReturn (*IOBluetoothIncomingDataAction)(IOBluetoothHostController * hostController, UInt8 * inDataPtr, UInt32 inDataSize, UInt32 inSequenceNumber); + + friend class IOBluetoothHCIRequest; + friend class IOBluetoothHCIController; + friend class IOBluetoothHostControllerTransport; + friend class IOBluetoothHostControllerUSBTransport; + friend class IOBluetoothHostControllerUARTTransport; + +public: + virtual IOReturn newUserClient(task_t owningTask, void * securityID, UInt32 type, IOUserClient ** handler) APPLE_KEXT_OVERRIDE; + virtual IOReturn AddUserClient(void *); + virtual void DetachUserClients(); + + virtual bool InitializeVariables(IOBluetoothHostControllerTransport * transport); + virtual bool init(IOBluetoothHCIController * family, IOBluetoothHostControllerTransport * transport); + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual bool SetVariables(); + virtual void Enable(IOBluetoothHostControllerTransport * transport); + virtual void Disable(); + virtual void StopAndFreeVariables(); + + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + static IOReturn stopAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + virtual IOReturn stopWL(IOService * provider); + + virtual bool terminate(IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + static IOReturn terminateAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + virtual IOReturn terminateWL(IOOptionBits options = 0); + + virtual IOReturn setProperties(OSObject * properties) APPLE_KEXT_OVERRIDE; + static IOReturn setPropertiesAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + virtual IOReturn setPropertiesWL(OSObject * properties); + + virtual bool setProperty(const OSSymbol * aKey, OSObject * anObject) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const OSString * aKey, OSObject * anObject) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char * aKey, OSObject * anObject) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char * aKey, const char * aString) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char * aKey, bool aBoolean) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char * aKey, unsigned long long aValue, unsigned int aNumberOfBits) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char * aKey, void * bytes, unsigned int length) APPLE_KEXT_OVERRIDE; + + virtual bool SetBluetoothControllerProperty(const OSSymbol * aKey, OSObject * anObject); + virtual bool SetBluetoothControllerProperty(const OSString * aKey, OSObject * anObject); + virtual bool SetBluetoothControllerProperty(const char * aKey, OSObject * anObject); + virtual bool SetBluetoothControllerProperty(const char * aKey, const char * aString); + virtual bool SetBluetoothControllerProperty(const char * aKey, bool aBoolean); + virtual bool SetBluetoothControllerProperty(const char * aKey, unsigned long long aValue, unsigned int aNumberOfBits); + virtual bool SetBluetoothControllerProperty(const char * aKey, void * bytes, unsigned int length); + + virtual IOWorkLoop * getWorkLoop() const APPLE_KEXT_OVERRIDE; + virtual IOCommandGate * getCommandGate() const; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual void BroadcastEventNotification(BluetoothHCIRequestID inID, BluetoothHCIEventCode inEventCode, IOReturn eventStatus, UInt8 * inDataToSendPtr, IOByteCount inDataSize, BluetoothHCICommandOpCode inOpCode, bool, UInt8); + virtual void BroadcastNotification(UInt32 type, IOBluetoothHCIControllerConfigState oldState, IOBluetoothHCIControllerConfigState newState); +#else + virtual void BroadcastEventNotification(BluetoothHCIRequestID inID, BluetoothHCIEventCode inEventCode, IOReturn eventStatus, UInt8 * inDataToSendPtr, IOByteCount inDataSize, BluetoothHCICommandOpCode inOpCode); + virtual void BroadcastConfigStateChangeNotification(IOBluetoothHCIControllerConfigState oldState, IOBluetoothHCIControllerConfigState newState); + virtual void BroadcastWoBTReconnectionNotification(); + virtual void BroadcastCommandTimeoutNotification(); + virtual void BroadcastUSBPipeStallNotification(); +#endif + + virtual void WaitForBluetoothd(); + virtual void FoundBluetoothd(); + + virtual IOBluetoothHCIControllerFeatureFlags GetControllerFeatureFlags(); + virtual bool SetControllerFeatureFlags(IOBluetoothHCIControllerFeatureFlags featureFlags); + virtual void setConfigState(IOBluetoothHCIControllerConfigState configState); + + virtual bool InitializeController(); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual IOReturn SetupController(bool *); +#else + virtual IOReturn SetupController(); +#endif +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15 + virtual IOReturn CallSetupController(); +#endif + virtual IOReturn SetupGeneralController(); + virtual IOReturn SetupCommonHardware(); + virtual bool ControllerSetupIsComplete(); + virtual void ControllerSetupComplete(int); + virtual void BluetoothHostControllerSetupCompleted(); + virtual bool InitializeHostControllerVariables(bool); + virtual IOReturn CallInitializeHostControllerVariables(); + virtual void CompleteInitializeHostControllerVariables(); + + virtual IOReturn configureReport(IOReportChannelList * channels, IOReportConfigureAction action, void * result, void * destination) APPLE_KEXT_OVERRIDE; + virtual IOReturn updateReport(IOReportChannelList * channels, IOReportConfigureAction action, void * result, void * destination) APPLE_KEXT_OVERRIDE; + + virtual bool CreatePowerReporters(); + virtual IOReturn UpdatePowerReports(IOBluetoothHCIControllerInternalPowerState powerState); + virtual IOReturn CallCreateDeviceReporter(IOBluetoothDevice * device); + static IOReturn CreateDeviceReporterAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4, void * arg5, void * arg6); + virtual IOReturn CreateDeviceReporter(IOBluetoothDevice * device); + virtual BluetoothDeviceReporter * FindDeviceReporter(const BluetoothDeviceAddress * address); + virtual IOReturn ConvertClassOfDeviceToDeviceType(UInt32, bool, UInt16 *, char *, UInt64 *, char *, UInt8 *); + virtual IOReturn AddDeviceReporter(BluetoothDeviceReporter * reporter); + virtual IOReturn RemoveDeviceReporter(IOBluetoothDevice * device); + virtual IOReturn UpdateDeviceReporter(IOBluetoothDevice * device, bool); + virtual IOReturn GetDeviceCounterForName(UInt16, char *, char *, UInt8 *); + virtual void PrintDeviceReporterList(); + virtual void UpdateLESetAdvertisingDataReporter(IOBluetoothHCIRequest * request); + virtual IOReturn SetupPowerStateReporter(); + + virtual void DesyncIncomingData(IOBluetoothIncomingDataAction action, UInt8 * inDataPtr, UInt32 inDataSize); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + static void DesyncIncomingDataAction(IOBluetoothHostController * hostController, void * action, void * inDataPtr, UInt32 inDataSize, UInt32 sequenceNumber); +#else + static void DesyncIncomingDataAction(IOBluetoothHostController * hostController, IOBluetoothIncomingDataAction action, void * inDataPtr, UInt32 inDataSize, UInt32 sequenceNumber); +#endif + virtual void SynchronizePacketSequence(UInt32 sequenceNumber); + virtual void SynchronizeSCOPacketSequence(UInt32 sequenceNumber); + + virtual IOBluetoothDevice * FindDeviceWithHandle(BluetoothConnectionHandle inConnectionHandle); + virtual IOBluetoothDevice * FindDeviceWithSCOHandle(BluetoothConnectionHandle inConnectionHandle); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual IOBluetoothDevice * FindDeviceWithAddress(const BluetoothDeviceAddress * inDeviceAddress, bool all); +#else + virtual IOBluetoothDevice * FindDeviceWithAddress(const BluetoothDeviceAddress * inDeviceAddress); +#endif + + virtual HearingDeviceListType * FindHearingDeviceWithAddress(const BluetoothDeviceAddress * inDeviceAddress); + virtual IOReturn AddHearingDevice(IOBluetoothDevice * inDevice); + virtual IOReturn RemoveHearingDevice(IOBluetoothDevice * inDevice, bool all); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual LEDeviceListType * FindLEDeviceWithConnectionHandle(BluetoothConnectionHandle inConnectionHandle); + virtual IOReturn AddLEDevice(BluetoothConnectionHandle inConnectionHandle); + virtual IOReturn RemoveLEDevice(BluetoothConnectionHandle inConnectionHandle, bool all); +#endif + + virtual IOReturn AddDevice(IOBluetoothDevice * inDevice); + virtual IOReturn RemoveDevice(IOBluetoothDevice * inDevice); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual void PrintDeviceList(); +#endif + + virtual IOReturn SetDevicePublishNotificationState(const BluetoothDeviceAddress *, UInt16); + virtual UInt16 GetDevicePublishNotificationState(const BluetoothDeviceAddress *); + virtual IOReturn CreateDeviceFromLEConnectionResults(BluetoothHCIEventLEConnectionCompleteResults * connectionResults); + virtual IOReturn CreateDeviceFromConnectionResults(BluetoothHCIEventConnectionCompleteResults * connectionResults); + virtual IOReturn CreateDeviceFromConnectionResults(BluetoothHCIEventConnectionCompleteResults * connectionResults, bool isInitiator); + virtual IOReturn DestroyDeviceWithDisconnectionResults(BluetoothHCIEventDisconnectionCompleteResults * disconnectionResults); + virtual IOReturn DestroyDevice(IOBluetoothDevice * inDevice); + virtual IOReturn DestroyAllDevices(); + + virtual bool terminateServiceNubs(); + virtual bool terminateServiceNubsComplete(); + + virtual void FlushDeviceACLPackets(IOBluetoothDevice * inDevice); + virtual void SaveNumOutstandingACLPackets(); + virtual void DecrementIdleTimerActivityCount(UInt16); + virtual void IncrementIdleTimerActivityCount(); + virtual void DecrementOutstandingACLPackets(UInt16, UInt16, UInt16, UInt16, UInt16, UInt16); + + virtual void ProcessFlushOccurredEvent(BluetoothHCIEventFlushOccurredResults * inFlushResults); + virtual void ProcessNumberOfCompletedPacketsEvent(UInt8 *); + virtual void ProcessHCIControllerResetEvent(); + + virtual IOReturn DispatchIncomingACLData(UInt8 * inDataPtr, UInt32 inDataSize); + virtual IOReturn DispatchIncomingSCOData(UInt8 * inDataPtr, UInt32 inDataSize, UInt32 inMissingData, AbsoluteTime inTimestamp); + virtual IOBluetoothDevice * OpenDeviceConnection(const BluetoothDeviceAddress * inDeviceAddress); + static IOReturn OpenDeviceConnectionAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + virtual IOBluetoothDevice * OpenDeviceConnectionWL(const BluetoothDeviceAddress * inDeviceAddress, UInt16, bool); + virtual IOReturn SendACLData(IOMemoryDescriptor * memDescriptor); + static void ACLPacketTimerFired(OSObject * owner, IOTimerEventSource * timerEventSource); + virtual IOReturn SendACLPacket(IOBluetoothACLMemoryDescriptor * memDescriptor, IOBluetoothDevice * inTargetDevice = NULL); + virtual IOReturn TransferACLPacketToHW(IOMemoryDescriptor * memDescriptor); + virtual void handleACLPacketTimeout(IOBluetoothACLMemoryDescriptor *); + virtual IOReturn setUnackQueueCompletionCalled(void *); + static IOReturn setUnackQueueCompletionCalledAction(OSObject * onwer, void * arg1, void * arg2, void * arg3, void * arg4, void * arg5, void * arg6); + + virtual IOReturn SetACLPacketCompletion(void *); + virtual IOReturn EnqueuePacket(IOMemoryDescriptor * memDescriptor, IOBluetoothDevice * inTargetDevice); + virtual IOReturn DequeuePacket(UInt16, UInt16, UInt16, UInt16, UInt16, UInt16); + virtual IOReturn RemovePacket(IOBluetoothACLMemoryDescriptor *); + virtual UInt32 RemoveAllPacketsBelongingTo(IOBluetoothDevice *); // returns number of packets removed + virtual IOReturn AdjustACLQueuesLimits(IOBluetoothDevice *); + virtual IOReturn AdjustACLQueuesAllowance(IOBluetoothDevice *, bool); + static IOReturn AdjustACLQueuesAllowanceAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4, void * arg5, void * arg6); + virtual char * CreateACLQueueDebugString(char *, UInt16); + virtual void SendSCOCompleted(IOBluetoothSCOMemoryDescriptorRetainer *, AbsoluteTime timestamp); + static IOReturn SendSCOCompletedAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4, void * arg5, void * arg6); + virtual IOReturn SendSCOData(IOMemoryDescriptor *, IOBluetoothSCOMemoryDescriptorRetainer *, int); + virtual IOReturn SendSCOData(IOMemoryDescriptor *); + static void SCOPacketTimerFired(OSObject * owner, IOTimerEventSource * timerEventSource); + virtual void handleSCOPacketTimeout(IOBluetoothSCOMemoryDescriptorRetainer *); + + virtual void SetNumSCOConnections(UInt8, UInt32); + virtual IOReturn ToggleSCOConnection(); + virtual IOReturn ToggleeSCOEV3Connection(); + virtual IOReturn ToggleeSCOEV4Connection(); + virtual IOReturn ToggleeSCOEV5Connection(); + + virtual UInt16 getSynchronousConnectionPacketTypeProperty(); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual bool NeedToSetupController(); + static IOReturn NeedToSetupControllerAction(IOBluetoothHostController * target); + virtual bool FullWake(char * calledByFunction); +#endif + + virtual void ProcessLMPData(UInt8 * data, UInt32 dataSize); + static IOReturn ProcessLMPDataAction(IOBluetoothHostController * hostController, UInt8 * data, UInt32 dataSize); + virtual void ProcessLMPDataWL(UInt8 * data, UInt32 dataSize); + + virtual void ProcessACLData(UInt8 * data, UInt32 dataSize); + static IOReturn ProcessACLDataAction(IOBluetoothHostController * hostController, UInt8 * incomingDataPtr, UInt32 inDataSize, UInt32 inSequenceNumber); + virtual void ProcessACLDataWL(UInt8 * data, UInt32 dataSize, UInt32 sequenceNumber); + + virtual void ProcessSCOData(UInt8 * data, UInt32 dataSize, UInt32 inMissingData, AbsoluteTime inTimestamp, Boolean copyData); + static IOReturn ProcessSCODataAction(IOBluetoothHostController * hostController, UInt8 * incomingDataPtr, UInt32 inDataSize, UInt32 inMissingData, AbsoluteTime * inTimestamp, Boolean inCopyData); + virtual void ProcessSCODataWL(UInt8 * data, UInt32 dataSize, UInt32 inMissingData, AbsoluteTime inTimestamp, Boolean copyData); + + virtual void ProcessEventData(UInt8 * inDataPtr, UInt32 inDataSize); + static IOReturn ProcessEventDataAction(IOBluetoothHostController * hostController, UInt8 * incomingDataPtr, UInt32 inDataSize, UInt32 inSequenceNumber); + virtual void ProcessEventDataWL(UInt8 * inDataPtr, UInt32 inDataSize, UInt32 sequenceNumber); + virtual void NotifyDataClientsForEventData(IOBluetoothHCIRequest * hciRequest, UInt32, UInt8 *); + + virtual bool GetCompleteCodeForCommand(BluetoothHCICommandOpCode inOpCode, BluetoothHCIEventCode * outEventCode); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual IOReturn GetOpCodeAndEventCode(UInt8 * inDataPtr, UInt32 inDataSize, BluetoothHCICommandOpCode * outOpCode, BluetoothHCIEventCode * eventCode, BluetoothHCIEventStatus * outStatus, UInt8 *, BluetoothDeviceAddress * outDeviceAddress, BluetoothConnectionHandle * outConnectionHandle, bool *); +#else + virtual IOReturn GetOpCodeAndEventCode(UInt8 * inDataPtr, BluetoothHCICommandOpCode * outOpCode, BluetoothHCIEventCode * eventCode, BluetoothHCIEventStatus * outStatus, UInt8 *, BluetoothDeviceAddress * outDeviceAddress, BluetoothConnectionHandle * outConnectionHandle); +#endif + + virtual IOReturn FindConnectionCompleteType(BluetoothDeviceAddress * inDeviceAddress, BluetoothHCICommandOpCode * outOpCode); + virtual IOReturn FindSynchronousConnectionCompleteType(BluetoothDeviceAddress * inDeviceAddress, BluetoothHCICommandOpCode * outOpCode); + + virtual IOReturn HandleSpecialOpcodes(BluetoothHCICommandOpCode opCode); + virtual IOReturn HCIRequestCreate(BluetoothHCIRequestID * outRequestID, bool inDoAsyncNotify = false, UInt32 inTimeout = 5000, BluetoothHCIRequestCallbackInfo * inCallbackInfo = NULL, task_t inTaskID = NULL, UInt32 inControlFlags = 0); + virtual IOReturn HCIRequestDelete(task_t inTask, BluetoothHCIRequestID inID); + virtual IOReturn LookupRequest(BluetoothHCIRequestID inID, IOBluetoothHCIRequest ** outRequestPtr); + virtual IOReturn PrepareRequestForNewCommand(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inDeviceAddress, BluetoothConnectionHandle inConnectionHandle); + virtual IOReturn DisposeRequestsForTaskID(task_t inTaskID); + virtual IOReturn CleanUpOrphanedHCIRequest(); + virtual void CleanUpExpiredHCIRequest(); + virtual bool HCIRequestQueuesAreEmpty(); + virtual void RemoveAllHCIRequestBelongsToThisDevice(IOBluetoothDevice * thisDevice); + virtual bool HCIRequestIsSynchronous(UInt32, bool *); + + virtual bool SetHCIRequestRequireEvents(UInt16, IOBluetoothHCIRequest * request); + virtual bool SetHCIRequestReceivedEvents(UInt8, IOBluetoothHCIRequest * request); + virtual void ValidateHCIRequestReceivedEvents(UInt8, IOBluetoothHCIRequest * request); + + virtual IOReturn SendHCIRequestFormatted(BluetoothHCIRequestID inID, BluetoothHCICommandOpCode inOpCode, IOByteCount outResultsSize, void * outResultsPtr, const char * inFormat, ...); + virtual IOReturn SendRawHCICommand(BluetoothHCIRequestID inID, char * buffer, IOByteCount bufferSize, UInt8 * outResultsPtr, IOByteCount outResultsSize); + virtual IOReturn ProcessWaitingRequests(bool); + virtual IOReturn SendingRequest(IOBluetoothHCIRequest * requestPtr); + virtual IOReturn SendHCIRequestToTransport(UInt8 *, IOByteCount); + + virtual IOReturn EnqueueRequestForController(IOBluetoothHCIRequest * requestPtr); + virtual IOReturn EnqueueRequest(IOBluetoothHCIRequest * inRequestPtr); + virtual IOReturn DequeueRequest(IOBluetoothHCIRequest * inRequestPtr); + virtual IOReturn FindQueuedRequest(BluetoothHCICommandOpCode opCode, BluetoothDeviceAddress * inDeviceAddress, BluetoothConnectionHandle inConnectionHandle, Boolean inUseAttributes, + IOBluetoothHCIRequest ** outRequestPtr); + virtual IOReturn EnqueueWaitRequest(IOBluetoothHCIRequest * inRequestPtr); + virtual IOReturn DequeueWaitRequest(IOBluetoothHCIRequest * inRequestPtr); + virtual IOReturn FindQueuedWaitRequest(BluetoothHCICommandOpCode opCode, IOBluetoothHCIRequest ** outRequestPtr); + virtual IOReturn AbortRequest(IOBluetoothHCIRequest * inRequestPtr); + virtual IOReturn AbortRequestAndSetTime(IOBluetoothHCIRequest *); + virtual IOReturn KillAllPendingRequests(bool destroy, bool includeIdleRequests); + virtual IOReturn CallKillAllPendingRequests(bool destroy, bool includeIdleRequests); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + virtual IOReturn IncrementHCICommandTimeOutCounter(UInt16 inOpCode); +#else + virtual IOReturn IncrementHCICommandTimeOutCounter(); +#endif + virtual void ResetHCICommandTimeOutCounter(); + + virtual void IncrementActiveConnections(); + virtual void DecrementActiveConnections(); + virtual void ActiveConnectionsInProgress(); + virtual void AllConnectionsGone(); + virtual void MergeChannelDescription(OSDictionary * destination, OSDictionary * source); + virtual void RemoveChannelRestrictions(OSDictionary * toChange, OSDictionary * removeRule, const char * key); + virtual bool IsAllowedDevice(OSDictionary * description, IOBluetoothDevice * device); + virtual void RemoveAllRules(); + + virtual OSDictionary * GetIncomingL2CAPChannelDescription(OSNumber * psmNumber); + virtual IOReturn AddAllowedIncomingL2CAPChannel(OSDictionary * channelDescription); + virtual void RemoveAllowedIncomingL2CAPChannel(OSObject * channelID); + + virtual void AddAllowedIncomingL2CAPChannel(BluetoothL2CAPPSM incomingPSM); + virtual void AddAllowedIncomingL2CAPChannel(OSNumber * psmNumber); + virtual void RemoveAllowedIncomingL2CAPChannel(BluetoothL2CAPPSM incomingPSM); + + virtual OSDictionary * GetIncomingRFCOMMChannelDescription(OSNumber * channelIDNumber); + virtual IOReturn AddAllowedIncomingRFCOMMChannel(OSDictionary * channelDescription); + virtual void AddAllowedIncomingRFCOMMChannel(BluetoothRFCOMMChannelID incomingChannelID); + virtual void AddAllowedIncomingRFCOMMChannel(OSNumber * channelIDNumber); + virtual void AddSecureIncomingRFCOMMChannel(BluetoothRFCOMMChannelID incomingChannelID); + virtual void AddSecureIncomingRFCOMMChannel(OSNumber * channelIDNumber); + virtual void RemoveAllowedIncomingRFCOMMChannel(OSObject * channelID); + virtual void RemoveAllowedIncomingRFCOMMChannel(BluetoothRFCOMMChannelID incomingChannelID); + virtual bool IsSecureIncomingRFCOMMChannel(BluetoothRFCOMMChannelID incomingChannelID); +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15 + virtual bool IsSecureIncomingRFCOMMChannel(OSNumber * incomingChannelID); + virtual void SetEnabledIncomingRFCOMMChannel(OSNumber * incomingChannelID, bool ShouldBeEnabled); +#endif + virtual void SetEnabledIncomingRFCOMMChannel(BluetoothRFCOMMChannelID incomingChannelID, bool ShouldBeEnabled); + + virtual bool IsAllowedIncomingL2CAPChannelForDevice(BluetoothL2CAPPSM incomingPSM, IOBluetoothDevice * device); + virtual bool IsAllowedIncomingRFCOMMChannelForDevice(BluetoothRFCOMMChannelID incomingChannelID, IOBluetoothDevice * device); + + static void idleTimerFired(OSObject * owner, IOTimerEventSource * timerEventSource); + virtual void StartIdleTimer(uint32_t milliseconds); + virtual void StopIdleTimer(); + virtual void EvaluateHighPriorityConnections(); + virtual void handleIdleTimeout(); + virtual IOReturn CallCancelTimeoutForIdleTimer(); + virtual IOReturn CallUpdateTimerForIdleTimer(); + virtual IOReturn CallResetTimerForIdleTimer(); + virtual IOReturn EnableIdleTimer(); + virtual IOReturn DisableIdleTimer(); + virtual void ChangeIdleTimerTime(char * calledByFunction, UInt32 newTime); + virtual IOReturn SetIdleTimerValue(UInt32 value); + virtual IOReturn SetIdleTimerValueInNVRAM(UInt32 value); + virtual IOReturn ClearIdleTimerValueInNVRAM(); + virtual void WriteIdleTimerValueToNVRAM(); + virtual void ReadIdleTimerValueFromNVRAM(); + virtual void RemoveIdleTimerValueInNVRAM(); + + virtual bool SetTransportIdlePolicyValue(); + virtual void WaitForAllDevicesToGetReadyToBeDestroyed(); + + virtual bool UpdatePowerStateProperty(IOBluetoothHCIControllerInternalPowerState powerState, bool); + virtual IOReturn RequestPowerStateChange(IOBluetoothHCIControllerInternalPowerState newPowerState, char *); + virtual IOReturn RequestPowerStateChangeFromUserSpace(IOBluetoothHCIControllerInternalPowerState newPowerState); + virtual bool Power_State_Change_In_Progress(); + virtual bool Power_State_Is_Off(); + virtual bool Is_Powering_Down(); + virtual IOBluetoothHCIControllerInternalPowerState GetControllerPowerState(); + virtual IOReturn GetTransportCurrentPowerState(IOBluetoothHCIControllerInternalPowerState * outPowerState); + virtual IOReturn GetTransportPendingPowerState(IOBluetoothHCIControllerInternalPowerState * outPowerState); + virtual IOReturn ChangeTransportPowerStateTo(unsigned long ordinal, bool willWait, IOBluetoothHCIControllerInternalPowerState powerState, char * name); + virtual IOReturn WaitForTransportPowerStateChange(IOBluetoothHCIControllerInternalPowerState, char *); + virtual bool SystemReadyForSleep(); + virtual void SetChangingPowerState(bool); + virtual void SetControllerPowerOptions(IOBluetoothHCIControllerPowerOptions inPowerOptions); + virtual IOBluetoothHCIControllerPowerOptions GetControllerPowerOptions(); + virtual void TransportIsReady(bool); + virtual void TransportIsGoingAway(); + virtual IOReturn ChangeControllerStateForRestart(); + virtual IOReturn CleanUpForPoweringOff(); + virtual IOReturn CleanUpBeforeTransportTerminate(IOBluetoothHostControllerTransport * transport); + virtual void SetVendorSpecificEventMask(bool); + virtual IOReturn CleanUpForCompletePowerChangeFromSleepToOn(); + virtual IOReturn CleanupForPowerChangeFromOnToSleep(bool, UInt32 *); + + virtual IOReturn PerformTaskForPowerManagementCalls(IOOptionBits options); + virtual IOReturn disableHIDEmulation(); + virtual IOReturn SetHIDEmulation(UInt32, bool); + virtual IOReturn CallSetHIDEmulation(); + virtual bool ModuleIsInUHEMode(bool *); + virtual IOReturn TransportRadioPowerOff(BluetoothHCICommandOpCode opCode, char * processName, int processID, IOBluetoothHCIRequest * request); + virtual IOReturn GetTransportRadioPowerState(UInt8 *); + virtual IOReturn SetTransportRadioPowerState(UInt8); + virtual IOReturn CallPowerRadio(bool); + virtual IOReturn SendBFCSetParams(UInt8, UInt8, UInt8); + virtual bool SetMaxPowerForConnection(UInt32, UInt8, UInt16); + virtual IOReturn WriteDeviceAddress(BluetoothHCIRequestID inID, BluetoothDeviceAddress * inAddress); + virtual IOReturn WriteLocalSupportedFeatures(UInt32, void *); + virtual IOReturn WriteBufferSize(); + virtual IOReturn DisableScan(); +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15 + virtual IOReturn EnableScan(); +#endif +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + virtual IOReturn CallBluetoothHCIReset(bool, char *); +#else + virtual IOReturn CallBluetoothHCIReset(bool); +#endif + + virtual IOReturn IgnoreUSBReset(bool); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual IOReturn HardResetController(UInt16); +#else + virtual IOReturn BluetoothResetDevice(UInt16); + virtual IOReturn BluetoothResetController(); + virtual IOReturn BluetoothResetHub(); + virtual IOReturn DoReset(); +#endif + virtual bool WillResetModule(); +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15 + virtual void ResetHardResetCounter(); +#endif +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + static IOReturn HardResetControllerAction(OSObject * target, UInt16); + virtual IOReturn EnqueueHardResetControllerAction(UInt16); +#endif + virtual IOReturn ResetTransportHardwareStatus(); + virtual IOReturn GetTransportHardwareStatus(UInt32 *); + virtual void TransportTerminating(IOBluetoothHostControllerTransport *); +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15 + virtual IOReturn ForceHardwareReset(); +#endif + virtual IOReturn GetTransportInfo(BluetoothTransportInfo *); + virtual bool SupportWoBT(); + virtual bool IsTBFCSupported(); + virtual bool IsAnyDevicesTBFCPageCapable(); + virtual bool SupportDeepIdle(); + virtual IOReturn SetIdlePolicy(bool); + virtual bool BluetoothRemoteWakeEnabled(); + virtual bool FileVaultIsTurnedOn(); + virtual IOReturn ControllerCommandSleep(void *, UInt32, char *, bool); + + virtual UInt32 ConvertAddressToUInt32(void * inAddress); + virtual IOReturn UpdateFirmware(UInt32); + virtual bool NeedToIncreaseInactivityTime(); + virtual void DisableControllerWorkQueue(); + virtual void DoNotTickleDisplay(); + virtual IOReturn ValidSleepTypeFromPowerManager(UInt32 *); + virtual IOReturn ToggleLMPLogging(); + virtual IOReturn SetupLighthouse(); + virtual IOReturn SetLighthouseControl(UInt8); + virtual IOReturn SetLighthouseParameters(UInt16, UInt16, UInt16, UInt8, UInt8, SInt8, UInt8); + virtual IOReturn SetLighthouseDebugQuery(UInt8); + virtual void WakeUpLEConnectionCompleteOutOfSequenceThread(); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual IOReturn RecoverX238EModule(); +#endif +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + virtual void SetControllerSleepMode(); +#endif + + virtual void TakeAHexDump(const void * inData, UInt32 inDataSize); + virtual void PrintAllHCIRequests(); + virtual void PrintDeviceListAddress(); + virtual void PrintClassVariablesContent(); + virtual os_log_t CreateOSLogObject(); + virtual BluetoothHCIRequestID GetMaxRequestID(); // return 500 +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual IOReturn TestLEAdvertisingReportEvent(UInt8); +#endif +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual bool IsClassicSecureConnectionsSupported(); +#endif + + virtual IOReturn BluetoothHCIInquiry(BluetoothHCIRequestID inID, BluetoothLAP inLAP, BluetoothHCIInquiryLength inInquiryLength, BluetoothHCIResponseCount inMaxResponseCount, + BluetoothHCIInquiryResults * outResults); + virtual IOReturn BluetoothHCIInquiryCancel(BluetoothHCIRequestID inID); + virtual IOReturn BluetoothHCIPeriodicInquiryMode(BluetoothHCIRequestID inID, BluetoothHCIInquiryLength inMaxPeriodLength, BluetoothHCIInquiryLength inMinPeriodLength, BluetoothLAP inLAP, + BluetoothHCIInquiryLength inInquiryLength, BluetoothHCIResponseCount inMaxResponses, BluetoothHCIInquiryResults * outResults); + virtual IOReturn BluetoothHCIExitPeriodicInquiryMode(BluetoothHCIRequestID inID); + virtual IOReturn BluetoothHCICreateConnection(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, BluetoothPacketType inPacketType, + BluetoothPageScanRepetitionMode inPageScanRepetitionMode, BluetoothPageScanMode inPageScanMode, BluetoothClockOffset inClockOffset, + BluetoothAllowRoleSwitch inAllowRoleSwitch, BluetoothHCIEventConnectionCompleteResults * outConnectionHandle); + virtual IOReturn BluetoothHCIDisconnect(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothReasonCode inReason, + BluetoothHCIEventDisconnectionCompleteResults * outResults); + virtual IOReturn BluetoothHCIAddSCOConnection(BluetoothHCIRequestID inID, BluetoothConnectionHandle inACLConnectionHandle, BluetoothPacketType inPacketType); + virtual IOReturn BluetoothHCIAcceptConnectionRequest(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, BluetoothRole inRole); + virtual IOReturn BluetoothHCIRejectConnectionRequest(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, BluetoothReasonCode inReason); + virtual IOReturn BluetoothHCILinkKeyRequestReply(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, const BluetoothKey * inKeyPtr, BluetoothDeviceAddress * outAddress); + virtual IOReturn BluetoothHCILinkKeyRequestNegativeReply(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, BluetoothDeviceAddress * outAddress); + virtual IOReturn BluetoothHCIPINCodeRequestReply(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, IOByteCount inPINCodeSize, const BluetoothPINCode * inPINCode, + BluetoothDeviceAddress * outAddress); + virtual IOReturn BluetoothHCIPINCodeRequestNegativeReply(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, BluetoothDeviceAddress * outAddress); + virtual IOReturn BluetoothHCIChangeConnectionPacketType(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothPacketType inPacketType); + virtual IOReturn BluetoothHCIAuthenticationRequested(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle); + virtual IOReturn BluetoothHCISetEncryptionEnable(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothEncryptionEnable inEncryptionEnable); + virtual IOReturn BluetoothHCIChangeConnectionLinkKey(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle); + virtual IOReturn BluetoothHCIMasterLinkKey(BluetoothHCIRequestID inID, BluetoothKeyFlag inKeyFlag); + virtual IOReturn BluetoothHCIRemoteNameRequest(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, BluetoothPageScanRepetitionMode inPageScanRepetitionMode, + BluetoothPageScanMode inPageScanMode, BluetoothClockOffset inClockOffset, BluetoothHCIEventRemoteNameRequestResults * outName); + virtual IOReturn BluetoothHCIReadRemoteSupportedFeatures(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIEventReadRemoteSupportedFeaturesResults * outFeatures); + virtual IOReturn BluetoothHCIReadRemoteExtendedFeatures(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCIExtendedInquiryResponseDataType inDataType, + BluetoothHCIEventReadRemoteExtendedFeaturesResults * outFeatures); + virtual IOReturn BluetoothHCIReadRemoteVersionInformation(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCIEventReadRemoteVersionInfoResults * outVersionInfo); + virtual IOReturn BluetoothHCIReadClockOffset(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothClockOffset * outClockOffset); + + virtual IOReturn BluetoothHCIIOCapabilityRequestReply(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, UInt8, UInt8, UInt8); + virtual IOReturn BluetoothHCIUserConfirmationRequestReply(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr); + virtual IOReturn BluetoothHCIUserConfirmationRequestNegativeReply(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr); + virtual IOReturn BluetoothHCIUserPasskeyRequestReply(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, UInt32); + virtual IOReturn BluetoothHCIUserPasskeyRequestNegativeReply(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr); + virtual IOReturn BluetoothHCIRemoteOOBDataRequestReply(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, BluetoothHCISimplePairingOOBData *, + BluetoothHCISimplePairingOOBData *); + virtual IOReturn BluetoothHCIRemoteOOBDataRequestNegativeReply(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr); + virtual IOReturn BluetoothHCIIOCapabilityRequestNegativeReply(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, UInt8); + virtual IOReturn BluetoothHCISetupSynchronousConnection(BluetoothHCIRequestID inID, BluetoothConnectionHandle inHandle, BluetoothHCISetupSynchronousConnectionParams * inParams); + virtual IOReturn BluetoothHCIAcceptSynchronousConnectionRequest(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, BluetoothHCIAcceptSynchronousConnectionRequestParams *); + virtual IOReturn BluetoothHCIRejectSynchronousConnectionRequest(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, UInt8); + virtual IOReturn BluetoothHCIEnhancedSetupSynchronousConnection(BluetoothHCIRequestID inID, BluetoothConnectionHandle inHandle, BluetoothHCIEnhancedSetupSynchronousConnectionParams * inParams); + virtual IOReturn BluetoothHCIEnhancedAcceptSynchronousConnectionRequest(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, + BluetoothHCIEnhancedAcceptSynchronousConnectionRequestParams *); + + virtual IOReturn BluetoothHCIHoldMode(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCIModeInterval inHoldModeMaxInterval, + BluetoothHCIModeInterval inHoldModeMinInterval); + virtual IOReturn BluetoothHCISniffMode(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCIModeInterval inSniffModeMaxInterval, + BluetoothHCIModeInterval inSniffModeMinInterval, BluetoothHCISniffAttemptCount inSniffAttemptCount, BluetoothHCISniffTimeout inSniffModeTimeout); + virtual IOReturn BluetoothHCIExitSniffMode(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle); + virtual IOReturn BluetoothHCIParkMode(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCIParkModeBeaconInterval inMaxInterval, + BluetoothHCIParkModeBeaconInterval inMinInterval); + virtual IOReturn BluetoothHCIExitParkMode(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle); + virtual IOReturn BluetoothHCIQualityOfServiceSetup(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCIQualityOfServiceSetupParams * inSetupPtr); + virtual IOReturn BluetoothHCIRoleDiscovery(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCIRoleInfo * outRoleInfo); + virtual IOReturn BluetoothHCISwitchRole(BluetoothHCIRequestID inID, BluetoothDeviceAddress * inAddressPtr, BluetoothHCIRole inNewRole); + virtual IOReturn BluetoothHCIReadLinkPolicySettings(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCILinkPolicySettingsInfo * outSettingsInfo); + virtual IOReturn BluetoothHCIReadDefaultLinkPolicySettings(BluetoothHCIRequestID inID, BluetoothHCILinkPolicySettingsInfo * outSettingsInfo); + virtual IOReturn BluetoothHCIWriteLinkPolicySettings(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCILinkPolicySettings inSettings, + BluetoothConnectionHandle * outConnectionHandle); + virtual IOReturn BluetoothHCIWriteDefaultLinkPolicySettings(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle); + virtual IOReturn BluetoothHCISniffSubrating(BluetoothHCIRequestID inID, UInt16, UInt16, UInt16, UInt16, UInt16 *); + virtual IOReturn BluetoothHCIFlowSpecification(BluetoothHCIRequestID inID, BluetoothHCIEventFlowSpecificationData *, BluetoothHCIEventFlowSpecificationData *); + virtual IOReturn BluetoothHCISetEventMask(BluetoothHCIRequestID inID, BluetoothSetEventMask * inMask); + virtual IOReturn BluetoothHCILESetEventMask(BluetoothHCIRequestID inID, BluetoothSetEventMask * inMask); + virtual IOReturn BluetoothHCILEReadBufferSize(BluetoothHCIRequestID inID, BluetoothHCILEBufferSize * outSize); + virtual IOReturn BluetoothHCILESetScanEnable(BluetoothHCIRequestID inID, UInt8, UInt8); + virtual IOReturn BluetoothHCILESetAdvertiseEnable(BluetoothHCIRequestID inID, UInt8); + virtual IOReturn BluetoothHCILEReadLocalSupportedFeatures(BluetoothHCIRequestID inID, BluetoothHCISupportedFeatures * outFeatures); + virtual IOReturn BluetoothHCILEReadRemoteUsedFeatures(BluetoothHCIRequestID inID, UInt16, BluetoothHCISupportedFeatures * outFeatures); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + virtual IOReturn BluetoothHCIReset(BluetoothHCIRequestID inID, char * name); +#else + virtual IOReturn BluetoothHCIReset(BluetoothHCIRequestID inID); +#endif + virtual IOReturn BluetoothHCISetEventFilter(BluetoothHCIRequestID inID, UInt8, UInt8, BluetoothEventFilterCondition *); + virtual IOReturn BluetoothHCIFlush(BluetoothHCIRequestID inID, BluetoothConnectionHandle inHandle); + virtual IOReturn BluetoothHCIReadPINType(BluetoothHCIRequestID inID, BluetoothPINType * outType); + virtual IOReturn BluetoothHCIWritePINType(BluetoothHCIRequestID inID, BluetoothPINType inType); + + virtual IOReturn BluetoothHCICreateNewUnitKey(BluetoothHCIRequestID inID); + virtual IOReturn BluetoothHCIReadStoredLinkKey(BluetoothHCIRequestID inID, BluetoothDeviceAddress * targetDevice, BluetoothHCIReadStoredLinkKeysFlag * inFlags, + BluetoothHCIStoredLinkKeysInfo * outKeysInfo); + virtual IOReturn BluetoothHCIWriteStoredLinkKey(BluetoothHCIRequestID inID, IOItemCount inNumKeysToWrite, BluetoothDeviceAddress inDeviceAddresses[], BluetoothKey inLinkKeys[], + BluetoothHCINumLinkKeysToWrite * outNumKeysWritten); + virtual IOReturn BluetoothHCIDeleteStoredLinkKey(BluetoothHCIRequestID inID, BluetoothDeviceAddress * targetDevice, BluetoothHCIDeleteStoredLinkKeyFlag * inFlag, + BluetoothHCINumLinkKeysDeleted * outNumDeleted); + + virtual IOReturn BluetoothHCIChangeLocalName(BluetoothHCIRequestID inID, BluetoothDeviceName newName); + virtual IOReturn BluetoothHCIReadLocalName(BluetoothHCIRequestID inID, BluetoothDeviceName name); + virtual IOReturn BluetoothHCIReadConnectionAcceptTimeout(BluetoothHCIRequestID inID, BluetoothHCIConnectionAcceptTimeout * outTimeout); + virtual IOReturn BluetoothHCIWriteConnectionAcceptTimeout(BluetoothHCIRequestID inID, BluetoothHCIConnectionAcceptTimeout inTimeout); + virtual IOReturn BluetoothHCIReadPageTimeout(BluetoothHCIRequestID inID, BluetoothHCIPageTimeout * outDataPtr); + virtual IOReturn BluetoothHCIWritePageTimeout(BluetoothHCIRequestID inID, BluetoothHCIPageTimeout inTimeout); + virtual IOReturn BluetoothHCIReadScanEnable(BluetoothHCIRequestID inID, BluetoothHCIPageScanEnableState * outState); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual IOReturn BluetoothHCIWriteScanEnable(BluetoothHCIRequestID inID, BluetoothHCIPageScanEnableState inState, bool); +#else + virtual IOReturn BluetoothHCIWriteScanEnable(BluetoothHCIRequestID inID, BluetoothHCIPageScanEnableState inState); +#endif + virtual IOReturn BluetoothHCIReadPageScanActivity(BluetoothHCIRequestID inID, BluetoothHCIScanActivity * outActivityInfo); + virtual IOReturn BluetoothHCIWritePageScanActivity(BluetoothHCIRequestID inID, BluetoothHCIScanActivity * inActivityInfo); + virtual IOReturn BluetoothHCIReadInquiryScanActivity(BluetoothHCIRequestID inID, BluetoothHCIScanActivity * outActivityInfo); + virtual IOReturn BluetoothHCIWriteInquiryScanActivity(BluetoothHCIRequestID inID, BluetoothHCIScanActivity * inActivityInfo); + virtual IOReturn BluetoothHCIReadAuthenticationEnable(BluetoothHCIRequestID inID, BluetoothHCIAuthenticationEnable * outAuthenticationState); + virtual IOReturn BluetoothHCIWriteAuthenticationEnable(BluetoothHCIRequestID inID, BluetoothHCIAuthenticationEnable inAuthenticationState); + + virtual IOReturn BluetoothHCIReadEncryptionMode(BluetoothHCIRequestID inID, BluetoothHCIEncryptionMode * outEncryptionState); + virtual IOReturn BluetoothHCIWriteEncryptionMode(BluetoothHCIRequestID inID, BluetoothHCIEncryptionMode inEncryptionMode); + virtual IOReturn BluetoothHCIReadClassOfDevice(BluetoothHCIRequestID inID, BluetoothClassOfDevice * outClassOfDevice); + virtual IOReturn BluetoothHCIWriteClassOfDevice(BluetoothHCIRequestID inID, BluetoothClassOfDevice inClassOfDevice); + virtual IOReturn BluetoothHCIReadVoiceSetting(BluetoothHCIRequestID inID, BluetoothHCIVoiceSetting * outVoiceSetting); + virtual IOReturn BluetoothHCIWriteVoiceSetting(BluetoothHCIRequestID inID, BluetoothHCIVoiceSetting inVoiceSetting); + virtual IOReturn BluetoothHCIReadAutomaticFlushTimeout(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIAutomaticFlushTimeoutInfo * outAutomaticFlushTimeoutInfo); + virtual IOReturn BluetoothHCIWriteAutomaticFlushTimeout(BluetoothHCIRequestID inID, BluetoothHCIAutomaticFlushTimeoutInfo * inAutomaticFlushTimeoutInfo, + BluetoothConnectionHandle * outConnectionHandle); + virtual IOReturn BluetoothHCIReadNumBroadcastRetransmissions(BluetoothHCIRequestID inID, BluetoothHCINumBroadcastRetransmissions * outNumRetrans); + virtual IOReturn BluetoothHCIWriteNumBroadcastRetransmissions(BluetoothHCIRequestID inID, BluetoothHCINumBroadcastRetransmissions inNumRetrans); + virtual IOReturn BluetoothHCIReadHoldModeActivity(BluetoothHCIRequestID inID, BluetoothHCIHoldModeActivity * outState); + virtual IOReturn BluetoothHCIWriteHoldModeActivity(BluetoothHCIRequestID inID, BluetoothHCIHoldModeActivity inState); + virtual IOReturn BluetoothHCIReadTransmitPowerLevel(BluetoothHCIRequestID inID, BluetoothConnectionHandle inHandle, BluetoothHCITransmitPowerLevelType inType, + BluetoothHCITransmitPowerLevelInfo * outLevelInfo); + virtual IOReturn BluetoothHCIReadSCOFlowControlEnable(BluetoothHCIRequestID inID, BluetoothHCIFlowControlState * outState); + virtual IOReturn BluetoothHCIWriteSCOFlowControlEnable(BluetoothHCIRequestID inID, BluetoothHCIFlowControlState inState); + virtual IOReturn BluetoothHCISetHostControllerToHostFlowControl(BluetoothHCIRequestID inID, BluetoothHCIFlowControlState inState); + virtual IOReturn BluetoothHCIHostBufferSize(BluetoothHCIRequestID inID, BluetoothHCIBufferSize * inSize); + virtual IOReturn BluetoothHCIHostNumberOfCompletedPackets(BluetoothHCIRequestID inID, UInt8, UInt16 *, UInt16 *); + virtual IOReturn BluetoothHCIReadLinkSupervisionTimeout(BluetoothHCIRequestID inID, BluetoothConnectionHandle inHandle, BluetoothHCILinkSupervisionTimeout * outInfo); + virtual IOReturn BluetoothHCIWriteLinkSupervisionTimeout(BluetoothHCIRequestID inID, BluetoothHCILinkSupervisionTimeout * inInfo, BluetoothConnectionHandle * outHandle); + virtual IOReturn BluetoothHCIReadNumberOfSupportedIAC(BluetoothHCIRequestID inID, BluetoothHCISupportedIAC * outNumSupported); + virtual IOReturn BluetoothHCIReadCurrentIACLAP(BluetoothHCIRequestID inID, BluetoothHCICurrentInquiryAccessCodes * inAccessCodes); + virtual IOReturn BluetoothHCIWriteCurrentIACLAP(BluetoothHCIRequestID inID, BluetoothHCICurrentInquiryAccessCodesForWrite * inAccessCodes); + virtual IOReturn BluetoothHCIReadPageScanPeriodMode(BluetoothHCIRequestID inID, BluetoothHCIPageScanPeriodMode * outMode); + virtual IOReturn BluetoothHCIWritePageScanPeriodMode(BluetoothHCIRequestID inID, BluetoothHCIPageScanPeriodMode inMode); + virtual IOReturn BluetoothHCIReadPageScanMode(BluetoothHCIRequestID inID, BluetoothHCIPageScanMode * outMode); + virtual IOReturn BluetoothHCIWritePageScanMode(BluetoothHCIRequestID inID, BluetoothHCIPageScanMode inMode); + + virtual IOReturn BluetoothHCIEnhancedFlush(BluetoothHCIRequestID inID, UInt16, UInt8, UInt16 *); + virtual IOReturn BluetoothHCIReadExtendedInquiryResponse(BluetoothHCIRequestID inID, BluetoothHCIReadExtendedInquiryResponseResults *); + virtual IOReturn BluetoothHCIWriteExtendedInquiryResponse(BluetoothHCIRequestID inID, UInt8, BluetoothHCIExtendedInquiryResponse *); + virtual IOReturn BluetoothHCIRefreshEncryptionKey(BluetoothHCIRequestID inID, UInt16, BluetoothHCIEventEncryptionKeyRefreshCompleteResults *); + virtual IOReturn BluetoothHCIReadInquiryMode(BluetoothHCIRequestID inID, BluetoothHCIInquiryMode *); + virtual IOReturn BluetoothHCIWriteInquiryMode(BluetoothHCIRequestID inID, BluetoothHCIInquiryMode); + virtual IOReturn BluetoothHCIReadSimplePairingMode(BluetoothHCIRequestID inID, BluetoothHCISimplePairingMode *); + virtual IOReturn BluetoothHCIWriteSimplePairingMode(BluetoothHCIRequestID inID, BluetoothHCISimplePairingMode); + virtual IOReturn BluetoothHCIReadLocalOOBData(BluetoothHCIRequestID inID, BluetoothHCIReadLocalOOBDataResults *); + virtual IOReturn BluetoothHCIReadInquiryResponseTransmitPower(BluetoothHCIRequestID inID, BluetoothHCITransmitPowerLevel *); + virtual IOReturn BluetoothHCIWriteInquiryResponseTransmitPower(BluetoothHCIRequestID inID, BluetoothHCITransmitPowerLevel); + virtual IOReturn BluetoothHCISendKeypressNotification(BluetoothHCIRequestID inID, const BluetoothDeviceAddress * inAddressPtr, UInt8); + virtual IOReturn BluetoothHCIReadDefaultErroneousDataReporting(BluetoothHCIRequestID inID, BluetoothHCIErroneousDataReporting *); + virtual IOReturn BluetoothHCIWriteDefaultErroneousDataReporting(BluetoothHCIRequestID inID, BluetoothHCIErroneousDataReporting); + virtual IOReturn BluetoothHCIReadAFHChannelAssessmentMode(BluetoothHCIRequestID inID, BluetoothHCIAFHChannelAssessmentMode *); + virtual IOReturn BluetoothHCIWriteAFHChannelAssessmentMode(BluetoothHCIRequestID inID, BluetoothHCIAFHChannelAssessmentMode); + virtual IOReturn BluetoothHCISetAFHHostChannelClassification(BluetoothHCIRequestID inID, BluetoothAFHHostChannelClassification *); + virtual IOReturn BluetoothHCIReadInquiryScanType(BluetoothHCIRequestID inID, BluetoothHCIInquiryScanType *); + virtual IOReturn BluetoothHCIWriteInquiryScanType(BluetoothHCIRequestID inID, BluetoothHCIInquiryScanType); + virtual IOReturn BluetoothHCIReadPageScanType(BluetoothHCIRequestID inID, BluetoothHCIPageScanType *); + virtual IOReturn BluetoothHCIWritePageScanType(BluetoothHCIRequestID inID, BluetoothHCIPageScanType); + + virtual IOReturn BluetoothHCIReadLocalVersionInformation(BluetoothHCIRequestID inID, BluetoothHCIVersionInfo * outVersionInfo); + virtual IOReturn BluetoothHCIReadLocalSupportedCommands(BluetoothHCIRequestID inID, BluetoothHCISupportedCommands * outCommands); + virtual IOReturn BluetoothHCIReadLocalSupportedFeatures(BluetoothHCIRequestID inID, BluetoothHCISupportedFeatures * outFeatures); + virtual IOReturn BluetoothHCIReadLocalExtendedFeatures(BluetoothHCIRequestID inID, UInt8, BluetoothHCIExtendedFeaturesInfo * outFeatures); + virtual IOReturn BluetoothHCIReadBufferSize(BluetoothHCIRequestID inID, BluetoothHCIBufferSize * outSize); + virtual IOReturn BluetoothHCIReadCountryCode(BluetoothHCIRequestID inID, BluetoothHCICountryCode * outCountryCode); + virtual IOReturn BluetoothHCIReadDeviceAddress(BluetoothHCIRequestID inID, BluetoothDeviceAddress * outAddress); + virtual IOReturn BluetoothHCIReadFailedContactCounter(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCIFailedContactInfo * outFailedContactCount); + virtual IOReturn BluetoothHCIResetFailedContactCounter(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle); + virtual IOReturn BluetoothHCIGetLinkQuality(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCILinkQualityInfo * outLinkQualityInfo); + virtual IOReturn BluetoothHCIReadRSSI(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCIRSSIInfo * outRSSIInfo); + virtual IOReturn BluetoothHCIReadAFHChannelMap(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothAFHResults * outAFHResults); + virtual IOReturn BluetoothHCIReadClock(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, UInt8, BluetoothReadClockInfo * outClockInfo); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual IOReturn BluetoothHCIReadEncryptionKeySize(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCIEncryptionKeySizeInfo * outEncryptionKeySizeInfo); +#endif + virtual IOReturn BluetoothHCICreateConnectionCancel(BluetoothHCIRequestID inID, const BluetoothDeviceAddress *, BluetoothDeviceAddress *); + virtual IOReturn BluetoothHCIRemoteNameRequestCancel(BluetoothHCIRequestID inID, const BluetoothDeviceAddress *, BluetoothDeviceAddress *); + virtual IOReturn BluetoothHCIReadLMPHandle(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCIReadLMPHandleResults * outLMPHandleResults); + + virtual IOReturn BluetoothHCIReadLoopbackMode(BluetoothHCIRequestID inID, BluetoothHCILoopbackMode * inLoopbackMode); + virtual IOReturn BluetoothHCIWriteLoopbackMode(BluetoothHCIRequestID inID, BluetoothHCILoopbackMode inLoopbackMode); + virtual IOReturn BluetoothHCIEnableDeviceUnderTestMode(BluetoothHCIRequestID inID); + virtual IOReturn BluetoothHCIWriteSimplePairingDebugMode(BluetoothHCIRequestID inID, BluetoothSimplePairingDebugMode inSimplePairingDebugMode); + + virtual IOReturn VendorCommand(BluetoothHCIRequestID inID, BluetoothHCIVendorCommandSelector inSelector, UInt8 * inCommandData, IOByteCount inCommandDataSize, IOByteCount outBufferSize, + UInt8 * outBuffer); + + virtual IOReturn BluetoothHCIBroadcomReadRawRSSI(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, BluetoothHCIRSSIInfo * outRSSIInfo); + virtual IOReturn BluetoothHCIBroadcomBFCSuspend(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle); + virtual IOReturn BluetoothHCIBroadcomBFCResume(BluetoothHCIRequestID inID, BluetoothConnectionHandle inConnectionHandle, const BluetoothDeviceAddress * inAddressPtr, + BluetoothBroadcomBFCReconnectData *); + virtual IOReturn BluetoothHCIBroadcomBFCReadParams(UInt32, BluetoothBroadcomBFCParams *); + virtual IOReturn BluetoothHCIBroadcomBFCSetParams(UInt32, BluetoothBroadcomBFCParams *); + virtual IOReturn BluetoothHCIBroadcomSetTransmitPower(UInt32, UInt16, SInt8); + virtual IOReturn BluetoothHCIBroadcomBFCReadRemoteBPCSFeatures(UInt32, UInt16, BluetoothBroadcomBFCRemoteBPCSFeatures *); + virtual IOReturn BluetoothHCIBroadcomBFCWriteScanEnable(UInt32, UInt8); + virtual IOReturn BluetoothHCIBroadcomBFCCreateConnection(UInt32, const BluetoothDeviceAddress *, UInt16, BluetoothHCIEventConnectionCompleteResults *); + virtual IOReturn BluetoothHCIBroadcomSetEventMask(UInt32, BluetoothBroadcomSetEventMask *); + virtual IOReturn BluetoothHCIBroadcomReadLocalFirmwareInfo(UInt32, UInt8, BluetoothBroadcomLocalFirmwareInfo *); + virtual IOReturn BluetoothHCIBroadcomBFCReadScanEnable(UInt32, UInt8 *); + virtual IOReturn BluetoothHCIBroadcomBFCIsConnectionTBFCSuspended(UInt32, UInt16, BluetoothBroadcomBFCConnectionTBFCSuspendedInfo *); + virtual IOReturn BluetoothHCIBroadcomSetUSBAutoResume(UInt32, UInt16); + virtual IOReturn BluetoothHCIBroadcomChangeLNAGainCoexsECI(UInt32, UInt8); + virtual IOReturn BluetoothHCIBroadcomTurnOFFDynamicPowerControl(UInt32, UInt8, const BluetoothDeviceAddress *); + virtual IOReturn BluetoothHCIBroadcomIncreaseDecreasePowerLevel(UInt32, const BluetoothDeviceAddress *, UInt8); + virtual IOReturn BluetoothHCIBroadcomARMMemoryPoke(UInt32, UInt32, UInt32, UInt8 *); + virtual IOReturn BluetoothHCIBroadcomARMMemoryPeek(UInt32, UInt32, UInt8 *); + virtual IOReturn BluetoothHCIBroadcomUARTSetSleepmodeParam(UInt32, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt32, UInt8); + virtual IOReturn BluetoothHCIBroadcomReadVerboseConfigVersionInfo(UInt32, BluetoothBroadcomVerboseConfigVersionInfo *); + virtual IOReturn BluetoothHCIBroadcomGetBasicRateACLConnectionStats(); + virtual IOReturn BluetoothHCIBroadcomResetBasicRateACLConnectionStats(); + virtual IOReturn BluetoothHCIBroadcomGetEDRACLConnectionStats(); + virtual IOReturn BluetoothHCIBroadcomIgnoreUSBReset(UInt32, UInt8, UInt8 *); + virtual IOReturn BluetoothHCIBroadcomLighthouseControl(UInt32, UInt8); + virtual IOReturn BluetoothHCIBroadcomLighthouseSetParameters(UInt32, UInt16, UInt16, UInt16, UInt8, UInt8, SInt8, UInt8); + virtual IOReturn BluetoothHCIBroadcomLighthouseDebugQuery(UInt32, UInt8); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual IOReturn BluetoothHCIBroadcomMasterSkipSniffMode(UInt16, UInt8, UInt8, UInt16, UInt16); + virtual IOReturn BluetoothHCIBroadcomLoadPwrRegulatoryFile(UInt8 *, UInt8); +#endif +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + virtual IOReturn BluetoothWriteLocalAddressFromRegistry(); +#endif + +private: + static bool windowServerDidAppear(void * target, void * refCon, IOService * newService, IONotifier * notifier); + static IOReturn windowServerDidAppearAction(OSObject * owner, void * arg0, void * arg1, void * arg2, void * arg3, void * arg4, void * arg5); + + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 0); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 1); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 2); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 3); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 4); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 5); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 6); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 7); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 8); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 9); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 10); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 11); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 12); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 13); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 14); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 15); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 16); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 17); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 18); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 19); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 20); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 21); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 22); + OSMetaClassDeclareReservedUnused(IOBluetoothHostController, 23); + +public: + OSSet * mReporterSet; // 136 + IOReportLegend * mReportLegend; // 144 + IOStateReporter * mPowerStateReporter; // 152 + BluetoothDeviceReporter ** mDeviceReporterList; // 160 + BluetoothDeviceReporter * mActiveDeviceReporter; // 168 + IOSimpleReporter * mAppleBTLEAdvertisingReporter; // 176 + IOSimpleReporter * mLESetAdvertisingDataReporter; // 184 + IONotifier * mWindowServerNotifier; // 192 + IOWorkLoop * mWorkLoop; // 200 + IOCommandGate * mCommandGate; // 208 + IOBluetoothHCIRequest * mBusyQueueHead; // 216 + IOBluetoothHCIRequest * mWaitQueueHead; // 224 + IOBluetoothHCIRequest ** mHCIRequestList; // 232 + IOByteCount mHCIRequestListSize; // 240 + BluetoothHCIRequestID mCurrentRequestID; // 248 + + IOBluetoothDevice * mDeviceListHead; // 256 + UInt8 * mEventDataBuffer; // 264, size is 2048 + IOByteCount mEventDataBufferSize; // 272 + UInt8 mNumberOfLowPriorityDevice; // 280 + UInt8 mNumberOfMidPriorityDevice; // 281 + UInt8 mNumberOfHighPriorityDevice; // 282 + UInt8 mNumberOfLowPriorityLEDevice; // 283 + UInt8 mNumberOfMidPriorityLEDevice; // 284 + UInt8 mNumberOfHighPriorityLEDevice; // 285 + BluetoothHCIBufferSize mACLSCOBufferSize; // 286 + BluetoothHCILEBufferSize mLEACLBufferSize; // 294 + + UInt16 mPreviousNumberOfOutstandingLowPriorityACLPackets; // 298 + UInt16 mPreviousNumberOfOutstandingMidPriorityACLPackets; // 300 + UInt16 mPreviousNumberOfOutstandingHighPriorityACLPackets; // 302 + UInt16 mTotalNumberOfPreviousOutstandingACLPackets; // 304, never used + + UInt16 mNumberOfOutstandingLowPriorityACLPackets; // 306 + UInt16 mNumberOfOutstandingMidPriorityACLPackets; // 308 + UInt16 mNumberOfOutstandingHighPriorityACLPackets; // 310 + UInt16 mTotalNumberOfOutstandingACLPackets; // 312 + + UInt32 mNumberOfLowPriorityACLPacketsInQueue; // 316 + UInt32 mNumberOfMidPriorityACLPacketsInQueue; // 320 + UInt32 mNumberOfHighPriorityACLPacketsInQueue; // 324 + UInt32 mTotalNumberOfACLPacketsInAllQueues; // 328 + + UInt16 mNumberOfAllowedLowPriorityACLDataPackets; // 332 + UInt16 mNumberOfAllowedMidPriorityACLDataPackets; // 334 + UInt16 mNumberOfAllowedHighPriorityACLDataPackets; // 336 + + BluetoothHCIACLPacket * mHighPriorityACLPacketsHead; // 344 + BluetoothHCIACLPacket * mHighPriorityACLPacketsTail; // 352 + BluetoothHCIACLPacket * mMidriorityACLPacketsHead; // 360 + BluetoothHCIACLPacket * mMidPriorityACLPacketsTail; // 368 + BluetoothHCIACLPacket * mLowPriorityACLPacketsHead; // 376 + BluetoothHCIACLPacket * mLowPriorityACLPacketsTail; // 384 + + UInt16 mPreviousNumberOfOutstandingLowPriorityLEACLPackets; // 392 + UInt16 mPreviousNumberOfOutstandingMidPriorityLEACLPackets; // 394 + UInt16 mPreviousNumberOfOutstandingHighPriorityLEACLPackets; // 396 + UInt16 mPreviousTotalNumberOfOutstandingLEACLPackets; // 398 + + UInt16 mNumberOfOutstandingLowPriorityLEACLPackets; // 400 + UInt16 mNumberOfOutstandingMidPriorityLEACLPackets; // 402 + UInt16 mNumberOfOutstandingHighPriorityLEACLPackets; // 404 + UInt16 mTotalNumberOfOutstandingLEACLPackets; // 406 + + UInt32 mNumberOfLowPriorityLEACLPacketsInQueue; // 408 + UInt32 mNumberOfMidPriorityLEACLPacketsInQueue; // 412 + UInt32 mNumberOfHighPriorityLEACLPacketsInQueue; // 416 + UInt32 mTotalNumberOfLEACLPacketsInAllQueues; // 420 + + UInt16 mNumberOfAllowedLowPriorityLEACLDataPackets; // 424 + UInt16 mNumberOfAllowedMidPriorityLEACLDataPackets; // 426 + UInt16 mNumberOfAllowedHighPriorityLEACLDataPackets; // 428 + + BluetoothHCIACLPacket * mHighPriorityLEACLPacketsHead; // 432 + BluetoothHCIACLPacket * mHighPriorityLEACLPacketsTail; // 440 + BluetoothHCIACLPacket * mMidriorityLEACLPacketsHead; // 448 + BluetoothHCIACLPacket * mMidPriorityLEACLPacketsTail; // 456 + BluetoothHCIACLPacket * mLowPriorityLEACLPacketsHead; // 464 + BluetoothHCIACLPacket * mLowPriorityLEACLPacketsTail; // 472 + + OSArray * mAllowedIncomingL2CAPChannels; // 480 + UInt32 mDesyncIncomingDataCounter; // 488 + UInt32 mCurrentlyExecutingSequenceNumber; // 492 + OSArray * mAllowedIncomingRFCOMMChannels; // 496 + IOBluetoothHCIControllerConfigState mPreviousControllerConfigState; // 504 + UInt32 unknown2; // 508 + UInt32 unknown3; // 512 + UInt16 unknown4; // 516 + bool unknown5; // 518 + UInt8 * mSCOPacketBuffer; // 520 + UInt16 mNumBufferedSCOBytes; // 528 + AbsoluteTime mBufferedSCOPacketTimestamp; // 536 + IOBluetoothInactivityTimerEventSource * mIdleTimer; // 544 + UInt32 mNumSCODataInQueue; // 552 + UInt32 mCurrentlyExecutingSCOSequenceNumber; // 556 + bool mNeedToCleanUpWaitForAckQueue; // 560 + UInt16 mSynchronousConnectionPacketType; // 562 + + HearingDeviceListType * mConnectedHearingDeviceListHead; // 568 + HearingDeviceListType * mConnectedHearingDeviceListTail; // 576 + + BluetoothHCISetupSynchronousConnectionParams mSetupSynchronousConnectionParams; // 584 + BluetoothConnectionHandle mSetupSynchronousConnectionHandle; // 600 + IOBluetoothDevice * mSetupSynchronousConnectionDevice; // 608 + BluetoothDeviceAddress * mSetupSynchronousConnectionDeviceAddress; // 616 + + BluetoothHCIEnhancedSetupSynchronousConnectionParams mEnhancedSetupSynchronousConnectionParams; // 624 + BluetoothConnectionHandle mEnhancedSetupSynchronousConnectionHandle; // 704 + IOBluetoothDevice * mEnhancedSetupSynchronousConnectionDevice; // 712 + BluetoothDeviceAddress * mEnhancedSetupSynchronousConnectionDeviceAddress; // 720 + + IOByteCount mTotalDataBytesSent; // 728 + IOByteCount mTotalDataBytesReceived; // 736 + IOByteCount mTotalSCOBytesReceived; // 744 + bool mKillAllPendingRequestsCalled; // 752 + bool mScanEnabled; // 753 + uint8_t __reserved0[6]; // 754 + + BluetoothSetEventMask mSetEventMask; // 760 + BluetoothSetEventMask mPreviousSetEventMask; // 768 + BluetoothSetEventMask mLESetEventMask; // 776 + BluetoothSetEventMask mPreviousLESetEventMask; // 784 + bool mLESetAdvertisingEnabled; // 792 + bool mLESetScanEnabled; // 793 + + OSSet * mHostControllerClients; // 800 +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + LEDeviceListType * mLEDeviceListHead; // 808 + LEDeviceListType * mLEDeviceListTail; // 816 +#endif + IOBluetoothHCIController * mBluetoothFamily; // 824 + IOBluetoothHostControllerTransport * mBluetoothTransport; // 832 + IOWorkQueue * mControllerWorkQueue; // 840 + IOWorkQueue * mReporterWorkQueue; // 848 + UInt16 __reserved1; // 856 + UInt16 mVendorID; // 858 + UInt16 mProductID; // 860 + + UInt32 mLocationID; // 864 + BluetoothDeviceAddress mDeviceAddress; // 868 + bool mBuiltIn; // 874 + bool mHostControllerVariablesInitialized; // 875 + bool mControllerSetupIsComplete; // 876 + bool mTransportIsReady; // 877 + bool mTransportIsGoingAway; // 878 + UInt8 mControllerSetupState; // 879 + UInt16 mActiveControllerType; // 880 + UInt8 unknown6; // 882 + UInt8 unknown7; // 883 + UInt8 unknown8; // 884 + bool mNeedToWaitForPowerStateChangeToOn; // 885 + bool mSupportNewIdlePolicy; // 886 + bool mSupportPowerOff; // 887 + bool mSupportConcurrentCreateConnection; // 888 + UInt8 mNumberOfTimedOutHCICommands; // 889 + UInt32 mTransportSleepType; // 892 + + bool mCanDoHardReset; // 896 + bool mTransportPowerOn; // 897 + + IOBluetoothHCIControllerPowerOptions mControllerPowerOptions; // 900 + IOBluetoothHCIControllerConfigState mControllerConfigState; // 904 + IOBluetoothHCIControllerFeatureFlags mControllerFeatureFlags; // 908 + UInt8 mNumberOfCommandsAllowedByHardware; // 912 + bool mWaitingForACLPackets; // 913 + UInt8 mNumSCOConnections; // 914 + UInt64 mTotalSCOBytesSent; // 920 + UInt16 mActiveConnections; // 928 + UInt8 mNextNewSynchronousConnectionType; // 930 + + bool mNeedToGetCurrentUSBIsochFrameNumber; // 931 + UInt16 unknown9; // 932, setted to 256 + UInt16 mMaxPower; // 934 + UInt16 unknownb; // 936 + UInt16 unknownc; // 938 + BluetoothHCIVersionInfo mLocalVersionInfo; // 940 + + UInt32 mVendorCommandSelector; // 952 + UInt8 mNumConfiguredHIDDevices; // 956 + UInt8 unknownd; // 957 + bool mSupportWoBT; // 958 + bool unknowne; // 959 + + UInt32 unknownf; // 960 + UInt8 unknown10; // 964 + UInt8 unknown11; // 965 + UInt8 unknown12; // 966 + UInt8 unknown13; // 967 + bool mIgnoreUSBResetCmdSent; // 968 + UInt8 unknown14; // 969 + bool mSupportDeepIdle; // 970 + UInt8 unknown15; // 971 + bool mWaitingForCompletedHCICommandsToSleep; // 972 calls transport completepowerstatechange + + int64_t mAppleBTLEAdvertisingReport[15]; // 976 + int64_t mTotalNumberofBTLEAdvertisingReportsReceived; // 1096 + int64_t mTotalNumberOfTimesBluetoothIdleTimerExpired; // 1104 + bool mPowerReportersCreated; // 1112 + int64_t mLESetAdvertisingData[15]; // 1120 + int64_t mTotalNumberOfLESetAdvertisingDataCommandSent; // 1240 + + // Idle timer + bool mIdleTimerDisabled; // 1248 + bool mPowerStateChanging; // 1249 + bool mHandlingIdleTimeout; // 1250 + UInt32 mPendingIdleTimerValue; // 1252 + UInt32 mIdleTimerValue; // 1256 + bool mIdleTimerValueSet; // 1260 + UInt32 mIdleTimerTime; // 1264, the one functions actually use + UInt32 mNVRAMIdleTimerValue; // 1268 + bool mSetNVRAMIdleTimerValue; // 1272 + bool mClearNVRAMIdleTimerValue; // 1273 + UInt32 mTransportIdleTimerValue; // 1276 + bool mSupportIdleTimer; // 1280 + + bool mUpdatingFirmware; // 1281 + bool mPendingRequestsState; // 1282, processing = 1, kill = 0 + bool mLEConnectionCompleteOutOfSequence; // 1283 + UInt16 mControllerOutstandingCalls; // 1284 + bool mSystemNotReadyForSleep; // 1286 + bool mSupportDPLE; // 1287 + os_log_t mInternalOSLogObject; // 1288 + bool mAutoResumeSet; // 1296 + bool mACLPacketCausedFullWake; // 1297 +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + bool mHardResetPerformed; // 1298 +#endif + UInt32 mHardResetCounter; // 1300 +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + bool mHardResetDuringBoot; // 1304 + bool mSupportLighthouseFeature; // 1305 + bool mSendExitHIDSuspendPacket; // 1306 + UInt8 mAllowedNumberOfTimedOutHCICommands; // 1307 + UInt32 mCreateLEDeviceCallTime; // 1308 + bool mBluetoothdNotFound; // 1312 +#else + bool mHardResetPerformed; /// 1304 +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + UInt32 mCreateLEDeviceCallTime; /// 1308 + bool mHardResetDuringBoot; /// 1312 +#endif +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + bool mSupportLighthouseFeature; /// 1313 + bool mSendExitHIDSuspendPacket; /// 1314 +#endif +#endif + + struct ExpansionData + { + void * refCon; + }; + ExpansionData * mIOBluetoothHostControllerExpansionData; // 1320 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothInactivityTimerEventSource.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothInactivityTimerEventSource.h new file mode 100644 index 0000000..3b57af3 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothInactivityTimerEventSource.h @@ -0,0 +1,88 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOBLUETOOTHINACTIVITYTIMEREVENTSOURCE_H +#define _IOKIT_IOBLUETOOTHINACTIVITYTIMEREVENTSOURCE_H + +#include + +class IOBluetoothInactivityTimerEventSource : public IOTimerEventSource +{ + OSDeclareDefaultStructors(IOBluetoothInactivityTimerEventSource) + +public: + virtual void updateTimer(); + virtual void handleTimer(OSObject * owner); + + static IOBluetoothInactivityTimerEventSource * createWithTimeoutInterval(AbsoluteTime interval, OSObject * owner, Action action = NULL); + static IOBluetoothInactivityTimerEventSource * createWithTimeoutIntervalMS(UInt32 ms, OSObject * owner, Action action = NULL); + static IOBluetoothInactivityTimerEventSource * createWithTimeoutIntervalUS(UInt32 us, OSObject * owner, Action action = NULL); + + /*! @function init + * @abstract Initializes the timer with an owner, and a handler to call when the timeout expires. + * @discussion This functions starts by calling IOTimerEventSource::init() with IOBluetoothInactivityTimerEventSource::timerFired as its timeout handler. Afterwards, it initializes + * mActivityCount to 0 and sets mTimeoutHandler to the parameter action. + * @param owner The owner of the timer. + * @param action A handler to call when the timeout expires. + * @result A true is returned on success and a false is returned on failure. + */ + + virtual bool init(OSObject * owner, Action action = NULL) APPLE_KEXT_OVERRIDE; + virtual bool initWithTimeoutInterval(AbsoluteTime interval, OSObject * owner, Action action = NULL); + virtual bool initWithTimeoutIntervalMS(UInt32 ms, OSObject * owner, Action action = NULL); + virtual bool initWithTimeoutIntervalUS(UInt32 us, OSObject * owner, Action action = NULL); + + static void timerFired(OSObject * owner, IOBluetoothInactivityTimerEventSource * sender); + virtual IOReturn setTimeout(AbsoluteTime interval) APPLE_KEXT_OVERRIDE; + virtual void cancelTimeout() APPLE_KEXT_OVERRIDE; + + virtual IOReturn setTimeoutInterval(AbsoluteTime interval); + virtual IOReturn setTimeoutIntervalMS(UInt32 ms); + virtual IOReturn setTimeoutIntervalUS(UInt32 us); + virtual AbsoluteTime getTimeoutInterval(); + virtual UInt32 getTimeoutIntervalMS(); + virtual UInt32 getTimeoutIntervalUS(); + + virtual void incrementActivityCount(); + virtual void decrementActivityCount(); + virtual UInt32 getActivityCount(); + + virtual IOReturn resetTimer(); + +protected: + AbsoluteTime mTimeoutInterval; // 96 + UInt32 mActivityCount; // 104 + Action mTimeoutHandler; // 112 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothInternal.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothInternal.h new file mode 100644 index 0000000..51a6ae3 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothInternal.h @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2021 Apple Inc. All rights reserved. + * Copyright (c) 2021 cjiang. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/*! + * @header IOBluetoothInternal.h + * This header contains internal types and macros needed by public IOBluetooth kernel APIs. + */ + +#pragma once + +typedef enum IOBluetoothHCIControllerConfigState +{ + kIOBluetoothHCIControllerConfigStateOnline, // Controller is configured and ready for clients + kIOBluetoothHCIControllerConfigStateKernelSetupPending, // New controller - kernel setup in progress + kIOBluetoothHCIControllerConfigStateDaemonSetupPending, // New controller - daemon setup in progress + kIOBluetoothHCIControllerConfigStateDaemonSetupComplete, // New controller - daemon setup complete + kIOBluetoothHCIControllerConfigStateResetPending, // HCI reset has been issued + kIOBluetoothHCIControllerConfigStateKernelPostResetSetupPending, // HCI reset complete - kernel setup in progress + kIOBluetoothHCIControllerConfigStateDaemonPostResetSetupPending, // HCI reset complete - daemon setup in progress + kIOBluetoothHCIControllerConfigStateDaemonPostResetSetupComplete, // HCI reset complete - daemon setup complete + kIOBluetoothHCIControllerConfigStateUninitialized +} IOBluetoothHCIControllerConfigState; + +typedef UInt32 IOBluetoothHCIControllerPowerOptions; +enum +{ + kIOBluetoothHCIControllerPowerOptionPowerOffSupported = 0x00000001, + kIOBluetoothHCIControllerPowerOptionWakeFromExistingConnectionSupported = 0x00000002, + kIOBluetoothHCIControllerPowerOptionWakeFromNewConnectionSupported = 0x00000004, + kIOBluetoothHCIControllerPowerOptionIdleWithConnectionSupported = 0x00000008, + kIOBluetoothHCIControllerPowerOptionIdleWhenInternalPower = 0x00000010 +}; + +enum IOBluetoothHCIControllerSleepOptions +{ + kIOBluetoothHCIControllerAllowWakeFromExistingConnection = 0x00000001, + kIOBluetoothHCIControllerAllowWakeFromNewConnection = 0x00000002, + kIOBluetoothHCIControllerTemporaryOnFromIdle = 0x00000004 +}; + +#define HCI_CONTROLLER_POWER_OFF_SUPPORTED(_controllerPowerOptions) \ + ((_controllerPowerOptions & kIOBluetoothHCIControllerPowerOptionPowerOffSupported) == kIOBluetoothHCIControllerPowerOptionPowerOffSupported) +#define HCI_CONTROLLER_SLEEP_SUPPORTED(_controllerPowerOptions) \ + ((_controllerPowerOptions & (kIOBluetoothHCIControllerPowerOptionWakeFromExistingConnectionSupported | kIOBluetoothHCIControllerPowerOptionWakeFromNewConnectionSupported))) + +typedef enum IOBluetoothHCIControllerInternalPowerState +{ + kIOBluetoothHCIControllerInternalPowerStateOff = 0, + kIOBluetoothHCIControllerInternalPowerStateOn = 1, + kIOBluetoothHCIControllerInternalPowerStateSleep = 2, + kIOBluetoothHCIControllerInternalPowerStateIdle = 3 +} IOBluetoothHCIControllerInternalPowerState; + +enum IOBluetoothHCIControllerPowerStateOrdinal +{ + kIOBluetoothHCIControllerPowerStateOrdinalOff = 0, + kIOBluetoothHCIControllerPowerStateOrdinalIdle = 1, + kIOBluetoothHCIControllerPowerStateOrdinalOn = 2, + kIOBluetoothHCIControllerPowerStateOrdinalCount +}; + +typedef UInt32 IOBluetoothHCIControllerFeatureFlags; +enum +{ + kIOBluetoothHCIControllerFeatureFlagVendorCommandFlowControl = 0x00000001, + kIOBluetoothHCIControllerFeatureFlagSCOSupported = 0x00000002, + kIOBluetoothHCIControllerFeatureFlagSerializeCommands = 0x10000000 +}; + +typedef struct IOBluetoothHCIUnifiedInquiryResult +{ + BluetoothHCIInquiryResult originalInquiryResult; + + /*! @var eventCode + * This value should be kBluetoothHCIEventInquiryResult, kBluetoothHCIEventInquiryResultWithRSSI, or kBluetoothHCIEventExtendedInquiryResult. */ + + BluetoothHCIEventCode eventCode; + + /*! @var extendedInquiryResponse + * This value should be kBluetoothHCIEventExtendedInquiryResult only. */ + + BluetoothHCIExtendedInquiryResponse extendedInquiryResponse; + + UInt8 reserved; + + /*! @var RSSIValue + * This value should be kBluetoothHCIEventExtendedInquiryResult or kBluetoothHCIEventInquiryResultWithRSSI only. */ + + BluetoothHCIRSSIValue RSSIValue; +} IOBluetoothHCIUnifiedInquiryResult; + +enum BluetoothHCIExtendedInquiryResponseDataTypesAppleSpecificInfo +{ + kBluetoothHCIExtendedInquiryResponseDataTypeAppleSpecificInfoReserved = 0x00, + kBluetoothHCIExtendedInquiryResponseDataTypeAppleSpecificInfoModelIdentifier = 0x01, /* UTF8String char data */ + kBluetoothHCIExtendedInquiryResponseDataTypeAppleSpecificInfoThirdPartyAdvertising = 0x02, +}; + +#define REQUIRE(err) os_log(OS_LOG_DEFAULT, "REQUIRE failure: %s - file: %s:%d\n", err, __FILE__, __LINE__) +#define CHECK(err) os_log(OS_LOG_DEFAULT, "CHECK failure: %s - file: %s:%d\n", err, __FILE__, __LINE__) +#define REQUIRE_NO_ERR(err) os_log(OS_LOG_DEFAULT, "REQUIRE_NO_ERR failure: 0x%x - file: %s:%d\n", err, __FILE__, __LINE__) + +#define BluetoothFamilyLogPacket(family, type, format, ...) do { \ + _Static_assert(__builtin_constant_p(format), "format string must be constant"); \ + char * _pkt_log = (char *) IOMalloc(0x1FF); \ + if ( _pkt_log ) { \ + bzero(_pkt_log, 0x1FF); \ + snprintf(_pkt_log, 0x1FF, format, ##__VA_ARGS__); \ + if (family) { \ + family->LogPacket(type, _pkt_log, strlen(_pkt_log)); } \ + IOFree(_pkt_log, 0x1FF); \ + } \ + __asm__(""); /* avoid tailcall */ \ +} while (0) + +#define OSLogAndLogPacket(log, family, type, format, ...) do { \ + os_log(log, format, ##__VA_ARGS__); \ + BluetoothFamilyLogPacket(family, type, format, ##__VA_ARGS__); \ +} while (0) diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothMemoryBlock.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothMemoryBlock.h new file mode 100644 index 0000000..40715b9 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothMemoryBlock.h @@ -0,0 +1,294 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOBLUETOOTHMEMORYBLOCK_H +#define _IOKIT_IOBLUETOOTHMEMORYBLOCK_H + +#include +#include +#include + +class IOBluetoothMemoryBlock : public OSObject +{ + OSDeclareDefaultStructors(IOBluetoothMemoryBlock) + + typedef void (*IOBluetoothMemoryBlockCallBack)(IOBluetoothMemoryBlock * target, IOOptionBits options, UInt64 arg0, UInt64 arg1, UInt64 arg2, UInt64 arg3, UInt64 arg4); + +public: + static IOBluetoothMemoryBlock * withAddress(void * address, IOByteCount withLength, IODirection withDirection); + static IOBluetoothMemoryBlock * withCapacity(IOByteCount capacity, IODirection direction); + static IOBluetoothMemoryBlock * withSubBlock(IOBluetoothMemoryBlock * subBlock, IODirection direction); + + virtual bool initWithAddress(void * address, IOByteCount withLength, IODirection withDirection); + virtual bool initWithCapacity(IOByteCount capacity, IODirection direction); + virtual bool initWithSubBlock(IOBluetoothMemoryBlock * subBlock, IODirection direction); + + virtual bool init() APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual IOByteCount readBytes(IOByteCount offset, void * bytes, IOByteCount length); + virtual IOByteCount writeBytes(IOByteCount offset, const void * bytes, IOByteCount length); + virtual IODirection getDirection(); + virtual IOByteCount getLength(); + + virtual IOReturn appendBlock(IOBluetoothMemoryBlock * block); + virtual IOBluetoothMemoryBlock * getBlock(); + + virtual IOReturn setCallBack(IOBluetoothMemoryBlockCallBack callBack, UInt64 data1, UInt64 data2, UInt64 data3, UInt64 data4, UInt64 data5); + virtual bool sent(IOOptionBits status); + virtual bool hasCallBack(); + virtual IOOptionBits packetSentStatus(); + +protected: + void * mBytes; // 16 + IOByteCount mBytesLength; // 24 + bool mIsWithCapacity; // 32 + IOBluetoothMemoryBlock * mSubBlock; // 40 + IODirection mDirection; // 48 + IOBluetoothMemoryBlockCallBack mCallBack; // 56 + UInt64 mCallBackArgs[5]; // 64 + IOOptionBits mPacketSentStatus; // 104 +}; + +class IOBluetoothL2CAPMemoryBlock : public IOBluetoothMemoryBlock +{ + OSDeclareDefaultStructors(IOBluetoothL2CAPMemoryBlock) + +public: + static IOBluetoothL2CAPMemoryBlock * withAddress(void * address, IOByteCount withLength, IODirection withDirection); + static IOBluetoothL2CAPMemoryBlock * withCapacity(IOByteCount capacity, IODirection direction); + static IOBluetoothL2CAPMemoryBlock * withSubBlock(IOBluetoothMemoryBlock * subBlock, IODirection direction); + + virtual bool init() APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual IOByteCount readBytes(IOByteCount offset, void * bytes, IOByteCount length) APPLE_KEXT_OVERRIDE; + virtual IOByteCount writeBytes(IOByteCount offset, const void * bytes, IOByteCount length) APPLE_KEXT_OVERRIDE; + virtual IOByteCount getLength() APPLE_KEXT_OVERRIDE; + + virtual BluetoothL2CAPChannelID readChannelID(); + virtual void writeChannelID(BluetoothL2CAPChannelID channelID); + +protected: + BluetoothL2CAPChannelID mChannelID; // 108 +}; + +extern UInt16 IOBluetoothL2CAPFCS(UInt16, UInt8); + +class IOBluetoothL2CAPSupervisoryFrameMemoryBlock : public IOBluetoothL2CAPMemoryBlock +{ + OSDeclareDefaultStructors(IOBluetoothL2CAPSupervisoryFrameMemoryBlock) + + typedef UInt8 SupervisoryFunctionMask; + +public: + static IOBluetoothL2CAPSupervisoryFrameMemoryBlock * withDirection(IODirection direction); + + virtual bool init() APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual bool sent(IOOptionBits status) APPLE_KEXT_OVERRIDE; + virtual bool hasCallBack() APPLE_KEXT_OVERRIDE; + + virtual IOByteCount readBytes(IOByteCount offset, void * bytes, IOByteCount length) APPLE_KEXT_OVERRIDE; + virtual IOByteCount writeBytes(IOByteCount offset, void * bytes, IOByteCount length); + virtual IOByteCount getLength() APPLE_KEXT_OVERRIDE; + + UInt8 getSupervisoryFunctionMask(UInt16); + virtual UInt8 getSupervisoryFunctionMask(); + virtual UInt8 setSupervisoryFunctionMask(SupervisoryFunctionMask mask); + + bool getRetransmissionDisableBit(UInt16); + virtual bool getRetransmissionDisableBit(); + virtual UInt8 setRetransmissionDisableBit(bool); + + UInt8 getReceiveSequenceNumber(UInt16); + virtual UInt8 getReceiveSequenceNumber(); + virtual UInt8 setReceiveSequenceNumber(UInt8); + + virtual IOReturn readFCS(UInt16 *); + virtual IOReturn writeFCS(UInt16); + +protected: + UInt16 mStandardControlField; // 110 + UInt16 mFrameCheckSequence; // 112 +}; + +class IOBluetoothL2CAPInformationFrameMemoryBlock : public IOBluetoothL2CAPSupervisoryFrameMemoryBlock +{ + OSDeclareDefaultStructors(IOBluetoothL2CAPInformationFrameMemoryBlock) + + typedef UInt16 SegmentationAndReassemblyMask; + +public: + static IOBluetoothL2CAPInformationFrameMemoryBlock * withDataFromBlock(IOBluetoothL2CAPInformationFrameMemoryBlock * block, IOByteCount offset, IOByteCount size, IODirection direction); + virtual bool initWithDataFromBlock(IOBluetoothL2CAPInformationFrameMemoryBlock * block, IOByteCount offset, IOByteCount size, IODirection direction); + + virtual bool init() APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual UInt64 readBytes(IOByteCount offset, void * bytes, IOByteCount length) APPLE_KEXT_OVERRIDE; + virtual UInt64 writeBytes(IOByteCount offset, void * bytes, IOByteCount length) APPLE_KEXT_OVERRIDE; + virtual UInt64 getLength() APPLE_KEXT_OVERRIDE; + virtual IOBluetoothMemoryBlock * getBlock() APPLE_KEXT_OVERRIDE; + + virtual bool sent(IOOptionBits status) APPLE_KEXT_OVERRIDE; + virtual bool hasCallBack() APPLE_KEXT_OVERRIDE; + + UInt16 getSegmentationMask(UInt16); + virtual UInt16 getSegmentationMask(); + virtual UInt16 setSegmentationMask(SegmentationAndReassemblyMask); + UInt16 getTransmitSequenceNumber(UInt16); + virtual UInt16 getTransmitSequenceNumber(); + virtual UInt16 setTransmitSequenceNumber(UInt8); + virtual UInt16 getSDU(); + virtual int setSDU(UInt16); + virtual UInt16 getPayload(); + virtual int acked(int); + +protected: + UInt16 mInfoPacketOffset; // 114 + UInt16 mInfoPacketSize; // 116 + UInt16 mSDU; // 118 +}; + +class IOBluetoothRFCOMMMemoryBlock : public IOBluetoothMemoryBlock +{ + OSDeclareDefaultStructors(IOBluetoothRFCOMMMemoryBlock) + +public: + static IOBluetoothRFCOMMMemoryBlock * withAddress(void * address, IOByteCount withLength, IODirection withDirection); + static IOBluetoothRFCOMMMemoryBlock * withCapacity(IOByteCount capacity, IODirection direction); + static IOBluetoothRFCOMMMemoryBlock * withSubBlock(IOBluetoothMemoryBlock * subBlock, IODirection direction); + virtual bool init() APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual UInt64 readBytes(UInt64 offset, void * bytes, UInt64 length) APPLE_KEXT_OVERRIDE; + virtual UInt64 getLength() APPLE_KEXT_OVERRIDE; + virtual UInt64 getLogicalLength(); + + virtual UInt8 readAddressByte(); + virtual void writeAddressByte(UInt8 whatByte); + virtual UInt8 readControlByte(); + virtual void writeControlByte(UInt8 whatByte); + virtual UInt8 readFCFByte(); + virtual void writeFCFByte(UInt8 whatByte); + virtual UInt8 readHeaderBytes(void * bytes, UInt64 length); + virtual UInt64 writeBytes(UInt64 offset, void * bytes, UInt64 length); + +protected: + UInt8 mAddressByte; // 108 + UInt8 mControlByte; // 109 + UInt16 mHeaderBytes; // 110 + UInt8 mHeaderBytesSize; // 112 + UInt8 mFCFByte; // 113 +}; + +class IOBluetoothACLMemoryDescriptor : public IOGeneralMemoryDescriptor +{ + OSDeclareDefaultStructors(IOBluetoothACLMemoryDescriptor) + +public: + static IOBluetoothACLMemoryDescriptor * withL2CAPMemoryBlock(IOBluetoothL2CAPMemoryBlock * block, UInt64, UInt64 withOffset, UInt16, IOOptionBits options, bool asReference = false); + + virtual bool initWithAddress(void * address, IOByteCount withLength, IODirection withDirection); + virtual bool initWithAddress(IOVirtualAddress address, IOByteCount withLength, IODirection withDirection, task_t withTask); + virtual bool initWithPhysicalAddress(IOPhysicalAddress address, IOByteCount withLength, IODirection withDirection); + virtual bool initWithPhysicalRanges(IOPhysicalRange * ranges, UInt32 withCount, IODirection withDirection, bool asReference = false); + virtual bool initWithRanges(IOVirtualRange * ranges, UInt32 withCount, IODirection withDirection, task_t withTask, bool asReference = false); + virtual bool initWithL2CAPMemoryBlock(IOBluetoothL2CAPMemoryBlock * block, UInt64, UInt64 withOffset, UInt16, IOOptionBits options, bool asReference = false); + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual IOByteCount readBytes(IOByteCount offset, void * bytes, IOByteCount withLength) APPLE_KEXT_OVERRIDE; + virtual IOByteCount writeBytes(IOByteCount offset, const void * bytes, IOByteCount withLength) APPLE_KEXT_OVERRIDE; + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone) APPLE_KEXT_OVERRIDE; + virtual IOReturn complete(IODirection forDirection = kIODirectionNone) APPLE_KEXT_OVERRIDE; + + virtual IOByteCount getLength() const APPLE_KEXT_OVERRIDE; + virtual IOByteCount getPayloadLength(); + virtual bool sent(IOOptionBits status); + virtual int packetSentStatus(); + virtual bool hasCallBack(); + virtual BluetoothConnectionHandle getConnectionHandle(); + virtual void setPacketSentStatusToInvalid(); + + bool prepareHCIBlock(); + +protected: + IOBluetoothMemoryBlock * mBlock; // 176 + IOByteCount mBuffersOffset; // 184 + IOByteCount mLength; // 192 + BluetoothConnectionHandle mConnectionHandle; // 200 + UInt16 mHeaderBytes; // 202 + UInt32 unknown1; // 204 + bool mAsReference; // 208 + IOOptionBits mPacketSentStatus; // 212 + void * mData; // 216 + IOByteCount mDataSize; // 224 + uint64_t reserved1[2]; // 232 + uint16_t reserved2; // 248 + uint8_t reserved3; // 250 +}; + +class IOBluetoothMemoryDescriptorRetainer : public OSObject +{ + OSDeclareDefaultStructors(IOBluetoothMemoryDescriptorRetainer) + + struct MemoryDescriptorCallBack + { + IOMemoryDescriptor * buffer; + void * data; + void * owner; + IOTimerEventSource * timer; + }; + +public: + virtual bool init() APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + MemoryDescriptorCallBack mMemoryDescriptorCallBack; // 16 +}; + +class IOBluetoothSCOMemoryDescriptorRetainer : public IOBluetoothMemoryDescriptorRetainer +{ + OSDeclareDefaultStructors(IOBluetoothSCOMemoryDescriptorRetainer) + +public: + virtual bool init() APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + +protected: + MemoryDescriptorCallBack mSCOMemoryDescriptorCallBack; // 48 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothMemoryBlockQueue.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothMemoryBlockQueue.h new file mode 100644 index 0000000..651d289 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothMemoryBlockQueue.h @@ -0,0 +1,106 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/*! + * @header IOBluetoothMemoryBlockQueue.h + * This header contains the definition of the IOBluetoothMemoryBlockQueue instance. + */ + +#ifndef _IOKIT_IOBLUETOOTHMEMORYBLOCKQUEUE_H +#define _IOKIT_IOBLUETOOTHMEMORYBLOCKQUEUE_H + +class IOBluetoothMemoryBlock; + +struct IOBluetoothMemoryBlockQueueNode +{ + IOBluetoothMemoryBlock * block; + IOBluetoothMemoryBlockQueueNode * next; + bool completionCalled; +}; + +class IOBluetoothMemoryBlockQueue : public OSObject +{ + OSDeclareDefaultStructors(IOBluetoothMemoryBlockQueue) + +public: + virtual bool init() APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + /*! @function queueIsEmpty + * @abstract Determines if the queue is empty. + * @discussion The queue would be counted as empty if mHeadNode is NULL and mNumEntriesInQueue is 0. + * @result If the queue is empty, the result would be true. Otherwise, it would be false. */ + + virtual bool queueIsEmpty(); + + /*! @function enqueueBlock + * @abstract Adds a new memory block to the tail of the queue. + * @discussion This function adopts the same approach of enqueuing an object as any other queue, but it is not done directly. The block is to be placed into an + * IOBluetoothMemoryBlockQueueNode, which will instead be enqueued. If the function is successfully executed, mNumEntriesInQueue would increment. + * @param block The memory block to enqueue. + * @result An IOReturn indicating whether the operation was successful. */ + + virtual IOReturn enqueueBlock(IOBluetoothMemoryBlock * block); + + /*! @function peekNextBlock + * @abstract Derives the memory block at the head of the queue. + * @result The memory block of mHeadNode. If it does not exist, NULL will be returned. */ + + virtual IOBluetoothMemoryBlock * peekNextBlock(); + + /*! @function enqueueBlock + * @abstract Removes the memory block at the head of the queue. + * @discussion If the queue is not empty, this function will remove mHeadNode by releasing it and moving the next entry to its address. If the function is successfully executed, + * mNumEntriesInQueue would decrement. + * @result The IOBluetoothMemoryBlock that is in the entry dequeued. If nothing is dequeued, it would be NULL. */ + + virtual IOBluetoothMemoryBlock * dequeueBlock(); + + /*! @function flushQueue + * @abstract Removes all entries from the queue. + * @discussion This functions continuously calls dequeueBlock() until there are no more entries left. + * @param releaseBlock If this parameter is true, the IOBluetoothMemoryBlock instances in the entries dequeued will be released. Vice versa.*/ + + virtual void flushQueue(bool releaseBlock); + virtual UInt32 numberOfEntriesInQueue(); + virtual IOReturn setCompletionCalled(IOBluetoothMemoryBlock * block); + virtual bool completionRoutineIsCalled(); + virtual IOReturn removeBlock(IOBluetoothMemoryBlock * block); + virtual void printQueue(); + +protected: + IOBluetoothMemoryBlockQueueNode * mHeadNode; // 16 + IOBluetoothMemoryBlockQueueNode * mTailNode; // 24 + UInt32 mNumEntriesInQueue; // 32 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothObject.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothObject.h new file mode 100644 index 0000000..6572544 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothObject.h @@ -0,0 +1,156 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/*! + * @header IOBluetoothObject.h + * This header contains the definition of the IOBluetoothObject class, a base for many classes, mostly channels, in the IOBluetoothFamily. + */ + +#ifndef _IOKIT_IOBLUETOOTHOBJECT_H +#define _IOKIT_IOBLUETOOTHOBJECT_H + +#include +#include +#include + +class IOBluetoothHCIController; + +/*! + * @class IOBluetoothObject : public IOService + * @abstract An abstract class representing an object in the IOBluetoothFamily. + * @discussion The IOBluetoothObject is the base for a lot of IOBluetooth classes due to its abstractness. Each IOBluetoothObject has a specific object ID, which could be obtained from the family. One + * of its most significant features is to provide handle pending IOs. + */ + +class IOBluetoothObject : public IOService +{ + OSDeclareDefaultStructors(IOBluetoothObject) + +public: + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual bool terminate(IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + + /*! @function willTerminate + * @abstract Passes a termination up the stack. + * @discussion Retains and releases the class per se, runs staticPerformTerminate from the command gate, and calls IOService::willTerminate(). + * @param provider The terminated provider of this object. + * @param options Options originally passed to terminate. + * @result An boolean indicating whether the operation was successful. */ + + virtual bool willTerminate(IOService * provider, IOOptionBits options) APPLE_KEXT_OVERRIDE; + + /*! @function performTerminate + * @abstract Use the command gate to sleep all pending IOs. + * @result For now, this function always returns kIOReturnSuccess. */ + + virtual IOReturn performTerminate(); + + /*! @function staticPerformTerminate + * @abstract Static version of performTerminate, implemented by converting owner to an IOBluetoothObject and calling performTerminate from there. + * @param owner The function's provider that will be converted to an IOBluetoothObject. + * @param arg0 Argument to action from run operation. + * @param arg1 Argument to action from run operation. + * @param arg2 Argument to action from run operation. + * @param arg3 Argument to action from run operation. + * @result An IOReturn indicating whether the operation was successful. */ + + static IOReturn staticPerformTerminate(OSObject * owner, void * arg0, void * arg1, void * arg2, void * arg3); + + /*! @function getWorkLoop + * @abstract Returns the current work loop. + * @result The current work loop, specifically mWorkLoop. */ + + virtual IOWorkLoop * getWorkLoop() const APPLE_KEXT_OVERRIDE; + + /*! @function getCommandGate + * @abstract Returns the current command gate. + * @result The current command gate, specifically mCommandGate. */ + + virtual IOCommandGate * getCommandGate() const; + + /*! @function incrementNumberOfPendingIO + * @abstract Increments the number of pending IOs by 1. + * @discussion This function would increment mNumPendingIO by 1 only if the workLoop is inGate() and the integer is within the range of an UInt32. + * @result An IOReturn indicating whether the operation was successful. */ + + virtual IOReturn incrementNumberOfPendingIO(); + + /*! @function decrementNumberOfPendingIO + * @abstract Decrements the number of pending IOs by 1. + * @discussion This function would decrement mNumPendingIO by 1 only if the workLoop is inGate() and the integer is within the range of an UInt32. If there are no pending IOs left after the + * decrement, it would call commandWakeup() to wakeup the threads. + * @result An IOReturn indicating whether the operation was successful. */ + + virtual IOReturn decrementNumberOfPendingIO(); + + /*! @function pendingIO + * @abstract Returns the number of attached pending IOs. + * @result The current number of pending IOs, specifically mNumPendingIO. */ + + virtual UInt32 pendingIO() const; + +protected: + /*! @var mWorkLoop + * The work loop of this class. For now, mCommandGate is the only event source that will be added. + * Offset: 136. */ + IOWorkLoop * mWorkLoop; + + /*! @var mWorkLoop + * The command gate of this class. + * Offset: 144. */ + IOCommandGate * mCommandGate; + + /*! @var mNumPendingIO + * This integer records to number of attached pending IOs. It could be obtained through pendingIO(). + * Offset: 152. */ + UInt32 mNumPendingIO; + + /*! @var mTerminateMask + * This unsigned char is used to mark if the class has been terminated. The second bit is set to true when termiante() is called. + * Offset: 156. */ + UInt8 mTerminateMask; + + /*! @var mBluetoothObjectID + * This integer records the BluetoothObjectID of this class, derived from mBluetoothFamily. + * Offset: 160. */ + UInt32 mBluetoothObjectID; + + /*! @var mBluetoothFamily + * A IOBluetoothHCIController that helps the class with several bluetooth-specific operations. + * Offset: 168. */ + IOBluetoothHCIController * mBluetoothFamily; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothTimerEventSource.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothTimerEventSource.h new file mode 100644 index 0000000..8080cbe --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothTimerEventSource.h @@ -0,0 +1,77 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOBLUETOOTHTIMEREVENTSOURCE_H +#define _IOKIT_IOBLUETOOTHTIMEREVENTSOURCE_H + +#include + +struct IOBluetoothTimer +{ + AbsoluteTime abstime; // 0 + UInt32 index; // 8 + void * refcon; // 16 + bool enabled; // 24 + IOBluetoothTimer * timerChainNext; // 32 +}; + +class IOBluetoothTimerEventSource : public IOTimerEventSource +{ + OSDeclareDefaultStructors(IOBluetoothTimerEventSource) + +public: + static IOBluetoothTimerEventSource * timerEventSource(OSObject * owner, Action action = NULL); + + static void timerAction(OSObject * owner, IOBluetoothTimerEventSource * sender); + virtual void timerFired(IOBluetoothTimerEventSource * sender); + virtual bool init(OSObject * owner, Action action = NULL) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + virtual bool addTimer(AbsoluteTime abstime, UInt32 index, void * refcon); + virtual bool removeTimer(UInt32 index); + virtual bool removeAllTimers(); + + virtual IOReturn setTimeoutMS(UInt32, UInt32, void *); + virtual IOReturn setTimeoutUS(UInt32, UInt32, void *); + virtual IOReturn setTimeout(UInt32, UInt32, UInt32, void *); + virtual IOReturn setTimeout(AbsoluteTime abstime, UInt32, void *); + virtual void cancelTimeout(UInt32); + virtual void cancelTimeout() APPLE_KEXT_OVERRIDE; + +protected: + IOBluetoothTimer * mCurrentTimer; // 96 + OSObject * mOwner; // 104 + Action mTimeoutHandler; // 112 + IOBluetoothTimer * mFiringTimer; // 120 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothTypes.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothTypes.h new file mode 100644 index 0000000..e352d5b --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothTypes.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/*! + * @header IOBluetoothTypes.h + * This header defines IOReturn values specific to IOBluetooth. + */ + +#pragma once + +#import + +// Error returns +#ifndef sub_iokit_bluetooth +#define sub_iokit_bluetooth err_sub(8) +#endif + +#define iokit_bluetooth_err(return ) (sys_iokit | sub_iokit_bluetooth | return ) + +#define kIOBluetoothDeviceResetError iokit_bluetooth_err(1) // Device reset interrupted pending operation +#define kIOBluetoothConnectionAlreadyExists iokit_bluetooth_err(2) // Attempting to open a connection that already exists +#define kIOBluetoothNoHCIController iokit_bluetooth_err(3) // No HCI controller is present +#define kIOBluetoothHCIPowerStatesNotSupported iokit_bluetooth_err(4) // HCI controller does not support changing power states diff --git a/QualcommWireless/include/IOKit/bluetooth/IOBluetoothWorkLoop.h b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothWorkLoop.h new file mode 100644 index 0000000..9a82e4f --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOBluetoothWorkLoop.h @@ -0,0 +1,124 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/*! + * @header IOBluetoothWorkLoop.h + * This header contains the definitions of the IOBluetoothLocalUtilityEventSource and IOBluetoothWorkLoop classes. + */ + +#ifndef _IOKIT_IOBLUETOOTHWORKLOOP_H +#define _IOKIT_IOBLUETOOTHWORKLOOP_H + +#include +#include + +/*! + * @class IOBluetoothLocalUtilityEventSource : public IOEventSource + * @abstract An event source providing utilities specific to the IOBluetooth family. + * @discussion The IOBluetoothLocalUtilityEventSource expands the functionality of its super class, IOEventSource, by implementing the functions closeGateOn() and openGateOn(), as well as a factory + * member function for organized construction of itself. This event source should be used and only used in the IOBluetooth family. + */ + +class IOBluetoothLocalUtilityEventSource : public IOEventSource +{ + OSDeclareDefaultStructors(IOBluetoothLocalUtilityEventSource) + +public: + /*! @function ioBluetoothLocalUtilityEventSource + * @abstract Factory member function to constuct and intialize an IOBluetoothLocalUtilityEventSource. + * @result Returns a IOBluetoothLocalUtilityEventSource instance if constructed successfully, 0 otherwise. + */ + + static IOBluetoothLocalUtilityEventSource * ioBluetoothLocalUtilityEventSource(); + + /*! @function checkForWork + * @abstract Virtual member function used by IOWorkLoop for work scheduling. + * @discussion This function overrides IOEventSource::checkForWork() so that it does nothing. + * @result Returns false. + */ + + virtual bool checkForWork() APPLE_KEXT_OVERRIDE; + + /*! @function closeGateOn + * @abstract Closes gate and sets the work loop. + * @discussion This function calls IOEventSource::setWorkLoop() and then IOEventSource::closeGate(). + * @param workLoop The parameter used in IOEventSource::setWorkLoop(). */ + + virtual void closeGateOn(IOWorkLoop * workLoop); + + /*! @function openGateOn + * @abstract Opens gate and sets the work loop. + * @discussion This function calls IOEventSource::setWorkLoop() and then IOEventSource::openGate(). + * @param workLoop The parameter used in IOEventSource::setWorkLoop(). */ + + virtual void openGateOn(IOWorkLoop * workLoop); +}; + +/*! + * @class IOBluetoothWorkLoop : public IOWorkLoop + * @abstract A work loop instance providing functions used exclusively by the IOBluetooth family. + * @discussion The IOBluetoothWorkLoop provides the functions handoffFrom() and returnTo(), which could help with linking between different work loops, a feature that could be used by the + * IOBluetoothFamily. This class also contains a factory member function for organized construction of itself. This work loop should be used and only used in the IOBluetooth family. + */ + +class IOBluetoothWorkLoop : public IOWorkLoop +{ + OSDeclareDefaultStructors(IOBluetoothWorkLoop) + +public: + /*! @function workLoop + * @abstract Factory member function to construct and intialize an IOBluetoothWorkLoop. + * @result Returns a IOBluetoothWorkLoop instance if constructed successfully, 0 otherwise. + */ + + static IOBluetoothWorkLoop * workLoop(); + + /*! @function handoffFrom + * @abstract Handoffs from a work loop instance. + * @discussion This function will first check if workLoop is inGate(). Then, it calls openGateOn(workLoop) using an IOBluetoothLocalUtilityEventSource instance and closeGate() on this. + * @param workLoop A work loop instance. + * @result An IOReturn indicating whether the operation is successful. + */ + + virtual IOReturn handoffFrom(IOWorkLoop * workLoop); + + /*! @function returnTo + * @abstract Returns to a work loop instance. + * @discussion This function will first check if workLoop is inGate(). Then, it calls openGate() on this and closeGateOn(workLoop) using an IOBluetoothLocalUtilityEventSource instance. + * @param workLoop A work loop instance. + * @result An IOReturn indicating whether the operation is successful. + */ + + virtual IOReturn returnTo(IOWorkLoop * workLoop); +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/IOWorkQueue.h b/QualcommWireless/include/IOKit/bluetooth/IOWorkQueue.h new file mode 100644 index 0000000..56d4fbe --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/IOWorkQueue.h @@ -0,0 +1,159 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOWORKQUEUE_H +#define _IOKIT_IOWORKQUEUE_H + +#include +#include + +/*! @class IOWorkQueue : public IOEventSource + * @abstract A circular queue that contains IOWorkQueueCall instances as its entries. + * @discussion ??? + */ + +class IOWorkQueue : public IOEventSource +{ + OSDeclareDefaultStructors(IOWorkQueue) + + typedef IOReturn (*Action)(OSObject * owner, void * arg0, void * arg1, void * arg2, void * arg3, void * arg4, void * arg5); + + // TO-DO: Make this clear + typedef int IOWorkQueueOperationMode; + enum IOWorkQueueOperationModes + { + kIOWorkQueueOperationModeWorkAvailable = 0, + kIOWorkQueueOperationModeWorkNotAvailable = 1, + kIOWorkQueueOperationModeCount + }; + + struct IOWorkQueueCall + { + Action action; // 0 + void * arg0; // 8 + void * arg1; // 16 + void * arg2; // 24 + void * arg3; // 32 + void * arg4; // 40 + void * arg5; // 48 + + IOWorkQueueCall * nextCall; // 56 + IOWorkQueueCall * previousCall; // 64 + }; + +public: + virtual void unusedCall002(IOWorkQueueCall **, IOWorkQueueCall **, IOWorkQueueCall *); + virtual void unusedCall003(IOWorkQueueCall **, IOWorkQueueCall **); + + virtual void enqueueWorkCall(IOWorkQueueCall *); + virtual IOWorkQueueCall * dequeueWorkCall(); + + virtual void unusedCall000(IOWorkQueueCall *); + virtual void unusedCall001(); + + virtual bool checkForWork() APPLE_KEXT_OVERRIDE; + virtual IOReturn executeWorkCall(IOWorkQueueCall *); + + virtual void processWorkCallFromSeparateThread(IOWorkQueueCall *); + virtual void processWorkCallFromSeparateThreadWL(); + static void * ThreadCallMain(void *, wait_result_t); + + virtual void unusedCall004(IOWorkQueueCall *); + + static IOWorkQueue * withCapacity(OSObject * owner, UInt32 size, IOWorkQueueOperationMode mode, bool isDebug, char * workQueueName); + virtual bool initWithCapacity(OSObject * owner, UInt32 size, IOWorkQueueOperationMode mode, bool isDebug, char * workQueueName); + + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual IOReturn enqueueAction(Action action, void * arg0, void * arg1, void * arg2, void * arg3, void * arg4, void * arg5); + + virtual void setCountedActionLimit(UInt32 limit); + virtual bool allDoneProcessing(); + virtual void setEnqueueEnable(bool enabled); + virtual void removeAllEntries(); + virtual void disable() APPLE_KEXT_OVERRIDE; + virtual void disableWL(); + + OSMetaClassDeclareReservedUnused(IOWorkQueue, 0); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 1); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 2); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 3); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 4); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 5); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 6); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 7); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 8); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 9); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 10); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 11); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 12); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 13); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 14); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 15); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 16); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 17); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 18); + OSMetaClassDeclareReservedUnused(IOWorkQueue, 19); + +protected: + IOWorkQueueCall * mWorkQueueHeadCall; // 72 + IOWorkQueueCall * mWorkQueueTailCall; // 80 + IOSimpleLock * mWorkQueueCallSimpleLock; // 88 + + struct ExpansionData + { + IOWorkLoop * eWorkLoop; // 0 + IOCommandGate * eCommandGate; // 8 + bool eStop; // 16 + IOThread eThread[20]; // 24 + uint8_t eThreadLimit[20]; // 184 + }; + ExpansionData * mExpansionData; // 96 + +#define eWorkLoop IOWorkQueue::mExpansionData->eWorkLoop +#define eCommandGate IOWorkQueue::mExpansionData->eCommandGate +#define eStop IOWorkQueue::mExpansionData->eStop +#define eThread IOWorkQueue::mExpansionData->eThread +#define eThreadLimit IOWorkQueue::mExpansionData->eThreadLimit + + void * mUnusedPointer; // 104 + + IOWorkQueueOperationMode mOperationMode; // 112 + SInt32 mThreadCounter; // 116 + UInt32 mCountedActionLimit; // 120 + bool mDebug; // 124 + bool mEnqueueEnabled; // 125 + char mWorkQueueName[0x64]; // 126 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/serial/IOBluetoothSerialClient.h b/QualcommWireless/include/IOKit/bluetooth/serial/IOBluetoothSerialClient.h new file mode 100644 index 0000000..dddb2a7 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/serial/IOBluetoothSerialClient.h @@ -0,0 +1,263 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOBLUETOOTHSERIALCLIENT_H +#define _IOKIT_IOBLUETOOTHSERIALCLIENT_H + +#include +#include +#include +#include + +class IOBluetoothRFCOMMChannel; +class IOBluetoothSerialManager; + +enum ParityType +{ + NoParity = 0, + OddParity, + EvenParity, + MaxParity +}; + +#define kDefaultBaudRate 9600 +#define kMaxBaudRate 3000000 +#define kMaxCircularBufferSize 4096 + +typedef struct CirQueue +{ + UInt8 * Start; + UInt8 * End; + UInt8 * NextChar; + UInt8 * LastChar; + IOByteCount Size; + IOByteCount InQueue; + IOLock * InUse; +} CirQueue; + +typedef enum QueueStatus +{ + queueNoError = 0, + queueFull, + queueEmpty, + queueMaxStatus +} QueueStatus; + +QueueStatus InitQueue(CirQueue * Queue, UInt8 * Buffer, size_t Size); +QueueStatus CloseQueue(CirQueue * Queue); +size_t AddtoQueue(CirQueue * Queue, UInt8 * Buffer, size_t Size); +size_t FreeSpaceinQueue(CirQueue * Queue); +QueueStatus PrivateAddBytetoQueue(CirQueue * Queue, char Value); +size_t GetSingleBlockPointer(CirQueue * Queue, size_t MaxSize, UInt8 ** Pointer); +size_t ConsiderThisBlockRead(CirQueue * Queue, UInt8 * Buffer, size_t Size); + +size_t FillBlockWithQueue(CirQueue * Queue, IOBluetoothMemoryBlock * Block); +size_t RemovefromQueue(CirQueue * Queue, UInt8 * Buffer, size_t Size); +QueueStatus PrivateGetBytetoQueue(CirQueue * Queue, UInt8 * Value); +size_t UsedSpaceinQueue(CirQueue * Queue); +size_t GetQueueSize(CirQueue * Queue); +QueueStatus AddBytetoQueue(CirQueue * Queue, char Value); +QueueStatus GetBytetoQueue(CirQueue * Queue, UInt8 * Value); +QueueStatus GetQueueStatus(CirQueue * Queue); + +typedef struct BufferMarks +{ + UInt32 BufferSize; + UInt32 HighWater; + UInt32 LowWater; + bool OverRun; +} BufferMarks; + +typedef struct Stats_t +{ + UInt32 ints; + UInt32 txInts; + UInt32 rxInts; + UInt32 mdmInts; + UInt32 txChars; + UInt32 rxChars; +} Stats_t; + +typedef struct PortInfo_t +{ + UInt32 Instance; // 0 + const UInt8 * PortName; // 8 + UInt32 State; // 16 + UInt32 WatchStateMask; // 20 + IOSimpleLock * WatchLock; // 24 + IOSimpleLock * serialRequestLock; // 32 + + // queue control structures: + CirQueue RX; // 40 + CirQueue TX; // 96 + + BufferMarks RXStats; // 152 + BufferMarks TXStats; // 168 + + // dbdma memory control + IOLock * IODBDMARxLock; // 184 + IOLock * IODBDMATrLock; // 192 + + // UART configuration info: + UInt32 Base; // 200 + UInt32 CharLength; // 204 + UInt32 StopBits; // 208 + UInt32 TXParity; // 212 + UInt32 RXParity; // 216 + UInt32 BreakLength; // 220 + UInt32 BaudRate; // 224 + UInt16 DLRimage; // 228 + UInt8 LCRimage; // 230 + UInt8 FCRimage; // 231 + UInt8 IERmask; // 232 + UInt8 RBRmask; // 233 + UInt32 MasterClock; // 236 + bool MinLatency; // 237 + bool WaitingForTXIdle; // 238 + bool JustDoneInterrupt; // 239 + bool PCMCIA; // 240 + bool PCMCIAYanked; // 241 + + // flow control state & configuration: + UInt8 XONchar; // 242 + UInt8 XOFFchar; // 243 + UInt32 SWspecial[8]; // 244 + UInt32 FlowControl; // 276 notify-on-delta & auto_control + UInt32 FlowControlState; // 280 + int RXOstate; // receive state 284 + int TXOstate; // transmit state if any Flow Control is received 288 + + UInt8 xOffSent; // 292 + + // Globals in the Copeland Version + UInt32 GlobalRecvChars; // 296 + UInt32 OverRunChars; // 300 + + // callout entries: + IOThread FrameTOEntry; // 304 + IOThread DataLatTOEntry; // 312 + IOThread DelayTOEntry; // 320 + IOThread HeartBeatTOEntry; // 328 + mach_timespec FrameInterval; // 336 + mach_timespec DataLatInterval; // 344 + mach_timespec CharLatInterval; // 352 + mach_timespec HeartBeatInterval; // 360 + + // Statistics + Stats_t Stats; // 368 + bool AreTransmitting; // 392 + bool GotTXInterrupt; // 393 + + IOBluetoothSerialManager * mProvider; // 400 + IOBluetoothRFCOMMChannel * mRFCOMMChannel; // 408 + IOLock * mTransmitLock; // 416 + bool mBlockConsideredRead; // 424 + thread_call_t mSetUpTransmitThreadCall; // 432 + bool mNeedToSendBlock; // 440 +} PortInfo_t; + +class IOBluetoothSerialClientModemStreamSync : public IOModemSerialStreamSync +{ + OSDeclareDefaultStructors(IOBluetoothSerialClientModemStreamSync) + +public: + virtual bool compareName(OSString * name, OSString ** matched = NULL) const APPLE_KEXT_OVERRIDE; +}; + +class IOBluetoothSerialClientSerialStreamSync : public IORS232SerialStreamSync +{ + OSDeclareDefaultStructors(IOBluetoothSerialClientSerialStreamSync) + +public: + virtual bool compareName(OSString * name, OSString ** matched = NULL) const APPLE_KEXT_OVERRIDE; +}; + +class IOBluetoothSerialClient : public IOSerialDriverSync +{ + OSDeclareDefaultStructors(IOBluetoothSerialClient) + +public: + static void serialSignalsCallBack(IOService * provider, int); + + virtual void free() APPLE_KEXT_OVERRIDE; + virtual bool requestTerminate(IOService * provider, IOOptionBits options) APPLE_KEXT_OVERRIDE; + + virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual bool attach(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void detach(IOService * provider) APPLE_KEXT_OVERRIDE; + + static void changeState(PortInfo_t * port, UInt32 state, UInt32 mask); + static void dataInFunction(IOService * target, UInt16, void *); + static UInt32 readPortState(PortInfo_t * port); + static void CheckQueues(PortInfo_t * port); + static bool BlockIsGone(IOBluetoothMemoryBlock * block, int, UInt64, UInt64, UInt64, UInt64, UInt64); + static bool SendNextBlock(PortInfo_t * port); + static bool SetUpTransmit(void * port, void * refCon); + static void detachRFCOMMLink(PortInfo_t * port); + + static void SetStructureDefaults(PortInfo_t * port, bool init); + bool createSerialStream(); + + static bool allocateRingBuffer(CirQueue * Queue, size_t BufferSize); + static void freeRingBuffer(CirQueue * Queue); + + virtual IOReturn acquirePort(bool sleep, void * refCon) APPLE_KEXT_OVERRIDE; + virtual IOReturn releasePort(void * refCon) APPLE_KEXT_OVERRIDE; + virtual IOReturn setState(UInt32 state, UInt32 mask, void * refCon) APPLE_KEXT_OVERRIDE; + virtual UInt32 getState(void * refCon) APPLE_KEXT_OVERRIDE; + virtual IOReturn watchState(UInt32 * state, UInt32 mask, void * refCon) APPLE_KEXT_OVERRIDE; + static IOReturn watchState(PortInfo_t * port, UInt32 * state, UInt32 mask); + virtual UInt32 nextEvent(void * refCon) APPLE_KEXT_OVERRIDE; + virtual IOReturn executeEvent(UInt32 event, UInt32 data, void * refCon) APPLE_KEXT_OVERRIDE; + static IOReturn executeEvent(PortInfo_t *, UInt32 event, UInt32 data, UInt32 * oldState, UInt32 * newState); + virtual IOReturn requestEvent(UInt32 event, UInt32 * data, void * refCon) APPLE_KEXT_OVERRIDE; + virtual IOReturn enqueueEvent(UInt32 event, UInt32 data, bool sleep, void * refCon) APPLE_KEXT_OVERRIDE; + virtual IOReturn dequeueEvent(UInt32 * event, UInt32 * data, bool sleep, void * refCon) APPLE_KEXT_OVERRIDE; + virtual IOReturn enqueueData(UInt8 * buffer, UInt32 size, UInt32 * count, bool sleep, void * refCon) APPLE_KEXT_OVERRIDE; + virtual IOReturn dequeueData(UInt8 * buffer, UInt32 size, UInt32 * count, UInt32 min, void * refCon) APPLE_KEXT_OVERRIDE; + + static IOReturn activatePort(PortInfo_t * port); + static void deactivatePort(PortInfo_t * port); + + static void dataLatTOHandler(PortInfo_t * port); + static void frameTOHandler(PortInfo_t * port); + static void delayTOHandler(PortInfo_t * port); + static void heartBeatTOHandler(PortInfo_t * port); + +protected: + PortInfo_t mSerialPort; // 136 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/serial/IOBluetoothSerialManager.h b/QualcommWireless/include/IOKit/bluetooth/serial/IOBluetoothSerialManager.h new file mode 100644 index 0000000..6d3be15 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/serial/IOBluetoothSerialManager.h @@ -0,0 +1,138 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOBLUETOOTHSERIALMANAGER_H +#define _IOKIT_IOBLUETOOTHSERIALMANAGER_H + +#include +#include +#include + +class IOBluetoothRFCOMMChannel; +class IOBluetoothL2CAPChannel; +class IOBluetoothHCIController; +class IOBluetoothRFCOMMConnection; + +class IOBluetoothSerialManager : public IOService +{ + OSDeclareDefaultStructors(IOBluetoothSerialManager) + + typedef struct SecurityParameters + { + bool authenticationRequired; + UInt8 encryptionType; + } SecurityParameters; + +protected: + static bool staticChannelGoesAway(void * target, void * refCon, IOService * newService, IONotifier * notifier); + static bool staticNewChannelShowsUp(void * target, void * refCon, IOService * newService, IONotifier * notifier); + static void newRFCOMMChannelMain(void *, void *); + static IOReturn staticNewChannelShowsUpAction(OSObject *, void *, void *, void *, void *); + static bool staticHCIControllerGoesAway(void * target, void * refCon, IOService * newService, IONotifier * notifier); + static void byeHCIControllerMain(void *, void *); + static IOReturn staticHCIControllerGoesAwayAction(OSObject *, void *, void *, void *, void *); + static bool staticHCIControllerShowsUp(void * target, void * refCon, IOService * newService, IONotifier * notifier); + static void newHCIControllerMain(void *, void *); + static IOReturn staticHCIControllerShowsUpAction(OSObject *, void *, void *, void *, void *); + static bool staticControllerTransportGoesAway(void * target, void * refCon, IOService * newService, IONotifier * notifier); + static bool staticControllerTransportShowsUp(void * target, void * refCon, IOService * newService, IONotifier * notifier); + static IOReturn staticOpenForClient(OSObject * target, void *, void *, void *, void *); + static IOReturn staticOpenL2CAPChannel(OSObject *, void *, void *, void *, void *); + static IOReturn staticCloseDeviceForService(OSObject *, void *, void *, void *, void *); + + virtual IOReturn protectedSetProperties(OSDictionary * dictionary); + virtual IOReturn protectedNewChannelShowsUp(IOBluetoothRFCOMMChannel * channel); + virtual IOReturn protectedHCIControllerGoesAway(IOBluetoothHCIController * controller); + virtual IOReturn protectedHCIControllerShowsUp(IOBluetoothHCIController * controller); + virtual IOReturn protectedOpenL2CAPChannel(BluetoothDeviceAddress * deviceAddress, SecurityParameters * params, UInt16, IOBluetoothL2CAPChannel ** outChannel); + virtual IOReturn protectedOpenChannelForClient(IOBluetoothSerialClient * client); + virtual IOReturn protectedCloseDeviceForService(IOService * service); + +public: + virtual bool init(OSDictionary * dictionary = NULL) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual IOReturn setProperties(OSObject * properties) APPLE_KEXT_OVERRIDE; + + virtual IOReturn capture(IOBluetoothRFCOMMConnection *, IOBluetoothSerialClient *); + virtual bool localRemovePort(OSString *); + virtual IOBluetoothSerialClient * localFindPort(OSString *); + virtual bool channelBelongsTo(IOBluetoothRFCOMMChannel *, UInt8 *); + virtual bool setProperties(OSDictionary * dictionary, IOBluetoothSerialClient *); + virtual bool copyProperty(const OSSymbol *, OSDictionary *, IOService *); + virtual bool handleSerialDictionary(OSDictionary *); + virtual bool terminateSerial(OSObject *); + virtual IOReturn addToAllowedPorts(IOBluetoothSerialClient *, bool); + IOReturn removeFromAllowedPorts(IOBluetoothSerialClient *); + virtual IOReturn openChannelForClient(IOBluetoothSerialClient *); + virtual bool closeChannelForClient(IOBluetoothSerialClient *); + virtual IOReturn closeDeviceForClientRFCOMM(IOBluetoothRFCOMMChannel *); + virtual bool serialMustReturnWithConnection(IOBluetoothSerialClient *); + virtual UInt8 serialAttachesToChannel(IOBluetoothSerialClient *); + + virtual bool serialNeedsBDAddress(IOBluetoothSerialClient *, BluetoothDeviceAddress *); + virtual bool serialIsEnabled(IOBluetoothSerialClient *); + virtual IOCommandGate * getBluetoothCommandGate() const; + +protected: + OSSymbol * mBTName; // 136 + OSSymbol * mBTTTYName; // 144 + OSSymbol * mBTPSM; // 152 + OSSymbol * mBTRFCOMMChannel; // 160 + OSSymbol * mBTAddress; // 168 + OSSymbol * mBTAuthenticationRequired; // 176 + OSSymbol * mBTEncryptionType; // 184 + OSSymbol * mBTSerialConnectionType; // 192 + OSSymbol * mBTEanbledState; // 200 + + IONotifier * mChInNotification; // 208 + IONotifier * mChOutNotification; // 216 + thread_call_t mNewChThreadCall; // 224 + IONotifier * mHCIInNotification; // 232 + IONotifier * mHCIOutNotification; // 240 + IONotifier * mTransportInNotification; // 248 + IONotifier * mTransportOutNotification; // 256 + thread_call_t mNewHCIThreadCall; // 264 + thread_call_t mByeHCIThreadCall; // 272 + IOWorkLoop * mWorkLoop; // 280 + IOCommandGate * mCommandGate; // 288 + IOWorkLoop * mBluetoothWorkLoop; // 296, workLoop of IOBluetoothHCIController + IOCommandGate * mBluetoothCommandGate; // 304 + IOBluetoothHCIController * mHCIController; // 312 + uint8_t __reserved; // 320, never used + IOBluetoothRFCOMMConnection * mRFCOMMConnection; // 328 + IOBluetoothL2CAPChannel * mL2CAPChannel; // 336 + bool mHasControllerTransport; // 344 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/transport/CSRBluetoothHostControllerUSBTransport.h b/QualcommWireless/include/IOKit/bluetooth/transport/CSRBluetoothHostControllerUSBTransport.h new file mode 100644 index 0000000..2e33141 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/transport/CSRBluetoothHostControllerUSBTransport.h @@ -0,0 +1,72 @@ +/* + * Released under "The GNU General Public License (GPL-2.0)" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _IOKIT_CSRBLUETOOTHHOSTCONTROLLERUSBTRANSPORT_H +#define _IOKIT_CSRBLUETOOTHHOSTCONTROLLERUSBTRANSPORT_H + +#include + +class CSRBluetoothHostControllerUSBTransport : public IOBluetoothHostControllerUSBTransport +{ + OSDeclareDefaultStructors(CSRBluetoothHostControllerUSBTransport) + +public: + virtual bool init(OSDictionary * dictionary = NULL) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual bool InitializeTransportWL(IOService * provider); + virtual void systemWillShutdownWL(IOOptionBits options, void * parameter); + + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 0); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 1); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 2); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 3); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 4); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 5); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 6); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 7); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 8); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 9); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 10); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 11); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 12); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 13); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 14); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 15); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 16); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 17); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 18); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 19); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 20); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 21); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 22); + OSMetaClassDeclareReservedUnused(CSRBluetoothHostControllerUSBTransport, 23); + +protected: + struct ExpansionData + { + void * mRefCon; + }; + ExpansionData * mExpansionData; +} + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/transport/IOBluetoothHostControllerTransport.h b/QualcommWireless/include/IOKit/bluetooth/transport/IOBluetoothHostControllerTransport.h new file mode 100644 index 0000000..db10020 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/transport/IOBluetoothHostControllerTransport.h @@ -0,0 +1,341 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/*! + * @header + * This header contains the definition of the IOBluetoothHostControllerTransport class, a subclass of IOService that serves as the base class for all the various transports in the IOBluetoothFamily. + * + */ + +#ifndef _IOKIT_IOBLUETOOTHHOSTCONTROLLERTRANSPORT_H +#define _IOKIT_IOBLUETOOTHHOSTCONTROLLERTRANSPORT_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +extern void BluetoothSleepTimeOutOccurred(OSObject * owner, IOTimerEventSource * sender); + +static const char * gInternalPowerStateString[7] = { "OFF", "ON", "SLEEP", "IDLE", "OFF", "IDLE", "ON" }; +static const char * gOrdinalPowerStateString[3] = { "OFF", "IDLE", "ON" }; +static const char * gPowerManagerSleepTypeString[9] = { "kIOPMSleepTypeInvalid", "kIOPMSleepTypeAbortedSleep", "kIOPMSleepTypeNormalSleep", "kIOPMSleepTypeSafeSleep", "kIOPMSleepTypeHibernate", "kIOPMSleepTypeStandby", "kIOPMSleepTypePowerOff", "kIOPMSleepTypeDeepIdle", "kIOPMSleepTypeLast" }; +static const char * gPowerManagerSleepTypeShortString[9] = { "SleepTypeInvalid", "SleepTypeAbortedSleep", "SleepTypeNormalSleep", "SleepTypeSafeSleep", "SleepTypeHibernate", "SleepTypeStandby", "SleepTypePowerOff", "SleepTypeDeepIdle", "SleepTypeLast" }; + +extern const IORegistryPlane * gIODTPlane; + +/*! @class IOBluetoothHostControllerTransport + * @abstract The base class for IOBluetoothFamily transports. + * @discussion ??? + * + */ + +class IOBluetoothHostControllerTransport : public IOService +{ + OSDeclareAbstractStructors(IOBluetoothHostControllerTransport) + + friend class IOBluetoothHCIController; + friend class IOBluetoothHostController; + +public: + /*! @function init + * @abstract Initializes member variables of IOBluetoothHostControllerTransport. + @discussion This function calls CreateOSLogObject() to create mInternalOSLogObject, sets the initial value for various members of the class, calls GetNVRAMSettingForSwitchBehavior() to set up + mSwitchBehavior, and creates the ExpansionData. It calls super::init() at the end to initialize its inherited members. + * @result Result of IOService::init(). */ + + virtual bool init(OSDictionary * dictionary = NULL) APPLE_KEXT_OVERRIDE; + + /*! @function free + * @abstract Frees data structures that were allocated the class was initialized. */ + + virtual void free() APPLE_KEXT_OVERRIDE; + + /*! @function probe + * @abstract Probes a matched device to see if it can be used. + * @discussion Aside from running probe() of the super class, this function would check the SkipIOBluetoothHostControllerUSBTransport property in the gIODTPlane. If it exists, the function will + * terminate returning NULL as Bluetooth USB Transport should be skipped. + * @param provider The registered IOService object that matches a driver personality's matching dictionary. + * @param score The driver's probe score. + * @result If SkipIOBluetoothHostControllerUSBTransport does not exist, the result of IOService::probe() would be returned. Otherwise, the result would be NULL. */ + + virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE; + + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + + virtual IOWorkLoop * getWorkLoop() const APPLE_KEXT_OVERRIDE; + virtual IOCommandGate * getCommandGate() const; + virtual bool setTransportWorkLoop(void *, IOWorkLoop * inWorkLoop); + + virtual bool terminate(IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + static IOReturn terminateAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + virtual bool terminateWL(IOOptionBits options = 0); + + virtual bool InitializeTransport(); + static IOReturn InitializeTransportAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + virtual bool InitializeTransportWL(IOService * provider); + + virtual OSObject * getPropertyFromTransport(const OSSymbol * aKey); + virtual OSObject * getPropertyFromTransport(const OSString * aKey); + virtual OSObject * getPropertyFromTransport(const char * aKey); + + virtual IOReturn SetRemoteWakeUp(bool); + virtual IOReturn DoDeviceReset(UInt16); + + virtual void AbortPipesAndClose(bool, bool); + virtual bool HostSupportsSleepOnUSB(); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual bool StartLMPLogging(); +#endif + virtual bool StartLMPLoggingBulkPipeRead(); + virtual bool StartInterruptPipeRead(); + virtual bool StopInterruptPipeRead(); + virtual bool StartBulkPipeRead(); + virtual bool StopBulkPipeRead(); + + virtual IOReturn TransportBulkOutWrite(void *); + virtual IOReturn TransportIsochOutWrite(void *, void *, IOOptionBits); + virtual IOReturn TransportSendSCOData(void *); + virtual IOReturn TransportLMPLoggingBulkOutWrite(UInt8, UInt8); + + virtual IOReturn SendHCIRequest(UInt8 * buffer, IOByteCount size); + virtual void UpdateSCOConnections(UInt8, UInt32); + virtual IOReturn ToggleLMPLogging(UInt8 *); + + virtual IOReturn CallConfigPM(); + virtual bool ConfigurePM(IOService * policyMaker); + + virtual unsigned long maxCapabilityForDomainState(IOPMPowerFlags domainState) APPLE_KEXT_OVERRIDE; + virtual unsigned long initialPowerStateForDomainState(IOPMPowerFlags domainState) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setPowerState(unsigned long powerStateOrdinal, IOService * whatDevice) APPLE_KEXT_OVERRIDE; + static IOReturn setPowerStateAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + virtual IOReturn setPowerStateWL(unsigned long powerStateOrdinal, IOService * whatDevice); + + virtual IOReturn RequestTransportPowerStateChange(IOBluetoothHCIControllerInternalPowerState powerState, char * name); + virtual IOReturn WaitForControllerPowerState(IOBluetoothHCIControllerInternalPowerState powerState, char *); + virtual IOReturn WaitForControllerPowerStateWithTimeout(IOBluetoothHCIControllerInternalPowerState powerState, uint32_t timeout, char *, bool); + virtual void CompletePowerStateChange(char *); + virtual IOReturn ProcessPowerStateChangeAfterResumed(char *); + + virtual IOReturn setAggressiveness(unsigned long type, unsigned long newLevel) APPLE_KEXT_OVERRIDE; +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + static IOReturn setAggressivenessAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + virtual bool setAggressivenessWL(unsigned long type, unsigned long newLevel); +#endif + + virtual IOReturn powerStateWillChangeTo(IOPMPowerFlags capabilities, unsigned long stateNumber, IOService * whatDevice) APPLE_KEXT_OVERRIDE; + static IOReturn powerStateWillChangeToAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + virtual IOReturn powerStateWillChangeToWL(IOOptionBits options, void *); + + virtual void systemWillShutdown(IOOptionBits specifier) APPLE_KEXT_OVERRIDE; + static IOReturn systemWillShutdownAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + virtual void systemWillShutdownWL(IOOptionBits options, void *); + + virtual IOBluetoothHCIControllerInternalPowerState GetCurrentPowerState(); + virtual IOBluetoothHCIControllerInternalPowerState GetPendingPowerState(); + + virtual IOReturn ChangeTransportPowerStateFromIdleToOn(char * name); + virtual IOReturn ChangeTransportPowerState(unsigned long ordinal, bool willWait, IOBluetoothHCIControllerInternalPowerState powerState, char * name); + virtual IOReturn WaitForControllerPowerStateChange(IOBluetoothHCIControllerInternalPowerState, char *); + + virtual IOReturn WakeupSleepingPowerStateThread(); + virtual bool ControllerSupportWoBT(); + virtual UInt16 GetControllerVendorID(); + virtual UInt16 GetControllerProductID(); + + virtual UInt8 GetRadioPowerState(); + virtual void SetRadioPowerState(UInt8 powerState); + + virtual bool GetNVRAMSettingForSwitchBehavior(); + virtual UInt32 GetControllerLocationID(); + virtual bool GetBuiltIn(); + virtual bool GetSupportPowerOff(); + virtual bool IsHardwareInitialized(); + virtual UInt32 GetHardwareStatus(); + virtual void ResetHardwareStatus(); + virtual UInt32 ConvertAddressToUInt32(void * address); + virtual void SetActiveController(bool); + virtual void ResetBluetoothDevice(); + virtual IOReturn TransportCommandSleep(void *, UInt32, char *, bool); + virtual void ReadyToGo(bool oneThread); + virtual bool TerminateCalled(); + virtual void GetInfo(void * outInfo); + virtual IOReturn CallPowerManagerChangePowerStateTo(unsigned long ordinal, char *); + virtual UInt16 GetControllerTransportType(); + virtual bool SupportNewIdlePolicy(); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual void CheckACPIMethodsAvailabilities(); +#else + virtual void CheckSpecialGPIO(); +#endif + virtual IOReturn SetBTRS(); + virtual IOReturn SetBTPU(); + virtual IOReturn SetBTPD(); + virtual IOReturn SetBTRB(bool); + virtual IOReturn SetBTLP(bool); + + virtual void NewSCOConnection(); + + virtual void retain() const APPLE_KEXT_OVERRIDE; + virtual void release() const APPLE_KEXT_OVERRIDE; + virtual void RetainTransport(char *); + virtual void ReleaseTransport(char *); + + virtual IOReturn SetIdlePolicyValue(uint32_t idleTimeoutMs); + virtual bool TransportWillReEnumerate(); + virtual void ConvertPowerFlagsToString(IOPMPowerFlags, char *); + virtual void SetupTransportSCOParameters(); + virtual void DestroyTransportSCOParameters(); + virtual bool WaitForSystemReadyForSleep(char *); + virtual IOReturn StartBluetoothSleepTimer(); + virtual void CancelBluetoothSleepTimer(); +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15 + virtual bool StopAllReads(); +#endif + virtual os_log_t CreateOSLogObject(); + + virtual IOReturn setProperties(OSObject * properties) APPLE_KEXT_OVERRIDE; + static IOReturn setPropertiesAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + virtual IOReturn setPropertiesWL(OSObject * properties); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual IOReturn HardReset(); +#else + virtual IOReturn PerformHardReset(); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + virtual void DumpTransportProviderState(); +#endif + + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 0); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 1); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 2); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 3); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 4); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 5); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 6); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 7); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 8); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 9); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 10); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 11); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 12); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 13); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 14); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 15); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 16); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 17); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 18); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 19); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 20); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 21); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 22); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerTransport, 23); + +public: + IOBluetoothHCIController * mBluetoothFamily; // 136 + IOBluetoothHostController * mBluetoothController; // 144 + IOService * mProvider; // 152 + IOWorkLoop * mWorkLoop; // 160 + IOCommandGate * mCommandGate; // 168 +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15 + IOWorkQueue * mTransportWorkQueue; ///176 +#endif + UInt16 mControllerVendorType; // 176 + + bool mUSBControllerSupportsSuspend; // 178 + UInt8 mTerminateState; // 179 + bool mLMPLoggingEnabled; // 180 + bool mSystemOnTheWayToSleep; // 181 + uint8_t reserved2; // 182 + uint8_t reserved3; // 183 + bool mConfiguredPM; // 184 + UInt32 mSwitchBehavior; // 188 + bool mHardwareInitialized; // 192 + UInt32 mHardwareStatus; // 196 + UInt32 mTerminateCounter; // 200 + bool mLMPLoggingAvailable; // 204 + void * mRefCon; // 208 + + IOBluetoothHCIControllerInternalPowerState mCurrentInternalPowerState; // 216 + IOBluetoothHCIControllerInternalPowerState mPendingInternalPowerState; // 220 + + UInt16 mConrollerTransportType; // 224 + bool mSupportNewIdlePolicy; // 226 + bool mBuiltIn; // 227 + UInt32 mLocationID; // 228 + bool mSupportPowerOff; // 232 + UInt32 mSleepType; // 236 + bool mIsControllerActive; // 240 + uint8_t reserved4; // 241 + UInt32 unknown111; // 244 + UInt8 mAlreadyOff; // 248 + UInt8 reserved6; // 249 + bool mSupportWoBT; // 250 + UInt8 mCurrentPMMethod; // 251 + UInt64 mTransportCounter; // 256, retain/released in Retain/ReleaseTransport + UInt16 mTransportOutstandingCalls; // 264 + bool reserved7; // 266 + IOTimerEventSource * mBluetoothSleepTimerEventSource; // 272 + bool mBluetoothSleepTimerStarted; // 280 + os_log_t mInternalOSLogObject; // 288 + bool mBootFromROM; // 296 + UInt16 mUARTProductID; // 298 +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + IOBluetoothACPIMethods * mACPIMethods; // 304 +#endif +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + bool reserved10; // 312 +#endif + + struct ExpansionData + { + UInt16 reserved; + }; + ExpansionData * mExpansionData; // 320 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/transport/IOBluetoothHostControllerUARTTransport.h b/QualcommWireless/include/IOKit/bluetooth/transport/IOBluetoothHostControllerUARTTransport.h new file mode 100644 index 0000000..57a4dd7 --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/transport/IOBluetoothHostControllerUARTTransport.h @@ -0,0 +1,143 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOBLUETOOTHHOSTCONTROLLERUARTTRANSPORT_H +#define _IOKIT_IOBLUETOOTHHOSTCONTROLLERUARTTRANSPORT_H + +#include +#include +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 +extern void TimeOutHandler(OSObject * owner, IOTimerEventSource * sender); +#endif + +enum BluetoothUARTPacketTypes +{ + kBluetoothUARTPacketTypeHCIRequest = 1, + kBluetoothUARTPacketTypeBulk = 2, + kBluetoothUARTPacketTypeIsoch = 3, + kBluetoothUARTPacketTypeEvent = 4, + kBluetoothUARTPacketTypeLMP = 7 +}; + +class IOBluetoothHostControllerUARTTransport : public IOBluetoothHostControllerTransport +{ + OSDeclareAbstractStructors(IOBluetoothHostControllerUARTTransport) + +public: + virtual bool init(OSDictionary * dictionary = NULL) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual bool terminateWL(IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; +#else + virtual bool terminate(IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; +#endif + virtual bool ConfigurePM(IOService * policyMaker) APPLE_KEXT_OVERRIDE; + virtual IOReturn setPowerStateWL(unsigned long powerStateOrdinal, IOService * whatDevice) APPLE_KEXT_OVERRIDE; + virtual void CompletePowerStateChange(char *) APPLE_KEXT_OVERRIDE; + virtual IOReturn powerStateWillChangeToWL(IOOptionBits options, void *) APPLE_KEXT_OVERRIDE; + virtual IOReturn RequestTransportPowerStateChange(IOBluetoothHCIControllerInternalPowerState powerState, char *) APPLE_KEXT_OVERRIDE; + virtual void systemWillShutdownWL(IOOptionBits options, void *) APPLE_KEXT_OVERRIDE; + + virtual UInt16 GetControllerVendorID() APPLE_KEXT_OVERRIDE; + virtual UInt16 GetControllerProductID() APPLE_KEXT_OVERRIDE; + + virtual IOReturn SendHCIRequest(UInt8 * data, IOByteCount size) APPLE_KEXT_OVERRIDE; + virtual IOReturn TransportBulkOutWrite(void * data) APPLE_KEXT_OVERRIDE; + virtual IOReturn TransportIsochOutWrite(void * data, void * retainer, IOOptionBits options) APPLE_KEXT_OVERRIDE; + virtual IOReturn TransportSendSCOData(void *) APPLE_KEXT_OVERRIDE; + + virtual IOReturn SendUART(UInt8 * data, UInt32 size); + static IOReturn StaticProcessACLSCOEventData(void * data, int size); + virtual IOReturn ProcessACLSCOEventData(); + virtual void GetInfo(void * outInfo) APPLE_KEXT_OVERRIDE; +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual IOReturn AcquirePort(bool); +#else + virtual IOReturn AcquirePort(); +#endif + virtual IOReturn ReleasePort(); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual IOReturn WaitForReceiveToBeReady(bool); +#else + virtual IOReturn WaitForReceiveToBeReady(); +#endif + virtual void NewSCOConnection() APPLE_KEXT_OVERRIDE; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual IOReturn SetLMPLogging(); + virtual bool StartLMPLogging() APPLE_KEXT_OVERRIDE; + virtual bool StopLMPLogging(); +#endif + virtual IOReturn ToggleLMPLogging(UInt8 *) APPLE_KEXT_OVERRIDE; + + virtual IOReturn DoDeviceReset(UInt16) APPLE_KEXT_OVERRIDE; +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual IOReturn DequeueDataInterruptEventGated(IOInterruptEventSource * sender, int count); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + virtual void DumpTransportProviderState() APPLE_KEXT_OVERRIDE; +#endif + +protected: + UInt8 * mDataToSend; // 328, the UART packet sent through SendUART() + UInt8 * mDataReceived; // 336, obtained from mProvider->DequeueData() + IORS232SerialStreamSync * mProvider; // 344 + void * mIsochOutWriteRetainer; // 352, second param of TransportIsochOutWrite + bool mReadyToReceive; // 360 + UInt32 mIsochOutWriteCounter; // 364 + bool mPowerStateChangeInProgress; // 368 + bool mSkipBluetoothFirmwareBoot; // 369 +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + IOWorkLoop * mUARTTransportWorkLoop; // 376 + IOInterruptEventSource::Action mDequeueDataInterruptEventAction; // 384 + IOInterruptEventSource * mDequeueDataInterruptEvent; // 392 + IOWorkLoop * mUARTTransportTimerWorkLoop; // 400 + IOCommandGate * mUARTTransportTimerCommandGate; // 408 + IOTimerEventSource * mUARTTransportTimer; // 416 + bool mUARTTransportTimerHasTimeout; // 424 + UInt32 mSlowEnqueueData; // 428 + UInt32 mLongestEnqueueDataCallMicroseconds; // 432 +#endif +}; + +#endif diff --git a/QualcommWireless/include/IOKit/bluetooth/transport/IOBluetoothHostControllerUSBTransport.h b/QualcommWireless/include/IOKit/bluetooth/transport/IOBluetoothHostControllerUSBTransport.h new file mode 100644 index 0000000..1de4c7b --- /dev/null +++ b/QualcommWireless/include/IOKit/bluetooth/transport/IOBluetoothHostControllerUSBTransport.h @@ -0,0 +1,287 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOKIT_IOBLUETOOTHHOSTCONTROLLERUSBTRANSPORT_H +#define _IOKIT_IOBLUETOOTHHOSTCONTROLLERUSBTRANSPORT_H + +#include +#include +#include + +extern const IORegistryPlane * gIODTPlane; +extern const IORegistryPlane * gIOServicePlane; +extern const OSSymbol * gIOGeneralInterest; + +class IOBluetoothMemoryDescriptorRetainer; + +class IOBluetoothHostControllerUSBTransport : public IOBluetoothHostControllerTransport +{ + OSDeclareAbstractStructors(IOBluetoothHostControllerUSBTransport) + + friend class IOBluetoothHostController; + +public: + virtual bool init(OSDictionary * dictionary = NULL) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual bool terminateWL(IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + virtual bool InitializeTransportWL(IOService * provider) APPLE_KEXT_OVERRIDE; + + virtual IOReturn SetRemoteWakeUp(bool) APPLE_KEXT_OVERRIDE; + virtual IOReturn DoDeviceReset(UInt16) APPLE_KEXT_OVERRIDE; + + virtual void AbortPipesAndClose(bool stop, bool release) APPLE_KEXT_OVERRIDE; + virtual bool HostSupportsSleepOnUSB() APPLE_KEXT_OVERRIDE; + + virtual bool ConfigurePM(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual unsigned long maxCapabilityForDomainState(IOPMPowerFlags domainState) APPLE_KEXT_OVERRIDE; + virtual unsigned long initialPowerStateForDomainState(IOPMPowerFlags domainState) APPLE_KEXT_OVERRIDE; +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_14 + virtual IOReturn setAggressiveness(unsigned long type, unsigned long newLevel) APPLE_KEXT_OVERRIDE; +#endif + virtual IOReturn setPowerStateWL(unsigned long powerStateOrdinal, IOService * whatDevice) APPLE_KEXT_OVERRIDE; + virtual IOReturn RequestTransportPowerStateChange(IOBluetoothHCIControllerInternalPowerState powerState, char * calledByFunction) APPLE_KEXT_OVERRIDE; + virtual void CompletePowerStateChange(char *) APPLE_KEXT_OVERRIDE; + virtual IOReturn ProcessPowerStateChangeAfterResumed(char *) APPLE_KEXT_OVERRIDE; + virtual IOReturn powerStateWillChangeTo(IOPMPowerFlags capabilities, unsigned long stateNumber, IOService * whatDevice) APPLE_KEXT_OVERRIDE; + virtual IOReturn powerStateWillChangeToWL(IOOptionBits options, void *) APPLE_KEXT_OVERRIDE; + virtual void systemWillShutdownWL(IOOptionBits options, void *) APPLE_KEXT_OVERRIDE; + + virtual bool ControllerSupportWoBT() APPLE_KEXT_OVERRIDE; + virtual UInt16 GetControllerVendorID() APPLE_KEXT_OVERRIDE; + virtual UInt16 GetControllerProductID() APPLE_KEXT_OVERRIDE; + virtual UInt8 GetRadioPowerState() APPLE_KEXT_OVERRIDE; + virtual void SetRadioPowerState(UInt8 state) APPLE_KEXT_OVERRIDE; + virtual void ResetBluetoothDevice() APPLE_KEXT_OVERRIDE; + virtual void GetInfo(void * outInfo) APPLE_KEXT_OVERRIDE; + static IOReturn SetIdlePolicyValueAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4); + virtual IOReturn SetIdlePolicyValue(uint32_t idleTimeoutMs) APPLE_KEXT_OVERRIDE; + virtual bool TransportWillReEnumerate() APPLE_KEXT_OVERRIDE; + + static IOReturn MessageReceiver(void * target, void * refCon, UInt32 messageType, IOService * provider, void * messageArgument, vm_size_t argSize); + virtual IOReturn HandleMessage(UInt32 messageType, IOService * provider, void * messageArgument, vm_size_t argSize); + static IOReturn HandleMessageAction(OSObject * owner, void * arg0, void * arg1, void * arg2, void * arg3, void * arg4, void * arg5); + + virtual IOReturn SendHCIRequest(UInt8 * buffer, IOByteCount size) APPLE_KEXT_OVERRIDE; + static void DeviceRequestCompleteHandler(void * owner, void * parameter, IOReturn status, uint32_t bytesTransferred); + static IOReturn DeviceRequestCompleteAction(OSObject * owner, void * arg1, void * arg2, void * arg3, void * arg4, void * arg5, void * arg6); + + virtual void UpdateSCOConnections(UInt8, UInt32) APPLE_KEXT_OVERRIDE; + virtual void SetupTransportSCOParameters() APPLE_KEXT_OVERRIDE; + virtual void DestroyTransportSCOParameters() APPLE_KEXT_OVERRIDE; + + virtual bool ConfigureDevice(); + virtual UInt8 GetInterfaceNumber(IOUSBHostInterface * interface); + virtual IOUSBHostInterface * FindNextInterface(IOUSBHostInterface *, UInt16, UInt16, UInt16, UInt16); + virtual IOUSBHostPipe * FindNextPipe(IOUSBHostInterface *, UInt8 type, UInt8 direction, UInt16 * maxPacketSize); + virtual bool FindInterfaces(); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual bool StartLMPLogging() APPLE_KEXT_OVERRIDE; +#endif + virtual bool StartLMPLoggingBulkPipeRead() APPLE_KEXT_OVERRIDE; + virtual IOReturn ToggleLMPLogging(UInt8 *) APPLE_KEXT_OVERRIDE; + virtual IOReturn TransportLMPLoggingBulkOutWrite(UInt8, UInt8) APPLE_KEXT_OVERRIDE; + + virtual bool StartInterruptPipeRead() APPLE_KEXT_OVERRIDE; + virtual bool StopInterruptPipeRead() APPLE_KEXT_OVERRIDE; + static void InterruptReadHandler(void * owner, void * parameter, IOReturn status, uint32_t bytesTransferred); + + virtual bool StartBulkPipeRead() APPLE_KEXT_OVERRIDE; + virtual bool StopBulkPipeRead() APPLE_KEXT_OVERRIDE; + static void BulkInReadHandler(void * owner, void * parameter, IOReturn status, uint32_t bytesTransferred); + + virtual bool StartIsochPipeRead(); + virtual bool StopIsochPipeRead(); + static void IsochInReadHandler(void * owner, void * parameter, IOReturn status, IOUSBHostIsochronousFrame * frameList); + virtual void ResetIsocFrames(IOUSBHostIsochronousFrame * isocFrames, UInt32 numberOfFrames); + + virtual bool StopAllPipes(); + virtual bool StartAllPipes(); +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15 + virtual bool StopAllReads() APPLE_KEXT_OVERRIDE; +#endif + + virtual void WaitForAllIOsToBeAborted(); + virtual void ReceiveInterruptData(void * data, UInt32 dataSize, bool); + + virtual IOReturn TransportBulkOutWrite(void * buffer) APPLE_KEXT_OVERRIDE; + virtual IOReturn BulkOutWrite(IOMemoryDescriptor *); + static void BulkOutWriteCompleteHandler(void * owner, void * parameter, IOReturn status, uint32_t bytesTransferred); + static IOReturn BulkOutWriteCompleteAction(OSObject * onwer, void * arg1, void * arg2, void * arg3, void * arg4, void * arg5, void * arg6); + virtual void HandleBulkOutWriteTimeout(IOBluetoothMemoryDescriptorRetainer *); + static void BulkOutWriteTimerFired(OSObject * target, IOTimerEventSource * sender); + + virtual void HandleIsochData(void *, int, IOUSBHostIsochronousFrame *); + virtual IOReturn TransportIsochOutWrite(void * memDescriptor, void *, IOOptionBits) APPLE_KEXT_OVERRIDE; + virtual IOReturn IsochOutWrite(IOMemoryDescriptor * memDescriptor, IOBluetoothSCOMemoryDescriptorRetainer *, int); + static void IsochOutWriteCompleteHandler(void * owner, void * parameter, IOReturn status, IOUSBHostIsochronousFrame * frameList); + + virtual void LogData(void * data, UInt64, IOByteCount size); + virtual bool USBControllerSupportsSuspend(); + + virtual bool SystemGoingToSleep(); + virtual IOReturn PrepareControllerForSleep(); + virtual bool PrepareControllerWakeFromSleep(); + virtual bool PrepareControllerForPowerOff(bool); + virtual bool PrepareControllerForPowerOn(); + virtual bool SystemWakeCausedByBluetooth(); + + virtual IOReturn ProcessG3StandByWake(); + virtual IOReturn ReConfigure(); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + virtual bool NeedToTurnOnUSBDebug(); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual IOReturn HardReset() APPLE_KEXT_OVERRIDE; +#else + virtual IOReturn PerformHardReset() APPLE_KEXT_OVERRIDE; +#endif + +private: + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 0); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 1); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 2); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 3); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 4); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 5); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 6); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 7); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 8); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 9); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 10); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 11); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 12); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 13); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 14); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 15); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 16); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 17); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 18); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 19); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 20); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 21); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 22); + OSMetaClassDeclareReservedUnused(IOBluetoothHostControllerUSBTransport, 23); + +protected: + IOUSBHostDevice * mBluetoothUSBHostDevice; // 328 + IOUSBHostDevice * mBluetoothUSBHub; // 336 + UInt16 mActiveDeviceRequestIOCount; // 344 + UInt16 mVendorID; // 346 + UInt16 mProductID; // 348 + + IOUSBHostInterface * mInterface; // 352 + IOUSBHostInterface * mIsochInterface; // 360 + UInt8 mInterfaceNumber; // 368 + UInt8 mIsochInterfaceNumber; // 369 + + uint8_t mEmptyInterruptReadData[1021]; // 370, an empty buffer used to determine if the buffer stored in mInterruptReadDataBuffer is empty + IOUSBHostPipe * mInterruptPipe; // 1392 + Descriptor * mInterruptDescriptor; // 1400 + IOBufferMemoryDescriptor * mInterruptReadDataBuffer; // 1408 + IOUSBHostCompletion mInterruptCompletion; // 1416 (size = 24) + bool mInterruptPipeStarted; // 1440 + UInt16 mInterruptPipeOutstandingIOCount; // 1442 + + IOUSBHostPipe * mBulkInPipe; // 1448 + Descriptor * mBulkInDescriptor; // 1456 + IOBufferMemoryDescriptor * mBulkInReadDataBuffer; // 1464 + IOUSBHostCompletion mBulkInCompletion; // 1472, 24 + bool mBulkInPipeStarted; // 1496 + UInt16 mBulkInPipeOutstandingIOCount; // 1498 + + IOUSBHostPipe * mBulkOutPipe; // 1504 + IOUSBHostCompletion mBulkOutCompletion; // 1512 + 24 + + IOUSBHostPipe * mIsochInPipe; // 1536 + IOBufferMemoryDescriptor ** mIsochInReadDataBufferList; // 1544, contains 2 IOBufferMemoryDescriptor + int mIsochInReadDataBufferStates[2]; // 1552 + IOUSBHostIsochronousCompletion * mIsochInCompletionRoutineList; // 1560 + UInt32 mIsochInPipeNumReads; // 1568 + bool mIsochInReadsComplete; // 1572 + IOUSBHostIsochronousFrame * mIsochInFrames; // 1576 + UInt64 mIsochInFrameNumber; // 1584 + vm_size_t mIsochInReadDataBufferLength; // 1592 + UInt32 mIsochInPipeNumFrames; // 1596 + UInt32 mIsochInFrameNumRequestedBytes; // 1600, The number of bytes requested to transfer for this frame + + UInt32 mIsochOutFrameNumRequestedBytes; // 1604 + IOUSBHostPipe * mIsochOutPipe; // 1608 + IOUSBHostIsochronousCompletion mIsochOutCompletion; // 1616 + 24 + IOUSBHostIsochronousFrame * mIsochOutFrames; // 1640 + UInt32 mIsochOutPipeNumFrames; // 1648 + UInt64 mIsochOutFrameNumber; // 1656 + + UInt32 mPreviousIsochOutPipeNumFrames; // 1664 + UInt8 mInterruptReadNumRetries; // 1668 + UInt8 mBulkInReadNumRetries; // 1669 + IONotifier * mMessageReceiverNotifier; // 1672 + UInt64 mPreviousIsochOutFrameNumber; // 1680 + + UInt8 * mInterruptData; // 1688 + UInt8 mInterruptDataLength; // 1696 + UInt32 mInterruptDataPosition; // 1700 + UInt16 mStopInterruptPipeReadCounter; // 1704 + + bool mInterfaceFound; // 1706 + bool mIsochInterfaceFound; // 1707 + bool unknown1; // 1708 + uint8_t __reserved1; // 1709 + bool isServiceRegistered; // 1710 + bool unknown2; // 1711 + UInt8 mHardResetState; // 1712 + bool __reserved2; // 1713 + bool mMatchedOnInterface; // 1714 + UInt32 mInterruptSleepMs; // 1716 + bool mAbortPipesAndCloseCalled; // 1720 + bool mPreviousEventIsSpecial; // 1721 + bool mIOClassIsAppleUSBXHCIPCI; // 1722 + bool mStopAllPipesCalled; // 1723 + bool unknown5; // 1724 pm state + bool unknown6; // 1725 pm state + bool mHostDeviceStarted; // 1726 + bool mHubStarted; // 1727 + + struct ExpansionData + { + void * mRefCon; + }; + ExpansionData * mExpansionData; // 1728 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/firewire/IOConfigDirectory.h b/QualcommWireless/include/IOKit/firewire/IOConfigDirectory.h new file mode 100644 index 0000000..d72ed21 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOConfigDirectory.h @@ -0,0 +1,182 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOCONFIGDIRECTORY_H__ +#define __IOCONFIGDIRECTORY_H__ + +#include +#include + +#include + +class OSData; +class OSString; +class OSIterator; +class IOFireWireDevice; + +/*! @class IOConfigDirectory +*/ +class IOConfigDirectory : public OSObject +{ + OSDeclareAbstractStructors(IOConfigDirectory); + +protected: + int fStart; // Offset into ROM of start of this dir + int fType; // Directory type + int fNumEntries; // In directory + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool initWithOffset(int start, int type); + + virtual const UInt32 *getBase() = 0; + virtual IOReturn createIterator(UInt32 testVal, UInt32 testMask, + OSIterator *&iterator); + virtual IOConfigDirectory *getSubDir(int start, int type) = 0; + +public: + /*! + @function update + makes sure that the ROM has at least the specified capacity, + and that the ROM is uptodate from its start to at least the + specified quadlet offset. + @result kIOReturnSuccess if the specified offset is now + accessable at romBase[offset]. + */ + virtual IOReturn update(UInt32 offset, const UInt32 *&romBase) = 0; + + /*! + @function getKeyType + Gets the data type for the specified key + @param type on return, set to the data type + @result kIOReturnSuccess if the key exists in the dictionary + */ + virtual IOReturn getKeyType(int key, IOConfigKeyType &type); + /*! + @function getKeyValue + Gets the value for the specified key, in a variety of forms. + @param value on return, set to the data type + @param text if non-zero, on return points to the + string description of the field, or NULL if no text found. + @result kIOReturnSuccess if the key exists in the dictionary + and is of a type appropriate for the value parameter + @param value reference to variable to store the entry's value + */ + virtual IOReturn getKeyValue(int key, UInt32 &value, OSString** text = NULL); + virtual IOReturn getKeyValue(int key, OSData *&value, + OSString** text = NULL); + virtual IOReturn getKeyValue(int key, IOConfigDirectory *&value, + OSString** text = NULL); + virtual IOReturn getKeyOffset(int key, FWAddress &value, + OSString** text = NULL); + + + /*! + @function getIndexType + Gets the data type for entry at the specified index + @param type on return, set to the data type + @result kIOReturnSuccess if the index exists in the dictionary + */ + virtual IOReturn getIndexType(int index, IOConfigKeyType &type); + /*! + @function getIndexKey + Gets the key for entry at the specified index + @param key on return, set to the key + @result kIOReturnSuccess if the index exists in the dictionary + */ + virtual IOReturn getIndexKey(int index, int &key); + + /*! + @function getIndexValue + Gets the value at the specified index of the directory, + in a variety of forms. + @param type on return, set to the data type + @result kIOReturnSuccess if the index exists in the dictionary + and is of a type appropriate for the value parameter + @param value reference to variable to store the entry's value + */ + virtual IOReturn getIndexValue(int index, UInt32 &value); + virtual IOReturn getIndexValue(int index, OSData *&value); + virtual IOReturn getIndexValue(int index, OSString *&value); + virtual IOReturn getIndexValue(int index, IOConfigDirectory *&value); + virtual IOReturn getIndexOffset(int index, FWAddress &value); + virtual IOReturn getIndexOffset(int index, UInt32 &value); + + /*! + @function getIndexEntry + Gets the entry at the specified index of the directory, + as a raw UInt32. + @param entry on return, set to the entry value + @result kIOReturnSuccess if the index exists in the dictionary + @param value reference to variable to store the entry's value + */ + virtual IOReturn getIndexEntry(int index, UInt32 &value); + + /*! + @function getSubdirectories + Creates an iterator over the subdirectories of the directory. + @param iterator on return, set to point to an OSIterator + @result kIOReturnSuccess if the iterator could be created + */ + virtual IOReturn getSubdirectories(OSIterator *&iterator); + + /*! + @function getKeySubdirectories + Creates an iterator over subdirectories of a given type of the directory. + @param key type of subdirectory to iterate over + @param iterator on return, set to point to an OSIterator + @result kIOReturnSuccess if the iterator could be created + */ + virtual IOReturn getKeySubdirectories(int key, OSIterator *&iterator); + + int getType() const; + + int getNumEntries() const; + +protected: + + virtual const UInt32 * lockData( void ) = 0; + virtual void unlockData( void ) = 0; + virtual IOReturn updateROMCache( UInt32 offset, UInt32 length ) = 0; + virtual IOReturn checkROMState( void ) = 0; + +private: + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 0); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 1); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 2); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 3); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 4); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 5); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 6); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 7); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 8); + +}; + +#endif /* __IOCONFIGDIRECTORY_H__ */ diff --git a/QualcommWireless/include/IOKit/firewire/IOFWAddressSpace.h b/QualcommWireless/include/IOKit/firewire/IOFWAddressSpace.h new file mode 100644 index 0000000..7ad6764 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWAddressSpace.h @@ -0,0 +1,331 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * + * IOFWAddressSpace.h + * + * Classes which describe addresses in the local node which are accessable to other nodes + * via firewire asynchronous read/write/lock requests. + */ + +#ifndef _IOKIT_IOFWADDRESSSPACE_H +#define _IOKIT_IOFWADDRESSSPACE_H + +#include +#include + +class IOFireWireDevice; +class IOFireWireBus; +class IOFireWireController; + +typedef void * IOFWRequestRefCon; + +/*! @function FWWriteCallback + @abstract Callback called when a write request packet is received for + a 'virtual' firewire address. + @param device is the node originating the request + @param speed is the FireWire speed of the request, update it if you need to control + the speed of the reply, otherwise the response will be the same speed. + @param addr is the address the device is requesting to write to + @param len is the number of bytes to write + @param buf contains the packet data + @param requestRefcon refcon Can be queried for extra info about the request, + using IOFireWireController::isLockRequest(), isQuadRequest() + @result return: + kFWResponseComplete = 0, OK + kFWResponseConflictError = 4, Resource conflict, may retry + kFWResponseDataError = 5, Data not available + kFWResponseTypeError = 6, Operation not supported + kFWResponseAddressError = 7 Address not valid in target device */ +typedef UInt32 (*FWWriteCallback)(void *refcon, UInt16 nodeID, IOFWSpeed &speed, + FWAddress addr, UInt32 len, const void *buf, IOFWRequestRefCon requestRefcon); + +/*! @function FWReadCallback + @abstract Callback called when a read request packet is received for + a 'virtual' firewire address. + @param nodeID is the node originating the request + @param speed is the FireWire speed of the request, update it if you need to control + the speed of the reply, otherwise the response will be the same speed. + @param addr is the address the device is requesting to read from + @param len is the number of bytes to read + @param buf contains the packet data + @param offset on return points to the offset into *buf of the packet data + @param requestRefcon refcon to pass back if sending a delayed response. Also can be queried + for extra info about the request + @result return: + kFWResponsePending = -1, Pseudo response, real response sent later. + kFWResponseComplete = 0, OK! + kFWResponseConflictError = 4, Resource conflict, may retry + kFWResponseDataError = 5, Data not available + kFWResponseTypeError = 6, Operation not supported + kFWResponseAddressError = 7 Address not valid in target device + + A return of kFWResponsePending should be followed at some later time by a call to + IOFireWireController::asyncReadResponse */ +typedef UInt32 (*FWReadCallback)(void *refcon, UInt16 nodeID, IOFWSpeed &speed, + FWAddress addr, UInt32 len, IOMemoryDescriptor **buf, + IOByteCount * offset, IOFWRequestRefCon requestRefcon); + +class IOFWAddressSpace; + +#pragma mark - + +/*! @class IOFWAddressSpaceAux + @discussion An IOFWAddressSpaceAux is for internal use only. You should never subclass IOFWAddressSpaceAux +*/ + +class IOFWAddressSpaceAux : public OSObject +{ + OSDeclareDefaultStructors(IOFWAddressSpaceAux) + + friend class IOFWAddressSpace; + +protected: + + IOFWAddressSpace * fPrimary; + IOFireWireController * fControl; + + OSSet * fTrustedNodeSet; + OSIterator * fTrustedNodeSetIterator; + + bool fExclusive; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFWAddressSpace * primary ); + virtual void free(); + + virtual bool isTrustedNode( UInt16 nodeID ); + virtual void addTrustedNode( IOFireWireDevice * device ); + virtual void removeTrustedNode( IOFireWireDevice * device ); + virtual void removeAllTrustedNodes( void ); + + bool isExclusive( void ); + void setExclusive( bool exclusive ); + + virtual bool intersects( IOFWAddressSpace * space ); + +private: + OSMetaClassDeclareReservedUsed(IOFWAddressSpaceAux, 0); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 1); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 2); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 3); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 4); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 5); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 6); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 7); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 8); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 9); + +}; + +#pragma mark - + +/* + * Base class for FireWire address space objects + */ + +/*! + @class IOFWAddressSpace +*/ + +class IOFWAddressSpace : public OSObject +{ + OSDeclareAbstractStructors(IOFWAddressSpace) + + friend class IOFWAddressSpaceAux; + +protected: + + IOFireWireController *fControl; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData + { + IOFWAddressSpaceAux * fAuxiliary; + }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * fIOFWAddressSpaceExpansion; + + virtual bool init(IOFireWireBus *bus); + virtual void free(); + +public: + + /*! @function doRead + @abstract An abstract method for processing an address space read request + @param nodeID FireWire Read from nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len read 'len' bytes from nodeID. + @param buf points to a memory descriptor containing the packet data. + @param offset start from this 'offset' in 'buf'. + @param refcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doRead(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + IOMemoryDescriptor **buf, IOByteCount * offset, + IOFWRequestRefCon refcon) = 0; + + /*! @function doWrite + @abstract An abstract method for processing an address space write request + @param nodeID FireWire Write to nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len write 'len' bytes to nodeID. + @param buf obtain bytes from location given by 'buf'. + @param refcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doWrite(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon) = 0; + + /*! @function doLock + @abstract A method for processing a lock request. + @param nodeID FireWire Lock request for nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param inlen 'inlen' bytes to use. + @param newVal new value to write at 'addr' location . + @param outLen 'outLen' bytes for result. + @param oldVal old value read from 'addr' location. + @param extType Type like kFWExtendedTCodeCompareSwap. + @param refcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doLock(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 inlen, + const UInt32 *newVal, UInt32 &outLen, UInt32 *oldVal, + UInt32 extType, IOFWRequestRefCon refcon); + + /*! @function activate + @abstract Address space is ready for handling requests. + @result IOReturn + */ + virtual IOReturn activate(); + + /*! @function deactivate + @abstract Address space request handler is disabled. + @result none + */ + virtual void deactivate(); + + /*! @function contains + @abstract returns number of bytes starting at addr in this space + @result 0 if it doesn't contain the address + */ + virtual UInt32 contains(FWAddress addr); + + /*! @function isTrustedNode + @abstract returns true if the node is added as a trusted node + @param nodeID is the nodeID to verify whether its trusted. + @result false if nodeID is not trusted + */ + inline bool isTrustedNode( UInt16 nodeID ) + { return fIOFWAddressSpaceExpansion->fAuxiliary->isTrustedNode( nodeID ); } + + /*! @function addTrustedNode + @abstract Add a trusted node. + @param device object pointing to a FireWire node on the bus. + @result none + */ + inline void addTrustedNode( IOFireWireDevice * device ) + { fIOFWAddressSpaceExpansion->fAuxiliary->addTrustedNode( device ); } + + /*! @function removeTrustedNode + @abstract Remove a trusted node. + @param device object pointing to a FireWire node on the bus. + @result none + */ + inline void removeTrustedNode( IOFireWireDevice * device ) + { fIOFWAddressSpaceExpansion->fAuxiliary->removeTrustedNode( device ); } + + /*! @function removeAllTrustedNodes + @abstract Remove all trusted nodes. + @result none + */ + inline void removeAllTrustedNodes( void ) + { fIOFWAddressSpaceExpansion->fAuxiliary->removeAllTrustedNodes(); } + + /*! @function isExclusive + @abstract Checks if an address space wants exclusive control of its address range + @result True if the address space is marked exclusive false otherwise + */ + + inline bool isExclusive( void ) + { return fIOFWAddressSpaceExpansion->fAuxiliary->isExclusive(); } + + /*! @function setExclusive + @abstract Sets if this address space requires exclusive control of its address range. Exclusivity should be set before an address space is activated. + @param exclusive True if address space should be exclusive, false otherwise + @result none + */ + + inline void setExclusive( bool exclusive ) + { fIOFWAddressSpaceExpansion->fAuxiliary->setExclusive( exclusive ); } + + /*! @function intersects + @abstract Checks this address space intersects with the given address range. Currently only supports IOFWPsuedoAddressSpaces. + @param space An address space to compare against + @result True if the address spaces intersect false otherwise + */ + + inline bool intersects( IOFWAddressSpace * space ) + { return fIOFWAddressSpaceExpansion->fAuxiliary->intersects( space ); } + + +protected: + + virtual IOFWAddressSpaceAux * createAuxiliary( void ); + +private: + OSMetaClassDeclareReservedUsed(IOFWAddressSpace, 0); + OSMetaClassDeclareReservedUsed(IOFWAddressSpace, 1); + +}; + +// the physical and psuedo address space classes used to be defined here +// for backwards compatibility, we pull them in now. the ifdefs surrounding +// the content of the header files ensures we do not multiply include a header. + +#include +#include + +#endif /* _IOKIT_IOFWADDRESSSPACE */ diff --git a/QualcommWireless/include/IOKit/firewire/IOFWAsyncStreamListener.h b/QualcommWireless/include/IOKit/firewire/IOFWAsyncStreamListener.h new file mode 100644 index 0000000..025b591 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWAsyncStreamListener.h @@ -0,0 +1,132 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOFWASYNCSTREAMLISTENER_H +#define _IOKIT_IOFWASYNCSTREAMLISTENER_H + +#include +#include +#include +#include + +class IOFWAsyncStreamReceiver; +class IOFWAsyncStreamReceivePort; + +/*! @class IOFWAsyncStreamListener +*/ +class IOFWAsyncStreamListener : public OSObject +{ + OSDeclareDefaultStructors(IOFWAsyncStreamListener) + +friend class IOFWAsyncStreamReceiver; +friend class IOFireWireController; + +public: + +/*! @function initAll + @abstract Creates an AsyncStream client for an Isoch channel. + @param control Points to IOFireWireController. + @param channel Isoch channel for listening. + @param proc Callback on packet reception. + @param obj Client's callback object. + @result returns true on success, else false. */ + bool initAll( IOFireWireController *control, UInt32 channel, FWAsyncStreamReceiveCallback proc, void *refcon ); + +/*! @function setListenerHandler + @abstract Set the callback that should be called to handle incoming async stream packets + @param inReceiver The callback to set. + @result Returns the callback that was previously set or nil for none.*/ + const FWAsyncStreamReceiveCallback setListenerHandler( FWAsyncStreamReceiveCallback inReceiver ); + +/*! @function TurnOffNotification + @abstract Turns off client callback notification. + @result none. */ + inline void TurnOffNotification() { fNotify = false; }; + +/*! @function TurnOnNotification + @abstract Turns on client callback notification. + @result none. */ + inline void TurnOnNotification() { fNotify = true; }; + +/*! @function IsNotificationOn + @abstract checks the notification state. + @result true if ON, else false */ + inline bool IsNotificationOn() { return fNotify; }; + +/*! @function setFlags + @abstract set flags for the listener. + @param flags indicate performance metrics. + @result none. */ + void setFlags( UInt32 flags ); + +/*! @function getFlags + @abstract get the flags of listener. + @param none. + @result flags. */ + UInt32 getFlags(); + +/*! @function getRefCon + @abstract get the refcon specific to this listener. + @param none. + @result fRefCon refcon passed during initialization. */ + inline void* getRefCon() { return fRefCon; }; + +/*! @function getOverrunCounter + @abstract get overrun counter from the DCL program. + @param none. + @result returns the counter value. */ + UInt32 getOverrunCounter(); + +protected: + + FWAsyncStreamReceiveCallback fClientProc; + void *fRefCon; + IOFWAsyncStreamReceiver *fReceiver; + bool fNotify; + UInt32 fFlags; + IOFireWireController *fControl; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual void free(void) APPLE_KEXT_OVERRIDE; + +private: +/*! function getReceiver + abstract Returns the Async Stream receiver object which tracks multiple + IOFWAsyncStreamListeners for the same Isoc channel. */ + inline IOFWAsyncStreamReceiver *getReceiver() { return fReceiver; }; + +/*! function invokeClients + abstract Invokes client's callback function with fRefCon. */ + void invokeClients( UInt8 *buffer ); + + OSMetaClassDeclareReservedUnused(IOFWAsyncStreamListener, 0); + OSMetaClassDeclareReservedUnused(IOFWAsyncStreamListener, 1); +}; +#endif // _IOKIT_IOFWASYNCSTREAMLISTENER_H + diff --git a/QualcommWireless/include/IOKit/firewire/IOFWCommand.h b/QualcommWireless/include/IOKit/firewire/IOFWCommand.h new file mode 100644 index 0000000..fdf85b5 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWCommand.h @@ -0,0 +1,977 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFWCommand.h + * + */ +#ifndef _IOKIT_IOFWCOMMAND_H +#define _IOKIT_IOFWCOMMAND_H + +#include +#include + +#include + +#include + +#define kFWCmdDefaultRetries 3 +#define kFWCmdZeroRetries 0 +#define kFWCmdReducedRetries 2 +#define kFWCmdIncreasedRetries 6 + +class IOMemoryDescriptor; +class IOSyncer; +class IOFireWireBus; +class IOFireWireController; +class IOFireWireNub; +class IOFWAddressSpace; // Description of chunk of local FW address space +class IOFWCommand; +class IOFWBusCommand; +class IOFWAsyncStreamCommand; +class IOCommandGate; +class IOFWAsyncPHYCommand; + +struct AsyncPendingTrans; + +// Struct for head of command queue +/*! + @struct IOFWCmdQ + @abstract Structure for head of a queue of IOFWCommands + @field fHead Points to the head of the queue, or NULL if queue is empty + @field fTail Points to the tail of the queue, or NULL if queue is empty + @function headChanged called when head command is changed, or the command + itself changes state. +*/ + +struct IOFWCmdQ +{ + IOFWCommand *fHead; + IOFWCommand *fTail; + bool executeQueue(bool all); + virtual void headChanged(IOFWCommand *oldHead); + + virtual ~IOFWCmdQ() {} + + void checkProgress( void ); +}; + +// Callback when device command completes asynchronously +typedef void (*FWDeviceCallback)(void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd); + +// Callback when bus command completes asynchronously +typedef void (*FWBusCallback)(void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd); + +// Callback when async stream command completes asynchronously +typedef void (*FWAsyncStreamCallback)(void *refcon, IOReturn status, IOFireWireBus *bus, IOFWAsyncStreamCommand *fwCmd); + +// Callback when async stream command completes asynchronously +typedef void (*FWAsyncPHYCallback)(void *refcon, IOReturn status, IOFireWireBus *bus, IOFWAsyncPHYCommand *fwCmd ); + +// Callback when async stream packet is received +typedef void (*FWAsyncStreamReceiveCallback)(void *refcon, const void *buf); + +#pragma mark - + +/* + * Base class for FireWire commands + */ +/*! @class IOFWCommand +*/ +class IOFWCommand : public IOCommand +{ + OSDeclareAbstractStructors(IOFWCommand) + +protected: + IOReturn fStatus; + IOFireWireController *fControl; + IOFWCommand * fQueuePrev; + IOFWCommand * fQueueNext; + IOFWCmdQ * fQueue; + UInt32 fTimeout; // How long (in microsecs) after execute() to timeout + AbsoluteTime fDeadline; // Time after which this command has timed out. + IOFWSyncer * fSyncWakeup; + UInt8 fSync; + UInt8 fCancelOnReset; + UInt8 spare[2]; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct MemberVariables + { + void * fFWIMRefCon; + IOReturn fCompletionStatus; + bool fSubmitTimeLatched; + AbsoluteTime fSubmitTime; + bool fFlush; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + MemberVariables * fMembers; + + virtual IOReturn complete(IOReturn status); + virtual void updateTimer(); + virtual IOReturn startExecution(); + + /* + * Execute the FWCommand immediately + * must be called with the workloop gate closed + */ + virtual IOReturn execute() = 0; + +public: + + virtual bool initWithController(IOFireWireController *control); + virtual void free( void ); + + IOReturn getStatus() const { return fStatus; }; + + /* + * Submit the FWCommand. + * if queue is false the command's execute() + * method will be called on the caller's thread, otherwise + * the command wil be queued for execution on the work loop thread. + */ + virtual IOReturn submit(bool queue = false); + + /* + * Cancel command, causes it to complete with given status + */ + virtual IOReturn cancel(IOReturn reason); + + /*! + @function setHead + inserts a command at the head of a queue. + @param queue queue command is being added to + */ + virtual void setHead(IOFWCmdQ &queue); + /*! + @function insertAfter + inserts a command after the specified one. + @param prev command to insert after + @param queue queue command is being added to + */ + virtual void insertAfter(IOFWCommand &prev); + + /*! + @function removeFromQ + Removes command from current queue. + */ + virtual void removeFromQ(); + + IOFWCommand *getPrevious() const + { return fQueuePrev; }; + IOFWCommand *getNext() const + { return fQueueNext; }; + const AbsoluteTime &getDeadline() const + { return fDeadline; }; + + bool cancelOnReset() const + { return fCancelOnReset; }; + + bool Busy() const + { return fStatus == kIOReturnBusy || fStatus == kIOFireWirePending;}; + + void setTimeout( UInt32 timeout ) + { fTimeout = timeout; }; + + friend class IOFWCmdQ; + + void * getFWIMRefCon( void ) + { + return fMembers->fFWIMRefCon; + } + + void setFWIMRefCon( void * refcon ) + { + fMembers->fFWIMRefCon = refcon; + } + + void setFlush( bool flush ) + { + fMembers->fFlush = flush; + } + + virtual IOReturn checkProgress( void ); + +private: + OSMetaClassDeclareReservedUsed(IOFWCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWCommand, 1); + +}; + +#pragma mark - + +/* + * Bus control commands + */ +/*! @class IOFWBusCommand +*/ +class IOFWBusCommand : public IOFWCommand +{ + OSDeclareAbstractStructors(IOFWBusCommand) + +protected: + FWBusCallback fComplete; + void * fRefCon; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual IOReturn complete(IOReturn status); + + virtual bool initWithController(IOFireWireController *control, + FWBusCallback completion=NULL, void *refcon=NULL); + virtual IOReturn reinit(FWBusCallback completion, void *refcon); + +private: + OSMetaClassDeclareReservedUnused(IOFWBusCommand, 0); + +}; + +#pragma mark - + +/* + * Command to execute some code after a specified delay (in microseconds) + * All it does is timeout after the specified delay, hence calling the completion + * callback. + */ +/*! @class IOFWDelayCommand +*/ +class IOFWDelayCommand : public IOFWBusCommand +{ + OSDeclareDefaultStructors(IOFWDelayCommand) + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +protected: + virtual IOReturn execute(); + +public: + virtual bool initWithDelay(IOFireWireController *control, UInt32 uSecs, + FWBusCallback completion, void *refcon); + virtual IOReturn reinit(UInt32 uSecs, FWBusCallback completion, void *refcon); + +private: + OSMetaClassDeclareReservedUnused(IOFWDelayCommand, 0); + +}; + +/* + * Send an async request to a device + */ +class IOFWUserReadQuadletCommand ; +class IOFWUserWriteCommand ; + +#pragma mark - + +/*! @class IOFWAsyncCommand +*/ +class IOFWAsyncCommand : public IOFWCommand +{ + OSDeclareAbstractStructors(IOFWAsyncCommand) + +protected: + IOFireWireNub * fDevice; + FWDeviceCallback fComplete; + void * fRefCon; + IOMemoryDescriptor *fMemDesc; + AsyncPendingTrans * fTrans; + UInt32 fAddressHi; + UInt32 fAddressLo; + IOByteCount fBytesTransferred; + int fSize; + int fSpeed; + int fMaxPack; + int fCurRetries; + int fMaxRetries; + UInt32 fGeneration; // bus topology fNodeID is valid for. + UInt16 fNodeID; + bool fFailOnReset; + bool fWrite; + + typedef struct + { + // some of our subclasses didn't have room for expansion data, so + // we've reserved space for their use here. + + void * fSubclassMembers; + int fMaxSpeed; + int fAckCode; + UInt32 fResponseCode; + UInt32 fFastRetryCount; + int fResponseSpeed; + bool fForceBlockRequests; + } + MemberVariables; + + MemberVariables * fMembers; + + virtual IOReturn complete(IOReturn status); + virtual bool initWithController(IOFireWireController *control); + virtual bool initAll(IOFireWireNub *device, FWAddress devAddress, + IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon, bool failOnReset); + virtual bool initAll(IOFireWireController *control, + UInt32 generation, FWAddress devAddress, + IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon); + virtual void free( void ); + virtual IOReturn reinit(FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon, bool failOnReset); + virtual IOReturn reinit(UInt32 generation, FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon); + bool createMemberVariables( void ); + void destroyMemberVariables( void ); +public: + // Utility for setting generation on newly created command + virtual void setGeneration(UInt32 generation) + { fGeneration = generation; } + + // To be called by IOFireWireController and derived classes. + virtual void gotPacket(int rcode, const void* data, int size) = 0; + virtual void gotAck(int ackCode); + + // update nodeID/generation after bus reset, from the device object + IOReturn updateGeneration(); + // explicitly update nodeID/generation after bus reset + IOReturn updateNodeID(UInt32 generation, UInt16 nodeID); + + // Generally useful stuff + IOByteCount getBytesTransferred() const + { return fBytesTransferred; }; + + FWAddress getAddress() const + { return FWAddress(fAddressHi, fAddressLo, fNodeID); } + + bool failOnReset() const + { return fFailOnReset; } + + IOFireWireNub * getDevice() const + { return fDevice; } + + /*! + @function setMaxPacket + Sets the maximum size for block transfers used by the command. + The command is initialized to use the maximum packet size calculated from the device's + PHY speed, bus info block and the bus topology. + Call this method before calling submit(). + @param maxBytes Maximum packet size in bytes. If the maxsize is 4 then quadlet transfers will be used. + */ + IOReturn setMaxPacket(UInt32 maxBytes) + { + if(fStatus == kIOReturnBusy || fStatus == kIOFireWirePending) + return fStatus; + fMaxPack = maxBytes; + return kIOReturnSuccess; + } + + void setMaxSpeed( int speed ); + + void setAckCode( int ack ); + int getAckCode( void ); + + void setRetries( int retries); + int getMaxRetries( void ); + + void setResponseCode( UInt32 rcode ); + UInt32 getResponseCode( void ) const; + + void setFastRetryCount( UInt32 count ) + { fMembers->fFastRetryCount = count; }; + + UInt32 getFastRetryCount( void ) + { return fMembers->fFastRetryCount; }; + + void setResponseSpeed( int speed ) + { fMembers->fResponseSpeed = speed; }; + + int getResponseSpeed( void ) + { return fMembers->fResponseSpeed; }; + + // forces even 4 byte transactions to be block requests + void setForceBlockRequests( bool enabled ) + { fMembers->fForceBlockRequests = enabled; } + + virtual IOReturn checkProgress( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFWAsyncCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWAsyncCommand, 1); + OSMetaClassDeclareReservedUnused(IOFWAsyncCommand, 2); + OSMetaClassDeclareReservedUnused(IOFWAsyncCommand, 3); + +}; + +#pragma mark - + +/* + * Concrete async requests - read, write and hordes of read/modify/write + */ +class IOFWReadCommand : public IOFWAsyncCommand +{ + OSDeclareDefaultStructors(IOFWReadCommand) + +protected: + + virtual void gotPacket(int rcode, const void* data, int size); + + virtual IOReturn execute(); + +public: + virtual bool initAll(IOFireWireNub *device, FWAddress devAddress, + IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon, bool failOnReset); + virtual bool initAll(IOFireWireController *control, + UInt32 generation, FWAddress devAddress, + IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon); + virtual IOReturn reinit(FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + virtual IOReturn reinit(UInt32 generation, FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion=NULL, void *refcon=NULL); + +private: + OSMetaClassDeclareReservedUnused(IOFWReadCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWReadCommand, 1); +}; + +#pragma mark - + +/*! + @class IOFWReadQuadCommand + @discussion An easier to use version of IOFWReadCommand for use when the data to be transferred + is an integer number of quads. + Note that block read requests will be used for transfers greater than one quad unless setMaxPacket(4) + is called. +*/ + +class IOFWReadQuadCommand : public IOFWAsyncCommand +{ + OSDeclareDefaultStructors(IOFWReadQuadCommand) + +protected: + + UInt32 * fQuads; + + typedef struct + { + bool fPingTime; + } + MemberVariables; + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + virtual void free( void ); + + virtual void gotPacket(int rcode, const void* data, int size); + + virtual IOReturn execute(); + +public: + virtual bool initAll(IOFireWireNub *device, FWAddress devAddress, + UInt32 *quads, int numQuads, + FWDeviceCallback completion, void *refcon, bool failOnReset); + + virtual bool initAll(IOFireWireController *control, + UInt32 generation, FWAddress devAddress, + UInt32 *quads, int numQuads, + FWDeviceCallback completion, void *refcon); + + virtual IOReturn reinit(FWAddress devAddress, UInt32 *quads, int numQuads, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + + virtual IOReturn reinit(UInt32 generation, FWAddress devAddress, UInt32 *quads, int numQuads, + FWDeviceCallback completion=NULL, void *refcon=NULL); + + void setPingTime( bool state ) + { ((MemberVariables*)fMembers->fSubclassMembers)->fPingTime = state; }; + +private: + OSMetaClassDeclareReservedUnused(IOFWReadQuadCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWReadQuadCommand, 1); +}; + +#pragma mark - + +class IOFWWriteCommand : public IOFWAsyncCommand +{ + + OSDeclareDefaultStructors(IOFWWriteCommand) + +protected: + + int fPackSize; + + typedef struct + { + bool fDeferredNotify; + bool fFastRetryOnBusy; + } + MemberVariables; + + virtual IOReturn execute(); + + virtual void gotPacket( int rcode, const void* data, int size ); + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + +public: + + virtual bool initWithController(IOFireWireController *control); + virtual bool initAll( IOFireWireNub * device, + FWAddress devAddress, + IOMemoryDescriptor * hostMem, + FWDeviceCallback completion, + void * refcon, + bool failOnReset ); + + virtual bool initAll( IOFireWireController * control, + UInt32 generation, + FWAddress devAddress, + IOMemoryDescriptor * hostMem, + FWDeviceCallback completion, + void * refcon ); + virtual void free( void ); + + virtual IOReturn reinit( FWAddress devAddress, + IOMemoryDescriptor * hostMem, + FWDeviceCallback completion = NULL, + void * refcon = NULL, + bool failOnReset = false ); + + virtual IOReturn reinit( UInt32 generation, + FWAddress devAddress, + IOMemoryDescriptor * hostMem, + FWDeviceCallback completion = NULL, + void * refcon = NULL ); + + void setDeferredNotify( bool state ) + { ((MemberVariables*)fMembers->fSubclassMembers)->fDeferredNotify = state; }; + + void setFastRetryOnBusy( bool state ) + { ((MemberVariables*)fMembers->fSubclassMembers)->fFastRetryOnBusy = state; }; + +private: + + OSMetaClassDeclareReservedUnused(IOFWWriteCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWWriteCommand, 1); + +}; + +#pragma mark - + +/*! + @class IOFWWriteQuadCommand + @discussion An easier to use version of IOFWWriteCommand for use when the data to be transferred + is small and an integer number of quads. + Note that block read requests will be used for transfers greater than one quad unless setMaxPacket(4) + is called. + kMaxWriteQuads is the largest legal number of quads that this object can be asked to transfer + (the data is copied into an internal buffer in init() and reinit()). +*/ + +class IOFWWriteQuadCommand : public IOFWAsyncCommand +{ + + OSDeclareDefaultStructors(IOFWWriteQuadCommand) + +public: + + enum + { + kMaxWriteQuads = 8 + }; + +protected: + + UInt32 fQuads[kMaxWriteQuads]; + UInt32 * fQPtr; + int fPackSize; + + typedef struct + { + bool fDeferredNotify; + IOMemoryDescriptor * fMemory; + } + MemberVariables; + + virtual void gotPacket( int rcode, const void* data, int size ); + + virtual IOReturn execute(); + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + +public: + virtual bool initWithController(IOFireWireController *control); + + virtual bool initAll( IOFireWireNub * device, + FWAddress devAddress, + UInt32 * quads, + int numQuads, + FWDeviceCallback completion, + void * refcon, + bool failOnReset ); + + virtual bool initAll( IOFireWireController * control, + UInt32 generation, + FWAddress devAddress, + UInt32 * quads, + int numQuads, + FWDeviceCallback completion, + void * refcon ); + + virtual void free( void ); + + virtual IOReturn reinit( FWAddress devAddress, + UInt32 * quads, + int numQuads, + FWDeviceCallback completion = NULL, + void * refcon = NULL, + bool failOnReset = false ); + + virtual IOReturn reinit( UInt32 generation, + FWAddress devAddress, + UInt32 * quads, + int numQuads, + FWDeviceCallback completion = NULL, + void * refcon = NULL ); + +protected: + + void setQuads( UInt32 * quads, int numQuads ); + bool createMemoryDescriptor( void ); + void destroyMemoryDescriptor( void ); + +public: + + void setDeferredNotify( bool state ) + { ((MemberVariables*)fMembers->fSubclassMembers)->fDeferredNotify = state; }; + +private: + + OSMetaClassDeclareReservedUnused(IOFWWriteQuadCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWWriteQuadCommand, 1); + +}; + +/* + * May need more parameters for some of these, + * and/or derive from a base Lock transaction command + */ + +#pragma mark - + +/*! @class IOFWCompareAndSwapCommand +*/ +class IOFWCompareAndSwapCommand : public IOFWAsyncCommand +{ + OSDeclareDefaultStructors(IOFWCompareAndSwapCommand) + +protected: + UInt32 fInputVals[4]; + UInt32 fOldVal[2]; + + typedef struct + { + IOMemoryDescriptor * fMemory; + } + MemberVariables; + + MemberVariables * fMembers; + + virtual void gotPacket(int rcode, const void* data, int size); + + virtual IOReturn execute(); + +public: + // Compare to cmpVal, and if equal replace with newVal. + // Size = 1 for 32 bit operation (one quad), 2 for 64 bit (two quads) + virtual bool initWithController(IOFireWireController *control); + virtual bool initAll(IOFireWireNub *device, FWAddress devAddress, + const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion, void *refcon, bool failOnReset); + virtual bool initAll(IOFireWireController *control, + UInt32 generation, FWAddress devAddress, + const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion, void *refcon); + + virtual IOReturn reinit(FWAddress devAddress, const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion=NULL, void *refcon=NULL, bool failOnReset=false); + virtual IOReturn reinit(UInt32 generation, FWAddress devAddress, + const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion=NULL, void *refcon=NULL); + + // sets oldVal to the old value returned by the device, and + // returns true if it was the expected value, ie. the lock succeeded + virtual bool locked(UInt32 *oldVal); + + virtual void free( void ); + +protected: + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + + void setInputVals( const UInt32 * cmpVal, const UInt32 * newVal, int size ); + + bool createMemoryDescriptor( void ); + void destroyMemoryDescriptor( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFWCompareAndSwapCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWCompareAndSwapCommand, 1); + OSMetaClassDeclareReservedUnused(IOFWCompareAndSwapCommand, 2); + OSMetaClassDeclareReservedUnused(IOFWCompareAndSwapCommand, 3); + +}; + +/* + * Send an async stream packet + */ + +#pragma mark - + +/*! @class IOFWAsyncStreamCommand +*/ +class IOFWAsyncStreamCommand : public IOFWCommand +{ + // temporary for debugging: + friend class IOFireWireUserClient ; + + OSDeclareDefaultStructors(IOFWAsyncStreamCommand) + +protected: + FWAsyncStreamCallback fComplete; + void * fRefCon; + IOMemoryDescriptor * fMemDesc; + int fSpeed; + int fSize; + int fCurRetries; + int fMaxRetries; + int fChannel; + int fSyncBits; + int fTag; + UInt32 fGeneration; // bus topology fNodeID is valid for. + bool fFailOnReset; + + typedef struct + { } + MemberVariables; + + MemberVariables * fMembers; + + virtual IOReturn complete( + IOReturn status); + + // To be called by IOFireWireController and derived classes. + virtual IOReturn execute(); + +public: + + virtual bool initAll( + IOFireWireController * control, + UInt32 generation, + UInt32 channel, + UInt32 sync, + UInt32 tag, + IOMemoryDescriptor * hostMem, + UInt32 size, + int speed, + FWAsyncStreamCallback completion, + void * refcon); + + virtual void free( void ); + + virtual IOReturn reinit( UInt32 generation, + UInt32 channel, + UInt32 sync, + UInt32 tag, + IOMemoryDescriptor * hostMem, + UInt32 size, + int speed, + FWAsyncStreamCallback completion, + void * refcon); + + virtual void gotAck( + int ackCode); + // Utility for setting generation on newly created command + virtual void setGeneration( + UInt32 generation) + { fGeneration = generation; } + + + // update nodeID/generation after bus reset, from the device object + IOReturn updateGeneration(); + + bool failOnReset() const + { return fFailOnReset; } + +private: + OSMetaClassDeclareReservedUnused(IOFWAsyncStreamCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWAsyncStreamCommand, 1); + +public: + virtual bool initAll( + IOFireWireController * control, + UInt32 generation, + UInt32 channel, + UInt32 sync, + UInt32 tag, + IOMemoryDescriptor * hostMem, + UInt32 size, + int speed, + FWAsyncStreamCallback completion, + void * refcon, + bool failOnReset ); + + + virtual IOReturn reinit( + UInt32 generation, + UInt32 channel, + UInt32 sync, + UInt32 tag, + IOMemoryDescriptor * hostMem, + UInt32 size, + int speed, + FWAsyncStreamCallback completion, + void * refcon, + bool failOnReset); + + +}; + +/* + * Send an async PHY packet + */ + +#pragma mark - + +/*! @class IOFWAsyncPHYCommand +*/ +class IOFWAsyncPHYCommand : public IOFWCommand +{ + // temporary for debugging: + friend class IOFireWireUserClient; + + OSDeclareDefaultStructors( IOFWAsyncPHYCommand ) + +protected: + AsyncPendingTrans * fTrans; + FWAsyncPHYCallback fComplete; + void * fRefCon; + int fCurRetries; + int fMaxRetries; + UInt32 fGeneration; + bool fFailOnReset; + UInt32 fData1; + UInt32 fData2; + int fAckCode; + UInt32 fResponseCode; + + typedef struct + { } + MemberVariables; + + MemberVariables * fMembers; + + virtual IOReturn complete( + IOReturn status ); + + // To be called by IOFireWireController and derived classes. + virtual IOReturn execute(); + + void setResponseCode( UInt32 rcode ); + void setAckCode( int ack ); + +public: + + virtual bool initAll( + IOFireWireController * control, + UInt32 generation, + UInt32 data1, + UInt32 data2, + FWAsyncPHYCallback completion, + void * refcon, + bool failOnReset ); + virtual void free( void ); + + virtual IOReturn reinit( UInt32 generation, + UInt32 data1, + UInt32 data2, + FWAsyncPHYCallback completion, + void * refcon, + bool failOnReset ); + + virtual void gotAck( + int ackCode ); + + // Utility for setting generation on newly created command + virtual void setGeneration( + UInt32 generation ) + { fGeneration = generation; } + + + // update nodeID/generation after bus reset, from the device object + IOReturn updateGeneration(); + + bool failOnReset() const + { return fFailOnReset; } + + + virtual void gotPacket( int rcode ); + + int getAckCode( void ); + UInt32 getResponseCode( void ) const; + + void setRetries( int retries); +private: + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 1); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 2); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 3); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 4); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 5); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 6); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 7); +}; + +#endif /* _IOKIT_IOFWCOMMAND_H */ diff --git a/QualcommWireless/include/IOKit/firewire/IOFWDCL.h b/QualcommWireless/include/IOKit/firewire/IOFWDCL.h new file mode 100644 index 0000000..719e243 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWDCL.h @@ -0,0 +1,343 @@ +/* +* IOFWDCL.h +* IOFireWireFamily +* +* Created by Niels on Fri Feb 21 2003. +* Copyright (c) 2003 Apple Computer, Inc. All rights reserved. +* +* $Log: not supported by cvs2svn $ +* Revision 1.19 2007/03/14 01:01:12 collin +* *** empty log message *** +* +* Revision 1.18 2007/01/26 23:42:19 ayanowit +* another fix for nuDCL rosetta mode +* +* Revision 1.17 2006/08/16 01:41:41 collin +* *** empty log message *** +* +* Revision 1.16 2006/03/09 22:26:46 niels +* fix 4466075 +* +* Revision 1.15 2006/03/09 22:20:14 niels +* fix 4466075 +* +* Revision 1.14 2006/03/09 21:40:44 niels +* fix 4466075 +* +* Revision 1.13 2006/02/09 00:21:50 niels +* merge chardonnay branch to tot +* +* Revision 1.12.4.1 2005/08/06 01:31:31 collin +* *** empty log message *** +* +* Revision 1.12 2005/02/18 03:19:03 niels +* fix isight +* +* Revision 1.11 2004/04/19 21:51:49 niels +* *** empty log message *** +* +* Revision 1.10 2004/03/25 00:00:23 niels +* fix panic allocating large physical address spaces +* +* Revision 1.9 2003/10/31 02:40:58 niels +* *** empty log message *** +* +* Revision 1.8 2003/08/26 05:11:21 niels +* *** empty log message *** +* +* Revision 1.7 2003/08/25 08:39:15 niels +* *** empty log message *** +* +* Revision 1.6 2003/08/18 23:18:14 niels +* *** empty log message *** +* +* Revision 1.5 2003/08/08 22:30:32 niels +* *** empty log message *** +* +* Revision 1.4 2003/07/30 05:22:14 niels +* *** empty log message *** +* +* Revision 1.3 2003/07/29 22:49:22 niels +* *** empty log message *** +* +* Revision 1.2 2003/07/21 06:52:58 niels +* merge isoch to TOT +* +* Revision 1.1.2.5 2003/07/18 00:17:41 niels +* *** empty log message *** +* +* Revision 1.1.2.4 2003/07/14 22:08:53 niels +* *** empty log message *** +* +* Revision 1.1.2.3 2003/07/11 18:15:33 niels +* *** empty log message *** +* +* Revision 1.1.2.2 2003/07/03 22:10:24 niels +* fix iidc/dv rcv +* +* Revision 1.1.2.1 2003/07/01 20:54:06 niels +* isoch merge +* +*/ + +#import + +#import +#import +#import + +class IODCLProgram ; +class OSIterator ; +class IOFireWireLink ; +class IOMemoryMap ; + +/*! @class IOFWDCL +*/ + +class IOFWDCL : public OSObject +{ + OSDeclareAbstractStructors( IOFWDCL ) ; + + public: + + typedef void (*Callback)( void * refcon ) ; + + enum + { + kDynamic = BIT(1)//kNuDCLDynamic, + ,kUpdateBeforeCallback = BIT(2)//kNuDCLUpdateBeforeCallback + ,kUser = BIT(18) // kNuDCLUser + ,kBigEndianUpdates = BIT(19) // NOTE: Don't change this without making similar change to IOFireWireLib's NuDCL::Export(...)! + } ; + + class InternalData + { + public: + + IOFWDCL * lastBranch ; + } ; + + protected: + + IOFWDCL* fBranch ; + Callback fCallback ; + volatile UInt32 * fTimeStampPtr ; + UInt32 fRangeCount ; + IOVirtualRange * fRanges ; + OSSet* fUpdateList ; + OSIterator * fUpdateIterator ; + volatile UInt32 * fUserStatusPtr ; + void* fRefcon ; + UInt32 fFlags ; + + InternalData * fLoLevel ; + + public: + + // + // IOFWDCL public API: + // + + virtual bool initWithRanges ( + OSSet * updateSet, + unsigned rangesCount = 0, + IOVirtualRange ranges [] = NULL ) ; + + void setBranch( IOFWDCL* branch ) ; + IOFWDCL* getBranch() const ; + void setTimeStampPtr ( UInt32* timeStampPtr ) ; + UInt32* getTimeStampPtr () const ; + void setCallback( Callback callback ) ; + Callback getCallback() const ; + void setStatusPtr( UInt32* statusPtr ) ; + UInt32* getStatusPtr() const ; + void setRefcon( void * refcon ) ; + void * getRefcon() const ; + const OSSet* getUpdateList() const ; + + virtual IOReturn addRange ( IOVirtualRange& range ) ; + virtual IOReturn setRanges ( UInt32 numRanges, IOVirtualRange ranges[] ) ; + virtual UInt32 getRanges( UInt32 maxRanges, IOVirtualRange ranges[] ) const ; + virtual UInt32 countRanges() ; + virtual IOReturn getSpan( IOVirtualRange& result ) const ; + virtual IOByteCount getSize() const ; + IOReturn appendUpdateList( IOFWDCL* updateDCL ) ; + IOReturn setUpdateList( OSSet* updateList ) ; + void emptyUpdateList() ; + void setFlags( UInt32 flags ) ; + UInt32 getFlags() const ; + + + virtual void update() = 0 ; + + // OSObject + + virtual void free (void) APPLE_KEXT_OVERRIDE; + + public: + + // + // internal use only; please don't use... + // + + virtual IOReturn compile( IODCLProgram & , bool & ) = 0 ; + virtual void link () = 0 ; + + OSMetaClassDeclareReservedUnused ( IOFWDCL, 4 ) ; // used to be relink() + + public : + virtual bool interrupt( bool &, IOFWDCL * & ) = 0 ; + virtual void finalize ( IODCLProgram & ) ; + virtual IOReturn importUserDCL ( + UInt8 * data, + IOByteCount & dataSize, + IOMemoryMap * bufferMap, + const OSArray * dcl ) ; + + protected : + + friend class IOFWDCLFriend ; + + public : + + // dump DCL info... + virtual void debug() ; + + public: + + // + // internal use only; please don't use... + // + + virtual bool checkForInterrupt() = 0 ; + + OSMetaClassDeclareReservedUsed ( IOFWDCL, 0 ) ; + OSMetaClassDeclareReservedUnused ( IOFWDCL, 1 ) ; + OSMetaClassDeclareReservedUnused ( IOFWDCL, 2 ) ; + OSMetaClassDeclareReservedUnused ( IOFWDCL, 3 ) ; +// OSMetaClassDeclareReservedUnused ( ***, 4 ) ; // used above + +} ; + +#pragma mark - + +/*! @class IOFWReceiveDCL +*/ + +class IOFWReceiveDCL : public IOFWDCL +{ + OSDeclareAbstractStructors( IOFWReceiveDCL ) + + protected : + + UInt8 fHeaderBytes ; + bool fWait ; + + public: + + // me + virtual bool initWithParams( + OSSet * updateSet, + UInt8 headerBytes, + unsigned rangesCount, + IOVirtualRange ranges [] ) ; + IOReturn setWaitControl( bool wait ) ; + + public : + + // internal use only: + virtual IOReturn importUserDCL ( + UInt8 * data, + IOByteCount & dataSize, + IOMemoryMap * bufferMap, + const OSArray * dcl ) APPLE_KEXT_OVERRIDE; + + protected : + + virtual void debug(void) APPLE_KEXT_OVERRIDE; + +} ; + +#pragma mark - + +/*! @class IOFWSendDCL +*/ + +class IOFWSendDCL : public IOFWDCL +{ + OSDeclareAbstractStructors( IOFWSendDCL ) + + protected: + + UInt32 * fUserHeaderPtr ; // pointer to 2 quadlets containing isoch header for this packet + UInt32 * fUserHeaderMaskPtr ; // pointer to 2 quadlets; used to mask header quadlets + IOFWDCL * fSkipBranchDCL ; + Callback fSkipCallback ; + void * fSkipRefcon ; + UInt8 fSync ; + UInt8 fTag ; + + public: + + // OSObject + virtual void free(void) APPLE_KEXT_OVERRIDE; + + // IOFWDCL + virtual IOReturn addRange ( IOVirtualRange& range ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setRanges ( UInt32 numRanges, IOVirtualRange ranges[] ) APPLE_KEXT_OVERRIDE; + + // me + virtual bool initWithParams( OSSet * updateSet, + unsigned rangesCount = 0, + IOVirtualRange ranges [] = NULL, + UInt8 sync = 0, + UInt8 tag = 0 ) ; + + void setUserHeaderPtr( UInt32* userHeaderPtr, UInt32 * maskPtr ) ; + UInt32 * getUserHeaderPtr() ; + UInt32 * getUserHeaderMask() ; + void setSkipBranch( IOFWDCL * skipBranchDCL ) ; + IOFWDCL * getSkipBranch() const ; + void setSkipCallback( Callback callback ) ; + Callback getSkipCallback() const ; + void setSkipRefcon( void * refcon = 0 ) ; + void * getSkipRefcon() const ; + void setSync( UInt8 sync ) ; + UInt8 getSync() const ; + void setTag( UInt8 tag ) ; + UInt8 getTag() const ; + + public : + + // internal use only: + virtual IOReturn importUserDCL ( + UInt8 * data, + IOByteCount & dataSize, + IOMemoryMap * bufferMap, + const OSArray * dcl ) APPLE_KEXT_OVERRIDE; + protected : + + virtual void debug(void) APPLE_KEXT_OVERRIDE; +} ; + +#pragma mark - + +/*! @class IOFWSkipCycleDCL +*/ + +class IOFWSkipCycleDCL : public IOFWDCL +{ + OSDeclareAbstractStructors( IOFWSkipCycleDCL ) + + public: + + virtual bool init(void) APPLE_KEXT_OVERRIDE; + + virtual IOReturn addRange ( IOVirtualRange& range ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setRanges ( UInt32 numRanges, IOVirtualRange ranges[] ) APPLE_KEXT_OVERRIDE; + virtual IOReturn getSpan( IOVirtualRange& result ) ; + + protected : + + virtual void debug(void) APPLE_KEXT_OVERRIDE; +} ; diff --git a/QualcommWireless/include/IOKit/firewire/IOFWDCLPool.h b/QualcommWireless/include/IOKit/firewire/IOFWDCLPool.h new file mode 100644 index 0000000..66fbf38 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWDCLPool.h @@ -0,0 +1,157 @@ +/* + * IOFWNuDCLPool.h + * IOFireWireFamily + * + * Created by Niels on Fri Mar 07 2003. + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * $Log: not supported by cvs2svn $ + * Revision 1.14 2008/03/03 23:31:42 ayanowit + * another gcc-42 fix. + * + * Revision 1.13 2007/01/26 20:52:31 ayanowit + * changes to user-space isoch stuff to support 64-bit apps. + * + * Revision 1.12 2006/02/09 00:21:50 niels + * merge chardonnay branch to tot + * + * Revision 1.11 2005/04/12 20:09:13 niels + * fix memory leak importing NuDCL programs from user space + * + * Revision 1.10.20.2 2006/01/31 04:49:50 collin + * *** empty log message *** + * + * Revision 1.10 2003/11/07 21:24:28 niels + * *** empty log message *** + * + * Revision 1.9 2003/11/07 21:01:18 niels + * *** empty log message *** + * + * Revision 1.8 2003/08/25 08:39:15 niels + * *** empty log message *** + * + * Revision 1.7 2003/08/22 18:15:16 niels + * *** empty log message *** + * + * Revision 1.6 2003/08/15 04:36:55 niels + * *** empty log message *** + * + * Revision 1.5 2003/07/30 05:22:14 niels + * *** empty log message *** + * + * Revision 1.4 2003/07/21 08:48:20 niels + * *** empty log message *** + * + * Revision 1.3 2003/07/21 07:52:13 niels + * *** empty log message *** + * + * Revision 1.2 2003/07/21 06:52:58 niels + * merge isoch to TOT + * + * Revision 1.1.2.3 2003/07/11 18:15:34 niels + * *** empty log message *** + * + * Revision 1.1.2.2 2003/07/09 21:24:00 niels + * *** empty log message *** + * + * Revision 1.1.2.1 2003/07/01 20:54:06 niels + * isoch merge + * + */ + +#import +#import +#import + +class IOFireWireLink ; +class IOFWDCL ; +class IOFWReceiveDCL ; +class IOFWSendDCL ; +class IOFWSkipCycleDCL ; +class IOFireWireUserClient ; +class IOMemoryDescriptor ; +class IOMemoryMap ; +class OSSet; + +/*! @class IOFWDCLPool + @discussion You should never subclass IOFWDCLPool +*/ + +class IOFWDCLPool : public OSObject +{ + OSDeclareAbstractStructors( IOFWDCLPool ) + + friend class IOFireWireUserClient ; + friend class IOFWUserLocalIsochPort ; + + protected: + + class Expansion* fReserved ; // for class expansion + + IOFireWireLink * fLink ; + UInt8 fCurrentTag ; + UInt8 fCurrentSync ; + OSArray* fProgram ; + DCLNuDCLLeader fLeader ; + + public: + + // OSObject + + virtual void free(void) APPLE_KEXT_OVERRIDE; + + // me + + virtual bool initWithLink ( IOFireWireLink& link, UInt32 capacity ) ; + + virtual void setCurrentTagAndSync ( UInt8 tag, UInt8 sync ) ; + + virtual IOFWReceiveDCL* appendReceiveDCL ( + OSSet * updateSet, + UInt8 headerBytes, + UInt32 rangesCount, + IOVirtualRange ranges[] ) ; + virtual IOFWSendDCL* appendSendDCL ( + OSSet * updateSet, + UInt32 rangesCount, + IOVirtualRange ranges[] ) ; + virtual IOFWSkipCycleDCL* appendSkipCycleDCL () ; + virtual const OSArray * getProgramRef () const ; + + protected : + + IOReturn importUserProgram ( + IOMemoryDescriptor * userExportDesc, + unsigned bufferRangeCount, + IOAddressRange bufferRanges[], + IOMemoryMap * bufferMap ) ; + IOReturn importUserDCL( + IOFWDCL * dcl, + void * importData, + IOByteCount & dataSize, + IOMemoryMap * bufferMap ) ; + + + protected : + + virtual IOFWReceiveDCL * allocReceiveDCL () = 0 ; + virtual IOFWSendDCL * allocSendDCL () = 0 ; + virtual IOFWSkipCycleDCL * allocSkipCycleDCL () = 0 ; + + private : + + void appendDCL( IOFWDCL * dcl ) ; + + public : + + DCLCommand * getProgram() ; + + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 0); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 1); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 2); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 3); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 4); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 5); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 6); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 7); +} ; diff --git a/QualcommWireless/include/IOKit/firewire/IOFWDCLProgram.h b/QualcommWireless/include/IOKit/firewire/IOFWDCLProgram.h new file mode 100644 index 0000000..144622c --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWDCLProgram.h @@ -0,0 +1,134 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFWDCLPROGRAM_H +#define _IOKIT_IOFWDCLPROGRAM_H + +#include +#include +#include +#include + +/*! @class IODCLProgram +*/ +class IODCLProgram : public OSObject +{ + OSDeclareAbstractStructors(IODCLProgram) + + private : + + void * reserved0 ;//fDCLTaskToKernel; + void * reserved1 ;//fDataTaskToKernel; + void * reserved2 ;//fDataBase; + void * reserved3 ;// IOMemoryDescriptor * fDCLDesc; + IOMemoryMap * fBufferMem ; + void * reserved5 ;// IOMemoryCursor * fDataCursor; + + protected: + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData + { + IOFWIsochResourceFlags resourceFlags ; + IODMACommand * fDMACommand; + }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * fExpansionData ; + + public : + + virtual void setIsochResourceFlags ( IOFWIsochResourceFlags flags ) ; // formerly getPhysicalSegs() + IOFWIsochResourceFlags getIsochResourceFlags () const ; + + protected: + + virtual void free (void) APPLE_KEXT_OVERRIDE; + + public: + + virtual bool init ( IOFireWireBus::DCLTaskInfo * info = NULL ) ; + virtual IOReturn allocateHW ( + IOFWSpeed speed, + UInt32 chan) = 0; + virtual IOReturn releaseHW () = 0; + virtual IOReturn compile ( + IOFWSpeed speed, + UInt32 chan) = 0; + virtual IOReturn notify ( + IOFWDCLNotificationType notificationType, + DCLCommand ** dclCommandList, + UInt32 numDCLCommands ) = 0; + virtual IOReturn start () = 0; + virtual void stop () = 0; + virtual IOReturn pause (); + virtual IOReturn resume (); + + virtual void setForceStopProc( + IOFWIsochChannel::ForceStopNotificationProc proc, + void * refCon, + IOFWIsochChannel * channel ) ; + protected : + + void generateBufferMap( DCLCommand * program ) ; + IOReturn virtualToPhysical( + IOVirtualRange ranges[], + unsigned rangeCount, + IOMemoryCursor::IOPhysicalSegment outSegments[], + unsigned & outPhysicalSegmentCount, + unsigned maxSegments ) ; + + public : + + IOMemoryMap * getBufferMap() const ; + + public : + + // close/open isoch workloop gate... + // clients should not need to call these. + virtual void closeGate() = 0 ; + virtual void openGate() = 0 ; + + virtual IOReturn synchronizeWithIO() = 0 ; + + private: + + OSMetaClassDeclareReservedUsed(IODCLProgram, 0); + OSMetaClassDeclareReservedUsed(IODCLProgram, 1); + OSMetaClassDeclareReservedUnused(IODCLProgram, 2); + OSMetaClassDeclareReservedUnused(IODCLProgram, 3); + OSMetaClassDeclareReservedUnused(IODCLProgram, 4); + +}; + +#endif /* ! _IOKIT_IOFWDCLPROGRAM_H */ + diff --git a/QualcommWireless/include/IOKit/firewire/IOFWDCLTranslator.h b/QualcommWireless/include/IOKit/firewire/IOFWDCLTranslator.h new file mode 100644 index 0000000..e02067c --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWDCLTranslator.h @@ -0,0 +1,114 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * A DCL program to interpret (in software) a program that's too complicated + * for the DMA engine. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFWDCLTRANSLATOR_H +#define _IOKIT_IOFWDCLTRANSLATOR_H + +#include +#include + + +/*! @class IODCLTranslator +*/ + +class IODCLTranslator : public IODCLProgram +{ + OSDeclareAbstractStructors(IODCLTranslator) + +protected: + enum + { + kNumPingPongs = 2, + kNumPacketsPerPingPong = 500, + kMaxIsochPacketSize = 1000, + kPingPongBufferSize = kNumPingPongs * kNumPacketsPerPingPong * kMaxIsochPacketSize + }; + + // Opcodes and buffer for pingpong program + DCLLabel fStartLabel; + DCLTransferPacket fTransfers[kNumPingPongs*kNumPacketsPerPingPong]; + DCLCallProc fCalls[kNumPingPongs]; + DCLJump fJumpToStart; + UInt8 fBuffer[kPingPongBufferSize]; + + IODCLProgram * fHWProgram; // Hardware program executing our opcodes + DCLCommand* fToInterpret; // The commands to interpret + DCLCommand* fCurrentDCLCommand; // Current command to interpret + int fPingCount; // Are we pinging or ponging? + UInt32 fPacketHeader; + + static void ListeningDCLPingPongProc(DCLCommand* pDCLCommand); + static void TalkingDCLPingPongProc(DCLCommand* pDCLCommand); + +public: + virtual bool init(DCLCommand* toInterpret); + virtual IOReturn allocateHW(IOFWSpeed speed, UInt32 chan); + virtual IOReturn releaseHW(); + virtual IOReturn notify(IOFWDCLNotificationType notificationType, + DCLCommand** dclCommandList, UInt32 numDCLCommands); + virtual void stop(); + + DCLCommand* getTranslatorOpcodes(); + void setHWProgram(IODCLProgram *program); +}; + +/*! @class IODCLTranslateTalk +*/ + +class IODCLTranslateTalk : public IODCLTranslator +{ + OSDeclareDefaultStructors(IODCLTranslateTalk) + +protected: + +public: + virtual IOReturn compile(IOFWSpeed speed, UInt32 chan); + virtual IOReturn start(); + +}; + +/*! @class IODCLTranslateListen +*/ + +class IODCLTranslateListen : public IODCLTranslator +{ + OSDeclareDefaultStructors(IODCLTranslateListen) + +protected: + +public: + virtual IOReturn compile(IOFWSpeed speed, UInt32 chan); + virtual IOReturn start(); + +}; +#endif /* ! _IOKIT_IOFWDCLPROGRAM_H */ + diff --git a/QualcommWireless/include/IOKit/firewire/IOFWIsochChannel.h b/QualcommWireless/include/IOKit/firewire/IOFWIsochChannel.h new file mode 100644 index 0000000..4bbd6c8 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWIsochChannel.h @@ -0,0 +1,132 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFWISOCHCHANNEL_H +#define _IOKIT_IOFWISOCHCHANNEL_H + +#include +#include + +enum +{ + kFWIsochChannelUnknownCondition = 0, + kFWIsochChannelNotEnoughBandwidth = 1, + kFWIsochChannelChannelNotAvailable = 2 +}; + +class IOFireWireController; +class IOFWIsochChannel; +class IOFWIsochPort; +class OSSet; +class IOFWReadQuadCommand; +class IOFWCompareAndSwapCommand; + +/*! @class IOFWIsochChannel +*/ +class IOFWIsochChannel : public OSObject +{ + OSDeclareDefaultStructors(IOFWIsochChannel) + + public: + + typedef IOReturn (ForceStopNotificationProc)(void* refCon, IOFWIsochChannel* channel, UInt32 stopCondition ); + +protected: + IOFireWireController * fControl; + ForceStopNotificationProc* fStopProc; + void * fStopRefCon; + IOFWIsochPort * fTalker; + OSSet * fListeners; + bool fDoIRM; + UInt32 fBandwidth; // Allocation units used + UInt32 fPacketSize; + IOFWSpeed fPrefSpeed; + IOFWSpeed fSpeed; // Actual speed used + UInt32 fChannel; // Actual channel used + IOFWReadQuadCommand * fReadCmd; + IOFWCompareAndSwapCommand * fLockCmd; + UInt32 fGeneration; // When bandwidth was allocated + + IOLock * fLock; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + static void threadFunc( void * arg ); + + virtual IOReturn updateBandwidth(bool claim); + virtual void reallocBandwidth( UInt32 generation ); + virtual void free(); + +public: + // Called from IOFireWireController + virtual bool init( IOFireWireController *control, bool doIRM, UInt32 packetSize, + IOFWSpeed prefSpeed, ForceStopNotificationProc* stopProc, + void *stopRefCon ); + virtual void handleBusReset(); + + // Called by clients + virtual IOReturn setTalker(IOFWIsochPort *talker); + virtual IOReturn addListener(IOFWIsochPort *listener); + + virtual IOReturn allocateChannel(); + virtual IOReturn releaseChannel(); + virtual IOReturn start(); + virtual IOReturn stop(); + +protected: + // handles IRM and channel determination and allocation. + // called by both user and kernel isoch channels + IOReturn allocateChannelBegin( IOFWSpeed speed, UInt64 allowedChans, UInt32 * channel = NULL ) ; + + // handles IRM and channel allocation. + // called by both user and kernel isoch channels + IOReturn releaseChannelComplete() ; + + IOReturn checkMemoryInRange( IOMemoryDescriptor * memory ); + +private: + OSMetaClassDeclareReservedUnused(IOFWIsochChannel, 0); + OSMetaClassDeclareReservedUnused(IOFWIsochChannel, 1); + OSMetaClassDeclareReservedUnused(IOFWIsochChannel, 2); + OSMetaClassDeclareReservedUnused(IOFWIsochChannel, 3); + +}; + +typedef IOFWIsochChannel::ForceStopNotificationProc FWIsochChannelForceStopNotificationProc ; +typedef IOFWIsochChannel::ForceStopNotificationProc* FWIsochChannelForceStopNotificationProcPtr ; + +#endif /* ! _IOKIT_IOFWISOCHCHANNEL_H */ + diff --git a/QualcommWireless/include/IOKit/firewire/IOFWIsochPort.h b/QualcommWireless/include/IOKit/firewire/IOFWIsochPort.h new file mode 100644 index 0000000..793c5e9 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWIsochPort.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * IOFWIsochPort is an abstract object that represents hardware on the bus + * (locally or remotely) that sends or receives isochronous packets. + * Local ports are implemented by the local device driver, + * Remote ports are implemented by the driver for the remote device. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFWISOCHPORT_H +#define _IOKIT_IOFWISOCHPORT_H + +#include +#include + +/*! @class IOFWIsochPort +*/ + +class IOFWIsochPort : public OSObject +{ + OSDeclareAbstractStructors(IOFWIsochPort) + +public: + // Return maximum speed and channels supported + // (bit n set = chan n supported) + virtual IOReturn getSupported(IOFWSpeed &maxSpeed, UInt64 &chanSupported) = 0; + + // Allocate hardware resources for port + virtual IOReturn allocatePort(IOFWSpeed speed, UInt32 chan) = 0; + virtual IOReturn releasePort() = 0; // Free hardware resources + virtual IOReturn start() = 0; // Start port processing packets + virtual IOReturn stop() = 0; // Stop processing packets + +private: + OSMetaClassDeclareReservedUnused(IOFWIsochPort, 0); + OSMetaClassDeclareReservedUnused(IOFWIsochPort, 1); + +}; + +#endif /* ! _IOKIT_IOFWISOCHPORT_H */ + diff --git a/QualcommWireless/include/IOKit/firewire/IOFWLocalIsochPort.h b/QualcommWireless/include/IOKit/firewire/IOFWLocalIsochPort.h new file mode 100644 index 0000000..d98bff0 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWLocalIsochPort.h @@ -0,0 +1,132 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * IOFWIsochPort is an abstract object that represents hardware on the bus + * (locally or remotely) that sends or receives isochronous packets. + * Local ports are implemented by the local device driver, + * Remote ports are implemented by the driver for the remote device. + * + * HISTORY + * + * $Log: not supported by cvs2svn $ + * Revision 1.9 2003/08/30 00:16:44 collin + * *** empty log message *** + * + * Revision 1.8 2003/08/15 04:36:55 niels + * *** empty log message *** + * + * Revision 1.7 2003/07/29 22:49:22 niels + * *** empty log message *** + * + * Revision 1.6 2003/07/21 06:52:58 niels + * merge isoch to TOT + * + * Revision 1.5.14.1 2003/07/01 20:54:07 niels + * isoch merge + * + */ + + +#ifndef _IOKIT_IOFWLOCALISOCHPORT_H +#define _IOKIT_IOFWLOCALISOCHPORT_H + +#import +#import + +class IOFireWireController; +class IODCLProgram; + +/*! @class IOFWLocalIsochPort +*/ +class IOFWLocalIsochPort : public IOFWIsochPort +{ + OSDeclareDefaultStructors(IOFWLocalIsochPort) + + protected: + + IOFireWireController * fControl; + IODCLProgram * fProgram; + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData + { + } ; + + ExpansionData * fExpansion ; + + protected : + + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + + public: + + virtual bool init ( + IODCLProgram * program, + IOFireWireController * control ) ; + + // Return maximum speed and channels supported + // (bit n set = chan n supported) + virtual IOReturn getSupported ( + IOFWSpeed & maxSpeed, + UInt64 & chanSupported ) APPLE_KEXT_OVERRIDE; + + // Allocate hardware resources for port + virtual IOReturn allocatePort ( + IOFWSpeed speed, + UInt32 chan ) APPLE_KEXT_OVERRIDE; + virtual IOReturn releasePort ( void ) APPLE_KEXT_OVERRIDE; // Free hardware resources + virtual IOReturn start ( void ) APPLE_KEXT_OVERRIDE; // Start port processing packets + virtual IOReturn stop ( void ) APPLE_KEXT_OVERRIDE; // Stop processing packets + + /*! @function notify + @abstract Informs hardware of a change to the DCL program. + @param notificationType Type of change. + @param dclCommandList List of DCL commands that have been changed. + @param numDCLCommands Number of commands in list. + @result IOKit error code. */ + virtual IOReturn notify( + IOFWDCLNotificationType notificationType, + DCLCommand ** dclCommandList, + UInt32 numDCLCommands ) ; + static void printDCLProgram ( + const DCLCommand * dcl, + UInt32 count = 0, + void (*printFN)( const char *format, ...) = NULL, + unsigned lineDelayMS = 0 ) ; + IOReturn setIsochResourceFlags ( + IOFWIsochResourceFlags flags ) ; + IODCLProgram * getProgramRef() const ; + + IOReturn synchronizeWithIO() ; + + private: + + OSMetaClassDeclareReservedUnused ( IOFWLocalIsochPort, 0 ) ; + OSMetaClassDeclareReservedUnused ( IOFWLocalIsochPort, 1 ) ; +}; + +#endif /* ! _IOKIT_IOFWLOCALISOCHPORT_H */ + diff --git a/QualcommWireless/include/IOKit/firewire/IOFWPHYPacketListener.h b/QualcommWireless/include/IOKit/firewire/IOFWPHYPacketListener.h new file mode 100644 index 0000000..ea2c6ff --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWPHYPacketListener.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2007 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOFWPHYPACKETLISTENER_H_ +#define _IOFWPHYPACKETLISTENER_H_ + +#include + +class IOFireWireController; + +// Callback when phy packet is received +typedef void (*FWPHYPacketCallback)( void *refcon, UInt32 data1, UInt32 data2 ); + +/*! @class IOFWPHYPacketListener +*/ + +class IOFWPHYPacketListener : public OSObject +{ + OSDeclareDefaultStructors( IOFWPHYPacketListener ); + + friend class IOFireWireController; + +protected: + + IOFireWireController * fControl; + FWPHYPacketCallback fCallback; + void * fRefCon; + + static IOFWPHYPacketListener * createWithController( IOFireWireController * controller ); + + virtual bool initWithController( IOFireWireController * control ); + virtual void free( void ); + +public: + + virtual IOReturn activate( void ); + virtual void deactivate( void ); + + virtual void setCallback( FWPHYPacketCallback callback ); + virtual void setRefCon( void * refcon ); + virtual void * getRefCon( void ); + +protected: + virtual void processPHYPacket( UInt32 data1, UInt32 data2 ); + + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 0 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 1 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 2 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 3 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 4 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 5 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 6 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 7 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 8 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 9 ); +}; + +#endif \ No newline at end of file diff --git a/QualcommWireless/include/IOKit/firewire/IOFWPhysicalAddressSpace.h b/QualcommWireless/include/IOKit/firewire/IOFWPhysicalAddressSpace.h new file mode 100644 index 0000000..b1944f4 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWPhysicalAddressSpace.h @@ -0,0 +1,263 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFWPHYSICALADDRESSSPACE_H +#define _IOKIT_IOFWPHYSICALADDRESSSPACE_H + +#include +#include + +/* + * Direct physical memory <-> FireWire address. + * Accesses to these addresses may be handled automatically by the + * hardware without notification. + * + * The 64 bit FireWire address of (32 bit) physical addr xxxx:xxxx is hostNode:0000:xxxx:xxxx + */ + +class IOFWPhysicalAddressSpace; + +struct FWSegment +{ + FWAddress address; + UInt32 length; +}; + +#pragma mark - + +/*! + @class IOFWPhysicalAddressSpaceAux +*/ + +class IOFWPhysicalAddressSpaceAux : public IOFWAddressSpaceAux +{ + OSDeclareDefaultStructors(IOFWPhysicalAddressSpaceAux) + + friend class IOFWAddressSpace; + friend class IOFWPhysicalAddressSpace; + +protected: + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData *reserved; + + IODMACommand * fDMACommand; + bool fDMACommandPrepared; + +public: + virtual bool init( IOFWAddressSpace * primary ); + virtual void free(); + + void setDMACommand( IODMACommand * dma_command ); + IODMACommand * getDMACommand( void ); + UInt64 getPhysicalSegment( UInt64 offset, UInt64 * length ); + + IOReturn prepare( void ); + IOReturn synchronize( IOOptionBits options ); + IOReturn complete( void ); + + bool isPrepared( void ); + + IOReturn getSegments( UInt64 * offset, FWSegment * fw_segments, UInt32 * num_segments ); + +private: + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 0); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 1); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 2); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 3); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 4); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 5); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 6); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 7); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 8); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 9); + +}; + +#pragma mark - + +/*! + @class IOFWPhysicalAddressSpace +*/ + +class IOFWPhysicalAddressSpace : public IOFWAddressSpace +{ + OSDeclareDefaultStructors(IOFWPhysicalAddressSpace) + + friend class IOFWPhysicalAddressSpaceAux; + +protected: + + IOMemoryDescriptor * fMem; // unused + vm_size_t fLen; // unused + + virtual void free(); + +public: + +/*! @function init + @abstract Initialize physical address space. + @param bus Points to IOFireWireBus object. + @result returns true if success, else false */ + virtual bool init( IOFireWireBus * bus ); + +/*! @function initWithDesc + @abstract Initialize physical address space with IOMemoryDescriptor. + @param bus Points to IOFireWireBus object. + @param mem Points to IOMemoryDescriptor. + @result returns true if success, else false */ + virtual bool initWithDesc(IOFireWireBus *bus, + IOMemoryDescriptor *mem); + +/*! @function doRead + @abstract A method for processing an address space read request + @param nodeID FireWire Read from nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len read 'len' bytes from nodeID. + @param buf points to a memory descriptor containing the packet data. + @param offset start from this 'offset' in 'buf'. + @param refcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doRead(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + IOMemoryDescriptor **buf, IOByteCount * offset, + IOFWRequestRefCon refcon); + +/*! @function doWrite + @abstract A method for processing an address space write request + @param nodeID FireWire Write to nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len write 'len' bytes to nodeID. + @param buf obtain bytes from location given by 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doWrite(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon); + +/*! @function getMemoryDescriptor + @abstract Gets the memory descriptor, which is associated to this + PhysicalAddressSpace. + @param none. + @result returns the IOMemoryDescriptor */ + IOMemoryDescriptor * getMemoryDescriptor( void ); + +/*! @function setMemoryDescriptor + @abstract Sets the memory descriptor, which will be associated to this + PhysicalAddressSpace. + @param none. + @result returns the IOMemoryDescriptor */ + IOReturn setMemoryDescriptor( IOMemoryDescriptor * descriptor ); + +/*! @function getLength + @abstract Get the length of the memory backed by PhysicalAddressSpace. + @param none. + @result returns the length */ + UInt64 getLength( void ); + +/*! @function setDMACommand + @abstract Set the DMACommand for this PhysicalAddressSpace. + @param dma_command Points to IODMACommand object. + @result none */ + inline void setDMACommand( IODMACommand * dma_command ) + { ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->setDMACommand( dma_command ); }; + +/*! @function getDMACommand + @abstract Get the DMACommand from this PhysicalAddressSpace. + @param none. + @result return previously assigned IODMACommand, null if not initialized */ + inline IODMACommand * getDMACommand( void ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->getDMACommand(); }; + +/*! @function initWithDMACommand + @abstract Initialize physical address space with IODMACommand. + @param bus Points to IOFireWireBus object. + @param command Points to IODMACommand. + @result returns true if success, else false */ + virtual bool initWithDMACommand( IOFireWireBus * control, IODMACommand * command ); + +/*! @function prepare + @abstract Prepare the IODMACommand used by this PhysicalAddressSpace. + @param none. + @result returns kIOReturnSuccess on success */ + inline IOReturn prepare( void ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->prepare(); }; + +/*! @function synchronize + @abstract synchronize the IODMACommand used by this PhysicalAddressSpace. + @param none. + @result returns kIOReturnSuccess on success */ + inline IOReturn synchronize( IOOptionBits options ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->synchronize( options ); }; + +/*! @function complete + @abstract complete the IODMACommand used by this PhysicalAddressSpace. + @param none. + @result returns kIOReturnSuccess on success */ + inline IOReturn complete( void ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->complete(); }; + +/*! @function isPrepared + @abstract Inspects whether the IODMACommand was prepared in this PhysicalAddressSpace. + @param none. + @result returns true if prepared, else false */ + inline bool isPrepared( void ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->isPrepared(); }; + +/*! @function getSegments + @abstract Returns the scatter gather list of memory segments from the IODMACommand + used in this PhysicalAddressSpace. + @param offset input/output parameter, defines the starting and ending offset in the memory + descriptor, relative to any offset passed to the prepare() method. + FWSegment Points to an array of memory segments. + num_segments Size of the FWSegment array. + @result returns kIOReturnSuccess on success */ + inline IOReturn getSegments( UInt64 * offset, FWSegment * fw_segments, UInt32 * num_segments ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->getSegments( offset, fw_segments, num_segments ); }; + +/*! @function checkMemoryInRange + @abstract Validates the IOMemoryDescriptor, which is used to initialize the PhysicalAddressSpace. + @param memory Points to a valid IOMemoryDescriptor. + @result returns kIOReturnSuccess on success */ + IOReturn checkMemoryInRange( IOMemoryDescriptor * memory ); + +protected: + + UInt64 getPhysicalSegment( UInt64 offset, UInt64 * length ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->getPhysicalSegment( offset, length); }; + + virtual IOFWAddressSpaceAux * createAuxiliary( void ); + +}; + +#endif diff --git a/QualcommWireless/include/IOKit/firewire/IOFWPseudoAddressSpace.h b/QualcommWireless/include/IOKit/firewire/IOFWPseudoAddressSpace.h new file mode 100644 index 0000000..02c2c30 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWPseudoAddressSpace.h @@ -0,0 +1,370 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFWPSEUDOADDRESSSPACE_H +#define _IOKIT_IOFWPSEUDOADDRESSSPACE_H + +#include + +/* + * If installed, this callback is invoked for drivers which + * would like to coalesce incoming writes and do batch processing + * of incoming block write packets. + * This callback can be installed by calling setARxReqIntCompleteHandler + * method in IOFWPseudoAddressSpace object. + */ +typedef void (*IOFWARxReqIntCompleteHandler)( void * refcon ); + +/* + * Pseudo firewire addresses usually represent emulated registers of some kind. + * Accesses to these addresses will result in the owner being notified. + * + * Virtual addresses should not have zero as the top 16 bits of the 48 bit local address, + * since that may look like a physical address to hardware (eg. OHCI). + * if reader is NULL then reads will not be allowed. + * if writer is NULL then writes will not be allowed. + * if either is NULL then lock requests will not be allowed. + * refcon is passed back as the first argument of read and write callbacks. + */ + +class IOFWPseudoAddressSpace; + +#pragma mark - + +/*! + @class IOFWPseudoAddressSpaceAux +*/ + +class IOFWPseudoAddressSpaceAux : public IOFWAddressSpaceAux +{ + OSDeclareDefaultStructors(IOFWPseudoAddressSpaceAux) + + friend class IOFWAddressSpace; + friend class IOFWPseudoAddressSpace; + friend class IOFireWireController; + +protected: + + struct MemberVariables + { + IOFWARxReqIntCompleteHandler fARxReqIntCompleteHandler; + void * fARxReqIntCompleteHandlerRefcon; + }; + + MemberVariables * fMembers; + +public: + + virtual bool init( IOFWAddressSpace * primary ); + virtual void free(); + +protected: + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + + virtual void handleARxReqIntComplete(); + +public: + +/*! @function setARxReqIntCompleteHandler + @abstract Installs a callback to receive notification, when FWIM has completed + ARxReqInt processing and no incoming packets are left in the queue. + @param refcon Client's callback object. + @param handler Client callback to be invoked, at the end of interrupt processing. + @result none. */ + virtual void setARxReqIntCompleteHandler( void * refcon, IOFWARxReqIntCompleteHandler handler ); + + virtual bool intersects( IOFWAddressSpace * space ); + +private: + + OSMetaClassDeclareReservedUsed(IOFWPseudoAddressSpaceAux, 0); + OSMetaClassDeclareReservedUsed(IOFWPseudoAddressSpaceAux, 1); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 2); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 3); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 4); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 5); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 6); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 7); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 8); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 9); + +}; + +/*! + @class IOFWPseudoAddressSpace +*/ + +class IOFWPseudoAddressSpace : public IOFWAddressSpace +{ + OSDeclareDefaultStructors(IOFWPseudoAddressSpace) + + friend class IOFWPseudoAddressSpaceAux; + friend class IOFireWireController; + +protected: + + IOMemoryDescriptor* fDesc; + void * fRefCon; + FWReadCallback fReader; + FWWriteCallback fWriter; + FWAddress fBase; + UInt32 fLen; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + static OSData * allocatedAddresses; // unused + + virtual void free(); + +public: + +/*! @function simpleReader + @abstract A method for processing an address space read request + @param refcon Client's callback object. + @param nodeID FireWire Read from nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len read 'len' bytes from nodeID. + @param buf points to a memory descriptor containing the packet data. + @param offset start from this 'offset' in 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + static UInt32 simpleReader( + void* refcon, + UInt16 nodeID, + IOFWSpeed & speed, + FWAddress addr, + UInt32 len, + IOMemoryDescriptor** buf, + IOByteCount* offset, + IOFWRequestRefCon reqrefcon); + +/*! @function simpleWriter + @abstract A method for processing an address space write request + @param refcon Client's callback object. + @param nodeID FireWire Write to nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len write 'len' bytes to nodeID. + @param buf obtain bytes from location given by 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + static UInt32 simpleWriter( + void* refcon, + UInt16 nodeID, + IOFWSpeed& speed, + FWAddress addr, + UInt32 len, + const void* buf, + IOFWRequestRefCon reqrefcon); +protected: + + // Get a unique address range + IOReturn allocateAddress( + FWAddress* addr, + UInt32 len); + // free address + void freeAddress( + FWAddress addr, + UInt32 len); + +public: + + static IOFWPseudoAddressSpace* readWrite( + FWAddress addr, + UInt32 len, + FWReadCallback reader, + FWWriteCallback writer, + void* refcon); + +/*! @function simpleRead + @abstract Create an address space object to handle read-only memory (eg. the local ROM) + handles everything itself + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the Pseudo Address Space. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace* simpleRead( + IOFireWireBus* bus, + FWAddress* addr, + UInt32 len, + const void* data); + +/*! @function simpleReadFixed + @abstract Create an address space object to handle fixed read-only memory (eg. the local ROM) + handles everything itself + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the Pseudo Address Space. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace* simpleReadFixed( + IOFireWireBus* bus, + FWAddress addr, + UInt32 len, + const void* data); + +/*! @function simpleRW + @abstract Create an address space object to handle r/w memory + handles everything itself + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the Pseudo Address Space. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace* simpleRW( + IOFireWireBus* bus, + FWAddress* addr, + UInt32 len, + void * data); + +/*! @function simpleRW + @abstract Create an address space object to handle r/w memory + handles everything itself + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace* simpleRW( + IOFireWireBus* bus, + FWAddress* addr, + IOMemoryDescriptor * data); + +/*! @function initAll + @abstract Initialize an address space object to handle r/w memory + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the Pseudo Address Space. + @param reader Callback handler for incoming Read. + @param writer Callback handler for incoming Write. + @param refcon Client's callback object. + @result returns true on success, false on failure */ + virtual bool initAll( + IOFireWireBus* bus, + FWAddress* addr, + UInt32 len, + FWReadCallback reader, + FWWriteCallback writer, + void* refcon); + +/*! @function initFixed + @abstract Initialize a fixed address space at top of kCSRRegisterSpaceBaseAddressHi + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param reader Callback handler for incoming Read. + @param writer Callback handler for incoming Write. + @param refcon Client's callback object. + @result returns true on success, false on failure */ + virtual bool initFixed( + IOFireWireBus* bus, + FWAddress addr, + UInt32 len, + FWReadCallback reader, + FWWriteCallback writer, + void* refcon); + +/*! @function doRead + @abstract A method for processing an address space read request + @param nodeID FireWire Read from nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len read 'len' bytes from nodeID. + @param buf points to a memory descriptor containing the packet data. + @param offset start from this 'offset' in 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doRead( + UInt16 nodeID, + IOFWSpeed & speed, + FWAddress addr, + UInt32 len, + IOMemoryDescriptor ** buf, + IOByteCount * offset, + IOFWRequestRefCon reqrefcon); +/*! @function doWrite + @abstract A method for processing an address space write request + @param nodeID FireWire Write to nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len write 'len' bytes to nodeID. + @param buf obtain bytes from location given by 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doWrite( + UInt16 nodeID, + IOFWSpeed& speed, + FWAddress addr, + UInt32 len, + const void* buf, + IOFWRequestRefCon reqrefcon); + +/*! @function contains + @abstract returns number of bytes starting at addr in this space + @result 0 if it doesn't contain the address + */ + virtual UInt32 contains(FWAddress addr); + +/*! @function simpleRWFixed + @abstract Create a Read/Write fixed address space at top of kCSRRegisterSpaceBaseAddressHi. + @param control Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the address range. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace * simpleRWFixed( IOFireWireBus *control, FWAddress addr, UInt32 len, const void *data ); + +protected: + + virtual IOFWAddressSpaceAux * createAuxiliary( void ); + +protected: + inline void handleARxReqIntComplete( void ) + { ((IOFWPseudoAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->handleARxReqIntComplete(); } + +public: +/*! @function setARxReqIntCompleteHandler + @abstract Installs a callback to receive notification, when FWIM has completed + ARxReqInt processing and no incoming packets are left in the queue. + @param refcon Client's callback object. + @param handler Client callback to be invoked, at the end of interrupt processing. + @result none. */ + inline void setARxReqIntCompleteHandler( void * refcon, IOFWARxReqIntCompleteHandler handler ) + { ((IOFWPseudoAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->setARxReqIntCompleteHandler( refcon, handler ); } + +private: + + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpace, 0); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpace, 1); + +}; + +#endif diff --git a/QualcommWireless/include/IOKit/firewire/IOFWRegs.h b/QualcommWireless/include/IOKit/firewire/IOFWRegs.h new file mode 100644 index 0000000..01c09cc --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWRegs.h @@ -0,0 +1,73 @@ +/* +* Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. +* +* @APPLE_LICENSE_HEADER_START@ +* +* The contents of this file constitute Original Code as defined in and +* are subject to the Apple Public Source License Version 1.1 (the +* "License"). You may not use this file except in compliance with the +* License. Please obtain a copy of the License at +* http://www.apple.com/publicsource and read it before using this file. +* +* This Original Code and all software distributed under the License are +* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the +* License for the specific language governing rights and limitations +* under the License. +* +* @APPLE_LICENSE_HEADER_END@ +*/ +/* + File: IOFWRegs.h + + Copyright: © 1996-1999 by Apple Computer, Inc., all rights reserved. + +*/ + +#ifndef __IOFWREGS_H__ +#define __IOFWREGS_H__ + +#include + +#ifndef NEW_ERROR_CODES + +// +// (!) The following error codes are obsolete... +// Please use the error codes defined in IOFireWireFamilyCommon.h +// + +enum { + inUseErr = -4160, // Item already in use + notFoundErr = -4161, // Item not found + timeoutErr = -4162, // Something timed out + busReconfiguredErr = -4163, // Bus was reconfigured + invalidIDTypeErr = -4166, // Given ID is of an invalid type for the requested operation. + alreadyRegisteredErr = -4168, // Item has already been registered. + disconnectedErr = -4169, // Target of request has been disconnected. + retryExceededErr = -4170, // Retry limit was exceeded. + addressRangeErr = -4171, // Address is not in range. + addressAlignmentErr = -4172, // Address is not of proper alignment. + + multipleTalkerErr = -4180, // Tried to install multiple talkers + channelActiveErr = -4181, // Operation not permitted when channel is active + noListenerOrTalkerErr = -4182, // Every isochronous channel must have one talker and at least + // one listener + noChannelsAvailableErr = -4183, // No supported isochronous channels are available + channelNotAvailableErr = -4184, // Required channel was not available. + invalidIsochPortIDErr = -4185, // An isochronous port ID is invalid. + invalidFWReferenceTypeErr = -4186, // Operation does not support type of given reference ID + separateBusErr = -4187, // Two or more entities are on two or more busses and cannot be associated with eachother. + badSelfIDsErr = -4188, // Received self IDs are bad. + +//zzz Do we own these next ID numbers? + cableVoltageTooLowErr = -4190, // Cable power below device's minimum voltage + cablePowerInsufficientErr = -4191 // Can't grant power request at this time +}; + + +#endif //NEW_ERROR_CODES + +#endif /* __IOFWREGS_H */ + diff --git a/QualcommWireless/include/IOKit/firewire/IOFWSimpleContiguousPhysicalAddressSpace.h b/QualcommWireless/include/IOKit/firewire/IOFWSimpleContiguousPhysicalAddressSpace.h new file mode 100644 index 0000000..606a9b2 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWSimpleContiguousPhysicalAddressSpace.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOFWSIMPLECONTIGUOUSPHYSICALADDRESSSPACE_H_ +#define _IOFWSIMPLECONTIGUOUSPHYSICALADDRESSSPACE_H_ + +#include + +/*! @class IOFWSimpleContiguousPhysicalAddressSpace +*/ + +class IOFWSimpleContiguousPhysicalAddressSpace : public IOFWSimplePhysicalAddressSpace +{ + OSDeclareDefaultStructors( IOFWSimpleContiguousPhysicalAddressSpace ) + +private: + + void * fSimpleContigPhysSpaceMembers; + + IOReturn cachePhysicalAddress( void ); + +protected: + virtual bool createMemberVariables( void ); + virtual void destroyMemberVariables( void ); + +public: + + virtual bool init( IOFireWireBus * control, vm_size_t size, IODirection direction ); + virtual void free( void ); + + FWAddress getFWAddress( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 0); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 1); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 2); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 3); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 4); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 5); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 6); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 7); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 8); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 9); + +}; + +#endif diff --git a/QualcommWireless/include/IOKit/firewire/IOFWSimplePhysicalAddressSpace.h b/QualcommWireless/include/IOKit/firewire/IOFWSimplePhysicalAddressSpace.h new file mode 100644 index 0000000..83a76a4 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWSimplePhysicalAddressSpace.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOFWSIMPLEPHYSICALADDRESSSPACE_H_ +#define _IOFWSIMPLEPHYSICALADDRESSSPACE_H_ + +#include +#include +#include +#include + +/*! @class IOFWSimplePhysicalAddressSpace +*/ + +class IOFWSimplePhysicalAddressSpace : public IOFWPhysicalAddressSpace +{ + OSDeclareDefaultStructors( IOFWSimplePhysicalAddressSpace ) + +private: + + void * fSimplePhysSpaceMembers; + + IOReturn allocateMemory( void ); + void deallocateMemory( void ); + +protected: + virtual bool createMemberVariables( void ); + virtual void destroyMemberVariables( void ); + +public: + + virtual bool init( IOFireWireBus * control, vm_size_t size, IODirection direction, bool contiguous = false ); + virtual void free( void ); + + IOVirtualAddress getVirtualAddress( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 0); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 1); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 2); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 3); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 4); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 5); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 6); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 7); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 8); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 9); + +}; + +#endif diff --git a/QualcommWireless/include/IOKit/firewire/IOFWSyncer.h b/QualcommWireless/include/IOKit/firewire/IOFWSyncer.h new file mode 100644 index 0000000..0fa497f --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWSyncer.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1998-2007 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOFWSYNCER_H +#define _IOFWSYNCER_H + +#include +#include +#include + +class IOFWSyncer : public OSObject +{ + OSDeclareDefaultStructors(IOFWSyncer) + +private: + // The spin lock that is used to guard the 'threadMustStop' variable. + IOSimpleLock *guardLock; + volatile bool threadMustStop; + IOReturn fResult; + virtual void free(); + virtual void privateSignal(); + +public: + + static IOFWSyncer * create(bool twoRetains = true); + + virtual bool init(bool twoRetains); + virtual void reinit(); + virtual IOReturn wait(bool autoRelease = true); + virtual void signal(IOReturn res = kIOReturnSuccess, + bool autoRelease = true); +}; + +#endif /* !_IOFWSYNCER */ + diff --git a/QualcommWireless/include/IOKit/firewire/IOFWUserObjectExporter.h b/QualcommWireless/include/IOKit/firewire/IOFWUserObjectExporter.h new file mode 100644 index 0000000..d6890ac --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWUserObjectExporter.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 1998-2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! @class IOFWUserObjectExporter + @discussion An IOFWUserObjectExporter is for internal use only. You should never subclass IOFWUserObjectExporter +*/ + + namespace IOFireWireLib + { + typedef UInt32 UserObjectHandle; + } + +#ifdef KERNEL + + class IOFWUserObjectExporter : public OSObject + { + OSDeclareDefaultStructors (IOFWUserObjectExporter ) + + public : + + typedef void (*CleanupFunction)( const OSObject * obj ); + typedef void (*CleanupFunctionWithExporter)( const OSObject * obj, IOFWUserObjectExporter * ); + + private : + + unsigned fCapacity; + unsigned fObjectCount; + const OSObject ** fObjects; + CleanupFunctionWithExporter * fCleanupFunctions; + IOLock * fLock; + OSObject * fOwner; + + public : + + static IOFWUserObjectExporter * createWithOwner( OSObject * owner ); + bool initWithOwner( OSObject * owner ); + + virtual bool init(void) APPLE_KEXT_OVERRIDE; + + virtual void free (void) APPLE_KEXT_OVERRIDE; + virtual bool serialize ( OSSerialize * s ) const APPLE_KEXT_OVERRIDE; + + // me + IOReturn addObject ( OSObject * obj, CleanupFunction cleanup, IOFireWireLib::UserObjectHandle * outHandle ); + void removeObject ( IOFireWireLib::UserObjectHandle handle ); + + // the returned object is retained! This is for thread safety.. if someone else released + // the object from the pool after you got it, you be in for Trouble + // Release the returned value when you're done!! + const OSObject * lookupObject ( IOFireWireLib::UserObjectHandle handle ) const; + const OSObject * lookupObjectForType( IOFireWireLib::UserObjectHandle handle, const OSMetaClass * toType ) const; + void removeAllObjects (); + + void lock () const; + void unlock () const; + + OSObject * getOwner() const; + + const IOFireWireLib::UserObjectHandle lookupHandle ( OSObject * object ) const; + + // don't subclass, but just in case someone does... + + private: + + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 0); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 1); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 2); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 3); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 4); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 5); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 6); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 7); + + }; + +#endif diff --git a/QualcommWireless/include/IOKit/firewire/IOFWUtils.h b/QualcommWireless/include/IOKit/firewire/IOFWUtils.h new file mode 100644 index 0000000..1a0ffc3 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFWUtils.h @@ -0,0 +1,32 @@ +/* + * IOFWUtils.h + * IOFireWireFamily + * + * Created by Niels on Fri Aug 16 2002. + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + */ + +#import + +//////////////////////////////////////////////////////////////////////////////// +// +// Useful FireWire utility functions. +// + +#ifdef __cplusplus +extern "C" { +#endif + +UInt16 FWComputeCRC16(const UInt32 *pQuads, UInt32 numQuads); +UInt16 FWUpdateCRC16(UInt16 crc16, UInt32 quad); + +UInt32 AddFWCycleTimeToFWCycleTime( UInt32 cycleTime1, UInt32 cycleTime2 ); +UInt32 SubtractFWCycleTimeFromFWCycleTime( UInt32 cycleTime1, UInt32 cycleTime2); + +void IOFWGetAbsoluteTime( AbsoluteTime * result ); + +#ifdef __cplusplus +} +#endif + diff --git a/QualcommWireless/include/IOKit/firewire/IOFireWireBus.h b/QualcommWireless/include/IOKit/firewire/IOFireWireBus.h new file mode 100644 index 0000000..053bfe4 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFireWireBus.h @@ -0,0 +1,373 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFIREWIREBUS_H +#define _IOKIT_IOFIREWIREBUS_H + +#include +#include +#include +#include +#include + +extern const OSSymbol *gFireWireROM; +extern const OSSymbol *gFireWireNodeID; +extern const OSSymbol *gFireWireSelfIDs; +extern const OSSymbol *gFireWireSpeed; +extern const OSSymbol *gFireWireUnit_Spec_ID; +extern const OSSymbol *gFireWireUnit_SW_Version; +extern const OSSymbol *gFireWireVendor_ID; +extern const OSSymbol *gFireWire_GUID; +extern const OSSymbol *gFireWireVendor_Name; +extern const OSSymbol *gFireWireProduct_Name; +extern const OSSymbol *gFireWireModel_ID; +extern const OSSymbol *gFireWireTDM; + +class IOFireWireDevice; +class IOLocalConfigDirectory; +class IOFWLocalIsochPort; +class IOFireWirePowerManager; +class IOFireWireBus; +class IOFWDCLPool; +class IOFWSimpleContiguousPhysicalAddressSpace; +class IOFWSimplePhysicalAddressSpace; +class IOFWUserObjectExporter; + +#pragma mark - + +/*! + @class IOFireWireBusAux +*/ + +class IOFireWireBusAux : public OSObject +{ + OSDeclareAbstractStructors(IOFireWireBusAux) + + friend class IOFireWireBus; + + protected: + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + public : + + virtual IOFWDCLPool * createDCLPool ( unsigned capacity ) const = 0 ; + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 32); + virtual UInt8 getMaxRec( void ) = 0; + + virtual UInt64 getFireWirePhysicalAddressMask( void ) = 0; + virtual UInt32 getFireWirePhysicalAddressBits( void ) = 0; + virtual UInt64 getFireWirePhysicalBufferMask( void ) = 0; + virtual UInt32 getFireWirePhysicalBufferBits( void ) = 0; + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ) = 0; + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ) = 0; + + virtual IOFWUserObjectExporter * getSessionRefExporter( void ) = 0; + + private: + OSMetaClassDeclareReservedUsed(IOFireWireBusAux, 0); + OSMetaClassDeclareReservedUsed(IOFireWireBusAux, 1); + OSMetaClassDeclareReservedUsed(IOFireWireBusAux, 2); + OSMetaClassDeclareReservedUsed(IOFireWireBusAux, 3); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 4); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 5); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 6); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 7); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 8); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 9); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 10); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 11); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 12); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 13); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 14); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 15); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 16); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 17); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 18); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 19); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 20); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 21); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 22); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 23); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 24); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 25); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 26); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 27); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 28); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 29); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 30); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 31); + +}; + +#pragma mark - + +/*! + @class IOFireWireBus + @abstract IOFireWireBus is a public class the provides access to + general FireWire functionality... +*/ + +class IOFireWireBus : public IOService +{ + OSDeclareAbstractStructors(IOFireWireBus) + +public: + + struct DCLTaskInfoAux + { + unsigned version ; + union // u + { + struct // v0 + { + IOMemoryMap * bufferMemoryMap ; // This field required to get physical addresses to program DMA. + // If NULL, we try to make the map ourselves. + // If you created a buffer memory descriptor + // for your program's buffers, just call map() on it + // and pass the returned object here... + } v0 ; + + struct // v1 + { + IOMemoryMap * bufferMemoryMap ; // same as 'bufferMemoryMap' from version 0, above. + + IOWorkLoop * workloop ; // A workloop on which to run callbacks for this port.. + // Can be NULL to use FireWire isochronous workloop... + // The workloop will be retained by the program object. + } v1 ; + + struct + { + IOMemoryMap * bufferMemoryMap ; // same as 'bufferMemoryMap' from version 0, above. + + IOWorkLoop * workloop ; // A workloop on which to run callbacks for this port.. + // Can be NULL to use FireWire isochronous workloop... + // The workloop will be retained by the program object. + IOFWIsochPortOptions options ; // extra options + } v2 ; + } u ; + } ; + + // this struct has been redefined for our next generation isochronous architecture, + // but is backwards compatible with the old definition.. This means we should + // be safe when an old-style driver is loaded.. + // To use DCLTaskInfo (see createLocalIsochPort) make sure all 'unused' fields are set to 0 or NULL + // and that auxInfo points to a valid DCLTaskInfoAux struct, defined above. + + struct DCLTaskInfo + { + task_t unused0 ; + vm_address_t unused1 ; + UInt32 unused2 ; + vm_address_t unused3 ; + UInt32 unused4 ; + void (*unused5)(void) ; + DCLTaskInfoAux * auxInfo ; // Refcon for user call + } ; + + static const IORegistryPlane * gIOFireWirePlane; + + IOFireWireBusAux * fAuxiliary; + + // Create an Isochronous Channel object + virtual IOFWIsochChannel *createIsochChannel( + bool doIRM, UInt32 bandwidth, IOFWSpeed prefSpeed, + IOFWIsochChannel::ForceStopNotificationProc stopProc=NULL, + void *stopRefCon=NULL) = 0; + + /*! @function createLocalIsochPort + @abstract Create a local isochronous port to run the given DCL program + @param talking Pass true to create a talker port; pass false to create a listener port. + @param opcodes A pointer to your DCL program (linked list of DCLCommand structs) + To use an IOFWDCL/IOFWDCLPool program, pass the DCLCommand returned by + IOFWDCLPool::getProgram(). + @param info (Optional) Pointer to DCLTaskInfo struct containing additional + configuration information. If you have an IOMemoryMap for your DCL program data buffers, + pass it here. You can also pass an IOWorkLoop if you want to use your own + workloop to handle callbacks for the created port object. + @param startEvent Specifies a bus condition on which the port should start receiving/sending packets + Must be kFWDCLImmediateEvent, kFWDCLCycleEvent, or kFWDCLSyBitsEvent. + Pass kFWDCLImmediateEvent to start without waiting when start() is called. Pass kFWDCLCycleEvent + to start() transmitting at a specified bus cycle time. Pass kFWDCLSyBitsEvent (receive only) + to start receiving packets once an isochronous packet with a specified sync field arrives. + @param startState Pass the value for the desired start condition, as specified by 'startEvent' + kFWDCLImmediateEvent: set to 0 + kFWDCLCycleEvent: the cycle timer value on which to start processing packets. For talker + ports, This value will be masked by 'startMask' and packet processing will be begin on the + next cycle whose lowest bits match the masked value. For listener ports, pass a 15-bit value + containg to the low order two bits of cycleSeconds and the 13-bit cycleCount on which to start + processing packets. + kFWDCLSyBitsEvent: The value of the sync field on which to start receive packets. The value will be masked + by 'startMask'. For DCLCommand based isoch ports, processing will begin on the first received packet + that has an isochronous header sync field matching 'startState'. For IOFWDCL/IOFWDCLPool based + ports, processing will pause on each IOFWDCL that has wait set to true until a packet that has + an isochronous header sync field matching 'startState' is received. + @result Returns an IOFWLocalIsochPort on success.*/ + virtual IOFWLocalIsochPort *createLocalIsochPort(bool talking, + DCLCommand *opcodes, DCLTaskInfo *info = 0, + UInt32 startEvent = 0, UInt32 startState = 0, UInt32 startMask = 0) = 0; + + virtual IOReturn getCycleTime(UInt32 &cycleTime) = 0; + virtual IOReturn getBusCycleTime(UInt32 &busTime, UInt32 &cycleTime) = 0; + + // Methods to manipulate the local Config ROM + virtual IOReturn AddUnitDirectory(IOLocalConfigDirectory *unitDir) = 0; + virtual IOReturn RemoveUnitDirectory(IOLocalConfigDirectory *unitDir) = 0; + + // Cause a bus reset + virtual IOReturn resetBus() = 0; + + // Convert a firewire nodeID into the IOFireWireDevice for it + virtual IOFireWireDevice * nodeIDtoDevice(UInt32 generation, UInt16 nodeID) = 0; + + // Execute specified function on workloop after specified delay + // Returned command is for delay, call it's cancel() function to cancel timeout. + virtual IOFWDelayCommand * createDelayedCmd(UInt32 uSecDelay, FWBusCallback func, void *refcon) = 0; + + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem) = 0; + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon) = 0; + + + // Extract info about the async request + virtual bool isLockRequest(IOFWRequestRefCon refcon) = 0; + virtual bool isQuadRequest(IOFWRequestRefCon refcon) = 0; + virtual UInt32 getExtendedTCode(IOFWRequestRefCon refcon) = 0; + + // How big (as a power of two) can packets sent to/received from the node be? + virtual int maxPackLog ( bool forSend, UInt16 nodeAddress) const = 0; + + // How big (as a power of two) can packets sent from A to B be? + virtual int maxPackLog ( UInt16 nodeA, UInt16 nodeB) const = 0; + + // Force given node to be root (via root holdoff Phy packet) + virtual IOReturn makeRoot ( UInt32 generation, UInt16 nodeID) = 0; + + // Create address space at fixed address in initial register space + virtual IOFWPseudoAddressSpace * createInitialAddressSpace ( UInt32 addressLo, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon) = 0; + + // Get address space object for given address, if any + virtual IOFWAddressSpace * getAddressSpace(FWAddress address) = 0; + + // Extract info about the async request - was the request ack'ed complete already? + virtual bool isCompleteRequest(IOFWRequestRefCon refcon) = 0; + + virtual IOFWAsyncStreamCommand * createAsyncStreamCommand( UInt32 generation, + UInt32 channel, UInt32 sync, UInt32 tag, IOMemoryDescriptor *hostMem, + UInt32 size, int speed,FWAsyncStreamCallback completion=NULL, void *refcon=NULL) = 0; + virtual UInt32 hopCount(UInt16 nodeAAddress, UInt16 nodeBAddress ) = 0; + virtual UInt32 hopCount(UInt16 nodeAAddress ) = 0; + virtual IOFireWirePowerManager * getBusPowerManager( void ) = 0; + +protected: + + virtual IOFireWireBusAux * createAuxiliary( void ) = 0; + + public : + + inline IOFWDCLPool * createDCLPool ( UInt32 capacity = 0 ) { return fAuxiliary->createDCLPool ( capacity ) ; } + inline UInt8 getMaxRec( void ) { return fAuxiliary->getMaxRec(); } + + // get the physical addressing limitations for this controller + + // returns the physical mask for memory addressable by the bus and this controller's DMA engine + // intended for use with IOBufferMemoryDescriptor::inTaskWithPhysicalMask() + // all current hardware is 32 bit --- currently returns 0x00000000FFFFFFFF + // this API is intended for allocating physical buffers. + // it will not return more than 48 bits so that buffer addresses can be turned into FWAddresses + inline UInt64 getFireWirePhysicalAddressMask( void ) + { return fAuxiliary->getFireWirePhysicalAddressMask(); } + + // returns a count of the maximum addressing bits supported by the bus and this controller + // intended for use with IODMACommand::withSpecification() + // all current hardware is 32 bit --- currently returns 32 + // this API is intended for allocating physical buffers. + // it will not return more than 48 bits so that buffer addresses can be turned into FWAddresses + inline UInt32 getFireWirePhysicalAddressBits( void ) + { return fAuxiliary->getFireWirePhysicalAddressBits(); } + + // returns the physical mask for memory addressable by this controller's DMA engine + // intended for use with IOBufferMemoryDescriptor::inTaskWithPhysicalMask() + // all current hardware is 32 bit --- currently returns 0x00000000FFFFFFFF + // this API is to allocate isoch and other buffers that don't need to be addressable by the bus + // it may someday return as high 64 bits + inline UInt64 getFireWirePhysicalBufferMask( void ) + { return fAuxiliary->getFireWirePhysicalBufferMask(); } + + // returns a count of the maximum addressing bits supported by this controller + // intended for use with IODMACommand::withSpecification() + // all current hardware is 32 bit --- currently returns 32 + // this API is to allocate isoch and other buffers that don't need to be addressable by the bus + // it may someday return as high 64 bits + inline UInt32 getFireWirePhysicalBufferBits( void ) + { return fAuxiliary->getFireWirePhysicalBufferBits(); } + + inline IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ) + { return fAuxiliary->createSimpleContiguousPhysicalAddressSpace( size, direction ); } + + inline IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ) + { return fAuxiliary->createSimplePhysicalAddressSpace( size, direction ); } + + virtual IOFWAsyncStreamCommand * createAsyncStreamCommand( UInt32 generation, + UInt32 channel, UInt32 sync, UInt32 tag, IOMemoryDescriptor *hostMem, + UInt32 size, int speed,FWAsyncStreamCallback completion, void *refcon, bool failOnReset) = 0; + + inline IOFWUserObjectExporter * getSessionRefExporter( void ) + { return fAuxiliary->getSessionRefExporter(); } + + private: + + OSMetaClassDeclareReservedUsed(IOFireWireBus, 0); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 1); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 2); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 3); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 4); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 5); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 6); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 7); + +}; + +#endif /* ! _IOKIT_IOFIREWIREBUS_H */ + diff --git a/QualcommWireless/include/IOKit/firewire/IOFireWireController.h b/QualcommWireless/include/IOKit/firewire/IOFireWireController.h new file mode 100644 index 0000000..44f73c2 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFireWireController.h @@ -0,0 +1,1098 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _IOKIT_IOFIREWIRECONTROLLER_H +#define _IOKIT_IOFIREWIRECONTROLLER_H + +#ifndef FIREWIREPRIVATE +#warning Please do not include this file. Include IOFireWireBus.h instead. +#endif + +#include +#include +#include +#include +#include +#include + +class OSData; +class IOWorkLoop; +class IOEventSource; +class IOFWQEventSource; +class IOTimerEventSource; +class IOMemoryDescriptor; +class IOFireWireController; +class IOFWAddressSpace; +class IOFWPseudoAddressSpace; +class IOFireWireNub; +class IOFireWireDevice; +class IOFireWireDeviceAux; +class IOFireWireUnit; +class IODCLProgram; +class IOLocalConfigDirectory; +class IOFireWireLink; +class IOFireWireSBP2ORB; +class IOFireWireSBP2Login; +class IOFireWireROMCache; +class IOFireWireLocalNode; +class IOFWWorkLoop; +class IOFireWireIRM; +class IOFireWirePowerManager; +class IOFWSimplePhysicalAddressSpace; +class IOFWSimpleContiguousPhysicalAddressSpace; +class IOFWAsyncStreamReceiver; +class IOFWAsyncStreamListener; +class IOFWUserVectorCommand; +class IOFWAsyncPHYCommand; +class IOFWPHYPacketListener; +class IOFWUserPHYPacketListener; +class IOFireWireUserClient; + +#if FIRELOGCORE +class IOFireLog; +class IOFireLogPublisher; +#endif + +const UInt32 kMaxWaitForValidSelfID = 20; // Still invalid SelfID after 20 retries + +// Phy packet defs. + +enum +{ + kFWPhyPacketID = FWBitRange (0, 1), + kFWPhyPacketIDPhase = FWBitRangePhase (0, 1), + + kFWPhyPacketPhyID = FWBitRange (2, 7), + kFWPhyPacketPhyIDPhase = FWBitRangePhase (2, 7) +}; + +enum +{ + kSelfIDPacketSize = 8, + kMaxSelfIDs = 4 // SelfID 0,1,3,8 +}; + +enum +{ + kFWConfigurationPacketID = 0, + kFWLinkOnPacketID = 1, + kFWSelfIDPacketID = 2 +}; + +enum +{ + kFWPhyConfigurationR = FW_BIT(8), + kFWPhyConfigurationT = FW_BIT(9), + kFWPhyConfigurationGapCnt = FWBitRange (10, 15), + kFWPhyConfigurationGapCntPhase = FWBitRangePhase (10, 15) +}; + +enum +{ + kFWSelfIDPortStatusChild = 3, + kFWSelfIDPortStatusParent = 2, + kFWSelfIDPortStatusNotConnected = 1, + kFWSelfIDPortStatusNotPresent = 0, + + kFWSelfIDNoPower = 0, + kFWSelfIDSelfPowered15W = 1, + kFWSelfIDSelfPowered30W = 2, + kFWSelfIDSelfPowered45W = 3, + kFWSelfIDBusPowered1W = 4, + kFWSelfIDBusPowered3W = 5, + kFWSelfIDBusPowered6W = 6, + kFWSelfIDBusPowered10W = 7, + + kFWSelfIDPhyID = kFWPhyPacketPhyID,//zzz do we need or want this? + kFWSelfIDPhyIDPhase = kFWPhyPacketPhyIDPhase, + kFWSelfIDM = FW_BIT(31), + + kFWSelfID0L = FW_BIT(9), + kFWSelfID0GapCnt = FWBitRange (10, 15), + kFWSelfID0GapCntPhase = FWBitRangePhase (10, 15), + kFWSelfID0SP = FWBitRange (16, 17), + kFWSelfID0SPPhase = FWBitRangePhase (16, 17), + kFWSelfID0Del = FWBitRange (18, 19), + kFWSelfID0DelPhase = FWBitRangePhase (18, 19), + kFWSelfID0C = FW_BIT(20), + kFWSelfID0Pwr = FWBitRange (21, 23), + kFWSelfID0PwrPhase = FWBitRangePhase (21, 23), + kFWSelfID0P0 = FWBitRange (24, 25), + kFWSelfID0P0Phase = FWBitRangePhase (24, 25), + kFWSelfID0P1 = FWBitRange (26, 27), + kFWSelfID0P1Phase = FWBitRangePhase (26, 27), + kFWSelfID0P2 = FWBitRange (28, 29), + kFWSelfID0P2Phase = FWBitRangePhase (28, 29), + kFWSelfID0I = FW_BIT(30), + + kFWSelfIDPacketType = FW_BIT(8), + kFWSelfIDNN = FWBitRange (9, 11), + kFWSelfIDNNPhase = FWBitRangePhase (9, 11), + kFWSelfIDNPa = FWBitRange (14, 15), + kFWSelfIDNPaPhase = FWBitRangePhase (14, 15), + kFWSelfIDNPb = FWBitRange (16, 17), + kFWSelfIDNPbPhase = FWBitRangePhase (16, 17), + kFWSelfIDNPc = FWBitRange (18, 19), + kFWSelfIDNPcPhase = FWBitRangePhase (18, 19), + kFWSelfIDNPd = FWBitRange (20, 21), + kFWSelfIDNPdPhase = FWBitRangePhase (20, 21), + kFWSelfIDNPe = FWBitRange (22, 23), + kFWSelfIDNPePhase = FWBitRangePhase (22, 23), + kFWSelfIDNPf = FWBitRange (24, 25), + kFWSelfIDNPfPhase = FWBitRangePhase (24, 25), + kFWSelfIDNPg = FWBitRange (26, 27), + kFWSelfIDNPgPhase = FWBitRangePhase (26, 27), + kFWSelfIDNPh = FWBitRange (28, 29), + kFWSelfIDNPhPhase = FWBitRangePhase (28, 29), + kFWSelfIDMore = FW_BIT(31) +}; + +// Primary packet defs. +enum +{ + kFWPacketTCode = FWBitRange (24, 27), + kFWPacketTCodePhase = FWBitRangePhase (24, 27) +}; + + +enum +{ + kFWAsynchSpd = FWBitRange (14, 15), + kFWAsynchSpdPhase = FWBitRangePhase (14, 15), + + kFWAsynchTLabel = FWBitRange (16, 21), + kFWAsynchTLabelPhase = FWBitRangePhase (16, 21), + kFWAsynchTTotal = ((0xffffffff & kFWAsynchTLabel) >> kFWAsynchTLabelPhase)+1, + kFWAsynchRt = FWBitRange (22, 23), + kFWAsynchRtPhase = FWBitRangePhase (22, 23), + kFWAsynchNew = 0, + kFWAsynchRetryA = 2, + kTIAsycnhRetryB = 3, + + kFWAsynchPriority = FWBitRange (28, 31), + kFWAsynchPriorityPhase = FWBitRangePhase (28, 31), + + kFWAsynchDestinationID = FWBitRange (0, 15), + kFWAsynchDestinationIDPhase = FWBitRangePhase (0, 15), + + kFWAsynchSourceID = FWBitRange (0, 15), + kFWAsynchSourceIDPhase = FWBitRangePhase (0, 15), + + kFWAsynchDestinationOffsetHigh = FWBitRange (16, 31), + kFWAsynchDestinationOffsetHighPhase = FWBitRangePhase (16, 31), + + kFWAsynchDestinationOffsetLow = FWBitRange (0, 31), + kFWAsynchDestinationOffsetLowPhase = FWBitRangePhase (0, 31), + + kFWAsynchDataLength = FWBitRange (0, 15), + kFWAsynchDataLengthPhase = FWBitRangePhase (0, 15), + + kFWAsynchExtendedTCode = FWBitRange (16, 31), + kFWAsynchExtendedTCodePhase = FWBitRangePhase (16, 31), + + kFWAsynchAckSent = FWBitRange (28, 31), + kFWAsynchAckSentPhase = FWBitRangePhase (28, 31), + + kFWAsynchRCode = FWBitRange (16, 19), + kFWAsynchRCodePhase = FWBitRangePhase (16, 19) +}; + +enum +{ + kFWTCodeWriteQuadlet = 0, + kFWTCodeWriteBlock = 1, + kFWTCodeWriteResponse = 2, + kFWTCodeReadQuadlet = 4, + kFWTCodeReadBlock = 5, + kFWTCodeReadQuadletResponse = 6, + kFWTCodeReadBlockResponse = 7, + kFWTCodeCycleStart = 8, + kFWTCodeLock = 9, + kFWTCodeIsochronousBlock = 10, + kFWTCodeLockResponse = 11, + kFWTCodePHYPacket = 14 +}; + +enum +{ + kFWExtendedTCodeMaskSwap = 1, + kFWExtendedTCodeCompareSwap = 2, + kFWExtendedTCodeFetchAdd = 3, + kFWExtendedTCodeLittleAdd = 4, + kFWExtendedTCodeBoundedAdd = 5, + kFWExtendedTCodeWrapAdd = 6, + kFWExtendedTCodeVendorDependent = 7 +}; + +// debug boot-arg constants +enum +{ + kFWDebugIgnoreNodeNone = 0xFFFFFFFF +}; + +struct AsyncPendingTrans { + IOFWAsyncCommand * fHandler; + IOFWCommand * fAltHandler; + int fTCode; + bool fInUse; +}; + +struct IOFWNodeScan { + IOFireWireController * fControl; + FWAddress fAddr; + UInt32 fBuf[5]; // Enough for bus info block + UInt32 * fSelfIDs; + int fNumSelfIDs; + int fROMSize; + int fRead; + IOFWReadQuadCommand * fCmd; + IOFWCompareAndSwapCommand * fLockCmd; + UInt32 generation; + UInt32 fIRMBitBucketOld; + UInt32 fIRMBitBucketNew; + bool fIRMisBad; + bool speedChecking; + bool fContenderNeedsChecking; + bool fIRMCheckingRead; + bool fIRMCheckingLock; + int fRetriesBumped; + bool fMustNotBeRoot; +}; + + +typedef struct IOFWDuplicateGUIDStruct IOFWDuplicateGUIDRec; +struct IOFWDuplicateGUIDStruct + { + IOFWDuplicateGUIDRec * fNextGUID; + CSRNodeUniqueID fGUID; + UInt32 fLastGenSeen; +}; + + +// IOFireWireDuplicateGUIDList +// +// A little class for keeping track of GUIDs which where we have observed 2 nodes with +// the same GUID + +class IOFireWireDuplicateGUIDList : public OSObject +{ + OSDeclareDefaultStructors(IOFireWireDuplicateGUIDList); + +private: + IOFWDuplicateGUIDRec * fFirstGUID; + +protected: + virtual void free(void) APPLE_KEXT_OVERRIDE; + +public: + + static IOFireWireDuplicateGUIDList * create( void ); + + void addDuplicateGUID( CSRNodeUniqueID guid, UInt32 gen ); + void removeDuplicateGUID( CSRNodeUniqueID guid ); + + bool findDuplicateGUID( CSRNodeUniqueID guid, UInt32 gen ); + +}; + +#define kMaxPendingTransfers kFWAsynchTTotal + +class IOFireWireController; + +#pragma mark - + +/*! + @class IOFireWireControllerAux +*/ + +class IOFireWireControllerAux : public IOFireWireBusAux +{ + OSDeclareDefaultStructors(IOFireWireControllerAux) + + friend class IOFireWireController; + +protected: + + IOFireWireController * fPrimary; + + UInt8 fMaxRec; + + UInt8 fPadding; + UInt16 fPadding2; + + IOFWUserObjectExporter * fSessionRefExporter; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init ( + IOFireWireController * primary ); + virtual void free (void) APPLE_KEXT_OVERRIDE; + virtual IOFWDCLPool * createDCLPool ( unsigned capacity ) const APPLE_KEXT_OVERRIDE; + virtual UInt8 getMaxRec( void ) APPLE_KEXT_OVERRIDE; + + virtual UInt64 getFireWirePhysicalAddressMask( void ) APPLE_KEXT_OVERRIDE; + virtual UInt32 getFireWirePhysicalAddressBits( void ) APPLE_KEXT_OVERRIDE; + virtual UInt64 getFireWirePhysicalBufferMask( void ) APPLE_KEXT_OVERRIDE; + virtual UInt32 getFireWirePhysicalBufferBits( void ) APPLE_KEXT_OVERRIDE; + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ) APPLE_KEXT_OVERRIDE; + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ) APPLE_KEXT_OVERRIDE; + + virtual IOFWUserObjectExporter * getSessionRefExporter( void ) APPLE_KEXT_OVERRIDE; + +private: + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 3); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 4); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 5); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 6); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 7); + +}; + + +#pragma mark - + +/*! @class IOFireWireController +*/ +class IOFireWireController : public IOFireWireBus +{ + OSDeclareAbstractStructors(IOFireWireController) + +protected: + enum busState { + kStarting = 0, + kAsleep, // Link off, zzzzzz + kWaitingBusReset, + kWaitingSelfIDs, // Bus has been reset, no selfIDs yet + kWaitingScan, // Got selfIDs, waiting a bit before hitting lame devices + kScanning, // Reading node ROMs + kWaitingPrune, // Read all ROMs, pausing before pruning missing devices + kRunning, // Normal happy state, + kWaitingBusResetStart // bus reset is desired, but not yet sent to the fwim + }; + + enum ResetState + { + kResetStateResetting, + kResetStateDisabled, + kResetStateArbitrated + }; + + enum + { + kDisablePhysicalAccess = (1 << 0) + }; + + struct timeoutQ: public IOFWCmdQ + { + IOTimerEventSource *fTimer; + virtual void headChanged(IOFWCommand *oldHead); + void busReset(); + }; + + struct pendingQ: public IOFWCmdQ + { + IOFWQEventSource *fSource; + virtual void headChanged(IOFWCommand *oldHead); + }; + + friend class IOFireWireLink; + friend class IOFireWireDevice; + friend class IOFireWireDeviceAux; + friend class IOFWAddressSpace; + friend class IOFWAddressSpaceAux; + friend class IOFWPseudoAddressSpace; + friend class IOFireWireSBP2ORB; + friend class IOFireWireSBP2Login; + friend class IOFWLocalIsochPort; + friend class IOFWCommand; + friend class IOFireWireUnit; + friend class IOFireWirePCRSpace; + friend class IOFireWireROMCache; + friend class IOFWAsyncStreamCommand; + friend class IOFireWireAVCLocalUnit; + friend class IOFireWireAVCUnit; + friend class IOFireWireAVCCommand; + friend class IOFireWirePowerManager; + friend class IOFWWriteQuadCommand; + friend class IOFWWriteCommand; + friend class IOFWCompareAndSwapCommand; + friend class IOFWAsyncCommand; + friend class IOFireWireAVCTargetSpace; + friend class AppleFWOHCI; + friend class IOFireWireNub; + friend class IOFWAsyncStreamListener; + friend class IOFireWireLocalNode; + friend class IOFireWireIRMAllocation; + friend class IOFWUserVectorCommand; + friend class IOFWAsyncPHYCommand; + friend class IOFWUserPHYPacketListener; + friend class IOFWAsyncStreamReceiver; + friend class IOFireWireUserClient; + +#if FIRELOGCORE + friend class IOFireLog; +#endif + + IOFireWireLink * fFWIM; + IOFWWorkLoop * fWorkLoop; + IOTimerEventSource * fTimer; + OSSet * fLocalAddresses; // Collection of local adress spaces + OSIterator * fSpaceIterator; // Iterator over local addr spaces + + OSSet * fAllocatedChannels; // Need to be informed of bus resets + OSIterator * fAllocChannelIterator; // Iterator over channels + + OSSet * fIRMAllocations; // Need to be informed of bus resets + OSIterator * fIRMAllocationsIterator; // Iterator over channels + OSSet * fIRMAllocationsAllocated; // Need to be informed of bus resets + + // Bus management variables (although we aren't a FireWire Bus Manager...) + AbsoluteTime fResetTime; // Time of last reset + UInt32 fBusGeneration; // ID of current bus topology. + UInt16 fLocalNodeID; // ID of local node, ie. this computer + UInt16 fRootNodeID; // ID of root, ie. highest node id in use. + UInt16 fIRMNodeID; // ID of Isochronous resource manager, or kFWBadNodeID + bool fBusMgr; // true if at least one node is bus manager capable + IORegistryEntry * fNodes[kFWMaxNodesPerBus]; // FireWire nodes on this bus + UInt32 * fNodeIDs[kFWMaxNodesPerBus+1]; // Pointer to SelfID list for each node + // +1 so we know how many selfIDs the last node has + + UInt32 fGapCount; // What we think the gap count should be + //UInt8 fSpeedCodes[(kFWMaxNodesPerBus+1)*kFWMaxNodesPerBus]; + UInt8 fSpeedVector[((kFWMaxNodesPerBus+1)*kFWMaxNodesPerBus)/2]; + // Max speed between two nodes + busState fBusState; // Which state are we in? + int fNumROMReads; // Number of device ROMs we are still reading + // SelfIDs + int fNumSelfIDs; // Total number of SelfID packets + UInt32 fSelfIDs[kMaxSelfIDs*kFWMaxNodesPerBus]; + + // The local device's Config ROM + UInt32 fROMHeader[5]; // More or less fixed header and bus info block + IOLocalConfigDirectory * fRootDir; // Local Config ROM root directory. + + // log base 2 of maximum packet size the FWIM can send/receive + // Normally calculated from bus info block. + int fMaxSendLog; + int fMaxRecvLog; + + IOFWAddressSpace * fROMAddrSpace; + IOMemoryDescriptor * fBadReadResponse; // Send back easily identified bad data to out of range addrs. + + // Array for outstanding requests (up to 64) + AsyncPendingTrans fTrans[kMaxPendingTransfers]; + int fLastTrans; + + // queue for executing commands that may timeout + timeoutQ fTimeoutQ; + + // queue for commands that can't execute yet + pendingQ fPendingQ; + + // queue for async commands interrupted by bus reset + IOFWCmdQ fAfterResetHandledQ; + + // Command to change bus state after a delay. + IOFWDelayCommand * fDelayedStateChangeCmd; + bool fDelayedStateChangeCmdNeedAbort; + + UInt32 fDelayedPhyPacket; + bool fBusResetScheduled; + ResetState fBusResetState; + IOFWDelayCommand * fBusResetStateChangeCmd; + UInt32 fBusResetDisabledCount; + +#if FIRELOGCORE + IOFireLogPublisher * fFireLogPublisher; +#else + void * fFireLogPublisher; +#endif + + OSData * fAllocatedAddresses; + + UInt32 fDevicePruneDelay; + + IOFWPhysicalAccessMode fPhysicalAccessMode; + IOFWSecurityMode fSecurityMode; + IONotifier * fKeyswitchNotifier; + + IOFireWireIRM * fIRM; + IOFireWirePowerManager * fBusPowerManager; + + bool fGapCountMismatch; + + bool fUseHalfSizePackets; + bool fRequestedHalfSizePackets; + + IOFWNodeScan * fScans[kFWMaxNodesPerBus]; + IOFireWireDuplicateGUIDList * fGUIDDups; + + bool fDelegateCycleMaster; + bool fBadIRMsKnown; + + UInt32 fPreviousGap; + + UInt32 fOutOfTLabels; + UInt32 fOutOfTLabels10S; + UInt32 fOutOfTLabelsThreshold; + +#ifdef LEGACY_SHUTDOWN + IONotifier * fPowerEventNotifier; +#endif + + bool fStarted; + + UInt32 fIOCriticalSectionCount; + UInt32 fHubPort; + UInt32 fDebugIgnoreNode; + + OSSet * fLocalAsyncStreamReceivers; + OSIterator * fAsyncStreamReceiverIterator; + + bool fInstantiated; + + IOReturn fStartStatus; + UInt32 fWaitingForSelfID; + + UInt32 fForcedRootNodeID; + bool fNodeMustBeRootFlag; + bool fNodeMustNotBeRootFlag; + + UInt32 fForcedGapCount; + bool fForcedGapFlag; + + OSSet * fPHYPacketListeners; + OSIterator * fPHYPacketListenersIterator; + + bool fDSLimited; + + IONotifier * fConsoleLockNotifier; + IOFireWireLocalNode * fLocalNode; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + static void clockTick(OSObject *, IOTimerEventSource *); + static void readROMGlue(void *refcon, IOReturn status, + IOFireWireNub *device, IOFWCommand *fwCmd); + static void delayedStateChange(void *refcon, IOReturn status, + IOFireWireBus *bus, IOFWBusCommand *fwCmd); + + virtual void processBusReset(); + virtual void processSelfIDs(UInt32 *IDs, int numIDs, UInt32 *ownIDs, int numOwnIDs); + virtual void processTimeout(IOTimerEventSource *src); + virtual void processRcvPacket( UInt32 *data, int numQuads, IOFWSpeed speed ); + virtual void processWriteRequest(UInt16 sourceID, UInt32 tlabel, + UInt32 *hdr, void *buf, int len, IOFWSpeed speed); + virtual void processLockRequest(UInt16 sourceID, UInt32 tlabel, + UInt32 *hdr, void *buf, int len, IOFWSpeed speed); + + // Process read from a local address, return rcode + virtual UInt32 doReadSpace(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + IOMemoryDescriptor **buf, IOByteCount * offset, IODMACommand **dma_command, + IOFWRequestRefCon refcon); + + // Process write to a local address, return rcode + virtual UInt32 doWriteSpace(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon); + + // Process lock to a local address, return rcode + UInt32 doLockSpace(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 inlen, + const UInt32 *newVal, UInt32 &outLen, UInt32 *oldVal, + UInt32 extType, IOFWRequestRefCon refcon); + + virtual void updatePlane(); + virtual void startBusScan(); + + // Called when all devices on bus have been examined + virtual void finishedBusScan(); + + virtual void buildTopology(bool doFWPlane); + + virtual void readDeviceROM(IOFWNodeScan *refCon, IOReturn status); + + virtual IOReturn UpdateROM(); + virtual IOReturn allocAddress(IOFWAddressSpace *space); + virtual void freeAddress(IOFWAddressSpace *space); + + IOFireWireBusAux * createAuxiliary( void ) APPLE_KEXT_OVERRIDE; + +public: + + // Initialization + virtual bool init(IOFireWireLink *fwim); + virtual void free(void) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService *provider) APPLE_KEXT_OVERRIDE; + virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool finalize( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual bool requestTerminate( IOService * provider, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + // Power management + virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService* whatDevice ) APPLE_KEXT_OVERRIDE; + + // Implement IOService::getWorkLoop + virtual IOWorkLoop *getWorkLoop() const APPLE_KEXT_OVERRIDE; + + // Allocate struct for tracking a transaction + virtual AsyncPendingTrans *allocTrans(IOFWAsyncCommand *cmd=NULL); + virtual void freeTrans(AsyncPendingTrans *trans); + + // Really public methods + + virtual IOReturn getCycleTime(UInt32 &cycleTime) APPLE_KEXT_OVERRIDE; + virtual IOReturn getBusCycleTime(UInt32 &busTime, UInt32 &cycleTime) APPLE_KEXT_OVERRIDE; + + // Methods to manipulate the local Config ROM + virtual IOReturn AddUnitDirectory(IOLocalConfigDirectory *unitDir) APPLE_KEXT_OVERRIDE; + virtual IOReturn RemoveUnitDirectory(IOLocalConfigDirectory *unitDir) APPLE_KEXT_OVERRIDE; + + // Cause a bus reset + virtual IOReturn resetBus(void) APPLE_KEXT_OVERRIDE; + + // Send async request packets + virtual IOReturn asyncRead( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + int size, + IOFWAsyncCommand * cmd ); + + virtual IOReturn asyncWrite( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + IOMemoryDescriptor * buf, + IOByteCount offset, + int size, + IOFWAsyncCommand * cmd ); + + /* DEPRECATED */ virtual IOReturn asyncWrite( UInt32 generation, + /* DEPRECATED */ UInt16 nodeID, + /* DEPRECATED */ UInt16 addrHi, + /* DEPRECATED */ UInt32 addrLo, + /* DEPRECATED */ int speed, + /* DEPRECATED */ int label, + /* DEPRECATED */ void * data, + /* DEPRECATED */ int size, + /* DEPRECATED */ IOFWAsyncCommand * cmd ); + + /* DEPRECATED */ virtual IOReturn asyncLock( UInt32 generation, + /* DEPRECATED */ UInt16 nodeID, + /* DEPRECATED */ UInt16 addrHi, + /* DEPRECATED */ UInt32 addrLo, + /* DEPRECATED */ int speed, + /* DEPRECATED */ int label, + /* DEPRECATED */ int type, + /* DEPRECATED */ void * data, + /* DEPRECATED */ int size, + /* DEPRECATED */ IOFWAsyncCommand * cmd); + + + // Send async read response packets + // useful for pseudo address spaces that require servicing outside the FireWire work loop. + virtual IOReturn asyncReadResponse( UInt32 generation, + UInt16 nodeID, + int speed, + IOMemoryDescriptor * buf, + IOByteCount offset, + int len, + IOFWRequestRefCon refcon ); + + virtual IOReturn asyncLockResponse( UInt32 generation, + UInt16 nodeID, + int speed, + IOMemoryDescriptor * buf, + IOByteCount offset, + int len, + IOFWRequestRefCon refcon ); + + // Try to fix whatever might have caused the other device to not respond + virtual IOReturn handleAsyncTimeout(IOFWAsyncCommand *cmd); + + // Convert a firewire nodeID into the IOFireWireDevice for it + virtual IOFireWireDevice * nodeIDtoDevice(UInt32 generation, UInt16 nodeID) APPLE_KEXT_OVERRIDE; + + // Add/remove a channel from the list informed of bus resets + virtual void addAllocatedChannel(IOFWIsochChannel *channel); + virtual void removeAllocatedChannel(IOFWIsochChannel *channel); + + // Add/remove a IRM allocation from the list informed of bus resets + virtual void addIRMAllocation(IOFireWireIRMAllocation *irmAllocation); + virtual void removeIRMAllocation(IOFireWireIRMAllocation *irmAllocation); + + // Create an Isochronous Channel object + // doIRM = true => allocate channel and bandwith in Isochronous Resource Manager + // packetSize packet size (in bytes), used to calculate bandwidth needed. + virtual IOFWIsochChannel *createIsochChannel( + bool doIRM, UInt32 packetSize, IOFWSpeed prefSpeed, + FWIsochChannelForceStopNotificationProc stopProc=NULL, + void *stopRefCon=NULL) APPLE_KEXT_OVERRIDE; + + // Create a local isochronous port to run the given DCL program + // if task is 0, the DCL program is for the kernel task, + // otherwise all DCL pointers are valid in the specified task. + // opcodes is also pointer valid in the specified task. + virtual IOFWLocalIsochPort *createLocalIsochPort(bool talking, + DCLCommand* opcodes, DCLTaskInfo *info = 0, + UInt32 startEvent = 0, UInt32 startState = 0, UInt32 startMask = 0) APPLE_KEXT_OVERRIDE; + + // Execute specified function on workloop after specified delay + // Returned command is for delay, call it's cancel() function to cancel timeout. + virtual IOFWDelayCommand * createDelayedCmd(UInt32 uSecDelay, FWBusCallback func, void *refcon) APPLE_KEXT_OVERRIDE; + + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem) APPLE_KEXT_OVERRIDE; + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon) APPLE_KEXT_OVERRIDE; + + // Extract info about the async request + virtual bool isLockRequest(IOFWRequestRefCon refcon) APPLE_KEXT_OVERRIDE; + virtual bool isQuadRequest(IOFWRequestRefCon refcon) APPLE_KEXT_OVERRIDE; + virtual UInt32 getExtendedTCode(IOFWRequestRefCon refcon) APPLE_KEXT_OVERRIDE; + + // Inline accessors for protected member variables + IOFWCmdQ &getTimeoutQ(); + IOFWCmdQ &getPendingQ(); + IOFWCmdQ &getAfterResetHandledQ(); + IOFireWireLink * getLink() const; + + IOLocalConfigDirectory *getRootDir() const; + bool checkGeneration(UInt32 gen) const; + UInt32 getGeneration() const; + UInt16 getLocalNodeID() const; + IOReturn getIRMNodeID(UInt32 &generation, UInt16 &id); + + const AbsoluteTime * getResetTime() const; + + IOFWSpeed FWSpeed(UInt16 nodeAddress) const; + IOFWSpeed FWSpeed(UInt16 nodeA, UInt16 nodeB) const; + + // How big (as a power of two) can packets sent to/received from the node be? + virtual int maxPackLog(bool forSend, UInt16 nodeAddress) const APPLE_KEXT_OVERRIDE; + + // How big (as a power of two) can packets sent from A to B be? + virtual int maxPackLog(UInt16 nodeA, UInt16 nodeB) const APPLE_KEXT_OVERRIDE; + + // Force given node to be root (via root holdoff Phy packet) + virtual IOReturn makeRoot(UInt32 generation, UInt16 nodeID) APPLE_KEXT_OVERRIDE; + + virtual IOFWPseudoAddressSpace *createInitialAddressSpace(UInt32 addressLo, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon) APPLE_KEXT_OVERRIDE; + + virtual IOFWAddressSpace *getAddressSpace(FWAddress address) APPLE_KEXT_OVERRIDE; + + // Extract info about the async request - was the request ack'ed complete already? + virtual bool isCompleteRequest(IOFWRequestRefCon refcon) APPLE_KEXT_OVERRIDE; + + // Are we currently scanning the bus? + bool scanningBus() const; + +protected: + + void openGate(); + void closeGate(); + +protected: + virtual void doBusReset( void ); + static void resetStateChange( void *refcon, IOReturn status, + IOFireWireBus *bus, IOFWBusCommand *fwCmd); + +public: + virtual IOReturn disableSoftwareBusResets( void ); + virtual void enableSoftwareBusResets( void ); + + virtual IOFWAsyncStreamCommand * createAsyncStreamCommand( UInt32 generation, + UInt32 channel, UInt32 sync, UInt32 tag, IOMemoryDescriptor *hostMem, + UInt32 size, int speed,FWAsyncStreamCallback completion, void *refcon) APPLE_KEXT_OVERRIDE; + + virtual IOReturn asyncStreamWrite(UInt32 generation, + int speed, int tag, int sync, int channel, + IOMemoryDescriptor *buf, IOByteCount offset, + int size, IOFWAsyncStreamCommand *cmd); + +protected: + bool inGate(); + + virtual IOReturn allocatePseudoAddress(FWAddress *addr, UInt32 lenDummy); + virtual void freePseudoAddress(FWAddress addr, UInt32 lenDummy); + + virtual IORegistryEntry * createDummyRegistryEntry( IOFWNodeScan *scan ); + + static IOFireWireLocalNode * getLocalNode(IOFireWireController *control); + + virtual void setPhysicalAccessMode( IOFWPhysicalAccessMode mode ); + virtual IOFWPhysicalAccessMode getPhysicalAccessMode( void ); + virtual void physicalAccessProcessBusReset( void ); + virtual void setNodeIDPhysicalFilter( UInt16 nodeID, bool state ); + + virtual void initSecurity( void ); + virtual void freeSecurity( void ); + static bool serverKeyswitchCallback( void * target, void * refCon, IOService * service, IONotifier * notifier ); + virtual void setSecurityMode( IOFWSecurityMode mode ); + virtual IOFWSecurityMode getSecurityMode( void ); + + virtual IOReturn createTimeoutQ( void ); + virtual void destroyTimeoutQ( void ); + virtual IOReturn createPendingQ( void ); + virtual void destroyPendingQ( void ); + + virtual UInt32 countNodeIDChildren( UInt16 nodeID, int hub_port = 0, int * hubChildRemainder = NULL, bool * hubParentFlag = NULL ); + +public: + virtual UInt32 hopCount(UInt16 nodeAAddress, UInt16 nodeBAddress ) APPLE_KEXT_OVERRIDE; + virtual UInt32 hopCount(UInt16 nodeAAddress ) APPLE_KEXT_OVERRIDE; + + virtual IOFireWirePowerManager * getBusPowerManager( void ) APPLE_KEXT_OVERRIDE; + +protected: + virtual void handleARxReqIntComplete(); + + virtual IOReturn asyncLock( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + int type, + IOMemoryDescriptor * buf, + IOByteCount offset, + int size, + IOFWAsyncCommand * cmd ); + + virtual IOReturn asyncWrite( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + IOMemoryDescriptor * buf, + IOByteCount offset, + int size, + IOFWAsyncCommand * cmd, + IOFWWriteFlags flags ); + +protected: + bool delayedStateCommandInUse() const; + void enterBusResetDisabledState( ); + + virtual UInt32 getPortNumberFromIndex( UInt16 index ); + + virtual bool checkForDuplicateGUID(IOFWNodeScan *scan, CSRNodeUniqueID *currentGUIDs ); + virtual void updateDevice(IOFWNodeScan *scan ); + virtual bool AssignCycleMaster(); + +public: + + IOReturn clipMaxRec2K(Boolean clipMaxRec ); + void setNodeSpeed( UInt16 nodeAddress, IOFWSpeed speed ); + void useHalfSizePackets( void ); + void disablePhyPortOnSleepForNodeID( UInt32 nodeID ); + + IOReturn handleAsyncCompletion( IOFWCommand *cmd, IOReturn status ); + void processCycle64Int(); + +#ifdef LEGACY_SHUTDOWN + static IOReturn systemShutDownHandler( void * target, void * refCon, + UInt32 messageType, IOService * service, + void * messageArgument, vm_size_t argSize ); +#else + virtual void systemWillShutdown( IOOptionBits specifier ) APPLE_KEXT_OVERRIDE; +#endif + + IOReturn beginIOCriticalSection( void ); + void endIOCriticalSection( void ); + +protected: + IOReturn poweredStart( void ); + void setNodeSpeed( UInt16 nodeA, UInt16 nodeB, UInt8 speed ); + void setNodeSpeed( UInt16 nodeAddress, UInt8 speed ); + +public: + bool isPhysicalAccessEnabledForNodeID( UInt16 nodeID ); + + // Allocate IRM bandwidth if the specified generation is the current FireWire generation. + IOReturn allocateIRMBandwidthInGeneration(UInt32 bandwidthUnits, UInt32 generation) ; + + // Release IRM bandwidth if the specified generation is the current FireWire generation. + IOReturn releaseIRMBandwidthInGeneration(UInt32 bandwidthUnits, UInt32 generation) ; + + // Allocate IRM channel if the specified generation is the current FireWire generation. + IOReturn allocateIRMChannelInGeneration(UInt8 isochChannel, UInt32 generation) ; + + // Release IRM channel if the specified generation is the current FireWire generation. + IOReturn releaseIRMChannelInGeneration(UInt8 isochChannel, UInt32 generation) ; + + // Create an IOFireWireIRMAllocation object which can be used to allocate isoch resources that are automatically reallocated after bus-resets! + IOFireWireIRMAllocation *createIRMAllocation(Boolean releaseIRMResourcesOnFree = true, + IOFireWireIRMAllocation::AllocationLostNotificationProc allocationLostProc = NULL, + void *pLostNotificationProcRefCon = NULL); + + IOFWAsyncStreamListener *createAsyncStreamListener( UInt32 channel, FWAsyncStreamReceiveCallback proc, void *refcon ); + + void removeAsyncStreamListener( IOFWAsyncStreamListener *listener ); + + IOFWSpeed getBroadcastSpeed(){ return FWSpeed( fLocalNodeID ); }; + +private: + + IOFWAsyncStreamReceiver *allocAsyncStreamReceiver( UInt32 channel, FWAsyncStreamReceiveCallback proc, void *refcon ); + + IOFWAsyncStreamReceiver *getAsyncStreamReceiver( UInt32 channel ); + + void freeAllAsyncStreamReceiver(); + + void activateAsyncStreamReceivers(); + + void deactivateAsyncStreamReceivers(); + +protected: + IOService *findKeyswitchDevice( void ); + void suspendBus( void ); + +public: + virtual IOReturn asyncRead( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + int size, + IOFWAsyncCommand * cmd, + IOFWReadFlags flags ); + + void checkProgress( void ); + + void terminateDevice( IOFireWireDevice * device ); + + void nodeMustBeRoot( UInt32 nodeID ); + + void nodeMustNotBeRoot( UInt32 nodeID ); + + void setGapCount( UInt32 gapCount ); + + IOReturn asyncPHYPacket( UInt32 generation, + UInt32 data, + UInt32 data2, + IOFWAsyncPHYCommand * cmd ); + + IOFWAsyncPHYCommand * createAsyncPHYCommand( UInt32 generation, + UInt32 data1, + UInt32 data2, + FWAsyncPHYCallback completion, + void * refcon, + bool failOnReset ); + +private: + AsyncPendingTrans * allocTrans( IOFWAsyncCommand * cmd, IOFWCommand * altcmd ); + +public: + + IOReturn activatePHYPacketListener( IOFWPHYPacketListener * listener ); + void deactivatePHYPacketListener( IOFWPHYPacketListener * listener ); + + IOFWPHYPacketListener * createPHYPacketListener( FWPHYPacketCallback proc, void * refcon ); + +private: + void processPHYPacket( UInt32 data1, UInt32 data2 ); + void enterLoggingMode( void ); + +public: + IOReturn getCycleTimeAndUpTime( UInt32 &cycleTime, UInt64 &uptime ); + +protected: + void removeAsyncStreamReceiver( IOFWAsyncStreamReceiver *receiver ); + +public: + + // Create a multi-isoch-receive listener + IOFireWireMultiIsochReceiveListener * createMultiIsochReceiveListener(UInt32 channel, + FWMultiIsochReceiveListenerCallback callback, + void *pCallbackRefCon, + FWMultiIsochReceiveListenerParams *pListenerParams = NULL); + + // Activate a multi-isoch-receive listener + IOReturn activateMultiIsochReceiveListener(IOFireWireMultiIsochReceiveListener *pListener); + + // Deactivate a multi-isoch-receive listener + IOReturn deactivateMultiIsochReceiveListener(IOFireWireMultiIsochReceiveListener *pListener); + + // Call for client to specify he is done with a multi-isoch receiver isoch packet + void clientDoneWithMultiIsochReceivePacket(IOFireWireMultiIsochReceivePacket *pPacket); + +public: + virtual IOFWAsyncStreamCommand * createAsyncStreamCommand( UInt32 generation, + UInt32 channel, UInt32 sync, UInt32 tag, IOMemoryDescriptor *hostMem, + UInt32 size, int speed,FWAsyncStreamCallback completion, void *refcon, bool failOnReset) APPLE_KEXT_OVERRIDE; + +private: + void addToIRMAllocationSet(IOFireWireIRMAllocation *anObject); + void removeFromIRMAllocationSet(IOFireWireIRMAllocation *anObject); + + static IOReturn consoleLockInterestHandler( void * target, void * refCon, + UInt32 messageType, IOService * provider, + void * messageArgument, vm_size_t argSize ); + +protected: + OSMetaClassDeclareReservedUnused(IOFireWireController, 0); + OSMetaClassDeclareReservedUnused(IOFireWireController, 1); + OSMetaClassDeclareReservedUnused(IOFireWireController, 2); + OSMetaClassDeclareReservedUnused(IOFireWireController, 3); + OSMetaClassDeclareReservedUnused(IOFireWireController, 4); + OSMetaClassDeclareReservedUnused(IOFireWireController, 5); + OSMetaClassDeclareReservedUnused(IOFireWireController, 6); + OSMetaClassDeclareReservedUnused(IOFireWireController, 7); + OSMetaClassDeclareReservedUnused(IOFireWireController, 8); + +}; + +#endif /* ! _IOKIT_IOFIREWIRECONTROLLER_H */ diff --git a/QualcommWireless/include/IOKit/firewire/IOFireWireDevice.h b/QualcommWireless/include/IOKit/firewire/IOFireWireDevice.h new file mode 100644 index 0000000..9bf07f4 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFireWireDevice.h @@ -0,0 +1,289 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + /*! @header + This header contains the definition of the IOFireWireDevice and IOFireWireDeviceAux classes. + An IOFireWireDevice object represents a FireWire device in the I/O Registry. + It is strongly recommended that you write applications that access FireWire devices rather than in-kernel device drivers. + For more information on how to do this, see {@linkdoc //apple_ref/doc/uid/TP40000969 FireWire Device Interface Guide}. + @indexgroup FireWire + */ +#ifndef _IOKIT_IOFIREWIREDEVICE_H +#define _IOKIT_IOFIREWIREDEVICE_H + +#include + +class IOFireWireROMCache; + +struct IOFWNodeScan; +struct RomScan; + +class IOFireWireDevice; + +#pragma mark - + +/*! @class IOFireWireDeviceAux + @discussion An IOFireWireDeviceAux is for internal use only. You should never subclass IOFireWireDeviceAux +*/ + +class IOFireWireDeviceAux : public IOFireWireNubAux +{ + OSDeclareDefaultStructors(IOFireWireDeviceAux) + + friend class IOFireWireDevice; + +protected: + + UInt32 fUnitCount; + IOFWSpeed fMaxSpeed; + OSSet * fOpenUnitSet; + AbsoluteTime fResumeTime; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFireWireDevice * primary ); + + virtual void free(void) APPLE_KEXT_OVERRIDE; + + virtual bool isTerminated( void ); + + virtual void setTerminationState( TerminationState state ) APPLE_KEXT_OVERRIDE; + + void setMaxSpeed( IOFWSpeed speed ); + + void setUnitCount( UInt32 count ); + + UInt32 getUnitCount( void ); + + bool isPhysicalAccessEnabled( void ) APPLE_KEXT_OVERRIDE; + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ) APPLE_KEXT_OVERRIDE; + + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ) APPLE_KEXT_OVERRIDE; + + OSSet * getOpenUnitSet() const; + + void latchResumeTime( void ); + + AbsoluteTime getResumeTime( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireDeviceAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireDeviceAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireDeviceAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireDeviceAux, 3); +}; + +#pragma mark - +/*! @class IOFireWireDevice + @abstract Represents a FireWire device. + @discussion The FireWire family tries to read the configuration ROM of each device on the FireWire bus. For each device that responds with + its bus information block, the FireWire family publishes an IOFireWireDevice object in the I/O Registry. An + IOFireWireDevice object keeps track of the device's node ID, copies config ROM properties into the object's property + list, and scans the config ROM for unit directories, publishing an IOFireWireUnit object for each unit directory it finds. +*/ + +class IOFireWireDevice : public IOFireWireNub +{ + OSDeclareDefaultStructors(IOFireWireDevice) + + friend class IOFireWireController; + friend class IOFireWireDeviceAux; + +protected: + + enum RegistrationState + { + kDeviceRegistered, + kDeviceNeedsRegisterService, + kDeviceNotRegistered + }; + + IOFireWireROMCache *fDeviceROM; + bool fOpenFromDevice; + UInt32 fOpenFromUnitCount; + UInt32 fROMGeneration; + IORecursiveLock *fROMLock; + RegistrationState fRegistrationState; + UInt32 fROMReadRetry; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + static void readROMDirGlue(void *refcon, IOReturn status, + IOFireWireNub *device, IOFWCommand *fwCmd); + static void readROMThreadFunc(void *arg); + + static void terminateDevice(void *arg); + + void processROM(RomScan *romScan); + + virtual void free(); + +public: + virtual IOReturn message( UInt32 type, IOService * provider, void * argument ) APPLE_KEXT_OVERRIDE; + + virtual bool handleOpen( IOService * forClient, IOOptionBits options, void * arg ) APPLE_KEXT_OVERRIDE; + + virtual void handleClose( IOService * forClient, IOOptionBits options ); + + virtual bool handleIsOpen( const IOService * forClient ) const APPLE_KEXT_OVERRIDE; + +protected: + virtual IOReturn cacheROM(OSData *rom, UInt32 offset, const UInt32 *&romBase); + + virtual const UInt32 * getROMBase(); + + virtual void setNodeROM(UInt32 generation, UInt16 localNodeID, const IOFWNodeScan *info); + +public: + virtual bool matchPropertyTable(OSDictionary * table) APPLE_KEXT_OVERRIDE; + + /*! @function init + @abstract Initializes the nub. + @param propTable Property table passed to the standard nub initialization. + @param scan Pointer to the node scan structure. + @result Returns true if initialization was successful; false otherwise. + */ + virtual bool init(OSDictionary * propTable, const IOFWNodeScan *scan); + + virtual bool attach(IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual bool finalize( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + /*! @function setNodeFlags + @abstract Sets the node's characteristics. + @param flags Refer to "node flags" in IOFireWireFamilyCommon.h. + */ + virtual void setNodeFlags( UInt32 flags ) APPLE_KEXT_OVERRIDE; + + /*! @function clearNodeFlags + @abstract Resets the node's characteristics. + @param flags Refer to "node flags" in IOFireWireFamilyCommon.h. + */ + virtual void clearNodeFlags( UInt32 flags ) APPLE_KEXT_OVERRIDE; + + /*! @function getNodeFlags + @abstract Retrieves the node's characteristics. + @param flags Refer to "node flags" in IOFireWireFamilyCommon.h. + @result UInt32 The flags set for a particular node. + */ + virtual UInt32 getNodeFlags( void ) APPLE_KEXT_OVERRIDE; + +protected: + virtual IOReturn configureNode( void ); + +public: + /*! @function createPhysicalAddressSpace + @abstract Creates local physical FireWire address spaces for the device to access. + @param mem Memory area allocated to back the physical access by Link hardware. + @result A valid IOFWPhysicalAddressSpace object on success; NULL on failure. + */ + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem) APPLE_KEXT_OVERRIDE; + + /*! @function createPseudoAddressSpace + @abstract Creates local pseudo FireWire address spaces for the device to access. + @param addr The FireWire address that is mapped to the pseudo address access. + @param len Size of the address space to allocate. + @param reader Read callback, when the device reads from this address space. + @param writer Write callback, when the device writes to this address space. + @param refcon Client's callback object returned during reader/writer callbacks. + @result A valid IOFWPseudoAddressSpace object on success; NULL on failure. + */ + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon) APPLE_KEXT_OVERRIDE; + +protected: + virtual IOReturn readRootDirectory( IOConfigDirectory * directory, OSDictionary * propTable ); + + virtual IOReturn processRootDirectory( OSDictionary * propTable ); + + virtual IOReturn readUnitDirectories( IOConfigDirectory * directory, OSSet * unitInfo ); + + virtual IOReturn processUnitDirectories( OSSet * unitSet ); + + virtual void setRegistrationState( RegistrationState fRegistrationState ); + + virtual void preprocessDirectories( OSDictionary * rootPropTable, OSSet * unitSet ); + + virtual void configurePhysicalFilter( void ); + +protected: + virtual IOFireWireNubAux * createAuxiliary( void ) APPLE_KEXT_OVERRIDE; + +public: + inline bool isTerminated( void ) + { return ((IOFireWireDeviceAux*)fAuxiliary)->isTerminated(); } + + /*! @function setMaxSpeed + @abstract Sets the maximum speed for this node. + @param speed Maximum speed. Refer to "bus speed numbers" in IOFireWireFamilyCommon.h. + */ + inline void setMaxSpeed( IOFWSpeed speed ) + { ((IOFireWireDeviceAux*)fAuxiliary)->setMaxSpeed( speed ); } + +protected: + inline void setUnitCount( UInt32 count ) + { ((IOFireWireDeviceAux*)fAuxiliary)->setUnitCount( count ); } + + inline OSSet * getOpenUnitSet( void ) const + { return ((IOFireWireDeviceAux*)fAuxiliary)->getOpenUnitSet(); } + +public: + /*! @function getUnitCount + @abstract Returns number of units attached to this device. + @result UInt32 The number of units attached to this device. + */ + inline UInt32 getUnitCount( void ) + { return ((IOFireWireDeviceAux*)fAuxiliary)->getUnitCount(); } + +protected: + inline AbsoluteTime getResumeTime( void ) + { return ((IOFireWireDeviceAux*)fAuxiliary)->getResumeTime(); } + + inline void latchResumeTime( void ) + { ((IOFireWireDeviceAux*)fAuxiliary)->latchResumeTime(); } + +private: + OSMetaClassDeclareReservedUnused(IOFireWireDevice, 0); + OSMetaClassDeclareReservedUnused(IOFireWireDevice, 1); + +}; + +#endif /* ! _IOKIT_IOFIREWIREDEVICE_H */ diff --git a/QualcommWireless/include/IOKit/firewire/IOFireWireFamilyCommon.h b/QualcommWireless/include/IOKit/firewire/IOFireWireFamilyCommon.h new file mode 100644 index 0000000..702759f --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFireWireFamilyCommon.h @@ -0,0 +1,1232 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOFireWireFamilyCommon.h + * IOFireWireUserClient/IOFireWireFamily + * + * Created by NWG on Fri Apr 28 2000. + * Copyright (c) 2000-2001 Apple Computer, Inc. All rights reserved. + * + */ +/* + $Log: not supported by cvs2svn $ + Revision 1.78 2008/05/08 02:33:22 collin + more K64 + + Revision 1.77 2008/04/24 00:01:39 collin + more K640 + + Revision 1.76 2007/12/05 04:52:08 collin + integrate chex workaround + + Revision 1.75 2007/08/31 20:29:06 collin + fixed 5437835 + + Revision 1.74 2007/04/24 21:40:23 arulchan + headerdoc changes + + Revision 1.73 2007/04/24 21:28:24 arulchan + changes for headerdoc + + Revision 1.72 2007/04/13 19:37:01 calderon + Integrated FireWireKPrintf implemented + + Revision 1.71 2007/03/14 18:41:43 collin + *** empty log message *** + + Revision 1.70 2007/02/28 23:10:13 ayanowit + Another IRMAllocation fix. + + Revision 1.69 2007/02/20 01:25:28 collin + *** empty log message *** + + Revision 1.68 2007/02/17 00:26:51 collin + *** empty log message *** + + Revision 1.67 2007/02/15 19:42:07 ayanowit + For 4369537, eliminated support for legacy DCL SendPacketWithHeader, since it didn't work anyway, and NuDCL does support it. + + Revision 1.66 2007/02/15 01:23:39 arulchan + changes in AssignCycleMaster + + Revision 1.65 2007/02/09 04:44:06 collin + *** empty log message *** + + Revision 1.64 2007/01/26 20:52:31 ayanowit + changes to user-space isoch stuff to support 64-bit apps. + + Revision 1.63 2007/01/16 01:41:02 gecko1 + 4159728 Add improved async lock based check for bad IRMs + + Revision 1.62 2007/01/15 23:29:05 arulchan + Fixed Skipped Packet Handler Notifications + + Revision 1.61 2007/01/12 22:15:14 arulchan + Added flag kIOFWEnableBeingRoot + + Revision 1.60 2007/01/10 22:14:44 calderon + Fixed 4046607 Propagate vendor/model from IIDC UnitDepedantInfoDir + Fixed some null termination shinanigans in getIndexValue(string) + + Revision 1.59 2007/01/08 18:47:19 ayanowit + More 64-bit changes for isoch. + + Revision 1.58 2006/07/07 20:18:25 calderon + 4227201: SpeedMap and HopCount table reductions. + + Revision 1.57 2006/04/03 21:29:48 collin + *** empty log message *** + + Revision 1.56 2006/02/09 00:21:51 niels + merge chardonnay branch to tot + + Revision 1.55.4.1 2005/08/06 01:31:31 collin + *** empty log message *** + + Revision 1.55 2005/03/12 03:27:51 collin + *** empty log message *** + + Revision 1.54 2005/01/12 06:34:53 collin + *** empty log message *** + + Revision 1.53 2004/05/04 22:52:19 niels + *** empty log message *** + + Revision 1.52 2004/03/26 01:42:53 gecko1 + Add code to disable any port directly connected to an iPod when we go to sleep. + + Revision 1.51 2004/03/05 00:33:59 calderon + Fixed 3570909 - FireWire - iokit_fw_errs should be defined in hex + All decimal #define errors in header changed to hex + + Revision 1.50 2003/11/07 21:01:18 niels + Revision 1.49 2003/10/21 01:16:41 collin + Revision 1.48 2003/10/17 00:25:24 collin + Revision 1.47 2003/10/15 02:19:45 collin + Revision 1.46 2003/07/22 10:49:47 niels + Revision 1.45 2003/07/21 06:52:59 niels + merge isoch to TOT + + Revision 1.44.4.5 2003/07/21 06:44:44 niels + Revision 1.44.4.4 2003/07/18 00:17:42 niels + Revision 1.44.4.3 2003/07/14 22:08:53 niels + Revision 1.44.4.2 2003/07/09 21:24:01 niels + Revision 1.44.4.1 2003/07/01 20:54:07 niels + isoch merge + + Revision 1.44 2003/03/17 01:05:22 collin + Revision 1.43 2003/03/07 01:26:06 collin + Revision 1.42 2003/02/19 22:33:17 niels + add skip cycle DCL + + Revision 1.41 2003/02/18 00:14:01 collin + Revision 1.40 2003/02/17 21:47:52 collin + Revision 1.39 2002/12/05 19:08:37 niels + remove trailing commas from enums in IOFireWireFamilyCommon.h + + Revision 1.38 2002/11/01 20:45:57 collin + add enhanced IRM with support for the BROADCAST_CHANNEL register + + Revision 1.37 2002/10/01 02:40:27 collin + security mode support + + Revision 1.36 2002/09/25 21:17:14 collin + fix headers again. + + Revision 1.35 2002/09/25 00:27:23 niels + flip your world upside-down + + Revision 1.34 2002/09/12 22:41:53 niels + add GetIRMNodeID() to user client + +*/ + +/*! @header IOFireWireFamilyCommon.h +This file contains useful definitions for working with FireWire +in the kernel and in user space +*/ + +#ifndef __IOFireWireFamilyCommon_H__ +#define __IOFireWireFamilyCommon_H__ + +#ifdef KERNEL +#ifndef __IOKIT_IOTYPES_H + #include +#endif +#else +#include +#endif + +//#define LEGACY_SHUTDOWN + +#define FW_OLD_DCL_DEFS +#define FW_OLD_BIT_DEFS + +// ================================================================= +// bit ranges and fields +// ================================================================= +#pragma mark - +#pragma mark BITS + +// FireWire bit defs. + +#define BIT(x) ( 1 << (x) ) +#define FW_BIT(x) ( 1 << (31 - (x) ) ) + +#define FWBitRange(start, end) \ +( \ + ((((UInt32) 0xFFFFFFFF) << (start)) >> \ + ((start) + (31 - (end)))) << \ + (31 - (end)) \ +) + +#define FWBitRangePhase(start, end) \ + (31 - (end)) + +#define BitRange(start, end) \ +( \ + ((((UInt32) 0xFFFFFFFF) << (31 - (end))) >> \ + ((31 - (end)) + (start))) << \ + (start) \ +) + + +#define BitRangePhase(start, end) \ + (start) + +// ================================================================= +// FireWire messages & errors +// ================================================================= +#pragma mark - +#pragma mark MESSAGES AND ERRORS + +#define iokit_fw_err(return) (sys_iokit|sub_iokit_firewire|return) + +// e0008010 -> 0xe000801f Response codes from response packets + +// Base of Response error codes +#define kIOFireWireResponseBase iokit_fw_err(0x10) + +// e0008020 -- Bus reset during command execution (current bus generation does +// not match that specified in command.) +#define kIOFireWireBusReset (kIOFireWireResponseBase+kFWResponseBusResetError) + +// e0008001 -- Can't find requested entry in ROM +#define kIOConfigNoEntry iokit_fw_err(0x1) + +// e0008002 -- In pending queue waiting to execute +#define kIOFireWirePending iokit_fw_err(0x2) + +// e0008003 -- Last DCL callback of program (internal use) +#define kIOFireWireLastDCLToken iokit_fw_err(0x3) + +// e0008004 +#define kIOFireWireConfigROMInvalid iokit_fw_err(0x4) + +// e0008005 +#define kIOFireWireAlreadyRegistered iokit_fw_err(0x5) + +// e0008006 +#define kIOFireWireMultipleTalkers iokit_fw_err(0x6) + +// e0008007 +#define kIOFireWireChannelActive iokit_fw_err(0x7) + +// e0008008 +#define kIOFireWireNoListenerOrTalker iokit_fw_err(0x8) + +// e0008009 +#define kIOFireWireNoChannels iokit_fw_err(0x9) + +// e000800A +#define kIOFireWireChannelNotAvailable iokit_fw_err(0xA) + +// e000800B +#define kIOFireWireSeparateBus iokit_fw_err(0xB) + +// e000800C +#define kIOFireWireBadSelfIDs iokit_fw_err(0xC) + +// e000800D +#define kIOFireWireLowCableVoltage iokit_fw_err(0xD) + +// e000800E +#define kIOFireWireInsufficientPower iokit_fw_err(0xE) + +// e000800f +#define kIOFireWireOutOfTLabels iokit_fw_err(0xF) + +// NOTE: errors 16Ñ31 used for address space response codes.. (see above) + +// e0008101 +#define kIOFireWireBogusDCLProgram iokit_fw_err(0x101) + +// e0008102 +#define kIOFireWireTalkingAndListening iokit_fw_err(0x102) + +// e0008103 +#define kIOFireWireHardwareSlept iokit_fw_err(0x103) + +// e0008104 // let's resume here... + +// e0008104 -- In the middle of completing +#define kIOFireWireCompleting iokit_fw_err(0x104) + +// e0008105 -- Invalid Response Length +#define kIOFireWireInvalidResponseLength iokit_fw_err(0x105) + +// e0008106 -- Isoch Bandwidth Not Available +#define kIOFireWireIsochBandwidthNotAvailable iokit_fw_err(0x106) + + +// e00087d0 +#define kIOFWMessageServiceIsRequestingClose (UInt32)iokit_fw_err(0x7D0) +#define kIOFWMessagePowerStateChanged (UInt32)iokit_fw_err(0x7D1) +#define kIOFWMessageTopologyChanged (UInt32)iokit_fw_err(0x7D2) +// ================================================================= +// Pseudo address space response codes +// ================================================================= +#pragma mark - +#pragma mark PSEDUO ADDRESS SPACE RESPONSE CODES +enum +{ + kFWResponseComplete = 0, // OK! + kFWResponseConflictError = 4, // Resource conflict, may retry + kFWResponseDataError = 5, // Data not available + kFWResponseTypeError = 6, // Operation not supported + kFWResponseAddressError = 7, // Address not valid in target device + kFWResponseBusResetError = 16, // Pseudo response generated locally + kFWResponsePending = 17 // Pseudo response, real response sent later. +}; + +// +// Pseudo address space response codes +// +enum +{ + kFWAckTimeout = -1, // Pseudo ack generated locally + kFWAckComplete = 1, + kFWAckPending = 2, + kFWAckBusyX = 4, + kFWAckBusyA = 5, + kFWAckBusyB = 6, + kFWAckDataError = 13, + kFWAckTypeError = 14 +}; + +// ================================================================= +// FireWire bus speed numbers +// ================================================================= +#pragma mark - +#pragma mark BUS SPEED NUMBERS + +typedef enum +{ + kFWSpeed100MBit = 0, + kFWSpeed200MBit = 1, + kFWSpeed400MBit = 2, + kFWSpeed800MBit = 3, + kFWSpeedReserved = 3, // In all cases, 1394B Devices report this speed, + // each port of the PHY could be different + + kFWSpeedUnknownMask = 0x80, // If speed was reserved and we haven't probed it further + + kFWSpeedMaximum = 0x7FFFFFFF, + kFWSpeedInvalid = 0x80000000 +} IOFWSpeed; + +// ================================================================= +// FWAddress +// ================================================================= +#pragma mark - +#pragma mark FWADDRESS +// +// The venerable FWAddress structure. This is the standard +// struct to use for passing FireWire addresses. +// + +typedef struct FWAddressStruct +{ + UInt16 nodeID; // bus/node + UInt16 addressHi; // Top 16 bits of node address. + UInt32 addressLo; // Bottom 32 bits of node address + + // + // Useful C++ only constructors + // + #ifdef __cplusplus + FWAddressStruct(const FWAddressStruct & a): + nodeID(a.nodeID), addressHi(a.addressHi), addressLo(a.addressLo) {}; + FWAddressStruct(UInt16 h=0xdead, UInt32 l=0xcafebabe) : + nodeID(0), addressHi(h), addressLo(l) {}; + FWAddressStruct(UInt16 h, UInt32 l, UInt16 n) : + nodeID(n), addressHi(h), addressLo(l) {}; + #endif +} FWAddress, *FWAddressPtr ; + +// ================================================================= +// Config ROM +// ================================================================= +#pragma mark - +#pragma mark CONFIG ROM + +// +// CSR bit defs. +// + +#define CSR_BIT(x) FW_BIT(x) + +#define CSRBitRange(start, end) \ +( \ + ((((UInt32) 0xFFFFFFFF) << (start)) >> \ + ((start) + (31 - (end)))) << \ + (31 - (end)) \ +) + +#define CSRBitRangePhase(start, end) \ + (31 - end) + +// +// Key types. +// + +typedef enum +{ + kConfigImmediateKeyType = 0, + kConfigOffsetKeyType = 1, + kConfigLeafKeyType = 2, + kConfigDirectoryKeyType = 3, + kInvalidConfigROMEntryType = 0xff +} IOConfigKeyType; + +// +// Key values. +// + +enum +{ + kConfigTextualDescriptorKey = 0x01, + kConfigBusDependentInfoKey = 0x02, + kConfigModuleVendorIdKey = 0x03, + kConfigModuleHwVersionKey = 0x04, + kConfigModuleSpecIdKey = 0x05, + kConfigModuleSwVersionKey = 0x06, + kConfigModuleDependentInfoKey = 0x07, + kConfigNodeVendorIdKey = 0x08, + kConfigNodeHwVersionKey = 0x09, + kConfigNodeSpecIdKey = 0x0A, + kConfigNodeSwVersionKey = 0x0B, + kConfigNodeCapabilitiesKey = 0x0C, + kConfigNodeUniqueIdKey = 0x0D, + kConfigNodeUnitsExtentKey = 0x0E, + kConfigNodeMemoryExtentKey = 0x0F, + kConfigNodeDependentInfoKey = 0x10, + kConfigUnitDirectoryKey = 0x11, + kConfigUnitSpecIdKey = 0x12, + kConfigUnitSwVersionKey = 0x13, + kConfigUnitDependentInfoKey = 0x14, + kConfigUnitLocationKey = 0x15, + kConfigUnitPollMaskKey = 0x16, + kConfigModelIdKey = 0x17, + kConfigGenerationKey = 0x38, // Apple-specific + + kConfigRootDirectoryKey = 0xffff // Not a real key +}; + +enum +{ + kConfigSBP2LUN = 0x14, + kConfigSBP2Revision = 0x21, + kConfigSBP2MAO = 0x54 +}; + +// Core CSR registers. +enum +{ + kCSRStateUnitDepend = CSRBitRange(0, 15), + kCSRStateUnitDependPhase = CSRBitRangePhase(0, 15), + + kCSRStateBusDepend = CSRBitRange(16, 23), + kCSRStateBusDependPhase = CSRBitRangePhase(16, 23), + + kCSRStateLost = CSR_BIT(24), + kCSRStateDReq = CSR_BIT(25), + kCSRStateELog = CSR_BIT(27), + kCSRStateAtn = CSR_BIT(28), + kCSRStateOff = CSR_BIT(29), + + kCSRStateState = CSRBitRange(30, 31), + kCSRStateStatePhase = CSRBitRangePhase(30, 31), + kCSRStateStateRunning = 0, + kCSRStateStateInitializing = 1, + kCSRStateStateTesting = 2, + kCSRStateStateDead = 3 +}; + +// Config ROM entry bit locations. + +enum +{ + kConfigBusInfoBlockLength = CSRBitRange (0, 7), + kConfigBusInfoBlockLengthPhase = CSRBitRangePhase (0, 7), + + kConfigROMCRCLength = CSRBitRange (8, 15), + kConfigROMCRCLengthPhase = CSRBitRangePhase (8, 15), + + kConfigROMCRCValue = CSRBitRange (16, 31), + kConfigROMCRCValuePhase = CSRBitRangePhase (16, 31), + + kConfigEntryKeyType = CSRBitRange (0, 1), + kConfigEntryKeyTypePhase = CSRBitRangePhase (0, 1), + + kConfigEntryKeyValue = CSRBitRange (2, 7), + kConfigEntryKeyValuePhase = CSRBitRangePhase (2, 7), + + kConfigEntryValue = CSRBitRange (8, 31), + kConfigEntryValuePhase = CSRBitRangePhase (8, 31), + + kConfigLeafDirLength = CSRBitRange (0, 15), + kConfigLeafDirLengthPhase = CSRBitRangePhase (0, 15), + + kConfigLeafDirCRC = CSRBitRange (16, 31), + kConfigLeafDirCRCPhase = CSRBitRangePhase (16, 31) +}; + +// +// Key types. +// +typedef enum +{ + kCSRImmediateKeyType = 0, + kCSROffsetKeyType = 1, + kCSRLeafKeyType = 2, + kCSRDirectoryKeyType = 3, + kInvalidCSRROMEntryType = 0xff +} IOCSRKeyType; + +// CSR 64-bit fixed address defs. + +enum +{ + kCSRNodeID = CSRBitRange (0, 15), + kCSRNodeIDPhase = CSRBitRangePhase (0, 15), + + kCSRInitialMemorySpaceBaseAddressHi = 0x00000000, + kCSRInitialMemorySpaceBaseAddressLo = 0x00000000, + + kCSRPrivateSpaceBaseAddressHi = 0x0000FFFF, + kCSRPrivateSpaceBaseAddressLo = 0xE0000000, + + kCSRRegisterSpaceBaseAddressHi = 0x0000FFFF, + kCSRRegisterSpaceBaseAddressLo = 0xF0000000, + + kCSRCoreRegistersBaseAddress = kCSRRegisterSpaceBaseAddressLo, + kCSRStateClearAddress = kCSRCoreRegistersBaseAddress + 0x0000, + kCSRStateSetAddress = kCSRCoreRegistersBaseAddress + 0x0004, + kCSRNodeIDsAddress = kCSRCoreRegistersBaseAddress + 0x0008, + kCSRResetStartAddress = kCSRCoreRegistersBaseAddress + 0x000C, + kCSRIndirectAddressAddress = kCSRCoreRegistersBaseAddress + 0x0010, + kCSRIndirectDataAddress = kCSRCoreRegistersBaseAddress + 0x0014, + kCSRSplitTimeoutHiAddress = kCSRCoreRegistersBaseAddress + 0x0018, + kCSRSplitTimeoutLoAddress = kCSRCoreRegistersBaseAddress + 0x001C, + kCSRArgumentHiAddress = kCSRCoreRegistersBaseAddress + 0x0020, + kCSRArgumentLoAddress = kCSRCoreRegistersBaseAddress + 0x0024, + kCSRTestStartAddress = kCSRCoreRegistersBaseAddress + 0x0028, + kCSRTestStatusAddress = kCSRCoreRegistersBaseAddress + 0x002C, + kCSRUnitsBaseHiAddress = kCSRCoreRegistersBaseAddress + 0x0030, + kCSRUnitsBaseLoAddress = kCSRCoreRegistersBaseAddress + 0x0034, + kCSRUnitsBoundHiAddress = kCSRCoreRegistersBaseAddress + 0x0038, + kCSRUnitsBoundLoAddress = kCSRCoreRegistersBaseAddress + 0x003C, + kCSRMemoryBaseHiAddress = kCSRCoreRegistersBaseAddress + 0x0040, + kCSRMemoryBaseLoAddress = kCSRCoreRegistersBaseAddress + 0x0044, + kCSRMemoryBoundHiAddress = kCSRCoreRegistersBaseAddress + 0x0048, + kCSRMemoryBoundLoAddress = kCSRCoreRegistersBaseAddress + 0x004C, + kCSRInterruptTargetAddress = kCSRCoreRegistersBaseAddress + 0x0050, + kCSRInterruptMaskAddress = kCSRCoreRegistersBaseAddress + 0x0054, + kCSRClockValueHiAddress = kCSRCoreRegistersBaseAddress + 0x0058, + kCSRClockValueMidAddress = kCSRCoreRegistersBaseAddress + 0x005C, + kCSRClockTickPeriodMidAddress = kCSRCoreRegistersBaseAddress + 0x0060, + kCSRClockTickPeriodLoAddress = kCSRCoreRegistersBaseAddress + 0x0064, + kCSRClockStrobeArrivedHiAddress = kCSRCoreRegistersBaseAddress + 0x0068, + kCSRClockStrobeArrivedMidAddress = kCSRCoreRegistersBaseAddress + 0x006C, + kCSRClockInfo0Address = kCSRCoreRegistersBaseAddress + 0x0070, + kCSRClockInfo1Address = kCSRCoreRegistersBaseAddress + 0x0074, + kCSRClockInfo2Address = kCSRCoreRegistersBaseAddress + 0x0078, + kCSRClockInfo3Address = kCSRCoreRegistersBaseAddress + 0x007C, + kCSRMessageRequestAddress = kCSRCoreRegistersBaseAddress + 0x0080, + kCSRMessageResponseAddress = kCSRCoreRegistersBaseAddress + 0x00C0, + kCSRErrorLogBufferAddress = kCSRCoreRegistersBaseAddress + 0x0180, + + kCSRBusDependentRegistersBaseAddress = kCSRRegisterSpaceBaseAddressLo + 0x0200, + kCSRBusyTimeout = kCSRRegisterSpaceBaseAddressLo + 0x0210, + kCSRBusManagerID = kCSRRegisterSpaceBaseAddressLo + 0x021C, + kCSRBandwidthAvailable = kCSRRegisterSpaceBaseAddressLo + 0x0220, + kCSRChannelsAvailable31_0 = kCSRRegisterSpaceBaseAddressLo + 0x0224, + kCSRChannelsAvailable63_32 = kCSRRegisterSpaceBaseAddressLo + 0x0228, + kCSRBroadcastChannel = kCSRRegisterSpaceBaseAddressLo + 0x0234, + + kConfigROMBaseAddress = kCSRRegisterSpaceBaseAddressLo + 0x0400, + kConfigBIBHeaderAddress = kConfigROMBaseAddress, + kConfigBIBBusNameAddress = kConfigROMBaseAddress + 4, + + kPCRBaseAddress = kCSRRegisterSpaceBaseAddressLo + 0x900, + kFCPCommandAddress = kCSRRegisterSpaceBaseAddressLo + 0xb00, + kFCPResponseAddress = kCSRRegisterSpaceBaseAddressLo + 0xd00 +}; + +// from figure 10-7 of 1394a +#define kBroadcastChannelInitialValues 0x8000001f +#define kBroadcastChannelValidMask 0x40000000 + +// CSR defined 64 bit unique ID. + +typedef UInt64 CSRNodeUniqueID; + +// FireWire core CSR registers. + +enum +{ + kFWCSRStateGone = FW_BIT(16), + kFWCSRStateLinkOff = FW_BIT(22), + kFWCSRStateCMstr = FW_BIT(23) +}; + +// FireWire bus/nodeID address defs. + +enum +{ + kFWAddressBusID = FWBitRange (16, 25) << kCSRNodeIDPhase, + kFWAddressBusIDPhase = FWBitRangePhase (16, 25) + kCSRNodeIDPhase, + + kFWAddressNodeID = FWBitRange (26, 31) << kCSRNodeIDPhase, + kFWAddressNodeIDPhase = FWBitRangePhase (26, 31) + kCSRNodeIDPhase, + + kFWLocalBusID = 1023, + kFWBroadcastNodeID = 63, + kFWBadNodeID = 0xffff, + + kFWLocalBusAddress = kFWLocalBusID << kFWAddressBusIDPhase, + kFWBroadcastAddress = kFWBroadcastNodeID << kFWAddressNodeIDPhase +}; + +#define FWNodeBaseAddress(busID, nodeID) \ +( \ + (busID << kFWAddressBusIDPhase) | \ + (nodeID << kFWAddressNodeIDPhase) \ +) + +#define FWNodeRegisterSpaceBaseAddressHi(busID, nodeID) \ +( \ + FWNodeBaseAddress (busID, nodeID) | \ + kCSRRegisterSpaceBaseAddressHi \ +) + +// FireWire CSR bus info block defs. + +enum +{ + kFWBIBHeaderAddress = kConfigBIBHeaderAddress, + kFWBIBBusNameAddress = kConfigBIBBusNameAddress, + kFWBIBNodeCapabilitiesAddress = kConfigROMBaseAddress + 8, + kFWBIBNodeUniqueIDHiAddress = kConfigROMBaseAddress + 12, + kFWBIBNodeUniqueIDLoAddress = kConfigROMBaseAddress + 16, + + kFWBIBBusName = 0x31333934, //'1394' + + kFWBIBIrmc = FW_BIT(0), + kFWBIBCmc = FW_BIT(1), + kFWBIBIsc = FW_BIT(2), + kFWBIBBmc = FW_BIT(3), + kFWBIBCycClkAcc = FWBitRange (8, 15), + kFWBIBCycClkAccPhase = FWBitRangePhase (8, 15), + kFWBIBMaxRec = FWBitRange (16, 19), + kFWBIBMaxRecPhase = FWBitRangePhase (16, 19), + kFWBIBMaxROM = FWBitRange (20, 21), + kFWBIBMaxROMPhase = FWBitRangePhase (20, 21), + kFWBIBGeneration = FWBitRange (24, 27), + kFWBIBGenerationPhase = FWBitRangePhase (24, 27), + kFWBIBLinkSpeed = FWBitRange (29, 31), + kFWBIBLinkSpeedPhase = FWBitRangePhase (29, 31) +}; + +enum +{ + kConfigUnitSpecAppleA27 = 0x000a27, + kConfigUnitSpec1394TA1 = 0x00a02d, + + kConfigUnitSWVersMacintosh10 = 10, + kConfigUnitSWVersIIDC100 = 0x000100, + kConfigUnitSWVersIIDC101 = 0x000101, + kConfigUnitSWVersIIDC102 = 0x000102 +}; + + +// ================================================================= +// Isoch defines +// ================================================================= +#pragma mark - +#pragma mark ISOCH + +enum +{ + kFWIsochDataLength = FWBitRange (0, 15), + kFWIsochDataLengthPhase = FWBitRangePhase (0, 15), + + kFWIsochTag = FWBitRange (16, 17), + kFWIsochTagPhase = FWBitRangePhase (16, 17), + + kFWIsochChanNum = FWBitRange (18, 23), + kFWIsochChanNumPhase = FWBitRangePhase (18, 23), + + kFWIsochTCode = FWBitRange (24, 27), + kFWIsochTCodePhase = FWBitRangePhase (24, 27), + + kFWIsochSy = FWBitRange (28, 31), + kFWIsochSyPhase = FWBitRangePhase (28, 31) +}; + +#define CHAN_BIT(x) (((UInt64)1) << (63 - (x)) +#define CHAN_MASK(x) (~CHAN_BIT(X)) + +typedef enum +{ + kFWNeverMultiMode = 0, + kFWAllowMultiMode, + kFWSuggestMultiMode, + kFWAlwaysMultiMode, + + kFWDefaultIsochResourceFlags = kFWNeverMultiMode +} IOFWIsochResourceFlags ; + +enum +{ + kFWIsochChannelDefaultFlags = 0, + kFWIsochChannelDoNotResumeOnWake = BIT(1) +} ; + +typedef enum +{ + kFWIsochPortDefaultOptions = 0, + kFWIsochPortUseSeparateKernelThread = BIT(1), + kFWIsochEnableRobustness = BIT(2), + kFWIsochBigEndianUpdates = BIT(3), // private + kFWIsochRequireLastContext = BIT(4), // private +} IOFWIsochPortOptions ; + +// ================================================================= +// DCL opcode defs. +// ================================================================= +#pragma mark - +#pragma mark DCL OPCODES + +enum +{ + kFWDCLImmediateEvent = 0, + kFWDCLCycleEvent = 1, + kFWDCLSyBitsEvent = 2 +}; + +typedef enum +{ + kFWDCLInvalidNotification = 0 + , kFWDCLUpdateNotification = 1 + , kFWDCLModifyNotification = 2 + , kFWNuDCLModifyNotification = 3 + , kFWNuDCLModifyJumpNotification = 4 + , kFWNuDCLUpdateNotification = 5 +} IOFWDCLNotificationType ; + +enum +{ + kFWDCLOpDynamicFlag = BIT(16), + kFWDCLOpVendorDefinedFlag = BIT(17), + kFWDCLOpFlagMask = BitRange (16, 31), + kFWDCLOpFlagPhase = BitRangePhase (16, 31) +}; + +enum +{ + kDCLInvalidOp = 0, + kDCLSendPacketStartOp = 1, + //kDCLSendPacketWithHeaderStartOp = 2, // Deprecated legacy DCL opcode! Use NuDCL instead! + kDCLSendPacketOp = 3, + kDCLSendBufferOp = 4, // obsolete - do not use + kDCLReceivePacketStartOp = 5, + kDCLReceivePacketOp = 6, + kDCLReceiveBufferOp = 7, // obsolete - do not use + kDCLCallProcOp = 8, + kDCLLabelOp = 9, + kDCLJumpOp = 10, + kDCLSetTagSyncBitsOp = 11, + kDCLUpdateDCLListOp = 12, + kDCLTimeStampOp = 13, + kDCLPtrTimeStampOp = 14, + kDCLSkipCycleOp = 15, + + kDCLNuDCLLeaderOp = 20 // compilerData field contains NuDCLRef to start of NuDCL + // program. + // Should not need to use this directly. +}; + +#ifdef FW_OLD_DCL_DEFS + +//typedef struct DCLCommandStruct ; +//typedef void (DCLCallCommandProc)(DCLCommandStruct* command); + +#else + +//typedef struct DCLCommand ; +//typedef void (DCLCallCommandProc)(DCLCommand* command); + +#endif + +// ================================================================= +// DCL structs +// ================================================================= +#pragma mark - +#pragma mark DCL + +#ifdef __LP64__ +typedef void* DCLCallProcDataType; +#else +typedef UInt32 DCLCallProcDataType; +#endif + +#ifdef KERNEL + #ifdef __LP64__ + typedef void* DCLCompilerDataType; + #else + typedef UInt32 DCLCompilerDataType; + #endif +#else + typedef UInt32 DCLCompilerDataType; +#endif + +typedef struct DCLCommandStruct +{ + struct DCLCommandStruct * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 operands[1]; // DCL operands (size varies) +} DCLCommand; + +typedef void (DCLCallCommandProc)(DCLCommand * command); + +typedef struct DCLTransferPacketStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + void * buffer; // Packet buffer. + UInt32 size; // Buffer size. +} DCLTransferPacket ; + +typedef struct DCLTransferBufferStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + void * buffer; // Buffer. + UInt32 size; // Buffer size. + UInt16 packetSize; // Size of packets to send. + UInt16 reserved; + UInt32 bufferOffset; // Current offset into buffer. +} DCLTransferBuffer ; + +typedef struct DCLCallProcStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + DCLCallCommandProc * proc; // Procedure to call. + DCLCallProcDataType procData; // Data for use by called procedure. +} DCLCallProc; + +typedef struct DCLLabelStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. +} DCLLabel; + +typedef struct DCLJumpStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + DCLLabel * pJumpDCLLabel; // DCL label to jump to. +} DCLJump; + +typedef struct DCLSetTagSyncBitsStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt16 tagBits; // Tag bits for following packets. + UInt16 syncBits; // Sync bits for following packets. +} DCLSetTagSyncBits; + +typedef struct DCLUpdateDCLListStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + DCLCommand ** dclCommandList; // List of DCL commands to update. + UInt32 numDCLCommands; // Number of DCL commands in list. +} DCLUpdateDCLList; + +typedef struct DCLTimeStampStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 timeStamp; // Time stamp. +} DCLTimeStamp; + +typedef struct DCLPtrTimeStampStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 * timeStampPtr; // Where to store the time stamp. +} DCLPtrTimeStamp ; + +typedef struct +{ + DCLCommand * pNextDCLCommand ; // unused - always NULL + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode ; // must be kDCLNuDCLLeaderOp + void* program ; // NuDCL program here... +} DCLNuDCLLeader ; + +#ifdef FW_OLD_DCL_DEFS + +// should not use these... + +typedef DCLCommand* DCLCommandPtr ; +typedef DCLTransferBuffer* DCLTransferBufferPtr ; +typedef DCLTransferPacket* DCLTransferPacketPtr ; +typedef DCLCallProc* DCLCallProcPtr ; +typedef DCLLabel* DCLLabelPtr ; +typedef DCLJump* DCLJumpPtr ; +typedef DCLSetTagSyncBits* DCLSetTagSyncBitsPtr ; +typedef DCLUpdateDCLList* DCLUpdateDCLListPtr ; +typedef DCLTimeStamp* DCLTimeStampPtr ; +typedef DCLPtrTimeStamp* DCLPtrTimeStampPtr ; +typedef DCLCallCommandProc* DCLCallCommandProcPtr ; + +#endif + + +// ================================================================= +// User-Lib Export DCL structs - Thses structus are used to pass +// a user-created legacy DCL program down into kernel space. These +// structs allow support for both 32-bit and 64-bit user-space clients. +// These structs should only be used internally. They are not for +// clients to create DCL programs with. +// ================================================================= + +typedef struct UserExportDCLCommandStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 operands[1]; // DCL operands (size varies) +} __attribute__ ((packed)) UserExportDCLCommand; + +typedef void (UserExportDCLCallCommandProc)(UserExportDCLCommand * command); + +typedef struct UserExportDCLTransferPacketStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t buffer; // Packet buffer. + UInt32 size; // Buffer size. +} __attribute__ ((packed)) UserExportDCLTransferPacket ; + +typedef struct UserExportDCLTransferBufferStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t buffer; // Buffer. + UInt32 size; // Buffer size. + UInt16 packetSize; // Size of packets to send. + UInt16 reserved; + UInt32 bufferOffset; // Current offset into buffer. +} __attribute__ ((packed)) UserExportDCLTransferBuffer ; + +typedef struct UserExportDCLCallProcStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t proc; // Procedure to call. + uint64_t procData; // Data for use by called procedure. +} __attribute__ ((packed)) UserExportDCLCallProc; + +typedef struct UserExportDCLLabelStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. +} __attribute__ ((packed)) UserExportDCLLabel; + +typedef struct UserExportDCLJumpStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t pJumpDCLLabel; // DCL label to jump to. +} __attribute__ ((packed)) UserExportDCLJump; + +typedef struct UserExportDCLSetTagSyncBitsStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt16 tagBits; // Tag bits for following packets. + UInt16 syncBits; // Sync bits for following packets. +} __attribute__ ((packed)) UserExportDCLSetTagSyncBits; + +typedef struct UserExportDCLUpdateDCLListStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t dclCommandList; // List of DCL commands to update. + UInt32 numDCLCommands; // Number of DCL commands in list. +} __attribute__ ((packed)) UserExportDCLUpdateDCLList; + +typedef struct UserExportDCLTimeStampStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 timeStamp; // Time stamp. +} __attribute__ ((packed)) UserExportDCLTimeStamp; + +typedef struct UserExportDCLPtrTimeStampStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t timeStampPtr; // Where to store the time stamp. +} __attribute__ ((packed)) UserExportDCLPtrTimeStamp ; + +typedef struct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand ; // unused - always NULL + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode ; // must be kDCLNuDCLLeaderOp + mach_vm_address_t program ; // NuDCL program here... +} __attribute__ ((packed)) UserExportDCLNuDCLLeader ; + + +// ================================================================= +// NuDCL +// ================================================================= +#pragma mark - +#pragma mark NUDCL + +typedef struct __NuDCL * NuDCLRef ; +typedef NuDCLRef NuDCLSendPacketRef ; +typedef NuDCLRef NuDCLSkipCycleRef ; +typedef NuDCLRef NuDCLReceivePacketRef ; + +typedef void (*NuDCLCallback)( void* refcon, NuDCLRef dcl ); + +typedef enum +{ + kNuDCLDynamic = BIT( 1 ), + kNuDCLUpdateBeforeCallback = BIT( 2 ) + +} NuDCLFlags ; + +// ================================================================= +// Miscellaneous +// ================================================================= +#pragma mark - +#pragma mark MISCELLANEOUS + +typedef void* FWClientCommandID ; + +typedef struct IOFireWireSessionRefOpaqueStuct* IOFireWireSessionRef ; + +// +// bus management constants. +// + +enum +{ + kFWBusManagerArbitrationTimeoutDuration = 625 // durationMillisecond +}; + +// +// bus characteristics. +// + +enum +{ + kFWMaxBusses = 1023, + kFWMaxNodesPerBus = 63, + kFWMaxNodeHops = 16 +}; + +/*! @enum NodeFlags + + @abstract Flags that specify characteristics of the FireWire device node. + + @constant kIOFWDisablePhysicalAccess Disable physical memory access + + @constant kIOFWDisableAllPhysicalAccess Disable all physical memory access + + @constant kIOFWEnableRetryOnAckD Enable retry on Ack D + + @constant kIOFWLimitAsyncPacketSize Limit async packet size + + @constant kIOFWDisablePhyOnSleep Disable Phy, when machine is in Sleep mode + + @constant kIOFWMustBeRoot Attempt to make this device root, There is no guarentee Mac OS will succeed in making the device + root. + + @constant kIOFWMustNotBeRoot Attempt to prevent this device from being root, There is no guarentee Mac OS will succeed in preventing the device + from being root. + + @constant kIOFWMustHaveGap63 Attempt to ensure the gap count is 63, when this device is on the bus. Gap 63 reduces bus performance significantly, + so this flag should be used only when absolutely necessary. There is no guarentee Mac OS will succeed in forcing + the gap count to 63. +*/ +enum +{ + kIOFWDisablePhysicalAccess = (1 << 0), + kIOFWDisableAllPhysicalAccess = (1 << 1), + kIOFWEnableRetryOnAckD = (1 << 2), + kIOFWLimitAsyncPacketSize = (1 << 3), + kIOFWDisablePhyOnSleep = (1 << 4), + kIOFWMustBeRoot = (1 << 5), + kIOFWMustNotBeRoot = (1 << 6), + kIOFWMustHaveGap63 = (1 << 7) +}; + +// +// write flags +// + +enum IOFWWriteFlags +{ + kIOFWWriteFlagsNone = 0x00000000, + kIOFWWriteFlagsDeferredNotify = 0x00000001, + kIOFWWriteFastRetryOnBusy = 0x00000002, + kIOFWWriteBlockRequest = 0x00000004, // force a block request +}; + +// +// read flags +// + +enum IOFWReadFlags +{ + kIOFWReadFlagsNone = 0x00000000, + kIOFWReadBlockRequest = 0x00000004, // force a block request + kIOFWReadPingTime = 0x00000008 // ping time +}; + +// +// security modes +// + +enum IOFWSecurityMode +{ + kIOFWSecurityModeNormal = 0, + kIOFWSecurityModeSecure = 1, + kIOFWSecurityModeSecurePermanent = 2 +}; + +// +// physical access settings +// + +enum IOFWPhysicalAccessMode +{ + kIOFWPhysicalAccessEnabled = 0, + kIOFWPhysicalAccessDisabled = 1, + kIOFWPhysicalAccessDisabledForGeneration = 2 +}; + +enum +{ + kIOFWSpecID_AAPL = 0xa27, + kIOFWSWVers_KPF = 0x40 +}; + +// old style bit defs +#ifdef FW_OLD_BIT_DEFS + + #define kBit0 BIT(0) + #define kBit1 BIT(1) + #define kBit2 BIT(2) + #define kBit3 BIT(3) + #define kBit4 BIT(4) + #define kBit5 BIT(5) + #define kBit6 BIT(6) + #define kBit7 BIT(7) + #define kBit8 BIT(8) + #define kBit9 BIT(9) + #define kBit10 BIT(10) + #define kBit11 BIT(11) + #define kBit12 BIT(12) + #define kBit13 BIT(13) + #define kBit14 BIT(14) + #define kBit15 BIT(15) + #define kBit16 BIT(16) + #define kBit17 BIT(17) + #define kBit18 BIT(18) + #define kBit19 BIT(19) + #define kBit20 BIT(20) + #define kBit21 BIT(21) + #define kBit22 BIT(22) + #define kBit23 BIT(23) + #define kBit24 BIT(24) + #define kBit25 BIT(25) + #define kBit26 BIT(26) + #define kBit27 BIT(27) + #define kBit28 BIT(28) + #define kBit29 BIT(29) + #define kBit30 BIT(30) + #define kBit31 BIT(31) + +#endif + +#endif //__IOFireWireFamilyCommon_H__ diff --git a/QualcommWireless/include/IOKit/firewire/IOFireWireIRMAllocation.h b/QualcommWireless/include/IOKit/firewire/IOFireWireIRMAllocation.h new file mode 100644 index 0000000..c67986c --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFireWireIRMAllocation.h @@ -0,0 +1,116 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREIRMALLOCATION_H +#define _IOKIT_IOFIREWIREIRMALLOCATION_H + +#include + +class IOFireWireController; + +//#include +//#include + +/*! @class IOFireWireIRMAllocation +*/ + +class IOFireWireIRMAllocation : public OSObject +{ + friend class IOFireWireController; + + OSDeclareDefaultStructors(IOFireWireIRMAllocation) + +public: + + // Prototype for the callback if reallocation after bus-reset is unsuccessful. + typedef IOReturn (*AllocationLostNotificationProc)(void* refCon, class IOFireWireIRMAllocation* allocation); + + // Initialize the IRM allocation object. + virtual bool init( IOFireWireController * control, + Boolean releaseIRMResourcesOnFree = true, + AllocationLostNotificationProc allocationLostProc = NULL, + void *pLostProcRefCon = NULL); + + // Specify whether of not the IRM resources should automatically + // be released when freeing this allocation object. + virtual void setReleaseIRMResourcesOnFree(Boolean doRelease); + + // Use the IRMAllocation object to allocate isoch resources + virtual IOReturn allocateIsochResources(UInt8 isochChannel, UInt32 bandwidthUnits); + + // Free isoch resources previously allocated with a call to allocateIsochResources + virtual IOReturn deallocateIsochResources(void); + + // Returns true if isoch resources are currently allocated, and if true, the allocated channel, and amount of isoch bandwidth. + virtual Boolean areIsochResourcesAllocated(UInt8 *pAllocatedIsochChannel, UInt32 *pAllocatedBandwidthUnits); + + // Get the refcon + virtual void * GetRefCon(void); + virtual void SetRefCon(void* refCon); + + // Override the base-class release function for special processing + virtual void release() const; + +protected: + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + // Free the allocation object (and release IRM resources if needed) + virtual void free( void ); + + // Controller will call this to notify about bus-reset complete. + virtual void handleBusReset(UInt32 generation); + + virtual void failedToRealloc(void); + virtual UInt32 getAllocationGeneration(void); + static void threadFunc( void * arg ); + +private: + + AllocationLostNotificationProc fAllocationLostProc; + void *fLostProcRefCon; + Boolean fReleaseIRMResourcesOnFree; + UInt8 fIsochChannel; + UInt32 fBandwidthUnits; + UInt32 fAllocationGeneration; + IORecursiveLock *fLock ; + IOFireWireController *fControl; + Boolean isAllocated; + + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 0); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 1); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 2); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 3); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 4); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 5); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 6); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 7); +}; + +#endif // _IOKIT_IOFIREWIREIRMALLOCATION_H diff --git a/QualcommWireless/include/IOKit/firewire/IOFireWireLocalNode.h b/QualcommWireless/include/IOKit/firewire/IOFireWireLocalNode.h new file mode 100644 index 0000000..8906da3 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFireWireLocalNode.h @@ -0,0 +1,140 @@ +/* + * IOFireWireLocalNode.h + * IOFireWireFamily + * + * Created by Niels on Fri Aug 16 2002. + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + $Log: not supported by cvs2svn $ + Revision 1.7 2008/11/14 00:17:12 arulchan + fix for rdar://5939334 + + Revision 1.6 2005/02/18 22:56:53 gecko1 + 3958781 Q45C EVT: FireWire ASP reporter says port speed is 800 Mb/sec + + Revision 1.5 2003/02/20 02:00:12 collin + *** empty log message *** + + Revision 1.4 2003/02/17 21:47:53 collin + *** empty log message *** + + Revision 1.3 2002/10/18 23:29:44 collin + fix includes, fix cast which fails on new compiler + + Revision 1.2 2002/09/25 00:27:24 niels + flip your world upside-down + +*/ + +// public +#import + +class IOFireWireLocalNode; + +#pragma mark - + +/*! + @class IOFireWireLocalNodeAux +*/ + +class IOFireWireLocalNodeAux : public IOFireWireNubAux +{ + OSDeclareDefaultStructors(IOFireWireLocalNodeAux) + + friend class IOFireWireLocalNode; + +protected: + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFireWireLocalNode * primary ); + virtual void free(void) APPLE_KEXT_OVERRIDE; + +private: + OSMetaClassDeclareReservedUnused(IOFireWireLocalNodeAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireLocalNodeAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireLocalNodeAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireLocalNodeAux, 3); + +}; + +#pragma mark - + +/*! @class IOFireWireLocalNode +*/ + +class IOFireWireLocalNode : public IOFireWireNub +{ + OSDeclareDefaultStructors(IOFireWireLocalNode) + + friend class IOFireWireLocalNodeAux; + + /*------------------Useful info about device (also available in the registry)--------*/ +protected: + + /*-----------Methods provided to FireWire device clients-------------*/ +public: + + // Set up properties affected by bus reset + virtual void setNodeProperties(UInt32 generation, UInt16 nodeID, UInt32 *selfIDs, int numIDs, IOFWSpeed maxSpeed ); + + /* + * Standard nub initialization + */ + virtual bool init(OSDictionary * propTable) APPLE_KEXT_OVERRIDE; + virtual bool attach(IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual void handleClose( IOService * forClient, + IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ) APPLE_KEXT_OVERRIDE; + virtual bool handleIsOpen( const IOService * forClient ) const APPLE_KEXT_OVERRIDE; + + /* + * Trick method to create protocol user clients + */ + virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE; + +protected: + + virtual IOFireWireNubAux * createAuxiliary( void ) APPLE_KEXT_OVERRIDE; + +public: + virtual IOReturn message( UInt32 type, IOService * provider, void * argument ) APPLE_KEXT_OVERRIDE; + virtual void free(void) APPLE_KEXT_OVERRIDE; + +protected: + OSSet * fOpenClients; +}; diff --git a/QualcommWireless/include/IOKit/firewire/IOFireWireMultiIsochReceive.h b/QualcommWireless/include/IOKit/firewire/IOFireWireMultiIsochReceive.h new file mode 100644 index 0000000..e003660 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFireWireMultiIsochReceive.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREMULTIISOCHRECEIVE_H_ +#define _IOKIT_IOFIREWIREMULTIISOCHRECEIVE_H_ + +class IOFireWireMultiIsochReceiveListener; +class IOFireWireMultiIsochReceivePacket; +class IOFireWireController; + +typedef IOReturn (*FWMultiIsochReceiveListenerCallback)(void *refcon, IOFireWireMultiIsochReceivePacket *pPacket); + +// These are the parameters clients can set which help us to optimize the mult-isoch-receiver +// polling interval, and memory resources +typedef struct FWMultiIsochReceiveListenerParamsStruct + { + // How much latency, from when the packet arrives to when the client is notified, can the client tolerate. + UInt32 maxLatencyInFireWireCycles; + + // In bits per second, the expected bit-rate of the incoming stream + UInt32 expectedStreamBitRate; + + // How long does the client expect to hold onto packets objects before returning them back to the receiver + UInt32 clientPacketReturnLatencyInFireWireCycles; + }FWMultiIsochReceiveListenerParams; + +/*! @class IOFireWireMultiIsochReceiveListener +*/ + +class IOFireWireMultiIsochReceiveListener : public OSObject + { + friend class IOFireWireLink; + + protected: + OSDeclareDefaultStructors(IOFireWireMultiIsochReceiveListener) + bool init(IOFireWireController *fwController, + UInt32 receiveChannel, + FWMultiIsochReceiveListenerCallback callback, + void *pCallbackRefCon, + FWMultiIsochReceiveListenerParams *pListenerParams); + void free(); + public: + static IOFireWireMultiIsochReceiveListener *create(IOFireWireController *fwController, + UInt32 channel, + FWMultiIsochReceiveListenerCallback callback, + void *pCallbackRefCon, + FWMultiIsochReceiveListenerParams *pListenerParams); + + // Call this to activate the listener + IOReturn Activate(); + + // Call this to deactivate the listener + IOReturn Deactivate(); + + // Call this to modify the callback/refcon pointers. Only call this when not activated! + IOReturn SetCallback(FWMultiIsochReceiveListenerCallback callback, + void *pCallbackRefCon); + + // Accessors + inline UInt32 getReceiveChannel(void) {return fChannel;}; + inline FWMultiIsochReceiveListenerCallback getCallback(void){return fClientCallback;}; + inline void * getRefCon(void){return fClientCallbackRefCon;}; + inline bool getActivatedState(void) {return fActivated;}; + + protected: + IOFireWireController *fControl; + UInt32 fChannel; + FWMultiIsochReceiveListenerCallback fClientCallback; + void *fClientCallbackRefCon; + bool fActivated; + FWMultiIsochReceiveListenerParams *fListenerParams; + }; + +#define kMaxRangesPerMultiIsochReceivePacket 6 + +/*! @class IOFireWireMultiIsochReceivePacket +*/ + +class IOFireWireMultiIsochReceivePacket : public OSObject + { + OSDeclareDefaultStructors(IOFireWireMultiIsochReceivePacket) + bool init(IOFireWireController *fwController); + void free(); + public: + static IOFireWireMultiIsochReceivePacket *create(IOFireWireController *fwController); + + // The clients who are passed this packet by the + // multi-isoch receiver calling their callback + // MUST call clientDone() on this packet to + // return it back for reuse! + void clientDone(void); + + UInt32 isochChannel(void); + UInt32 packetReceiveTime(void); + + UInt32 isochPayloadSize(void); // The size of just the isoch payload, not including header/trailer quads. + inline UInt32 isochPacketSize(void) {return isochPayloadSize()+8; }; // The size of the packet, including header/trailer quads. + + // This returns a memory descriptor to the client. The client must call complete(), and release() on the + // memory descriptor when done. + IOMemoryDescriptor *createMemoryDescriptorForRanges(void); + + // These should be treated as read-only by clients, + // as should the data contained in these buffers! + IOAddressRange ranges[kMaxRangesPerMultiIsochReceivePacket] ; + UInt32 numRanges; + + // These should be treated private for clients! + // Messing with them will screw up the bookkeepping + // in the Multi-Isoch Receiver! + UInt32 numClientReferences; + void* elements[kMaxRangesPerMultiIsochReceivePacket]; + + protected: + IOFireWireController *fControl; + }; + +#endif \ No newline at end of file diff --git a/QualcommWireless/include/IOKit/firewire/IOFireWireNub.h b/QualcommWireless/include/IOKit/firewire/IOFireWireNub.h new file mode 100644 index 0000000..39762ce --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFireWireNub.h @@ -0,0 +1,293 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFireWireNub.h + * + * + * Note: IOFWCommand(s) are allocated by methods in this class. + * The remaining methods to setup and submit IOFWCommands are defined in + * IOFWCommand.h + */ +#ifndef _IOKIT_IOFIREWIRENUB_H +#define _IOKIT_IOFIREWIRENUB_H + +// public +#include +#include +#include + +class IOFireWireController; +class IOFireWireBus; +class IOConfigDirectory; +class IOFireWireNub; +class IOFireWireDevice; +class IOFireWireUnit; +class IOFWSimplePhysicalAddressSpace; +class IOFWSimpleContiguousPhysicalAddressSpace; + +enum TerminationState +{ + kNotTerminated = 0, + kNeedsTermination, + kTerminated +}; + +#pragma mark - + +/*! + @class IOFireWireNubAux +*/ + +class IOFireWireNubAux : public OSObject +{ + OSDeclareDefaultStructors(IOFireWireNubAux) + + friend class IOFireWireNub; + +protected: + + IOFireWireNub * fPrimary; + TerminationState fTerminationState; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFireWireNub * primary ); + virtual void free(void) APPLE_KEXT_OVERRIDE; + + virtual UInt32 hopCount( IOFireWireNub * nub ); + virtual UInt32 hopCount( void ); + + virtual TerminationState getTerminationState( void ); + virtual void setTerminationState( TerminationState state ); + + virtual bool isPhysicalAccessEnabled( void ); + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ); + + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 3); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 4); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 5); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 6); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 7); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 8); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 9); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 10); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 11); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 12); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 13); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 14); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 15); + +}; + +#pragma mark - + +/*! @class IOFireWireNub +*/ +class IOFireWireNub : public IOService +{ + OSDeclareAbstractStructors(IOFireWireNub) + + friend class IOFireWireController; + friend class IOFireWireNubAux; + friend class IOFireWireDeviceAux; + friend class IOFireWireUnitAux; + friend class IOFireWireDevice; + friend class IOFireWireUnit; + +/*------------------Useful info about device (also available in the registry)--------*/ +protected: + int fDeviceSpeed; // Max supported by device + int fCommsSpeed; // Max speed this node can communicate with device + UInt16 fNodeID; // Current node ID (could change after bus reset!) + UInt16 fLocalNodeID; // ID of the local node (could change after bus reset!) + UInt32 fGeneration; // ID Of bus topology that fNodeID is valid for. + CSRNodeUniqueID fUniqueID; // Device's globally unique ID (never changes) + mach_timespec_t fAsyncTimeout; // Guesstimate of how long to wait for response + // from device when making async requests + // Different values for quad/block transfers? + // OS8 FW has 40/100 mSec. + + int fMaxReadPackLog; + int fMaxWritePackLog; + int fMaxReadROMPackLog; + + IOFireWireController *fControl; + IOConfigDirectory *fDirectory; + + UInt32 fNodeFlags; + + OSSet * fConfigDirectorySet; + + IOFireWireNubAux * fAuxiliary; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual void free(void) APPLE_KEXT_OVERRIDE; + +/*------------------Methods provided to FireWire device clients-----------------------*/ +public: + + // Get nodeID and bus generation info + IOReturn getNodeIDGeneration(UInt32 &generation, UInt16 &nodeID, UInt16 &localID) const; + IOReturn getNodeIDGeneration(UInt32 &generation, UInt16 &nodeID) const; + + // How fast can this system talk to the node? + virtual IOFWSpeed FWSpeed() const; + + // How fast can this node talk to another node? + virtual IOFWSpeed FWSpeed(const IOFireWireNub *dst) const; + + // How big (as a power of two) can packets sent to/received from the node be? + virtual int maxPackLog(bool forSend) const; + + // How big (as a power of two) can packets sent to/received from a specified address in the node be? + virtual int maxPackLog(bool forSend, FWAddress address) const; + + // How big (as a power of two) can packets sent from this node to dst node/received from dst be? + virtual int maxPackLog(bool forSend, const IOFireWireNub *dst) const; + + // Set maximum packet size nub can handle + virtual void setMaxPackLog(bool forSend, bool forROM, int maxPackLog); + + /* + * Create various FireWire commands to send to the device + */ + virtual IOFWReadCommand *createReadCommand(FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + virtual IOFWReadQuadCommand *createReadQuadCommand(FWAddress devAddress, UInt32 *quads, int numQuads, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + + virtual IOFWWriteCommand *createWriteCommand(FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + virtual IOFWWriteQuadCommand *createWriteQuadCommand(FWAddress devAddress, UInt32 *quads, int numQuads, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + + // size is 1 for 32 bit compare, 2 for 64 bit. + virtual IOFWCompareAndSwapCommand *createCompareAndSwapCommand(FWAddress devAddress, + const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + /* + * Create local FireWire address spaces for the device to access + */ + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem); + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon); + + /* + * Get Config directory for nub + * Device nub directory is root directory, Unit nub directory is Unit directory. + * + * Depricated use getConfigDirectoryRef + * + */ + + virtual IOReturn getConfigDirectory(IOConfigDirectory *&dir); + + /* + * Get bus for nub + */ + IOFireWireBus * getBus() const; + + IOFireWireController * getController() const; + + const CSRNodeUniqueID &getUniqueID() const; + + /* + * Standard nub initialization + */ + virtual bool init(OSDictionary * propTable) APPLE_KEXT_OVERRIDE; + + virtual void setNodeFlags( UInt32 flags ); + virtual UInt32 getNodeFlags( void ); + virtual void clearNodeFlags( UInt32 flags ); + + virtual IOReturn setConfigDirectory( IOConfigDirectory *directory ); + + virtual IOReturn getConfigDirectoryRef( IOConfigDirectory *&dir ); + + inline UInt32 hopCount( IOFireWireNub * nub ) + { return fAuxiliary->hopCount( nub ); } + + inline UInt32 hopCount( void ) + { return fAuxiliary->hopCount(); } + + inline TerminationState getTerminationState( void ) + { return fAuxiliary->getTerminationState(); } + +protected: + inline void setTerminationState( TerminationState state ) + { fAuxiliary->setTerminationState( state ); } + + virtual IOFireWireNubAux * createAuxiliary( void ); + +public: + + inline bool isPhysicalAccessEnabled( void ) + { return fAuxiliary->isPhysicalAccessEnabled(); } + + inline IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ) + { return fAuxiliary->createSimpleContiguousPhysicalAddressSpace( size, direction ); } + + inline IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ) + { return fAuxiliary->createSimplePhysicalAddressSpace( size, direction ); } + +private: + OSMetaClassDeclareReservedUsed(IOFireWireNub, 0); + OSMetaClassDeclareReservedUsed(IOFireWireNub, 1); + OSMetaClassDeclareReservedUnused(IOFireWireNub, 2); + OSMetaClassDeclareReservedUnused(IOFireWireNub, 3); + +}; + +#endif /* ! _IOKIT_IOFIREWIRENUB_H */ diff --git a/QualcommWireless/include/IOKit/firewire/IOFireWirePowerManager.h b/QualcommWireless/include/IOKit/firewire/IOFireWirePowerManager.h new file mode 100644 index 0000000..e0a141a --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFireWirePowerManager.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREPOWERMANAGER_H +#define _IOKIT_IOFIREWIREPOWERMANAGER_H + +#include + +#include +#include + +class IOFireWireController; + +/*! @class IOFireWirePowerManager +*/ + +class IOFireWirePowerManager : public OSObject +{ + OSDeclareAbstractStructors(IOFireWirePowerManager); + +protected: + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + IOFireWireController * fControl; + + UInt32 fMaximumDeciwatts; + UInt32 fAllocatedDeciwatts; + +public: + static IOFireWirePowerManager * createWithController( IOFireWireController * controller ); + + virtual bool initWithController( IOFireWireController * controller ); + + virtual void setMaximumDeciwatts( UInt32 deciwatts ); + virtual IOReturn allocateDeciwatts( UInt32 deciwatts ); + virtual void deallocateDeciwatts( UInt32 deciwatts ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 0); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 1); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 2); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 3); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 4); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 5); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 6); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 7); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 8); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 9); +}; + +#endif \ No newline at end of file diff --git a/QualcommWireless/include/IOKit/firewire/IOFireWireUnit.h b/QualcommWireless/include/IOKit/firewire/IOFireWireUnit.h new file mode 100644 index 0000000..6509b94 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOFireWireUnit.h @@ -0,0 +1,167 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFireWireUnit.h + * + * + */ +#ifndef _IOKIT_IOFIREWIREUNIT_H +#define _IOKIT_IOFIREWIREUNIT_H + +// public +#include + +class IOFireWireDevice; +class IOFireWireUnit; + +#pragma mark - + +/*! + @class IOFireWireUnitAux +*/ + +class IOFireWireUnitAux : public IOFireWireNubAux +{ + OSDeclareDefaultStructors(IOFireWireUnitAux) + + friend class IOFireWireUnit; + +protected: + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFireWireUnit * primary ); + virtual void free(); + + virtual bool isPhysicalAccessEnabled( void ); + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ); + + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireUnitAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireUnitAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireUnitAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireUnitAux, 3); + +}; + +#pragma mark - + +/*! @class IOFireWireUnit +*/ +class IOFireWireUnit : public IOFireWireNub +{ + OSDeclareDefaultStructors(IOFireWireUnit) + + friend class IOFireWireUnitAux; + friend class IOFireWireDevice; + +protected: + IOFireWireDevice *fDevice; // The device unit is part of + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +/*------------------Methods provided to FireWire device clients-----------------------*/ +public: + + virtual bool init(OSDictionary *propTable, IOConfigDirectory *directory); + + /* + * Standard nub initialization + */ + virtual bool attach(IOService * provider ); + virtual void free(); + + /* + * Matching language support + * Match on the following properties of the unit: + * Vendor_ID + * GUID + * Unit_Spec_ID + * Unit_SW_Version + */ + virtual bool matchPropertyTable(OSDictionary * table); + + + virtual IOReturn message( UInt32 type, IOService * provider, void * argument ); + + // Override handleOpen() and handleClose() to pass on to device + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + virtual void setNodeFlags( UInt32 flags ); + virtual void clearNodeFlags( UInt32 flags ); + virtual UInt32 getNodeFlags( void ); + + virtual IOReturn setConfigDirectory( IOConfigDirectory *directory ); + + /* + * Create local FireWire address spaces for the device to access + */ + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem); + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon); + +protected: + + virtual IOFireWireNubAux * createAuxiliary( void ); + +public: + void setMaxSpeed( IOFWSpeed speed ); + +protected: + void terminateUnit( void ); + static void terminateUnitThreadFunc( void * refcon ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireUnit, 0); + OSMetaClassDeclareReservedUnused(IOFireWireUnit, 1); + +}; + +#endif /* ! _IOKIT_IOFIREWIREDEVICE_H */ diff --git a/QualcommWireless/include/IOKit/firewire/IOLocalConfigDirectory.h b/QualcommWireless/include/IOKit/firewire/IOLocalConfigDirectory.h new file mode 100644 index 0000000..953d5f9 --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IOLocalConfigDirectory.h @@ -0,0 +1,110 @@ +/* +* Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. +* +* @APPLE_LICENSE_HEADER_START@ +* +* The contents of this file constitute Original Code as defined in and +* are subject to the Apple Public Source License Version 1.1 (the +* "License"). You may not use this file except in compliance with the +* License. Please obtain a copy of the License at +* http://www.apple.com/publicsource and read it before using this file. +* +* This Original Code and all software distributed under the License are +* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the +* License for the specific language governing rights and limitations +* under the License. +* +* @APPLE_LICENSE_HEADER_END@ +*/ + +#ifndef __IOLOCALCONFIGDIRECTORY_H__ +#define __IOLOCALCONFIGDIRECTORY_H__ + +#include +#include +#include +#include + +class OSArray; +class OSData; +class IOFireWireController; +class IOFWUserObjectExporter ; + +/*! @class IOLocalConfigDirectory +*/ +class IOLocalConfigDirectory : public IOConfigDirectory +{ + friend class IOFireWireController; + friend class IOFireWireUserClient ; + + OSDeclareDefaultStructors(IOLocalConfigDirectory); + +protected: + OSArray *fEntries; // Entries for this directory. + OSData *fROM; // Local ROM, if compiled. + UInt32 fHeader; // Num entries and CRC. + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool init(void) APPLE_KEXT_OVERRIDE; + virtual void free(void) APPLE_KEXT_OVERRIDE; + + virtual const UInt32 *getBase(void) APPLE_KEXT_OVERRIDE; + virtual IOConfigDirectory *getSubDir(int start, int type) APPLE_KEXT_OVERRIDE; + +public: + static IOLocalConfigDirectory *create(); + + /*! + @function update + makes sure that the ROM has at least the specified capacity, + and that the ROM is uptodate from its start to at least the + specified quadlet offset. + @result kIOReturnSuccess if the specified offset is now + accessable at romBase[offset]. + */ + virtual IOReturn update(UInt32 offset, const UInt32 *&romBase) APPLE_KEXT_OVERRIDE; + + virtual IOReturn compile(OSData *rom); + + // All flavours of addEntry eat a retain of the desc string + virtual IOReturn addEntry(int key, UInt32 value, OSString *desc = NULL); + virtual IOReturn addEntry(int key, IOLocalConfigDirectory *value, + OSString *desc = NULL); + virtual IOReturn addEntry(int key, OSData *value, OSString *desc = NULL); + virtual IOReturn addEntry(int key, FWAddress value, OSString *desc = NULL); + virtual IOReturn removeSubDir(IOLocalConfigDirectory *value); + const OSArray *getEntries() const; + + virtual IOReturn getIndexValue(int index, IOConfigDirectory *&value) APPLE_KEXT_OVERRIDE; + +protected: + + virtual const UInt32 * lockData( void ) APPLE_KEXT_OVERRIDE; + virtual void unlockData( void ) APPLE_KEXT_OVERRIDE; + virtual IOReturn updateROMCache( UInt32 offset, UInt32 length ) APPLE_KEXT_OVERRIDE; + virtual IOReturn checkROMState( void ) APPLE_KEXT_OVERRIDE; + + // call eats a retain count + virtual IOReturn addEntry(OSString *desc); + + IOReturn incrementGeneration( void ); + static void exporterCleanup( const OSObject * self, IOFWUserObjectExporter * exporter ) ; + +private: + OSMetaClassDeclareReservedUsed(IOLocalConfigDirectory, 0); + OSMetaClassDeclareReservedUnused(IOLocalConfigDirectory, 1); + OSMetaClassDeclareReservedUnused(IOLocalConfigDirectory, 2); +}; + +#endif /* __IOLOCALCONFIGDIRECTORY_H__ */ diff --git a/QualcommWireless/include/IOKit/firewire/IORemoteConfigDirectory.h b/QualcommWireless/include/IOKit/firewire/IORemoteConfigDirectory.h new file mode 100644 index 0000000..f5438ae --- /dev/null +++ b/QualcommWireless/include/IOKit/firewire/IORemoteConfigDirectory.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOREMOTECONFIGDIRECTORY_H__ +#define __IOREMOTECONFIGDIRECTORY_H__ + +#include +#include + +#include +#include + +#include "IOFireWireROMCache.h" + +class OSString; +class OSIterator; +class IOFireWireDevice; + +/*! @class IORemoteConfigDirectory +*/ +class IORemoteConfigDirectory : public IOConfigDirectory +{ + OSDeclareDefaultStructors(IORemoteConfigDirectory); + +protected: + IOFireWireROMCache *fROM; // Our cache of the ROM + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool initWithOwnerOffset(IOFireWireROMCache *rom, + int start, int type); + virtual void free(void) APPLE_KEXT_OVERRIDE; + + virtual const UInt32 *getBase(void) APPLE_KEXT_OVERRIDE; + virtual IOConfigDirectory *getSubDir(int start, int type) APPLE_KEXT_OVERRIDE; + +public: + static IOConfigDirectory *withOwnerOffset(IOFireWireROMCache *rom, + int start, int type); + + + /*! + @function update + makes sure that the ROM has at least the specified capacity, + and that the ROM is uptodate from its start to at least the + specified quadlet offset. + @result kIOReturnSuccess if the specified offset is now + accessable at romBase[offset]. + */ + virtual IOReturn update(UInt32 offset, const UInt32 *&romBase) APPLE_KEXT_OVERRIDE; + +protected: + + virtual const UInt32 * lockData( void ) APPLE_KEXT_OVERRIDE; + virtual void unlockData( void ) APPLE_KEXT_OVERRIDE; + virtual IOReturn updateROMCache( UInt32 offset, UInt32 length ) APPLE_KEXT_OVERRIDE; + virtual IOReturn checkROMState( void ) APPLE_KEXT_OVERRIDE; + +private: + OSMetaClassDeclareReservedUnused(IORemoteConfigDirectory, 0); + OSMetaClassDeclareReservedUnused(IORemoteConfigDirectory, 1); + OSMetaClassDeclareReservedUnused(IORemoteConfigDirectory, 2); +}; + + +#endif /* __IOREMOTECONFIGDIRECTORY_H__ */ diff --git a/QualcommWireless/include/IOKit/graphics/GTrace.hpp b/QualcommWireless/include/IOKit/graphics/GTrace.hpp new file mode 100644 index 0000000..5645918 --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/GTrace.hpp @@ -0,0 +1,392 @@ +// +// GTrace.hpp +// +// Created by bparke on 3/17/17. +// + +#ifndef GTrace_hpp +#define GTrace_hpp + +#include + +#include +#include +#include + +#include "IOKit/graphics/GTraceTypes.hpp" + +// Kernel clients that haven't enabled C++11 yet +#if !GTRACE_ARCHAIC_CPP +#include +#endif + +// TODO: Provide example of GTRACE() macro use. + +// ---------------------------------------------------------------------------- +// Main tracing Macros +// ---------------------------------------------------------------------------- + +// Use this to encode t0, for automatic decoding and start/end pairing +// Function has been moved and renamed, define old macro in terms of new +#define GTFuncTag(i, t, tag) GPACKFUNCTAG(i, t, tag) + +#define GTRACERAW(tracer, t0, a0, t1, a1, t2, a2, t3, a3) do{ \ + if (static_cast(tracer)){ \ + (tracer)->recordToken(__LINE__, \ + MAKEGTRACETAG(t0), MAKEGTRACEARG(a0), \ + MAKEGTRACETAG(t1), MAKEGTRACEARG(a1), \ + MAKEGTRACETAG(t2), MAKEGTRACEARG(a2), \ + MAKEGTRACETAG(t3), MAKEGTRACEARG(a3)); \ + } \ +}while(0) + +// Convenience macro, used when all args are ordinary hex data fields. +#define GTRACERAWNT(tracer, a0, a1, a2, a3) \ + GTRACERAW(tracer, 0, a0, 0, a1, 0, a2, 0, a3) + +#define GTRACE(tracer, fid, ft, t0, a0, t1, a1, t2, a2, t3, a3) \ + GTRACERAW(tracer, GTFuncTag(fid, ft, t0), a0, t1, a1, t2, a2, t3, a3) + +// Convenience macro, used when all as are ordinary hex data fields. +#define GTRACE_NT(tracer, fid, ft, a0, a1, a2, a3) \ + GTRACERAW(tracer, GTFuncTag(fid, ft, 0), a0, 0, a1, 0, a2, 0, a3) + +// GTrace for calls that are slow. The GTRACE_IFSLOW_START records the current +// time, then GTRACE_IFSLOW_END will record an entry if the duration between +// start and end is > the threshold. Note `delayat` is in absolute time units. +#define GTRACE_IFSLOW_START(tracer, fid) do { \ + const uint64_t _gtrace_ ## fid ## _start_ \ + = ((static_cast(tracer)) ? mach_continuous_time() : 0) + +// Matches the do{ from GTRACE_IFSLOW_START, must be in same scope +#define GTRACE_IFSLOW_END(tracer, fid, ft, t0, a0, t1, a1, t2, a2, delayat) \ + if(static_cast(tracer)) { \ + const uint64_t _gtrace_ifslow_now_ = mach_continuous_time(); \ + const uint64_t _gtrace_delta_ \ + = _gtrace_ifslow_now_ - _gtrace_ ## fid ## _start_; \ + if(_gtrace_delta_ > (delayat)) \ + (tracer)->recordToken(__LINE__, GTFuncTag(fid, ft, 0), \ + _gtrace_delta_, t0, a0, t1, a1, t2, a2, \ + _gtrace_ifslow_now_); \ + } \ +}while(0) + +// Create a pair of GTrace records but only record them if the time duration +// was > than the absolute time threshold given in GTRACE_DEFER_END +#define GTRACE_DEFER_START(tracer, t0, a0, t1, a1, t2, a2, t3, a3) \ +do{ \ + const GTraceEntry _gtrace_start_ = (static_cast(tracer)) \ + ? (tracer)->formatToken(__LINE__, t0, a0, t1, a1, t2, a2, t3, a3) \ + : GTraceEntry() + +// Matches the do{ from GTRACE_DEFER_START, must be in same block scope +#define GTRACE_DEFER_END(tracer, t0, a0, t1, a1, t2, a2, t3, a3, delayat) \ + if (static_cast(tracer)) { \ + const uint64_t _gtrace_defer_now_ = mach_continuous_time(); \ + const uint64_t _gtrace_delta_ \ + = _gtrace_defer_now_ - _gtrace_start_.timestamp(); \ + if(_gtrace_delta_ > (delayat)) { \ + (tracer)->recordToken(_gtrace_start_); \ + (tracer)->recordToken(__LINE__, t0, a0, t1, a1, \ + t2, a2, t3, a3, _gtrace_defer_now_); \ + } \ + } \ +}while(0) + +#if GTRACE_IMPL +// Macro used by IOGraphicsFamily internally, not required for third party use. +#define GTRACE_LOG_SYNCH(tracer, t0) do { \ + if (static_cast(tracer)) { \ + const uint32_t __gtrace_log_sync_ind__ = tracer->synchIndex(); \ + tracer->recordToken(__LINE__, \ + MAKEGTRACETAG(t0),static_cast(__gtrace_log_sync_ind__), \ + 0, 0, 0, 0, 0, 0); \ + IOLog("GTrace synchronization point %x\n", __gtrace_log_sync_ind__); \ + } \ +}while(0) +#endif + +class IOMemoryDescriptor; +class IOMemoryMap; +class GTraceBuffer final : public OSObject +{ + OSDeclareFinalStructors(GTraceBuffer); + + using super = OSObject; + +public: + + // sizeP is an in/out variable, size will be <= 16KiB + // The Breadcrumb function callout is a clean context that does not hold a + // lock. + using breadcrumb_func + = IOReturn (*)(void* context, void* buffer, uint16_t* sizeP); + +#if !GTRACE_ARCHAIC_CPP + using shared_type = iog::OSSharedObject; + + /*! + @function make + @abstract Make a shared object of a new GTrace buffer. + @discussion Creates an optimised lockfree algorithm for storing 64byte + records into a ring buffer. This buffer can be dumped by + `iogdiagnose` and then decoded using + /AppleInternal/AppleGraphicsControl/IOGDiagnoseDecode. + + In addition to the ring buffer the client can also provide a + function that will copy up to 16KiB of additional data used by + the client's decode module. It is much better if this func is + LOCKFREE. If the function does not return within 1 second we + may abort the thread reading the data and discard the buffer. + Thus it is a data-looser to stall the fetch thread for too + long. + + The breadcrumb_func is not called with GTraceBuffer locks + held. + @param bufferName: Max 32 byte C string copied into fetch header. + @param decoderName: Max 32 byte C string copied into fetch header, used by + IOGDiagnoseDecode to find a decode module in + /AppleInternal/AppleGraphicsControl/IOGDiagnose_modules directory. + @param lineCount: Number of lines to store in ring buffer. Line count will + be rounded up to a power of two and is bounded by + kGTraceMinimumLineCount and kGTraceMaximumLineCount. + @param bcf: breadcrumb_func. May be null. Function to call when the buffer + is being fetched, to be used by your decode module. See discussion. + @param context: Context to pass to the bcf function. + @result OSSharedObject with the new created buffer. An empty + buffer on failure. + */ + static shared_type make( + const char* decoderName, const char* bufferName, + const uint32_t lineCount, breadcrumb_func bcf, void* context); + + /*! @function destroy + @abstract Destroy a buffer shared object created with make. + @discussion When a client is done with the gtrace buffer use + destroy(iog::move()) to destroy your shared object and + stop further calls to the breadcrumb func. This will destroy your + reference to the buffer. Before completing destruction the breadcrumb + function if any will be called only once and then never called again + after on return. The breadcrumb function is never called with any + internal buffer locks held. The GTraceBuffer guarantees that no + further calls to the breadcrumb function will occur once this call + completes. + + Note it is not necessary to destroy every copy of the shared_type + (OSSharedObject), rather only call destroy when you no + longer wish any further breadcrumb callouts during teardown of your + master objects, essentially it is symetric with make() calls. + @param bso An rvalue reference to the buffer shared object. + */ + static void destroy(shared_type&& bso); +#endif // !GTRACE_ARCHAIC_CPP + +#if GTRACE_ARCHAIC_CPP || GTRACE_IMPL + /*! @function makeArchaicCpp + @abstract Equivalent to make for archaic pre-C++11 projects. See make + for more details. + */ + static GTraceBuffer* makeArchaicCpp( + const char* decoderName, const char* bufferName, + const uint32_t lineCount, breadcrumb_func bcf, void* context) + __attribute__((deprecated ("Use C++11 and GTraceBuffer::make."))); + + /*! @function destroyArchaicCpp + @abstract Equivalent to destroy for archaic pre-C++11 projects. See + destroy for more details. + @discussion Similar to destroy, destroyArchaicCpp releases one reference + on the buffer. Clients must use destroyArchaicCpp once + (mirroring the call to makeArchaicCpp). + */ + static void destroyArchaicCpp(GTraceBuffer *buffer) + __attribute__((deprecated ("Use C++11 and GTraceBuffer::destroy."))); +#endif + + /*! @function formatToken + @abstract Format a token suitable for recording. + @discussion GTrace supports tokenized tracing. formatToken is used to + create a tokenized KTrace style entry suitable for inserting into the + ring buffer. Carefully written for C++ return value optimisation. + @param line The line number associated with the token + @param tag1 An implementation specific tag associated with arg1 + @param tag2 An implementation specific tag associated with arg2 + @param tag3 An implementation specific tag associated with arg3 + @param tag4 An implementation specific tag associated with arg4 + @param arg1 Component/implementation specific value. + @param arg2 Component/implementation specific value. + @param arg3 Component/implementation specific value. + @param arg4 Component/implementation specific value. + @param timestamp Supplied timestamp or current MCT + @result GTraceEntry structure filled in with given data. + */ + GTraceEntry formatToken(const uint16_t line, + const uint64_t tag1, const uint64_t arg1, + const uint64_t tag2, const uint64_t arg2, + const uint64_t tag3, const uint64_t arg3, + const uint64_t tag4, const uint64_t arg4, + const uint64_t timestamp = mach_continuous_time()); + + /*! @function recordToken + @abstract Add token data to token stream. + @discussion recordToken() takes a formatted GTraceEntry and writes it to + the ring buffer. + @param entry a const GTraceEntry reference to be atomically added to token + stream. + */ + void recordToken(const GTraceEntry& entry); + + /*! @function recordToken + @abstract Add the token data to the token stream + @discussion GTrace supports tokenized tracing. recordToken is used to + insert a tokenized KTrace style trace into the trace buffer. + @param line The line number associated with the token + @param tag1 An implementation specific tag associated with arg1 + @param tag2 An implementation specific tag associated with arg2 + @param tag3 An implementation specific tag associated with arg3 + @param tag4 An implementation specific tag associated with arg4 + @param arg1 Component/implementation specific value. + @param arg2 Component/implementation specific value. + @param arg3 Component/implementation specific value. + @param arg4 Component/implementation specific value. + @param timestamp Supplied timestamp or current MCT + */ + void recordToken(const uint16_t line, + const uint64_t tag1, const uint64_t arg1, + const uint64_t tag2, const uint64_t arg2, + const uint64_t tag3, const uint64_t arg3, + const uint64_t tag4, const uint64_t arg4, + const uint64_t timestamp = mach_continuous_time()) + { + recordToken(formatToken( + line, tag1, arg1, tag2, arg2, tag3, arg3, tag4, arg4, timestamp)); + } + +#if GTRACE_IMPL + /*! @function synchIndex + @abstract Publishes the current gtrace token index. + @discussion Used by Decode to synchronize between os_log and GTrace. I + have chosen to share the atomic next index operation though + it may cause decode ambiguity. It is very light weight. + */ + inline uint32_t synchIndex() const { return nextLine(); } + + /*! @function fetch + @abstract + Copies token buffer into provided memory descriptor. + @discussion + Copies the tokens data from the internal buffers into the provided + IOMemoryDescriptor, which must be prepared. Data is copied up to the + buffer size or the internal buffer size (which ever is less). Once the + data is copied a post processing step that obfuscates pointers is run. + @param bso OSSharedObject (i.e. shared_type) of GTraceBuffer + @param outDesc pointer to a prepared memory descriptor. + @result kIOReturnSuccess if the copy was successful, else an error. + */ + static IOReturn fetch(shared_type bso, IOMemoryDescriptor* outDesc); + +#ifndef _OPEN_SOURCE_ + /*! + @function makeUser + @abstract Record a user land gtrace buffer. + @discussion The block of memory provided by the client process will be + copied out in sysdiagnose by the iogdiagnose CLI tool. User buffers do + NOT support breadcrumb functions. However, a client process can + designate a block of the buffer as breadcrumb space, but note no + inter-locking will be provided between recording data into it and + fetch. Destroy buffers in the usual way. + @param bufMD: Block of memory provided by client process. + @param errP: Pointer to a IOReturn return code, only written on failure. + @result OSSharedObject with the new created buffer. An empty + buffer on failure. + */ + static shared_type makeUser(IOMemoryDescriptor *bufMD, IOReturn* errP); + +protected: + IOReturn copyOutUser(iog::OSUniqueObject map) const; +public: +#endif // !_OPEN_SOURCE_ + + + /* Getters for constant header information */ + size_t decoderName(char *name, const int len) const; // truncates + size_t bufferName(char *name, const int len) const; // truncates + uint32_t lineMask() const { return fLineMask; } + uint32_t lineCount() const { return fLineCount; } + uint32_t bufferID() const { return fHeader.fBufferID; } + +protected: + // OSObject overrides + bool init() APPLE_KEXT_OVERRIDE; + void free() APPLE_KEXT_OVERRIDE; + + // Internal functions + // See make() for details on arguments + IOReturn init( + const GTraceHeader& header, IOMemoryDescriptor* userBufferMD, + breadcrumb_func bcf, const void* context); + static shared_type makeFromHeader( + const GTraceHeader& header, IOMemoryDescriptor* userBufferMD, + breadcrumb_func bcf, void* context, IOReturn* errP); + static GTraceHeader buildHeader( + const char* decoderName, const char* bufferName, + const uint32_t count); + + inline uint32_t getNextLine(void) + { return atomic_fetch_add(&fNextLine, 1) & fLineMask; } + + // Complicated const casting because atomic_load will not take a const + // pointer, problem mixing C and C++, but C++ doesn't exist + // in the kernel yet and probably never will as it is deep STL. + inline uint32_t nextLine() const + { return atomic_load(&(const_cast(this)->fNextLine)); } + + IOReturn copyOut( + iog::OSUniqueObject map, OSData* bcData) const; + + // APIs for IODisplayWranglerUserClients.cpp, also used by unit tests + friend class IOGDiagnosticGTraceClient; + + /*! @function fetch + @abstract + Copies the token buffer into the provided memory descriptor. + IOGDiagnosticUserClient interface + @discussion + Copies the tokens data from the internal buffers into the provided + IOMemoryDescriptor, which must be prepared. Data is copied up to the + buffer size or the internal buffer size (which ever is less). Once the + data is copied a post processing step that obfuscates pointers is run. + + Releases buffer if the globally cached OSSharedObject is unique, + that is it has only one outstanding reference AND the complete buffer + was sucessfully copied into outDesc. + @param index Index of buffer in buffer pool cache + @param outDesc pointer to a prepared memory descriptor. + @result kIOReturnSuccess if the copy was successful, else an error. + */ + static IOReturn fetch(const uint32_t index, IOMemoryDescriptor* outDesc); + +private: + // Header that is copied out on demand + GTraceHeader fHeader; + atomic_uint_fast32_t fNextLine; + GTraceEntry* fBuffer; + +#ifndef _OPEN_SOURCE_ + IOMemoryDescriptor* fUserBufferMD; +#endif // !_OPEN_SOURCE_ + + breadcrumb_func fBreadcrumbFunc; + const void* fBCFContext; // Context to be passed to fBreadcrumbFunc + OSData* fBCData; + uint32_t fBCActiveCount; + + uint32_t fLineMask; + uint32_t fLineCount; + bool fWrapped; + + // Workaround for pre-C++11 clients, which can't see OSSharedObject. + shared_type fArchaicCPPSharedObjectHack; +#endif // GTRACE_IMPL +}; + +#endif /* GTrace_h */ diff --git a/QualcommWireless/include/IOKit/graphics/IOAccelClientConnect.h b/QualcommWireless/include/IOKit/graphics/IOAccelClientConnect.h new file mode 100644 index 0000000..1092d73 --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/IOAccelClientConnect.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOACCEL_CLIENT_CONNECT_H +#define _IOACCEL_CLIENT_CONNECT_H + + +/* +** The IOAccelerator service name +*/ +#define kIOAcceleratorClassName "IOAccelerator" + + +/* +** IOAccelerator public client types. Private client types start with +** kIOAccelNumClientTypes. +*/ +enum eIOAcceleratorClientTypes { + kIOAccelSurfaceClientType, + kIOAccelNumClientTypes, +#ifndef _OPEN_SOURCE_ + kIOAccelSurface2ClientType = 0x20 +#endif /* _OPEN_SOURCE_ */ +}; + + +#endif /* _IOACCEL_CLIENT_CONNECT_H */ + diff --git a/QualcommWireless/include/IOKit/graphics/IOAccelSurfaceConnect.h b/QualcommWireless/include/IOKit/graphics/IOAccelSurfaceConnect.h new file mode 100644 index 0000000..19dfe1b --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/IOAccelSurfaceConnect.h @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOACCEL_SURFACE_CONNECT_H +#define _IOACCEL_SURFACE_CONNECT_H + +#include +#include + +/* +** Surface visible region in device coordinates. +** +** num_rects: The number of rectangles in the rect array. If num_rects +** is zero the bounds rectangle is used for the visible rectangle. +** If num_rects is zero the surface must be completely contained +** by the device. +** +** bounds: The unclipped surface rectangle in device coords. Extends +** beyond the device bounds if the surface is not totally on +** the device. +** +** rect[]: An array of visible rectangles in device coords. If num_rects +** is non-zero only the region described by these rectangles is +** copied to the frame buffer during a flush operation. +*/ +typedef struct +{ + UInt32 num_rects; + IOAccelBounds bounds; + IOAccelBounds rect[0]; +} IOAccelDeviceRegion; + + +/* +** Determine the size of a region. +*/ +#define IOACCEL_SIZEOF_DEVICE_REGION(_rgn_) (sizeof(IOAccelDeviceRegion) + (_rgn_)->num_rects * sizeof(IOAccelBounds)) + + +/* +** Surface client public memory types. Private memory types start with +** kIOAccelNumSurfaceMemoryTypes. +*/ +enum eIOAccelSurfaceMemoryTypes { + kIOAccelNumSurfaceMemoryTypes +}; + + +/* +** Surface client public methods. Private methods start with +** kIOAccelNumSurfaceMethods. +*/ +enum eIOAccelSurfaceMethods { + kIOAccelSurfaceReadLockOptions, + kIOAccelSurfaceReadUnlockOptions, + kIOAccelSurfaceGetState, + kIOAccelSurfaceWriteLockOptions, + kIOAccelSurfaceWriteUnlockOptions, + kIOAccelSurfaceRead, + kIOAccelSurfaceSetShapeBacking, + + kIOAccelSurfaceSetIDMode, + kIOAccelSurfaceSetScale, + + kIOAccelSurfaceSetShape, + kIOAccelSurfaceFlush, + + kIOAccelSurfaceQueryLock, + + kIOAccelSurfaceReadLock, + kIOAccelSurfaceReadUnlock, + kIOAccelSurfaceWriteLock, + kIOAccelSurfaceWriteUnlock, + + kIOAccelSurfaceControl, + kIOAccelSurfaceSetShapeBackingAndLength, + + kIOAccelNumSurfaceMethods +}; + + +/* +** Option bits for IOAccelCreateSurface and the kIOAccelSurfaceSetIDMode method. +** The color depth field can take any value of the _CGSDepth enumeration. +*/ +typedef enum { + kIOAccelSurfaceModeColorDepth1555 = 0x00000003, + kIOAccelSurfaceModeColorDepth8888 = 0x00000004, +// kIOAccelSurfaceModeColorDepthRGB565 = 0x00000005, + kIOAccelSurfaceModeColorDepthYUV = 0x00000006, + kIOAccelSurfaceModeColorDepthYUV9 = 0x00000007, + kIOAccelSurfaceModeColorDepthYUV12 = 0x00000008, + kIOAccelSurfaceModeColorDepthYUV2 = 0x00000009, + kIOAccelSurfaceModeColorDepthBGRA32 = 0x0000000A, + +// kIOAccelSurfaceModeColorDepthRGBA64 = 0x0000000B, +// kIOAccelSurfaceModeColorDepthRGBAFloat64 = 0x0000000C, +// kIOAccelSurfaceModeColorDepthRGBAFloat128 = 0x0000000D, + +// kIOAccelSurfaceModeColorDepthYUV420 = 0x0000000E, + kIOAccelSurfaceModeColorDepth2101010 = 0x0000000F, + + kIOAccelSurfaceModeColorDepthBits = 0x0000000F, + + kIOAccelSurfaceModeStereoBit = 0x00000010, + kIOAccelSurfaceModeWindowedBit = 0x00000020, + +#ifndef _OPEN_SOURCE_ + kIOAccelSurfaceModeSurface2 = 0x00004000, +#endif /* _OPEN_SOURCE_ */ + kIOAccelSurfaceModeBeamSync = 0x00008000 +} eIOAccelSurfaceModeBits; + + +/* +** Options bits for IOAccelSetSurfaceShape and the kIOAccelSurfaceSetShape method. +*/ +typedef enum { + kIOAccelSurfaceShapeNone = 0x00000000, + kIOAccelSurfaceShapeNonBlockingBit = 0x00000001, + kIOAccelSurfaceShapeNonSimpleBit = 0x00000002, + kIOAccelSurfaceShapeIdentityScaleBit = 0x00000004, + kIOAccelSurfaceShapeFrameSyncBit = 0x00000008, + kIOAccelSurfaceShapeBeamSyncBit = 0x00000010, + kIOAccelSurfaceShapeStaleBackingBit = 0x00000020, + kIOAccelSurfaceShapeAssemblyBit = 0x00000040, + kIOAccelSurfaceShapeWaitEnabledBit = 0x00000080, + + /* wrong name, use kIOAccelSurfaceShapeNonBlockingBit */ + kIOAccelSurfaceShapeBlockingBit = kIOAccelSurfaceShapeNonBlockingBit +} eIOAccelSurfaceShapeBits; + +/* +** Return bits for the kIOAccelSurfaceGetState method. +*/ +typedef enum { + kIOAccelSurfaceStateNone = 0x00000000, + kIOAccelSurfaceStateIdleBit = 0x00000001 +} eIOAccelSurfaceStateBits; + +/* +** Option bits for the kIOAccelSurfaceSetScale method. +*/ +typedef enum { + kIOAccelSurfaceBeamSyncSwaps = 0x00000001, + kIOAccelSurfaceFixedSource = 0x00000002, + + kIOAccelSurfaceFiltering = 0x000000f0, + kIOAccelSurfaceFilterDefault = 0x00000000, + kIOAccelSurfaceFilterNone = 0x00000010, + kIOAccelSurfaceFilterLinear = 0x00000020 + +} eIOAccelSurfaceScaleBits; + +/* +** Option bits for the kIOAccelSurfaceLock methods. +*/ +typedef enum { + kIOAccelSurfaceLockInBacking = 0, + kIOAccelSurfaceLockInAccel = 1, + kIOAccelSurfaceLockInDontCare = 2, + kIOAccelSurfaceLockInMask = 0x00000003 +} eIOAccelSurfaceLockBits; + +#endif /* _IOACCEL_SURFACE_CONNECT_H */ + diff --git a/QualcommWireless/include/IOKit/graphics/IOAccelTypes.h b/QualcommWireless/include/IOKit/graphics/IOAccelTypes.h new file mode 100644 index 0000000..b28ae84 --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/IOAccelTypes.h @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOACCEL_TYPES_H +#define _IOACCEL_TYPES_H + +#include +#include + +#define IOACCEL_TYPES_REV 12 + +#if !defined(OSTYPES_K64_REV) && !defined(MAC_OS_X_VERSION_10_6) +#define IOACCELTYPES_10_5 1 +#endif + +/* Integer rectangle in device coordinates */ +typedef struct +{ + SInt16 x; + SInt16 y; + SInt16 w; + SInt16 h; +} IOAccelBounds; + +typedef struct +{ + SInt16 w; + SInt16 h; +} IOAccelSize; + +/* Surface information */ + +enum { + kIOAccelVolatileSurface = 0x00000001 +}; + +typedef struct +{ +#if IOACCELTYPES_10_5 + vm_address_t address[4]; +#else + mach_vm_address_t address[4]; +#endif /* IOACCELTYPES_10_5 */ + UInt32 rowBytes; + UInt32 width; + UInt32 height; + UInt32 pixelFormat; + IOOptionBits flags; + IOFixed colorTemperature[4]; + UInt32 typeDependent[4]; +} IOAccelSurfaceInformation; + +typedef struct +{ +#if IOACCELTYPES_10_5 + long x, y, w, h; + void *client_addr; + unsigned long client_row_bytes; +#else + SInt32 x, y, w, h; + mach_vm_address_t client_addr; + UInt32 client_row_bytes; +#endif /* IOACCELTYPES_10_5 */ +} IOAccelSurfaceReadData; + +typedef struct { + IOAccelBounds buffer; + IOAccelSize source; + UInt32 reserved[8]; +} IOAccelSurfaceScaling; + + +typedef SInt32 IOAccelID; + +enum { + kIOAccelPrivateID = 0x00000001 +}; + + +#endif /* _IOACCEL_TYPES_H */ + diff --git a/QualcommWireless/include/IOKit/graphics/IOAccelerator.h b/QualcommWireless/include/IOKit/graphics/IOAccelerator.h new file mode 100644 index 0000000..618d38d --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/IOAccelerator.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IO_ACCELERATOR_H +#define _IO_ACCELERATOR_H + +#include + +#include + +class IOAccelerator : public IOService +{ + OSDeclareDefaultStructors(IOAccelerator) + +public: + static IOReturn createAccelID(IOOptionBits options, IOAccelID * identifier); + static IOReturn retainAccelID(IOOptionBits options, IOAccelID identifier); + static IOReturn releaseAccelID(IOOptionBits options, IOAccelID identifier); + +}; + + +#endif /* _IO_ACCELERATOR_H */ + diff --git a/QualcommWireless/include/IOKit/graphics/IODisplay.h b/QualcommWireless/include/IOKit/graphics/IODisplay.h new file mode 100644 index 0000000..3ba8e15 --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/IODisplay.h @@ -0,0 +1,323 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODISPLAY_H +#define _IOKIT_IODISPLAY_H + +#include +#include + +#include + +#include + +extern const OSSymbol * gIODisplayParametersKey; +extern const OSSymbol * gIODisplayGUIDKey; + +extern const OSSymbol * gIODisplayValueKey; +extern const OSSymbol * gIODisplayMinValueKey; +extern const OSSymbol * gIODisplayMaxValueKey; + +extern const OSSymbol * gIODisplayBrightnessProbeKey; +extern const OSSymbol * gIODisplayLinearBrightnessProbeKey; +extern const OSSymbol * gIODisplayContrastKey; +extern const OSSymbol * gIODisplayBrightnessKey; +extern const OSSymbol * gIODisplayLinearBrightnessKey; +extern const OSSymbol * gIODisplayUsableLinearBrightnessKey; +extern const OSSymbol * gIODisplayBrightnessFadeKey; +extern const OSSymbol * gIODisplayHorizontalPositionKey; +extern const OSSymbol * gIODisplayHorizontalSizeKey; +extern const OSSymbol * gIODisplayVerticalPositionKey; +extern const OSSymbol * gIODisplayVerticalSizeKey; +extern const OSSymbol * gIODisplayTrapezoidKey; +extern const OSSymbol * gIODisplayPincushionKey; +extern const OSSymbol * gIODisplayParallelogramKey; +extern const OSSymbol * gIODisplayRotationKey; +extern const OSSymbol * gIODisplayOverscanKey; +extern const OSSymbol * gIODisplayVideoBestKey; +extern const OSSymbol * gIODisplaySelectedColorModeKey; + +extern const OSSymbol * gIODisplayRedGammaScaleKey; +extern const OSSymbol * gIODisplayGreenGammaScaleKey; +extern const OSSymbol * gIODisplayBlueGammaScaleKey; +extern const OSSymbol * gIODisplayGammaScaleKey; + +extern const OSSymbol * gIODisplayParametersTheatreModeKey; +extern const OSSymbol * gIODisplayParametersTheatreModeWindowKey; + +extern const OSSymbol * gIODisplayMCCSVersionKey; +extern const OSSymbol * gIODisplayTechnologyTypeKey; +extern const OSSymbol * gIODisplayUsageTimeKey; +extern const OSSymbol * gIODisplayFirmwareLevelKey; + +extern const OSSymbol * gIODisplaySpeakerVolumeKey; +extern const OSSymbol * gIODisplaySpeakerSelectKey; +extern const OSSymbol * gIODisplayMicrophoneVolumeKey; +extern const OSSymbol * gIODisplayAmbientLightSensorKey; +extern const OSSymbol * gIODisplayAudioMuteAndScreenBlankKey; +extern const OSSymbol * gIODisplayAudioTrebleKey; +extern const OSSymbol * gIODisplayAudioBassKey; +extern const OSSymbol * gIODisplayAudioBalanceLRKey; +extern const OSSymbol * gIODisplayAudioProcessorModeKey; +extern const OSSymbol * gIODisplayPowerModeKey; +extern const OSSymbol * gIODisplayManufacturerSpecificKey; + +extern const OSSymbol * gIODisplayPowerStateKey; +extern const OSSymbol * gIODisplayControllerIDKey; +extern const OSSymbol * gIODisplayCapabilityStringKey; + +extern const OSSymbol * gIODisplayParametersCommitKey; +extern const OSSymbol * gIODisplayParametersDefaultKey; +extern const OSSymbol * gIODisplayParametersFlushKey; + +extern const OSSymbol * gIODisplayFadeTime1Key; +extern const OSSymbol * gIODisplayFadeTime2Key; +extern const OSSymbol * gIODisplayFadeTime3Key; +extern const OSSymbol * gIODisplayFadeStyleKey; + +extern UInt32 gIODisplayFadeTime1; +extern UInt32 gIODisplayFadeTime2; +extern UInt32 gIODisplayFadeTime3; +extern UInt32 gIODisplayFadeStyle; + +enum { + kIODisplayNumPowerStates = 4, + kIODisplayMaxPowerState = kIODisplayNumPowerStates - 1 +}; + +class IODisplayWrangler; +class IODisplayConnect : public IOService +{ + OSDeclareDefaultStructors(IODisplayConnect) + friend class IODisplayWrangler; + +private: + IOIndex fConnectIndex; + uint64_t fFBRegID; + +protected: +/* Reserved for future use. (Internal use only) */ + struct ExpansionData { }; + +/* Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + + // Support for IODisplayWrangler + virtual bool initWithConnection(const uint64_t fbRegID, + const IOIndex connection); + +public: + // IODisplayConnect interface + virtual IOFramebuffer * getFramebuffer( void ); + virtual IOIndex getConnection( void ); + virtual IOReturn getAttributeForConnection( IOSelect selector, uintptr_t * value ); + virtual IOReturn setAttributeForConnection( IOSelect selector, uintptr_t value ); + virtual void joinPMtree ( IOService * driver ) APPLE_KEXT_OVERRIDE; + +#ifndef _OPEN_SOURCE_ + // Support for IODisplay + static void recordGTraceToken( + const uint16_t line, + const uint16_t tag0, const uint64_t fbRegID, + const uint16_t tag1, const uint64_t arg1, + const uint16_t tag2, const uint64_t arg2, + const uint16_t tag3, const uint64_t arg3); + void recordGTraceToken(const uint16_t line, + const uint16_t fnID, const uint8_t fnType, + const uint16_t tag1, const uint64_t arg1, + const uint16_t tag2, const uint64_t arg2, + const uint16_t tag3, const uint64_t arg3); + inline uint64_t getFBRegistryID() { return fFBRegID; } +#endif // !_OPEN_SOURCE_ +}; + +class IODisplay : public IOService +{ + OSDeclareAbstractStructors(IODisplay) + +public: + static void initialize( void ); + +protected: + // used to query the framebuffer controller + IODisplayConnect * fConnection; + class IODisplayParameterHandler * fParameterHandler; + void * __resv; + IONotifier * fNotifier; + + // pointer to protected instance variables for power management + struct IODisplayPMVars * fDisplayPMVars; + +public: + uintptr_t fWSAADeferState; +protected: + // reserved for future expansion + void * _IODisplay_reserved[31]; + +public: + virtual IOService * probe( IOService * provider, + SInt32 * score ) APPLE_KEXT_OVERRIDE; + + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual IODisplayConnect * getConnection( void ); + + virtual IOReturn getConnectFlagsForDisplayMode( + IODisplayModeID mode, UInt32 * flags ); + + virtual IOReturn getGammaTableByIndex( + UInt32 * channelCount, UInt32 * dataCount, + UInt32 * dataWidth, void ** data ); + + virtual IOReturn readFramebufferEDID( void ); + + virtual IOReturn framebufferEvent( IOFramebuffer * framebuffer, + IOIndex event, void * info ); + // parameter setting + virtual bool setProperty(const OSSymbol* aKey, OSObject* anObject) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const OSString* aKey, OSObject* anObject) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char* aKey, OSObject* anObject) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char* aKey, const char* aString) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char* aKey, bool aBoolean) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char* aKey, unsigned long long aValue, + unsigned int aNumberOfBits) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char* aKey, void *bytes, unsigned int length) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE; + virtual bool setForKey( OSDictionary * params, const OSSymbol * key, + SInt32 value, SInt32 min, SInt32 max ); + + static bool addParameter( OSDictionary * params, const OSSymbol * paramName, SInt32 min, SInt32 max ); + static bool setParameter( OSDictionary * params, const OSSymbol * paramName, SInt32 value ); + static OSDictionary * getIntegerRange( OSDictionary * params, const OSSymbol * sym, + SInt32 * value, SInt32 * min, SInt32 * max ); + + // low level set/get + virtual bool doIntegerSet( OSDictionary * params, + const OSSymbol * paramName, UInt32 value ); + virtual bool doDataSet( const OSSymbol * paramName, OSData * value ); + virtual bool doUpdate( void ); + + // power management methods + virtual IOReturn setPowerState( unsigned long, IOService * ) APPLE_KEXT_OVERRIDE; + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags ) APPLE_KEXT_OVERRIDE; + virtual unsigned long initialPowerStateForDomainState( IOPMPowerFlags ) APPLE_KEXT_OVERRIDE; + virtual unsigned long powerStateForDomainState( IOPMPowerFlags ) APPLE_KEXT_OVERRIDE; + + // + virtual void initPowerManagement( IOService * provider); + virtual void dropOneLevel( void ); + virtual void makeDisplayUsable( void ); + void setDisplayPowerState(unsigned long state); + +#ifndef _OPEN_SOURCE_ +// GTrace V2 support for IOBacklightDisplay tracing +#define HAS_IBDGTRACETOKEN 1 + void recordGTraceToken(const uint16_t line, + const uint16_t fnID, const uint8_t fnType, + const uint16_t tag1, const uint64_t arg1, + const uint16_t tag2, const uint64_t arg2, + const uint16_t tag3, const uint64_t arg3); +#endif // !_OPEN_SOURCE_ + +private: + OSMetaClassDeclareReservedUnused(IODisplay, 0); + OSMetaClassDeclareReservedUnused(IODisplay, 1); + OSMetaClassDeclareReservedUnused(IODisplay, 2); + OSMetaClassDeclareReservedUnused(IODisplay, 3); + OSMetaClassDeclareReservedUnused(IODisplay, 4); + OSMetaClassDeclareReservedUnused(IODisplay, 5); + OSMetaClassDeclareReservedUnused(IODisplay, 6); + OSMetaClassDeclareReservedUnused(IODisplay, 7); + OSMetaClassDeclareReservedUnused(IODisplay, 8); + OSMetaClassDeclareReservedUnused(IODisplay, 9); + OSMetaClassDeclareReservedUnused(IODisplay, 10); + OSMetaClassDeclareReservedUnused(IODisplay, 11); + OSMetaClassDeclareReservedUnused(IODisplay, 12); + OSMetaClassDeclareReservedUnused(IODisplay, 13); + OSMetaClassDeclareReservedUnused(IODisplay, 14); + OSMetaClassDeclareReservedUnused(IODisplay, 15); + OSMetaClassDeclareReservedUnused(IODisplay, 16); + OSMetaClassDeclareReservedUnused(IODisplay, 17); + OSMetaClassDeclareReservedUnused(IODisplay, 18); + OSMetaClassDeclareReservedUnused(IODisplay, 19); + +private: + static IOReturn _framebufferEvent( OSObject * osobj, void * ref, + IOFramebuffer *framebuffer, IOIndex event, void * info ); + + void searchParameterHandlers(IORegistryEntry * entry); + bool addParameterHandler( IODisplayParameterHandler * parameterHandler ); + bool removeParameterHandler( IODisplayParameterHandler * parameterHandler ); + static bool updateNumber( OSDictionary * params, const OSSymbol * key, SInt32 value ); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +class IOBacklightDisplay : public IODisplay +{ + OSDeclareDefaultStructors(IOBacklightDisplay) + + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 0); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 1); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 2); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 3); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 4); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 5); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 6); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 7); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 8); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 9); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +class IODisplayParameterHandler : public IOService +{ + OSDeclareDefaultStructors(IODisplayParameterHandler) + +public: + virtual bool setDisplay( IODisplay * display ) = 0; + virtual bool doIntegerSet( OSDictionary * params, + const OSSymbol * paramName, UInt32 value ) = 0; + virtual bool doDataSet( const OSSymbol * paramName, OSData * value ) = 0; + virtual bool doUpdate( void ) = 0; + +private: + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 0); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 1); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 2); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 3); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 4); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 5); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 6); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 7); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 8); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 9); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#endif /* ! _IOKIT_IODISPLAY_H */ + diff --git a/QualcommWireless/include/IOKit/graphics/IOFramebuffer.h b/QualcommWireless/include/IOKit/graphics/IOFramebuffer.h new file mode 100644 index 0000000..a12dc63 --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/IOFramebuffer.h @@ -0,0 +1,1024 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFRAMEBUFFER_H +#define _IOKIT_IOFRAMEBUFFER_H + +#include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Woverloaded-virtual" +#include +#pragma clang diagnostic pop +#include + +#include +#include + +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +#define IOFRAMEBUFFER_REV 7 + + +class IOFramebuffer; +class IOBufferMemoryDescriptor; +struct IOFBController; + + +typedef void (*CursorBlitProc)( + IOFramebuffer * inst, + void * shmem, + volatile unsigned char *vramPtr, + unsigned int cursStart, + unsigned int vramRow, + unsigned int cursRow, + int width, + int height ); + +typedef void (*CursorRemoveProc)( + IOFramebuffer * inst, + void * shmem, + volatile unsigned char *vramPtr, + unsigned int vramRow, + int width, + int height ); + + +typedef void * IOFBCursorRef; + +struct IOFBCursorControlCallouts { + IOReturn (*setCursorImage) (void * target, void * ref, + IOHardwareCursorDescriptor * description, IOFBCursorRef cursorImage); + IOReturn (*setCursorState) (void * target, void * ref, + SInt32 x, SInt32 y, bool visible); + UInt32 reserved[30]; +}; +typedef struct IOFBCursorControlCallouts IOFBCursorControlCallouts; + +struct IOFBCursorControlAttribute { + void * inst; + void * ref; + const IOFBCursorControlCallouts * callouts; + UInt32 reserved[29]; +}; +typedef struct IOFBCursorControlAttribute IOFBCursorControlAttribute; + +// clock & data values +enum { + kIODDCLow = 0, + kIODDCHigh = 1, + kIODDCTristate = 2 +}; +// ddcBlockType constants +enum { + // EDID block type. + kIODDCBlockTypeEDID = 0 +}; + +// ddcFlags constants +enum { + // Force a new read of the EDID. + kIODDCForceRead = 0x00000001 +}; + +enum { + kDisabledInterruptState = 0, + kEnabledInterruptState = 1 +}; + +typedef void (*IOFBInterruptProc)( OSObject * target, void * ref ); + + +typedef IOReturn (*IOFramebufferNotificationHandler) + (OSObject * obj, void * ref, + IOFramebuffer * framebuffer, IOIndex event, + void * info); + +// IOFramebufferNotificationHandler events +enum { + kIOFBNotifyDisplayModeWillChange = 1, + kIOFBNotifyDisplayModeDidChange = 2, + + kIOFBNotifyWillSleep = 3, + kIOFBNotifyDidWake = 4, + + kIOFBNotifyDidPowerOff = 5, + kIOFBNotifyWillPowerOn = 6, + + kIOFBNotifyDidSleep = kIOFBNotifyDidPowerOff, + kIOFBNotifyWillWake = kIOFBNotifyWillPowerOn, + + kIOFBNotifyWillPowerOff = 7, + kIOFBNotifyDidPowerOn = 8, + + kIOFBNotifyWillChangeSpeed = 9, + kIOFBNotifyDidChangeSpeed = 10, + + kIOFBNotifyHDACodecWillPowerOn = 11, // since IOGRAPHICSTYPES_REV 68 + kIOFBNotifyHDACodecDidPowerOn = 12, // since IOGRAPHICSTYPES_REV 68 + + kIOFBNotifyHDACodecWillPowerOff = 13, // since IOGRAPHICSTYPES_REV 68 + kIOFBNotifyHDACodecDidPowerOff = 14, // since IOGRAPHICSTYPES_REV 68 + + kIOFBNotifyClamshellChange = 20, + + kIOFBNotifyCaptureChange = 30, + + kIOFBNotifyOnlineChange = 40, + + kIOFBNotifyDisplayDimsChange = 50, + + kIOFBNotifyProbed = 60, + + kIOFBNotifyVRAMReady = 70, + + kIOFBNotifyWillNotify = 80, + kIOFBNotifyDidNotify = 81, + + // IOGraphics needs to send WSAAWillExitDefer and WSAADidExitDefer instead of single message + kIOFBNotifyWSAAWillEnterDefer = 90, // since IOGRAPHICSTYPES_REV 53 + kIOFBNotifyWSAAWillExitDefer = 91, // since IOGRAPHICSTYPES_REV 53 + + kIOFBNotifyWSAADidEnterDefer = 92, // since IOGRAPHICSTYPES_REV 53 + kIOFBNotifyWSAADidExitDefer = 93, // since IOGRAPHICSTYPES_REV 53 + + kIOFBNotifyWSAAEnterDefer = kIOFBNotifyWSAAWillEnterDefer, + kIOFBNotifyWSAAExitDefer = kIOFBNotifyWSAAWillExitDefer, + + kIOFBNotifyTerminated = 100, // since IOGRAPHICSTYPES_REV 49 +}; + +/* + Discussion: addFramebufferNotificationWithOptions + + Clients that want to take advantage of the fine grain IOFramebuffer event notifications must register their framebuffer notification handler with addFramebufferNotificationWithOptions and provide a single kIOFBNotifyGroup ID, one or more kIOFBNotifyEvents and optionally a desired kIOFBNotifyPriority value. If no priority is required, clients must set groupPriority to 0. Clients must not register with any predefined kIOFBNotifyGroup that they do not belong to. kIOFBNotifyGroup values within the range of 0x8000 to 0xFFFF are available for general and third party software use. Where multiple independent software components end up using the same kIOFBNotifyGroup identification numbers, the callout order is determined first by priority and then by registration order. Clients that request a priority that is outside of the range specified by kIOFBNotifyPriority_Min/kIOFBNotifyPriority_Max will be clamped to the range limits. + + Handler invocation by IOGraphics: + + Clients are only called for the kIOFBNotifyEvents that they requested at time of registration. + Multiple clients with the same kIOFBNotifyGroup are called in the order based on the requested priority. + Multiple clients with the same kIOFBNotifyGroup and the same priority are called in a "first registered, first served" order. + IOGraphics will invoke the handlers based on group, then priority, the registration order. The ordering of the group callouts is private and will change as required/desired by Apple. Clients must NOT rely on group callout order to determine system or intercomponent behavior. If there is a strong need to be called before a specific component, please file a radar with the Component of "IOGraphics" and the Version of "all". + + Discussion: addFramebufferNotification + Legacy and existing software that relies upon addFramebufferNotification() will behave as if they had called with the following options: addFramebufferNotificationWithOptions(..., kIOFBNotifyGroupID_Legacy, 0, kIOFBNotifyEvent_All); + Legacy clients are called after kIOFBNotifyGroup IDs within the range of 0x0 to 0x7FFF have been called, but before IDs in the range of 0x8000 to 0xFFFF. + */ + +// addFramebufferNotificationWithOptions event types +enum { + kIOFBNotifyEvent_None = (0ULL << 0), + kIOFBNotifyEvent_DisplayModeChange = (1ULL << 0), + kIOFBNotifyEvent_SleepWake = (1ULL << 1), // Only for events: kIOFBNotifyWillSleep & kIOFBNotifyDidWake + kIOFBNotifyEvent_PowerOnOff = (1ULL << 2), + kIOFBNotifyEvent_ChangeSpeed = (1ULL << 3), + kIOFBNotifyEvent_ClamshellChange = (1ULL << 4), + kIOFBNotifyEvent_CaptureChange = (1ULL << 5), + kIOFBNotifyEvent_OnlineChange = (1ULL << 6), + kIOFBNotifyEvent_DisplayDimsChange = (1ULL << 7), + kIOFBNotifyEvent_Probed = (1ULL << 8), + kIOFBNotifyEvent_VRAMReady = (1ULL << 9), + kIOFBNotifyEvent_Notify = (1ULL << 10), // kIOFBNotifyWillNotify & kIOFBNotifyDidNotify + kIOFBNotifyEvent_WSAADefer = (1ULL << 11), + kIOFBNotifyEvent_Terminated = (1ULL << 12), + kIOFBNotifyEvent_HDACodecPowerOnOff = (1ULL << 13), // since IOFRAMEBUFFER_REV 7 + + kIOFBNotifyEvent_Last = (1ULL << 14), + kIOFBNotifyEvent_All = (kIOFBNotifyEvent_Last - 1) +}; + +enum { + // 0x0 - 0xFF - Private: Reserved for IOGraphics. + kIOFBNotifyGroupID_Legacy = 0x001, + kIOFBNotifyGroupID_IODisplay = 0x010, + + // 0x100 - 0x1FF - Reserved for Apple kernel extensions + kIOFBNotifyGroupID_AppleGraphicsDevicePolicy = 0x100, + kIOFBNotifyGroupID_AppleGraphicsMGPUPowerControl = 0x110, + kIOFBNotifyGroupID_AppleGraphicsMUXControl = 0x120, + kIOFBNotifyGroupID_AppleGraphicsControl = 0x130, + kIOFBNotifyGroupID_AppleGraphicsDisplayPolicy = 0x140, + kIOFBNotifyGroupID_AppleGraphicsPowerManagement = 0x150, + kIOFBNotifyGroupID_AppleHDAController = 0x160, + kIOFBNotifyGroupID_AppleIOAccelDisplayPipe = 0x170, + kIOFBNotifyGroupID_AppleMCCSControl = 0x180, + + // 0x200 - 0x2FF - Reserved for vendor kernel extensions + kIOFBNotifyGroupID_VendorIntel = 0x200, + + // 0x300 - 0x3FF - Reserved for vendor kernel extensions + kIOFBNotifyGroupID_VendorNVIDIA = 0x300, + + // 0x400 - 0x4FF - Reserved for vendor kernel extensions + kIOFBNotifyGroupID_VendorAMD = 0x400, + + // 0x500 - 0x7FFF - Reserved for future use + + // 0x8000+ - Reserved for third party software + kIOFBNotifyGroupID_ThirdParty = 0x8000, + + kIOFBNotifyGroupID_Count = 15 +}; + +// addFramebufferNotificationWithOptions group priority range +enum { + kIOFBNotifyPriority_Min = -32768, + kIOFBNotifyPriority_Max = 32767, +}; + +struct IOFramebufferNotificationNotify +{ + IOIndex event; + void * info; +}; + +enum { + kFBDisplayUsablePowerState = 0x80000000, + kFBDisplayPowerStateMask = 0x0000ffff +}; + +#define kIOFBDependentIDKey "IOFBDependentID" +#define kIOFBDependentIndexKey "IOFBDependentIndex" + +#ifndef _OPEN_SOURCE_ +// GTrace V2 support for AGDC markers +#define HAS_AGDCGTRACETOKEN 1 +extern void agdcGTraceToken( + const IOFramebuffer* fb, const uint16_t line, const bool useController, + const uint16_t fnID, const uint8_t fnType, + const uint16_t tag1, const uint64_t arg1, + const uint16_t tag2, const uint64_t arg2, + const uint16_t tag3, const uint64_t arg3); +#endif // !_OPEN_SOURCE_ + +struct StdFBShmem_t; +class IOFramebufferUserClient; +class IODisplay; + +/*! @class IOFramebuffer : public IOGraphicsDevice + @abstract The base class for graphics devices to be made available as part of the desktop. + @discussion The IOFramebuffer base class defines APIs used to publish a linear framebuffer device. Device driver writers should subclass this class to provide a X native driver. Mac OS X will also utilize 'ndrv' drivers via a subclass of IOFramebuffer IONDRVFramebuffer that does not require device driver writers to provide a X native driver. + + There are no in kernel clients of IOFramebuffer aside from rudimentary console and panic UI supported by the IOFramebuffer class. The IOFramebuffer class provides the IOUserClient implementation to allow the CoreGraphics server to provide the user accessible interface to all displays on a Mac OS X system, and this is further layered underneath application frameworks. Device driver writers should not need any knowledge of this part of the interfaces. Similarly the instance variables of IOFramebuffer are mostly used for cursor rendering which is handled by the IOFramebuffer class, and should be avoided by subclass implementors. Only IOFramebuffer methods with header documentation in this header are designed for subclasses to implement. + + IOFramebuffer provides simple dumb framebuffer operation - accceleration for 2D, 3D and video may be provided by a separate implementation of the IOAccelerator class. +*/ + +class IOFramebuffer : public IOGraphicsDevice +{ + friend class IOFramebufferUserClient; + friend class IOFramebufferSharedUserClient; + friend class IOFramebufferDiagnosticUserClient; + friend class IOFramebufferParameterHandler; + friend class IODisplay; +#ifndef _OPEN_SOURCE_ + friend void agdcGTraceToken( + const IOFramebuffer*, const uint16_t, const bool, const uint16_t, + const uint8_t, const uint16_t, const uint64_t, const uint16_t, + const uint64_t, const uint16_t, const uint64_t); +#endif // !_OPEN_SOURCE_ + + OSDeclareDefaultStructors(IOFramebuffer); + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +private: + +protected: + StdFBShmem_t * priv; + int shmemClientVersion; + IOBufferMemoryDescriptor * sharedCursor; + + union { + struct { + /* Mapping tables used in cursor drawing to 5-5-5 displays. */ + unsigned char * _bm34To35SampleTable; + unsigned char * _bm35To34SampleTable; + /* Mapping tables used in cursor drawing to 8-bit RGB displays. */ + unsigned int * _bm256To38SampleTable; + unsigned char * _bm38To256SampleTable; + } t; + UInt8 * tables[ 4 ]; + } colorConvert; + + /* cursor blitting vars */ + CursorBlitProc cursorBlitProc; + CursorRemoveProc cursorRemoveProc; + + IOGSize maxCursorSize; + void * _IOFramebuffer_reservedE[6]; + uint32_t _IOFramebuffer_reservedF; + uint32_t thisNameLen; + const char * thisName; + volatile unsigned char * cursorSave; + unsigned int white; + + IOGPoint nextCursorLoc; + int nextCursorFrame; + SInt32 connectChange; + semaphore_t vblSemaphore; + + /* memory ranges */ + volatile unsigned char * fFrameBuffer; + unsigned int fTotalWidth; + unsigned int rowBytes; + unsigned int bytesPerPixel; + + IOMemoryMap * fVramMap; + IOByteCount fVramMapOffset; + OSArray * userAccessRanges; + unsigned int suspended:1; + unsigned int captured:1; + unsigned int sleepConnectCheck:1; + unsigned int messaged:1; + unsigned int cursorEnable:1; + unsigned int _IOFramebuffer_reservedC:27; + IOFramebuffer * nextDependent; + OSArray * fFBNotifications; + + class IOFramebufferUserClient * fServerConnect; + class IOFramebufferSharedUserClient * fSharedConnect; + + unsigned int opened:1; + unsigned int dead:1; + unsigned int configPending:1; + unsigned int doNotUseServerNotified:1; // Deprecated + unsigned int doNotUseServerState:1; // Deprecated + unsigned int doNotUseServerPendingAck:1;// Deprecated + unsigned int isUsable:1; + unsigned int mirrored:1; + unsigned int pendingPowerState:4; + unsigned int pendingPowerChange:1; + unsigned int pagingState:1; + unsigned int mirrorPrimary:1; + unsigned int mirrorSWCursor:1; + + bool clutValid; + bool currentMono; + bool needCursorService; + bool haveVBLService; + bool haveHWCursor; + bool hwCursorLoaded; + + void * serverMsg; + IOInterruptEventSource * deferredEvents; + + /* Reserved for future expansion. */ + int _IOFramebuffer_reserved[5]; + +private: + struct IOFramebufferPrivate * __private; + +public: +/*! @function doI2CRequest + @abstract Carry out an I2C request. + @discussion IOFramebuffer subclasses may optionally implement this method to perform I2C bus requests on one of the buses they support. Alternatively they may implement the setDDCClock(), setDDCData(), readDDCClock(), readDDCData() methods and respond from getAttributeForConnection() to the kConnectionSupportsLLDDCSense attribute with success, in which case IOFramebuffer::doI2CRequest() will carry out a software implementation of I2C using the low level routines and conforming to the timing constraints passed in the timing parameter. Subclasses may pass timing parameters tuned for the specific bus, otherwise VESA DDC defaults will apply. + @timing event Subclasses may pass timing parameters tuned for the specific bus, otherwise if NULL, VESA DDC defaults will apply. + @param request An IOI2CRequest structure. The request should be carried out synchronously if the completion routine is NULL, otherwise it may optionally be carried out asynchronously. The completion routine should be called if supplied. + @result an IOReturn code. If kIOReturnSuccess, the result of the transaction is returned in the requests result field. +*/ + virtual IOReturn doI2CRequest( UInt32 bus, struct IOI2CBusTiming * timing, struct IOI2CRequest * request ); + OSMetaClassDeclareReservedUsed(IOFramebuffer, 0); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13 + + /*! @function diagnoseReport + @abstract Provide private diagnostic information. + @discussion Allow vendor implementations to provide diagnostic information when a catastrophic failure has been encounterd. + */ + virtual IOReturn diagnoseReport( void * param1, void * param2, void * param3, void * param4 ); + OSMetaClassDeclareReservedUsed(IOFramebuffer, 1); + +/*! @function setGammaTable + @abstract Set the gamma table to be used by the framebuffer. + @discussion IOFramebuffer subclasses should implement this method to allow a gamma table to be set. + @param channelCount Defines the number of channels in the supplied data. OS X will pass three for separate R, G, B data, or one if the same data should apply to all channels. + @param dataCount The number of data entries per channel. + @param dataWidth The number of bits in each entry. 8 for Mac OS X 10.1 and earlier, 16 for later releases. + @param data The packed array of correction data. Data is passed for the R (or single) channel followed by the G & B channels. Each entry is one or two bytes (if dataWidth > 8). + @param syncToVBL 0 don't sync to VBL, else sync. + @result an IOReturn code. + */ + virtual IOReturn setGammaTable( UInt32 channelCount, UInt32 dataCount, + UInt32 dataWidth, void * data, bool syncToVBL ); + OSMetaClassDeclareReservedUsed(IOFramebuffer, 2); +#else + OSMetaClassDeclareReservedUnused(IOFramebuffer, 1); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 2); +#endif + +private: + + OSMetaClassDeclareReservedUnused(IOFramebuffer, 3); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 4); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 5); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 6); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 7); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 8); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 9); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 10); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 11); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 12); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 13); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 14); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 15); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 16); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 17); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 18); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 19); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 20); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 21); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 22); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 23); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 24); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 25); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 26); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 27); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 28); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 29); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 30); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 31); + + +public: + // IOKit overrides + static void initialize(); + + virtual bool attach( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool requestTerminate( IOService * provider, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual bool terminate( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual bool willTerminate( IOService * provider, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + virtual IOWorkLoop * getWorkLoop() const APPLE_KEXT_OVERRIDE; +#ifndef _OPEN_SOURCE_ + virtual IOReturn setProperties(OSObject* properties) APPLE_KEXT_OVERRIDE; +#endif + + IOWorkLoop * getGraphicsSystemWorkLoop() const; + IOWorkLoop * getControllerWorkLoop() const; + + virtual IOReturn requestProbe( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn powerStateWillChangeTo ( IOPMPowerFlags, unsigned long, IOService* ) APPLE_KEXT_OVERRIDE; + virtual IOReturn powerStateDidChangeTo ( IOPMPowerFlags, unsigned long, IOService* ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setPowerState( unsigned long powerStateOrdinal, IOService * device) APPLE_KEXT_OVERRIDE; + virtual IOReturn setAggressiveness( unsigned long type, unsigned long newLevel ) APPLE_KEXT_OVERRIDE; + virtual IOReturn getAggressiveness( unsigned long type, unsigned long * currentLevel ) APPLE_KEXT_OVERRIDE; + virtual IOReturn newUserClient( task_t owningTask, + void * security_id, + UInt32 type, + IOUserClient ** clientH ) APPLE_KEXT_OVERRIDE; + virtual IOReturn callPlatformFunction( const OSSymbol * functionName, + bool waitForFunction, + void *p1, void *p2, + void *p3, void *p4 ) APPLE_KEXT_OVERRIDE; + virtual IOReturn message(UInt32 type, IOService *provider, void *argument = 0) APPLE_KEXT_OVERRIDE; + + virtual void hideCursor( void ) APPLE_KEXT_OVERRIDE; + virtual void showCursor( IOGPoint * cursorLoc, int frame ) APPLE_KEXT_OVERRIDE; + virtual void moveCursor( IOGPoint * cursorLoc, int frame ) APPLE_KEXT_OVERRIDE; + // virtual + void resetCursor( void ); + + virtual void getVBLTime( AbsoluteTime * time, AbsoluteTime * delta ) APPLE_KEXT_OVERRIDE; + + virtual void getBoundingRect ( IOGBounds ** bounds ) APPLE_KEXT_OVERRIDE; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Woverloaded-virtual" + virtual IOReturn open( void ); + + virtual void close( void ); +#pragma clang diagnostic pop + + virtual bool isConsoleDevice( void ); + + virtual IOReturn setupForCurrentConfig( void ); + + virtual bool serializeInfo( OSSerialize * s ); + virtual bool setNumber( OSDictionary * dict, const char * key, + UInt32 number ); + + IONotifier * addFramebufferNotification( + IOFramebufferNotificationHandler handler, + OSObject * obj, void * ref); + +/*! @function getApertureRange + @abstract Return reference to IODeviceMemory object representing memory range of framebuffer. + @discussion IOFramebuffer subclasses must implement this method to describe the memory used by the framebuffer in the current mode. The OS will map this memory range into user space for client access - the range should only include vram memory not hardware registers. + @param aperture The system will only access the aperture kIOFBSystemAperture. + @result an IODeviceMemory instance. A reference will be consumed by the caller for each call of this method - the implementatation should create a new instance of IODeviceMemory for each call, or return one instance with a retain for each call. +*/ + + virtual IODeviceMemory * getApertureRange( IOPixelAperture aperture ) = 0; + +/*! @function getVRAMRange + @abstract Return reference to IODeviceMemory object representing memory range of all the cards vram. + @discussion IOFramebuffer subclasses should implement this method to describe all the vram memory available on the card. The OS will map this memory range into user space for client access - the range should only include vram memory not hardware registers. + @result an IODeviceMemory instance. A reference will be consumed by the caller for each call of this method - the implementatation should create a new instance of IODeviceMemory for each call, or return one instance with a retain for each call. +*/ + + virtual IODeviceMemory * getVRAMRange( void ); + +protected: + +/*! @function handleEvent + @abstract Notify IOFramebuffer superclass code of events. + @discussion IOFramebuffer subclasses should call this IOFramebuffer method on certain power state changes. + @param event The event that has occurred:
+ kIOFBNotifyWillPowerOff call before entering a state other than the maximum.
+ kIOFBNotifyDidPowerOn call after entering the maximum power state.
+ kIOFBNotifyWillPowerOff call before entering a state other than the maximum.
+ kIOFBNotifyDidPowerOn call after entering a state other than the maximum.
+ @param info None of the above events require additional info, pass zero. + @result an IOReturn code, safely ignored. +*/ + + IOReturn handleEvent( IOIndex event, void * info = 0 ); + + + IOReturn deliverFramebufferNotification( + IOIndex event, void * info = 0 ); + +#ifdef IOFRAMEBUFFER_PRIVATE +#include +#endif + +public: +/*! @function enableController + @abstract Perform first time setup of the framebuffer. + @discussion IOFramebuffer subclasses should perform their initialization of the hardware here. The IOService start() method is not called at a time appropriate for this initialization. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn enableController( void ); + +/*! @function getPixelFormats + @abstract List the pixel formats the framebuffer supports. + @discussion IOFramebuffer subclasses must implement this method to return an array of strings representing the possible pixel formats available in the framebuffer. + @result A const char * pointer. The string consists of a concatenation of each pixel format string separated by the NULL character. The commonly supported pixel formats for Mac OS X are defined as IO8BitIndexedPixels, IO16BitDirectPixels, IO32BitDirectPixels. +*/ + + virtual const char * getPixelFormats( void ) = 0; + +/*! @function getDisplayModeCount + @abstract Return the number of display modes the framebuffer supports. + @discussion IOFramebuffer subclasses must implement this method to return a count of the display modes available. This count should change unless a connection change is posted for the device indicated the framebuffer and/or display configuration has changed. + @result A count of the display modes available. +*/ + + virtual IOItemCount getDisplayModeCount( void ) = 0; + +/*! @function getDisplayModes + @abstract Return the number of display modes the framebuffer supports. + @discussion IOFramebuffer subclasses must implement this method to return an array of display mode IDs available for the framebuffer. The IDs are defined by the driver in the range 0x00000001 - 0x7fffffff, and should be constant for a given display mode. + @param allDisplayModes A caller allocated buffer with the size given by the result of getDisplayModeCount(). + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getDisplayModes( IODisplayModeID * allDisplayModes ) = 0; + +/*! @function getInformationForDisplayMode + @abstract Return information about a given display mode. + @discussion IOFramebuffer subclasses must implement this method to return information in the IODisplayModeInformation structure for the display mode with the passed ID. + @param displayMode A display mode ID previously returned by getDisplayModes(). + @param info Pointer to a structure of type IODisplayModeInformation to be filled out by the driver. IODisplayModeInformation is documented in IOGraphicsTypes.h. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getInformationForDisplayMode( IODisplayModeID displayMode, + IODisplayModeInformation * info ) = 0; + +/*! @function getPixelFormatsForDisplayMode + @abstract Obsolete. + @discussion IOFramebuffer subclasses must implement this method to return zero. + @param displayMode Ignored. + @param depth Ignored. + @result Return zero. +*/ + + virtual UInt64 getPixelFormatsForDisplayMode( IODisplayModeID displayMode, + IOIndex depth ) = 0; + +/*! @function getPixelInformation + @abstract Return information about the framebuffer format for a given display mode and depth. + @discussion IOFramebuffer subclasses must implement this method to return information in the IOPixelInformation structure for the display mode with the passed ID, depth index and aperture. The aperture utilized by the system is always kIOFBSystemAperture. Drivers may define alternative apertures, being a view of the framebuffer in a different pixel format from the default. + @param displayMode A display mode ID previously returned by getDisplayModes(). + @param depth An index from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure (inclusive). + @param pixelInfo Pointer to a structure of type IOPixelInformation to be filled out by the driver. IOPixelInformation is documented in IOGraphicsTypes.h. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getPixelInformation( + IODisplayModeID displayMode, IOIndex depth, + IOPixelAperture aperture, IOPixelInformation * pixelInfo ) = 0; + +/*! @function getCurrentDisplayMode + @abstract Return the framebuffers current display mode and depth. + @discussion IOFramebuffer subclasses must implement this method to return the current mode and depth. + @param displayMode A display mode ID representing the current mode. + @param depth An index indicating the depth configuration of the framebuffer. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getCurrentDisplayMode( IODisplayModeID * displayMode, + IOIndex * depth ) = 0; + +/*! @function setCurrentDisplayMode + @abstract Set the framebuffers current display mode and depth. + @discussion IOFramebuffer subclasses should implement this method to set the current mode and depth. Other than at enableController() time, this is the only method that should change the framebuffer format and is synchronized with clients and attached accelerators to make sure access to the device is disallowed during the change. + @param displayMode A display mode ID representing the new mode. + @param depth An index indicating the new depth configuration of the framebuffer. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn setDisplayMode( IODisplayModeID displayMode, + IOIndex depth ); + +/*! @function setApertureEnable + @abstract Enable an aperture on the framebuffer (usually unimplemented, no OS usage). + @discussion IOFramebuffer subclasses may implement this method to set enable a non standard aperture. The system does not call this method. + @param aperture A device specific aperture index. + @param enable Device specific mask of options. + @result an IOReturn code. +*/ + + virtual IOReturn setApertureEnable( IOPixelAperture aperture, + IOOptionBits enable ); + +/*! @function setStartupDisplayMode + @abstract Set the framebuffers display mode and depth to be used during boot and at startup. + @discussion IOFramebuffer subclasses should implement this method to set the mode and depth to be used during boot and at startup, to reduce needed mode changes during boot when the display connection type is the same. If possible this mode should also be used by the OpenFirmware driver for the card. + @param displayMode A display mode ID representing the new startup mode. + @param depth An index indicating the new startup depth configuration of the framebuffer. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode. + @result an IOReturn code. +*/ + + virtual IOReturn setStartupDisplayMode( IODisplayModeID displayMode, + IOIndex depth ); + +/*! @function getCurrentDisplayMode + @abstract Return the framebuffers display mode and depth to be used during boot and at startup. + @discussion IOFramebuffer subclasses should implement this method to return the current mode and depth. + @param displayMode A display mode ID representing the mode used during startup. + @param depth An index indicating the depth configuration of the framebuffer used during startup. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode. + @result an IOReturn code. +*/ + + virtual IOReturn getStartupDisplayMode( IODisplayModeID * displayMode, + IOIndex * depth ); + +/*! @function setCLUTWithEntries + @abstract Set the color lookup table to be used by the framebuffer in indexed modes. + @discussion IOFramebuffer subclasses may implement this method to allow a palette to be set for indexed display modes. It will not be called on framebuffers in direct display modes. + @param colors A pointer to an array of numEntries RGB color entries. + @param index The index of the first entry to set. + @param numEntries The number of entries in the table. + @param options Options controlling the operation.
+ kSetCLUTByValue is set if the index field of each entry should be used to set the table sparsely, otherwise consecutive entries from the index parameter should be set.
+ kSetCLUTImmediately is set if the CLUT set should not be synchronized with the vertical blank, otherwise it should.
+ kSetCLUTWithLuminance is set if the CLUT should be set to a gray value equivalent in luminance to the passed color entry.
+ @result an IOReturn code. +*/ + + virtual IOReturn setCLUTWithEntries( IOColorEntry * colors, UInt32 index, + UInt32 numEntries, IOOptionBits options ); + +/*! @function setGammaTable + @abstract Set the gamma table to be used by the framebuffer. + @discussion IOFramebuffer subclasses should implement this method to allow a gamma table to be set. + @param channelCount Defines the number of channels in the supplied data. OS X will pass three for separate R, G, B data, or one if the same data should apply to all channels. + @param dataCount The number of data entries per channel. + @param dataWidth The number of bits in each entry. 8 for Mac OS X 10.1 and earlier, 16 for later releases. + @param data The packed array of correction data. Data is passed for the R (or single) channel followed by the G & B channels. Each entry is one or two bytes (if dataWidth > 8). + @result an IOReturn code. +*/ + + virtual IOReturn setGammaTable( UInt32 channelCount, UInt32 dataCount, + UInt32 dataWidth, void * data ); + +/*! @function setAttribute + @abstract Generic method to set some attribute of the framebuffer device. + @discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be set. + @param attribute Defines the attribute to be set. Some defined attributes are:
+ kIOPowerAttribute The IOFramebuffer class implements most power management (IOService) methods. It calls the subclass to carry out the power management state change with this attribute. When carrying out power state changes, the subclass should call IOFramebuffer::handleEvent for certain changes - set that method for more information. + @param value The new value for the attribute. + @result an IOReturn code. +*/ + + virtual IOReturn setAttribute( IOSelect attribute, uintptr_t value ); + +/*! @function getAttribute + @abstract Generic method to retrieve some attribute of the framebuffer device. + @discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be returned. + @param attribute Defines the attribute to be set. Some defined attributes are:
+ kIOHardwareCursorAttribute If the device supports a hardware cursor and implements the setCursorImage() and setCursorState() calls it should return true for this attribute. + @param value Returns the value for the attribute. + @result an IOReturn code. +*/ + + virtual IOReturn getAttribute( IOSelect attribute, uintptr_t * value ); + +/*! @function getTimingInfoForDisplayMode + @abstract Returns a timing description for a display mode. + @discussion IOFramebuffer subclasses should implement this method to return timing information for a display mode. This allows the OS to enable display modes based on its knowledge of the connected display type. Two types of timing information are defined, by Apple defined constant, or by a detailed description of the timing parameters of the mode. + @param displayMode A display mode ID representing the mode to examine. + @param info The driver returns the information for the display mode in this structure.
+ If the mode has an Apple defined constant, such as timingVESA_1024x768_75hz, it should be returned in the appleTimingID field. Otherwise the field should be set to timingInvalid.
+ If the driver is able to supply detailed timing information, it should return it in the detailedInfo.v2 field of the structure, otherwise the driver should clear the kIODetailedTimingValid flag from the flags field.
+ The IODetailedTimingInformationV2 structure is documented in IOGraphicsTypes.h + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getTimingInfoForDisplayMode( + IODisplayModeID displayMode, IOTimingInformation * info ); + +/*! @function validateDetailedTiming + @abstract Reports whether a detailed timing is able to be programmed with the device. + @discussion IOFramebuffer subclasses may implement programmable mode functionality where the OS is able to install modes described by a detailed timing into the driver. + @param description A pointer to a IODetailedTimingInformationV2 structure. The driver should examine this description and change any fields that it cannot implement to reflect its closest possible implementation. + @param descripSize sizeof(IODetailedTimingInformationV2) + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from installing the programmable mode. +*/ + + virtual IOReturn validateDetailedTiming( + void * description, IOByteCount descripSize ); + +/*! @function setDetailedTimings + @abstract Installs an array of OS programmed detailed timings to be made available by the driver. + @discussion IOFramebuffer subclasses may implement programmable mode functionality where the OS is able to install modes described by a detailed timing into the driver. The driver needs to add these modes to its internal mode list if it provides this functionality. + @param array An OSArray of OSData objects. Each OSData contains one IODetailedTimingInformationV2 structure. All the data described by the array should be copied or retained by this call until the next invocation of this method. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from installing the programmable modes. +*/ + + virtual IOReturn setDetailedTimings( OSArray * array ); + +/*! @function getConnectionCount + @abstract Reports the number of display connections the device supports, driven from one framebuffer. + @discussion IOFramebuffer subclasses may implement functionality where a single framebuffer drives multiple displays. This is not recommended or fully supported and instead multihead cards should implement multiple instances of IOFramebuffer objects to provide full functionality. + @result A count of the number of display connections reported by the framebuffer. Current versions of OS X only support one connection completely. +*/ + + virtual IOItemCount getConnectionCount( void ); + + +/*! @function setAttributeForConnection + @abstract Generic method to set some attribute of the framebuffer device, specific to one display connection. + @discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be set, specific to one display connection. + @param attribute Defines the attribute to be set. Some defined attributes are:
+ kIOCapturedAttribute If the device supports hotplugging displays, it should disable the generation of hot plug interrupts when the attribute kIOCapturedAttribute is set to true. + @param value The new value for the attribute. + @result an IOReturn code. +*/ + + virtual IOReturn setAttributeForConnection( IOIndex connectIndex, + IOSelect attribute, uintptr_t value ); + +/*! @function getAttributeForConnection + @abstract Generic method to retrieve some attribute of the framebuffer device, specific to one display connection. + @discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be returned, specific to one display connection. + @param attribute Defines the attribute to be returned. Some defined attributes are:
+ kConnectionSupportsHLDDCSense If the framebuffer supports the DDC methods hasDDCConnect() and getDDCBlock() it should return success (and no value) for this attribute.
+ kConnectionSupportsLLDDCSense If the framebuffer wishes to make use of IOFramebuffer::doI2CRequest software implementation of I2C it should implement the I2C methods setDDCClock(), setDDCData(), readDDCClock(), readDDCData(), and it should return success (and no value) for this attribute.
+ @param value Returns the value for the attribute. + @result an IOReturn code. +*/ + + virtual IOReturn getAttributeForConnection( IOIndex connectIndex, + IOSelect attribute, uintptr_t * value ); + +/*! @function convertCursorImage + @abstract Utility method of IOFramebuffer to convert cursor image to a hardware cursor format. + @discussion IOFramebuffer subclasses may implement hardware cursor functionality, if so they should pass the cursor image given by the setCursorImage() method, with a description of their hardware cursor format, to this helper function to this routine to convert the image to one suitable for the hardware. + @param cursorImage Opaque cursor parameter from the setCursorImage() call. + @param description Describes the cursor format supported by the driver. + @param cursor Structure describing the drivers allocated buffer to receive the converted image. + @result a bool indicating the conversion was successful. +*/ + + virtual bool convertCursorImage( void * cursorImage, + IOHardwareCursorDescriptor * description, + IOHardwareCursorInfo * cursor ); + +/*! @function setCursorImage + @abstract Set a new image for the hardware cursor. + @discussion IOFramebuffer subclasses may implement hardware cursor functionality, if so they should implement this method to change the hardware cursor image. The image should be passed to the convertCursorImage() method with each type of cursor format the hardware supports until success, if all fail the hardware cursor should be hidden and kIOReturnUnsupported returned. + @param cursorImage Opaque cursor description. This should be passed to the convertCursorImage() method to convert to a format specific to the hardware. + @result An IOReturn code. +*/ + + virtual IOReturn setCursorImage( void * cursorImage ); + +/*! @function setCursorState + @abstract Set a new position and visibility for the hardware cursor. + @discussion IOFramebuffer subclasses may implement hardware cursor functionality, if so they should implement this method to change the position and visibility of the cursor. + @param x Left coordinate of the cursor image. A signed value, will be negative if the cursor's hot spot and position place it partly offscreen. + @param y Top coordinate of the cursor image. A signed value, will be negative if the cursor's hot spot and position place it partly offscreen. + @param visible Visible state of the cursor. + @result An IOReturn code. +*/ + + virtual IOReturn setCursorState( SInt32 x, SInt32 y, bool visible ); + +/*! @function flushCursor + @abstract Perform any needed cache flushing after software cursor rendering. + @discussion IOFramebuffer implements software cursor functionality when a hardware cursor is unavailable. Some hardware may need to flush a cache after the processor has finished lifting and dropping the software cursor. +*/ + + virtual void flushCursor( void ); + +/*! @function getAppleSense + @abstract Return display sense information for legacy Apple sensing. + @discussion Hardware that supports simple display sensing, or the classic 3 pin Apple sensing described in Designing Cards and Drivers, should implement this method to return sense information. + @param connectIndex Index of the display connection, from zero to the value of getConnectionCount(). + @param senseType Return zero to indicate legacy Apple sensing. + @param primary Return the value of the primary Apple sense code. + @param extended Return the value of the secondary Apple sense code. + @param displayType Return an Apple defined constant for the type of display sensed. For example, kVGAConnect, kNTSCConnect, kPALConnect etc. + @result An IOReturn code. +*/ + + virtual IOReturn getAppleSense( IOIndex connectIndex, + UInt32 * senseType, + UInt32 * primary, + UInt32 * extended, + UInt32 * displayType ); + +/*! @function connectFlags + @abstract Return display sense information for legacy Apple sensing. + @discussion Hardware that supports simple display sensing, or the classic 3 pin Apple sensing described in Designing Cards and Drivers, should implement this method to return mode flags relative to the sensed display. If this method is unimplemented, all modes have are given the flags kDisplayModeValidFlag | kDisplayModeSafeFlag. + @param connectIndex Index of the display connection, from zero to the value of getConnectionCount(). + @param displayMode A display mode ID. + @param flags Return the flags value for the given mode with the connected display. Flags are:
+ kDisplayModeValidFlag - mode is considered valid for the connected display by the driver. + kDisplayModeSafeFlag - mode is considered safe (not requiring mode change confirmation) for the connected display by the driver. + kDisplayModeDefaultFlag - mode is considered default for the connected display by the driver. + @result An IOReturn code. +*/ + + virtual IOReturn connectFlags( IOIndex connectIndex, + IODisplayModeID displayMode, IOOptionBits * flags ); + + //// IOLowLevelDDCSense + +/*! @function setDDCClock + @abstract Sets the state of the I2C clock line on a bus. + @discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to set the state of the I2C clock line on the given bus. Otherwise may be unimplemented. + @param bus Index of the bus. + @param value One of kIODDCLow, kIODDCHigh, kIODDCTristate. +*/ + + virtual void setDDCClock( IOIndex bus, UInt32 value ); + +/*! @function setDDCData + @abstract Sets the state of the I2C data line on a bus. + @discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to set the state of the I2C data line on the given bus. Otherwise may be unimplemented. + @param bus Index of the bus. + @param value One of kIODDCLow, kIODDCHigh, kIODDCTristate. +*/ + virtual void setDDCData( IOIndex bus, UInt32 value ); + +/*! @function readDDCClock + @abstract Reads the input state of the I2C clock line on a bus. + @discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to return the input state of the I2C clock line on the given bus. Otherwise may be unimplemented. + @param bus Index of the bus. + @result A boolean reflecting the current state of the clock line on the given bus. +*/ + virtual bool readDDCClock( IOIndex bus ); + +/*! @function readDDCData + @abstract Reads the input state of the I2C data line on a bus. + @discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to return the input state of the I2C data line on the given bus. Otherwise may be unimplemented. + @param bus Index of the bus. + @result A boolean reflecting the current state of the data line on the given bus. +*/ + virtual bool readDDCData( IOIndex bus ); + + virtual IOReturn enableDDCRaster( bool enable ); + +/*! @function hasDDCConnect + @abstract Return display DDC connect state. + @discussion Hardware that supports DDC/EDID display sensing should implement this method to return true if a DDC display is detected. They should also return success for the connection attribute kConnectionSupportsHLDDCSense (from getAttributeForConnection()). + @param connectIndex Index of the display connection, from zero to the value of getConnectionCount(). + @result True if a DDC display is detected. +*/ + + virtual bool hasDDCConnect( IOIndex connectIndex ); + +/*! @function getDDCBlock + @abstract Return display EDID data. + @discussion Hardware that supports DDC/EDID display sensing should implement this method to return EDID data in 128 byte blocks. + @param connectIndex Index of the display connection, from zero to the value of getConnectionCount(). + @param blockNumber Block number, ranging from one to the number of blocks return by the display. + @param blockType kIODDCBlockTypeEDID will be passed. + @param options No options are currently defined. + @param data Caller allocated buffer to receive the blocks data. + @param length In/out parameter - callers allocated buffer size, driver returns actual size. + @result An IOReturn code. +*/ + + virtual IOReturn getDDCBlock( IOIndex connectIndex, UInt32 blockNumber, + IOSelect blockType, IOOptionBits options, + UInt8 * data, IOByteCount * length ); + +/*! @function registerForInterruptType + @abstract Set callbacks for driver to call on interrupt events. + @discussion The IOFramebuffer class will call its subclasses to set callbacks to be called on interrupt events generated by hardware events. Only two are currently in use - vertical blank interrupts and connection changed interrupts. + @param interruptType One of these constants:
+ kIOFBVBLInterruptType Specifying a vertical blanking interrupt. + kIOFBConnectInterruptType Specify the display connection should be resensed. + @param proc C callback to be called by the driver when the specified event occurs. + @param target Target parameter for the callback proc. + @param ref Ref parameter for the callback proc. + @param interruptRef The subclass should return an opaque reference to the installed interrupt handler, for use with unregisterInterrupt() and setInterruptState(). + @result An IOReturn code. +*/ + + virtual IOReturn registerForInterruptType( IOSelect interruptType, + IOFBInterruptProc proc, OSObject * target, void * ref, + void ** interruptRef ); + +/*! @function unregisterInterrupt + @abstract Remove a callback previously installed by registerForInterruptType(). + @discussion Remove a callback previously installed by registerForInterruptType(). + @param interruptRef The interruptRef returned from the registerForInterruptType call that installed the interrupt. + @result An IOReturn code. +*/ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Woverloaded-virtual" + virtual IOReturn unregisterInterrupt( void * interruptRef ); +#pragma clang diagnostic pop + +/*! @function unregisterInterrupt + @abstract Enable or disable a callback previously installed by registerForInterruptType(). + @discussion Enable or disable a callback previously installed by registerForInterruptType(). + @param state True or false to enable the callback. + @result An IOReturn code. +*/ + + virtual IOReturn setInterruptState( void * interruptRef, UInt32 state ); + + virtual IOReturn getNotificationSemaphore( IOSelect interruptType, + semaphore_t * semaphore ); + + IOReturn setBackingFramebuffer(const IOPixelInformation * info, + uint32_t bufferCount, + void * mappedAddress[]); + IOReturn switchBackingFramebuffer(uint32_t bufferIndex); + +/* non WL clients apis +*/ + IOReturn setAttributeExt( IOSelect attribute, uintptr_t value ); + + IOReturn getAttributeExt( IOSelect attribute, uintptr_t * value ); + + IOReturn setAttributeForConnectionExt( IOIndex connectIndex, + IOSelect attribute, uintptr_t value ); + + IOReturn getAttributeForConnectionExt( IOIndex connectIndex, + IOSelect attribute, uintptr_t * value ); + + /* New */ + IONotifier * addFramebufferNotificationWithOptions(IOFramebufferNotificationHandler handler, + OSObject * target, void * ref, + IOSelect groupID, IOIndex groupPriority, IOSelect events); + + void resetLimitState(void); + void sendLimitState(const uint32_t line); +}; + +#endif /* ! _IOKIT_IOFRAMEBUFFER_H */ diff --git a/QualcommWireless/include/IOKit/graphics/IOFramebufferShared.h b/QualcommWireless/include/IOKit/graphics/IOFramebufferShared.h new file mode 100644 index 0000000..4034934 --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/IOFramebufferShared.h @@ -0,0 +1,261 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFRAMEBUFFERSHARED_H +#define _IOKIT_IOFRAMEBUFFERSHARED_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*! @header IOFramebufferShared +The IOFramebufferShared.h header contains definitions of objects and types shared between a kernel level IOFrameBuffer service and a non-kernel window server. In Mac OS X this structure is used by the CoreGraphics server and IOGraphics Family, and is not available to other clients. IOFramebuffer subclasses and IOFramebuffer clients within the kernel should also not rely on this structure definition and constants. It is public only for use on Darwin based window servers. Cursor and window server state data is exchanged by kernel and non-kernel tasks through a slice of shared memory containing a StdFBShmem_t structure.
+For a non-kernel task to get access to this slice of shared memory, a connection to an IOFramebuffer service must be made. A connection is made with the IOServiceOpen() function described in IOKitLib.h. A connection type of kIOFBServerConnectType or kIOFBSharedConnectType (for read-only access) should be specified. An io_connect_t handle is returned by IOServiceOpen(). This handle must be passed to IOFBCreateSharedCursor() to create the slice of shared memory. Then IOConnectMapMemory() may be called with a memory type of kIOFBCursorMemory to map the shared memory into the non-kernel task. +*/ + +#ifdef KERNEL +// CGS use optional +/*! @defined IOFB_ARBITRARY_SIZE_CURSOR + @discussion When IOFB_ARBITRARY_SIZE_CURSOR is not defined, the maximum cursor size is assumed to be CURSORWIDTH x CURSORHEIGHT and this header file will define a number of structures for storing cursor images accordingly. A non-kernel task may define IOFB_ARBITRARY_SIZE_CURSOR and use cursors up to the size specified when IOFBCreateSharedCursor() was called. In this case appropriate structures for storing cursor images must be defined elsewhere. In the kernel, IOFB_ARBITRARY_SIZE_CURSOR is always defined. +*/ +#define IOFB_ARBITRARY_SIZE_CURSOR +#define IOFB_ARBITRARY_FRAMES_CURSOR 1 +#endif + +#define IOFB_SUPPORTS_XOR_CURSOR +#define IOFB_SUPPORTS_HW_SHIELD +#define IOFB_SUPPORTS_ARBITRARY_FRAMES_CURSOR + +// +// Cursor and Window Server state data, occupying a slice of shared memory +// between the kernel and WindowServer. +// +/*! @enum CursorParameters + @constant kIOFBNumCursorFrames The number of cursor images stored in the StdFBShmem_t structure. + @constant kIOFBNumCursorFramesShift Used with waiting cursors. + @constant kIOFBMaxCursorDepth The maximum cursor pixel depth. +*/ +enum { +#if IOFB_ARBITRARY_FRAMES_CURSOR + kIOFBMainCursorIndex = 0, + kIOFBWaitCursorIndex = 1, + kIOFBNumCursorIndex = 4, +#else + kIOFBNumCursorFrames = 4, + kIOFBNumCursorFramesShift = 2, +#endif + kIOFBMaxCursorDepth = 32, + kIOFBMaxCursorWidth = 256, + kIOFBMaxCursorFrames = 32, +}; + +#ifndef IOFB_ARBITRARY_SIZE_CURSOR + +/*! @defined CURSORWIDTH + @discussion The maximum width of the cursor image in pixels. This is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. +*/ +#define CURSORWIDTH 16 /* width in pixels */ + +/*! @defined CURSORHEIGHT + @discussion The maximum height of the cursor image in pixels. This is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. +*/ +#define CURSORHEIGHT 16 /* height in pixels */ + +/*! @struct bm12Cursor + @abstract Cursor image for 1-bit cursor. + @discussion This structure stores 16 pixel x 16 pixel cursors to be used with 1-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. + @field image This array contains the cursor images. + @field mask This array contains the cursor mask. + @field save This array stores the pixel values of the region underneath the cursor in its last drawn position. +*/ +struct bm12Cursor { + unsigned int image[4][16]; + unsigned int mask[4][16]; + unsigned int save[16]; +}; + +/*! @struct bm18Cursor + @abstract Cursor image for 8-bit cursor. + @discussion This structure stores 16 pixel x 16 pixel cursors to be used with 8-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. + @field image This array contains cursor color values, which are converted to displayed colors through the color table. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. + @field mask This array contains the cursor alpha mask. The array is two dimensional with the same indexing as the image. If an alpha mask pixel is 0 and the corresponding image pixel is set to white for the display, then this cursor pixel will invert pixels on the display. + @field save This array stores the color values of the region underneath the cursor in its last drawn position. +*/ +struct bm18Cursor { + unsigned char image[4][256]; + unsigned char mask[4][256]; + unsigned char save[256]; +}; + +/*! @struct bm34Cursor + @abstract Cursor image for 15-bit cursor. + @discussion This structure stores 16 pixel x 16 pixel cursors to be used with 15-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. + @field image This array defines the cursor color values and transparency. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. A value of 0 means the pixel is transparent. Non-zero values are stored with the red, green, blue, and alpha values encoded with the following masks:
+ red mask = 0xF000
+ blue mask 0x0F00
+ green mask 0x00F0
+ alpha mask = 0x000F
+Note, only 4 bits are allocated for each color component. + @field save This array stores the color values of the region underneath the cursor in its last drawn position. +*/ +struct bm34Cursor { + unsigned short image[4][256]; + unsigned short save[256]; +}; + +/*! @struct bm38Cursor + @abstract Cursor image for 24-bit cursor. + @discussion This structure stores 16 pixel x 16 pixel cursors to be used with 24-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. + @field image This array defines the cursor color values and transparency. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. The lower 24 bits of a pixel's value contain the RGB color, while the upper 8 bits contain the alpha value. + @field save This array stores the color values of the region underneath the cursor in its last drawn position. +*/ +struct bm38Cursor { + unsigned int image[4][256]; + unsigned int save[256]; +}; + +#endif /* IOFB_ARBITRARY_SIZE_CURSOR */ + +enum { + kIOFBCursorImageNew = 0x01, + kIOFBCursorHWCapable = 0x02 +}; +enum { + kIOFBHardwareCursorActive = 0x01, + kIOFBHardwareCursorInVRAM = 0x02 +}; + +/*! @struct StdFBShmem_t + @discussion This structure contains cursor and window server state data and occupies a slice of shared memory between the kernel and window server. Several elements of this structure are only used in software cursor mode. Unless otherwise indicated, the coordinates in this structure are given in display space. Display space is the coordinate space that encompasses all the screens. The positions of the screens within display space indicate their location relative to each other as the cursor moves between them. If there is only one screen, the screen coordinates and display space coordinates will be the same. + @field cursorSema Semaphore lock for write access to the shared data in this structure. + @field frame The current cursor frame index. + @field cursorShow The cursor is displayed when cursorShow is 0. + @field cursorObscured If this is true, the cursor has been obscured and cursorShow should not be 0. The cursor will be shown again the next time it is moved. + @field shieldFlag When this is set to true the cursor will not be displayed in the region specified by shieldRect. + @field shielded True if the cursor has been hidden because it entered the shielded region. + @field saveRect The region that is saved underneath the cursor in software cursor mode. + @field shieldRect The region that the cursor will not be displayed in if shieldFlag is true. + @field cursorLoc The location of the cursor hot spot. + @field cursorRect The region that the cursor image currently occupies in software cursor mode. + @field oldCursorRect The region that the cursor image occupied the last time the cursor was drawn in software cursor mode. + @field screenBounds The region that the current screen occupies. + @field version Contains kIOFBCurrentShmemVersion so that a user client can ensure it is using the same version of this structure as the kernel. + @field structSize Contains the size of this structure. + @field vblTime The time of the most recent vertical blanking. + @field vblDelta The interval between the two most recent vertical blankings. + @field vblCount A running count of vertical blank interrupts. + @field reservedC Reserved for future use. + @field hardwareCursorCapable True if the hardware is capable of using hardware cursor mode. + @field hardwareCursorActive True if currently using the hardware cursor mode. + @field reservedB Reserved for future use. + @field cursorSize This array contains the cursor sizes indexed by frame. + @field hotSpot This array contains the location of the cursor hot spots indexed by frame. The hot spots coordinates are given relative to the top left corner of the cursor image. + @field cursor A union of structures that define the cursor images. The structure used depends on the framebuffer's bit depth. These structures are defined above. +*/ + +struct StdFBShmem_t { + OSSpinLock cursorSema; + int frame; + char cursorShow; + char cursorObscured; + char shieldFlag; + char shielded; + IOGBounds saveRect; + IOGBounds shieldRect; + IOGPoint cursorLoc; + IOGBounds cursorRect; + IOGBounds oldCursorRect; + IOGBounds screenBounds; + int version; + int structSize; + AbsoluteTime vblTime; + AbsoluteTime vblDelta; + unsigned long long int vblCount; +#if IOFB_ARBITRARY_FRAMES_CURSOR + unsigned long long int vblDrift; + unsigned long long int vblDeltaMeasured; + AbsoluteTime vblDeltaReal; + unsigned int reservedC[22]; +#else + unsigned int reservedC[27]; + unsigned char hardwareCursorFlags[kIOFBNumCursorFrames]; +#endif + unsigned char hardwareCursorCapable; + unsigned char hardwareCursorActive; + unsigned char hardwareCursorShields; + unsigned char reservedB[1]; +#if IOFB_ARBITRARY_FRAMES_CURSOR + IOGSize cursorSize[kIOFBNumCursorIndex]; + IOGPoint hotSpot[kIOFBNumCursorIndex]; +#else + IOGSize cursorSize[kIOFBNumCursorFrames]; + IOGPoint hotSpot[kIOFBNumCursorFrames]; +#endif +#ifndef IOFB_ARBITRARY_SIZE_CURSOR + union { + struct bm12Cursor bw; + struct bm18Cursor bw8; + struct bm34Cursor rgb; + struct bm38Cursor rgb24; + } cursor; +#else /* IOFB_ARBITRARY_SIZE_CURSOR */ + unsigned char cursor[0]; +#endif /* IOFB_ARBITRARY_SIZE_CURSOR */ +}; +#ifndef __cplusplus +typedef volatile struct StdFBShmem_t StdFBShmem_t; +#endif + + +/*! @enum FramebufferConstants + @constant kIOFBCurrentShmemVersion The current version of the slice of shared memory that contains the cursor and window server state data in the StdFBShmem_t structure. + @constant kIOFBCursorMemory The memory type for IOConnectMapMemory() to get a slice of shared memory that contains the StdFBShmem_t structure. +*/ +enum { + // version for IOFBCreateSharedCursor + kIOFBShmemVersionMask = 0x000000ff, + kIOFBTenPtOneShmemVersion = 2, + kIOFBTenPtTwoShmemVersion = 3, + kIOFBCurrentShmemVersion = 2, + + // number of frames in animating cursor (if > kIOFBTenPtTwoShmemVersion) + kIOFBShmemCursorNumFramesMask = 0x00ff0000, + kIOFBShmemCursorNumFramesShift = 16, + + // memory types for IOConnectMapMemory. + kIOFBCursorMemory = 100 +}; + +/*! @defined IOFRAMEBUFFER_CONFORMSTO + @discussion The class name of the framebuffer service. +*/ +#define IOFRAMEBUFFER_CONFORMSTO "IOFramebuffer" + +#ifdef __cplusplus +} +#endif + +#endif /* ! _IOKIT_IOFRAMEBUFFERSHARED_H */ diff --git a/QualcommWireless/include/IOKit/graphics/IOGraphicsDevice.h b/QualcommWireless/include/IOKit/graphics/IOGraphicsDevice.h new file mode 100644 index 0000000..b724d5a --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/IOGraphicsDevice.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IOGRAPHICSDEVICE_H +#define _IOKIT_IOGRAPHICSDEVICE_H + +#include + +#include + + +class IOGraphicsDevice : public IOService +{ + OSDeclareAbstractStructors(IOGraphicsDevice) + +public: + + virtual void hideCursor( void ) = 0; + virtual void showCursor( IOGPoint * cursorLoc, int frame ) = 0; + virtual void moveCursor( IOGPoint * cursorLoc, int frame ) = 0; + + virtual void getVBLTime( AbsoluteTime * time, AbsoluteTime * delta ) = 0; + + virtual void getBoundingRect ( IOGBounds ** bounds ) = 0; +}; + +#endif /* ! _IOKIT_IOGRAPHICSDEVICE_H */ + diff --git a/QualcommWireless/include/IOKit/graphics/IOGraphicsEngine.h b/QualcommWireless/include/IOKit/graphics/IOGraphicsEngine.h new file mode 100644 index 0000000..8b1ccaa --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/IOGraphicsEngine.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + * 10 Mar 99 sdouglas created. + */ + + +struct IOGraphicsEngineContext { + OSSpinLock contextLock; + IOOptionBits state; + void * owner; + UInt32 version; + IOByteCount structSize; + UInt32 reserved[ 8 ]; +}; +#ifndef __cplusplus +typedef volatile struct IOGraphicsEngineContext IOGraphicsEngineContext; +#endif + +enum { + // memory type for IOMapMemory + kIOGraphicsEngineContext = 100 +}; + +enum { + // version + kIOGraphicsEngineContextVersion = 1 +}; diff --git a/QualcommWireless/include/IOKit/graphics/IOGraphicsInterfaceTypes.h b/QualcommWireless/include/IOKit/graphics/IOGraphicsInterfaceTypes.h new file mode 100644 index 0000000..5b392a7 --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/IOGraphicsInterfaceTypes.h @@ -0,0 +1,301 @@ +/* + * Copyright (c) 1999-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOGRAPHICSINTERFACETYPES_H +#define _IOKIT_IOGRAPHICSINTERFACETYPES_H + +#include + +#define IO_FOUR_CHAR_CODE(x) (x) + +typedef UInt32 IOFourCharCode; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#define kCurrentGraphicsInterfaceVersion 1 +#define kCurrentGraphicsInterfaceRevision 2 + + +#ifdef IOGA_COMPAT +typedef SInt32 IOBlitCompletionToken; +#endif + +typedef UInt32 IOBlitType; +enum { + kIOBlitTypeVerbMask = 0x000000ff, + kIOBlitTypeRects = 0, + kIOBlitTypeCopyRects, + kIOBlitTypeLines, + kIOBlitTypeScanlines, + kIOBlitTypeCopyRegion, + + kIOBlitTypeMoveCursor, + kIOBlitTypeShowCursor, + kIOBlitTypeHideCursor, + + kIOBlitTypeMonoExpand = 0x00000100, + kIOBlitTypeColorSpaceConvert = 0x00000200, + kIOBlitTypeScale = 0x00000400, + + kIOBlitTypeSourceKeyColorModeMask = 0x00003000, + kIOBlitTypeDestKeyColorModeMask = 0x0000c000, + kIOBlitTypeSourceKeyColorEqual = 0x00001000, + kIOBlitTypeSourceKeyColorNotEqual = 0x00002000, + kIOBlitTypeDestKeyColorEqual = 0x00004000, + kIOBlitTypeDestKeyColorNotEqual = 0x00008000, + + kIOBlitTypeOperationMask = 0x0fff0000, + kIOBlitTypeOperationShift = 16, + kIOBlitTypeOperationTypeMask = 0x0f000000, + + kIOBlitTypeOperationType0 = 0x00000000, + kIOBlitCopyOperation = 0x00000000 | kIOBlitTypeOperationType0, + kIOBlitOrOperation = 0x00010000 | kIOBlitTypeOperationType0, + kIOBlitXorOperation = 0x00020000 | kIOBlitTypeOperationType0, + kIOBlitBlendOperation = 0x00030000 | kIOBlitTypeOperationType0, + kIOBlitHighlightOperation = 0x00040000 | kIOBlitTypeOperationType0 +}; + +typedef UInt32 IOBlitSourceType; +enum { + kIOBlitSourceDefault = 0x00000000, + kIOBlitSourceFramebuffer = 0x00001000, + kIOBlitSourceMemory = 0x00002000, + kIOBlitSourceOOLMemory = 0x00003000, + kIOBlitSourcePattern = 0x00004000, + kIOBlitSourceOOLPattern = 0x00005000, + kIOBlitSourceSolid = 0x00006000, + kIOBlitSourceCGSSurface = 0x00007000, + kIOBlitSourceIsSame = 0x80000000 +}; + +#ifdef IOGA_COMPAT +typedef IOBlitSourceType IOBlitSourceDestType; +enum { + kIOBlitDestFramebuffer = 0x00000001 +}; +#endif + +typedef struct IOBlitOperationStruct { + UInt32 color0; + UInt32 color1; + SInt32 offsetX; + SInt32 offsetY; + UInt32 sourceKeyColor; + UInt32 destKeyColor; + UInt32 specific[16]; +} IOBlitOperation; + +typedef struct IOBlitRectangleStruct { + SInt32 x; + SInt32 y; + SInt32 width; + SInt32 height; +} IOBlitRectangle; + +typedef struct IOBlitRectanglesStruct { + IOBlitOperation operation; + IOItemCount count; + IOBlitRectangle rects[1]; +} IOBlitRectangles; + +typedef struct IOBlitCopyRectangleStruct { + SInt32 sourceX; + SInt32 sourceY; + SInt32 x; + SInt32 y; + SInt32 width; + SInt32 height; +} IOBlitCopyRectangle; + +typedef struct IOBlitCopyRectanglesStruct { + IOBlitOperation operation; + IOItemCount count; + IOBlitCopyRectangle rects[1]; +} IOBlitCopyRectangles; + + +typedef struct IOBlitCopyRegionStruct { + IOBlitOperation operation; + SInt32 deltaX; + SInt32 deltaY; + IOAccelDeviceRegion * region; +} IOBlitCopyRegion; + + +typedef struct IOBlitVertexStruct { + SInt32 x; + SInt32 y; +} IOBlitVertex; + +typedef struct IOBlitVerticesStruct { + IOBlitOperation operation; + IOItemCount count; + IOBlitVertex vertices[2]; +} IOBlitVertices; + +typedef struct IOBlitScanlinesStruct { + IOBlitOperation operation; + IOItemCount count; + SInt32 y; + SInt32 height; + SInt32 x[2]; +} IOBlitScanlines; + + +typedef struct IOBlitCursorStruct { + IOBlitOperation operation; + IOBlitRectangle rect; +} IOBlitCursor; + +typedef struct _IOBlitMemory * IOBlitMemoryRef; + + +/* Quickdraw.h pixel formats*/ + +enum { + kIO1MonochromePixelFormat = 0x00000001, /* 1 bit indexed*/ + kIO2IndexedPixelFormat = 0x00000002, /* 2 bit indexed*/ + kIO4IndexedPixelFormat = 0x00000004, /* 4 bit indexed*/ + kIO8IndexedPixelFormat = 0x00000008, /* 8 bit indexed*/ + kIO16BE555PixelFormat = 0x00000010, /* 16 bit BE rgb 555 (Mac)*/ + kIO24RGBPixelFormat = 0x00000018, /* 24 bit rgb */ + kIO32ARGBPixelFormat = 0x00000020, /* 32 bit argb (Mac)*/ + kIO1IndexedGrayPixelFormat = 0x00000021, /* 1 bit indexed gray*/ + kIO2IndexedGrayPixelFormat = 0x00000022, /* 2 bit indexed gray*/ + kIO4IndexedGrayPixelFormat = 0x00000024, /* 4 bit indexed gray*/ + kIO8IndexedGrayPixelFormat = 0x00000028 /* 8 bit indexed gray*/ +}; + +enum { + kIO16LE555PixelFormat = IO_FOUR_CHAR_CODE('L555'), /* 16 bit LE rgb 555 (PC)*/ + kIO16LE5551PixelFormat = IO_FOUR_CHAR_CODE('5551'), /* 16 bit LE rgb 5551*/ + kIO16BE565PixelFormat = IO_FOUR_CHAR_CODE('B565'), /* 16 bit BE rgb 565*/ + kIO16LE565PixelFormat = IO_FOUR_CHAR_CODE('L565'), /* 16 bit LE rgb 565*/ + kIO24BGRPixelFormat = IO_FOUR_CHAR_CODE('24BG'), /* 24 bit bgr */ + kIO32BGRAPixelFormat = IO_FOUR_CHAR_CODE('BGRA'), /* 32 bit bgra (Matrox)*/ + kIO32ABGRPixelFormat = IO_FOUR_CHAR_CODE('ABGR'), /* 32 bit abgr */ + kIO32RGBAPixelFormat = IO_FOUR_CHAR_CODE('RGBA'), /* 32 bit rgba */ + kIOYUVSPixelFormat = IO_FOUR_CHAR_CODE('yuvs'), /* YUV 4:2:2 byte ordering 16-unsigned = 'YUY2'*/ + kIOYUVUPixelFormat = IO_FOUR_CHAR_CODE('yuvu'), /* YUV 4:2:2 byte ordering 16-signed*/ + kIOYVU9PixelFormat = IO_FOUR_CHAR_CODE('YVU9'), /* YVU9 Planar 9*/ + kIOYUV411PixelFormat = IO_FOUR_CHAR_CODE('Y411'), /* YUV 4:1:1 Interleaved 16*/ + kIOYVYU422PixelFormat = IO_FOUR_CHAR_CODE('YVYU'), /* YVYU 4:2:2 byte ordering 16*/ + kIOUYVY422PixelFormat = IO_FOUR_CHAR_CODE('UYVY'), /* UYVY 4:2:2 byte ordering 16*/ + kIOYUV211PixelFormat = IO_FOUR_CHAR_CODE('Y211'), /* YUV 2:1:1 Packed 8*/ + kIO2vuyPixelFormat = IO_FOUR_CHAR_CODE('2vuy') /* UYVY 4:2:2 byte ordering 16*/ +}; + +/* Non Quickdraw.h pixel formats*/ +enum { + kIO16LE4444PixelFormat = IO_FOUR_CHAR_CODE('L444'), /* 16 bit LE argb 4444*/ + kIO16BE4444PixelFormat = IO_FOUR_CHAR_CODE('B444'), /* 16 bit BE argb 4444*/ + kIO64BGRAPixelFormat = IO_FOUR_CHAR_CODE('B16I'), /* 64 bit bgra */ + kIO64RGBAFloatPixelFormat = IO_FOUR_CHAR_CODE('B16F'), /* 64 bit rgba */ + kIO128RGBAFloatPixelFormat = IO_FOUR_CHAR_CODE('B32F') /* 128 bit rgba float */ +}; + +enum { + kIOBlitMemoryRequiresHostFlush = 0x00000001 +}; + +typedef struct IOBlitSurfaceStruct { + union { + UInt8 * bytes; + IOBlitMemoryRef ref; + } memory; + IOFourCharCode pixelFormat; + IOBlitRectangle size; + UInt32 rowBytes; + UInt32 byteOffset; + UInt32 * palette; + IOOptionBits accessFlags; + IOBlitMemoryRef interfaceRef; + UInt32 more[14]; +} IOBlitSurface; + +typedef IOBlitSurface IOBlitMemory; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +enum { + // options for Synchronize + kIOBlitSynchronizeWaitBeamExit = 0x00000001, + kIOBlitSynchronizeFlushHostWrites = 0x00000002 +}; + +enum { + // options for WaitComplete & Flush + kIOBlitWaitContext = 0x00000000, + kIOBlitWaitAll2D = 0x00000001, + kIOBlitWaitGlobal = 0x00000001, + kIOBlitWaitAll = 0x00000002, + kIOBlitWaitCheck = 0x00000080, + kIOBlitFlushWithSwap = 0x00010000 +}; + +enum { + // options for AllocateSurface + kIOBlitHasCGSSurface = 0x00000001, + kIOBlitFixedSource = 0x00000002, + kIOBlitBeamSyncSwaps = 0x00000004, + kIOBlitReferenceSource = 0x00000008 +}; + +enum { + // options for UnlockSurface + kIOBlitUnlockWithSwap = 0x80000000 +}; + +enum { + // options for SetDestination + kIOBlitFramebufferDestination = 0x00000000, + kIOBlitSurfaceDestination = 0x00000001 +}; + + + +enum { + // options for blit procs + kIOBlitBeamSync = 0x00000001, + kIOBlitBeamSyncAlways = 0x00000002, + kIOBlitBeamSyncSpin = 0x00000004, + + kIOBlitAllOptions = 0xffffffff +}; + +enum { + // capabilities + kIOBlitColorSpaceTypes = IO_FOUR_CHAR_CODE('cspc') +}; + + +// keys for IOAccelFindAccelerator() +#define kIOAccelTypesKey "IOAccelTypes" +#define kIOAccelIndexKey "IOAccelIndex" + +#define kIOAccelRevisionKey "IOAccelRevision" + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#endif /* !_IOKIT_IOGRAPHICSINTERFACETYPES_H */ diff --git a/QualcommWireless/include/IOKit/graphics/IOGraphicsTypes.h b/QualcommWireless/include/IOKit/graphics/IOGraphicsTypes.h new file mode 100644 index 0000000..92feacf --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/IOGraphicsTypes.h @@ -0,0 +1,1722 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOGRAPHICSTYPES_H +#define _IOKIT_IOGRAPHICSTYPES_H + + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define IOGRAPHICSTYPES_REV 71 + +typedef SInt32 IOIndex; +typedef UInt32 IOSelect; +typedef UInt32 IOFixed1616; +typedef UInt32 IODisplayVendorID; +typedef UInt32 IODisplayProductID; + +typedef SInt32 IODisplayModeID; +enum { + // This is the ID given to a programmable timing used at boot time + kIODisplayModeIDBootProgrammable = (IODisplayModeID)0xFFFFFFFB, + // Lowest (unsigned) DisplayModeID reserved by Apple + kIODisplayModeIDReservedBase = (IODisplayModeID)0x80000000 +}; + +enum { + kIOMaxPixelBits = 64 +}; +typedef char IOPixelEncoding[ kIOMaxPixelBits ]; + +// Common Apple pixel formats + +#define IO1BitIndexedPixels "P" +#define IO2BitIndexedPixels "PP" +#define IO4BitIndexedPixels "PPPP" +#define IO8BitIndexedPixels "PPPPPPPP" +#define IO16BitDirectPixels "-RRRRRGGGGGBBBBB" +#define IO32BitDirectPixels "--------RRRRRRRRGGGGGGGGBBBBBBBB" + +#define kIO30BitDirectPixels "--RRRRRRRRRRGGGGGGGGGGBBBBBBBBBB" +#define kIO64BitDirectPixels "-16R16G16B16" + +#define kIO16BitFloatPixels "-16FR16FG16FB16" +#define kIO32BitFloatPixels "-32FR32FG32FB32" + +// other possible pixel formats + +#define IOYUV422Pixels "Y4U2V2" +#define IO8BitOverlayPixels "O8" +// page flipping +#define IOPagedPixels "Page1" + +#define IO_SampleTypeAlpha 'A' +#define IO_SampleTypeSkip '-' + +// Info about a pixel format +enum { + kIOCLUTPixels = 0, + kIOFixedCLUTPixels = 1, + kIORGBDirectPixels = 2, + kIOMonoDirectPixels = 3, + kIOMonoInverseDirectPixels = 4, + kIORGBSignedDirectPixels = 5, + kIORGBSignedFloatingPointPixels = 6 +}; + +/*! + * @struct IOPixelInformation + * @abstract A structure defining the format of a framebuffer. + * @discussion This structure is used by IOFramebuffer to define the format of the pixels. + * @field bytesPerRow The number of bytes per row. + * @field bytesPerPlane Not used. + * @field bitsPerPixel The number of bits per pixel, including unused bits and alpha. + * @field pixelType One of kIOCLUTPixels (indexed pixels with changeable CLUT), kIORGBDirectPixels (direct pixels). + * @field componentCount One for indexed pixels, three for direct pixel formats. + * @field bitsPerComponent Number of bits per component in each pixel. + * @field componentMasks Mask of the bits valid for each component of the pixel - in R, G, B order for direct pixels. + * @field pixelFormat String description of the pixel format - IO32BitDirectPixels, IO16BitDirectPixels etc. + * @field flags None defined - set to zero. + * @field activeWidth Number of pixels visible per row. + * @field activeHeight Number of visible pixel rows. + * @field reserved Set to zero. + */ + +struct IOPixelInformation { + UInt32 bytesPerRow; + UInt32 bytesPerPlane; + UInt32 bitsPerPixel; + UInt32 pixelType; + UInt32 componentCount; + UInt32 bitsPerComponent; + UInt32 componentMasks[ 8 * 2 ]; + IOPixelEncoding pixelFormat; + UInt32 flags; + UInt32 activeWidth; + UInt32 activeHeight; + UInt32 reserved[ 2 ]; +}; +typedef struct IOPixelInformation IOPixelInformation; + +// ID for industry standard display timings +typedef UInt32 IOAppleTimingID; + +/*! + * @struct IODisplayModeInformation + * @abstract A structure defining the format of a framebuffer. + * @discussion This structure is used by IOFramebuffer to define the format of the pixels. + * @field nominalWidth Number of pixels visible per row. + * @field nominalHeight Number of visible pixel rows. + * @field refreshRate Refresh rate in fixed point 16.16. + * @field maxDepthIndex Highest depth index available in this display mode. + * @field flags Flags for the mode, including:
+ * kDisplayModeInterlacedFlag mode is interlaced.
+ * kDisplayModeSimulscanFlag mode is available on multiple display connections.
+ * kDisplayModeNotPresetFlag mode is not a factory preset for the display (geometry may need correction).
+ * kDisplayModeStretchedFlag mode is stretched/distorted to match the display aspect ratio.
+ * @field imageWidth Physical width of active image if known, in millimeters, otherwise zero.
+ * @field imageHeight Physical height of active image if known, in millimeters, otherwise zero.
+ * @field reserved Set to zero. + */ + +struct IODisplayModeInformation { + UInt32 nominalWidth; + UInt32 nominalHeight; + IOFixed1616 refreshRate; + IOIndex maxDepthIndex; + UInt32 flags; + UInt16 imageWidth; + UInt16 imageHeight; + UInt32 reserved[ 3 ]; +}; +typedef struct IODisplayModeInformation IODisplayModeInformation; + +// flags +enum { + kDisplayModeSafetyFlags = 0x00000007, + + kDisplayModeAlwaysShowFlag = 0x00000008, + kDisplayModeNeverShowFlag = 0x00000080, + kDisplayModeNotResizeFlag = 0x00000010, + kDisplayModeRequiresPanFlag = 0x00000020, + + kDisplayModeInterlacedFlag = 0x00000040, + + kDisplayModeSimulscanFlag = 0x00000100, + kDisplayModeBuiltInFlag = 0x00000400, + kDisplayModeNotPresetFlag = 0x00000200, + kDisplayModeStretchedFlag = 0x00000800, + kDisplayModeNotGraphicsQualityFlag = 0x00001000, + kDisplayModeValidateAgainstDisplay = 0x00002000, + kDisplayModeTelevisionFlag = 0x00100000, + kDisplayModeValidForMirroringFlag = 0x00200000, + kDisplayModeAcceleratorBackedFlag = 0x00400000, + kDisplayModeValidForHiResFlag = 0x00800000, + kDisplayModeValidForAirPlayFlag = 0x01000000, + kDisplayModeNativeFlag = 0x02000000 +}; +enum { + kDisplayModeValidFlag = 0x00000001, + kDisplayModeSafeFlag = 0x00000002, + kDisplayModeDefaultFlag = 0x00000004 +}; + +#ifndef KERNEL +// Framebuffer info - obsolete + +struct IOFramebufferInformation { + IOPhysicalAddress baseAddress; + UInt32 activeWidth; + UInt32 activeHeight; + IOByteCount bytesPerRow; + IOByteCount bytesPerPlane; + UInt32 bitsPerPixel; + UInt32 pixelType; + UInt32 flags; + UInt32 reserved[ 4 ]; +}; +typedef struct IOFramebufferInformation IOFramebufferInformation; +#endif + +// flags +enum { + kFramebufferSupportsCopybackCache = 0x00010000, + kFramebufferSupportsWritethruCache = 0x00020000, + kFramebufferSupportsGammaCorrection = 0x00040000, + kFramebufferDisableAltivecAccess = 0x00080000 +}; + +// Aperture is an index into supported pixel formats for a mode & depth +typedef IOIndex IOPixelAperture; +enum { + kIOFBSystemAperture = 0 +}; + +//// CLUTs + +// IOFBSetGamma Sync Types +#define kIOFBSetGammaSyncNotSpecified -1 +#define kIOFBSetGammaSyncNoSync 0 +#define kIOFBSetGammaSyncVerticalBlankSync 1 + +typedef UInt16 IOColorComponent; + +/*! + * @struct IOColorEntry + * @abstract A structure defining one entry of a color lookup table. + * @discussion This structure is used by IOFramebuffer to define an entry of a color lookup table. + * @field index Number of pixels visible per row. + * @field red Value of red component 0-65535. + * @field green Value of green component 0-65535. + * @field blue Value of blue component 0-65535. + */ + +struct IOColorEntry { + UInt16 index; + IOColorComponent red; + IOColorComponent green; + IOColorComponent blue; +}; +typedef struct IOColorEntry IOColorEntry; + +// options (masks) +enum { + kSetCLUTByValue = 0x00000001, // else at index + kSetCLUTImmediately = 0x00000002, // else at VBL + kSetCLUTWithLuminance = 0x00000004 // else RGB +}; + +//// Controller attributes + +enum { + kIOPowerStateAttribute = 'pwrs', + kIOPowerAttribute = 'powr', + kIODriverPowerAttribute = 'dpow', + kIOHardwareCursorAttribute = 'crsr', + + kIOMirrorAttribute = 'mirr', + kIOMirrorDefaultAttribute = 'mrdf', + + kIOCapturedAttribute = 'capd', + + kIOCursorControlAttribute = 'crsc', + + kIOSystemPowerAttribute = 'spwr', + kIOWindowServerActiveAttribute = 'wsrv', + kIOVRAMSaveAttribute = 'vrsv', + kIODeferCLUTSetAttribute = 'vclt', + + kIOClamshellStateAttribute = 'clam', + + kIOFBDisplayPortTrainingAttribute = 'dpta', + + kIOFBDisplayState = 'dstt', + + kIOFBVariableRefreshRate = 'vrr?', + + kIOFBLimitHDCPAttribute = 'hdcp', + kIOFBLimitHDCPStateAttribute = 'sHDC', + + kIOFBStop = 'stop', + + kIOFBRedGammaScaleAttribute = 'gslr', // as of IOGRAPHICSTYPES_REV 54 + kIOFBGreenGammaScaleAttribute = 'gslg', // as of IOGRAPHICSTYPES_REV 54 + kIOFBBlueGammaScaleAttribute = 'gslb', // as of IOGRAPHICSTYPES_REV 54 + + kIOFBHDRMetaDataAttribute = 'hdrm', // as of IOGRAPHICSTYPES_REV 64 + + kIOBuiltinPanelPowerAttribute = 'pnlp', // as of IOGRAPHICSTYPES_REV 71 +}; + +enum { + kIOFBHDCPLimit_AllowAll = 0, + kIOFBHDCPLimit_NoHDCP1x = 1 << 0, + kIOFBHDCPLimit_NoHDCP20Type0 = 1 << 1, + kIOFBHDCPLimit_NoHDCP20Type1 = 1 << 2, // Default case +}; + +// kIOFBHDRMetaDataAttribute +struct IOFBHDRMetaDataV1 +{ + uint16_t displayPrimary_X0; // X coordinate of red primary + uint16_t displayPrimary_Y0; // Y coordinate of red primary + uint16_t displayPrimary_X1; // X coordinate of green primary + uint16_t displayPrimary_Y1; // Y coordinate of green primary + uint16_t displayPrimary_X2; // X coordinate of blue primary + uint16_t displayPrimary_Y2; // Y coordinate of blue primary + uint16_t displayPrimary_X; // X coordinate of white primary + uint16_t displayPrimary_Y; // Y coordinate of white primary + uint16_t desiredLuminance_Max; // Desired max display luminance + uint16_t desiredLuminance_Min; // Desired min display luminance + uint16_t desiredLightLevel_Avg; // Desired max frame-average light level + uint16_t desiredLightLevel_Max; // Desired max light level + + uint64_t __reservedA[5]; // Reserved - set to zero +}; +typedef struct IOFBHDRMetaDataV1 IOFBHDRMetaDataV1; +typedef union { + IOFBHDRMetaDataV1 v1; +} IOFBHDRMetaData; + +// IOGraphics: Implement display state attribute for deteriming display state post wake +// kIOFBDisplayState +enum { + kIOFBDisplayState_AlreadyActive = (1 << 0), + kIOFBDisplayState_RestoredProfile = (1 << 1), + kIOFBDisplayState_PipelineBlack = (1 << 2), + kIOFBDisplayState_Mask = (kIOFBDisplayState_AlreadyActive | + kIOFBDisplayState_RestoredProfile | + kIOFBDisplayState_PipelineBlack) +}; + +// values for kIOWindowServerActiveAttribute +enum { + // States + kIOWSAA_Unaccelerated = 0, // CPU rendering/access only, no GPU access + kIOWSAA_Accelerated = 1, // GPU rendering/access only, no CPU mappings + kIOWSAA_From_Accelerated = 2, // Transitioning from GPU to CPU + kIOWSAA_To_Accelerated = 3, // Transitioning from CPU to GPU + kIOWSAA_Sleep = 4, + kIOWSAA_Hibernate = kIOWSAA_Sleep, + kIOWSAA_DriverOpen = 5, // Reserved + kIOWSAA_StateMask = 0xF, + // Bits + kIOWSAA_Transactional = 0x10, // If this bit is present, transition is to/from transactional operation model. + // These attributes are internal + kIOWSAA_DeferStart = 0x100, + kIOWSAA_DeferEnd = 0x200, + kIOWSAA_NonConsoleDevice = 0x400, // If present, associated FB is non-console. See ERS for further details. + kIOWSAA_Reserved = 0xF0000000 +}; + +// IOFBNS prefix is IOFramebuffer notifyServer +enum { + kIOFBNS_Rendezvous = 0x87654321, // Note sign-bit is 1 here. + + kIOFBNS_MessageMask = 0x0000000f, + kIOFBNS_Sleep = 0x00, + kIOFBNS_Wake = 0x01, + kIOFBNS_Doze = 0x02, +#ifndef _OPEN_SOURCE_ + // IOGraphics: Add 10 second timeout to IODW DIM + // policy. + // Enum of Bitfields for Windows server notification msgh_id, which is a + // integer_t signed type. + kIOFBNS_Dim = 0x03, + kIOFBNS_UnDim = 0x04, +#endif // !_OPEN_SOURCE_ + + // For Wake messages this field contains the current kIOFBDisplayState as + // returned by attribute 'kIOFBDisplayState' + kIOFBNS_DisplayStateMask = 0x00000f00, + kIOFBNS_DisplayStateShift = 8, + + // Message Generation Count, top-bit i.e. sign-bit is always 0 for normal + // messages, see kIOFBNS_Rendezvous is the only exception and it doesn't + // encode a generation count. + kIOFBNS_GenerationMask = 0x7fff0000, + kIOFBNS_GenerationShift = 16, +}; + +// values for kIOMirrorAttribute +enum { + kIOMirrorIsPrimary = 0x80000000, + kIOMirrorHWClipped = 0x40000000, + kIOMirrorIsMirrored = 0x20000000 +}; + +// values for kIOMirrorDefaultAttribute +enum { + kIOMirrorDefault = 0x00000001, + kIOMirrorForced = 0x00000002 +}; + +//// Display mode timing information + +struct IODetailedTimingInformationV1 { + // from EDID defn + UInt32 pixelClock; // Hertz + UInt32 horizontalActive; // pixels + UInt32 horizontalBlanking; // pixels + UInt32 horizontalBorder; // pixels + UInt32 horizontalSyncOffset; // pixels + UInt32 horizontalSyncWidth; // pixels + UInt32 verticalActive; // lines + UInt32 verticalBlanking; // lines + UInt32 verticalBorder; // lines + UInt32 verticalSyncOffset; // lines + UInt32 verticalSyncWidth; // lines +}; +typedef struct IODetailedTimingInformationV1 IODetailedTimingInformationV1; + +/*! + * @struct IODetailedTimingInformationV2 + * @abstract A structure defining the detailed timing information of a display mode. + * @discussion This structure is used by IOFramebuffer to define detailed timing information for a display mode. The VESA EDID document has more information. + * @field __reservedA Set to zero. + * @field horizontalScaledInset If the mode is scaled, sets the number of active pixels to remove the left and right edges in order to display an underscanned image. + * @field verticalScaledInset If the mode is scaled, sets the number of active lines to remove the top and bottom edges in order to display an underscanned image. + * @field scalerFlags If the mode is scaled, + * kIOScaleStretchToFit may be set to allow stretching. + * kIOScaleRotateFlags is mask which may have the value given by kIOScaleRotate90, kIOScaleRotate180, kIOScaleRotate270 to display a rotated framebuffer. + * @field horizontalScaled If the mode is scaled, sets the size of the image before scaling or rotation. + * @field verticalScaled If the mode is scaled, sets the size of the image before scaling or rotation. + * @field signalConfig + * kIOAnalogSetupExpected set if display expects a blank-to-black setup or pedestal. See VESA signal standards.
+ * kIOInterlacedCEATiming set for a CEA style interlaced timing:
+ * Field 1 vertical blanking = half specified vertical blanking lines.
+ * Field 2 vertical blanking = (half vertical blanking lines) + 1 line.
+ * Field 1 vertical offset = half specified vertical sync offset.
+ * Field 2 vertical offset = (half specified vertical sync offset) + 0.5 lines.
+ * @field signalLevels One of:
+ * kIOAnalogSignalLevel_0700_0300 0.700 - 0.300 V p-p.
+ * kIOAnalogSignalLevel_0714_0286 0.714 - 0.286 V p-p.
+ * kIOAnalogSignalLevel_1000_0400 1.000 - 0.400 V p-p.
+ * kIOAnalogSignalLevel_0700_0000 0.700 - 0.000 V p-p.
+ * @field pixelClock Pixel clock frequency in Hz. + * @field minPixelClock Minimum pixel clock frequency in Hz, with error. + * @field maxPixelClock Maximum pixel clock frequency in Hz, with error. + * @field horizontalActive Pixel clocks per line. + * @field horizontalBlanking Blanking clocks per line. + * @field horizontalSyncOffset First clock of horizontal sync. + * @field horizontalSyncPulseWidth Width of horizontal sync. + * @field verticalActive Number of lines per frame. + * @field verticalBlanking Blanking lines per frame. + * @field verticalSyncOffset First line of vertical sync. + * @field verticalSyncPulseWidth Height of vertical sync. + * @field horizontalBorderLeft Number of pixels in left horizontal border. + * @field horizontalBorderRight Number of pixels in right horizontal border. + * @field verticalBorderTop Number of lines in top vertical border. + * @field verticalBorderBottom Number of lines in bottom vertical border. + * @field horizontalSyncConfig kIOSyncPositivePolarity for positive polarity horizontal sync (0 for negative). + * @field horizontalSyncLevel Zero. + * @field verticalSyncConfig kIOSyncPositivePolarity for positive polarity vertical sync (0 for negative). + * @field verticalSyncLevel Zero. + * @field numLinks number of links to be used by a dual link timing, if zero, assume one link. + * @field verticalBlankingExtension maximum number of blanking extension lines that is available. (0 for none). + * @field pixelEncoding 2017 Timing Features - ERS 2-58 (6.3.1) + * @field bitsPerColorComponent 2017 Timing Features - ERS 2-58 (6.3.1) + * @field colorimetry 2017 Timing Features - ERS 2-58 (6.3.1) + * @field dynamicRange 2017 Timing Features - ERS 2-58 (6.3.1) + * @field dscCompressedBitsPerPixel 2018 Timing Features - ERS 2-63 (6.3.1) + * @field dscSliceHeight 2018 Timing Features - ERS 2-63 (6.3.1) + * @field dscSliceWidth 2018 Timing Features - ERS 2-63 (6.3.1) + * @field __reservedB Reserved set to zero. + */ + +struct IODetailedTimingInformationV2 { + + UInt32 __reservedA[3]; // Init to 0 + UInt32 horizontalScaledInset; // pixels + UInt32 verticalScaledInset; // lines + + UInt32 scalerFlags; + UInt32 horizontalScaled; + UInt32 verticalScaled; + + UInt32 signalConfig; + UInt32 signalLevels; + + UInt64 pixelClock; // Hz + + UInt64 minPixelClock; // Hz - With error what is slowest actual clock + UInt64 maxPixelClock; // Hz - With error what is fasted actual clock + + UInt32 horizontalActive; // pixels + UInt32 horizontalBlanking; // pixels + UInt32 horizontalSyncOffset; // pixels + UInt32 horizontalSyncPulseWidth; // pixels + + UInt32 verticalActive; // lines + UInt32 verticalBlanking; // lines + UInt32 verticalSyncOffset; // lines + UInt32 verticalSyncPulseWidth; // lines + + UInt32 horizontalBorderLeft; // pixels + UInt32 horizontalBorderRight; // pixels + UInt32 verticalBorderTop; // lines + UInt32 verticalBorderBottom; // lines + + UInt32 horizontalSyncConfig; + UInt32 horizontalSyncLevel; // Future use (init to 0) + UInt32 verticalSyncConfig; + UInt32 verticalSyncLevel; // Future use (init to 0) + UInt32 numLinks; + + UInt32 verticalBlankingExtension; // lines (AdaptiveSync: 0 for non-AdaptiveSync support) + + UInt16 pixelEncoding; + UInt16 bitsPerColorComponent; + UInt16 colorimetry; + UInt16 dynamicRange; + + UInt16 dscCompressedBitsPerPixel; + UInt16 dscSliceHeight; + UInt16 dscSliceWidth; + UInt16 __reservedB[5]; // Init to 0 +}; +typedef struct IODetailedTimingInformationV2 IODetailedTimingInformationV2; +typedef struct IODetailedTimingInformationV2 IODetailedTimingInformation; + +struct IOTimingInformation { + IOAppleTimingID appleTimingID; // kIOTimingIDXXX const + UInt32 flags; + union { + IODetailedTimingInformationV1 v1; + IODetailedTimingInformationV2 v2; + } detailedInfo; +}; +typedef struct IOTimingInformation IOTimingInformation; + +enum { + // IOTimingInformation flags + kIODetailedTimingValid = 0x80000000, + kIOScalingInfoValid = 0x40000000 +}; + +enum { + // scalerFlags + kIOScaleStretchToFit = 0x00000001, + + kIOScaleRotateFlags = 0x000000f0, + + kIOScaleSwapAxes = 0x00000010, + kIOScaleInvertX = 0x00000020, + kIOScaleInvertY = 0x00000040, + + kIOScaleRotate0 = 0x00000000, + kIOScaleRotate90 = kIOScaleSwapAxes | kIOScaleInvertX, + kIOScaleRotate180 = kIOScaleInvertX | kIOScaleInvertY, + kIOScaleRotate270 = kIOScaleSwapAxes | kIOScaleInvertY +}; + +enum { + kIOPixelEncodingNotSupported = 0x0000, + kIOPixelEncodingRGB444 = 0x0001, + kIOPixelEncodingYCbCr444 = 0x0002, + kIOPixelEncodingYCbCr422 = 0x0004, + kIOPixelEncodingYCbCr420 = 0x0008 +}; + +enum { + kIOBitsPerColorComponentNotSupported = 0x0000, + kIOBitsPerColorComponent6 = 0x0001, + kIOBitsPerColorComponent8 = 0x0002, + kIOBitsPerColorComponent10 = 0x0004, + kIOBitsPerColorComponent12 = 0x0008, + kIOBitsPerColorComponent16 = 0x0010 +}; + +enum { + kIOColorimetryNotSupported = 0x0000, + kIOColorimetryNativeRGB = 0x0001, + kIOColorimetrysRGB = 0x0002, + kIOColorimetryDCIP3 = 0x0004, + kIOColorimetryAdobeRGB = 0x0008, + kIOColorimetryxvYCC = 0x0010, + kIOColorimetryWGRGB = 0x0020, + kIOColorimetryBT601 = 0x0040, + kIOColorimetryBT709 = 0x0080, + kIOColorimetryBT2020 = 0x0100, + kIOColorimetryBT2100 = 0x0200 +}; + +enum { + kIODynamicRangeNotSupported = 0x0000, + kIODynamicRangeSDR = 0x0001, + kIODynamicRangeHDR10 = 0x0002, + kIODynamicRangeDolbyNormalMode = 0x0004, + kIODynamicRangeDolbyTunnelMode = 0x0008, + kIODynamicRangeTraditionalGammaHDR = 0x0010 +}; + +#pragma pack(push, 4) +struct IOFBDisplayModeDescription { + IODisplayModeInformation info; + IOTimingInformation timingInfo; +}; +typedef struct IOFBDisplayModeDescription IOFBDisplayModeDescription; +#pragma pack(pop) + +/*! + * @struct IODisplayTimingRangeV1 + * @abstract A structure defining the limits and attributes of a display or framebuffer. + * @discussion This structure is used to define the limits for modes programmed as detailed timings by the OS. The VESA EDID is useful background information for many of these fields. A data property with this structure under the key kIOFBTimingRangeKey in a framebuffer will allow the OS to program detailed timings that fall within its range. + * @field __reservedA Set to zero. + * @field version Set to zero. + * @field __reservedB Set to zero. + * @field minPixelClock minimum pixel clock frequency in range, in Hz. + * @field minPixelClock maximum pixel clock frequency in range, in Hz. + * @field maxPixelError largest variation between specified and actual pixel clock frequency, in Hz. + * @field supportedSyncFlags mask of supported sync attributes. The following are defined:
+ * kIORangeSupportsSeparateSyncs - digital separate syncs.
+ * kIORangeSupportsSyncOnGreen - sync on green.
+ * kIORangeSupportsCompositeSync - composite sync.
+ * kIORangeSupportsVSyncSerration - vertical sync has serration and equalization pulses.
+ * @field supportedSignalLevels mask of possible signal levels. The following are defined:
+ * kIORangeSupportsSignal_0700_0300 0.700 - 0.300 V p-p.
+ * kIORangeSupportsSignal_0714_0286 0.714 - 0.286 V p-p.
+ * kIORangeSupportsSignal_1000_0400 1.000 - 0.400 V p-p.
+ * kIORangeSupportsSignal_0700_0000 0.700 - 0.000 V p-p.
+ * @field supportedSignalConfigs mask of possible signal configurations. The following are defined:
+ * kIORangeSupportsInterlacedCEATiming Supports CEA style interlaced timing:
+ * Field 1 vertical blanking = specified vertical blanking lines.
+ * Field 2 vertical blanking = vertical blanking lines + 1 line.
+ * Field 1 vertical offset = specified vertical sync offset.
+ * Field 2 vertical offset = specified vertical sync offset + 0.5 lines.
+ * kIORangeSupportsInterlacedCEATimingWithConfirm Supports CEA style interlaced timing, but require a confirm. + * @field minFrameRate minimum frame rate (vertical refresh frequency) in range, in Hz. + * @field maxFrameRate maximum frame rate (vertical refresh frequency) in range, in Hz. + * @field minLineRate minimum line rate (horizontal refresh frequency) in range, in Hz. + * @field maxLineRate maximum line rate (horizontal refresh frequency) in range, in Hz. + * @field maxHorizontalTotal maximum clocks in horizontal line (active + blanking). + * @field maxVerticalTotal maximum lines in vertical frame (active + blanking). + * @field __reservedD Set to zero. + * @field charSizeHorizontalActive horizontalActive must be a multiple of charSizeHorizontalActive. + * @field charSizeHorizontalBlanking horizontalBlanking must be a multiple of charSizeHorizontalBlanking. + * @field charSizeHorizontalSyncOffset horizontalSyncOffset must be a multiple of charSizeHorizontalSyncOffset. + * @field charSizeHorizontalSyncPulse horizontalSyncPulse must be a multiple of charSizeHorizontalSyncPulse. + * @field charSizeVerticalActive verticalActive must be a multiple of charSizeVerticalActive. + * @field charSizeVerticalBlanking verticalBlanking must be a multiple of charSizeVerticalBlanking. + * @field charSizeVerticalSyncOffset verticalSyncOffset must be a multiple of charSizeVerticalSyncOffset. + * @field charSizeVerticalSyncPulse verticalSyncPulse must be a multiple of charSizeVerticalSyncPulse. + * @field charSizeHorizontalBorderLeft horizontalBorderLeft must be a multiple of charSizeHorizontalBorderLeft. + * @field charSizeHorizontalBorderRight horizontalBorderRight must be a multiple of charSizeHorizontalBorderRight. + * @field charSizeVerticalBorderTop verticalBorderTop must be a multiple of charSizeVerticalBorderTop. + * @field charSizeVerticalBorderBottom verticalBorderBottom must be a multiple of charSizeVerticalBorderBottom. + * @field charSizeHorizontalTotal (horizontalActive + horizontalBlanking) must be a multiple of charSizeHorizontalTotal. + * @field charSizeVerticalTotal (verticalActive + verticalBlanking) must be a multiple of charSizeVerticalTotal. + * @field __reservedE Set to zero. + * @field minHorizontalActiveClocks minimum value of horizontalActive. + * @field maxHorizontalActiveClocks maximum value of horizontalActive. + * @field minHorizontalBlankingClocks minimum value of horizontalBlanking. + * @field maxHorizontalBlankingClocks maximum value of horizontalBlanking. + * @field minHorizontalSyncOffsetClocks minimum value of horizontalSyncOffset. + * @field maxHorizontalSyncOffsetClocks maximum value of horizontalSyncOffset. + * @field minHorizontalPulseWidthClocks minimum value of horizontalPulseWidth. + * @field maxHorizontalPulseWidthClocks maximum value of horizontalPulseWidth. + * @field minVerticalActiveClocks minimum value of verticalActive. + * @field maxVerticalActiveClocks maximum value of verticalActive. + * @field minVerticalBlankingClocks minimum value of verticalBlanking. + * @field maxVerticalBlankingClocks maximum value of verticalBlanking. + * @field minVerticalSyncOffsetClocks minimum value of verticalSyncOffset. + * @field maxVerticalSyncOffsetClocks maximum value of verticalSyncOffset. + * @field minVerticalPulseWidthClocks minimum value of verticalPulseWidth. + * @field maxVerticalPulseWidthClocks maximum value of verticalPulseWidth. + * @field minHorizontalBorderLeft minimum value of horizontalBorderLeft. + * @field maxHorizontalBorderLeft maximum value of horizontalBorderLeft. + * @field minHorizontalBorderRight minimum value of horizontalBorderRight. + * @field maxHorizontalBorderRight maximum value of horizontalBorderRight. + * @field minVerticalBorderTop minimum value of verticalBorderTop. + * @field maxVerticalBorderTop maximum value of verticalBorderTop. + * @field minVerticalBorderBottom minimum value of verticalBorderBottom. + * @field maxVerticalBorderBottom maximum value of verticalBorderBottom. + * @field maxNumLinks number of links supported, if zero, 1 link is assumed. + * @field minLink0PixelClock minimum pixel clock for link 0 (kHz). + * @field maxLink0PixelClock maximum pixel clock for link 0 (kHz). + * @field minLink1PixelClock minimum pixel clock for link 1 (kHz). + * @field maxLink1PixelClock maximum pixel clock for link 1 (kHz). + * @field supportedPixelEncoding 2017 Timing Features - ERS 2-58 (6.3.1) + * @field supportedBitsPerColorComponent 2017 Timing Features - ERS 2-58 (6.3.1) + * @field supportedColorimetry 2017 Timing Features - ERS 2-58 (6.3.1) + * @field supportedDynamicRange 2017 Timing Features - ERS 2-58 (6.3.1) + * @field __reservedF Set to zero. + */ + +struct IODisplayTimingRangeV1 +{ + UInt32 __reservedA[2]; // Init to 0 + UInt32 version; // Init to 0 + UInt32 __reservedB[5]; // Init to 0 + + UInt64 minPixelClock; // Min dot clock in Hz + UInt64 maxPixelClock; // Max dot clock in Hz + + UInt32 maxPixelError; // Max dot clock error + UInt32 supportedSyncFlags; + UInt32 supportedSignalLevels; + UInt32 supportedSignalConfigs; + + UInt32 minFrameRate; // Hz + UInt32 maxFrameRate; // Hz + UInt32 minLineRate; // Hz + UInt32 maxLineRate; // Hz + + UInt32 maxHorizontalTotal; // Clocks - Maximum total (active + blanking) + UInt32 maxVerticalTotal; // Clocks - Maximum total (active + blanking) + UInt32 __reservedD[2]; // Init to 0 + + UInt8 charSizeHorizontalActive; + UInt8 charSizeHorizontalBlanking; + UInt8 charSizeHorizontalSyncOffset; + UInt8 charSizeHorizontalSyncPulse; + + UInt8 charSizeVerticalActive; + UInt8 charSizeVerticalBlanking; + UInt8 charSizeVerticalSyncOffset; + UInt8 charSizeVerticalSyncPulse; + + UInt8 charSizeHorizontalBorderLeft; + UInt8 charSizeHorizontalBorderRight; + UInt8 charSizeVerticalBorderTop; + UInt8 charSizeVerticalBorderBottom; + + UInt8 charSizeHorizontalTotal; // Character size for active + blanking + UInt8 charSizeVerticalTotal; // Character size for active + blanking + UInt16 __reservedE; // Reserved (Init to 0) + + UInt32 minHorizontalActiveClocks; + UInt32 maxHorizontalActiveClocks; + UInt32 minHorizontalBlankingClocks; + UInt32 maxHorizontalBlankingClocks; + + UInt32 minHorizontalSyncOffsetClocks; + UInt32 maxHorizontalSyncOffsetClocks; + UInt32 minHorizontalPulseWidthClocks; + UInt32 maxHorizontalPulseWidthClocks; + + UInt32 minVerticalActiveClocks; + UInt32 maxVerticalActiveClocks; + UInt32 minVerticalBlankingClocks; + UInt32 maxVerticalBlankingClocks; + + UInt32 minVerticalSyncOffsetClocks; + UInt32 maxVerticalSyncOffsetClocks; + UInt32 minVerticalPulseWidthClocks; + UInt32 maxVerticalPulseWidthClocks; + + UInt32 minHorizontalBorderLeft; + UInt32 maxHorizontalBorderLeft; + UInt32 minHorizontalBorderRight; + UInt32 maxHorizontalBorderRight; + + UInt32 minVerticalBorderTop; + UInt32 maxVerticalBorderTop; + UInt32 minVerticalBorderBottom; + UInt32 maxVerticalBorderBottom; + UInt32 maxNumLinks; // number of links, if zero, assume link 1 + UInt32 minLink0PixelClock; // min pixel clock for link 0 (kHz) + UInt32 maxLink0PixelClock; // max pixel clock for link 0 (kHz) + UInt32 minLink1PixelClock; // min pixel clock for link 1 (kHz) + UInt32 maxLink1PixelClock; // max pixel clock for link 1 (kHz) + + UInt16 supportedPixelEncoding; + UInt16 supportedBitsPerColorComponent; + UInt16 supportedColorimetryModes; + UInt16 supportedDynamicRangeModes; + + UInt32 __reservedF[1]; // Init to 0 +}; + +typedef struct IODisplayTimingRangeV1 IODisplayTimingRangeV1; +/*! + * @struct IODisplayTimingRangeV2 + * @abstract A structure defining the limits and attributes of DSC capabilities in a framebuffer. + * @discussion This structure is used to define the limits for DSC enabled modes programmed as detailed timings by the OS. The VESA DSC spec is useful background information for many of these fields. + * @field maxBandwidth Maximum permitted bandwidth of the given topology in bits per second. + * @field dscMinSliceHeight Minimum slice Height, in units of line. + * @field dscMaxSliceHeight Maximum slice Height, in units of line. + * @field dscMinSliceWidth Minimum slice width, in units of line. + * @field dscMaxSliceWidth Maximum slice width, in units of line. + * @field dscMinSlicePerLine Minimum slice per Line. + * @field dscMaxSlicePerLine Maximum slice per Line. + * @field dscMinBPC Minimum Bits per component, in units of bits. + * @field dscMaxBPC Maximum Bits per component, in units of bits. + * @field dscMinBPP Minimum target bits/pixel, in bpp. + * @field dscMaxBPP Maximum target bits/pixel, in bpp. + * @field dscVBR VBR mode, 0:disabled 1:enabled. + * @field dscBlockPredEnable DSC BP is user or not, 0: not used, 1: used. + * @field __reservedF Set to zero. + */ +struct IODisplayTimingRangeV2 +{ + UInt32 __reservedA[2]; // Init to 0 + UInt32 version; // Init to 0 + UInt32 __reservedB[5]; // Init to 0 + + UInt64 minPixelClock; // Min dot clock in Hz + UInt64 maxPixelClock; // Max dot clock in Hz + + UInt32 maxPixelError; // Max dot clock error + UInt32 supportedSyncFlags; + UInt32 supportedSignalLevels; + UInt32 supportedSignalConfigs; + + UInt32 minFrameRate; // Hz + UInt32 maxFrameRate; // Hz + UInt32 minLineRate; // Hz + UInt32 maxLineRate; // Hz + + UInt32 maxHorizontalTotal; // Clocks - Maximum total (active + blanking) + UInt32 maxVerticalTotal; // Clocks - Maximum total (active + blanking) + UInt32 __reservedD[2]; // Init to 0 + + UInt8 charSizeHorizontalActive; + UInt8 charSizeHorizontalBlanking; + UInt8 charSizeHorizontalSyncOffset; + UInt8 charSizeHorizontalSyncPulse; + + UInt8 charSizeVerticalActive; + UInt8 charSizeVerticalBlanking; + UInt8 charSizeVerticalSyncOffset; + UInt8 charSizeVerticalSyncPulse; + + UInt8 charSizeHorizontalBorderLeft; + UInt8 charSizeHorizontalBorderRight; + UInt8 charSizeVerticalBorderTop; + UInt8 charSizeVerticalBorderBottom; + + UInt8 charSizeHorizontalTotal; // Character size for active + blanking + UInt8 charSizeVerticalTotal; // Character size for active + blanking + UInt16 __reservedE; // Reserved (Init to 0) + + UInt32 minHorizontalActiveClocks; + UInt32 maxHorizontalActiveClocks; + UInt32 minHorizontalBlankingClocks; + UInt32 maxHorizontalBlankingClocks; + + UInt32 minHorizontalSyncOffsetClocks; + UInt32 maxHorizontalSyncOffsetClocks; + UInt32 minHorizontalPulseWidthClocks; + UInt32 maxHorizontalPulseWidthClocks; + + UInt32 minVerticalActiveClocks; + UInt32 maxVerticalActiveClocks; + UInt32 minVerticalBlankingClocks; + UInt32 maxVerticalBlankingClocks; + + UInt32 minVerticalSyncOffsetClocks; + UInt32 maxVerticalSyncOffsetClocks; + UInt32 minVerticalPulseWidthClocks; + UInt32 maxVerticalPulseWidthClocks; + + UInt32 minHorizontalBorderLeft; + UInt32 maxHorizontalBorderLeft; + UInt32 minHorizontalBorderRight; + UInt32 maxHorizontalBorderRight; + + UInt32 minVerticalBorderTop; + UInt32 maxVerticalBorderTop; + UInt32 minVerticalBorderBottom; + UInt32 maxVerticalBorderBottom; + UInt32 maxNumLinks; // number of links, if zero, assume link 1 + UInt32 minLink0PixelClock; // min pixel clock for link 0 (kHz) + UInt32 maxLink0PixelClock; // max pixel clock for link 0 (kHz) + UInt32 minLink1PixelClock; // min pixel clock for link 1 (kHz) + UInt32 maxLink1PixelClock; // max pixel clock for link 1 (kHz) + + UInt16 supportedPixelEncoding; + UInt16 supportedBitsPerColorComponent; + UInt16 supportedColorimetryModes; + UInt16 supportedDynamicRangeModes; + + UInt32 __reservedF[1]; // Init to 0 + UInt64 maxBandwidth; + UInt32 dscMinSliceHeight; + UInt32 dscMaxSliceHeight; + UInt32 dscMinSliceWidth; + UInt32 dscMaxSliceWidth; + UInt32 dscMinSlicePerLine; + UInt32 dscMaxSlicePerLine; + UInt16 dscMinBPC; + UInt16 dscMaxBPC; + UInt16 dscMinBPP; + UInt16 dscMaxBPP; + UInt8 dscVBR; + UInt8 dscBlockPredEnable; + UInt32 __reservedC[6]; +}; + +typedef struct IODisplayTimingRangeV2 IODisplayTimingRangeV2; + + +typedef struct IODisplayTimingRangeV2 IODisplayTimingRange; + +enum { + // IOTimingRange version + kIOTimingRangeV2 = 0x00000002, + kIOTimingRangeV1 = 0x00000000 +}; + +enum { + // supportedPixelEncoding + kIORangePixelEncodingNotSupported = 0x0000, + kIORangePixelEncodingRGB444 = 0x0001, + kIORangePixelEncodingYCbCr444 = 0x0002, + kIORangePixelEncodingYCbCr422 = 0x0004, + kIORangePixelEncodingYCbCr420 = 0x0008, +}; + +enum { + // supportedBitsPerColorComponent + kIORangeBitsPerColorComponentNotSupported = 0x0000, + kIORangeBitsPerColorComponent6 = 0x0001, + kIORangeBitsPerColorComponent8 = 0x0002, + kIORangeBitsPerColorComponent10 = 0x0004, + kIORangeBitsPerColorComponent12 = 0x0008, + kIORangeBitsPerColorComponent16 = 0x0010, +}; + +enum { + // supportedColorimetry + kIORangeColorimetryNotSupported = 0x0000, + kIORangeColorimetryNativeRGB = 0x0001, + kIORangeColorimetrysRGB = 0x0002, + kIORangeColorimetryDCIP3 = 0x0004, + kIORangeColorimetryAdobeRGB = 0x0008, + kIORangeColorimetryxvYCC = 0x0010, + kIORangeColorimetryWGRGB = 0x0020, + kIORangeColorimetryBT601 = 0x0040, + kIORangeColorimetryBT709 = 0x0080, + kIORangeColorimetryBT2020 = 0x0100, + kIORangeColorimetryBT2100 = 0x0200, +}; + +enum { + // supportedDynamicRange + kIORangeDynamicRangeNotSupported = 0x0000, + kIORangeDynamicRangeSDR = 0x0001, + kIORangeDynamicRangeHDR10 = 0x0002, + kIORangeDynamicRangeDolbyNormalMode = 0x0004, + kIORangeDynamicRangeDolbyTunnelMode = 0x0008, + kIORangeDynamicRangeTraditionalGammaHDR = 0x0010 +}; + +enum { + // supportedSignalLevels + kIORangeSupportsSignal_0700_0300 = 0x00000001, + kIORangeSupportsSignal_0714_0286 = 0x00000002, + kIORangeSupportsSignal_1000_0400 = 0x00000004, + kIORangeSupportsSignal_0700_0000 = 0x00000008 +}; +enum { + // supportedSyncFlags + kIORangeSupportsSeparateSyncs = 0x00000001, + kIORangeSupportsSyncOnGreen = 0x00000002, + kIORangeSupportsCompositeSync = 0x00000004, + kIORangeSupportsVSyncSerration = 0x00000008 +}; +enum { + // supportedSignalConfigs + kIORangeSupportsInterlacedCEATiming = 0x00000004, + kIORangeSupportsInterlacedCEATimingWithConfirm = 0x00000008 +}; + +enum { + // signalConfig + kIODigitalSignal = 0x00000001, + kIOAnalogSetupExpected = 0x00000002, + kIOInterlacedCEATiming = 0x00000004, + kIONTSCTiming = 0x00000008, + kIOPALTiming = 0x00000010, + kIODSCBlockPredEnable = 0x00000020, +}; + +enum { + // signalLevels for analog + kIOAnalogSignalLevel_0700_0300 = 0, + kIOAnalogSignalLevel_0714_0286 = 1, + kIOAnalogSignalLevel_1000_0400 = 2, + kIOAnalogSignalLevel_0700_0000 = 3 +}; + +enum { + // horizontalSyncConfig and verticalSyncConfig + kIOSyncPositivePolarity = 0x00000001 +}; + +/*! + * @struct IODisplayScalerInformation + * @abstract A structure defining the scaling capabilities of a framebuffer. + * @discussion This structure is used to define the limits for modes programmed as detailed timings by the OS. A data property with this structure under the key kIOFBScalerInfoKey in a framebuffer will allow the OS to program detailed timings that are scaled to a displays native resolution. + * @field __reservedA Set to zero. + * @field version Set to zero. + * @field __reservedB Set to zero. + * @field scalerFeatures Mask of scaling features. The following are defined:
+ * kIOScaleStretchOnly If set the framebuffer can only provide stretched scaling with non-square pixels, without borders.
+ * kIOScaleCanUpSamplePixels If set framebuffer can scale up from a smaller number of source pixels to a larger native timing (eg. 640x480 pixels on a 1600x1200 timing).
+ * kIOScaleCanDownSamplePixels If set framebuffer can scale down from a larger number of source pixels to a smaller native timing (eg. 1600x1200 pixels on a 640x480 timing).
+ * kIOScaleCanScaleInterlaced If set framebuffer can scale an interlaced detailed timing.
+ * kIOScaleCanSupportInset If set framebuffer can support scaled modes with non-zero horizontalScaledInset, verticalScaledInset fields.
+ * kIOScaleCanRotate If set framebuffer can support some of the flags in the kIOScaleRotateFlags mask.
+ * kIOScaleCanBorderInsetOnly If set framebuffer can support scaled modes with non-zero horizontalScaledInset, verticalScaledInset fields, but requires the active pixels to be equal in size to the inset area, ie. can do insets with a border versus scaling an image.
+ * @field maxHorizontalPixels Maximum number of horizontal source pixels (horizontalScaled).
+ * @field maxVerticalPixels Maximum number of vertical source pixels (verticalScaled).
+ * @field __reservedC Set to zero. + */ + +struct IODisplayScalerInformation { + UInt32 __reservedA[1]; // Init to 0 + UInt32 version; // Init to 0 + UInt32 __reservedB[2]; // Init to 0 + + IOOptionBits scalerFeatures; + UInt32 maxHorizontalPixels; + UInt32 maxVerticalPixels; + UInt32 __reservedC[5]; // Init to 0 +}; +typedef struct IODisplayScalerInformation IODisplayScalerInformation; + +enum { + /* scalerFeatures */ + kIOScaleStretchOnly = 0x00000001, + kIOScaleCanUpSamplePixels = 0x00000002, + kIOScaleCanDownSamplePixels = 0x00000004, + kIOScaleCanScaleInterlaced = 0x00000008, + kIOScaleCanSupportInset = 0x00000010, + kIOScaleCanRotate = 0x00000020, + kIOScaleCanBorderInsetOnly = 0x00000040 +}; + +//// Connections + +enum { + kOrConnections = 0xffffffe, + kAndConnections = 0xffffffd +}; + +enum { + kConnectionFlags = 'flgs', + kConnectionSyncEnable = 'sync', + kConnectionSyncFlags = 'sycf', + kConnectionSupportsAppleSense = 'asns', + kConnectionSupportsLLDDCSense = 'lddc', + kConnectionSupportsHLDDCSense = 'hddc', + kConnectionEnable = 'enab', + kConnectionCheckEnable = 'cena', + kConnectionProbe = 'prob', + kConnectionIgnore = '\0igr', + kConnectionChanged = 'chng', + kConnectionPower = 'powr', + kConnectionPostWake = 'pwak', + kConnectionDisplayParameterCount = 'pcnt', + kConnectionDisplayParameters = 'parm', + kConnectionOverscan = 'oscn', + kConnectionVideoBest = 'vbst', + + kConnectionRedGammaScale = 'rgsc', + kConnectionGreenGammaScale = 'ggsc', + kConnectionBlueGammaScale = 'bgsc', + kConnectionGammaScale = 'gsc ', + kConnectionFlushParameters = 'flus', + + kConnectionVBLMultiplier = 'vblm', + + kConnectionHandleDisplayPortEvent = 'dpir', + + kConnectionPanelTimingDisable = 'pnlt', + + kConnectionColorMode = 'cyuv', + kConnectionColorModesSupported = 'colr', + kConnectionColorDepthsSupported = ' bpc', + + kConnectionControllerDepthsSupported = '\0grd', + kConnectionControllerColorDepth = '\0dpd', + kConnectionControllerDitherControl = '\0gdc', + + kConnectionDisplayFlags = 'dflg', + + kConnectionEnableAudio = 'aud ', + kConnectionAudioStreaming = 'auds', + + kConnectionStartOfFrameTime = 'soft', // as of IOGRAPHICSTYPES_REV 65 +}; + +// kConnectionFlags values +enum { + kIOConnectionBuiltIn = 0x00000800, + kIOConnectionStereoSync = 0x00008000 +}; + +// kConnectionSyncControl values +enum { + kIOHSyncDisable = 0x00000001, + kIOVSyncDisable = 0x00000002, + kIOCSyncDisable = 0x00000004, + kIONoSeparateSyncControl = 0x00000040, + kIOTriStateSyncs = 0x00000080, + kIOSyncOnBlue = 0x00000008, + kIOSyncOnGreen = 0x00000010, + kIOSyncOnRed = 0x00000020 +}; + +// kConnectionHandleDisplayPortEvent values +enum { + kIODPEventStart = 1, + kIODPEventIdle = 2, + + kIODPEventForceRetrain = 3, + + kIODPEventRemoteControlCommandPending = 256, + kIODPEventAutomatedTestRequest = 257, + kIODPEventContentProtection = 258, + kIODPEventMCCS = 259, + kIODPEventSinkSpecific = 260 +}; + +#define kIODisplayAttributesKey "IODisplayAttributes" + +#define kIODisplaySupportsUnderscanKey "IODisplaySupportsUnderscan" +#define kIODisplaySupportsBasicAudioKey "IODisplaySupportsBasicAudio" +#define kIODisplaySupportsYCbCr444Key "IODisplaySupportsYCbCr444" +#define kIODisplaySupportsYCbCr422Key "IODisplaySupportsYCbCr422" +#define kIODisplaySelectedColorModeKey "cmod" + +enum +{ + kIODisplayColorMode = kConnectionColorMode, +}; + +#if 0 +enum +{ + // kConnectionColorMode attribute + kIODisplayColorModeReserved = 0x00000000, + kIODisplayColorModeRGB = 0x00000001, + kIODisplayColorModeYCbCr422 = 0x00000010, + kIODisplayColorModeYCbCr444 = 0x00000100, + kIODisplayColorModeRGBLimited = 0x00001000, + kIODisplayColorModeAuto = 0x10000000, +}; +#endif + +enum +{ + // kConnectionColorDepthsSupported attribute + kIODisplayRGBColorComponentBitsUnknown = 0x00000000, + kIODisplayRGBColorComponentBits6 = 0x00000001, + kIODisplayRGBColorComponentBits8 = 0x00000002, + kIODisplayRGBColorComponentBits10 = 0x00000004, + kIODisplayRGBColorComponentBits12 = 0x00000008, + kIODisplayRGBColorComponentBits14 = 0x00000010, + kIODisplayRGBColorComponentBits16 = 0x00000020, + + kIODisplayYCbCr444ColorComponentBitsUnknown = 0x00000000, + kIODisplayYCbCr444ColorComponentBits6 = 0x00000100, + kIODisplayYCbCr444ColorComponentBits8 = 0x00000200, + kIODisplayYCbCr444ColorComponentBits10 = 0x00000400, + kIODisplayYCbCr444ColorComponentBits12 = 0x00000800, + kIODisplayYCbCr444ColorComponentBits14 = 0x00001000, + kIODisplayYCbCr444ColorComponentBits16 = 0x00002000, + + kIODisplayYCbCr422ColorComponentBitsUnknown = 0x00000000, + kIODisplayYCbCr422ColorComponentBits6 = 0x00010000, + kIODisplayYCbCr422ColorComponentBits8 = 0x00020000, + kIODisplayYCbCr422ColorComponentBits10 = 0x00040000, + kIODisplayYCbCr422ColorComponentBits12 = 0x00080000, + kIODisplayYCbCr422ColorComponentBits14 = 0x00100000, + kIODisplayYCbCr422ColorComponentBits16 = 0x00200000, +}; + +enum +{ + // kConnectionDitherControl attribute + kIODisplayDitherDisable = 0x00000000, + kIODisplayDitherSpatial = 0x00000001, + kIODisplayDitherTemporal = 0x00000002, + kIODisplayDitherFrameRateControl = 0x00000004, + kIODisplayDitherDefault = 0x00000080, + kIODisplayDitherAll = 0x000000FF, + kIODisplayDitherRGBShift = 0, + kIODisplayDitherYCbCr444Shift = 8, + kIODisplayDitherYCbCr422Shift = 16, +}; + +enum +{ + // kConnectionDisplayFlags attribute + kIODisplayNeedsCEAUnderscan = 0x00000001, +}; + +enum +{ + kIODisplayPowerStateOff = 0, + kIODisplayPowerStateMinUsable = 1, + kIODisplayPowerStateOn = 2, +}; + +#define IO_DISPLAY_CAN_FILL 0x00000040 +#define IO_DISPLAY_CAN_BLIT 0x00000020 + +#define IO_24BPP_TRANSFER_TABLE_SIZE 256 +#define IO_15BPP_TRANSFER_TABLE_SIZE 256 +#define IO_8BPP_TRANSFER_TABLE_SIZE 256 +#define IO_12BPP_TRANSFER_TABLE_SIZE 256 +#define IO_2BPP_TRANSFER_TABLE_SIZE 256 + +#define STDFB_BM256_TO_BM38_MAP_SIZE 256 +#define STDFB_BM38_TO_BM256_MAP_SIZE 256 +#define STDFB_BM38_TO_256_WITH_LOGICAL_SIZE \ + (STDFB_BM38_TO_BM256_MAP_SIZE + (256/sizeof(int))) + +#define STDFB_4BPS_TO_5BPS_MAP_SIZE 16 +#define STDFB_5BPS_TO_4BPS_MAP_SIZE 32 + +enum { + // connection types for IOServiceOpen + kIOFBServerConnectType = 0, + kIOFBSharedConnectType = 1, + kIOGDiagnoseGTraceType = 11452, // On Display Wrangler + kIOGDiagnoseConnectType = 38744, +}; + +enum { + // options for IOServiceRequestProbe() + kIOFBUserRequestProbe = 0x00000001 +}; + +struct IOGPoint { + SInt16 x; + SInt16 y; +}; +typedef struct IOGPoint IOGPoint; + +struct IOGSize { + SInt16 width; + SInt16 height; +}; +typedef struct IOGSize IOGSize; + +struct IOGBounds { + SInt16 minx; + SInt16 maxx; + SInt16 miny; + SInt16 maxy; +}; +typedef struct IOGBounds IOGBounds; + +#ifndef kIODescriptionKey + +#if !defined(__Point__) && !defined(BINTREE_H) && !defined(__MACTYPES__) +#define __Point__ +typedef IOGPoint Point; +#endif + +#if !defined(__Bounds__) && !defined(BINTREE_H) && !defined(__MACTYPES__) +#define __Bounds__ +typedef IOGBounds Bounds; +#endif + +#endif /* !kIODescriptionKey */ + +// cursor description + +enum { + kTransparentEncoding = 0, + kInvertingEncoding +}; + +enum { + kTransparentEncodingShift = (kTransparentEncoding << 1), + kTransparentEncodedPixel = (0x01 << kTransparentEncodingShift), + + kInvertingEncodingShift = (kInvertingEncoding << 1), + kInvertingEncodedPixel = (0x01 << kInvertingEncodingShift) +}; + +enum { + kHardwareCursorDescriptorMajorVersion = 0x0001, + kHardwareCursorDescriptorMinorVersion = 0x0000 +}; + +/*! + * @struct IOHardwareCursorDescriptor + * @abstract A structure defining the format of a hardware cursor. + * @discussion This structure is used by IOFramebuffer to define the format of a hardware cursor. + * @field majorVersion Set to kHardwareCursorDescriptorMajorVersion. + * @field minorVersion Set to kHardwareCursorDescriptorMinorVersion. + * @field height Maximum size of the cursor. + * @field width Maximum size of the cursor. + * @field bitDepth Number bits per pixel, or a QD/QT pixel type, for example kIO8IndexedPixelFormat, kIO32ARGBPixelFormat. + * @field maskBitDepth Unused. + * @field numColors Number of colors for indexed pixel types. + * @field colorEncodings An array pointer specifying the pixel values corresponding to the indices into the color table, for indexed pixel types. + * @field flags None defined, set to zero. + * @field supportedSpecialEncodings Mask of supported special pixel values, eg. kTransparentEncodedPixel, kInvertingEncodedPixel. + * @field specialEncodings Array of pixel values for each supported special encoding. + */ + +struct IOHardwareCursorDescriptor { + UInt16 majorVersion; + UInt16 minorVersion; + UInt32 height; + UInt32 width; + UInt32 bitDepth; // bits per pixel, or a QD/QT pixel type + UInt32 maskBitDepth; // unused + UInt32 numColors; // number of colors in the colorMap. ie. + UInt32 * colorEncodings; + UInt32 flags; + UInt32 supportedSpecialEncodings; + UInt32 specialEncodings[16]; +}; +typedef struct IOHardwareCursorDescriptor IOHardwareCursorDescriptor; + +enum { + kHardwareCursorInfoMajorVersion = 0x0001, + kHardwareCursorInfoMinorVersion = 0x0000 +}; + +/*! + * @struct IOHardwareCursorInfo + * @abstract A structure defining the converted data of a hardware cursor. + * @discussion This structure is used by IOFramebuffer to return the data of a hardware cursor by convertCursorImage() after conversion based on the IOHardwareCursorDescriptor passed to that routine. + * @field majorVersion Set to kHardwareCursorInfoMajorVersion. + * @field minorVersion Set to kHardwareCursorInfoMinorVersion. + * @field cursorHeight The actual size of the cursor is returned. + * @field cursorWidth The actual size of the cursor is returned. + * @field colorMap Pointer to array of IOColorEntry structures, with the number of elements set by the numColors field of the IOHardwareCursorDescriptor. Zero should be passed for direct pixel formats. + * @field hardwareCursorData Buffer to receive the converted cursor data. + * @field cursorHotSpotX Cursor's hotspot. + * @field cursorHotSpotY Cursor's hotspot. + * @field reserved Reserved, set to zero. + */ + +struct IOHardwareCursorInfo { + UInt16 majorVersion; + UInt16 minorVersion; + UInt32 cursorHeight; + UInt32 cursorWidth; + // nil or big enough for hardware's max colors + IOColorEntry * colorMap; + UInt8 * hardwareCursorData; + UInt16 cursorHotSpotX; + UInt16 cursorHotSpotY; + UInt32 reserved[5]; +}; +typedef struct IOHardwareCursorInfo IOHardwareCursorInfo; + +// interrupt types + +enum { + kIOFBVBLInterruptType = 'vbl ', + kIOFBHBLInterruptType = 'hbl ', + kIOFBFrameInterruptType = 'fram', + // Demand to check configuration (Hardware unchanged) + kIOFBConnectInterruptType = 'dci ', + // Demand to rebuild (Hardware has reinitialized on dependent change) + kIOFBChangedInterruptType = 'chng', + // Demand to remove framebuffer (Hardware not available on dependent change -- but must not buserror) + kIOFBOfflineInterruptType = 'remv', + // Notice that hardware is available (after being removed) + kIOFBOnlineInterruptType = 'add ', + // DisplayPort short pulse + kIOFBDisplayPortInterruptType = 'dpir', + // DisplayPort link event + kIOFBDisplayPortLinkChangeInterruptType = 'dplk', + // MCCS + kIOFBMCCSInterruptType = 'mccs', + // early vram notification + kIOFBWakeInterruptType = 'vwak', +}; + +// IOAppleTimingID's +enum { + kIOTimingIDInvalid = 0, /* Not a standard timing */ + kIOTimingIDApple_FixedRateLCD = 42, /* Lump all fixed-rate LCDs into one category.*/ + kIOTimingIDApple_512x384_60hz = 130, /* 512x384 (60 Hz) Rubik timing. */ + kIOTimingIDApple_560x384_60hz = 135, /* 560x384 (60 Hz) Rubik-560 timing. */ + kIOTimingIDApple_640x480_67hz = 140, /* 640x480 (67 Hz) HR timing. */ + kIOTimingIDApple_640x400_67hz = 145, /* 640x400 (67 Hz) HR-400 timing. */ + kIOTimingIDVESA_640x480_60hz = 150, /* 640x480 (60 Hz) VGA timing. */ + kIOTimingIDVESA_640x480_72hz = 152, /* 640x480 (72 Hz) VGA timing. */ + kIOTimingIDVESA_640x480_75hz = 154, /* 640x480 (75 Hz) VGA timing. */ + kIOTimingIDVESA_640x480_85hz = 158, /* 640x480 (85 Hz) VGA timing. */ + kIOTimingIDGTF_640x480_120hz = 159, /* 640x480 (120 Hz) VESA Generalized Timing Formula */ + kIOTimingIDApple_640x870_75hz = 160, /* 640x870 (75 Hz) FPD timing.*/ + kIOTimingIDApple_640x818_75hz = 165, /* 640x818 (75 Hz) FPD-818 timing.*/ + kIOTimingIDApple_832x624_75hz = 170, /* 832x624 (75 Hz) GoldFish timing.*/ + kIOTimingIDVESA_800x600_56hz = 180, /* 800x600 (56 Hz) SVGA timing. */ + kIOTimingIDVESA_800x600_60hz = 182, /* 800x600 (60 Hz) SVGA timing. */ + kIOTimingIDVESA_800x600_72hz = 184, /* 800x600 (72 Hz) SVGA timing. */ + kIOTimingIDVESA_800x600_75hz = 186, /* 800x600 (75 Hz) SVGA timing. */ + kIOTimingIDVESA_800x600_85hz = 188, /* 800x600 (85 Hz) SVGA timing. */ + kIOTimingIDVESA_1024x768_60hz = 190, /* 1024x768 (60 Hz) VESA 1K-60Hz timing. */ + kIOTimingIDVESA_1024x768_70hz = 200, /* 1024x768 (70 Hz) VESA 1K-70Hz timing. */ + kIOTimingIDVESA_1024x768_75hz = 204, /* 1024x768 (75 Hz) VESA 1K-75Hz timing (very similar to kIOTimingIDApple_1024x768_75hz). */ + kIOTimingIDVESA_1024x768_85hz = 208, /* 1024x768 (85 Hz) VESA timing. */ + kIOTimingIDApple_1024x768_75hz = 210, /* 1024x768 (75 Hz) Apple 19" RGB. */ + kIOTimingIDVESA_1152x864_75hz = 215, /* 1152x864 (75 Hz) VESA timing. */ + kIOTimingIDApple_1152x870_75hz = 220, /* 1152x870 (75 Hz) Apple 21" RGB. */ + kIOTimingIDAppleNTSC_ST = 230, /* 512x384 (60 Hz, interlaced, non-convolved). */ + kIOTimingIDAppleNTSC_FF = 232, /* 640x480 (60 Hz, interlaced, non-convolved). */ + kIOTimingIDAppleNTSC_STconv = 234, /* 512x384 (60 Hz, interlaced, convolved). */ + kIOTimingIDAppleNTSC_FFconv = 236, /* 640x480 (60 Hz, interlaced, convolved). */ + kIOTimingIDApplePAL_ST = 238, /* 640x480 (50 Hz, interlaced, non-convolved). */ + kIOTimingIDApplePAL_FF = 240, /* 768x576 (50 Hz, interlaced, non-convolved). */ + kIOTimingIDApplePAL_STconv = 242, /* 640x480 (50 Hz, interlaced, convolved). */ + kIOTimingIDApplePAL_FFconv = 244, /* 768x576 (50 Hz, interlaced, convolved). */ + kIOTimingIDVESA_1280x960_75hz = 250, /* 1280x960 (75 Hz) */ + kIOTimingIDVESA_1280x960_60hz = 252, /* 1280x960 (60 Hz) */ + kIOTimingIDVESA_1280x960_85hz = 254, /* 1280x960 (85 Hz) */ + kIOTimingIDVESA_1280x1024_60hz = 260, /* 1280x1024 (60 Hz) */ + kIOTimingIDVESA_1280x1024_75hz = 262, /* 1280x1024 (75 Hz) */ + kIOTimingIDVESA_1280x1024_85hz = 268, /* 1280x1024 (85 Hz) */ + kIOTimingIDVESA_1600x1200_60hz = 280, /* 1600x1200 (60 Hz) VESA timing. */ + kIOTimingIDVESA_1600x1200_65hz = 282, /* 1600x1200 (65 Hz) VESA timing. */ + kIOTimingIDVESA_1600x1200_70hz = 284, /* 1600x1200 (70 Hz) VESA timing. */ + kIOTimingIDVESA_1600x1200_75hz = 286, /* 1600x1200 (75 Hz) VESA timing (pixel clock is 189.2 Mhz dot clock). */ + kIOTimingIDVESA_1600x1200_80hz = 288, /* 1600x1200 (80 Hz) VESA timing (pixel clock is 216>? Mhz dot clock) - proposed only. */ + kIOTimingIDVESA_1600x1200_85hz = 289, /* 1600x1200 (85 Hz) VESA timing (pixel clock is 229.5 Mhz dot clock). */ + kIOTimingIDVESA_1792x1344_60hz = 296, /* 1792x1344 (60 Hz) VESA timing (204.75 Mhz dot clock). */ + kIOTimingIDVESA_1792x1344_75hz = 298, /* 1792x1344 (75 Hz) VESA timing (261.75 Mhz dot clock). */ + kIOTimingIDVESA_1856x1392_60hz = 300, /* 1856x1392 (60 Hz) VESA timing (218.25 Mhz dot clock). */ + kIOTimingIDVESA_1856x1392_75hz = 302, /* 1856x1392 (75 Hz) VESA timing (288 Mhz dot clock). */ + kIOTimingIDVESA_1920x1440_60hz = 304, /* 1920x1440 (60 Hz) VESA timing (234 Mhz dot clock). */ + kIOTimingIDVESA_1920x1440_75hz = 306, /* 1920x1440 (75 Hz) VESA timing (297 Mhz dot clock). */ + kIOTimingIDSMPTE240M_60hz = 400, /* 60Hz V, 33.75KHz H, interlaced timing, 16:9 aspect, typical resolution of 1920x1035. */ + kIOTimingIDFilmRate_48hz = 410, /* 48Hz V, 25.20KHz H, non-interlaced timing, typical resolution of 640x480. */ + kIOTimingIDSony_1600x1024_76hz = 500, /* 1600x1024 (76 Hz) Sony timing (pixel clock is 170.447 Mhz dot clock). */ + kIOTimingIDSony_1920x1080_60hz = 510, /* 1920x1080 (60 Hz) Sony timing (pixel clock is 159.84 Mhz dot clock). */ + kIOTimingIDSony_1920x1080_72hz = 520, /* 1920x1080 (72 Hz) Sony timing (pixel clock is 216.023 Mhz dot clock). */ + kIOTimingIDSony_1920x1200_76hz = 540, /* 1900x1200 (76 Hz) Sony timing (pixel clock is 243.20 Mhz dot clock). */ + kIOTimingIDApple_0x0_0hz_Offline = 550, /* Indicates that this timing will take the display off-line and remove it from the system. */ + kIOTimingIDVESA_848x480_60hz = 570, /* 848x480 (60 Hz) VESA timing. */ + kIOTimingIDVESA_1360x768_60hz = 590 /* 1360x768 (60 Hz) VESA timing. */ +}; + +// framebuffer property keys + +#define kIOFramebufferInfoKey "IOFramebufferInformation" + +#define kIOFBWidthKey "IOFBWidth" +#define kIOFBHeightKey "IOFBHeight" +#define kIOFBRefreshRateKey "IOFBRefreshRate" +#define kIOFBFlagsKey "IOFBFlags" +#define kIOFBBytesPerRowKey "IOFBBytesPerRow" +#define kIOFBBytesPerPlaneKey "IOFBBytesPerPlane" +#define kIOFBBitsPerPixelKey "IOFBBitsPerPixel" +#define kIOFBComponentCountKey "IOFBComponentCount" +#define kIOFBBitsPerComponentKey "IOFBBitsPerComponent" + +#define kIOFBDetailedTimingsKey "IOFBDetailedTimings" +#define kIOFBTimingRangeKey "IOFBTimingRange" +#define kIOFBScalerInfoKey "IOFBScalerInfo" +#define kIOFBCursorInfoKey "IOFBCursorInfo" +#define kIOFBHDMIDongleROMKey "IOFBHDMIDongleROM" + +#define kIOFBHostAccessFlagsKey "IOFBHostAccessFlags" + +#define kIOFBMemorySizeKey "IOFBMemorySize" + +#define kIOFBNeedsRefreshKey "IOFBNeedsRefresh" + +#define kIOFBProbeOptionsKey "IOFBProbeOptions" + +#define kIOFBGammaWidthKey "IOFBGammaWidth" +#define kIOFBGammaCountKey "IOFBGammaCount" +#define kIOFBCLUTDeferKey "IOFBCLUTDefer" + +#define kIOFBDisplayPortConfigurationDataKey "dpcd-registers" + +// exists on the hibernate progress display device +#ifndef kIOHibernatePreviewActiveKey +#define kIOHibernatePreviewActiveKey "IOHibernatePreviewActive" +// values for kIOHibernatePreviewActiveKey set by driver +enum { + kIOHibernatePreviewActive = 0x00000001, + kIOHibernatePreviewUpdates = 0x00000002 +}; +#endif + +#define kIOHibernateEFIGfxStatusKey "IOHibernateEFIGfxStatus" + +// CFNumber/CFData +#define kIOFBAVSignalTypeKey "av-signal-type" +enum { + kIOFBAVSignalTypeUnknown = 0x00000000, + kIOFBAVSignalTypeVGA = 0x00000001, + kIOFBAVSignalTypeDVI = 0x00000002, + kIOFBAVSignalTypeHDMI = 0x00000008, + kIOFBAVSignalTypeDP = 0x00000010, +}; + +// kIOFBDisplayPortTrainingAttribute data + +struct IOFBDPLinkConfig +{ + uint16_t version; // 8 bit high (major); 8 bit low (minor) + uint8_t bitRate; // same encoding as the spec + uint8_t __reservedA[1]; // reserved set to zero + uint16_t t1Time; // minimum duration of the t1 pattern (microseconds) + uint16_t t2Time; // minimum duration of the t2 pattern + uint16_t t3Time; // minimum duration of the t3 pattern + uint8_t idlePatterns; // minimum number of idle patterns + uint8_t laneCount; // number of lanes in the link + uint8_t voltage; + uint8_t preEmphasis; + uint8_t downspread; + uint8_t scrambler; + uint8_t maxBitRate; // same encoding as the bitRate field + uint8_t maxLaneCount; // an integer + uint8_t maxDownspread; // 0 = Off. 1 = 0.5 + uint8_t __reservedB[9]; // reserved set to zero - fix align and provide 8 bytes of padding. +}; +typedef struct IOFBDPLinkConfig IOFBDPLinkConfig; + +enum +{ + kIOFBBitRateRBR = 0x06, // 1.62 Gbps per lane + kIOFBBitRateHBR = 0x0A, // 2.70 Gbps per lane + kIOFBBitRateHBR2 = 0x14, // 5.40 Gbps per lane +}; + +enum { + kIOFBLinkVoltageLevel0 = 0x00, + kIOFBLinkVoltageLevel1 = 0x01, + kIOFBLinkVoltageLevel2 = 0x02, + kIOFBLinkVoltageLevel3 = 0x03 +}; + +enum +{ + kIOFBLinkPreEmphasisLevel0 = 0x00, + kIOFBLinkPreEmphasisLevel1 = 0x01, + kIOFBLinkPreEmphasisLevel2 = 0x02, + kIOFBLinkPreEmphasisLevel3 = 0x03 +}; + +enum +{ + kIOFBLinkDownspreadNone = 0x0, + kIOFBLinkDownspreadMax = 0x1 +}; + +enum +{ + kIOFBLinkScramblerNormal = 0x0, // for external displays + kIOFBLinkScramblerAlternate = 0x1 // used for eDP +}; + +// diagnostic keys + +#define kIOFBConfigKey "IOFBConfig" +#define kIOFBModesKey "IOFBModes" +#define kIOFBModeIDKey "ID" +#define kIOFBModeDMKey "DM" +#define kIOFBModeTMKey "TM" +#define kIOFBModeAIDKey "AID" +#define kIOFBModeDFKey "DF" +#define kIOFBModePIKey "PI" + +// display property keys + +#define kIODisplayEDIDKey "IODisplayEDID" +#define kIODisplayEDIDOriginalKey "IODisplayEDIDOriginal" +#define kIODisplayLocationKey "IODisplayLocation" // CFString +#define kIODisplayConnectFlagsKey "IODisplayConnectFlags" // CFNumber +#define kIODisplayHasBacklightKey "IODisplayHasBacklight" // CFBoolean +#define kIODisplayIsDigitalKey "IODisplayIsDigital" // CFBoolean +#define kDisplayBundleKey "DisplayBundle" + +#define kAppleDisplayTypeKey "AppleDisplayType" +#define kAppleSenseKey "AppleSense" + +#define kIODisplayMCCSVersionKey "IODisplayMCCSVersion" +#define kIODisplayTechnologyTypeKey "IODisplayTechnologyType" +#define kIODisplayUsageTimeKey "IODisplayUsageTime" +#define kIODisplayFirmwareLevelKey "IODisplayFirmwareLevel" + +enum { + kDisplayVendorIDUnknown = 'unkn', + kDisplayProductIDGeneric = 0x717 +}; + +#define kDisplayVendorID "DisplayVendorID" // CFNumber +#define kDisplayProductID "DisplayProductID" // CFNumber +#define kDisplaySerialNumber "DisplaySerialNumber" // CFNumber +#define kDisplaySerialString "DisplaySerialString" // CFString +#define kDisplayWeekOfManufacture "DisplayWeekManufacture" // CFNumber +#define kDisplayYearOfManufacture "DisplayYearManufacture" // CFNumber + +// CFDictionary of language-locale keys, name values +// eg. "en"="Color LCD", "en-GB"="Colour LCD" +#define kDisplayProductName "DisplayProductName" + +// all CFNumber or CFArray of CFNumber (floats) +#define kDisplayWhitePointX "DisplayWhitePointX" +#define kDisplayWhitePointY "DisplayWhitePointY" +#define kDisplayRedPointX "DisplayRedPointX" +#define kDisplayRedPointY "DisplayRedPointY" +#define kDisplayGreenPointX "DisplayGreenPointX" +#define kDisplayGreenPointY "DisplayGreenPointY" +#define kDisplayBluePointX "DisplayBluePointX" +#define kDisplayBluePointY "DisplayBluePointY" +#define kDisplayWhiteGamma "DisplayWhiteGamma" +#define kDisplayRedGamma "DisplayRedGamma" +#define kDisplayGreenGamma "DisplayGreenGamma" +#define kDisplayBlueGamma "DisplayBlueGamma" + +// Display gamma +#define kDisplayGammaChannels "DisplayGammaChannels" // CFNumber 1 or 3 channel count +#define kDisplayGammaEntryCount "DisplayGammaEntryCount" // CFNumber 1-based count of entries per channel +#define kDisplayGammaEntrySize "DisplayGammaEntrySize" // CFNumber size in bytes of each table entry +#define kDisplayGammaTable "DisplayGammaTable" // CFData + +// CFBoolean +#define kDisplayBrightnessAffectsGamma "DisplayBrightnessAffectsGamma" +#define kDisplayViewAngleAffectsGamma "DisplayViewAngleAffectsGamma" + +// CFData +#define kDisplayCSProfile "DisplayCSProfile" + +// CFNumber +#define kDisplayHorizontalImageSize "DisplayHorizontalImageSize" +#define kDisplayVerticalImageSize "DisplayVerticalImageSize" + +// Pixel description + +// CFBoolean +#define kDisplayFixedPixelFormat "DisplayFixedPixelFormat" + +enum { + kDisplaySubPixelLayoutUndefined = 0x00000000, + kDisplaySubPixelLayoutRGB = 0x00000001, + kDisplaySubPixelLayoutBGR = 0x00000002, + kDisplaySubPixelLayoutQuadGBL = 0x00000003, + kDisplaySubPixelLayoutQuadGBR = 0x00000004, + + kDisplaySubPixelConfigurationUndefined = 0x00000000, + kDisplaySubPixelConfigurationDelta = 0x00000001, + kDisplaySubPixelConfigurationStripe = 0x00000002, + kDisplaySubPixelConfigurationStripeOffset = 0x00000003, + kDisplaySubPixelConfigurationQuad = 0x00000004, + + kDisplaySubPixelShapeUndefined = 0x00000000, + kDisplaySubPixelShapeRound = 0x00000001, + kDisplaySubPixelShapeSquare = 0x00000002, + kDisplaySubPixelShapeRectangular = 0x00000003, + kDisplaySubPixelShapeOval = 0x00000004, + kDisplaySubPixelShapeElliptical = 0x00000005 +}; + +// CFNumbers +#define kDisplaySubPixelLayout "DisplaySubPixelLayout" +#define kDisplaySubPixelConfiguration "DisplaySubPixelConfiguration" +#define kDisplaySubPixelShape "DisplaySubPixelShape" + +#define kIODisplayOverrideMatchingKey "IODisplayOverrideMatching" + +// Display parameters + +#define kIODisplayParametersKey "IODisplayParameters" +#define kIODisplayGUIDKey "IODisplayGUID" + +#define kIODisplayValueKey "value" +#define kIODisplayMinValueKey "min" +#define kIODisplayMaxValueKey "max" + +#define kIODisplayBrightnessProbeKey "brightness-probe" +#define kIODisplayLinearBrightnessProbeKey "linear-brightness-probe" +#define kIODisplayBrightnessKey "brightness" +#define kIODisplayLinearBrightnessKey "linear-brightness" +#define kIODisplayUsableLinearBrightnessKey "usable-linear-brightness" +#define kIODisplayBrightnessFadeKey "brightness-fade" +#define kIODisplayContrastKey "contrast" +#define kIODisplayHorizontalPositionKey "horizontal-position" +#define kIODisplayHorizontalSizeKey "horizontal-size" +#define kIODisplayVerticalPositionKey "vertical-position" +#define kIODisplayVerticalSizeKey "vertical-size" +#define kIODisplayTrapezoidKey "trapezoid" +#define kIODisplayPincushionKey "pincushion" +#define kIODisplayParallelogramKey "parallelogram" +#define kIODisplayRotationKey "rotation" +#define kIODisplayTheatreModeKey "theatre-mode" +#define kIODisplayTheatreModeWindowKey "theatre-mode-window" +#define kIODisplayOverscanKey "oscn" +#define kIODisplayVideoBestKey "vbst" + +#define kIODisplaySpeakerVolumeKey "speaker-volume" +#define kIODisplaySpeakerSelectKey "speaker-select" +#define kIODisplayMicrophoneVolumeKey "microphone-volume" +#define kIODisplayAmbientLightSensorKey "ambient-light-sensor" +#define kIODisplayAudioMuteAndScreenBlankKey "audio-mute-and-screen-blank" +#define kIODisplayAudioTrebleKey "audio-treble" +#define kIODisplayAudioBassKey "audio-bass" +#define kIODisplayAudioBalanceLRKey "audio-balance-LR" +#define kIODisplayAudioProcessorModeKey "audio-processor-mode" +#define kIODisplayPowerModeKey "power-mode" +#define kIODisplayManufacturerSpecificKey "manufacturer-specific" + +#define kIODisplayPowerStateKey "dsyp" + +#define kIODisplayControllerIDKey "IODisplayControllerID" +#define kIODisplayCapabilityStringKey "IODisplayCapabilityString" + +#define kIODisplayRedGammaScaleKey "rgsc" +#define kIODisplayGreenGammaScaleKey "ggsc" +#define kIODisplayBlueGammaScaleKey "bgsc" +#define kIODisplayGammaScaleKey "gsc " + +#define kIODisplayParametersCommitKey "commit" +#define kIODisplayParametersDefaultKey "defaults" +#define kIODisplayParametersFlushKey "flush" + +#ifdef __cplusplus +} +#endif + +#endif /* ! _IOKIT_IOGRAPHICSTYPES_H */ diff --git a/QualcommWireless/include/IOKit/graphics/tl/_config b/QualcommWireless/include/IOKit/graphics/tl/_config new file mode 100644 index 0000000..b1a05dc --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/tl/_config @@ -0,0 +1,38 @@ +/* vim: set ft=cpp: + * + * Copyright (c) 2018- Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +// No need for versioning yet, no binary compatibilty is really provided by C++ +// anyway. But if the IOG template library becomes part of IOKit we should add +// an inlined versioned namespace. + +#ifndef IOG_TL__CONFIG +#define IOG_TL__CONFIG + +#define _IOG_START_NAMESPACE namespace iog { +#define _IOG_END_NAMESPACE } +#define _VIOG iog + +namespace iog { +} + +#endif // !IOG_TL__CONFIG diff --git a/QualcommWireless/include/IOKit/graphics/tl/iolocks b/QualcommWireless/include/IOKit/graphics/tl/iolocks new file mode 100644 index 0000000..898975d --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/tl/iolocks @@ -0,0 +1,123 @@ +/* vim: set ft=cpp: + * + * Copyright (c) 2018- Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +// Since IOKit doesn't support stl for good reason, we would like to +// cherry-pick the more useful c++11 and after templates + +#ifndef IOG_TL_IOLOCKS +#define IOG_TL_IOLOCKS + +#include <_config> + +#include +#include + +_IOG_START_NAMESPACE + +// Declare a special type of IOSimpleLock that indicates interrupt blocking +struct IOSimpleLockInterrupt {}; +inline IOSimpleLock* IOSimpleLockCastOperator(IOSimpleLockInterrupt *sli) + { return reinterpret_cast(sli); } +inline IOSimpleLockInterrupt* IOSimpleLockInterruptAlloc() + { return reinterpret_cast(IOSimpleLockAlloc()); } +inline void IOSimpleLockInterruptFree(IOSimpleLockInterrupt* sli) + { return IOSimpleLockFree(IOSimpleLockCastOperator(sli)); } + +namespace locking_primitives { +// Take locks +inline IOInterruptState lock(IOLock* l) + { IOLockLock(l); return 0; } +inline IOInterruptState lock(IORecursiveLock* l) + { IORecursiveLockLock(l); return 0; } +inline IOInterruptState lock(IOSimpleLock* l) + { IOSimpleLockLock(l); return 0; } +inline IOInterruptState lock(IOSimpleLockInterrupt* sli) +{ + auto *sl = reinterpret_cast(sli); + return IOSimpleLockLockDisableInterrupt(sl); +} + +// Release locks +inline void unlock(IOLock* l, IOInterruptState) + { IOLockUnlock(l); } +inline void unlock(IORecursiveLock* l, IOInterruptState) + { IORecursiveLockUnlock(l); } +inline void unlock(IOSimpleLock* l, IOInterruptState) + { IOSimpleLockUnlock(l); } +inline void unlock(IOSimpleLockInterrupt* sli, IOInterruptState is) +{ + auto *sl = reinterpret_cast(sli); + IOSimpleLockUnlockEnableInterrupt(sl, is); +} + +// Lock assertions +// TODO(gvdl): Hack alert, for some reason IOLocks.h doesn't publish the +// assertions out of XNU_KERNEL_PRIVATE. Until it is published I have copy and +// pasted the implementaiton, radar to follow. +inline void assertLocked(IOLock* l) + { LCK_MTX_ASSERT(static_cast(l), LCK_ASSERT_OWNED); } +inline void assertLocked(IORecursiveLock* l) + { assert(IORecursiveLockHaveLock(l)); } +inline void assertLocked(IOSimpleLock* l) + { LCK_SPIN_ASSERT(static_cast(l), LCK_ASSERT_OWNED); } +inline void assertLocked(IOSimpleLockInterrupt* l) + { LCK_SPIN_ASSERT(reinterpret_cast(l), LCK_ASSERT_OWNED); } + +inline void assertUnlocked(IOLock* l) + { LCK_MTX_ASSERT(static_cast(l), LCK_ASSERT_NOTOWNED); } +inline void assertUnlocked(IORecursiveLock* l) + { assert(!IORecursiveLockHaveLock(l)); } +inline void assertUnlocked(IOSimpleLock* l) + { LCK_SPIN_ASSERT(static_cast(l), LCK_ASSERT_NOTOWNED); } +inline void assertUnlocked(IOSimpleLockInterrupt* l) + { LCK_SPIN_ASSERT(reinterpret_cast(l), LCK_ASSERT_NOTOWNED); } +}; // namespace locking_primitives + +// LockGuard works as is with IOLock, IORecursiveLock, IOSimpleLock and the +// above IOSimpleLockInterrupt (which disables interrupts too). +template +class LockGuard { +public: + LockGuard() = delete; + LockGuard(const LockGuard&) = delete; + LockGuard& operator=(const LockGuard&) = delete; + LockGuard& operator=(LockGuard&& other) = delete; + + explicit LockGuard(_L* lock) : fLock(lock) + { + fMostlyUnusedInterruptState = locking_primitives::lock(fLock); + } + ~LockGuard() + { + if (static_cast(fLock)) + locking_primitives::unlock(fLock, fMostlyUnusedInterruptState); + } + LockGuard(LockGuard&& other) : fLock(other.fLock) { other.fLock = 0; } +private: + _L* fLock = nullptr; + IOInterruptState fMostlyUnusedInterruptState = 0; +}; + +_IOG_END_NAMESPACE + +#endif // !IOG_TL_IOLOCKS diff --git a/QualcommWireless/include/IOKit/graphics/tl/osmemory b/QualcommWireless/include/IOKit/graphics/tl/osmemory new file mode 100644 index 0000000..1b486a4 --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/tl/osmemory @@ -0,0 +1,538 @@ +/* vim: set ft=cpp: + * + * Copyright (c) 2018- Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +// Since IOKit doesn't support stl for good reason, we would like to +// cherry-pick the more useful c++11 and after template. In particular the +// smart pointer stuff. This file is an OSObject specialization of +// std::unique_ptr, std::shared_ptr and std::weak_ptr + +#ifndef IOG_TL_OSMEMORY +#define IOG_TL_OSMEMORY + +#if KERNEL +#include +#include +#else +#include +#endif + +#include <_config> +#include + +#include + +#include + +_IOG_START_NAMESPACE + +template class OSUniqueObject; +template class OSSharedObject; +template class OSWeakObject; + +// std::unique_ptr equivalent +template +class OSUniqueObject +{ +public: + using pointer = _T*; + using element_type = _T; + +private: + pointer fTypedObj = nullptr; + + template friend class OSSharedObject; + + void impl_release() + { + OSSafeReleaseNULL(fTypedObj); + } + + template + OSUniqueObject& impl_opassign(OSUniqueObject<_Y>&& other) + { + if (this != &other) + { + impl_release(); + fTypedObj = other.fTypedObj; + other.fTypedObj = nullptr; + } + return *this; + } + +public: + OSUniqueObject() = default; + ~OSUniqueObject() + { + OSSafeReleaseNULL(fTypedObj); + } + + // Just like std::unique_ptr, takes ownership of p + OSUniqueObject(pointer p) : fTypedObj(p) { } + + explicit OSUniqueObject(nullptr_t /* np */) {} + OSUniqueObject& operator=(nullptr_t /* np */) + { + impl_release(); + return *this; + } + + // Move + OSUniqueObject(OSUniqueObject&& other) : fTypedObj(other.fTypedObj) + { other.fTypedObj = nullptr; } + template + OSUniqueObject(OSUniqueObject<_Y>&& other) : fTypedObj(other.fTypedObj) + { other.fTypedObj = nullptr; } + OSUniqueObject& operator=(OSUniqueObject&& other) + { return impl_opassign(_VIOG::move(other)); } + template + OSUniqueObject& operator=(OSUniqueObject<_Y>&& other) + { return impl_opassign(_VIOG::move(other)); } + + // Copy is illegal + OSUniqueObject(const OSUniqueObject&) = delete; + template + OSUniqueObject(const OSUniqueObject<_Y>& other) = delete; + OSUniqueObject& operator=(const OSUniqueObject& other) = delete; + template + OSUniqueObject& operator=(const OSUniqueObject<_Y>& other) = delete; + + // Member functions + pointer get() const { return fTypedObj; } + pointer operator->() const { return fTypedObj; } + _T& operator*() const { return *fTypedObj; } + operator bool() const { return static_cast(get()); } + void reset(pointer p = nullptr) { *this = OSUniqueObject(p); } + + void swap(OSUniqueObject& other) + { + _VIOG::swap(fTypedObj, other.fTypedObj); + } +}; // OSUniqueObject<_T> + +// OSUniqueObject non member funtions +template +void swap(OSUniqueObject<_T>& lhs, OSUniqueObject<_T>& rhs) { lhs.swap(rhs); } + +// std::unique_ptr performs '==' operations by comparing get(). But that is +// just crazy. If two unique_ptrs are different objects and have the same +// pointer then our uniqueness assumption is violated. +template +bool operator==(const OSUniqueObject<_T>& lhs, const OSUniqueObject<_Y>& rhs) + { return lhs.get() == rhs.get(); } +template +bool operator!=(const OSUniqueObject<_T>& lhs, const OSUniqueObject<_Y>& rhs) + { return !(lhs == rhs); } + +// Null pointer comparison specializations +template +bool operator==(const OSUniqueObject<_T>& lhs, _VIOG::nullptr_t) + { return !static_cast(lhs); } +template +bool operator==(_VIOG::nullptr_t, const OSUniqueObject<_T>& rhs) + { return !static_cast(rhs); } +template +bool operator!=(const OSUniqueObject<_T>& lhs, _VIOG::nullptr_t) + { return static_cast(lhs); } +template +bool operator!=(_VIOG::nullptr_t, const OSUniqueObject<_T>& rhs) + { return static_cast(rhs); } + + +// Shared and Weak object helper class +class _OSSharedWeakCounter +{ + template friend class OSSharedObject; + template friend class OSWeakObject; + + OSObject* fObj; + os_refcnt fUseCount; + os_refcnt fWeakCount; + + explicit _OSSharedWeakCounter(OSObject* obj); + ~_OSSharedWeakCounter(); + + bool retain_shared(); + void release_shared(); + long count_shared() const; + void retain_weak(); + void release_weak(); + + _OSSharedWeakCounter* lock() + { + return retain_shared() ? this : nullptr; + } +}; // class _OSSharedWeakCounter + +// std::shared_ptr equivalent +template +class OSSharedObject +{ +public: + using element_type = _T; + using pointer = _T*; + using weak_type = OSWeakObject<_T>; + +private: + _OSSharedWeakCounter* fControl = nullptr; + pointer fTypedObj = nullptr; + + template friend class OSSharedObject; + template friend class OSWeakObject; + + void impl_zero() + { + fControl = nullptr; + fTypedObj = nullptr; + } + void impl_setme(const OSSharedObject& from) + { + fControl = from.fControl; + fTypedObj = from.fTypedObj; + } + template + void impl_setme(const OSSharedObject<_Y>& from) + { + fControl = from.fControl; + fTypedObj = from.fTypedObj; + } + void impl_saferetain() + { + if (static_cast(fControl)) + fControl->retain_shared(); + } + void impl_saferelease() + { + if (static_cast(fControl)) + fControl->release_shared(); + } + +public: + // Basic constructor destructors + + // Just like std::shared_ptr, takes ownership of p + OSSharedObject(_T* tp) + : fControl(new _OSSharedWeakCounter(tp)), fTypedObj(tp) {} + template + OSSharedObject(_Y* yp) + : fControl(new _OSSharedWeakCounter(yp)), fTypedObj(yp) {} + + OSSharedObject() = default; + ~OSSharedObject() + { + impl_saferelease(); + impl_zero(); + } + + // Move + OSSharedObject(OSSharedObject&& other) + { + impl_setme(other); + other.impl_zero(); + } + template + OSSharedObject(OSSharedObject<_Y>&& other) + { + impl_setme(other); + other.impl_zero(); + } + OSSharedObject& operator=(OSSharedObject&& other) + { + if (this != &other) + { + impl_saferelease(); + impl_setme(other); + other.impl_zero(); + } + return *this; + } + template + OSSharedObject& operator=(OSSharedObject<_Y>&& other) + { + if (this != &other) + { + impl_saferelease(); + impl_setme(other); + other.impl_zero(); + } + return *this; + } + + // Copy + OSSharedObject(const OSSharedObject& other) + { + impl_setme(other); + impl_saferetain(); + } + template + OSSharedObject(const OSSharedObject<_Y>& other) + { + impl_setme(other); + impl_saferetain(); + } + template + OSSharedObject(const OSSharedObject<_Y>& other, element_type* p) + : fControl(other.fControl) // Aliasing copy + { + if (static_cast(fControl)) { + fControl->retain_shared(); + fTypedObj = p; + } + } + OSSharedObject& operator=(const OSSharedObject& other) + { + if (this != &other) + { + impl_saferelease(); + impl_setme(other); + impl_saferetain(); + } + return *this; + } + + template + OSSharedObject& operator=(const OSSharedObject<_Y>& other) + { + if (this != &other) + { + impl_saferelease(); + impl_setme(other); + impl_saferetain(); + } + return *this; + } + + + pointer get() const { return fTypedObj; } + pointer operator->() const { return fTypedObj; } + _T& operator*() const { return *fTypedObj; } + operator bool() const { return static_cast(get()); } + void reset() { *this = OSSharedObject(); }; + long use_count() const + { + return static_cast(fControl)? fControl->count_shared() : 0; + } + + void swap(OSSharedObject& other) + { + _VIOG::swap(fControl, other.fControl); + _VIOG::swap(fTypedObj, other.fTypedObj); + } +}; + +// OSSharedObject non member funtions +template +void swap(OSSharedObject<_T>& lhs, OSSharedObject<_T>& rhs) { lhs.swap(rhs); } + +template +OSSharedObject<_T> static_pointer_cast(const OSSharedObject<_Y>& other) +{ + auto p = static_cast::element_type*>( + other.get()); + return OSSharedObject<_T>(other, p); +} + +template +OSSharedObject<_T> dynamic_pointer_cast(const OSSharedObject<_Y>& other) +{ + + auto p = OSDynamicCast(_T, other.get()); + if (static_cast(p)) + return OSSharedObject<_T>(other, p); + else + return OSSharedObject<_T>(); +} + + +template +OSSharedObject<_T> const_pointer_cast(const OSSharedObject<_Y>& other) +{ + auto p = const_cast::element_type*>( + other.get()); + return OSSharedObject<_T>(other, p); +} + +template +OSSharedObject<_T> reinterpret_pointer_cast(const OSSharedObject<_Y>& other) +{ + auto p = reinterpret_cast::element_type*>( + other.get()); + return OSSharedObject<_T>(other, p); +} + +template +bool operator==(const OSSharedObject<_T>& lhs, const OSSharedObject<_Y>& rhs) + { return lhs.get() == rhs.get(); } +template +bool operator!=(const OSSharedObject<_T>& lhs, const OSSharedObject<_Y>& rhs) + { return !(lhs == rhs); } +template +bool operator==(const OSSharedObject<_T>& lhs, _VIOG::nullptr_t) + { return !static_cast(lhs); } +template +bool operator==(_VIOG::nullptr_t, const OSSharedObject<_T>& rhs) + { return !static_cast(rhs); } +template +bool operator!=(const OSSharedObject<_T>& lhs, _VIOG::nullptr_t) + { return static_cast(lhs); } +template +bool operator!=(_VIOG::nullptr_t, const OSSharedObject<_T>& rhs) + { return static_cast(rhs); } + +// std::weak_ptr equivalent +template +class OSWeakObject +{ +public: + using element_type = _T; + +private: + _OSSharedWeakCounter* fControl = nullptr; + _T* fTypedObj = nullptr; + + template friend class OSSharedObject; + template friend class OSWeakObject; + + void impl_zero() + { + fControl = nullptr; + fTypedObj = nullptr; + } + void impl_saferetain() + { + if (static_cast(fControl)) + fControl->retain_weak(); + } + void impl_saferelease() + { + if (static_cast(fControl)) + fControl->release_weak(); + } + +public: + OSWeakObject() = default; + ~OSWeakObject() + { + impl_saferelease(); + impl_zero(); + } + + // Conversion from shared to weak + template + OSWeakObject(const OSSharedObject<_Y>& shared) + : fControl(shared.fControl), fTypedObj(shared.fTypedObj) + { + impl_saferetain(); + } + template + OSWeakObject& operator=(const OSSharedObject<_Y>& shared) + { + if (this != &shared) + { + impl_saferelease(); + fControl = shared.fControl; + fTypedObj = shared.fTypedObj; + impl_saferetain(); + } + return *this; + } + + // Copy + OSWeakObject(const OSWeakObject& other) + : fControl(other.fControl), fTypedObj(other.fTypedObj) + { + impl_saferetain(); + } + template + OSWeakObject(const OSWeakObject<_Y>& other) + : fControl(other.fControl), fTypedObj(other.fTypedObj) + { + impl_saferetain(); + } + OSWeakObject& operator=(const OSWeakObject& other) + { + if (this != &other) + { + impl_saferelease(); + fControl = other.fControl; + fTypedObj = other.fTypedObj; + impl_saferetain(); + } + return *this; + } + + // Move + OSWeakObject(OSWeakObject&& other) + : fControl(other.fControl), fTypedObj(other.fTypedObj) + { + other.impl_zero(); + } + template + OSWeakObject(OSWeakObject<_Y>&& other) + :fControl(other.fControl), fTypedObj(other.fTypedObj) + { + other.impl_zero(); + } + OSWeakObject& operator=(OSWeakObject&& other) + { + if (this != &other) + { + impl_saferelease(); + fControl = other.fControl; + fTypedObj = other.fTypedObj; + other.impl_zero(); + } + return *this; + } + + void reset() { *this = OSWeakObject(); }; + long use_count() const + { + return static_cast(fControl)? fControl->count_shared() : 0; + } + bool expired() const + { + return !static_cast(fControl) || fControl->count_shared() == 0; + } + OSSharedObject<_T> lock() const + { + OSSharedObject<_T> ret; + ret.fControl = static_cast(fControl)? fControl->lock() : nullptr; + if (static_cast(ret.fControl)) + ret.fTypedObj = fTypedObj; + return ret; + } + + void swap(OSWeakObject<_T>& other) + { + _VIOG::swap(fControl, other.fControl); + _VIOG::swap(fTypedObj, other.fTypedObj); + } +}; + +// OSWeakObject non member funtions +template +void swap(OSWeakObject<_T>& lhs, OSWeakObject<_T>& rhs) { lhs.swap(rhs); } + +_IOG_END_NAMESPACE + +#endif // !IOG_TL_OSMEMORY diff --git a/QualcommWireless/include/IOKit/graphics/tl/osutility b/QualcommWireless/include/IOKit/graphics/tl/osutility new file mode 100644 index 0000000..733bdfb --- /dev/null +++ b/QualcommWireless/include/IOKit/graphics/tl/osutility @@ -0,0 +1,74 @@ +/* vim: set ft=cpp: + * + * Copyright (c) 2018- Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +// Darwin kernel type_traits and other stuff + +#ifndef IOG_TL_OSUTILITY +#define IOG_TL_OSUTILITY + +#include <_config> + + +_IOG_START_NAMESPACE + +typedef decltype(nullptr) nullptr_t; + +// Reference removal +template struct remove_reference {typedef _T type;}; +template struct remove_reference<_T&> {typedef _T type;}; +template struct remove_reference<_T&&> {typedef _T type;}; +template +using remove_reference_t = typename remove_reference<_T>::type; + +// Pointer removal +template struct remove_pointer {typedef _T type;}; +template struct remove_pointer<_T*> {typedef _T type;}; +template struct remove_pointer<_T* const> {typedef _T type;}; +template struct remove_pointer<_T* volatile> {typedef _T type;}; +template struct remove_pointer<_T* const volatile> {typedef _T type;}; +template +using remove_pointer_t = typename remove_pointer<_T>::type; + +// Const/Volatile +template struct remove_const {typedef _T type;}; +template struct remove_const {typedef _T type;}; +template struct remove_volatile {typedef _T type;}; +template struct remove_volatile {typedef _T type;}; + +// move +template +inline remove_reference_t<_T>&& move(_T&& _t) +{ + return static_cast&&>(_t); +} + +template void swap(_T& lhs, _T& rhs) +{ + _T tmp; + tmp = _VIOG::move(lhs); + lhs = _VIOG::move(rhs); + rhs = _VIOG::move(tmp); +} + +_IOG_END_NAMESPACE + +#endif /* IOG_TL_OSUTILITY */ diff --git a/QualcommWireless/include/IOKit/hid/AppleHIDUsageTables.h b/QualcommWireless/include/IOKit/hid/AppleHIDUsageTables.h new file mode 100644 index 0000000..03f2757 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/AppleHIDUsageTables.h @@ -0,0 +1,268 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _APPLEHIDUSAGETABLES_H +#define _APPLEHIDUSAGETABLES_H + +/* ****************************************************************************************** + * Apple HID Usage Tables + * + * The following constants are Apple Vendor specific usages + * ****************************************************************************************** */ + + +/* Usage Pages */ +enum { + kHIDPage_AppleVendor = 0xFF00, + kHIDPage_AppleVendorKeyboard = 0xFF01, + kHIDPage_AppleVendorMouse = 0xFF02, + kHIDPage_AppleVendorAccelerometer = 0xFF03, + kHIDPage_AppleVendorAmbientLightSensor = 0xFF04, + kHIDPage_AppleVendorTemperatureSensor = 0xFF05, + kHIDPage_AppleVendorHeadset = 0xFF07, + kHIDPage_AppleVendorPowerSensor = 0xFF08, + kHIDPage_AppleVendorSmartCover = 0xFF09, + kHIDPage_AppleVendorPlatinum = 0xFF0A, + kHIDPage_AppleVendorHeartRate = 0xFF0A, + kHIDPage_AppleVendorLisa = 0xFF0B, + kHIDPage_AppleVendorMotion = 0xFF0C, + kHIDPage_AppleVendorBattery = 0xFF0D, + kHIDPage_AppleVendorIRRemote = 0xFF0E, + kHIDPage_AppleVendorDebug = 0xFF0F, + kHIDPage_AppleVendorIRInterface = 0xFF10, + kHIDPage_AppleVendorDFR = 0xFF11, + kHIDPage_AppleVendorDFRBrightness = 0xFF12, + kHIDPage_AppleVendorSenderID = 0xFF13, + kHIDPage_AppleVendorFilteredEvent = 0xFF50, + kHIDPage_AppleVendorMultitouch = 0xFF60, + kHIDPage_AppleVendorDisplay = 0xFF92, + kHIDPage_AppleVendorTopCase = 0x00FF +}; + + +/* AppleVendor Page (0xff00) */ +enum { + kHIDUsage_AppleVendor_TopCase = 0x0001, /* Application Collection */ + kHIDUsage_AppleVendor_Display = 0x0002, /* Application Collection */ + kHIDUsage_AppleVendor_Accelerometer = 0x0003, /* Application Collection */ + kHIDUsage_AppleVendor_AmbientLightSensor = 0x0004, /* Application Collection */ + kHIDUsage_AppleVendor_TemperatureSensor = 0x0005, /* Application Collection */ + kHIDUsage_AppleVendor_Keyboard = 0x0006, /* Application Collection */ + kHIDUsage_AppleVendor_Headset = 0x0007, /* Application Collection */ + kHIDUsage_AppleVendor_ProximitySensor = 0x0008, /* Application Collection */ + kHIDUsage_AppleVendor_Gyro = 0x0009, /* Application Collection */ + kHIDUsage_AppleVendor_Compass = 0x000A, /* Application Collection */ + kHIDUsage_AppleVendor_DeviceManagement = 0x000B, /* Application Collection */ + kHIDUsage_AppleVendor_Trackpad = 0x000C, /* Application Collection */ + kHIDUsage_AppleVendor_TopCaseReserved = 0x000D, /* Application Collection */ + kHIDUsage_AppleVendor_Motion = 0x000E, /* Application Collection */ + kHIDUsage_AppleVendor_KeyboardBacklight = 0x000F, /* Application Collection */ + kHIDUsage_AppleVendor_DeviceMotionLite = 0x0010, /* Application Collection */ + kHIDUsage_AppleVendor_Force = 0x0011, /* Application Collection */ + kHIDUsage_AppleVendor_BluetoothRadio = 0x0012, /* Application Collection */ + kHIDUsage_AppleVendor_Orb = 0x0013, /* Application Collection */ + kHIDUsage_AppleVendor_AccessoryBattery = 0x0014, /* Application Collection Use kHIDUsage_PD_PeripheralDevice */ + kHIDUsage_AppleVendor_Humidity = 0x0015, /* Application Collection */ + kHIDUsage_AppleVendor_DFR = 0x0016, /* Application Collection */ + kHIDUsage_AppleVendor_NXEvent = 0x0017, /* Application Collection */ + kHIDUsage_AppleVendor_NXEvent_Translated = 0x0018, /* Application Collection */ + kHIDUsage_AppleVendor_NXEvent_Diagnostic = 0x0019, /* Application Collection */ + kHIDUsage_AppleVendor_Homer = 0x0020, /* Application Collection */ + kHIDUsage_AppleVendor_Color = 0x0021, /* Dynamic Value */ + kHIDUsage_AppleVendor_Accessibility = 0x0022, /* Application Collection */ + kHIDUsage_AppleVendor_Message = 0x0023, /* Application Collection */ + kHIDUsage_AppleVendor_Luna = 0x0024, /* Application Collection */ + kHIDUsage_AppleVendor_Payload = 0x0025, /* Application Collection */ + kHIDUsage_AppleVendor_Perf = 0x0026, /* Application Collection */ + kHIDUsage_AppleVendor_Gallium = 0x0027, /* Application Collection */ + kHIDUsage_AppleVendor_HIDRelay = 0x0028, /* Application Collection */ + kHIDUsage_AppleVendor_SmartCover = 0x0029 /* Application Collection */ +}; + + +/* AppleVendor Keyboard Page (0xff01) */ +enum { + kHIDUsage_AppleVendorKeyboard_Spotlight = 0x0001, + kHIDUsage_AppleVendorKeyboard_Dashboard = 0x0002, + kHIDUsage_AppleVendorKeyboard_Function = 0x0003, + kHIDUsage_AppleVendorKeyboard_Launchpad = 0x0004, + kHIDUsage_AppleVendorKeyboard_Reserved = 0x000A, + kHIDUsage_AppleVendorKeyboard_CapsLockDelayEnable = 0x000B, + kHIDUsage_AppleVendorKeyboard_PowerState = 0x000C, + kHIDUsage_AppleVendorKeyboard_Expose_All = 0x0010, + kHIDUsage_AppleVendorKeyboard_Expose_Desktop = 0x0011, + kHIDUsage_AppleVendorKeyboard_Brightness_Up = 0x0020, + kHIDUsage_AppleVendorKeyboard_Brightness_Down = 0x0021, + kHIDUsage_AppleVendorKeyboard_Language = 0x0030, + + /* Synthesized Keyboard Events */ + kHIDUsage_AppleVendorKeyboard_WillReset = 0x0040, + kHIDUsage_AppleVendorKeyboard_Reset = 0x0041, + kHIDUsage_AppleVendorKeyboard_WillFactoryReset = 0x0042, + kHIDUsage_AppleVendorKeyboard_AccessibilityToggle = 0x0043, +}; + +/* AppleVendor Page Headset (0xff07) */ +enum +{ + kHIDUsage_AV_Headset_Availability = 0x0001 +}; + +/* AppleVendor Power Page (0xff08) */ +enum { + kHIDUsage_AppleVendorPowerSensor_Power = 0x0001, + kHIDUsage_AppleVendorPowerSensor_Current = 0x0002, + kHIDUsage_AppleVendorPowerSensor_Voltage = 0x0003, +}; + +/* AppleVendor Smart Cover Page (0xff09) */ +enum { + kHIDUsage_AppleVendorSmartCover_Open = 0x0001, + kHIDUsage_AppleVendorSmartCover_Flap1 = 0x0002, + kHIDUsage_AppleVendorSmartCover_Flap2 = 0x0003, + kHIDUsage_AppleVendorSmartCover_Flap3 = 0x0004, + kHIDUsage_AppleVendorSmartCover_Attach = 0x0010, + kHIDUsage_AppleVendorSmartCover_StateUnknown= 0x0020, +}; + +/* AppleVendor Platinum - Heart Rate (0xff0A) */ +enum { + kHIDUsage_AppleVendorPlatinum_Lutetium = 0x0003, + kHIDUsage_AppleVendorHeartRate_HR = 0x0001, + kHIDUsage_AppleVendorHeartRate_BGHR = 0x0003, + kHIDUsage_AppleVendorHeartRate_Erbium = 0x0010, +}; + +/* AppleVendor Motion (0xff0C) */ +enum { + kHIDUsage_AppleVendorMotion_Motion = 0x0001, + kHIDUsage_AppleVendorMotion_Activity = 0x0002, + kHIDUsage_AppleVendorMotion_Gesture = 0x0003, + kHIDUsage_AppleVendorMotion_DeviceMotion = 0x0004, + kHIDUsage_AppleVendorMotion_DeviceMotion6 = 0x0005, + kHIDUsage_AppleVendorMotion_Orientation = 0x0006, + kHIDUsage_AppleVendorMotion_DeviceMotion3 = 0x0007, + kHIDUsage_AppleVendorMotion_DeviceMotion10 = 0x0008 +}; + +/* AppleVendor Battery (0xff0D) */ +enum { + kHIDUsage_AppleVendorBattery_RawCapacity = 0x0001, + kHIDUsage_AppleVendorBattery_NominalChargeCapacity = 0x0002, + kHIDUsage_AppleVendorBattery_CumulativeCurrent = 0x0003, +}; + +/* AppleVendor IR Remote (0xff0E) */ +enum { + kHIDUsage_AppleVendorIRRemote_Pair = 0x0001, + kHIDUsage_AppleVendorIRRemote_Unpair = 0x0002, + kHIDUsage_AppleVendorIRRemote_LowBattery = 0x0003, + kHIDUsage_AppleVendorIRRemote_BTLEDiscoveryMode = 0x0004, +}; + +/* AppleVendor Debug (0xff0F) */ +enum { + kHIDUsage_AppleVendorDebug_Screenshot = 0x0001, + kHIDUsage_AppleVendorDebug_Stackshot = 0x0002, + kHIDUsage_AppleVendorDebug_SendLogs = 0x0003, + kHIDUsage_AppleVendorDebug_BlackScreenRecover = 0x0004, +}; + +/* AppleVendor IR Interface (0xff10) */ +enum { + kHIDUsage_AppleVendorIRInterface_IRCommand = 0x0001, + kHIDUsage_AppleVendorIRInterface_IRTimings = 0x0002, +}; + +/* AppleVendor Multitouch Page (0xff60) */ +enum { + kHIDUsage_AppleVendorMultitouch_PowerOff = 0x0001, + kHIDUsage_AppleVendorMultitouch_DeviceReady = 0x0002, + kHIDUsage_AppleVendorMultitouch_ExternalMessage = 0x0003, + kHIDUsage_AppleVendorMultitouch_WillPowerOn = 0x0004, + kHIDUsage_AppleVendorMultitouch_TouchCancel = 0x0005, + kHIDUsage_AppleVendorMultitouch_RawFrame = 0x0006, +}; + +/* AppleVendor Page Top Case (0x00ff) */ +enum +{ + kHIDUsage_AV_TopCase_KeyboardFn = 0x0003, + kHIDUsage_AV_TopCase_BrightnessUp = 0x0004, + kHIDUsage_AV_TopCase_KeyboardLayoutSwitch = 0x0004, // use in output report on DFR virtual keyboard + kHIDUsage_AV_TopCase_BrightnessDown = 0x0005, + kHIDUsage_AV_TopCase_VideoMirror = 0x0006, + kHIDUsage_AV_TopCase_IlluminationToggle = 0x0007, + kHIDUsage_AV_TopCase_IlluminationUp = 0x0008, + kHIDUsage_AV_TopCase_IlluminationDown = 0x0009, + kHIDUsage_AV_TopCase_ClamshellLatched = 0x000A, + kHIDUsage_AV_TopCase_Reserved_MouseData = 0x00C0 +}; + +/* AppleVendor DFR (0xff11) */ +enum { + kHIDUsage_AppleVendorDFR_TouchTimestamp = 0x0001, + kHIDUsage_AppleVendorDFR_TouchGenerationCount = 0x0002, + kHIDUsage_AppleVendorDFR_EventRoutingData = 0x0003 +}; + +/* AppleVendor DFR Brightness (0xff12) */ +enum { + kHIDUsage_AppleVendorDFRBrightness_DFRBrightnes = 0x0001, /* Application Collection */ + + kHIDUsage_AppleVendorDFRBrightness_Update = 0x0010, + kHIDUsage_AppleVendorDFRBrightness_Absolute = 0x0011, + kHIDUsage_AppleVendorDFRBrightness_Relative = 0x0012, + kHIDUsage_AppleVendorDFRBrightness_RampLength = 0x0013, + + kHIDUsage_AppleVendorDFRBrightness_DimmingStepOptions = 0x0020, + kHIDUsage_AppleVendorDFRBrightness_DimmingStep = 0x0021, + kHIDUsage_AppleVendorDFRBrightness_DimmingStepRampLength = 0x0022, + kHIDUsage_AppleVendorDFRBrightness_DimmingStepFactor = 0x0023, + + kHIDUsage_AppleVendorDFRBrightness_DisplayState = 0x0031, + kHIDUsage_AppleVendorDFRBrightness_DisplaySateRampLength = 0x0032, + + kHIDUsage_AppleVendorDFRBrightness_Version = 0x0040, + kHIDUsage_AppleVendorDFRBrightness_AutoBrightness = 0x0041, + kHIDUsage_AppleVendorDFRBrightness_MinNits = 0x0042, + kHIDUsage_AppleVendorDFRBrightness_MaxNits = 0x0043, + kHIDUsage_AppleVendorDFRBrightness_CurveType = 0x0044, + kHIDUsage_AppleVendorDFRBrightness_CurvePointCount = 0x0045, + kHIDUsage_AppleVendorDFRBrightness_CurveUpdateRampLength = 0x0046, + kHIDUsage_AppleVendorDFRBrightness_CurveIlluminanceCoordinates = 0x0047, + kHIDUsage_AppleVendorDFRBrightness_CurveLuminanceCoordinates = 0x0048, + + kHIDUsage_AppleVendorDFRBrightness_DFRBurninCounterUpdate = 0x0050, + kHIDUsage_AppleVendorDFRBrightness_DFRBurninCounterValue = 0x0051, +}; + +/* AppleVendor Sender ID (0xff13) */ +enum { + /* Transports */ + kHIDUsage_AppleVendorSenderID_IR = 0x0001, + kHIDUsage_AppleVendorSenderID_CEC = 0x0002, + + /* Applications */ + kHIDUsage_AppleVendorSenderID_MediaRemote = 0x0010, +}; +#endif /* _APPLEHIDUSAGETABLES_H */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDDevice.h b/QualcommWireless/include/IOKit/hid/IOHIDDevice.h new file mode 100644 index 0000000..fcd6710 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDDevice.h @@ -0,0 +1,799 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDDEVICE_H +#define _IOKIT_HID_IOHIDDEVICE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +class IOHIDSystem; +class IOHIDPointing; +class IOHIDKeyboard; +class IOHIDConsumer; +class IOHIDElementPrivate; +class IOHIDEventQueue; +class IOHIDInterface; +class IOHIDDeviceShim; +struct IOHIDReportHandler; +class IOHIDAsyncReportQueue; +class IOHIDDeviceElementContainer; + + +/*! @class IOHIDDevice : public IOService + @abstract IOHIDDevice defines a Human Interface Device (HID) object, + which will interact with the HID Manager by publishing static properties + in the registry, and also by reporting HID events through shared memory. + IOHIDDevice is an abstract class that must be subclassed to support a + specific type of HID devices, such as USB HID class devices. +
+ Since most HID devices are expected to be USB devices, IOHIDDevice + uses the USB HID specification to define the format of the report + descriptor, and also reports that are used to communicate with the + hardware via some intervening transport layer. However, there is no + mandate that the transport layer must be restricted to USB. A subclass + may be created to support legacy ADB joysticks, and issue packets on + the ADB bus and translate those packets to USB reports, and vice versa. + IOHIDDevice does not care how those reports are generated or consumed + by the physical device, as long as the reports abide to the USB + specification. */ + +class IOHIDDevice : public IOService +{ + OSDeclareDefaultStructorsWithDispatch ( IOHIDDevice ) + + friend class IOHIDLibUserClient; + friend class IOHIDDeviceShim; + friend class IOHIDInterface; + +private: + OSArray * _elementArray; + UInt32 _dataElementIndex; + IORecursiveLock * _elementLock; + IOHIDReportHandler * _reportHandlers; // unused + IOBufferMemoryDescriptor * _elementValuesDescriptor; // unused + bool _readyForInputReports; + UInt32 _reportCount; + UInt32 _maxInputReportSize; + UInt32 _maxOutputReportSize; + UInt32 _maxFeatureReportSize; + + struct ExpansionData { + OSSet * clientSet; + IOService * seizedClient; + AbsoluteTime eventDeadline; + bool performTickle; + bool performWakeTickle; + OSArray * interfaceNubs; + OSArray * hierarchElements; + OSArray * interfaceElementArrays; + IOHIDAsyncReportQueue * asyncReportQueue; + IOWorkLoop * workLoop; + IOEventSource * eventSource; + IONotifier * deviceNotify; + IOHIDDeviceElementContainer *elementContainer; + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + void setupResolution(); + + // HID report descriptor parsing support. + + bool linkToParent( const OSArray * array, + UInt32 parentIndex, + UInt32 childIndex ); + + bool createCollectionElements( HIDPreparsedDataRef parseData, + OSArray * array, + UInt32 maxCount ); + + bool createValueElements( HIDPreparsedDataRef parseData, + OSArray * array, + UInt32 hidReportType, + IOHIDElementType elementType, + UInt32 maxCount ); + + bool createButtonElements( HIDPreparsedDataRef parseData, + OSArray * array, + UInt32 hidReportType, + IOHIDElementType elementType, + UInt32 maxCount ); + + bool createReportHandlerElements( HIDPreparsedDataRef parseData); + + bool getReportCountAndSizes( HIDPreparsedDataRef parseData ); + + bool setReportSize( UInt8 reportID, + IOHIDReportType reportType, + UInt32 bits ); + + IOReturn createElementHierarchy( HIDPreparsedDataRef parseData ); + + IOReturn parseReportDescriptor( IOMemoryDescriptor * report, + IOOptionBits options = 0 ); + + IOBufferMemoryDescriptor * createMemoryForElementValues(); + + OSNumber * newPrimaryUsageNumber(UInt32 interfaceIdx) const; + + OSNumber * newPrimaryUsagePageNumber(UInt32 interfaceIdx) const; + + OSArray * newDeviceUsagePairs(OSArray * elements, UInt32 start); + + static bool _publishDeviceNotificationHandler(void * target, + void * refCon, + IOService * newService, + IONotifier * notifier ); + +protected: + +/*! @function free + @abstract Free the IOHIDDevice object. + @discussion Release all resources that were previously allocated, + then call super::free() to propagate the call to our superclass. */ + + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! @function handleOpen + @abstract Handle a client open on the interface. + @discussion This method is called by IOService::open() with the + arbitration lock held, and must return true to accept the client open. + This method will in turn call handleClientOpen() to qualify the client + requesting the open. + @param client The client object that requested the open. + @param options Options passed to IOService::open(). + @param argument Argument passed to IOService::open(). + @result true to accept the client open, false otherwise. */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * argument) APPLE_KEXT_OVERRIDE; + +/*! @function handleClose + @abstract Handle a client close on the interface. + @discussion This method is called by IOService::close() with the + arbitration lock held. This method will in turn call handleClientClose() + to notify interested subclasses about the client close. If this represents + the last close, then the interface will also close the controller before + this method returns. The controllerWillClose() method will be called before + closing the controller. Subclasses should not override this method. + @param client The client object that requested the close. + @param options Options passed to IOService::close(). */ + + virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE; + +/*! @function handleIsOpen + @abstract Query whether a client has an open on the interface. + @discussion This method is always called by IOService with the + arbitration lock held. Subclasses should not override this method. + @result true if the specified client, or any client if none (0) is + specified, presently has an open on this object. */ + + virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE; + +/*! @function handleStart + @abstract Prepare the hardware and driver to support I/O operations. + @discussion IOHIDDevice will call this method from start() before + any I/O operations are issued to the concrete subclass. Methods + such as newReportDescriptor() are only called after handleStart() + has returned true. A subclass that overrides this method should + begin its implementation by calling the version in super, and + then check the return value. + @param provider The provider argument passed to start(). + @result True on success, or false otherwise. Returning false will + cause start() to fail and return false. */ + + virtual bool handleStart( IOService * provider ); + +/*! @function handleStop + @abstract Quiesce the hardware and stop the driver. + @discussion IOHIDDevice will call this method from stop() to + signal that the hardware should be quiesced and the driver stopped. + A subclass that overrides this method should end its implementation + by calling the version in super. + @param provider The provider argument passed to stop(). */ + + virtual void handleStop( IOService * provider ); + +/*! @function newUserClient + @abstract Handle a request to create a connection for a non kernel + client. + @discussion Create a new IOUserClient, or a subclass of IOUserClient, + to service a connection to a non kernel client. This implementation + will simply call the implementation in IOService to handle the call. + @param owningTask The mach task requesting the connection. + @param security_id A token representing the access level for the task. + @param type A constant specifying the type of connection to be created. + @param properties A dictionary of additional properties for the connection. + @param handler The IOUserClient object returned. + @result The return from IOService::newUserClient() is returned. */ + + virtual IOReturn newUserClient( task_t owningTask, + void * security_id, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler ) APPLE_KEXT_OVERRIDE; + IOReturn newUserClientInternal(task_t owningTask, + void * security_id, + OSDictionary * properties, + IOUserClient ** handler ); + +/*! @function publishProperties + @abstract Publish HID properties to the I/O Kit registry. + @discussion Called by the start() method to fetch and publish all + HID properties to the I/O Kit registry. These properties will allow + the HID Manager to identify all HID device(s) in the system, by + iterating through objects that are subclasses of IOHIDDevice, and + then fetch their published property values. The implementation in + IOHIDDevice will call methods to get each individual HID property, + and subclasses will not normally need to override this method. + @param provider The provider argument passed to start(). + @result True to indicate that all properties were discovered and + published to the registry, false otherwise. Returning false will + cause start() to fail and return false. */ + + virtual bool publishProperties( IOService * provider ); + +public: + +/*! @function init + @abstract Initialize an IOHIDDevice object. + @discussion Prime the IOHIDDevice object and prepare it to support + a probe() or a start() call. This implementation will simply call + super::init(). + @param dictionary A dictionary associated with this IOHIDDevice + instance. + @result True on sucess, or false otherwise. */ + + virtual bool init( OSDictionary * dictionary = 0 ) APPLE_KEXT_OVERRIDE; + +/*! @function start + @abstract Start up the driver using the given provider. + @discussion IOHIDDevice will allocate resources, then call handleStart() + before fetching the report descriptor through newReportDescriptor(), and + publishing HID properties to the registry. Before returning true to + indicate success, registerService() is called to trigger client matching. + Subclasses are recommended to override handleStart(). + @param provider The provider that the driver was matched to, and selected + to run with. + @result True on success, or false otherwise. */ + + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + +/*! @function stop + @abstract Called by a provider (during its termination) before detaching + all its clients. + @discussion IOHIDDevice will call handleStop(), then release allocated + resources. Subclasses are recommended to override handleStop(). + @param provider The provider that the driver was started on. */ + + virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE; + +/*! @function matchPropertyTable + @abstract Called by the provider during a match + @discussion Compare the properties in the supplied table to this + object's properties. + @param table The property table that this device will match against +*/ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score) APPLE_KEXT_OVERRIDE; + +/*! @function message + @abstract Receives messages delivered from an attached provider. + @discussion Handles the kIOMessageDeviceSignaledWakeup message + from a provider identifying the IOHIDDevice as the wakeup source. + @param type A type defined in IOMessage.h. + @param provider The provider from which the message originates. + @param argument An argument defined by the message type. + @result An IOReturn code defined by the message type. +*/ + + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ) APPLE_KEXT_OVERRIDE; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_11_0 + using IOService::setProperty; +/*! @function setProperty + @abstract Synchronized method to add a property to an IOHIDDevice's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The properties name as an OSSymbol. + @param anObject The property value. + @result true on success or false on a resource failure. */ + + virtual bool setProperty( const OSSymbol * aKey, OSObject * anObject) APPLE_KEXT_OVERRIDE; +#endif + +/*! @function newTransportString + @abstract Returns a string object that describes the transport + layer used by the HID device. + @result A string object. The caller must decrement the retain count + on the object returned. */ + + virtual OSString * newTransportString() const; + +/*! @function newManufacturerString + @abstract Returns a string object that describes the manufacturer + of the HID device. + @result A string object. The caller must decrement the retain count + on the object returned. */ + + virtual OSString * newManufacturerString() const; + +/*! @function newProductString + @abstract Returns a string object that describes the product + of the HID device. + @result A string object. The caller must decrement the retain count + on the object returned. */ + + virtual OSString * newProductString() const; + +/*! @function newVendorIDNumber + @abstract Returns a number object that describes the vendor ID + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newVendorIDNumber() const; + +/*! @function newProductIDNumber + @abstract Returns a number object that describes the product ID + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newProductIDNumber() const; + +/*! @function newVersionNumber + @abstract Returns a number object that describes the version number + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newVersionNumber() const; + +// *** THIS HAS BEEN DEPRECATED. PLEASE USE newSerialNumberString *** +/*! @function newSerialNumber + @abstract THIS HAS BEEN DEPRECATED. PLEASE USE newSerialNumberString. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newSerialNumber() const; + +/*! @function newPrimaryUsageNumber + @abstract Returns a number object that describes the primary usage + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newPrimaryUsageNumber() const; + +/*! @function newPrimaryUsagePageNumber + @abstract Returns a number object that describes the primary usage + page of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newPrimaryUsagePageNumber() const; + +/*! @function newReportDescriptor + @abstract Create and return a new memory descriptor that describes the + report descriptor for the HID device. + @discussion A subclass must override this pure virtual function, and + return a memory descriptor that describes the HID report descriptor as + defined by the USB Device Class Definition for Human Interface Devices + Version 1.1 specification. + @param descriptor Pointer to the memory descriptor returned. This + memory descriptor will be released by the caller. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + virtual IOReturn newReportDescriptor( + IOMemoryDescriptor ** descriptor ) const = 0; + +/*! @function handleReport + @abstract Handle an asynchronous report received from the HID device. + @param report A memory descriptor that describes the report. + @param reportType The type of report. + @param options Options to specify the request. No options are + currently defined, and the default value is 0. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + virtual IOReturn handleReport( + IOMemoryDescriptor * report, + IOHIDReportType reportType = kIOHIDReportTypeInput, + IOOptionBits options = 0 ); + +/*! @function getReport + @abstract Get a report from the HID device. + @discussion A completion parameter may be added in the future. + @param report A memory descriptor that describes the memory to store + the report read from the HID device. + @param reportType The report type. + @param options The lower 8 bits will represent the Report ID. The + other 24 bits are options to specify the request. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + virtual IOReturn getReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options ); + +/*! @function setReport + @abstract Send a report to the HID device. + @discussion A completion parameter may be added in the future. + @param report A memory descriptor that describes the report to send + to the HID device. + @param reportType The report type. + @param options The lower 8 bits will represent the Report ID. The + other 24 bits are options to specify the request. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + virtual IOReturn setReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options = 0 ); + +/*! @function getMemoryWithCurrentElementValues + @abstract Get a reference to a memory descriptor that describes the + memory block containing the current HID element values. + @discussion Each HID element that can contribute to an input, output, + or feature report, is assigned an area of memory from a common memory + block allocated by IOHIDDevice. Each element will use its assigned + memory area to store its current value, defined by an IOHIDElementValue + structure. The memory described by the memory descriptor may be mapped + to user space to allow the HID Manager to poll the current element + value without the cost of a user-kernel transition. Subclasses should + not override this method. + @result A reference to a memory descriptor that describes the current + element values, or 0 to indicate a resource shortage. */ + + virtual IOMemoryDescriptor * getMemoryWithCurrentElementValues() const; + +/*! @function registerElement + @abstract A registration function called by a HID element to register + itself, and also to obtain an unique cookie identifier + (unique per device, not unique system-wide). + @discussion An internal data type, an IOHIDElementPrivate, is created to + represent each HID element discovered by parsing the HID report + descriptor. Each element created will call this method to register + itself with its owner (IOHIDDevice), and also to obtain an element + cookie that is used by HID Manager to specify and identify the element. + Subclasses should not override this method. + @param element The element that is requesting registration with its + owner. + @param cookie Pointer to the returned cookie assigned to this element. + @result True on success, or false otherwise. */ + + virtual bool registerElement( IOHIDElementPrivate * element, + IOHIDElementCookie * cookie ); + +/*! @function startEventDelivery + @abstract Start delivering events from a HID element to the event + queue specified. + @discussion Clients of IOHIDDevice may create an IOHIDEventQueue, and + then call this method to register for delivery of events generated by + one or more HID elements to that event queue. Subclasses should not + override this method. + @param queue The event queue that is interested in receiving events + generated by the HID element specified. The retain count on the queue + will be incremented by one. + @param cookie The cookie for a HID element published by the HID device. + @param options Options to specify the request. No options are currently + defined, and the default value is zero. + @result kIOReturnSuccess on success, or kIOReturnBadArgument if the + queue or the cookie argument specified is invalid, or kIOReturnNoMemory + if a resource shortage was encountered. */ + + virtual IOReturn startEventDelivery( IOHIDEventQueue * queue, + IOHIDElementCookie cookie, + IOOptionBits options = 0 ); + +/*! @function stopEventDelivery + @abstract Stop delivering events from one or more HID elements to the + event queue specified. + @discussion Clients that called startEventDelivery() must eventually + call this method to stop event delivery to its queue from one or more + HID elements. + @param queue The event queue that no longer wishes to receive events + generated by the HID element specified. + @param cookie The cookie for a HID element published by the HID device. + The default value of zero indicates that the queue should be removed from + the event dispatch list of all HID elements published by the HID device. + Subclasses should not override this method. + @result kIOReturnSuccess if the queue was removed from the event dispatch + list for one or more HID elements, or kIOReturnBadArgument if the queue + or the cookie argument specified is invalid, or kIOReturnNotFound if the + queue was not found. */ + + virtual IOReturn stopEventDelivery( IOHIDEventQueue * queue, + IOHIDElementCookie cookie = 0 ); + +/*! @function checkEventDelivery + @abstract Check whether events from a HID element will be delivered to + the event queue specified. + @param queue The event queue. + @param cookie The cookie for a HID element published by the HID device. + @param isActive Pointer to the return value that is set to true if events + generated by the HID element will be delivered to the queue, or false + otherwise. This return value is set only if kIOReturnSuccess is + returned. + @result kIOReturnSuccess on success, or kIOReturnBadArgument if one or + more of the arguments provided are invalid. */ + + virtual IOReturn checkEventDelivery( IOHIDEventQueue * queue, + IOHIDElementCookie cookie, + bool * isActive ); + +/*! @function updateElementValues + @abstract Updates element values from a HID device via getReport. + @discussion A completion parameter may be added in the future. + @param cookies A list of element cookies who's values need to be + set on the device. + @param cookieCount The number of element cookies. + @result kIOReturnSuccess on success, or an error return otherwise. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 0); + virtual IOReturn updateElementValues(IOHIDElementCookie * cookies, UInt32 cookieCount = 1); + +/*! @function postElementValues + @abstract Posts element values to a HID device via setReport. + @discussion A completion parameter may be added in the future. + @param cookies A list of element cookies who's values need to be + set on the device. + @param cookieCount The number of element cookies. + @result kIOReturnSuccess on success, or an error return otherwise. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 1); + virtual IOReturn postElementValues(IOHIDElementCookie * cookies, UInt32 cookieCount = 1); + +/*! @function newSerialNumberString + @abstract Returns a string object that describes the serial number + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 2); + virtual OSString * newSerialNumberString() const; + +/*! @function newLocationIDNumber + @abstract Returns a number object that describes the location ID + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 3); + virtual OSNumber * newLocationIDNumber() const; + +/*! @function getReport + @abstract Get a report from the HID device. + @discussion A completion parameter may be added in the future. + @param report A memory descriptor that describes the memory to store + the report read from the HID device. + @param reportType The report type. + @param options The lower 8 bits will represent the Report ID. The + other 24 bits are options to specify the request. + @param completionTimeout Specifies an amount of time (in ms) after which + the command will be aborted if the entire command has not been completed. + @param completion Function to call when request completes. If omitted then + getReport() executes synchronously, blocking until the request is complete. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + OSMetaClassDeclareReservedUsed(IOHIDDevice, 4); + virtual IOReturn getReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options, + UInt32 completionTimeout, + IOHIDCompletion * completion = 0); + +/*! @function setReport + @abstract Send a report to the HID device. + @discussion A completion parameter may be added in the future. + @param report A memory descriptor that describes the report to send + to the HID device. + @param reportType The report type. + @param options The lower 8 bits will represent the Report ID. The + other 24 bits are options to specify the request. + @param completionTimeout Specifies an amount of time (in ms) after which + the command will be aborted if the entire command has not been completed. + @param completion Function to call when request completes. If omitted then + setReport() executes synchronously, blocking until the request is complete. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + OSMetaClassDeclareReservedUsed(IOHIDDevice, 5); + virtual IOReturn setReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options, + UInt32 completionTimeout, + IOHIDCompletion * completion = 0); + +/*! @function newVendorIDSourceNumber + @abstract Returns a number object that describes the vendor ID + source of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 6); + virtual OSNumber * newVendorIDSourceNumber() const; + +/*! @function newCountryCodeNumber + @abstract Returns a number object that describes the country code + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 7); + virtual OSNumber * newCountryCodeNumber() const; + + +/*! @function handleReportWithTime + @abstract Handle an asynchronous report received from the HID device. + @param timeStamp The timestamp of report. + @param report A memory descriptor that describes the report. + @param reportType The type of report. Currently, only + kIOHIDReportTypeInput report type is handled. + @param options Options to specify the request. No options are + currently defined, and the default value is 0. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + OSMetaClassDeclareReservedUsed(IOHIDDevice, 8); + virtual IOReturn handleReportWithTime( + AbsoluteTime timeStamp, + IOMemoryDescriptor * report, + IOHIDReportType reportType = kIOHIDReportTypeInput, + IOOptionBits options = 0); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_5 + +/*! @function newReportInterval + @abstract Returns a number object that describes the actual polling + interval of the HID device in microseconds. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 9); + virtual OSNumber * newReportIntervalNumber() const; + +#else + + OSMetaClassDeclareReservedUnused(IOHIDDevice, 9); + +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 + + OSMetaClassDeclareReservedUsed(IOHIDDevice, 10); + virtual IOReturn handleReportWithTimeAsync( + AbsoluteTime timeStamp, + IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options, + UInt32 completionTimeout, + IOHIDCompletion * completion); + +#else + + OSMetaClassDeclareReservedUnused(IOHIDDevice, 10); + +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9 + +/*! @function newDeviceUsagePairs + @abstract Returns an array of usage dictionaries. IOHIDDevice creates + create this from the actual report descriptor, and that should be the base + for any subclass override. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 11); + virtual OSArray * newDeviceUsagePairs(); + +#else + + OSMetaClassDeclareReservedUnused(IOHIDDevice, 11); + +#endif + +protected: + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + + /*! @function createInterface + @abstract Creates an IOHIDInterface nub for the device to attach to. + @discussion Will create multiple interfaces, if applicable and support is + enabled. + @result true on success, false otherwise. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 12); + virtual bool createInterface(IOOptionBits options = 0); + + /*! @function destroyInterface + @abstract Destroys the IOHIDInterface nub attached to the device. + @discussion This method will destroy all interfaces if multiple were + created. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 13); + virtual void destroyInterface(IOOptionBits options = 0); + +#else + + OSMetaClassDeclareReservedUnused(IOHIDDevice, 12); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 13); + +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + + /*! @function conformsTo + @abstract Checks if a device conforms to a certain usage page/usage. + @discussion Iterates through the usages returned from newDeviceUsagePairs + function and checks for matching usages. + @result true if the device conforms to the specified usage page/usage. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 14); + virtual bool conformsTo(UInt32 usagePage, UInt32 usage); + + /*! @function completeReport + @abstract complete reports for DriverKit drivers + @discussion This method only used by DriverKit driver + created. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 15); + virtual void completeReport(OSAction * action, IOReturn status, uint32_t actualByteCount); + +#else + + OSMetaClassDeclareReservedUnused(IOHIDDevice, 14); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 15); + +#endif + + OSMetaClassDeclareReservedUnused(IOHIDDevice, 16); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 17); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 18); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 19); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 20); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 21); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 22); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 23); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 24); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 25); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 26); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 27); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 28); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 29); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 30); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 31); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 32); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 33); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 34); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 35); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 36); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 37); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 38); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 39); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 40); + +}; + +#endif /* !_IOKIT_HID_IOHIDDEVICE_H */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDDeviceKeys.h b/QualcommWireless/include/IOKit/hid/IOHIDDeviceKeys.h new file mode 100644 index 0000000..77030c4 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDDeviceKeys.h @@ -0,0 +1,228 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 2019 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef IOHIDDeviceKeys_h +#define IOHIDDeviceKeys_h + +/*! + * @define kIOHIDTransportKey + * + * @abstract + * Number property that describes the transport of the device. + */ +#define kIOHIDTransportKey "Transport" + +/*! + * @define kIOHIDVendorIDKey + * + * @abstract + * Number property that describes the vendor ID of the device. + */ +#define kIOHIDVendorIDKey "VendorID" + +/*! + * @define kIOHIDProductIDKey + * + * @abstract + * Number property that describes the product ID of the device. + */ +#define kIOHIDProductIDKey "ProductID" + +/*! + * @define kIOHIDVersionNumberKey + * + * @abstract + * Number property that describes the version number of the device. + */ +#define kIOHIDVersionNumberKey "VersionNumber" + +/*! + * @define kIOHIDManufacturerKey + * + * @abstract + * String property that describes the manufacturer of the device. + */ +#define kIOHIDManufacturerKey "Manufacturer" + +/*! + * @define kIOHIDProductKey + * + * @abstract + * String property that describes the product of the device. + */ +#define kIOHIDProductKey "Product" + +/*! + * @define kIOHIDSerialNumberKey + * + * @abstract + * String property that describes the serial number of the device. + */ +#define kIOHIDSerialNumberKey "SerialNumber" + +/*! + * @define kIOHIDCountryCodeKey + * + * @abstract + * Number property that describes the country code of the device. + */ +#define kIOHIDCountryCodeKey "CountryCode" + +/*! + * @define kIOHIDLocationIDKey + * + * @abstract + * Number property that describes the location ID of the device. + */ +#define kIOHIDLocationIDKey "LocationID" + +/*! + * @define kIOHIDDeviceUsagePairsKey + * + * @abstract + * Array property that describes the top level usages of the device. The array + * will have dictionaries of usage pages/usages of each top level collection + * that exists on the device. + */ +#define kIOHIDDeviceUsagePairsKey "DeviceUsagePairs" + +/*! + * @define kIOHIDDeviceUsageKey + * + * @abstract + * Number property used in the device usage pairs array above. Describes a + * usage of the device. + */ +#define kIOHIDDeviceUsageKey "DeviceUsage" + +/*! + * @define kIOHIDDeviceUsagePageKey + * + * @abstract + * Number property used in the device usage pairs array above. Describes a + * usage page of the device. + */ +#define kIOHIDDeviceUsagePageKey "DeviceUsagePage" + +/*! + * @define kIOHIDPrimaryUsageKey + * + * @abstract + * Number property that describes the primary usage page of the device. + */ +#define kIOHIDPrimaryUsageKey "PrimaryUsage" + +/*! + * @define kIOHIDPrimaryUsagePageKey + * + * @abstract + * Number property that describes the primary usage of the device. + */ +#define kIOHIDPrimaryUsagePageKey "PrimaryUsagePage" + +/*! + * @define kIOHIDMaxInputReportSizeKey + * + * @abstract + * Number property that describes the max input report size of the device. This + * is derived from the report descriptor data provided in the + * kIOHIDReportDescriptorKey key. + */ +#define kIOHIDMaxInputReportSizeKey "MaxInputReportSize" + +/*! + * @define kIOHIDMaxOutputReportSizeKey + * + * @abstract + * Number property that describes the max output report size of the device. This + * is derived from the report descriptor data provided in the + * kIOHIDReportDescriptorKey key. + */ +#define kIOHIDMaxOutputReportSizeKey "MaxOutputReportSize" + +/*! + * @define kIOHIDMaxFeatureReportSizeKey + * + * @abstract + * Number property that describes the max feature report size of the device. + * This is derived from the report descriptor data provided in the + * kIOHIDReportDescriptorKey key. + */ +#define kIOHIDMaxFeatureReportSizeKey "MaxFeatureReportSize" + +/*! + * @define kIOHIDReportIntervalKey + * + * @abstract + * Number property set on the device from a client that describes the interval in us + * at which the client wishes to receive reports. It is up to the device to + * determine how to handle this key, if it chooses to do so. + */ +#define kIOHIDReportIntervalKey "ReportInterval" + +/*! + * @define kIOHIDBatchIntervalKey + * + * @abstract + * Number property set on the device from a client that describes the interval + * at which the client wishes to receive batched reports. It is up to the device + * to determine how to handle this key, if it chooses to do so. + */ +#define kIOHIDBatchIntervalKey "BatchInterval" + +/*! + * @define kIOHIDRequestTimeoutKey + * + * @abstract + * Number property that describes the request timeout in us for get/setReport calls. + * It is up to the device to determine how to handle this key, if it chooses to + * do so. + */ +#define kIOHIDRequestTimeoutKey "RequestTimeout" + +/*! + * @define kIOHIDReportDescriptorKey + * + * @abstract + * Data property that describes the report descriptor of the device. + */ +#define kIOHIDReportDescriptorKey "ReportDescriptor" + +/*! + * @define kIOHIDBuiltInKey + * + * @abstract + * Number property that describes if the device is built in. + */ +#define kIOHIDBuiltInKey "Built-In" + +/*! + * @define kIOHIDPhysicalDeviceUniqueIDKey + * + * @abstract + * String property that describes a unique identifier of the device. + */ +#define kIOHIDPhysicalDeviceUniqueIDKey "PhysicalDeviceUniqueID" + +#endif /* IOHIDDeviceKeys_h */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDDeviceTypes.h b/QualcommWireless/include/IOKit/hid/IOHIDDeviceTypes.h new file mode 100644 index 0000000..73cc226 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDDeviceTypes.h @@ -0,0 +1,294 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 2019 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef IOHIDDeviceTypes_h +#define IOHIDDeviceTypes_h + +#include + +#if TARGET_OS_DRIVERKIT +#include +#include +#else +#include +#include +#endif // TARGET_OS_DRIVERKIT + +/*! + * @typedef IOHIDReportType + * + * @abstract + * Describes different type of HID reports. + */ +enum IOHIDReportType { + kIOHIDReportTypeInput = 0, + kIOHIDReportTypeOutput, + kIOHIDReportTypeFeature, + kIOHIDReportTypeCount +}; +typedef enum IOHIDReportType IOHIDReportType; + +/*! + * @typedef IOHIDElementCommitDirection + * + * @abstract + * Commit direction passed in to the commit() function of an IOHIDElement. + * + * @field kIOHIDElementCommitDirectionIn + * Passing in kIOHIDElementCommitDirectionIn will issue a getReport call to the + * device, and the element will be updated with the value retrieved by the + * device. The value can be accessed via the getValue() or getDataValue() + * functions. + * + * @field kIOHIDElementCommitDirectionOut + * Passing in kIOHIDElementCommitDirectionOut will issue a setReport call to the + * device. Before issuing this call, the desired value should be set on the + * element with the setValue() or setDataValue() functions. + */ +typedef enum { + kIOHIDElementCommitDirectionIn, + kIOHIDElementCommitDirectionOut +} IOHIDElementCommitDirection; + +/*! + * @typedef IOHIDElementCookie + * + * @abstract + * Abstract data type used as a unique identifier for an element. + */ +#ifdef __LP64__ +typedef uint32_t IOHIDElementCookie; +#else +typedef void * IOHIDElementCookie; +#endif + +/*! + * @typedef IOHIDElementType + * + * @abstract + * Describes different types of HID elements. + * + * @discussion + * Used by the IOHIDFamily to identify the type of element processed. + * Represented by the key kIOHIDElementTypeKey in the dictionary describing the + * element. + * + * @field kIOHIDElementTypeInput_Misc + * Misc input data field or varying size. + * + * @field kIOHIDElementTypeInput_Button + * One bit input data field. + * + * @field kIOHIDElementTypeInput_Axis + * Input data field used to represent an axis. + * + * @field kIOHIDElementTypeInput_ScanCodes + * Input data field used to represent a scan code or usage selector. + * + * @field kIOHIDElementTypeInput_NULL + * Input data field used to represent the end of an input report when receiving + * input elements. + * + * @field kIOHIDElementTypeOutput + * Used to represent an output data field in a report. + * + * @field kIOHIDElementTypeFeature + * Describes input and output elements not intended for consumption by the end + * user. + * + * @field kIOHIDElementTypeCollection + * Element used to identify a relationship between two or more elements. + */ +enum IOHIDElementType { + kIOHIDElementTypeInput_Misc = 1, + kIOHIDElementTypeInput_Button = 2, + kIOHIDElementTypeInput_Axis = 3, + kIOHIDElementTypeInput_ScanCodes = 4, + kIOHIDElementTypeInput_NULL = 5, + kIOHIDElementTypeOutput = 129, + kIOHIDElementTypeFeature = 257, + kIOHIDElementTypeCollection = 513 +}; +typedef enum IOHIDElementType IOHIDElementType; + +enum { + kIOHIDElementFlagsConstantMask = 0x0001, + kIOHIDElementFlagsVariableMask = 0x0002, + kIOHIDElementFlagsRelativeMask = 0x0004, + kIOHIDElementFlagsWrapMask = 0x0008, + kIOHIDElementFlagsNonLinearMask = 0x0010, + kIOHIDElementFlagsNoPreferredMask = 0x0020, + kIOHIDElementFlagsNullStateMask = 0x0040, + kIOHIDElementFlagsVolativeMask = 0x0080, + kIOHIDElementFlagsBufferedByteMask = 0x0100 +}; +typedef uint32_t IOHIDElementFlags; + +/*! + * @typedef IOHIDElementCollectionType + * + * @abstract + * Describes different types of HID collections. + * + * @discussion + * Collections identify a relationship between two or more elements. + * + * @field kIOHIDElementCollectionTypePhysical + * Used for a set of data items that represent data points collected at one + * geometric point. + * + * @field kIOHIDElementCollectionTypeApplication + * Identifies item groups serving different purposes in a single device. + * + * @field kIOHIDElementCollectionTypeLogical + * Used when a set of data items form a composite data structure. + * + * @field kIOHIDElementCollectionTypeReport + * Wraps all the fields in a report. + * + * @field kIOHIDElementCollectionTypeNamedArray + * Contains an array of selector usages. + * + * @field kIOHIDElementCollectionTypeUsageSwitch + * Modifies the meaning of the usage it contains. + * + * @field kIOHIDElementCollectionTypeUsageModifier + * Modifies the meaning of the usage attached to the encompassing collection. + */ +enum IOHIDElementCollectionType{ + kIOHIDElementCollectionTypePhysical = 0x00, + kIOHIDElementCollectionTypeApplication, + kIOHIDElementCollectionTypeLogical, + kIOHIDElementCollectionTypeReport, + kIOHIDElementCollectionTypeNamedArray, + kIOHIDElementCollectionTypeUsageSwitch, + kIOHIDElementCollectionTypeUsageModifier +}; +typedef enum IOHIDElementCollectionType IOHIDElementCollectionType; + +/*! + * @typedef IOHIDValueScaleType + * + * @abstract + * Describes different types of scaling that can be performed on element values. + * + * @field kIOHIDValueScaleTypeCalibrated + * Type for value that is scaled with respect to the calibration properties. + * + * @field kIOHIDValueScaleTypePhysical + * Type for value that is scaled with respect to the physical min and physical + * max of the element. + * + * @field kIOHIDValueScaleTypeExponent + * Type for value that is scaled with respect to the element's unit exponent. + */ +enum { + kIOHIDValueScaleTypeCalibrated, + kIOHIDValueScaleTypePhysical, + kIOHIDValueScaleTypeExponent +}; +typedef uint32_t IOHIDValueScaleType; + +/*! + * @typedef IOHIDValueOptions + * + * @abstract + * Describes options for gathering element values. + * + * @field kIOHIDValueOptionsFlagRelativeSimple + * Compares against previous value + */ +enum { + kIOHIDValueOptionsFlagRelativeSimple = (1<<0), + kIOHIDValueOptionsFlagPrevious = (1<<1), + kIOHIDValueOptionsUpdateElementValues = (1<<2) +}; +typedef uint32_t IOHIDValueOptions; + +/*! + * @typedef IOHIDCompletionAction + * + * @abstract Function called when set/get report completes + * + * @param target + * The target specified in the IOHIDCompletion struct. + * + * @param parameter + * The parameter specified in the IOHIDCompletion struct. + * + * @param status + * Completion status + */ +typedef void (*IOHIDCompletionAction)(void *target, + void *parameter, + IOReturn status, + uint32_t bufferSizeRemaining); + +/*! + * @typedef IOHIDCompletion + * + * @abstract + * Struct spefifying action to perform when set/get report completes. + * + * @var target + * The target to pass to the action function. + * + * @var action + * The function to call. + * + * @var parameter + * The parameter to pass to the action function. + */ +typedef struct IOHIDCompletion { + void *target; + IOHIDCompletionAction action; + void *parameter; +} IOHIDCompletion; + +/*! + * @abstract + * Option bits for IOHIDDevice::handleReport, IOHIDDevice::getReport, and + * IOHIDDevice::setReport + * + * @field kIOHIDReportOptionNotInterrupt + * Tells method that the report passed was not interrupt driven. + */ +enum +{ + kIOHIDReportOptionNotInterrupt = 0x100, + kIOHIDReportOptionVariableSize = 0x200 +}; + +/*! + * @typedef HIDReportCommandType + * + * @abstract + * Type of the report command for DriverKit driver + */ +typedef enum { + kIOHIDReportCommandSetReport, + kIOHIDReportCommandGetReport +} HIDReportCommandType; + +#endif /* IOHIDDeviceTypes_h */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDElement.h b/QualcommWireless/include/IOKit/hid/IOHIDElement.h new file mode 100644 index 0000000..fa3ecec --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDElement.h @@ -0,0 +1,121 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDELEMENT_H +#define _IOKIT_HID_IOHIDELEMENT_H + +#include +#include +#include + +//=========================================================================== +// An object that describes a single HID element. + +class IOHIDElement : public OSCollection +{ + OSDeclareAbstractStructors( IOHIDElement ) + + /* Internal use only */ + struct ExpansionData { + }; + ExpansionData * _reserved; + + +public: + + virtual IOHIDElementCookie getCookie() = 0; + virtual IOHIDElement * getParentElement() = 0; + virtual OSArray * getChildElements() = 0; + virtual IOHIDElementType getType() = 0; + virtual IOHIDElementCollectionType getCollectionType() = 0; + virtual UInt32 getUsagePage() = 0; + virtual UInt32 getUsage() = 0; + virtual UInt32 getLogicalMin() = 0; + virtual UInt32 getLogicalMax() = 0; + virtual UInt32 getPhysicalMin() = 0; + virtual UInt32 getPhysicalMax() = 0; + virtual UInt32 getUnitExponent() = 0; + virtual UInt32 getUnit() = 0; + virtual UInt32 getReportSize() = 0; + virtual UInt32 getReportCount() = 0; + virtual UInt32 getReportID() = 0; + virtual UInt32 getFlags() = 0; + virtual AbsoluteTime getTimeStamp() = 0; + virtual UInt32 getValue() = 0; + virtual OSData * getDataValue() = 0; + virtual void setValue(UInt32 value) = 0; + virtual void setDataValue(OSData * value) = 0; + + OSMetaClassDeclareReservedUsed(IOHIDElement, 0); + virtual bool conformsTo(UInt32 usagePage, UInt32 usage=0) = 0; + + OSMetaClassDeclareReservedUsed(IOHIDElement, 1); + virtual void setCalibration(UInt32 min=0, UInt32 max=0, UInt32 saturationMin=0, UInt32 saturationMax=0, UInt32 deadZoneMin=0, UInt32 deadZoneMax=0, IOFixed granularity=0) = 0; + + OSMetaClassDeclareReservedUsed(IOHIDElement, 2); + virtual UInt32 getScaledValue(IOHIDValueScaleType type=kIOHIDValueScaleTypePhysical) = 0; + + OSMetaClassDeclareReservedUsed(IOHIDElement, 3); + virtual IOFixed getScaledFixedValue(IOHIDValueScaleType type=kIOHIDValueScaleTypePhysical) = 0; + + OSMetaClassDeclareReservedUsed(IOHIDElement, 4); + virtual UInt32 getValue(IOOptionBits options) = 0; + + OSMetaClassDeclareReservedUsed(IOHIDElement, 5); + virtual OSData * getDataValue(IOOptionBits options) = 0; + + OSMetaClassDeclareReservedUsed(IOHIDElement, 6); + virtual boolean_t isVariableSize() = 0; + + OSMetaClassDeclareReservedUsed(IOHIDElement, 7); + virtual IOFixed getScaledFixedValue(IOHIDValueScaleType type, IOOptionBits options) = 0; + + OSMetaClassDeclareReservedUnused(IOHIDElement, 8); + OSMetaClassDeclareReservedUnused(IOHIDElement, 9); + OSMetaClassDeclareReservedUnused(IOHIDElement, 10); + OSMetaClassDeclareReservedUnused(IOHIDElement, 11); + OSMetaClassDeclareReservedUnused(IOHIDElement, 12); + OSMetaClassDeclareReservedUnused(IOHIDElement, 13); + OSMetaClassDeclareReservedUnused(IOHIDElement, 14); + OSMetaClassDeclareReservedUnused(IOHIDElement, 15); + OSMetaClassDeclareReservedUnused(IOHIDElement, 16); + OSMetaClassDeclareReservedUnused(IOHIDElement, 17); + OSMetaClassDeclareReservedUnused(IOHIDElement, 18); + OSMetaClassDeclareReservedUnused(IOHIDElement, 19); + OSMetaClassDeclareReservedUnused(IOHIDElement, 20); + OSMetaClassDeclareReservedUnused(IOHIDElement, 21); + OSMetaClassDeclareReservedUnused(IOHIDElement, 22); + OSMetaClassDeclareReservedUnused(IOHIDElement, 23); + OSMetaClassDeclareReservedUnused(IOHIDElement, 24); + OSMetaClassDeclareReservedUnused(IOHIDElement, 25); + OSMetaClassDeclareReservedUnused(IOHIDElement, 26); + OSMetaClassDeclareReservedUnused(IOHIDElement, 27); + OSMetaClassDeclareReservedUnused(IOHIDElement, 28); + OSMetaClassDeclareReservedUnused(IOHIDElement, 29); + OSMetaClassDeclareReservedUnused(IOHIDElement, 30); + OSMetaClassDeclareReservedUnused(IOHIDElement, 31); + +}; + +#endif /* !_IOKIT_HID_IOHIDELEMENT_H */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDEvent.h b/QualcommWireless/include/IOKit/hid/IOHIDEvent.h new file mode 100644 index 0000000..45aefe8 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDEvent.h @@ -0,0 +1,464 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOHIDEVENT_H +#define _IOKIT_IOHIDEVENT_H + +#include +#include +#if KERNEL +#include +#include +#include +#endif /*KERNEL*/ +#include +#include + +#if TARGET_OS_OSX +#include +#endif /*TARGET_OS_OSX*/ + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +#define ALIGNED_DATA_SIZE(data_size,align_size) ((((data_size - 1) / align_size) + 1) * align_size) + +typedef struct IOHIDEventData IOHIDEventData; + +class IOHIDEvent : public OSObject +{ + OSDeclareAbstractStructors( IOHIDEvent ) + + IOHIDEventData * _data; + OSArray * _children; + IOHIDEvent * _parent; + size_t _capacity; + AbsoluteTime _timeStamp; + UInt64 _senderID; + uint64_t _typeMask; + IOOptionBits _options; + UInt32 _eventCount; + + bool initWithCapacity(IOByteCount capacity); + bool initWithType(IOHIDEventType type, IOByteCount additionalCapacity=0); + bool initWithTypeTimeStamp(IOHIDEventType type, AbsoluteTime timeStamp, IOOptionBits options = 0, IOByteCount additionalCapacity=0); + IOByteCount getLength(UInt32 * eventCount); + IOByteCount appendBytes(UInt8 * bytes, IOByteCount withLength); + + static IOHIDEvent * _axisEvent ( IOHIDEventType type, + AbsoluteTime timeStamp, + IOFixed x, + IOFixed y, + IOFixed z, + IOOptionBits options = 0); + + static IOHIDEvent * _motionEvent ( IOHIDEventType type, + AbsoluteTime timeStamp, + IOFixed x, + IOFixed y, + IOFixed z, + uint32_t motionType = 0, + uint32_t motionSubType = 0, + UInt32 sequence = 0, + IOOptionBits options = 0); + +public: + static IOHIDEvent * withBytes( const void * bytes, + IOByteCount size); + + static IOHIDEvent * withType( IOHIDEventType type = kIOHIDEventTypeNULL, + IOOptionBits options = 0); + + static IOHIDEvent * keyboardEvent( + AbsoluteTime timeStamp, + UInt32 usagePage, + UInt32 usage, + Boolean down, + IOOptionBits options = 0); + + static IOHIDEvent * keyboardEvent( + AbsoluteTime timeStamp, + UInt32 usagePage, + UInt32 usage, + Boolean down, + UInt8 pressCount, + Boolean longPress, + UInt8 clickSpeed, + IOOptionBits options = 0); + + + static IOHIDEvent * translationEvent ( + AbsoluteTime timeStamp, + IOFixed x, + IOFixed y, + IOFixed z, + IOOptionBits options = 0); + + static IOHIDEvent * scrollEventWithFixed ( + AbsoluteTime timeStamp, + IOFixed x, + IOFixed y, + IOFixed z, + IOOptionBits options = 0); + + static IOHIDEvent * scrollEvent ( + AbsoluteTime timeStamp, + SInt32 x, + SInt32 y, + SInt32 z, + IOOptionBits options = 0); + + static IOHIDEvent * zoomEvent ( + AbsoluteTime timeStamp, + IOFixed x, + IOFixed y, + IOFixed z, + IOOptionBits options = 0); + + static IOHIDEvent * accelerometerEvent ( + AbsoluteTime timeStamp, + IOFixed x, + IOFixed y, + IOFixed z, + IOHIDMotionType type = 0, + IOHIDMotionPath subType = 0, + UInt32 sequence = 0, + IOOptionBits options = 0); + + static IOHIDEvent * gyroEvent ( AbsoluteTime timeStamp, + IOFixed x, + IOFixed y, + IOFixed z, + IOHIDMotionType type = 0, + IOHIDMotionPath subType = 0, + UInt32 sequence = 0, + IOOptionBits options = 0); + + static IOHIDEvent * compassEvent ( + AbsoluteTime timeStamp, + IOFixed x, + IOFixed y, + IOFixed z, + IOHIDMotionType type = 0, + IOHIDMotionPath subType = 0, + UInt32 sequence = 0, + IOOptionBits options = 0); + + static IOHIDEvent * buttonEvent ( + AbsoluteTime timeStamp, + UInt32 mask, + UInt8 number, + bool state, + IOOptionBits options = 0); + + static IOHIDEvent * buttonEvent ( + AbsoluteTime timeStamp, + UInt32 mask, + UInt8 number, + IOFixed pressure, + IOOptionBits options = 0); + + static IOHIDEvent * ambientLightSensorEvent ( + AbsoluteTime timeStamp, + UInt32 level, + UInt32 channel0 = 0, + UInt32 channel1 = 0, + UInt32 channel2 = 0, + UInt32 channel3 = 0, + IOOptionBits options = 0); + + static IOHIDEvent * ambientLightSensorEvent( + AbsoluteTime timeStamp, + UInt32 level, + UInt8 colorSpace, + IOHIDDouble colorComponent0, + IOHIDDouble colorComponent1, + IOHIDDouble colorComponent2, + IOOptionBits options); + + static IOHIDEvent * proximityEvent ( + AbsoluteTime timeStamp, + IOHIDProximityDetectionMask mask, + UInt32 level, + IOOptionBits options = 0); + + static IOHIDEvent * temperatureEvent ( + AbsoluteTime timeStamp, + IOFixed temperature, + IOOptionBits options = 0); + + + static IOHIDEvent * relativePointerEventWithFixed( + AbsoluteTime timeStamp, + IOFixed x, + IOFixed y, + IOFixed z, + UInt32 buttonState, + UInt32 oldButtonState = 0, + IOOptionBits options = 0); + + static IOHIDEvent * relativePointerEvent( + AbsoluteTime timeStamp, + SInt32 x, + SInt32 y, + SInt32 z, + UInt32 buttonState, + UInt32 oldButtonState = 0, + IOOptionBits options = 0); + + static IOHIDEvent * absolutePointerEvent( + AbsoluteTime timeStamp, + IOFixed x, + IOFixed y, + IOFixed z, + UInt32 buttonState, + UInt32 oldButtonState = 0, + IOOptionBits options = 0); + + static IOHIDEvent * multiAxisPointerEvent( + AbsoluteTime timeStamp, + IOFixed x, + IOFixed y, + IOFixed z, + IOFixed rX, + IOFixed rY, + IOFixed rZ, + UInt32 buttonState, + UInt32 oldButtonState = 0, + IOOptionBits options = 0); + + static IOHIDEvent * digitizerEvent( + AbsoluteTime timeStamp, + UInt32 transducerID, + IOHIDDigitizerTransducerType type, + bool inRange, + UInt32 buttonState, + IOFixed x, + IOFixed y, + IOFixed z = 0, + IOFixed tipPressure = 0, + IOFixed auxPressure = 0, + IOFixed twist = 0, + IOOptionBits options = 0 ); + + static IOHIDEvent * digitizerEventWithTiltOrientation( + AbsoluteTime timeStamp, + UInt32 transducerID, + IOHIDDigitizerTransducerType type, + bool inRange, + UInt32 buttonState, + IOFixed x, + IOFixed y, + IOFixed z = 0, + IOFixed tipPressure = 0, + IOFixed auxPressure = 0, + IOFixed twist = 0, + IOFixed xTilt = 0, + IOFixed yTilt = 0, + IOOptionBits options = 0 ); + + static IOHIDEvent * digitizerEventWithPolarOrientation( + AbsoluteTime timeStamp, + UInt32 transducerID, + IOHIDDigitizerTransducerType type, + bool inRange, + UInt32 buttonState, + IOFixed x, + IOFixed y, + IOFixed z = 0, + IOFixed tipPressure = 0, + IOFixed auxPressure = 0, + IOFixed twist = 0, + IOFixed altitude = 0, + IOFixed azimuth = 0, + IOOptionBits options = 0 ); + + static IOHIDEvent * digitizerEventWithPolarOrientation( + AbsoluteTime timeStamp, + UInt32 transducerID, + IOHIDDigitizerTransducerType type, + bool inRange, + UInt32 buttonState, + IOFixed x, + IOFixed y, + IOFixed z = 0, + IOFixed tipPressure = 0, + IOFixed auxPressure = 0, + IOFixed twist = 0, + IOFixed altitude = 0, + IOFixed azimuth = 0, + IOFixed quality = 0, + IOFixed density = 0, + IOOptionBits options = 0 ); + + static IOHIDEvent * digitizerEventWithPolarOrientation( + AbsoluteTime timeStamp, + UInt32 transducerID, + IOHIDDigitizerTransducerType type, + bool inRange, + UInt32 buttonState, + IOFixed x, + IOFixed y, + IOFixed z = 0, + IOFixed tipPressure = 0, + IOFixed auxPressure = 0, + IOFixed twist = 0, + IOFixed altitude = 0, + IOFixed azimuth = 0, + IOFixed quality = 0, + IOFixed density = 0, + IOFixed majorRadius = 6<<16, + IOFixed minorRadius = 6<<16, + IOOptionBits options = 0 ); + + static IOHIDEvent * digitizerEventWithQualityOrientation( + AbsoluteTime timeStamp, + UInt32 transducerID, + IOHIDDigitizerTransducerType type, + bool inRange, + UInt32 buttonState, + IOFixed x, + IOFixed y, + IOFixed z = 0, + IOFixed tipPressure = 0, + IOFixed auxPressure = 0, + IOFixed twist = 0, + IOFixed quality = 0, + IOFixed density = 0, + IOFixed irregularity = 0, + IOFixed majorRadius = 6<<16, + IOFixed minorRadius = 6<<16, + IOOptionBits options = 0 ); + + static IOHIDEvent * powerEvent( + AbsoluteTime timeStamp, + int64_t measurement, + IOHIDPowerType powerType, + IOHIDPowerSubType powerSubType = 0, + IOOptionBits options = 0); + + static IOHIDEvent * vendorDefinedEvent( + AbsoluteTime timeStamp, + UInt32 usagePage, + UInt32 usage, + UInt32 version, + UInt8 * data, + UInt32 length, + IOOptionBits options = 0); + + static IOHIDEvent * biometricEvent(AbsoluteTime timeStamp, IOFixed level, IOHIDBiometricEventType eventType, IOOptionBits options=0); + + static IOHIDEvent * biometricEvent(AbsoluteTime timeStamp, IOFixed level, IOHIDBiometricEventType eventType, UInt32 usagePage, UInt32 usage, UInt8 tapCount, IOOptionBits options=0); + + static IOHIDEvent * atmosphericPressureEvent(AbsoluteTime timeStamp, IOFixed level, UInt32 sequence=0, IOOptionBits options=0); + + static IOHIDEvent * unicodeEvent(AbsoluteTime timeStamp, UInt8 * payload, UInt32 length, IOHIDUnicodeEncodingType encoding, IOFixed quality, IOOptionBits options); + + static IOHIDEvent * standardGameControllerEvent( + AbsoluteTime timeStamp, + IOFixed dpadUp, + IOFixed dpadDown, + IOFixed dpadLeft, + IOFixed dpadRight, + IOFixed faceX, + IOFixed faceY, + IOFixed faceA, + IOFixed faceB, + IOFixed shoulderL, + IOFixed shoulderR, + IOOptionBits options = 0); + + static IOHIDEvent * extendedGameControllerEvent( + AbsoluteTime timeStamp, + IOFixed dpadUp, + IOFixed dpadDown, + IOFixed dpadLeft, + IOFixed dpadRight, + IOFixed faceX, + IOFixed faceY, + IOFixed faceA, + IOFixed faceB, + IOFixed shoulderL1, + IOFixed shoulderR1, + IOFixed shoulderL2, + IOFixed shoulderR2, + IOFixed joystickX, + IOFixed joystickY, + IOFixed joystickZ, + IOFixed joystickRz, + IOOptionBits options = 0); + + + static IOHIDEvent * orientationEvent(AbsoluteTime timeStamp, UInt32 orientationType, IOOptionBits options = 0); + + static IOHIDEvent * humidityEvent(AbsoluteTime timeStamp, IOFixed rh, UInt32 sequence=0, IOOptionBits options=0); + + static IOHIDEvent * brightnessEvent(AbsoluteTime timeStamp, IOFixed currentBrightness, IOFixed targetBrightness, UInt64 transitionTime, IOOptionBits options = 0); + + static IOHIDEvent * genericGestureEvent(AbsoluteTime timeStamp, IOHIDGenericGestureType gestureType, IOOptionBits options = 0); + + virtual void appendChild(IOHIDEvent *childEvent); + OSArray* getChildren(); + + virtual AbsoluteTime getTimeStamp(); + virtual void setTimeStamp(AbsoluteTime timeStamp); + + virtual IOHIDEventType getType(); + virtual void setType(IOHIDEventType type); + + virtual IOHIDEventPhaseBits getPhase(); + virtual void setPhase(IOHIDEventPhaseBits phase); + + virtual IOHIDEvent * getEvent(IOHIDEventType type, IOOptionBits options = 0); + + virtual SInt32 getIntegerValue( + IOHIDEventField key, IOOptionBits options = 0); + virtual void setIntegerValue( + IOHIDEventField key, SInt32 value, IOOptionBits options = 0); + + virtual IOFixed getFixedValue(IOHIDEventField key, IOOptionBits options = 0); + virtual void setFixedValue(IOHIDEventField key, IOFixed value, IOOptionBits options = 0); + + virtual UInt8 * getDataValue(IOHIDEventField key, IOOptionBits options = 0); + + virtual void free(void) APPLE_KEXT_OVERRIDE; + + virtual size_t getLength(); + virtual IOByteCount readBytes(void *bytes, IOByteCount withLength); +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + virtual OSData *createBytes(); +#endif + + virtual void setSenderID(uint64_t senderID); + + virtual uint64_t getLatency(uint32_t scaleFactor); + + virtual IOHIDDouble getDoubleValue( IOHIDEventField key, IOOptionBits options); + virtual void setDoubleValue( IOHIDEventField key, IOHIDDouble value, IOOptionBits options); + + inline IOOptionBits getOptions() { return _options; }; + +}; + +#endif /* _IOKIT_IOHIDEVENT_H */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDEventDriver.h b/QualcommWireless/include/IOKit/hid/IOHIDEventDriver.h new file mode 100644 index 0000000..09de75f --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDEventDriver.h @@ -0,0 +1,385 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDEVENTDRIVER_H +#define _IOKIT_HID_IOHIDEVENTDRIVER_H + +#include +#include +#include +#include +#include +#include + +class DigitizerTransducer; +class EventElementCollection; +class IOHIDEvent; + +/*! @class IOHIDEventDriver : public IOHIDEventService + @abstract + @discussion +*/ +class IOHIDEventDriver : public IOHIDEventService +{ + OSDeclareDefaultStructors( IOHIDEventDriver ) + +private: + IOHIDInterface * _interface; + void * _reservedVoid[3] __unused; + + OSArray * _supportedElements; + + UInt32 _bootSupport; + bool _multipleReports; + bool _authenticatedDevice; + bool _reservedBool __unused; + UInt32 _reservedUInt32 __unused; + bool _reservedBool1 __unused; + + + struct ExpansionData { + SInt32 absoluteAxisRemovalPercentage; + SInt32 preferredAxisRemovalPercentage; + + struct { + OSArray * elements; + } led; + + struct { + OSArray * elements; + } scroll; + + struct { + OSArray * elements; + bool disabled; + } relative; + + struct { + OSArray * elements; + OSArray * blessedUsagePairs; + UInt8 bootMouseData[4]; + bool appleVendorSupported; + IOHIDElement * keyboardPower; + } keyboard; + + struct { + IOHIDElement * deviceModeElement; + OSArray * transducers; + IOHIDElement * touchCancelElement; + bool native; + bool collectionDispatch; + IOFixed centroidX; + IOFixed centroidY; + IOHIDElement * relativeScanTime; + IOHIDElement * surfaceSwitch; + IOHIDElement * reportRate; + } digitizer; + + struct { + OSArray * elements; + + UInt32 capable; + UInt32 sendingReportID; + IOFixed axis[6]; + UInt32 buttonState; + IOOptionBits options; + bool disabled; + } multiAxis; + + struct { + IOHIDElement * gestureStateElement; + OSArray * legacyElements; + OSArray * gesturesCandidates; + } unicode; + + struct { + bool extended; + bool formFitting; + OSArray * elements; + UInt32 capable; + UInt32 sendingReportID; + + struct { + IOFixed up; + IOFixed down; + IOFixed left; + IOFixed right; + } dpad; + + struct { + IOFixed x; + IOFixed y; + IOFixed a; + IOFixed b; + }face; + + struct { + IOFixed x; + IOFixed y; + IOFixed z; + IOFixed rz; + } joystick; + + struct { + IOFixed l1; + IOFixed l2; + IOFixed r1; + IOFixed r2; + } shoulder; + + struct { + unsigned int left; + unsigned int right; + } thumbstick; + + } gameController; + + struct { + OSArray * childElements; + OSArray * primaryElements; + OSArray * pendingEvents; + } vendorMessage; + + struct { + OSArray * elements; + } biometric; + + struct { + OSArray * elements; + } accel; + + struct { + OSArray * elements; + } gyro; + + struct { + OSArray * elements; + } compass; + + struct { + OSArray * elements; + } temperature; + + struct { + IOHIDElement * reportInterval; + IOHIDElement * maxFIFOEvents; + IOHIDElement * reportLatency; + IOHIDElement * sniffControl; + } sensorProperty; + + struct { + OSArray * cmElements; + OSArray * tiltElements; + } orientation; + + UInt64 lastReportTime; + + IOWorkLoop * workLoop; + IOCommandGate * commandGate; + }; + + ExpansionData * _reserved; + + bool getBlessedUsagePairs(); + bool parseElements(OSArray * elementArray, UInt32 bootProtocol); + bool parseRelativeElement(IOHIDElement * element); + bool parseMultiAxisElement(IOHIDElement * element); + bool parseGameControllerElement(IOHIDElement * element); + bool parseDigitizerElement(IOHIDElement * element); + bool parseDigitizerTransducerElement(IOHIDElement * element, IOHIDElement * parent=NULL); + bool parseScrollElement(IOHIDElement * element); + bool parseLEDElement(IOHIDElement * element); + bool parseKeyboardElement(IOHIDElement * element); + bool parseUnicodeElement(IOHIDElement * element); + bool parseLegacyUnicodeElement(IOHIDElement * element); + bool parseGestureUnicodeElement(IOHIDElement * element); + bool parseVendorMessageElement(IOHIDElement * element); + bool parseBiometricElement(IOHIDElement * element); + bool parseAccelElement(IOHIDElement * element); + bool parseGyroElement(IOHIDElement * element); + bool parseCompassElement(IOHIDElement * element); + bool parseTemperatureElement(IOHIDElement * element); + bool parseSensorPropertyElement(IOHIDElement * element); + bool parseDeviceOrientationElement(IOHIDElement * element); + + void processDigitizerElements(); + void processMultiAxisElements(); + void processGameControllerElements(); + void processUnicodeElements(); + + void setRelativeProperties(); + void setDigitizerProperties(); + void setGameControllerProperties(); + void setMultiAxisProperties(); + void setScrollProperties(); + void setLEDProperties(); + void setKeyboardProperties(); + void setUnicodeProperties(); + void setAccelerationProperties(); + void setVendorMessageProperties(); + void setBiometricProperties(); + void setAccelProperties(); + void setGyroProperties(); + void setCompassProperties(); + void setTemperatureProperties(); + void setSensorProperties(); + void setDeviceOrientationProperties(); + void setSurfaceDimensions(); + + UInt32 checkGameControllerElement(IOHIDElement * element); + UInt32 checkMultiAxisElement(IOHIDElement * element); + + static void calibrateJustifiedPreferredStateElement(IOHIDElement * element, SInt32 removalPercentage); + static void calibrateCenteredPreferredStateElement(IOHIDElement * element, SInt32 removalPercentage); + + void handleBootPointingReport(AbsoluteTime timeStamp, IOMemoryDescriptor * report, UInt32 reportID); + void handleRelativeReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleGameControllerReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleMultiAxisPointerReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleDigitizerCollectionReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleDigitizerReport(AbsoluteTime timeStamp, UInt32 reportID); + IOHIDEvent* handleDigitizerTransducerReport(DigitizerTransducer * transducer, AbsoluteTime timeStamp, UInt32 reportID); + void handleScrollReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleKeboardReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleUnicodeReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleUnicodeLegacyReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleUnicodeGestureReport(AbsoluteTime timeStamp, UInt32 reportID); + IOHIDEvent * handleUnicodeGestureCandidateReport(EventElementCollection * candidate, AbsoluteTime timeStamp, UInt32 reportID); + + void handleVendorMessageReport(AbsoluteTime timeStamp, IOMemoryDescriptor * report, UInt32 reportID, int phase); + void handleBiometricReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleAccelReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleGyroReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleCompassReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleTemperatureReport(AbsoluteTime timeStamp, UInt32 reportID); + void handleDeviceOrientationReport(AbsoluteTime timeStamp, UInt32 reportID); + + bool serializeCharacterGestureState(void * ref, OSSerialize * serializer); + bool conformTo (UInt32 usagePage, UInt32 usage); + IOHIDEvent* createDigitizerTransducerEventForReport(DigitizerTransducer * transducer, AbsoluteTime timeStamp, UInt32 reportID); + bool serializeDebugState(void * ref, OSSerialize * serializer); + +protected: + + virtual void free(void) APPLE_KEXT_OVERRIDE; + + virtual OSArray * getReportElements(void) APPLE_KEXT_OVERRIDE; + + virtual bool handleStart( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual void handleStop( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual void handleInterruptReport ( + AbsoluteTime timeStamp, + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID); + + virtual OSString * getTransport (void) APPLE_KEXT_OVERRIDE; + + virtual UInt32 getLocationID (void) APPLE_KEXT_OVERRIDE; + + virtual UInt32 getVendorID (void) APPLE_KEXT_OVERRIDE; + + virtual UInt32 getVendorIDSource (void) APPLE_KEXT_OVERRIDE; + + virtual UInt32 getProductID (void) APPLE_KEXT_OVERRIDE; + + virtual UInt32 getVersion (void) APPLE_KEXT_OVERRIDE; + + virtual UInt32 getCountryCode (void) APPLE_KEXT_OVERRIDE; + + virtual OSString * getManufacturer (void) APPLE_KEXT_OVERRIDE; + + virtual OSString * getProduct (void) APPLE_KEXT_OVERRIDE; + + virtual OSString * getSerialNumber (void) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setElementValue ( + UInt32 usagePage, + UInt32 usage, + UInt32 value ) APPLE_KEXT_OVERRIDE; + + virtual UInt32 getElementValue ( + UInt32 usagePage, + UInt32 usage ) APPLE_KEXT_OVERRIDE; + + virtual void dispatchEvent(IOHIDEvent * event, IOOptionBits options=0) APPLE_KEXT_OVERRIDE; + +public: + + + virtual bool init( OSDictionary * dictionary = 0 ) APPLE_KEXT_OVERRIDE; + + virtual bool didTerminate( + IOService * provider, + IOOptionBits options, + bool * defer ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE; + + virtual IOHIDEvent * copyEvent( + IOHIDEventType type, + IOHIDEvent * matching = 0, + IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + + virtual IOHIDEvent *copyMatchingEvent(OSDictionary *matching) APPLE_KEXT_OVERRIDE; + + + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 0); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 1); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 2); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 3); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 4); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 5); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 6); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 7); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 8); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 9); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 10); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 11); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 12); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 13); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 14); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 15); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 16); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 17); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 18); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 19); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 20); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 21); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 22); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 23); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 24); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 25); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 26); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 27); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 28); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 29); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 30); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 31); + +}; + +#endif /* !_IOKIT_HID_IOHIDEVENTDRIVER_H */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDEventFieldDefs.h b/QualcommWireless/include/IOKit/hid/IOHIDEventFieldDefs.h new file mode 100644 index 0000000..32aeaa5 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDEventFieldDefs.h @@ -0,0 +1,316 @@ +/* +* +* @APPLE_LICENSE_HEADER_START@ +* +* Copyright (c) 2017 Apple Computer, Inc. All Rights Reserved. +* +* This file contains Original Code and/or Modifications of Original Code +* as defined in and that are subject to the Apple Public Source License +* Version 2.0 (the 'License'). You may not use this file except in +* compliance with the License. Please obtain a copy of the License at +* http://www.opensource.apple.com/apsl/ and read it before using this +* file. +* +* The Original Code and all software distributed under the License are +* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +* Please see the License for the specific language governing rights and +* limitations under the License. +* +* @APPLE_LICENSE_HEADER_END@ +*/ + +// +// DO NOT EDIT THIS FILE. IT IS AUTO-GENERATED +// + +#ifndef _IOHIDEVENTFIELDDEFS_H +#define _IOHIDEVENTFIELDDEFS_H + +#define kIOHIDEventFieldVendorDefinedBase IOHIDEventFieldBase(kIOHIDEventTypeVendorDefined) +static const IOHIDEventField kIOHIDEventFieldVendorDefinedDataLength = (kIOHIDEventFieldVendorDefinedBase | 3); +static const IOHIDEventField kIOHIDEventFieldVendorDefinedVersion = (kIOHIDEventFieldVendorDefinedBase | 2); +static const IOHIDEventField kIOHIDEventFieldVendorDefinedUsage = (kIOHIDEventFieldVendorDefinedBase | 1); +static const IOHIDEventField kIOHIDEventFieldVendorDefinedData = (kIOHIDEventFieldVendorDefinedBase | 4); +static const IOHIDEventField kIOHIDEventFieldVendorDefinedUsagePage = (kIOHIDEventFieldVendorDefinedBase | 0); + +#define kIOHIDEventFieldScaleBase IOHIDEventFieldBase(kIOHIDEventTypeScale) +static const IOHIDEventField kIOHIDEventFieldScaleZ = (kIOHIDEventFieldScaleBase | 2); +static const IOHIDEventField kIOHIDEventFieldScaleX = (kIOHIDEventFieldScaleBase | 0); +static const IOHIDEventField kIOHIDEventFieldScaleY = (kIOHIDEventFieldScaleBase | 1); + +#define kIOHIDEventFieldSymbolicHotKeyBase IOHIDEventFieldBase(kIOHIDEventTypeSymbolicHotKey) +static const IOHIDEventField kIOHIDEventFieldSymbolicHotKeyValue = (kIOHIDEventFieldSymbolicHotKeyBase | 0); +static const IOHIDEventField kIOHIDEventFieldSymbolicHotKeyIsCGSEvent = (kIOHIDEventFieldSymbolicHotKeyBase | 1); + +#define kIOHIDEventFieldTemperatureBase IOHIDEventFieldBase(kIOHIDEventTypeTemperature) +static const IOHIDEventField kIOHIDEventFieldTemperatureLevel = (kIOHIDEventFieldTemperatureBase | 0); + +#define kIOHIDEventFieldAccelerometerBase IOHIDEventFieldBase(kIOHIDEventTypeAccelerometer) +static const IOHIDEventField kIOHIDEventFieldAccelerometerY = (kIOHIDEventFieldAccelerometerBase | 1); +static const IOHIDEventField kIOHIDEventFieldAccelerometerX = (kIOHIDEventFieldAccelerometerBase | 0); +static const IOHIDEventField kIOHIDEventFieldAccelerometerZ = (kIOHIDEventFieldAccelerometerBase | 2); +static const IOHIDEventField kIOHIDEventFieldAccelerometerType = (kIOHIDEventFieldAccelerometerBase | 3); +static const IOHIDEventField kIOHIDEventFieldAccelerometerSubType = (kIOHIDEventFieldAccelerometerBase | 4); +static const IOHIDEventField kIOHIDEventFieldAccelerometerSequence = (kIOHIDEventFieldAccelerometerBase | 5); + +#define kIOHIDEventFieldProgressBase IOHIDEventFieldBase(kIOHIDEventTypeProgress) +static const IOHIDEventField kIOHIDEventFieldProgressLevel = (kIOHIDEventFieldProgressBase | 1); +static const IOHIDEventField kIOHIDEventFieldProgressEventType = (kIOHIDEventFieldProgressBase | 0); + +#define kIOHIDEventFieldGenericGestureBase IOHIDEventFieldBase(kIOHIDEventTypeGenericGesture) +static const IOHIDEventField kIOHIDEventFieldGenericGestureTypeTapCount = (kIOHIDEventFieldGenericGestureBase | 1); +static const IOHIDEventField kIOHIDEventFieldGenericGestureType = (kIOHIDEventFieldGenericGestureBase | 0); +static const IOHIDEventField kIOHIDEventFieldGenericGestureTypeSwipeProgress = (kIOHIDEventFieldGenericGestureBase | 2); + +#define kIOHIDEventFieldNULLBase IOHIDEventFieldBase(kIOHIDEventTypeNULL) +static const IOHIDEventField kIOHIDEventFieldIsRelative = (kIOHIDEventFieldNULLBase | 0); +static const IOHIDEventField kIOHIDEventFieldIsCenterOrigin = (kIOHIDEventFieldNULLBase | 3); +static const IOHIDEventField kIOHIDEventFieldIsBuiltIn = (kIOHIDEventFieldNULLBase | 4); +static const IOHIDEventField kIOHIDEventFieldIsPixelUnits = (kIOHIDEventFieldNULLBase | 2); +static const IOHIDEventField kIOHIDEventFieldIsCollection = (kIOHIDEventFieldNULLBase | 1); + +#define kIOHIDEventFieldAmbientLightSensorBase IOHIDEventFieldBase(kIOHIDEventTypeAmbientLightSensor) +static const IOHIDEventField kIOHIDEventFieldAmbientLightColorSpace = (kIOHIDEventFieldAmbientLightSensorBase | 6); +static const IOHIDEventField kIOHIDEventFieldAmbientLightColorComponent2 = (kIOHIDEventFieldAmbientLightSensorBase | 9); +static const IOHIDEventField kIOHIDEventFieldAmbientLightColorComponent1 = (kIOHIDEventFieldAmbientLightSensorBase | 8); +static const IOHIDEventField kIOHIDEventFieldAmbientLightColorComponent0 = (kIOHIDEventFieldAmbientLightSensorBase | 7); +static const IOHIDEventField kIOHIDEventFieldAmbientLightSensorRawChannel0 = (kIOHIDEventFieldAmbientLightSensorBase | 1); +static const IOHIDEventField kIOHIDEventFieldAmbientLightSensorRawChannel1 = (kIOHIDEventFieldAmbientLightSensorBase | 2); +static const IOHIDEventField kIOHIDEventFieldAmbientLightSensorRawChannel2 = (kIOHIDEventFieldAmbientLightSensorBase | 3); +static const IOHIDEventField kIOHIDEventFieldAmbientLightSensorRawChannel3 = (kIOHIDEventFieldAmbientLightSensorBase | 4); +static const IOHIDEventField kIOHIDEventFieldAmbientLightSensorLevel = (kIOHIDEventFieldAmbientLightSensorBase | 0); +static const IOHIDEventField kIOHIDEventFieldAmbientLightSensorIlluminance = (kIOHIDEventFieldAmbientLightSensorBase | 11); +static const IOHIDEventField kIOHIDEventFieldAmbientLightDisplayBrightnessChanged = (kIOHIDEventFieldAmbientLightSensorBase | 5); +static const IOHIDEventField kIOHIDEventFieldAmbientLightSensorColorTemperature = (kIOHIDEventFieldAmbientLightSensorBase | 10); + +#define kIOHIDEventFieldPowerBase IOHIDEventFieldBase(kIOHIDEventTypePower) +static const IOHIDEventField kIOHIDEventFieldPowerType = (kIOHIDEventFieldPowerBase | 1); +static const IOHIDEventField kIOHIDEventFieldPowerSubType = (kIOHIDEventFieldPowerBase | 2); +static const IOHIDEventField kIOHIDEventFieldPowerMeasurement = (kIOHIDEventFieldPowerBase | 0); + +#define kIOHIDEventFieldForceBase IOHIDEventFieldBase(kIOHIDEventTypeForce) +static const IOHIDEventField kIOHIDEventFieldForceStagePressure = (kIOHIDEventFieldForceBase | 3); +static const IOHIDEventField kIOHIDEventFieldForceStage = (kIOHIDEventFieldForceBase | 2); +static const IOHIDEventField kIOHIDEventFieldForceProgress = (kIOHIDEventFieldForceBase | 1); +static const IOHIDEventField kIOHIDEventFieldForceBehavior = (kIOHIDEventFieldForceBase | 0); + +#define kIOHIDEventFieldMotionGestureBase IOHIDEventFieldBase(kIOHIDEventTypeMotionGesture) +static const IOHIDEventField kIOHIDEventFieldMotionGestureProgress = (kIOHIDEventFieldMotionGestureBase | 1); +static const IOHIDEventField kIOHIDEventFieldMotionGestureGestureType = (kIOHIDEventFieldMotionGestureBase | 0); + +#define kIOHIDEventFieldGameControllerBase IOHIDEventFieldBase(kIOHIDEventTypeGameController) +static const IOHIDEventField kIOHIDEventFieldGameControllerJoyStickAxisX = (kIOHIDEventFieldGameControllerBase | 13); +static const IOHIDEventField kIOHIDEventFieldGameControllerJoyStickAxisY = (kIOHIDEventFieldGameControllerBase | 14); +static const IOHIDEventField kIOHIDEventFieldGameControllerType = (kIOHIDEventFieldGameControllerBase | 0); +static const IOHIDEventField kIOHIDEventFieldGameControllerDirectionPadRight = (kIOHIDEventFieldGameControllerBase | 4); +static const IOHIDEventField kIOHIDEventFieldGameControllerShoulderButtonR1 = (kIOHIDEventFieldGameControllerBase | 10); +static const IOHIDEventField kIOHIDEventFieldGameControllerFaceButtonA = (kIOHIDEventFieldGameControllerBase | 5); +static const IOHIDEventField kIOHIDEventFieldGameControllerFaceButtonB = (kIOHIDEventFieldGameControllerBase | 6); +static const IOHIDEventField kIOHIDEventFieldGameControllerDirectionPadLeft = (kIOHIDEventFieldGameControllerBase | 3); +static const IOHIDEventField kIOHIDEventFieldGameControllerThumbstickButtonRight = (kIOHIDEventFieldGameControllerBase | 18); +static const IOHIDEventField kIOHIDEventFieldGameControllerDirectionPadDown = (kIOHIDEventFieldGameControllerBase | 2); +static const IOHIDEventField kIOHIDEventFieldGameControllerThumbstickButtonLeft = (kIOHIDEventFieldGameControllerBase | 17); +static const IOHIDEventField kIOHIDEventFieldGameControllerJoyStickAxisZ = (kIOHIDEventFieldGameControllerBase | 15); +static const IOHIDEventField kIOHIDEventFieldGameControllerShoulderButtonR2 = (kIOHIDEventFieldGameControllerBase | 12); +static const IOHIDEventField kIOHIDEventFieldGameControllerFaceButtonY = (kIOHIDEventFieldGameControllerBase | 8); +static const IOHIDEventField kIOHIDEventFieldGameControllerShoulderButtonL2 = (kIOHIDEventFieldGameControllerBase | 11); +static const IOHIDEventField kIOHIDEventFieldGameControllerJoyStickAxisRz = (kIOHIDEventFieldGameControllerBase | 16); +static const IOHIDEventField kIOHIDEventFieldGameControllerShoulderButtonL1 = (kIOHIDEventFieldGameControllerBase | 9); +static const IOHIDEventField kIOHIDEventFieldGameControllerFaceButtonX = (kIOHIDEventFieldGameControllerBase | 7); +static const IOHIDEventField kIOHIDEventFieldGameControllerDirectionPadUp = (kIOHIDEventFieldGameControllerBase | 1); + +#define kIOHIDEventFieldTranslationBase IOHIDEventFieldBase(kIOHIDEventTypeTranslation) +static const IOHIDEventField kIOHIDEventFieldTranslationY = (kIOHIDEventFieldTranslationBase | 1); +static const IOHIDEventField kIOHIDEventFieldTranslationX = (kIOHIDEventFieldTranslationBase | 0); +static const IOHIDEventField kIOHIDEventFieldTranslationZ = (kIOHIDEventFieldTranslationBase | 2); + +#define kIOHIDEventFieldDigitizerBase IOHIDEventFieldBase(kIOHIDEventTypeDigitizer) +static const IOHIDEventField kIOHIDEventFieldDigitizerType = (kIOHIDEventFieldDigitizerBase | 4); +static const IOHIDEventField kIOHIDEventFieldDigitizerChildEventMask = (kIOHIDEventFieldDigitizerBase | 24); +static const IOHIDEventField kIOHIDEventFieldDigitizerAuxiliaryPressure = (kIOHIDEventFieldDigitizerBase | 11); +static const IOHIDEventField kIOHIDEventFieldDigitizerQualityRadiiAccuracy = (kIOHIDEventFieldDigitizerBase | 26); +static const IOHIDEventField kIOHIDEventFieldDigitizerQuality = (kIOHIDEventFieldDigitizerBase | 17); +static const IOHIDEventField kIOHIDEventFieldDigitizerMinorRadius = (kIOHIDEventFieldDigitizerBase | 21); +static const IOHIDEventField kIOHIDEventFieldDigitizerEventMask = (kIOHIDEventFieldDigitizerBase | 7); +static const IOHIDEventField kIOHIDEventFieldDigitizerGenerationCount = (kIOHIDEventFieldDigitizerBase | 27); +static const IOHIDEventField kIOHIDEventFieldDigitizerIndex = (kIOHIDEventFieldDigitizerBase | 5); +static const IOHIDEventField kIOHIDEventFieldDigitizerTouch = (kIOHIDEventFieldDigitizerBase | 9); +static const IOHIDEventField kIOHIDEventFieldDigitizerAzimuth = (kIOHIDEventFieldDigitizerBase | 16); +static const IOHIDEventField kIOHIDEventFieldDigitizerTiltX = (kIOHIDEventFieldDigitizerBase | 13); +static const IOHIDEventField kIOHIDEventFieldDigitizerTiltY = (kIOHIDEventFieldDigitizerBase | 14); +static const IOHIDEventField kIOHIDEventFieldDigitizerRange = (kIOHIDEventFieldDigitizerBase | 8); +static const IOHIDEventField kIOHIDEventFieldDigitizerPressure = (kIOHIDEventFieldDigitizerBase | 10); +static const IOHIDEventField kIOHIDEventFieldDigitizerCollection = (kIOHIDEventFieldDigitizerBase | 22); +static const IOHIDEventField kIOHIDEventFieldDigitizerAltitude = (kIOHIDEventFieldDigitizerBase | 15); +static const IOHIDEventField kIOHIDEventFieldDigitizerDensity = (kIOHIDEventFieldDigitizerBase | 18); +static const IOHIDEventField kIOHIDEventFieldDigitizerOrientationType = (kIOHIDEventFieldDigitizerBase | 31); +static const IOHIDEventField kIOHIDEventFieldDigitizerY = (kIOHIDEventFieldDigitizerBase | 1); +static const IOHIDEventField kIOHIDEventFieldDigitizerWillUpdateMask = (kIOHIDEventFieldDigitizerBase | 28); +static const IOHIDEventField kIOHIDEventFieldDigitizerIdentity = (kIOHIDEventFieldDigitizerBase | 6); +static const IOHIDEventField kIOHIDEventFieldDigitizerTwist = (kIOHIDEventFieldDigitizerBase | 12); +static const IOHIDEventField kIOHIDEventFieldDigitizerX = (kIOHIDEventFieldDigitizerBase | 0); +static const IOHIDEventField kIOHIDEventFieldDigitizerIsDisplayIntegrated = (kIOHIDEventFieldDigitizerBase | 25); +static const IOHIDEventField kIOHIDEventFieldDigitizerZ = (kIOHIDEventFieldDigitizerBase | 2); +static const IOHIDEventField kIOHIDEventFieldDigitizerMajorRadius = (kIOHIDEventFieldDigitizerBase | 20); +static const IOHIDEventField kIOHIDEventFieldDigitizerButtonMask = (kIOHIDEventFieldDigitizerBase | 3); +static const IOHIDEventField kIOHIDEventFieldDigitizerIrregularity = (kIOHIDEventFieldDigitizerBase | 19); +static const IOHIDEventField kIOHIDEventFieldDigitizerDidUpdateMask = (kIOHIDEventFieldDigitizerBase | 29); + +#define kIOHIDEventFieldCompassBase IOHIDEventFieldBase(kIOHIDEventTypeCompass) +static const IOHIDEventField kIOHIDEventFieldCompassType = (kIOHIDEventFieldCompassBase | 3); +static const IOHIDEventField kIOHIDEventFieldCompassZ = (kIOHIDEventFieldCompassBase | 2); +static const IOHIDEventField kIOHIDEventFieldCompassX = (kIOHIDEventFieldCompassBase | 0); +static const IOHIDEventField kIOHIDEventFieldCompassY = (kIOHIDEventFieldCompassBase | 1); +static const IOHIDEventField kIOHIDEventFieldCompassSubType = (kIOHIDEventFieldCompassBase | 4); +static const IOHIDEventField kIOHIDEventFieldCompassSequence = (kIOHIDEventFieldCompassBase | 5); + +#define kIOHIDEventFieldRotationBase IOHIDEventFieldBase(kIOHIDEventTypeRotation) +static const IOHIDEventField kIOHIDEventFieldRotationY = (kIOHIDEventFieldRotationBase | 1); +static const IOHIDEventField kIOHIDEventFieldRotationX = (kIOHIDEventFieldRotationBase | 0); +static const IOHIDEventField kIOHIDEventFieldRotationZ = (kIOHIDEventFieldRotationBase | 2); + +#define kIOHIDEventFieldMotionActivityBase IOHIDEventFieldBase(kIOHIDEventTypeMotionActivity) +static const IOHIDEventField kIOHIDEventFieldMotionActivityConfidence = (kIOHIDEventFieldMotionActivityBase | 1); +static const IOHIDEventField kIOHIDEventFieldMotionActivityActivityType = (kIOHIDEventFieldMotionActivityBase | 0); + +#define kIOHIDEventFieldMultiAxisPointerBase IOHIDEventFieldBase(kIOHIDEventTypeMultiAxisPointer) +static const IOHIDEventField kIOHIDEventFieldMultiAxisPointerRy = (kIOHIDEventFieldMultiAxisPointerBase | 4); +static const IOHIDEventField kIOHIDEventFieldMultiAxisPointerRx = (kIOHIDEventFieldMultiAxisPointerBase | 3); +static const IOHIDEventField kIOHIDEventFieldMultiAxisPointerRz = (kIOHIDEventFieldMultiAxisPointerBase | 5); +static const IOHIDEventField kIOHIDEventFieldMultiAxisPointerButtonMask = (kIOHIDEventFieldMultiAxisPointerBase | 6); +static const IOHIDEventField kIOHIDEventFieldMultiAxisPointerZ = (kIOHIDEventFieldMultiAxisPointerBase | 2); +static const IOHIDEventField kIOHIDEventFieldMultiAxisPointerX = (kIOHIDEventFieldMultiAxisPointerBase | 0); +static const IOHIDEventField kIOHIDEventFieldMultiAxisPointerY = (kIOHIDEventFieldMultiAxisPointerBase | 1); + +#define kIOHIDEventFieldBrightnessBase IOHIDEventFieldBase(kIOHIDEventTypeBrightness) +static const IOHIDEventField kIOHIDEventFieldTargetBrightness = (kIOHIDEventFieldBrightnessBase | 1); +static const IOHIDEventField kIOHIDEventFieldCurrentBrightness = (kIOHIDEventFieldBrightnessBase | 0); +static const IOHIDEventField kIOHIDEventFieldTransitionTime = (kIOHIDEventFieldBrightnessBase | 2); + +#define kIOHIDEventFieldGyroBase IOHIDEventFieldBase(kIOHIDEventTypeGyro) +static const IOHIDEventField kIOHIDEventFieldGyroX = (kIOHIDEventFieldGyroBase | 0); +static const IOHIDEventField kIOHIDEventFieldGyroY = (kIOHIDEventFieldGyroBase | 1); +static const IOHIDEventField kIOHIDEventFieldGyroZ = (kIOHIDEventFieldGyroBase | 2); +static const IOHIDEventField kIOHIDEventFieldGyroSubType = (kIOHIDEventFieldGyroBase | 4); +static const IOHIDEventField kIOHIDEventFieldGyroSequence = (kIOHIDEventFieldGyroBase | 5); +static const IOHIDEventField kIOHIDEventFieldGyroType = (kIOHIDEventFieldGyroBase | 3); + +#define kIOHIDEventFieldButtonBase IOHIDEventFieldBase(kIOHIDEventTypeButton) +static const IOHIDEventField kIOHIDEventFieldButtonPressure = (kIOHIDEventFieldButtonBase | 3); +static const IOHIDEventField kIOHIDEventFieldButtonClickCount = (kIOHIDEventFieldButtonBase | 2); +static const IOHIDEventField kIOHIDEventFieldButtonMask = (kIOHIDEventFieldButtonBase | 0); +static const IOHIDEventField kIOHIDEventFieldButtonState = (kIOHIDEventFieldButtonBase | 4); +static const IOHIDEventField kIOHIDEventFieldButtonNumber = (kIOHIDEventFieldButtonBase | 1); + +#define kIOHIDEventFieldNavigationSwipeBase IOHIDEventFieldBase(kIOHIDEventTypeNavigationSwipe) +static const IOHIDEventField kIOHIDEventFieldNavigationSwipeFlavor = (kIOHIDEventFieldNavigationSwipeBase | 5); +static const IOHIDEventField kIOHIDEventFieldNavigationSwipeProgress = (kIOHIDEventFieldNavigationSwipeBase | 2); +static const IOHIDEventField kIOHIDEventFieldNavigationSwipeMask = (kIOHIDEventFieldNavigationSwipeBase | 0); +static const IOHIDEventField kIOHIDEventFieldNavigationSwipeMotion = (kIOHIDEventFieldNavigationSwipeBase | 1); +static const IOHIDEventField kIOHIDEventFieldNavigationSwipePositionY = (kIOHIDEventFieldNavigationSwipeBase | 4); +static const IOHIDEventField kIOHIDEventFieldNavigationSwipePositionX = (kIOHIDEventFieldNavigationSwipeBase | 3); +static const IOHIDEventField kIOHIDEventFieldNavigationSwipePositionZ = (kIOHIDEventFieldNavigationSwipeBase | 6); + +#define kIOHIDEventFieldAtmosphericPressureBase IOHIDEventFieldBase(kIOHIDEventTypeAtmosphericPressure) +static const IOHIDEventField kIOHIDEventFieldAtmosphericPressureLevel = (kIOHIDEventFieldAtmosphericPressureBase | 0); +static const IOHIDEventField kIOHIDEventFieldAtmosphericSequence = (kIOHIDEventFieldAtmosphericPressureBase | 1); + +#define kIOHIDEventFieldHumidityBase IOHIDEventFieldBase(kIOHIDEventTypeHumidity) +static const IOHIDEventField kIOHIDEventFieldHumiditySequence = (kIOHIDEventFieldHumidityBase | 1); +static const IOHIDEventField kIOHIDEventFieldHumidityRH = (kIOHIDEventFieldHumidityBase | 0); + +#define kIOHIDEventFieldVelocityBase IOHIDEventFieldBase(kIOHIDEventTypeVelocity) +static const IOHIDEventField kIOHIDEventFieldVelocityX = (kIOHIDEventFieldVelocityBase | 0); +static const IOHIDEventField kIOHIDEventFieldVelocityY = (kIOHIDEventFieldVelocityBase | 1); +static const IOHIDEventField kIOHIDEventFieldVelocityZ = (kIOHIDEventFieldVelocityBase | 2); + +#define kIOHIDEventFieldScrollBase IOHIDEventFieldBase(kIOHIDEventTypeScroll) +static const IOHIDEventField kIOHIDEventFieldScrollIsPixels = (kIOHIDEventFieldScrollBase | 3); +static const IOHIDEventField kIOHIDEventFieldScrollX = (kIOHIDEventFieldScrollBase | 0); +static const IOHIDEventField kIOHIDEventFieldScrollY = (kIOHIDEventFieldScrollBase | 1); +static const IOHIDEventField kIOHIDEventFieldScrollZ = (kIOHIDEventFieldScrollBase | 2); + +#define kIOHIDEventFieldBiometricBase IOHIDEventFieldBase(kIOHIDEventTypeBiometric) +static const IOHIDEventField kIOHIDEventFieldBiometricEventType = (kIOHIDEventFieldBiometricBase | 0); +static const IOHIDEventField kIOHIDEventFieldBiometricUsage = (kIOHIDEventFieldBiometricBase | 3); +static const IOHIDEventField kIOHIDEventFieldBiometricLevel = (kIOHIDEventFieldBiometricBase | 1); +static const IOHIDEventField kIOHIDEventFieldBiometricTapCount = (kIOHIDEventFieldBiometricBase | 4); +static const IOHIDEventField kIOHIDEventFieldBiometricUsagePage = (kIOHIDEventFieldBiometricBase | 2); + +#define kIOHIDEventFieldBoundaryScrollBase IOHIDEventFieldBase(kIOHIDEventTypeBoundaryScroll) +static const IOHIDEventField kIOHIDEventFieldBoundaryScrollProgress = (kIOHIDEventFieldBoundaryScrollBase | 2); +static const IOHIDEventField kIOHIDEventFieldBoundaryScrollFlavor = (kIOHIDEventFieldBoundaryScrollBase | 5); +static const IOHIDEventField kIOHIDEventFieldBoundaryScrollPositionY = (kIOHIDEventFieldBoundaryScrollBase | 4); +static const IOHIDEventField kIOHIDEventFieldBoundaryScrollPositionX = (kIOHIDEventFieldBoundaryScrollBase | 3); +static const IOHIDEventField kIOHIDEventFieldBoundaryScrollMask = (kIOHIDEventFieldBoundaryScrollBase | 0); +static const IOHIDEventField kIOHIDEventFieldBoundaryScrollMotion = (kIOHIDEventFieldBoundaryScrollBase | 1); + +#define kIOHIDEventFieldLEDBase IOHIDEventFieldBase(kIOHIDEventTypeLED) +static const IOHIDEventField kIOHIDEventFieldLEDMask = (kIOHIDEventFieldLEDBase | 0); +static const IOHIDEventField kIOHIDEventFieldLEDState = (kIOHIDEventFieldLEDBase | 2); +static const IOHIDEventField kIOHIDEventFieldLEDNumber = (kIOHIDEventFieldLEDBase | 1); + +#define kIOHIDEventFieldOrientationBase IOHIDEventFieldBase(kIOHIDEventTypeOrientation) +static const IOHIDEventField kIOHIDEventFieldOrientationOrientationType = (kIOHIDEventFieldOrientationBase | 3); +static const IOHIDEventField kIOHIDEventFieldOrientationTiltZ = (kIOHIDEventFieldOrientationBase | 7); +static const IOHIDEventField kIOHIDEventFieldOrientationTiltY = (kIOHIDEventFieldOrientationBase | 6); +static const IOHIDEventField kIOHIDEventFieldOrientationTiltX = (kIOHIDEventFieldOrientationBase | 5); +static const IOHIDEventField kIOHIDEventFieldOrientationAzimuth = (kIOHIDEventFieldOrientationBase | 1); +static const IOHIDEventField kIOHIDEventFieldOrientationQuatZ = (kIOHIDEventFieldOrientationBase | 11); +static const IOHIDEventField kIOHIDEventFieldOrientationQuatY = (kIOHIDEventFieldOrientationBase | 10); +static const IOHIDEventField kIOHIDEventFieldOrientationQuatX = (kIOHIDEventFieldOrientationBase | 9); +static const IOHIDEventField kIOHIDEventFieldOrientationQuatW = (kIOHIDEventFieldOrientationBase | 8); +static const IOHIDEventField kIOHIDEventFieldOrientationDeviceOrientationUsage = (kIOHIDEventFieldOrientationBase | 4); +static const IOHIDEventField kIOHIDEventFieldOrientationAltitude = (kIOHIDEventFieldOrientationBase | 2); +static const IOHIDEventField kIOHIDEventFieldOrientationRadius = (kIOHIDEventFieldOrientationBase | 0); + +#define kIOHIDEventFieldProximityBase IOHIDEventFieldBase(kIOHIDEventTypeProximity) +static const IOHIDEventField kIOHIDEventFieldProximityLevel = (kIOHIDEventFieldProximityBase | 1); +static const IOHIDEventField kIOHIDEventFieldProximityDetectionMask = (kIOHIDEventFieldProximityBase | 0); + +#define kIOHIDEventFieldFluidTouchGestureBase IOHIDEventFieldBase(kIOHIDEventTypeFluidTouchGesture) +static const IOHIDEventField kIOHIDEventFieldFluidTouchGesturePositionY = (kIOHIDEventFieldFluidTouchGestureBase | 4); +static const IOHIDEventField kIOHIDEventFieldFluidTouchGesturePositionX = (kIOHIDEventFieldFluidTouchGestureBase | 3); +static const IOHIDEventField kIOHIDEventFieldFluidTouchGestureMask = (kIOHIDEventFieldFluidTouchGestureBase | 0); +static const IOHIDEventField kIOHIDEventFieldFluidTouchGestureProgress = (kIOHIDEventFieldFluidTouchGestureBase | 2); +static const IOHIDEventField kIOHIDEventFieldFluidTouchGestureMotion = (kIOHIDEventFieldFluidTouchGestureBase | 1); +static const IOHIDEventField kIOHIDEventFieldFluidTouchGestureFlavor = (kIOHIDEventFieldFluidTouchGestureBase | 5); + +#define kIOHIDEventFieldDockSwipeBase IOHIDEventFieldBase(kIOHIDEventTypeDockSwipe) +static const IOHIDEventField kIOHIDEventFieldDockSwipeProgress = (kIOHIDEventFieldDockSwipeBase | 2); +static const IOHIDEventField kIOHIDEventFieldDockSwipeMask = (kIOHIDEventFieldDockSwipeBase | 0); +static const IOHIDEventField kIOHIDEventFieldDockSwipeMotion = (kIOHIDEventFieldDockSwipeBase | 1); +static const IOHIDEventField kIOHIDEventFieldDockSwipeFlavor = (kIOHIDEventFieldDockSwipeBase | 5); +static const IOHIDEventField kIOHIDEventFieldDockSwipePositionX = (kIOHIDEventFieldDockSwipeBase | 3); +static const IOHIDEventField kIOHIDEventFieldDockSwipePositionY = (kIOHIDEventFieldDockSwipeBase | 4); +static const IOHIDEventField kIOHIDEventFieldDockSwipePositionZ = (kIOHIDEventFieldDockSwipeBase | 6); + +#define kIOHIDEventFieldUnicodeBase IOHIDEventFieldBase(kIOHIDEventTypeUnicode) +static const IOHIDEventField kIOHIDEventFieldUnicodePayload = (kIOHIDEventFieldUnicodeBase | 3); +static const IOHIDEventField kIOHIDEventFieldUnicodeLength = (kIOHIDEventFieldUnicodeBase | 2); +static const IOHIDEventField kIOHIDEventFieldUnicodeQuality = (kIOHIDEventFieldUnicodeBase | 1); +static const IOHIDEventField kIOHIDEventFieldUnicodeEncoding = (kIOHIDEventFieldUnicodeBase | 0); + +#define kIOHIDEventFieldKeyboardBase IOHIDEventFieldBase(kIOHIDEventTypeKeyboard) +static const IOHIDEventField kIOHIDEventFieldKeyboardStickyKeyPhase = (kIOHIDEventFieldKeyboardBase | 9); +static const IOHIDEventField kIOHIDEventFieldKeyboardStickyKeyToggle = (kIOHIDEventFieldKeyboardBase | 10); +static const IOHIDEventField kIOHIDEventFieldKeyboardMouseKeyToggle = (kIOHIDEventFieldKeyboardBase | 8); +static const IOHIDEventField kIOHIDEventFieldKeyboardClickSpeed = (kIOHIDEventFieldKeyboardBase | 6); +static const IOHIDEventField kIOHIDEventFieldKeyboardPressCount = (kIOHIDEventFieldKeyboardBase | 4); +static const IOHIDEventField kIOHIDEventFieldKeyboardLongPress = (kIOHIDEventFieldKeyboardBase | 5); +static const IOHIDEventField kIOHIDEventFieldKeyboardUsagePage = (kIOHIDEventFieldKeyboardBase | 0); +static const IOHIDEventField kIOHIDEventFieldKeyboardSlowKeyPhase = (kIOHIDEventFieldKeyboardBase | 7); +static const IOHIDEventField kIOHIDEventFieldKeyboardDown = (kIOHIDEventFieldKeyboardBase | 2); +static const IOHIDEventField kIOHIDEventFieldKeyboardRepeat = (kIOHIDEventFieldKeyboardBase | 3); +static const IOHIDEventField kIOHIDEventFieldKeyboardUsage = (kIOHIDEventFieldKeyboardBase | 1); + +#define kIOHIDEventFieldPointerBase IOHIDEventFieldBase(kIOHIDEventTypePointer) +static const IOHIDEventField kIOHIDEventFieldPointerZ = (kIOHIDEventFieldPointerBase | 2); +static const IOHIDEventField kIOHIDEventFieldPointerY = (kIOHIDEventFieldPointerBase | 1); +static const IOHIDEventField kIOHIDEventFieldPointerX = (kIOHIDEventFieldPointerBase | 0); +static const IOHIDEventField kIOHIDEventFieldPointerButtonMask = (kIOHIDEventFieldPointerBase | 3); + +#endif diff --git a/QualcommWireless/include/IOKit/hid/IOHIDEventService.h b/QualcommWireless/include/IOKit/hid/IOHIDEventService.h new file mode 100644 index 0000000..2230924 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDEventService.h @@ -0,0 +1,980 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDEVENTSERVICE_H +#define _IOKIT_HID_IOHIDEVENTSERVICE_H + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#if TARGET_OS_IPHONE +#include +#endif +#include + +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif +enum +{ + kHIDDispatchOptionPointerNoAcceleration = 0x01, + kHIDDispatchOptionPointerDisplayIntegrated = 0x02, + kHIDDispatchOptionPointerAffixToScreen = kHIDDispatchOptionPointerDisplayIntegrated, + kHIDDispatchOptionPointerAbsolutToRelative = 0x04 +}; + +enum +{ + kHIDDispatchOptionScrollNoAcceleration = (1<<0), + + kHIDDispatchOptionScrollMomentumAny = 0x00e, + kHIDDispatchOptionScrollMomentumContinue = (1<<1), + kHIDDispatchOptionScrollMomentumStart = (1<<2), + kHIDDispatchOptionScrollMomentumEnd = (1<<3), + + kHIDDispatchOptionPhaseAny = 0xff0, + kHIDDispatchOptionPhaseBegan = (1<<4), + kHIDDispatchOptionPhaseChanged = (1<<5), + kHIDDispatchOptionPhaseEnded = (1<<6), + kHIDDispatchOptionPhaseCanceled = (1<<7), + kHIDDispatchOptionPhaseMayBegin = (1<<11), + + kHIDDispatchOptionDeliveryNotificationForce = (1<<12), + kHIDDispatchOptionDeliveryNotificationSuppress = (1<<13) +}; + +enum +{ + kHIDDispatchOptionKeyboardNoRepeat = (1<<0) +}; + + +class IOHIDEventService; +class IOHIDPointing; +class IOHIDKeyboard; +class IOHIDConsumer; +struct TransducerData; +class IOHIDEvent; +class IOBufferMemoryDescriptor; + +#ifndef _IOKIT_HID_IOHIDEVENTTYPES_H +typedef uint32_t IOHIDEventType; +typedef uint32_t IOHIDBiometricEventType; +#endif + +struct KeyValueMask { + Key key; + uint32_t mask; +}; + +typedef void (*DebugKeyActionProc) (IOHIDEventService *self, void * parameter); +struct DebugKeyAction { + uint32_t mask; + DebugKeyActionProc action; + void* parameter; +}; + + +/*! @class IOHIDEventService : public IOService + @abstract + @discussion + */ +class IOHIDEventService : public IOService +{ + OSDeclareDefaultStructorsWithDispatch( IOHIDEventService ) + + friend class IOHIDPointing; + friend class IOHIDKeyboard; + friend class IOHIDConsumer; + friend class AppleEmbeddedKeyboard; + friend class IOHIDEventServiceUserClient; + friend class IOHIDEventServiceFastPathUserClient; + +private: + IOHIDKeyboard * _keyboardNub; + IOHIDPointing * _pointingNub; //unused, keep to maintain layout + IOHIDConsumer * _consumerNub; + + IOLock * _clientDictLock; + IORecursiveLock * _nubLock; + + void * _reserved0; + + bool _readyForInputReports; + + struct ExpansionData { + IOService * provider; + IOWorkLoop * workLoop; + OSArray * deviceUsagePairs; + IOCommandGate * commandGate; + + OSDictionary * clientDict; + IOBufferMemoryDescriptor *eventMemory; + IOLock *eventMemLock; + + struct { + UInt32 deviceID; + bool range; + bool touch; + SInt32 x; + SInt32 y; + SInt32 z; + } digitizer; + + struct { + +#if TARGET_OS_IPHONE + struct { + UInt32 startMask; + UInt32 mask; + UInt32 nmiHoldMask; + UInt32 nmiDelay; + UInt32 nmiTriplePressMask; + UInt32 nmiPressCount; + UInt64 nmiStartTime; + IOTimerEventSource * nmiTimer; + UInt32 stackshotHeld; + IOTimerEventSource * stackshotTimer; + } debug; + bool swapISO; +#else + Key pressedKeys[10]; + UInt32 pressedKeysMask; +#endif + bool appleVendorSupported; + } keyboard; + + struct { + IOFixed x; + IOFixed y; + IOFixed z; + IOFixed rX; + IOFixed rY; + IOFixed rZ; + UInt32 buttonState; + IOOptionBits options; + IOTimerEventSource * timer; + } multiAxis; + + struct { + UInt32 buttonState; + } relativePointer; + +#if TARGET_OS_OSX + + struct { + UInt32 buttonState; + } absolutePointer; +#ifdef POINTING_SHIM_SUPPORT + int pointingShim; +#endif + int keyboardShim; +#endif + UInt32 debugMask; + }; + +#if TARGET_OS_OSX + static KeyValueMask keyMonitorTable[]; + static DebugKeyAction debugKeyActionTable[]; +#endif + + ExpansionData * _reserved; + +#ifdef POINTING_SHIM_SUPPORT + IOHIDPointing * newPointingShim ( + UInt32 buttonCount = 1, + IOFixed pointerResolution = (400 << 16), + IOFixed scrollResolution = 0, + IOOptionBits options = 0 ); +#endif + + IOHIDKeyboard * newKeyboardShim ( + UInt32 supportedModifiers = 0, + IOOptionBits options = 0 ); + + IOHIDConsumer * newConsumerShim ( IOOptionBits options = 0 ); + + void parseSupportedElements ( + OSArray * elementArray, + UInt32 bootProtocol ); + + void processTabletElement ( IOHIDElement * element ); + + IOFixed determineResolution ( IOHIDElement * element ); + +#if TARGET_OS_IPHONE + void debuggerTimerCallback(IOTimerEventSource *sender); + + void triggerDebugger(); + + void stackshotTimerCallback(IOTimerEventSource *sender); +#endif + + void multiAxisTimerCallback(IOTimerEventSource *sender); + + void calculateStandardType(); + bool supportsHeadset(OSArray *elements); + +protected: + + virtual void free(void) APPLE_KEXT_OVERRIDE; + +/*! @function handleOpen + @abstract Handle a client open on the interface. + @discussion This method is called by IOService::open() with the + arbitration lock held, and must return true to accept the client open. + This method will in turn call handleClientOpen() to qualify the client + requesting the open. + @param client The client object that requested the open. + @param options Options passed to IOService::open(). + @param argument Argument passed to IOService::open(). + @result true to accept the client open, false otherwise. */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * argument) APPLE_KEXT_OVERRIDE; + +/*! @function handleClose + @abstract Handle a client close on the interface. + @discussion This method is called by IOService::close() with the + arbitration lock held. This method will in turn call handleClientClose() + to notify interested subclasses about the client close. If this represents + the last close, then the interface will also close the controller before + this method returns. The controllerWillClose() method will be called before + closing the controller. Subclasses should not override this method. + @param client The client object that requested the close. + @param options Options passed to IOService::close(). */ + + virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE; + +/*! @function handleIsOpen + @abstract Query whether a client has an open on the interface. + @discussion This method is always called by IOService with the + arbitration lock held. Subclasses should not override this method. + @result true if the specified client, or any client if none (0) is + specified, presently has an open on this object. */ + + virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE; + +/*! @function handleStart + @abstract Prepare the hardware and driver to support I/O operations. + @discussion IOHIDEventService will call this method from start() before + any I/O operations are issued to the concrete subclass. Methods + such as getReportElements() are only called after handleStart() + has returned true. A subclass that overrides this method should + begin its implementation by calling the version in super, and + then check the return value. + @param provider The provider argument passed to start(). + @result True on success, or false otherwise. Returning false will + cause start() to fail and return false. */ + + virtual bool handleStart( IOService * provider ); + +/*! @function handleStop + @abstract Quiesce the hardware and stop the driver. + @discussion IOHIDEventService will call this method from stop() to + signal that the hardware should be quiesced and the driver stopped. + A subclass that overrides this method should end its implementation + by calling the version in super. + @param provider The provider argument passed to stop(). */ + + virtual void handleStop( IOService * provider ); + + virtual OSString * getTransport (); + virtual UInt32 getLocationID (); + virtual UInt32 getVendorID (); + virtual UInt32 getVendorIDSource (); + virtual UInt32 getProductID (); + virtual UInt32 getVersion (); + virtual UInt32 getCountryCode (); + virtual OSString * getManufacturer (); + virtual OSString * getProduct (); + virtual OSString * getSerialNumber (); + + virtual OSArray * getReportElements(); + + virtual IOReturn setElementValue ( + UInt32 usagePage, + UInt32 usage, + UInt32 value ); + + virtual UInt32 getElementValue ( + UInt32 usagePage, + UInt32 usage ); + + virtual void dispatchKeyboardEvent( + AbsoluteTime timeStamp, + UInt32 usagePage, + UInt32 usage, + UInt32 value, + IOOptionBits options = 0 ); + + virtual void dispatchRelativePointerEvent( + AbsoluteTime timeStamp, + SInt32 dx, + SInt32 dy, + UInt32 buttonState, + IOOptionBits options = 0 ); + + void dispatchRelativePointerEventWithFixed( + AbsoluteTime timeStamp, + IOFixed dx, + IOFixed dy, + UInt32 buttonState, + IOOptionBits options = 0 ); + + + virtual void dispatchAbsolutePointerEvent( + AbsoluteTime timeStamp, + SInt32 x, + SInt32 y, + IOGBounds * bounds, + UInt32 buttonState, + bool inRange, + SInt32 tipPressure, + SInt32 tipPressureMin, + SInt32 tipPressureMax, + IOOptionBits options = 0 ); + + virtual void dispatchScrollWheelEvent( + AbsoluteTime timeStamp, + SInt32 deltaAxis1, + SInt32 deltaAxis2, + SInt32 deltaAxis3, + IOOptionBits options = 0 ); + + void dispatchScrollWheelEventWithFixed( + AbsoluteTime timeStamp, + IOFixed deltaAxis1, + IOFixed deltaAxis2, + IOFixed deltaAxis3, + IOOptionBits options = 0 ); + + virtual void dispatchTabletPointerEvent( + AbsoluteTime timeStamp, + UInt32 transducerID, + SInt32 x, + SInt32 y, + SInt32 z, + IOGBounds * bounds, + UInt32 buttonState, + SInt32 tipPressure, + SInt32 tipPressureMin, + SInt32 tipPressureMax, + SInt32 barrelPressure, + SInt32 barrelPressureMin, + SInt32 barrelPressureMax, + SInt32 tiltX, + SInt32 tiltY, + UInt32 twist, + IOOptionBits options = 0 ); + + virtual void dispatchTabletProximityEvent( + AbsoluteTime timeStamp, + UInt32 transducerID, + bool inRange, + bool invert, + UInt32 vendorTransducerUniqueID = 0, + UInt32 vendorTransducerSerialNumber = 0, + IOOptionBits options = 0 ); + +public: + bool readyForReports(); + + virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE; + + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setSystemProperties( OSDictionary * properties ); + + virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12 + virtual IOReturn newUserClient( + task_t owningTask, + void * securityID, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler ) APPLE_KEXT_OVERRIDE; +#endif + +protected: + OSMetaClassDeclareReservedUsed(IOHIDEventService, 0); + virtual OSArray * getDeviceUsagePairs(); + + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 1); + virtual UInt32 getReportInterval(); + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 2); + enum { + kMultiAxisOptionRotationForTranslation = (1<<0), + kMultiAxisOptionZForScroll = (1<<1) + }; +/*! + @function dispatchMultiAxisPointerEvent + @abstract Dispatch multi-axis pointer event + @discussion This is meant to be used with joysticks or multi-axis pointer devices such as those with + with 6 degrees of freedom. This function will generate related relative pointer and scroll + event associated with movement. + @param timeStamp AbsoluteTime representing origination of event + @param buttonState Button mask where bit0 is the primary button, bit1 secondary and so forth + @param x Absolute location of pointer along the x-axis from -1.0 to 1.0 in 16:16 fixed point. + @param y Absolute location of pointer along the y-axis from -1.0 to 1.0 in 16:16 fixed point. + @param z Absolute location of pointer along the z-axis from -1.0 to 1.0 in 16:16 fixed point. + @param rX Absolute rotation of pointer around the x-axis from -1.0 to 1.0 in 16:16 fixed point. + @param rY Absolute rotation of pointer around the y-axis from -1.0 to 1.0 in 16:16 fixed point. + @param rZ Absolute rotation of pointer around the z-axis from -1.0 to 1.0 in 16:16 fixed point. + @param options Additional options to be used when dispatching event such as leveraging rotational + axis for translation or using the z axis for vertical scrolling. +*/ + virtual void dispatchMultiAxisPointerEvent( + AbsoluteTime timeStamp, + UInt32 buttonState, + IOFixed x, + IOFixed y, + IOFixed z, + IOFixed rX = 0, + IOFixed rY = 0, + IOFixed rZ = 0, + IOOptionBits options = 0 ); + + enum { + kDigitizerInvert = (1<<0), + + kDigitizerCapabilityButtons = (1<<16), + kDigitizerCapabilityPressure = (1<<16), + kDigitizerCapabilityTangentialPressure = (1<<16), + kDigitizerCapabilityZ = (1<<16), + kDigitizerCapabilityTiltX = (1<<16), + kDigitizerCapabilityTiltY = (1<<16), + kDigitizerCapabilityTwist = (1<<16), + }; + + enum { + kDigitizerTransducerTypeStylus = 0, + kDigitizerTransducerTypePuck, + kDigitizerTransducerTypeFinger, + kDigitizerTransducerTypeHand + }; + typedef UInt32 DigitizerTransducerType; + +/*! + @function dispatchDigitizerEvent + @abstract Dispatch tablet events without orientation + @discussion This is meant to be used with transducers without any orientation. + @param timeStamp AbsoluteTime representing origination of event + @param ID ID of the transducer generating the event + @param type Type of the transducer generating the event + @param inRange Details whether the transducer is in promitity to digitizer surface + @param buttonState Button mask where bit0 is the primary button, bit1 secondary and so forth + @param x Absolute location of transducer along the x-axis from 0.0 to 1.0 in + 16:16 fixed point. + @param y Absolute location of transducer along the y-axis from 0.0 to 1.0 in + 16:16 fixed point. + @param z Absolute location of transducer along the z-axis from 0.0 to 1.0 in + 16:16 fixed point. This is typically used to determine the distance + between the transducer and surface + @param tipPressure Absolute pressure exerted on surface by tip from 0.0 to 1.0 in 16:16 + fixed point. + @param auxPressure Absolute pressure exerted on transducer from 0.0 to 1.0 in 16:16 fixed point. + @param options Additional options to be used when dispatching event. +*/ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 3); + virtual void dispatchDigitizerEvent( + AbsoluteTime timeStamp, + UInt32 transducerID, + DigitizerTransducerType type, + bool inRange, + UInt32 buttonState, + IOFixed x, + IOFixed y, + IOFixed z = 0, + IOFixed tipPressure = 0, + IOFixed auxPressure = 0, + IOFixed twist = 0, + IOOptionBits options = 0 ); + +/*! + @function dispatchDigitizerEventWithTiltOrientation + @abstract Dispatch tablet events with tilt orientation + @discussion This is meant to be used with transducers that leverage tilt orientation + @param timeStamp AbsoluteTime representing origination of event + @param ID ID of the transducer generating the event + @param type Type of the transducer generating the event + @param inRange Details whether the transducer is in promitity to digitizer surface + @param buttonState Button mask where bit0 is the primary button, bit1 secondary and so forth + @param x Absolute location of transducer along the x-axis from 0.0 to 1.0 in + 16:16 fixed point. + @param y Absolute location of transducer along the y-axis from 0.0 to 1.0 in + 16:16 fixed point. + @param z Absolute location of transducer along the z-axis from 0.0 to 1.0 in + 16:16 fixed point. This is typically used to determine the distance + between the transducer and surface + @param tipPressure Absolute pressure exerted on surface by tip from 0.0 to 1.0 in 16:16 + fixed point. + @param auxPressure Absolute pressure exerted on transducer from 0.0 to 1.0 in 16:16 fixed point. + @param twist Absolute clockwise rotation along the transducer's major axis from 0.0 to + 360.0 degrees in 16:16 fixed point. + @param tiltX Absolute plane angle between the Y-Z plane and the plane containing the + transducer axis and the Y axis. A positive X tilt is to the right. Value is + represented in degrees from -90.0 to 90.0 in 16:16 fixed point. + @param tiltY Absolute plane angle between the X-Z plane and the plane containing the + transducer axis and the X axis. A positive Y tilt is towards the user. Value + is represented in degrees from -90.0 to 90.0 in 16:16 fixed point. + @param options Additional options to be used when dispatching event. +*/ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 4); + virtual void dispatchDigitizerEventWithTiltOrientation( + AbsoluteTime timeStamp, + UInt32 ID, + DigitizerTransducerType type, + bool inRange, + UInt32 buttonState, + IOFixed x, + IOFixed y, + IOFixed z = 0, + IOFixed tipPressure = 0, // 0.0-1.0 in 16:16 fixed + IOFixed auxPressure = 0, // 0.0-1.0 in 16:16 fixed + IOFixed twist = 0, + IOFixed tiltX = 0, + IOFixed tiltY = 0, + IOOptionBits options = 0 ); + +/*! + @function dispatchDigitizerEventWithPolarOrientation + @abstract Dispatch tablet events with polar orientation + @discussion This is meant to be used with transducers that leverage polar orientation + @param timeStamp AbsoluteTime representing origination of event + @param ID ID of the transducer generating the event + @param type Type of the transducer generating the event + @param inRange Details whether the transducer is in promitity to digitizer surface + @param buttonState Button mask where bit0 is the primary button, bit1 secondary and so forth + @param x Absolute location of transducer along the x-axis from 0.0 to 1.0 in + 16:16 fixed point. + @param y Absolute location of transducer along the y-axis from 0.0 to 1.0 in + 16:16 fixed point. + @param z Absolute location of transducer along the z-axis from 0.0 to 1.0 in + 16:16 fixed point. This is typically used to determine the distance + between the transducer and surface + @param tipPressure Absolute pressure exerted on surface by tip from 0.0 to 1.0 in 16:16 + fixed point. + @param auxPressure Absolute pressure exerted on transducer from 0.0 to 1.0 in 16:16 fixed point. + @param twist Absolute clockwise rotation along the transducer's major axis from 0.0 to + 360.0 degrees in 16:16 fixed point. + @param altitude Specifies angle with the X-Y plane thorugh a signed, semicircular range. + Positive values specify an angle downward and toward the positive Z axis. + Value is represented in degrees from -180.0 to 180.0 in 16:16 fixed point. + @param azimuth Counter clockwise rotation of the cursor around the Z-axis through a full + circular range. Value is represented in degrees from 0.0 to 360.0 in 16:16 + fixed point. + @param options Additional options to be used when dispatching event. +*/ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 5); + virtual void dispatchDigitizerEventWithPolarOrientation( + AbsoluteTime timeStamp, + UInt32 transducerID, + DigitizerTransducerType type, + bool inRange, + UInt32 buttonState, + IOFixed x, + IOFixed y, + IOFixed z = 0, + IOFixed tipPressure = 0, // 0.0-1.0 in 16:16 fixed + IOFixed tanPressure = 0, // 0.0-1.0 in 16:16 fixed + IOFixed twist = 0, + IOFixed altitude = 0, + IOFixed azimuth = 0, + IOOptionBits options = 0 ); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 + /*! + @function dispatchUnicodeEvent + @abstract Dispatch unicode events + @discussion The HID specificiation provides a means to dispatch unicode characters from HID + compliant devices. The original method was to leverage the unicode page to deliver UTF-16 LE + characters by way of a usage page selector. + @param timeStamp AbsoluteTime representing origination of event + @param length Length of unicode payload + @param payload character payload + @param quality A fixed point value from 0.0 to 1.0 that represents that quality/confidence of the event. + @param options Additional options to be used when dispatching event. + */ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 6); + enum { + kUnicodeEncodingTypeUTF8 = 0, + kUnicodeEncodingTypeUTF16LE, + kUnicodeEncodingTypeUTF16BE, + kUnicodeEncodingTypeUTF32LE, + kUnicodeEncodingTypeUTF32BE, + }; + typedef UInt32 UnicodeEncodingType; + + virtual void dispatchUnicodeEvent( + AbsoluteTime timeStamp, + UInt8 * payload, + UInt32 length, + UnicodeEncodingType encoding = kUnicodeEncodingTypeUTF16LE, + IOFixed quality = (1<<16), + IOOptionBits options = 0); + + +#else + OSMetaClassDeclareReservedUnused(IOHIDEventService, 6); +#endif + +private: + enum { + kDigitizerOrientationTypeTilt = 0, + kDigitizerOrientationTypePolar, + kDigitizerOrientationTypeQuality + }; + typedef UInt32 DigitizerOrientationType; + + void dispatchDigitizerEventWithOrientation( + AbsoluteTime timeStamp, + UInt32 transducerID, + DigitizerTransducerType type, + bool inRange, + UInt32 buttonState, + IOFixed x, + IOFixed y, + IOFixed z = 0, + IOFixed tipPressure = 0, + IOFixed auxPressure = 0, + IOFixed twist = 0, + DigitizerOrientationType orientationType = kDigitizerOrientationTypeTilt, + IOFixed * orientationParams = NULL, + UInt32 orientationParamCount = 0, + IOOptionBits options = 0 ); + + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12 +public: + typedef void (*Action)(OSObject *target, OSObject * sender, void *context, OSObject *event, IOOptionBits options); + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 7); + virtual bool open( + IOService * client, + IOOptionBits options, + void * context, + Action action); + +protected: + OSMetaClassDeclareReservedUsed(IOHIDEventService, 8); + virtual void dispatchEvent(IOHIDEvent * event, IOOptionBits options=0); + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 9); + virtual UInt32 getPrimaryUsagePage(); + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 10); + virtual UInt32 getPrimaryUsage(); + +#if TARGET_OS_OSX + static void debugActionSysdiagnose(IOHIDEventService* self, void *parameter); + static void debugActionNMI(IOHIDEventService* self, void *parameter); +#endif + +public: + OSMetaClassDeclareReservedUsed(IOHIDEventService, 11); + virtual IOHIDEvent * copyEvent( + IOHIDEventType type, + IOHIDEvent * matching = 0, + IOOptionBits options = 0); + +protected: + /*! + @function dispatchStandardGameControllerEvent + @abstract Dispatch standard game controller event + @discussion This is meant to dispatch a conforming standard game controller event that includes the + following: Direction Pad, Face Buttons, and Left and Right Shoulder Buttons. + @param timeStamp AbsoluteTime representing origination of event + @param dpadUp Direction pad up with a fixed value between 0.0 and 1.0 + @param dpadDown Direction pad down with a fixed value between 0.0 and 1.0 + @param dpadLeft Direction pad left with a fixed value between 0.0 and 1.0 + @param dpadRight Direction pad right with a fixed value between 0.0 and 1.0 + @param faceX Face button X with a fixed value between 0.0 and 1.0 + @param faceY Face button Y with a fixed value between 0.0 and 1.0 + @param faceA Face button A with a fixed value between 0.0 and 1.0 + @param faceB Face button B with a fixed value between 0.0 and 1.0 + @param shoulderL Left shoulder button with a fixed value between 0.0 and 1.0 + @param shoulderR Right shoulder button with a fixed value between 0.0 and 1.0 + @param options Additional options to be defined. + */ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 12); + virtual void dispatchStandardGameControllerEvent( + AbsoluteTime timeStamp, + IOFixed dpadUp, + IOFixed dpadDown, + IOFixed dpadLeft, + IOFixed dpadRight, + IOFixed faceX, + IOFixed faceY, + IOFixed faceA, + IOFixed faceB, + IOFixed shoulderL, + IOFixed shoulderR, + IOOptionBits options = 0 ); + + /*! + @function dispatchExtendedGameControllerEvent + @abstract Dispatch extended game controller event + @discussion This is meant to dispatch a conforming extended game controller event that includes the + following: Direction Pad, Face Buttons, Left and Right Joysticks and 2 Left and 2 Right Shoulder Buttons. + @param timeStamp AbsoluteTime representing origination of event + @param dpadUp Direction pad up with a fixed value between 0.0 and 1.0 + @param dpadDown Direction pad down with a fixed value between 0.0 and 1.0 + @param dpadLeft Direction pad left with a fixed value between 0.0 and 1.0 + @param dpadRight Direction pad right with a fixed value between 0.0 and 1.0 + @param faceX Face button X with a fixed value between 0.0 and 1.0 + @param faceY Face button Y with a fixed value between 0.0 and 1.0 + @param faceA Face button A with a fixed value between 0.0 and 1.0 + @param faceB Face button B with a fixed value between 0.0 and 1.0 + @param shoulderL1 Top left shoulder button with a fixed value between 0.0 and 1.0 + @param shoulderR1 Top right shoulder button with a fixed value between 0.0 and 1.0 + @param shoulderL2 Bottom left shoulder button with a fixed value between 0.0 and 1.0 + @param shoulderR2 Bottom right shoulder button with a fixed value between 0.0 and 1.0 + @param joystickX Joystick X axis with a fixed value between -1.0 and 1.0 + @param joystickY Joystick Y axis with a fixed value between -1.0 and 1.0 + @param joystickZ Joystick Z axis with a fixed value between -1.0 and 1.0 + @param joystickRz Joystick Rz axis with a fixed value between -1.0 and 1.0 + @param options Additional options to be defined. + */ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 13); + virtual void dispatchExtendedGameControllerEvent( + AbsoluteTime timeStamp, + IOFixed dpadUp, + IOFixed dpadDown, + IOFixed dpadLeft, + IOFixed dpadRight, + IOFixed faceX, + IOFixed faceY, + IOFixed faceA, + IOFixed faceB, + IOFixed shoulderL1, + IOFixed shoulderR1, + IOFixed shoulderL2, + IOFixed shoulderR2, + IOFixed joystickX, + IOFixed joystickY, + IOFixed joystickZ, + IOFixed joystickRz, + IOOptionBits options = 0 ); + + +#else +protected: + OSMetaClassDeclareReservedUnused(IOHIDEventService, 7); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 8); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 9); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 10); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 11); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 12); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 13); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12 + /*! + @function dispatchBiometricEvent + @abstract Dispatch biometric event + @param timeStamp AbsoluteTime representing origination of event. + @param level Float value from 0 - 1.0 detailing the current level. + @param eventType The type of biometric event. + @param options Additional options to be defined. + */ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 14); + virtual void dispatchBiometricEvent( + AbsoluteTime timeStamp, + IOFixed level, + IOHIDBiometricEventType eventType, + IOOptionBits options = 0); +#else + OSMetaClassDeclareReservedUnused(IOHIDEventService, 14); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13 + /*! + @function copyEventForClient + @abstract Copy event/events for client + @dicussion function called NOT on service workloop. It is guaranteed that function call will not occur once service closed by this client + @param copySpec Event copy spec (If copySpec is an OSData object, physical copy needs to be made if callee intends to retain data) + @param options options + @param clientContext client identifier + */ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 15); + virtual IOHIDEvent * copyEventForClient (OSObject * copySpec, IOOptionBits options, void * clientContext); + + /*! + @function copyPropertyForClient + @abstract Copy property for client + @dicussion function called on service workloop + @param aKey property key + @param clientContext client identifier + */ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 16); + virtual OSObject * copyPropertyForClient (const char * aKey, void * clientContext) const; + + /*! + @function setPropertiesForClient + @abstract Set properties for client + @dicussion function called on service workloop + @param properties properties object + @param clientContext client identifier + */ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 17); + virtual IOReturn setPropertiesForClient (OSObject * properties, void * clientContext); + + /*! + @function openForClient + @abstract open service for client + @dicussion function called on service workloop + @param client client service + @param options options + @param property client property + @param clientContext client identifier should be provided by callee, will be used for all subsequent ...Client calls. It is safe to release memory associated with parameter at close + */ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 18); + virtual bool openForClient (IOService * client, IOOptionBits options, OSDictionary *property, void ** clientContext); + + /*! + @function closeForClient + @abstract close service for client + @param clientContext client identifier + @param options options + */ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 19); + virtual void closeForClient(IOService *client, void *context, IOOptionBits options = 0); +#else + OSMetaClassDeclareReservedUnused(IOHIDEventService, 15); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 16); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 17); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 18); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 19); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + /*! + @function dispatchExtendedGameControllerEvent + @abstract Dispatch extended game controller event + @discussion This is meant to dispatch a conforming extended game controller event that includes the + following: Direction Pad, Face Buttons, Left and Right Joysticks and 2 Left and 2 Right Shoulder Buttons. + @param timeStamp AbsoluteTime representing origination of event + @param dpadUp Direction pad up with a fixed value between 0.0 and 1.0 + @param dpadDown Direction pad down with a fixed value between 0.0 and 1.0 + @param dpadLeft Direction pad left with a fixed value between 0.0 and 1.0 + @param dpadRight Direction pad right with a fixed value between 0.0 and 1.0 + @param faceX Face button X with a fixed value between 0.0 and 1.0 + @param faceY Face button Y with a fixed value between 0.0 and 1.0 + @param faceA Face button A with a fixed value between 0.0 and 1.0 + @param faceB Face button B with a fixed value between 0.0 and 1.0 + @param shoulderL1 Top left shoulder button with a fixed value between 0.0 and 1.0 + @param shoulderR1 Top right shoulder button with a fixed value between 0.0 and 1.0 + @param shoulderL2 Bottom left shoulder button with a fixed value between 0.0 and 1.0 + @param shoulderR2 Bottom right shoulder button with a fixed value between 0.0 and 1.0 + @param joystickX Joystick X axis with a fixed value between -1.0 and 1.0 + @param joystickY Joystick Y axis with a fixed value between -1.0 and 1.0 + @param joystickZ Joystick Z axis with a fixed value between -1.0 and 1.0 + @param joystickRz Joystick Rz axis with a fixed value between -1.0 and 1.0 + @param thumbstickButtonLeft Joystick left thumbstick button with boolean value true/false for button down/up + @param thumbstickButtonRight Joystick right thumbstick button with boolean value true/false for button down/up + @param options Additional options to be defined. + */ + OSMetaClassDeclareReservedUsed(IOHIDEventService, 20); + virtual void dispatchExtendedGameControllerEventWithThumbstickButtons( + AbsoluteTime timeStamp, + IOFixed dpadUp, + IOFixed dpadDown, + IOFixed dpadLeft, + IOFixed dpadRight, + IOFixed faceX, + IOFixed faceY, + IOFixed faceA, + IOFixed faceB, + IOFixed shoulderL1, + IOFixed shoulderR1, + IOFixed shoulderL2, + IOFixed shoulderR2, + IOFixed joystickX, + IOFixed joystickY, + IOFixed joystickZ, + IOFixed joystickRz, + boolean_t thumbstickButtonLeft, + boolean_t thumbstickButtonRight, + IOOptionBits options = 0 ); +#else + OSMetaClassDeclareReservedUnused(IOHIDEventService, 20); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + OSMetaClassDeclareReservedUsed(IOHIDEventService, 21); + virtual IOHIDEvent *copyMatchingEvent(OSDictionary *matching); +#else + OSMetaClassDeclareReservedUnused(IOHIDEventService, 21); +#endif + + OSMetaClassDeclareReservedUnused(IOHIDEventService, 22); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 23); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 24); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 25); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 26); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 27); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 28); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 29); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 30); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 31); + +public: +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12 + virtual void close( IOService * forClient, IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_15 + /*! @function message + @abstract Receives messages delivered from an attached provider. + @discussion Handles the kIOMessageDeviceSignaledWakeup message + from a provider identifying the IOHIDDevice as the wakeup source. + @param type A type defined in IOMessage.h. + @param provider The provider from which the message originates. + @param argument An argument defined by the message type. + @result An IOReturn code defined by the message type. + */ + + virtual IOReturn message(UInt32 type, IOService * provider, void * argument) APPLE_KEXT_OVERRIDE; +#endif +}; + +#endif /* !_IOKIT_HID_IOHIDEVENTSERVICE_H */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDEventServiceKeys.h b/QualcommWireless/include/IOKit/hid/IOHIDEventServiceKeys.h new file mode 100644 index 0000000..595c458 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDEventServiceKeys.h @@ -0,0 +1,132 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 2019 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef IOHIDEventServiceKeys_h +#define IOHIDEventServiceKeys_h + +/*! + * @define kIOHIDPointerAccelerationKey + * + * @abstract + * Number property that contains the pointer acceleration value. + */ +#define kIOHIDPointerAccelerationKey "HIDPointerAcceleration" + +/*! + * @define kIOHIDPointerAccelerationTypeKey + * + * @abstract + * String property containing the type of acceleration for pointer. + * Supported types are: + * kIOHIDPointerAccelerationKey + * kIOHIDMouseScrollAccelerationKey + * kIOHIDTrackpadAccelerationType + */ +#define kIOHIDPointerAccelerationTypeKey "HIDPointerAccelerationType" + +/*! + * @define kIOHIDMouseScrollAccelerationKey + * + * @abstract + * Number property that contains the mouse scroll acceleration value. + */ +#define kIOHIDMouseScrollAccelerationKey "HIDMouseScrollAcceleration" + +/*! + * @define kIOHIDMouseAccelerationTypeKey + * + * @abstract + * Number property that contains the mouse acceleration value. + */ +#define kIOHIDMouseAccelerationTypeKey "HIDMouseAcceleration" + +/*! + * @define kIOHIDScrollAccelerationKey + * + * @abstract + * Number property that contains the scroll acceleration value. + */ +#define kIOHIDScrollAccelerationKey "HIDScrollAcceleration" + +/*! + * @define kIOHIDScrollAccelerationTypeKey + * + * @abstract + * Number property containing the type of acceleration for scroll. + * Supported types are: + * kIOHIDMouseScrollAccelerationKey + * kIOHIDTrackpadScrollAccelerationKey + */ +#define kIOHIDScrollAccelerationTypeKey "HIDScrollAccelerationType" + +/*! + * @define kIOHIDDigitizerTipThresholdKey + * + * @abstract + * Number property that describes the threshold percentage for when the tip + * pressure of a digitizer stylus should change from hovering to dragging. + * + * @discussion + * If a digitizer stylus supports the kHIDUsage_Dig_TipPressure (0x30) usage, + * the service may optionally publish this key to describe the value at which + * the pressure should change the pointer behavior from hovering to dragging. + * The value is a percentage from 0 to 100, where 100 percent is equal to the + * logical max that the stylus dispatches. If no value is provided, the default + * value of 75 will be used. + */ +#define kIOHIDDigitizerTipThresholdKey "DigitizerTipThreshold" + +/*! + * @define kIOHIDSurfaceDimensionsKey + * + * @abstract + * Dictionary property published on a service that describes the surface + * dimensions for services that publish absolute X/Y values, such as digitizer + * and pointer devices. The dictionary will contain the kIOHIDWidthKey and + * kIOHIDHeightKey keys described below. Value is in millimeter represented + * as IOFixed. + */ +#define kIOHIDSurfaceDimensionsKey "SurfaceDimensions" + +/*! + * @define kIOHIDWidthKey + * + * @abstract + * Number property used in the surface dimensions dictionary described above. + * Default value represents the physical max - physical min of the absolute + * X value. + */ +#define kIOHIDWidthKey "Width" + +/*! + * @define kIOHIDHeightKey + * + * @abstract + * Number property used in the surface dimensions dictionary described above. + * Default value represents the physical max - physical min of the absolute + * Y value. + */ +#define kIOHIDHeightKey "Height" + +#endif /* IOHIDDeviceTypes_h */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDEventServiceKeys_Private.h b/QualcommWireless/include/IOKit/hid/IOHIDEventServiceKeys_Private.h new file mode 100644 index 0000000..eb71209 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDEventServiceKeys_Private.h @@ -0,0 +1,60 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 2019 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef IOHIDEventServiceKeys_Private_h +#define IOHIDEventServiceKeys_Private_h + + +/*! + * @define kIOHIDMaxEventSizeKey + * + * @abstract + * Number property that describes the max event size in bytes that the event + * service will dispatch. If this property is not provided, the default max + * size will be set to 4096 bytes. + */ +#define kIOHIDMaxEventSizeKey "MaxEventSize" + +/*! + * @define kIOHIDMaxReportSizeKey + * + * @abstract + * Number property that describes the max report size in bytes that the device + * will dispatch. If this property is not provided, the + * kIOHIDMaxInputReportSizeKey key will be used. + */ +#define kIOHIDMaxReportSizeKey "MaxReportSize" + +/*! + * @define kIOHIDReportPoolSizeKey + * + * @abstract + * Number property that describes the amount of report buffers that should + * be created for handling reports. If this property is not provided, the + * default value of 1 will be used. + */ +#define kIOHIDReportPoolSizeKey "ReportPoolSize" + + +#endif /* IOHIDEventServiceKeys_Private_h */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDEventServiceTypes.h b/QualcommWireless/include/IOKit/hid/IOHIDEventServiceTypes.h new file mode 100644 index 0000000..94d7ed9 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDEventServiceTypes.h @@ -0,0 +1,74 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 2019 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef IOHIDEventServiceTypes_h +#define IOHIDEventServiceTypes_h + +/*! + * @typedef IOHIDKeyboardEventOptions + * + * @abstract + * Keyboard event options passed in to dispatchKeyboardEvent function in + * IOHIDEventService. + * + * @field kIOHIDKeyboardEventOptionsNoKeyRepeat + * Default behavior for keyboard events is to repeat keys if the key has been + * held down for a certain amount of time defined in system preferences. Pass + * in this option to not apply key repeat logic to this event. + */ +typedef enum { + kIOHIDKeyboardEventOptionsNoKeyRepeat = (1 << 8), +} IOHIDKeyboardEventOptions; + +/*! + * @typedef IOHIDPointerEventOptions + * + * @abstract + * Pointer event options passed in to dispatch(Relative/Absolute)PointerEvent + * function in IOHIDEventService. + * + * @field kIOHIDPointerEventOptionsNoAcceleration + * Pointer events are subject to an acceleration algorithm. Pass in this option + * if you do not wish to have acceleration logic applied to the pointer event. + */ +typedef enum { + kIOHIDPointerEventOptionsNoAcceleration = (1 << 8), +} IOHIDPointerEventOptions; + +/*! + * @typedef IOHIDScrollEventOptions + * + * @abstract + * Scroll event options passed in to dispatchScrollEvent function in + * IOHIDEventService. + * + * @field kIOHIDScrollEventOptionsNoAcceleration + * Scroll events are subject to an acceleration algorithm. Pass in this option + * if you do not wish to have acceleration logic applied to the scroll event. + */ +typedef enum { + kIOHIDScrollEventOptionsNoAcceleration = (1 << 8), +} IOHIDScrollEventOptions; + +#endif /* IOHIDEventServiceTypes_h */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDEventTypes.h b/QualcommWireless/include/IOKit/hid/IOHIDEventTypes.h new file mode 100644 index 0000000..9f37f49 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDEventTypes.h @@ -0,0 +1,723 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOHIDEVENTTYPES_H +#define _IOKIT_IOHIDEVENTTYPES_H /* { */ + +#include + +#if TARGET_OS_DRIVERKIT +#include +#else +#include +#endif + +#define IOHIDEventTypeMask(type) (1LL< +#else +#include +#endif + +enum { + kIOHIDGenericGestureTypeTap = 0, + kIOHIDGenericGestureTypeSwipe +}; + +enum { + kIOHIDDigitizerOrientationTypeTilt = 0, + kIOHIDDigitizerOrientationTypePolar, + kIOHIDDigitizerOrientationTypeQuality +}; + +enum { + kIOHIDEventFieldMultiAxisPointerButtonNumber = kIOHIDEventFieldButtonNumber, + kIOHIDEventFieldMultiAxisPointerButtonClickCount = kIOHIDEventFieldButtonClickCount, + kIOHIDEventFieldMultiAxisPointerButtonPressure = kIOHIDEventFieldButtonPressure +}; + +enum { + kIOHIDEventFieldPointerButtonNumber = kIOHIDEventFieldButtonNumber, + kIOHIDEventFieldPointerButtonClickCount = kIOHIDEventFieldButtonClickCount, + kIOHIDEventFieldPointerButtonPressure = kIOHIDEventFieldButtonPressure +}; + +/* DEPRECATED: use pointer field */ +enum { + kIOHIDEventFieldMouseX = kIOHIDEventFieldPointerX, + kIOHIDEventFieldMouseY = kIOHIDEventFieldPointerY, + kIOHIDEventFieldMouseZ = kIOHIDEventFieldPointerZ, + kIOHIDEventFieldMouseButtonMask = kIOHIDEventFieldPointerButtonMask, + kIOHIDEventFieldMouseNumber = kIOHIDEventFieldPointerButtonNumber, + kIOHIDEventFieldMouseClickCount = kIOHIDEventFieldPointerButtonClickCount, + kIOHIDEventFieldMousePressure = kIOHIDEventFieldPointerButtonPressure +}; + +/* DEPRECATED: misspelled */ +enum { + kIOHIDEventFieldNavagationSwipeFlavor = kIOHIDEventFieldNavigationSwipeFlavor +}; + +enum { + kIOHIDEventFieldForceLean = kIOHIDEventFieldForceStagePressure, + kIOHIDEventFieldForceTransitionProgress = kIOHIDEventFieldForceProgress +}; + +enum { + kIOHIDEventFieldDigitizerEstimatedMask = (kIOHIDEventFieldDigitizerBase | 30) +}; + +/*! + @typedef IOHIDMotionType + @abstract Type of Motion event triggered. + @constant kIOHIDMotionTypeNormal + @constant kIOHIDMotionTypeShake + */ +enum { + kIOHIDMotionTypeNormal = 0, + kIOHIDMotionTypeShake = 1, + kIOHIDMotionTypePath = 2 +}; +typedef uint32_t IOHIDMotionType; + +/*! + @typedef IOHIDMotionPath + @abstract Type of Motion Path event triggered. + @constant IOHIDMotionPathStart + @constant IOHIDMotionPathEnd + */ +enum { + kIOHIDMotionPathStart = 0, + kIOHIDMotionPathEnd = 1, +}; +typedef uint32_t IOHIDMotionPath; + +// Legacy +enum { + kIOHIDAccelerometerTypeNormal = kIOHIDMotionTypeNormal, + kIOHIDAccelerometerTypeShake = kIOHIDMotionTypeShake, + kIOHIDGyroTypeNormal = kIOHIDMotionTypeNormal, + kIOHIDGyroTypeShake = kIOHIDMotionTypeShake, +}; + +typedef IOHIDMotionType IOHIDAccelerometerType; +typedef IOHIDMotionPath IOHIDAccelerometerSubType; + + +typedef IOHIDMotionType IOHIDGyroType; +typedef IOHIDMotionPath IOHIDGyroSubType; + + +typedef IOHIDMotionType IOHIDCompassType; +typedef IOHIDMotionPath IOHIDCompassSubType; + + +enum { + kIOHIDKeyboardLongPress = 1, + kIOHIDKeyboardLongPressBit = 0, + kIOHIDKeyboardLongPressMask = (kIOHIDKeyboardLongPress << kIOHIDKeyboardLongPressBit), +}; + +enum { + kIOHIDKeyboardClickSpeedNone = 0, + kIOHIDKeyboardClickSpeedSlow = 1, + kIOHIDKeyboardClickSpeedNormal = 2, + kIOHIDKeyboardClickSpeedFast = 3, + kIOHIDKeyboardClickSpeedStartBit = 1, + kIOHIDKeyboardClickSpeedMask = (0x3 << kIOHIDKeyboardClickSpeedStartBit), +}; + +enum { + kIOHIDKeyboardSlowKeyNone = 0, + kIOHIDKeyboardSlowKeyPhaseStart = 1, + kIOHIDKeyboardSlowKeyPhaseAbort = 2, + kIOHIDKeyboardSlowKeyOn = 3, + kIOHIDKeyboardSlowKeyPhaseBit = 3, + kIOHIDKeyboardSlowKeyPhaseMask = (0x3 << kIOHIDKeyboardSlowKeyPhaseBit), +}; + +enum { + kIOHIDKeyboardMouseKeyToggle = 1, + kIOHIDKeyboardMouseKeyToggleBit = 5, + kIOHIDKeyboardMouseKeyToggleMask = (1 << kIOHIDKeyboardMouseKeyToggleBit), +}; + + +/*! + @typedef IOHIDPowerType + @abstract Type of Power event triggered. + @constant kIOHIDPowerTypePower + @constant kIOHIDPowerTypeCurrent + @constant kIOHIDPowerTypeVoltage + */ +enum { + kIOHIDPowerTypePower = 0, + kIOHIDPowerTypeCurrent = 1, + kIOHIDPowerTypeVoltage = 2 +}; +typedef uint32_t IOHIDPowerType; + +/*! + @typedef IOHIDPowerSubType + @abstract Reserved + @constant kIOHIDPowerSubTypeNormal + @constant kIOHIDPowerSubTypeCumulative + */ +enum { + kIOHIDPowerSubTypeNormal = 0, + kIOHIDPowerSubTypeCumulative +}; +typedef uint32_t IOHIDPowerSubType; + + +/*! + @typedef IOHIDBiometricEventType + @abstract Type of biometric event triggered. + @constant kIOHIDBiometricEventTypeHumanProximity + @constant kIOHIDBiometricEventTypeHumanTouch + @constant kIOHIDBiometricEventTypeHumanForce + @constant kIOHIDBiometricEventTypeHumanPresence + */ +enum { + kIOHIDBiometricEventTypeHumanProximity = 0, + kIOHIDBiometricEventTypeHumanTouch, + kIOHIDBiometricEventTypeHumanForce, + kIOHIDBiometricEventTypeHumanPresence +}; + +typedef uint32_t IOHIDBiometricEventType; + + + + + +enum { + kIOHIDUnicodeEncodingTypeUTF8, + kIOHIDUnicodeEncodingTypeUTF16LE, + kIOHIDUnicodeEncodingTypeUTF16BE, + kIOHIDUnicodeEncodingTypeUTF32LE, + kIOHIDUnicodeEncodingTypeUTF32BE, +}; +typedef uint32_t IOHIDUnicodeEncodingType; + + +/*! + @typedef IOHIDMotionActivityEventType + @abstract Type of motion activity event triggered. + @constant kIOHIDMotionActivityEventTypeUnknown + @constant kIOHIDMotionActivityEventTypeStatic + @constant kIOHIDMotionActivityEventTypeMoving + @constant kIOHIDMotionActivityEventTypeSemiStationary + @constant kIOHIDMotionActivityEventTypeWalking + @constant kIOHIDMotionActivityEventTypeRunning + @constant kIOHIDMotionActivityEventTypeCycling + @constant kIOHIDMotionActivityEventTypeInVehicleStatic + @constant kIOHIDMotionActivityEventTypeDriving + */ +enum { + kIOHIDMotionActivityEventTypeUnknown = 0, + kIOHIDMotionActivityEventTypeStatic, + kIOHIDMotionActivityEventTypeMoving, + kIOHIDMotionActivityEventTypeSemiStationary, + kIOHIDMotionActivityEventTypeWalking, + kIOHIDMotionActivityEventTypeRunning, + kIOHIDMotionActivityEventTypeCycling, + kIOHIDMotionActivityEventTypeInVehicleStatic, + kIOHIDMotionActivityEventTypeDriving, +}; + +typedef uint32_t IOHIDMotionActivityEventType; + + +/*! + @typedef IOHIDMotionGestureEventType + @abstract Type of motion gesture event triggered. + @constant kIOHIDMotionGestureEventTypeUnknown + @constant kIOHIDMotionGestureEventTypeRaiseToListen + @constant kIOHIDMotionGestureEventTypeRaiseToLook +*/ +enum { + kIOHIDMotionGestureEventTypeUnknown = 0, + kIOHIDMotionGestureEventTypeRaiseToListen, + kIOHIDMotionGestureEventTypeRaiseToLook, +}; + + +/*! + @typedef IOHIDSwipeMask + @abstract Mask detailing the type of swipe detected. + @constant kIOHIDSwipeUp + @constant kIOHIDSwipeDown + @constant kIOHIDSwipeLeft + @constant kIOHIDSwipeRight +*/ +enum { + kIOHIDSwipeNone = 0, + kIOHIDSwipeUp = 1<<0, + kIOHIDSwipeDown = 1<<1, + kIOHIDSwipeLeft = 1<<2, + kIOHIDSwipeRight = 1<<3, + kIOHIDScaleExpand = 1<<4, + kIOHIDScaleContract = 1<<5, + kIOHIDRotateCW = 1<<6, + kIOHIDRotateCCW = 1<<7, +}; +typedef uint32_t IOHIDSwipeMask; + +/*! + @typedef IOHIDGestureMotion + @abstract Motion gestures + @constant kIOHIDGestureMotionNone + @constant kIOHIDGestureMotionHorizontalX + @constant kIOHIDGestureMotionVerticalY + @constant kIOHIDGestureMotionScale + @constant kIOHIDGestureMotionRotate + @constant kIOHIDGestureMotionTap + @constant kIOHIDGestureMotionDoubleTap + @constant kIOHIDGestureMotionFromLeftEdge + @constant kIOHIDGestureMotionOffLeftEdge + @constant kIOHIDGestureMotionFromRightEdge + @constant kIOHIDGestureMotionOffRightEdge + @constant kIOHIDGestureMotionFromTopEdge + @constant kIOHIDGestureMotionOffTopEdge + @constant kIOHIDGestureMotionFromBottomEdge + @constant kIOHIDGestureMotionOffBottomEdge +*/ +enum { + kIOHIDGestureMotionNone, + kIOHIDGestureMotionHorizontalX, + kIOHIDGestureMotionVerticalY, + kIOHIDGestureMotionScale, + kIOHIDGestureMotionRotate, + kIOHIDGestureMotionTap, + kIOHIDGestureMotionDoubleTap, + kIOHIDGestureMotionFromLeftEdge, + kIOHIDGestureMotionOffLeftEdge, + kIOHIDGestureMotionFromRightEdge, + kIOHIDGestureMotionOffRightEdge, + kIOHIDGestureMotionFromTopEdge, + kIOHIDGestureMotionOffTopEdge, + kIOHIDGestureMotionFromBottomEdge, + kIOHIDGestureMotionOffBottomEdge, +}; +typedef uint16_t IOHIDGestureMotion; + +/*! + @typedef IOHIDGestureFlavor + @abstract Gesture flavours + @constant kIOHIDGestureFlavorNone + @constant kIOHIDGestureFlavorNotificationCenterPrimary + @constant kIOHIDGestureFlavorNotificationCenterSecondary + @constant kIOHIDGestureFlavorDockPrimary + @constant kIOHIDGestureFlavorDockSecondary + @constant kIOHIDGestureFlavorNavagationPrimary + @constant kIOHIDGestureFlavorNavagationSecondary + @constant kIOHIDGestureFlavorControlCenterPrimary + @constant kIOHIDGestureFlavorControlCenterSecondary +*/ +enum { + kIOHIDGestureFlavorNone, + kIOHIDGestureFlavorNotificationCenterPrimary, + kIOHIDGestureFlavorNotificationCenterSecondary, + kIOHIDGestureFlavorDockPrimary, + kIOHIDGestureFlavorDockSecondary, + kIOHIDGestureFlavorNavagationPrimary, + kIOHIDGestureFlavorNavagationSecondary, + kIOHIDGestureFlavorControlCenterPrimary, + kIOHIDGestureFlavorControlCenterSecondary, +}; +typedef uint16_t IOHIDGestureFlavor; + +/*! + @typedef IOHIDProximityDetectionMask + @abstract Proximity mask detailing the inputs that were detected. + @constant kIOHIDProximityDetectionLargeBodyContact + @constant kIOHIDProximityDetectionLargeBodyFarField + @constant kIOHIDProximityDetectionIrregularObjects + @constant kIOHIDProximityDetectionEdgeStraddling + @constant kIOHIDProximityDetectionFlatFingerClasp + @constant kIOHIDProximityDetectionFingerTouch + @constant kIOHIDProximityDetectionReceiver + @constant kIOHIDProximityDetectionSmallObjectsHovering + @constant kIOHIDProximityDetectionReceiverCrude + @constant kIOHIDProximityDetectionReceiverMonitoring +*/ +enum { + kIOHIDProximityDetectionLargeBodyContact = 1<<0, + kIOHIDProximityDetectionLargeBodyFarField = 1<<1, + kIOHIDProximityDetectionIrregularObjects = 1<<2, + kIOHIDProximityDetectionEdgeStraddling = 1<<3, + kIOHIDProximityDetectionFlatFingerClasp = 1<<4, + kIOHIDProximityDetectionFingerTouch = 1<<5, + kIOHIDProximityDetectionReceiver = 1<<6, + kIOHIDProximityDetectionSmallObjectsHovering = 1<<7, + kIOHIDProximityDetectionReceiverCrude = 1<<8, + kIOHIDProximityDetectionReceiverMonitoring = 1<<9 +}; +typedef uint32_t IOHIDProximityDetectionMask; + +/*! + @typedef IOHIDDigitizerType + @abstract The type of digitizer path initiating an event. + @constant kIOHIDDigitizerTransducerTypeStylus + @constant kIOHIDDigitizerTransducerTypePuck + @constant kIOHIDDigitizerTransducerTypeFinger + @constant kIOHIDDigitizerTransducerTypeHand +*/ +enum { + kIOHIDDigitizerTransducerTypeStylus = 0, + kIOHIDDigitizerTransducerTypePuck, + kIOHIDDigitizerTransducerTypeFinger, + kIOHIDDigitizerTransducerTypeHand +}; +typedef uint32_t IOHIDDigitizerTransducerType; + +/*! + @typedef IOHIDDigitizerEventMask + @abstract Event mask detailing the events being dispatched by a digitizer. + @discussion It is possible for digitizer events to contain child digitizer events, effectively, behaving as collections. + In the collection case, the child event mask field referrence by kIOHIDEventFieldDigitizerChildEventMask will detail the + cumulative event state of the child digitizer events. +
+ Please Note: + If you append a child digitizer event to a parent digitizer event, appropriate state will be transfered on to the parent. + @constant kIOHIDDigitizerEventRange Issued when the range state has changed. + @constant kIOHIDDigitizerEventTouch Issued when the touch state has changed. + @constant kIOHIDDigitizerEventPosition Issued when the position has changed. + @constant kIOHIDDigitizerEventStop Issued when motion has achieved a state of calculated non-movement. + @constant kIOHIDDigitizerEventPeak Issues when new maximum values have been detected. + @constant kIOHIDDigitizerEventIdentity Issued when the identity has changed. + @constant kIOHIDDigitizerEventAttribute Issued when an attribute has changed. + @constant kIOHIDDigitizerEventCancel + @constant kIOHIDDigitizerEventResting + @constant kIOHIDDigitizerEventFromEdgeFlat Issued when a digitizer approaches from the edge with flattened presentation + @constant kIOHIDDigitizerEventFromEdgeTip Issued when a digitizer approaches from the edge with standard (i.e. un-flattened) presentation. + @constant kIOHIDDigitizerEventFromCorner Issued when a digitizer approaches from a corner + @constant kIOHIDDigitizerEventSwipePending Issued to indicate that an edge swipe is pending + @constant kIOHIDDigitizerEventFromEdgeForcePending Issued to indicate that edge press is pending + @constant kIOHIDDigitizerEventFromEdgeForceActive Issued to indicate that edge press is active + @constant kIOHIDDigitizerEventUpSwipe Issued when an up swipe has been detected. + @constant kIOHIDDigitizerEventDownSwipe Issued when an down swipe has been detected. + @constant kIOHIDDigitizerEventLeftSwipe Issued when an left swipe has been detected. + @constant kIOHIDDigitizerEventRightSwipe Issued when an right swipe has been detected. + @constant kIOHIDDigitizerEventSwipeMask Mask used to gather swipe events. +*/ +enum { + kIOHIDDigitizerEventRange = 1<<0, + kIOHIDDigitizerEventTouch = 1<<1, + kIOHIDDigitizerEventPosition = 1<<2, + kIOHIDDigitizerEventStop = 1<<3, + kIOHIDDigitizerEventPeak = 1<<4, + kIOHIDDigitizerEventIdentity = 1<<5, + kIOHIDDigitizerEventAttribute = 1<<6, + kIOHIDDigitizerEventCancel = 1<<7, + kIOHIDDigitizerEventStart = 1<<8, + kIOHIDDigitizerEventResting = 1<<9, + kIOHIDDigitizerEventFromEdgeFlat = 1<<10, + kIOHIDDigitizerEventFromEdgeTip = 1<<11, + kIOHIDDigitizerEventFromCorner = 1<<12, + kIOHIDDigitizerEventSwipePending = 1<<13, + kIOHIDDigitizerEventFromEdgeForcePending = 1<<14, + kIOHIDDigitizerEventFromEdgeForceActive = 1<<15, + kIOHIDDigitizerEventTap = 1<<17, + kIOHIDDigitizerEventSwipeLocked = 1<<18, + kIOHIDDigitizerEventSwipeUp = 1<<24, + kIOHIDDigitizerEventSwipeDown = 1<<25, + kIOHIDDigitizerEventSwipeLeft = 1<<26, + kIOHIDDigitizerEventSwipeRight = 1<<27, + kIOHIDDigitizerEventEstimatedAltitude = 1<<28, + kIOHIDDigitizerEventEstimatedAzimuth = 1<<29, + kIOHIDDigitizerEventEstimatedPressure = 1<<30, + kIOHIDDigitizerEventSwipeMask = 0xF<<24, +}; +typedef uint32_t IOHIDDigitizerEventMask; + +/*! + @typedef IOHIDDigitizerEventUpdateMask + @abstract Bit mask detailing the fields that have or will change in a digitizer event +*/ +enum { + kIOHIDDigitizerEventUpdateXMask = 1< +#include +#include +#include +#include + +class IOHIDDevice; +class IOBufferMemoryDescriptor; +class OSAction; + +/*! @class IOHIDInterface : public IOService + @abstract In kernel interface to a HID device. +*/ + +class IOHIDInterface : public IOService +{ + OSDeclareDefaultStructorsWithDispatch( IOHIDInterface ) + +public: + + /*! @typedef IOHIDInterface::InterruptReportAction + @abstract Callback to handle an asynchronous report received from + the HID device. + @discussion This callback is set when calling IOHIDInterface::open. + @param target Pointer to your data object. + @param timestamp Time when the report was delivered. + @param report A memory descriptor that describes the report. + @param type The type of report. + @param reportID The ID of the report. + @param refcon void * pointer to more data. + */ + typedef void (*InterruptReportAction)( + OSObject * target, + AbsoluteTime timestamp, + IOMemoryDescriptor * report, + IOHIDReportType type, + UInt32 reportID, + void * refcon); + + /*! + @typedef IOHIDInterface::CompletionAction + @discussion Function called when HID I/O completes. + @param target Pointer to your data object. + @param refcon void * pointer to more data. + @param status Completion status. + @param bufferSizeRemaining Bytes left to be transferred. + */ + + typedef void (*CompletionAction)( + OSObject * target, + void * refcon, + IOReturn status, + UInt32 bufferSizeRemaining); + +private: + IOHIDDevice * _owner; + OSArray * _elementArray; + InterruptReportAction _interruptAction; + void * _interruptRefCon; + OSObject * _interruptTarget; + OSString * _transportString; + OSString * _manufacturerString; + OSString * _productString; + OSString * _serialNumberString; + UInt32 _locationID; + UInt32 _vendorID; + UInt32 _vendorIDSource; + UInt32 _productID; + UInt32 _version; + UInt32 _countryCode; + IOByteCount _maxReportSize[kIOHIDReportTypeCount]; + + struct ExpansionData { + UInt32 reportInterval; + OSAction *reportAction; + IOWorkLoop *workLoop; + IOCommandGate *commandGate; + OSArray *deviceElements; + OSSet *reportPool; + bool opened; + bool sleeping; + }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + bool openGated(IOService *forClient, IOOptionBits options, OSAction *action); + void handleReportGated(AbsoluteTime timestamp, + IOMemoryDescriptor *report, + IOHIDReportType type, + UInt32 reportID, + void *ctx); + IOReturn addReportToPoolGated(IOMemoryDescriptor *report); + +protected: + + void HandleReportPrivate(AbsoluteTime timestamp, + IOMemoryDescriptor * report, + IOHIDReportType type, + UInt32 reportID, + void * ctx); + + + /*! + @function free + @abstract Free the IOHIDInterface object. + @discussion Release all resources that were previously allocated, + then call super::free() to propagate the call to our superclass. + */ + + virtual void free() APPLE_KEXT_OVERRIDE; + +public: + + static IOHIDInterface * withElements ( OSArray * elements ); + + /*! + @function init + @abstract Initialize an IOHIDInterface object. + @discussion Prime the IOHIDInterface object and prepare it to support + a probe() or a start() call. This implementation will simply call + super::init(). + @param dictionary A dictionary associated with this IOHIDInterface + instance. + @result True on sucess, or false otherwise. + */ + + virtual bool init( OSDictionary * dictionary = 0 ) APPLE_KEXT_OVERRIDE; + + /*! + @function start + @abstract Start up the driver using the given provider. + @discussion IOHIDInterface will allocate resources. Before returning true + to indicate success, registerService() is called to trigger client matching. + @param provider The provider that the driver was matched to, and selected + to run with. + @result True on success, or false otherwise. + */ + + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + + + virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE; + /*! + @function matchPropertyTable + @abstract Called by the provider during a match + @discussion Compare the properties in the supplied table to this + object's properties. + @param table The property table that this device will match against + */ + + virtual bool matchPropertyTable( + OSDictionary * table, + SInt32 * score) APPLE_KEXT_OVERRIDE; + + virtual bool open ( + IOService * client, + IOOptionBits options, + InterruptReportAction action, + void * refCon); + + virtual void close( + IOService * client, + IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; + + using IOService::setProperty; + virtual bool setProperty( const OSSymbol * aKey, OSObject * anObject) APPLE_KEXT_OVERRIDE; + + virtual OSString * getTransport (); + virtual UInt32 getLocationID (); + virtual UInt32 getVendorID (); + virtual UInt32 getVendorIDSource (); + virtual UInt32 getProductID (); + virtual UInt32 getVersion (); + virtual UInt32 getCountryCode (); + virtual OSString * getManufacturer (); + virtual OSString * getProduct (); + virtual OSString * getSerialNumber (); + virtual IOByteCount getMaxReportSize (IOHIDReportType type); + + virtual OSArray * createMatchingElements ( + OSDictionary * matching = 0, + IOOptionBits options = 0); + + virtual void handleReport ( + AbsoluteTime timeStamp, + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID, + IOOptionBits options = 0); + + virtual IOReturn setReport ( + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID = 0, + IOOptionBits options = 0); + + virtual IOReturn getReport ( + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID = 0, + IOOptionBits options = 0); + + virtual IOReturn setReport ( + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID, + IOOptionBits options, + UInt32 completionTimeout, + CompletionAction * completion = 0); + + virtual IOReturn getReport ( + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID, + IOOptionBits options, + UInt32 completionTimeout, + CompletionAction * completion = 0); + virtual IOReturn message( + UInt32 type, + IOService * provider, + void * argument = NULL) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUsed(IOHIDInterface, 0); + virtual UInt32 getReportInterval (); + + OSMetaClassDeclareReservedUnused(IOHIDInterface, 1); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 2); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 3); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 4); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 5); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 6); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 7); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 8); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 9); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 10); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 11); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 12); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 13); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 14); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 15); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 16); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 17); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 18); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 19); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 20); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 21); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 22); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 23); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 24); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 25); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 26); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 27); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 28); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 29); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 30); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 31); +}; + +#endif /* !_IOKIT_HID_IOHIDINTERFACE_H */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDKeys.h b/QualcommWireless/include/IOKit/hid/IOHIDKeys.h new file mode 100644 index 0000000..203b5c0 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDKeys.h @@ -0,0 +1,375 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDKEYS_H_ +#define _IOKIT_HID_IOHIDKEYS_H_ + +#include +#include +#include +#include +#include +#include +#include + +__BEGIN_DECLS + +/* The following keys are used to search the IORegistry for HID related services +*/ + +/* This is used to find HID Devices in the IORegistry */ +#define kIOHIDDeviceKey "IOHIDDevice" + +/*! + @defined HID Device Property Keys + @abstract Keys that represent properties of a paticular device. + @discussion Keys that represent properties of a paticular device. Can be added + to your matching dictionary when refining searches for HID devices. +

+ Please note:
+ kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer + rich enough to describe a device's capabilities. Take, for example, a + device that describes both a keyboard and a mouse in the same descriptor. + The previous behavior was to only describe the keyboard behavior with the + primary usage and usage page. Needless to say, this would sometimes cause + a program interested in mice to skip this device when matching. +
+ Thus we have added 3 + additional keys: +
    +
  • kIOHIDDeviceUsageKey
  • +
  • kIOHIDDeviceUsagePageKey
  • +
  • kIOHIDDeviceUsagePairsKey
  • +
+ kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing + key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. + These usage pairs describe all application type collections (behaviors) defined + by the device. +

+ An application intersted in only matching on one criteria would only add the + kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. + If it is interested in a device that has multiple behaviors, the application would + instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his + matching dictionary. +*/ +#define kIOHIDVendorIDSourceKey "VendorIDSource" +#define kIOHIDStandardTypeKey "StandardType" +#define kIOHIDSampleIntervalKey "SampleInterval" +#define kIOHIDResetKey "Reset" +#define kIOHIDKeyboardLanguageKey "KeyboardLanguage" +#define kIOHIDAltHandlerIdKey "alt_handler_id" +#define kIOHIDDisplayIntegratedKey "DisplayIntegrated" +#define kIOHIDProductIDMaskKey "ProductIDMask" +#define kIOHIDProductIDArrayKey "ProductIDArray" +#define kIOHIDPowerOnDelayNSKey "HIDPowerOnDelayNS" +#define kIOHIDCategoryKey "Category" +#define kIOHIDMaxResponseLatencyKey "MaxResponseLatency" +#define kIOHIDUniqueIDKey "UniqueID" +#define kIOHIDModelNumberKey "ModelNumber" + + +#define kIOHIDTransportUSBValue "USB" +#define kIOHIDTransportBluetoothValue "Bluetooth" +#define kIOHIDTransportBluetoothLowEnergyValue "BluetoothLowEnergy" +#define kIOHIDTransportAIDBValue "AID" +#define kIOHIDTransportI2CValue "I2C" +#define kIOHIDTransportSPIValue "SPI" +#define kIOHIDTransportSerialValue "Serial" +#define kIOHIDTransportIAPValue "iAP" +#define kIOHIDTransportAirPlayValue "AirPlay" +#define kIOHIDTransportSPUValue "SPU" +#define kIOHIDTransportBTAACPValue "BT-AACP" + + +#define kIOHIDCategoryAutomotiveValue "Automotive" + +/*! + @define kIOHIDElementKey + @abstract Keys that represents an element property. + @discussion Property for a HID Device or element dictionary. + Elements can be heirarchical, so they can contain other elements. +*/ +#define kIOHIDElementKey "Elements" + +/*! + @defined HID Element Dictionary Keys + @abstract Keys that represent properties of a particular elements. + @discussion These keys can also be added to a matching dictionary + when searching for elements via copyMatchingElements. +*/ +#define kIOHIDElementCookieKey "ElementCookie" +#define kIOHIDElementTypeKey "Type" +#define kIOHIDElementCollectionTypeKey "CollectionType" +#define kIOHIDElementUsageKey "Usage" +#define kIOHIDElementUsagePageKey "UsagePage" +#define kIOHIDElementMinKey "Min" +#define kIOHIDElementMaxKey "Max" +#define kIOHIDElementScaledMinKey "ScaledMin" +#define kIOHIDElementScaledMaxKey "ScaledMax" +#define kIOHIDElementSizeKey "Size" +#define kIOHIDElementReportSizeKey "ReportSize" +#define kIOHIDElementReportCountKey "ReportCount" +#define kIOHIDElementReportIDKey "ReportID" +#define kIOHIDElementIsArrayKey "IsArray" +#define kIOHIDElementIsRelativeKey "IsRelative" +#define kIOHIDElementIsWrappingKey "IsWrapping" +#define kIOHIDElementIsNonLinearKey "IsNonLinear" +#define kIOHIDElementHasPreferredStateKey "HasPreferredState" +#define kIOHIDElementHasNullStateKey "HasNullState" +#define kIOHIDElementFlagsKey "Flags" +#define kIOHIDElementUnitKey "Unit" +#define kIOHIDElementUnitExponentKey "UnitExponent" +#define kIOHIDElementNameKey "Name" +#define kIOHIDElementValueLocationKey "ValueLocation" +#define kIOHIDElementDuplicateIndexKey "DuplicateIndex" +#define kIOHIDElementParentCollectionKey "ParentCollection" +#define kIOHIDElementVariableSizeKey "VariableSize" + +#ifndef __ppc__ + #define kIOHIDElementVendorSpecificKey "VendorSpecific" +#else + #define kIOHIDElementVendorSpecificKey "VendorSpecifc" +#endif + +/*! + @defined HID Element Match Keys + @abstract Keys used for matching particular elements. + @discussion These keys should only be used with a matching + dictionary when searching for elements via copyMatchingElements. +*/ +#define kIOHIDElementCookieMinKey "ElementCookieMin" +#define kIOHIDElementCookieMaxKey "ElementCookieMax" +#define kIOHIDElementUsageMinKey "UsageMin" +#define kIOHIDElementUsageMaxKey "UsageMax" + +/*! + @defined kIOHIDElementCalibrationMinKey + @abstract The minimum bounds for a calibrated value. +*/ +#define kIOHIDElementCalibrationMinKey "CalibrationMin" + +/*! + @defined kIOHIDElementCalibrationMaxKey + @abstract The maximum bounds for a calibrated value. +*/ +#define kIOHIDElementCalibrationMaxKey "CalibrationMax" + +/*! + @defined kIOHIDElementCalibrationSaturationMinKey + @abstract The mininum tolerance to be used when calibrating a logical element value. + @discussion The saturation property is used to allow for slight differences in the minimum and maximum value returned by an element. +*/ +#define kIOHIDElementCalibrationSaturationMinKey "CalibrationSaturationMin" + +/*! + @defined kIOHIDElementCalibrationSaturationMaxKey + @abstract The maximum tolerance to be used when calibrating a logical element value. + @discussion The saturation property is used to allow for slight differences in the minimum and maximum value returned by an element. +*/ +#define kIOHIDElementCalibrationSaturationMaxKey "CalibrationSaturationMax" + +/*! + @defined kIOHIDElementCalibrationDeadZoneMinKey + @abstract The minimum bounds near the midpoint of a logical value in which the value is ignored. + @discussion The dead zone property is used to allow for slight differences in the idle value returned by an element. +*/ +#define kIOHIDElementCalibrationDeadZoneMinKey "CalibrationDeadZoneMin" + +/*! + @defined kIOHIDElementCalibrationDeadZoneMinKey + @abstract The maximum bounds near the midpoint of a logical value in which the value is ignored. + @discussion The dead zone property is used to allow for slight differences in the idle value returned by an element. +*/ +#define kIOHIDElementCalibrationDeadZoneMaxKey "CalibrationDeadZoneMax" + +/*! + @defined kIOHIDElementCalibrationGranularityKey + @abstract The scale or level of detail returned in a calibrated element value. + @discussion Values are rounded off such that if granularity=0.1, values after calibration are 0, 0.1, 0.2, 0.3, etc. +*/ +#define kIOHIDElementCalibrationGranularityKey "CalibrationGranularity" + +/*! + @defined kIOHIDKeyboardSupportsEscKey + @abstract Describe if keyboard device supports esc key. + @discussion Keyboard devices having full HID keyboard descriptor can specify if esc key is actually supported or not. For new macs with TouchBar this is ideal scenario where keyboard descriptor by defaultspecifies presence of esc key but through given property client can check if key is present or not + */ +#define kIOHIDKeyboardSupportsEscKey "HIDKeyboardSupportsEscKey" + +/*! + @typedef IOHIDOptionsType + @abstract Options for opening a device via IOHIDLib. + @constant kIOHIDOptionsTypeNone Default option. + @constant kIOHIDOptionsTypeSeizeDevice Used to open exclusive + communication with the device. This will prevent the system + and other clients from receiving events from the device. +*/ +enum { + kIOHIDOptionsTypeNone = 0x00, + kIOHIDOptionsTypeSeizeDevice = 0x01 +}; +typedef uint32_t IOHIDOptionsType; + + +/*! + @typedef IOHIDQueueOptionsType + @abstract Options for creating a queue via IOHIDLib. + @constant kIOHIDQueueOptionsTypeNone Default option. + @constant kIOHIDQueueOptionsTypeEnqueueAll Force the IOHIDQueue + to enqueue all events, relative or absolute, regardless of change. +*/ +enum { + kIOHIDQueueOptionsTypeNone = 0x00, + kIOHIDQueueOptionsTypeEnqueueAll = 0x01 +}; +typedef uint32_t IOHIDQueueOptionsType; + +/*! + @typedef IOHIDStandardType + @abstract Type to define what industrial standard the device is referencing. + @constant kIOHIDStandardTypeANSI ANSI. + @constant kIOHIDStandardTypeISO ISO. + @constant kIOHIDStandardTypeJIS JIS. + @constant kIOHIDStandardTypeUnspecified. +*/ +enum { + kIOHIDStandardTypeANSI = 0x0, + kIOHIDStandardTypeISO = 0x1, + kIOHIDStandardTypeJIS = 0x2, + kIOHIDStandardTypeUnspecified = 0xFFFFFFFF, +}; +typedef uint32_t IOHIDStandardType; + +#define kIOHIDDigitizerGestureCharacterStateKey "DigitizerCharacterGestureState" + +/* + * kIOHIDSystemButtonPressedDuringDarkBoot - Used to message that a wake button was pressed during dark boot + */ +#define kIOHIDSystemButtonPressedDuringDarkBoot iokit_family_msg(sub_iokit_hidsystem, 7) + +/*! + @defined IOHIDKeyboard Keys + @abstract Keys that represent parameters of keyboards. + @discussion Legacy IOHIDKeyboard keys, formerly in IOHIDPrivateKeys. See IOHIDServiceKeys.h for the new keys. + */ +#define kIOHIDKeyboardCapsLockDelay "CapsLockDelay" +#define kIOHIDKeyboardEjectDelay "EjectDelay" + +/*! + @defined kFnFunctionUsageMapKey + @abstract top row key remapping for consumer usages + @discussion string of comma separated uint64_t value representing (usagePage<<32) | usage pairs + + */ +#define kFnFunctionUsageMapKey "FnFunctionUsageMap" + +/*! + @defined kFnKeyboardUsageMapKey + @abstract top row key reampping for consumer usages + @discussion string of comma separated uint64_t value representing (usagePage<<32) | usage pairs + + */ +#define kFnKeyboardUsageMapKey "FnKeyboardUsageMap" + +#define kNumLockKeyboardUsageMapKey "NumLockKeyboardUsageMap" + +#define kKeyboardUsageMapKey "KeyboardUsageMap" + +/*! + @defined kIOHIDDeviceOpenedByEventSystemKey + @abstract Property set when corresponding event service object opened by HID event system + @discussion boolean value + + */ +#define kIOHIDDeviceOpenedByEventSystemKey "DeviceOpenedByEventSystem" + +/*! + * @define kIOHIDDeviceSuspendKey + * + * @abstract + * Boolean property set on a user space IOHIDDeviceRef to suspend report delivery + * to registered callbacks. + * + * @discussion + * When set to true, the callbacks registered via the following API will not be invoked: + * IOHIDDeviceRegisterInputReportCallback + * IOHIDDeviceRegisterInputReportWithTimeStampCallback + * IOHIDDeviceRegisterInputValueCallback + * To resume report delivery, this property should be set to false. + */ +#define kIOHIDDeviceSuspendKey "IOHIDDeviceSuspend" + + + +/*! + @defined kIOHIDSensorPropertyReportIntervalKey + @abstract Property to get or set the Report Interval in us of supported sensor devices + @discussion Corresponds to kHIDUsage_Snsr_Property_ReportInterval in a sensor device's + descriptor. + */ +#define kIOHIDSensorPropertyReportIntervalKey kIOHIDReportIntervalKey + +/*! + @defined kIOHIDSensorPropertySampleIntervalKey + @abstract Property to get or set the Sample Interval in us of supported sensor devices + @discussion Corresponds to kHIDUsage_Snsr_Property_SamplingRate in a sensor device's + descriptor. + */ +#define kIOHIDSensorPropertySampleIntervalKey kIOHIDSampleIntervalKey + +/*! + @defined kIOHIDSensorPropertyBatchIntervalKey + @abstract Property to get or set the Batch Interval / Report Latency in us of supported sensor devices + @discussion Corresponds to kHIDUsage_Snsr_Property_ReportLatency in a sensor device's + descriptor. + */ +#define kIOHIDSensorPropertyBatchIntervalKey kIOHIDBatchIntervalKey + +/*! + @defined kIOHIDSensorPropertyReportLatencyKey + @abstract Alias of kIOHIDSensorPropertyBatchIntervalKey + */ +#define kIOHIDSensorPropertyReportLatencyKey kIOHIDSensorPropertyBatchIntervalKey + +/*! + @defined kIOHIDSensorPropertyMaxFIFOEventsKey + @abstract Property to get or set the maximum FIFO event queue size of supported sensor devices + @discussion Corresponds to kHIDUsage_Snsr_Property_MaxFIFOEvents in a sensor device's + descriptor. + */ +#define kIOHIDSensorPropertyMaxFIFOEventsKey "MaxFIFOEvents" + +/*! + @defined kIOHIDDigitizerSurfaceSwitchKey + @abstract Property to turn on / of surface digitizer contact reporting + @discussion To allow for better power management, a host may wish to indicate what it would like a touchpad digitizer to not report surface digitizer contacts by clearing this + flag. By default, upon cold‐boot/power cycle, touchpads that support reporting surface + contacts shall do so by default. +*/ + +#define kIOHIDDigitizerSurfaceSwitchKey "DigitizerSurfaceSwitch" + +__END_DECLS + +#endif /* !_IOKIT_HID_IOHIDKEYS_H_ */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDPrivateKeys.h b/QualcommWireless/include/IOKit/hid/IOHIDPrivateKeys.h new file mode 100644 index 0000000..939411e --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDPrivateKeys.h @@ -0,0 +1,242 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDPRIVATEKEYS_H_ +#define _IOKIT_HID_IOHIDPRIVATEKEYS_H_ + +#include +#include +#include +#include + +__BEGIN_DECLS + +/*! + @defined HID Device Property Keys + @abstract Keys that represent properties of a paticular device. + @discussion Keys that represent properties of a paticular element. Can be added + to your matching dictionary when refining searches for HID devices. +*/ +#define kIOHIDInputReportElementsKey "InputReportElements" + +#define kIOHIDReportModeKey "ReportMode" + +typedef enum { + kIOHIDReportModeTypeNormal = 0, + kIOHIDReportModeTypeFiltered +} IOHIDReportModeType; + +/* Following table is used to convert Apple USB keyboard IDs into a numbering + scheme that can be combined with ADB handler IDs for both Cocoa and Carbon */ +enum { + kgestUSBUnknownANSIkd = 3, /* Unknown ANSI keyboard */ + kgestUSBGenericANSIkd = 40, /* Generic ANSI keyboard */ + kgestUSBGenericISOkd = 41, /* Generic ANSI keyboard */ + kgestUSBGenericJISkd = 42, /* Generic ANSI keyboard */ + + kgestUSBCosmoANSIKbd = 198, /* (0xC6) Gestalt Cosmo USB Domestic (ANSI) Keyboard */ + kprodUSBCosmoANSIKbd = 0x201, // The actual USB product ID in hardware + kgestUSBCosmoISOKbd = 199, /* (0xC7) Cosmo USB International (ISO) Keyboard */ + kprodUSBCosmoISOKbd = 0x202, + kgestUSBCosmoJISKbd = 200, /* (0xC8) Cosmo USB Japanese (JIS) Keyboard */ + kprodUSBCosmoJISKbd = 0x203, + kgestUSBAndyANSIKbd = 204, /* (0xCC) Andy USB Keyboard Domestic (ANSI) Keyboard */ + kprodUSBAndyANSIKbd = 0x204, + kgestUSBAndyISOKbd = 205, /* (0xCD) Andy USB Keyboard International (ISO) Keyboard */ + kprodUSBAndyISOKbd = 0x205, + kgestUSBAndyJISKbd = 206, /* (0xCE) Andy USB Keyboard Japanese (JIS) Keyboard */ + kprodUSBAndyJISKbd = 0x206, + + kgestQ6ANSIKbd = 31, /* (031) Apple Q6 Keyboard Domestic (ANSI) Keyboard */ + kprodQ6ANSIKbd = 0x208, + kgestQ6ISOKbd = 32, /* (32) Apple Q6 Keyboard International (ISO) Keyboard */ + kprodQ6ISOKbd = 0x209, + kgestQ6JISKbd = 33, /* (33) Apple Q6 Keyboard Japanese (JIS) Keyboard */ + kprodQ6JISKbd = 0x20a, + + kgestQ30ANSIKbd = 34, /* (34) Apple Q30 Keyboard Domestic (ANSI) Keyboard */ + kprodQ30ANSIKbd = 0x20b, + kgestQ30ISOKbd = 35, /* (35) Apple Q30 Keyboard International (ISO) Keyboard */ + kprodQ30ISOKbd = 0x20c, + kgestQ30JISKbd = 36, /* (36) Apple Q30 Keyboard Japanese (JIS) Keyboard */ + kprodQ30JISKbd = 0x20d, + + kgestFountainANSIKbd = 37, /* (37) Apple Fountain Keyboard Domestic (ANSI) Keyboard */ + kprodFountainANSIKbd = 0x20e, + kgestFountainISOKbd = 38, /* (38) Apple Fountain Keyboard International (ISO) Keyboard */ + kprodFountainISOKbd = 0x20f, + kgestFountainJISKbd = 39, /* (39) Apple Fountain Keyboard Japanese (JIS) Keyboard */ + kprodFountainJISKbd = 0x210, + + kgestSantaANSIKbd = 37, /* (37) Apple Santa Keyboard Domestic (ANSI) Keyboard */ + kprodSantaANSIKbd = 0x211, + kgestSantaISOKbd = 38, /* (38) Apple Santa Keyboard International (ISO) Keyboard */ + kprodSantaISOKbd = 0x212, + kgestSantaJISKbd = 39, /* (39) Apple Santa Keyboard Japanese (JIS) Keyboard */ + kprodSantaJISKbd = 0x213, + + kgestM89ISOKbd = 47, /* (47) Apple M89 Wired (ISO) Keyboard */ + kgestM90ISOKbd = 44 /* (44) Apple M90 Wireless (ISO) Keyboard */ +}; + +/*! + @defined kIOHIDLogLevelKey + @abstract Level of detailed logging generated by device driver. + @discussion The values should match level used in syslog and asl. +*/ + +#define kIOHIDLogLevelKey "LogLevel" + +typedef enum { + kIOHIDLogLevelTypeEmergency = 0, + kIOHIDLogLevelTypeAlert, + kIOHIDLogLevelTypeCritical, + kIOHIDLogLevelTypeError, + kIOHIDLogLevelTypeWarning, + kIOHIDLogLevelTypeNotice, + kIOHIDLogLevelTypeInfo, + kIOHIDLogLevelTypeDebug, + kIOHIDLogLevelTypeTrace +} IOHIDLogLevelType; + +/*! + @defined kIOHIDTraceConfigKey + @abstract enable/configure ktrace signposts + @discussion property should be set on event system +*/ + +#define kIOHIDDebugConfigKey "HIDDebug" + +enum { + kIOHIDDebugTraceWithKTrace = 0x1, + kIOHIDDebugTraceWithOsLog = 0x2, + kIOHIDDebugTraceUserDevice = 0x4, + kIOHIDDebugTraceEventSystem = 0x8, + kIOHIDDebugPerfEvent = 0x10, +}; + +/*! + @defined kIOHIDPerfKey + @abstract tag events with perf event + @discussion perf event will be added as child to top level event +*/ + +#define kIOHIDPerfEventKey "PerfEvent" + + +/*! + @defined HID Element Dictionary Keys + @abstract Keys that represent properties of a particular elements. + @discussion These keys can also be added to a matching dictionary + when searching for elements via copyMatchingElements. +*/ +#define kIOHIDElementCollectionCookieKey "CollectionCookie" + +#define kIOHIDAbsoluteAxisBoundsRemovalPercentage "AbsoluteAxisBoundsRemovalPercentage" + +#define kIOHIDEventServiceQueueSize "QueueSize" +#define kIOHIDAltSenderIdKey "alt_sender_id" + +/*! + * @define kIOHIDMaxReportBufferCountKey + * @abstract Number property published on an IOHIDDevice that contains the + * report buffer count. + * @discussion HID devices can have the concept of a report buffer, wherein + * reports can be enqueued and dispatched in quick succession. + * A report buffer count can be published to help determine the + * correct queue size that will be able to handle incoming report + * rates. The queue size is determined by report buffer count + * multiplied by the report buffer's entry size (see + * kIOHIDReportBufferEntrySizeKey below). + */ +#define kIOHIDMaxReportBufferCountKey "MaxReportBufferCount" + +/*! + * @define kIOHIDReportBufferEntrySizeKey + * @abstract Number property published on an IOHIDDevice that contains + * the report buffer's entry size. + * @discussion Used in conjunction with kIOHIDMaxReportBufferCountKey. + * This key describes the entry size of the reports (in bytes) + * in the report buffer. The queue size is determined by the + * report buffer's report count multiplied by the entry size. + */ +#define kIOHIDReportBufferEntrySizeKey "ReportBufferEntrySize" + +#define kIOHIDAppleVendorSupported "AppleVendorSupported" + +#define kIOHIDSetButtonPropertiesKey "SetButtonProperties" +#define kIOHIDSetButtonPriorityKey "SetButtonPriority" +#define kIOHIDSetButtonDelayKey "SetButtonDelay" +#define kIOHIDSetButtonLoggingKey "SetButtonLogging" + +#define kIOHIDSetDoubleClickTimeoutKey "SetDoubleClickTimeout" + +#define kIOHIDSupportsGlobeKeyKey "SupportsGlobeKey" + +#define kIOHIDCompatibilityInterface "HIDCompatibilityInterface" + +#define kIOHIDAuthenticatedDeviceKey "Authenticated" + + +/*! + @typedef IOHIDGameControllerType + @abstract Describes support game controller types. + @constant kIOHIDGameControllerTypeStandard Standard game controller. + @constant kIOHIDGameControllerTypeExtended Extended game controller. + */ +enum { + kIOHIDGameControllerTypeStandard, + kIOHIDGameControllerTypeExtended +}; +typedef uint32_t IOHIDGameControllerType; + +#define kIOHIDGameControllerTypeKey "GameControllerType" + +#define kIOHIDGameControllerFormFittingKey "GameControllerFormFitting" + + +#define kIOHIDFastPathHasEntitlementKey "FastPathHasEntitlement" + + +/*! + @typedef IOHIDHomeButtonType + @abstract Integer value that describes the type of home/menu button on the device. + @discussion For use with MobileGestalt key kMGQHomeButtonType. This query is + applicable to standard iOS. Use with other platforms or nonstandard + iOS devices could have unexpected results. + @constant kIOHIDHomeButtonTypeMechanical Mechanical home button. + @constant kIOHIDHomeButtonTypeSSHB "Solid-state" virtual home button. + @constant kIOHIDHomeButtonTypeNone No home button - e.g. on-screen virtual home bar. + */ +typedef enum { + kIOHIDHomeButtonTypeMechanical = 0, + kIOHIDHomeButtonTypeSSHB = 1, + kIOHIDHomeButtonTypeNone = 2 +} IOHIDHomeButtonType; + + + +__END_DECLS + +#endif /* !_IOKIT_HID_IOHIDPRIVATEKEYS_H_ */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDProperties.h b/QualcommWireless/include/IOKit/hid/IOHIDProperties.h new file mode 100644 index 0000000..c172dff --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDProperties.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2016 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef IOHIDProperties_h +#define IOHIDProperties_h + +#include + +/*! + * @define kIOHIDMouseAccelerationType + * + * @abstract CFNumber that contains the mouse acceleration value. + */ +#define kIOHIDMouseAccelerationType "HIDMouseAcceleration" + +/*! + * @define kIOHIDPointerButtonMode + * + * @abstract CFNumber containing the current pointer button mode. + * See IOHIDButtonModes enumerator for possible modes. + */ +#define kIOHIDPointerButtonMode "HIDPointerButtonMode" +#define kIOHIDPointerButtonModeKey kIOHIDPointerButtonMode + +/*! + * @define kIOHIDUserUsageMapKey + * + * @abstract CFArray of dictionaries that contain user defined key mappings. + */ +#define kIOHIDUserKeyUsageMapKey "UserKeyMapping" + +/*! + * @define kIOHIDKeyboardCapsLockDelayOverride + * + * @abstract CFNumber containing the delay (in ms) before the caps lock key is activated. + */ +#define kIOHIDKeyboardCapsLockDelayOverride "CapsLockDelayOverride" +#define kIOHIDKeyboardCapsLockDelayOverrideKey kIOHIDKeyboardCapsLockDelayOverride + +/*! + * @define kIOHIDServiceEjectDelayKey + * + * @abstract CFNumber containing the delay (in ms) before the eject key is activated. + */ +#define kIOHIDServiceEjectDelayKey "EjectDelay" + +/*! + * @define kIOHIDServiceInitialKeyRepeatDelayKey + * + * @abstract CFNumber containing the delay (in ns) before the initial key repeat. + * If value is 0, there are no repeats. + */ +#define kIOHIDServiceInitialKeyRepeatDelayKey "HIDInitialKeyRepeat" + +/*! + * @define kIOHIDServiceKeyRepeatDelayKey + * + * @abstract CFNumber containing the delay (in ns) for subsequent key repeats. + * If value is 0, there are no repeats (including initial). + */ +#define kIOHIDServiceKeyRepeatDelayKey "HIDKeyRepeat" + +/*! + * @define kIOHIDIdleTimeMicrosecondsKey + * + * @abstract CFNumber containing the HID idle time in microseconds. + */ +#define kIOHIDIdleTimeMicrosecondsKey "HIDIdleTimeMicroseconds" + +/*! + * @define kIOHIDServiceCapsLockStateKey + * + * @abstract CFBoolean for setting/getting the caps lock state of the + * service. The caps lock LED will be updated to reflect the state. + */ +#define kIOHIDServiceCapsLockStateKey "HIDCapsLockState" + +#endif /* IOHIDProperties_h */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDUsageTables.h b/QualcommWireless/include/IOKit/hid/IOHIDUsageTables.h new file mode 100644 index 0000000..77db996 --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDUsageTables.h @@ -0,0 +1,2591 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOHIDUSAGETABLES_H +#define _IOHIDUSAGETABLES_H + +/* ****************************************************************************************** + * HID Usage Tables + * + * The following constants are from the USB 'HID Usage Tables' specification, revision 1.1rc3 + * ****************************************************************************************** */ + + +/* Usage Pages */ +enum +{ + kHIDPage_Undefined = 0x00, + kHIDPage_GenericDesktop = 0x01, + kHIDPage_Simulation = 0x02, + kHIDPage_VR = 0x03, + kHIDPage_Sport = 0x04, + kHIDPage_Game = 0x05, + kHIDPage_GenericDeviceControls = 0x06, + kHIDPage_KeyboardOrKeypad = 0x07, /* USB Device Class Definition for Human Interface Devices (HID). Note: the usage type for all key codes is Selector (Sel). */ + kHIDPage_LEDs = 0x08, + kHIDPage_Button = 0x09, + kHIDPage_Ordinal = 0x0A, + kHIDPage_Telephony = 0x0B, + kHIDPage_Consumer = 0x0C, + kHIDPage_Digitizer = 0x0D, + /* Reserved 0x0E */ + kHIDPage_PID = 0x0F, /* USB Physical Interface Device definitions for force feedback and related devices. */ + kHIDPage_Unicode = 0x10, + /* Reserved 0x11 - 0x13 */ + kHIDPage_AlphanumericDisplay = 0x14, + /* Reserved 0x15 - 0x1F */ + kHIDPage_Sensor = 0x20, + /* Reserved 0x21 - 0x7f */ + kHIDPage_Monitor = 0x80, + kHIDPage_MonitorEnumerated = 0x81, + kHIDPage_MonitorVirtual = 0x82, + kHIDPage_MonitorReserved = 0x83, + /* Power 0x84 - 0x87 USB Device Class Definition for Power Devices */ + kHIDPage_PowerDevice = 0x84, /* Power Device Page */ + kHIDPage_BatterySystem = 0x85, /* Battery System Page */ + kHIDPage_PowerReserved = 0x86, + kHIDPage_PowerReserved2 = 0x87, + /* Reserved 0x88 - 0x8B */ + kHIDPage_BarCodeScanner = 0x8C, /* (Point of Sale) USB Device Class Definition for Bar Code Scanner Devices */ + kHIDPage_WeighingDevice = 0x8D, /* (Point of Sale) USB Device Class Definition for Weighing Devices */ + kHIDPage_Scale = 0x8D, /* (Point of Sale) USB Device Class Definition for Scale Devices */ + kHIDPage_MagneticStripeReader = 0x8E, + /* ReservedPointofSalepages 0x8F */ + kHIDPage_CameraControl = 0x90, /* USB Device Class Definition for Image Class Devices */ + kHIDPage_Arcade = 0x91, /* OAAF Definitions for arcade and coinop related Devices */ + /* Reserved 0x92 - 0xFEFF */ + /* VendorDefined 0xFF00 - 0xFFFF */ + kHIDPage_VendorDefinedStart = 0xFF00 +}; + +/* Undefined Usage for all usage pages */ +enum +{ + kHIDUsage_Undefined = 0x00 +}; + +/* GenericDesktop Page (0x01) */ +enum +{ + kHIDUsage_GD_Pointer = 0x01, /* Physical Collection */ + kHIDUsage_GD_Mouse = 0x02, /* Application Collection */ + /* 0x03 Reserved */ + kHIDUsage_GD_Joystick = 0x04, /* Application Collection */ + kHIDUsage_GD_GamePad = 0x05, /* Application Collection */ + kHIDUsage_GD_Keyboard = 0x06, /* Application Collection */ + kHIDUsage_GD_Keypad = 0x07, /* Application Collection */ + kHIDUsage_GD_MultiAxisController = 0x08, /* Application Collection */ + kHIDUsage_GD_TabletPCSystemControls = 0x09, /* Application Collection */ + kHIDUsage_GD_AssistiveControl = 0x0A, /* Application Collection */ + kHIDUsage_GD_SpatialController = 0x0F, /* Application Collection */ + kHIDUsage_GD_AssistiveControlCompatible = 0x10, /* Application Collection */ + /* 0x0B - 0x2F Reserved */ + kHIDUsage_GD_X = 0x30, /* Dynamic Value */ + kHIDUsage_GD_Y = 0x31, /* Dynamic Value */ + kHIDUsage_GD_Z = 0x32, /* Dynamic Value */ + kHIDUsage_GD_Rx = 0x33, /* Dynamic Value */ + kHIDUsage_GD_Ry = 0x34, /* Dynamic Value */ + kHIDUsage_GD_Rz = 0x35, /* Dynamic Value */ + kHIDUsage_GD_Slider = 0x36, /* Dynamic Value */ + kHIDUsage_GD_Dial = 0x37, /* Dynamic Value */ + kHIDUsage_GD_Wheel = 0x38, /* Dynamic Value */ + kHIDUsage_GD_Hatswitch = 0x39, /* Dynamic Value */ + kHIDUsage_GD_CountedBuffer = 0x3A, /* Logical Collection */ + kHIDUsage_GD_ByteCount = 0x3B, /* Dynamic Value */ + kHIDUsage_GD_MotionWakeup = 0x3C, /* One-Shot Control */ + kHIDUsage_GD_Start = 0x3D, /* On/Off Control */ + kHIDUsage_GD_Select = 0x3E, /* On/Off Control */ + /* 0x3F Reserved */ + kHIDUsage_GD_Vx = 0x40, /* Dynamic Value */ + kHIDUsage_GD_Vy = 0x41, /* Dynamic Value */ + kHIDUsage_GD_Vz = 0x42, /* Dynamic Value */ + kHIDUsage_GD_Vbrx = 0x43, /* Dynamic Value */ + kHIDUsage_GD_Vbry = 0x44, /* Dynamic Value */ + kHIDUsage_GD_Vbrz = 0x45, /* Dynamic Value */ + kHIDUsage_GD_Vno = 0x46, /* Dynamic Value */ + /* 0x47 - 0x7F Reserved */ + kHIDUsage_GD_SystemControl = 0x80, /* Application Collection */ + kHIDUsage_GD_SystemPowerDown = 0x81, /* One-Shot Control */ + kHIDUsage_GD_SystemSleep = 0x82, /* One-Shot Control */ + kHIDUsage_GD_SystemWakeUp = 0x83, /* One-Shot Control */ + kHIDUsage_GD_SystemContextMenu = 0x84, /* One-Shot Control */ + kHIDUsage_GD_SystemMainMenu = 0x85, /* One-Shot Control */ + kHIDUsage_GD_SystemAppMenu = 0x86, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuHelp = 0x87, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuExit = 0x88, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuSelect = 0x89, /* Selector */ + kHIDUsage_GD_SystemMenu = kHIDUsage_GD_SystemMenuSelect, /* Selector */ + kHIDUsage_GD_SystemMenuRight = 0x8A, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuLeft = 0x8B, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuUp = 0x8C, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuDown = 0x8D, /* Re-Trigger Control */ + /* 0x8E - 0x8F Reserved */ + kHIDUsage_GD_DPadUp = 0x90, /* On/Off Control */ + kHIDUsage_GD_DPadDown = 0x91, /* On/Off Control */ + kHIDUsage_GD_DPadRight = 0x92, /* On/Off Control */ + kHIDUsage_GD_DPadLeft = 0x93, /* On/Off Control */ + kHIDUsage_GD_IndexTrigger = 0x94, /* On/Off Control */ + kHIDUsage_GD_PalmTrigger = 0x95, /* On/Off Control */ + kHIDUsage_GD_Thumbstick = 0x96, /* On/Off Control */ + /* 0x94 - 0xFFFF Reserved */ + kHIDUsage_GD_Reserved = 0xFFFF +}; + +/* Simulation Page (0x02) */ +/* This section provides detailed descriptions of the usages employed by simulation devices. */ +enum +{ + kHIDUsage_Sim_FlightSimulationDevice = 0x01, /* Application Collection */ + kHIDUsage_Sim_AutomobileSimulationDevice = 0x02, /* Application Collection */ + kHIDUsage_Sim_TankSimulationDevice = 0x03, /* Application Collection */ + kHIDUsage_Sim_SpaceshipSimulationDevice = 0x04, /* Application Collection */ + kHIDUsage_Sim_SubmarineSimulationDevice = 0x05, /* Application Collection */ + kHIDUsage_Sim_SailingSimulationDevice = 0x06, /* Application Collection */ + kHIDUsage_Sim_MotorcycleSimulationDevice = 0x07, /* Application Collection */ + kHIDUsage_Sim_SportsSimulationDevice = 0x08, /* Application Collection */ + kHIDUsage_Sim_AirplaneSimulationDevice = 0x09, /* Application Collection */ + kHIDUsage_Sim_HelicopterSimulationDevice = 0x0A, /* Application Collection */ + kHIDUsage_Sim_MagicCarpetSimulationDevice = 0x0B, /* Application Collection */ + kHIDUsage_Sim_BicycleSimulationDevice = 0x0C, /* Application Collection */ + /* 0x0D - 0x1F Reserved */ + kHIDUsage_Sim_FlightControlStick = 0x20, /* Application Collection */ + kHIDUsage_Sim_FlightStick = 0x21, /* Application Collection */ + kHIDUsage_Sim_CyclicControl = 0x22, /* Physical Collection */ + kHIDUsage_Sim_CyclicTrim = 0x23, /* Physical Collection */ + kHIDUsage_Sim_FlightYoke = 0x24, /* Application Collection */ + kHIDUsage_Sim_TrackControl = 0x25, /* Physical Collection */ + /* 0x26 - 0xAF Reserved */ + kHIDUsage_Sim_Aileron = 0xB0, /* Dynamic Value */ + kHIDUsage_Sim_AileronTrim = 0xB1, /* Dynamic Value */ + kHIDUsage_Sim_AntiTorqueControl = 0xB2, /* Dynamic Value */ + kHIDUsage_Sim_AutopilotEnable = 0xB3, /* On/Off Control */ + kHIDUsage_Sim_ChaffRelease = 0xB4, /* One-Shot Control */ + kHIDUsage_Sim_CollectiveControl = 0xB5, /* Dynamic Value */ + kHIDUsage_Sim_DiveBrake = 0xB6, /* Dynamic Value */ + kHIDUsage_Sim_ElectronicCountermeasures = 0xB7, /* On/Off Control */ + kHIDUsage_Sim_Elevator = 0xB8, /* Dynamic Value */ + kHIDUsage_Sim_ElevatorTrim = 0xB9, /* Dynamic Value */ + kHIDUsage_Sim_Rudder = 0xBA, /* Dynamic Value */ + kHIDUsage_Sim_Throttle = 0xBB, /* Dynamic Value */ + kHIDUsage_Sim_FlightCommunications = 0xBC, /* On/Off Control */ + kHIDUsage_Sim_FlareRelease = 0xBD, /* One-Shot Control */ + kHIDUsage_Sim_LandingGear = 0xBE, /* On/Off Control */ + kHIDUsage_Sim_ToeBrake = 0xBF, /* Dynamic Value */ + kHIDUsage_Sim_Trigger = 0xC0, /* Momentary Control */ + kHIDUsage_Sim_WeaponsArm = 0xC1, /* On/Off Control */ + kHIDUsage_Sim_Weapons = 0xC2, /* Selector */ + kHIDUsage_Sim_WingFlaps = 0xC3, /* Dynamic Value */ + kHIDUsage_Sim_Accelerator = 0xC4, /* Dynamic Value */ + kHIDUsage_Sim_Brake = 0xC5, /* Dynamic Value */ + kHIDUsage_Sim_Clutch = 0xC6, /* Dynamic Value */ + kHIDUsage_Sim_Shifter = 0xC7, /* Dynamic Value */ + kHIDUsage_Sim_Steering = 0xC8, /* Dynamic Value */ + kHIDUsage_Sim_TurretDirection = 0xC9, /* Dynamic Value */ + kHIDUsage_Sim_BarrelElevation = 0xCA, /* Dynamic Value */ + kHIDUsage_Sim_DivePlane = 0xCB, /* Dynamic Value */ + kHIDUsage_Sim_Ballast = 0xCC, /* Dynamic Value */ + kHIDUsage_Sim_BicycleCrank = 0xCD, /* Dynamic Value */ + kHIDUsage_Sim_HandleBars = 0xCE, /* Dynamic Value */ + kHIDUsage_Sim_FrontBrake = 0xCF, /* Dynamic Value */ + kHIDUsage_Sim_RearBrake = 0xD0, /* Dynamic Value */ + /* 0xD1 - 0xFFFF Reserved */ + kHIDUsage_Sim_Reserved = 0xFFFF +}; + +/* VR Page (0x03) */ +/* Virtual Reality controls depend on designators to identify the individual controls. Most of the following are */ +/* usages are applied to the collections of entities that comprise the actual device. */ +enum +{ + kHIDUsage_VR_Belt = 0x01, /* Application Collection */ + kHIDUsage_VR_BodySuit = 0x02, /* Application Collection */ + kHIDUsage_VR_Flexor = 0x03, /* Physical Collection */ + kHIDUsage_VR_Glove = 0x04, /* Application Collection */ + kHIDUsage_VR_HeadTracker = 0x05, /* Physical Collection */ + kHIDUsage_VR_HeadMountedDisplay = 0x06, /* Application Collection */ + kHIDUsage_VR_HandTracker = 0x07, /* Application Collection */ + kHIDUsage_VR_Oculometer = 0x08, /* Application Collection */ + kHIDUsage_VR_Vest = 0x09, /* Application Collection */ + kHIDUsage_VR_AnimatronicDevice = 0x0A, /* Application Collection */ + /* 0x0B - 0x1F Reserved */ + kHIDUsage_VR_StereoEnable = 0x20, /* On/Off Control */ + kHIDUsage_VR_DisplayEnable = 0x21, /* On/Off Control */ + /* 0x22 - 0xFFFF Reserved */ + kHIDUsage_VR_Reserved = 0xFFFF +}; + +/* Sport Page (0x04) */ +enum +{ + kHIDUsage_Sprt_BaseballBat = 0x01, /* Application Collection */ + kHIDUsage_Sprt_GolfClub = 0x02, /* Application Collection */ + kHIDUsage_Sprt_RowingMachine = 0x03, /* Application Collection */ + kHIDUsage_Sprt_Treadmill = 0x04, /* Application Collection */ + /* 0x05 - 0x2F Reserved */ + kHIDUsage_Sprt_Oar = 0x30, /* Dynamic Value */ + kHIDUsage_Sprt_Slope = 0x31, /* Dynamic Value */ + kHIDUsage_Sprt_Rate = 0x32, /* Dynamic Value */ + kHIDUsage_Sprt_StickSpeed = 0x33, /* Dynamic Value */ + kHIDUsage_Sprt_StickFaceAngle = 0x34, /* Dynamic Value */ + kHIDUsage_Sprt_StickHeelOrToe = 0x35, /* Dynamic Value */ + kHIDUsage_Sprt_StickFollowThrough = 0x36, /* Dynamic Value */ + kHIDUsage_Sprt_StickTempo = 0x37, /* Dynamic Value */ + kHIDUsage_Sprt_StickType = 0x38, /* Named Array */ + kHIDUsage_Sprt_StickHeight = 0x39, /* Dynamic Value */ + /* 0x3A - 0x4F Reserved */ + kHIDUsage_Sprt_Putter = 0x50, /* Selector */ + kHIDUsage_Sprt_1Iron = 0x51, /* Selector */ + kHIDUsage_Sprt_2Iron = 0x52, /* Selector */ + kHIDUsage_Sprt_3Iron = 0x53, /* Selector */ + kHIDUsage_Sprt_4Iron = 0x54, /* Selector */ + kHIDUsage_Sprt_5Iron = 0x55, /* Selector */ + kHIDUsage_Sprt_6Iron = 0x56, /* Selector */ + kHIDUsage_Sprt_7Iron = 0x57, /* Selector */ + kHIDUsage_Sprt_8Iron = 0x58, /* Selector */ + kHIDUsage_Sprt_9Iron = 0x59, /* Selector */ + kHIDUsage_Sprt_10Iron = 0x5A, /* Selector */ + kHIDUsage_Sprt_11Iron = 0x5B, /* Selector */ + kHIDUsage_Sprt_SandWedge = 0x5C, /* Selector */ + kHIDUsage_Sprt_LoftWedge = 0x5D, /* Selector */ + kHIDUsage_Sprt_PowerWedge = 0x5E, /* Selector */ + kHIDUsage_Sprt_1Wood = 0x5F, /* Selector */ + kHIDUsage_Sprt_3Wood = 0x60, /* Selector */ + kHIDUsage_Sprt_5Wood = 0x61, /* Selector */ + kHIDUsage_Sprt_7Wood = 0x62, /* Selector */ + kHIDUsage_Sprt_9Wood = 0x63, /* Selector */ + /* 0x64 - 0xFFFF Reserved */ + kHIDUsage_Sprt_Reserved = 0xFFFF +}; + +/* Game Page (0x05) */ +enum +{ + kHIDUsage_Game_3DGameController = 0x01, /* Application Collection */ + kHIDUsage_Game_PinballDevice = 0x02, /* Application Collection */ + kHIDUsage_Game_GunDevice = 0x03, /* Application Collection */ + /* 0x04 - 0x1F Reserved */ + kHIDUsage_Game_PointofView = 0x20, /* Physical Collection */ + kHIDUsage_Game_TurnRightOrLeft = 0x21, /* Dynamic Value */ + kHIDUsage_Game_PitchUpOrDown = 0x22, /* Dynamic Value */ + kHIDUsage_Game_RollRightOrLeft = 0x23, /* Dynamic Value */ + kHIDUsage_Game_MoveRightOrLeft = 0x24, /* Dynamic Value */ + kHIDUsage_Game_MoveForwardOrBackward = 0x25, /* Dynamic Value */ + kHIDUsage_Game_MoveUpOrDown = 0x26, /* Dynamic Value */ + kHIDUsage_Game_LeanRightOrLeft = 0x27, /* Dynamic Value */ + kHIDUsage_Game_LeanForwardOrBackward = 0x28, /* Dynamic Value */ + kHIDUsage_Game_HeightOfPOV = 0x29, /* Dynamic Value */ + kHIDUsage_Game_Flipper = 0x2A, /* Momentary Control */ + kHIDUsage_Game_SecondaryFlipper = 0x2B, /* Momentary Control */ + kHIDUsage_Game_Bump = 0x2C, /* Momentary Control */ + kHIDUsage_Game_NewGame = 0x2D, /* One-Shot Control */ + kHIDUsage_Game_ShootBall = 0x2E, /* One-Shot Control */ + kHIDUsage_Game_Player = 0x2F, /* One-Shot Control */ + kHIDUsage_Game_GunBolt = 0x30, /* On/Off Control */ + kHIDUsage_Game_GunClip = 0x31, /* On/Off Control */ + kHIDUsage_Game_Gun = 0x32, /* Selector */ + kHIDUsage_Game_GunSingleShot = 0x33, /* Selector */ + kHIDUsage_Game_GunBurst = 0x34, /* Selector */ + kHIDUsage_Game_GunAutomatic = 0x35, /* Selector */ + kHIDUsage_Game_GunSafety = 0x36, /* On/Off Control */ + kHIDUsage_Game_GamepadFireOrJump = 0x37, /* Logical Collection */ + kHIDUsage_Game_GamepadTrigger = 0x39, /* Logical Collection */ + kHIDUsage_Game_GamepadFormFitting_Compatibility = 0x39, /* Static Flag */ + kHIDUsage_Game_GamepadFormFitting = 0x3A, /* Static Flag */ + /* 0x3A - 0xFFFF Reserved */ + kHIDUsage_Game_Reserved = 0xFFFF +}; + +/* Generic Device Controls (0x0g) */ +enum +{ + kHIDUsage_GenDevControls_BackgroundControls = 0x01, /* Application Collection */ +}; + +/* KeyboardOrKeypad Page (0x07) */ +/* This section is the Usage Page for key codes to be used in implementing a USB keyboard. A Boot Keyboard (84-, 101- or 104-key) should at a minimum support all associated usage codes as indicated in the ÒBootÓ */ +/* column below. */ +/* The usage type of all key codes is Selectors (Sel), except for the modifier keys Keyboard Left Control (0x224) to Keyboard Right GUI (0x231) which are Dynamic Flags (DV). */ +/* Note: A general note on Usages and languages: Due to the variation of keyboards from language to language, it is not feasible to specify exact key mappings for every language. Where this list is not specific for a key function in a language, the closest equivalent key position should be used, so that a keyboard may be modified for a different language by simply printing different keycaps. One example is the Y key on a North American keyboard. In Germany this is typically Z. Rather than changing the keyboard firmware to put the Z Usage into that place in the descriptor list, the vendor should use the Y Usage on both the North American and German keyboards. This continues to be the existing practice in the industry, in order to minimize the number of changes to the electronics to accommodate otherlanguages. */ +enum +{ + kHIDUsage_KeyboardErrorRollOver = 0x01, /* ErrorRollOver */ + kHIDUsage_KeyboardPOSTFail = 0x02, /* POSTFail */ + kHIDUsage_KeyboardErrorUndefined = 0x03, /* ErrorUndefined */ + kHIDUsage_KeyboardA = 0x04, /* a or A */ + kHIDUsage_KeyboardB = 0x05, /* b or B */ + kHIDUsage_KeyboardC = 0x06, /* c or C */ + kHIDUsage_KeyboardD = 0x07, /* d or D */ + kHIDUsage_KeyboardE = 0x08, /* e or E */ + kHIDUsage_KeyboardF = 0x09, /* f or F */ + kHIDUsage_KeyboardG = 0x0A, /* g or G */ + kHIDUsage_KeyboardH = 0x0B, /* h or H */ + kHIDUsage_KeyboardI = 0x0C, /* i or I */ + kHIDUsage_KeyboardJ = 0x0D, /* j or J */ + kHIDUsage_KeyboardK = 0x0E, /* k or K */ + kHIDUsage_KeyboardL = 0x0F, /* l or L */ + kHIDUsage_KeyboardM = 0x10, /* m or M */ + kHIDUsage_KeyboardN = 0x11, /* n or N */ + kHIDUsage_KeyboardO = 0x12, /* o or O */ + kHIDUsage_KeyboardP = 0x13, /* p or P */ + kHIDUsage_KeyboardQ = 0x14, /* q or Q */ + kHIDUsage_KeyboardR = 0x15, /* r or R */ + kHIDUsage_KeyboardS = 0x16, /* s or S */ + kHIDUsage_KeyboardT = 0x17, /* t or T */ + kHIDUsage_KeyboardU = 0x18, /* u or U */ + kHIDUsage_KeyboardV = 0x19, /* v or V */ + kHIDUsage_KeyboardW = 0x1A, /* w or W */ + kHIDUsage_KeyboardX = 0x1B, /* x or X */ + kHIDUsage_KeyboardY = 0x1C, /* y or Y */ + kHIDUsage_KeyboardZ = 0x1D, /* z or Z */ + kHIDUsage_Keyboard1 = 0x1E, /* 1 or ! */ + kHIDUsage_Keyboard2 = 0x1F, /* 2 or @ */ + kHIDUsage_Keyboard3 = 0x20, /* 3 or # */ + kHIDUsage_Keyboard4 = 0x21, /* 4 or $ */ + kHIDUsage_Keyboard5 = 0x22, /* 5 or % */ + kHIDUsage_Keyboard6 = 0x23, /* 6 or ^ */ + kHIDUsage_Keyboard7 = 0x24, /* 7 or & */ + kHIDUsage_Keyboard8 = 0x25, /* 8 or * */ + kHIDUsage_Keyboard9 = 0x26, /* 9 or ( */ + kHIDUsage_Keyboard0 = 0x27, /* 0 or ) */ + kHIDUsage_KeyboardReturnOrEnter = 0x28, /* Return (Enter) */ + kHIDUsage_KeyboardEscape = 0x29, /* Escape */ + kHIDUsage_KeyboardDeleteOrBackspace = 0x2A, /* Delete (Backspace) */ + kHIDUsage_KeyboardTab = 0x2B, /* Tab */ + kHIDUsage_KeyboardSpacebar = 0x2C, /* Spacebar */ + kHIDUsage_KeyboardHyphen = 0x2D, /* - or _ */ + kHIDUsage_KeyboardEqualSign = 0x2E, /* = or + */ + kHIDUsage_KeyboardOpenBracket = 0x2F, /* [ or { */ + kHIDUsage_KeyboardCloseBracket = 0x30, /* ] or } */ + kHIDUsage_KeyboardBackslash = 0x31, /* \ or | */ + kHIDUsage_KeyboardNonUSPound = 0x32, /* Non-US # or _ */ + kHIDUsage_KeyboardSemicolon = 0x33, /* ; or : */ + kHIDUsage_KeyboardQuote = 0x34, /* ' or " */ + kHIDUsage_KeyboardGraveAccentAndTilde = 0x35, /* Grave Accent and Tilde */ + kHIDUsage_KeyboardComma = 0x36, /* , or < */ + kHIDUsage_KeyboardPeriod = 0x37, /* . or > */ + kHIDUsage_KeyboardSlash = 0x38, /* / or ? */ + kHIDUsage_KeyboardCapsLock = 0x39, /* Caps Lock */ + kHIDUsage_KeyboardF1 = 0x3A, /* F1 */ + kHIDUsage_KeyboardF2 = 0x3B, /* F2 */ + kHIDUsage_KeyboardF3 = 0x3C, /* F3 */ + kHIDUsage_KeyboardF4 = 0x3D, /* F4 */ + kHIDUsage_KeyboardF5 = 0x3E, /* F5 */ + kHIDUsage_KeyboardF6 = 0x3F, /* F6 */ + kHIDUsage_KeyboardF7 = 0x40, /* F7 */ + kHIDUsage_KeyboardF8 = 0x41, /* F8 */ + kHIDUsage_KeyboardF9 = 0x42, /* F9 */ + kHIDUsage_KeyboardF10 = 0x43, /* F10 */ + kHIDUsage_KeyboardF11 = 0x44, /* F11 */ + kHIDUsage_KeyboardF12 = 0x45, /* F12 */ + kHIDUsage_KeyboardPrintScreen = 0x46, /* Print Screen */ + kHIDUsage_KeyboardScrollLock = 0x47, /* Scroll Lock */ + kHIDUsage_KeyboardPause = 0x48, /* Pause */ + kHIDUsage_KeyboardInsert = 0x49, /* Insert */ + kHIDUsage_KeyboardHome = 0x4A, /* Home */ + kHIDUsage_KeyboardPageUp = 0x4B, /* Page Up */ + kHIDUsage_KeyboardDeleteForward = 0x4C, /* Delete Forward */ + kHIDUsage_KeyboardEnd = 0x4D, /* End */ + kHIDUsage_KeyboardPageDown = 0x4E, /* Page Down */ + kHIDUsage_KeyboardRightArrow = 0x4F, /* Right Arrow */ + kHIDUsage_KeyboardLeftArrow = 0x50, /* Left Arrow */ + kHIDUsage_KeyboardDownArrow = 0x51, /* Down Arrow */ + kHIDUsage_KeyboardUpArrow = 0x52, /* Up Arrow */ + kHIDUsage_KeypadNumLock = 0x53, /* Keypad NumLock or Clear */ + kHIDUsage_KeypadSlash = 0x54, /* Keypad / */ + kHIDUsage_KeypadAsterisk = 0x55, /* Keypad * */ + kHIDUsage_KeypadHyphen = 0x56, /* Keypad - */ + kHIDUsage_KeypadPlus = 0x57, /* Keypad + */ + kHIDUsage_KeypadEnter = 0x58, /* Keypad Enter */ + kHIDUsage_Keypad1 = 0x59, /* Keypad 1 or End */ + kHIDUsage_Keypad2 = 0x5A, /* Keypad 2 or Down Arrow */ + kHIDUsage_Keypad3 = 0x5B, /* Keypad 3 or Page Down */ + kHIDUsage_Keypad4 = 0x5C, /* Keypad 4 or Left Arrow */ + kHIDUsage_Keypad5 = 0x5D, /* Keypad 5 */ + kHIDUsage_Keypad6 = 0x5E, /* Keypad 6 or Right Arrow */ + kHIDUsage_Keypad7 = 0x5F, /* Keypad 7 or Home */ + kHIDUsage_Keypad8 = 0x60, /* Keypad 8 or Up Arrow */ + kHIDUsage_Keypad9 = 0x61, /* Keypad 9 or Page Up */ + kHIDUsage_Keypad0 = 0x62, /* Keypad 0 or Insert */ + kHIDUsage_KeypadPeriod = 0x63, /* Keypad . or Delete */ + kHIDUsage_KeyboardNonUSBackslash = 0x64, /* Non-US \ or | */ + kHIDUsage_KeyboardApplication = 0x65, /* Application */ + kHIDUsage_KeyboardPower = 0x66, /* Power */ + kHIDUsage_KeypadEqualSign = 0x67, /* Keypad = */ + kHIDUsage_KeyboardF13 = 0x68, /* F13 */ + kHIDUsage_KeyboardF14 = 0x69, /* F14 */ + kHIDUsage_KeyboardF15 = 0x6A, /* F15 */ + kHIDUsage_KeyboardF16 = 0x6B, /* F16 */ + kHIDUsage_KeyboardF17 = 0x6C, /* F17 */ + kHIDUsage_KeyboardF18 = 0x6D, /* F18 */ + kHIDUsage_KeyboardF19 = 0x6E, /* F19 */ + kHIDUsage_KeyboardF20 = 0x6F, /* F20 */ + kHIDUsage_KeyboardF21 = 0x70, /* F21 */ + kHIDUsage_KeyboardF22 = 0x71, /* F22 */ + kHIDUsage_KeyboardF23 = 0x72, /* F23 */ + kHIDUsage_KeyboardF24 = 0x73, /* F24 */ + kHIDUsage_KeyboardExecute = 0x74, /* Execute */ + kHIDUsage_KeyboardHelp = 0x75, /* Help */ + kHIDUsage_KeyboardMenu = 0x76, /* Menu */ + kHIDUsage_KeyboardSelect = 0x77, /* Select */ + kHIDUsage_KeyboardStop = 0x78, /* Stop */ + kHIDUsage_KeyboardAgain = 0x79, /* Again */ + kHIDUsage_KeyboardUndo = 0x7A, /* Undo */ + kHIDUsage_KeyboardCut = 0x7B, /* Cut */ + kHIDUsage_KeyboardCopy = 0x7C, /* Copy */ + kHIDUsage_KeyboardPaste = 0x7D, /* Paste */ + kHIDUsage_KeyboardFind = 0x7E, /* Find */ + kHIDUsage_KeyboardMute = 0x7F, /* Mute */ + kHIDUsage_KeyboardVolumeUp = 0x80, /* Volume Up */ + kHIDUsage_KeyboardVolumeDown = 0x81, /* Volume Down */ + kHIDUsage_KeyboardLockingCapsLock = 0x82, /* Locking Caps Lock */ + kHIDUsage_KeyboardLockingNumLock = 0x83, /* Locking Num Lock */ + kHIDUsage_KeyboardLockingScrollLock = 0x84, /* Locking Scroll Lock */ + kHIDUsage_KeypadComma = 0x85, /* Keypad Comma */ + kHIDUsage_KeypadEqualSignAS400 = 0x86, /* Keypad Equal Sign for AS/400 */ + kHIDUsage_KeyboardInternational1 = 0x87, /* International1 */ + kHIDUsage_KeyboardInternational2 = 0x88, /* International2 */ + kHIDUsage_KeyboardInternational3 = 0x89, /* International3 */ + kHIDUsage_KeyboardInternational4 = 0x8A, /* International4 */ + kHIDUsage_KeyboardInternational5 = 0x8B, /* International5 */ + kHIDUsage_KeyboardInternational6 = 0x8C, /* International6 */ + kHIDUsage_KeyboardInternational7 = 0x8D, /* International7 */ + kHIDUsage_KeyboardInternational8 = 0x8E, /* International8 */ + kHIDUsage_KeyboardInternational9 = 0x8F, /* International9 */ + kHIDUsage_KeyboardLANG1 = 0x90, /* LANG1 */ + kHIDUsage_KeyboardLANG2 = 0x91, /* LANG2 */ + kHIDUsage_KeyboardLANG3 = 0x92, /* LANG3 */ + kHIDUsage_KeyboardLANG4 = 0x93, /* LANG4 */ + kHIDUsage_KeyboardLANG5 = 0x94, /* LANG5 */ + kHIDUsage_KeyboardLANG6 = 0x95, /* LANG6 */ + kHIDUsage_KeyboardLANG7 = 0x96, /* LANG7 */ + kHIDUsage_KeyboardLANG8 = 0x97, /* LANG8 */ + kHIDUsage_KeyboardLANG9 = 0x98, /* LANG9 */ + kHIDUsage_KeyboardAlternateErase = 0x99, /* AlternateErase */ + kHIDUsage_KeyboardSysReqOrAttention = 0x9A, /* SysReq/Attention */ + kHIDUsage_KeyboardCancel = 0x9B, /* Cancel */ + kHIDUsage_KeyboardClear = 0x9C, /* Clear */ + kHIDUsage_KeyboardPrior = 0x9D, /* Prior */ + kHIDUsage_KeyboardReturn = 0x9E, /* Return */ + kHIDUsage_KeyboardSeparator = 0x9F, /* Separator */ + kHIDUsage_KeyboardOut = 0xA0, /* Out */ + kHIDUsage_KeyboardOper = 0xA1, /* Oper */ + kHIDUsage_KeyboardClearOrAgain = 0xA2, /* Clear/Again */ + kHIDUsage_KeyboardCrSelOrProps = 0xA3, /* CrSel/Props */ + kHIDUsage_KeyboardExSel = 0xA4, /* ExSel */ + /* 0xA5-0xDF Reserved */ + kHIDUsage_KeyboardLeftControl = 0xE0, /* Left Control */ + kHIDUsage_KeyboardLeftShift = 0xE1, /* Left Shift */ + kHIDUsage_KeyboardLeftAlt = 0xE2, /* Left Alt */ + kHIDUsage_KeyboardLeftGUI = 0xE3, /* Left GUI */ + kHIDUsage_KeyboardRightControl = 0xE4, /* Right Control */ + kHIDUsage_KeyboardRightShift = 0xE5, /* Right Shift */ + kHIDUsage_KeyboardRightAlt = 0xE6, /* Right Alt */ + kHIDUsage_KeyboardRightGUI = 0xE7, /* Right GUI */ + /* 0xE8-0xFFFF Reserved */ + kHIDUsage_Keyboard_Reserved = 0xFFFF +}; + +/* LEDs Page (0x08) */ +/* An LED or indicator is implemented as an On/Off Control (OOF) using the ÒSingle button toggleÓ mode, where a value of 1 will turn on the indicator, and a value of 0 will turn it off. The exceptions are described below. */ +enum +{ + kHIDUsage_LED_NumLock = 0x01, /* On/Off Control */ + kHIDUsage_LED_CapsLock = 0x02, /* On/Off Control */ + kHIDUsage_LED_ScrollLock = 0x03, /* On/Off Control */ + kHIDUsage_LED_Compose = 0x04, /* On/Off Control */ + kHIDUsage_LED_Kana = 0x05, /* On/Off Control */ + kHIDUsage_LED_Power = 0x06, /* On/Off Control */ + kHIDUsage_LED_Shift = 0x07, /* On/Off Control */ + kHIDUsage_LED_DoNotDisturb = 0x08, /* On/Off Control */ + kHIDUsage_LED_Mute = 0x09, /* On/Off Control */ + kHIDUsage_LED_ToneEnable = 0x0A, /* On/Off Control */ + kHIDUsage_LED_HighCutFilter = 0x0B, /* On/Off Control */ + kHIDUsage_LED_LowCutFilter = 0x0C, /* On/Off Control */ + kHIDUsage_LED_EqualizerEnable = 0x0D, /* On/Off Control */ + kHIDUsage_LED_SoundFieldOn = 0x0E, /* On/Off Control */ + kHIDUsage_LED_SurroundOn = 0x0F, /* On/Off Control */ + kHIDUsage_LED_Repeat = 0x10, /* On/Off Control */ + kHIDUsage_LED_Stereo = 0x11, /* On/Off Control */ + kHIDUsage_LED_SamplingRateDetect = 0x12, /* On/Off Control */ + kHIDUsage_LED_Spinning = 0x13, /* On/Off Control */ + kHIDUsage_LED_CAV = 0x14, /* On/Off Control */ + kHIDUsage_LED_CLV = 0x15, /* On/Off Control */ + kHIDUsage_LED_RecordingFormatDetect = 0x16, /* On/Off Control */ + kHIDUsage_LED_OffHook = 0x17, /* On/Off Control */ + kHIDUsage_LED_Ring = 0x18, /* On/Off Control */ + kHIDUsage_LED_MessageWaiting = 0x19, /* On/Off Control */ + kHIDUsage_LED_DataMode = 0x1A, /* On/Off Control */ + kHIDUsage_LED_BatteryOperation = 0x1B, /* On/Off Control */ + kHIDUsage_LED_BatteryOK = 0x1C, /* On/Off Control */ + kHIDUsage_LED_BatteryLow = 0x1D, /* On/Off Control */ + kHIDUsage_LED_Speaker = 0x1E, /* On/Off Control */ + kHIDUsage_LED_HeadSet = 0x1F, /* On/Off Control */ + kHIDUsage_LED_Hold = 0x20, /* On/Off Control */ + kHIDUsage_LED_Microphone = 0x21, /* On/Off Control */ + kHIDUsage_LED_Coverage = 0x22, /* On/Off Control */ + kHIDUsage_LED_NightMode = 0x23, /* On/Off Control */ + kHIDUsage_LED_SendCalls = 0x24, /* On/Off Control */ + kHIDUsage_LED_CallPickup = 0x25, /* On/Off Control */ + kHIDUsage_LED_Conference = 0x26, /* On/Off Control */ + kHIDUsage_LED_StandBy = 0x27, /* On/Off Control */ + kHIDUsage_LED_CameraOn = 0x28, /* On/Off Control */ + kHIDUsage_LED_CameraOff = 0x29, /* On/Off Control */ + kHIDUsage_LED_OnLine = 0x2A, /* On/Off Control */ + kHIDUsage_LED_OffLine = 0x2B, /* On/Off Control */ + kHIDUsage_LED_Busy = 0x2C, /* On/Off Control */ + kHIDUsage_LED_Ready = 0x2D, /* On/Off Control */ + kHIDUsage_LED_PaperOut = 0x2E, /* On/Off Control */ + kHIDUsage_LED_PaperJam = 0x2F, /* On/Off Control */ + kHIDUsage_LED_Remote = 0x30, /* On/Off Control */ + kHIDUsage_LED_Forward = 0x31, /* On/Off Control */ + kHIDUsage_LED_Reverse = 0x32, /* On/Off Control */ + kHIDUsage_LED_Stop = 0x33, /* On/Off Control */ + kHIDUsage_LED_Rewind = 0x34, /* On/Off Control */ + kHIDUsage_LED_FastForward = 0x35, /* On/Off Control */ + kHIDUsage_LED_Play = 0x36, /* On/Off Control */ + kHIDUsage_LED_Pause = 0x37, /* On/Off Control */ + kHIDUsage_LED_Record = 0x38, /* On/Off Control */ + kHIDUsage_LED_Error = 0x39, /* On/Off Control */ + kHIDUsage_LED_Usage = 0x3A, /* Selector */ + kHIDUsage_LED_UsageInUseIndicator = 0x3B, /* Usage Switch */ + kHIDUsage_LED_UsageMultiModeIndicator = 0x3C, /* Usage Modifier */ + kHIDUsage_LED_IndicatorOn = 0x3D, /* Selector */ + kHIDUsage_LED_IndicatorFlash = 0x3E, /* Selector */ + kHIDUsage_LED_IndicatorSlowBlink = 0x3F, /* Selector */ + kHIDUsage_LED_IndicatorFastBlink = 0x40, /* Selector */ + kHIDUsage_LED_IndicatorOff = 0x41, /* Selector */ + kHIDUsage_LED_FlashOnTime = 0x42, /* Dynamic Value */ + kHIDUsage_LED_SlowBlinkOnTime = 0x43, /* Dynamic Value */ + kHIDUsage_LED_SlowBlinkOffTime = 0x44, /* Dynamic Value */ + kHIDUsage_LED_FastBlinkOnTime = 0x45, /* Dynamic Value */ + kHIDUsage_LED_FastBlinkOffTime = 0x46, /* Dynamic Value */ + kHIDUsage_LED_UsageIndicatorColor = 0x47, /* Usage Modifier */ + kHIDUsage_LED_IndicatorRed = 0x48, /* Selector */ + kHIDUsage_LED_IndicatorGreen = 0x49, /* Selector */ + kHIDUsage_LED_IndicatorAmber = 0x4A, /* Selector */ + kHIDUsage_LED_GenericIndicator = 0x4B, /* On/Off Control */ + kHIDUsage_LED_SystemSuspend = 0x4C, /* On/Off Control */ + kHIDUsage_LED_ExternalPowerConnected = 0x4D, /* On/Off Control */ + kHIDUsage_LED_PlayerIndicator = 0x4E, /* Collection Logical */ + kHIDUsage_LED_Player1 = 0x4F, /* Selector */ + kHIDUsage_LED_Player2 = 0x50, /* Selector */ + kHIDUsage_LED_Player3 = 0x51, /* Selector */ + kHIDUsage_LED_Player4 = 0x52, /* Selector */ + kHIDUsage_LED_Player5 = 0x53, /* Selector */ + kHIDUsage_LED_Player6 = 0x54, /* Selector */ + kHIDUsage_LED_Player7 = 0x55, /* Selector */ + kHIDUsage_LED_Player8 = 0x56, /* Selector */ + /* 0x4E - 0xFFFF Reserved */ + kHIDUsage_LED_Reserved = 0xFFFF +}; + +/* Button Page (0x09) */ +/* The Button page is the first place an application should look for user selection controls. System graphical user interfaces typically employ a pointer and a set of hierarchical selectors to select, move and otherwise manipulate their environment. For these purposes the following assignment of significance can be applied to the Button usages: */ +/* ¥ Button 1, Primary Button. Used for object selecting, dragging, and double click activation. On MacOS, this is the only button. Microsoft operating systems call this a logical left button, because it */ +/* is not necessarily physically located on the left of the pointing device. */ +/* ¥ Button 2, Secondary Button. Used by newer graphical user interfaces to browse object properties. Exposed by systems to applications that typically assign application-specific functionality. */ +/* ¥ Button 3, Tertiary Button. Optional control. Exposed to applications, but seldom assigned functionality due to prevalence of two- and one-button devices. */ +/* ¥ Buttons 4 -55. As the button number increases, its significance as a selector decreases. */ +/* In many ways the assignment of button numbers is similar to the assignment of Effort in Physical descriptors. Button 1 would be used to define the button a finger rests on when the hand is in the Òat restÓ position, that is, virtually no effort is required by the user to activate the button. Button values increment as the finger has to stretch to reach a control. See Section 6.2.3, ÒPhysical Descriptors,Ó in the HID Specification for methods of further qualifying buttons. */ +enum +{ + kHIDUsage_Button_1 = 0x01, /* (primary/trigger) */ + kHIDUsage_Button_2 = 0x02, /* (secondary) */ + kHIDUsage_Button_3 = 0x03, /* (tertiary) */ + kHIDUsage_Button_4 = 0x04, /* 4th button */ + kHIDUsage_Button_5 = 0x05, /* (5th button) */ + kHIDUsage_Button_6 = 0x06, /* (6th button) */ + kHIDUsage_Button_7 = 0x07, /* (7th button) */ + kHIDUsage_Button_8 = 0x08, /* (8th button) */ + kHIDUsage_Button_9 = 0x09, /* (9th button) */ + kHIDUsage_Button_10 = 0x0a, /* (10th button) */ + kHIDUsage_Button_11 = 0x0b, /* (11th button) */ + kHIDUsage_Button_12 = 0x0c, /* (12th button) */ + kHIDUsage_Button_13 = 0x0d, /* (13th button) */ + kHIDUsage_Button_14 = 0x0e, /* (14th button) */ + kHIDUsage_Button_15 = 0x0f, /* (15th button) */ + kHIDUsage_Button_16 = 0x10, /* (16th button) */ + kHIDUsage_Button_17 = 0x11, /* (17th button) */ + kHIDUsage_Button_18 = 0x12, /* (18th button) */ + kHIDUsage_Button_19 = 0x13, /* (19th button) */ + kHIDUsage_Button_20 = 0x14, /* (20th button) */ + kHIDUsage_Button_21 = 0x15, /* (21st button) */ + kHIDUsage_Button_22 = 0x16, /* (22nd button) */ + kHIDUsage_Button_23 = 0x17, /* (23rd button) */ + kHIDUsage_Button_24 = 0x18, /* (24th button) */ + kHIDUsage_Button_25 = 0x19, /* (25th button) */ + kHIDUsage_Button_26 = 0x1a, /* (26th button) */ + kHIDUsage_Button_27 = 0x1b, /* (27th button) */ + kHIDUsage_Button_28 = 0x1c, /* (28th button) */ + kHIDUsage_Button_29 = 0x1d, /* (29th button) */ + kHIDUsage_Button_30 = 0x1e, /* (30th button) */ + kHIDUsage_Button_31 = 0x1f, /* (31st button) */ + kHIDUsage_Button_32 = 0x20, /* (32nd button) */ + kHIDUsage_Button_33 = 0x21, /* (33rd button) */ + kHIDUsage_Button_34 = 0x22, /* (34th button) */ + kHIDUsage_Button_35 = 0x23, /* (35th button) */ + kHIDUsage_Button_36 = 0x24, /* (36th button) */ + kHIDUsage_Button_37 = 0x25, /* (37th button) */ + kHIDUsage_Button_38 = 0x26, /* (38th button) */ + kHIDUsage_Button_39 = 0x27, /* (39th button) */ + kHIDUsage_Button_40 = 0x28, /* (40th button) */ + kHIDUsage_Button_41 = 0x29, /* (41st button) */ + kHIDUsage_Button_42 = 0x2a, /* (42nd button) */ + kHIDUsage_Button_43 = 0x2b, /* (43rd button) */ + kHIDUsage_Button_44 = 0x2c, /* (44th button) */ + kHIDUsage_Button_45 = 0x2d, /* (45th button) */ + kHIDUsage_Button_46 = 0x2e, /* (46th button) */ + kHIDUsage_Button_47 = 0x2f, /* (47th button) */ + kHIDUsage_Button_48 = 0x30, /* (48th button) */ + kHIDUsage_Button_49 = 0x31, /* (49th button) */ + kHIDUsage_Button_50 = 0x32, /* (50th button) */ + kHIDUsage_Button_51 = 0x33, /* (51st button) */ + kHIDUsage_Button_52 = 0x34, /* (52nd button) */ + kHIDUsage_Button_53 = 0x35, /* (53rd button) */ + kHIDUsage_Button_54 = 0x36, /* (54th button) */ + kHIDUsage_Button_55 = 0x37, /* (55th button) */ + kHIDUsage_Button_56 = 0x38, /* (56th button) */ + kHIDUsage_Button_57 = 0x39, /* (57th button) */ + kHIDUsage_Button_58 = 0x3a, /* (58th button) */ + kHIDUsage_Button_59 = 0x3b, /* (59th button) */ + kHIDUsage_Button_60 = 0x3c, /* (60th button) */ + kHIDUsage_Button_61 = 0x3d, /* (61st button) */ + kHIDUsage_Button_62 = 0x3e, /* (62nd button) */ + kHIDUsage_Button_63 = 0x3f, /* (63rd button) */ + kHIDUsage_Button_64 = 0x40, /* (64th button) */ + kHIDUsage_Button_65 = 0x41, /* (65th button) */ + kHIDUsage_Button_66 = 0x42, /* (66th button) */ + kHIDUsage_Button_67 = 0x43, /* (67th button) */ + kHIDUsage_Button_68 = 0x44, /* (68th button) */ + kHIDUsage_Button_69 = 0x45, /* (69th button) */ + kHIDUsage_Button_70 = 0x46, /* (70th button) */ + kHIDUsage_Button_71 = 0x47, /* (71st button) */ + kHIDUsage_Button_72 = 0x48, /* (72nd button) */ + kHIDUsage_Button_73 = 0x49, /* (73rd button) */ + kHIDUsage_Button_74 = 0x4a, /* (74th button) */ + kHIDUsage_Button_75 = 0x4b, /* (75th button) */ + kHIDUsage_Button_76 = 0x4c, /* (76th button) */ + kHIDUsage_Button_77 = 0x4d, /* (77th button) */ + kHIDUsage_Button_78 = 0x4e, /* (78th button) */ + kHIDUsage_Button_79 = 0x4f, /* (79th button) */ + kHIDUsage_Button_80 = 0x50, /* (80th button) */ + kHIDUsage_Button_81 = 0x51, /* (81st button) */ + kHIDUsage_Button_82 = 0x52, /* (82nd button) */ + kHIDUsage_Button_83 = 0x53, /* (83rd button) */ + kHIDUsage_Button_84 = 0x54, /* (84th button) */ + kHIDUsage_Button_85 = 0x55, /* (85th button) */ + kHIDUsage_Button_86 = 0x56, /* (86th button) */ + kHIDUsage_Button_87 = 0x57, /* (87th button) */ + kHIDUsage_Button_88 = 0x58, /* (88th button) */ + kHIDUsage_Button_89 = 0x59, /* (89th button) */ + kHIDUsage_Button_90 = 0x5a, /* (90th button) */ + kHIDUsage_Button_91 = 0x5b, /* (91st button) */ + kHIDUsage_Button_92 = 0x5c, /* (92nd button) */ + kHIDUsage_Button_93 = 0x5d, /* (93rd button) */ + kHIDUsage_Button_94 = 0x5e, /* (94th button) */ + kHIDUsage_Button_95 = 0x5f, /* (95th button) */ + kHIDUsage_Button_96 = 0x60, /* (96th button) */ + kHIDUsage_Button_97 = 0x61, /* (97th button) */ + kHIDUsage_Button_98 = 0x62, /* (98th button) */ + kHIDUsage_Button_99 = 0x63, /* (99th button) */ + kHIDUsage_Button_100 = 0x64, /* (100th button) */ + kHIDUsage_Button_101 = 0x65, /* (101st button) */ + kHIDUsage_Button_102 = 0x66, /* (102nd button) */ + kHIDUsage_Button_103 = 0x67, /* (103rd button) */ + kHIDUsage_Button_104 = 0x68, /* (104th button) */ + kHIDUsage_Button_105 = 0x69, /* (105th button) */ + kHIDUsage_Button_106 = 0x6a, /* (106th button) */ + kHIDUsage_Button_107 = 0x6b, /* (107th button) */ + kHIDUsage_Button_108 = 0x6c, /* (108th button) */ + kHIDUsage_Button_109 = 0x6d, /* (109th button) */ + kHIDUsage_Button_110 = 0x6e, /* (110th button) */ + kHIDUsage_Button_111 = 0x6f, /* (111th button) */ + kHIDUsage_Button_112 = 0x70, /* (112th button) */ + kHIDUsage_Button_113 = 0x71, /* (113th button) */ + kHIDUsage_Button_114 = 0x72, /* (114th button) */ + kHIDUsage_Button_115 = 0x73, /* (115th button) */ + kHIDUsage_Button_116 = 0x74, /* (116th button) */ + kHIDUsage_Button_117 = 0x75, /* (117th button) */ + kHIDUsage_Button_118 = 0x76, /* (118th button) */ + kHIDUsage_Button_119 = 0x77, /* (119th button) */ + kHIDUsage_Button_120 = 0x78, /* (120th button) */ + kHIDUsage_Button_121 = 0x79, /* (121st button) */ + kHIDUsage_Button_122 = 0x7a, /* (122nd button) */ + kHIDUsage_Button_123 = 0x7b, /* (123rd button) */ + kHIDUsage_Button_124 = 0x7c, /* (124th button) */ + kHIDUsage_Button_125 = 0x7d, /* (125th button) */ + kHIDUsage_Button_126 = 0x7e, /* (126th button) */ + kHIDUsage_Button_127 = 0x7f, /* (127th button) */ + kHIDUsage_Button_128 = 0x80, /* (128th button) */ + kHIDUsage_Button_129 = 0x81, /* (129th button) */ + kHIDUsage_Button_130 = 0x82, /* (130th button) */ + kHIDUsage_Button_131 = 0x83, /* (131st button) */ + kHIDUsage_Button_132 = 0x84, /* (132nd button) */ + kHIDUsage_Button_133 = 0x85, /* (133rd button) */ + kHIDUsage_Button_134 = 0x86, /* (134th button) */ + kHIDUsage_Button_135 = 0x87, /* (135th button) */ + kHIDUsage_Button_136 = 0x88, /* (136th button) */ + kHIDUsage_Button_137 = 0x89, /* (137th button) */ + kHIDUsage_Button_138 = 0x8a, /* (138th button) */ + kHIDUsage_Button_139 = 0x8b, /* (139th button) */ + kHIDUsage_Button_140 = 0x8c, /* (140th button) */ + kHIDUsage_Button_141 = 0x8d, /* (141st button) */ + kHIDUsage_Button_142 = 0x8e, /* (142nd button) */ + kHIDUsage_Button_143 = 0x8f, /* (143rd button) */ + kHIDUsage_Button_144 = 0x90, /* (144th button) */ + kHIDUsage_Button_145 = 0x91, /* (145th button) */ + kHIDUsage_Button_146 = 0x92, /* (146th button) */ + kHIDUsage_Button_147 = 0x93, /* (147th button) */ + kHIDUsage_Button_148 = 0x94, /* (148th button) */ + kHIDUsage_Button_149 = 0x95, /* (149th button) */ + kHIDUsage_Button_150 = 0x96, /* (150th button) */ + kHIDUsage_Button_151 = 0x97, /* (151st button) */ + kHIDUsage_Button_152 = 0x98, /* (152nd button) */ + kHIDUsage_Button_153 = 0x99, /* (153rd button) */ + kHIDUsage_Button_154 = 0x9a, /* (154th button) */ + kHIDUsage_Button_155 = 0x9b, /* (155th button) */ + kHIDUsage_Button_156 = 0x9c, /* (156th button) */ + kHIDUsage_Button_157 = 0x9d, /* (157th button) */ + kHIDUsage_Button_158 = 0x9e, /* (158th button) */ + kHIDUsage_Button_159 = 0x9f, /* (159th button) */ + kHIDUsage_Button_160 = 0xa0, /* (160th button) */ + kHIDUsage_Button_161 = 0xa1, /* (161st button) */ + kHIDUsage_Button_162 = 0xa2, /* (162nd button) */ + kHIDUsage_Button_163 = 0xa3, /* (163rd button) */ + kHIDUsage_Button_164 = 0xa4, /* (164th button) */ + kHIDUsage_Button_165 = 0xa5, /* (165th button) */ + kHIDUsage_Button_166 = 0xa6, /* (166th button) */ + kHIDUsage_Button_167 = 0xa7, /* (167th button) */ + kHIDUsage_Button_168 = 0xa8, /* (168th button) */ + kHIDUsage_Button_169 = 0xa9, /* (169th button) */ + kHIDUsage_Button_170 = 0xaa, /* (170th button) */ + kHIDUsage_Button_171 = 0xab, /* (171st button) */ + kHIDUsage_Button_172 = 0xac, /* (172nd button) */ + kHIDUsage_Button_173 = 0xad, /* (173rd button) */ + kHIDUsage_Button_174 = 0xae, /* (174th button) */ + kHIDUsage_Button_175 = 0xaf, /* (175th button) */ + kHIDUsage_Button_176 = 0xb0, /* (176th button) */ + kHIDUsage_Button_177 = 0xb1, /* (177th button) */ + kHIDUsage_Button_178 = 0xb2, /* (178th button) */ + kHIDUsage_Button_179 = 0xb3, /* (179th button) */ + kHIDUsage_Button_180 = 0xb4, /* (180th button) */ + kHIDUsage_Button_181 = 0xb5, /* (181st button) */ + kHIDUsage_Button_182 = 0xb6, /* (182nd button) */ + kHIDUsage_Button_183 = 0xb7, /* (183rd button) */ + kHIDUsage_Button_184 = 0xb8, /* (184th button) */ + kHIDUsage_Button_185 = 0xb9, /* (185th button) */ + kHIDUsage_Button_186 = 0xba, /* (186th button) */ + kHIDUsage_Button_187 = 0xbb, /* (187th button) */ + kHIDUsage_Button_188 = 0xbc, /* (188th button) */ + kHIDUsage_Button_189 = 0xbd, /* (189th button) */ + kHIDUsage_Button_190 = 0xbe, /* (190th button) */ + kHIDUsage_Button_191 = 0xbf, /* (191st button) */ + kHIDUsage_Button_192 = 0xc0, /* (192nd button) */ + kHIDUsage_Button_193 = 0xc1, /* (193rd button) */ + kHIDUsage_Button_194 = 0xc2, /* (194th button) */ + kHIDUsage_Button_195 = 0xc3, /* (195th button) */ + kHIDUsage_Button_196 = 0xc4, /* (196th button) */ + kHIDUsage_Button_197 = 0xc5, /* (197th button) */ + kHIDUsage_Button_198 = 0xc6, /* (198th button) */ + kHIDUsage_Button_199 = 0xc7, /* (199th button) */ + kHIDUsage_Button_200 = 0xc8, /* (200th button) */ + kHIDUsage_Button_201 = 0xc9, /* (201st button) */ + kHIDUsage_Button_202 = 0xca, /* (202nd button) */ + kHIDUsage_Button_203 = 0xcb, /* (203rd button) */ + kHIDUsage_Button_204 = 0xcc, /* (204th button) */ + kHIDUsage_Button_205 = 0xcd, /* (205th button) */ + kHIDUsage_Button_206 = 0xce, /* (206th button) */ + kHIDUsage_Button_207 = 0xcf, /* (207th button) */ + kHIDUsage_Button_208 = 0xd0, /* (208th button) */ + kHIDUsage_Button_209 = 0xd1, /* (209th button) */ + kHIDUsage_Button_210 = 0xd2, /* (210th button) */ + kHIDUsage_Button_211 = 0xd3, /* (211th button) */ + kHIDUsage_Button_212 = 0xd4, /* (212th button) */ + kHIDUsage_Button_213 = 0xd5, /* (213th button) */ + kHIDUsage_Button_214 = 0xd6, /* (214th button) */ + kHIDUsage_Button_215 = 0xd7, /* (215th button) */ + kHIDUsage_Button_216 = 0xd8, /* (216th button) */ + kHIDUsage_Button_217 = 0xd9, /* (217th button) */ + kHIDUsage_Button_218 = 0xda, /* (218th button) */ + kHIDUsage_Button_219 = 0xdb, /* (219th button) */ + kHIDUsage_Button_220 = 0xdc, /* (220th button) */ + kHIDUsage_Button_221 = 0xdd, /* (221st button) */ + kHIDUsage_Button_222 = 0xde, /* (222nd button) */ + kHIDUsage_Button_223 = 0xdf, /* (223rd button) */ + kHIDUsage_Button_224 = 0xe0, /* (224th button) */ + kHIDUsage_Button_225 = 0xe1, /* (225th button) */ + kHIDUsage_Button_226 = 0xe2, /* (226th button) */ + kHIDUsage_Button_227 = 0xe3, /* (227th button) */ + kHIDUsage_Button_228 = 0xe4, /* (228th button) */ + kHIDUsage_Button_229 = 0xe5, /* (229th button) */ + kHIDUsage_Button_230 = 0xe6, /* (230th button) */ + kHIDUsage_Button_231 = 0xe7, /* (231st button) */ + kHIDUsage_Button_232 = 0xe8, /* (232nd button) */ + kHIDUsage_Button_233 = 0xe9, /* (233rd button) */ + kHIDUsage_Button_234 = 0xea, /* (234th button) */ + kHIDUsage_Button_235 = 0xeb, /* (235th button) */ + kHIDUsage_Button_236 = 0xec, /* (236th button) */ + kHIDUsage_Button_237 = 0xed, /* (237th button) */ + kHIDUsage_Button_238 = 0xee, /* (238th button) */ + kHIDUsage_Button_239 = 0xef, /* (239th button) */ + kHIDUsage_Button_240 = 0xf0, /* (240th button) */ + kHIDUsage_Button_241 = 0xf1, /* (241st button) */ + kHIDUsage_Button_242 = 0xf2, /* (242nd button) */ + kHIDUsage_Button_243 = 0xf3, /* (243rd button) */ + kHIDUsage_Button_244 = 0xf4, /* (244th button) */ + kHIDUsage_Button_245 = 0xf5, /* (245th button) */ + kHIDUsage_Button_246 = 0xf6, /* (246th button) */ + kHIDUsage_Button_247 = 0xf7, /* (247th button) */ + kHIDUsage_Button_248 = 0xf8, /* (248th button) */ + kHIDUsage_Button_249 = 0xf9, /* (249th button) */ + kHIDUsage_Button_250 = 0xfa, /* (250th button) */ + kHIDUsage_Button_251 = 0xfb, /* (251st button) */ + kHIDUsage_Button_252 = 0xfc, /* (252nd button) */ + kHIDUsage_Button_253 = 0xfd, /* (253rd button) */ + kHIDUsage_Button_254 = 0xfe, /* (254th button) */ + kHIDUsage_Button_255 = 0xff, /* (255th button) */ + /* ... */ + kHIDUsage_Button_65535 = 0xFFFF +}; + +/* Ordinal Page (0x0A) */ +/* The Ordinal page allows multiple instances of a control or sets of controls to be declared without requiring individual enumeration in the native usage page. For example, it is not necessary to declare usages of Pointer 1, Pointer 2, and so forth on the Generic Desktop page. When parsed, the ordinal instance number is, in essence, concatenated to the usages attached to the encompassing collection to create Pointer 1, Pointer 2, and so forth. */ +/* For an example, see Section A.5, ÒMultiple Instances of a Control,Ó in Appendix A, ÒUsage Examples.Ó By convention, an Ordinal collection is placed inside the collection for which it is declaring multiple instances. */ +/* Instances do not have to be identical. */ +enum +{ + /* 0x00 Reserved */ + kHIDUsage_Ord_Instance1 = 0x01, /* Usage Modifier */ + kHIDUsage_Ord_Instance2 = 0x02, /* Usage Modifier */ + kHIDUsage_Ord_Instance3 = 0x03, /* Usage Modifier */ + kHIDUsage_Ord_Instance4 = 0x04, /* Usage Modifier */ + kHIDUsage_Ord_Instance65535 = 0xFFFF /* Usage Modifier */ +}; + +/* Telephony Page (0x0B) */ +/* This usage page defines the keytop and control usages for telephony devices. */ +/* Indicators on a phone are handled by wrapping them in LED: Usage In Use Indicator and LED: Usage Selected Indicator usages. For example, a message-indicator LED would be identified by a Telephony: Message usage declared as a Feature or Output in a LED: Usage In Use Indicator collection. */ +/* See Section 14, ÒConsumer Page (0x0C),Ó for audio volume and tone controls. */ +enum +{ + kHIDUsage_Tfon_Phone = 0x01, /* Application Collection */ + kHIDUsage_Tfon_AnsweringMachine = 0x02, /* Application Collection */ + kHIDUsage_Tfon_MessageControls = 0x03, /* Logical Collection */ + kHIDUsage_Tfon_Handset = 0x04, /* Logical Collection */ + kHIDUsage_Tfon_Headset = 0x05, /* Logical Collection */ + kHIDUsage_Tfon_TelephonyKeyPad = 0x06, /* Named Array */ + kHIDUsage_Tfon_ProgrammableButton = 0x07, /* Named Array */ + /* 0x08 - 0x1F Reserved */ + kHIDUsage_Tfon_HookSwitch = 0x20, /* On/Off Control */ + kHIDUsage_Tfon_Flash = 0x21, /* Momentary Control */ + kHIDUsage_Tfon_Feature = 0x22, /* One-Shot Control */ + kHIDUsage_Tfon_Hold = 0x23, /* On/Off Control */ + kHIDUsage_Tfon_Redial = 0x24, /* One-Shot Control */ + kHIDUsage_Tfon_Transfer = 0x25, /* One-Shot Control */ + kHIDUsage_Tfon_Drop = 0x26, /* One-Shot Control */ + kHIDUsage_Tfon_Park = 0x27, /* On/Off Control */ + kHIDUsage_Tfon_ForwardCalls = 0x28, /* On/Off Control */ + kHIDUsage_Tfon_AlternateFunction = 0x29, /* Momentary Control */ + kHIDUsage_Tfon_Line = 0x2A, /* One-Shot Control */ + kHIDUsage_Tfon_SpeakerPhone = 0x2B, /* On/Off Control */ + kHIDUsage_Tfon_Conference = 0x2C, /* On/Off Control */ + kHIDUsage_Tfon_RingEnable = 0x2D, /* On/Off Control */ + kHIDUsage_Tfon_Ring = 0x2E, /* Selector */ + kHIDUsage_Tfon_PhoneMute = 0x2F, /* On/Off Control */ + kHIDUsage_Tfon_CallerID = 0x30, /* Momentary Control */ + /* 0x31 - 0x4F Reserved */ + kHIDUsage_Tfon_SpeedDial = 0x50, /* One-Shot Control */ + kHIDUsage_Tfon_StoreNumber = 0x51, /* One-Shot Control */ + kHIDUsage_Tfon_RecallNumber = 0x52, /* One-Shot Control */ + kHIDUsage_Tfon_PhoneDirectory = 0x53, /* On/Off Control */ + /* 0x54 - 0x6F Reserved */ + kHIDUsage_Tfon_VoiceMail = 0x70, /* On/Off Control */ + kHIDUsage_Tfon_ScreenCalls = 0x71, /* On/Off Control */ + kHIDUsage_Tfon_DoNotDisturb = 0x72, /* On/Off Control */ + kHIDUsage_Tfon_Message = 0x73, /* One-Shot Control */ + kHIDUsage_Tfon_AnswerOnOrOff = 0x74, /* On/Off Control */ + /* 0x75 - 0x8F Reserved */ + kHIDUsage_Tfon_InsideDialTone = 0x90, /* Momentary Control */ + kHIDUsage_Tfon_OutsideDialTone = 0x91, /* Momentary Control */ + kHIDUsage_Tfon_InsideRingTone = 0x92, /* Momentary Control */ + kHIDUsage_Tfon_OutsideRingTone = 0x93, /* Momentary Control */ + kHIDUsage_Tfon_PriorityRingTone = 0x94, /* Momentary Control */ + kHIDUsage_Tfon_InsideRingback = 0x95, /* Momentary Control */ + kHIDUsage_Tfon_PriorityRingback = 0x96, /* Momentary Control */ + kHIDUsage_Tfon_LineBusyTone = 0x97, /* Momentary Control */ + kHIDUsage_Tfon_ReorderTone = 0x98, /* Momentary Control */ + kHIDUsage_Tfon_CallWaitingTone = 0x99, /* Momentary Control */ + kHIDUsage_Tfon_ConfirmationTone1 = 0x9A, /* Momentary Control */ + kHIDUsage_Tfon_ConfirmationTone2 = 0x9B, /* Momentary Control */ + kHIDUsage_Tfon_TonesOff = 0x9C, /* On/Off Control */ + kHIDUsage_Tfon_OutsideRingback = 0x9D, /* Momentary Control */ + /* 0x9E - 0xAF Reserved */ + kHIDUsage_Tfon_PhoneKey0 = 0xB0, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey1 = 0xB1, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey2 = 0xB2, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey3 = 0xB3, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey4 = 0xB4, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey5 = 0xB5, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey6 = 0xB6, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey7 = 0xB7, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey8 = 0xB8, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey9 = 0xB9, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyStar = 0xBA, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyPound = 0xBB, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyA = 0xBC, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyB = 0xBD, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyC = 0xBE, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyD = 0xBF, /* Selector/One-Shot Control */ + /* 0xC0 - 0xFFFF Reserved */ + kHIDUsage_TFon_Reserved = 0xFFFF +}; + +/* Consumer Page (0x0C) */ +/* All controls on the Consumer page are application-specific. That is, they affect a specific device, not the system as a whole. */ +enum +{ + kHIDUsage_Csmr_ConsumerControl = 0x01, /* Application Collection */ + kHIDUsage_Csmr_NumericKeyPad = 0x02, /* Named Array */ + kHIDUsage_Csmr_ProgrammableButtons = 0x03, /* Named Array */ + kHIDUsage_Csmr_Microphone = 0x04, /* Application Collection */ + kHIDUsage_Csmr_Headphone = 0x05, /* Application Collection */ + kHIDUsage_Csmr_GraphicEqualizer = 0x06, /* Application Collection */ + /* 0x07 - 0x1F Reserved */ + kHIDUsage_Csmr_Plus10 = 0x20, /* One-Shot Control */ + kHIDUsage_Csmr_Plus100 = 0x21, /* One-Shot Control */ + kHIDUsage_Csmr_AMOrPM = 0x22, /* One-Shot Control */ + /* 0x23 - 0x3F Reserved */ + kHIDUsage_Csmr_Power = 0x30, /* On/Off Control */ + kHIDUsage_Csmr_Reset = 0x31, /* One-Shot Control */ + kHIDUsage_Csmr_Sleep = 0x32, /* One-Shot Control */ + kHIDUsage_Csmr_SleepAfter = 0x33, /* One-Shot Control */ + kHIDUsage_Csmr_SleepMode = 0x34, /* Re-Trigger Control */ + kHIDUsage_Csmr_Illumination = 0x35, /* On/Off Control */ + kHIDUsage_Csmr_FunctionButtons = 0x36, /* Named Array */ + /* 0x37 - 0x3F Reserved */ + kHIDUsage_Csmr_Menu = 0x40, /* On/Off Control */ + kHIDUsage_Csmr_MenuPick = 0x41, /* One-Shot Control */ + kHIDUsage_Csmr_MenuUp = 0x42, /* One-Shot Control */ + kHIDUsage_Csmr_MenuDown = 0x43, /* One-Shot Control */ + kHIDUsage_Csmr_MenuLeft = 0x44, /* One-Shot Control */ + kHIDUsage_Csmr_MenuRight = 0x45, /* One-Shot Control */ + kHIDUsage_Csmr_MenuEscape = 0x46, /* One-Shot Control */ + kHIDUsage_Csmr_MenuValueIncrease = 0x47, /* One-Shot Control */ + kHIDUsage_Csmr_MenuValueDecrease = 0x48, /* One-Shot Control */ + /* 0x49 - 0x5F Reserved */ + kHIDUsage_Csmr_DataOnScreen = 0x60, /* On/Off Control */ + kHIDUsage_Csmr_ClosedCaption = 0x61, /* On/Off Control */ + kHIDUsage_Csmr_ClosedCaptionSelect = 0x62, /* Selector */ + kHIDUsage_Csmr_VCROrTV = 0x63, /* On/Off Control */ + kHIDUsage_Csmr_BroadcastMode = 0x64, /* One-Shot Control */ + kHIDUsage_Csmr_Snapshot = 0x65, /* One-Shot Control */ + kHIDUsage_Csmr_Still = 0x66, /* One-Shot Control */ + kHIDUsage_Csmr_PictureInPictureToggle = 0x67, /* One-Shot Control */ + kHIDUsage_Csmr_PictureInPictureSwap = 0x68, /* One-Shot Control */ + kHIDUsage_Csmr_RedMenuButton = 0x69, /* Momentary Control */ + kHIDUsage_Csmr_GreenMenuButton = 0x6A, /* Momentary Control */ + kHIDUsage_Csmr_BlueMenuButton = 0x6B, /* Momentary Control */ + kHIDUsage_Csmr_YellowMenuButton = 0x6C, /* Momentary Control */ + kHIDUsage_Csmr_Aspect = 0x6D, /* One-shot Control */ + kHIDUsage_Csmr_3DModeSelect = 0x6E, /* One-shot Control */ + kHIDUsage_Csmr_DisplayBrightnessIncrement = 0x6F, /* Re-Trigger Control */ + kHIDUsage_Csmr_DisplayBrightnessDecrement = 0x70, /* Re-Trigger Control */ + kHIDUsage_Csmr_DisplayBrightness = 0x71, /* Logical Collection */ + kHIDUsage_Csmr_DisplayBacklightToggle = 0x72, /* One Shot Control */ + kHIDUsage_Csmr_DisplayBrightnessMinimum = 0x73, /* One Shot Control */ + kHIDUsage_Csmr_DisplayBrightnessMaximum = 0x74, /* One Shot Control */ + kHIDUsage_Csmr_DisplayBrightnessSetAutoBrightness = 0x75, /* On Off Control */ + kHIDUsage_Csmr_KeyboardBrightnessIncrement = 0x79, /* Re-Trigger Control */ + kHIDUsage_Csmr_KeyboardBrightnessDecrement = 0x7A, /* Re-Trigger Control */ + /* 0x7B - 0x7F Reserved */ + kHIDUsage_Csmr_Selection = 0x80, /* Named Array */ + kHIDUsage_Csmr_Assign = 0x81, /* Selector */ + kHIDUsage_Csmr_ModeStep = 0x82, /* One-Shot Control */ + kHIDUsage_Csmr_RecallLast = 0x83, /* One-Shot Control */ + kHIDUsage_Csmr_EnterChannel = 0x84, /* One-Shot Control */ + kHIDUsage_Csmr_OrderMovie = 0x85, /* One-Shot Control */ + kHIDUsage_Csmr_Channel = 0x86, /* Linear Control */ + kHIDUsage_Csmr_MediaSelection = 0x87, /* Selector */ + kHIDUsage_Csmr_MediaSelectComputer = 0x88, /* Selector */ + kHIDUsage_Csmr_MediaSelectTV = 0x89, /* Selector */ + kHIDUsage_Csmr_MediaSelectWWW = 0x8A, /* Selector */ + kHIDUsage_Csmr_MediaSelectDVD = 0x8B, /* Selector */ + kHIDUsage_Csmr_MediaSelectTelephone = 0x8C, /* Selector */ + kHIDUsage_Csmr_MediaSelectProgramGuide = 0x8D, /* Selector */ + kHIDUsage_Csmr_MediaSelectVideoPhone = 0x8E, /* Selector */ + kHIDUsage_Csmr_MediaSelectGames = 0x8F, /* Selector */ + kHIDUsage_Csmr_MediaSelectMessages = 0x90, /* Selector */ + kHIDUsage_Csmr_MediaSelectCD = 0x91, /* Selector */ + kHIDUsage_Csmr_MediaSelectVCR = 0x92, /* Selector */ + kHIDUsage_Csmr_MediaSelectTuner = 0x93, /* Selector */ + kHIDUsage_Csmr_Quit = 0x94, /* One-Shot Control */ + kHIDUsage_Csmr_Help = 0x95, /* On/Off Control */ + kHIDUsage_Csmr_MediaSelectTape = 0x96, /* Selector */ + kHIDUsage_Csmr_MediaSelectCable = 0x97, /* Selector */ + kHIDUsage_Csmr_MediaSelectSatellite = 0x98, /* Selector */ + kHIDUsage_Csmr_MediaSelectSecurity = 0x99, /* Selector */ + kHIDUsage_Csmr_MediaSelectHome = 0x9A, /* Selector */ + kHIDUsage_Csmr_MediaSelectCall = 0x9B, /* Selector */ + kHIDUsage_Csmr_ChannelIncrement = 0x9C, /* One-Shot Control */ + kHIDUsage_Csmr_ChannelDecrement = 0x9D, /* One-Shot Control */ + kHIDUsage_Csmr_Media = 0x9E, /* Selector */ + /* 0x9F Reserved */ + kHIDUsage_Csmr_VCRPlus = 0xA0, /* One-Shot Control */ + kHIDUsage_Csmr_Once = 0xA1, /* One-Shot Control */ + kHIDUsage_Csmr_Daily = 0xA2, /* One-Shot Control */ + kHIDUsage_Csmr_Weekly = 0xA3, /* One-Shot Control */ + kHIDUsage_Csmr_Monthly = 0xA4, /* One-Shot Control */ + /* 0xA5 - 0xAF Reserved */ + kHIDUsage_Csmr_Play = 0xB0, /* On/Off Control */ + kHIDUsage_Csmr_Pause = 0xB1, /* On/Off Control */ + kHIDUsage_Csmr_Record = 0xB2, /* On/Off Control */ + kHIDUsage_Csmr_FastForward = 0xB3, /* On/Off Control */ + kHIDUsage_Csmr_Rewind = 0xB4, /* On/Off Control */ + kHIDUsage_Csmr_ScanNextTrack = 0xB5, /* One-Shot Control */ + kHIDUsage_Csmr_ScanPreviousTrack = 0xB6, /* One-Shot Control */ + kHIDUsage_Csmr_Stop = 0xB7, /* One-Shot Control */ + kHIDUsage_Csmr_Eject = 0xB8, /* One-Shot Control */ + kHIDUsage_Csmr_RandomPlay = 0xB9, /* On/Off Control */ + kHIDUsage_Csmr_SelectDisc = 0xBA, /* Named Array */ + kHIDUsage_Csmr_EnterDisc = 0xBB, /* Momentary Control */ + kHIDUsage_Csmr_Repeat = 0xBC, /* One-Shot Control */ + kHIDUsage_Csmr_Tracking = 0xBD, /* Linear Control */ + kHIDUsage_Csmr_TrackNormal = 0xBE, /* One-Shot Control */ + kHIDUsage_Csmr_SlowTracking = 0xBF, /* Linear Control */ + kHIDUsage_Csmr_FrameForward = 0xC0, /* Re-Trigger Control */ + kHIDUsage_Csmr_FrameBack = 0xC1, /* Re-Trigger Control */ + kHIDUsage_Csmr_Mark = 0xC2, /* One-Shot Control */ + kHIDUsage_Csmr_ClearMark = 0xC3, /* One-Shot Control */ + kHIDUsage_Csmr_RepeatFromMark = 0xC4, /* On/Off Control */ + kHIDUsage_Csmr_ReturnToMark = 0xC5, /* One-Shot Control */ + kHIDUsage_Csmr_SearchMarkForward = 0xC6, /* One-Shot Control */ + kHIDUsage_Csmr_SearchMarkBackwards = 0xC7, /* One-Shot Control */ + kHIDUsage_Csmr_CounterReset = 0xC8, /* One-Shot Control */ + kHIDUsage_Csmr_ShowCounter = 0xC9, /* One-Shot Control */ + kHIDUsage_Csmr_TrackingIncrement = 0xCA, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrackingDecrement = 0xCB, /* Re-Trigger Control */ + kHIDUsage_Csmr_StopOrEject = 0xCC, /* One-Shot Control */ + kHIDUsage_Csmr_PlayOrPause = 0xCD, /* One-Shot Control */ + kHIDUsage_Csmr_PlayOrSkip = 0xCE, /* One-Shot Control */ + kHIDUsage_Csmr_VoiceCommand = 0xCF, /* One-Shot Control */ + /* 0xCF - 0xDF Reserved */ + kHIDUsage_Csmr_Volume = 0xE0, /* Linear Control */ + kHIDUsage_Csmr_Balance = 0xE1, /* Linear Control */ + kHIDUsage_Csmr_Mute = 0xE2, /* On/Off Control */ + kHIDUsage_Csmr_Bass = 0xE3, /* Linear Control */ + kHIDUsage_Csmr_Treble = 0xE4, /* Linear Control */ + kHIDUsage_Csmr_BassBoost = 0xE5, /* On/Off Control */ + kHIDUsage_Csmr_SurroundMode = 0xE6, /* One-Shot Control */ + kHIDUsage_Csmr_Loudness = 0xE7, /* On/Off Control */ + kHIDUsage_Csmr_MPX = 0xE8, /* On/Off Control */ + kHIDUsage_Csmr_VolumeIncrement = 0xE9, /* Re-Trigger Control */ + kHIDUsage_Csmr_VolumeDecrement = 0xEA, /* Re-Trigger Control */ + /* 0xEB - 0xEF Reserved */ + kHIDUsage_Csmr_Speed = 0xF0, /* Selector */ + kHIDUsage_Csmr_PlaybackSpeed = 0xF1, /* Named Array */ + kHIDUsage_Csmr_StandardPlay = 0xF2, /* Selector */ + kHIDUsage_Csmr_LongPlay = 0xF3, /* Selector */ + kHIDUsage_Csmr_ExtendedPlay = 0xF4, /* Selector */ + kHIDUsage_Csmr_Slow = 0xF5, /* One-Shot Control */ + /* 0xF6 - 0xFF Reserved */ + kHIDUsage_Csmr_FanEnable = 0x100, /* On/Off Control */ + kHIDUsage_Csmr_FanSpeed = 0x101, /* Linear Control */ + kHIDUsage_Csmr_LightEnable = 0x102, /* On/Off Control */ + kHIDUsage_Csmr_LightIlluminationLevel = 0x103, /* Linear Control */ + kHIDUsage_Csmr_ClimateControlEnable = 0x104, /* On/Off Control */ + kHIDUsage_Csmr_RoomTemperature = 0x105, /* Linear Control */ + kHIDUsage_Csmr_SecurityEnable = 0x106, /* On/Off Control */ + kHIDUsage_Csmr_FireAlarm = 0x107, /* One-Shot Control */ + kHIDUsage_Csmr_PoliceAlarm = 0x108, /* One-Shot Control */ + kHIDUsage_Csmr_Proximity = 0x109, /* Linear Control */ + kHIDUsage_Csmr_Motion = 0x10A, /* One-Shot Control */ + kHIDUsage_Csmr_DuressAlarm = 0x10B, /* One-Shot Control */ + kHIDUsage_Csmr_HoldupAlarm = 0x10C, /* One-Shot Control */ + kHIDUsage_Csmr_MedicalAlarm = 0x10D, /* One-Shot Control */ + /* 0x10E - 0x14F Reserved */ + kHIDUsage_Csmr_BalanceRight = 0x150, /* Re-Trigger Control */ + kHIDUsage_Csmr_BalanceLeft = 0x151, /* Re-Trigger Control */ + kHIDUsage_Csmr_BassIncrement = 0x152, /* Re-Trigger Control */ + kHIDUsage_Csmr_BassDecrement = 0x153, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrebleIncrement = 0x154, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrebleDecrement = 0x155, /* Re-Trigger Control */ + /* 0x156 - 0x15F Reserved */ + kHIDUsage_Csmr_SpeakerSystem = 0x160, /* Logical Collection */ + kHIDUsage_Csmr_ChannelLeft = 0x161, /* Logical Collection */ + kHIDUsage_Csmr_ChannelRight = 0x162, /* Logical Collection */ + kHIDUsage_Csmr_ChannelCenter = 0x163, /* Logical Collection */ + kHIDUsage_Csmr_ChannelFront = 0x164, /* Logical Collection */ + kHIDUsage_Csmr_ChannelCenterFront = 0x165, /* Logical Collection */ + kHIDUsage_Csmr_ChannelSide = 0x166, /* Logical Collection */ + kHIDUsage_Csmr_ChannelSurround = 0x167, /* Logical Collection */ + kHIDUsage_Csmr_ChannelLowFrequencyEnhancement = 0x168, /* Logical Collection */ + kHIDUsage_Csmr_ChannelTop = 0x169, /* Logical Collection */ + kHIDUsage_Csmr_ChannelUnknown = 0x16A, /* Logical Collection */ + /* 0x16B - 0x16F Reserved */ + kHIDUsage_Csmr_SubChannel = 0x170, /* Linear Control */ + kHIDUsage_Csmr_SubChannelIncrement = 0x171, /* One-Shot Control */ + kHIDUsage_Csmr_SubChannelDecrement = 0x172, /* One-Shot Control */ + kHIDUsage_Csmr_AlternateAudioIncrement = 0x173, /* One-Shot Control */ + kHIDUsage_Csmr_AlternateAudioDecrement = 0x174, /* One-Shot Control */ + /* 0x175 - 0x17F Reserved */ + kHIDUsage_Csmr_ApplicationLaunchButtons = 0x180, /* Named Array */ + kHIDUsage_Csmr_ALLaunchButtonConfigurationTool = 0x181, /* Selector */ + kHIDUsage_Csmr_ALProgrammableButtonConfiguration = 0x182, /* Selector */ + kHIDUsage_Csmr_ALConsumerControlConfiguration = 0x183, /* Selector */ + kHIDUsage_Csmr_ALWordProcessor = 0x184, /* Selector */ + kHIDUsage_Csmr_ALTextEditor = 0x185, /* Selector */ + kHIDUsage_Csmr_ALSpreadsheet = 0x186, /* Selector */ + kHIDUsage_Csmr_ALGraphicsEditor = 0x187, /* Selector */ + kHIDUsage_Csmr_ALPresentationApp = 0x188, /* Selector */ + kHIDUsage_Csmr_ALDatabaseApp = 0x189, /* Selector */ + kHIDUsage_Csmr_ALEmailReader = 0x18A, /* Selector */ + kHIDUsage_Csmr_ALNewsreader = 0x18B, /* Selector */ + kHIDUsage_Csmr_ALVoicemail = 0x18C, /* Selector */ + kHIDUsage_Csmr_ALContactsOrAddressBook = 0x18D, /* Selector */ + kHIDUsage_Csmr_ALCalendarOrSchedule = 0x18E, /* Selector */ + kHIDUsage_Csmr_ALTaskOrProjectManager = 0x18F, /* Selector */ + kHIDUsage_Csmr_ALLogOrJournalOrTimecard = 0x190, /* Selector */ + kHIDUsage_Csmr_ALCheckbookOrFinance = 0x191, /* Selector */ + kHIDUsage_Csmr_ALCalculator = 0x192, /* Selector */ + kHIDUsage_Csmr_ALAOrVCaptureOrPlayback = 0x193, /* Selector */ + kHIDUsage_Csmr_ALLocalMachineBrowser = 0x194, /* Selector */ + kHIDUsage_Csmr_ALLANOrWANBrowser = 0x195, /* Selector */ + kHIDUsage_Csmr_ALInternetBrowser = 0x196, /* Selector */ + kHIDUsage_Csmr_ALRemoteNetworkingOrISPConnect = 0x197, /* Selector */ + kHIDUsage_Csmr_ALNetworkConference = 0x198, /* Selector */ + kHIDUsage_Csmr_ALNetworkChat = 0x199, /* Selector */ + kHIDUsage_Csmr_ALTelephonyOrDialer = 0x19A, /* Selector */ + kHIDUsage_Csmr_ALLogon = 0x19B, /* Selector */ + kHIDUsage_Csmr_ALLogoff = 0x19C, /* Selector */ + kHIDUsage_Csmr_ALLogonOrLogoff = 0x19D, /* Selector */ + kHIDUsage_Csmr_ALTerminalLockOrScreensaver = 0x19E, /* Selector */ + kHIDUsage_Csmr_ALControlPanel = 0x19F, /* Selector */ + kHIDUsage_Csmr_ALCommandLineProcessorOrRun = 0x1A0, /* Selector */ + kHIDUsage_Csmr_ALProcessOrTaskManager = 0x1A1, /* Selector */ + kHIDUsage_Csmr_AL = 0x1A2, /* Selector */ + kHIDUsage_Csmr_ALNextTaskOrApplication = 0x1A3, /* Selector */ + kHIDUsage_Csmr_ALPreviousTaskOrApplication = 0x1A4, /* Selector */ + kHIDUsage_Csmr_ALPreemptiveHaltTaskOrApplication = 0x1A5, /* Selector */ + kHIDUsage_Csmr_ALIntegratedHelpCenter = 0x1A6, /* Selector */ + kHIDUsage_Csmr_ALDocuments = 0x1A7, /* Selector */ + kHIDUsage_Csmr_ALThesaurus = 0x1A8, /* Selector */ + kHIDUsage_Csmr_ALDictionary = 0x1A9, /* Selector */ + kHIDUsage_Csmr_ALDesktop = 0x1AA, /* Selector */ + kHIDUsage_Csmr_ALSpellCheck = 0x1AB, /* Selector */ + kHIDUsage_Csmr_ALGrammerCheck = 0x1AC, /* Selector */ + kHIDUsage_Csmr_ALWirelessStatus = 0x1AD, /* Selector */ + kHIDUsage_Csmr_ALKeyboardLayout = 0x1AE, /* Selector */ + kHIDUsage_Csmr_ALVirusProtection = 0x1AF, /* Selector */ + kHIDUsage_Csmr_ALEncryption = 0x1B0, /* Selector */ + kHIDUsage_Csmr_ALScreenSaver = 0x1B1, /* Selector */ + kHIDUsage_Csmr_ALAlarms = 0x1B2, /* Selector */ + kHIDUsage_Csmr_ALClock = 0x1B3, /* Selector */ + kHIDUsage_Csmr_ALFileBrowser = 0x1B4, /* Selector */ + kHIDUsage_Csmr_ALPowerStatus = 0x1B5, /* Selector */ + kHIDUsage_Csmr_ALImageBrowser = 0x1B6, /* Selector */ + kHIDUsage_Csmr_ALAudioBrowser = 0x1B7, /* Selector */ + kHIDUsage_Csmr_ALMovieBrowser = 0x1B8, /* Selector */ + kHIDUsage_Csmr_ALDigitalRightsManager = 0x1B9, /* Selector */ + kHIDUsage_Csmr_ALDigitalWallet = 0x1BA, /* Selector */ + /* 0x1BB Reserved */ + kHIDUsage_Csmr_ALInstantMessaging = 0x1BC, /* Selector */ + kHIDUsage_Csmr_ALOEMFeatureBrowser = 0x1BD, /* Selector */ + kHIDUsage_Csmr_ALOEMHelp = 0x1BE, /* Selector */ + kHIDUsage_Csmr_ALOnlineCommunity = 0x1BF, /* Selector */ + kHIDUsage_Csmr_ALEntertainmentContentBrowser = 0x1C0, /* Selector */ + kHIDUsage_Csmr_ALOnlineShoppingBrowswer = 0x1C1, /* Selector */ + kHIDUsage_Csmr_ALSmartCardInformationOrHelp = 0x1C2, /* Selector */ + kHIDUsage_Csmr_ALMarketMonitorOrFinanceBrowser = 0x1C3, /* Selector */ + kHIDUsage_Csmr_ALCustomizedCorporateNewsBrowser = 0x1C4, /* Selector */ + kHIDUsage_Csmr_ALOnlineActivityBrowswer= 0x1C5, /* Selector */ + kHIDUsage_Csmr_ALResearchOrSearchBrowswer = 0x1C6, /* Selector */ + kHIDUsage_Csmr_ALAudioPlayer= 0x1C7, /* Selector */ + kHIDUsage_Csmr_ALNavigation = 0x1C8, /* Selector */ + /* 0x1C9 - 0x1FF Reserved */ + kHIDUsage_Csmr_GenericGUIApplicationControls = 0x200, /* Named Array */ + kHIDUsage_Csmr_ACNew = 0x201, /* Selector */ + kHIDUsage_Csmr_ACOpen = 0x202, /* Selector */ + kHIDUsage_Csmr_ACClose = 0x203, /* Selector */ + kHIDUsage_Csmr_ACExit = 0x204, /* Selector */ + kHIDUsage_Csmr_ACMaximize = 0x205, /* Selector */ + kHIDUsage_Csmr_ACMinimize = 0x206, /* Selector */ + kHIDUsage_Csmr_ACSave = 0x207, /* Selector */ + kHIDUsage_Csmr_ACPrint = 0x208, /* Selector */ + kHIDUsage_Csmr_ACProperties = 0x209, /* Selector */ + kHIDUsage_Csmr_ACUndo = 0x21A, /* Selector */ + kHIDUsage_Csmr_ACCopy = 0x21B, /* Selector */ + kHIDUsage_Csmr_ACCut = 0x21C, /* Selector */ + kHIDUsage_Csmr_ACPaste = 0x21D, /* Selector */ + kHIDUsage_Csmr_AC = 0x21E, /* Selector */ + kHIDUsage_Csmr_ACFind = 0x21F, /* Selector */ + kHIDUsage_Csmr_ACFindandReplace = 0x220, /* Selector */ + kHIDUsage_Csmr_ACSearch = 0x221, /* Selector */ + kHIDUsage_Csmr_ACGoTo = 0x222, /* Selector */ + kHIDUsage_Csmr_ACHome = 0x223, /* Selector */ + kHIDUsage_Csmr_ACBack = 0x224, /* Selector */ + kHIDUsage_Csmr_ACForward = 0x225, /* Selector */ + kHIDUsage_Csmr_ACStop = 0x226, /* Selector */ + kHIDUsage_Csmr_ACRefresh = 0x227, /* Selector */ + kHIDUsage_Csmr_ACPreviousLink = 0x228, /* Selector */ + kHIDUsage_Csmr_ACNextLink = 0x229, /* Selector */ + kHIDUsage_Csmr_ACBookmarks = 0x22A, /* Selector */ + kHIDUsage_Csmr_ACHistory = 0x22B, /* Selector */ + kHIDUsage_Csmr_ACSubscriptions = 0x22C, /* Selector */ + kHIDUsage_Csmr_ACZoomIn = 0x22D, /* Selector */ + kHIDUsage_Csmr_ACZoomOut = 0x22E, /* Selector */ + kHIDUsage_Csmr_ACZoom = 0x22F, /* Selector */ + kHIDUsage_Csmr_ACFullScreenView = 0x230, /* Selector */ + kHIDUsage_Csmr_ACNormalView = 0x231, /* Selector */ + kHIDUsage_Csmr_ACViewToggle = 0x232, /* Selector */ + kHIDUsage_Csmr_ACScrollUp = 0x233, /* Selector */ + kHIDUsage_Csmr_ACScrollDown = 0x234, /* Selector */ + kHIDUsage_Csmr_ACScroll = 0x235, /* Selector */ + kHIDUsage_Csmr_ACPanLeft = 0x236, /* Selector */ + kHIDUsage_Csmr_ACPanRight = 0x237, /* Selector */ + kHIDUsage_Csmr_ACPan = 0x238, /* Selector */ + kHIDUsage_Csmr_ACNewWindow = 0x239, /* Selector */ + kHIDUsage_Csmr_ACTileHorizontally = 0x23A, /* Selector */ + kHIDUsage_Csmr_ACTileVertically = 0x23B, /* Selector */ + kHIDUsage_Csmr_ACFormat = 0x23C, /* Selector */ + kHIDUsage_Csmr_ACEdit = 0x23D, /* Selector */ + kHIDUsage_Csmr_ACBold = 0x23E, /* Selector */ + kHIDUsage_Csmr_ACItalics = 0x23F, /* Selector */ + kHIDUsage_Csmr_ACUnderline = 0x240, /* Selector */ + kHIDUsage_Csmr_ACStrikethrough = 0x241, /* Selector */ + kHIDUsage_Csmr_ACSubscript = 0x242, /* Selector */ + kHIDUsage_Csmr_ACSuperscript = 0x243, /* Selector */ + kHIDUsage_Csmr_ACAllCaps = 0x244, /* Selector */ + kHIDUsage_Csmr_ACRotate = 0x245, /* Selector */ + kHIDUsage_Csmr_ACResize = 0x246, /* Selector */ + kHIDUsage_Csmr_ACFlipHorizontal = 0x247, /* Selector */ + kHIDUsage_Csmr_ACFlipVertical = 0x248, /* Selector */ + kHIDUsage_Csmr_ACMirrorHorizontal = 0x249, /* Selector */ + kHIDUsage_Csmr_ACMirrorVertical = 0x24A, /* Selector */ + kHIDUsage_Csmr_ACFontSelect = 0x24B, /* Selector */ + kHIDUsage_Csmr_ACFontColor = 0x24C, /* Selector */ + kHIDUsage_Csmr_ACFontSize = 0x24D, /* Selector */ + kHIDUsage_Csmr_ACJustifyLeft = 0x24E, /* Selector */ + kHIDUsage_Csmr_ACJustifyCenterH = 0x24F, /* Selector */ + kHIDUsage_Csmr_ACJustifyRight = 0x250, /* Selector */ + kHIDUsage_Csmr_ACJustifyBlockH = 0x251, /* Selector */ + kHIDUsage_Csmr_ACJustifyTop = 0x252, /* Selector */ + kHIDUsage_Csmr_ACJustifyCenterV = 0x253, /* Selector */ + kHIDUsage_Csmr_ACJustifyBottom = 0x254, /* Selector */ + kHIDUsage_Csmr_ACJustifyBlockV = 0x255, /* Selector */ + kHIDUsage_Csmr_ACIndentyDecrease = 0x256, /* Selector */ + kHIDUsage_Csmr_ACIndentyIncrease = 0x257, /* Selector */ + kHIDUsage_Csmr_ACNumberedList = 0x258, /* Selector */ + kHIDUsage_Csmr_ACRestartNumbering = 0x259, /* Selector */ + kHIDUsage_Csmr_ACBulletedList = 0x25A, /* Selector */ + kHIDUsage_Csmr_ACPromote = 0x25B, /* Selector */ + kHIDUsage_Csmr_ACDemote = 0x25C, /* Selector */ + kHIDUsage_Csmr_ACYes = 0x25D, /* Selector */ + kHIDUsage_Csmr_ACNo = 0x25E, /* Selector */ + kHIDUsage_Csmr_ACCancel = 0x25F, /* Selector */ + kHIDUsage_Csmr_ACCatalog = 0x260, /* Selector */ + kHIDUsage_Csmr_ACBuyOrCheckout = 0x261, /* Selector */ + kHIDUsage_Csmr_ACAddToCart = 0x262, /* Selector */ + kHIDUsage_Csmr_ACExpand = 0x263, /* Selector */ + kHIDUsage_Csmr_ACExpandAll = 0x264, /* Selector */ + kHIDUsage_Csmr_ACCollapse = 0x265, /* Selector */ + kHIDUsage_Csmr_ACCollapseAll = 0x266, /* Selector */ + kHIDUsage_Csmr_ACPrintPreview = 0x267, /* Selector */ + kHIDUsage_Csmr_ACPasteSpecial = 0x268, /* Selector */ + kHIDUsage_Csmr_ACInsertMode = 0x269, /* Selector */ + kHIDUsage_Csmr_ACDelete = 0x26A, /* Selector */ + kHIDUsage_Csmr_ACLock = 0x26B, /* Selector */ + kHIDUsage_Csmr_ACUnlock = 0x26C, /* Selector */ + kHIDUsage_Csmr_ACProtect = 0x26D, /* Selector */ + kHIDUsage_Csmr_ACUnprotect = 0x26E, /* Selector */ + kHIDUsage_Csmr_ACAttachComment = 0x26F, /* Selector */ + kHIDUsage_Csmr_ACDetachComment = 0x270, /* Selector */ + kHIDUsage_Csmr_ACViewComment = 0x271, /* Selector */ + kHIDUsage_Csmr_ACSelectWord = 0x272, /* Selector */ + kHIDUsage_Csmr_ACSelectSentence = 0x273, /* Selector */ + kHIDUsage_Csmr_ACSelectParagraph = 0x274, /* Selector */ + kHIDUsage_Csmr_ACSelectColumn = 0x275, /* Selector */ + kHIDUsage_Csmr_ACSelectRow = 0x276, /* Selector */ + kHIDUsage_Csmr_ACSelectTable = 0x277, /* Selector */ + kHIDUsage_Csmr_ACSelectObject = 0x278, /* Selector */ + kHIDUsage_Csmr_ACRedoOrRepeat = 0x279, /* Selector */ + kHIDUsage_Csmr_ACSort = 0x27A, /* Selector */ + kHIDUsage_Csmr_ACSortAscending = 0x27B, /* Selector */ + kHIDUsage_Csmr_ACSortDescending = 0x27C, /* Selector */ + kHIDUsage_Csmr_ACFilter = 0x27D, /* Selector */ + kHIDUsage_Csmr_ACSetClock = 0x27E, /* Selector */ + kHIDUsage_Csmr_ACViewClock = 0x27F, /* Selector */ + kHIDUsage_Csmr_ACSelectTimeZone = 0x280, /* Selector */ + kHIDUsage_Csmr_ACEditTimeZones = 0x281, /* Selector */ + kHIDUsage_Csmr_ACSetAlarm = 0x282, /* Selector */ + kHIDUsage_Csmr_ACClearAlarm = 0x283, /* Selector */ + kHIDUsage_Csmr_ACSnoozeAlarm = 0x284, /* Selector */ + kHIDUsage_Csmr_ACResetAlarm = 0x285, /* Selector */ + kHIDUsage_Csmr_ACSynchronize = 0x286, /* Selector */ + kHIDUsage_Csmr_ACSendOrReceive = 0x287, /* Selector */ + kHIDUsage_Csmr_ACSendTo = 0x288, /* Selector */ + kHIDUsage_Csmr_ACReply = 0x289, /* Selector */ + kHIDUsage_Csmr_ACReplyAll = 0x28A, /* Selector */ + kHIDUsage_Csmr_ACForwardMessage = 0x28B, /* Selector */ + kHIDUsage_Csmr_ACSend = 0x28C, /* Selector */ + kHIDUsage_Csmr_ACAttachFile = 0x28D, /* Selector */ + kHIDUsage_Csmr_ACUpload = 0x28E, /* Selector */ + kHIDUsage_Csmr_ACDownload = 0x28F, /* Selector */ + kHIDUsage_Csmr_ACSetBorders = 0x290, /* Selector */ + kHIDUsage_Csmr_ACInsertRow = 0x291, /* Selector */ + kHIDUsage_Csmr_ACInsertColumn = 0x292, /* Selector */ + kHIDUsage_Csmr_ACInsertFile = 0x293, /* Selector */ + kHIDUsage_Csmr_ACInsertPicture = 0x294, /* Selector */ + kHIDUsage_Csmr_ACInsertObject = 0x295, /* Selector */ + kHIDUsage_Csmr_ACInsertSymbol = 0x296, /* Selector */ + kHIDUsage_Csmr_ACSaveAndClose = 0x297, /* Selector */ + kHIDUsage_Csmr_ACRename = 0x298, /* Selector */ + kHIDUsage_Csmr_ACMerge = 0x299, /* Selector */ + kHIDUsage_Csmr_ACSplit = 0x29A, /* Selector */ + kHIDUsage_Csmr_ACDistributeH = 0x29B, /* Selector */ + kHIDUsage_Csmr_ACDistributeV = 0x29C, /* Selector */ + kHIDUsage_Csmr_ACKeyboardLayoutSelect = 0x29D, /* One-Shot Control */ + kHIDUsage_Csmr_ACNavigationGuidance = 0x29E, /* Selector */ + kHIDUsage_Csmr_ACDesktopShowAllWindows = 0x29F, /* Selector */ + kHIDUsage_Csmr_ACDesktopShowAllApplications = 0x2A0, /* Selector */ + /* 0x2A1 - 0xFFFF Reserved */ + kHIDUsage_Csmr_Reserved = 0xFFFF +}; + +/* Digitizer Page (0x0D) */ +/* This section provides detailed descriptions of the usages employed by Digitizer Devices. */ +enum +{ + kHIDUsage_Dig_Digitizer = 0x01, /* Application Collection */ + kHIDUsage_Dig_Pen = 0x02, /* Application Collection */ + kHIDUsage_Dig_LightPen = 0x03, /* Application Collection */ + kHIDUsage_Dig_TouchScreen = 0x04, /* Application Collection */ + kHIDUsage_Dig_TouchPad = 0x05, /* Application Collection */ + kHIDUsage_Dig_WhiteBoard = 0x06, /* Application Collection */ + kHIDUsage_Dig_CoordinateMeasuringMachine = 0x07, /* Application Collection */ + kHIDUsage_Dig_3DDigitizer = 0x08, /* Application Collection */ + kHIDUsage_Dig_StereoPlotter = 0x09, /* Application Collection */ + kHIDUsage_Dig_ArticulatedArm = 0x0A, /* Application Collection */ + kHIDUsage_Dig_Armature = 0x0B, /* Application Collection */ + kHIDUsage_Dig_MultiplePointDigitizer = 0x0C, /* Application Collection */ + kHIDUsage_Dig_FreeSpaceWand = 0x0D, /* Application Collection */ + kHIDUsage_Dig_DeviceConfiguration = 0x0E, /* Application Collection */ + /* 0x0F - 0x1F Reserved */ + kHIDUsage_Dig_Stylus = 0x20, /* Logical Collection */ + kHIDUsage_Dig_Puck = 0x21, /* Logical Collection */ + kHIDUsage_Dig_Finger = 0x22, /* Logical Collection */ + kHIDUsage_Dig_DeviceSettings = 0x23, /* Logical Collection */ + kHIDUsage_Dig_GestureCharacter = 0x24, /* Logical Collection */ + /* 0x25 - 0x2F Reserved */ + kHIDUsage_Dig_TipPressure = 0x30, /* Dynamic Value */ + kHIDUsage_Dig_BarrelPressure = 0x31, /* Dynamic Value */ + kHIDUsage_Dig_InRange = 0x32, /* Momentary Control */ + kHIDUsage_Dig_Touch = 0x33, /* Momentary Control */ + kHIDUsage_Dig_Untouch = 0x34, /* One-Shot Control */ + kHIDUsage_Dig_Tap = 0x35, /* One-Shot Control */ + kHIDUsage_Dig_Quality = 0x36, /* Dynamic Value */ + kHIDUsage_Dig_DataValid = 0x37, /* Momentary Control */ + kHIDUsage_Dig_TransducerIndex = 0x38, /* Dynamic Value */ + kHIDUsage_Dig_TabletFunctionKeys = 0x39, /* Logical Collection */ + kHIDUsage_Dig_ProgramChangeKeys = 0x3A, /* Logical Collection */ + kHIDUsage_Dig_BatteryStrength = 0x3B, /* Dynamic Value */ + kHIDUsage_Dig_Invert = 0x3C, /* Momentary Control */ + kHIDUsage_Dig_XTilt = 0x3D, /* Dynamic Value */ + kHIDUsage_Dig_YTilt = 0x3E, /* Dynamic Value */ + kHIDUsage_Dig_Azimuth = 0x3F, /* Dynamic Value */ + kHIDUsage_Dig_Altitude = 0x40, /* Dynamic Value */ + kHIDUsage_Dig_Twist = 0x41, /* Dynamic Value */ + kHIDUsage_Dig_TipSwitch = 0x42, /* Momentary Control */ + kHIDUsage_Dig_SecondaryTipSwitch = 0x43, /* Momentary Control */ + kHIDUsage_Dig_BarrelSwitch = 0x44, /* Momentary Control */ + kHIDUsage_Dig_Eraser = 0x45, /* Momentary Control */ + kHIDUsage_Dig_TabletPick = 0x46, /* Momentary Control */ + kHIDUsage_Dig_TouchValid = 0x47, /* Momentary Control */ + kHIDUsage_Dig_Width = 0x48, /* Dynamic Value */ + kHIDUsage_Dig_Height = 0x49, /* Dynamic Value */ + /* 0x4A - 0x50 Reserved */ + kHIDUsage_Dig_ContactIdentifier = 0x51, /* Dynamic Value */ + kHIDUsage_Dig_DeviceMode = 0x52, /* Dynamic Value */ + kHIDUsage_Dig_DeviceIdentifier = 0x53, /* Dynamic Value */ + kHIDUsage_Dig_ContactCount = 0x54, /* Dynamic Value */ + kHIDUsage_Dig_ContactCountMaximum = 0x55, /* Static Value */ + kHIDUsage_Dig_RelativeScanTime = 0x56, /* Dynamic Value */ + kHIDUsage_Dig_SurfaceSwitch = 0x57, /* Dynamic Flag */ + + /* 0x56 - 0x5F Reserved */ + kHIDUsage_Dig_GestureCharacterEnable = 0x60, /* Dynamic Flag */ + kHIDUsage_Dig_GestureCharacterQuality = 0x61, /* Dynamic Value */ + kHIDUsage_Dig_GestureCharacterDataLength = 0x62, /* Dynamic Value */ + kHIDUsage_Dig_GestureCharacterData = 0x63, /* Buffered Bytes */ + kHIDUsage_Dig_GestureCharacterEncoding = 0x64, /* Named Array */ + kHIDUsage_Dig_GestureCharacterEncodingUTF8 = 0x65, /* Selector */ + kHIDUsage_Dig_GestureCharacterEncodingUTF16LE = 0x66, /* Selector */ + kHIDUsage_Dig_GestureCharacterEncodingUTF16BE = 0x67, /* Selector */ + kHIDUsage_Dig_GestureCharacterEncodingUTF32LE = 0x68, /* Selector */ + kHIDUsage_Dig_GestureCharacterEncodingUTF32BE = 0x69, /* Selector */ + + kHIDUsage_Dig_ReportRate = 0xA1, /* Dynamic Value */ + + /* 0x70 - 0xFFFF Reserved */ + kHIDUsage_Dig_Reserved = 0xFFFF +}; + +/* Physical Interface Device Page (0x0F) */ +/* This section provides detailed descriptions of the usages employed by Power Devices. */ +enum +{ + kHIDUsage_PID_PhysicalInterfaceDevice = 0x01, /* CA - A collection of PID usages */ + /* 0x02 - 0x1F Reserved */ + kHIDUsage_PID_Normal = 0x20, /* DV - A force applied perpendicular to the surface of an object */ + kHIDUsage_PID_SetEffectReport = 0x21, /* XXX */ + kHIDUsage_PID_EffectBlockIndex = 0x22, /* XXX */ + kHIDUsage_PID_ParamBlockOffset = 0x23, /* XXX */ + kHIDUsage_PID_ROM_Flag = 0x24, /* XXX */ + kHIDUsage_PID_EffectType = 0x25, /* XXX */ + kHIDUsage_PID_ET_ConstantForce = 0x26, /* XXX */ + kHIDUsage_PID_ET_Ramp = 0x27, /* XXX */ + kHIDUsage_PID_ET_CustomForceData = 0x28, /* XXX */ + /* 0x29 - 0x2F Reserved */ + kHIDUsage_PID_ET_Square = 0x30, /* XXX */ + kHIDUsage_PID_ET_Sine = 0x31, /* XXX */ + kHIDUsage_PID_ET_Triangle = 0x32, /* XXX */ + kHIDUsage_PID_ET_SawtoothUp = 0x33, /* XXX */ + kHIDUsage_PID_ET_SawtoothDown = 0x34, /* XXX */ + /* 0x35 - 0x3F Reserved */ + kHIDUsage_PID_ET_Spring = 0x40, /* XXX */ + kHIDUsage_PID_ET_Damper = 0x41, /* XXX */ + kHIDUsage_PID_ET_Inertia = 0x42, /* XXX */ + kHIDUsage_PID_ET_Friction = 0x43, /* XXX */ + /* 0x44 - 0x4F Reserved */ + kHIDUsage_PID_Duration = 0x50, /* XXX */ + kHIDUsage_PID_SamplePeriod = 0x51, /* XXX */ + kHIDUsage_PID_Gain = 0x52, /* XXX */ + kHIDUsage_PID_TriggerButton = 0x53, /* XXX */ + kHIDUsage_PID_TriggerRepeatInterval = 0x54, /* XXX */ + kHIDUsage_PID_AxesEnable = 0x55, /* XXX */ + kHIDUsage_PID_DirectionEnable = 0x56, /* XXX */ + kHIDUsage_PID_Direction = 0x57, /* XXX */ + kHIDUsage_PID_TypeSpecificBlockOffset = 0x58, /* XXX */ + kHIDUsage_PID_BlockType = 0x59, /* XXX */ + kHIDUsage_PID_SetEnvelopeReport = 0x5A, /* XXX */ + kHIDUsage_PID_AttackLevel = 0x5B, /* XXX */ + kHIDUsage_PID_AttackTime = 0x5C, /* XXX */ + kHIDUsage_PID_FadeLevel = 0x5D, /* XXX */ + kHIDUsage_PID_FadeTime = 0x5E, /* XXX */ + kHIDUsage_PID_SetConditionReport = 0x5F, /* XXX */ + + kHIDUsage_PID_CP_Offset = 0x60, /* XXX */ + kHIDUsage_PID_PositiveCoefficient = 0x61, /* XXX */ + kHIDUsage_PID_NegativeCoefficient = 0x62, /* XXX */ + kHIDUsage_PID_PositiveSaturation = 0x63, /* XXX */ + kHIDUsage_PID_NegativeSaturation = 0x64, /* XXX */ + kHIDUsage_PID_DeadBand = 0x65, /* XXX */ + kHIDUsage_PID_DownloadForceSample = 0x66, /* XXX */ + kHIDUsage_PID_IsochCustomForceEnable = 0x67, /* XXX */ + kHIDUsage_PID_CustomForceDataReport = 0x68, /* XXX */ + kHIDUsage_PID_CustomForceData = 0x69, /* XXX */ + kHIDUsage_PID_CustomForceVendorDefinedData = 0x6A, /* XXX */ + kHIDUsage_PID_SetCustomForceReport = 0x6B, /* XXX */ + kHIDUsage_PID_CustomForceDataOffset = 0x6C, /* XXX */ + kHIDUsage_PID_SampleCount = 0x6D, /* XXX */ + kHIDUsage_PID_SetPeriodicReport = 0x6E, /* XXX */ + kHIDUsage_PID_Offset = 0x6F, /* XXX */ + + kHIDUsage_PID_Magnitude = 0x70, /* XXX */ + kHIDUsage_PID_Phase = 0x71, /* XXX */ + kHIDUsage_PID_Period = 0x72, /* XXX */ + kHIDUsage_PID_SetConstantForceReport = 0x73, /* XXX */ + kHIDUsage_PID_SetRampForceReport = 0x74, /* XXX */ + kHIDUsage_PID_RampStart = 0x75, /* XXX */ + kHIDUsage_PID_RampEnd = 0x76, /* XXX */ + kHIDUsage_PID_EffectOperationReport = 0x77, /* XXX */ + kHIDUsage_PID_EffectOperation = 0x78, /* XXX */ + kHIDUsage_PID_OpEffectStart = 0x79, /* XXX */ + kHIDUsage_PID_OpEffectStartSolo = 0x7A, /* XXX */ + kHIDUsage_PID_OpEffectStop = 0x7B, /* XXX */ + kHIDUsage_PID_LoopCount = 0x7C, /* XXX */ + kHIDUsage_PID_DeviceGainReport = 0x7D, /* XXX */ + kHIDUsage_PID_DeviceGain = 0x7E, /* XXX */ + kHIDUsage_PID_PoolReport = 0x7F, /* XXX */ + + kHIDUsage_PID_RAM_PoolSize = 0x80, /* XXX */ + kHIDUsage_PID_ROM_PoolSize = 0x81, /* XXX */ + kHIDUsage_PID_ROM_EffectBlockCount = 0x82, /* XXX */ + kHIDUsage_PID_SimultaneousEffectsMax = 0x83, /* XXX */ + kHIDUsage_PID_PoolAlignment = 0x84, /* XXX */ + kHIDUsage_PID_PoolMoveReport = 0x85, /* XXX */ + kHIDUsage_PID_MoveSource = 0x86, /* XXX */ + kHIDUsage_PID_MoveDestination = 0x87, /* XXX */ + kHIDUsage_PID_MoveLength = 0x88, /* XXX */ + kHIDUsage_PID_BlockLoadReport = 0x89, /* XXX */ + /* 0x8A Reserved */ + kHIDUsage_PID_BlockLoadStatus = 0x8B, /* XXX */ + kHIDUsage_PID_BlockLoadSuccess = 0x8C, /* XXX */ + kHIDUsage_PID_BlockLoadFull = 0x8D, /* XXX */ + kHIDUsage_PID_BlockLoadError = 0x8E, /* XXX */ + kHIDUsage_PID_BlockHandle = 0x8F, /* XXX */ + + kHIDUsage_PID_BlockFreeReport = 0x90, /* XXX */ + kHIDUsage_PID_TypeSpecificBlockHandle = 0x91, /* XXX */ + kHIDUsage_PID_StateReport = 0x92, /* XXX */ + /* 0x93 Reserved */ + kHIDUsage_PID_EffectPlaying = 0x94, /* XXX */ + kHIDUsage_PID_DeviceControlReport = 0x95, /* XXX */ + kHIDUsage_PID_DeviceControl = 0x96, /* XXX */ + kHIDUsage_PID_DC_EnableActuators = 0x97, /* XXX */ + kHIDUsage_PID_DC_DisableActuators = 0x98, /* XXX */ + kHIDUsage_PID_DC_StopAllEffects = 0x99, /* XXX */ + kHIDUsage_PID_DC_DeviceReset = 0x9A, /* XXX */ + kHIDUsage_PID_DC_DevicePause = 0x9B, /* XXX */ + kHIDUsage_PID_DC_DeviceContinue = 0x9C, /* XXX */ + /* 0x9d - 0x9E Reserved */ + kHIDUsage_PID_DevicePaused = 0x9F, /* XXX */ + + kHIDUsage_PID_ActuatorsEnabled = 0xA0, /* XXX */ + /* 0xA1 - 0xA3 Reserved */ + kHIDUsage_PID_SafetySwitch = 0xA4, /* XXX */ + kHIDUsage_PID_ActuatorOverrideSwitch = 0xA5, /* XXX */ + kHIDUsage_PID_ActuatorPower = 0xA6, /* XXX */ + kHIDUsage_PID_StartDelay = 0xA7, /* XXX */ + kHIDUsage_PID_ParameterBlockSize = 0xA8, /* XXX */ + kHIDUsage_PID_DeviceManagedPool = 0xA9, /* XXX */ + kHIDUsage_PID_SharedParameterBlocks = 0xAA, /* XXX */ + kHIDUsage_PID_CreateNewEffectReport = 0xAB, /* XXX */ + kHIDUsage_PID_RAM_PoolAvailable = 0xAC, /* XXX */ + /* 0xAD - 0xFFFF Reserved */ + kHIDUsage_PID_Reserved = 0xFFFF +}; + +/* AlphanumericDisplay Page (0x14) */ +/* The Alphanumeric Display page is intended for use by simple alphanumeric displays that are used on consumer devices. */ +enum +{ + kHIDUsage_AD_AlphanumericDisplay = 0x01, /* Application Collection */ + /* 0x02 - 0x1F Reserved */ + kHIDUsage_AD_DisplayAttributesReport = 0x20, /* Logical Collection */ + kHIDUsage_AD_ASCIICharacterSet = 0x21, /* Static Flag */ + kHIDUsage_AD_DataReadBack = 0x22, /* Static Flag */ + kHIDUsage_AD_FontReadBack = 0x23, /* Static Flag */ + kHIDUsage_AD_DisplayControlReport = 0x24, /* Logical Collection */ + kHIDUsage_AD_ClearDisplay = 0x25, /* Dynamic Flag */ + kHIDUsage_AD_DisplayEnable = 0x26, /* Dynamic Flag */ + kHIDUsage_AD_ScreenSaverDelay = 0x27, /* Static Value */ + kHIDUsage_AD_ScreenSaverEnable = 0x28, /* Dynamic Flag */ + kHIDUsage_AD_VerticalScroll = 0x29, /* Static Flag */ + kHIDUsage_AD_HorizontalScroll = 0x2A, /* Static Flag */ + kHIDUsage_AD_CharacterReport = 0x2B, /* Logical Collection */ + kHIDUsage_AD_DisplayData = 0x2C, /* Dynamic Value */ + kHIDUsage_AD_DisplayStatus = 0x2D, /* Logical Collection */ + kHIDUsage_AD_StatNotReady = 0x2E, /* Selector */ + kHIDUsage_AD_StatReady = 0x2F, /* Selector */ + kHIDUsage_AD_ErrNotaloadablecharacter = 0x30, /* Selector */ + kHIDUsage_AD_ErrFontdatacannotberead = 0x31, /* Selector */ + kHIDUsage_AD_CursorPositionReport = 0x32, /* Logical Collection */ + kHIDUsage_AD_Row = 0x33, /* Dynamic Value */ + kHIDUsage_AD_Column = 0x34, /* Dynamic Value */ + kHIDUsage_AD_Rows = 0x35, /* Static Value */ + kHIDUsage_AD_Columns = 0x36, /* Static Value */ + kHIDUsage_AD_CursorPixelPositioning = 0x37, /* Static Flag */ + kHIDUsage_AD_CursorMode = 0x38, /* Dynamic Flag */ + kHIDUsage_AD_CursorEnable = 0x39, /* Dynamic Flag */ + kHIDUsage_AD_CursorBlink = 0x3A, /* Dynamic Flag */ + kHIDUsage_AD_FontReport = 0x3B, /* Logical Collection */ + kHIDUsage_AD_FontData = 0x3C, /* Buffered Byte */ + kHIDUsage_AD_CharacterWidth = 0x3D, /* Static Value */ + kHIDUsage_AD_CharacterHeight = 0x3E, /* Static Value */ + kHIDUsage_AD_CharacterSpacingHorizontal = 0x3F, /* Static Value */ + kHIDUsage_AD_CharacterSpacingVertical = 0x40, /* Static Value */ + kHIDUsage_AD_UnicodeCharacterSet = 0x41, /* Static Flag */ + /* 0x42 - 0xFFFF Reserved */ + kHIDUsage_AD_Reserved = 0xFFFF +}; + +/* Sensor Page (0x20) */ +/* The Sensor page is intended for use by devices that capture biometric, electrical, environmental, light, location, mechanical, motion, orientation, scanner, etc events. */ +enum +{ + kHIDUsage_Snsr_Undefined = 0x00, + kHIDUsage_Snsr_Sensor = 0x01, /* Application/Physical Collection */ + /* 0x02 - 0x0F Reserved */ + kHIDUsage_Snsr_Biometric = 0x10, /* Application/Physical Collection */ + kHIDUsage_Snsr_Biometric_HumanPresence = 0x11, /* Application/Physical Collection */ + kHIDUsage_Snsr_Biometric_HumanProximity = 0x12, /* Application/Physical Collection */ + kHIDUsage_Snsr_Biometric_HumanTouch = 0x13, /* Application/Physical Collection */ + /* 0x14 - 0x1F Reserved */ + kHIDUsage_Snsr_Electrical = 0x20, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Capacitance = 0x21, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Current = 0x22, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Power = 0x23, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Inductance = 0x24, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Resistance = 0x25, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Voltage = 0x26, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Potentiometer = 0x27, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Frequency = 0x28, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Period = 0x29, /* Application/Physical Collection */ + /* 0x2A - 0x2F Reserved */ + kHIDUsage_Snsr_Environmental = 0x30, /* Application/Physical Collection */ + kHIDUsage_Snsr_Environmental_AtmosphericPressure = 0x31, /* Application/Physical Collection */ + kHIDUsage_Snsr_Environmental_Humidity = 0x32, /* Application/Physical Collection */ + kHIDUsage_Snsr_Environmental_Temperature = 0x33, /* Application/Physical Collection */ + kHIDUsage_Snsr_Environmental_WindDirection = 0x34, /* Application/Physical Collection */ + kHIDUsage_Snsr_Environmental_WindSpeed = 0x35, /* Application/Physical Collection */ + /* 0x36 - 0x3F Reserved */ + kHIDUsage_Snsr_Light = 0x40, /* Application/Physical Collection */ + kHIDUsage_Snsr_Light_AmbientLight = 0x41, /* Application/Physical Collection */ + kHIDUsage_Snsr_Light_ConsumerInfrared = 0x42, /* Application/Physical Collection */ + /* 0x43 - 0x4F Reserved */ + kHIDUsage_Snsr_Location = 0x50, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_Broadcast = 0x51, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_DeadReckoning = 0x52, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_GPS = 0x53, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_Lookup = 0x54, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_Other = 0x55, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_Static = 0x56, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_Triangulation = 0x57, /* Application/Physical Collection */ + /* 0x58 - 0x5F Reserved */ + kHIDUsage_Snsr_Mechanical = 0x60, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_BooleanSwitch = 0x61, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_BooleanSwitchArray = 0x62, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_MultivalueSwitch = 0x63, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_Force = 0x64, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_Pressure = 0x65, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_Strain = 0x66, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_Weight = 0x67, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_HapticVibrator = 0x68, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_HallEffectSwitch = 0x69, /* Application/Physical Collection */ + /* 0x6A - 0x6F Reserved */ + kHIDUsage_Snsr_Motion = 0x70, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Accelerometer1D = 0x71, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Accelerometer2D = 0x72, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Accelerometer3D = 0x73, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Gyrometer1D = 0x74, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Gyrometer2D = 0x75, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Gyrometer3D = 0x76, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_MotionDetector = 0x77, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Speedometer = 0x78, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Accelerometer = 0x79, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Gyrometer = 0x7A, /* Application/Physical Collection */ + /* 0x7B - 0x7F Reserved */ + kHIDUsage_Snsr_Orientation = 0x80, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Compass1D = 0x81, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Compass2D = 0x82, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Compass3D = 0x83, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Inclinometer1D = 0x84, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Inclinometer2D = 0x85, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Inclinometer3D = 0x86, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Distance1D = 0x87, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Distance2D = 0x88, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Distance3D = 0x89, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_DeviceOrientation = 0x8A, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_CompassD = 0x8B, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_InclinometerD = 0x8C, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_DistanceD = 0x8D, /* Application/Physical Collection */ + /* 0x8E - 0x8F Reserved */ + kHIDUsage_Snsr_Scanner = 0x90, /* Application/Physical Collection */ + kHIDUsage_Snsr_Scanner_Barcode = 0x91, /* Application/Physical Collection */ + kHIDUsage_Snsr_Scanner_RFID = 0x92, /* Application/Physical Collection */ + kHIDUsage_Snsr_Scanner_NFC = 0x93, /* Application/Physical Collection */ + /* 0x94 - 0x9F Reserved */ + kHIDUsage_Snsr_Time = 0xA0, /* Application/Physical Collection */ + kHIDUsage_Snsr_Time_AlarmTimer = 0xA1, /* Application/Physical Collection */ + kHIDUsage_Snsr_Time_RealTimeClock = 0xA2, /* Application/Physical Collection */ + /* 0xA3 - 0xDF Reserved */ + kHIDUsage_Snsr_Other = 0xE0, /* Application/Physical Collection */ + kHIDUsage_Snsr_Other_Custom = 0xE1, /* Application/Physical Collection */ + kHIDUsage_Snsr_Other_Generic = 0xE2, /* Application/Physical Collection */ + kHIDUsage_Snsr_Other_GenericEnumerator = 0xE3, /* Application/Physical Collection */ + /* 0xE4 - 0xEF Reserved */ + /* 0xF0 - 0xFF Vendor Reserved */ + + /* Common Sensor Type Data Fields */ + + /* Usage Switches used in conjunction with other Data Usages. The value of the modifier is OR-ed in to the upper nibble of the 16bit Data Usage. */ + kHIDUsage_Snsr_Modifier_None = 0x0, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_ChangeSensitivityAbsolute = 0x1, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_Max = 0x2, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_Min = 0x3, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_Accuracy = 0x4, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_Resolution = 0x5, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_ThresholdHigh = 0x6, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_ThresholdLow = 0x7, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_CalibrationOffset = 0x8, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_CalibrationMultiplier = 0x9, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_ReportInterval = 0xA, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_FrequencyMax = 0xB, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_PeriodMax = 0xC, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_ChangeSensitivityPercentRange = 0xD, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_ChangeSensitivityPercentRelative = 0xE, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_VendorDefined = 0xF, /* Data Field Usage Switch */ + + /* Event Usages */ + kHIDUsage_Snsr_Event = 0x0200, + kHIDUsage_Snsr_Event_SensorState = 0x0201, + kHIDUsage_Snsr_Event_SensorEvent = 0x0202, + /* 0x0203 - 0x02FF Event Reserved */ + + kHIDUsage_Snsr_Event_SensorState_Undefined = 0x0800, + kHIDUsage_Snsr_Event_SensorState_Ready = 0x0801, + kHIDUsage_Snsr_Event_SensorState_NotAvailable = 0x0802, + kHIDUsage_Snsr_Event_SensorState_NoData = 0x0803, + kHIDUsage_Snsr_Event_SensorState_Initializing = 0x0804, + kHIDUsage_Snsr_Event_SensorState_AccessDenied = 0x0805, + kHIDUsage_Snsr_Event_SensorState_Error = 0x0806, + /* 0x0807 - 0x080F Reserved */ + + kHIDUsage_Snsr_Event_SensorEvent_Unknown = 0x0810, + kHIDUsage_Snsr_Event_SensorEvent_StateChanged = 0x0811, + kHIDUsage_Snsr_Event_SensorEvent_PropertyChanged = 0x0812, + kHIDUsage_Snsr_Event_SensorEvent_DataUpdated = 0x0813, + kHIDUsage_Snsr_Event_SensorEvent_PollResponse = 0x0814, + kHIDUsage_Snsr_Event_SensorEvent_ChangeSensitivity = 0x0815, + kHIDUsage_Snsr_Event_SensorEvent_RangeMaxReached = 0x0816, + kHIDUsage_Snsr_Event_SensorEvent_RangeMinReached = 0x0817, + kHIDUsage_Snsr_Event_SensorEvent_HighThresholdCrossUp = 0x0818, + kHIDUsage_Snsr_Event_SensorEvent_HighThresholdCrossDown = 0x0819, + kHIDUsage_Snsr_Event_SensorEvent_LowThresholdCrossUp = 0x081A, + kHIDUsage_Snsr_Event_SensorEvent_LowThresholdCrossDown = 0x081B, + kHIDUsage_Snsr_Event_SensorEvent_ZeroThresholdCrossUp = 0x081C, + kHIDUsage_Snsr_Event_SensorEvent_ZeroThresholdCrossDown = 0x081D, + kHIDUsage_Snsr_Event_SensorEvent_PeriodExceeded = 0x081E, + kHIDUsage_Snsr_Event_SensorEvent_FrequencyExceeded = 0x081F, + kHIDUsage_Snsr_Event_SensorEvent_ComplexTrigger = 0x0820, + /* 0x0821 - 0x082F Reserved */ + + /* Property Usages */ + kHIDUsage_Snsr_Property = 0x0300, + kHIDUsage_Snsr_Property_FriendlyName = 0x0301, + kHIDUsage_Snsr_Property_PersistentUniqueID = 0x0302, + kHIDUsage_Snsr_Property_SensorStatus = 0x0303, + kHIDUsage_Snsr_Property_MinimumReportInterval = 0x0304, + kHIDUsage_Snsr_Property_Manufacturer = 0x0305, + kHIDUsage_Snsr_Property_Model = 0x0306, + kHIDUsage_Snsr_Property_SerialNumber = 0x0307, + kHIDUsage_Snsr_Property_Description = 0x0308, + kHIDUsage_Snsr_Property_ConnectionType = 0x0309, + kHIDUsage_Snsr_Property_DevicePath = 0x030A, + kHIDUsage_Snsr_Property_HardwareRevision = 0x030B, + kHIDUsage_Snsr_Property_FirmwareVersion = 0x030C, + kHIDUsage_Snsr_Property_ReleaseData = 0x030D, + kHIDUsage_Snsr_Property_ReportInterval = 0x030E, + kHIDUsage_Snsr_Property_ChangeSensitivityAbsolute = 0x030F, + kHIDUsage_Snsr_Property_ChangeSensitivityPercentRange = 0x0310, + kHIDUsage_Snsr_Property_ChangeSensitivityPercentRelative = 0x0311, + kHIDUsage_Snsr_Property_Accuracy = 0x0312, + kHIDUsage_Snsr_Property_Resolution = 0x0313, + kHIDUsage_Snsr_Property_Maximum = 0x0314, + kHIDUsage_Snsr_Property_Minimum = 0x0315, + kHIDUsage_Snsr_Property_ReportingState = 0x0316, + kHIDUsage_Snsr_Property_SamplingRate = 0x0317, + kHIDUsage_Snsr_Property_ResponseCurve = 0x0318, + kHIDUsage_Snsr_Property_PowerState = 0x0319, + kHIDUsage_Snsr_Property_MaxFIFOEvents = 0x031A, + kHIDUsage_Snsr_Property_ReportLatency = 0x031B, + + /* 0x031C - 0x03FF Reserved */ + + kHIDUsage_Snsr_Property_ConnectionType_Integrated = 0x0830, + kHIDUsage_Snsr_Property_ConnectionType_Attached = 0x0831, + kHIDUsage_Snsr_Property_ConnectionType_External = 0x0832, + /* 0x0833 - 0x083F Reserved */ + kHIDUsage_Snsr_Property_ReportingState_NoEvents = 0x0840, + kHIDUsage_Snsr_Property_ReportingState_AllEvents = 0x0841, + kHIDUsage_Snsr_Property_ReportingState_ThresholdEvents = 0x0842, + kHIDUsage_Snsr_Property_ReportingState_WakeNoEvents = 0x0843, + kHIDUsage_Snsr_Property_ReportingState_WakeAllEvents = 0x0844, + kHIDUsage_Snsr_Property_ReportingState_WakeThresholdEvents = 0x0845, + /* 0x0846 - 0x084F Reserved */ + kHIDUsage_Snsr_Property_PowerState_Undefined = 0x0850, + kHIDUsage_Snsr_Property_PowerState_D0_FullPower = 0x0851, + kHIDUsage_Snsr_Property_PowerState_D1_LowPower = 0x0852, + kHIDUsage_Snsr_Property_PowerState_D2_Standby = 0x0853, + kHIDUsage_Snsr_Property_PowerState_D3_Sleep = 0x0854, + kHIDUsage_Snsr_Property_PowerState_D4_PowerOff = 0x0855, + /* 0x0855 - 0x085F Reserved */ + kHIDUsage_Snsr_Light_Illuminance = 0x04D1, + + /* Specific Sensor Type Data Fields */ + + /* Location Sensor Data Fields */ + kHIDUsage_Snsr_Data_Location = 0x0400, + kHIDUsage_Snsr_Data_Location_Reserved = 0x0401, + kHIDUsage_Snsr_Data_Location_AltitudeAntennaSeaLevel = 0x0402, + kHIDUsage_Snsr_Data_Location_DifferentialReferenceStationID = 0x0403, + kHIDUsage_Snsr_Data_Location_AltitudeEllipsoidError = 0x0404, + kHIDUsage_Snsr_Data_Location_AltitudeEllipsoid = 0x0405, + kHIDUsage_Snsr_Data_Location_AltitudeSeaLevelError = 0x0406, + kHIDUsage_Snsr_Data_Location_AltitudeSeaLevel = 0x0407, + kHIDUsage_Snsr_Data_Location_DifferentialGPSDataAge = 0x0408, + kHIDUsage_Snsr_Data_Location_ErrorRadius = 0x0409, + + kHIDUsage_Snsr_Data_Location_FixQuality = 0x040A, + kHIDUsage_Snsr_Data_Location_FixQualityNoFix = 0x0870, + kHIDUsage_Snsr_Data_Location_FixQualityGPS = 0x0871, + kHIDUsage_Snsr_Data_Location_FixQualityDGPS = 0x0872, + + kHIDUsage_Snsr_Data_Location_FixType = 0x040B, + kHIDUsage_Snsr_Data_Location_FixTypeNoFix = 0x0880, + kHIDUsage_Snsr_Data_Location_FixTypeGPSSPSMode = 0x0881, + kHIDUsage_Snsr_Data_Location_FixTypeDGPSSPSMode = 0x0882, + kHIDUsage_Snsr_Data_Location_FixTypeGPSPPSMode = 0x0883, + kHIDUsage_Snsr_Data_Location_FixTypeRealTimeKinematic = 0x0884, + kHIDUsage_Snsr_Data_Location_FixTypeFloatRTK = 0x0885, + kHIDUsage_Snsr_Data_Location_FixTypeEstimated = 0x0886, + kHIDUsage_Snsr_Data_Location_FixTypeManualInputMode = 0x0887, + kHIDUsage_Snsr_Data_Location_FixTypeSimulatorMode = 0x0888, + + kHIDUsage_Snsr_Data_Location_GeoidalSeparation = 0x040C, + + kHIDUsage_Snsr_Data_Location_GPSOperationMode = 0x040D, + kHIDUsage_Snsr_Data_Location_GPSOperationModeManual = 0x0890, + kHIDUsage_Snsr_Data_Location_GPSOperationModeAutomatic = 0x0891, + + kHIDUsage_Snsr_Data_Location_GPSSelectionMode = 0x040E, + kHIDUsage_Snsr_Data_Location_GPSSelectionModeAutonomous = 0x08A0, + kHIDUsage_Snsr_Data_Location_GPSSelectionModeDGPS = 0x08A1, + kHIDUsage_Snsr_Data_Location_GPSSelectionModeEstimated = 0x08A2, + kHIDUsage_Snsr_Data_Location_GPSSelectionModeManualInput = 0x08A3, + kHIDUsage_Snsr_Data_Location_GPSSelectionModeSimulator = 0x08A4, + kHIDUsage_Snsr_Data_Location_GPSSelectionModeDataNotValid = 0x08A5, + + kHIDUsage_Snsr_Data_Location_GPSStatus = 0x040F, + kHIDUsage_Snsr_Data_Location_GPSStatusDataValid = 0x08B0, + kHIDUsage_Snsr_Data_Location_GPSStatusDataNotValid = 0x08B1, + + kHIDUsage_Snsr_Data_Location_PositionDilutionOfPrecision = 0x0410, + kHIDUsage_Snsr_Data_Location_HorizontalDilutionOfPrecision = 0x0411, + kHIDUsage_Snsr_Data_Location_VerticalDilutionOfPrecision = 0x0412, + kHIDUsage_Snsr_Data_Location_Latitude = 0x0413, + kHIDUsage_Snsr_Data_Location_Longitude = 0x0414, + kHIDUsage_Snsr_Data_Location_TrueHeading = 0x0415, + kHIDUsage_Snsr_Data_Location_MagneticHeading = 0x0416, + kHIDUsage_Snsr_Data_Location_MagneticVariation = 0x0417, + kHIDUsage_Snsr_Data_Location_Speed = 0x0418, + kHIDUsage_Snsr_Data_Location_SatellitesInView = 0x0419, + kHIDUsage_Snsr_Data_Location_SatellitesInViewAzimuth = 0x041A, + kHIDUsage_Snsr_Data_Location_SatellitesInViewElevation = 0x041B, + kHIDUsage_Snsr_Data_Location_SatellitesInViewIDs = 0x041C, + kHIDUsage_Snsr_Data_Location_SatellitesInViewPRNs = 0x041D, + kHIDUsage_Snsr_Data_Location_SatellitesInViewSNRatios = 0x041E, + kHIDUsage_Snsr_Data_Location_SatellitesUsedCount = 0x041F, + kHIDUsage_Snsr_Data_Location_SatellitesUsedPRNs = 0x0420, + kHIDUsage_Snsr_Data_Location_NMEASentence = 0x0421, + kHIDUsage_Snsr_Data_Location_AddressLine1 = 0x0422, + kHIDUsage_Snsr_Data_Location_AddressLine2 = 0x0423, + kHIDUsage_Snsr_Data_Location_City = 0x0424, + kHIDUsage_Snsr_Data_Location_StateOrProvince = 0x0425, + kHIDUsage_Snsr_Data_Location_CountryOrRegion = 0x0426, + kHIDUsage_Snsr_Data_Location_PostalCode = 0x0427, + /* 0x0428 - 0x0429 Reserved */ + + /* Location Sensor Properties */ + kHIDUsage_Snsr_Property_Location = 0x042A, + kHIDUsage_Snsr_Property_Location_DesiredAccuracy = 0x042B, + kHIDUsage_Snsr_Property_Location_AccuracyDefault = 0x0860, + kHIDUsage_Snsr_Property_Location_AccuracyHigh = 0x0861, + kHIDUsage_Snsr_Property_Location_AccuracyMedium = 0x0862, + kHIDUsage_Snsr_Property_Location_AccuracyLow = 0x0863, + /* 0x042C - 0x042F Reserved */ + + /* Environmental Sensor Data Fields */ + kHIDUsage_Snsr_Data_Environmental = 0x0430, + kHIDUsage_Snsr_Data_Environmental_AtmosphericPressure = 0x0431, + kHIDUsage_Snsr_Data_Environmental_Reserved = 0x0432, + kHIDUsage_Snsr_Data_Environmental_RelativeHumidity = 0x0433, + kHIDUsage_Snsr_Data_Environmental_Temperature = 0x0434, + kHIDUsage_Snsr_Data_Environmental_WindDirection = 0x0435, + kHIDUsage_Snsr_Data_Environmental_WindSpeed = 0x0436, + /* 0x0437 - 0x043F Reserved */ + + /* Environmental Sensor Properties */ + kHIDUsage_Snsr_Property_Environmental = 0x0440, + kHIDUsage_Snsr_Property_Environmental_ReferencePressure = 0x0441, + /* 0x0442 - 0x044F Reserved */ + + /* Motion Sensor Data Fields */ + kHIDUsage_Snsr_Data_Motion = 0x0450, + kHIDUsage_Snsr_Data_Motion_State = 0x0451, + kHIDUsage_Snsr_Data_Motion_Acceleration = 0x0452, + kHIDUsage_Snsr_Data_Motion_AccelerationAxisX = 0x0453, + kHIDUsage_Snsr_Data_Motion_AccelerationAxisY = 0x0454, + kHIDUsage_Snsr_Data_Motion_AccelerationAxisZ = 0x0455, + kHIDUsage_Snsr_Data_Motion_AngularVelocity = 0x0456, + kHIDUsage_Snsr_Data_Motion_AngularVelocityXAxis = 0x0457, + kHIDUsage_Snsr_Data_Motion_AngularVelocityYAxis = 0x0458, + kHIDUsage_Snsr_Data_Motion_AngularVelocityZAxis = 0x0459, + kHIDUsage_Snsr_Data_Motion_AngularPosition = 0x045A, + kHIDUsage_Snsr_Data_Motion_AngularPositionXAxis = 0x045B, + kHIDUsage_Snsr_Data_Motion_AngularPositionYAxis = 0x045C, + kHIDUsage_Snsr_Data_Motion_AngularPositionZAxis = 0x045D, + kHIDUsage_Snsr_Data_Motion_Speed = 0x045E, + kHIDUsage_Snsr_Data_Motion_Intensity = 0x045F, + /* 0x0460 - 0x046F Reserved */ + + /* Orientation Sensor Data Fields */ + kHIDUsage_Snsr_Data_Orientation = 0x0470, + kHIDUsage_Snsr_Data_Orientation_Heading = 0x0471, + kHIDUsage_Snsr_Data_Orientation_HeadingXAxis = 0x0472, + kHIDUsage_Snsr_Data_Orientation_HeadingYAxis = 0x0473, + kHIDUsage_Snsr_Data_Orientation_HeadingZAxis = 0x0474, + kHIDUsage_Snsr_Data_Orientation_HeadingCompensatedMagneticNorth = 0x0475, + kHIDUsage_Snsr_Data_Orientation_HeadingCompensatedTrueNorth = 0x0476, + kHIDUsage_Snsr_Data_Orientation_HeadingMagneticNorth = 0x0477, + kHIDUsage_Snsr_Data_Orientation_HeadingTrueNorth = 0x0478, + kHIDUsage_Snsr_Data_Orientation_Distance = 0x0479, + kHIDUsage_Snsr_Data_Orientation_DistanceXAxis = 0x047A, + kHIDUsage_Snsr_Data_Orientation_DistanceYAxis = 0x047B, + kHIDUsage_Snsr_Data_Orientation_DistanceZAxis = 0x047C, + kHIDUsage_Snsr_Data_Orientation_DistanceOutOfRange = 0x047D, + kHIDUsage_Snsr_Data_Orientation_Tilt = 0x047E, + kHIDUsage_Snsr_Data_Orientation_TiltXAxis = 0x047F, + kHIDUsage_Snsr_Data_Orientation_TiltYAxis = 0x0480, + kHIDUsage_Snsr_Data_Orientation_TiltZAxis = 0x0481, + kHIDUsage_Snsr_Data_Orientation_RotationMatrix = 0x0482, + kHIDUsage_Snsr_Data_Orientation_Quaternion = 0x0483, + kHIDUsage_Snsr_Data_Orientation_MagneticFlux = 0x0484, + kHIDUsage_Snsr_Data_Orientation_MagneticFluxXAxis = 0x0485, + kHIDUsage_Snsr_Data_Orientation_MagneticFluxYAxis = 0x0486, + kHIDUsage_Snsr_Data_Orientation_MagneticFluxZAxis = 0x0487, + /* 0x0488 - 0x048F Reserved */ + + /* Mechanical Sensor Data Field */ + kHIDUsage_Snsr_Data_Mechanical = 0x0490, + kHIDUsage_Snsr_Data_Mechanical_BooleanSwitchState = 0x0491, + kHIDUsage_Snsr_Data_Mechanical_BooleanSwitchArrayStates = 0x0492, + kHIDUsage_Snsr_Data_Mechanical_MultivalueSwitchValue = 0x0493, + kHIDUsage_Snsr_Data_Mechanical_Force = 0x0494, + kHIDUsage_Snsr_Data_Mechanical_AbsolutePressure = 0x0495, + kHIDUsage_Snsr_Data_Mechanical_GaugePressure = 0x0496, + kHIDUsage_Snsr_Data_Mechanical_Strain = 0x0497, + kHIDUsage_Snsr_Data_Mechanical_Weight = 0x0498, + /* 0x0499 - 0x49F Reserved */ + + /* Mechanical Sensor Properties */ + kHIDUsage_Snsr_Property_Mechanical = 0x04A0, + kHIDUsage_Snsr_Property_Mechanical_VibrationState = 0x04A1, + kHIDUsage_Snsr_Property_Mechanical_ForwardVibrationSpeed = 0x04A2, + kHIDUsage_Snsr_Property_Mechanical_BackwardVibrationSpeed = 0x04A3, + /* 0x04A4 - 0x04AF Reserved */ + + /* Biometric Sensor Data Fields */ + kHIDUsage_Snsr_Data_Biometric = 0x04B0, + kHIDUsage_Snsr_Data_Biometric_HumanPresence = 0x04B1, + kHIDUsage_Snsr_Data_Biometric_HumanProximityRange = 0x04B2, + kHIDUsage_Snsr_Data_Biometric_HumanProximityOutOfRange = 0x04B3, + kHIDUsage_Snsr_Data_Biometric_HumanTouchState = 0x04B4, + /* 0x04B5 - 0x04CF Reserved */ + + /* Light Sensor Data Fields */ + kHIDUsage_Snsr_Data_Light = 0x04D0, + kHIDUsage_Snsr_Data_Light_Illuminance = 0x04D1, + kHIDUsage_Snsr_Data_Light_ColorTemperature = 0x04D2, + kHIDUsage_Snsr_Data_Light_Chromaticity = 0x04D3, + kHIDUsage_Snsr_Data_Light_ChromaticityX = 0x04D4, + kHIDUsage_Snsr_Data_Light_ChromaticityY = 0x04D5, + kHIDUsage_Snsr_Data_Light_ConsumerIRSentenceReceive = 0x04D6, + /* 0x04D7 - 0x04DF Reserved */ + + /* Light Sensor Properties */ + kHIDUsage_Snsr_Property_Light = 0x04E0, + kHIDUsage_Snsr_Property_Light_ConsumerIRSentenceSend = 0x04E1, + /* 0x04E2 - 0x04EF Reserved */ + + /* Scanner Sensor Data Fields */ + kHIDUsage_Snsr_Data_Scanner = 0x04F0, + kHIDUsage_Snsr_Data_Scanner_RFIDTag40Bit = 0x04F1, + kHIDUsage_Snsr_Data_Scanner_NFCSentenceReceive = 0x04F2, + /* 0x04F3 - 0x04F7 Reserved */ + + /* Scanner Sensor Properties */ + kHIDUsage_Snsr_Property_Scanner = 0x04F8, + kHIDUsage_Snsr_Property_Scanner_NFCSentenceSend = 0x0F49, + /* 0x04FA - 0x04FF Reserved */ + + /* Electrical Sensor Data Fields */ + kHIDUsage_Snsr_Data_Electrical = 0x0500, + kHIDUsage_Snsr_Data_Electrical_Capacitance = 0x0501, + kHIDUsage_Snsr_Data_Electrical_Current = 0x0502, + kHIDUsage_Snsr_Data_Electrical_ElectricalPower = 0x0503, + kHIDUsage_Snsr_Data_Electrical_Inductance = 0x0504, + kHIDUsage_Snsr_Data_Electrical_Resistance = 0x0505, + kHIDUsage_Snsr_Data_Electrical_Voltage = 0x0506, + kHIDUsage_Snsr_Data_Electrical_Frequency = 0x0507, + kHIDUsage_Snsr_Data_Electrical_Period = 0x0508, + kHIDUsage_Snsr_Data_Electrical_PercentOfRange = 0x0509, + /* 0x050A - 0x051F Reserved */ + + /* Time Sensor Data Fields */ + kHIDUsage_Snsr_Data_Time = 0x0520, + kHIDUsage_Snsr_Data_Time_Year = 0x0521, + kHIDUsage_Snsr_Data_Time_Month = 0x0522, + kHIDUsage_Snsr_Data_Time_Day = 0x0523, + + kHIDUsage_Snsr_Data_Time_DayOfWeek = 0x0524, + kHIDUsage_Snsr_Data_Time_DayOfWeekSunday = 0x08C0, + kHIDUsage_Snsr_Data_Time_DayOfWeekMonday = 0x08C1, + kHIDUsage_Snsr_Data_Time_DayOfWeekTuesday = 0x08C2, + kHIDUsage_Snsr_Data_Time_DayOfWeekWednesday = 0x08C3, + kHIDUsage_Snsr_Data_Time_DayOfWeekThursday = 0x08C4, + kHIDUsage_Snsr_Data_Time_DayOfWeekFriday = 0x08C5, + kHIDUsage_Snsr_Data_Time_DayOfWeekSaturday = 0x08C6, + + kHIDUsage_Snsr_Data_Time_Hour = 0x0525, + kHIDUsage_Snsr_Data_Time_Minute = 0x0526, + kHIDUsage_Snsr_Data_Time_Second = 0x0527, + kHIDUsage_Snsr_Data_Time_Millisecond = 0x0528, + kHIDUsage_Snsr_Data_Time_Timestamp = 0x0529, + kHIDUsage_Snsr_Data_Time_JulianDayOfYear = 0x052A, + /* 0x052B - 0x052F Reserved */ + + /* Time Sensor Properties */ + kHIDUsage_Snsr_Property_Time = 0x0530, + kHIDUsage_Snsr_Property_Time_TimeZoneOffsetFromUTC = 0x0531, + kHIDUsage_Snsr_Property_Time_TimeZoneName = 0x0532, + kHIDUsage_Snsr_Property_Time_DaylightSavingsTimeObserved = 0x0533, + kHIDUsage_Snsr_Property_Time_TimeTrimAdjustment = 0x0534, + kHIDUsage_Snsr_Property_Time_ArmAlarm = 0x0535, + /* 0x0536 - 0x053F Reserved */ + + /* Custom Sensor Data Fields */ + kHIDUsage_Snsr_Data_Custom = 0x0540, + kHIDUsage_Snsr_Data_Custom_Usage = 0x0541, + kHIDUsage_Snsr_Data_Custom_BooleanArray = 0x0542, + kHIDUsage_Snsr_Data_Custom_Value = 0x0543, + kHIDUsage_Snsr_Data_Custom_Value1 = 0x0544, + kHIDUsage_Snsr_Data_Custom_Value2 = 0x0545, + kHIDUsage_Snsr_Data_Custom_Value3 = 0x0546, + kHIDUsage_Snsr_Data_Custom_Value4 = 0x0547, + kHIDUsage_Snsr_Data_Custom_Value5 = 0x0548, + kHIDUsage_Snsr_Data_Custom_Value6 = 0x0549, + /* 0x054A - 0x055F Reserved */ +}; + +/* Power Device Page (0x84) */ +/* This section provides detailed descriptions of the usages employed by Power Devices. */ +enum +{ + + kHIDUsage_PD_Undefined = 0x00, /* Power Device Undefined Usage */ + kHIDUsage_PD_iName = 0x01, /* CL- Power Device Name Index */ + kHIDUsage_PD_PresentStatus = 0x02, /* CL- Power Device Present Status */ + kHIDUsage_PD_ChangedStatus = 0x03, /* CA- Power Device Changed Status */ + kHIDUsage_PD_UPS = 0x04, /* CA- Uninterruptible Power Supply */ + kHIDUsage_PD_PowerSupply = 0x05, /* CA- Power Supply */ + kHIDUsage_PD_PeripheralDevice = 0x06, /* CA- Perpheral Device */ + /* Reserved 0x07 - 0x0F */ + kHIDUsage_PD_BatterySystem = 0x10, /* CP- Battery System power module */ + kHIDUsage_PD_BatterySystemID = 0x11, /* SV IF- Battery System ID */ + kHIDUsage_PD_Battery = 0x12, /* CP- Battery */ + kHIDUsage_PD_BatteryID = 0x13, /* SV IF- Battery ID */ + kHIDUsage_PD_Charger = 0x14, /* CP- Charger */ + kHIDUsage_PD_ChargerID = 0x15, /* SV IF- Charger ID */ + kHIDUsage_PD_PowerConverter = 0x16, /* CP- Power Converter power module */ + kHIDUsage_PD_PowerConverterID = 0x17, /* SV IF- Power Converter ID */ + kHIDUsage_PD_OutletSystem = 0x18, /* CP- Outlet System power module */ + kHIDUsage_PD_OutletSystemID = 0x19, /* SV IF-Outlet System ID */ + kHIDUsage_PD_Input = 0x1A, /* CP- Power Device Input */ + kHIDUsage_PD_InputID = 0x1B, /* SV IF- Power Device Input ID */ + kHIDUsage_PD_Output = 0x1C, /* CP- Power Device Output */ + kHIDUsage_PD_OutputID = 0x1D, /* SV IF- Power Device Output ID */ + kHIDUsage_PD_Flow = 0x1E, /* CP- Power Device Flow */ + kHIDUsage_PD_FlowID = 0x1F, /* Item IF- Power Device Flow ID */ + kHIDUsage_PD_Outlet = 0x20, /* CP- Power Device Outlet */ + kHIDUsage_PD_OutletID = 0x21, /* SV IF- Power Device Outlet ID */ + kHIDUsage_PD_Gang = 0x22, /* CL/CP- Power Device Gang */ + kHIDUsage_PD_GangID = 0x23, /* SV IF- Power Device Gang ID */ + kHIDUsage_PD_PowerSummary = 0x24, /* CL/CP- Power Device Power Summary */ + kHIDUsage_PD_PowerSummaryID = 0x25, /* SV IF- Power Device Power Summary ID */ + /* Reserved 0x26 - 0x2F */ + kHIDUsage_PD_Voltage = 0x30, /* DV IF- Power Device Voltage */ + kHIDUsage_PD_Current = 0x31, /* DV IF- Power Device Current */ + kHIDUsage_PD_Frequency = 0x32, /* DV IF- Power Device Frequency */ + kHIDUsage_PD_ApparentPower = 0x33, /* DV IF- Power Device Apparent Power */ + kHIDUsage_PD_ActivePower = 0x34, /* DV IF- Power Device RMS Power */ + kHIDUsage_PD_PercentLoad = 0x35, /* DV IF- Power Device Percent Load */ + kHIDUsage_PD_Temperature = 0x36, /* DV IF- Power Device Temperature */ + kHIDUsage_PD_Humidity = 0x37, /* DV IF- Power Device Humidity */ + kHIDUsage_PD_BadCount = 0x38, /* DV IF- Power Device Bad Condition Count */ + /* Reserved 0x39 - 0x3F */ + kHIDUsage_PD_ConfigVoltage = 0x40, /* SV/DV F- Power Device Nominal Voltage */ + kHIDUsage_PD_ConfigCurrent = 0x41, /* SV/DV F- Power Device Nominal Current */ + kHIDUsage_PD_ConfigFrequency = 0x42, /* SV/DV F- Power Device Nominal Frequency */ + kHIDUsage_PD_ConfigApparentPower = 0x43, /* SV/DV F- Power Device Nominal Apparent Power */ + kHIDUsage_PD_ConfigActivePower = 0x44, /* SV/DV F- Power Device Nominal RMS Power */ + kHIDUsage_PD_ConfigPercentLoad = 0x45, /* SV/DV F- Power Device Nominal Percent Load */ + kHIDUsage_PD_ConfigTemperature = 0x46, /* SV/DV F- Power Device Nominal Temperature */ + kHIDUsage_PD_ConfigHumidity = 0x47, /* SV/DV F- Power Device Nominal Humidity */ + /* Reserved 0x48 - 0x4F */ + kHIDUsage_PD_SwitchOnControl = 0x50, /* DV F- Power Device Switch On Control */ + kHIDUsage_PD_SwitchOffControl = 0x51, /* DV F- Power Device Switch Off Control */ + kHIDUsage_PD_ToggleControl = 0x52, /* DV F- Power Device Toogle Sequence Control */ + kHIDUsage_PD_LowVoltageTransfer = 0x53, /* DV F- Power Device Min Transfer Voltage */ + kHIDUsage_PD_HighVoltageTransfer = 0x54, /* DV F- Power Device Max Transfer Voltage */ + kHIDUsage_PD_DelayBeforeReboot = 0x55, /* DV F- Power Device Delay Before Reboot */ + kHIDUsage_PD_DelayBeforeStartup = 0x56, /* DV F- Power Device Delay Before Startup */ + kHIDUsage_PD_DelayBeforeShutdown = 0x57, /* DV F- Power Device Delay Before Shutdown */ + kHIDUsage_PD_Test = 0x58, /* DV F- Power Device Test Request/Result */ + kHIDUsage_PD_ModuleReset = 0x59, /* DV F- Power Device Reset Request/Result */ + kHIDUsage_PD_AudibleAlarmControl = 0x5A, /* DV F- Power Device Audible Alarm Control */ + /* Reserved 0x5B - 0x5F */ + kHIDUsage_PD_Present = 0x60, /* DV IOF- Power Device Present */ + kHIDUsage_PD_Good = 0x61, /* DV IOF- Power Device Good */ + kHIDUsage_PD_InternalFailure = 0x62, /* DV IOF- Power Device Internal Failure */ + kHIDUsage_PD_VoltageOutOfRange = 0x63, /* DV IOF- Power Device Voltage Out Of Range */ + kHIDUsage_PD_FrequencyOutOfRange = 0x64, /* DV IOF- Power Device Frequency Out Of Range */ + kHIDUsage_PD_Overload = 0x65, /* DV IOF- Power Device Overload */ + kHIDUsage_PD_OverCharged = 0x66, /* DV IOF- Power Device Over Charged */ + kHIDUsage_PD_OverTemperature = 0x67, /* DV IOF- Power Device Over Temperature */ + kHIDUsage_PD_ShutdownRequested = 0x68, /* DV IOF- Power Device Shutdown Requested */ + kHIDUsage_PD_ShutdownImminent = 0x69, /* DV IOF- Power Device Shutdown Imminent */ + /* Reserved 0x6A */ + kHIDUsage_PD_SwitchOnOff = 0x6B, /* DV IOF- Power Device On/Off Switch Status */ + kHIDUsage_PD_Switchable = 0x6C, /* DV IOF- Power Device Switchable */ + kHIDUsage_PD_Used = 0x6D, /* DV IOF- Power Device Used */ + kHIDUsage_PD_Boost = 0x6E, /* DV IOF- Power Device Boosted */ + kHIDUsage_PD_Buck = 0x6F, /* DV IOF- Power Device Bucked */ + kHIDUsage_PD_Initialized = 0x70, /* DV IOF- Power Device Initialized */ + kHIDUsage_PD_Tested = 0x71, /* DV IOF- Power Device Tested */ + kHIDUsage_PD_AwaitingPower = 0x72, /* DV IOF- Power Device Awaiting Power */ + kHIDUsage_PD_CommunicationLost = 0x73, /* DV IOF- Power Device Communication Lost */ + /* Reserved 0x74 - 0xFC */ + kHIDUsage_PD_iManufacturer = 0xFD, /* SV F- Power Device Manufacturer String Index */ + kHIDUsage_PD_iProduct = 0xFE, /* SV F- Power Device Product String Index */ + kHIDUsage_PD_iserialNumber = 0xFF /* SV F- Power Device Serial Number String Index */ +}; + +/* Battery System Page (x85) */ +/* This section provides detailed descriptions of the usages employed by Battery Systems. */ +enum +{ + kHIDUsage_BS_Undefined = 0x00, /* Battery System Undefined */ + kHIDUsage_BS_SMBBatteryMode = 0x01, /* CL - SMB Mode */ + kHIDUsage_BS_SMBBatteryStatus = 0x02, /* CL - SMB Status */ + kHIDUsage_BS_SMBAlarmWarning = 0x03, /* CL - SMB Alarm Warning */ + kHIDUsage_BS_SMBChargerMode = 0x04, /* CL - SMB Charger Mode */ + kHIDUsage_BS_SMBChargerStatus = 0x05, /* CL - SMB Charger Status */ + kHIDUsage_BS_SMBChargerSpecInfo = 0x06, /* CL - SMB Charger Extended Status */ + kHIDUsage_BS_SMBSelectorState = 0x07, /* CL - SMB Selector State */ + kHIDUsage_BS_SMBSelectorPresets = 0x08, /* CL - SMB Selector Presets */ + kHIDUsage_BS_SMBSelectorInfo = 0x09, /* CL - SMB Selector Info */ + /* Reserved 0x0A - 0x0F */ + kHIDUsage_BS_OptionalMfgFunction1 = 0x10, /* DV F - Battery System Optional SMB Mfg Function 1 */ + kHIDUsage_BS_OptionalMfgFunction2 = 0x11, /* DV F - Battery System Optional SMB Mfg Function 2 */ + kHIDUsage_BS_OptionalMfgFunction3 = 0x12, /* DV F - Battery System Optional SMB Mfg Function 3 */ + kHIDUsage_BS_OptionalMfgFunction4 = 0x13, /* DV F - Battery System Optional SMB Mfg Function 4 */ + kHIDUsage_BS_OptionalMfgFunction5 = 0x14, /* DV F - Battery System Optional SMB Mfg Function 5 */ + kHIDUsage_BS_ConnectionToSMBus = 0x15, /* DF F - Battery System Connection To System Management Bus */ + kHIDUsage_BS_OutputConnection = 0x16, /* DF F - Battery System Output Connection Status */ + kHIDUsage_BS_ChargerConnection = 0x17, /* DF F - Battery System Charger Connection */ + kHIDUsage_BS_BatteryInsertion = 0x18, /* DF F - Battery System Battery Insertion */ + kHIDUsage_BS_Usenext = 0x19, /* DF F - Battery System Use Next */ + kHIDUsage_BS_OKToUse = 0x1A, /* DF F - Battery System OK To Use */ + kHIDUsage_BS_BatterySupported = 0x1B, /* DF F - Battery System Battery Supported */ + kHIDUsage_BS_SelectorRevision = 0x1C, /* DF F - Battery System Selector Revision */ + kHIDUsage_BS_ChargingIndicator = 0x1D, /* DF F - Battery System Charging Indicator */ + /* Reserved 0x1E - 0x27 */ + kHIDUsage_BS_ManufacturerAccess = 0x28, /* DV F - Battery System Manufacturer Access */ + kHIDUsage_BS_RemainingCapacityLimit = 0x29, /* DV F - Battery System Remaining Capacity Limit */ + kHIDUsage_BS_RemainingTimeLimit = 0x2A, /* DV F - Battery System Remaining Time Limit */ + kHIDUsage_BS_AtRate = 0x2B, /* DV F - Battery System At Rate... */ + kHIDUsage_BS_CapacityMode = 0x2C, /* DV F - Battery System Capacity Mode */ + kHIDUsage_BS_BroadcastToCharger = 0x2D, /* DV F - Battery System Broadcast To Charger */ + kHIDUsage_BS_PrimaryBattery = 0x2E, /* DV F - Battery System Primary Battery */ + kHIDUsage_BS_ChargeController = 0x2F, /* DV F - Battery System Charge Controller */ + /* Reserved 0x30 - 0x3F */ + kHIDUsage_BS_TerminateCharge = 0x40, /* DF IOF - Battery System Terminate Charge */ + kHIDUsage_BS_TerminateDischarge = 0x41, /* DF IOF - Battery System Terminate Discharge */ + kHIDUsage_BS_BelowRemainingCapacityLimit = 0x42, /* DF IOF - Battery System Below Remaining Capacity Limit */ + kHIDUsage_BS_RemainingTimeLimitExpired = 0x43, /* DF IOF - Battery System Remaining Time Limit Expired */ + kHIDUsage_BS_Charging = 0x44, /* DF IOF - Battery System Charging */ + kHIDUsage_BS_Discharging = 0x45, /* DV IOF - Battery System Discharging */ + kHIDUsage_BS_FullyCharged = 0x46, /* DF IOF - Battery System Fully Charged */ + kHIDUsage_BS_FullyDischarged = 0x47, /* DV IOF - Battery System Fully Discharged */ + kHIDUsage_BS_ConditioningFlag = 0x48, /* DV IOF - Battery System Conditioning Flag */ + kHIDUsage_BS_AtRateOK = 0x49, /* DV IOF - Battery System At Rate OK */ + kHIDUsage_BS_SMBErrorCode = 0x4A, /* DF IOF - Battery System SMB Error Code */ + kHIDUsage_BS_NeedReplacement = 0x4B, /* DF IOF - Battery System Need Replacement */ + /* Reserved 0x4C - 0x5F */ + kHIDUsage_BS_AtRateTimeToFull = 0x60, /* DV IF - Battery System At Rate Time To Full */ + kHIDUsage_BS_AtRateTimeToEmpty = 0x61, /* DV IF - Battery System At Rate Time To Empty */ + kHIDUsage_BS_AverageCurrent = 0x62, /* DV IF - Battery System Average Current */ + kHIDUsage_BS_Maxerror = 0x63, /* DV IF - Battery System Max Error */ + kHIDUsage_BS_RelativeStateOfCharge = 0x64, /* DV IF - Battery System Relative State Of Charge */ + kHIDUsage_BS_AbsoluteStateOfCharge = 0x65, /* DV IF - Battery System Absolute State Of Charge */ + kHIDUsage_BS_RemainingCapacity = 0x66, /* DV IF - Battery System Remaining Capacity */ + kHIDUsage_BS_FullChargeCapacity = 0x67, /* DV IF - Battery System Full Charge Capacity */ + kHIDUsage_BS_RunTimeToEmpty = 0x68, /* DV IF - Battery System Run Time To Empty */ + kHIDUsage_BS_AverageTimeToEmpty = 0x69, /* DV IF - Battery System Average Time To Empty */ + kHIDUsage_BS_AverageTimeToFull = 0x6A, /* DV IF - Battery System Average Time To Full */ + kHIDUsage_BS_CycleCount = 0x6B, /* DV IF - Battery System Cycle Count */ + /* Reserved 0x6C - 0x7F */ + kHIDUsage_BS_BattPackModelLevel = 0x80, /* SV F - Battery System Batt Pack Model Level */ + kHIDUsage_BS_InternalChargeController = 0x81, /* SF F - Battery System Internal Charge Controller */ + kHIDUsage_BS_PrimaryBatterySupport = 0x82, /* SF F - Battery System Primary Battery Support */ + kHIDUsage_BS_DesignCapacity = 0x83, /* SV F - Battery System Design Capacity */ + kHIDUsage_BS_SpecificationInfo = 0x84, /* SV F - Battery System Specification Info */ + kHIDUsage_BS_ManufacturerDate = 0x85, /* SV F - Battery System Manufacturer Date */ + kHIDUsage_BS_SerialNumber = 0x86, /* SV F - Battery System Serial Number */ + kHIDUsage_BS_iManufacturerName = 0x87, /* SV F - Battery System Manufacturer Name Index */ + kHIDUsage_BS_iDevicename = 0x88, /* SV F - Battery System Device Name Index */ + kHIDUsage_BS_iDeviceChemistry = 0x89, /* SV F - Battery System Device Chemistry Index */ + kHIDUsage_BS_ManufacturerData = 0x8A, /* SV F - Battery System Manufacturer Data */ + kHIDUsage_BS_Rechargable = 0x8B, /* SV F - Battery System Rechargable */ + kHIDUsage_BS_WarningCapacityLimit = 0x8C, /* SV F - Battery System Warning Capacity Limit */ + kHIDUsage_BS_CapacityGranularity1 = 0x8D, /* SV F - Battery System Capacity Granularity 1 */ + kHIDUsage_BS_CapacityGranularity2 = 0x8E, /* SV F - Battery System Capacity Granularity 2 */ + kHIDUsage_BS_iOEMInformation = 0x8F, /* SV F - Battery System OEM Information Index */ + /* Reserved 0x90 - 0xBF */ + kHIDUsage_BS_InhibitCharge = 0xC0, /* DF IOF - Battery System Inhibit Charge */ + kHIDUsage_BS_EnablePolling = 0xC1, /* DF IOF - Battery System Enable Polling */ + kHIDUsage_BS_ResetToZero = 0xC2, /* DF IOF - Battery System Reset To Zero */ + /* Reserved 0xC3 - 0xCF */ + kHIDUsage_BS_ACPresent = 0xD0, /* DF IOF - Battery System AC Present */ + kHIDUsage_BS_BatteryPresent = 0xD1, /* DF IOF - Battery System Battery Present */ + kHIDUsage_BS_PowerFail = 0xD2, /* DF IOF - Battery System Power Fail */ + kHIDUsage_BS_AlarmInhibited = 0xD3, /* DF IOF - Battery System Alarm Inhibited */ + kHIDUsage_BS_ThermistorUnderRange = 0xD4, /* DF IOF - Battery System Thermistor Under Range */ + kHIDUsage_BS_ThermistorHot = 0xD5, /* DF IOF - Battery System Thermistor Hot */ + kHIDUsage_BS_ThermistorCold = 0xD6, /* DF IOF - Battery System Thermistor Cold */ + kHIDUsage_BS_ThermistorOverRange = 0xD7, /* DF IOF - Battery System Thermistor Over Range */ + kHIDUsage_BS_VoltageOutOfRange = 0xD8, /* DF IOF - Battery System Voltage Out Of Range */ + kHIDUsage_BS_CurrentOutOfRange = 0xD9, /* DF IOF - Battery System Current Out Of Range */ + kHIDUsage_BS_CurrentNotRegulated = 0xDA, /* DF IOF - Battery System Current Not Regulated */ + kHIDUsage_BS_VoltageNotRegulated = 0xDB, /* DF IOF - Battery System Voltage Not Regulated */ + kHIDUsage_BS_MasterMode = 0xDC, /* DF IOF - Battery System Master Mode */ + /* Reserved 0xDD - 0xEF */ + kHIDUsage_BS_ChargerSelectorSupport = 0xF0, /* SF F- Battery System Charger Support Selector */ + kHIDUsage_BS_ChargerSpec = 0xF1, /* SF F- Battery System Charger Specification */ + kHIDUsage_BS_Level2 = 0xF2, /* SF F- Battery System Charger Level 2 */ + kHIDUsage_BS_Level3 = 0xF3 /* SF F- Battery System Charger Level 3 */ + /* Reserved 0xF2 - 0xFF */ +}; + +/* Bar Code Scanner Page (0x8C) */ +/* This section provides detailed descriptions of the usages employed by Bar Code Scanner Devices. */ +enum +{ + kHIDUsage_BCS_Undefined = 0x00, /* Bar Code Scanner Undefined Usage */ + kHIDUsage_BCS_BadgeReader = 0x01, /* CA - Bar Code Badge Reader */ + kHIDUsage_BCS_BarCodeScanner = 0x02, /* CA -Bar Code Scanner */ + kHIDUsage_BCS_DumbBarCodeScanner = 0x03, /* CA -Dumb Bar Code Scanner Usage */ + kHIDUsage_BCS_CordlessScannerBase = 0x04, /* CA -Cordless Base Usage */ + kHIDUsage_BCS_BarCodeScannerCradle = 0x05, /* CA -Bar Code Scanner Cradle Usage */ + /* Reserved 0x06 - 0x0F */ + kHIDUsage_BCS_AttributeReport = 0x10, /* CL - Attribute Report */ + kHIDUsage_BCS_SettingsReport = 0x11, /* CL - Settings Report */ + kHIDUsage_BCS_ScannedDataReport = 0x12, /* CL - Scanned Data Report */ + kHIDUsage_BCS_RawScannedDataReport = 0x13, /* CL - Raw Scanned Data Report */ + kHIDUsage_BCS_TriggerReport = 0x14, /* CL - Trigger Report */ + kHIDUsage_BCS_StatusReport = 0x15, /* CL - Status Report */ + kHIDUsage_BCS_UPC_EANControlReport = 0x16, /* CL - UPC/EAN Control Report */ + kHIDUsage_BCS_EAN2_3LabelControlReport = 0x17, /* CL - EAN 2/3 Label Control Report */ + kHIDUsage_BCS_Code39ControlReport = 0x18, /* CL - Code 39 Control Report */ + kHIDUsage_BCS_Interleaved2of5ControlReport = 0x19, /* CL - Interleaved 2 of 5 Control Report */ + kHIDUsage_BCS_Standard2of5ControlReport = 0x1A, /* CL - Standard 2 of 5 Control Report */ + kHIDUsage_BCS_MSIPlesseyControlReport = 0x1B, /* CL - MSI Plessey Control Report */ + kHIDUsage_BCS_CodabarControlReport = 0x1C, /* CL - Codabar Control Report */ + kHIDUsage_BCS_Code128ControlReport = 0x1D, /* CL - Code 128 Control Report */ + kHIDUsage_BCS_Misc1DControlReport = 0x1E, /* CL - Misc 1D Control Report */ + kHIDUsage_BCS_2DControlReport = 0x1F, /* CL - 2D Control Report */ + /* Reserved 0x20 - 0x2F */ + kHIDUsage_BCS_Aiming_PointerMide = 0x30, /* SF - Aiming Pointer Mode */ + kHIDUsage_BCS_BarCodePresentSensor = 0x31, /* SF - Bar Code Present Sensor */ + kHIDUsage_BCS_Class1ALaser = 0x32, /* SF - Class 1A Laser */ + kHIDUsage_BCS_Class2Laser = 0x33, /* SF - Class 2 Laser */ + kHIDUsage_BCS_HeaterPresent = 0x34, /* SF - Heater Present */ + kHIDUsage_BCS_ContactScanner = 0x35, /* SF - Contact Scanner */ + kHIDUsage_BCS_ElectronicArticleSurveillanceNotification = 0x36, /* SF - Electronic Article Surveillance Notification */ + kHIDUsage_BCS_ConstantElectronicArticleSurveillance = 0x37, /* SF - Constant Electronic Article Surveillance */ + kHIDUsage_BCS_ErrorIndication = 0x38, /* SF - Error Indication */ + kHIDUsage_BCS_FixedBeeper = 0x39, /* SF - Fixed Beeper */ + kHIDUsage_BCS_GoodDecodeIndication = 0x3A, /* SF - Good Decode Indication */ + kHIDUsage_BCS_HandsFreeScanning = 0x3B, /* SF - Hands Free Scanning */ + kHIDUsage_BCS_IntrinsicallySafe = 0x3C, /* SF - Intrinsically Safe */ + kHIDUsage_BCS_KlasseEinsLaser = 0x3D, /* SF - Klasse Eins Laser */ + kHIDUsage_BCS_LongRangeScanner = 0x3E, /* SF - Long Range Scanner */ + kHIDUsage_BCS_MirrorSpeedControl = 0x3F, /* SF - Mirror Speed Control */ + kHIDUsage_BCS_NotOnFileIndication = 0x40, /* SF - Not On File Indication */ + kHIDUsage_BCS_ProgrammableBeeper = 0x41, /* SF - Programmable Beeper */ + kHIDUsage_BCS_Triggerless = 0x42, /* SF - Triggerless */ + kHIDUsage_BCS_Wand = 0x43, /* SF - Wand */ + kHIDUsage_BCS_WaterResistant = 0x44, /* SF - Water Resistant */ + kHIDUsage_BCS_MultiRangeScanner = 0x45, /* SF - Multi-Range Scanner */ + kHIDUsage_BCS_ProximitySensor = 0x46, /* SF - Proximity Sensor */ + /* Reserved 0x47 - 0x4C */ + kHIDUsage_BCS_FragmentDecoding = 0x4D, /* DF - Fragment Decoding */ + kHIDUsage_BCS_ScannerReadConfidence = 0x4E, /* DV - Scanner Read Confidence */ + kHIDUsage_BCS_DataPrefix = 0x4F, /* NAry - Data Prefix */ + kHIDUsage_BCS_PrefixAIMI = 0x50, /* SEL - Prefix AIMI */ + kHIDUsage_BCS_PrefixNone = 0x51, /* SEL - Prefix None */ + kHIDUsage_BCS_PrefixProprietary = 0x52, /* SEL - Prefix Proprietary */ + /* Reserved 0x53 - 0x54 */ + kHIDUsage_BCS_ActiveTime = 0x55, /* DV - Active Time */ + kHIDUsage_BCS_AimingLaserPattern = 0x56, /* DF - Aiming Laser Pattern */ + kHIDUsage_BCS_BarCodePresent = 0x57, /* OOC - Bar Code Present */ + kHIDUsage_BCS_BeeperState = 0x58, /* OOC - Beeper State */ + kHIDUsage_BCS_LaserOnTime = 0x59, /* DV - Laser On Time */ + kHIDUsage_BCS_LaserState = 0x5A, /* OOC - Laser State */ + kHIDUsage_BCS_LockoutTime = 0x5B, /* DV - Lockout Time */ + kHIDUsage_BCS_MotorState = 0x5C, /* OOC - Motor State */ + kHIDUsage_BCS_MotorTimeout = 0x5D, /* DV - Motor Timeout */ + kHIDUsage_BCS_PowerOnResetScanner = 0x5E, /* DF - Power On Reset Scanner */ + kHIDUsage_BCS_PreventReadOfBarcodes = 0x5F, /* DF - Prevent Read of Barcodes */ + kHIDUsage_BCS_InitiateBarcodeRead = 0x60, /* DF - Initiate Barcode Read */ + kHIDUsage_BCS_TriggerState = 0x61, /* DF - Trigger State */ + kHIDUsage_BCS_TriggerMode = 0x62, /* NAry - Trigger Mode */ + kHIDUsage_BCS_TriggerModeBlinkingLaserOn = 0x63, /* SEL - Trigger Mode Blinking Laser On */ + kHIDUsage_BCS_TriggerModeContinuousLaserOn = 0x64, /* SEL - Trigger Mode Continuous Laser On */ + kHIDUsage_BCS_TriggerModeLaserOnWhilePulled = 0x65, /* SEL - Trigger Mode Laser on while Pulled */ + kHIDUsage_BCS_TriggerModeLaserStaysOnAfterTriggerRelease = 0x66, /* SEL - Trigger Mode Laser stays on after Trigger Release */ + /* Reserved 0x67 - 0x6C */ + kHIDUsage_BCS_CommitParametersToNVM = 0x6D, /* DF - Commit Parameters to NVM */ + kHIDUsage_BCS_ParameterScanning = 0x6E, /* DF - Parameter Scanning */ + kHIDUsage_BCS_ParametersChanged = 0x6F, /* OOC - Parameters Changed */ + kHIDUsage_BCS_SetParameterDefaultValues = 0x70, /* DF - Set parameter default values */ + /* Reserved 0x71 - 0x74 */ + kHIDUsage_BCS_ScannerInCradle = 0x75, /* OOC - Scanner In Cradle */ + kHIDUsage_BCS_ScannerInRange = 0x76, /* OOC - Scanner In Range */ + /* Reserved 0x77 - 0x79 */ + kHIDUsage_BCS_AimDuration = 0x7A, /* DV - Aim Duration */ + kHIDUsage_BCS_GoodReadLampDuration = 0x7B, /* DV - Good Read Lamp Duration */ + kHIDUsage_BCS_GoodReadLampIntensity = 0x7C, /* DV - Good Read Lamp Intensity */ + kHIDUsage_BCS_GoodReadLED = 0x7D, /* DF - Good Read LED */ + kHIDUsage_BCS_GoodReadToneFrequency = 0x7E, /* DV - Good Read Tone Frequency*/ + kHIDUsage_BCS_GoodReadToneLength = 0x7F, /* DV - Good Read Tone Length */ + kHIDUsage_BCS_GoodReadToneVolume = 0x80, /* DV - Good Read Tone Volume */ + /* Reserved 0x81 */ + kHIDUsage_BCS_NoReadMessage = 0x82, /* DF - No Read Message */ + kHIDUsage_BCS_NotOnFileVolume = 0x83, /* DV - Not on File Volume */ + kHIDUsage_BCS_PowerupBeep = 0x84, /* DF - Powerup Beep */ + kHIDUsage_BCS_SoundErrorBeep = 0x85, /* DF - Sound Error Beep */ + kHIDUsage_BCS_SoundGoodReadBeep = 0x86, /* DF - Sound Good Read Beep */ + kHIDUsage_BCS_SoundNotOnFileBeep = 0x87, /* DF - Sound Not On File Beep */ + kHIDUsage_BCS_GoodReadWhenToWrite = 0x88, /* NArry - Good Read When to Write */ + kHIDUsage_BCS_GRWTIAfterDecode = 0x89, /* SEL - GRWTI After Decode */ + kHIDUsage_BCS_GRWTIBeep_LampAfterTransmit = 0x8A, /* SEL - GRWTI Beep/Lamp after transmit */ + kHIDUsage_BCS_GRWTINoBeep_LampUseAtAll = 0x8B, /* SEL - GRWTI No Beep/Lamp at all */ + /* Reserved 0x8C - 0x90 */ + kHIDUsage_BCS_BooklandEAN = 0x91, /* DF - Bookland EAN */ + kHIDUsage_BCS_ConvertEAN8To13Type = 0x92, /* DF - Convert EAN 8 to 13 Type */ + kHIDUsage_BCS_ConvertUPCAToEAN_13 = 0x93, /* DF - Convert UPC A to EAN-13 */ + kHIDUsage_BCS_ConvertUPC_EToA = 0x94, /* DF - Convert UPC-E to A */ + kHIDUsage_BCS_EAN_13 = 0x95, /* DF - EAN-13 */ + kHIDUsage_BCS_EAN_8 = 0x96, /* DF - EAN_8 */ + kHIDUsage_BCS_EAN_99_128_Mandatory = 0x97, /* DF - EAN-99 128_Mandatory */ + kHIDUsage_BCS_EAN_99_P5_128_Optional = 0x98, /* DF - EAN-99 P5/128_Optional */ + /* Reserved 0x99 */ + kHIDUsage_BCS_UPC_EAN = 0x9A, /* DF - UPC/EAN */ + kHIDUsage_BCS_UPC_EANCouponCode = 0x9B, /* DF - UPC/EAN Coupon Code */ + kHIDUsage_BCS_UPC_EANPeriodicals = 0x9C, /* DV - UPC/EAN Periodicals */ + kHIDUsage_BCS_UPC_A = 0x9D, /* DF - UPC-A */ + kHIDUsage_BCS_UPC_AWith128Mandatory = 0x9E, /* DF - UPC-A with 128 Mandatory */ + kHIDUsage_BCS_UPC_AWith128Optical = 0x9F, /* DF - UPC-A with 128 Optical */ + kHIDUsage_BCS_UPC_AWithP5Optional = 0xA0, /* DF - UPC-A with P5 Optional */ + kHIDUsage_BCS_UPC_E = 0xA1, /* DF - UPC-E */ + kHIDUsage_BCS_UPC_E1 = 0xA2, /* DF - UPC-E1 */ + /* Reserved 0xA3 - 0xA8 */ + kHIDUsage_BCS_Periodical = 0xA9, /* NArry - Periodical */ + kHIDUsage_BCS_PeriodicalAutoDiscriminatePlus2 = 0xAA,/* SEL - Periodical Auto-Discriminate + 2 */ + kHIDUsage_BCS_PeriodicalOnlyDecodeWithPlus2 = 0xAB, /* SEL - Periodical Only Decode with + 2 */ + kHIDUsage_BCS_PeriodicalIgnorePlus2 = 0xAC, /* SEL - Periodical Ignore + 2 */ + kHIDUsage_BCS_PeriodicalAutoDiscriminatePlus5 = 0xAD,/* SEL - Periodical Auto-Discriminate + 5 */ + kHIDUsage_BCS_PeriodicalOnlyDecodeWithPlus5 = 0xAE, /* SEL - Periodical Only Decode with + 5 */ + kHIDUsage_BCS_PeriodicalIgnorePlus5 = 0xAF, /* SEL - Periodical Ignore + 5 */ + kHIDUsage_BCS_Check = 0xB0, /* NArry - Check */ + kHIDUsage_BCS_CheckDisablePrice = 0xB1, /* SEL - Check Disable Price */ + kHIDUsage_BCS_CheckEnable4DigitPrice = 0xB2, /* SEL - Check Enable 4 digit Price */ + kHIDUsage_BCS_CheckEnable5DigitPrice = 0xB3, /* SEL - Check Enable 5 digit Price */ + kHIDUsage_BCS_CheckEnableEuropean4DigitPrice = 0xB4,/* SEL - Check Enable European 4 digit Price */ + kHIDUsage_BCS_CheckEnableEuropean5DigitPrice = 0xB5,/* SEL - Check Enable European 5 digit Price */ + /* Reserved 0xB6 */ + kHIDUsage_BCS_EANTwoLabel = 0xB7, /* DF - EAN Two Label */ + kHIDUsage_BCS_EANThreeLabel = 0xB8, /* DF - EAN Thread Label */ + kHIDUsage_BCS_EAN8FlagDigit1 = 0xB9, /* DV - EAN 8 Flag Digit 1 */ + kHIDUsage_BCS_EAN8FlagDigit2 = 0xBA, /* DV - EAN 8 Flag Digit 2 */ + kHIDUsage_BCS_EAN8FlagDigit3 = 0xBB, /* DV - EAN 8 Flag Digit 3 */ + kHIDUsage_BCS_EAN13FlagDigit1 = 0xBC, /* DV - EAN 13 Flag Digit 1 */ + kHIDUsage_BCS_EAN13FlagDigit2 = 0xBD, /* DV - EAN 13 Flag Digit 2 */ + kHIDUsage_BCS_EAN13FlagDigit3 = 0xBE, /* DV - EAN 13 Flag Digit 3 */ + kHIDUsage_BCS_AddEAN2_3LabelDefinition = 0xBF, /* DF - Add EAN 2/3 Label Definition */ + kHIDUsage_BCS_ClearAllEAN2_3LabelDefinitions = 0xC0,/* DF - Clear all EAN 2/3 Label Definitions */ + /* Reserved 0xC1 - 0xC2 */ + kHIDUsage_BCS_Codabar = 0xC3, /* DF - Codabar */ + kHIDUsage_BCS_Code128 = 0xC4, /* DF - Code 128 */ + /* Reserved 0xC5 - 0xC6 */ + kHIDUsage_BCS_Code39 = 0xC7, /* DF - Code 39 */ + kHIDUsage_BCS_Code93 = 0xC8, /* DF - Code 93 */ + kHIDUsage_BCS_FullASCIIConversion = 0xC9, /* DF - Full ASCII Conversion */ + kHIDUsage_BCS_Interleaved2of5 = 0xCA, /* DF - Interleaved 2 of 5 */ + kHIDUsage_BCS_ItalianPharmacyCode = 0xCB, /* DF - Italian Pharmacy Code */ + kHIDUsage_BCS_MSI_Plessey = 0xCC, /* DF - MSI/Plessey */ + kHIDUsage_BCS_Standard2of5IATA = 0xCD, /* DF - Standard 2 of 5 IATA */ + kHIDUsage_BCS_Standard2of5 = 0xCE, /* DF - Standard 2 of 5 */ + /* Reserved 0xCF - 0xD2 */ + kHIDUsage_BCS_TransmitStart_Stop = 0xD3, /* DF - Transmit Start/Stop */ + kHIDUsage_BCS_TriOptic = 0xD4, /* DF - Tri-Optic */ + kHIDUsage_BCS_UCC_EAN_128 = 0xD5, /* DF - UCC/EAN-128 */ + kHIDUsage_BCS_CheckDigit = 0xD6, /* NArry - Check Digit */ + kHIDUsage_BCS_CheckDigitDisable = 0xD7, /* SEL - Check Digit Disable */ + kHIDUsage_BCS_CheckDigitEnableInterleaved2of5OPCC = 0xD8, /* SEL - Check Digit Enable Interleaved 2 of 5 OPCC */ + kHIDUsage_BCS_CheckDigitEnableInterleaved2of5USS = 0xD9, /* SEL - Check Digit Enable Interleaved 2 of 5 USS */ + kHIDUsage_BCS_CheckDigitEnableStandard2of5OPCC = 0xD8, /* SEL - Check Digit Enable Standard 2 of 5 OPCC */ + kHIDUsage_BCS_CheckDigitEnableStandard2of5USS = 0xD9, /* SEL - Check Digit Enable Standard 2 of 5 USS */ + kHIDUsage_BCS_CheckDigitEnableOneMSIPlessey = 0xDC, /* SEL - Check Digit Enable One MSI Plessey */ + kHIDUsage_BCS_CheckDigitEnableTwoMSIPlessey = 0xDD, /* SEL - Check Digit Enable Two MSI Plessey */ + kHIDUsage_BCS_CheckDigitCodabarEnable = 0xDE, /* SEL - Check Digit Codabar Enable */ + kHIDUsage_BCS_CheckDigitCode99Enable = 0xDF, /* SEL - Check Digit Code 99 Enable */ + /* Reserved 0xE0 - 0xEF */ + kHIDUsage_BCS_TransmitCheckDigit = 0xF0, /* NArry - Transmit Check Digit */ + kHIDUsage_BCS_DisableCheckDigitTransmit = 0xF1, /* SEL - Disable Check Digit Transmit */ + kHIDUsage_BCS_EnableCheckDigitTransmit = 0xF2, /* SEL - Enable Check Digit Transmit */ + /* Reserved 0xF3 - 0xFA */ + kHIDUsage_BCS_SymbologyIdentifier1 = 0xFB, /* DV - Symbology Identifier 1 */ + kHIDUsage_BCS_SymbologyIdentifier2 = 0xFC, /* DV - Symbology Identifier 2 */ + kHIDUsage_BCS_SymbologyIdentifier3 = 0xFD, /* DV - Symbology Identifier 3 */ + kHIDUsage_BCS_DecodedData = 0xFE, /* DV - Decoded Data */ + kHIDUsage_BCS_DecodeDataContinued = 0xFF, /* DF - Decode Data Continued */ + kHIDUsage_BCS_BarSpaceData = 0x100, /* DV - Bar Space Data */ + kHIDUsage_BCS_ScannerDataAccuracy = 0x101, /* DV - Scanner Data Accuracy */ + kHIDUsage_BCS_RawDataPolarity = 0x102, /* NArry - Raw Data Polarity */ + kHIDUsage_BCS_PolarityInvertedBarCode = 0x103, /* SEL - Polarity Inverted Bar Code */ + kHIDUsage_BCS_PolarityNormalBarCode = 0x103, /* SEL - Polarity Normal Bar Code */ + /* Reserved 0x105 */ + kHIDUsage_BCS_MinimumLengthToDecode = 0x106, /* DV - Minimum Length to Decode */ + kHIDUsage_BCS_MaximumLengthToDecode = 0x107, /* DV - Maximum Length to Decode */ + kHIDUsage_BCS_FirstDiscreteLengthToDecode = 0x108, /* DV - First Discrete Length to Decode */ + kHIDUsage_BCS_SecondDiscreteLengthToDecode = 0x109, /* DV - Second Discrete Length to Decode */ + kHIDUsage_BCS_DataLengthMethod = 0x10A, /* NArry - Data Length Method */ + kHIDUsage_BCS_DLMethodReadAny = 0x10B, /* DF - DL Method Read any */ + kHIDUsage_BCS_DLMethodCheckInRange = 0x10C, /* DF - DL Method Check in Range */ + kHIDUsage_BCS_DLMethodCheckForDiscrete = 0x10D, /* DF - DL Method Check for Discrete */ + /* Reserved 0x10E - 0x10F */ + kHIDUsage_BCS_AztecCode = 0x110, /* DF - Aztec Code */ + kHIDUsage_BCS_BC412 = 0x111, /* DF - BC412 */ + kHIDUsage_BCS_ChannelCode = 0x112, /* DF - Channel Code */ + kHIDUsage_BCS_Code16 = 0x113, /* DF - Code 16 */ + kHIDUsage_BCS_Code32 = 0x114, /* DF - Code 32 */ + kHIDUsage_BCS_Code49 = 0x115, /* DF - Code 49 */ + kHIDUsage_BCS_CodeOne = 0x116, /* DF - Code One */ + kHIDUsage_BCS_Colorcode = 0x117, /* DF - Colorcode */ + kHIDUsage_BCS_DataMatrix = 0x118, /* DF - Data Matrix */ + kHIDUsage_BCS_MaxiCode = 0x119, /* DF - MaxiCode */ + kHIDUsage_BCS_MicroPDF = 0x11A, /* DF - MicroPDF */ + kHIDUsage_BCS_PDF_417 = 0x11B, /* DF - PDF-417 */ + kHIDUsage_BCS_PosiCode = 0x11C, /* DF - PosiCode */ + kHIDUsage_BCS_QRCode = 0x11D, /* DF - QR Code */ + kHIDUsage_BCS_SuperCode = 0x11E, /* DF - SuperCode */ + kHIDUsage_BCS_UltraCode = 0x11F, /* DF - UltraCode */ + kHIDUsage_BCS_USB_5_SlugCode = 0x120, /* DF - USD-5 (Slug Code) */ + kHIDUsage_BCS_VeriCode = 0x121 /* DF - VeriCode */ + /* Reserved 0x122 - 0xFFFF */ +}; + +/* Weighing Devices Page (0x8D) */ +/* This section provides detailed descriptions of the usages employed by Weighing Devices. */ +enum +{ + kHIDUsage_WD_Undefined = 0x00, /* Weighing Device Undefined Usage */ + kHIDUsage_WD_WeighingDevice = 0x01, /* CA - Weighing Device */ + /* Reserved 0x02 - 0x1F */ + kHIDUsage_WD_ScaleScaleDevice = 0x20, /* CL - Scale Device */ + kHIDUsage_WD_ScaleScaleClassIMetricCL = 0x21, /* CL - Scale Class I Metric */ + kHIDUsage_WD_ScaleScaleClassIMetric = 0x22, /* SEL - Scale Class I Metric */ + kHIDUsage_WD_ScaleScaleClassIIMetric = 0x23, /* SEL - Scale Class II Metric */ + kHIDUsage_WD_ScaleScaleClassIIIMetric = 0x24, /* SEL - Scale Class III Metric */ + kHIDUsage_WD_ScaleScaleClassIIILMetric = 0x25, /* SEL - Scale Class IIIL Metric */ + kHIDUsage_WD_ScaleScaleClassIVMetric = 0x26, /* SEL - Scale Class IV Metric */ + kHIDUsage_WD_ScaleScaleClassIIIEnglish = 0x27, /* SEL - Scale Class III English */ + kHIDUsage_WD_ScaleScaleClassIIILEnglish = 0x28, /* SEL - Scale Class IIIL English */ + kHIDUsage_WD_ScaleScaleClassIVEnglish = 0x29, /* SEL - Scale Class IV English */ + kHIDUsage_WD_ScaleScaleClassGeneric = 0x2A, /* SEL - Scale Class Generic */ + /* Reserved 0x2B - 0x2F */ + kHIDUsage_WD_ScaleAtrributeReport = 0x30, /* CL - Scale Attribute Report */ + kHIDUsage_WD_ScaleControlReport = 0x31, /* CL - Scale Control Report */ + kHIDUsage_WD_ScaleDataReport = 0x32, /* CL - Scale Data Report */ + kHIDUsage_WD_ScaleStatusReport = 0x33, /* CL - Scale Status Report */ + kHIDUsage_WD_ScaleWeightLimitReport = 0x34, /* CL - Scale Weight Limit Report */ + kHIDUsage_WD_ScaleStatisticsReport = 0x35, /* CL - Scale Statistics Report */ + /* Reserved 0x36 - 0x3F */ + kHIDUsage_WD_DataWeight = 0x40, /* DV - Data Weight */ + kHIDUsage_WD_DataScaling = 0x41, /* DV - Data Scaling */ + /* Reserved 0x42 - 0x4F */ + kHIDUsage_WD_WeightUnit = 0x50, /* CL - Weight Unit */ + kHIDUsage_WD_WeightUnitMilligram = 0x51, /* SEL - Weight Unit Milligram */ + kHIDUsage_WD_WeightUnitGram = 0x52, /* SEL - Weight Unit Gram */ + kHIDUsage_WD_WeightUnitKilogram = 0x53, /* SEL - Weight Unit Kilogram */ + kHIDUsage_WD_WeightUnitCarats = 0x54, /* SEL - Weight Unit Carats */ + kHIDUsage_WD_WeightUnitTaels = 0x55, /* SEL - Weight Unit Taels */ + kHIDUsage_WD_WeightUnitGrains = 0x56, /* SEL - Weight Unit Grains */ + kHIDUsage_WD_WeightUnitPennyweights = 0x57, /* SEL - Weight Unit Pennyweights */ + kHIDUsage_WD_WeightUnitMetricTon = 0x58, /* SEL - Weight Unit Metric Ton */ + kHIDUsage_WD_WeightUnitAvoirTon = 0x59, /* SEL - Weight Unit Avoir Ton */ + kHIDUsage_WD_WeightUnitTroyOunce = 0x5A, /* SEL - Weight Unit Troy Ounce */ + kHIDUsage_WD_WeightUnitOunce = 0x5B, /* SEL - Weight Unit Ounce */ + kHIDUsage_WD_WeightUnitPound = 0x5C, /* SEL - Weight Unit Pound */ + /* Reserved 0x5D - 0x5F */ + kHIDUsage_WD_CalibrationCount = 0x60, /* DV - Calibration Count */ + kHIDUsage_WD_RezeroCount = 0x61, /* DV - Re-Zero Count*/ + /* Reserved 0x62 - 0x6F */ + kHIDUsage_WD_ScaleStatus = 0x70, /* CL - Scale Status */ + kHIDUsage_WD_ScaleStatusFault = 0x71, /* SEL - Scale Status Fault */ + kHIDUsage_WD_ScaleStatusStableAtZero = 0x72, /* SEL - Scale Status Stable at Center of Zero */ + kHIDUsage_WD_ScaleStatusInMotion = 0x73, /* SEL - Scale Status In Motion */ + kHIDUsage_WD_ScaleStatusWeightStable = 0x74, /* SEL - Scale Status Weight Stable */ + kHIDUsage_WD_ScaleStatusUnderZero = 0x75, /* SEL - Scale Status Under Zero */ + kHIDUsage_WD_ScaleStatusOverWeightLimit = 0x76, /* SEL - Scale Status Over Weight Limit */ + kHIDUsage_WD_ScaleStatusRequiresCalibration = 0x77, /* SEL - Scale Status Requires Calibration */ + kHIDUsage_WD_ScaleStatusRequiresRezeroing = 0x78, /* SEL - Scale Status Requires Re-zeroing */ + /* Reserved 0x79 - 0x7F */ + kHIDUsage_WD_ZeroScale = 0x80, /* OOC - Zero Scale */ + kHIDUsage_WD_EnforcedZeroReturn = 0x81 /* OOC - Enforced Zero Return */ + /* Reserved 0x82 - 0xFFFF */ + +}; + +/* Magnetic Stripe Reader Page (0x8E) */ +/* This section provides detailed descriptions of the usages employed by Magnetic Stripe Reader Devices. */ +enum +{ + kHIDUsage_MSR_Undefined = 0x00, /* MagStripe Undefined Usage */ + kHIDUsage_MSR_DeviceReadOnly = 0x01, /* CA - MSR Device Read-Only */ + /* Reserved 0x02 - 0x10 */ + kHIDUsage_MSR_Track1Length = 0x11, /* SF, DF, SEL - Track 1 Length */ + kHIDUsage_MSR_Track2Length = 0x12, /* SF, DF, SEL - Track 2 Length */ + kHIDUsage_MSR_Track3Length = 0x13, /* SF, DF, SEL - Track 3 Length */ + kHIDUsage_MSR_TrackJISLength = 0x14, /* SF, DF, SEL - Track JIS Length */ + /* Reserved 0x15 - 0x1F */ + kHIDUsage_MSR_TrackData = 0x20, /* SF, DF, SEL - Track Data */ + kHIDUsage_MSR_Track1Data = 0x21, /* SF, DF, SEL - Track 1 Data */ + kHIDUsage_MSR_Track2Data = 0x22, /* SF, DF, SEL - Track 2 Data */ + kHIDUsage_MSR_Track3Data = 0x23, /* SF, DF, SEL - Track 3 Data */ + kHIDUsage_MSR_TrackJISData = 0x24 /* SF, DF, SEL - Track JIS Data */ + /* Reserved 0x25 - 0xFFFF */ +}; + +/* Camera Control Page (0x90) */ +enum +{ + kHIDUsage_CC_Undefined = 0x00, /* Camera Control Undefined Usage */ + /* Reserved 0x01 - 0x1F */ + kHIDUsage_CC_Autofocus = 0x20, /* One-Shot Control */ + kHIDUsage_CC_Shutter = 0x21, /* One-Shot Control */ +}; + +#endif /* _IOHIDUSAGETABLES_H */ diff --git a/QualcommWireless/include/IOKit/hid/IOHIDUtility.h b/QualcommWireless/include/IOKit/hid/IOHIDUtility.h new file mode 100644 index 0000000..fbb4e2b --- /dev/null +++ b/QualcommWireless/include/IOKit/hid/IOHIDUtility.h @@ -0,0 +1,81 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 2016 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef IOHIDUtility_h +#define IOHIDUtility_h + +#include +#include + +enum { + kKeyMaskCtrl = 0x0001, + kKeyMaskShift = 0x0002, + kKeyMaskAlt = 0x0004, + kKeyMaskCommand = 0x0008, + kKeyMaskPeriod = 0x0010, + kKeyMaskComma = 0x0020, + kKeyMaskSlash = 0x0040, + kKeyMaskEsc = 0x0080, + kKeyMaskFn = 0x0100, + kKeyMaskUnknown = 0x80000000 +}; + +struct Key { + uint64_t _value; + bool _modified; + Key ():_value(0), _modified(false){} + Key (uint32_t usagePage, uint32_t usage):_value(((uint64_t)usagePage << 32) | usage), _modified(false) {} + Key (uint32_t usagePage, uint32_t usage, bool modified):_value(((uint64_t)usagePage << 32) | usage), _modified(modified) {} + Key (uint64_t usageAndUsagePage): _value (usageAndUsagePage), _modified(false) {} + friend bool operator==(const Key &lhs, const Key &rhs) { + return (lhs._value == rhs._value); + } + friend bool operator<(const Key &lhs, const Key &rhs) { + return (lhs._value < rhs._value); + } + uint32_t usage () const {return ((uint32_t*)&_value)[0];} + uint32_t usagePage () const {return((uint32_t*)&_value)[1];} + bool isValid () const {return _value != 0;} + bool isModifier () const; + bool isTopRow () const { + bool result = false; + if ((usagePage() == kHIDPage_KeyboardOrKeypad) && + (((usage() >= kHIDUsage_Keyboard1) && (usage() <= kHIDUsage_Keyboard0)) || + (usage() == kHIDUsage_KeyboardHyphen) || + (usage() == kHIDUsage_KeyboardEqualSign) || + (usage() == kHIDUsage_KeyboardGraveAccentAndTilde) || + (usage() == kHIDUsage_KeyboardDeleteOrBackspace))) { + result = true; + } + return result; + } + +}; + +struct KeyAttribute { + uint32_t _flags; + KeyAttribute (uint32_t flags = 0):_flags(flags) {}; +}; + +#endif /* IOHIDUtility_h */ diff --git a/QualcommWireless/include/IOKit/hidsystem/IOHIDDescriptorParser.h b/QualcommWireless/include/IOKit/hidsystem/IOHIDDescriptorParser.h new file mode 100644 index 0000000..0c16bd5 --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/IOHIDDescriptorParser.h @@ -0,0 +1,996 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2012 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef __IOHIDDescriptorParser__ +#define __IOHIDDescriptorParser__ + +#define __iohid_deprecated(_msg) + +#if RTKIT +#include +#include +#include + +typedef uint8_t UInt8; +typedef int8_t Int8; +typedef uint32_t UInt32; +typedef int32_t SInt32; +typedef uint32_t IOByteCount; +typedef bool Boolean; +typedef SInt32 OSStatus; +typedef size_t vm_size_t; + +#else + +#include + +#if TARGET_OS_DRIVERKIT +#include +#include +#include + +typedef uint8_t UInt8; +typedef int8_t Int8; +typedef uint32_t UInt32; +typedef int32_t SInt32; +typedef unsigned char Boolean; +typedef SInt32 OSStatus; +typedef size_t vm_size_t; + +#else +#include +#endif + +#if __has_include() + #include +#endif + +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* End missing types and enums */ + + + +#if __has_include() + #include +#elif __has_include() + #include +#else +enum +{ + kHIDSuccess = 0, + +/* HID assigned error numbers are -13949 .. -13900 */ + kHIDBaseError = -13950, + + kHIDNullStateErr, + kHIDBufferTooSmallErr, + kHIDValueOutOfRangeErr, + kHIDUsageNotFoundErr, + kHIDNotValueArrayErr, + kHIDInvalidPreparsedDataErr, + kHIDIncompatibleReportErr, + kHIDBadLogPhysValuesErr, + kHIDInvalidReportTypeErr, + kHIDInvalidReportLengthErr, + kHIDNullPointerErr, + kHIDBadParameterErr, + kHIDNotEnoughMemoryErr, + kHIDEndOfDescriptorErr, + kHIDUsagePageZeroErr, + kHIDBadLogicalMinimumErr, + kHIDBadLogicalMaximumErr, + kHIDInvertedLogicalRangeErr, + kHIDInvertedPhysicalRangeErr, + kHIDUnmatchedUsageRangeErr, + kHIDInvertedUsageRangeErr, + kHIDUnmatchedStringRangeErr, + kHIDUnmatchedDesignatorRangeErr, + kHIDReportSizeZeroErr, + kHIDReportCountZeroErr, + kHIDReportIDZeroErr, + kHIDInvalidRangePageErr, + + // + // HID device driver errors + // + + kHIDDeviceNotReady = -13910, // The device is still initializing, try again later + kHIDVersionIncompatibleErr, +}; +#endif +// types of HID reports (input, output, feature) +enum +{ + kHIDInputReport = 1, + kHIDOutputReport, + kHIDFeatureReport, + kHIDUnknownReport = 255 +}; + +// flags passed to HIDOpenReportDescriptor +enum +{ + kHIDFlag_StrictErrorChecking = 0x00000001 +}; + +typedef UInt32 HIDReportType; +typedef UInt32 HIDUsage; + +typedef void *HIDPreparsedDataRef; + +/*! + @typedef HIDUsageAndPage + @abstract The HIDUsageAndPage data structure is used by HID clients when obtaining status of buttons to hold the usage page and usage of a button that is down. + @discussion Clients use the HIDUSageAndPage structure with the HIDGetButtonsEx function to obtain both the usage page and usage identifiers of each button that is down. + @field usage Specifies the usage identifier within the usage page specified by usagePage of a button that is down. + @field usagePage Specifies the usage page identifier of a button that is down. + */ +struct HIDUsageAndPage +{ + HIDUsage usage; + HIDUsage usagePage; +}; +typedef struct HIDUsageAndPage HIDUsageAndPage, *HIDUsageAndPagePtr; + +/*! + @typedef HIDCaps + @abstract The HIDCaps data structure is used by HID clients to hold the capabilities of a HID device. + @discussion This structure holds the parsed capabilities and data maximums returned for a device by the HIDGetCaps function. + @field usage Specifies the specific class of functionality that this device provides. This value is dependent and specific to the value provided in the usagePage field. For example, a keyboard could have a usagePage of kHIDUsagePage_Generic and a usage of kHIDUsage_Generic_Keyboard. + @field usagePage Specifies the usage page identifier for this top level collection. + @field inputReportByteLength Specifies the maximum length, in bytes, of an input report for this device, including the report ID which is unilaterally prepended to the device data. + @field outputReportByteLength Specifies the maximum length, in bytes, of an output report for this device, including the report ID which is unilaterally prepended to the device data. + @field featureReportByteLength Specifies the maximum length, in bytes, of a feature report for this device, including the report ID which is unilaterally prepended to the device data. + @field numberCollectionNodes Specifies the number of HIDCollectionNode structures that are returned for this top level collection by the HIDGetConnectionNodes function. + @field numberInputButtonCaps Specifies the number of input buttons. + @field numberInputValueCaps Specifies the number of input values. + @field numberOutputButtonCaps Specifies the number of output buttons. + @field numberOutputValueCaps Specifies the number of output values + @field numberFeatureButtonCaps Specifies the number of feature buttons. + @field numberFeatureValueCaps Specifies the number of feature values. + */ +struct HIDCaps +{ + HIDUsage usage; + HIDUsage usagePage; + IOByteCount inputReportByteLength; + IOByteCount outputReportByteLength; + IOByteCount featureReportByteLength; + UInt32 numberCollectionNodes; + UInt32 numberInputButtonCaps; + UInt32 numberInputValueCaps; + UInt32 numberOutputButtonCaps; + UInt32 numberOutputValueCaps; + UInt32 numberFeatureButtonCaps; + UInt32 numberFeatureValueCaps; +}; +typedef struct HIDCaps HIDCaps, * HIDCapsPtr; + +struct HIDCapabilities { + HIDUsage usage; + HIDUsage usagePage; + IOByteCount inputReportByteLength; + IOByteCount outputReportByteLength; + IOByteCount featureReportByteLength; + UInt32 numberCollectionNodes; + UInt32 numberInputButtonCaps; + UInt32 numberInputValueCaps; + UInt32 numberOutputButtonCaps; + UInt32 numberOutputValueCaps; + UInt32 numberFeatureButtonCaps; + UInt32 numberFeatureValueCaps; +}; +typedef struct HIDCapabilities HIDCapabilities, * HIDCapabilitiesPtr; + + +struct HIDCollectionNode +{ + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + UInt32 parent; + UInt32 numberOfChildren; + UInt32 nextSibling; + UInt32 firstChild; +}; +typedef struct HIDCollectionNode HIDCollectionNode, * HIDCollectionNodePtr; + +struct HIDButtonCaps +{ + HIDUsage usagePage; + UInt32 reportID; + UInt32 bitField; + UInt32 collection; + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + Boolean isRange; + Boolean isStringRange; + Boolean isDesignatorRange; + Boolean isAbsolute; + SInt32 startBit; // Added esb 9-29-99 + + union + { + struct + { + HIDUsage usageMin; + HIDUsage usageMax; + UInt32 stringMin; + UInt32 stringMax; + UInt32 designatorMin; + UInt32 designatorMax; + } range; + struct + { + HIDUsage usage; + HIDUsage reserved1; + UInt32 stringIndex; + UInt32 reserved2; + UInt32 designatorIndex; + UInt32 reserved3; + } notRange; + } u; +}; +typedef struct HIDButtonCaps HIDButtonCaps, * HIDButtonCapsPtr; + +struct HIDButtonCapabilities +{ + HIDUsage usagePage; + UInt32 reportID; + UInt32 bitField; + UInt32 collection; + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + Boolean isRange; + Boolean isStringRange; + Boolean isDesignatorRange; + Boolean isAbsolute; + + SInt32 unitExponent; // Added KH 1/25/01 + SInt32 units; // Added KH 1/25/01 +// UInt32 reserved; // Not added KH 1/25/01 + SInt32 startBit; // Added esb 9-29-99 + UInt32 pbVersion; // Added KH 1/25/01 + + union + { + struct + { + HIDUsage usageMin; + HIDUsage usageMax; + UInt32 stringMin; + UInt32 stringMax; + UInt32 designatorMin; + UInt32 designatorMax; + } range; + struct + { + HIDUsage usage; + HIDUsage reserved1; + UInt32 stringIndex; + UInt32 reserved2; + UInt32 designatorIndex; + UInt32 reserved3; + } notRange; + } u; +}; +typedef struct HIDButtonCapabilities HIDButtonCapabilities, * HIDButtonCapabilitiesPtr; + +struct HIDValueCaps +{ + HIDUsage usagePage; + UInt32 reportID; + UInt32 bitField; + UInt32 collection; + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + + Boolean isRange; + Boolean isStringRange; + Boolean isDesignatorRange; + Boolean isAbsolute; + + UInt32 startBit; // Added by esb 9-28-99 + UInt32 bitSize; + UInt32 reportCount; + + SInt32 logicalMin; + SInt32 logicalMax; + SInt32 physicalMin; + SInt32 physicalMax; + + union + { + struct + { + HIDUsage usageMin; + HIDUsage usageMax; + UInt32 stringMin; + UInt32 stringMax; + UInt32 designatorMin; + UInt32 designatorMax; + } range; + struct + { + HIDUsage usage; + HIDUsage reserved1; + UInt32 stringIndex; + UInt32 reserved2; + UInt32 designatorIndex; + UInt32 reserved3; + } notRange; + } u; +}; +typedef struct HIDValueCaps HIDValueCaps, * HIDValueCapsPtr; + +struct HIDValueCapabilities +{ + HIDUsage usagePage; + UInt32 reportID; + UInt32 bitField; + UInt32 collection; + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + + Boolean isRange; + Boolean isStringRange; + Boolean isDesignatorRange; + Boolean isAbsolute; + + UInt32 bitSize; + UInt32 reportCount; + + SInt32 logicalMin; + SInt32 logicalMax; + SInt32 physicalMin; + SInt32 physicalMax; + + SInt32 unitExponent; // Added KH 1/25/01 + SInt32 units; // Added KH 1/25/01 +// UInt32 reserved; // Not added KH 1/25/01 + SInt32 startBit; // Added esb 9-29-99 // Moved here KH 1/25/01 + UInt32 pbVersion; // Added KH 1/25/01 + + union + { + struct + { + HIDUsage usageMin; + HIDUsage usageMax; + UInt32 stringMin; + UInt32 stringMax; + UInt32 designatorMin; + UInt32 designatorMax; + } range; + struct + { + HIDUsage usage; + HIDUsage reserved1; + UInt32 stringIndex; + UInt32 reserved2; + UInt32 designatorIndex; + UInt32 reserved3; + } notRange; + } u; +}; +typedef struct HIDValueCapabilities HIDValueCapabilities, * HIDValueCapabilitiesPtr; + +/*! + @function HIDOpenReportDescriptor + @abstract The HIDOpenReportDescriptor function allocates the memory the parser needs to handle the given report descriptor, and then parses the report descriptor. + @discussion When the parsed information is no longer needed, clients should call the HIDCloseReportDescriptor function. + @param hidReportDescriptor Contains a pointer to the actual HID report descriptor from the USB device's firmware + @param descriptorLength The length of the HID report descriptor + @param preparsedDataRef Preparsed data reference to be used for subsequent function calls + @param flags Flags for this runction are kHIDFlag_StrictErrorChecking = 0x00000001 + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDOpenReportDescriptor (void * hidReportDescriptor, + IOByteCount descriptorLength, + HIDPreparsedDataRef * preparsedDataRef, + UInt32 flags); + +/*! + @function HIDCloseReportDescriptor + @abstract Disposes of the memory the parser allocated for the HIDOpenReportDescriptor function. + @param preparsedDataRef Preparsed data reference for the report that is returned by the HIDOpenReportDescriptor function. After making a call to the HIDCloseReportDescriptor function, the preparsedDataRef is invalid and should not be used. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDCloseReportDescriptor (HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetButtonCaps + @abstract Returns the button capabilities structures for a HID device based on the given preparsed data. + @param reportType Specifies the type of report for which to retrieve the scaled value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport + @param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCaps structures. The structures contain information for all buttons that meet the search criteria + @param buttonCapsSize Contains the size of the buttonCaps array passed in to the function and is set to the number of elements actually placed in the array after the call completes. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetButtonCaps (HIDReportType reportType, + HIDButtonCapsPtr buttonCaps, + UInt32 * buttonCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetButtonCapabilities + @abstract Returns the button capabilities structures for a HID device based on the given preparsed data. + @param reportType Specifies the type of report for which to retrieve the scaled value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport + @param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCapabilities structures. The structures contain information for all buttons that meet the search criteria + @param buttonCapsSize Contains the size of the buttonCaps array passed in to the function and is set to the number of elements actually placed in the array after the call completes. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetButtonCapabilities (HIDReportType reportType, + HIDButtonCapabilitiesPtr buttonCaps, + UInt32 * buttonCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetCaps + @abstract Returns the capabilities of a HID device based on the given preparsed data. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param capabilities Points to a caller allocated buffer, that upon return contains the parsed capability information for this HID device. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetCaps (HIDPreparsedDataRef preparsedDataRef, + HIDCapsPtr capabilities); + +/*! + @function HIDGetCapabilities + @abstract Returns the capabilities of a HID device based on the given preparsed data. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param capabilities Points to a caller allocated buffer, that upon return contains the parsed capability information for this HID device. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetCapabilities (HIDPreparsedDataRef preparsedDataRef, + HIDCapabilitiesPtr capabilities); + +/*! + @function HIDGetCollectionNodes + @abstract Returns an array of HIDCollectionNode structures that describe the relationships and layout of the link collections within this top level collection. + @discussion The length of the buffer required, in array elements, for an entire collection node array is found in the HIDCaps structure member numberCollectionNodes. You obtain the HIDCaps information by calling the HIDGetCaps function. For information on the relationships of link collections described by the data returned from this routine, see the descripton of the HIDCollectionNode structure. + @param collectionNodes Points to a caller-allocated array of HIDCollectionNode structures in which this routine returns an entry for each collection within the top level collection. A collection is a group of corresponding HID descriptors containing input, output, and feature items that have some common relationship to one another. For example, a pointer collection contains items for x and y position data, and button data. + @param collectionNodesSize On input, specifies the length in array elements of the buffer provided at collectionNodes. On output, this parameter is set to the number of entries in the collectionNodes array that were initialized. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetCollectionNodes (HIDCollectionNodePtr collectionNodes, + UInt32 * collectionNodesSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetScaledUsageValue + @abstract The HIDGetScaledUsageValue function returns the capabilities for all buttons for a given top level collection. + @discussion Clients who which to obtain all capabilities for a usage that contains multiple data items for a single usage that corresponds to a HID byte array, must call the HIDGetUsageValueArray function. + @param reportType Specifies the type of report for which to retrieve the scaled value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page of the value to be retrieved. + @param collection Optionally specifies the link collection identifier of the value to be retrieved. + @param usage Specifies the usage of the scaled value to be retrieved. + @param usageValue Points to a variable, that on return from this routine holds the scaled value retrieved from the device report. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data + @param reportLength Specifies the length, in bytes, of the report data provided at report + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetScaledUsageValue (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + SInt32 * usageValue, + HIDPreparsedDataRef preparsedDataRef, + void * report, + IOByteCount reportLength); + +/*! + @function HIDGetSpecificButtonCaps + @abstract Retrieves the capabilities for all buttons in a specific type of report that meet the search criteria. + @discussion The HIDGetSpecificButtonCaps function retrieves capability data for buttons that meet a given search criteria, as opposed to the HIDGetButtonCaps function which returns the capability data for all buttons on the device. Calling this routine specifying zero for usagePage, usage and collection is equivalent to calling the HIDGetButtonCaps function. + @param reportType Specifies the type of report for which to retrieve the button capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only buttons that specify this usage page will be retrieved. + @param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only buttons that are part of the specified link collection are retrieved. + @param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only buttons that match the value specified are retrieved. + @param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCaps structures. The structures contain information for all buttons that meet the search criteria. + @param buttonCapsSize On input, specifies the length, in array elements, of the buffer provided in the buttonCaps parameter. On output, this parameter is set to the actual number of elements that were returned by the function call, in the buffer provided in the buttonCaps parameter, if the routine completed without error. The correct length necessary to retrieve the button capabilities can be found in the capability data returned for the device by the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetSpecificButtonCaps (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDButtonCapsPtr buttonCaps, + UInt32 * buttonCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetSpecificButtonCapabilities + @abstract Retrieves the capabilities for all buttons in a specific type of report that meet the search criteria. + @discussion The HIDGetSpecificButtonCapabilities function retrieves capability data for buttons that meet a given search criteria, as opposed to the HIDGetButtonCapabilities function which returns the capability data for all buttons on the device. Calling this routine specifying zero for usagePage, usage and collection is equivalent to calling the HIDGetButtonCapabilities function. + @param reportType Specifies the type of report for which to retrieve the button capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only buttons that specify this usage page will be retrieved. + @param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only buttons that are part of the specified link collection are retrieved. + @param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only buttons that match the value specified are retrieved. + @param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCapabilities structures. The structures contain information for all buttons that meet the search criteria. + @param buttonCapsSize On input, specifies the length, in array elements, of the buffer provided in the buttonCaps parameter. On output, this parameter is set to the actual number of elements that were returned by the function call, in the buffer provided in the buttonCaps parameter, if the routine completed without error. The correct length necessary to retrieve the button capabilities can be found in the capability data returned for the device by the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetSpecificButtonCapabilities (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDButtonCapabilitiesPtr buttonCaps, + UInt32 * buttonCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetSpecificValueCaps + @abstract Retrieves the capabilities for all values in a specific type of report that meet the search criteria. + @discussion The HIDGetSpecificValueCaps function retrieves capability data for values that meet given search criteria, as opposed to the HIDGetValueCaps function, which returns the capability data for all values on the device. Calling this routine with a value of zero for usagePage, usage and collection parameters is equivalent to calling the HIDGetValueCaps function. + @param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport. + @param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage page will be retrieved. + @param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only values that are part of this link collection will be retrieved. + @param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage will be retrieved. + @param valueCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDValueCaps structures that contain information for all values that meet the search criteria. + @param valueCapsSize Specifies the length on input, in array elements, of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned by this function call, in the buffer provided in the valueCaps parameter, if the routine completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device from the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetSpecificValueCaps (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDValueCapsPtr valueCaps, + UInt32 * valueCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetSpecificValueCapabilities + @abstract Retrieves the capabilities for all values in a specific type of report that meet the search criteria. + @discussion The HIDGetSpecificValueCapabilities function retrieves capability data for values that meet given search criteria, as opposed to the HIDGetValueCapabilities function, which returns the capability data for all values on the device. Calling this routine with a value of zero for usagePage, usage and collection parameters is equivalent to calling the HIDGetValueCapabilities function. + @param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport. + @param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage page will be retrieved. + @param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only values that are part of this link collection will be retrieved. + @param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage will be retrieved. + @param valueCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDValueCapabilities structures that contain information for all values that meet the search criteria. + @param valueCapsSize Specifies the length on input, in array elements, of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned by this function call, in the buffer provided in the valueCaps parameter, if the routine completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device from the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetSpecificValueCapabilities (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDValueCapabilitiesPtr valueCaps, + UInt32 * valueCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetButtonsOnPage + @abstract Retrieves the button stat information for buttons on a specified usage page. + @param reportType Specifies the type of report, provided in the report parameter, from which to retrieve the buttons. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport. + @param usagePage Specifies the usage page of the buttons for which to retrieve the current state. + @param collection Optionally specifies the link collection identifier used to retrieve only specific button states. If this value is non-zero, only the buttons that are part of the given collection are returned. + @param usageList On return, points to a caller-allocated buffer that contains the usages of all the buttons that are perssed and belong to the usage page specified in the usagePage parameter. + @param usageListSize Is the size, in array elements, of the buffer provided in the usageList parameter. On return, this parameter contains the number of button states that were set by this routine. If the error kHIDBufferTooSmallErr was returned, this parameter contains the number of array elements required to hold all button data requested. The maximum number of buttons that can ever be returned for a given type of report can be obtained by calling the HIDMaxUsageListLength function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetButtonsOnPage (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage * usageList, + UInt32 * usageListSize, + HIDPreparsedDataRef preparsedDataRef, + void * report, + IOByteCount reportLength); + +/*! + @function HIDGetButtons + @abstract The HIDGetButtons function takes a report from a HID device and gets the current state of the buttons in that report. + @param reportType Specifies the type of report, provided in the report parameter, from which to retrieve the buttons. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport + @param collection Optionally specifies the link collection identifier used to retrieve only specific button states. If this value is non-zero, only the buttons that are part of the given collection are returned. + @param usageList On return, points to a caller-allocated buffer that contains the usages of all the buttons that are pressed. + @param usageListSize Is the size, in array elements, of the buffer provided in the usageList parameter. On return, this parameter contains the number of button states that were set by this routine. If the error kHIDBufferToSmallErr was returned, this parameter contains the number of array elements required to hold all button data requested. The maximum number of buttons that can ever be returned for a given type of report can be obtained by calling the HIDMaxUsageListLength function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the length, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetButtons (HIDReportType reportType, + UInt32 collection, + HIDUsageAndPagePtr usageList, + UInt32 * usageListSize, + HIDPreparsedDataRef preparsedDataRef, + void * report, + IOByteCount reportLength); + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetNextButtonInfo (HIDReportType reportType, + HIDUsage usagePage, + HIDUsage usage, + UInt32 * collection, + UInt8 * reportID, + HIDPreparsedDataRef preparsedDataRef); + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetNextUsageValueInfo (HIDReportType reportType, + HIDUsage usagePage, + HIDUsage usage, + UInt32 * collection, + UInt8 * reportID, + HIDPreparsedDataRef preparsedDataRef); + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetReportLength (HIDReportType reportType, + UInt8 reportID, + IOByteCount *reportLength, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetUsageValue + @abstract The HIDGetUsageValue function returns a value from a device data report given a selected search criteria. + @discussion The HIDGetUsageValue function does not sign the value. To have the sign bit automatically applied, use the HIDGetScaledUsageValue function instead. For manually assigning the sign bit, the position of the sign bit can be found in the HIDValueCaps structure for this value. Clients who wish to obtain all data for a usage that contains multiple data items for a single usage, corresponding to a HID byte array, must call the HIDGetUsageValueArray function instead. + @param reportType Specifies the type of report, provided in report, from which to retrieve the value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page of the value to retrieve. + @param collection Optionally specifies the link collection identifier of the value to be retrieved. + @param usage Specifies the usage of the value to be retrieved. + @param usageValue Points to a variable, that on return from this routine holds the value retrieved from the device report. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetUsageValue (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + SInt32 * usageValue, + HIDPreparsedDataRef preparsedDataRef, + void * report, + IOByteCount reportLength); + +/*! + @function HIDGetUsageValueArray + @abstract The HIDGetUsageValueArray function returns a value from a device data report given a selected search criteria. + @discussion When the HIDGetUsageValueArray function retrieves the data, it fills in the buffer in little-endian order beginning with the least significant bit of the data for this usage. The data is filled in without regard to byte alignment and is shifted such that the least significant bit is placed as the 1st bit of the given buffer. + @param reportType Specifies the type of report, provided in report, from which to retrieve the value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page of the data to be retrieved. + @param collection Optionally specifies the link collection identifier of the data to be retrieved. + @param usage Specifies the usage identifier of the value to be retrieved. + @param usageValueBuffer Points to a caller-allocated buffer that contains, on output, the data from the device. The correct length for this buffer can be found by multiplying the reportCount and bitSize fields of the HIDValueCaps structure for the value and rounding the resulting value up to the nearest byte. + @param usageValueBufferSize Specifies the size, in bytes, of the buffer in the usageValueBuffer parameter. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in report. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetUsageValueArray (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + UInt8 * usageValueBuffer, + IOByteCount usageValueBufferSize, + HIDPreparsedDataRef preparsedDataRef, + void * report, + IOByteCount reportLength); + +/*! + @function HIDGetValueCaps + @abstract The HIDGetValueCaps function retrieves the capabilities for all values for a specified top level collection. + @discussion The HIDGetValueCaps function retrieves the capability data for all values in a top level collection without regard for the usage, usage page or collection of the value. To retrieve value capabilities for a specific usage, usage page or collection, use the HIDGetSpecificValueCaps function. + @param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param valueCaps On return, points to a caller-allocated buffer that contains an array of HIDValueCaps structures containing information for all values in the top level collection. + @param valueCapsSize On input, specifies the size in array elements of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned in the buffer provided in the valueCaps parameter, if the function completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device by the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetValueCaps (HIDReportType reportType, + HIDValueCapsPtr valueCaps, + UInt32 * valueCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetValueCapabilities + @abstract The HIDGetValueCapabilities function retrieves the capabilities for all values for a specified top level collection. + @discussion The HIDGetValueCapabilities function retrieves the capability data for all values in a top level collection without regard for the usage, usage page or collection of the value. To retrieve value capabilities for a specific usage, usage page or collection, use the HIDGetSpecificValueCapabilities function. + @param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param valueCaps On return, points to a caller-allocated buffer that contains an array of HIDValueCapabilities structures containing information for all values in the top level collection. + @param valueCapsSize On input, specifies the size in array elements of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned in the buffer provided in the valueCaps parameter, if the function completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device by the HIDGetCapabilities function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDGetValueCapabilities (HIDReportType reportType, + HIDValueCapabilitiesPtr valueCaps, + UInt32 * valueCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDInitReport (HIDReportType reportType, + UInt8 reportID, + HIDPreparsedDataRef preparsedDataRef, + void * report, + IOByteCount reportLength); + +/*! + @function HIDMaxUsageListLength + @abstract The HIDMaxUsageListLength function returns the maximum number of buttons that can be returned from a given report type for the top level collection. + @param reportType Specifies the type of report for which to get a maximum usage count. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Optionally specifies the usage page identifier to use as a search criteria. If this parameter is zero, the function returns the number of buttons for the entire top-level collection regardless of the actual value of the usage page. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +UInt32 +HIDMaxUsageListLength (HIDReportType reportType, + HIDUsage usagePage, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDSetScaledUsageValue + @abstract The HIDSetScaledUsageValue function takes a signed physical (scaled) number and converts it to the logical, or device representation and inserts it in a given report. + @discussion The HIDSetScaledUsageValue function automatically handles the setting of the signed bit in the data to be sent to the device. + @param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between values that have the same usage page and usage identifiers. If this parameter is zero, it will be ignored. + @param usage Specifies the usage identifier of the value to be set in the report. + @param usageValue Specifies the physical, or scaled, value to be set in the value for the given report. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the length, in bytes of the report data specified in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDSetScaledUsageValue (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + SInt32 usageValue, + HIDPreparsedDataRef preparsedDataRef, + void * report, + IOByteCount reportLength); + +/*! + @function HIDSetButtons + @abstract The HIDSetButtons function takes a report from a HID device and returns the current state of the buttons in that report. + @param reportType Specifies the type of repor. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between buttons. If this parameter is zero, it is ignored. + @param usageList Points to a caller-allocated buffer that contains an array of button data to be set in the report in the report parameter. + @param usageListSize Specifies the size, in array elements, of the buffer provided in the usageList parameter. If an error is returned by a call to this function, the usageListLength parameter contains the location in the array provided in the usageList parameter where the error was encountered. All array entries encountered prior to the error location were successfully set in the report provided in the report parameter. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDSetButtons (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage * usageList, + UInt32 * usageListSize, + HIDPreparsedDataRef preparsedDataRef, + void * report, + IOByteCount reportLength); + +/*! + @function HIDSetUsageValue + @abstract The HIDSetUsageValue function sets a value in a give report. + @discussion The HIDSetUsageVlaue function does not automatically handle the sign bit. Clients must either manually set the sign bit, at the position provided in the HIDValueCaps structure for this value, or call the HIDSetScaledUsageValue function. + @param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between values that have the same usage page and usage identifiers. If this parameter is zero, it is ignored. + @param usage Specifies the usage identifier of the value to be set in the report. + @param usageValue Specifies the data that is to be set in the value for the given report. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDSetUsageValue (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + SInt32 usageValue, + HIDPreparsedDataRef preparsedDataRef, + void * report, + IOByteCount reportLength); + +/*! + @function HIDSetUsageValueArray + @abstract The HIDSetUsageValueArray function sets an array of values in a given report. + @discussion The HIDSetUsageValue function does not automatically handle the sign bit. Clients must either manually set the sign bit, at the position provided in the HIDValueCaps structure for this value, or call the HIDSetScaledUsageValue function. + @param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between values that have the same usage page and usage identifiers. If this parameter is zero, it is ignored. + @param usage Specifies the usage identifier of the value to be set in the report. + @param usageValueBuffer Points to a caller-allocated buffer that contains, on output, the data from the device. The correct length for this buffer can be found by multiplying the reportCount and bitSize fields of the HIDValueCaps structure for this value and rounding the resulting value up to the nearest byte. + @param usageValueBufferLength Specifies the size, in bytes, of the buffer in the usageValueBuffer parameter. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDSetUsageValueArray (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + UInt8 * usageValueBuffer, + IOByteCount usageValueBufferLength, + HIDPreparsedDataRef preparsedDataRef, + void * report, + IOByteCount reportLength); + +/*! + @function HIDUsageListDifference + @abstract The HIDUsageListDifference function compares and provides the differences between two lists of buttons. + @param previousUsageList Points to the older button list to be used for comparison. + @param currentUsageList Points to the newer button list to be used for comparison. + @param breakUsageList On return, points to a caller-allocated buffer that contains the buttons set in the older list, specified in the previousUsageList parameter, but not set in the new list, specified in the currentUsageList parameter. + @param makeUsageList On return, points to a caller-allocated buffer that contains the buttons set in the new list, specified in the currentUsageList parameter, but not set in the old list, specified in the previousUsageList parameter. + @param usageListsSize Specifies the length, in array elements, of the buffers provided in the currentUsageList and previousUssageList parameters. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDUsageListDifference (HIDUsage * previousUsageList, + HIDUsage * currentUsageList, + HIDUsage * breakUsageList, + HIDUsage * makeUsageList, + UInt32 usageListsSize); + +/*! + @function HIDSetButton + @abstract The HIDSetButton function takes a report from a HID device and sets the current state of the specified button in that report. + @param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between buttons. If this parameter is zero, it is ignored. + @param usage Points to a caller-allocated buffer that contains the button data to be set in the report in the report parameter. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +__iohid_deprecated("Use DriverKit") +extern +OSStatus +HIDSetButton (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDPreparsedDataRef preparsedDataRef, + void * report, + IOByteCount reportLength); + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/QualcommWireless/include/IOKit/hidsystem/IOHIDParameter.h b/QualcommWireless/include/IOKit/hidsystem/IOHIDParameter.h new file mode 100644 index 0000000..c805123 --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/IOHIDParameter.h @@ -0,0 +1,349 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * evsio.h - Get/Set parameter calls for Event Status Driver. + * + * CAUTION: Developers should stick to the API exported in + * to guarantee + * binary compatability of their applications in future + * releases. + * + * HISTORY + * 22 May 1992 Mike Paquette at NeXT + * Created. + */ +#ifndef _DEV_EVSIO_H +#define _DEV_EVSIO_H + +/* Public type definitions. */ +#include +#include +#include + +/* + * Identify this driver as one that uses the new driverkit and messaging API + */ +#ifndef _NeXT_MACH_EVENT_DRIVER_ +#define _NeXT_MACH_EVENT_DRIVER_ (1) +#endif /* !_NeXT_MACH_EVENT_DRIVER_ */ + +/* * */ + +#define kIOHIDKindKey "HIDKind" +#define kIOHIDInterfaceIDKey "HIDInterfaceID" +#define kIOHIDSubinterfaceIDKey "HIDSubinterfaceID" +#define kIOHIDOriginalSubinterfaceIDKey "HIDOriginalSubinterfaceID" + +#define kIOHIDParametersKey "HIDParameters" + +#define kIOHIDVirtualHIDevice "HIDVirtualDevice" + +#define kIOHIDKeyRepeatKey "HIDKeyRepeat" +#define kIOHIDInitialKeyRepeatKey "HIDInitialKeyRepeat" +#define kIOHIDKeyMappingKey "HIDKeyMapping" +#define kIOHIDResetKeyboardKey "HIDResetKeyboard" + +#define kIOHIDKeyboardModifierMappingPairsKey "HIDKeyboardModifierMappingPairs" +#define kIOHIDKeyboardModifierMappingSrcKey "HIDKeyboardModifierMappingSrc" +#define kIOHIDKeyboardModifierMappingDstKey "HIDKeyboardModifierMappingDst" + +#define kIOHIDKeyboardCapsLockDoesLockKey "HIDKeyboardCapsLockDoesLock" +#define kIOHIDKeyboardSupportsF12EjectKey "HIDKeyboardSupportsF12Eject" +#define kIOHIDKeyboardSupportedModifiersKey "HIDKeyboardSupportedModifiers" +#define kIOHIDKeyboardGlobalModifiersKey "HIDKeyboardGlobalModifiers" + + +//read only property that specify usage of clobal modifiers +// Bit[0] - Report modifiers to the service by setting kIOHIDKeyboardGlobalModifiersKey with global modifiers +// Bit[1] - Update/translate events from service taking global modifiers state in consideration +#define kIOHIDServiceGlobalModifiersUsageKey "HIDServiceGlobalModifiersUsage" + + +#define kIOHIDPointerResolutionKey "HIDPointerResolution" +#define kIOHIDResetPointerKey "HIDResetPointer" +#define kIOHIDPointerConvertAbsoluteKey "HIDPointerConvertAbsolute" +#define kIOHIDPointerContactToMoveKey "HIDPointerContactToMove" +#define kIOHIDPointerPressureToClickKey "HIDPointerPressureToClick" +#define kIOHIDPointerButtonCountKey "HIDPointerButtonCount" + +#define kIOHIDPointerAccelerationSettingsKey "HIDPointerAccelerationSettings" +#define kIOHIDPointerAccelerationTableKey "HIDPointerAccelerationTable" + +// velocity for pointer acceleration +#define kIOHIDPointerAccelerationMultiplierKey "HIDPointerAccelerationMultiplier" + + +#define kIOHIDScrollResetKey "HIDScrollReset" +#define kIOHIDScrollResolutionKey "HIDScrollResolution" +#define kIOHIDScrollReportRateKey "HIDScrollReportRate" +#define kIOHIDScrollAccelerationTableKey "HIDScrollAccelerationTable" + +#define kIOHIDScrollResolutionXKey "HIDScrollResolutionX" +#define kIOHIDScrollResolutionYKey "HIDScrollResolutionY" +#define kIOHIDScrollResolutionZKey "HIDScrollResolutionZ" + +#define kIOHIDScrollAccelerationTableXKey "HIDScrollAccelerationTableX" +#define kIOHIDScrollAccelerationTableYKey "HIDScrollAccelerationTableY" +#define kIOHIDScrollAccelerationTableZKey "HIDScrollAccelerationTableZ" + +#define kIOHIDScrollMouseButtonKey "HIDScrollMouseButton" + +#define kIOHIDScrollZoomModifierMaskKey "HIDScrollZoomModifierMask" + +#define kIOHIDTrackpadScrollAccelerationKey "HIDTrackpadScrollAcceleration" + +#define kIOHIDTrackpadAccelerationType "HIDTrackpadAcceleration" + +#define kIOHIDClickTimeKey "HIDClickTime" +#define kIOHIDClickSpaceKey "HIDClickSpace" + +#define kIOHIDWaitCursorFrameIntervalKey "HIDWaitCursorFrameInterval" + +#define kIOHIDAutoDimThresholdKey "HIDAutoDimThreshold" +#define kIOHIDAutoDimStateKey "HIDAutoDimState" +#define kIOHIDAutoDimTimeKey "HIDAutoDimTime" +#define kIOHIDIdleTimeKey "HIDIdleTime" + +#define kIOHIDBrightnessKey "HIDBrightness" +#define kIOHIDAutoDimBrightnessKey "HIDAutoDimBrightness" + +#define kIOHIDFKeyModeKey "HIDFKeyMode" + +// if kIOHIDStickyKeysDisabledKey is 1, then all sticky keys functionality +// is completely turned off. Multiple shifts will have no effect. +#define kIOHIDStickyKeysDisabledKey "HIDStickyKeysDisabled" + +// if kIOHIDStickyKeysOnKey is 1 then a depressed modifier will stay down +// until a non-modifer key is pressed (or sticky keys is turned off) +#define kIOHIDStickyKeysOnKey "HIDStickyKeysOn" + +// if kIOHIDStickyKeysShiftTogglesKey is 1, then a sequence of five +// shift keys in sequence will toggle sticky keys on or off +#define kIOHIDStickyKeysShiftTogglesKey "HIDStickyKeysShiftToggles" + +// +// +#define kIOHIDResetStickyKeyNotification "HIDResetStickyKeyNotification" + +// if kIOHIDMouseKeysOptionTogglesKey is 1, then a sequence of five +// option keys in sequence will toggle mouse keys on or off +#define kIOHIDMouseKeysOptionTogglesKey "HIDMouseKeysOptionToggles" + +// kIOHIDSlowKeysDelayKey represents the delay used for slow keys. +// if kIOHIDSlowKeysDelayKey is 0, then slow keys off +#define kIOHIDSlowKeysDelayKey "HIDSlowKeysDelay" + +#define kIOHIDF12EjectDelayKey "HIDF12EjectDelay" + +#define kIOHIDMouseKeysOnKey "HIDMouseKeysOn" + +#define kIOHIDUseKeyswitchKey "HIDUseKeyswitch" + +#define kIOHIDDisallowRemappingOfPrimaryClickKey "HIDDisallowRemappingOfPrimaryClick" +#define kIOHIDMouseKeysEnablesVirtualNumPadKey "HIDMouseKeysEnablesVirtualNumPad" + +#define kIOHIDResetLEDsKey "HIDResetLEDs" + +// Parametric Acceleration Keys +#define kHIDAccelParametricCurvesKey "HIDAccelCurves" +#define kHIDPointerReportRateKey "HIDPointerReportRate" +#define kHIDTrackingAccelParametricCurvesKey "HIDTrackingAccelCurves" +#define kHIDScrollAccelParametricCurvesKey "HIDScrollAccelCurves" +#define kHIDAccelParametricCurvesDebugKey "HIDAccelCurvesDebug" +#define kHIDScrollAccelParametricCurvesDebugKey "HIDScrollAccelCurvesDebug" +#define kHIDAccelGainLinearKey "HIDAccelGainLinear" +#define kHIDAccelGainParabolicKey "HIDAccelGainParabolic" +#define kHIDAccelGainCubicKey "HIDAccelGainCubic" +#define kHIDAccelGainQuarticKey "HIDAccelGainQuartic" +#define kHIDAccelTangentSpeedLinearKey "HIDAccelTangentSpeedLinear" +#define kHIDAccelTangentSpeedParabolicRootKey "HIDAccelTangentSpeedParabolicRoot" +#define kHIDAccelTangentSpeedCubicRootKey "HIDAccelTangentSpeedCubicRoot" +#define kHIDAccelTangentSpeedQuarticRootKey "HIDAccelTangentSpeedQuarticRoot" +#define kHIDAccelIndexKey "HIDAccelIndex" + +// Scroll Count Keys +#define kIOHIDScrollCountMaxTimeDeltaBetweenKey "HIDScrollCountMaxTimeDeltaBetween" +#define kIOHIDScrollCountMaxTimeDeltaToSustainKey "HIDScrollCountMaxTimeDeltaToSustain" +#define kIOHIDScrollCountMinDeltaToStartKey "HIDScrollCountMinDeltaToStart" +#define kIOHIDScrollCountMinDeltaToSustainKey "HIDScrollCountMinDeltaToSustain" +#define kIOHIDScrollCountIgnoreMomentumScrollsKey "HIDScrollCountIgnoreMomentumScrolls" +#define kIOHIDScrollCountMouseCanResetKey "HIDScrollCountMouseCanReset" +#define kIOHIDScrollCountMaxKey "HIDScrollCountMax" +#define kIOHIDScrollCountAccelerationFactorKey "HIDScrollCountAccelerationFactor" +#define kIOHIDScrollCountZeroKey "HIDScrollCountZero" +#define kIOHIDScrollCountBootDefaultKey "HIDScrollCountBootDefault" +#define kIOHIDScrollCountResetKey "HIDScrollCountReset" + +// HIDSystem Property Key + +// Mark user activity state on HID System +#define kIOHIDActivityUserIdleKey "IOHIDActivityUserIdle" + +// the following values are used in kIOHIDPointerButtonMode +typedef enum { + kIOHIDButtonMode_BothLeftClicks = 0, + kIOHIDButtonMode_ReverseLeftRightClicks = 1, + kIOHIDButtonMode_EnableRightClick = 2 +} IOHIDButtonModes; + +#ifdef _undef +#define EVS_PREFIX "Evs_" /* All EVS calls start with this string */ + +/* WaitCursor-related ioctls */ + +#define EVSIOSWT "Evs_SetWaitThreshold" +#define EVSIOSWT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSWS "Evs_SetWaitSustain" +#define EVSIOSWS_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSWFI "Evs_SetWaitFrameInterval" +#define EVSIOSWFI_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOCWINFO "Evs_CurrentWaitCursorInfo" +#define EVSIOCWINFO_THRESH 0 +#define EVSIOCWINFO_SUSTAIN (EVSIOCWINFO_THRESH + EVS_PACKED_TIME_SIZE) +#define EVSIOCWINFO_FINTERVAL (EVSIOCWINFO_SUSTAIN + EVS_PACKED_TIME_SIZE) +#define EVSIOCWINFO_SIZE (EVSIOCWINFO_FINTERVAL + EVS_PACKED_TIME_SIZE) +#endif + +#define EVS_PACKED_TIME_SIZE (sizeof(UInt64) / sizeof( unsigned int)) + +/* Device control ioctls. Levels specified may be in the range 0 - 64. */ + +#define EVSIOSB kIOHIDBrightnessKey +#define EVSIOSB_SIZE 1 + +#define EVSIOSADB kIOHIDAutoDimBrightnessKey +#define EVSIOSADB_SIZE 1 + +#ifdef _undef +#define EVSIOSA "Evs_SetAttenuation" +#define EVIOSA_SIZE 1 + +#define EVSIO_DCTLINFO "Evs_DeviceControlInfo" +typedef enum { + EVSIO_DCTLINFO_BRIGHT, + EVSIO_DCTLINFO_ATTEN, + EVSIO_DCTLINFO_AUTODIMBRIGHT +} evsio_DCTLINFOIndices; +#define EVSIO_DCTLINFO_SIZE (EVSIO_DCTLINFO_AUTODIMBRIGHT + 1) +#endif + +/* + * Device status request + */ +#define EVSIOINFO NX_EVS_DEVICE_INFO + + +/* Keyboard-related ioctls - implemented within Event Sources */ + +#define EVSIOSKR kIOHIDKeyRepeatKey +#define EVSIOSKR_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSIKR kIOHIDInitialKeyRepeatKey +#define EVSIOSIKR_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIORKBD kIOHIDResetKeyboardKey +#define EVSIORKBD_SIZE 1 + +#define EVSIOCKR_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOCKML kIOHIDKeyMappingKey +#define EVSIOCKML_SIZE 1 + +/* The following two tokens are for use with the get/set character routines. */ +#define EVSIOSKM kIOHIDKeyMappingKey +#define EVSIOSKM_SIZE 4096 + +#define EVSIOCKM kIOHIDKeyMappingKey +#define EVSIOCKM_SIZE 4096 + +/* Mouse-related ioctls - implemented within Event Sources */ + +#define EVSIOSMS kIOHIDPointerAccelerationKey +#define EVSIOSMS_SIZE (1) + +#define EVSIOCMS kIOHIDPointerAccelerationKey +#define EVSIOCMS_SIZE (1) + +#ifdef _undef +#define EVSIOSMH "Evs_SetMouseHandedness" +#define EVSIOSMH_SIZE 1 // value from NXMouseButton enum + +#define EVSIOCMH "Evs_CurrentMouseHandedness" +#define EVSIOCMH_SIZE 1 +#endif + +/* Generic pointer device controls, implemented by the Event Driver. */ +#define EVSIOSCT kIOHIDClickTimeKey +#define EVSIOSCT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSCS kIOHIDClickSpaceKey +typedef enum { + EVSIOSCS_X, + EVSIOSCS_Y +} evsioEVSIOSCSIndices; +#define EVSIOSCS_SIZE (EVSIOSCS_Y + 1) + +#define EVSIOSADT kIOHIDAutoDimThresholdKey +#define EVSIOSADT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSADS kIOHIDAutoDimStateKey +#define EVSIOSADS_SIZE 1 + +#define EVSIORMS kIOHIDResetPointerKey +#define EVSIORMS_SIZE 1 + +#define EVSIOCCT kIOHIDClickTimeKey +#define EVSIOCCT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOCADT kIOHIDAutoDimThresholdKey +#define EVSIOCADT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOGDADT kIOHIDAutoDimTimeKey +#define EVSIOGDADT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOIDLE kIOHIDIdleTimeKey +#define EVSIOIDLE_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOCCS kIOHIDClickSpaceKey +typedef enum { + EVSIOCCS_X, + EVSIOCCS_Y +} evsioEVSIOCCSIndices; +#define EVSIOCCS_SIZE (EVSIOCCS_Y + 1) + +#define EVSIOCADS kIOHIDAutoDimStateKey +#define EVSIOCADS_SIZE 1 + +enum { + // Selectors for IOHIDGetModifierLockState and IOHIDSetModifierLockState + kIOHIDCapsLockState = 0x00000001, + kIOHIDNumLockState = 0x00000002, + kIOHIDActivityUserIdle = 0x00000003, + kIOHIDActivityDisplayOn = 0x00000004, +}; + +#endif /* !_DEV_EVSIO_H */ diff --git a/QualcommWireless/include/IOKit/hidsystem/IOHIDShared.h b/QualcommWireless/include/IOKit/hidsystem/IOHIDShared.h new file mode 100644 index 0000000..7ac20b1 --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/IOHIDShared.h @@ -0,0 +1,291 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2011 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _DEV_EVIO_H +#define _DEV_EVIO_H + +#include + +__BEGIN_DECLS + +#if KERNEL +#include +#else /* !KERNEL */ +#include +#include +#endif /* KERNEL */ + +#include +#include +#include +#include + +/* + * Identify this driver as one that uses the new driverkit and messaging API + */ +#ifndef _NeXT_MACH_EVENT_DRIVER_ +#define _NeXT_MACH_EVENT_DRIVER_ (1) +#endif /* _NeXT_MACH_EVENT_DRIVER_ */ + + +/* Pressure Constants */ +#define MINPRESSURE EV_MINPRESSURE +#define MAXPRESSURE EV_MAXPRESSURE + +#define LLEQSIZE 240 /* Entries in low-level event queue */ + +typedef struct _NXEQElStruct { + int next; /* Slot of lleq for next event */ + OSSpinLock sema; /* Is high-level code reading this event now? */ + NXEvent event; /* The event itself */ +} NXEQElement; + +/****************************************************************************** + SHARED MEMORY OVERVIEW + + PERSPECTIVE + The ev driver and PostScript share at least one page of wired memory. + This memory contains the low-level event queue which ev deposits events + into and PostScript reads events from. Also, this memory contains other + important data such as wait cursor state and some general cursor state. + This memory is critical for speed. That is, we avoid having to make + system calls for common operations. + + SHARED MEMORY REGIONS + There are currently three "regions" or "zones" delineated within this + shared memory. The first zone is the EvOffsets structure. This structure + contains two offsets from the beginning of shared memory. The first offset + is to the second zone, EvGlobals. The second offset is to the third + zone, private shmem for drivers. + + INITIALIZATION OF SHARED MEMORY + When the WindowServer starts up, it finds all screens that will be active. + It then opens the ev driver and calls the EVIOSSCR ioctl repeatedly for + each screen in use. This lets the ev driver set up the evScreen array + and fill in each element. This ioctl also returns to PostScript a running + total shared memory size with which to allocate. PostScript then allocates + a region of memory this size and calls evmmap to "map in" this shared + region. Evmmap initializes and fills in the EvOffsets and EvGlobals. + Next the WindowServer calls each screen in turn to register itself with + the ev driver in the same sequence as presented to EVIOSSCR. Each screen + driver calls ev_register_screen() which among other things allocates a + part of the private shmem (of the third shared memory zone) for the driver. + + DEBUGGING NOTES + You can easily display and set this shared memory from kgdb, but usually + cannot do so from within PostScript. Gdb (or some weird interaction + between gdb and the os) chokes on this shmem. So if you read or write + this area of memory, copy-on-write will occur and you'll get a completely + new page for PostScript. This will render the shared memory scheme + useless and you will have to restart PostScript. It was my understanding + that before, we were able to "read" this area from PS, but not write to + it (the idea behind copy-on-WRITE). However, this seems to be broken + in 2.0. We think this is a kernel bug. +******************************************************************************/ + +typedef volatile struct _evOffsets { + int evGlobalsOffset; /* Offset to EvGlobals structure */ + int evShmemOffset; /* Offset to private shmem regions */ +} EvOffsets; + +/****************************************************************************** + EvGlobals + This structures defines the portion of the events driver data structure + that is exported to the PostScript server. It contains the event queue + which is in memory shared between the driver and the PostScript server. + All the variables necessary to read and process events from the queue are + contained here. +******************************************************************************/ + +typedef volatile struct _evGlobals { + OSSpinLock cursorSema; /* set to disable periodic code */ + int eNum; /* Unique id for mouse events */ + int buttons; /* State of the mouse buttons 1==down, 0==up */ + int eventFlags; /* The current value of event.flags */ + int VertRetraceClock; /* The current value of event.time */ + IOGPoint cursorLoc; /* The current location of the cursor, in desktop coordinates */ + int frame; /* current cursor frame */ + IOGBounds workBounds; /* bounding box of all screens */ + IOGBounds mouseRect; /* Rect for mouse-exited events */ + int version; /* for run time checks */ + int structSize; /* for run time checks */ + int lastFrame; + /* The current location of the cursor, 24.8 bit fixed point format */ + IOFixedPoint32 screenCursorFixed; /* in Screen coordinates */ + IOFixedPoint32 desktopCursorFixed;/* in Desktop coordinates */ + unsigned int reservedA[27]; + + unsigned reserved:25; + unsigned updateCursorPositionFromFixed:1; /* if this is set, IOHIDSystem will take any cursor position updates from desktopCursorFixed instead of cursorLoc */ + unsigned logCursorUpdates:1; /* log cursor updates */ + unsigned wantPressure:1; /* pressure in current mouseRect? */ + unsigned wantPrecision:1; /* precise coordinates in current mouseRect? */ + unsigned dontWantCoalesce:1; /* coalesce within the current mouseRect? */ + unsigned dontCoalesce:1; /* actual flag which determines coalescing */ + unsigned mouseRectValid:1; /* If nonzero, post a mouse-exited whenever mouse outside mouseRect. */ + int movedMask; /* This contains an event mask for the three events MOUSEMOVED, + LMOUSEDRAGGED, and RMOUSEDRAGGED. It says whether driver should + generate those events. */ + OSSpinLock waitCursorSema; /* protects wait cursor fields */ + int AALastEventSent; /* timestamp for wait cursor */ + int AALastEventConsumed; /* timestamp for wait cursor */ + int waitCursorUp; /* Is wait cursor up? */ + char ctxtTimedOut; /* Has wait cursor timer expired? */ + char waitCursorEnabled; /* Play wait cursor game (per ctxt)? */ + char globalWaitCursorEnabled; /* Play wait cursor game (global)? */ + int waitThreshold; /* time before wait cursor appears */ + + int LLEHead; /* The next event to be read */ + int LLETail; /* Where the next event will go */ + int LLELast; /* The last event entered */ + NXEQElement lleq[LLEQSIZE]; /* The event queue itself */ +} EvGlobals; + +/* These evio structs are used in various calls supported by the ev driver. */ + +struct evioLLEvent { + int setCursor; + int type; + IOGPoint location; + NXEventData data; + int setFlags; + int flags; +}; + +typedef struct evioLLEvent _NXLLEvent; + +#ifdef mach3xxx + +/* + * On a keypress of a VOL UP or VOL DOWN key, we send a message to the + * sound server to notify it of the volume change. The message includes + * a flag to indicate which key was pressed, and the machine independant + * flag bits to indicate which modifier keys were pressed. + */ + +struct evioSpecialKeyMsg +{ + msg_header_t Head; + msg_type_t keyType; + int key; // special key number, from bsd/dev/ev_keymap.h + msg_type_t directionType; + int direction; // NX_KEYDOWN, NX_KEYUP from event.h + msg_type_t flagsType; + int flags; // device independant flags from event.h + msg_type_t levelType; + int level; // EV_AUDIO_MIN_VOLUME to EV_AUDIO_MAX_VOLUME +}; +#else +struct evioSpecialKeyMsg +{ + mach_msg_header_t Head; + int key; // special key number, from bsd/dev/ev_keymap.h + int direction; // NX_KEYDOWN, NX_KEYUP from event.h + int flags; // device independant flags from event.h + int level; // EV_AUDIO_MIN_VOLUME to EV_AUDIO_MAX_VOLUME +}; +#endif + +#define EV_SPECIAL_KEY_MSG_ID (('S'<<24) | ('k'<<16) | ('e'<<8) | ('y')) +typedef struct evioSpecialKeyMsg *evioSpecialKeyMsg_t; + +/* + * Volume ranges + */ +#define EV_AUDIO_MIN_VOLUME 0 +#define EV_AUDIO_MAX_VOLUME 64 + +#define kIOHIDSystemClass "IOHIDSystem" +#define kIOHIKeyboardClass "IOHIKeyboard" +#define kIOHIPointingClass "IOHIPointing" + +#define IOHIDSYSTEM_CONFORMSTO kIOHIDSystemClass + +enum { + kIOHIDEventNotification = 0, +}; +#define kIOHIDCurrentShmemVersion 4 +#define kIOHIDLastCompatibleShmemVersion 3 + +enum { + kIOHIDServerConnectType = 0, + kIOHIDParamConnectType = 1, + kIOHIDEventSystemConnectType = 3, +}; + +enum { + kIOHIDGlobalMemory = 0 +}; + +enum { + kIOHIDEventQueueTypeKernel = 0, + kIOHIDEventQueueTypeUser = 1 +}; + +#ifdef KERNEL +typedef UInt16 (*MasterVolumeUpdate)(void); +typedef bool (*MasterMuteUpdate)(void); + +typedef struct { + MasterVolumeUpdate incrementMasterVolume; + MasterVolumeUpdate decrementMasterVolume; + MasterMuteUpdate toggleMasterMute; +} MasterAudioFunctions; + +extern MasterAudioFunctions *masterAudioFunctions; +#endif + +#ifndef KERNEL +#ifndef _IOKIT_IOHIDLIB_H +#include +#endif +#endif /* !KERNEL */ + + + +enum { + /*! + @defined kIOHIDOpenedByEventSystem + @abstract option passed to open for IOHIDInterface if opened by IOHIDEventDriver + */ + kIOHIDOpenedByEventSystem = 0x10000, + /*! + @defined kIOHIDOpenedByFastPathClient + @abstract option passed to open for IOHIDEventService if opened by fast path client + */ + kIOHIDOpenedByFastPathClient = 0x20000 +}; + +// iokit_vendor_specific_msg(1) unused + +/*! + @defined kIOHIDMessageRelayServiceInterfaceActive + @abstract message from IOHIDDevice to indicate that the IOHIDRelayService's USB interface is active. + */ + +#define kIOHIDMessageRelayServiceInterfaceActive iokit_vendor_specific_msg(2) + +__END_DECLS + + +#endif /* !_DEV_EVIO_H */ diff --git a/QualcommWireless/include/IOKit/hidsystem/IOHIDSystem.h b/QualcommWireless/include/IOKit/hidsystem/IOHIDSystem.h new file mode 100644 index 0000000..83616a0 --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/IOHIDSystem.h @@ -0,0 +1,615 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * EventDriver.h - Exported Interface Event Driver object. + * + * The EventDriver is a pseudo-device driver. + * + * HISTORY + * 19 Mar 1992 Mike Paquette at NeXT + * Created. + * 4 Aug 1993 Erik Kay at NeXT + * API cleanup + */ + +#ifndef _IOHIDSYSTEM_H +#define _IOHIDSYSTEM_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "IOHIDWorkLoop.h" +#if TARGET_OS_IPHONE +class IOGraphicsDevice; +#else +#include +#endif +#include +#include +#include +#include +#include +#include /* For NX_NUM_SCANNED_SPECIALKEYS */ + +// The following messages should be unique across the entire system +#ifndef sub_iokit_hidsystem +#define sub_iokit_hidsystem err_sub(14) +#endif + +#define kIOHIDSystem508MouseClickMessage iokit_family_msg(sub_iokit_hidsystem, 1) +#define kIOHIDSystemDeviceSeizeRequestMessage iokit_family_msg(sub_iokit_hidsystem, 2) +#define kIOHIDSystem508SpecialKeyDownMessage iokit_family_msg(sub_iokit_hidsystem, 3) +// 4 is used by IOHIDSecurePrompt +#define kIOHIDSystemActivityTickle iokit_family_msg(sub_iokit_hidsystem, 5) +#define kIOHIDSystemUserHidActivity iokit_family_msg(sub_iokit_hidsystem, 6) + +class IOHistogramReporter; +class IOHIDKeyboardDevice; +class IOHIDPointingDevice; +class IOHIDEvent; +class IOFixedPoint64; + +class IOHIDSystem : public IOService +{ + OSDeclareDefaultStructors(IOHIDSystem); + + friend class IOHIDUserClient; + friend class IOHIDParamUserClient; + friend class IOHIDEventSystemUserClient; + +private: + IOHIDWorkLoop *workLoop; + IOTimerEventSource *periodicES; + IOInterruptEventSource *keyboardEQES; + IOCommandGate *cmdGate; + IONotifier *publishNotify; + void *eventMsg; // Msg to be sent to Window Server. + void *stackShotMsg; // Msg to be sent to Stack Shot. + + // Shared memory area information + IOBufferMemoryDescriptor * globalMemory; + uintptr_t shmem_addr; // kernel address of shared memory + vm_size_t shmem_size; // size of shared memory + + // Pointers to structures which occupy the shared memory area. + volatile EvGlobals *evg; // Pointer to EvGlobals (shmem) + // Internal variables related to the shared memory area + int lleqSize; // # of entries in low-level queue + // FIXME: why is this ivar lleqSize an ivar? {Dan] + + // Screens list + vm_size_t evScreenSize; // Byte size of evScreen array + void *evScreen; // array of screens known to driver + int screens; // running total of allocated screens + UInt32 cursorScreens; // bit mask of screens with cursor present + UInt32 cursorPinScreen;// a screen to pin against + IOGBounds cursorPin; // Range to which cursor is pinned + // while on this screen. + IOGBounds workSpace; // IOGBounds of full workspace. + // Event Status state - This includes things like event timestamps, + // time til screen dim, and related things manipulated through the + // Event Status API. + // + struct ExpansionData; + ExpansionData *_privateData; + + IOGPoint clickLoc; // location of last mouse click + IOGPoint clickSpaceThresh;// max mouse delta to be a doubleclick + +// int clickState; // Current click state + + bool evOpenCalled; // Has the driver been opened? + bool evInitialized; // Has the first-open-only initialization run? + bool evStateChanging; // Is the event system state changing. + bool eventsOpen; // Boolean: has evmmap been called yet? + bool cursorStarted; // periodic events running? + bool cursorEnabled; // cursor positioning ok? + bool cursorCoupled; // cursor positioning on pointer moves ok? + bool cursorPinned; // cursor positioning on pointer moves ok? + + uint64_t lastUndimEvent; + + struct SetFixedMouseLocData { + uint64_t origTs; + uint64_t callTs; + int32_t x; + int32_t y; + int32_t pid; + } __attribute__((packed)); + + struct Diags { + /* Cursor actions slower than this are tracked for diagnostics */ + static const uint32_t SLOW_CURSOR_MS = 20; + + typedef enum { + kCursorActionShow = 0, + kCursorActionHide, + kCursorActionMove, + + kCursorActionCount + } CursorAction; + + static const char * cursorStrings[kCursorActionCount]; + + uint64_t cursorWorkloopTime; + uint64_t lastActionTimes[kCursorActionCount]; + uint8_t lastCursorActionsMask; + + IOHistogramReporter * cursorTotalHistReporter; + IOHistogramReporter * cursorGraphicsHistReporter; + + } _diags; + + IOService *displayManager; // points to display manager + IOPMPowerFlags displayState; + + + IOService * rootDomain; + AbsoluteTime displayStateChangeDeadline; + AbsoluteTime displaySleepWakeupDeadline; + UInt32 powerState; + + OSDictionary * savedParameters; // keep user settings + + UInt32 maxWaitCursorFrame; // animation frames + UInt32 firstWaitCursorFrame; // + + IOHIDPointingDevice * _hidPointingDevice; + IOHIDKeyboardDevice * _hidKeyboardDevice; + + OSObject * lastSender; + + + bool setParamPropertiesInProgress; + + OSSet * dataQueueSet; + + +private: + + + virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags, unsigned long, IOService * ) APPLE_KEXT_OVERRIDE; + static IOReturn powerStateHandler( void *target, void *refCon, + UInt32 messageType, IOService *service, void *messageArgument, vm_size_t argSize ); + void updatePowerState(UInt32 messageType); + + /* Resets */ + void _setScrollCountParameters(OSDictionary *newSettings = NULL); + + /* Initialize the shared memory area */ + void initShmem(bool clean); + /* Dispatch low level events through shared memory to the WindowServer */ + void postEvent( int what, + /* at */ IOFixedPoint64 * location, + /* atTime */ AbsoluteTime ts, + /* withData */NXEventData * myData, + /* sender */ OSObject * sender = 0, + /* pid */ UInt32 extPID = 0, + /* processKEQ*/bool processKEQ = true, + /* options*/ UInt32 options = 0 + ); + /* Dispatch mechanisms for screen state changes */ + void evDispatch( + /* command */ EvCmd evcmd); + + OSDictionary * createFilteredParamPropertiesForService(IOService * service, OSDictionary * dict); + + static void _periodicEvents(IOHIDSystem * self, + IOTimerEventSource *timer); + + static void doProcessKeyboardEQ(IOHIDSystem * self); + static void processKeyboardEQ(IOHIDSystem * self, AbsoluteTime * deadline = 0); + + void doProcessNotifications(); + + bool genericNotificationHandler(void * ref, IOService * newService, IONotifier * notifier ); + + static bool handlePublishNotification( void * target, IOService * newService ); + static bool handleTerminationNotification( void * target, IOService * newService ); + + static void makeNumberParamProperty( OSDictionary * dict, const char * key, + unsigned long long number, unsigned int bits ); + + static void makeInt32ArrayParamProperty( OSDictionary * dict, const char * key, + UInt32 * array, unsigned int count ); + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOHIDSystem(Input) category; + * the declarations have now been merged directly into this class. + * + * Exported Interface Event Driver object input services. + */ + +private: + // Schedule next periodic run based on current event system state. + void scheduleNextPeriodicEvent(); + // Message invoked to run periodic events. This method runs in the workloop. + void periodicEvents(IOTimerEventSource *timer); + // Start the cursor running. + bool startCursor(); + // Repin cursor location. + bool resetCursor(); + // Wait Cursor machinery. + void showWaitCursor(); + void hideWaitCursor(); + void animateWaitCursor(); + void changeCursor(int frame); + // Return screen number a point lies on. + int pointToScreen(IOGPoint * p); + + inline void showCursor(); + inline void hideCursor(); + inline void moveCursor(); + void enableContinuousCursor(); + void disableContinuousCursor(); + void _onScreenCursorPin(); + + bool registerEventSource(IOService * source); + + // Set abs cursor position. + void setCursorPosition(IOGPoint * newLoc, bool external, OSObject * sender=0); + void _setCursorPosition(bool external = false, bool proximityChange = false, OSObject * sender=0); + + static bool _idleTimeSerializerCallback(void * target, void * ref, OSSerialize *s); + static bool _cursorStateSerializerCallback(void * target, void * ref, OSSerialize *s); + static bool _displaySerializerCallback(void * target, void * ref, OSSerialize *s); + + IOReturn _recordCursorAction(uint64_t origTS, uint64_t entryTS); + + virtual IOReturn configureReport(IOReportChannelList *channels, + IOReportConfigureAction action, + void *result, + void *destination) APPLE_KEXT_OVERRIDE; + virtual IOReturn updateReport(IOReportChannelList *channels, + IOReportUpdateAction action, + void *result, + void *destination) APPLE_KEXT_OVERRIDE; + + void createParameters( void ); + +/* END HISTORICAL NOTE */ + +// void updateUnificationFlags (); + +public: + static IOHIDSystem * instance(); /* Return the current instance of the */ + /* EventDriver, or 0 if none. */ + + virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE; + virtual IOHIDSystem * probe(IOService * provider, + SInt32 * score) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual IOReturn message(UInt32 type, IOService * provider, + void * argument) APPLE_KEXT_OVERRIDE; + virtual void free(void) APPLE_KEXT_OVERRIDE; + virtual bool attach( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void detach( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual IOWorkLoop *getWorkLoop(void) const APPLE_KEXT_OVERRIDE; + + virtual IOReturn evOpen(void); + virtual IOReturn evClose(void); + + virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setParamProperties(OSDictionary * dict); + + /* Create the shared memory area */ + virtual IOReturn createShmem(void*,void*,void*,void*,void*,void*); + + /* register the IOSharedDataQueue for the new user events */ + virtual IOReturn registerEventQueue(IOSharedDataQueue * queue); + + /* Unregister the IOSharedDataQueue for the new user events */ + virtual IOReturn unregisterEventQueue(IOSharedDataQueue * queue); + +public: + + virtual IOReturn newUserClient(task_t owningTask, + /* withToken */ void * security_id, + /* ofType */ UInt32 type, + /* withProps*/ OSDictionary * properties, + /* client */ IOUserClient ** handler) APPLE_KEXT_OVERRIDE; + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOHIPointingEvents protocol; + * the declarations have now been merged directly into this class. + */ + +public: +/* + * HISTORICAL NOTE: + * The following methods were part of the IOHIKeyboardEvents protocol; + * the declarations have now been merged directly into this class. + */ + +public: + virtual void keyboardEvent(unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + + virtual void keyboardSpecialEvent( unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* guid */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + + virtual void updateEventFlags(unsigned flags); /* Does not generate events */ + + + + +private: + + static void _keyboardEvent( IOHIDSystem * self, + unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + OSObject * sender, + void * refcon); + + static void _keyboardSpecialEvent(IOHIDSystem * self, + unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* guid */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + OSObject * sender, + void * refcon); + + static void _updateEventFlags( IOHIDSystem * self, + unsigned flags, + OSObject * sender, + void * refcon); /* Does not generate events */ + + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOUserClient protocol; + * the declarations have now been merged directly into this class. + */ + +public: + + virtual IOReturn setEventsEnable(void*,void*,void*,void*,void*,void*); + virtual IOReturn setCursorEnable(void*,void*,void*,void*,void*,void*); + virtual IOReturn extPostEvent(void*,void*,void*,void*,void*,void*); + virtual IOReturn extSetMouseLocation(void*,void*,void*,void*,void*,void*); + virtual IOReturn extGetButtonEventNum(void*,void*,void*,void*,void*,void*); + + IOReturn extSetBounds(void*,void*,void*,void*,void*,void*); + IOReturn extSetOnScreenBounds(void*,void*,void*,void*,void*,void*); + IOReturn setBounds(IOGBounds * bounds, IOGPoint * screenPoint, bool onScreen); + + IOReturn extGetStateForSelector(void*,void*,void*,void*,void*,void*); + IOReturn extSetStateForSelector(void*,void*,void*,void*,void*,void*); + IOReturn extRegisterVirtualDisplay(void*,void*,void*,void*,void*,void*); + IOReturn extUnregisterVirtualDisplay(void*,void*,void*,void*,void*,void*); + IOReturn extSetVirtualDisplayBounds(void*,void*,void*,void*,void*,void*); + IOReturn extGetUserHidActivityState(void*,void*,void*,void*,void*,void*); + IOReturn setContinuousCursorEnable(void*,void*,void*,void*,void*,void*); +/* + * HISTORICAL NOTE: + * The following methods were part of the IOScreenRegistration protocol; + * the declarations have now been merged directly into this class. + * + * Methods exported by the EventDriver for display systems. + * + * The screenRegister protocol is used by frame buffer drivers to register + * themselves with the Event Driver. These methods are called in response + * to an _IOGetParameterInIntArray() call with "IO_Framebuffer_Register" or + * "IO_Framebuffer_Unregister". + */ + +public: + virtual int registerScreen(IOGraphicsDevice * instance, + /* bounds */ IOGBounds * bp, + /* virtual bounds */ IOGBounds * vbp); +private: + static IOReturn doRegisterScreen(IOHIDSystem *self, IOGraphicsDevice *io_gd, IOGBounds *bp, IOGBounds * vbp, void *arg3); + IOReturn registerScreenGated(IOGraphicsDevice *io_gd, IOGBounds *bp, IOGBounds * vbp, SInt32 *index); +public: + + + virtual void unregisterScreen(int index); + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOWorkspaceBounds protocol; + * the declarations have now been merged directly into this class. + * + * Absolute position input devices and some specialized output devices + * may need to know the bounding rectangle for all attached displays. + * The following method returns a IOGBounds* for the workspace. Please note + * that the bounds are kept as signed values, and that on a multi-display + * system the minx and miny values may very well be negative. + */ + +public: + virtual IOGBounds * workspaceBounds(); + +/* END HISTORICAL NOTES */ + +private: +void keyboardEvent(unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender); + +void keyboardSpecialEvent( unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* guid */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender); + +void updateEventFlags(unsigned flags, OSObject * sender); + + +/* + * COMMAND GATE COMPATIBILITY: + * The following method is part of the work needed to make IOHIDSystem + * compatible with IOCommandGate. The use of IOCommandQueue has been + * deprecated, thus requiring this move. This should allow for less + * context switching as all actions formerly run on the I/O Workloop + * thread, will now be run on the caller thread. The static methods + * will be called from cmdGate->runAction and returns the appropriate + * non-static helper method. Arguments are stored in the void* array, + * args, and are passed through. Since we are returning in the static + * function, gcc3 should translate that to one instruction, thus + * minimizing cost. + */ + +static IOReturn doEvClose (IOHIDSystem *self); + IOReturn evCloseGated (void); + +static IOReturn doUnregisterScreen (IOHIDSystem *self, void * arg0); + IOReturn unregisterScreenGated (int index); + +static IOReturn doSetDisplayBounds (IOHIDSystem *self, void * arg0, void * arg1); + IOReturn setDisplayBoundsGated (UInt32 index, IOGBounds *bounds); + +static IOReturn doCreateShmem (IOHIDSystem *self, void * arg0); + IOReturn createShmemGated (void * p1); + +static IOReturn doRegisterEventQueue (IOHIDSystem *self, void * arg0); + IOReturn registerEventQueueGated (void * p1); + +static IOReturn doUnregisterEventQueue (IOHIDSystem *self, void * arg0); + IOReturn unregisterEventQueueGated (void * p1); + + +static IOReturn doKeyboardEvent (IOHIDSystem *self, void * args); + void keyboardEventGated (unsigned eventType, + unsigned flags, + unsigned key, + unsigned charCode, + unsigned charSet, + unsigned origCharCode, + unsigned origCharSet, + unsigned keyboardType, + bool repeat, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doKeyboardSpecialEvent (IOHIDSystem *self, void * args); + void keyboardSpecialEventGated ( + unsigned eventType, + unsigned flags, + unsigned key, + unsigned flavor, + UInt64 guid, + bool repeat, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doUpdateEventFlags (IOHIDSystem *self, void * args); + void updateEventFlagsGated (unsigned flags, OSObject * sender); + +static IOReturn doNewUserClient (IOHIDSystem *self, void * args); + IOReturn newUserClientGated (task_t owningTask, + void * security_id, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler); + +static IOReturn doSetCursorEnable (IOHIDSystem *self, void * arg0); + IOReturn setCursorEnableGated (void * p1); + +static IOReturn doSetContinuousCursorEnable (IOHIDSystem *self, void * arg0); + IOReturn setContinuousCursorEnableGated (void * p1); + +static IOReturn doExtPostEvent(IOHIDSystem *self, void * arg0, void * arg1, void * arg2, void * arg3); + IOReturn extPostEventGated (void * p1, void * p2, void * p3); + +static IOReturn doExtSetMouseLocation (IOHIDSystem *self, void * args); + IOReturn extSetMouseLocationGated (void * args); + +static IOReturn doExtGetButtonEventNum (IOHIDSystem *self, void * arg0, void * arg1); + IOReturn extGetButtonEventNumGated (void * p1, void * p2); + +static IOReturn doSetParamPropertiesPre (IOHIDSystem *self, void * arg0, void * arg1); + IOReturn setParamPropertiesPreGated (OSDictionary * dict, OSIterator ** pOpenIter); + +static IOReturn doSetParamPropertiesPost (IOHIDSystem *self, void * arg0); + IOReturn setParamPropertiesPostGated (OSDictionary * dict); + + IOReturn updateParamPropertiesGated(IOService * source); + +static IOReturn doExtGetStateForSelector (IOHIDSystem *self, void *p1, void *p2); +static IOReturn doExtSetStateForSelector (IOHIDSystem *self, void *p1, void *p2); + +/* END COMMAND GATE COMPATIBILITY */ + +public: + virtual UInt32 eventFlags(); + virtual void sleepDisplayTickle(); + + virtual void dispatchEvent(IOHIDEvent *event, IOOptionBits options=0); + + void updateHidActivity(); + void hidActivityChecker(); + static void reportUserHidActivity(IOHIDSystem *self, void *args ); + void reportUserHidActivityGated(void *args ); + + static IOReturn getUserHidActivityState(IOHIDSystem *self, void *arg0); + IOReturn getUserHidActivityStateGated(void *state); + +}; + +#endif /* !_IOHIDSYSTEM_H */ diff --git a/QualcommWireless/include/IOKit/hidsystem/IOHIDTypes.h b/QualcommWireless/include/IOKit/hidsystem/IOHIDTypes.h new file mode 100644 index 0000000..c665f9b --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/IOHIDTypes.h @@ -0,0 +1,182 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/****************************************************************************** + ev_types.h + Data types for the events status driver. + This file contains public API. + mpaque 11Oct91 + + Copyright 1991 NeXT Computer, Inc. + Copyright 1997-2011 Apple, Inc. + + Modified: + +******************************************************************************/ + +#ifndef _DEV_EV_TYPES_H +#define _DEV_EV_TYPES_H + +#include +#include +#include + +// This should be removed, but is being used by others +// IOHIDFamily-355 causes projects to fail to build with 'ev_lock_data_t' does not name a type +#include + +/* Shared memory versions */ +#define EVENT_SYSTEM_VERSION 2 + +/* Maximum length of SetMouseScaling arrays */ +#define NX_MAXMOUSESCALINGS 20 + +typedef struct evsioKeymapping /* Match old struct names in kernel */ +{ + int size; + char *mapping; +} NXKeyMapping; + +typedef struct evsioMouseScaling /* Match old struct names in kernel */ +{ + int numScaleLevels; + short scaleThresholds[NX_MAXMOUSESCALINGS]; + short scaleFactors[NX_MAXMOUSESCALINGS]; +} NXMouseScaling; + +typedef enum { + NX_OneButton, + NX_LeftButton, + NX_RightButton +} NXMouseButton; + +// IOFixedPoint32 is a 24.8 format +typedef struct __IOFixedPoint32 { + int32_t x; + int32_t y; +} IOFixedPoint32; + +/* + * NXEventSystemInfo() information structures. These are designed to + * allow for expansion. + * + * The current implementation of NXEventSystemInfo() uses an ioctl call. + * THIS WILL CHANGE. + */ + +/* + * Generic query max size and typedefs. + * + * The maximum size is selected to support anticipated future extensions + * of request flavors. Certain flavors planned for future releases may + * require roughtly 800 ints to represent. We allow a little extra, in + * case further growth is needed. + */ +typedef int *NXEventSystemInfoType; +#define NX_EVS_INFO_MAX (1024) /* Max array size */ +typedef int NXEventSystemInfoData[NX_EVS_INFO_MAX]; + +/* Event System Devices query */ +#define NX_EVS_DEVICE_MAX 16 + + /* Interface types */ +#define NX_EVS_DEVICE_INTERFACE_OTHER 0 +#define NX_EVS_DEVICE_INTERFACE_NeXT 1 // NeXT custom, in older sys +#define NX_EVS_DEVICE_INTERFACE_ADB 2 // NeXT/fruit keybds/mice +#define NX_EVS_DEVICE_INTERFACE_ACE 3 // For x86 PC keyboards +#define NX_EVS_DEVICE_INTERFACE_SERIAL_ACE 4 // For PC serial mice +#define NX_EVS_DEVICE_INTERFACE_BUS_ACE 5 // For PC bus mice +#define NX_EVS_DEVICE_INTERFACE_HIL 6 // For HIL hp keyboard +#define NX_EVS_DEVICE_INTERFACE_TYPE5 7 // For Sun Type5 keyboard + +/* + * Note! if any new interface types are added above, the following + * definition of the number of interfaces supported must reflect this. + * This is used in the libkeymap project (storemap.c module) which needs + * to be cognizant of the number of new devices coming online + * via support for heterogeneous architecture platforms. + * e.g., PCs, HP's HIL, Sun's Type5 keyboard,... + */ +#define NUM_SUPPORTED_INTERFACES (NX_EVS_DEVICE_INTERFACE_TYPE5 + 1) + // Other, NeXT, ADB, ACE,... + + /* Device types */ +#define NX_EVS_DEVICE_TYPE_OTHER 0 +#define NX_EVS_DEVICE_TYPE_KEYBOARD 1 +#define NX_EVS_DEVICE_TYPE_MOUSE 2 // Relative position devices +#define NX_EVS_DEVICE_TYPE_TABLET 3 // Absolute position devices + +typedef struct { + int interface; /* NeXT, ADB, other */ + int interface_addr; /* Device address on the interface */ + int dev_type; /* Keyboard, mouse, tablet, other */ + int id; /* manufacturer's device handler ID */ +} NXEventSystemDevice; + +typedef struct { + NXEventSystemDevice dev[NX_EVS_DEVICE_MAX]; +} NXEventSystemDeviceList; + +#define __OLD_NX_EVS_DEVICE_INFO 1 +#define NX_EVS_DEVICE_INFO "Evs_EventDeviceInfo" +#define NX_EVS_DEVICE_INFO_COUNT \ + (sizeof (NXEventSystemDeviceList) / sizeof (int)) + +/* + * Types used in evScreen protocol compliant operations. + */ + +typedef enum {EVNOP, EVHIDE, EVSHOW, EVMOVE, EVLEVEL} EvCmd; /* Cursor state */ + +#define EV_SCREEN_MIN_BRIGHTNESS 0 +#define EV_SCREEN_MAX_BRIGHTNESS 64 +/* Scale should lie between MIN_BRIGHTNESS and MAX_BRIGHTNESS */ +#define EV_SCALE_BRIGHTNESS( scale, datum ) \ + ((((UInt32)(datum))*((UInt32)scale)) >> 6) + +/* + * Definition of a tick, as a time in milliseconds. This controls how + * often the event system periodic jobs are run. All actual tick times + * are derived from the nanosecond timer. These values are typically used + * as part of computing mouse velocity for acceleration purposes. + */ +#define EV_TICK_TIME 16 /* 16 milliseconds */ +#define EV_TICKS_PER_SEC (1000/EV_TICK_TIME) /* ~ 62 Hz */ + +/* Mouse Button bits, as passed from an EventSrc to the Event Driver */ +#define EV_RB (0x01) +#define EV_LB (0x04) +#define EV_MOUSEBUTTONMASK (EV_LB | EV_RB) + +/* Tablet Pressure Constants, as passed from an EventSrc to the Event Driver */ +#define EV_MINPRESSURE 0 +#define EV_MAXPRESSURE 255 + +/* Cursor size in pixels */ +#define EV_CURSOR_WIDTH 16 +#define EV_CURSOR_HEIGHT 16 + + +#define kAppleOnboardGUID 0x0610000000000000ULL + +#endif /* !_DEV_EV_TYPES_H */ + diff --git a/QualcommWireless/include/IOKit/hidsystem/IOHIDUsageTables.h b/QualcommWireless/include/IOKit/hidsystem/IOHIDUsageTables.h new file mode 100644 index 0000000..77db996 --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/IOHIDUsageTables.h @@ -0,0 +1,2591 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOHIDUSAGETABLES_H +#define _IOHIDUSAGETABLES_H + +/* ****************************************************************************************** + * HID Usage Tables + * + * The following constants are from the USB 'HID Usage Tables' specification, revision 1.1rc3 + * ****************************************************************************************** */ + + +/* Usage Pages */ +enum +{ + kHIDPage_Undefined = 0x00, + kHIDPage_GenericDesktop = 0x01, + kHIDPage_Simulation = 0x02, + kHIDPage_VR = 0x03, + kHIDPage_Sport = 0x04, + kHIDPage_Game = 0x05, + kHIDPage_GenericDeviceControls = 0x06, + kHIDPage_KeyboardOrKeypad = 0x07, /* USB Device Class Definition for Human Interface Devices (HID). Note: the usage type for all key codes is Selector (Sel). */ + kHIDPage_LEDs = 0x08, + kHIDPage_Button = 0x09, + kHIDPage_Ordinal = 0x0A, + kHIDPage_Telephony = 0x0B, + kHIDPage_Consumer = 0x0C, + kHIDPage_Digitizer = 0x0D, + /* Reserved 0x0E */ + kHIDPage_PID = 0x0F, /* USB Physical Interface Device definitions for force feedback and related devices. */ + kHIDPage_Unicode = 0x10, + /* Reserved 0x11 - 0x13 */ + kHIDPage_AlphanumericDisplay = 0x14, + /* Reserved 0x15 - 0x1F */ + kHIDPage_Sensor = 0x20, + /* Reserved 0x21 - 0x7f */ + kHIDPage_Monitor = 0x80, + kHIDPage_MonitorEnumerated = 0x81, + kHIDPage_MonitorVirtual = 0x82, + kHIDPage_MonitorReserved = 0x83, + /* Power 0x84 - 0x87 USB Device Class Definition for Power Devices */ + kHIDPage_PowerDevice = 0x84, /* Power Device Page */ + kHIDPage_BatterySystem = 0x85, /* Battery System Page */ + kHIDPage_PowerReserved = 0x86, + kHIDPage_PowerReserved2 = 0x87, + /* Reserved 0x88 - 0x8B */ + kHIDPage_BarCodeScanner = 0x8C, /* (Point of Sale) USB Device Class Definition for Bar Code Scanner Devices */ + kHIDPage_WeighingDevice = 0x8D, /* (Point of Sale) USB Device Class Definition for Weighing Devices */ + kHIDPage_Scale = 0x8D, /* (Point of Sale) USB Device Class Definition for Scale Devices */ + kHIDPage_MagneticStripeReader = 0x8E, + /* ReservedPointofSalepages 0x8F */ + kHIDPage_CameraControl = 0x90, /* USB Device Class Definition for Image Class Devices */ + kHIDPage_Arcade = 0x91, /* OAAF Definitions for arcade and coinop related Devices */ + /* Reserved 0x92 - 0xFEFF */ + /* VendorDefined 0xFF00 - 0xFFFF */ + kHIDPage_VendorDefinedStart = 0xFF00 +}; + +/* Undefined Usage for all usage pages */ +enum +{ + kHIDUsage_Undefined = 0x00 +}; + +/* GenericDesktop Page (0x01) */ +enum +{ + kHIDUsage_GD_Pointer = 0x01, /* Physical Collection */ + kHIDUsage_GD_Mouse = 0x02, /* Application Collection */ + /* 0x03 Reserved */ + kHIDUsage_GD_Joystick = 0x04, /* Application Collection */ + kHIDUsage_GD_GamePad = 0x05, /* Application Collection */ + kHIDUsage_GD_Keyboard = 0x06, /* Application Collection */ + kHIDUsage_GD_Keypad = 0x07, /* Application Collection */ + kHIDUsage_GD_MultiAxisController = 0x08, /* Application Collection */ + kHIDUsage_GD_TabletPCSystemControls = 0x09, /* Application Collection */ + kHIDUsage_GD_AssistiveControl = 0x0A, /* Application Collection */ + kHIDUsage_GD_SpatialController = 0x0F, /* Application Collection */ + kHIDUsage_GD_AssistiveControlCompatible = 0x10, /* Application Collection */ + /* 0x0B - 0x2F Reserved */ + kHIDUsage_GD_X = 0x30, /* Dynamic Value */ + kHIDUsage_GD_Y = 0x31, /* Dynamic Value */ + kHIDUsage_GD_Z = 0x32, /* Dynamic Value */ + kHIDUsage_GD_Rx = 0x33, /* Dynamic Value */ + kHIDUsage_GD_Ry = 0x34, /* Dynamic Value */ + kHIDUsage_GD_Rz = 0x35, /* Dynamic Value */ + kHIDUsage_GD_Slider = 0x36, /* Dynamic Value */ + kHIDUsage_GD_Dial = 0x37, /* Dynamic Value */ + kHIDUsage_GD_Wheel = 0x38, /* Dynamic Value */ + kHIDUsage_GD_Hatswitch = 0x39, /* Dynamic Value */ + kHIDUsage_GD_CountedBuffer = 0x3A, /* Logical Collection */ + kHIDUsage_GD_ByteCount = 0x3B, /* Dynamic Value */ + kHIDUsage_GD_MotionWakeup = 0x3C, /* One-Shot Control */ + kHIDUsage_GD_Start = 0x3D, /* On/Off Control */ + kHIDUsage_GD_Select = 0x3E, /* On/Off Control */ + /* 0x3F Reserved */ + kHIDUsage_GD_Vx = 0x40, /* Dynamic Value */ + kHIDUsage_GD_Vy = 0x41, /* Dynamic Value */ + kHIDUsage_GD_Vz = 0x42, /* Dynamic Value */ + kHIDUsage_GD_Vbrx = 0x43, /* Dynamic Value */ + kHIDUsage_GD_Vbry = 0x44, /* Dynamic Value */ + kHIDUsage_GD_Vbrz = 0x45, /* Dynamic Value */ + kHIDUsage_GD_Vno = 0x46, /* Dynamic Value */ + /* 0x47 - 0x7F Reserved */ + kHIDUsage_GD_SystemControl = 0x80, /* Application Collection */ + kHIDUsage_GD_SystemPowerDown = 0x81, /* One-Shot Control */ + kHIDUsage_GD_SystemSleep = 0x82, /* One-Shot Control */ + kHIDUsage_GD_SystemWakeUp = 0x83, /* One-Shot Control */ + kHIDUsage_GD_SystemContextMenu = 0x84, /* One-Shot Control */ + kHIDUsage_GD_SystemMainMenu = 0x85, /* One-Shot Control */ + kHIDUsage_GD_SystemAppMenu = 0x86, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuHelp = 0x87, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuExit = 0x88, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuSelect = 0x89, /* Selector */ + kHIDUsage_GD_SystemMenu = kHIDUsage_GD_SystemMenuSelect, /* Selector */ + kHIDUsage_GD_SystemMenuRight = 0x8A, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuLeft = 0x8B, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuUp = 0x8C, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuDown = 0x8D, /* Re-Trigger Control */ + /* 0x8E - 0x8F Reserved */ + kHIDUsage_GD_DPadUp = 0x90, /* On/Off Control */ + kHIDUsage_GD_DPadDown = 0x91, /* On/Off Control */ + kHIDUsage_GD_DPadRight = 0x92, /* On/Off Control */ + kHIDUsage_GD_DPadLeft = 0x93, /* On/Off Control */ + kHIDUsage_GD_IndexTrigger = 0x94, /* On/Off Control */ + kHIDUsage_GD_PalmTrigger = 0x95, /* On/Off Control */ + kHIDUsage_GD_Thumbstick = 0x96, /* On/Off Control */ + /* 0x94 - 0xFFFF Reserved */ + kHIDUsage_GD_Reserved = 0xFFFF +}; + +/* Simulation Page (0x02) */ +/* This section provides detailed descriptions of the usages employed by simulation devices. */ +enum +{ + kHIDUsage_Sim_FlightSimulationDevice = 0x01, /* Application Collection */ + kHIDUsage_Sim_AutomobileSimulationDevice = 0x02, /* Application Collection */ + kHIDUsage_Sim_TankSimulationDevice = 0x03, /* Application Collection */ + kHIDUsage_Sim_SpaceshipSimulationDevice = 0x04, /* Application Collection */ + kHIDUsage_Sim_SubmarineSimulationDevice = 0x05, /* Application Collection */ + kHIDUsage_Sim_SailingSimulationDevice = 0x06, /* Application Collection */ + kHIDUsage_Sim_MotorcycleSimulationDevice = 0x07, /* Application Collection */ + kHIDUsage_Sim_SportsSimulationDevice = 0x08, /* Application Collection */ + kHIDUsage_Sim_AirplaneSimulationDevice = 0x09, /* Application Collection */ + kHIDUsage_Sim_HelicopterSimulationDevice = 0x0A, /* Application Collection */ + kHIDUsage_Sim_MagicCarpetSimulationDevice = 0x0B, /* Application Collection */ + kHIDUsage_Sim_BicycleSimulationDevice = 0x0C, /* Application Collection */ + /* 0x0D - 0x1F Reserved */ + kHIDUsage_Sim_FlightControlStick = 0x20, /* Application Collection */ + kHIDUsage_Sim_FlightStick = 0x21, /* Application Collection */ + kHIDUsage_Sim_CyclicControl = 0x22, /* Physical Collection */ + kHIDUsage_Sim_CyclicTrim = 0x23, /* Physical Collection */ + kHIDUsage_Sim_FlightYoke = 0x24, /* Application Collection */ + kHIDUsage_Sim_TrackControl = 0x25, /* Physical Collection */ + /* 0x26 - 0xAF Reserved */ + kHIDUsage_Sim_Aileron = 0xB0, /* Dynamic Value */ + kHIDUsage_Sim_AileronTrim = 0xB1, /* Dynamic Value */ + kHIDUsage_Sim_AntiTorqueControl = 0xB2, /* Dynamic Value */ + kHIDUsage_Sim_AutopilotEnable = 0xB3, /* On/Off Control */ + kHIDUsage_Sim_ChaffRelease = 0xB4, /* One-Shot Control */ + kHIDUsage_Sim_CollectiveControl = 0xB5, /* Dynamic Value */ + kHIDUsage_Sim_DiveBrake = 0xB6, /* Dynamic Value */ + kHIDUsage_Sim_ElectronicCountermeasures = 0xB7, /* On/Off Control */ + kHIDUsage_Sim_Elevator = 0xB8, /* Dynamic Value */ + kHIDUsage_Sim_ElevatorTrim = 0xB9, /* Dynamic Value */ + kHIDUsage_Sim_Rudder = 0xBA, /* Dynamic Value */ + kHIDUsage_Sim_Throttle = 0xBB, /* Dynamic Value */ + kHIDUsage_Sim_FlightCommunications = 0xBC, /* On/Off Control */ + kHIDUsage_Sim_FlareRelease = 0xBD, /* One-Shot Control */ + kHIDUsage_Sim_LandingGear = 0xBE, /* On/Off Control */ + kHIDUsage_Sim_ToeBrake = 0xBF, /* Dynamic Value */ + kHIDUsage_Sim_Trigger = 0xC0, /* Momentary Control */ + kHIDUsage_Sim_WeaponsArm = 0xC1, /* On/Off Control */ + kHIDUsage_Sim_Weapons = 0xC2, /* Selector */ + kHIDUsage_Sim_WingFlaps = 0xC3, /* Dynamic Value */ + kHIDUsage_Sim_Accelerator = 0xC4, /* Dynamic Value */ + kHIDUsage_Sim_Brake = 0xC5, /* Dynamic Value */ + kHIDUsage_Sim_Clutch = 0xC6, /* Dynamic Value */ + kHIDUsage_Sim_Shifter = 0xC7, /* Dynamic Value */ + kHIDUsage_Sim_Steering = 0xC8, /* Dynamic Value */ + kHIDUsage_Sim_TurretDirection = 0xC9, /* Dynamic Value */ + kHIDUsage_Sim_BarrelElevation = 0xCA, /* Dynamic Value */ + kHIDUsage_Sim_DivePlane = 0xCB, /* Dynamic Value */ + kHIDUsage_Sim_Ballast = 0xCC, /* Dynamic Value */ + kHIDUsage_Sim_BicycleCrank = 0xCD, /* Dynamic Value */ + kHIDUsage_Sim_HandleBars = 0xCE, /* Dynamic Value */ + kHIDUsage_Sim_FrontBrake = 0xCF, /* Dynamic Value */ + kHIDUsage_Sim_RearBrake = 0xD0, /* Dynamic Value */ + /* 0xD1 - 0xFFFF Reserved */ + kHIDUsage_Sim_Reserved = 0xFFFF +}; + +/* VR Page (0x03) */ +/* Virtual Reality controls depend on designators to identify the individual controls. Most of the following are */ +/* usages are applied to the collections of entities that comprise the actual device. */ +enum +{ + kHIDUsage_VR_Belt = 0x01, /* Application Collection */ + kHIDUsage_VR_BodySuit = 0x02, /* Application Collection */ + kHIDUsage_VR_Flexor = 0x03, /* Physical Collection */ + kHIDUsage_VR_Glove = 0x04, /* Application Collection */ + kHIDUsage_VR_HeadTracker = 0x05, /* Physical Collection */ + kHIDUsage_VR_HeadMountedDisplay = 0x06, /* Application Collection */ + kHIDUsage_VR_HandTracker = 0x07, /* Application Collection */ + kHIDUsage_VR_Oculometer = 0x08, /* Application Collection */ + kHIDUsage_VR_Vest = 0x09, /* Application Collection */ + kHIDUsage_VR_AnimatronicDevice = 0x0A, /* Application Collection */ + /* 0x0B - 0x1F Reserved */ + kHIDUsage_VR_StereoEnable = 0x20, /* On/Off Control */ + kHIDUsage_VR_DisplayEnable = 0x21, /* On/Off Control */ + /* 0x22 - 0xFFFF Reserved */ + kHIDUsage_VR_Reserved = 0xFFFF +}; + +/* Sport Page (0x04) */ +enum +{ + kHIDUsage_Sprt_BaseballBat = 0x01, /* Application Collection */ + kHIDUsage_Sprt_GolfClub = 0x02, /* Application Collection */ + kHIDUsage_Sprt_RowingMachine = 0x03, /* Application Collection */ + kHIDUsage_Sprt_Treadmill = 0x04, /* Application Collection */ + /* 0x05 - 0x2F Reserved */ + kHIDUsage_Sprt_Oar = 0x30, /* Dynamic Value */ + kHIDUsage_Sprt_Slope = 0x31, /* Dynamic Value */ + kHIDUsage_Sprt_Rate = 0x32, /* Dynamic Value */ + kHIDUsage_Sprt_StickSpeed = 0x33, /* Dynamic Value */ + kHIDUsage_Sprt_StickFaceAngle = 0x34, /* Dynamic Value */ + kHIDUsage_Sprt_StickHeelOrToe = 0x35, /* Dynamic Value */ + kHIDUsage_Sprt_StickFollowThrough = 0x36, /* Dynamic Value */ + kHIDUsage_Sprt_StickTempo = 0x37, /* Dynamic Value */ + kHIDUsage_Sprt_StickType = 0x38, /* Named Array */ + kHIDUsage_Sprt_StickHeight = 0x39, /* Dynamic Value */ + /* 0x3A - 0x4F Reserved */ + kHIDUsage_Sprt_Putter = 0x50, /* Selector */ + kHIDUsage_Sprt_1Iron = 0x51, /* Selector */ + kHIDUsage_Sprt_2Iron = 0x52, /* Selector */ + kHIDUsage_Sprt_3Iron = 0x53, /* Selector */ + kHIDUsage_Sprt_4Iron = 0x54, /* Selector */ + kHIDUsage_Sprt_5Iron = 0x55, /* Selector */ + kHIDUsage_Sprt_6Iron = 0x56, /* Selector */ + kHIDUsage_Sprt_7Iron = 0x57, /* Selector */ + kHIDUsage_Sprt_8Iron = 0x58, /* Selector */ + kHIDUsage_Sprt_9Iron = 0x59, /* Selector */ + kHIDUsage_Sprt_10Iron = 0x5A, /* Selector */ + kHIDUsage_Sprt_11Iron = 0x5B, /* Selector */ + kHIDUsage_Sprt_SandWedge = 0x5C, /* Selector */ + kHIDUsage_Sprt_LoftWedge = 0x5D, /* Selector */ + kHIDUsage_Sprt_PowerWedge = 0x5E, /* Selector */ + kHIDUsage_Sprt_1Wood = 0x5F, /* Selector */ + kHIDUsage_Sprt_3Wood = 0x60, /* Selector */ + kHIDUsage_Sprt_5Wood = 0x61, /* Selector */ + kHIDUsage_Sprt_7Wood = 0x62, /* Selector */ + kHIDUsage_Sprt_9Wood = 0x63, /* Selector */ + /* 0x64 - 0xFFFF Reserved */ + kHIDUsage_Sprt_Reserved = 0xFFFF +}; + +/* Game Page (0x05) */ +enum +{ + kHIDUsage_Game_3DGameController = 0x01, /* Application Collection */ + kHIDUsage_Game_PinballDevice = 0x02, /* Application Collection */ + kHIDUsage_Game_GunDevice = 0x03, /* Application Collection */ + /* 0x04 - 0x1F Reserved */ + kHIDUsage_Game_PointofView = 0x20, /* Physical Collection */ + kHIDUsage_Game_TurnRightOrLeft = 0x21, /* Dynamic Value */ + kHIDUsage_Game_PitchUpOrDown = 0x22, /* Dynamic Value */ + kHIDUsage_Game_RollRightOrLeft = 0x23, /* Dynamic Value */ + kHIDUsage_Game_MoveRightOrLeft = 0x24, /* Dynamic Value */ + kHIDUsage_Game_MoveForwardOrBackward = 0x25, /* Dynamic Value */ + kHIDUsage_Game_MoveUpOrDown = 0x26, /* Dynamic Value */ + kHIDUsage_Game_LeanRightOrLeft = 0x27, /* Dynamic Value */ + kHIDUsage_Game_LeanForwardOrBackward = 0x28, /* Dynamic Value */ + kHIDUsage_Game_HeightOfPOV = 0x29, /* Dynamic Value */ + kHIDUsage_Game_Flipper = 0x2A, /* Momentary Control */ + kHIDUsage_Game_SecondaryFlipper = 0x2B, /* Momentary Control */ + kHIDUsage_Game_Bump = 0x2C, /* Momentary Control */ + kHIDUsage_Game_NewGame = 0x2D, /* One-Shot Control */ + kHIDUsage_Game_ShootBall = 0x2E, /* One-Shot Control */ + kHIDUsage_Game_Player = 0x2F, /* One-Shot Control */ + kHIDUsage_Game_GunBolt = 0x30, /* On/Off Control */ + kHIDUsage_Game_GunClip = 0x31, /* On/Off Control */ + kHIDUsage_Game_Gun = 0x32, /* Selector */ + kHIDUsage_Game_GunSingleShot = 0x33, /* Selector */ + kHIDUsage_Game_GunBurst = 0x34, /* Selector */ + kHIDUsage_Game_GunAutomatic = 0x35, /* Selector */ + kHIDUsage_Game_GunSafety = 0x36, /* On/Off Control */ + kHIDUsage_Game_GamepadFireOrJump = 0x37, /* Logical Collection */ + kHIDUsage_Game_GamepadTrigger = 0x39, /* Logical Collection */ + kHIDUsage_Game_GamepadFormFitting_Compatibility = 0x39, /* Static Flag */ + kHIDUsage_Game_GamepadFormFitting = 0x3A, /* Static Flag */ + /* 0x3A - 0xFFFF Reserved */ + kHIDUsage_Game_Reserved = 0xFFFF +}; + +/* Generic Device Controls (0x0g) */ +enum +{ + kHIDUsage_GenDevControls_BackgroundControls = 0x01, /* Application Collection */ +}; + +/* KeyboardOrKeypad Page (0x07) */ +/* This section is the Usage Page for key codes to be used in implementing a USB keyboard. A Boot Keyboard (84-, 101- or 104-key) should at a minimum support all associated usage codes as indicated in the ÒBootÓ */ +/* column below. */ +/* The usage type of all key codes is Selectors (Sel), except for the modifier keys Keyboard Left Control (0x224) to Keyboard Right GUI (0x231) which are Dynamic Flags (DV). */ +/* Note: A general note on Usages and languages: Due to the variation of keyboards from language to language, it is not feasible to specify exact key mappings for every language. Where this list is not specific for a key function in a language, the closest equivalent key position should be used, so that a keyboard may be modified for a different language by simply printing different keycaps. One example is the Y key on a North American keyboard. In Germany this is typically Z. Rather than changing the keyboard firmware to put the Z Usage into that place in the descriptor list, the vendor should use the Y Usage on both the North American and German keyboards. This continues to be the existing practice in the industry, in order to minimize the number of changes to the electronics to accommodate otherlanguages. */ +enum +{ + kHIDUsage_KeyboardErrorRollOver = 0x01, /* ErrorRollOver */ + kHIDUsage_KeyboardPOSTFail = 0x02, /* POSTFail */ + kHIDUsage_KeyboardErrorUndefined = 0x03, /* ErrorUndefined */ + kHIDUsage_KeyboardA = 0x04, /* a or A */ + kHIDUsage_KeyboardB = 0x05, /* b or B */ + kHIDUsage_KeyboardC = 0x06, /* c or C */ + kHIDUsage_KeyboardD = 0x07, /* d or D */ + kHIDUsage_KeyboardE = 0x08, /* e or E */ + kHIDUsage_KeyboardF = 0x09, /* f or F */ + kHIDUsage_KeyboardG = 0x0A, /* g or G */ + kHIDUsage_KeyboardH = 0x0B, /* h or H */ + kHIDUsage_KeyboardI = 0x0C, /* i or I */ + kHIDUsage_KeyboardJ = 0x0D, /* j or J */ + kHIDUsage_KeyboardK = 0x0E, /* k or K */ + kHIDUsage_KeyboardL = 0x0F, /* l or L */ + kHIDUsage_KeyboardM = 0x10, /* m or M */ + kHIDUsage_KeyboardN = 0x11, /* n or N */ + kHIDUsage_KeyboardO = 0x12, /* o or O */ + kHIDUsage_KeyboardP = 0x13, /* p or P */ + kHIDUsage_KeyboardQ = 0x14, /* q or Q */ + kHIDUsage_KeyboardR = 0x15, /* r or R */ + kHIDUsage_KeyboardS = 0x16, /* s or S */ + kHIDUsage_KeyboardT = 0x17, /* t or T */ + kHIDUsage_KeyboardU = 0x18, /* u or U */ + kHIDUsage_KeyboardV = 0x19, /* v or V */ + kHIDUsage_KeyboardW = 0x1A, /* w or W */ + kHIDUsage_KeyboardX = 0x1B, /* x or X */ + kHIDUsage_KeyboardY = 0x1C, /* y or Y */ + kHIDUsage_KeyboardZ = 0x1D, /* z or Z */ + kHIDUsage_Keyboard1 = 0x1E, /* 1 or ! */ + kHIDUsage_Keyboard2 = 0x1F, /* 2 or @ */ + kHIDUsage_Keyboard3 = 0x20, /* 3 or # */ + kHIDUsage_Keyboard4 = 0x21, /* 4 or $ */ + kHIDUsage_Keyboard5 = 0x22, /* 5 or % */ + kHIDUsage_Keyboard6 = 0x23, /* 6 or ^ */ + kHIDUsage_Keyboard7 = 0x24, /* 7 or & */ + kHIDUsage_Keyboard8 = 0x25, /* 8 or * */ + kHIDUsage_Keyboard9 = 0x26, /* 9 or ( */ + kHIDUsage_Keyboard0 = 0x27, /* 0 or ) */ + kHIDUsage_KeyboardReturnOrEnter = 0x28, /* Return (Enter) */ + kHIDUsage_KeyboardEscape = 0x29, /* Escape */ + kHIDUsage_KeyboardDeleteOrBackspace = 0x2A, /* Delete (Backspace) */ + kHIDUsage_KeyboardTab = 0x2B, /* Tab */ + kHIDUsage_KeyboardSpacebar = 0x2C, /* Spacebar */ + kHIDUsage_KeyboardHyphen = 0x2D, /* - or _ */ + kHIDUsage_KeyboardEqualSign = 0x2E, /* = or + */ + kHIDUsage_KeyboardOpenBracket = 0x2F, /* [ or { */ + kHIDUsage_KeyboardCloseBracket = 0x30, /* ] or } */ + kHIDUsage_KeyboardBackslash = 0x31, /* \ or | */ + kHIDUsage_KeyboardNonUSPound = 0x32, /* Non-US # or _ */ + kHIDUsage_KeyboardSemicolon = 0x33, /* ; or : */ + kHIDUsage_KeyboardQuote = 0x34, /* ' or " */ + kHIDUsage_KeyboardGraveAccentAndTilde = 0x35, /* Grave Accent and Tilde */ + kHIDUsage_KeyboardComma = 0x36, /* , or < */ + kHIDUsage_KeyboardPeriod = 0x37, /* . or > */ + kHIDUsage_KeyboardSlash = 0x38, /* / or ? */ + kHIDUsage_KeyboardCapsLock = 0x39, /* Caps Lock */ + kHIDUsage_KeyboardF1 = 0x3A, /* F1 */ + kHIDUsage_KeyboardF2 = 0x3B, /* F2 */ + kHIDUsage_KeyboardF3 = 0x3C, /* F3 */ + kHIDUsage_KeyboardF4 = 0x3D, /* F4 */ + kHIDUsage_KeyboardF5 = 0x3E, /* F5 */ + kHIDUsage_KeyboardF6 = 0x3F, /* F6 */ + kHIDUsage_KeyboardF7 = 0x40, /* F7 */ + kHIDUsage_KeyboardF8 = 0x41, /* F8 */ + kHIDUsage_KeyboardF9 = 0x42, /* F9 */ + kHIDUsage_KeyboardF10 = 0x43, /* F10 */ + kHIDUsage_KeyboardF11 = 0x44, /* F11 */ + kHIDUsage_KeyboardF12 = 0x45, /* F12 */ + kHIDUsage_KeyboardPrintScreen = 0x46, /* Print Screen */ + kHIDUsage_KeyboardScrollLock = 0x47, /* Scroll Lock */ + kHIDUsage_KeyboardPause = 0x48, /* Pause */ + kHIDUsage_KeyboardInsert = 0x49, /* Insert */ + kHIDUsage_KeyboardHome = 0x4A, /* Home */ + kHIDUsage_KeyboardPageUp = 0x4B, /* Page Up */ + kHIDUsage_KeyboardDeleteForward = 0x4C, /* Delete Forward */ + kHIDUsage_KeyboardEnd = 0x4D, /* End */ + kHIDUsage_KeyboardPageDown = 0x4E, /* Page Down */ + kHIDUsage_KeyboardRightArrow = 0x4F, /* Right Arrow */ + kHIDUsage_KeyboardLeftArrow = 0x50, /* Left Arrow */ + kHIDUsage_KeyboardDownArrow = 0x51, /* Down Arrow */ + kHIDUsage_KeyboardUpArrow = 0x52, /* Up Arrow */ + kHIDUsage_KeypadNumLock = 0x53, /* Keypad NumLock or Clear */ + kHIDUsage_KeypadSlash = 0x54, /* Keypad / */ + kHIDUsage_KeypadAsterisk = 0x55, /* Keypad * */ + kHIDUsage_KeypadHyphen = 0x56, /* Keypad - */ + kHIDUsage_KeypadPlus = 0x57, /* Keypad + */ + kHIDUsage_KeypadEnter = 0x58, /* Keypad Enter */ + kHIDUsage_Keypad1 = 0x59, /* Keypad 1 or End */ + kHIDUsage_Keypad2 = 0x5A, /* Keypad 2 or Down Arrow */ + kHIDUsage_Keypad3 = 0x5B, /* Keypad 3 or Page Down */ + kHIDUsage_Keypad4 = 0x5C, /* Keypad 4 or Left Arrow */ + kHIDUsage_Keypad5 = 0x5D, /* Keypad 5 */ + kHIDUsage_Keypad6 = 0x5E, /* Keypad 6 or Right Arrow */ + kHIDUsage_Keypad7 = 0x5F, /* Keypad 7 or Home */ + kHIDUsage_Keypad8 = 0x60, /* Keypad 8 or Up Arrow */ + kHIDUsage_Keypad9 = 0x61, /* Keypad 9 or Page Up */ + kHIDUsage_Keypad0 = 0x62, /* Keypad 0 or Insert */ + kHIDUsage_KeypadPeriod = 0x63, /* Keypad . or Delete */ + kHIDUsage_KeyboardNonUSBackslash = 0x64, /* Non-US \ or | */ + kHIDUsage_KeyboardApplication = 0x65, /* Application */ + kHIDUsage_KeyboardPower = 0x66, /* Power */ + kHIDUsage_KeypadEqualSign = 0x67, /* Keypad = */ + kHIDUsage_KeyboardF13 = 0x68, /* F13 */ + kHIDUsage_KeyboardF14 = 0x69, /* F14 */ + kHIDUsage_KeyboardF15 = 0x6A, /* F15 */ + kHIDUsage_KeyboardF16 = 0x6B, /* F16 */ + kHIDUsage_KeyboardF17 = 0x6C, /* F17 */ + kHIDUsage_KeyboardF18 = 0x6D, /* F18 */ + kHIDUsage_KeyboardF19 = 0x6E, /* F19 */ + kHIDUsage_KeyboardF20 = 0x6F, /* F20 */ + kHIDUsage_KeyboardF21 = 0x70, /* F21 */ + kHIDUsage_KeyboardF22 = 0x71, /* F22 */ + kHIDUsage_KeyboardF23 = 0x72, /* F23 */ + kHIDUsage_KeyboardF24 = 0x73, /* F24 */ + kHIDUsage_KeyboardExecute = 0x74, /* Execute */ + kHIDUsage_KeyboardHelp = 0x75, /* Help */ + kHIDUsage_KeyboardMenu = 0x76, /* Menu */ + kHIDUsage_KeyboardSelect = 0x77, /* Select */ + kHIDUsage_KeyboardStop = 0x78, /* Stop */ + kHIDUsage_KeyboardAgain = 0x79, /* Again */ + kHIDUsage_KeyboardUndo = 0x7A, /* Undo */ + kHIDUsage_KeyboardCut = 0x7B, /* Cut */ + kHIDUsage_KeyboardCopy = 0x7C, /* Copy */ + kHIDUsage_KeyboardPaste = 0x7D, /* Paste */ + kHIDUsage_KeyboardFind = 0x7E, /* Find */ + kHIDUsage_KeyboardMute = 0x7F, /* Mute */ + kHIDUsage_KeyboardVolumeUp = 0x80, /* Volume Up */ + kHIDUsage_KeyboardVolumeDown = 0x81, /* Volume Down */ + kHIDUsage_KeyboardLockingCapsLock = 0x82, /* Locking Caps Lock */ + kHIDUsage_KeyboardLockingNumLock = 0x83, /* Locking Num Lock */ + kHIDUsage_KeyboardLockingScrollLock = 0x84, /* Locking Scroll Lock */ + kHIDUsage_KeypadComma = 0x85, /* Keypad Comma */ + kHIDUsage_KeypadEqualSignAS400 = 0x86, /* Keypad Equal Sign for AS/400 */ + kHIDUsage_KeyboardInternational1 = 0x87, /* International1 */ + kHIDUsage_KeyboardInternational2 = 0x88, /* International2 */ + kHIDUsage_KeyboardInternational3 = 0x89, /* International3 */ + kHIDUsage_KeyboardInternational4 = 0x8A, /* International4 */ + kHIDUsage_KeyboardInternational5 = 0x8B, /* International5 */ + kHIDUsage_KeyboardInternational6 = 0x8C, /* International6 */ + kHIDUsage_KeyboardInternational7 = 0x8D, /* International7 */ + kHIDUsage_KeyboardInternational8 = 0x8E, /* International8 */ + kHIDUsage_KeyboardInternational9 = 0x8F, /* International9 */ + kHIDUsage_KeyboardLANG1 = 0x90, /* LANG1 */ + kHIDUsage_KeyboardLANG2 = 0x91, /* LANG2 */ + kHIDUsage_KeyboardLANG3 = 0x92, /* LANG3 */ + kHIDUsage_KeyboardLANG4 = 0x93, /* LANG4 */ + kHIDUsage_KeyboardLANG5 = 0x94, /* LANG5 */ + kHIDUsage_KeyboardLANG6 = 0x95, /* LANG6 */ + kHIDUsage_KeyboardLANG7 = 0x96, /* LANG7 */ + kHIDUsage_KeyboardLANG8 = 0x97, /* LANG8 */ + kHIDUsage_KeyboardLANG9 = 0x98, /* LANG9 */ + kHIDUsage_KeyboardAlternateErase = 0x99, /* AlternateErase */ + kHIDUsage_KeyboardSysReqOrAttention = 0x9A, /* SysReq/Attention */ + kHIDUsage_KeyboardCancel = 0x9B, /* Cancel */ + kHIDUsage_KeyboardClear = 0x9C, /* Clear */ + kHIDUsage_KeyboardPrior = 0x9D, /* Prior */ + kHIDUsage_KeyboardReturn = 0x9E, /* Return */ + kHIDUsage_KeyboardSeparator = 0x9F, /* Separator */ + kHIDUsage_KeyboardOut = 0xA0, /* Out */ + kHIDUsage_KeyboardOper = 0xA1, /* Oper */ + kHIDUsage_KeyboardClearOrAgain = 0xA2, /* Clear/Again */ + kHIDUsage_KeyboardCrSelOrProps = 0xA3, /* CrSel/Props */ + kHIDUsage_KeyboardExSel = 0xA4, /* ExSel */ + /* 0xA5-0xDF Reserved */ + kHIDUsage_KeyboardLeftControl = 0xE0, /* Left Control */ + kHIDUsage_KeyboardLeftShift = 0xE1, /* Left Shift */ + kHIDUsage_KeyboardLeftAlt = 0xE2, /* Left Alt */ + kHIDUsage_KeyboardLeftGUI = 0xE3, /* Left GUI */ + kHIDUsage_KeyboardRightControl = 0xE4, /* Right Control */ + kHIDUsage_KeyboardRightShift = 0xE5, /* Right Shift */ + kHIDUsage_KeyboardRightAlt = 0xE6, /* Right Alt */ + kHIDUsage_KeyboardRightGUI = 0xE7, /* Right GUI */ + /* 0xE8-0xFFFF Reserved */ + kHIDUsage_Keyboard_Reserved = 0xFFFF +}; + +/* LEDs Page (0x08) */ +/* An LED or indicator is implemented as an On/Off Control (OOF) using the ÒSingle button toggleÓ mode, where a value of 1 will turn on the indicator, and a value of 0 will turn it off. The exceptions are described below. */ +enum +{ + kHIDUsage_LED_NumLock = 0x01, /* On/Off Control */ + kHIDUsage_LED_CapsLock = 0x02, /* On/Off Control */ + kHIDUsage_LED_ScrollLock = 0x03, /* On/Off Control */ + kHIDUsage_LED_Compose = 0x04, /* On/Off Control */ + kHIDUsage_LED_Kana = 0x05, /* On/Off Control */ + kHIDUsage_LED_Power = 0x06, /* On/Off Control */ + kHIDUsage_LED_Shift = 0x07, /* On/Off Control */ + kHIDUsage_LED_DoNotDisturb = 0x08, /* On/Off Control */ + kHIDUsage_LED_Mute = 0x09, /* On/Off Control */ + kHIDUsage_LED_ToneEnable = 0x0A, /* On/Off Control */ + kHIDUsage_LED_HighCutFilter = 0x0B, /* On/Off Control */ + kHIDUsage_LED_LowCutFilter = 0x0C, /* On/Off Control */ + kHIDUsage_LED_EqualizerEnable = 0x0D, /* On/Off Control */ + kHIDUsage_LED_SoundFieldOn = 0x0E, /* On/Off Control */ + kHIDUsage_LED_SurroundOn = 0x0F, /* On/Off Control */ + kHIDUsage_LED_Repeat = 0x10, /* On/Off Control */ + kHIDUsage_LED_Stereo = 0x11, /* On/Off Control */ + kHIDUsage_LED_SamplingRateDetect = 0x12, /* On/Off Control */ + kHIDUsage_LED_Spinning = 0x13, /* On/Off Control */ + kHIDUsage_LED_CAV = 0x14, /* On/Off Control */ + kHIDUsage_LED_CLV = 0x15, /* On/Off Control */ + kHIDUsage_LED_RecordingFormatDetect = 0x16, /* On/Off Control */ + kHIDUsage_LED_OffHook = 0x17, /* On/Off Control */ + kHIDUsage_LED_Ring = 0x18, /* On/Off Control */ + kHIDUsage_LED_MessageWaiting = 0x19, /* On/Off Control */ + kHIDUsage_LED_DataMode = 0x1A, /* On/Off Control */ + kHIDUsage_LED_BatteryOperation = 0x1B, /* On/Off Control */ + kHIDUsage_LED_BatteryOK = 0x1C, /* On/Off Control */ + kHIDUsage_LED_BatteryLow = 0x1D, /* On/Off Control */ + kHIDUsage_LED_Speaker = 0x1E, /* On/Off Control */ + kHIDUsage_LED_HeadSet = 0x1F, /* On/Off Control */ + kHIDUsage_LED_Hold = 0x20, /* On/Off Control */ + kHIDUsage_LED_Microphone = 0x21, /* On/Off Control */ + kHIDUsage_LED_Coverage = 0x22, /* On/Off Control */ + kHIDUsage_LED_NightMode = 0x23, /* On/Off Control */ + kHIDUsage_LED_SendCalls = 0x24, /* On/Off Control */ + kHIDUsage_LED_CallPickup = 0x25, /* On/Off Control */ + kHIDUsage_LED_Conference = 0x26, /* On/Off Control */ + kHIDUsage_LED_StandBy = 0x27, /* On/Off Control */ + kHIDUsage_LED_CameraOn = 0x28, /* On/Off Control */ + kHIDUsage_LED_CameraOff = 0x29, /* On/Off Control */ + kHIDUsage_LED_OnLine = 0x2A, /* On/Off Control */ + kHIDUsage_LED_OffLine = 0x2B, /* On/Off Control */ + kHIDUsage_LED_Busy = 0x2C, /* On/Off Control */ + kHIDUsage_LED_Ready = 0x2D, /* On/Off Control */ + kHIDUsage_LED_PaperOut = 0x2E, /* On/Off Control */ + kHIDUsage_LED_PaperJam = 0x2F, /* On/Off Control */ + kHIDUsage_LED_Remote = 0x30, /* On/Off Control */ + kHIDUsage_LED_Forward = 0x31, /* On/Off Control */ + kHIDUsage_LED_Reverse = 0x32, /* On/Off Control */ + kHIDUsage_LED_Stop = 0x33, /* On/Off Control */ + kHIDUsage_LED_Rewind = 0x34, /* On/Off Control */ + kHIDUsage_LED_FastForward = 0x35, /* On/Off Control */ + kHIDUsage_LED_Play = 0x36, /* On/Off Control */ + kHIDUsage_LED_Pause = 0x37, /* On/Off Control */ + kHIDUsage_LED_Record = 0x38, /* On/Off Control */ + kHIDUsage_LED_Error = 0x39, /* On/Off Control */ + kHIDUsage_LED_Usage = 0x3A, /* Selector */ + kHIDUsage_LED_UsageInUseIndicator = 0x3B, /* Usage Switch */ + kHIDUsage_LED_UsageMultiModeIndicator = 0x3C, /* Usage Modifier */ + kHIDUsage_LED_IndicatorOn = 0x3D, /* Selector */ + kHIDUsage_LED_IndicatorFlash = 0x3E, /* Selector */ + kHIDUsage_LED_IndicatorSlowBlink = 0x3F, /* Selector */ + kHIDUsage_LED_IndicatorFastBlink = 0x40, /* Selector */ + kHIDUsage_LED_IndicatorOff = 0x41, /* Selector */ + kHIDUsage_LED_FlashOnTime = 0x42, /* Dynamic Value */ + kHIDUsage_LED_SlowBlinkOnTime = 0x43, /* Dynamic Value */ + kHIDUsage_LED_SlowBlinkOffTime = 0x44, /* Dynamic Value */ + kHIDUsage_LED_FastBlinkOnTime = 0x45, /* Dynamic Value */ + kHIDUsage_LED_FastBlinkOffTime = 0x46, /* Dynamic Value */ + kHIDUsage_LED_UsageIndicatorColor = 0x47, /* Usage Modifier */ + kHIDUsage_LED_IndicatorRed = 0x48, /* Selector */ + kHIDUsage_LED_IndicatorGreen = 0x49, /* Selector */ + kHIDUsage_LED_IndicatorAmber = 0x4A, /* Selector */ + kHIDUsage_LED_GenericIndicator = 0x4B, /* On/Off Control */ + kHIDUsage_LED_SystemSuspend = 0x4C, /* On/Off Control */ + kHIDUsage_LED_ExternalPowerConnected = 0x4D, /* On/Off Control */ + kHIDUsage_LED_PlayerIndicator = 0x4E, /* Collection Logical */ + kHIDUsage_LED_Player1 = 0x4F, /* Selector */ + kHIDUsage_LED_Player2 = 0x50, /* Selector */ + kHIDUsage_LED_Player3 = 0x51, /* Selector */ + kHIDUsage_LED_Player4 = 0x52, /* Selector */ + kHIDUsage_LED_Player5 = 0x53, /* Selector */ + kHIDUsage_LED_Player6 = 0x54, /* Selector */ + kHIDUsage_LED_Player7 = 0x55, /* Selector */ + kHIDUsage_LED_Player8 = 0x56, /* Selector */ + /* 0x4E - 0xFFFF Reserved */ + kHIDUsage_LED_Reserved = 0xFFFF +}; + +/* Button Page (0x09) */ +/* The Button page is the first place an application should look for user selection controls. System graphical user interfaces typically employ a pointer and a set of hierarchical selectors to select, move and otherwise manipulate their environment. For these purposes the following assignment of significance can be applied to the Button usages: */ +/* ¥ Button 1, Primary Button. Used for object selecting, dragging, and double click activation. On MacOS, this is the only button. Microsoft operating systems call this a logical left button, because it */ +/* is not necessarily physically located on the left of the pointing device. */ +/* ¥ Button 2, Secondary Button. Used by newer graphical user interfaces to browse object properties. Exposed by systems to applications that typically assign application-specific functionality. */ +/* ¥ Button 3, Tertiary Button. Optional control. Exposed to applications, but seldom assigned functionality due to prevalence of two- and one-button devices. */ +/* ¥ Buttons 4 -55. As the button number increases, its significance as a selector decreases. */ +/* In many ways the assignment of button numbers is similar to the assignment of Effort in Physical descriptors. Button 1 would be used to define the button a finger rests on when the hand is in the Òat restÓ position, that is, virtually no effort is required by the user to activate the button. Button values increment as the finger has to stretch to reach a control. See Section 6.2.3, ÒPhysical Descriptors,Ó in the HID Specification for methods of further qualifying buttons. */ +enum +{ + kHIDUsage_Button_1 = 0x01, /* (primary/trigger) */ + kHIDUsage_Button_2 = 0x02, /* (secondary) */ + kHIDUsage_Button_3 = 0x03, /* (tertiary) */ + kHIDUsage_Button_4 = 0x04, /* 4th button */ + kHIDUsage_Button_5 = 0x05, /* (5th button) */ + kHIDUsage_Button_6 = 0x06, /* (6th button) */ + kHIDUsage_Button_7 = 0x07, /* (7th button) */ + kHIDUsage_Button_8 = 0x08, /* (8th button) */ + kHIDUsage_Button_9 = 0x09, /* (9th button) */ + kHIDUsage_Button_10 = 0x0a, /* (10th button) */ + kHIDUsage_Button_11 = 0x0b, /* (11th button) */ + kHIDUsage_Button_12 = 0x0c, /* (12th button) */ + kHIDUsage_Button_13 = 0x0d, /* (13th button) */ + kHIDUsage_Button_14 = 0x0e, /* (14th button) */ + kHIDUsage_Button_15 = 0x0f, /* (15th button) */ + kHIDUsage_Button_16 = 0x10, /* (16th button) */ + kHIDUsage_Button_17 = 0x11, /* (17th button) */ + kHIDUsage_Button_18 = 0x12, /* (18th button) */ + kHIDUsage_Button_19 = 0x13, /* (19th button) */ + kHIDUsage_Button_20 = 0x14, /* (20th button) */ + kHIDUsage_Button_21 = 0x15, /* (21st button) */ + kHIDUsage_Button_22 = 0x16, /* (22nd button) */ + kHIDUsage_Button_23 = 0x17, /* (23rd button) */ + kHIDUsage_Button_24 = 0x18, /* (24th button) */ + kHIDUsage_Button_25 = 0x19, /* (25th button) */ + kHIDUsage_Button_26 = 0x1a, /* (26th button) */ + kHIDUsage_Button_27 = 0x1b, /* (27th button) */ + kHIDUsage_Button_28 = 0x1c, /* (28th button) */ + kHIDUsage_Button_29 = 0x1d, /* (29th button) */ + kHIDUsage_Button_30 = 0x1e, /* (30th button) */ + kHIDUsage_Button_31 = 0x1f, /* (31st button) */ + kHIDUsage_Button_32 = 0x20, /* (32nd button) */ + kHIDUsage_Button_33 = 0x21, /* (33rd button) */ + kHIDUsage_Button_34 = 0x22, /* (34th button) */ + kHIDUsage_Button_35 = 0x23, /* (35th button) */ + kHIDUsage_Button_36 = 0x24, /* (36th button) */ + kHIDUsage_Button_37 = 0x25, /* (37th button) */ + kHIDUsage_Button_38 = 0x26, /* (38th button) */ + kHIDUsage_Button_39 = 0x27, /* (39th button) */ + kHIDUsage_Button_40 = 0x28, /* (40th button) */ + kHIDUsage_Button_41 = 0x29, /* (41st button) */ + kHIDUsage_Button_42 = 0x2a, /* (42nd button) */ + kHIDUsage_Button_43 = 0x2b, /* (43rd button) */ + kHIDUsage_Button_44 = 0x2c, /* (44th button) */ + kHIDUsage_Button_45 = 0x2d, /* (45th button) */ + kHIDUsage_Button_46 = 0x2e, /* (46th button) */ + kHIDUsage_Button_47 = 0x2f, /* (47th button) */ + kHIDUsage_Button_48 = 0x30, /* (48th button) */ + kHIDUsage_Button_49 = 0x31, /* (49th button) */ + kHIDUsage_Button_50 = 0x32, /* (50th button) */ + kHIDUsage_Button_51 = 0x33, /* (51st button) */ + kHIDUsage_Button_52 = 0x34, /* (52nd button) */ + kHIDUsage_Button_53 = 0x35, /* (53rd button) */ + kHIDUsage_Button_54 = 0x36, /* (54th button) */ + kHIDUsage_Button_55 = 0x37, /* (55th button) */ + kHIDUsage_Button_56 = 0x38, /* (56th button) */ + kHIDUsage_Button_57 = 0x39, /* (57th button) */ + kHIDUsage_Button_58 = 0x3a, /* (58th button) */ + kHIDUsage_Button_59 = 0x3b, /* (59th button) */ + kHIDUsage_Button_60 = 0x3c, /* (60th button) */ + kHIDUsage_Button_61 = 0x3d, /* (61st button) */ + kHIDUsage_Button_62 = 0x3e, /* (62nd button) */ + kHIDUsage_Button_63 = 0x3f, /* (63rd button) */ + kHIDUsage_Button_64 = 0x40, /* (64th button) */ + kHIDUsage_Button_65 = 0x41, /* (65th button) */ + kHIDUsage_Button_66 = 0x42, /* (66th button) */ + kHIDUsage_Button_67 = 0x43, /* (67th button) */ + kHIDUsage_Button_68 = 0x44, /* (68th button) */ + kHIDUsage_Button_69 = 0x45, /* (69th button) */ + kHIDUsage_Button_70 = 0x46, /* (70th button) */ + kHIDUsage_Button_71 = 0x47, /* (71st button) */ + kHIDUsage_Button_72 = 0x48, /* (72nd button) */ + kHIDUsage_Button_73 = 0x49, /* (73rd button) */ + kHIDUsage_Button_74 = 0x4a, /* (74th button) */ + kHIDUsage_Button_75 = 0x4b, /* (75th button) */ + kHIDUsage_Button_76 = 0x4c, /* (76th button) */ + kHIDUsage_Button_77 = 0x4d, /* (77th button) */ + kHIDUsage_Button_78 = 0x4e, /* (78th button) */ + kHIDUsage_Button_79 = 0x4f, /* (79th button) */ + kHIDUsage_Button_80 = 0x50, /* (80th button) */ + kHIDUsage_Button_81 = 0x51, /* (81st button) */ + kHIDUsage_Button_82 = 0x52, /* (82nd button) */ + kHIDUsage_Button_83 = 0x53, /* (83rd button) */ + kHIDUsage_Button_84 = 0x54, /* (84th button) */ + kHIDUsage_Button_85 = 0x55, /* (85th button) */ + kHIDUsage_Button_86 = 0x56, /* (86th button) */ + kHIDUsage_Button_87 = 0x57, /* (87th button) */ + kHIDUsage_Button_88 = 0x58, /* (88th button) */ + kHIDUsage_Button_89 = 0x59, /* (89th button) */ + kHIDUsage_Button_90 = 0x5a, /* (90th button) */ + kHIDUsage_Button_91 = 0x5b, /* (91st button) */ + kHIDUsage_Button_92 = 0x5c, /* (92nd button) */ + kHIDUsage_Button_93 = 0x5d, /* (93rd button) */ + kHIDUsage_Button_94 = 0x5e, /* (94th button) */ + kHIDUsage_Button_95 = 0x5f, /* (95th button) */ + kHIDUsage_Button_96 = 0x60, /* (96th button) */ + kHIDUsage_Button_97 = 0x61, /* (97th button) */ + kHIDUsage_Button_98 = 0x62, /* (98th button) */ + kHIDUsage_Button_99 = 0x63, /* (99th button) */ + kHIDUsage_Button_100 = 0x64, /* (100th button) */ + kHIDUsage_Button_101 = 0x65, /* (101st button) */ + kHIDUsage_Button_102 = 0x66, /* (102nd button) */ + kHIDUsage_Button_103 = 0x67, /* (103rd button) */ + kHIDUsage_Button_104 = 0x68, /* (104th button) */ + kHIDUsage_Button_105 = 0x69, /* (105th button) */ + kHIDUsage_Button_106 = 0x6a, /* (106th button) */ + kHIDUsage_Button_107 = 0x6b, /* (107th button) */ + kHIDUsage_Button_108 = 0x6c, /* (108th button) */ + kHIDUsage_Button_109 = 0x6d, /* (109th button) */ + kHIDUsage_Button_110 = 0x6e, /* (110th button) */ + kHIDUsage_Button_111 = 0x6f, /* (111th button) */ + kHIDUsage_Button_112 = 0x70, /* (112th button) */ + kHIDUsage_Button_113 = 0x71, /* (113th button) */ + kHIDUsage_Button_114 = 0x72, /* (114th button) */ + kHIDUsage_Button_115 = 0x73, /* (115th button) */ + kHIDUsage_Button_116 = 0x74, /* (116th button) */ + kHIDUsage_Button_117 = 0x75, /* (117th button) */ + kHIDUsage_Button_118 = 0x76, /* (118th button) */ + kHIDUsage_Button_119 = 0x77, /* (119th button) */ + kHIDUsage_Button_120 = 0x78, /* (120th button) */ + kHIDUsage_Button_121 = 0x79, /* (121st button) */ + kHIDUsage_Button_122 = 0x7a, /* (122nd button) */ + kHIDUsage_Button_123 = 0x7b, /* (123rd button) */ + kHIDUsage_Button_124 = 0x7c, /* (124th button) */ + kHIDUsage_Button_125 = 0x7d, /* (125th button) */ + kHIDUsage_Button_126 = 0x7e, /* (126th button) */ + kHIDUsage_Button_127 = 0x7f, /* (127th button) */ + kHIDUsage_Button_128 = 0x80, /* (128th button) */ + kHIDUsage_Button_129 = 0x81, /* (129th button) */ + kHIDUsage_Button_130 = 0x82, /* (130th button) */ + kHIDUsage_Button_131 = 0x83, /* (131st button) */ + kHIDUsage_Button_132 = 0x84, /* (132nd button) */ + kHIDUsage_Button_133 = 0x85, /* (133rd button) */ + kHIDUsage_Button_134 = 0x86, /* (134th button) */ + kHIDUsage_Button_135 = 0x87, /* (135th button) */ + kHIDUsage_Button_136 = 0x88, /* (136th button) */ + kHIDUsage_Button_137 = 0x89, /* (137th button) */ + kHIDUsage_Button_138 = 0x8a, /* (138th button) */ + kHIDUsage_Button_139 = 0x8b, /* (139th button) */ + kHIDUsage_Button_140 = 0x8c, /* (140th button) */ + kHIDUsage_Button_141 = 0x8d, /* (141st button) */ + kHIDUsage_Button_142 = 0x8e, /* (142nd button) */ + kHIDUsage_Button_143 = 0x8f, /* (143rd button) */ + kHIDUsage_Button_144 = 0x90, /* (144th button) */ + kHIDUsage_Button_145 = 0x91, /* (145th button) */ + kHIDUsage_Button_146 = 0x92, /* (146th button) */ + kHIDUsage_Button_147 = 0x93, /* (147th button) */ + kHIDUsage_Button_148 = 0x94, /* (148th button) */ + kHIDUsage_Button_149 = 0x95, /* (149th button) */ + kHIDUsage_Button_150 = 0x96, /* (150th button) */ + kHIDUsage_Button_151 = 0x97, /* (151st button) */ + kHIDUsage_Button_152 = 0x98, /* (152nd button) */ + kHIDUsage_Button_153 = 0x99, /* (153rd button) */ + kHIDUsage_Button_154 = 0x9a, /* (154th button) */ + kHIDUsage_Button_155 = 0x9b, /* (155th button) */ + kHIDUsage_Button_156 = 0x9c, /* (156th button) */ + kHIDUsage_Button_157 = 0x9d, /* (157th button) */ + kHIDUsage_Button_158 = 0x9e, /* (158th button) */ + kHIDUsage_Button_159 = 0x9f, /* (159th button) */ + kHIDUsage_Button_160 = 0xa0, /* (160th button) */ + kHIDUsage_Button_161 = 0xa1, /* (161st button) */ + kHIDUsage_Button_162 = 0xa2, /* (162nd button) */ + kHIDUsage_Button_163 = 0xa3, /* (163rd button) */ + kHIDUsage_Button_164 = 0xa4, /* (164th button) */ + kHIDUsage_Button_165 = 0xa5, /* (165th button) */ + kHIDUsage_Button_166 = 0xa6, /* (166th button) */ + kHIDUsage_Button_167 = 0xa7, /* (167th button) */ + kHIDUsage_Button_168 = 0xa8, /* (168th button) */ + kHIDUsage_Button_169 = 0xa9, /* (169th button) */ + kHIDUsage_Button_170 = 0xaa, /* (170th button) */ + kHIDUsage_Button_171 = 0xab, /* (171st button) */ + kHIDUsage_Button_172 = 0xac, /* (172nd button) */ + kHIDUsage_Button_173 = 0xad, /* (173rd button) */ + kHIDUsage_Button_174 = 0xae, /* (174th button) */ + kHIDUsage_Button_175 = 0xaf, /* (175th button) */ + kHIDUsage_Button_176 = 0xb0, /* (176th button) */ + kHIDUsage_Button_177 = 0xb1, /* (177th button) */ + kHIDUsage_Button_178 = 0xb2, /* (178th button) */ + kHIDUsage_Button_179 = 0xb3, /* (179th button) */ + kHIDUsage_Button_180 = 0xb4, /* (180th button) */ + kHIDUsage_Button_181 = 0xb5, /* (181st button) */ + kHIDUsage_Button_182 = 0xb6, /* (182nd button) */ + kHIDUsage_Button_183 = 0xb7, /* (183rd button) */ + kHIDUsage_Button_184 = 0xb8, /* (184th button) */ + kHIDUsage_Button_185 = 0xb9, /* (185th button) */ + kHIDUsage_Button_186 = 0xba, /* (186th button) */ + kHIDUsage_Button_187 = 0xbb, /* (187th button) */ + kHIDUsage_Button_188 = 0xbc, /* (188th button) */ + kHIDUsage_Button_189 = 0xbd, /* (189th button) */ + kHIDUsage_Button_190 = 0xbe, /* (190th button) */ + kHIDUsage_Button_191 = 0xbf, /* (191st button) */ + kHIDUsage_Button_192 = 0xc0, /* (192nd button) */ + kHIDUsage_Button_193 = 0xc1, /* (193rd button) */ + kHIDUsage_Button_194 = 0xc2, /* (194th button) */ + kHIDUsage_Button_195 = 0xc3, /* (195th button) */ + kHIDUsage_Button_196 = 0xc4, /* (196th button) */ + kHIDUsage_Button_197 = 0xc5, /* (197th button) */ + kHIDUsage_Button_198 = 0xc6, /* (198th button) */ + kHIDUsage_Button_199 = 0xc7, /* (199th button) */ + kHIDUsage_Button_200 = 0xc8, /* (200th button) */ + kHIDUsage_Button_201 = 0xc9, /* (201st button) */ + kHIDUsage_Button_202 = 0xca, /* (202nd button) */ + kHIDUsage_Button_203 = 0xcb, /* (203rd button) */ + kHIDUsage_Button_204 = 0xcc, /* (204th button) */ + kHIDUsage_Button_205 = 0xcd, /* (205th button) */ + kHIDUsage_Button_206 = 0xce, /* (206th button) */ + kHIDUsage_Button_207 = 0xcf, /* (207th button) */ + kHIDUsage_Button_208 = 0xd0, /* (208th button) */ + kHIDUsage_Button_209 = 0xd1, /* (209th button) */ + kHIDUsage_Button_210 = 0xd2, /* (210th button) */ + kHIDUsage_Button_211 = 0xd3, /* (211th button) */ + kHIDUsage_Button_212 = 0xd4, /* (212th button) */ + kHIDUsage_Button_213 = 0xd5, /* (213th button) */ + kHIDUsage_Button_214 = 0xd6, /* (214th button) */ + kHIDUsage_Button_215 = 0xd7, /* (215th button) */ + kHIDUsage_Button_216 = 0xd8, /* (216th button) */ + kHIDUsage_Button_217 = 0xd9, /* (217th button) */ + kHIDUsage_Button_218 = 0xda, /* (218th button) */ + kHIDUsage_Button_219 = 0xdb, /* (219th button) */ + kHIDUsage_Button_220 = 0xdc, /* (220th button) */ + kHIDUsage_Button_221 = 0xdd, /* (221st button) */ + kHIDUsage_Button_222 = 0xde, /* (222nd button) */ + kHIDUsage_Button_223 = 0xdf, /* (223rd button) */ + kHIDUsage_Button_224 = 0xe0, /* (224th button) */ + kHIDUsage_Button_225 = 0xe1, /* (225th button) */ + kHIDUsage_Button_226 = 0xe2, /* (226th button) */ + kHIDUsage_Button_227 = 0xe3, /* (227th button) */ + kHIDUsage_Button_228 = 0xe4, /* (228th button) */ + kHIDUsage_Button_229 = 0xe5, /* (229th button) */ + kHIDUsage_Button_230 = 0xe6, /* (230th button) */ + kHIDUsage_Button_231 = 0xe7, /* (231st button) */ + kHIDUsage_Button_232 = 0xe8, /* (232nd button) */ + kHIDUsage_Button_233 = 0xe9, /* (233rd button) */ + kHIDUsage_Button_234 = 0xea, /* (234th button) */ + kHIDUsage_Button_235 = 0xeb, /* (235th button) */ + kHIDUsage_Button_236 = 0xec, /* (236th button) */ + kHIDUsage_Button_237 = 0xed, /* (237th button) */ + kHIDUsage_Button_238 = 0xee, /* (238th button) */ + kHIDUsage_Button_239 = 0xef, /* (239th button) */ + kHIDUsage_Button_240 = 0xf0, /* (240th button) */ + kHIDUsage_Button_241 = 0xf1, /* (241st button) */ + kHIDUsage_Button_242 = 0xf2, /* (242nd button) */ + kHIDUsage_Button_243 = 0xf3, /* (243rd button) */ + kHIDUsage_Button_244 = 0xf4, /* (244th button) */ + kHIDUsage_Button_245 = 0xf5, /* (245th button) */ + kHIDUsage_Button_246 = 0xf6, /* (246th button) */ + kHIDUsage_Button_247 = 0xf7, /* (247th button) */ + kHIDUsage_Button_248 = 0xf8, /* (248th button) */ + kHIDUsage_Button_249 = 0xf9, /* (249th button) */ + kHIDUsage_Button_250 = 0xfa, /* (250th button) */ + kHIDUsage_Button_251 = 0xfb, /* (251st button) */ + kHIDUsage_Button_252 = 0xfc, /* (252nd button) */ + kHIDUsage_Button_253 = 0xfd, /* (253rd button) */ + kHIDUsage_Button_254 = 0xfe, /* (254th button) */ + kHIDUsage_Button_255 = 0xff, /* (255th button) */ + /* ... */ + kHIDUsage_Button_65535 = 0xFFFF +}; + +/* Ordinal Page (0x0A) */ +/* The Ordinal page allows multiple instances of a control or sets of controls to be declared without requiring individual enumeration in the native usage page. For example, it is not necessary to declare usages of Pointer 1, Pointer 2, and so forth on the Generic Desktop page. When parsed, the ordinal instance number is, in essence, concatenated to the usages attached to the encompassing collection to create Pointer 1, Pointer 2, and so forth. */ +/* For an example, see Section A.5, ÒMultiple Instances of a Control,Ó in Appendix A, ÒUsage Examples.Ó By convention, an Ordinal collection is placed inside the collection for which it is declaring multiple instances. */ +/* Instances do not have to be identical. */ +enum +{ + /* 0x00 Reserved */ + kHIDUsage_Ord_Instance1 = 0x01, /* Usage Modifier */ + kHIDUsage_Ord_Instance2 = 0x02, /* Usage Modifier */ + kHIDUsage_Ord_Instance3 = 0x03, /* Usage Modifier */ + kHIDUsage_Ord_Instance4 = 0x04, /* Usage Modifier */ + kHIDUsage_Ord_Instance65535 = 0xFFFF /* Usage Modifier */ +}; + +/* Telephony Page (0x0B) */ +/* This usage page defines the keytop and control usages for telephony devices. */ +/* Indicators on a phone are handled by wrapping them in LED: Usage In Use Indicator and LED: Usage Selected Indicator usages. For example, a message-indicator LED would be identified by a Telephony: Message usage declared as a Feature or Output in a LED: Usage In Use Indicator collection. */ +/* See Section 14, ÒConsumer Page (0x0C),Ó for audio volume and tone controls. */ +enum +{ + kHIDUsage_Tfon_Phone = 0x01, /* Application Collection */ + kHIDUsage_Tfon_AnsweringMachine = 0x02, /* Application Collection */ + kHIDUsage_Tfon_MessageControls = 0x03, /* Logical Collection */ + kHIDUsage_Tfon_Handset = 0x04, /* Logical Collection */ + kHIDUsage_Tfon_Headset = 0x05, /* Logical Collection */ + kHIDUsage_Tfon_TelephonyKeyPad = 0x06, /* Named Array */ + kHIDUsage_Tfon_ProgrammableButton = 0x07, /* Named Array */ + /* 0x08 - 0x1F Reserved */ + kHIDUsage_Tfon_HookSwitch = 0x20, /* On/Off Control */ + kHIDUsage_Tfon_Flash = 0x21, /* Momentary Control */ + kHIDUsage_Tfon_Feature = 0x22, /* One-Shot Control */ + kHIDUsage_Tfon_Hold = 0x23, /* On/Off Control */ + kHIDUsage_Tfon_Redial = 0x24, /* One-Shot Control */ + kHIDUsage_Tfon_Transfer = 0x25, /* One-Shot Control */ + kHIDUsage_Tfon_Drop = 0x26, /* One-Shot Control */ + kHIDUsage_Tfon_Park = 0x27, /* On/Off Control */ + kHIDUsage_Tfon_ForwardCalls = 0x28, /* On/Off Control */ + kHIDUsage_Tfon_AlternateFunction = 0x29, /* Momentary Control */ + kHIDUsage_Tfon_Line = 0x2A, /* One-Shot Control */ + kHIDUsage_Tfon_SpeakerPhone = 0x2B, /* On/Off Control */ + kHIDUsage_Tfon_Conference = 0x2C, /* On/Off Control */ + kHIDUsage_Tfon_RingEnable = 0x2D, /* On/Off Control */ + kHIDUsage_Tfon_Ring = 0x2E, /* Selector */ + kHIDUsage_Tfon_PhoneMute = 0x2F, /* On/Off Control */ + kHIDUsage_Tfon_CallerID = 0x30, /* Momentary Control */ + /* 0x31 - 0x4F Reserved */ + kHIDUsage_Tfon_SpeedDial = 0x50, /* One-Shot Control */ + kHIDUsage_Tfon_StoreNumber = 0x51, /* One-Shot Control */ + kHIDUsage_Tfon_RecallNumber = 0x52, /* One-Shot Control */ + kHIDUsage_Tfon_PhoneDirectory = 0x53, /* On/Off Control */ + /* 0x54 - 0x6F Reserved */ + kHIDUsage_Tfon_VoiceMail = 0x70, /* On/Off Control */ + kHIDUsage_Tfon_ScreenCalls = 0x71, /* On/Off Control */ + kHIDUsage_Tfon_DoNotDisturb = 0x72, /* On/Off Control */ + kHIDUsage_Tfon_Message = 0x73, /* One-Shot Control */ + kHIDUsage_Tfon_AnswerOnOrOff = 0x74, /* On/Off Control */ + /* 0x75 - 0x8F Reserved */ + kHIDUsage_Tfon_InsideDialTone = 0x90, /* Momentary Control */ + kHIDUsage_Tfon_OutsideDialTone = 0x91, /* Momentary Control */ + kHIDUsage_Tfon_InsideRingTone = 0x92, /* Momentary Control */ + kHIDUsage_Tfon_OutsideRingTone = 0x93, /* Momentary Control */ + kHIDUsage_Tfon_PriorityRingTone = 0x94, /* Momentary Control */ + kHIDUsage_Tfon_InsideRingback = 0x95, /* Momentary Control */ + kHIDUsage_Tfon_PriorityRingback = 0x96, /* Momentary Control */ + kHIDUsage_Tfon_LineBusyTone = 0x97, /* Momentary Control */ + kHIDUsage_Tfon_ReorderTone = 0x98, /* Momentary Control */ + kHIDUsage_Tfon_CallWaitingTone = 0x99, /* Momentary Control */ + kHIDUsage_Tfon_ConfirmationTone1 = 0x9A, /* Momentary Control */ + kHIDUsage_Tfon_ConfirmationTone2 = 0x9B, /* Momentary Control */ + kHIDUsage_Tfon_TonesOff = 0x9C, /* On/Off Control */ + kHIDUsage_Tfon_OutsideRingback = 0x9D, /* Momentary Control */ + /* 0x9E - 0xAF Reserved */ + kHIDUsage_Tfon_PhoneKey0 = 0xB0, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey1 = 0xB1, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey2 = 0xB2, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey3 = 0xB3, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey4 = 0xB4, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey5 = 0xB5, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey6 = 0xB6, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey7 = 0xB7, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey8 = 0xB8, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey9 = 0xB9, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyStar = 0xBA, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyPound = 0xBB, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyA = 0xBC, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyB = 0xBD, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyC = 0xBE, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyD = 0xBF, /* Selector/One-Shot Control */ + /* 0xC0 - 0xFFFF Reserved */ + kHIDUsage_TFon_Reserved = 0xFFFF +}; + +/* Consumer Page (0x0C) */ +/* All controls on the Consumer page are application-specific. That is, they affect a specific device, not the system as a whole. */ +enum +{ + kHIDUsage_Csmr_ConsumerControl = 0x01, /* Application Collection */ + kHIDUsage_Csmr_NumericKeyPad = 0x02, /* Named Array */ + kHIDUsage_Csmr_ProgrammableButtons = 0x03, /* Named Array */ + kHIDUsage_Csmr_Microphone = 0x04, /* Application Collection */ + kHIDUsage_Csmr_Headphone = 0x05, /* Application Collection */ + kHIDUsage_Csmr_GraphicEqualizer = 0x06, /* Application Collection */ + /* 0x07 - 0x1F Reserved */ + kHIDUsage_Csmr_Plus10 = 0x20, /* One-Shot Control */ + kHIDUsage_Csmr_Plus100 = 0x21, /* One-Shot Control */ + kHIDUsage_Csmr_AMOrPM = 0x22, /* One-Shot Control */ + /* 0x23 - 0x3F Reserved */ + kHIDUsage_Csmr_Power = 0x30, /* On/Off Control */ + kHIDUsage_Csmr_Reset = 0x31, /* One-Shot Control */ + kHIDUsage_Csmr_Sleep = 0x32, /* One-Shot Control */ + kHIDUsage_Csmr_SleepAfter = 0x33, /* One-Shot Control */ + kHIDUsage_Csmr_SleepMode = 0x34, /* Re-Trigger Control */ + kHIDUsage_Csmr_Illumination = 0x35, /* On/Off Control */ + kHIDUsage_Csmr_FunctionButtons = 0x36, /* Named Array */ + /* 0x37 - 0x3F Reserved */ + kHIDUsage_Csmr_Menu = 0x40, /* On/Off Control */ + kHIDUsage_Csmr_MenuPick = 0x41, /* One-Shot Control */ + kHIDUsage_Csmr_MenuUp = 0x42, /* One-Shot Control */ + kHIDUsage_Csmr_MenuDown = 0x43, /* One-Shot Control */ + kHIDUsage_Csmr_MenuLeft = 0x44, /* One-Shot Control */ + kHIDUsage_Csmr_MenuRight = 0x45, /* One-Shot Control */ + kHIDUsage_Csmr_MenuEscape = 0x46, /* One-Shot Control */ + kHIDUsage_Csmr_MenuValueIncrease = 0x47, /* One-Shot Control */ + kHIDUsage_Csmr_MenuValueDecrease = 0x48, /* One-Shot Control */ + /* 0x49 - 0x5F Reserved */ + kHIDUsage_Csmr_DataOnScreen = 0x60, /* On/Off Control */ + kHIDUsage_Csmr_ClosedCaption = 0x61, /* On/Off Control */ + kHIDUsage_Csmr_ClosedCaptionSelect = 0x62, /* Selector */ + kHIDUsage_Csmr_VCROrTV = 0x63, /* On/Off Control */ + kHIDUsage_Csmr_BroadcastMode = 0x64, /* One-Shot Control */ + kHIDUsage_Csmr_Snapshot = 0x65, /* One-Shot Control */ + kHIDUsage_Csmr_Still = 0x66, /* One-Shot Control */ + kHIDUsage_Csmr_PictureInPictureToggle = 0x67, /* One-Shot Control */ + kHIDUsage_Csmr_PictureInPictureSwap = 0x68, /* One-Shot Control */ + kHIDUsage_Csmr_RedMenuButton = 0x69, /* Momentary Control */ + kHIDUsage_Csmr_GreenMenuButton = 0x6A, /* Momentary Control */ + kHIDUsage_Csmr_BlueMenuButton = 0x6B, /* Momentary Control */ + kHIDUsage_Csmr_YellowMenuButton = 0x6C, /* Momentary Control */ + kHIDUsage_Csmr_Aspect = 0x6D, /* One-shot Control */ + kHIDUsage_Csmr_3DModeSelect = 0x6E, /* One-shot Control */ + kHIDUsage_Csmr_DisplayBrightnessIncrement = 0x6F, /* Re-Trigger Control */ + kHIDUsage_Csmr_DisplayBrightnessDecrement = 0x70, /* Re-Trigger Control */ + kHIDUsage_Csmr_DisplayBrightness = 0x71, /* Logical Collection */ + kHIDUsage_Csmr_DisplayBacklightToggle = 0x72, /* One Shot Control */ + kHIDUsage_Csmr_DisplayBrightnessMinimum = 0x73, /* One Shot Control */ + kHIDUsage_Csmr_DisplayBrightnessMaximum = 0x74, /* One Shot Control */ + kHIDUsage_Csmr_DisplayBrightnessSetAutoBrightness = 0x75, /* On Off Control */ + kHIDUsage_Csmr_KeyboardBrightnessIncrement = 0x79, /* Re-Trigger Control */ + kHIDUsage_Csmr_KeyboardBrightnessDecrement = 0x7A, /* Re-Trigger Control */ + /* 0x7B - 0x7F Reserved */ + kHIDUsage_Csmr_Selection = 0x80, /* Named Array */ + kHIDUsage_Csmr_Assign = 0x81, /* Selector */ + kHIDUsage_Csmr_ModeStep = 0x82, /* One-Shot Control */ + kHIDUsage_Csmr_RecallLast = 0x83, /* One-Shot Control */ + kHIDUsage_Csmr_EnterChannel = 0x84, /* One-Shot Control */ + kHIDUsage_Csmr_OrderMovie = 0x85, /* One-Shot Control */ + kHIDUsage_Csmr_Channel = 0x86, /* Linear Control */ + kHIDUsage_Csmr_MediaSelection = 0x87, /* Selector */ + kHIDUsage_Csmr_MediaSelectComputer = 0x88, /* Selector */ + kHIDUsage_Csmr_MediaSelectTV = 0x89, /* Selector */ + kHIDUsage_Csmr_MediaSelectWWW = 0x8A, /* Selector */ + kHIDUsage_Csmr_MediaSelectDVD = 0x8B, /* Selector */ + kHIDUsage_Csmr_MediaSelectTelephone = 0x8C, /* Selector */ + kHIDUsage_Csmr_MediaSelectProgramGuide = 0x8D, /* Selector */ + kHIDUsage_Csmr_MediaSelectVideoPhone = 0x8E, /* Selector */ + kHIDUsage_Csmr_MediaSelectGames = 0x8F, /* Selector */ + kHIDUsage_Csmr_MediaSelectMessages = 0x90, /* Selector */ + kHIDUsage_Csmr_MediaSelectCD = 0x91, /* Selector */ + kHIDUsage_Csmr_MediaSelectVCR = 0x92, /* Selector */ + kHIDUsage_Csmr_MediaSelectTuner = 0x93, /* Selector */ + kHIDUsage_Csmr_Quit = 0x94, /* One-Shot Control */ + kHIDUsage_Csmr_Help = 0x95, /* On/Off Control */ + kHIDUsage_Csmr_MediaSelectTape = 0x96, /* Selector */ + kHIDUsage_Csmr_MediaSelectCable = 0x97, /* Selector */ + kHIDUsage_Csmr_MediaSelectSatellite = 0x98, /* Selector */ + kHIDUsage_Csmr_MediaSelectSecurity = 0x99, /* Selector */ + kHIDUsage_Csmr_MediaSelectHome = 0x9A, /* Selector */ + kHIDUsage_Csmr_MediaSelectCall = 0x9B, /* Selector */ + kHIDUsage_Csmr_ChannelIncrement = 0x9C, /* One-Shot Control */ + kHIDUsage_Csmr_ChannelDecrement = 0x9D, /* One-Shot Control */ + kHIDUsage_Csmr_Media = 0x9E, /* Selector */ + /* 0x9F Reserved */ + kHIDUsage_Csmr_VCRPlus = 0xA0, /* One-Shot Control */ + kHIDUsage_Csmr_Once = 0xA1, /* One-Shot Control */ + kHIDUsage_Csmr_Daily = 0xA2, /* One-Shot Control */ + kHIDUsage_Csmr_Weekly = 0xA3, /* One-Shot Control */ + kHIDUsage_Csmr_Monthly = 0xA4, /* One-Shot Control */ + /* 0xA5 - 0xAF Reserved */ + kHIDUsage_Csmr_Play = 0xB0, /* On/Off Control */ + kHIDUsage_Csmr_Pause = 0xB1, /* On/Off Control */ + kHIDUsage_Csmr_Record = 0xB2, /* On/Off Control */ + kHIDUsage_Csmr_FastForward = 0xB3, /* On/Off Control */ + kHIDUsage_Csmr_Rewind = 0xB4, /* On/Off Control */ + kHIDUsage_Csmr_ScanNextTrack = 0xB5, /* One-Shot Control */ + kHIDUsage_Csmr_ScanPreviousTrack = 0xB6, /* One-Shot Control */ + kHIDUsage_Csmr_Stop = 0xB7, /* One-Shot Control */ + kHIDUsage_Csmr_Eject = 0xB8, /* One-Shot Control */ + kHIDUsage_Csmr_RandomPlay = 0xB9, /* On/Off Control */ + kHIDUsage_Csmr_SelectDisc = 0xBA, /* Named Array */ + kHIDUsage_Csmr_EnterDisc = 0xBB, /* Momentary Control */ + kHIDUsage_Csmr_Repeat = 0xBC, /* One-Shot Control */ + kHIDUsage_Csmr_Tracking = 0xBD, /* Linear Control */ + kHIDUsage_Csmr_TrackNormal = 0xBE, /* One-Shot Control */ + kHIDUsage_Csmr_SlowTracking = 0xBF, /* Linear Control */ + kHIDUsage_Csmr_FrameForward = 0xC0, /* Re-Trigger Control */ + kHIDUsage_Csmr_FrameBack = 0xC1, /* Re-Trigger Control */ + kHIDUsage_Csmr_Mark = 0xC2, /* One-Shot Control */ + kHIDUsage_Csmr_ClearMark = 0xC3, /* One-Shot Control */ + kHIDUsage_Csmr_RepeatFromMark = 0xC4, /* On/Off Control */ + kHIDUsage_Csmr_ReturnToMark = 0xC5, /* One-Shot Control */ + kHIDUsage_Csmr_SearchMarkForward = 0xC6, /* One-Shot Control */ + kHIDUsage_Csmr_SearchMarkBackwards = 0xC7, /* One-Shot Control */ + kHIDUsage_Csmr_CounterReset = 0xC8, /* One-Shot Control */ + kHIDUsage_Csmr_ShowCounter = 0xC9, /* One-Shot Control */ + kHIDUsage_Csmr_TrackingIncrement = 0xCA, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrackingDecrement = 0xCB, /* Re-Trigger Control */ + kHIDUsage_Csmr_StopOrEject = 0xCC, /* One-Shot Control */ + kHIDUsage_Csmr_PlayOrPause = 0xCD, /* One-Shot Control */ + kHIDUsage_Csmr_PlayOrSkip = 0xCE, /* One-Shot Control */ + kHIDUsage_Csmr_VoiceCommand = 0xCF, /* One-Shot Control */ + /* 0xCF - 0xDF Reserved */ + kHIDUsage_Csmr_Volume = 0xE0, /* Linear Control */ + kHIDUsage_Csmr_Balance = 0xE1, /* Linear Control */ + kHIDUsage_Csmr_Mute = 0xE2, /* On/Off Control */ + kHIDUsage_Csmr_Bass = 0xE3, /* Linear Control */ + kHIDUsage_Csmr_Treble = 0xE4, /* Linear Control */ + kHIDUsage_Csmr_BassBoost = 0xE5, /* On/Off Control */ + kHIDUsage_Csmr_SurroundMode = 0xE6, /* One-Shot Control */ + kHIDUsage_Csmr_Loudness = 0xE7, /* On/Off Control */ + kHIDUsage_Csmr_MPX = 0xE8, /* On/Off Control */ + kHIDUsage_Csmr_VolumeIncrement = 0xE9, /* Re-Trigger Control */ + kHIDUsage_Csmr_VolumeDecrement = 0xEA, /* Re-Trigger Control */ + /* 0xEB - 0xEF Reserved */ + kHIDUsage_Csmr_Speed = 0xF0, /* Selector */ + kHIDUsage_Csmr_PlaybackSpeed = 0xF1, /* Named Array */ + kHIDUsage_Csmr_StandardPlay = 0xF2, /* Selector */ + kHIDUsage_Csmr_LongPlay = 0xF3, /* Selector */ + kHIDUsage_Csmr_ExtendedPlay = 0xF4, /* Selector */ + kHIDUsage_Csmr_Slow = 0xF5, /* One-Shot Control */ + /* 0xF6 - 0xFF Reserved */ + kHIDUsage_Csmr_FanEnable = 0x100, /* On/Off Control */ + kHIDUsage_Csmr_FanSpeed = 0x101, /* Linear Control */ + kHIDUsage_Csmr_LightEnable = 0x102, /* On/Off Control */ + kHIDUsage_Csmr_LightIlluminationLevel = 0x103, /* Linear Control */ + kHIDUsage_Csmr_ClimateControlEnable = 0x104, /* On/Off Control */ + kHIDUsage_Csmr_RoomTemperature = 0x105, /* Linear Control */ + kHIDUsage_Csmr_SecurityEnable = 0x106, /* On/Off Control */ + kHIDUsage_Csmr_FireAlarm = 0x107, /* One-Shot Control */ + kHIDUsage_Csmr_PoliceAlarm = 0x108, /* One-Shot Control */ + kHIDUsage_Csmr_Proximity = 0x109, /* Linear Control */ + kHIDUsage_Csmr_Motion = 0x10A, /* One-Shot Control */ + kHIDUsage_Csmr_DuressAlarm = 0x10B, /* One-Shot Control */ + kHIDUsage_Csmr_HoldupAlarm = 0x10C, /* One-Shot Control */ + kHIDUsage_Csmr_MedicalAlarm = 0x10D, /* One-Shot Control */ + /* 0x10E - 0x14F Reserved */ + kHIDUsage_Csmr_BalanceRight = 0x150, /* Re-Trigger Control */ + kHIDUsage_Csmr_BalanceLeft = 0x151, /* Re-Trigger Control */ + kHIDUsage_Csmr_BassIncrement = 0x152, /* Re-Trigger Control */ + kHIDUsage_Csmr_BassDecrement = 0x153, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrebleIncrement = 0x154, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrebleDecrement = 0x155, /* Re-Trigger Control */ + /* 0x156 - 0x15F Reserved */ + kHIDUsage_Csmr_SpeakerSystem = 0x160, /* Logical Collection */ + kHIDUsage_Csmr_ChannelLeft = 0x161, /* Logical Collection */ + kHIDUsage_Csmr_ChannelRight = 0x162, /* Logical Collection */ + kHIDUsage_Csmr_ChannelCenter = 0x163, /* Logical Collection */ + kHIDUsage_Csmr_ChannelFront = 0x164, /* Logical Collection */ + kHIDUsage_Csmr_ChannelCenterFront = 0x165, /* Logical Collection */ + kHIDUsage_Csmr_ChannelSide = 0x166, /* Logical Collection */ + kHIDUsage_Csmr_ChannelSurround = 0x167, /* Logical Collection */ + kHIDUsage_Csmr_ChannelLowFrequencyEnhancement = 0x168, /* Logical Collection */ + kHIDUsage_Csmr_ChannelTop = 0x169, /* Logical Collection */ + kHIDUsage_Csmr_ChannelUnknown = 0x16A, /* Logical Collection */ + /* 0x16B - 0x16F Reserved */ + kHIDUsage_Csmr_SubChannel = 0x170, /* Linear Control */ + kHIDUsage_Csmr_SubChannelIncrement = 0x171, /* One-Shot Control */ + kHIDUsage_Csmr_SubChannelDecrement = 0x172, /* One-Shot Control */ + kHIDUsage_Csmr_AlternateAudioIncrement = 0x173, /* One-Shot Control */ + kHIDUsage_Csmr_AlternateAudioDecrement = 0x174, /* One-Shot Control */ + /* 0x175 - 0x17F Reserved */ + kHIDUsage_Csmr_ApplicationLaunchButtons = 0x180, /* Named Array */ + kHIDUsage_Csmr_ALLaunchButtonConfigurationTool = 0x181, /* Selector */ + kHIDUsage_Csmr_ALProgrammableButtonConfiguration = 0x182, /* Selector */ + kHIDUsage_Csmr_ALConsumerControlConfiguration = 0x183, /* Selector */ + kHIDUsage_Csmr_ALWordProcessor = 0x184, /* Selector */ + kHIDUsage_Csmr_ALTextEditor = 0x185, /* Selector */ + kHIDUsage_Csmr_ALSpreadsheet = 0x186, /* Selector */ + kHIDUsage_Csmr_ALGraphicsEditor = 0x187, /* Selector */ + kHIDUsage_Csmr_ALPresentationApp = 0x188, /* Selector */ + kHIDUsage_Csmr_ALDatabaseApp = 0x189, /* Selector */ + kHIDUsage_Csmr_ALEmailReader = 0x18A, /* Selector */ + kHIDUsage_Csmr_ALNewsreader = 0x18B, /* Selector */ + kHIDUsage_Csmr_ALVoicemail = 0x18C, /* Selector */ + kHIDUsage_Csmr_ALContactsOrAddressBook = 0x18D, /* Selector */ + kHIDUsage_Csmr_ALCalendarOrSchedule = 0x18E, /* Selector */ + kHIDUsage_Csmr_ALTaskOrProjectManager = 0x18F, /* Selector */ + kHIDUsage_Csmr_ALLogOrJournalOrTimecard = 0x190, /* Selector */ + kHIDUsage_Csmr_ALCheckbookOrFinance = 0x191, /* Selector */ + kHIDUsage_Csmr_ALCalculator = 0x192, /* Selector */ + kHIDUsage_Csmr_ALAOrVCaptureOrPlayback = 0x193, /* Selector */ + kHIDUsage_Csmr_ALLocalMachineBrowser = 0x194, /* Selector */ + kHIDUsage_Csmr_ALLANOrWANBrowser = 0x195, /* Selector */ + kHIDUsage_Csmr_ALInternetBrowser = 0x196, /* Selector */ + kHIDUsage_Csmr_ALRemoteNetworkingOrISPConnect = 0x197, /* Selector */ + kHIDUsage_Csmr_ALNetworkConference = 0x198, /* Selector */ + kHIDUsage_Csmr_ALNetworkChat = 0x199, /* Selector */ + kHIDUsage_Csmr_ALTelephonyOrDialer = 0x19A, /* Selector */ + kHIDUsage_Csmr_ALLogon = 0x19B, /* Selector */ + kHIDUsage_Csmr_ALLogoff = 0x19C, /* Selector */ + kHIDUsage_Csmr_ALLogonOrLogoff = 0x19D, /* Selector */ + kHIDUsage_Csmr_ALTerminalLockOrScreensaver = 0x19E, /* Selector */ + kHIDUsage_Csmr_ALControlPanel = 0x19F, /* Selector */ + kHIDUsage_Csmr_ALCommandLineProcessorOrRun = 0x1A0, /* Selector */ + kHIDUsage_Csmr_ALProcessOrTaskManager = 0x1A1, /* Selector */ + kHIDUsage_Csmr_AL = 0x1A2, /* Selector */ + kHIDUsage_Csmr_ALNextTaskOrApplication = 0x1A3, /* Selector */ + kHIDUsage_Csmr_ALPreviousTaskOrApplication = 0x1A4, /* Selector */ + kHIDUsage_Csmr_ALPreemptiveHaltTaskOrApplication = 0x1A5, /* Selector */ + kHIDUsage_Csmr_ALIntegratedHelpCenter = 0x1A6, /* Selector */ + kHIDUsage_Csmr_ALDocuments = 0x1A7, /* Selector */ + kHIDUsage_Csmr_ALThesaurus = 0x1A8, /* Selector */ + kHIDUsage_Csmr_ALDictionary = 0x1A9, /* Selector */ + kHIDUsage_Csmr_ALDesktop = 0x1AA, /* Selector */ + kHIDUsage_Csmr_ALSpellCheck = 0x1AB, /* Selector */ + kHIDUsage_Csmr_ALGrammerCheck = 0x1AC, /* Selector */ + kHIDUsage_Csmr_ALWirelessStatus = 0x1AD, /* Selector */ + kHIDUsage_Csmr_ALKeyboardLayout = 0x1AE, /* Selector */ + kHIDUsage_Csmr_ALVirusProtection = 0x1AF, /* Selector */ + kHIDUsage_Csmr_ALEncryption = 0x1B0, /* Selector */ + kHIDUsage_Csmr_ALScreenSaver = 0x1B1, /* Selector */ + kHIDUsage_Csmr_ALAlarms = 0x1B2, /* Selector */ + kHIDUsage_Csmr_ALClock = 0x1B3, /* Selector */ + kHIDUsage_Csmr_ALFileBrowser = 0x1B4, /* Selector */ + kHIDUsage_Csmr_ALPowerStatus = 0x1B5, /* Selector */ + kHIDUsage_Csmr_ALImageBrowser = 0x1B6, /* Selector */ + kHIDUsage_Csmr_ALAudioBrowser = 0x1B7, /* Selector */ + kHIDUsage_Csmr_ALMovieBrowser = 0x1B8, /* Selector */ + kHIDUsage_Csmr_ALDigitalRightsManager = 0x1B9, /* Selector */ + kHIDUsage_Csmr_ALDigitalWallet = 0x1BA, /* Selector */ + /* 0x1BB Reserved */ + kHIDUsage_Csmr_ALInstantMessaging = 0x1BC, /* Selector */ + kHIDUsage_Csmr_ALOEMFeatureBrowser = 0x1BD, /* Selector */ + kHIDUsage_Csmr_ALOEMHelp = 0x1BE, /* Selector */ + kHIDUsage_Csmr_ALOnlineCommunity = 0x1BF, /* Selector */ + kHIDUsage_Csmr_ALEntertainmentContentBrowser = 0x1C0, /* Selector */ + kHIDUsage_Csmr_ALOnlineShoppingBrowswer = 0x1C1, /* Selector */ + kHIDUsage_Csmr_ALSmartCardInformationOrHelp = 0x1C2, /* Selector */ + kHIDUsage_Csmr_ALMarketMonitorOrFinanceBrowser = 0x1C3, /* Selector */ + kHIDUsage_Csmr_ALCustomizedCorporateNewsBrowser = 0x1C4, /* Selector */ + kHIDUsage_Csmr_ALOnlineActivityBrowswer= 0x1C5, /* Selector */ + kHIDUsage_Csmr_ALResearchOrSearchBrowswer = 0x1C6, /* Selector */ + kHIDUsage_Csmr_ALAudioPlayer= 0x1C7, /* Selector */ + kHIDUsage_Csmr_ALNavigation = 0x1C8, /* Selector */ + /* 0x1C9 - 0x1FF Reserved */ + kHIDUsage_Csmr_GenericGUIApplicationControls = 0x200, /* Named Array */ + kHIDUsage_Csmr_ACNew = 0x201, /* Selector */ + kHIDUsage_Csmr_ACOpen = 0x202, /* Selector */ + kHIDUsage_Csmr_ACClose = 0x203, /* Selector */ + kHIDUsage_Csmr_ACExit = 0x204, /* Selector */ + kHIDUsage_Csmr_ACMaximize = 0x205, /* Selector */ + kHIDUsage_Csmr_ACMinimize = 0x206, /* Selector */ + kHIDUsage_Csmr_ACSave = 0x207, /* Selector */ + kHIDUsage_Csmr_ACPrint = 0x208, /* Selector */ + kHIDUsage_Csmr_ACProperties = 0x209, /* Selector */ + kHIDUsage_Csmr_ACUndo = 0x21A, /* Selector */ + kHIDUsage_Csmr_ACCopy = 0x21B, /* Selector */ + kHIDUsage_Csmr_ACCut = 0x21C, /* Selector */ + kHIDUsage_Csmr_ACPaste = 0x21D, /* Selector */ + kHIDUsage_Csmr_AC = 0x21E, /* Selector */ + kHIDUsage_Csmr_ACFind = 0x21F, /* Selector */ + kHIDUsage_Csmr_ACFindandReplace = 0x220, /* Selector */ + kHIDUsage_Csmr_ACSearch = 0x221, /* Selector */ + kHIDUsage_Csmr_ACGoTo = 0x222, /* Selector */ + kHIDUsage_Csmr_ACHome = 0x223, /* Selector */ + kHIDUsage_Csmr_ACBack = 0x224, /* Selector */ + kHIDUsage_Csmr_ACForward = 0x225, /* Selector */ + kHIDUsage_Csmr_ACStop = 0x226, /* Selector */ + kHIDUsage_Csmr_ACRefresh = 0x227, /* Selector */ + kHIDUsage_Csmr_ACPreviousLink = 0x228, /* Selector */ + kHIDUsage_Csmr_ACNextLink = 0x229, /* Selector */ + kHIDUsage_Csmr_ACBookmarks = 0x22A, /* Selector */ + kHIDUsage_Csmr_ACHistory = 0x22B, /* Selector */ + kHIDUsage_Csmr_ACSubscriptions = 0x22C, /* Selector */ + kHIDUsage_Csmr_ACZoomIn = 0x22D, /* Selector */ + kHIDUsage_Csmr_ACZoomOut = 0x22E, /* Selector */ + kHIDUsage_Csmr_ACZoom = 0x22F, /* Selector */ + kHIDUsage_Csmr_ACFullScreenView = 0x230, /* Selector */ + kHIDUsage_Csmr_ACNormalView = 0x231, /* Selector */ + kHIDUsage_Csmr_ACViewToggle = 0x232, /* Selector */ + kHIDUsage_Csmr_ACScrollUp = 0x233, /* Selector */ + kHIDUsage_Csmr_ACScrollDown = 0x234, /* Selector */ + kHIDUsage_Csmr_ACScroll = 0x235, /* Selector */ + kHIDUsage_Csmr_ACPanLeft = 0x236, /* Selector */ + kHIDUsage_Csmr_ACPanRight = 0x237, /* Selector */ + kHIDUsage_Csmr_ACPan = 0x238, /* Selector */ + kHIDUsage_Csmr_ACNewWindow = 0x239, /* Selector */ + kHIDUsage_Csmr_ACTileHorizontally = 0x23A, /* Selector */ + kHIDUsage_Csmr_ACTileVertically = 0x23B, /* Selector */ + kHIDUsage_Csmr_ACFormat = 0x23C, /* Selector */ + kHIDUsage_Csmr_ACEdit = 0x23D, /* Selector */ + kHIDUsage_Csmr_ACBold = 0x23E, /* Selector */ + kHIDUsage_Csmr_ACItalics = 0x23F, /* Selector */ + kHIDUsage_Csmr_ACUnderline = 0x240, /* Selector */ + kHIDUsage_Csmr_ACStrikethrough = 0x241, /* Selector */ + kHIDUsage_Csmr_ACSubscript = 0x242, /* Selector */ + kHIDUsage_Csmr_ACSuperscript = 0x243, /* Selector */ + kHIDUsage_Csmr_ACAllCaps = 0x244, /* Selector */ + kHIDUsage_Csmr_ACRotate = 0x245, /* Selector */ + kHIDUsage_Csmr_ACResize = 0x246, /* Selector */ + kHIDUsage_Csmr_ACFlipHorizontal = 0x247, /* Selector */ + kHIDUsage_Csmr_ACFlipVertical = 0x248, /* Selector */ + kHIDUsage_Csmr_ACMirrorHorizontal = 0x249, /* Selector */ + kHIDUsage_Csmr_ACMirrorVertical = 0x24A, /* Selector */ + kHIDUsage_Csmr_ACFontSelect = 0x24B, /* Selector */ + kHIDUsage_Csmr_ACFontColor = 0x24C, /* Selector */ + kHIDUsage_Csmr_ACFontSize = 0x24D, /* Selector */ + kHIDUsage_Csmr_ACJustifyLeft = 0x24E, /* Selector */ + kHIDUsage_Csmr_ACJustifyCenterH = 0x24F, /* Selector */ + kHIDUsage_Csmr_ACJustifyRight = 0x250, /* Selector */ + kHIDUsage_Csmr_ACJustifyBlockH = 0x251, /* Selector */ + kHIDUsage_Csmr_ACJustifyTop = 0x252, /* Selector */ + kHIDUsage_Csmr_ACJustifyCenterV = 0x253, /* Selector */ + kHIDUsage_Csmr_ACJustifyBottom = 0x254, /* Selector */ + kHIDUsage_Csmr_ACJustifyBlockV = 0x255, /* Selector */ + kHIDUsage_Csmr_ACIndentyDecrease = 0x256, /* Selector */ + kHIDUsage_Csmr_ACIndentyIncrease = 0x257, /* Selector */ + kHIDUsage_Csmr_ACNumberedList = 0x258, /* Selector */ + kHIDUsage_Csmr_ACRestartNumbering = 0x259, /* Selector */ + kHIDUsage_Csmr_ACBulletedList = 0x25A, /* Selector */ + kHIDUsage_Csmr_ACPromote = 0x25B, /* Selector */ + kHIDUsage_Csmr_ACDemote = 0x25C, /* Selector */ + kHIDUsage_Csmr_ACYes = 0x25D, /* Selector */ + kHIDUsage_Csmr_ACNo = 0x25E, /* Selector */ + kHIDUsage_Csmr_ACCancel = 0x25F, /* Selector */ + kHIDUsage_Csmr_ACCatalog = 0x260, /* Selector */ + kHIDUsage_Csmr_ACBuyOrCheckout = 0x261, /* Selector */ + kHIDUsage_Csmr_ACAddToCart = 0x262, /* Selector */ + kHIDUsage_Csmr_ACExpand = 0x263, /* Selector */ + kHIDUsage_Csmr_ACExpandAll = 0x264, /* Selector */ + kHIDUsage_Csmr_ACCollapse = 0x265, /* Selector */ + kHIDUsage_Csmr_ACCollapseAll = 0x266, /* Selector */ + kHIDUsage_Csmr_ACPrintPreview = 0x267, /* Selector */ + kHIDUsage_Csmr_ACPasteSpecial = 0x268, /* Selector */ + kHIDUsage_Csmr_ACInsertMode = 0x269, /* Selector */ + kHIDUsage_Csmr_ACDelete = 0x26A, /* Selector */ + kHIDUsage_Csmr_ACLock = 0x26B, /* Selector */ + kHIDUsage_Csmr_ACUnlock = 0x26C, /* Selector */ + kHIDUsage_Csmr_ACProtect = 0x26D, /* Selector */ + kHIDUsage_Csmr_ACUnprotect = 0x26E, /* Selector */ + kHIDUsage_Csmr_ACAttachComment = 0x26F, /* Selector */ + kHIDUsage_Csmr_ACDetachComment = 0x270, /* Selector */ + kHIDUsage_Csmr_ACViewComment = 0x271, /* Selector */ + kHIDUsage_Csmr_ACSelectWord = 0x272, /* Selector */ + kHIDUsage_Csmr_ACSelectSentence = 0x273, /* Selector */ + kHIDUsage_Csmr_ACSelectParagraph = 0x274, /* Selector */ + kHIDUsage_Csmr_ACSelectColumn = 0x275, /* Selector */ + kHIDUsage_Csmr_ACSelectRow = 0x276, /* Selector */ + kHIDUsage_Csmr_ACSelectTable = 0x277, /* Selector */ + kHIDUsage_Csmr_ACSelectObject = 0x278, /* Selector */ + kHIDUsage_Csmr_ACRedoOrRepeat = 0x279, /* Selector */ + kHIDUsage_Csmr_ACSort = 0x27A, /* Selector */ + kHIDUsage_Csmr_ACSortAscending = 0x27B, /* Selector */ + kHIDUsage_Csmr_ACSortDescending = 0x27C, /* Selector */ + kHIDUsage_Csmr_ACFilter = 0x27D, /* Selector */ + kHIDUsage_Csmr_ACSetClock = 0x27E, /* Selector */ + kHIDUsage_Csmr_ACViewClock = 0x27F, /* Selector */ + kHIDUsage_Csmr_ACSelectTimeZone = 0x280, /* Selector */ + kHIDUsage_Csmr_ACEditTimeZones = 0x281, /* Selector */ + kHIDUsage_Csmr_ACSetAlarm = 0x282, /* Selector */ + kHIDUsage_Csmr_ACClearAlarm = 0x283, /* Selector */ + kHIDUsage_Csmr_ACSnoozeAlarm = 0x284, /* Selector */ + kHIDUsage_Csmr_ACResetAlarm = 0x285, /* Selector */ + kHIDUsage_Csmr_ACSynchronize = 0x286, /* Selector */ + kHIDUsage_Csmr_ACSendOrReceive = 0x287, /* Selector */ + kHIDUsage_Csmr_ACSendTo = 0x288, /* Selector */ + kHIDUsage_Csmr_ACReply = 0x289, /* Selector */ + kHIDUsage_Csmr_ACReplyAll = 0x28A, /* Selector */ + kHIDUsage_Csmr_ACForwardMessage = 0x28B, /* Selector */ + kHIDUsage_Csmr_ACSend = 0x28C, /* Selector */ + kHIDUsage_Csmr_ACAttachFile = 0x28D, /* Selector */ + kHIDUsage_Csmr_ACUpload = 0x28E, /* Selector */ + kHIDUsage_Csmr_ACDownload = 0x28F, /* Selector */ + kHIDUsage_Csmr_ACSetBorders = 0x290, /* Selector */ + kHIDUsage_Csmr_ACInsertRow = 0x291, /* Selector */ + kHIDUsage_Csmr_ACInsertColumn = 0x292, /* Selector */ + kHIDUsage_Csmr_ACInsertFile = 0x293, /* Selector */ + kHIDUsage_Csmr_ACInsertPicture = 0x294, /* Selector */ + kHIDUsage_Csmr_ACInsertObject = 0x295, /* Selector */ + kHIDUsage_Csmr_ACInsertSymbol = 0x296, /* Selector */ + kHIDUsage_Csmr_ACSaveAndClose = 0x297, /* Selector */ + kHIDUsage_Csmr_ACRename = 0x298, /* Selector */ + kHIDUsage_Csmr_ACMerge = 0x299, /* Selector */ + kHIDUsage_Csmr_ACSplit = 0x29A, /* Selector */ + kHIDUsage_Csmr_ACDistributeH = 0x29B, /* Selector */ + kHIDUsage_Csmr_ACDistributeV = 0x29C, /* Selector */ + kHIDUsage_Csmr_ACKeyboardLayoutSelect = 0x29D, /* One-Shot Control */ + kHIDUsage_Csmr_ACNavigationGuidance = 0x29E, /* Selector */ + kHIDUsage_Csmr_ACDesktopShowAllWindows = 0x29F, /* Selector */ + kHIDUsage_Csmr_ACDesktopShowAllApplications = 0x2A0, /* Selector */ + /* 0x2A1 - 0xFFFF Reserved */ + kHIDUsage_Csmr_Reserved = 0xFFFF +}; + +/* Digitizer Page (0x0D) */ +/* This section provides detailed descriptions of the usages employed by Digitizer Devices. */ +enum +{ + kHIDUsage_Dig_Digitizer = 0x01, /* Application Collection */ + kHIDUsage_Dig_Pen = 0x02, /* Application Collection */ + kHIDUsage_Dig_LightPen = 0x03, /* Application Collection */ + kHIDUsage_Dig_TouchScreen = 0x04, /* Application Collection */ + kHIDUsage_Dig_TouchPad = 0x05, /* Application Collection */ + kHIDUsage_Dig_WhiteBoard = 0x06, /* Application Collection */ + kHIDUsage_Dig_CoordinateMeasuringMachine = 0x07, /* Application Collection */ + kHIDUsage_Dig_3DDigitizer = 0x08, /* Application Collection */ + kHIDUsage_Dig_StereoPlotter = 0x09, /* Application Collection */ + kHIDUsage_Dig_ArticulatedArm = 0x0A, /* Application Collection */ + kHIDUsage_Dig_Armature = 0x0B, /* Application Collection */ + kHIDUsage_Dig_MultiplePointDigitizer = 0x0C, /* Application Collection */ + kHIDUsage_Dig_FreeSpaceWand = 0x0D, /* Application Collection */ + kHIDUsage_Dig_DeviceConfiguration = 0x0E, /* Application Collection */ + /* 0x0F - 0x1F Reserved */ + kHIDUsage_Dig_Stylus = 0x20, /* Logical Collection */ + kHIDUsage_Dig_Puck = 0x21, /* Logical Collection */ + kHIDUsage_Dig_Finger = 0x22, /* Logical Collection */ + kHIDUsage_Dig_DeviceSettings = 0x23, /* Logical Collection */ + kHIDUsage_Dig_GestureCharacter = 0x24, /* Logical Collection */ + /* 0x25 - 0x2F Reserved */ + kHIDUsage_Dig_TipPressure = 0x30, /* Dynamic Value */ + kHIDUsage_Dig_BarrelPressure = 0x31, /* Dynamic Value */ + kHIDUsage_Dig_InRange = 0x32, /* Momentary Control */ + kHIDUsage_Dig_Touch = 0x33, /* Momentary Control */ + kHIDUsage_Dig_Untouch = 0x34, /* One-Shot Control */ + kHIDUsage_Dig_Tap = 0x35, /* One-Shot Control */ + kHIDUsage_Dig_Quality = 0x36, /* Dynamic Value */ + kHIDUsage_Dig_DataValid = 0x37, /* Momentary Control */ + kHIDUsage_Dig_TransducerIndex = 0x38, /* Dynamic Value */ + kHIDUsage_Dig_TabletFunctionKeys = 0x39, /* Logical Collection */ + kHIDUsage_Dig_ProgramChangeKeys = 0x3A, /* Logical Collection */ + kHIDUsage_Dig_BatteryStrength = 0x3B, /* Dynamic Value */ + kHIDUsage_Dig_Invert = 0x3C, /* Momentary Control */ + kHIDUsage_Dig_XTilt = 0x3D, /* Dynamic Value */ + kHIDUsage_Dig_YTilt = 0x3E, /* Dynamic Value */ + kHIDUsage_Dig_Azimuth = 0x3F, /* Dynamic Value */ + kHIDUsage_Dig_Altitude = 0x40, /* Dynamic Value */ + kHIDUsage_Dig_Twist = 0x41, /* Dynamic Value */ + kHIDUsage_Dig_TipSwitch = 0x42, /* Momentary Control */ + kHIDUsage_Dig_SecondaryTipSwitch = 0x43, /* Momentary Control */ + kHIDUsage_Dig_BarrelSwitch = 0x44, /* Momentary Control */ + kHIDUsage_Dig_Eraser = 0x45, /* Momentary Control */ + kHIDUsage_Dig_TabletPick = 0x46, /* Momentary Control */ + kHIDUsage_Dig_TouchValid = 0x47, /* Momentary Control */ + kHIDUsage_Dig_Width = 0x48, /* Dynamic Value */ + kHIDUsage_Dig_Height = 0x49, /* Dynamic Value */ + /* 0x4A - 0x50 Reserved */ + kHIDUsage_Dig_ContactIdentifier = 0x51, /* Dynamic Value */ + kHIDUsage_Dig_DeviceMode = 0x52, /* Dynamic Value */ + kHIDUsage_Dig_DeviceIdentifier = 0x53, /* Dynamic Value */ + kHIDUsage_Dig_ContactCount = 0x54, /* Dynamic Value */ + kHIDUsage_Dig_ContactCountMaximum = 0x55, /* Static Value */ + kHIDUsage_Dig_RelativeScanTime = 0x56, /* Dynamic Value */ + kHIDUsage_Dig_SurfaceSwitch = 0x57, /* Dynamic Flag */ + + /* 0x56 - 0x5F Reserved */ + kHIDUsage_Dig_GestureCharacterEnable = 0x60, /* Dynamic Flag */ + kHIDUsage_Dig_GestureCharacterQuality = 0x61, /* Dynamic Value */ + kHIDUsage_Dig_GestureCharacterDataLength = 0x62, /* Dynamic Value */ + kHIDUsage_Dig_GestureCharacterData = 0x63, /* Buffered Bytes */ + kHIDUsage_Dig_GestureCharacterEncoding = 0x64, /* Named Array */ + kHIDUsage_Dig_GestureCharacterEncodingUTF8 = 0x65, /* Selector */ + kHIDUsage_Dig_GestureCharacterEncodingUTF16LE = 0x66, /* Selector */ + kHIDUsage_Dig_GestureCharacterEncodingUTF16BE = 0x67, /* Selector */ + kHIDUsage_Dig_GestureCharacterEncodingUTF32LE = 0x68, /* Selector */ + kHIDUsage_Dig_GestureCharacterEncodingUTF32BE = 0x69, /* Selector */ + + kHIDUsage_Dig_ReportRate = 0xA1, /* Dynamic Value */ + + /* 0x70 - 0xFFFF Reserved */ + kHIDUsage_Dig_Reserved = 0xFFFF +}; + +/* Physical Interface Device Page (0x0F) */ +/* This section provides detailed descriptions of the usages employed by Power Devices. */ +enum +{ + kHIDUsage_PID_PhysicalInterfaceDevice = 0x01, /* CA - A collection of PID usages */ + /* 0x02 - 0x1F Reserved */ + kHIDUsage_PID_Normal = 0x20, /* DV - A force applied perpendicular to the surface of an object */ + kHIDUsage_PID_SetEffectReport = 0x21, /* XXX */ + kHIDUsage_PID_EffectBlockIndex = 0x22, /* XXX */ + kHIDUsage_PID_ParamBlockOffset = 0x23, /* XXX */ + kHIDUsage_PID_ROM_Flag = 0x24, /* XXX */ + kHIDUsage_PID_EffectType = 0x25, /* XXX */ + kHIDUsage_PID_ET_ConstantForce = 0x26, /* XXX */ + kHIDUsage_PID_ET_Ramp = 0x27, /* XXX */ + kHIDUsage_PID_ET_CustomForceData = 0x28, /* XXX */ + /* 0x29 - 0x2F Reserved */ + kHIDUsage_PID_ET_Square = 0x30, /* XXX */ + kHIDUsage_PID_ET_Sine = 0x31, /* XXX */ + kHIDUsage_PID_ET_Triangle = 0x32, /* XXX */ + kHIDUsage_PID_ET_SawtoothUp = 0x33, /* XXX */ + kHIDUsage_PID_ET_SawtoothDown = 0x34, /* XXX */ + /* 0x35 - 0x3F Reserved */ + kHIDUsage_PID_ET_Spring = 0x40, /* XXX */ + kHIDUsage_PID_ET_Damper = 0x41, /* XXX */ + kHIDUsage_PID_ET_Inertia = 0x42, /* XXX */ + kHIDUsage_PID_ET_Friction = 0x43, /* XXX */ + /* 0x44 - 0x4F Reserved */ + kHIDUsage_PID_Duration = 0x50, /* XXX */ + kHIDUsage_PID_SamplePeriod = 0x51, /* XXX */ + kHIDUsage_PID_Gain = 0x52, /* XXX */ + kHIDUsage_PID_TriggerButton = 0x53, /* XXX */ + kHIDUsage_PID_TriggerRepeatInterval = 0x54, /* XXX */ + kHIDUsage_PID_AxesEnable = 0x55, /* XXX */ + kHIDUsage_PID_DirectionEnable = 0x56, /* XXX */ + kHIDUsage_PID_Direction = 0x57, /* XXX */ + kHIDUsage_PID_TypeSpecificBlockOffset = 0x58, /* XXX */ + kHIDUsage_PID_BlockType = 0x59, /* XXX */ + kHIDUsage_PID_SetEnvelopeReport = 0x5A, /* XXX */ + kHIDUsage_PID_AttackLevel = 0x5B, /* XXX */ + kHIDUsage_PID_AttackTime = 0x5C, /* XXX */ + kHIDUsage_PID_FadeLevel = 0x5D, /* XXX */ + kHIDUsage_PID_FadeTime = 0x5E, /* XXX */ + kHIDUsage_PID_SetConditionReport = 0x5F, /* XXX */ + + kHIDUsage_PID_CP_Offset = 0x60, /* XXX */ + kHIDUsage_PID_PositiveCoefficient = 0x61, /* XXX */ + kHIDUsage_PID_NegativeCoefficient = 0x62, /* XXX */ + kHIDUsage_PID_PositiveSaturation = 0x63, /* XXX */ + kHIDUsage_PID_NegativeSaturation = 0x64, /* XXX */ + kHIDUsage_PID_DeadBand = 0x65, /* XXX */ + kHIDUsage_PID_DownloadForceSample = 0x66, /* XXX */ + kHIDUsage_PID_IsochCustomForceEnable = 0x67, /* XXX */ + kHIDUsage_PID_CustomForceDataReport = 0x68, /* XXX */ + kHIDUsage_PID_CustomForceData = 0x69, /* XXX */ + kHIDUsage_PID_CustomForceVendorDefinedData = 0x6A, /* XXX */ + kHIDUsage_PID_SetCustomForceReport = 0x6B, /* XXX */ + kHIDUsage_PID_CustomForceDataOffset = 0x6C, /* XXX */ + kHIDUsage_PID_SampleCount = 0x6D, /* XXX */ + kHIDUsage_PID_SetPeriodicReport = 0x6E, /* XXX */ + kHIDUsage_PID_Offset = 0x6F, /* XXX */ + + kHIDUsage_PID_Magnitude = 0x70, /* XXX */ + kHIDUsage_PID_Phase = 0x71, /* XXX */ + kHIDUsage_PID_Period = 0x72, /* XXX */ + kHIDUsage_PID_SetConstantForceReport = 0x73, /* XXX */ + kHIDUsage_PID_SetRampForceReport = 0x74, /* XXX */ + kHIDUsage_PID_RampStart = 0x75, /* XXX */ + kHIDUsage_PID_RampEnd = 0x76, /* XXX */ + kHIDUsage_PID_EffectOperationReport = 0x77, /* XXX */ + kHIDUsage_PID_EffectOperation = 0x78, /* XXX */ + kHIDUsage_PID_OpEffectStart = 0x79, /* XXX */ + kHIDUsage_PID_OpEffectStartSolo = 0x7A, /* XXX */ + kHIDUsage_PID_OpEffectStop = 0x7B, /* XXX */ + kHIDUsage_PID_LoopCount = 0x7C, /* XXX */ + kHIDUsage_PID_DeviceGainReport = 0x7D, /* XXX */ + kHIDUsage_PID_DeviceGain = 0x7E, /* XXX */ + kHIDUsage_PID_PoolReport = 0x7F, /* XXX */ + + kHIDUsage_PID_RAM_PoolSize = 0x80, /* XXX */ + kHIDUsage_PID_ROM_PoolSize = 0x81, /* XXX */ + kHIDUsage_PID_ROM_EffectBlockCount = 0x82, /* XXX */ + kHIDUsage_PID_SimultaneousEffectsMax = 0x83, /* XXX */ + kHIDUsage_PID_PoolAlignment = 0x84, /* XXX */ + kHIDUsage_PID_PoolMoveReport = 0x85, /* XXX */ + kHIDUsage_PID_MoveSource = 0x86, /* XXX */ + kHIDUsage_PID_MoveDestination = 0x87, /* XXX */ + kHIDUsage_PID_MoveLength = 0x88, /* XXX */ + kHIDUsage_PID_BlockLoadReport = 0x89, /* XXX */ + /* 0x8A Reserved */ + kHIDUsage_PID_BlockLoadStatus = 0x8B, /* XXX */ + kHIDUsage_PID_BlockLoadSuccess = 0x8C, /* XXX */ + kHIDUsage_PID_BlockLoadFull = 0x8D, /* XXX */ + kHIDUsage_PID_BlockLoadError = 0x8E, /* XXX */ + kHIDUsage_PID_BlockHandle = 0x8F, /* XXX */ + + kHIDUsage_PID_BlockFreeReport = 0x90, /* XXX */ + kHIDUsage_PID_TypeSpecificBlockHandle = 0x91, /* XXX */ + kHIDUsage_PID_StateReport = 0x92, /* XXX */ + /* 0x93 Reserved */ + kHIDUsage_PID_EffectPlaying = 0x94, /* XXX */ + kHIDUsage_PID_DeviceControlReport = 0x95, /* XXX */ + kHIDUsage_PID_DeviceControl = 0x96, /* XXX */ + kHIDUsage_PID_DC_EnableActuators = 0x97, /* XXX */ + kHIDUsage_PID_DC_DisableActuators = 0x98, /* XXX */ + kHIDUsage_PID_DC_StopAllEffects = 0x99, /* XXX */ + kHIDUsage_PID_DC_DeviceReset = 0x9A, /* XXX */ + kHIDUsage_PID_DC_DevicePause = 0x9B, /* XXX */ + kHIDUsage_PID_DC_DeviceContinue = 0x9C, /* XXX */ + /* 0x9d - 0x9E Reserved */ + kHIDUsage_PID_DevicePaused = 0x9F, /* XXX */ + + kHIDUsage_PID_ActuatorsEnabled = 0xA0, /* XXX */ + /* 0xA1 - 0xA3 Reserved */ + kHIDUsage_PID_SafetySwitch = 0xA4, /* XXX */ + kHIDUsage_PID_ActuatorOverrideSwitch = 0xA5, /* XXX */ + kHIDUsage_PID_ActuatorPower = 0xA6, /* XXX */ + kHIDUsage_PID_StartDelay = 0xA7, /* XXX */ + kHIDUsage_PID_ParameterBlockSize = 0xA8, /* XXX */ + kHIDUsage_PID_DeviceManagedPool = 0xA9, /* XXX */ + kHIDUsage_PID_SharedParameterBlocks = 0xAA, /* XXX */ + kHIDUsage_PID_CreateNewEffectReport = 0xAB, /* XXX */ + kHIDUsage_PID_RAM_PoolAvailable = 0xAC, /* XXX */ + /* 0xAD - 0xFFFF Reserved */ + kHIDUsage_PID_Reserved = 0xFFFF +}; + +/* AlphanumericDisplay Page (0x14) */ +/* The Alphanumeric Display page is intended for use by simple alphanumeric displays that are used on consumer devices. */ +enum +{ + kHIDUsage_AD_AlphanumericDisplay = 0x01, /* Application Collection */ + /* 0x02 - 0x1F Reserved */ + kHIDUsage_AD_DisplayAttributesReport = 0x20, /* Logical Collection */ + kHIDUsage_AD_ASCIICharacterSet = 0x21, /* Static Flag */ + kHIDUsage_AD_DataReadBack = 0x22, /* Static Flag */ + kHIDUsage_AD_FontReadBack = 0x23, /* Static Flag */ + kHIDUsage_AD_DisplayControlReport = 0x24, /* Logical Collection */ + kHIDUsage_AD_ClearDisplay = 0x25, /* Dynamic Flag */ + kHIDUsage_AD_DisplayEnable = 0x26, /* Dynamic Flag */ + kHIDUsage_AD_ScreenSaverDelay = 0x27, /* Static Value */ + kHIDUsage_AD_ScreenSaverEnable = 0x28, /* Dynamic Flag */ + kHIDUsage_AD_VerticalScroll = 0x29, /* Static Flag */ + kHIDUsage_AD_HorizontalScroll = 0x2A, /* Static Flag */ + kHIDUsage_AD_CharacterReport = 0x2B, /* Logical Collection */ + kHIDUsage_AD_DisplayData = 0x2C, /* Dynamic Value */ + kHIDUsage_AD_DisplayStatus = 0x2D, /* Logical Collection */ + kHIDUsage_AD_StatNotReady = 0x2E, /* Selector */ + kHIDUsage_AD_StatReady = 0x2F, /* Selector */ + kHIDUsage_AD_ErrNotaloadablecharacter = 0x30, /* Selector */ + kHIDUsage_AD_ErrFontdatacannotberead = 0x31, /* Selector */ + kHIDUsage_AD_CursorPositionReport = 0x32, /* Logical Collection */ + kHIDUsage_AD_Row = 0x33, /* Dynamic Value */ + kHIDUsage_AD_Column = 0x34, /* Dynamic Value */ + kHIDUsage_AD_Rows = 0x35, /* Static Value */ + kHIDUsage_AD_Columns = 0x36, /* Static Value */ + kHIDUsage_AD_CursorPixelPositioning = 0x37, /* Static Flag */ + kHIDUsage_AD_CursorMode = 0x38, /* Dynamic Flag */ + kHIDUsage_AD_CursorEnable = 0x39, /* Dynamic Flag */ + kHIDUsage_AD_CursorBlink = 0x3A, /* Dynamic Flag */ + kHIDUsage_AD_FontReport = 0x3B, /* Logical Collection */ + kHIDUsage_AD_FontData = 0x3C, /* Buffered Byte */ + kHIDUsage_AD_CharacterWidth = 0x3D, /* Static Value */ + kHIDUsage_AD_CharacterHeight = 0x3E, /* Static Value */ + kHIDUsage_AD_CharacterSpacingHorizontal = 0x3F, /* Static Value */ + kHIDUsage_AD_CharacterSpacingVertical = 0x40, /* Static Value */ + kHIDUsage_AD_UnicodeCharacterSet = 0x41, /* Static Flag */ + /* 0x42 - 0xFFFF Reserved */ + kHIDUsage_AD_Reserved = 0xFFFF +}; + +/* Sensor Page (0x20) */ +/* The Sensor page is intended for use by devices that capture biometric, electrical, environmental, light, location, mechanical, motion, orientation, scanner, etc events. */ +enum +{ + kHIDUsage_Snsr_Undefined = 0x00, + kHIDUsage_Snsr_Sensor = 0x01, /* Application/Physical Collection */ + /* 0x02 - 0x0F Reserved */ + kHIDUsage_Snsr_Biometric = 0x10, /* Application/Physical Collection */ + kHIDUsage_Snsr_Biometric_HumanPresence = 0x11, /* Application/Physical Collection */ + kHIDUsage_Snsr_Biometric_HumanProximity = 0x12, /* Application/Physical Collection */ + kHIDUsage_Snsr_Biometric_HumanTouch = 0x13, /* Application/Physical Collection */ + /* 0x14 - 0x1F Reserved */ + kHIDUsage_Snsr_Electrical = 0x20, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Capacitance = 0x21, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Current = 0x22, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Power = 0x23, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Inductance = 0x24, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Resistance = 0x25, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Voltage = 0x26, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Potentiometer = 0x27, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Frequency = 0x28, /* Application/Physical Collection */ + kHIDUsage_Snsr_Electrical_Period = 0x29, /* Application/Physical Collection */ + /* 0x2A - 0x2F Reserved */ + kHIDUsage_Snsr_Environmental = 0x30, /* Application/Physical Collection */ + kHIDUsage_Snsr_Environmental_AtmosphericPressure = 0x31, /* Application/Physical Collection */ + kHIDUsage_Snsr_Environmental_Humidity = 0x32, /* Application/Physical Collection */ + kHIDUsage_Snsr_Environmental_Temperature = 0x33, /* Application/Physical Collection */ + kHIDUsage_Snsr_Environmental_WindDirection = 0x34, /* Application/Physical Collection */ + kHIDUsage_Snsr_Environmental_WindSpeed = 0x35, /* Application/Physical Collection */ + /* 0x36 - 0x3F Reserved */ + kHIDUsage_Snsr_Light = 0x40, /* Application/Physical Collection */ + kHIDUsage_Snsr_Light_AmbientLight = 0x41, /* Application/Physical Collection */ + kHIDUsage_Snsr_Light_ConsumerInfrared = 0x42, /* Application/Physical Collection */ + /* 0x43 - 0x4F Reserved */ + kHIDUsage_Snsr_Location = 0x50, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_Broadcast = 0x51, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_DeadReckoning = 0x52, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_GPS = 0x53, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_Lookup = 0x54, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_Other = 0x55, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_Static = 0x56, /* Application/Physical Collection */ + kHIDUsage_Snsr_Location_Triangulation = 0x57, /* Application/Physical Collection */ + /* 0x58 - 0x5F Reserved */ + kHIDUsage_Snsr_Mechanical = 0x60, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_BooleanSwitch = 0x61, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_BooleanSwitchArray = 0x62, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_MultivalueSwitch = 0x63, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_Force = 0x64, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_Pressure = 0x65, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_Strain = 0x66, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_Weight = 0x67, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_HapticVibrator = 0x68, /* Application/Physical Collection */ + kHIDUsage_Snsr_Mechanical_HallEffectSwitch = 0x69, /* Application/Physical Collection */ + /* 0x6A - 0x6F Reserved */ + kHIDUsage_Snsr_Motion = 0x70, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Accelerometer1D = 0x71, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Accelerometer2D = 0x72, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Accelerometer3D = 0x73, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Gyrometer1D = 0x74, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Gyrometer2D = 0x75, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Gyrometer3D = 0x76, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_MotionDetector = 0x77, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Speedometer = 0x78, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Accelerometer = 0x79, /* Application/Physical Collection */ + kHIDUsage_Snsr_Motion_Gyrometer = 0x7A, /* Application/Physical Collection */ + /* 0x7B - 0x7F Reserved */ + kHIDUsage_Snsr_Orientation = 0x80, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Compass1D = 0x81, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Compass2D = 0x82, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Compass3D = 0x83, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Inclinometer1D = 0x84, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Inclinometer2D = 0x85, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Inclinometer3D = 0x86, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Distance1D = 0x87, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Distance2D = 0x88, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_Distance3D = 0x89, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_DeviceOrientation = 0x8A, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_CompassD = 0x8B, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_InclinometerD = 0x8C, /* Application/Physical Collection */ + kHIDUsage_Snsr_Orientation_DistanceD = 0x8D, /* Application/Physical Collection */ + /* 0x8E - 0x8F Reserved */ + kHIDUsage_Snsr_Scanner = 0x90, /* Application/Physical Collection */ + kHIDUsage_Snsr_Scanner_Barcode = 0x91, /* Application/Physical Collection */ + kHIDUsage_Snsr_Scanner_RFID = 0x92, /* Application/Physical Collection */ + kHIDUsage_Snsr_Scanner_NFC = 0x93, /* Application/Physical Collection */ + /* 0x94 - 0x9F Reserved */ + kHIDUsage_Snsr_Time = 0xA0, /* Application/Physical Collection */ + kHIDUsage_Snsr_Time_AlarmTimer = 0xA1, /* Application/Physical Collection */ + kHIDUsage_Snsr_Time_RealTimeClock = 0xA2, /* Application/Physical Collection */ + /* 0xA3 - 0xDF Reserved */ + kHIDUsage_Snsr_Other = 0xE0, /* Application/Physical Collection */ + kHIDUsage_Snsr_Other_Custom = 0xE1, /* Application/Physical Collection */ + kHIDUsage_Snsr_Other_Generic = 0xE2, /* Application/Physical Collection */ + kHIDUsage_Snsr_Other_GenericEnumerator = 0xE3, /* Application/Physical Collection */ + /* 0xE4 - 0xEF Reserved */ + /* 0xF0 - 0xFF Vendor Reserved */ + + /* Common Sensor Type Data Fields */ + + /* Usage Switches used in conjunction with other Data Usages. The value of the modifier is OR-ed in to the upper nibble of the 16bit Data Usage. */ + kHIDUsage_Snsr_Modifier_None = 0x0, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_ChangeSensitivityAbsolute = 0x1, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_Max = 0x2, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_Min = 0x3, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_Accuracy = 0x4, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_Resolution = 0x5, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_ThresholdHigh = 0x6, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_ThresholdLow = 0x7, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_CalibrationOffset = 0x8, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_CalibrationMultiplier = 0x9, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_ReportInterval = 0xA, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_FrequencyMax = 0xB, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_PeriodMax = 0xC, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_ChangeSensitivityPercentRange = 0xD, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_ChangeSensitivityPercentRelative = 0xE, /* Data Field Usage Switch */ + kHIDUsage_Snsr_Modifier_VendorDefined = 0xF, /* Data Field Usage Switch */ + + /* Event Usages */ + kHIDUsage_Snsr_Event = 0x0200, + kHIDUsage_Snsr_Event_SensorState = 0x0201, + kHIDUsage_Snsr_Event_SensorEvent = 0x0202, + /* 0x0203 - 0x02FF Event Reserved */ + + kHIDUsage_Snsr_Event_SensorState_Undefined = 0x0800, + kHIDUsage_Snsr_Event_SensorState_Ready = 0x0801, + kHIDUsage_Snsr_Event_SensorState_NotAvailable = 0x0802, + kHIDUsage_Snsr_Event_SensorState_NoData = 0x0803, + kHIDUsage_Snsr_Event_SensorState_Initializing = 0x0804, + kHIDUsage_Snsr_Event_SensorState_AccessDenied = 0x0805, + kHIDUsage_Snsr_Event_SensorState_Error = 0x0806, + /* 0x0807 - 0x080F Reserved */ + + kHIDUsage_Snsr_Event_SensorEvent_Unknown = 0x0810, + kHIDUsage_Snsr_Event_SensorEvent_StateChanged = 0x0811, + kHIDUsage_Snsr_Event_SensorEvent_PropertyChanged = 0x0812, + kHIDUsage_Snsr_Event_SensorEvent_DataUpdated = 0x0813, + kHIDUsage_Snsr_Event_SensorEvent_PollResponse = 0x0814, + kHIDUsage_Snsr_Event_SensorEvent_ChangeSensitivity = 0x0815, + kHIDUsage_Snsr_Event_SensorEvent_RangeMaxReached = 0x0816, + kHIDUsage_Snsr_Event_SensorEvent_RangeMinReached = 0x0817, + kHIDUsage_Snsr_Event_SensorEvent_HighThresholdCrossUp = 0x0818, + kHIDUsage_Snsr_Event_SensorEvent_HighThresholdCrossDown = 0x0819, + kHIDUsage_Snsr_Event_SensorEvent_LowThresholdCrossUp = 0x081A, + kHIDUsage_Snsr_Event_SensorEvent_LowThresholdCrossDown = 0x081B, + kHIDUsage_Snsr_Event_SensorEvent_ZeroThresholdCrossUp = 0x081C, + kHIDUsage_Snsr_Event_SensorEvent_ZeroThresholdCrossDown = 0x081D, + kHIDUsage_Snsr_Event_SensorEvent_PeriodExceeded = 0x081E, + kHIDUsage_Snsr_Event_SensorEvent_FrequencyExceeded = 0x081F, + kHIDUsage_Snsr_Event_SensorEvent_ComplexTrigger = 0x0820, + /* 0x0821 - 0x082F Reserved */ + + /* Property Usages */ + kHIDUsage_Snsr_Property = 0x0300, + kHIDUsage_Snsr_Property_FriendlyName = 0x0301, + kHIDUsage_Snsr_Property_PersistentUniqueID = 0x0302, + kHIDUsage_Snsr_Property_SensorStatus = 0x0303, + kHIDUsage_Snsr_Property_MinimumReportInterval = 0x0304, + kHIDUsage_Snsr_Property_Manufacturer = 0x0305, + kHIDUsage_Snsr_Property_Model = 0x0306, + kHIDUsage_Snsr_Property_SerialNumber = 0x0307, + kHIDUsage_Snsr_Property_Description = 0x0308, + kHIDUsage_Snsr_Property_ConnectionType = 0x0309, + kHIDUsage_Snsr_Property_DevicePath = 0x030A, + kHIDUsage_Snsr_Property_HardwareRevision = 0x030B, + kHIDUsage_Snsr_Property_FirmwareVersion = 0x030C, + kHIDUsage_Snsr_Property_ReleaseData = 0x030D, + kHIDUsage_Snsr_Property_ReportInterval = 0x030E, + kHIDUsage_Snsr_Property_ChangeSensitivityAbsolute = 0x030F, + kHIDUsage_Snsr_Property_ChangeSensitivityPercentRange = 0x0310, + kHIDUsage_Snsr_Property_ChangeSensitivityPercentRelative = 0x0311, + kHIDUsage_Snsr_Property_Accuracy = 0x0312, + kHIDUsage_Snsr_Property_Resolution = 0x0313, + kHIDUsage_Snsr_Property_Maximum = 0x0314, + kHIDUsage_Snsr_Property_Minimum = 0x0315, + kHIDUsage_Snsr_Property_ReportingState = 0x0316, + kHIDUsage_Snsr_Property_SamplingRate = 0x0317, + kHIDUsage_Snsr_Property_ResponseCurve = 0x0318, + kHIDUsage_Snsr_Property_PowerState = 0x0319, + kHIDUsage_Snsr_Property_MaxFIFOEvents = 0x031A, + kHIDUsage_Snsr_Property_ReportLatency = 0x031B, + + /* 0x031C - 0x03FF Reserved */ + + kHIDUsage_Snsr_Property_ConnectionType_Integrated = 0x0830, + kHIDUsage_Snsr_Property_ConnectionType_Attached = 0x0831, + kHIDUsage_Snsr_Property_ConnectionType_External = 0x0832, + /* 0x0833 - 0x083F Reserved */ + kHIDUsage_Snsr_Property_ReportingState_NoEvents = 0x0840, + kHIDUsage_Snsr_Property_ReportingState_AllEvents = 0x0841, + kHIDUsage_Snsr_Property_ReportingState_ThresholdEvents = 0x0842, + kHIDUsage_Snsr_Property_ReportingState_WakeNoEvents = 0x0843, + kHIDUsage_Snsr_Property_ReportingState_WakeAllEvents = 0x0844, + kHIDUsage_Snsr_Property_ReportingState_WakeThresholdEvents = 0x0845, + /* 0x0846 - 0x084F Reserved */ + kHIDUsage_Snsr_Property_PowerState_Undefined = 0x0850, + kHIDUsage_Snsr_Property_PowerState_D0_FullPower = 0x0851, + kHIDUsage_Snsr_Property_PowerState_D1_LowPower = 0x0852, + kHIDUsage_Snsr_Property_PowerState_D2_Standby = 0x0853, + kHIDUsage_Snsr_Property_PowerState_D3_Sleep = 0x0854, + kHIDUsage_Snsr_Property_PowerState_D4_PowerOff = 0x0855, + /* 0x0855 - 0x085F Reserved */ + kHIDUsage_Snsr_Light_Illuminance = 0x04D1, + + /* Specific Sensor Type Data Fields */ + + /* Location Sensor Data Fields */ + kHIDUsage_Snsr_Data_Location = 0x0400, + kHIDUsage_Snsr_Data_Location_Reserved = 0x0401, + kHIDUsage_Snsr_Data_Location_AltitudeAntennaSeaLevel = 0x0402, + kHIDUsage_Snsr_Data_Location_DifferentialReferenceStationID = 0x0403, + kHIDUsage_Snsr_Data_Location_AltitudeEllipsoidError = 0x0404, + kHIDUsage_Snsr_Data_Location_AltitudeEllipsoid = 0x0405, + kHIDUsage_Snsr_Data_Location_AltitudeSeaLevelError = 0x0406, + kHIDUsage_Snsr_Data_Location_AltitudeSeaLevel = 0x0407, + kHIDUsage_Snsr_Data_Location_DifferentialGPSDataAge = 0x0408, + kHIDUsage_Snsr_Data_Location_ErrorRadius = 0x0409, + + kHIDUsage_Snsr_Data_Location_FixQuality = 0x040A, + kHIDUsage_Snsr_Data_Location_FixQualityNoFix = 0x0870, + kHIDUsage_Snsr_Data_Location_FixQualityGPS = 0x0871, + kHIDUsage_Snsr_Data_Location_FixQualityDGPS = 0x0872, + + kHIDUsage_Snsr_Data_Location_FixType = 0x040B, + kHIDUsage_Snsr_Data_Location_FixTypeNoFix = 0x0880, + kHIDUsage_Snsr_Data_Location_FixTypeGPSSPSMode = 0x0881, + kHIDUsage_Snsr_Data_Location_FixTypeDGPSSPSMode = 0x0882, + kHIDUsage_Snsr_Data_Location_FixTypeGPSPPSMode = 0x0883, + kHIDUsage_Snsr_Data_Location_FixTypeRealTimeKinematic = 0x0884, + kHIDUsage_Snsr_Data_Location_FixTypeFloatRTK = 0x0885, + kHIDUsage_Snsr_Data_Location_FixTypeEstimated = 0x0886, + kHIDUsage_Snsr_Data_Location_FixTypeManualInputMode = 0x0887, + kHIDUsage_Snsr_Data_Location_FixTypeSimulatorMode = 0x0888, + + kHIDUsage_Snsr_Data_Location_GeoidalSeparation = 0x040C, + + kHIDUsage_Snsr_Data_Location_GPSOperationMode = 0x040D, + kHIDUsage_Snsr_Data_Location_GPSOperationModeManual = 0x0890, + kHIDUsage_Snsr_Data_Location_GPSOperationModeAutomatic = 0x0891, + + kHIDUsage_Snsr_Data_Location_GPSSelectionMode = 0x040E, + kHIDUsage_Snsr_Data_Location_GPSSelectionModeAutonomous = 0x08A0, + kHIDUsage_Snsr_Data_Location_GPSSelectionModeDGPS = 0x08A1, + kHIDUsage_Snsr_Data_Location_GPSSelectionModeEstimated = 0x08A2, + kHIDUsage_Snsr_Data_Location_GPSSelectionModeManualInput = 0x08A3, + kHIDUsage_Snsr_Data_Location_GPSSelectionModeSimulator = 0x08A4, + kHIDUsage_Snsr_Data_Location_GPSSelectionModeDataNotValid = 0x08A5, + + kHIDUsage_Snsr_Data_Location_GPSStatus = 0x040F, + kHIDUsage_Snsr_Data_Location_GPSStatusDataValid = 0x08B0, + kHIDUsage_Snsr_Data_Location_GPSStatusDataNotValid = 0x08B1, + + kHIDUsage_Snsr_Data_Location_PositionDilutionOfPrecision = 0x0410, + kHIDUsage_Snsr_Data_Location_HorizontalDilutionOfPrecision = 0x0411, + kHIDUsage_Snsr_Data_Location_VerticalDilutionOfPrecision = 0x0412, + kHIDUsage_Snsr_Data_Location_Latitude = 0x0413, + kHIDUsage_Snsr_Data_Location_Longitude = 0x0414, + kHIDUsage_Snsr_Data_Location_TrueHeading = 0x0415, + kHIDUsage_Snsr_Data_Location_MagneticHeading = 0x0416, + kHIDUsage_Snsr_Data_Location_MagneticVariation = 0x0417, + kHIDUsage_Snsr_Data_Location_Speed = 0x0418, + kHIDUsage_Snsr_Data_Location_SatellitesInView = 0x0419, + kHIDUsage_Snsr_Data_Location_SatellitesInViewAzimuth = 0x041A, + kHIDUsage_Snsr_Data_Location_SatellitesInViewElevation = 0x041B, + kHIDUsage_Snsr_Data_Location_SatellitesInViewIDs = 0x041C, + kHIDUsage_Snsr_Data_Location_SatellitesInViewPRNs = 0x041D, + kHIDUsage_Snsr_Data_Location_SatellitesInViewSNRatios = 0x041E, + kHIDUsage_Snsr_Data_Location_SatellitesUsedCount = 0x041F, + kHIDUsage_Snsr_Data_Location_SatellitesUsedPRNs = 0x0420, + kHIDUsage_Snsr_Data_Location_NMEASentence = 0x0421, + kHIDUsage_Snsr_Data_Location_AddressLine1 = 0x0422, + kHIDUsage_Snsr_Data_Location_AddressLine2 = 0x0423, + kHIDUsage_Snsr_Data_Location_City = 0x0424, + kHIDUsage_Snsr_Data_Location_StateOrProvince = 0x0425, + kHIDUsage_Snsr_Data_Location_CountryOrRegion = 0x0426, + kHIDUsage_Snsr_Data_Location_PostalCode = 0x0427, + /* 0x0428 - 0x0429 Reserved */ + + /* Location Sensor Properties */ + kHIDUsage_Snsr_Property_Location = 0x042A, + kHIDUsage_Snsr_Property_Location_DesiredAccuracy = 0x042B, + kHIDUsage_Snsr_Property_Location_AccuracyDefault = 0x0860, + kHIDUsage_Snsr_Property_Location_AccuracyHigh = 0x0861, + kHIDUsage_Snsr_Property_Location_AccuracyMedium = 0x0862, + kHIDUsage_Snsr_Property_Location_AccuracyLow = 0x0863, + /* 0x042C - 0x042F Reserved */ + + /* Environmental Sensor Data Fields */ + kHIDUsage_Snsr_Data_Environmental = 0x0430, + kHIDUsage_Snsr_Data_Environmental_AtmosphericPressure = 0x0431, + kHIDUsage_Snsr_Data_Environmental_Reserved = 0x0432, + kHIDUsage_Snsr_Data_Environmental_RelativeHumidity = 0x0433, + kHIDUsage_Snsr_Data_Environmental_Temperature = 0x0434, + kHIDUsage_Snsr_Data_Environmental_WindDirection = 0x0435, + kHIDUsage_Snsr_Data_Environmental_WindSpeed = 0x0436, + /* 0x0437 - 0x043F Reserved */ + + /* Environmental Sensor Properties */ + kHIDUsage_Snsr_Property_Environmental = 0x0440, + kHIDUsage_Snsr_Property_Environmental_ReferencePressure = 0x0441, + /* 0x0442 - 0x044F Reserved */ + + /* Motion Sensor Data Fields */ + kHIDUsage_Snsr_Data_Motion = 0x0450, + kHIDUsage_Snsr_Data_Motion_State = 0x0451, + kHIDUsage_Snsr_Data_Motion_Acceleration = 0x0452, + kHIDUsage_Snsr_Data_Motion_AccelerationAxisX = 0x0453, + kHIDUsage_Snsr_Data_Motion_AccelerationAxisY = 0x0454, + kHIDUsage_Snsr_Data_Motion_AccelerationAxisZ = 0x0455, + kHIDUsage_Snsr_Data_Motion_AngularVelocity = 0x0456, + kHIDUsage_Snsr_Data_Motion_AngularVelocityXAxis = 0x0457, + kHIDUsage_Snsr_Data_Motion_AngularVelocityYAxis = 0x0458, + kHIDUsage_Snsr_Data_Motion_AngularVelocityZAxis = 0x0459, + kHIDUsage_Snsr_Data_Motion_AngularPosition = 0x045A, + kHIDUsage_Snsr_Data_Motion_AngularPositionXAxis = 0x045B, + kHIDUsage_Snsr_Data_Motion_AngularPositionYAxis = 0x045C, + kHIDUsage_Snsr_Data_Motion_AngularPositionZAxis = 0x045D, + kHIDUsage_Snsr_Data_Motion_Speed = 0x045E, + kHIDUsage_Snsr_Data_Motion_Intensity = 0x045F, + /* 0x0460 - 0x046F Reserved */ + + /* Orientation Sensor Data Fields */ + kHIDUsage_Snsr_Data_Orientation = 0x0470, + kHIDUsage_Snsr_Data_Orientation_Heading = 0x0471, + kHIDUsage_Snsr_Data_Orientation_HeadingXAxis = 0x0472, + kHIDUsage_Snsr_Data_Orientation_HeadingYAxis = 0x0473, + kHIDUsage_Snsr_Data_Orientation_HeadingZAxis = 0x0474, + kHIDUsage_Snsr_Data_Orientation_HeadingCompensatedMagneticNorth = 0x0475, + kHIDUsage_Snsr_Data_Orientation_HeadingCompensatedTrueNorth = 0x0476, + kHIDUsage_Snsr_Data_Orientation_HeadingMagneticNorth = 0x0477, + kHIDUsage_Snsr_Data_Orientation_HeadingTrueNorth = 0x0478, + kHIDUsage_Snsr_Data_Orientation_Distance = 0x0479, + kHIDUsage_Snsr_Data_Orientation_DistanceXAxis = 0x047A, + kHIDUsage_Snsr_Data_Orientation_DistanceYAxis = 0x047B, + kHIDUsage_Snsr_Data_Orientation_DistanceZAxis = 0x047C, + kHIDUsage_Snsr_Data_Orientation_DistanceOutOfRange = 0x047D, + kHIDUsage_Snsr_Data_Orientation_Tilt = 0x047E, + kHIDUsage_Snsr_Data_Orientation_TiltXAxis = 0x047F, + kHIDUsage_Snsr_Data_Orientation_TiltYAxis = 0x0480, + kHIDUsage_Snsr_Data_Orientation_TiltZAxis = 0x0481, + kHIDUsage_Snsr_Data_Orientation_RotationMatrix = 0x0482, + kHIDUsage_Snsr_Data_Orientation_Quaternion = 0x0483, + kHIDUsage_Snsr_Data_Orientation_MagneticFlux = 0x0484, + kHIDUsage_Snsr_Data_Orientation_MagneticFluxXAxis = 0x0485, + kHIDUsage_Snsr_Data_Orientation_MagneticFluxYAxis = 0x0486, + kHIDUsage_Snsr_Data_Orientation_MagneticFluxZAxis = 0x0487, + /* 0x0488 - 0x048F Reserved */ + + /* Mechanical Sensor Data Field */ + kHIDUsage_Snsr_Data_Mechanical = 0x0490, + kHIDUsage_Snsr_Data_Mechanical_BooleanSwitchState = 0x0491, + kHIDUsage_Snsr_Data_Mechanical_BooleanSwitchArrayStates = 0x0492, + kHIDUsage_Snsr_Data_Mechanical_MultivalueSwitchValue = 0x0493, + kHIDUsage_Snsr_Data_Mechanical_Force = 0x0494, + kHIDUsage_Snsr_Data_Mechanical_AbsolutePressure = 0x0495, + kHIDUsage_Snsr_Data_Mechanical_GaugePressure = 0x0496, + kHIDUsage_Snsr_Data_Mechanical_Strain = 0x0497, + kHIDUsage_Snsr_Data_Mechanical_Weight = 0x0498, + /* 0x0499 - 0x49F Reserved */ + + /* Mechanical Sensor Properties */ + kHIDUsage_Snsr_Property_Mechanical = 0x04A0, + kHIDUsage_Snsr_Property_Mechanical_VibrationState = 0x04A1, + kHIDUsage_Snsr_Property_Mechanical_ForwardVibrationSpeed = 0x04A2, + kHIDUsage_Snsr_Property_Mechanical_BackwardVibrationSpeed = 0x04A3, + /* 0x04A4 - 0x04AF Reserved */ + + /* Biometric Sensor Data Fields */ + kHIDUsage_Snsr_Data_Biometric = 0x04B0, + kHIDUsage_Snsr_Data_Biometric_HumanPresence = 0x04B1, + kHIDUsage_Snsr_Data_Biometric_HumanProximityRange = 0x04B2, + kHIDUsage_Snsr_Data_Biometric_HumanProximityOutOfRange = 0x04B3, + kHIDUsage_Snsr_Data_Biometric_HumanTouchState = 0x04B4, + /* 0x04B5 - 0x04CF Reserved */ + + /* Light Sensor Data Fields */ + kHIDUsage_Snsr_Data_Light = 0x04D0, + kHIDUsage_Snsr_Data_Light_Illuminance = 0x04D1, + kHIDUsage_Snsr_Data_Light_ColorTemperature = 0x04D2, + kHIDUsage_Snsr_Data_Light_Chromaticity = 0x04D3, + kHIDUsage_Snsr_Data_Light_ChromaticityX = 0x04D4, + kHIDUsage_Snsr_Data_Light_ChromaticityY = 0x04D5, + kHIDUsage_Snsr_Data_Light_ConsumerIRSentenceReceive = 0x04D6, + /* 0x04D7 - 0x04DF Reserved */ + + /* Light Sensor Properties */ + kHIDUsage_Snsr_Property_Light = 0x04E0, + kHIDUsage_Snsr_Property_Light_ConsumerIRSentenceSend = 0x04E1, + /* 0x04E2 - 0x04EF Reserved */ + + /* Scanner Sensor Data Fields */ + kHIDUsage_Snsr_Data_Scanner = 0x04F0, + kHIDUsage_Snsr_Data_Scanner_RFIDTag40Bit = 0x04F1, + kHIDUsage_Snsr_Data_Scanner_NFCSentenceReceive = 0x04F2, + /* 0x04F3 - 0x04F7 Reserved */ + + /* Scanner Sensor Properties */ + kHIDUsage_Snsr_Property_Scanner = 0x04F8, + kHIDUsage_Snsr_Property_Scanner_NFCSentenceSend = 0x0F49, + /* 0x04FA - 0x04FF Reserved */ + + /* Electrical Sensor Data Fields */ + kHIDUsage_Snsr_Data_Electrical = 0x0500, + kHIDUsage_Snsr_Data_Electrical_Capacitance = 0x0501, + kHIDUsage_Snsr_Data_Electrical_Current = 0x0502, + kHIDUsage_Snsr_Data_Electrical_ElectricalPower = 0x0503, + kHIDUsage_Snsr_Data_Electrical_Inductance = 0x0504, + kHIDUsage_Snsr_Data_Electrical_Resistance = 0x0505, + kHIDUsage_Snsr_Data_Electrical_Voltage = 0x0506, + kHIDUsage_Snsr_Data_Electrical_Frequency = 0x0507, + kHIDUsage_Snsr_Data_Electrical_Period = 0x0508, + kHIDUsage_Snsr_Data_Electrical_PercentOfRange = 0x0509, + /* 0x050A - 0x051F Reserved */ + + /* Time Sensor Data Fields */ + kHIDUsage_Snsr_Data_Time = 0x0520, + kHIDUsage_Snsr_Data_Time_Year = 0x0521, + kHIDUsage_Snsr_Data_Time_Month = 0x0522, + kHIDUsage_Snsr_Data_Time_Day = 0x0523, + + kHIDUsage_Snsr_Data_Time_DayOfWeek = 0x0524, + kHIDUsage_Snsr_Data_Time_DayOfWeekSunday = 0x08C0, + kHIDUsage_Snsr_Data_Time_DayOfWeekMonday = 0x08C1, + kHIDUsage_Snsr_Data_Time_DayOfWeekTuesday = 0x08C2, + kHIDUsage_Snsr_Data_Time_DayOfWeekWednesday = 0x08C3, + kHIDUsage_Snsr_Data_Time_DayOfWeekThursday = 0x08C4, + kHIDUsage_Snsr_Data_Time_DayOfWeekFriday = 0x08C5, + kHIDUsage_Snsr_Data_Time_DayOfWeekSaturday = 0x08C6, + + kHIDUsage_Snsr_Data_Time_Hour = 0x0525, + kHIDUsage_Snsr_Data_Time_Minute = 0x0526, + kHIDUsage_Snsr_Data_Time_Second = 0x0527, + kHIDUsage_Snsr_Data_Time_Millisecond = 0x0528, + kHIDUsage_Snsr_Data_Time_Timestamp = 0x0529, + kHIDUsage_Snsr_Data_Time_JulianDayOfYear = 0x052A, + /* 0x052B - 0x052F Reserved */ + + /* Time Sensor Properties */ + kHIDUsage_Snsr_Property_Time = 0x0530, + kHIDUsage_Snsr_Property_Time_TimeZoneOffsetFromUTC = 0x0531, + kHIDUsage_Snsr_Property_Time_TimeZoneName = 0x0532, + kHIDUsage_Snsr_Property_Time_DaylightSavingsTimeObserved = 0x0533, + kHIDUsage_Snsr_Property_Time_TimeTrimAdjustment = 0x0534, + kHIDUsage_Snsr_Property_Time_ArmAlarm = 0x0535, + /* 0x0536 - 0x053F Reserved */ + + /* Custom Sensor Data Fields */ + kHIDUsage_Snsr_Data_Custom = 0x0540, + kHIDUsage_Snsr_Data_Custom_Usage = 0x0541, + kHIDUsage_Snsr_Data_Custom_BooleanArray = 0x0542, + kHIDUsage_Snsr_Data_Custom_Value = 0x0543, + kHIDUsage_Snsr_Data_Custom_Value1 = 0x0544, + kHIDUsage_Snsr_Data_Custom_Value2 = 0x0545, + kHIDUsage_Snsr_Data_Custom_Value3 = 0x0546, + kHIDUsage_Snsr_Data_Custom_Value4 = 0x0547, + kHIDUsage_Snsr_Data_Custom_Value5 = 0x0548, + kHIDUsage_Snsr_Data_Custom_Value6 = 0x0549, + /* 0x054A - 0x055F Reserved */ +}; + +/* Power Device Page (0x84) */ +/* This section provides detailed descriptions of the usages employed by Power Devices. */ +enum +{ + + kHIDUsage_PD_Undefined = 0x00, /* Power Device Undefined Usage */ + kHIDUsage_PD_iName = 0x01, /* CL- Power Device Name Index */ + kHIDUsage_PD_PresentStatus = 0x02, /* CL- Power Device Present Status */ + kHIDUsage_PD_ChangedStatus = 0x03, /* CA- Power Device Changed Status */ + kHIDUsage_PD_UPS = 0x04, /* CA- Uninterruptible Power Supply */ + kHIDUsage_PD_PowerSupply = 0x05, /* CA- Power Supply */ + kHIDUsage_PD_PeripheralDevice = 0x06, /* CA- Perpheral Device */ + /* Reserved 0x07 - 0x0F */ + kHIDUsage_PD_BatterySystem = 0x10, /* CP- Battery System power module */ + kHIDUsage_PD_BatterySystemID = 0x11, /* SV IF- Battery System ID */ + kHIDUsage_PD_Battery = 0x12, /* CP- Battery */ + kHIDUsage_PD_BatteryID = 0x13, /* SV IF- Battery ID */ + kHIDUsage_PD_Charger = 0x14, /* CP- Charger */ + kHIDUsage_PD_ChargerID = 0x15, /* SV IF- Charger ID */ + kHIDUsage_PD_PowerConverter = 0x16, /* CP- Power Converter power module */ + kHIDUsage_PD_PowerConverterID = 0x17, /* SV IF- Power Converter ID */ + kHIDUsage_PD_OutletSystem = 0x18, /* CP- Outlet System power module */ + kHIDUsage_PD_OutletSystemID = 0x19, /* SV IF-Outlet System ID */ + kHIDUsage_PD_Input = 0x1A, /* CP- Power Device Input */ + kHIDUsage_PD_InputID = 0x1B, /* SV IF- Power Device Input ID */ + kHIDUsage_PD_Output = 0x1C, /* CP- Power Device Output */ + kHIDUsage_PD_OutputID = 0x1D, /* SV IF- Power Device Output ID */ + kHIDUsage_PD_Flow = 0x1E, /* CP- Power Device Flow */ + kHIDUsage_PD_FlowID = 0x1F, /* Item IF- Power Device Flow ID */ + kHIDUsage_PD_Outlet = 0x20, /* CP- Power Device Outlet */ + kHIDUsage_PD_OutletID = 0x21, /* SV IF- Power Device Outlet ID */ + kHIDUsage_PD_Gang = 0x22, /* CL/CP- Power Device Gang */ + kHIDUsage_PD_GangID = 0x23, /* SV IF- Power Device Gang ID */ + kHIDUsage_PD_PowerSummary = 0x24, /* CL/CP- Power Device Power Summary */ + kHIDUsage_PD_PowerSummaryID = 0x25, /* SV IF- Power Device Power Summary ID */ + /* Reserved 0x26 - 0x2F */ + kHIDUsage_PD_Voltage = 0x30, /* DV IF- Power Device Voltage */ + kHIDUsage_PD_Current = 0x31, /* DV IF- Power Device Current */ + kHIDUsage_PD_Frequency = 0x32, /* DV IF- Power Device Frequency */ + kHIDUsage_PD_ApparentPower = 0x33, /* DV IF- Power Device Apparent Power */ + kHIDUsage_PD_ActivePower = 0x34, /* DV IF- Power Device RMS Power */ + kHIDUsage_PD_PercentLoad = 0x35, /* DV IF- Power Device Percent Load */ + kHIDUsage_PD_Temperature = 0x36, /* DV IF- Power Device Temperature */ + kHIDUsage_PD_Humidity = 0x37, /* DV IF- Power Device Humidity */ + kHIDUsage_PD_BadCount = 0x38, /* DV IF- Power Device Bad Condition Count */ + /* Reserved 0x39 - 0x3F */ + kHIDUsage_PD_ConfigVoltage = 0x40, /* SV/DV F- Power Device Nominal Voltage */ + kHIDUsage_PD_ConfigCurrent = 0x41, /* SV/DV F- Power Device Nominal Current */ + kHIDUsage_PD_ConfigFrequency = 0x42, /* SV/DV F- Power Device Nominal Frequency */ + kHIDUsage_PD_ConfigApparentPower = 0x43, /* SV/DV F- Power Device Nominal Apparent Power */ + kHIDUsage_PD_ConfigActivePower = 0x44, /* SV/DV F- Power Device Nominal RMS Power */ + kHIDUsage_PD_ConfigPercentLoad = 0x45, /* SV/DV F- Power Device Nominal Percent Load */ + kHIDUsage_PD_ConfigTemperature = 0x46, /* SV/DV F- Power Device Nominal Temperature */ + kHIDUsage_PD_ConfigHumidity = 0x47, /* SV/DV F- Power Device Nominal Humidity */ + /* Reserved 0x48 - 0x4F */ + kHIDUsage_PD_SwitchOnControl = 0x50, /* DV F- Power Device Switch On Control */ + kHIDUsage_PD_SwitchOffControl = 0x51, /* DV F- Power Device Switch Off Control */ + kHIDUsage_PD_ToggleControl = 0x52, /* DV F- Power Device Toogle Sequence Control */ + kHIDUsage_PD_LowVoltageTransfer = 0x53, /* DV F- Power Device Min Transfer Voltage */ + kHIDUsage_PD_HighVoltageTransfer = 0x54, /* DV F- Power Device Max Transfer Voltage */ + kHIDUsage_PD_DelayBeforeReboot = 0x55, /* DV F- Power Device Delay Before Reboot */ + kHIDUsage_PD_DelayBeforeStartup = 0x56, /* DV F- Power Device Delay Before Startup */ + kHIDUsage_PD_DelayBeforeShutdown = 0x57, /* DV F- Power Device Delay Before Shutdown */ + kHIDUsage_PD_Test = 0x58, /* DV F- Power Device Test Request/Result */ + kHIDUsage_PD_ModuleReset = 0x59, /* DV F- Power Device Reset Request/Result */ + kHIDUsage_PD_AudibleAlarmControl = 0x5A, /* DV F- Power Device Audible Alarm Control */ + /* Reserved 0x5B - 0x5F */ + kHIDUsage_PD_Present = 0x60, /* DV IOF- Power Device Present */ + kHIDUsage_PD_Good = 0x61, /* DV IOF- Power Device Good */ + kHIDUsage_PD_InternalFailure = 0x62, /* DV IOF- Power Device Internal Failure */ + kHIDUsage_PD_VoltageOutOfRange = 0x63, /* DV IOF- Power Device Voltage Out Of Range */ + kHIDUsage_PD_FrequencyOutOfRange = 0x64, /* DV IOF- Power Device Frequency Out Of Range */ + kHIDUsage_PD_Overload = 0x65, /* DV IOF- Power Device Overload */ + kHIDUsage_PD_OverCharged = 0x66, /* DV IOF- Power Device Over Charged */ + kHIDUsage_PD_OverTemperature = 0x67, /* DV IOF- Power Device Over Temperature */ + kHIDUsage_PD_ShutdownRequested = 0x68, /* DV IOF- Power Device Shutdown Requested */ + kHIDUsage_PD_ShutdownImminent = 0x69, /* DV IOF- Power Device Shutdown Imminent */ + /* Reserved 0x6A */ + kHIDUsage_PD_SwitchOnOff = 0x6B, /* DV IOF- Power Device On/Off Switch Status */ + kHIDUsage_PD_Switchable = 0x6C, /* DV IOF- Power Device Switchable */ + kHIDUsage_PD_Used = 0x6D, /* DV IOF- Power Device Used */ + kHIDUsage_PD_Boost = 0x6E, /* DV IOF- Power Device Boosted */ + kHIDUsage_PD_Buck = 0x6F, /* DV IOF- Power Device Bucked */ + kHIDUsage_PD_Initialized = 0x70, /* DV IOF- Power Device Initialized */ + kHIDUsage_PD_Tested = 0x71, /* DV IOF- Power Device Tested */ + kHIDUsage_PD_AwaitingPower = 0x72, /* DV IOF- Power Device Awaiting Power */ + kHIDUsage_PD_CommunicationLost = 0x73, /* DV IOF- Power Device Communication Lost */ + /* Reserved 0x74 - 0xFC */ + kHIDUsage_PD_iManufacturer = 0xFD, /* SV F- Power Device Manufacturer String Index */ + kHIDUsage_PD_iProduct = 0xFE, /* SV F- Power Device Product String Index */ + kHIDUsage_PD_iserialNumber = 0xFF /* SV F- Power Device Serial Number String Index */ +}; + +/* Battery System Page (x85) */ +/* This section provides detailed descriptions of the usages employed by Battery Systems. */ +enum +{ + kHIDUsage_BS_Undefined = 0x00, /* Battery System Undefined */ + kHIDUsage_BS_SMBBatteryMode = 0x01, /* CL - SMB Mode */ + kHIDUsage_BS_SMBBatteryStatus = 0x02, /* CL - SMB Status */ + kHIDUsage_BS_SMBAlarmWarning = 0x03, /* CL - SMB Alarm Warning */ + kHIDUsage_BS_SMBChargerMode = 0x04, /* CL - SMB Charger Mode */ + kHIDUsage_BS_SMBChargerStatus = 0x05, /* CL - SMB Charger Status */ + kHIDUsage_BS_SMBChargerSpecInfo = 0x06, /* CL - SMB Charger Extended Status */ + kHIDUsage_BS_SMBSelectorState = 0x07, /* CL - SMB Selector State */ + kHIDUsage_BS_SMBSelectorPresets = 0x08, /* CL - SMB Selector Presets */ + kHIDUsage_BS_SMBSelectorInfo = 0x09, /* CL - SMB Selector Info */ + /* Reserved 0x0A - 0x0F */ + kHIDUsage_BS_OptionalMfgFunction1 = 0x10, /* DV F - Battery System Optional SMB Mfg Function 1 */ + kHIDUsage_BS_OptionalMfgFunction2 = 0x11, /* DV F - Battery System Optional SMB Mfg Function 2 */ + kHIDUsage_BS_OptionalMfgFunction3 = 0x12, /* DV F - Battery System Optional SMB Mfg Function 3 */ + kHIDUsage_BS_OptionalMfgFunction4 = 0x13, /* DV F - Battery System Optional SMB Mfg Function 4 */ + kHIDUsage_BS_OptionalMfgFunction5 = 0x14, /* DV F - Battery System Optional SMB Mfg Function 5 */ + kHIDUsage_BS_ConnectionToSMBus = 0x15, /* DF F - Battery System Connection To System Management Bus */ + kHIDUsage_BS_OutputConnection = 0x16, /* DF F - Battery System Output Connection Status */ + kHIDUsage_BS_ChargerConnection = 0x17, /* DF F - Battery System Charger Connection */ + kHIDUsage_BS_BatteryInsertion = 0x18, /* DF F - Battery System Battery Insertion */ + kHIDUsage_BS_Usenext = 0x19, /* DF F - Battery System Use Next */ + kHIDUsage_BS_OKToUse = 0x1A, /* DF F - Battery System OK To Use */ + kHIDUsage_BS_BatterySupported = 0x1B, /* DF F - Battery System Battery Supported */ + kHIDUsage_BS_SelectorRevision = 0x1C, /* DF F - Battery System Selector Revision */ + kHIDUsage_BS_ChargingIndicator = 0x1D, /* DF F - Battery System Charging Indicator */ + /* Reserved 0x1E - 0x27 */ + kHIDUsage_BS_ManufacturerAccess = 0x28, /* DV F - Battery System Manufacturer Access */ + kHIDUsage_BS_RemainingCapacityLimit = 0x29, /* DV F - Battery System Remaining Capacity Limit */ + kHIDUsage_BS_RemainingTimeLimit = 0x2A, /* DV F - Battery System Remaining Time Limit */ + kHIDUsage_BS_AtRate = 0x2B, /* DV F - Battery System At Rate... */ + kHIDUsage_BS_CapacityMode = 0x2C, /* DV F - Battery System Capacity Mode */ + kHIDUsage_BS_BroadcastToCharger = 0x2D, /* DV F - Battery System Broadcast To Charger */ + kHIDUsage_BS_PrimaryBattery = 0x2E, /* DV F - Battery System Primary Battery */ + kHIDUsage_BS_ChargeController = 0x2F, /* DV F - Battery System Charge Controller */ + /* Reserved 0x30 - 0x3F */ + kHIDUsage_BS_TerminateCharge = 0x40, /* DF IOF - Battery System Terminate Charge */ + kHIDUsage_BS_TerminateDischarge = 0x41, /* DF IOF - Battery System Terminate Discharge */ + kHIDUsage_BS_BelowRemainingCapacityLimit = 0x42, /* DF IOF - Battery System Below Remaining Capacity Limit */ + kHIDUsage_BS_RemainingTimeLimitExpired = 0x43, /* DF IOF - Battery System Remaining Time Limit Expired */ + kHIDUsage_BS_Charging = 0x44, /* DF IOF - Battery System Charging */ + kHIDUsage_BS_Discharging = 0x45, /* DV IOF - Battery System Discharging */ + kHIDUsage_BS_FullyCharged = 0x46, /* DF IOF - Battery System Fully Charged */ + kHIDUsage_BS_FullyDischarged = 0x47, /* DV IOF - Battery System Fully Discharged */ + kHIDUsage_BS_ConditioningFlag = 0x48, /* DV IOF - Battery System Conditioning Flag */ + kHIDUsage_BS_AtRateOK = 0x49, /* DV IOF - Battery System At Rate OK */ + kHIDUsage_BS_SMBErrorCode = 0x4A, /* DF IOF - Battery System SMB Error Code */ + kHIDUsage_BS_NeedReplacement = 0x4B, /* DF IOF - Battery System Need Replacement */ + /* Reserved 0x4C - 0x5F */ + kHIDUsage_BS_AtRateTimeToFull = 0x60, /* DV IF - Battery System At Rate Time To Full */ + kHIDUsage_BS_AtRateTimeToEmpty = 0x61, /* DV IF - Battery System At Rate Time To Empty */ + kHIDUsage_BS_AverageCurrent = 0x62, /* DV IF - Battery System Average Current */ + kHIDUsage_BS_Maxerror = 0x63, /* DV IF - Battery System Max Error */ + kHIDUsage_BS_RelativeStateOfCharge = 0x64, /* DV IF - Battery System Relative State Of Charge */ + kHIDUsage_BS_AbsoluteStateOfCharge = 0x65, /* DV IF - Battery System Absolute State Of Charge */ + kHIDUsage_BS_RemainingCapacity = 0x66, /* DV IF - Battery System Remaining Capacity */ + kHIDUsage_BS_FullChargeCapacity = 0x67, /* DV IF - Battery System Full Charge Capacity */ + kHIDUsage_BS_RunTimeToEmpty = 0x68, /* DV IF - Battery System Run Time To Empty */ + kHIDUsage_BS_AverageTimeToEmpty = 0x69, /* DV IF - Battery System Average Time To Empty */ + kHIDUsage_BS_AverageTimeToFull = 0x6A, /* DV IF - Battery System Average Time To Full */ + kHIDUsage_BS_CycleCount = 0x6B, /* DV IF - Battery System Cycle Count */ + /* Reserved 0x6C - 0x7F */ + kHIDUsage_BS_BattPackModelLevel = 0x80, /* SV F - Battery System Batt Pack Model Level */ + kHIDUsage_BS_InternalChargeController = 0x81, /* SF F - Battery System Internal Charge Controller */ + kHIDUsage_BS_PrimaryBatterySupport = 0x82, /* SF F - Battery System Primary Battery Support */ + kHIDUsage_BS_DesignCapacity = 0x83, /* SV F - Battery System Design Capacity */ + kHIDUsage_BS_SpecificationInfo = 0x84, /* SV F - Battery System Specification Info */ + kHIDUsage_BS_ManufacturerDate = 0x85, /* SV F - Battery System Manufacturer Date */ + kHIDUsage_BS_SerialNumber = 0x86, /* SV F - Battery System Serial Number */ + kHIDUsage_BS_iManufacturerName = 0x87, /* SV F - Battery System Manufacturer Name Index */ + kHIDUsage_BS_iDevicename = 0x88, /* SV F - Battery System Device Name Index */ + kHIDUsage_BS_iDeviceChemistry = 0x89, /* SV F - Battery System Device Chemistry Index */ + kHIDUsage_BS_ManufacturerData = 0x8A, /* SV F - Battery System Manufacturer Data */ + kHIDUsage_BS_Rechargable = 0x8B, /* SV F - Battery System Rechargable */ + kHIDUsage_BS_WarningCapacityLimit = 0x8C, /* SV F - Battery System Warning Capacity Limit */ + kHIDUsage_BS_CapacityGranularity1 = 0x8D, /* SV F - Battery System Capacity Granularity 1 */ + kHIDUsage_BS_CapacityGranularity2 = 0x8E, /* SV F - Battery System Capacity Granularity 2 */ + kHIDUsage_BS_iOEMInformation = 0x8F, /* SV F - Battery System OEM Information Index */ + /* Reserved 0x90 - 0xBF */ + kHIDUsage_BS_InhibitCharge = 0xC0, /* DF IOF - Battery System Inhibit Charge */ + kHIDUsage_BS_EnablePolling = 0xC1, /* DF IOF - Battery System Enable Polling */ + kHIDUsage_BS_ResetToZero = 0xC2, /* DF IOF - Battery System Reset To Zero */ + /* Reserved 0xC3 - 0xCF */ + kHIDUsage_BS_ACPresent = 0xD0, /* DF IOF - Battery System AC Present */ + kHIDUsage_BS_BatteryPresent = 0xD1, /* DF IOF - Battery System Battery Present */ + kHIDUsage_BS_PowerFail = 0xD2, /* DF IOF - Battery System Power Fail */ + kHIDUsage_BS_AlarmInhibited = 0xD3, /* DF IOF - Battery System Alarm Inhibited */ + kHIDUsage_BS_ThermistorUnderRange = 0xD4, /* DF IOF - Battery System Thermistor Under Range */ + kHIDUsage_BS_ThermistorHot = 0xD5, /* DF IOF - Battery System Thermistor Hot */ + kHIDUsage_BS_ThermistorCold = 0xD6, /* DF IOF - Battery System Thermistor Cold */ + kHIDUsage_BS_ThermistorOverRange = 0xD7, /* DF IOF - Battery System Thermistor Over Range */ + kHIDUsage_BS_VoltageOutOfRange = 0xD8, /* DF IOF - Battery System Voltage Out Of Range */ + kHIDUsage_BS_CurrentOutOfRange = 0xD9, /* DF IOF - Battery System Current Out Of Range */ + kHIDUsage_BS_CurrentNotRegulated = 0xDA, /* DF IOF - Battery System Current Not Regulated */ + kHIDUsage_BS_VoltageNotRegulated = 0xDB, /* DF IOF - Battery System Voltage Not Regulated */ + kHIDUsage_BS_MasterMode = 0xDC, /* DF IOF - Battery System Master Mode */ + /* Reserved 0xDD - 0xEF */ + kHIDUsage_BS_ChargerSelectorSupport = 0xF0, /* SF F- Battery System Charger Support Selector */ + kHIDUsage_BS_ChargerSpec = 0xF1, /* SF F- Battery System Charger Specification */ + kHIDUsage_BS_Level2 = 0xF2, /* SF F- Battery System Charger Level 2 */ + kHIDUsage_BS_Level3 = 0xF3 /* SF F- Battery System Charger Level 3 */ + /* Reserved 0xF2 - 0xFF */ +}; + +/* Bar Code Scanner Page (0x8C) */ +/* This section provides detailed descriptions of the usages employed by Bar Code Scanner Devices. */ +enum +{ + kHIDUsage_BCS_Undefined = 0x00, /* Bar Code Scanner Undefined Usage */ + kHIDUsage_BCS_BadgeReader = 0x01, /* CA - Bar Code Badge Reader */ + kHIDUsage_BCS_BarCodeScanner = 0x02, /* CA -Bar Code Scanner */ + kHIDUsage_BCS_DumbBarCodeScanner = 0x03, /* CA -Dumb Bar Code Scanner Usage */ + kHIDUsage_BCS_CordlessScannerBase = 0x04, /* CA -Cordless Base Usage */ + kHIDUsage_BCS_BarCodeScannerCradle = 0x05, /* CA -Bar Code Scanner Cradle Usage */ + /* Reserved 0x06 - 0x0F */ + kHIDUsage_BCS_AttributeReport = 0x10, /* CL - Attribute Report */ + kHIDUsage_BCS_SettingsReport = 0x11, /* CL - Settings Report */ + kHIDUsage_BCS_ScannedDataReport = 0x12, /* CL - Scanned Data Report */ + kHIDUsage_BCS_RawScannedDataReport = 0x13, /* CL - Raw Scanned Data Report */ + kHIDUsage_BCS_TriggerReport = 0x14, /* CL - Trigger Report */ + kHIDUsage_BCS_StatusReport = 0x15, /* CL - Status Report */ + kHIDUsage_BCS_UPC_EANControlReport = 0x16, /* CL - UPC/EAN Control Report */ + kHIDUsage_BCS_EAN2_3LabelControlReport = 0x17, /* CL - EAN 2/3 Label Control Report */ + kHIDUsage_BCS_Code39ControlReport = 0x18, /* CL - Code 39 Control Report */ + kHIDUsage_BCS_Interleaved2of5ControlReport = 0x19, /* CL - Interleaved 2 of 5 Control Report */ + kHIDUsage_BCS_Standard2of5ControlReport = 0x1A, /* CL - Standard 2 of 5 Control Report */ + kHIDUsage_BCS_MSIPlesseyControlReport = 0x1B, /* CL - MSI Plessey Control Report */ + kHIDUsage_BCS_CodabarControlReport = 0x1C, /* CL - Codabar Control Report */ + kHIDUsage_BCS_Code128ControlReport = 0x1D, /* CL - Code 128 Control Report */ + kHIDUsage_BCS_Misc1DControlReport = 0x1E, /* CL - Misc 1D Control Report */ + kHIDUsage_BCS_2DControlReport = 0x1F, /* CL - 2D Control Report */ + /* Reserved 0x20 - 0x2F */ + kHIDUsage_BCS_Aiming_PointerMide = 0x30, /* SF - Aiming Pointer Mode */ + kHIDUsage_BCS_BarCodePresentSensor = 0x31, /* SF - Bar Code Present Sensor */ + kHIDUsage_BCS_Class1ALaser = 0x32, /* SF - Class 1A Laser */ + kHIDUsage_BCS_Class2Laser = 0x33, /* SF - Class 2 Laser */ + kHIDUsage_BCS_HeaterPresent = 0x34, /* SF - Heater Present */ + kHIDUsage_BCS_ContactScanner = 0x35, /* SF - Contact Scanner */ + kHIDUsage_BCS_ElectronicArticleSurveillanceNotification = 0x36, /* SF - Electronic Article Surveillance Notification */ + kHIDUsage_BCS_ConstantElectronicArticleSurveillance = 0x37, /* SF - Constant Electronic Article Surveillance */ + kHIDUsage_BCS_ErrorIndication = 0x38, /* SF - Error Indication */ + kHIDUsage_BCS_FixedBeeper = 0x39, /* SF - Fixed Beeper */ + kHIDUsage_BCS_GoodDecodeIndication = 0x3A, /* SF - Good Decode Indication */ + kHIDUsage_BCS_HandsFreeScanning = 0x3B, /* SF - Hands Free Scanning */ + kHIDUsage_BCS_IntrinsicallySafe = 0x3C, /* SF - Intrinsically Safe */ + kHIDUsage_BCS_KlasseEinsLaser = 0x3D, /* SF - Klasse Eins Laser */ + kHIDUsage_BCS_LongRangeScanner = 0x3E, /* SF - Long Range Scanner */ + kHIDUsage_BCS_MirrorSpeedControl = 0x3F, /* SF - Mirror Speed Control */ + kHIDUsage_BCS_NotOnFileIndication = 0x40, /* SF - Not On File Indication */ + kHIDUsage_BCS_ProgrammableBeeper = 0x41, /* SF - Programmable Beeper */ + kHIDUsage_BCS_Triggerless = 0x42, /* SF - Triggerless */ + kHIDUsage_BCS_Wand = 0x43, /* SF - Wand */ + kHIDUsage_BCS_WaterResistant = 0x44, /* SF - Water Resistant */ + kHIDUsage_BCS_MultiRangeScanner = 0x45, /* SF - Multi-Range Scanner */ + kHIDUsage_BCS_ProximitySensor = 0x46, /* SF - Proximity Sensor */ + /* Reserved 0x47 - 0x4C */ + kHIDUsage_BCS_FragmentDecoding = 0x4D, /* DF - Fragment Decoding */ + kHIDUsage_BCS_ScannerReadConfidence = 0x4E, /* DV - Scanner Read Confidence */ + kHIDUsage_BCS_DataPrefix = 0x4F, /* NAry - Data Prefix */ + kHIDUsage_BCS_PrefixAIMI = 0x50, /* SEL - Prefix AIMI */ + kHIDUsage_BCS_PrefixNone = 0x51, /* SEL - Prefix None */ + kHIDUsage_BCS_PrefixProprietary = 0x52, /* SEL - Prefix Proprietary */ + /* Reserved 0x53 - 0x54 */ + kHIDUsage_BCS_ActiveTime = 0x55, /* DV - Active Time */ + kHIDUsage_BCS_AimingLaserPattern = 0x56, /* DF - Aiming Laser Pattern */ + kHIDUsage_BCS_BarCodePresent = 0x57, /* OOC - Bar Code Present */ + kHIDUsage_BCS_BeeperState = 0x58, /* OOC - Beeper State */ + kHIDUsage_BCS_LaserOnTime = 0x59, /* DV - Laser On Time */ + kHIDUsage_BCS_LaserState = 0x5A, /* OOC - Laser State */ + kHIDUsage_BCS_LockoutTime = 0x5B, /* DV - Lockout Time */ + kHIDUsage_BCS_MotorState = 0x5C, /* OOC - Motor State */ + kHIDUsage_BCS_MotorTimeout = 0x5D, /* DV - Motor Timeout */ + kHIDUsage_BCS_PowerOnResetScanner = 0x5E, /* DF - Power On Reset Scanner */ + kHIDUsage_BCS_PreventReadOfBarcodes = 0x5F, /* DF - Prevent Read of Barcodes */ + kHIDUsage_BCS_InitiateBarcodeRead = 0x60, /* DF - Initiate Barcode Read */ + kHIDUsage_BCS_TriggerState = 0x61, /* DF - Trigger State */ + kHIDUsage_BCS_TriggerMode = 0x62, /* NAry - Trigger Mode */ + kHIDUsage_BCS_TriggerModeBlinkingLaserOn = 0x63, /* SEL - Trigger Mode Blinking Laser On */ + kHIDUsage_BCS_TriggerModeContinuousLaserOn = 0x64, /* SEL - Trigger Mode Continuous Laser On */ + kHIDUsage_BCS_TriggerModeLaserOnWhilePulled = 0x65, /* SEL - Trigger Mode Laser on while Pulled */ + kHIDUsage_BCS_TriggerModeLaserStaysOnAfterTriggerRelease = 0x66, /* SEL - Trigger Mode Laser stays on after Trigger Release */ + /* Reserved 0x67 - 0x6C */ + kHIDUsage_BCS_CommitParametersToNVM = 0x6D, /* DF - Commit Parameters to NVM */ + kHIDUsage_BCS_ParameterScanning = 0x6E, /* DF - Parameter Scanning */ + kHIDUsage_BCS_ParametersChanged = 0x6F, /* OOC - Parameters Changed */ + kHIDUsage_BCS_SetParameterDefaultValues = 0x70, /* DF - Set parameter default values */ + /* Reserved 0x71 - 0x74 */ + kHIDUsage_BCS_ScannerInCradle = 0x75, /* OOC - Scanner In Cradle */ + kHIDUsage_BCS_ScannerInRange = 0x76, /* OOC - Scanner In Range */ + /* Reserved 0x77 - 0x79 */ + kHIDUsage_BCS_AimDuration = 0x7A, /* DV - Aim Duration */ + kHIDUsage_BCS_GoodReadLampDuration = 0x7B, /* DV - Good Read Lamp Duration */ + kHIDUsage_BCS_GoodReadLampIntensity = 0x7C, /* DV - Good Read Lamp Intensity */ + kHIDUsage_BCS_GoodReadLED = 0x7D, /* DF - Good Read LED */ + kHIDUsage_BCS_GoodReadToneFrequency = 0x7E, /* DV - Good Read Tone Frequency*/ + kHIDUsage_BCS_GoodReadToneLength = 0x7F, /* DV - Good Read Tone Length */ + kHIDUsage_BCS_GoodReadToneVolume = 0x80, /* DV - Good Read Tone Volume */ + /* Reserved 0x81 */ + kHIDUsage_BCS_NoReadMessage = 0x82, /* DF - No Read Message */ + kHIDUsage_BCS_NotOnFileVolume = 0x83, /* DV - Not on File Volume */ + kHIDUsage_BCS_PowerupBeep = 0x84, /* DF - Powerup Beep */ + kHIDUsage_BCS_SoundErrorBeep = 0x85, /* DF - Sound Error Beep */ + kHIDUsage_BCS_SoundGoodReadBeep = 0x86, /* DF - Sound Good Read Beep */ + kHIDUsage_BCS_SoundNotOnFileBeep = 0x87, /* DF - Sound Not On File Beep */ + kHIDUsage_BCS_GoodReadWhenToWrite = 0x88, /* NArry - Good Read When to Write */ + kHIDUsage_BCS_GRWTIAfterDecode = 0x89, /* SEL - GRWTI After Decode */ + kHIDUsage_BCS_GRWTIBeep_LampAfterTransmit = 0x8A, /* SEL - GRWTI Beep/Lamp after transmit */ + kHIDUsage_BCS_GRWTINoBeep_LampUseAtAll = 0x8B, /* SEL - GRWTI No Beep/Lamp at all */ + /* Reserved 0x8C - 0x90 */ + kHIDUsage_BCS_BooklandEAN = 0x91, /* DF - Bookland EAN */ + kHIDUsage_BCS_ConvertEAN8To13Type = 0x92, /* DF - Convert EAN 8 to 13 Type */ + kHIDUsage_BCS_ConvertUPCAToEAN_13 = 0x93, /* DF - Convert UPC A to EAN-13 */ + kHIDUsage_BCS_ConvertUPC_EToA = 0x94, /* DF - Convert UPC-E to A */ + kHIDUsage_BCS_EAN_13 = 0x95, /* DF - EAN-13 */ + kHIDUsage_BCS_EAN_8 = 0x96, /* DF - EAN_8 */ + kHIDUsage_BCS_EAN_99_128_Mandatory = 0x97, /* DF - EAN-99 128_Mandatory */ + kHIDUsage_BCS_EAN_99_P5_128_Optional = 0x98, /* DF - EAN-99 P5/128_Optional */ + /* Reserved 0x99 */ + kHIDUsage_BCS_UPC_EAN = 0x9A, /* DF - UPC/EAN */ + kHIDUsage_BCS_UPC_EANCouponCode = 0x9B, /* DF - UPC/EAN Coupon Code */ + kHIDUsage_BCS_UPC_EANPeriodicals = 0x9C, /* DV - UPC/EAN Periodicals */ + kHIDUsage_BCS_UPC_A = 0x9D, /* DF - UPC-A */ + kHIDUsage_BCS_UPC_AWith128Mandatory = 0x9E, /* DF - UPC-A with 128 Mandatory */ + kHIDUsage_BCS_UPC_AWith128Optical = 0x9F, /* DF - UPC-A with 128 Optical */ + kHIDUsage_BCS_UPC_AWithP5Optional = 0xA0, /* DF - UPC-A with P5 Optional */ + kHIDUsage_BCS_UPC_E = 0xA1, /* DF - UPC-E */ + kHIDUsage_BCS_UPC_E1 = 0xA2, /* DF - UPC-E1 */ + /* Reserved 0xA3 - 0xA8 */ + kHIDUsage_BCS_Periodical = 0xA9, /* NArry - Periodical */ + kHIDUsage_BCS_PeriodicalAutoDiscriminatePlus2 = 0xAA,/* SEL - Periodical Auto-Discriminate + 2 */ + kHIDUsage_BCS_PeriodicalOnlyDecodeWithPlus2 = 0xAB, /* SEL - Periodical Only Decode with + 2 */ + kHIDUsage_BCS_PeriodicalIgnorePlus2 = 0xAC, /* SEL - Periodical Ignore + 2 */ + kHIDUsage_BCS_PeriodicalAutoDiscriminatePlus5 = 0xAD,/* SEL - Periodical Auto-Discriminate + 5 */ + kHIDUsage_BCS_PeriodicalOnlyDecodeWithPlus5 = 0xAE, /* SEL - Periodical Only Decode with + 5 */ + kHIDUsage_BCS_PeriodicalIgnorePlus5 = 0xAF, /* SEL - Periodical Ignore + 5 */ + kHIDUsage_BCS_Check = 0xB0, /* NArry - Check */ + kHIDUsage_BCS_CheckDisablePrice = 0xB1, /* SEL - Check Disable Price */ + kHIDUsage_BCS_CheckEnable4DigitPrice = 0xB2, /* SEL - Check Enable 4 digit Price */ + kHIDUsage_BCS_CheckEnable5DigitPrice = 0xB3, /* SEL - Check Enable 5 digit Price */ + kHIDUsage_BCS_CheckEnableEuropean4DigitPrice = 0xB4,/* SEL - Check Enable European 4 digit Price */ + kHIDUsage_BCS_CheckEnableEuropean5DigitPrice = 0xB5,/* SEL - Check Enable European 5 digit Price */ + /* Reserved 0xB6 */ + kHIDUsage_BCS_EANTwoLabel = 0xB7, /* DF - EAN Two Label */ + kHIDUsage_BCS_EANThreeLabel = 0xB8, /* DF - EAN Thread Label */ + kHIDUsage_BCS_EAN8FlagDigit1 = 0xB9, /* DV - EAN 8 Flag Digit 1 */ + kHIDUsage_BCS_EAN8FlagDigit2 = 0xBA, /* DV - EAN 8 Flag Digit 2 */ + kHIDUsage_BCS_EAN8FlagDigit3 = 0xBB, /* DV - EAN 8 Flag Digit 3 */ + kHIDUsage_BCS_EAN13FlagDigit1 = 0xBC, /* DV - EAN 13 Flag Digit 1 */ + kHIDUsage_BCS_EAN13FlagDigit2 = 0xBD, /* DV - EAN 13 Flag Digit 2 */ + kHIDUsage_BCS_EAN13FlagDigit3 = 0xBE, /* DV - EAN 13 Flag Digit 3 */ + kHIDUsage_BCS_AddEAN2_3LabelDefinition = 0xBF, /* DF - Add EAN 2/3 Label Definition */ + kHIDUsage_BCS_ClearAllEAN2_3LabelDefinitions = 0xC0,/* DF - Clear all EAN 2/3 Label Definitions */ + /* Reserved 0xC1 - 0xC2 */ + kHIDUsage_BCS_Codabar = 0xC3, /* DF - Codabar */ + kHIDUsage_BCS_Code128 = 0xC4, /* DF - Code 128 */ + /* Reserved 0xC5 - 0xC6 */ + kHIDUsage_BCS_Code39 = 0xC7, /* DF - Code 39 */ + kHIDUsage_BCS_Code93 = 0xC8, /* DF - Code 93 */ + kHIDUsage_BCS_FullASCIIConversion = 0xC9, /* DF - Full ASCII Conversion */ + kHIDUsage_BCS_Interleaved2of5 = 0xCA, /* DF - Interleaved 2 of 5 */ + kHIDUsage_BCS_ItalianPharmacyCode = 0xCB, /* DF - Italian Pharmacy Code */ + kHIDUsage_BCS_MSI_Plessey = 0xCC, /* DF - MSI/Plessey */ + kHIDUsage_BCS_Standard2of5IATA = 0xCD, /* DF - Standard 2 of 5 IATA */ + kHIDUsage_BCS_Standard2of5 = 0xCE, /* DF - Standard 2 of 5 */ + /* Reserved 0xCF - 0xD2 */ + kHIDUsage_BCS_TransmitStart_Stop = 0xD3, /* DF - Transmit Start/Stop */ + kHIDUsage_BCS_TriOptic = 0xD4, /* DF - Tri-Optic */ + kHIDUsage_BCS_UCC_EAN_128 = 0xD5, /* DF - UCC/EAN-128 */ + kHIDUsage_BCS_CheckDigit = 0xD6, /* NArry - Check Digit */ + kHIDUsage_BCS_CheckDigitDisable = 0xD7, /* SEL - Check Digit Disable */ + kHIDUsage_BCS_CheckDigitEnableInterleaved2of5OPCC = 0xD8, /* SEL - Check Digit Enable Interleaved 2 of 5 OPCC */ + kHIDUsage_BCS_CheckDigitEnableInterleaved2of5USS = 0xD9, /* SEL - Check Digit Enable Interleaved 2 of 5 USS */ + kHIDUsage_BCS_CheckDigitEnableStandard2of5OPCC = 0xD8, /* SEL - Check Digit Enable Standard 2 of 5 OPCC */ + kHIDUsage_BCS_CheckDigitEnableStandard2of5USS = 0xD9, /* SEL - Check Digit Enable Standard 2 of 5 USS */ + kHIDUsage_BCS_CheckDigitEnableOneMSIPlessey = 0xDC, /* SEL - Check Digit Enable One MSI Plessey */ + kHIDUsage_BCS_CheckDigitEnableTwoMSIPlessey = 0xDD, /* SEL - Check Digit Enable Two MSI Plessey */ + kHIDUsage_BCS_CheckDigitCodabarEnable = 0xDE, /* SEL - Check Digit Codabar Enable */ + kHIDUsage_BCS_CheckDigitCode99Enable = 0xDF, /* SEL - Check Digit Code 99 Enable */ + /* Reserved 0xE0 - 0xEF */ + kHIDUsage_BCS_TransmitCheckDigit = 0xF0, /* NArry - Transmit Check Digit */ + kHIDUsage_BCS_DisableCheckDigitTransmit = 0xF1, /* SEL - Disable Check Digit Transmit */ + kHIDUsage_BCS_EnableCheckDigitTransmit = 0xF2, /* SEL - Enable Check Digit Transmit */ + /* Reserved 0xF3 - 0xFA */ + kHIDUsage_BCS_SymbologyIdentifier1 = 0xFB, /* DV - Symbology Identifier 1 */ + kHIDUsage_BCS_SymbologyIdentifier2 = 0xFC, /* DV - Symbology Identifier 2 */ + kHIDUsage_BCS_SymbologyIdentifier3 = 0xFD, /* DV - Symbology Identifier 3 */ + kHIDUsage_BCS_DecodedData = 0xFE, /* DV - Decoded Data */ + kHIDUsage_BCS_DecodeDataContinued = 0xFF, /* DF - Decode Data Continued */ + kHIDUsage_BCS_BarSpaceData = 0x100, /* DV - Bar Space Data */ + kHIDUsage_BCS_ScannerDataAccuracy = 0x101, /* DV - Scanner Data Accuracy */ + kHIDUsage_BCS_RawDataPolarity = 0x102, /* NArry - Raw Data Polarity */ + kHIDUsage_BCS_PolarityInvertedBarCode = 0x103, /* SEL - Polarity Inverted Bar Code */ + kHIDUsage_BCS_PolarityNormalBarCode = 0x103, /* SEL - Polarity Normal Bar Code */ + /* Reserved 0x105 */ + kHIDUsage_BCS_MinimumLengthToDecode = 0x106, /* DV - Minimum Length to Decode */ + kHIDUsage_BCS_MaximumLengthToDecode = 0x107, /* DV - Maximum Length to Decode */ + kHIDUsage_BCS_FirstDiscreteLengthToDecode = 0x108, /* DV - First Discrete Length to Decode */ + kHIDUsage_BCS_SecondDiscreteLengthToDecode = 0x109, /* DV - Second Discrete Length to Decode */ + kHIDUsage_BCS_DataLengthMethod = 0x10A, /* NArry - Data Length Method */ + kHIDUsage_BCS_DLMethodReadAny = 0x10B, /* DF - DL Method Read any */ + kHIDUsage_BCS_DLMethodCheckInRange = 0x10C, /* DF - DL Method Check in Range */ + kHIDUsage_BCS_DLMethodCheckForDiscrete = 0x10D, /* DF - DL Method Check for Discrete */ + /* Reserved 0x10E - 0x10F */ + kHIDUsage_BCS_AztecCode = 0x110, /* DF - Aztec Code */ + kHIDUsage_BCS_BC412 = 0x111, /* DF - BC412 */ + kHIDUsage_BCS_ChannelCode = 0x112, /* DF - Channel Code */ + kHIDUsage_BCS_Code16 = 0x113, /* DF - Code 16 */ + kHIDUsage_BCS_Code32 = 0x114, /* DF - Code 32 */ + kHIDUsage_BCS_Code49 = 0x115, /* DF - Code 49 */ + kHIDUsage_BCS_CodeOne = 0x116, /* DF - Code One */ + kHIDUsage_BCS_Colorcode = 0x117, /* DF - Colorcode */ + kHIDUsage_BCS_DataMatrix = 0x118, /* DF - Data Matrix */ + kHIDUsage_BCS_MaxiCode = 0x119, /* DF - MaxiCode */ + kHIDUsage_BCS_MicroPDF = 0x11A, /* DF - MicroPDF */ + kHIDUsage_BCS_PDF_417 = 0x11B, /* DF - PDF-417 */ + kHIDUsage_BCS_PosiCode = 0x11C, /* DF - PosiCode */ + kHIDUsage_BCS_QRCode = 0x11D, /* DF - QR Code */ + kHIDUsage_BCS_SuperCode = 0x11E, /* DF - SuperCode */ + kHIDUsage_BCS_UltraCode = 0x11F, /* DF - UltraCode */ + kHIDUsage_BCS_USB_5_SlugCode = 0x120, /* DF - USD-5 (Slug Code) */ + kHIDUsage_BCS_VeriCode = 0x121 /* DF - VeriCode */ + /* Reserved 0x122 - 0xFFFF */ +}; + +/* Weighing Devices Page (0x8D) */ +/* This section provides detailed descriptions of the usages employed by Weighing Devices. */ +enum +{ + kHIDUsage_WD_Undefined = 0x00, /* Weighing Device Undefined Usage */ + kHIDUsage_WD_WeighingDevice = 0x01, /* CA - Weighing Device */ + /* Reserved 0x02 - 0x1F */ + kHIDUsage_WD_ScaleScaleDevice = 0x20, /* CL - Scale Device */ + kHIDUsage_WD_ScaleScaleClassIMetricCL = 0x21, /* CL - Scale Class I Metric */ + kHIDUsage_WD_ScaleScaleClassIMetric = 0x22, /* SEL - Scale Class I Metric */ + kHIDUsage_WD_ScaleScaleClassIIMetric = 0x23, /* SEL - Scale Class II Metric */ + kHIDUsage_WD_ScaleScaleClassIIIMetric = 0x24, /* SEL - Scale Class III Metric */ + kHIDUsage_WD_ScaleScaleClassIIILMetric = 0x25, /* SEL - Scale Class IIIL Metric */ + kHIDUsage_WD_ScaleScaleClassIVMetric = 0x26, /* SEL - Scale Class IV Metric */ + kHIDUsage_WD_ScaleScaleClassIIIEnglish = 0x27, /* SEL - Scale Class III English */ + kHIDUsage_WD_ScaleScaleClassIIILEnglish = 0x28, /* SEL - Scale Class IIIL English */ + kHIDUsage_WD_ScaleScaleClassIVEnglish = 0x29, /* SEL - Scale Class IV English */ + kHIDUsage_WD_ScaleScaleClassGeneric = 0x2A, /* SEL - Scale Class Generic */ + /* Reserved 0x2B - 0x2F */ + kHIDUsage_WD_ScaleAtrributeReport = 0x30, /* CL - Scale Attribute Report */ + kHIDUsage_WD_ScaleControlReport = 0x31, /* CL - Scale Control Report */ + kHIDUsage_WD_ScaleDataReport = 0x32, /* CL - Scale Data Report */ + kHIDUsage_WD_ScaleStatusReport = 0x33, /* CL - Scale Status Report */ + kHIDUsage_WD_ScaleWeightLimitReport = 0x34, /* CL - Scale Weight Limit Report */ + kHIDUsage_WD_ScaleStatisticsReport = 0x35, /* CL - Scale Statistics Report */ + /* Reserved 0x36 - 0x3F */ + kHIDUsage_WD_DataWeight = 0x40, /* DV - Data Weight */ + kHIDUsage_WD_DataScaling = 0x41, /* DV - Data Scaling */ + /* Reserved 0x42 - 0x4F */ + kHIDUsage_WD_WeightUnit = 0x50, /* CL - Weight Unit */ + kHIDUsage_WD_WeightUnitMilligram = 0x51, /* SEL - Weight Unit Milligram */ + kHIDUsage_WD_WeightUnitGram = 0x52, /* SEL - Weight Unit Gram */ + kHIDUsage_WD_WeightUnitKilogram = 0x53, /* SEL - Weight Unit Kilogram */ + kHIDUsage_WD_WeightUnitCarats = 0x54, /* SEL - Weight Unit Carats */ + kHIDUsage_WD_WeightUnitTaels = 0x55, /* SEL - Weight Unit Taels */ + kHIDUsage_WD_WeightUnitGrains = 0x56, /* SEL - Weight Unit Grains */ + kHIDUsage_WD_WeightUnitPennyweights = 0x57, /* SEL - Weight Unit Pennyweights */ + kHIDUsage_WD_WeightUnitMetricTon = 0x58, /* SEL - Weight Unit Metric Ton */ + kHIDUsage_WD_WeightUnitAvoirTon = 0x59, /* SEL - Weight Unit Avoir Ton */ + kHIDUsage_WD_WeightUnitTroyOunce = 0x5A, /* SEL - Weight Unit Troy Ounce */ + kHIDUsage_WD_WeightUnitOunce = 0x5B, /* SEL - Weight Unit Ounce */ + kHIDUsage_WD_WeightUnitPound = 0x5C, /* SEL - Weight Unit Pound */ + /* Reserved 0x5D - 0x5F */ + kHIDUsage_WD_CalibrationCount = 0x60, /* DV - Calibration Count */ + kHIDUsage_WD_RezeroCount = 0x61, /* DV - Re-Zero Count*/ + /* Reserved 0x62 - 0x6F */ + kHIDUsage_WD_ScaleStatus = 0x70, /* CL - Scale Status */ + kHIDUsage_WD_ScaleStatusFault = 0x71, /* SEL - Scale Status Fault */ + kHIDUsage_WD_ScaleStatusStableAtZero = 0x72, /* SEL - Scale Status Stable at Center of Zero */ + kHIDUsage_WD_ScaleStatusInMotion = 0x73, /* SEL - Scale Status In Motion */ + kHIDUsage_WD_ScaleStatusWeightStable = 0x74, /* SEL - Scale Status Weight Stable */ + kHIDUsage_WD_ScaleStatusUnderZero = 0x75, /* SEL - Scale Status Under Zero */ + kHIDUsage_WD_ScaleStatusOverWeightLimit = 0x76, /* SEL - Scale Status Over Weight Limit */ + kHIDUsage_WD_ScaleStatusRequiresCalibration = 0x77, /* SEL - Scale Status Requires Calibration */ + kHIDUsage_WD_ScaleStatusRequiresRezeroing = 0x78, /* SEL - Scale Status Requires Re-zeroing */ + /* Reserved 0x79 - 0x7F */ + kHIDUsage_WD_ZeroScale = 0x80, /* OOC - Zero Scale */ + kHIDUsage_WD_EnforcedZeroReturn = 0x81 /* OOC - Enforced Zero Return */ + /* Reserved 0x82 - 0xFFFF */ + +}; + +/* Magnetic Stripe Reader Page (0x8E) */ +/* This section provides detailed descriptions of the usages employed by Magnetic Stripe Reader Devices. */ +enum +{ + kHIDUsage_MSR_Undefined = 0x00, /* MagStripe Undefined Usage */ + kHIDUsage_MSR_DeviceReadOnly = 0x01, /* CA - MSR Device Read-Only */ + /* Reserved 0x02 - 0x10 */ + kHIDUsage_MSR_Track1Length = 0x11, /* SF, DF, SEL - Track 1 Length */ + kHIDUsage_MSR_Track2Length = 0x12, /* SF, DF, SEL - Track 2 Length */ + kHIDUsage_MSR_Track3Length = 0x13, /* SF, DF, SEL - Track 3 Length */ + kHIDUsage_MSR_TrackJISLength = 0x14, /* SF, DF, SEL - Track JIS Length */ + /* Reserved 0x15 - 0x1F */ + kHIDUsage_MSR_TrackData = 0x20, /* SF, DF, SEL - Track Data */ + kHIDUsage_MSR_Track1Data = 0x21, /* SF, DF, SEL - Track 1 Data */ + kHIDUsage_MSR_Track2Data = 0x22, /* SF, DF, SEL - Track 2 Data */ + kHIDUsage_MSR_Track3Data = 0x23, /* SF, DF, SEL - Track 3 Data */ + kHIDUsage_MSR_TrackJISData = 0x24 /* SF, DF, SEL - Track JIS Data */ + /* Reserved 0x25 - 0xFFFF */ +}; + +/* Camera Control Page (0x90) */ +enum +{ + kHIDUsage_CC_Undefined = 0x00, /* Camera Control Undefined Usage */ + /* Reserved 0x01 - 0x1F */ + kHIDUsage_CC_Autofocus = 0x20, /* One-Shot Control */ + kHIDUsage_CC_Shutter = 0x21, /* One-Shot Control */ +}; + +#endif /* _IOHIDUSAGETABLES_H */ diff --git a/QualcommWireless/include/IOKit/hidsystem/IOHIDWorkLoop.h b/QualcommWireless/include/IOKit/hidsystem/IOHIDWorkLoop.h new file mode 100644 index 0000000..c78f25a --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/IOHIDWorkLoop.h @@ -0,0 +1,22 @@ + +#ifndef _IOKIT_IOHIDWORKLOOP_H +#define _IOKIT_IOHIDWORKLOOP_H + +#include +class IOHIDWorkLoop : public IOWorkLoop +{ + OSDeclareDefaultStructors(IOHIDWorkLoop) + +protected: + lck_grp_t * fLockGroup; + + bool init ( void ) APPLE_KEXT_OVERRIDE; + void free ( void ) APPLE_KEXT_OVERRIDE; + +public: + // Create a workloop + static IOHIDWorkLoop * workLoop(); +}; + +#endif /* ! _IOKIT_IOHIDWORKLOOP_H */ + diff --git a/QualcommWireless/include/IOKit/hidsystem/IOHIDevice.h b/QualcommWireless/include/IOKit/hidsystem/IOHIDevice.h new file mode 100644 index 0000000..b3605b0 --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/IOHIDevice.h @@ -0,0 +1,71 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * IOHIDevice.h - Common Event Source object class. + * + * HISTORY + * 22 May 1992 Mike Paquette at NeXT + * Created. + * 4 Aug 1993 Erik Kay at NeXT + * API cleanup + * 5 Aug 1993 Erik Kay at NeXT + * added ivar space for future expansion + */ + +#ifndef _IOHIDEVICE_H +#define _IOHIDEVICE_H + +#include +#include + +typedef enum { + kHIUnknownDevice = 0, + kHIKeyboardDevice = 1, + kHIRelativePointingDevice = 2 +} IOHIDKind; + +class IOHIDevice : public IOService +{ + OSDeclareDefaultStructors(IOHIDevice); + +public: + virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE; + virtual void free(void) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual bool open( IOService * forClient, + IOOptionBits options = 0, + void * arg = 0 ) APPLE_KEXT_OVERRIDE; + + virtual UInt32 deviceType(); + virtual IOHIDKind hidKind(); + virtual UInt32 interfaceID(); + virtual bool updateProperties(void); + virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setParamProperties(OSDictionary * dict); + virtual UInt64 getGUID(); + + static SInt32 GenerateKey(OSObject *object); +}; + +#endif /* !_IOHIDEVICE_H */ diff --git a/QualcommWireless/include/IOKit/hidsystem/IOHIKeyboard.h b/QualcommWireless/include/IOKit/hidsystem/IOHIKeyboard.h new file mode 100644 index 0000000..0c023ab --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/IOHIKeyboard.h @@ -0,0 +1,273 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * EventSrcPCKeyboard.h - PC Keyboard EventSrc subclass definition + * + * HISTORY + * 28 Aug 1992 Joe Pasqua + * Created. + */ + +#ifndef _IOHIKEYBOARD_H +#define _IOHIKEYBOARD_H + +#include +#include + +/* Start Action Definitions */ + +/* + * HISTORICAL NOTE: + * The following entry points were part of the IOHIKeyboardEvents + * protocol. + */ + +typedef void (*KeyboardEventAction)( OSObject * target, + /* eventFlags */ unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + +typedef void (*KeyboardSpecialEventAction)(OSObject * target, + /* eventType */ unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* source id */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + +typedef void (*UpdateEventFlagsAction)( OSObject * target, + /* flags */ unsigned flags); + +/* Event Callback Definitions */ + +typedef void (*KeyboardEventCallback)( + /* target */ OSObject * target, + /* eventFlags */ unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +typedef void (*KeyboardSpecialEventCallback)( + /* target */ OSObject * target, + /* eventType */ unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* source id */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +typedef void (*UpdateEventFlagsCallback)( + /* target */ OSObject * target, + /* flags */ unsigned flags, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +/* End Action Definitions */ + +/* Default key repeat parameters */ +#define EV_DEFAULTINITIALREPEAT 500000000ULL // 1/2 sec in nanoseconds +#define EV_DEFAULTKEYREPEAT 83333333ULL // 1/12 sec in nanoseconds +#define EV_MINKEYREPEAT 16700000ULL // 1/60 sec + +class IOHIKeyboard : public IOHIDevice +{ + OSDeclareDefaultStructors(IOHIKeyboard); + + friend class IOHIDKeyboardDevice; + friend class IOHIDKeyboardEventDevice; + friend class IOHIDKeyboard; + friend class IOHIDConsumer; + +protected: + IOLock * _deviceLock; // Lock for all device access + IOHIKeyboardMapper * _keyMap; // KeyMap instance + + // The following fields describe the kind of keyboard + UInt32 _interfaceType; + UInt32 _deviceType; + + // The following fields describe the state of the keyboard + UInt32 * _keyState; // kbdBitVector + IOByteCount _keyStateSize; // kbdBitVector allocated size + unsigned _eventFlags; // Current eventFlags + bool _alphaLock; // true means alpha lock is on + bool _numLock; // true means num lock is on + bool _charKeyActive; // true means char gen. key active + + // The following fields are used in performing key repeats + bool _isRepeat; // true means we're generating repeat + unsigned _codeToRepeat; // What we are repeating + bool _calloutPending; // true means we've sched. a callout + AbsoluteTime _lastEventTime; // Time last event was dispatched + AbsoluteTime _downRepeatTime; // Time when we should next repeat + AbsoluteTime _keyRepeat; // Delay between key repeats + AbsoluteTime _initialKeyRepeat; // Delay before initial key repeat + UInt64 _guid; + + OSObject * _keyboardEventTarget; + KeyboardEventAction _keyboardEventAction; + OSObject * _keyboardSpecialEventTarget; + KeyboardSpecialEventAction _keyboardSpecialEventAction; + OSObject * _updateEventFlagsTarget; + UpdateEventFlagsAction _updateEventFlagsAction; + + UInt16 _lastUsagePage; + UInt16 _lastUsage; + +protected: + virtual void dispatchKeyboardEvent(unsigned int keyCode, + /* direction */ bool goingDown, + /* timeStamp */ AbsoluteTime time); + void setLastPageAndUsage(UInt16 usagePage, UInt16 usage); + void getLastPageAndUsage(UInt16 &usagePage, UInt16 &usage); + void clearLastPageAndUsage(); + +public: + virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void free(void) APPLE_KEXT_OVERRIDE; + + virtual bool open(IOService * client, + IOOptionBits options, + KeyboardEventAction keAction, + KeyboardSpecialEventAction kseAction, + UpdateEventFlagsAction uefAction); + + bool open( IOService * client, + IOOptionBits options, + void *, + KeyboardEventCallback keCallback, + KeyboardSpecialEventCallback kseCallback, + UpdateEventFlagsCallback uefCallback); + + virtual void close(IOService * client, IOOptionBits ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn message( UInt32 type, IOService * provider, + void * argument = 0 ) APPLE_KEXT_OVERRIDE; + + virtual IOHIDKind hidKind( void ) APPLE_KEXT_OVERRIDE; + virtual bool updateProperties( void ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setParamProperties(OSDictionary * dict) APPLE_KEXT_OVERRIDE; + virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE; + + inline bool isRepeat() {return _isRepeat;} + +protected: // for subclasses to implement + virtual const unsigned char * defaultKeymapOfLength(UInt32 * length); + virtual void setAlphaLockFeedback(bool val); + virtual void setNumLockFeedback(bool val); + virtual UInt32 maxKeyCodes(); + + +private: + virtual bool resetKeyboard(); + virtual void scheduleAutoRepeat(); + static void _autoRepeat(void * arg, void *); + virtual void autoRepeat(); + virtual void setRepeat(unsigned eventType, unsigned keyCode); + void setRepeatMode(bool repeat); + static void _createKeyboardNub(thread_call_param_t param0, thread_call_param_t param1); + +/* + * HISTORICAL NOTE: + * The following methods were part of the KeyMapDelegate protocol; + * the declarations have now been merged directly into this class. + */ + +public: + virtual void keyboardEvent(unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned keyCode, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet); + + virtual void keyboardSpecialEvent(unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned keyCode, + /* specialty */ unsigned flavor); + + virtual void updateEventFlags(unsigned flags); // Does not generate events + + virtual unsigned eventFlags(); // Global event flags + virtual unsigned deviceFlags(); // per-device event flags + virtual void setDeviceFlags(unsigned flags); // Set device event flags + virtual bool alphaLock(); // current alpha-lock state + virtual void setAlphaLock(bool val); // Set current alpha-lock state + virtual bool numLock(); + virtual void setNumLock(bool val); + virtual bool charKeyActive(); // Is a character gen. key down? + virtual void setCharKeyActive(bool val); // Note that a char gen key is down. + virtual bool doesKeyLock(unsigned key); //does key lock physically + virtual unsigned getLEDStatus(); //check hardware for LED status + +private: + static void _keyboardEvent( IOHIKeyboard * self, + unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + static void _keyboardSpecialEvent( + IOHIKeyboard * self, + unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* guid */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + + static void _updateEventFlags( IOHIKeyboard * self, + unsigned flags); /* Does not generate events */ + +}; + +#endif /* !_IOHIKEYBOARD_H */ diff --git a/QualcommWireless/include/IOKit/hidsystem/IOHIKeyboardMapper.h b/QualcommWireless/include/IOKit/hidsystem/IOHIKeyboardMapper.h new file mode 100644 index 0000000..2fd3fdb --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/IOHIKeyboardMapper.h @@ -0,0 +1,247 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOHIKEYBOARDMAPPER_H +#define _IOHIKEYBOARDMAPPER_H + +#include +#include +#include +#include + +class IOHIKeyboard; +class IOHIDSystem; + +/* + * Key ip/down state is tracked in a bit list. Bits are set + * for key-down, and cleared for key-up. The bit vector and macros + * for it's manipulation are defined here. + */ + +typedef UInt32 * kbdBitVector; + +#define EVK_BITS_PER_UNIT 32 +#define EVK_BITS_MASK 31 +#define EVK_BITS_SHIFT 5 // 1<<5 == 32, for cheap divide + +#define EVK_KEYDOWN(n, bits) \ + (bits)[((n)>>EVK_BITS_SHIFT)] |= (1 << ((n) & EVK_BITS_MASK)) + +#define EVK_KEYUP(n, bits) \ + (bits)[((n)>>EVK_BITS_SHIFT)] &= ~(1 << ((n) & EVK_BITS_MASK)) + +#define EVK_IS_KEYDOWN(n, bits) \ + (((bits)[((n)>>EVK_BITS_SHIFT)] & (1 << ((n) & EVK_BITS_MASK))) != 0) + +/* the maximum number of modifier keys sticky keys can hold at once */ +#define kMAX_MODIFIERS 5 + +/* the number of shift keys in a row that must be depressed to toggle state */ +#define kNUM_SHIFTS_TO_ACTIVATE 5 + +/* the number of milliseconds all the shifts must be pressed in - 30 seconds (30000 mS)*/ +#define kDEFAULT_SHIFTEXPIREINTERVAL 30000 + + +// sticky keys state flags +enum +{ + kState_Disabled_Flag = 0x0001, // disabled and will do nothing until this is changed + kState_ShiftActivates_Flag = 0x0002, // the 'on' gesture (5 shifts) will activate + kState_On = 0x0004, // currently on, will hold down modifiers when pressed + kState_On_ModifiersDown = 0x0008, // one or more modifiers being held down + kState_Mask = 0x00FF, // mask for all states +}; + +typedef struct _stickyKeys_ToggleInfo +{ + // size of this allocation + IOByteCount size; + + // which modifier key we are tracking (using NX_WHICHMODMASK) + unsigned toggleModifier; + + // the number of times the modifier must be pressed to toggle + unsigned repetitionsToToggle; + + // how long the user has to press the modifier repetitionsToToggle times + // the default is 30 seconds + AbsoluteTime expireInterval; + + // the number of times the modifier used within the alloted time + unsigned currentCount; + + // the times that the last shift must occer for this one to be used + // this array will actually be of size repetitionsToToggle + AbsoluteTime deadlines[1]; +} StickyKeys_ToggleInfo; + +// Flags for each sticky key modifier +// This will allow for chording of keys +// and for key locking +enum +{ + kModifier_DidPerformModifiy = 0x01, + kModifier_DidKeyUp = 0x02, + kModifier_Locked = 0x04, +}; +typedef struct _stickyKeys_ModifierInfo +{ + UInt8 key; // Key code of the sticky modifier + UInt8 state; // The state of the sticky modifier + UInt8 leftModBit; // System Mod bit of the sticky modifier +} StickyKeys_ModifierInfo; + +class IOHIDKeyboardDevice; + +class IOHIKeyboardMapper : public OSObject +{ + OSDeclareDefaultStructors(IOHIKeyboardMapper); + +private: + IOHIKeyboard * _delegate; // KeyMap delegate + bool _mappingShouldBeFreed; // true if map can be IOFree'd + NXParsedKeyMapping _parsedMapping; // current system-wide keymap + + // binary compatibility padding + struct ExpansionData { + + // This is for sticky keys + kbdBitVector cached_KeyBits; + + UInt32 specialKeyModifierFlags; + + SInt32 modifierSwap_Modifiers[NX_NUMMODIFIERS]; + + unsigned char * cachedAlphaLockModDefs; + }; + ExpansionData * _reserved; // Reserved for future use. (Internal use only) + +public: + static IOHIKeyboardMapper * keyboardMapper( + IOHIKeyboard * delegate, + const UInt8 * mapping, + UInt32 mappingLength, + bool mappingShouldBeFreed ); + + virtual bool init(IOHIKeyboard * delegate, + const UInt8 * mapping, + UInt32 mappingLength, + bool mappingShouldBeFreed); + virtual void free(void) APPLE_KEXT_OVERRIDE; + + virtual const UInt8 * mapping(); + virtual UInt32 mappingLength(); + virtual bool serialize(OSSerialize *s) const APPLE_KEXT_OVERRIDE; + + virtual void translateKeyCode(UInt8 key, bool keyDown, kbdBitVector keyBits); + virtual UInt8 getParsedSpecialKey(UInt8 logical); //retrieve a key from _parsedMapping + + virtual void setKeyboardTarget (IOService * keyboardTarget); + + virtual bool updateProperties (void); + virtual IOReturn setParamProperties (OSDictionary * dict); + + // keyEventPostProcess is called while a lock is not held, so a recursive + // call back into HIKeyboard is possible + virtual void keyEventPostProcess (void); + +private: + static void makeNumberParamProperty( OSDictionary * dict, const char * key, + unsigned long long number, unsigned int bits ); + + + virtual bool parseKeyMapping(const UInt8 * mapping, + UInt32 mappingLength, + NXParsedKeyMapping * parsedMapping) const; + + virtual void calcModBit(int bit, kbdBitVector keyBits); + virtual void doModCalc(int key, kbdBitVector keyBits); + virtual void doCharGen(int keyCode, bool down); + + /* sticky keys functionality */ +private: + // original translateKeyCode + void rawTranslateKeyCode (UInt8 key, bool keyDown, kbdBitVector keyBits); + + // post special keyboard events thru the event system + void postKeyboardSpecialEvent (unsigned subtype, unsigned eventType=NX_SYSDEFINED); + +private: + +private: +public: + OSMetaClassDeclareReservedUsed(IOHIKeyboardMapper, 0); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + + // binary compatibility padding + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 1); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 2); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 3); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 4); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 5); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 6); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 7); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 8); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 9); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 10); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 11); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 12); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 13); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 14); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 15); +}; + +#endif // _IOHIKEYBOARDMAPPER_H + +/* + * HISTORICAL NOTE: + * The "delegate" object had to respond to the following protocol; + * this protocol has since been merged into the IOHIKeyboard class. + * + * @protocol KeyMapDelegate + * + * - keyboardEvent :(unsigned)eventType + * flags :(unsigned)flags + * keyCode :(unsigned)keyCode + * charCode:(unsigned)charCode + * charSet :(unsigned)charSet + * originalCharCode:(unsigned)origCharCode + * originalCharSet:(unsigned)origCharSet; + * + * - keyboardSpecialEvent:(unsigned)eventType + * flags :(unsigned)flags + * keyCode :(unsigned)keyCode + * specialty:(unsigned)flavor; + * + * - updateEventFlags:(unsigned)flags; // Does not generate events + * + * - (unsigned)eventFlags; // Global event flags + * - (unsigned)deviceFlags; // per-device event flags + * - setDeviceFlags:(unsigned)flags; // Set device event flags + * - (bool)alphaLock; // current alpha-lock state + * - setAlphaLock:(bool)val; // Set current alpha-lock state + * - (bool)charKeyActive; // Is a character gen. key down? + * - setCharKeyActive:(bool)val; // Note that a char gen key is down. + * + * @end + */ diff --git a/QualcommWireless/include/IOKit/hidsystem/IOHIPointing.h b/QualcommWireless/include/IOKit/hidsystem/IOHIPointing.h new file mode 100644 index 0000000..22fce3c --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/IOHIPointing.h @@ -0,0 +1,256 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOHIPOINTING_H +#define _IOHIPOINTING_H + +#include +#include +#include + +/* Start Action Definitions */ + +/* + * HISTORICAL NOTE: + * The following entry points were part of the IOHIPointingEvents + * protocol. + */ +typedef void (*RelativePointerEventAction)(OSObject * target, + /* buttons */ int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts); + +typedef void (*AbsolutePointerEventAction)(OSObject * target, + /* buttons */ int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts); + +typedef void (*ScrollWheelEventAction)(OSObject * target, + short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + AbsoluteTime ts); + +/* Event Callback Definitions */ + +typedef void (*RelativePointerEventCallback)( + /* target */ OSObject * target, + /* buttons */ int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +typedef void (*AbsolutePointerEventCallback)( + /* target */ OSObject * target, + /* buttons */ int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +typedef void (*ScrollWheelEventCallback)( + /* target */ OSObject * target, + /* delta1 */ short deltaAxis1, + /* delta2 */ short deltaAxis2, + /* delta3 */ short deltaAxis3, + /* fixedDelta1 */ IOFixed fixedDelta1, + /* fixedDelta2 */ IOFixed fixedDelta2, + /* fixedDelta3 */ IOFixed fixedDelta3, + /* pointDelta1 */ SInt32 pointDelta1, + /* pointDelta2 */ SInt32 pointDelta2, + /* pointDelta3 */ SInt32 pointDelta3, + /* reserved */ SInt32 options, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +/* End Action Definitions */ + +/* Default accel level parameters */ +#define EV_DEFAULTPOINTERACCELLEVEL 0x0000b000 +#define EV_DEFAULTSCROLLACCELLEVEL 0x00005000 + +class IOHIDPointingDevice; +struct ScrollAccelInfo; + +class IOHIPointing : public IOHIDevice +{ + OSDeclareDefaultStructors(IOHIPointing); + + friend class IOHITablet; + friend class IOHIDPointing; + +private: + IOLock * _deviceLock; // Lock for all device access + int _buttonMode; // The "handedness" of the pointer + IOFixed _acceleration; + bool _convertAbsoluteToRelative; + bool _contactToMove; + bool _hadContact; + IOGPoint _previousLocation; + UInt8 _pressureThresholdToClick; // A scale factor of 0 to 255 to determine how much pressure is necessary to generate a primary mouse click - a value of 255 means no click will be generated + void * _scaleSegments; + IOItemCount _scaleSegCount; + IOFixed _fractX; + IOFixed _fractY; + + OSObject * _relativePointerEventTarget; + RelativePointerEventAction _relativePointerEventAction; + OSObject * _absolutePointerEventTarget; + AbsolutePointerEventAction _absolutePointerEventAction; + OSObject * _scrollWheelEventTarget; + ScrollWheelEventAction _scrollWheelEventAction; + + struct ExpansionData; + + ExpansionData * _reserved; + + void setPointingMode(UInt32 accelerateMode); + UInt32 getPointingMode (); + void setScrollType(UInt32 scrollType); + UInt32 getScrollType(); + + void dispatchScrollWheelEventWithAccelInfo( + SInt32 deltaAxis1, + SInt32 deltaAxis2, + SInt32 deltaAxis3, + ScrollAccelInfo * info, + AbsoluteTime ts); + + +protected: + virtual void dispatchRelativePointerEvent(int dx, + int dy, + UInt32 buttonState, + AbsoluteTime ts); + + virtual void dispatchAbsolutePointerEvent(IOGPoint * newLoc, + IOGBounds * bounds, + UInt32 buttonState, + bool proximity, + int pressure, + int pressureMin, + int pressureMax, + int stylusAngle, + AbsoluteTime ts); + + virtual void dispatchScrollWheelEvent(short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + AbsoluteTime ts); + +public: + virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual void free(void) APPLE_KEXT_OVERRIDE; + + virtual bool open(IOService * client, + IOOptionBits options, + RelativePointerEventAction rpeAction, + AbsolutePointerEventAction apeAction, + ScrollWheelEventAction sweAction); + + bool open( IOService * client, + IOOptionBits options, + void *, + RelativePointerEventCallback rpeCallback, + AbsolutePointerEventCallback apeCallback, + ScrollWheelEventCallback sweCallback); + + virtual void close(IOService * client, IOOptionBits ) APPLE_KEXT_OVERRIDE; + virtual IOReturn message( UInt32 type, IOService * provider, + void * argument = 0 ) APPLE_KEXT_OVERRIDE; + + virtual IOHIDKind hidKind(void) APPLE_KEXT_OVERRIDE; + virtual bool updateProperties( void ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setParamProperties( OSDictionary * dict ) APPLE_KEXT_OVERRIDE; + virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags powerFlags, + unsigned long newState, IOService * device) APPLE_KEXT_OVERRIDE; + virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags powerFlags, + unsigned long newState, IOService * device) APPLE_KEXT_OVERRIDE; + +protected: // for subclasses to implement + virtual OSData * copyAccelerationTable(); + virtual IOItemCount buttonCount(); + virtual IOFixed resolution(); + + // RY: Adding method to copy scroll wheel accel table. + // Unfortunately, we don't have any padding, so this + // is going to be non-virtual. + /*virtual*/ OSData * copyScrollAccelerationTable(); + +private: + virtual bool resetPointer(); + virtual void scalePointer(int * dxp, int * dyp); + virtual void setupForAcceleration(IOFixed accl); + + // RY: Adding methods to support scroll wheel accel. + // Unfortunately, we don't have any padding, so these + // are going to be non-virtual. + /*virtual*/ bool resetScroll(); + /*virtual*/ void setupScrollForAcceleration(IOFixed accl); + + // RY: We have to make sure that subclasses that will + // take advantage of this have their defined resolution + // in their property table. + /*virtual*/ IOFixed scrollResolutionForType(SInt32 type=-1); + /*virtual*/ IOFixed scrollReportRate(); + /*virtual*/ OSData * copyScrollAccelerationTableForType(SInt32 type=-1); + +private: + static void _relativePointerEvent( IOHIPointing * self, + int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts); + + /* Tablet event reporting */ + static void _absolutePointerEvent(IOHIPointing * self, + int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts); + + /* Mouse scroll wheel event reporting */ + static void _scrollWheelEvent(IOHIPointing *self, + short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + AbsoluteTime ts); + +}; + +#endif /* !_IOHIPOINTING_H */ diff --git a/QualcommWireless/include/IOKit/hidsystem/IOLLEvent.h b/QualcommWireless/include/IOKit/hidsystem/IOLLEvent.h new file mode 100644 index 0000000..0a72a4e --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/IOLLEvent.h @@ -0,0 +1,586 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/****************************************************************************** + event.h (PostScript side version) + + CONFIDENTIAL + Copyright (c) 1988 NeXT, Inc. as an unpublished work. + All Rights Reserved. + + Created Leo 01Mar88 + + Modified: + 04May88 Leo Final event types and record + 22Aug88 Leo Change short -> int for window, add reserved + 26May90 Ted Added NX_UNDIMMASK to correct triggering of UndoAutoDim + 12Dec91 Mike Brought into sync with dpsclient/event.h, and fixed + the #ifndef interlock with dpsclient/event.h that was + broken during the Great Header Revision. + + The PostScript version of this file differs from the + Window Kit version in that the coordinates here are + ints instead of floats. +******************************************************************************/ + +#ifndef _DEV_EVENT_H +#define _DEV_EVENT_H + +#include +#include +#include + +#ifdef EVENT_H /* Interlock with dpsclient/event.h */ +#if !defined(_NXSIZE_) /* Work around patch for old event.h in Phase 3 projs*/ +#define _NXSIZE_ 1 /* NXCoord, NXPoint, NXSize decl seen */ +#define _NXSize_ NXSize +#endif /* _NXSIZE_ */ +#else /* EVENT_H */ /* Haven't seen dpsclient/event.h, so define away */ +#define EVENT_H + +#ifdef KERNEL +#else /* KERNEL */ + +#if !defined(_NXSIZE_) /* Work around patch for old event.h in Phase 3 projs*/ +#define _NXSIZE_ 1 /* NXCoord, NXPoint, NXSize decl seen */ +typedef float NXCoord; + +typedef struct _NXPoint { /* point */ + NXCoord x, y; +} NXPoint; + +typedef struct _NXSize { /* size */ + NXCoord width, height; +} NXSize; +#define _NXSize_ NXSize /* Correct usage in event_status_driver.h */ +#endif /* _NXSIZE_ */ + +#endif /* KERNEL */ + +/* Event types */ + +#define NX_NULLEVENT 0 /* internal use */ + +/* mouse events */ + +#define NX_LMOUSEDOWN 1 /* left mouse-down event */ +#define NX_LMOUSEUP 2 /* left mouse-up event */ +#define NX_RMOUSEDOWN 3 /* right mouse-down event */ +#define NX_RMOUSEUP 4 /* right mouse-up event */ +#define NX_MOUSEMOVED 5 /* mouse-moved event */ +#define NX_LMOUSEDRAGGED 6 /* left mouse-dragged event */ +#define NX_RMOUSEDRAGGED 7 /* right mouse-dragged event */ +#define NX_MOUSEENTERED 8 /* mouse-entered event */ +#define NX_MOUSEEXITED 9 /* mouse-exited event */ + +/* other mouse events + * + * event.data.mouse.buttonNumber should contain the + * button number (2-31) changing state. + */ +#define NX_OMOUSEDOWN 25 /* other mouse-down event */ +#define NX_OMOUSEUP 26 /* other mouse-up event */ +#define NX_OMOUSEDRAGGED 27 /* other mouse-dragged event */ + +/* keyboard events */ + +#define NX_KEYDOWN 10 /* key-down event */ +#define NX_KEYUP 11 /* key-up event */ +#define NX_FLAGSCHANGED 12 /* flags-changed event */ + +/* composite events */ + +#define NX_KITDEFINED 13 /* application-kit-defined event */ +#define NX_SYSDEFINED 14 /* system-defined event */ +#define NX_APPDEFINED 15 /* application-defined event */ +/* There are additional DPS client defined events past this point. */ + +/* Scroll wheel events */ + +#define NX_SCROLLWHEELMOVED 22 + +/* Zoom events */ +#define NX_ZOOM 28 + +/* tablet events */ + +#define NX_TABLETPOINTER 23 /* for non-mousing transducers */ +#define NX_TABLETPROXIMITY 24 /* for non-mousing transducers */ + +/* event range */ + +#define NX_FIRSTEVENT 0 +#define NX_LASTEVENT 28 +#define NX_NUMPROCS (NX_LASTEVENT-NX_FIRSTEVENT+1) + +/* Event masks */ +#define NX_NULLEVENTMASK (1 << NX_NULLEVENT) /* NULL event */ +#define NX_LMOUSEDOWNMASK (1 << NX_LMOUSEDOWN) /* left mouse-down */ +#define NX_LMOUSEUPMASK (1 << NX_LMOUSEUP) /* left mouse-up */ +#define NX_RMOUSEDOWNMASK (1 << NX_RMOUSEDOWN) /* right mouse-down */ +#define NX_RMOUSEUPMASK (1 << NX_RMOUSEUP) /* right mouse-up */ +#define NX_OMOUSEDOWNMASK (1 << NX_OMOUSEDOWN) /* other mouse-down */ +#define NX_OMOUSEUPMASK (1 << NX_OMOUSEUP) /* other mouse-up */ +#define NX_MOUSEMOVEDMASK (1 << NX_MOUSEMOVED) /* mouse-moved */ +#define NX_LMOUSEDRAGGEDMASK (1 << NX_LMOUSEDRAGGED) /* left-dragged */ +#define NX_RMOUSEDRAGGEDMASK (1 << NX_RMOUSEDRAGGED) /* right-dragged */ +#define NX_OMOUSEDRAGGEDMASK (1 << NX_OMOUSEDRAGGED) /* other-dragged */ +#define NX_MOUSEENTEREDMASK (1 << NX_MOUSEENTERED) /* mouse-entered */ +#define NX_MOUSEEXITEDMASK (1 << NX_MOUSEEXITED) /* mouse-exited */ +#define NX_KEYDOWNMASK (1 << NX_KEYDOWN) /* key-down */ +#define NX_KEYUPMASK (1 << NX_KEYUP) /* key-up */ +#define NX_FLAGSCHANGEDMASK (1 << NX_FLAGSCHANGED) /* flags-changed */ +#define NX_KITDEFINEDMASK (1 << NX_KITDEFINED) /* kit-defined */ +#define NX_SYSDEFINEDMASK (1 << NX_SYSDEFINED) /* system-defined */ +#define NX_APPDEFINEDMASK (1 << NX_APPDEFINED) /* app-defined */ +#define NX_SCROLLWHEELMOVEDMASK (1 << NX_SCROLLWHEELMOVED) /* scroll wheel moved */ +#define NX_ZOOMMASK (1 << NX_ZOOM) /* Zoom */ +#define NX_TABLETPOINTERMASK (1 << NX_TABLETPOINTER) /* tablet pointer moved */ +#define NX_TABLETPROXIMITYMASK (1 << NX_TABLETPROXIMITY) /* tablet pointer proximity */ + +#define EventCodeMask(type) (1 << (type)) +#define NX_ALLEVENTS -1 /* Check for all events */ + +/* sub types for mouse and move events */ + +#define NX_SUBTYPE_DEFAULT 0 +#define NX_SUBTYPE_TABLET_POINT 1 +#define NX_SUBTYPE_TABLET_PROXIMITY 2 +#define NX_SUBTYPE_MOUSE_TOUCH 3 + +/* sub types for system defined events */ + +#define NX_SUBTYPE_POWER_KEY 1 +#define NX_SUBTYPE_AUX_MOUSE_BUTTONS 7 + +/* + * NX_SUBTYPE_AUX_CONTROL_BUTTONS usage + * + * The incoming NXEvent for other mouse button down/up has event.type + * NX_SYSDEFINED and event.data.compound.subtype NX_SUBTYPE_AUX_MOUSE_BUTTONS. + * Within the event.data.compound.misc.L[0] contains bits for all the buttons + * that have changed state, and event.data.compound.misc.L[1] contains the + * current button state as a bitmask, with 1 representing down, and 0 + * representing up. Bit 0 is the left button, bit one is the right button, + * bit 2 is the center button and so forth. + */ +#define NX_SUBTYPE_AUX_CONTROL_BUTTONS 8 + +#define NX_SUBTYPE_EJECT_KEY 10 +#define NX_SUBTYPE_SLEEP_EVENT 11 +#define NX_SUBTYPE_RESTART_EVENT 12 +#define NX_SUBTYPE_SHUTDOWN_EVENT 13 +#define NX_SUBTYPE_MENU 16 +#define NX_SUBTYPE_ACCESSIBILITY 17 + + + +#define NX_SUBTYPE_STICKYKEYS_ON 100 +#define NX_SUBTYPE_STICKYKEYS_OFF 101 +#define NX_SUBTYPE_STICKYKEYS_SHIFT 102 +#define NX_SUBTYPE_STICKYKEYS_CONTROL 103 +#define NX_SUBTYPE_STICKYKEYS_ALTERNATE 104 +#define NX_SUBTYPE_STICKYKEYS_COMMAND 105 +#define NX_SUBTYPE_STICKYKEYS_RELEASE 106 +#define NX_SUBTYPE_STICKYKEYS_TOGGLEMOUSEDRIVING 107 + +// New stickykeys key events +// These were created to send an event describing the +// different state of the modifiers +#define NX_SUBTYPE_STICKYKEYS_SHIFT_DOWN 110 +#define NX_SUBTYPE_STICKYKEYS_CONTROL_DOWN 111 +#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_DOWN 112 +#define NX_SUBTYPE_STICKYKEYS_COMMAND_DOWN 113 +#define NX_SUBTYPE_STICKYKEYS_FN_DOWN 114 + +#define NX_SUBTYPE_STICKYKEYS_SHIFT_LOCK 120 +#define NX_SUBTYPE_STICKYKEYS_CONTROL_LOCK 121 +#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_LOCK 122 +#define NX_SUBTYPE_STICKYKEYS_COMMAND_LOCK 123 +#define NX_SUBTYPE_STICKYKEYS_FN_LOCK 124 + +#define NX_SUBTYPE_STICKYKEYS_SHIFT_UP 130 +#define NX_SUBTYPE_STICKYKEYS_CONTROL_UP 131 +#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_UP 132 +#define NX_SUBTYPE_STICKYKEYS_COMMAND_UP 133 +#define NX_SUBTYPE_STICKYKEYS_FN_UP 134 + + + +// SlowKeys +#define NX_SUBTYPE_SLOWKEYS_START 200 +#define NX_SUBTYPE_SLOWKEYS_ABORT 201 +#define NX_SUBTYPE_SLOWKEYS_END 202 + +// HID Parameter Property Modified +#define NX_SUBTYPE_HIDPARAMETER_MODIFIED 210 + +/* Masks for the bits in event.flags */ + +/* device-independent */ + +#define NX_ALPHASHIFTMASK 0x00010000 +#define NX_SHIFTMASK 0x00020000 +#define NX_CONTROLMASK 0x00040000 +#define NX_ALTERNATEMASK 0x00080000 +#define NX_COMMANDMASK 0x00100000 +#define NX_NUMERICPADMASK 0x00200000 +#define NX_HELPMASK 0x00400000 +#define NX_SECONDARYFNMASK 0x00800000 +#define NX_ALPHASHIFT_STATELESS_MASK 0x01000000 + +/* device-dependent (really?) */ + +#define NX_DEVICELCTLKEYMASK 0x00000001 +#define NX_DEVICELSHIFTKEYMASK 0x00000002 +#define NX_DEVICERSHIFTKEYMASK 0x00000004 +#define NX_DEVICELCMDKEYMASK 0x00000008 +#define NX_DEVICERCMDKEYMASK 0x00000010 +#define NX_DEVICELALTKEYMASK 0x00000020 +#define NX_DEVICERALTKEYMASK 0x00000040 +#define NX_DEVICE_ALPHASHIFT_STATELESS_MASK 0x00000080 +#define NX_DEVICERCTLKEYMASK 0x00002000 + +/* + * Additional reserved bits in event.flags + */ + +#define NX_STYLUSPROXIMITYMASK 0x00000080 /* deprecated */ +#define NX_NONCOALSESCEDMASK 0x00000100 + +/* click state values + * If you have the following events in close succession, the click + * field has the indicated value: + * + * Event Click Value Comments + * mouse-down 1 Not part of any click yet + * mouse-up 1 Aha! A click! + * mouse-down 2 Doing a double-click + * mouse-up 2 It's finished + * mouse-down 3 A triple + * mouse-up 3 + */ + +/* Values for the character set in event.data.key.charSet */ + +#define NX_ASCIISET 0 +#define NX_SYMBOLSET 1 +#define NX_DINGBATSSET 2 + +/* tablet button masks + * Mask bits for the tablet barrel buttons placed in tablet.buttons. + * The buttons field uses adopts the following convention: + * + * Bit Comments + * 0 Left Mouse Button ( kHIDUsage_Button_1 ) + * 1 Right Mouse Button ( kHIDUsage_Button_2 ) + * 2 Middle Mouse Button ( kHIDUsage_Button_3 ) + * 3 4th Mouse Button ( kHIDUsage_Button_4 ) + * ... + * 15 15th Mouse Button + * + * For your convenience, the following mask bits have been defined + * for tablet specific application: + */ + +#define NX_TABLET_BUTTON_PENTIPMASK 0x0001 +#define NX_TABLET_BUTTON_PENLOWERSIDEMASK 0x0002 +#define NX_TABLET_BUTTON_PENUPPERSIDEMASK 0x0004 + + +/* tablet capability masks + * Mask bits for the tablet capabilities field. Use these + * masks with the capabilities field of a proximity event to + * determine what fields in a Tablet Event are valid for this + * device. + */ +#define NX_TABLET_CAPABILITY_DEVICEIDMASK 0x0001 +#define NX_TABLET_CAPABILITY_ABSXMASK 0x0002 +#define NX_TABLET_CAPABILITY_ABSYMASK 0x0004 +#define NX_TABLET_CAPABILITY_VENDOR1MASK 0x0008 +#define NX_TABLET_CAPABILITY_VENDOR2MASK 0x0010 +#define NX_TABLET_CAPABILITY_VENDOR3MASK 0x0020 +#define NX_TABLET_CAPABILITY_BUTTONSMASK 0x0040 +#define NX_TABLET_CAPABILITY_TILTXMASK 0x0080 +#define NX_TABLET_CAPABILITY_TILTYMASK 0x0100 +#define NX_TABLET_CAPABILITY_ABSZMASK 0x0200 +#define NX_TABLET_CAPABILITY_PRESSUREMASK 0x0400 +#define NX_TABLET_CAPABILITY_TANGENTIALPRESSUREMASK 0x0800 +#define NX_TABLET_CAPABILITY_ORIENTINFOMASK 0x1000 +#define NX_TABLET_CAPABILITY_ROTATIONMASK 0x2000 + +/* proximity pointer types + * Value that describes the type of pointing device placed in + * proximity.pointerType. + */ + +#define NX_TABLET_POINTER_UNKNOWN 0 +#define NX_TABLET_POINTER_PEN 1 +#define NX_TABLET_POINTER_CURSOR 2 +#define NX_TABLET_POINTER_ERASER 3 + +/* TabletPointData type: defines the tablet data for points included + * in mouse events created by a tablet driver. + */ + +typedef struct _NXTabletPointData { + SInt32 x; /* absolute x coordinate in tablet space at full tablet resolution */ + SInt32 y; /* absolute y coordinate in tablet space at full tablet resolution */ + SInt32 z; /* absolute z coordinate in tablet space at full tablet resolution */ + UInt16 buttons; /* one bit per button - bit 0 is first button - 1 = closed */ + UInt16 pressure; /* scaled pressure value; MAX=(2^16)-1, MIN=0 */ + struct { /* tilt range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) */ + SInt16 x; /* scaled tilt x value */ + SInt16 y; /* scaled tilt y value */ + } tilt; + UInt16 rotation; /* Fixed-point representation of device rotation in a 10.6 format */ + SInt16 tangentialPressure; /* tangential pressure on the device; same range as tilt */ + UInt16 deviceID; /* system-assigned unique device ID */ + SInt16 vendor1; /* vendor-defined signed 16-bit integer */ + SInt16 vendor2; /* vendor-defined signed 16-bit integer */ + SInt16 vendor3; /* vendor-defined signed 16-bit integer */ +} NXTabletPointData, *NXTabletPointDataPtr; + +/* TabletProximityData type: defines the tablet data for proximity + * events included in mouse events created by a tablet driver. + */ + +typedef struct _NXTabletProximityData { + UInt16 vendorID; /* vendor-defined ID - typically the USB vendor ID */ + UInt16 tabletID; /* vendor-defined tablet ID - typically the USB product ID */ + UInt16 pointerID; /* vendor-defined ID of the specific pointing device */ + UInt16 deviceID; /* system-assigned unique device ID */ + UInt16 systemTabletID; /* system-assigned unique tablet ID */ + UInt16 vendorPointerType; /* vendor-defined pointer type */ + UInt32 pointerSerialNumber; /* vendor-defined serial number */ + UInt64 uniqueID __attribute__ ((packed)); /* vendor-defined unique ID */ + UInt32 capabilityMask; /* capabilities mask of the device */ + UInt8 pointerType; /* type of pointing device */ + UInt8 enterProximity; /* non-zero = entering; zero = leaving */ + SInt16 reserved1; +} NXTabletProximityData, *NXTabletProximityDataPtr; + +/* EventData type: defines the data field of an event */ + +typedef union { + struct { /* For mouse-down and mouse-up events */ + UInt8 subx; /* sub-pixel position for x */ + UInt8 suby; /* sub-pixel position for y */ + SInt16 eventNum; /* unique identifier for this button */ + SInt32 click; /* click state of this event */ + UInt8 pressure; /* pressure value: 0=none, 255=full */ + UInt8 buttonNumber;/* button generating other button event (0-31) */ + UInt8 subType; + UInt8 reserved2; + SInt32 reserved3; + union { + NXTabletPointData point; /* tablet point data */ + NXTabletProximityData proximity; /* tablet proximity data */ + } tablet; + } mouse; + struct { + SInt32 dx; + SInt32 dy; + UInt8 subx; + UInt8 suby; + UInt8 subType; + UInt8 reserved1; + SInt32 reserved2; + union { + NXTabletPointData point; /* tablet point data */ + NXTabletProximityData proximity; /* tablet proximity data */ + } tablet; + } mouseMove; + struct { /* For key-down and key-up events */ + UInt16 origCharSet; /* unmodified character set code */ + SInt16 repeat; /* for key-down: nonzero if really a repeat */ + UInt16 charSet; /* character set code */ + UInt16 charCode; /* character code in that set */ + UInt16 keyCode; /* device-dependent key number */ + UInt16 origCharCode; /* unmodified character code */ + SInt32 reserved1; + UInt32 keyboardType; + SInt32 reserved2; + SInt32 reserved3; + SInt32 reserved4; + SInt32 reserved5[4]; + } key; + struct { /* For mouse-entered and mouse-exited events */ + SInt16 reserved; + SInt16 eventNum; /* unique identifier from mouse down event */ + SInt32 trackingNum; /* unique identifier from settrackingrect */ + SInt32 userData; /* uninterpreted integer from settrackingrect */ + SInt32 reserved1; + SInt32 reserved2; + SInt32 reserved3; + SInt32 reserved4; + SInt32 reserved5; + SInt32 reserved6[4]; + } tracking; + struct { + SInt16 deltaAxis1; + SInt16 deltaAxis2; + SInt16 deltaAxis3; + SInt16 reserved1; + SInt32 fixedDeltaAxis1; + SInt32 fixedDeltaAxis2; + SInt32 fixedDeltaAxis3; + SInt32 pointDeltaAxis1; + SInt32 pointDeltaAxis2; + SInt32 pointDeltaAxis3; + SInt32 reserved8[4]; + } scrollWheel, zoom; + struct { /* For window-changed, sys-defined, and app-defined events */ + SInt16 reserved; + SInt16 subType; /* event subtype for compound events */ + union { + float F[11]; /* for use in compound events */ + SInt32 L[11]; /* for use in compound events */ + SInt16 S[22]; /* for use in compound events */ + char C[44]; /* for use in compound events */ + } misc; + } compound; + struct { + SInt32 x; /* absolute x coordinate in tablet space at full tablet resolution */ + SInt32 y; /* absolute y coordinate in tablet space at full tablet resolution */ + SInt32 z; /* absolute z coordinate in tablet space at full tablet resolution */ + UInt16 buttons; /* one bit per button - bit 0 is first button - 1 = closed */ + UInt16 pressure; /* scaled pressure value; MAX=(2^16)-1, MIN=0 */ + struct { /* tilt range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) */ + SInt16 x; /* scaled tilt x value */ + SInt16 y; /* scaled tilt y value */ + } tilt; + UInt16 rotation; /* Fixed-point representation of device rotation in a 10.6 format */ + SInt16 tangentialPressure; /* tangential pressure on the device; same range as tilt */ + UInt16 deviceID; /* system-assigned unique device ID */ + SInt16 vendor1; /* vendor-defined signed 16-bit integer */ + SInt16 vendor2; /* vendor-defined signed 16-bit integer */ + SInt16 vendor3; /* vendor-defined signed 16-bit integer */ + SInt32 reserved[4]; + } tablet; + struct { + UInt16 vendorID; /* vendor-defined ID - typically the USB vendor ID */ + UInt16 tabletID; /* vendor-defined tablet ID - typically the USB product ID */ + UInt16 pointerID; /* vendor-defined ID of the specific pointing device */ + UInt16 deviceID; /* system-assigned unique device ID */ + UInt16 systemTabletID; /* system-assigned unique tablet ID */ + UInt16 vendorPointerType; /* vendor-defined pointer type */ + UInt32 pointerSerialNumber; /* vendor-defined serial number */ + UInt64 uniqueID __attribute__ ((packed)); /* vendor-defined unique ID */ + UInt32 capabilityMask; /* capabilities mask of the device */ + UInt8 pointerType; /* type of pointing device */ + UInt8 enterProximity; /* non-zero = entering; zero = leaving */ + SInt16 reserved1; + SInt32 reserved2[4]; + } proximity; +} NXEventData; + +/* The current version number of the NXEventData structure. */ + +#define kNXEventDataVersion 2 + +/* Finally! The event record! */ +#ifndef __ppc__ +typedef struct _NXEvent { + SInt32 type; /* An event type from above */ + struct { + SInt32 x, y; /* Base coordinates in window, */ + } location; /* from bottom left */ + UInt64 time __attribute__ ((packed)); /* time since launch */ + SInt32 flags; /* key state flags */ + UInt32 window; /* window number of assigned window */ + UInt64 service_id __attribute__ ((packed)); /* service id */ + SInt32 ext_pid; /* external pid */ + NXEventData data; /* type-dependent data */ +} NXEvent, *NXEventPtr; + +#else + +typedef struct _NXEvent { + SInt32 type; /* An event type from above */ + struct { + SInt32 x, y; /* Base coordinates in window, */ + } location; /* from bottom left */ + UInt64 time __attribute__ ((packed)); /* time since launch */ + SInt32 flags; /* key state flags */ + UInt32 window; /* window number of assigned window */ + NXEventData data; /* type-dependent data */ + UInt64 service_id __attribute__ ((packed)); /* service id */ + SInt32 ext_pid; /* external pid */ +} NXEvent, *NXEventPtr; + +#endif + +/* The current version number of the NXEvent structure. */ + +#define kNXEventVersion 2 + +/* How to pick window(s) for event (for PostEvent) */ +#define NX_NOWINDOW -1 +#define NX_BYTYPE 0 +#define NX_BROADCAST 1 +#define NX_TOPWINDOW 2 +#define NX_FIRSTWINDOW 3 +#define NX_MOUSEWINDOW 4 +#define NX_NEXTWINDOW 5 +#define NX_LASTLEFT 6 +#define NX_LASTRIGHT 7 +#define NX_LASTKEY 8 +#define NX_EXPLICIT 9 +#define NX_TRANSMIT 10 +#define NX_BYPSCONTEXT 11 + +#endif /* EVENT_H */ /* End of defs common with dpsclient/event.h */ + +/* Mask of events that cause the screen to wake up */ +#define NX_WAKEMASK ( NX_KEYDOWNMASK | NX_FLAGSCHANGEDMASK | \ + NX_LMOUSEDOWNMASK | NX_LMOUSEUPMASK | \ + NX_RMOUSEDOWNMASK | NX_RMOUSEUPMASK | \ + NX_OMOUSEDOWNMASK | NX_OMOUSEUPMASK \ + ) + +/* Mask of events that cause screen to undim */ +#define NX_UNDIMMASK ( NX_WAKEMASK | NX_KEYUPMASK | NX_SCROLLWHEELMOVEDMASK | \ + NX_LMOUSEDRAGGEDMASK | NX_RMOUSEDRAGGEDMASK | NX_OMOUSEDRAGGEDMASK | \ + NX_MOUSEMOVEDMASK | NX_MOUSEENTEREDMASK | NX_MOUSEEXITEDMASK | \ + NX_TABLETPOINTERMASK | NX_TABLETPROXIMITYMASK \ + ) + + +#define NX_EVENT_EXTENSION_LOCATION_INVALID 0x1 +#define NX_EVENT_EXTENSION_LOCATION_TYPE_FLOAT 0x2 +#define NX_EVENT_EXTENSION_LOCATION_DEVICE_SCALED 0x4 +#define NX_EVENT_EXTENSION_MOUSE_DELTA_TYPE_FLOAT 0x8 +#define NX_EVENT_EXTENSION_AUDIT_TOKEN 0x10 + +typedef struct _NXEventExtension { + UInt32 flags; + audit_token_t audit; +} NXEventExtension; + +typedef struct _NXEventExt { + NXEvent payload; + NXEventExtension extension; +} NXEventExt; + +#endif /* !_DEV_EVENT_H */ + diff --git a/QualcommWireless/include/IOKit/hidsystem/ev_keymap.h b/QualcommWireless/include/IOKit/hidsystem/ev_keymap.h new file mode 100644 index 0000000..e6db930 --- /dev/null +++ b/QualcommWireless/include/IOKit/hidsystem/ev_keymap.h @@ -0,0 +1,171 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * ev_keymap.h + * Defines the structure used for parsing keymappings. These structures + * and definitions are used by event sources in the kernel and by + * applications and utilities which manipulate keymaps. + * + * HISTORY + * 02-Jun-1992 Mike Paquette at NeXT + * Created. + */ + +#ifndef _DEV_EV_KEYMAP_H +#define _DEV_EV_KEYMAP_H + +#define NX_NUMKEYCODES 256 /* Highest key code is 0xff. ADB used to use 0x80 for keydown state, but who the heck uses adb anymore. */ +#define NX_NUMSEQUENCES 128 /* Maximum possible number of sequences */ +#define NX_NUMMODIFIERS 16 /* Maximum number of modifier bits */ +#define NX_BYTE_CODES 0 /* If first short 0, all are bytes (else shorts) */ + +#define NX_WHICHMODMASK 0x0f /* bits out of keyBits for bucky bits */ +#define NX_MODMASK 0x10 /* Bit out of keyBits indicates modifier bit */ +#define NX_CHARGENMASK 0x20 /* bit out of keyBits for char gen */ +#define NX_SPECIALKEYMASK 0x40 /* bit out of keyBits for specialty key */ +#define NX_KEYSTATEMASK 0x80 /* OBSOLETE - DO NOT USE IN NEW DESIGNS */ + +/* + * Special keys currently known to and understood by the system. + * If new specialty keys are invented, extend this list as appropriate. + * The presence of these keys in a particular implementation is not + * guaranteed. + */ +#define NX_NOSPECIALKEY 0xFFFF +#define NX_KEYTYPE_SOUND_UP 0 +#define NX_KEYTYPE_SOUND_DOWN 1 +#define NX_KEYTYPE_BRIGHTNESS_UP 2 +#define NX_KEYTYPE_BRIGHTNESS_DOWN 3 +#define NX_KEYTYPE_CAPS_LOCK 4 +#define NX_KEYTYPE_HELP 5 +#define NX_POWER_KEY 6 +#define NX_KEYTYPE_MUTE 7 +#define NX_UP_ARROW_KEY 8 +#define NX_DOWN_ARROW_KEY 9 +#define NX_KEYTYPE_NUM_LOCK 10 + +#define NX_KEYTYPE_CONTRAST_UP 11 +#define NX_KEYTYPE_CONTRAST_DOWN 12 +#define NX_KEYTYPE_LAUNCH_PANEL 13 +#define NX_KEYTYPE_EJECT 14 +#define NX_KEYTYPE_VIDMIRROR 15 + +#define NX_KEYTYPE_PLAY 16 +#define NX_KEYTYPE_NEXT 17 +#define NX_KEYTYPE_PREVIOUS 18 +#define NX_KEYTYPE_FAST 19 +#define NX_KEYTYPE_REWIND 20 + +#define NX_KEYTYPE_ILLUMINATION_UP 21 +#define NX_KEYTYPE_ILLUMINATION_DOWN 22 +#define NX_KEYTYPE_ILLUMINATION_TOGGLE 23 + +#define NX_NUMSPECIALKEYS 24 /* Maximum number of special keys */ +#define NX_NUM_SCANNED_SPECIALKEYS 24 /* First 24 special keys are */ + /* actively scanned in kernel */ + +#define NX_KEYTYPE_MENU 25 + +/* Mask of special keys that are posted as events */ + +#define NX_SPECIALKEY_POST_MASK \ + ((1 << NX_KEYTYPE_SOUND_UP) | (1 << NX_KEYTYPE_SOUND_DOWN) | \ + (1 << NX_POWER_KEY) | (1 << NX_KEYTYPE_MUTE) | \ + (1 << NX_KEYTYPE_BRIGHTNESS_UP) | (1 << NX_KEYTYPE_BRIGHTNESS_DOWN) | \ + (1 << NX_KEYTYPE_CONTRAST_UP) | (1 << NX_KEYTYPE_CONTRAST_UP) | \ + (1 << NX_KEYTYPE_LAUNCH_PANEL) | (1 << NX_KEYTYPE_EJECT) | \ + (1 << NX_KEYTYPE_VIDMIRROR) | (1 << NX_KEYTYPE_PLAY) | \ + (1 << NX_KEYTYPE_NEXT) | (1 << NX_KEYTYPE_PREVIOUS) | \ + (1 << NX_KEYTYPE_FAST) | (1 << NX_KEYTYPE_REWIND) | \ + (1 << NX_KEYTYPE_ILLUMINATION_UP) | \ + (1 << NX_KEYTYPE_ILLUMINATION_DOWN) | \ + (1 << NX_KEYTYPE_ILLUMINATION_TOGGLE) | 0) + +/* Modifier key indices into modDefs[] */ +#define NX_MODIFIERKEY_ALPHALOCK 0 +#define NX_MODIFIERKEY_SHIFT 1 +#define NX_MODIFIERKEY_CONTROL 2 +#define NX_MODIFIERKEY_ALTERNATE 3 +#define NX_MODIFIERKEY_COMMAND 4 +#define NX_MODIFIERKEY_NUMERICPAD 5 +#define NX_MODIFIERKEY_HELP 6 +#define NX_MODIFIERKEY_SECONDARYFN 7 +#define NX_MODIFIERKEY_NUMLOCK 8 + +/* support for right hand modifier */ +#define NX_MODIFIERKEY_RSHIFT 9 +#define NX_MODIFIERKEY_RCONTROL 10 +#define NX_MODIFIERKEY_RALTERNATE 11 +#define NX_MODIFIERKEY_RCOMMAND 12 + +#define NX_MODIFIERKEY_ALPHALOCK_STATELESS 13 +#define NX_MODIFIERKEY_LAST_KEY 13 + + +typedef struct _NXParsedKeyMapping_ { + /* If nonzero, all numbers are shorts; if zero, all numbers are bytes*/ + short shorts; + + /* + * For each keycode, low order bit says if the key + * generates characters. + * High order bit says if the key is assigned to a modifier bit. + * The second to low order bit gives the current state of the key. + */ + char keyBits[NX_NUMKEYCODES]; + + /* Bit number of highest numbered modifier bit */ + int maxMod; + + /* Pointers to where the list of keys for each modifiers bit begins, + * or NULL. + */ + unsigned char *modDefs[NX_NUMMODIFIERS]; + + /* Key code of highest key deinfed to generate characters */ + int numDefs; + + /* Pointer into the keyMapping where this key's definitions begin */ + unsigned char *keyDefs[NX_NUMKEYCODES]; + + /* number of sequence definitions */ + int numSeqs; + + /* pointers to sequences */ + unsigned char *seqDefs[NX_NUMSEQUENCES]; + + /* Special key definitions */ + int numSpecialKeys; + + /* Special key values, or 0xFFFF if none */ + unsigned short specialKeys[NX_NUMSPECIALKEYS]; + + /* Pointer to the original keymapping string */ + const unsigned char *mapping; + + /* Length of the original string */ + int mappingLen; +} NXParsedKeyMapping; + +#endif /* !_DEV_EV_KEYMAP_H */ diff --git a/QualcommWireless/include/IOKit/i2c/IOI2CInterface.h b/QualcommWireless/include/IOKit/i2c/IOI2CInterface.h new file mode 100644 index 0000000..0a10f74 --- /dev/null +++ b/QualcommWireless/include/IOKit/i2c/IOI2CInterface.h @@ -0,0 +1,262 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOI2CINTERFACE_H +#define _IOKIT_IOI2CINTERFACE_H + +#include /* IOOptionBits */ +#include /* uint32_t */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +typedef struct IOI2CRequest IOI2CRequest; +typedef struct IOI2CBuffer IOI2CBuffer; + +typedef void (*IOI2CRequestCompletion) (IOI2CRequest * request); + +// IOI2CRequest.sendTransactionType, IOI2CRequest.replyTransactionType +enum { + kIOI2CNoTransactionType = 0, + kIOI2CSimpleTransactionType = 1, + kIOI2CDDCciReplyTransactionType = 2, + kIOI2CCombinedTransactionType = 3, + kIOI2CDisplayPortNativeTransactionType = 4 +}; + +// IOI2CRequest.commFlags +enum { + kIOI2CUseSubAddressCommFlag = 0x00000002 +}; + +/*! + * @struct IOI2CRequest + * @abstract A structure defining an I2C bus transaction. + * @discussion This structure is used to request an I2C transaction consisting of a send (write) to and reply (read) from a device, either of which is optional, to be carried out atomically on an I2C bus. + * @field __reservedA Set to zero. + * @field result The result of the transaction. Common errors are kIOReturnNoDevice if there is no device responding at the given address, kIOReturnUnsupportedMode if the type of transaction is unsupported on the requested bus. + * @field completion A completion routine to be executed when the request completes. If NULL is passed, the request is synchronous, otherwise it may execute asynchronously. + * @field commFlags Flags that modify the I2C transaction type. The following flags are defined:
+ * kIOI2CUseSubAddressCommFlag Transaction includes a subaddress.
+ * @field minReplyDelay Minimum delay as absolute time between send and reply transactions. + * @field sendAddress I2C address to write. + * @field sendSubAddress I2C subaddress to write. + * @field __reservedB Set to zero. + * @field sendTransactionType The following types of transaction are defined for the send part of the request:
+ * kIOI2CNoTransactionType No send transaction to perform.
+ * kIOI2CSimpleTransactionType Simple I2C message.
+ * kIOI2CCombinedTransactionType Combined format I2C R/~W transaction.
+ * @field sendBuffer Pointer to the send buffer. + * @field sendBytes Number of bytes to send. Set to actual bytes sent on completion of the request. + * @field replyAddress I2C Address from which to read. + * @field replySubAddress I2C Address from which to read. + * @field __reservedC Set to zero. + * @field replyTransactionType The following types of transaction are defined for the reply part of the request:
+ * kIOI2CNoTransactionType No reply transaction to perform.
+ * kIOI2CSimpleTransactionType Simple I2C message.
+ * kIOI2CDDCciReplyTransactionType DDC/ci message (with embedded length). See VESA DDC/ci specification.
+ * kIOI2CCombinedTransactionType Combined format I2C R/~W transaction.
+ * @field replyBuffer Pointer to the reply buffer. + * @field replyBytes Max bytes to reply (size of replyBuffer). Set to actual bytes received on completion of the request. + * @field __reservedD Set to zero. + */ + +#pragma pack(push, 4) +struct IOI2CRequest +{ + IOOptionBits sendTransactionType; + IOOptionBits replyTransactionType; + uint32_t sendAddress; + uint32_t replyAddress; + uint8_t sendSubAddress; + uint8_t replySubAddress; + uint8_t __reservedA[2]; + + uint64_t minReplyDelay; + + IOReturn result; + IOOptionBits commFlags; + +#if defined(__LP64__) + uint32_t __padA; +#else + vm_address_t sendBuffer; +#endif + uint32_t sendBytes; + + uint32_t __reservedB[2]; + +#if defined(__LP64__) + uint32_t __padB; +#else + vm_address_t replyBuffer; +#endif + uint32_t replyBytes; + + IOI2CRequestCompletion completion; +#if !defined(__LP64__) + uint32_t __padC[5]; +#else + vm_address_t sendBuffer; + vm_address_t replyBuffer; +#endif + + uint32_t __reservedC[10]; +}; +#pragma pack(pop) + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#define kIOI2CInterfaceClassName "IOI2CInterface" + +#define kIOI2CInterfaceIDKey "IOI2CInterfaceID" +#define kIOI2CBusTypeKey "IOI2CBusType" +#define kIOI2CTransactionTypesKey "IOI2CTransactionTypes" +#define kIOI2CSupportedCommFlagsKey "IOI2CSupportedCommFlags" + +#define kIOFBI2CInterfaceInfoKey "IOFBI2CInterfaceInfo" +#define kIOFBI2CInterfaceIDsKey "IOFBI2CInterfaceIDs" + +// kIOI2CBusTypeKey values +enum { + kIOI2CBusTypeI2C = 1, + kIOI2CBusTypeDisplayPort = 2 +}; + +/*! + * @struct IOI2CBusTiming + * @abstract A structure defining low level timing for an I2C bus. + * @discussion This structure is used to specify timeouts and pulse widths for an I2C bus implementation. + * @field bitTimeout Maximum time a slave can delay (by pulling the clock line low) a single bit response. + * @field byteTimeout Maximum time a slave can delay (by pulling the clock line low) the first bit of a byte response. + * @field acknowledgeTimeout Maximum time to wait for a slave to respond with an ACK after writing a byte. + * @field startTimeout Maximum time to wait for a slave to respond after a start signal. + * @field riseFallTime Time to wait after any change in output signal. + * @field __reservedA Set to zero. + */ + +struct IOI2CBusTiming +{ + AbsoluteTime bitTimeout; + AbsoluteTime byteTimeout; + AbsoluteTime acknowledgeTimeout; + AbsoluteTime startTimeout; + AbsoluteTime holdTime; + AbsoluteTime riseFallTime; + UInt32 __reservedA[8]; +}; +typedef struct IOI2CBusTiming IOI2CBusTiming; + +#ifndef KERNEL + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// options for IOFBCopyI2CInterfaceForBus() +enum { + kIOI2CBusNumberMask = 0x000000ff +}; + + +/*! @function IOFBGetI2CInterfaceCount + @abstract Returns a count of I2C interfaces available associated with an IOFramebuffer instance. + @discussion Returns a count of I2C interfaces available associated with an IOFramebuffer instance. + @param framebuffer The io_service_t of an IOFramebuffer instance. CoreGraphics will provide this for a CGDisplay with the CGDisplayIOServicePort() call. + @param count Interface count is returned. + @result An IOReturn code. */ + +IOReturn IOFBGetI2CInterfaceCount( io_service_t framebuffer, IOItemCount * count ); + +/*! @function IOFBCopyI2CInterfaceForBus + @abstract Returns an instance of an I2C bus interface, associated with an IOFramebuffer instance / bus index pair. + @discussion Some graphics devices will allow access to an I2C bus routed through a display connector in order to control external devices on that bus. This function returns an instance of an I2C bus interface, associated with an IOFramebuffer instance / bus index pair. The number of I2C buses is available from the IOFBGetI2CInterfaceCount() call. The interface may be used with the IOI2CInterfaceOpen/Close/SendRequest() calls to carry out I2C transactions on that bus. Not all graphics devices support this functionality. + @param bus The zero based index of the bus on the requested framebuffer. + @param interface The interface instance is returned. The caller should release this instance with IOObjectRelease(). + @result An IOReturn code. */ + +IOReturn IOFBCopyI2CInterfaceForBus( io_service_t framebuffer, IOOptionBits bus, io_service_t * interface ); + +typedef struct IOI2CConnect * IOI2CConnectRef; /* struct IOI2CConnect is opaque */ + +IOReturn IOI2CCopyInterfaceForID( CFTypeRef identifier, io_service_t * interface ); + +/*! @function IOI2CInterfaceOpen + @abstract Opens an instance of an I2C bus interface, allowing I2C requests to be made. + @discussion An instance of an I2C bus interface, obtained by IOFBCopyI2CInterfaceForBus, is opened with this function allowing I2C requests to be made. + @param interface An I2C bus interface (see IOFBCopyI2CInterfaceForBus). The interface may be released after this call is made. + @param options Pass kNilOptions. + @param connect The opaque IOI2CConnectRef is returned, for use with IOI2CSendRequest() and IOI2CInterfaceClose(). + @result An IOReturn code. */ + +IOReturn IOI2CInterfaceOpen( io_service_t interface, IOOptionBits options, + IOI2CConnectRef * connect ); + +/*! @function IOI2CInterfaceClose + @abstract Closes an IOI2CConnectRef. + @discussion Frees the resources associated with an IOI2CConnectRef. + @param connect The opaque IOI2CConnectRef returned by IOI2CInterfaceOpen(). + @param options Pass kNilOptions. + @result An IOReturn code. */ + +IOReturn IOI2CInterfaceClose( IOI2CConnectRef connect, IOOptionBits options ); + +/*! @function IOI2CSendRequest + @abstract Carries out the I2C transaction specified by an IOI2CRequest structure. + @discussion Frees the resources associated with an IOI2CConnectRef. + @param connect The opaque IOI2CConnectRef returned by IOI2CInterfaceOpen(). + @param options Pass kNilOptions. + @param request Pass a pointer to a IOI2CRequest structure describing the request. If an asynchronous request (with a non-NULL completion routine) the request structure must be valid for the life of the request. + @result An IOReturn code reflecting only the result of starting the transaction. If the result of IOI2CSendRequest() is kIOReturnSuccess, the I2C transaction result is returned in the result field of the request structure. */ + +IOReturn IOI2CSendRequest( IOI2CConnectRef connect, IOOptionBits options, + IOI2CRequest * request ); + +#else + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @class IOI2CInterface + @abstract The base class for an I2C bus interface. + @discussion The IOI2CInterface base class defines an I2C bus interface. Not useful for developers. */ + +class IOI2CInterface : public IOService +{ + OSDeclareDefaultStructors(IOI2CInterface) + +protected: + UInt64 fID; + +public: + IOReturn newUserClient( task_t owningTask, + void * security_id, + UInt32 type, + IOUserClient ** handler ) APPLE_KEXT_OVERRIDE; + + bool registerI2C( UInt64 id ); + + virtual IOReturn startIO( IOI2CRequest * request ) = 0; +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#endif /* KERNEL */ + +#endif /* ! _IOKIT_IOI2CINTERFACE_H */ + diff --git a/QualcommWireless/include/IOKit/ndrvsupport/IOMacOSTypes.h b/QualcommWireless/include/IOKit/ndrvsupport/IOMacOSTypes.h new file mode 100644 index 0000000..61893ee --- /dev/null +++ b/QualcommWireless/include/IOKit/ndrvsupport/IOMacOSTypes.h @@ -0,0 +1,419 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997 Apple Computer, Inc. + * + * + * HISTORY + * + * sdouglas 22 Oct 97 - first checked in. + * sdouglas 21 July 98 - start IOKit + */ + +/* + File: Types.h + + Contains: Basic Macintosh data types. + + Version: Technology: PowerSurge 1.0.2. + Package: Universal Interfaces 2.1.2 on ETO #20 + + Copyright: � 1984-1995 by Apple Computer, Inc. + All rights reserved. + + Bugs?: If you find a problem with this file, use the Apple Bug Reporter + stack. Include the file and version information (from above) + in the problem description and send to: + Internet: apple.bugs@applelink.apple.com + AppleLink: APPLE.BUGS + +*/ + +#ifndef _IOKIT_IOMACOSTYPES_H +#define _IOKIT_IOMACOSTYPES_H +#ifndef __MACTYPES__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __LP64__ +#pragma options align=mac68k +#endif + +#ifndef NULL +#if !defined(__cplusplus) && (defined(__SC__) || defined(THINK_C)) +#define NULL ((void *) 0) +#else +#define NULL 0 +#endif +#endif + +enum { + noErr = 0 +}; + +typedef unsigned char Byte; + +typedef signed char SignedByte; + +typedef UInt16 UniChar; + +typedef char *Ptr; + +typedef Ptr *Handle; + +typedef UInt32 Fixed; + +typedef Fixed *FixedPtr; + +typedef UInt32 Fract; + +typedef Fract *FractPtr; + +/* +enum { + false, + true +}; +#if !__option(bool) + #ifndef true + #define true 1 + #endif + #ifndef false + #define false 0 + #endif +#endif + +typedef unsigned char Boolean; +*/ + + +typedef short OSErr; + +typedef unsigned int FourCharCode; + +typedef FourCharCode OSType; + +typedef FourCharCode ResType; + +typedef OSType *OSTypePtr; + +typedef ResType *ResTypePtr; + +struct Rect { + short top; + short left; + short bottom; + short right; +}; +typedef struct Rect Rect; + +typedef Rect *RectPtr; + +// Quickdraw.i + +/* + kVariableLengthArray is used in array bounds to specify a variable length array. + It is ususally used in variable length structs when the last field is an array + of any size. Before ANSI C, we used zero as the bounds of variable length + array, but that is illegal in ANSI C. Example: + + struct FooList + { + short listLength; + Foo elements[kVariableLengthArray]; + }; +*/ + +enum { + kVariableLengthArray = 1 +}; + +/* Numeric version part of 'vers' resource */ +struct NumVersion { + UInt8 majorRev; /*1st part of version number in BCD*/ + UInt8 minorAndBugRev; /*2nd & 3rd part of version number share a byte*/ + UInt8 stage; /*stage code: dev, alpha, beta, final*/ + UInt8 nonRelRev; /*revision level of non-released version*/ +}; +typedef struct NumVersion NumVersion; + +typedef struct OpaqueRef *KernelID; + +typedef UInt8 *BytePtr; + +typedef IOByteCount ByteCount; + +typedef IOItemCount ItemCount; + +typedef void *LogicalAddress; + +#if !defined(__LP64__) +typedef void *PhysicalAddress; +#endif + +typedef UInt32 PBVersion; + +typedef SInt32 Duration; + +#define kInvalidID 0 + +enum { + kNilOptions = 0 +}; + + +typedef unsigned char Str31[32]; + + +/* +From: + File: DriverFamilyMatching.i <18> + Copyright: � 1995-1996 by Apple Computer, Inc., all rights reserved. +*/ + +//############################################## +// Well known properties in the Name Registry +//############################################## + +#define kPropertyName "name" +#define kPropertyCompatible "compatible" +#define kPropertyDriverPtr "driver-ptr" +#define kPropertyDriverDesc "driver-description" +#define kPropertyReg "reg" +#define kPropertyAAPLAddress "AAPL,address" +#define kPropertyMatching "matching" + + +//######################################################### +// Descriptor for Drivers and NDRVs +//######################################################### +/* Driver Typing Information Used to Match Drivers With Devices */ +struct DriverType { + Str31 nameInfoStr; /* Driver Name/Info String*/ + NumVersion version; /* Driver Version Number*/ +}; +typedef struct DriverType DriverType; +typedef DriverType * DriverTypePtr; + +/* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */ +typedef IOOptionBits RuntimeOptions; + + +enum { + kDriverIsLoadedUponDiscovery = 0x00000001, /* auto-load driver when discovered*/ + kDriverIsOpenedUponLoad = 0x00000002, /* auto-open driver when loaded*/ + kDriverIsUnderExpertControl = 0x00000004, /* I/O expert handles loads/opens*/ + kDriverIsConcurrent = 0x00000008, /* supports concurrent requests*/ + kDriverQueuesIOPB = 0x00000010, /* device manager doesn't queue IOPB*/ + kDriverIsLoadedAtBoot = 0x00000020, /* Driver is loaded at the boot time */ + kDriverIsForVirtualDevice = 0x00000040, /* Driver is for a virtual Device */ + kDriverSupportDMSuspendAndResume = 0x00000080 /* Driver supports Device Manager Suspend and Resume command */ +}; + +struct DriverOSRuntime { + RuntimeOptions driverRuntime; /* Options for OS Runtime*/ + Str31 driverName; /* Driver's name to the OS*/ + UInt32 driverDescReserved[8]; /* Reserved area*/ +}; +typedef struct DriverOSRuntime DriverOSRuntime; +typedef DriverOSRuntime * DriverOSRuntimePtr; + +/* OS Service Information Used To Declare What APIs a Driver Supports */ +typedef UInt32 ServiceCount; + +struct DriverServiceInfo { + OSType serviceCategory; /* Service Category Name*/ + OSType serviceType; /* Type within Category*/ + NumVersion serviceVersion; /* Version of service*/ +}; +typedef struct DriverServiceInfo DriverServiceInfo; +typedef DriverServiceInfo * DriverServiceInfoPtr; + +struct DriverOSService { + ServiceCount nServices; /* Number of Services Supported*/ + DriverServiceInfo service[1]; /* The List of Services (at least one)*/ +}; +typedef struct DriverOSService DriverOSService; +typedef DriverOSService * DriverOSServicePtr; + +/* Categories */ + +enum { + kServiceCategoryDisplay = 'disp', /* Display Manager*/ + kServiceCategoryOpenTransport = 'otan', /* Open Transport*/ + kServiceCategoryBlockStorage = 'blok', /* Block Storage*/ + kServiceCategoryNdrvDriver = 'ndrv', /* Generic Native Driver*/ + kServiceCategoryScsiSIM = 'scsi', /* SCSI */ + kServiceCategoryFileManager = 'file', /* File Manager */ + kServiceCategoryIDE = 'ide-', /* ide */ + kServiceCategoryADB = 'adb-', /* adb */ + kServiceCategoryPCI = 'pci-', /* pci bus */ + /* Nu Bus */ + kServiceCategoryDFM = 'dfm-', /* DFM */ + kServiceCategoryMotherBoard = 'mrbd', /* mother Board */ + kServiceCategoryKeyboard = 'kybd', /* Keyboard */ + kServiceCategoryPointing = 'poit', /* Pointing */ + kServiceCategoryRTC = 'rtc-', /* RTC */ + kServiceCategoryNVRAM = 'nram', /* NVRAM */ + kServiceCategorySound = 'sond', /* Sound (1/3/96 MCS) */ + kServiceCategoryPowerMgt = 'pgmt', /* Power Management */ + kServiceCategoryGeneric = 'genr' /* Generic Service Category to receive general Events */ +}; + +/* Ndrv ServiceCategory Types */ +enum { + kNdrvTypeIsGeneric = 'genr', /* generic*/ + kNdrvTypeIsVideo = 'vido', /* video*/ + kNdrvTypeIsBlockStorage = 'blok', /* block storage*/ + kNdrvTypeIsNetworking = 'netw', /* networking*/ + kNdrvTypeIsSerial = 'serl', /* serial*/ + kNdrvTypeIsParallel = 'parl', /* parallel */ + kNdrvTypeIsSound = 'sond', /* sound*/ + kNdrvTypeIsBusBridge = 'brdg' +}; + +typedef UInt32 DriverDescVersion; + +/* The Driver Description */ +enum { + kInitialDriverDescriptor = 0, + kVersionOneDriverDescriptor = 1 +}; + +enum { + kTheDescriptionSignature = 'mtej', + kDriverDescriptionSignature = 'pdes' +}; + + +struct DriverDescription { + OSType driverDescSignature; /* Signature field of this structure*/ + DriverDescVersion driverDescVersion; /* Version of this data structure*/ + DriverType driverType; /* Type of Driver*/ + DriverOSRuntime driverOSRuntimeInfo; /* OS Runtime Requirements of Driver*/ + DriverOSService driverServices; /* Apple Service API Membership*/ +}; +typedef struct DriverDescription DriverDescription; +typedef DriverDescription * DriverDescriptionPtr; + + +#ifndef __LP64__ +#pragma options align=reset +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __MACTYPES__ */ + +#ifndef __QUICKDRAW__ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __LP64__ +#pragma options align=mac68k +#endif + +struct RGBColor { + unsigned short red; /*magnitude of red component*/ + unsigned short green; /*magnitude of green component*/ + unsigned short blue; /*magnitude of blue component*/ +}; +typedef struct RGBColor RGBColor; +typedef RGBColor *RGBColorPtr; +typedef RGBColorPtr *RGBColorHdl; + +struct ColorSpec { + short value; /*index or other value*/ + RGBColor rgb; /*true color*/ +}; + +typedef struct ColorSpec ColorSpec; +typedef ColorSpec *ColorSpecPtr; + +struct GammaTbl { + short gVersion; /*gamma version number*/ + short gType; /*gamma data type*/ + short gFormulaSize; /*Formula data size*/ + short gChanCnt; /*number of channels of data*/ + short gDataCnt; /*number of values/channel*/ + short gDataWidth; /*bits/corrected value (data packed to next larger byte size)*/ + short gFormulaData[1]; /*data for formulas followed by gamma values*/ +}; +typedef struct GammaTbl GammaTbl; +typedef GammaTbl *GammaTblPtr; + +struct RegEntryID +{ + void * opaque[4]; +}; +typedef struct RegEntryID RegEntryID; +typedef RegEntryID * RegEntryIDPtr; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +struct IONDRVControlParameters { + UInt8 __reservedA[0x1a]; + UInt16 code; + void * params; + UInt8 __reservedB[0x12]; +}; + +enum { + kIONDRVOpenCommand = 128 + 0, + kIONDRVCloseCommand = 128 + 1, + kIONDRVReadCommand = 128 + 2, + kIONDRVWriteCommand = 128 + 3, + kIONDRVControlCommand = 128 + 4, + kIONDRVStatusCommand = 128 + 5, + kIONDRVKillIOCommand = 128 + 6, + kIONDRVInitializeCommand = 128 + 7, /* init driver and device*/ + kIONDRVFinalizeCommand = 128 + 8, /* shutdown driver and device*/ + kIONDRVReplaceCommand = 128 + 9, /* replace an old driver*/ + kIONDRVSupersededCommand = 128 + 10 /* prepare to be replaced by a new driver*/ +}; +enum { + kIONDRVSynchronousIOCommandKind = 0x00000001, + kIONDRVAsynchronousIOCommandKind = 0x00000002, + kIONDRVImmediateIOCommandKind = 0x00000004 +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __LP64__ +#pragma options align=reset +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __QUICKDRAW__ */ + +#endif /* _IOKIT_IOMACOSTYPES_H */ diff --git a/QualcommWireless/include/IOKit/ndrvsupport/IOMacOSVideo.h b/QualcommWireless/include/IOKit/ndrvsupport/IOMacOSVideo.h new file mode 100644 index 0000000..795072b --- /dev/null +++ b/QualcommWireless/include/IOKit/ndrvsupport/IOMacOSVideo.h @@ -0,0 +1,1391 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + File: Video.h + + Contains: Video Driver Interfaces. + + Copyright: (c) 1986-2000 by Apple Computer, Inc., all rights reserved + + Bugs?: For bug reports, consult the following page on + the World Wide Web: + + http://developer.apple.com/bugreporter/ + +*/ +#ifndef __IOMACOSVIDEO__ +#define __IOMACOSVIDEO__ + +#define PRAGMA_STRUCT_ALIGN 1 +#define FOUR_CHAR_CODE(x) (x) +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __LP64__ +#pragma options align=mac68k +#endif + +enum { + mBaseOffset = 1, /*Id of mBaseOffset.*/ + mRowBytes = 2, /*Video sResource parameter Id's */ + mBounds = 3, /*Video sResource parameter Id's */ + mVersion = 4, /*Video sResource parameter Id's */ + mHRes = 5, /*Video sResource parameter Id's */ + mVRes = 6, /*Video sResource parameter Id's */ + mPixelType = 7, /*Video sResource parameter Id's */ + mPixelSize = 8, /*Video sResource parameter Id's */ + mCmpCount = 9, /*Video sResource parameter Id's */ + mCmpSize = 10, /*Video sResource parameter Id's */ + mPlaneBytes = 11, /*Video sResource parameter Id's */ + mVertRefRate = 14, /*Video sResource parameter Id's */ + mVidParams = 1, /*Video parameter block id.*/ + mTable = 2, /*Offset to the table.*/ + mPageCnt = 3, /*Number of pages*/ + mDevType = 4, /*Device Type*/ + oneBitMode = 128, /*Id of OneBitMode Parameter list.*/ + twoBitMode = 129, /*Id of TwoBitMode Parameter list.*/ + fourBitMode = 130, /*Id of FourBitMode Parameter list.*/ + eightBitMode = 131 /*Id of EightBitMode Parameter list.*/ +}; + +enum { + sixteenBitMode = 132, /*Id of SixteenBitMode Parameter list.*/ + thirtyTwoBitMode = 133, /*Id of ThirtyTwoBitMode Parameter list.*/ + firstVidMode = 128, /*The new, better way to do the above. */ + secondVidMode = 129, /* QuickDraw only supports six video */ + thirdVidMode = 130, /* at this time. */ + fourthVidMode = 131, + fifthVidMode = 132, + sixthVidMode = 133, + spGammaDir = 64, + spVidNamesDir = 65 +}; + +typedef UInt32 AVIDType; +typedef AVIDType DisplayIDType; +typedef IODisplayModeID DisplayModeID; +typedef UInt16 DepthMode; +typedef UInt32 VideoDeviceType; +typedef UInt32 GammaTableID; + +/* csTimingFormat values in VDTimingInfo */ +/* look in the declaration rom for timing info */ +enum { + kDeclROMtables = FOUR_CHAR_CODE('decl'), + kDetailedTimingFormat = FOUR_CHAR_CODE('arba') /* Timing is a detailed timing*/ +}; + +/* Size of a block of EDID (Extended Display Identification Data) */ +enum { + kDDCBlockSize = 128 +}; + +/* ddcBlockType constants*/ +enum { + kDDCBlockTypeEDID = 0 /* EDID block type. */ +}; + +/* ddcFlags constants*/ +enum { + kDDCForceReadBit = 0, /* Force a new read of the EDID. */ + kDDCForceReadMask = (1 << kDDCForceReadBit) /* Mask for kddcForceReadBit. */ +}; + + +/* Timing mode constants for Display Manager MultiMode support + Corresponding .h equates are in Video.h + .a equates are in Video.a + .r equates are in DepVideoEqu.r + + The second enum is the old names (for compatibility). + The first enum is the new names. +*/ +enum { + timingInvalid = 0, /* Unknown timing... force user to confirm. */ + timingInvalid_SM_T24 = 8, /* Work around bug in SM Thunder24 card.*/ + timingApple_FixedRateLCD = 42, /* Lump all fixed-rate LCDs into one category.*/ + timingApple_512x384_60hz = 130, /* 512x384 (60 Hz) Rubik timing. */ + timingApple_560x384_60hz = 135, /* 560x384 (60 Hz) Rubik-560 timing. */ + timingApple_640x480_67hz = 140, /* 640x480 (67 Hz) HR timing. */ + timingApple_640x400_67hz = 145, /* 640x400 (67 Hz) HR-400 timing. */ + timingVESA_640x480_60hz = 150, /* 640x480 (60 Hz) VGA timing. */ + timingVESA_640x480_72hz = 152, /* 640x480 (72 Hz) VGA timing. */ + timingVESA_640x480_75hz = 154, /* 640x480 (75 Hz) VGA timing. */ + timingVESA_640x480_85hz = 158, /* 640x480 (85 Hz) VGA timing. */ + timingGTF_640x480_120hz = 159, /* 640x480 (120 Hz) VESA Generalized Timing Formula */ + timingApple_640x870_75hz = 160, /* 640x870 (75 Hz) FPD timing.*/ + timingApple_640x818_75hz = 165, /* 640x818 (75 Hz) FPD-818 timing.*/ + timingApple_832x624_75hz = 170, /* 832x624 (75 Hz) GoldFish timing.*/ + timingVESA_800x600_56hz = 180, /* 800x600 (56 Hz) SVGA timing. */ + timingVESA_800x600_60hz = 182, /* 800x600 (60 Hz) SVGA timing. */ + timingVESA_800x600_72hz = 184, /* 800x600 (72 Hz) SVGA timing. */ + timingVESA_800x600_75hz = 186, /* 800x600 (75 Hz) SVGA timing. */ + timingVESA_800x600_85hz = 188, /* 800x600 (85 Hz) SVGA timing. */ + timingVESA_1024x768_60hz = 190, /* 1024x768 (60 Hz) VESA 1K-60Hz timing. */ + timingVESA_1024x768_70hz = 200, /* 1024x768 (70 Hz) VESA 1K-70Hz timing. */ + timingVESA_1024x768_75hz = 204, /* 1024x768 (75 Hz) VESA 1K-75Hz timing (very similar to timingApple_1024x768_75hz). */ + timingVESA_1024x768_85hz = 208, /* 1024x768 (85 Hz) VESA timing. */ + timingApple_1024x768_75hz = 210, /* 1024x768 (75 Hz) Apple 19" RGB. */ + timingApple_1152x870_75hz = 220, /* 1152x870 (75 Hz) Apple 21" RGB. */ + timingAppleNTSC_ST = 230, /* 512x384 (60 Hz, interlaced, non-convolved). */ + timingAppleNTSC_FF = 232, /* 640x480 (60 Hz, interlaced, non-convolved). */ + timingAppleNTSC_STconv = 234, /* 512x384 (60 Hz, interlaced, convolved). */ + timingAppleNTSC_FFconv = 236, /* 640x480 (60 Hz, interlaced, convolved). */ + timingApplePAL_ST = 238, /* 640x480 (50 Hz, interlaced, non-convolved). */ + timingApplePAL_FF = 240, /* 768x576 (50 Hz, interlaced, non-convolved). */ + timingApplePAL_STconv = 242, /* 640x480 (50 Hz, interlaced, convolved). */ + timingApplePAL_FFconv = 244, /* 768x576 (50 Hz, interlaced, convolved). */ + timingVESA_1280x960_75hz = 250, /* 1280x960 (75 Hz) */ + timingVESA_1280x960_60hz = 252, /* 1280x960 (60 Hz) */ + timingVESA_1280x960_85hz = 254, /* 1280x960 (85 Hz) */ + timingVESA_1280x1024_60hz = 260, /* 1280x1024 (60 Hz) */ + timingVESA_1280x1024_75hz = 262, /* 1280x1024 (75 Hz) */ + timingVESA_1280x1024_85hz = 268, /* 1280x1024 (85 Hz) */ + timingVESA_1600x1200_60hz = 280, /* 1600x1200 (60 Hz) VESA timing. */ + timingVESA_1600x1200_65hz = 282, /* 1600x1200 (65 Hz) VESA timing. */ + timingVESA_1600x1200_70hz = 284, /* 1600x1200 (70 Hz) VESA timing. */ + timingVESA_1600x1200_75hz = 286, /* 1600x1200 (75 Hz) VESA timing (pixel clock is 189.2 Mhz dot clock). */ + timingVESA_1600x1200_80hz = 288, /* 1600x1200 (80 Hz) VESA timing (pixel clock is 216>? Mhz dot clock) - proposed only. */ + timingVESA_1600x1200_85hz = 289, /* 1600x1200 (85 Hz) VESA timing (pixel clock is 229.5 Mhz dot clock). */ + timingVESA_1792x1344_60hz = 296, /* 1792x1344 (60 Hz) VESA timing (204.75 Mhz dot clock). */ + timingVESA_1792x1344_75hz = 298, /* 1792x1344 (75 Hz) VESA timing (261.75 Mhz dot clock). */ + timingVESA_1856x1392_60hz = 300, /* 1856x1392 (60 Hz) VESA timing (218.25 Mhz dot clock). */ + timingVESA_1856x1392_75hz = 302, /* 1856x1392 (75 Hz) VESA timing (288 Mhz dot clock). */ + timingVESA_1920x1440_60hz = 304, /* 1920x1440 (60 Hz) VESA timing (234 Mhz dot clock). */ + timingVESA_1920x1440_75hz = 306, /* 1920x1440 (75 Hz) VESA timing (297 Mhz dot clock). */ + timingSMPTE240M_60hz = 400, /* 60Hz V, 33.75KHz H, interlaced timing, 16:9 aspect, typical resolution of 1920x1035. */ + timingFilmRate_48hz = 410, /* 48Hz V, 25.20KHz H, non-interlaced timing, typical resolution of 640x480. */ + timingSony_1600x1024_76hz = 500, /* 1600x1024 (76 Hz) Sony timing (pixel clock is 170.447 Mhz dot clock). */ + timingSony_1920x1080_60hz = 510, /* 1920x1080 (60 Hz) Sony timing (pixel clock is 159.84 Mhz dot clock). */ + timingSony_1920x1080_72hz = 520, /* 1920x1080 (72 Hz) Sony timing (pixel clock is 216.023 Mhz dot clock). */ + timingSony_1920x1200_76hz = 540, /* 1900x1200 (76 Hz) Sony timing (pixel clock is 243.20 Mhz dot clock). */ + timingApple_0x0_0hz_Offline = 550 /* Indicates that this timing will take the display off-line and remove it from the system. */ +}; + + +/* Deprecated timing names.*/ +enum { + timingApple12 = timingApple_512x384_60hz, + timingApple12x = timingApple_560x384_60hz, + timingApple13 = timingApple_640x480_67hz, + timingApple13x = timingApple_640x400_67hz, + timingAppleVGA = timingVESA_640x480_60hz, + timingApple15 = timingApple_640x870_75hz, + timingApple15x = timingApple_640x818_75hz, + timingApple16 = timingApple_832x624_75hz, + timingAppleSVGA = timingVESA_800x600_56hz, + timingApple1Ka = timingVESA_1024x768_60hz, + timingApple1Kb = timingVESA_1024x768_70hz, + timingApple19 = timingApple_1024x768_75hz, + timingApple21 = timingApple_1152x870_75hz, + timingSony_1900x1200_74hz = 530, /* 1900x1200 (74 Hz) Sony timing (pixel clock is 236.25 Mhz dot clock). */ + timingSony_1900x1200_76hz = timingSony_1920x1200_76hz /* 1900x1200 (76 Hz) Sony timing (pixel clock is 245.48 Mhz dot clock). */ +}; + +/* csConnectFlags values in VDDisplayConnectInfo */ +enum { + kAllModesValid = 0, /* All modes not trimmed by primary init are good close enough to try */ + kAllModesSafe = 1, /* All modes not trimmed by primary init are know to be safe */ + kReportsTagging = 2, /* Can detect tagged displays (to identify smart monitors) */ + kHasDirectConnection = 3, /* True implies that driver can talk directly to device (e.g. serial data link via sense lines) */ + kIsMonoDev = 4, /* Says whether there's an RGB (0) or Monochrome (1) connection. */ + kUncertainConnection = 5, /* There may not be a display (no sense lines?). */ + kTaggingInfoNonStandard = 6, /* Set when csConnectTaggedType/csConnectTaggedData are non-standard (i.e., not the Apple CRT sense codes). */ + kReportsDDCConnection = 7, /* Card can do ddc (set kHasDirectConnect && kHasDDCConnect if you actually found a ddc display). */ + kHasDDCConnection = 8, /* Card has ddc connect now. */ + kConnectionInactive = 9, /* Set when the connection is NOT currently active (generally used in a multiconnection environment). */ + kDependentConnection = 10, /* Set when some ascpect of THIS connection depends on another (will generally be set in a kModeSimulscan environment). */ + kBuiltInConnection = 11, /* Set when connection is KNOWN to be built-in (this is not the same as kHasDirectConnection). */ + kOverrideConnection = 12, /* Set when the reported connection is not the true one, but is one that has been forced through a SetConnection call */ + kFastCheckForDDC = 13, /* Set when all 3 are true: 1) sense codes indicate DDC display could be attached 2) attempted fast check 3) DDC failed */ + kReportsHotPlugging = 14, /* Detects and reports hot pluggging on connector (via VSL also implies DDC will be up to date w/o force read) */ + kStereoSyncConnection = 15 /* Connection supports stereo sync signalling */ +}; + + +/* csDisplayType values in VDDisplayConnectInfo */ +enum { + kUnknownConnect = 1, /* Not sure how we'll use this, but seems like a good idea. */ + kPanelConnect = 2, /* For use with fixed-in-place LCD panels. */ + kPanelTFTConnect = 2, /* Alias for kPanelConnect */ + kFixedModeCRTConnect = 3, /* For use with fixed-mode (i.e., very limited range) displays. */ + kMultiModeCRT1Connect = 4, /* 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe */ + kMultiModeCRT2Connect = 5, /* 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe */ + kMultiModeCRT3Connect = 6, /* 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain */ + kMultiModeCRT4Connect = 7, /* Expansion to large multi mode (not yet used) */ + kModelessConnect = 8, /* Expansion to modeless model (not yet used) */ + kFullPageConnect = 9, /* 640x818 (to get 8bpp in 512K case) and 640x870 (these two only) */ + kVGAConnect = 10, /* 640x480 VGA default -- question everything else */ + kNTSCConnect = 11, /* NTSC ST (default), FF, STconv, FFconv */ + kPALConnect = 12, /* PAL ST (default), FF, STconv, FFconv */ + kHRConnect = 13, /* Straight-6 connect -- 640x480 and 640x400 (to get 8bpp in 256K case) (these two only) */ + kPanelFSTNConnect = 14, /* For use with fixed-in-place LCD FSTN (aka "Supertwist") panels */ + kMonoTwoPageConnect = 15, /* 1152x870 Apple color two-page display */ + kColorTwoPageConnect = 16, /* 1152x870 Apple B&W two-page display */ + kColor16Connect = 17, /* 832x624 Apple B&W two-page display */ + kColor19Connect = 18, /* 1024x768 Apple B&W two-page display */ + kGenericCRT = 19, /* Indicates nothing except that connection is CRT in nature. */ + kGenericLCD = 20, /* Indicates nothing except that connection is LCD in nature. */ + kDDCConnect = 21, /* DDC connection, always set kHasDDCConnection */ + kNoConnect = 22 /* No display is connected - load sensing or similar level of hardware detection is assumed (used by resident drivers that support hot plugging when nothing is currently connected) */ +}; + +/* csTimingFlags values in VDTimingInfoRec */ +enum { + kModeValid = 0, /* Says that this mode should NOT be trimmed. */ + kModeSafe = 1, /* This mode does not need confirmation */ + kModeDefault = 2, /* This is the default mode for this type of connection */ + kModeShowNow = 3, /* This mode should always be shown (even though it may require a confirm) */ + kModeNotResize = 4, /* This mode should not be used to resize the display (eg. mode selects a different connector on card) */ + kModeRequiresPan = 5, /* This mode has more pixels than are actually displayed */ + kModeInterlaced = 6, /* This mode is interlaced (single pixel lines look bad). */ + kModeShowNever = 7, /* This mode should not be shown in the user interface. */ + kModeSimulscan = 8, /* Indicates that more than one display connection can be driven from a single framebuffer controller. */ + kModeNotPreset = 9, /* Indicates that the timing is not a factory preset for the current display (geometry may need correction) */ + kModeBuiltIn = 10, /* Indicates that the display mode is for the built-in connect only (on multiconnect devices like the PB 3400) Only the driver is quieried */ + kModeStretched = 11, /* Indicates that the display mode will be stretched/distorted to match the display aspect ratio */ + kModeNotGraphicsQuality = 12, /* Indicates that the display mode is not the highest quality (eg. stretching artifacts). Intended as a hint */ + kModeValidateAgainstDisplay = 13 /* Indicates that this mode should be validated against the display EDID */ +}; + +/* csDepthFlags in VDVideoParametersInfoRec */ +enum { + kDepthDependent = 0, /* Says that this depth mode may cause dependent changes in other framebuffers (and . */ + kDepthDependentMask = (1 << kDepthDependent) /* mask for kDepthDependent */ +}; + +/* csResolutionFlags bit flags for VDResolutionInfoRec */ +enum { + kResolutionHasMultipleDepthSizes = 0 /* Says that this mode has different csHorizontalPixels, csVerticalLines at different depths (usually slightly larger at lower depths) */ +}; + + +enum { + /* Power Mode constants for VDPowerStateRec.powerState. Note the numeric order does not match the power state order */ + kAVPowerOff = 0, /* Power fully off*/ + kAVPowerStandby = 1, + kAVPowerSuspend = 2, + kAVPowerOn = 3, + kHardwareSleep = 128, + kHardwareWake = 129, + kHardwareWakeFromSuspend = 130, + kHardwareWakeToDoze = 131, + kHardwareWakeToDozeFromSuspend = 132, + kHardwarePark = 133, + kHardwareDrive = 134 +}; + +/* Reduced perf level, for GetPowerState, SetPowerState*/ +enum { + kPowerStateReducedPowerMask = 0x00000300, + kPowerStateFullPower = 0x00000000, + kPowerStateReducedPower1 = 0x00000100, + kPowerStateReducedPower2 = 0x00000200, + kPowerStateReducedPower3 = 0x00000300 +}; + +enum { + /* Power Mode masks and bits for VDPowerStateRec.powerFlags. */ + kPowerStateNeedsRefresh = 0, /* When leaving this power mode, a display will need refreshing */ + kPowerStateSleepAwareBit = 1, /* if gestaltPCCardDockingSelectorFix, Docking mgr checks this bit before checking kPowerStateSleepAllowedBit */ + kPowerStateSleepForbiddenBit = 2, /* if kPowerStateSleepAwareBit, Docking mgr checks this bit before sleeping */ + kPowerStateSleepCanPowerOffBit = 3, /* supports power down sleep (ie PCI power off)*/ + kPowerStateSleepNoDPMSBit = 4, /* Bug #2425210. Do not use DPMS with this display.*/ + kPowerStateSleepWaketoDozeBit = 5, /* Supports Wake to Doze */ + kPowerStateSleepWakeNeedsProbeBit = 6, /* Does not sense connection changes on wake */ + + kPowerStateNeedsRefreshMask = (1 << kPowerStateNeedsRefresh), + kPowerStateSleepAwareMask = (1 << kPowerStateSleepAwareBit), + kPowerStateSleepForbiddenMask = (1 << kPowerStateSleepForbiddenBit), + kPowerStateSleepCanPowerOffMask = (1 << kPowerStateSleepCanPowerOffBit), + kPowerStateSleepNoDPMSMask = (1 << kPowerStateSleepNoDPMSBit), + kPowerStateSleepWaketoDozeMask = (1 << kPowerStateSleepWaketoDozeBit), + kPowerStateSleepWakeNeedsProbeMask = (1 << kPowerStateSleepWakeNeedsProbeBit), + + kPowerStateSupportsReducedPower1Bit = 10, + kPowerStateSupportsReducedPower2Bit = 11, + kPowerStateSupportsReducedPower3Bit = 12, + kPowerStateSupportsReducedPower1BitMask = (1 << 10), + kPowerStateSupportsReducedPower2BitMask = (1 << 11), + kPowerStateSupportsReducedPower3BitMask = (1 << 12) +}; + + +enum { + /* Control Codes */ + cscReset = 0, + cscKillIO = 1, + cscSetMode = 2, + cscSetEntries = 3, + cscSetGamma = 4, + cscGrayPage = 5, + cscGrayScreen = 5, + cscSetGray = 6, + cscSetInterrupt = 7, + cscDirectSetEntries = 8, + cscSetDefaultMode = 9, + cscSwitchMode = 10, /* Takes a VDSwitchInfoPtr */ + cscSetSync = 11, /* Takes a VDSyncInfoPtr */ + cscSavePreferredConfiguration = 16, /* Takes a VDSwitchInfoPtr */ + cscSetHardwareCursor = 22, /* Takes a VDSetHardwareCursorPtr */ + cscDrawHardwareCursor = 23, /* Takes a VDDrawHardwareCursorPtr */ + cscSetConvolution = 24, /* Takes a VDConvolutionInfoPtr */ + cscSetPowerState = 25, /* Takes a VDPowerStatePtr */ + cscPrivateControlCall = 26, /* Takes a VDPrivateSelectorDataRec*/ + cscSetMultiConnect = 28, /* From a GDI point of view, this call should be implemented completely in the HAL and not at all in the core.*/ + cscSetClutBehavior = 29, /* Takes a VDClutBehavior */ + cscSetDetailedTiming = 31, /* Takes a VDDetailedTimingPtr */ + cscDoCommunication = 33, /* Takes a VDCommunicationPtr */ + cscProbeConnection = 34, /* Takes nil pointer */ + /* (may generate a kFBConnectInterruptServiceType service interrupt) */ + cscSetScaler = 36, /* Takes a VDScalerPtr */ + cscSetMirror = 37, /* Takes a VDMirrorPtr*/ + cscSetFeatureConfiguration = 38, /* Takes a VDConfigurationPtr*/ + cscUnusedCall = 127 /* This call used to expand the scrn resource. Its imbedded data contains more control info */ +}; + +enum { + /* Status Codes */ + cscGetMode = 2, + cscGetEntries = 3, + cscGetPageCnt = 4, + cscGetPages = 4, /* This is what C&D 2 calls it. */ + cscGetPageBase = 5, + cscGetBaseAddr = 5, /* This is what C&D 2 calls it. */ + cscGetGray = 6, + cscGetInterrupt = 7, + cscGetGamma = 8, + cscGetDefaultMode = 9, + cscGetCurMode = 10, /* Takes a VDSwitchInfoPtr */ + cscGetSync = 11, /* Takes a VDSyncInfoPtr */ + cscGetConnection = 12, /* Return information about the connection to the display */ + cscGetModeTiming = 13, /* Return timing info for a mode */ + cscGetModeBaseAddress = 14, /* Return base address information about a particular mode */ + cscGetScanProc = 15, /* QuickTime scan chasing routine */ + cscGetPreferredConfiguration = 16, /* Takes a VDSwitchInfoPtr */ + cscGetNextResolution = 17, /* Takes a VDResolutionInfoPtr */ + cscGetVideoParameters = 18, /* Takes a VDVideoParametersInfoPtr */ + cscGetGammaInfoList = 20, /* Takes a VDGetGammaListPtr */ + cscRetrieveGammaTable = 21, /* Takes a VDRetrieveGammaPtr */ + cscSupportsHardwareCursor = 22, /* Takes a VDSupportsHardwareCursorPtr */ + cscGetHardwareCursorDrawState = 23, /* Takes a VDHardwareCursorDrawStatePtr */ + cscGetConvolution = 24, /* Takes a VDConvolutionInfoPtr */ + cscGetPowerState = 25, /* Takes a VDPowerStatePtr */ + cscPrivateStatusCall = 26, /* Takes a VDPrivateSelectorDataRec*/ + cscGetDDCBlock = 27, /* Takes a VDDDCBlockRec */ + cscGetMultiConnect = 28, /* From a GDI point of view, this call should be implemented completely in the HAL and not at all in the core.*/ + cscGetClutBehavior = 29, /* Takes a VDClutBehavior */ + cscGetTimingRanges = 30, /* Takes a VDDisplayTimingRangePtr */ + cscGetDetailedTiming = 31, /* Takes a VDDetailedTimingPtr */ + cscGetCommunicationInfo = 32, /* Takes a VDCommunicationInfoPtr */ + cscGetScalerInfo = 35, /* Takes a VDScalerInfoPtr */ + cscGetScaler = 36, /* Takes a VDScalerPtr */ + cscGetMirror = 37, /* Takes a VDMirrorPtr*/ + cscGetFeatureConfiguration = 38, /* Takes a VDConfigurationPtr*/ + cscGetFeatureList = 39 +}; + +/* Bit definitions for the Get/Set Sync call*/ +enum { + kDisableHorizontalSyncBit = 0, + kDisableVerticalSyncBit = 1, + kDisableCompositeSyncBit = 2, + kEnableSyncOnBlue = 3, + kEnableSyncOnGreen = 4, + kEnableSyncOnRed = 5, + kNoSeparateSyncControlBit = 6, + kTriStateSyncBit = 7, + kHorizontalSyncMask = 0x01, + kVerticalSyncMask = 0x02, + kCompositeSyncMask = 0x04, + kDPMSSyncMask = 0x07, + kTriStateSyncMask = 0x80, + kSyncOnBlueMask = 0x08, + kSyncOnGreenMask = 0x10, + kSyncOnRedMask = 0x20, + kSyncOnMask = 0x38 +}; + +enum { + /* Power Mode constants for translating DPMS modes to Get/SetSync calls. */ + kDPMSSyncOn = 0, + kDPMSSyncStandby = 1, + kDPMSSyncSuspend = 2, + kDPMSSyncOff = 7 +}; + +/* Bit definitions for the Get/Set Convolution call*/ +enum { + kConvolved = 0, + kLiveVideoPassThru = 1, + kConvolvedMask = 0x01, + kLiveVideoPassThruMask = 0x02 +}; + + + +struct VPBlock { + UInt32 vpBaseOffset; /*Offset to page zero of video RAM (From minorBaseOS).*/ +#if __LP64__ + UInt32 vpRowBytes; /*Width of each row of video memory.*/ +#else + SInt16 vpRowBytes; /*Width of each row of video memory.*/ +#endif + Rect vpBounds; /*BoundsRect for the video display (gives dimensions).*/ + SInt16 vpVersion; /*PixelMap version number.*/ + SInt16 vpPackType; + UInt32 vpPackSize; + UInt32 vpHRes; /*Horizontal resolution of the device (pixels per inch).*/ + UInt32 vpVRes; /*Vertical resolution of the device (pixels per inch).*/ + SInt16 vpPixelType; /*Defines the pixel type.*/ + SInt16 vpPixelSize; /*Number of bits in pixel.*/ + SInt16 vpCmpCount; /*Number of components in pixel.*/ + SInt16 vpCmpSize; /*Number of bits per component*/ + UInt32 vpPlaneBytes; /*Offset from one plane to the next.*/ +}; +typedef struct VPBlock VPBlock; +typedef VPBlock * VPBlockPtr; + +struct VDEntryRecord { + Ptr csTable; /* pointer to color table entry=value, r,g,b:INTEGER*/ +}; +typedef struct VDEntryRecord VDEntryRecord; + +typedef VDEntryRecord * VDEntRecPtr; +/* Parm block for SetGray control call */ + +struct VDGrayRecord { + Boolean csMode; /*Same as GDDevType value (0=color, 1=mono)*/ + SInt8 filler; +}; +typedef struct VDGrayRecord VDGrayRecord; + +typedef VDGrayRecord * VDGrayPtr; +/* Parm block for SetInterrupt call */ + +struct VDFlagRecord { + SInt8 csMode; + SInt8 filler; +}; +typedef struct VDFlagRecord VDFlagRecord; + +typedef VDFlagRecord * VDFlagRecPtr; +/* Parm block for SetEntries control call */ + +struct VDSetEntryRecord { + ColorSpec * csTable; /*Pointer to an array of color specs*/ + SInt16 csStart; /*Which spec in array to start with, or -1*/ + SInt16 csCount; /*Number of color spec entries to set*/ +}; +typedef struct VDSetEntryRecord VDSetEntryRecord; + +typedef VDSetEntryRecord * VDSetEntryPtr; +/* Parm block for SetGamma control call */ + +struct VDGammaRecord { + Ptr csGTable; /*pointer to gamma table*/ +}; +typedef struct VDGammaRecord VDGammaRecord; + +typedef VDGammaRecord * VDGamRecPtr; + +struct VDSwitchInfoRec { + DepthMode csMode; /* mode depth*/ + DisplayModeID csData; /* functional sResource of mode*/ + UInt16 csPage; /* page to switch in*/ + Ptr csBaseAddr; /* base address of page (return value)*/ + uintptr_t csReserved; /* Reserved (set to 0) */ +}; +typedef struct VDSwitchInfoRec VDSwitchInfoRec; + +typedef VDSwitchInfoRec * VDSwitchInfoPtr; + +struct VDTimingInfoRec { + DisplayModeID csTimingMode; /* timing mode (a la InitGDevice) */ + uintptr_t csTimingReserved; /* reserved */ + UInt32 csTimingFormat; /* what format is the timing info */ + UInt32 csTimingData; /* data supplied by driver */ + UInt32 csTimingFlags; /* mode within device */ +}; +typedef struct VDTimingInfoRec VDTimingInfoRec; + +typedef VDTimingInfoRec * VDTimingInfoPtr; + +struct VDDisplayConnectInfoRec { + UInt16 csDisplayType; /* Type of display connected */ + UInt8 csConnectTaggedType; /* type of tagging */ + UInt8 csConnectTaggedData; /* tagging data */ + UInt32 csConnectFlags; /* tell us about the connection */ + uintptr_t csDisplayComponent; /* if the card has a direct connection to the display, it returns the display component here (FUTURE) */ + uintptr_t csConnectReserved; /* reserved */ +}; +typedef struct VDDisplayConnectInfoRec VDDisplayConnectInfoRec; + +typedef VDDisplayConnectInfoRec * VDDisplayConnectInfoPtr; + +struct VDMultiConnectInfoRec { + UInt32 csDisplayCountOrNumber; /* For GetMultiConnect, returns count n of 1..n connections; otherwise, indicates the ith connection.*/ + VDDisplayConnectInfoRec csConnectInfo; /* Standard VDDisplayConnectionInfo for connection i.*/ +}; +typedef struct VDMultiConnectInfoRec VDMultiConnectInfoRec; + +typedef VDMultiConnectInfoRec * VDMultiConnectInfoPtr; +/* RawSenseCode + This abstract data type is not exactly abstract. Rather, it is merely enumerated constants + for the possible raw sense code values when 'standard' sense code hardware is implemented. + + For 'standard' sense code hardware, the raw sense is obtained as follows: + o Instruct the frame buffer controller NOT to actively drive any of the monitor sense lines + o Read the state of the monitor sense lines 2, 1, and 0. (2 is the MSB, 0 the LSB) + + IMPORTANT Note: + When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants + are valid 'csConnectTaggedType' values in 'VDDisplayConnectInfo' + +*/ +typedef UInt8 RawSenseCode; +enum { + kRSCZero = 0, + kRSCOne = 1, + kRSCTwo = 2, + kRSCThree = 3, + kRSCFour = 4, + kRSCFive = 5, + kRSCSix = 6, + kRSCSeven = 7 +}; + + +/* ExtendedSenseCode + This abstract data type is not exactly abstract. Rather, it is merely enumerated constants + for the values which are possible when the extended sense algorithm is applied to hardware + which implements 'standard' sense code hardware. + + For 'standard' sense code hardware, the extended sense code algorithm is as follows: + (Note: as described here, sense line 'A' corresponds to '2', 'B' to '1', and 'C' to '0') + o Drive sense line 'A' low and read the values of 'B' and 'C'. + o Drive sense line 'B' low and read the values of 'A' and 'C'. + o Drive sense line 'C' low and read the values of 'A' and 'B'. + + In this way, a six-bit number of the form BC/AC/AB is generated. + + IMPORTANT Note: + When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants + are valid 'csConnectTaggedData' values in 'VDDisplayConnectInfo' + +*/ +typedef UInt8 ExtendedSenseCode; +enum { + kESCZero21Inch = 0x00, /* 21" RGB */ + kESCOnePortraitMono = 0x14, /* Portrait Monochrome */ + kESCTwo12Inch = 0x21, /* 12" RGB */ + kESCThree21InchRadius = 0x31, /* 21" RGB (Radius) */ + kESCThree21InchMonoRadius = 0x34, /* 21" Monochrome (Radius) */ + kESCThree21InchMono = 0x35, /* 21" Monochrome */ + kESCFourNTSC = 0x0A, /* NTSC */ + kESCFivePortrait = 0x1E, /* Portrait RGB */ + kESCSixMSB1 = 0x03, /* MultiScan Band-1 (12" thru 1Six") */ + kESCSixMSB2 = 0x0B, /* MultiScan Band-2 (13" thru 19") */ + kESCSixMSB3 = 0x23, /* MultiScan Band-3 (13" thru 21") */ + kESCSixStandard = 0x2B, /* 13"/14" RGB or 12" Monochrome */ + kESCSevenPAL = 0x00, /* PAL */ + kESCSevenNTSC = 0x14, /* NTSC */ + kESCSevenVGA = 0x17, /* VGA */ + kESCSeven16Inch = 0x2D, /* 16" RGB (GoldFish) */ + kESCSevenPALAlternate = 0x30, /* PAL (Alternate) */ + kESCSeven19Inch = 0x3A, /* Third-Party 19" */ + kESCSevenDDC = 0x3E, /* DDC display */ + kESCSevenNoDisplay = 0x3F /* No display connected */ +}; + +/* DepthMode + This abstract data type is used to to reference RELATIVE pixel depths. + Its definition is largely derived from its past usage, analogous to 'xxxVidMode' + + Bits per pixel DOES NOT directly map to 'DepthMode' For example, on some + graphics hardware, 'kDepthMode1' may represent 1 BPP, whereas on other + hardware, 'kDepthMode1' may represent 8BPP. + + DepthMode IS considered to be ordinal, i.e., operations such as <, >, ==, etc. + behave as expected. The values of the constants which comprise the set are such + that 'kDepthMode4 < kDepthMode6' behaves as expected. +*/ +enum { + kDepthMode1 = 128, + kDepthMode2 = 129, + kDepthMode3 = 130, + kDepthMode4 = 131, + kDepthMode5 = 132, + kDepthMode6 = 133 +}; + +enum { + kFirstDepthMode = 128, /* These constants are obsolete, and just included */ + kSecondDepthMode = 129, /* for clients that have converted to the above */ + kThirdDepthMode = 130, /* kDepthModeXXX constants. */ + kFourthDepthMode = 131, + kFifthDepthMode = 132, + kSixthDepthMode = 133 +}; + + + +struct VDPageInfo { + DepthMode csMode; /* mode within device*/ + DisplayModeID csData; /* data supplied by driver*/ + SInt16 csPage; /* page to switch in*/ + Ptr csBaseAddr; /* base address of page*/ +}; +typedef struct VDPageInfo VDPageInfo; + +typedef VDPageInfo * VDPgInfoPtr; + +struct VDSizeInfo { + SInt16 csHSize; /* desired/returned h size*/ + SInt16 csHPos; /* desired/returned h position*/ + SInt16 csVSize; /* desired/returned v size*/ + SInt16 csVPos; /* desired/returned v position*/ +}; +typedef struct VDSizeInfo VDSizeInfo; + +typedef VDSizeInfo * VDSzInfoPtr; + +struct VDSettings { + SInt16 csParamCnt; /* number of params*/ + SInt16 csBrightMax; /* max brightness*/ + SInt16 csBrightDef; /* default brightness*/ + SInt16 csBrightVal; /* current brightness*/ + SInt16 csCntrstMax; /* max contrast*/ + SInt16 csCntrstDef; /* default contrast*/ + SInt16 csCntrstVal; /* current contrast*/ + SInt16 csTintMax; /* max tint*/ + SInt16 csTintDef; /* default tint*/ + SInt16 csTintVal; /* current tint*/ + SInt16 csHueMax; /* max hue*/ + SInt16 csHueDef; /* default hue*/ + SInt16 csHueVal; /* current hue*/ + SInt16 csHorizDef; /* default horizontal*/ + SInt16 csHorizVal; /* current horizontal*/ + SInt16 csHorizMax; /* max horizontal*/ + SInt16 csVertDef; /* default vertical*/ + SInt16 csVertVal; /* current vertical*/ + SInt16 csVertMax; /* max vertical*/ +}; +typedef struct VDSettings VDSettings; +typedef VDSettings * VDSettingsPtr; + +struct VDDefMode { + UInt8 csID; + SInt8 filler; +}; +typedef struct VDDefMode VDDefMode; +typedef VDDefMode * VDDefModePtr; + +struct VDSyncInfoRec { + UInt8 csMode; + UInt8 csFlags; +}; +typedef struct VDSyncInfoRec VDSyncInfoRec; + +typedef VDSyncInfoRec * VDSyncInfoPtr; +/* + All displayModeID values from 0x80000000 to 0xFFFFFFFF and 0x00 + are reserved for Apple Computer. +*/ +/* Constants for the cscGetNextResolution call */ +enum { + kDisplayModeIDCurrent = 0x00, /* Reference the Current DisplayModeID */ + kDisplayModeIDInvalid = (IODisplayModeID)0xFFFFFFFF, /* A bogus DisplayModeID in all cases */ + kDisplayModeIDFindFirstResolution = (IODisplayModeID)0xFFFFFFFE, /* Used in cscGetNextResolution to reset iterator */ + kDisplayModeIDNoMoreResolutions = (IODisplayModeID)0xFFFFFFFD, /* Used in cscGetNextResolution to indicate End Of List */ + kDisplayModeIDFindFirstProgrammable = (IODisplayModeID)0xFFFFFFFC, /* Used in cscGetNextResolution to find unused programmable timing */ + kDisplayModeIDBootProgrammable = (IODisplayModeID)0xFFFFFFFB, /* This is the ID given at boot time by the OF driver to a programmable timing */ + kDisplayModeIDReservedBase = (IODisplayModeID)0x80000000 /* Lowest (unsigned) DisplayModeID reserved by Apple */ +}; + +/* Constants for the GetGammaInfoList call */ +enum { + kGammaTableIDFindFirst = (GammaTableID)0xFFFFFFFE, /* Get the first gamma table ID */ + kGammaTableIDNoMoreTables = (GammaTableID)0xFFFFFFFD, /* Used to indicate end of list */ + kGammaTableIDSpecific = 0x00 /* Return the info for the given table id */ +}; + +/* Constants for GetMultiConnect call*/ +enum { + kGetConnectionCount = 0xFFFFFFFF, /* Used to get the number of possible connections in a "multi-headed" framebuffer environment.*/ + kActivateConnection = (0 << kConnectionInactive), /* Used for activating a connection (csConnectFlags value).*/ + kDeactivateConnection = (1 << kConnectionInactive) /* Used for deactivating a connection (csConnectFlags value.)*/ +}; + +/* VDCommunicationRec.csBusID values*/ +enum { + kVideoDefaultBus = 0 +}; + + +/* VDCommunicationInfoRec.csBusType values*/ +enum { + kVideoBusTypeInvalid = 0, + kVideoBusTypeI2C = 1, + kVideoBusTypeDisplayPort = 2 +}; + + +/* VDCommunicationRec.csSendType and VDCommunicationRec.csReplyType values*/ +enum { + kVideoNoTransactionType = 0, /* No transaction*/ + kVideoNoTransactionTypeMask = (1 << kVideoNoTransactionType), + kVideoSimpleI2CType = 1, /* Simple I2C message*/ + kVideoSimpleI2CTypeMask = (1 << kVideoSimpleI2CType), + kVideoDDCciReplyType = 2, /* DDC/ci message (with imbedded length)*/ + kVideoDDCciReplyTypeMask = (1 << kVideoDDCciReplyType), + kVideoCombinedI2CType = 3, /* Combined format I2C R/~W transaction*/ + kVideoCombinedI2CTypeMask = (1 << kVideoCombinedI2CType), + kVideoDisplayPortNativeType = 4, /* DisplayPort Native */ + kVideoDisplayPortNativeTypeMask = (1 << kVideoDisplayPortNativeType) +}; + +// VDCommunicationRec.csCommFlags and VDCommunicationInfoRec.csSupportedCommFlags +enum { + kVideoReplyMicroSecDelayBit = 0, /* If bit set, the driver should delay csMinReplyDelay micro seconds between send and receive*/ + kVideoReplyMicroSecDelayMask = (1 << kVideoReplyMicroSecDelayBit), + kVideoUsageAddrSubAddrBit = 1, /* If bit set, the driver understands to use the lower 16 bits of the address field as two 8 bit values (address/subaddress) for the I2C transaction*/ + kVideoUsageAddrSubAddrMask = (1 << kVideoUsageAddrSubAddrBit) +}; + + +struct VDResolutionInfoRec { + DisplayModeID csPreviousDisplayModeID; /* ID of the previous resolution in a chain */ + DisplayModeID csDisplayModeID; /* ID of the next resolution */ + UInt32 csHorizontalPixels; /* # of pixels in a horizontal line at the max depth */ + UInt32 csVerticalLines; /* # of lines in a screen at the max depth */ + Fixed csRefreshRate; /* Vertical Refresh Rate in Hz */ + DepthMode csMaxDepthMode; /* 0x80-based number representing max bit depth */ + UInt32 csResolutionFlags; /* Reserved - flag bits */ + uintptr_t csReserved; /* Reserved */ +}; +typedef struct VDResolutionInfoRec VDResolutionInfoRec; + +typedef VDResolutionInfoRec * VDResolutionInfoPtr; + +struct VDVideoParametersInfoRec { + DisplayModeID csDisplayModeID; /* the ID of the resolution we want info on */ + DepthMode csDepthMode; /* The bit depth we want the info on (0x80 based) */ + VPBlockPtr csVPBlockPtr; /* Pointer to a video parameter block */ + UInt32 csPageCount; /* Number of pages supported by the resolution */ + VideoDeviceType csDeviceType; /* Device Type: Direct, Fixed or CLUT; */ + UInt32 csDepthFlags; /* Flags */ +}; +typedef struct VDVideoParametersInfoRec VDVideoParametersInfoRec; + +typedef VDVideoParametersInfoRec * VDVideoParametersInfoPtr; + +struct VDGammaInfoRec { + GammaTableID csLastGammaID; /* the ID of the previous gamma table */ + GammaTableID csNextGammaID; /* the ID of the next gamma table */ + Ptr csGammaPtr; /* Ptr to a gamma table data */ + uintptr_t csReserved; /* Reserved */ +}; +typedef struct VDGammaInfoRec VDGammaInfoRec; + +typedef VDGammaInfoRec * VDGammaInfoPtr; + +struct VDGetGammaListRec { + GammaTableID csPreviousGammaTableID; /* ID of the previous gamma table */ + GammaTableID csGammaTableID; /* ID of the gamma table following csPreviousDisplayModeID */ + UInt32 csGammaTableSize; /* Size of the gamma table in bytes */ + char * csGammaTableName; /* Gamma table name (c-string) */ +}; +typedef struct VDGetGammaListRec VDGetGammaListRec; + +typedef VDGetGammaListRec * VDGetGammaListPtr; + +struct VDRetrieveGammaRec { + GammaTableID csGammaTableID; /* ID of gamma table to retrieve */ + GammaTbl * csGammaTablePtr; /* Location to copy desired gamma to */ +}; +typedef struct VDRetrieveGammaRec VDRetrieveGammaRec; + +typedef VDRetrieveGammaRec * VDRetrieveGammaPtr; + +struct VDSetHardwareCursorRec { + void * csCursorRef; /* reference to cursor data */ + UInt32 csReserved1; /* reserved for future use */ + UInt32 csReserved2; /* should be ignored */ +}; +typedef struct VDSetHardwareCursorRec VDSetHardwareCursorRec; + +typedef VDSetHardwareCursorRec * VDSetHardwareCursorPtr; + +struct VDDrawHardwareCursorRec { + SInt32 csCursorX; /* x coordinate */ + SInt32 csCursorY; /* y coordinate */ + UInt32 csCursorVisible; /* true if cursor is must be visible */ + UInt32 csReserved1; /* reserved for future use */ + UInt32 csReserved2; /* should be ignored */ +}; +typedef struct VDDrawHardwareCursorRec VDDrawHardwareCursorRec; + +typedef VDDrawHardwareCursorRec * VDDrawHardwareCursorPtr; + +struct VDSupportsHardwareCursorRec { + UInt32 csSupportsHardwareCursor; + /* true if hardware cursor is supported */ + UInt32 csReserved1; /* reserved for future use */ + UInt32 csReserved2; /* must be zero */ +}; +typedef struct VDSupportsHardwareCursorRec VDSupportsHardwareCursorRec; + +typedef VDSupportsHardwareCursorRec * VDSupportsHardwareCursorPtr; + +struct VDHardwareCursorDrawStateRec { + SInt32 csCursorX; /* x coordinate */ + SInt32 csCursorY; /* y coordinate */ + UInt32 csCursorVisible; /* true if cursor is visible */ + UInt32 csCursorSet; /* true if cursor successfully set by last set control call */ + UInt32 csReserved1; /* reserved for future use */ + UInt32 csReserved2; /* must be zero */ +}; +typedef struct VDHardwareCursorDrawStateRec VDHardwareCursorDrawStateRec; + +typedef VDHardwareCursorDrawStateRec * VDHardwareCursorDrawStatePtr; + +struct VDConvolutionInfoRec { + DisplayModeID csDisplayModeID; /* the ID of the resolution we want info on */ + DepthMode csDepthMode; /* The bit depth we want the info on (0x80 based) */ + UInt32 csPage; + UInt32 csFlags; + UInt32 csReserved; +}; +typedef struct VDConvolutionInfoRec VDConvolutionInfoRec; + +typedef VDConvolutionInfoRec * VDConvolutionInfoPtr; + +struct VDPowerStateRec { + UInt32 powerState; + UInt32 powerFlags; + + uintptr_t powerReserved1; + uintptr_t powerReserved2; +}; +typedef struct VDPowerStateRec VDPowerStateRec; + +typedef VDPowerStateRec * VDPowerStatePtr; +/* + Private Data to video drivers. + + In versions of MacOS with multiple address spaces (System 8), the OS + must know the extent of parameters in order to move them between the caller + and driver. The old private-selector model for video drivers does not have + this information so: + + For post-7.x Systems private calls should be implemented using the cscPrivateCall +*/ + +struct VDPrivateSelectorDataRec { + LogicalAddress privateParameters; /* Caller's parameters*/ + ByteCount privateParametersSize; /* Size of data sent from caller to driver*/ + LogicalAddress privateResults; /* Caller's return area. Can be nil, or same as privateParameters.*/ + ByteCount privateResultsSize; /* Size of data driver returns to caller. Can be nil, or same as privateParametersSize.*/ +}; +typedef struct VDPrivateSelectorDataRec VDPrivateSelectorDataRec; + + +struct VDPrivateSelectorRec { + UInt32 reserved; /* Reserved (set to 0). */ + VDPrivateSelectorDataRec data[1]; +}; +typedef struct VDPrivateSelectorRec VDPrivateSelectorRec; + +struct VDDDCBlockRec { + UInt32 ddcBlockNumber; /* Input -- DDC EDID (Extended Display Identification Data) number (1-based) */ + ResType ddcBlockType; /* Input -- DDC block type (EDID/VDIF) */ + UInt32 ddcFlags; /* Input -- DDC Flags*/ + UInt32 ddcReserved; /* Reserved */ + Byte ddcBlockData[128]; /* Output -- DDC EDID/VDIF data (kDDCBlockSize) */ +}; +typedef struct VDDDCBlockRec VDDDCBlockRec; + +typedef VDDDCBlockRec * VDDDCBlockPtr; + +enum { + /* timingSyncConfiguration*/ + kSyncInterlaceMask = (1 << 7), + kSyncAnalogCompositeMask = 0, + kSyncAnalogCompositeSerrateMask = (1 << 2), + kSyncAnalogCompositeRGBSyncMask = (1 << 1), + kSyncAnalogBipolarMask = (1 << 3), + kSyncAnalogBipolarSerrateMask = (1 << 2), + kSyncAnalogBipolarSRGBSyncMask = (1 << 1), + kSyncDigitalCompositeMask = (1 << 4), + kSyncDigitalCompositeSerrateMask = (1 << 2), + kSyncDigitalCompositeMatchHSyncMask = (1 << 2), + kSyncDigitalSeperateMask = (1 << 4) + (1 << 3), + kSyncDigitalVSyncPositiveMask = (1 << 2), + kSyncDigitalHSyncPositiveMask = (1 << 1) +}; + + + + +struct VDDisplayTimingRangeRec { + UInt32 csRangeSize; /* Init to sizeof(VDDisplayTimingRangeRec) */ + UInt32 csRangeType; /* Init to 0 */ + UInt32 csRangeVersion; /* Init to 0 */ + UInt32 csRangeReserved; /* Init to 0 */ + + UInt32 csRangeBlockIndex; /* Requested block (first index is 0)*/ + UInt32 csRangeGroup; /* set to 0 */ + UInt32 csRangeBlockCount; /* # blocks */ + UInt32 csRangeFlags; /* dependent video */ + + UInt64 csMinPixelClock; /* Min dot clock in Hz */ + UInt64 csMaxPixelClock; /* Max dot clock in Hz */ + + UInt32 csMaxPixelError; /* Max dot clock error */ + UInt32 csTimingRangeSyncFlags; + UInt32 csTimingRangeSignalLevels; + UInt32 csTimingRangeSupportedSignalConfigs; + + UInt32 csMinFrameRate; /* Hz */ + UInt32 csMaxFrameRate; /* Hz */ + UInt32 csMinLineRate; /* Hz */ + UInt32 csMaxLineRate; /* Hz */ + + + UInt32 csMaxHorizontalTotal; /* Clocks - Maximum total (active + blanking) */ + UInt32 csMaxVerticalTotal; /* Clocks - Maximum total (active + blanking) */ + UInt32 csMaxTotalReserved1; /* Reserved */ + UInt32 csMaxTotalReserved2; /* Reserved */ + + + + /* Some cards require that some timing elements*/ + /* be multiples of a "character size" (often 8*/ + /* clocks). The "xxxxCharSize" fields document*/ + /* those requirements.*/ + + + UInt8 csCharSizeHorizontalActive; /* Character size */ + UInt8 csCharSizeHorizontalBlanking; /* Character size */ + UInt8 csCharSizeHorizontalSyncOffset; /* Character size */ + UInt8 csCharSizeHorizontalSyncPulse; /* Character size */ + + UInt8 csCharSizeVerticalActive; /* Character size */ + UInt8 csCharSizeVerticalBlanking; /* Character size */ + UInt8 csCharSizeVerticalSyncOffset; /* Character size */ + UInt8 csCharSizeVerticalSyncPulse; /* Character size */ + + UInt8 csCharSizeHorizontalBorderLeft; /* Character size */ + UInt8 csCharSizeHorizontalBorderRight; /* Character size */ + UInt8 csCharSizeVerticalBorderTop; /* Character size */ + UInt8 csCharSizeVerticalBorderBottom; /* Character size */ + + UInt8 csCharSizeHorizontalTotal; /* Character size for active + blanking */ + UInt8 csCharSizeVerticalTotal; /* Character size for active + blanking */ + UInt16 csCharSizeReserved1; /* Reserved (Init to 0) */ + + + UInt32 csMinHorizontalActiveClocks; + UInt32 csMaxHorizontalActiveClocks; + UInt32 csMinHorizontalBlankingClocks; + UInt32 csMaxHorizontalBlankingClocks; + + UInt32 csMinHorizontalSyncOffsetClocks; + UInt32 csMaxHorizontalSyncOffsetClocks; + UInt32 csMinHorizontalPulseWidthClocks; + UInt32 csMaxHorizontalPulseWidthClocks; + + UInt32 csMinVerticalActiveClocks; + UInt32 csMaxVerticalActiveClocks; + UInt32 csMinVerticalBlankingClocks; + UInt32 csMaxVerticalBlankingClocks; + + UInt32 csMinVerticalSyncOffsetClocks; + UInt32 csMaxVerticalSyncOffsetClocks; + UInt32 csMinVerticalPulseWidthClocks; + UInt32 csMaxVerticalPulseWidthClocks; + + + UInt32 csMinHorizontalBorderLeft; + UInt32 csMaxHorizontalBorderLeft; + UInt32 csMinHorizontalBorderRight; + UInt32 csMaxHorizontalBorderRight; + + UInt32 csMinVerticalBorderTop; + UInt32 csMaxVerticalBorderTop; + UInt32 csMinVerticalBorderBottom; + UInt32 csMaxVerticalBorderBottom; + + UInt32 csMaxNumLinks; /* number of links, if zero, assume link 1 */ + UInt32 csMinLink0PixelClock; /* min pixel clock for link 0 (kHz) */ + UInt32 csMaxLink0PixelClock; /* max pixel clock for link 0 (kHz) */ + UInt32 csMinLink1PixelClock; /* min pixel clock for link 1 (kHz) */ + UInt32 csMaxLink1PixelClock; /* max pixel clock for link 1 (kHz) */ + + UInt32 csReserved6; /* Reserved (Init to 0)*/ + UInt32 csReserved7; /* Reserved (Init to 0)*/ + UInt32 csReserved8; /* Reserved (Init to 0)*/ +}; +typedef struct VDDisplayTimingRangeRec VDDisplayTimingRangeRec; + +typedef VDDisplayTimingRangeRec * VDDisplayTimingRangePtr; + +enum { + /* csDisplayModeState*/ + kDMSModeReady = 0, /* Display Mode ID is configured and ready*/ + kDMSModeNotReady = 1, /* Display Mode ID is is being programmed*/ + kDMSModeFree = 2 /* Display Mode ID is not associated with a timing*/ +}; + + +/* Video driver Errors -10930 to -10959 */ +enum { + kTimingChangeRestrictedErr = -10930, + kVideoI2CReplyPendingErr = -10931, + kVideoI2CTransactionErr = -10932, + kVideoI2CBusyErr = -10933, + kVideoI2CTransactionTypeErr = -10934, + kVideoBufferSizeErr = -10935, + kVideoCannotMirrorErr = -10936 +}; + + +enum { + /* csTimingRangeSignalLevels*/ + kRangeSupportsSignal_0700_0300_Bit = 0, + kRangeSupportsSignal_0714_0286_Bit = 1, + kRangeSupportsSignal_1000_0400_Bit = 2, + kRangeSupportsSignal_0700_0000_Bit = 3, + kRangeSupportsSignal_0700_0300_Mask = (1 << kRangeSupportsSignal_0700_0300_Bit), + kRangeSupportsSignal_0714_0286_Mask = (1 << kRangeSupportsSignal_0714_0286_Bit), + kRangeSupportsSignal_1000_0400_Mask = (1 << kRangeSupportsSignal_1000_0400_Bit), + kRangeSupportsSignal_0700_0000_Mask = (1 << kRangeSupportsSignal_0700_0000_Bit) +}; + + +enum { + /* csSignalConfig*/ + kDigitalSignalBit = 0, /* Do not set. Mac OS does not currently support arbitrary digital timings*/ + kAnalogSetupExpectedBit = 1, /* Analog displays - display expects a blank-to-black setup or pedestal. See VESA signal standards.*/ + kInterlacedCEA861SyncModeBit = 2, + + kDigitalSignalMask = (1 << kDigitalSignalBit), + kAnalogSetupExpectedMask = (1 << kAnalogSetupExpectedBit), + kInterlacedCEA861SyncModeMask = (1 << kInterlacedCEA861SyncModeBit) +}; + + +enum { + /* csSignalLevels for analog*/ + kAnalogSignalLevel_0700_0300 = 0, + kAnalogSignalLevel_0714_0286 = 1, + kAnalogSignalLevel_1000_0400 = 2, + kAnalogSignalLevel_0700_0000 = 3 +}; + + +enum { + /* csTimingRangeSyncFlags*/ + kRangeSupportsSeperateSyncsBit = 0, + kRangeSupportsSyncOnGreenBit = 1, + kRangeSupportsCompositeSyncBit = 2, + kRangeSupportsVSyncSerrationBit = 3, + kRangeSupportsSeperateSyncsMask = (1 << kRangeSupportsSeperateSyncsBit), + kRangeSupportsSyncOnGreenMask = (1 << kRangeSupportsSyncOnGreenBit), + kRangeSupportsCompositeSyncMask = (1 << kRangeSupportsCompositeSyncBit), + kRangeSupportsVSyncSerrationMask = (1 << kRangeSupportsVSyncSerrationBit) +}; + + + +enum { + /* csHorizontalSyncConfig and csVerticalSyncConfig*/ + kSyncPositivePolarityBit = 0, /* Digital separate sync polarity for analog interfaces (0 => negative polarity)*/ + kSyncPositivePolarityMask = (1 << kSyncPositivePolarityBit) +}; + + + + +/* For timings with kDetailedTimingFormat.*/ + +struct VDDetailedTimingRec { + UInt32 csTimingSize; /* Init to sizeof(VDDetailedTimingRec)*/ + UInt32 csTimingType; /* Init to 0*/ + UInt32 csTimingVersion; /* Init to 0*/ + UInt32 csTimingReserved; /* Init to 0*/ + + DisplayModeID csDisplayModeID; /* Init to 0*/ + UInt32 csDisplayModeSeed; /* */ + UInt32 csDisplayModeState; /* Display Mode state*/ + UInt32 csDisplayModeAlias; /* Mode to use when programmed.*/ + + UInt32 csSignalConfig; + UInt32 csSignalLevels; + + UInt64 csPixelClock; /* Hz*/ + + UInt64 csMinPixelClock; /* Hz - With error what is slowest actual clock */ + UInt64 csMaxPixelClock; /* Hz - With error what is fasted actual clock */ + + + UInt32 csHorizontalActive; /* Pixels*/ + UInt32 csHorizontalBlanking; /* Pixels*/ + UInt32 csHorizontalSyncOffset; /* Pixels*/ + UInt32 csHorizontalSyncPulseWidth; /* Pixels*/ + + UInt32 csVerticalActive; /* Lines*/ + UInt32 csVerticalBlanking; /* Lines*/ + UInt32 csVerticalSyncOffset; /* Lines*/ + UInt32 csVerticalSyncPulseWidth; /* Lines*/ + + UInt32 csHorizontalBorderLeft; /* Pixels*/ + UInt32 csHorizontalBorderRight; /* Pixels*/ + UInt32 csVerticalBorderTop; /* Lines*/ + UInt32 csVerticalBorderBottom; /* Lines*/ + + UInt32 csHorizontalSyncConfig; + UInt32 csHorizontalSyncLevel; /* Future use (init to 0)*/ + UInt32 csVerticalSyncConfig; + UInt32 csVerticalSyncLevel; /* Future use (init to 0)*/ + + UInt32 csNumLinks; /* number of links, if 0 = assume link - 0 */ + + UInt32 csReserved2; /* Init to 0*/ + UInt32 csReserved3; /* Init to 0*/ + UInt32 csReserved4; /* Init to 0*/ + + UInt32 csReserved5; /* Init to 0*/ + UInt32 csReserved6; /* Init to 0*/ + UInt32 csReserved7; /* Init to 0*/ + UInt32 csReserved8; /* Init to 0*/ +}; +typedef struct VDDetailedTimingRec VDDetailedTimingRec; + +typedef VDDetailedTimingRec * VDDetailedTimingPtr; + +/* csScalerFeatures */ +enum { + kScaleStretchOnlyMask = (1<<0), /* True means the driver cannot add borders to avoid non-square pixels */ + kScaleCanUpSamplePixelsMask = (1<<1), /* True means timings with more active clocks than pixels (ie 640x480 pixels on a 1600x1200 timing) */ + kScaleCanDownSamplePixelsMask = (1<<2), /* True means timings with fewer active clocks than pixels (ie 1600x1200 pixels on a 640x480 timing) */ + kScaleCanScaleInterlacedMask = (1<<3), /* True means can scale an interlaced timing */ + kScaleCanSupportInsetMask = (1<<4), /* True means can scale a timing with insets */ + kScaleCanRotateMask = (1<<5), /* True means can rotate image */ + kScaleCanBorderInsetOnlyMask = (1<<6) /* True means can scale a timing with insets */ +}; + +/* csScalerFlags */ +enum { + kScaleStretchToFitMask = 0x00000001, /* True means the driver should avoid borders and allow non-square pixels */ + + kScaleRotateFlagsMask = 0x000000f0, + + kScaleSwapAxesMask = 0x00000010, + kScaleInvertXMask = 0x00000020, + kScaleInvertYMask = 0x00000040, + + kScaleRotate0Mask = 0x00000000, + kScaleRotate90Mask = kScaleSwapAxesMask | kScaleInvertXMask, + kScaleRotate180Mask = kScaleInvertXMask | kScaleInvertYMask, + kScaleRotate270Mask = kScaleSwapAxesMask | kScaleInvertYMask +}; + +typedef UInt32 VDClutBehavior; +typedef VDClutBehavior * VDClutBehaviorPtr; +enum { + kSetClutAtSetEntries = 0, /* SetEntries behavior is to update clut during SetEntries call*/ + kSetClutAtVBL = 1 /* SetEntries behavior is to upate clut at next vbl*/ +}; + + +struct VDCommunicationRec { + SInt32 csBusID; /* kVideoDefaultBus for single headed cards.*/ + UInt32 csCommFlags; /* Always zero*/ + UInt32 csMinReplyDelay; /* Minimum delay between send and reply transactions (units depend on csCommFlags)*/ + UInt32 csReserved2; /* Always zero*/ + + UInt32 csSendAddress; /* Usually I2C address (eg 0x6E)*/ + UInt32 csSendType; /* See kVideoSimpleI2CType etc.*/ + LogicalAddress csSendBuffer; /* Pointer to the send buffer*/ + ByteCount csSendSize; /* Number of bytes to send*/ + + UInt32 csReplyAddress; /* Address from which to read (eg 0x6F for kVideoDDCciReplyType I2C address)*/ + UInt32 csReplyType; /* See kVideoDDCciReplyType etc.*/ + LogicalAddress csReplyBuffer; /* Pointer to the reply buffer*/ + ByteCount csReplySize; /* Max bytes to reply (size of csReplyBuffer)*/ + + UInt32 csReserved3; + UInt32 csReserved4; + UInt32 csReserved5; /* Always zero*/ + UInt32 csReserved6; /* Always zero*/ +}; +typedef struct VDCommunicationRec VDCommunicationRec; + +typedef VDCommunicationRec * VDCommunicationPtr; + +struct VDCommunicationInfoRec { + SInt32 csBusID; /* kVideoDefaultBus for single headed cards. */ + UInt32 csBusType; /* See kVideoBusI2C etc.*/ + SInt32 csMinBus; /* Minimum bus (usually kVideoDefaultBus). Used to probe additional busses*/ + SInt32 csMaxBus; /* Max bus (usually kVideoDefaultBus). Used to probe additional busses*/ + + UInt32 csSupportedTypes; /* Bit field for first 32 supported transaction types. Eg. 0x07 => support for kVideoNoTransactionType, kVideoSimpleI2CType and kVideoDDCciReplyType.*/ + UInt32 csSupportedCommFlags; /* Return the flags csCommFlags understood by this driver. */ + UInt32 csReserved2; /* Always zero*/ + UInt32 csReserved3; /* Always zero*/ + + UInt32 csReserved4; /* Always zero*/ + UInt32 csReserved5; /* Always zero*/ + UInt32 csReserved6; /* Always zero*/ + UInt32 csReserved7; /* Always zero*/ +}; +typedef struct VDCommunicationInfoRec VDCommunicationInfoRec; + +typedef VDCommunicationInfoRec * VDCommunicationInfoPtr; + + +struct VDScalerRec { + UInt32 csScalerSize; /* Init to sizeof(VDScalerRec) */ + UInt32 csScalerVersion; /* Init to 0 */ + UInt32 csReserved1; /* Init to 0 */ + UInt32 csReserved2; /* Init to 0 */ + + DisplayModeID csDisplayModeID; /* Display Mode ID modified by this call. */ + UInt32 csDisplayModeSeed; /* */ + UInt32 csDisplayModeState; /* Display Mode state */ + UInt32 csReserved3; /* Init to 0 */ + + UInt32 csScalerFlags; /* Init to 0 */ + UInt32 csHorizontalPixels; /* Graphics system addressable pixels */ + UInt32 csVerticalPixels; /* Graphics system addressable lines */ + UInt32 csHorizontalInset; /* Border pixels for underscan */ + UInt32 csVerticalInset; /* Border lines for underscan */ + UInt32 csReserved6; /* Init to 0 */ + UInt32 csReserved7; /* Init to 0 */ + UInt32 csReserved8; /* Init to 0 */ +}; +typedef struct VDScalerRec VDScalerRec; +typedef VDScalerRec *VDScalerPtr; + +struct VDScalerInfoRec { + UInt32 csScalerInfoSize; /* Init to sizeof(VDScalerInfoRec) */ + UInt32 csScalerInfoVersion; /* Init to 0 */ + UInt32 csReserved1; /* Init to 0 */ + UInt32 csReserved2; /* Init to 0 */ + + UInt32 csScalerFeatures; /* Feature flags */ + UInt32 csMaxHorizontalPixels; /* limit to horizontal scaled pixels */ + UInt32 csMaxVerticalPixels; /* limit to vertical scaled pixels */ + UInt32 csReserved3; /* Init to 0 */ + + UInt32 csReserved4; /* Init to 0 */ + UInt32 csReserved5; /* Init to 0 */ + UInt32 csReserved6; /* Init to 0 */ + UInt32 csReserved7; /* Init to 0 */ +}; +typedef struct VDScalerInfoRec VDScalerInfoRec; +typedef VDScalerInfoRec *VDScalerInfoPtr; + +enum { + /* csMirrorFeatures*/ + kMirrorSameDepthOnlyMirrorMask = (1 << 0), /* Commonly true - Mirroring can only be done if the displays are the same bitdepth*/ + kMirrorSameSizeOnlyMirrorMask = (1 << 1), /* Commonly false - Mirroring can only be done if the displays are the same size*/ + kMirrorSameTimingOnlyMirrorMask = (1 << 2), /* Sometimes true - Mirroring can only be done if the displays are the same timing*/ + kMirrorCommonGammaMask = (1 << 3) /* Sometimes true - Only one gamma correction LUT.*/ +}; + +enum { + /* csMirrorSupportedFlags and csMirrorFlags*/ + kMirrorCanMirrorMask = (1 << 0), /* Set means we can HW mirrored right now (uses csMirrorEntryID)*/ + kMirrorAreMirroredMask = (1 << 1), /* Set means we are HW mirrored right now (uses csMirrorEntryID)*/ + kMirrorUnclippedMirrorMask = (1 << 2), /* Set means mirrored displays are not clipped to their intersection*/ + kMirrorHAlignCenterMirrorMask = (1 << 3), /* Set means mirrored displays can/should be centered horizontally*/ + kMirrorVAlignCenterMirrorMask = (1 << 4), /* Set means mirrored displays can/should be centered vertically*/ + kMirrorCanChangePixelFormatMask = (1 << 5), /* Set means mirrored the device should change the pixel format of mirrored displays to allow mirroring.*/ + kMirrorCanChangeTimingMask = (1 << 6), /* Set means mirrored the device should change the timing of mirrored displays to allow mirroring.*/ + kMirrorClippedMirrorMask = (1 << 7) /* Set means mirrored displays are clipped to their intersection (driver handles blacking and base address adjustment)*/ +}; + +struct VDMirrorRec { + UInt32 csMirrorSize; /* Init to sizeof(VDMirrorRec)*/ + UInt32 csMirrorVersion; /* Init to 0*/ + + RegEntryID csMirrorRequestID; /* Input RegEntryID to check for mirroring support and state*/ + RegEntryID csMirrorResultID; /* Output RegEntryID of the next mirrored device*/ + + UInt32 csMirrorFeatures; /* Output summary features of the driver*/ + UInt32 csMirrorSupportedFlags; /* Output configuration options supported by the driver*/ + UInt32 csMirrorFlags; /* Output configuration options active now*/ + UInt32 csReserved1; /* Init to 0*/ + + + UInt32 csReserved2; /* Init to 0*/ + UInt32 csReserved3; /* Init to 0*/ + UInt32 csReserved4; /* Init to 0*/ + UInt32 csReserved5; /* Init to 0*/ +}; +typedef struct VDMirrorRec VDMirrorRec; +typedef VDMirrorRec * VDMirrorPtr; + +struct VDConfigurationRec { + UInt32 csConfigFeature; /* input what feature to config - always input*/ + UInt32 csConfigSupport; /* output support value - always output*/ + uintptr_t csConfigValue; /* input/output feature value - input on Control(), output on Status()*/ + uintptr_t csReserved1; + uintptr_t csReserved2; +}; +typedef struct VDConfigurationRec VDConfigurationRec; +typedef VDConfigurationRec * VDConfigurationPtr; + +enum +{ + kDVIPowerSwitchFeature = (1 << 0), /* Used for csConfigFeature*/ + kDVIPowerSwitchSupportMask = (1 << 0), /* Read-only*/ + kDVIPowerSwitchActiveMask = (1 << 0), /* Read/write for csConfigValue*/ +}; + +struct VDConfigurationFeatureListRec +{ + OSType * csConfigFeatureList; + ItemCount csNumConfigFeatures; + uintptr_t csReserved1; + uintptr_t csReserved2; +}; +typedef struct VDConfigurationFeatureListRec VDConfigurationFeatureListRec; +typedef VDConfigurationFeatureListRec * VDConfigurationFeatureListRecPtr; + + +#ifndef __LP64__ +#pragma options align=reset +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __IOMACOSVIDEO__ */ + diff --git a/QualcommWireless/include/IOKit/ndrvsupport/IONDRVFramebuffer.h b/QualcommWireless/include/IOKit/ndrvsupport/IONDRVFramebuffer.h new file mode 100644 index 0000000..154e146 --- /dev/null +++ b/QualcommWireless/include/IOKit/ndrvsupport/IONDRVFramebuffer.h @@ -0,0 +1,360 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997-1998 Apple Computer, Inc. + * + * + * HISTORY + * + * sdouglas 22 Oct 97 - first checked in. + * sdouglas 24 Jul 98 - start IOKit. + * sdouglas 15 Dec 98 - cpp. + * + */ + +#ifndef _IOKIT_IONDRVFRAMEBUFFER_H +#define _IOKIT_IONDRVFRAMEBUFFER_H + +#include +#include +#include + +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +#define kIONDRVDisableKey "AAPL,disable-ndrv" + +class IONDRVFramebuffer : public IOFramebuffer +{ + OSDeclareDefaultStructors(IONDRVFramebuffer) + +protected: +/* Reserved for future use. (Internal use only) */ + struct ExpansionData { }; + ExpansionData * reserved; + +protected: + + IOService * fNub; + class IONDRV * fNdrv; + + // current configuration + IODisplayModeID currentDisplayMode; + IOIndex currentDepth; + IOIndex currentPage; + UInt8 __reservedE; + + IOPhysicalAddress __resv_was_physicalFramebuffer; + IOMemoryDescriptor * vramRange; + + UInt8 gammaWidth; + UInt8 __reservedD; + UInt8 lastGrayMode; + VDClutBehavior lastClutSetting; + UInt8 __reservedC; + + bool consoleDevice; + UInt32 powerState; + UInt32 ndrvState; + SInt32 ndrvEnter; + OSArray * detailedTimings; + UInt32 detailedTimingsSeed; + UInt32 * detailedTimingsCurrent; + + IODeviceMemory * vramMemory; + + VDResolutionInfoRec cachedVDResolution; + + struct _VSLService * vslServices; + + UInt32 accessFlags; + unsigned int shouldDoI2CPower:1; + unsigned int online:1; + unsigned int avJackState:1; + unsigned int grayMode:1; + unsigned int platformSleep:1; + unsigned int forceReadEDID:1; + unsigned int supportsProbe:1; + unsigned int __reservedB:25; + + IOService * fDevice; + + UInt32 __reservedA[29]; + +private: + struct IONDRVFramebufferPrivate * __private; + +public: + virtual IOReturn doDriverIO( UInt32 commandID, void * contents, + UInt32 commandCode, UInt32 commandKind ); +private: + OSMetaClassDeclareReservedUsed(IONDRVFramebuffer, 0); + + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 1); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 2); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 3); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 4); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 5); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 6); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 7); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 8); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 9); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 10); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 11); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 12); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 13); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 14); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 15); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 16); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 17); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 18); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 19); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 20); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 21); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 22); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 23); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 24); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 25); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 26); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 27); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 28); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 29); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 30); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 31); + +private: + + void initForPM ( void ); + + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags domainState ) APPLE_KEXT_OVERRIDE; + virtual unsigned long initialPowerStateForDomainState( IOPMPowerFlags domainState ) APPLE_KEXT_OVERRIDE; + virtual unsigned long powerStateForDomainState( IOPMPowerFlags domainState ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn checkDriver( void ); + virtual UInt32 iterateAllModes( IODisplayModeID * displayModeIDs ); + virtual IOReturn getResInfoForMode( IODisplayModeID modeID, + IODisplayModeInformation * theInfo ); + virtual IOReturn getResInfoForArbMode( IODisplayModeID modeID, + IODisplayModeInformation * theInfo ); + IOReturn getResInfoForDetailed( IODisplayModeID modeID, + VDDetailedTimingRec * detailed, + IODisplayModeInformation * info ); + IOIndex mapDepthIndex( IODisplayModeID modeID, IOIndex depth, bool fromDepthMode ); + virtual IOReturn validateDisplayMode( + IODisplayModeID mode, IOOptionBits flags, + VDDetailedTimingRec ** detailed ); + virtual IOReturn setDetailedTiming( + IODisplayModeID mode, IOOptionBits options, + void * description, IOByteCount descripSize ); + virtual void getCurrentConfiguration( void ); + static const IOTVector * _undefinedSymbolHandler( void * obj, + const char * libraryName, const char * symbolName ); + static bool _videoJackStateChangeHandler( void * target, void * ref, + IOService * newService, IONotifier * notifier ); + static void _avProbeAction( OSObject * p0, IOTimerEventSource * evtSrc ); + void displayI2CPower( bool enable ); + IOReturn ndrvSetPowerState( UInt32 newState ); + IOReturn ndrvUpdatePowerState( void ); + IOReturn ndrvSetDisplayPowerState( UInt32 newState ); + static IOReturn _probeAction( IONDRVFramebuffer * fb, IOOptionBits options ); + bool searchOfflineMode( IODisplayModeID * offlineMode ); + IOReturn processConnectChange( uintptr_t * value ); + IOReturn setMirror( IONDRVFramebuffer * other ); + IOReturn setConnectionFlags( void ); + bool getOnlineState( void ); + IOReturn ndrvGetSetFeature( UInt32 feature, uintptr_t newValue, uintptr_t * currentValue ); + static IOReturn _doControl( IONDRVFramebuffer * fb, UInt32 code, void * params ); + static IOReturn _doStatus( IONDRVFramebuffer * fb, UInt32 code, void * params ); + static IOReturn extControl( OSObject * owner, void * code, void * params ); + static IOReturn extStatus( OSObject * owner, void * code, void * params ); + IOReturn createI2C( void ); + void setInfoProperties( void ); + +public: + virtual IOReturn doControl( UInt32 code, void * params ); + virtual IOReturn doStatus( UInt32 code, void * params ); + +public: + + virtual IOService * probe( IOService * provider, + SInt32 * score ) APPLE_KEXT_OVERRIDE; + + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual void free( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn requestProbe( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn enableController( void ) APPLE_KEXT_OVERRIDE; + + virtual IODeviceMemory * makeSubRange( IOPhysicalAddress64 start, + IOPhysicalLength64 length ); + virtual IODeviceMemory * getApertureRange( IOPixelAperture aperture ) APPLE_KEXT_OVERRIDE; + virtual IODeviceMemory * getVRAMRange( void ) APPLE_KEXT_OVERRIDE; + + virtual IODeviceMemory * findVRAM( void ); + + virtual bool isConsoleDevice( void ) APPLE_KEXT_OVERRIDE; + + virtual const IOTVector * undefinedSymbolHandler( const char * libraryName, + const char * symbolName ); + + virtual const char * getPixelFormats( void ) APPLE_KEXT_OVERRIDE; + + // Array of supported display modes + virtual IOItemCount getDisplayModeCount( void ) APPLE_KEXT_OVERRIDE; + virtual IOReturn getDisplayModes( IODisplayModeID * allDisplayModes ) APPLE_KEXT_OVERRIDE; + + // Info about a display mode + virtual IOReturn getInformationForDisplayMode( IODisplayModeID displayMode, + IODisplayModeInformation * info ) APPLE_KEXT_OVERRIDE; + + // Mask of pixel formats available in mode and depth + virtual UInt64 getPixelFormatsForDisplayMode( IODisplayModeID displayMode, + IOIndex depth ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn getPixelInformation( + IODisplayModeID displayMode, IOIndex depth, + IOPixelAperture aperture, IOPixelInformation * pixelInfo ) APPLE_KEXT_OVERRIDE; + + // Framebuffer info + + virtual IOReturn setupForCurrentConfig( void ) APPLE_KEXT_OVERRIDE; + + // Current display mode and depth + virtual IOReturn getCurrentDisplayMode( IODisplayModeID * displayMode, + IOIndex * depth ) APPLE_KEXT_OVERRIDE; + + // Set display mode and depth + virtual IOReturn setDisplayMode( IODisplayModeID displayMode, + IOIndex depth ) APPLE_KEXT_OVERRIDE; + + // For pages + virtual IOReturn setApertureEnable( IOPixelAperture aperture, + IOOptionBits enable ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setStartupDisplayMode( IODisplayModeID displayMode, + IOIndex depth ) APPLE_KEXT_OVERRIDE; + virtual IOReturn getStartupDisplayMode( IODisplayModeID * displayMode, + IOIndex * depth ) APPLE_KEXT_OVERRIDE; + + //// CLUTs + + virtual IOReturn setCLUTWithEntries( IOColorEntry * colors, UInt32 index, + UInt32 numEntries, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + //// Gamma + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13 + virtual IOReturn setGammaTable( UInt32 channelCount, UInt32 dataCount, + UInt32 dataWidth, void * data, bool syncToVBL ) APPLE_KEXT_OVERRIDE; +#endif + + virtual IOReturn setGammaTable( UInt32 channelCount, UInt32 dataCount, + UInt32 dataWidth, void * data ) APPLE_KEXT_OVERRIDE; + + //// Display mode timing information + + virtual IOReturn getTimingInfoForDisplayMode( IODisplayModeID displayMode, + IOTimingInformation * info ) APPLE_KEXT_OVERRIDE; + + //// Detailed timing information + + virtual IOReturn validateDetailedTiming( + void * description, IOByteCount descripSize ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setDetailedTimings( OSArray * array ) APPLE_KEXT_OVERRIDE; + + //// Controller attributes + + virtual IOReturn setAttribute( IOSelect attribute, uintptr_t value ) APPLE_KEXT_OVERRIDE; + virtual IOReturn getAttribute( IOSelect attribute, uintptr_t * value ) APPLE_KEXT_OVERRIDE; + + //// Connections + + virtual IOItemCount getConnectionCount( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn getAttributeForConnection( IOIndex connectIndex, + IOSelect attribute, uintptr_t * value ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setAttributeForConnection( IOIndex connectIndex, + IOSelect attribute, uintptr_t info ) APPLE_KEXT_OVERRIDE; + + // Apple sensing + + virtual IOReturn getAppleSense( IOIndex connectIndex, + UInt32 * senseType, + UInt32 * primary, + UInt32 * extended, + UInt32 * displayType ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn connectFlags( IOIndex connectIndex, + IODisplayModeID displayMode, IOOptionBits * flags ) APPLE_KEXT_OVERRIDE; + + //// IOHighLevelDDCSense + + virtual bool hasDDCConnect( IOIndex connectIndex ) APPLE_KEXT_OVERRIDE; + virtual IOReturn getDDCBlock( IOIndex connectIndex, UInt32 blockNumber, + IOSelect blockType, IOOptionBits options, + UInt8 * data, IOByteCount * length ) APPLE_KEXT_OVERRIDE; + + //// Interrupts + + virtual IOReturn registerForInterruptType( IOSelect interruptType, + IOFBInterruptProc proc, OSObject * target, void * ref, + void ** interruptRef ) APPLE_KEXT_OVERRIDE; + virtual IOReturn unregisterInterrupt( void * interruptRef ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setInterruptState( void * interruptRef, UInt32 state ) APPLE_KEXT_OVERRIDE; + + //// HW Cursors + + virtual IOReturn setCursorImage( void * cursorImage ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setCursorState( SInt32 x, SInt32 y, bool visible ) APPLE_KEXT_OVERRIDE; + + //// I2C calls + + virtual IOReturn doI2CRequest( UInt32 bus, IOI2CBusTiming * timing, IOI2CRequest * request ) APPLE_KEXT_OVERRIDE; + + //// VSL calls + + static OSStatus VSLNewInterruptService( + void * entryID, + UInt32 serviceType, + _VSLService ** serviceID ); + static OSStatus VSLDisposeInterruptService( _VSLService * serviceID ); + static OSStatus VSLDoInterruptService( _VSLService * serviceID ); + static Boolean VSLPrepareCursorForHardwareCursor( + void * cursorRef, + IOHardwareCursorDescriptor * hwDesc, + IOHardwareCursorInfo * hwCursorInfo ); +}; + +#endif /* ! _IOKIT_IONDRVFRAMEBUFFER_H */ + + diff --git a/QualcommWireless/include/IOKit/ndrvsupport/IONDRVLibraries.h b/QualcommWireless/include/IOKit/ndrvsupport/IONDRVLibraries.h new file mode 100644 index 0000000..3d4b8d3 --- /dev/null +++ b/QualcommWireless/include/IOKit/ndrvsupport/IONDRVLibraries.h @@ -0,0 +1,376 @@ + +#ifndef __IONDRVLIBRARIES__ +#define __IONDRVLIBRARIES__ + +#include +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/* NameRegistry error codes */ +enum { + nrLockedErr = -2536, + nrNotEnoughMemoryErr = -2537, + nrInvalidNodeErr = -2538, + nrNotFoundErr = -2539, + nrNotCreatedErr = -2540, + nrNameErr = -2541, + nrNotSlotDeviceErr = -2542, + nrDataTruncatedErr = -2543, + nrPowerErr = -2544, + nrPowerSwitchAbortErr = -2545, + nrTypeMismatchErr = -2546, + nrNotModifiedErr = -2547, + nrOverrunErr = -2548, + nrResultCodeBase = -2549, + nrPathNotFound = -2550, /* a path component lookup failed */ + nrPathBufferTooSmall = -2551, /* buffer for path is too small */ + nrInvalidEntryIterationOp = -2552, /* invalid entry iteration operation */ + nrPropertyAlreadyExists = -2553, /* property already exists */ + nrIterationDone = -2554, /* iteration operation is done */ + nrExitedIteratorScope = -2555, /* outer scope of iterator was exited */ + nrTransactionAborted = -2556, /* transaction was aborted */ + + gestaltUndefSelectorErr = -5551 /*undefined selector was passed to Gestalt*/ +}; + +enum { + kNVRAMProperty = 0x00000020, // matches NR +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef _IOKIT_IOSERVICE_H +typedef struct IOService IOService; +#endif + +IOReturn _IONDRVLibrariesInitialize( IOService * provider ); +IOReturn _IONDRVLibrariesFinalize( IOService * provider ); + +#ifndef kAAPLRegEntryIDKey +#define kAAPLRegEntryIDKey "AAPL,RegEntryID" +#endif + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/******************************************************************************* + * + * Foundation Types + * + */ +/* Value of a property */ +typedef void * RegPropertyValue; +/* Length of property value */ +typedef UInt32 RegPropertyValueSize; + +/*******************************************************************************/ + +/******************************************************************************* + * + * Root Entry Name Definitions (Applies to all Names in the RootNameSpace) + * + * + Names are a colon-separated list of name components. Name components + * may not themselves contain colons. + * + Names are presented as null-terminated ASCII character strings. + * + Names follow similar parsing rules to Apple file system absolute + * and relative paths. However the '::' parent directory syntax is + * not currently supported. + */ +/* Max length of Entry Name */ +enum { + kRegCStrMaxEntryNameLength = 47 +}; + +/* Entry Names are single byte ASCII */ +typedef char RegCStrEntryName; +typedef char * RegCStrEntryNamePtr; +/* length of RegCStrEntryNameBuf = kRegCStrMaxEntryNameLength+1*/ +typedef char RegCStrEntryNameBuf[48]; +typedef char RegCStrPathName; +typedef UInt32 RegPathNameSize; +enum { + kRegPathNameSeparator = ':', /* 0x3A */ + kRegEntryNameTerminator = 0x00, /* '\0' */ + kRegPathNameTerminator = 0x00 /* '\0' */ +}; + +/******************************************************************************* + * + * Property Name and ID Definitions + * (Applies to all Properties Regardless of NameSpace) + */ +enum { + kRegMaximumPropertyNameLength = 31, /* Max length of Property Name */ + kRegPropertyNameTerminator = 0x00 /* '\0' */ +}; + +typedef char RegPropertyNameBuf[32]; +typedef char RegPropertyName; +typedef char * RegPropertyNamePtr; +enum { + kRegMaxPropertyNameLength = kRegMaximumPropertyNameLength +}; + +/******************************************************************************* + * + * Iteration Operations + * + * These specify direction when traversing the name relationships + */ +typedef UInt32 RegIterationOp; +typedef RegIterationOp RegEntryIterationOp; +enum { + /* Absolute locations*/ + kRegIterRoot = 0x00000002, /* "Upward" Relationships */ + kRegIterParents = 0x00000003, /* include all parent(s) of entry */ + /* "Downward" Relationships*/ + kRegIterChildren = 0x00000004, /* include all children */ + kRegIterSubTrees = 0x00000005, /* include all sub trees of entry */ + kRegIterDescendants = 0x00000005, /* include all descendants of entry */ + /* "Horizontal" Relationships */ + kRegIterSibling = 0x00000006, /* include all siblings */ + /* Keep doing the same thing*/ + kRegIterContinue = 0x00000001 +}; + +/******************************************************************************* + * + * Name Entry and Property Modifiers + * + * + * + * Modifiers describe special characteristics of names + * and properties. Modifiers might be supported for + * some names and not others. + * + * Device Drivers should not rely on functionality + * specified as a modifier. + */ +typedef UInt32 RegModifiers; +typedef RegModifiers RegEntryModifiers; +typedef RegModifiers RegPropertyModifiers; +enum { + kRegNoModifiers = 0x00000000, /* no entry modifiers in place */ + kRegUniversalModifierMask = 0x0000FFFF, /* mods to all entries */ + kRegNameSpaceModifierMask = 0x00FF0000, /* mods to all entries within namespace */ + kRegModifierMask = (RegModifiers)0xFF000000 /* mods to just this entry */ +}; + +/* Universal Property Modifiers */ +enum { + kRegPropertyValueIsSavedToNVRAM = 0x00000020, /* property is non-volatile (saved in NVRAM) */ + kRegPropertyValueIsSavedToDisk = 0x00000040 /* property is non-volatile (saved on disk) */ +}; + +typedef size_t Size; + +#ifndef _IOKIT_IOREGISTRYENTRY_H +typedef struct IORegistryIterator IORegistryIterator; +typedef struct OSIterator OSIterator; +#endif /* _IOKIT_IOREGISTRYENTRY_H */ +typedef IORegistryIterator * RegEntryIter; +typedef OSIterator * RegPropertyIter; + +OSStatus RegistryEntryIDCopy( const RegEntryID * entryID, RegEntryID * to ); + +OSStatus RegistryEntryIDInit( RegEntryID * entryID ); + +Boolean RegistryEntryIDCompare( const RegEntryID * id1, const RegEntryID * id2); + +OSStatus RegistryPropertyGetSize( + const RegEntryID * entryID, + const RegPropertyName * propertyName, + RegPropertyValueSize * propertySize); + +OSStatus RegistryPropertyGet( + const RegEntryID * entryID, + const RegPropertyName * propertyName, + void * propertyValue, + RegPropertyValueSize * propertySize); + +OSStatus RegistryPropertyCreate( + const RegEntryID * entryID, + const RegPropertyName * propertyName, + const void * propertyValue, + RegPropertyValueSize propertySize); + +OSStatus RegistryPropertyDelete( + const RegEntryID * entryID, + const RegPropertyName * propertyName); + +OSStatus RegistryPropertySet( + const RegEntryID * entryID, + const RegPropertyName * propertyName, + const void * propertyValue, + RegPropertyValueSize propertySize); + +OSStatus RegistryPropertyGetMod( + const RegEntryID * entry, + const RegPropertyName * name, + RegPropertyModifiers * modifiers); + +OSStatus RegistryPropertySetMod( + const RegEntryID * entry, + const RegPropertyName * name, + RegPropertyModifiers modifiers); + +OSStatus RegistryPropertyIterateCreate( + const RegEntryID * entry, + RegPropertyIter * cookie); + +OSStatus RegistryPropertyIterateDispose( RegPropertyIter * cookie); + +OSStatus RegistryPropertyIterate( + RegPropertyIter * cookie, + RegPropertyName * foundProperty, + Boolean * done); + +OSStatus RegistryEntryIterateCreate( RegEntryIter * cookie); + +OSStatus RegistryEntryIterateDispose( RegEntryIter * cookie); + +OSStatus RegistryEntryIterate( RegEntryIter * cookie, + RegEntryIterationOp relationship, + RegEntryID * foundEntry, + Boolean * done); + +OSStatus RegistryCStrEntryToName( const RegEntryID * entryID, + RegEntryID * parentEntry, + RegCStrEntryName * nameComponent, + Boolean * done ); + +OSStatus RegistryCStrEntryLookup( const RegEntryID * parentEntry, + const RegCStrPathName * path, + RegEntryID * newEntry); + +OSStatus RegistryEntryIDDispose(RegEntryID * entryID); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +enum { + paramErr = -50, /*error in user parameter list*/ + noHardwareErr = -200, /*Sound Manager Error Returns*/ + notEnoughHardwareErr = -201, /*Sound Manager Error Returns*/ + userCanceledErr = -128, + qErr = -1, /*queue element not found during deletion*/ + vTypErr = -2, /*invalid queue element*/ + corErr = -3, /*core routine number out of range*/ + unimpErr = -4, /*unimplemented core routine*/ + SlpTypeErr = -5, /*invalid queue element*/ + seNoDB = -8, /*no debugger installed to handle debugger command*/ + controlErr = -17, /*I/O System Errors*/ + statusErr = -18, /*I/O System Errors*/ + readErr = -19, /*I/O System Errors*/ + writErr = -20, /*I/O System Errors*/ + badUnitErr = -21, /*I/O System Errors*/ + unitEmptyErr = -22, /*I/O System Errors*/ + openErr = -23, /*I/O System Errors*/ + closErr = -24, /*I/O System Errors*/ + dRemovErr = -25, /*tried to remove an open driver*/ + dInstErr = -26, /*DrvrInstall couldn't find driver in resources*/ + + badCksmErr = -69, /*addr mark checksum didn't check*/ +}; +enum { + durationMicrosecond = -1, /* Microseconds are negative*/ + durationMillisecond = 1, /* Milliseconds are positive*/ + durationSecond = 1000, /* 1000 * durationMillisecond*/ + durationMinute = 60000, /* 60 * durationSecond,*/ + durationHour = 3600000, /* 60 * durationMinute,*/ + durationDay = 86400000, /* 24 * durationHour,*/ + durationNoWait = 0, /* don't block*/ + durationForever = 0x7FFFFFFF /* no time limit*/ +}; +#ifndef NULL + #if !defined(__cplusplus) && (defined(__SC__) || defined(THINK_C)) + /* Symantec C compilers (but not C++) want NULL and nil to be (void*)0 */ + #define NULL ((void *) 0) + #else + /* in case int is 16-bits, make sure NULL is 32-bits */ + #define NULL 0L + #endif +#endif + +#ifndef nil + #define nil NULL +#endif + +enum { + clutType = 0, /*0 if lookup table*/ + fixedType = 1, /*1 if fixed table*/ + directType = 2, /*2 if direct values*/ + RGBDirect = 16 /* 16 & 32 bits/pixel pixelType value */ +}; +typedef UInt32 * UInt32Ptr; + +typedef struct IOHardwareCursorDescriptor HardwareCursorDescriptorRec; +typedef HardwareCursorDescriptorRec * HardwareCursorDescriptorPtr; +typedef struct IOHardwareCursorInfo HardwareCursorInfoRec; +typedef HardwareCursorInfoRec * HardwareCursorInfoPtr; + +typedef ResType InterruptServiceType; +typedef struct _VSLService * InterruptServiceIDType; +typedef InterruptServiceIDType * InterruptServiceIDPtr; + +enum { + kVBLInterruptServiceType = 'vbl ', + kHBLInterruptServiceType = 'hbl ', + kFrameInterruptServiceType = 'fram', + kConnectInterruptServiceType = 'dci ', /* Renamed -- Use kFBCheckInterruptServiceType*/ + kFBConnectInterruptServiceType = kConnectInterruptServiceType, /* Demand to check configuration (Hardware unchanged)*/ + kFBChangedInterruptServiceType = 'chng', /* Demand to rebuild (Hardware has reinitialized on dependent change)*/ + kFBOfflineInterruptServiceType = 'remv', /* Demand to remove framebuffer (Hardware not available on dependent change -- but must not buserror)*/ + kFBOnlineInterruptServiceType = 'add ' /* Notice that hardware is available (after being removed)*/ +}; + +enum { + kVSLClamshellStateGestaltType = 'clam', +}; + +OSErr +VSLNewInterruptService( + RegEntryID * serviceDevice, + InterruptServiceType serviceType, + InterruptServiceIDPtr serviceID); + +OSErr +VSLDisposeInterruptService(InterruptServiceIDType serviceID); + +OSErr +VSLDoInterruptService(InterruptServiceIDType serviceID); + +Boolean +VSLPrepareCursorForHardwareCursor( + void * cursorRef, + IOHardwareCursorDescriptor * hardwareDescriptor, + IOHardwareCursorInfo * hwCursorInfo); + + +enum { + /* Version Release Stage Codes */ + developStage = 0x20, + alphaStage = 0x40, + betaStage = 0x60, + finalStage = 0x80 +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +typedef struct OpaqueIOCommandID* IOCommandID; + +typedef UInt32 IOCommandKind; +typedef UInt32 IOCommandCode; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifdef __cplusplus +} +#endif + +#endif /* __IONDRVLIBRARIES__ */ + diff --git a/QualcommWireless/include/IOKit/ndrvsupport/IONDRVSupport.h b/QualcommWireless/include/IOKit/ndrvsupport/IONDRVSupport.h new file mode 100644 index 0000000..f2702bc --- /dev/null +++ b/QualcommWireless/include/IOKit/ndrvsupport/IONDRVSupport.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IONDRVSUPPORT__ +#define __IONDRVSUPPORT__ + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +#define kIONDRVIgnoreKey "AAPL,iokit-ignore-ndrv" +#define kIONDRVForXKey "AAPL,iokit-ndrv" + + +struct IOTVector { + void * pc; + UInt32 toc; +}; +typedef struct IOTVector IOTVector; + +#ifdef __cplusplus +} +#endif + +#endif /* __IONDRVSUPPORT__ */ diff --git a/QualcommWireless/include/IOKit/network/IOBasicOutputQueue.h b/QualcommWireless/include/IOKit/network/IOBasicOutputQueue.h new file mode 100644 index 0000000..f568224 --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IOBasicOutputQueue.h @@ -0,0 +1,354 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOBASICOUTPUTQUEUE_H +#define _IOBASICOUTPUTQUEUE_H + +#include +#include +#include + +struct IOMbufQueue; + +/*! @class IOBasicOutputQueue + @abstract A concrete implementation of an IOOutputQueue. + @discussion This object uses a mutex to protect the packet queue from + multiple producers. + A single producer is promoted to become a consumer when the queue is + not active. Otherwise, the producer will simply queue the packet and + return without blocking. + + The flow of packets from the queue to its target can be controlled + by calling methods such as start(), stop(), or service(). The target + is expected to call those methods from a single threaded context, + i.e. the work loop context in a network driver. In addition, the + target must also return a status for every packet delivered by the + consumer thread. This return value is the only mechanism that the + target can use to manage the queue when it is running on the + consumer thread. +*/ + +class IOBasicOutputQueue : public IOOutputQueue +{ + OSDeclareDefaultStructors( IOBasicOutputQueue ) + +private: + static IOReturn dispatchNetworkDataNotification(void * target, + void * param, + IONetworkData * data, + UInt32 type); + + void dequeue(); + +protected: + OSObject * _target; + IOOutputAction _action; + UInt32 _priorities; + IOOutputQueueStats * _stats; + IONetworkData * _statsData; + IOLock * _queueLock; + IOMbufQueue * _inQueues; + IOMbufQueue * _primaryQueues; + IOMbufQueue * _shadowQueues; + volatile bool _waitDequeueDone; + volatile UInt32 _state; + volatile UInt32 _serviceCount; + +/*! @function serviceThread + @abstract Provides an implementation for the serviceThread() method + defined in IOOutputQueue. + @discussion This method is called by the scheduled service thread when it + starts to run. The service thread is scheduled by service() + to restart a stalled queue when the kServiceAsync option is given. + @param param A parameter that was given to scheduleServiceThread(). + This parameter is not used. +*/ + + virtual void serviceThread(void * param) APPLE_KEXT_OVERRIDE; + +/*! @function output + @abstract Transfers all packets in the mbuf queue to the target. + @param queue A queue of output packets. + @param state Returns a state bit defined by IOBasicOutputQueue that + declares the new state of the queue following this method call. + A kStateStalled is returned if the queue should stall, otherwise 0 + is returned. +*/ + + virtual void output(IOMbufQueue * queue, UInt32 * state); + +/*! @function free + @abstract Frees the IOBasicOutputQueue object. + @discussion This function releases allocated resources, then call super::free(). +*/ + + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! @function handleNetworkDataAccess + @abstract Handles an external access to the IONetworkData object + returned by getStatisticsData(). + @param data The IONetworkData object being accessed. + @param type Description of the type of access being performed. + @param param An optional parameter for the handler. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn handleNetworkDataAccess(IONetworkData * data, + UInt32 type, + void * param); + +public: + +/*! @function init + @abstract Initializes an IOBasicOutputQueue object. + @param target The object that will handle packets removed from the + queue, which is usually a subclass of IONetworkController. + @param action The function that will handle packets removed from the + queue. + @param capacity The initial capacity of the output queue. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool init(OSObject * target, + IOOutputAction action, + UInt32 capacity = 0, + UInt32 priorities = 1); + +/*! @function withTarget + @abstract Factory method that constructs and initializes an + IOBasicOutputQueue object. + @param target An IONetworkController object that will handle packets + removed from the queue. + @param capacity The initial capacity of the output queue. + @result Returns an IOBasicOutputQueue object on success, or 0 otherwise. +*/ + + static IOBasicOutputQueue * withTarget(IONetworkController * target, + UInt32 capacity = 0); + + /*! @function withTarget + @abstract Factory method that constructs and initializes an + IOBasicOutputQueue object. + @param target An IONetworkController object that will handle packets + removed from the queue. + @param capacity The initial capacity of the output queue. + @param priorities The number of traffic priorities supported + @result Returns an IOBasicOutputQueue object on success, or 0 otherwise. + */ + + static IOBasicOutputQueue * withTarget(IONetworkController * target, + UInt32 capacity, + UInt32 priorities); + +/*! @function withTarget + @abstract Factory method that constructs and initializes an + IOBasicOutputQueue object. + @param target The object that will handle packets removed from the + queue. + @param action The function that will handle packets removed from the + queue. + @param capacity The initial capacity of the output queue. + @result Returns an IOBasicOutputQueue object on success, or 0 otherwise. +*/ + + static IOBasicOutputQueue * withTarget(OSObject * target, + IOOutputAction action, + UInt32 capacity = 0); + + /*! @function withTarget + @abstract Factory method that constructs and initializes an + IOBasicOutputQueue object. + @param target The object that will handle packets removed from the + queue. + @param action The function that will handle packets removed from the + queue. + @param capacity The initial capacity of the output queue. + @param priorities The number of traffic priorities supported + @result Returns an IOBasicOutputQueue object on success, or 0 otherwise. + */ + + static IOBasicOutputQueue * withTarget(OSObject * target, + IOOutputAction action, + UInt32 capacity, + UInt32 priorities); + +/*! @function enqueue + @abstract Adds a packet, or a chain of packets, + to the queue. + @discussion This method is called by a client to add a packet, or a chain of packets, + to the queue. A packet is described by an mbuf chain, while a chain + of packets is constructed by linking multiple mbuf chains via the + m_nextpkt field. This method can be called by multiple client + threads. + @param m A single packet, or a chain of packets. + @param param A parameter provided by the caller. + @result Always returns 0. +*/ + + virtual UInt32 enqueue(mbuf_t m, void * param) APPLE_KEXT_OVERRIDE; + +/*! @function start + @abstract Starts up the packet flow between the queue and its target. + @discussion Called by the target to start the queue. This will allow + packets to be removed from the queue, and then delivered to the target. + @result Returns true if the queue was started successfully, false otherwise. */ + + virtual bool start() APPLE_KEXT_OVERRIDE; + +/*! @function stop + @abstract Stops the packet flow between the queue and its target. + @discussion This method stops the queue and prevents it from sending packets to its + target. This call is synchronous and it may block. After this method + returns, the queue will no longer call the registered target/action, + even as new packets are added to the queue. The queue will continue to + absorb new packets until the size of the queue reaches its capacity. + The registered action must never call stop(), or a deadlock will occur. + @result Returns the previous running state of the queue, + true if the queue was running, false if the queue was already stopped. +*/ + + virtual bool stop() APPLE_KEXT_OVERRIDE; + +/*! @enum ServiceAsync + @abstract The option bits recognized by service(). + @constant kServiceAsync Set this option to service the queue in + an asynchronous manner. The service() call will not block, but a + scheduling latency will be introduced before the queue is serviced. +*/ + + enum { + kServiceAsync = 0x1 + }; + +/*! @function service + @abstract Services a queue that was stalled by the target. + @discussion A target that stalls the queue must call service() when + it becomes ready to accept more packets. Calling this method when the + queue is not stalled is harmless. + @result Returns true if the queue was stalled and there were packets sitting in + the queue awaiting delivery, false otherwise. +*/ + + virtual bool service(IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + +/*! @function flush + @abstract Drops and frees all packets currently held by the queue. + @discussion To ensure that all packets are removed from the queue, + stop() should be called prior to flush(), to make sure there are + no packets in-flight and being delivered to the target. + @result Returns the number of packets that were dropped and freed. +*/ + + virtual UInt32 flush() APPLE_KEXT_OVERRIDE; + +/*! @function setCapacity + @abstract Changes the number of packets that the queue can hold + before it begins to drop excess packets. + @param capacity The new desired capacity. + @result Returns true if the new capacity was accepted, false otherwise. +*/ + + virtual bool setCapacity(UInt32 capacity) APPLE_KEXT_OVERRIDE; + +/*! @function getCapacity + @abstract Gets the number of packets that the queue can hold. + @discussion The queue will begin to drop incoming packets when the + size of the queue reaches its capacity. + @result Returns the current queue capacity. +*/ + + virtual UInt32 getCapacity() const APPLE_KEXT_OVERRIDE; + +/*! @function getSize + @abstract Gets the number of packets currently held in the queue. + @result Returns the size of the queue. +*/ + + virtual UInt32 getSize() const APPLE_KEXT_OVERRIDE; + +/*! @function getDropCount + @abstract Gets the number of packets dropped by the queue. + @result Returns the number of packets dropped due to over-capacity, or by + external calls to the flush() method. +*/ + + virtual UInt32 getDropCount(); + +/*! @function getOutputCount + @abstract Gets the number of packets accepted by the target. + @result Returns the number of times that kIOOutputStatusAccepted is returned by + the target. +*/ + + virtual UInt32 getOutputCount(); + +/*! @function getRetryCount + @abstract Gets the number of instances when the target has refused to + accept the packet provided. + @result Returns the number of times that kIOOutputStatusRetry is returned by the + target. +*/ + + virtual UInt32 getRetryCount(); + +/*! @function getStallCount + @abstract Gets the number of instances when the target has stalled the + queue. + @result Returns the number of times that kIOOutputCommandStall is returned by the + target. +*/ + + virtual UInt32 getStallCount(); + +/*! @enum GetStateBits + @abstract The bits in the value returned by getState(). + @constant kStateRunning Set when the queue is running. Calling start() + and stop() will set or clear this bit. + @constant kStateStalled Set when the queue is stalled by the target. + @constant kStateActive Set when a consumer thread is actively removing + packets from the queue and passing them to the target. +*/ + + enum { + kStateRunning = 0x1, + kStateOutputStalled = 0x2, + kStateOutputActive = 0x4, + kStateOutputServiceMask = 0xff00 + }; + +/*! @function getState + @abstract Gets the state of the queue object. + @result Returns the current state of the queue object. +*/ + + virtual UInt32 getState() const; + +/*! @function getStatisticsData + @abstract Returns an IONetworkData object containing statistics counters + updated by the queue. + @result Returns an IONetworkData object. +*/ + + virtual IONetworkData * getStatisticsData() const APPLE_KEXT_OVERRIDE; +}; + +#endif /* !_IOBASICOUTPUTQUEUE_H */ diff --git a/QualcommWireless/include/IOKit/network/IOEthernetController.h b/QualcommWireless/include/IOKit/network/IOEthernetController.h new file mode 100644 index 0000000..72b4600 --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IOEthernetController.h @@ -0,0 +1,1226 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOETHERNETCONTROLLER_H +#define _IOETHERNETCONTROLLER_H + +#include +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +#ifndef APPLE_KEXT_DEPRECATE +#define APPLE_KEXT_DEPRECATE +#endif + +/*! @defined kIOEthernetControllerClass + @abstract kIOEthernetControllerClass is the name of the + IOEthernetController class. */ + +#define kIOEthernetControllerClass "IOEthernetController" + +/*! @defined kIOEthernetAddressSize + @abstract The number of bytes in an Ethernet hardware address. */ + +#define kIOEthernetAddressSize 6 + +/*! @defined kIOEthernetMaxPacketSize + @abstract The maximum size of an Ethernet packet, including + the FCS bytes. */ + +#define kIOEthernetMaxPacketSize 1518 + +/*! @defined kIOEthernetMinPacketSize + @abstract The minimum size of an Ethernet packet, including + the FCS bytes. */ + +#define kIOEthernetMinPacketSize 64 + +/*! @defined kIOEthernetCRCSize + @abstract The size in bytes of the 32-bit CRC value appended + to the end of each Ethernet frame. */ + +#define kIOEthernetCRCSize 4 + +/*! @defined kIOEthernetWakeOnLANFilterGroup + @abstract kIOEthernetWakeOnLANFilterGroup describes the name assigned + to the Ethernet Wake-On-LAN filter group. This group represents + wake filters that are supported by the controller. */ + +#define kIOEthernetWakeOnLANFilterGroup "IOEthernetWakeOnLANFilterGroup" + +/*! @defined kIOEthernetDisabledWakeOnLANFilterGroup + @abstract kIOEthernetDisabledWakeOnLANFilterGroup describes the name + assigned to the disabled Ethernet Wake-On-LAN filter group. This + group represents wake filters that are currently disabled. + Membership in this group is dynamic. */ + +#define kIOEthernetDisabledWakeOnLANFilterGroup \ + "IOEthernetDisabledWakeOnLANFilterGroup" + +/*! @enum Wake On LAN Filters + @abstract All filters in the Wake-on-LAN filter group. + @discussion Each filter listed will respond to a network event that + will trigger a system wake-up. + @constant kIOEthernetWakeOnMagicPacket Reception of a Magic Packet. + @constant kIOEthernetWakeOnPacketAddressMatch Reception of a packet + which passes through any of the address filtering mechanisms based + on its destination Ethernet address. This may include unicast, + broadcast, or multicast addresses depending on the current state + and setting of the corresponding packet filters. */ + +enum { + kIOEthernetWakeOnMagicPacket = 0x00000001, + kIOEthernetWakeOnPacketAddressMatch = 0x00000002 +}; + +#ifdef KERNEL +#ifdef __cplusplus + +struct IOEthernetAddress { + UInt8 bytes[kIOEthernetAddressSize]; +}; + +/*! @const gIOEthernetWakeOnLANFilterGroup + @discussion gIOEthernetWakeOnLANFilterGroup is an OSSymbol object + that contains the name of the Ethernet Wake-on-LAN filter group + defined by kIOEthernetWakeOnLANFilterGroup. */ + +extern const OSSymbol * gIOEthernetWakeOnLANFilterGroup; + +/*! @const gIOEthernetDisabledWakeOnLANFilterGroup + @discussion gIOEthernetDisabledWakeOnLANFilterGroup is an OSSymbol object + that contains the name of the disabled Ethernet Wake-on-LAN filter group + defined by kIOEthernetDisabledWakeOnLANFilterGroup. */ + +extern const OSSymbol * gIOEthernetDisabledWakeOnLANFilterGroup; + + +/*! @enum AVB Time Sync Support + @abstract The support that the controller has for Time Sync timestamping. + @discussion A controller can support ingress and egress timestamping of time sync packets + in a number of ways. + @const kIOEthernetControllerAVBTimeSyncSupportNone Controller does not support sending or + receiving packets with ingress and egress timestamping + @const kIOEthernetControllerAVBTimeSyncSupportHardware Controller supports sending and + receiving packets with ingress and egress timestamping and the timestamping is done in hardware + @const kIOEthernetControllerAVBTimeSyncSupportInterrupt Controller supports sending and receiving + packets with ingress and egress timestamping and the timestamping is done in the primary interrupt handler + @const kIOEthernetControllerAVBTimeSyncSupportSoftware Controller supports sending and receiving + packets with ingress and egress timestamping and the timestamping is done in software stack + (secondary interrupt handler or higher) +*/ +typedef enum +{ + kIOEthernetControllerAVBTimeSyncSupportNone, + kIOEthernetControllerAVBTimeSyncSupportHardware, + kIOEthernetControllerAVBTimeSyncSupportInterrupt, + kIOEthernetControllerAVBTimeSyncSupportSoftware, +} IOEthernetControllerAVBTimeSyncSupport; + + +/*! @enum Controller AVB States + @abstract The state the AVB support is in. + @discussion A controller can be in one of 4 states depending on the capabilities required by the AVB stack. + @const kIOEthernetControllerAVBStateDisabled No AVB streaming services or gPTP can run + @const kIOEthernetControllerAVBStateActivated No AVB streaming services and no gPTP but they can be + enabled, no media restrictions + @const kIOEthernetControllerAVBStateTimeSyncEnabled No AVB streaming services, time sync hardware + enabled so that gPTP can run, no media restrictions + @const kIOEthernetControllerAVBStateAVBEnabled AVB streams can run, media restrictions are in place +*/ +typedef enum +{ + kIOEthernetControllerAVBStateDisabled, + kIOEthernetControllerAVBStateActivated, + kIOEthernetControllerAVBStateTimeSyncEnabled, + kIOEthernetControllerAVBStateAVBEnabled, +} IOEthernetControllerAVBState; + +///Events to trigger changes of state +/*! @enum Controller AVB State Events + @abstract Events to trigger the change in AVB state of the controller. + @const kIOEthernetControllerAVBStateEventDisable Disable AVB support + @const kIOEthernetControllerAVBStateEventEnable Enable AVB support + @const kIOEthernetControllerAVBStateEventStartTimeSync Start using Time Sync services. + @const kIOEthernetControllerAVBStateEventStopTimeSync Stop using Time Sync services. + @const kIOEthernetControllerAVBStateEventStartStreaming Start using realtime streaming services. + @const kIOEthernetControllerAVBStateEventStopStreaming Stop using realtime streaming services. +*/ +typedef enum +{ + kIOEthernetControllerAVBStateEventDisable, + kIOEthernetControllerAVBStateEventEnable, + kIOEthernetControllerAVBStateEventStartTimeSync, + kIOEthernetControllerAVBStateEventStopTimeSync, + kIOEthernetControllerAVBStateEventStartStreaming, + kIOEthernetControllerAVBStateEventStopStreaming, +} IOEthernetControllerAVBStateEvent; + + +class IOTimeSyncEthernetInterfaceAdapter; + +/*! @class IOEthernetController + @abstract Abstract superclass for Ethernet controllers. + @discussion Ethernet controller drivers should subclass IOEthernetController, and implement + or override the hardware specific methods to create an Ethernet driver. + An interface object (an IOEthernetInterface instance) must be + instantiated by the driver, through attachInterface(), to connect + the controller driver to the data link layer. +*/ + +class APPLE_KEXT_DEPRECATE IOEthernetController : public IONetworkController +{ + OSDeclareAbstractStructors( IOEthernetController ) + +protected: + struct IOECTSCallbackEntry; + + struct ExpansionData { + IOEthernetControllerAVBTimeSyncSupport fTimeSyncSupport; + bool fRealtimeMulticastAllowed; + + IOMapper *fAVBPacketMapper; + + uint32_t fNumberOfRealtimeTransmitQueues; + uint64_t *fTransmitQueuePacketLatency; + uint64_t *fTransmitQueuePrefetchDelay; + + uint32_t fNumberOfRealtimeReceiveQueues; + + IOEthernetControllerAVBState fAVBControllerState; + int32_t fTimeSyncEnabled; + int32_t fAVBEnabled; + IOLock *fStateLock; + OSArray *fStateChangeNotifiers; + IOLock *fStateChangeNotifiersLock; + + OSArray *fTimeSyncReceiveHandlers; + IOLock *fTimeSyncReceiveHandlersLock; + OSArray *fTimeSyncTransmitHandlers; + IOLock *fTimeSyncTransmitHandlersLock; + uint32_t fNextTimeSyncTransmitCallbackID; + bool fHasTimeSyncTransmitCallbackIDAvailable; + + struct IOECTSCallbackEntry *fTimeSyncTransmitCallbackQueue; + IOLock *fTimeSyncTransmitCallbackQueueLock; + struct IOECTSCallbackEntry *fTimeSyncReceiveCallbackQueue; + IOLock *fTimeSyncReceiveCallbackQueueLock; + + bool fTimeSyncCallbackThreadShouldKeepRunning; + bool fTimeSyncCallbackThreadIsRunning; + thread_t fTimeSyncCallbackThread; + semaphore_t fTimeSyncCallbackStartSemaphore; + semaphore_t fTimeSyncCallbackStopSemaphore; + semaphore_t fTimeSyncCallbackQueueSemaphore; + uint64_t fTimeSyncCallbackTimeoutTime; + + bool fgPTPPresent; + }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + +public: + +/*! @function initialize + @abstract IOEthernetController class initializer. + @discussion Creates global OSSymbol objects that are used as keys. */ + + static void initialize(); + +/*! @function init + @abstract Initializes an IOEthernetController object. + @param properties A dictionary object containing a property table + associated with this instance. + @result Returns true on success, false otherwise. +*/ + + virtual bool init(OSDictionary * properties) APPLE_KEXT_OVERRIDE; + +/*! @function getPacketFilters + @abstract Gets the set of packet filters supported by the Ethernet + controller in the given filter group. + @discussion The default implementation of the abstract method inherited + from IONetworkController. When the filter group specified is + gIONetworkFilterGroup, then this method will return a value formed by + a bitwise OR of kIOPacketFilterUnicast, kIOPacketFilterBroadcast, + kIOPacketFilterMulticast, kIOPacketFilterPromiscuous. Otherwise, the + return value will be set to zero (0). Subclasses must override this + method if their filtering capability differs from what is reported by + this default implementation. This method is called from the workloop + context, and the result is published to the I/O Kit Registry. + @param group The name of the filter group. + @param filters Pointer to the mask of supported filters returned by + this method. + @result Returns kIOReturnSuccess. Drivers that override this + method must return kIOReturnSuccess to indicate success, or an error + return code otherwise. +*/ + + virtual IOReturn getPacketFilters(const OSSymbol * group, + UInt32 * filters) const APPLE_KEXT_OVERRIDE; + +/*! @function enablePacketFilter + @abstract Enables one of the supported packet filters from the + given filter group. + @discussion The default implementation of the abstract method inherited + from IONetworkController. This method will call setMulticastMode() or + setPromiscuousMode() when the multicast or the promiscuous filter is to be + enabled. Requests to disable the Unicast or Broadcast filters are handled + silently, without informing the subclass. Subclasses can override this + method to change this default behavior, or to extend it to handle + additional filter types or filter groups. This method call is synchronized + by the workloop's gate. + @param group The name of the filter group containing the filter to be + enabled. + @param aFilter The filter to enable. + @param enabledFilters All filters currently enabled by the client. + @param options Optional flags for the enable request. + @result Returns the value returned by setMulticastMode() or setPromiscuousMode() if + either of those two methods are called. Returns kIOReturnSuccess if the filter + specified is kIOPacketFilterUnicast or kIOPacketFilterBroadcast. + Returns kIOReturnUnsupported if the filter group specified is not + gIONetworkFilterGroup. +*/ + + virtual IOReturn enablePacketFilter(const OSSymbol * group, + UInt32 aFilter, + UInt32 enabledFilters, + IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + +/*! @function disablePacketFilter + @abstract Disables a packet filter that is currently enabled from the + given filter group. + @discussion The default implementation of the abstract method inherited + from IONetworkController. This method will call setMulticastMode() or + setPromiscuousMode() when the multicast or the promiscuous filter is to be + disabled. Requests to disable the Unicast or Broadcast filters are handled + silently, without informing the subclass. Subclasses can override this + method to change this default behavior, or to extend it to handle + additional filter types or filter groups. This method call is synchronized + by the workloop's gate. + @param group The name of the filter group containing the filter to be + disabled. + @param aFilter The filter to disable. + @param enabledFilters All filters currently enabled by the client. + @param options Optional flags for the disable request. + @result Returns the value returned by setMulticastMode() or setPromiscuousMode() if + either of those two methods are called. Returns kIOReturnSuccess if the filter + specified is kIOPacketFilterUnicast or kIOPacketFilterBroadcast. + Returns kIOReturnUnsupported if the filter group specified is not + gIONetworkFilterGroup. +*/ + + virtual IOReturn disablePacketFilter(const OSSymbol * group, + UInt32 aFilter, + UInt32 enabledFilters, + IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + +/*! @function getHardwareAddress + @abstract Gets the Ethernet controller's station address. + @discussion The default implementation of the abstract method inherited + from IONetworkController. This method will call the overloaded form + IOEthernetController::getHardwareAddress() that subclasses are expected + to override. + @param addr The buffer where the controller's hardware address should + be written. + @param inOutAddrBytes The size of the address buffer provided by the + client, and replaced by this method with the actual size of + the hardware address in bytes. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn getHardwareAddress(void * addr, + UInt32 * inOutAddrBytes) APPLE_KEXT_OVERRIDE; + +/*! @function setHardwareAddress + @abstract Sets or changes the station address used by the Ethernet + controller. + @discussion The default implementation of the abstract method inherited + from IONetworkController. This method will call the overloaded form + IOEthernetController::setHardwareAddress() that subclasses are expected + to override. + @param addr The buffer containing the hardware address provided by + the client. + @param addrBytes The size of the address buffer provided by the + client in bytes. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn setHardwareAddress(const void * addr, + UInt32 addrBytes) APPLE_KEXT_OVERRIDE; + +/*! @function getMaxPacketSize + @abstract Gets the maximum packet size supported by the Ethernet + controller, including the frame header and FCS. + @param maxSize Pointer to the return value. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn getMaxPacketSize(UInt32 * maxSize) const APPLE_KEXT_OVERRIDE; + +/*! @function getMinPacketSize + @abstract Gets the minimum packet size supported by the Ethernet + controller, including the frame header and FCS. + @param minSize Pointer to the return value. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn getMinPacketSize(UInt32 * minSize) const APPLE_KEXT_OVERRIDE; + +/*! @function getPacketFilters + @abstract Gets the set of packet filters supported by the Ethernet + controller in the network filter group. + @param filters Pointer to the return value containing a mask of + supported filters. + @result Returns kIOReturnSuccess. Drivers that override this + method must return kIOReturnSuccess to indicate success, or an error + return code otherwise. +*/ + + virtual IOReturn getPacketFilters(UInt32 * filters) const; + +/*! @function getHardwareAddress + @abstract Gets the Ethernet controller's permanent station address. + @discussion Ethernet drivers must implement this method, by reading the + address from hardware and writing it to the buffer provided. This method + is called from the workloop context. + @param addrP Pointer to an IOEthernetAddress where the hardware address + should be returned. + @result Returns kIOReturnSuccess on success, or an error return code otherwise. +*/ + + virtual IOReturn getHardwareAddress(IOEthernetAddress * addrP) = 0; + +/*! @function setHardwareAddress + @abstract Sets or changes the station address used by the Ethernet + controller. + @discussion This method is called in response to a client command to + change the station address used by the Ethernet controller. Implementation + of this method is optional. This method is called from the workloop context. + @param addrP Pointer to an IOEthernetAddress containing the new station + address. + @result The default implementation will always return kIOReturnUnsupported. + If overridden, drivers must return kIOReturnSuccess on success, or an error + return code otherwise. +*/ + + virtual IOReturn setHardwareAddress(const IOEthernetAddress * addrP); + +/*! @function setMulticastMode + @abstract Enables or disables multicast mode. + @discussion Called by enablePacketFilter() or disablePacketFilter() + when there is a change in the activation state of the multicast filter + identified by kIOPacketFilterMulticast. This method is called from the + workloop context. + @param active True to enable multicast mode, false to disable it. + @result Returns kIOReturnUnsupported. If overridden, drivers must return + kIOReturnSuccess on success, or an error return code otherwise. +*/ + + virtual IOReturn setMulticastMode(bool active); + +/*! @function setMulticastList + @abstract Sets the list of multicast addresses a multicast filter + should use to match against the destination address of an incoming frame. + @discussion This method sets the list of multicast addresses that the multicast filter + should use to match against the destination address of an incoming frame. + The frame should be accepted when a match occurs. Called when the multicast group membership of an interface + object is changed. Drivers that support kIOPacketFilterMulticast should + override this method and update the hardware multicast filter using the + list of Ethernet addresses provided. Perfect multicast filtering is + preferred if supported by the hardware, in order to reduce the number of + unwanted packets received. If the number of multicast addresses in the + list exceeds what the hardware is capable of supporting, or if perfect + filtering is not supported, then ideally the hardware should be programmed + to perform imperfect filtering, through some form of hash filtering + mechanism. Only as a last resort should the driver enable reception of + all multicast packets to satisfy this request. This method is called + from the workloop context, and only if the driver reports + kIOPacketFilterMulticast support in getPacketFilters(). + @param addrs An array of Ethernet addresses. This argument must be + ignored if the count argument is 0. + @param count The number of Ethernet addresses in the list. This value + will be zero when the list becomes empty. + @result Returns kIOReturnUnsupported. Drivers must return kIOReturnSuccess to + indicate success, or an error return code otherwise. +*/ + + virtual IOReturn setMulticastList(IOEthernetAddress * addrs, + UInt32 count); + +/*! @function setPromiscuousMode + @abstract Enables or disables promiscuous mode. + @discussion Called by enablePacketFilter() or disablePacketFilter() + when there is a change in the activation state of the promiscuous + filter identified by kIOPacketFilterPromiscuous. This method is + called from the workloop context. + @param active True to enable promiscuous mode, false to disable it. + @result Returns kIOReturnUnsupported. If overridden, drivers must return + kIOReturnSuccess on success, or an error return code otherwise. +*/ + + virtual IOReturn setPromiscuousMode(bool active); + +/*! @function setWakeOnMagicPacket + @abstract Enables or disables the wake on Magic Packet support. + @discussion Called by enablePacketFilter() or disablePacketFilter() + when there is a change in the activation state of the Wake-on-LAN + filter identified by kIOEthernetWakeOnMagicPacket. This method is + called from the workloop context. + @param active True to enable support for system wake on reception + of a Magic Packet, false to disable it. + @result Returns kIOReturnUnsupported. If overridden, drivers must return + kIOReturnSuccess on success, or an error return code otherwise. +*/ + + virtual IOReturn setWakeOnMagicPacket(bool active); + +protected: + +/*! @function createInterface + @abstract Creates an IOEthernetInterface object. + @discussion This method allocates and returns a new IOEthernetInterface instance. + A subclass of IONetworkController must implement this method and return + a matching interface object. The implementation in IOEthernetController + will return an IOEthernetInterface object. Subclasses of + IOEthernetController, such as Ethernet controller drivers, will have + little reason to override this implementation. + @result Returns a newly allocated and initialized IOEthernetInterface object. +*/ + + virtual IONetworkInterface * createInterface() APPLE_KEXT_OVERRIDE; + +/*! @function free + @abstract Frees the IOEthernetController instance. + @discussion This method releases resources, and is + then followed by a call to super::free(). */ + + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! @function publishProperties + @abstract Publishes Ethernet controller properties and capabilities. + @discussion This method publishes Ethernet controller properties to the property + table. For instance, getHardwareAddress() is called to fetch the + hardware address, and the address is then published to the property + table. This method call is synchronized by the workloop's gate, + and must never be called directly by subclasses. + @result Returns true if all properties and capabilities were discovered, + and published successfully, false otherwise. Returning false will + prevent client objects from attaching to the Ethernet controller + since a property that a client relies upon may be missing. +*/ + + virtual bool publishProperties() APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUsed( IOEthernetController, 0); + + /*! @function getVlanTagDemand + @abstract Fetch the demand for hardware vlan tag stuffing + for the given packet before it is transmitted on the network. + @discussion A network controller that can insert 802.1Q vlan tags for output + packets must call this method to obtain vlan tag information that it must + insert into the given output packet. + @param m A mbuf containing a packet that may require vlan tag stuffing. + @param vlanTag After calling, the low order 16 bits contain the 802.1Q priority and + vlan ID tag in host order. The hi-order 16 bits are currently unused and should be ignored. + @result true if vlanTag has been set and should be used. + false if no vlan tag stuffing is required for this packet. */ + + virtual bool getVlanTagDemand(mbuf_t m, UInt32 *vlanTag); + + OSMetaClassDeclareReservedUsed( IOEthernetController, 1); + + /*! @function setVlanTag + @abstract Encode a received packet with the vlan tag result reported + by the hardware. + @discussion A network controller that can strip 802.1Q vlan tag information for a + received packet should call this method to encode the result on the + packet, before passing it up towards the protocol stacks. + @param m A mbuf containing a packet that has had its 802.1q vlan tag stripped by + the hardware. + @param vlanTag A value in host order that contains the 802.1q vlan tag and priority + in the low order 16 bits. The hi order word is currently unused and should be set to 0. */ + + virtual void setVlanTag(mbuf_t m, UInt32 vlanTag); + + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_14 + +public: + + /*! @struct IOEthernetControllerAVBSupport + @abstract Group of capabilities for the AVB/TSN support of the driver and hardware. + @discussion Structure containing the AVB/TSN capabilities of the controller. + @field timeSyncSupport The type of time sync timestamping support the driver provides. + @field numberOfRealtimeTransmitQueues The number of hardware queues available for AVB + traffic transmission. These are queues which support launch timestamps. + @field numberOfRealtimeReceiveQueues The number of hardware queues available for AVB + traffic reception. These are dedicated hardware queues with filtering that send + packets into a provided callback rather than the regular network stack + @field realtimeMulticastIsAllowed The transport layer allows for realtime traffic + to be sent multicast. Ethernet networks typically respond as true, WiFi networks as false. + @field packetMapper The IOMapper to be used for mapping the virtual memory used for packets to + the physical address addresses used by the controller. May be NULL to indicate that it can use + physical addresses from anywhere in the address space. + */ + typedef struct + { + IOEthernetControllerAVBTimeSyncSupport timeSyncSupport; + uint32_t numberOfRealtimeTransmitQueues; + uint32_t numberOfRealtimeReceiveQueues; + bool realtimeMulticastIsAllowed; + IOMapper *packetMapper; + } IOEthernetControllerAVBSupport; + + /*! @function getAVBSupport + @abstract Indicates that AVB streaming is supported and what capabilities it has. + @discussion + @param avbSupport A pointer to an IOEthernetControllerAVBSupport struct to return the capabilities. + @return True if this controller has at least 1 real time transmit queues or at least 1 realtime receive queues + */ + bool getAVBSupport(IOEthernetControllerAVBSupport *avbSupport) const; + +protected: + /*! @function setRealtimeMulticastIsAllowed + @abstract Sets up the realtime multicast allowed in the AVB support information. + @discussion Used by subclasses to set the value returned in the realtimeMulticastIsAllowed + field of the AVB support capabilities. This indicates if the transport allows the realtime + AVB transmit queues to use multicast destination addresses. A transport such as WiFi where + multicast drops to a low transfer rate would typically set this to false. Wired Ethernet + would typically set this to true. The default value of a newly initialized object is true. + @param realtimeMulticastAllowed bool indicating if the transport allows realtime streams to use multicast destination addresses. + */ + void setRealtimeMulticastIsAllowed(bool realtimeMulticastAllowed); + /*! @function setAVBPacketMapper + @abstract Sets up the packet mapper in the AVB support information. + @discussion Used by subclasses to set the value returned in the packetMapper field of the AVB + support capabilities. This is used by the AVB stack to create the memory descriptors used + for transmitting packets by the controller. The packet mapper is retained. + @param packetMapper the IOMapper to be used. + */ + void setAVBPacketMapper(IOMapper *packetMaper); + +#pragma mark Interface State + friend IOTimeSyncEthernetInterfaceAdapter; +public: + /*! @function getControllerAVBState + @abstract Get the current AVB state of the controller. + @discussion The controller transitions through a number of AVB states depending on the + services required by the AVB stack. The state transitions are triggered by a call to + changeAVBControllerState() as the AVB stack transitions into and out of using TimeSync + and/or streaming services + @return The AVB state of the controller. + */ + IOEthernetControllerAVBState getControllerAVBState(void) const; + + /*! @function changeAVBControllerState + @abstract Change the AVB state of the AVB state of the controller. + @discussion Called by the AVB stack to trigger changing of the controller AVB state machine + based on what services the AVB stack requires. + @param event The event to trigger the state machine change. + @return IOReturn code indicating either success or reason for failure. + */ + IOReturn changeAVBControllerState(IOEthernetControllerAVBStateEvent event); + + /*! @typedef avb_state_callback_t + @abstract Callback function for notifying of AVB state changes + @discussion Prototype for the callback function provided to the registerForAVBStateChangeNotifications() + function for calling back to the requestor. + @param context The context pointer that was provided in the call the registerForAVBStateChangeNotifications() + @param newState The new state that the controller is now in. + */ + typedef void (* avb_state_callback_t)(void *context, IOEthernetControllerAVBState oldState, IOEthernetControllerAVBState newState); + + //Allow the AVB stack or other interested drivers to register for notifications in the change of AVB state + /*! @function registerForAVBStateChangeNotifications + @abstract Function to register to receive callbacks whenever the AVB state changes. + @discussion This function registers the callback function and context provided by the caller so that + it can be called when the AVB state of the controller changes. + @param callback A pointer to a callback function + @param context A caller specified pointer sized value that is passed back in the callback function. + @return IOReturn code indicating success or a reason for failure. + */ + IOReturn registerForAVBStateChangeNotifications(avb_state_callback_t callback, void *context); + /*! @function deregisterForAVBStateChangeNotifications + @abstract Function to deregister from receiving callbacks whenever the AVB state changes. + @discussion This function deregisters the callback function and context provided by the caller so that + it will stop being called when the AVB state of the controller changes. The provided values must + match what was previously registered with registerForAVBStateChangeNotifications(). + @param callback A pointer to a callback function. + @param context A caller specified pointer sized value that is passed back in the callback function. + @return IOReturn code indicating success or a reason for failure. + */ + IOReturn deregisterForAVBStateChangeNotifications(avb_state_callback_t callback, void *context); + +protected: + /*! @function setAVBControllerState + @abstract Set the controller to the new AVB state. + @discussion This function is called as part of the changeAVBControllerState() processing and performs + the change to the new state. This function is overriden by subclasses to perform any driver specific + actions (such as enabling or disabling hardware features). Subclasses must call the base implementation + and should be called last. + @param newState The state to which the controller's AVB state machine will be set. + @return IOReturn code indicating success or a reason for failure. + */ + virtual IOReturn setAVBControllerState(IOEthernetControllerAVBState newState); + OSMetaClassDeclareReservedUsed( IOEthernetController, 2); + +#pragma mark AVB Packets and Callbacks +public: +#define kMaxIOEthernetReltimeEntries 4 + + struct IOEthernetAVBPacket; + + /*! @typedef avb_packet_callback_t + @abstract Callback function for handling received realtime or TimeSync packets + @discussion Prototype for the callback function provided to the setRealtimeReceiveQueuePacketHandler(), + addTimeSyncReceivePacketHandler() and addTimeSyncTransmitPacketHandler() functions for calling back to the requestor. + @param context The context pointer that was provided in the call the registerForAVBStateChangeNotifications() + @param packet The packet being received or transmitted. + */ + typedef void (* avb_packet_callback_t)(void *context, struct IOEthernetAVBPacket *packet); + + /*! @struct IOEthernetAVBPacket + @abstract Structure containing an AVB or TimeSync packet. + @discussion Structure containing the metadata for an AVB or TimeSync packet. + @field structVersion The version of the packet structure. The only defined version is version 0 and this field shall be set to 0. + @field numberOfEntries The number of entries in the virtualRanges and physicalRanges fields that contain + valid addresses and lengths. + @field virtualRanges The kernel virtual addresses of the buffer segments that make up the packet. + @field physicalRanges The physical addresses of the mapped buffer segments that make up the packet. + @field packetTimestamp The timestamp of the packet in mach_absolute_time() based time. For AVB realtime + transmit packets this is the launch time of the packet, for AVB realtime receive packets this is + optionally the ingress time of the packet. For TimeSync packets this is the egress time of transmitted + packets or the ingress time of received packets. + @field timestampValid Indicates if the packetTimestamp field contains a valid value. + @field transmittedTimeSyncCallbackRef For transmited egress time stamped packets the callback reference + returned by calling addTimeSyncTransmitPacketHandler(). This is required when calling transmitTimeSyncPacket(). + @field vlanTag The VLAN tag associated with the packet (includes the VLAN ID, Priority Code Point and Drop Eligable Indicator). + This is typically used on receive paths to carry the VLAN tag that was stripped during reception. + @field desc_buffer A field for the allocator to keep track of the buffer for memory management purposes. Use is allocator defined. + @field desc_dma A field for the allocator to keep track of the DMA. Use is allocator defined. + @field completion_context A pointer value for use in the completion callback + @field completion_callback A callback function called by completeAVBPacket() to return the packet to the allocator when use is completed. + */ + typedef struct IOEthernetAVBPacket + { + int structVersion; + int numberOfEntries; + IOVirtualRange virtualRanges[kMaxIOEthernetReltimeEntries]; + IOPhysicalRange physicalRanges[kMaxIOEthernetReltimeEntries]; + uint64_t packetTimestamp; + bool timestampValid; + uint32_t transmittedTimeSyncCallbackRef; + + uint16_t vlanTag; + + void *desc_buffer; + void *desc_dma; + void *completion_context; + avb_packet_callback_t completion_callback; + + void *reservedAVBStack; + void *reservedFamily; + } IOEthernetAVBPacket; + + /*! @function completeAVBPacket + @abstract Call the packet's completion callback to hand the packet back to the allocator of the packet for reuse or destruction. + @discussion The completeAVBPacket function is called to provide the packet back to the allocator (or its delegate function). + This is called by the owner of the IOEthernetAVBPacket when they have finished using it. + @param packet The packet to be returned. + */ + void completeAVBPacket(IOEthernetAVBPacket *packet); + + /*! @function allocateAVBPacket + @abstract Allocate a packet from the AVB packet pool. + @discussion Provide a packet from the AVB packet pool. The packet must eventually be returned by a call to completeAVBPacket(). + Packets allocated by this call will have one segment (numberOfEntries = 1) with a 2000 byte length. The caller must set the + virtual and physical range lengths to the amount of data actually used for the packet. + @param fromRealtimePool If true pull the packet from the pre-allocated realtime pool, if false then allocate a new packet. + @result The allocated packet. May return NULL if the pool is out of packets. + */ + IOEthernetAVBPacket *allocateAVBPacket(bool fromRealtimePool); + + +private: + static void allocatedAVBPacketCompletion(void *context, IOEthernetAVBPacket *packet); + void realtimePoolAVBPacketCompletion(IOEthernetAVBPacket *packet); + + +#pragma mark Realtime Transmit +public: + /*! @function getTransmitQueuePacketLatency + @abstract Get the minimum amount of time required between when transmitRealtimePacket() is called and the launch timestamp. + @discussion Get the packet latency, the minimum amount of time needed between when a packet is given to + transmitRealtimePacket() and the launchTime when it is sent. This includes any prefetch delay (where the NIC fetches + the data at most that amount of time before the launch time) and any descriptor setup time. + @param queueIndex index of the realtime transmit queue. + @return The number of mach_absolute_time ticks. + */ + uint64_t getTransmitQueuePacketLatency(uint32_t queueIndex) const; + + /*! @function getTransmitQueuePrefetchDelay + @abstract Get the maximum amount of time required between when NIC will DMA the packet contents and the launch timestamp. + @discussion Get the prefetch delay, the maximum amount of time between when the NIC will DMA the packet contents and + the launchTime when it is sent. + @param queueIndex index of the realtime transmit queue. + @return The number of mach_absolute_time ticks. + */ + uint64_t getTransmitQueuePrefetchDelay(uint32_t queueIndex) const; + + /*! @function transmitRealtimePacket + @abstract Transmit an AVB packet on a realtime transmit queue. + @discussion Queues an AVB packet onto one of the controllers realtime transmit queues. + @param queueIndex index of the realtime transmit queue. + @param packets Array of the AVB packets to transmit. + @param packetCount The number of AVB packets in the packets array. + @param commonTimestamp All of the packets in the packets array share the same timestamp and the timestamp from the first packet + should be used for scheduling all of the packets if needed by the hardware. + @param successfulPacketCount The number of packets that were sucessfully added to the transmit queue. + @return IOReturn indicating success or reason for failure. + */ + virtual IOReturn transmitRealtimePackets(uint32_t queueIndex, IOEthernetAVBPacket **packets, uint32_t packetCount, bool commonTimestamp, uint32_t *successfulPacketCount); + OSMetaClassDeclareReservedUsed( IOEthernetController, 3); + + //Clean up the realtime transmit queue (free up anything that has already been processed by the NIC) + /*! @function cleanupTransmitQueue + @abstract Cleanup the realtime transmit queue synchronously with AVB adding frames. + @discussion This function performs necessary cleanup of the realtime transmit queue (cleaning through transmit + descriptors) to free up space in the queue without needing to handle an interrupt. This is called from a + realtime (priority 97) thread and care should be taken about use of locks and memory allocation/deallocation. + @param queueIndex index of the realtime transmit queue. + @return IOReturn indicating success or reason for failure. + */ + virtual IOReturn cleanupTransmitQueue(uint32_t queueIndex); + OSMetaClassDeclareReservedUsed( IOEthernetController, 4); + +protected: + /*! @function setNumberOfRealtimeTransmitQueues + @abstract Sets up the realtime transmit queue count in the AVB support information. + @discussion Used by subclasses to set the value returned in the numberOfRealtimeTransmitQueues field of the AVB + support capabilities. It also initializes internal data structures to contain enough space for keeping track + of realtime transmit queue information (such as the packet latency). + @param numberOfTransmitQueues The number of transmit queues. + */ + void setNumberOfRealtimeTransmitQueues(uint32_t numberOfTransmitQueues); + /*! @function setTransmitQueuePacketLatency + @abstract Set the value returned by getTransmitQueuePacketLatency() for a given queue. + @discussion Stores the value of the minimum packet latency for a given queue. See getTransmitQueuePacketLatency for more details. + @param queueIndex index of the realtime transmit queue. + @param packetLatency The packet latency for the queue. + */ + void setTransmitQueuePacketLatency(uint32_t queueIndex, uint64_t packetLatency); + + /*! @function setTransmitQueuePrefetchDelay + @abstract Set the value returned by getTransmitQueuePrefetchDelay() for a given queue. + @discussion Stores the value of the maximum prefetch delay for a given queue. See getTransmitQueuePrefetchDelay for more details. + @param queueIndex index of the realtime transmit queue. + @param PrefetchDelay The prefetch delay for the queue. + */ + void setTransmitQueuePrefetchDelay(uint32_t queueIndex, uint64_t prefetchDelay); + +#pragma mark Realtime Receive +public: + /*! @enum Filter element types + @abstract The type of the filter element described in an IOEthernetAVBIngressFilterElement struct. + @const IOEthernetAVBIngressFilterTypeDestinationMAC Match a specific destination MAC address. Uses the destinationMAC field of the filter union. + @const IOEthernetAVBIngressFilterTypeEtherTypeVLANTag Match a specific EtherType and VLAN Tag (Priority Code Point + VLAN ID). Uses the etherTypeVLANTag field of the filter union. + @const IOEthernetAVBIngressFilterTypeUDPv4Port Match a specific UDPv4 source and/or destination port. Uses the udpPort field of the filter union. + @const IOEthernetAVBIngressFilterTypeUDPv6Port Match a specific UDPv6 source and/or destination port. Uses the udpPort field of the filter union. + @const IOEthernetAVBIngressFilterTypeIPv4Tuple Match a specific IPv4 tuple (source address, destination address, source port, destination port and protocol). Uses the ipv4Tuple field of the filter union. + @const IOEthernetAVBIngressFilterTypeIPv6Tuple Match a specific IPv6 tuple (source address, destination address, source port, destination port and protocol). Uses the ipv6Tuple field of the filter union. + @const IOEthernetAVBIngressFilterTypeMPLSLabel Match a specific MPLS Label. Uses the mplsLabel field of the filter union. + @const IOEthernetAVBIngressFilterTypeByteMatch Match an aribitrary byte range up to 128 bytes long. Uses the byteMatch field of the filter union. + @const IOEthernetAVBIngressFilterTypeCompound Provide an AND of more filter terms (takes each of the sub filters and ANDs together the results). Uses the compound field of the filter union. + */ + typedef enum + { + IOEthernetAVBIngressFilterTypeDestinationMAC, + IOEthernetAVBIngressFilterTypeEtherTypeVLANTag, + IOEthernetAVBIngressFilterTypeUDPv4Port, + IOEthernetAVBIngressFilterTypeUDPv6Port, + IOEthernetAVBIngressFilterTypeIPv4Tuple, + IOEthernetAVBIngressFilterTypeIPv6Tuple, + IOEthernetAVBIngressFilterTypeMPLSLabel, + IOEthernetAVBIngressFilterTypeByteMatch, + IOEthernetAVBIngressFilterTypeCompound, + } IOEthernetAVBIngressFilterType; + + /*! @enum Filter IP tuple protocol types + @abstract The protocl that the IPv4 or IPv6 tuple match applies to. + @const IOEthernetAVBIngressFilterProtocolTCP A TCP packet. + @const IOEthernetAVBIngressFilterProtocolUDP A UDP packet. + @const IOEthernetAVBIngressFilterProtocolSCTP An SCTP packet. + @const IOEthernetAVBIngressFilterProtocolICMP An ICMP packet. + */ + typedef enum + { + IOEthernetAVBIngressFilterProtocolTCP, + IOEthernetAVBIngressFilterProtocolUDP, + IOEthernetAVBIngressFilterProtocolSCTP, + IOEthernetAVBIngressFilterProtocolICMP + } IOEthernetAVBIngressFilterProtocol; + + /*! @struct IOEthernetAVBRealtimeIngressFilterElement + @abstract One element in realtime receive queue ingress filter used to configure the hardware + to send the packet to the specified receive queue. + @discussion One element in realtime receive queue ingress filter used to configure the hardware + to send the packet to the specified receive queue. + + For IOEthernetAVBRealtimeIngressFilterTypeEtherTypeVLANTag the element is applied as + (etherTypeVLANTag.etherType == (packet.etherType & etherTypeVLANTag.etherTypeMask)) && (etherTypeVLANTag.vlanTag == (packet.vlanTag & etherTypeVLANTag.vlanTagMask)) + For IOEthernetAVBRealtimeIngressFilterTypeUDPv4Port or IOEthernetAVBRealtimeIngressFilterTypeUDPv6Port the element is applied as + (udpPort.sourcePort == (packet.sourcePort & udpPort.sourcePortMask)) && (udpPort.destinationPort == (packet.destinationPort & udpPort.destinationPortMask)) + @field filterType The type of filter being added, defines which member of the union (filter) is used + @field filter The union of all possible filter type fields. + + @field destinationMAC The struct containing matching parameters for an IOEthernetAVBIngressFilterTypeDestinationMAC filter element. + @field etherTypeVLANTag The struct containing matching parameters for an IOEthernetAVBIngressFilterTypeEtherTypeVLANTag fiter element. + @field udpPort The struct containing matching parameters for an IOEthernetAVBIngressFilterTypeUDPv4Port or IOEthernetAVBIngressFilterTypeUDPv6Port filter element. + @field ipv4Tuple The struct containing matching parameters for an IOEthernetAVBIngressFilterTypeIPv4Tuple filter element. + @field ipv6Tuple The struct containing matching parameters for an IOEthernetAVBIngressFilterTypeIPv6Tuple filter element. + @field mplsLabel The struct containing matching parameters for an IOEthernetAVBIngressFilterTypeMPLSLabel filter element. + @field byteMatch The struct containing matching parameters for an IOEthernetAVBIngressFilterTypeByteMatch filter element. + @field compound The struct containing matching parameters for an IOEthernetAVBIngressFilterTypeCompound filter element. + + @field macAddress The MAC address to match. + @field macAddressMask The mask to apply to the destination MAC address of the packet to compare to the macAddress field. + + @field etherType The EtherType to match to send to the queue. + @field etherTypeMask The mask to apply to the EtherType of the packet to compare to the etherType field. + @field vlanTag The VLAN Tag (PCP and VID) to match to send to the queue. + @field vlanTagMask The mask to apply to the VLAN tag of the packet to compare to the vlanTag field. + + @field sourcePort The source port to match. + @field sourcePortMask The mask to apply to the source port of the packet to compare to the sourcePort field. + @field destinationPort The destination port to match. + @field destinationPortMask The mask to apply to the destination port of the packet to compare to the destinationPort field. + + @field sourceAddress The source address to match. + @field sourceAddressMask The mask to apply to the source address of the packet to compare to the sourceAddress field. + @field destinationAddress The destination address to match. + @field destinationAddressMask The mask to apply to the destination address of the packet to compare to the destinationAddress field. + @field protocol The protocol that the match applies to. See IOEthernetAVBIngressFilterProtocol. + + @field label The MPLS label to match + @field labelMask The mask to apply to the MPLS label in the packet to compare to the label field. + + @field patternOffset The offset into the packet that the pattern match begins at. + @field patternLength The number of bytes of pattern and pattern mask used in the match (maximum 128). + @field pattern The pattern to match. + @field patternMask The mask to apply to the bytes in the packet to compare to the pattern. + + @field elementCount The number of entries in the elements field. + @field elements An array of IOEthernetAVBIngressFilterElement structs for sub filters to be ANDed together to make this filter element. These elements should not have sub elements. + */ + typedef struct IOEthernetAVBIngressFilterElement + { + IOEthernetAVBIngressFilterType filterType; + + union + { + struct + { + uint8_t macAddress[kIOEthernetAddressSize]; + uint8_t macAddressMask[kIOEthernetAddressSize]; + } destinationMAC; + + struct + { + uint16_t etherType; + uint16_t etherTypeMask; + uint16_t vlanTag; + uint16_t vlanTagMask; + } etherTypeVLANTag; + + struct + { + uint16_t sourcePort; + uint16_t sourcePortMask; + uint16_t destinationPort; + uint16_t destinationPortMask; + } udpPort; + + struct + { + uint32_t sourceAddress; + uint32_t sourceAddressMask; + uint32_t destinationAddress; + uint32_t destinationAddressMask; + uint16_t sourcePort; + uint16_t sourcePortMask; + uint16_t destinationPort; + uint16_t destinationPortMask; + + uint8_t protocol; + } ipv4Tuple; + + struct + { + uint8_t sourceAddress[16]; + uint8_t sourceAddressMask[16]; + uint8_t destinationAddress[16]; + uint8_t destinationAddressMask[16]; + uint16_t sourcePort; + uint16_t sourcePortMask; + uint16_t destinationPort; + uint16_t destinationPortMask; + + uint8_t protocol; + } ipv6Tuple; + + struct + { + uint32_t label; + uint32_t labelMask; + } mplsLabel; + + struct + { + uint8_t patternOffset; + uint8_t patternLength; + uint8_t pattern[128]; + uint8_t patternMask[128]; + } byteMatch; + + struct + { + uint32_t elementCount; + struct IOEthernetAVBIngressFilterElement *elements; + } compound; + } filter; + } IOEthernetAVBIngressFilterElement; + + //Set the VLAN ID and PCP being used for a receive queue + /*! @function setRealtimeReceiveQueueFilter + @abstract Set the ingress filter being used for a receive queue. + @discussion Sets the ingress filter hardware for directing the appropriate media streaming packets into the receive queue. + Passing an empty array removes any added filters and either resets the queue to a default value or disables the queue. + @param queueIndex index of the realtime receive queue. + @param filterElements the array of IOEthernetAVBIngressFilterElement elements to apply as the ingress filter, + @param filterElementCount the number of elements in the filterElements array. + @return IOReturn indicating success or reason for failure. + */ + virtual IOReturn setRealtimeReceiveQueueFilter(uint32_t queueIndex, IOEthernetAVBIngressFilterElement *filterElements, uint32_t filterElementCount); + OSMetaClassDeclareReservedUsed( IOEthernetInterface, 5); + + //Get the VLAN ID and PCP being used for a receive queue + /*! @function getRealtimeReceiveQueueFilter + @abstract Get the ingress filter being used for a receive queue. + @discussion Gets the ingress filter hardware for directing the appropriate media streaming packets into the receive queue. + The caller should call IOFree on any elements array within an IOEthernetAVBIngressFilterTypeCompound element. + @param queueIndex index of the realtime receive queue. + @param filterElements the array of IOEthernetAVBIngressFilterElement elements to apply as the ingress filter, + @param filterElementCount the number of elements in the filterElements array. On entry this is the maximum size of the array. + @return IOReturn indicating success or reason for failure. + */ + virtual IOReturn getRealtimeReceiveQueueFilter(uint32_t queueIndex, IOEthernetAVBIngressFilterElement *filterElements, uint32_t *filterElementCount); + OSMetaClassDeclareReservedUsed( IOEthernetInterface, 6); + + /*! @function setRealtimeReceiveQueuePacketHandler + @abstract Set the packet handler callback function for a realtime receive queue. + @discussion Sets the callback function and context to be used to process all of the packets for a realtime receive queue. + Ownership of the packets is handed from the driver to the callback function. The callback function must call completeAVBPacket() + before returning. + @param queueIndex index of the realtime receive queue. + @param callback The callback function pointer. + @param context A caller specified pointer sized value that is passed back in the callback function. + @return IOReturn indicating success or reason for failure. + */ + virtual IOReturn setRealtimeReceiveQueuePacketHandler(uint32_t queueIndex, avb_packet_callback_t callback, void *context); + OSMetaClassDeclareReservedUsed( IOEthernetController, 7); + + /*! @function setRealtimeReceiveDestinationMACList + @abstract Set the list of destination MAC addreses used for a realtime receive queue. + @discussion Set the list of destination MAC addresses that are being received on a realtime receive queue. These multicast + addresses are *not* included in the list supplied to the setMulticastList call. + @param queueIndex index of the realtime receive queue. + @param addresses An array of ethernet destination MAC addresses. This shall be ignored if addressCount is 0. + @param addressCount The number of elements in the addresses array. + @return IOReturn indicating success or reason for failure. + */ + virtual IOReturn setRealtimeReceiveDestinationMACList(uint32_t queueIndex, IOEthernetAddress *addresses, int addressCount); + OSMetaClassDeclareReservedUsed( IOEthernetController, 8); + +protected: + /*! @function setNumberOfRealtimeReceiveQueues + @abstract Sets up the realtime receive queue count in the AVB support information. + @discussion Used by subclasses to set the value returned in the numberOfRealtimeReceiveQueues field of the AVB + support capabilities. It also initializes internal data structures to contain enough space for keeping track + of realtime receive queue information (such as the callbacks). + @param numberOfReceiveQueues The number of receive queues. + */ + void setNumberOfRealtimeReceiveQueues(uint32_t numberOfReceiveQueues); + +#pragma mark Time Sync +public: + /*! @function addTimeSyncReceivePacketHandler + @abstract Add a callback function to the list of Time Sync receive callbacks. + @discussion Add a callback function to the set of callbacks that are called for every received time sync packet. + Ownership of the packet is not handed to the callback function. The callback function must not call completeAVBPacket(). + @param callback The function to be called upon receiving a Time Sync packet in the dedicated time sync receive queue. + @param context A caller specified pointer sized value that is passed back in the callback function. + @return IOReturn indicating success or reason for failure. + */ + IOReturn addTimeSyncReceivePacketHandler(avb_packet_callback_t callback, void *context); + /*! @function removeTimeSyncReceivePacketHandler + @abstract Remove a previously added callback. + @discussion Remove a callback function that was previously added with addTimeSyncReceivePacketHandler(). + @param callback The function previously added. + @param context A caller specified pointer sized value that is passed back in the callback function. + @return IOReturn indicating success or reason for failure. + */ + IOReturn removeTimeSyncReceivePacketHandler(avb_packet_callback_t callback, void *context); + + //Set the callback for transmitted time sync packets (those that require egress timestamping) + /*! @function addTimeSyncTransmitPacketHandler + @abstract Add a callback function to be called after transmitting an egress timestamped Time Sync packet. + @discussion Add a callback function to the list and assigns a reference to it for tracking the callback to be used + for returning the egress timestamp to the caller. Ownership of the packet is not handed to the callback function. + The callback function must not call completeAVBPacket(). + @param callback The function to be called upon transmitting a Time Sync packet and obtaining it's egress timestamp. + @param context A caller specified pointer sized value that is passed back in the callback function. + @param callbackRef A pointer to a uint32_t that is allocated to the callback for use in the packets passed + to the transmitTimeSyncPacket so that the callback will be called. + @return IOReturn indicating success or reason for failure. + */ + IOReturn addTimeSyncTransmitPacketHandler(avb_packet_callback_t callback, void *context, uint32_t *callbackRef); + /*! @function removeTimeSyncTransmitPacketHandler + @abstract Remove a callback function previously added with addTimeSyncTransmitPacketHandler() + @discussion Remove a transmit packet handler previously added with addTimeSyncTransmitPacketHandler(). + @param callbackRef The callback reference returned by the call to addTimeSyncTransmitPacketHandler(). + @return IOReturn indicating success or reason for failure. + */ + IOReturn removeTimeSyncTransmitPacketHandler(uint32_t callbackRef); + + /*! @function transmitTimeSyncPacket + @abstract Transmit a time sync packet and capture it's egress timestamp. + @discussion Transmit a time sync packet which requires egress timestamping, after the egress timestamp is available + the transmit packet handler is called, passing this packet. If expiryTime (in mach_absolute_time) is reached + before the packet is transmitted it is aborted the packet callback called with the packet containing no valid timestamp. + @param packet The packet to be transmitted. + @param expiryTime The time at which the packet no longer needs to be transmitted if it hasn't already been transmitted. + @return IOReturn indicating success or reason for failure. + */ + virtual IOReturn transmitTimeSyncPacket(IOEthernetAVBPacket * packet, uint64_t expiryTime); + OSMetaClassDeclareReservedUsed( IOEthernetController, 9); + + +protected: + /*! @function setGPTPPresent + @abstract Set the gPTP present flag on the controller and trigger the AVB stack loading. + @discussion Sets the gPTPPresent property on the controller and interface. If setting gPTPPresent to true it calls + registerService() to trigger matching and loading of the AVB stack on demand, otherwise it calls messageClients + to trigger the stack to unload. + @param gPTPPresent + @return IOReturn indicating success or reason for failure. + */ + IOReturn setGPTPPresent(bool gPTPPresent); + +protected: + /*! @function receivedTimeSyncPacket + @abstract Send the received time sync packet to the callback functions. + @discussion This function is called by subclasses when they have received a Time Sync packet to send it to all of the + registered callback functions. + @param packet The received time sync packet. + */ + void receivedTimeSyncPacket(IOEthernetAVBPacket *packet); + /*! @function transmittedTimeSyncPacket + @abstract Send the transmitted time sync packet to the transmit callback. + @discussion This function is called by subclasses when they have transmitted an egress timestamped packet and have the + egress timestamp or when they have expired the packet. + @param packet The transmitted time sync packet + @param expired A bool indicating if the call is due to the packet being expired. + */ + void transmittedTimeSyncPacket(IOEthernetAVBPacket *packet, bool expired); + + /*! @function setTimeSyncPacketSupport + @abstract Sets up the time sync support in the AVB support information + @discussion Used by subclasses to set the value returned in the timeSyncSupport field of the AVB support caoabilities. + @param timeSyncPacketSupport The support that the controller has for timestamping. + */ + void setTimeSyncPacketSupport(IOEthernetControllerAVBTimeSyncSupport timeSyncPacketSupport); + +private: + static void timeSyncCallbackThreadEntry(void *param, wait_result_t waitResult); + void timeSyncCallbackThread(void); + + + + +#else + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOEthernetController, 2); + OSMetaClassDeclareReservedUnused( IOEthernetController, 3); + OSMetaClassDeclareReservedUnused( IOEthernetController, 4); + OSMetaClassDeclareReservedUnused( IOEthernetController, 5); + OSMetaClassDeclareReservedUnused( IOEthernetController, 6); + OSMetaClassDeclareReservedUnused( IOEthernetController, 7); + OSMetaClassDeclareReservedUnused( IOEthernetController, 8); + OSMetaClassDeclareReservedUnused( IOEthernetController, 9); +#endif + OSMetaClassDeclareReservedUnused( IOEthernetController, 10); + OSMetaClassDeclareReservedUnused( IOEthernetController, 11); + OSMetaClassDeclareReservedUnused( IOEthernetController, 12); + OSMetaClassDeclareReservedUnused( IOEthernetController, 13); + OSMetaClassDeclareReservedUnused( IOEthernetController, 14); + OSMetaClassDeclareReservedUnused( IOEthernetController, 15); + OSMetaClassDeclareReservedUnused( IOEthernetController, 16); + OSMetaClassDeclareReservedUnused( IOEthernetController, 17); + OSMetaClassDeclareReservedUnused( IOEthernetController, 18); + OSMetaClassDeclareReservedUnused( IOEthernetController, 19); + OSMetaClassDeclareReservedUnused( IOEthernetController, 20); + OSMetaClassDeclareReservedUnused( IOEthernetController, 21); + OSMetaClassDeclareReservedUnused( IOEthernetController, 22); + OSMetaClassDeclareReservedUnused( IOEthernetController, 23); + OSMetaClassDeclareReservedUnused( IOEthernetController, 24); + OSMetaClassDeclareReservedUnused( IOEthernetController, 25); + OSMetaClassDeclareReservedUnused( IOEthernetController, 26); + OSMetaClassDeclareReservedUnused( IOEthernetController, 27); + OSMetaClassDeclareReservedUnused( IOEthernetController, 28); + OSMetaClassDeclareReservedUnused( IOEthernetController, 29); + OSMetaClassDeclareReservedUnused( IOEthernetController, 30); + OSMetaClassDeclareReservedUnused( IOEthernetController, 31); +}; + +/* + * FIXME: remove this. + */ +enum { + kIOEnetPromiscuousModeOff = false, + kIOEnetPromiscuousModeOn = true, + kIOEnetPromiscuousModeAll = true, + kIOEnetMulticastModeOff = false, + kIOEnetMulticastModeFilter = true +}; +typedef bool IOEnetPromiscuousMode; +typedef bool IOEnetMulticastMode; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOETHERNETCONTROLLER_H */ diff --git a/QualcommWireless/include/IOKit/network/IOEthernetInterface.h b/QualcommWireless/include/IOKit/network/IOEthernetInterface.h new file mode 100644 index 0000000..a5f707e --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IOEthernetInterface.h @@ -0,0 +1,312 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOETHERNETINTERFACE_H +#define _IOETHERNETINTERFACE_H + +/*! @defined kIOEthernetInterfaceClass + @abstract The name of the + IOEthernetInterface class. +*/ + +#define kIOEthernetInterfaceClass "IOEthernetInterface" + +/*! @defined kIOActivePacketFilters + @abstract A property of IOEthernetInterface objects. + @discussion The kIOActivePacketFilters property has an OSDictionary value that describes the current + set of packet filters that have been successfully activated. Each + entry in the dictionary is a key/value pair consisting of the filter + group name, and an OSNumber describing the set of active filters for + that group. Entries in this dictionary will mirror those in + kIORequiredPacketFilters if the controller has reported success for + all filter change requests from the IOEthernetInterface object. +*/ + +#define kIOActivePacketFilters "IOActivePacketFilters" + +/*! @defined kIORequiredPacketFilters + @abstract A property of IOEthernetInterface objects. + @discussion The kIORequiredPacketFilters property has an OSDictionary value that describes the current + set of required packet filters. Each entry in the dictionary is a + key/value pair consisting of the filter group name, and an OSNumber + describing the set of required filters for that group. +*/ + +#define kIORequiredPacketFilters "IORequiredPacketFilters" + +/*! @defined kIOMulticastAddressList + @abstract A property of IOEthernetInterface objects. + @discussion The kIOMulticastAddressList property is an OSData object that describes the + list of multicast addresses that are being used by the + controller to match against the destination address of an + incoming frame. +*/ + +#define kIOMulticastAddressList "IOMulticastAddressList" +#define kIOMulticastFilterData kIOMulticastAddressList + +#ifdef KERNEL +#ifdef __cplusplus + +#include +#include +#include + +/*! @class IOEthernetInterface + @abstract The Ethernet interface object. + @discussion An Ethernet controller driver, + that is a subclass of IOEthernetController, will instantiate an object + of this class when the driver calls the attachInterface() method. + This interface object will then vend an Ethernet interface to DLIL, + and manage the connection between the controller driver and the upper + networking layers. Drivers will seldom need to subclass + IOEthernetInterface. +*/ + +class APPLE_KEXT_DEPRECATE IOEthernetInterface : public IONetworkInterface +{ + OSDeclareDefaultStructors( IOEthernetInterface ) + +private: + thread_call_t _inputEventThreadCall; // inputEvent() thread call + UInt32 _mcAddrCount; // # of multicast addresses + bool _ctrEnabled; // Is controller enabled? + OSDictionary * _supportedFilters; // Controller's supported filters + OSDictionary * _requiredFilters; // The required filters + OSDictionary * _activeFilters; // Currently active filters + bool _controllerLostPower; // true if controller is unusable + + struct ExpansionData { + UInt32 altMTU; // track the physical mtu of controller + UInt32 publishedFeatureID; // id for published wake packet + uint32_t supportedWakeFilters; // bitmask of supported wake filters + OSNumber * disabledWakeFilters; // OSNumber of disabled wake filters + uint64_t wompEnabledAssertionID; + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + + IOReturn enableController(IONetworkController * ctr); + IOReturn setupMulticastFilter(IONetworkController * ctr); + + UInt32 getFilters(const OSDictionary * dict, + const OSSymbol * group); + + bool setFilters(OSDictionary * dict, + const OSSymbol * group, + UInt32 filters); + + IOReturn disableFilter(IONetworkController * ctr, + const OSSymbol * group, + UInt32 filter, + IOOptionBits options = 0); + + IOReturn enableFilter(IONetworkController * ctr, + const OSSymbol * group, + UInt32 filter, + IOOptionBits options = 0); + + int syncSIOCSIFFLAGS(IONetworkController * ctr); + int syncSIOCSIFADDR(IONetworkController * ctr); + int syncSIOCADDMULTI(IONetworkController * ctr); + int syncSIOCDELMULTI(IONetworkController * ctr); + int syncSIOCSIFMTU(IONetworkController * ctr, struct ifreq * ifr, bool); + int syncSIOCGIFDEVMTU(IONetworkController * ctr, struct ifreq * ifr); + int syncSIOCSIFLLADDR(IONetworkController * ctr, const char * lladdr, int len); + int syncSIOCSIFCAP(IONetworkController * ctr, struct ifreq * ifr); + void _fixupVlanPacket(mbuf_t, u_int16_t, int); + void reportInterfaceWakeFlags(IONetworkController * ctr); + + static void handleEthernetInputEvent(thread_call_param_t param0, thread_call_param_t param1); + static int performGatedCommand(void *, void *, void *, void *, void *); + static IOReturn enableFilter_Wrapper( + IOEthernetInterface *, IONetworkController *, const OSSymbol *, UInt32 , IOOptionBits); + +public: + +/*! @function init + @abstract Initializes an IOEthernetInterface instance. + @discussion Instance variables are initialized, and an arpcom + structure is allocated. + @param controller A network controller object that will service + the interface object being initialized. + @result Returns true on success, false otherwise. +*/ + + virtual bool init( IONetworkController * controller ) APPLE_KEXT_OVERRIDE; + +/*! @function getNamePrefix + @abstract Returns a string containing the prefix to use when + creating a BSD name for this interface. + @discussion The BSD name for each interface object is created by + concatenating a string returned by this method, with an unique + unit number assigned by IONetworkStack. + @result Returns a pointer to a constant C string "en". Therefore, Ethernet + interfaces will be registered with BSD as en0, en1, etc. +*/ + + virtual const char * getNamePrefix() const APPLE_KEXT_OVERRIDE; + +protected: + +/*! @function free + @abstract Frees the IOEthernetInterface instance. + @discussion The memory allocated for the arpcom structure is released, + followed by a call to super::free(). +*/ + + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! @function performCommand + @abstract Handles an ioctl command sent to the Ethernet interface. + @discussion This method handles socket ioctl commands sent to the Ethernet + interface from DLIL. Commands recognized and processed by this method are + SIOCSIFADDR, SIOCSIFFLAGS, SIOCADDMULTI, and SIOCDELMULTI. Other commands + are passed to the superclass. + @param controller The controller object. + @param cmd The ioctl command code. + @param arg0 Command argument 0. Generally a pointer to an ifnet structure + associated with the interface. + @param arg1 Command argument 1. + @result Returns a BSD return value defined in bsd/sys/errno.h. +*/ + + virtual SInt32 performCommand(IONetworkController * controller, + unsigned long cmd, + void * arg0, + void * arg1) APPLE_KEXT_OVERRIDE; + +/*! @function controllerDidOpen + @abstract A notification that the interface has opened the network + controller. + @discussion This method will be called by IONetworkInterface after a + network controller has accepted an open from this interface object. + IOEthernetInterface will first call the implementation in its + superclass, then inspect the controller through properties published + in the registry. This method is called with the arbitration lock held. + @param controller The controller object that was opened. + @result Returns true on success, false otherwise. Returning false will + cause the controller to be closed, and any pending client opens to be + rejected. +*/ + + virtual bool controllerDidOpen(IONetworkController * controller) APPLE_KEXT_OVERRIDE; + +/*! @function controllerWillClose + @abstract A notification that the interface will close the network + controller. + @discussion This method will simply call super to propagate the method + call. This method is called with the arbitration lock held. + @param controller The controller that is about to be closed. +*/ + + virtual void controllerWillClose(IONetworkController * controller) APPLE_KEXT_OVERRIDE; + + +/*! @function controllerWillChangePowerState + @abstract Handles a notification that the network controller + servicing this interface object is about to transition to a new power state. + @discussion If the controller is about to transition to an unusable state, + and it is currently enabled, then the disable() method on the controller is + called. + @param controller The network controller object. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller is switching to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result Always returns kIOReturnSuccess. +*/ + + virtual IOReturn controllerWillChangePowerState( + IONetworkController * controller, + IOPMPowerFlags flags, + UInt32 stateNumber, + IOService * policyMaker) APPLE_KEXT_OVERRIDE; + +/*! @function controllerDidChangePowerState + @abstract Handles a notification that the network controller servicing + this interface object has transitioned to a new power state. + @discussion If the controller did transition to a usable state, and it was + previously disabled due to a previous power change, then it is re-enabled. + @param controller The network controller object. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller has switched to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result Always returns kIOReturnSuccess. +*/ + + virtual IOReturn controllerDidChangePowerState( + IONetworkController * controller, + IOPMPowerFlags flags, + UInt32 stateNumber, + IOService * policyMaker) APPLE_KEXT_OVERRIDE; + +public: + /* Override IONetworkInterface::willTerminate() */ + + virtual bool willTerminate( IOService * provider, + IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + /* Override IONetworkInterface::attachToDataLinkLayer() */ + + virtual IOReturn attachToDataLinkLayer( IOOptionBits options, + void * parameter) APPLE_KEXT_OVERRIDE; + + /* Override IONetworkInterface::inputEvent() */ + + virtual bool inputEvent( UInt32 type, void * data) APPLE_KEXT_OVERRIDE; + +protected: + virtual void feedPacketInputTap(mbuf_t) APPLE_KEXT_OVERRIDE; + virtual void feedPacketOutputTap(mbuf_t) APPLE_KEXT_OVERRIDE; + virtual bool initIfnetParams(struct ifnet_init_params *params) APPLE_KEXT_OVERRIDE; + +public: + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 0); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 1); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 2); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 3); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 4); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 5); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 6); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 7); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 8); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 9); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 10); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 11); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 12); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 13); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 14); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOETHERNETINTERFACE_H */ diff --git a/QualcommWireless/include/IOKit/network/IOEthernetStats.h b/QualcommWireless/include/IOKit/network/IOEthernetStats.h new file mode 100644 index 0000000..6125c2d --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IOEthernetStats.h @@ -0,0 +1,161 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOEthernetStats.h - Ethernet MIB statistics definitions. + * + * HISTORY + */ + +#ifndef _IOETHERNETSTATS_H +#define _IOETHERNETSTATS_H + +/*! @header IOEthernetStats.h + @discussion Ethernet statistics. */ + +//--------------------------------------------------------------------------- +// Ethernet-like statistics group. + +/*! @typedef IODot3StatsEntry + @discussion Ethernet MIB statistics structure. + @field alignmentErrors dot3StatsAlignmentErrors. + @field fcsErrors dot3StatsFCSErrors. + @field singleCollisionFrames dot3StatsSingleCollisionFrames. + @field multipleCollisionFrames dot3StatsMultipleCollisionFrames. + @field sqeTestErrors dot3StatsSQETestErrors. + @field deferredTransmissions dot3StatsDeferredTransmissions. + @field lateCollisions dot3StatsLateCollisions. + @field excessiveCollisions dot3StatsExcessiveCollisions. + @field internalMacTransmitErrors dot3StatsInternalMacTransmitErrors. + @field carrierSenseErrors dot3StatsCarrierSenseErrors. + @field frameTooLongs dot3StatsFrameTooLongs. + @field internalMacReceiveErrors dot3StatsInternalMacReceiveErrors. + @field etherChipSet dot3StatsEtherChipSet. + @field missedFrames dot3StatsMissedFrames (not in RFC1650). + */ + +typedef struct { + UInt32 alignmentErrors; + UInt32 fcsErrors; + UInt32 singleCollisionFrames; + UInt32 multipleCollisionFrames; + UInt32 sqeTestErrors; + UInt32 deferredTransmissions; + UInt32 lateCollisions; + UInt32 excessiveCollisions; + UInt32 internalMacTransmitErrors; + UInt32 carrierSenseErrors; + UInt32 frameTooLongs; + UInt32 internalMacReceiveErrors; + UInt32 etherChipSet; + UInt32 missedFrames; +} IODot3StatsEntry; + +//--------------------------------------------------------------------------- +// Ethernet-like collision statistics group (optional). + +/*! @typedef IODot3CollEntry + @discussion Collision statistics structure. + @field collFrequencies dot3StatsCollFrequencies. */ + +typedef struct { + UInt32 collFrequencies[16]; +} IODot3CollEntry; + +//--------------------------------------------------------------------------- +// Receiver extra statistics group (not defined by RFC 1650). + +/*! @typedef IODot3RxExtraEntry + @discussion Extra receiver statistics not defined by RFC1650. + @field overruns receiver overruns. + @field watchdogTimeouts watchdog timer expirations. + @field frameTooShorts runt frames. + @field collisionErrors frames damages by late collision. + @field phyErrors PHY receive errors. + @field timeouts receiver timeouts. + @field interrupts receiver interrupts. + @field resets receiver resets. + @field resourceErrors receiver resource shortages. + */ + +typedef struct { + UInt32 overruns; + UInt32 watchdogTimeouts; + UInt32 frameTooShorts; + UInt32 collisionErrors; + UInt32 phyErrors; + UInt32 timeouts; + UInt32 interrupts; + UInt32 resets; + UInt32 resourceErrors; + UInt32 reserved[4]; +} IODot3RxExtraEntry; + +//--------------------------------------------------------------------------- +// Transmitter extra statistics group (not defined by RFC 1650). + +/*! @typedef IODot3TxExtraEntry + @discussion Extra transmitter statistics not defined by RFC1650. + @field underruns transmit underruns. + @field jabbers jabber events. + @field phyErrors PHY transmit errors. + @field timeouts transmitter timeouts. + @field interrupts transmitter interrupts. + @field resets transmitter resets. + @field resourceErrors transmitter resource shortages. + */ + +typedef struct { + UInt32 underruns; + UInt32 jabbers; + UInt32 phyErrors; + UInt32 timeouts; + UInt32 interrupts; + UInt32 resets; + UInt32 resourceErrors; + UInt32 reserved[4]; +} IODot3TxExtraEntry; + +//--------------------------------------------------------------------------- +// Aggregate Ethernet statistics. + +/*! @typedef IOEthernetStats + @discussion Aggregate Ethernet statistics structure. + @field dot3StatsEntry IODot3StatsEntry statistics group. + @field dot3CollEntry IODot3CollEntry statistics group. + @field dot3RxExtraEntry IODot3RxExtraEntry statistics group. + @field dot3TxExtraEntry IODot3TxExtraEntry statistics group. + */ + +typedef struct { + IODot3StatsEntry dot3StatsEntry; + IODot3CollEntry dot3CollEntry; + IODot3RxExtraEntry dot3RxExtraEntry; + IODot3TxExtraEntry dot3TxExtraEntry; +} IOEthernetStats; + +/*! @defined kIOEthernetStatsKey + @discussion Defines the name of an IONetworkData that contains + an IOEthernetStats. */ + +#define kIOEthernetStatsKey "IOEthernetStatsKey" + +#endif /* !_IOETHERNETSTATS_H */ diff --git a/QualcommWireless/include/IOKit/network/IOGatedOutputQueue.h b/QualcommWireless/include/IOKit/network/IOGatedOutputQueue.h new file mode 100644 index 0000000..7ffca75 --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IOGatedOutputQueue.h @@ -0,0 +1,178 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOGATEDOUTPUTQUEUE_H +#define _IOGATEDOUTPUTQUEUE_H + +#include +#include +#include +#include + +/*! @class IOGatedOutputQueue + @abstract An extension of an IOBasicOutputQueue. + @discussion An IOCommandGate + object is created by this queue and added to a work loop as an + event source. All calls to the target by the consumer thread must + occur with the gate closed. Therefore, all calls to the target of + this type of queue will be serialized with any other thread that + runs on the same work loop context. This is useful for network + drivers that have a tight hardware coupling between the transmit + and receive engines, and a single-threaded hardware access model + is desirable. +*/ + +class IOGatedOutputQueue : public IOBasicOutputQueue +{ + OSDeclareDefaultStructors( IOGatedOutputQueue ) + +private: + static void gatedOutput(OSObject * owner, + IOGatedOutputQueue * self, + IOMbufQueue * queue, + UInt32 * state); + + static void restartDeferredOutput(OSObject * owner, + IOInterruptEventSource * sender, + int count); + +protected: + IOCommandGate * _gate; + IOInterruptEventSource * _interruptSrc; + +/*! @function output + @abstract Transfers all packets in the mbuf queue to the target. + @param queue A queue of output packets. + @param state Return a state bit defined by IOBasicOutputQueue that + declares the new state of the queue following this method call. + A kStateStalled is returned if the queue should stall, otherwise 0 + is returned. +*/ + + virtual void output(IOMbufQueue * queue, UInt32 * state) APPLE_KEXT_OVERRIDE; + +/*! @function free + @abstract Frees the IOGatedOutputQueue object. + @discussion Release allocated resources, then call super::free(). */ + + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! @function output + @abstract Overrides the method inherited from IOOutputQueue. + @result Returns true if a thread was successfully scheduled to service + the queue. +*/ + + virtual bool scheduleServiceThread(void * param) APPLE_KEXT_OVERRIDE; + +public: + +/*! @function init + @abstract Initializes an IOGatedOutputQueue object. + @param target The object that will handle packets removed from the + queue, and is usually a subclass of IONetworkController. + @param action The function that will handle packets removed from the + queue. + @param workloop A workloop object. An IOCommandGate object is created + and added to this workloop as an event source. + @param capacity The initial capacity of the output queue. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool init(OSObject * target, + IOOutputAction action, + IOWorkLoop * workloop, + UInt32 capacity = 0, + UInt32 priorities = 1); + +/*! @function withTarget + @abstract Factory method that constructs and initializes an + IOGatedOutputQueue object. + @param target An IONetworkController object that will handle packets + removed from the queue. + @param workloop A workloop object. An IOCommandGate object is created + and added to this workloop as an event source. + @param capacity The initial capacity of the output queue. + @result Returns an IOGatedOutputQueue object on success, or 0 otherwise. +*/ + + static IOGatedOutputQueue * withTarget(IONetworkController * target, + IOWorkLoop * workloop, + UInt32 capacity = 0); + + /*! @function withTarget + @abstract Factory method that constructs and initializes an + IOGatedOutputQueue object. + @param target An IONetworkController object that will handle packets + removed from the queue. + @param workloop A workloop object. An IOCommandGate object is created + and added to this workloop as an event source. + @param capacity The initial capacity of the output queue. + @param priorities The number of traffic priorities supported + @result Returns an IOGatedOutputQueue object on success, or 0 otherwise. + */ + + static IOGatedOutputQueue * withTarget(IONetworkController * target, + IOWorkLoop * workloop, + UInt32 capacity, + UInt32 priorities); + +/*! @function withTarget + @abstract Factory method that constructs and initializes an + IOGatedOutputQueue object. + @param target The object that will handle packets removed from the + queue. + @param action The function that will handle packets removed from the + queue. + @param workloop A workloop object. An IOCommandGate object is created + and added to this workloop as an event source. + @param capacity The initial capacity of the output queue. + @result Returns an IOGatedOutputQueue object on success, or 0 otherwise. +*/ + + static IOGatedOutputQueue * withTarget(OSObject * target, + IOOutputAction action, + IOWorkLoop * workloop, + UInt32 capacity = 0); + + /*! @function withTarget + @abstract Factory method that constructs and initializes an + IOGatedOutputQueue object. + @param target The object that will handle packets removed from the + queue. + @param action The function that will handle packets removed from the + queue. + @param workloop A workloop object. An IOCommandGate object is created + and added to this workloop as an event source. + @param capacity The initial capacity of the output queue. + @param priorities The number of traffic priorities supported + @result Returns an IOGatedOutputQueue object on success, or 0 otherwise. + */ + + static IOGatedOutputQueue * withTarget(OSObject * target, + IOOutputAction action, + IOWorkLoop * workloop, + UInt32 capacity, + UInt32 priorities); +}; + +#endif /* !_IOGATEDOUTPUTQUEUE_H */ diff --git a/QualcommWireless/include/IOKit/network/IOKernelDebugger.h b/QualcommWireless/include/IOKit/network/IOKernelDebugger.h new file mode 100644 index 0000000..4543aca --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IOKernelDebugger.h @@ -0,0 +1,402 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKERNELDEBUGGER_H +#define _IOKERNELDEBUGGER_H + +#include + +/*! @typedef IODebuggerRxHandler + @discussion Defines the receive handler that must be implemented + by the target to service KDP receive requests. This handler is called + by kdpReceiveDispatcher(). + @param target The target object. + @param buffer KDP receive buffer. The buffer allocated has room for + 1518 bytes. The receive handler must not overflow this buffer. + @param length The amount of data received and placed into the buffer. + Set to 0 if no frame was received during the poll interval. + @param timeout The amount of time to poll in milliseconds while waiting + for a frame to arrive. */ + +typedef void (*IODebuggerRxHandler)( IOService * target, + void * buffer, + UInt32 * length, + UInt32 timeout ); + +/*! @typedef IODebuggerTxHandler + @discussion Defines the transmit handler that must be implemented + by the target to service KDP transmit requests. This handler is called + by kdpTransmitDispatcher(). + @param target The target object. + @param buffer KDP transmit buffer. This buffer contains a KDP frame + to be sent on the network. + @param length The number of bytes in the transmit buffer. */ + +typedef void (*IODebuggerTxHandler)( IOService * target, + void * buffer, + UInt32 length ); + +/*! @typedef IODebuggerLinkStatusHandler + @discussion Defines the link up handler that must be implemented + by the target to service KDP link status requests. This handler is called + by kdpLinkStatusDispatcher(). + @param target The target object. + @result Return link status. +*/ + +typedef UInt32 (*IODebuggerLinkStatusHandler)( IOService * target); + +/*! @typedef IODebuggerSetModeHandler + @discussion Defines the mode handler that must be implemented + by the target to service KDP link status requests. This handler is called + by kdpSetModeDispatcher(). + @param target The target object. + @param active True if entering KDP and false if exiting KDP. + @result Return true on success and false on failure. +*/ + +typedef bool (*IODebuggerSetModeHandler)( IOService * target, bool active); + +/*! @typedef IODebuggerLockState + @discussion Defines flags returned by IOKernelDebugger::lock(). + @constant kIODebuggerLockTaken Set if the debugger lock was taken. */ + +typedef enum { + kIODebuggerLockTaken = 0x1 +} IODebuggerLockState; + +/*! @class IOKernelDebugger + @abstract Kernel debugger nub. + @discussion This object interfaces with the KDP + (kernel debugger protocol) module and dispatches KDP requests to its + target (provider). The target, designated as the debugger device, must + implement a pair of handler functions that are called to handle KDP + transmit and receive requests during a debugging session. Only a single + IOKernelDebugger in the system can be active at a given time. The + active IOKernelDebugger is the one that has an IOKDP object attached + as a client. + + The debugger device is usually a subclass of IOEthernetController. + However, any IOService can service an IOKernelDebugger client, + implement the two polled mode handlers, and transport the KDP + packets through a data channel. However, KDP assumes that the + debugger device is an Ethernet interface and therefore it will + always send, and expect to receive, an Ethernet frame. */ + +class IOKernelDebugger : public IOService +{ + OSDeclareDefaultStructors( IOKernelDebugger ) + +protected: + IOService * _target; // target (provider) + IODebuggerTxHandler _txHandler; // target's transmit handler. + IODebuggerRxHandler _rxHandler; // target's receive handler. + IOService * _client; // client that has opened us. + bool _pmDisabled; // true if disabled by PM. + + struct ExpansionData { + thread_call_t activationChangeThreadCall; + UInt32 stateVars[2]; + IONotifier * interfaceNotifier; + IODebuggerLinkStatusHandler linkStatusHandler; // target's link status handler. + IODebuggerSetModeHandler setModeHandler; // target's KDP mode handler. + }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + +/*! @function kdpReceiveDispatcher + @abstract The KDP receive dispatch function. + @discussion Field KDP receives requests, then dispatches the call to the + registered receiver handler. + @param buffer KDP receive buffer. The buffer allocated by KDP has room + for 1518 bytes. The receive handler must not overflow this buffer. + @param length The amount of data received and placed into the buffer. + Set to 0 if a frame was not received during the poll interval. + @param timeout The amount of time to poll in milliseconds while waiting + for a frame to arrive. +*/ + + static void kdpReceiveDispatcher(void * buffer, + UInt32 * length, + UInt32 timeout); + +/*! @function kdpTransmitDispatcher + @abstract The KDP transmit dispatch function. + @discussion Field KDP transmit requests, then dispatches the call to the + registered transmit handler. + @param buffer KDP transmit buffer. This buffer contains a KDP frame to + be sent on the network. + @param length The number of bytes in the transmit buffer. +*/ + + static void kdpTransmitDispatcher(void * buffer, UInt32 length); + +/*! @function kdpLinkStatusDispatcher + @abstract The KDP link status dispatch function. + @discussion Field KDP link status requests, then dispatches the call to the + registered link up handler. + @result Return link status. +*/ + + static UInt32 kdpLinkStatusDispatcher(void); + + +/*! @function kdpSetModeDispatcher + @abstract The KDP set mode dispatch function. + @discussion Field KDP set mode requests, then dispatches the call to the + registered set mode handler. + @param active TRUE if entering KDP. FALSE if leaving KDP. + @result Return TRUE if the link is up and data can be sent/received. Otherwise, + return FALSE. +*/ + + static boolean_t kdpSetModeDispatcher(boolean_t active); + +/*! @function free + @abstract Frees the IOKernelDebugger instance. */ + + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! @function nullTxHandler + @abstract Null transmit handler. + @discussion This function is registered as the transmit handler when an + IOKernelDebugger object surrenders its status as the active debugger nub. + Until another IOKernelDebugger object gets promoted, this function will + handle polled transmit requests from KDP. This function does nothing + useful. +*/ + + static void nullTxHandler( IOService * target, + void * buffer, + UInt32 length ); + +/*! @function nullRxHandler + @abstract Null receive handler. + @discussion This function is registered as the receive handler when an + IOKernelDebugger object surrenders its status as the active debugger nub. + Until another IOKernelDebugger object gets promoted, this function will + handle polled receive requests from KDP. This function does nothing + except to log a warning message. +*/ + + static void nullRxHandler( IOService * target, + void * buffer, + UInt32 * length, + UInt32 timeout ); + +/*! @function nullLinkStatusHandler + @abstract Null link status handler. + @discussion This function is registered as the link status handler when an + IOKernelDebugger object surrenders its status as the active debugger nub. + Until another IOKernelDebugger object gets promoted, this function will + handle polled link status requests from KDP. + @result This function will always report link up. +*/ + + static UInt32 nullLinkStatusHandler( IOService * target); + +/*! @function nullSetModeHandler + @abstract Null set mode handler. + @discussion This function is registered as the set mode handler when an + IOKernelDebugger object surrenders its status as the active debugger nub. + Until another IOKernelDebugger object gets promoted, this function will + handle set mode requests from KDP. + @result This function will always return true. +*/ + + static bool nullSetModeHandler( IOService * target, bool active); + +/*! @function registerHandler + @abstract Registers the target and the handler functions. + @discussion This method is called by handleOpen() and handleClose() + to register or unregister the target and its handler functions. + @param target The target object. + @param txHandler The transmit handler function. The null handler is + registered if the argument is zero. + @param rxHandler The receive handler function. The null handler is + @param linkUpHandler The linkup handler function. The null handler is + registered if the argument is zero. +*/ + + static void registerHandler( IOService * target, + IODebuggerTxHandler txHandler = 0, + IODebuggerRxHandler rxHandler = 0, + IODebuggerLinkStatusHandler linkUpHandler = 0, + IODebuggerSetModeHandler setModeHandler = 0); + +/*! @function powerStateWillChangeTo + @abstract Handles notification that the network controller will change + power state. + @discussion If the controller is about to become unusable, then the + controller's handlers are unregistered, and the controller is disabled. + @param flags Describe the capability of the controller in the new power + state. + @param stateNumber The number of the state in the state array that the + controller is switching to. + @param policyMaker The policy maker that manages the controller's + power state. + @result Returns the constant 3000000, to indicate a maximum of 3 seconds for the + preparation to complete, and an acknowledgement delivered to the + policy maker. +*/ + + virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags flags, + unsigned long stateNumber, + IOService * policyMaker ) APPLE_KEXT_OVERRIDE; + +/*! @function powerStateDidChangeTo + @abstract Handles notification that the network controller did change + power state. + @discussion If the controller became usable, then the controller is + re-enabled, and the controller's handlers are re-registered. + @param flags Description of the capability of the controller in the new power + state. + @param stateNumber The number of the state in the state array that the + controller is switching to. + @param policyMaker The policy maker that manages the controller's + power state. + @result Returns the constant 3000000, to indicate a maximum of 3 seconds for the + preparation to complete, and an acknowledgement delivered to the + policy maker. +*/ + + virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags flags, + unsigned long stateNumber, + IOService * policyMaker ) APPLE_KEXT_OVERRIDE; + +/*! @function handleOpen + @abstract Handles a client open. + @discussion This method is called by IOService::open() to handle an + open from a client (IOKDP) with the arbitration lock held. + @param forClient The client (IOKDP) requesting the open. + @param options Options passed to the open() call. Not used. + @param arg A family defined argument passed to the open() call. Not used. + @result Returns true on success, false otherwise. +*/ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ) APPLE_KEXT_OVERRIDE; + +/*! @function handleClose + @abstract Handles a client close. + @discussion This method is called by IOService::close() to handle a + close from a client with the arbitration lock held. + @param forClient The client (IOKDP) requesting the close. + @param options Options passed to the close() call. Not used. +*/ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ) APPLE_KEXT_OVERRIDE; + +/*! @function handleIsOpen + @abstract Queries whether a client has an open on this object. + @discussion This method is called by IOService::isOpen() with the + arbitration lock held. + @result Returns true if the specified client, or any client if none (0) is + specified, presently has an open on this object. +*/ + + virtual bool handleIsOpen( const IOService * forClient ) const APPLE_KEXT_OVERRIDE; + + static bool interfacePublished( + void *target, void *param, IOService *service, IONotifier *notifier ); + +public: + +/*! @function lock + @abstract Takes the debugger lock conditionally. + @discussion This method takes the debugger lock if the object given matches the + target registered by registerHandler(). + @param target The target or provider of an IOKernelDebugger object. + @result Returns kIODebuggerLockTaken if the lock was taken, or 0 otherwise. +*/ + + static IODebuggerLockState lock( IOService * target ); + +/*! @function unlock + @abstract Releases the debugger lock. + @discussion This method releases the debugger lock if the kIODebuggerLockTaken flag is + set in the argument. +*/ + + static void unlock( IODebuggerLockState state ); + +/*! @function init + @abstract Initializes an IOKernelDebugger instance. + @param target The target object that implements the debugger handlers. + @param txHandler The target's transmit handler. A pointer to a 'C' function. + @param rxHandler The target's receive handler. A pointer to a 'C' function. + @param linkStatusHandler The target's link status handler. A pointer to a 'C' function. + @param setModeHandler The target's set mode handler. A pointer to a 'C' function. + @result Returns true if the instance initialized successfully, false otherwise. +*/ + + virtual bool init( IOService * target, + IODebuggerTxHandler txHandler, + IODebuggerRxHandler rxHandler, + IODebuggerLinkStatusHandler linkUpHandler, + IODebuggerSetModeHandler setModeHandler); + +/*! @function debugger + @abstract Factory method that performs allocation and initialization + of an IOKernelDebugger object. + @param target The target object that implements the debugger handlers. + @param txHandler The target's transmit handler. A pointer to a 'C' function. + @param rxHandler The target's receive handler. A pointer to a 'C' function. + @param linkStatusHandler The target's link status handler. A pointer to a 'C' function. + @param setModeHandler The target's set mode handler. A pointer to a 'C' function. + @result Returns an IOKernelDebugger instance on success, 0 otherwise. +*/ + + static IOKernelDebugger * debugger( IOService * target, + IODebuggerTxHandler txHandler, + IODebuggerRxHandler rxHandler, + IODebuggerLinkStatusHandler linkStatusHandler, + IODebuggerSetModeHandler setModeHandler); + + /* + * Entry point for generic messages delivered from the provider. + */ + + virtual IOReturn message( UInt32 type, IOService * provider, void * arg ) APPLE_KEXT_OVERRIDE; + +/*! @function signalDebugger + @abstract Signal the kernel to enter the debugger when safe. +*/ + static void signalDebugger(void); + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOKernelDebugger, 0); + OSMetaClassDeclareReservedUnused( IOKernelDebugger, 1); + OSMetaClassDeclareReservedUnused( IOKernelDebugger, 2); + OSMetaClassDeclareReservedUnused( IOKernelDebugger, 3); +}; + +// Concise form of the lock()/unlock() static member functions. +// +#define IODebuggerLock IOKernelDebugger::lock +#define IODebuggerUnlock IOKernelDebugger::unlock + +#endif /* !_IOKERNELDEBUGGER_H */ diff --git a/QualcommWireless/include/IOKit/network/IOMbufMemoryCursor.h b/QualcommWireless/include/IOKit/network/IOMbufMemoryCursor.h new file mode 100644 index 0000000..4e40173 --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IOMbufMemoryCursor.h @@ -0,0 +1,381 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_NETWORK_IOMBUFMEMORYCURSOR_H +#define _IOKIT_NETWORK_IOMBUFMEMORYCURSOR_H + +#include + + +/*! @class IOMbufMemoryCursor + @abstract A mechanism to convert mbuf chains to physical addresses. + @discussion The IOMbufMemoryCursor defines the super class that all + specific mbuf cursors must inherit from, but a mbuf cursor can be created + without a specific formal subclass by just providing a segment function to + the initializers. This class performs the task of walking a given + mbuf chain and creating a physical scatter/gather list appropriate for + the target hardware. When necessary, this class may also coalesce + mbuf chains when the generated scatter/gather list exceeds the specified + hardware limit. However, this should be avoided since it exacts a + performance cost. +

+ A driver is expected to create a mbuf cursor and configure it to match the + limitations of it's DMA hardware; for instance the mbuf cursor used by + an Ethernet controller driver may have a maximum physical segment size + of 1520, and allow for up to 6 physical segments. Thus it would create a + mbuf cursor with a maxSegmentSize of 1520 and a maxNumSegments of 6. + The driver may choose to supply an OutputSegmentFunc function to + format the output of each scatter/gather segment to match the + hardware descriptor format, or it may use a subclass of + IOMbufMemoryCursor to generate IOPhysicalSegment segments with + various byte orders. +

+ A driver may also create more than one mbuf cursor, perhaps one + dedicated for the transmit thread, and the other for the receive thread. + This becomes a requirement when the driver is multi-threaded, since the + mbuf cursor maintains state and does not support reentrancy. */ + +class IOMbufMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufMemoryCursor) + +protected: + UInt32 maxNumSegments; + UInt32 coalesceCount; + UInt32 packetTooBigErrors; + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool initWithSpecification(OutputSegmentFunc outSeg, + UInt32 maxSegmentSize, + UInt32 maxTransferSize, + UInt32 align); + +public: +/*! @function initWithSpecification + @abstract Primary initializer for the IOMbufMemoryCursor class. + @param outSeg Function to call to output one physical segment. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns true if the inherited classes and this instance initialized + successfully. +*/ + + virtual bool initWithSpecification(OutputSegmentFunc outSeg, + UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function genPhysicalSegments + @abstract Generates a physical scatter/gather list given a mbuf packet. + @discussion Generates a list of physical segments from the given mbuf. + @param packet The mbuf packet. + @param vector Void pointer to base of output physical scatter/gather list. + Always passed directly onto the OutputSegmentFunc without interpretation + by the cursor. + @param maxSegs Maximum number of segments that can be written to segments + array. + @param doCoalesce Set to true to perform coalescing when the required + number of segments exceeds the specified limit, otherwise abort and + return 0. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + virtual UInt32 genPhysicalSegments(mbuf_t packet, void * vector, + UInt32 maxSegs, bool doCoalesce); + +/*! @function getAndResetCoalesceCount + @abstract Returns a count of the total number of mbuf chains coalesced + by genPhysicalSegments(). + @discussion This method returns a count of the total number of mbuf chains coalesced + by genPhysicalSegments(). The counter is then reset to 0. + @result Returns the coalesce count. +*/ + + UInt32 getAndResetCoalesceCount(); + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOMbufMemoryCursor, 0); + OSMetaClassDeclareReservedUnused( IOMbufMemoryCursor, 1); + OSMetaClassDeclareReservedUnused( IOMbufMemoryCursor, 2); + OSMetaClassDeclareReservedUnused( IOMbufMemoryCursor, 3); +}; + + +/*! @class IOMbufNaturalMemoryCursor + @abstract An IOMbufMemoryCursor subclass that outputs a vector of + IOPhysicalSegments in the natural byte orientation for the cpu. + @discussion The IOMbufNaturalMemoryCursor would be used when it is too + difficult to implement an OutputSegmentFunc that is more appropriate for + your hardware. This cursor just outputs an array of IOPhysicalSegments. +*/ + +class IOMbufNaturalMemoryCursor : public IOMbufMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufNaturalMemoryCursor) + +public: + +/*! @function withSpecification + @abstract Factory function that creates and initializes an + IOMbufNaturalMemoryCursor in one operation. + @discussion See also IOMbufMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns a new mbuf cursor if successfully created and initialized, + 0 otherwise. +*/ + + static IOMbufNaturalMemoryCursor * withSpecification(UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function getPhysicalSegments + @abstract Generates a cpu natural physical scatter/gather list from a given + mbuf. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegments(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); + +/*! @function getPhysicalSegmentsWithCoalesce + @abstract Generates a cpu natural physical scatter/gather list from a given + mbuf. + @discussion Generate a cpu natural physical scatter/gather list from a + given mbuf. Coalesce mbuf chain when the number of segments in the + scatter/gather list exceeds numVectorSegments. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegmentsWithCoalesce(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); +}; + +//=========================================================================== +//=========================================================================== + +/*! @class IOMbufBigMemoryCursor + @abstract An IOMbufMemoryCursor subclass that outputs a vector of + IOPhysicalSegments in the big endian byte order. + @discussion The IOMbufBigMemoryCursor would be used when the DMA hardware + requires a big endian address and length pair. This cursor outputs an + array of IOPhysicalSegments that are encoded in big-endian format. +*/ + +class IOMbufBigMemoryCursor : public IOMbufMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufBigMemoryCursor) + +public: + +/*! @function withSpecification + @abstract Factory function that creates and initializes an + IOMbufBigMemoryCursor in one operation. + @discussion See also IOMbufMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns a new mbuf cursor if successfully created and initialized, + 0 otherwise. +*/ + + static IOMbufBigMemoryCursor * withSpecification(UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function getPhysicalSegments + @abstract Generates a big endian physical scatter/gather list from a given + mbuf. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegments(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); + +/*! @function getPhysicalSegmentsWithCoalesce + @abstract Generates a big endian physical scatter/gather list from a given + mbuf. + @discussion Generate a big endian physical scatter/gather list from a + given mbuf. Coalesce mbuf chain when the number of segments in the + scatter/gather list exceeds numVectorSegments. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegmentsWithCoalesce(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); +}; + +//=========================================================================== +//=========================================================================== + +/*! @class IOMbufLittleMemoryCursor + @abstract An IOMbufMemoryCursor subclass that outputs a vector of + IOPhysicalSegments in the little endian byte order. + @discussion The IOMbufLittleMemoryCursor would be used when the DMA + hardware requires a little endian address and length pair. This cursor + outputs an array of IOPhysicalSegments that are encoded in little endian + format. +*/ + +class IOMbufLittleMemoryCursor : public IOMbufMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufLittleMemoryCursor) + +public: + +/*! @function withSpecification + @abstract Factory function that creates and initializes an + IOMbufLittleMemoryCursor in one operation. + @discussion See also IOMbufMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns a new mbuf cursor if successfully created and initialized, + 0 otherwise. +*/ + + static IOMbufLittleMemoryCursor * withSpecification(UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function getPhysicalSegments + @abstract Generates a little endian physical scatter/gather list from a + given mbuf. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegments(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); + +/*! @function getPhysicalSegmentsWithCoalesce + @abstract Generates a little endian physical scatter/gather list from a + given mbuf. + @discussion Generate a little endian physical scatter/gather list from a + given mbuf. Coalesce mbuf chain when the number of segments in the + scatter/gather list exceeds numVectorSegments. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegmentsWithCoalesce(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); +}; + +#ifdef __ppc__ + +struct IODBDMADescriptor; + +//=========================================================================== +//=========================================================================== + +/*! @class IOMbufDBDMAMemoryCursor + @abstract An IOMbufMemoryCursor subclass that outputs a vector of + IODBDMADescriptors. +*/ + +class IOMbufDBDMAMemoryCursor : public IOMbufMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufDBDMAMemoryCursor) + +public: + +/*! @function withSpecification + @abstract Factory function that creates and initializes an + IOMbufDBDMAMemoryCursor in one operation. + @discussion See also IOMbufMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns a new mbuf cursor if successfully created and initialized, + 0 otherwise. +*/ + + static IOMbufDBDMAMemoryCursor * withSpecification(UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function getPhysicalSegments + @abstract Generates a DBDMA descriptor list from a given mbuf. + @param packet The mbuf packet. + @param vector Pointer to an array of IODBDMADescriptor for the output list. + @param numVectorSegments Maximum number of IODBDMADescriptors accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegments(mbuf_t packet, + struct IODBDMADescriptor *vector, + UInt32 numVectorSegments = 0); + +/*! @function getPhysicalSegmentsWithCoalesce + @abstract Generates a DBDMA descriptor list from a given mbuf. + @discussion Generate a DBDMA descriptor list from a given mbuf. + Coalesce mbuf chain when the number of elements in the list exceeds + numVectorSegments. + @param packet The mbuf packet. + @param vector Pointer to an array of IODBDMADescriptor for the output list. + @param numVectorSegments Maximum number of IODBDMADescriptors accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegmentsWithCoalesce(mbuf_t packet, + struct IODBDMADescriptor * vector, + UInt32 numVectorSegments = 0); +}; + +#endif /* __ppc__ */ + +#endif /* !_IOKIT_NETWORK_IOMBUFMEMORYCURSOR_H */ + diff --git a/QualcommWireless/include/IOKit/network/IONetworkController.h b/QualcommWireless/include/IOKit/network/IONetworkController.h new file mode 100644 index 0000000..21be744 --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IONetworkController.h @@ -0,0 +1,1716 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKCONTROLLER_H +#define _IONETWORKCONTROLLER_H + +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +/*! @defined kIONetworkControllerClass + @abstract The name of the IONetworkController class. */ + +#define kIONetworkControllerClass "IONetworkController" + +/*! @defined kIOVendor + @abstract A property of IONetworkController objects. + @discussion The kIOVendor property is a property of IONetworkController objects. It has an OSString value that describes the vendor of the network controller. */ + +#define kIOVendor "IOVendor" + +/*! @defined kIOModel + @abstract A property of IONetworkController objects. + @discussion The kIOModel property is a property of IONetworkController objects. It has an OSString value that describes the model of the network controller. */ + +#define kIOModel "IOModel" + +/*! @defined kIORevision + @abstract A property of IONetworkController objects. + @discussion The kIORevision property is a property of IONetworkController objects. It has an OSString value that describes the revision level of the network controller. */ + +#define kIORevision "IORevision" + +/*! @defined kIOFeatures + @abstract A property of IONetworkController objects. + @discussion The kIOFeatures property is a property of IONetworkController objects. It has an OSNumber value that describes generic features defined by IONetworkController that are supported by the + network controller. */ + +#define kIOFeatures "IOFeatures" + +/*! @defined kIOMediumDictionary + @abstract A property of IONetworkController objects. + @discussion The kIOMediumDictionary property is a property of IONetworkController + objects. It has an OSDictionary value that is a container for the + collection of IONetworkMedium objects that represent the media + types supported by the network controller. + Each entry in the dictionary is a key/value pair consisting of + the medium name, and a dictionary value that contains the + properties for that medium entry. */ + +#define kIOMediumDictionary "IOMediumDictionary" + +/*! @defined kIODefaultMedium + @abstract A property of IONetworkController objects. + @discussion The kIODefaultMedium property is a property of IONetworkController + objects. It has an OSString value that describes the name of the + default medium. This definition may change or disappear in the + future. */ + +#define kIODefaultMedium "IODefaultMedium" + +/*! @defined kIOSelectedMedium + @abstract A property of IONetworkController objects. + @discussion The kIOSelectedMedium property is a property of IONetworkController + objects. It has an OSSymbol value that describes the name of the + current selected medium. This name can be used as a key into the + medium dictionary to gather additional information about the + selected medium. */ + +#define kIOSelectedMedium "IOSelectedMedium" + +/*! @defined kIOActiveMedium + @abstract A property of IONetworkController objects. + @discussion The kIOActiveMedium property is a property of IONetworkController + objects. It has an OSSymbol value that describes the name of the + active medium. This is the name of the medium where an active + link has been established. This name can be used as a key into + the medium dictionary to gather additional information about the + active medium. */ + +#define kIOActiveMedium "IOActiveMedium" + +/*! @defined kIOLinkSpeed + @abstract A property of IONetworkController objects. + @discussion The kIOLinkSpeed property is a property of IONetworkController + objects. It has an OSNumber value that describes the speed of the + link established over the active medium in bits per second. */ + +#define kIOLinkSpeed "IOLinkSpeed" + +/*! @defined kIOLinkStatus + @abstract A property of IONetworkController objects. + @discussion The kIOLinkStatus property is a property of IONetworkController + objects. It has an OSNumber value that describes the current network + link status. See IONetworkMedium for the definition of the link + status bits. */ + +#define kIOLinkStatus "IOLinkStatus" + +/*! @defined kIOLinkData + @abstract A property of IONetworkController objects. + @discussion The kIOLinkData property is a property of IONetworkController + objects. It has an OSData value that contains additional information + describing the active link that was established. + Its interpretation is not defined. */ + +#define kIOLinkData "IOLinkData" + +/*! @defined kIOPacketFilters + @abstract A property of IONetworkController objects. + @discussion The kIOPacketFilters property is a property of IONetworkController + objects. It has an OSDictionary value that describes the entire + set of packet filters supported by the controller. Each entry + in the dictionary is a key/value pair consisting of the filter + group name, and an OSNumber describing the set of supported + filters for that group. */ + +#define kIOPacketFilters "IOPacketFilters" + +/*! @defined kIOMACAddress + @abstract A property of IONetworkController objects. + @discussion The kIOMACAddress property is a property of IONetworkController + objects. It has an OSData value that describes the hardware + MAC (media access controller) address, or station address, + of the network controller. */ + +#define kIOMACAddress "IOMACAddress" + +/*! @defined kIOMaxPacketSize + @abstract A property of IONetworkController objects. + @discussion The kIOMaxPacketSize property is a property of IONetworkController + objects. It has an OSNumber value that describes the maximum + packet size supported by the controller. */ + +#define kIOMaxPacketSize "IOMaxPacketSize" + +/*! @defined kIOMinPacketSize + @abstract A property of IONetworkController objects. + @discussion The kIOMinPacketSize property is a property of IONetworkController + objects. It has an OSNumber value that describes the minimum + packet size supported by the controller. */ + +#define kIOMinPacketSize "IOMinPacketSize" + +/*! @defined kIONetworkFilterGroup + @abstract The name assigned to the standard network filter group. */ + +#define kIONetworkFilterGroup "IONetworkFilterGroup" + +/*! @enum StandardPacketFilters + @abstract All standard packet filters. + @discussion Each filter will allow the reception of certain class of packets + depending on its destination MAC address. + @constant kIOPacketFilterUnicast Reception of unicast packets. + @constant kIOPacketFilterBroadcast Reception of broadcast packets. + @constant kIOPacketFilterMulticast Reception of multicast packets + addressed to a set of multicast addresses. + @constant kIOPacketFilterMulticastAll Reception of all multicast + packets. + @constant kIOPacketFilterPromiscuous Reception of all packets. + @constant kIOPacketFilterPromiscuousAll Reception of all packets, + including bad packets. */ + +enum { + kIOPacketFilterUnicast = 0x1, + kIOPacketFilterBroadcast = 0x2, + kIOPacketFilterMulticast = 0x10, + kIOPacketFilterMulticastAll = 0x20, + kIOPacketFilterPromiscuous = 0x100, + kIOPacketFilterPromiscuousAll = 0x200 +}; + +/*! @enum Network Feature Flags + @abstract Feature flags returned by the getFeatures() method. + @constant kIONetworkFeatureNoBSDWait Set this bit in the value + returned by getFeatures() to disable the automatic wait for + "IOBSD" resource by the IONetworkController::start() method. + @constant kIONetworkFeatureHardwareVlan Set this bit in the value + returned by getFeatures() to indicate the controller supports hardware + stripping and stuffing of 802.1q vlan tags. If the controller supports + this feature it must enable it when initializing so that all received + packets delivered to higher layers have the tag stripped. The controller + should use setVlanTag() to provide the tag information out of band. + @constant kIONetworkFeatureSoftwareVlan Set this bit in the value + returned by getFeatures() to indicate that the controller can support software + based vlan by transmitting and receiving packets 4 bytes longer that normal. + @constant kIONetworkFeatureMultiPages Set this bit if the driver is + capable of handling packets coming down from the network stack that + reside in virtually, but not in physically contiguous span of the + external mbuf clusters. In this case, the data area of a packet in + the external mbuf cluster might cross one or more physical pages that + are disjoint, depending on the interface MTU and the packet size. + Such a use of larger than system page size clusters by the network + stack is done for better system efficiency. Drivers that utilize the + IOMbufNaturalMemoryCursor with the getPhysicalSegmentsWithCoalesce + interfaces and enumerate the list of vectors should set this flag + for possible gain in performance during bulk data transfer. + @constant kIONetworkFeatureTSOIPv4 Set this bit to advertise support + for TCP/IPv4 segmentation offload. + @constant kIONetworkFeatureTSOIPv6 Set this bit to advertise support + for TCP/IPv6 segmentation offload. + @constant kIONetworkFeatureTransmitCompletionStatus Set this bit to + advertise the capability to report per-packet transmit completion status. + See IONetworkInterface::reportTransmitCompletionStatus. + @constant kIONetworkFeatureHWTimeStamp Set this bit to advertise + the capability to compute per-packet timestamp in hardware. + @constant kIONetworkFeatureHWTimeStamp Set this bit to advertise + the capability to compute per-packet timestamp in software. +*/ + +enum { + kIONetworkFeatureNoBSDWait = 0x001, + kIONetworkFeatureHardwareVlan = 0x002, + kIONetworkFeatureSoftwareVlan = 0x004, + kIONetworkFeatureMultiPages = 0x008, + kIONetworkFeatureTSOIPv4 = 0x010, + kIONetworkFeatureTSOIPv6 = 0x020, + kIONetworkFeatureTransmitCompletionStatus = 0x040, + kIONetworkFeatureHWTimeStamp = 0x080, + kIONetworkFeatureSWTimeStamp = 0x100, + kIONetworkFeatureLRO = 0x200 +}; + +#ifdef KERNEL +#ifdef __cplusplus + +#include +#include +#include +#include + +class IOCommandGate; +class IOOutputQueue; +class IONetworkMedium; + +/*! @typedef IOPacketBufferConstraints + @discussion Constraint parameters, specified by a driver, + for the data buffer in a packet mbuf. This is observed by + allocatePacket() to satisfy the stated requirements. + @field alignStart Starting address byte alignment. + @field alignLength Buffer length byte alignment. */ + +typedef struct { + UInt32 alignStart; + UInt32 alignLength; + UInt32 reserved[6]; +} IOPacketBufferConstraints; + +// Some frequently used alignment constants. +// +enum { + kIOPacketBufferAlign1 = 1, + kIOPacketBufferAlign2 = 2, + kIOPacketBufferAlign4 = 4, + kIOPacketBufferAlign8 = 8, + kIOPacketBufferAlign16 = 16, + kIOPacketBufferAlign32 = 32 +}; + +/*! @const gIONetworkFilterGroup + @discussion gIONetworkFilterGroup is an OSSymbol object that contains + the name of the standard network filter group as defined by + kIONetworkFilterGroup. */ + +extern const OSSymbol * gIONetworkFilterGroup; + +/*! @class IONetworkController + @abstract Implements the framework for a generic + network controller. + @discussion A subclass of IONetworkController must provide + additional functionality specific for a particular networking type. + In addition, the driver must implement (override) a basic set of + hardware dependent methods to create a working driver. + + IONetworkController attaches itself to the data link layer (DLIL) via + an IONetworkInterface object. A controller object without a companion + interface is not accessible to the networking system. The controller + interacts with DLIL by calling methods defined by the interface object. + And conversely, DLIL will issue commands and packets to the controller + through the interface object. + + IONetworkController will create an IOCommandGate and attach this + event source to an IOWorkLoop object. All commands sent from the + interface object are handled through the IOCommandGate object, + which will serialize access to the controller. Outbound packets sent + from the interface to the controller have no implicit serialization. + Drivers must implement an output function that is thread safe, or use + an IOOutputQueue object which will provide a serialization model. + + Note: IONetworkController internally uses some private messaging constants + in the sys_iokit | sub_iokit_networking range defined in + "IONetworkControllerPrivate.h". If you create a client for your controller + (for example an IOUserClient), and it overrides the IOService::message + method, your client may receive these messages. It should ignore these + messages and pass them to super::message() + */ + +class IONetworkController : public IOService +{ + OSDeclareAbstractStructors( IONetworkController ) + +private: + + IOWorkLoop * _workLoop; + IOCommandGate * _cmdGate; + IOOutputQueue * _outputQueue; + OSSet * _clientSet; + OSCollectionIterator * _clientSetIter; + OSObject * _cmdClient; + UInt32 _alignStart; + UInt32 _alignLength; + UInt32 _alignPadding; + bool _propertiesPublished; + IOLock * _mediumLock; + IODebuggerLockState _debugLockState; + SInt32 _debugLockCount; + OSNumber * _linkStatus; + OSNumber * _linkSpeed; + const OSData * _lastLinkData; + const OSSymbol * _lastActiveMediumName; + const OSSymbol * _lastCurrentMediumName; + mbuf_t _freeList; + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + + bool _broadcastEvent(UInt32 type, void * data = 0); + + static void debugRxHandler(IOService * handler, + void * buffer, + UInt32 * length, + UInt32 timeout); + + static void debugTxHandler(IOService * handler, + void * buffer, + UInt32 length); + + static UInt32 debugLinkStatusHandler(IOService * handler); + static bool debugSetModeHandler(IOService * handler, bool active); + + static IOReturn executeCommandAction(OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3); + + static IOReturn handleCommand(void * target, + void * param0, + void * param1, + void * param2, + void * param3); + +public: + +/*! @function init + @abstract Initializes the IONetworkController object. + @discussion Instance variables are initialized, then super::init() + is called. + @param properties A dictionary object containing a property table + associated with this instance. + @result Returns true on success, false otherwise. +*/ + + virtual bool init(OSDictionary * properties) APPLE_KEXT_OVERRIDE; + +/*! @function start + @abstract Starts the network controller. + @discussion After the controller driver has successfully matched + to a provider, this method is called to start the network controller. + IONetworkController will allocate resources and gather controller + properties in its implementation. No I/O will be performed until + the subclass tries to attach a client object. A driver must override + this method, and call super::start() at the beginning of its own + implementation. Then check the return value to make sure that its + superclass was started successfully before proceeding. Tasks that + are usually performed by a driver's start method are: resource + allocation, hardware initialization, allocation of IOEventSources + and attaching them to a workloop, publishing a medium dictionary, + and finally, attaching an interface object when it is ready to + handle client requests. + @param provider The provider that the controller was matched + (and attached) to. + @result Returns true on success, false otherwise. +*/ + + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + +/*! @function stop + @abstract Stops the network controller. + @discussion The counterpart of start(). The controller has been + instructed to stop running. The stop() method should release + resources and undo actions performed by the start() method. + Subclasses must override this method and call super::stop() + at the end of its implementation. + @param provider The provider that the controller was matched + (and attached) to. */ + + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 +/*! @function message + @abstract Receives messages delivered from an attached provider. + @discussion Handles the kIOMessageDeviceSignaledWakeup message + from a provider identifying the IONetworkController as the wakeup source. + @param type A type defined in IOMessage.h. + @param provider The provider from which the message originates. + @param argument An argument defined by the message type. + @result An IOReturn code defined by the message type. +*/ + + virtual IOReturn message( + UInt32 type, IOService * provider, void * argument ) APPLE_KEXT_OVERRIDE; +#endif + +/*! @typedef IONetworkController::Action + @discussion Definition of a C function that can be called + through executeCommand(). + @param target The first argument passed to action. + @param param0 Action parameter 0. + @param param1 Action parameter 1. + @param param2 Action parameter 2. + @param param3 Action parameter 3. */ + + typedef IOReturn (*Action)(void * target, void * param0, + void * param1, + void * param2, + void * param3); + +/*! @function executeCommand + @abstract Makes a C function call through the command gate. + @discussion This method makes a call to a C function that will be synchronized + with the workloop thread, and any other threads that are called + with the workloop's gate closed. + @param client The client requesting the action. This parameter is not + passed to the function. + @param action Pointer to a C function to be executed. + @param target The first parameter in the action callout. + @param param0 Action parameter 0. + @param param1 Action parameter 1. + @param param2 Action parameter 2. + @param param3 Action parameter 3. + @result Returns the value returned by the action. +*/ + + virtual IOReturn executeCommand(OSObject * client, + Action action, + void * target, + void * param0 = 0, + void * param1 = 0, + void * param2 = 0, + void * param3 = 0); + +/*! @function outputPacket + @abstract Transmits an output packet. + @discussion If an IOOutputQueue was created by createOutputQueue(), + then this method will be called by the output queue object. + Otherwise, an interface object will call this method directly when + it receives an output packet from the data link layer. + + There is no upper limit on the number of mbufs, hence the number of + memory fragments, in the mbuf chain provided. Drivers must be able to + handle cases when the mbuf count might exceed the limit supported by their + DMA engines, and perform coalescing to copy the various memory fragments + into a lesser number of fragments. This complexity can be hidden from + the driver when an IOMbufMemoryCursor is used, which is able to convert + an mbuf chain into a physical address scatter-gather list that will not + exceed a specified number of physically contiguous memory segments. + See IOMbufMemoryCursor. + + The implementation in IONetworkController performs no useful action + and will drop all packets. A driver must override this method and + process the output packet provided. The implementation in the driver + must not block, since this may cause the network stack to be reentered + from an unsafe point. + @param mbuf_t An mbuf chain containing the output packet to be sent on + the network. + @param param A parameter provided by the caller. + @result Returns a return code defined by the caller. +*/ + + virtual UInt32 outputPacket(mbuf_t m, void * param); + +/*! @function getFeatures + @abstract Reports generic features supported by the controller and/or + the driver. + @result This method will always return 0. Subclasses may override + this method and return a bit mask of all supported features. */ + + virtual UInt32 getFeatures() const; + +/*! @function newVendorString + @result Returns a string describing the vendor of the network controller. + The caller is responsible for releasing the string object returned. */ + + virtual const OSString * newVendorString() const; + +/*! @function newModelString + @result Returns a string describing the model of the network controller. + The caller is responsible for releasing the string object returned. */ + + virtual const OSString * newModelString() const; + +/*! @function newRevisionString + @result Returns a string describing the hardware revision of the + network controller. The caller is responsible for releasing the + string object returned. */ + + virtual const OSString * newRevisionString() const; + +/*! @function getSelectedMedium + @abstract Gets the current selected medium. + @discussion If the driver has previously called setSelectedMedium() + to indicate its current media selection, then this method will return + that medium object. Otherwise, the driver's property table is + consulted and a default medium property is examined, and the + corresponding entry in the medium dictionary is returned. + @result Returns the current selected medium, the default medium, or 0. +*/ + + virtual const IONetworkMedium * getSelectedMedium() const; + const IONetworkMedium * getCurrentMedium() const; + +/*! @function getMediumDictionary + @abstract Returns the medium dictionary published by the driver. + @discussion Returns the medium dictionary published by the driver + through publishMediumDictionary(). Use copyMediumDictionary() to + create and get a copy of the medium dictionary. + @result Returns the published medium dictionary, or 0 if the driver has not + yet published a medium dictionary through publishMediumDictionary(). +*/ + + virtual const OSDictionary * getMediumDictionary() const; + +/*! @function copyMediumDictionary + @abstract Returns a copy of the medium dictionary published by the + driver. + @discussion The caller is responsible for releasing the dictionary + object returned. Use getMediumDictionary() to get a reference to the + published medium dictionary instead of creating a copy. + @result Returns a copy of the medium dictionary, or 0 if the driver has not + published a medium dictionary through publishMediumDictionary(). +*/ + + virtual OSDictionary * copyMediumDictionary() const; + +/*! @function getOutputHandler + @abstract Gets the address of the method designated to handle output + packets for the network controller. + @result Returns a pointer to the outputPacket() method. +*/ + + virtual IOOutputAction getOutputHandler() const; + +/*! @function doEnable + @abstract Makes a synchronized call to enable() through executeCommand(). + @discussion Do not use this method, it may be removed in the future. + See enable(). +*/ + + virtual IOReturn doEnable(IOService * client); + +/*! @function doDisable + @abstract Makes a synchronized call to disable() through executeCommand(). + @discussion Do not use this method, it may be removed in the future. + See disable(). +*/ + + virtual IOReturn doDisable(IOService * client); + +/*! @function getCommandGate + @abstract Gets the IOCommandGate object created by IONetworkController. + @discussion When IONetworkController is started, an IOCommandGate object + is instantiated and attached to the workloop returned by getWorkLoop(). + This IOCommandGate object is used internally to synchronize client + commands handled through executeCommand(). Subclasses that need an + IOCommandGate should try to reuse the object returned by this method, + rather than creating a new instance. See IOCommandGate documentation. + @result Returns the IOCommandGate object created by IONetworkController. +*/ + + virtual IOCommandGate * getCommandGate() const; + +/*! @function getHardwareAddress + @abstract Gets the network controller's permanent hardware/station + address. + @discussion This method call is synchronized by the workloop's gate. + @param addr The buffer where the controller's hardware address should + be stored. + @param inOutAddrBytes The size of the address buffer provided by the + client, and replaced by this method with the actual size of + the hardware address in bytes. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn getHardwareAddress(void * addr, + UInt32 * inOutAddrBytes) = 0; + +/*! @function setHardwareAddress + @abstract Sets or changes the station address used by the network + controller. + @discussion This method call is synchronized by the workloop's gate. + @param addr The buffer containing the hardware address provided by + the client. + @param addrBytes The size of the address buffer provided by the + client in bytes. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn setHardwareAddress(const void * addr, + UInt32 addrBytes) = 0; + +/*! @function enable + @abstract Handles an enable request from a client. + @discussion This method handles an enable request from a client. A client will call + enable after it has opened the controller, and before it starts to use + the controller to send and to receive packets over the network. The + client object provided is typecasted using OSDynamicCast, and depending + on whether the client is an IOKernelDebugger or an IONetworkInterface, + then an overloaded enable method that takes a more specific argument + type is called. If the client matches neither type, then + kIOReturnBadArgument is returned. A driver has the option of overriding + this base enable method, or the overloaded form. This method call is + synchronized by the workloop's gate. + @param client The client object requesting the enable. + @result Returns the return value from the overloaded enable() method, or + kIOReturnBadArgument if the client type is unknown. +*/ + + virtual IOReturn enable(IOService * client); + +/*! @function disable + @abstract Handles a disable request from a client. + @discussion This method handles a disable request from a client. A client will call + disable if it has previously enabled the controller, and it no longer + needs to transport packets or perform I/O using the controller. + The client object is typecasted using OSDynamicCast, and depending on + whether the client is an IOKernelDebugger or an IONetworkInterface, + then an overloaded disable method that takes a more specific argument + type is called. If the client matches neither type, then + kIOReturnBadArgument is returned. A driver has the option of overriding + this base disable method, or the overloaded form. This method call is + synchronized by the workloop's gate. + @param client The client object requesting the disable. + @result Returns the return from the overloaded disable() method, or + kIOReturnBadArgument if the client type is unknown. +*/ + + virtual IOReturn disable(IOService * client); + +/*! @function setMaxPacketSize + @abstract A client request to change the maximum packet size. + @discussion This method call is synchronized by the workloop's gate. + @param maxSize The new maximum packet size. + @result Returns kIOReturnUnsupported. Drivers may override this method + and return either kIOReturnSuccess to indicate that the new size + was accepted and is in effect, or an error code to indicate failure. +*/ + + virtual IOReturn setMaxPacketSize(UInt32 maxSize); + +/*! @function getMaxPacketSize + @abstract Gets the maximum packet size supported by the controller. + @param maxSize Pointer to the return value. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn getMaxPacketSize(UInt32 * maxSize) const = 0; + +/*! @function getMinPacketSize + @abstract Gets the minimum packet size supported by the controller. + @param minSize Pointer to the return value. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn getMinPacketSize(UInt32 * minSize) const = 0; + +/*! @function selectMedium + @abstract A client request to change the medium selection. + @discussion This method is called when a client issues a command + for the controller to change its current medium selection. + The implementation must call setSelectedMedium() after the change + has occurred. This method call is synchronized by the workloop's + gate. + @param medium An entry from the published medium dictionary that + represents the selection chosen by the client. + @result Returns kIOReturnUnsupported. Drivers may override this method and + return kIOReturnSuccess if the selection was successful, + or an error code otherwise. +*/ + + virtual IOReturn selectMedium(const IONetworkMedium * medium); + +/*! @function selectMediumWithName + @abstract A client request to change the medium selection. + @discussion This method is called when a client issues a command + for the controller to change its current medium selection. + This implementation will look for an entry in the medium + dictionary published by the driver that is associated with the + key given. If a match is found, then selectMedium() is called to + perform the selection, otherwise an error is reported back to the + client. Subclasses should override selectMedium() and not this + method. This method call is synchronized by the workloop's gate. + @param mediumName An OSSymbol object that describes the name of the + new medium selected by the client. + @result Returns the return from selectMedium() if a matching entry was found + from the medium dictionary. Returns kIOReturnUnsupported if a medium + dictionary does not exist, or kIOReturnBadArgument if the name given + does not match any entry in the medium dictionary. +*/ + + virtual IOReturn selectMediumWithName(const OSSymbol * mediumName); + +/*! @function getPacketFilters + @abstract Gets the set of packet filters supported by the network + controller for the given filter group. + @discussion A subclass must implement this method and report the + set of filters that are supported for the given filter group. + This method call is synchronized by the workloop's gate. + @param group The name of the filter group. + @param filters Pointer to the mask of supported filters returned by + this method. + @result Returns kIOReturnSuccess on success, or an error to indicate a + failure to discover the set of supported filters. +*/ + + virtual IOReturn getPacketFilters(const OSSymbol * group, + UInt32 * filters) const = 0; + +/*! @function enablePacketFilter + @abstract Enables one of the supported packet filters from the + given filter group. + @discussion A client will call this method to enable a supported filter + from the filter group specified. If the client wishes to enable more + than one filter, it must call this method multiple times to enable the + desired set of filters. This method call is synchronized by the + workloop's gate. + @param group The name of the filter group containing the filter to be + enabled. + @param aFilter The filter to enable. + @param enabledFilters All filters currently enabled by the client. + @param options Optional flags for the enable request. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn enablePacketFilter(const OSSymbol * group, + UInt32 aFilter, + UInt32 enabledFilters, + IOOptionBits options = 0) = 0; + +/*! @function disablePacketFilter + @abstract Disables a packet filter that is currently enabled from the + given filter group. + @discussion After a supported filter has been successfully enabled, + a client can call this method to disable that filter. This method call + is synchronized by the workloop's gate. + @param group The name of the filter group containing the filter to be + disabled. + @param aFilter The filter to disable. + @param enabledFilters All filters currently enabled by the client. + @param options Optional flags for the disable request. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn disablePacketFilter(const OSSymbol * group, + UInt32 aFilter, + UInt32 enabledFilters, + IOOptionBits options = 0) = 0; + +/*! @function getOutputQueue + @abstract Gets the IOOutputQueue object created by createOutputQueue(). + @result Returns a reference to the output queue object created by + createOutputQueue(). +*/ + + virtual IOOutputQueue * getOutputQueue() const; + +/*! @function getPacketBufferConstraints + @abstract Gets the controller's packet buffer constraints. + @discussion Called by start() to obtain the constraints on the + memory buffer for each mbuf packet allocated through allocatePacket(). + Drivers can override this method to specify the buffer constraints + imposed by their bus master hardware. Note that outbound packets, + those that originate from the network stack, are not currently + subject to the constraints reported here. + @param constraints A pointer to an IOPacketBufferConstraints + structure that this method is expected to initialize. + See IOPacketBufferConstraints structure definition. +*/ + + virtual void getPacketBufferConstraints( + IOPacketBufferConstraints * constraints) const; + +/*! @function allocatePacket + @abstract Allocates a packet with a data buffer that is larger than + or equal to the size specified. + @discussion This method will always return a single mbuf unless the + size requested (plus the alignment padding) is greater than MCLBYTES. + The data buffer for the mbuf (or an mbuf chain) returned is aligned + according to the constraints reported by getPacketBufferConstraints(). + The length fields in each mbuf returned are set by this method, thus + allowing the mbuf to be passed directly to an IOMbufMemoryCursor object + in order to convert the mbuf to a physical address scatter-gather list. + @param size The minimum size of the data buffer for the mbuf + packet allocated. + @result Returns an mbuf packet, or 0 if allocation failed. +*/ + + virtual mbuf_t allocatePacket(UInt32 size); + +/*! @function copyPacket + @abstract Allocates a new packet, containing data copied from an + existing source packet. + @discussion The source packet is not modified by this method. + @param m The source packet. + @param size The number of bytes to copy. If set to 0, then the + entire data buffer from the source packet is copied. + @result Returns a new packet containing the same data as the source packet. +*/ + + virtual mbuf_t copyPacket(const mbuf_t m, UInt32 size = 0); + +/*! @function replacePacket + @abstract Allocates a new packet to replace an existing packet, the + existing packet is then returned. + @param mp A handle to the existing packet. + @param size If size is 0, then the new packet shall have the same buffer + size as the original packet that is being replaced. Otherwise, the new + packet shall have the buffer size specified by this value. + @result If packet allocation was successful, then a replacement will + take place and the original packet will be returned. Otherwise, 0 + is returned, and the original packet will be left untouched. +*/ + + virtual mbuf_t replacePacket(mbuf_t * mp, UInt32 size = 0); + +/*! @function replaceOrCopyPacket + @abstract A helper method that combines the functionality of + copyPacket() and replacePacket() to process a packet containing + a received frame. + @discussion This method will either make a copy or replace the existing + packet, whichever is more time efficient. Packets containing small frames + are copied, otherwise they are replaced. If replaced, then the existing + packet is returned, and a new packet with the same buffer size is created + to take its place. If copied, the existing packet is left intact, while a + copy is returned that will hold a copy of the data from the source packet. + @param mp A handle to the existing packet that may be replaced. + @param length The number of bytes received held in the packet. + Must be greater than zero. + @param replaced Pointer to a return value that is set to true to indicate + that the existing packet was replaced, or false to indicate that the + existing packet was not replaced, and a copy was created. + @result Returns a replacement or a copy of the existing packet, or 0 if packet + allocation failed. +*/ + + virtual mbuf_t replaceOrCopyPacket(mbuf_t * mp, + UInt32 length, + bool * replaced); + + enum { + kDelayFree = 0x01 + }; + +/*! @function freePacket + @abstract Releases the packet given back to the free pool. + @param mbuf_t The packet to be freed. + @param options When kDelayFree option is set, then the packet + provided to this function will be queued on the free packet queue. + A subsequent call to releaseFreePackets() will release all queued + packets by making a single BSD function call. Without the kDelayFree + option, the packet provided will be released immediately. +*/ + + virtual void freePacket(mbuf_t, IOOptionBits options = 0); + +/*! @function releaseFreePackets + @abstract Releases all packets held in the free packet queue. + @discussion The free packet queue is not protected by a lock. This + function must be called in a single-threaded manner with respect to + all calls to freePacket() with the kDelayFree option set. + @result Returns the number of packets queued and released. +*/ + + virtual UInt32 releaseFreePackets(); + +/*! @enum TCP/IP Checksums + @abstract TCP/IP checksums that may be supported by the + hardware. + @constant kChecksumFamilyTCPIP A value that describes the collection + of TCP/IP checksums. + @constant kChecksumIP An IP header checksum. + @constant kChecksumTCP A TCP checksum that covers the TCP header and TCP + data. + @constant kChecksumUDP A UDP checksum that covers the UDP header and UDP + data. + @constant kChecksumTCPIPv6 A TCP checksum that covers the IPv6 pseudo header, + TCP header and TCP data. + @constant kChecksumUDPIPv6 A UDP checksum that covers the IPv6 pseudo header, + UDP header and UDP data. + @constant kChecksumTCPNoPseudoHeader A TCP checksum that covers the TCP + header and the TCP data, but the pseudo header is not included in the + checksum computation. A partial 16-bit checksum value must be provided + to allow the protocol stacks to calculate and verify the final checksum. + This type of checksum is not currently supported on the output path. + @constant kChecksumUDPNoPseudoHeader A UDP checksum that covers the UDP + header and the UDP data, but the pseudo header is not included in the + checksum computation. A partial 16-bit checksum value must be provided + to allow the protocol stacks to calculate and verify the final checksum. + This type of checksum is not currently supported on the output path. + @constant kChecksumTCPSum16 The hardware has a simple checksum engine + that can perform a TCP style ones complement sum of 16-bit words over + a certain range of bytes in a packet. The hardware does not have the + ability to scan for IP or TCP headers, and the driver must pass/get + additional parameter(s) to or from the protocol stack to coordinate + the checksumming effort. +*/ + + enum { + kChecksumFamilyTCPIP = 0x00000001, + kChecksumIP = 0x0001, + kChecksumTCP = 0x0002, + kChecksumUDP = 0x0004, + kChecksumTCPIPv6 = 0x0020, + kChecksumUDPIPv6 = 0x0040, + kChecksumTCPNoPseudoHeader = 0x0100, + kChecksumUDPNoPseudoHeader = 0x0200, + kChecksumTCPSum16 = 0x1000 + }; + +/*! @function getChecksumSupport + @abstract Gets checksums that are supported by the network controller for + the given checksum family. + @discussion A network controller that is capable of inserting and verifying + checksums on output and input packets, should override this method and + advertise its capability in order to assist or offload the software checksum + calculations performed by the protocol stacks. + @param checksumMask A pointer to the mask of supported checksums returned + by this method. + @param checksumFamily A value that specifies the checksum family. + @param isOutput Set to true to query the support for checksum insertion on + output packets, or false to query the support for checksum verification + on input packets. Controllers that have symmetric hardware checksum support + can return a fixed checksum mask value, and ignore this argument. + @result Default return is kIOReturnUnsupported. Controllers that override + this method must return kIOReturnSuccess. Any other return value will be + interpretated as a lack of checksum support, regardless of the value + returned through the first argument. +*/ + + virtual IOReturn getChecksumSupport( UInt32 * checksumMask, + UInt32 checksumFamily, + bool isOutput ); + +/*! @function setChecksumResult + @abstract Encodes a received packet with the checksum result reported + by the hardware. + @discussion A network controller that can verify the checksum(s) for a + received packet, should call this method to encode the result on the + packet, before passing it up towards the protocol stacks. + @param packet An mbuf containing a packet that has been checksummed by + the hardware. + @param checksumFamily A value that specifies the checksum family. + @param resultMask A mask of all checksums that were checked or computed. + Setting a bit implies that the driver is able to report the result of + the checksum computation, by asserting the validity of the checksum, + or by returning a partial checksum value. + @param validMask A mask of all checksums are were computed and verified + by the hardware as valid. Certain types of checksum performed by the + hardware are inheritely incomplete, and therefore should never be marked + as valid. A checksum cannot be marked valid unless it has also been + checked. + @param param0 Optional parameter 0, defaults to 0. + @param param1 Optional parameter 1, defaults to 0. + @result Returns true if the checksum family is valid and the packet has been + encoded with the checksum result provided, false otherwise. +*/ + + virtual bool setChecksumResult( mbuf_t packet, + UInt32 checksumFamily, + UInt32 resultMask, + UInt32 validMask, + UInt32 param0 = 0, + UInt32 param1 = 0 ); + +/*! @function getChecksumDemand + @abstract Fetches the demand for hardware checksum computation and insertion + for the given packet before it is transmitted on the network. + @discussion A network controller that can insert a checksum for output + packets must call this method to obtain the set of checksums that it must + compute, and insert into the appropriate fields in the given output packet. + @param packet An mbuf containing a packet that may be missing one or more + checksums in the specified checksum family. + @param checksumFamily A value that specifies the checksum family. + @param demandMask A mask of all checksums that the hardware must compute + and insert into the appropriate checksum fields in the packet. + @param param0 Optional parameter 0, defaults to 0. + @param param1 Optional parameter 1, defaults to 0. +*/ + + virtual void getChecksumDemand( const mbuf_t packet, + UInt32 checksumFamily, + UInt32 * demandMask, + void * param0 = 0, + void * param1 = 0 ); + +/*! @function publishMediumDictionary + @abstract Publishes a dictionary of IONetworkMedium objects to + advertise the media selection supported by the network controller. + @discussion Called by drivers to publish their medium dictionary. + Each entry in the dictionary is an IONetworkMedium object that + represents a single medium that is supported by the controller. + This method will make a copy of the dictionary provided, then add + the copy to the driver's property table. The dictionary provided + can be released by the caller upon returning from this method. + It is permissible to call this method multiple times, which may be + necessary if the hardware's media capability changes dynamically. + However, if the capability is static, which is often the case, + then a driver will typically call this method only once from + its start() method. + + Several methods depend on the presence of a medium dictionary. + They should be called after the medium dictionary has been + published. Those methods are: + setSelectedMedium() + getSelectedMedium() + getMediumDictionary() + copyMediumDictionary() + + @param mediumDict A dictionary of IONetworkMedium objects. + @result Returns true if the dictionary is valid, and was successfully + exported to the property table, false otherwise. +*/ + + virtual bool publishMediumDictionary(const OSDictionary * mediumDict); + +/*! @function setSelectedMedium + @abstract Designates an entry in the published medium dictionary as + the current selected medium. + @discussion After the driver has configured the hardware to select + one of its supported media types, it must call this method to inform + its parent about the change that has occurred. IONetworkController + will update a property in the registry to reflect the current selection. + @param medium A medium object representing the current selection. + @result Returns true if the property table update was successful, + false if the update failed, or if the medium provided does not match + any entry from the published medium dictionary. +*/ + + virtual bool setSelectedMedium(const IONetworkMedium * medium); + bool setCurrentMedium(const IONetworkMedium * medium); + +/*! @function setLinkStatus + @abstract Reports the link status and the active medium. + @discussion Drivers must call this method when a link change is + detected. IONetworkController will update the link status properties + in the registry, and generate an event to inform the upper layers + about the change. + @param status Link status bits. + See IONetworkMedium for the definition of the link status bits. + @param activeMedium An object in the published medium dictionary + that represents the active medium. This may not be the same as + the selected medium. Set this to 0 if the link is inactive. + @param speed Link speed in units of bits per second. If zero, then + the link speed is taken from the medium object provided. + @param data An OSData containing any additional link parameter that + the driver wishes to publish to the registry. + @result Returns true if all link properties were successfully updated, + false otherwise. +*/ + + virtual bool setLinkStatus( + UInt32 status, + const IONetworkMedium * activeMedium = 0, + UInt64 speed = 0, + OSData * data = 0); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 +/*! @function systemWillShutdown + @abstract Handles system shutdown and restart notifications. + @discussion Overrides IOService::systemWillShutdown in order + to notify network clients that the power-managed controller should be disabled. + As a result, drivers can expect their disable method to be called + before system shutdown or restart. This implementation is synchronous and can + block before calling IOService::systemWillShutdown and return. + @param specifier + kIOMessageSystemWillPowerOff or kIOMessageSystemWillRestart. + @see //apple_ref/cpp/instm/IOService/systemWillShutdown/void/(IOOptionBits) IOService::systemWillShutdown +*/ + + virtual void systemWillShutdown( IOOptionBits specifier ) APPLE_KEXT_OVERRIDE; + + /* Override IOService::setAggressiveness() */ + + virtual IOReturn setAggressiveness( + unsigned long type, unsigned long newLevel ) APPLE_KEXT_OVERRIDE; +#endif + +protected: + +/*! @function free + @abstract Frees the IONetworkController object. + @discussion Frees the IONetworkController object by releasing all + allocated resources, followed by a call to super::free(). +*/ + + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! @function registerWithPolicyMaker + @abstract Implemented by controller drivers to register with + the power management policy-maker. + @discussion Drivers that are able to power manage their hardware + should override this method and register with the policy-maker + provided by calling IOService::registerPowerDriver(). + IONetworkController will call this method before the initial + attempt is made to attach a client. + @param policyMaker The policy-maker chosen to manage power for + this network controller. + @result Returns kIOReturnSuccess on success, kIOReturnUnsupported if the + driver does not support power management, or an appropriate error + return code. The default return is kIOReturnUnsupported. */ + + virtual IOReturn registerWithPolicyMaker(IOService * policyMaker); + +/*! @function createWorkLoop + @abstract Method called by IONetworkController prior to the initial + getWorkLoop() call. + @discussion Before IONetworkController calls getWorkLoop() in its + start() method, it will call createWorkLoop() to make sure that a + subclass that wants to create a workloop, will do so before its + first use. + @result Returns true to indicate success, false otherwise. Returning false + will fail IONetworkController::start(). +*/ + + virtual bool createWorkLoop(); + +/*! @function prepare + @abstract Prepares the controller before an IOService is created and + attached as a client. + @discussion This method is called by attachInterface() or + attachDebuggerClient() to prepare the controller before the new client + object is attached. This method will call publishProperties() to publish + controller capabilities and properties that may be used by client objects. + However, publishProperties() will be called only once, even if prepare() + is called multiple times. This method call is synchronized by the + workloop's gate. + @result Returns kIOReturnSuccess on success, or an error code otherwise. + Returning an error will fail the client attach. +*/ + + virtual IOReturn prepare(); + +/*! @function publishProperties + @abstract Publishes controller properties and capabilities. + @discussion Called by IONetworkController to discover controller + properties, and publish them to the property table in the I/O Kit + Registry. This method is called once by prepare(). + @result Returns true if all properties were discovered and published + successfully, false otherwise. Returning false will prevent client + objects from attaching to the controller, since a property that + a client relies upon may be missing. */ + + virtual bool publishProperties(); + +/*! @function getCommandClient + @abstract Gets the command client object. + @discussion Methods called on the workloop context to service a + client request can call this method to get the client object that + initiated the command. + @result Returns the command client. If the caller is not running on the + workloop thread, or if the thread does not have the workloop's gate + closed, then 0 is returned. +*/ + + virtual OSObject * getCommandClient() const; + +/*! @function handleOpen + @abstract Handles a client open. + @discussion This method handles a client open on the controller object. IOService + calls this method with the arbitration lock held. Subclasses + should not override this method. + @param client The client that is attempting to open the controller. + @param options Not used. See IOService. + @param argument Not used. See IOService. + @result Returns true to accept the client open, false to refuse it. +*/ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * argument) APPLE_KEXT_OVERRIDE; + +/*! @function handleClose + @abstract Handles a client close. + @discussion This method handles a close from one of the client objects. IOService + calls this method with the arbitration lock held. Subclasses + should not override this method. + @param client The client that is closing the controller. + @param options Not used. See IOService. +*/ + + virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE; + +/*! @function handleIsOpen + @abstract Queries whether a client has an open on the controller. + @discussion This method is always called by IOService with the + arbitration lock held. Subclasses should not override this method. + @result Returns true if the specified client, or any client if none (0) is + specified, presently has an open on this object. +*/ + + virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE; + +/*! @function enable + @abstract A request from an interface client to enable the controller. + @discussion This method is called by an interface client to enable the controller. + Upon receiving this command, the controller driver must bring up the + hardware and become ready to transmit and receive packets. A driver + should also delay the allocation of most runtime resources until this + method is called in order to conserve system resources. This method call + is synchronized by the workloop's gate. + @param interface The interface client object that requested the enable. + @result Returns kIOReturnUnsupported. Drivers that override this method must + return kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn enable(IONetworkInterface * interface); + +/*! @function disable + @abstract A request from an interface client to disable the controller. + @discussion This method is called by an interface client to disable the controller. + This method should stop the hardware and disable hardware interrupt + sources. Any resources allocated by enable() should also be deallocated. + This method call is synchronized by the workloop's gate. + @param interface The interface object that requested the disable. + @result kIOReturnUnsupported. Drivers that override this method must + return Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn disable(IONetworkInterface * interface); + +/*! @function attachInterface + @abstract Attaches a new network interface client object. + @discussion This method creates a new network interface object and attaches + it as a client of the controller. The createInterface() method + is used to allocate and to initialize the interface, followed by a call to + configureInterface() to configure the interface. Subclasses + may override those two methods to customize the new interface object. + Before this method returns, registerService() is called on the + interface to start matching, which will ultimately attach the interface + to the networking stack. + Drivers will typically call this method from their start() + method after they are ready to process interface requests. This has the + desirable effect of preventing the busyState at the IOService + root from becoming zero before the interface object has completed matching, + which then holds off the user process that is waiting for I/O Kit to become + quiet before assigning BSD names to all interfaces. Drivers that are unable + to trigger interface matching synchronously from their start() + method should instead call adjustBusy to manually increment + the busyState, then followed by a busyState + decrement after attaching and registering the interface, or after a + reasonable timeout. + @param interface Upon success (return value is true), the + pointer to the interface object will be written to the argument provided. + @param doRegister If true, start interface matching before returning. + Drivers can pass false to postpone interface matching, then + register the interface when ready. + @result Returns true on success, false otherwise. +*/ + + virtual bool attachInterface(IONetworkInterface ** interface, + bool doRegister = true); + +/*! @function detachInterface + @abstract Detaches an interface client object. + @discussion This method will verify that the object provided is indeed + an IONetworkInterface instance, and then call its terminate() method. + Note that an interface object will close and detach from its + controller after the data link layer has removed all references to + all data structures exposed by the interface. The interface object + should be released following this call. + @param interface An interface object to be detached and terminated. + @param sync If true, the interface is terminated synchronously. + This may cause this method to block for an indeterminate + amount of time. */ + + virtual void detachInterface(IONetworkInterface * interface, + bool sync = false); + +/*! @function createInterface + @abstract Creates a new network interface object. + @discussion This method is called by attachInterface() to perform + allocation and initialization of a new interface object. A subclass of + IONetworkController must implement this method and return a matching + interface object. For example, IOEthernetController's implementation + will return an IOEthernetInterface object when createInterface() is + called. + @result Returns a newly allocated and initialized interface object. +*/ + + virtual IONetworkInterface * createInterface() = 0; + +/*! @function configureInterface + @abstract Configures a newly created network interface object. + @discussion This method configures an interface object that was created by + createInterface(). Subclasses can override this method to customize + and examine the interface object that will be attached to the + controller as a client. + @param interface The interface object to be configured. + @result Returns true if the operation was successful, false otherwise + (this will cause attachInterface() to fail and return 0). +*/ + + virtual bool configureInterface(IONetworkInterface * interface); + +/*! @function createOutputQueue + @abstract Creates an IOOutputQueue to handle output packet queueing, + and also to resolve contention for the controller's transmitter from + multiple client threads. + @discussion This method is called by start() to create an IOOutputQueue object to + handle output packet queueing. The default implementation will always + return 0, hence no output queue will be created. A driver may override + this method and return a subclass of IOOutputQueue. IONetworkController + will keep a reference to the queue created, and will release this + object when IONetworkController is freed. Also see getOutputQueue(). + @result Returns a newly allocated and initialized IOOutputQueue object. +*/ + + virtual IOOutputQueue * createOutputQueue(); + +/*! @function enable + @abstract An enable request from an IOKernelDebugger client. + @discussion Drivers that provide debugging support may either override + this method and set up the hardware to support the polled-mode send and + receive methods, receivePacket() and sendPacket(), or override the base + enable() and disable() methods that take an IOService argument. + @param debugger The IOKernelDebugger client requesting the enable. + @result Returns kIOReturnSuccess. Drivers must return kIOReturnSuccess + on success, or an error otherwise. +*/ + + virtual IOReturn enable(IOKernelDebugger * debugger); + +/*! @function disable + @abstract A disable request from an IOKernelDebugger client. + @discussion Drivers that provide debugging support may either override + this method to disable support for the polled-mode send and receive + methods, or override the base enable() and disable() methods that + take an IOService argument. + @param debugger The IOKernelDebugger client requesting the disable. + @result Returns kIOReturnSuccess. Drivers must return kIOReturnSuccess + on success, or an error otherwise. +*/ + + virtual IOReturn disable(IOKernelDebugger * debugger); + +/*! @function attachDebuggerClient + @abstract Attaches a new IOKernelDebugger client object. + @discussion This method allocates an IOKernelDebugger object and attaches it as + a client. Having a debugger client implies that the controller + supports kernel debugging, and therefore must implement the two + polled-mode methods that are called by the debugger client. See + sendPacket() and receivePacket(). Only a single debugger client + should be attached to each controller. + @param debuggerP A handle that will return the new + IOKernelDebugger object created. + @result Returns true on success, false otherwise. +*/ + + virtual bool attachDebuggerClient(IOKernelDebugger ** debuggerP); + +/*! @function detachDebuggerClient + @abstract Detaches an IOKernelDebugger client object. + @discussion This method detaches and terminates the IOKernelDebugger client object + provided. A synchronous termination is issued, and this method will + return after the debugger client has been terminated. The debugger + client should be released following this call. + @param debugger The IOKernelDebugger object to be detached and + terminated. If the argument provided is NULL or is not an + IOKernelDebugger, this method will return immediately. +*/ + + virtual void detachDebuggerClient(IOKernelDebugger * debugger); + +/*! @function reserveDebuggerLock + @abstract Takes the global debugger lock. + @discussion This method should not be used. Instead, call the + lock() method provided by IOKernelDebugger. +*/ + + void reserveDebuggerLock(); + +/*! @function releaseDebuggerLock + @abstract Releases the global debugger lock. + @discussion This method should not be used. Instead, call the + unlock() method provided by IOKernelDebugger. +*/ + + void releaseDebuggerLock(); + +/*! @function receivePacket + @abstract Debugger polled-mode receive handler. + @discussion This method must be implemented by a driver that supports + kernel debugging. After a debugger client has been attached through + attachDebuggerClient(), this method will be called by the debugger + client to poll for an incoming packet when the kernel debugger is active. + This method may be called from the primary interrupt context, and the + implementation must avoid any memory allocation, and must never block. + The receivePacket() method in IONetworkController is used as a placeholder, + it performs no useful action, and should not be called. A driver that + attaches a debugger client must override this method. + @param pkt Address of a receive buffer where the received packet should + be stored. This buffer has room for 1518 bytes. + @param pktSize Address where the number of bytes received must be + recorded. Set this to zero if no packets were received during + the timeout interval. + @param timeout The maximum amount of time in milliseconds to poll for + a packet to arrive before this method must return. +*/ + + virtual void receivePacket(void * pkt, UInt32 * pktSize, UInt32 timeout); + +/*! @function sendPacket + @abstract Debugger polled-mode transmit handler. + @discussion This method must be implemented by a driver that supports + kernel debugging. After a debugger client has been attached through + attachDebuggerClient(), this method will be called by the debugger + to send an outbound packet only when the kernel debugger is active. + This method may be called from the primary interrupt context, and the + implementation must avoid any memory allocation, and must never block. + The sendPacket() method in IONetworkController is used as a placeholder, + it performs no useful action, and should not be called. A driver that + attaches a debugger client must override this method. + @param pkt Pointer to a transmit buffer containing the packet to be + sent on the network. + @param pktSize The size of the transmit buffer in bytes. +*/ + + virtual void sendPacket(void * pkt, UInt32 pktSize); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_7 + +/*! @function getDebuggerLinkStatus + @abstract Debugger polled-mode link status handler. + @discussion This method should be implemented by a driver that wishes to support + early availability kernel debugging. After a debugger client has been attached through + attachDebuggerClient(), this method will be called by the debugger + to poll for link status availability only when the kernel debugger is active. + This method may be called from the primary interrupt context. As a result, the + implementation must avoid any memory allocation, not use spinlocks, and + never block. + + The getDebuggerLinkStatus() method in IONetworkController is used as a placeholder + and always reports that the link is up. A driver that attaches a debugger client + should override this method. The driver should do any setup required to make + sure the link is available for use. Prior to sending or receiving data, KDP will call this + function repeatedly until it indicates that the link is both valid and active + (kIONetworkLinkValid | kIONetworkLinkActive). + + @result Link status bits. See IONetworkMedium for the definition of the link status bits. +*/ + virtual UInt32 getDebuggerLinkStatus(void); + +/*! @function setDebuggerMode + @abstract Set debugger mode for network drivers. + @discussion This method should be implemented by a driver that wishes to be notified when + entering or leaving KDP. After a debugger client has been attached through + attachDebuggerClient(), this method will be called by the debugger + to inform the driver that the kernel debugger is going active or inactive. + This method may be called from the primary interrupt context. As a result, the + implementation must avoid any memory allocation, not use spinlocks, and + never block. + + The setDebuggerMode() method in IONetworkController is used as a placeholder + and doesn't do anything. If a driver wishes to perform specific actions based upon whether + or not the debugger is active or not, it should override this method. For example, drivers + may wish to alter power management settings or perform other chipset reconfigurations based + upon the active debugger state. + + @param active Set to true if entering KDP and false if leaving KDP. + @result Returns true on success and false otherwise. +*/ + virtual bool setDebuggerMode(bool active); + + // Virtual function padding + OSMetaClassDeclareReservedUsed( IONetworkController, 0); // getDebuggerLinkStatus + OSMetaClassDeclareReservedUsed( IONetworkController, 1); // setDebuggerMode + +#else + // Virtual function padding + OSMetaClassDeclareReservedUnused( IONetworkController, 0); + OSMetaClassDeclareReservedUnused( IONetworkController, 1); +#endif + +#ifdef __PRIVATE_SPI__ +public: + +/*! @function getMbufServiceClass + @discussion Get the service class of an mbuf packet. + @param mbuf The mbuf to get the service class of. + @result The service class +*/ + static IOMbufServiceClass getMbufServiceClass( mbuf_t mbuf ); + +/*! @function attachAuxiliaryDataToPacket + @abstract Attach family or driver specific data to a mbuf packet. + @discussion Memory is allocated for the auxiliary data and attached to + the packet. The data provided is then copied to the allocated memory. + Attaching auxiliary data to a packet which already has auxiliary data + attached will fail. The existing auxiliary data must be detached from the + packet and freed using removeAuxiliaryDataFromPacket before + attaching new data. Freeing the packet will also free any memory allocated + for auxiliary data. + @param packet The mbuf packet to attach the auxiliary data to. The packet + must point to a header mbuf with MBUF_PKTHDR flag set. + @param data Pointer to the auxiliary data provided by the caller. + This cannot be NULL. + @param length The length of the auxiliary data in bytes. + This must be greater than zero. + @param family The interface family defined in net/kpi_interface.h. + @param subFamily Reserved for future use. + @result kIOReturnSuccess upon success, or an error code + otherwise. +*/ + static IOReturn attachAuxiliaryDataToPacket( + mbuf_t packet, + const void * data, + IOByteCount length, + uint32_t family = 0, + uint32_t subFamily = 0 ); + +/*! @function removeAuxiliaryDataFromPacket + @discussion Remove and free any driver auxiliary data associated with + the packet. + @param packet The mbuf packet to remove the auxiliary data from. +*/ + static void removeAuxiliaryDataFromPacket( + mbuf_t packet ); + +/*! @function outputStart + @abstract An indication to the driver to dequeue and transmit packets + waiting in the interface output queue. + @discussion A driver that supports the pull output model must override this + method, which will be called by a per-interface output thread when a packet + is added to the interface output queue. In response, driver must verify that + free transmit resources are available, then dequeue one or more packets by + calling IONetworkInterface::dequeueOutputPackets(). Packets + removed from the queue are owned by the driver, and should be immediately + prepared for transmission. Additional software queueing at the driver layer + to store the dequeued packets for delayed transmission is highly discouraged + unless absolutely necessary. If transmit resources are exhausted, the driver + should quickly return kIOReturnNoResources to force the output + thread to retry later, otherwise the output thread will continue to call + this method until the output queue is empty. When driver creates a single + network interface, this method will execute in a single threaded context. + However, it is the driver's responsibility to protect transmit resources + that are shared with other driver threads. To simplify drivers that wish to + process output packets on their work loop context, the family provides an + option to force the output thread to always call this method through a + runAction(). However this can have negative performance + implications due to extra locking and serializing the output thread against + other work loop events. Another option that drivers can deploy to + synchronize against the output thread is to issue a thread stop before + touching any shared resources. But this should be used sparingly on the + data path since stopping the output thread can block. + @param interface The network interface with packet(s) to transmit. + @param options Always zero. + @result kIOReturnSuccess on success, output thread will + continue calling the driver until the output queue is empty. + kIOReturnNoResources when there is a temporary driver resource + shortage. +*/ + virtual IOReturn outputStart( + IONetworkInterface * interface, + IOOptionBits options ); + + OSMetaClassDeclareReservedUsed( IONetworkController, 2); + +/*! @function setInputPacketPollingEnable + @abstract Informs the driver when input polling is enabled or disabled. + @discussion A driver that supports input polling should override this + method to handle the transition from the default push-model, where a + hardware interrupt causes the driver to push input packets to the network + stack, to the pull-model where a poller thread will periodically poll the + driver for input packets. When polling is enabled, receive interrupt should + be masked OFF. This method is always called on driver's work loop context. + @param interface The interface that has enabled or disabled input polling. + @param enabled true if input polling is enabled, + false if input polling is disabled. + @result Driver should return kIOReturnSuccess if the transition + to/from polled-mode was successful, or an error code otherwise. +*/ + virtual IOReturn setInputPacketPollingEnable( + IONetworkInterface * interface, + bool enabled ); + + OSMetaClassDeclareReservedUsed( IONetworkController, 3); + +/*! @function pollInputPackets + @abstract Called by the interface poller thread to retrieve input packets + from the driver. + @discussion A driver that supports input polling must override this method + and pass any input packets to the network interface. For each input packet, + driver must call IONetworkInterface::enqueueInputPacket and + pass the pollQueue argument to add the packet to the polling + queue. This should continue until the maximum packet count is reached, or + the driver runs out of input packets. The poller can be configured to call + this method on the driver's work loop context. + @param interface The interface that is polling packets from the driver. + @param maxCount The maximum number of packets that the poller can accept. + @param pollQueue The polling queue that should be passed to + IONetworkInterface::enqueueInputPacket. Do not cache or use + this pointer after the method returns. + @param context The family will always pass zero. This can be used by the + driver for calls originating from the driver. E.g. A driver may choose to + unify polled-mode and interrupt-mode input packet handling and call this + method from its receive interrupt handler and pass a non-zero context to + distinguish the calling context. +*/ + virtual void pollInputPackets( + IONetworkInterface * interface, + uint32_t maxCount, + IOMbufQueue * pollQueue, + void * context ); + + OSMetaClassDeclareReservedUsed( IONetworkController, 4); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9 + +/*! @function networkInterfaceNotification + @abstract Receives notification from an attached network interface. + @discussion An attached network interface invokes this method to notify + the driver about an interface state change or an event from the networking + stack. The family does not synchronize the call using the driver's work + loop. + @param interface The interface that issued the notification. + @param type The type of notification. + @param argument Optional data associated with the notification. Can be + NULL if the notification does not provide in-band data. + @result Default implementation returns kIOReturnUnsupported. + Driver should return kIOReturnSuccess if the notification + was handled. +*/ + virtual IOReturn networkInterfaceNotification( + IONetworkInterface * interface, + uint32_t type, + void * argument ); + + OSMetaClassDeclareReservedUsed( IONetworkController, 5); + +#else + + OSMetaClassDeclareReservedUnused( IONetworkController, 5); + +#endif + +#else /* !__PRIVATE_SPI__ */ + OSMetaClassDeclareReservedUnused( IONetworkController, 2); + OSMetaClassDeclareReservedUnused( IONetworkController, 3); + OSMetaClassDeclareReservedUnused( IONetworkController, 4); + OSMetaClassDeclareReservedUnused( IONetworkController, 5); +#endif /* !__PRIVATE_SPI__ */ + OSMetaClassDeclareReservedUnused( IONetworkController, 6); + OSMetaClassDeclareReservedUnused( IONetworkController, 7); + OSMetaClassDeclareReservedUnused( IONetworkController, 8); + OSMetaClassDeclareReservedUnused( IONetworkController, 9); + OSMetaClassDeclareReservedUnused( IONetworkController, 10); + OSMetaClassDeclareReservedUnused( IONetworkController, 11); + OSMetaClassDeclareReservedUnused( IONetworkController, 12); + OSMetaClassDeclareReservedUnused( IONetworkController, 13); + OSMetaClassDeclareReservedUnused( IONetworkController, 14); + OSMetaClassDeclareReservedUnused( IONetworkController, 15); + OSMetaClassDeclareReservedUnused( IONetworkController, 16); + OSMetaClassDeclareReservedUnused( IONetworkController, 17); + OSMetaClassDeclareReservedUnused( IONetworkController, 18); + OSMetaClassDeclareReservedUnused( IONetworkController, 19); + OSMetaClassDeclareReservedUnused( IONetworkController, 20); + OSMetaClassDeclareReservedUnused( IONetworkController, 21); + OSMetaClassDeclareReservedUnused( IONetworkController, 22); + OSMetaClassDeclareReservedUnused( IONetworkController, 23); + OSMetaClassDeclareReservedUnused( IONetworkController, 24); + OSMetaClassDeclareReservedUnused( IONetworkController, 25); + OSMetaClassDeclareReservedUnused( IONetworkController, 26); + OSMetaClassDeclareReservedUnused( IONetworkController, 27); + OSMetaClassDeclareReservedUnused( IONetworkController, 28); + OSMetaClassDeclareReservedUnused( IONetworkController, 29); + OSMetaClassDeclareReservedUnused( IONetworkController, 30); + OSMetaClassDeclareReservedUnused( IONetworkController, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IONETWORKCONTROLLER_H */ diff --git a/QualcommWireless/include/IOKit/network/IONetworkData.h b/QualcommWireless/include/IOKit/network/IONetworkData.h new file mode 100644 index 0000000..9b61df2 --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IONetworkData.h @@ -0,0 +1,477 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKDATA_H +#define _IONETWORKDATA_H + +#define IONetworkParameter IONetworkData // FIXME + +/*! @enum NetworkDataAccessTypes + @abstract Constants that describe access types. + @constant kIONetworkDataAccessTypeRead Read access. + @constant kIONetworkDataAccessTypeWrite Write access (deprecated). + @constant kIONetworkDataAccessTypeReset Reset access (deprecated). + @constant kIONetworkDataAccessTypeSerialize Serialization access. +*/ + +enum { + kIONetworkDataAccessTypeRead = 0x01, + kIONetworkDataAccessTypeWrite = 0x02, + kIONetworkDataAccessTypeReset = 0x04, + kIONetworkDataAccessTypeSerialize = 0x08, + kIONetworkDataAccessTypeMask = 0xff +}; + +/*! @define kIONetworkDataBasicAccessTypes + @discussion The default access types supported by an IONetworkData + object. Allow read() and serialize(). */ + +#define kIONetworkDataBasicAccessTypes \ + (kIONetworkDataAccessTypeRead | kIONetworkDataAccessTypeSerialize) + +/*! @enum NetworkDataBufferTypes + @abstract The types of data buffers that can be managed by an IONetworkData object. + @constant kIONetworkDataBufferTypeInternal An internal data buffer + allocated by the init() method. + @constant kIONetworkDataBufferTypeExternal An external (persistent) data + buffer. + @constant kIONetworkDataBufferTypeNone No data buffer. The only useful + action perfomed by an IONetworkData object with this buffer type + is to call the access notification handler. +*/ + +enum { + kIONetworkDataBufferTypeInternal = 0, + kIONetworkDataBufferTypeExternal, + kIONetworkDataBufferTypeNone +}; + +/*! @defined kIONetworkDataBytes + @abstract A property of IONetworkData objects. + @discussion The kIONetworkDataBytes property is an OSData that describes + the data buffer of an IONetworkData object. This property is present + only if kIONetworkDataAccessTypeSerialize access is supported. +*/ + +#define kIONetworkDataBytes "Data" + +/*! @defined kIONetworkDataAccessTypes + @abstract A property of IONetworkData objects. + @discussion The kIONetworkDataAccessTypes property is an OSNumber that + describes the supported access types of an IONetworkData object. +*/ + +#define kIONetworkDataAccessTypes "Access Types" + +/*! @defined kIONetworkDataSize + @abstract A property of IONetworkData objects. + @discussion The kIONetworkDataSize property is an OSNumber that + describes the size of the data buffer of an IONetworkData object. +*/ + +#define kIONetworkDataSize "Size" + +#ifdef KERNEL + +#include +#include + +/*! @class IONetworkData + @abstract An object that manages a fixed-size named buffer. + @discussion An IONetworkData object manages a fixed-size named buffer. + This object provides external access methods that can be used to + access the contents of the data buffer. In addition, serialization + is supported, and therefore this object can be added to a property + table to publish the data object. An unique name must be assigned to + the object during initialization. An OSSymbol key will be created + based on the assigned name, and this key can be used when the object + is added to a dictionary. + + The level of access granted to the access methods can be restricted, + by specifying a set of supported access types when the object is + initialized, or modified later by calling setAccessTypes(). By default, + each IONetworkData object created will support serialization, and will + also allow its data buffer to be read through the read() access method. + + An access notification handler, in the form of a 'C' function, can + be registered to receive a call each time the data buffer is accessed + through an access method. Arguments provided to the handler will identify + the data object and the type of access that triggered the notification. + The handler can therefore perform lazy update of the data buffer until + an interested party tries to read or serialize the data. The notification + handler can also take over the default action performed by the access + methods when the buffer type is set to kIONetworkDataBufferTypeNone. + This will prevent the access methods from accessing the data buffer, + and allow the handler to override the access protocol. + + This object is primarily used by IONetworkInterface to export interface + properties to user space. +*/ + + +class IONetworkData : public OSObject +{ + OSDeclareDefaultStructors( IONetworkData ) + +public: + +/*! @typedef Action + @abstract Defines a C function that may be called by an IONetworkData object + when one of its access methods is called. + @param target The target of the notification. + @param param A parameter that was provided when the notification + handler was registered. + @param data The IONetworkData object being accessed, and the + sender of the notification. + @param accessType A bit will be set indicating the type of access + which triggered the notification. + @param buffer Pointer to the accessor's buffer. Only valid for + read() and write() accesses. + @param bufferSize Pointer to the size of the accessor's buffer. + @param offset An offset from the start of the data buffer to begin + reading or writing. +*/ + + typedef IOReturn (*Action)(void * target, + void * param, + IONetworkData * data, + UInt32 accessType, + void * buffer, + UInt32 * bufferSize, + UInt32 offset); + +protected: + const OSSymbol * _key; // key associated with this object. + UInt32 _access; // supported access types. + void * _buffer; // Data buffer. + UInt32 _bufType; // buffer type + UInt32 _size; // data buffer size. + void * _tapTarget; // target for access notification. + Action _tapAction; // the function to call. + void * _tapParam; // arbitrary notification param. + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + +/*! @function free + @abstract Frees the IONetworkData object. +*/ + + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! @function writeBytes + @abstract Writes to the data buffer with data from a source buffer + provided by the caller. + @param srcBuffer Pointer to a source buffer provided by the caller. + @param srcBufferSize The size of the source buffer. + @param writeOffset A byte offset from the start of the data buffer + to begin writting. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool writeBytes(const void * srcBuffer, + UInt32 srcBufferSize, + UInt32 writeOffset = 0); + +/*! @function readBytes + @abstract Reads from the data buffer and copies the data to a destination + buffer provided by the caller. + @param dstBuffer Pointer to the destination buffer. + @param dstBufferSize Pointer to an integer containing the size of the + destination buffer. And is overwritten by this method with the actual + number of bytes copied to the destination buffer. + @param readOffset A byte offset from the start of the data buffer + to begin reading. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool readBytes(void * dstBuffer, + UInt32 * dstBufferSize, + UInt32 readOffset = 0) const; + +/*! @function clearBuffer + @abstract Clears the data buffer by filling it with zeroes. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool clearBuffer(); + +public: + +/*! @function withInternalBuffer + @abstract Factory method that constructs and initializes an + IONetworkData object with an internal data buffer. + @param name A name to assign to this object. + @param bufferSize The number of bytes to allocate for the internal data + buffer. + @param accessTypes The initial supported access types. + @param target The notification target. + @param action The notification action. + @param param A parameter to pass to the notification action. + @result Returns an IONetworkData object on success, or 0 otherwise. +*/ + + static IONetworkData * + withInternalBuffer(const char * name, + UInt32 bufferSize, + UInt32 accessTypes = + kIONetworkDataBasicAccessTypes, + void * target = 0, + Action action = 0, + void * param = 0); + +/*! @function withExternalBuffer + @abstract Factory method that constructs and initializes an + IONetworkData object with an external data buffer. + @param name A name to assign to this object. + @param bufferSize The size of the external data buffer. + @param externalBuffer Pointer to the external data buffer. + @param accessTypes The initial supported access types. + @param target The notification target. + @param action The notification action. + @param param A parameter to pass to the notification action. + @result Returns an IONetworkData object on success, or 0 otherwise. +*/ + + static IONetworkData * + withExternalBuffer(const char * name, + UInt32 bufferSize, + void * externalBuffer, + UInt32 accessTypes = + kIONetworkDataBasicAccessTypes, + void * target = 0, + Action action = 0, + void * param = 0); + +/*! @function withNoBuffer + @abstract Factory method that constructs and initializes an + IONetworkData object without a data buffer. + @discussion The notification handler + must intervene when the IONetworkData is accessed. + @param name A name to assign to this object. + @param bufferSize The size of the phantom data buffer. + @param accessTypes The initial supported access types. + @param target The notification target. + @param action The notification action. + @param param A parameter to pass to the notification action. + @result Returns an IONetworkData object on success, or 0 otherwise. +*/ + + static IONetworkData * withNoBuffer(const char * name, + UInt32 bufferSize, + UInt32 accessTypes, + void * target, + Action action, + void * param = 0); + +/*! @function init + @abstract Initializes an IONetworkData object. + @param name A name to assign to this object. + @param bufferType The type of buffer associated with this object. + @param bufferSize The size of the data buffer. + @param externalBuffer Pointer to an external data buffer. + @param accessTypes The initial supported access types. + Can be later modified by calling setAccessTypes(). + @param target The notification target. + @param action The notification action. + @param param A parameter to pass to the notification action. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool init(const char * name, + UInt32 bufferType, + UInt32 bufferSize, + void * externalBuffer = 0, + UInt32 accessTypes = + kIONetworkDataBasicAccessTypes, + void * target = 0, + Action action = 0, + void * param = 0); + +/*! @function setAccessTypes + @abstract Sets the types of access that are permitted on the data buffer. + @param types A mask of access types indicating the supported access + types. +*/ + + virtual void setAccessTypes(UInt32 types); + +/*! @function setNotificationTarget + @abstract Registers a C function to handle access notifications sent + from this object. + @discussion A notification is sent by an IONetworkData object to the + registered notification handler, when an access method is called to + modify the contents of the data buffer. + @param target The first parameter passed to the notification handler. + @param action A pointer to a C function that will handle the notification. + If 0, then notification is disabled. + @param param An optional parameter passed to the notification handler. +*/ + + virtual void setNotificationTarget(void * target, + Action action, + void * param = 0); + +/*! @function getBuffer + @abstract Gets a pointer to the data buffer. + @result Returns a pointer to the data buffer. Returns 0 if the buffer type is + kIONetworkDataBufferTypeNone. +*/ + + virtual const void * getBuffer() const; + +/*! @function getBufferType + @abstract Gets the type of data buffer managed by this object. + @result Returns a constant that describes the type of the data buffer. +*/ + + virtual UInt32 getBufferType() const; + +/*! @function getAccessTypes + @abstract Gets the types of data access supported by this object. + @result Returns a mask of supported access types. +*/ + + virtual UInt32 getAccessTypes() const; + +/*! @function getNotificationTarget + @abstract Gets the first parameter that will be passed to the access + notification handler. + @result Returns the first parameter that will be passed to the access notification + handler. +*/ + + virtual void * getNotificationTarget() const; + +/*! @function getNotificationAction + @abstract Gets the C function that was registered to handle access + notifications sent from this object. + @result Returns a pointer to a C function, or 0 if notification is disabled. +*/ + + virtual Action getNotificationAction() const; + +/*! @function getNotificationParameter + @abstract Gets the parameter that will be passed to the access + notification handler. + @result Returns the parameter that will be passed to the access notification + handler. +*/ + + virtual void * getNotificationParameter() const; + +/*! @function getKey + @abstract Gets a unique OSSymbol key associated with this object. + @discussion During initialization, IONetworkData will create an + OSSymbol key based on its assigned name. + @result Returns an OSSymbol key that was generated from the name assigned to + this object. +*/ + + virtual const OSSymbol * getKey() const; + +/*! @function getSize + @abstract Gets the size of the data buffer. + @result Returns the size of the data buffer managed by this object in bytes. +*/ + + virtual UInt32 getSize() const; + +/*! @function reset + @abstract An access method that resets the data buffer. + @discussion This method handles an external request to reset the data buffer. + If notification is enabled, then the notification handler is called + after the data buffer has been cleared. + @result Returns kIOReturnSuccess on success, + kIOReturnNotWritable if reset access is not permitted, + or an error from the notification handler. +*/ + + virtual IOReturn reset(); + +/*! @function read + @abstract An access method that reads from the data buffer. + @discussion This method handles an external request to read from the data buffer + and copy it to the destination buffer provided by the accessor. + If notification is enabled, then the notification handler is called + before the data buffer is copied to the destination buffer. The + notification handler may use this opportunity to intervene and + to update the contents of the data buffer. + @param dstBuffer Pointer to the destination buffer. + @param dstBufferSize Pointer to an integer containing the size of the + destination buffer. And is overwritten by this method to the actual number + of bytes copied to the destination buffer. + @param readOffset An offset from the start of the source data buffer to + begin reading. + @result Returns kIOReturnSuccess on success, + kIOReturnBadArgument if any of the arguments provided is invalid, + kIOReturnNotReadable if read access is not permitted, + or an error from the notification handler. +*/ + + virtual IOReturn read(void * dstBuffer, + UInt32 * dstBufferSize, + UInt32 readOffset = 0); + +/*! @function write + @abstract An access method that writes to the data buffer. + @discussion This method handles an external request to write to the data buffer + from a source buffer provided by the accessor. After checking that + the data object supports write accesses, the data buffer is updated + if it exists. Then the registered notification handler is called. + @param srcBuffer Pointer to the source buffer. + @param srcBufferSize The number of bytes to write to the data buffer. + @param writeOffset An offset from the start of the destination data buffer + to begin writing. + @result Returns kIOReturnSuccess on success, + kIOReturnBadArgument if any of the arguments provided is invalid, + kIOReturnNotWritable if write access is not permitted, + or an error from the notification handler. +*/ + + virtual IOReturn write(void * srcBuffer, + UInt32 srcBufferSize, + UInt32 writeOffset = 0); + +/*! @function serialize + @abstract Serializes the IONetworkData object. + @discussion If notification is enabled, then the notification + handler is called just before the data buffer is serialized. + @param s An OSSerialize object. + @result Returns true on success, false otherwise. +*/ + + virtual bool serialize(OSSerialize * s) const APPLE_KEXT_OVERRIDE; + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IONetworkData, 0); + OSMetaClassDeclareReservedUnused( IONetworkData, 1); + OSMetaClassDeclareReservedUnused( IONetworkData, 2); + OSMetaClassDeclareReservedUnused( IONetworkData, 3); +}; + +#endif /* KERNEL */ + +#endif /* !_IONETWORKDATA_H */ diff --git a/QualcommWireless/include/IOKit/network/IONetworkInterface.h b/QualcommWireless/include/IOKit/network/IONetworkInterface.h new file mode 100644 index 0000000..1e51706 --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IONetworkInterface.h @@ -0,0 +1,1541 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKINTERFACE_H +#define _IONETWORKINTERFACE_H + +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +/*! @defined kIONetworkInterfaceClass + @abstract The name of the IONetworkInterface class. +*/ + +#define kIONetworkInterfaceClass "IONetworkInterface" + +/*! @defined kIONetworkData + @abstract A property of IONetworkInterface objects. + @discussion The kIONetworkData property has an OSDictionary value and is a + container for the set of IONetworkData objects managed by the interface. + Each entry in the dictionary is a key/value pair consisting of + the network data name, and an OSDictionary describing the + contents of the network data. +*/ + +#define kIONetworkData "IONetworkData" + +/*! @defined kIOInterfaceType + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceType property has an OSNumber value that + specifies the type of network interface that this interface represents. + The type constants are defined in bsd/net/if_types.h. +*/ + +#define kIOInterfaceType "IOInterfaceType" + +/*! @defined kIOMaxTransferUnit + @abstract A property of IONetworkInterface objects. + @discussion The kIOMaxTransferUnit property has an OSNumber value that + specifies the maximum transfer unit for the interface in bytes. +*/ + +#define kIOMaxTransferUnit "IOMaxTransferUnit" + +/*! @defined kIOMediaAddressLength + @abstract A property of IONetworkInterface objects. + @discussion The kIOMediaAddressLength property has an OSNumber value that + specifies the size of the media address in bytes. +*/ + +#define kIOMediaAddressLength "IOMediaAddressLength" + +/*! @defined kIOMediaHeaderLength + @abstract A property of IONetworkInterface objects. + @discussion The kIOMediaHeaderLength property has an OSNumber value that + specifies the size of the media header in bytes. +*/ + +#define kIOMediaHeaderLength "IOMediaHeaderLength" + +/*! @defined kIOInterfaceFlags + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceFlags property has an OSNumber value that + specifies the current value of the interface flags. The flag constants + are defined in bsd/net/if.h. +*/ + +#define kIOInterfaceFlags "IOInterfaceFlags" + +/*! @defined kIOInterfaceExtraFlags + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceExtraFlags property has an OSNumber value that + specifies the current value of the interface eflags. The eflag constants + are defined in bsd/net/if.h. +*/ + +#define kIOInterfaceExtraFlags "IOInterfaceExtraFlags" + +/*! @defined kIOInterfaceUnit + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceUnit property has an OSNumber value that + describes the unit number assigned to the interface object. +*/ + +#define kIOInterfaceUnit "IOInterfaceUnit" + +/*! @defined kIOInterfaceState + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceState property has an OSNumber value that + describes the current state of the interface object. This property is + not exported to BSD via the ifnet structure. +*/ + +#define kIOInterfaceState "IOInterfaceState" + +/*! @defined kIOInterfaceNamePrefix + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceNamePrefix property has an OSString value that + describes the string prefix for the BSD name assigned to the interface. +*/ + +#define kIOInterfaceNamePrefix "IOInterfaceNamePrefix" + +/*! @defined kIOPrimaryInterface + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceNamePrefix property has an OSBoolean value that + describes whether the interface is the primary or the built-in network + interface. +*/ + +#define kIOPrimaryInterface "IOPrimaryInterface" + +/*! @defined kIOBuiltin + @abstract kIOBuiltin is a property of IONetworkInterface + objects. It has an OSBoolean value. + @discussion The kIOBuiltin property describes whether the + interface is built-in. +*/ + +#define kIOBuiltin "IOBuiltin" + +/*! @defined kIOLocation + @abstract kIOLocation is a property of IONetworkInterface + objects. It has an OSString value. + @discussion The kIOLocation property describes the physical + location of built-in interfaces. +*/ + +#define kIOLocation "IOLocation" + +/*! @defined kIONetworkNoBSDAttachKey + @abstract kIONetworkNoBSDAttachKey is a property of IONetworkInterface + objects. It has an OSBoolean value. + @discussion Adding a property with this key and the value kOSBooleanTrue + before the interface is published will hold off the BSD attach. + When the interface is ready to attach to BSD, remove the property + and then re-publish the interface by calling registerService(). +*/ + +#define kIONetworkNoBSDAttachKey "IONetworkNoBSDAttach" + +/*! @enum InterfaceObjectStates + @discussion Constants used to encode the state of the interface object. + @constant kIONetworkInterfaceRegisteredState The interface object has + registered with the data link layer. + @constant kIONetworkInterfaceOpenedState One or more clients have an + open on the interface object. + @constant kIONetworkInterfaceDisabledState The interface is temporarily + unable to service its clients. This will occur when the network + controller that is servicing the interface has entered a low power + state that renders it unusable. +*/ + +enum { + kIONetworkInterfaceRegisteredState = 0x1, + kIONetworkInterfaceOpenedState = 0x2, + kIONetworkInterfaceDisabledState = 0x4 +}; + +#ifdef KERNEL +#ifdef __cplusplus + +#include +#include +#include +#include +#include + +class IONetworkController; +class IONetworkStack; +class IOCommandGate; +struct IOMbufQueue; + +/*! @typedef IOOutputAction + @discussion Prototype for an output packet handler that will process + all outbound packets sent to the interface from the data link layer. + An output handler is registered with the interface by calling + registerOutputHandler(). + @param mbuf_t A packet mbuf. + @param param A parameter for the output request. */ + +typedef UInt32 (OSObject::*IOOutputAction)(mbuf_t, void * param); + +/*! @typedef BPF_FUNC + @discussion Prototype for the BPF tap handler. This will disappear + when the correct DLIL header file is included. */ + +typedef int (*BPF_FUNC)(struct ifnet *, struct mbuf *); + +// Network event types recognized by inputEvent(). +// +enum { + /* DLIL defined event, argument must be a pointer to a + kern_event_msg structure. */ + kIONetworkEventTypeDLIL = 0xff000001, + + /* Link up event, no argument */ + kIONetworkEventTypeLinkUp = 0xff000002, + + /* Link down event, no argument */ + kIONetworkEventTypeLinkDown = 0xff000003, + + /* Wake on LAN support changed, no argument */ + kIONetworkEventWakeOnLANSupportChanged = 0xff000004, + + /* Link speed changed */ + kIONetworkEventTypeLinkSpeedChange = 0xff000005 +}; + +#ifdef __PRIVATE_SPI__ +enum { + kIONetworkWorkLoopSynchronous = 0x00000001 +}; + +enum { + kIONetworkClientBehaviorLinkStateActiveRegister = 0x00000001, + kIONetworkClientBehaviorLinkStateChangeMessage = 0x00000002 +}; + +/*! @enum IOMbufServiceClass + @discussion Service class of a mbuf packet. + @constant kIOMbufServiceClassBKSYS Background System-Initiated. + @constant kIOMbufServiceClassBK Background. + @constant kIOMbufServiceClassBE Best Effort. + @constant kIOMbufServiceClassRD Responsive Data. + @constant kIOMbufServiceClassOAM Operations, Administration, and Management. + @constant kIOMbufServiceClassAV Multimedia Audio/Video Streaming. + @constant kIOMbufServiceClassRV Responsive Multimedia Audio/Video. + @constant kIOMbufServiceClassVI Interactive Video. + @constant kIOMbufServiceClassVO Interactive Voice. + @constant kIOMbufServiceClassCTL Network Control. +*/ +enum IOMbufServiceClass { + kIOMbufServiceClassBKSYS = 100, + kIOMbufServiceClassBK = 200, + kIOMbufServiceClassBE = 0, + kIOMbufServiceClassRD = 300, + kIOMbufServiceClassOAM = 400, + kIOMbufServiceClassAV = 500, + kIOMbufServiceClassRV = 600, + kIOMbufServiceClassVI = 700, + kIOMbufServiceClassVO = 800, + kIOMbufServiceClassCTL = 900 +}; + +/*! @enum IONetworkTransmitStatus + @discussion Constants for packet transmit status. + @constant kIONetworkTransmitStatusSuccess Packet sent across link. + @constant kIONetworkTransmitStatusFailed Failed to send packet across link. + @constant kIONetworkTransmitStatusAborted Send aborted, peer was asleep. + @constant kIONetworkTransmitStatusQueueFull Driver send queue was full. +*/ +enum { + kIONetworkTransmitStatusSuccess = 0, + kIONetworkTransmitStatusFailed = 1, + kIONetworkTransmitStatusAborted = 2, + kIONetworkTransmitStatusQueueFull = 3 +}; + +typedef uint32_t IONetworkTransmitStatus; + +/*! @typedef IONetworkPacketPollingParameters + @discussion Mirrors the definition of ifnet_poll_params(). + @field maxPacketCount The maximum number of packets to be dequeued each + time the driver's pollInputPackets is invoked. A zero value + indicates the use of default maximum defined by the system. + @field lowThresholdPackets Low watermark packets threshold. + @field highThresholdPackets High watermark packets threshold. + @field lowThresholdBytes Low watermark bytes threshold. + @field highThresholdBytes High watermark bytes threshold. + @field pollIntervalTime The interval time between each invocation of + the driver's pollInputPackets in nanoseconds. +*/ +struct IONetworkPacketPollingParameters { + uint32_t maxPacketCount; + uint32_t lowThresholdPackets; + uint32_t highThresholdPackets; + uint32_t lowThresholdBytes; + uint32_t highThresholdBytes; + uint64_t pollIntervalTime; + uint64_t reserved[4]; +}; +#endif /* __PRIVATE_SPI__ */ + +/*! @class IONetworkInterface + @abstract Abstract class that manages the connection between an + IONetworkController and the data link interface layer. + @discussion An IONetworkInterface object manages the connection between + an IONetworkController and the data link interface layer (DLIL). + All interactions between the controller and DLIL must go through an + interface object. Any data structures that are required by DLIL for a + particular interface type shall be allocated and mantained by the + interface object. IONetworkInterface is an abstract class that must be + extended by a concrete subclass to specialize for a particular network + type. + + Although most drivers will allocate a single interface object, + it is possible for multiple interfaces to be attached to a single + controller. This controller driver will be responsible for arbitrating + access among its multiple interface clients. + + IONetworkInterface also maintains a dictionary of IONetworkData + objects containing statistics structures. Controller drivers can + ask for a particular data object by name and update the + statistics counters within directly. This dictionary is added to + the interface's property table and is visible outside of the kernel. +*/ + +class IONetworkInterface : public IOService +{ + OSDeclareAbstractStructors( IONetworkInterface ) + + friend class IONetworkStack; + +#ifdef __PRIVATE_SPI__ +public: +/*! @typedef OutputPreEnqueueHandler + @param target Reference supplied when the handler was installed. + @param refCon Reference supplied when the handler was installed. + @param packet The output packet; may be the head of a chain of packets. + Call enqueueOutputPacket() for each packet in the chain to + enqueue the packet before returning. The handler executes on the thread + context of the sending client. +*/ + typedef errno_t (*OutputPreEnqueueHandler)( + void * target, void * refCon, mbuf_t packet ); + + static IOReturn errnoToIOReturn( errno_t error ); +#endif /* __PRIVATE_SPI__ */ + +private: + IONetworkController * _driver; + ifnet_t _backingIfnet; + IOLock * _privateLock; + OSSet * _clientSet; + OSNumber * _stateBits; + bpf_packet_func _inputFilterFunc; + bpf_packet_func _outputFilterFunc; + OSObject * _outTarget; + IOOutputAction _outAction; + UInt32 _clientVar[4]; + OSDictionary * _dataDict; + IOMbufQueue * _inputPushQueue; + void * _unused1; + UInt32 _unused2; + + struct ExpansionData { + int unit; + int type; + int mtu; + int flags; + int eflags; + int addrlen; + int hdrlen; + int32_t loggingLevel; + uint32_t outputQueueModel; + IONetworkStats driverStats; + IONetworkStats lastDriverStats; + ifnet_stat_increment_param inputDeltas; + IORecursiveLock * publicLock; + char * remote_NMI_pattern; + unsigned int remote_NMI_len; + IONetworkController * controller; + uint32_t configFlags; + uint32_t txRingSize; + uint32_t txPullOptions; + uint32_t txQueueSize; + uint32_t txSchedulingModel; + uint32_t txTargetQdelay; + uint32_t txThreadState; + volatile UInt32 txThreadFlags; + uint32_t txThreadSignal; + uint32_t txThreadSignalLast; + thread_t txStartThread; + void * txStartAction; + IOWorkLoop * txWorkLoop; + uint32_t rxRingSize; + uint32_t rxPollOptions; + uint32_t rxPollModel; + void * rxPollAction; + void * rxCtlAction; + uint64_t rxPollEmpty; + uint64_t rxPollTotal; +#ifdef __PRIVATE_SPI__ + OutputPreEnqueueHandler peqHandler; + void * peqTarget; + void * peqRefcon; + uint32_t subType; +#endif + uint16_t txStartDelayQueueLength; /* optional */ + uint16_t txStartDelayTimeout; /* optional */ + IOOptionBits clientBehavior; + thread_call_t inputEventThreadCall; // inputEvent() thread call + }; + + ExpansionData * _reserved; + + bool _syncNetworkDataDict(); + SInt32 syncSIOCSIFMEDIA(IONetworkController * ctr, struct ifreq * ifr); + SInt32 syncSIOCGIFMEDIA(IONetworkController * ctr, struct ifreq * ifr, + unsigned long cmd); + SInt32 syncSIOCSIFMTU(IONetworkController * ctr, struct ifreq * ifr); + void drainOutputQueue(ifnet_t ifp, IONetworkController * driver); + IOReturn haltOutputThread(uint32_t stateBit); +#ifdef __PRIVATE_SPI__ + void actionInputCtl(IONetworkController * driver, + ifnet_ctl_cmd_t cmd, uint32_t arglen, void * arg ); +#endif + void pushInputQueue( IOMbufQueue * queue ); + void pushInputPacket( mbuf_t packet, uint32_t length ); + int if_start_precheck( ifnet_t ifp ); + static int performGatedCommand(void *, void *, void *, void *, void *); + static void powerChangeHandler(void *, void *, void *); + static errno_t if_ioctl(ifnet_t ifp, unsigned long cmd, void * data); + static int if_output(ifnet_t ifp, mbuf_t); + static errno_t if_set_bpf_tap(ifnet_t ifp, bpf_tap_mode, bpf_packet_func); + static void if_detach(ifnet_t ifp); + static void if_start(ifnet_t ifp); + static void if_start_gated(ifnet_t ifp); + static void if_input_poll(ifnet_t ifp, uint32_t flags, + uint32_t max_count, + mbuf_t * first_packet, mbuf_t * last_packet, + uint32_t * cnt, uint32_t * len); + static void if_input_poll_gated(ifnet_t ifp, uint32_t flags, + uint32_t max_count, + mbuf_t * first_packet, mbuf_t * last_packet, + uint32_t * cnt, uint32_t * len); +#ifdef __PRIVATE_SPI__ + static errno_t if_input_ctl(ifnet_t ifp, ifnet_ctl_cmd_t cmd, + uint32_t arglen, void * arg); + static errno_t if_output_pre_enqueue(ifnet_t ifp, mbuf_t packet); + static errno_t if_output_ctl(ifnet_t ifp, ifnet_ctl_cmd_t cmd, + u_int32_t arglen, void *arg); +#endif + void notifyDriver( uint32_t type, void * data ); + static void handleNetworkInputEvent(thread_call_param_t param0, thread_call_param_t param1); + +public: + +/*! @function isPrimaryInterface + @abstract Queries whether the interface is the primary network interface + on the system. + @discussion The definition of a primary interface and its discovery is + platform specific. + @result Returns true if the interface is the primary interface, + false otherwise. +*/ + virtual bool isPrimaryInterface( void ) const; + +/*! @function init + @abstract Initializes the IONetworkInterface object. + @discussion Resources are allocated, but an ifnet_t will not + be allocated until the interface is assigned a BSD name and attached to the + network stack. + @param controller A network controller object that will service the + the interface. + @result Returns true on success, false otherwise. +*/ + virtual bool init( IONetworkController * controller ); + +/*! @function isRegistered + @abstract Queries if the interface has attached to the BSD network stack. + @discussion Once attached a kIOBSDNameKey property is added + to the interface object with the assigned BSD name. + @result Returns true if interface is registered and attached to the network + stack, false otherwise. +*/ + virtual bool isRegistered( void ) const; + +/*! @function getInterfaceState + @abstract Reports the current state of the interface object. + @result Returns the current interface state flags. +*/ + virtual UInt32 getInterfaceState( void ) const; + +/*! @function getController + @abstract Gets the IONetworkController object that created + this interface. + @discussion The controller object passed to init() will be retained until + the interface closes the controller. Subclasses can safely call this method + before the controller is closed. + @result Returns the parent IONetworkController object. +*/ + virtual IONetworkController * getController( void ) const; + +/*! @function inputPacket + @abstract For drivers to submit a received packet to the network stack. + @discussion The packet provided to this method may be added to an input + queue managed by the interface object, which the driver can use to postpone + the packet handoff to the network stack, until all received packets have been + added to the input queue. A subsequent call to flushInputQueue(), + will transfer the entire contents of the input queue to the network stack. + This input queue is not protected by a lock. Drivers that leverage this + input queue must either access the queue from a single thread, or enforce + serialized access. + @param mbuf_t The mbuf containing the received packet. + @param length Specify the size of the received packet in the mbuf. + The mbuf length fields are updated with this value. If zero, then the mbuf + length fields are not updated. + @param options Pass kInputOptionQueuePacket to enqueue the + input packet. Pass zero to bypass the input queue, and immediately submit + the packet to the network stack. + @param param A parameter provided by the driver. Not used. + @result Returns the number of packets that were submitted to the network + stack, or zero if the packet was enqueued. +*/ + virtual UInt32 inputPacket( + mbuf_t packet, + UInt32 length = 0, + IOOptionBits options = 0, + void * param = 0 ); + +/*! @enum InputOptionQueuePacket + @discussion Options for inputPacket(). + @constant kInputOptionQueuePacket Enqueue the input packet provided to the + input packet queue. Calls to inputPacket() must be serialized. +*/ + enum { + kInputOptionQueuePacket = 0x1 + }; + +/*! @function flushInputQueue + @abstract Submit all packets held in the input queue to the network stack. + @discussion Allow drivers to remove all packets from the input queue and + submit them to the network stack. This method should be used in concert + with the inputPacket() method, to flush the input queue after + queueing a number of received packets. + @result Returns the number of packets that were submitted to the network + stack. Returns zero if the queue was empty. +*/ + virtual UInt32 flushInputQueue( void ); + +/*! @function clearInputQueue + @abstract Discards all packets in the input queue. + @discussion This method removes all packets from the input queue and + releases them back to the free mbuf pool. It is unusual for a driver to + call this method. + @result Returns the number of packets freed. +*/ + virtual UInt32 clearInputQueue( void ); + +/*! @function inputEvent + @abstract Sends an event to the network stack. + @discussion This method can be used by the driver to send an event to the + network stack. + @param type A constant describing the event type. + @param data An optional data associated with the event. + @result Returns true if the event was delivered, false if the event type + specified is invalid, or if the event delivery failed. +*/ + virtual bool inputEvent( UInt32 type, void * data ); + +/*! @function registerOutputHandler + @abstract Registers a target/action to handle outbound packets. + @discussion The interface object will forward all output packets sent from + the network stack to the target and action registered using this method. + The registration must occur before the interface is registered and opened + by IONetworkStack, otherwise the default handler will be used. + The default target and action is set by init() as the + controller, and the handler returned by the controller's + getOutputHandler() method. + @param target Object that implements the output handler. + @param action The function that will handle output packets. + @result Returns true if the target/action provided was accepted, + false otherwise. +*/ + virtual bool registerOutputHandler( + OSObject * target, + IOOutputAction action ); + +/*! @function getNamePrefix + @abstract Returns the BSD name prefix as a C-string. + @discussion The BSD name for each interface object is generated by + concatenating the string returned by this method, along with an unit number + assigned by IONetworkStack. A concrete interface subclass must + implement this method and return a distinct name prefix for its instances. + @result Returns a pointer to a constant C-string. +*/ + virtual const char * getNamePrefix() const = 0; + +/*! @function getInterfaceType + @abstract Gets the interface type. + @discussion This method returns the interface type previously set by + setInterfaceType. + @result Returns a constant defined in bsd/net/if_types.h + that describes the interface type. +*/ + virtual UInt8 getInterfaceType( void ) const; + +/*! @function getMaxTransferUnit + @abstract Gets the maximum transfer unit for this interface. + @discussion This method calls ifnet_mtu and returns the + maximum transfer unit. + @result Returns the interface MTU size in bytes. +*/ + virtual UInt32 getMaxTransferUnit( void ) const; + +/*! @function getFlags + @abstract Gets the current interface flags. + @discussion This method calls ifnet_flags and returns the + current interface flags. + @result Returns the interface flags. +*/ + virtual UInt16 getFlags( void ) const; + +/*! @function getExtraFlags + @abstract Gets the current interface eflags. + @discussion This method calls ifnet_eflags and returns the + current interface eflags. + @result Returns the value of the interface eflags. +*/ + virtual UInt32 getExtraFlags( void ) const; + +/*! @function getMediaAddressLength + @abstract Gets the size of the media (MAC-layer) address. + @discussion This method calls ifnet_addrlen and returns the + media address length. + @result Returns the size of the media address in bytes. +*/ + virtual UInt8 getMediaAddressLength( void ) const; + +/*! @function getMediaHeaderLength + @abstract Gets the size of the media header. + @discussion This method calls ifnet_hdrlen and returns the + media header length. + @result Returns the size of the media header in bytes. +*/ + virtual UInt8 getMediaHeaderLength( void ) const; + +/*! @function getUnitNumber + @abstract Gets the unit number assigned to this interface object. + @discussion This method calls ifnet_unit and returns the + unit number assigned by IONetworkStack. + @result Returns the assigned interface unit number. +*/ + virtual UInt16 getUnitNumber( void ) const; + +/*! @function addNetworkData + @abstract Adds an IONetworkData object to the interface. + @discussion The IONetworkData object is added to a + collection using the key from IONetworkData::getKey(). + The object provided is retained. + @param aData The IONetworkData object. + @result Returns true if the object was added, false otherwise. +*/ + virtual bool addNetworkData( IONetworkData * aData ); + +/*! @function removeNetworkData + @abstract Removes an IONetworkData object from the interface. + @discussion This method removes an IONetworkData object from + the collection managed by the interface. The object removed is released. + @param aKey An OSSymbol identifying the object to be removed. + @result Returns true if the object was found and removed, false otherwise. +*/ + virtual bool removeNetworkData( const OSSymbol * aKey ); + +/*! @function removeNetworkData + @abstract Removes an IONetworkData object from the interface. + @discussion This method removes an IONetworkData object from + the collection managed by the interface. The object removed is released. + @param aKey A C-string identifying the object to be removed. + @result Returns true if the object was found and removed, false otherwise. +*/ + virtual bool removeNetworkData( const char * aKey ); + +/*! @function getNetworkData + @abstract Gets an IONetworkData object from the interface. + @discussion Returns a reference to an IONetworkData object + that was previously added to the interface, and is associated with the + provided key. + @param aKey A C-string identifying the object. + @result Returns a reference to the matching IONetworkData + object, or NULL if no match was found. +*/ + virtual IONetworkData * getNetworkData( const char * aKey ) const; + +/*! @function getNetworkData + @abstract Gets an IONetworkData object from the interface. + @discussion Returns a reference to an IONetworkData object + that was previously added to the interface, and is associated with the + provided key. + @param aKey An OSSymbol identifying the object. + @result Returns a reference to the matching IONetworkData + object, or NULL if no match was found. +*/ + virtual IONetworkData * getNetworkData(const OSSymbol * aKey) const; + + /* Compatibility methods */ + IONetworkData * getParameter(const char * aKey) const; + bool setExtendedFlags(UInt32 flags, UInt32 clear = 0); + + /* Override IOService::message() */ + virtual IOReturn message( UInt32 type, IOService * provider, void * argument ) APPLE_KEXT_OVERRIDE; + +/*! @function debuggerRegistered + @abstract Tells the IONetworkData that this interface will be + used by the debugger. +*/ + void debuggerRegistered( void ); + +protected: +/*! @function setInterfaceType + @abstract Sets the interface type. + @discussion Sets the interface type before the interface is attached to + the network stack. See bsd/net/if_types.h for defined types. + The kIOInterfaceType is also updated using the provided type. + @param type A constant defined in bsd/net/if_types.h that + describes the interface type. + @result Returns true to indicate success if the interface has not yet + attached to the network stack, otherwise returns false. +*/ + virtual bool setInterfaceType( UInt8 type ); + +/*! @function setMaxTransferUnit + @abstract Sets the maximum transfer unit for this interface. + @discussion Calls ifnet_set_mtu if the interface is attached + to the network stack, and updates the kIOMaxTransferUnit + property using the provided value. + @param mtu The interface MTU size in bytes. + @result Always returns true. +*/ + virtual bool setMaxTransferUnit( UInt32 mtu ); + +/*! @function setFlags + @abstract Performs a read-modify-write operation on the current + interface flags value. + @discussion Calls ifnet_set_flags if the interface is attached + to the network stack, and updates the kIOInterfaceFlags + property using the provided value. See bsd/net/if.h header + file for the flag constants. + @param flags The bits that should be set. + @param clear The bits that should be cleared. If zero, then non + of the flags are cleared and the result is formed by OR'ing the + original flags value with the new flags. + @result Always returns true. +*/ + virtual bool setFlags( UInt16 flags, UInt16 clear = 0 ); + + /* Deprecated. No replacement. */ + virtual bool setExtraFlags( UInt32 flags, UInt32 clear = 0 ); + +/*! @function setMediaAddressLength + @abstract Sets the size of the media (MAC-layer) address. + @discussion Calls ifnet_set_addrlen if interface is attached + to the network stack, and updates the kIOMediaAddressLength + property using the provided value. + @param length The size of the media address in bytes. + @result Always returns true. +*/ + virtual bool setMediaAddressLength( UInt8 length ); + +/*! @function setMediaHeaderLength + @abstract Sets the size of the media header. + @discussion Calls ifnet_set_hdrlen if interface is attached + to the network stack, and updates the kIOMediaHeaderLength + property using the provided value. + @param length The size of the media header in bytes. + @result Always returns true. +*/ + virtual bool setMediaHeaderLength( UInt8 length ); + +/*! @function setUnitNumber + @abstract Assigns an unique unit number to this interface. + @discussion This method is called internally before the interface is + attached to the network stack, to assign an unique unit number to the + interface object. The kIOInterfaceUnit property is also + updated using the provided value. + @param unit The unit number assigned to this interface object. + @result Returns true to indicate success if the interface has not yet + attached to the network stack, otherwise returns false. +*/ + virtual bool setUnitNumber( UInt16 unit ); + +/*! @function free + @abstract Frees the IONetworkInterface object. + @discussion Resource allocated by init() are released, and + clearInputQueue() is called to ensure that the input queue is empty. + The interface should have already detached from the network stack. +*/ + virtual void free( void ) APPLE_KEXT_OVERRIDE; + + /* Override IOService::handleOpen() */ + virtual bool handleOpen( IOService * client, + IOOptionBits options, + void * argument ) APPLE_KEXT_OVERRIDE; + + /* Override IOService::handleClose() */ + virtual void handleClose( IOService * client, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + /* Override IOService::handleIsOpen() */ + virtual bool handleIsOpen( const IOService * client ) const APPLE_KEXT_OVERRIDE; + +/*! @function lock + @abstract Acquires a recursive lock owned by the interface. + @discussion A recursive lock is allocated and initialized in + init(). This lock is otherwise not used by the + IONetworkInterface class. This method call acquires + the lock and must be balanced with an unlock(). +*/ + virtual void lock( void ); + +/*! @function unlock + @abstract Releases the recursive lock owned by the interface. + @discussion A recursive lock is allocated and initialized in + init(). This lock is otherwise not used by the + IONetworkInterface class. This method call releases + the lock to balance a prior lock(). +*/ + virtual void unlock( void ); + +/*! @function controllerDidOpen + @abstract Sends a notification that the interface has opened the network + controller. + @discussion This method is called by handleOpen() to notify + subclasses that the controller was opened. The open on the controller + occurs when the interface receives the initial open request from a client. + Subclasses can override this method and inspect the controller before + allowing the client open. This method is called with the arbitration lock + held, hence issuing I/O to the controller must be avoided to eliminate the + possibility of a deadlock. + @param controller The controller that was opened. + @result Must return true in order for handleOpen() to accept the client + open. If the return is false, then the controller will be closed and the + client open will fail. +*/ + virtual bool controllerDidOpen( IONetworkController * controller ); + +/*! @function controllerWillClose + @abstract Sends a notification that the interface will close the network + controller. + @discussion This method is called by handleClose() after + receiving a close from the last interface client, and just before the + controller is closed. Subclasses can override this method to perform any + cleanup action before the controller is closed. This method is called with + the arbitration lock held, hence issuing I/O to the controller should be + avoided to eliminate the possibility of a deadlock. + @param controller The controller that is about to be closed. +*/ + virtual void controllerWillClose( IONetworkController * controller ); + +/*! @function performCommand + @abstract Handles an ioctl command sent to the network interface. + @discussion This method handles socket ioctl commands sent to the + network interface from DLIL. + IONetworkInterface handles commands that are common for all network + interface types. A subclass of IONetworkInterface may override this + method to override the command handling in IONetworkInterface, or + to extend the command processing to handle additional commands. + The ioctl commands handled by IONetworkInterface are + SIOCGIFMTU (Get interface MTU size), + SIOCSIFMTU (Set interface MTU size), + SIOCSIFMEDIA (Set media), and + SIOCGIFMEDIA (Get media and link status). + @param controller The controller object. + @param cmd The ioctl command code. + @param arg0 Command argument 0. Generally a pointer to an ifnet structure + associated with the interface. + @param arg1 Command argument 1. + @result Returns a BSD return value defined in bsd/sys/errno.h. +*/ + virtual SInt32 performCommand( + IONetworkController * controller, + unsigned long cmd, + void * arg0, + void * arg1 ); + +public: + +/*! @function getIfnet + @abstract Returns the ifnet_t allocated by the interface object. + @discussion Gets the interface's ifnet_t, which is managed + primarily by IONetworkInterface, however subclasses or drivers + can use this method to obtain a reference to the ifnet_t for + interface KPI calls. + @result Returns the ifnet_t after the interface has attached + to the network stack and before the interface is detached, otherwise returns + NULL. +*/ + virtual ifnet_t getIfnet( void ) const; + +protected: + + /* Deprecated. Use initIfnetParams instead. */ + virtual bool initIfnet( struct ifnet * ifp ); + +/*! @function handleClientOpen + @abstract Handles a client open on the interface. + @discussion This method is called by handleOpen() to allow a + subclass to handle a client close. The arbitration lock is held. + @param client The client object requesting the open. + @param options Options passed to handleOpen(). + @param argument Argument passed to handleOpen(). + @result Returns true to accept the client open, false to reject the open. +*/ + virtual bool handleClientOpen( IOService * client, + IOOptionBits options, + void * argument ); + +/*! @function handleClientClose + @abstract Handles a client close on the interface. + @discussion This method is called by handleClose() to allow a + subclass to handle a client close. The arbitration lock is held. + @param client The client object requesting the close. + @param options Options same options passed to handleClose(). +*/ + virtual void handleClientClose( IOService * client, + IOOptionBits options ); + + /* Override IOService::newUserClient() */ + virtual IOReturn newUserClient( task_t owningTask, + void * security_id, + UInt32 type, + IOUserClient ** handler ) APPLE_KEXT_OVERRIDE; + +/*! @function setInterfaceState + @abstract Updates the interface object state flags. + @discussion The flags reflect the current state of the interface, and is + also published through the kIOInterfaceState property. + @param set The flags that should be set. + @param clear The flags that should be cleared. + @result Returns the new interface state flags. +*/ + virtual UInt32 setInterfaceState( UInt32 set, UInt32 clear = 0 ); + +/*! @function powerStateWillChangeTo + @abstract Handles a pre-change power interest notification from the + network controller. + @discussion The controllerWillChangePowerState() method is + called by this handler. Subclasses are not expected to override this method. + @param flags Flags that describe the capability of the controller in the + new power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller is switching to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result Returns IOPMAckImplied to indicate synchronous completion. +*/ + virtual IOReturn powerStateWillChangeTo( + IOPMPowerFlags flags, + unsigned long stateNumber, + IOService * policyMaker ) APPLE_KEXT_OVERRIDE; + +/*! @function powerStateDidChangeTo + @abstract Handles a post-change power interest notification from the + network controller. + @discussion The controllerDidChangePowerState() method is + called by this handler. Subclasses are not expected to override this method. + @param flags Flags that describe the capability of the controller in the + new power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller has switched to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result Returns IOPMAckImplied to indicate synchronous completion. +*/ + virtual IOReturn powerStateDidChangeTo( + IOPMPowerFlags flags, + unsigned long stateNumber, + IOService * policyMaker ) APPLE_KEXT_OVERRIDE; + +/*! @function controllerWillChangePowerState + @abstract Handles a notification that the network controller servicing + this interface object will transition to a new power state. + @param controller The network controller object. + @param flags Flags that describe the capability of the controller in the + new power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller is switching to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result The return value is always kIOReturnSuccess. +*/ + virtual IOReturn controllerWillChangePowerState( + IONetworkController * controller, + IOPMPowerFlags flags, + UInt32 stateNumber, + IOService * policyMaker ); + +/*! @function controllerDidChangePowerState + @abstract Handles a notification that the network controller servicing + this interface object has transitioned to a new power state. + @param controller The network controller object. + @param flags Flags that describe the capability of the controller in the + new power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller has switched to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result The return value is always kIOReturnSuccess. +*/ + virtual IOReturn controllerDidChangePowerState( + IONetworkController * controller, + IOPMPowerFlags flags, + UInt32 stateNumber, + IOService * policyMaker ); + +public: + /* Override IOService::willTerminate() */ + virtual bool willTerminate( + IOService * provider, + IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + /* Override IOService::requestTerminate() */ + virtual bool requestTerminate( + IOService * provider, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + /* Override IOService::serializeProperties() */ + virtual bool serializeProperties( OSSerialize * s ) const APPLE_KEXT_OVERRIDE; + +/*! @function attachToDataLinkLayer + @abstract Attach the network interface to the BSD data link layer. + @discussion This method is called internally to attach the network + interface to the BSD data link layer, after an unit number has been + assigned. The calling context is not synchronized against the driver's + work loop. Subclasses may override this method to perform additional + setup before the network stack attach. The getIfnet() method + will return the BSD interface being attached. + @param options Options for the attach call. None are currently defined. + @param parameter Parameter for the attach call. Not currently used. + @result Returns kIOReturnSuccess on success. +*/ + virtual IOReturn attachToDataLinkLayer( IOOptionBits options, + void * parameter ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 0); + +/*! @function detachFromDataLinkLayer + @abstract Detach the network interface from the BSD data link layer. + @discussion This method is called internally to detach the network + interface from the BSD data link layer, after the interface has been + terminated and before the last client close. This method will block until + the detach operation is complete. The calling context is not synchronized + against the driver's work loop. Subclasses may override this method to + perform additional cleanup before or after detaching from the network + stack. The getIfnet() method will return NULL after detach. + @param options Options for the detach call. None are currently defined. + @param parameter Parameter for the detach call. Not currently used. +*/ + virtual void detachFromDataLinkLayer( IOOptionBits options, + void * parameter ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 1); + +protected: +/*! @function feedPacketInputTap + @abstract Feed received packets to the BPF + @discussion This function is called internally to send input packets to + the BPF input tap when it is enabled. Subclasses are not expected to + override this method. + @param mbuf_t Pointer to the input packet. +*/ + virtual void feedPacketInputTap( mbuf_t ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 2); + +/*! @function feedPacketOutputTap + @abstract Feed output packets to the BPF + @discussion This function is called internally to send output packets to + the BPF output tap when it is enabled. Subclasses are not expected to + override this method. + @param mbuf_t Pointer to the output packet. +*/ + virtual void feedPacketOutputTap( mbuf_t ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 3); + +/*! @function initIfnetParams + @abstract Allows a subclass to provide ifnet initialization parameters + specific to an interface type. + @discussion This method initializes the parameters that are common to all + network interfaces. An interface subclass is expected to override this + method, call the superclass implementation first, then initialize the + parameters specific to that interface type. This method is called after + an unit number has been assigned to the interface, and just before the + interface is attached to BSD. + @param params Pointer to an ifnet_init_params allocated by + the caller. + @result Returns true on success, false otherwise. +*/ + virtual bool initIfnetParams( struct ifnet_init_params * params ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 4); + +/*! @function configureOutputStartDelay + @abstract Configure the output start delay + @discussion This optional routine, if used, needs to be called after + IONetworkInterface::init() and before IONetworkInterface::attachToDataLinkLayer(). + This allows for over-riding ifnet_init_eparams.start_delay_qlen and + ifnet_init_eparams.start_delay_timeout. + @param outputStartDelayQueueLength, maps to ifnet_init_eparams.start_delay_qlen + @param outputStartDelayTimeout, maps to ifnet_init_eparams.start_delay_timeout + @result kIOReturnSuccess if interface was successfully + configured. + */ + IOReturn configureOutputStartDelay( uint16_t outputStartDelayQueueLength, + uint16_t outputStartDelayTimeout ); + +public: +#ifdef __PRIVATE_SPI__ +/*! @function setInterfaceSubType + @abstract Sets the interface sub-type. + @discussion The sub-type must be set before the interface is attached to + the networking stack. The driver's configureInterface() + or attachToDataLinkLayer in a subclass are valid call sites. + @param subType A constant defined in IONetworkTypesPrivate.h. + @result Returns true on success, false otherwise. +*/ + bool setInterfaceSubType( uint32_t subType ); + +/*! @function isBPFTapEnabled + @abstract Query if the BPF tap is enabled. + @abstract Allows a driver to poll the BPF tap state after receiving a + kIONetworkNotificationBPFTapStateChange notification. + @param options No options are currently defined, always pass zero. + @result Returns true if BPF tap is enabled, + false otherwise. +*/ + bool isBPFTapEnabled( IOOptionBits options = 0 ) const; + +/*! @function getLoggingLevel + @abstract Query the logging level for the interface. + @abstract Allows a driver to poll the logging level after receiving a + kIONetworkNotificationLoggingLevelChange notification. + @param options No options are currently defined, always pass zero. + @result Returns the current logging level. +*/ + int32_t getLoggingLevel( IOOptionBits options = 0 ) const; + +/*! @enum OutputPacketSchedulingModel + @discussion Output packet scheduling models. + @constant kOutputPacketSchedulingModelNormal + The default output packet scheduling model where the driver or media does + not require strict scheduling strategy, and that the networking stack is + free to choose the most appropriate scheduling and queueing algorithm, + including shaping traffics. + @constant kOutputPacketSchedulingModelDriverManaged + The alternative output packet scheduling model where the driver or media + requires strict scheduling strategy (e.g. 802.11 WMM), and that the + networking stack is only responsible for creating multiple queues for the + corresponding service classes. + @constant kOutputPacketSchedulingModelFqCodel + The FQ-CoDel packet scheduling model. +*/ + enum { + kOutputPacketSchedulingModelNormal = 0, + kOutputPacketSchedulingModelDriverManaged = 1, + kOutputPacketSchedulingModelFqCodel = 2 + }; + +/*! @function configureOutputPullModel + @abstract Configure and use the pull-model to transmit packets. + @discussion A driver that supports the pull-model to transmit packets must + call this method from configureInterface() to configure the + model, and to transition the interface to use the pull-model exclusively. + In the pull-model, the interface will manage an output queue that a driver + can pull packets from. An output thread will notify the driver through + outputStart() when packets are added to the output queue. + @param driverQueueSize The number of packets that the driver's transmit + queue or ring can hold. This parameter is not currently used by the family, + and drivers can pass zero. + @param options kIONetworkWorkLoopSynchronous forces the output + thread to call outputStart() on the driver's work loop context. + @param outputQueueSize The size of the interface output queue. Unless the + driver has special requirements, it is advisable to pass zero to let the + networking stack choose the output queue size. + @param outputSchedulingModel An output packet scheduling model. + Pass zero or kOutputPacketSchedulingModelNormal for the default + model which lets the network stacking choose the most appropriate scheduling + and queueing algorithm. + @param outputTargetQdelay Allow drivers to set the default target delay. + @result kIOReturnSuccess if interface was successfully + configured to use the pull-model for outbound packets. +*/ + virtual IOReturn configureOutputPullModel( + uint32_t driverQueueSize, + IOOptionBits options = 0, + uint32_t outputQueueSize = 0, + uint32_t outputSchedulingModel = 0, + uint32_t outputTargetQdelay = 0); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 5); + +/*! @function configureInputPacketPolling + @abstract Configure and enable polling of input packets. + @discussion A driver that supports polled-mode processing of input packets + must call this method from configureInterface() to configure + input polling. Once configured, the network stack is allowed to dynamically + transition the input model from the default push-model where packets are + pushed by the driver to the network stack, to the pull-model where a poller + thread will periodically pull packets (if any) from the driver. + @param driverQueueSize The number of packets that the driver's receive + queue or ring can hold when completely full. + @param options kIONetworkWorkLoopSynchronous forces the + poller thread to call pollInputPackets() on the driver's + work loop context. The setInputPacketPollingEnable() + method call is always synchronized against the driver's work loop. + @result kIOReturnSuccess if input polling was successfully + configured. +*/ + virtual IOReturn configureInputPacketPolling( + uint32_t driverQueueSize, + IOOptionBits options = 0 ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 6); + +/*! @function reportDataTransferRates + @abstract For drivers to report the current data transfer rates. + @discussion The rates reported by this method will supersede the single + link speed reported by IONetworkController::setLinkStatus. + This method allows the driver to report asymmetric input and output data + rates, and also the effective data rates when available. + @param outputRateMax The maximum output data rate in bit/s. + @param inputRateMax The maximum input data rate in bit/s. + @param outputRateEffective The effective output data rate in bit/s. + If zero, the outputRateMax value is passed to the network stack. + @param inputRateEffective The effective input data rate in bit/s. + If zero, the inputRateMax value is passed to the network stack. +*/ + virtual void reportDataTransferRates( + uint64_t outputRateMax, + uint64_t inputRateMax, + uint64_t outputRateEffective = 0, + uint64_t inputRateEffective = 0 ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 7); + +/*! @function stopOutputThread + @abstract Called by drivers to stop the output thread. + @discussion Only drivers that support the pull output model should call + this method. In the stop state, the output thread will not invoke the + driver's outputStart() method, even when new packets are + added to the output queue. This method is synchronous with respect to + any outputStart() invocation, so upon returning from this + method it is guaranteed that the output thread has stopped executing + driver code. The network interface will internally stop the output + thread before detaching from the network stack, and also before system + shutdown and restart. + @param options No options are currently defined, always pass zero. + @result kIOReturnSuccess if the thread was stopped, + kIOReturnTimeout if the wait for output thread to exit + outputStart() timed out. +*/ + IOReturn stopOutputThread( IOOptionBits options = 0 ); + +/*! @function startOutputThread + @abstract Called by drivers to start the output thread. + @discussion The output thread is initially in a stop state, and it must + be started before it can invoke the driver's outputStart() + method. Drivers may also issue start to release a previous stop request. + After starting the output thread, if the output queue is not empty, or + after a new packet is added to the output queue, the output thread will + wakeup and invoke the driver's outputStart() method. + @param options No options are currently defined, always pass zero. + @result kIOReturnSuccess if start was successful, + kIOReturnNotAttached if the network interface has detached + from the network stack. +*/ + IOReturn startOutputThread( IOOptionBits options = 0 ); + +/*! @function signalOutputThread + @abstract Informs the output thread that driver has completed packet + transmission. + @discussion A driver that supports the pull output model must call this + method after packet transmission is complete, and driver resources are + available to outputStart() to handle additional packets. + It is recommended to batch this call when retiring a group of output + packets. This method will wake up the output thread if the output queue + is not empty, and the output thread is not stopped. + @param options No options are currently defined, always pass zero. +*/ + void signalOutputThread( IOOptionBits options = 0 ); + +/*! @function flushOutputQueue + @abstract Flush all packets in the interface output queue. + @discussion A driver that supports the pull output model can use this + method to free all packets currently held in the interface output queue. + @param options No options are currently defined, always pass zero. +*/ + void flushOutputQueue( IOOptionBits options = 0 ); + +/*! @function dequeueOutputPackets + @abstract Dequeue packets from the interface output queue. + @discussion A driver that supports the output pull-model will typically + call this method from outputStart() after it has calculated + the maximum number of packets that can be dequeued based on available + resources. Drivers should not dequeue more packets than they can accept + since there is no facility to insert a packet to the head of the queue. + The only recourse is to drop the packet, or store the packet on a driver + managed queue which is not recommended. This method can dequeue a single + packet as a mbuf chain, or multiple packets using a linked list of mbuf + chains. It is also possible for the queue to not return any packet to the + driver in order to throttle the transmit rate. Although typically called + from outputStart(), this is not a mandatory requirement. E.g. + a driver may choose to dequeue in the transmit completion path to quickly + fill an available transmit slot. + @param maxCount The maximum number of packets to dequeue. This value must + be greater than zero. + @param packetHead Pointer to the first packet that was dequeued. + @param packetTail Optional pointer to the last packet that was dequeued. + @param packetCount Optional pointer to store the number of packets that + was dequeued. + @param packetBytes Optional pointer to store the total length of packets + that was dequeued. The length of each packet is given by + mbuf_pkthdr_len(). + @result kIOReturnSuccess if at least one packet was dequeued, + kIOReturnBadArgument if an argument was invalid, + kIOReturnNoFrames if the queue is empty, or the queue is + limiting the transmit rate. +*/ + virtual IOReturn dequeueOutputPackets( + uint32_t maxCount, + mbuf_t * packetHead, + mbuf_t * packetTail = 0, + uint32_t * packetCount = 0, + uint64_t * packetBytes = 0 ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 8); + +/*! @function dequeueOutputPacketsWithServiceClass + @abstract Dequeue packets of a particular service class from the interface + output queue. + @discussion See dequeueOutputPackets. + @param maxCount The maximum number of packets to dequeue. This value must + be greater than zero. + @param serviceClass A service class specification provided by the caller. + Only packets belonging to the specified service class will be dequeued. + @param packetHead Pointer to the first packet that was dequeued. + @param packetTail Optional pointer to the last packet that was dequeued. + @param packetCount Optional pointer to store the number of packets that + was dequeued. + @param packetBytes Optional pointer to store the total length of packets + that was dequeued. The length of each packet is given by + mbuf_pkthdr_len(). + @result kIOReturnSuccess if at least one packet was dequeued, + kIOReturnBadArgument if an argument was invalid, + kIOReturnNoFrames if the queue is empty, no packet belongs to + the service class or the queue is limiting the transmit rate. +*/ + virtual IOReturn dequeueOutputPacketsWithServiceClass( + uint32_t maxCount, + IOMbufServiceClass serviceClass, + mbuf_t * packetHead, + mbuf_t * packetTail = 0, + uint32_t * packetCount = 0, + uint64_t * packetBytes = 0 ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 9); + +/*! @function dequeueOutputPacketsWithMaxSize + @abstract Dequeue packets with a byte size constraint. + @discussion See dequeueOutputPackets. + @param maxSize The maximum byte size of the dequeued packet chain. + This value must be greater than zero. + @param packetHead Pointer to the first packet that was dequeued. + @param packetTail Optional pointer to the last packet that was dequeued. + @param packetCount Optional pointer to store the number of packets that + was dequeued. + @param packetBytes Optional pointer to store the total length of packets + that was dequeued. The length of each packet is given by + mbuf_pkthdr_len(). +*/ + IOReturn dequeueOutputPacketsWithMaxSize( + uint32_t maxSize, + mbuf_t * packetHead, + mbuf_t * packetTail = 0, + uint32_t * packetCount = 0, + uint64_t * packetBytes = 0 ); + +/* @function installOutputPreEnqueueHandler + @abstract Install a handler to intercept all output packets before they + are added to the output queue. + @discussion A single handler can be installed before the interface is + attached to the networking stack. The handler will not be invoked unless + the driver configures the interface to utilize the new output pull-model. + @param handler A C-function handler. + @target A reference passed to the handler. + @refCon A reference constant passed to the handler. + @result kIOReturnSuccess if the handler was successfully + installed, kIOReturnBadArgument if the handler provided was + NULL, or kIOReturnError if the call was made after the + interface has already attached to the networking stack. +*/ + IOReturn installOutputPreEnqueueHandler( + OutputPreEnqueueHandler handler, + void * target, + void * refCon ); + +/* @function enqueueOutputPacket + @abstract Enqueue a packet to the output queue. + @discussion Wrapper for the private ifnet_enqueue(). + @param packet The packet being enqueued; only one packet is allowed + to be enqueued at a time. + @param options No options are currently defined, always pass zero. + @result The value returned by ifnet_enqueue(). +*/ + errno_t enqueueOutputPacket( + mbuf_t packet, + IOOptionBits options = 0 ); + +/*! @function enqueueInputPacket + @abstract Queue a packet received by the driver before forwarding it to + the networking stack. + @discussion When input polling is not enabled, drivers should call this + method to queue each received packet on the interface input queue, then + flush the input queue at the end of the driver receive loop. When this + method is called as a result of input polling, driver must specify the + polling queue by passing the queue provided by the poller. Access to the + interface input queue is unsynchronized, since input packet handling is + expected to be single-threaded. The input packet must point to a header + mbuf with MBUF_PKTHDR flag set, with any additional mbufs + linked by the next chain. The length in the packet header, including the + data length for every mbuf in the chain must be set. If FCS is included + in the packet data, then the MBUF_HASFCS mbuf flag must be + set. This is the preferred interface to queue and submit an input packet, + and is functionally equivalent to calling inputPacket with + the kInputOptionQueuePacket option. Submitting a chain of + packets is not supported. + @param packet The input packet. Caller ceases ownership of the packet + regardless of the return value. + @param queue Defaults to zero which specifies the interface input queue. + To handoff a packet during input polling, pass the queue provided by the + poller. + @param options No options are currently defined, always pass zero. + @result kIOReturnSuccess if packet was added to the queue, + or an error code otherwise. +*/ + virtual IOReturn enqueueInputPacket( + mbuf_t packet, + IOMbufQueue * queue = 0, + IOOptionBits options = 0 ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 10); + +/*! @function reportTransmitCompletionStatus + @abstract Report the transmit completion status for an outgoing packet. + @discussion Invoked by drivers that are capable of reporting when a packet + has been transmitted across the link layer. Besides reporting the packet + transmit status using this method, driver must also publish the + kIONetworkFeatureTransmitCompletionStatus feature. + @param packet The packet that was transmitted. + @param status The transmit status. + @param param1 Always pass zero. + @param param2 Always pass zero. + @param No options are currently defined, always pass zero. + @result kIOReturnSuccess if the transmit status was valid + and accepted, otherwise kIOReturnBadArgument for bad status, + or kIOReturnError if an error occurred when passing the status + to the networking stack. +*/ + IOReturn reportTransmitCompletionStatus( + mbuf_t packet, + IOReturn status, + uint32_t param1 = 0, + uint32_t param2 = 0, + IOOptionBits options = 0 ); + +/*! @function reportDatapathIssue + @abstract Used by kernel network driver or family to inform userspace + of a datapath issue. + @discussion An issue report will be sent to any userspace applications + or daemons that have registered for datapath issues notifications from + this network interface. + @param issue Subsystem specific error code. + @param data Reserved for future use. + @param length Reserved for future use. + @result Returns kIOReturnSuccess if successful, + otherwise an appropriate error code. +*/ + IOReturn reportDatapathIssue( + IOReturn issue, + void * data = 0, + IOByteCount length = 0 ); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9 +/*! @function setPacketPollingParameters + @abstract Modify the input polling parameters. + @discussion Invokes ifnet_set_poll_params() using the + parameters provided. + @param params Polling parameters. + @param options No options are currently defined, always pass zero. + @result Returns kIOReturnSuccess if successful, + otherwise an appropriate error code. +*/ + IOReturn setPacketPollingParameters( + const IONetworkPacketPollingParameters * params, + IOOptionBits options = 0 ); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13 + /*! @function configureClientBehavior + @abstract Configure client behavior. + @discussion Invoked by drivers that wish to alter IONetworkInterface's behavior. + @param options set kIONetworkClientBehaviorLinkStateActiveRegister + to have IONetworkInterface trigger matching when link state goes to active. + set kIONetworkClientBehaviorLinkStateChangeMessage to have + IONetworkInterface deliver an IOKit message when link state changes. + @result Returns kIOReturnSuccess if successful, + otherwise an appropriate error code. + */ + IOReturn configureClientBehavior( IOOptionBits options = 0 ); +#endif + +#else /* !__PRIVATE_SPI__ */ + OSMetaClassDeclareReservedUnused( IONetworkInterface, 5); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 6); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 7); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 8); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 9); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 10); +#endif /* !__PRIVATE_SPI__ */ + OSMetaClassDeclareReservedUnused( IONetworkInterface, 11); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 12); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 13); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 14); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IONETWORKINTERFACE_H */ diff --git a/QualcommWireless/include/IOKit/network/IONetworkMedium.h b/QualcommWireless/include/IOKit/network/IONetworkMedium.h new file mode 100644 index 0000000..62dbc66 --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IONetworkMedium.h @@ -0,0 +1,425 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKMEDIUM_H +#define _IONETWORKMEDIUM_H + +__BEGIN_DECLS + +#include + +/*! @typedef IOMediumType + @discussion A 32-bit value divided into fields which describes + a single medium type. */ + +typedef UInt32 IOMediumType; + +/*! @defined kIOMediumType + @abstract A property of IONetworkMedium objects. + @discussion The kIOMediumType property is an OSNumber object that describes the type of + medium that this object represents. +*/ + +#define kIOMediumType "Type" + +/*! @defined kIOMediumFlags + @abstract A property of IONetworkMedium objects. + @discussion The kIOMediumFlags property is an OSNumber object that describes a set of + attributes assigned to the medium. +*/ + +#define kIOMediumFlags "Flags" + +/*! @defined kIOMediumSpeed + @abstract A property of IONetworkMedium objects. + @discussion The kIOMediumSpeed property is an OSNumber object that describes the maximum link + speed supported by the medium in bits per second. +*/ + +#define kIOMediumSpeed "Speed" + +/*! @defined kIOMediumIndex + @abstract A property of IONetworkMedium objects. + @discussion The kIOMediumIndex property is an OSNumber object that describes an index assigned + by the owner of the medium object. Its interpretation is driver + specific. +*/ + +#define kIOMediumIndex "Index" + +//=========================================================================== +// Medium Type (IOMediumType). +// +// The medium type is encoded by a 32-bit value. The definitions of +// the fields and the encoding for each field is adapted from FreeBSD. +// +// Bits Definition +// ------------------- +// 4-0 medium subtype +// 7-5 network type +// 15-8 network specific options +// 19-16 reserved +// 27-20 common options +// 31-28 instance number + +// Ethernet. +// +enum { + kIOMediumEthernet = IFM_ETHER, + kIOMediumEthernetAuto = ( IFM_AUTO | IFM_ETHER ), + kIOMediumEthernetManual = ( IFM_MANUAL | IFM_ETHER ), + kIOMediumEthernetNone = ( IFM_NONE | IFM_ETHER ), + kIOMediumEthernet10BaseT = ( IFM_10_T | IFM_ETHER ), + kIOMediumEthernet10Base2 = ( IFM_10_2 | IFM_ETHER ), + kIOMediumEthernet10Base5 = ( IFM_10_5 | IFM_ETHER ), + kIOMediumEthernet100BaseTX = ( IFM_100_TX | IFM_ETHER ), + kIOMediumEthernet100BaseFX = ( IFM_100_FX | IFM_ETHER ), + kIOMediumEthernet100BaseT4 = ( IFM_100_T4 | IFM_ETHER ), + kIOMediumEthernet100BaseVG = ( IFM_100_VG | IFM_ETHER ), + kIOMediumEthernet100BaseT2 = ( IFM_100_T2 | IFM_ETHER ), + kIOMediumEthernet1000BaseSX = ( IFM_1000_SX | IFM_ETHER ), + kIOMediumEthernet10BaseSTP = ( IFM_10_STP | IFM_ETHER ), + kIOMediumEthernet10BaseFL = ( IFM_10_FL | IFM_ETHER ), + kIOMediumEthernet1000BaseLX = ( IFM_1000_LX | IFM_ETHER ), + kIOMediumEthernet1000BaseCX = ( IFM_1000_CX | IFM_ETHER ), + kIOMediumEthernet1000BaseTX = ( IFM_1000_T | IFM_ETHER ), //deprecated- use kIOMediumEthernet1000BaseT instead + kIOMediumEthernet1000BaseT = ( IFM_1000_T | IFM_ETHER ), + kIOMediumEthernetHomePNA1 = ( IFM_HPNA_1 | IFM_ETHER ), + kIOMediumEthernet10GBaseSR = ( IFM_10G_SR | IFM_ETHER ), + kIOMediumEthernet10GBaseLR = ( IFM_10G_LR | IFM_ETHER ), + kIOMediumEthernet10GBaseCX4 = ( IFM_10G_CX4 | IFM_ETHER ), + kIOMediumEthernet10GBaseT = ( IFM_10G_T | IFM_ETHER ), + kIOMediumEthernet2500BaseT = ( IFM_2500_T | IFM_ETHER ), + kIOMediumEthernet5000BaseT = ( IFM_5000_T | IFM_ETHER ) +}; + +// IEEE 802.11 Wireless. +// +enum { + kIOMediumIEEE80211 = IFM_IEEE80211, + kIOMediumIEEE80211Auto = ( IFM_AUTO | IFM_IEEE80211 ), + kIOMediumIEEE80211Manual = ( IFM_MANUAL | IFM_IEEE80211 ), + kIOMediumIEEE80211None = ( IFM_NONE | IFM_IEEE80211 ), + kIOMediumIEEE80211FH1 = ( IFM_IEEE80211_FH1 | IFM_IEEE80211 ), + kIOMediumIEEE80211FH2 = ( IFM_IEEE80211_FH2 | IFM_IEEE80211 ), + kIOMediumIEEE80211DS2 = ( IFM_IEEE80211_DS2 | IFM_IEEE80211 ), + kIOMediumIEEE80211DS5 = ( IFM_IEEE80211_DS5 | IFM_IEEE80211 ), + kIOMediumIEEE80211DS11 = ( IFM_IEEE80211_DS11 | IFM_IEEE80211 ), + kIOMediumIEEE80211DS1 = ( IFM_IEEE80211_DS1 | IFM_IEEE80211 ), + kIOMediumIEEE80211OptionAdhoc = IFM_IEEE80211_ADHOC +}; + +// Common options. +// +enum { + kIOMediumOptionFullDuplex = IFM_FDX, + kIOMediumOptionHalfDuplex = IFM_HDX, + kIOMediumOptionFlowControl = IFM_FLOW, + kIOMediumOptionEEE = IFM_EEE, + kIOMediumOptionFlag0 = IFM_FLAG0, + kIOMediumOptionFlag1 = IFM_FLAG1, + kIOMediumOptionFlag2 = IFM_FLAG2, + kIOMediumOptionLoopback = IFM_LOOP +}; + +// Medium type masks. +// +#define kIOMediumSubTypeMask IFM_TMASK +#define kIOMediumNetworkTypeMask IFM_NMASK +#define kIOMediumOptionsMask IFM_OMASK +#define kIOMediumCommonOptionsMask IFM_GMASK +#define kIOMediumInstanceShift IFM_ISHIFT +#define kIOMediumInstanceMask IFM_IMASK + +// Medium type field accessors. +// +#define IOMediumGetSubType(x) ((x) & kIOMediumSubTypeMask) +#define IOMediumGetNetworkType(x) ((x) & kIOMediumNetworkTypeMask) +#define IOMediumGetInstance(x) (((x) & kIOMediumInstanceMask) >> \ + kIOMediumInstanceShift) + +//=========================================================================== +// Medium flags. + + +//=========================================================================== +// Link status bits. +// +enum { + kIONetworkLinkValid = IFM_AVALID, // link status is valid + kIONetworkLinkActive = IFM_ACTIVE, // link is up/active. + kIONetworkLinkNoNetworkChange = IFM_WAKESAMENET +}; + +__END_DECLS + +#ifdef KERNEL +//=========================================================================== +// IONetworkMedium class. + +#include +#include + +/*! @class IONetworkMedium + @abstract An object that encapsulates information about a network + medium (i.e. 10Base-T, or 100Base-T Full Duplex). + @discussion The main purpose of + this object is for a network driver to advertise its media capability, + through a collection of IONetworkMedium objects stored in a dictionary + in its property table. IONetworkMedium supports serialization, and will + encode its properties in the form of a dictionary to the serialization + stream when instructed. This will allow a user-space application to + browse the set of media types supported by the controller. +*/ + +class IONetworkMedium : public OSObject +{ + OSDeclareDefaultStructors( IONetworkMedium ) + +protected: + IOMediumType _type; + UInt32 _flags; + UInt64 _speed; + UInt32 _index; + const OSSymbol * _name; + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *_reserved; + + +/*! @function free + @abstract Frees the IONetworkMedium object. +*/ + + virtual void free() APPLE_KEXT_OVERRIDE; + +public: + +/*! @function nameForType + @abstract Creates a name that describes a medium type. + @discussion Given a medium type, creates an OSymbol object that + describes the medium type. There is a 1-to-1 mapping between the + medium type, and the medium name created by this method. The caller + is responsible for releasing the OSSymbol object returned. + @param type A medium type. See IONetworkMedium.h for type encoding. + @result Returns an OSSymbol object is created based on the type provided. +*/ + + static const OSSymbol * nameForType(IOMediumType type); + +/*! @function addMedium + @abstract Adds an IONetworkMedium object to a dictionary. + @discussion A helper function to add an IONetworkMedium object to a + given dictionary. The name of the medium is used as the key for the + new dictionary entry. + @param dict An OSDictionary object where the medium object should be + added as a new entry. + @param medium The IONetworkMedium object to add to the dictionary. + @result Returns true on success, false otherwise. +*/ + + static bool addMedium(OSDictionary * dict, + const IONetworkMedium * medium); + +/*! @function removeMedium + @abstract Removes an IONetworkMedium object from a dictionary. + @discussion A helper function to remove an entry in a dictionary. + @param dict The OSDictionary object where the medium object should be + removed from. + @param medium The name of this medium object is used as the key. +*/ + + static void removeMedium(OSDictionary * dict, + const IONetworkMedium * medium); + +/*! @function getMediumWithType + @abstract Finds a medium object from a dictionary with a given type. + @discussion This method iterates through a dictionary and returns an IONetworkMedium + entry with the given type. An optional mask supplies the don't care bits. + @param dict The dictionary to look for a matching entry. + @param type Search for an entry with this type. + @param mask The don't care bits in IOMediumType. Defaults to 0, which + implies that a perfect match is desired. + @result Returns the first matching IONetworkMedium entry found, + or 0 if no match was found. +*/ + + static IONetworkMedium * getMediumWithType(const OSDictionary * dict, + IOMediumType type, + IOMediumType mask = 0); + +/*! @function getMediumWithIndex + @abstract Finds a medium object from a dictionary with a given index. + @discussion This method iterates through a dictionary and returns an IONetworkMedium + entry with the given index. An optional mask supplies the don't care bits. + @param dict The dictionary to look for a matching entry. + @param index Search for an entry with the given index. + @param mask The don't care bits in index. Defaults to 0, which + implies that a perfect match is desired. + @result Returns the first matching IONetworkMedium entry found, + or 0 if no match was found. +*/ + + static IONetworkMedium * getMediumWithIndex(const OSDictionary * dict, + UInt32 index, + UInt32 mask = 0); + +/*! @function init + @abstract Initializes an IONetworkMedium object. + @param type The medium type, this value is encoded with bits defined in + IONetworkMedium.h. + @param speed The maximum (or the only) link speed supported over this + medium in units of bits per second. + @param flags An optional flag for the medium object. + See IONetworkMedium.h for defined flags. + @param index An optional index number assigned by the owner. + Drivers can use this to store an index to a media table in + the driver, or it may map to a driver-defined media type. + @param name An optional name assigned to this medium object. If 0, + then a name will be created based on the medium type by + calling IONetworkMedium::nameForType(). Since the name of + the medium is used as a key when inserted into a dictionary, + the name chosen must be unique within the scope of the owner. + @result Returns true on success, false otherwise. +*/ + + virtual bool init(IOMediumType type, + UInt64 speed, + UInt32 flags = 0, + UInt32 index = 0, + const char * name = 0); + +/*! @function medium + @abstract Factory method that allocates and initializes an IONetworkMedium object. + @param type The medium type, this value is encoded with bits defined in + IONetworkMedium.h. + @param speed The maximum (or the only) link speed supported over this + medium in units of bits per second. + @param flags An optional flag for the medium object. + See IONetworkMedium.h for defined flags. + @param index An optional index number assigned by the owner. + Drivers can use this to store an index to a media table in + the driver, or it may map to a driver-defined media type. + @param name An optional name assigned to this medium object. If 0, + then a name will be created based on the medium type by + calling IONetworkMedium::nameForType(). Since the name of + the medium is used as a key when inserted into a dictionary, + the name chosen must be unique within the scope of the owner. + @result Returns an IONetworkMedium instance on success, or 0 otherwise. +*/ + + static IONetworkMedium * medium(IOMediumType type, + UInt64 speed, + UInt32 flags = 0, + UInt32 index = 0, + const char * name = 0); + +/*! @function getType + @result Returns the medium type assigned to this medium object. +*/ + + virtual IOMediumType getType() const; + +/*! @function getSpeed + @result Returns the maximum link speed supported by this medium. +*/ + + virtual UInt64 getSpeed() const; + +/*! @function getFlags + @result Returns the medium flags. +*/ + + virtual UInt32 getFlags() const; + +/*! @function getIndex + @result Returns the assigned medium index. +*/ + + virtual UInt32 getIndex() const; + +/*! @function getName + @result Returns the name assigned to this medium object. +*/ + + virtual const OSSymbol * getName() const; + +/*! @function getKey + @result Returns the key to use for this medium object. This key should be + used when this object is added to a dictionary. Same as getName(). +*/ + + virtual const OSSymbol * getKey() const; + +/*! @function isEqualTo + @abstract Tests for equality between two IONetworkMedium objects. + @discussion Two IONetworkMedium objects are considered equal if + they have similar properties assigned to them during initialization. + @param medium An IONetworkMedium to test against the IONetworkMedium + object being called. + @result Returns true if equal, false otherwise. +*/ + + virtual bool isEqualTo(const IONetworkMedium * medium) const; + +/*! @function isEqualTo + @abstract Tests for equality between a IONetworkMedium object and an + OSObject. + @discussion The OSObject is considered equal to the IONetworkMedium + object if the OSObject is an IONetworkMedium, and they have + similar properties assigned to them during initialization. + @param obj An OSObject to test against an IONetworkMedium object. + @result Returns true if equal, false otherwise. +*/ + + virtual bool isEqualTo(const OSMetaClassBase * obj) const APPLE_KEXT_OVERRIDE; + +/*! @function serialize + @abstract Serializes the IONetworkMedium object. + @discussion A dictionary is created containing the properties + assigned to this medium object, and this dictionary is then + serialized using the OSSerialize object provided. + @param s An OSSerialize object. + @result Returns true on success, false otherwise. +*/ + + virtual bool serialize(OSSerialize * s) const APPLE_KEXT_OVERRIDE; + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IONetworkMedium, 0); + OSMetaClassDeclareReservedUnused( IONetworkMedium, 1); + OSMetaClassDeclareReservedUnused( IONetworkMedium, 2); + OSMetaClassDeclareReservedUnused( IONetworkMedium, 3); +}; + +// Translate getKey() to getName(). +// +inline const OSSymbol * IONetworkMedium::getKey() const +{ + return getName(); +} + +#endif /* KERNEL */ + +#endif /* !_IONETWORKMEDIUM_H */ diff --git a/QualcommWireless/include/IOKit/network/IONetworkStats.h b/QualcommWireless/include/IOKit/network/IONetworkStats.h new file mode 100644 index 0000000..f358c1e --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IONetworkStats.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKSTATS_H +#define _IONETWORKSTATS_H + +#include + +/*! @header IONetworkStats.h + @discussion Generic network statistics. */ + +//------------------------------------------------------------------------ +// Generic network statistics. Common to all network interfaces. +// +// WARNING: This structure must match the statistics field in +// ifnet->if_data. This structure will overlay a portion of ifnet. + +/*! @typedef IONetworkStats + @discussion Generic network statistics structure. + @field inputPackets count input packets. + @field inputErrors count input errors. + @field outputPackets count output packets. + @field outputErrors count output errors. + @field collisions count collisions on CDMA networks. */ + +typedef struct { + UInt32 inputPackets; + UInt32 inputErrors; + UInt32 outputPackets; + UInt32 outputErrors; + UInt32 collisions; +} IONetworkStats; + +/*! @defined kIONetworkStatsKey + @discussion Defines the name of an IONetworkData that contains + an IONetworkStats. */ + +#define kIONetworkStatsKey "IONetworkStatsKey" + +//------------------------------------------------------------------------ +// Output queue statistics. + +/*! @typedef IOOutputQueueStats + @discussion Statistics recorded by IOOutputQueue objects. + @field capacity queue capacity. + @field size current size of the queue. + @field peakSize peak size of the queue. + @field dropCount number of packets dropped. + @field outputCount number of output packets. + @field retryCount number of retries. + @field stallCount number of queue stalls. */ + +typedef struct { + UInt32 capacity; + UInt32 size; + UInt32 peakSize; + UInt32 dropCount; + UInt32 outputCount; + UInt32 retryCount; + UInt32 stallCount; + UInt32 reserved[4]; +} IOOutputQueueStats; + +/*! @defined kIOOutputQueueStatsKey + @discussion Defines the name of an IONetworkData that contains + an IOOutputQueueStats. */ + +#define kIOOutputQueueStatsKey "IOOutputQueueStatsKey" + +#endif /* !_IONETWORKSTATS_H */ diff --git a/QualcommWireless/include/IOKit/network/IOOutputQueue.h b/QualcommWireless/include/IOKit/network/IOOutputQueue.h new file mode 100644 index 0000000..5716dd6 --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IOOutputQueue.h @@ -0,0 +1,280 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOOUTPUTQUEUE_H +#define _IOOUTPUTQUEUE_H + +#include + +// Forward declarations. +// +struct mbuf; +class IONetworkData; + +// FIXME - We do not want the enqueue/dequeue macros defined in queue.h. +// +#undef enqueue +#undef dequeue + +// FIXME - Belongs in IOBasicOutputQueue.h +// +/*! @enum OutputPacketStatus + @abstract The status of the packet sent to the target. + @constant kIOOutputStatusMask Define the status field in the return code. + @constant kIOOutputStatusAccept Packet was accepted by the target. + @constant kIOOutputStatusDropped Packet accepted, but was also dropped. + @constant kIOOutputStatusRetry Target ran out of resources, and is unable + to accept the packet. The ownership of the packet reverts back to the + queue. +*/ + +enum { + kIOOutputStatusMask = 0x00ff, + kIOOutputStatusAccepted = 0x0000, + kIOOutputStatusDropped = 0x0001, + kIOOutputStatusRetry = 0x0002 +}; + +/*! @enum OutputCommands + @abstract A command requested by the target. + @constant kIOOutputCommandMask Define the command field in the return code. + @constant kIOOutputCommandNone No command. + @constant kIOOutputCommandStall A command to stall the queue. +*/ + +enum { + kIOOutputCommandMask = 0xff00, + kIOOutputCommandNone = 0x0000, + kIOOutputCommandStall = 0x0100 +}; + +/*! @enum OutputHandlerReturnCodes + @abstract Common return codes returned by the target's output handler. + @constant kIOReturnOutputSuccess Packet was accepted. + @constant kIOReturnOutputDropped Packet was dropped. + @constant kIOReturnOutputStall Stall the queue and retry the same packet + when the queue is restarted. +*/ + +enum { + kIOReturnOutputSuccess = (kIOOutputStatusAccepted | kIOOutputCommandNone), + kIOReturnOutputDropped = (kIOOutputStatusDropped | kIOOutputCommandNone), + kIOReturnOutputStall = (kIOOutputStatusRetry | kIOOutputCommandStall) +}; + +/*! @class IOOutputQueue + @abstract A packet queue that supports multiple producers and a single + consumer. + @discussion Each producer, or a client thread, will deliver a chain of packets + to the queue. A single consumer will remove packets from the queue one at a + time and forward it to the registered target/action. This object may be used + by an IONetworkController on the output (transmit) side to handle the output + packet flow downstream from an IONetworkInterface, and then call the driver's + output function. IOOutputQueue is an abstract class that provides an interface + for its subclasses. Concrete subclasses will complete the implementation, and + specify the context that the target is called for packets removed from + the queue. +*/ + +class IOOutputQueue : public OSObject +{ + OSDeclareAbstractStructors( IOOutputQueue ) + +private: + + static void runServiceThread(thread_call_param_t, thread_call_param_t); + +protected: + + thread_call_t _callEntry; // callout entry structure. + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *_reserved; + + +/*! @function init + @abstract Initializes an IOOutputQueue object. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool init() APPLE_KEXT_OVERRIDE; + +/*! @function free + @abstract Frees the IOOutputQueue object. + @discussion Release allocated resources, then call super::free(). +*/ + + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! @function scheduleServiceThread + @abstract Schedules a service thread callout. + @discussion This method can be called by service() to schedule + a thread that will call serviceThread() when it starts running. + @param param A parameter to pass to the serviceThread() method. + @result Returns true if a thread callout was scheduled, false otherwise. +*/ + + virtual bool scheduleServiceThread(void * param = 0); + +/*! @function cancelServiceThread + @abstract Cancels any pending service thread callout. + @result Returns true if a previously scheduled thread callout was canceled, + false otherwise. +*/ + + virtual bool cancelServiceThread(); + +/*! @function serviceThread + @abstract Method called by the scheduled service thread when it + starts to run. + @discussion Must be implemented by a subclass that calls + scheduleServiceThread(). The default implementation does nothing. + @param param A parameter that was given to scheduleServiceThread() + when the service thread was scheduled. +*/ + + virtual void serviceThread(void * param); + +public: + +/*! @function start + @abstract Starts up the queue. + @discussion This method is called by the target to start the queue. This will allow + packets to be removed from the queue, then delivered to the target. + @result Returns true if the queue was started successfully, false otherwise. +*/ + + virtual bool start() = 0; + +/*! @function stop + @abstract Stops the queue. + @discussion Stop the queue and prevent it from sending packets to its + target. + @result Returns the previous running state of the queue, + true if the queue was running, false if the queue was already stopped. +*/ + + virtual bool stop() = 0; + +/*! @function service + @abstract Services the queue. + @discussion Manage the queue after it has been started. + @param options Options for the service request. + @result Returns a return value to indicate the service result. +*/ + + virtual bool service(IOOptionBits options = 0) = 0; + +/*! @function flush + @abstract Drops and frees all packets currently held by the queue. + @result Returns the number of packets that were dropped and freed. +*/ + + virtual UInt32 flush() = 0; + +/*! @function setCapacity + @abstract Changes the number of packets that the queue can hold + before it begins to drop excess packets. + @param capacity The new desired capacity. + @result Returns true if the new capacity was accepted, false otherwise. +*/ + + virtual bool setCapacity(UInt32 capacity) = 0; + +/*! @function getCapacity + @abstract Gets the number of packets that the queue can hold. + @discussion The queue will begin to drop incoming packets when the + size of queue reaches its capacity. + @result Returns the current queue capacity. +*/ + + virtual UInt32 getCapacity() const = 0; + +/*! @function getSize + @abstract Gets the number of packets currently held in the queue. + @result Returns the size of the queue. +*/ + + virtual UInt32 getSize() const = 0; + +/*! @function enqueue + @abstract Adds a packet, or a chain of packets, to the queue. + @discussion This method is called by a client to add a packet, or a chain of packets, + to the queue. A packet is described by an mbuf chain, while a chain + of packets is constructed by linking multiple mbuf chains via the + m_nextpkt field. + @param m A single packet, or a chain of packets. + @param param A parameter provided by the caller. + @result Returns a return code. +*/ + + virtual UInt32 enqueue(mbuf_t m, void * param) = 0; + +/*! @function getOutputHandler + @abstract Returns the address of a function that is designated to handle + incoming packets sent to the queue object. + @result Returns the address of the enqueue() method. +*/ + + virtual IOOutputAction getOutputHandler() const; + +/*! @function getStatisticsData + @abstract Returns an IONetworkData object containing statistics counters + updated by the queue. + @result Returns an IONetworkData object. This implementation will always return + 0. +*/ + + virtual IONetworkData * getStatisticsData() const; + + /*! @function getMbufPriority + @abstract Determines an mbuf's traffic priority. The highest priority is 0. + @discussion A queue can prioritize certain classes of traffic. This method + facilitates that by evaluating an mbuf and returning its priority. + @param m An mbuf to analyze. + @result Returns a UInt32 representing the priority of the packet. 0 is the highest priority. + */ + + OSMetaClassDeclareReservedUsed( IOOutputQueue, 0); + virtual UInt32 getMbufPriority(mbuf_t m); + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOOutputQueue, 1); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 2); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 3); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 4); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 5); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 6); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 7); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 8); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 9); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 10); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 11); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 12); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 13); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 14); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 15); +}; + +#endif /* !_IOOUTPUTQUEUE_H */ diff --git a/QualcommWireless/include/IOKit/network/IOPacketQueue.h b/QualcommWireless/include/IOKit/network/IOPacketQueue.h new file mode 100644 index 0000000..b6694b0 --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IOPacketQueue.h @@ -0,0 +1,290 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOPACKETQUEUE_H +#define _IOPACKETQUEUE_H + +#include +#include +extern "C" { +#include +} +// Forward declarations. +// +struct mbuf; +struct IOMbufQueue; + +// We do not want the enqueue/dequeue macros defined in queue.h. +// +// #warning queue.h should not be included +#undef enqueue +#undef dequeue + +/*! @class IOPacketQueue + @abstract Implements a bounded FIFO queue of mbuf packets. + @discussion Packets are + removed from the head of the queue (dequeue), and new packets are added + to the tail of the queue (enqueue). A spinlock is used to synchronize + access to the queue between methods that have a "lock" prefix. +*/ + +class IOPacketQueue : public OSObject +{ + OSDeclareDefaultStructors( IOPacketQueue ) + +protected: + IOMbufQueue * _queue; // mbuf queue + IOSimpleLock * _lock; // spinlock for synchronized methods + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *_reserved; + +/*! @function free + @abstract Frees the IOPacketQueue object. + @discussion All packets held by the queue are released back to the free + pool, resource are deallocated, then super::free() is called. +*/ + + virtual void free() APPLE_KEXT_OVERRIDE; + +/*! @var IOPacketQueueDefaultCapacity + @abstract Describes the default capacity of the + queue object. + @discussion The capacity is only observed by the enqueue() method. + Therefore, it is possible for the size of the queue to exceed its + capacity when other methods, such as prepend(), are used to add packets + to the queue. +*/ + + static const UInt32 IOPacketQueueDefaultCapacity = 100; + +public: + +/*! @function withCapacity + @abstract Factory method that constructs and initializes an + IOPacketQueue object. + @param capacity The initial capacity of the queue object. Can be + later changed by calling the setCapacity() method. + @result Returns an IOPacketQueue instance on success, or 0 otherwise. +*/ + + static IOPacketQueue * withCapacity(UInt32 capacity = + IOPacketQueueDefaultCapacity); + +/*! @function initWithCapacity + @abstract Initializes an IOPacketQueue object. + @discussion This method initializes an IOPacketQueue object with the given capacity. + @param capacity The initial capacity of the queue. Can be later changed + by calling the setCapacity() method. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool initWithCapacity(UInt32 capacity = + IOPacketQueueDefaultCapacity); + +/*! @function getSize + @abstract Gets the size of the queue. + @result Returns the number of packets currently held by the queue. +*/ + + virtual UInt32 getSize() const; + +/*! @function setCapacity + @abstract Changes the capacity of the queue. + @param capacity The new capacity. + @result Returns true if the new capacity was accepted, false otherwise. +*/ + + virtual bool setCapacity(UInt32 capacity); + +/*! @function getCapacity + @abstract Gets the current capacity of the queue. + @result Returns the current queue capacity. +*/ + + virtual UInt32 getCapacity() const; + +/*! @function peek + @abstract Examines the packet at the head of the queue without + removing it from the queue. + @discussion A following call to peek() or dequeue() will return + the same packet. The caller must never modify the mbuf packet returned. + @result Returns the packet at the head of the queue. +*/ + + virtual const mbuf_t peek() const; + +/*! @function prepend + @abstract Adds a chain of packets to the head of the queue. + @param m A chain of packets to add to the head of the queue. +*/ + + virtual void prepend(mbuf_t m); + +/*! @function prepend + @abstract Removes all packets from the specified queue, and adds them + to the head of this queue. + @param queue The source IOPacketQueue object containing the packets to + be transferred. +*/ + + virtual void prepend(IOPacketQueue * queue); + +/*! @function lockPrepend + @abstract Adds a chain of packets to the head of a synchronized queue. + @discussion A spinlock is used to synchronize access to the queue. + @param m A chain of packets to add to the head of the queue. + @result Always returns true. +*/ + + virtual void lockPrepend(mbuf_t m); + +/*! @function enqueue + @abstract Adds a chain of packets to the tail of the queue. + @discussion Packets are not added if the size of the queue has reached + its capacity. + @param m A chain of packets to add to the tail of the queue. + @result Returns true on success, or false to indicate over-capacity and refusal + to accept the packet chain provided. +*/ + + virtual bool enqueue(mbuf_t m); + +/*! @function enqueue + @abstract Removes all packets from the specified queue, and adds them + to the tail of this queue. + @param queue The source IOPacketQueue object containing the packets to + be transferred. + @result Always returns true. +*/ + + virtual bool enqueue(IOPacketQueue * queue); + +/*! @function enqueueWithDrop + @abstract Adds a chain of packets to the tail of the queue. + @discussion Packets are + dropped if the size of the queue has reached its capacity. + @param m A chain of packets to add to the tail of the queue. + @result Returns the number of packets dropped and freed by the queue. +*/ + + virtual UInt32 enqueueWithDrop(mbuf_t m); + +/*! @function lockEnqueue + @abstract Adds a chain of packets to the tail of a synchronized queue. + @discussion Packets are not added if the size of the queue has reached + its capacity. A spinlock is used to synchronize access to the queue. + @param m A chain of packets to add to the tail of the queue. + @result Returns true on success, or false to indicate over-capacity and refusal + to accept the packet chain provided. +*/ + + virtual bool lockEnqueue(mbuf_t m); + +/*! @function lockEnqueueWithDrop + @abstract Adds a chain of packets to the tail of a synchronized queue. + @discussion Packets are dropped if the size of the queue has reached its capacity. A spinlock is used to synchronize access to the queue. + @param m A chain of packets to add to the tail of the queue. + @result Returns the number of packets dropped and freed by the queue. +*/ + + virtual UInt32 lockEnqueueWithDrop(mbuf_t m); + +/*! @function dequeue + @abstract Removes a single packet from the head of the queue. + @result Returns a packet removed from the head of the queue, or NULL if the + queue was empty. +*/ + + virtual mbuf_t dequeue(); + +/*! @function lockDequeue + @abstract Removes a single packet from the head of a synchronized queue. + @discussion A spinlock is used to synchronize access to the queue. + @result Returns a packet removed from the head of the queue, or NULL if the + queue was empty. +*/ + + virtual mbuf_t lockDequeue(); + +/*! @function dequeueAll + @abstract Removes all packets from the queue and returns the head of the + packet chain. + @discussion The size of the queue is cleared to zero. + @result Returns the head of a packet chain linking all packets that were held + in the queue, or NULL if the queue was empty. +*/ + + virtual mbuf_t dequeueAll(); + +/*! @function lockDequeueAll + @abstract Removes all packets from a synchronized queue and returns the + head of the packet chain. + @discussion The size of the queue is cleared to zero. A spinlock is used + to synchronize access to the queue. + @result Returns the head of a packet chain linking all packets that were held + in the queue, or NULL if the queue was empty. +*/ + + virtual mbuf_t lockDequeueAll(); + +/*! @function flush + @abstract Frees all packets currently held in the queue and releases them + back to the free mbuf pool. + @discussion The size of the queue is cleared to zero. + @result Returns the number of packets freed. +*/ + + virtual UInt32 flush(); + +/*! @function lockFlush + @abstract Frees all packets currently held in a synchronized queue and + releases them back to the free mbuf pool. + @discussion The size of the queue is cleared to zero. A spinlock is used + to synchronize access to the queue. + @result Returns the number of packets freed. +*/ + + virtual UInt32 lockFlush(); + + // Virtual Pad functions + OSMetaClassDeclareReservedUnused( IOPacketQueue, 0); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 1); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 2); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 3); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 4); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 5); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 6); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 7); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 8); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 9); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 10); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 11); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 12); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 13); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 14); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 15); +}; + +#endif /* !_IOPACKETQUEUE_H */ diff --git a/QualcommWireless/include/IOKit/network/IOSkywalkEthernetInterface.h b/QualcommWireless/include/IOKit/network/IOSkywalkEthernetInterface.h new file mode 100644 index 0000000..6266d89 --- /dev/null +++ b/QualcommWireless/include/IOKit/network/IOSkywalkEthernetInterface.h @@ -0,0 +1,21 @@ +// +// IOSkywalkEthernetInterface.h +// IO80211Family +// +// Created by 钟先耀 on 2019/10/18. +// Copyright © 2019 钟先耀. All rights reserved. +// + +#ifndef _IOSKYWALKINTERFACE_H +#define _IOSKYWALKINTERFACE_H + +#include + +class IOSkywalkEthernetInterface : public IOEthernetController { + OSDeclareAbstractStructors( IOSkywalkEthernetInterface ) + +public: + +}; + +#endif /* _IOSKYWALKINTERFACE_H */ diff --git a/QualcommWireless/include/IOKit/nvram/IONVRAMController.h b/QualcommWireless/include/IOKit/nvram/IONVRAMController.h new file mode 100644 index 0000000..fcabedf --- /dev/null +++ b/QualcommWireless/include/IOKit/nvram/IONVRAMController.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IONVRAMCONTROLLER_H +#define _IOKIT_IONVRAMCONTROLLER_H + +#include + +class IONVRAMController : public IOService +{ + OSDeclareAbstractStructors(IONVRAMController); + +public: + virtual void registerService(IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + + virtual void sync(void); + + virtual IOReturn read(IOByteCount offset, UInt8 *buffer, + IOByteCount length) = 0; + virtual IOReturn write(IOByteCount offset, UInt8 *buffer, + IOByteCount length) = 0; +}; + +#endif /* !_IOKIT_IONVRAMCONTROLLER_H */ diff --git a/QualcommWireless/include/IOKit/pci/IOAGPDevice.h b/QualcommWireless/include/IOKit/pci/IOAGPDevice.h new file mode 100644 index 0000000..c3a7d90 --- /dev/null +++ b/QualcommWireless/include/IOKit/pci/IOAGPDevice.h @@ -0,0 +1,222 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOAGPDEVICE_H +#define _IOKIT_IOAGPDEVICE_H + +#include +#include + +/* Definitions of AGP config registers */ +enum { + kIOPCIConfigAGPStatusOffset = 4, + kIOPCIConfigAGPCommandOffset = 8 +}; + +/* Definitions of AGP Command & Status registers */ +enum { + kIOAGPRequestQueueMask = 0xff000000, + kIOAGPSideBandAddresssing = 0x00000200, + kIOAGPEnable = 0x00000100, + kIOAGP4GbAddressing = 0x00000020, + kIOAGPFastWrite = 0x00000010, + kIOAGP4xDataRate = 0x00000004, + kIOAGP2xDataRate = 0x00000002, + kIOAGP1xDataRate = 0x00000001 +}; + +enum { + kIOAGPGartInvalidate = 0x00000001 +}; + +// getAGPStatus() defines +enum { + kIOAGPDefaultStatus = 0 +}; +enum { + kIOAGPIdle = 0x00000001, + kIOAGPInvalidGARTEntry = 0x00000002, + kIOAGPAccessOutOfRange = 0x00000004 +}; + +#define kIOAGPBusFlagsKey "IOAGPFlags" +enum { + // the AGP target must be idle before invalidating its gart tlb + kIOAGPGartIdleInvalidate = 0x00000001, + + // the AGP target cannot handle operations that cross page boundaries + kIOAGPDisablePageSpans = 0x00000002, + + // the AGP target cannot handle master -> target AGP writes + kIOAGPDisableAGPWrites = 0x00000004, + + // the AGP target cannot handle target -> master PCI reads + kIOAGPDisablePCIReads = 0x00000008, + + // the AGP target cannot handle master -> target PCI writes + kIOAGPDisablePCIWrites = 0x00000010, + + // the AGP target cannot handle all unaligned transactions + kIOAGPDisableUnaligned = 0x00000020, + + kIOAGPDisableFeature6 = 0x00000040, + kIOAGPDisableFeature7 = 0x00000080, + kIOAGPDisableFeature8 = 0x00000100, + kIOAGPDisableFeature9 = 0x00000200 +}; + +// masterState +enum { + kIOAGPStateEnabled = 0x00000001, + kIOAGPStateEnablePending = 0x00010000 +}; + + +/*! @class IOAGPDevice + @abstract An IOService class representing an AGP master device. + @discussion The discovery of an AGP master device by the PCI bus family results in an instance of the IOAGPDevice being created and published. It provides services specific to AGP, in addition to the PCI services supplied by its superclass IOPCIDevice. +*/ + +class IOAGPDevice : public IOPCIDevice +{ + OSDeclareDefaultStructors(IOAGPDevice) + +protected: + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. +*/ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) +*/ + ExpansionData *reserved; + +public: + UInt32 masterState; + UInt8 masterAGPRegisters; + +/*! @function createAGPSpace + @abstract Allocates the AGP space, and enables AGP transactions on the master and slave. + @discussion This method should be called by the driver for the AGP master device to set the size of the space and enable AGP transactions. It will destroy any AGP space currently allocated. + @param options No options are currently defined, pass zero. + @param address The physical range allocated for the AGP space is passed back to the caller. + @param length An in/out parameter - the caller sets the devices maximum AGP addressing and the actual size created is passed back. + @result Returns an IOReturn code indicating success or failure. +*/ + + virtual IOReturn createAGPSpace( IOOptionBits options, + IOPhysicalAddress * address, + IOPhysicalLength * length ); + +/*! @function destroyAGPSpace + @abstract Destroys the AGP space, and disables AGP transactions on the master and slave. + @discussion This method should be called by the driver to shutdown AGP transactions and release resources. +*/ + + virtual IOReturn destroyAGPSpace( void ); + +/*! @function getAGPRangeAllocator + @abstract Accessor to obtain the AGP range allocator. + @discussion To allocate ranges in AGP space, obtain a range allocator for the space with this method. It is retained while the space is created (until destroyAGPSpace is called) and should not be released by the caller. + @result Returns a pointer to the range allocator for the AGP space. +*/ + + virtual IORangeAllocator * getAGPRangeAllocator( void ); + +/*! @function getAGPStatus + @abstract Returns the current state of the AGP bus. + @discussion Returns state bits for the AGP bus. Only one type of status is currently defined. + @param which Type of status - only kIOAGPDefaultStatus is currently valid. + @result Returns mask of status bits for the AGP bus. +*/ + + virtual IOOptionBits getAGPStatus( IOOptionBits which = kIOAGPDefaultStatus ); + +/*! @function commitAGPMemory + @abstract Makes memory addressable by AGP transactions. + @discussion Makes the memory described by the IOMemoryDescriptor object addressable by AGP by entering its pages into the GART array, given an offset into AGP space supplied by the caller (usually allocated by the AGP range allocator). It is the caller's responsibility to prepare non-kernel pageable memory before calling this method, with IOMemoryDescriptor::prepare. + @param memory A IOMemoryDescriptor object describing the memory to add to the GART. + @param agpOffset An offset into AGP space that the caller has allocated - usually allocated by the AGP range allocator. + @param options Pass kIOAGPGartInvalidate if the AGP target should invalidate any GART TLB. + @result Returns an IOReturn code indicating success or failure. +*/ + + virtual IOReturn commitAGPMemory( IOMemoryDescriptor * memory, + IOByteCount agpOffset, + IOOptionBits options = 0 ); + +/*! @function releaseAGPMemory + @abstract Releases memory addressable by AGP transactions. + @discussion Makes the memory described by the IOMemoryDescriptor object unaddressable by AGP by removing its pages from the GART array, given an offset into AGP space supplied by the caller (usually allocated by the AGP range allocator). It is the caller's responsibility to complete non-kernel pageable memory before calling this method, with IOMemoryDescriptor::complete. + @param memory A IOMemoryDescriptor object describing the memory to remove from the GART. + @param agpOffset An offset into AGP space that the caller has allocated - usually allocated by the AGP range allocator. + @param options Pass kIOAGPGartInvalidate if the AGP target should invalidate any GART TLB. + @result Returns an IOReturn code indicating success or failure. +*/ + + virtual IOReturn releaseAGPMemory( IOMemoryDescriptor * memory, + IOByteCount agpOffset, + IOOptionBits options = 0 ); + + virtual IOReturn resetAGP( IOOptionBits options = 0 ); + +/*! @function getAGPSpace + @abstract Returns the allocated AGP space. + @discussion This method can be called by the driver for the AGP master device to retrieve the physical address and size of the space created with createAGPSpace. + @param address The physical range allocated for the AGP space is passed back to the caller. Zero may be passed if the address is not needed by the caller. + @param length The size of the the AGP space created is passed back. Zero may be passed if the length is not needed by the caller. + @result Returns an IOReturn code indicating success or failure. +*/ + + virtual IOReturn getAGPSpace( IOPhysicalAddress * address, + IOPhysicalLength * length ); + + // Unused Padding + OSMetaClassDeclareReservedUnused(IOAGPDevice, 0); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 1); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 2); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 3); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 4); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 5); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 6); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 7); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 8); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 9); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 10); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 11); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 12); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 13); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 14); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 15); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 16); +}; + +#endif /* ! _IOKIT_IOAGPDEVICE_H */ diff --git a/QualcommWireless/include/IOKit/pci/IOPCIBridge.h b/QualcommWireless/include/IOKit/pci/IOPCIBridge.h new file mode 100644 index 0000000..e4aa04e --- /dev/null +++ b/QualcommWireless/include/IOKit/pci/IOPCIBridge.h @@ -0,0 +1,526 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOPCIBRIDGE_H +#define _IOKIT_IOPCIBRIDGE_H + +#include +#include +#include +#include +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +class IOPCIConfigurator; +class IOPCIDevice; +class IOPCIMessagedInterruptController; + +enum { + kIOPCIResourceTypeMemory = 0, + kIOPCIResourceTypePrefetchMemory = 1, + kIOPCIResourceTypeIO = 2, + kIOPCIResourceTypeBusNumber = 3, + kIOPCIResourceTypeCount = 4, +}; + +/*! + @class IOPCIBridge + @abstract Base class for all PCI bridge drivers. +*/ + +class IOPCIBridge : public IOService +{ + friend class IOPCIDevice; + friend class IOPCI2PCIBridge; + friend class IOPCIConfigurator; + + OSDeclareAbstractStructors(IOPCIBridge) + +private: + static void initialize(void); + IORegistryEntry * findMatching( OSIterator * in, IOPCIAddressSpace space ); + virtual bool isDTNub( IOPCIDevice * nub ); + bool checkProperties( IOPCIDevice * entry ); + + void removeDevice( IOPCIDevice * device, IOOptionBits options = 0 ); + + void restoreQEnter(IOPCIDevice * device); + void restoreQRemove(IOPCIDevice * device); + + IOReturn restoreTunnelState(IOPCIDevice * rootDevice, IOOptionBits options, + bool * didTunnelController); + IOReturn restoreMachineState( IOOptionBits options, IOPCIDevice * device ); + void tunnelsWait(IOPCIDevice * device); + static IOReturn finishMachineState(IOOptionBits options); + static IOReturn systemPowerChange(void * target, void * refCon, + UInt32 messageType, IOService * service, + void * messageArgument, vm_size_t argSize); + + IOReturn _restoreDeviceState( IOPCIDevice * device, IOOptionBits options ); + IOReturn _restoreDeviceDependents(IOPCIDevice * device, IOOptionBits options, IOPCIDevice * forDependent); + IOReturn resolveLegacyInterrupts( IOService * provider, IOPCIDevice * nub ); + IOReturn resolveMSIInterrupts ( IOService * provider, IOPCIDevice * nub ); + + IOReturn relocate(IOPCIDevice * device, uint32_t options); + void spaceFromProperties( IORegistryEntry * regEntry, + IOPCIAddressSpace * space ); + void updateWakeReason(IOPCIDevice * device); + +protected: +#if !defined(__arm64__) + static SInt32 compareAddressCell( UInt32 cellCount, UInt32 cleft[], UInt32 cright[] ); +#else + static SInt64 compareAddressCell( UInt32 cellCount, UInt32 cleft[], UInt32 cright[] ); +#endif + IOReturn setDeviceASPMBits(IOPCIDevice * device, uint32_t bits); + IOReturn setDeviceL1PMBits(IOPCIDevice * device, uint32_t bits); + IOReturn setDeviceCLKREQBits(IOPCIDevice * device, uint32_t bits); + + IOReturn setDevicePowerState(IOPCIDevice * device, IOOptionBits options, + unsigned long prevState, unsigned long newState); + static IOReturn configOp(IOService * device, uintptr_t op, void * result, void * arg = 0); + static void deferredProbe(IOPCIDevice * device); + + void * __reserved1; + void * __reserved2; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOPCIBridge in the future. +*/ + struct ExpansionData + { + struct IOPCIRange * rangeLists[kIOPCIResourceTypeCount]; + IOPCIMessagedInterruptController *messagedInterruptController; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) +*/ +private: + ExpansionData *reserved; + +protected: + IOWorkLoop * getConfiguratorWorkLoop(void) const; + +public: + static IOPCIEventSource * createEventSource( + OSObject * owner, IOPCIEventSource::Action action, uint32_t options); + +public: + virtual void probeBus( IOService * provider, UInt8 busNum ); + + virtual UInt8 firstBusNum( void ); + virtual UInt8 lastBusNum( void ); + + virtual void spaceFromProperties( OSDictionary * propTable, + IOPCIAddressSpace * space ); + virtual OSDictionary * constructProperties( IOPCIAddressSpace space ); + + virtual IOPCIDevice * createNub( OSDictionary * from ); + + virtual bool initializeNub( IOPCIDevice * nub, OSDictionary * from ); + + virtual bool publishNub( IOPCIDevice * nub, UInt32 index ); + + virtual bool addBridgeMemoryRange( IOPhysicalAddress start, + IOPhysicalLength length, bool host ); + + virtual bool addBridgeIORange( IOByteCount start, IOByteCount length ); + + +private: + virtual bool constructRange( IOPCIAddressSpace * flags, + IOPhysicalAddress64 phys, IOPhysicalLength64 len, + OSArray * array ); + + virtual bool matchNubWithPropertyTable( IOService * nub, + OSDictionary * propertyTable, + SInt32 * score ); + + virtual bool compareNubName( const IOService * nub, OSString * name, + OSString ** matched = 0 ) const; + + virtual bool pciMatchNub( IOPCIDevice * nub, + OSDictionary * table, SInt32 * score); + + virtual bool matchKeys( IOPCIDevice * nub, const char * keys, + UInt32 defaultMask, UInt8 regNum ); + + virtual IOReturn getNubResources( IOService * nub ); + + virtual IOReturn getNubAddressing( IOPCIDevice * nub ); + + virtual IOReturn getDTNubAddressing( IOPCIDevice * nub ); + +public: + virtual void free( void ) APPLE_KEXT_OVERRIDE; + + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_5 + virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE; +#endif + + virtual bool configure( IOService * provider ); + + virtual IOReturn setProperties(OSObject * properties) APPLE_KEXT_OVERRIDE; + + virtual IOReturn newUserClient(task_t owningTask, void * securityID, + UInt32 type, OSDictionary * properties, + IOUserClient ** handler) APPLE_KEXT_OVERRIDE; + + virtual unsigned long maxCapabilityForDomainState ( IOPMPowerFlags domainState ) APPLE_KEXT_OVERRIDE; + virtual unsigned long initialPowerStateForDomainState ( IOPMPowerFlags domainState ) APPLE_KEXT_OVERRIDE; + virtual unsigned long powerStateForDomainState ( IOPMPowerFlags domainState ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn callPlatformFunction(const OSSymbol * functionName, + bool waitForFunction, + void * param1, void * param2, + void * param3, void * param4) APPLE_KEXT_OVERRIDE; + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + virtual IODeviceMemory * ioDeviceMemory( void ) = 0; + + virtual UInt32 configRead32( IOPCIAddressSpace space, UInt8 offset ) = 0; + virtual void configWrite32( IOPCIAddressSpace space, + UInt8 offset, UInt32 data ) = 0; + virtual UInt16 configRead16( IOPCIAddressSpace space, UInt8 offset ) = 0; + virtual void configWrite16( IOPCIAddressSpace space, + UInt8 offset, UInt16 data ) = 0; + virtual UInt8 configRead8( IOPCIAddressSpace space, UInt8 offset ) = 0; + virtual void configWrite8( IOPCIAddressSpace space, + UInt8 offset, UInt8 data ) = 0; + + virtual IOPCIAddressSpace getBridgeSpace( void ) = 0; + + virtual UInt32 findPCICapability( IOPCIAddressSpace space, + UInt8 capabilityID, UInt8 * offset = 0 ); + + virtual IOReturn setPowerState(unsigned long powerStateOrdinal, + IOService * whatDevice) APPLE_KEXT_OVERRIDE; + virtual IOReturn setDevicePowerState( IOPCIDevice * device, + unsigned long whatToDo ); + virtual IOReturn saveDeviceState( IOPCIDevice * device, + IOOptionBits options = 0 ); + virtual IOReturn restoreDeviceState( IOPCIDevice * device, + IOOptionBits options = 0 ); + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + virtual IOReturn createAGPSpace( IOAGPDevice * master, + IOOptionBits options, + IOPhysicalAddress * address, + IOPhysicalLength * length ); + + virtual IOReturn destroyAGPSpace( IOAGPDevice * master ); + + virtual IORangeAllocator * getAGPRangeAllocator( IOAGPDevice * master ); + + virtual IOOptionBits getAGPStatus( IOAGPDevice * master, + IOOptionBits options = 0 ); + virtual IOReturn resetAGPDevice( IOAGPDevice * master, + IOOptionBits options = 0 ); + + virtual IOReturn getAGPSpace( IOAGPDevice * master, + IOPhysicalAddress * address, + IOPhysicalLength * length ); + + virtual IOReturn commitAGPMemory( IOAGPDevice * master, + IOMemoryDescriptor * memory, + IOByteCount agpOffset, + IOOptionBits options ); + + virtual IOReturn releaseAGPMemory( IOAGPDevice * master, + IOMemoryDescriptor * memory, + IOByteCount agpOffset, + IOOptionBits options ); + +protected: + OSMetaClassDeclareReservedUsed(IOPCIBridge, 0); +private: + virtual bool addBridgePrefetchableMemoryRange( IOPhysicalAddress start, + IOPhysicalLength length, + bool host ); +protected: + bool addBridgePrefetchableMemoryRange( addr64_t start, addr64_t length ); + IOReturn kernelRequestProbe(IOPCIDevice * device, uint32_t options); + IOReturn protectDevice(IOPCIDevice * device, uint32_t space, uint32_t prot); + + OSMetaClassDeclareReservedUsed(IOPCIBridge, 1); + virtual UInt32 extendedFindPCICapability( IOPCIAddressSpace space, + UInt32 capabilityID, IOByteCount * offset = 0 ); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 + OSMetaClassDeclareReservedUsed(IOPCIBridge, 2); + virtual IOReturn setDeviceASPMState(IOPCIDevice * device, + IOService * client, IOOptionBits state); +#else + OSMetaClassDeclareReservedUnused(IOPCIBridge, 2); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_7 + OSMetaClassDeclareReservedUsed(IOPCIBridge, 3); + virtual IOReturn checkLink(uint32_t options = 0); +#else + OSMetaClassDeclareReservedUnused(IOPCIBridge, 3); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 + OSMetaClassDeclareReservedUsed(IOPCIBridge, 4); + virtual IOReturn enableLTR(IOPCIDevice * device, bool enable); + + OSMetaClassDeclareReservedUsed(IOPCIBridge, 5); + virtual IOPCIEventSource * createEventSource(IOPCIDevice * device, + OSObject * owner, IOPCIEventSource::Action action, uint32_t options); +#else + OSMetaClassDeclareReservedUnused(IOPCIBridge, 4); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 5); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_12_0 + OSMetaClassDeclareReservedUsed(IOPCIBridge, 6); + virtual UInt32 extendedFindPCICapability(struct IOPCIConfigEntry * entry, + UInt32 capabilityID, + IOByteCount * offset = NULL); +public: + virtual bool init( OSDictionary * propTable ); +#else + OSMetaClassDeclareReservedUnused(IOPCIBridge, 6); +#endif + + // Unused Padding + OSMetaClassDeclareReservedUnused(IOPCIBridge, 7); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 8); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 9); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 10); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 11); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 12); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 13); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 14); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 15); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 16); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 17); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 18); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 19); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 20); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 21); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 22); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 23); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 24); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 25); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 26); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 27); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 28); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 29); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 30); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 31); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +class IOPCI2PCIBridge : public IOPCIBridge +{ + friend class IOPCIEventSource; + friend class IOPCIDevice; + + OSDeclareDefaultStructors(IOPCI2PCIBridge) + +protected: + IOFilterInterruptEventSource * fBridgeInterruptSource; + +private: + IOPCIDevice * fBridgeDevice; + IOTimerEventSource * fTimerProbeES; + IOWorkLoop * fWorkLoop; + IOPMDriverAssertionID fPMAssertion; + IOSimpleLock * fISRLock; + struct IOPCIAERRoot * fAERRoot; + uint32_t __resvA[6]; + int32_t fTunnelL1EnableCount; + uint32_t fHotplugCount; + + uint8_t _resvA[3]; + uint8_t fHotPlugInts; + uint8_t fIntsPending; + uint8_t fIsAERRoot; + + uint8_t fPresence; + uint8_t fWaitingLinkEnable; + uint8_t fLinkChangeOnly; + uint8_t fBridgeInterruptEnablePending; + uint8_t fNeedProbe; + uint8_t fPresenceInt; + uint8_t fBridgeMSI; + uint8_t fNoDevice; + uint8_t fLinkControlWithPM; + uint8_t fPowerState; + char fLogName[32]; +; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData {}; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +public: + + virtual UInt8 firstBusNum( void ) APPLE_KEXT_OVERRIDE; + virtual UInt8 lastBusNum( void ) APPLE_KEXT_OVERRIDE; + +public: + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual bool serializeProperties( OSSerialize * serialize ) const APPLE_KEXT_OVERRIDE; + + virtual IOService * probe( IOService * provider, + SInt32 * score ) APPLE_KEXT_OVERRIDE; + + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual bool configure( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual void probeBus( IOService * provider, UInt8 busNum ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn requestProbe( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_5 + virtual void systemWillShutdown(IOOptionBits specifier) APPLE_KEXT_OVERRIDE; +#endif + + virtual void saveBridgeState( void ); + + virtual void restoreBridgeState( void ); + + IOReturn setPowerState( unsigned long powerState, + IOService * whatDevice ) APPLE_KEXT_OVERRIDE; + + void adjustPowerState(unsigned long state); + + virtual IOReturn saveDeviceState( IOPCIDevice * device, + IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; + + virtual bool publishNub( IOPCIDevice * nub, UInt32 index ) APPLE_KEXT_OVERRIDE; + + virtual IODeviceMemory * ioDeviceMemory( void ) APPLE_KEXT_OVERRIDE; + + virtual IOPCIAddressSpace getBridgeSpace( void ) APPLE_KEXT_OVERRIDE; + + virtual UInt32 configRead32( IOPCIAddressSpace space, UInt8 offset ) APPLE_KEXT_OVERRIDE; + virtual void configWrite32( IOPCIAddressSpace space, + UInt8 offset, UInt32 data ) APPLE_KEXT_OVERRIDE; + virtual UInt16 configRead16( IOPCIAddressSpace space, UInt8 offset ) APPLE_KEXT_OVERRIDE; + virtual void configWrite16( IOPCIAddressSpace space, + UInt8 offset, UInt16 data ) APPLE_KEXT_OVERRIDE; + virtual UInt8 configRead8( IOPCIAddressSpace space, UInt8 offset ) APPLE_KEXT_OVERRIDE; + virtual void configWrite8( IOPCIAddressSpace space, + UInt8 offset, UInt8 data ) APPLE_KEXT_OVERRIDE; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 + virtual IOReturn setDeviceASPMState(IOPCIDevice * device, + IOService * client, IOOptionBits state) APPLE_KEXT_OVERRIDE; +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_7 + virtual IOReturn checkLink(uint32_t options = 0) APPLE_KEXT_OVERRIDE; +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 + virtual IOReturn enableLTR(IOPCIDevice * device, bool enable) APPLE_KEXT_OVERRIDE; + + virtual IOPCIEventSource * createEventSource(IOPCIDevice * device, + OSObject * owner, IOPCIEventSource::Action action, uint32_t options) APPLE_KEXT_OVERRIDE; +#endif + + // Unused Padding + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 0); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 1); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 2); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 3); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 4); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 5); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 6); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 7); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 8); + +protected: + void allocateBridgeInterrupts(IOService * provider); + void startBridgeInterrupts(IOService * provider); + void enableBridgeInterrupts(void); + void disableBridgeInterrupts(void); + +private: + IOReturn setTunnelL1Enable(IOPCIDevice * device, IOService * client, + bool l1Enable); + +public: + void startBootDefer(IOService * provider); + + bool filterInterrupt( IOFilterInterruptEventSource * source); + + void handleInterrupt( IOInterruptEventSource * source, + int count ); + void timerProbe(IOTimerEventSource * es); +}; + +#define kIOPCI2PCIBridgeName "IOPP" + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_12_0 +class IOPCIHostBridge : public IOPCIBridge +{ + OSDeclareDefaultStructors(IOPCIHostBridge); +public: + virtual void free(void) APPLE_KEXT_OVERRIDE; + + virtual IOService *probe(IOService * provider, SInt32 *score) APPLE_KEXT_OVERRIDE; + virtual bool configure(IOService * provider) APPLE_KEXT_OVERRIDE; + + // Host bridge data is shared, when bridges have shared resources, i.e. PCIe config space (legacy systems). + // They must be unique, if bridge has no resources to share (Apple Silicone). + IOService *bridgeData; + + // IOPCIFamily 726 (macOS Tahoe) extends the private host bridge layout. + // Keep subclass storage beyond fields written by the runtime superclass. + uint32_t _domainId; +private: + IONotifier *_publishNotifier; +}; +#endif + +#endif /* ! _IOKIT_IOPCIBRIDGE_H */ diff --git a/QualcommWireless/include/IOKit/pci/IOPCIDevice.h b/QualcommWireless/include/IOKit/pci/IOPCIDevice.h new file mode 100644 index 0000000..20b3d8a --- /dev/null +++ b/QualcommWireless/include/IOKit/pci/IOPCIDevice.h @@ -0,0 +1,813 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IOPCIDEVICE_H +#define _IOKIT_IOPCIDEVICE_H + +#include +#include + +#if TARGET_OS_OSX +#include +#endif + +/* Definitions of PCI Config Registers */ +enum { + kIOPCIConfigVendorID = kIOPCIConfigurationOffsetVendorID, + kIOPCIConfigDeviceID = kIOPCIConfigurationOffsetDeviceID, + kIOPCIConfigCommand = kIOPCIConfigurationOffsetCommand, + kIOPCIConfigStatus = kIOPCIConfigurationOffsetStatus, + kIOPCIConfigRevisionID = kIOPCIConfigurationOffsetRevisionID, + kIOPCIConfigClassCode = kIOPCIConfigurationOffsetClassCode, + kIOPCIConfigCacheLineSize = kIOPCIConfigurationOffsetCacheLineSize, + kIOPCIConfigLatencyTimer = kIOPCIConfigurationOffsetLatencyTimer, + kIOPCIConfigHeaderType = kIOPCIConfigurationOffsetHeaderType, + kIOPCIConfigBIST = kIOPCIConfigurationOffsetBIST, + kIOPCIConfigBaseAddress0 = kIOPCIConfigurationOffsetBaseAddress0, + kIOPCIConfigBaseAddress1 = kIOPCIConfigurationOffsetBaseAddress1, + kIOPCIConfigBaseAddress2 = kIOPCIConfigurationOffsetBaseAddress2, + kIOPCIConfigBaseAddress3 = kIOPCIConfigurationOffsetBaseAddress3, + kIOPCIConfigBaseAddress4 = kIOPCIConfigurationOffsetBaseAddress4, + kIOPCIConfigBaseAddress5 = kIOPCIConfigurationOffsetBaseAddress5, + kIOPCIConfigCardBusCISPtr = kIOPCIConfigurationOffsetCardBusCISPtr, + kIOPCIConfigSubSystemVendorID = kIOPCIConfigurationOffsetSubSystemVendorID, + kIOPCIConfigSubSystemID = kIOPCIConfigurationOffsetSubSystemID, + kIOPCIConfigExpansionROMBase = kIOPCIConfigurationOffsetExpansionROMBase, + kIOPCIConfigCapabilitiesPtr = kIOPCIConfigurationOffsetCapabilitiesPtr, + kIOPCIConfigInterruptLine = kIOPCIConfigurationOffsetInterruptLine, + kIOPCIConfigInterruptPin = kIOPCIConfigurationOffsetInterruptPin, + kIOPCIConfigMinimumGrant = kIOPCIConfigurationOffsetMinimumGrant, + kIOPCIConfigMaximumLatency = kIOPCIConfigurationOffsetMaximumLatency +}; + +/* Definitions of Capabilities PCI Config Register */ +enum { + kIOPCIPowerManagementCapability = kIOPCICapabilityIDPowerManagement, + kIOPCIAGPCapability = kIOPCICapabilityIDAGP, + kIOPCIVitalProductDataCapability = kIOPCICapabilityIDVitalProductData, + kIOPCISlotIDCapability = kIOPCICapabilityIDSlotID, + kIOPCIMSICapability = kIOPCICapabilityIDMSI, + kIOPCICPCIHotswapCapability = kIOPCICapabilityIDCPCIHotswap, + kIOPCIPCIXCapability = kIOPCICapabilityIDPCIX, + kIOPCILDTCapability = kIOPCICapabilityIDLDT, + kIOPCIVendorSpecificCapability = kIOPCICapabilityIDVendorSpecific, + kIOPCIDebugPortCapability = kIOPCICapabilityIDDebugPort, + kIOPCICPCIResourceControlCapability = kIOPCICapabilityIDCPCIResourceControl, + kIOPCIHotplugCapability = kIOPCICapabilityIDHotplug, + kIOPCIAGP8Capability = kIOPCICapabilityIDAGP8, + kIOPCISecureCapability = kIOPCICapabilityIDSecure, + kIOPCIPCIExpressCapability = kIOPCICapabilityIDPCIExpress, + kIOPCIMSIXCapability = kIOPCICapabilityIDMSIX, + kIOPCIFPBCapability = kIOPCICapabilityIDFPB, + + kIOPCIExpressErrorReportingCapability = kIOPCIExpressCapabilityIDErrorReporting, + kIOPCIExpressVirtualChannelCapability = kIOPCIExpressCapabilityIDVirtualChannel, + kIOPCIExpressDeviceSerialNumberCapability = kIOPCIExpressCapabilityIDDeviceSerialNumber, + kIOPCIExpressPowerBudgetCapability = kIOPCIExpressCapabilityIDPowerBudget, + kIOPCIExpressAccessControlServicesCapability = kIOPCIExpressCapabilityIDAccessControlServices, + kIOPCIExpressLatencyTolerenceReportingCapability = kIOPCIExpressCapabilityIDLatencyTolerenceReporting, + kIOPCIExpressL1PMSubstatesCapability = kIOPCIExpressCapabilityIDL1PMSubstates, +}; + +/* Space definitions */ +enum { + kIOPCIConfigSpace = 0, + kIOPCIIOSpace = 1, + kIOPCI32BitMemorySpace = 2, + kIOPCI64BitMemorySpace = 3 +}; + +enum { + kPCI2PCIPrimaryBus = 0x18, + kPCI2PCISecondaryBus = 0x19, + kPCI2PCISubordinateBus = 0x1a, + kPCI2PCISecondaryLT = 0x1b, + kPCI2PCIIORange = 0x1c, + kPCI2PCIMemoryRange = 0x20, + kPCI2PCIPrefetchMemoryRange = 0x24, + kPCI2PCIPrefetchUpperBase = 0x28, + kPCI2PCIPrefetchUpperLimit = 0x2c, + kPCI2PCIUpperIORange = 0x30, + kPCI2PCIBridgeControl = 0x3e +}; + +#define IOPCIPMCSPMEDISABLEINS3_DEFINED 1 +#define IOPCIPMCSPMEWAKEREASON_DEFINED 1 + +union IOPCIAddressSpace { + UInt32 bits; + struct { +#if __BIG_ENDIAN__ + unsigned int reloc:1; + unsigned int prefetch:1; + unsigned int t:1; + unsigned int resv:3; + unsigned int space:2; + unsigned int busNum:8; + unsigned int deviceNum:5; + unsigned int functionNum:3; + unsigned int registerNum:8; +#elif __LITTLE_ENDIAN__ + unsigned int registerNum:8; + unsigned int functionNum:3; + unsigned int deviceNum:5; + unsigned int busNum:8; + unsigned int space:2; + unsigned int resv:3; + unsigned int t:1; + unsigned int prefetch:1; + unsigned int reloc:1; +#endif + } s; + struct { +#if __BIG_ENDIAN__ + unsigned int resv:4; + unsigned int registerNumExtended:4; + unsigned int busNum:8; + unsigned int deviceNum:5; + unsigned int functionNum:3; + unsigned int registerNum:8; +#elif __LITTLE_ENDIAN__ + unsigned int registerNum:8; + unsigned int functionNum:3; + unsigned int deviceNum:5; + unsigned int busNum:8; + unsigned int registerNumExtended:4; + unsigned int resv:4; +#endif + } es; +}; +typedef union IOPCIAddressSpace IOPCIAddressSpace; + +struct IOPCIPhysicalAddress { + IOPCIAddressSpace physHi; +#if defined(__i386__) || defined(__x86_64__) + UInt32 physMid; + UInt32 physLo; + UInt32 lengthHi; + UInt32 lengthLo; +#else + UInt32 physLo; + UInt32 physMid; + UInt32 lengthLo; + UInt32 lengthHi; +#endif +}; + +// IOPCIDevice matching property names +#define kIOPCITunnelCompatibleKey "IOPCITunnelCompatible" +#define kIOPCITunnelledKey "IOPCITunnelled" +#define kIOPCITunnelL1EnableKey "IOPCITunnelL1Enable" + +#define kIOPCIPauseCompatibleKey "IOPCIPauseCompatible" + +// property to control PCI default config space save on sleep +#define kIOPMPCIConfigSpaceVolatileKey "IOPMPCIConfigSpaceVolatile" +// property to disable express link on sleep +#define kIOPMPCISleepLinkDisableKey "IOPMPCISleepLinkDisable" +// property to reset secondary bus on sleep +#define kIOPMPCISleepResetKey "IOPMPCISleepReset" + +#ifndef kIOPlatformDeviceASPMEnableKey +#define kIOPlatformDeviceASPMEnableKey "IOPlatformDeviceASPMEnable" +#endif + +#ifndef kIOPCIDeviceASPMSupportedKey +#define kIOPCIDeviceASPMSupportedKey "pci-aspm-supported" +#endif + +#define kIOPCIPMEOptionsKey "IOPCIPMEOptions" + +#define kIOPCITunnelIDKey "IOPCITunnelID" +#define kIOPCITunnelControllerIDKey "IOPCITunnelControllerID" + +#define kIOPCIBridgeInterruptESKey "IOPCIBridgeInterruptES" + +#define kIOPCIDeviceDeviceTreeEntryKey "IOPCIDeviceDeviceTreeEntry" + +enum { + kIOPCIDevicePowerStateCount = 4, + kIOPCIDeviceOffState = 0, + kIOPCIDeviceDozeState = 1, + kIOPCIDeviceOnState = 2, + kIOPCIDevicePausedState = 3, +}; + +enum +{ + // bits getInterruptType result + kIOInterruptTypePCIMessaged = 0x00010000 +}; + +// setLatencyTolerance options +enum +{ + kIOPCILatencySnooped = 0x00000001, + kIOPCILatencyUnsnooped = 0x00000002, +}; + +enum +{ + kIOPCIProbeOptionDone = 0x80000000, + + kIOPCIProbeOptionEject = 0x00100000, + kIOPCIProbeOptionNeedsScan = 0x00200000, +}; + + +// saveDeviceState options +enum +{ + kIOPCIConfigShadowPermanent = 0x80000000, +}; + +#if defined(KERNEL) + +#include +#include + +class IOPCIDevice; +class IOPCIBridge; +class IOPCI2PCIBridge; +class IOPCIMessagedInterruptController; +class IOPCIConfigurator; +class IOPCIEventSource; + +// IOPCIEvent.event +enum +{ + kIOPCIEventCorrectableError = 1, + kIOPCIEventNonFatalError = 2, + kIOPCIEventFatalError = 3, + kIOPCIEventLinkEnableChange = 4, +}; + + +struct IOPCIEvent +{ + IOPCIDevice * reporter; + uint32_t event; + uint32_t data[5]; +}; + +class IOPCIEventSource : public IOEventSource +{ + friend class IOPCIBridge; + friend class IOPCI2PCIBridge; + + OSDeclareDefaultStructors(IOPCIEventSource); +public: + typedef void (*Action)(OSObject * owner, IOPCIEventSource * es, + const IOPCIEvent * event ); +#define IOPCIEventAction IOPCIEventSource::Action + +private: + queue_chain_t fQ; + IOPCI2PCIBridge * fRoot; + IOPCIDevice * fDevice; + uint8_t fReadIndex; + uint8_t fWriteIndex; + IOPCIEvent * fEvents; + +public: + virtual void enable( void ) APPLE_KEXT_OVERRIDE; + virtual void disable( void ) APPLE_KEXT_OVERRIDE; + +protected: + virtual void free( void ) APPLE_KEXT_OVERRIDE; + virtual bool checkForWork( void ) APPLE_KEXT_OVERRIDE; +}; + + +typedef IOReturn (*IOPCIDeviceConfigHandler)(void * ref, + IOMessage message, IOPCIDevice * device, uint32_t state); + +/*! @class IOPCIDevice : public IOService + @abstract An IOService class representing a PCI device. + @discussion The discovery of a PCI device by the PCI bus family results in an instance of the IOPCIDevice being created and published. It provides services for looking up and mapping memory mapped hardware, and access to the PCI configuration and I/O spaces. + +

Matching Supported by IOPCIDevice

+ +Two types of matching are available, OpenFirmware name matching and PCI register matching. Currently, only one of these two matching schemes can be used in the same property table. + +

OpenFirmware Name Matching

+ +IOService performs matching based on the IONameMatch property (see IOService). IOPCIDevices created with OpenFirmware device tree entries will name match based on the standard OpenFirmware name matching properties. + +

PCI Register Matching

+ +A PCI device driver can also match on the values of certain config space registers. + +In each case, several matching values can be specified, and an optional mask for the value of the config space register may follow the value, preceded by an '&' character. +
+
+ kIOPCIMatchKey, "IOPCIMatch" +
+The kIOPCIMatchKey property matches the vendor and device ID (0x00) register, or the subsystem register (0x2c). +
+
+ kIOPCIPrimaryMatchKey, "IOPCIPrimaryMatch" +
+The kIOPCIPrimaryMatchKey property matches the vendor and device ID (0x00) register. +
+
+ kIOPCISecondaryMatchKey, "IOPCISecondaryMatch" +
+The kIOPCISecondaryMatchKey property matches the subsystem register (0x2c). +
+
+ kIOPCIClassMatchKey, "IOPCIClassMatch" +
+The kIOPCIClassMatchKey property matches the class code register (0x08). The default mask for this register is 0xffffff00. +
+
+Examples: +
+
+ <key>IOPCIMatch</key>
+ <string>0x00261011</string> +
+Matches a device whose vendor ID is 0x1011, and device ID is 0x0026, including subsystem IDs. +
+
+ <key>IOPCIMatch</key>
+ <string>0x00789004&0x00ffffff 0x78009004&0x0xff00ffff</string> +
+Matches with any device with a vendor ID of 0x9004, and a device ID of 0xzz78 or 0x78zz, where 'z' is don't care. +
+
+ <key>IOPCIClassMatch</key>
+ <string>0x02000000&0xffff0000</string> +
+
+Matches a device whose class code is 0x0200zz, an ethernet device. + +*/ + +class IOPCIDevice : public IOService +{ +#if TARGET_OS_OSX + OSDeclareDefaultStructorsWithDispatch(IOPCIDevice) +#else + OSDeclareDefaultStructors(IOPCIDevice) +#endif + + friend class IOPCIBridge; + friend class IOPCI2PCIBridge; + friend class IOPCIMessagedInterruptController; + friend class IOPCIConfigurator; + +protected: + IOPCIBridge * parent; + IOMemoryMap * ioMap; + OSObject * slotNameProperty; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + struct IOPCIDeviceExpansionData * reserved; + +public: + IOPCIAddressSpace space; + UInt32 * savedConfig; + +public: + /* IOService/IORegistryEntry methods */ + + virtual bool init( OSDictionary * propTable ) APPLE_KEXT_OVERRIDE; + virtual bool init( IORegistryEntry * from, + const IORegistryPlane * inPlane ) APPLE_KEXT_OVERRIDE; + virtual void free( void ) APPLE_KEXT_OVERRIDE; + virtual bool attach( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void detach( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void detachAbove(const IORegistryPlane *) APPLE_KEXT_OVERRIDE; + + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, OSDictionary * properties, + IOUserClient ** handler ) APPLE_KEXT_OVERRIDE; + + virtual bool handleOpen(IOService * forClient, IOOptionBits options, void * arg) APPLE_KEXT_OVERRIDE; + virtual void handleClose(IOService * forClient, IOOptionBits options) APPLE_KEXT_OVERRIDE; + + virtual IOReturn requestProbe( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn powerStateWillChangeTo (IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService* whatDevice) APPLE_KEXT_OVERRIDE; + virtual IOReturn setPowerState( unsigned long, IOService * ) APPLE_KEXT_OVERRIDE; + + virtual unsigned long maxCapabilityForDomainState ( IOPMPowerFlags domainState ) APPLE_KEXT_OVERRIDE; + virtual unsigned long initialPowerStateForDomainState ( IOPMPowerFlags domainState ) APPLE_KEXT_OVERRIDE; + virtual unsigned long powerStateForDomainState ( IOPMPowerFlags domainState ) APPLE_KEXT_OVERRIDE; + + virtual bool compareName( OSString * name, OSString ** matched = 0 ) const APPLE_KEXT_OVERRIDE; + virtual bool matchPropertyTable(OSDictionary * table) APPLE_KEXT_OVERRIDE; + virtual bool matchPropertyTable( OSDictionary * table, + SInt32 * score ) APPLE_KEXT_OVERRIDE; + virtual IOService * matchLocation( IOService * client ) APPLE_KEXT_OVERRIDE; + virtual IOReturn getResources( void ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setProperties(OSObject * properties) APPLE_KEXT_OVERRIDE; + virtual IOReturn callPlatformFunction(const OSSymbol * functionName, + bool waitForFunction, + void * p1, void * p2, + void * p3, void * p4) APPLE_KEXT_OVERRIDE; + virtual IOReturn callPlatformFunction(const char * functionName, + bool waitForFunction, + void * p1, void * p2, + void * p3, void * p4) APPLE_KEXT_OVERRIDE; + virtual IODeviceMemory * getDeviceMemoryWithIndex(unsigned int index) APPLE_KEXT_OVERRIDE; + +private: + bool configAccess(bool write); + bool initReserved(void); + IOReturn setPCIPowerState(uint8_t powerState, uint32_t options); + void updateWakeReason(uint16_t pmeState); + IOReturn enableLTR(IOPCIDevice * device, bool enable); + IOReturn enableACS(IOPCIDevice * device, bool enable); + +public: + + /* Config space accessors */ + + virtual UInt32 configRead32( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite32( IOPCIAddressSpace space, + UInt8 offset, UInt32 data ); + virtual UInt16 configRead16( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite16( IOPCIAddressSpace space, + UInt8 offset, UInt16 data ); + virtual UInt8 configRead8( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite8( IOPCIAddressSpace space, + UInt8 offset, UInt8 data ); + +#if __IOPCIDEVICE_INTERNAL__ + +#if APPLE_KEXT_VTABLE_PADDING + virtual UInt32 configRead32( UInt8 offset ); + virtual UInt16 configRead16( UInt8 offset ); + virtual UInt8 configRead8( UInt8 offset ); + virtual void configWrite32( UInt8 offset, UInt32 data ); + virtual void configWrite16( UInt8 offset, UInt16 data ); + virtual void configWrite8( UInt8 offset, UInt8 data ); +#endif /* APPLE_KEXT_VTABLE_PADDING */ + +#else /* !__IOPCIDEVICE_INTERNAL__ */ + +/*! @function configRead32 + @abstract Reads a 32-bit value from the PCI device's configuration space. + @discussion This method reads a 32-bit configuration space register on the device and returns its value. + @param offset An offset into configuration space, of which bits 0-1 are ignored. + @result An 32-bit value in host byte order (big endian on PPC). */ + + UInt32 configRead32( IOByteCount offset ) { return (extendedConfigRead32(offset)); } + +/*! @function configRead16 + @abstract Reads a 16-bit value from the PCI device's configuration space. + @discussion This method reads a 16-bit configuration space register on the device and returns its value. + @param offset An offset into configuration space, of which bit 0 is ignored. + @result An 16-bit value in host byte order (big endian on PPC). */ + + UInt16 configRead16( IOByteCount offset ) { return (extendedConfigRead16(offset)); } + +/*! @function configRead8 + @abstract Reads a 8-bit value from the PCI device's configuration space. + @discussion This method reads a 8-bit configuration space register on the device and returns its value. + @param offset An offset into configuration space. + @result An 8-bit value. */ + + UInt8 configRead8( IOByteCount offset ) { return (extendedConfigRead8(offset)); } + +/*! @function configWrite32 + @abstract Writes a 32-bit value to the PCI device's configuration space. + @discussion This method write a 32-bit value to a configuration space register on the device. + @param offset An offset into configuration space, of which bits 0-1 are ignored. + @param data An 32-bit value to be written in host byte order (big endian on PPC). */ + + void configWrite32( IOByteCount offset, UInt32 data ) { return (extendedConfigWrite32(offset, data)); } + +/*! @function configWrite16 + @abstract Writes a 16-bit value to the PCI device's configuration space. + @discussion This method write a 16-bit value to a configuration space register on the device. + @param offset An offset into configuration space, of which bit 0 is ignored. + @param data An 16-bit value to be written in host byte order (big endian on PPC). */ + + void configWrite16( IOByteCount offset, UInt16 data ) { return (extendedConfigWrite16(offset, data)); } + +/*! @function configWrite8 + @abstract Writes a 8-bit value to the PCI device's configuration space. + @discussion This method write a 8-bit value to a configuration space register on the device. + @param offset An offset into configuration space. + @param data An 8-bit value to be written. */ + + void configWrite8( IOByteCount offset, UInt8 data ) { return (extendedConfigWrite8(offset, data)); } + + OSMetaClassDeclareReservedUnused(IOPCIDevice, 16); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 17); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 18); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 19); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 20); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 21); +public: + +#endif /* !__IOPCIDEVICE_INTERNAL__ */ + + virtual IOReturn saveDeviceState( IOOptionBits options = 0 ); + virtual IOReturn restoreDeviceState( IOOptionBits options = 0 ); + +/*! @function setConfigBits + @abstract Sets masked bits in a configuration space register. + @discussion This method sets masked bits in a configuration space register on the device by reading and writing the register. The value of the masked bits before the write is returned. + @param offset An 8-bit offset into configuration space, of which bits 0-1 are ignored. + @param mask An 32-bit mask indicating which bits in the value parameter are valid. + @param value An 32-bit value to be written in host byte order (big endian on PPC). + @result The value of the register masked with the mask before the write. */ + + virtual UInt32 setConfigBits( UInt8 offset, UInt32 mask, UInt32 value ); + +/*! @function setMemoryEnable + @abstract Sets the device's memory space response. + @discussion This method sets the memory space response bit in the device's command config space register to the passed value, and returns the previous state of the enable. + @param enable True or false to enable or disable the memory space response. + @result True if the memory space response was previously enabled, false otherwise. */ + + virtual bool setMemoryEnable( bool enable ); + +/*! @function setIOEnable + @abstract Sets the device's I/O space response. + @discussion This method sets the I/O space response bit in the device's command config space register to the passed value, and returns the previous state of the enable. The exclusive option allows only one exclusive device on the bus to be enabled concurrently, this should be only for temporary access. + @param enable True or false to enable or disable the I/O space response. + @param exclusive If true, only one setIOEnable with the exclusive flag set will be allowed at a time on the bus, this should be only for temporary access. + @result True if the I/O space response was previously enabled, false otherwise. */ + + virtual bool setIOEnable( bool enable, bool exclusive = false ); + +/*! @function setBusMasterEnable + @abstract Sets the device's bus master enable. + @discussion This method sets the bus master enable bit in the device's command config space register to the passed value, and returns the previous state of the enable. + @param enable True or false to enable or disable bus mastering. + @result True if bus mastering was previously enabled, false otherwise. */ + + virtual bool setBusMasterEnable( bool enable ); + +/*! @function findPCICapability + @abstract Search configuration space for a PCI capability register. + @discussion This method searches the device's config space for a PCI capability register matching the passed capability ID, if the device supports PCI capabilities. To search for PCI Express extended capabilities or for multiple capablities with the same ID, use the extendedFindPCICapability() method. + @param capabilityID An 8-bit PCI capability ID. + @param offset An optional pointer to return the offset into config space where the capability was found. + @result The 32-bit value of the capability register if one was found, zero otherwise. */ + + virtual UInt32 findPCICapability( UInt8 capabilityID, UInt8 * offset = 0 ); + +/*! @function getBusNumber + @abstract Accessor to return the PCI device's assigned bus number. + @discussion This method is an accessor to return the PCI device's assigned bus number. + @result The 8-bit value of device's PCI bus number. */ + + virtual UInt8 getBusNumber( void ); + +/*! @function getDeviceNumber + @abstract Accessor to return the PCI device's device number. + @discussion This method is an accessor to return the PCI device's device number. + @result The 5-bit value of device's device number. */ + + virtual UInt8 getDeviceNumber( void ); + +/*! @function getFunctionNumber + @abstract Accessor to return the PCI device's function number. + @discussion This method is an accessor to return the PCI device's function number. + @result The 3-bit value of device's function number. */ + + virtual UInt8 getFunctionNumber( void ); + + /* Device memory accessors */ + +/*! @function getDeviceMemoryWithRegister + @abstract Returns an instance of IODeviceMemory representing one of the device's memory mapped ranges. + @discussion This method will return a pointer to an instance of IODeviceMemory for the physical memory range that was assigned to the configuration space base address register passed in. It is analogous to IOService::getDeviceMemoryWithIndex. + @param reg The 8-bit configuration space register that is the base address register for the desired range. + @result A pointer to an instance of IODeviceMemory, or zero no such range was found. The IODeviceMemory is retained by the provider, so is valid while attached, or while any mappings to it exist. It should not be released by the caller. */ + + virtual IODeviceMemory * getDeviceMemoryWithRegister( UInt8 reg ); + +/*! @function mapDeviceMemoryWithRegister + @abstract Maps a physical range of the device. + @discussion This method will create a mapping for the IODeviceMemory for the physical memory range that was assigned to the configuration space base address register passed in, with IODeviceMemory::map(options). The mapping is represented by the returned instance of IOMemoryMap, which should not be released until the mapping is no longer required. This method is analogous to IOService::mapDeviceMemoryWithIndex. + @param reg The 8-bit configuration space register that is the base address register for the desired range. + @param options Options to be passed to the IOMemoryDescriptor::map() method. + @result An instance of IOMemoryMap, or zero if the index is beyond the count available. The mapping should be released only when access to it is no longer required. */ + + virtual IOMemoryMap * mapDeviceMemoryWithRegister( UInt8 reg, + IOOptionBits options = 0 ); + +/*! @function ioDeviceMemory + @abstract Accessor to the I/O space aperture for the bus. + @discussion This method will return a reference to the IODeviceMemory for the I/O aperture of the bus the device is on. + @result A pointer to an IODeviceMemory object for the I/O aperture. The IODeviceMemory is retained by the provider, so is valid while attached, or while any mappings to it exist. It should not be released by the caller. */ + + virtual IODeviceMemory * ioDeviceMemory( void ); + + /* I/O space accessors */ + +/*! @function ioWrite32 + @abstract Writes a 32-bit value to an I/O space aperture. + @discussion This method will write a 32-bit value to a 4 byte aligned offset in an I/O space aperture. If a map object is passed in, the value is written relative to it, otherwise to the value is written relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param value The value to be written in host byte order (big endian on PPC). + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. */ + + virtual void ioWrite32( UInt16 offset, UInt32 value, + IOMemoryMap * map = 0 ); + +/*! @function ioWrite16 + @abstract Writes a 16-bit value to an I/O space aperture. + @discussion This method will write a 16-bit value to a 2 byte aligned offset in an I/O space aperture. If a map object is passed in, the value is written relative to it, otherwise to the value is written relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param value The value to be written in host byte order (big endian on PPC). + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. */ + + virtual void ioWrite16( UInt16 offset, UInt16 value, + IOMemoryMap * map = 0 ); + +/*! @function ioWrite8 + @abstract Writes a 8-bit value to an I/O space aperture. + @discussion This method will write a 8-bit value to an offset in an I/O space aperture. If a map object is passed in, the value is written relative to it, otherwise to the value is written relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param value The value to be written in host byte order (big endian on PPC). + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. */ + + virtual void ioWrite8( UInt16 offset, UInt8 value, + IOMemoryMap * map = 0 ); + +/*! @function ioRead32 + @abstract Reads a 32-bit value from an I/O space aperture. + @discussion This method will read a 32-bit value from a 4 byte aligned offset in an I/O space aperture. If a map object is passed in, the value is read relative to it, otherwise to the value is read relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. + @result The value read in host byte order (big endian on PPC). */ + + virtual UInt32 ioRead32( UInt16 offset, IOMemoryMap * map = 0 ); + +/*! @function ioRead16 + @abstract Reads a 16-bit value from an I/O space aperture. + @discussion This method will read a 16-bit value from a 2 byte aligned offset in an I/O space aperture. If a map object is passed in, the value is read relative to it, otherwise to the value is read relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. + @result The value read in host byte order (big endian on PPC). */ + + virtual UInt16 ioRead16( UInt16 offset, IOMemoryMap * map = 0 ); + +/*! @function ioRead8 + @abstract Reads a 8-bit value from an I/O space aperture. + @discussion This method will read a 8-bit value from an offset in an I/O space aperture. If a map object is passed in, the value is read relative to it, otherwise to the value is read relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. + @result The value read. */ + + virtual UInt8 ioRead8( UInt16 offset, IOMemoryMap * map = 0 ); + + OSMetaClassDeclareReservedUsed(IOPCIDevice, 0); +/*! @function hasPCIPowerManagement + @abstract determine whether or not the device supports PCI Bus Power Management. + @discussion This method will look at the device's capabilties registers and determine whether or not the device supports the PCI BUS Power Management Specification. + @param state (optional) Check for support of a specific state (e.g. kPCIPMCPMESupportFromD3Cold). If state is not suuplied or is 0, then check for a property in the registry which tells which state the hardware expects the device to go to during sleep. + @result true if the specified state is supported */ + virtual bool hasPCIPowerManagement(IOOptionBits state = 0); + + OSMetaClassDeclareReservedUsed(IOPCIDevice, 1); +/*! @function enablePCIPowerManagement + @abstract enable PCI power management for sleep state + @discussion This method will enable PCI Bus Powermanagement when going to sleep mode. + @param state (optional) Enables PCI Power Management by placing the function in the given state (e.g. kPCIPMCSPowerStateD3). If state is not specified or is 0xffffffff, then the IOPCIDevice determines the desired state. If state is kPCIPMCSPowerStateD0 (0) then PCI Power Management is disabled. + @result kIOReturnSuccess if there were no errors */ + virtual IOReturn enablePCIPowerManagement(IOOptionBits state = 0xffffffff); + + OSMetaClassDeclareReservedUsed(IOPCIDevice, 2); +/*! @function extendedFindPCICapability + @abstract Search configuration space for a PCI capability register. + @discussion This method searches the device's config space for a PCI capability register matching the passed capability ID, if the device supports PCI capabilities. + @param capabilityID A PCI capability ID. PCI Express devices may support extended capabilities in config space starting at offset 0x100. To search this space, the ID passed should be the negated value of the PCI-SIG assigned ID for the extended capability. + @param offset An optional in/out parameter to return the offset into config space where the capability was found, and to set the start point of the next search. Initialize the offset to zero before the first call to extendedFindPCICapability() and subsequent calls will find all capabilty blocks that may exist on the device with the same ID. + @result The 32-bit value of the capability register if one was found, zero otherwise. */ + + virtual UInt32 extendedFindPCICapability( UInt32 capabilityID, IOByteCount * offset = 0 ); + + // Unused Padding + OSMetaClassDeclareReservedUnused(IOPCIDevice, 3); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 4); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 5); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 6); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 7); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 8); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 9); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 10); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 11); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 12); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 13); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 14); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 15); + +public: + +/*! @function extendedConfigRead32 + @abstract Reads a 32-bit value from the PCI device's configuration space. + @discussion This method reads a 32-bit configuration space register on the device and returns its value. + @param offset A byte offset into configuration space, of which bits 0-1 are ignored. + @result An 32-bit value in host byte order (big endian on PPC). */ + + UInt32 extendedConfigRead32( IOByteCount offset ); + +/*! @function extendedConfigRead16 + @abstract Reads a 16-bit value from the PCI device's configuration space. + @discussion This method reads a 16-bit configuration space register on the device and returns its value. + @param offset A byte offset into configuration space, of which bit 0 is ignored. + @result An 16-bit value in host byte order (big endian on PPC). */ + + UInt16 extendedConfigRead16( IOByteCount offset ); + +/*! @function extendedConfigRead8 + @abstract Reads a 8-bit value from the PCI device's configuration space. + @discussion This method reads a 8-bit configuration space register on the device and returns its value. + @param offset A byte offset into configuration space. + @result An 8-bit value. */ + + UInt8 extendedConfigRead8( IOByteCount offset ); + +/*! @function extendedConfigWrite32 + @abstract Writes a 32-bit value to the PCI device's configuration space. + @discussion This method writes a 32-bit value to a configuration space register on the device. + @param offset A byte offset into configuration space, of which bits 0-1 are ignored. + @param data An 32-bit value to be written in host byte order (big endian on PPC). */ + + void extendedConfigWrite32( IOByteCount offset, UInt32 data ); + +/*! @function extendedConfigWrite16 + @abstract Writes a 16-bit value to the PCI device's configuration space. + @discussion This method writes a 16-bit value to a configuration space register on the device. + @param offset A byte offset into configuration space, of which bit 0 is ignored. + @param data An 16-bit value to be written in host byte order (big endian on PPC). */ + + void extendedConfigWrite16( IOByteCount offset, UInt16 data ); + +/*! @function extendedConfigWrite8 + @abstract Writes a 8-bit value to the PCI device's configuration space. + @discussion This method writes a 8-bit value to a configuration space register on the device. + @param offset A byte offset into configuration space. + @param data An 8-bit value to be written. */ + + void extendedConfigWrite8( IOByteCount offset, UInt8 data ); + + // pass NULL or currentHandler, currentRef to get current handler installed + // pass NULL or handler, ref to set handler for device + // messages: kIOMessageDeviceWillPowerOff, kIOMessageDeviceHasPoweredOff, + // kIOMessageDeviceWillPowerOn, kIOMessageDeviceHasPoweredOn + // state: D3 + IOReturn setConfigHandler(IOPCIDeviceConfigHandler handler, void * ref, + IOPCIDeviceConfigHandler * currentHandler, void ** currentRef); + + // + IOReturn kernelRequestProbe(uint32_t options); + + // (kIOPCIConfigSpace, VM_PROT_READ/WRITE to disable that access) + IOReturn protectDevice(uint32_t space, uint32_t prot); + + IOReturn checkLink(uint32_t options = 0); + + IOReturn relocate(uint32_t options = 0); + + IOReturn setLatencyTolerance(IOOptionBits type, uint64_t nanoseconds); + + IOPCIEventSource * createEventSource(OSObject * owner, IOPCIEventSource::Action action, uint32_t options); + + // allow tunnel controller to enter L1, client should be an attached driver calling + // this method in its IOPCIDevice provider. + IOReturn setTunnelL1Enable(IOService * client, bool l1Enable); + + IOReturn setASPMState(IOService * client, IOOptionBits state); + + enum { kIOPCIAERErrorDescriptionMaxLength = 256 }; + + void copyAERErrorDescriptionForBit(bool correctable, uint32_t bit, char * string, size_t maxLength); +}; + +#endif /* defined(KERNEL) */ + +#endif /* ! _IOKIT_IOPCIDEVICE_H */ + diff --git a/QualcommWireless/include/IOKit/pci/IOPCIFamilyDefinitions.h b/QualcommWireless/include/IOKit/pci/IOPCIFamilyDefinitions.h new file mode 100644 index 0000000..4cf01c4 --- /dev/null +++ b/QualcommWireless/include/IOKit/pci/IOPCIFamilyDefinitions.h @@ -0,0 +1,243 @@ +/* + * Copyright (c) 2018-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef IOPCIDefinitions_h +#define IOPCIDefinitions_h + +#include +#if TARGET_OS_DRIVERKIT +#include +#include +#include +#include +#include +#else +#include +#include +#endif + +// IOPCIDevice matching property names +#define kIOPCIMatchKey "IOPCIMatch" +#define kIOPCIPrimaryMatchKey "IOPCIPrimaryMatch" +#define kIOPCISecondaryMatchKey "IOPCISecondaryMatch" +#define kIOPCIClassMatchKey "IOPCIClassMatch" + +// pci express capabilities +#define kIOPCIExpressCapabilitiesKey "IOPCIExpressCapabilities" +// pci express link status +#define kIOPCIExpressLinkStatusKey "IOPCIExpressLinkStatus" +// pci express link capabilities +#define kIOPCIExpressLinkCapabilitiesKey "IOPCIExpressLinkCapabilities" +// pci express slot status +#define kIOPCIExpressSlotStatusKey "IOPCIExpressSlotStatus" +// pci express slot capabilities +#define kIOPCIExpressSlotCapabilitiesKey "IOPCIExpressSlotCapabilities" + +#define kIOPCIDeviceMemoryArrayKey "IODeviceMemory" + +/* Definitions of PCI Config Registers */ +enum +{ + kIOPCIConfigurationOffsetVendorID = 0x00, + kIOPCIConfigurationOffsetDeviceID = 0x02, + kIOPCIConfigurationOffsetCommand = 0x04, + kIOPCIConfigurationOffsetStatus = 0x06, + kIOPCIConfigurationOffsetRevisionID = 0x08, + kIOPCIConfigurationOffsetClassCode = 0x09, + kIOPCIConfigurationOffsetCacheLineSize = 0x0C, + kIOPCIConfigurationOffsetLatencyTimer = 0x0D, + kIOPCIConfigurationOffsetHeaderType = 0x0E, + kIOPCIConfigurationOffsetBIST = 0x0F, + kIOPCIConfigurationOffsetBaseAddress0 = 0x10, + kIOPCIConfigurationOffsetBaseAddress1 = 0x14, + kIOPCIConfigurationOffsetBaseAddress2 = 0x18, + kIOPCIConfigurationOffsetBaseAddress3 = 0x1C, + kIOPCIConfigurationOffsetBaseAddress4 = 0x20, + kIOPCIConfigurationOffsetBaseAddress5 = 0x24, + kIOPCIConfigurationOffsetCardBusCISPtr = 0x28, + kIOPCIConfigurationOffsetSubSystemVendorID = 0x2C, + kIOPCIConfigurationOffsetSubSystemID = 0x2E, + kIOPCIConfigurationOffsetExpansionROMBase = 0x30, + kIOPCIConfigurationOffsetCapabilitiesPtr = 0x34, + kIOPCIConfigurationOffsetInterruptLine = 0x3C, + kIOPCIConfigurationOffsetInterruptPin = 0x3D, + kIOPCIConfigurationOffsetMinimumGrant = 0x3E, + kIOPCIConfigurationOffsetMaximumLatency = 0x3F +}; + +/* Definitions of Capabilities PCI Config Register */ +enum +{ + kIOPCICapabilityIDOffset = 0x00, + kIOPCINextCapabilityOffset = 0x01, + + kIOPCICapabilityIDPowerManagement = 0x01, + kIOPCICapabilityIDAGP = 0x02, + kIOPCICapabilityIDVitalProductData = 0x03, + kIOPCICapabilityIDSlotID = 0x04, + kIOPCICapabilityIDMSI = 0x05, + kIOPCICapabilityIDCPCIHotswap = 0x06, + kIOPCICapabilityIDPCIX = 0x07, + kIOPCICapabilityIDLDT = 0x08, + kIOPCICapabilityIDVendorSpecific = 0x09, + kIOPCICapabilityIDDebugPort = 0x0a, + kIOPCICapabilityIDCPCIResourceControl = 0x0b, + kIOPCICapabilityIDHotplug = 0x0c, + kIOPCICapabilityIDAGP8 = 0x0e, + kIOPCICapabilityIDSecure = 0x0f, + kIOPCICapabilityIDPCIExpress = 0x10, + kIOPCICapabilityIDMSIX = 0x11, + kIOPCICapabilityIDFPB = 0x15, + + kIOPCIExpressCapabilityIDErrorReporting = -0x01UL, + kIOPCIExpressCapabilityIDVirtualChannel = -0x02UL, + kIOPCIExpressCapabilityIDDeviceSerialNumber = -0x03UL, + kIOPCIExpressCapabilityIDPowerBudget = -0x04UL, + kIOPCIExpressCapabilityIDAccessControlServices = -0x0DUL, + kIOPCIExpressCapabilityIDLatencyTolerenceReporting = -0x18UL, + kIOPCIExpressCapabilityIDL1PMSubstates = -0x1EUL, +}; + +/* Command register definitions */ +enum +{ + kIOPCICommandIOSpace = 0x0001, + kIOPCICommandMemorySpace = 0x0002, + kIOPCICommandBusMaster = 0x0004, + kIOPCICommandSpecialCycles = 0x0008, + kIOPCICommandMemWrInvalidate = 0x0010, + kIOPCICommandPaletteSnoop = 0x0020, + kIOPCICommandParityError = 0x0040, + kIOPCICommandAddressStepping = 0x0080, + kIOPCICommandSERR = 0x0100, + kIOPCICommandFastBack2Back = 0x0200, + kIOPCICommandInterruptDisable = 0x0400 +}; + +/* Status register definitions */ +enum +{ + kIOPCIStatusInterrupt = 0x0008, + kIOPCIStatusCapabilities = 0x0010, + kIOPCIStatusPCI66 = 0x0020, + kIOPCIStatusUDF = 0x0040, + kIOPCIStatusFastBack2Back = 0x0080, + kIOPCIStatusDevSel0 = 0x0000, + kIOPCIStatusDevSel1 = 0x0200, + kIOPCIStatusDevSel2 = 0x0400, + kIOPCIStatusDevSel3 = 0x0600, + kIOPCIStatusTargetAbortCapable = 0x0800, + kIOPCIStatusTargetAbortActive = 0x1000, + kIOPCIStatusMasterAbortActive = 0x2000, + kIOPCIStatusSERRActive = 0x4000, + kIOPCIStatusParityErrActive = 0x8000 +}; + +enum +{ + kPCI2PCIOffsetPrimaryBus = 0x18, + kPCI2PCIOffsetSecondaryBus = 0x19, + kPCI2PCIOffsetSubordinateBus = 0x1a, + kPCI2PCIOffsetSecondaryLT = 0x1b, + kPCI2PCIOffsetIORange = 0x1c, + kPCI2PCIOffsetMemoryRange = 0x20, + kPCI2PCIOffsetPrefetchMemoryRange = 0x24, + kPCI2PCIOffsetPrefetchUpperBase = 0x28, + kPCI2PCIOffsetPrefetchUpperLimit = 0x2c, + kPCI2PCIOffsetUpperIORange = 0x30, + kPCI2PCIOffsetBridgeControl = 0x3e +}; + +// constants which are part of the PCI Bus Power Management Spec. +enum +{ + // capabilities bits in the 16 bit capabilities register + kPCIPMCPMESupportFromD3Cold = 0x8000, + kPCIPMCPMESupportFromD3Hot = 0x4000, + kPCIPMCPMESupportFromD2 = 0x2000, + kPCIPMCPMESupportFromD1 = 0x1000, + kPCIPMCPMESupportFromD0 = 0x0800, + kPCIPMCD2Support = 0x0400, + kPCIPMCD1Support = 0x0200, + + kPCIPMCD3Support = 0x0001 +}; + +enum +{ + // bits in the power management control/status register + kPCIPMCSPMEStatus = 0x8000, + kPCIPMCSPMEEnable = 0x0100, + kPCIPMCSPowerStateMask = 0x0003, + kPCIPMCSPowerStateD3 = 0x0003, + kPCIPMCSPowerStateD2 = 0x0002, + kPCIPMCSPowerStateD1 = 0x0001, + kPCIPMCSPowerStateD0 = 0x0000, + + kPCIPMCSDefaultEnableBits = (~(IOOptionBits)0), + + kPCIPMCSPMEDisableInS3 = 0x00010000, + kPCIPMCSPMEWakeReason = 0x00020000 +}; + +// PCIe error bits +enum +{ + kIOPCIUncorrectableErrorBitDataLinkProtocol = 4, + kIOPCIUncorrectableErrorBitSurpriseDown = 5, + kIOPCIUncorrectableErrorBitPoisonedTLP = 12, + kIOPCIUncorrectableErrorBitFlowControlProtocol = 13, + kIOPCIUncorrectableErrorBitCompletionTimeout = 14, + kIOPCIUncorrectableErrorBitCompleterAbort = 15, + kIOPCIUncorrectableErrorBitUnexpectedCompletion = 16, + kIOPCIUncorrectableErrorBitReceiverOverflow = 17, + kIOPCIUncorrectableErrorBitMalformedTLP = 18, + kIOPCIUncorrectableErrorBitECRC = 19, + kIOPCIUncorrectableErrorBitUnsupportedRequest = 20, + + kIOPCIUncorrectableErrorBitACSViolation = 21, + kIOPCIUncorrectableErrorBitInternal = 22, + kIOPCIUncorrectableErrorBitMCBlockedTLP = 23, + kIOPCIUncorrectableErrorBitAtomicOpEgressBlocked = 24, + kIOPCIUncorrectableErrorBitTLPPrefixBlocked = 25 +}; + +enum +{ + kIOPCICorrectableErrorBitReceiver = 0, + kIOPCICorrectableErrorBitBadTLP = 6, + kIOPCICorrectableErrorBitBadDLLP = 7, + kIOPCICorrectableErrorBitReplayNumRollover = 8, + kIOPCICorrectableErrorBitReplayTimerTimeout = 12, + kIOPCICorrectableErrorBitAdvisoryNonFatal = 13, + kIOPCICorrectableErrorBitCorrectedInternal = 14, + kIOPCICorrectableErrorBitHeaderLogOverflow = 15, +}; + + +#endif /* IOPCIDefinitions_h */ diff --git a/QualcommWireless/include/IOKit/platform/AppleMacIO.h b/QualcommWireless/include/IOKit/platform/AppleMacIO.h new file mode 100644 index 0000000..45e5b9b --- /dev/null +++ b/QualcommWireless/include/IOKit/platform/AppleMacIO.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_APPLEMACIO_H +#define _IOKIT_APPLEMACIO_H + +#include + +#include + +class AppleMacIO : public IOService +{ + OSDeclareAbstractStructors(AppleMacIO); + + IOService * fNub; + IOMemoryMap * fMemory; + + struct ExpansionData { }; + ExpansionData *fReserved; + +protected: + virtual bool selfTest( void ); + +public: + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + + virtual IOService * createNub( IORegistryEntry * from ); + + virtual void processNub( IOService * nub ); + + virtual void publishBelow( IORegistryEntry * root ); + + virtual const char * deleteList( void ); + virtual const char * excludeList( void ); + + virtual bool compareNubName( const IOService * nub, OSString * name, + OSString ** matched = 0 ) const; + + virtual IOReturn getNubResources( IOService * nub ); + + OSMetaClassDeclareReservedUnused(AppleMacIO, 0); + OSMetaClassDeclareReservedUnused(AppleMacIO, 1); + OSMetaClassDeclareReservedUnused(AppleMacIO, 2); + OSMetaClassDeclareReservedUnused(AppleMacIO, 3); +}; + +#endif /* ! _IOKIT_APPLEMACIO_H */ diff --git a/QualcommWireless/include/IOKit/platform/AppleMacIODevice.h b/QualcommWireless/include/IOKit/platform/AppleMacIODevice.h new file mode 100644 index 0000000..cb6f898 --- /dev/null +++ b/QualcommWireless/include/IOKit/platform/AppleMacIODevice.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_APPLEMACIODEVICE_H +#define _IOKIT_APPLEMACIODEVICE_H + +#include + +class AppleMacIODevice : public IOService +{ + OSDeclareDefaultStructors(AppleMacIODevice); + +private: + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual bool compareName( OSString * name, OSString ** matched = 0 ) const APPLE_KEXT_OVERRIDE; + virtual IOService *matchLocation(IOService *client) APPLE_KEXT_OVERRIDE; + virtual IOReturn getResources( void ) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(AppleMacIODevice, 0); + OSMetaClassDeclareReservedUnused(AppleMacIODevice, 1); + OSMetaClassDeclareReservedUnused(AppleMacIODevice, 2); + OSMetaClassDeclareReservedUnused(AppleMacIODevice, 3); +}; + +#endif /* ! _IOKIT_APPLEMACIODEVICE_H */ diff --git a/QualcommWireless/include/IOKit/platform/AppleNMI.h b/QualcommWireless/include/IOKit/platform/AppleNMI.h new file mode 100644 index 0000000..a21688e --- /dev/null +++ b/QualcommWireless/include/IOKit/platform/AppleNMI.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998-9 Apple Computer, Inc. All rights reserved. + * + * DRI: Josh de Cesare + * + */ + +#ifndef _IOKIT_APPLENMI_H +#define _IOKIT_APPLENMI_H + +#include +#include + +// NMI Interrupt Constants +enum{ + kExtInt9_NMIIntSource = 0x800506E0, + kNMIIntLevelMask = 0x00004000, + kNMIIntMask = 0x00000080 +}; + + +class AppleNMI : public IOService +{ + OSDeclareDefaultStructors(AppleNMI); + +private: + bool enable_debugger; + bool mask_NMI; + + struct ExpansionData { }; + ExpansionData * reserved; // Reserved for future use + +public: + IOService *rootDomain; + virtual bool start(IOService *provider) APPLE_KEXT_OVERRIDE; + virtual IOReturn initNMI(IOInterruptController *parentController, OSData *parentSource); + virtual IOReturn handleInterrupt(void *refCon, IOService *nub, int source); + +// Power handling methods: + virtual IOReturn powerStateWillChangeTo(IOPMPowerFlags, unsigned long, IOService*) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(AppleNMI, 0); + OSMetaClassDeclareReservedUnused(AppleNMI, 1); + OSMetaClassDeclareReservedUnused(AppleNMI, 2); + OSMetaClassDeclareReservedUnused(AppleNMI, 3); +}; + +#endif /* ! _IOKIT_APPLENMI_H */ diff --git a/QualcommWireless/include/IOKit/platform/ApplePlatformExpert.h b/QualcommWireless/include/IOKit/platform/ApplePlatformExpert.h new file mode 100644 index 0000000..d5ffd5a --- /dev/null +++ b/QualcommWireless/include/IOKit/platform/ApplePlatformExpert.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_APPLEPLATFORM_H +#define _IOKIT_APPLEPLATFORM_H + +#include + +enum { + kBootROMTypeOldWorld = 0, + kBootROMTypeNewWorld +}; + +enum { + kChipSetTypePowerSurge = 0, + kChipSetTypePowerStar, + kChipSetTypeGossamer, + kChipSetTypePowerExpress, + kChipSetTypeCore99, + kChipSetTypeCore2001 +}; + +enum { + kMachineTypeUnknown = 0 +}; + +extern const OSSymbol *gGetDefaultBusSpeedsKey; + +class ApplePlatformExpert : public IODTPlatformExpert +{ + OSDeclareAbstractStructors(ApplePlatformExpert); + +private: + SInt32 _timeToGMT; + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool configure( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual const char * deleteList( void ) APPLE_KEXT_OVERRIDE; + virtual const char * excludeList( void ) APPLE_KEXT_OVERRIDE; + + virtual void registerNVRAMController( IONVRAMController * nvram ) APPLE_KEXT_OVERRIDE; + + virtual long getGMTTimeOfDay(void) APPLE_KEXT_OVERRIDE; + virtual void setGMTTimeOfDay(long secs) APPLE_KEXT_OVERRIDE; + + virtual bool getMachineName(char *name, int maxLength) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(ApplePlatformExpert, 0); + OSMetaClassDeclareReservedUnused(ApplePlatformExpert, 1); + OSMetaClassDeclareReservedUnused(ApplePlatformExpert, 2); + OSMetaClassDeclareReservedUnused(ApplePlatformExpert, 3); +}; + + +#endif /* ! _IOKIT_APPLEPLATFORM_H */ diff --git a/QualcommWireless/include/IOKit/power/IOPwrController.h b/QualcommWireless/include/IOKit/power/IOPwrController.h new file mode 100644 index 0000000..f38707f --- /dev/null +++ b/QualcommWireless/include/IOKit/power/IOPwrController.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * 24 Nov 1998 suurballe Created. + */ + +#include + +class IOPwrController : public IOService +{ + OSDeclareAbstractStructors(IOPwrController); + +public: +}; diff --git a/QualcommWireless/include/IOKit/pwr_mgt/IOPM.h b/QualcommWireless/include/IOKit/pwr_mgt/IOPM.h new file mode 100644 index 0000000..84fcaa7 --- /dev/null +++ b/QualcommWireless/include/IOKit/pwr_mgt/IOPM.h @@ -0,0 +1,963 @@ +/* + * Copyright (c) 1998-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOPM_H +#define _IOKIT_IOPM_H + +#include +#include +#include + +/*! @header IOPM.h + * @abstract Defines power management constants and keys used by both in-kernel and user space power management. + * @discussion IOPM.h defines a range of power management constants used in several in-kernel and user space APIs. Most significantly, the IOPMPowerFlags used to specify the fields of an IOPMPowerState struct are defined here. + * + * Most of the constants defined in IOPM.h are deprecated or for Apple internal use only, and are not elaborated on in headerdoc. + */ + +enum { + kIOPMMaxPowerStates = 10, + IOPMMaxPowerStates = kIOPMMaxPowerStates +}; + +/*! @enum IOPMPowerFlags + * @abstract Bits are used in defining capabilityFlags, inputPowerRequirements, and outputPowerCharacter in the IOPMPowerState structure. + * @discussion These bits may be bitwise-OR'd together in the IOPMPowerState capabilityFlags field, the outputPowerCharacter field, and/or the inputPowerRequirement field. + * + * The comments clearly mark whether each flag should be used in the capabilityFlags field, outputPowerCharacter field, and inputPowerRequirement field, or all three. + * + * The value of capabilityFlags, inputPowerRequirement or outputPowerCharacter may be 0. Most drivers implement their 'OFF' state, used when asleep, by defininf each of the 3 fields as 0. + * + * The bits listed below are only the most common bits used to define a device's power states. Your device's IO family may require that your device specify other input or output power flags to interact properly. Consult family-specific documentation to determine if your IOPower plane parents or children require other power flags; they probably don't. + * + * @constant kIOPMPowerOn Indicates the device is on, requires power, and provides power. Useful as a: Capability, InputPowerRequirement, OutputPowerCharacter + * + * @constant kIOPMDeviceUsable Indicates the device is usable in this state. Useful only as a Capability + * + * @constant kIOPMLowPower + * Indicates device is in a low power state. May be bitwis-OR'd together + * with kIOPMDeviceUsable flag, to indicate the device is still usable. + * + * A device with a capability of kIOPMLowPower may: + * Require either 0 or kIOPMPowerOn from its power parent + * Offer either kIOPMLowPower, kIOPMPowerOn, or 0 (no power at all) + * to its power plane children. + * + * Useful only as a Capability, although USB drivers should consult USB family documentation for other valid circumstances to use the kIOPMLowPower bit. + * + * @constant kIOPMPreventIdleSleep + * In the capability field of a power state, disallows idle system sleep while the device is in that state. + * + * For example, displays and disks set this capability for their ON power state; since the system may not idle sleep while the display (and thus keyboard or mouse) or the disk is active. + * + * Useful only as a Capability. + * + * @constant kIOPMSleepCapability + * Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. + * + * @constant kIOPMRestartCapability + * Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. + * + * @constant kIOPMSleep + * Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. + * + * @constant kIOPMRestart + * Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. + * + * @constant kIOPMInitialDeviceState + * Indicates the initial power state for the device. If initialPowerStateForDomainState() returns a power state with this flag set in the capability field, then the initial power change is performed without calling the driver's setPowerState(). + * + * @constant kIOPMRootDomainState + * An indication that the power flags represent the state of the root power + * domain. This bit must not be set in the IOPMPowerState structure. + * Power Management may pass this bit to initialPowerStateForDomainState() + * to map from a global system state to the desired device state. + */ +typedef unsigned long IOPMPowerFlags; +enum { + kIOPMPowerOn = 0x00000002, + kIOPMDeviceUsable = 0x00008000, + kIOPMLowPower = 0x00010000, + kIOPMPreventIdleSleep = 0x00000040, + kIOPMSleepCapability = 0x00000004, + kIOPMRestartCapability = 0x00000080, + kIOPMSleep = 0x00000001, + kIOPMRestart = 0x00000080, + kIOPMInitialDeviceState = 0x00000100, + kIOPMRootDomainState = 0x00000200 +}; + +/* + * Private IOPMPowerFlags + * + * For Apple use only + * Not for use with non-Apple drivers + * Their behavior is undefined + */ +enum { + kIOPMClockNormal = 0x0004, + kIOPMClockRunning = 0x0008, + kIOPMPreventSystemSleep = 0x0010, + kIOPMDoze = 0x0400, + kIOPMChildClamp = 0x0080, + kIOPMChildClamp2 = 0x0200, + kIOPMNotPowerManaged = 0x0800 +}; + +/* + * Deprecated IOPMPowerFlags + * Their behavior is undefined when used in IOPMPowerState + * Capability, InputPowerRequirement, or OutputPowerCharacter fields. + */ +enum { + kIOPMMaxPerformance = 0x4000, + kIOPMPassThrough = 0x0100, + kIOPMAuxPowerOn = 0x0020, + kIOPMNotAttainable = 0x0001, + kIOPMContextRetained = 0x2000, + kIOPMConfigRetained = 0x1000, + kIOPMStaticPowerValid = 0x0800, + kIOPMSoftSleep = 0x0400, + kIOPMCapabilitiesMask = kIOPMPowerOn | kIOPMDeviceUsable | + kIOPMMaxPerformance | kIOPMContextRetained | + kIOPMConfigRetained | kIOPMSleepCapability | + kIOPMRestartCapability +}; + +/* + * Support for old names of IOPMPowerFlag constants + */ +enum { + IOPMNotAttainable = kIOPMNotAttainable, + IOPMPowerOn = kIOPMPowerOn, + IOPMClockNormal = kIOPMClockNormal, + IOPMClockRunning = kIOPMClockRunning, + IOPMAuxPowerOn = kIOPMAuxPowerOn, + IOPMDeviceUsable = kIOPMDeviceUsable, + IOPMMaxPerformance = kIOPMMaxPerformance, + IOPMContextRetained = kIOPMContextRetained, + IOPMConfigRetained = kIOPMConfigRetained, + IOPMNotPowerManaged = kIOPMNotPowerManaged, + IOPMSoftSleep = kIOPMSoftSleep +}; + + +enum { + kIOPMNextHigherState = 1, + kIOPMHighestState = 2, + kIOPMNextLowerState = 3, + kIOPMLowestState = 4 +}; + +enum { + IOPMNextHigherState = kIOPMNextHigherState, + IOPMHighestState = kIOPMHighestState, + IOPMNextLowerState = kIOPMNextLowerState, + IOPMLowestState = kIOPMLowestState +}; + +// Internal commands used by power managment command queue +enum { + kIOPMBroadcastAggressiveness = 1, + kIOPMUnidleDevice +}; + +// Power consumption unknown value +enum { + kIOPMUnknown = 0xFFFF +}; + +/******************************************************************************* + * + * Root Domain property keys of interest + * + ******************************************************************************/ + +/* AppleClamshellState + * reflects the state of the clamshell (lid) on a portable. + * It has a boolean value. + * true == clamshell is closed + * false == clamshell is open + * not present == no clamshell on this hardware + */ +#define kAppleClamshellStateKey "AppleClamshellState" + +/* AppleClamshellCausesSleep + * reflects the clamshell close behavior on a portable. + * It has a boolean value. + * true == system will sleep when clamshell is closed + * false == system will not sleep on clamshell close + * (typically external display mode) + * not present == no clamshell on this hardware + */ +#define kAppleClamshellCausesSleepKey "AppleClamshellCausesSleep" + +/* kIOPMSleepWakeUUIDKey + * Key refers to a CFStringRef that will uniquely identify + * a sleep/wake cycle for logging & tracking. + * The key becomes valid at the beginning of a sleep cycle - before we + * initiate any sleep/wake notifications. + * The key becomes invalid at the completion of a system wakeup. The + * property will not be present in the IOPMrootDomain's registry entry + * when it is invalid. + * + * See IOPMrootDomain notification kIOPMMessageSleepWakeUUIDChange + */ + #define kIOPMSleepWakeUUIDKey "SleepWakeUUID" + +/* kIOPMBootSessionUUIDKey + * Key refers to a CFStringRef that will uniquely identify + * a boot cycle. + * The key becomes valid at boot time and remains valid + * till shutdown. The property value will remain same across + * sleep/wake/hibernate cycle. + */ +#define kIOPMBootSessionUUIDKey "BootSessionUUID" + +/* kIOPMDeepSleepEnabledKey + * Indicates the Deep Sleep enable state. + * It has a boolean value. + * true == Deep Sleep is enabled + * false == Deep Sleep is disabled + * not present == Deep Sleep is not supported on this hardware + */ +#define kIOPMDeepSleepEnabledKey "Standby Enabled" + +/* kIOPMDeepSleepDelayKey + * Key refers to a CFNumberRef that represents the delay in seconds before + * entering Deep Sleep state when on battery power and when remaining + * battery capacity is below a particular threshold (e.g., 50%.) The + * property is not present if Deep Sleep is unsupported. + */ +#define kIOPMDeepSleepDelayKey "Standby Delay" + +/* kIOPMDeepSleepDelayHighKey + * Key refers to a CFNumberRef that represents the delay in seconds before + * entering Deep Sleep state. This is used instead of the value specified by + * kIOPMDeepSleepDelayKey if the remaining battery capacity is above a + * particular threshold (e.g. 50%) or on AC power. The property is not + * present if Deep Sleep is unsupported. + */ +#define kIOPMDeepSleepDelayHighKey "High Standby Delay" + +/* kIOPMLowBatteryThresholdKey + * Key refers to a CFNumberRef that represents the threshold used to choose + * between the normal deep sleep delay and the high deep sleep delay (as a + * percentage of total battery capacity remaining.) The property is not + * present if Deep Sleep is unsupported. + */ +#define kIOPMStandbyBatteryThresholdKey "Standby Battery Threshold" + +/* kIOPMDestroyFVKeyOnStandbyKey + * Specifies if FileVault key can be stored when going to standby mode + * It has a boolean value, + * true == Destroy FV key when going to standby mode + * false == Retain FV key when going to standby mode + * not present == Retain FV key when going to standby mode + */ +#define kIOPMDestroyFVKeyOnStandbyKey "DestroyFVKeyOnStandby" + +/******************************************************************************* + * + * Properties that can control power management behavior + * + ******************************************************************************/ + +/* kIOPMResetPowerStateOnWakeKey + * If an IOService publishes this key with the value of kOSBooleanTrue, + * then PM will disregard the influence from changePowerStateToPriv() or + * any activity tickles that occurred before system sleep when resolving + * the initial device power state on wake. Influences from power children + * and changePowerStateTo() are not eliminated. At the earliest opportunity + * upon system wake, PM will query the driver for a new power state to be + * installed as the initial changePowerStateToPriv() influence, by calling + * initialPowerStateForDomainState() with both kIOPMRootDomainState and + * kIOPMPowerOn flags set. The default implementation will always return + * the lowest power state. Drivers can override this default behavior to + * immediately raise the power state when there are work blocked on the + * power change, and cannot afford to wait until the next activity tickle. + * This property should be statically added to a driver's plist or set at + * runtime before calling PMinit(). + */ +#define kIOPMResetPowerStateOnWakeKey "IOPMResetPowerStateOnWake" + +/******************************************************************************* + * + * Driver PM Assertions + * + ******************************************************************************/ + +/* Driver Assertion bitfield description + * Driver PM assertions are defined by these bits. + */ +enum { + /*! kIOPMDriverAssertionCPUBit + * When set, PM kernel will prefer to leave the CPU and core hardware + * running in "Dark Wake" state, instead of sleeping. + */ + kIOPMDriverAssertionCPUBit = 0x01, + + /*! kIOPMDriverAssertionPreventSystemIdleSleepBit + * When set, the system should not idle sleep. This does not prevent + * demand sleep. + */ + kIOPMDriverAssertionPreventSystemIdleSleepBit = 0x02, + + /*! kIOPMDriverAssertionUSBExternalDeviceBit + * When set, driver is informing PM that an external USB device is attached. + */ + kIOPMDriverAssertionUSBExternalDeviceBit = 0x04, + + /*! kIOPMDriverAssertionBluetoothHIDDevicePairedBit + * When set, driver is informing PM that a Bluetooth HID device is paired. + */ + kIOPMDriverAssertionBluetoothHIDDevicePairedBit = 0x08, + + /*! kIOPMDriverAssertionExternalMediaMountedBit + * When set, driver is informing PM that an external media is mounted. + */ + kIOPMDriverAssertionExternalMediaMountedBit = 0x10, + + /*! kIOPMDriverAssertionReservedBit5 + * Reserved for Thunderbolt. + */ + kIOPMDriverAssertionReservedBit5 = 0x20, + + /*! kIOPMDriverAssertionPreventDisplaySleepBit + * When set, the display should remain powered on while the system's awake. + */ + kIOPMDriverAssertionPreventDisplaySleepBit = 0x40, + + /*! kIOPMDriverAssertionReservedBit7 + * Reserved for storage family. + */ + kIOPMDriverAssertionReservedBit7 = 0x80, + + /*! kIOPMDriverAssertionMagicPacketWakeEnabledBit + * When set, driver is informing PM that magic packet wake is enabled. + */ + kIOPMDriverAssertionMagicPacketWakeEnabledBit = 0x100, + + /*! kIOPMDriverAssertionNetworkKeepAliveActiveBit + * When set, driver is informing PM that it is holding the network + * interface up to do TCPKeepAlive + */ + kIOPMDriverAssertionNetworkKeepAliveActiveBit = 0x200 +}; + +/* kIOPMAssertionsDriverKey + * This kIOPMrootDomain key refers to a CFNumberRef property, containing + * a bitfield describing the aggregate PM assertion levels. + * Example: A value of 0 indicates that no driver has asserted anything. + * Or, a value of kIOPMDriverAssertionCPUBit + * indicates that a driver (or drivers) have asserted a need for CPU and video. + */ +#define kIOPMAssertionsDriverKey "DriverPMAssertions" + +/* kIOPMAssertionsDriverKey + * This kIOPMrootDomain key refers to a CFNumberRef property, containing + * a bitfield describing the aggregate PM assertion levels. + * Example: A value of 0 indicates that no driver has asserted anything. + * Or, a value of kIOPMDriverAssertionCPUBit + * indicates that a driver (or drivers) have asserted a need for CPU and video. + */ +#define kIOPMAssertionsDriverDetailedKey "DriverPMAssertionsDetailed" + +/******************************************************************************* + * + * Kernel Driver assertion detailed dictionary keys + * + * Keys decode the Array & dictionary data structure under IOPMrootDomain property + * kIOPMAssertionsDriverKey. + * + */ +#define kIOPMDriverAssertionIDKey "ID" +#define kIOPMDriverAssertionCreatedTimeKey "CreatedTime" +#define kIOPMDriverAssertionModifiedTimeKey "ModifiedTime" +#define kIOPMDriverAssertionOwnerStringKey "Owner" +#define kIOPMDriverAssertionOwnerServiceKey "ServicePtr" +#define kIOPMDriverAssertionRegistryEntryIDKey "RegistryEntryID" +#define kIOPMDriverAssertionLevelKey "Level" +#define kIOPMDriverAssertionAssertedKey "Assertions" + +/******************************************************************************* + * + * Root Domain general interest messages + * + * Available by registering for interest type 'gIOGeneralInterest' + * on IOPMrootDomain. + * + ******************************************************************************/ + +/* kIOPMMessageClamshellStateChange + * Delivered as a general interest notification on the IOPMrootDomain + * IOPMrootDomain sends this message when state of either AppleClamshellState + * or AppleClamshellCausesSleep changes. If this clamshell change results in + * a sleep, the sleep will initiate soon AFTER delivery of this message. + * The state of both variables is encoded in a bitfield argument sent with + * the message. Check bits 0 and 1 using kClamshellStateBit & kClamshellSleepBit + */ +enum { + kClamshellStateBit = (1 << 0), + kClamshellSleepBit = (1 << 1) +}; + +#define kIOPMMessageClamshellStateChange \ + iokit_family_msg(sub_iokit_powermanagement, 0x100) + +/* kIOPMMessageFeatureChange + * Delivered when the set of supported features ("Supported Features" dictionary + * under IOPMrootDomain registry) changes in some way. Typically addition or + * removal of a supported feature. + * RootDomain passes no argument with this message. + */ +#define kIOPMMessageFeatureChange \ + iokit_family_msg(sub_iokit_powermanagement, 0x110) + +/* kIOPMMessageInflowDisableCancelled + * The battery has drained completely to its "Fully Discharged" state. + * If a user process has disabled battery inflow for battery + * calibration, we forcibly re-enable Inflow at this point. + * If inflow HAS been forcibly re-enabled, bit 0 + * (kInflowForciblyEnabledBit) will be set. + */ +enum { + kInflowForciblyEnabledBit = (1 << 0) +}; + +/* kIOPMMessageInternalBatteryFullyDischarged + * The battery has drained completely to its "Fully Discharged" state. + */ +#define kIOPMMessageInternalBatteryFullyDischarged \ + iokit_family_msg(sub_iokit_powermanagement, 0x120) + +/* kIOPMMessageSystemPowerEventOccurred + * Some major system thermal property has changed, and interested clients may + * modify their behavior. + */ +#define kIOPMMessageSystemPowerEventOccurred \ + iokit_family_msg(sub_iokit_powermanagement, 0x130) + +/* kIOPMMessageSleepWakeUUIDChange + * Either a new SleepWakeUUID has been specified at the beginning of a sleep, + * or we're removing the existing property upon completion of a wakeup. + */ +#define kIOPMMessageSleepWakeUUIDChange \ + iokit_family_msg(sub_iokit_powermanagement, 0x140) + +/* kIOPMMessageSleepWakeUUIDSet + * Argument accompanying the kIOPMMessageSleepWakeUUIDChange notification when + * a new UUID has been specified. + */ +#define kIOPMMessageSleepWakeUUIDSet ((void *)1) + +/* kIOPMMessageSleepWakeUUIDCleared + * Argument accompanying the kIOPMMessageSleepWakeUUIDChange notification when + * the current UUID has been removed. + */ +#define kIOPMMessageSleepWakeUUIDCleared ((void *)NULL) + +/*! kIOPMMessageDriverAssertionsChanged + * Sent when kernel PM driver assertions have changed. + */ +#define kIOPMMessageDriverAssertionsChanged \ + iokit_family_msg(sub_iokit_powermanagement, 0x150) + +/*! kIOPMMessageDarkWakeThermalEmergency + * Sent when machine becomes unsustainably warm in DarkWake. + * Kernel PM might choose to put the machine back to sleep right after. + */ +#define kIOPMMessageDarkWakeThermalEmergency \ + iokit_family_msg(sub_iokit_powermanagement, 0x160) + +/******************************************************************************* + * + * Power commands issued to root domain + * Use with IOPMrootDomain::receivePowerNotification() + * + * These commands are issued from system drivers only: + * ApplePMU, AppleSMU, IOGraphics, AppleACPIFamily + * + * TODO: deprecate kIOPMAllowSleep and kIOPMPreventSleep + ******************************************************************************/ +enum { + kIOPMSleepNow = (1 << 0),// put machine to sleep now + kIOPMAllowSleep = (1 << 1),// allow idle sleep + kIOPMPreventSleep = (1 << 2),// do not allow idle sleep + kIOPMPowerButton = (1 << 3),// power button was pressed + kIOPMClamshellClosed = (1 << 4),// clamshell was closed + kIOPMPowerEmergency = (1 << 5),// battery dangerously low + kIOPMDisableClamshell = (1 << 6),// do not sleep on clamshell closure + kIOPMEnableClamshell = (1 << 7),// sleep on clamshell closure + kIOPMProcessorSpeedChange = (1 << 8),// change the processor speed + kIOPMOverTemp = (1 << 9),// system dangerously hot + kIOPMClamshellOpened = (1 << 10),// clamshell was opened + kIOPMDWOverTemp = (1 << 11),// DarkWake thermal limits exceeded. + kIOPMPowerButtonUp = (1 << 12),// Power button up + kIOPMProModeEngaged = (1 << 13),// Fans entered 'ProMode' + kIOPMProModeDisengaged = (1 << 14) // Fans exited 'ProMode' +}; + + +/******************************************************************************* + * + * Power Management Return Codes + * + ******************************************************************************/ +enum { + kIOPMNoErr = 0, + + // Returned by driver's setPowerState(), powerStateWillChangeTo(), + // powerStateDidChangeTo(), or acknowledgeSetPowerState() to + // implicitly acknowledge power change upon function return. + kIOPMAckImplied = 0, + + // Deprecated + kIOPMWillAckLater = 1, + + // Returned by requestPowerDomainState() to indicate + // unrecognized specification parameter. + kIOPMBadSpecification = 4, + + // Returned by requestPowerDomainState() to indicate + // no power state matches search specification. + kIOPMNoSuchState = 5, + + // Deprecated + kIOPMCannotRaisePower = 6, + + // Deprecated + kIOPMParameterError = 7, + + // Returned when power management state is accessed + // before driver has called PMinit(). + kIOPMNotYetInitialized = 8, + + // And the old constants; deprecated + IOPMNoErr = kIOPMNoErr, + IOPMAckImplied = kIOPMAckImplied, + IOPMWillAckLater = kIOPMWillAckLater, + IOPMBadSpecification = kIOPMBadSpecification, + IOPMNoSuchState = kIOPMNoSuchState, + IOPMCannotRaisePower = kIOPMCannotRaisePower, + IOPMParameterError = kIOPMParameterError, + IOPMNotYetInitialized = kIOPMNotYetInitialized +}; + + +// IOPMPowerSource class descriptive strings +// Power Source state is published as properties to the IORegistry under these +// keys. +#define kIOPMPSExternalConnectedKey "ExternalConnected" +#define kIOPMPSExternalChargeCapableKey "ExternalChargeCapable" +#define kIOPMPSBatteryInstalledKey "BatteryInstalled" +#define kIOPMPSIsChargingKey "IsCharging" +#define kIOPMFullyChargedKey "FullyCharged" +#define kIOPMPSAtWarnLevelKey "AtWarnLevel" +#define kIOPMPSAtCriticalLevelKey "AtCriticalLevel" +#define kIOPMPSCurrentCapacityKey "CurrentCapacity" +#define kIOPMPSMaxCapacityKey "MaxCapacity" +#define kIOPMPSDesignCapacityKey "DesignCapacity" +#define kIOPMPSTimeRemainingKey "TimeRemaining" +#define kIOPMPSAmperageKey "Amperage" +#define kIOPMPSVoltageKey "Voltage" +#define kIOPMPSCycleCountKey "CycleCount" +#define kIOPMPSMaxErrKey "MaxErr" +#define kIOPMPSAdapterInfoKey "AdapterInfo" +#define kIOPMPSLocationKey "Location" +#define kIOPMPSErrorConditionKey "ErrorCondition" +#define kIOPMPSManufacturerKey "Manufacturer" +#define kIOPMPSManufactureDateKey "ManufactureDate" +#define kIOPMPSModelKey "Model" +#define kIOPMPSSerialKey "Serial" +#define kIOPMDeviceNameKey "DeviceName" +#define kIOPMPSLegacyBatteryInfoKey "LegacyBatteryInfo" +#define kIOPMPSBatteryHealthKey "BatteryHealth" +#define kIOPMPSHealthConfidenceKey "HealthConfidence" +#define kIOPMPSCapacityEstimatedKey "CapacityEstimated" +#define kIOPMPSBatteryChargeStatusKey "ChargeStatus" +#define kIOPMPSBatteryTemperatureKey "Temperature" +#define kIOPMPSAdapterDetailsKey "AdapterDetails" +#define kIOPMPSChargerConfigurationKey "ChargerConfiguration" + +// kIOPMPSBatteryChargeStatusKey may have one of the following values, or may have +// no value. If kIOPMBatteryChargeStatusKey has a NULL value (or no value) associated with it +// then charge is proceeding normally. If one of these battery charge status reasons is listed, +// then the charge may have been interrupted. +#define kIOPMBatteryChargeStatusTooHot "HighTemperature" +#define kIOPMBatteryChargeStatusTooCold "LowTemperature" +#define kIOPMBatteryChargeStatusTooHotOrCold "HighOrLowTemperature" +#define kIOPMBatteryChargeStatusGradient "BatteryTemperatureGradient" + +// Definitions for battery location, in case of multiple batteries. +// A location of 0 is unspecified +// Location is undefined for single battery systems +enum { + kIOPMPSLocationLeft = 1001, + kIOPMPSLocationRight = 1002 +}; + +// Battery quality health types, specified by BatteryHealth and HealthConfidence +// properties in an IOPMPowerSource battery kext. +enum { + kIOPMUndefinedValue = 0, + kIOPMPoorValue = 1, + kIOPMFairValue = 2, + kIOPMGoodValue = 3 +}; + +// Keys for kIOPMPSAdapterDetailsKey dictionary +#define kIOPMPSAdapterDetailsIDKey "AdapterID" +#define kIOPMPSAdapterDetailsWattsKey "Watts" +#define kIOPMPSAdapterDetailsRevisionKey "AdapterRevision" +#define kIOPMPSAdapterDetailsSerialNumberKey "SerialNumber" +#define kIOPMPSAdapterDetailsFamilyKey "FamilyCode" +#define kIOPMPSAdapterDetailsAmperageKey "Current" +#define kIOPMPSAdapterDetailsDescriptionKey "Description" +#define kIOPMPSAdapterDetailsPMUConfigurationKey "PMUConfiguration" +#define kIOPMPSAdapterDetailsVoltage "Voltage" +#define kIOPMPSAdapterDetailsSourceIDKey "Source" +#define kIOPMPSAdapterDetailsErrorFlagsKey "ErrorFlags" +#define kIOPMPSAdapterDetailsSharedSourceKey "SharedSource" +#define kIOPMPSAdapterDetailsCloakedKey "CloakedSource" + +// values for kIOPSPowerAdapterFamilyKey +enum { + kIOPSFamilyCodeDisconnected = 0, + kIOPSFamilyCodeUnsupported = kIOReturnUnsupported, + kIOPSFamilyCodeFirewire = iokit_family_err(sub_iokit_firewire, 0), + kIOPSFamilyCodeUSBHost = iokit_family_err(sub_iokit_usb, 0), + kIOPSFamilyCodeUSBHostSuspended = iokit_family_err(sub_iokit_usb, 1), + kIOPSFamilyCodeUSBDevice = iokit_family_err(sub_iokit_usb, 2), + kIOPSFamilyCodeUSBAdapter = iokit_family_err(sub_iokit_usb, 3), + kIOPSFamilyCodeUSBChargingPortDedicated = iokit_family_err(sub_iokit_usb, 4), + kIOPSFamilyCodeUSBChargingPortDownstream = iokit_family_err(sub_iokit_usb, 5), + kIOPSFamilyCodeUSBChargingPort = iokit_family_err(sub_iokit_usb, 6), + kIOPSFamilyCodeUSBUnknown = iokit_family_err(sub_iokit_usb, 7), + kIOPSFamilyCodeUSBCBrick = iokit_family_err(sub_iokit_usb, 8), + kIOPSFamilyCodeUSBCTypeC = iokit_family_err(sub_iokit_usb, 9), + kIOPSFamilyCodeUSBCPD = iokit_family_err(sub_iokit_usb, 10), + kIOPSFamilyCodeAC = iokit_family_err(sub_iokit_pmu, 0), + kIOPSFamilyCodeExternal = iokit_family_err(sub_iokit_pmu, 1), + kIOPSFamilyCodeExternal2 = iokit_family_err(sub_iokit_pmu, 2), + kIOPSFamilyCodeExternal3 = iokit_family_err(sub_iokit_pmu, 3), + kIOPSFamilyCodeExternal4 = iokit_family_err(sub_iokit_pmu, 4), + kIOPSFamilyCodeExternal5 = iokit_family_err(sub_iokit_pmu, 5), +}; + +// values for kIOPMPSAdapterDetailsErrorFlagsKey +enum { + kIOPSAdapterErrorFlagNoErrors = 0, + kIOPSAdapterErrorFlagInsufficientAvailablePower = (1 << 1), + kIOPSAdapterErrorFlagForeignObjectDetected = (1 << 2), + kIOPSAdapterErrorFlagDeviceNeedsToBeRepositioned = (1 << 3), +}; + +// Battery's time remaining estimate is invalid this long (seconds) after a wake +#define kIOPMPSInvalidWakeSecondsKey "BatteryInvalidWakeSeconds" + +// Battery must wait this long (seconds) after being completely charged before +// the battery is settled. +#define kIOPMPSPostChargeWaitSecondsKey "PostChargeWaitSeconds" + +// Battery must wait this long (seconds) after being completely discharged +// before the battery is settled. +#define kIOPMPSPostDishargeWaitSecondsKey "PostDischargeWaitSeconds" + + +/* CPU Power Management status keys + * Pass as arguments to IOPMrootDomain::systemPowerEventOccurred + * Or as arguments to IOPMSystemPowerEventOccurred() + * Or to decode the dictionary obtained from IOPMCopyCPUPowerStatus() + * These keys reflect restrictions placed on the CPU by the system + * to bring the CPU's power consumption within allowable thermal and + * power constraints. + */ + + +/* kIOPMGraphicsPowerLimitsKey + * The key representing the dictionary of graphics power limits. + * The dictionary contains the other kIOPMCPUPower keys & their associated + * values (e.g. Speed limit, Processor Count, and Schedule limits). + */ +#define kIOPMGraphicsPowerLimitsKey "Graphics_Power_Limits" + +/* kIOPMGraphicsPowerLimitPerformanceKey + * The key representing the percent of overall performance made available + * by the graphics chip as a percentage (integer 0 - 100). + */ +#define kIOPMGraphicsPowerLimitPerformanceKey "Graphics_Power_Performance" + + + +/* kIOPMCPUPowerLimitsKey + * The key representing the dictionary of CPU Power Limits. + * The dictionary contains the other kIOPMCPUPower keys & their associated + * values (e.g. Speed limit, Processor Count, and Schedule limits). + */ +#define kIOPMCPUPowerLimitsKey "CPU_Power_Limits" + +/* kIOPMCPUPowerLimitProcessorSpeedKey defines the speed & voltage limits placed + * on the CPU. + * Represented as a percentage (0-100) of maximum CPU speed. + */ +#define kIOPMCPUPowerLimitProcessorSpeedKey "CPU_Speed_Limit" + +/* kIOPMCPUPowerLimitProcessorCountKey reflects how many, if any, CPUs have been + * taken offline. Represented as an integer number of CPUs (0 - Max CPUs). + */ +#define kIOPMCPUPowerLimitProcessorCountKey "CPU_Available_CPUs" + +/* kIOPMCPUPowerLimitSchedulerTimeKey represents the percentage (0-100) of CPU time + * available. 100% at normal operation. The OS may limit this time for a percentage + * less than 100%. + */ +#define kIOPMCPUPowerLimitSchedulerTimeKey "CPU_Scheduler_Limit" + + +/* Thermal Level Warning Key + * Indicates the thermal constraints placed on the system. This value may + * cause clients to action to consume fewer system resources. + * The value associated with this warning is defined by the platform. + */ +#define kIOPMThermalLevelWarningKey "Thermal_Level_Warning" + +/* Thermal Warning Level values + * kIOPMThermalLevelNormal - under normal operating conditions + * kIOPMThermalLevelDanger - thermal pressure may cause system slowdown + * kIOPMThermalLevelCritical - thermal conditions may cause imminent shutdown + * + * The platform may define additional thermal levels if necessary. + * Platform specific values are defined from 100 and above + */ +enum { + kIOPMThermalLevelNormal = 0, + kIOPMThermalLevelDanger = 5, + kIOPMThermalLevelCritical = 10, + + kIOPMThermalLevelWarning = 100, + kIOPMThermalLevelTrap = 110, + + kIOPMThermalLevelUnknown = 255, +}; + +#define kIOPMThermalWarningLevelNormal kIOPMThermalLevelNormal +#define kIOPMThermalWarningLevelDanger kIOPMThermalLevelWarning +#define kIOPMThermalWarningLevelCrisis kIOPMThermalLevelCritical + +// PM Settings Controller setting types +// Settings types used primarily with: +// IOPMrootDomain::registerPMSettingController +// The values are identical to the similarly named keys for use in user space +// PM settings work. Those keys are defined in IOPMLibPrivate.h. +#define kIOPMSettingWakeOnRingKey "Wake On Modem Ring" +#define kIOPMSettingRestartOnPowerLossKey "Automatic Restart On Power Loss" +#define kIOPMSettingWakeOnACChangeKey "Wake On AC Change" +#define kIOPMSettingSleepOnPowerButtonKey "Sleep On Power Button" +#define kIOPMSettingWakeOnClamshellKey "Wake On Clamshell Open" +#define kIOPMSettingReduceBrightnessKey "ReduceBrightness" +#define kIOPMSettingDisplaySleepUsesDimKey "Display Sleep Uses Dim" +#define kIOPMSettingTimeZoneOffsetKey "TimeZoneOffsetSeconds" +#define kIOPMSettingMobileMotionModuleKey "MobileMotionModule" +#define kIOPMSettingGraphicsSwitchKey "GPUSwitch" +#define kIOPMSettingProModeControl "ProModeControl" +#define kIOPMSettingProModeDefer "ProModeDefer" + +// Setting controlling drivers can register to receive scheduled wake data +// Either in "CF seconds" type, or structured calendar data in a formatted +// IOPMCalendarStruct defined below. +#define kIOPMSettingAutoWakeSecondsKey "wake" +#define kIOPMSettingAutoWakeCalendarKey "WakeByCalendarDate" +#define kIOPMSettingAutoPowerSecondsKey "poweron" +#define kIOPMSettingAutoPowerCalendarKey "PowerByCalendarDate" + +// Debug seconds auto wake +// Used by sleep cycling debug tools +#define kIOPMSettingDebugWakeRelativeKey "WakeRelativeToSleep" +#define kIOPMSettingDebugPowerRelativeKey "PowerRelativeToShutdown" + +// Maintenance wake calendar. +#define kIOPMSettingMaintenanceWakeCalendarKey "MaintenanceWakeCalendarDate" + + +struct IOPMCalendarStruct { + UInt32 year; + UInt8 month; + UInt8 day; + UInt8 hour; + UInt8 minute; + UInt8 second; + UInt8 selector; +}; +typedef struct IOPMCalendarStruct IOPMCalendarStruct; + +// SetAggressiveness types +enum { + kPMGeneralAggressiveness = 0, + kPMMinutesToDim, + kPMMinutesToSpinDown, + kPMMinutesToSleep, + kPMEthernetWakeOnLANSettings, + kPMSetProcessorSpeed, + kPMPowerSource, + kPMMotionSensor, + kPMLastAggressivenessType +}; +#define kMaxType (kPMLastAggressivenessType-1) + +// SetAggressiveness values for the kPMPowerSource aggressiveness type +enum { + kIOPMInternalPower = 1, + kIOPMExternalPower +}; + +#define kIOREMSleepEnabledKey "REMSleepEnabled" + +// Strings for deciphering the dictionary returned from IOPMCopyBatteryInfo +#define kIOBatteryInfoKey "IOBatteryInfo" +#define kIOBatteryCurrentChargeKey "Current" +#define kIOBatteryCapacityKey "Capacity" +#define kIOBatteryFlagsKey "Flags" +#define kIOBatteryVoltageKey "Voltage" +#define kIOBatteryAmperageKey "Amperage" +#define kIOBatteryCycleCountKey "Cycle Count" + +enum { + kIOBatteryInstalled = (1 << 2), + kIOBatteryCharge = (1 << 1), + kIOBatteryChargerConnect = (1 << 0) +}; + +// Private power management message indicating battery data has changed +// Indicates new data resides in the IORegistry +#define kIOPMMessageBatteryStatusHasChanged iokit_family_msg(sub_iokit_pmu, 0x100) + +// Apple private Legacy messages for re-routing AutoWake and AutoPower messages to the PMU +// through newer user space IOPMSchedulePowerEvent API +#define kIOPMUMessageLegacyAutoWake iokit_family_msg(sub_iokit_pmu, 0x200) +#define kIOPMUMessageLegacyAutoPower iokit_family_msg(sub_iokit_pmu, 0x210) + +// For use with IOPMPowerSource bFlags +#define IOPM_POWER_SOURCE_REV 2 +enum { + kIOPMACInstalled = kIOBatteryChargerConnect, + kIOPMBatteryCharging = kIOBatteryCharge, + kIOPMBatteryInstalled = kIOBatteryInstalled, + kIOPMUPSInstalled = (1 << 3), + kIOPMBatteryAtWarn = (1 << 4), + kIOPMBatteryDepleted = (1 << 5), + kIOPMACnoChargeCapability = (1 << 6), // AC adapter cannot charge battery + kIOPMRawLowBattery = (1 << 7), // used only by Platform Expert + kIOPMForceLowSpeed = (1 << 8), // set by Platfm Expert, chk'd by Pwr Plugin + kIOPMClosedClamshell = (1 << 9), // set by PMU - reflects state of the clamshell + kIOPMClamshellStateOnWake = (1 << 10) // used only by Platform Expert +}; + +// ********************************************** +// Internal power management data structures +// ********************************************** + +#if KERNEL && __cplusplus +class IOService; + +enum { + kIOPowerEmergencyLevel = 1000 +}; + +enum { + kIOPMSubclassPolicy, + kIOPMSuperclassPolicy1 +}; + +struct stateChangeNote { + IOPMPowerFlags stateFlags; + unsigned long stateNum; + void * powerRef; +}; +typedef struct stateChangeNote stateChangeNote; + +#endif /* KERNEL && __cplusplus */ +struct IOPowerStateChangeNotification { + void * powerRef; + unsigned long returnValue; + unsigned long stateNumber; + IOPMPowerFlags stateFlags; +}; +typedef struct IOPowerStateChangeNotification IOPowerStateChangeNotification; +typedef IOPowerStateChangeNotification sleepWakeNote; + +/*! @struct IOPMSystemCapabilityChangeParameters + * @abstract A structure describing a system capability change. + * @discussion A system capability change is a system level transition from a set + * of system capabilities to a new set of system capabilities. Power management + * sends a kIOMessageSystemCapabilityChange message and provides + * this structure as the message data (by reference) to + * gIOPriorityPowerStateInterest clients when system capability + * changes. + * @field notifyRef An identifier for this message notification. Clients with pending + * I/O can signal completion by calling allowPowerChange() with this + * value as the argument. Clients that are able to process the notification + * synchronously should ignore this field. + * @field maxWaitForReply A return value to the caller indicating the maximum time in + * microseconds to wait for the allowPowerChange() call. The default + * value is zero, which indicates the client processing has finished, and power + * management should not wait for an allowPowerChange() call. + * @field changeFlags Flags will be set to indicate whether the notification precedes + * the capability change (kIOPMSystemCapabilityWillChange), or after + * the capability change has occurred (kIOPMSystemCapabilityDidChange). + * @field __reserved1 Set to zero. + * @field fromCapabilities The system capabilities at the start of the transition. + * @field toCapabilities The system capabilities at the end of the transition. + * @field __reserved2 Set to zero. + */ +struct IOPMSystemCapabilityChangeParameters { + uint32_t notifyRef; + uint32_t maxWaitForReply; + uint32_t changeFlags; + uint32_t __reserved1; + uint32_t fromCapabilities; + uint32_t toCapabilities; + uint32_t __reserved2[4]; +}; + +/*! @enum IOPMSystemCapabilityChangeFlags + * @constant kIOPMSystemCapabilityWillChange Indicates the system capability will change. + * @constant kIOPMSystemCapabilityDidChange Indicates the system capability has changed. + */ +enum { + kIOPMSystemCapabilityWillChange = 0x01, + kIOPMSystemCapabilityDidChange = 0x02 +}; + +enum { + kIOPMSystemCapabilityCPU = 0x01, + kIOPMSystemCapabilityGraphics = 0x02, + kIOPMSystemCapabilityAudio = 0x04, + kIOPMSystemCapabilityNetwork = 0x08 +}; + +#endif /* ! _IOKIT_IOPM_H */ diff --git a/QualcommWireless/include/IOKit/pwr_mgt/IOPMLibDefs.h b/QualcommWireless/include/IOKit/pwr_mgt/IOPMLibDefs.h new file mode 100644 index 0000000..7caa525 --- /dev/null +++ b/QualcommWireless/include/IOKit/pwr_mgt/IOPMLibDefs.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + + +#define kPMSetAggressiveness 0 +#define kPMGetAggressiveness 1 +#define kPMSleepSystem 2 +#define kPMAllowPowerChange 3 +#define kPMCancelPowerChange 4 +#define kPMShutdownSystem 5 +#define kPMRestartSystem 6 +#define kPMSleepSystemOptions 7 +#define kPMSetMaintenanceWakeCalendar 8 +#define kPMSetUserAssertionLevels 9 +#define kPMActivityTickle 10 +#define kPMGetSystemSleepType 11 +#define kPMSetClamshellSleepState 12 +#define kPMSleepWakeWatchdogEnable 13 +#define kPMSleepWakeDebugTrig 14 +#define kPMSetDisplayPowerOn 15 + +#define kNumPMMethods 16 diff --git a/QualcommWireless/include/IOKit/pwr_mgt/IOPMPowerSource.h b/QualcommWireless/include/IOKit/pwr_mgt/IOPMPowerSource.h new file mode 100644 index 0000000..c248941 --- /dev/null +++ b/QualcommWireless/include/IOKit/pwr_mgt/IOPMPowerSource.h @@ -0,0 +1,303 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOPMPowerSource_h_ +#define _IOPMPowerSource_h_ + +#include +#include +#include +#include +#include + +enum { + kSecondsPerHour = 3600, + kTenMinutesInSeconds = 600 +}; + + +/*! @class IOPMPowerSource + * + * See IOKit/pwr_mgt/IOPM.h for power source keys relevant to this class. These + * report-type keys are required for calls to IOPMPowerSource::setReportables(), + * and they define the IORegistry interface through which data is passed back + * up to the rest of the system. + * + * A subclassing driver that doesn't want to do anything fancy should: + * 1. Subclass IOPMPowerSource + * 2. Install its own battery change notifications or polling routine that can + * converse with actual battery hardware. + * 3. When battery state changes, change the relevant member variables + * through setCurrentCapacity() style accessors. + * 4. Call updateStatus() on itself when all such settings have been updated. + * + * The subclass driver should also initially populate its settings and call + * updateStatus() on launch. + * + * + * Settings: + * + *
+ * ExternalConnected
+ * Type: bool
+ * IORegistry Key: kIOPMPSExternalConnectedKey
+ * True if computer is drawing external power
+ *
+ * ExternalChargeCapable
+ * Type: bool
+ * IORegistry Key: kIOPMPSExternalChargeCapableKey
+ * True if external power is capable of charging internal battery
+ *
+ * BatteryInstalled
+ * Type: bool
+ * IORegistry Key: kIOPMPSBatteryInstalledKey
+ * True if a battery is present; false if removed
+ *
+ * IsCharging
+ * Type: bool
+ * IORegistry Key: kIOPMPSIsChargingKey
+ * True if battery is charging itself from external power
+ *
+ * AtWarnLevel
+ * Type: bool
+ * IORegistry Key: kIOPMPSAtWarnLevelKey
+ * True if draining battery capacity and past warn level
+ *
+ * AtCriticalLevel
+ * Type: bool
+ * IORegistry Key: kIOPMPSAtCriticalLevelKey
+ * True if draining battery capacity and past critical level
+ *
+ * CurrentCapacity
+ * MaxCapacity
+ * Type: unsigned int
+ * IORegistry Key: kIOPMPSCurrentCapacityKey, kIOPMPSMaxCapacityKey
+ * Capacity measured in mAh
+ *
+ * TimeRemaining
+ * Type: int
+ * IORegistry Key: kIOPMPSTimeRemainingKey
+ * Time remaining measured in minutes
+ *
+ * Amperage
+ * Type: int
+ * IORegistry Key: kIOPMPSAmperageKey
+ * Current is measured in mA
+ *
+ * Voltage
+ * Type: unsigned int
+ * IORegistry Key: kIOPMPSVoltageKey
+ * Voltage measured in mV
+ *
+ * CycleCount
+ * Type: unsigned int
+ * IORegistry Key: kIOPMPSCycleCountKey
+ * Number of charge/discharge cycles
+ *
+ * AdapterInfo
+ * Type: int
+ * IORegistry Key: kIOPMPSAdapterInfoKey
+ * Power adapter information
+ *
+ * Location
+ * Type: int
+ * IORegistry Key: kIOPMPSLocationKey
+ * Clue about battery's location in machine - Left vs. Right
+ *
+ * ErrorCondition
+ * Type: OSSymbol
+ * IORegistry Key: kIOPMPSErrorConditionKey
+ * String describing error state of battery
+ *
+ * Manufacturer
+ * Type: OSSymbol
+ * IORegistry Key: kIOPMPSManufacturerKey
+ * String describing battery manufacturer
+ *
+ * Manufactured Date
+ * Type: unsigned 16-bit bitfield
+ * IORegistry Key: kIOPMPSManufactureDateKey
+ * Date is published in a bitfield per the Smart Battery Data spec rev 1.1
+ * in section 5.1.26
+ *   Bits 0...4 => day (value 1-31; 5 bits)
+ *   Bits 5...8 => month (value 1-12; 4 bits)
+ *   Bits 9...15 => years since 1980 (value 0-127; 7 bits)
+ *
+ * Model
+ * Type: OSSymbol
+ * IORegistry Key: kIOPMPSModelKey
+ * String describing model number
+ *
+ * Serial
+ * Type: OSSymbol
+ * IORegistry Key: kIOPMPSSerialKey
+ * String describing serial number or unique info
+ * The serial number published hear bears no correspondence to the Apple serial
+ * number printed on each battery. This is a manufacturer serial number with
+ * no correlation to the printed serial number.
+ *
+ * LegacyIOBatteryInfo
+ * Type: OSDictionary
+ * IORegistry Key: kIOPMPSLegacyBatteryInfoKey
+ * Dictionary conforming to the OS X 10.0-10.4
+ * 
+ */ + +class IOPMPowerSource : public IOService +{ + OSDeclareDefaultStructors(IOPMPowerSource); + + friend class IOPMPowerSourceList; + +protected: + +/*! @var settingsChangedSinceLastUpdate + * Used by subclasses to determine if any settings have been modified via the + * accessors below since last call to update(). true is settings have changed; + * false otherwise. + */ + bool settingsChangedSinceUpdate; + +/*! @var properties + * Stores power source state + */ + OSDictionary *properties; + + const OSSymbol *externalConnectedKey; + const OSSymbol *externalChargeCapableKey; + const OSSymbol *batteryInstalledKey; + const OSSymbol *chargingKey; + const OSSymbol *warnLevelKey; + const OSSymbol *criticalLevelKey; + const OSSymbol *currentCapacityKey; + const OSSymbol *maxCapacityKey; + const OSSymbol *timeRemainingKey; + const OSSymbol *amperageKey; + const OSSymbol *voltageKey; + const OSSymbol *cycleCountKey; + const OSSymbol *adapterInfoKey; + const OSSymbol *locationKey; + const OSSymbol *errorConditionKey; + const OSSymbol *manufacturerKey; + const OSSymbol *modelKey; + const OSSymbol *serialKey; + const OSSymbol *batteryInfoKey; + +// Tracking for IOPMPowerSourceList + IOPMPowerSource *nextInList; + +public: + +/*! @function powerSource + * @abstract Creates a new IOPMPowerSource nub. Must be attached to IORegistry, + * and registered by provider. + */ + static IOPMPowerSource *powerSource(void); + + virtual bool init(void) APPLE_KEXT_OVERRIDE; + + virtual void free(void) APPLE_KEXT_OVERRIDE; + +/*! @function updateStatus + * @abstract Must be called by physical battery controller when battery state + * has changed significantly. + * @discussion The system will not poll this object for battery updates. Rather \ + * the battery's controller must call updateStatus() every time state changes \ + * and the settings will be relayed to higher levels of power management. \ + * The subclassing driver should override this only if the driver needs to add \ + * new settings to the base class. + */ + virtual void updateStatus(void); + +/* Public accessors for battery state + */ + bool externalConnected(void); + bool externalChargeCapable(void); + bool batteryInstalled(void); + bool isCharging(void); + bool atWarnLevel(void); + bool atCriticalLevel(void); + + unsigned int currentCapacity(void); + unsigned int maxCapacity(void); + unsigned int capacityPercentRemaining(void); + int timeRemaining(void); + int amperage(void); + unsigned int voltage(void); + unsigned int cycleCount(void); + int adapterInfo(void); + int location(void); + + OSSymbol *errorCondition(void); + OSSymbol *manufacturer(void); + OSSymbol *model(void); + OSSymbol *serial(void); + OSDictionary *legacyIOBatteryInfo(void); + + OSObject *getPSProperty(const OSSymbol *); + +protected: + +/* Protected "setter" methods for subclasses + * Subclasses should use these setters to modify all battery properties. + * + * Subclasses must follow all property changes with a call to updateStatus() + * to flush settings changes to upper level battery API clients. + * + */ + void setExternalConnected(bool); + void setExternalChargeCapable(bool); + void setBatteryInstalled(bool); + void setIsCharging(bool); + void setAtWarnLevel(bool); + void setAtCriticalLevel(bool); + + void setCurrentCapacity(unsigned int); + void setMaxCapacity(unsigned int); + void setTimeRemaining(int); + void setAmperage(int); + void setVoltage(unsigned int); + void setCycleCount(unsigned int); + void setAdapterInfo(int); + void setLocation(int); + + void setErrorCondition(OSSymbol *); + void setManufacturer(OSSymbol *); + void setModel(OSSymbol *); + void setSerial(OSSymbol *); + void setLegacyIOBatteryInfo(OSDictionary *); + +/*! All of these methods funnel through the generic accessor method + * setPSProperty. Caller can pass in any arbitrary OSSymbol key, and + * that value will be stored in the PM settings dictionary, and relayed + * onto the IORegistry at update time. + */ + void setPSProperty(const OSSymbol *, OSObject *); +}; + +#endif diff --git a/QualcommWireless/include/IOKit/pwr_mgt/IOPMPowerSourceList.h b/QualcommWireless/include/IOKit/pwr_mgt/IOPMPowerSourceList.h new file mode 100644 index 0000000..e69663a --- /dev/null +++ b/QualcommWireless/include/IOKit/pwr_mgt/IOPMPowerSourceList.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#include +#include + +class IOPMPowerSource; + +class IOPMPowerSourceList : public OSObject +{ + OSDeclareDefaultStructors(IOPMPowerSourceList); +private: +// pointer to first power source in list + IOPMPowerSource *firstItem; + +// how many power sources are in the list + unsigned long length; + +public: + void initialize(void); + void free(void) APPLE_KEXT_OVERRIDE; + + unsigned long numberOfItems(void); + IOReturn addToList(IOPMPowerSource *newPowerSource); + IOReturn removeFromList(IOPMPowerSource *theItem); + + LIBKERN_RETURNS_NOT_RETAINED IOPMPowerSource *firstInList(void); + LIBKERN_RETURNS_NOT_RETAINED IOPMPowerSource *nextInList(IOPMPowerSource *currentItem); +}; diff --git a/QualcommWireless/include/IOKit/pwr_mgt/IOPMpowerState.h b/QualcommWireless/include/IOKit/pwr_mgt/IOPMpowerState.h new file mode 100644 index 0000000..1ca2452 --- /dev/null +++ b/QualcommWireless/include/IOKit/pwr_mgt/IOPMpowerState.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOPMPOWERSTATE_H +#define _IOKIT_IOPMPOWERSTATE_H + +#include + +/*! @header IOPMpowerState.h + * @abstract Defines the struct IOPMPowerState that power managed drivers should use to describe their power states. + */ + +/*! @struct IOPMPowerState + * @abstract Describes a device's power state. + * @discussion To take part in system power management, drivers should define an array of 2 or more power states and pass it to kernel power management through IOService::registerPowerDriver. + * @field version Defines version number of this struct. Just use the value "1" when defining an IOPMPowerState. + * @field capabilityFlags Describes the capability of the device in this state. + * @field outputPowerCharacter Describes the power provided in this state. + * @field inputPowerRequirement Describes the input power required in this state. + * @field staticPower Describes average consumption in milliwatts. Unused; drivers may specify 0. + * @field stateOrder Valid in version kIOPMPowerStateVersion2 or greater of this structure. Defines ordering of power states independently of the power state ordinal. + * @field powerToAttain Describes dditional power to attain this state from next lower state (in milliWatts). Unused; drivers may specify 0. + * @field timeToAttain Describes time required to enter this state from next lower state (in microseconds). Unused; drivers may specify 0. + * @field settleUpTime Describes settle time required after entering this state from next lower state (microseconds). Unused; drivers may specify 0. + * @field timeToLower Describes time required to enter next lower state from this one (microseconds). Unused; drivers may specify 0. + * @field settleDownTime Settle time required after entering next lower state from this state (microseconds). Unused; drivers may specify 0. + * @field powerDomainBudget Describes power in milliWatts a domain in this state can deliver to its children. Unused; drivers may specify 0. + * } + */ + +struct IOPMPowerState { + unsigned long version; + IOPMPowerFlags capabilityFlags; + IOPMPowerFlags outputPowerCharacter; + IOPMPowerFlags inputPowerRequirement; + unsigned long staticPower; + unsigned long stateOrder; + unsigned long powerToAttain; + unsigned long timeToAttain; + unsigned long settleUpTime; + unsigned long timeToLower; + unsigned long settleDownTime; + unsigned long powerDomainBudget; +}; + +typedef struct IOPMPowerState IOPMPowerState; + +enum { + kIOPMPowerStateVersion1 = 1, + kIOPMPowerStateVersion2 = 2 +}; + +#endif /* _IOKIT_IOPMPOWERSTATE_H */ diff --git a/QualcommWireless/include/IOKit/pwr_mgt/IOPowerConnection.h b/QualcommWireless/include/IOKit/pwr_mgt/IOPowerConnection.h new file mode 100644 index 0000000..67d84b3 --- /dev/null +++ b/QualcommWireless/include/IOKit/pwr_mgt/IOPowerConnection.h @@ -0,0 +1,167 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOPOWERCONNECTION_H +#define _IOKIT_IOPOWERCONNECTION_H + +#include +#include + +/*! @class IOPowerConnection + * Do not use IOPowerConnection. This class is an implementation detail defined + * for IOPM's management of the IORegistry IOPower plane. + * + * Only Kernel IOKit power management should reference the IOPowerConnection class. + */ + +class IOPowerConnection : public IOService +{ + OSDeclareDefaultStructors(IOPowerConnection); + +protected: +/*! @field parentKnowsState true: parent knows state of its domain + * used by child */ + bool stateKnown; + +/*! @field currentPowerFlags power flags which describe the current state of the power domain + * used by child */ + IOPMPowerFlags currentPowerFlags; + +/*! @field desiredDomainState state number which corresponds to the child's desire + * used by parent */ + unsigned long desiredDomainState; + +/*! @field requestFlag set to true when desiredDomainState is set */ + bool requestFlag; + +/*! @field preventIdleSleepFlag true if child has this bit set in its desired state + * used by parent */ + unsigned long preventIdleSleepFlag; + +/*! @field preventSystemSleepFlag true if child has this bit set in its desired state + * used by parent */ + unsigned long preventSystemSleepFlag; + +/*! @field awaitingAck true if child has not yet acked our notification + * used by parent */ + bool awaitingAck; + +/*! @field readyFlag true if the child has been added as a power child + * used by parent */ + bool readyFlag; + + +public: +/*! @function setParentKnowsState + * @abstract Sets the stateKnown variable. + * @discussion Called by the parent when the object is created and called by the child when it discovers that the parent now knows its state. */ + void setParentKnowsState(bool ); + +/*! @function setParentCurrentPowerFlags + * @abstract Sets the currentPowerFlags variable. + * @discussion Called by the parent when the object is created and called by the child when it discovers that the parent state is changing. */ + void setParentCurrentPowerFlags(IOPMPowerFlags ); + +/*! @function parentKnowsState + * @abstract Returns the stateKnown variable. */ + bool parentKnowsState(void ); + +/*! @function parentCurrentPowerFlags + * @abstract Returns the currentPowerFlags variable. */ + IOPMPowerFlags parentCurrentPowerFlags(void ); + +/*! @function setDesiredDomainState + * @abstract Sets the desiredDomainState variable. + * @discussion Called by the parent. */ + void setDesiredDomainState(unsigned long ); + +/*! @function getDesiredDomainState + * @abstract Returns the desiredDomainState variable. + * @discussion Called by the parent. */ + unsigned long getDesiredDomainState( void ); + +/*! @function setChildHasRequestedPower +* @abstract Set the flag that says that the child has called requestPowerDomainState. +* @discussion Called by the parent. */ + void setChildHasRequestedPower( void ); + +/*! @function childHasRequestedPower + * @abstract Return the flag that says whether the child has called requestPowerDomainState. + * @discussion Called by the PCI Aux Power Supply Driver to see if a device driver + * is power managed. */ + bool childHasRequestedPower( void ); + +/*! @function setPreventIdleSleepFlag + * @abstract Sets the preventIdleSleepFlag variable. + * @discussion Called by the parent. */ + void setPreventIdleSleepFlag(unsigned long ); + +/*! @function getPreventIdleSleepFlag + * @abstract Returns the preventIdleSleepFlag variable. + * @discussion Called by the parent. */ + bool getPreventIdleSleepFlag( void ); + +/*! @function setPreventSystemSleepFlag + * @abstract Sets the preventSystemSleepFlag variable. + * @discussion Called by the parent. */ + void setPreventSystemSleepFlag(unsigned long ); + +/*! @function getPreventSystemSleepFlag + * @abstract Returns the preventSystemSleepFlag variable. + * @discussion Called by the parent. */ + bool getPreventSystemSleepFlag( void ); + +/*! @function setAwaitingAck + * @abstract Sets the awaitingAck variable. + * @discussion Called by the parent. */ + void setAwaitingAck( bool ); + +/*! @function getAwaitingAck + * @abstract Returns the awaitingAck variable. + * @discussion Called by the parent. */ + bool getAwaitingAck( void ); + +/*! @function setReadyFlag + * @abstract Sets the readyFlag variable. + * @discussion Called by the parent. */ + void setReadyFlag( bool flag ); + +/*! @function getReadyFlag + * @abstract Returns the readyFlag variable. + * @discussion Called by the parent. */ + bool getReadyFlag( void ) const; +}; + +#endif /* ! _IOKIT_IOPOWERCONNECTION_H */ diff --git a/QualcommWireless/include/IOKit/pwr_mgt/RootDomain.h b/QualcommWireless/include/IOKit/pwr_mgt/RootDomain.h new file mode 100644 index 0000000..066b1f5 --- /dev/null +++ b/QualcommWireless/include/IOKit/pwr_mgt/RootDomain.h @@ -0,0 +1,353 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_ROOTDOMAIN_H +#define _IOKIT_ROOTDOMAIN_H + +#include +#include +#include +#include +#include + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +/*! + * Types for PM Assertions + * For creating, releasing, and getting PM assertion levels. + */ + +/*! IOPMDriverAssertionType + * A bitfield describing a set of assertions. May be used to specify which assertions + * to set with IOPMrootDomain::createPMAssertion; or to query which + * assertions are set with IOPMrootDomain::releasePMAssertion. + */ +typedef uint64_t IOPMDriverAssertionType; + +/* IOPMDriverAssertionID + * Drivers may create PM assertions to request system behavior (keep the system awake, + * or keep the display awake). When a driver creates an assertion via + * IOPMrootDomain::createPMAssertion, PM returns a handle to + * the assertion of type IOPMDriverAssertionID. + */ +typedef uint64_t IOPMDriverAssertionID; +#define kIOPMUndefinedDriverAssertionID 0 + +/* IOPMDriverAssertionLevel + * Possible values for IOPMDriverAssertionLevel are kIOPMDriverAssertionLevelOff + * and kIOPMDriverAssertionLevelOn + */ +typedef uint32_t IOPMDriverAssertionLevel; +#define kIOPMDriverAssertionLevelOff 0 +#define kIOPMDriverAssertionLevelOn 255 + +/* + * Flags for get/setSleepSupported() + */ +enum { + kRootDomainSleepNotSupported = 0x00000000, + kRootDomainSleepSupported = 0x00000001, + kFrameBufferDeepSleepSupported = 0x00000002, + kPCICantSleep = 0x00000004 +}; + +/* + * IOPMrootDomain registry property keys + */ +#define kRootDomainSupportedFeatures "Supported Features" +#define kRootDomainSleepReasonKey "Last Sleep Reason" +#define kRootDomainSleepOptionsKey "Last Sleep Options" +#define kIOPMRootDomainWakeReasonKey "Wake Reason" +#define kIOPMRootDomainWakeTypeKey "Wake Type" +#define kIOPMRootDomainPowerStatusKey "Power Status" + +/* + * Possible sleep reasons found under kRootDomainSleepReasonsKey + */ +#define kIOPMClamshellSleepKey "Clamshell Sleep" +#define kIOPMPowerButtonSleepKey "Power Button Sleep" +#define kIOPMSoftwareSleepKey "Software Sleep" +#define kIOPMOSSwitchHibernationKey "OS Switch Sleep" +#define kIOPMIdleSleepKey "Idle Sleep" +#define kIOPMLowPowerSleepKey "Low Power Sleep" +#define kIOPMThermalEmergencySleepKey "Thermal Emergency Sleep" +#define kIOPMMaintenanceSleepKey "Maintenance Sleep" + +/* + * String constants for communication with PM CPU + */ +#define kIOPMRootDomainLidCloseCString "LidClose" +#define kIOPMRootDomainBatPowerCString "BatPower" + +/* + * Supported Feature bitfields for IOPMrootDomain::publishFeature() + */ +enum { + kIOPMSupportedOnAC = (1 << 0), + kIOPMSupportedOnBatt = (1 << 1), + kIOPMSupportedOnUPS = (1 << 2) +}; + +typedef IOReturn (*IOPMSettingControllerCallback) +(OSObject *target, const OSSymbol *type, + OSObject *val, uintptr_t refcon); + +__BEGIN_DECLS +IONotifier * registerSleepWakeInterest( + IOServiceInterestHandler, void *, void * = NULL); + +IONotifier * registerPrioritySleepWakeInterest( + IOServiceInterestHandler handler, + void * self, void * ref = NULL); + +IOReturn acknowledgeSleepWakeNotification(void * ); + +IOReturn vetoSleepWakeNotification(void * PMrefcon); +__END_DECLS + +#define IOPM_ROOTDOMAIN_REV 2 + +class IOPMrootDomain : public IOService +{ + OSDeclareFinalStructors(IOPMrootDomain); + +public: + static IOPMrootDomain * construct( void ); + + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setAggressiveness( unsigned long, unsigned long ) APPLE_KEXT_OVERRIDE; + virtual IOReturn getAggressiveness( unsigned long, unsigned long * ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn sleepSystem( void ); + IOReturn sleepSystemOptions( OSDictionary *options ); + + virtual IOReturn setProperties( OSObject * ) APPLE_KEXT_OVERRIDE; + virtual bool serializeProperties( OSSerialize * s ) const APPLE_KEXT_OVERRIDE; + virtual OSObject * copyProperty( const char * aKey ) const APPLE_KEXT_OVERRIDE; + +/*! @function systemPowerEventOccurred + * @abstract Other drivers may inform IOPMrootDomain of system PM events + * @discussion systemPowerEventOccurred is a richer alternative to receivePowerNotification() + * Only Apple-owned kexts should have reason to call systemPowerEventOccurred. + * @param event An OSSymbol describing the type of power event. + * @param intValue A 32-bit integer value associated with the event. + * @result kIOReturnSuccess on success */ + + IOReturn systemPowerEventOccurred( + const OSSymbol *event, + uint32_t intValue ); + + IOReturn systemPowerEventOccurred( + const OSSymbol *event, + OSObject *value ); + + void claimSystemWakeEvent( IOService *device, + IOOptionBits flags, + const char *reason, + OSObject *details = NULL ); + + virtual IOReturn receivePowerNotification( UInt32 msg ); + + virtual void setSleepSupported( IOOptionBits flags ); + + virtual IOOptionBits getSleepSupported( void ); + + void wakeFromDoze( void ); + + void requestUserActive(IOService *driver, const char *reason); + +// KEXT driver announces support of power management feature + + void publishFeature( const char *feature ); + +// KEXT driver announces support of power management feature +// And specifies power sources with kIOPMSupportedOn{AC/Batt/UPS} bitfield. +// Returns a unique uint32_t identifier for later removing support for this +// feature. +// NULL is acceptable for uniqueFeatureID for kexts without plans to unload. + + void publishFeature( const char *feature, + uint32_t supportedWhere, + uint32_t *uniqueFeatureID); + +// KEXT driver announces removal of a previously published power management +// feature. Pass 'uniqueFeatureID' returned from publishFeature() + + IOReturn removePublishedFeature( uint32_t removeFeatureID ); + +/*! @function copyPMSetting + * @abstract Copy the current value for a PM setting. Returns an OSNumber or + * OSData depending on the setting. + * @param whichSetting Name of the desired setting. + * @result OSObject value if valid, NULL otherwise. */ + + OSObject * copyPMSetting( OSSymbol *whichSetting ); + +/*! @function registerPMSettingController + * @abstract Register for callbacks on changes to certain PM settings. + * @param settings NULL terminated array of C strings, each string for a PM + * setting that the caller is interested in and wants to get callbacks for. + * @param callout C function ptr or member function cast as such. + * @param target The target of the callback, usually 'this' + * @param refcon Will be passed to caller in callback; for caller's use. + * @param handle Caller should keep the OSObject * returned here. If non-NULL, + * handle will have a retain count of 1 on return. To deregister, pass to + * unregisterPMSettingController() + * @result kIOReturnSuccess on success. */ + + IOReturn registerPMSettingController( + const OSSymbol *settings[], + IOPMSettingControllerCallback callout, + OSObject *target, + uintptr_t refcon, + OSObject **handle); // out param + +/*! @function registerPMSettingController + * @abstract Register for callbacks on changes to certain PM settings. + * @param settings NULL terminated array of C strings, each string for a PM + * setting that the caller is interested in and wants to get callbacks for. + * @param supportedPowerSources bitfield indicating which power sources these + * settings are supported for (kIOPMSupportedOnAC, etc.) + * @param callout C function ptr or member function cast as such. + * @param target The target of the callback, usually 'this' + * @param refcon Will be passed to caller in callback; for caller's use. + * @param handle Caller should keep the OSObject * returned here. If non-NULL, + * handle will have a retain count of 1 on return. To deregister, pass to + * unregisterPMSettingController() + * @result kIOReturnSuccess on success. */ + + IOReturn registerPMSettingController( + const OSSymbol *settings[], + uint32_t supportedPowerSources, + IOPMSettingControllerCallback callout, + OSObject *target, + uintptr_t refcon, + OSObject **handle); // out param + + virtual IONotifier * registerInterest( + const OSSymbol * typeOfInterest, + IOServiceInterestHandler handler, + void * target, void * ref = NULL ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn callPlatformFunction( + const OSSymbol *functionName, + bool waitForFunction, + void *param1, void *param2, + void *param3, void *param4 ) APPLE_KEXT_OVERRIDE; + +/*! @function createPMAssertion + * @abstract Creates an assertion to influence system power behavior. + * @param whichAssertionsBits A bitfield specify the assertion that the caller requests. + * @param assertionLevel An integer detailing the initial assertion level, kIOPMDriverAssertionLevelOn + * or kIOPMDriverAssertionLevelOff. + * @param ownerService A pointer to the caller's IOService class, for tracking. + * @param ownerDescription A reverse-DNS string describing the caller's identity and reason. + * @result On success, returns a new assertion of type IOPMDriverAssertionID + */ + IOPMDriverAssertionID createPMAssertion( + IOPMDriverAssertionType whichAssertionsBits, + IOPMDriverAssertionLevel assertionLevel, + IOService *ownerService, + const char *ownerDescription); + +/* @function setPMAssertionLevel + * @abstract Modify the level of a pre-existing assertion. + * @discussion Change the value of a PM assertion to influence system behavior, + * without undergoing the work required to create or destroy an assertion. Suggested + * for clients who will assert and de-assert needs for PM behavior several times over + * their lifespan. + * @param assertionID An assertion ID previously returned by createPMAssertion + * @param assertionLevel The new assertion level. + * @result kIOReturnSuccess if it worked; kIOReturnNotFound or other IOReturn error on failure. + */ + IOReturn setPMAssertionLevel(IOPMDriverAssertionID assertionID, IOPMDriverAssertionLevel assertionLevel); + +/*! @function getPMAssertionLevel + * @absract Returns the active level of the specified assertion(s). + * @discussion Returns kIOPMDriverAssertionLevelOff or + * kIOPMDriverAssertionLevelOn. If multiple assertions are specified + * in the bitfield, only returns kIOPMDriverAssertionLevelOn + * if all assertions are active. + * @param whichAssertionBits Bits defining the assertion or assertions the caller is interested in + * the level of. If in doubt, pass kIOPMDriverAssertionCPUBit as the argument. + * @result Returns kIOPMDriverAssertionLevelOff or + * kIOPMDriverAssertionLevelOn indicating the specified assertion's levels, if available. + * If the assertions aren't supported on this machine, or aren't recognized by the OS, the + * result is undefined. + */ + IOPMDriverAssertionLevel getPMAssertionLevel(IOPMDriverAssertionType whichAssertionBits); + +/*! @function releasePMAssertion + * @abstract Removes an assertion to influence system power behavior. + * @result On success, returns a new assertion of type IOPMDriverAssertionID * + */ + IOReturn releasePMAssertion(IOPMDriverAssertionID releaseAssertion); + +/*! @function restartWithStackshot + * @abstract Take a stackshot of the system and restart the system. + * @result Return kIOReturnSuccess if it work, kIOReturnError if the service is not available. + */ + IOReturn restartWithStackshot(); + + IOReturn setWakeTime(uint64_t wakeContinuousTime); + +private: + unsigned long getRUN_STATE(void); + + virtual IOReturn changePowerStateTo( unsigned long ordinal ) APPLE_KEXT_COMPATIBILITY_OVERRIDE; + virtual IOReturn changePowerStateToPriv( unsigned long ordinal ); + virtual IOReturn requestPowerDomainState( IOPMPowerFlags, IOPowerConnection *, unsigned long ) APPLE_KEXT_OVERRIDE; + virtual void powerChangeDone( unsigned long ) APPLE_KEXT_OVERRIDE; + virtual bool tellChangeDown( unsigned long ) APPLE_KEXT_OVERRIDE; + virtual bool askChangeDown( unsigned long ) APPLE_KEXT_OVERRIDE; + virtual void tellChangeUp( unsigned long ) APPLE_KEXT_OVERRIDE; + virtual void tellNoChangeDown( unsigned long ) APPLE_KEXT_OVERRIDE; + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9 + virtual IOReturn configureReport(IOReportChannelList *channels, + IOReportConfigureAction action, + void *result, + void *destination) APPLE_KEXT_OVERRIDE; + virtual IOReturn updateReport(IOReportChannelList *channels, + IOReportUpdateAction action, + void *result, + void *destination) APPLE_KEXT_OVERRIDE; +#endif + + void configureReportGated(uint64_t channel_id, + uint64_t action, + void *result); + IOReturn updateReportGated(uint64_t ch_id, + void *result, + IOBufferMemoryDescriptor *dest); + +}; + + +#endif /* _IOKIT_ROOTDOMAIN_H */ diff --git a/QualcommWireless/include/IOKit/rtc/IORTCController.h b/QualcommWireless/include/IOKit/rtc/IORTCController.h new file mode 100644 index 0000000..876210e --- /dev/null +++ b/QualcommWireless/include/IOKit/rtc/IORTCController.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * 24 Nov 1998 suurballe Created. + */ +#ifndef _IORTCCONTROLLER_H +#define _IORTCCONTROLLER_H + +#include + +typedef void (*RTC_tick_handler)( IOService * ); + + +class IORTCController : public IOService +{ + OSDeclareAbstractStructors(IORTCController); + +public: + + virtual IOReturn getRealTimeClock( UInt8 * currentTime, IOByteCount * length ) = 0; + virtual IOReturn setRealTimeClock( UInt8 * newTime ) = 0; +}; + +class IORTC : public IOService +{ + OSDeclareAbstractStructors(IORTC); + +protected: + +/*! @var reserved + * Reserved for future use. (Internal use only) */ + struct ExpansionData { }; + ExpansionData *iortc_reserved __unused; + +public: + + virtual long getGMTTimeOfDay( void ) = 0; + virtual void setGMTTimeOfDay( long secs ) = 0; + + virtual void getUTCTimeOfDay( clock_sec_t * secs, clock_nsec_t * nsecs ); + virtual void setUTCTimeOfDay( clock_sec_t secs, clock_nsec_t nsecs ); + + virtual void setAlarmEnable( IOOptionBits message ) = 0; + + virtual IOReturn getMonotonicClockOffset( int64_t * usecs ); + virtual IOReturn setMonotonicClockOffset( int64_t usecs ); + virtual IOReturn getMonotonicClockAndTimestamp( uint64_t * usecs, uint64_t *mach_absolute_time ); + + + OSMetaClassDeclareReservedUnused(IORTC, 0); + OSMetaClassDeclareReservedUnused(IORTC, 1); + OSMetaClassDeclareReservedUnused(IORTC, 2); + OSMetaClassDeclareReservedUnused(IORTC, 3); + OSMetaClassDeclareReservedUnused(IORTC, 4); + OSMetaClassDeclareReservedUnused(IORTC, 5); + OSMetaClassDeclareReservedUnused(IORTC, 6); + OSMetaClassDeclareReservedUnused(IORTC, 7); +}; + +#endif /* !_IORTCCONTROLLER_H */ diff --git a/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2LSIWorkaroundDescriptor.h b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2LSIWorkaroundDescriptor.h new file mode 100644 index 0000000..178ef00 --- /dev/null +++ b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2LSIWorkaroundDescriptor.h @@ -0,0 +1,292 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#if __ppc__ + +/*! + @header IOFireWireSBP2LSIWorkaroundDescriptor + Contains the class definition for IOFireWireSBP2LSIWorkaroundDescriptor. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2LSIWORKAROUNDDESCRIPTOR_H +#define _IOKIT_IOFIREWIRESBP2LSIWORKAROUNDDESCRIPTOR_H + +#include + +class IOFireWireSBP2LSIRange; + +/*! + @class IOFireWireSBP2LSIWorkaroundDescriptor + @abstract This is a subclass of IOGeneralMemoryDescriptor. It is designed to work around + a hardware problem in a common SBP2 target. It takes a memory descriptor as + an argument. It retains this descriptor and returns a new one with resegmented + physical segments and potentially some "unfixable" segments double buffered. + + If the transfer will cause data to be sent from the Mac, syncBuffersForOutput + must be called before the transfer. + + If the transfer will cause data to be recieve by the Mac, syncBuffersForInput + must be called after the transfer. + + This class calculates the new segmentation only once when it is created. + Any changes to the structure of the original memory descriptor will render + this one useless. It must be released and a new IOFireWireSBP2LSIWorkaroundDescriptor + can be created. + + LSI Bridge Workaround Algorithm Details + + Goals: + 1. Avoid LSI Logic "< 16 byte" bug - prevent any data packet smaller than 16 bytes + 2. Minimize double-buffering + 3. Support non-multiple-of-512-byte devices, e.g. CD Audio + + Solution: + Write a page table such that the bridge will nor use packets smaller than 16 bytes. + In other words, rearrange the memory descriptor to avoid the bug, and do it such + that the SBP-2 layer will not break up a segment (du ro the 64k-1 limit) and + re-introduces the problem + + SBP-2 defines the kFWSBP2MaxPageClusterSize constant. We simply make sure + none of our segments are larger than this size and SBP-2 will not break them + up when it writes the SBP-2 page table. + + Notes: + - Some double buffering is unavoidable. Discontiguous pages may yield page + fragments at the start or end of the buffer (or both, with non-512x buffers). + solution uses less than 33 bytes of double-buffer per segment in original + memory descriptor. + - If driver must break up IO to meet ATA limit of 255 (250?) blocks, assume + the driver does this at a higher level (before applying workaround). + - It is expected that the original memory descriptor has been prepared (wired) +*/ + +class IOFireWireSBP2LSIWorkaroundDescriptor : public IOGeneralMemoryDescriptor +{ + OSDeclareDefaultStructors(IOFireWireSBP2LSIWorkaroundDescriptor) + + friend class IOFireWireSBP2LSIRange; + +protected: + + // reserved for future use + struct ExpansionData { }; + ExpansionData *reserved; + + bool fFixedCapacity; // for both allocators + + ////////////////////////////////////// + // for range allocator + + OSArray * fPermanentRanges; + UInt32 fAllocatedRangesCount; + + virtual IOReturn rangeAllocatorInitialize( UInt32 rangeCount ); + virtual void rangeAllocatorDeallocateAllRanges( void ); + virtual IOFireWireSBP2LSIRange * rangeAllocatorNewRange( void ); + virtual void rangeAllocatorFree( void ); + + ////////////////////////////////////// + // for buffer allocator + + OSArray * fBufferDescriptors; + UInt32 fPermanentPages; + IOByteCount fAllocatedBytesCount; + + virtual IOReturn bufferAllocatorInitialize( IOByteCount requestedBufferSize ); + virtual void bufferAllocatorDeallocateAllBuffers( void ); + virtual void * bufferAllocatorNewBuffer( IOPhysicalAddress * address ); + virtual void bufferAllocatorFree( void ); + + ////////////////////////////////////// + // for range table allocator + + IOPhysicalRange * fRangeTable; + IOByteCount fRangeTableSize; + + virtual IOReturn rangeTableAllocatorInitialize( UInt32 requestedBufferSize ); + virtual IOPhysicalRange * rangeTableAllocatorNewTable( UInt32 entries ); + virtual void rangeTableAllocatorFree( void ); + + ////////////////////////////////////// + // for workaround + + IOMemoryDescriptor * fOriginalDesc; + OSArray * fRanges; + IOByteCount fOffset; + IOByteCount fLength; + IODirection fDirection; + + + virtual bool initWithCapacity + ( UInt32 permanentRanges, IOByteCount permanentBufferSpace, bool fixedCapacity ); + + virtual void free(); + + virtual IOReturn resetToInitialCapacity( void ); + virtual IOReturn initializeRangesArray( void ); + virtual IOReturn recalculateSmallSegments( void ); + virtual IOReturn splitLargeSegments( void ); + virtual IOReturn resegmentOddLengthSegments( void ); + virtual IOReturn initializeBuffers( void ); + + virtual bool initWithAddress( void * address, /* not supported */ + IOByteCount withLength, + IODirection withDirection ); + + virtual bool initWithAddress( vm_address_t address, /* not supported */ + IOByteCount withLength, + IODirection withDirection, + task_t withTask ); + + virtual bool initWithPhysicalAddress( + IOPhysicalAddress address, /* not supported */ + IOByteCount withLength, + IODirection withDirection ); + + virtual bool initWithPhysicalRanges( + IOPhysicalRange * ranges, /* not supported */ + UInt32 withCount, + IODirection withDirection, + bool asReference = false ); + + virtual bool initWithRanges( IOVirtualRange * ranges, /* not supported */ + UInt32 withCount, + IODirection withDirection, + task_t withTask, + bool asReference = false ); + +public: + + // static factory methods and intializers + + // + // create a new instance + // + + + /*! + @function withDescriptor + @abstract Creates a new IOFireWireSBP2LSIWorkaroundDescriptor. + @discussion Create a IOFireWireSBP2LSIWorkaroundDescriptor with no permanent capacity then + inits it the given descriptor. This is basicly a short cut for calling + withCapacity( 0, 0, false) and the initWithDescriptor() + @param desc Original memory descriptor. + @param offset Offset of data to "fix" in bytes from beginning of descriptor. + @param len Length of data in bytes to "fix" + @param direction IODirection of data transfer. + @result Returns a new IOFireWireSBP2LSIWorkaroundDescriptor if successful. + */ + + static IOFireWireSBP2LSIWorkaroundDescriptor * withDescriptor + ( IOMemoryDescriptor * desc, IOByteCount offset = 0, + IOByteCount len = 0, IODirection direction = kIODirectionOutIn ); + + // initialize with descriptor + + /*! + @function initWithDescriptor + @abstract Initialize an IOFireWireSBP2LSIWorkaroundDescriptor with the given descriptor. + @discussion Initialize the workaround descriptor with the given descriptor. + @param desc Original memory descriptor. + @param offset Offset of data to "fix" in bytes from beginning of descriptor. + @param len Length of data in bytes to "fix" + @param direction IODirection of data transfer. + @result Returns true if the initialization was successful. + */ + + virtual bool initWithDescriptor( IOMemoryDescriptor * desc, IOByteCount offset = 0, + IOByteCount len = 0, IODirection direction = kIODirectionOutIn ); + + + /////////////////////////////////// + + + /*! + @function withCapacity + @abstract Create a new descriptor with possibly a permanent capacity. + @discussion Create and IOFireWireSBP2LSIWorkaroundDescriptor with a permanent fixed capacity. + You should call initWithDescriptor afterward. permanentRanges is number of ranges to keep + permanently allocated for use by the algorithm. If fixedCapacity is false additional ranges + may be allocated and deallocated dyanmicly if needed. The algorithm may require more or less + ranges than either the original descriptor or the final fixed may decriptor contain. + permanentBufferSpace is the number of bytes of permanent buffer to keep arround. If fixedCapacity + is false additional buffer space may be allocated and deallocated dynamically. permanentBufferSpace + should generally be set to 32 * maximum number of ranges. fixedCapacity is a flag indicating + whether dynamic allocations are allowed. When making decisions about the maximum amount of + buffer space to keep around, it should be noted tha the maximum number of ranges maybe different + from permanentRanges if fixedCapcity is false. + @param permanentRanges Count of permanent ranges. + @param permanentBufferSpace Byte count of permanent buffers. + @param fixedCapacity bool indicating if dynamic allocations can be made. + @result Returns true if the initialization was successful. + */ + + static IOFireWireSBP2LSIWorkaroundDescriptor * withCapacity + ( UInt32 permanentRanges, IOByteCount permanentBufferSpace, bool fixedCapacity ); + + + /////////////////////////////////// + + // + // manipulate buffers for IO + // + + /*! + @function syncBuffersForOutput + @abstract Synchronize the buffers for output. + @discussion Since double buffering may be invovled in the workaround. The driver needs to + indicate when these buffers should be syncronized with the original descriptor. For data + that will be output syncBuffersForOutput should be called before submiting the ORB. + @result Returns kIOReturnSuccess if sync was successful. + */ + + virtual IOReturn syncBuffersForOutput( void ); // call before output + + /*! + @function syncBuffersForInput + @abstract Synchronize the buffers for input. + @discussion Since double buffering may be invovled in the workaround. The driver needs to + indicate when these buffers should be syncronized with the original descriptor. For data + that will be input syncBuffersForOutput should be called after receiving completion status + for the ORB. + @result Returns kIOReturnSuccess if sync was successful. + */ + + virtual IOReturn syncBuffersForInput( void ); // call after input + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 0); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 8); + +}; + +#endif + +#endif diff --git a/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2LUN.h b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2LUN.h new file mode 100644 index 0000000..e6c97de --- /dev/null +++ b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2LUN.h @@ -0,0 +1,270 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2LUN + Contains the class definition for IOFireWireSBP2LUN. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2LUN_H +#define _IOKIT_IOFIREWIRESBP2LUN_H + +#include +#include + +#include + +#include +#include + +class IOFireWireSBP2Target; + +/*! + @class IOFireWireSBP2LUN + @abstract Provider for most drivers. + @discussion IOFireWireSBP2LUN objects are created by IOFireWireSBP2Target objects. Each target may have zero or more IOFireWireSBP2LUN children. The LUN object serves as the matching nub for most drivers and therefore will be the provider for most drivers. It supplies the methods that control the operation of the LUN as a whole. Methods that control the behavior and execution of an SBP2 login session are supplied in a separate IOFireWireSBP2Login object. The LUN can be used to create one of these login objects. + The LUN can also create IOFireWireSBP2ManagementORBs for configuring and appending non-login related management functions. Login related management functions (ie. Login, Logout, Reconnect) are supplied by the IOFireWireSBP2Login. + Finally the LUN can supply a reference to the IOFireWireUnit. This can be useful if a driver wishes to access the standard FireWire APIs. +*/ + +class IOFireWireSBP2LUN : public IOService +{ + OSDeclareDefaultStructors( IOFireWireSBP2LUN ); + + friend class IOFireWireSBP2ManagementORB; + friend class IOFireWireSBP2Login; + friend class IOFireWireSBP2UserClient; + +protected: + + // reserved for future use + struct ExpansionData { }; + ExpansionData *reserved; + + //////////////////////////////////////////// + // methods called by friend classes + + // IOFireWireSBP2Login methods + virtual void removeLogin( IOFireWireSBP2Login * login ); + virtual IOFireWireSBP2Target * getTarget( void ); + + // IOFireWireSBP2ManagementORB methods + virtual void clearAllTasksInSet( void ); // assumes caller is on workloop + virtual void removeManagementORB( IOFireWireSBP2ManagementORB * orb ); + + // IOFireWireSBP2UserClient methods + virtual void flushAllManagementORBs( void ); + +public: + + //////////////////////////////////////////// + // IOService overrides + + /*! @function attach + @abstract Attaches an IOService client to a provider in the registry. + @discussion See IOService for discussion. + @param provider The IOService object which will serve as this objects provider. + @result false if the provider is inactive or on a resource failure, otherwise true. + */ + + virtual bool attach( IOService *provider ); + + /*! @function handleOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result Return true if the open was successful, false otherwise. */ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + /*! + @function handleClose + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of handleOpen. + */ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + /*! + @function matchPropertyTable + @abstract Implements SBP2 specific matching. + @discussion See IOService for discussion. + @param table The dictionary of properties to be matched against. + @result Returns false if the family considers the matching dictionary does not match in properties it understands, true otherwise. + */ + + virtual bool matchPropertyTable(OSDictionary * table); + +protected: + + //////////////////////////////////////////// + // private fields + + IOFireWireSBP2Target * fProviderTarget; + UInt32 fLUNumber; + OSSet * fLoginSet; + OSIterator * fLoginSetIterator; + IOCommandGate * fGate; + OSSet * fORBSet; + OSIterator * fORBSetIterator; + OSObject * fDiagnostics; + + //////////////////////////////////////////// + // private methods + + // IOService methods + virtual void free( void ); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + + // create management orb internals + static IOReturn staticCreateManagementORBAction( OSObject *self, + void * refCon, + void * completion, + void * orb, + void * ); + virtual IOReturn createManagementORBAction( void * refCon, + FWSBP2ManagementCallback completion, + IOFireWireSBP2ManagementORB ** orb ); + + // remove management orb internals + static IOReturn staticRemoveManagementORBAction( OSObject * self, void * orb, + void *, void *, void * ); + virtual IOReturn removeManagementORBAction( IOFireWireSBP2ManagementORB * orb ); + + // flush all management orb internals + static IOReturn staticExecuteFlushAllMgmtORBs( OSObject * self, void *, + void *, void *, void * ); + virtual IOReturn executeFlushAllMgmtORBs( void ); + + // IOFireWireSBP2ManagementORB friend class wrappers + virtual bool initMgmtORBWithLUN( IOFireWireSBP2ManagementORB * orb, IOFireWireSBP2LUN * lun, + void * refCon, + FWSBP2ManagementCallback completion ); + + // IOFireWireSBP2Login friend class wrappers + virtual bool initLoginWithLUN( IOFireWireSBP2Login * login, IOFireWireSBP2LUN * lun ); + virtual void suspendedNotify( void ); + virtual void resumeNotify( void ); + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 0); + +public: + + //////////////////////////////////////////// + // client methods + + // getters + + /*! + @function getFireWireUnit + @abstract Returns an IOFireWireUnit object. + @discussion An IOFireWireUnit is the provider of an IOFireWireSBP2Target. In order to + use the base FireWire services you will need a reference to the unit. This method + returns that reference. + @result Returns a pointer to an IOFireWireUnit. + */ + + virtual IOFireWireUnit * getFireWireUnit( void ); + + /*! + @function getLUNumber + @abstract Returns the LUNs number. + @discussion Each LUN has a number to uniquely identify it on a device. This method returns + this value in a UInt32. + @result Returns a UInt32 containing the Logical Unit Number. + */ + + virtual UInt32 getLUNumber( void ); + + // factory methods + + /*! + @function createLogin + @abstract Creates a new IOFireWireSBP2Login object. + @discussion Creates a new IOFireWireSBP2Login object for the LUN. Login objects supply most + of the SBP2 APIs related to login maintenance and Normal Command ORB execution. + @result Returns a pointer to a new IOFireWireSBP2Login. + */ + + virtual IOFireWireSBP2Login *createLogin( void ); + + /*! + @function createManagementORB + @abstract Creates a new IOFireWireSBP2ManagementORB object. + @discussion Creates a new IOFireWireSBP2ManagementORB object. Management objects let you + execute commands like QueryLogins, LogicalUnitReset, and AbortTask. These commands are + configured after they are created here. When they are done executing (after a call to submit) + the supplied completion routine will be called with the supplied refcon. Usually this refCon + is the "this" pointer of completion method's object. + @param refCon The refcon passed to the completion routine. + @param completion The completion routine. Called when the ORB finishes execution. + @result Returns a pointer to a new IOFireWireSBP2Login. + */ + + virtual IOFireWireSBP2ManagementORB * createManagementORB( void * refCon, FWSBP2ManagementCallback completion ); + +protected: + + static IOReturn staticCreateLogin( OSObject *self, void * login, void *, void *, void * ); + virtual IOReturn createLoginAction( IOFireWireSBP2Login ** login ); + + static IOReturn staticRemoveLoginAction( OSObject *self, void * login, void *, void *, void * ); + virtual IOReturn removeLoginAction( IOFireWireSBP2Login * login ); + +public: + + /*! + @function getDiagnostics + @abstract Debug-only method. + @discussion Returns a reference to the internal diagnostics object when the services are built + in debug mode. Should be a no-op in release builds. + @result Returns a pointer to the diagnostics object (if any). + */ + + virtual OSObject * getDiagnostics( void ); + + virtual bool finalize( IOOptionBits options ); + +protected: + + void terminateNotify( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 8); + +}; + +#endif \ No newline at end of file diff --git a/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2Login.h b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2Login.h new file mode 100644 index 0000000..42a838c --- /dev/null +++ b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2Login.h @@ -0,0 +1,1078 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2Login + Contains the class definition for IOFireWireSBP2Login. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2LOGIN_H +#define _IOKIT_IOFIREWIRESBP2LOGIN_H + +#include + +#include + +#include +#include + +// login option flags +enum +{ + kFWSBP2DontSynchronizeMgmtAgent = (1 << 0), + kFWSBP2ExclusiveLogin = (1 << 5) +}; + +// notification events +enum +{ + kFWSBP2NormalCommandStatus = 6, + kFWSBP2NormalCommandTimeout = 7, + kFWSBP2UnsolicitedStatus = 8, + kFWSBP2NormalCommandReset = 9 +}; + +#define kIOMessageFWSBP2ReconnectComplete iokit_fw_err(0x3E8) +#define kIOMessageFWSBP2ReconnectFailed iokit_fw_err(0x3E9) + +/*! + @typedef FWSBP2LoginResponse + @param length Length of login response. + @param loginID Unique id representing this login. + @param commandBlockAgentAddressHi High 32 bits of command block agent address. + @param commandBlockAgentAddressLo Low 32 bits of command block agent address. + @param reserved Reserved. + @param reconnectHold Reconnect timeout encoded as 2^reconnectHold seconds. +*/ + +typedef struct +{ + UInt16 length; + UInt16 loginID; + UInt32 commandBlockAgentAddressHi; + UInt32 commandBlockAgentAddressLo; + UInt16 reserved; + UInt16 reconnectHold; +} FWSBP2LoginResponse, *FWSBP2LoginResponsePtr; + +/*! + @typedef FWSBP2StatusBlock + @param details Src, Resp, D, Len fields of status block format + @param sbpStatus SBP2 specific status + @param orbOffsetHi High 32 bits of address of orb status is for. + @param orbOffsetLo Low 32 bits of address of orb status is for. + @param status[6] Up to 48 bytes of additional data. Length is determined by len field. +*/ + +typedef struct +{ + UInt8 details; + UInt8 sbpStatus; + UInt16 orbOffsetHi; + UInt32 orbOffsetLo; + UInt32 status[6]; +} FWSBP2StatusBlock; + +class IOFireWireSBP2LUN; +class IOFireWireSBP2Login; + +// struct sent to login complete handler + +/*! + @typedef FWSBP2LoginCompleteParams + @param login Pointer to IOFireWireSBP2Login object. + @param generation FireWire generation value. + @param status Status of login attempt. + @param loginResponse Pointer to login response struct. + @param statusBlock Pointer to status block buffer. + @param statusBlockLength Length of entire status block. +*/ + +typedef struct +{ + IOFireWireSBP2Login * login; // login object this param is sent from + UInt32 generation; // generation this login was attempted in + + IOReturn status; // status of login attempt + + FWSBP2LoginResponsePtr loginResponse; // pointer to loginResponse buffer + FWSBP2StatusBlock * statusBlock; // pointer to statusBlock buffer + UInt32 statusBlockLength; // size of statusBlock buffer + +} FWSBP2LoginCompleteParams, *FWSBP2LoginCompleteParamsPtr; + +// struct sent to logout complete handler + +/*! + @typedef FWSBP2LogoutCompleteParams + @param login Pointer to IOFireWireSBP2Login object. + @param generation FireWire generation value. + @param status Status of login attempt. + @param statusBlock Pointer to status block buffer. + @param statusBlockLength Length of entire status block. +*/ + +typedef struct +{ + IOFireWireSBP2Login * login; // login object this param is sent from + UInt32 generation; // generation this login was attempted in + + IOReturn status; // status of login attempt + + FWSBP2StatusBlock * statusBlock; // pointer to statusBlock buffer + UInt32 statusBlockLength; // size of statusBlock buffer + +} FWSBP2LogoutCompleteParams, *FWSBP2LogoutCompleteParamsPtr; + +// struct sent with reconnect notification + +/*! + @typedef FWSBP2LogoutCompleteParams + @param login Pointer to IOFireWireSBP2Login object. + @param generation FireWire generation value. + @param status Status of login attempt. + @param reconnectStatusBlock Pointer to status block buffer. + @param reconnectStatusBlockLength Length of entire status block. +*/ + +typedef struct +{ + IOFireWireSBP2Login * login; // login object this param is sent from + UInt32 generation; // generation this login was attempted in + + IOReturn status; // status of reconnect attempt + + void * reconnectStatusBlock; // pointer to statusBlock buffer + UInt32 reconnectStatusBlockLength; // size of statusBlock buffer +} FWSBP2ReconnectParams, *FWSBP2ReconnectParamsPtr; + +// Callback when login and logout commands complete asynchronously + +/*! + @typedef FWSBP2LoginCallback + @param refCon Reference constant supplied when the notification was registered. + @param params Structure containing additional information about the status of the login. +*/ + +typedef void (*FWSBP2LoginCallback)(void * refCon, FWSBP2LoginCompleteParamsPtr params); + +/*! + @typedef FWSBP2LogoutCallback + @param refCon Reference constant supplied when the notification was registered. + @param params Structure containing additional information about the status of the logout. +*/ + +typedef void (*FWSBP2LogoutCallback)(void * refCon, FWSBP2LogoutCompleteParamsPtr params); + +/*! + @typedef FWSBP2StatusCallback + @param refCon Reference constant supplied when the notification was registered. + @param status Indicates success or failure of operation. +*/ + +typedef void (*FWSBP2StatusCallback)(void * refCon, IOReturn status); + +/*! + @typedef FWSBP2FetchAgentWriteCallback + @param refCon Reference constant supplied when the notification was registered. + @param status Indicates success or failure of operation. + @param orb Indicates current last orb in chain. +*/ + +typedef void (*FWSBP2FetchAgentWriteCallback)(void * refCon, IOReturn status, IOFireWireSBP2ORB * orb); + +/*! + @typedef FWSBP2NotifyParams + @param notificationEvent Type of event we are being notified of. + @param message buffer containing message. + @param length length of message field. + @param generation FireWire generation value. +*/ + +typedef struct +{ + void * commandObject; + UInt32 notificationEvent; + const void * message; + UInt32 length; + UInt32 generation; +} FWSBP2NotifyParams, *FWSBP2NotifyParamsPtr; + + +/*! + @typedef FWSBP2NotifyCallback + @param refCon Reference constant supplied when the notification was registered. + @param params FWSBP2NotifyParams containing notification information. +*/ + +typedef void (*FWSBP2NotifyCallback)(void * refCon, FWSBP2NotifyParamsPtr params); + +/*! + @class IOFireWireSBP2Login + @abstract Supplies the login maintenance and Normal Command ORB execution portions of the API. + @discussion Supplies APIs for login maintenance and command execution. Drivers can use this + object to create IOFireWireSBP2ORB objects and execute them. Solicited and unsolicited status + callback routines can be registered and the SBP2 services will notify the driver when the + appropriate status arrives. + This class also handles login maintenance. Supplies APIs for logging in and logging out and + attempts to reconnect to the LUN after bus resets. The base FireWire services deliver bus + reset notification via the IOKit message routine. The SBP2 services build on this behavior + and deliver reconnectFailed and reconnectComplete through the message routine as well. +*/ + +class IOFireWireSBP2Login : public OSObject +{ + OSDeclareDefaultStructors( IOFireWireSBP2Login ) + + friend class IOFireWireSBP2ORB; + friend class IOFireWireSBP2LUN; + friend class IOFireWireSBP2UserClient; + +protected: + + // command selectors + enum + { + kLoginCommandIdle = 0, + kLoginCommandDoLogin = 1, + kLoginCommandDoLogout = 2, + kLoginAddORB = 3, + kLoginRemoveORB = 4, + kLoginFetchAgentReset = 5 + }; + + // internal login states + enum + { + kLoginStateIdle = 0, + kLoginStateLoggingIn = 1, + kLoginStateConnected = 2, + kLoginStateReconnect = 3, + kLoginStateLoggingOut = 4, + kLoginStateTerminated = 5 + }; + + // rom keys + enum + { + kUnitCharacteristicsKey = 0x3A, + kManagementAgentOffsetKey = 0x54 + }; + + // sbp2 defs + enum + { + kFWSBP2RequestComplete = 0, + kFWSBP2TransportFailure = 1, + kFWSBP2IllegalRequest = 2, + kFWSBP2VendorDependent = 3 + }; + + enum + { + kFWSBP2NoSense = 0, + kFWSBP2RequestTypeNotSupported = 1, + kFWSBP2SpeedNotSupported = 2, + kFWSBP2PageSizeNotSupported = 3, + kFWSBP2AccessDenied = 4, + kFWSBP2LogicalUnitNotSupported = 5, + kFWSBP2MaxPayloadTooSmall = 6, + kFWSBP2FunctionRejected = 9, + kFWSBP2LoginIDNotRecognized = 10, + kFWSBP2DummyORBCompleted = 11, + kFWSBP2RequestAborted = 12, + kFWSBP2UnspecifiedError = 0xFF + }; + + typedef struct + { + UInt32 password[2]; + UInt32 loginResponseAddressHi; + UInt32 loginResponseAddressLo; + UInt16 options; + UInt16 lun; + UInt16 passwordLength; + UInt16 loginResponseLength; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2LoginORB; + + typedef struct + { + UInt32 reserved1[4]; + UInt16 options; + UInt16 loginID; + UInt32 reserved2; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2ReconnectORB; + + typedef struct + { + UInt32 reserved1[4]; + UInt16 options; + UInt16 loginID; + UInt32 reserved2; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2LogoutORB; + +protected: + + /////////////////////////////////////////////////////////////////// + // private interface methods + + // IOFireWireSBP2LUN methods + virtual void clearAllTasksInSet( void ); + virtual bool initWithLUN( IOFireWireSBP2LUN * lun ); + virtual void suspendedNotify( void ); + virtual void resumeNotify( void ); + + // IOFireWireSBP2ORB methods + virtual IOFireWireUnit * getFireWireUnit( void ); + virtual IOFireWireSBP2LUN * getFireWireLUN( void ); + virtual bool isFetchAgentWriteInProgress( void ); + virtual bool isConnected( void ); + virtual IOReturn removeORB( IOFireWireSBP2ORB * orb ); + virtual IOReturn appendORBImmediate( IOFireWireSBP2ORB * orb ); + virtual IOReturn appendORB( IOFireWireSBP2ORB * orb ); + virtual void sendTimeoutNotification( IOFireWireSBP2ORB * orb ); + +protected: + + // reserved for future use + struct ExpansionData { }; + ExpansionData *reserved; + + IOFireWireSBP2LUN * fLUN; + IOFireWireUnit * fUnit; + IOFireWireController * fControl; + IOCommandGate * fGate; + + FWSBP2LoginCallback fLoginCompletionCallback; + void * fLoginCompletionRefCon; + + FWSBP2LogoutCallback fLogoutCompletionCallback; + void * fLogoutCompletionRefCon; + + FWSBP2NotifyCallback fStatusNotifyCallback; + void * fStatusNotifyRefCon; + + FWSBP2NotifyCallback fUnsolicitedStatusNotifyCallback; + void * fUnsolicitedStatusNotifyRefCon; + + UInt32 fLoginFlags; + UInt32 fReconnectTime; + + UInt32 fLoginState; + UInt32 fManagementOffset; + UInt32 fManagementTimeout; + UInt32 fMaxORBSize; + UInt32 fMaxCommandBlockSize; + UInt16 fLoginNodeID; + UInt32 fLoginGeneration; + UInt32 fLoginID; + UInt32 fReconnectHold; + UInt32 fMaxPayloadSize; + void * fRefCon; + + // resources + + FWSBP2LoginORB fLoginORB; + IOFWAddressSpace * fLoginORBAddressSpace; + FWAddress fLoginORBAddress; + + FWSBP2LoginResponse fLoginResponse; + IOFWAddressSpace * fLoginResponseAddressSpace; + FWAddress fLoginResponseAddress; + + FWSBP2ReconnectORB fReconnectORB; + IOFWAddressSpace * fReconnectORBAddressSpace; + FWAddress fReconnectORBAddress; + + FWSBP2StatusBlock fStatusBlock; + IOFWAddressSpace * fStatusBlockAddressSpace; + FWAddress fStatusBlockAddress; + + FWSBP2StatusBlock fReconnectStatusBlock; + IOFWAddressSpace * fReconnectStatusBlockAddressSpace; + FWAddress fReconnectStatusBlockAddress; + + FWSBP2LogoutORB fLogoutORB; + IOFWAddressSpace * fLogoutORBAddressSpace; + FWAddress fLogoutORBAddress; + bool fLogoutPending; + + IOFWWriteCommand * fLoginWriteCommand; + IOMemoryDescriptor * fLoginWriteCommandMemory; + bool fLoginWriteInProgress; + + IOFWWriteCommand * fReconnectWriteCommand; + IOMemoryDescriptor * fReconnectWriteCommandMemory; + bool fReconnectWriteInProgress; + bool fReconnectWriteInterrupted; + + IOFWWriteCommand * fLogoutWriteCommand; + IOMemoryDescriptor * fLogoutWriteCommandMemory; + bool fLogoutWriteInProgress; + + IOFWCommand * fLoginTimeoutCommand; + bool fLoginTimeoutTimerSet; + + IOFWDelayCommand * fReconnectTimeoutCommand; + bool fReconnectTimeoutTimerSet; + + IOFWCommand * fLogoutTimeoutCommand; + bool fLogoutTimeoutTimerSet; + + FWAddress fFetchAgentAddress; + IOMemoryDescriptor * fFetchAgentWriteCommandMemory; + FWAddress fLastORBAddress; + IOFireWireSBP2ORB * fLastORB; + IOFWWriteCommand * fFetchAgentWriteCommand; + bool fFetchAgentWriteCommandInUse; + FWSBP2FetchAgentWriteCallback fFetchAgentWriteCompletion; + void * fFetchAgentWriteRefCon; + IOFireWireSBP2ORB * fORBToWrite; + + OSSet * fORBSet; + OSIterator * fORBSetIterator; + + void * fPasswordBuf; + UInt32 fPasswordLen; + IOFWAddressSpace * fPasswordAddressSpace; + FWAddress fPasswordAddress; + IOMemoryDescriptor * fPasswordDescriptor; + + bool fSuspended; + + UInt32 fLoginRetryDelay; + UInt32 fLoginRetryCount; + UInt32 fLoginRetryMax; + IOFWDelayCommand * fLoginRetryTimeoutCommand; + bool fLoginRetryTimeoutTimerSet; + IOFireWireSBP2Target * fTarget; + + bool fUnsolicitedStatusEnableRequested; + + IOFWDelayCommand * fReconnectRetryTimeoutCommand; + bool fReconnectRetryTimeoutTimerSet; + + int fCriticalSectionCount; + + // init / destroy + virtual IOReturn getUnitInformation( void ); + virtual IOReturn allocateResources( void ); + virtual void free( void ); + + // orb add / remove + virtual IOReturn addORB( IOFireWireSBP2ORB * orb ); + static IOReturn staticExecuteAddORB( OSObject *self, void * orb, void *, void *, void * ); + virtual IOReturn executeAddORB( IOFireWireSBP2ORB * orb ); + + static IOReturn staticExecuteRemoveORB( OSObject *self, void * orb, void *, void *, void * ); + virtual IOReturn executeRemoveORB( IOFireWireSBP2ORB * orb ); + + // + // login + // + + static IOReturn staticExecuteLogin( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeLogin( void ); + virtual void abortLogin( void ); + + // login write complete handler + static void loginWriteCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void loginWriteComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // login timeout handler + static void loginTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void loginTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + // status block write handler + static UInt32 statusBlockWriteStatic(void *refcon, UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon lockRead); + virtual UInt32 statusBlockWrite( UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, const void *buf, IOFWRequestRefCon lockRead); + virtual void completeLogin( IOReturn state, const void *buf = NULL, UInt32 len = 0, void * buf2 = NULL ); + + // + // reconnect + // + + virtual void doReconnect( void ); + virtual void restartReconnect( void ); + virtual void startReconnectTimer( void ); + + // reconnect write complete handler + static void reconnectWriteCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void reconnectWriteComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // reconnect timeout handler + static void reconnectTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void reconnectTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + // reconnect status block + static UInt32 reconnectStatusBlockWriteStatic(void *refcon, UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, + UInt32 len, const void *buf, IOFWRequestRefCon lockRead); + virtual UInt32 reconnectStatusBlockWrite( UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon lockRead); + + virtual void sendReconnectNotification( UInt32 event ); + virtual void sendReconnectNotificationWithStatusBlock( UInt32 event ); + + // + // logout + // + + static IOReturn staticExecuteLogout( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeLogout( void ); + + // logout write complete handler + static void logoutWriteCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void logoutWriteComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // logout timeout handler + static void logoutTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void logoutTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + virtual void completeLogout( IOReturn state, const void *buf = NULL, UInt32 len = 0); + + // fetch agent write complete handler + static void fetchAgentWriteCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void fetchAgentWriteComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // + // fetch agent + // + + bool fFetchAgentResetInProgress; + UInt32 fFetchAgentResetBuffer; + FWAddress fFetchAgentResetAddress; + IOFWWriteQuadCommand * fFetchAgentResetCommand; + void * fFetchAgentResetRefCon; + FWSBP2StatusCallback fFetchAgentResetCompletion; + + static IOReturn staticExecuteFetchAgentReset( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeFetchAgentReset( void ); + static void fetchAgentResetCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void fetchAgentResetComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // + // doorbell + // + + bool fDoorbellInProgress; + bool fDoorbellRingAgain; + UInt32 fDoorbellBuffer; + FWAddress fDoorbellAddress; + IOFWWriteQuadCommand * fDoorbellCommand; + + static IOReturn staticExecuteDoorbell( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeDoorbell( void ); + static void doorbellCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void doorbellComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // + // enable unsolicited satus + // + + bool fUnsolicitedStatusEnableInProgress; + UInt32 fUnsolicitedStatusEnableBuffer; + FWAddress fUnsolicitedStatusEnableAddress; + IOFWWriteQuadCommand * fUnsolicitedStatusEnableCommand; + + static IOReturn staticExecuteUnsolicitedStatusEnable( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeUnsolicitedStatusEnable( void ); + static void unsolicitedStatusEnableCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void unsolicitedStatusEnableComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // + // busy timeout stuff + // + + bool fSetBusyTimeoutInProgress; + UInt32 fSetBusyTimeoutBuffer; + FWAddress fSetBusyTimeoutAddress; + IOFWWriteQuadCommand * fSetBusyTimeoutCommand; + + bool fInCriticalSection; + + UInt16 fLocalNodeID; + bool fFastStartSupported; + UInt32 fFastStartOffset; + UInt32 fFastStartMaxPayload; + + UInt32 fUserLoginGeneration; + bool fUserLoginGenerationSet; + + IOFWDelayCommand * fFetchAgentRetryTimerCommand; + bool fFetchAgentRetryTimerSet; + + virtual IOReturn executeSetBusyTimeout( void ); + static void setBusyTimeoutCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void setBusyTimeoutComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + +private: + // IOFireWireSBP2ORB friend class wrappers + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 0); + +protected: + virtual bool initORBWithLogin( IOFireWireSBP2ORB * orb, IOFireWireSBP2Login * login ); + virtual void setNextORBAddress( IOFireWireSBP2ORB * orb, FWAddress address ); + virtual void fetchAgentWriteComplete( IOFireWireSBP2ORB * orb, IOReturn status ); + virtual bool isORBTimerSet( IOFireWireSBP2ORB * orb ); + virtual void cancelORBTimer( IOFireWireSBP2ORB * orb ); + + // IOFireWireSBP2LUN friend class wrappers + virtual void removeLogin( void ); + virtual IOFireWireSBP2Target * getTarget( void ); + + UInt32 fARDMAMax; + bool fPhysicalAccessEnabled; + + bool fLoginStatusReceived; + FWSBP2StatusBlock fLoginStatusBlock; + UInt32 fLoginStatusBlockLen; + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 5); + +public: + + ////////////////////////////// + + /*! + @function createORB + @abstract Creates a new IOFireWireSBP2ORB for this login. + @discussion Create a new IOFireWireSBP2ORB for this login. It can be configured + with it's accessors and executed with submitORB below. + @result Returns a pointer to the new ORB object. + */ + + virtual IOFireWireSBP2ORB * createORB( void ); + + /*! + @function submitORB + @abstract Submits the given orb + @discussion Starts execution of the given ORB. If the ORB is an immediate ORB it's + addresss is written to the fetch agent. If it is a non immediate orb its address + is appended to the last orb of the currently processing chain. The doorbell is not + rung automatically it must be run manually with the ringDoorbell command described below. + @param orb The orb to be executed. + @result Returns kIOReturnSuccess if the ORB has been started successfully. + */ + + virtual IOReturn submitORB( IOFireWireSBP2ORB * orb ); + + // set callbacks + + /*! + @function setStatusNotifyProc + @abstract Sets the callback to be called on normal command status. + @discussion The supplied callback is called when normal command status is recieved, when + a normal command times out, or when a normal command is aborted. + "notificationEvent" in the callback's params will indicate what happened. + It will be set to one of the following values: kFWSBP2NormalCommandReset, kFWSBP2NormalCommandStatus, + or kFWSBP2NormalCommandTimeout. If the event type is kFWSBP2NormalCommandTimeout and "len" is + non-zero then "message" contains the data written to the status block. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2NotifyCallback. + */ + + virtual void setStatusNotifyProc( void * refCon, FWSBP2NotifyCallback callback ); + + /*! + @function getStatusNotifyProc + @abstract Returns the callback to be called on normal command status. + @discussion Returns the refCon and callback address of the status notify callback. + @param refCon output parameter returning the refCon to be passed to the callback. + @param callback output parameter returning the address of the callback. + */ + + virtual void getStatusNotifyProc( void ** refCon, FWSBP2NotifyCallback * callback ); + + /*! + @function setUnsolicitedStatusNotifyProc + @abstract Sets the callback to be called on normal command status. + @discussion The supplied callback is called when unsolicited status is recieved. + "notificationEvent" in the callback's params will indicate what happened. In this + case it will be set to kFWSBP2UnsolicitedStatus. If "len" is + non-zero then "message" contains the data written to the status block. Note: any buffers + returned by callbacks are only valid for the duration of the login and should not have + their contents modified. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2NotifyCallback. + */ + + virtual void setUnsolicitedStatusNotifyProc( void * refCon, FWSBP2NotifyCallback callback ); + + /*! + @function getUnsolicitedStatusNotifyProc + @abstract Returns the callback to be called on unsolicited status. + @discussion Returns the refCon and callback address of the unsolicited status notify callback. + @param refCon output parameter returning the refCon to be passed to the callback. + @param callback output parameter returning the address of the callback. + */ + + virtual void getUnsolicitedStatusNotifyProc( void ** refCon, FWSBP2NotifyCallback * callback ); + + // command handling + + /*! + @function setLoginCompletion + @abstract Sets the callback to be called when a login attempt is complete. + @discussion The supplied callback is called when a login attempt has completed. "status" in the + callback's params should be checked to determine the success or failure of the login attempt. + If "statusBlock" is non-null then login status was written and it has been supplied here. If + the login attempt was successful then the login response will be supplied in the "loginResponse" + buffer. Note: all buffers supplied to callbacks are only valid for the duration of the callback. + Also, you are not to modify the contents of any supplied buffer. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2LoginCallback. + */ + + virtual void setLoginCompletion( void * refCon, FWSBP2LoginCallback completion ); + + /*! + @function submitLogin + @abstract Attempts to login to the LUN. + @discussion This call begins the login process. The login object should be configured prior + to this call. If kIOReturnSuccess is returned from this call then the loginCompletion routine + will be called when the login completes (successfully or unsuccesfully). + @result Returns kIOReturnSuccess login has successlly begun. + */ + + virtual IOReturn submitLogin( void ); + + /*! + @function submitLogout + @abstract Attempts to logout of the LUN. + @discussion This call begins the logout process. If kIOReturnSuccess is returned from this call then + the logoutCompletion routine will be called when the logout completes (successfully or unsuccesfully). + @result Returns kIOReturnSuccess if logout has successfully begun. + */ + + virtual IOReturn submitLogout( void ); + + /*! + @function setLogoutCompletion + @abstract Sets the callback to be called when a logout attempt is complete. + @discussion The supplied callback is called when a logout attempt has completed. "status" in the + callback's params should be checked to determine the success or failure of the logout attempt. + If "statusBlock" is non-null then logout status was written and it has been supplied here. + Note: all buffers supplied to callbacks are only valid for the duration of the callback. + Also, you are not to modify the contents of any supplied buffer. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2LogoutCallback. + */ + + virtual void setLogoutCompletion( void * refCon, FWSBP2LogoutCallback completion ); + + /*! + @function setFetchAgentWriteCompletion + @abstract Sets the callback to be called when the fetch agent write completes. + @discussion When an immediate orb is executed with submitORB, it's address is written to a + specific address on the device. This address is called the fetch agent. The device the + reads that orb from the Mac's memory and executes it. With this call you can register to + be called back when this write to the fetch agent completes. The SBP2 services guarantee + that the fetch agent write will be complete before status is reported for an ORB, so for + most drivers this notification is not required. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2FetchAgentWriteCallback. + */ + + virtual void setFetchAgentWriteCompletion( void * refCon, FWSBP2FetchAgentWriteCallback completion ); + + /*! + @function setFetchAgentResetCompletion + @abstract Sets the callback to be called when a fetch agent reset completes. + @discussion The fetch agent state machine on the device can be reset by a write to a specific + register. The SBP2 services offer a utility method to reset the fetch agent. You can register + a callback routine here to be notified when this rest write completes. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2FetchAgentWriteCallback. + */ + + virtual void setFetchAgentResetCompletion( void * refCon, FWSBP2StatusCallback completion ); + + /*! + @function submitFetchAgentReset + @abstract Resets the LUN's fetch agent. + @discussion The fetch agent state machine on the device can be reset by a write to a specific + register. This reset can be intiated by a call to this method. Notification of the completion + of this write can be had by registering a callback with the setFetchAgentResetCompletion method. + @result Returns kIOReturnSuccess if the reset started successfully. + */ + + virtual IOReturn submitFetchAgentReset( void ); + + /*! + @function ringDoorbell + @abstract Rings the doorbell on the LUN. + @discussion Non-immediate appends to the ORB chain may require the fetch agent state machine + to be notified of the new ORB's presence. This is accomplished by writing to the so called + doorbell register. This method begins one of those writes. + @result Returns kIOReturnSuccess if the ring started successfully. + */ + + virtual IOReturn ringDoorbell( void ); + + /*! + @function enableUnsolicitedStatus + @abstract Enables unsolicited status. + @discussion After unsolicited is sent the device will not send any additional unsolicited status + until a specific register is written. This serves as a sort of flow-control for unsolicited status. + After unsolicited status is recieved and processed drivers will want to reenable the delivery + of unsolicted status by a call to this method. + @result Returns kIOReturnSuccess if the status enable write started successfully. + */ + + virtual IOReturn enableUnsolicitedStatus( void ); + + // accessors + + /*! + @function getMaxCommandBlockSize + @abstract Returns the maximum command block size. + @discussion The device publishes an upper limit on the size of command block that it can + accept. That value can be accessed via this method. + @result Returns a UInt32 containing the maximum command block size. + */ + + virtual UInt32 getMaxCommandBlockSize( void ); + + /*! + @function getLoginID + @abstract Returns the current login ID. + @discussion When we successfully login to a device. The device gives us a unique login id. + This is used internally for reconnecting to the device after bus resets and for certain other + management ORBs. Most drivers are probably not interested in this value. + @result Returns a UInt32 containing the current login ID. + */ + + virtual UInt32 getLoginID( void ); + + /*! + @function setLoginFlags + @abstract Sets login configuration flags. + @discussion Configures the login behavior according to the provided flags. Currently two + flags are defined for this API. kFWSBP2ExclusiveLogin sets the exclusive login bit in the + login ORB. kFWSBP2DontSynchronizeMgmtAgent allows simultaneous logins or reconnects to LUNs + with a common management agent (ie LUNs in the same unit directory). + @param loginFlags the login configuration flags. + */ + + virtual void setLoginFlags( UInt32 loginFlags ); + + /*! + @function getLoginFlags + @abstract Returns the currently set login flags. + @discussion Returns the current state of the login flags. Currently there is only one + flag defined for this API. kFWSBP2ExclusiveLogin indicates that the exclusive login bit + should be set in the login ORB. + @result Returns a UInt32 containing the currently set login flags. + */ + + virtual UInt32 getLoginFlags( void ); + + /*! + @function setReconnectTime + @abstract Sets the desired reconnect duration. + @discussion The target and initiator arbitrate the duration of the reconnect timeout. Here + the initiator specifies its desired timeout time in 2^reconnectTime seconds. After a + successful login the device returns the actual timeout value it wishes to use. This value + may be less than the reconnect timeout that the intiator specified if this is all that the + device can support. + @param reconnectTime The desired reconnect timeout encoded as 2^reconnectTime seconds. + */ + + virtual void setReconnectTime( UInt32 reconnectTime ); + + /*! + @function getReconnectTime + @abstract Returns the currently set reconnect time. + @discussion Returns the currently desired initiator reconnect time encoded as 2^time seconds. + @result Returns a UInt32 containing the currently set reconnect time. + */ + + virtual UInt32 getReconnectTime( void ); + + /*! + @function setMaxPayloadSize + @abstract Sets the maximum data transfer length for a normal command ORB. + @discussion Sets the maximum data transfer length for a normal command ORB. This value is + the maximum for all ORBs sent to this LUN. This can be trimmed further on an ORB by ORB basis, + by a similar call in the IOFireWireSBP2ORB itself. + @param reconnectTime The desired maximum payload size in bytes. + */ + + virtual void setMaxPayloadSize( UInt32 maxPayloadSize ); + + /*! + @function getMaxPayloadSize + @abstract Returns the currently set maximum payload size. + @discussion Returns the currently global maximum payload size in bytes. + @result Returns a UInt32 containing the currently set maximum payload size. + */ + + virtual UInt32 getMaxPayloadSize( void ); + + /*! + @function setPassword + @abstract Sets the login password. + @discussion Sets the login password using a buffer and a length. An alternate version exists + that accepts an IOMemoryDescriptor. If the password length is 8 or less the password is copied + directly into the login orb. If the length is greater than 8 the buffer is referenced by address + in the login ORB. In this case the buffer is not copied and should remain allocated for the + duration of the login attempt. + @param buf a pointer to the password buffer. + @param len the length in bytes of the password buffer. + @result Returns kIOReturnSuccess on success. + */ + + virtual IOReturn setPassword( void * buf, UInt32 len ); + + /*! + @function setPassword + @abstract Sets the login password. + @discussion Sets the login password using an IOMemoryDescriptor. An alternate version exists + that accepts a buffer and a length. If the password length is 8 or less the password is copied + directly into the login orb. If the length is greater than 8 the buffer is referenced by address + in the login ORB. + @param memory an IOMemoryDescriptor referencing the password. + @result Returns kIOReturnSuccess on success. + */ + + virtual IOReturn setPassword( IOMemoryDescriptor * memory ); + + + /*! + @function setRefCon + @abstract Sets the login refCon. + @discussion Sets a user defined value on the login that can be retrieved later with the + method getRefCon. + @param refCon a user defined value. + */ + + virtual void setRefCon( void * refCon ); + + /*! + @function getRefCon + @abstract Returns the refCon set with setRefCon. + @discussion Returns the user defined value previously stored in the login with setRefCon. + @result Returns the previously stored user defined value. + */ + + virtual void * getRefCon( void ); + + /*! + @function setBusyTimeoutRegisterValue + @abstract Sets the value to be written to the BUSY_TIMEOUT register. + @discussion 1394-1995 defines a register known as the BUSY_TIMEOUT register. This register + controls the busy retry behavior of your device. The initial value for this register is + 0x00000000. Which means busied transactions will not be retried. Since most devices want + their transactions retired on busy acks, the SBP2 service automatically updates the + BUSY_TIMEOUT register with the value specified here whenever necessary. Most drivers should + set this value to 0x0000000f. + @param timeout desired value of the BUSY_TIMEOUT register. + */ + + virtual void setBusyTimeoutRegisterValue( UInt32 timeout ); + +protected: + + virtual void startORBTimer( IOFireWireSBP2ORB * orb ); + virtual void prepareORBForExecution( IOFireWireSBP2ORB * orb ); + + static IOReturn staticExecuteORB( OSObject *self, void * orb, void *, void *, void * ); + virtual IOReturn executeORB( IOFireWireSBP2ORB * orb ); + +public: + + /*! + @function release + @abstract Primary implementation of the release mechanism. + @discussion See OSObject.h for more information. When retainCount == when then call free(). + */ + + virtual void release() const; + + /*! + @function setLoginRetryCountAndDelayTime + @abstract Sets login retry behavior. + @discussion Sets login retry behavior. + @param retryCount number of times to retry logins + @param uSecs delay time in microseconds between login retries + */ + + virtual void setLoginRetryCountAndDelayTime( UInt32 retryCount, UInt32 uSecs ); + +protected: + virtual IOReturn initialExecuteLogin( void ); + virtual void startLoginRetryTimer( void ); + virtual void stopLoginRetryTimer( void ); + static void loginRetryTimeoutStatic( void *refcon, IOReturn status, + IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void loginRetryTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd); + + virtual void startReconnectRetryTimer( void ); + virtual void stopReconnectRetryTimer( void ); + static void reconnectRetryTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void reconnectRetryTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + virtual bool isORBAppended( IOFireWireSBP2ORB * orb ); + virtual void setORBIsAppended( IOFireWireSBP2ORB * orb, bool state ); + +public: + virtual void setAddressLoForLoginORBAndResponse( UInt32 addressLoORB, UInt32 addresLoResponse ); + + virtual void setLoginGeneration( UInt32 generation ); + virtual void clearLoginGeneration( void ); + +protected: + void startFetchAgentRetryTimer( UInt32 duration ); + void stopFetchAgentRetryTimer( void ); + static void fetchAgentRetryTimerStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + void fetchAgentRetryTimer( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + void terminateNotify( void ); + void processLoginWrite( void ); + +public: + + bool isPhysicalAccessEnabled( void ); + UInt32 getARDMMax( void ); + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 8); + + }; + +#endif diff --git a/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2ManagementORB.h b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2ManagementORB.h new file mode 100644 index 0000000..9455383 --- /dev/null +++ b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2ManagementORB.h @@ -0,0 +1,345 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2ManagementORB + Contains the class definition for IOFireWireSBP2ManagementORB. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2MANAGEMENTORB_H +#define _IOKIT_IOFIREWIRESBP2MANAGEMENTORB_H + +#include +#include + +#include + +class IOFireWireSBP2LUN; +class IOFireWireSBP2ManagementORB; +class IOFireWireSBP2ORB; + +enum +{ + kFWSBP2QueryLogins = 1, + kFWSBP2AbortTask = 0xb, + kFWSBP2AbortTaskSet = 0xc, + kFWSBP2LogicalUnitReset = 0xe, + kFWSBP2TargetReset = 0xf +}; + +// Callback when management command completes asynchronously + +/*! + @typedef FWSBP2ManagementCallback + @param refCon Reference constant supplied when the notification was registered. + @param status Indicates success or failure of operation. + @param orb Indicates current orb status is for. +*/ + +typedef void (*FWSBP2ManagementCallback)(void * refCon, IOReturn status, IOFireWireSBP2ManagementORB * orb); + +/*! + @class IOFireWireSBP2ManagementORB + @abstract Supplies non login related management ORBs. Management ORBs can be executed independent + of a login, if necessary. Management ORBs are created using the IOFireWireSBP2LUN interface. +*/ + +class IOFireWireSBP2ManagementORB : public IOFWCommand +{ + OSDeclareDefaultStructors( IOFireWireSBP2ManagementORB ) + + friend class IOFireWireSBP2LUN; + friend class IOFireWireSBP2UserClient; + +protected: + + //////////////////////////////////////// + // rom keys + + enum + { + kUnitCharacteristicsKey = 0x3A, + kManagementAgentOffsetKey = 0x54 + }; + + //////////////////////////////////////// + // structs + + typedef struct + { + UInt32 orbOffsetHi; + UInt32 orbOffsetLo; + UInt32 reserved1[2]; + UInt16 options; + UInt16 loginID; + UInt32 reserved2; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2TaskManagementORB; + + typedef struct + { + UInt32 reserved1[2]; + UInt32 queryResponseAddressHi; + UInt32 queryResponseAddressLo; + UInt16 options; + UInt16 lun; + UInt16 reserved2; + UInt16 queryResponseLength; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2QueryLoginsORB; + + typedef struct + { + UInt8 details; + UInt8 sbpStatus; + UInt16 orbOffsetHi; + UInt32 orbOffsetLo; + UInt32 status[6]; + } FWSBP2StatusBlock; + +protected: + + //////////////////////////////////////// + // friend methods + + // IOFireWireSBP2LUN methods + virtual bool initWithLUN( IOFireWireSBP2LUN * lun, + void * refCon, + FWSBP2ManagementCallback completion ); + + // IOFireWireSBP2UserClient methods + virtual void setAsyncCallbackReference( void * asyncRef ); + virtual void getAsyncCallbackReference( void * asyncRef ); + +protected: + + // reserved for future use + struct ExpansionData + { + bool fInCriticalSection; + }; + ExpansionData * fExpansionData; + + IOFireWireSBP2LUN * fLUN; + IOFireWireUnit * fUnit; + + UInt32 fManagementOffset; + UInt32 fManagementTimeout; + UInt32 fFunction; + OSObject * fManageeCommand; + + // our orb + FWSBP2TaskManagementORB fManagementORB; + IOFWAddressSpace * fManagementORBAddressSpace; + FWAddress fManagementORBAddress; + + // command to write management agent + IOFWWriteCommand * fWriteCommand; + IOMemoryDescriptor * fWriteCommandMemory; + + // timeout + IOFWCommand * fTimeoutCommand; + bool fTimeoutTimerSet; + + // status block + FWSBP2StatusBlock fStatusBlock; + IOFWAddressSpace * fStatusBlockAddressSpace; + FWAddress fStatusBlockAddress; + + // response buffer + void * fResponseBuf; + UInt32 fResponseLen; + IOFWAddressSpace * fResponseAddressSpace; + FWAddress fResponseAddress; + + // competion routine + FWSBP2ManagementCallback fCompletionCallback; + void * fCompletionRefCon; + + // for user client + OSAsyncReference64 fCallbackAsyncRef; + + IOMemoryMap * fResponseMap; + + bool fCompleting; + + //////////////////////////////////////// + + // init / destroy + virtual IOReturn getUnitInformation( void ); + virtual IOReturn allocateResources( void ); + virtual void free( void ); + + // command execution + virtual IOReturn execute( void ); + virtual IOReturn complete( IOReturn state ); + + // write complete handler + static void writeCompleteStatic( void *refcon, + IOReturn status, + IOFireWireNub *device, + IOFWCommand *fwCmd ); + virtual void writeComplete( IOReturn status, + IOFireWireNub *device, + IOFWCommand *fwCmd ); + + // timeout handler + static void handleTimeoutStatic( void *refcon, + IOReturn status, + IOFireWireBus *bus, + IOFWBusCommand *fwCmd ); + virtual void handleTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + // status block write handler + static UInt32 statusBlockWriteStatic( void *refcon, + UInt16 nodeID, + IOFWSpeed &speed, + FWAddress addr, + UInt32 len, + const void *buf, + IOFWRequestRefCon lockRead ); + virtual UInt32 statusBlockWrite( UInt16 nodeID, + FWAddress addr, + UInt32 len, + const void *buf, + IOFWRequestRefCon lockRead ); + + // IOFireWireSBP2LUN friend class wrappers + virtual void clearAllTasksInSet( void ); + virtual void removeManagementORB( IOFireWireSBP2ManagementORB * orb ); + +public: + + //////////////////////////////////////// + // client methods + + /*! + @function setCommandFunction + @abstract Sets the function of the management ORB. + @discussion Sets the the function of the management ORB. Legal values are kFWSBP2QueryLogins, + kFWSBP2AbortTask, kFWSBP2AbortTaskSet, kFWSBP2LogicalUnitReset, and kFWSBP2TargetReset. + @param function a value indicating the desired management function. + @result Returns kIOReturnSuccess if function was a legal function. + */ + + virtual IOReturn setCommandFunction( UInt32 function ); + + /*! + @function getCommandFunction + @abstract Returns the current function of the management ORB. + @discussion Returns the function of the management ORB. This is the same value that was + set with setCommandFunction. + @result Returns the function of the management ORB. + */ + + virtual UInt32 getCommandFunction( void ); + + /*! + @function setManageeCommand + @abstract Sets the command to be managed by the management ORB. + @discussion All management functions except kFWSBP2QueryLogins require a reference to an ORB of + some sort. kFWSBP2AbortTaskSet, kFWSBP2LogicalUnitReset, and kFWSBP2TargetReset require a + reference to the login ORB. kFWSBP2AbortTask requires a reference to the ORB to be aborted. + This method allows you to set the ORB to be managed. + @param command a reference to an IOFireWireSBP2Login or an IOFireWireSBP2ORB. + */ + + virtual void setManageeCommand( OSObject * command ); + + /*! + @function getCommandFunction + @abstract Returns the current managee command of the management ORB. + @discussion Returns the current managee command of the management ORB. This is the same value that was + set with setManageeCommand. + @result Returns the current managee command of the management ORB. + */ + + virtual OSObject* getManageeCommand( void ); + + /*! + @function setResponseBuffer + @abstract Sets the response buffer for the management ORB. + @discussion Sets the response buffer for the management ORB. kFWSBP2QueryLogins returns + a response to its query and needs to write it somewhere. This routine allows you to + specify the location. + @param desc memory descriptor for buffer. + @result Returns kIOReturnSuccess on a success. + */ + + virtual IOReturn setResponseBuffer( IOMemoryDescriptor * desc ); + + /*! + @function setResponseBuffer + @abstract Sets the response buffer for the management ORB. + @discussion Sets the response buffer for the management ORB. kFWSBP2QueryLogins returns + a response to its query and needs to write it somewhere. This routine allows you to + specify the location. + @param buf backing store for buffer + @param len length of buffer. + @result Returns kIOReturnSuccess on a success. + */ + + virtual IOReturn setResponseBuffer( void * buf, UInt32 len ); + + /*! + @function getResponseBuffer + @abstract Returns the response buffer for the management ORB. + @discussion Returns the response buffer set in setResponseBuffer above + @param desc memory descriptor for buffer. + @param buf output parameter for backing store for buffer + @param len output parameter for length of buffer. + */ + + virtual void getResponseBuffer( void ** buf, UInt32 * len ); + + /*! + @function release + @abstract Primary implementation of the release mechanism. + @discussion See OSObject.h for more information. + @param when When retainCount == when then call free(). + */ + + virtual void release() const; + +protected: + + virtual void setORBToDummy( IOFireWireSBP2ORB * orb ); + + virtual void suspendedNotify(); + +private: + + OSMetaClassDeclareReservedUsed(IOFireWireSBP2ManagementORB, 0); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 8); + +}; + +#endif \ No newline at end of file diff --git a/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2ORB.h b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2ORB.h new file mode 100644 index 0000000..5c11593 --- /dev/null +++ b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2ORB.h @@ -0,0 +1,547 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2ORB + Contains the class definition for IOFireWireSBP2ORB. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2ORB_H +#define _IOKIT_IOFIREWIRESBP2ORB_H + +#include + +#include +#include +#include + +enum +{ + kFWSBP2ConstraintForceDoubleBuffer = (1 << 0) +}; + +// login option flags +enum +{ + kFWSBP2CommandCompleteNotify = (1 << 0), + kFWSBP2CommandTransferDataFromTarget = (1 << 1), + kFWSBP2CommandImmediate = (1 << 2), + + kFWSBP2CommandNormalORB = (1 << 5), + kFWSBP2CommandReservedORB = (1 << 6), + kFWSBP2CommandVendorORB = (1 << 7), + kFWSBP2CommandDummyORB = (1 << 8), + kFWSBP2CommandCheckGeneration = (1 << 9), + + kFWSBP2CommandFixedSize = (1 << 10), + kFWSBP2CommandVirtualORBs = (1 << 11) // handy for debugging +}; + +enum +{ + kFWSBP2MaxPageClusterSize = 0xf000 +}; + +class IOFireWireSBP2ORB; +class IOFireWireSBP2LUN; +class IOFireWireSBP2Login; + +/*! + @class IOFireWireSBP2ORB + @abstract Represents an SBP2 normal command ORB. Supplies the APIs for configuring normal + command ORBs. This includes setting the command block and writing the page tables for I/O. + The ORBs are executed using the submitORB method in IOFireWireSBP2Login. +*/ + +class IOFireWireSBP2ORB : public IOCommand +{ + OSDeclareDefaultStructors( IOFireWireSBP2ORB ) + + friend class IOFireWireSBP2Login; + friend class IOFireWireSBP2ManagementORB; + +protected: + + typedef struct + { + UInt32 nextORBAddressHi; + UInt32 nextORBAddressLo; + UInt32 dataDescriptorHi; + UInt32 dataDescriptorLo; + UInt16 options; + UInt16 dataSize; + UInt32 commandBlock[1]; // will be variable sized + } FWSBP2ORB; + + typedef struct + { + UInt16 segmentLength; + UInt16 segmentBaseAddressHi; + UInt32 segmentBaseAddressLo; + } FWSBP2PTE; + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 0); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 8); + +protected: + + virtual void deallocateBufferAddressSpace( void ); + virtual IOReturn allocateTimer( void ); + virtual void deallocateTimer( void ); + + /*! + @function deallocatePageTable + @abstract Frees up memory allocated for the page table. + @discussion Frees all memory associated with the page table. Undoes what allocatePageTable does. + Calling allocatePageTable again will automatically deallocate the existing page table before + allocating a new one, so this method is not used in most cases. + */ + + virtual void deallocatePageTable( void ); + +protected: + + // IOFireWireSBP2Login methods + virtual bool initWithLogin( IOFireWireSBP2Login * login ); + virtual void setNextORBAddress( FWAddress address ); + +public: + + /*! + @function allocatePageTable + @abstract Allocates memory for the page table. + @discussion Page table allocation is handle automatically by the ORB, except if the + kFWSBP2CommandFixedSize flags is set. In this case we will fail to write a page table if we + need more page table space than we have already. This method is exposed so these drivers + can preallocate as much page table as they need. This is useful if your driver is part of + the paging path and cannot allow allocations to occur. + @param entryCount number of entries of page table to be allocated. + */ + + virtual IOReturn allocatePageTable( UInt32 entryCount ); + +protected: + + virtual bool isTimerSet( void ); + virtual void cancelTimer( void ); + +protected: + + // reserved for future use + struct ExpansionData { }; + ExpansionData *reserved; + + IOFireWireSBP2Login * fLogin; + IOFireWireSBP2LUN * fLUN; + IOFireWireUnit * fUnit; + IOFireWireController * fControl; + IODMACommand * fDMACommand; + void * fUnused2; + + UInt32 fCommandFlags; + UInt32 fMaxPayloadSize; + UInt32 fTimeoutDuration; + UInt32 fGeneration; + UInt64 fRefCon; + + // + // orb + // + + IOMemoryDescriptor * fORBDescriptor; + FWSBP2ORB * fORBBuffer; + + FWAddress fORBPseudoAddress; + IOFWAddressSpace * fORBPseudoAddressSpace; + + IOFWAddressSpace * fORBPhysicalAddressSpace; + FWAddress fORBPhysicalAddress; + + // + // page table + // + + UInt32 fPageTableSize; + IOBufferMemoryDescriptor * fPageTableDescriptor; + + IOFWAddressSpace * fPageTablePhysicalAddressSpace; + FWAddress fPageTablePhysicalAddress; + UInt32 fPageTablePhysicalLength; + + IOFWAddressSpace * fPageTablePseudoAddressSpace; + FWAddress fPageTablePseudoAddress; + + // + // buffers + // + + IOFWAddressSpace * fBufferAddressSpace; + bool fBufferAddressSpaceAllocated; + IOMemoryDescriptor * fBufferDescriptor; + + // + // timer + // + + IOFWDelayCommand * fTimeoutCommand; + bool fTimeoutTimerSet; + + bool fInProgress; + bool fIsAppended; + + UInt32 fFetchAgentWriteRetries; + UInt32 fPTECount; + UInt32 fFetchAgentWriteRetryInterval; + + UInt32 fConstraintOptions; + + virtual IOReturn allocateResources( void ); + virtual void free( void ); + + // orb timeout handler + static void orbTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void orbTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + // login friend class wrappers + virtual IOFireWireUnit * getFireWireUnit( void ); + virtual IOFireWireSBP2LUN * getFireWireLUN( void ); + virtual void deallocateORB( void ); + virtual IOReturn allocateORB( UInt32 orbSize ); + virtual IOReturn removeORB( IOFireWireSBP2ORB * orb ); + virtual void prepareORBForExecution( void ); + virtual void startTimer( void ); + virtual void sendTimeoutNotification( IOFireWireSBP2ORB * orb ); + +public: + + /*! + @function release + @abstract Primary implementation of the release mechanism. + @discussion See OSObject.h for more information. + @param when When retainCount == when then call free(). + */ + + virtual void release() const; + + /*! + @function getLogin + @abstract Gets the login associated with this ORB. + @discussion Returns the IOFireWireSBP2Login object associated with this ORB. + @result Returns a pointer to an IOFireWireSBP2Login. + */ + + virtual IOFireWireSBP2Login * getLogin( void ); + + /*! + @function setCommandBuffersAsRanges + @abstract Creates a page table from a list of ranges. + @discussion Creates a page table with the given parameters. Any addresses mapped by this method + must remain valid until setCommandBuffers is called again or releaseCommandBuffers is called. + The SBP2 services do not release references to the command buffers just because the command + has completed. + @param ranges An array of ranges representing the data to be transfered. + @param withCount The number of ranges in the ranges array. + @param withDirection An IODirection indicating the direction of data transfer. + @param withTask The task that these adressses reside in. + @param offset Offset in bytes into data to begin writing table at. + @param length Number of bytes of data to map from offset. + @result Returns KIOReturnSuccess if the page table was written successfully. + */ + + virtual IOReturn setCommandBuffersAsRanges( IOVirtualRange * ranges, + UInt32 withCount, + IODirection withDirection, + task_t withTask, + UInt32 offset = 0, + UInt32 length = 0 ); + /*! + @function setCommandBuffersAsRanges + @abstract Creates a page table from a list of ranges. + @discussion Creates a page table with the given parameters. Any addresses mapped by this method + must remain valid until setCommandBuffers is called again or releaseCommandBuffers is called. + The SBP2 services do not release references to the command buffers just because the command + has completed. + @param memoryDescriptor IOMemoryDescriptor describe ranges to be written to a page table. + @param offset Offset in bytes into data to begin writing table at. + @param length Number of bytes of data to map from offset. + @result Returns KIOReturnSuccess if the page table was written successfully. + */ + + virtual IOReturn setCommandBuffers( IOMemoryDescriptor * memoryDescriptor, UInt32 offset = 0, + UInt32 length = 0 ); + + + /*! + @function releaseCommandBuffers + @abstract Releases SBP2's reference to the command buffers. + @discussion When you create a page table with one of the variants of setCommandBuffers. + SBP2 holds on to a reference to the buffers until this method is called. This means that + if a command completed and you manipulated the memory descriptor or released the buffers + without calling this method you could leave FW in an inconsistent state. + @result Returns KIOReturnSuccess if the page table was cleared successfully. + */ + + virtual IOReturn releaseCommandBuffers( void ); + + /*! + @function setCommandBlock + @abstract Sets the command block portion of the ORB. + @discussion Copys the data provided in the buffer to the command block portion of the ORB. + @param buffer Pointer to buffer to copy command block from. + @param length Number of bytes of data to copy. + @result Returns KIOReturnSuccess if the command block was updated successfully. + */ + + virtual IOReturn setCommandBlock( void * buffer, UInt32 length ); + + /*! + @function setCommandBlock + @abstract Sets the command block portion of the ORB. + @discussion Copys the data provided in the buffer to the command block portion of the ORB. + @param memory IOMemoryDescriptor representing the command block buffer. + @result Returns KIOReturnSuccess if the command block was updated successfully. + */ + + virtual IOReturn setCommandBlock( IOMemoryDescriptor * memory ); + + /*! + @function getCommandBufferDescriptor + @abstract Returns the memory descriptor representing the command buffer. + @discussion Returns the IOMemoryDescriptor for the data mapped by setCommandBuffer variants. + Works for setCommandBuffersAsRanges too. + @result Returns memory descriptor representing mapped data buffers. + */ + + virtual IOMemoryDescriptor * getCommandBufferDescriptor( void ); + + // accessors + + /*! + @function setCommandFlags + @abstract Sets configuration flags for the ORB. + @discussion Sets the configuration flags for the ORB. These can be any of the following: +

kFWSBP2CommandCompleteNotify - Set the notify bit as specified in SBP2 standard. Set to receive completion/timeout notification on this ORB. You almost always want to set this.

+

kFWSBP2CommandTransferDataFromTarget - Transfer direction as specified in SBP2 standard. Set if data is to be written by the device into the host's memory.

+

kFWSBP2CommandImmediate - Immediate Append. ORB address will be written to fetch agent and not chained. It is only legal to have one immediate ORB in progress at a time.

+

kFWSBP2CommandNormalORB - ORB format 0 - Format specified by SBP2 standard. Set this for most ORBs.

+

kFWSBP2CommandReservedORB - ORB format 1 - Format reserved by SBP2 standard for future standardization.

+

kFWSBP2CommandVendorORB - ORB format 2 - Format specified by SBP2 standard for vendor dependent ORBs.

+

kFWSBP2CommandDummyORB - ORB format 3 - Format specified by SBP2 standard for dummy ORBs.

+

kFWSBP2CommandCheckGeneration - If set upon submitORB, the ORB will only be appended if generation set with setCommandGeneration() matches the current generation. Pretty much all SBP2 drivers need sophisticated logic to track login state, so this is generally not used.

+

kFWSBP2CommandFixedSize - Do not allocate more memory for page table if needed. If there is not enough space in the currently allocated page table, the setCommandBuffers call will fail. This is important to set if your device is the backing store, as we don't want to cause memory allocations on the paging path.

+

kFWSBP2CommandVirtualORBs - Normally ORBs are backed by physical address spaces. Setting this flag makes this ORB backed by a pseudo address space. This can make ORBs easier to see in a bus trace. Virtual ORBs will have an address in the form of ffcX.XXXX.0000.0000. Pseudo address space backed ORBs are slower, so you won't want to set for deployment builds.

+ @param flags The flags to be set. + */ + + virtual void setCommandFlags( UInt32 flags ); + + /*! + @function getCommandFlags + @abstract Sets configuration flags for the ORB. + @discussion Returns the current configuration flags set on this ORB. + @result Return The current ORB flags. + */ + + virtual UInt32 getCommandFlags( void ); + + /*! + @function setMaxPayloadSize + @abstract Sets max payload size for the ORB. + @discussion This sets the maximum payload size for this ORB only. This size is clipped by + the global max payload size set in the login object. + @param maxPayloadSize The maximum payload size in bytes. + */ + + virtual void setMaxPayloadSize( UInt32 maxPayloadSize ); + + /*! + @function getMaxPayloadSize + @abstract Gets max payload size for the ORB. + @discussion This gets the maximum payload size for this ORB only. + @result Returns the maximum payload size in bytes. + */ + + virtual UInt32 getMaxPayloadSize( void ); + + /*! + @function setCommandTimeout + @abstract Sets the timeout of the ORB. + @discussion This sets the timeout for the ORB in milliseconds. Note that ORBs without timeouts + can be "lost." You will obviously not recieve timeout notification for timeouts of zero. But + perhaps less obviously you will not recieve orb reset notification, which is really a sort of + accelerated timeout notification for bus reset situations. + @param timeout The timeout duration in milliseconds. + */ + + virtual void setCommandTimeout( UInt32 timeout ); + + /*! + @function getCommandTimeout + @abstract Gets the timeout of the ORB. + @discussion This method gets the timeout for this ORB in milliseconds. + @result Returns the timeout for the orb in milliseconds. + */ + + virtual UInt32 getCommandTimeout( void ); + + + /*! + @function setCommandGeneration + @abstract Sets the command generation. + @discussion This sets the bus generation this ORB should be appended in. It is only meaningful + when combined with the kFWSBP2CommandCheckGeneration flags above. + @param gen The bus generation for command execution. + */ + + virtual void setCommandGeneration( UInt32 gen ); + + /*! + @function getCommandGeneration + @abstract Gets the command generation. + @discussion This gets the bus generation this ORB should be appended in. + @result Returns the bus generation for command execution. + */ + + virtual UInt32 getCommandGeneration( void ); + + /*! + @function setRefCon + @abstract Sets the ORB refCon. + @discussion Sets a user defined value on the ORB that can be retrieved later with the + method getRefCon. + @param refCon a user defined value. + */ + + virtual void setRefCon( void * refCon ); + + /*! + @function getRefCon + @abstract Returns the refCon set with setRefCon. + @discussion Returns the user defined value previously stored in the ORB with setRefCon. + @result Returns the previously stored user defined value. + */ + + virtual void * getRefCon( void ); + +protected: + + virtual void setToDummy( void ); + +public: + /*! + @function getORBAddress + @abstract Returns the FireWire address of this ORB. + @discussion Returns the FireWire bus address of this ORB. This is not the same as the Macintosh + address for the IOFireWireSBP2ORB. + @result Returns the FireWire address of this ORB. + */ + + virtual void getORBAddress( FWAddress * address ); + +protected: + + virtual bool isAppended( void ); + virtual void setIsAppended( bool state ); + virtual UInt32 getFetchAgentWriteRetries( void ); + virtual void setFetchAgentWriteRetries( UInt32 retries ); + + virtual void prepareFastStartPacket( IOBufferMemoryDescriptor * descriptor ); + + UInt32 getFetchAgentWriteRetryInterval( void ); + void setFetchAgentWriteRetryInterval( UInt32 interval ); + + IOReturn completeBufferAddressSpace( void ); + IOReturn prepareBufferAddressSpace( IOMemoryDescriptor * memoryDescriptor ); + +public: + + /*! + @function setBufferConstraints + @abstract Configures page table generation parameters + @discussion Sets the maximums size of any page table segment and the required alignemnt. Double buffering + may be used to satisfy these constraints. The only supported option is kFWSBP2ConstraintForceDoubleBuffer which + forces a page aligned double buffering of the entire descriptor. + @result May return an error if there is a problem allocating the underlying resources or if buffers are currently attached. + */ + + IOReturn setBufferConstraints( UInt64 maxSegmentSize, UInt32 alignment, UInt32 options = 0); + + + /*! + @function setCommandBuffersAsRanges64 + @abstract Creates a page table from a list of 64 bit ranges. + @discussion Creates a page table with the given parameters. Any addresses mapped by this method + must remain valid until setCommandBuffers is called again or releaseCommandBuffers is called. + The SBP2 services do not release references to the command buffers just because the command + has completed. This is a 64 bit compatible version of setCommandBuffersAsRanges. + @param ranges An array of ranges representing the data to be transfered. + @param withCount The number of ranges in the ranges array. + @param withDirection An IODirection indicating the direction of data transfer. + @param withTask The task that these adressses reside in. + @param offset Offset in bytes into data to begin writing table at. + @param length Number of bytes of data to map from offset. + @result Returns KIOReturnSuccess if the page table was written successfully. + */ + + IOReturn setCommandBuffersAsRanges64( IOAddressRange * ranges, + uint64_t withCount, + IODirection withDirection, + task_t withTask, + uint64_t offset = 0, + uint64_t length = 0); + + /*! + @function setRefCon64 + @abstract Sets the ORB refCon as a 64 bit value. + @discussion Sets a user defined value on the ORB that can be retrieved later with the + method getRefCon. + @param refCon a user defined value. + */ + + virtual void setRefCon64( UInt64 refCon ); + + /*! + @function getRefCon64 + @abstract Returns the 64 bit refCon set with setRefCon64. + @discussion Returns the user defined value previously stored in the ORB with setRefCon. + @result Returns the previously stored user defined value. + */ + + virtual UInt64 getRefCon64( void ); + +protected: + + UInt32 calculateTransferSizeLog( bool * clipping ); + + +}; + +#endif diff --git a/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2Target.h b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2Target.h new file mode 100644 index 0000000..4288ce9 --- /dev/null +++ b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2Target.h @@ -0,0 +1,224 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2Target + Contains the class definition for IOFireWireSBP2Target. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2TARGET_H +#define _IOKIT_IOFIREWIRESBP2TARGET_H + +#include +#include + +enum +{ + kIOFWSBP2FailsOnAckBusy = (1 << 0), + kIOFWSBP2FailsOnBusResetsDuringIO = (1 << 1), + kIOFWSBP2DontUsePTPacketLimit = (1 << 2) +}; + +/*! + @class IOFireWireSBP2Target + @abstract Serves as bridge between IOFireWireUnit and IOFireWireLUN. + @discussion Matches against IOFireWireUnits supporting the SBP2 protocol. Creates IOFireWireSBP2LUN nubs for matching. Most drivers will match against an IOFireWireSBP2LUN, but matching against an IOFireWireSBP2Target is also supported. This can be useful in cases where a single driver wishes to + control all LUNs on a device. Support for this technique is minimal, however, and the driver will be + required to discover it's LUNs through the registry. +*/ + +class IOFireWireSBP2Target : public IOService +{ + OSDeclareDefaultStructors(IOFireWireSBP2Target); + +protected: + + ///////////////////////////////////////// + // rom keys + + enum + { + kCmdSpecIDKey = 0x38, + kCmdSetKey = 0x39, + kSoftwareRevKey = 0x3b, + kFirmwareRevKey = 0x3c, + kLUNKey = 0x14, + kLUNDirectoryKey = 0xd4, + kManagementAgentOffsetKey = 0x54, + kUnitCharacteristicsKey = 0x3A, + kRevisionKey = 0x21, + kFastStartKey = 0x3E + }; + + typedef struct + { + UInt32 cmdSpecID; + UInt32 cmdSet; + UInt32 vendorID; + UInt32 softwareRev; + UInt32 firmwareRev; + UInt32 lun; + UInt32 devType; + UInt32 unitCharacteristics; + UInt32 managementOffset; + UInt32 revision; + bool fastStartSupported; + UInt32 fastStart; + } LUNInfo; + + // reserved for future use + struct ExpansionData + { + bool fStarted; + OSArray * fPendingMgtAgentCommands ; + UInt32 fNumberPendingMgtAgentOrbs; + UInt32 fNumLUNs; + }; + ExpansionData * fExpansionData; + + ///////////////////////////////////////// + // private fields + + bool fOpenFromTarget; + UInt32 fOpenFromLUNCount; + IOFireWireUnit * fProviderUnit; + UInt32 fFlags; + + IOFireWireController * fControl; + + UInt32 fIOCriticalSectionCount; + + ///////////////////////////////////////// + // private internals + + virtual void free( void ); + virtual IOReturn message( UInt32 type, + IOService * provider, + void * argument = 0); + + virtual void scanForLUNs( void ); + IOReturn createLUN( LUNInfo * info ); + +public: + + ///////////////////////////////////////// + // public methods + + /*! @function handleOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result Return true if the open was successful, false otherwise. */ + + virtual bool handleOpen( IOService * forClient, IOOptionBits options, void * arg ); + + /*! + @function handleClose + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of handleOpen. + */ + + virtual void handleClose( IOService * forClient, IOOptionBits options ); + + /*! + @function handleIsOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient If non-zero, isOpen returns the open state for that client. If zero is passed, isOpen returns the open state for all clients. + @result Returns true if the specific, or any, client has the IOService open. + */ + + virtual bool handleIsOpen( const IOService * forClient ) const; + + /*! + @function start + @abstract During an IOService instantiation, the start method is called when the IOService has been selected to run on the provider. + @discussion See IOService for discussion. + @result Return true if the start was successful, false otherwise (which will cause the instance to be detached and usually freed). + */ + + virtual bool start( IOService *provider ); + + /*! + @function stop + @abstract During an IOService termination, the stop method is called in its clients before they are detached & it is destroyed. + @discussion See IOService for discussion. + */ + + virtual void stop( IOService *provider ); + + /*! + @function getFireWireUnit + @abstract Returns an IOFireWireUnit object. + @discussion An IOFireWireUnit is the provider of an IOFireWireSBP2Target. In order to use the base FireWire services + you will need a reference to the unit. This method returns that reference. + @result Returns a pointer to an IOFireWireUnit. + */ + + virtual IOFireWireUnit * getFireWireUnit( void ); + + /*! + @function matchPropertyTable + @abstract Implements SBP2 specific matching. + @discussion See IOService for discussion. + @param table The dictionary of properties to be matched against. + @result Returns false if the family considers the matching dictionary does not match in properties it understands, true otherwise. + */ + + virtual bool matchPropertyTable( OSDictionary * table ); + + virtual void setTargetFlags( UInt32 flags ); + virtual UInt32 getTargetFlags( void ); + +protected: + virtual void configurePhysicalFilter( void ); + +public: + virtual void clearTargetFlags( UInt32 flags ); + virtual IOReturn beginIOCriticalSection( void ); + virtual void endIOCriticalSection( void ); + + virtual bool finalize( IOOptionBits options ); + + IOReturn synchMgmtAgentAccess( IOFWCommand * mgmtOrbCommand ); + void completeMgmtAgentAccess( ); + void clearMgmtAgentAccess( ); + void cancelMgmtAgentAccess( IOFWCommand * mgmtOrbCommand ); + +protected: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 0); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 8); + +}; + +#endif diff --git a/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2UserClient.h b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2UserClient.h new file mode 100644 index 0000000..a469558 --- /dev/null +++ b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2UserClient.h @@ -0,0 +1,188 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIRESBP2USERCLIENT_H +#define _IOKIT_IOFIREWIRESBP2USERCLIENT_H + +#include + +#define FIREWIREPRIVATE +#include +#undef FIREWIREPRIVATE + +#include + +#include +#include + +class IOFireWireSBP2UserClient : public IOUserClient +{ + OSDeclareDefaultStructors(IOFireWireSBP2UserClient) + +protected: + + bool fOpened; + bool fStarted; + IOFireWireSBP2Login * fLogin; + task_t fTask; + + IOFireWireSBP2LUN * fProviderLUN; + OSAsyncReference64 fMessageCallbackAsyncRef; + OSAsyncReference64 fLoginCallbackAsyncRef; + OSAsyncReference64 fLogoutCallbackAsyncRef; + OSAsyncReference64 fUnsolicitedStatusNotifyAsyncRef; + OSAsyncReference64 fStatusNotifyAsyncRef; + OSAsyncReference64 fFetchAgentResetAsyncRef; + OSAsyncReference64 fFetchAgentWriteAsyncRef; + + IOFWUserObjectExporter * fExporter; + + IOFireWireLib::UserObjectHandle fSessionRef; + + IOLock * fUserClientLock; + + virtual IOReturn externalMethod( uint32_t selector, + IOExternalMethodArguments * args, + IOExternalMethodDispatch * dispatch, + OSObject * target, + void * reference ); +public: + + virtual bool initWithTask( task_t owningTask, void * securityToken, UInt32 type, OSDictionary * properties ); + virtual void free (); + + virtual bool start( IOService * provider ); + + virtual IOReturn clientClose( void ); + virtual IOReturn clientDied( void ); + + // IOFireWireSBP2ManagementORB friend class wrappers + virtual void flushAllManagementORBs( void ); + + ///////////////////////////////////////////////// + // IOFireWireSBP2LUN + + IOReturn open( IOExternalMethodArguments * arguments ); + IOReturn openWithSessionRef( IOExternalMethodArguments * arguments ); + IOReturn getSessionRef( IOExternalMethodArguments * arguments ); + IOReturn close( IOExternalMethodArguments * arguments ); + + // callbacks + IOReturn setMessageCallback( IOExternalMethodArguments * arguments ); + virtual IOReturn message( UInt32 type, IOService * provider, void * arg ); + + ///////////////////////////////////////////////// + // IOFireWireSBP2Login + + IOReturn setLoginCallback( IOExternalMethodArguments * arguments ); + IOReturn setLogoutCallback( IOExternalMethodArguments * arguments ); + IOReturn setUnsolicitedStatusNotify( IOExternalMethodArguments * arguments ); + IOReturn setStatusNotify( IOExternalMethodArguments * arguments ); + IOReturn createLogin( IOExternalMethodArguments * arguments ); + IOReturn releaseLogin( IOExternalMethodArguments * arguments ); + IOReturn submitLogin( IOExternalMethodArguments * arguments ); + IOReturn submitLogout( IOExternalMethodArguments * arguments ); + IOReturn setLoginFlags( IOExternalMethodArguments * arguments ); + IOReturn getMaxCommandBlockSize( IOExternalMethodArguments * arguments ); + IOReturn getLoginID( IOExternalMethodArguments * arguments ); + IOReturn setReconnectTime( IOExternalMethodArguments * arguments ); + IOReturn setMaxPayloadSize( IOExternalMethodArguments * arguments ); + + IOReturn submitFetchAgentReset( IOExternalMethodArguments * arguments ); + IOReturn setFetchAgentWriteCompletion( IOExternalMethodArguments * arguments ); + IOReturn ringDoorbell( IOExternalMethodArguments * arguments ); + IOReturn enableUnsolicitedStatus( IOExternalMethodArguments * arguments ); + IOReturn setBusyTimeoutRegisterValue( IOExternalMethodArguments * arguments ); + IOReturn setPassword( IOExternalMethodArguments * arguments ); + + // callbacks + + static void staticLoginCallback( void * refCon, FWSBP2LoginCompleteParamsPtr params ); + virtual void loginCallback( FWSBP2LoginCompleteParamsPtr params ); + + static void staticLogoutCallback( void * refCon, FWSBP2LogoutCompleteParamsPtr params ); + virtual void logoutCallback( FWSBP2LogoutCompleteParamsPtr params ); + + static void staticStatusNotify( void * refCon, FWSBP2NotifyParams * params ); + virtual void statusNotify( FWSBP2NotifyParams * params ); + + static void staticUnsolicitedNotify( void * refCon, FWSBP2NotifyParams * params ); + virtual void unsolicitedNotify( FWSBP2NotifyParams * params ); + + static void staticFetchAgentWriteComplete( void * refCon, IOReturn status, IOFireWireSBP2ORB * orb ); + virtual void fetchAgentWriteComplete( IOReturn status, IOFireWireSBP2ORB * orb ); + + static void staticFetchAgentResetComplete( void * refCon, IOReturn status ); + virtual void fetchAgentResetComplete( IOReturn status ); + + ///////////////////////////////////////////////// + // IOFireWireSBP2ORB + + IOReturn createORB( IOExternalMethodArguments * arguments ); + IOReturn releaseORB( IOExternalMethodArguments * arguments ); + IOReturn submitORB( IOExternalMethodArguments * arguments ); + IOReturn setCommandFlags( IOExternalMethodArguments * arguments ); + IOReturn setORBRefCon( IOExternalMethodArguments * arguments ); + IOReturn setMaxORBPayloadSize( IOExternalMethodArguments * arguments ); + IOReturn setCommandTimeout( IOExternalMethodArguments * arguments ); + IOReturn setCommandGeneration( IOExternalMethodArguments * arguments ); + IOReturn setToDummy( IOExternalMethodArguments * arguments ); + IOReturn setCommandBuffersAsRanges( IOExternalMethodArguments * arguments ); + IOReturn releaseCommandBuffers( IOExternalMethodArguments * arguments ); + IOReturn setCommandBlock( IOExternalMethodArguments * arguments ); + + // LSI workaround + IOReturn LSIWorkaroundSetCommandBuffersAsRanges( IOExternalMethodArguments * arguments ); + IOReturn LSIWorkaroundSyncBuffersForOutput( IOExternalMethodArguments * arguments ); + IOReturn LSIWorkaroundSyncBuffersForInput( IOExternalMethodArguments * arguments ); + + ///////////////////////////////////////////////// + // IOFireWireSBP2MgmtORB + + IOReturn createMgmtORB( IOExternalMethodArguments * arguments ); + IOReturn releaseMgmtORB( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBCallback( IOExternalMethodArguments * arguments ); + IOReturn submitMgmtORB( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBCommandFunction( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBManageeORB( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBManageeLogin( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBResponseBuffer( IOExternalMethodArguments * arguments ); + + // callbacks + static void staticMgmtORBCallback( void * refCon, IOReturn status, IOFireWireSBP2ManagementORB * orb ); + virtual void mgmtORBCallback( IOReturn status, IOFireWireSBP2ManagementORB * orb ); + + // IOFireWireSBP2MgmtORB friend class wrappers + virtual void setMgmtORBAsyncCallbackReference( IOFireWireSBP2ManagementORB * orb, void * asyncRef ); + virtual void getMgmtORBAsyncCallbackReference( IOFireWireSBP2ManagementORB * orb, void * asyncRef ); + + uint32_t checkScalarInputCount; + uint32_t checkStructureInputSize; + uint32_t checkScalarOutputCount; + uint32_t checkStructureOutputSize; + + IOReturn checkArguments( IOExternalMethodArguments * args, uint32_t scalarInCount, uint32_t structInCount, + uint32_t scalarOutCount, uint32_t structOutCount ); + +}; + +#endif diff --git a/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2UserClientCommon.h b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2UserClientCommon.h new file mode 100644 index 0000000..cb114ba --- /dev/null +++ b/QualcommWireless/include/IOKit/sbp2/IOFireWireSBP2UserClientCommon.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIRESBP2USERCLIENTCOMMON_H_ +#define _IOKIT_IOFIREWIRESBP2USERCLIENTCOMMON_H_ + +#define kIOFireWireSBP2LibConnection 12 + +enum IOFWSBP2UserClientCommandCodes { + kIOFWSBP2UserClientOpen, // kIOUCScalarIScalarO 0,0 + kIOFWSBP2UserClientClose, // kIOUCScalarIScalarO 0,0 + kIOFWSBP2UserClientCreateLogin, // kIOUCScalarIScalarO 0,1 + kIOFWSBP2UserClientReleaseLogin, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSubmitLogin, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSubmitLogout, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetLoginFlags, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientGetMaxCommandBlockSize, // kIOUCScalarIScalarO 1,1 + kIOFWSBP2UserClientGetLoginID, // kIOUCScalarIScalarO 1,1 + kIOFWSBP2UserClientSetReconnectTime, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetMaxPayloadSize, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientCreateORB, // kIOUCScalarIScalarO 0,1 + kIOFWSBP2UserClientReleaseORB, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSubmitORB, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetCommandFlags, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientSetMaxORBPayloadSize, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientSetCommandTimeout, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientSetCommandGeneration, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientSetToDummy, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetCommandBuffersAsRanges, // kIOUCScalarIScalarO 6,0 + kIOFWSBP2UserClientReleaseCommandBuffers, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetCommandBlock, // kIOUCScalarIScalarO 3,0 + kIOFWSBP2UserClientCreateMgmtORB, // kIOUCScalarIScalarO 0,1 + kIOFWSBP2UserClientReleaseMgmtORB, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSubmitMgmtORB, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientMgmtORBSetCommandFunction, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientMgmtORBSetManageeORB, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientMgmtORBSetManageeLogin, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientMgmtORBSetResponseBuffer, // kIOUCScalarIScalarO 3,0 + kIOFWSBP2UserClientLSIWorkaroundSetCommandBuffersAsRanges, // kIOUCScalarIScalarO 6,0 + kIOFWSBP2UserClientMgmtORBLSIWorkaroundSyncBuffersForOutput, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientMgmtORBLSIWorkaroundSyncBuffersForInput, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientOpenWithSessionRef, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientGetSessionRef, // kIOUCScalarIScalarO 0,1 + kIOFWSBP2UserClientRingDoorbell, // kIOUCScalarIScalarO 1, 0 + kIOFWSBP2UserClientEnableUnsolicitedStatus, // kIOUCScalarIScalarO 1, 0 + kIOFWSBP2UserClientSetBusyTimeoutRegisterValue, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetORBRefCon, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetPassword, // kIOUCScalarIScalarO 3, 0 + kIOFWSBP2UserClientSetMessageCallback, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetLoginCallback, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetLogoutCallback, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetUnsolicitedStatusNotify, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetStatusNotify, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetMgmtORBCallback, // kIOUCScalarIScalarO 3, 0 + kIOFWSBP2UserClientSubmitFetchAgentReset, // kIOUCScalarIScalarO 3, 0 + kIOFWSBP2UserClientSetFetchAgentWriteCompletion, // kIOUCScalarIScalaO 2, 0 + kIOFWSBP2UserClientNumCommands +}; + +#endif \ No newline at end of file diff --git a/QualcommWireless/include/IOKit/sbp2/IOFireWireSerialBusProtocolTransport.h b/QualcommWireless/include/IOKit/sbp2/IOFireWireSerialBusProtocolTransport.h new file mode 100644 index 0000000..4e0276e --- /dev/null +++ b/QualcommWireless/include/IOKit/sbp2/IOFireWireSerialBusProtocolTransport.h @@ -0,0 +1,449 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/*! + @header IOFireWireSerialBusProtocolTransport + Contains the class definition for IOFireWireSerialBusProtocolTransport. +*/ + + +#ifndef _IOKIT_IO_FIREWIRE_SERIAL_BUS_PROTOCOL_TRANSPORT_H_ +#define _IOKIT_IO_FIREWIRE_SERIAL_BUS_PROTOCOL_TRANSPORT_H_ + + +#include +#include +#include +#include +#include +#include +#include + +#include + +/*! + @class IOFireWireSerialBusProtocolTransport + @abstract SCSI Protocol Driver Family for FireWire SBP2 Devices. + @discussion IOFireWireSerialBusProtocolTransport contains all the bus specific support for FireWire + SBP2 compliant devices. To add vendor specific features or workarounds you will sub-class the appropriate + methods of this family. +*/ + +class IOFireWireSerialBusProtocolTransport : public IOSCSIProtocolServices +{ + + OSDeclareDefaultStructors ( IOFireWireSerialBusProtocolTransport ) + +private: + + IOFireWireUnit * fUnit; + IOFireWireSBP2LUN * fSBPTarget; + IOFireWireSBP2Login * fLogin; + IOFireWireSBP2ORB * fORB; + IOFireWireSBP2ManagementORB * fLUNResetORB; + + // /!\ WARNING! NOT USED left behind for legacy binary reasons + __unused IOSimpleLock * fQueueLock; + + UInt32 fLoginRetryCount; + bool fDeferRegisterService; + bool fNeedLogin; + + // /!\ WARNING! NOT USED left behind for legacy binary reasons + __unused bool fPhysicallyConnected; + + static void + StatusNotifyStatic ( void * refCon, FWSBP2NotifyParamsPtr params ); + + static void + UnsolicitedStatusNotifyStatic ( void * refCon, + FWSBP2NotifyParamsPtr params ); + + static void + LunResetCompleteStatic ( void * refCon, + IOReturn status, + IOFireWireSBP2ManagementORB * orb ); + + static void + FetchAgentResetCompleteStatic ( void * refcon, + IOReturn status ); + + static IOReturn + ConnectToDeviceStatic ( OSObject * refCon, void *, void *, void *, void * ); + + virtual void + FetchAgentResetComplete ( IOReturn status ); + + static void LoginCompletionStatic ( void * refCon, FWSBP2LoginCompleteParams * params ); + + static void + LogoutCompletionStatic ( void * refCon, FWSBP2LogoutCompleteParams * params ); + + /*! + @function CoalesceSenseData + @abstract CoalesceSenseData convert a SBP-2 status block into a SPC-2 sense block. + @discussion CoalesceSenseData pulls the appropriate bits out of the SBP2 sense block + as defined in SBP-2 Annex B section B.2 and dynamically builds a sense data block as + defined in SPC-2 section 7.23.2. + */ + + SCSITaskStatus + CoalesceSenseData ( FWSBP2StatusBlock * sourceData, + UInt8 quadletCount, + SCSI_Sense_Data * targetData ); + + virtual void ConnectToDevice ( void ); + + virtual void DisconnectFromDevice ( void ); + + virtual bool IsDeviceCPUInDiskMode ( void ); + +protected: + + /*! + @function AllocateResources + @abstract Allocate Resources. + @discussion Called from start method to allocate needed resources. + */ + + virtual IOReturn AllocateResources ( void ); + + /*! + @function DeallocateResources + @abstract Deallocate Resources. + @discussion Called from cleanUp method to deallocate resources. + */ + + virtual void DeallocateResources ( void ); + + enum SBP2LoginState + { + kFirstTimeLoggingInState, + kLogginSucceededState, + kLogginFailedState + }; + + /*! + @typedef SBP2ClientOrbData + @param orb IOFireWireSBP2ORB for request. + @param scsiTask SCSITaskIdentifier of request. + @param serviceResponse SCSIServiceResponse of request. + @param taskStatus SCSITaskStatus of request. + @discussion This structure is stuffed into the refcon so we can associate which + IOFireWireSBP2ORB and SCSITaskIdentifier is completing. + */ + + typedef struct { + IOFireWireSBP2ORB * orb; + SCSITaskIdentifier scsiTask; + SCSIServiceResponse serviceResponse; + SCSITaskStatus taskStatus; + IOBufferMemoryDescriptor * quadletAlignedBuffer; + } SBP2ClientOrbData; + + static const UInt32 kDefaultBusyTimeoutValue = 0x0000000F; + static const UInt64 kMaxFireWireLUN = 0xFFFF; + static const UInt32 kMaxFireWirePayload = 4096; + static const UInt32 kMaxLoginRetryCount = 8; + static const UInt32 kMaxReconnectCount = 128; + static const UInt32 kCSRModelInfoKey = 0x17; + + UInt32 fReconnectCount; + bool fLoggedIn; + + // binary compatibility instance variable expansion + struct ExpansionData + { + IOCommandPool * fCommandPool; + IOCommandPool * fSubmitQueue; + SBP2LoginState fLoginState; + bool fLUNResetPathFlag; + int fLUNResetCount; + bool fAlwaysSetSenseData; + bool fAutonomousSpinDownWorkAround; + }; + + ExpansionData * reserved; + + bool fObjectIsOpen; + + /*! + @function CommandORBAccessor + @abstract accessor function for fORB. + @discussion xxx. + */ + + IOFireWireSBP2ORB * CommandORBAccessor ( void ); + + /*! + @function SBP2LoginAccessor + @abstract accessor function for fLogin. + @discussion xxx. + */ + + IOFireWireSBP2Login * SBP2LoginAccessor ( void ); + + virtual IOReturn + message ( UInt32 type, IOService * provider, void * argument = 0 ) APPLE_KEXT_OVERRIDE; + + /*! + @function SendSCSICommand + @abstract Prepare and send a SCSI command to the device. + @discussion The incoming SCSITaskIdentifier gets turned into a IOFireWireSBP2ORB + and is submitted to the SBP2 layer. See IOSCSIProtocolServices.h for more details + regarding SendSCSICommand. Also see IOFireWireSBP2Lib.h for details regarding the + IOFireWireSBP2ORB structure and the submitORB method. + @result If the command was sent to the device and is pending completion, the + subclass should return true and return back the kSCSIServiceResponse_Request_In_Process response. + If the command completes immediately with an error, the subclass will return true + and return back the appropriate status. If the subclass is currently processing all the + commands it can, the subclass will return false and the command will be resent next time + CommandCompleted is called. + */ + + virtual bool + SendSCSICommand ( SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ) APPLE_KEXT_OVERRIDE; + + /*! + @function SetCommandBuffers + @abstract Method to set orb's buffers. + @discussion This method was added so that subclasses can override and massage buffers as + needed. The default simply calls setCommandBuffers. See IOFireWireSBP2Lib.h for details + regarding the setCommandBuffers method. + @result xxx. + */ + + virtual IOReturn + SetCommandBuffers ( IOFireWireSBP2ORB * orb, SCSITaskIdentifier request ); + + /*! + @function CompleteSCSITask + @abstract This qualifies and sets appropriate data then calls CommandCompleted. + @discussion See IOSCSIProtocolServices.h for more details + regarding CommandCompleted. + */ + + virtual void + CompleteSCSITask ( IOFireWireSBP2ORB * orb ); + + /*! + @function AbortSCSICommand + @abstract This method is intended to abort an in progress SCSI Task. + @discussion Currently not implemented in super class. This is a stub method for adding + the abort command in the near future. + @result See SCSITask.h for SCSIServiceResponse codes. + */ + + virtual SCSIServiceResponse + AbortSCSICommand ( SCSITaskIdentifier request ) APPLE_KEXT_OVERRIDE; + + /*! + @function StatusNotify + @abstract This is our handler for status. + @discussion See IOFireWireSBP2Lib.h for details regarding the FWSBP2NotifyParams + structure that is passed in to the completion.. + */ + + virtual void + StatusNotify ( FWSBP2NotifyParams * params ); + + /*! + @function SetValidAutoSenseData + @abstract Set the auto sense data that was returned for a given SCSI Task. + @discussion SetValidAutoSenseData is called to qualify sense data that is copied to the + client via the SetAutoSenseData method. See IOSCSIProtocolServices.h for more details + regarding SetAutoSenseData. + */ + + void + SetValidAutoSenseData ( SBP2ClientOrbData * clientData, + FWSBP2StatusBlock * statusBlock, + SCSI_Sense_Data * targetData ); + + /*! + @function UnsolicitedStatusNotify + @abstract This is our handler for unsolicited status. + @discussion After we have parsed and handled the unsolicited status we call + enableUnsolicitedStatus. See IOFireWireSBP2Lib.h for details regarding the + enableUnsolicitedStatus method. + */ + + virtual void + UnsolicitedStatusNotify ( FWSBP2NotifyParamsPtr params ); + + /*! + @function LoginCompletion + @abstract Completion routine for login complete. + @discussion See IOFireWireSBP2Lib.h for details regarding the FWSBP2LogoutCompleteParams + structure that is passed in to the completion. + */ + + virtual void + LoginCompletion ( FWSBP2LoginCompleteParams * params ); + + /*! + @function LogoutCompletion + @abstract Completion routine for logout complete. + @discussion See IOFireWireSBP2Lib.h for details regarding the FWSBP2LogoutCompleteParams + structure that is passed in to the completion. + */ + + virtual void + LogoutCompletion ( FWSBP2LogoutCompleteParams * params ); + + /*! + @function IsProtocolServiceSupported + @abstract Determine is specified feature is supported by the protocol layer. + @discussion If the service has a value that must be returned, it will be returned in the + serviceValue output parameter. See IOSCSIProtocolServices.h for more details regarding + IsProtocolServiceSupported. + @result Will return true if the specified feature is supported by the protocol layer. + */ + + virtual bool + IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue ) APPLE_KEXT_OVERRIDE; + + /*! + @function HandleProtocolServiceFeature + @abstract Handle specified feature supported by the protocol layer. + @discussion See IOSCSIProtocolServices.h for more details regarding HandleProtocolServiceFeature. + @result Will return true if the specified feature is supported by the protocol layer. + */ + + virtual bool + HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue ) APPLE_KEXT_OVERRIDE; + + /*! + @function LunResetComplete + @abstract Callback to submit Fetch Agent Reset. + @discussion See IOFireWireSBP2Lib.h for details regarding the submitFetchAgentReset + method. + */ + + virtual void + LunResetComplete ( IOReturn status, IOFireWireSBP2ManagementORB * orb ); + +public: + + /*! + @function init + @abstract See IOService for discussion. + @discussion Setup and prime class into known state. + */ + + bool init ( OSDictionary * propTable ) APPLE_KEXT_OVERRIDE; + + /*! + @function start + @discussion See IOService for discussion. + @result Return true if the start was successful, false otherwise ( which will + cause the instance to be detached and usually freed ). + */ + + virtual bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + + /*! + @function cleanUp + @abstract cleanUp is called to tear down IOFireWireSerialBusProtocolTransport. + @discussion cleanUp is called when we receive a kIOFWMessageServiceIsRequestingClose + message or if we fail our initialization. + */ + + virtual void cleanUp ( void ); + + /*! + @function finalize + @abstract See IOService for discussion. + @result Returns true. + */ + + virtual bool finalize ( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + /*! + @function free + @discussion See IOService for discussion. + @result none. + */ + + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + +protected: + + virtual IOReturn login ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 1 ); + + virtual IOReturn submitLogin ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 2 ); + + virtual void loginLost ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 3 ); + + void loginSuspended ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 4 ); + + virtual void loginResumed ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 5 ); + + static IOReturn CriticalOrbSubmissionStatic ( + OSObject * refCon, + void * val1, + void * val2, + void * val3, + void * val4 ); + + /*! + @function CriticalOrbSubmission + @abstract xxx. + @discussion xxx. + @result none. + */ + + void + CriticalOrbSubmission ( + IOFireWireSBP2ORB * orb, + SCSITaskIdentifier request ); + + virtual void submitOrbFromQueue ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 6 ); + +private: + + // binary compatibility reserved method space + + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 7 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 8 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 9 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 10 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 11 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 12 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 13 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 14 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 15 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 16 ); + +}; + +#endif /* _IOKIT_IO_FIREWIRE_SERIAL_BUS_PROTOCOL_TRANSPORT_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOBDServices.h b/QualcommWireless/include/IOKit/scsi/IOBDServices.h new file mode 100644 index 0000000..55a6e31 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOBDServices.h @@ -0,0 +1,240 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_BD_SERVICES_H_ +#define _IOKIT_IO_BD_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// IOKit includes +#include + +// Generic IOKit storage related headers +#include +#include + +// SCSI Architecture Model Family includes +#include + +class IOMemoryDescriptor; + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOBDServices : public IOBDBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOBDServices ) + +protected: + + OSSet * fClients; + IOSCSIPeripheralDeviceType05 * fProvider; + + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + + // Reserve space for future expansion. + struct IOBDServicesExpansionData { }; + IOBDServicesExpansionData * fIOBDServicesReserved; + +public: + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doEjectMedia ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ) APPLE_KEXT_OVERRIDE; + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const APPLE_KEXT_OVERRIDE; + virtual IOReturn doSynchronizeCache ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn getWriteCacheState ( bool * enabled ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setWriteCacheState ( bool enabled ) APPLE_KEXT_OVERRIDE; + + virtual char * getVendorString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getProductString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getRevisionString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getAdditionalDeviceInfoString ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportEjectability ( bool * isEjectable ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportRemovability ( bool * isRemovable ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ) APPLE_KEXT_OVERRIDE; + + /* CD Specific */ + virtual IOReturn doAsyncReadCD ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn readISRC ( UInt8 track, CDISRC isrc ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn readMCN ( CDMCN mcn) APPLE_KEXT_OVERRIDE; + + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn audioPause ( bool pause ); + + virtual IOReturn audioPlay ( CDMSF timeStart, CDMSF timeStop ); + + virtual IOReturn audioScan ( CDMSF timeStart, bool reverse ); + + virtual IOReturn audioStop ( void ); + + virtual IOReturn getAudioStatus ( CDAudioStatus * status ); + + virtual IOReturn getAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume ); + + virtual IOReturn setAudioVolume ( UInt8 leftVolume, UInt8 rightVolume ); + + virtual IOReturn getSpeed ( UInt16 * kilobytesPerSecond ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setSpeed ( UInt16 kilobytesPerSecond ) APPLE_KEXT_OVERRIDE; + + /* DVD Specific */ + virtual UInt32 getMediaType ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 lba, + const UInt8 agid, + const DVDKeyFormat keyFormat ) APPLE_KEXT_OVERRIDE __attribute__ ((deprecated)); + + virtual IOReturn reportKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 lba, + const UInt8 blockCount, + const UInt8 agid, + const DVDKeyFormat keyFormat ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn sendKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt8 agid, + const DVDKeyFormat keyFormat ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn readDVDStructure ( IOMemoryDescriptor * buffer, + const UInt8 structureFormat, + const UInt32 logicalBlockAddress, + const UInt8 layer, + const UInt8 agid ) APPLE_KEXT_OVERRIDE; + + /* BD Specific */ + virtual IOReturn readDiscStructure ( IOMemoryDescriptor * buffer, + UInt8 structureFormat, + UInt32 logicalBlockAddress, + UInt8 layer, + UInt8 agid, + UInt8 mediaType ) APPLE_KEXT_OVERRIDE; + + /* 10.6.0 */ + virtual IOReturn requestIdle ( void ) APPLE_KEXT_OVERRIDE; + + /* System Specific */ + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setProperties ( OSObject * properties ) APPLE_KEXT_OVERRIDE; + + /* User Client Specific */ + virtual bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access ); + + virtual bool handleOpen ( IOService * client, IOOptionBits options, void * access ) APPLE_KEXT_OVERRIDE; + virtual void handleClose ( IOService * client, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual bool handleIsOpen ( const IOService * client ) const APPLE_KEXT_OVERRIDE; + + /* Added with 10.1.3 */ + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 msf, + UInt8 trackSessionNumber, + UInt16 * actualByteCount ) APPLE_KEXT_OVERRIDE; + + /* Added with 10.1.3 */ + virtual IOReturn readDiscInfo ( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ) APPLE_KEXT_OVERRIDE; + + /* Added with 10.1.3 */ + virtual IOReturn readTrackInfo ( IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount ) APPLE_KEXT_OVERRIDE; + + /* Added with 10.5 */ + virtual IOReturn splitTrack ( UInt32 address ) APPLE_KEXT_OVERRIDE; + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOBDServices, 1 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 2 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 3 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 4 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 5 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 6 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 7 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_BD_SERVICES_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOBlockStorageServices.h b/QualcommWireless/include/IOKit/scsi/IOBlockStorageServices.h new file mode 100644 index 0000000..4f756d4 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOBlockStorageServices.h @@ -0,0 +1,164 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_BLOCK_STORAGE_SERVICES_H_ +#define _IOKIT_IO_BLOCK_STORAGE_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// IOKit includes +#include + +// Generic IOKit storage related headers +#include + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOBlockStorageServices : public IOBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOBlockStorageServices ) + +private: + + bool fMediaChanged; /* DEPRECATED */ + bool fMediaPresent; + +protected: + + IOSCSIBlockCommandsDevice * fProvider; + + UInt64 fMaxReadBlocks; + UInt64 fMaxWriteBlocks; + + virtual bool attach ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void detach ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + virtual IOReturn newUserClient ( + task_t owningTask, + void * securityID, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler ) APPLE_KEXT_OVERRIDE; + + // Reserve space for future expansion. + struct IOBlockStorageServicesExpansionData { }; + IOBlockStorageServicesExpansionData * fIOBlockStorageServicesReserved; + +public: + + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ) APPLE_KEXT_OVERRIDE; + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doEjectMedia ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ) APPLE_KEXT_OVERRIDE; + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const APPLE_KEXT_OVERRIDE; + virtual IOReturn doSynchronizeCache ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getVendorString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getProductString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getRevisionString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getAdditionalDeviceInfoString ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportEjectability ( bool * isEjectable ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportRemovability ( bool * isRemovable ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn getWriteCacheState ( bool * enabled ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setWriteCacheState ( bool enabled ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doUnmap ( IOBlockStorageDeviceExtent * extents, + UInt32 extentsCount, + IOStorageUnmapOptions options = 0 ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doGetProvisionStatus ( UInt64 block, + UInt64 nblks, + UInt32 * extentsCount, + IOBlockStorageProvisionDeviceExtent * extents, + IOStorageGetProvisionStatusOptions options = 0) APPLE_KEXT_OVERRIDE; + + +#if !TARGET_OS_IPHONE + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 1 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 2 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 3 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 4 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 5 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 6 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 7 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 8 ); +#endif /* !TARGET_OS_IPHONE */ + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_BLOCK_STORAGE_SERVICES_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOCompactDiscServices.h b/QualcommWireless/include/IOKit/scsi/IOCompactDiscServices.h new file mode 100644 index 0000000..0a9f5ae --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOCompactDiscServices.h @@ -0,0 +1,222 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_COMPACT_DISC_SERVICES_H_ +#define _IOKIT_IO_COMPACT_DISC_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// IOKit includes +#include + +// Generic IOKit storage related headers +#include +#include + +// SCSI Architecture Model Family includes +#include + +class IOMemoryDescriptor; + +// Use this switch to turn off the data cache. +#define _USE_DATA_CACHING_ 1 + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOCompactDiscServices : public IOCDBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOCompactDiscServices ) + +#if (_USE_DATA_CACHING_) + // Data Cache members + bool fUseDataCache; // Indicates if cache should be used. This + // will be set to false if all the necessary support + // for the data cache could not be allocated or + // initialized. + UInt8 * fDataCacheStorage; // Storage space for the cache + UInt32 fDataCacheStartBlock; // Starting block of the data in the cache. + UInt32 fDataCacheBlockCount; // Number of contiguous blocks in the cache + // starting with fDataCacheStartBlock. A value of + // zero in this member indicates that all data + // in the cache is invalid. + + IOSimpleLock * fDataCacheLock; // This is the lock for preventing multiple access + // while manipulating the data cache. +#endif + +protected: + + OSSet * fClients; + IOSCSIPeripheralDeviceType05 * fProvider; + + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + + // Reserve space for future expansion. + struct IOCompactDiscServicesExpansionData { }; + IOCompactDiscServicesExpansionData * fIOCompactDiscServicesReserved; + +public: + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doEjectMedia ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ) APPLE_KEXT_OVERRIDE; + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const APPLE_KEXT_OVERRIDE; + virtual IOReturn doSynchronizeCache ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn getWriteCacheState ( bool * enabled ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setWriteCacheState ( bool enabled ) APPLE_KEXT_OVERRIDE; + + virtual char * getVendorString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getProductString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getRevisionString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getAdditionalDeviceInfoString ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportEjectability ( bool * isEjectable ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportRemovability ( bool * isRemovable ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ) APPLE_KEXT_OVERRIDE; + + /* CD Specific */ + virtual IOReturn doAsyncReadCD ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn readISRC ( UInt8 track, CDISRC isrc ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn readMCN ( CDMCN mcn) APPLE_KEXT_OVERRIDE; + + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn audioPause ( bool pause ); + + virtual IOReturn audioPlay ( CDMSF timeStart, CDMSF timeStop ); + + virtual IOReturn audioScan ( CDMSF timeStart, bool reverse ); + + virtual IOReturn audioStop ( void ); + + virtual IOReturn getAudioStatus ( CDAudioStatus * status ); + + virtual IOReturn getAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume ); + + virtual IOReturn setAudioVolume ( UInt8 leftVolume, UInt8 rightVolume ); + + virtual UInt32 getMediaType ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn getSpeed ( UInt16 * kilobytesPerSecond ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setSpeed ( UInt16 kilobytesPerSecond ) APPLE_KEXT_OVERRIDE; + + /* System Specific */ + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setProperties ( OSObject * properties ) APPLE_KEXT_OVERRIDE; + + /* User Client Specific */ + virtual bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access ); + + virtual bool handleOpen ( IOService * client, IOOptionBits options, void * access ) APPLE_KEXT_OVERRIDE; + virtual void handleClose ( IOService * client, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual bool handleIsOpen ( const IOService * client ) const APPLE_KEXT_OVERRIDE; + + /* Added with 10.1.3 */ + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 msf, + UInt8 trackSessionNumber, + UInt16 * actualByteCount ) APPLE_KEXT_OVERRIDE; + + /* Added with 10.1.3 */ + virtual IOReturn readDiscInfo ( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ) APPLE_KEXT_OVERRIDE; + + /* Added with 10.1.3 */ + virtual IOReturn readTrackInfo ( IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount ) APPLE_KEXT_OVERRIDE; + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 1 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 2 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 3 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 4 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 5 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 6 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 7 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_COMPACT_DISC_SERVICES_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IODVDServices.h b/QualcommWireless/include/IOKit/scsi/IODVDServices.h new file mode 100644 index 0000000..2f276db --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IODVDServices.h @@ -0,0 +1,250 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_DVD_SERVICES_H_ +#define _IOKIT_IO_DVD_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// IOKit includes +#include + +// Generic IOKit storage related headers +#include +#include + +// SCSI Architecture Model Family includes +#include + +class IOMemoryDescriptor; + +// Use this switch to turn off the data cache. +#define _DVD_USE_DATA_CACHING_ 1 + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IODVDServices : public IODVDBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IODVDServices ) + +#if (_DVD_USE_DATA_CACHING_) + // Data Cache members + bool fUseDataCache; // Indicates if cache should be used. This + // will be set to false if all the necessary support + // for the data cache could not be allocated or + // initialized. + UInt8 * fDataCacheStorage; // Storage space for the cache + UInt32 fDataCacheStartBlock; // Starting block of the data in the cache. + UInt32 fDataCacheBlockCount; // Number of contiguous blocks in the cache + // starting with fDataCacheStartBlock. A value of + // zero in this member indicates that all data + // in the cache is invalid. + + IOSimpleLock * fDataCacheLock; // This is the lock for preventing multiple access + // while manipulating the data cache. +#endif + +protected: + + OSSet * fClients; + IOSCSIPeripheralDeviceType05 * fProvider; + + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + + // Reserve space for future expansion. + struct IODVDServicesExpansionData { }; + IODVDServicesExpansionData * fIODVDServicesReserved; + +public: + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doEjectMedia ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ) APPLE_KEXT_OVERRIDE; + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const APPLE_KEXT_OVERRIDE; + virtual IOReturn doSynchronizeCache ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn getWriteCacheState ( bool * enabled ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setWriteCacheState ( bool enabled ) APPLE_KEXT_OVERRIDE; + + virtual char * getVendorString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getProductString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getRevisionString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getAdditionalDeviceInfoString ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportEjectability ( bool * isEjectable ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportRemovability ( bool * isRemovable ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ) APPLE_KEXT_OVERRIDE; + + /* CD Specific */ + virtual IOReturn doAsyncReadCD ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn readISRC ( UInt8 track, CDISRC isrc ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn readMCN ( CDMCN mcn) APPLE_KEXT_OVERRIDE; + + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn audioPause ( bool pause ); + + virtual IOReturn audioPlay ( CDMSF timeStart, CDMSF timeStop ); + + virtual IOReturn audioScan ( CDMSF timeStart, bool reverse ); + + virtual IOReturn audioStop ( void ); + + virtual IOReturn getAudioStatus ( CDAudioStatus * status ); + + virtual IOReturn getAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume ); + + virtual IOReturn setAudioVolume ( UInt8 leftVolume, UInt8 rightVolume ); + + virtual IOReturn getSpeed ( UInt16 * kilobytesPerSecond ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setSpeed ( UInt16 kilobytesPerSecond ) APPLE_KEXT_OVERRIDE; + + /* DVD Specific */ + virtual UInt32 getMediaType ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 lba, + const UInt8 agid, + const DVDKeyFormat keyFormat ) APPLE_KEXT_OVERRIDE __attribute__ ((deprecated)); + + virtual IOReturn reportKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 lba, + const UInt8 blockCount, + const UInt8 agid, + const DVDKeyFormat keyFormat ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn sendKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt8 agid, + const DVDKeyFormat keyFormat ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn readDVDStructure ( IOMemoryDescriptor * buffer, + const UInt8 structureFormat, + const UInt32 logicalBlockAddress, + const UInt8 layer, + const UInt8 agid ) APPLE_KEXT_OVERRIDE; + + /* 10.6.0 */ + virtual IOReturn requestIdle ( void ) APPLE_KEXT_OVERRIDE; + + /* System Specific */ + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ) APPLE_KEXT_OVERRIDE; + virtual IOReturn setProperties ( OSObject * properties ) APPLE_KEXT_OVERRIDE; + + /* User Client Specific */ + virtual bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access ); + + virtual bool handleOpen ( IOService * client, IOOptionBits options, void * access ) APPLE_KEXT_OVERRIDE; + virtual void handleClose ( IOService * client, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual bool handleIsOpen ( const IOService * client ) const APPLE_KEXT_OVERRIDE; + + /* Added with 10.1.3 */ + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 msf, + UInt8 trackSessionNumber, + UInt16 * actualByteCount ) APPLE_KEXT_OVERRIDE; + + /* Added with 10.1.3 */ + virtual IOReturn readDiscInfo ( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ) APPLE_KEXT_OVERRIDE; + + /* Added with 10.1.3 */ + virtual IOReturn readTrackInfo ( IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount ) APPLE_KEXT_OVERRIDE; + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IODVDServices, 1 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 2 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 3 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 4 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 5 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 6 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 7 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_DVD_SERVICES_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOReducedBlockServices.h b/QualcommWireless/include/IOKit/scsi/IOReducedBlockServices.h new file mode 100644 index 0000000..46188af --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOReducedBlockServices.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_REDUCED_BLOCK_SERVICES_H_ +#define _IOKIT_IO_REDUCED_BLOCK_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// Generic IOKit related headers +#include + +// Generic IOKit storage related headers +#include + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOReducedBlockServices : public IOBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOReducedBlockServices ) + + +protected: + // Reserve space for future expansion. + struct IOReducedBlockServicesExpansionData { }; + IOReducedBlockServicesExpansionData * fIOReducedBlockServicesReserved; + + IOSCSIPeripheralDeviceType0E * fProvider; + + virtual bool attach ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void detach ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + + +public: + + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ) APPLE_KEXT_OVERRIDE; + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doEjectMedia ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ) APPLE_KEXT_OVERRIDE; + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const APPLE_KEXT_OVERRIDE; + + virtual IOReturn doSynchronizeCache ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn getWriteCacheState ( bool * enabled ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setWriteCacheState ( bool enabled ) APPLE_KEXT_OVERRIDE; + + virtual char * getVendorString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getProductString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getRevisionString ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * getAdditionalDeviceInfoString ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportEjectability ( bool * isEjectable ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportRemovability ( bool * isRemovable ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ) APPLE_KEXT_OVERRIDE; + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 1 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 2 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 3 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 4 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 5 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 6 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 7 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_REDUCED_BLOCK_SERVICES_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOSCSIBlockCommandsDevice.h b/QualcommWireless/include/IOKit/scsi/IOSCSIBlockCommandsDevice.h new file mode 100644 index 0000000..f99312a --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOSCSIBlockCommandsDevice.h @@ -0,0 +1,1594 @@ +/* + * Copyright (c) 1998-2011 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_BLOCK_COMMANDS_DEVICE_H_ +#define _IOKIT_IO_SCSI_BLOCK_COMMANDS_DEVICE_H_ + +#if defined(KERNEL) && defined(__cplusplus) + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// SBC power states as defined in T10:996D SCSI Block Commands - 3 (SBC-3) +// Revision 8c, November 13, 1997, pages 10-11. +enum +{ + kSBCPowerStateSystemSleep = 0, + kSBCPowerStateSleep = 1, + kSBCPowerStateStandby = 2, + kSBCPowerStateIdle = 3, + kSBCPowerStateActive = 4, + kSBCNumPowerStates = 5 +}; + +enum +{ + kMediaStateUnlocked = 0, + kMediaStateLocked = 1 +}; + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include +#include +#include +#include + +// Generic IOKit storage related headers +#include + +// SCSI Architecture Model Family includes +#include +#include + +// Build includes +#include + +// Forward declaration for the SCSIBlockCommands that is used internally by the +// IOSCSIBlockCommandsDevice class. +class SCSIBlockCommands; + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +/*! + @class IOSCSIBlockCommandsDevice + @superclass IOSCSIPrimaryCommandsDevice + @discussion Implementation of the T10 device Block Commands device. + */ +class IOSCSIBlockCommandsDevice : public IOSCSIPrimaryCommandsDevice +{ + + OSDeclareAbstractStructors ( IOSCSIBlockCommandsDevice ) + +private: + + IOReturn GetWriteCacheState ( IOMemoryDescriptor * buffer, + UInt8 modePageControlValue ); + + static void AsyncReadWriteComplete ( SCSITaskIdentifier completedTask ); + +protected: + + // Reserve space for future expansion. + struct IOSCSIBlockCommandsDeviceExpansionData + { + IONotifier * fPowerDownNotifier; + bool fWriteCacheEnabled; + bool fDeviceIsShared; + UInt64 fMediumBlockCount64; +#if !TARGET_OS_IPHONE + bool fDeviceHasSATTranslation; + bool fDeviceHasNVMETranslation; +#endif /* !TARGET_OS_IPHONE */ + bool fProtocolSpecificPowerControl; + bool fRequiresEjectWithStartStopUnit; + UInt32 fMaximumUnmapLBACount; + UInt32 fMaximumUnmapBlockDescriptorCount; + UInt64 fMaximumWriteSameLength; + UInt8 fLBPRZ; + bool fUnmapAllowed; + bool fUseWriteSame; + }; + IOSCSIBlockCommandsDeviceExpansionData * fIOSCSIBlockCommandsDeviceReserved; + + #define fPowerDownNotifier fIOSCSIBlockCommandsDeviceReserved->fPowerDownNotifier + #define fWriteCacheEnabled fIOSCSIBlockCommandsDeviceReserved->fWriteCacheEnabled + #define fMaximumUnmapLBACount fIOSCSIBlockCommandsDeviceReserved->fMaximumUnmapLBACount + #define fMaximumUnmapBlockDescriptorCount fIOSCSIBlockCommandsDeviceReserved->fMaximumUnmapBlockDescriptorCount + #define fMaximumWriteSameLength fIOSCSIBlockCommandsDeviceReserved->fMaximumWriteSameLength + #define fLBPRZ fIOSCSIBlockCommandsDeviceReserved->fLBPRZ + #define fUnmapAllowed fIOSCSIBlockCommandsDeviceReserved->fUnmapAllowed + #define fUseWriteSame fIOSCSIBlockCommandsDeviceReserved->fUseWriteSame + + // The fDeviceIsShared is used to indicate whether this device exists on a Physical + // Interconnect that allows multiple initiators to access it. This is used mainly + // by the power management code to not send power state related START_STOP_UNIT + // commands to the device. + // The fDeviceIsShared value is also used to prevent power state commands from being + // sent to manual eject device since these devices behave better when allowed to + // manage their own power. + #define fDeviceIsShared fIOSCSIBlockCommandsDeviceReserved->fDeviceIsShared + + // The fMediumBlockCount64 provides support for 64 bit LBAs and + // replaces fMediumBlockCount which only supports 32 bits. + // This value should not be directly accessed and instead the member routine + // ReportMediumTotalBlockCount() should be used to retrieve it and the member routine + // SetMediumCharacteristics() should be used to set it. + #define fMediumBlockCount64 fIOSCSIBlockCommandsDeviceReserved->fMediumBlockCount64 + +#if !TARGET_OS_IPHONE + #define fDeviceHasSATTranslation fIOSCSIBlockCommandsDeviceReserved->fDeviceHasSATTranslation +#endif /* !TARGET_OS_IPHONE */ + +#if !TARGET_OS_IPHONE + #define fDeviceHasNVMETranslation fIOSCSIBlockCommandsDeviceReserved->fDeviceHasNVMETranslation +#endif /* !TARGET_OS_IPHONE */ + + // Device support protocol specific power off + #define fProtocolSpecificPowerControl fIOSCSIBlockCommandsDeviceReserved->fProtocolSpecificPowerControl + + // Device requires START_STOP_UNIT for ejects, regardless if PREVENT_ALLOW_MEIDUMREMOVAL + // failed. + #define fRequiresEjectWithStartStopUnit fIOSCSIBlockCommandsDeviceReserved->fRequiresEjectWithStartStopUnit + +private: + /* OBSOLETE. Use IOSCSIPrimaryCommandsDevice::Get/SetANSIVersion */ + UInt8 fANSIVersion; + +protected: + // ---- Device Characteristics ---- + bool fMediaIsRemovable; + + // ---- Medium Characteristics ---- + bool fMediumPresent; + +private: + // The byte count of each physical block on the medium. + // This value should not be directly accessed and instead the member routine + // ReportMediumBlockSize() should be used to retrieve it and the member routine + // SetMediumCharacteristics() should be used to set it. + UInt32 fMediumBlockSize; + + // The total number of blocks of fMediumBlockSize on the medium. + // OBSOLETE. Use fMediumBlockCount64 instead which allows for support of + // devices that have 33 through 64 bit LBA values. + UInt32 fMediumBlockCount; + +protected: + // Whether the installed medium is protected from writes + bool fMediumIsWriteProtected; + + // Whether user removal of medium has been prevented + bool fMediumRemovalPrevented; + + // Indicates whether this is a known manual eject device + bool fKnownManualEject; + + // Polling thread variables + thread_call_t fPollingThread; + UInt32 fPollingMode; + enum + { + kPollingMode_Suspended = 0, + kPollingMode_NewMedia = 1, + kPollingMode_MediaRemoval = 2 + }; + + // ---- Methods for controlling the current state of device support ---- + /*! + @function InitializeDeviceSupport + @abstract Called in super class's start() to initialize device support. + @discussion Called in super class's start() to initialize device support. The underlying infrastructure + for supporting a device must be implemented here. + @result true if device could be successfully configured false if not. + */ + virtual bool InitializeDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function StartDeviceSupport + @abstract Called in super class's start() to start device support. + @discussion Called in super class's start() to start device support. Support for starting + devices and making them usable must be implemented here. + */ + virtual void StartDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function SuspendDeviceSupport + @abstract Called to temporarily suspend device support. + @discussion Called to temporarily suspend device support. Support for suspending + devices must be implemented here. + */ + virtual void SuspendDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function ResumeDeviceSupport + @abstract Called to temporarily resume device support. + @discussion Called to temporarily resume device support. Support for resuming + devices must be implemented here. + */ + virtual void ResumeDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function StopDeviceSupport + @abstract Called to stop device support. + @discussion Called to stop device support. Support for stopping + devices must be implemented here. + */ + virtual void StopDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function TerminateDeviceSupport + @abstract Called to terminate device support. + @discussion Called to terminate device support. The underlying infrastructure for + support a device should be cleaned up here. + */ + virtual void TerminateDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function free + @abstract Called to release all resources held by the object. + @discussion Release all resources held by the object, then call super::free(). + */ + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function ClearNotReadyStatus + @abstract Clears any NOT_READY status for the device. + @discussion Polls device with TEST_UNIT_READY until the device returns kSCSITaskStatus_GOOD status. + Exits if device has become disconnected. + @result true if device is now active (isInactive == false) and false otherwise. + */ + virtual bool ClearNotReadyStatus ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function CreateStorageServiceNub + @abstract Creates a nub which links the IOSCSIReducedBlockCommandsDevice to the IOStorageFamily. + @discussion Creates a nub which links the IOSCSIReducedBlockCommandsDevice to the IOStorageFamily. + */ + virtual void CreateStorageServiceNub ( void ); + + /*! + @function DetermineDeviceCharacteristics + @abstract Determine the characteristics of the device. + @discussion Determine the characteristics, ANSI version, removability, etc., of the device via its INQUIRY data. + @result true on success and false on failure. + */ + virtual bool DetermineDeviceCharacteristics ( void ); + + /*! + @function GetMediumRotationRate + @abstract Get the rotation rate of the device. + @discussion Get the rotation rate of the device via its INQUIRY data. + Sets the result as a property on the device's registry entry. + */ + void GetMediumRotationRate ( void ); + + /*! + @function LogicalBlockProvisioningUnmapSupport + @abstract Check if the device supports Logical Block Provisioning Unmap. + @discussion Check if the device supports Logical Block Provisioning Unmap via its INQUIRY data. + @return true if unmap is supported and false otherwise. + */ + bool LogicalBlockProvisioningUnmapSupport ( void ); + + /*! + @function GetDeviceUnmapCharacteristics + @abstract Get the unmap characteristics of the device. + @discussion Get the unmap characteristics of the device. + */ + void GetDeviceUnmapCharacteristics ( ); + + // ---- Methods used for controlling the polling thread ---- + + /*! + @function ProcessPoll + @abstract Process a poll for media. + @discussion Process a poll for media based on the current polling mode of the driver. + */ + virtual void ProcessPoll ( void ); + + /*! + @function EnablePolling + @abstract Enables media polling. + @discussion Schedules a thread to poll the device for media at the prescribed interval. + */ + virtual void EnablePolling ( void ); + + /*! + @function DisablePolling + @abstract Disables media polling. + @discussion Cancels ( if running ) the media polling thread. + */ + virtual void DisablePolling ( void ); + + // Main and support methods for polling for new Media + + /*! + @function PollForNewMedia + @abstract Polls for new media insertion. + @discussion Polls for new media insertion. If new media is inserted, it is initialized and + clients are notified via the kIOMessageMediaStateHasChanged message. + */ + virtual void PollForNewMedia ( void ); + + /*! + @function DetermineMediaPresence + @abstract Check if media has been inserted. + @discussion Check if media has been inserted by sending TEST_UNIT_READY + and checking the SENSE data. + @return true if medium was found and false otherwise. + */ + virtual bool DetermineMediaPresence ( void ); + + /*! + @function PreventMediumRemoval + @abstract Prevent Medium Removal. + @discussion Prevents medium removal by sending the PREVENT_ALLOW_MEDIUM_REMOVAL command + with the PREVENT field set to "Medium removal shall be prohibited". + @return true if medium was successfully locked and false otherwise. + */ + virtual bool PreventMediumRemoval ( void ); + + /*! + @function DetermineMediumCapacity + @abstract Determines capacity of the medium. + @discussion Determines capacity of the medium via the READ_CAPACITY or READ_CAPACITY_16 commands. + @param blockSize used to return the block size of the medium. + @param blockCount used to return the block count of the medium. + @return true if medium capacity was successfully queried and false otherwise. + */ + virtual bool DetermineMediumCapacity ( + UInt64 * blockSize, + UInt64 * blockCount ); + + /*! + @function DetermineMediumWriteProtectState + @abstract Determine medium write protect state of the medium. + @discussion Determine medium write protect state of the medium via MODE_SENSE_10, MODE_SENSE_6, + or manual READ_10 commands. + @return true if medium is in write protect state and false otherwise. + */ + virtual bool DetermineMediumWriteProtectState ( void ); + + // Main and support methods for polling for Media removal + + /*! + @function PollForMediaRemoval + @abstract Check if media has been removed. + @discussion Check if media has been removed by sending TEST_UNIT_READY + and checking the SENSE data. If so, message clients and resets the driver's + medium characteristics. + */ + virtual void PollForMediaRemoval ( void ); + + // ---- Methods used for handling medium characteristics ---- + + /*! + @function SetMediumCharacteristics + @abstract Sets the block size and block count for the current media. + OBSOLETE - Use the version compatible with 64 bit LBAs instead. + @discussion Sets the block size and block count for the current media. + OBSOLETE - Use the version compatible with 64 bit LBAs instead. + @param blockSize The media's block size in bytes. + @param blockCount The count of the media's blocks. + */ + virtual void SetMediumCharacteristics ( + UInt32 blockSize, + UInt32 blockCount ); + + /*! + @function SetMediumCharacteristics + @abstract Sets the block size and block count for the current media. + @discussion Sets the block size and block count for the current media. + @param blockSize The media's block size in bytes. + @param blockCount The count of the media's blocks. + */ + void SetMediumCharacteristics ( + UInt64 blockSize, + UInt64 blockCount ); + + /*! + @function ResetMediumCharacteristics + @abstract Resets the block size and block count. + @discussion Resets the block size and block count. + */ + virtual void ResetMediumCharacteristics ( void ); + + /*! + @function IssueRead + @abstract DEPRECATED. Please do not use this method. + @discussion DEPRECATED. Please do not use this method. + @param buffer DEPRECATED. Please do not use this method. + @param startBlock DEPRECATED. Please do not use this method. + @param blockCount DEPRECATED. Please do not use this method. + @result DEPRECATED. Please do not use this method. + */ + virtual IOReturn IssueRead ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + /*! + @function IssueRead + @abstract Issues an asynchronous read command. + @discussion Issues an asynchronous read command. + @param buffer A pointer to a valid IOMemoryDescriptor to which the data can be copied to. + @param startBlock Starting logical block address for the read operation. + @param blockCount The number of blocks to be read. + @param clientData A valid pointer to the client data to be used for callback completion. + @result A valid IOReturn value. + */ + virtual IOReturn IssueRead ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + + /*! + @function IssueWrite + @abstract DEPRECATED. Please do not use this method. + @discussion DEPRECATED. Please do not use this method. + @param buffer DEPRECATED. Please do not use this method. + @param startBlock DEPRECATED. Please do not use this method. + @param blockCount DEPRECATED. Please do not use this method. + @result DEPRECATED. Please do not use this method. + */ + virtual IOReturn IssueWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + /*! + @function IssueWrite + @abstract Issues an asynchronous write command. + @discussion Issues an asynchronous write command. + @param buffer A pointer to a valid IOMemoryDescriptor to which the data can be copied from. + @param startBlock Starting logical block address for the write operation. + @param blockCount The number of blocks to be written. + @param clientData A valid pointer to the client data to be used for callback completion. + @result A valid IOReturn value. + */ + virtual IOReturn IssueWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + + /*! + @function IssueUnmap + @abstract Issue a synchronous unmap command. + @discussion Issue a synchronous unmap command. + @param extentsList a list of extents to unmap. + @param blockDescriptorCount the count of extents in extentsList. + @return A valid IOReturn value. + */ + IOReturn IssueUnmap ( + IOBlockStorageDeviceExtent * extentsList, + UInt32 blockDescriptorCount ); + + // ----- Power Management Support ------ + + /*! + @function InitializePowerManagement + @abstract Called to initialize power management. + @discussion Called by InitializeDeviceSupport() to initialize power management by, + joining the power management tree, registering power states, and setting the lowest idle + power state. + @param provider A valid pointer to this object's provider. + */ + virtual void InitializePowerManagement ( IOService * provider ) APPLE_KEXT_OVERRIDE; + + /*! + @function GetInitialPowerState + @abstract Called by power management to determine initial power state. + @discussion We override this method so that when we register for power management, + we go to our active power state (which the drive is definitely in + at startup time). + @result Returns the initial power state desired when power management is initialized. + */ + virtual UInt32 GetInitialPowerState ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function GetNumberOfPowerStateTransitions + @abstract Called by power management to determine this class's total + number of power state transitions. + @discussion We override this method in order to provide the number of transitions + from Fully active to Sleep state so that the idle timer can be adjusted + to the appropriate time period based on the disk spin down time set in + the Energy Saver prefs panel. + @result Returns the number of power state transitions for this class. + */ + virtual UInt32 GetNumberOfPowerStateTransitions ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function TicklePowerManager + @abstract The TicklePowerManager method is called to tell the power manager that the + device needs to be in a certain power state to handle requests. + @discussion The TicklePowerManager() is called by CheckPowerState() and + sends an activity tickle ( via activityTickle() ) to the power manager + so that the idle timer is reset. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. + */ + virtual void TicklePowerManager ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function HandlePowerChange + @abstract Handles the state machine for power management state changes. + @discussion The HandlePowerChange method is the state machine for power management. + It is guaranteed to be on its own thread of execution (different from + the power manager thread AND the workloop thread. This routine can + send sync or async calls to the drive without worrying about threading + issues. + */ + virtual void HandlePowerChange ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function HandleCheckPowerState(void) + @abstract The HandleCheckPowerState (void) method is on the serialized side of the command + gate and can change member variables safely without multi-threading issues. + It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + with the max power state the class registered with. + @discussion The HandleCheckPowerState (void) method is on the serialized side of the command + gate and can change member variables safely without multi-threading issues. + It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + with the max power state the class registered with. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. The default behavior is to block until the + object transitions to its maximum power state. + */ + virtual void HandleCheckPowerState ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function VerifyMediumPresence + @abstract Called to ascertain the current presence of media. + @discussion The VerifyMediumPresence method is called to see if the medium which we + anticipated being there is still there. + @result true if media is present and false if media is not present. + */ + virtual bool VerifyMediumPresence ( void ); + + /*! + @function CheckMediumCapacityData + @abstract Called to ascertain if the medium has changed capacity data. + If so, it messages the upper layers. + @discussion The CheckMediumCapacityData is called to see if the medium has indeed changed + capacity data. If it has, it messages the upper layers. + */ + void CheckMediumCapacityData ( void ); + +public: + + /*! + @function sProcessPoll + @abstract Static method called to poll for media. + @discussion Static method called to poll for media. Called from polling thread. + Will reschedule itself via EnablePolling if polling is not suspended. + @param pdtDriver a pointer to a valid IOSCSIBlockCommandsDevice ( or subclass ) which is to + be polled. + @param refCon a pointer to an additional object which can be determined by the implementer. + */ + static void sProcessPoll ( void * pdtDriver, void * refCon ); + + // ---- Methods for controlling the device ---- + + /*! + @function SyncReadWrite + @abstract DEPRECATED. Please do not use this method. + @discussion DEPRECATED. Please do not use this method. + @param buffer DEPRECATED. Please do not use this method. + @param startBlock DEPRECATED. Please do not use this method. + @param blockCount DEPRECATED. Please do not use this method. + @param blockSize DEPRECATED. Please do not use this method. + @result DEPRECATED. Please do not use this method. + */ + virtual IOReturn SyncReadWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize ); + + /*! + @function AsyncReadWrite + @abstract Translates an asynchronous I/O request into a read or a write. + @discussion Translates an asynchronous I/O request into a read or a write. + @param buffer A pointer to a valid IOMemoryDescriptor to which the + data can be copied to or from. + @param startBlock Starting logical block address for the write operation. + @param blockCount The number of blocks to read or write. + @param blockSize used to specify the block size to be used for the read or write. + @param clientData A valid pointer to the client data to be used for callback completion. + @result A valid IOReturn value. + */ + virtual IOReturn AsyncReadWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize, + void * clientData ); + + /*! + @function GetWriteCacheState + @abstract Get the write cache state. + @discussion Get the write cache state. + @param enabled used to return the current write cache state. + @return A valid IOReturn value. + */ + IOReturn GetWriteCacheState ( bool * enabled ); + + /*! + @function SetWriteCacheState + @abstract Sets the write cache state. + @discussion Sets the write cache state. + @param enabled the state of the write cache. + @return A valid IOReturn value. + */ + IOReturn SetWriteCacheState ( bool enabled ); + + /*! + @function DetermineMediumGeometry + @abstract Determines geometry of the medium. + @discussion Determines geometry of the medium via mode sense data and places + the results in the Device Characteristics Dictionary + */ + void DetermineMediumGeometry ( void ); + + // ---- Methods for controlling medium state ---- + /*! + @function EjectTheMedium + @abstract Called to eject the inserted media from the drive. + @discussion Called by IOBlockStorageDevice subclasses to eject the inserted + media from the drive. + @result A valid IOReturn value. + */ + virtual IOReturn EjectTheMedium ( void ); + + /*! + @function LockUnlockMedium + @abstract Called to lock or unlock the inserted media. + @discussion Called by IOBlockStorageDevice subclasses to lock or unlock the inserted media. + @param doLock if true the media will be locked, if false the media will be unlocked. + @result A valid IOReturn value. + */ + virtual IOReturn LockUnlockMedium ( bool doLock ); + + /*! + @function SynchronizeCache + @abstract Called to synchronize the devices cache and thereby force its contents to be + written out to the media. + @discussion Called by IOBlockStorageDevice subclasses to synchronize the devices cache + and thereby force the cache's contents to be written out to the media. + @result A valid IOReturn value. + */ + virtual IOReturn SynchronizeCache ( void ); + + // ---- Methods for controlling media format ---- + + /*! + @function FormatMedium + @abstract Called to perform a low level format of the inserted media. + @discussion Called IOBlockStorageDevice subclasses to perform a low level + of the inserted media. Default implementation simply returns kIOReturnUnsupported + if not overridden. + @param blockCount The number of blocks to be formatted. + @param blockSize used to specify the block size to be used for the format. + @result A valid IOReturn value. + */ + virtual IOReturn FormatMedium ( + UInt64 blockCount, + UInt64 blockSize ); + + /*! + @function GetFormatCapacities + @abstract Called to determine the formatted capacity of the inserted media. + @discussion Called IOBlockStorageDevice subclasses to determine the formatted + capacity of the inserted media. Presently unsupported by default implementation. + Returns 0 unless overridden. + @param capacities a pointer to a valid UInt64 array. + @param capacitiesMaxCount the number of elements addressable within capacities. + @result The number of elements assigned in capacities ( count is 1 based ). + */ + virtual UInt32 GetFormatCapacities ( + UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + // ---- Query methods to report device characteristics ---- + + /*! + @function ReportDeviceMaxBlocksReadTransfer + @abstract Reports maximum read transfer blocks. + @discussion Reports the maximum number of blocks that the device can handle per + read. A value of 0 (zero) indicates there is no limit aside from the size of + the method's return parameter. + @return the maximum read transfer blocks. + */ + virtual UInt64 ReportDeviceMaxBlocksReadTransfer ( void ); + + /*! + @function ReportDeviceMaxBlocksWriteTransfer + @abstract Reports maximum write transfer blocks. + @discussion Reports the maximum number of blocks that the device can handle per + write. A value of 0 (zero) indicates there is no limit aside from the size of + the method's return parameter. + @return the maximum write transfer blocks. + */ + virtual UInt64 ReportDeviceMaxBlocksWriteTransfer ( void ); + + /*! + @function ReportDeviceMediaRemovability + @abstract Reports whether the device supports removal of the media. + @discussion Reports whether the device supports removal of the media. + @return true if media is removable and false otherwise. + */ + virtual bool ReportDeviceMediaRemovability ( void ); + + // ---- Query methods to report installed medium characteristics ---- + + /*! + @function ReportMediumBlockSize + @abstract Reports the logical block size of the medium. + @discussion Reports the logical block size of the medium. + @return the logical block size. + */ + virtual UInt64 ReportMediumBlockSize ( void ); + + /*! + @function ReportMediumTotalBlockCount + @abstract Reports the total logical block count of the medium. + @discussion Reports the total logical block count of the medium. + @return the total logical block count. + */ + virtual UInt64 ReportMediumTotalBlockCount ( void ); + + /*! + @function ReportMediumWriteProtection + @abstract Reports whether or not the medium is write protected. + @discussion Reports whether or not the media is write protected. + @return true if media is write protected and false otherwise. + */ + virtual bool ReportMediumWriteProtection ( void ); + + // ---- Query method to report the device provision initialization pattern ---- + + /*! + @function ReportProvisioningInitializationPattern + @abstract Reports the device provision initialization pattern. + @discussion Reports the device provision initialization pattern. + @param buffer the buffer into which the results will be copied. + @result A valid IOReturn value. + */ + IOReturn ReportProvisioningInitializationPattern ( + IOMemoryDescriptor * buffer ); + + /*! @function message + @abstract Receives messages delivered from an attached provider. + @discussion Handles the kIOMessageMediaParametersHaveChanged message + by CheckMediumCapacityData on a separate thread. + @param type A type defined in IOMessage.h. + @param nub The provider from which the message originates. + @param arg An argument defined by the message type. + @result An IOReturn code defined by the message type. + */ + virtual IOReturn message ( UInt32 type, IOService * nub, void * arg ) APPLE_KEXT_OVERRIDE; + + // ---- Called prior to restarting or shutting down ---- + + /*! @function systemWillShutdown + @abstract Handles system shutdown and restart notifications. + @discussion Overrides IOService::systemWillShutdown in order + to execute any special handling as specified in the device characteristics dictionary. + As a result, drivers can expect their disable method to be called + before system shutdown or restart. This implementation is synchronous and can + block before calling IOService::systemWillShutdown and return. + @param specifier + kIOMessageSystemWillPowerOff or kIOMessageSystemWillRestart. + @see //apple_ref/cpp/instm/IOService/systemWillShutdown/void/(IOOptionBits) IOService::systemWillShutdown + */ + virtual void systemWillShutdown ( IOOptionBits specifier ) APPLE_KEXT_OVERRIDE; + + // ---- Unmap related methods ---- + // Check to see if we can coalesce the current and the next extent + + /*! + @function UnmapTryExtentCoalesce + @abstract Helper function to check and coalesce two extents. + @discussion Helper function to check and coalesce two extents. In order to be + successfully merged, the extents must be sequential. + @param mergedExtent a pointer where the new merged extent will be placed. + @param currentExtent the first extent to merge. + @param nextExtent the second extent to merge. + @return true if the extents were merged and false otherwise. + */ + bool UnmapTryExtentCoalesce ( + IOBlockStorageDeviceExtent * mergedExtent, + IOBlockStorageDeviceExtent * currentExtent, + IOBlockStorageDeviceExtent * nextExtent ); + + /*! + @function UnmapTruncateAndAccumulate + @abstract Helper function to truncate an extent if required. + @discussion Adds an extent to the end of the extent unmap dispatch list. + If there are not enough unmap LBAs to fit the whole extent, it is split and the remaining, + truncated extent is returned. + @param extentDispatchList the extent dispatch list to add the extent. + @param blockDescriptorCount the current count of block descriptors in the dispatch list. + @param unmapLBACount the current count of queued LBAs for the next unmap operation. + @param mergedExtent a pointer to the extent to be added. The truncated extent is returned + using this pointer as well. + @return true if adding the extent used all remaining unmap LBAs + and false otherwise. + */ + bool UnmapTruncateAndAccumulate ( + IOBlockStorageDeviceExtent * extentDispatchList, + UInt32 blockDescriptorCount, + UInt32 * unmapLBACount, + IOBlockStorageDeviceExtent * mergedExtent ); + + // Use the write same command to do unmaps on the given extents. + + /*! + @function WriteSameUnmap + @abstract Uses the write same command to unmap the given extents. + @discussion Uses the write same command to unmap the given extents. + @param extents the array of extents to unmap. + @param extentsCount the count of extents in the provided array. + @param requestBlockSize used to specify the block size to be used for the write. + @return A valid IOReturn value. + */ + IOReturn WriteSameUnmap ( + IOBlockStorageDeviceExtent * extents, + UInt32 extentsCount, + UInt32 requestBlockSize ); + + /*! + @function UpdateLBAProvisionStatus + @abstract Get the block provision status. + @discussion Update the extents with the provision status that we got from the device. + @param extentsCount the count of extents in extents. + @param extents a list of extents to unmap. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the received + status data is to be stored. + @param transferLength used to specify the maximum requested amount of status data. + @return A valid IOReturn value. + */ + IOReturn UpdateLBAProvisionStatus ( + UInt32 * extentsCount, + IOBlockStorageProvisionDeviceExtent * extents, + IOMemoryDescriptor * dataBuffer, + UInt32 transferLength ); + + /*! + @function IsUnmapAllowed + @abstract Return whether unmap is allowed. + @discussion Return whether unmap is allowed. + @return true if unmap is allowed and false otherwise. + */ + bool IsUnmapAllowed ( ); + + /*! + @function IsUseWriteSame + @abstract Return whether WRITE_SAME should be used for UNMAP commands. + @discussion Return whether WRITE_SAME should be used for UNMAP commands. + @return true if the device supports unmap operations with write same command + and false otherwise. + */ + bool IsUseWriteSame ( ); + +protected: + + + /*! + @function GET_LBA_STATUS + @abstract Builds a GET_LBA_STATUS command. + @discussion Builds a GET_LBA_STATUS command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the received + status data is to be stored. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address + from which the get status is to be initiated. + @param ALLOCATION_LENGTH used to specify the maximum requested amount of status data. + @param CONTROL the CONTROL byte to use for the command. + @result true if the command was successfully built and false otherwise. + */ + bool GET_LBA_STATUS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + /*! + @function READ_10 + @abstract Builds a READ (10) command. + @discussion Builds a READ (10) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the read data is to be stored. + @param blockSize used to specify the block size to be used for the read. + @param DPO the value of the disable page out bit to set in the command. + @param FUA the value of the force unit access bit to set in the command. + @param RELADR the value of the relative address bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the read is to be initiated. + @param TRANSFER_LENGTH the desired transfer length in blocks. + @param CONTROL the CONTROL byte to use for the command. + @result true if the command was successfully built and false otherwise. + */ + virtual bool READ_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.10 + /*! + @function READ_10 + @abstract Builds a READ (10) command. + @discussion Builds a READ (10) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the read data is to be stored. + @param blockSize used to specify the block size to be used for the read. + @param RDPROTECT the value of the read protect field to set in the command. + @param DPO the value of the disable page out bit to set in the command. + @param FUA the value of the force unit access bit to set in the command. + @param FUA_NV the value of the force unit access bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the read is to be initiated. + @param GROUP_NUMBER the value of the grouping function group number to set in the command. + @param TRANSFER_LENGTH the desired transfer length in blocks. + @param CONTROL the CONTROL byte to use for the command. + @result true if the command was successfully built and false otherwise. + */ + bool READ_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit RDPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField6Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + /*! + @function READ_12 + @abstract Builds a READ (12) command. + @discussion Builds a READ (12) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the read data is to be stored. + @param blockSize used to specify the block size to be used for the read. + @param DPO the value of the disable page out bit to set in the command. + @param FUA the value of the force unit access bit to set in the command. + @param RELADR the value of the relative address bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the read is to be initiated. + @param TRANSFER_LENGTH the desired transfer length in blocks. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + virtual bool READ_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.11 + /*! + @function READ_12 + @abstract Builds a READ (12) command. + @discussion Builds a READ (12) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the read data is to be stored. + @param blockSize used to specify the block size to be used for the read. + @param RDPROTECT the value of the read protect field to set in the command. + @param DPO the value of the disable page out bit to set in the command. + @param FUA the value of the force unit access bit to set in the command. + @param FUA_NV the value of the force unit access bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the read is to be initiated. + @param TRANSFER_LENGTH the desired transfer length in blocks. + @param GROUP_NUMBER the value of the grouping function group number to set in the command. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + bool READ_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit RDPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField6Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + /*! + @function READ_16 + @abstract Builds a READ (16) command. + @discussion Builds a READ (16) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the read data is to be stored. + @param blockSize used to specify the block size to be used for the read. + @param RDPROTECT the value of the read protect field to set in the command. + @param DPO the value of the disable page out bit to set in the command. + @param FUA the value of the force unit access bit to set in the command. + @param FUA_NV the value of the force unit access bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the read is to be initiated. + @param TRANSFER_LENGTH the desired transfer length in blocks. + @param GROUP_NUMBER the value of the grouping function group number to set in the command. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + bool READ_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit RDPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField6Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + /*! + @function READ_CAPACITY + @abstract Builds a READ CAPACITY command. + @discussion Builds a READ CAPACITY command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the read capacity data is to be stored. + @param RELADR the value of the relative address bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which + the read capacity is to be initiated. + @param PMI the value of the partial medium indicator bit to set in the command. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + virtual bool READ_CAPACITY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Bit PMI, + SCSICmdField1Byte CONTROL ); + + /*! + @function READ_CAPACITY_16 + @abstract Builds a READ CAPACITY (16) command. + @discussion Builds a READ CAPACITY (16) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the read capacity data is to be stored. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which + the read capacity is to be initiated. + @param ALLOCATION_LENGTH used to specify the maximum requested amount of read data. + @param PMI the value of the partial medium indicator bit to set in the command. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + bool READ_CAPACITY_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Bit PMI, + SCSICmdField1Byte CONTROL ); + + /*! + @function REPORT_PROVISIONING_INITIALIZATION_PATTERN + @abstract Builds a REPORT_PROVISIONING_INITIALIZATION_PATTERN command. + @discussion Builds a REPORT_PROVISIONING_INITIALIZATION_PATTERN command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the + provisioning initialization pattern data is to be stored. + @param ALLOCATION_LENGTH used to specify the maximum requested amount of provisioning data. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + bool REPORT_PROVISIONING_INITIALIZATION_PATTERN ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + /*! + @function START_STOP_UNIT + @abstract Builds a START STOP UNIT command. + @discussion Builds a START STOP UNIT command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param IMMED the value of the immediate bit to set in the command. + @param POWER_CONDITIONS used to specify the desired POWER CONDITIONS code. + @param LOEJ used to specify whether or not the LOAD/EJECT ( LEOJ ) bit for the command needs to be set. + @param START the value of the START bit to set in the command. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + virtual bool START_STOP_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField4Bit POWER_CONDITIONS, + SCSICmdField1Bit LOEJ, + SCSICmdField1Bit START, + SCSICmdField1Byte CONTROL ); + + /*! + @function SYNCHRONIZE_CACHE + @abstract Builds a SYNCHRONIZE CACHE command. + @discussion Builds a SYNCHRONIZE CACHE command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param IMMED the value of the immediate bit to set in the command. + @param RELADR the value of the relative address bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which + the synchronize cache is to be initiated. + @param NUMBER_OF_BLOCKS the number of blocks to synchronize. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + virtual bool SYNCHRONIZE_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.22 + /*! + @function SYNCHRONIZE_CACHE + @abstract Builds a SYNCHRONIZE CACHE command. + @discussion Builds a SYNCHRONIZE CACHE command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param IMMED the value of the immediate bit to set in the command. + @param SYNC_NV used to specify whether or not the synchronize non-volatile bit for the command needs to be set. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which + the synchronize cache is to be initiated. + @param GROUP_NUMBER the value of the grouping function group number to set in the command. + @param NUMBER_OF_BLOCKS the number of blocks to synchronize. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + bool SYNCHRONIZE_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit SYNC_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField6Bit GROUP_NUMBER, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + /*! + @function SYNCRONIZE_CACHE_16 + @abstract Builds a SYNCHRONIZE CACHE (16) command. + @discussion Builds a SYNCHRONIZE CACHE (16) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param SYNC_NV used to specify whether or not the synchronize non-volatile bit for the command needs to be set. + @param IMMED the value of the immediate bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which + the synchronize cache is to be initiated. + @param NUMBER_OF_BLOCKS the number of blocks to synchronize. + @param GROUP_NUMBER the value of the grouping function group number to set in the command. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + bool SYNCRONIZE_CACHE_16 ( + SCSITaskIdentifier request, + SCSICmdField1Bit SYNC_NV, + SCSICmdField1Bit IMMED, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte NUMBER_OF_BLOCKS, + SCSICmdField6Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + /*! + @function UNMAP + @abstract Builds a UNMAP command. + @discussion Builds a UNMAP command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the + parameter list data is supplied. + @param ANCHOR the value of the anchor bit to set in the command. + @param GROUP_NUMBER the value of the grouping function group number to set in the command. + @param PARAMETER_LIST_LENGTH the length of the supplied parameter list data buffer in bytes. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + bool UNMAP ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit ANCHOR, + SCSICmdField6Bit GROUP_NUMBER, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + /*! + @function WRITE_10 + @abstract Builds a WRITE (10) command. + @discussion Builds a WRITE (10) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the data to be written is stored. + @param blockSize used to specify the block size to be used for the write. + @param DPO the value of the disable page out bit to set in the command. + @param FUA the value of the force unit access bit to set in the command. + @param EBP the value of the erase by pass bit to set in the command. + @param RELADR the value of the relative address bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the write is to be initiated. + @param TRANSFER_LENGTH the desired transfer length in blocks. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + virtual bool WRITE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit EBP, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.29 + /*! + @function WRITE_10 + @abstract Builds a WRITE (10) command. + @discussion Builds a WRITE (10) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the data to be written is stored. + @param blockSize used to specify the block size to be used for the write. + @param WRPROTECT the value of the write protect field to set in the command. + @param DPO the value of the disable page out bit to set in the command. + @param FUA the value of the force unit access bit to set in the command. + @param FUA_NV the value of the force unit access bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the write is to be initiated. + @param GROUP_NUMBER the value of the grouping function group number to set in the command. + @param TRANSFER_LENGTH the desired transfer length in blocks. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + bool WRITE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField6Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + /*! + @function WRITE_12 + @abstract Builds a WRITE (12) command. + @discussion Builds a WRITE (12) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the data to be written is stored. + @param blockSize used to specify the block size to be used for the write. + @param DPO the value of the disable page out bit to set in the command. + @param FUA the value of the force unit access bit to set in the command. + @param EBP the value of the erase by pass bit to set in the command. + @param RELADR the value of the relative address bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the write is to be initiated. + @param TRANSFER_LENGTH the desired transfer length in blocks. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + virtual bool WRITE_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit EBP, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.30 + /*! + @function WRITE_12 + @abstract Builds a WRITE (12) command. + @discussion Builds a WRITE (12) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the data to be written is stored. + @param blockSize used to specify the block size to be used for the write. + @param WRPROTECT the value of the write protect field to set in the command. + @param DPO the value of the disable page out bit to set in the command. + @param FUA the value of the force unit access bit to set in the command. + @param FUA_NV the value of the force unit access bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the write is to be initiated. + @param GROUP_NUMBER the value of the grouping function group number to set in the command. + @param TRANSFER_LENGTH the desired transfer length in blocks. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + bool WRITE_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField6Bit GROUP_NUMBER, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + /*! + @function WRITE_16 + @abstract Builds a WRITE (16) command. + @discussion Builds a WRITE (16) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a pointer to a valid IOMemoryDescriptor in which the data to be written is stored. + @param blockSize used to specify the block size to be used for the write. + @param WRPROTECT the value of the write protect field to set in the command. + @param DPO the value of the disable page out bit to set in the command. + @param FUA the value of the force unit access bit to set in the command. + @param FUA_NV the value of the force unit access bit to set in the command. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the write is to be initiated. + @param TRANSFER_LENGTH the desired transfer length in blocks. + @param GROUP_NUMBER the value of the grouping function group number to set in the command. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + bool WRITE_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField6Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + /*! + @function WRITE_SAME_10 + @abstract Builds a WRITE SAME (10) command. + @discussion Builds a WRITE SAME (10) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param buffer a pointer to a valid IOMemoryDescriptor in which the data to be written is stored. + @param requestBlockSize used to specify the block size to be used for the write. + @param WRPROTECT the value of the write protect field to set in the command. + @param ANCHOR the value of the anchor bit to set in the command. + @param UNMAP the value of the unmap bit to set in the command. + @param startBlock Starting logical block address for the write or unmap operation. + @param GROUP_NUMBER the value of the grouping function group number to set in the command. + @param blockCount The number of blocks to write or unmap. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + bool WRITE_SAME_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * buffer, + UInt32 requestBlockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit ANCHOR, + SCSICmdField1Bit UNMAP, + SCSICmdField4Byte startBlock, + SCSICmdField6Bit GROUP_NUMBER, + SCSICmdField2Byte blockCount, + SCSICmdField1Byte CONTROL ); + + /*! + @function WRITE_SAME_16 + @abstract Builds a WRITE SAME (16) command. + @discussion Builds a WRITE SAME (16) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param buffer a pointer to a valid IOMemoryDescriptor in which the data to be written is stored. + @param requestBlockSize used to specify the block size to be used for the write. + @param WRPROTECT the value of the write protect field to set in the command. + @param ANCHOR the value of the anchor bit to set in the command. + @param UNMAP the value of the unmap bit to set in the command. + @param NDOB used to specify whether or not the no data-out buffer bit for the command needs to be set. + @param startBlock Starting logical block address for the write or unmap operation. + @param blockCount The number of blocks to write or unmap. + @param GROUP_NUMBER the value of the grouping function group number to set in the command. + @param CONTROL the CONTROL byte to use for the command. + @return true if the command was successfully built and false otherwise. + */ + bool WRITE_SAME_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * buffer, + UInt32 requestBlockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit ANCHOR, + SCSICmdField1Bit UNMAP, + SCSICmdField1Bit NDOB, + SCSICmdField8Byte startBlock, + SCSICmdField4Byte blockCount, + SCSICmdField6Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 1 ); + +public: + + /*! + @function PowerDownHandler + @abstract Method called at sleep, restart, or shutdown time. + @discussion Notification handler registered with registerPrioritySleepWakeInterest(). + @param refCon a pointer to an object which can be determined by the implementer when + registerPrioritySleepWakeInterest() is called. + @param messageType a constant defined in IOMessage.h ( kIOMessageSystemWillPowerOff, kIOMessageSystemWillRestart, etc. ). + @param provider a pointer to the provider of the notification. + @param messageArgument a pointer to the notification's argument. + @param argSize the size of the argument. + @result A valid IOReturn value. + */ + virtual IOReturn PowerDownHandler ( void * refCon, + UInt32 messageType, + IOService * provider, + void * messageArgument, + vm_size_t argSize ); + + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 2 ); + +protected: + + /*! + @function SetMediumIcon + @abstract Sets graphical icon for device's medium objects. + @discussion Provides an opportunity for the driver to select a more fitting icon then default icon. + */ + virtual void SetMediumIcon ( void ); + + + /* Added with 10.3.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 3 ); + +protected: + + /*! + @function AsyncReadWriteCompletion + @abstract Completion routine for asynchronous read and write requests. + @discussion Completion routine for asynchronous read and write requests. + @param completedTask the task from which to extract the client data to inspect. + */ + virtual void AsyncReadWriteCompletion ( SCSITaskIdentifier completedTask ); + + + /* Added with 10.6.0 */ + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 4 ); + +public: + + /*! + @function AsyncReadWrite + @abstract Translates an asynchronous I/O request into a read or a write. + @discussion Translates an asynchronous I/O request into a read or a write. + @param buffer A pointer to a valid IOMemoryDescriptor to which the + data can be copied to or from. + @param startBlock Starting logical block address for the write operation. + @param blockCount The number of block to be write. + @param blockSize used to specify the block size to be used for the read or write. + @param attributes used to set the attributes of the read or write. + Currently only used to set kIOStorageOptionForceUnitAccess. + @param clientData A valid pointer to the client data to be used for callback completion. + @result A valid IOReturn value. + */ + virtual IOReturn AsyncReadWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize, + IOStorageAttributes * attributes, + void * clientData ); + + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 5 ); + + /*! + @function Unmap + @abstract Unmap the given extents. + @discussion Unmap the given extents. + @param extents a list of extents to unmap. + @param ExtentsCount the count of extents in extents. + @result A valid IOReturn value. + */ + virtual IOReturn Unmap ( IOBlockStorageDeviceExtent * extents, + UInt32 ExtentsCount ); + + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 6 ); + + /*! + @function WriteSame + @abstract Write or unmap the given extent. + @discussion Write or unmap the given extent. + @param buffer a pointer to a valid IOMemoryDescriptor in which the data to be written is stored. + @param startBlock Starting logical block address for the write or unmap operation. + @param blockCount The number of blocks to write or unmap. + @param writeSameOptions the command options to pass to WRITE_SAME. + @param requestBlockSize used to specify the block size to be used for the write. + @result A valid IOReturn value. + */ + virtual IOReturn WriteSame ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt8 writeSameOptions, + UInt32 requestBlockSize ); + + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 7 ); + + /*! + @function GetProvisionStatus + @abstract Get the block provision status. + @discussion Get the block provision status. + @param block Starting logical block address for the status operation. + @param nblks The number of blocks. + @param extentsCount the count of extents in extents. + @param extents a list of extents to unmap. + @result A valid IOReturn value. + */ + virtual IOReturn GetProvisionStatus ( UInt64 block, + UInt64 nblks, + UInt32 * extentsCount, + IOBlockStorageProvisionDeviceExtent * extents ); + + +private: + +#if !TARGET_OS_IPHONE + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 16 ); +#endif /* !TARGET_OS_IPHONE */ + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_BLOCK_COMMANDS_DEVICE_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOSCSIMultimediaCommandsDevice.h b/QualcommWireless/include/IOKit/scsi/IOSCSIMultimediaCommandsDevice.h new file mode 100644 index 0000000..0aa05a2 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOSCSIMultimediaCommandsDevice.h @@ -0,0 +1,831 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_MULTIMEDIA_COMMANDS_DEVICE_H_ +#define _IOKIT_IO_SCSI_MULTIMEDIA_COMMANDS_DEVICE_H_ + +#if KERNEL +#include +#else +#include +#endif + +#include + +// Build includes +#include + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + + +// Message constants +#define kIOMessageTrayStateChange 0x69000035 +#define kIOMessageTrayStateHasChanged kIOMessageTrayStateChange // DEPRECATED, use kIOMessageTrayStateChange instead + +// Message values for kIOMessageTrayStateChange +enum +{ + kMessageTrayStateChangeRequestAccepted = 0, + kMessageTrayStateChangeRequestRejected = 1 +}; + +#define kIOMessageMediaAccessChange 0x69000036 + +// Message values for kIOMessageMediaAccessChange +enum +{ + kMessageDeterminingMediaPresence = 0, + kMessageFoundMedia = 1, + kMessageMediaTypeDetermined = 2 +}; + +// IOKit property keys and constants +#define kIOPropertySupportedCDFeatures kIOPropertySupportedCDFeaturesKey +#define kIOPropertySupportedDVDFeatures kIOPropertySupportedDVDFeaturesKey +#define kIOPropertySupportedBDFeatures kIOPropertySupportedBDFeaturesKey +#define kIOPropertyLowPowerPolling "Low Power Polling" + +typedef UInt32 CDFeatures; +enum +{ + kCDFeaturesAnalogAudioBit = 0, // Analog Audio playback + kCDFeaturesReadStructuresBit = 1, // CD-ROM + kCDFeaturesWriteOnceBit = 2, // CD-R + kCDFeaturesReWriteableBit = 3, // CD-R/W + kCDFeaturesCDDAStreamAccurateBit = 4, // CD-DA stream accurate + kCDFeaturesPacketWriteBit = 5, // Packet Writing + kCDFeaturesTAOWriteBit = 6, // CD Track At Once + kCDFeaturesSAOWriteBit = 7, // CD Mastering - Session At Once + kCDFeaturesRawWriteBit = 8, // CD Mastering - Raw + kCDFeaturesTestWriteBit = 9, // CD Mastering/TAO - Test Write + kCDFeaturesBUFWriteBit = 10 // CD Mastering/TAO - Buffer Underrun Free +}; + +enum +{ + kCDFeaturesAnalogAudioMask = (1 << kCDFeaturesAnalogAudioBit), + kCDFeaturesReadStructuresMask = (1 << kCDFeaturesReadStructuresBit), + kCDFeaturesWriteOnceMask = (1 << kCDFeaturesWriteOnceBit), + kCDFeaturesReWriteableMask = (1 << kCDFeaturesReWriteableBit), + kCDFeaturesCDDAStreamAccurateMask = (1 << kCDFeaturesCDDAStreamAccurateBit), + kCDFeaturesPacketWriteMask = (1 << kCDFeaturesPacketWriteBit), + kCDFeaturesTAOWriteMask = (1 << kCDFeaturesTAOWriteBit), + kCDFeaturesSAOWriteMask = (1 << kCDFeaturesSAOWriteBit), + kCDFeaturesRawWriteMask = (1 << kCDFeaturesRawWriteBit), + kCDFeaturesTestWriteMask = (1 << kCDFeaturesTestWriteBit), + kCDFeaturesBUFWriteMask = (1 << kCDFeaturesBUFWriteBit) +}; + +typedef UInt32 DVDFeatures; +enum +{ + kDVDFeaturesCSSBit = 0, // DVD-CSS + kDVDFeaturesReadStructuresBit = 1, // DVD-ROM + kDVDFeaturesWriteOnceBit = 2, // DVD-R + kDVDFeaturesRandomWriteableBit = 3, // DVD-RAM + kDVDFeaturesReWriteableBit = 4, // DVD-RW + kDVDFeaturesTestWriteBit = 5, // DVD-R Write - Test Write + kDVDFeaturesBUFWriteBit = 6, // DVD-R Write - Buffer Underrun Free + kDVDFeaturesPlusRBit = 7, // DVD+R + kDVDFeaturesPlusRWBit = 8, // DVD+RW (implies backgound format support) + kDVDFeaturesHDReadBit = 9, // HD DVD-ROM + kDVDFeaturesHDRBit = 10, // HD DVD-R + kDVDFeaturesHDRAMBit = 11, // HD DVD-RAM + kDVDFeaturesHDRWBit = 12 // HD DVD-RW +}; + +enum +{ + kDVDFeaturesCSSMask = (1 << kDVDFeaturesCSSBit), + kDVDFeaturesReadStructuresMask = (1 << kDVDFeaturesReadStructuresBit), + kDVDFeaturesWriteOnceMask = (1 << kDVDFeaturesWriteOnceBit), + kDVDFeaturesRandomWriteableMask = (1 << kDVDFeaturesRandomWriteableBit), + kDVDFeaturesReWriteableMask = (1 << kDVDFeaturesReWriteableBit), + kDVDFeaturesTestWriteMask = (1 << kDVDFeaturesTestWriteBit), + kDVDFeaturesBUFWriteMask = (1 << kDVDFeaturesBUFWriteBit), + kDVDFeaturesPlusRMask = (1 << kDVDFeaturesPlusRBit), + kDVDFeaturesPlusRWMask = (1 << kDVDFeaturesPlusRWBit), + kDVDFeaturesHDReadMask = (1 << kDVDFeaturesHDReadBit), + kDVDFeaturesHDRMask = (1 << kDVDFeaturesHDRBit), + kDVDFeaturesHDRAMMask = (1 << kDVDFeaturesHDRAMBit), + kDVDFeaturesHDRWMask = (1 << kDVDFeaturesHDRWBit) +}; + +typedef UInt32 BDFeatures; +enum +{ + kBDFeaturesReadBit = 0, // BD-ROM + kBDFeaturesWriteBit = 1 // BD-R / BD-RE +}; + +enum +{ + kBDFeaturesReadMask = (1 << kBDFeaturesReadBit), + kBDFeaturesWriteMask = (1 << kBDFeaturesWriteBit) +}; + +enum +{ + kDiscStatusEmpty = 0, + kDiscStatusIncomplete = 1, + kDiscStatusComplete = 2, + kDiscStatusOther = 3, + kDiscStatusMask = 0x03, + kDiscStatusErasableMask = 0x10 +}; + + +#if defined(KERNEL) && defined(__cplusplus) + +// MMC power states as defined in T10:1228D SCSI Multimedia Commands - 2 (MMC-2) +// Revision 11a, August 30, 1999, page 312 (Annex F). +enum +{ + kMMCPowerStateSystemSleep = 0, + kMMCPowerStateSleep = 1, + kMMCPowerStateStandby = 2, + kMMCPowerStateIdle = 3, + kMMCPowerStateActive = 4, + kMMCNumPowerStates = 5 +}; + +enum +{ + kMediaStateUnlocked = 0, + kMediaStateLocked = 1 +}; + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include +#include + +// Generic IOKit storage related headers +#include +#include +#include + +// SCSI Architecture Model Family includes +#include + +// Forward definitions for internal use only classes +class SCSIMultimediaCommands; +class SCSIBlockCommands; + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIMultimediaCommandsDevice : public IOSCSIPrimaryCommandsDevice +{ + + OSDeclareAbstractStructors ( IOSCSIMultimediaCommandsDevice ) + +private: + + static void AsyncReadWriteComplete ( SCSITaskIdentifier completedTask ); + +protected: + + // Reserve space for future expansion. + struct IOSCSIMultimediaCommandsDeviceExpansionData + { + IONotifier * fPowerDownNotifier; + bool fDeviceSupportsPowerOff; + BDFeatures fSupportedBDFeatures; + bool fDeviceSupportsAsyncNotification; + bool fDeviceSupportsFastSpindown; + UInt8 fCDLoadingMechanism; + bool fDoNotLockMedia; + }; + IOSCSIMultimediaCommandsDeviceExpansionData * fIOSCSIMultimediaCommandsDeviceReserved; + + #define fPowerDownNotifier fIOSCSIMultimediaCommandsDeviceReserved->fPowerDownNotifier + #define fDeviceSupportsPowerOff fIOSCSIMultimediaCommandsDeviceReserved->fDeviceSupportsPowerOff + #define fSupportedBDFeatures fIOSCSIMultimediaCommandsDeviceReserved->fSupportedBDFeatures + #define fDeviceSupportsAsyncNotification fIOSCSIMultimediaCommandsDeviceReserved->fDeviceSupportsAsyncNotification + #define fDeviceSupportsFastSpindown fIOSCSIMultimediaCommandsDeviceReserved->fDeviceSupportsFastSpindown + #define fCDLoadingMechanism fIOSCSIMultimediaCommandsDeviceReserved->fCDLoadingMechanism + #define fDoNotLockMedia fIOSCSIMultimediaCommandsDeviceReserved->fDoNotLockMedia + + CDFeatures fSupportedCDFeatures; + DVDFeatures fSupportedDVDFeatures; + + UInt16 fCurrentDiscSpeed; + bool fMediaChanged; + bool fMediaPresent; + + // The byte count of each physical block on the media. + UInt32 fMediaBlockSize; + + // The total number of blocks of fMediaBlockSize on the media. + UInt32 fMediaBlockCount; + + // Flags used to indicate device feature + bool fMediaIsRemovable; + bool fMediaIsWriteProtected; + UInt32 fMediaType; + + thread_call_t fPollingThread; + bool fDeviceSupportsLowPowerPolling; + bool fLowPowerPollingEnabled; + UInt32 fPollingMode; + + enum + { + kPollingMode_Suspended = 0, + kPollingMode_NewMedia = 1, + kPollingMode_MediaRemoval = 2 + }; + + virtual IOReturn setProperties ( OSObject * properties ) APPLE_KEXT_OVERRIDE; + + virtual void CreateStorageServiceNub ( void ); + virtual bool DetermineDeviceCharacteristics ( void ); + virtual IOReturn DetermineIfMediaIsRemovable ( void ); + virtual IOReturn DetermineDeviceFeatures ( void ); + virtual void DetermineMediaType ( void ); + virtual bool CheckForDVDMediaType ( void ); + virtual bool CheckForCDMediaType ( void ); + virtual void PollForMedia ( void ); + virtual void EnablePolling ( void ); + virtual void DisablePolling ( void ); + virtual void CheckWriteProtection ( void ); + virtual bool ClearNotReadyStatus ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn GetDeviceConfiguration ( void ); + virtual IOReturn GetDeviceConfigurationSize ( UInt32 * size ); + virtual IOReturn ParseFeatureList ( UInt32 numProfiles, UInt8 * firstFeaturePtr ); + + virtual IOReturn GetMechanicalCapabilities ( void ); + virtual IOReturn GetMechanicalCapabilitiesSize ( UInt32 * size ); + virtual IOReturn ParseMechanicalCapabilities ( UInt8 * mechanicalCapabilitiesPtr ); + + virtual IOReturn CheckForLowPowerPollingSupport ( void ); + virtual IOReturn GetCurrentPowerStateOfDrive ( UInt32 * powerState ); + + virtual IOReturn IssueRead ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueRead ( IOMemoryDescriptor * buffer, + void * clientData, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueWrite ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueWrite ( IOMemoryDescriptor * buffer, + void * clientData, + UInt64 startBlock, + UInt64 blockCount ); + + virtual void SetMediaCharacteristics ( UInt32 blockSize, UInt32 blockCount ); + virtual void ResetMediaCharacteristics ( void ); + + UInt8 ConvertBCDToHex ( UInt8 binaryCodedDigit ); + + // ------ User Client Support ------ + + virtual IOReturn HandleSetUserClientExclusivityState ( IOService * userClient, bool state ) APPLE_KEXT_OVERRIDE; + + // ----- Power Management Support ------ + + // We override this method to set our power states and register ourselves + // as a power policy maker. + virtual void InitializePowerManagement ( IOService * provider ) APPLE_KEXT_OVERRIDE; + + // We override this method so that when we register for power management, + // we go to our active power state (which the drive is definitely in + // at startup time). + virtual UInt32 GetInitialPowerState ( void ) APPLE_KEXT_OVERRIDE; + + // We override this method in order to provide the number of transitions + // from Fully active to Sleep state so that the idle timer can be adjusted + // to the appropriate time period based on the disk spindown time set in + // the Energy Saver prefs panel. + virtual UInt32 GetNumberOfPowerStateTransitions ( void ) APPLE_KEXT_OVERRIDE; + + // The TicklePowerManager method is called to tell the power manager that the + // device needs to be in a certain power state to handle requests. + virtual void TicklePowerManager ( void ) APPLE_KEXT_OVERRIDE; + + // The HandlePowerChange method is the state machine for power management. + // It is guaranteed to be on its own thread of execution (different from + // the power manager thread AND the workloop thread. This routine can + // send sync or async calls to the drive without worrying about threading + // issues. + virtual void HandlePowerChange ( void ) APPLE_KEXT_OVERRIDE; + + // The HandleCheckPowerState (void) method is on the serialized side of the command + // gate and can change member variables safely without multi-threading issues. + // It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + // with the max power state the class registered with. + virtual void HandleCheckPowerState ( void ) APPLE_KEXT_OVERRIDE; + + // The CheckMediaPresence method is called to see if the media which we + // anticipated being there is still there. + virtual bool CheckMediaPresence ( void ); + + virtual bool InitializeDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + virtual void StartDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + virtual void SuspendDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + virtual void ResumeDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + virtual void StopDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + virtual void TerminateDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn VerifyDeviceState ( void ) APPLE_KEXT_OVERRIDE; + + +public: + + virtual IOReturn setAggressiveness ( unsigned long type, unsigned long minutes ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn SyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn AsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + void * clientData ); + + virtual IOReturn EjectTheMedia ( void ); + virtual IOReturn GetTrayState ( UInt8 * trayState ); + virtual IOReturn SetTrayState ( UInt8 trayState ); + virtual IOReturn FormatMedia ( UInt64 byteCapacity ); + virtual UInt32 GetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + virtual IOReturn LockUnlockMedia ( bool doLock ); + virtual IOReturn SynchronizeCache ( void ); + virtual IOReturn ReportBlockSize ( UInt64 * blockSize ); + virtual IOReturn ReportEjectability ( bool * isEjectable ); + virtual IOReturn ReportLockability ( bool * isLockable ); + virtual IOReturn ReportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + virtual IOReturn ReportMaxReadTransfer ( UInt64 blockSize, + UInt64 * max ); + virtual IOReturn ReportMaxValidBlock ( UInt64 * maxBlock ); + virtual IOReturn ReportMaxWriteTransfer ( UInt64 blockSize, + UInt64 * max ); + virtual IOReturn ReportMediaState ( bool * mediaPresent, + bool * changed ); + virtual IOReturn ReportRemovability ( bool * isRemovable ); + virtual IOReturn ReportWriteProtection ( bool * isWriteProtected ); + + static void sPollForMedia ( void * pdtDriver, void * refCon ); + + /* CD Specific */ + virtual IOReturn SetMediaAccessSpeed ( UInt16 kilobytesPerSecond ); + + virtual IOReturn GetMediaAccessSpeed ( UInt16 * kilobytesPerSecond ); + + virtual IOReturn AsyncReadCD ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + void * clientData ); + + virtual IOReturn ReadISRC ( UInt8 track, CDISRC isrc ); + + virtual IOReturn ReadMCN ( CDMCN mcn); + + virtual IOReturn ReadTOC ( IOMemoryDescriptor * buffer ); + + /* DVD Specific */ + virtual UInt32 GetMediaType ( void ); + + virtual IOReturn ReportKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 lba, + const UInt8 agid, + const DVDKeyFormat keyFormat ) __attribute__ ((deprecated)); + + virtual IOReturn SendKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn ReadDVDStructure ( IOMemoryDescriptor * buffer, + const UInt32 length, + const UInt8 structureFormat, + const UInt32 logicalBlockAddress, + const UInt8 layer, + const UInt8 agid ); + + // The block size decoding for Read CD and Read CD MSF as defined in table 255 + bool GetBlockSize ( + UInt32 * requestedByteCount, + SCSICmdField3Bit EXPECTED_SECTOR_TYPE, + SCSICmdField1Bit SYNC, + SCSICmdField2Bit HEADER_CODES, + SCSICmdField1Bit USER_DATA, + SCSICmdField1Bit EDC_ECC, + SCSICmdField2Bit ERROR_FIELD, + SCSICmdField3Bit SUBCHANNEL_SELECTION_BITS ); + + SCSICmdField4Byte ConvertMSFToLBA ( SCSICmdField3Byte MSF ); + + // The GET CONFIGURATION command as defined in section 6.1.4 + virtual bool GET_CONFIGURATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Bit RT, + SCSICmdField2Byte STARTING_FEATURE_NUMBER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The GET EVENT/STATUS NOTIFICATION command as defined in section 6.1.5 + virtual bool GET_EVENT_STATUS_NOTIFICATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit IMMED, + SCSICmdField1Byte NOTIFICATION_CLASS_REQUEST, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The GET PERFORMANCE command as defined in section 6.1.6 + virtual bool GET_PERFORMANCE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Bit TOLERANCE, + SCSICmdField1Bit WRITE, + SCSICmdField2Bit EXCEPT, + SCSICmdField4Byte STARTING_LBA, + SCSICmdField2Byte MAXIMUM_NUMBER_OF_DESCRIPTORS, + SCSICmdField1Byte CONTROL ); + + // The LOAD/UNLOAD MEDIUM command as defined in section 6.1.7 + virtual bool LOAD_UNLOAD_MEDIUM ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit LO_UNLO, + SCSICmdField1Bit START, + SCSICmdField1Byte SLOT, + SCSICmdField1Byte CONTROL ); + + // The MECHANISM STATUS command as defined in section 6.1.8 + virtual bool MECHANISM_STATUS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor *dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The READ CD command as defined in section 6.1.15 + virtual bool READ_CD ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit EXPECTED_SECTOR_TYPE, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte STARTING_LOGICAL_BLOCK_ADDRESS, + SCSICmdField3Byte TRANSFER_LENGTH, + SCSICmdField1Bit SYNC, + SCSICmdField2Bit HEADER_CODES, + SCSICmdField1Bit USER_DATA, + SCSICmdField1Bit EDC_ECC, + SCSICmdField2Bit ERROR_FIELD, + SCSICmdField3Bit SUBCHANNEL_SELECTION_BITS, + SCSICmdField1Byte CONTROL ); + + // The READ CD MSF command as defined in section 6.1.16 + virtual bool READ_CD_MSF ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit EXPECTED_SECTOR_TYPE, + SCSICmdField3Byte STARTING_MSF, + SCSICmdField3Byte ENDING_MSF, + SCSICmdField1Bit SYNC, + SCSICmdField2Bit HEADER_CODES, + SCSICmdField1Bit USER_DATA, + SCSICmdField1Bit EDC_ECC, + SCSICmdField2Bit ERROR_FIELD, + SCSICmdField3Bit SUBCHANNEL_SELECTION_BITS, + SCSICmdField1Byte CONTROL ); + + // The READ CAPACITY command as defined in section 6.1.17 + virtual bool READ_CAPACITY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Bit PMI, + SCSICmdField1Byte CONTROL ); + + // The READ DISC INFORMATION command as defined in section 6.1.18 + virtual bool READ_DISC_INFORMATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The READ DVD STRUCTURE command as defined in section 6.1.19 + virtual bool READ_DVD_STRUCTURE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte ADDRESS, + SCSICmdField1Byte LAYER_NUMBER, + SCSICmdField1Byte FORMAT, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField1Byte CONTROL ); + + // The READ FORMAT CAPACITIES command as defined in section 6.1.20 + virtual bool READ_FORMAT_CAPACITIES ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The READ SUB-CHANNEL command as defined in section 6.1.23 + virtual bool READ_SUB_CHANNEL ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit MSF, + SCSICmdField1Bit SUBQ, + SCSICmdField1Byte SUB_CHANNEL_PARAMETER_LIST, + SCSICmdField1Byte TRACK_NUMBER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The READ TOC/PMA/ATIP command as defined in section 6.1.24/25 + virtual bool READ_TOC_PMA_ATIP ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit MSF, + SCSICmdField4Bit FORMAT, + SCSICmdField1Byte TRACK_SESSION_NUMBER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The READ TRACK INFORMATION command as defined in section 6.1.26 + virtual bool READ_TRACK_INFORMATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Bit ADDRESS_NUMBER_TYPE, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS_TRACK_SESSION_NUMBER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The SET CD SPEED command as defined in section 6.1.36 + virtual bool SET_CD_SPEED ( + SCSITaskIdentifier request, + SCSICmdField2Byte LOGICAL_UNIT_READ_SPEED, + SCSICmdField2Byte LOGICAL_UNIT_WRITE_SPEED, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT ***********************/ + + // The SET READ AHEAD command as defined in section 6.1.37 + virtual bool SET_READ_AHEAD ( + SCSITaskIdentifier request, + SCSICmdField4Byte TRIGGER_LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte READ_AHEAD_LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte CONTROL ); + + // The SET STREAMING command as defined in section 6.1.38 + virtual bool SET_STREAMING ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool START_STOP_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField4Bit POWER_CONDITIONS, + SCSICmdField1Bit LOEJ, + SCSICmdField1Bit START, + SCSICmdField1Byte CONTROL ); + + // The SYNCHRONIZE CACHE command as defined in section 6.1.40 + virtual bool SYNCHRONIZE_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + // The WRITE (10) command as defined in section 6.1.41 + virtual bool WRITE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The WRITE AND VERIFY (10) command as defined in section 6.1.42 + virtual bool WRITE_AND_VERIFY_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYT_CHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + /* Added with 10.1.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 1 ); + + virtual IOReturn ReadTOC ( IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 msf, + UInt32 trackSessionNumber, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 2 ); + + virtual IOReturn ReadDiscInfo ( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 3 ); + + virtual IOReturn ReadTrackInfo ( IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount ); + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 4 ); + + virtual IOReturn PowerDownHandler ( void * refCon, + UInt32 messageType, + IOService * provider, + void * messageArgument, + vm_size_t argSize ); + + /* Added with 10.3.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 5 ); + + +protected: + + + virtual void AsyncReadWriteCompletion ( SCSITaskIdentifier completedTask ); + + +public: + + + /* Added with 10.5 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 6 ); + + virtual IOReturn ReadDiscStructure ( IOMemoryDescriptor * buffer, + const UInt32 length, + const UInt8 structureFormat, + const UInt32 logicalBlockAddress, + const UInt8 layer, + const UInt8 agid, + const UInt8 mediaType ); + + + bool CheckForBDMediaType ( void ); + + + bool READ_DISC_STRUCTURE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Bit MEDIA_TYPE, + SCSICmdField4Byte ADDRESS, + SCSICmdField1Byte LAYER_NUMBER, + SCSICmdField1Byte FORMAT, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField1Byte CONTROL ); + + + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 7 ); + + virtual IOReturn ReserveTrack ( UInt8 reservationType, + UInt8 reservationFormat, + UInt64 ReservationParameter ); + + + bool RESERVE_TRACK_V2 ( SCSITaskIdentifier request, + SCSICmdField1Bit RMZ, + SCSICmdField1Bit ARSV, + SCSICmdField7Byte RESERVATION_PARAMETER, + SCSICmdField1Byte CONTROL ); + + + bool REPORT_KEY_V2 ( SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte KEY_CLASS, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField6Bit KEY_FORMAT, + SCSICmdField1Byte CONTROL ) __attribute__ ((deprecated)); + + + bool REPORT_KEY_V3 ( SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte KEY_CLASS, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte BLOCK_COUNT, + SCSICmdField2Bit AGID, + SCSICmdField6Bit KEY_FORMAT, + SCSICmdField1Byte CONTROL ); + + + bool SEND_KEY_V2 ( SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte KEY_CLASS, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField6Bit KEY_FORMAT, + SCSICmdField1Byte CONTROL ); + + +protected: + + + void SetPollingMode ( UInt32 newPollingMode ); + + +public: + + + /* 10.6.0 */ + + IOReturn RequestIdle ( void ); + + /* 10.12.0 */ + virtual IOReturn ReportKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 lba, + const UInt8 blockCount, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_MULTIMEDIA_COMMANDS_DEVICE_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceNub.h b/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceNub.h new file mode 100644 index 0000000..f6404c9 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceNub.h @@ -0,0 +1,228 @@ +/* + * Copyright (c) 1998-2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_NUB_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_NUB_H_ + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// Probe score values +enum +{ + kPeripheralDeviceTypeNoMatch = 0, + kDefaultProbeRanking = 5000, + kFirstOrderRanking = 10000, + kSecondOrderRanking = 15000, + kThirdOrderRanking = 20000 +}; + + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include +#include + +// SCSI Architecture Model Family includes +#include + +// Build includes +#include + + +// Forward definitions for internal use only classes. +class SCSIPrimaryCommands; + +//----------------------------------------------------------------------------- +// Class Declarations +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceNub : public IOSCSIProtocolServices +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceNub ) + +private: + + static bool sCompareIOProperty ( + IOService * object, + OSDictionary * table, + char * propertyKeyName, + bool * matches ); + + static void TaskCallback ( SCSITaskIdentifier completedTask ); + void TaskCompletion ( SCSITaskIdentifier completedTask ); + + static IOReturn sWaitForTask ( void * object, SCSITask * request ); + IOReturn GatedWaitForTask ( SCSITask * request ); + +protected: + + SCSIServiceResponse SendTask ( SCSITask * request ); + + bool InterrogateDevice ( void ); + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceNubExpansionData { }; + IOSCSIPeripheralDeviceNubExpansionData * fIOSCSIPeripheralDeviceNubReserved; + + IOSCSIProtocolInterface * fProvider; + + UInt8 fDefaultInquiryCount; + + virtual bool SendSCSICommand ( SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ) APPLE_KEXT_OVERRIDE; + + virtual SCSIServiceResponse AbortSCSICommand ( SCSITaskIdentifier request ) APPLE_KEXT_OVERRIDE; + + // The IsProtocolServiceSupported will return true if the specified + // feature is supported by the protocol layer. If the service has a value that must be + // returned, it will be returned in the serviceValue output parameter. + virtual bool IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue ) APPLE_KEXT_OVERRIDE; + + virtual bool HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue ) APPLE_KEXT_OVERRIDE; + +public: + + bool init ( OSDictionary * propTable ) APPLE_KEXT_OVERRIDE; + virtual bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn message ( UInt32 type, IOService * nub, void * arg ) APPLE_KEXT_OVERRIDE; + + virtual bool matchPropertyTable ( OSDictionary * table, + SInt32 * score ) APPLE_KEXT_OVERRIDE; + + // The ExecuteCommand method will take a SCSITask object and transport + // it across the physical wires to the device + virtual void ExecuteCommand ( SCSITaskIdentifier request ) APPLE_KEXT_OVERRIDE; + + // The Task Management function to allow the SCSI Application Layer client to request + // that a specific task be aborted. + virtual SCSIServiceResponse AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag ) APPLE_KEXT_OVERRIDE; + + // The Task Management function to allow the SCSI Application Layer client to request + // that a all tasks curerntly in the task set be aborted. + virtual SCSIServiceResponse AbortTaskSet ( UInt8 theLogicalUnit ) APPLE_KEXT_OVERRIDE; + + virtual SCSIServiceResponse ClearACA ( UInt8 theLogicalUnit ) APPLE_KEXT_OVERRIDE; + + virtual SCSIServiceResponse ClearTaskSet ( UInt8 theLogicalUnit ) APPLE_KEXT_OVERRIDE; + + virtual SCSIServiceResponse LogicalUnitReset ( UInt8 theLogicalUnit ) APPLE_KEXT_OVERRIDE; + + virtual SCSIServiceResponse TargetReset ( void ) APPLE_KEXT_OVERRIDE; + + // ************* Obsoleted Member Routine **************** + // The AbortCommand method is replaced by the AbortTask Management function and + // should no longer be called. + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier abortTask ) APPLE_KEXT_OVERRIDE; + +private: + + +#if !TARGET_OS_IPHONE + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 16 ); +#endif /* !TARGET_OS_IPHONE */ + +}; + + +class IOSCSILogicalUnitNub : public IOSCSIPeripheralDeviceNub +{ + + OSDeclareDefaultStructors ( IOSCSILogicalUnitNub ) + +private: + + UInt8 fLogicalUnitNumber; + +protected: + + // Reserve space for future expansion. + struct IOSCSILogicalUnitNubExpansionData { }; + IOSCSILogicalUnitNubExpansionData * fIOSCSILogicalUnitNubReserved; + +public: + + virtual void SetLogicalUnitNumber ( UInt8 newLUN ); + UInt8 GetLogicalUnitNumber ( void ); + + // The ExecuteCommand method will take a SCSITask object and transport + // it across the physical wires to the device + virtual void ExecuteCommand ( SCSITaskIdentifier request ) APPLE_KEXT_OVERRIDE; + +private: + +#if !TARGET_OS_IPHONE + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 16 ); +#endif /* !TARGET_OS_IPHONE */ + +}; + + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_NUB_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceType00.h b/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceType00.h new file mode 100644 index 0000000..0e8e8af --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceType00.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_OO_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_OO_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceType00 : public IOSCSIBlockCommandsDevice +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceType00 ) + +protected: + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceType00ExpansionData + { + OSSet * fClients; + }; + IOSCSIPeripheralDeviceType00ExpansionData * fIOSCSIPeripheralDeviceType00Reserved; + +public: + + bool init ( OSDictionary * propTable ) APPLE_KEXT_OVERRIDE; + virtual bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + + virtual bool handleOpen ( + IOService * client, + IOOptionBits options, + void * access ) APPLE_KEXT_OVERRIDE; + + virtual void handleClose ( + IOService * client, + IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + virtual bool handleIsOpen ( const IOService * client ) const APPLE_KEXT_OVERRIDE; + + virtual IOReturn newUserClient ( + task_t owningTask, + void * securityID, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler ) APPLE_KEXT_OVERRIDE; + virtual void CreateStorageServiceNub ( void ) APPLE_KEXT_OVERRIDE; + + virtual char * GetVendorString ( void ) APPLE_KEXT_OVERRIDE; + virtual char * GetProductString ( void ) APPLE_KEXT_OVERRIDE; + virtual char * GetRevisionString ( void ) APPLE_KEXT_OVERRIDE; + + +private: + +#if !TARGET_OS_IPHONE + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 8 ); +#endif /* !TARGET_OS_IPHONE */ + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_OO_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceType05.h b/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceType05.h new file mode 100644 index 0000000..e443166 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceType05.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_05_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_05_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceType05 : public IOSCSIMultimediaCommandsDevice +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceType05 ) + +protected: + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceType05ExpansionData { }; + IOSCSIPeripheralDeviceType05ExpansionData * fIOSCSIPeripheralDeviceType05Reserved; + +public: + + bool init ( OSDictionary * propTable ) APPLE_KEXT_OVERRIDE; + virtual bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void stop ( IOService * provider ) APPLE_KEXT_OVERRIDE; + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_05_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceType07.h b/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceType07.h new file mode 100644 index 0000000..9631287 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceType07.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_07_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_07_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceType07 : public IOSCSIBlockCommandsDevice +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceType07 ) + +protected: + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceType07ExpansionData { }; + IOSCSIPeripheralDeviceType07ExpansionData * fIOSCSIPeripheralDeviceType07Reserved; + +public: + + bool init ( OSDictionary * propTable ) APPLE_KEXT_OVERRIDE; + virtual bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void stop ( IOService * provider ) APPLE_KEXT_OVERRIDE; + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_07_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceType0E.h b/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceType0E.h new file mode 100644 index 0000000..d3eac58 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOSCSIPeripheralDeviceType0E.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_0E_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_0E_H_ + +#if defined(KERNEL) && defined(__cplusplus) + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceType0E : public IOSCSIReducedBlockCommandsDevice +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceType0E ) + +protected: + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceType0EExpansionData { }; + IOSCSIPeripheralDeviceType0EExpansionData * fIOSCSIPeripheralDeviceType0EReserved; + +public: + + bool init ( OSDictionary * propTable ) APPLE_KEXT_OVERRIDE; + virtual bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void stop ( IOService * provider ) APPLE_KEXT_OVERRIDE; + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_0E_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOSCSIPrimaryCommandsDevice.h b/QualcommWireless/include/IOKit/scsi/IOSCSIPrimaryCommandsDevice.h new file mode 100644 index 0000000..53a1575 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOSCSIPrimaryCommandsDevice.h @@ -0,0 +1,731 @@ +/* + * Copyright (c) 1998-2015 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_ +#define _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include +#include +#include +#include + +// SCSI Architecture Model Family includes +#include +#include +#include +#include + +// Build includes +#include + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// Notification messages +enum +{ + kSCSIServicesNotification_Suspend = 0x69000080, + kSCSIServicesNotification_Resume = 0x69000090 +}; + + +// Timeout values +enum +{ + kOneSecondTimeoutInMS = 1000, + kTenSecondTimeoutInMS = 10 * kOneSecondTimeoutInMS, + kThirtySecondTimeoutInMS = 30 * kOneSecondTimeoutInMS, + kFortyFiveSecondTimeoutInMS = 45 * kOneSecondTimeoutInMS +}; + +// Mode page values for page control field +enum +{ + kModePageControlCurrentValues = 0x00, + kModePageControlChangeableValues = 0x01, + kModePageControlDefaultValues = 0x02, + kModePageControlSavedValues = 0x03 +}; + +// The command should be tried 5 times. The original attempt +// plus 4 retries. +#define kDefaultRetryCount 4 + +// Forward declarations for internal use only classes +class SCSIPrimaryCommands; + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPrimaryCommandsDevice : public IOSCSIProtocolInterface +{ + + OSDeclareAbstractStructors ( IOSCSIPrimaryCommandsDevice ) + + friend class SCSITaskUserClient; + +private: + + IOSCSIProtocolInterface * fProtocolDriver; + + // The fProtocolAccessEnabled member variable indicates whether + // requests coming from the client can be sent to the device. + // This will be set to true after the Protocol Service driver is successfully + // opened and before the call to InitializeDeviceSupport and set to false before + // TerminateDeviceSupport is called. + bool fProtocolAccessEnabled; + + // The fDeviceAccessEnabled member variable indicates whether + // requests coming from the client can be sent to the device. + // This will be set to true after InitializeDeviceSupport is called and + // set to false before StopDeviceSupport is called. + bool fDeviceAccessEnabled; + bool fDeviceAccessSuspended; + + static bool ServerKeyswitchCallback ( void * target, + void * refCon, + IOService * newService ); + + static void TaskCallback ( SCSITaskIdentifier completedTask ); + void TaskCompletion ( SCSITaskIdentifier completedTask ); + + static IOReturn sWaitForTask ( void * object, SCSITaskIdentifier request ); + IOReturn GatedWaitForTask ( SCSITaskIdentifier request ); + +protected: + + // Reserve space for future expansion. + struct IOSCSIPrimaryCommandsDeviceExpansionData + { + IONotifier * fKeySwitchNotifier; + UInt8 fANSIVersion; + UInt32 fReadTimeoutDuration; + UInt32 fWriteTimeoutDuration; + bool fCMDQUE; + SCSITaggedTaskIdentifier fTaskID; + IOSimpleLock * fTaskIDLock; + UInt32 fRetryCount; + UInt32 fNumCommandsExecuting; + int fMaxPollRetries; + int fPollDebounceRetriesLeft; + }; + IOSCSIPrimaryCommandsDeviceExpansionData * fIOSCSIPrimaryCommandsDeviceReserved; + + #define fReadTimeoutDuration fIOSCSIPrimaryCommandsDeviceReserved->fReadTimeoutDuration + #define fWriteTimeoutDuration fIOSCSIPrimaryCommandsDeviceReserved->fWriteTimeoutDuration + #define fRetryCount fIOSCSIPrimaryCommandsDeviceReserved->fRetryCount + #define fNumCommandsExecuting fIOSCSIPrimaryCommandsDeviceReserved->fNumCommandsExecuting + #define fMaxPollRetries fIOSCSIPrimaryCommandsDeviceReserved->fMaxPollRetries + #define fPollDebounceRetriesLeft fIOSCSIPrimaryCommandsDeviceReserved->fPollDebounceRetriesLeft + + UInt8 fDefaultInquiryCount; + OSDictionary * fDeviceCharacteristicsDictionary; + UInt32 fNumCommandsOutstanding; + + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + void SetANSIVersion ( UInt8 ); + void SetCMDQUE ( bool value ); + IOReturn GetModeSense ( + IOMemoryDescriptor * dataBuffer, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField2Byte ALLOCATION_LENGTH, + bool * use10ByteModeSense ); + bool RetrieveINQUIRYData ( + UInt8 EVPD, + UInt8 inquiryPage, + UInt8 * inquiryBuffer, + UInt16 * dataSize ); + + // This flag is set if the device responds to a MODE_SENSE_10 command + // with the page code set to 0x1A (Power Conditions Mode Page) + bool fDeviceSupportsPowerConditions; + + // This method is called by the start method to obtain information from + // the device with regards to whether it supports the power conditions mode page. + virtual void CheckPowerConditionsModePage ( void ); + + // This will return back the Protocol driver that is used to + // send service requests to the device. + virtual IOSCSIProtocolInterface * GetProtocolDriver ( void ); + + // This will get a new SCSITask for the caller + virtual SCSITaskIdentifier GetSCSITask ( void ); + + // This will release a SCSITask (eventually return it to a pool) + virtual void ReleaseSCSITask ( SCSITaskIdentifier request ); + + // This will return a unique value for the tagged task identifier + SCSITaggedTaskIdentifier GetUniqueTagID ( void ); + + // Call for executing the command synchronously + SCSIServiceResponse SendCommand ( + SCSITaskIdentifier request, + UInt32 timeoutDuration ); + + // Call for executing the command asycnchronously + void SendCommand ( + SCSITaskIdentifier request, + UInt32 timeoutDuration, + SCSITaskCompletion taskCompletion ); + + + virtual bool InitializeDeviceSupport ( void ) = 0; + virtual void StartDeviceSupport ( void ) = 0; + virtual void SuspendDeviceSupport ( void ) = 0; + virtual void ResumeDeviceSupport ( void ) = 0; + virtual void StopDeviceSupport ( void ) = 0; + virtual void TerminateDeviceSupport ( void ) = 0; + virtual UInt32 GetNumberOfPowerStateTransitions ( void ) = 0; + + virtual IOReturn VerifyDeviceState ( void ); + // Called to clear any power-on/reset status in the drive + virtual bool ClearPowerOnReset ( void ); + virtual bool ClearNotReadyStatus ( void ) = 0; + + bool IsProtocolAccessEnabled ( void ); + bool IsDeviceAccessEnabled ( void ); + bool IsDeviceAccessSuspended ( void ); + + // Accessors for saving and retrieving data from an SCSITask object. + bool ResetForNewTask( + SCSITaskIdentifier request ); + bool SetTaskAttribute ( + SCSITaskIdentifier request, + SCSITaskAttribute newAttribute ); + SCSITaskAttribute GetTaskAttribute ( + SCSITaskIdentifier request ); + bool SetTaggedTaskIdentifier ( + SCSITaskIdentifier request, + SCSITaggedTaskIdentifier taggedTaskIdentifier ); + SCSITaggedTaskIdentifier GetTaggedTaskIdentifier ( + SCSITaskIdentifier request ); + bool SetTaskState ( + SCSITaskIdentifier request, + SCSITaskState newTaskState ); + SCSITaskState GetTaskState ( + SCSITaskIdentifier request ); + bool SetTaskStatus ( + SCSITaskIdentifier request, + SCSITaskStatus newStatus ); + SCSITaskStatus GetTaskStatus ( + SCSITaskIdentifier request ); + bool SetCommandDescriptorBlock ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5 ); + + // Populate the 10 Byte Command Descriptor Block + bool SetCommandDescriptorBlock ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5, + UInt8 cdbByte6, + UInt8 cdbByte7, + UInt8 cdbByte8, + UInt8 cdbByte9 ); + + // Populate the 12 Byte Command Descriptor Block + bool SetCommandDescriptorBlock ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5, + UInt8 cdbByte6, + UInt8 cdbByte7, + UInt8 cdbByte8, + UInt8 cdbByte9, + UInt8 cdbByte10, + UInt8 cdbByte11 ); + + // Populate the 16 Byte Command Descriptor Block + bool SetCommandDescriptorBlock ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5, + UInt8 cdbByte6, + UInt8 cdbByte7, + UInt8 cdbByte8, + UInt8 cdbByte9, + UInt8 cdbByte10, + UInt8 cdbByte11, + UInt8 cdbByte12, + UInt8 cdbByte13, + UInt8 cdbByte14, + UInt8 cdbByte15 ); + + bool SetDataTransferDirection ( + SCSITaskIdentifier request, + UInt8 newDirection ); + UInt8 GetDataTransferDirection ( + SCSITaskIdentifier request ); + bool SetRequestedDataTransferCount ( + SCSITaskIdentifier request, + UInt64 newRequestedCount ); + UInt64 GetRequestedDataTransferCount ( + SCSITaskIdentifier request ); + bool SetRealizedDataTransferCount ( + SCSITaskIdentifier request, + UInt64 newRealizedDataCount ); + UInt64 GetRealizedDataTransferCount ( + SCSITaskIdentifier request ); + bool SetDataBuffer ( + SCSITaskIdentifier request, + IOMemoryDescriptor * newBuffer ); + IOMemoryDescriptor * GetDataBuffer ( + SCSITaskIdentifier request ); + bool SetTimeoutDuration ( + SCSITaskIdentifier request, + UInt32 newTimeout ); + UInt32 GetTimeoutDuration ( + SCSITaskIdentifier request ); + bool SetTaskCompletionCallback ( + SCSITaskIdentifier request, + SCSITaskCompletion newCallback ); + void TaskCompletedNotification ( + SCSITaskIdentifier request ); + + bool SetServiceResponse ( + SCSITaskIdentifier request, + SCSIServiceResponse serviceResponse ); + SCSIServiceResponse GetServiceResponse ( + SCSITaskIdentifier request ); + bool SetAutosenseCommand ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5 ); + bool GetAutoSenseData ( + SCSITaskIdentifier request, + SCSI_Sense_Data * senseData ); // DEPRECATED, use below function instead + bool GetAutoSenseData ( + SCSITaskIdentifier request, + SCSI_Sense_Data * senseData, + UInt8 senseDataSize ); + UInt8 GetAutoSenseDataSize ( + SCSITaskIdentifier request ); + + bool SetApplicationLayerReference ( + SCSITaskIdentifier request, + void * newReferenceValue ); + void * GetApplicationLayerReference ( + SCSITaskIdentifier request ); + + void IncrementOutstandingCommandsCount ( void ); + static void sIncrementOutstandingCommandsCount ( + IOSCSIPrimaryCommandsDevice * self ); + virtual void HandleIncrementOutstandingCommandsCount ( void ); + + + // This static member routine provides a mechanism for retrieving a pointer to + // the object that is claimed as the owner of the specified SCSITask. + static OSObject * sGetOwnerForTask ( SCSITaskIdentifier request ); + +public: + + bool init ( OSDictionary * propTable ) APPLE_KEXT_OVERRIDE; + virtual bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void stop ( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual IOReturn message ( UInt32 type, IOService * nub, void * arg ) APPLE_KEXT_OVERRIDE; + + // The setAgressiveness method is called by the power manager + // to notify us of certain power management settings. We override + // this method in order to catch the kPMMinutesToSpinDown message + // in order to set our idle timer. + virtual IOReturn setAggressiveness ( unsigned long type, unsigned long minutes ) APPLE_KEXT_OVERRIDE; + + // Methods for getting device information strings + virtual char * GetVendorString ( void ); + virtual char * GetProductString ( void ); + virtual char * GetRevisionString ( void ); + OSDictionary * GetProtocolCharacteristicsDictionary ( void ); + OSDictionary * GetDeviceCharacteristicsDictionary ( void ); + UInt8 GetANSIVersion ( void ); + bool GetCMDQUE ( void ); +#if !TARGET_OS_IPHONE + OSString * MapINQUIRYDataToIconFile ( void ); +#endif /* !TARGET_OS_IPHONE */ + UInt32 GetRetryCount ( void ); + + // -- SCSI Protocol Interface Methods -- + // The ExecuteCommand method will take a SCSI Task and transport + // it across the physical wire(s) to the device + virtual void ExecuteCommand ( SCSITaskIdentifier request ) APPLE_KEXT_OVERRIDE; + + // The Task Management function to allow the SCSI Application Layer client to request + // that a specific task be aborted. + SCSIServiceResponse AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag ) APPLE_KEXT_OVERRIDE; + + // The Task Management function to allow the SCSI Application Layer client to request + // that a all tasks curerntly in the task set be aborted. + SCSIServiceResponse AbortTaskSet ( UInt8 theLogicalUnit ) APPLE_KEXT_OVERRIDE; + + SCSIServiceResponse ClearACA ( UInt8 theLogicalUnit ) APPLE_KEXT_OVERRIDE; + + SCSIServiceResponse ClearTaskSet ( UInt8 theLogicalUnit ) APPLE_KEXT_OVERRIDE; + + SCSIServiceResponse LogicalUnitReset ( UInt8 theLogicalUnit ) APPLE_KEXT_OVERRIDE; + + SCSIServiceResponse TargetReset ( void ) APPLE_KEXT_OVERRIDE; + + // The AbortCommand method will abort the indicated SCSI Task, + // if it is possible and the task has not already completed. + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier request ) APPLE_KEXT_OVERRIDE; + + // The IsProtocolServiceSupported will return true if the specified + // feature is supported by the protocol layer. If the service has a value that must be + // returned, it will be returned in the serviceValue output parameter. + virtual bool IsProtocolServiceSupported ( + SCSIProtocolFeature feature, + void * serviceValue ) APPLE_KEXT_OVERRIDE; + + // The HandleProtocolServiceFeature will return true if the specified feature could + // be handled properly by the protocol layer. + virtual bool HandleProtocolServiceFeature ( + SCSIProtocolFeature feature, + void * serviceValue ) APPLE_KEXT_OVERRIDE; + + // Utility methods for use by all peripheral device objects. + + // isParameterValid are used to validate that the parameter passed into + // the command methods are of the correct value. + + // Validate Parameter used for 1 bit to 1 byte paramaters + bool IsParameterValid ( + SCSICmdField1Byte param, + SCSICmdField1Byte mask ); + + // Validate Parameter used for 9 bit to 2 byte paramaters + bool IsParameterValid ( + SCSICmdField2Byte param, + SCSICmdField2Byte mask ); + + // Validate Parameter used for 17 bit to 4 byte paramaters + bool IsParameterValid ( + SCSICmdField4Byte param, + SCSICmdField4Byte mask ); + + // Validate Parameter used for 33 bit to 8 byte paramaters + bool IsParameterValid ( + SCSICmdField8Byte param, + SCSICmdField8Byte mask ); + + + bool IsMemoryDescriptorValid ( + IOMemoryDescriptor * dataBuffer ); + + bool IsMemoryDescriptorValid ( + IOMemoryDescriptor * dataBuffer, + UInt64 requiredSize ); + + virtual bool INQUIRY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit CMDDT, + SCSICmdField1Bit EVPD, + SCSICmdField1Byte PAGE_OR_OPERATION_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + +#if !TARGET_OS_IPHONE + + virtual bool LOG_SELECT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PCR, + SCSICmdField1Bit SP, + SCSICmdField2Bit PC, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool LOG_SENSE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PPC, + SCSICmdField1Bit SP, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField2Byte PARAMETER_POINTER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* !TARGET_OS_IPHONE */ + + virtual bool MODE_SELECT_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PF, + SCSICmdField1Bit SP, + SCSICmdField1Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool MODE_SELECT_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PF, + SCSICmdField1Bit SP, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool MODE_SENSE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DBD, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool MODE_SENSE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit LLBAA, + SCSICmdField1Bit DBD, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + +#if !TARGET_OS_IPHONE + + virtual bool PERSISTENT_RESERVE_IN ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool PERSISTENT_RESERVE_OUT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField4Bit SCOPE, + SCSICmdField4Bit TYPE, + SCSICmdField1Byte CONTROL ); + +#endif /* !TARGET_OS_IPHONE */ + + virtual bool PREVENT_ALLOW_MEDIUM_REMOVAL ( + SCSITaskIdentifier request, + SCSICmdField2Bit PREVENT, + SCSICmdField1Byte CONTROL ); + +#if !TARGET_OS_IPHONE + + virtual bool READ_BUFFER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Bit MODE, + SCSICmdField1Byte BUFFER_ID, + SCSICmdField3Byte BUFFER_OFFSET, + SCSICmdField3Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool RECEIVE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool RECEIVE_DIAGNOSTICS_RESULTS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PCV, + SCSICmdField1Byte PAGE_CODE, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool RELEASE_6 ( + SCSITaskIdentifier request, + SCSICmdField1Byte CONTROL ); + + virtual bool RELEASE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit THRDPTY, + SCSICmdField1Bit LONGID, + SCSICmdField1Byte THIRD_PARTY_DEVICE_ID, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* !TARGET_OS_IPHONE */ + + virtual bool REPORT_DEVICE_IDENTIFIER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + + + virtual bool REPORT_LUNS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool REQUEST_SENSE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + +#if !TARGET_OS_IPHONE + + virtual bool RESERVE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte CONTROL ); + + virtual bool RESERVE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit THRDPTY, + SCSICmdField1Bit LONGID, + SCSICmdField1Byte THIRD_PARTY_DEVICE_ID, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool SEND ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit AER, + SCSICmdField3Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool SEND_DIAGNOSTICS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit SELF_TEST_CODE, + SCSICmdField1Bit PF, + SCSICmdField1Bit SELF_TEST, + SCSICmdField1Bit DEVOFFL, + SCSICmdField1Bit UNITOFFL, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool SET_DEVICE_IDENTIFIER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField4Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* !TARGET_OS_IPHONE */ + + virtual bool TEST_UNIT_READY ( + SCSITaskIdentifier request, + SCSICmdField1Byte CONTROL ); + +#if !TARGET_OS_IPHONE + + virtual bool WRITE_BUFFER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Bit MODE, + SCSICmdField1Byte BUFFER_ID, + SCSICmdField3Byte BUFFER_OFFSET, + SCSICmdField3Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* !TARGET_OS_IPHONE */ + + // The SPC-3 INQUIRY command as defined in section 6.4.1 of SPC-3. + bool INQUIRY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit EVPD, + SCSICmdField1Byte PAGE_CODE, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + OSMetaClassDeclareReservedUsed ( IOSCSIPrimaryCommandsDevice, 1 ); + + // ClampPowerState() will check if it is currently running behind the + // workloop lock, if not, it will call itself again to run behind the + // workloop gate. When subclassing ClampPowerState() make sure to take + // workloop synchronization in consideration. + + virtual void ClampPowerState ( void ); + + OSMetaClassDeclareReservedUsed ( IOSCSIPrimaryCommandsDevice, 2 ); + + virtual void ReleasePowerStateClamp ( void ); + + +private: + + +#if !TARGET_OS_IPHONE + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 16 ); +#endif /* !TARGET_OS_IPHONE */ + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOSCSIProtocolInterface.h b/QualcommWireless/include/IOKit/scsi/IOSCSIProtocolInterface.h new file mode 100644 index 0000000..c6a7393 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOSCSIProtocolInterface.h @@ -0,0 +1,922 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PROTOCOL_INTERFACE_H_ +#define _IOKIT_IO_SCSI_PROTOCOL_INTERFACE_H_ + + +/*! @header SCSI Protocol Interface + @discussion + This file contains definitions for the IOSCSIProtocolInterface class, + SCSI Protocol Features used by this interface, and additional constants + used by this interface. +*/ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +#include +#include + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +/* +SCSI Device Characteristics - Defined between SCSI Application Layer and + SCSI Protocol Layer only. +*/ + +/*! +@constant kIOPropertySCSIDeviceCharacteristicsKey +@discussion +This key is used to define SCSI Device Characteristics for a particular device. +It is the key for the dictionary containing the keys of characteristics. These keys +are only defined between the SCSI Protocol Layer and the SCSI Applicaiton Layer. Some +properties may be copied from this dictionary to the more generic Device Characteristics +or Protocol Characteristics dictionaries. +*/ +#define kIOPropertySCSIDeviceCharacteristicsKey "SCSI Device Characteristics" + +/*! +@constant kIOPropertySCSIInquiryLengthKey +@discussion +This key is used to define a default INQUIRY length to issue to the device. The +value is a UInt32 corresponding to the number of bytes to request in the INQUIRY +command. +*/ +#define kIOPropertySCSIInquiryLengthKey "Inquiry Length" + +/*! +@constant kIOPropertySCSIManualEjectKey +@discussion +This key is used to indicate that the device is known to be a manual ejectable media +device. This property overrides all of the driver checks for determining this capability. +This property is a string, although if it exists it should always be true. +*/ +#define kIOPropertySCSIManualEjectKey "Manual Eject" + +/*! +@constant kIOPropertyReadTimeOutDurationKey +@discussion +This key is used to define the Read Time Out for a particular device. +This property overrides all of the protocol defaults. +This property is a value, in milliseconds. +*/ +#define kIOPropertyReadTimeOutDurationKey "Read Time Out Duration" + +/*! +@constant kIOPropertyWriteTimeOutDurationKey +@discussion +This key is used to define the Write Time Out for a particular device. +This property overrides all of the protocol defaults. +This property is a value, in milliseconds. +*/ +#define kIOPropertyWriteTimeOutDurationKey "Write Time Out Duration" + +/*! +@constant kIOPropertyRetryCountKey +@discussion +This key is used to define the number of Read/Write retries for a particular device. +This property overrides all of the protocol defaults. +The value is a UInt32 corresponding to the number of retries. +*/ +#define kIOPropertyRetryCountKey "Retry Count" + +/*! + @constant kIOPropertyAutonomousSpinDownKey + @discussion + This key is used to indicate that the device is known to have its own internal logic + for idle disk spin down. This key is used to mark device which respond poorly to our + efforts to manually spin down or spin up the device when it is already in the desired + state. + */ +#define kIOPropertyAutonomousSpinDownKey "Autonomous Spin Down" + +/*! + @constant kIOPropertyDoNotPreventMediumRemovalKey + @discussion + This key is used to indicate that the device either does not require or respond + well to PREVENT_ALLOW_MEDIUM_REMOVAL. This property indicates that the + PREVENT_ALLOW_MEDIUM_REMOVAL should not be used with the specified device. + */ +#define kIOPropertyDoNotPreventMediumRemovalKey "Do Not Prevent Medium Removal" + +/*! + @constant kIOPropertyEjectRequireStartStopUnitKey + @discussion + This key is used to indicate that while the device may have failed PREVENT_ALLOW_MEDIUM + REMOVAL it still requires a START_STOP_UNIT to eject/unload media. + */ +#define kIOPropertyEjectRequireStartStopUnitKey "Eject Requires START_STOP_UNIT" + +/*! + @constant kIOPropertyRequiresRestartEjectKey + @discussion + This key is used to indicate that the device requires a START_STOP_UNIT to eject + the device's media prior to restarting to ensuring proper function at next boot cycle. + */ +#define kIOPropertyRequiresRestartEjectKey "Require Restart Eject" + +/*! + @constant kIOPropertyNoSenseDebounceRetries + @discussion + This key is used to indicate how many retries a device may require when it reports + NO_SENSE/NO_ADITIONAL_SENSE_INFORMATION as a response to a REQUEST_SENSE. + */ +#define kIOPropertyNoSenseDebounceRetries "NO_SENSE Debounce Retries" + +#if defined(KERNEL) && defined(__cplusplus) + + +/*! +@constant kCFBundleIdentifierKey +@discussion +Property key for CFBundleIdentifier. +*/ +#define kCFBundleIdentifierKey "CFBundleIdentifier" + +/*! +@constant kIOSCSIArchitectureBundleIdentifierKey +@discussion +IOSCSIArchitectureModelFamily's CFBundle identifier. +*/ +#define kIOSCSIArchitectureBundleIdentifierKey "com.apple.iokit.IOSCSIArchitectureModelFamily" + + +// General kernel headers +#include + +// General IOKit headers +#include +#include +#include +#include + +// SCSI Architecture Model Family includes +#include + + +/*! +@enum SCSI Protocol Interface Device Notification values +@discussion +Message values for SCSI Protocol Interface Device Notifications. +@constant kSCSIProtocolNotification_DeviceRemoved +Private message sent between a SCSI protocol service provider and +SCSI application layer driver to indicate device removal. +@constant kSCSIProtocolNotification_VerifyDeviceState +Private message sent between a SCSI protocol service provider and +SCSI application layer driver to indicate device state may have +changed and the device state should be re-verified by the SCSI +Application Layer driver. An example would be a bus reset which clears +the tray locking state of an ATAPI device. +@constant kSCSIServicesNotification_ExclusivityChanged +Message sent when a change in exclusivity state occurs. Usually in +response to acquiring/releasing exclusive access to a device via a user client. +@constant kSCSIProtocolNotification_ForcePowerDown +Message sent between a SCSI protocol service provider and +SCSI application layer driver to initiate transition to the lowest power state. +@constant kSCSIProtocolNotification_ForcePowerUp +Message sent between a SCSI protocol service provider and +SCSI application layer driver to initiate transition to the highest power state. +*/ +enum +{ + kSCSIProtocolNotification_DeviceRemoved = 0x69000010, + kSCSIProtocolNotification_VerifyDeviceState = 0x69000020, + kSCSIServicesNotification_ExclusivityChanged = 0x69000030, + kSCSIProtocolNotification_ForcePowerDown = 0x69000040, + kSCSIProtocolNotification_ForcePowerUp = 0x69000050 +}; + + +/*! +@typedef SCSIProtocolFeature +@discussion +Typedef for SCSIProtocolFeature, a 32-bit quantity. +*/ +typedef UInt32 SCSIProtocolFeature; + +/*! +@enum SCSI Protocol Features +@discussion +The list of SCSI Protocol Features currently supported. +*/ +enum +{ + + /*! + @constant kSCSIProtocolFeature_ACA Not yet used. + */ + kSCSIProtocolFeature_ACA = 1, + + /*! + @constant kSCSIProtocolFeature_CPUInDiskMode Used to determine + if the SCSI Protocol Services Driver supports a CPU which is in + target disk mode. + */ + kSCSIProtocolFeature_CPUInDiskMode = 2, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificPolling Used + to determine if the SCSI Protocol Services Driver supports + protocol specific polling for media. This is used for low-power + polling specifically for ATAPI devices on ATA buses + */ + kSCSIProtocolFeature_ProtocolSpecificPolling = 3, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificSleepCommand Used + to determine if the SCSI Protocol Services Driver supports + protocol specific sleep commands to a drive. This is used for + sleeping drives specifically ATAPI devices on ATA buses. + */ + kSCSIProtocolFeature_ProtocolSpecificSleepCommand = 4, + + /*! + @constant kSCSIProtocolFeature_GetMaximumLogicalUnitNumber If + the SCSI Protocol Services Driver supports logical units, it will + report the maximum addressable ID that it supports in the UInt32 pointer + that is passed in as the serviceValue. If only one unit is supported, + the driver should return false for this query. + */ + kSCSIProtocolFeature_GetMaximumLogicalUnitNumber = 5, + + /*! + @constant kSCSIProtocolFeature_MaximumReadBlockTransferCount If + the SCSI Protocol Services Driver has a maximum number of + blocks that can be transfered in a read request, it will return + true to this query and return the block count in the UInt32 pointer + that is passed in as the serviceValue. + */ + kSCSIProtocolFeature_MaximumReadBlockTransferCount = 6, + + /*! + @constant kSCSIProtocolFeature_MaximumWriteBlockTransferCount If + the SCSI Protocol Services Driver has a maximum number of + blocks that can be transferred in a write request, it will return + true to this query and return the block count in the UInt32 pointer + that is passed in as the serviceValue. + */ + kSCSIProtocolFeature_MaximumWriteBlockTransferCount = 7, + + /*! + @constant kSCSIProtocolFeature_MaximumReadTransferByteCount If + the SCSI Protocol Services Driver has a maximum byte count + that can be transferred in a read request, it will return + true to this query and return the byte count in the UInt64 pointer + that is passed in as the serviceValue. + */ + kSCSIProtocolFeature_MaximumReadTransferByteCount = 8, + + /*! + @constant kSCSIProtocolFeature_MaximumWriteTransferByteCount If + the SCSI Protocol Services Driver has a maximum byte count + that can be transferred in a write request, it will return + true to this query and return the byte count in the UInt64 pointer + that is passed in as the serviceValue. + */ + kSCSIProtocolFeature_MaximumWriteTransferByteCount = 9, + + /*! + @constant kSCSIProtocolFeature_SubmitDefaultInquiryData If + the SCSI Protocol Services Driver needs any extra information to + make any negotiation settings from the standard INQUIRY data, this + will be called to set that appropriately. The serviceValue will + point to a SCSICmd_INQUIRY_StandardData buffer. The size + of the buffer depends on the SCSI Device Characteristics + dictionary for the device or bus. If there is no + kIOPropertySCSIInquiryLengthKey value set in the dictionary + or if it doesn't exist, then the size of the data will be + the size of the full amount of Inquiry retrieved from the device. + */ + kSCSIProtocolFeature_SubmitDefaultInquiryData = 10, + + /*! + @constant kSCSIProtocolFeature_ProtocolAlwaysReportsAutosenseData If + the SCSI Protocol Services Driver always reports available + autosense data when a kSCSITaskStatus_CHECK_CONDITION is set, + then the protocol layer should return true. E.g. FireWire + transport drivers should respond true to this. + */ + kSCSIProtocolFeature_ProtocolAlwaysReportsAutosenseData = 11, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificPowerOff If + the SCSI Protocol Services Driver supports removing the power + to the drive, then the protocol layer should return true. This is + used for aggressive power management, specifically for ATAPI + devices on ATA buses. + */ + kSCSIProtocolFeature_ProtocolSpecificPowerOff = 12, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificPowerControl + Used to determine if the SCSI Protocol Services Driver supports + switching the power to the drive on and off. This is used for aggressive + power management, specifically for SATAPI devices on AHCI buses. + */ + kSCSIProtocolFeature_ProtocolSpecificPowerControl = 13, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificAsyncNotification + Used to determine if the SCSI Protocol Services Driver supports + asynchronous notifications from the drive. This is used to prevent + polling for media, specifically for SATAPI devices on AHCI buses. + */ + kSCSIProtocolFeature_ProtocolSpecificAsyncNotification = 14, + + /*! + kSCSIProtocolFeature_HierarchicalLogicalUnits: + If the SCSI Protocol Services layer supports hierarchical + logical units, then the protocol services layer should report true + and use IOSCSIProtocolServices::GetLogicalUnitBytes() to retrieve + the full 8 bytes of LUN information. + */ + kSCSIProtocolFeature_HierarchicalLogicalUnits = 15, + + /*! + kSCSIProtocolFeature_MultiPathing: + If the SCSI Protocol Services layer supports multi-pathing, + then the protocol services layer should report true. + This is used to support multiple paths to a logical unit + by creating a IOSCSIMultipathedLogicalUnit object. + */ + kSCSIProtocolFeature_MultiPathing = 16, + + /*! + kSCSIProtocolFeature_ProtocolSpecificLinkRetrain: + If the SCSI Protocol Services layer supports link retrain, then the protocol + services layer should report true. + */ + kSCSIProtocolFeature_ProtocolSpecificLinkRetrain = 17 + +}; + + +/*! +@typedef SCSIProtocolPowerState +@discussion +Typedef for SCSIProtocolPowerState, a 32-bit quantity. +*/ +typedef UInt32 SCSIProtocolPowerState; + +/*! +@enum SCSI Protocol Power States +@discussion +The list of SCSI Protocol Power States. +*/ +enum +{ + /*! + @constant kSCSIProtocolPowerStateOff + Off power state. + */ + kSCSIProtocolPowerStateOff = 0, + + /*! + @constant kSCSIProtocolPowerStateOn + On power state. + */ + kSCSIProtocolPowerStateOn = 1 +}; + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +/*! +@class IOSCSIProtocolInterface +@superclass IOService +@discussion +This class defines the public SCSI Protocol Layer API for any class that +provides Protocol services or needs to provide the Protocol Service API +for passing service requests to a Protocol Service driver. +*/ +class IOSCSIProtocolInterface : public IOService +{ + + OSDeclareAbstractStructors ( IOSCSIProtocolInterface ) + +public: + + /*! @function init + @abstract Initializes generic IOService data structures (expansion data, etc). + */ + virtual bool init( OSDictionary * dictionary = 0 ) APPLE_KEXT_OVERRIDE; + + /*! + @function start + @abstract During an IOService object's instantiation, starts the IOService object that has been selected to run on the provider. + @discussion See IOService.h for details. + @result true if the start was successful; false otherwise (which will cause the instance to be detached and usually freed). + */ + virtual bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + + /*! + @function free + @abstract Called to release all resources held by the object. + @discussion Release all resources held by the object, then call super::free(). + */ + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function willTerminate + @abstract Passes a termination up the stack. + @discussion Notification that a provider has been terminated, sent before recursing up the stack, in root-to-leaf order. + @param provider The terminated provider of this object. + @param options Options originally passed to terminate(). + @result true. + */ + virtual bool willTerminate ( IOService * provider, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + /*! + @function GetUserClientExclusivityState + @abstract Gets the current exclusivity state of the user client. + @discussion The GetUserClientExclusivityState() method is called by the SCSITaskUserClient + to determine if any user client is holding exclusive access at the current time. This is simply + a preflight check and a return value of false does not guarantee that a subsequent + call to SetUserClientExclusivityState() will return successfully. + @result true if a user client is in exclusive control of the device, false otherwise. + */ + virtual bool GetUserClientExclusivityState ( void ); + + /*! + @function SetUserClientExclusivityState + @abstract Sets the current exclusivity state of the user client. + @discussion The SetUserClientExclusivityState() method is called by the SCSITaskUserClient + to set the exclusive access mode. + @param userClient The instance of SCSITaskUserClient for which to change exclusivity state. + @param state Exclusivity state. true means exclusive access is desired, false + means exclusive access is being released. + @result A valid IOReturn code indicating success or the type of failure. + */ + virtual IOReturn SetUserClientExclusivityState ( IOService * userClient, bool state ); + + + /*! + @function initialPowerStateForDomainState + @abstract Determines which power state a device is in, given the current power domain state. + @discussion Power management calls this method once, when the driver is initializing power management. + Subclasses should not need to override this method. + @param flags Flags that describe the character of "domain power"; they represent the outputPowerCharacter field of a state in the power domain's power state array. + @result A state number. + */ + virtual unsigned long initialPowerStateForDomainState ( IOPMPowerFlags flags ) APPLE_KEXT_OVERRIDE; + + /*! + @function setPowerState + @abstract Requests a power managed driver to change the power state of its device. + @discussion Requests a power managed driver to change the power state of its device. Most subclasses + of IOSCSIProtocolInterface have class-specific mechanisms and should not override this routine. + See IOSCSIProtocolServices.h, IOSCSIBlockCommandsDevice.h, IOSCSIReducedBlockCommandsDevice.h, and + IOSCSIMultimediaCommandsDevice.h for more information about power management changes. + Subclasses should not need to override this method. + @param powerStateOrdinal The number in the power state array to which the drive is being instructed to change. + @param whichDevice A pointer to the power management object which registered to manage power for this device. + The whichDevice field is not pertinent to us since the driver is both the "policy maker" for the device, + and the "policy implementor" for the device. + @result See IOService.h for details. + */ + virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService * whichDevice ) APPLE_KEXT_OVERRIDE; + + /*! + @function IsPowerManagementIntialized + @abstract Called to determine if power management is initialized. + @discussion Called to determine if power management is initialized. + Subclasses should not need to override this method. + @result true if power management has been initialized, false otherwise. + */ + virtual bool IsPowerManagementIntialized ( void ); + + /*! + @function CheckPowerState + @abstract Called by clients to ensure device is in correct power state before issuing I/O. + @discussion Called by clients to ensure device is in correct power state before issuing I/O. + If the device is not ready to handle such requests, it gives the driver a chance to block the + thread until the device is ready. Subclasses should not need to override this method. + */ + virtual void CheckPowerState ( void ); + + /*! + @function ExecuteCommand + @abstract Called to send a SCSITask and transport it across the physical wire(s) to the device. + @discussion Called to send a SCSITask and transport it across the physical wire(s) to the device. + Subclasses internal to IOSCSIArchitectureModelFamily will need to override this method. Third + party subclasses should not need to override this method. + @param request A valid SCSITaskIdentifier representing the task to transport across the wire(s). + */ + virtual void ExecuteCommand ( SCSITaskIdentifier request ) = 0; + + /*! + @function AbortCommand + @abstract Obsolete. Do not use this method. + @discussion Obsolete. Do not use this method. + */ + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier request ) = 0; + + /*! + @function IsProtocolServiceSupported + @abstract This method is called to query for support of a protocol specific service feature. + @discussion This method is called to query for support of a protocol specific service feature. + Subclasses of IOSCSIProtocolServices should override this method. + @param feature A valid SCSIProtocolFeature. See enums for SCSIProtocolFeature. + @param serviceValue A pointer to a structure/value that is used in conjunction with the feature + requested. See enums for SCSIProtocolFeature. NB: This parameter may be NULL for certain + feature requests. + @result true if the feature is supported, false otherwise. + */ + virtual bool IsProtocolServiceSupported ( + SCSIProtocolFeature feature, + void * serviceValue ) = 0; + + /*! + @function HandleProtocolServiceFeature + @abstract This method is called to enact support of a protocol specific service feature. + @discussion This method is called to enact support of a protocol specific service feature. + Subclasses of IOSCSIProtocolServices should override this method. + @param feature A valid SCSIProtocolFeature. See enums for SCSIProtocolFeature. + @param serviceValue A pointer to a structure/value that is used in conjunction with the feature + requested. See enums for SCSIProtocolFeature. NB: This parameter may be NULL for certain + feature requests. + @result true if the service feature request succeeded, false otherwise. + */ + virtual bool HandleProtocolServiceFeature ( + SCSIProtocolFeature feature, + void * serviceValue ) = 0; + +protected: + + // Reserve space for future expansion. + struct IOSCSIProtocolInterfaceExpansionData + { + IOWorkLoop * fWorkLoop; + }; + IOSCSIProtocolInterfaceExpansionData * fIOSCSIProtocolInterfaceReserved; + + // ------ Power Management Support ------ + + thread_call_t fPowerManagementThread; + IOCommandGate * fCommandGate; + UInt32 fCurrentPowerState; + UInt32 fProposedPowerState; + bool fPowerTransitionInProgress; + bool fPowerAckInProgress; + bool fPowerManagementInitialized; + + /*! + @function GetCommandGate + @abstract Accessor method to obtain the IOCommandGate. + @discussion Accessor method to obtain the IOCommandGate. + @result The IOCommandGate for this instance. May return NULL. + */ + IOCommandGate * GetCommandGate ( void ); + + /*! + @function InitializePowerManagement + @abstract This method is called to initialize power management. + @discussion This method is called to initialize power management. It will call PMinit(), joinPMTree(), + and makeUsable(). This method does not call registerPowerDriver(). + Subclasses may override this method to change the behavior (such as the number of power states). + @param provider The power management provider (i.e. the provider to attach to in the PowerManagement + tree). This may be a device that is not in the PM Tree itself, in which case, the IOService plane + is traversed towards the root node in an effort to find a node in the PM Tree. + */ + virtual void InitializePowerManagement ( IOService * provider ); + + /*! + @function GetInitialPowerState + @abstract This method is called to obtain the initial power state of the device (usually the highest). + @discussion This method is called to obtain the initial power state of the device (usually the highest). + Subclasses must override this method. + @result A power state ordinal. + */ + virtual UInt32 GetInitialPowerState ( void ) = 0; + + /*! + @function finalize + @abstract Finalizes the destruction of an IOService object. + @discussion See IOService.h + Subclasses may override this method, but should call super::finalize(). + @result true. + */ + virtual bool finalize ( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + /*! + @function sHandleSetPowerState + @abstract The sHandleSetPowerState method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sHandleSetPowerState method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + @param powerStateOrdinal The power state to which device shall be changed. + @result A valid IOReturn code indicating success or failure. + */ + static IOReturn sHandleSetPowerState ( IOSCSIProtocolInterface * self, UInt32 powerStateOrdinal ); + + /*! + @function sGetPowerTransistionInProgress + @abstract The sGetPowerTransistionInProgress method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sGetPowerTransistionInProgress method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + @result true if a power state is in progress, otherwise false. + */ + static bool sGetPowerTransistionInProgress ( IOSCSIProtocolInterface * self ); + + /*! + @function HandleSetPowerState + @abstract The HandleSetPowerState method is called by the glue code and is on the + serialized side of the command gate. + @discussion The HandleSetPowerState method is called by the glue code and is on the + serialized side of the command gate. This allows us to touch any member + variables as necessary without any multi-threading issues. + Subclasses may override this method to change behavior. Third party subclasses + should not need to override this method, but may. + @param powerStateOrdinal The power state to which device shall be changed. + */ + virtual void HandleSetPowerState ( UInt32 powerStateOrdinal ); + + /*! + @function sPowerManagement + @abstract The sPowerManagement method is a static C-function which is called using + mach's thread_call API. It guarantees us a thread of execution which is + different than the power management thread and the workloop thread on which + we can issue commands to the device synchronously or asynchronously without + worrying about deadlocks. It calls through to HandlePowerChange, which is + a state machine used to direct power management. + @discussion The sPowerManagement method is a static C-function which is called using + mach's thread_call API. It guarantees us a thread of execution which is + different than the power management thread and the workloop thread on which + we can issue commands to the device synchronously or asynchronously without + worrying about deadlocks. It calls through to HandlePowerChange, which is + a state machine used to direct power management. + @param whichDevice The 'this' pointer. + */ + static void sPowerManagement ( thread_call_param_t whichDevice ); + + /*! + @function HandlePowerChange + @abstract The HandlePowerChange method is pure virtual and is left to each protocol or + application layer driver to implement. It is guaranteed to be called on its + own thread of execution and can make synchronous or asynchronous calls. + @discussion The HandlePowerChange method is pure virtual and is left to each protocol or + application layer driver to implement. It is guaranteed to be called on its + own thread of execution and can make synchronous or asynchronous calls. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. + */ + virtual void HandlePowerChange ( void ) = 0; + + /*! + @function sHandleCheckPowerState + @abstract The sHandleCheckPowerState method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sHandleCheckPowerState method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + */ + static void sHandleCheckPowerState ( IOSCSIProtocolInterface * self ); + + /*! + @function HandleCheckPowerState(void) + @abstract The HandleCheckPowerState (void) method is on the serialized side of the command + gate and can change member variables safely without multi-threading issues. + It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + with the max power state the class registered with. + @discussion The HandleCheckPowerState (void) method is on the serialized side of the command + gate and can change member variables safely without multi-threading issues. + It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + with the max power state the class registered with. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. + */ + virtual void HandleCheckPowerState ( void ) = 0; + + /*! + @function HandleCheckPowerState(UInt32 maxPowerState) + @abstract The HandleCheckPowerState(UInt32 maxPowerState) method is called by + the subclasses and is passed the maxPowerState number given to the power + manager at initialization time. This guarantees the threads block until that + power state has been achieved. + @discussion The HandleCheckPowerState(UInt32 maxPowerState) method is called by + the subclasses and is passed the maxPowerState number given to the power + manager at initialization time. This guarantees the threads block until that + power state has been achieved. + @param maxPowerState The maximum power state in the power state array. + */ + void HandleCheckPowerState ( UInt32 maxPowerState ); + + /*! + @function TicklePowerManager(void) + @abstract The TicklePowerManager(void) method is called by CheckPowerState and + sends an activity tickle to the power manager so that the idle timer is + reset. + @discussion The TicklePowerManager(void) method is called by CheckPowerState and + sends an activity tickle to the power manager so that the idle timer is + reset. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. + */ + virtual void TicklePowerManager ( void ) = 0; + + /*! + @function TicklePowerManager(UInt32 maxPowerState) + @abstract The TicklePowerManager(UInt32 maxPowerState) method is a convenience + function which can be called by subclasses in TicklePowerManager (void) + in order to tell the power manager to reset idle timer or bring the device + into the requested state. It returns whatever is returned by activityTickle + (true if device is in the requested state, false if it is not). + @discussion The TicklePowerManager(UInt32 maxPowerState) method is a convenience + function which can be called by subclasses in TicklePowerManager(void) + in order to tell the power manager to reset idle timer or bring the device + into the requested state. It returns whatever is returned by activityTickle + (true if device is in the requested state, false if it is not). + @param maxPowerState The maximum power state in the power state array. + @result The result of the call to activityTickle(). See IOService.h for details. + */ + bool TicklePowerManager ( UInt32 maxPowerState ); + + // ------ User Client Support ------ + + bool fUserClientExclusiveControlled; + IOService * fUserClient; + + /*! + @function sGetUserClientExclusivityState + @abstract The sGetUserClientExclusivityState method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sGetUserClientExclusivityState method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + @param state A pointer to a bool in which the state should be set. + */ + static void sGetUserClientExclusivityState ( IOSCSIProtocolInterface * self, bool * state ); + + /*! + @function sSetUserClientExclusivityState + @abstract The sSetUserClientExclusivityState method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sSetUserClientExclusivityState method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + @param result A pointer to an IOReturn for the resulting status. + @param userClient The instance of SCSITaskUserClient for which to change exclusivity state. + @param state A bool indicating the desired state to set. + */ + static void sSetUserClientExclusivityState ( IOSCSIProtocolInterface * self, IOReturn * result, IOService * userClient, bool state ); + + /*! + @function HandleGetUserClientExclusivityState + @abstract Gets the current exclusivity state of the user client. + @discussion The HandleGetUserClientExclusivityState() method is called on the serialized side + of the command gate to determine if any user client is holding exclusive access at the current + time. See discussion for GetUserClientExclusivityState(). + Subclasses may override this method to alter default behavior. Third party subclasses should + not need to override this method. + @result true if a user client is in exclusive control of the device, false otherwise. + */ + virtual bool HandleGetUserClientExclusivityState ( void ); + + /*! + @function HandleSetUserClientExclusivityState + @abstract Sets the current exclusivity state of the user client. + @discussion The HandleSetUserClientExclusivityState() method is called on the serialized side + of the command gate to set the exclusive access mode. + @param userClient The instance of SCSITaskUserClient for which to change exclusivity state. + @param state Exclusivity state. true means exclusive access is desired, false + means exclusive access is being released. + @result A valid IOReturn code indicating success or the type of failure. + */ + virtual IOReturn HandleSetUserClientExclusivityState ( IOService * userClient, bool state ); + +public: + + // ------- SCSI Architecture Model Task Management Functions ------ + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 1 ); + /*! + @function AbortTask + @abstract Aborts a task based on the Logical Unit and tagged task identifier. + @discussion Aborts a task based on the Logical Unit and tagged task identifier. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @param theTag A valid SCSITaggedTaskIdentifier representing an outstanding SCSITask. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 2 ); + /*! + @function AbortTaskSet + @abstract Aborts a task set based on the Logical Unit. + @discussion Aborts a task set based on the Logical Unit. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse AbortTaskSet ( UInt8 theLogicalUnit ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 3 ); + /*! + @function ClearACA + @abstract Clears an Auto-Contingent Allegiance (ACA) for the specified Logical Unit. + @discussion Clears an Auto-Contingent Allegiance (ACA) for the specified Logical Unit. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse ClearACA ( UInt8 theLogicalUnit ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 4 ); + /*! + @function ClearTaskSet + @abstract Clears a task set for the specified Logical Unit. + @discussion Clears a task set for the specified Logical Unit. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse ClearTaskSet ( UInt8 theLogicalUnit ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 5 ); + /*! + @function LogicalUnitReset + @abstract Resets the specified Logical Unit. + @discussion Resets the specified Logical Unit. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse LogicalUnitReset ( UInt8 theLogicalUnit ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 6 ); + + /*! + @function TargetReset + @abstract Resets the target device. + @discussion Resets the target device. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse TargetReset ( void ) = 0; + +private: + + // Method to show that the disk spinning up in spindump stacks + void __DISK_IS_ASLEEP__ ( void ) __attribute__((noinline)); + +#if !TARGET_OS_IPHONE + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 16 ); +#endif /* !TARGET_OS_IPHONE */ + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PROTOCOL_INTERFACE_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOSCSIProtocolServices.h b/QualcommWireless/include/IOKit/scsi/IOSCSIProtocolServices.h new file mode 100644 index 0000000..2c7a52e --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOSCSIProtocolServices.h @@ -0,0 +1,784 @@ +/* + * Copyright (c) 1998-2011 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_PROTOCOL_SERVICES_H_ +#define _IOKIT_IO_SCSI_PROTOCOL_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// Mach includes +#include + +// General IOKit headers +#include +#include + +// SCSI Architecture Model Family includes +#include +#include +#include + +// Build includes +#include + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// Power Management values +enum +{ + kSCSIProtocolLayerPowerStateOff = 0, + kSCSIProtocolLayerPowerStateOn = 1, + kSCSIProtocolLayerNumDefaultStates = 2 +}; + +// Forward definitions of internal use only classes +class SCSITask; + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +/*! + @class IOSCSIProtocolServices + @superclass IOSCSIProtocolInterface + @discussion + This class defines the public SCSI Protocol Services Layer API for any class + that implements SCSI protocol services. A protocol services layer driver is + responsible for taking incoming SCSITaskIdentifier objects and translating + them to the native command type for the native protocol interface + (e.g. SBP-2 ORB on FireWire). + */ +class IOSCSIProtocolServices : public IOSCSIProtocolInterface +{ + + OSDeclareAbstractStructors ( IOSCSIProtocolServices ) + +private: + + // The head pointer for the queue of waiting SCSI Tasks. + SCSITask * fSCSITaskQueueHead; /* OBSOLETE */ + + // This is the lock for preventing multiple access while + // manipulating the SCSI Task queue. + IOSimpleLock * fQueueLock; + + // The internal flag to indicate whether service requests should be + // executed or immediately errored, such as when a device is removed. + bool fAllowServiceRequests; + +protected: + + // Reserve space for future expansion. + struct IOSCSIProtocolServicesExpansionData + { + // For internal use only. Do not use. + UInt32 fSemaphore; + bool fRequiresAutosenseDescriptor; + SCSITaskCompletion fCompletionRoutine; + queue_head_t fTaskQueueHead; + queue_head_t fAutoSenseQueueHead; + }; + IOSCSIProtocolServicesExpansionData * fIOSCSIProtocolServicesReserved; + + /*! + @function SendSCSICommand + @abstract Pure virtual method subclasses must implement in order to send SCSITasks on the wire. + @discussion Send a SCSI Command to the device. If the command was sent to the + device and is pending completion, the subclass should return true and + return back the kSCSIServiceResponse_Request_In_Process response. + If the command completes immediately with an error, the subclass will + return true and return back the appropriate status. + If the subclass is currently processing all the commands it can, the + subclass will return false and the command will be resent next time + CommandCompleted is called. + @param request A valid SCSITaskIdentifier representing the command to send on the wire. + @param serviceResponse Pointer to a SCSIServiceResponse value returned to the caller. + @param taskStatus Pointer to a SCSITaskStatus value returned to the caller. + @result False if no more commands can be processed at this time, otherwise true. + */ + virtual bool SendSCSICommand ( SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ) = 0; + + /*! + @function AbortSCSICommand + @abstract Pure virtual method subclasses must implement so that SCSITasks may be aborted. + @discussion Provides the capability for a caller to request that a particular SCSITask + be aborted. + @param request A valid SCSITaskIdentifier representing the command to be aborted. + @result A valid SCSIServiceResponse. + */ + virtual SCSIServiceResponse AbortSCSICommand ( SCSITaskIdentifier request ) = 0; + + /*! + @function CommandCompleted + @abstract Method subclass calls to complete a SCSITask. + @discussion Subclasses will call this inherited method when the command + executed by SendSCSICommand has completed. + @param request A valid SCSITaskIdentifier indicating the request to complete. + @param serviceResponse A valid SCSIServiceResponse value. + @param taskStatus A valid SCSITaskStatus value. + */ + void CommandCompleted ( SCSITaskIdentifier request, + SCSIServiceResponse serviceResponse, + SCSITaskStatus taskStatus ); + + /*! + @function GetTaskAttribute + @abstract Accessor method to retrieve the SCSITaskAttribute associated with the specified request. + @discussion Accessor method to retrieve the SCSITaskAttribute associated with the specified request. + @param request A valid SCSITaskIdentifier. + @result A valid SCSITaskAttribute value. + */ + SCSITaskAttribute GetTaskAttribute ( SCSITaskIdentifier request ); + + /*! + @function SetTaskState + @abstract Accessor method to set the SCSITaskState associated with the specified request. + @discussion Accessor method to set the SCSITaskState associated with the specified request. + @param request A valid SCSITaskIdentifier. + @param newTaskState A valid SCSITaskState value. + @result True on success, otherwise false. + */ + bool SetTaskState ( SCSITaskIdentifier request, + SCSITaskState newTaskState ); + /*! + @function GetTaskState + @abstract Accessor method to retrieve the SCSITaskState associated with the specified request. + @discussion Accessor method to retrieve the SCSITaskState associated with the specified request. + @param request A valid SCSITaskIdentifier. + @result A valid SCSITaskState value. + */ + SCSITaskState GetTaskState ( SCSITaskIdentifier request ); + + /*! + @function GetLogicalUnitNumber + @abstract Accessor method to retrieve the logical unit number associated with the specified request. + @discussion Accessor method to retrieve the logical unit number associated with the specified request. + NOTE: This method is deprecated in favor of GetLogicalUnitBytes(). + @param request A valid SCSITaskIdentifier. + @result A valid single-byte LUN value. + */ + UInt8 GetLogicalUnitNumber ( SCSITaskIdentifier request ); + + /*! + @function GetLogicalUnitBytes + @abstract Accessor method to retrieve the logical unit bytes associated with the specified request. + @discussion Accessor method to retrieve the logical unit bytes associated with the specified request. + @param request A valid SCSITaskIdentifier. + @param lunBytes A pointer to SCSILogicalUnitBytes to be filled in by this method. + */ + void GetLogicalUnitBytes ( SCSITaskIdentifier request, SCSILogicalUnitBytes * lunBytes ); + + /*! + @function GetCommandDescriptorBlockSize + @abstract Accessor method to retrieve the Command Descriptor Block size associated with the specified request. + @discussion Accessor method to retrieve the Command Descriptor Block size associated with the specified request. + @param request A valid SCSITaskIdentifier. + @result A valid CDB size (e.g. 6, 10, 12, or 16 bytes). + */ + UInt8 GetCommandDescriptorBlockSize ( SCSITaskIdentifier request ); + + /*! + @function GetCommandDescriptorBlock + @abstract Accessor method to retrieve the Command Descriptor Block associated with the specified request. + @discussion Accessor method to retrieve the Command Descriptor Block associated with the specified request. + @param request A valid SCSITaskIdentifier. + @param cdbData A pointer to SCSICommandDescriptorBlock to be filled in by this method. + NOTE: This routine will always fill in 16 bytes, so if the protocol layer driver supports less than this amount + it will have to create a local SCSICommandDescriptorBlock variable to get the CDB data. + @result True on success, otherwise false. + */ + bool GetCommandDescriptorBlock ( SCSITaskIdentifier request, + SCSICommandDescriptorBlock * cdbData ); + + /*! + @function GetDataTransferDirection + @abstract Accessor method to retrieve the data transfer direction associated with the specified request. + @discussion Accessor method to retrieve the data transfer direction associated with the specified request. + @param request A valid SCSITaskIdentifier. + @result The data transfer direction (e.g. kSCSIDataTransfer_NoDataTransfer). + */ + UInt8 GetDataTransferDirection ( SCSITaskIdentifier request ); + + /*! + @function GetRequestedDataTransferCount + @abstract Accessor method to retrieve the requested data transfer count associated with the specified request. + @discussion Accessor method to retrieve the requested data transfer count associated with the specified request. + @param request A valid SCSITaskIdentifier. + @result The requested data transfer count. + */ + UInt64 GetRequestedDataTransferCount ( SCSITaskIdentifier request ); + + /*! + @function SetRealizedDataTransferCount + @abstract Accessor method to set the realized (actual) data transfer count associated with the specified request. + @discussion Accessor method to set the realized (actual) data transfer count associated with the specified request. + @param request A valid SCSITaskIdentifier. + @param newRealizedDataCount The realized (actual) data count transferred. + @result True on success, otherwise false. + */ + bool SetRealizedDataTransferCount ( SCSITaskIdentifier request, + UInt64 newRealizedDataCount ); + + /*! + @function GetRealizedDataTransferCount + @abstract Accessor method to retrieve the realized data transfer count associated with the specified request. + @discussion Accessor method to retrieve the realized data transfer count associated with the specified request. + @param request A valid SCSITaskIdentifier. + @result The realized data transfer count. + */ + UInt64 GetRealizedDataTransferCount ( SCSITaskIdentifier request ); + + /*! + @function GetDataBuffer + @abstract Accessor method to retrieve the data buffer associated with the specified request. + @discussion Accessor method to retrieve the data buffer associated with the specified request. + @param request A valid SCSITaskIdentifier. + @result An IOMemoryDescriptor associated with the request. May be NULL if data transfer + direction is kSCSIDataTransfer_NoDataTransfer. + */ + IOMemoryDescriptor * GetDataBuffer ( SCSITaskIdentifier request ); + + /*! + @function GetDataBufferOffset + @abstract Accessor method to retrieve the data buffer offset associated with the specified request. + @discussion Accessor method to retrieve the data buffer offset associated with the specified request. + @param request A valid SCSITaskIdentifier. + @result Offset into the data buffer at which to start the transfer of data. + */ + UInt64 GetDataBufferOffset ( SCSITaskIdentifier request ); + + /*! + @function GetTimeoutDuration + @abstract Accessor method to retrieve the timeout duration in milliseconds associated with the specified request. + @discussion Accessor method to retrieve the timeout duration in milliseconds associated with the specified request. + @param request A valid SCSITaskIdentifier. + @result Timeout duration in milliseconds. + */ + UInt32 GetTimeoutDuration ( SCSITaskIdentifier request ); + + /*! + @function GetAutosenseRequestedDataTransferCount + @abstract Accessor method to retrieve the requested data transfer count for autosense data + associated with the specified request. + @discussion Accessor method to retrieve the requested data transfer count for autosense data + associated with the specified request. + @param request A valid SCSITaskIdentifier. + @result The requested autosense data transfer count. + */ + UInt64 GetAutosenseRequestedDataTransferCount ( SCSITaskIdentifier request ); + + /*! + @function SetAutoSenseData + @abstract Accessor method to set the autosense data. NOTE: This method is deprecated. + @discussion Accessor method to set the autosense data. NOTE: This method is deprecated. + @param request A valid SCSITaskIdentifier. + @param senseData A pointer to a SCSI_Sense_Data structure to be copied. Only + sizeof(struct SCSI_Sense_Data) bytes will be copied. + @result True if sense data was successfully copied, otherwise false. + */ + bool SetAutoSenseData ( SCSITaskIdentifier request, + SCSI_Sense_Data * senseData ) __attribute__ ((deprecated)); + + /*! + @function SetAutoSenseData + @abstract Accessor method to set the autosense data. + @discussion Accessor method to set the autosense data. + @param request A valid SCSITaskIdentifier. + @param senseData A pointer to sense data to be copied. + @param senseDataSize Number of bytes to copy. + @result True if sense data was successfully copied, otherwise false. + */ + bool SetAutoSenseData ( SCSITaskIdentifier request, + SCSI_Sense_Data * senseData, + UInt8 senseDataSize ); + + /*! + @function EnsureAutosenseDescriptorExists + @abstract Internal method, not to be called by subclasses. + @discussion Internal method, not to be called by subclasses. + @param request A valid SCSITaskIdentifier. + */ + void EnsureAutosenseDescriptorExists ( SCSITaskIdentifier request ); + + /*! + @function SetProtocolLayerReference + @abstract Accessor method to set the protocol layer reference. + @discussion Accessor method to set the protocol layer reference. + @param request A valid SCSITaskIdentifier. + @param newReferenceValue Pointer to reference data. + @result True on success, otherwise false. + */ + bool SetProtocolLayerReference ( + SCSITaskIdentifier request, + void * newReferenceValue ); + + /*! + @function GetProtocolLayerReference + @abstract Accessor method to retrieve the protocol layer reference. + @discussion Accessor method to retrieve the protocol layer reference. + @param request A valid SCSITaskIdentifier. + @result The protocol layer reference value. May be NULL. + */ + void * GetProtocolLayerReference ( SCSITaskIdentifier request ); + + /*! + @function SetTaskExecutionMode + @abstract Internal method used to set the task execution mode. + @discussion Internal method used to set the task execution mode. + @param request A valid SCSITaskIdentifier. + @param newTaskMode A valid SCSITaskMode value. + @result True on success, otherwise false. + */ + bool SetTaskExecutionMode ( + SCSITaskIdentifier request, + SCSITaskMode newTaskMode ); + + /*! + @function GetTaskExecutionMode + @abstract Internal method used to retrieve the task execution mode. + @discussion Internal method used to retrieve the task execution mode. + @param request A valid SCSITaskIdentifier. + @result A valid SCSITaskMode value. + */ + SCSITaskMode GetTaskExecutionMode ( SCSITaskIdentifier request ); + + /*! + @function SendNotification_DeviceRemoved + @abstract Method called by subclasses when a device is physically removed from the bus. + @discussion Method called by subclasses when a device is physically removed from the bus. + */ + void SendNotification_DeviceRemoved ( void ); + + /*! + @function SendNotification_VerifyDeviceState + @abstract Method called by subclasses when a device state needs to be re-verified due to some + bus condition which may have changed the device state. + @discussion Method called by subclasses when a device state needs to be re-verified due to some + bus condition which may have changed the device state. + */ + void SendNotification_VerifyDeviceState ( void ); + + // -- SCSI Task Queue Management Methods -- + // Following are the commands used to manipulate the queue of pending SCSI Tasks. + + /*! + @function AddSCSITaskToQueue + @abstract Internal method called to add a SCSITask to the processing queue. + @discussion Internal method called to add a SCSITask to the processing queue. + @param request A valid SCSITaskIdentifier. + */ + void AddSCSITaskToQueue ( SCSITaskIdentifier request ); + + /*! + @function AddSCSITaskToHeadOfQueue + @abstract Internal method called to add a SCSITask to the head of the processing queue. + @discussion Internal method called to add a SCSITask to the head of the processing queue. + @param request A valid SCSITask pointer. + */ + void AddSCSITaskToHeadOfQueue ( SCSITask * request ); + + /*! + @function RetrieveNextSCSITaskFromQueue + @abstract Internal method called to retrieve the next SCSITask to process. + @discussion Internal method called to retrieve the next SCSITask to process. + @result A valid SCSITask pointer or NULL if there are no tasks to process. + */ + SCSITask * RetrieveNextSCSITaskFromQueue ( void ); + + /*! + @function AbortSCSITaskFromQueue + @abstract Deprecated internal method. + @discussion Deprecated internal method. + */ + bool AbortSCSITaskFromQueue ( SCSITask * request ); + + /*! + @function SendSCSITasksFromQueue + @abstract Internal method called to start processing SCSITasks. + @discussion Internal method called to start processing SCSITasks. Only one client or workloop + thread may process SCSITasks at any point in time. This method coordinates to ensure only one + thread does so. + */ + void SendSCSITasksFromQueue ( void ); + + /*! + @function RejectSCSITasksCurrentlyQueued + @abstract Internal method called to reject currently enqueued SCSITasks. + @discussion Internal method called to reject currently enqueued SCSITasks. This method is + typically called in response to device termination. + */ + void RejectSCSITasksCurrentlyQueued ( void ); + + /*! + @function ProcessCompletedTask + @abstract Internal method called to process completed SCSITasks. + @discussion Internal method called to process completed SCSITasks. This method determines if + a CHECK_CONDITION has occurred and if sense data was requested and autosense data is not present. + If so, it will change the execution mode of the SCSITask and request sense data on behalf of + the caller. + @param request A valid SCSITaskIdentifier. + @param serviceResponse A valid SCSIServiceResponse value. + @param taskStatus A valid SCSITaskStatus value. + */ + void ProcessCompletedTask ( SCSITaskIdentifier request, + SCSIServiceResponse serviceResponse, + SCSITaskStatus taskStatus ); + + /*! + @function RejectTask + @abstract Internal method called to reject a particular SCSITask. + @discussion Internal method called to reject a particular SCSITask. + @param request A valid SCSITaskIdentifier. + */ + void RejectTask ( SCSITaskIdentifier request ); + + // ------ Power Management Support ------ + + /*! + @function InitializePowerManagement + @abstract Subclasses call this method to initialize power management. + @discussion Subclasses call this method to initialize power management. + In the protocol services layer, this method calls the protocol interface layer + to initialize power management state variables and then registers the protocol + layer driver with the power manager with two(2) states, ON and OFF. Subclasses may + override this behavior. + @param provider The provider to be joined to in the power management tree. + */ + virtual void InitializePowerManagement ( IOService * provider ) APPLE_KEXT_OVERRIDE; + + /*! + @function GetInitialPowerState + @abstract This method is called once, right after InitializePowerManagement() + in order to determine what state the device is initially in at startup time (usually + the highest power mode). + @discussion This method is called once, right after InitializePowerManagement() + in order to determine what state the device is initially in at startup time (usually + the highest power mode). + @result The power state the device is currently in. + */ + virtual UInt32 GetInitialPowerState ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function HandlePowerChange + @abstract This method is called to handle a power change. + @discussion This method is called to handle a power change. It is called from a clean thread + context (i.e. new thread, no locks held) and can make synchronous or asynchronous calls. + */ + virtual void HandlePowerChange ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function HandleCheckPowerState + @abstract Method called to check if the device is in the correct power state for an I/O. + @discussion The HandleCheckPowerState (void) method is on the serialized side of the command + gate and can change member variables safely without multi-threading issues. Its main purpose is + to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) with the max power state + with which the class registered. + */ + virtual void HandleCheckPowerState ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function TicklePowerManager + @abstract Internal method. Do not use. + @discussion Internal method. Do not use. + */ + virtual void TicklePowerManager ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function HandlePowerOff + @abstract Convenience method for a protocol service driver to handle a power off call (called + on the way to sleep). + @discussion Convenience method for a protocol service driver to handle a power off call (called + on the way to sleep). This method is guaranteed to be called after application layer drivers + have been put to sleep. + @result A valid IOReturn code. + */ + virtual IOReturn HandlePowerOff ( void ); + + /*! + @function HandlePowerOn + @abstract Convenience method for a protocol service driver to handle a power on call (called + on the way back up from sleep). + @discussion Convenience method for a protocol service driver to handle a power on call (called + on the way back up from sleep). Driver should perform any bus specific activity necessary to + recover from power-on/wake from sleep (e.g. bus reset on ATAPI). This method is guaranteed to + be called before application layer drivers have been awakened. + @result A valid IOReturn code. + */ + virtual IOReturn HandlePowerOn ( void ); + + +public: + + + /*! + @function init + @abstract Standard init method for all IORegistryEntry subclasses. + @discussion A registry entry must be initialized with this method before it can be used. A property dictionary may passed and will be retained by this method for use as the registry entry's property table, or an empty one will be created. + @param A dictionary that will become the registry entry's property table (retaining it), or zero which will cause an empty property table to be created. + @result true on success, or false on a resource failure. + */ + virtual bool init ( OSDictionary * propTable = 0 ) APPLE_KEXT_OVERRIDE; + + /*! + @function start + @abstract During an IOService object's instantiation, starts the IOService object that has been selected to run on the provider. + @discussion The start method of an IOService instance is called by its provider when it has been selected (due to its probe score and match category) as the winning client. The client is already attached to the provider when start is called.
Implementations of start must call start on their superclass at an appropriate point. If an implementation of start has already called super::start but subsequently determines that it will fail, it must call super::stop to balance the prior call to super::start and prevent reference leaks. + @result true if the start was successful; false otherwise (which will cause the instance to be detached and usually freed). + */ + virtual bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + + + /*! + @function free + @abstract Frees data structures that were allocated during start(). + @discussion Frees data structures that were allocated during start(). + */ + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function RegisterSCSITaskCompletionRoutine + @abstract Used by IOSCSITargetDevice to register a completion routine. + @discussion Used by IOSCSITargetDevice to register a completion routine. Internal use only. + @param completion A SCSITaskCompletion routine. + */ + void RegisterSCSITaskCompletionRoutine ( SCSITaskCompletion completion ); + + // ------- SCSI Architecture Model Task Management Functions ------ + + /*! + @function ExecuteCommand + @abstract ExecuteCommand method will take a SCSI Task and transport it across the physical + wire(s) to the device. + @discussion ExecuteCommand method will take a SCSI Task and transport it across the physical + wire(s) to the device. + @param request A valid SCSITaskIdentifier. + */ + void ExecuteCommand ( SCSITaskIdentifier request ) APPLE_KEXT_OVERRIDE; + + /*! + @function AbortTask + @abstract The Task Management function to allow the SCSI Application Layer client to request + that a specific task be aborted. + @discussion The Task Management function to allow the SCSI Application Layer client to request + that a specific task be aborted. + @param theLogicalUnit A logical unit for which to abort a task. + @param theTag A valid SCSITaggedTaskIdentifier used to identify which task to abort. + @result A valid SCSIServiceResponse. + */ + SCSIServiceResponse AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag ) APPLE_KEXT_OVERRIDE; + + /*! + @function AbortTaskSet + @abstract The Task Management function to allow the SCSI Application Layer client to request + that a complete task set be aborted. + @discussion The Task Management function to allow the SCSI Application Layer client to request + that a complete task set be aborted. + @param theLogicalUnit A logical unit for which to abort the task set. + @result A valid SCSIServiceResponse. + */ + SCSIServiceResponse AbortTaskSet ( UInt8 theLogicalUnit ) APPLE_KEXT_OVERRIDE; + + /*! + @function ClearACA + @abstract The Task Management function to clear an Auto-Contingent Allegiance condition. + @discussion The Task Management function to clear an Auto-Contingent Allegiance condition. + @param theLogicalUnit A logical unit for which to clear the ACA. + @result A valid SCSIServiceResponse. + */ + SCSIServiceResponse ClearACA ( UInt8 theLogicalUnit ) APPLE_KEXT_OVERRIDE; + + /*! + @function ClearTaskSet + @abstract The Task Management function to clear a task set. + @discussion The Task Management function to clear a task set. + @param theLogicalUnit A logical unit for which to clear a task set. + @result A valid SCSIServiceResponse. + */ + SCSIServiceResponse ClearTaskSet ( UInt8 theLogicalUnit ) APPLE_KEXT_OVERRIDE; + + /*! + @function LogicalUnitReset + @abstract The Task Management function to reset a logical unit. + @discussion The Task Management function to reset a logical unit. + @param theLogicalUnit A logical unit for which to clear a task set. + @result A valid SCSIServiceResponse. + */ + SCSIServiceResponse LogicalUnitReset ( UInt8 theLogicalUnit ) APPLE_KEXT_OVERRIDE; + + /*! + @function TargetReset + @abstract The Task Management function to reset a target device. + @discussion The Task Management function to reset a target device. + @result A valid SCSIServiceResponse. + */ + SCSIServiceResponse TargetReset ( void ) APPLE_KEXT_OVERRIDE; + + // ************* Obsoleted Member Routine **************** + /*! + @function AbortCommand + @abstract Deprecated. Do not use. + @discussion Deprecated. Do not use. + */ + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier request ) APPLE_KEXT_OVERRIDE __attribute__ ((deprecated)); + + + // ---- Method used for determining protocol or physical interconnect characteristics. ---- + /*! + @function IsProtocolServiceSupported + @abstract IsProtocolServiceSupported will return true if the specified + feature is supported by the protocol layer. + @discussion IsProtocolServiceSupported will return true if the specified + feature is supported by the protocol layer. + @param feature A valid SCSIProtocolFeature. + @param serviceValue A pointer to a value for the protocol feature. + @result True if the requested service is supported, otherwise false. + */ + virtual bool IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue ) APPLE_KEXT_OVERRIDE = 0; + + /*! + @function HandleProtocolServiceFeature + @abstract HandleProtocolServiceFeature instructs the Protocol Services driver to perform the + necessary tasks for the indicated feature. + @discussion HandleProtocolServiceFeature instructs the Protocol Services driver to perform the + necessary tasks for the indicated feature. + @param feature A valid SCSIProtocolFeature. + @param serviceValue A pointer to a value for the protocol feature. + @result True if successful, otherwise false. + */ + virtual bool HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue ) APPLE_KEXT_OVERRIDE = 0; + + +protected: + + // ----- Protocol Services Driver request handlers for Task Management functions ----- + + /*! + @function HandleAbortTask + @abstract HandleAbortTask instructs the Protocol Services driver to abort the task. + @discussion HandleAbortTask instructs the Protocol Services driver to abort the task. + @param theLogicalUnit A valid logical unit number. + @param theTag The tag of the command to abort. + @result A valid SCSIServiceResponse. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 1 ); + virtual SCSIServiceResponse HandleAbortTask ( + UInt8 theLogicalUnit, + SCSITaggedTaskIdentifier theTag ); + + /*! + @function HandleAbortTaskSet + @abstract HandleAbortTaskSet instructs the Protocol Services driver to abort the task set. + @discussion HandleAbortTaskSet instructs the Protocol Services driver to abort the task set. + @param theLogicalUnit A valid logical unit number. + @result A valid SCSIServiceResponse. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 2 ); + virtual SCSIServiceResponse HandleAbortTaskSet ( + UInt8 theLogicalUnit ); + + /*! + @function HandleClearACA + @abstract HandleClearACA instructs the Protocol Services driver to clear an auto-contingent allegiance. + @discussion HandleClearACA instructs the Protocol Services driver to clear an auto-contingent allegiance. + @param theLogicalUnit A valid logical unit number. + @result A valid SCSIServiceResponse. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 3 ); + virtual SCSIServiceResponse HandleClearACA ( + UInt8 theLogicalUnit ); + + /*! + @function HandleClearTaskSet + @abstract HandleClearTaskSet instructs the Protocol Services driver to clear the task set. + @discussion HandleClearTaskSet instructs the Protocol Services driver to clear the task set. + @param theLogicalUnit A valid logical unit number. + @result A valid SCSIServiceResponse. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 4 ); + virtual SCSIServiceResponse HandleClearTaskSet ( + UInt8 theLogicalUnit ); + + /*! + @function HandleLogicalUnitReset + @abstract HandleLogicalUnitReset instructs the Protocol Services driver to reset the logical unit. + @discussion HandleLogicalUnitReset instructs the Protocol Services driver to reset the logical unit. + @param theLogicalUnit A valid logical unit number. + @result A valid SCSIServiceResponse. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 5 ); + virtual SCSIServiceResponse HandleLogicalUnitReset ( + UInt8 theLogicalUnit ); + + /*! + @function HandleTargetReset + @abstract HandleTargetReset instructs the Protocol Services driver to reset the target. + @discussion HandleTargetReset instructs the Protocol Services driver to reset the target. + @result A valid SCSIServiceResponse. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 6 ); + virtual SCSIServiceResponse HandleTargetReset ( void ); + + /*! + @function CreateSCSITargetDevice + @abstract Used to create a SCSITargetDevice which will manage logical units. + @discussion The CreateSCSITargetDevice member routine will create the appropriate object + to represent the Target portion of a SCSI Device. This object is responsible + for managing the Target functions of the SCSI Device including the Task Manager and + Logical Units. + @result True if successful, otherwise false. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 7 ); + virtual bool CreateSCSITargetDevice ( void ); + +private: + + +#if !TARGET_OS_IPHONE + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 16 ); +#endif /* !TARGET_OS_IPHONE */ + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PROTOCOL_SERVICES_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/IOSCSIReducedBlockCommandsDevice.h b/QualcommWireless/include/IOKit/scsi/IOSCSIReducedBlockCommandsDevice.h new file mode 100644 index 0000000..8658fa7 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/IOSCSIReducedBlockCommandsDevice.h @@ -0,0 +1,1010 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_REDUCED_BLOCK_COMMANDS_DEVICE_H_ +#define _IOKIT_IO_SCSI_REDUCED_BLOCK_COMMANDS_DEVICE_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +/*! @header SCSI Reduced Block Commands Device + @discussion + This file contains definitions for the IOSCSIReducedBlockCommandsDevice class, + commands required for RBC devices, power management, and additional constants + used by this class. + */ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include +#include + +// Generic IOKit storage related headers +#include + +// SCSI Architecture Model Family includes +#include + +// Build includes +#include + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// RBC power states as defined in T10:1240D SCSI Reduced Block Commands (RBC) +// Revision 10a, August 18, 1999, page 13. +enum +{ + kRBCPowerStateSystemSleep = 0, + kRBCPowerStateSleep = 1, + kRBCPowerStateStandby = 2, + kRBCPowerStateIdle = 3, + kRBCPowerStateActive = 4, + kRBCNumPowerStates = 5 +}; + +/*! +@enum Media lock state values +@discussion +Values used to set media lock state. +@constant kMediaStateUnlocked +Value to be passed in order to unlock media and make it availabe for writing. +@constant kMediaStateLocked +Value to be passed when the media is to be locked and made read-only. +*/ + +enum +{ + kMediaStateUnlocked = 0, + kMediaStateLocked = 1 +}; + +#define kCapacityDataBufferSize 8 + +// Forward declaration for the SCSIReducedBlockCommands that is used internally by the +// IOSCSIReducedBlockCommandsDevice class. +class SCSIReducedBlockCommands; + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +/*! +@class IOSCSIReducedBlockCommandsDevice +@superclass IOSCSIPrimaryCommandsDevice +@discussion +Implementation of the T10 device Reduced Block Commands device. This is the base +driver for all subclasses implementing peripheral device type 0xE. +*/ +class IOSCSIReducedBlockCommandsDevice : public IOSCSIPrimaryCommandsDevice +{ + + OSDeclareAbstractStructors ( IOSCSIReducedBlockCommandsDevice ); + +private: + + static void AsyncReadWriteComplete ( SCSITaskIdentifier completedTask ); + +protected: + + // Reserve space for future expansion. + struct IOSCSIReducedBlockCommandsDeviceExpansionData + { + IONotifier * fPowerDownNotifier; + bool fMediumRemovalPrevented; + bool fKnownManualEject; + UInt32 fPollingMode; + bool fProtocolSpecificPowerControl; + }; + IOSCSIReducedBlockCommandsDeviceExpansionData * fIOSCSIReducedBlockCommandsDeviceReserved; + + #define fPowerDownNotifier fIOSCSIReducedBlockCommandsDeviceReserved->fPowerDownNotifier + #define fMediumRemovalPrevented fIOSCSIReducedBlockCommandsDeviceReserved->fMediumRemovalPrevented + #define fKnownManualEject fIOSCSIReducedBlockCommandsDeviceReserved->fKnownManualEject + #define fPollingMode fIOSCSIReducedBlockCommandsDeviceReserved->fPollingMode + #define fProtocolSpecificPowerControl fIOSCSIReducedBlockCommandsDeviceReserved->fProtocolSpecificPowerControl + + bool fMediaChanged; + bool fMediaPresent; + + // The byte count of each physical block on the media. + UInt32 fMediaBlockSize; + + // The total number of blocks of mediaBlockSize on the media. + UInt32 fMediaBlockCount; + + // Flags used to indicate device features. + bool fMediaIsRemovable; + bool fMediaIsWriteProtected; + + thread_call_t fPollingThread; + + enum + { + kPollingMode_Suspended = 0, + kPollingMode_NewMedia = 1, + kPollingMode_MediaRemoval = 2 + }; + + /*! + @function CreateStorageServiceNub + @abstract Creates a nub which links the IOSCSIReducedBlockCommandsDevice to the IOStorageFamily. + @discussion Creates a nub which links the IOSCSIReducedBlockCommandsDevice to the IOStorageFamily. + */ + virtual void CreateStorageServiceNub ( void ); + + /*! + @function DetermineDeviceCharacteristics + @abstract Determine the characteristics of the device. + @discussion Determine the characteristics, ANSI version, removability, etc., of the device via its INQUIRY data. + @result true on success and false on failure. + */ + virtual bool DetermineDeviceCharacteristics ( void ); + + /*! + @function PollForMedia + @abstract Poll device for media insertion or removal depending on selected polling mode. + @discussion Polls device for media insertion or removal depending on selected polling mode. + If a change in media state is detected the correct media inserted or removed API is called from within PollForMedia. + */ + virtual void PollForMedia ( void ); + + /*! + @function EnablePolling + @abstract Enables media polling. + @discussion Schedules a thread to poll the device for media at the prescribed interval. + */ + virtual void EnablePolling ( void ); + + /*! + @function DisablePolling + @abstract Disables media polling. + @discussion Cancels ( if running ) the media polling thread. + */ + virtual void DisablePolling ( void ); + + /*! + @function CheckWriteProtection + @abstract Ascertains whether or not media is locked. + @discussion Determines the current write protection state of the media. + Result stored in fMediaIsWriteProtected. + */ + virtual void CheckWriteProtection ( void ); + + /*! + @function SetMediaCharacteristics + @abstract Sets the block size and block count for the current media. + @discussion Sets the block size and block count for the current media. + @param blockSize The media's block size in bytes. + @param blockCount The count of the media's blocks. + */ + virtual void SetMediaCharacteristics ( UInt32 blockSize, UInt32 blockCount ); + + /*! + @function ResetMediaCharacteristics + @abstract Resets the block size and block count. + @discussion Resets the block size and block count. + */ + virtual void ResetMediaCharacteristics ( void ); + + /*! + @function ClearNotReadyStatus + @abstract Clears any NOT_READY status for the device. + @discussion Polls device with TEST_UNIT_READY until the device returns kSCSITaskStatus_GOOD status. + Exits if device has become disconnected. + @result true if device is now active (isInactive == false) and false otherwise. + */ + virtual bool ClearNotReadyStatus ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function IssueRead + @abstract DEPRECATED. Please do not use this method. + @discussion DEPRECATED. Please do not use this method. + @param buffer DEPRECATED. Please do not use this method. + @param startBlock DEPRECATED. Please do not use this method. + @param blockCount DEPRECATED. Please do not use this method. + @result DEPRECATED. Please do not use this method. + */ + virtual IOReturn IssueRead ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + /*! + @function IssueWrite + @abstract DEPRECATED. Please do not use this method. + @discussion DEPRECATED. Please do not use this method. + @param buffer DEPRECATED. Please do not use this method. + @param startBlock DEPRECATED. Please do not use this method. + @param blockCount DEPRECATED. Please do not use this method. + @result DEPRECATED. Please do not use this method. + */ + virtual IOReturn IssueWrite ( IOMemoryDescriptor* buffer, + UInt64 startBlock, + UInt64 blockCount ); + + /*! + @function IssueRead + @abstract Issues an asynchronous read command. + @discussion Issues an asynchronous read command. + @param buffer A pointer to a valid IOMemoryDescriptor to which the data can be copied to. + @param startBlock Starting logical block address for the read operation. + @param blockCount The number of blocks to be read. + @param clientData A valid pointer to the client data to be used for callback completion. + @result A valid IOReturn value. + */ + virtual IOReturn IssueRead ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + + /*! + @function IssueWrite + @abstract Issues an asynchronous write command. + @discussion Issues an asynchronous write command. + @param buffer A pointer to a valid IOMemoryDescriptor to which the data can be copied from. + @param startBlock Starting logical block address for the write operation. + @param blockCount The number of blocks to be written. + @param clientData A valid pointer to the client data to be used for callback completion. + @result A valid IOReturn value. + */ + virtual IOReturn IssueWrite ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + + // ----- Power Management Support ------ + + /*! + @function InitializePowerManagement + @abstract Called to initialize power management. + @discussion Called by InitializeDeviceSupport() to initialize power management by, + joining the power management tree, registering power states, and setting the lowest idle + power state. + @param A valid pointer to this object's provider. + */ + + // We override this method to set our power states and register ourselves + // as a power policy maker. + virtual void InitializePowerManagement ( IOService * provider ) APPLE_KEXT_OVERRIDE; + + /*! + @function GetInitialPowerState + @abstract Called by power management to determine initial power state. + @discussion Called by power management to determine which power state is desired when + power management is initialized. + @result Returns the initial power state desired when power management is initialized. + */ + + // We override this method so that when we register for power management, + // we go to our active power state (which the drive is definitely in + // at startup time). + virtual UInt32 GetInitialPowerState ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function GetNumberOfPowerStateTransitions + @abstract Called by power management to determine this class's total + number of power state transitions. + @discussion Called by power management to determine this class's total + number of power state transitions. + @result Returns the number of power state transitions for this class. + */ + + // We override this method in order to provide the number of transitions + // from Fully active to Sleep state so that the idle timer can be adjusted + // to the appropriate time period based on the disk spin down time set in + // the Energy Saver prefs panel. + virtual UInt32 GetNumberOfPowerStateTransitions ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function TicklePowerManager + @abstract The TicklePowerManager() is called by CheckPowerState() and + sends an activity tickle ( via activityTickle() ) to the power manager + so that the idle timer is reset. + @discussion The TicklePowerManager() is called by CheckPowerState() and + sends an activity tickle ( via activityTickle() ) to the power manager + so that the idle timer is reset. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. + */ + + // The TicklePowerManager method is called to tell the power manager that the + // device needs to be in a certain power state to handle requests. + virtual void TicklePowerManager ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function HandlePowerChange + @abstract Handles the state machine for power management state changes. + @discussion Handles the state machine for power management state changes. + */ + + // The HandlePowerChange method is the state machine for power management. + // It is guaranteed to be on its own thread of execution (different from + // the power manager thread AND the workloop thread. This routine can + // send sync or async calls to the drive without worrying about threading + // issues. + virtual void HandlePowerChange ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function HandleCheckPowerState(void) + @abstract The HandleCheckPowerState (void) method is on the serialized side of the command + gate and can change member variables safely without multi-threading issues. + It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + with the max power state the class registered with. + @discussion The HandleCheckPowerState (void) method is on the serialized side of the command + gate and can change member variables safely without multi-threading issues. + It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + with the max power state the class registered with. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. The default behavior is to block until the + object transistions to its maximum power state. + */ + + virtual void HandleCheckPowerState ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function CheckMediaPresence + @abstract Called to ascertain the current presence of media. + @discussion Called to ascertain the current presence of media. + @result true if media is present and false if media is not present. + */ + + // The CheckMediaPresence method is called to see if the media which we + // anticipated being there is still there. + virtual bool CheckMediaPresence ( void ); + + /*! + @function InitializeDeviceSupport + @abstract Called in super class's start() to initialize device support. + @discussion Called in super class's start() to initialize device support. The underlying infrastructure + for supporting a device must be implemented here. + @result true if device could be successfully configured false if not. + */ + virtual bool InitializeDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function StartDeviceSupport + @abstract Called in super class's start() to start device support. + @discussion Called in super class's start() to start device support. Support for starting + devices and making them usable must be implemented here. + */ + virtual void StartDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function SuspendDeviceSupport + @abstract Called to temporarily suspend device support. + @discussion Called to temporarily suspend device support. Support for suspending + devices must be implemented here. + */ + virtual void SuspendDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function ResumeDeviceSupport + @abstract Called to temporarily resume device support. + @discussion Called to temporarily resume device support. Support for resuming + devices must be implemented here. + */ + virtual void ResumeDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function StopDeviceSupport + @abstract Called to stop device support. + @discussion Called to stop device support. Support for stopping + devices must be implemented here. + */ + virtual void StopDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function TerminateDeviceSupport + @abstract Called to terminate device support. + @discussion Called to terminate device support. The underlying infrastructure for + support a device should be cleaned up here. + */ + virtual void TerminateDeviceSupport ( void ) APPLE_KEXT_OVERRIDE; + + /*! + @function free + @abstract Called to release all resources held by the object. + @discussion Release all resources held by the object, then call super::free(). + */ + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + +public: + + /*! + @function SyncReadWrite + @abstract Translates a synchronous I/O request into a read or a write. + @discussion Translates a synchronous I/O request into a read or a write. + Default implementation always returns kIOReturnUnsupported. + @param buffer A pointer to a valid IOMemoryDescriptor to which the + data can be copied to or from. + @param startBlock Starting logical block address for the write operation. + @param blockCount The number of block to be write. + @result A valid IOReturn value. + */ + virtual IOReturn SyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + /*! + @function AsyncReadWrite + @abstract Translates an asynchronous I/O request into a read or a write. + @discussion Translates an asynchronous I/O request into a read or a write. + @param buffer A pointer to a valid IOMemoryDescriptor to which the + data can be copied to or from. + @param startBlock Starting logical block address for the write operation. + @param blockCount The number of block to be write. + @result A valid IOReturn value. + */ + virtual IOReturn AsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + void * clientData ); + + /*! + @function EjectTheMedia + @abstract Called to eject the inserted media from the drive. + @discussion Called by IOBlockStorageDevice subclasses to eject the inserted + media from the drive. + @result A valid IOReturn value. + */ + virtual IOReturn EjectTheMedia ( void ); + + /*! + @function FormatMedia + @abstract Called to perform a low level format of the inserted media. + @discussion Called IOBlockStorageDevice subclasses to perform a low level + of the inserted media. Default implementation simply returns kIOReturnUnsupported + if not overridden. + @param byteCapacity + @result A valid IOReturn value. + */ + virtual IOReturn FormatMedia ( UInt64 byteCapacity ); + + /*! + @function GetFormatCapacities + @abstract Called to determine the formatted capacity of the inserted media. + @discussion Called IOBlockStorageDevice subclasses to determine the formatted + capacity of the inserted media. Presently unsupported by default implementation. + Returns 0 unless overridden. + @param capacities a pointer to a valid UInt64 array. + @param capacitiesMaxCount the number of elements addressable within capacities. + @result The number of elements assigned in capacities ( count is 1 based ). + */ + virtual UInt32 GetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + /*! + @function LockUnlockMedia + @abstract Called to lock or unlock the inserted media. + @discussion Called by IOBlockStorageDevice subclasses to lock or unlock the inserted media. + @param doLock if true the media will be locked, if false the media will be unlocked. + @result A valid IOReturn value. + */ + virtual IOReturn LockUnlockMedia ( bool doLock ); + + /*! + @function SynchronizeCache + @abstract Called to synchronize the devices cache and thereby force its contents to be + written out to the media. + @discussion Called by IOBlockStorageDevice subclasses to synchronize the devices cache + and thereby force the cache's contents to be written out to the media. + @result A valid IOReturn value. + */ + virtual IOReturn SynchronizeCache ( void ); + + /*! + @function ReportBlockSize + @abstract Reports the logical block size of the media. + @discussion Called by IOBlockStorageDevice subclasses to get the logical block size of the media. + @param blockSize a valid pointer to a UInt64 in which the logical block size is to be stored. + @result A valid IOReturn value. + */ + virtual IOReturn ReportBlockSize ( UInt64 * blockSize ); + + /*! + @function ReportEjectability + @abstract Reports whether or not the media is ejectable. + @discussion Called by IOBlockStorageDevice subclasses to determine whether or not the media is ejectable. + @param isEjectable a valid pointer to a bool in which the ejectability of the media is to be stored. + @result A valid IOReturn value. + */ + virtual IOReturn ReportEjectability ( bool * isEjectable ); + + /*! + @function ReportLockability + @abstract Reports whether or not the media is lockable ( can be write protected ). + @discussion Called by IOBlockStorageDevice subclasses to determine whether or not the media is lockable + ( can be write protected ). + @param isLockable a valid pointer to a bool in which the lockability of the media is to be stored. + @result A valid IOReturn value. + */ + virtual IOReturn ReportLockability ( bool * isLockable ); + + /*! + @function ReportPollRequirements + @abstract Reports polling requirements to caller. + @discussion Called by IOBlockStorageDevice subclasses to determine polling requirements. + Used to determine if polling for media is required and if polling is expensive. + @param pollIsRequired a pointer to a bool in which to store whether or not polling is required. + @param pollIsExpensive a pointer to a bool in which to store whether or not polling is expensive. + @result A valid IOReturn value. + */ + virtual IOReturn ReportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + /*! + @function ReportMaxReadTransfer + @abstract Reports maximum read transfer size to caller. + @discussion Called by IOBlockStorageDevice subclasses to determine the maximum size + of a read transfer in bytes. + @param blockSize used to pass in the block size to be used for a follow up transfer. + @param max a pointer to a UInt64 in which to store the maximum transfer size in bytes. + @result A valid IOReturn value. + */ + virtual IOReturn ReportMaxReadTransfer ( UInt64 blockSize, + UInt64 * max ); + + /*! + @function ReportMaxValidBlock + @abstract Reports the maximum valid block on the media. + @discussion Called by IOBlockStorageDevice subclasses to determine the maximum valid + block of the media. + @param maxBlock a pointer to a UInt64 in which the maximum valid block is to be stored. + @result A valid IOReturn value. + */ + virtual IOReturn ReportMaxValidBlock ( UInt64 * maxBlock ); + + /*! + @function ReportMaxWriteTransfer + @abstract Reports maximum write transfer size to caller. + @discussion Called by IOBlockStorageDevice subclasses to determine the maximum size + of a write transfer in bytes. + @param blockSize used to pass in the block size of the media. + @param max a pointer to a UInt64 in which to store the maximum transfer size in bytes. + @result A valid IOReturn value. + */ + virtual IOReturn ReportMaxWriteTransfer ( UInt64 blockSize, + UInt64 * max ); + + /*! + @function ReportMediaState + @abstract Reports the state of media in the device. + @discussion Called by IOBlockStorageDevice subclasses to determine whether or not media is + present and if that media has changed. + @param mediaPresent a pointer to a bool in which media presence will be stored. + @param changed a pointer to a bool in which whether or not the media has changed will be stored. + @result A valid IOReturn value. + */ + virtual IOReturn ReportMediaState ( bool * mediaPresent, + bool * changed ); + + /*! + @function ReportRemovability + @abstract Reports whether or not the media may be removed. + @discussion Called by IOBlockStorageDevice subclasses to determine whether or not the media may be removed. + @param isRemovable a pointer to a bool in which whether or not the media can be me removed + will be stored. + @result A valid IOReturn value. + */ + virtual IOReturn ReportRemovability ( bool * isRemovable ); + + /*! + @function ReportWriteProtection + @abstract Reports whether or not the media is write protected. + @discussion Called by IOBlockStorageDevice subclasses to determine whether or not the media is write protected. + @param isWriteProtected a pointer to a bool in which whether or not the media is write protected will be stored. + @result A valid IOReturn value. + */ + virtual IOReturn ReportWriteProtection ( bool * isWriteProtected ); + + /*! + @function sPollForMedia + @abstract Static method called to poll for media. + @discussion Static method called to poll for media. + @param pdtDriver a pointer to a valid IOSCSIReducedBlockCommandsDevice ( or subclass ) which is to + be polled. + @param refCon a pointer to an additional object which can be determined by the implementer. + */ + static void sPollForMedia ( void * pdtDriver, void * refCon ); + + +protected: + + + /*! + @function FORMAT_UNIT + @abstract Builds a FORMAT UNIT command. + @discussion Builds a FORMAT UNIT command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param IMMED used to specify whether or not the immediate bit for the command needs to be set. + @param PROGRESS used to specify whether or not the progress bit for the commands needs to be set. + @param PERCENT_TIME used to specify whether or not the percent time bit for the command needs to be set. + @param INCREMENT used to specify whether or not the increment bit for the command needs to be set. + @result true if the command was successfully built and false if not. + */ + // The FORMAT_UNIT command as defined in section 5.1 + virtual bool FORMAT_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit PROGRESS, + SCSICmdField1Bit PERCENT_TIME, + SCSICmdField1Bit INCREMENT ); + + /*! + @function INQUIRY + @abstract Builds a INQUIRY command. + @discussion Builds a INQUIRY command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a point to a valid IOMemoryDescriptor in which the received INQUIRY data is to be stored. + @param CMDDT used to specify whether or not the command support data ( CmdDT ) bit for the commands needs to be set. + @param EVPD used to specify whether or not the vital product data ( EVPD ) bit for the command needs to be set. + @param PAGE_OR_OPERATION_CODE used to specify which INQUIRY data page is being requested of the device. + @param ALLOCATION_LENGTH used to specify the maximum requested amount of INQUIRY data. + @result true if the command was successfully built and false if not. + */ + // The INQUIRY command as defined in SPC-2 w/o CONTROL byte + virtual bool INQUIRY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit CMDDT, + SCSICmdField1Bit EVPD, + SCSICmdField1Byte PAGE_OR_OPERATION_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + /*! + @function MODE_SELECT_6 + @abstract Builds a MODE SELECT(6) command. + @discussion Builds a MODE SELECT(6) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a point to a valid IOMemoryDescriptor in which the MODE SELECT data is stored. + @param PF used to specify whether or not the page format ( PF ) bit for the commands needs to be set. + @param SP used to specify whether or not the saves pages ( SP ) bit for the command needs to be set. + @param PARAMETER_LIST_LENGTH used to specify the length of the supplied data. + @result true if the command was successfully built and false if not. + */ + // The MODE_SELECT(6) command as defined in SPC-2 w/o CONTROL byte + virtual bool MODE_SELECT_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PF, + SCSICmdField1Bit SP, + SCSICmdField1Byte PARAMETER_LIST_LENGTH ); + + /*! + @function MODE_SENSE_6 + @abstract Builds a MODE SENSE(6) command. + @discussion Builds a MODE SENSE(6) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a point to a valid IOMemoryDescriptor in which the MODE SENSE data is to be stored. + @param DBD used to specify whether or not the disable block descriptors ( DBD ) bit for the commands needs to be set. + @param PC used to specify the desired page control ( PC ) value. + @param PAGE_CODE used to specify the desired page code. + @param ALLOCATION_LENGTH used to specify the maximum requested amount of MODE_SENSE data. + @result true if the command was successfully built and false if not. + */ + // The MODE_SENSE(6) command as defined in SPC-2 w/o CONTROL byte + virtual bool MODE_SENSE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DBD, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + /*! + @function PERSISTENT_RESERVE_IN + @abstract Builds a PERSISTENT RESERVE IN command. + @discussion Builds a PERSISTENT RESERVE IN command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a point to a valid IOMemoryDescriptor in which the reservation data is to be stored. + @param SERVICE_ACTION used to specify the SERVICE ACTION code. + @param ALLOCATION_LENGTH used to specify the number of parameter data bytes available to be returned. + @result true if the command was successfully built and false if not. + */ + // The PERSISTENT_RESERVE_IN command as defined in SPC-2 w/o CONTROL byte + virtual bool PERSISTENT_RESERVE_IN ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField2Byte ALLOCATION_LENGTH ); + + /*! + @function PERSISTENT_RESERVE_OUT + @abstract Builds a PERSISTENT RESERVE OUT command. + @discussion Builds a PERSISTENT RESERVE OUT command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a point to a valid IOMemoryDescriptor in which the reservation data is stored. + @param SERVICE_ACTION used to specify the SERVICE ACTION code. + @param SCOPE used to specify the desired scope. + @param TYPE used to specify the desired type. + @result true if the command was successfully built and false if not. + */ + // The PERSISTENT_RESERVE_OUT command as defined in SPC-2 w/o CONTROL byte + virtual bool PERSISTENT_RESERVE_OUT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField4Bit SCOPE, + SCSICmdField4Bit TYPE ); + + /*! + @function PREVENT_ALLOW_MEDIUM_REMOVAL + @abstract Builds a PREVENT ALLOW MEDIUM REMOVAL command. + @discussion Builds a PREVENT ALLOW MEDIUM REMOVAL command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param PREVENT used to specify whether or not media removal shall be prevented or allowed. The caller + uses kMediaStateUnlocked or kMediaStateLocked constant to set the state. + @result true if the command was successfully built and false if not. + */ + // The PREVENT_ALLOW_MEDIUM_REMOVAL command as defined in SPC-2 w/o CONTROL byte + virtual bool PREVENT_ALLOW_MEDIUM_REMOVAL ( + SCSITaskIdentifier request, + SCSICmdField2Bit PREVENT ); + + /*! + @function READ_10 + @abstract Builds a READ(10) command. + @discussion Builds a READ(10) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a point to a valid IOMemoryDescriptor in which the read data is to be stored. + @param blockSize used to specify the block size to be used for the read. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the read is to be initiated. + @param TRANSFER_LENGTH the desired transfer length in blocks. + @result true if the command was successfully built and false if not. + */ + // The READ_10 command as defined in section 5.2 + virtual bool READ_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH ); + + /*! + @function READ_CAPACITY + @abstract Builds a READ CAPACITY command. + @discussion Builds a READ CAPACITY command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a point to a valid IOMemoryDescriptor in which the read capacity data is to be stored. + @result true if the command was successfully built and false if not. + */ + // The READ_CAPACITY command as defined in section 5.3 + virtual bool READ_CAPACITY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer ); + + /*! + @function RELEASE_6 + @abstract Builds a RELEASE(6) command. + @discussion Builds a RELEASE(6) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @result true if the command was successfully built and false if not. + */ + // The RELEASE(6) command as defined in SPC-2 w/o CONTROL byte + virtual bool RELEASE_6 ( + SCSITaskIdentifier request ); + + /*! + @function REQUEST_SENSE + @abstract Builds a REQUEST SENSE command. + @discussion Builds a REQUEST SENSE command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a point to a valid IOMemoryDescriptor in which the sense data is to be stored. + @param ALLOCATION_LENGTH the maximum size of sense data to be supplied. + @result true if the command was successfully built and false if not. + */ + // The REQUEST_SENSE command as defined in SPC-2 w/o CONTROL byte + virtual bool REQUEST_SENSE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + /*! + @function RESERVE_6 + @abstract Builds a RESERVE(6) command. + @discussion Builds a RESERVE(6) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @result true if the command was successfully built and false if not. + */ + // The RESERVE(6) command as defined in SPC-2 w/o CONTROL byte + virtual bool RESERVE_6 ( + SCSITaskIdentifier request ); + + /*! + @function START_STOP_UNIT + @abstract Builds a START STOP UNIT command. + @discussion Builds a START STOP UNIT command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param IMMED used to specify whether or not the immediate bit for the command needs to be set. + @param POWER_CONDITIONS used to specify the desired POWER CONDITIONS code. + @param LEOJ used to specify whether or not the LOAD/EJECT ( LEOJ ) bit for the command needs to be set. + @param START used to specify whether or not the START bit for the command needs to be set. + @result true if the command was successfully built and false if not. + */ + // The START_STOP_UNIT command as defined in section 5.4 + virtual bool START_STOP_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField4Bit POWER_CONDITIONS, + SCSICmdField1Bit LEOJ, + SCSICmdField1Bit START ); + + /*! + @function SYNCHRONIZE_CACHE + @abstract Builds a SYNCHRONIZE CACHE command. + @discussion Builds a SYNCHRONIZE CACHE command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @result true if the command was successfully built and false if not. + */ + // The SYNCRONIZE_CACHE command as defined in section 5.5 + virtual bool SYNCHRONIZE_CACHE ( + SCSITaskIdentifier request ); + + /*! + @function TEST_UNIT_READY + @abstract Builds a TEST UNIT READY command. + @discussion Builds a TEST UNIT READY command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @result true if the command was successfully built and false if not. + */ + // The TEST_UNIT_READY command as defined in SPC-2 w/o CONTROL byte + virtual bool TEST_UNIT_READY ( + SCSITaskIdentifier request ); + + /*! + @function VERIFY + @abstract Builds a VERIFY command. + @discussion Builds a VERIFY command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the verify should be initiated. + @param VERIFICATION_LENGTH the desired length in blocks. + @result true if the command was successfully built and false if not. + */ + // The VERIFY command as defined in section 5.7 + virtual bool VERIFY ( + SCSITaskIdentifier request, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte VERIFICATION_LENGTH ); + + /*! + @function WRITE_10 + @abstract Builds a WRITE(10) command. + @discussion Builds a WRITE(10) command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a point to a valid IOMemoryDescriptor in which the data to be written is stored. + @param blockSize used to specify the block size to be used for the write. + @param FUA used specify whether or not the force unit access ( FUA ) bit should be set. + @param LOGICAL_BLOCK_ADDRESS used to specify the logical block address from which the write should be initiated. + @param TRANSFER_LENGTH the desired transfer length in blocks. + @result true if the command was successfully built and false if not. + */ + // The WRITE_10 command as defined in section 5.6 + virtual bool WRITE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit FUA, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH ); + + /*! + @function WRITE_BUFFER + @abstract Builds a WRITE BUFFER command. + @discussion Builds a WRITE BUFFER command. + @param request a SCSITaskIdentifier in which the built command will be stored. + @param dataBuffer a point to a valid IOMemoryDescriptor in which the data to be written is stored. + @param MODE used to specify which WRITE BUFFER mode is to be used. + @param BUFFER_ID used to be specificy the desired buffer ID. + @param BUFFER_OFFSET used to specify the desired buffer offset. + @param PARAMETER_LIST_LENGTH the length of the buffer to be transferred. + @result true if the command was successfully built and false if not. + */ + // The WRITE_BUFFER command as defined in SPC-2 w/o CONTROL byte + virtual bool WRITE_BUFFER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Bit MODE, + SCSICmdField1Byte BUFFER_ID, + SCSICmdField3Byte BUFFER_OFFSET, + SCSICmdField3Byte PARAMETER_LIST_LENGTH ); + + + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIReducedBlockCommandsDevice, 1 ); + +public: + + /*! + @function PowerDownHandler + @abstract Method called at sleep, restart, or shutdown time. + @discussion Notification handler registered with registerPrioritySleepWakeInterest(). + @param refCon a pointer to an object which can be determined by the implementer when + registerPrioritySleepWakeInterest() is called. + @param messageType a constant defined in IOMessage.h ( kIOMessageSystemWillPowerOff, kIOMessageSystemWillRestart, etc. ). + @param provider a pointer to the provider of the notification. + @param messageArgument a pointer to the notification's argument. + @param argSize the size of the argument. + @result A valid IOReturn value. + */ + virtual IOReturn PowerDownHandler ( void * refCon, + UInt32 messageType, + IOService * provider, + void * messageArgument, + vm_size_t argSize ); + + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIReducedBlockCommandsDevice, 2 ); + +protected: + + /*! + @function SetMediaIcon + @abstract Sets graphical icon for device's media objects. + @discussion Provides an opportunity for the driver to select a more fitting icon then default icon. + */ + virtual void SetMediaIcon ( void ); + + + /* Added with 10.3.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIReducedBlockCommandsDevice, 3 ); + +protected: + + /*! + @function AsyncReadWriteCompletion + @abstract Completion routine for asynchronous read and write requests. + @discussion Completion routine for asynchronous read and write requests. + */ + virtual void AsyncReadWriteCompletion ( SCSITaskIdentifier completedTask ); + + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_REDUCED_BLOCK_COMMANDS_DEVICE_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/SCSICmds_INQUIRY_Definitions.h b/QualcommWireless/include/IOKit/scsi/SCSICmds_INQUIRY_Definitions.h new file mode 100644 index 0000000..c2ec0d2 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/SCSICmds_INQUIRY_Definitions.h @@ -0,0 +1,1232 @@ +/* + * Copyright (c) 1998-2018 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_INQUIRY_H_ +#define _IOKIT_SCSI_CMDS_INQUIRY_H_ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +#if KERNEL +#include +#else +#include +#endif + + +/*! @header SCSI Inquiry Definitions + @discussion + This file contains all definitions for the data returned from + the INQUIRY (0x12) command. +*/ + + +/*! + * @enum Payload sizes + * @discussion + * Definitions for sizes related to the INQUIRY data. + * @constant kINQUIRY_StandardDataHeaderSize + * INQUIRY data header size. + * @constant kINQUIRY_MaximumDataSize + * Maximum size for INQUIRY data. +*/ +enum +{ + kINQUIRY_StandardDataHeaderSize = 5, + kINQUIRY_MaximumDataSize = 255 +}; + + +/*! +@enum INQUIRY field sizes +@discussion +Sizes for some of the inquiry data fields. +@constant kINQUIRY_VENDOR_IDENTIFICATION_Length +Size of VENDOR_IDENTIFICATION field. +@constant kINQUIRY_PRODUCT_IDENTIFICATION_Length +Size of PRODUCT_IDENTIFICATION field. +@constant kINQUIRY_PRODUCT_REVISION_LEVEL_Length +Size of PRODUCT_REVISION_LEVEL field. +*/ +enum +{ + kINQUIRY_VENDOR_IDENTIFICATION_Length = 8, + kINQUIRY_PRODUCT_IDENTIFICATION_Length = 16, + kINQUIRY_PRODUCT_REVISION_LEVEL_Length = 4 +}; + + +/*! +@struct SCSICmd_INQUIRY_StandardData +@discussion +This structure defines the format of the required standard data that is +returned for the INQUIRY command. This is the data that is required to +be returned from all devices. +*/ +typedef struct SCSICmd_INQUIRY_StandardData +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 RMB; // 7 = removable + UInt8 VERSION; // 7/6 = ISO/IEC, 5-3 = ECMA, 2-0 = ANSI. + UInt8 RESPONSE_DATA_FORMAT; // 7 = AERC, 6 = Obsolete, 5 = NormACA, 4 = HiSup 3-0 = Response data format. (SPC-3 obsoletes AERC) + // If ANSI Version = 0, this is ATAPI and bits 7-4 = ATAPI version. + UInt8 ADDITIONAL_LENGTH; // Number of additional bytes available in inquiry data + UInt8 SCCSReserved; // SCC-2 device flag and reserved fields (SPC-3 adds PROTECT 3PC TPGS, and ACC) + UInt8 flags1; // First byte of support flags (See SPC-3 section 6.4.2) + UInt8 flags2; // Second byte of support flags (Byte 7) (See SPC-3 section 6.4.2) + char VENDOR_IDENTIFICATION[kINQUIRY_VENDOR_IDENTIFICATION_Length]; + char PRODUCT_IDENTIFICATION[kINQUIRY_PRODUCT_IDENTIFICATION_Length]; + char PRODUCT_REVISION_LEVEL[kINQUIRY_PRODUCT_REVISION_LEVEL_Length]; +} SCSICmd_INQUIRY_StandardData; +typedef SCSICmd_INQUIRY_StandardData * SCSICmd_INQUIRY_StandardDataPtr; + + +/*! +@struct SCSICmd_INQUIRY_StandardDataAll +@discussion +This structure defines the all of the fields that can be returned in +repsonse to the INQUIRy request for the standard data. There is no +requirement as to how much of the additional data must be returned by a device. +*/ +typedef struct SCSICmd_INQUIRY_StandardDataAll +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 RMB; // 7 = removable + UInt8 VERSION; // 7/6 = ISO/IEC, 5-3 = ECMA, 2-0 = ANSI. + UInt8 RESPONSE_DATA_FORMAT; // 7 = AERC, 6 = Obsolete, 5 = NormACA, 4 = HiSup 3-0 = Response data format. + // If ANSI Version = 0, this is ATAPI and bits 7-4 = ATAPI version. + UInt8 ADDITIONAL_LENGTH; // Number of additional bytes available in inquiry data + UInt8 SCCSReserved; // SCC-2 device flag and reserved fields + UInt8 flags1; // First byte of support flags (Byte 6) + UInt8 flags2; // Second byte of support flags (Byte 7) + char VENDOR_IDENTIFICATION[kINQUIRY_VENDOR_IDENTIFICATION_Length]; + char PRODUCT_IDENTIFICATION[kINQUIRY_PRODUCT_IDENTIFICATION_Length]; + char PRODUCT_REVISION_LEVEL[kINQUIRY_PRODUCT_REVISION_LEVEL_Length]; + + // Following is the optional data that may be returned by a device. + UInt8 VendorSpecific1[20]; + UInt8 flags3; // Third byte of support flags, mainly SPI-3 (Byte 56) + UInt8 Reserved1; + UInt16 VERSION_DESCRIPTOR[8]; + UInt8 Reserved2[22]; + UInt8 VendorSpecific2[160]; +} SCSICmd_INQUIRY_StandardDataAll; + + +/*! +@enum Peripheral Qualifier +@discussion +Inquiry Peripheral Qualifier definitions +@constant kINQUIRY_PERIPHERAL_QUALIFIER_Connected +Peripheral Device is connected. +@constant kINQUIRY_PERIPHERAL_QUALIFIER_SupportedButNotConnected +Peripheral Device is supported, but not connected. +@constant kINQUIRY_PERIPHERAL_QUALIFIER_NotSupported +Peripheral Device is not supported. +@constant kINQUIRY_PERIPHERAL_QUALIFIER_Mask +Mask to use for PERIPHERAL_DEVICE_TYPE field. +*/ +enum +{ + kINQUIRY_PERIPHERAL_QUALIFIER_Connected = 0x00, + kINQUIRY_PERIPHERAL_QUALIFIER_SupportedButNotConnected = 0x20, + kINQUIRY_PERIPHERAL_QUALIFIER_NotSupported = 0x60, + kINQUIRY_PERIPHERAL_QUALIFIER_Mask = 0xE0 +}; + + +/*! +@enum Peripheral Device types +@discussion +Inquiry Peripheral Device type definitions +@constant kINQUIRY_PERIPHERAL_TYPE_DirectAccessSBCDevice +SBC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_SequentialAccessSSCDevice +Sequential Access (Tape) SSC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_PrinterSSCDevice +SSC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_ProcessorSPCDevice +SPC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_WriteOnceSBCDevice +SBC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_CDROM_MMCDevice +MMC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_ScannerSCSI2Device +SCSI2 Device. +@constant kINQUIRY_PERIPHERAL_TYPE_OpticalMemorySBCDevice +SBC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_MediumChangerSMCDevice +SMC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_CommunicationsSSCDevice +Comms SSC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_StorageArrayControllerSCC2Device +SCC2 Device. +@constant kINQUIRY_PERIPHERAL_TYPE_EnclosureServicesSESDevice +SES Device. +@constant kINQUIRY_PERIPHERAL_TYPE_SimplifiedDirectAccessRBCDevice +RBC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_OpticalCardReaderOCRWDevice +OCRW Device. +@constant kINQUIRY_PERIPHERAL_TYPE_ObjectBasedStorageDevice +OSD device. +@constant kINQUIRY_PERIPHERAL_TYPE_AutomationDriveInterface +Automation Drive Interface device. +@constant kINQUIRY_PERIPHERAL_TYPE_WellKnownLogicalUnit +Well known logical unit. +@constant kINQUIRY_PERIPHERAL_TYPE_UnknownOrNoDeviceType +Unknown or no device. +@constant kINQUIRY_PERIPHERAL_TYPE_Mask +Mask to use for PERIPHERAL_DEVICE_TYPE field. +*/ +enum +{ + kINQUIRY_PERIPHERAL_TYPE_DirectAccessSBCDevice = 0x00, + kINQUIRY_PERIPHERAL_TYPE_SequentialAccessSSCDevice = 0x01, + kINQUIRY_PERIPHERAL_TYPE_PrinterSSCDevice = 0x02, + kINQUIRY_PERIPHERAL_TYPE_ProcessorSPCDevice = 0x03, + kINQUIRY_PERIPHERAL_TYPE_WriteOnceSBCDevice = 0x04, + kINQUIRY_PERIPHERAL_TYPE_CDROM_MMCDevice = 0x05, + kINQUIRY_PERIPHERAL_TYPE_ScannerSCSI2Device = 0x06, + kINQUIRY_PERIPHERAL_TYPE_OpticalMemorySBCDevice = 0x07, + kINQUIRY_PERIPHERAL_TYPE_MediumChangerSMCDevice = 0x08, + kINQUIRY_PERIPHERAL_TYPE_CommunicationsSSCDevice = 0x09, + /* 0x0A - 0x0B ASC IT8 Graphic Arts Prepress Devices */ + kINQUIRY_PERIPHERAL_TYPE_StorageArrayControllerSCC2Device = 0x0C, + kINQUIRY_PERIPHERAL_TYPE_EnclosureServicesSESDevice = 0x0D, + kINQUIRY_PERIPHERAL_TYPE_SimplifiedDirectAccessRBCDevice = 0x0E, + kINQUIRY_PERIPHERAL_TYPE_OpticalCardReaderOCRWDevice = 0x0F, + /* 0x10 - 0x1E Reserved Device Types */ + kINQUIRY_PERIPHERAL_TYPE_ObjectBasedStorageDevice = 0x11, + kINQUIRY_PERIPHERAL_TYPE_AutomationDriveInterface = 0x12, + kINQUIRY_PERIPHERAL_TYPE_WellKnownLogicalUnit = 0x1E, + kINQUIRY_PERIPHERAL_TYPE_UnknownOrNoDeviceType = 0x1F, + + + kINQUIRY_PERIPHERAL_TYPE_Mask = 0x1F +}; + + +/*! +@enum Removable Bit field definitions +@discussion +Inquiry Removable Bit field definitions +@constant kINQUIRY_PERIPHERAL_RMB_MediumFixed +Medium type is fixed disk. +@constant kINQUIRY_PERIPHERAL_RMB_MediumRemovable +Medium type is removable disk. +@constant kINQUIRY_PERIPHERAL_RMB_BitMask +Mask to use for RMB field. +*/ +enum +{ + kINQUIRY_PERIPHERAL_RMB_MediumFixed = 0x00, + kINQUIRY_PERIPHERAL_RMB_MediumRemovable = 0x80, + kINQUIRY_PERIPHERAL_RMB_BitMask = 0x80 +}; + + +/*! +@enum Version field definitions +@discussion +Definitions for bits/masks in the INQUIRY Version field. +@constant kINQUIRY_ISO_IEC_VERSION_Mask +Mask for valid bits for ISO/IEC Version. +@constant kINQUIRY_ECMA_VERSION_Mask +Mask for valid bits for ECMA Version. +@constant kINQUIRY_ANSI_VERSION_NoClaimedConformance +No ANSI conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_1_Compliant +SCSI-1 conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_2_Compliant +SCSI-2 conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant +SPC conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_SPC_2_Compliant +SPC-2 conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_SPC_3_Compliant +SPC-3 conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_Mask +Mask for valid bits for ANSI Version. +*/ +enum +{ + kINQUIRY_ISO_IEC_VERSION_Mask = 0xC0, + + kINQUIRY_ECMA_VERSION_Mask = 0x38, + + kINQUIRY_ANSI_VERSION_NoClaimedConformance = 0x00, + kINQUIRY_ANSI_VERSION_SCSI_1_Compliant = 0x01, + kINQUIRY_ANSI_VERSION_SCSI_2_Compliant = 0x02, + kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant = 0x03, + kINQUIRY_ANSI_VERSION_SCSI_SPC_2_Compliant = 0x04, + kINQUIRY_ANSI_VERSION_SCSI_SPC_3_Compliant = 0x05, + kINQUIRY_ANSI_VERSION_Mask = 0x07 +}; + + +/*! +@enum Response Data Format field definitions +@discussion +Definitions for bits/masks in the INQUIRY RESPONSE_DATA_FORMAT field. +@constant kINQUIRY_Byte3_HISUP_Bit +HISUP bit definition. +@constant kINQUIRY_Byte3_NORMACA_Bit +NORMACA bit definition. +@constant kINQUIRY_Byte3_AERC_Bit +AERC bit definition. +@constant kINQUIRY_RESPONSE_DATA_FORMAT_Mask +Mask for valid bits for RESPONSE_DATA_FORMAT. +@constant kINQUIRY_Byte3_HISUP_Mask +Mask to use to test the HISUP bit. +@constant kINQUIRY_Byte3_NORMACA_Mask +Mask to use to test the NORMACA bit. +@constant kINQUIRY_Byte3_AERC_Mask +Mask to use to test the AERC bit. +*/ +enum +{ + // Bit definitions + // Bits 0-3: RESPONSE DATA FORMAT + kINQUIRY_Byte3_HISUP_Bit = 4, + kINQUIRY_Byte3_NORMACA_Bit = 5, + // Bit 6 is Obsolete + kINQUIRY_Byte3_AERC_Bit = 7, + + // Masks + kINQUIRY_RESPONSE_DATA_FORMAT_Mask = 0x0F, // Bits 0-3 + kINQUIRY_Byte3_HISUP_Mask = (1 << kINQUIRY_Byte3_HISUP_Bit), + kINQUIRY_Byte3_NORMACA_Mask = (1 << kINQUIRY_Byte3_NORMACA_Bit), + // Bit 6 is Obsolete + kINQUIRY_Byte3_AERC_Mask = (1 << kINQUIRY_Byte3_AERC_Bit) +}; + + +/*! +@enum SCCS field definitions +@discussion +Definitions for bits/masks in the INQUIRY SCCSReserved field. +@constant kINQUIRY_Byte5_SCCS_Bit +SCCS bit definition. +@constant kINQUIRY_Byte5_ACC_Bit +ACC bit definition. +@constant kINQUIRY_Byte5_ExplicitTPGS_Bit +Explicit TPGS bit definition. +@constant kINQUIRY_Byte5_ImplicitTPGS_Bit +Implicit TPGS bit definition. +@constant kINQUIRY_Byte5_3PC_Bit +3PC bit definition. +@constant kINQUIRY_Byte5_PROTECT_Bit +PROTECT bit definition. +@constant kINQUIRY_Byte5_SCCS_Mask +Mask to use to test the SCCS bit. +@constant kINQUIRY_Byte5_ACC_Mask +Mask to use to test the ACC bit. +@constant kINQUIRY_Byte5_ExplicitTPGS_Mask +Mask to use for the Explicit TPGS bits. +@constant kINQUIRY_Byte5_ImplicitTPGS_Mask +Mask to use for the Implicit TPGS bits. +@constant kINQUIRY_Byte5_3PC_Mask +Mask to use to test the 3PC bit. +@constant kINQUIRY_Byte5_PROTECT_Mask +Mask to use to test the PROTECT bit. +*/ +enum +{ + // Bit definitions + kINQUIRY_Byte5_SCCS_Bit = 7, + kINQUIRY_Byte5_ACC_Bit = 6, + kINQUIRY_Byte5_ExplicitTPGS_Bit = 5, + kINQUIRY_Byte5_ImplicitTPGS_Bit = 4, + kINQUIRY_Byte5_3PC_Bit = 3, + // Bits 1-2: Reserved + kINQUIRY_Byte5_PROTECT_Bit = 0, + + // Masks + kINQUIRY_Byte5_SCCS_Mask = (1 << kINQUIRY_Byte5_SCCS_Bit), + kINQUIRY_Byte5_ACC_Mask = (1 << kINQUIRY_Byte5_ACC_Bit), + kINQUIRY_Byte5_ExplicitTPGS_Mask = (1 << kINQUIRY_Byte5_ExplicitTPGS_Bit), + kINQUIRY_Byte5_ImplicitTPGS_Mask = (1 << kINQUIRY_Byte5_ImplicitTPGS_Bit), + + kINQUIRY_Byte5_3PC_Mask = (1 << kINQUIRY_Byte5_3PC_Bit), + // Bits 1-2: Reserved + kINQUIRY_Byte5_PROTECT_Mask = (1 << kINQUIRY_Byte5_PROTECT_Bit) +}; + + +/*! +@enum flags1 field definitions +@discussion +Definitions for bits/masks in the INQUIRY flags1 field. +@constant kINQUIRY_Byte6_ADDR16_Bit +ADDR16 bit definition. +@constant kINQUIRY_Byte6_MCHNGR_Bit +MCHNGR bit definition. +@constant kINQUIRY_Byte6_MULTIP_Bit +MULTIP bit definition. +@constant kINQUIRY_Byte6_VS_Bit +VS bit definition. +@constant kINQUIRY_Byte6_ENCSERV_Bit +ENCSERV bit definition. +@constant kINQUIRY_Byte6_BQUE_Bit +BQUE bit definition. +@constant kINQUIRY_Byte6_ADDR16_Mask +Mask to use to test the ADDR16 bit. +@constant kINQUIRY_Byte6_MCHNGR_Mask +Mask to use to test the MCHNGR bit. +@constant kINQUIRY_Byte6_MULTIP_Mask +Mask to use to test the MULTIP bit. +@constant kINQUIRY_Byte6_VS_Mask +Mask to use to test the VS bit. +@constant kINQUIRY_Byte6_ENCSERV_Mask +Mask to use to test the ENCSERV bit. +@constant kINQUIRY_Byte6_BQUE_Mask +Mask to use to test the BQUE bit. +*/ +enum +{ + // Byte offset + kINQUIRY_Byte6_Offset = 6, + + // Bit definitions + kINQUIRY_Byte6_ADDR16_Bit = 0, // SPI Specific + // Bit 1 is Obsolete + // Bit 2 is Obsolete + kINQUIRY_Byte6_MCHNGR_Bit = 3, + kINQUIRY_Byte6_MULTIP_Bit = 4, + kINQUIRY_Byte6_VS_Bit = 5, + kINQUIRY_Byte6_ENCSERV_Bit = 6, + kINQUIRY_Byte6_BQUE_Bit = 7, + + // Masks + kINQUIRY_Byte6_ADDR16_Mask = (1 << kINQUIRY_Byte6_ADDR16_Bit), // SPI Specific + // Bit 1 is Obsolete + // Bit 2 is Obsolete + kINQUIRY_Byte6_MCHNGR_Mask = (1 << kINQUIRY_Byte6_MCHNGR_Bit), + kINQUIRY_Byte6_MULTIP_Mask = (1 << kINQUIRY_Byte6_MULTIP_Bit), + kINQUIRY_Byte6_VS_Mask = (1 << kINQUIRY_Byte6_VS_Bit), + kINQUIRY_Byte6_ENCSERV_Mask = (1 << kINQUIRY_Byte6_ENCSERV_Bit), + kINQUIRY_Byte6_BQUE_Mask = (1 << kINQUIRY_Byte6_BQUE_Bit) +}; + + +/*! +@enum flags2 field definitions +@discussion +Definitions for bits/masks in the INQUIRY flags2 field. +@constant kINQUIRY_Byte7_VS_Bit +VS bit definition. +@constant kINQUIRY_Byte7_CMDQUE_Bit +CMDQUE bit definition. +@constant kINQUIRY_Byte7_TRANDIS_Bit +TRANDIS bit definition. +@constant kINQUIRY_Byte7_LINKED_Bit +LINKED bit definition. +@constant kINQUIRY_Byte7_SYNC_Bit +SYNC bit definition. +@constant kINQUIRY_Byte7_WBUS16_Bit +WBUS16 bit definition. +@constant kINQUIRY_Byte7_RELADR_Bit +RELADR bit definition. +@constant kINQUIRY_Byte7_VS_Mask +Mask to use to test the VS bit. +@constant kINQUIRY_Byte7_CMDQUE_Mask +Mask to use to test the CMDQUE bit. +@constant kINQUIRY_Byte7_TRANDIS_Mask +Mask to use to test the TRANDIS bit. +@constant kINQUIRY_Byte7_LINKED_Mask +Mask to use to test the LINKED bit. +@constant kINQUIRY_Byte7_SYNC_Mask +Mask to use to test the SYNC bit. +@constant kINQUIRY_Byte7_WBUS16_Mask +Mask to use to test the WBUS16 bit. +@constant kINQUIRY_Byte7_RELADR_Mask +Mask to use to test the RELADR bit. +*/ +enum +{ + // Byte offset + kINQUIRY_Byte7_Offset = 7, + + // Bit definitions + kINQUIRY_Byte7_VS_Bit = 0, + kINQUIRY_Byte7_CMDQUE_Bit = 1, + kINQUIRY_Byte7_TRANDIS_Bit = 2, // SPI Specific + kINQUIRY_Byte7_LINKED_Bit = 3, + kINQUIRY_Byte7_SYNC_Bit = 4, // SPI Specific + kINQUIRY_Byte7_WBUS16_Bit = 5, // SPI Specific + // Bit 6 is Obsolete + kINQUIRY_Byte7_RELADR_Bit = 7, + + // Masks + kINQUIRY_Byte7_VS_Mask = (1 << kINQUIRY_Byte7_VS_Bit), + kINQUIRY_Byte7_CMDQUE_Mask = (1 << kINQUIRY_Byte7_CMDQUE_Bit), + kINQUIRY_Byte7_TRANDIS_Mask = (1 << kINQUIRY_Byte7_TRANDIS_Bit),// SPI Specific + kINQUIRY_Byte7_LINKED_Mask = (1 << kINQUIRY_Byte7_LINKED_Bit), + kINQUIRY_Byte7_SYNC_Mask = (1 << kINQUIRY_Byte7_SYNC_Bit), // SPI Specific + kINQUIRY_Byte7_WBUS16_Mask = (1 << kINQUIRY_Byte7_WBUS16_Bit), // SPI Specific + // Bit 6 is Obsolete + kINQUIRY_Byte7_RELADR_Mask = (1 << kINQUIRY_Byte7_RELADR_Bit) +}; + + +/*! +@enum Byte 56 features field definitions +@discussion +Definitions for bits/masks in the INQUIRY Byte 56 field. +Inquiry Byte 56 features (for devices that report an ANSI VERSION of +kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant or later). +These are SPI-3 Specific. +@constant kINQUIRY_Byte56_IUS_Bit +IUS bit definition. +@constant kINQUIRY_Byte56_QAS_Bit +QAS bit definition. +@constant kINQUIRY_Byte56_IUS_Mask +Mask to use to test the IUS bit. +@constant kINQUIRY_Byte56_QAS_Mask +Mask to use to test the QAS bit. +@constant kINQUIRY_Byte56_CLOCKING_Mask +Mask to use to test CLOCKING bits. +@constant kINQUIRY_Byte56_CLOCKING_ONLY_ST +Single-transition clocking only. +@constant kINQUIRY_Byte56_CLOCKING_ONLY_DT +Double-transition clocking only. +@constant kINQUIRY_Byte56_CLOCKING_ST_AND_DT +Single-transition and double-transition clocking. +*/ +enum +{ + // Byte offset + kINQUIRY_Byte56_Offset = 56, + + // Bit definitions + kINQUIRY_Byte56_IUS_Bit = 0, + kINQUIRY_Byte56_QAS_Bit = 1, + // Bits 2 and 3 are the CLOCKING bits + // All other bits are reserved + + kINQUIRY_Byte56_IUS_Mask = (1 << kINQUIRY_Byte56_IUS_Bit), + kINQUIRY_Byte56_QAS_Mask = (1 << kINQUIRY_Byte56_QAS_Bit), + kINQUIRY_Byte56_CLOCKING_Mask = 0x0C, + + // Definitions for the CLOCKING bits + kINQUIRY_Byte56_CLOCKING_ONLY_ST = 0x00, + kINQUIRY_Byte56_CLOCKING_ONLY_DT = 0x04, + // kINQUIRY_Byte56_CLOCKING_RESERVED = 0x08, + kINQUIRY_Byte56_CLOCKING_ST_AND_DT = 0x0C +}; + + +/*! +@define kINQUIRY_VERSION_DESCRIPTOR_MaxCount +Maximum number of INQUIRY version descriptors supported. +*/ +#define kINQUIRY_VERSION_DESCRIPTOR_MaxCount 8 + + +/*! +@enum kINQUIRY_VERSION_DESCRIPTOR_SAT +SAT specification version descriptor. +*/ +enum +{ + kINQUIRY_VERSION_DESCRIPTOR_SAT = 0x1EA0 +}; + +/*! + @enum kINQUIRY_VERSION_DESCRIPTOR_NVME + NVMe specification version descriptor. + */ +enum +{ + kINQUIRY_VERSION_DESCRIPTOR_NVME = 0x8080 +}; + + +/* +IORegistry property names for information derived from the Inquiry data. +The Peripheral Device Type is the only property that the +generic Logical Unit Drivers will use to match. These properties are +listed in order of matching priority. First is the Peripheral Device Type. +Second is the Vendor Identification. Third is the Product Identification. +Last is the Product Revision Level. To match a particular product, you would +specify the Peripheral Device Type, Vendor Identification, and Product +Identification. To restrict the match to a particular firmware revision, you +would add the Product Revision Level. To not match on a particular product, +but on a particular vendor's products, you would only include the +Peripheral Device Type and the Vendor Identification. +*/ + +/*! +@define kIOPropertySCSIPeripheralDeviceType +SCSI Peripheral Device Type as reported in the INQUIRY data. +*/ +#define kIOPropertySCSIPeripheralDeviceType "Peripheral Device Type" + +/*! +@define kIOPropertySCSIPeripheralDeviceTypeSize +Size of the kIOPropertySCSIPeripheralDeviceType key. +*/ +#define kIOPropertySCSIPeripheralDeviceTypeSize 8 + +/*! +@define kIOPropertyTPGSInfo +TPGS Info as reported in the INQUIRY data. +*/ +#define kIOPropertyTPGSInfo "TPGS Information" + +/*! +@define kIOPropertyHiSup +Hierarchical LUN Support as reported in the INQUIRY data. +*/ +#define kIOPropertyHiSup "Hierarchical LUN Support" + +/*! +@define kIOPropertyTPGSInfoSize +Size of the kIOPropertyTPGSInfo key. +*/ +#define kIOPropertyTPGSInfoSize 8 + +/* These properties are listed in order of matching priority */ + +/*! +@define kIOPropertySCSIVendorIdentification +Vendor ID as reported in the INQUIRY data. Additional space characters (0x20) +are truncated. +*/ +#define kIOPropertySCSIVendorIdentification "Vendor Identification" + +/*! +@define kIOPropertySCSIProductIdentification +Product ID as reported in the INQUIRY data. Additional space characters (0x20) +are truncated. +*/ +#define kIOPropertySCSIProductIdentification "Product Identification" + +/*! +@define kIOPropertySCSIProductRevisionLevel +Product Revision Level as reported in the INQUIRY data. +*/ +#define kIOPropertySCSIProductRevisionLevel "Product Revision Level" + +#ifndef __OPEN_SOURCE__ + +/*! +@enum INQUIRY Page Codes +@discussion INQUIRY Page Codes to be used when EVPD is set in the +INQUIRY command. +@constant kINQUIRY_Page00_PageCode +Page Code 00h. +@constant kINQUIRY_Page80_PageCode +Page Code 80h. +@constant kINQUIRY_Page83_PageCode +Page Code 83h. +@constant kINQUIRY_Page89_PageCode +Page Code 89h. +@constant kINQUIRY_PageB0_PageCode +Page Code B0h. +@constant kINQUIRY_PageB1_PageCode +Page Code B1h. +@constant kINQUIRY_PageB2_PageCode +Page Code B2h. +@constant kINQUIRY_PageC0_PageCode +Page Code C0h. +@constant kINQUIRY_PageC1_PageCode +Page Code C1h. +*/ +enum +{ + kINQUIRY_Page00_PageCode = 0x00, + kINQUIRY_Page80_PageCode = 0x80, + kINQUIRY_Page83_PageCode = 0x83, + kINQUIRY_Page89_PageCode = 0x89, + kINQUIRY_PageB0_PageCode = 0xB0, + kINQUIRY_PageB1_PageCode = 0xB1, + kINQUIRY_PageB2_PageCode = 0xB2, + kINQUIRY_PageC0_PageCode = 0xC0, + kINQUIRY_PageC1_PageCode = 0xC1 +}; + +#else + +/*! + @enum INQUIRY Page Codes + @discussion INQUIRY Page Codes to be used when EVPD is set in the + INQUIRY command. + @constant kINQUIRY_Page00_PageCode + Page Code 00h. + @constant kINQUIRY_Page80_PageCode + Page Code 80h. + @constant kINQUIRY_Page83_PageCode + Page Code 83h. + @constant kINQUIRY_Page89_PageCode + Page Code 89h. + @constant kINQUIRY_PageB0_PageCode + Page Code B0h. + @constant kINQUIRY_PageB1_PageCode + Page Code B1h. + @constant kINQUIRY_PageB2_PageCode + Page Code B2h. + */ +enum +{ + kINQUIRY_Page00_PageCode = 0x00, + kINQUIRY_Page80_PageCode = 0x80, + kINQUIRY_Page83_PageCode = 0x83, + kINQUIRY_Page89_PageCode = 0x89, + kINQUIRY_PageB0_PageCode = 0xB0, + kINQUIRY_PageB1_PageCode = 0xB1, + kINQUIRY_PageB2_PageCode = 0xB2, +}; + +#endif /* __OPEN_SOURCE__ */ + + +/*! +@struct SCSICmd_INQUIRY_Page00_Header +@discussion INQUIRY Page 00h Header. +*/ +typedef struct SCSICmd_INQUIRY_Page00_Header +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 00h + UInt8 RESERVED; // reserved field + UInt8 PAGE_LENGTH; // n-3 bytes +} SCSICmd_INQUIRY_Page00_Header; + + +/*! +@struct SCSICmd_INQUIRY_Page00_Header_SPC_16 +@discussion INQUIRY Page 00h Header. +*/ +typedef struct SCSICmd_INQUIRY_Page00_Header_SPC_16 +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 00h + UInt16 PAGE_LENGTH; // n-3 bytes +} SCSICmd_INQUIRY_Page00_Header_SPC_16; + +/*! +@struct SCSICmd_INQUIRY_Page80_Header +@discussion INQUIRY Page 80h Header. +*/ +typedef struct SCSICmd_INQUIRY_Page80_Header +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 80h + UInt8 RESERVED; // reserved field + UInt8 PAGE_LENGTH; // n-3 bytes + UInt8 PRODUCT_SERIAL_NUMBER; // 4-n +} SCSICmd_INQUIRY_Page80_Header; + + +/*! +@struct SCSICmd_INQUIRY_Page80_Header_SPC_16 +@discussion INQUIRY Page 80h Header with 16 bytes INQUIRY Command. +*/ +typedef struct SCSICmd_INQUIRY_Page80_Header_SPC_16 +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 80h + UInt16 PAGE_LENGTH; // n-3 bytes + UInt8 PRODUCT_SERIAL_NUMBER; // 4-n +} SCSICmd_INQUIRY_Page80_Header_SPC_16; + + +/*! +@define kIOPropertySCSIINQUIRYUnitSerialNumber +Key that describes the INQUIRY Unit Serial Number in the IORegistry. +*/ +#define kIOPropertySCSIINQUIRYUnitSerialNumber "INQUIRY Unit Serial Number" + + +/*! +@struct SCSICmd_INQUIRY_Page83_Header +@discussion INQUIRY Page 83h Header. +*/ +typedef struct SCSICmd_INQUIRY_Page83_Header +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 83h + UInt8 RESERVED; // reserved field + UInt8 PAGE_LENGTH; // n-3 bytes +} SCSICmd_INQUIRY_Page83_Header; + + +/*! +@struct SCSICmd_INQUIRY_Page83_Header_SPC_16 +@discussion INQUIRY Page 83h Header used with the 16 byte INQUIRY command. +*/ +typedef struct SCSICmd_INQUIRY_Page83_Header_SPC_16 +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 83h + UInt16 PAGE_LENGTH; // n-3 bytes +} SCSICmd_INQUIRY_Page83_Header_SPC_16; + + +/*! +@struct SCSICmd_INQUIRY_Page83_Identification_Descriptor +@discussion INQUIRY Page 83h Identification Descriptor. +*/ +typedef struct SCSICmd_INQUIRY_Page83_Identification_Descriptor +{ + UInt8 CODE_SET; // 7-4 = Protocol Identifier. 3-0 = Code Set + UInt8 IDENTIFIER_TYPE; // 7 = PIV 5-4 = ASSOCIATION 3-0 = Identifier + UInt8 RESERVED; + UInt8 IDENTIFIER_LENGTH; + UInt8 IDENTIFIER; +} SCSICmd_INQUIRY_Page83_Identification_Descriptor; + + +/*! +@enum INQUIRY Page 83h Code Set +@discussion +Definitions for the Code Set field. +@constant kINQUIRY_Page83_CodeSetBinaryData +The identifier contains binary data. +@constant kINQUIRY_Page83_CodeSetASCIIData +The identifier contains ASCII data. +@constant kINQUIRY_Page83_CodeSetUTF8Data +The identifier contains UTF-8 data. +*/ +enum +{ + kINQUIRY_Page83_CodeSetReserved = 0x0, + kINQUIRY_Page83_CodeSetBinaryData = 0x1, + kINQUIRY_Page83_CodeSetASCIIData = 0x2, + kINQUIRY_Page83_CodeSetUTF8Data = 0x3, + // 0x4 - 0xF reserved + kINQUIRY_Page83_CodeSetMask = 0xF +}; + + +/*! +@enum INQUIRY Page 83h Association +@discussion +Definitions for the Association field. +@constant kINQUIRY_Page83_AssociationLogicalUnit +Association of the identifier is with the logical unit. +@constant kINQUIRY_Page83_AssociationDevice +Association of the identifier is with the device (same as logical unit in SPC-2). +@constant kINQUIRY_Page83_AssociationTargetPort +Association of the identifier is with the target port. +@constant kINQUIRY_Page83_AssociationTargetDevice +Association of the identifier is with the target device (i.e. all ports). +@constant kINQUIRY_Page83_AssociationMask +Mask to use to determine association. +*/ +enum +{ + // SPC-3 - Association is changed to be specific to + // Logical Units + kINQUIRY_Page83_AssociationLogicalUnit = 0x00, + + // Backwards compatibility for SPC-2 + kINQUIRY_Page83_AssociationDevice = kINQUIRY_Page83_AssociationLogicalUnit, + + // Association is related to a Target Port + kINQUIRY_Page83_AssociationTargetPort = 0x10, + + // SPC-3 - Added as specific association to + // a Target device. + kINQUIRY_Page83_AssociationTargetDevice = 0x20, + + kINQUIRY_Page83_AssociationMask = 0x30, + kINQUIRY_Page83_AssociationShift = 4 +}; + + +/*! +@enum INQUIRY Page 83h Identifier Type +@discussion +Definitions for the Identifier Type field. +@constant kINQUIRY_Page83_IdentifierTypeVendorSpecific +Vendor Specific Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeVendorID +Vendor Specific Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeIEEE_EUI64 +EUI-64 Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeNAAIdentifier +NAA Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeRelativePortIdentifier +Relative Target Port Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeTargetPortGroup +Target Port Group Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeLogicalUnitGroup +Logical Unit Group Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeMD5LogicalUnitIdentifier +MD5 Logical Unit Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeSCSINameString +SCSI Name String Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeMask +Mask to use to determine association. +@constant kINQUIRY_Page83_ProtocolIdentifierValidBit +PIV Bit definition. +@constant kINQUIRY_Page83_ProtocolIdentifierValidMask +Mask to use to determine if PIV is set. +*/ +enum +{ + kINQUIRY_Page83_IdentifierTypeVendorSpecific = 0, + kINQUIRY_Page83_IdentifierTypeVendorID = 1, + kINQUIRY_Page83_IdentifierTypeIEEE_EUI64 = 2, + kINQUIRY_Page83_IdentifierTypeNAAIdentifier = 3, + kINQUIRY_Page83_IdentifierTypeRelativePortIdentifier = 4, + kINQUIRY_Page83_IdentifierTypeTargetPortGroup = 5, + kINQUIRY_Page83_IdentifierTypeLogicalUnitGroup = 6, + kINQUIRY_Page83_IdentifierTypeMD5LogicalUnitIdentifier = 7, + kINQUIRY_Page83_IdentifierTypeSCSINameString = 8, + // 0x9 - 0xF Reserved + + kINQUIRY_Page83_IdentifierTypeMask = 0xF, + + kINQUIRY_Page83_ProtocolIdentifierValidBit = 7, + kINQUIRY_Page83_ProtocolIdentifierValidMask = (1 << kINQUIRY_Page83_ProtocolIdentifierValidBit) + +}; + +// Backwards compatibility +#define kINQUIRY_Page83_IdentifierTypeFCNameIdentifier kINQUIRY_Page83_IdentifierTypeNAAIdentifier +#define kINQUIRY_Page83_IdentifierTypeUndefined kINQUIRY_Page83_IdentifierTypeVendorSpecific + + +/*! +@enum Protocol Identifier values +@discussion +Definitions for the protocol identifier values. +@constant kSCSIProtocolIdentifier_FibreChannel +FibreChannel Protocol Identifier. +@constant kSCSIProtocolIdentifier_ParallelSCSI +Parallel SCSI Protocol Identifier. +@constant kSCSIProtocolIdentifier_SSA +SSA Protocol Identifier. +@constant kSCSIProtocolIdentifier_FireWire +FireWire (IEEE-1394) Protocol Identifier. +@constant kSCSIProtocolIdentifier_RDMA +RDMA Protocol Identifier. +@constant kSCSIProtocolIdentifier_iSCSI +iSCSI Protocol Identifier. +@constant kSCSIProtocolIdentifier_SAS +SAS Protocol Identifier. +@constant kSCSIProtocolIdentifier_ADT +ADT Protocol Identifier. +@constant kSCSIProtocolIdentifier_ATAPI +ATAPI Protocol Identifier. +@constant kSCSIProtocolIdentifier_None +No Protocol Identifier. +*/ +enum +{ + kSCSIProtocolIdentifier_FibreChannel = 0, + kSCSIProtocolIdentifier_ParallelSCSI = 1, + kSCSIProtocolIdentifier_SSA = 2, + kSCSIProtocolIdentifier_FireWire = 3, + kSCSIProtocolIdentifier_RDMA = 4, + kSCSIProtocolIdentifier_iSCSI = 5, + kSCSIProtocolIdentifier_SAS = 6, + kSCSIProtocolIdentifier_ADT = 7, + kSCSIProtocolIdentifier_ATAPI = 8, + // 0x9-0xE Reserved + kSCSIProtocolIdentifier_None = 0xF +}; + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdentification +Device Identification key. +*/ +#define kIOPropertySCSIINQUIRYDeviceIdentification "INQUIRY Device Identification" + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdCodeSet +Code Set type key. +*/ +#define kIOPropertySCSIINQUIRYDeviceIdCodeSet "Code Set" + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdType +Identifier Type key. +*/ +#define kIOPropertySCSIINQUIRYDeviceIdType "Identifier Type" + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdAssociation +Association key. +*/ +#define kIOPropertySCSIINQUIRYDeviceIdAssociation "Association" + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdentifier +Identifier key (data or string). +*/ +#define kIOPropertySCSIINQUIRYDeviceIdentifier "Identifier" + + + + +/*! +@struct SCSICmd_INQUIRY_Page83_RelativeTargetPort_Identifier +@discussion INQUIRY Page 83h Relative Target Port Identifier. +*/ +typedef struct SCSICmd_INQUIRY_Page83_RelativeTargetPort_Identifier +{ + UInt16 OBSOLETE; + UInt16 RELATIVE_TARGET_PORT_IDENTIFIER; +} SCSICmd_INQUIRY_Page83_RelativeTargetPort_Identifier; + + +/*! +@struct SCSICmd_INQUIRY_Page83_TargetPortGroup_Identifier +@discussion INQUIRY Page 83h Target Port Group Identifier. +*/ +typedef struct SCSICmd_INQUIRY_Page83_TargetPortGroup_Identifier +{ + UInt16 RESERVED; + UInt16 TARGET_PORT_GROUP; +} SCSICmd_INQUIRY_Page83_TargetPortGroup_Identifier; + + +/*! +@struct SCSICmd_INQUIRY_Page83_LogicalUnitGroup_Identifier +@discussion INQUIRY Page 83h Logical Unit Group Identifier. +*/ +typedef struct SCSICmd_INQUIRY_Page83_LogicalUnitGroup_Identifier +{ + UInt16 RESERVED; + UInt16 LOGICAL_UNIT_GROUP; +} SCSICmd_INQUIRY_Page83_LogicalUnitGroup_Identifier; + + +/*! +@struct SCSICmd_INQUIRY_Page89_Data +@discussion INQUIRY Page 89h data as defined in the SAT 1.0 +specification. This section contains all structures and +definitions used by the INQUIRY command in response to a request +for page 89h - ATA information VPD Page. +*/ +typedef struct SCSICmd_INQUIRY_Page89_Data +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 89h + UInt16 PAGE_LENGTH; // Must be equal to 238h + UInt32 Reserved; + UInt8 SAT_VENDOR_IDENTIFICATION[kINQUIRY_VENDOR_IDENTIFICATION_Length]; + UInt8 SAT_PRODUCT_IDENTIFICATION[kINQUIRY_PRODUCT_IDENTIFICATION_Length]; + UInt8 SAT_PRODUCT_REVISION_LEVEL[kINQUIRY_PRODUCT_REVISION_LEVEL_Length]; + UInt8 ATA_DEVICE_SIGNATURE[20]; + UInt8 COMMAND_CODE; + UInt8 Reserved2[3]; + UInt8 IDENTIFY_DATA[512]; +} SCSICmd_INQUIRY_Page89_Data; + +#pragma pack(push, 1) + +/*! + @struct SCSICmd_INQUIRY_PageB0_Data + @discussion INQUIRY Page B0h data as defined in the SBC + specification. This section contains all structures and + definitions used by the INQUIRY command in response to a request + for page B0h - Block Limits VPD Page. + */ +typedef struct SCSICmd_INQUIRY_PageB0_Data +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to B0h + UInt16 PAGE_LENGTH; // Must be equal to 3Ch + UInt8 WSNZ; // 0 = WSNZ, 7-1 = Reserved. + UInt8 MAXIMUM_COMPARE_AND_WRITE_LENGTH; + UInt16 OPTIMAL_TRANSFER_LENGTH_GRANULARITY; + UInt32 MAXIMUM_TRANSFER_LENGTH; + UInt32 OPTIMAL_TRANSFER_LENGTH; + UInt32 MAXIMUM_PREFETCH_LENGTH; + UInt32 MAXIMUM_UNMAP_LBA_COUNT; + UInt32 MAXIMUM_UNMAP_BLOCK_DESCRIPTOR_COUNT; + UInt32 OPTIMAL_UNMAP_GRANULARITY; + UInt32 UNMAP_GRANULARITY_ALIGNMENT; + UInt64 MAXIMUM_WRITE_SAME_LENGTH; + UInt32 MAXIMUM_ATOMIC_TRANSFER_LENGTH; + UInt32 ATOMIC_ALIGNMENT; + UInt32 ATOMIC_TRANSFER_LENGTH_GRANULARITY; + UInt32 MAXIMUM_ATOMIC_TRANSFER_LENGTH_WITH_ATOMIC_BOUNDARY; + UInt32 MAXIMUM_ATOMIC_BOUNDARY_SIZE; +} SCSICmd_INQUIRY_PageB0_Data; + +#pragma pack(pop) + +/*! +@struct SCSICmd_INQUIRY_PageB1_Data +@discussion INQUIRY Page B1h data as defined in the SBC +specification. This section contains all structures and +definitions used by the INQUIRY command in response to a request +for page B1h - Block Device Characteristics VPD Page. +*/ +typedef struct SCSICmd_INQUIRY_PageB1_Data +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to B1h + UInt8 Reserved; + UInt8 PAGE_LENGTH; // Must be equal to 3Ch + UInt16 MEDIUM_ROTATION_RATE; + UInt8 Reserved2[58]; +} SCSICmd_INQUIRY_PageB1_Data; + +enum +{ + kINQUIRY_PageB1_Page_Length = 0x3C +}; + +#pragma pack(push, 1) + +/*! + @struct SCSICmd_INQUIRY_PageB2_Data + @discussion INQUIRY Page B2h data as defined in the SBC + specification. This section contains all structures and + definitions used by the INQUIRY command in response to a request + for page B2h - Logical Block Provisioning VPD Page. + */ +typedef struct SCSICmd_INQUIRY_PageB2_Data +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to B2h. + UInt16 PAGE_LENGTH; // Must be n-3. + UInt8 THRESHOLD_EXPONENT; + UInt8 LBP_FLAGS; // 7 = LBPU, 6 = LBPWS, 5 = LBPWS10, + // 4-2 = LBPRZ, 1 = ANC_SUP, 0 = DP. + UInt8 MINIMUM_PERCENTAGE; // 7-3 = MINIMUM PERCENTAGE, + // 2-0 = PROVISIONING TYPE. + UInt8 THRESHOLD_PERCENTAGE; +} SCSICmd_INQUIRY_PageB2_Data; + +typedef struct SCSICmd_INQUIRY_PageB2_Provisioning_Group_Descriptor +{ + UInt8 DESIGNATION_DESCRIPTOR[20]; + UInt8 RESERVED[18]; +} SCSICmd_INQUIRY_PageB2_Provisioning_Group_Descriptor; + +#pragma pack(pop) + +#ifndef __OPEN_SOURCE__ + +#pragma pack(push, 1) + +enum +{ + kC0DataMaxStringLen = 32 +}; + +enum +{ + kINQUIRY_PageC0_Features_HasSEP_LUN = ( 1 << 3 ) +}; + +typedef struct SCSICmd_INQUIRY_PageCx_Header +{ + + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to C0h or C1h + UInt8 RESERVED; + UInt8 PAGE_LENGTH; + +} SCSICmd_INQUIRY_PAGECx_Header; + +/*! + @struct SCSICmd_INQUIRY_PageC0_Data + @discussion INQUIRY Page C0h data as defined in Apple Target + Disk Mode specification. This is a vendor specific data structure. + This section contains all structures and definitions used by + the INQUIRY command in response to a request for page C0h. + */ + +typedef struct SCSICmd_INQUIRY_PageC0_Data +{ + + SCSICmd_INQUIRY_PAGECx_Header fHeader; + UInt8 fTdmPageVersion; + UInt8 fTdmProtocolVersion; + UInt8 fReserved1; + UInt8 fReserved2; + UInt8 fMacModelId[kC0DataMaxStringLen]; + UInt8 fSerialNumber[kC0DataMaxStringLen]; + UInt32 fMaxReadSize; + UInt32 fMaxWriteSize; + UInt32 fNativeBlockSize; + UInt32 fPreferredIOSize; + UInt64 fFeatures; + UInt64 fWorkArounds; + UInt16 fEncryptionType; + UInt8 fReserved3[2]; + UInt64 fInstalledRAMSize; + +} SCSICmd_INQUIRY_PageC0_Data; + +/*! + @struct SCSICmd_INQUIRY_PageC1_Data + @discussion INQUIRY Page C1h data as defined in Apple Target + Disk Mode specification. This is a vendor specific data structure. + This section contains all structures and definitions used by + the INQUIRY command in response to a request for page C1h. + */ + +typedef struct SCSICmd_INQUIRY_PageC1_Data +{ + + SCSICmd_INQUIRY_PAGECx_Header fHeader; + UInt8 fTdmPowerRequirementsPageVersion; + UInt8 fReserved1; + UInt16 fReserved2; + UInt32 fPowerRequired; + +} SCSICmd_INQUIRY_PageC1_Data; + +#pragma pack(pop) + +#endif /* __OPEN_SOURCE__ */ + +/*! +@define kIOPropertySATVendorIdentification +Vendor Identification of the SATL. +*/ +#define kIOPropertySATVendorIdentification "SAT Vendor Identification" + + +/*! +@define kIOPropertySATProductIdentification +Product Identification of the SATL. +*/ +#define kIOPropertySATProductIdentification "SAT Product Identification" + + +/*! +@define kIOPropertySATProductRevisonLevel +Product Revision Level of the SATL. +*/ +#define kIOPropertySATProductRevisonLevel "SAT Product Revision Level" + + +#endif /* _IOKIT_SCSI_CMDS_INQUIRY_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/SCSICmds_MODE_Definitions.h b/QualcommWireless/include/IOKit/scsi/SCSICmds_MODE_Definitions.h new file mode 100644 index 0000000..8d9c250 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/SCSICmds_MODE_Definitions.h @@ -0,0 +1,559 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_MODE_DEFINITIONS_H_ +#define _IOKIT_SCSI_CMDS_MODE_DEFINITIONS_H_ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +#if KERNEL +#include +#else +#include +#endif + + +/*! @header SCSI Request Sense Definitions + @discussion + This file contains all definitions for the data returned from + the MODE_SENSE_6 and MODE_SENSE_10 commands. +*/ + +#pragma pack(1) + +/*! +@struct SPCModeParameterHeader6 +@discussion +Mode Parameter Header for the MODE_SENSE_6 command. +*/ +typedef struct SPCModeParameterHeader6 +{ + UInt8 MODE_DATA_LENGTH; + UInt8 MEDIUM_TYPE; + UInt8 DEVICE_SPECIFIC_PARAMETER; + UInt8 BLOCK_DESCRIPTOR_LENGTH; +} SPCModeParameterHeader6; + + +/*! +@struct SPCModeParameterHeader10 +@discussion +Mode Parameter Header for the MODE_SENSE_10 command. +*/ +typedef struct SPCModeParameterHeader10 +{ + UInt16 MODE_DATA_LENGTH; + UInt8 MEDIUM_TYPE; + UInt8 DEVICE_SPECIFIC_PARAMETER; + UInt8 LONGLBA; + UInt8 RESERVED; + UInt16 BLOCK_DESCRIPTOR_LENGTH; +} SPCModeParameterHeader10; + + +/*! +@enum Long LBA Bitfield definitions +@discussion +Long LBA Bitfield definitions for Mode Parameter Header +for MODE_SENSE_10 command. +@constant kModeSenseParameterHeader10_LongLBABit +Bit to indicate Long LBA block descriptors follow. +@constant kModeSenseParameterHeader10_LongLBAMask +Mask to test for kModeSenseParameterHeader10_LongLBABit. +*/ +enum +{ + kModeSenseParameterHeader10_LongLBABit = 0, + kModeSenseParameterHeader10_LongLBAMask = (1 << kModeSenseParameterHeader10_LongLBABit), +}; + + +/*! +@enum Device Specific Parameter Bitfield definitions +@discussion +SBC definitions for Device Specific Parameter in the +Mode Sense Header Block. +@constant kModeSenseSBCDeviceSpecific_DPOFUABit +Bit to indicate DPO and FUA bits are accepted by the device server. +@constant kModeSenseSBCDeviceSpecific_WriteProtectBit +Bit to indicate medium is write protected. +@constant kModeSenseSBCDeviceSpecific_DPOFUAMask +Mask to test for kModeSenseSBCDeviceSpecific_DPOFUABit. +@constant kModeSenseSBCDeviceSpecific_WriteProtectMask +Mask to test for kModeSenseSBCDeviceSpecific_WriteProtectBit. +*/ +enum +{ + kModeSenseSBCDeviceSpecific_DPOFUABit = 4, + kModeSenseSBCDeviceSpecific_WriteProtectBit = 7, + kModeSenseSBCDeviceSpecific_DPOFUAMask = (1 << kModeSenseSBCDeviceSpecific_DPOFUABit), + kModeSenseSBCDeviceSpecific_WriteProtectMask = (1 << kModeSenseSBCDeviceSpecific_WriteProtectBit) +}; + + +/*! +@struct ModeParameterBlockDescriptor +@discussion +General mode parameter block descriptor. +*/ +typedef struct ModeParameterBlockDescriptor +{ + UInt8 DENSITY_CODE; + UInt8 NUMBER_OF_BLOCKS[3]; + UInt8 RESERVED; + UInt8 BLOCK_LENGTH[3]; +} ModeParameterBlockDescriptor; + + +/*! +@struct DASDModeParameterBlockDescriptor +@discussion +Direct Access Storage Device mode parameter block descriptor. +*/ +typedef struct DASDModeParameterBlockDescriptor +{ + UInt32 NUMBER_OF_BLOCKS; + UInt8 DENSITY_CODE; + UInt8 BLOCK_LENGTH[3]; +} DASDModeParameterBlockDescriptor; + + +/*! +@struct LongLBAModeParameterBlockDescriptor +@discussion +Long LBA mode parameter block descriptor. +*/ +typedef struct LongLBAModeParameterBlockDescriptor +{ + UInt64 NUMBER_OF_BLOCKS; + UInt8 DENSITY_CODE; + UInt8 RESERVED[3]; + UInt32 BLOCK_LENGTH; +} LongLBAModeParameterBlockDescriptor; + + +/*! +@struct ModePageFormatHeader +@discussion +Mode Page format header. +*/ +typedef struct ModePageFormatHeader +{ + UInt8 PS_PAGE_CODE; + UInt8 PAGE_LENGTH; +} ModePageFormatHeader; + + +/*! +@enum Mode Page Format bit definitions +@discussion +Mode Page Format bit definitions. +@constant kModePageFormat_PS_Bit +Bit to indicate Parameters Saveable. +@constant kModePageFormat_PAGE_CODE_Mask +Mask to obtain the PAGE_CODE from the PS_PAGE_CODE field. +@constant kModePageFormat_PS_Mask +Mask to test for kModePageFormat_PS_Bit. +*/ +enum +{ + kModePageFormat_PS_Bit = 7, + + kModePageFormat_PAGE_CODE_Mask = 0x3F, + kModePageFormat_PS_Mask = (1 << kModePageFormat_PS_Bit) +}; + + +#if 0 +#pragma mark - +#pragma mark SPC Mode Pages +#pragma mark - +#endif + + +/*! +@enum SPC Mode Pages +@discussion +SPC Mode Page definitions. +@constant kSPCModePagePowerConditionCode +Power Conditions Mode Page value. +@constant kSPCModePageAllPagesCode +All Mode Pages value. +*/ +enum +{ + kSPCModePagePowerConditionCode = 0x1A, + kSPCModePageAllPagesCode = 0x3F +}; + +/*! +@struct SPCModePagePowerCondition +@discussion +Power Conditions Mode Page (PAGE CODE 0x1A) format. +*/ +typedef struct SPCModePagePowerCondition +{ + ModePageFormatHeader header; + UInt8 RESERVED; + UInt8 IDLE_STANDBY; + UInt32 IDLE_CONDITION_TIMER; + UInt32 STANDBY_CONDITION_TIMER; +} SPCModePagePowerCondition; + + +#if 0 +#pragma mark - +#pragma mark 0x00 SBC Direct Access Mode Pages +#pragma mark - +#endif + + +/*! +@enum SBC Mode Pages +@discussion +SBC Mode Page definitions. +@constant kSBCModePageFormatDeviceCode +Format Device Mode Page value. +@constant kSBCModePageRigidDiskGeometryCode +Rigid Disk Geometry Page value. +@constant kSBCModePageFlexibleDiskCode +Flexible Disk Page value. +@constant kSBCModePageCachingCode +Caching Page value. +*/ +enum +{ + kSBCModePageFormatDeviceCode = 0x03, + kSBCModePageRigidDiskGeometryCode = 0x04, + kSBCModePageFlexibleDiskCode = 0x05, + kSBCModePageCachingCode = 0x08 +}; + + +/*! +@struct SBCModePageFormatDevice +@discussion +Format Device Mode Page (PAGE CODE 0x03) format. +*/ +typedef struct SBCModePageFormatDevice +{ + ModePageFormatHeader header; + UInt16 TRACKS_PER_ZONE; + UInt16 ALTERNATE_SECTORS_PER_ZONE; + UInt16 ALTERNATE_TRACKS_PER_ZONE; + UInt16 ALTERNATE_TRACKS_PER_LOGICAL_UNIT; + UInt16 SECTORS_PER_TRACK; + UInt16 DATA_BYTES_PER_PHYSICAL_SECTOR; + UInt16 INTERLEAVE; + UInt16 TRACK_SKEW_FACTOR; + UInt16 CYLINDER_SKEW_FACTOR; + UInt8 SSEC_HSEC_RMB_SURF; + UInt8 RESERVED[3]; +} SBCModePageFormatDevice; + + +/*! +@struct SBCModePageRigidDiskGeometry +@discussion +Rigid Disk Geometry Mode Page (PAGE CODE 0x04) format. +*/ +typedef struct SBCModePageRigidDiskGeometry +{ + ModePageFormatHeader header; + UInt8 NUMBER_OF_CYLINDERS[3]; + UInt8 NUMBER_OF_HEADS; + UInt8 STARTING_CYLINDER_WRITE_PRECOMPENSATION[3]; + UInt8 STARTING_CYLINDER_REDUCED_WRITE_CURRENT[3]; + UInt16 DEVICE_STEP_RATE; + UInt8 LANDING_ZONE_CYLINDER[3]; + UInt8 RPL; + UInt8 ROTATIONAL_OFFSET; + UInt8 RESERVED; + UInt16 MEDIUM_ROTATION_RATE; + UInt8 RESERVED1[2]; +} SBCModePageRigidDiskGeometry; + + +/*! +@enum Rigid Disk Geometry bitfields +@discussion +Bit field masks for Rigid Disk Geometry structure fields. +@constant kSBCModePageRigidDiskGeometry_RPL_Mask +Mask for use with the RPL field. +*/ +enum +{ + kSBCModePageRigidDiskGeometry_RPL_Mask = 0x03 +}; + + +/*! +@struct SBCModePageFlexibleDisk +@discussion +Flexible Disk Mode Page (PAGE CODE 0x05) format. +*/ +typedef struct SBCModePageFlexibleDisk +{ + ModePageFormatHeader header; + UInt16 TRANSFER_RATE; + UInt8 NUMBER_OF_HEADS; + UInt8 SECTORS_PER_TRACK; + UInt16 DATA_BYTES_PER_SECTOR; + UInt16 NUMBER_OF_CYLINDERS; + UInt16 STARTING_CYLINDER_WRITE_PRECOMPENSATION; + UInt16 STARTING_CYLINDER_REDUCED_WRITE_CURRENT; + UInt16 DEVICE_STEP_RATE; + UInt8 DEVICE_STEP_PULSE_WIDTH; + UInt16 HEAD_SETTLE_DELAY; + UInt8 MOTOR_ON_DELAY; + UInt8 MOTOR_OFF_DELAY; + UInt8 TRDY_SSN_MO; + UInt8 SPC; + UInt8 WRITE_COMPENSATION; + UInt8 HEAD_LOAD_DELAY; + UInt8 HEAD_UNLOAD_DELAY; + UInt8 PIN_34_PIN_2; + UInt8 PIN_4_PIN_1; + UInt16 MEDIUM_ROTATION_RATE; + UInt8 RESERVED[2]; +} SBCModePageFlexibleDisk; + + +/*! +@enum TRDY_SSN_MO bitfields +@discussion +Bit field definitions and masks for Flexible Disk TRDY_SSN_MO field. +@constant kSBCModePageFlexibleDisk_MO_Bit +MO Bit definition. +@constant kSBCModePageFlexibleDisk_SSN_Bit +SSN Bit definition. +@constant kSBCModePageFlexibleDisk_TRDY_Bit +TRDY Bit definition. +@constant kSBCModePageFlexibleDisk_MO_Mask +Mask for use with TRDY_SSN_MO field. +@constant kSBCModePageFlexibleDisk_SSN_Mask +Mask for use with TRDY_SSN_MO field. +@constant kSBCModePageFlexibleDisk_TRDY_Mask +Mask for use with TRDY_SSN_MO field. +*/ +enum +{ + // Bits 0:4 Reserved + kSBCModePageFlexibleDisk_MO_Bit = 5, + kSBCModePageFlexibleDisk_SSN_Bit = 6, + kSBCModePageFlexibleDisk_TRDY_Bit = 7, + + kSBCModePageFlexibleDisk_MO_Mask = (1 << kSBCModePageFlexibleDisk_MO_Bit), + kSBCModePageFlexibleDisk_SSN_Mask = (1 << kSBCModePageFlexibleDisk_SSN_Bit), + kSBCModePageFlexibleDisk_TRDY_Mask = (1 << kSBCModePageFlexibleDisk_TRDY_Bit) +}; + + +/*! +@enum SPC bitfields +@discussion +Bit field definitions and masks for Flexible Disk SPC field. +@constant kSBCModePageFlexibleDisk_SPC_Mask +Mask for use with SPC field. +*/ +enum +{ + kSBCModePageFlexibleDisk_SPC_Mask = 0x0F +}; + + +/*! +@enum PIN_34_PIN_2 bitfields +@discussion +Bit field definitions and masks for Flexible Disk PIN_34_PIN_2 field. +@constant kSBCModePageFlexibleDisk_PIN_2_Mask +Mask for use with PIN_34_PIN_2 field. +@constant kSBCModePageFlexibleDisk_PIN_34_Mask +Mask for use with PIN_34_PIN_2 field. +*/ +enum +{ + kSBCModePageFlexibleDisk_PIN_2_Mask = 0x0F, + kSBCModePageFlexibleDisk_PIN_34_Mask = 0xF0 +}; + + +/*! +@enum PIN_4_PIN_1 bitfields +@discussion +Bit field definitions and masks for Flexible Disk PIN_4_PIN_1 field. +@constant kSBCModePageFlexibleDisk_PIN_1_Mask +Mask for use with PIN_4_PIN_1 field. +@constant kSBCModePageFlexibleDisk_PIN_4_Mask +Mask for use with PIN_4_PIN_1 field. +*/ +enum +{ + kSBCModePageFlexibleDisk_PIN_1_Mask = 0x0F, + kSBCModePageFlexibleDisk_PIN_4_Mask = 0xF0 +}; + + +/*! +@struct SBCModePageCaching +@discussion +Caching Mode Page (PAGE CODE 0x08) format. +*/ +typedef struct SBCModePageCaching +{ + ModePageFormatHeader header; + UInt8 flags; + UInt8 DEMAND_READ_WRITE_RETENTION_PRIORITY; + UInt16 DISABLE_PREFETCH_TRANSFER_LENGTH; + UInt16 MINIMUM_PREFETCH; + UInt16 MAXIMUM_PREFETCH; + UInt16 MAXIMUM_PREFETCH_CEILING; + UInt8 flags2; + UInt8 NUMBER_OF_CACHE_SEGMENTS; + UInt16 CACHE_SEGMENT_SIZE; + UInt8 RESERVED; + UInt8 NON_CACHE_SEGMENT_SIZE[3]; +} SBCModePageCaching; + + +/*! +@enum Caching flags bitfields +@discussion +Bit field definitions and masks for Caching flags field. +@constant kSBCModePageCaching_RCD_Bit +RCD Bit definition. +@constant kSBCModePageCaching_MF_Bit +MF Bit definition. +@constant kSBCModePageCaching_WCE_Bit +WCE Bit definition. +@constant kSBCModePageCaching_SIZE_Bit +SIZE Bit definition. +@constant kSBCModePageCaching_DISC_Bit +DISC Bit definition. +@constant kSBCModePageCaching_CAP_Bit +CAP Bit definition. +@constant kSBCModePageCaching_ABPF_Bit +ABPF Bit definition. +@constant kSBCModePageCaching_IC_Bit +IC Bit definition. +@constant kSBCModePageCaching_RCD_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_MF_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_WCE_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_SIZE_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_DISC_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_CAP_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_ABPF_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_IC_Mask +Mask for use with flags field. +*/ +enum +{ + kSBCModePageCaching_RCD_Bit = 0, + kSBCModePageCaching_MF_Bit = 1, + kSBCModePageCaching_WCE_Bit = 2, + kSBCModePageCaching_SIZE_Bit = 3, + kSBCModePageCaching_DISC_Bit = 4, + kSBCModePageCaching_CAP_Bit = 5, + kSBCModePageCaching_ABPF_Bit = 6, + kSBCModePageCaching_IC_Bit = 7, + + kSBCModePageCaching_RCD_Mask = (1 << kSBCModePageCaching_RCD_Bit), + kSBCModePageCaching_MF_Mask = (1 << kSBCModePageCaching_MF_Bit), + kSBCModePageCaching_WCE_Mask = (1 << kSBCModePageCaching_WCE_Bit), + kSBCModePageCaching_SIZE_Mask = (1 << kSBCModePageCaching_SIZE_Bit), + kSBCModePageCaching_DISC_Mask = (1 << kSBCModePageCaching_DISC_Bit), + kSBCModePageCaching_CAP_Mask = (1 << kSBCModePageCaching_CAP_Bit), + kSBCModePageCaching_ABPF_Mask = (1 << kSBCModePageCaching_ABPF_Bit), + kSBCModePageCaching_IC_Mask = (1 << kSBCModePageCaching_IC_Bit) +}; + + +/*! +@enum Demand Read/Write Retention masks +@discussion +Demand Read/Write Retention masks. +@constant kSBCModePageCaching_DEMAND_WRITE_Mask +Mask for the DEMAND_READ_WRITE_RETENTION_PRIORITY field. +@constant kSBCModePageCaching_DEMAND_READ_Mask +Mask for the DEMAND_READ_WRITE_RETENTION_PRIORITY field. +*/ +enum +{ + kSBCModePageCaching_DEMAND_WRITE_Mask = 0x00FF, + kSBCModePageCaching_DEMAND_READ_Mask = 0xFF00 +}; + +/*! +@enum Caching flags2 bitfields +@discussion +Bit field definitions and masks for Caching flags2 field. +@constant kSBCModePageCaching_VS1_Bit +VS1 Bit definition. +@constant kSBCModePageCaching_VS2_Bit +VS2 Bit definition. +@constant kSBCModePageCaching_DRA_Bit +DRA Bit definition. +@constant kSBCModePageCaching_LBCSS_Bit +LBCSS Bit definition. +@constant kSBCModePageCaching_FSW_Bit +FSW Bit definition. +@constant kSBCModePageCaching_VS1_Mask +Mask for use with flags2 field. +@constant kSBCModePageCaching_VS2_Mask +Mask for use with flags2 field. +@constant kSBCModePageCaching_DRA_Mask +Mask for use with flags2 field. +@constant kSBCModePageCaching_LBCSS_Mask +Mask for use with flags2 field. +@constant kSBCModePageCaching_FSW_Mask +Mask for use with flags2 field. +*/ +enum +{ + // Bits 0:2 Reserved + kSBCModePageCaching_VS1_Bit = 3, + kSBCModePageCaching_VS2_Bit = 4, + kSBCModePageCaching_DRA_Bit = 5, + kSBCModePageCaching_LBCSS_Bit = 6, + kSBCModePageCaching_FSW_Bit = 7, + + kSBCModePageCaching_VS1_Mask = (1 << kSBCModePageCaching_VS1_Bit), + kSBCModePageCaching_VS2_Mask = (1 << kSBCModePageCaching_VS2_Bit), + kSBCModePageCaching_DRA_Mask = (1 << kSBCModePageCaching_DRA_Bit), + kSBCModePageCaching_LBCSS_Mask = (1 << kSBCModePageCaching_LBCSS_Bit), + kSBCModePageCaching_FSW_Mask = (1 << kSBCModePageCaching_FSW_Bit) +}; + +#pragma options align=reset + +#endif /* _IOKIT_SCSI_CMDS_MODE_DEFINITIONS_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/SCSICmds_READ_CAPACITY_Definitions.h b/QualcommWireless/include/IOKit/scsi/SCSICmds_READ_CAPACITY_Definitions.h new file mode 100644 index 0000000..59abde3 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/SCSICmds_READ_CAPACITY_Definitions.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_READ_CAPACITY_H_ +#define _IOKIT_SCSI_CMDS_READ_CAPACITY_H_ + + +#if KERNEL +#include +#else +#include +#endif + + +/*! @header SCSI Request Sense Definitions + @discussion + This file contains all definitions for the data returned from + the READ CAPACITY 10 (0x25) and READ CAPACITY 16 (0x9E) commands. +*/ + +/*! +@enum READ CAPACITY Payload Sizes +@discussion +Sizes of the payload for the READ CAPACITY 10 and +READ CAPACITY 16 commands. +@constant kREPORT_CAPACITY_DataSize +Data size for a READ_CAPACITY command. +@constant kREPORT_CAPACITY_16_DataSize +Data size for a READ_CAPACITY_16 command. +*/ +enum +{ + kREPORT_CAPACITY_DataSize = 8, + kREPORT_CAPACITY_16_DataSize = 32 +}; + + +/*! +@constant kREPORT_CAPACITY_MaximumLBA +@discussion +Maximum LBA supported via READ CAPACITY 10 command. +*/ +#define kREPORT_CAPACITY_MaximumLBA 0xFFFFFFFFUL + + +/*! +@constant kREPORT_CAPACITY_16_MaximumLBA +@discussion +Maximum LBA supported via READ CAPACITY 16 command. +*/ +#define kREPORT_CAPACITY_16_MaximumLBA 0xFFFFFFFFFFFFFFFFULL + + +/*! +@struct SCSI_Capacity_Data +@discussion +Capacity return structure for READ CAPACITY 10 command. +*/ +typedef struct SCSI_Capacity_Data +{ + UInt32 RETURNED_LOGICAL_BLOCK_ADDRESS; + UInt32 BLOCK_LENGTH_IN_BYTES; +} SCSI_Capacity_Data; + + +/*! +@struct SCSI_Capacity_Data_Long +@discussion +Capacity return structure for READ CAPACITY 16 command. +*/ +typedef struct SCSI_Capacity_Data_Long +{ + UInt64 RETURNED_LOGICAL_BLOCK_ADDRESS; + UInt32 BLOCK_LENGTH_IN_BYTES; + UInt8 RTO_EN_PROT_EN; + UInt8 Reserved[19]; +} SCSI_Capacity_Data_Long; + + +/*! +@enum RTO_EN definitions +@discussion +Values for the REFERENCE TAG OWN (RTO_EN) bit in the +READ CAPACITY Long Data structure. +@constant kREAD_CAPACITY_RTO_Enabled +Reference Tag Own enabled. +@constant kREAD_CAPACITY_RTO_Disabled +Reference Tag Own disabled. +@constant kREAD_CAPACITY_RTO_Mask +Mask to use when checking the RTO_EN_PROT_EN field. +*/ +enum +{ + kREAD_CAPACITY_RTO_Enabled = 0x02, + kREAD_CAPACITY_RTO_Disabled = 0x00, + kREAD_CAPACITY_RTO_Mask = 0x02 +}; + + +/*! +@enum PROTECTION INFORMATION definitions +@discussion +Values for the PROTECTION INFORMATION (PROT_EN) bit in the +READ CAPACITY Long Data structure. +@constant kREAD_CAPACITY_PROT_Enabled +Protection Information enabled. +@constant kREAD_CAPACITY_PROT_Disabled +Protection Information disabled. +@constant kREAD_CAPACITY_PROT_Mask +Mask to use when checking the RTO_EN_PROT_EN field. +*/ + +enum +{ + kREAD_CAPACITY_PROT_Enabled = 0x01, + kREAD_CAPACITY_PROT_Disabled = 0x00, + kREAD_CAPACITY_PROT_Mask = 0x01 +}; + + +#endif /* _IOKIT_SCSI_CMDS_READ_CAPACITY_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/SCSICmds_REPORT_LUNS_Definitions.h b/QualcommWireless/include/IOKit/scsi/SCSICmds_REPORT_LUNS_Definitions.h new file mode 100644 index 0000000..e2892fb --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/SCSICmds_REPORT_LUNS_Definitions.h @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2004-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_REPORT_LUNS_DEFINITIONS_H_ +#define _IOKIT_SCSI_CMDS_REPORT_LUNS_DEFINITIONS_H_ + + +#if KERNEL +#include +#else +#include +#endif + + +/*! @header SCSI Request Sense Definitions + @discussion + This file contains all definitions for the data returned from + the REPORT_LUNS (0xA0) command. +*/ + + +/*! +@struct SCSICmd_REPORT_LUNS_LUN_ENTRY +@discussion +This structure represents a single LUN entry in a LUN list +returned via the REPORT_LUNS command. +*/ +typedef struct SCSICmd_REPORT_LUNS_LUN_ENTRY +{ + UInt16 FIRST_LEVEL_ADDRESSING; + UInt16 SECOND_LEVEL_ADDRESSING; + UInt16 THIRD_LEVEL_ADDRESSING; + UInt16 FOURTH_LEVEL_ADDRESSING; +} SCSICmd_REPORT_LUNS_LUN_ENTRY; + + +/*! +@constant kREPORT_LUNS_HeaderSize +@discussion +Size of the REPORT_LUNS header as defined in the SPC-3 specification. +*/ +#define kREPORT_LUNS_HeaderSize 8 + +/*! +@enum REPORT_LUNS addressing methods. +@discussion +REPORT_LUNS addressing methods described in +SAM-2 documents. +@constant kREPORT_LUNS_ADDRESS_METHOD_PERIPHERAL_DEVICE +Peripheral Device Addressing Method. +@constant kREPORT_LUNS_ADDRESS_DEVICE_TYPE_SPECIFIC +Device Type Specific Addressing Method. +@constant kREPORT_LUNS_ADDRESS_METHOD_LOGICAL_UNIT +Logical Unit Specific Addressing Method. +@constant kREPORT_LUNS_ADDRESS_METHOD_OFFSET +Offset to the address method data. +*/ +enum +{ + kREPORT_LUNS_ADDRESS_METHOD_PERIPHERAL_DEVICE = 0, + kREPORT_LUNS_ADDRESS_METHOD_FLAT_SPACE = 1, + kREPORT_LUNS_ADDRESS_DEVICE_TYPE_SPECIFIC = kREPORT_LUNS_ADDRESS_METHOD_FLAT_SPACE, + kREPORT_LUNS_ADDRESS_METHOD_LOGICAL_UNIT = 2, + // Reserved [3] + kREPORT_LUNS_ADDRESS_METHOD_OFFSET = 14 +}; + + +/*! +@struct REPORT_LUNS_LOGICAL_UNIT_ADDRESSING +@discussion +This structure represents a LUN Addressing scheme. +*/ +typedef struct REPORT_LUNS_LOGICAL_UNIT_ADDRESSING +{ +#ifdef __LITTLE_ENDIAN__ + UInt16 LUN : 5; + UInt16 BUS_NUMBER : 3; + UInt16 TARGET : 6; + UInt16 reserved2 : 1; + UInt16 reserved : 1; +#else /* !__LITTLE_ENDIAN__ */ + UInt16 reserved : 1; + UInt16 reserved2 : 1; + UInt16 TARGET : 6; + UInt16 BUS_NUMBER : 3; + UInt16 LUN : 5; +#endif /* !__LITTLE_ENDIAN__ */ +} REPORT_LUNS_LOGICAL_UNIT_ADDRESSING; + + +/*! +@struct REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING +@discussion +This structure represents a Peripheral Device Addressing scheme. +*/ +typedef struct REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING +{ +#ifdef __LITTLE_ENDIAN__ + UInt16 TARGET_LUN : 8; + UInt16 BUS_IDENTIFIER : 6; + UInt16 reserved2 : 1; + UInt16 reserved : 1; +#else /* !__LITTLE_ENDIAN__ */ + UInt16 reserved : 1; + UInt16 reserved2 : 1; + UInt16 BUS_IDENTIFIER : 6; + UInt16 TARGET_LUN : 8; +#endif /* !__LITTLE_ENDIAN__ */ +} REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING; + + +/*! +@struct SCSICmd_REPORT_LUNS_Header +@discussion +This structure defines the format of the data that is returned for +the REPORT_LUNS command. +*/ +typedef struct SCSICmd_REPORT_LUNS_Header +{ + UInt32 LUN_LIST_LENGTH; // LUN list length in bytes. + UInt32 RESERVED; + SCSICmd_REPORT_LUNS_LUN_ENTRY LUN[1]; // Variable length list. Must have at least LUN 0 if +} SCSICmd_REPORT_LUNS_Header; // Target supports REPORT_LUNS command. + + +#endif /* _IOKIT_SCSI_CMDS_REPORT_LUNS_DEFINITIONS_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h b/QualcommWireless/include/IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h new file mode 100644 index 0000000..8cfabb0 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h @@ -0,0 +1,234 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_REQUEST_SENSE_H_ +#define _IOKIT_SCSI_CMDS_REQUEST_SENSE_H_ + + +#if KERNEL +#include +#else +#include +#endif + + +/*! @header SCSI Request Sense Definitions + @discussion + This file contains all definitions for the data returned from + the REQUEST SENSE (0x03) command and from auto sense on protocols + that support it. +*/ + + +/*! +@enum kSenseDefaultSize +@discussion +The default size for SCSI Request Sense data. +*/ +enum +{ + kSenseDefaultSize = 18 +}; + + +/*! +@struct SCSI_Sense_Data +@discussion +The basic SCSI Request Sense data structure. +*/ +typedef struct SCSI_Sense_Data +{ + UInt8 VALID_RESPONSE_CODE; // 7 = Valid. 6-0 = Response Code. + UInt8 SEGMENT_NUMBER; // Segment number + UInt8 SENSE_KEY; // 7 = FILEMARK, 6 = EOM, 5 = ILI, 3-0 = SENSE KEY. + UInt8 INFORMATION_1; // INFORMATION. + UInt8 INFORMATION_2; // INFORMATION. + UInt8 INFORMATION_3; // INFORMATION. + UInt8 INFORMATION_4; // INFORMATION. + UInt8 ADDITIONAL_SENSE_LENGTH; // Number of additional bytes available in sense data + UInt8 COMMAND_SPECIFIC_INFORMATION_1; // Command Specific Information + UInt8 COMMAND_SPECIFIC_INFORMATION_2; // Command Specific Information + UInt8 COMMAND_SPECIFIC_INFORMATION_3; // Command Specific Information + UInt8 COMMAND_SPECIFIC_INFORMATION_4; // Command Specific Information + UInt8 ADDITIONAL_SENSE_CODE; // Additional Sense Code + UInt8 ADDITIONAL_SENSE_CODE_QUALIFIER; // Additional Sense Code Qualifier + UInt8 FIELD_REPLACEABLE_UNIT_CODE; // Field Replaceable Unit Code + UInt8 SKSV_SENSE_KEY_SPECIFIC_MSB; // 7 = Sense Key Specific Valid bit, 6-0 Sense Key Specific MSB + UInt8 SENSE_KEY_SPECIFIC_MID; // Sense Key Specific Middle + UInt8 SENSE_KEY_SPECIFIC_LSB; // Sense Key Specific LSB +} SCSI_Sense_Data; + + +/*! +@enum Sense Valid +@discussion +Masks to use to determine if sense data is valid or not. +@constant kSENSE_DATA_VALID +Sense data is valid. +@constant kSENSE_NOT_DATA_VALID +Sense data is not valid. +@constant kSENSE_DATA_VALID_Mask +Validity mask to use when checking the VALID_RESPONSE_CODE field. +*/ +enum +{ + kSENSE_DATA_VALID = 0x80, + kSENSE_NOT_DATA_VALID = 0x00, + kSENSE_DATA_VALID_Mask = 0x80 +}; + + +/*! +@enum Sense Response Codes +@discussion +Masks and values to determine the Response Code. +@constant kSENSE_RESPONSE_CODE_Current_Errors +Response code indicating current errors are reported. +@constant kSENSE_RESPONSE_CODE_Deferred_Errors +Response code indicating deferred errors are reported. +@constant kSENSE_RESPONSE_CODE_Mask +Mask to use when checking the VALID_RESPONSE_CODE field. +*/ +enum +{ + kSENSE_RESPONSE_CODE_Current_Errors = 0x70, + kSENSE_RESPONSE_CODE_Deferred_Errors = 0x71, + kSENSE_RESPONSE_CODE_Mask = 0x7F +}; + + +/*! +@enum FILEMARK bit field definitions +@discussion +Masks and values to determine the FileMark bit field. +@constant kSENSE_FILEMARK_Set +Filemark bit is set. +@constant kSENSE_FILEMARK_Not_Set +Filemark bit is not set. +@constant kSENSE_FILEMARK_Mask +Mask to use when checking the SENSE_KEY field for the FILEMARK bit. +*/ +enum +{ + kSENSE_FILEMARK_Set = 0x80, + kSENSE_FILEMARK_Not_Set = 0x00, + kSENSE_FILEMARK_Mask = 0x80 +}; + + +/*! +@enum EOM bit field definitions +@discussion +Masks and values to determine the End Of Medium bit field. +@constant kSENSE_EOM_Set +End Of Medium bit is set. +@constant kSENSE_EOM_Not_Set +End Of Medium bit is not set. +@constant kSENSE_EOM_Mask +Mask to use when checking the SENSE_KEY field for the EOM bit. +*/ +enum +{ + kSENSE_EOM_Set = 0x40, + kSENSE_EOM_Not_Set = 0x00, + kSENSE_EOM_Mask = 0x40 +}; + + +/*! +@enum ILI bit field definitions +@discussion +Masks and values to determine the Incorrect Length Indicator bit field. +@constant kSENSE_ILI_Set +Incorrect Length Indicator bit is set. +@constant kSENSE_ILI_Not_Set +Incorrect Length Indicator bit is not set. +@constant kSENSE_ILI_Mask +Mask to use when checking the SENSE_KEY field for the ILI bit. +*/ +enum +{ + kSENSE_ILI_Set = 0x20, + kSENSE_ILI_Not_Set = 0x00, + kSENSE_ILI_Mask = 0x20 +}; + + +/*! +@enum Sense Key definitions +@discussion +Masks and values to determine the SENSE_KEY. +@constant kSENSE_KEY_NO_SENSE +No sense data is present. +@constant kSENSE_KEY_RECOVERED_ERROR +A recovered error has occurred. +@constant kSENSE_KEY_NOT_READY +Device server is not ready. +@constant kSENSE_KEY_MEDIUM_ERROR +Device server detected a medium error. +@constant kSENSE_KEY_HARDWARE_ERROR +Device server detected a hardware error. +@constant kSENSE_KEY_ILLEGAL_REQUEST +Device server detected an illegal request. +@constant kSENSE_KEY_UNIT_ATTENTION +Device server indicates a unit attention condition. +@constant kSENSE_KEY_DATA_PROTECT +Device server indicates a data protect condition. +@constant kSENSE_KEY_BLANK_CHECK +Device server indicates a blank check condition. +@constant kSENSE_KEY_VENDOR_SPECIFIC +Device server indicates a vendor specific condition. +@constant kSENSE_KEY_COPY_ABORTED +Device server indicates a copy aborted condition. +@constant kSENSE_KEY_ABORTED_COMMAND +Device server indicates an aborted command condition. +@constant kSENSE_KEY_VOLUME_OVERFLOW +Device server indicates a volume overflow condition. +@constant kSENSE_KEY_MISCOMPARE +Device server indicates a miscompare condition. +@constant kSENSE_KEY_Mask +Mask to use when checking the SENSE_KEY field for the SENSE_KEY value. +*/ +enum +{ + kSENSE_KEY_NO_SENSE = 0x00, + kSENSE_KEY_RECOVERED_ERROR = 0x01, + kSENSE_KEY_NOT_READY = 0x02, + kSENSE_KEY_MEDIUM_ERROR = 0x03, + kSENSE_KEY_HARDWARE_ERROR = 0x04, + kSENSE_KEY_ILLEGAL_REQUEST = 0x05, + kSENSE_KEY_UNIT_ATTENTION = 0x06, + kSENSE_KEY_DATA_PROTECT = 0x07, + kSENSE_KEY_BLANK_CHECK = 0x08, + kSENSE_KEY_VENDOR_SPECIFIC = 0x09, + kSENSE_KEY_COPY_ABORTED = 0x0A, + kSENSE_KEY_ABORTED_COMMAND = 0x0B, + /* SENSE KEY 0x0C is obsoleted */ + kSENSE_KEY_VOLUME_OVERFLOW = 0x0D, + kSENSE_KEY_MISCOMPARE = 0x0E, + /* SENSE KEY 0x0F is reserved */ + kSENSE_KEY_Mask = 0x0F +}; + + +#endif /* _IOKIT_SCSI_CMDS_REQUEST_SENSE_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/SCSICommandDefinitions.h b/QualcommWireless/include/IOKit/scsi/SCSICommandDefinitions.h new file mode 100644 index 0000000..d33aed6 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/SCSICommandDefinitions.h @@ -0,0 +1,479 @@ +/* + * Copyright (c) 2001-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_COMMAND_DEFINITIONS_H_ +#define _IOKIT_SCSI_COMMAND_DEFINITIONS_H_ + + +#if KERNEL +#include +#else +#include +#endif + + +/*! @header SCSICommandDefinitions + @discussion + This file contains all the definitions for types and constants that are + used by the command set classes for building CDBs. The field type + definitions are used for the parameters passed to a method that builds and + sends any SCSI defined command to clearly identify the type of value + expected for a parameter. + + The command methods will then use the appropriate mask to verify that the + value passed into a parameter is of the specified type. + + Currently only types and masks are defined for 8 bytes and smaller fields. + If a command is defined that uses a larger field, these should be expanded + to include those sizes. +*/ + +#pragma mark Field Type Definitions +/* These are the type definitions used for the parameters of methods that + * build and send Command Descriptor Blocks. + */ + +/* 1 Byte or smaller fields. */ + +/*! @typedef SCSICmdField1Bit */ +typedef UInt8 SCSICmdField1Bit; + +/*! @typedef SCSICmdField2Bit */ +typedef UInt8 SCSICmdField2Bit; + +/*! @typedef SCSICmdField3Bit */ +typedef UInt8 SCSICmdField3Bit; + +/*! @typedef SCSICmdField4Bit */ +typedef UInt8 SCSICmdField4Bit; + +/*! @typedef SCSICmdField5Bit */ +typedef UInt8 SCSICmdField5Bit; + +/*! @typedef SCSICmdField6Bit */ +typedef UInt8 SCSICmdField6Bit; + +/*! @typedef SCSICmdField7Bit */ +typedef UInt8 SCSICmdField7Bit; + +/*! @typedef SCSICmdField1Byte */ +typedef UInt8 SCSICmdField1Byte; + +/* 2 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField9Bit */ +typedef UInt16 SCSICmdField9Bit; + +/*! @typedef SCSICmdField10Bit */ +typedef UInt16 SCSICmdField10Bit; + +/*! @typedef SCSICmdField11Bit */ +typedef UInt16 SCSICmdField11Bit; + +/*! @typedef SCSICmdField12Bit */ +typedef UInt16 SCSICmdField12Bit; + +/*! @typedef SCSICmdField13Bit */ +typedef UInt16 SCSICmdField13Bit; + +/*! @typedef SCSICmdField14Bit */ +typedef UInt16 SCSICmdField14Bit; + +/*! @typedef SCSICmdField15Bit */ +typedef UInt16 SCSICmdField15Bit; + +/*! @typedef SCSICmdField2Byte */ +typedef UInt16 SCSICmdField2Byte; + +/* 3 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField17Bit */ +typedef UInt32 SCSICmdField17Bit; + +/*! @typedef SCSICmdField18Bit */ +typedef UInt32 SCSICmdField18Bit; + +/*! @typedef SCSICmdField19Bit */ +typedef UInt32 SCSICmdField19Bit; + +/*! @typedef SCSICmdField20Bit */ +typedef UInt32 SCSICmdField20Bit; + +/*! @typedef SCSICmdField21Bit */ +typedef UInt32 SCSICmdField21Bit; + +/*! @typedef SCSICmdField22Bit */ +typedef UInt32 SCSICmdField22Bit; + +/*! @typedef SCSICmdField23Bit */ +typedef UInt32 SCSICmdField23Bit; + +/*! @typedef SCSICmdField3Byte */ +typedef UInt32 SCSICmdField3Byte; + +/* 4 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField25Bit */ +typedef UInt32 SCSICmdField25Bit; + +/*! @typedef SCSICmdField26Bit */ +typedef UInt32 SCSICmdField26Bit; + +/*! @typedef SCSICmdField27Bit */ +typedef UInt32 SCSICmdField27Bit; + +/*! @typedef SCSICmdField28Bit */ +typedef UInt32 SCSICmdField28Bit; + +/*! @typedef SCSICmdField29Bit */ +typedef UInt32 SCSICmdField29Bit; + +/*! @typedef SCSICmdField30Bit */ +typedef UInt32 SCSICmdField30Bit; + +/*! @typedef SCSICmdField31Bit */ +typedef UInt32 SCSICmdField31Bit; + +/*! @typedef SCSICmdField4Byte */ +typedef UInt32 SCSICmdField4Byte; + +/* 5 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField33Bit */ +typedef UInt64 SCSICmdField33Bit; + +/*! @typedef SCSICmdField34Bit */ +typedef UInt64 SCSICmdField34Bit; + +/*! @typedef SCSICmdField35Bit */ +typedef UInt64 SCSICmdField35Bit; + +/*! @typedef SCSICmdField36Bit */ +typedef UInt64 SCSICmdField36Bit; + +/*! @typedef SCSICmdField37Bit */ +typedef UInt64 SCSICmdField37Bit; + +/*! @typedef SCSICmdField38Bit */ +typedef UInt64 SCSICmdField38Bit; + +/*! @typedef SCSICmdField39Bit */ +typedef UInt64 SCSICmdField39Bit; + +/*! @typedef SCSICmdField5Byte */ +typedef UInt64 SCSICmdField5Byte; + +/* 6 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField41Bit */ +typedef UInt64 SCSICmdField41Bit; + +/*! @typedef SCSICmdField42Bit */ +typedef UInt64 SCSICmdField42Bit; + +/*! @typedef SCSICmdField43Bit */ +typedef UInt64 SCSICmdField43Bit; + +/*! @typedef SCSICmdField44Bit */ +typedef UInt64 SCSICmdField44Bit; + +/*! @typedef SCSICmdField45Bit */ +typedef UInt64 SCSICmdField45Bit; + +/*! @typedef SCSICmdField46Bit */ +typedef UInt64 SCSICmdField46Bit; + +/*! @typedef SCSICmdField47Bit */ +typedef UInt64 SCSICmdField47Bit; + +/*! @typedef SCSICmdField6Byte */ +typedef UInt64 SCSICmdField6Byte; + +/* 7 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField49Bit */ +typedef UInt64 SCSICmdField49Bit; + +/*! @typedef SCSICmdField50Bit */ +typedef UInt64 SCSICmdField50Bit; + +/*! @typedef SCSICmdField51Bit */ +typedef UInt64 SCSICmdField51Bit; + +/*! @typedef SCSICmdField52Bit */ +typedef UInt64 SCSICmdField52Bit; + +/*! @typedef SCSICmdField53Bit */ +typedef UInt64 SCSICmdField53Bit; + +/*! @typedef SCSICmdField54Bit */ +typedef UInt64 SCSICmdField54Bit; + +/*! @typedef SCSICmdField55Bit */ +typedef UInt64 SCSICmdField55Bit; + +/*! @typedef SCSICmdField7Byte */ +typedef UInt64 SCSICmdField7Byte; + +/* 8 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField57Bit */ +typedef UInt64 SCSICmdField57Bit; + +/*! @typedef SCSICmdField58Bit */ +typedef UInt64 SCSICmdField58Bit; + +/*! @typedef SCSICmdField59Bit */ +typedef UInt64 SCSICmdField59Bit; + +/*! @typedef SCSICmdField60Bit */ +typedef UInt64 SCSICmdField60Bit; + +/*! @typedef SCSICmdField61Bit */ +typedef UInt64 SCSICmdField61Bit; + +/*! @typedef SCSICmdField62Bit */ +typedef UInt64 SCSICmdField62Bit; + +/*! @typedef SCSICmdField63Bit */ +typedef UInt64 SCSICmdField63Bit; + +/*! @typedef SCSICmdField8Byte */ +typedef UInt64 SCSICmdField8Byte; + + +#pragma mark Field Mask Definitions +/* These are masks that are used to verify that the values passed into the + * parameters for the fields are not larger than the field size. + * + * NB: These have changed from enums to #define since enums greater than + * 32 bits in size are not well-defined in C99. + */ + +/* 1 Byte or smaller fields. */ + +/*! @constant kSCSICmdFieldMask1Bit */ +#define kSCSICmdFieldMask1Bit 0x01 + +/*! @constant kSCSICmdFieldMask2Bit */ +#define kSCSICmdFieldMask2Bit 0x03 + +/*! @constant kSCSICmdFieldMask3Bit */ +#define kSCSICmdFieldMask3Bit 0x07 + +/*! @constant kSCSICmdFieldMask4Bit */ +#define kSCSICmdFieldMask4Bit 0x0F + +/*! @constant kSCSICmdFieldMask5Bit */ +#define kSCSICmdFieldMask5Bit 0x1F + +/*! @constant kSCSICmdFieldMask6Bit */ +#define kSCSICmdFieldMask6Bit 0x3F + +/*! @constant kSCSICmdFieldMask7Bit */ +#define kSCSICmdFieldMask7Bit 0x7F + +#define kSCSICmdFieldMask1Byte 0xFF + +/* 2 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask9Bit */ +#define kSCSICmdFieldMask9Bit 0x01FF + +/*! @constant kSCSICmdFieldMask10Bit */ +#define kSCSICmdFieldMask10Bit 0x03FF + +/*! @constant kSCSICmdFieldMask11Bit */ +#define kSCSICmdFieldMask11Bit 0x07FF + +/*! @constant kSCSICmdFieldMask12Bit */ +#define kSCSICmdFieldMask12Bit 0x0FFF + +/*! @constant kSCSICmdFieldMask13Bit */ +#define kSCSICmdFieldMask13Bit 0x1FFF + +/*! @constant kSCSICmdFieldMask14Bit */ +#define kSCSICmdFieldMask14Bit 0x3FFF + +/*! @constant kSCSICmdFieldMask15Bit */ +#define kSCSICmdFieldMask15Bit 0x7FFF + +/*! @constant kSCSICmdFieldMask2Byte */ +#define kSCSICmdFieldMask2Byte 0xFFFF + +/* 3 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask17Bit */ +#define kSCSICmdFieldMask17Bit 0x01FFFF + +/*! @constant kSCSICmdFieldMask18Bit */ +#define kSCSICmdFieldMask18Bit 0x03FFFF + +/*! @constant kSCSICmdFieldMask19Bit */ +#define kSCSICmdFieldMask19Bit 0x07FFFF + +/*! @constant kSCSICmdFieldMask20Bit */ +#define kSCSICmdFieldMask20Bit 0x0FFFFF + +/*! @constant kSCSICmdFieldMask21Bit */ +#define kSCSICmdFieldMask21Bit 0x1FFFFF + +/*! @constant kSCSICmdFieldMask22Bit */ +#define kSCSICmdFieldMask22Bit 0x3FFFFF + +/*! @constant kSCSICmdFieldMask23Bit */ +#define kSCSICmdFieldMask23Bit 0x7FFFFF + +/*! @constant kSCSICmdFieldMask3Byte */ +#define kSCSICmdFieldMask3Byte 0xFFFFFF + +/* 4 Bytes or smaller fields. */ +/*! @constant kSCSICmdFieldMask25Bit */ +#define kSCSICmdFieldMask25Bit 0x01FFFFFFUL + +/*! @constant kSCSICmdFieldMask26Bit */ +#define kSCSICmdFieldMask26Bit 0x03FFFFFFUL + +/*! @constant kSCSICmdFieldMask27Bit */ +#define kSCSICmdFieldMask27Bit 0x07FFFFFFUL + +/*! @constant kSCSICmdFieldMask28Bit */ +#define kSCSICmdFieldMask28Bit 0x0FFFFFFFUL + +/*! @constant kSCSICmdFieldMask29Bit */ +#define kSCSICmdFieldMask29Bit 0x1FFFFFFFUL + +/*! @constant kSCSICmdFieldMask30Bit */ +#define kSCSICmdFieldMask30Bit 0x3FFFFFFFUL + +/*! @constant kSCSICmdFieldMask31Bit */ +#define kSCSICmdFieldMask31Bit 0x7FFFFFFFUL + +/*! @constant kSCSICmdFieldMask4Byte */ +#define kSCSICmdFieldMask4Byte 0xFFFFFFFFUL + +/* 5 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask33Bit */ +#define kSCSICmdFieldMask33Bit 0x01FFFFFFFFULL + +/*! @constant kSCSICmdFieldMask34Bit */ +#define kSCSICmdFieldMask34Bit 0x03FFFFFFFFULL + +/*! @constant kSCSICmdFieldMask35Bit */ +#define kSCSICmdFieldMask35Bit 0x07FFFFFFFFULL + +/*! @constant kSCSICmdFieldMask36Bit */ +#define kSCSICmdFieldMask36Bit 0x0FFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask37Bit */ +#define kSCSICmdFieldMask37Bit 0x1FFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask38Bit */ +#define kSCSICmdFieldMask38Bit 0x3FFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask39Bit */ +#define kSCSICmdFieldMask39Bit 0x7FFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask5Byte */ +#define kSCSICmdFieldMask5Byte 0xFFFFFFFFFFULL + +/* 6 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask41Bit */ +#define kSCSICmdFieldMask41Bit 0x01FFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask42Bit */ +#define kSCSICmdFieldMask42Bit 0x03FFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask43Bit */ +#define kSCSICmdFieldMask43Bit 0x07FFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask44Bit */ +#define kSCSICmdFieldMask44Bit 0x0FFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask45Bit */ +#define kSCSICmdFieldMask45Bit 0x1FFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask46Bit */ +#define kSCSICmdFieldMask46Bit 0x3FFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask47Bit */ +#define kSCSICmdFieldMask47Bit 0x7FFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask6Byte */ +#define kSCSICmdFieldMask6Byte 0xFFFFFFFFFFFFULL + +/* 7 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask49Bit */ +#define kSCSICmdFieldMask49Bit 0x01FFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask50Bit */ +#define kSCSICmdFieldMask50Bit 0x03FFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask51Bit */ +#define kSCSICmdFieldMask51Bit 0x07FFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask52Bit */ +#define kSCSICmdFieldMask52Bit 0x0FFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask53Bit */ +#define kSCSICmdFieldMask53Bit 0x1FFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask54Bit */ +#define kSCSICmdFieldMask54Bit 0x3FFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask55Bit */ +#define kSCSICmdFieldMask55Bit 0x7FFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask7Byte */ +#define kSCSICmdFieldMask7Byte 0xFFFFFFFFFFFFFFULL + +/* 8 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask57Bit */ +#define kSCSICmdFieldMask57Bit 0x01FFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask58Bit */ +#define kSCSICmdFieldMask58Bit 0x03FFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask59Bit */ +#define kSCSICmdFieldMask59Bit 0x07FFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask60Bit */ +#define kSCSICmdFieldMask60Bit 0x0FFFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask61Bit */ +#define kSCSICmdFieldMask61Bit 0x1FFFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask62Bit */ +#define kSCSICmdFieldMask62Bit 0x3FFFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask63Bit */ +#define kSCSICmdFieldMask63Bit 0x7FFFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask8Byte */ +#define kSCSICmdFieldMask8Byte 0xFFFFFFFFFFFFFFFFULL + +#endif /* _IOKIT_SCSI_COMMAND_DEFINITIONS_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/SCSICommandOperationCodes.h b/QualcommWireless/include/IOKit/scsi/SCSICommandOperationCodes.h new file mode 100644 index 0000000..37a92c6 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/SCSICommandOperationCodes.h @@ -0,0 +1,920 @@ +/* + * Copyright (c) 2001-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _SCSI_COMMAND_OPERATION_CODES_H_ +#define _SCSI_COMMAND_OPERATION_CODES_H_ + +#pragma mark About this file +/* This file contains the operation code definitions for all commands defined + * by the SCSI specifications. The commands are listed in three formats: + * 1) All commands are listed in alphabetical order. This list is the live + * enumeration for all of the command constants. + * 2) The commands are listed in ascending numerical order. + * 3) The commands are grouped by Peripheral Device Type. + * + * In the command listings by Peripheral Device Type, there will be a comment + * following each command. This comment indentifies the section of the related + * specification where the commands is defined and the requirement type of the + * command, Mandatory or Optional. + * If a specification redefines an optional command from SPC as mandatory, + * the command will be relisted in the Peripheral Device Type command list with + * the mandatory tag next to it. + * All commands that are listed in SPC as Device Type Specifc will be relisted + * as a comment in all specifications lists that support that command with the + * appropriate Mandatory or Optional tag for that specification. + * + * The section number and the requirement type of the command are based on the + * version of the specification listed in the header comment for the Peripheral + * Device Type. This data is provided for informational purposes only. The + * specification document and version that the device adheres to as indicated + * by the data returned in response to the INQUIRY command should be used as + * the authorative source for supported and required behavior of the device. + * + * The SPC set is listed before all other Peripheral Device Type commands as + * this is the base document from which all of the other documents are derived. + * + * The Peripheral Device Types and associated command sets as defined by SPC-2, + * section 7.4.1 are as follows: + * Peripheral Device Type Associated Command Specification + * ------------------------------------ ----------------------------------- + * 0x00 Direct Access Device SBC - SCSI-3 Block Commands + * 0x01 Sequential Access Device SSC - SCSI-3 Stream Commands + * 0x02 Printer Device SSC - SCSI-3 Stream Commands + * 0x03 Processor Device SPC - SCSI Primary Commands-2 + * 0x04 Write Once Device SBC - SCSI-3 Block Commands + * 0x05 CD-ROM Device MMC - SCSI Multimedia Commands-2 + * 0x06 Scanner Device SGC - SCSI-3 Graphics Commands + * 0x07 Optical Memory Device SBC - SCSI-3 Block Commands + * 0x08 Medium Changer Device SMC - SCSI-3 Medium Changer Cmds + * 0x09 Communications Device SSC - SCSI-3 Stream Commands + * 0x0A - 0x0B Graphic Arts Prepress Dev ASC IT8 + * 0x0C Storage Array Controller Device SCC-2 - SCSI Controller Commands-2 + * 0x0D Enclosure Services SES - SCSI-3 Enclosure Services + * 0x0E Simplified Direct Access Device RBC - SCSI Reduced Block Commands + * 0x0F Optical Card Reader/Writer Device OCRW - SCSI Specification for + * Optical Card Reader/Writer + * 0x10 Reserved No command specification + * 0x11 Object-Based Storage Device OSD - SCSI Object Based Storage + * Device Commands + * 0x12 - 0x14 Reserved No command specification + * 0x15 Multimedia Media Access Engine RMC - Reduced Multimedia Commands + * 0x16 - 0x1E Reserved No command specification + * 0x1F Unknown or No Device No command specification + */ + +#pragma mark - +#pragma mark Command Definitions by Name +/* All SCSI Commands listed in alphabetical order. These are the live + * definitions of the commands. All other command lists are informative. + */ +enum +{ + kSCSICmd_ACCESS_CONTROL_IN = 0x86, + kSCSICmd_ACCESS_CONTROL_OUT = 0x87, + kSCSICmd_BLANK = 0xA1, + kSCSICmd_CHANGE_DEFINITION = 0x40, + kSCSICmd_CLOSE_TRACK_SESSION = 0x5B, + kSCSICmd_COMPARE = 0x39, + kSCSICmd_COPY = 0x18, + kSCSICmd_COPY_AND_VERIFY = 0x3A, + kSCSICmd_ERASE_10 = 0x2C, + kSCSICmd_ERASE_12 = 0xAC, + kSCSICmd_EXTENDED_COPY = 0x83, + kSCSICmd_FORMAT_UNIT = 0x04, + kSCSICmd_GET_CONFIGURATION = 0x46, + kSCSICmd_GET_EVENT_STATUS_NOTIFICATION = 0x4A, + kSCSICmd_GET_PERFORMANCE = 0xAC, + kSCSICmd_INQUIRY = 0x12, + kSCSICmd_LOAD_UNLOAD_MEDIUM = 0xA6, + kSCSICmd_LOCK_UNLOCK_CACHE = 0x36, + kSCSICmd_LOCK_UNLOCK_CACHE_16 = 0x92, + kSCSICmd_LOG_SELECT = 0x4C, + kSCSICmd_LOG_SENSE = 0x4D, + kSCSICmd_MAINTENANCE_IN = 0xA3, + kSCSICmd_MAINTENANCE_OUT = 0xA4, + kSCSICmd_MECHANISM_STATUS = 0xBD, + kSCSICmd_MEDIUM_SCAN = 0x38, + kSCSICmd_MODE_SELECT_6 = 0x15, + kSCSICmd_MODE_SELECT_10 = 0x55, + kSCSICmd_MODE_SENSE_6 = 0x1A, + kSCSICmd_MODE_SENSE_10 = 0x5A, + kSCSICmd_MOVE_MEDIUM_ATTACHED = 0xA7, + kSCSICmd_PAUSE_RESUME = 0x4B, + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, + kSCSICmd_PLAY_AUDIO_10 = 0x45, + kSCSICmd_PLAY_AUDIO_12 = 0xA5, + kSCSICmd_PLAY_AUDIO_MSF = 0x47, + kSCSICmd_PLAY_AUDIO_TRACK_INDEX = 0x48, + kSCSICmd_PLAY_CD = 0xBC, + kSCSICmd_PLAY_RELATIVE_10 = 0x49, + kSCSICmd_PLAY_RELATIVE_12 = 0xA9, + kSCSICmd_PREFETCH = 0x34, + kSCSICmd_PREFETCH_16 = 0x90, + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, + kSCSICmd_READ_6 = 0x08, + kSCSICmd_READ_10 = 0x28, + kSCSICmd_READ_12 = 0xA8, + kSCSICmd_READ_16 = 0x88, + kSCSICmd_READ_ATTRIBUTE = 0x8C, + kSCSICmd_READ_BUFFER = 0x3C, + kSCSICmd_READ_BUFFER_CAPACITY = 0x5C, + kSCSICmd_READ_CAPACITY = 0x25, + kSCSICmd_READ_CD = 0xBE, + kSCSICmd_READ_CD_MSF = 0xB9, + kSCSICmd_READ_DEFECT_DATA_10 = 0x37, + kSCSICmd_READ_DEFECT_DATA_12 = 0xB7, + kSCSICmd_READ_DISC_INFORMATION = 0x51, + kSCSICmd_READ_DVD_STRUCTURE = 0xAD, + kSCSICmd_READ_DISC_STRUCTURE = 0xAD, + kSCSICmd_READ_ELEMENT_STATUS_ATTACHED = 0xB4, + kSCSICmd_READ_FORMAT_CAPACITIES = 0x23, + kSCSICmd_READ_GENERATION = 0x29, + kSCSICmd_READ_HEADER = 0x44, + kSCSICmd_READ_LONG = 0x3E, + kSCSICmd_READ_MASTER_CUE = 0x59, + kSCSICmd_READ_SUB_CHANNEL = 0x42, + kSCSICmd_READ_TOC_PMA_ATIP = 0x43, + kSCSICmd_READ_TRACK_INFORMATION = 0x52, + kSCSICmd_READ_UPDATED_BLOCK_10 = 0x2D, + kSCSICmd_REASSIGN_BLOCKS = 0x07, + kSCSICmd_REBUILD = 0x81, + kSCSICmd_RECEIVE = 0x08, + kSCSICmd_RECEIVE_COPY_RESULTS = 0x84, + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, + kSCSICmd_REDUNDANCY_GROUP_IN = 0xBA, + kSCSICmd_REDUNDANCY_GROUP_OUT = 0xBB, + kSCSICmd_REGENERATE = 0x82, + kSCSICmd_RELEASE_6 = 0x17, + kSCSICmd_RELEASE_10 = 0x57, + kSCSICmd_REPAIR_TRACK = 0x58, + kSCSICmd_REPORT_DEVICE_IDENTIFIER = 0xA3, + kSCSICmd_REPORT_KEY = 0xA4, + kSCSICmd_REPORT_LUNS = 0xA0, + kSCSICmd_REQUEST_SENSE = 0x03, + kSCSICmd_RESERVE_6 = 0x16, + kSCSICmd_RESERVE_10 = 0x56, + kSCSICmd_RESERVE_TRACK = 0x53, + kSCSICmd_REZERO_UNIT = 0x01, + kSCSICmd_SCAN_MMC = 0xBA, + kSCSICmd_SEARCH_DATA_EQUAL_10 = 0x31, + kSCSICmd_SEARCH_DATA_EQUAL_12 = 0xB1, + kSCSICmd_SEARCH_DATA_HIGH_10 = 0x30, + kSCSICmd_SEARCH_DATA_HIGH_12 = 0xB0, + kSCSICmd_SEARCH_DATA_LOW_10 = 0x32, + kSCSICmd_SEARCH_DATA_LOW_12 = 0xB2, + kSCSICmd_SEEK_6 = 0x0B, + kSCSICmd_SEEK_10 = 0x2B, + kSCSICmd_SEND = 0x0A, + kSCSICmd_SEND_CUE_SHEET = 0x5D, + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, + kSCSICmd_SEND_DVD_STRUCTURE = 0xBF, + kSCSICmd_SEND_EVENT = 0xA2, + kSCSICmd_SEND_KEY = 0xA3, + kSCSICmd_SEND_OPC_INFORMATION = 0x54, + kSCSICmd_SERVICE_ACTION_IN = 0x9E, + kSCSICmd_SERVICE_ACTION_OUT = 0x9F, + kSCSICmd_SET_CD_SPEED = 0xBB, + kSCSICmd_SET_DEVICE_IDENTIFIER = 0xA4, + kSCSICmd_SET_LIMITS_10 = 0x33, + kSCSICmd_SET_LIMITS_12 = 0xB3, + kSCSICmd_SET_READ_AHEAD = 0xA7, + kSCSICmd_SET_STREAMING = 0xB6, + kSCSICmd_SPARE_IN = 0xBC, + kSCSICmd_SPARE_OUT = 0xBD, + kSCSICmd_START_STOP_UNIT = 0x1B, + kSCSICmd_STOP_PLAY_SCAN = 0x4E, + kSCSICmd_SYNCHRONIZE_CACHE = 0x35, + kSCSICmd_SYNCHRONIZE_CACHE_16 = 0x91, + kSCSICmd_TEST_UNIT_READY = 0x00, + kSCSICmd_UPDATE_BLOCK = 0x3D, + kSCSICmd_UNMAP = 0x42, + kSCSICmd_VERIFY_10 = 0x2F, + kSCSICmd_VERIFY_12 = 0xAF, + kSCSICmd_VERIFY_16 = 0x8F, + kSCSICmd_VOLUME_SET_IN = 0xBE, + kSCSICmd_VOLUME_SET_OUT = 0xBF, + kSCSICmd_WRITE_6 = 0x0A, + kSCSICmd_WRITE_10 = 0x2A, + kSCSICmd_WRITE_12 = 0xAA, + kSCSICmd_WRITE_16 = 0x8A, + kSCSICmd_WRITE_AND_VERIFY_10 = 0x2E, + kSCSICmd_WRITE_AND_VERIFY_12 = 0xAE, + kSCSICmd_WRITE_AND_VERIFY_16 = 0x8E, + kSCSICmd_WRITE_ATTRIBUTE = 0x8D, + kSCSICmd_WRITE_BUFFER = 0x3B, + kSCSICmd_WRITE_LONG = 0x3F, + kSCSICmd_WRITE_SAME = 0x41, + kSCSICmd_WRITE_SAME_16 = 0x93, + kSCSICmd_XDREAD = 0x52, + kSCSICmd_XDWRITE = 0x50, + kSCSICmd_XDWRITE_EXTENDED = 0x80, + kSCSICmd_XDWRITEREAD_10 = 0x53, + kSCSICmd_XPWRITE = 0x51, + + kSCSICmdVariableLengthCDB = 0x7F +}; + +/* Service Action Definitions for the Variable Length CDB (7Fh) command */ +enum +{ + kSCSIServiceAction_READ_32 = 0x0009, + kSCSIServiceAction_VERIFY_32 = 0x000A, + kSCSIServiceAction_WRITE_32 = 0x000B, + kSCSIServiceAction_WRITE_AND_VERIFY_32 = 0x000C, + kSCSIServiceAction_WRITE_SAME_32 = 0x000D, + kSCSIServiceAction_XDREAD_32 = 0x0003, + kSCSIServiceAction_XDWRITE_32 = 0x0004, + kSCSIServiceAction_XDWRITEREAD_32 = 0x0007, + kSCSIServiceAction_XPWRITE_32 = 0x0006 +}; + +/* Service Action Definitions for the MAINTENANCE IN (A3h) command */ +enum +{ + kSCSIServiceAction_REPORT_ALIASES = 0x0B, + kSCSIServiceAction_REPORT_DEVICE_IDENTIFIER = 0x05, + kSCSIServiceAction_REPORT_PRIORITY = 0x0E, + kSCSIServiceAction_REPORT_PROVISIONING_INITIALIZATION_PATTERN = 0x1D, + kSCSIServiceAction_REPORT_SUPPORTED_OPERATION_CODES = 0x0C, + kSCSIServiceAction_REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS = 0x0D, + kSCSIServiceAction_REPORT_TARGET_PORT_GROUPS = 0x0A +}; + +/* Service Action Definitions for the MAINTENANCE OUT (A4h) command */ +enum +{ + kSCSIServiceAction_CHANGE_ALIASES = 0x0B, + kSCSIServiceAction_SET_DEVICE_IDENTIFIER = 0x06, + kSCSIServiceAction_SET_PRIORITY = 0x0E, + kSCSIServiceAction_SET_TARGET_PORT_GROUPS = 0x0A +}; + +/* Service Action Definitions for the SERVICE ACTION IN (9Eh) command */ +enum +{ + kSCSIServiceAction_GET_LBA_STATUS = 0x12, + kSCSIServiceAction_READ_CAPACITY_16 = 0x10, + kSCSIServiceAction_READ_LONG_16 = 0x11, +}; + +/* Service Action Definitions for the SERVICE ACTION OUT (9Fh) command */ +enum +{ + kSCSIServiceAction_WRITE_LONG_16 = 0x11 +}; + +#pragma mark - +#pragma mark Command Definitions by Number +#if 0 +enum +{ +}; +#endif + + +#pragma mark - +#pragma mark All Types SPC Commands +/* Commands defined by the T10:1236-D SCSI Primary Commands-2 (SPC-2) + * command specification. The definitions and section numbers are based on + * section 7 of the revision 18, 21 May 2000 version of the specification. + * + * These commands are defined for all devices. + */ +enum +{ + kSPCCmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSPCCmd_COMPARE = 0x39, /* Sec. 7.2: Optional */ + kSPCCmd_COPY = 0x18, /* Sec. 7.3: Optional */ + kSPCCmd_COPY_AND_VERIFY = 0x3A, /* Sec. 7.4: Optional */ + kSPCCmd_EXTENDED_COPY = 0x83, /* Sec. 7.5: Optional */ + kSPCCmd_INQUIRY = 0x12, /* Sec. 7.6: Mandatory */ + kSPCCmd_LOG_SELECT = 0x4C, /* Sec. 7.7: Optional */ + kSPCCmd_LOG_SENSE = 0x4D, /* Sec. 7.8: Optional */ + kSPCCmd_MODE_SELECT_6 = 0x15, /* Sec. 7.9: Device Type + * Specific */ + kSPCCmd_MODE_SELECT_10 = 0x55, /* Sec. 7.10: Device Type + * Specific */ + kSPCCmd_MODE_SENSE_6 = 0x1A, /* Sec. 7.11: Device Type + * Specific */ + kSPCCmd_MODE_SENSE_10 = 0x5A, /* Sec. 7.12: Device Type + * Specific */ + kSPCCmd_MOVE_MEDIUM_ATTACHED = 0xA7, /* Defined in SMC */ + kSPCCmd_PERSISTENT_RESERVE_IN = 0x5E, /* Sec. 7.13: Device Type + * Specific */ + kSPCCmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Sec. 7.14: Device Type + * Specific */ + kSPCCmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* Sec. 7.15: Device Type + * Specific */ + kSPCCmd_READ_BUFFER = 0x3C, /* Sec. 7.16: Optional */ + kSPCCmd_READ_ELEMENT_STATUS_ATTACHED = 0xB4, /* Defined in SMC */ + kSPCCmd_RECEIVE_COPY_RESULTS = 0x84, /* Sec. 7.17: Optional */ + kSPCCmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* Sec. 7.18: Optional */ + kSPCCmd_RELEASE_10 = 0x57, /* Sec. 7.19: Device Type + * Specific */ + kSPCCmd_RELEASE_6 = 0x17, /* Sec. 7.20: Device Type + * Specific */ + kSPCCmd_REPORT_DEVICE_IDENTIFIER = 0xA3, /* Sec. 7.21: Optional */ + kSPCCmd_REPORT_LUNS = 0xA0, /* Sec. 7.22: Mandatory for + * LUN Supporting devices*/ + kSPCCmd_REQUEST_SENSE = 0x03, /* Sec. 7.23: Device Type + * Specific */ + kSPCCmd_RESERVE_10 = 0x56, /* Sec. 7.24: Device Type + * Specific */ + kSPCCmd_RESERVE_6 = 0x16, /* Sec. 7.25: Device Type + * Specific */ + kSPCCmd_SEND_DIAGNOSTICS = 0x1D, /* Sec. 7.26: Optional */ + kSPCCmd_SET_DEVICE_IDENTIFIER = 0xA4, /* Sec. 7.27: Optional */ + kSPCCmd_TEST_UNIT_READY = 0x00, /* Sec. 7.28: Mandatory */ + kSPCCmd_WRITE_BUFFER = 0x3B /* Sec. 7.29: Optional */ +}; + +#pragma mark - +#pragma mark 0x00 SBC Direct Access Commands +/* Commands defined by the T10:990-D SCSI-3 Block Commands (SBC) command + * specification. The definitions and section numbers are based on section 6.1 + * of the revision 8c, 13 November 1997 version of the specification. + */ +enum +{ + kSBCCmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSBCCmd_COMPARE = 0x39, /* SPC: Optional */ + kSBCCmd_COPY = 0x18, /* SPC: Optional */ + kSBCCmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional*/ + kSBCCmd_FORMAT_UNIT = 0x04, /* Sec. 6.1.1: Mandatory */ + kSBCCmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSBCCmd_LOCK_UNLOCK_CACHE = 0x36, /* Sec. 6.1.2: Optional */ + kSBCCmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSBCCmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSBCCmd_MODE_SELECT_6 = 0x15, /* SPC: Optional */ + kSBCCmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSBCCmd_MODE_SENSE_6 = 0x1A, /* SPC: Optional */ + kSBCCmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSBCCmd_MOVE_MEDIUM_ATTACHED = 0xA7, /* SMC: Optional */ + kSBCCmd_PERSISTENT_RESERVE_IN = 0x5E, /* SPC: Optional */ + kSBCCmd_PERSISTENT_RESERVE_OUT = 0x5F, /* SPC: Optional */ + kSBCCmd_PREFETCH = 0x34, /* Sec. 6.1.3: Optional */ + kSBCCmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* SPC: Optional */ + kSBCCmd_READ_6 = 0x08, /* Sec. 6.1.4: Mandatory */ + kSBCCmd_READ_10 = 0x28, /* Sec. 6.1.5: Mandatory */ + kSBCCmd_READ_12 = 0xA8, /* Sec. 6.2.4: Optional */ + kSBCCmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSBCCmd_READ_CAPACITY = 0x25, /* Sec. 6.1.6: Mandatory */ + kSBCCmd_READ_DEFECT_DATA_10 = 0x37, /* Sec. 6.1.7: Optional */ + kSBCCmd_READ_DEFECT_DATA_12 = 0xB7, /* Sec. 6.2.5: Optional */ + kSBCCmd_READ_ELEMENT_STATUS_ATTACHED = 0xB4, /* SMC: Optional */ + kSBCCmd_READ_GENERATION = 0x29, /* Sec. 6.2.6: Optional */ + kSBCCmd_READ_LONG = 0x3E, /* Sec. 6.1.8: Optional */ + kSBCCmd_READ_UPDATED_BLOCK_10 = 0x2D, /* Sec. 6.2.7: Optional */ + kSBCCmd_REASSIGN_BLOCKS = 0x07, /* Sec. 6.1.9: Optional */ + kSBCCmd_REBUILD = 0x81, /* Sec. 6.1.10: Optional */ + kSBCCmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSBCCmd_REGENERATE = 0x82, /* Sec. 6.1.11: Optional */ + kSBCCmd_RELEASE_6 = 0x17, /* SPC: Optional */ + kSBCCmd_RELEASE_10 = 0x57, /* SPC: Mandatory */ + kSBCCmd_REPORT_LUNS = 0xA0, /* SPC: Optional */ + kSBCCmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSBCCmd_RESERVE_6 = 0x16, /* SPC: Optional */ + kSBCCmd_RESERVE_10 = 0x56, /* SPC: Mandatory */ + kSBCCmd_REZERO_UNIT = 0x01, /* Obsolete */ + kSBCCmd_SEARCH_DATA_EQUAL_10 = 0x31, /* Obsolete */ + kSBCCmd_SEARCH_DATA_HIGH_10 = 0x30, /* Obsolete */ + kSBCCmd_SEARCH_DATA_LOW_10 = 0x32, /* Obsolete */ + kSBCCmd_SEEK_6 = 0x0B, /* Obsolete */ + kSBCCmd_SEEK_10 = 0x2B, /* Sec. 6.1.12: Optional */ + kSBCCmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSBCCmd_SET_LIMITS_10 = 0x33, /* Sec. 6.1.13: Optional */ + kSBCCmd_SET_LIMITS_12 = 0xB3, /* Sec. 6.2.8: Optional */ + kSBCCmd_START_STOP_UNIT = 0x1B, /* Sec. 6.1.14: Optional */ + kSBCCmd_SYNCHRONIZE_CACHE = 0x35, /* Sec. 6.1.15: Optional */ + kSBCCmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSBCCmd_UPDATE_BLOCK = 0x3D, /* Sec. 6.2.9: Optional */ + kSBCCmd_VERIFY_10 = 0x2F, /* Sec. 6.1.16: Optional */ + kSBCCmd_WRITE_6 = 0x0A, /* Sec. 6.1.17: Optional */ + kSBCCmd_WRITE_10 = 0x2A, /* Sec. 6.1.18: Optional */ + kSBCCmd_WRITE_12 = 0xAA, /* Sec. 6.2.13: Optional */ + kSBCCmd_WRITE_AND_VERIFY_10 = 0x2E, /* Sec. 6.1.19: Optional */ + kSBCCmd_WRITE_AND_VERIFY_12 = 0xAE, /* Sec. 6.2.15: Optional */ + kSBCCmd_WRITE_BUFFER = 0x3B, /* SPC: Optional */ + kSBCCmd_WRITE_LONG = 0x3F, /* Sec. 6.1.20: Optional */ + kSBCCmd_WRITE_SAME = 0x41, /* Sec. 6.1.21: Optional */ + kSBCCmd_XDREAD = 0x52, /* Sec. 6.1.22: Optional */ + kSBCCmd_XDWRITE = 0x50, /* Sec. 6.1.23: Optional */ + kSBCCmd_XDWRITE_EXTENDED = 0x80, /* Sec. 6.1.24: Optional */ + kSBCCmd_XPWRITE = 0x51 /* Sec. 6.1.25: Optional */ +}; + +#pragma mark - +#pragma mark 0x01 SSC Sequential Access Commands +/* Commands defined by the T10:997-D SCSI-3 Stream Commands (SSC) command + * specification. The definitions and section numbers are based on section 5 + * of the revision 22, January 1, 2000 version of the specification. + */ +enum +{ + kSSCSeqCmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSSCSeqCmd_COMPARE = 0x39, /* SPC: Optional */ + kSSCSeqCmd_COPY = 0x18, /* SPC: Optional */ + kSSCSeqCmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional */ + kSSCSeqCmd_ERASE = 0x19, /* Sec. 5.3.1: Mandatory */ + kSSCSeqCmd_FORMAT_MEDIUM = 0x04, /* Sec. 5.3.2: Optional */ + kSSCSeqCmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSSCSeqCmd_LOAD_UNLOAD = 0x1B, /* Sec. 5.3.3: Optional */ + kSSCSeqCmd_LOCATE = 0x2B, /* Sec. 5.3.4: Optional */ + kSSCSeqCmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSSCSeqCmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSSCSeqCmd_MODE_SELECT_6 = 0x15, /* SPC: Mandatory */ + kSSCSeqCmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSSCSeqCmd_MODE_SENSE_6 = 0x1A, /* SPC: Mandatory */ + kSSCSeqCmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSSCSeqCmd_MOVE_MEDIUM = 0xA5, /* SMC: Optional */ + kSSCSeqCmd_MOVE_MEDIUM_ATTACHED = 0xA7, /* SMC: Optional */ + kSSCSeqCmd_PERSISTENT_RESERVE_IN = 0x5E, /* SPC: Optional */ + kSSCSeqCmd_PERSISTENT_RESERVE_OUT = 0x5F, /* SPC: Optional */ + kSSCSeqCmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* SPC: Optional */ + kSSCSeqCmd_READ_6 = 0x08, /* Sec. 5.3.5: Mandatory */ + kSSCSeqCmd_READ_BLOCK_LIMITS = 0x05, /* Sec. 5.3.6: Mandatory */ + kSSCSeqCmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSSCSeqCmd_READ_ELEMENT_STATUS = 0xB8, /* SMC: Optional */ + kSSCSeqCmd_READ_ELEMENT_STATUS_ATTACHED = 0xB4, /* SMC: Optional */ + kSSCSeqCmd_READ_POSITION = 0x34, /* Sec. 5.3.7: Mandatory */ + kSSCSeqCmd_READ_REVERSE = 0x0F, /* Sec. 5.3.8: Optional */ + kSSCSeqCmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSSCSeqCmd_RECOVER_BUFFERED_DATA = 0x14, /* Sec. 5.3.9: Optional */ + kSSCSeqCmd_RELEASE_6 = 0x17, /* SPC: Mandatory */ + kSSCSeqCmd_RELEASE_10 = 0x57, /* SPC: Mandatory */ + kSSCSeqCmd_REPORT_DENSITY_SUPPORT = 0x44, /* Sec. 5.3.10: Mandatory*/ + kSSCSeqCmd_REPORT_LUNS = 0xA0, /* SPC: Mandatory */ + kSSCSeqCmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSSCSeqCmd_RESERVE_6 = 0x16, /* SPC: Mandatory */ + kSSCSeqCmd_RESERVE_10 = 0x56, /* SPC: Mandatory */ + kSSCSeqCmd_REWIND = 0x01, /* Sec. 5.3.11: Mandatory*/ + kSSCSeqCmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSSCSeqCmd_SPACE = 0x11, /* Sec. 5.3.12: Mandatory*/ + kSSCSeqCmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSSCSeqCmd_VERIFY_6 = 0x13, /* Sec. 5.3.13: Optional */ + kSSCSeqCmd_WRITE_6 = 0x0A, /* Sec. 5.3.14: Mandatory*/ + kSSCSeqCmd_WRITE_BUFFER = 0x3B, /* SPC: Optional */ + kSSCSeqCmd_WRITE_FILEMARKS = 0x10 /* Sec. 5.3.15: Mandatory*/ +}; + +#pragma mark - +#pragma mark 0x02 SSC Printer Commands +/* Commands defined by the T10:997-D SCSI-3 Stream Commands (SSC) command + * specification. The definitions and section numbers are based on section 6 + * of the revision 22, January 1, 2000 version of the specification. + */ +enum +{ + kSSCPrinterCmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSSCPrinterCmd_COMPARE = 0x39, /* SPC: Optional */ + kSSCPrinterCmd_COPY = 0x18, /* SPC: Optional */ + kSSCPrinterCmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional */ + kSSCPrinterCmd_FORMAT = 0x04, /* Sec. 6.2.1: Optional */ + kSSCPrinterCmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSSCPrinterCmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSSCPrinterCmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSSCPrinterCmd_MODE_SELECT_6 = 0x15, /* SPC: Mandatory */ + kSSCPrinterCmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSSCPrinterCmd_MODE_SENSE_6 = 0x1A, /* SPC: Mandatory */ + kSSCPrinterCmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSSCPrinterCmd_PERSISTENT_RESERVE_IN = 0x5E, /* SPC: Optional */ + kSSCPrinterCmd_PERSISTENT_RESERVE_OUT = 0x5F, /* SPC: Optional */ + kSSCPrinterCmd_PRINT = 0x0A, /* Sec. 6.2.2: Mandatory */ + kSSCPrinterCmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSSCPrinterCmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSSCPrinterCmd_RECOVER_BUFFERED_DATA = 0x14, /* Sec. 6.2.3: Optional */ + kSSCPrinterCmd_RELEASE_6 = 0x17, /* SPC: Mandatory */ + kSSCPrinterCmd_RELEASE_10 = 0x57, /* SPC: Mandatory */ + kSSCPrinterCmd_REPORT_LUNS = 0xA0, /* SPC: Mandatory */ + kSSCPrinterCmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSSCPrinterCmd_RESERVE_6 = 0x16, /* SPC: Mandatory */ + kSSCPrinterCmd_RESERVE_10 = 0x56, /* SPC: Mandatory */ + kSSCPrinterCmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSSCPrinterCmd_SLEW_AND_PRINT = 0x0B, /* Sec. 6.2.4: Optional */ + kSSCPrinterCmd_STOP_PRINT = 0x1B, /* Sec. 6.2.5: Optional */ + kSSCPrinterCmd_SYNCHRONIZE_BUFFER = 0x10, /* Sec. 6.2.6: Optional */ + kSSCPrinterCmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSSCPrinterCmd_WRITE_BUFFER = 0x3B /* SPC: Optional */ +}; + +#pragma mark - +#pragma mark 0x03 SPC Processor Commands +/* Commands defined by the T10:1236-D SCSI Primary Commands-2 (SPC-2) + * command specification. The definitions and section numbers are based on + * section 9 of the revision 18, 21 May 2000 version of the specification. + */ +enum +{ + kSPCProcCmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSPCProcCmd_COMPARE = 0x39, /* Sec. 7.2: Optional */ + kSPCProcCmd_COPY = 0x18, /* Sec. 7.3: Optional */ + kSPCProcCmd_COPY_AND_VERIFY = 0x3A, /* Sec. 7.4: Optional */ + kSPCProcCmd_EXTENDED_COPY = 0x83, /* Sec. 7.5: Optional */ + kSPCProcCmd_INQUIRY = 0x12, /* Sec. 7.6: Mandatory */ + kSPCProcCmd_LOG_SELECT = 0x4C, /* Sec. 7.7: Optional */ + kSPCProcCmd_LOG_SENSE = 0x4D, /* Sec. 7.8: Optional */ + kSPCProcCmd_PERSISTENT_RESERVE_IN = 0x5E, /* Sec. 7.13: Optional */ + kSPCProcCmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Sec. 7.14: Optional */ + kSPCProcCmd_READ_BUFFER = 0x3C, /* Sec. 7.16: Optional */ + kSPCProcCmd_RECEIVE = 0x08, /* Sec. 9.2: Optional */ + kSPCProcCmd_RECEIVE_COPY_RESULTS = 0x84, /* Sec. 7.17: Optional */ + kSPCProcCmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* Sec. 7.18: Optional */ + kSPCProcCmd_RELEASE_10 = 0x57, /* Sec. 7.19: Optional */ + kSPCProcCmd_RELEASE_6 = 0x17, /* Sec. 7.20: Optional */ + kSPCProcCmd_REPORT_LUNS = 0xA0, /* Sec. 7.22: Optional */ + kSPCProcCmd_REQUEST_SENSE = 0x03, /* Sec. 7.23: Mandatory */ + kSPCProcCmd_RESERVE_10 = 0x56, /* Sec. 7.24: Optional */ + kSPCProcCmd_RESERVE_6 = 0x16, /* Sec. 7.25: Optional */ + kSPCProcCmd_SEND = 0x0A, /* Sec. 9.3: Optional */ + kSPCProcCmd_SEND_DIAGNOSTICS = 0x1D, /* Sec. 7.26: Mandatory */ + kSPCProcCmd_TEST_UNIT_READY = 0x00, /* Sec. 7.27: Mandatory */ + kSPCProcCmd_WRITE_BUFFER = 0x3B /* Sec. 7.29: Optional */ +}; + +#pragma mark - +#pragma mark 0x04 SBC Write Once Commands +/* Commands defined by the T10:990-D SCSI-3 Block Commands (SBC) command + * specification. The definitions and section numbers are based on section 6.3 + * of the revision 8c, 13 November 1997 version of the specification. + */ +enum +{ + kSBCWOCmd_CHANGE_DEFINITION = 0x40, /* SPC: Optional */ + kSBCWOCmd_COMPARE = 0x39, /* SPC: Optional */ + kSBCWOCmd_COPY = 0x18, /* SPC: Optional */ + kSBCWOCmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional*/ + kSBCWOCmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSBCWOCmd_LOCK_UNLOCK_CACHE = 0x36, /* Sec. 6.1.2: Optional */ + kSBCWOCmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSBCWOCmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSBCWOCmd_MEDIUM_SCAN = 0x38, /* Sec. 6.2.3: Optional */ + kSBCWOCmd_MODE_SELECT_6 = 0x15, /* SPC: Optional */ + kSBCWOCmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSBCWOCmd_MODE_SENSE_6 = 0x1A, /* SPC: Optional */ + kSBCWOCmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSBCWOCmd_MOVE_MEDIUM = 0xA5, /* SMC: Optional */ + kSBCWOCmd_PERSISTENT_RESERVE_IN = 0x5E, /* SPC: Optional */ + kSBCWOCmd_PERSISTENT_RESERVE_OUT = 0x5F, /* SPC: Optional */ + kSBCWOCmd_PREFETCH = 0x34, /* Sec. 6.1.3: Optional */ + kSBCWOCmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* SPC: Optional */ + kSBCWOCmd_READ_6 = 0x08, /* Sec. 6.1.4: Optional */ + kSBCWOCmd_READ_10 = 0x28, /* Sec. 6.1.5: Mandatory */ + kSBCWOCmd_READ_12 = 0xA8, /* Sec. 6.2.4: Optional */ + kSBCWOCmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSBCWOCmd_READ_CAPACITY = 0x25, /* Sec. 6.1.6: Mandatory */ + kSBCWOCmd_READ_ELEMENT_STATUS = 0xB8, /* SMC: Optional */ + kSBCWOCmd_READ_LONG = 0x3E, /* Sec. 6.1.8: Optional */ + kSBCWOCmd_REASSIGN_BLOCKS = 0x07, /* Sec. 6.1.9: Optional */ + kSBCWOCmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSBCWOCmd_RELEASE_6 = 0x17, /* SPC: Optional */ + kSBCWOCmd_RELEASE_10 = 0x57, /* SPC: Mandatory */ + kSBCWOCmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSBCWOCmd_RESERVE_6 = 0x16, /* SPC: Optional */ + kSBCWOCmd_RESERVE_10 = 0x56, /* SPC: Mandatory */ + kSBCWOCmd_REZERO_UNIT = 0x01, /* Obsolete */ + kSBCWOCmd_SEARCH_DATA_EQUAL_10 = 0x31, /* Obsolete */ + kSBCWOCmd_SEARCH_DATA_EQUAL_12 = 0xB1, /* Obsolete */ + kSBCWOCmd_SEARCH_DATA_HIGH_10 = 0x30, /* Obsolete */ + kSBCWOCmd_SEARCH_DATA_HIGH_12 = 0xB0, /* Obsolete */ + kSBCWOCmd_SEARCH_DATA_LOW_10 = 0x32, /* Obsolete */ + kSBCWOCmd_SEARCH_DATA_LOW_12 = 0xB2, /* Obsolete */ + kSBCWOCmd_SEEK_6 = 0x0B, /* Obsolete */ + kSBCWOCmd_SEEK_10 = 0x2B, /* Sec. 6.1.12: Optional */ + kSBCWOCmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSBCWOCmd_SET_LIMITS_10 = 0x33, /* Sec. 6.1.13: Optional */ + kSBCWOCmd_SET_LIMITS_12 = 0xB3, /* Sec. 6.2.8: Optional */ + kSBCWOCmd_START_STOP_UNIT = 0x1B, /* Sec. 6.1.14: Optional */ + kSBCWOCmd_SYNCHRONIZE_CACHE = 0x35, /* Sec. 6.1.15: Optional */ + kSBCWOCmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSBCWOCmd_VERIFY_10 = 0x2F, /* Sec. 6.2.10: Optional */ + kSBCWOCmd_VERIFY_12 = 0xAF, /* Sec. 6.2.11: Optional */ + kSBCWOCmd_WRITE_6 = 0x0A, /* Sec. 6.1.17: Optional */ + kSBCWOCmd_WRITE_10 = 0x2A, /* Sec. 6.2.10: Mandatory*/ + kSBCWOCmd_WRITE_12 = 0xAA, /* Sec. 6.2.13: Optional */ + kSBCWOCmd_WRITE_AND_VERIFY_10 = 0x2E, /* Sec. 6.2.14: Optional */ + kSBCWOCmd_WRITE_AND_VERIFY_12 = 0xAE, /* Sec. 6.2.15: Optional */ + kSBCWOCmd_WRITE_BUFFER = 0x3B, /* SPC: Optional */ + kSBCWOCmd_WRITE_LONG = 0x3F /* Sec. 6.1.20: Optional */ +}; + +#pragma mark - +#pragma mark 0x05 MMC CD-ROM Commands +/* Commands defined by the T10:1363-D SCSI Multimedia Commands-3 (MMC-3) + * specification. The definitions and section numbers are based on section 6.1 + * of the revision 01, March 03, 2000 version of the specification. + * + * NOTE: The comments following each command may not be accurate. These are + * not from the MMC-3 specification, but have been derived from the SCSI-2 and + * original MMC specifications. Unlike the other SCSI command specifications, + * MMC-2 and MMC-3 do not provide a command requirement type and therefore does + * not relist the SPC commands with these requirements as they apply to MMC + * devices. The MMC-2 and MMC-3 specifications also refer back to the SBC + * specification which seems invalid since MMC devices do not represent a + * Peripheral Device Type defined by SBC. It is assumed that the SBC + * references refer to the Peripheral Device Type 0x00 - Direct Access Commands + * definitions from that specification. + */ +enum +{ + kMMCCmd_BLANK = 0xA1, /* Sec. 6.1.1: */ + kMMCCmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kMMCCmd_CLOSE_TRACK_SESSION = 0x5B, /* Sec. 6.1.2: */ + kMMCCmd_COMPARE = 0x39, /* SPC: Optional */ + kMMCCmd_COPY = 0x18, /* SPC: Optional */ + kMMCCmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional */ + kMMCCmd_ERASE = 0x2C, /* SBC: */ + kMMCCmd_FORMAT_UNIT = 0x04, /* Sec. 6.1.3: */ + kMMCCmd_GET_CONFIGURATION = 0x46, /* Sec. 6.1.4: */ + kMMCCmd_GET_EVENT_STATUS_NOTIFICATION = 0x4A, /* Sec. 6.1.5: */ + kMMCCmd_GET_PERFORMANCE = 0xAC, /* Sec. 6.1.6: */ + kMMCCmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kMMCCmd_LOAD_UNLOAD_MEDIUM = 0xA6, /* Sec. 6.1.7: */ + kMMCCmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kMMCCmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kMMCCmd_MECHANISM_STATUS = 0xBD, /* Sec. 6.1.8: */ + kMMCCmd_MODE_SELECT_6 = 0x15, /* SPC: Mandatory */ + kMMCCmd_MODE_SELECT_10 = 0x55, /* SPC: Mandatory */ + kMMCCmd_MODE_SENSE_6 = 0x1A, /* SPC: Mandatory */ + kMMCCmd_MODE_SENSE_10 = 0x5A, /* SPC: Mandatory */ + kMMCCmd_PAUSE_RESUME = 0x4B, /* Sec. 6.1.9: */ + kMMCCmd_PLAY_AUDIO_10 = 0x45, /* Sec. 6.1.10: */ + kMMCCmd_PLAY_AUDIO_12 = 0xA5, /* Sec. 6.1.11: */ + kMMCCmd_PLAY_AUDIO_MSF = 0x47, /* Sec. 6.1.12: */ + kMMCCmd_PLAY_AUDIO_TRACK_INDEX = 0x48, /* Obsolete */ + kMMCCmd_PLAY_CD = 0xBC, /* Sec. 6.1.13: */ + kMMCCmd_PLAY_RELATIVE_10 = 0x49, /* Obsolete */ + kMMCCmd_PLAY_RELATIVE_12 = 0xA9, /* Obsolete */ + kMMCCmd_PREFETCH = 0x34, /* Optional */ + kMMCCmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* Optional */ + kMMCCmd_READ_6 = 0x08, /* Optional */ + kMMCCmd_READ_10 = 0x28, /* Mandatory */ + kMMCCmd_READ_12 = 0xA8, /* Optional */ + kMMCCmd_READ_BUFFER = 0x3C, /* Optional */ + kMMCCmd_READ_BUFFER_CAPACITY = 0x5C, /* Sec. 6.1.15: */ + kMMCCmd_READ_CD = 0xBE, /* Sec. 6.1.16: */ + kMMCCmd_READ_CD_MSF = 0xB9, /* Sec. 6.1.17: */ + kMMCCmd_READ_CAPACITY = 0x25, /* Sec. 6.1.18: */ + kMMCCmd_READ_DISC_INFORMATION = 0x51, /* Sec. 6.1.19: */ + kMMCCmd_READ_DVD_STRUCTURE = 0xAD, /* Sec. 6.1.20: */ + kMMCCmd_READ_DISC_STRUCTURE = 0xAD, /* Sec. 6.1.20: */ + kMMCCmd_READ_FORMAT_CAPACITIES = 0x23, /* Sec. 6.1.21: */ + kMMCCmd_READ_HEADER = 0x44, /* Sec. 6.1.22: */ + kMMCCmd_READ_LONG = 0x3E, /* Optional */ + kMMCCmd_READ_MASTER_CUE = 0x59, /* Sec. 6.1.23: */ + kMMCCmd_READ_SUB_CHANNEL = 0x42, /* Sec. 6.1.24: */ + kMMCCmd_READ_TOC_PMA_ATIP = 0x43, /* Sec. 6.1.25: */ + kMMCCmd_READ_TRACK_INFORMATION = 0x52, /* Sec. 6.1.27: */ + kMMCCmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* Optional */ + kMMCCmd_RELEASE_6 = 0x17, /* Mandatory */ + kMMCCmd_RELEASE_10 = 0x57, /* Optional */ + kMMCCmd_REPAIR_TRACK = 0x58, /* Sec. 6.1.28: */ + kMMCCmd_REPORT_KEY = 0xA4, /* Sec. 6.1.29: */ + kMMCCmd_REQUEST_SENSE = 0x03, /* Mandatory */ + kMMCCmd_RESERVE_6 = 0x16, /* Mandatory */ + kMMCCmd_RESERVE_10 = 0x56, /* Optional */ + kMMCCmd_RESERVE_TRACK = 0x53, /* Sec. 6.1.30: */ + kMMCCmd_SCAN_MMC = 0xBA, /* Sec. 6.1.31: */ + kMMCCmd_SEARCH_DATA_EQUAL_10 = 0x31, /* Obsolete */ + kMMCCmd_SEARCH_DATA_EQUAL_12 = 0xB1, /* Obsolete */ + kMMCCmd_SEARCH_DATA_HIGH_10 = 0x30, /* Obsolete */ + kMMCCmd_SEARCH_DATA_HIGH_12 = 0xB0, /* Obsolete */ + kMMCCmd_SEARCH_DATA_LOW_10 = 0x32, /* Obsolete */ + kMMCCmd_SEARCH_DATA_LOW_12 = 0xB2, /* Obsolete */ + kMMCCmd_SEEK_6 = 0x0B, /* Obsolete */ + kMMCCmd_SEEK_10 = 0x2B, /* SBC: */ + kMMCCmd_SEND_CUE_SHEET = 0x5D, /* Sec. 6.1.32: */ + kMMCCmd_SEND_DIAGNOSTICS = 0x1D, /* Mandatory */ + kMMCCmd_SEND_DVD_STRUCTURE = 0xBF, /* Sec. 6.1.33: */ + kMMCCmd_SEND_EVENT = 0xA2, /* Sec. 6.1.34: */ + kMMCCmd_SEND_KEY = 0xA3, /* Sec. 6.1.35: */ + kMMCCmd_SEND_OPC_INFORMATION = 0x54, /* Sec. 6.1.36: */ + kMMCCmd_SET_CD_SPEED = 0xBB, /* Sec. 6.1.37: */ + kMMCCmd_SET_LIMITS_10 = 0x33, /* Optional */ + kMMCCmd_SET_LIMITS_12 = 0xB3, /* Optional */ + kMMCCmd_SET_READ_AHEAD = 0xA7, /* Sec. 6.1.38: */ + kMMCCmd_SET_STREAMING = 0xB6, /* Sec. 6.1.39: */ + kMMCCmd_START_STOP_UNIT = 0x1B, /* Optional */ + kMMCCmd_STOP_PLAY_SCAN = 0x4E, /* Sec. 6.1.40: */ + kMMCCmd_SYNCHRONIZE_CACHE = 0x35, /* Sec. 6.1.41: */ + kMMCCmd_TEST_UNIT_READY = 0x00, /* Mandatory */ + kMMCCmd_VERIFY_10 = 0x2F, /* Optional */ + kMMCCmd_VERIFY_12 = 0xAF, /* Optional */ + kMMCCmd_WRITE_10 = 0x2A, /* Sec. 6.1.42: */ + kMMCCmd_WRITE_12 = 0xAA, /* Sec. 6.1.43: */ + kMMCCmd_WRITE_AND_VERIFY_10 = 0x2E, /* Sec. 6.1.44: */ + kMMCCmd_WRITE_BUFFER = 0x3B /* Optional */ +}; + +#pragma mark - +#pragma mark 0x06 SGC Scanner Commands +/* Commands defined by the T10:998-D SCSI-3 Graphics Commands (SGC) + * specification. The definitions and section numbers are based on section 6 + * of the revision 0, April 1995 version of the specification. + */ +enum +{ + kSGCCmd_CHANGE_DEFINITION = 0x40, /* SPC: Optional */ + kSGCCmd_COMPARE = 0x39, /* SPC: Optional */ + kSGCCmd_COPY = 0x18, /* SPC: Optional */ + kSGCCmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional */ + kSGCCmd_GET_DATA_BUFFER_STATUS = 0x34, /* Sec. 6.1.1: Optional */ + kSGCCmd_GET_WINDOW = 0x25, /* Sec. 6.1.2: Optional */ + kSGCCmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSGCCmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSGCCmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSGCCmd_MODE_SELECT_6 = 0x15, /* SPC: Optional */ + kSGCCmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSGCCmd_MODE_SENSE_6 = 0x1A, /* SPC: Optional */ + kSGCCmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSGCCmd_OBJECT_POSITION = 0x31, /* Sec. 6.1.3: Optional */ + kSGCCmd_PORT_STATUS = 0x11, /* SPC (??): Mandatory + * for dual port devices */ + kSGCCmd_READ = 0x28, /* Sec. 6.1.4: Mandatory */ + kSGCCmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSGCCmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSGCCmd_RELEASE_6 = 0x17, /* SPC: Mandatory */ + kSGCCmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSGCCmd_RESERVE_6 = 0x16, /* SPC: Mandatory */ + kSGCCmd_SCAN = 0x1B, /* Sec. 6.1.5: Optional */ + kSGCCmd_SEND = 0x1B, /* Sec. 6.1.6: Optional */ + kSGCCmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSGCCmd_SET_WINDOW = 0x24, /* Sec. 6.1.7: Mandatory */ + kSGCCmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSGCCmd_WRITE_BUFFER = 0x3B /* SPC: Optional */ +}; + +#pragma mark - +#pragma mark 0x07 SBC Optical Media Commands +/* Commands defined by the T10:990-D SCSI-3 Block Commands (SBC) + * (revision 8c, 13 November 1998) command specification. + */ + +#pragma mark - +#pragma mark 0x08 SMC Medium Changer Commands +/* Commands defined by the T10:1228-D SCSI-3 Medium Changer Commands-2 (SMC-2) + * (revision 0, March 16, 2000) command specification. + */ +enum +{ + /* Commands For Independent Medium Changers */ + kSMCCmd_EXCHANGE_MEDIUM = 0xA6, /* Optional */ + kSMCCmd_INITIALIZE_ELEMENT_STATUS = 0x07, /* Optional */ + kSMCCmd_MODE_SELECT_6 = 0x15, /* Optional */ + kSMCCmd_MODE_SELECT_10 = 0x55, /* Optional */ + kSMCCmd_MODE_SENSE_6 = 0x1A, /* Optional */ + kSMCCmd_MODE_SENSE_10 = 0x5A, /* Optional */ + kSMCCmd_MOVE_MEDIUM = 0xA5, /* Mandatory */ + kSMCCmd_PERSISTENT_RESERVE_IN = 0x5E, /* Optional */ + kSMCCmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Optional */ + kSMCCmd_POSITION_TO_ELEMENT = 0x2B, /* Optional */ + kSMCCmd_READ_ELEMENT_STATUS = 0xB8, /* Mandatory */ + kSMCCmd_RELEASE_ELEMENT_6 = 0x16, /* Optional */ + kSMCCmd_RELEASE_ELEMENT_10 = 0x56, /* Optional */ + kSMCCmd_REQUEST_VOLUME_ELEMENT_ADDRESS = 0xB5, /* Optional */ + kSMCCmd_REQUEST_SENSE = 0x03, /* Mandatory */ + kSMCCmd_RESERVE_ELEMENT_6 = 0x16, /* Optional */ + kSMCCmd_RESERVE_ELEMENT_10 = 0x56 /* Optional */ +}; + +#pragma mark - +#pragma mark 0x09 SSC Communications Commands +/* Commands defined by the T10:997-D SCSI-3 Stream Commands (SSC) + * (revision 22, January 1, 2000) command specification. + */ + +#pragma mark - +#pragma mark 0x0A ASC IT8 Prepress Commands +#pragma mark 0x0B ASC IT8 Prepress Commands +/* Commands defined by the ASC IT8 specification + * (revision xx, month day, year) command specification. + */ +#if 0 +enum +{ +}; +#endif + +#pragma mark - +#pragma mark 0x0C SCC Array Controller Commands +/* Commands defined by the ANSI NCITS.318-199x SCSI Controller + * Commands (SCC-2) ratified command specification. + */ +enum +{ + kSCCCmd_MAINTENANCE_IN = 0xA3, /* Mandatory */ + kSCCCmd_MAINTENANCE_OUT = 0xA4, /* Optional */ + kSCCCmd_MODE_SELECT_6 = 0x15, /* Optional */ + kSCCCmd_MODE_SELECT_10 = 0x55, /* Optional */ + kSCCCmd_MODE_SENSE_6 = 0x1A, /* Optional */ + kSCCCmd_MODE_SENSE_10 = 0x5A, /* Optional */ + kSCCCmd_PERSISTENT_RESERVE_IN = 0x5E, /* Optional */ + kSCCCmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Optional */ + kSCCCmd_PORT_STATUS = 0x1F, /* Optional */ + kSCCCmd_REDUNDANCY_GROUP_IN = 0xBA, /* Mandatory */ + kSCCCmd_REDUNDANCY_GROUP_OUT = 0xBB, /* Optional */ + kSCCCmd_RELEASE_6 = 0x17, /* Optional */ + kSCCCmd_RELEASE_10 = 0x57, /* Optional */ + kSCCCmd_REPORT_LUNS = 0xA0, /* Mandatory */ + kSCCCmd_REQUEST_SENSE = 0x03, /* Mandatory */ + kSCCCmd_RESERVE_6 = 0x16, /* Optional */ + kSCCCmd_RESERVE_10 = 0x56, /* Optional*/ + kSCCCmd_SEND_DIAGNOSTICS = 0x1D, /* Optional */ + kSCCCmd_SPARE_IN = 0xBC, /* Mandatory */ + kSCCCmd_SPARE_OUT = 0xBD /* Optional */ +}; + +#pragma mark - +#pragma mark 0x0D SES Enclosure Services Commands +/* Commands defined by the T10:1212-D SCSI-3 Enclosure Services (SES) + * (revision 8b, February 11, 1998) command specification. + */ +enum +{ + kSESCmd_MODE_SELECT_6 = 0x15, /* Optional */ + kSESCmd_MODE_SELECT_10 = 0x55, /* Optional */ + kSESCmd_MODE_SENSE_6 = 0x1A, /* Optional */ + kSESCmd_MODE_SENSE_10 = 0x5A, /* Optional */ + kSESCmd_PERSISTENT_RESERVE_IN = 0x5E, /* Optional */ + kSESCmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Optional */ + kSESCmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x17, /* Mandatory */ + kSESCmd_RELEASE_6 = 0x17, /* Optional */ + kSESCmd_RELEASE_10 = 0x57, /* Optional */ + kSESCmd_REQUEST_SENSE = 0x03, /* Mandatory */ + kSESCmd_RESERVE_6 = 0x16, /* Optional */ + kSESCmd_RESERVE_10 = 0x56, /* Optional */ + kSESCmd_SEND_DIAGNOSTICS = 0x1D /* Mandatory */ +}; + +#pragma mark - +#pragma mark 0x0E RBC Reduced Block Commands +/* Commands defined by the T10:1240-D Reduced Block Commands (RBC) + * (revision 10a, August 18, 1999) command specification. + */ +enum +{ + kRBCCmd_FORMAT_UNIT = 0x04, /* Optional */ + kRBCCmd_READ_10 = 0x28, /* Mandatory */ + kRBCCmd_READ_CAPACITY = 0x25, /* Mandatory */ + kRBCCmd_START_STOP_UNIT = 0x1B, /* Mandatory */ + kRBCCmd_SYNCHRONIZE_CACHE = 0x35, /* Optional */ + kRBCCmd_VERIFY_10 = 0x2F, /* Mandatory */ + kRBCCmd_WRITE_10 = 0x2A, /* Mandatory */ + kRBCCmd_WRITE_BUFFER = 0x3B /* Mandatory for fixed media + * Optional for removable */ +}; + +#pragma mark - +#pragma mark 0x0F OCRW Optical Card Commands +/* Commands defined by the ISO/IEC 14776-381 SCSI Specification for + * Optical Card Reader/Writer (OCRW) ratified command specification. + */ +#if 0 +enum +{ +}; +#endif + +#pragma mark - +#pragma mark 0x11 OSD Object-based Storage Commands +/* Commands defined by the T10:1355-D Object-based Storage Commands (OSD) + * (revision 1, 18 May 2000) command specification. + */ +#if 0 +enum +{ +}; +#endif + +#pragma mark - +#pragma mark 0x15 RMC Simplified Multimedia Commands +/* Commands defined by the T10:1364-D Reduced Multimedia Commands (RMC) + * (revision 1, November 11, 1999) command specification. + */ +#if 0 +enum +{ +}; +#endif + +#endif /* _SCSI_COMMAND_OPERATION_CODES_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/SCSIPort.h b/QualcommWireless/include/IOKit/scsi/SCSIPort.h new file mode 100644 index 0000000..8eefbeb --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/SCSIPort.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2004-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_PORTS_H_ +#define _IOKIT_SCSI_PORTS_H_ + + +/*! @header SCSIPort + @discussion + This file contains all the definitions for SCSIPort notifications and status. +*/ + + +/*! +@enum kSCSIPort_NotificationStatusChange +@discussion +Message definition to be used with the messageClients +call to inform of a change in port status. +*/ +enum +{ + kSCSIPort_NotificationStatusChange = 0x68000001 +}; + + +/*! @typedef SCSIPortStatus + @abstract 32-bit number to represent a SCSIPortStatus. + @discussion Type for SCSIPortStatus. +*/ + +typedef UInt32 SCSIPortStatus; + +/*! @enum SCSI Port Status Values + @discussion Definitions for the possible port status values +*/ +enum +{ + /*! + @constant kSCSIPort_StatusOnline + The port is online. + */ + kSCSIPort_StatusOnline = 0, + + /*! + @constant kSCSIPort_StatusOffline + The port is offline (e.g. unplugged cable). + */ + kSCSIPort_StatusOffline = 1, + + /*! + @constant kSCSIPort_StatusFailure + Driver has detected unrecoverable port failure (e.g. hardware port failure) + */ + kSCSIPort_StatusFailure = 2 +}; + +#endif /* _IOKIT_SCSI_PORTS_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/SCSITask.h b/QualcommWireless/include/IOKit/scsi/SCSITask.h new file mode 100644 index 0000000..52939fa --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/SCSITask.h @@ -0,0 +1,465 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_SCSI_TASK_H_ +#define _IOKIT_SCSI_TASK_H_ + + +#if KERNEL +#include <IOKit/IOTypes.h> +#else +#include <CoreFoundation/CoreFoundation.h> +#endif + + +/*! @header SCSITask +SCSITask typedefs and constants used inside the kernel and user space. + +Note that the SCSITaskIdentifier is an opaque object and that directly +casting the SCSITaskIdentifier to any other type is discouraged. The SCSITask +implementation changes when necessary to accomodate architectural changes, +performance improvements, and bug fixes. + +Device and protocol layer drivers that need to access information +contained in a SCSITask should use the appropriate accessor methods in +IOSCSIPrimaryCommandsDevice.h or IOSCSIProtocolServices.h +*/ + + +/*! @typedef SCSIDeviceIdentifier + @abstract 64-bit number to represent a SCSI Device. + @discussion If the identifier can either be that of an initiator or a target, + SCSIDeviceIdentifier should be used. +*/ + +typedef UInt64 SCSIDeviceIdentifier; + +/*! @typedef SCSITargetIdentifier + @abstract 64-bit number to represent a SCSI Target Device. + @discussion If the identifier is for a target only and not an initiator, then + SCSITargetIdentifier should be used. +*/ + +typedef SCSIDeviceIdentifier SCSITargetIdentifier; + +/*! @typedef SCSIInitiatorIdentifier + @abstract 64-bit number to represent a SCSI Initiator Device. + @discussion If the identifier is for an initiator only and not a target, then + SCSIInitiatorIdentifier should be used. +*/ + +typedef SCSIDeviceIdentifier SCSIInitiatorIdentifier; + +/*! @typedef SCSILogicalUnitBytes[8] + @abstract 8-Byte array to represent LUN information + @discussion The SCSI Primary Commands specification treats the 64-bits + of LUN information as 4 2-byte structures. + + Use of the 64-bit SCSILogicalUnitNumber is now deprecated. Since it + was not defined on Mac OS X how the 64-bits were encoded for hierarchical + units and all usage was simply as a 64-bit number, changing the encoding + scheme now would result in non-binary compatible code. New APIs have been + added to retrieve the LUN bytes from the SCSITask and set them in the SCSITask. + */ +typedef UInt8 SCSILogicalUnitBytes[8]; +typedef UInt64 SCSILogicalUnitNumber; // DEPRECATED + + +/*! @typedef SCSITaggedTaskIdentifier + @abstract 64-bit number to represent a unique task identifier. + @discussion The Tagged Task Identifier is used when a Task has a Task Attribute other + than SIMPLE. The SCSI Application Layer client that controls the Logical + Unit for which a Task is intended is required to guarantee that the Task + Tag Identifier is unique. Zero cannot be used a a Tag value as this is used + to when a Tagged Task Identifier value is needed for a Task with a SIMPLE + attribute. +*/ + +typedef UInt64 SCSITaggedTaskIdentifier; + +/*! + @enum Untagged Task Identifier + @discussion The Untagged Task Identifier is used to indicate no unique tag + is associated with the Task. + @constant kSCSIUntaggedTaskIdentifier This value means the task is untagged. + */ + +enum +{ + kSCSIUntaggedTaskIdentifier = 0 +}; + +/*! + @typedef SCSITaskAttribute + @abstract Attributes for task delivery. + @discussion The Task Attribute defines how this task should be managed + when determing order for queueing and submission to the + appropriate device server. The Task Attribute is set by the SCSI + Application Layer and cannot be modified by the SCSI Protocol Layer. + @constant kSCSITask_SIMPLE The task has a simple attribute. + @constant kSCSITask_ORDERED The task has an ordered attribute. + @constant kSCSITask_HEAD_OF_QUEUE The task has a head-of-queue attribute. + @constant kSCSITask_ACA The task has an auto-contingent-allegiance attribute. + */ + +typedef enum SCSITaskAttribute +{ + kSCSITask_SIMPLE = 0, + kSCSITask_ORDERED = 1, + kSCSITask_HEAD_OF_QUEUE = 2, + kSCSITask_ACA = 3 +} SCSITaskAttribute; + +/*! + @typedef SCSITaskState + @abstract Attributes for task state. + @discussion The Task State represents the current state of the task. + The state is set to NEW_TASK when the task is created. The SCSI Protocol + Layer will then adjust the state as the task is queued and during + execution. The SCSI Application Layer can examine the state to monitor + the progress of a task. The Task State can only be modified by the SCSI + Protocol Layer. The SCSI Application Layer can only read the state. + @constant kSCSITaskState_NEW_TASK The task state is new task. + @constant kSCSITaskState_ENABLED The task is enabled and queued. + @constant kSCSITaskState_BLOCKED The task is blocked. + @constant kSCSITaskState_DORMANT The task is dormant. + @constant kSCSITaskState_ENDED The task is complete. + */ + +typedef enum SCSITaskState +{ + kSCSITaskState_NEW_TASK = 0, + kSCSITaskState_ENABLED = 1, + kSCSITaskState_BLOCKED = 2, + kSCSITaskState_DORMANT = 3, + kSCSITaskState_ENDED = 4 +} SCSITaskState; + + +/*! + @typedef SCSIServiceResponse + @abstract Attributes for task service response. + @discussion The Service Response represents the execution status of + a service request made to a Protocol Services Driver. The Service + Response can only be modified by the SCSI Protocol Layer. The SCSI + Application Layer can only read the state. + */ + +typedef enum SCSIServiceResponse +{ + /*! + @constant kSCSIServiceResponse_Request_In_Process + Not defined in SAM specification, but is a service response used + for asynchronous commands that are not yet completed. + */ + kSCSIServiceResponse_Request_In_Process = 0, + + /*! + @constant kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE + The service request failed because of a delivery or target failure. + */ + kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE = 1, + + /*! + @constant kSCSIServiceResponse_TASK_COMPLETE + The task completed. + */ + kSCSIServiceResponse_TASK_COMPLETE = 2, + + /*! + @constant kSCSIServiceResponse_LINK_COMMAND_COMPLETE + The linked command completed. + */ + kSCSIServiceResponse_LINK_COMMAND_COMPLETE = 3, + + /*! + @constant kSCSIServiceResponse_FUNCTION_COMPLETE + The task management function completed. + */ + kSCSIServiceResponse_FUNCTION_COMPLETE = 4, + + /*! + @constant kSCSIServiceResponse_FUNCTION_REJECTED + The task management function was rejected. + */ + kSCSIServiceResponse_FUNCTION_REJECTED = 5 +} SCSIServiceResponse; + +/*! + @typedef SCSITaskStatus + @abstract Attributes for task status. + @discussion The Task Status represents the completion status + of the task which provides the SCSI Application Layer with + additional information about how to procede in handling a + completed task. + + The SCSI Architecture Model specification only defines task + status values for when a task completes with a service response + of either TASK_COMPLETED or LINK_COMMAND_COMPLETE. + + Since additional information will aid in error recovery when + a task fails to be completed by a device due to a service + response of kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE, + additional values have been defined that can be returned by the + SCSI Protocol Layer to inform the SCSI Application Layer of the + cause of the delivery failure. + + The Task Status can only be modified by the SCSI Protocol Layer. + The SCSI Application Layer can only read the status +*/ +typedef enum SCSITaskStatus +{ + + /*! + @constant kSCSITaskStatus_GOOD + The task completed with a status of GOOD. + */ + + kSCSITaskStatus_GOOD = 0x00, + + /*! + @constant kSCSITaskStatus_CHECK_CONDITION + The task completed with a status of CHECK_CONDITION. Additional + information about the condition should be available in the sense data. + */ + + kSCSITaskStatus_CHECK_CONDITION = 0x02, + + /*! + @constant kSCSITaskStatus_CONDITION_MET + The task completed with a status of CONDITION_MET. + */ + + kSCSITaskStatus_CONDITION_MET = 0x04, + + /*! + @constant kSCSITaskStatus_BUSY + The task completed with a status of BUSY. The device server might need + time to process a request and a delay may be required. + */ + kSCSITaskStatus_BUSY = 0x08, + + /*! + @constant kSCSITaskStatus_INTERMEDIATE + The task completed with a status of INTERMEDIATE. + */ + kSCSITaskStatus_INTERMEDIATE = 0x10, + + /*! + @constant kSCSITaskStatus_INTERMEDIATE_CONDITION_MET + The task completed with a status of INTERMEDIATE_CONDITION_MET. + */ + kSCSITaskStatus_INTERMEDIATE_CONDITION_MET = 0x14, + + /*! + @constant kSCSITaskStatus_RESERVATION_CONFLICT + The task completed with a status of RESERVATION_CONFLICT. + */ + kSCSITaskStatus_RESERVATION_CONFLICT = 0x18, + + /*! + @constant kSCSITaskStatus_TASK_SET_FULL + The task completed with a status of TASK_SET_FULL. The device server + may need to complete a task before the initiator sends another. + */ + kSCSITaskStatus_TASK_SET_FULL = 0x28, + + /*! + @constant kSCSITaskStatus_ACA_ACTIVE + The task completed with a status of ACA_ACTIVE. The device server may + need the initiator to clear the Auto-Contingent Allegiance condition + before it will respond to new commands. + */ + kSCSITaskStatus_ACA_ACTIVE = 0x30, + + /*! + @constant kSCSITaskStatus_TaskTimeoutOccurred + If a task is aborted by the SCSI Protocol Layer due to it exceeding + the timeout value specified by the task, the task status shall be + set to kSCSITaskStatus_TaskTimeoutOccurred. + */ + + kSCSITaskStatus_TaskTimeoutOccurred = 0x01, + + /*! + @constant kSCSITaskStatus_ProtocolTimeoutOccurred + If a task is aborted by the SCSI Protocol Layer due to it exceeding a + timeout value specified by the support for the protocol or a related + specification, the task status shall be set to + kSCSITaskStatus_ProtocolTimeoutOccurred. + */ + + kSCSITaskStatus_ProtocolTimeoutOccurred = 0x02, + + /*! + @constant kSCSITaskStatus_DeviceNotResponding + If a task is unable to be delivered due to a failure of the device not + accepting the task or the device acknowledging the attempt to send it the + device the task status shall be set to kSCSITaskStatus_DeviceNotResponding. + This will allow the SCSI Application driver to perform the necessary steps + to try to recover the device. This shall only be reported after the SCSI + Protocol Layer driver has attempted all protocol specific attempts to recover + the device. + */ + + kSCSITaskStatus_DeviceNotResponding = 0x03, + + /*! + @constant kSCSITaskStatus_DeviceNotPresent + If the task is unable to be delivered because the device has been + detached, the task status shall be set to kSCSITaskStatus_DeviceNotPresent. + This will allow the SCSI Application Layer to halt the sending of tasks + to the device and, if supported, perform any device failover or system + cleanup. + */ + kSCSITaskStatus_DeviceNotPresent = 0x04, + + /*! + @constant kSCSITaskStatus_DeliveryFailure + If the task is unable to be + delivered to the device due to a failure in the SCSI Protocol Layer, + such as a bus reset or communications error, but the device is is + known to be functioning properly, the task status shall be set to + kSCSITaskStatus_DeliveryFailure. This can also be reported if the + task could not be delivered due to a protocol error that has since + been corrected. + */ + kSCSITaskStatus_DeliveryFailure = 0x05, + + /*! + @constant kSCSITaskStatus_No_Status + This status is not defined by + the SCSI specifications, but is here to provide a status that can + be returned in cases where there is not status available from the + device or protocol, for example, when the service response is + neither TASK_COMPLETED nor LINK_COMMAND_COMPLETE or when the + service response is SERVICE_DELIVERY_OR_TARGET_FAILURE and the + reason for failure could not be determined. + */ + kSCSITaskStatus_No_Status = 0xFF +} SCSITaskStatus; + +/*! + @enum Command Descriptor Block Size + @discussion Command Descriptor Block Size constants. +*/ +enum +{ + /*! + @constant kSCSICDBSize_Maximum This is the largest size a Command Descriptor + Block can be as specified in SPC-2. + */ + kSCSICDBSize_Maximum = 16, + + /*! + @constant kSCSICDBSize_6Byte Use this for a 6-byte CDB. + */ + kSCSICDBSize_6Byte = 6, + + /*! + @constant kSCSICDBSize_10Byte Use this for a 10-byte CDB. + */ + kSCSICDBSize_10Byte = 10, + + /*! + @constant kSCSICDBSize_12Byte Use this for a 12-byte CDB. + */ + kSCSICDBSize_12Byte = 12, + + /*! + @constant kSCSICDBSize_16Byte Use this for a 16-byte CDB. + */ + kSCSICDBSize_16Byte = 16 +}; + +typedef UInt8 SCSICommandDescriptorBlock[kSCSICDBSize_Maximum]; + +/*! + @enum Data Transfer Direction + @discussion DataTransferDirection constants. +*/ +enum +{ + /*! + @constant kSCSIDataTransfer_NoDataTransfer Use this for tasks + that transfer no data. + */ + kSCSIDataTransfer_NoDataTransfer = 0x00, + + /*! + @constant kSCSIDataTransfer_FromInitiatorToTarget Use this for tasks that transfer + data from the initiator to the target. + */ + kSCSIDataTransfer_FromInitiatorToTarget = 0x01, + + /*! + @constant kSCSIDataTransfer_FromTargetToInitiator Use this for tasks that transfer + data from the target to the initiator. + */ + kSCSIDataTransfer_FromTargetToInitiator = 0x02 +}; + + +#if defined(KERNEL) && defined(__cplusplus) + +/* Libkern includes */ +#include <libkern/c++/OSObject.h> + + +/*! + @enum SCSITaskMode + @discussion The SCSI Task mode is used by the SCSI + Protocol Layer to indicate what mode the task is executing. +*/ +typedef enum SCSITaskMode +{ + kSCSITaskMode_CommandExecution = 1, + kSCSITaskMode_Autosense = 2 +} SCSITaskMode; + +/*! + @typedef SCSITaskIdentifier + @discussion This is an opaque object that represents a task. + This is used so that drivers for both the SCSI Protocol Layer + and the SCSI Application Layer cannot modify the SCSITask object + directly but must instead use the inherited methods to do so. This + allows the implementation of SCSITask to change without directly + impacting device and protocol layer drivers. In addition, it + prevents changing of properties that are not allowed to be + changed by a given layer. +*/ +typedef OSObject * SCSITaskIdentifier; + + +/*! + @typedef SCSITaskCompletion + @discussion This is the typedef for completion routines that + work with SCSITaskIdentifiers. +*/ +typedef void ( *SCSITaskCompletion )( SCSITaskIdentifier completedTask ); + + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_SCSI_TASK_H_ */ diff --git a/QualcommWireless/include/IOKit/scsi/spi/IOSCSIParallelInterfaceController.h b/QualcommWireless/include/IOKit/scsi/spi/IOSCSIParallelInterfaceController.h new file mode 100644 index 0000000..9cd9709 --- /dev/null +++ b/QualcommWireless/include/IOKit/scsi/spi/IOSCSIParallelInterfaceController.h @@ -0,0 +1,1617 @@ +/* + * Copyright (c) 2002-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IO_SCSI_PARALLEL_INTERFACE_CONTROLLER_H__ +#define __IOKIT_IO_SCSI_PARALLEL_INTERFACE_CONTROLLER_H__ + + + /*! + @header IOSCSIParallelInterfaceController + The IOSCSIParallelInterfaceController class and the associated HBA child + class is responsible for the management of all related hardware. This + includes the onboard HBA controller chip and the physical state of the + bus. These classes are not responsible for any of the management of + the SCSI Devices on the bus with the exception of maintaining the queue that + holds the objects representing those SCSI Devices. +*/ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit includes +#include <IOKit/IOService.h> +#include <IOKit/IOWorkLoop.h> +#include <IOKit/IOCommandGate.h> +#include <IOKit/IODMACommand.h> +#include <IOKit/IOInterruptEventSource.h> +#include <IOKit/IOFilterInterruptEventSource.h> +#include <IOKit/IOTimerEventSource.h> +#include <IOKit/IOCommandPool.h> + +// IOKit SCSI ArchitectureModel Family includes +#include <IOKit/scsi/SCSITask.h> +#include <IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h> +#include <IOKit/scsi/SCSIPort.h> + +#include <Availability.h> + +#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED +#error "Missing macOS target version" +#endif + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + + +#define kIOPropertySCSIDeviceFeaturesKey "SCSI Device Features" +#define kIOPropertySCSI_I_T_NexusFeaturesKey "SCSI I_T Nexus Features" + +// Set this key with a value of true in ReportHBAConstraints() to indicate support +// for full 8-byte LUN addressing and use GetLogicalUnitBytes() to obtain the +// full 8-byte LUN when processing commands in ProcessParallelTask(). +#define kIOHierarchicalLogicalUnitSupportKey "SCSI Hierarchical Logical Unit Support" + +// This is the alignment mask used when allocating per-task HBA data. It allows +// the HBA to declare whether or not it supports 64-bit addressability and what the +// minimum byte alignment is for the data. E.g. By specifying 0x0000FFFFFFFFFFFEULL, +// the controller would be indicating that it supports 48-bits of addressability, but +// at a minimum of being 2-byte aligned. +#define kIOMinimumHBADataAlignmentMaskKey "HBA Data Alignment" + +// The Feature Selectors used to identify features of the SCSI Parallel +// Interface. These are used by the DoesHBASupportSCSIParallelFeature +// to report whether the HBA supports a given SCSI Parallel Interface +// feature and are used for requesting negotiation and reporting negotiation +// results between the controller and the device. + +// When the DoesHBASupportSCSIParallelFeature() member routine of the controller +// child class is called, it will return true if the HBA that it controls +// supports the specified SCSIParallelFeature or false if it does not. +typedef enum SCSIParallelFeature +{ + // The selector for support of Wide Data Transfers. Only Wide16 is supported + // as Wide32 has been obsoleted by the SPI-3 specification. + kSCSIParallelFeature_WideDataTransfer = 0, + + // The selector for support of Synchronous Data Transfers. + kSCSIParallelFeature_SynchronousDataTransfer = 1, + + // The selector for support of Quick Arbitration and Selection (QAS). + kSCSIParallelFeature_QuickArbitrationAndSelection = 2, + + // The selector for support of Double Transition (DT) data transfers. + kSCSIParallelFeature_DoubleTransitionDataTransfers = 3, + + // The selector for SPI Information Unit (IU) transfers. + kSCSIParallelFeature_InformationUnitTransfers = 4, + + // Since the Feature selectors are zero base, this will always have the + // correct total. + kSCSIParallelFeature_TotalFeatureCount +} SCSIParallelFeature; + + +typedef enum SCSIParallelFeatureRequest +{ + // This selector indicates that current negotiation + // should be used. + kSCSIParallelFeature_NoNegotiation = 0, + + // This selector indicates that the controller + // should attempt negotiation for the feature + kSCSIParallelFeature_AttemptNegotiation = 1, + + // This selector indicates that the controller + // should clear any negotiation for the feature + kSCSIParallelFeature_ClearNegotiation = 2 +} SCSIParallelFeatureRequest; + +typedef enum SCSIParallelFeatureResult +{ + kSCSIParallelFeature_NegotitiationUnchanged = 0, + kSCSIParallelFeature_NegotitiationCleared = 1, + kSCSIParallelFeature_NegotitiationSuccess = 2 +} SCSIParallelFeatureResult; + + +// The SCSI Message Codes used for MESSAGE IN and MESSAGE OUT phases. +enum SCSIParallelMessages +{ + // Link Control Messages + kSCSIParallelMessage_TASK_COMPLETE = 0x00, + kSCSIParallelMessage_EXTENDED_MESSAGE = 0x01, + kSCSIParallelMessage_SAVE_DATA_POINTER = 0x02, + kSCSIParallelMessage_RESTORE_POINTERS = 0x03, + kSCSIParallelMessage_DISCONNECT = 0x04, + kSCSIParallelMessage_INITIATOR_DETECTED_ERROR = 0x05, + kSCSIParallelMessage_MESSAGE_REJECT = 0x07, + kSCSIParallelMessage_NO_OPERATION = 0x08, + kSCSIParallelMessage_MESSAGE_PARITY_ERROR = 0x09, + kSCSIParallelMessage_IGNORE_WIDE_RESIDUE = 0x23, + kSCSIParallelMessage_QAS_REQUEST = 0x55, + kSCSIParallelMessage_IDENTIFY = 0x80, + + // The Message Codes used in the EXTENDED_MESSAGE message. + kSCSIParallelMessage_MODIFY_DATA_POINTER = 0x00, + kSCSIParallelMessage_SYNCHONOUS_DATA_TRANSFER_REQUEST = 0x01, + // Reserved = 0x02 + kSCSIParallelMessage_WIDE_DATA_TRANSFER_REQUEST = 0x03, + kSCSIParallelMessage_PARALLEL_PROTOCOL_REQUEST = 0x04, + // Reserved = 0x05 through 0xFF + + // Task Attribute Message Codes + kSCSIParallelMessage_ACA = 0x24, + kSCSIParallelMessage_HEAD_OF_QUEUE = 0x21, + kSCSIParallelMessage_LINKED_COMMAND_COMPLETE = 0x0A, + kSCSIParallelMessage_ORDERED = 0x22, + kSCSIParallelMessage_SIMPLE = 0x20, + + // Task Management Message Codes + kSCSIParallelMessage_ABORT_TASK = 0x0D, + kSCSIParallelMessage_ABORT_TASK_SET = 0x06, + kSCSIParallelMessage_CLEAR_ACA = 0x16, + kSCSIParallelMessage_CLEAR_TASK_SET = 0x0E, + kSCSIParallelMessage_LOGICAL_UNIT_RESET = 0x17, + kSCSIParallelMessage_TARGET_RESET = 0x0C +}; + +enum +{ + kSCSIParallelTaskControllerIDQueueHead = 0 +}; + +// Notifications +enum +{ + kSCSIControllerNotificationBusReset = 0x68000000 +}; + +// Forward declaration for the internally used Parallel Device object. +class IOSCSIParallelInterfaceDevice; + +// This is the identifier that is used to specify a given parallel Task. +typedef OSObject * SCSIParallelTaskIdentifier; + + +//----------------------------------------------------------------------------- +// Class Declarations +//----------------------------------------------------------------------------- + +/*! @class IOSCSIParallelInterfaceController + @abstract Class that represents a SCSI Host Bus Adapter. + @discussion Class that represents a SCSI Host Bus Adapter. +*/ +class IOSCSIParallelInterfaceController : public IOService +{ + + OSDeclareAbstractStructors ( IOSCSIParallelInterfaceController ) + +#if 0 +#pragma mark - +#pragma mark Client API +#endif + + +public: + + /*! + @function GetSCSIParallelTask + @abstract Method to allow the client to get a SCSIParallelTask + @discussion Get a SCSIParallelTask from the controller so that a request + can be issued to the HBA driver. + @param blockForCommand If the blockForCommand parameter is set to false + and there are no free SCSIParallelTasks, this method will return NULL, + otherwise it will wait for one to become available before returning. + @result If there is a SCSI Parallel Task available, a reference to it + will be returned. + */ + + SCSIParallelTaskIdentifier GetSCSIParallelTask ( bool blockForCommand ); + + /*! + @function FreeSCSIParallelTask + @abstract Method to allow the client to release a SCSIParallelTask + @discussion The FreeSCSIParallelTask method is called by the client when + a SCSIParallelTask has been completed and the associated returnTask + needs to be returned to the pool. + @param returnTask is a reference to the SCSIParallelTaskIdentifier to be + returned. + */ + + void FreeSCSIParallelTask ( SCSIParallelTaskIdentifier returnTask ); + + /*! + @function FindTaskForAddress + @abstract Find a task for a given Task Address, if one exists. + @discussion If a valid Tagged Task Identifier is specified, this method + will return the task specified by the Tagged Task Address if one is + found, or else NULL will be returned. If zero is used as the Tagged + Task Identifier, then this routine will search for an outstanding task + based on the Untagged Task Address and return the task or else, if one + is not found, return NULL. + @param theT is the Target component of the I_T_L or I_T_L_Q nexus. + @param theL is the Logical Unit component of the I_T_L or I_T_L_Q nexus. + @param theQ is the Queue Tag component of the I_T_L_Q nexus. If this is + an I_T_L nexus, then the kSCSIUntaggedTaskIdentifier constant should be + used for theQ. + @result returns a valid SCSIParallelTaskIdentifier or NULL if none + found. + */ + + SCSIParallelTaskIdentifier FindTaskForAddress ( + SCSIDeviceIdentifier theT, + SCSILogicalUnitNumber theL, + SCSITaggedTaskIdentifier theQ ); + + + /*! + @function FindTaskForControllerIdentifier + @abstract Find a task for a given Target and Controller Task Identifier + @discussion Allows the controller child class to find an outstanding task + for a specified target and controller task identifier + @param theTarget is the Target that the task . + @param theIdentifier is the controller task identifier set using the SCSI + Parallel Task's SetControllerTaskIdentifier() method. + @result returns a valid SCSIParallelTaskIdentifier or NULL if none + found. + */ + + SCSIParallelTaskIdentifier FindTaskForControllerIdentifier ( + SCSIDeviceIdentifier theTarget, + UInt64 theIdentifier ); + + + /*! + @function ExecuteParallelTask + @abstract Submit a SCSIParallelTask for execution. + @discussion The ExecuteParallelTask call is made by the client to submit + a SCSIParallelTask for execution. + @param parallelRequest is a reference to the SCSIParallelTaskIdentifier + to be executed. + @result is an appropriate SCSIServiceResponse which are defined in the + file <IOKit/scsi/SCSITask.h>. + */ + + SCSIServiceResponse ExecuteParallelTask ( + SCSIParallelTaskIdentifier parallelRequest ); + + // --- Public API methods provided by HBA child classes ---- + + /*! + @function ReportHBAHighestLogicalUnitNumber + @abstract Gets the Highest Logical Unit Number. + @discussion This method is used to query the HBA child class to + determine what the highest Logical Unit Number that the controller can + address. + @result returns a valid 64-bit logical unit number. + */ + + virtual SCSILogicalUnitNumber ReportHBAHighestLogicalUnitNumber ( void ) = 0; + + /*! + @function DoesHBASupportSCSIParallelFeature + @abstract Queries the HBA child class to determine if it supports a + specific SPI feature. + @discussion Queries the HBA child class to determine if it supports the + specified feature as defined by the SCSI Parallel Interconnect + specifications. + @result Returns true if requested feature is supported. + */ + + virtual bool DoesHBASupportSCSIParallelFeature ( + SCSIParallelFeature theFeature ) = 0; + + /*! + @function InitializeTargetForID + @abstract Called to initialize a target device. + @discussion This method will be called to initialize a target device in + a single-threaded manner. The HBA can use this method to probe the + target or do anything else necessary before the device object is + registered with IOKit for matching. + @result Returns true if the target was successfully initialized. + */ + + virtual bool InitializeTargetForID ( + SCSITargetIdentifier targetID ) = 0; + + // The SCSI Task Management Functions as defined in the SCSI Architecture + // Model - 2 (SAM-2) specification. These are used by the client to request + // the specified function. The controller can complete these immmediately + // by returning the appropriate SCSIServiceResponse, or these can be completed + // asyncronously by the controller returning a SCSIServiceResponse of + // kSCSIServiceResponse_Request_In_Process and then calling the appropriate + // function complete member routine listed in the child class API section. + + virtual SCSIServiceResponse AbortTaskRequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSITaggedTaskIdentifier theQ ) = 0; + + virtual SCSIServiceResponse AbortTaskSetRequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL ) = 0; + + virtual SCSIServiceResponse ClearACARequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL ) = 0; + + virtual SCSIServiceResponse ClearTaskSetRequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL ) = 0; + + virtual SCSIServiceResponse LogicalUnitResetRequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL ) = 0; + + virtual SCSIServiceResponse TargetResetRequest ( + SCSITargetIdentifier theT ) = 0; + + + + /*! + @function DoesHBAPerformAutoSense + @abstract Queries the HBA child class to determine if it automatically + performs AutoSense and provides AutoSense data for each I/O. If the HBA + allocates space for AutoSense in its HBA specific data region on a per + task basis, the HBA should respond true. + @discussion Queries the HBA child class to determine if it automatically + performs AutoSense and provides AutoSense data for each I/O. If the HBA + allocates space for AutoSense in its HBA specific data region on a per + task basis, the HBA should respond true. + @result Return true if HBA performs AutoSense into its own private data + buffer. + */ + + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 1 ); + + virtual bool DoesHBAPerformAutoSense ( void ); + + /*! + @function ReportHBAConstraints + @abstract Called to report the I/O constraints for this controller. + A list of valid keys includes: + kIOMaximumSegmentCountReadKey, (required) + kIOMaximumSegmentCountWriteKey, (required) + kIOMaximumSegmentByteCountReadKey, (required) + kIOMaximumSegmentByteCountWriteKey, (required) + kIOMinimumSegmentAlignmentByteCountKey, (required) + kIOMaximumSegmentAddressableBitCountKey, (required) + kIOMinimumHBADataAlignmentMaskKey (required) + kIOHierarchicalLogicalUnitSupportKey (optional). + NB: These keys and their values are described in this header and <IOKit/IOKitKeys.h> + @param constraints. An OSDictionary object used to aggregate the key/value pairs. + Subclasses must set the required keys if they override this method. If a subclass does + not provide the required keys, the system will panic. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 2 ); + + virtual void ReportHBAConstraints ( OSDictionary * constraints ); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_7 + + /*! + @function DoesHBASupportMultiPathing + @abstract Queries the HBA child class to determine if it supports + Multi-Pathing. + @discussion Queries the HBA child class to determine if it supports + Multi-Pathing. + @result Returns true if requested feature is supported. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 3 ); + + virtual bool DoesHBASupportMultiPathing ( void ); + +#else + + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 3 ); + +#endif + + // Padding for the Client API + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 8 ); + + +#if 0 +#pragma mark - +#pragma mark Child Class API +#endif + + +protected: + + // ---- Target Creation and Destruction methods --- + + /*! + @function CreateTargetForID + @abstract Method to perform device creation. + @discussion For HBA child classes that report true to the + DoesHBAPerformDeviceManagement() method, the child class will be + responsible for all device management by using these methods; + otherwise, the superclass will be responsible for all device management. + This method must be used to perform SCSI Parallel Device creation and + cannot be overridden. + @param targetID SCSIDeviceIdentifier of desired targetID. + @result returns true if successful. + */ + + bool CreateTargetForID ( SCSIDeviceIdentifier targetID ); + + /*! + @function CreateTargetForID + @abstract Method to perform device creation. + @discussion For HBA child classes that report true to the + DoesHBAPerformDeviceManagement() method, the child class will be + responsible for all device management by using these methods; + otherwise, the superclass will be responsible for all device management. + This method must be used to perform SCSI Parallel Device creation and + cannot be overridden. + @param targetID SCSIDeviceIdentifier of desired targetID. + @param properties A dictionary of properties to associate with the device + upon creation. The list of valid property keys is as follows: + kIOPropertySASAddressKey, + kIOPropertyFibreChannelNodeWorldWideNameKey, + kIOPropertyFibreChannelPortWorldWideNameKey, + kIOPropertyFibreChannelAddressIdentifierKey, + kIOPropertyFibreChannelALPAKey, and + kIOPropertyRetryCountKey + These keys are defined in + <IOKit/storage/IOStorageProtocolCharacteristics.h> and the values + associated with these keys must be of the proper type/size, + or the target creation will not succeed. + @result returns true if successful. + */ + + bool CreateTargetForID ( SCSIDeviceIdentifier targetID, + OSDictionary * properties ); + + /*! + @function DestroyTargetForID + @abstract Method to perform device destruction. + @discussion For HBA child classes that report true to the + DoesHBAPerformDeviceManagement() method, the child class will be + responsible for all device management by using these methods; otherwise, + the superclass will be responsible for all device management. + This method must be used to perform SCSI Parallel Device destruction and + cannot be overridden. + @param targetID SCSIDeviceIdentifier of desired targetID. + */ + + void DestroyTargetForID ( SCSIDeviceIdentifier targetID ); + + /*! + @function GetTargetForID + @abstract Accessor for getting pointer to IOSCSIParallelInterfaceDevice. + @param targetID SCSIDeviceIdentifier of desired targetID. + @result returns pointer to IOSCSIParallelInterfaceDevice or NULL if not + found. + */ + + IOSCSIParallelInterfaceDevice * GetTargetForID ( + SCSIDeviceIdentifier targetID ); + + /*! + @function SetTargetProperty + @abstract Accessor for setting a property for a specific target. + @param device A pointer to a valid IOSCSIParallelInterfaceDevice. + @param key A pointer to a valid OSString object which represents the key. + A list of valid keys includes: + kIOPropertySASAddressKey, + kIOPropertyFibreChannelNodeWorldWideNameKey, + kIOPropertyFibreChannelPortWorldWideNameKey, + kIOPropertyFibreChannelAddressIdentifierKey, and + kIOPropertyFibreChannelALPAKey. + NB: These keys and their values are described in <IOKit/storage/IOStorageProtocolCharacteristics.h> + @param value Pointer to an OSObject (one of type OSData, OSString, etc.) + which represents the value for the property. The value must be of the proper type + and size for the specified key. + @result returns true if identifier was properly set, otherwise false. + */ + + bool SetTargetProperty ( SCSIDeviceIdentifier targetID, + const char * key, + OSObject * value ); + + /*! + @function RemoveTargetProperty + @abstract Accessor for removing a property from a specific target. + @param device A pointer to a valid IOSCSIParallelInterfaceDevice. + @param key A pointer to a valid OSString object which represents the key. + */ + + void RemoveTargetProperty ( SCSIDeviceIdentifier targetID, + const char * key ); + + // ---- Methods for HBA specifics. ---- + + /*! + @function SetHBAProperty + @abstract Accessor for setting a property for this object. + @param key A pointer to a valid OSString object which represents the key. + A list of valid keys includes: + kIOPropertyVendorNameKey, + kIOPropertyProductNameKey, + kIOPropertyProductRevisionLevelKey, + kIOPropertyPortDescriptionKey, + kIOPropertyPortSpeedKey, + kIOPropertyPortTopologyKey, + kIOPropertySCSIParallelSignalingTypeKey, + kIOPropertyFibreChannelCableDescriptionKey, + kIOPropertyFibreChannelNodeWorldWideNameKey, + kIOPropertyFibreChannelPortWorldWideNameKey, + kIOPropertyFibreChannelAddressIdentifierKey, + kIOPropertyFibreChannelALPAKey, and + kIOPropertySASAddressKey. + NB: These keys and their values are described in <IOKit/storage/IOStorageDeviceCharacteristics.h> + and <IOKit/storage/IOStorageProtocolCharacteristics.h> + @param value Pointer to an OSObject (one of type OSData, OSString, etc.) + which represents the value for the property. The value must be of the proper type, + and/or size for the specified key. + @result returns true if identifier was properly set, otherwise false. + */ + + bool SetHBAProperty ( const char * key, + OSObject * value ); + + /*! + @function RemoveHBAProperty + @abstract Accessor for removing a property for this object. + @param key A pointer to a valid OSString object which represents the key. + See the SetHBAProperty() method for a list of valid keys. + */ + + void RemoveHBAProperty ( const char * key ); + + // These methods will not be called before the InitializeController() call, + // and will not be called after the TerminateController() call. But in the + // interval between those calls, they shall report the correct requested + // information. They are implemented as seperate pure virtual methods + // instead of a selector driven method because the HBA child class is + // required to report this information. + + /*! + @function ReportInitiatorIdentifier + @abstract Get the SCSI Device Identifier for the HBA. + @discussion This method will be called to determine the SCSI Device + Identifier that the Initiator has assigned for this HBA. + @result returns SCSIInitiatorIdentifier. + */ + + virtual SCSIInitiatorIdentifier ReportInitiatorIdentifier ( void ) = 0; + + /*! + @function ReportHighestSupportedDeviceID + @abstract Get the highest supported SCSI Device Identifier. + @discussion This method will be called to determine the value of the + highest SCSI Device Identifier supported by the HBA. This value will be + used to determine the last ID to process. + @result returns highest SCSIDeviceIdentifier + */ + + virtual SCSIDeviceIdentifier ReportHighestSupportedDeviceID ( void ) = 0; + + /*! + @function ReportMaximumTaskCount + @abstract Report Maximum Task Count + @discussion This method will be called to retrieve the maximum number of + outstanding tasks the HBA can process. This number must be greater than + zero or the controller driver will fail to match and load. + @result returns maximum (non-zero) task count. + */ + + virtual UInt32 ReportMaximumTaskCount ( void ) = 0; + + /*! + @function ReportHBASpecificTaskDataSize + @abstract Determine memory needed for HBA Task specific use. + @discussion This method is used to retrieve the amount of memory that + will be allocated in the SCSI Parallel Task for HBA specific use. + @result returns memory required in bytes + */ + + virtual UInt32 ReportHBASpecificTaskDataSize ( void ) = 0; + + /*! + @function ReportHBASpecificDeviceDataSize + @abstract Determine memory needed for HBA Device specific use. + @discussion This method is used to retrieve the amount of memory that + will be allocated in the SCSI Parallel Device for HBA specific use. + @result returns memory required in bytes + */ + + virtual UInt32 ReportHBASpecificDeviceDataSize ( void ) = 0; + + /*! + @function DoesHBAPerformDeviceManagement + @abstract Determine if HBA will manage devices. + @discussion This method is used to determine if the HBA will manage + target device creation and destruction. + @result return true means objects for target devices will only be + created when the child class calls the CreateTargetForID method. + */ + + virtual bool DoesHBAPerformDeviceManagement ( void ) = 0; + + // ---- Initialize and Terminate methods for the subclass to implement ----- + // The subclass shall not override the IOKit init and terminate methods, + // but shall instead rely on these methods for initialization and + // termination. + + // This is done to allow for this superclass to manage all IOKit specifics + // and to require only a Family specific API to be implemented by the + // subclass drivers. + + /*! + @function InitializeController + @abstract Called to initialize the controller + @discussion It is guaranteed that the InitializeController() will only be + called once per instantiation. The InitializeController() methods allows + the subclass driver to do all the necessary initialization required by + the hardware before it is able to accept requests to execute. All + necessary allocation of resources should be made during this method + call. This is the first method that will be called in the subclass. + @result return true means that initialization was successful. + */ + + virtual bool InitializeController ( void ) = 0; + + /*! + @function TerminateController + @abstract Called to terminate the controller + @discussion It is guaranteed that the TerminateController() will only be + called once and only after the InitializeController() method and only if + true was returned in response to the InitializeController() method. + The TerminateController() method allows the subclass to release all + resources that were acquired for operation of the hardware and shutdown + all hardware services. + This is the last method of the subclass that will be called before the + class is destroyed. + */ + + virtual void TerminateController ( void ) = 0; + + // ---- Start and Stop methods for the subclass ---- + + /*! + @function StartController + @abstract Called to start the controller + @discussion The StartController will always be called before any + requests are sent to the driver for execution. This method is called + after an initialize to start the services provided by the specific HBA + driver or called after a StopController call to restart those services. + After this call completes, all services provided by the HBA driver are + available to the client. + @result return true means that start was successful. + */ + + virtual bool StartController ( void ) = 0; + + /*! + @function StopController + @abstract Called to stop the controller + @discussion The StopController method will be called any time that the + system wants the card to stop accepting requests. ( See StartController + discussion ). The subclass should disable the hardware interrupt for + the particular controller (if possible) in this method. + */ + + virtual void StopController ( void ) = 0; + + // ---- Suspend and Resume Methods for the subclass ---- + + /*! + @function SuspendServices + @abstract Called to suspend controller services + @discussion Method will be called when the system wants to suspend the + services that are provided by the HBA driver. This call is not a reset + and the driver shall retain all state data between this so that if a + ResumeServices call is received, the driver can continue providing + services without a visible difference to the client. The driver may + receive multiple SuspendServices calls without receiving a + ResumeServices call and should ignore any after the first until a + ResumeServices call is received. + */ + + virtual void SuspendServices ( void ); + + /*! + @function ResumeServices + @abstract Called to resume controller services + @discussion Method that will be called to resume services + provided by the driver. ( See SuspendServices discussion ) + */ + + virtual void ResumeServices ( void ); + + /*! + @function HandleInterruptRequest + @abstract Handle Interrupt Request + @discussion The HandleInterruptRequest is used to notify an HBA + specific subclass that an interrupt request needs to be serviced. It is + called on the workloop (it holds the gate) at secondary interrupt level. + */ + + virtual void HandleInterruptRequest ( void ) = 0; + + /*! + @function EnableInterrupt + @abstract Enable Interrupt + @discussion Method that the HBA child class can call to enable + the associated IOInterruptEventSource. + */ + + void EnableInterrupt ( void ); + + /*! + @function DisableInterrupt + @abstract Disable Interrupt + @discussion Method that the HBA child class can call to disable + the associated IOInterruptEventSource. + */ + + void DisableInterrupt ( void ); + + /*! + @function SignalInterrupt + @abstract Signals that an interrupt has occurred. + @discussion Subclasses of IOSCSIParallelInterfaceController + should call this method in order to get the secondary interrupt + thread scheduled if and only if they will be returning false from + their overriden FilterInterruptRequest() method. See the + discussion for the FilterInterruptRequest() method for more + details. + + NOTE: This method should only be called from within the + FilterInterruptRequest() method and at no other time. + + Available in 10.3.3 or later. + + */ + + void SignalInterrupt ( void ); + + /*! + @function ProcessParallelTask + @abstract Called by client to process a parallel task. + @discussion This method is called to process a parallel task (i.e. put + the command on the bus). The HBA specific sublcass must implement this + method. + @param parallelRequest A valid SCSIParallelTaskIdentifier. + @result serviceResponse (see <IOKit/scsi/SCSITask.h>) + */ + + virtual SCSIServiceResponse ProcessParallelTask ( + SCSIParallelTaskIdentifier parallelRequest ) = 0; + + /*! + @function CompleteParallelTask + @abstract Parallel Task Completion + @discussion The HBA specific sublcass inherits the CompleteParallelTask() + method which shall be called when the HBA has completed the processing + of a parallel task. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param completionStatus The status of the SCSI bus. + @param serviceResponse (see <IOKit/scsi/SCSITask.h>) + */ + + void CompleteParallelTask ( + SCSIParallelTaskIdentifier parallelRequest, + SCSITaskStatus completionStatus, + SCSIServiceResponse serviceResponse ); + + + // Completion routines for the SCSI Task Management functions as described + // in the SCSI ArchitectureModel - 2 (SAM-2) specification. Each of these + // correspond to a client request for the specific Task Management functions. + // If the Controller Child Class completed the request by returning a + // SCSIServiceResponse of anything other than kSCSIServiceResponse_Request_In_Process, + // then the controller class does not need to call the completion member routine. + // If the controller did not complete the request immediately, then it will + // need to call the appropriate completion member routine listed here. + void CompleteAbortTask ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSITaggedTaskIdentifier theQ, + SCSIServiceResponse serviceResponse ); + + void CompleteAbortTaskSet ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSIServiceResponse serviceResponse ); + + void CompleteClearACA ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSIServiceResponse serviceResponse ); + + void CompleteClearTaskSet ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSIServiceResponse serviceResponse ); + + void CompleteLogicalUnitReset ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSIServiceResponse serviceResponse ); + + void CompleteTargetReset ( + SCSITargetIdentifier theT, + SCSIServiceResponse serviceResponse ); + + /*! + @function NotifyClientsOfBusReset + @abstract Method called to notify clients that a bus reset has occurred. + @discussion This method is used by the HBA child class to inform the + parent class and any clients that a bus reset has occurred. + */ + + void NotifyClientsOfBusReset ( void ); + + /*! + @function NotifyClientsOfPortStatusChange + @abstract Method called to notify clients of port status change events. + @discussion This method is used by the HBA child class to inform the + parent class and any clients that a port has changed status. + */ + + void NotifyClientsOfPortStatusChange ( SCSIPortStatus newStatus ); + + /*! + @function GetSCSIDomainIdentifier + @abstract Accessor method to get the SCSI Domain Identifier. + @discussion Accessor method to get the SCSI Domain Identifier. + @result returns SCSI Domain Identifier. + */ + + SInt32 GetSCSIDomainIdentifier ( void ); + + /*! + @function GetProvider + @abstract Accessor method to get the IOService which is the controller's + provider. + @discussion Accessor method to get the IOService which is the + controller's provider. + @result returns pointer to IOService. + */ + + IOService * GetProvider ( void ); + + /*! + @function GetWorkLoop + @abstract Accessor method to get the IOWorkLoop associated with this + HBA. + @discussion Accessor method to get the IOWorkLoop associated with this + HBA. + @result returns pointer to IOWorkLoop. + */ + + IOWorkLoop * GetWorkLoop ( void ) const; + + /*! + @function GetCommandGate + @abstract Accessor to get an IOCommandGate associated with the workloop. + @discussion Accessor to get an IOCommandGate associated with the + workloop. + @result returns pointer to IOCommandGate. + */ + + IOCommandGate * GetCommandGate ( void ); + + // ---- SCSI Parallel Task Object Accessors ---- + + /*! + @function GetSCSITaskIdentifier + @abstract Method to retrieve a SCSITaskIdentifier from a valid + SCSIParallelTaskIdentifier. + @discussion Method to retrieve a SCSITaskIdentifier from a valid + SCSIParallelTaskIdentifier. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns SCSITaskIdentifier that represents the original request + from the SCSI Application Layer client. + */ + + SCSITaskIdentifier GetSCSITaskIdentifier ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetTargetIdentifier + @abstract Method to get the SCSITargetIdentifier associated with a + request. + @discussion Method to get the SCSITargetIdentifier associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns SCSITargetIdentifier + */ + + SCSITargetIdentifier GetTargetIdentifier ( + SCSIParallelTaskIdentifier parallelTask ); + + // ---- Methods for Accessing data in the client's SCSI Task Object ---- + // Method to retrieve the LUN that identifies the Logical Unit whose Task + // Set to which this task is to be added. + + /*! + @function GetLogicalUnitNumber + @abstract Method to get the logical unit number associated with a + request. + @discussion Method to get the logical unit number associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns a valid 64-bit logical unit number. + */ + + SCSILogicalUnitNumber GetLogicalUnitNumber ( + SCSIParallelTaskIdentifier parallelTask ); // DEPRECATED, use GetLogicalUnitBytes instead. + + /*! + @function GetLogicalUnitBytes + @abstract Method to get the logical unit bytes associated with a + request. + @discussion Method to get the logical unit bytes associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns a valid 8-byte logical unit address. + */ + + void GetLogicalUnitBytes ( + SCSIParallelTaskIdentifier parallelTask, + SCSILogicalUnitBytes * logicalUnitBytes ); + + /*! + @function GetTaggedTaskIdentifier + @abstract Method to retrieve the SCSI Tagged Task Identifier of the + task. If the returned value is equal to kSCSIUntaggedTaskIdentifier, + then this task is untagged. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result an SCSITaskAttribute value. + */ + + SCSITaggedTaskIdentifier GetTaggedTaskIdentifier ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetTaskAttribute + @abstract Method to retrieve the SCSI Task Attribute of the task + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result an SCSITaskAttribute value. + */ + + SCSITaskAttribute GetTaskAttribute ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetCommandDescriptorBlockSize + @abstract Method to retrieve the size of the SCSI Command Descriptor + Block (CDB). + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns the size of the SCSI Command Descriptor Block in bytes. + */ + + UInt8 GetCommandDescriptorBlockSize ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetCommandDescriptorBlock + @abstract Method to retrieve the SCSI Command Descriptor Block (CDB). + @discussion This will always return a 16 Byte CDB. If the Protocol Layer + driver does not support 16 Byte CDBs, it will have to create a local + SCSICommandDescriptorBlock variable to get the CDB data and then + transfer the needed bytes from there. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param cdbData is a SCSICommandDescriptorBlock pointer to 16 byte CDB + @result returns true if data was copied to cdbData pointer + */ + + bool GetCommandDescriptorBlock ( + SCSIParallelTaskIdentifier parallelTask, + SCSICommandDescriptorBlock * cdbData ); + + /*! + @function GetDataTransferDirection + @abstract Retrieves the data transfer direction for any data associated + with the request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result One of the valid data transfer directions described in + <IOKit/scsi/SCSITask.h> + */ + + UInt8 GetDataTransferDirection ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetRequestedDataTransferCount + @abstract Retrieves the requested data transfer count for any data + associated with the request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result The requested data transfer count in bytes. + */ + + UInt64 GetRequestedDataTransferCount ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetRealizedDataTransferCount + @abstract Retrieves the realized data transfer count for any data + associated with the request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result The realized data transfer count in bytes. + */ + + UInt64 GetRealizedDataTransferCount ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function SetRealizedDataTransferCount + @abstract Sets the realized data transfer count in bytes. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param realizedTransferCountInBytes is the number of bytes actually + transferred. + @result true means the data transfer count was successfully set. + */ + + bool SetRealizedDataTransferCount ( + SCSIParallelTaskIdentifier parallelTask, + UInt64 realizedTransferCountInBytes ); + + /*! + @function IncrementRealizedDataTransferCount + @abstract Increments the realized data transfer count. This method is + helpful for when the HBA has to do multiple passes of DMA because there + are more scatter-gather elements than it can process in one pass. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param realizedTransferCountInBytes is the number of bytes to add to the + realized data count for the task. + */ + + void IncrementRealizedDataTransferCount ( + SCSIParallelTaskIdentifier parallelTask, + UInt64 realizedTransferCountInBytes ); + + /*! + @function GetDataBuffer + @abstract Method to retrieve client buffer from the request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns pointer to an IOMemoryDescriptor which represents the + buffer. + */ + + IOMemoryDescriptor * GetDataBuffer ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetDataBufferOffset + @abstract Method to retrieve offset into client buffer at which to start + processing. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns offset in bytes + */ + + UInt64 GetDataBufferOffset ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetDMACommand + @abstract Method to retrieve a pointer to an IODMACommand from the request. + @discussion For devices utilizing DMA, the IODMACommand object should be + obtained via GetDMACommand(). The subclass is responsible for calling prepare() + on the IODMACommand object using the proper offset obtained via GetDataBufferOffset() + and correct size obtained via GetRequestedDataTransferCount(). The subclass + is further responsible for calling complete() on the IODMACommand object once + all DMA operations have finished. + NB: Subclasses should not call IODMACommand::setMemoryDescriptor(). + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns pointer to an IODMACommand which is used in conjunction + with the task. + */ + + IODMACommand * GetDMACommand ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetTimeoutDuration + @abstract Method to retrieve the timeout duration in milliseconds for a + request. + @discussion Method to retrieve the timeout duration in milliseconds for + a request. A value of zero represents an infinite timeout, or on + hardware where infinite timeouts are not possible, substitute the + longest timeout possible. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns timeout duration in milliseconds + */ + + UInt32 GetTimeoutDuration ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function SetAutoSenseData + @abstract Method to set the auto sense data buffer associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param newSensedata pointer to auto sense data buffer + @result returns true if data in newSenseData was succesfully into the + task object + */ + + bool SetAutoSenseData ( + SCSIParallelTaskIdentifier parallelTask, + SCSI_Sense_Data * newSenseData, + UInt8 senseDataSize ); + + /*! + @function GetAutoSenseData + @abstract Method to retrieve auto sense data buffer associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param receivingBuffer pointer to auto sense data buffer + @result returns true if successfully copied data into receivingBuffer + */ + + bool GetAutoSenseData ( + SCSIParallelTaskIdentifier parallelTask, + SCSI_Sense_Data * receivingBuffer, + UInt8 senseDataSize ); + + /*! + @function GetAutoSenseDataSize + @abstract Method to retrieve auto sense data buffer size associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns Size of auto sense data buffer. + */ + + UInt8 GetAutoSenseDataSize ( + SCSIParallelTaskIdentifier parallelTask ); + + + /*! + @function GetSCSIParallelFeatureNegotiation + @abstract Method to retrieve the requested value for negotiation of the. + @discussion Query as to whether the SCSI Parallel Device object has + negotiated wide data transfers. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result A valid SCSIParallelFeatureControl. + */ + + SCSIParallelFeatureRequest GetSCSIParallelFeatureNegotiation ( + SCSIParallelTaskIdentifier parallelTask, + SCSIParallelFeature requestedFeature ); + + /*! + @function GetSCSIParallelFeatureNegotiationCount + @abstract Method to retrieve the number of requested negotiations. + @discussion Query as to the number of SCSI Parallel Features that are + requested to either be negotitated or cleared. These are all features + that are set to either kSCSIParallelFeature_AttemptNegotiation or + kSCSIParallelFeature_ClearNegotiation. If the return value is zero, + then all features are set to kSCSIParallelFeature_NoNegotiation + and all feature negotiations are to remain as they currently exist. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result an unsigned integer up to 64 bits in size. + */ + + UInt64 GetSCSIParallelFeatureNegotiationCount ( + SCSIParallelTaskIdentifier parallelTask); + + /*! + @function SetSCSIParallelFeatureNegotiationResult + @abstract Method to set the wide data transfer negotiation result. + @discussion Method to set the wide data transfer negotiation result. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param requestedFeature The SCSIParallelFeature that the has been set to + newResult. + @param newResult A valid SCSIParallelFeatureResult value. + */ + + void SetSCSIParallelFeatureNegotiationResult ( + SCSIParallelTaskIdentifier parallelTask, + SCSIParallelFeature requestedFeature, + SCSIParallelFeatureResult newResult ); + + /*! + @function GetSCSIParallelFeatureNegotiationResult + @abstract Method to retrieve the result of any wide transfer + negotiations. + @discussion Query as to whether the SCSI Parallel Controller object has + negotiated wide data transfers. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result A valid SCSIParallelFeatureResult. + */ + + SCSIParallelFeatureResult GetSCSIParallelFeatureNegotiationResult ( + SCSIParallelTaskIdentifier parallelTask, + SCSIParallelFeature requestedFeature ); + + /*! + @function GetSCSIParallelFeatureNegotiationResultCount + @abstract Method to retrieve the number of changed negotiations. + @discussion Query as to the number of SCSI Parallel Features that have + been changed to either negotitated or cleared. These are all features + that are set to either kSCSIParallelFeature_NegotitiationCleared or + kSCSIParallelFeature_NegotitiationSuccess. If the return value is zero, + then all features are set to kSCSIParallelFeature_NegotitiationUnchanged. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result an unsigned integer up to 64 bits in size. + */ + + UInt64 GetSCSIParallelFeatureNegotiationResultCount ( + SCSIParallelTaskIdentifier parallelTask); + + // Controller Task Identifier related member routines + + /*! + @function SetControllerTaskIdentifier + @abstract Method to set the Controller Task Identifier. + @discussion This method allows the Controller Child Class + driver to set a unique identifier to associate with the specified + SCSI Parallel Task. This identifier is designed to be used by + controllers that do not have access to the LUN and Tag information + when notified by the HBA that a request has completed. + If the kSCSIParallelTaskControllerIDQueueHead is used, this + member routine will return the first Task on the queue. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param newIdentifier unsigned 64 bit integer token. + @result none + */ + + void SetControllerTaskIdentifier ( + SCSIParallelTaskIdentifier parallelTask, + UInt64 newIdentifier ); + + UInt64 GetControllerTaskIdentifier ( + SCSIParallelTaskIdentifier parallelTask); + + + // The HBA Data related fields + + /*! + @function GetHBADataSize + @abstract Method to retrieve the HBA Data Size in bytes. + @discussion Method to retrieve the HBA Data Size in bytes. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns HBA Data size in bytes. + */ + + UInt32 GetHBADataSize ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetHBADataPointer + @abstract Method to retrieve the HBA Data pointer. + @discussion Method to retrieve the HBA Data pointer. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns pointer to buffer for HBA specific data, NULL if + none found or GetHBADataSize() returns zero. + */ + + void * GetHBADataPointer ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetHBADataDescriptor + @abstract Method to retrieve the IOMemoryDescriptor associated with + the HBA Data. + @discussion Method to retrieve the IOMemoryDescriptor associated with + the HBA Data. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns pointer to an IOMemoryDescriptor that wraps the HBA + specific data buffer, NULL if none found or GetHBADataSize() returns zero. + */ + + IOMemoryDescriptor * GetHBADataDescriptor ( + SCSIParallelTaskIdentifier parallelTask ); + + // ---- SCSI Parallel Device Object Accessors ---- + + // The HBA Data related fields + + /*! + @function GetHBATargetDataSize + @abstract Method to retrieve the HBA Data Size in bytes. + @discussion Method to retrieve the HBA Data Size in bytes. + @param targetDevice A valid SCSITargetIdentifier. + @result returns HBA Data size in bytes. + */ + + UInt32 GetHBATargetDataSize ( SCSITargetIdentifier targetID ); + + /*! + @function GetHBATargetDataPointer + @abstract Method to retrieve the HBA Data pointer. + @discussion Method to retrieve the HBA Data pointer. + @param targetDevice A valid SCSITargetIdentifier. + @result returns pointer to buffer for HBA specific data, NULL if + none found or GetHBADataSize is zero. + */ + + void * GetHBATargetDataPointer ( SCSITargetIdentifier targetID ); + + +#if 0 +#pragma mark - +#pragma mark Additional Child Class APIs +#endif + + + // ---- Timeout Related Methods ---- + + /*! + @function SetTimeoutForTask + @abstract Method to set the timeout duration in milliseconds for a + request. + @discussion Method to set the timeout duration in milliseconds for a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param timeoutOverride A timeout value in milliseconds in case the + HBA driver wishes to override the default value provided in the + parallelTask. + */ + + void SetTimeoutForTask ( SCSIParallelTaskIdentifier parallelTask, + UInt32 timeoutOverride = 0 ); + + /*! + @function HandleTimeout + @abstract Method to handle command timeouts. + @discussion Method to handle command timeouts. This should + be overridden by the child class in order to clean up HBA + specific structures after a timeout has occurred. This method + is called on the workloop (it holds the gate). + @param parallelRequest A valid SCSIParallelTaskIdentifier. + */ + + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 9 ); + + virtual void HandleTimeout ( + SCSIParallelTaskIdentifier parallelRequest ); + + + // ---- Filter Interrupt ---- + + /*! + @function FilterInterruptRequest + @abstract Filter method called at primary interrupt time. + @discussion Filter method called at primary interrupt time. + This should only be overridden by the child class in order + to determine if an interrupt occurred for this controller instance. + Since all work occurs at primary interrupt time, this routine + should be quick and efficient and defer as much processing as + possible to the HandleInterruptRequest() method. + + NOTE: Unlike the HandleInterruptRequest() and HandleTimeout() + methods, FilterInterruptRequest() is NOT called with the + workloop lock held. + + If the value returned by FilterInterruptRequest() is true, the + secondary interrupt thread will be scheduled and the hardware + interrupt line will be disabled. If the controller instance shares + that interrupt line with other devices, it can cause large + interrupt latencies. If the controller instance can disable the + interrupt in the chip itself, the following can be done to reduce + interrupt latencies: + + - Interrupt occurs + - FilterInterruptRequest() method is called. + - If the interrupt is not for this controller, return false + immediately. + - If the interrupt is for this controller, and the controller + can disable interrupts for this chip, the controller should + disable the interrupts for this chip, call SignalInterrupt(), + and return false. This causes the secondary interrupt thread + to get scheduled, yet does not disable the interrupt line for + all devices tied to that interrupt. This effectively allows + other devices to process their interrrupts, thus reducing + interrupt latency for those devices. + - HandleInterruptRequest() method is called. + - Controller processes interrupt and completes I/O requests. + - Controller re-enables interrupts for the device. + + NOTE: If you use this approach, the interrupting condition MUST be + cleared from the hardware, otherwise an infinite process interrupt + loop will occur. + + If the controller cannot disable interrupts on the chip, it should + simply return true if an interrupt has occurred for its device. + + @result True if the hardware interrupt line should be disabled, + otherwise false. + */ + + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 10 ); + + virtual bool FilterInterruptRequest ( void ); + + /*! + @function InitializeDMASpecification + @abstract Called to initialize an IODMACommand with a DMA specification. + @param command A pointer to a valid IODMACommand object. Subclasses + should override this method and call IODMACommand::initWithSpecification() + supplying the proper arguments to that method based on the DMA strategy. + @result boolean value indicating success or failure. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 11 ); + + virtual bool InitializeDMASpecification ( IODMACommand * command ); + + /*! + @function CreateDeviceInterrupt + @abstract Called to create an IOInterruptEventSource for the device. Subclasses + may wish to use a different interrupt index than 0 (e.g. for using PCI Message + Signaled Interrupts) or might not need an interrupt at all (virtual HBA). + @param action A pointer to the action routine that should be passed to either + IOInterruptEventSource::interruptEventSource() or + IOFilterInterruptEventSource::filterInterruptEventSource as the method to call + when an interrupt occurs for the device (sometimes called the "deferred procedure call" + or the "secondary context method". By passing this routine along, it will + properly wire up the HandleInterruptRequest() method you should override to handle + interrupts. + @param filter A pointer to the filter routine that should be passed to + IOFilterInterruptEventSource::filterInterruptEventSource as the method to call + at primary interrupt time when an interrupt occurs for the device. + By passing this routine along, it will properly wire up the + FilterInterruptRequest() method you may override to handle primary interrupts. + @result IOInterruptEventSource. May return NULL if and only if there is no + hardware interrupt associated with this device. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 12 ); + + virtual IOInterruptEventSource * CreateDeviceInterrupt ( + IOInterruptEventSource::Action action, + IOFilterInterruptEventSource::Filter filter, + IOService * provider ); + + // Padding for the Child Class API + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 16 ); + + +#if 0 +#pragma mark - +#pragma mark Internal Use Only +#endif + +private: + + // binary compatibility instance variable expansion + struct ExpansionData { }; + ExpansionData * fIOSCSIParallelInterfaceControllerExpansionData; + + IOService * fProvider; + OSSet * fClients; + + static SInt32 fSCSIParallelDomainCount; + SInt32 fSCSIDomainIdentifier; + + // The HBA attributes + SCSIInitiatorIdentifier fInitiatorIdentifier; + + // The maximum SCSI Device Identifier support by the HBA + // This is retreived from the child class via the + SCSIDeviceIdentifier fHighestSupportedDeviceID; + + // The total number of tasks that the HBA can proccess at a time. + // This is retrieved from the child class via ReportMaximumTaskCount + UInt32 fSupportedTaskCount; + + // The Number of requests that are currently outstanding for the current + // instantiation. + UInt16 fOutstandingRequests; + + // The member variable to indicate if the current instantiation has been + // succesfully intialized. + bool fHBAHasBeenInitialized; + + // The member variable to indicate if the current instantiation is running. + // A true means that the last or only Start call made was successful. A + // false value means that either a successful Start has not been made or a + // Stop call has been made. + bool fHBACanAcceptClientRequests; + + // The pool for the available SCSI Parallel Task objects + IOCommandPool * fParallelTaskPool; + + // WorkLoop variables + IOWorkLoop * fWorkLoop; + IOTimerEventSource * fTimerEvent; + IOInterruptEventSource * fDispatchEvent; + + IOCommandGate * fControllerGate; + + bool AllocateSCSIParallelTasks ( void ); + void DeallocateSCSIParallelTasks ( void ); + + IOWorkLoop * getWorkLoop ( void ) const APPLE_KEXT_OVERRIDE; + bool CreateWorkLoop ( IOService * provider ); + void ReleaseWorkLoop ( void ); + + // SCSI Parallel Device List + // The SCSI Parallel Device List will consist of 16 elements to represent + // identifiers that end in 0h through Fh. Each array element will point + // to a device object that represents the beginning of a linked list of + // device objects. By using an array of linked lists, the traversal time + // to find an object on a bus that supports a large number of devices, such + // as Fibre Channel, will be significantly lower than having to walk a list + // that is comprised of all devices on the bus. For parallel wide and + // narrow busses, which support 16 and 8 devices respectively, this will act + // like a simple array of device objects. + enum + { + kSCSIParallelDeviceListArrayCount = 16, + kSCSIParallelDeviceListIndexMask = 0x0F + }; + + IOSimpleLock * fDeviceLock; + IOSCSIParallelInterfaceDevice * + fParallelDeviceList[kSCSIParallelDeviceListArrayCount]; + + void InitializeDeviceList ( void ); + void AddDeviceToTargetList ( + IOSCSIParallelInterfaceDevice * newDevice ); + void RemoveDeviceFromTargetList ( + IOSCSIParallelInterfaceDevice * victimDevice ); + + // The Interrupt Service Routine for the controller. + static void ServiceInterrupt ( + OSObject * theObject, + IOInterruptEventSource * theSource, + int count ); + + static void TimeoutOccurred ( OSObject * owner, IOTimerEventSource * sender ); + + static bool FilterInterrupt ( + OSObject * theObject, + IOFilterInterruptEventSource * theSource ); + + // IOService support methods + // These shall not be overridden by the HBA child classes. + bool start ( IOService * provider ) APPLE_KEXT_OVERRIDE; + void stop ( IOService * provider ) APPLE_KEXT_OVERRIDE; + + +protected: + + // These may be overriden by the HBA child classes if necessary, but should + // call the superclass implementation. + virtual bool handleOpen ( + IOService * client, + IOOptionBits options, + void * arg ) APPLE_KEXT_OVERRIDE; + + virtual void handleClose ( + IOService * client, + IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + virtual bool handleIsOpen ( + const IOService * client ) const APPLE_KEXT_OVERRIDE; + + virtual bool willTerminate ( IOService * provider, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual bool didTerminate ( IOService * provider, IOOptionBits options, bool * defer ) APPLE_KEXT_OVERRIDE; + virtual void free ( void ) APPLE_KEXT_OVERRIDE; + + +}; + + +#endif /* __IOKIT_IO_SCSI_PARALLEL_INTERFACE_CONTROLLER_H__ */ diff --git a/QualcommWireless/include/IOKit/serial/IOModemSerialStreamSync.h b/QualcommWireless/include/IOKit/serial/IOModemSerialStreamSync.h new file mode 100644 index 0000000..be75287 --- /dev/null +++ b/QualcommWireless/include/IOKit/serial/IOModemSerialStreamSync.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOModemSerialStreamSync.h + * This file contains Modem specific extensions to the IOSerialStreamSync class. + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + * + */ + +#ifndef _SERIAL_IOMODEMSERIALSTREAMSYNC_H +#define _SERIAL_IOMODEMSERIALSTREAMSYNC_H + +#include <IOKit/serial/IOSerialStreamSync.h> + +class IOModemSerialStreamSync : public IOSerialStreamSync +{ + OSDeclareDefaultStructors(IOModemSerialStreamSync) +}; + +#endif /* !_SERIAL_IOMODEMSERIALSTREAMSYNC_H */ + diff --git a/QualcommWireless/include/IOKit/serial/IORS232SerialStreamSync.h b/QualcommWireless/include/IOKit/serial/IORS232SerialStreamSync.h new file mode 100644 index 0000000..15d520a --- /dev/null +++ b/QualcommWireless/include/IOKit/serial/IORS232SerialStreamSync.h @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * IORS232SerialStreamSync.h + * This file contains RS232 specific extensions to the IOSerialStreamSync class. + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + */ + +#ifndef _SERIAL_IORS232SERIALSTREAMSYNC_H +#define _SERIAL_IORS232SERIALSTREAMSYNC_H + +#include <sys/ioctl.h> +#include <IOKit/serial/IOSerialStreamSync.h> + +/* + * Extra events for RS232 based PortDevices + */ + +#define PD_RS232_E_RX_LINE_BREAK (PD_DATA_VOID|PD_OP(63)) // line break was received +#define PD_RS232_E_LINE_BREAK (PD_DATA_BYTE|PD_OP(62)) // BOOL set/clear line break + +#define PD_RS232_E_RX_STOP_BITS (PD_DATA_LONG|PD_OP(61)) // half stop bits +#define PD_RS232_E_STOP_BITS (PD_DATA_LONG|PD_OP(60)) // half stop bits + +#define PD_RS232_E_XON_BYTE (PD_DATA_BYTE|PD_OP(59)) // The XON char for TX&RX +#define PD_RS232_E_XOFF_BYTE (PD_DATA_BYTE|PD_OP(58)) // The XOFF char for TX&RX + +#define PD_RS232_E_MIN_LATENCY (PD_DATA_BYTE|PD_OP(57)) // BOOL true if low latency req + +/* + * RS232 Parity stuff, used with the DATA_INTEGRITY event + */ +#define PD_RS232_PARITY_DEFAULT 0 // Valid only for RX, means follow TX +#define PD_RS232_PARITY_NONE 1 // No Parity bit inserted or expected +#define PD_RS232_PARITY_ODD 2 // Odd Parity bit inserted or expected +#define PD_RS232_PARITY_EVEN 3 // Even Parity bit inserted or expected +#define PD_RS232_PARITY_MARK 4 // Mark inserted or expected +#define PD_RS232_PARITY_SPACE 5 // Space inserted or expected +#define PD_RS232_PARITY_ANY 6 // Valid only for RX, means discard parity + +/* + * RS232 Flow Control specifiers, used with the FLOW_CONTROL event + * NB. The XON character is set with FLOW_START_DATA + * and the XOFF character is set with FLOW_STOP_DATA. + * + * Signal Name Direction + * RFR Ready For Receive Output generated by UART + * RTS Ready To Send (alias of RFR) Output generated by UART + * CTS Clear To Send Input sensed by UART + * DTR Data Terminal Ready Output generated by UART + * DSR Data Set Ready Input sensed by UART + * TXO XON/XOFF/XANY protocol Characters received by UART + * RXO XON/XOFF protocol Characters transmitted by UART + * DCD Data Carrier Detect Input sensed by UART + */ + +/* + * RS232 State Word extensions, based on <bsd/sys/ioctl.h> + * Also the 'current state' bits for enq/deq of Flow Control event + */ +#define PD_RS232_S_MASK 0x0000ffffUL +#define PD_RS232_S_SHIFT 0 // to align State bits for enq/deq event +#define PD_RS232_D_MASK 0xffff0000UL +#define PD_RS232_D_SHIFT 16 // to align Delta bits for enq/deq event +#define PD_RS232_A_MASK 0x0000ffffUL +#define PD_RS232_A_SHIFT 0 // to align Auto bits for req/exec event +#define PD_RS232_N_MASK 0xffff0000UL +#define PD_RS232_N_SHIFT 16 // to align Notify bits for req/exec event + +#define PD_RS232_S_LE TIOCM_LE // line enable +#define PD_RS232_S_DTR TIOCM_DTR // data terminal ready +#define PD_RS232_S_RTS TIOCM_RTS // request to send +#define PD_RS232_S_RFR PD_RS232_S_RTS // ready for receive +#define PD_RS232_S_TXO TIOCM_ST // TX XON/XOFF +#define PD_RS232_S_RXO TIOCM_SR // RX XON/XOFF +#define PD_RS232_S_CTS TIOCM_CTS // clear to send +#define PD_RS232_S_CAR TIOCM_CAR // carrier detect +#define PD_RS232_S_DCD PD_RS232_S_CAR +#define PD_RS232_S_RNG TIOCM_RNG // ring +#define PD_RS232_S_RI PD_RS232_S_RNG +#define PD_RS232_S_DSR TIOCM_DSR // data set ready + +#define PD_RS232_S_BRK 0x00000800UL // break active Extension to TIOCM +#define PD_RS232_S_LOOP 0x00001000UL // LOOP back Extension to TIOCM +#define PD_RS232_S_TXQ 0x00002000UL // User flowcontrol bit +#define PD_RS232_S_RXQ 0x00004000UL // User flowcontrol bit + +// The 'delta' bits for enq/deq of Flow Control event +#define PD_RS232_D_LE (PD_RS232_S_LE << PD_RS232_D_SHIFT) +#define PD_RS232_D_DTR (PD_RS232_S_DTR << PD_RS232_D_SHIFT) +#define PD_RS232_D_RTS (PD_RS232_S_RTS << PD_RS232_D_SHIFT) +#define PD_RS232_D_RFR (PD_RS232_S_RFR << PD_RS232_D_SHIFT) +#define PD_RS232_D_TXO (PD_RS232_S_TXO << PD_RS232_D_SHIFT) +#define PD_RS232_D_RXO (PD_RS232_S_RXO << PD_RS232_D_SHIFT) +#define PD_RS232_D_CTS (PD_RS232_S_CTS << PD_RS232_D_SHIFT) +#define PD_RS232_D_CAR (PD_RS232_S_CAR << PD_RS232_D_SHIFT) +#define PD_RS232_D_DCD (PD_RS232_S_DCD << PD_RS232_D_SHIFT) +#define PD_RS232_D_RNG (PD_RS232_S_RNG << PD_RS232_D_SHIFT) +#define PD_RS232_D_RI (PD_RS232_S_RI << PD_RS232_D_SHIFT) +#define PD_RS232_D_DSR (PD_RS232_S_DSR << PD_RS232_D_SHIFT) + +#define PD_RS232_D_BRK (PD_RS232_S_BRK << PD_RS232_D_SHIFT) +#define PD_RS232_D_LOOP (PD_RS232_S_LOOP << PD_RS232_D_SHIFT) +#define PD_RS232_D_TXQ (PD_RS232_S_TXQ << PD_RS232_D_SHIFT) +#define PD_RS232_D_RXQ (PD_RS232_S_RXQ << PD_RS232_D_SHIFT) + +// The 'auto' bits for exec/req of Flow Control event +#define PD_RS232_A_LE PD_RS232_S_LE +#define PD_RS232_A_DTR PD_RS232_S_DTR +#define PD_RS232_A_RTS PD_RS232_S_RTS +#define PD_RS232_A_RFR PD_RS232_S_RFR +#define PD_RS232_A_TXO PD_RS232_S_TXO +#define PD_RS232_A_RXO PD_RS232_S_RXO +#define PD_RS232_A_CTS PD_RS232_S_CTS +#define PD_RS232_A_CAR PD_RS232_S_CAR +#define PD_RS232_A_DCD PD_RS232_S_DCD +#define PD_RS232_A_RNG PD_RS232_S_RNG +#define PD_RS232_A_RI PD_RS232_S_RI +#define PD_RS232_A_DSR PD_RS232_S_DSR +#define PD_RS232_A_XANY 0x00000400 // changes _A_TXO from XON/XOFF to XANY/XOFF +#define PD_RS232_A_BRK PD_RS232_S_BRK +#define PD_RS232_A_LOOP PD_RS232_S_LOOP +#define PD_RS232_A_TXQ PD_RS232_S_TXQ +#define PD_RS232_A_RXQ PD_RS232_S_RXQ + +// The 'notify' bits for exec/req of Flow Control event +#define PD_RS232_N_LE (PD_RS232_S_LE << PD_RS232_N_SHIFT) +#define PD_RS232_N_DTR (PD_RS232_S_DTR << PD_RS232_N_SHIFT) +#define PD_RS232_N_RTS (PD_RS232_S_RTS << PD_RS232_N_SHIFT) +#define PD_RS232_N_RFR (PD_RS232_S_RFR << PD_RS232_N_SHIFT) +#define PD_RS232_N_TXO (PD_RS232_S_TXO << PD_RS232_N_SHIFT) +#define PD_RS232_N_RXO (PD_RS232_S_RXO << PD_RS232_N_SHIFT) +#define PD_RS232_N_CTS (PD_RS232_S_CTS << PD_RS232_N_SHIFT) +#define PD_RS232_N_CAR (PD_RS232_S_CAR << PD_RS232_N_SHIFT) +#define PD_RS232_N_DCD (PD_RS232_S_DCD << PD_RS232_N_SHIFT) +#define PD_RS232_N_RNG (PD_RS232_S_RNG << PD_RS232_N_SHIFT) +#define PD_RS232_N_RI (PD_RS232_S_RI << PD_RS232_N_SHIFT) +#define PD_RS232_N_DSR (PD_RS232_S_DSR << PD_RS232_N_SHIFT) + +#define PD_RS232_N_BRK (PD_RS232_S_BRK << PD_RS232_N_SHIFT) +#define PD_RS232_N_LOOP (PD_RS232_S_LOOP << PD_RS232_N_SHIFT) +#define PD_RS232_N_TXQ (PD_RS232_S_TXQ << PD_RS232_N_SHIFT) +#define PD_RS232_N_RXQ (PD_RS232_S_RXQ << PD_RS232_N_SHIFT) + +class IORS232SerialStreamSync : public IOSerialStreamSync +{ + OSDeclareDefaultStructors(IORS232SerialStreamSync) +}; + +#endif /* !_SERIAL_IORS232SERIALSTREAMSYNC_H */ + diff --git a/QualcommWireless/include/IOKit/serial/IOSerialDriverSync.h b/QualcommWireless/include/IOKit/serial/IOSerialDriverSync.h new file mode 100644 index 0000000..92f69df --- /dev/null +++ b/QualcommWireless/include/IOKit/serial/IOSerialDriverSync.h @@ -0,0 +1,91 @@ +/* + *Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + *@APPLE_LICENSE_HEADER_START@ + * + *The contents of this file constitute Original Code as defined in and + *are subject to the Apple Public Source License Version 1.1 (the + *"License"). You may not use this file except in compliance with the + *License. Please obtain a copy of the License at + *http://www.apple.com/publicsource and read it before using this file. + * + *This Original Code and all software distributed under the License are + *distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + *EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + *INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + *License for the specific language governing rights and limitations + *under the License. + * + *@APPLE_LICENSE_HEADER_END@ + */ + +/* + * IOSerialDriverSync.h + * This file contains the abstract parent class for any IOSerialDriver + * interface, which is a generic serial interface, designed for devices + * that do character oriented transfers (async) rather than block or + * packet transfers. Most notably RS-232, Printer, Mouse, and Keyboard + * type devices. + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + */ + +#ifndef _SERIAL_IOSERIALDRIVERSYNC_H +#define _SERIAL_IOSERIALDRIVERSYNC_H + +#include <IOKit/IOService.h> + +class IOSerialDriverSync : public IOService +{ + OSDeclareAbstractStructors(IOSerialDriverSync); + +public: + virtual IOReturn acquirePort(bool sleep, void *refCon) = 0; + + virtual IOReturn releasePort(void *refCon) = 0; + + virtual IOReturn setState(UInt32 state, UInt32 mask, void *refCon) = 0; + + virtual UInt32 getState(void *refCon) = 0; + + virtual IOReturn watchState(UInt32 *state, UInt32 mask, void *refCon) = 0; + + virtual UInt32 nextEvent(void *refCon) = 0; + + virtual IOReturn executeEvent(UInt32 event, UInt32 data, void *refCon) = 0; + + virtual IOReturn requestEvent(UInt32 event, UInt32 *data, void *refCon) = 0; + + virtual IOReturn enqueueEvent(UInt32 event, UInt32 data, + bool sleep, void *refCon) = 0; + + virtual IOReturn dequeueEvent(UInt32 *event, UInt32 *data, + bool sleep, void *refCon) = 0; + + virtual IOReturn enqueueData(UInt8 *buffer, UInt32 size, UInt32 *count, + bool sleep, void *refCon) = 0; + + virtual IOReturn dequeueData(UInt8 *buffer, UInt32 size, UInt32 *count, + UInt32 min, void *refCon) = 0; + +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 0); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 1); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 2); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 3); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 4); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 5); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 6); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 7); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 8); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 9); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 10); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 11); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 12); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 13); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 14); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 15); + +}; + +#endif /* !_SERIAL_IOSERIALDRIVERSYNC_H */ diff --git a/QualcommWireless/include/IOKit/serial/IOSerialKeys.h b/QualcommWireless/include/IOKit/serial/IOSerialKeys.h new file mode 100644 index 0000000..9538a24 --- /dev/null +++ b/QualcommWireless/include/IOKit/serial/IOSerialKeys.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOSerialKeys.h + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + * + */ + +/* +Sample Matching dictionary +{ + IOProviderClass = kIOSerialBSDServiceValue; + kIOSerialBSDTypeKey = kIOSerialBSDAllTypes + | kIOSerialBSDModemType + | kIOSerialBSDRS232Type; + kIOTTYDeviceKey = <Raw Unique Device Name>; + kIOTTYBaseNameKey = <Raw Unique Device Name>; + kIOTTYSuffixKey = <Raw Unique Device Name>; + kIOCalloutDeviceKey = <Callout Device Name>; + kIODialinDeviceKey = <Dialin Device Name>; +} + +Note only the IOProviderClass is mandatory. The other keys allow the searcher to reduce the size of the set of matching devices. +*/ + +/* Service Matching That is the 'IOProviderClass' */ +#define kIOSerialBSDServiceValue "IOSerialBSDClient" + +/* Matching keys */ +#define kIOSerialBSDTypeKey "IOSerialBSDClientType" + +/* Currently possible kIOSerialBSDTypeKey values. */ +#define kIOSerialBSDAllTypes "IOSerialStream" +#define kIOSerialBSDModemType "IOModemSerialStream" +#define kIOSerialBSDRS232Type "IORS232SerialStream" + +// Properties that resolve to a /dev device node to open for +// a particular service +#define kIOTTYDeviceKey "IOTTYDevice" +#define kIOTTYBaseNameKey "IOTTYBaseName" +#define kIOTTYSuffixKey "IOTTYSuffix" + +#define kIOCalloutDeviceKey "IOCalloutDevice" +#define kIODialinDeviceKey "IODialinDevice" + +// Property 'ioctl' wait for the tty device to go idle. +#define kIOTTYWaitForIdleKey "IOTTYWaitForIdle" + +#if KERNEL +extern const OSSymbol *gIOSerialBSDServiceValue; +extern const OSSymbol *gIOSerialBSDTypeKey; +extern const OSSymbol *gIOSerialBSDAllTypes; +extern const OSSymbol *gIOSerialBSDModemType; +extern const OSSymbol *gIOSerialBSDRS232Type; +extern const OSSymbol *gIOTTYDeviceKey; +extern const OSSymbol *gIOTTYBaseNameKey; +extern const OSSymbol *gIOTTYSuffixKey; +extern const OSSymbol *gIOCalloutDeviceKey; +extern const OSSymbol *gIODialinDeviceKey; +#endif /* KERNEL */ diff --git a/QualcommWireless/include/IOKit/serial/IOSerialStreamSync.h b/QualcommWireless/include/IOKit/serial/IOSerialStreamSync.h new file mode 100644 index 0000000..e1b8017 --- /dev/null +++ b/QualcommWireless/include/IOKit/serial/IOSerialStreamSync.h @@ -0,0 +1,275 @@ +/* + *Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + *@APPLE_LICENSE_HEADER_START@ + * + *The contents of this file constitute Original Code as defined in and + *are subject to the Apple Public Source License Version 1.1 (the + *"License"). You may not use this file except in compliance with the + *License. Please obtain a copy of the License at + *http://www.apple.com/publicsource and read it before using this file. + * + *This Original Code and all software distributed under the License are + *distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + *EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + *INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + *License for the specific language governing rights and limitations + *under the License. + * + *@APPLE_LICENSE_HEADER_END@ + */ +/* + * IOSerialStreamSync.h + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + * + */ + +#ifndef _SERIAL_IOSERIALSTREAMSYNC_H +#define _SERIAL_IOSERIALSTREAMSYNC_H + +#include <IOKit/IOService.h> + +#ifdef __LP64__ + +#define PD_DATA_MASK 0x03U +#define PD_DATA_VOID 0x00U +#define PD_DATA_BYTE 0x01U +#define PD_DATA_WORD 0x02U +#define PD_DATA_LONG 0x03U + +#else + +#define PD_DATA_MASK 0x03UL +#define PD_DATA_VOID 0x00UL +#define PD_DATA_BYTE 0x01UL +#define PD_DATA_WORD 0x02UL +#define PD_DATA_LONG 0x03UL + +#endif + +#define PD_OP(x) ((x) << 2) +#define PD_E_MASK (~PD_DATA_MASK) + +/* General Command & Status events */ +#define PD_E_EOQ (PD_DATA_VOID|PD_OP( 0)) // Always nextEvent on empty queue +#define PD_E_ACTIVE (PD_DATA_BYTE|PD_OP( 1)) // BOOL start/shutdown chip + +/* Queue management events - all units are multiples of characters + *based on the current character size + */ +#define PD_E_TXQ_SIZE (PD_DATA_LONG|PD_OP( 2)) +#define PD_E_RXQ_SIZE (PD_DATA_LONG|PD_OP( 3)) +#define PD_E_TXQ_LOW_WATER (PD_DATA_LONG|PD_OP( 4)) +#define PD_E_RXQ_LOW_WATER (PD_DATA_LONG|PD_OP( 5)) +#define PD_E_TXQ_HIGH_WATER (PD_DATA_LONG|PD_OP( 6)) +#define PD_E_RXQ_HIGH_WATER (PD_DATA_LONG|PD_OP( 7)) +#define PD_E_TXQ_AVAILABLE (PD_DATA_LONG|PD_OP( 8)) +#define PD_E_RXQ_AVAILABLE (PD_DATA_LONG|PD_OP( 9)) +#define PD_E_TXQ_FLUSH (PD_DATA_VOID|PD_OP(10)) +#define PD_E_RXQ_FLUSH (PD_DATA_LONG|PD_OP(11)) + +/* port & link characteristics - units are half bits */ +#define PD_E_DATA_RATE (PD_DATA_LONG|PD_OP(12)) // raw bits of symbols per second +#define PD_E_RX_DATA_RATE (PD_DATA_LONG|PD_OP(13)) +#define PD_E_DATA_SIZE (PD_DATA_LONG|PD_OP(14)) // raw bits per symbol +#define PD_E_RX_DATA_SIZE (PD_DATA_LONG|PD_OP(15)) +#define PD_E_DATA_INTEGRITY (PD_DATA_LONG|PD_OP(16)) // parity or ECC method +#define PD_E_RX_DATA_INTEGRITY (PD_DATA_LONG|PD_OP(17)) +#define PD_E_EXTERNAL_CLOCK_MODE (PD_DATA_LONG|PD_OP(28)) // multiplier between clock and data rates + +/* timeout events */ +#define PD_E_DELAY (PD_DATA_LONG|PD_OP(18)) // inter-character delay (us) +#define PD_E_DATA_LATENCY (PD_DATA_LONG|PD_OP(19)) // A dequeueData Latency timeout + // rcs Secondary Timer mainly to fix performance + // problems with MIDI and IRDA drivers. + // Midi and Irda drivers will issue an IOCTL + // call with this as the selector and + // the Data as the value they want the rate set + // to (Typically 1 for IrDA devices) +#define PD_E_FLOW_CONTROL (PD_DATA_LONG|PD_OP(20)) // enable/disable each flow mechanism + +/* I/O events */ +#define PD_E_VALID_DATA (PD_DATA_VOID|PD_OP(21)) // A valid frame was received +#define PD_E_VALID_DATA_BYTE (PD_DATA_BYTE|PD_E_VALID_DATA) +#define PD_E_VALID_DATA_WORD (PD_DATA_WORD|PD_E_VALID_DATA) +#define PD_E_VALID_DATA_LONG (PD_DATA_LONG|PD_E_VALID_DATA) + +#define PD_E_SPECIAL (PD_DATA_VOID|PD_OP(22)) // valid data received with 'special' value +#define PD_E_SPECIAL_BYTE (PD_DATA_BYTE|PD_E_SPECIAL) +#define PD_E_SPECIAL_WORD (PD_DATA_WORD|PD_E_SPECIAL) +#define PD_E_SPECIAL_LONG (PD_DATA_LONG|PD_E_SPECIAL) + +#define PD_E_FRAMING_ERROR (PD_DATA_VOID|PD_OP(23)) // Failure occured assembling frame +#define PD_E_FRAMING_BYTE (PD_DATA_BYTE|PD_E_FRAMING_ERROR) +#define PD_E_FRAMING_WORD (PD_DATA_WORD|PD_E_FRAMING_ERROR) +#define PD_E_FRAMING_LONG (PD_DATA_LONG|PD_E_FRAMING_ERROR) + +#define PD_E_INTEGRITY_ERROR (PD_DATA_VOID|PD_OP(24)) // An uncorrectable frame was received +#define PD_E_INTEGRITY_BYTE (PD_DATA_BYTE|PD_E_INTEGRITY_ERROR) +#define PD_E_INTEGRITY_WORD (PD_DATA_WORD|PD_E_INTEGRITY_ERROR) +#define PD_E_INTEGRITY_LONG (PD_DATA_LONG|PD_E_INTEGRITY_ERROR) + +#define PD_E_INTEGRITY_WARNING (PD_DATA_VOID|PD_OP(25)) // A correctable frame was received +#define PD_E_HW_OVERRUN_ERROR (PD_DATA_VOID|PD_OP(26)) // Hardware's buffer overflowed, data lost +#define PD_E_SW_OVERRUN_ERROR (PD_DATA_VOID|PD_OP(27)) // Driver's buffer overflowed, data lost + +/* + *The variables below make up the bits returned + *by the State methods:- getState, setState, watchState + */ +#define PD_S_MASK 0xffff0000UL +#define PD_S_RX_OFFSET 7 + +#define PD_S_ACQUIRED 0x80000000UL +#define PD_S_ACTIVE 0x40000000UL + +#define PD_S_TX_ENABLE 0x20000000UL +#define PD_S_TX_BUSY 0x10000000UL +#define PD_S_TX_EVENT 0x08000000UL +#define PD_S_TXQ_EMPTY 0x04000000UL +#define PD_S_TXQ_LOW_WATER 0x02000000UL +#define PD_S_TXQ_HIGH_WATER 0x01000000UL +#define PD_S_TXQ_FULL 0x00800000UL +#define PD_S_TXQ_MASK ( PD_S_TXQ_EMPTY | PD_S_TXQ_LOW_WATER \ + | PD_S_TXQ_FULL | PD_S_TXQ_HIGH_WATER ) + +#define PD_S_RX_ENABLE (PD_S_TX_ENABLE >> PD_S_RX_OFFSET) +#define PD_S_RX_BUSY (PD_S_TX_BUSY >> PD_S_RX_OFFSET) +#define PD_S_RX_EVENT (PD_S_TX_EVENT >> PD_S_RX_OFFSET) +#define PD_S_RXQ_EMPTY (PD_S_TXQ_EMPTY >> PD_S_RX_OFFSET) +#define PD_S_RXQ_LOW_WATER (PD_S_TXQ_LOW_WATER >> PD_S_RX_OFFSET) +#define PD_S_RXQ_HIGH_WATER (PD_S_TXQ_HIGH_WATER >> PD_S_RX_OFFSET) +#define PD_S_RXQ_FULL (PD_S_TXQ_FULL >> PD_S_RX_OFFSET) +#define PD_S_RXQ_MASK (PD_S_TXQ_MASK >> PD_S_RX_OFFSET) + +class IOSerialDriverSync; +class IOSerialStreamSync : public IOService +{ + OSDeclareDefaultStructors(IOSerialStreamSync); + +protected: + IOSerialDriverSync *fProvider; + void *fRefCon; + +public: + /* acquire tests and sets the state of the port object. If the port was + *available, then the state is set to busy, and kIOReturnSuccess is returned. + *If the port was already busy and sleep is YES, then the thread will sleep + *until the port is freed, then re-attempts the acquire. If the port was + *already busy and sleep in NO, then kIOReturnExclusiveAccess is returned. + */ + virtual IOReturn acquirePort(bool sleep); + + /* release sets the state of the port object to available and wakes up any + *threads sleeping for access to this port. It will return kIOReturnSuccess + *if the port was in a busy state, and kIOReturnNotOpen if it was available. + */ + virtual IOReturn releasePort(); + + /* + *Set the state for the port device. + */ + virtual IOReturn setState(UInt32 state, UInt32 mask); + + /* + *Get the state for the port device. + */ + virtual UInt32 getState(); + + /* + *Wait for the at least one of the state bits defined in mask to be equal + *to the value defined in state. + *Check on entry then sleep until necessary. + */ + virtual IOReturn watchState(UInt32 *state, UInt32 mask); + + /* nextEvent returns the type of the next event on the RX queue. If no + *events are present on the RX queue, then EOQ is returned. + */ + virtual UInt32 nextEvent(); + + /* executeEvent causes the specified event to be processed immediately. + *This is primarily used for channel control commands like START & STOP + */ + virtual IOReturn executeEvent(UInt32 event, UInt32 data); + + /* requestEvent processes the specified event as an immediate request and + *returns the results in data. This is primarily used for getting link + *status information and verifying baud rate and such. + */ + virtual IOReturn requestEvent(UInt32 event, UInt32 *data); + + /* enqueueEvent will place the specified event into the TX queue. The + *sleep argument allows the caller to specify the enqueueEvent's + *behaviour when the TX queue is full. If sleep is true, then this + *method will sleep until the event is enqueued. If sleep is false, + *then enqueueEvent will immediatly return kIOReturnNoResources. + */ + virtual IOReturn enqueueEvent(UInt32 event, UInt32 data, bool sleep); + + /* dequeueEvent will remove the oldest event from the RX queue and return + *it in event & data. The sleep argument defines the behaviour if the RX + *queue is empty. If sleep is true, then this method will sleep until an + *event is available. If sleep is false, then an EOQ event will be + *returned. In either case kIOReturnSuccess is returned. + */ + virtual IOReturn dequeueEvent(UInt32 *event, UInt32 *data, bool sleep); + + /* enqueueData will attempt to copy data from the specified buffer to the + *TX queue as a sequence of VALID_DATA events. The argument bufferSize + *specifies the number of bytes to be sent. The actual number of bytes + *transferred is returned in transferCount. If sleep is true, then this + *method will sleep until all bytes can be transferred. If sleep is + *false, then as many bytes as possible will be copied to the TX queue. + */ + virtual IOReturn enqueueData(UInt8 *buffer, UInt32 size, UInt32 *count, bool sleep ); + + /* dequeueData will attempt to copy data from the RX queue to the specified + *buffer. No more than bufferSize VALID_DATA events will be transferred. + *In other words, copying will continue until either a non-data event is + *encountered or the transfer buffer is full. The actual number of bytes + *transferred is returned in transferCount. + * + *The sleep semantics of this method are slightly more complicated than + *other methods in this API: Basically, this method will continue to + *sleep until either minCount characters have been received or a non + *data event is next in the RX queue. If minCount is zero, then this + *method never sleeps and will return immediatly if the queue is empty. + * + *The latency parameter specifies the maximum amount of time that should + *pass after the first character is available before the routine returns. + *This allows the caller to specify a 'packet' timeout. The unit of the + *latency parameter is microseconds, though the exact delay may vary + *depending on the granularity of the timeout services available to the + *driver. + */ + virtual IOReturn dequeueData(UInt8 *buffer, UInt32 size, UInt32 *count, UInt32 min); + + /* Internal for IOSerialDriver only */ + virtual bool init(OSDictionary *dictionary = 0, void *refCon = 0); + virtual bool attach(IOService *provider) APPLE_KEXT_OVERRIDE; + void *getRefCon() const { return fRefCon; } + +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 0); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 1); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 2); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 3); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 4); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 5); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 6); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 7); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 8); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 9); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 10); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 11); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 12); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 13); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 14); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 15); +}; + +#endif /* !_SERIAL_IOSERIALSTREAMSYNC_H */ + + diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkCloneableNetworkPacket.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkCloneableNetworkPacket.h new file mode 100644 index 0000000..97b2f33 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkCloneableNetworkPacket.h @@ -0,0 +1,76 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKCLONEABLENETWORKPACKET_H +#define _IOSKYWALKCLONEABLENETWORKPACKET_H + +#include <IOKit/skywalk/IOSkywalkNetworkPacket.h> + +class IOSkywalkCloneableNetworkPacket : public IOSkywalkNetworkPacket +{ + OSDeclareDefaultStructors( IOSkywalkCloneableNetworkPacket ) + +public: + static IOSkywalkPacket * withPool( IOSkywalkPacketBufferPool * pool, IOSkywalkPacketDescriptor * desc, IOOptionBits options ); + virtual bool initWithPool( IOSkywalkPacketBufferPool * pool, IOSkywalkPacketDescriptor * desc, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + IOSkywalkCloneableNetworkPacket * packetClone(); + IOReturn packetCloneWithBaseAndLimit( int64_t base, size_t limit, IOSkywalkCloneableNetworkPacket ** packet ); + IOReturn setPacketBufferBaseAndLimit( int64_t base, size_t limit ); + IOReturn getPacketBufferBaseAddr( uint8_t ** baseAddr ); + IOReturn getPacketBufferObjectBaseAddr( uint8_t ** baseAddr ); + IOReturn getPacketBufferObjectIOBusBaseAddr( uint8_t ** baseAddr ); + + virtual UInt32 getPacketBuffers( IOSkywalkPacketBuffer ** buffers, UInt32 count ) APPLE_KEXT_OVERRIDE; + virtual UInt32 getPacketBufferCount() APPLE_KEXT_OVERRIDE; + virtual IOMemoryDescriptor * getMemoryDescriptor() APPLE_KEXT_OVERRIDE; + virtual IOReturn setDataLength( UInt32 length ) APPLE_KEXT_OVERRIDE; + virtual UInt32 getDataLength() APPLE_KEXT_OVERRIDE; + virtual IOReturn setDataOffset( UInt16 offset ) APPLE_KEXT_OVERRIDE; + virtual UInt16 getDataOffset() APPLE_KEXT_OVERRIDE; + virtual IOReturn setDataOffsetAndLength( UInt16 offset, UInt32 length ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn prepareWithQueue( IOSkywalkPacketQueue * queue, IOSkywalkPacketDirection direction = kIOSkywalkPacketDirectionNone, IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; + virtual IOReturn completeWithQueue( IOSkywalkPacketQueue * queue, IOSkywalkPacketDirection direction = kIOSkywalkPacketDirectionNone, IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; + + virtual UInt32 getPacketType() APPLE_KEXT_OVERRIDE; + virtual kern_buflet_t acquireWithPacketHandle( UInt64 handle, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual void disposePacket() APPLE_KEXT_OVERRIDE; + void printPacket(); + +protected: + uint64_t _reserved[3]; // 128... I bet they are used or set in another class! +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkController.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkController.h new file mode 100644 index 0000000..99cf72a --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkController.h @@ -0,0 +1,59 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKCONTROLLER_H +#define _IOSKYWALKCONTROLLER_H + +#include <IOKit/IOService.h> + +class IOSkywalkInterface; + +class IOSkywalkController : public IOService +{ + OSDeclareDefaultStructors( IOSkywalkController ) + +public: + virtual void free() APPLE_KEXT_OVERRIDE; + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool handleOpen( IOService * forClient, IOOptionBits options, void * arg ) APPLE_KEXT_OVERRIDE; + virtual void handleClose( IOService * forClient, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual bool handleIsOpen( const IOService * forClient ) const APPLE_KEXT_OVERRIDE; + IOReturn attachInterface( IOSkywalkInterface * interface, IOOptionBits options ); + IOReturn detachInterface( IOSkywalkInterface * interface, IOOptionBits options ); + +protected: + void * mReserved; + OSSet * mInterfaces; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkEthernetInterface.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkEthernetInterface.h new file mode 100644 index 0000000..bdd1cb9 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkEthernetInterface.h @@ -0,0 +1,95 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKETHERNETINTERFACE_H +#define _IOSKYWALKETHERNETINTERFACE_H + +#include <IOKit/skywalk/IOSkywalkNetworkInterface.h> +#include <net/if_dl.h> + +class IOSkywalkEthernetInterface : public IOSkywalkNetworkInterface +{ + OSDeclareAbstractStructors( IOSkywalkEthernetInterface ) + + struct RegistrationInfo; + +public: + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + bool initRegistrationInfo( RegistrationInfo * info, IOOptionBits options, size_t size ); + IOReturn registerEthernetInterface( const RegistrationInfo * info, IOSkywalkPacketQueue ** queues, IOOptionBits queueOptions, IOSkywalkPacketBufferPool * pool1, IOSkywalkPacketBufferPool * pool2, IOOptionBits options = 0 ); + IOReturn deregisterEthernetInterface( IOOptionBits options = 0 ); + + virtual IOReturn initBSDInterfaceParameters( struct ifnet_init_eparams * params, sockaddr_dl ** ll ) APPLE_KEXT_OVERRIDE; + virtual IOReturn prepareBSDInterface( ifnet_t interface, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual errno_t processBSDCommand( ifnet_t interface, UInt32 cmd, void * data ) APPLE_KEXT_OVERRIDE; + + errno_t ioctl_sifflags( ifnet_t interface ); + errno_t ioctl_multicast( ifnet_t interface, bool ); + + virtual IOReturn getPacketTapInfo(UInt32 *, UInt32 *) APPLE_KEXT_OVERRIDE; + virtual UInt32 getMaxTransferUnit() APPLE_KEXT_OVERRIDE; + virtual UInt32 getMinPacketSize() APPLE_KEXT_OVERRIDE; + virtual UInt32 getHardwareAssists() APPLE_KEXT_OVERRIDE; + + virtual IOReturn configureMulticastFilter( UInt32, const ether_addr * addresses, uint32_t count ); + virtual IOReturn setPromiscuousModeEnable( bool enable, IOOptionBits options ); + + OSMetaClassDeclareReservedUnused( IOSkywalkEthernetInterface, 0 ); + OSMetaClassDeclareReservedUnused( IOSkywalkEthernetInterface, 1 ); + OSMetaClassDeclareReservedUnused( IOSkywalkEthernetInterface, 2 ); + OSMetaClassDeclareReservedUnused( IOSkywalkEthernetInterface, 3 ); + OSMetaClassDeclareReservedUnused( IOSkywalkEthernetInterface, 4 ); + OSMetaClassDeclareReservedUnused( IOSkywalkEthernetInterface, 5 ); + OSMetaClassDeclareReservedUnused( IOSkywalkEthernetInterface, 6 ); + OSMetaClassDeclareReservedUnused( IOSkywalkEthernetInterface, 7 ); + OSMetaClassDeclareReservedUnused( IOSkywalkEthernetInterface, 8 ); + OSMetaClassDeclareReservedUnused( IOSkywalkEthernetInterface, 9 ); + OSMetaClassDeclareReservedUnused( IOSkywalkEthernetInterface, 10 ); + +protected: + void * mReserved; + + struct ExpansionData + { + RegistrationInfo * eRegistrationInfo; + OSData * eMulticastAddresses; + UInt32 eNumMulticastAddresses; + UInt16 eBSDInterfaceFlags; + sockaddr_dl eLinkLayerSockAddress; + }; + ExpansionData * mExpansionData; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkFamily.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkFamily.h new file mode 100644 index 0000000..05c2ff0 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkFamily.h @@ -0,0 +1,54 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#pragma once + +#include <IOKit/skywalk/IOSkywalkSupport.h> +#include <IOKit/skywalk/IOSkywalkTypes.h> +#include <IOKit/skywalk/IOSkywalkMemorySegment.h> +#include <IOKit/skywalk/IOSkywalkPacket.h> +#include <IOKit/skywalk/IOSkywalkNetworkPacket.h> +#include <IOKit/skywalk/IOSkywalkCloneableNetworkPacket.h> +#include <IOKit/skywalk/IOSkywalkPacketBuffer.h> +#include <IOKit/skywalk/IOSkywalkPacketBufferPool.h> +#include <IOKit/skywalk/IOSkywalkPacketQueue.h> +#include <IOKit/skywalk/IOSkywalkRxSubmissionQueue.h> +#include <IOKit/skywalk/IOSkywalkRxCompletionQueue.h> +#include <IOKit/skywalk/IOSkywalkTxSubmissionQueue.h> +#include <IOKit/skywalk/IOSkywalkTxCompletionQueue.h> +#include <IOKit/skywalk/IOSkywalkController.h> +#include <IOKit/skywalk/IOSkywalkNetworkController.h> +#include <IOKit/skywalk/IOSkywalkInterface.h> +#include <IOKit/skywalk/IOSkywalkNetworkInterface.h> +#include <IOKit/skywalk/IOSkywalkEthernetInterface.h> +#include <IOKit/skywalk/IOUserNetworkEthernetNicProxy.h> diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkInterface.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkInterface.h new file mode 100644 index 0000000..c1828f9 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkInterface.h @@ -0,0 +1,81 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKINTERFACE_H +#define _IOSKYWALKINTERFACE_H + +#include <IOKit/IOService.h> + +class IOSkywalkPacketQueue; +class IOSkywalkPacketBufferPool; + +class IOSkywalkInterface : public IOService +{ + OSDeclareAbstractStructors( IOSkywalkInterface ) + +protected: + virtual void free() APPLE_KEXT_OVERRIDE; + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool handleOpen( IOService * forClient, IOOptionBits options, void * arg ) APPLE_KEXT_OVERRIDE; + virtual void handleClose( IOService * forClient, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual bool handleIsOpen( const IOService * forClient ) const APPLE_KEXT_OVERRIDE; + virtual IOReturn enable( IOOptionBits options ) = 0; + virtual IOReturn disable( IOOptionBits options ) = 0; + virtual IOReturn clientConnectWithTask( task_t task, IOService * forClient, IOOptionBits options ); + virtual void clientDisconnect( IOService * forClient, IOOptionBits options ); + + IOReturn registerInterfaceWithQueues( IOSkywalkPacketQueue ** queue, UInt32 count, IOSkywalkPacketBufferPool * pool1, IOSkywalkPacketBufferPool * pool2, IOOptionBits options = 0 ); + IOReturn deregisterInterfaceWithQueues(); + + OSMetaClassDeclareReservedUnused( IOSkywalkInterface, 0 ); + OSMetaClassDeclareReservedUnused( IOSkywalkInterface, 1 ); + OSMetaClassDeclareReservedUnused( IOSkywalkInterface, 2 ); + OSMetaClassDeclareReservedUnused( IOSkywalkInterface, 3 ); + OSMetaClassDeclareReservedUnused( IOSkywalkInterface, 4 ); + OSMetaClassDeclareReservedUnused( IOSkywalkInterface, 5 ); + OSMetaClassDeclareReservedUnused( IOSkywalkInterface, 6 ); + OSMetaClassDeclareReservedUnused( IOSkywalkInterface, 7 ); + OSMetaClassDeclareReservedUnused( IOSkywalkInterface, 8 ); + OSMetaClassDeclareReservedUnused( IOSkywalkInterface, 9 ); + OSMetaClassDeclareReservedUnused( IOSkywalkInterface, 10 ); + +protected: + void * mReserved; // 136 + OSArray * mPacketQueueArray; // 144 + IOSkywalkPacketBufferPool * mPacketBufferPool1; // 152 + IOSkywalkPacketBufferPool * mPacketBufferPool2; // 160 + OSSet * mClients; // 168 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkMemorySegment.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkMemorySegment.h new file mode 100644 index 0000000..634ad2f --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkMemorySegment.h @@ -0,0 +1,88 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKMEMORYSEGMENT_H +#define _IOSKYWALKMEMORYSEGMENT_H + +#include <IOKit/IODMACommand.h> +#include <IOKit/skywalk/IOSkywalkPacketBufferPool.h> + +struct IOSkywalkMemorySegmentDescriptor +{ + UInt32 packetBufferCount; + + struct + { + IODMACommand::SegmentFunction outSegFunc; + UInt8 numAddressBits; + UInt64 maxSegmentSize; + IODMACommand::MappingOptions mappingOptions; + UInt64 maxTransferSize; + UInt32 alignment; + IOMapper * mapper; + } * specs; +}; + +class IOSkywalkMemorySegment : public OSObject +{ + OSDeclareDefaultStructors( IOSkywalkMemorySegment ) + +public: + static IOSkywalkMemorySegment * withPool( IOSkywalkPacketBufferPool * pool, IOSkywalkMemorySegmentDescriptor * desc, IOOptionBits options = 0 ); + virtual bool initWithPool( IOSkywalkPacketBufferPool * pool, IOSkywalkMemorySegmentDescriptor * desc, IOOptionBits options = 0 ); + virtual void free() APPLE_KEXT_OVERRIDE; + + IOSkywalkPacketBufferPool * getPacketBufferPool(); + virtual IOReturn setDMACommand( IODMACommand * dmaCommand, IOOptionBits options = 0 ); + virtual IODMACommand * getDMACommand(); + + virtual IOReturn prepare( IODirection forDirection = kIODirectionNone ); + virtual IOReturn complete( IODirection forDirection = kIODirectionNone ); + + virtual IOReturn setBufferMemoryDescriptor( IOBufferMemoryDescriptor * md ); + IOMemoryDescriptor * getMemoryDescriptor(); + virtual IOReturn setMemoryDescriptor( IOMemoryDescriptor * md, UInt64 address ); + UInt64 getVirtualAddress(); + +protected: + void * mReserved; // 16 + IOSkywalkPacketBufferPool * mPool; // 24 + IOMemoryDescriptor * mMemoryDescriptor; // 32 + OSObject * _unknown; // 40 + UInt64 mVirtualAddress; // 48 + IODMACommand * mDMACommand; // 56 + OSArray * mPacketBufferArray; // 64, stores IOSkywalkPacketBuffers + uint64_t _reserved1[6]; // 72 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkNetworkController.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkNetworkController.h new file mode 100644 index 0000000..41a1ace --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkNetworkController.h @@ -0,0 +1,44 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKNETWORKCONTROLLER_H +#define _IOSKYWALKNETWORKCONTROLLER_H + +#include <IOKit/skywalk/IOSkywalkController.h> + +class IOSkywalkNetworkController : public IOSkywalkController +{ + OSDeclareDefaultStructors( IOSkywalkNetworkController ) +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkNetworkInterface.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkNetworkInterface.h new file mode 100644 index 0000000..64502f9 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkNetworkInterface.h @@ -0,0 +1,144 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKNETWORKINTERFACE_H +#define _IOSKYWALKNETWORKINTERFACE_H + +#include <IOKit/skywalk/IOSkywalkInterface.h> +#include <IOKit/skywalk/IOSkywalkTypes.h> +#include <IOKit/80211/apple80211_ioctl.h> + +class IOSkywalkNetworkKDPPoller; + +class IOSkywalkNetworkInterface : public IOSkywalkInterface +{ + OSDeclareAbstractStructors( IOSkywalkNetworkInterface ) + + struct RegistrationInfo; + +public: + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE; + + IOReturn registerNetworkInterface( const RegistrationInfo * info, IOSkywalkPacketQueue ** queues, IOOptionBits queueOptions, IOSkywalkPacketBufferPool * pool1, IOSkywalkPacketBufferPool * pool2, IOOptionBits options = 0 ); + IOReturn deregisterNetworkInterface( IOOptionBits options = 0 ); + + void handleLinkStatusEvent(); + IOReturn reportEventType( UInt32 type, void * argument, vm_size_t argSize = 0 ); + IOReturn reportLinkStatus( IOSkywalkNetworkLinkStatus linkStatus, IOSkywalkNetworkMediaType activeMediaType ); + IOReturn reportLinkQuality( IOSkywalkNetworkLinkQuality linkQuality ); + IOReturn reportDataBandwidths( uint64_t maxInputBandwidth, uint64_t maxOutputBandwidth, uint64_t effectiveInputBandwidth, uint64_t effectiveOutputBandwidth ); + IOReturn reportInterfaceAdvisory( const struct ifnet_interface_advisory * advisory ); + + virtual IOReturn setAggressiveness( unsigned long type, unsigned long newLevel ) APPLE_KEXT_OVERRIDE; + + virtual void joinPMtree( IOService * driver ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn initBSDInterfaceParameters( struct ifnet_init_eparams * params, struct sockaddr_dl ** ll ) = 0; + virtual IOReturn prepareBSDInterface( ifnet_t interface, IOOptionBits options ); + virtual void finalizeBSDInterface( ifnet_t interface, IOOptionBits options ); + virtual ifnet_t getBSDInterface(); + virtual void setBSDName( const char * name ); + virtual const char * getBSDName(); + + virtual errno_t processBSDCommand( ifnet_t interface, UInt32 cmd, void * data ); + errno_t ioctl_gifmedia( ifnet_t interface, UInt32 sockioc, void * data ); + errno_t ioctl_sifmedia( ifnet_t interface, void * data ); + errno_t ioctl_gifdevmtu( ifnet_t interface, void * data ); + errno_t ioctl_sifmtu( ifnet_t interface, void * data, bool useOriginalLength ); + errno_t ioctl_gifcap( ifnet_t interface, void * data ); + errno_t ioctl_sifcap( ifnet_t interface, void * data ); + + virtual void setRunningState( bool state ); + + virtual IOReturn handleChosenMedia( UInt32 ); + virtual IOReturn getSupportedMediaArray( UInt32 *, UInt32 * ); + + virtual IOReturn getPacketTapInfo( UInt32 *, UInt32 * ); + virtual IOReturn getUnsentDataByteCount( UInt32 *, UInt32 *, UInt32 ); + virtual IOReturn getSupportedWakeFlags( UInt32 * flags ); + virtual IOReturn enableNetworkWake( UInt32 flags ); + + virtual IOReturn calculateRingSizeForQueue( const IOSkywalkPacketQueue * queue, UInt32 * size ); + IOReturn getServiceClassIndex( kern_packet_svc_class_t serviceClass, UInt32 * index ); + virtual UInt32 getMaxTransferUnit(); + virtual UInt32 getMinPacketSize(); + virtual IOReturn getMTU( UInt32 * mtu ); + virtual void setMTU( UInt32 mtu ); + + virtual UInt32 getHardwareAssists(); + virtual void setHardwareAssists( UInt32 hardwareAssists ); + IOReturn setKDPPoller( IOSkywalkNetworkKDPPoller * poller ); + + virtual void captureInterfaceState( UInt32 state ); + virtual void restoreInterfaceState( UInt32 state ); + virtual IOReturn handleDoorbellForQueue( IOSkywalkPacketQueue * queue, UInt32 ); + + OSMetaClassDeclareReservedUnused( IOSkywalkNetworkInterface, 0 ); + OSMetaClassDeclareReservedUnused( IOSkywalkNetworkInterface, 1 ); + OSMetaClassDeclareReservedUnused( IOSkywalkNetworkInterface, 2 ); + OSMetaClassDeclareReservedUnused( IOSkywalkNetworkInterface, 3 ); + OSMetaClassDeclareReservedUnused( IOSkywalkNetworkInterface, 4 ); + OSMetaClassDeclareReservedUnused( IOSkywalkNetworkInterface, 5 ); + OSMetaClassDeclareReservedUnused( IOSkywalkNetworkInterface, 6 ); + OSMetaClassDeclareReservedUnused( IOSkywalkNetworkInterface, 7 ); + OSMetaClassDeclareReservedUnused( IOSkywalkNetworkInterface, 8 ); + OSMetaClassDeclareReservedUnused( IOSkywalkNetworkInterface, 9 ); + OSMetaClassDeclareReservedUnused( IOSkywalkNetworkInterface, 10 ); + +protected: + void * mReserved; + + struct ExpansionData + { + RegistrationInfo * eRegistrationInfo; + ifnet_t eBSDInterface; + OSArray * ePacketQueueArray; + IOLock * eDataLock; + IOLock * eInterfacePreparedLock; + IOSkywalkNetworkKDPPoller * eKDPPoller; + thread_call_t eLinkStatusEventThread; + UInt32 eLinkStatusMessageType; + IOSkywalkNetworkMediaType eActiveMediaType; + UInt32 eChosenMedia; + IOSkywalkNetworkLinkStatus eLinkStatus; + bool eInterfacePrepared; + const char eBSDName[80]; + UInt32 eMTU; + }; + ExpansionData * mExpansionData; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkNetworkPacket.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkNetworkPacket.h new file mode 100644 index 0000000..96316d3 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkNetworkPacket.h @@ -0,0 +1,83 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKNETWORKPACKET_H +#define _IOSKYWALKNETWORKPACKET_H + +#include <IOKit/skywalk/IOSkywalkPacket.h> + +class IOSkywalkNetworkPacket : public IOSkywalkPacket +{ + OSDeclareDefaultStructors( IOSkywalkNetworkPacket ) + +public: + static IOSkywalkNetworkPacket * withPool( IOSkywalkPacketBufferPool * pool, IOSkywalkPacketDescriptor * desc, IOOptionBits options ); + virtual UInt32 getPacketType() APPLE_KEXT_OVERRIDE; + + IOReturn setHeadroom( uint8_t headroom ); + uint8_t getHeadroom(); + IOReturn setLinkHeaderLength( uint8_t length ); + uint8_t getLinkHeaderLength(); + IOReturn setLinkHeaderOffset( uint32_t offset ); + IOReturn getLinkHeaderOffset( uint32_t * offset ); + IOReturn setNetworkHeaderOffset( uint32_t offset ); + IOReturn getNetworkHeaderOffset( uint32_t * offset ); + IOReturn setDataContainsFCS( bool contain ); + bool getDataContainsFCS(); + kern_packet_svc_class_t getServiceClass(); + + IOReturn setTimestamp( AbsoluteTime timestamp ); + IOReturn getTimestamp( AbsoluteTime * timestamp ); + IOReturn clearTimestamp(); + bool isTimestampRequested(); + IOReturn setCompletionStatus( int status ); + IOReturn getExpiryTime( AbsoluteTime * time ); + + IOReturn getTokenData( void * data, uint16_t * size ); + IOReturn getPacketID( packet_id_t * packetID ); + + bool isPacketGroupStart(); + bool isPacketGroupEnd(); + bool isHighPriority(); + bool isTransportNewFlow(); + bool isTransportLastPacket(); + IOReturn setIsLinkBroadcast( bool broadcast ); + bool isLinkBroadcast(); + IOReturn setIsLinkMulticast( bool multicast ); + bool isLinkMulticast(); + +protected: + void * mReserved; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkPacket.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkPacket.h new file mode 100644 index 0000000..5253248 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkPacket.h @@ -0,0 +1,115 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKPACKET_H +#define _IOSKYWALKPACKET_H + +#include <IOKit/IOCommand.h> +#include <IOKit/skywalk/IOSkywalkPacketBufferPool.h> + +typedef uint32_t IOSkywalkPacketDirection; +enum +{ + kIOSkywalkPacketDirectionNone = 0x00000000, + kIOSkywalkPacketDirectionTx = 0x00000001, + kIOSkywalkPacketDirectionRx = 0x00000002 +}; + +enum IOSkywalkPacketTypes +{ + kIOSkywalkPacketTypeGeneric = 0, + kIOSkywalkPacketTypeNetwork, + kIOSkywalkPacketTypeCloneable +}; + +struct IOSkywalkPacketDescriptor +{ + kern_packet_idx_t packetIndex; + bool singleBuffer; +}; + +class IOSkywalkPacket : public IOCommand +{ + OSDeclareDefaultStructors( IOSkywalkPacket ) + +public: + static IOSkywalkPacket * withPool( IOSkywalkPacketBufferPool * pool, IOSkywalkPacketDescriptor * desc, IOOptionBits options ); + virtual bool initWithPool( IOSkywalkPacketBufferPool * pool, IOSkywalkPacketDescriptor * desc, IOOptionBits options ); + virtual void free() APPLE_KEXT_OVERRIDE; + + IOSkywalkPacketBufferPool * getPacketBufferPool(); + UInt32 getBufferSize(); + virtual UInt32 getPacketBuffers( IOSkywalkPacketBuffer ** buffers, UInt32 maxBuffers ); + virtual UInt32 getPacketBufferCount(); + virtual IOMemoryDescriptor * getMemoryDescriptor(); + virtual IOReturn setDataLength( UInt32 length ); + virtual UInt32 getDataLength(); + virtual IOReturn setDataOffset( UInt16 offset ); + virtual UInt16 getDataOffset(); + virtual IOReturn setDataOffsetAndLength( UInt16 offset, UInt32 length ); + + IOSkywalkPacketQueue * getSourceQueue(); + virtual IOReturn prepareWithQueue( IOSkywalkPacketQueue * queue, IOSkywalkPacketDirection direction = kIOSkywalkPacketDirectionNone, IOOptionBits options = 0 ); + virtual IOReturn prepare( IOSkywalkPacketQueue * queue, UInt64 offset, IOOptionBits options = 0 ); + virtual IOReturn completeWithQueue( IOSkywalkPacketQueue * queue, IOSkywalkPacketDirection direction = kIOSkywalkPacketDirectionNone, IOOptionBits options = 0 ); + virtual IOReturn complete( IOSkywalkPacketQueue * queue, IOOptionBits options = 0 ); + + void setTransferDirection( IOSkywalkPacketDirection direction ); + IOSkywalkPacketDirection getTransferDirection(); + bool clearTransferDirection( IOSkywalkPacketDirection direction ); + + void setSlotReference( void * ref ); + void * getSlotReference(); + virtual UInt32 getPacketType(); + virtual kern_buflet_t acquireWithPacketHandle( kern_packet_t handle, IOOptionBits options ); + void cancelCompletionCallback(); + virtual void disposePacket(); + +protected: + void * mReserved; // 32 + kern_packet_t mPacketHandle; // 40 + IOSkywalkPacketBuffer ** mPacketBuffers; // 48 + IOSkywalkPacketQueue * mSourceQueue; // 56 + IOSkywalkPacketBufferPool * mBufferPool; // 64 + kern_buflet_t mBuflet; // 72 + + uint64_t _reserved0; // 80 + UInt32 mPacketState; // 88 - 0 on complete, 1 on acquire, 2 on prepare + UInt32 mMaxNumBuffers; // 92 + UInt32 mActualNumBuffers; // 96 + kern_packet_idx_t mPacketIndex; // 100 + IOSkywalkPacketDirection mTransferDirection; // 104 + void * mSlotReference; // 112 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkPacketBuffer.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkPacketBuffer.h new file mode 100644 index 0000000..903a7b4 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkPacketBuffer.h @@ -0,0 +1,116 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKPACKETBUFFER_H +#define _IOSKYWALKPACKETBUFFER_H + +#include <skywalk/os_skywalk.h> +#include <IOKit/IOCommand.h> +#include <IOKit/skywalk/IOSkywalkTypes.h> + +class IOSkywalkPacket; +class IOSkywalkPacketQueue; +class IOSkywalkPacketBufferPool; +class IOSkywalkMemorySegment; + +struct IOSkywalkPacketBufferDescriptor +{ + IOMemoryDescriptor * memDescriptor; + IOSkywalkMemorySegment * memSegment; + UInt64 memSegmentOffset; +}; + +class IOSkywalkPacketBuffer : public IOCommand +{ + OSDeclareDefaultStructors( IOSkywalkPacketBuffer ) + +public: + static IOSkywalkPacketBuffer * withPool( IOSkywalkPacketBufferPool * pool, IOSkywalkPacketBufferDescriptor * desc, IOOptionBits options = 0 ); + virtual bool initWithPool( IOSkywalkPacketBufferPool * pool, IOSkywalkPacketBufferDescriptor * desc, IOOptionBits options = 0 ); + virtual void free() APPLE_KEXT_OVERRIDE; + + IOSkywalkPacketBufferPool * getPacketBufferPool(); + UInt32 getBufferSize(); + + UInt32 getDataLength(); + IOReturn setDataLength( UInt32 length ); + UInt16 getDataOffset(); + IOReturn setDataOffset( UInt16 offset ); + IOReturn setDataOffsetAndLength( UInt16 offset, UInt32 length ); + + IOSkywalkPacket * getPacket(); + virtual void setPacket( IOSkywalkPacket * packet, IOOptionBits options ); + + virtual IOReturn prepare( IODirection forDirection = kIODirectionNone ); + virtual IOReturn complete( IODirection forDirection = kIODirectionNone ); + + IOSkywalkMemorySegment * getMemorySegment(); + UInt64 getMemorySegmentOffset(); + virtual IOReturn prepareWithMemorySegment( IOSkywalkMemorySegment * segment, UInt64 offset, IOOptionBits options = 0 ); + virtual IOReturn completeWithMemorySegment( IOSkywalkMemorySegment * segment, UInt64 offset, IOOptionBits options = 0 ); + + IOSkywalkPacketQueue * getSourceQueue(); + virtual IOReturn prepareWithQueue( IOSkywalkPacketQueue * queue, IODirection direction = kIODirectionNone, IOOptionBits options = 0 ); + virtual IOReturn completeWithQueue( IOSkywalkPacketQueue * queue, IODirection direction = kIODirectionNone, IOOptionBits options = 0 ); + + kern_buflet_t getBufletHandle(); + void setBufletHandle( kern_buflet_t handle ); + virtual void acquireWithBufletHandle( kern_buflet_t handle ); + + UInt64 getBufferHandle(); + virtual void acquireWithBufferHandle( UInt64 handle ); + + virtual void disposePacketBuffer(); + void cancelCompletionCallback(); + +public: + void * mReserved; // 32 + IOSkywalkPacketBufferPool * mPool; // 40 + kern_buflet_t mBufletHandle; // 48 + UInt64 mBufferHandle; // 56 + + IOSkywalkPacket * mPacket; // 64 + IOSkywalkPacketQueue * mSourceQueue; // 72 + IOMemoryDescriptor * mMemDescriptor; // 80 + IOSkywalkMemorySegment * mMemorySegment; // 88 + uint64_t __reserved0[2]; // 96 + + UInt64 mMemorySegmentOffset; // 112 + UInt32 mBufferState; // 120 + UInt32 mDataLength; // 124 + UInt16 mDataOffset; // 128 + + uint64_t _reserved1; // 136 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkPacketBufferPool.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkPacketBufferPool.h new file mode 100644 index 0000000..ae17cf3 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkPacketBufferPool.h @@ -0,0 +1,172 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2021 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKPACKETBUFFERPOOL_H +#define _IOSKYWALKPACKETBUFFERPOOL_H + +#include <IOKit/IOBufferMemoryDescriptor.h> +#include <IOKit/skywalk/IOSkywalkPacketBuffer.h> + +extern void pp_ctx_retain( void * target ); +extern void pp_ctx_release( void * target ); + +struct SegmentStats +{ + UInt64 constructorCount; + UInt64 destructorCount; + UInt64 prepareErrors; + UInt32 prepareMaxRetries; + UInt32 prepareErrorCode; +}; + +struct IOSkywalkPacketDescriptor; +struct IOSkywalkPacketBufferDescriptor; +struct IOSkywalkMemorySegmentDescriptor; + +class IOSkywalkInterface; + +class IOSkywalkPacketBufferPool : public OSObject +{ + OSDeclareDefaultStructors( IOSkywalkPacketBufferPool ) + + /*! @enum IOSkywalkPacketBufferPoolFlags + @abstract Flags for PoolOptions::poolFlags. + @constant PoolFlagSingleMemorySegment The pool will be constucted with single memory segment of buffers. + @constant PoolFlagPersistentMemory The pool memory will be persistently wired. + */ + + enum IOSkywalkPacketBufferPoolFlags + { + kIOSkywalkPacketBufferPoolFlagSingleMemorySegment = 0x00000002, + kIOSkywalkPacketBufferPoolFlagPersistentMemory = 0x00000004, + kIOSkywalkPacketBufferPoolFlagFlagMask = kIOSkywalkPacketBufferPoolFlagSingleMemorySegment | kIOSkywalkPacketBufferPoolFlagPersistentMemory + }; + + struct PoolOptions + { + uint32_t packetCount; // 0 + uint32_t bufferCount; // 4 + uint32_t bufferSize; // 8 + uint32_t maxBuffersPerPacket; // 12 + uint32_t memorySegmentSize; // 16 + uint32_t poolFlags; // 20 + uint64_t _reserved; // 24 + }; + +public: + static IOSkywalkPacketBufferPool * withName( const char * name, OSObject * owner, UInt32 packetType, const PoolOptions * options ); + virtual bool initWithName( const char * name, void * owner, UInt32 packetType, const PoolOptions * options ); + virtual bool initWithName( const char * name, OSObject * owner, UInt32 packetType, const PoolOptions * options ); + const char * getPoolName(); + virtual void free() APPLE_KEXT_OVERRIDE; + void disposeAllPackets(); + void disposeAllBuffers(); + virtual void release() const APPLE_KEXT_OVERRIDE; + void releaseAllPackets(); + void releaseAllMemorySegments(); + + void checkInPacketQueue( const IOSkywalkPacketQueue * queue ); + void checkOutPacketQueue( const IOSkywalkPacketQueue * queue ); + + void reportingChangeNotification(); + void checkInReportingService( IOService * service, const IOSkywalkInterface * interface ); + void checkOutReportingService( const IOService * service ); + void addPoolReporter( IOService * service, OSSet * reportSet ); + void createReportersForService( IOService * service, const IOSkywalkInterface * interface ); + void removeReportersForService( const IOService * service ); + OSSet * copyReportersForService( const IOService * service ); + UInt64 getReportChannelValue( UInt64 reportChannel ); + + virtual IOReturn allocatePacket( UInt32 bufCount, IOSkywalkPacket ** outPacket, IOOptionBits options ); // no sleep if (options & 1) + virtual IOReturn allocatePackets( UInt32 bufCount, UInt32 * numPackets, IOSkywalkPacket ** outPackets, IOOptionBits options ); + virtual IOReturn deallocatePacket( IOSkywalkPacket * packet ); + virtual IOReturn deallocatePackets( IOSkywalkPacket ** packets, uint32_t numPackets ); + virtual IOReturn deallocatePacketChain( kern_packet_t packet ); + + virtual IOReturn allocatePacketBuffer( IOSkywalkPacketBuffer ** outBuf, IOOptionBits options ); + virtual IOReturn allocatePacketBuffers( UInt32 * numBufs, IOSkywalkPacketBuffer ** outBufs, IOOptionBits options ); + virtual IOReturn deallocatePacketBuffer( IOSkywalkPacketBuffer * buf ); + virtual IOReturn deallocatePacketBuffers( IOSkywalkPacketBuffer ** bufs, uint32_t numBufs ); + + static void segmentConstructor( kern_pbufpool_t pbufPool, kern_segment_t segment, IOMemoryDescriptor * md ); + static void segmentDestructor( kern_pbufpool_t pbufPool, kern_segment_t segment, IOMemoryDescriptor * md ); + bool createSegmentBuffers( IOSkywalkMemorySegment * segment, UInt32 numBuffers, bool subDesc ); + void destroySegmentBuffers( IOSkywalkMemorySegment * segment ); + IOReturn prepareMemorySegment( IOSkywalkMemorySegment * segment, IOBufferMemoryDescriptor * buffer, UInt64 offset ); + + virtual IOReturn newPacket( IOSkywalkPacketDescriptor * desc, IOSkywalkPacket ** outPacket ); + IOSkywalkPacket * getPacketWithHandle( kern_packet_t handle ); + IOSkywalkPacket * getPacketWithIndex( kern_packet_idx_t index ); + + virtual IOReturn newPacketBuffer( IOSkywalkPacketBufferDescriptor * desc, IOSkywalkPacketBuffer ** outBuffer ); + IOSkywalkPacketBuffer * getPacketBufferWithBufletHandle( kern_buflet_t handle ); + IOSkywalkPacketBuffer * getPacketBufferWithSegmentInfo( kern_segment_t segment, UInt32 bufIndex ); + + virtual IOReturn newMemorySegment( IOSkywalkMemorySegmentDescriptor * desc, IOSkywalkMemorySegment ** outSegment ); + IOSkywalkMemorySegment * getMemorySegmentWithHandle( kern_segment_t handle ); + +protected: + void * mReserved; // 16 + kern_pbufpool_t mPbufPool; // 24 + OSObject * mProvider; // 32 + + UInt32 mPacketCount; // 40 + UInt32 mBufferCount; // 44 + UInt32 mBufferSize; // 48 + UInt32 mMaxFragments; // 52 + UInt32 mSegmentCount; // 56 + UInt32 mPacketType; // 60 + UInt32 mSegmentSize; // 64 + UInt32 mBuffersPerSegment; // 68 + UInt32 mPoolFlags; // 72 + + uint64_t _reserved; // 80 + IOSkywalkMemorySegment * mMemSegment; // 88 + OSArray * mPacketArray; // 96 + OSArray * mSegmentArray; // 104 + uint64_t _reserved2; // 112 + SegmentStats * mSegmentStats; // 120 + + IOLock * mSetLock; // 128 - protect the OSSets + OSSet * mPacketQueueSet; // 136 + OSString * mPoolName; // 144 + OSSet * mReporterSet; // 152 + OSSet * mReportingServiceSet; // 160 + thread_call_t mReportingChangeNotificationThread; // 168 + bool mSingleMemorySemgent; // 176 + bool mPersistentMemory; // 177 + bool mSegmentBuffersWithSubRange; // 178 + bool mDisposed; // 179 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkPacketQueue.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkPacketQueue.h new file mode 100644 index 0000000..5446ae0 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkPacketQueue.h @@ -0,0 +1,117 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2022 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKPACKETQUEUE_H +#define _IOSKYWALKPACKETQUEUE_H + +#include <IOKit/skywalk/IOSkywalkPacket.h> +#include <IOKit/IOEventSource.h> + +class IOSkywalkPacketPoller; + +typedef void (*IOSkywalkPacketQueueNotifyAction)(IOSkywalkPacketQueue * owner, void * arg); + +class IOSkywalkPacketQueue : public IOEventSource +{ + OSDeclareAbstractStructors( IOSkywalkPacketQueue ) + +public: + virtual IOReturn initialize( void * refCon ); + virtual void finalize(); + virtual IOReturn synchronize( IOOptionBits options ); + virtual IOReturn syncPackets( kern_packet_t * packetArray, UInt32 * packetCount, IOOptionBits options ); + virtual IOReturn sendNotification( IOOptionBits options ); + virtual IOReturn handleDoorbell( IOOptionBits options ); + + void * getRefcon(); + virtual IOSkywalkPacketBufferPool * getPacketBufferPool(); + virtual IOReturn setPacketBufferPool( IOSkywalkPacketBufferPool * pool ); + IOSkywalkInterface * getInterface(); + void setInterface( IOSkywalkInterface * interface ); + + bool isQueueReady(); + kern_packet_svc_class_t getServiceClass(); + + IODirection getDirection(); + UInt32 getQueueId(); + UInt32 getCapacity(); + UInt32 getBufferSize(); + virtual UInt32 getPacketCount() = 0; + virtual UInt32 getPacketBufferCount(); + virtual UInt32 getFreeSpace(); + virtual IOReturn getDataByteCount( UInt32 * count ); + + virtual IOReturn setPacketPoller( IOSkywalkPacketPoller * poller ); + virtual IOReturn performCommand( UInt32 command, void * data, size_t dataSize ); + // Call to default completion methods cause panics + virtual void packetCompletion( IOSkywalkPacket * packet, IOSkywalkPacketQueue * queue, IOOptionBits options ); + virtual void bufferCompletion( IOSkywalkPacketBuffer * buffer, IOSkywalkPacketQueue * queue, IOOptionBits options ); + void scheduleQueueNotification( IOSkywalkPacketQueue * queue ); + void deliverQueueNotifications( IOSkywalkPacketQueueNotifyAction notification, void * param ); + static UInt64 statGetElapsedTime( const AbsoluteTime * startTime ); + + virtual bool initWithPool( IOSkywalkPacketBufferPool * pool, UInt32 bufferSize, IODirection direction, UInt32 capacity, UInt32 queueId, OSObject * owner, IOEventSource::Action action, void * refCon ); + virtual void free() APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused( IOSkywalkPacketQueue, 0 ); + OSMetaClassDeclareReservedUnused( IOSkywalkPacketQueue, 1 ); + OSMetaClassDeclareReservedUnused( IOSkywalkPacketQueue, 2 ); + OSMetaClassDeclareReservedUnused( IOSkywalkPacketQueue, 3 ); + OSMetaClassDeclareReservedUnused( IOSkywalkPacketQueue, 4 ); + OSMetaClassDeclareReservedUnused( IOSkywalkPacketQueue, 5 ); + OSMetaClassDeclareReservedUnused( IOSkywalkPacketQueue, 6 ); + OSMetaClassDeclareReservedUnused( IOSkywalkPacketQueue, 7 ); + OSMetaClassDeclareReservedUnused( IOSkywalkPacketQueue, 8 ); + OSMetaClassDeclareReservedUnused( IOSkywalkPacketQueue, 9 ); + OSMetaClassDeclareReservedUnused( IOSkywalkPacketQueue, 10 ); + +protected: + void * mReserved; // 72 + IOSkywalkPacketBufferPool * mPool; // 80 + void * mRefcon; // 88 + IOSkywalkPacketQueue * mNotificationOwner; // 96 + OSArray * mNotificationArray; // 104 + IOSkywalkInterface * mInterface; // 112 + + uint64_t _reserved0[4]; // 120 + + UInt32 mQueueId; // 152 + UInt32 mCapacity; // 156 + UInt32 mBufferSize; // 160 + IODirection mDirection; // 164 + kern_packet_svc_class_t mServiceClass; // 168 + uint64_t _reserved1[2]; // 172 + bool mQueueReady; // 188 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkRxCompletionQueue.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkRxCompletionQueue.h new file mode 100644 index 0000000..70f2858 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkRxCompletionQueue.h @@ -0,0 +1,93 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2022 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKRXCOMPLETIONQUEUE_H +#define _IOSKYWALKRXCOMPLETIONQUEUE_H + +#include <IOKit/skywalk/IOSkywalkPacketQueue.h> + +class IOSkywalkRxCompletionQueue; +class IOSkywalkPacketTable; + +typedef IOReturn (*IOSkywalkRxCompletionQueueAction)( OSObject * owner, IOSkywalkRxCompletionQueue *, IOSkywalkPacket **, UInt32, void * ); + +class IOSkywalkRxCompletionQueue : public IOSkywalkPacketQueue +{ + OSDeclareDefaultStructors( IOSkywalkRxCompletionQueue ) + +public: + virtual IOReturn initialize( void * refCon ) APPLE_KEXT_OVERRIDE; + virtual void finalize() APPLE_KEXT_OVERRIDE; + virtual void enable() APPLE_KEXT_OVERRIDE; + virtual void disable() APPLE_KEXT_OVERRIDE; + + IOReturn synchronizeNonChain( IOOptionBits options ); + virtual IOReturn synchronize( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual IOReturn syncPackets( kern_packet_t * packetArray, UInt32 * packetCount, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual IOReturn sendNotification( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setPacketPoller( IOSkywalkPacketPoller * poller ) APPLE_KEXT_OVERRIDE; + virtual IOReturn performCommand( UInt32 command, void * data, size_t dataSize ) APPLE_KEXT_OVERRIDE; + IOReturn gatedEnqueue( void * refCon, bool * ); + virtual IOReturn requestEnqueue( void * packets, IOOptionBits options ); + virtual IOReturn enqueuePackets( const IOSkywalkPacket ** packets, UInt32 packetCount, IOOptionBits options ); + virtual IOReturn enqueuePackets( const queue_entry * packets, UInt32 packetCount, IOOptionBits options ); + virtual UInt32 getPacketCount() APPLE_KEXT_OVERRIDE; + UInt32 getEffectiveCapacity( IOOptionBits options ); + virtual bool checkForWork() APPLE_KEXT_OVERRIDE; + + static IOSkywalkRxCompletionQueue * withPool( IOSkywalkPacketBufferPool * pool, UInt32 capacity, UInt32 queueId, OSObject * owner, IOSkywalkRxCompletionQueueAction action, void * refCon, IOOptionBits options ); + virtual bool initWithPool( IOSkywalkPacketBufferPool * pool, UInt32 capacity, UInt32 queueId, OSObject * owner, IOSkywalkRxCompletionQueueAction action, void * refCon, IOOptionBits options ); + virtual void free() APPLE_KEXT_OVERRIDE; + + void addReporters( IOService * target, OSSet * set ); + UInt64 getReportChannelValue( UInt64 reportChannel ); + + OSMetaClassDeclareReservedUnused( IOSkywalkRxCompletionQueue, 0 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxCompletionQueue, 1 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxCompletionQueue, 2 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxCompletionQueue, 3 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxCompletionQueue, 4 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxCompletionQueue, 5 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxCompletionQueue, 6 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxCompletionQueue, 7 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxCompletionQueue, 8 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxCompletionQueue, 9 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxCompletionQueue, 10 ); + +protected: + +}; +// 296 + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkRxSubmissionQueue.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkRxSubmissionQueue.h new file mode 100644 index 0000000..8e282a8 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkRxSubmissionQueue.h @@ -0,0 +1,103 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2022 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKRXSUBMISSIONQUEUE_H +#define _IOSKYWALKRXSUBMISSIONQUEUE_H + +#include <IOKit/skywalk/IOSkywalkPacketQueue.h> + +class IOSkywalkRxSubmissionQueue; +class IOSkywalkPacketTable; + +typedef IOReturn (*IOSkywalkRxSubmissionQueueAction)( OSObject * owner, IOSkywalkRxSubmissionQueue *, const IOSkywalkPacket **, UInt32, void * ); + +struct IOSkywalkRxSubmissionQueueStats; // 56 + +class IOSkywalkRxSubmissionQueue : public IOSkywalkPacketQueue +{ + OSDeclareDefaultStructors( IOSkywalkRxSubmissionQueue ) + +public: + virtual IOReturn initialize( void * refCon ) APPLE_KEXT_OVERRIDE; + virtual void finalize() APPLE_KEXT_OVERRIDE; + virtual void enable() APPLE_KEXT_OVERRIDE; + virtual void disable() APPLE_KEXT_OVERRIDE; + + void gatedDequeue( void * refCon ); + virtual IOReturn requestDequeue( void * refCon, IOOptionBits options ); + void retryDequeue(); + + virtual IOReturn performCommand( UInt32 command, void * data, size_t dataSize ) APPLE_KEXT_OVERRIDE; + virtual void packetCompletion( IOSkywalkPacket * packet, IOSkywalkPacketQueue * queue, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + void adjustPacketCounters(); + virtual UInt32 getPacketCount() APPLE_KEXT_OVERRIDE; + UInt32 getEffectiveCapacity( IOOptionBits options ); + virtual bool checkForWork() APPLE_KEXT_OVERRIDE; + + static IOSkywalkRxSubmissionQueue * withPool( IOSkywalkPacketBufferPool * pool, UInt32 capacity, UInt32 queueId, kern_packet_svc_class_t serviceClass, OSObject * owner, IOSkywalkRxSubmissionQueueAction action, void * refCon, IOOptionBits options ); + virtual bool initWithPool( IOSkywalkPacketBufferPool * pool, UInt32 capacity, UInt32 queueId, kern_packet_svc_class_t serviceClass, OSObject * owner, IOSkywalkRxSubmissionQueueAction action, void * refCon, IOOptionBits options ) + virtual void free() APPLE_KEXT_OVERRIDE; + + void addReporters( IOService * target, OSSet * set ); + UInt64 getReportChannelValue( UInt64 reportChannel ); + + OSMetaClassDeclareReservedUnused( IOSkywalkRxSubmissionQueue, 0 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxSubmissionQueue, 1 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxSubmissionQueue, 2 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxSubmissionQueue, 3 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxSubmissionQueue, 4 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxSubmissionQueue, 5 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxSubmissionQueue, 6 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxSubmissionQueue, 7 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxSubmissionQueue, 8 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxSubmissionQueue, 9 ); + OSMetaClassDeclareReservedUnused( IOSkywalkRxSubmissionQueue, 10 ); + +protected: + void * mReserved; // 192 + IOSkywalkPacketTable * mTable; // 200 + IOLock * mInitLock; // 208 + IOSkywalkRxSubmissionQueueStats * mStats; // 216 + thread_call_t mRetryDequeueThread; // 224 + uint64_t _reserved0; // 232 + UInt32 mQueueId; // 240 + UInt32 ; // 244 + UInt32 ; // 248 + UInt32 ; // 252 + UInt32 ; // 256 + UInt32 ; // 260 + UInt32 ; // 264 + uint64_t _reserved1[2]; // 272 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkSupport.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkSupport.h new file mode 100644 index 0000000..17d6f3d --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkSupport.h @@ -0,0 +1,402 @@ +/* + * Copyright (c) 2015-2022 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOSKYWALKSUPPORT_H +#define _IOSKYWALKSUPPORT_H + +#include <sys/queue.h> +#include <IOKit/IOService.h> +#include <IOKit/IOBufferMemoryDescriptor.h> +#include <IOKit/IOMultiMemoryDescriptor.h> + +typedef uint32_t IOSKSize; +typedef uint32_t IOSKIndex; +typedef uint32_t IOSKCount; +typedef uint32_t IOSKOffset; + +typedef struct +{ + boolean_t userWritable; /* writable by user task */ + boolean_t kernelWritable; /* writable by kernel task */ + boolean_t iodirIn; /* direction: device-to-host */ + boolean_t iodirOut; /* direction: host-to-device */ + boolean_t purgeable; /* purgeable (not wired) */ + boolean_t inhibitCache; /* cache-inhibit */ + boolean_t physContig; /* physically contiguous */ + boolean_t pureData; /* data only, no pointers */ +} IOSKMemoryBufferSpec; + +typedef struct +{ + boolean_t noRedirect; +} IOSKRegionSpec; + +const OSSymbol * IOSKCopyKextIdentifierWithAddress( vm_address_t address ); + +class IOMemoryDescriptor; +typedef IOMemoryDescriptor * IOSKMemoryRef; +typedef IOSKMemoryRef IOSKMemoryArrayRef; +typedef IOSKMemoryRef IOSKMemoryBufferRef; + +class IOSKArena; +typedef IOSKArena * IOSKArenaRef; + +class IOSKRegion; +typedef IOSKRegion * IOSKRegionRef; + +class IOSKMapper; +typedef IOSKMapper * IOSKMapperRef; +typedef IOSKMemoryRef IOSKMemoryDescriptor; + +class IOMemoryMap; +typedef IOMemoryMap * IOSKMemoryMapRef; + +#define IOSK_CONSUMED LIBKERN_CONSUMED + +__BEGIN_DECLS + +IOSKMemoryBufferRef IOSKMemoryBufferCreate( mach_vm_size_t capacity, + const IOSKMemoryBufferSpec * spec, + mach_vm_address_t * kvaddr ); + +IOSKMemoryArrayRef IOSKMemoryArrayCreate( const IOSKMemoryRef refs[], + uint32_t count ); + +void IOSKMemoryDestroy( IOSK_CONSUMED IOSKMemoryRef reference ); + +IOSKMemoryMapRef IOSKMemoryMapToTask( IOSKMemoryRef reference, + task_t intoTask, + mach_vm_address_t * mapAddr, + mach_vm_size_t * mapSize ); + +IOSKMemoryMapRef IOSKMemoryMapToKernelTask( IOSKMemoryRef reference, + mach_vm_address_t * mapAddr, + mach_vm_size_t * mapSize ); + +void IOSKMemoryMapDestroy( + IOSK_CONSUMED IOSKMemoryMapRef reference ); + +IOReturn IOSKMemoryReclaim( IOSKMemoryRef reference ); +IOReturn IOSKMemoryDiscard( IOSKMemoryRef reference ); + +IOReturn IOSKMemoryWire( IOSKMemoryRef reference ); +IOReturn IOSKMemoryUnwire( IOSKMemoryRef reference ); + +IOSKArenaRef +IOSKArenaCreate( IOSKRegionRef * regionList, IOSKCount regionCount ); + +void +IOSKArenaDestroy( IOSK_CONSUMED IOSKArenaRef arena ); + +void +IOSKArenaRedirect( IOSKArenaRef arena ); + +IOSKRegionRef +IOSKRegionCreate( const IOSKRegionSpec * regionSpec, + IOSKSize segmentSize, IOSKCount segmentCount ); + +void +IOSKRegionDestroy( IOSK_CONSUMED IOSKRegionRef region ); + +IOReturn +IOSKRegionSetBuffer( IOSKRegionRef region, IOSKIndex segmentIndex, + IOSKMemoryBufferRef buffer ); + +void +IOSKRegionClearBuffer( IOSKRegionRef region, IOSKIndex segmentIndex ); + +void +IOSKRegionClearBufferDebug( IOSKRegionRef region, IOSKIndex segmentIndex, + IOSKMemoryBufferRef * prevBufferRef ); + +IOSKMapperRef +IOSKMapperCreate( IOSKArenaRef arena, task_t task ); + +void +IOSKMapperDestroy( IOSK_CONSUMED IOSKMapperRef mapper ); + +void +IOSKMapperRedirect( IOSKMapperRef mapper ); + +IOReturn +IOSKMapperGetAddress( IOSKMapperRef mapper, + mach_vm_address_t * address, mach_vm_size_t * size ); + +boolean_t +IOSKBufferIsWired( IOSKMemoryBufferRef buffer ); + +__END_DECLS + +class IOSKMemoryArray : public IOMultiMemoryDescriptor +{ + OSDeclareFinalStructors( IOSKMemoryArray ) + +public: + bool overwriteMappingInTask( + task_t intoTask, + mach_vm_address_t * startAddr, + IOOptionBits options ); +}; + +class IOSKMemoryBuffer : public IOBufferMemoryDescriptor +{ + OSDeclareFinalStructors( IOSKMemoryBuffer ) + +public: + bool initWithSpec( task_t inTask, + mach_vm_size_t capacity, + mach_vm_address_t alignment, + const IOSKMemoryBufferSpec * spec ); + + virtual void * getBytesNoCopy( void ) APPLE_KEXT_OVERRIDE; + + virtual void * getBytesNoCopy(vm_size_t start, vm_size_t withLength) APPLE_KEXT_OVERRIDE; + + bool + isWired( void ) const + { + return _wireCount != 0; + } + + IOSKMemoryBufferSpec fSpec; + void *fKernelAddr; + IOMemoryMap *fKernelReadOnlyMapping; + +protected: + virtual void taggedRelease(const void *tag = NULL) const APPLE_KEXT_OVERRIDE; + virtual void free( void ) APPLE_KEXT_OVERRIDE; +}; + +// FIXME: rename IOSKMemoryBuffer -> IOSKBuffer +typedef IOSKMemoryBuffer IOSKBuffer; + +/*! @class IOSKRegionMapper + @abstract IOSkywalk memory mapper of a IOSKRegion. + @discussion Tracks all memory mappings of a single IOSKRegion, with an array of IOMemoryMaps to map the region's memory segments. Created and released by the parent IOSKMapper. +*/ + +class IOSKRegionMapper : public OSObject +{ + OSDeclareFinalStructors( IOSKRegionMapper ) + +public: + bool initWithMapper( IOSKMapper * mapper, IOSKRegion * region, + IOSKOffset regionOffset ); + + IOReturn map( IOSKIndex segIndex, IOSKBuffer * buffer ); + void unmap( IOSKIndex segIndex, vm_prot_t prot ); + + kern_return_t mapOverwrite( vm_map_offset_t addr, + vm_map_size_t size, vm_prot_t prot ); + +private: + virtual void free( void ) APPLE_KEXT_OVERRIDE; + + IOSKMapper * fMapper; + IOSKRegion * fRegion; + IOMemoryMap ** fMemoryMaps; + IOSKCount fMemoryMapCount; + IOSKOffset fRegionOffset; +}; + +/*! @class IOSKMapper + @abstract IOSkywalk memory mapper of a task. + @discussion Manages all memory mappings of a single task, with an array of IOSKRegionMappers to map all memory regions of a memory arena. Retains the IOSKArena. +*/ + +class IOSKMapper : public OSObject +{ + OSDeclareFinalStructors( IOSKMapper ) + friend class IOSKRegionMapper; + +public: + bool initWithTask( task_t task, IOSKArena * arena ); + + IOReturn map( IOSKIndex regIndex, IOSKIndex segIndex, IOSKBuffer * buffer ); + void unmap( IOSKIndex regIndex, IOSKIndex segIndex, vm_prot_t prot ); + + mach_vm_address_t + getMapAddress( mach_vm_size_t * size ) const + { + if (size) + *size = fMapSize; + return fMapAddr; + } + + IOSKArena * + getArena( void ) const + { + return fArena; + } + bool + isRedirected( void ) const + { + return fRedirected; + } + void + redirectMap( void ) + { + fRedirected = true; + } + +private: + virtual void free( void ) APPLE_KEXT_OVERRIDE; + + task_t fTask; + vm_map_t fTaskMap; + IOSKArena * fArena; + OSArray * fSubMaps; + mach_vm_address_t fMapAddr; + mach_vm_size_t fMapSize; + bool fRedirected; +}; + +/*! @class IOSKArena + @abstract IOSkywalk memory buffer arena consisting of IOSKRegions. + @discussion An array of IOSKRegions is used to create an IOSKArena. One or more IOSKMapper can map the arena memory to tasks. Retains the IOSKRegions, also circularly retains the IOSKMapper(s) until the client calls IOSKMapperDestroy(). +*/ + +class IOSKArena : public OSObject +{ + OSDeclareFinalStructors( IOSKArena ) + +public: + bool initWithRegions( IOSKRegion ** regions, + IOSKCount regionCount ); + + IOReturn createMapperForTask( task_t task, + LIBKERN_RETURNS_RETAINED IOSKMapper ** mapper ); + void redirectMap( IOSKMapper * mapper ); + + IOSKSize + getArenaSize( void ) const + { + return fArenaSize; + } + IOSKCount + getRegionCount( void ) const + { + return fRegions->getCount(); + } + IOSKRegion * getRegion( IOSKIndex regIndex ) const; + + IOReturn map( const IOSKRegion * region, + IOSKOffset regionOffset, + IOSKIndex regionIndex, + IOSKIndex segmentIndex, + IOSKMemoryBuffer * buffer ); + + void unmap( const IOSKRegion * region, + IOSKOffset regionOffset, + IOSKIndex regionIndex, + IOSKIndex segmentIndex, + vm_prot_t prot, + bool isRedirected, + const void * context ); + + bool addMapper( const IOSKMapper * mapper ); + void removeMapper( const IOSKMapper * mapper ); + +private: + virtual void free( void ) APPLE_KEXT_OVERRIDE; + + IOLock * fArenaLock; + OSSet * fMappers; + OSArray * fRegions; + IOSKSize fArenaSize; +}; + +/*! @class IOSKRegion + @abstract IOSkywalk memory buffer region. + @discussion An IOSKRegion manages a dynamic array of IOSKBuffers representing each memory segment in the region. Each IOSKRegion can be shared by multiple IOSKArenas, and the IOSKRegion keeps state specific to each arena - the offset and the index of the region within the arena. A lock is used to serialize updates to the IOSKBuffer array and the arenas. Retains the IOSKBuffers. +*/ + +class IOSKRegion : public OSObject +{ + OSDeclareFinalStructors( IOSKRegion ) + +public: + bool initWithSpec( const IOSKRegionSpec * spec, + IOSKSize segSize, IOSKCount segCount ); + + IOReturn setSegmentBuffer( IOSKIndex index, IOSKBuffer * buf ); + void clearSegmentBuffer( IOSKIndex index, IOSKMemoryBufferRef * prevBuffer ); + + bool attachArena( IOSKArena * arena, + IOSKOffset regionOffset, IOSKIndex regionIndex ); + void detachArena( const IOSKArena * arena ); + + IOReturn updateMappingsForArena( IOSKArena * arena, bool redirect, + const void * context = NULL ); + + IOSKCount + getSegmentCount( void ) const + { + return fSegmentCount; + } + IOSKSize + getSegmentSize( void ) const + { + return fSegmentSize; + } + IOSKSize + getRegionSize( void ) const + { + return fSegmentCount * fSegmentSize; + } + +private: + virtual void free( void ) APPLE_KEXT_OVERRIDE; + + struct Segment + { + IOSKBuffer * fBuffer; + }; + + struct ArenaEntry + { + SLIST_ENTRY(ArenaEntry) link; + IOSKArena * fArena; + IOSKOffset fRegionOffset; + IOSKIndex fRegionIndex; + }; + SLIST_HEAD(ArenaHead, ArenaEntry); + + IOReturn _setSegmentBuffer( const IOSKIndex index, IOSKMemoryBuffer * buf ); + void _clearSegmentBuffer( const IOSKIndex index, IOSKMemoryBufferRef * prevBuffer ); + ArenaEntry * findArenaEntry( const IOSKArena * arena ); + + IOSKRegionSpec fSpec; + IOLock * fRegionLock; + ArenaHead * fArenaHead; + Segment * fSegments; + IOSKCount fSegmentCount; + IOSKSize fSegmentSize; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkTxCompletionQueue.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkTxCompletionQueue.h new file mode 100644 index 0000000..5b3eae9 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkTxCompletionQueue.h @@ -0,0 +1,151 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2022 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKTXCOMPLETIONQUEUE_H +#define _IOSKYWALKTXCOMPLETIONQUEUE_H + +#include <IOKit/skywalk/IOSkywalkPacketQueue.h> + +extern void queueNotifyAction( IOSkywalkPacketQueue * target, void * refCon ); + +class IOSkywalkTxCompletionQueue; +class IOSkywalkPacketTable; + +typedef IOReturn (*IOSkywalkTxCompletionQueueAction)( OSObject * owner, IOSkywalkTxCompletionQueue *, IOSkywalkPacket **, UInt32, void * ); + +/*! @struct IOSkywalkTxCompletionQueueStats + @abstract A structure containing counters of serveral functions in the IOSkywalkTxCompletionQueue class. + @field enqueueCounter Increment with each successful enqueue operation, regardless of the function utilized. + @field checkForWorkCounter Increment with each call to checkForWork() if enqueueAndCompletePackets() is executed. + @field enqueueFailureCounter Increment with each failed enqueue operation. + @field completeCounter The number of packets completed, updated each time completePackets() is called. +*/ +struct IOSkywalkTxCompletionQueueStats +{ + UInt64 enqueueCounter; + UInt64 checkForWorkCounter; + UInt64 enqueueFailureCounter; + UInt64 completeCounter; +}; + +class IOSkywalkTxCompletionQueue : public IOSkywalkPacketQueue +{ + OSDeclareDefaultStructors( IOSkywalkTxCompletionQueue ) + +public: + virtual IOReturn initialize( void * refCon ) APPLE_KEXT_OVERRIDE; + virtual void finalize() APPLE_KEXT_OVERRIDE; + virtual void enable() APPLE_KEXT_OVERRIDE; + virtual void disable() APPLE_KEXT_OVERRIDE; + + virtual IOReturn performCommand( UInt32 command, void * data, size_t dataSize ) APPLE_KEXT_OVERRIDE; + virtual IOReturn requestEnqueue( void * packets, IOOptionBits options ); + virtual IOReturn enqueuePackets( const IOSkywalkPacket ** packets, UInt32 packetCount, IOOptionBits options ); + virtual IOReturn enqueuePackets( const queue_entry * packets, UInt32 packetCount, IOOptionBits options ); + void completePackets(); + IOReturn enqueueAndCompletePackets( void * packets ); + virtual UInt32 getPacketCount() APPLE_KEXT_OVERRIDE; + UInt32 getEffectiveCapacity( IOOptionBits options ); + virtual bool checkForWork() APPLE_KEXT_OVERRIDE; + + static IOSkywalkTxCompletionQueue * withPool( IOSkywalkPacketBufferPool * pool, UInt32 capacity, UInt32 queueId, OSObject * owner, IOSkywalkTxCompletionQueueAction action, void * refCon, IOOptionBits options ); + virtual bool initWithPool( IOSkywalkPacketBufferPool * pool, UInt32 capacity, UInt32 queueId, OSObject * owner, IOSkywalkTxCompletionQueueAction action, void * refCon, IOOptionBits options ); + virtual void free() APPLE_KEXT_OVERRIDE; + + void addReporters( IOService * target, OSSet * set ); + UInt64 getReportChannelValue( UInt64 reportChannel ); + + OSMetaClassDeclareReservedUnused( IOSkywalkTxCompletionQueue, 0 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxCompletionQueue, 1 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxCompletionQueue, 2 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxCompletionQueue, 3 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxCompletionQueue, 4 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxCompletionQueue, 5 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxCompletionQueue, 6 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxCompletionQueue, 7 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxCompletionQueue, 8 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxCompletionQueue, 9 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxCompletionQueue, 10 ); + +protected: + /*! @var mReserved + * The first variable of every class in IOSkywalkFamily is reserved. + * Offset: 192. */ + void * mReserved; + + /*! @var mTable + * The IOSkywalkPacketTable in which the packets of this queue are stored. + * Offset: 200. */ + IOSkywalkPacketTable * mTable; + + /*! @var mInitLock + * An IOLock governing the initialize() and finalize() routines. + * Offset: 208. */ + IOLock * mInitLock; + + /*! @var mStats + * Structure containing various counters related to this class. + * Offset: 216. */ + IOSkywalkTxCompletionQueueStats * mStats; + + /*! @var mCommandData + * Data for command 0x50000. + * Offset: 224. */ + void * mCommandData; + + uint64_t _reserved0[2]; + + /*! @var mActionStatus + * Set when $link action runs and clear when it completes. No new enqueue request should happen when this flag is set. + * Offset: 248. */ + UInt32 mActionStatus; + + /*! @var mInitCounter + * Incremented by initialize() and decremented by finalize(). + * Offset: 252. */ + UInt32 mInitCounter; + + /*! @var mWorkCounter + * The number of works to do, incremented in requestEnqueue(). A work in this class could be considered as an enqueue request. + * Offset: 256. */ + UInt32 mWorkCounter; + + /*! @var mNumCheckedWorks + * Updated with the value of $link mWorkCounter whenever checkForWork() is called. + * Offset: 260. */ + UInt32 mNumCheckedWorks; + + uint64_t _reserved1[2]; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkTxSubmissionQueue.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkTxSubmissionQueue.h new file mode 100644 index 0000000..1805062 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkTxSubmissionQueue.h @@ -0,0 +1,125 @@ +/* + * Released under "The BSD 3-Clause License" + * + * Copyright (c) 2022 cjiang. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _IOSKYWALKTXSUBMISSIONQUEUE_H +#define _IOSKYWALKTXSUBMISSIONQUEUE_H + +#include <IOKit/skywalk/IOSkywalkPacketQueue.h> + +class IOSkywalkTxSubmissionQueue; +class IOSkywalkPacketTable; +class IOSkywalkRing; + +typedef IOReturn (*IOSkywalkQueryFreeSpaceHandler) ( OSObject * owner, IOSkywalkTxSubmissionQueue * queue, UInt32 * outSpace ); +typedef IOReturn (*IOSkywalkTxSubmissionQueueAction)( OSObject * owner, IOSkywalkTxSubmissionQueue * queue, const IOSkywalkPacket **, UInt32, void * ); + +struct IOSkywalkTxSubmissionQueueStats; // size = 128 + +class IOSkywalkTxSubmissionQueue : public IOSkywalkPacketQueue +{ + OSDeclareDefaultStructors( IOSkywalkTxSubmissionQueue ) + +public: + virtual IOReturn initialize( void * refCon ) APPLE_KEXT_OVERRIDE; + virtual void finalize() APPLE_KEXT_OVERRIDE; + virtual void enable() APPLE_KEXT_OVERRIDE; + virtual void disable() APPLE_KEXT_OVERRIDE; + + virtual IOReturn synchronize( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + void requestAsyncRefill(); + void refillTxRing( bool txDoorbellContext ); + + virtual IOReturn sendNotification( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual IOReturn handleDoorbell( IOOptionBits options ) APPLE_KEXT_OVERRIDE; + + void gatedDequeue( void * refCon ); + virtual IOReturn requestDequeue( void * refCon, IOOptionBits options ); + virtual void purgePackets(); + + virtual IOReturn performCommand( UInt32 command, void * data, size_t dataSize ) APPLE_KEXT_OVERRIDE; + virtual void packetCompletion( IOSkywalkPacket * packet, IOSkywalkPacketQueue * queue, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + void adjustPacketCounters(); + virtual UInt32 getPacketCount() APPLE_KEXT_OVERRIDE; + virtual IOReturn getDataByteCount( UInt32 * count ) APPLE_KEXT_OVERRIDE; + UInt32 getEffectiveCapacity( IOOptionBits options ); + virtual bool checkForWork() APPLE_KEXT_OVERRIDE; + + // outSpace is unused + static UInt32 defaultQueryFreeSpaceHandler( OSObject * owner, IOSkywalkTxSubmissionQueue * queue, UInt32 * outSpace ); + UInt32 defaultQueryFreeSpace( UInt32 * outSpace ); + + static IOSkywalkTxSubmissionQueue * withPoolAndServiceClass( IOSkywalkPacketBufferPool * pool, UInt32 capacity, UInt32 queueId, kern_packet_svc_class_t serviceClass, OSObject * owner, IOSkywalkQueryFreeSpaceHandler handler, IOSkywalkTxSubmissionQueueAction action, void * refCon, IOOptionBits options ); + static IOSkywalkTxSubmissionQueue * withPool( IOSkywalkPacketBufferPool * pool, UInt32 capacity, UInt32 queueId, OSObject * owner, IOSkywalkQueryFreeSpaceHandler handler, IOSkywalkTxSubmissionQueueAction action, void * refCon, IOOptionBits options ); + static IOSkywalkTxSubmissionQueue * withPool( IOSkywalkPacketBufferPool * pool, UInt32 capacity, UInt32 queueId, OSObject * owner, IOSkywalkTxSubmissionQueueAction action, void * refCon, IOOptionBits options ); + virtual bool initWithPool( IOSkywalkPacketBufferPool * pool, UInt32 capacity, UInt32 queueId, kern_packet_svc_class_t serviceClass, OSObject * owner, IOSkywalkQueryFreeSpaceHandler handler, IOSkywalkTxSubmissionQueueAction action, void * refCon, IOOptionBits options ); + virtual void free() APPLE_KEXT_OVERRIDE; + + void addReporters( IOService * target, OSSet * set ); + UInt64 getReportChannelValue( UInt64 reportChannel ); + + OSMetaClassDeclareReservedUnused( IOSkywalkTxSubmissionQueue, 0 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxSubmissionQueue, 1 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxSubmissionQueue, 2 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxSubmissionQueue, 3 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxSubmissionQueue, 4 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxSubmissionQueue, 5 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxSubmissionQueue, 6 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxSubmissionQueue, 7 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxSubmissionQueue, 8 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxSubmissionQueue, 9 ); + OSMetaClassDeclareReservedUnused( IOSkywalkTxSubmissionQueue, 10 ); + +protected: + void * mReserved; // 192 + IOSkywalkRing * mRing; // 200 + IOSkywalkPacketTable * mTable; // 208 + IOSkywalkQueryFreeSpaceHandler mQueryFreeSpaceHandler; // 216 + ifnet_t mIfnet; // 224 + IOSkywalkTxSubmissionQueueStats * mStats; // 232 + uint64_t _reserved0[3]; // 240 + UInt32 mPacketCount; // 264 + UInt32 mNumCompletedPackets; // 268 + // 272 + // 276 + // 280 + // 284 + // 288 + // 292 + // 300 + // 308 + // 316 +}; + +// 344 + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOSkywalkTypes.h b/QualcommWireless/include/IOKit/skywalk/IOSkywalkTypes.h new file mode 100644 index 0000000..a0e1ca0 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOSkywalkTypes.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2019-2022 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOSKYWALKTYPES_H +#define _IOSKYWALKTYPES_H + +#include <IOKit/IOLib.h> + +typedef uint32_t IOSkywalkNetworkLinkStatus; +enum +{ + kIOSkywalkNetworkLinkStatusInvalid = 0x00000000, + kIOSkywalkNetworkLinkStatusInactive = 0x00000001, + kIOSkywalkNetworkLinkStatusActive = 0x00000003, + kIOSkywalkNetworkLinkStatusWakeSameNet = 0x00000004 +}; + +typedef uint32_t IOSkywalkNetworkLinkQuality; +enum +{ + kIOSkywalkNetworkLinkQualityOff = (-2), + kIOSkywalkNetworkLinkQualityUnknown = (-1), + kIOSkywalkNetworkLinkQualityBad = 10, + kIOSkywalkNetworkLinkQualityPoor = 50, + kIOSkywalkNetworkLinkQualityGood = 100 +}; + +enum { + kIOSkywalkNetworkMediaOptionFullDuplex = 0x00100000, + kIOSkywalkNetworkMediaOptionHalfDuplex = 0x00200000, + kIOSkywalkNetworkMediaOptionFlowControl = 0x00400000, + kIOSkywalkNetworkMediaOptionEEE = 0x00800000, + kIOSkywalkNetworkMediaOptionLoopback = 0x08000000 +}; + +typedef uint32_t IOSkywalkNetworkMediaType; +enum +{ + kIOSkywalkNetworkMediaEthernetAuto = 0x00000020, + kIOSkywalkNetworkMediaEthernetManual = 0x00000021, + kIOSkywalkNetworkMediaEthernetNone = 0x00000022, + kIOSkywalkNetworkMediaEthernet10BaseT = 0x00000023, + kIOSkywalkNetworkMediaEthernet10Base2 = 0x00000024, + kIOSkywalkNetworkMediaEthernet10Base5 = 0x00000025, + kIOSkywalkNetworkMediaEthernet100BaseTX = 0x00000026, + kIOSkywalkNetworkMediaEthernet100BaseFX = 0x00000027, + kIOSkywalkNetworkMediaEthernet100BaseT4 = 0x00000028, + kIOSkywalkNetworkMediaEthernet100BaseVG = 0x00000029, + kIOSkywalkNetworkMediaEthernet100BaseT2 = 0x0000002a, + kIOSkywalkNetworkMediaEthernet1000BaseSX = 0x0000002b, + kIOSkywalkNetworkMediaEthernet10BaseSTP = 0x0000002c, + kIOSkywalkNetworkMediaEthernet10BaseFL = 0x0000002d, + kIOSkywalkNetworkMediaEthernet1000BaseLX = 0x0000002e, + kIOSkywalkNetworkMediaEthernet1000BaseCX = 0x0000002f, + kIOSkywalkNetworkMediaEthernet1000BaseT = 0x00000030, + kIOSkywalkNetworkMediaEthernetHomePNA1 = 0x00000031, + kIOSkywalkNetworkMediaEthernet10GBaseSR = 0x00000032, + kIOSkywalkNetworkMediaEthernet10GBaseLR = 0x00000033, + kIOSkywalkNetworkMediaEthernet10GBaseCX4 = 0x00000034, + kIOSkywalkNetworkMediaEthernet10GBaseT = 0x00000035, + kIOSkywalkNetworkMediaEthernet2500BaseT = 0x00000036, + kIOSkywalkNetworkMediaEthernet5000BaseT = 0x00000037, + kIOSkywalkNetworkMediaEthernet1000BaseCX_SGMII = 0x00000038, + kIOSkywalkNetworkMediaEthernet1000BaseKX = 0x00000039, + kIOSkywalkNetworkMediaEthernet10GBaseKX4 = 0x0000003a, + kIOSkywalkNetworkMediaEthernet10GBaseKR = 0x0000003b, + kIOSkywalkNetworkMediaEthernet10GBaseCR1 = 0x0000003c, + kIOSkywalkNetworkMediaEthernet10GBaseER = 0x0000003d, + kIOSkywalkNetworkMediaEthernet20GBaseKR2 = 0x0000003e, + kIOSkywalkNetworkMediaEthernet25GBaseCR = 0x0000003f, + kIOSkywalkNetworkMediaEthernet25GBaseKR = 0x00000820, + kIOSkywalkNetworkMediaEthernet25GBaseSR = 0x00000821, + kIOSkywalkNetworkMediaEthernet25GBaseLR = 0x00000822, + kIOSkywalkNetworkMediaEthernet40GBaseCR4 = 0x00000823, + kIOSkywalkNetworkMediaEthernet40GBaseSR4 = 0x00000824, + kIOSkywalkNetworkMediaEthernet40GBaseLR4 = 0x00000825, + kIOSkywalkNetworkMediaEthernet40GBaseKR4 = 0x00000826, + kIOSkywalkNetworkMediaEthernet50GBaseCR2 = 0x00000827, + kIOSkywalkNetworkMediaEthernet50GBaseKR2 = 0x00000828, + kIOSkywalkNetworkMediaEthernet50GBaseSR2 = 0x00000829, + kIOSkywalkNetworkMediaEthernet50GBaseLR2 = 0x0000082a, + kIOSkywalkNetworkMediaEthernet56GBaseR4 = 0x0000082b, + kIOSkywalkNetworkMediaEthernet100GBaseCR4 = 0x0000082c, + kIOSkywalkNetworkMediaEthernet100GBaseSR4 = 0x0000082d, + kIOSkywalkNetworkMediaEthernet100GBaseKR4 = 0x0000082e, + kIOSkywalkNetworkMediaEthernet100GBaseLR4 = 0x0000082f, + kIOSkywalkNetworkMediaEthernetMask = 0x00000fff +}; + +enum +{ + kIOSkywalkNetworkFeatureFlagSoftwareVlan = 0x00020000, + kIOSkywalkNetworkFeatureFlagWOMP = 0x04000000, + kIOSkywalkNetworkFeatureFlagNicProxy = 0x08000000 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/skywalk/IOUserNetworkEthernetNicProxy.h b/QualcommWireless/include/IOKit/skywalk/IOUserNetworkEthernetNicProxy.h new file mode 100644 index 0000000..b005098 --- /dev/null +++ b/QualcommWireless/include/IOKit/skywalk/IOUserNetworkEthernetNicProxy.h @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2020-2022 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOUSERNETWORKETHERNETNICPROXY_H +#define _IOUSERNETWORKETHERNETNICPROXY_H + +#include <netinet/in.h> +#include <net/ethernet.h> +#pragma pack(1) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu-variable-sized-type-not-at-end" + +// +// IP V4 TCP Keepalive structure. +// +typedef struct nicproxy_v4_keep_alive_s { + uint32_t timeout; + in_port_t local_port; + in_port_t remote_port; + ether_addr_t remote_mac_addr; + uint16_t win_size; + uint32_t seq_num; + uint32_t ack_num; + in_addr_t local_ip; + in_addr_t remote_ip; +} nicproxy_v4_keep_alive_t; + +// +// IP V6 TCP Keepalive structure. +// +typedef struct nicproxy_v6_keep_alive_s { + uint32_t timeout; + in_port_t local_port; + in_port_t remote_port; + ether_addr_t remote_mac_addr; + uint16_t win_size; + uint32_t seq_num; + uint32_t ack_num; + in6_addr_t local_ip; + in6_addr_t remote_ip; +} nicproxy_v6_keep_alive_t; + +typedef struct nicproxy_inet_info_s { + uint8_t v4LocalAddrCount; + uint8_t v4AddrCount; + uint8_t v6LocalAddrCount; + uint8_t v6AddrCount; + // FW will add the base to the following offset members and will treat them as pointers. + // The offsets are relative to the start of this struct so that the struct is pretty much self-contained + // in_addr_t * + uint32_t v4AddrOfft; + // uint8_t * + uint32_t v4PrefixOfft; + // in6_addr * + uint32_t v6AddrOfft; + // uint8_t * + uint32_t v6PrefixOfft; +} nicproxy_inet_info_t; + +typedef struct nicproxy_port_info_s { + uint16_t UDPPortCount; + uint16_t TCPPortCount; + // in_port_t * + uint32_t UDPPortOfft; // See the comment in the nicproxy_inet_info struct + // in_port_t * + uint32_t TCPPortOfft; +} nicproxy_port_info_t; + +typedef struct nicproxy_keep_alive_info_s { + uint16_t v4KACount; + uint16_t v6KACount; + uint32_t retryCount; + uint32_t retryInterval; + // nicproxy_v4_keep_alive_t * + uint32_t v4KAOfft; // See the comment in the nicproxy_inet_info struct + // nicproxy_v6_keep_alive_t * + uint32_t v6KAOfft; +} nicproxy_keep_alive_info_t; + +typedef struct nicproxy_rr_info_s { + uint32_t RRCount; + uint32_t RRBufLen; + // Offset to RR index table relative to the start of offloadRRInfo struct. The indices + // themselves are relative to the start of RR buffer. FW can add the buffer address + // and treat them as pointers. + // uint8_t ** + uint32_t RRIdxOfft; + // Offset to the RR buffer relative to the start of offloadRRInfo struct. + // uint8_t * + uint32_t RRBufOfft; +} nicproxy_rr_info_t; + +#define NIC_PROXY_FLAGS_WONLINK (1 << 7); +#define NIC_PROXY_FLAGS_WOMP (1 << 6); + +typedef struct nicproxy_info_s { + uint32_t len; // The whole structure length including the variable-size buf + ether_addr_t mac_addr; + uint8_t flags; + uint8_t reserved; + nicproxy_inet_info_t ips; + nicproxy_port_info_t ports; + nicproxy_keep_alive_info_t kas; + nicproxy_rr_info_t rrs; + uint8_t buf[0]; +} nicproxy_info_t; + +// +// Resource Record definitions. +// +enum { + rr_ptr_mask = 0xc0, + rr_length_mask = 0x3f +}; + +typedef union rr_record_s { + struct { + uint8_t len; + union { + uint8_t name[]; + uint8_t record[]; + }; + } label; + struct { + uint8_t hb; + uint8_t lb; + uint8_t record[]; + } ptr; + struct { + uint16_t type; + uint16_t rr_class; + uint32_t ttl; + uint16_t len; + } rr; +} rr_record_t; + +typedef struct rr_sub_type_s { + uint16_t sub_typ_cnt; + uint8_t sub_typ_name[]; +} rr_sub_type_t; + +typedef struct rr_srv_record_s { + rr_record_t rr_record; + struct { + uint16_t priority; + uint16_t weight; + uint16_t port; + uint8_t target[]; + }; + rr_sub_type_t sub_type; +} rr_srv_record_t; + +typedef struct rr_txt_record_s { + rr_record_t rr_record; + uint8_t txt[]; +} rr_txt_record_t; + +typedef struct rr_ptr_record_s { + rr_record_t rr_record; + uint8_t name[]; +} rr_ptr_record_t; + +typedef struct rr_null_record_s { + rr_record_t rr_record; + uint8_t data[]; +} rr_null_record_t; + +typedef struct nicproxy_limits_info_s { + uint8_t ipv4_cnt; + uint8_t ipv6_cnt; + uint16_t kaIPv4Count; + uint16_t kaIPv6Count; + uint16_t wakeUDPCount; + uint16_t wakeTCPCount; + uint16_t rr_cnt; + uint8_t mDnsMaxDomainLen; + uint8_t ethCount; + uint16_t rr_buf_size; +} nicproxy_limits_info_t; + +#pragma clang diagnostic pop +#pragma pack() + +#endif diff --git a/QualcommWireless/include/IOKit/storage/IOAppleLabelScheme.h b/QualcommWireless/include/IOKit/storage/IOAppleLabelScheme.h new file mode 100644 index 0000000..242255e --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOAppleLabelScheme.h @@ -0,0 +1,191 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * This header contains the IOAppleLabelScheme class definition. + */ + +#ifndef _IOAPPLELABELSCHEME_H +#define _IOAPPLELABELSCHEME_H + +#include <IOKit/IOTypes.h> + +/* + * kIOAppleLabelSchemeClass is the name of the IOAppleLabelScheme class. + */ + +#define kIOAppleLabelSchemeClass "IOAppleLabelScheme" + +/* + * Apple Label Scheme Definitions + */ + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* Label scheme. */ + +struct applelabel +{ + uint8_t al_boot0[416]; /* (reserved for boot area) */ + uint16_t al_magic; /* (the magic number) */ + uint16_t al_type; /* (label type) */ + uint32_t al_flags; /* (generic flags) */ + uint64_t al_offset; /* (offset of property area, bytes) */ + uint32_t al_size; /* (size of property area, bytes) */ + uint32_t al_checksum; /* (checksum of property area) */ + uint8_t al_boot1[72]; /* (reserved for boot area) */ +}; + +/* Label scheme signature (al_magic). */ + +#define AL_MAGIC 0x414C + +/* Label scheme version (al_type). */ + +#define AL_TYPE_DEFAULT 0x0000 + +/* Label scheme flags (al_flags). */ + +#define AL_FLAG_DEFAULT 0x00000000 + +#pragma pack(pop) /* (reset to default struct packing) */ + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOFilterScheme.h> + +/* + * Class + */ + +class IOAppleLabelScheme : public IOFilterScheme +{ + OSDeclareDefaultStructors(IOAppleLabelScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + IOMedia * _content; + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(void) APPLE_KEXT_OVERRIDE; + + /* + * Scan the provider media for an Apple label scheme. + */ + + virtual IOMedia * scan(SInt32 * score); + + /* + * Ask whether the given content appears to be corrupt. + */ + + virtual bool isContentCorrupt(OSDictionary * properties); + + /* + * Ask whether the given content appears to be invalid. + */ + + virtual bool isContentInvalid(OSDictionary * properties); + + /* + * Instantiate a new media object to represent the given content. + */ + + virtual IOMedia * instantiateMediaObject(OSDictionary * properties); + + /* + * Allocate a new media object (called from instantiateMediaObject). + */ + + virtual IOMedia * instantiateDesiredMediaObject(OSDictionary * properties); + + /* + * Attach the given media object to the device tree plane. + */ + + virtual bool attachMediaObjectToDeviceTree(IOMedia * media); + + /* + * Detach the given media object from the device tree plane. + */ + + virtual void detachMediaObjectFromDeviceTree(IOMedia * media); + +public: + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE; + + /* + * Determine whether the provider media contains an Apple label scheme. + */ + + virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE; + + /* + * Publish the new media object which represents our content. + */ + + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + + /* + * Clean up after the media object we published before terminating. + */ + + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 0); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 1); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 2); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 3); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 4); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 5); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 6); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 7); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 8); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 9); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 10); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 11); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 12); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 13); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 14); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOAPPLELABELSCHEME_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOApplePartitionScheme.h b/QualcommWireless/include/IOKit/storage/IOApplePartitionScheme.h new file mode 100644 index 0000000..8e9f2c3 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOApplePartitionScheme.h @@ -0,0 +1,251 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * This header contains the IOApplePartitionScheme class definition. + */ + +#ifndef _IOAPPLEPARTITIONSCHEME_H +#define _IOAPPLEPARTITIONSCHEME_H + +#include <IOKit/IOTypes.h> + +/* + * kIOApplePartitionSchemeClass is the name of the IOApplePartitionScheme class. + */ + +#define kIOApplePartitionSchemeClass "IOApplePartitionScheme" + +/* + * Apple Partition Map Definitions + */ + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* Structure constants. */ + +#define DPISTRLEN 32 + +/* Partition map entry, as found in blocks 1 to dpme_map_entries of the disk. */ + +typedef struct dpme +{ + UInt16 dpme_signature; /* (unique value for partition entry, 'PM') */ + UInt16 dpme_reserved_1; /* (reserved for future use) */ + UInt32 dpme_map_entries; /* (number of partition entries) */ + UInt32 dpme_pblock_start; /* (physical block start of partition) */ + UInt32 dpme_pblocks; /* (physical block count of partition) */ + char dpme_name[DPISTRLEN]; /* (name of partition) */ + char dpme_type[DPISTRLEN]; /* (type of partition, eg. Apple_HFS) */ + UInt32 dpme_lblock_start; /* (logical block start of partition) */ + UInt32 dpme_lblocks; /* (logical block count of partition) */ + UInt32 dpme_flags; /* (partition flags, see defines below) */ + UInt32 dpme_boot_block; /* (logical block start of boot code) */ + UInt32 dpme_boot_bytes; /* (byte count of boot code) */ + UInt32 dpme_load_addr; /* (load address in memory of boot code) */ + UInt32 dpme_load_addr_2; /* (reserved for future use) */ + UInt32 dpme_goto_addr; /* (jump address in memory of boot code) */ + UInt32 dpme_goto_addr_2; /* (reserved for future use) */ + UInt32 dpme_checksum; /* (checksum of boot code) */ + UInt8 dpme_process_id[16]; /* (processor type) */ + UInt32 dpme_reserved_2[32]; /* (reserved for future use) */ + UInt32 dpme_reserved_3[62]; /* (reserved for future use) */ +} DPME; + +/* Driver descriptor map entry. */ + +typedef struct DDMap +{ + UInt32 ddBlock; /* (driver's block start, sbBlkSize-blocks) */ + UInt16 ddSize; /* (driver's block count, 512-blocks) */ + UInt16 ddType; /* (driver's system type) */ +} DDMap; + +/* Driver descriptor map, as found in block zero of the disk. */ + +typedef struct Block0 +{ + UInt16 sbSig; /* (unique value for block zero, 'ER') */ + UInt16 sbBlkSize; /* (block size for this device) */ + UInt32 sbBlkCount; /* (block count for this device) */ + UInt16 sbDevType; /* (device type) */ + UInt16 sbDevId; /* (device id) */ + UInt32 sbDrvrData; /* (driver data) */ + UInt16 sbDrvrCount; /* (driver descriptor count) */ + DDMap sbDrvrMap[8]; /* (driver descriptor table) */ + UInt8 sbReserved[430]; /* (reserved for future use) */ +} Block0; + +/* Partition map signature (sbSig). */ + +#define BLOCK0_SIGNATURE 0x4552 + +/* Partition map entry signature (dpme_signature). */ + +#define DPME_SIGNATURE 0x504D + +/* Partition map entry flags (dpme_flags). */ + +#define DPME_FLAGS_VALID 0x00000001 /* (bit 0) */ +#define DPME_FLAGS_ALLOCATED 0x00000002 /* (bit 1) */ +#define DPME_FLAGS_IN_USE 0x00000004 /* (bit 2) */ +#define DPME_FLAGS_BOOTABLE 0x00000008 /* (bit 3) */ +#define DPME_FLAGS_READABLE 0x00000010 /* (bit 4) */ +#define DPME_FLAGS_WRITABLE 0x00000020 /* (bit 5) */ +#define DPME_FLAGS_OS_PIC_CODE 0x00000040 /* (bit 6) */ +#define DPME_FLAGS_OS_SPECIFIC_2 0x00000080 /* (bit 7) */ +#define DPME_FLAGS_OS_SPECIFIC_1 0x00000100 /* (bit 8) */ +#define DPME_FLAGS_RESERVED_2 0xFFFFFE00 /* (bit 9..31) */ + +#pragma pack(pop) /* (reset to default struct packing) */ + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOPartitionScheme.h> + +/* + * Class + */ + +class IOApplePartitionScheme : public IOPartitionScheme +{ + OSDeclareDefaultStructors(IOApplePartitionScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + OSSet * _partitions; /* (set of media objects representing partitions) */ + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(void) APPLE_KEXT_OVERRIDE; + + /* + * Scan the provider media for an Apple partition map. Returns the set + * of media objects representing each of the partitions (the retain for + * the set is passed to the caller), or null should no partition map be + * found. The default probe score can be adjusted up or down, based on + * the confidence of the scan. + */ + + virtual OSSet * scan(SInt32 * score); + + /* + * Ask whether the given partition appears to be corrupt. A partition that + * is corrupt will cause the failure of the Apple partition map recognition + * altogether. + */ + + virtual bool isPartitionCorrupt( dpme * partition, + UInt32 partitionID, + UInt32 partitionBlockSize ); + + /* + * Ask whether the given partition appears to be invalid. A partition that + * is invalid will cause it to be skipped in the scan, but will not cause a + * failure of the Apple partition map recognition. + */ + + virtual bool isPartitionInvalid( dpme * partition, + UInt32 partitionID, + UInt32 partitionBlockSize ); + + /* + * Instantiate a new media object to represent the given partition. + */ + + virtual IOMedia * instantiateMediaObject( dpme * partition, + UInt32 partitionID, + UInt32 partitionBlockSize ); + + /* + * Allocate a new media object (called from instantiateMediaObject). + */ + + virtual IOMedia * instantiateDesiredMediaObject( + dpme * partition, + UInt32 partitionID, + UInt32 partitionBlockSize ); + +public: + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE; + + /* + * Determine whether the provider media contains an Apple partition map. + */ + + virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE; + + /* + * Publish the new media objects which represent our partitions. + */ + + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + + /* + * Clean up after the media objects we published before terminating. + */ + + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + + /* + * Request that the provider media be re-scanned for partitions. + */ + + virtual IOReturn requestProbe(IOOptionBits options) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 0); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 1); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 2); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 3); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 4); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 5); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 6); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 7); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 8); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 9); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 10); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 11); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 12); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 13); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 14); + OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOAPPLEPARTITIONSCHEME_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOBDBlockStorageDevice.h b/QualcommWireless/include/IOKit/storage/IOBDBlockStorageDevice.h new file mode 100644 index 0000000..f3c0e65 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOBDBlockStorageDevice.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2006-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBDBlockStorageDevice + * @abstract + * This header contains the IOBDBlockStorageDevice class definition. + */ + +#ifndef _IOBDBLOCKSTORAGEDEVICE_H +#define _IOBDBLOCKSTORAGEDEVICE_H + +#include <IOKit/storage/IOBDTypes.h> + +/*! + * @defined kIOBDBlockStorageDeviceClass + * @abstract + * kIOBDBlockStorageDeviceClass is the name of the IOBDBlockStorageDevice class. + * @discussion + * kIOBDBlockStorageDeviceClass is the name of the IOBDBlockStorageDevice class. + */ + +#define kIOBDBlockStorageDeviceClass "IOBDBlockStorageDevice" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IODVDBlockStorageDevice.h> + +/* Property used for matching, so the generic driver gets the nub it wants. */ +#define kIOBlockStorageDeviceTypeBD "BD" + +/*! + * @class + * IOBDBlockStorageDevice + * @abstract + * The IOBDBlockStorageDevice class is a generic BD block storage device + * abstraction. + * @discussion + * This class is the protocol for generic BD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * The APIs are the union of CD APIs, DVD APIs, and all + * necessary new low-level BD APIs. + * + * A subclass implements relay methods that translate our requests into + * calls to a protocol- and device-specific provider. + */ + +class IOBDBlockStorageDevice : public IODVDBlockStorageDevice +{ + OSDeclareAbstractStructors(IOBDBlockStorageDevice) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /*! + * @function init + * @discussion + * Initialize this object's minimal state. + * @param properties + * Substitute property table for this object (optional). + * @result + * Returns true on success, false otherwise. + */ + + virtual bool init(OSDictionary * properties); + + /*! + * @function readDiscStructure + * @discussion + * Issue an MMC READ DISC STRUCTURE command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param format + * As documented by MMC. + * @param address + * As documented by MMC. + * @param layer + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param type + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readDiscStructure( IOMemoryDescriptor * buffer, + UInt8 format, + UInt32 address, + UInt8 layer, + UInt8 grantID, + UInt8 type ) = 0; + + /*! + * @function splitTrack + * @discussion + * Issue an MMC RESERVE TRACK command with the ARSV bit. + * @param address + * As documented by MMC. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn splitTrack(UInt32 address) = 0; + + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 0); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 1); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 2); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 3); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 4); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 5); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 6); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 7); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 8); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 9); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 10); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 11); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 12); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 13); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 14); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBDBLOCKSTORAGEDEVICE_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOBDBlockStorageDriver.h b/QualcommWireless/include/IOKit/storage/IOBDBlockStorageDriver.h new file mode 100644 index 0000000..645ad1d --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOBDBlockStorageDriver.h @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2006-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * @header IOBDBlockStorageDriver + * @abstract + * This header contains the IOBDBlockStorageDriver class definition. + * @discussion + * This class implements BD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * A protocol-specific provider implements the functionality using an appropriate + * protocol and commands. + */ + +#ifndef _IOBDBLOCKSTORAGEDRIVER_H +#define _IOBDBLOCKSTORAGEDRIVER_H + +#include <IOKit/storage/IOBDBlockStorageDevice.h> +#include <IOKit/storage/IODVDBlockStorageDriver.h> + +/* + * @defined kIOBDBlockStorageDriverClass + * @abstract + * kIOBDBlockStorageDriverClass is the name of the IOBDBlockStorageDriver class. + * @discussion + * kIOBDBlockStorageDriverClass is the name of the IOBDBlockStorageDriver class. + */ + +#define kIOBDBlockStorageDriverClass "IOBDBlockStorageDriver" + +/* + * @class + * IOBDBlockStorageDriver + * @abstract + * Generic BD Driver. + * @discussion + * Storage drivers are split into two parts: the Generic Driver handles + * all generic device issues, independent of the lower-level transport + * mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations + * at the Generic Driver level are translated into a series of generic + * device operations. These operations are passed via the Device Nub + * to a Transport Driver, which implements the appropriate + * transport-dependent protocol to execute these operations. + * + * To determine the write-protect state of a device (or media), for + * example, the generic driver would issue a call to the + * Transport Driver's reportWriteProtection method. If this were a SCSI + * device, its Transport Driver would issue a Mode Sense command to + * extract the write-protection status bit. The Transport Driver then + * reports true or false to the generic driver. + * + * The generic driver therefore has no knowledge of, or involvement + * with, the actual commands and mechanisms used to communicate with + * the device. It is expected that the generic driver will rarely, if + * ever, need to be subclassed to handle device idiosyncrasies; rather, + * the Transport Driver should be changed via overrides. + * + * A generic driver could be subclassed to create a different type of + * generic device. The generic driver IOBDBlockStorageDriver class is a subclass + * of IODVDBlockStorageDriver, adding BD functions. Similarly, the Transport Driver + * IOBDBlockStorageDevice is a subclass of IODVDBlockStorageDevice, adding BD + * functions. +*/ + +class IOBDBlockStorageDriver : public IODVDBlockStorageDriver +{ + OSDeclareDefaultStructors(IOBDBlockStorageDriver) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + /* Overrides of IODVDBlockStorageDriver. */ + + virtual IOReturn acceptNewMedia(void); + + /* End of IODVDBlockStorageDriver overrides. */ + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IOBDBlockStorageDevice. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IOBDBlockStorageDevice * getProvider() const; + + /* Overrides of IODVDBlockStorageDriver: */ + + virtual const char * getDeviceTypeName(void); + virtual IOMedia * instantiateDesiredMediaObject(void); + virtual IOMedia * instantiateMediaObject(UInt64 base,UInt64 byteSize, + UInt32 blockSize,char *mediaName); + virtual IOReturn readStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format, + const UInt32 address,const UInt8 layer,const UInt8 agid); + + /* End of IODVDBlockStorageDriver overrides. */ + + /* + * @function splitTrack + * @discussion + * Issue an MMC RESERVE TRACK command with the ARSV bit. + * @param address + * As documented by MMC. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn splitTrack(UInt32 address); + + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 0); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 1); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 2); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 3); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 4); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 5); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 6); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 7); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 8); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 9); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 10); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 11); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 12); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 13); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 14); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 15); +}; + +#endif /* !_IOBDBLOCKSTORAGEDRIVER_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOBDMedia.h b/QualcommWireless/include/IOKit/storage/IOBDMedia.h new file mode 100644 index 0000000..f932f19 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOBDMedia.h @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2006-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBDMedia + * @abstract + * This header contains the IOBDMedia class definition. + */ + +#ifndef _IOBDMEDIA_H +#define _IOBDMEDIA_H + +/*! + * @defined kIOBDMediaClass + * @abstract + * kIOBDMediaClass is the name of the IOBDMedia class. + * @discussion + * kIOBDMediaClass is the name of the IOBDMedia class. + */ + +#define kIOBDMediaClass "IOBDMedia" + +/*! + * @defined kIOBDMediaTypeKey + * @abstract + * kIOBDMediaTypeKey is a property of IOBDMedia objects. It has an OSString + * value. + * @discussion + * The kIOBDMediaTypeKey property identifies the BD media type (BD-ROM, BD-R, + * BD-RE, etc). See the kIOBDMediaType contants for possible values. + */ + +#define kIOBDMediaTypeKey "Type" + +/*! + * @defined kIOBDMediaTypeROM + * The kIOBDMediaTypeKey constant for BD-ROM media. + */ + +#define kIOBDMediaTypeROM "BD-ROM" + +/*! + * @defined kIOBDMediaTypeR + * The kIOBDMediaTypeKey constant for BD-R media. + */ + +#define kIOBDMediaTypeR "BD-R" + +/*! + * @defined kIOBDMediaTypeRE + * The kIOBDMediaTypeKey constant for BD-RE media. + */ + +#define kIOBDMediaTypeRE "BD-RE" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOBDBlockStorageDriver.h> +#include <IOKit/storage/IOMedia.h> + +/*! + * @class IOBDMedia + * @abstract + * The IOBDMedia class is a random-access disk device abstraction for BDs. + * @discussion + * The IOBDMedia class is a random-access disk device abstraction for BDs. + */ + +class IOBDMedia : public IOMedia +{ + OSDeclareDefaultStructors(IOBDMedia) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IOBDBlockStorageDriver. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IOBDBlockStorageDriver * getProvider() const; + + /* + * Compare the properties in the supplied table to this object's properties. + */ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + /* + * Issue an MMC REPORT KEY command. + * Obsoleted, replaced by this interface. + * virtual IOReturn reportKey( IOMemoryDescriptor * buffer, + * UInt8 keyClass, + * UInt32 address, + * UInt8 blockCount, + * UInt8 grantID, + * UInt8 format ); + */ + + virtual IOReturn reportKey( IOMemoryDescriptor * buffer, + UInt8 keyClass, + UInt32 address, + UInt8 grantID, + UInt8 format ) __attribute__ ((deprecated)); + + /*! + * @function sendKey + * @discussion + * Issue an MMC SEND KEY command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param keyClass + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param format + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn sendKey( IOMemoryDescriptor * buffer, + UInt8 keyClass, + UInt8 grantID, + UInt8 format ); + + /*! + * @function readStructure + * @discussion + * Issue an MMC READ DISC STRUCTURE command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param format + * As documented by MMC. + * @param address + * As documented by MMC. + * @param layer + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readStructure( IOMemoryDescriptor * buffer, + UInt8 format, + UInt32 address, + UInt8 layer, + UInt8 grantID ); + + /*! + * @function getSpeed + * @discussion + * Get the current speed used for data transfers. + * @param kilobytesPerSecond + * Returns the current speed used for data transfers, in kB/s. + * + * kBDSpeedMin specifies the minimum speed for all BD media (1X). + * kBDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond); + + /*! + * @function setSpeed + * @discussion + * Set the speed to be used for data transfers. + * @param kilobytesPerSecond + * Speed to be used for data transfers, in kB/s. + * + * kBDSpeedMin specifies the minimum speed for all BD media (1X). + * kBDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setSpeed(UInt16 kilobytesPerSecond); + + /*! + * @function readDiscInfo + * @discussion + * Issue an MMC READ DISC INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param type + * Reserved for future use. Set to zero. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readDiscInfo( IOMemoryDescriptor * buffer, + UInt8 type, + UInt16 * actualByteCount ); + + /*! + * @function readTrackInfo + * @discussion + * Issue an MMC READ TRACK INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param address + * As documented by MMC. + * @param addressType + * As documented by MMC. + * @param open + * Reserved for future use. Set to zero. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readTrackInfo( IOMemoryDescriptor * buffer, + UInt32 address, + UInt8 addressType, + UInt8 open, + UInt16 * actualByteCount ); + + /*! + * @function splitTrack + * @discussion + * Issue an MMC RESERVE TRACK command with the ARSV bit. + * @param address + * As documented by MMC. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn splitTrack(UInt32 address); + + /*! + * @function reportKey + * @discussion + * Issue an MMC REPORT KEY command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param keyClass + * As documented by MMC. + * @param address + * As documented by MMC. + * @param blockCount + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param format + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn reportKey( IOMemoryDescriptor * buffer, + UInt8 keyClass, + UInt32 address, + UInt8 blockCount, + UInt8 grantID, + UInt8 format ); + + OSMetaClassDeclareReservedUsed(IOBDMedia, 0); /* reportKey */ + OSMetaClassDeclareReservedUnused(IOBDMedia, 1); + OSMetaClassDeclareReservedUnused(IOBDMedia, 2); + OSMetaClassDeclareReservedUnused(IOBDMedia, 3); + OSMetaClassDeclareReservedUnused(IOBDMedia, 4); + OSMetaClassDeclareReservedUnused(IOBDMedia, 5); + OSMetaClassDeclareReservedUnused(IOBDMedia, 6); + OSMetaClassDeclareReservedUnused(IOBDMedia, 7); + OSMetaClassDeclareReservedUnused(IOBDMedia, 8); + OSMetaClassDeclareReservedUnused(IOBDMedia, 9); + OSMetaClassDeclareReservedUnused(IOBDMedia, 10); + OSMetaClassDeclareReservedUnused(IOBDMedia, 11); + OSMetaClassDeclareReservedUnused(IOBDMedia, 12); + OSMetaClassDeclareReservedUnused(IOBDMedia, 13); + OSMetaClassDeclareReservedUnused(IOBDMedia, 14); + OSMetaClassDeclareReservedUnused(IOBDMedia, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBDMEDIA_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOBDMediaBSDClient.h b/QualcommWireless/include/IOKit/storage/IOBDMediaBSDClient.h new file mode 100644 index 0000000..778dd39 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOBDMediaBSDClient.h @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2006-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOBDMEDIABSDCLIENT_H +#define _IOBDMEDIABSDCLIENT_H + +#include <sys/ioctl.h> +#include <sys/types.h> + +#include <IOKit/storage/IOBDTypes.h> + +/* + * Definitions + * + * ioctl description + * ---------------------------- ------------------------------------------------ + * DKIOCBDREADSTRUCTURE see IOBDMedia::readStructure() in IOBDMedia.h + * + * DKIOCBDREADDISCINFO see IOBDMedia::readDiscInfo() in IOBDMedia.h + * DKIOCBDREADTRACKINFO see IOBDMedia::readTrackInfo() in IOBDMedia.h + * + * DKIOCBDREPORTKEY see IOBDMedia::reportKey() in IOBDMedia.h + * DKIOCBDSENDKEY see IOBDMedia::sendKey() in IOBDMedia.h + * + * DKIOCBDGETSPEED see IOBDMedia::getSpeed() in IOBDMedia.h + * DKIOCBDSETSPEED see IOBDMedia::setSpeed() in IOBDMedia.h + * + * in /System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/ + */ + +typedef struct +{ + uint8_t format; + + uint8_t reserved0008[3]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t grantID; + uint8_t layer; + + uint8_t reserved0080[4]; /* reserved, clear to zero */ + + uint16_t bufferLength; + void * buffer; +} dk_bd_read_structure_t; + +typedef struct +{ + uint8_t format; + uint8_t keyClass; + uint8_t blockCount; + + uint8_t reserved0024[1]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t grantID; + + uint8_t reserved0072[5]; /* reserved, clear to zero */ + + uint16_t bufferLength; + void * buffer; +} dk_bd_report_key_t; + +typedef struct +{ + uint8_t format; + uint8_t keyClass; + + uint8_t reserved0016[6]; /* reserved, clear to zero */ + + uint8_t grantID; + + uint8_t reserved0072[5]; /* reserved, clear to zero */ + + uint16_t bufferLength; + void * buffer; +} dk_bd_send_key_t; + +typedef struct +{ + uint8_t reserved0000[14]; /* reserved, clear to zero */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_bd_read_disc_info_t; + +typedef struct +{ + uint8_t reserved0000[4]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t addressType; + + uint8_t reserved0072[5]; /* reserved, clear to zero */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_bd_read_track_info_t; + +#define DKIOCBDREADSTRUCTURE _IOW('d', 160, dk_bd_read_structure_t) +#define DKIOCBDREPORTKEY _IOW('d', 161, dk_bd_report_key_t) +#define DKIOCBDSENDKEY _IOW('d', 162, dk_bd_send_key_t) + +#define DKIOCBDGETSPEED _IOR('d', 163, uint16_t) +#define DKIOCBDSETSPEED _IOW('d', 163, uint16_t) + +#define DKIOCBDREADDISCINFO _IOWR('d', 164, dk_bd_read_disc_info_t) +#define DKIOCBDREADTRACKINFO _IOWR('d', 165, dk_bd_read_track_info_t) + +#define DKIOCBDSPLITTRACK _IOW('d', 166, uint32_t) + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOBDMedia.h> +#include <IOKit/storage/IOMediaBSDClient.h> + +/* + * Class + */ + +class IOBDMediaBSDClient : public IOMediaBSDClient +{ + OSDeclareDefaultStructors(IOBDMediaBSDClient) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of IOService -- IOBDMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOBDMedia * getProvider() const; + + /* + * Process a BD-specific ioctl. + */ + + virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc); + + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 0); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 1); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 2); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 3); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 4); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 5); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 6); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 7); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBDMEDIABSDCLIENT_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOBDTypes.h b/QualcommWireless/include/IOKit/storage/IOBDTypes.h new file mode 100644 index 0000000..d31cef7 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOBDTypes.h @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2006-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _BDTYPES_H +#define _BDTYPES_H + +#include <IOKit/IOTypes.h> + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* + * Media Types + */ + +enum +{ + kBDMediaTypeUnknown = 0x0300, + kBDMediaTypeROM = 0x0302, /* BD-ROM */ + kBDMediaTypeRE = 0x0303, /* BD-RE */ + kBDMediaTypeR = 0x0304, /* BD-R */ + + kBDMediaTypeMin = 0x0300, + kBDMediaTypeMax = 0x03FF +}; + +typedef UInt32 BDMediaType; + +/* + * Media Speed (kB/s) + */ + +#define kBDSpeedMin 0x1126 +#define kBDSpeedMax 0xFFFF + +/* + * MMC Formats + */ + +// Read Disc Information Format +struct BDDiscInfo +{ + UInt16 dataLength; +#ifdef __LITTLE_ENDIAN__ + UInt8 discStatus:2; + UInt8 stateOfLastSession:2; + UInt8 erasable:1; + UInt8 dataType:3; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 dataType:3; + UInt8 erasable:1; + UInt8 stateOfLastSession:2; + UInt8 discStatus:2; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 reserved2; + UInt8 numberOfSessionsLSB; + UInt8 firstTrackNumberInLastSessionLSB; + UInt8 lastTrackNumberInLastSessionLSB; + UInt8 reserved4[2]; + UInt8 numberOfSessionsMSB; + UInt8 firstTrackNumberInLastSessionMSB; + UInt8 lastTrackNumberInLastSessionMSB; + UInt8 reserved6[22]; +}; +typedef struct BDDiscInfo BDDiscInfo; + +// Read Track Information Format +struct BDTrackInfo +{ + UInt16 dataLength; + UInt8 trackNumberLSB; + UInt8 sessionNumberLSB; + UInt8 reserved; +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved2:5; + UInt8 damage:1; + UInt8 reserved3:2; + + UInt8 reserved4:6; + UInt8 blank:1; + UInt8 reservedTrack:1; + + UInt8 nextWritableAddressValid:1; + UInt8 lastRecordedAddressValid:1; + UInt8 reserved5:6; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved3:2; + UInt8 damage:1; + UInt8 reserved2:5; + + UInt8 reservedTrack:1; + UInt8 blank:1; + UInt8 reserved4:6; + + UInt8 reserved5:6; + UInt8 lastRecordedAddressValid:1; + UInt8 nextWritableAddressValid:1; +#endif /* !__LITTLE_ENDIAN__ */ + UInt32 trackStartAddress; + UInt32 nextWritableAddress; + UInt32 freeBlocks; + UInt32 clusterSize; + UInt32 trackSize; + UInt32 lastRecordedAddress; + UInt8 trackNumberMSB; + UInt8 sessionNumberMSB; + UInt8 reserved6; + UInt8 reserved7; +}; +typedef struct BDTrackInfo BDTrackInfo; + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* _BDTYPES_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOBlockStorageDevice.h b/QualcommWireless/include/IOKit/storage/IOBlockStorageDevice.h new file mode 100644 index 0000000..c197001 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOBlockStorageDevice.h @@ -0,0 +1,549 @@ +/* + * Copyright (c) 1998-2015 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBlockStorageDevice + * @abstract + * This header contains the IOBlockStorageDevice class definition. + */ + +#ifndef _IOBLOCKSTORAGEDEVICE_H +#define _IOBLOCKSTORAGEDEVICE_H + +#include <IOKit/IOTypes.h> +#include <IOKit/storage/IOStorageDeviceCharacteristics.h> + +/*! + * @defined kIOBlockStorageDeviceClass + * @abstract + * The name of the IOBlockStorageDevice class. + */ + +#define kIOBlockStorageDeviceClass "IOBlockStorageDevice" + +/*! + * @defined kIOBlockStorageDeviceWriteCacheStateKey + * @abstract + * The name of the property used to get or set the write cache state of the + * block storage device. + */ +#define kIOBlockStorageDeviceWriteCacheStateKey "WriteCacheState" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOMessage.h> +#include <IOKit/IOService.h> +#include <IOKit/storage/IOMedia.h> + +/*! + * @defined kIOMessageMediaParametersHaveChanged + * @abstract + * The message ID which indicates that the media parameters, such as the highest valid block + * for the device, have changed. + * @discussion + * The message is passed to all clients of the IOBlockStorageDevice via the message() method. + */ +#define kIOMessageMediaParametersHaveChanged iokit_family_msg(sub_iokit_block_storage, 2) + +/*! + * @defined kIOMessageMediaStateHasChanged + * @abstract + * The message ID which indicates that the media state has changed. + * @discussion + * The message is passed to all clients of the IOBlockStorageDevice via the message() method. + * The argument that is passed along with this message is an IOMediaState value. + */ +#define kIOMessageMediaStateHasChanged iokit_family_msg(sub_iokit_block_storage, 1) + +/* Property used for matching, so the generic driver gets the nub it wants. */ +/*! + * @defined kIOBlockStorageDeviceTypeKey + * @abstract The name of the property tested for nub type matching by the generic block + * storage driver. + */ +#define kIOBlockStorageDeviceTypeKey "device-type" +/*! + * @defined kIOBlockStorageDeviceTypeGeneric + * @abstract A character string used for nub matching. + */ +#define kIOBlockStorageDeviceTypeGeneric "Generic" +/*! + * @defined kIOBlockStorageDeviceTDMLocked + * @abstract A boolean property to tell if device is connected through TDM, and not + * authenticated yet + */ +#define kIOBlockStorageDeviceTDMLocked "AppleTDMLocked" +/*! + * @struct IOBlockStorageDeviceExtent + * @abstract + * Extent for unmap storage requests. + * @field blockStart + * The starting block number of the operation. + * @field blockCount + * The integral number of blocks to be deleted. + */ + +struct IOBlockStorageDeviceExtent +{ + UInt64 blockStart; + UInt64 blockCount; +}; + +/*! + * @struct IOBlockStorageProvisionDeviceExtent + * @discussion + * Extent for provision status. + * @field blockStart + * Starting block offset for the operation. + * @field blockCount + * Size of the operation. + * @field provisionType + * Block provision type, such as mapped, deallocated, or anchared. See + * IOStorageProvisionTypes + */ + +struct IOBlockStorageProvisionDeviceExtent +{ + UInt64 blockStart; + UInt64 blockCount; + UInt8 provisionType; + UInt8 reserved[7]; +}; + +/*! + * @class + * IOBlockStorageDevice + * @abstract + * A generic block storage device abstraction. + * @discussion + * The IOBlockStorageDevice class exports the generic block storage protocol, + * independent of the physical connection protocol (e.g. SCSI, ATA, USB), + * forwarding all requests to its provider (the Transport Driver). + * Though the nub does no actual processing of requests, it is necessary + * in a C++ environment. The Transport Driver can be of any type, as + * long as it inherits from IOService. Because Transport Drivers needn't + * derive from a type known to IOBlockStorageDriver, it isn't possible for + * IOBlockStorageDriver to include the appropriate header file to allow direct + * communication with the Transport Driver. Thus we achieve polymorphism by + * having the Transport Driver instantiate a subclass of IOBlockStorageDevice. + * A typical implementation for a concrete subclass of IOBlockStorageDevice + * simply relays all methods to its provider (the Transport Driver), which + * implements the protocol- and device-specific behavior. + * + * All pure-virtual functions must be implemented by the Transport Driver, which + * is responsible for instantiating the Nub. + */ + +class IOBlockStorageDevice : public IOService { + + OSDeclareAbstractStructors(IOBlockStorageDevice) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* Overrides from IORegistryEntry */ + + using IORegistryEntry::getProperty; + + /*! + * @function init + * @discussion + * This function is overridden so that IOBlockStorageDevice can set a + * property, used by IOBlockStorageDriver for matching. Since the concrete + * subclass of IOBlockStorageDevice can be of any class type, the property + * is used for matching. + * + * This function is usually not overridden by developers. + */ + virtual bool init(OSDictionary * properties) APPLE_KEXT_OVERRIDE; + + virtual OSObject * getProperty(const OSSymbol * key) const APPLE_KEXT_OVERRIDE; + + virtual IOReturn setProperties(OSObject * properties) APPLE_KEXT_OVERRIDE; + + /* --- A subclass must implement the the following methods: --- */ + + /*! + * @function doEjectMedia + * @abstract + * Eject the media. + */ + virtual IOReturn doEjectMedia(void) = 0; + + /*! + * @function doFormatMedia + * @abstract + * Format the media to the specified byte capacity. + * @discussion + * The specified byte capacity must be one supported by the device. + * Supported capacities can be obtained by calling doGetFormatCapacities. + * @param byteCapacity + * The byte capacity to which the device is to be formatted, if possible. + */ + virtual IOReturn doFormatMedia(UInt64 byteCapacity) = 0; + + /*! + * @function doGetFormatCapacities + * @abstract + * Return the allowable formatting byte capacities. + * @discussion + * This function returns the supported byte capacities for the device. + * @param capacities + * Pointer for returning the list of capacities. + * @param capacitiesMaxCount + * The number of capacity values returned in "capacities," or if no buffer + * is given, the total number of capacity values available. + */ + virtual UInt32 doGetFormatCapacities(UInt64 * capacities, + UInt32 capacitiesMaxCount) const = 0; + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual IOReturn doLockUnlockMedia(bool doLock) __attribute__ ((deprecated)); +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + virtual IOReturn doSynchronizeCache(void) __attribute__ ((deprecated)); + + /*! + * @function getVendorString + * @abstract + * Return Vendor Name string for the device. + * @result + * A pointer to a static character string. + */ + virtual char * getVendorString(void) = 0; + + /*! + * @function getProductString + * @abstract + * Return Product Name string for the device. + * @result + * A pointer to a static character string. + */ + virtual char * getProductString(void) = 0; + + /*! + * @function getRevisionString + * @abstract + * Return Product Revision string for the device. + * @result + * A pointer to a static character string. + */ + virtual char * getRevisionString(void) = 0; + + /*! + * @function getAdditionalDeviceInfoString + * @abstract + * Return additional informational string for the device. + * @result + * A pointer to a static character string. + */ + virtual char * getAdditionalDeviceInfoString(void) = 0; + + /*! + * @function reportBlockSize + * @abstract + * Report the block size for the device, in bytes. + * @param blockSize + * Pointer to returned block size value. + */ + virtual IOReturn reportBlockSize(UInt64 *blockSize) = 0; + + /*! + * @function reportEjectability + * @abstract + * Report if the media is ejectable under software control. + * @discussion + * This method should only be called if the media is known to be removable. + * @param isEjectable + * Pointer to returned result. True indicates the media is ejectable, False indicates + * the media cannot be ejected under software control. + */ + virtual IOReturn reportEjectability(bool *isEjectable) = 0; + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual IOReturn reportLockability(bool *isLockable) __attribute__ ((deprecated)); +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + /*! + * @function reportMaxValidBlock + * @abstract + * Report the highest valid block for the device. + * @param maxBlock + * Pointer to returned result + */ + virtual IOReturn reportMaxValidBlock(UInt64 *maxBlock) = 0; + + /*! + * @function reportMediaState + * @abstract + * Report the device's media state. + * @discussion + * This method reports whether we have media in the drive or not, and + * whether the state has changed from the previously reported state. + * + * A result of kIOReturnSuccess is always returned if the test for media is successful, + * regardless of media presence. The mediaPresent result should be used to determine + * whether media is present or not. A return other than kIOReturnSuccess indicates that + * the Transport Driver was unable to interrogate the device. In this error case, the + * outputs mediaState and changedState will *not* be stored. + * @param mediaPresent Pointer to returned media state. True indicates media is present + * in the device; False indicates no media is present. + */ + virtual IOReturn reportMediaState(bool *mediaPresent,bool *changedState = 0) = 0; + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual IOReturn reportPollRequirements(bool *pollRequired, + bool *pollIsExpensive) __attribute__ ((deprecated)); +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + /*! + * @function reportRemovability + * @abstract + * Report whether the media is removable or not. + * @discussion + * This method reports whether the media is removable, but it does not + * provide detailed information regarding software eject or lock/unlock capability. + * @param isRemovable + * Pointer to returned result. True indicates that the media is removable; False + * indicates the media is not removable. + */ + virtual IOReturn reportRemovability(bool *isRemovable) = 0; + + /*! + * @function reportWriteProtection + * @abstract + * Report whether the media is write-protected or not. + * @param isWriteProtected + * Pointer to returned result. True indicates that the media is write-protected (it + * cannot be written); False indicates that the media is not write-protected (it + * is permissible to write). + */ + virtual IOReturn reportWriteProtection(bool *isWriteProtected) = 0; + + /*! + * @function getWriteCacheState + * @abstract + * Reports the current write cache state of the device. + * @discussion + * Reports the current write cache state of the device. The write cache + * state is not guaranteed to persist across reboots and detaches. + * @param enabled + * Pointer to returned result. True indicates the write cache is enabled; + * False indicates the write cache is disabled. + */ + virtual IOReturn getWriteCacheState(bool *enabled); + + /*! + * @function setWriteCacheState + * @abstract + * Sets the write cache state of the device. + * @discussion + * Sets the write cache state of the device. The write cache state + * is not guaranteed to persist across reboots and detaches. + * @param enabled + * True to enable the write cache; False to disable the write cache. + */ + virtual IOReturn setWriteCacheState(bool enabled); + + /*! + * @function doAsyncReadWrite + * @abstract + * Start an asynchronous read or write operation. + * @param buffer + * An IOMemoryDescriptor describing the data-transfer buffer. The data direction + * is contained in the IOMemoryDescriptor. Responsibility for releasing the descriptor + * rests with the caller. + * @param block + * The starting block number of the data transfer. + * @param nblks + * The integral number of blocks to be transferred. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. + * @param completion + * The completion routine to call once the data transfer is complete. + */ + virtual IOReturn doAsyncReadWrite(IOMemoryDescriptor *buffer, + UInt64 block, UInt64 nblks, + IOStorageAttributes *attributes, + IOStorageCompletion *completion) = 0; + + /*! + * @function requestIdle + * @abstract + * Request that the device enter an idle state. + * @discussion + * Request that the device enter an idle state. The device will exit this state on the + * next read or write request, or as it sees necessary. One example is for a DVD drive + * to spin down when it enters such an idle state, and spin up on the next read request + * from the system. + */ + virtual IOReturn requestIdle(void); + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual IOReturn doDiscard(UInt64 block, UInt64 nblks) __attribute__ ((deprecated)); +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + /*! + * @function doUnmap + * @abstract + * Delete unused data blocks from the media. + * @param extents + * List of extents. See IOBlockStorageDeviceExtent. It is legal for the callee to + * overwrite the contents of this buffer in order to satisfy the request. + * @param extentsCount + * Number of extents. + * @param options + * Options for the unmap. See IOStorageUnmapOptions. + */ + virtual IOReturn doUnmap(IOBlockStorageDeviceExtent * extents, + UInt32 extentsCount, + IOStorageUnmapOptions options = 0); /* 10.6.6 */ + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 + /*! + * @function doSetPriority + * @abstract + * Reprioritize read or write operations. + * @param extents + * List of extents. See IOBlockStorageDeviceExtent. It is legal for the callee to + * overwrite the contents of this buffer in order to satisfy the request. + * @param extentsCount + * Number of extents. + * @param priority + * New priority. See IOStoragePriority. + */ + virtual IOReturn doSetPriority(IOBlockStorageDeviceExtent * extents, + UInt32 extentsCount, + IOStoragePriority priority); /* 10.10.0 */ +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_11 + /*! + * @function doSynchronize + * @abstract + * Force data blocks in the hardware's buffer to be flushed to the media. + * @discussion + * This method should only be called if the media is writable. + * @param block + * The starting block number of the synchronization. + * @param nblks + * The integral number of blocks to be synchronized. Set to zero to specify the + * end-of-media. + * @param options + * Options for the synchronization. See IOStorageSynchronizeOptions. + */ + virtual IOReturn doSynchronize(UInt64 block, + UInt64 nblks, + IOStorageSynchronizeOptions options = 0); /* 10.11.0 */ +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12 + /*! + * @function doGetProvisionStatus + * @discussion + * Get device block provision status + * @param block + * Block offset of logical extent on the device. + * @param nblks + * Blocks count of logical extent on the device. + * @param extentsCount + * Number of extents allocated in extents. On return, this parameter indicate number + * of provision extents returned. + * @param extents + * List of provision extents, block based. See IOStorageProvisionDeviceExtents. + * @param options + * Options for get provision status. See IOStorageGetProvisionStatusOptions. + * @result + * Returns the status of the getProvisionStatus. + */ + + virtual IOReturn doGetProvisionStatus(UInt64 block, + UInt64 nblks, + UInt32 * extentsCount, + IOBlockStorageProvisionDeviceExtent * extents, + IOStorageGetProvisionStatusOptions options = 0); /* 10.12.0 */ +#endif + + OSMetaClassDeclareReservedUsed(IOBlockStorageDevice, 0); + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 + OSMetaClassDeclareReservedUsed(IOBlockStorageDevice, 1); +#else + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 1); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_11 + OSMetaClassDeclareReservedUsed(IOBlockStorageDevice, 2); +#else + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 2); +#endif + +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12 + OSMetaClassDeclareReservedUsed(IOBlockStorageDevice, 3); +#else + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 3); +#endif + + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 4); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 5); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 6); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 7); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 8); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 9); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 10); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 11); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 12); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 13); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 14); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 15); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 16); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 17); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 18); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 19); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 20); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 21); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 22); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 23); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 24); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 25); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 26); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 27); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 28); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 29); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 30); + OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBLOCKSTORAGEDEVICE_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOBlockStorageDriver.h b/QualcommWireless/include/IOKit/storage/IOBlockStorageDriver.h new file mode 100644 index 0000000..0b04b9f --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOBlockStorageDriver.h @@ -0,0 +1,1528 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBlockStorageDriver + * @abstract + * This header contains the IOBlockStorageDriver class definition. + */ + +#ifndef _IOBLOCKSTORAGEDRIVER_H +#define _IOBLOCKSTORAGEDRIVER_H + +#include <IOKit/IOTypes.h> + +/*! + * @defined kIOBlockStorageDriverClass + * @abstract + * The name of the IOBlockStorageDriver class. + */ + +#define kIOBlockStorageDriverClass "IOBlockStorageDriver" + +/*! + * @defined kIOBlockStorageDriverStatisticsKey + * @abstract + * Holds a table of numeric values describing the driver's + * operating statistics. + * @discussion + * This property holds a table of numeric values describing the driver's + * operating statistics. The table is an OSDictionary, where each entry + * describes one given statistic. + */ + +#define kIOBlockStorageDriverStatisticsKey "Statistics" + +/*! + * @defined kIOBlockStorageDriverStatisticsBytesReadKey + * @abstract + * Describes the number of bytes read since the block storage + * driver was instantiated. + * @discussion + * This property describes the number of bytes read since the block storage + * driver was instantiated. It is one of the statistic entries listed under + * the top-level kIOBlockStorageDriverStatisticsKey property table. It has + * an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsBytesReadKey "Bytes (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsBytesWrittenKey + * @abstract + * Describes the number of bytes written since the block storage + * driver was instantiated. + * @discussion + * This property describes the number of bytes written since the block storage + * driver was instantiated. It is one of the statistic entries listed under the + * top-level kIOBlockStorageDriverStatisticsKey property table. It has an + * OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsBytesWrittenKey "Bytes (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsReadErrorsKey + * @abstract + * Describes the number of read errors encountered since the block + * storage driver was instantiated. + * @discussion + * This property describes the number of read errors encountered since the block + * storage driver was instantiated. It is one of the statistic entries listed + * under the top-level kIOBlockStorageDriverStatisticsKey property table. It + * has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsReadErrorsKey "Errors (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsWriteErrorsKey + * @abstract + * Describes the number of write errors encountered since the + * block storage driver was instantiated. + * @discussion + * This property describes the number of write errors encountered since the + * block storage driver was instantiated. It is one of the statistic entries + * listed under the top-level kIOBlockStorageDriverStatisticsKey property table. + * It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsWriteErrorsKey "Errors (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsLatentReadTimeKey + * @abstract + * Describes the number of nanoseconds of latency during reads + * since the block storage driver was instantiated. + * @discussion + * This property describes the number of nanoseconds of latency during reads + * since the block storage driver was instantiated. It is one of the statistic + * entries listed under the top-level kIOBlockStorageDriverStatisticsKey + * property table. It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsLatentReadTimeKey "Latency Time (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsLatentWriteTimeKey + * @abstract + * Describes the number of nanoseconds of latency during writes + * since the block storage driver was instantiated. + * @discussion + * This property describes the number of nanoseconds of latency during writes + * since the block storage driver was instantiated. It is one of the statistic + * entries listed under the top-level kIOBlockStorageDriverStatisticsKey + * property table. It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsLatentWriteTimeKey "Latency Time (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsReadsKey + * @abstract + * Describes the number of read operations processed since the + * block storage driver was instantiated. + * @discussion + * This property describes the number of read operations processed since the + * block storage driver was instantiated. It is one of the statistic entries + * listed under the top-level kIOBlockStorageDriverStatisticsKey property table. + * It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsReadsKey "Operations (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsWritesKey + * @abstract + * Describes the number of write operations processed since the + * block storage driver was instantiated. + * @discussion + * This property describes the number of write operations processed since the + * block storage driver was instantiated. It is one of the statistic entries + * listed under the top-level kIOBlockStorageDriverStatisticsKey property table. + * It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsWritesKey "Operations (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsReadRetriesKey + * @abstract + * Describes the number of read retries required since the block + * storage driver was instantiated. + * @discussion + * This property describes the number of read retries required since the block + * storage driver was instantiated. It is one of the statistic entries listed + * under the top-level kIOBlockStorageDriverStatisticsKey property table. It + * has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsReadRetriesKey "Retries (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsWriteRetriesKey + * @abstract + * Describes the number of write retries required since the block + * storage driver was instantiated. + * @discussion + * This property describes the number of write retries required since the block + * storage driver was instantiated. It is one of the statistic entries listed + * under the top-level kIOBlockStorageDriverStatisticsKey property table. It + * has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsWriteRetriesKey "Retries (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsTotalReadTimeKey + * @abstract + * Describes the number of nanoseconds spent performing reads + * since the block storage driver was instantiated. + * @discussion + * This property describes the number of nanoseconds spent performing reads + * since the block storage driver was instantiated. It is one of the statistic + * entries listed under the top-level kIOBlockStorageDriverStatisticsKey + * property table. It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsTotalReadTimeKey "Total Time (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsTotalWriteTimeKey + * @abstract + * Describes the number of nanoseconds spent performing writes + * since the block storage driver was instantiated. + * @discussion + * This property describes the number of nanoseconds spent performing writes + * since the block storage driver was instantiated. It is one of the statistic + * entries listed under the top-level kIOBlockStorageDriverStatisticsKey + * property table. It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsTotalWriteTimeKey "Total Time (Write)" + +/*! + * @enum IOMediaState + * @abstract + * The different states that getMediaState() can report. + * @constant kIOMediaStateOffline + * Media is not available. + * @constant kIOMediaStateOnline + * Media is available and ready for operations. + * @constant kIOMediaStateBusy + * Media is available, but not ready for operations. + */ + +enum +{ + kIOMediaStateOffline = 0, + kIOMediaStateOnline = 1, + kIOMediaStateBusy = 2 +}; + +typedef UInt32 IOMediaState; + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOBlockStorageDevice.h> +#include <IOKit/storage/IOMedia.h> +#include <IOKit/storage/IOStorage.h> + +/*! + * @class IOBlockStorageDriver + * @abstract + * The common base class for generic block storage drivers. + * @discussion + * The IOBlockStorageDriver class is the common base class for generic block + * storage drivers. It matches and communicates via an IOBlockStorageDevice + * interface, and connects to the remainder of the storage framework via the + * IOStorage protocol. It extends the IOStorage protocol by implementing the + * appropriate open and close semantics, deblocking for unaligned transfers, + * polling for ejectable media, locking and ejection policies, media object + * creation and tear-down, and statistics gathering and reporting. + * + * Block storage drivers are split into two parts: the generic driver handles + * all generic device issues, independent of the lower-level transport + * mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations + * at the generic driver level are translated into a series of generic + * device operations. These operations are passed via the IOBlockStorageDevice + * nub to a transport driver, which implements the appropriate + * transport-dependent protocol to execute these operations. + * + * To determine the write-protect state of a device (or media), for + * example, the generic driver would issue a call to the + * Transport Driver's reportWriteProtection method. If this were a SCSI + * device, its transport driver would issue a Mode Sense command to + * extract the write-protection status bit. The transport driver then + * reports true or false to the generic driver. + * + * The generic driver therefore has no knowledge of, or involvement + * with, the actual commands and mechanisms used to communicate with + * the device. It is expected that the generic driver will rarely, if + * ever, need to be subclassed to handle device idiosyncrasies; rather, + * the transport driver should be changed via overrides. + * + * A generic driver could be subclassed to create a different type of + * generic device. The generic driver IOCDBlockStorageDriver class is + * a subclass of IOBlockStorageDriver, adding CD functions. + */ + +class IOBlockStorageDriver : public IOStorage +{ + OSDeclareDefaultStructors(IOBlockStorageDriver); + +public: + + /*! + * @enum Statistics + * @abstract + * Indices for the different statistics that getStatistics() can report. + * @constant kStatisticsReads Number of read operations thus far. + * @constant kStatisticsBytesRead Number of bytes read thus far. + * @constant kStatisticsTotalReadTime Nanoseconds spent performing reads thus far. + * @constant kStatisticsLatentReadTime Nanoseconds of latency during reads thus far. + * @constant kStatisticsReadRetries Number of read retries thus far. + * @constant kStatisticsReadErrors Number of read errors thus far. + * @constant kStatisticsWrites Number of write operations thus far. + * @constant kStatisticsSingleBlockWrites Number of write operations for a single block thus far. + * @constant kStatisticsBytesWritten Number of bytes written thus far. + * @constant kStatisticsTotalWriteTime Nanoseconds spent performing writes thus far. + * @constant kStatisticsLatentWriteTime Nanoseconds of latency during writes thus far. + * @constant kStatisticsWriteRetries Number of write retries thus far. + * @constant kStatisticsWriteErrors Number of write errors thus far. + */ + + enum Statistics + { + kStatisticsReads, + kStatisticsBytesRead, + kStatisticsTotalReadTime, + kStatisticsLatentReadTime, + kStatisticsReadRetries, + kStatisticsReadErrors, + + kStatisticsWrites, + kStatisticsSingleBlockWrites, + kStatisticsBytesWritten, + kStatisticsTotalWriteTime, + kStatisticsLatentWriteTime, + kStatisticsWriteRetries, + kStatisticsWriteErrors + }; + + static const UInt32 kStatisticsCount = kStatisticsWriteErrors + 1; + +protected: + + struct Context; + + struct ExpansionData + { + UInt64 reserved0000; + UInt64 maxReadBlockTransfer; + UInt64 maxWriteBlockTransfer; + IONotifier * powerEventNotifier; + UInt32 deblockRequestWriteLockCount; + UInt64 maxReadSegmentTransfer; + UInt64 maxWriteSegmentTransfer; + UInt64 maxReadSegmentByteTransfer; + UInt64 maxWriteSegmentByteTransfer; + UInt64 minSegmentAlignmentByteTransfer; + UInt64 maxSegmentWidthByteTransfer; + Context * contexts; + IOSimpleLock * contextsLock; + UInt32 contextsCount; + UInt32 contextsMaxCount; + }; + ExpansionData * _expansionData; + + #define _maxReadBlockTransfer \ + IOBlockStorageDriver::_expansionData->maxReadBlockTransfer + #define _maxWriteBlockTransfer \ + IOBlockStorageDriver::_expansionData->maxWriteBlockTransfer + #define _powerEventNotifier \ + IOBlockStorageDriver::_expansionData->powerEventNotifier + #define _deblockRequestWriteLockCount \ + IOBlockStorageDriver::_expansionData->deblockRequestWriteLockCount + #define _maxReadSegmentTransfer \ + IOBlockStorageDriver::_expansionData->maxReadSegmentTransfer + #define _maxWriteSegmentTransfer \ + IOBlockStorageDriver::_expansionData->maxWriteSegmentTransfer + #define _maxReadSegmentByteTransfer \ + IOBlockStorageDriver::_expansionData->maxReadSegmentByteTransfer + #define _maxWriteSegmentByteTransfer \ + IOBlockStorageDriver::_expansionData->maxWriteSegmentByteTransfer + #define _minSegmentAlignmentByteTransfer \ + IOBlockStorageDriver::_expansionData->minSegmentAlignmentByteTransfer + #define _maxSegmentWidthByteTransfer \ + IOBlockStorageDriver::_expansionData->maxSegmentWidthByteTransfer + #define _contexts \ + IOBlockStorageDriver::_expansionData->contexts + #define _contextsLock \ + IOBlockStorageDriver::_expansionData->contextsLock + #define _contextsCount \ + IOBlockStorageDriver::_expansionData->contextsCount + #define _contextsMaxCount \ + IOBlockStorageDriver::_expansionData->contextsMaxCount + + OSSet * _openClients; + OSNumber * _statistics[kStatisticsCount]; + + /* + * @struct Context + * @discussion + * Context structure for a read/write operation. It describes the block size, + * and where applicable, a block type and block sub-type, for a data transfer, + * as well as the completion information for the original request. Note that + * the block type field is unused in the IOBlockStorageDriver class. + * @field block.size + * Block size for the operation. + * @field block.type + * Block type for the operation. Unused in IOBlockStorageDriver. The default + * value for this field is IOBlockStorageDriver::kBlockTypeStandard. + * @field block.typeSub + * Block sub-type for the operation. It's definition depends on block.type. + * Unused in IOBlockStorageDriver. + * @field request.byteStart + * Starting byte offset for the data transfer. + * @param request.buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param request.attributes + * Attributes of the data transfer. See IOStorageAttributes. + * @param request.completion + * Completion routine to call once the data transfer is complete. + */ + + struct Context + { + struct + { + UInt64 byteStart; + IOMemoryDescriptor * buffer; + IOStorageAttributes attributes; + IOStorageCompletion completion; + } request; + + struct + { + UInt32 size; + UInt8 type; + UInt8 typeSub[3]; + } block; + + AbsoluteTime timeStart; + + UInt64 reserved0704; + UInt64 reserved0768; + UInt64 reserved0832; + UInt64 reserved0896; + + Context * next; + }; + + static const UInt8 kBlockTypeStandard = 0x00; + + using IOService::open; + + /* + * Free all of this object's outstanding resources. + * + * This method's implementation is not typically overridden. + */ + + void free() APPLE_KEXT_OVERRIDE; + + /*! + * @function handleOpen + * @discussion + * The handleOpen method grants or denies permission to access this object + * to an interested client. The argument is an IOStorageAccess value that + * specifies the level of access desired -- reader or reader-writer. + * + * This method can be invoked to upgrade or downgrade the access level for + * an existing client as well. The previous access level will prevail for + * upgrades that fail, of course. A downgrade should never fail. If the + * new access level should be the same as the old for a given client, this + * method will do nothing and return success. In all cases, one, singular + * close-per-client is expected for all opens-per-client received. + * + * This implementation replaces the IOService definition of handleIsOpen(). + * @param client + * Client requesting the open. + * @param options + * Options for the open. Set to zero. + * @param access + * Access level for the open. Set to kIOStorageAccessReader or + * kIOStorageAccessReaderWriter. + * @result + * Returns true if the open was successful, false otherwise. + */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * access) APPLE_KEXT_OVERRIDE; + + /*! + * @function handleIsOpen + * @discussion + * The handleIsOpen method determines whether the specified client, or any + * client if none is specified, presently has an open on this object. + * + * This implementation replaces the IOService definition of handleIsOpen(). + * @param client + * Client to check the open state of. Set to zero to check the open state + * of all clients. + * @result + * Returns true if the client was (or clients were) open, false otherwise. + */ + + virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE; + + /*! + * @function handleClose + * @discussion + * The handleClose method closes the client's access to this object. + * + * This implementation replaces the IOService definition of handleIsOpen(). + * @param client + * Client requesting the close. + * @param options + * Options for the close. Set to zero. + */ + + virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE; + + /*! + * @function addToBytesTransferred + * @discussion + * Update the total number of bytes transferred, the total transfer time, + * and the total latency time -- used for statistics. + * + * This method's implementation is not typically overridden. + * @param bytesTransferred + * Number of bytes transferred in this operation. + * @param totalTime + * Nanoseconds spent performing this operation. + * @param latentTime + * Nanoseconds of latency during this operation. + * @param isWrite + * Indicates whether this operation was a write, otherwise is was a read. + */ + + virtual void addToBytesTransferred(UInt64 bytesTransferred, + UInt64 totalTime, + UInt64 latentTime, + bool isWrite); + + /*! + * @function incrementErrors + * @discussion + * Update the total error count -- used for statistics. + * + * This method's implementation is not typically overridden. + * @param isWrite + * Indicates whether this operation was a write, otherwise is was a read. + */ + + virtual void incrementErrors(bool isWrite); + + /*! + * @function incrementRetries + * @discussion + * Update the total retry count -- used for statistics. + * + * This method's implementation is not typically overridden. + * @param isWrite + * Indicates whether this operation was a write, otherwise is was a read. + */ + + virtual void incrementRetries(bool isWrite); + + /*! + * @function allocateContext + * @discussion + * Allocate a context structure for a read/write operation. + * @result + * Context structure. + */ + + virtual Context * allocateContext(); + + /*! + * @function deleteContext + * @discussion + * Delete a context structure from a read/write operation. + * @param context + * Context structure to be deleted. + */ + + virtual void deleteContext(Context * context); + + /*! + * @function deblockRequest + * @discussion + * The deblockRequest method checks to see if the incoming request rests + * on the media's block boundaries, and if not, deblocks it. Deblocking + * involves rounding out the request to the nearest block boundaries and + * transferring the excess bytes into a scratch buffer. + * + * This method is part of a sequence of methods invoked for each read/write + * request. The first is prepareRequest, which allocates and prepares some + * context for the transfer; the second is deblockRequest, which aligns the + * transfer at the media's block boundaries; third is breakUpRequest, which + * breaks up the transfer into multiple sub-transfers when certain hardware + * constraints are exceeded; fourth is executeRequest, which implements the + * actual transfer from the block storage device. + * + * This method's implementation is not typically overridden. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param context + * Additional context information for the data transfer (e.g. block size). + */ + + virtual void deblockRequest(UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion, + Context * context); + + /*! + * @function executeRequest + * @discussion + * Execute an asynchronous storage request. The request is guaranteed to be + * block-aligned. + * + * This method is part of a sequence of methods invoked for each read/write + * request. The first is prepareRequest, which allocates and prepares some + * context for the transfer; the second is deblockRequest, which aligns the + * transfer at the media's block boundaries; third is breakUpRequest, which + * breaks up the transfer into multiple sub-transfers when certain hardware + * constraints are exceeded; fourth is executeRequest, which implements the + * actual transfer from the block storage device. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param context + * Additional context information for the data transfer (e.g. block size). + */ + + virtual void executeRequest(UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion, + Context * context); + + /*! + * @function handleStart + * @discussion + * Prepare the block storage driver for operation. + * + * This is where a media object needs to be created for fixed media, and + * optionally for removable media. + * + * Note that this method is called from within the start() routine; + * if this method returns successfully, it should be prepared to accept + * any of IOBlockStorageDriver's APIs. + * @param provider + * This object's provider. + * @result + * Returns true on success, false otherwise. + */ + + virtual bool handleStart(IOService * provider); + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual bool handleYield(IOService * provider, + IOOptionBits options = 0, + void * argument = 0) __attribute__ ((deprecated)); +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + /*! + * @function getMediaBlockSize + * @discussion + * Ask the driver about the media's natural block size. + * @result + * Natural block size, in bytes. + */ + + virtual UInt64 getMediaBlockSize() const; + +public: + + using IOStorage::open; + using IOStorage::read; + using IOStorage::write; + + /* + * Initialize this object's minimal state. + * + * This method's implementation is not typically overridden. + */ + + virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE; + + /* + * This method is called once we have been attached to the provider object. + * + * This method's implementation is not typically overridden. + */ + + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + + /* + * This method is called before we are detached from the provider object. + * + * This method's implementation is not typically overridden. + */ + + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + + virtual bool didTerminate(IOService * provider, + IOOptionBits options, + bool * defer) APPLE_KEXT_OVERRIDE; + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual bool yield(IOService * provider, + IOOptionBits options = 0, + void * argument = 0) __attribute__ ((deprecated)); +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + /*! + * @function read + * @discussion + * The read method is the receiving end for all read requests from the + * storage framework (through the media object created by this driver). + * + * This method initiates a sequence of methods (stages) for each read/write + * request. The first is prepareRequest, which allocates and prepares some + * context for the transfer; the second is deblockRequest, which aligns the + * transfer at the media's block boundaries; third is breakUpRequest, which + * breaks up the transfer into multiple sub-transfers when certain hardware + * constraints are exceeded; fourth is executeRequest, which implements the + * actual transfer from the block storage device. + * + * This method's implementation is not typically overridden. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE; + + /*! + * @function write + * @discussion + * The write method is the receiving end for all write requests from the + * storage framework (through the media object created by this driver). + * + * This method initiates a sequence of methods (stages) for each read/write + * request. The first is prepareRequest, which allocates and prepares some + * context for the transfer; the second is deblockRequest, which aligns the + * transfer at the media's block boundaries; third is breakUpRequest, which + * breaks up the transfer into multiple sub-transfers when certain hardware + * constraints are exceeded; fourth is executeRequest, which implements the + * actual transfer from the block storage device. + * + * This method's implementation is not typically overridden. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE; + + /*! + * @function synchronize + * @discussion + * Flush the cached data in the storage object, if any. + * @param client + * Client requesting the synchronization. + * @param byteStart + * Starting byte offset for the synchronization. + * @param byteCount + * Size of the synchronization. Set to zero to specify the end-of-media. + * @param options + * Options for the synchronization. See IOStorageSynchronizeOptions. + * @result + * Returns the status of the synchronization. + */ + + virtual IOReturn synchronize(IOService * client, + UInt64 byteStart, + UInt64 byteCount, + IOStorageSynchronizeOptions options = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function unmap + * @discussion + * Delete unused data from the storage object at the specified byte offsets. + * @param client + * Client requesting the operation. + * @param extents + * List of extents. See IOStorageExtent. It is legal for the callee to + * overwrite the contents of this buffer in order to satisfy the request. + * @param extentsCount + * Number of extents. + * @param options + * Options for the unmap. See IOStorageUnmapOptions. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn unmap(IOService * client, + IOStorageExtent * extents, + UInt32 extentsCount, + IOStorageUnmapOptions options = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function getProvisionStatus + * @discussion + * Get device block provision status + * @param client + * Client requesting the synchronization. + * @param byteStart + * Byte offset of logical extent on the device. + * @param byteCount + * Byte length of logical extent on the device, 0 mean the entire remaining space. + * @param extentsCount + * Number of extents allocated in extents. On return, this parameter indicate number + * of provision extents returned. + * @param extents + * List of provision extents. See IOStorageProvisionExtents. + * @result + * Returns the status of the getProvisionStatus. + */ + + virtual IOReturn getProvisionStatus(IOService * client, + UInt64 byteStart, + UInt64 byteCount, + UInt32 * extentsCount, + IOStorageProvisionExtent * extents, + IOStorageGetProvisionStatusOptions options = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function lockPhysicalExtents + * @discussion + * Lock the contents of the storage object against relocation temporarily, + * for the purpose of getting physical extents. + * @param client + * Client requesting the operation. + * @result + * Returns true if the lock was successful, false otherwise. + */ + + virtual bool lockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE; + + /*! + * @function copyPhysicalExtent + * @discussion + * Convert the specified byte offset into a physical byte offset, relative + * to a physical storage object. This call should only be made within the + * context of lockPhysicalExtents(). + * @param client + * Client requesting the operation. + * @param byteStart + * Starting byte offset for the operation. Returns a physical byte offset, + * relative to the physical storage object, on success. + * @param byteCount + * Size of the operation. Returns the actual number of bytes which can be + * transferred, relative to the physical storage object, on success. + * @result + * A reference to the physical storage object, which should be released by + * the caller, or a null on error. + */ + + virtual IOStorage * copyPhysicalExtent(IOService * client, + UInt64 * byteStart, + UInt64 * byteCount) APPLE_KEXT_OVERRIDE; + + /*! + * @function unlockPhysicalExtents + * @discussion + * Unlock the contents of the storage object for relocation again. This + * call must balance a successful call to lockPhysicalExtents(). + * @param client + * Client requesting the operation. + */ + + virtual void unlockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE; + + /*! + * @function setPriority + * @discussion + * Reprioritize read or write requests at the specified byte offsets. + * @param client + * Client requesting the operation. + * @param extents + * List of extents. See IOStorageExtent. It is legal for the callee to + * overwrite the contents of this buffer in order to satisfy the request. + * @param extentsCount + * Number of extents. + * @param priority + * New priority. See IOStoragePriority. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setPriority(IOService * client, + IOStorageExtent * extents, + UInt32 extentsCount, + IOStoragePriority priority) APPLE_KEXT_OVERRIDE; + + /*! + * @function ejectMedia + * @discussion + * Eject the media from the device. The driver is responsible for tearing + * down the media object it created before proceeding with the eject. If + * the tear-down fails, an error should be returned. + * @result + * An IOReturn code. + */ + + virtual IOReturn ejectMedia(); + + /*! + * @function formatMedia + * @discussion + * Format the media with the specified byte capacity. The driver is + * responsible for tearing down the media object and recreating it. + * @param byteCapacity + * Number of bytes to format media to. + * @result + * An IOReturn code. + */ + + virtual IOReturn formatMedia(UInt64 byteCapacity); + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual IOReturn lockMedia(bool lock) __attribute__ ((deprecated)); + + virtual IOReturn pollMedia() __attribute__ ((deprecated)); +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + /*! + * @function isMediaEjectable + * @discussion + * Ask the driver whether the media is ejectable. + * @result + * Returns true if the media is ejectable, false otherwise. + */ + + virtual bool isMediaEjectable() const; + + /*! + * @function isMediaRemovable + * @discussion + * Ask the driver whether the media is ejectable. + * @result + * Returns true if the media is ejectable, false otherwise. + */ + + virtual bool isMediaRemovable() const; + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual bool isMediaPollExpensive() const __attribute__ ((deprecated)); + + virtual bool isMediaPollRequired() const __attribute__ ((deprecated)); +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + /*! + * @function isMediaWritable + * @discussion + * Ask the driver whether the media is writable. + * @result + * Returns true if the media is writable, false otherwise. + */ + + virtual bool isMediaWritable() const; + + /*! + * @function getMediaState + * @discussion + * Ask the driver about the media's current state. + * @result + * An IOMediaState value. + */ + + virtual IOMediaState getMediaState() const; + + /*! + * @function getFormatCapacities + * @discussion + * Ask the driver to report the feasible formatting capacities for the + * inserted media (in bytes). This routine fills the caller's buffer, + * up to the maximum count specified if the real number of capacities + * would overflow the buffer. The return value indicates the actual + * number of capacities copied to the buffer. + * + * If the capacities buffer is not supplied or if the maximum count is + * zero, the routine returns the proposed count of capacities instead. + * @param capacities + * Buffer that will receive the UInt64 capacity values. + * @param capacitiesMaxCount + * Maximum number of capacity values that can be held in the buffer. + * @result + * Actual number of capacity values copied to the buffer, or if no buffer + * is given, the total number of capacity values available. + */ + + virtual UInt32 getFormatCapacities(UInt64 * capacities, + UInt32 capacitiesMaxCount) const; + + /*! + * @function getStatistics + * @discussion + * Ask the driver to report its operating statistics. + * + * The statistics are each indexed by IOBlockStorageDriver::Statistics + * indices. This routine fills the caller's buffer, up to the maximum + * count specified if the real number of statistics would overflow the + * buffer. The return value indicates the actual number of statistics + * copied to the buffer. + * + * If the statistics buffer is not supplied or if the maximum count is + * zero, the routine returns the proposed count of statistics instead. + * @param statistics + * Buffer that will receive the UInt64 statistic values. + * @param statisticsMaxCount + * Maximum number of statistic values that can be held in the buffer. + * @result + * Actual number of statistic values copied to the buffer, or if no buffer + * is given, the total number of statistic values available. + */ + + virtual UInt32 getStatistics(UInt64 * statistics, + UInt32 statisticsMaxCount) const; + + /*! + * @function getStatistic + * @discussion + * Ask the driver to report one of its operating statistics. + * @param statistic + * Statistic index (an IOBlockStorageDriver::Statistics index). + * @result + * Statistic value. + */ + + virtual UInt64 getStatistic(Statistics statistic) const; + + /* + * Generic entry point for calls from the provider. A return value of + * kIOReturnSuccess indicates that the message was received, and where + * applicable, that it was successful. + */ + + virtual IOReturn message(UInt32 type, IOService * provider, void * argument) APPLE_KEXT_OVERRIDE; + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IOBlockStorageDevice. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IOBlockStorageDevice * getProvider() const APPLE_KEXT_OVERRIDE; + +protected: + + IOLock * _deblockRequestWriteLock; + + UInt64 _reserved1024; + + static void breakUpRequestExecute(void * parameter, void * target); + + static void deblockRequestExecute(void * parameter, void * target); + + /* + * This is the completion routine for the broken up breaker sub-requests. + * It verifies the success of the just-completed stage, transitions to + * the next stage, then builds and issues a transfer for the next stage. + */ + + static void breakUpRequestCompletion(void * target, + void * parameter, + IOReturn status, + UInt64 actualByteCount); + + /* + * This is the completion routine for the aligned deblocker sub-requests. + * It verifies the success of the just-completed stage, transitions to + * the next stage, then builds and issues a transfer for the next stage. + */ + + static void deblockRequestCompletion(void * target, + void * parameter, + IOReturn status, + UInt64 actualByteCount); + + /* + * This is the completion routine for the prepared request. It updates + * the driver's statistics, performs some clean up work, then calls the + * original request's completion routine. + */ + + static void prepareRequestCompletion(void * target, + void * parameter, + IOReturn status, + UInt64 actualByteCount); + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual void schedulePoller() __attribute__ ((deprecated)); + + virtual void unschedulePoller() __attribute__ ((deprecated)); +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + /* + * This method is the power event handler for restarts and shutdowns. + */ + + static IOReturn handlePowerEvent(void * target, + void * parameter, + UInt32 messageType, + IOService * provider, + void * messageArgument, + vm_size_t messageArgumentSize); + +protected: + + /* Device info: */ + + /*! + * @var _removable + * True if the media is removable; False if it is fixed (not removable). + */ + bool _removable; + + /*! + * @var _ejectable + * True if the media is ejectable under software control. + */ + bool _ejectable; /* software-ejectable */ + + UInt16 _reserved1104; + + UInt32 _openAssertions; + + /* Media info and states: */ + + /*! + * @var _mediaObject + * A pointer to the media object we have instantiated (if any). + */ + IOMedia * _mediaObject; + + /*! + * @var _mediaType + * Type of the media (can be used to differentiate between the + * different types of CD media, DVD media, etc). + */ + UInt32 _mediaType; + + bool _solidState; + + /*! + * @var _writeProtected + * True if the media is write-protected; False if not. + */ + bool _writeProtected; + + UInt16 _reserved1264; + UInt64 _reserved1280; + + /*! + * @var _mediaBlockSize + * The block size of the media, in bytes. + */ + UInt64 _mediaBlockSize; + + /*! + * @var _maxBlockNumber + * The maximum allowable block number for the media, zero-based. + */ + UInt64 _maxBlockNumber; + + /*! + * @var _maxReadByteTransfer + * The maximum byte transfer allowed for read operations. + */ + UInt64 _maxReadByteTransfer; + + /*! + * @var _maxWriteByteTransfer + * The maximum byte transfer allowed for write operations. + */ + UInt64 _maxWriteByteTransfer; + + /*! + * @function acceptNewMedia + * @abstract + * React to new media insertion. + * @discussion + * This method logs the media block size and block count, then calls + * instantiateMediaObject to get a media object instantiated. The + * media object is then attached above us and registered. + * + * This method can be overridden to control what happens when new media + * is inserted. The default implementation deals with one IOMedia object. + */ + virtual IOReturn acceptNewMedia(void); + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual UInt64 constrainByteCount(UInt64 requestedCount,bool isWrite) __attribute__ ((deprecated)); +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + /*! + * @function decommissionMedia + * @abstract + * Decommission an existing piece of media that has gone away. + * @discussion + * This method wraps a call to terminate, to tear down the stack and + * the IOMedia object for the media. If "forcible" is true, the media + * object will be forgotten, and initMediaState will be called. A + * forcible decommission would occur when an unrecoverable error + * happens during tear-down (e.g. perhaps a client is still open), but + * we must still forget about the media. + * @param forcible + * True to force forgetting of the media object even if terminate reports + * that there was an active client. + */ + virtual IOReturn decommissionMedia(bool forcible); + + /*! + * @function instantiateDesiredMediaObject + * @abstract + * Create an IOMedia object for media. + * @discussion + * This method creates the exact type of IOMedia object desired. It is called by + * instantiateMediaObject. A subclass may override this one-line method to change + * the type of media object actually instantiated. + */ + virtual IOMedia * instantiateDesiredMediaObject(void); + + /*! + * @function instantiateMediaObject + * @abstract + * Create an IOMedia object for media. + * @discussion + * This method creates an IOMedia object from the supplied parameters. It is a + * convenience method to wrap the handful of steps to do the job. + * @param base + * Byte number of beginning of active data area of the media. Usually zero. + * @param byteSize + * Size of the data area of the media, in bytes. + * @param blockSize + * Block size of the media, in bytes. + * @param mediaName + * Name of the IOMedia object. + * @result + * A pointer to the created IOMedia object, or a null on error. + */ + virtual IOMedia * instantiateMediaObject(UInt64 base,UInt64 byteSize, + UInt32 blockSize,char *mediaName); + + /*! + * @function recordMediaParameters + * @abstract + * Obtain media-related parameters on media insertion. + * @discussion + * This method obtains media-related parameters via calls to the + * Transport Driver's reportBlockSize, reportMaxValidBlock, + * and reportWriteProtection methods. + */ + virtual IOReturn recordMediaParameters(void); + + /*! + * @function rejectMedia + * @abstract + * Reject new media. + * @discussion + * This method will be called if validateNewMedia returns False (thus rejecting + * the new media. A vendor may choose to override this method to control behavior + * when media is rejected. + * + * The default implementation simply calls ejectMedia. + */ + virtual void rejectMedia(void); /* default ejects */ + + /*! + * @function validateNewMedia + * @abstract + * Verify that new media is acceptable. + * @discussion + * This method will be called whenever new media is detected. Return true to accept + * the media, or false to reject it (and call rejectMedia). Vendors might override + * this method to handle password-protection for new media. + * + * The default implementation always returns True, indicating media is accepted. + */ + virtual bool validateNewMedia(void); + + /* --- Internally used methods. --- */ + + /* + * @group + * Internally Used Methods + * @discussion + * These methods are used internally, and will not generally be modified. + */ + + /*! + * @function checkForMedia + * @abstract + * Check if media has newly arrived or disappeared. + * @discussion + * This method does most of the work in polling for media, first + * calling the block storage device's reportMediaState method. If + * reportMediaState reports no change in the media state, kIOReturnSuccess + * is returned. If the media state has indeed changed, a call is made to + * mediaStateHasChanged to act on the event. + */ + virtual IOReturn checkForMedia(void); + + /*! + * @function getDeviceTypeName + * @abstract + * Return the desired device name. + * @discussion + * This method returns a string, used to compare the + * kIOBlockStorageDeviceTypeKey of our provider. This method is called from + * probe. + * + * The default implementation of this method returns + * kIOBlockStorageDeviceTypeGeneric. + */ + virtual const char * getDeviceTypeName(void); + + /*! + * @function initMediaState + * @abstract + * Initialize media-related instance variables. + * @discussion + * Called when media is not present, this method marks the device state + * as not having media present, not spun up, and write-enabled. + */ + virtual void initMediaState(void); + + /*! + * @function mediaStateHasChanged + * @abstract + * React to a new media insertion or a media removal. + * @discussion + * This method is called on a media state change, that is, an arrival + * or removal. If media has just become available, calls are made to + * recordMediaParameters and acceptNewMedia. If media has just gone + * away, a call is made to decommissionMedia, with the forcible + * parameter set to true. The forcible tear-down is needed to enforce + * the disappearance of media, regardless of interested clients. + */ + virtual IOReturn mediaStateHasChanged(IOMediaState state); + + /* + * @endgroup + */ + +protected: + + /*! + * @function breakUpRequest + * @discussion + * The breakUpRequest method checks to see if the incoming request exceeds + * our transfer constraints, and if so, breaks up the request into smaller + * sub-requests. + * + * This method is part of a sequence of methods invoked for each read/write + * request. The first is prepareRequest, which allocates and prepares some + * context for the transfer; the second is deblockRequest, which aligns the + * transfer at the media's block boundaries; third is breakUpRequest, which + * breaks up the transfer into multiple sub-transfers when certain hardware + * constraints are exceeded; fourth is executeRequest, which implements the + * actual transfer from the block storage device. + * + * This method's implementation is not typically overridden. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param context + * Additional context information for the data transfer (e.g. block size). + */ + + virtual void breakUpRequest(UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion, + Context * context); + + /*! + * @function prepareRequest + * @discussion + * The prepareRequest method allocates and prepares state for the transfer. + * + * This method is part of a sequence of methods invoked for each read/write + * request. The first is prepareRequest, which allocates and prepares some + * context for the transfer; the second is deblockRequest, which aligns the + * transfer at the media's block boundaries; third is breakUpRequest, which + * breaks up the transfer into multiple sub-transfers when certain hardware + * constraints are exceeded; fourth is executeRequest, which implements the + * actual transfer from the block storage device. + * + * This method's implementation is not typically overridden. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void prepareRequest(UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + +public: + + /*! + * @function requestIdle + * @abstract + * Request that the device enter an idle state. + * @discussion + * Request that the device enter an idle state. The device will exit this state on the + * next read or write request, or as it sees necessary. One example is for a DVD drive + * to spin down when it enters such an idle state, and spin up on the next read request + * from the system. + */ + virtual IOReturn requestIdle(void); + + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 0); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 1); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 2); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 3); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 4); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 5); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 6); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 7); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 8); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 9); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 10); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 11); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 12); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 13); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 14); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 15); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 16); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 17); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 18); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 19); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 20); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 21); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 22); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 23); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 24); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 25); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 26); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 27); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 28); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 29); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 30); + OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBLOCKSTORAGEDRIVER_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOCDBlockStorageDevice.h b/QualcommWireless/include/IOKit/storage/IOCDBlockStorageDevice.h new file mode 100644 index 0000000..f33b85f --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOCDBlockStorageDevice.h @@ -0,0 +1,142 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOCDBlockStorageDevice + * @abstract + * This header contains the IOCDBlockStorageDevice class definition. + */ + +#ifndef _IOCDBLOCKSTORAGEDEVICE_H +#define _IOCDBLOCKSTORAGEDEVICE_H + +#include <IOKit/storage/IOCDTypes.h> + +/*! + * @defined kIOCDBlockStorageDeviceClass + * @abstract + * kIOCDBlockStorageDeviceClass is the name of the IOCDBlockStorageDevice class. + * @discussion + * kIOCDBlockStorageDeviceClass is the name of the IOCDBlockStorageDevice class. + */ + +#define kIOCDBlockStorageDeviceClass "IOCDBlockStorageDevice" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOBlockStorageDevice.h> + +/* Property used for matching, so the generic driver gets the nub it wants. */ +#define kIOBlockStorageDeviceTypeCDROM "CDROM" + +/*! + * @class + * IOCDBlockStorageDevice : public IOBlockStorageDevice + * @abstract + * The IOCDBlockStorageDevice class is a generic CD block storage device + * abstraction. + * @discussion + * This class is the protocol for generic CD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * The APIs are the union of CD (block storage) data APIs and all + * necessary low-level CD APIs. + * + * A subclass implements relay methods that translate our requests into + * calls to a protocol- and device-specific provider. + */ + +class IOCDBlockStorageDevice : public IOBlockStorageDevice { + + OSDeclareAbstractStructors(IOCDBlockStorageDevice) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* Overrides from IORegistryEntry */ + + virtual bool init(OSDictionary * properties); + + /*-----------------------------------------*/ + /* CD APIs */ + /*-----------------------------------------*/ + + virtual IOReturn doAsyncReadCD(IOMemoryDescriptor *buffer, + UInt32 block,UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion) = 0; + virtual UInt32 getMediaType(void) = 0; + virtual IOReturn readISRC(UInt8 track,CDISRC isrc) = 0; + virtual IOReturn readMCN(CDMCN mcn) = 0; + virtual IOReturn readTOC(IOMemoryDescriptor *buffer) = 0; + + /*-----------------------------------------*/ + /* CD APIs */ + /*-----------------------------------------*/ + + virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond) = 0; + + virtual IOReturn setSpeed(UInt16 kilobytesPerSecond) = 0; + + virtual IOReturn readTOC(IOMemoryDescriptor *buffer,CDTOCFormat format, + UInt8 msf,UInt8 trackSessionNumber, + UInt16 *actualByteCount) = 0; + + virtual IOReturn readDiscInfo(IOMemoryDescriptor *buffer, + UInt16 *actualByteCount) = 0; + + virtual IOReturn readTrackInfo(IOMemoryDescriptor *buffer,UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 *actualByteCount) = 0; + + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 0); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 1); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 2); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 3); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 4); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 5); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 6); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 7); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 8); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 9); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 10); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 11); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 12); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 13); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 14); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOCDBLOCKSTORAGEDEVICE_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOCDBlockStorageDriver.h b/QualcommWireless/include/IOKit/storage/IOCDBlockStorageDriver.h new file mode 100644 index 0000000..7be06eb --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOCDBlockStorageDriver.h @@ -0,0 +1,218 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOCDBlockStorageDriver.h + * + * This class implements CD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * A protocol-specific provider implements the functionality using an appropriate + * protocol and commands. + */ + +#ifndef _IOCDBLOCKSTORAGEDRIVER_H +#define _IOCDBLOCKSTORAGEDRIVER_H + +#include <IOKit/IOTypes.h> +#include <IOKit/storage/IOCDBlockStorageDevice.h> +#include <IOKit/storage/IOCDTypes.h> +#include <IOKit/storage/IOBlockStorageDriver.h> + +/* + * @defined kIOCDBlockStorageDriverClass + * @abstract + * kIOCDBlockStorageDriverClass is the name of the IOCDBlockStorageDriver class. + * @discussion + * kIOCDBlockStorageDriverClass is the name of the IOCDBlockStorageDriver class. + */ + +#define kIOCDBlockStorageDriverClass "IOCDBlockStorageDriver" + +class IOCDBlockStorageDriver : public IOBlockStorageDriver { + + OSDeclareDefaultStructors(IOCDBlockStorageDriver) + +public: + + static const UInt64 kBlockSizeCD = 2352; + static const UInt8 kBlockTypeCD = 0x01; + + /* Overrides of IORegistryEntry */ + + virtual bool init(OSDictionary * properties); + virtual void free(void); + + /* Overrides of IOBlockStorageDriver: */ + + virtual IOReturn ejectMedia(void); + virtual void executeRequest(UInt64 byteStart, + IOMemoryDescriptor *buffer, + IOStorageAttributes *attributes, + IOStorageCompletion *completion, + Context *context); + virtual const char * getDeviceTypeName(void); + virtual IOMedia * instantiateDesiredMediaObject(void); + virtual IOMedia * instantiateMediaObject(UInt64 base,UInt64 byteSize, + UInt32 blockSize,char *mediaName); + virtual IOReturn recordMediaParameters(void); + + /* End of IOBlockStorageDriver overrides. */ + + /* + * @function getMediaType + * @abstract + * Get the current type of media inserted in the CD drive. + * @discussion + * Certain I/O operations may not be allowed depending on the type of + * media currently inserted. For example, one cannot issue write operations + * if CD-ROM media is inserted. + * @result + * See the kCDMediaType constants in IOCDTypes.h. + */ + virtual UInt32 getMediaType(void); + + /* -------------------------------------------------*/ + /* APIs implemented here, exported by IOCDMedia: */ + /* -------------------------------------------------*/ + + virtual CDTOC * getTOC(void); + virtual void readCD(IOService *client, + UInt64 byteStart, + IOMemoryDescriptor *buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes *attributes, + IOStorageCompletion *completion); + virtual IOReturn readISRC(UInt8 track,CDISRC isrc); + virtual IOReturn readMCN(CDMCN mcn); + + /* end of IOCDMedia APIs */ + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IOCDBlockStorageDevice. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IOCDBlockStorageDevice * getProvider() const; + +protected: + + /* Overrides of IOBlockStorageDriver behavior. */ + + /* When CD media is inserted, we want to create multiple nubs for the data and + * audio tracks, for sessions, and the entire media. We override the methods + * that manage nubs. + */ + virtual IOReturn acceptNewMedia(void); + virtual IOReturn decommissionMedia(bool forcible); + + /* End of IOBlockStorageDriver overrides. */ + + /* Internally used methods: */ + + using IOBlockStorageDriver::getMediaBlockSize; + + virtual IOReturn cacheTocInfo(void); + virtual UInt64 getMediaBlockSize(CDSectorArea area,CDSectorType type); + virtual void prepareRequest(UInt64 byteStart, + IOMemoryDescriptor *buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes *attributes, + IOStorageCompletion *completion); + + /* ------- */ + + struct ExpansionData + { + UInt32 minBlockNumberAudio; + UInt32 maxBlockNumberAudio; + }; + ExpansionData * _expansionData; + + #define _minBlockNumberAudio \ + IOCDBlockStorageDriver::_expansionData->minBlockNumberAudio + #define _maxBlockNumberAudio \ + IOCDBlockStorageDriver::_expansionData->maxBlockNumberAudio + + UInt32 _reserved0032; + + /* We keep the TOC here because we'll always need it, so what the heck. + * + * There are possible "point" track entries for 0xa0..a2, 0xb0..b4, and 0xc0..0xc1. + * Tracks need not start at 1, as long as they're between 1 and 99, and have contiguous + * numbers. + */ + + CDTOC * _toc; + UInt32 _tocSize; + + /* ------- */ + + IOReturn reportDiscInfo(CDDiscInfo *discInfo); + IOReturn reportTrackInfo(UInt16 track,CDTrackInfo *trackInfo); + +public: + + virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond); + + virtual IOReturn setSpeed(UInt16 kilobytesPerSecond); + + virtual IOReturn readTOC(IOMemoryDescriptor *buffer,CDTOCFormat format, + UInt8 formatAsTime,UInt8 trackOrSessionNumber, + UInt16 *actualByteCount); + + virtual IOReturn readDiscInfo(IOMemoryDescriptor *buffer, + UInt16 *actualByteCount); + + virtual IOReturn readTrackInfo(IOMemoryDescriptor *buffer,UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 *actualByteCount); + + virtual void writeCD(IOService *client, + UInt64 byteStart, + IOMemoryDescriptor *buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes *attributes, + IOStorageCompletion *completion); + + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 0); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 1); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 2); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 3); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 4); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 5); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 6); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 7); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 8); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 9); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 10); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 11); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 12); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 13); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 14); + OSMetaClassDeclareReservedUnused(IOCDBlockStorageDriver, 15); +}; +#endif diff --git a/QualcommWireless/include/IOKit/storage/IOCDMedia.h b/QualcommWireless/include/IOKit/storage/IOCDMedia.h new file mode 100644 index 0000000..9aab27e --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOCDMedia.h @@ -0,0 +1,507 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOCDMedia + * @abstract + * This header contains the IOCDMedia class definition. + */ + +#ifndef _IOCDMEDIA_H +#define _IOCDMEDIA_H + +/*! + * @defined kIOCDMediaClass + * @abstract + * kIOCDMediaClass is the name of the IOCDMedia class. + * @discussion + * kIOCDMediaClass is the name of the IOCDMedia class. + */ + +#define kIOCDMediaClass "IOCDMedia" + +/*! + * @defined kIOCDMediaTOCKey + * @abstract + * kIOCDMediaTOCKey is a property of IOCDMedia objects. It has an OSData value + * and a CDTOC structure. + * @discussion + * The kIOCDMediaTOCKey property contains the CD's full table of contents, + * formatted as a CDTOC structure. The CDTOC structure is same as what is + * returned by a READ TOC command, format 0x02. All fields in the TOC are + * guaranteed to be binary-encoded (no BCD-encoded numbers are ever passed). + */ + +#define kIOCDMediaTOCKey "TOC" + +/*! + * @defined kIOCDMediaTypeKey + * @abstract + * kIOCDMediaTypeKey is a property of IOCDMedia objects. It has an OSString + * value. + * @discussion + * The kIOCDMediaTypeKey property identifies the CD media type (CD-ROM, CD-R, + * CD-RW, etc). See the kIOCDMediaType contants for possible values. + */ + +#define kIOCDMediaTypeKey "Type" + +/*! + * @defined kIOCDMediaTypeROM + * The kIOCDMediaTypeKey constant for CD-ROM media (inclusive of the CD-I, + * CD-ROM XA, and CD Audio standards, and mixed mode combinations thereof). + */ + +#define kIOCDMediaTypeROM "CD-ROM" + +/*! + * @defined kIOCDMediaTypeR + * The kIOCDMediaTypeKey constant for CD Recordable (CD-R) media. + */ + +#define kIOCDMediaTypeR "CD-R" + +/*! + * @defined kIOCDMediaTypeRW + * The kIOCDMediaTypeKey constant for CD ReWritable (CD-RW) media. + */ + +#define kIOCDMediaTypeRW "CD-RW" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOCDBlockStorageDriver.h> +#include <IOKit/storage/IOMedia.h> + +/*! + * @class IOCDMedia + * @abstract + * The IOCDMedia class is a random-access disk device abstraction for CDs. + * @discussion + * The IOCDMedia class is a random-access disk device abstraction for CDs. It + * extends the IOMedia class by implementing special CD APIs, such as readCD, + * and publishing the TOC as a property of the IOCDMedia object. + */ + +class IOCDMedia : public IOMedia +{ + OSDeclareDefaultStructors(IOCDMedia) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + using IOStorage::read; + using IOStorage::write; + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IOCDBlockStorageDriver. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IOCDBlockStorageDriver * getProvider() const; + + /* + * Compare the properties in the supplied table to this object's properties. + */ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + /*! + * @function read + * @discussion + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /* + * @function write + * @discussion + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /*! + * @function readCD + * @discussion + * Read data from the CD media object at the specified byte offset into the + * specified buffer, asynchronously. Special areas of the CD sector can be + * read via this method, such as the header and subchannel data. When the + * read completes, the caller will be notified via the specified completion + * action. + * + * The buffer will be retained for the duration of the read. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer (see sectorArea parameter). + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param sectorArea + * Sector area(s) to read. The sum of each area's size defines the natural + * block size of the media for the call. This should be taken into account + * when computing the address of byteStart. See IOCDTypes.h. + * @param sectorType + * Sector type that is expected. The data transfer is terminated as soon as + * data is encountered that does not match the expected type. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void readCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /*! + * @function readCD + * @discussion + * Read data from the CD media object at the specified byte offset into the + * specified buffer, synchronously. Special areas of the CD sector can be + * read via this method, such as the header and subchannel data. When the + * read completes, this method will return to the caller. The actual byte + * count field is optional. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer (see sectorArea parameter). + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param sectorArea + * Sector area(s) to read. The sum of each area's size defines the natural + * block size of the media for the call. This should be taken into account + * when computing the address of byteStart. See IOCDTypes.h. + * @param sectorType + * Sector type that is expected. The data transfer is terminated as soon as + * data is encountered that does not match the expected type. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes * attributes = 0, + UInt64 * actualByteCount = 0); + + /*! + * @function readISRC + * @discussion + * Read the International Standard Recording Code for the specified track. + * @param track + * Track number from which to read the ISRC. + * @param isrc + * Buffer for the ISRC data. Buffer contents will be zero-terminated. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn readISRC(UInt8 track, CDISRC isrc); + + /*! + * @function readMCN + * @discussion + * Read the Media Catalog Number (also known as the Universal Product Code). + * @param mcn + * Buffer for the MCN data. Buffer contents will be zero-terminated. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn readMCN(CDMCN mcn); + + /*! + * @function getTOC + * @discussion + * Get the full Table Of Contents. + * + * All CDTOC fields passed across I/O Kit APIs are guaranteed to be + * binary-encoded (no BCD-encoded numbers are ever passed). + * @result + * Returns a pointer to the TOC buffer (do not deallocate). + */ + + virtual CDTOC * getTOC(); + + /*! + * @function getSpeed + * @discussion + * Get the current speed used for data transfers. + * @param kilobytesPerSecond + * Returns the current speed used for data transfers, in kB/s. + * + * kCDSpeedMin specifies the minimum speed for all CD media (1X). + * kCDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond); + + /*! + * @function setSpeed + * @discussion + * Set the speed to be used for data transfers. + * @param kilobytesPerSecond + * Speed to be used for data transfers, in kB/s. + * + * kCDSpeedMin specifies the minimum speed for all CD media (1X). + * kCDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setSpeed(UInt16 kilobytesPerSecond); + + /*! + * @function readTOC + * @discussion + * Issue an MMC READ TOC/PMA/ATIP command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param format + * As documented by MMC. + * @param formatAsTime + * As documented by MMC. + * @param trackOrSessionNumber + * As documented by MMC. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readTOC(IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 formatAsTime, + UInt8 trackOrSessionNumber, + UInt16 * actualByteCount); + + /*! + * @function readDiscInfo + * @discussion + * Issue an MMC READ DISC INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readDiscInfo(IOMemoryDescriptor * buffer, + UInt16 * actualByteCount); + + /*! + * @function readTrackInfo + * @discussion + * Issue an MMC READ TRACK INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param address + * As documented by MMC. + * @param addressType + * As documented by MMC. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readTrackInfo(IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount); + + /* + * @function writeCD + * @discussion + * Write data into the CD media object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer (see sectorArea parameter). + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param sectorArea + * Sector area(s) to write. The sum of each area's size defines the natural + * block size of the media for the call. This should be taken into account + * when computing the address of byteStart. See IOCDTypes.h. + * @param sectorType + * Sector type that is expected. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void writeCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /* + * @function writeCD + * @discussion + * Write data into the CD media object at the specified byte offset from the + * specified buffer, synchronously. When the write completes, this method + * will return to the caller. The actual byte count field is optional. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer (see sectorArea parameter). + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param sectorArea + * Sector area(s) to write. The sum of each area's size defines the natural + * block size of the media for the call. This should be taken into account + * when computing the address of byteStart. See IOCDTypes.h. + * @param sectorType + * Sector type that is expected. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn writeCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes * attributes = 0, + UInt64 * actualByteCount = 0); + + OSMetaClassDeclareReservedUnused(IOCDMedia, 0); + OSMetaClassDeclareReservedUnused(IOCDMedia, 1); + OSMetaClassDeclareReservedUnused(IOCDMedia, 2); + OSMetaClassDeclareReservedUnused(IOCDMedia, 3); + OSMetaClassDeclareReservedUnused(IOCDMedia, 4); + OSMetaClassDeclareReservedUnused(IOCDMedia, 5); + OSMetaClassDeclareReservedUnused(IOCDMedia, 6); + OSMetaClassDeclareReservedUnused(IOCDMedia, 7); + OSMetaClassDeclareReservedUnused(IOCDMedia, 8); + OSMetaClassDeclareReservedUnused(IOCDMedia, 9); + OSMetaClassDeclareReservedUnused(IOCDMedia, 10); + OSMetaClassDeclareReservedUnused(IOCDMedia, 11); + OSMetaClassDeclareReservedUnused(IOCDMedia, 12); + OSMetaClassDeclareReservedUnused(IOCDMedia, 13); + OSMetaClassDeclareReservedUnused(IOCDMedia, 14); + OSMetaClassDeclareReservedUnused(IOCDMedia, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOCDMEDIA_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOCDMediaBSDClient.h b/QualcommWireless/include/IOKit/storage/IOCDMediaBSDClient.h new file mode 100644 index 0000000..d5acdcf --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOCDMediaBSDClient.h @@ -0,0 +1,199 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOCDMEDIABSDCLIENT_H +#define _IOCDMEDIABSDCLIENT_H + +#include <sys/ioctl.h> + +#include <IOKit/storage/IOCDTypes.h> + +/* + * Definitions + * + * ioctl description + * ---------------------------- ------------------------------------------------ + * DKIOCCDREAD see IOCDMedia::readCD() in IOCDMedia.h + * DKIOCCDREADTOC see IOCDMedia::readTOC() in IOCDMedia.h + * + * DKIOCCDREADDISCINFO see IOCDMedia::readDiscInfo() in IOCDMedia.h + * DKIOCCDREADTRACKINFO see IOCDMedia::readTrackInfo() in IOCDMedia.h + * + * DKIOCCDREADISRC see IOCDMedia::readISRC() in IOCDMedia.h + * DKIOCCDREADMCN see IOCDMedia::readMCN() in IOCDMedia.h + * + * DKIOCCDGETSPEED see IOCDMedia::getSpeed() in IOCDMedia.h + * DKIOCCDSETSPEED see IOCDMedia::setSpeed() in IOCDMedia.h + * + * in /System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/ + */ + +typedef struct +{ + uint64_t offset; + + uint8_t sectorArea; + uint8_t sectorType; + +#ifdef __LP64__ + uint8_t reserved0080[10]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0080[6]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint32_t bufferLength; /* actual length on return */ + void * buffer; +} dk_cd_read_t; + +typedef struct +{ + CDISRC isrc; + uint8_t track; + + uint8_t reserved0112[2]; /* reserved, clear to zero */ +} dk_cd_read_isrc_t; + +typedef struct +{ + CDMCN mcn; + + uint8_t reserved0112[2]; /* reserved, clear to zero */ +} dk_cd_read_mcn_t; + +typedef struct +{ + uint8_t format; + uint8_t formatAsTime; + + uint8_t reserved0016[5]; /* reserved, clear to zero */ + + union + { + uint8_t session; + uint8_t track; + } address; + +#ifdef __LP64__ + uint8_t reserved0064[6]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0064[2]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_cd_read_toc_t; + +typedef struct +{ +#ifdef __LP64__ + uint8_t reserved0000[14]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0000[10]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_cd_read_disc_info_t; + +typedef struct +{ + uint8_t reserved0000[4]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t addressType; + +#ifdef __LP64__ + uint8_t reserved0072[5]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0072[1]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_cd_read_track_info_t; + +#define DKIOCCDREAD _IOWR('d', 96, dk_cd_read_t) + +#define DKIOCCDREADISRC _IOWR('d', 97, dk_cd_read_isrc_t) +#define DKIOCCDREADMCN _IOWR('d', 98, dk_cd_read_mcn_t) + +#define DKIOCCDGETSPEED _IOR('d', 99, uint16_t) +#define DKIOCCDSETSPEED _IOW('d', 99, uint16_t) + +#define DKIOCCDREADTOC _IOWR('d', 100, dk_cd_read_toc_t) + +#define DKIOCCDREADDISCINFO _IOWR('d', 101, dk_cd_read_disc_info_t) +#define DKIOCCDREADTRACKINFO _IOWR('d', 102, dk_cd_read_track_info_t) + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOCDMedia.h> +#include <IOKit/storage/IOMediaBSDClient.h> + +/* + * Class + */ + +class IOCDMediaBSDClient : public IOMediaBSDClient +{ + OSDeclareDefaultStructors(IOCDMediaBSDClient) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of IOService -- IOCDMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOCDMedia * getProvider() const; + + /* + * Process a CD-specific ioctl. + */ + + virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc); + + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 0); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 1); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 2); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 3); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 4); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 5); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 6); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 7); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOCDMEDIABSDCLIENT_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOCDPartitionScheme.h b/QualcommWireless/include/IOKit/storage/IOCDPartitionScheme.h new file mode 100644 index 0000000..1c9cd93 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOCDPartitionScheme.h @@ -0,0 +1,226 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * @header IOCDPartitionScheme + * @abstract + * This header contains the IOCDPartitionScheme class definition. + */ + +#ifndef _IOCDPARTITIONSCHEME_H +#define _IOCDPARTITIONSCHEME_H + +#include <IOKit/storage/IOCDTypes.h> + +/* + * @defined kIOCDPartitionSchemeClass + * @abstract + * kIOCDPartitionSchemeClass is the name of the IOCDPartitionScheme class. + * @discussion + * kIOCDPartitionSchemeClass is the name of the IOCDPartitionScheme class. + */ + +#define kIOCDPartitionSchemeClass "IOCDPartitionScheme" + +/* + * @defined kIOMediaSessionIDKey + * @abstract + * kIOMediaSessionIDKey is property of IOMedia objects. It has an OSNumber + * value. + * @discussion + * The kIOMediaSessionIDKey property is placed into each IOMedia instance + * created by the CD partition scheme. It identifies the session number + * the track was recorded on. + */ + +#define kIOMediaSessionIDKey "Session ID" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOCDMedia.h> +#include <IOKit/storage/IOPartitionScheme.h> + +/* + * Class + */ + +class IOCDPartitionScheme : public IOPartitionScheme +{ + OSDeclareDefaultStructors(IOCDPartitionScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + OSSet * _partitions; /* (set of media objects representing partitions) */ + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(void); + + /* + * Scan the provider media for CD partitions (in TOC). Returns the set + * of media objects representing each of the partitions (the retain for + * the set is passed to the caller), or null should no CD partitions be + * found. The default probe score can be adjusted up or down, based on + * the confidence of the scan. + */ + + virtual OSSet * scan(SInt32 * score); + + /* + * Ask whether the given partition appears to be corrupt. A partition that + * is corrupt will cause the failure of the CD partition scheme altogether. + */ + + virtual bool isPartitionCorrupt( CDTOCDescriptor * partition, + UInt64 partitionSize, + UInt32 partitionBlockSize, + CDSectorType partitionBlockType, + CDTOC * toc ); + + /* + * Ask whether the given partition appears to be invalid. A partition that + * is invalid will cause it to be skipped in the scan, but will not cause a + * failure of the CD partition scheme. + */ + + virtual bool isPartitionInvalid( CDTOCDescriptor * partition, + UInt64 partitionSize, + UInt32 partitionBlockSize, + CDSectorType partitionBlockType, + CDTOC * toc ); + + /* + * Instantiate a new media object to represent the given partition. + */ + + virtual IOMedia * instantiateMediaObject( + CDTOCDescriptor * partition, + UInt64 partitionSize, + UInt32 partitionBlockSize, + CDSectorType partitionBlockType, + CDTOC * toc ); + + /* + * Allocate a new media object (called from instantiateMediaObject). + */ + + virtual IOMedia * instantiateDesiredMediaObject( + CDTOCDescriptor * partition, + UInt64 partitionSize, + UInt32 partitionBlockSize, + CDSectorType partitionBlockType, + CDTOC * toc ); + +public: + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0); + + /* + * Scan the provider media for CD partitions. + */ + + virtual IOService * probe(IOService * provider, SInt32 * score); + + /* + * Determine whether the provider media contains CD partitions. + */ + + virtual bool start(IOService * provider); + + /* + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * + * For the CD partition scheme, we convert the read from a partition + * object into the appropriate readCD command to our provider media. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /* + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * + * For the CD partition scheme, we convert the write from a partition + * object into the appropriate writeCD command to our provider media. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of OSObject -- IOCDMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOCDMedia * getProvider() const; + + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 0); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 1); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 2); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 3); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 4); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 5); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 6); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 7); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 8); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 9); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 10); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 11); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 12); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 13); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 14); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOCDPARTITIONSCHEME_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOCDTypes.h b/QualcommWireless/include/IOKit/storage/IOCDTypes.h new file mode 100644 index 0000000..db1be39 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOCDTypes.h @@ -0,0 +1,492 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOCDTYPES_H +#define _IOCDTYPES_H + +#include <IOKit/IOTypes.h> +#include <libkern/OSByteOrder.h> + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* + * Minutes, Seconds, Frames (M:S:F) + * + * All M:S:F values passed across I/O Kit APIs are guaranteed to be + * binary-encoded numbers (no BCD-encoded numbers are ever passed). + */ + +typedef struct +{ + UInt8 minute; + UInt8 second; + UInt8 frame; +} CDMSF; + +/* + * Media Catalogue Numbers (MCN), International Standard Recording Codes (ISRC) + * + * All MCN and ISRC values passed across I/O Kit APIs are guaranteed + * to have a zero-terminating byte, for convenient use as C strings. + */ + +#define kCDMCNMaxLength 13 +#define kCDISRCMaxLength 12 + +typedef char CDMCN [kCDMCNMaxLength + 1]; +typedef char CDISRC[kCDISRCMaxLength + 1]; + +/* + * Audio Status + * + * All CDAudioStatus fields passed across I/O Kit APIs are guaranteed to + * be binary-encoded numbers (no BCD-encoded numbers are ever passed). + */ + +#define kCDAudioStatusUnsupported 0x00 +#define kCDAudioStatusActive 0x11 +#define kCDAudioStatusPaused 0x12 +#define kCDAudioStatusSuccess 0x13 +#define kCDAudioStatusFailure 0x14 +#define kCDAudioStatusNone 0x15 + +typedef struct +{ + UInt8 status; + struct + { + CDMSF time; + struct + { + UInt8 index; + UInt8 number; + CDMSF time; + } track; + } position; +} CDAudioStatus; + +/* + * Table Of Contents + * + * All CDTOC fields passed across I/O Kit APIs are guaranteed to be + * binary-encoded numbers (no BCD-encoded numbers are ever passed). + */ + +typedef struct +{ + UInt8 session; +#ifdef __LITTLE_ENDIAN__ + UInt8 control:4, adr:4; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 adr:4, control:4; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 tno; + UInt8 point; + CDMSF address; + UInt8 zero; + CDMSF p; +} CDTOCDescriptor; + +typedef struct +{ + UInt16 length; + UInt8 sessionFirst; + UInt8 sessionLast; + CDTOCDescriptor descriptors[0]; +} CDTOC; + +/* + * Table Of Contents Descriptor Count Convenience Function + */ + +static inline UInt32 CDTOCGetDescriptorCount(CDTOC * toc) +{ + UInt32 tocSize = OSSwapBigToHostInt16(toc->length) + (UInt32) sizeof(toc->length); + + return (tocSize < (UInt32) sizeof(CDTOC)) ? 0 : + (tocSize - (UInt32) sizeof(CDTOC)) / (UInt32) sizeof(CDTOCDescriptor); +} + +/* + * M:S:F To LBA Convenience Function + */ + +static inline UInt32 CDConvertMSFToLBA(CDMSF msf) +{ + return (((msf.minute * 60U) + msf.second) * 75U) + msf.frame - 150U; +} + +/* + * M:S:F To Clipped LBA Convenience Function + */ + +static inline UInt32 CDConvertMSFToClippedLBA(CDMSF msf) +{ + return (msf.minute == 0 && msf.second <= 1) ? 0 : CDConvertMSFToLBA(msf); +} + +/* + * LBA To M:S:F Convenience Function + */ + +static inline CDMSF CDConvertLBAToMSF(UInt32 lba) +{ + CDMSF msf; + + lba += 150; + msf.minute = (lba / (75 * 60)); + msf.second = (lba % (75 * 60)) / 75; + msf.frame = (lba % (75 )); + + return msf; +} + +/* + * Track Number To M:S:F Convenience Function + * + * The CDTOC structure is assumed to be complete, that is, none of + * the descriptors are missing or clipped due to an insufficiently + * sized buffer holding the CDTOC contents. + */ + +static inline CDMSF CDConvertTrackNumberToMSF(UInt8 track, CDTOC * toc) +{ + UInt32 count = CDTOCGetDescriptorCount(toc); + UInt32 i; + CDMSF msf = { 0xFF, 0xFF, 0xFF }; + + for (i = 0; i < count; i++) + { + if (toc->descriptors[i].point == track && toc->descriptors[i].adr == 1) + { + msf = toc->descriptors[i].p; + break; + } + } + + return msf; +} + +/* + * Sector Areas, Sector Types + * + * Bytes Per Type CDDA Mode1 Mode2 Mode2Form1 Mode2Form2 + * Per Area +----------+----------+----------+----------+----------+ + * Sync | 0 | 12 | 12 | 12 | 12 | + * Header | 0 | 4 | 4 | 4 | 4 | + * SubHeader | 0 | 0 | 0 | 8 | 8 | + * User | 2352 | 2048 | 2336 | 2048 | 2328 | + * Auxiliary | 0 | 288 | 0 | 280 | 0 | + * ErrorFlags | 294 | 294 | 294 | 294 | 294 | + * SubChannel | 96 | 96 | 96 | 96 | 96 | + * SubChannelQ | 16 | 16 | 16 | 16 | 16 | + * +----------+----------+----------+----------+----------+ + */ + +typedef enum +{ + kCDSectorAreaSync = 0x80, + kCDSectorAreaHeader = 0x20, + kCDSectorAreaSubHeader = 0x40, + kCDSectorAreaUser = 0x10, + kCDSectorAreaAuxiliary = 0x08, + kCDSectorAreaErrorFlags = 0x02, + kCDSectorAreaSubChannel = 0x01, + kCDSectorAreaSubChannelQ = 0x04 +} CDSectorArea; + +typedef enum +{ + kCDSectorTypeUnknown = 0x00, + kCDSectorTypeCDDA = 0x01, + kCDSectorTypeMode1 = 0x02, + kCDSectorTypeMode2 = 0x03, + kCDSectorTypeMode2Form1 = 0x04, + kCDSectorTypeMode2Form2 = 0x05, + kCDSectorTypeCount = 0x06 +} CDSectorType; + +typedef enum +{ + kCDSectorSizeCDDA = 2352, + kCDSectorSizeMode1 = 2048, + kCDSectorSizeMode2 = 2336, + kCDSectorSizeMode2Form1 = 2048, + kCDSectorSizeMode2Form2 = 2328, + kCDSectorSizeWhole = 2352 +} CDSectorSize; + +/* + * Media Types + */ + +enum +{ + kCDMediaTypeUnknown = 0x0100, + kCDMediaTypeROM = 0x0102, /* CD-ROM */ + kCDMediaTypeR = 0x0104, /* CD-R */ + kCDMediaTypeRW = 0x0105, /* CD-RW */ + + kCDMediaTypeMin = 0x0100, + kCDMediaTypeMax = 0x01FF +}; + +typedef UInt32 CDMediaType; + +/* + * Media Speed (kB/s) + */ + +#define kCDSpeedMin 0x00B0 +#define kCDSpeedMax 0xFFFF + +/* + * MMC Formats + */ + +// Read Table Of Contents Format Types +typedef UInt8 CDTOCFormat; +enum +{ + kCDTOCFormatTOC = 0x02, // CDTOC + kCDTOCFormatPMA = 0x03, // CDPMA + kCDTOCFormatATIP = 0x04, // CDATIP + kCDTOCFormatTEXT = 0x05 // CDTEXT +}; + +// Read Table Of Contents Format 0x03 +struct CDPMADescriptor +{ + UInt8 reserved; +#ifdef __LITTLE_ENDIAN__ + UInt8 control:4, adr:4; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 adr:4, control:4; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 tno; + UInt8 point; + CDMSF address; + UInt8 zero; + CDMSF p; +}; +typedef struct CDPMADescriptor CDPMADescriptor; + +struct CDPMA +{ + UInt16 dataLength; + UInt8 reserved; + UInt8 reserved2; + CDPMADescriptor descriptors[0]; +}; +typedef struct CDPMA CDPMA; + +// Read Table Of Contents Format 0x04 +struct CDATIP +{ + UInt16 dataLength; + UInt8 reserved[2]; +#ifdef __LITTLE_ENDIAN__ + UInt8 referenceSpeed:3; + UInt8 reserved3:1; + UInt8 indicativeTargetWritingPower:3; + UInt8 reserved2:1; + + UInt8 reserved5:6; + UInt8 unrestrictedUse:1; + UInt8 reserved4:1; + + UInt8 a3Valid:1; + UInt8 a2Valid:1; + UInt8 a1Valid:1; + UInt8 discSubType:3; + UInt8 discType:1; + UInt8 reserved6:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved2:1; + UInt8 indicativeTargetWritingPower:3; + UInt8 reserved3:1; + UInt8 referenceSpeed:3; + + UInt8 reserved4:1; + UInt8 unrestrictedUse:1; + UInt8 reserved5:6; + + UInt8 reserved6:1; + UInt8 discType:1; + UInt8 discSubType:3; + UInt8 a1Valid:1; + UInt8 a2Valid:1; + UInt8 a3Valid:1; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 reserved7; + CDMSF startTimeOfLeadIn; + UInt8 reserved8; + CDMSF lastPossibleStartTimeOfLeadOut; + UInt8 reserved9; + UInt8 a1[3]; + UInt8 reserved10; + UInt8 a2[3]; + UInt8 reserved11; + UInt8 a3[3]; + UInt8 reserved12; +}; +typedef struct CDATIP CDATIP; + +// Read Table Of Contents Format 0x05 +struct CDTEXTDescriptor +{ + UInt8 packType; + UInt8 trackNumber; + UInt8 sequenceNumber; +#ifdef __LITTLE_ENDIAN__ + UInt8 characterPosition:4; + UInt8 blockNumber:3; + UInt8 doubleByteCharacterCode:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 doubleByteCharacterCode:1; + UInt8 blockNumber:3; + UInt8 characterPosition:4; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 textData[12]; + UInt8 reserved[2]; +}; +typedef struct CDTEXTDescriptor CDTEXTDescriptor; + +struct CDTEXT +{ + UInt16 dataLength; + UInt8 reserved; + UInt8 reserved2; + CDTEXTDescriptor descriptors[0]; +}; +typedef struct CDTEXT CDTEXT; + +// Read Disc Information Format +struct CDDiscInfo +{ + UInt16 dataLength; +#ifdef __LITTLE_ENDIAN__ + UInt8 discStatus:2; + UInt8 stateOfLastSession:2; + UInt8 erasable:1; + UInt8 reserved:3; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved:3; + UInt8 erasable:1; + UInt8 stateOfLastSession:2; + UInt8 discStatus:2; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 numberOfFirstTrack; + UInt8 numberOfSessionsLSB; + UInt8 firstTrackNumberInLastSessionLSB; + UInt8 lastTrackNumberInLastSessionLSB; +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved3:5; + UInt8 unrestrictedUse:1; + UInt8 discBarCodeValid:1; + UInt8 discIdentificationValid:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 discIdentificationValid:1; + UInt8 discBarCodeValid:1; + UInt8 unrestrictedUse:1; + UInt8 reserved3:5; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 discType; + UInt8 numberOfSessionsMSB; + UInt8 firstTrackNumberInLastSessionMSB; + UInt8 lastTrackNumberInLastSessionMSB; + UInt32 discIdentification; + UInt8 reserved7; + CDMSF lastSessionLeadInStartTime; + UInt8 reserved8; + CDMSF lastPossibleStartTimeOfLeadOut; + UInt8 discBarCode[8]; + UInt8 reserved9; + UInt8 numberOfOPCTableEntries; + UInt8 opcTableEntries[0]; +}; +typedef struct CDDiscInfo CDDiscInfo; + +// Read Track Information Address Types +typedef UInt8 CDTrackInfoAddressType; +enum +{ + kCDTrackInfoAddressTypeLBA = 0x00, + kCDTrackInfoAddressTypeTrackNumber = 0x01, + kCDTrackInfoAddressTypeSessionNumber = 0x02, +}; + +// Read Track Information Format +struct CDTrackInfo +{ + UInt16 dataLength; + UInt8 trackNumberLSB; + UInt8 sessionNumberLSB; + UInt8 reserved; +#ifdef __LITTLE_ENDIAN__ + UInt8 trackMode:4; + UInt8 copy:1; + UInt8 damage:1; + UInt8 reserved3:2; + + UInt8 dataMode:4; + UInt8 fixedPacket:1; + UInt8 packet:1; + UInt8 blank:1; + UInt8 reservedTrack:1; + + UInt8 nextWritableAddressValid:1; + UInt8 lastRecordedAddressValid:1; + UInt8 reserved5:6; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved3:2; + UInt8 damage:1; + UInt8 copy:1; + UInt8 trackMode:4; + + UInt8 reservedTrack:1; + UInt8 blank:1; + UInt8 packet:1; + UInt8 fixedPacket:1; + UInt8 dataMode:4; + + UInt8 reserved5:6; + UInt8 lastRecordedAddressValid:1; + UInt8 nextWritableAddressValid:1; +#endif /* !__LITTLE_ENDIAN__ */ + UInt32 trackStartAddress; + UInt32 nextWritableAddress; + UInt32 freeBlocks; + UInt32 fixedPacketSize; + UInt32 trackSize; + UInt32 lastRecordedAddress; + UInt8 trackNumberMSB; + UInt8 sessionNumberMSB; + UInt8 reserved6; + UInt8 reserved7; +}; +typedef struct CDTrackInfo CDTrackInfo; + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* _IOCDTYPES_H */ diff --git a/QualcommWireless/include/IOKit/storage/IODVDBlockStorageDevice.h b/QualcommWireless/include/IOKit/storage/IODVDBlockStorageDevice.h new file mode 100644 index 0000000..7198d8e --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IODVDBlockStorageDevice.h @@ -0,0 +1,140 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IODVDBlockStorageDevice + * @abstract + * This header contains the IODVDBlockStorageDevice class definition. + */ + +#ifndef _IODVDBLOCKSTORAGEDEVICE_H +#define _IODVDBLOCKSTORAGEDEVICE_H + +#include <IOKit/storage/IODVDTypes.h> + +/*! + * @defined kIODVDBlockStorageDeviceClass + * @abstract + * kIODVDBlockStorageDeviceClass is the name of the IODVDBlockStorageDevice class. + * @discussion + * kIODVDBlockStorageDeviceClass is the name of the IODVDBlockStorageDevice class. + */ + +#define kIODVDBlockStorageDeviceClass "IODVDBlockStorageDevice" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOCDBlockStorageDevice.h> + +/* Property used for matching, so the generic driver gets the nub it wants. */ +#define kIOBlockStorageDeviceTypeDVD "DVD" + +/*! + * @class + * IODVDBlockStorageDevice : public IOCDBlockStorageDevice + * @abstract + * The IODVDBlockStorageDevice class is a generic DVD block storage device + * abstraction. + * @discussion + * This class is the protocol for generic DVD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * The APIs are the union of CD APIs and all + * necessary new low-level DVD APIs. + * + * A subclass implements relay methods that translate our requests into + * calls to a protocol- and device-specific provider. + */ + +class IODVDBlockStorageDevice : public IOCDBlockStorageDevice { + + OSDeclareAbstractStructors(IODVDBlockStorageDevice) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* Overrides from IORegistryEntry */ + + virtual bool init(OSDictionary * properties); + + /* New APIs for DVD */ + + virtual IOReturn reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt32 lba,const UInt8 agid,const DVDKeyFormat keyFormat) __attribute__ ((deprecated)); + + virtual IOReturn sendKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt8 agid,const DVDKeyFormat keyFormat) = 0; + + virtual IOReturn readDVDStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format, + const UInt32 address,const UInt8 layer,const UInt8 agid) = 0; + + virtual IOReturn reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt32 lba,const UInt8 blockCount, + const UInt8 agid,const DVDKeyFormat keyFormat); /* 10.12.0 */ + + OSMetaClassDeclareReservedUsed(IODVDBlockStorageDevice, 0); /* reportKey */ + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 1); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 2); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 3); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 4); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 5); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 6); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 7); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 8); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 9); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 10); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 11); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 12); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 13); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 14); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 15); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 16); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 17); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 18); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 19); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 20); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 21); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 22); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 23); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 24); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 25); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 26); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 27); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 28); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 29); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 30); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IODVDBLOCKSTORAGEDEVICE_H */ diff --git a/QualcommWireless/include/IOKit/storage/IODVDBlockStorageDriver.h b/QualcommWireless/include/IOKit/storage/IODVDBlockStorageDriver.h new file mode 100644 index 0000000..7b21b8b --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IODVDBlockStorageDriver.h @@ -0,0 +1,239 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IODVDBlockStorageDriver.h + * + * This class implements DVD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * A protocol-specific provider implements the functionality using an appropriate + * protocol and commands. + */ + +#ifndef _IODVDBLOCKSTORAGEDRIVER_H +#define _IODVDBLOCKSTORAGEDRIVER_H + +#include <IOKit/IOTypes.h> +#include <IOKit/storage/IOCDBlockStorageDriver.h> +#include <IOKit/storage/IODVDBlockStorageDevice.h> +#include <IOKit/storage/IODVDTypes.h> + +/* + * @defined kIODVDBlockStorageDriverClass + * @abstract + * kIODVDBlockStorageDriverClass is the name of the IODVDBlockStorageDriver class. + * @discussion + * kIODVDBlockStorageDriverClass is the name of the IODVDBlockStorageDriver class. + */ + +#define kIODVDBlockStorageDriverClass "IODVDBlockStorageDriver" + +class IODVDBlockStorageDevice; + +/* + * @class + * IODVDBlockStorageDriver : public IOCDBlockStorageDriver + * @abstract + * Generic DVD Driver. + * @discussion + * Storage drivers are split into two parts: the Generic Driver handles + * all generic device issues, independent of the lower-level transport + * mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations + * at the Generic Driver level are translated into a series of generic + * device operations. These operations are passed via the Device Nub + * to a Transport Driver, which implements the appropriate + * transport-dependent protocol to execute these operations. + * + * To determine the write-protect state of a device (or media), for + * example, the generic driver would issue a call to the + * Transport Driver's reportWriteProtection method. If this were a SCSI + * device, its Transport Driver would issue a Mode Sense command to + * extract the write-protection status bit. The Transport Driver then + * reports true or false to the generic driver. + * + * The generic driver therefore has no knowledge of, or involvement + * with, the actual commands and mechanisms used to communicate with + * the device. It is expected that the generic driver will rarely, if + * ever, need to be subclassed to handle device idiosyncrasies; rather, + * the Transport Driver should be changed via overrides. + * + * A generic driver could be subclassed to create a different type of + * generic device. The generic driver IODVDBlockStorageDriver class is a subclass + * of IOCDBlockStorageDriver, adding DVD functions. Similarly, the Transport Driver + * IODVDBlockStorageDevice is a subclass of IOCDBlockStorageDevice, adding DVD + * functions. +*/ + +class IODVDBlockStorageDriver : public IOCDBlockStorageDriver { + + OSDeclareDefaultStructors(IODVDBlockStorageDriver) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + /* Overrides of IOCDBlockStorageDriver. */ + + virtual IOReturn acceptNewMedia(void); + + /* End of IOCDBlockStorageDriver overrides. */ + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IODVDBlockStorageDevice. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IODVDBlockStorageDevice * getProvider() const; + + /* Overrides of IOCDBlockStorageDriver: */ + + virtual const char * getDeviceTypeName(void); + virtual IOMedia * instantiateDesiredMediaObject(void); + virtual IOMedia * instantiateMediaObject(UInt64 base,UInt64 byteSize, + UInt32 blockSize,char *mediaName); + + /* End of IOCDBlockStorageDriver overrides. */ + + /* + * @function reportKey + * @abstract + * Get key info from the DVD drive. + * @discussion + * This function handles the getting of key- and encryption-related data for the drive. + * @param buffer + * A buffer containing information, as documented in the specification + * "MtFuji Commands For Multimedia Devices." + * @param keyClass + * As documented by MtFuji. See DVDKeyClass. + * @param lba + * As documented by MtFuji. + * @param agid + * As documented by MtFuji. + * @param keyFormat + * As documented by MtFuji. See DVDKeyFormat. + */ + virtual IOReturn reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt32 lba,const UInt8 agid,const DVDKeyFormat keyFormat) __attribute__ ((deprecated)); + + /* + * @function sendKey + * @abstract + * Send key info to the DVD drive. + * @discussion + * This function handles the setting of key- and encryption-related data for the drive. + * @param buffer + * A buffer containing information, as documented in the specification + * "MtFuji Commands For Multimedia Devices." + * @param keyClass + * As documented by MtFuji. See DVDKeyClass. + * @param agid + * As documented by MtFuji. + * @param keyFormat + * As documented by MtFuji. See DVDKeyFormat. + */ + virtual IOReturn sendKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt8 agid,const DVDKeyFormat keyFormat); + + /* + * @function readStructure + * @abstract + * Get control structures from the DVD media. + * @discussion + * This function handles the getting of control structure data for the media. + * @param buffer + * A buffer containing information, as documented in the specification + * "MtFuji Commands For Multimedia Devices." + * @param format + * As documented by MtFuji. See DVDStructureFormat. + * @param address + * As documented by MtFuji. + * @param layer + * As documented by MtFuji. + * @param agid + * As documented by MtFuji. + */ + virtual IOReturn readStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format, + const UInt32 address,const UInt8 layer,const UInt8 agid); + + /* + * @function reportKey + * @abstract + * Get key info from the DVD drive. + * @discussion + * This function handles the getting of key- and encryption-related data for the drive. + * @param buffer + * A buffer containing information, as documented in the specification + * "MtFuji Commands For Multimedia Devices." + * @param keyClass + * As documented by MtFuji. See DVDKeyClass. + * @param lba + * As documented by MtFuji. + * @param blockCount + * As documented by MMC + * @param agid + * As documented by MtFuji. + * @param keyFormat + * As documented by MtFuji. See DVDKeyFormat. + */ + virtual IOReturn reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt32 lba,const UInt8 blockCount, + const UInt8 agid,const DVDKeyFormat keyFormat); + + OSMetaClassDeclareReservedUsed(IODVDBlockStorageDriver, 0); /* reportKey */ + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 1); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 2); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 3); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 4); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 5); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 6); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 7); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 8); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 9); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 10); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 11); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 12); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 13); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 14); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 15); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 16); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 17); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 18); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 19); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 20); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 21); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 22); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 23); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 24); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 25); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 26); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 27); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 28); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 29); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 30); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 31); +}; +#endif diff --git a/QualcommWireless/include/IOKit/storage/IODVDMedia.h b/QualcommWireless/include/IOKit/storage/IODVDMedia.h new file mode 100644 index 0000000..8745ce0 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IODVDMedia.h @@ -0,0 +1,366 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IODVDMedia + * @abstract + * This header contains the IODVDMedia class definition. + */ + +#ifndef _IODVDMEDIA_H +#define _IODVDMEDIA_H + +/*! + * @defined kIODVDMediaClass + * @abstract + * kIODVDMediaClass is the name of the IODVDMedia class. + * @discussion + * kIODVDMediaClass is the name of the IODVDMedia class. + */ + +#define kIODVDMediaClass "IODVDMedia" + +/*! + * @defined kIODVDMediaTypeKey + * @abstract + * kIODVDMediaTypeKey is a property of IODVDMedia objects. It has an OSString + * value. + * @discussion + * The kIODVDMediaTypeKey property identifies the DVD media type (DVD-ROM, + * DVD-R, DVD-RW, DVD+RW, DVD-RAM, etc). See the kIODVDMediaType contants + * for possible values. + */ + +#define kIODVDMediaTypeKey "Type" + +/*! + * @defined kIODVDMediaTypeROM + * The kIODVDMediaTypeKey constant for DVD-ROM media. + */ + +#define kIODVDMediaTypeROM "DVD-ROM" + +/*! + * @defined kIODVDMediaTypeR + * The kIODVDMediaTypeKey constant for DVD Recordable (DVD-R) media. + */ + +#define kIODVDMediaTypeR "DVD-R" + +/*! + * @defined kIODVDMediaTypeRW + * The kIODVDMediaTypeKey constant for DVD ReWritable (DVD-RW) media. + */ + +#define kIODVDMediaTypeRW "DVD-RW" + +/*! + * @defined kIODVDMediaTypePlusR + * The kIODVDMediaTypeKey constant for DVD "Plus" Recordable (DVD+R) media. + */ + +#define kIODVDMediaTypePlusR "DVD+R" + +/*! + * @defined kIODVDMediaTypePlusRW + * The kIODVDMediaTypeKey constant for DVD "Plus" ReWritable (DVD+RW) media. + */ + +#define kIODVDMediaTypePlusRW "DVD+RW" + +/*! + * @defined kIODVDMediaTypeRAM + * The kIODVDMediaTypeKey constant for DVD-RAM media. + */ + +#define kIODVDMediaTypeRAM "DVD-RAM" + +/*! + * @defined kIODVDMediaTypeHDROM + * The kIODVDMediaTypeKey constant for HD DVD-ROM media. + */ + +#define kIODVDMediaTypeHDROM "HD DVD-ROM" + +/*! + * @defined kIODVDMediaTypeHDR + * The kIODVDMediaTypeKey constant for HD DVD Recordable (HD DVD-R) media. + */ + +#define kIODVDMediaTypeHDR "HD DVD-R" + +/*! + * @defined kIODVDMediaTypeHDRW + * The kIODVDMediaTypeKey constant for HD DVD ReWritable (HD DVD-RW) media. + */ + +#define kIODVDMediaTypeHDRW "HD DVD-RW" + +/*! + * @defined kIODVDMediaTypeHDRAM + * The kIODVDMediaTypeKey constant for HD DVD-RAM media. + */ + +#define kIODVDMediaTypeHDRAM "HD DVD-RAM" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IODVDBlockStorageDriver.h> +#include <IOKit/storage/IOMedia.h> + +/*! + * @class IODVDMedia + * @abstract + * The IODVDMedia class is a random-access disk device abstraction for DVDs. + * @discussion + * The IODVDMedia class is a random-access disk device abstraction for DVDs. + */ + +class IODVDMedia : public IOMedia +{ + OSDeclareDefaultStructors(IODVDMedia) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IODVDBlockStorageDriver. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IODVDBlockStorageDriver * getProvider() const; + + /* + * Compare the properties in the supplied table to this object's properties. + */ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + /* + * Issue an MMC REPORT KEY command. + * Obsoleted, replaced by this interface: + * virtual IOReturn reportKey( IOMemoryDescriptor * buffer, + * UInt8 keyClass, + * UInt32 address, + * UInt8 blockCount, + * UInt8 grantID, + * UInt8 format ); + */ + + virtual IOReturn reportKey( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 address, + const UInt8 grantID, + const DVDKeyFormat format ) __attribute__ ((deprecated)); + + /*! + * @function sendKey + * @discussion + * Issue an MMC SEND KEY command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. Pass null for the kDVDKeyFormatAGID_Invalidate format + * case. + * @param keyClass + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param format + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn sendKey( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt8 grantID, + const DVDKeyFormat format ); + + /*! + * @function readStructure + * @discussion + * Issue an MMC READ DVD STRUCTURE command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param format + * As documented by MMC. + * @param address + * As documented by MMC. + * @param layer + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readStructure( IOMemoryDescriptor * buffer, + const DVDStructureFormat format, + const UInt32 address, + const UInt8 layer, + const UInt8 grantID ); + + /*! + * @function getSpeed + * @discussion + * Get the current speed used for data transfers. + * @param kilobytesPerSecond + * Returns the current speed used for data transfers, in kB/s. + * + * kDVDSpeedMin specifies the minimum speed for all DVD media (1X). + * kDVDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond); + + /*! + * @function setSpeed + * @discussion + * Set the speed to be used for data transfers. + * @param kilobytesPerSecond + * Speed to be used for data transfers, in kB/s. + * + * kDVDSpeedMin specifies the minimum speed for all DVD media (1X). + * kDVDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setSpeed(UInt16 kilobytesPerSecond); + + /*! + * @function readDiscInfo + * @discussion + * Issue an MMC READ DISC INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readDiscInfo( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ); + + /*! + * @function readRZoneInfo + * @discussion + * Issue an MMC READ RZONE INFORMATION (READ TRACK INFORMATION) command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param address + * As documented by MMC. + * @param addressType + * As documented by MMC. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readRZoneInfo( IOMemoryDescriptor * buffer, + UInt32 address, + DVDRZoneInfoAddressType addressType, + UInt16 * actualByteCount ); + + /*! + * @function reportKey + * @discussion + * Issue an MMC REPORT KEY command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param keyClass + * As documented by MMC. + * @param address + * As documented by MMC. + * @param blockCount + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param format + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn reportKey( IOMemoryDescriptor * buffer, + UInt8 keyClass, + UInt32 address, + UInt8 blockCount, + UInt8 grantID, + UInt8 format ); + + OSMetaClassDeclareReservedUsed(IODVDMedia, 0); /* reportKey */ + OSMetaClassDeclareReservedUnused(IODVDMedia, 1); + OSMetaClassDeclareReservedUnused(IODVDMedia, 2); + OSMetaClassDeclareReservedUnused(IODVDMedia, 3); + OSMetaClassDeclareReservedUnused(IODVDMedia, 4); + OSMetaClassDeclareReservedUnused(IODVDMedia, 5); + OSMetaClassDeclareReservedUnused(IODVDMedia, 6); + OSMetaClassDeclareReservedUnused(IODVDMedia, 7); + OSMetaClassDeclareReservedUnused(IODVDMedia, 8); + OSMetaClassDeclareReservedUnused(IODVDMedia, 9); + OSMetaClassDeclareReservedUnused(IODVDMedia, 10); + OSMetaClassDeclareReservedUnused(IODVDMedia, 11); + OSMetaClassDeclareReservedUnused(IODVDMedia, 12); + OSMetaClassDeclareReservedUnused(IODVDMedia, 13); + OSMetaClassDeclareReservedUnused(IODVDMedia, 14); + OSMetaClassDeclareReservedUnused(IODVDMedia, 15); + OSMetaClassDeclareReservedUnused(IODVDMedia, 16); + OSMetaClassDeclareReservedUnused(IODVDMedia, 17); + OSMetaClassDeclareReservedUnused(IODVDMedia, 18); + OSMetaClassDeclareReservedUnused(IODVDMedia, 19); + OSMetaClassDeclareReservedUnused(IODVDMedia, 20); + OSMetaClassDeclareReservedUnused(IODVDMedia, 21); + OSMetaClassDeclareReservedUnused(IODVDMedia, 22); + OSMetaClassDeclareReservedUnused(IODVDMedia, 23); + OSMetaClassDeclareReservedUnused(IODVDMedia, 24); + OSMetaClassDeclareReservedUnused(IODVDMedia, 25); + OSMetaClassDeclareReservedUnused(IODVDMedia, 26); + OSMetaClassDeclareReservedUnused(IODVDMedia, 27); + OSMetaClassDeclareReservedUnused(IODVDMedia, 28); + OSMetaClassDeclareReservedUnused(IODVDMedia, 29); + OSMetaClassDeclareReservedUnused(IODVDMedia, 30); + OSMetaClassDeclareReservedUnused(IODVDMedia, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IODVDMEDIA_H */ diff --git a/QualcommWireless/include/IOKit/storage/IODVDMediaBSDClient.h b/QualcommWireless/include/IOKit/storage/IODVDMediaBSDClient.h new file mode 100644 index 0000000..d0d7073 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IODVDMediaBSDClient.h @@ -0,0 +1,198 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IODVDMEDIABSDCLIENT_H +#define _IODVDMEDIABSDCLIENT_H + +#include <sys/ioctl.h> + +#include <IOKit/storage/IODVDTypes.h> + +/* + * Definitions + * + * ioctl description + * ---------------------------- ------------------------------------------------ + * DKIOCDVDREADSTRUCTURE see IODVDMedia::readStructure() in IODVDMedia.h + * + * DKIOCDVDREADDISCINFO see IODVDMedia::readDiscInfo() in IODVDMedia.h + * DKIOCDVDREADRZONEINFO see IODVDMedia::readRZoneInfo() in IODVDMedia.h + * + * DKIOCDVDREPORTKEY see IODVDMedia::reportKey() in IODVDMedia.h + * DKIOCDVDSENDKEY see IODVDMedia::sendKey() in IODVDMedia.h + * + * DKIOCDVDGETSPEED see IODVDMedia::getSpeed() in IODVDMedia.h + * DKIOCDVDSETSPEED see IODVDMedia::setSpeed() in IODVDMedia.h + * + * in /System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/ + */ + +typedef struct +{ + uint8_t format; + + uint8_t reserved0008[3]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t grantID; + uint8_t layer; + +#ifdef __LP64__ + uint8_t reserved0080[4]; /* reserved, clear to zero */ +#endif /* __LP64__ */ + + uint16_t bufferLength; + void * buffer; +} dk_dvd_read_structure_t; + +typedef struct +{ + uint8_t format; + uint8_t keyClass; + uint8_t blockCount; + + uint8_t reserved0024[1]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t grantID; + +#ifdef __LP64__ + uint8_t reserved0072[5]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0072[1]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; + void * buffer; +} dk_dvd_report_key_t; + +typedef struct +{ + uint8_t format; + uint8_t keyClass; + + uint8_t reserved0016[6]; /* reserved, clear to zero */ + + uint8_t grantID; + +#ifdef __LP64__ + uint8_t reserved0072[5]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0072[1]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; + void * buffer; +} dk_dvd_send_key_t; + +typedef struct +{ +#ifdef __LP64__ + uint8_t reserved0000[14]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0000[10]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_dvd_read_disc_info_t; + +typedef struct +{ + uint8_t reserved0000[4]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t addressType; + +#ifdef __LP64__ + uint8_t reserved0072[5]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0072[1]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_dvd_read_rzone_info_t; + +#define DKIOCDVDREADSTRUCTURE _IOW('d', 128, dk_dvd_read_structure_t) +#define DKIOCDVDREPORTKEY _IOW('d', 129, dk_dvd_report_key_t) +#define DKIOCDVDSENDKEY _IOW('d', 130, dk_dvd_send_key_t) + +#define DKIOCDVDGETSPEED _IOR('d', 131, uint16_t) +#define DKIOCDVDSETSPEED _IOW('d', 131, uint16_t) + +#define DKIOCDVDREADDISCINFO _IOWR('d', 132, dk_dvd_read_disc_info_t) +#define DKIOCDVDREADRZONEINFO _IOWR('d', 133, dk_dvd_read_rzone_info_t) + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IODVDMedia.h> +#include <IOKit/storage/IOMediaBSDClient.h> + +/* + * Class + */ + +class IODVDMediaBSDClient : public IOMediaBSDClient +{ + OSDeclareDefaultStructors(IODVDMediaBSDClient) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of IOService -- IODVDMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IODVDMedia * getProvider() const; + + /* + * Process a DVD-specific ioctl. + */ + + virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc); + + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 0); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 1); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 2); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 3); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 4); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 5); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 6); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 7); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IODVDMEDIABSDCLIENT_H */ diff --git a/QualcommWireless/include/IOKit/storage/IODVDTypes.h b/QualcommWireless/include/IOKit/storage/IODVDTypes.h new file mode 100644 index 0000000..d4398a3 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IODVDTypes.h @@ -0,0 +1,437 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IODVDTYPES_H +#define _IODVDTYPES_H + +#include <IOKit/IOTypes.h> + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* + * Media Types + */ + +enum +{ + kDVDMediaTypeUnknown = 0x0200, + kDVDMediaTypeROM = 0x0202, /* DVD-ROM */ + kDVDMediaTypeRAM = 0x0203, /* DVD-RAM */ + kDVDMediaTypeR = 0x0204, /* DVD-R */ + kDVDMediaTypeRW = 0x0205, /* DVD-RW */ + kDVDMediaTypePlusRW = 0x0206, /* DVD+RW */ + kDVDMediaTypePlusR = 0x0207, /* DVD+R */ + kDVDMediaTypeHDROM = 0x0212, /* HD DVD-ROM */ + kDVDMediaTypeHDRAM = 0x0213, /* HD DVD-RAM */ + kDVDMediaTypeHDR = 0x0214, /* HD DVD-R */ + kDVDMediaTypeHDRW = 0x0215, /* HD DVD-RW */ + + kDVDMediaTypeMin = 0x0200, + kDVDMediaTypeMax = 0x02FF +}; + +typedef UInt32 DVDMediaType; + +/* + * Media Speed (kB/s) + */ + +#define kDVDSpeedMin 0x0546 +#define kDVDSpeedMax 0xFFFF + +/* + * MMC Formats + */ + +typedef UInt8 DVDCPRMRegionCode; +enum +{ + kDVDCPRMRegion1 = 0xFE, + kDVDCPRMRegion2 = 0xFD, + kDVDCPRMRegion3 = 0xFB, + kDVDCPRMRegion4 = 0xF7, + kDVDCPRMRegion5 = 0xEF, + kDVDCPRMRegion6 = 0xDF +}; + +typedef UInt8 DVDRegionalPlaybackControlScheme; +enum +{ + kDVDRegionalPlaybackControlSchemePhase1 = 0x00, + kDVDRegionalPlaybackControlSchemePhase2 = 0x01 +}; + +typedef UInt8 DVDBookType; +enum +{ + kDVDBookTypeROM = 0x0, + kDVDBookTypeRAM = 0x1, + kDVDBookTypeR = 0x2, + kDVDBookTypeRW = 0x3, + kDVDBookTypeHDROM = 0x4, + kDVDBookTypeHDRAM = 0x5, + kDVDBookTypeHDR = 0x6, + kDVDBookTypeHDRW = 0x7, + kDVDBookTypePlusRW = 0x9, + kDVDBookTypePlusR = 0xA, + kDVDBookTypePlusRWDoubleLayer = 0xD, + kDVDBookTypePlusRDoubleLayer = 0xE +}; + +typedef UInt8 DVDKeyClass; +enum +{ + kDVDKeyClassCSS_CPPM_CPRM = 0x00, + kDVDKeyClassRSSA = 0x01 +}; + +typedef UInt8 DVDKeyFormat; +enum +{ + kDVDKeyFormatAGID_CSS = 0x00, + kDVDKeyFormatChallengeKey = 0x01, + kDVDKeyFormatKey1 = 0x02, + kDVDKeyFormatKey2 = 0x03, + kDVDKeyFormatTitleKey = 0x04, + kDVDKeyFormatASF = 0x05, + kDVDKeyFormatSetRegion = 0x06, + kDVDKeyFormatRegionState = 0x08, + kDVDKeyFormatAGID_CSS2 = 0x10, + kDVDKeyFormatAGID_CPRM = 0x11, + kDVDKeyFormatAGID_Invalidate = 0x3F +}; + +typedef UInt8 DVDStructureFormat; +enum +{ + kDVDStructureFormatPhysicalFormatInfo = 0x00, + kDVDStructureFormatCopyrightInfo = 0x01, + kDVDStructureFormatDiscKeyInfo = 0x02, + // skip BCA + kDVDStructureFormatManufacturingInfo = 0x04 +}; + +// Read DVD Structures Format 0x00 +struct DVDPhysicalFormatInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; +#ifdef __LITTLE_ENDIAN__ + // Byte 0 + UInt8 partVersion:4; + UInt8 bookType:4; + + // Byte 1 + UInt8 minimumRate:4; + UInt8 discSize:4; + + // Byte 2 + UInt8 layerType:4; + UInt8 trackPath:1; + UInt8 numberOfLayers:2; + UInt8 reserved2:1; + + // Byte 3 + UInt8 trackDensity:4; + UInt8 linearDensity:4; +#else /* !__LITTLE_ENDIAN__ */ + // Byte 0 + UInt8 bookType:4; + UInt8 partVersion:4; + + // Byte 1 + UInt8 discSize:4; + UInt8 minimumRate:4; + + // Byte 2 + UInt8 reserved2:1; + UInt8 numberOfLayers:2; + UInt8 trackPath:1; + UInt8 layerType:4; + + // Byte 3 + UInt8 linearDensity:4; + UInt8 trackDensity:4; +#endif /* !__LITTLE_ENDIAN__ */ + + // Bytes 4-15 + UInt8 zero1; // always 0x00 + UInt8 startingPhysicalSectorNumberOfDataArea[3]; + UInt8 zero2; // always 0x00 + UInt8 endPhysicalSectorNumberOfDataArea[3]; + UInt8 zero3; // always 0x00 + UInt8 endSectorNumberInLayerZero[3]; + + // Byte 16 +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved1:7; + UInt8 bcaFlag:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 bcaFlag:1; + UInt8 reserved1:7; +#endif /* !__LITTLE_ENDIAN__ */ + + // Bytes 17-2047 + UInt8 mediaSpecific[2031]; +}; +typedef struct DVDPhysicalFormatInfo DVDPhysicalFormatInfo; + +// Read DVD Structures Format 0x01 +struct DVDCopyrightInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 copyrightProtectionSystemType; + DVDCPRMRegionCode regionMask; + UInt8 reserved2[2]; +}; +typedef struct DVDCopyrightInfo DVDCopyrightInfo; + +// Read DVD Structures Format 0x02 +struct DVDDiscKeyInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 discKeyStructures[2048]; +}; +typedef struct DVDDiscKeyInfo DVDDiscKeyInfo; + +// Read DVD Structures Format 0x04 +struct DVDManufacturingInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 discManufacturingInfo[2048]; +}; +typedef struct DVDManufacturingInfo DVDManufacturingInfo; + +// ReportKey Format 0x00 +struct DVDAuthenticationGrantIDInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 reserved2[3]; +#ifdef __LITTLE_ENDIAN__ + UInt8 reservedBits:6; + UInt8 grantID:2; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 grantID:2; + UInt8 reservedBits:6; +#endif /* !__LITTLE_ENDIAN__ */ +}; +typedef struct DVDAuthenticationGrantIDInfo DVDAuthenticationGrantIDInfo; + +// ReportKey and SendKey Format 0x01 +struct DVDChallengeKeyInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 challengeKeyValue[10]; + UInt8 reserved2[2]; +}; +typedef struct DVDChallengeKeyInfo DVDChallengeKeyInfo; + +// ReportKey Format 0x02 +struct DVDKey1Info +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 key1Value[5]; + UInt8 reserved2[3]; +}; +typedef struct DVDKey1Info DVDKey1Info; + +// SendKey Format 0x03 +struct DVDKey2Info +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 key2Value[5]; + UInt8 reserved2[3]; +}; +typedef struct DVDKey2Info DVDKey2Info; + +// ReportKey Format 0x04 +struct DVDTitleKeyInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; +#ifdef __LITTLE_ENDIAN__ + UInt8 CP_MOD:4; + UInt8 CGMS:2; + UInt8 CP_SEC:1; + UInt8 CPM:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 CPM:1; + UInt8 CP_SEC:1; + UInt8 CGMS:2; + UInt8 CP_MOD:4; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 titleKeyValue[5]; + UInt8 reserved2[2]; +}; +typedef struct DVDTitleKeyInfo DVDTitleKeyInfo; + +// ReportKey Format 0x05 +struct DVDAuthenticationSuccessFlagInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 reserved2[3]; +#ifdef __LITTLE_ENDIAN__ + UInt8 successFlag:1; + UInt8 reservedBits:7; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reservedBits:7; + UInt8 successFlag:1; +#endif /* !__LITTLE_ENDIAN__ */ +}; +typedef struct DVDAuthenticationSuccessFlagInfo DVDAuthenticationSuccessFlagInfo; + +// ReportKey Format 0x08 +struct DVDRegionPlaybackControlInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; +#ifdef __LITTLE_ENDIAN__ + UInt8 numberUserResets:3; + UInt8 numberVendorResets:3; + UInt8 typeCode:2; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 typeCode:2; + UInt8 numberVendorResets:3; + UInt8 numberUserResets:3; +#endif /* !__LITTLE_ENDIAN__ */ + DVDCPRMRegionCode driveRegion; + DVDRegionalPlaybackControlScheme rpcScheme; + UInt8 reserved2; +}; +typedef struct DVDRegionPlaybackControlInfo DVDRegionPlaybackControlInfo; + +// Read Disc Information Format +struct DVDDiscInfo +{ + UInt16 dataLength; +#ifdef __LITTLE_ENDIAN__ + UInt8 discStatus:2; + UInt8 stateOfLastBorder:2; + UInt8 erasable:1; + UInt8 reserved:3; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved:3; + UInt8 erasable:1; + UInt8 stateOfLastBorder:2; + UInt8 discStatus:2; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 reserved2; + UInt8 numberOfBordersLSB; + UInt8 firstRZoneNumberInLastBorderLSB; + UInt8 lastRZoneNumberInLastBorderLSB; +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved3:5; + UInt8 unrestrictedUse:1; + UInt8 discBarCodeValid:1; + UInt8 reserved4:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved4:1; + UInt8 discBarCodeValid:1; + UInt8 unrestrictedUse:1; + UInt8 reserved3:5; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 reserved5; + UInt8 numberOfBordersMSB; + UInt8 firstRZoneNumberInLastBorderMSB; + UInt8 lastRZoneNumberInLastBorderMSB; + UInt8 reserved6[4]; + UInt8 reserved7[4]; + UInt8 reserved8[4]; + UInt8 discBarCode[8]; + UInt8 reserved9; + UInt8 numberOfOPCTableEntries; + UInt8 opcTableEntries[0]; +}; +typedef struct DVDDiscInfo DVDDiscInfo; + +// Read RZone Information Address Types +typedef UInt8 DVDRZoneInfoAddressType; +enum +{ + kDVDRZoneInfoAddressTypeLBA = 0x00, + kDVDRZoneInfoAddressTypeRZoneNumber = 0x01, + kDVDRZoneInfoAddressTypeBorderNumber = 0x02, +}; + +// Read RZone Information Format +struct DVDRZoneInfo +{ + UInt16 dataLength; + UInt8 rzoneNumberLSB; + UInt8 borderNumberLSB; + UInt8 reserved; +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved2:4; + UInt8 copy:1; + UInt8 damage:1; + UInt8 reserved3:2; + + UInt8 reserved4:4; + UInt8 restrictedOverwrite:1; + UInt8 incremental:1; + UInt8 blank:1; + UInt8 reservedRZone:1; + + UInt8 nextWritableAddressValid:1; + UInt8 lastRecordedAddressValid:1; + UInt8 reserved5:6; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved3:2; + UInt8 damage:1; + UInt8 copy:1; + UInt8 reserved2:4; + + UInt8 reservedRZone:1; + UInt8 blank:1; + UInt8 incremental:1; + UInt8 restrictedOverwrite:1; + UInt8 reserved4:4; + + UInt8 reserved5:6; + UInt8 lastRecordedAddressValid:1; + UInt8 nextWritableAddressValid:1; +#endif /* !__LITTLE_ENDIAN__ */ + UInt32 rzoneStartAddress; + UInt32 nextWritableAddress; + UInt32 freeBlocks; + UInt32 blockingFactor; + UInt32 rzoneSize; + UInt32 lastRecordedAddress; + UInt8 rzoneNumberMSB; + UInt8 borderNumberMSB; + UInt8 reserved6; + UInt8 reserved7; +}; +typedef struct DVDRZoneInfo DVDRZoneInfo; + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* _IODVDTYPES_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOFDiskPartitionScheme.h b/QualcommWireless/include/IOKit/storage/IOFDiskPartitionScheme.h new file mode 100644 index 0000000..0036e37 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOFDiskPartitionScheme.h @@ -0,0 +1,245 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * This header contains the IOFDiskPartitionScheme class definition. + */ + +#ifndef _IOFDISKPARTITIONSCHEME_H +#define _IOFDISKPARTITIONSCHEME_H + +#include <IOKit/IOTypes.h> + +/* + * kIOFDiskPartitionSchemeClass is the name of the IOFDiskPartitionScheme class. + */ + +#define kIOFDiskPartitionSchemeClass "IOFDiskPartitionScheme" + +/* + * FDisk Partition Map Definitions + */ + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* Structure constants. */ + +#define DISK_BLK0SZ sizeof(struct disk_blk0) /* (size of partition map) */ +#define DISK_BOOTSZ 446 /* (size of boot code in map) */ +#define DISK_NPART 4 /* (number of entries in map) */ + +/* Partition map entry. */ + +struct fdisk_part +{ + UInt8 bootid; /* (is active boot partition?) */ + UInt8 beghead; /* (beginning head) */ + UInt8 begsect; /* (beginning sector; beginning cylinder, high 2 bits) */ + UInt8 begcyl; /* (beginning cylinder, low 8 bits) */ + UInt8 systid; /* (type) */ + UInt8 endhead; /* (ending head) */ + UInt8 endsect; /* (ending sector; ending cylinder, high 2 bits) */ + UInt8 endcyl; /* (ending cylinder, low 8 bits) */ + UInt32 relsect; /* (block start) */ + UInt32 numsect; /* (block count) */ +}; + +/* Partition map, as found in block zero of the disk (or extended partition). */ + +struct disk_blk0 +{ + UInt8 bootcode[DISK_BOOTSZ]; /* (boot code) */ + struct fdisk_part parts[DISK_NPART]; /* (partition entries) */ + UInt16 signature; /* (unique signature for map) */ +}; + +/* Partition map signature (signature). */ + +#define DISK_SIGNATURE 0xAA55 + +/* Partition map entry types (systid). */ + +#define FDISK_PARTITION_TYPE_01 "DOS_FAT_12" +#define FDISK_PARTITION_TYPE_04 "DOS_FAT_16_S" +#define FDISK_PARTITION_TYPE_06 "DOS_FAT_16" +#define FDISK_PARTITION_TYPE_07 "Windows_NTFS" +#define FDISK_PARTITION_TYPE_0B "DOS_FAT_32" +#define FDISK_PARTITION_TYPE_0C "Windows_FAT_32" +#define FDISK_PARTITION_TYPE_0E "Windows_FAT_16" +#define FDISK_PARTITION_TYPE_42 "Windows_LDM" +#define FDISK_PARTITION_TYPE_82 "Linux_Swap" +#define FDISK_PARTITION_TYPE_83 "Linux" +#define FDISK_PARTITION_TYPE_8E "Linux_LVM" +#define FDISK_PARTITION_TYPE_A5 "FreeBSD" +#define FDISK_PARTITION_TYPE_A6 "OpenBSD" +#define FDISK_PARTITION_TYPE_A7 "Apple_Rhapsody_UFS" +#define FDISK_PARTITION_TYPE_A8 "Apple_UFS" +#define FDISK_PARTITION_TYPE_A9 "NetBSD" +#define FDISK_PARTITION_TYPE_AB "Apple_Boot" +#define FDISK_PARTITION_TYPE_AE "Apple_Encrypted" +#define FDISK_PARTITION_TYPE_AF "Apple_HFS" +#define FDISK_PARTITION_TYPE_FD "Linux_RAID" + +#pragma pack(pop) /* (reset to default struct packing) */ + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOPartitionScheme.h> + +/* + * Class + */ + +class IOFDiskPartitionScheme : public IOPartitionScheme +{ + OSDeclareDefaultStructors(IOFDiskPartitionScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + OSSet * _partitions; /* (set of media objects representing partitions) */ + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(void) APPLE_KEXT_OVERRIDE; + + /* + * Scan the provider media for an FDisk partition map. Returns the set + * of media objects representing each of the partitions (the retain for + * the set is passed to the caller), or null should no partition map be + * found. The default probe score can be adjusted up or down, based on + * the confidence of the scan. + */ + + virtual OSSet * scan(SInt32 * score); + + /* + * Ask whether the given partition is extended. + */ + + virtual bool isPartitionExtended(fdisk_part * partition); + + /* + * Ask whether the given partition is used. + */ + + virtual bool isPartitionUsed(fdisk_part * partition); + + /* + * Ask whether the given partition appears to be corrupt. A partition that + * is corrupt will cause the failure of the FDisk partition map recognition + * altogether. + */ + + virtual bool isPartitionCorrupt( fdisk_part * partition, + UInt32 partitionID, + UInt32 fdiskBlock ); + + /* + * Ask whether the given partition appears to be invalid. A partition that + * is invalid will cause it to be skipped in the scan, but will not cause a + * failure of the FDisk partition map recognition. + */ + + virtual bool isPartitionInvalid( fdisk_part * partition, + UInt32 partitionID, + UInt32 fdiskBlock ); + + /* + * Instantiate a new media object to represent the given partition. + */ + + virtual IOMedia * instantiateMediaObject( fdisk_part * partition, + UInt32 partitionID, + UInt32 fdiskBlock ); + + /* + * Allocate a new media object (called from instantiateMediaObject). + */ + + virtual IOMedia * instantiateDesiredMediaObject( fdisk_part * partition, + UInt32 partitionID, + UInt32 fdiskBlock ); + +public: + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE; + + /* + * Determine whether the provider media contains an FDisk partition map. + */ + + virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE; + + /* + * Publish the new media objects which represent our partitions. + */ + + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + + /* + * Clean up after the media objects we published before terminating. + */ + + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + + /* + * Request that the provider media be re-scanned for partitions. + */ + + virtual IOReturn requestProbe(IOOptionBits options) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 0); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 1); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 2); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 3); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 4); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 5); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 6); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 7); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 8); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 9); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 10); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 11); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 12); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 13); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 14); + OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOFDISKPARTITIONSCHEME_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOFilterScheme.h b/QualcommWireless/include/IOKit/storage/IOFilterScheme.h new file mode 100644 index 0000000..dcb6cf4 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOFilterScheme.h @@ -0,0 +1,396 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOFilterScheme + * @abstract + * This header contains the IOFilterScheme class definition. + */ + +#ifndef _IOFILTERSCHEME_H +#define _IOFILTERSCHEME_H + +/*! + * @defined kIOFilterSchemeClass + * @abstract + * The name of the IOFilterScheme class. + * @discussion + * kIOFilterSchemeClass is the name of the IOFilterScheme class. + */ + +#define kIOFilterSchemeClass "IOFilterScheme" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOMedia.h> +#include <IOKit/storage/IOStorage.h> + +/*! + * @class IOFilterScheme + * @abstract + * The common base class for all filter scheme + * objects. + * @discussion + * The IOFilterScheme class is the common base class for all filter scheme + * objects. It extends the IOStorage class by implementing the appropriate + * open and close semantics for filter objects (standard semantics are act + * as a relay for incoming opens, producing one outgoing open for each + * incoming open). It also implements the default read and write semantics, + * which pass all reads and writes through to the provider media unprocessed. + * For simple schemes, the default behavior is sufficient. More complex + * filter schemes such as RAID will want to do extra processing for reads + * and writes. + */ + +class IOFilterScheme : public IOStorage +{ + OSDeclareDefaultStructors(IOFilterScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + /*! + * @function handleOpen + * @discussion + * The handleOpen method grants or denies permission to access this object + * to an interested client. The argument is an IOStorageAccess value that + * specifies the level of access desired -- reader or reader-writer. + * + * This method can be invoked to upgrade or downgrade the access level for + * an existing client as well. The previous access level will prevail for + * upgrades that fail, of course. A downgrade should never fail. If the + * new access level should be the same as the old for a given client, this + * method will do nothing and return success. In all cases, one, singular + * close-per-client is expected for all opens-per-client received. + * + * This implementation replaces the IOService definition of handleOpen(). + * @param client + * Client requesting the open. + * @param options + * Options for the open. Set to zero. + * @param access + * Access level for the open. Set to kIOStorageAccessReader or + * kIOStorageAccessReaderWriter. + * @result + * Returns true if the open was successful, false otherwise. + */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * access) APPLE_KEXT_OVERRIDE; + + /*! + * @function handleIsOpen + * @discussion + * The handleIsOpen method determines whether the specified client, or any + * client if none is specified, presently has an open on this object. + * + * This implementation replaces the IOService definition of handleIsOpen(). + * @param client + * Client to check the open state of. Set to zero to check the open state + * of all clients. + * @result + * Returns true if the client was (or clients were) open, false otherwise. + */ + + virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE; + + /*! + * @function handleClose + * @discussion + * The handleClose method closes the client's access to this object. + * + * This implementation replaces the IOService definition of handleClose(). + * @param client + * Client requesting the close. + * @param options + * Options for the close. Set to zero. + */ + + virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE; + +public: + + using IOStorage::read; + using IOStorage::write; + + /*! + * @function read + * @discussion + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * + * For simple filter schemes, the default behavior is to simply pass the + * read through to the provider media. More complex filter schemes such + * as RAID will need to do extra processing here. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE; + + /*! + * @function write + * @discussion + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * + * For simple filter schemes, the default behavior is to simply pass the + * write through to the provider media. More complex filter schemes such + * as RAID will need to do extra processing here. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE; + + /*! + * @function synchronize + * @discussion + * Flush the cached data in the storage object, if any. + * @param client + * Client requesting the synchronization. + * @param byteStart + * Starting byte offset for the synchronization. + * @param byteCount + * Size of the synchronization. Set to zero to specify the end-of-media. + * @param options + * Options for the synchronization. See IOStorageSynchronizeOptions. + * @result + * Returns the status of the synchronization. + */ + + virtual IOReturn synchronize(IOService * client, + UInt64 byteStart, + UInt64 byteCount, + IOStorageSynchronizeOptions options = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function unmap + * @discussion + * Delete unused data from the storage object at the specified byte offsets. + * @param client + * Client requesting the operation. + * @param extents + * List of extents. See IOStorageExtent. It is legal for the callee to + * overwrite the contents of this buffer in order to satisfy the request. + * @param extentsCount + * Number of extents. + * @param options + * Options for the unmap. See IOStorageUnmapOptions. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn unmap(IOService * client, + IOStorageExtent * extents, + UInt32 extentsCount, + IOStorageUnmapOptions options = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function getProvisionStatus + * @discussion + * Get device block provision status + * @param client + * Client requesting the synchronization. + * @param byteStart + * Byte offset of logical extent on the device. + * @param byteCount + * Byte length of logical extent on the device, 0 mean the entire remaining space. + * @param extentsCount + * Number of extents allocated in extents. On return, this parameter indicate number + * of provision extents returned. + * @param extents + * List of provision extents. See IOStorageProvisionExtents. + * @result + * Returns the status of the getProvisionStatus. + */ + + virtual IOReturn getProvisionStatus(IOService * client, + UInt64 byteStart, + UInt64 byteCount, + UInt32 * extentsCount, + IOStorageProvisionExtent * extents, + IOStorageGetProvisionStatusOptions options = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function lockPhysicalExtents + * @discussion + * Lock the contents of the storage object against relocation temporarily, + * for the purpose of getting physical extents. + * @param client + * Client requesting the operation. + * @result + * Returns true if the lock was successful, false otherwise. + */ + + virtual bool lockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE; + + /*! + * @function copyPhysicalExtent + * @discussion + * Convert the specified byte offset into a physical byte offset, relative + * to a physical storage object. This call should only be made within the + * context of lockPhysicalExtents(). + * @param client + * Client requesting the operation. + * @param byteStart + * Starting byte offset for the operation. Returns a physical byte offset, + * relative to the physical storage object, on success. + * @param byteCount + * Size of the operation. Returns the actual number of bytes which can be + * transferred, relative to the physical storage object, on success. + * @result + * A reference to the physical storage object, which should be released by + * the caller, or a null on error. + */ + + virtual IOStorage * copyPhysicalExtent(IOService * client, + UInt64 * byteStart, + UInt64 * byteCount) APPLE_KEXT_OVERRIDE; + + /*! + * @function unlockPhysicalExtents + * @discussion + * Unlock the contents of the storage object for relocation again. This + * call must balance a successful call to lockPhysicalExtents(). + * @param client + * Client requesting the operation. + */ + + virtual void unlockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE; + + /*! + * @function setPriority + * @discussion + * Reprioritize read or write requests at the specified byte offsets. + * @param client + * Client requesting the operation. + * @param extents + * List of extents. See IOStorageExtent. It is legal for the callee to + * overwrite the contents of this buffer in order to satisfy the request. + * @param extentsCount + * Number of extents. + * @param priority + * New priority. See IOStoragePriority. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setPriority(IOService * client, + IOStorageExtent * extents, + UInt32 extentsCount, + IOStoragePriority priority) APPLE_KEXT_OVERRIDE; + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of OSObject -- an IOMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOMedia * getProvider() const APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(IOFilterScheme, 0); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 1); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 2); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 3); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 4); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 5); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 6); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 7); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 8); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 9); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 10); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 11); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 12); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 13); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 14); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 15); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 16); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 17); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 18); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 19); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 20); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 21); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 22); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 23); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 24); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 25); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 26); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 27); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 28); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 29); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 30); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOFILTERSCHEME_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOFireWireStorageCharacteristics.h b/QualcommWireless/include/IOKit/storage/IOFireWireStorageCharacteristics.h new file mode 100644 index 0000000..710f29f --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOFireWireStorageCharacteristics.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_FIREWIRE_STORAGE_DEVICE_CHARACTERISTICS_H_ +#define _IOKIT_IO_FIREWIRE_STORAGE_DEVICE_CHARACTERISTICS_H_ + +// +// Bridge Characteristics - Characteristics defined for FireWire bridges. +// + +/*! +@defined kIOPropertyBridgeCharacteristicsKey +@discussion This key is used to define Bridge Characteristics for a particular +devices's bridge chipset. It has an associated dictionary which lists the +bridge characteristics. + +Requirement: Optional + +Example: +<pre> +@textblock +<dict> + <key>Bridge Characteristics</key> + <dict> + <key>Bridge Vendor Name</key> + <string>Oxford Semiconductor</string> + <key>Bridge Model Name</key> + <string>FW911</string> + <key>Bridge Revision Level</key> + <string>3.7</string> + </dict> +</dict> +@/textblock +</pre> +*/ + +#define kIOPropertyBridgeCharacteristicsKey "Bridge Characteristics" +#define kIOPropertyBridgeVendorNameKey "Bridge Vendor Name" +#define kIOPropertyBridgeModelNameKey "Bridge Model Name" +#define kIOPropertyBridgeRevisionLevelKey "Bridge Revision Level" + +#endif /* _IOKIT_IO_FIREWIRE_STORAGE_DEVICE_CHARACTERISTICS_H_ */ \ No newline at end of file diff --git a/QualcommWireless/include/IOKit/storage/IOGUIDPartitionScheme.h b/QualcommWireless/include/IOKit/storage/IOGUIDPartitionScheme.h new file mode 100644 index 0000000..d4b9e5a --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOGUIDPartitionScheme.h @@ -0,0 +1,252 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * This header contains the IOGUIDPartitionScheme class definition. + */ + +#ifndef _IOGUIDPARTITIONSCHEME_H +#define _IOGUIDPARTITIONSCHEME_H + +#include <IOKit/IOTypes.h> + +/* + * kIOGUIDPartitionSchemeClass is the name of the IOGUIDPartitionScheme class. + */ + +#define kIOGUIDPartitionSchemeClass "IOGUIDPartitionScheme" + +/* + * GUID Partition Map Definitions + */ + +#include <uuid/uuid.h> + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* Partition map. */ + +struct gpt_hdr +{ + uint8_t hdr_sig[8]; + uint32_t hdr_revision; + uint32_t hdr_size; + uint32_t hdr_crc_self; + uint32_t __reserved; + uint64_t hdr_lba_self; + uint64_t hdr_lba_alt; + uint64_t hdr_lba_start; + uint64_t hdr_lba_end; + uuid_t hdr_uuid; + uint64_t hdr_lba_table; + uint32_t hdr_entries; + uint32_t hdr_entsz; + uint32_t hdr_crc_table; + uint32_t padding; +}; + +/* Partition map entry. */ + +struct gpt_ent +{ + uuid_t ent_type; + uuid_t ent_uuid; + uint64_t ent_lba_start; + uint64_t ent_lba_end; + uint64_t ent_attr; + uint16_t ent_name[36]; +}; + +/* Partition map signature (hdr_sig). */ + +#define GPT_HDR_SIG "EFI PART" + +/* Partition map version (hdr_revision). */ + +#define GPT_HDR_REVISION 0x00010000 + +/* Partition map entry flags (ent_attr). */ + +#define GPT_ENT_ATTR_PLATFORM 0x00000001 + +/*! + * @defined kIOGUIDPartitionSchemeUUIDKey + * @abstract + * A property of IOGUIDPartitionSchemeGUID objects + * @discussion + * The kIOGUIDPartitionSchemeUUIDKey property has an OSString value and contains + * a persistent GUID for the disk define in GPT header + */ +#define kIOGUIDPartitionSchemeUUIDKey "UUID" + +/*! + * @defined kIOMediaGPTPartitionAttributesKey + * @abstrat + * A property of IOMedia objects for GPT partitions + * @discussion + * The kIOMediaGPTPartitionAttributesKey property has an OSNumber value of 64bit + * GPT partition attributes + */ +#define kIOMediaGPTPartitionAttributesKey "GPT Attributes" + +#pragma pack(pop) /* (reset to default struct packing) */ + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOPartitionScheme.h> + +/* + * Class + */ + +class IOGUIDPartitionScheme : public IOPartitionScheme +{ + OSDeclareDefaultStructors(IOGUIDPartitionScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + OSSet * _partitions; /* (set of media objects representing partitions) */ + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(void) APPLE_KEXT_OVERRIDE; + + /* + * Scan the provider media for a GUID partition map. Returns the set + * of media objects representing each of the partitions (the retain for + * the set is passed to the caller), or null should no partition map be + * found. The default probe score can be adjusted up or down, based on + * the confidence of the scan. + */ + + virtual OSSet * scan(SInt32 * score); + + /* + * Ask whether the given partition is used. + */ + + virtual bool isPartitionUsed(gpt_ent * partition); + + /* + * Ask whether the given partition appears to be corrupt. A partition that + * is corrupt will cause the failure of the GUID partition map recognition + * altogether. + */ + + virtual bool isPartitionCorrupt( gpt_ent * partition, + UInt32 partitionID ); + + /* + * Ask whether the given partition appears to be invalid. A partition that + * is invalid will cause it to be skipped in the scan, but will not cause a + * failure of the GUID partition map recognition. + */ + + virtual bool isPartitionInvalid( gpt_ent * partition, + UInt32 partitionID ); + + /* + * Instantiate a new media object to represent the given partition. + */ + + virtual IOMedia * instantiateMediaObject( gpt_ent * partition, + UInt32 partitionID ); + + /* + * Allocate a new media object (called from instantiateMediaObject). + */ + + virtual IOMedia * instantiateDesiredMediaObject( gpt_ent * partition, + UInt32 partitionID ); + +public: + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE; + + /* + * Determine whether the provider media contains a GUID partition map. + */ + + virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE; + + /* + * Publish the new media objects which represent our partitions. + */ + + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + + /* + * Clean up after the media objects we published before terminating. + */ + + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + + /* + * Request that the provider media be re-scanned for partitions. + */ + + virtual IOReturn requestProbe(IOOptionBits options) APPLE_KEXT_OVERRIDE; + + /* + * Generic entry point for calls from the provider. A return value of + * kIOReturnSuccess indicates that the message was received, and where + * applicable, that it was successful. + */ + + virtual IOReturn message(UInt32 type, IOService * provider, void * argument) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 0); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 1); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 2); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 3); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 4); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 5); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 6); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 7); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 8); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 9); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 10); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 11); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 12); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 13); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 14); + OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOGUIDPARTITIONSCHEME_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOMedia.h b/QualcommWireless/include/IOKit/storage/IOMedia.h new file mode 100644 index 0000000..75ed962 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOMedia.h @@ -0,0 +1,797 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOMedia + * @abstract + * This header contains the IOMedia class definition. + */ + +#ifndef _IOMEDIA_H +#define _IOMEDIA_H + +#include <IOKit/IOTypes.h> + +/*! + * @defined kIOMediaClass + * @abstract + * The name of the IOMedia class. + */ + +#define kIOMediaClass "IOMedia" + +/*! + * @defined kIOMediaContentKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaContentKey property has an OSString + * value and contains a description of the media's + * contents. The description is the same as the hint at the time of the + * object's creation, but it is possible that the description has been overridden + * by a client (which has probed the media and identified the content correctly) + * of the media object. It is more accurate than the hint for this reason. The + * string is formed in the likeness of Apple's "Apple_HFS" strings or in the + * likeness of a UUID. + */ + +#define kIOMediaContentKey "Content" + +/*! + * @defined kIOMediaContentHintKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaContentHintKey property has an OSString + * value and contains a hint of the media's contents. + * The hint is set at the time of the object's creation, should the creator have + * a clue as to what it may contain. The hint string does not change for the + * lifetime of the object and is formed in the likeness of Apple's "Apple_HFS" + * strings or in the likeness of a UUID. + */ + +#define kIOMediaContentHintKey "Content Hint" + +/*! + * @defined kIOMediaEjectableKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaEjectableKey property has an OSBoolean + * value and describes whether the media is ejectable + * from the drive mechanism under software control. Implies IOMediaRemovable + * is also true. + */ + +#define kIOMediaEjectableKey "Ejectable" + +/*! + * @defined kIOMediaLeafKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaLeafKey property has an OSBoolean value and describes whether the media is a leaf, that is, + * it is the deepest media object in this branch of the I/O Registry. + */ + +#define kIOMediaLeafKey "Leaf" + +/*! + * @defined kIOMediaOpenKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaOpenKey property has an OSBoolean value and describes whether + * a client presently has an open on this media. + */ + +#define kIOMediaOpenKey "Open" + +/*! + * @defined kIOMediaPreferredBlockSizeKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaPreferredBlockSizeKey property has an + * OSNumber value and describes the media's natural + * block size in bytes. This information is useful to clients that want to + * optimize access to the media. + */ + +#define kIOMediaPreferredBlockSizeKey "Preferred Block Size" + +/*! + * @defined kIOMediaRemovableKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaRemovableKey property has an OSBoolean + * value and describes whether the media is removable + * from the drive mechanism. + */ + +#define kIOMediaRemovableKey "Removable" + +/*! + * @defined kIOMediaSizeKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaSizeKey property has an OSNumber value and describes the total length of the media in + * bytes. + */ + +#define kIOMediaSizeKey "Size" + +/*! + * @defined kIOMediaUUIDKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaUUIDKey property has an OSString value and contains a persistent + * Universal Unique Identifier for the media if such an identifier is available. + */ + +#define kIOMediaUUIDKey "UUID" + +/*! + * @defined kIOMediaWholeKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaWholeKey property has an OSBoolean + * value and describes whether the media is whole, that is, + * it represents the whole disk (the physical disk, or a virtual replica + * thereof). + */ + +#define kIOMediaWholeKey "Whole" + +/*! + * @defined kIOMediaWritableKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaWritableKey property has an OSBoolean + * value and describes whether the media is writable. + */ + +#define kIOMediaWritableKey "Writable" + +/*! + * @defined kIOMediaContentMaskKey + * @abstract + * A property of IOMedia clients. + * @discussion + * The kIOMediaContentMaskKey property has an OSString + * value and must exist in all IOMedia clients that + * drive new content (that is, produce new media objects). When the client + * matches against the provider media, the value of the client's + * kIOMediaContentMaskKey property is used to replace the provider's + * kIOMediaContentKey property. + */ + +#define kIOMediaContentMaskKey "Content Mask" + +/*! + * @defined kIOMediaIconKey + * @abstract + * A property of any object in the media stack. + * @discussion + * kIOMediaIconKey is a property of any object in the media stack that wishes + * to override the default icon shown for the media objects in the stack. It + * is usually defined in a provider object below the media object. It has an + * OSDictionary value, with properties identical to the kIOIconKey definition, + * that is, kCFBundleIdentifierKey and kIOBundleResourceFileKey. + */ + +#define kIOMediaIconKey "IOMediaIcon" + +/*! + * @enum IOMediaAttributeMask + * @discussion + * The IOMediaAttributeMask bit mask describes various attributes of + * the media object, such as its ejectability and its removability. + * @constant kIOMediaAttributeEjectableMask + * Indicates whether the media is ejectable from the drive mechanism + * under software control. Implies kIOMediaAttributeRemovableMask. + * @constant kIOMediaAttributeRemovableMask + * Indicates whether the media is removable from the drive mechanism. + */ + +enum +{ + kIOMediaAttributeEjectableMask = 0x00000001, + kIOMediaAttributeRemovableMask = 0x00000002, + kIOMediaAttributeReservedMask = 0xFFFFFFFC +}; + +typedef UInt32 IOMediaAttributeMask; + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOStorage.h> + +/*! + * @class IOMedia + * @abstract + * A random-access disk device abstraction. + * @discussion + * The IOMedia class is a random-access disk device abstraction. It provides a + * consistent interface for both real and virtual disk devices, for subdivisions + * of disks such as partitions, for supersets of disks such as RAID volumes, and + * so on. It extends the IOStorage class by implementing the appropriate open, + * close, read, write, and matching semantics for media objects. The properties + * it has reflect the properties of real disk devices, such as ejectability and + * writability. + * + * The read and write interfaces support byte-level access to the storage space, + * with the appropriate deblocking handled by the block storage driver, however, + * a typical client will want to get the natural block size in order to optimize + * access to the real disk device. A read or write is accepted so long as the + * client's access is valid, the media is formatted and the transfer is within + * the bounds of the media. An optional non-zero base (offset) is then applied + * before the read or write is passed to the provider object. + */ + +class IOMedia : public IOStorage +{ + OSDeclareDefaultStructors(IOMedia) + +protected: + +#ifdef KERNEL_PRIVATE + struct ExpansionData { + IOLock * _lock; + OSArray * _probeList; + bool _needRegisterService; + }; + #define mediaManagementLock ( IOMedia::_expansionData->_lock ) + #define mediaProbeList ( IOMedia::_expansionData->_probeList ) + #define mediaNeedRegisterService ( IOMedia::_expansionData->_needRegisterService ) +#else /* KERNEL_PRIVATE */ + struct ExpansionData { /* */ }; +#endif /* KERNEL_PRIVATE */ + + ExpansionData * _expansionData; + + UInt32 _attributes; + + bool _isWhole; + bool _isWritable; + + UInt64 _mediaBase; /* (relative to the storage object below us) */ + UInt64 _mediaSize; + + IOStorageAccess _openLevel; + OSDictionary * _openClients; + + UInt32 _reserved0320; + + UInt64 _preferredBlockSize; + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free() APPLE_KEXT_OVERRIDE; + + /*! + * @function handleOpen + * @discussion + * The handleOpen method grants or denies permission to access this object + * to an interested client. The argument is an IOStorageAccess value that + * specifies the level of access desired -- reader or reader-writer. + * + * This method can be invoked to upgrade or downgrade the access level for + * an existing client as well. The previous access level will prevail for + * upgrades that fail, of course. A downgrade should never fail. If the + * new access level should be the same as the old for a given client, this + * method will do nothing and return success. In all cases, one, singular + * close-per-client is expected for all opens-per-client received. + * + * This implementation replaces the IOService definition of handleOpen(). + * @param client + * Client requesting the open. + * @param options + * Options for the open. Set to zero. + * @param access + * Access level for the open. Set to kIOStorageAccessReader or + * kIOStorageAccessReaderWriter. + * @result + * Returns true if the open was successful, false otherwise. + */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * access) APPLE_KEXT_OVERRIDE; + + /*! + * @function handleIsOpen + * @discussion + * The handleIsOpen method determines whether the specified client, or any + * client if none is specified, presently has an open on this object. + * + * This implementation replaces the IOService definition of handleIsOpen(). + * @param client + * Client to check the open state of. Set to zero to check the open state + * of all clients. + * @result + * Returns true if the client was (or clients were) open, false otherwise. + */ + + virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE; + + /*! + * @function handleClose + * @discussion + * The handleClose method closes the client's access to this object. + * + * This implementation replaces the IOService definition of handleClose(). + * @param client + * Client requesting the close. + * @param options + * Options for the close. Set to zero. + */ + + virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE; + +#ifdef KERNEL_PRIVATE +private: + + void scheduleProbe ( IOService * driver ); + void scheduleRegisterService( void ); + +public: + + /*! + * @function close + * @abstract Releases active access to a provider. + * @discussion IOService provides generic open and close semantics to track + * clients of a provider that have established an active datapath. The use + * of open and close, and rules regarding * ownership are family defined, + * and defined by the handleOpen and handleClose methods in the provider. + * @param client Designates the client of the provider requesting the + * close. + * @param options Options available for the close. The provider family may + * implement options for close; IOService defines none. + */ + + virtual void close( IOService * client, + IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; + +#endif /* KERNEL_PRIVATE */ + +public: + + using IOStorage::read; + using IOStorage::write; + + /* + * This method is called for each client interested in the services we + * provide. The superclass links us as a parent to this client in the + * I/O Kit registry on success. + */ + + virtual bool attachToChild(IORegistryEntry * client, + const IORegistryPlane * plane) APPLE_KEXT_OVERRIDE; + + /* + * This method is called for each client that loses interest in the + * services we provide. The superclass unlinks us from this client + * in the I/O Kit registry on success. + */ + + virtual void detachFromChild(IORegistryEntry * client, + const IORegistryPlane * plane) APPLE_KEXT_OVERRIDE; + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of OSObject -- IOStorage. This method + * serves simply as a convenience to subclass developers. + */ + + virtual IOStorage * getProvider() const APPLE_KEXT_OVERRIDE; + + /* + * Compare the properties in the supplied table to this object's properties. + */ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score) APPLE_KEXT_OVERRIDE; + + /*! + * @function read + * @discussion + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE; + + /*! + * @function write + * @discussion + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE; + + /*! + * @function synchronize + * @discussion + * Flush the cached data in the storage object, if any. + * @param client + * Client requesting the synchronization. + * @param byteStart + * Starting byte offset for the synchronization. + * @param byteCount + * Size of the synchronization. Set to zero to specify the end-of-media. + * @param options + * Options for the synchronization. See IOStorageSynchronizeOptions. + * @result + * Returns the status of the synchronization. + */ + + virtual IOReturn synchronize(IOService * client, + UInt64 byteStart, + UInt64 byteCount, + IOStorageSynchronizeOptions options = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function unmap + * @discussion + * Delete unused data from the storage object at the specified byte offsets. + * @param client + * Client requesting the operation. + * @param extents + * List of extents. See IOStorageExtent. It is legal for the callee to + * overwrite the contents of this buffer in order to satisfy the request. + * @param extentsCount + * Number of extents. + * @param options + * Options for the unmap. See IOStorageUnmapOptions. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn unmap(IOService * client, + IOStorageExtent * extents, + UInt32 extentsCount, + IOStorageUnmapOptions options = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function getProvisionStatus + * @discussion + * Get device block provision status + * @param client + * Client requesting the synchronization. + * @param byteStart + * Byte offset of logical extent on the device. + * @param byteCount + * Byte length of logical extent on the device, 0 mean the entire remaining space. + * @param extentsCount + * Number of extents allocated in extents. On return, this parameter indicate number + * of provision extents returned. + * @param extents + * List of provision extents. See IOStorageProvisionExtents. + * @result + * Returns the status of the getProvisionStatus. + */ + + virtual IOReturn getProvisionStatus(IOService * client, + UInt64 byteStart, + UInt64 byteCount, + UInt32 * extentsCount, + IOStorageProvisionExtent * extents, + IOStorageGetProvisionStatusOptions options = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function lockPhysicalExtents + * @discussion + * Lock the contents of the storage object against relocation temporarily, + * for the purpose of getting physical extents. + * @param client + * Client requesting the operation. + * @result + * Returns true if the lock was successful, false otherwise. + */ + + virtual bool lockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE; + + /*! + * @function copyPhysicalExtent + * @discussion + * Convert the specified byte offset into a physical byte offset, relative + * to a physical storage object. This call should only be made within the + * context of lockPhysicalExtents(). + * @param client + * Client requesting the operation. + * @param byteStart + * Starting byte offset for the operation. Returns a physical byte offset, + * relative to the physical storage object, on success. + * @param byteCount + * Size of the operation. Returns the actual number of bytes which can be + * transferred, relative to the physical storage object, on success. + * @result + * A reference to the physical storage object, which should be released by + * the caller, or a null on error. + */ + + virtual IOStorage * copyPhysicalExtent(IOService * client, + UInt64 * byteStart, + UInt64 * byteCount) APPLE_KEXT_OVERRIDE; + + /*! + * @function unlockPhysicalExtents + * @discussion + * Unlock the contents of the storage object for relocation again. This + * call must balance a successful call to lockPhysicalExtents(). + * @param client + * Client requesting the operation. + */ + + virtual void unlockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE; + + /*! + * @function setPriority + * @discussion + * Reprioritize read or write requests at the specified byte offsets. + * @param client + * Client requesting the operation. + * @param extents + * List of extents. See IOStorageExtent. It is legal for the callee to + * overwrite the contents of this buffer in order to satisfy the request. + * @param extentsCount + * Number of extents. + * @param priority + * New priority. See IOStoragePriority. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setPriority(IOService * client, + IOStorageExtent * extents, + UInt32 extentsCount, + IOStoragePriority priority) APPLE_KEXT_OVERRIDE; + + /*! + * @function getPreferredBlockSize + * @discussion + * Ask the media object for its natural block size. This information + * is useful to clients that want to optimize access to the media. + * @result + * Natural block size, in bytes. + */ + + virtual UInt64 getPreferredBlockSize() const; + + /*! + * @function getSize + * @discussion + * Ask the media object for its total length in bytes. + * @result + * Media size, in bytes. + */ + + virtual UInt64 getSize() const; + + /*! + * @function getBase + * @discussion + * Ask the media object for its byte offset relative to the provider media. + * @result + * Media offset, in bytes. + */ + + virtual UInt64 getBase() const; + + /*! + * @function isEjectable + * @discussion + * Ask the media object whether it is ejectable. + * @result + * Returns true if the media is ejectable, false otherwise. + */ + + virtual bool isEjectable() const; + + /*! + * @function isFormatted + * @discussion + * Ask the media object whether it is formatted. + * @result + * Returns true if the media is formatted, false otherwise. + */ + + virtual bool isFormatted() const; + + /*! + * @function isWhole + * @discussion + * Ask the media object whether it represents the whole disk. + * @result + * Returns true if the media represents the whole disk, false otherwise. + */ + + virtual bool isWhole() const; + + /*! + * @function isWritable + * @discussion + * Ask the media object whether it is writable. + * @result + * Returns true if the media is writable, false otherwise. + */ + + virtual bool isWritable() const; + + /*! + * @function getContent + * @discussion + * Ask the media object for a description of its contents. The description + * is the same as the hint at the time of the object's creation, but it is + * possible that the description has been overridden by a client (which has probed + * the media and identified the content correctly) of the media object. It + * is more accurate than the hint for this reason. The string is formed in + * the likeness of Apple's "Apple_HFS" strings or in the likeness of a UUID. + * + * The content description can be overridden by any client that matches onto + * this media object with a match category of kIOStorageCategory. The media + * object checks for a kIOMediaContentMaskKey property in the client, and if + * it finds one, it copies it into kIOMediaContentKey property. + * @result + * Description of media's contents. + */ + + virtual const char * getContent() const; + + /*! + * @function getContentHint + * @discussion + * Ask the media object for a hint of its contents. The hint is set at the + * time of the object's creation, should the creator have a clue as to what + * it may contain. The hint string does not change for the lifetime of the + * object and is also formed in the likeness of Apple's "Apple_HFS" strings + * or in the likeness of a UUID. + * @result + * Hint of media's contents. + */ + + virtual const char * getContentHint() const; + + /*! + * @function init + * @discussion + * Initialize this object's minimal state. + * @param base + * Media offset, in bytes. + * @param size + * Media size, in bytes. + * @param preferredBlockSize + * Natural block size, in bytes. + * @param attributes + * Media attributes, such as ejectability and removability. See + * IOMediaAttributeMask. + * @param isWhole + * Indicates whether the media represents the whole disk. + * @param isWritable + * Indicates whether the media is writable. + * @param contentHint + * Hint of media's contents (optional). See getContentHint(). + * @param properties + * Substitute property table for this object (optional). + * @result + * Returns true on success, false otherwise. + */ + + virtual bool init(UInt64 base, + UInt64 size, + UInt64 preferredBlockSize, + IOMediaAttributeMask attributes, + bool isWhole, + bool isWritable, + const char * contentHint = 0, + OSDictionary * properties = 0); + + /*! + * @function getAttributes + * @discussion + * Ask the media object for its attributes. + * @result + * Media attributes, such as ejectability and removability. See + * IOMediaAttributeMask. + */ + + virtual IOMediaAttributeMask getAttributes() const; + + OSMetaClassDeclareReservedUnused(IOMedia, 0); + OSMetaClassDeclareReservedUnused(IOMedia, 1); + OSMetaClassDeclareReservedUnused(IOMedia, 2); + OSMetaClassDeclareReservedUnused(IOMedia, 3); + OSMetaClassDeclareReservedUnused(IOMedia, 4); + OSMetaClassDeclareReservedUnused(IOMedia, 5); + OSMetaClassDeclareReservedUnused(IOMedia, 6); + OSMetaClassDeclareReservedUnused(IOMedia, 7); + OSMetaClassDeclareReservedUnused(IOMedia, 8); + OSMetaClassDeclareReservedUnused(IOMedia, 9); + OSMetaClassDeclareReservedUnused(IOMedia, 10); + OSMetaClassDeclareReservedUnused(IOMedia, 11); + OSMetaClassDeclareReservedUnused(IOMedia, 12); + OSMetaClassDeclareReservedUnused(IOMedia, 13); + OSMetaClassDeclareReservedUnused(IOMedia, 14); + OSMetaClassDeclareReservedUnused(IOMedia, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOMEDIA_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOMediaBSDClient.h b/QualcommWireless/include/IOKit/storage/IOMediaBSDClient.h new file mode 100644 index 0000000..5896971 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOMediaBSDClient.h @@ -0,0 +1,142 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOMEDIABSDCLIENT_H +#define _IOMEDIABSDCLIENT_H + +#include <sys/disk.h> + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <sys/conf.h> +#include <IOKit/storage/IOMedia.h> + +class AnchorTable; +class MinorTable; +struct MinorSlot; + +UInt64 _IOMediaBSDClientGetThrottleMask(IOMedia * media); + +/* + * Class + */ + +class IOMediaBSDClient : public IOService +{ + OSDeclareDefaultStructors(IOMediaBSDClient) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +private: + + AnchorTable * _anchors; + UInt32 _reserved0064 __attribute__ ((unused)); + UInt32 _reserved0096 __attribute__ ((unused)); + MinorTable * _minors; + UInt32 _reserved0160 __attribute__ ((unused)); + +protected: + + /* + * Find the whole media that roots the given media tree. + */ + + virtual IOMedia * getWholeMedia( IOMedia * media, + UInt32 * slicePathSize = 0, + char * slicePath = 0 ); + + /* + * Create bdevsw and cdevsw nodes for the given media object. + */ + + virtual bool createNodes(IOMedia * media); + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free() APPLE_KEXT_OVERRIDE; + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IOMedia. This method + * method serves simply as a convenience to subclass developers. + */ + + virtual IOMedia * getProvider() const APPLE_KEXT_OVERRIDE; + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE; + + /* + * This method is called once we have been attached to the provider object. + */ + + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + + /* + * This method is called when we are to terminate from the provider object. + */ + + virtual bool terminate(IOOptionBits options) APPLE_KEXT_OVERRIDE; + + /* + * Process a foreign ioctl. + */ + + virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc); + + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 0); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 1); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 2); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 3); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 4); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 5); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 6); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 7); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 8); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 9); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 10); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 11); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 12); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 13); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 14); + OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOMEDIABSDCLIENT_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOPartitionScheme.h b/QualcommWireless/include/IOKit/storage/IOPartitionScheme.h new file mode 100644 index 0000000..3d54142 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOPartitionScheme.h @@ -0,0 +1,481 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOPartitionScheme + * @abstract + * This header contains the IOPartitionScheme class definition. + */ + +#ifndef _IOPARTITIONSCHEME_H +#define _IOPARTITIONSCHEME_H + +/*! + * @defined kIOPartitionSchemeClass + * @abstract + * The name of the IOPartitionScheme class. + * @discussion + * kIOPartitionSchemeClass is the name of the IOPartitionScheme class. + */ + +#define kIOPartitionSchemeClass "IOPartitionScheme" + +/*! + * @defined kIOMediaBaseKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaBaseKey property has an OSNumber value and is placed into an + * IOMedia instance created via the partition scheme. It describes the byte + * offset of the partition relative to the provider media. + */ + +#define kIOMediaBaseKey "Base" + +/*! + * @defined kIOMediaLiveKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaLiveKey property has an OSBoolean + * value and is placed into an IOMedia instance + * created via the partition scheme. It describes whether the + * partition is live, that is, it is up-to-date with respect + * to the on-disk partition table. + */ + +#define kIOMediaLiveKey "Live" + +/*! + * @defined kIOMediaPartitionIDKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaPartitionIDKey property has an OSNumber + * value and is placed into an IOMedia instance + * created via the partition scheme. It is an ID that differentiates one + * partition from the other (within a given scheme). It is typically an index + * into the on-disk partition table. + */ + +#define kIOMediaPartitionIDKey "Partition ID" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOMedia.h> +#include <IOKit/storage/IOStorage.h> + +/*! + * @class IOPartitionScheme + * @abstract + * The common base class for all partition scheme + * objects. + * @discussion + * The IOPartitionScheme class is the common base class for all partition scheme + * objects. It extends the IOStorage class by implementing the appropriate open + * and close semantics for partition objects (standard semantics are to act as a + * multiplexor for incoming opens, producing one outgoing open with the correct + * access). It also implements the default read and write semantics, which pass + * all reads and writes through to the provider media unprocessed. For simple + * schemes, the default behavior is sufficient. More complex partition schemes + * such as RAID will want to do extra processing for reads and writes. + */ + +class IOPartitionScheme : public IOStorage +{ + OSDeclareDefaultStructors(IOPartitionScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + IOStorageAccess _openLevel; + OSSet * _openReaders; + OSSet * _openReaderWriters; + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free() APPLE_KEXT_OVERRIDE; + + /*! + * @function handleOpen + * @discussion + * The handleOpen method grants or denies permission to access this object + * to an interested client. The argument is an IOStorageAccess value that + * specifies the level of access desired -- reader or reader-writer. + * + * This method can be invoked to upgrade or downgrade the access level for + * an existing client as well. The previous access level will prevail for + * upgrades that fail, of course. A downgrade should never fail. If the + * new access level should be the same as the old for a given client, this + * method will do nothing and return success. In all cases, one, singular + * close-per-client is expected for all opens-per-client received. + * + * This implementation replaces the IOService definition of handleOpen(). + * @param client + * Client requesting the open. + * @param options + * Options for the open. Set to zero. + * @param access + * Access level for the open. Set to kIOStorageAccessReader or + * kIOStorageAccessReaderWriter. + * @result + * Returns true if the open was successful, false otherwise. + */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * access) APPLE_KEXT_OVERRIDE; + + /*! + * @function handleIsOpen + * @discussion + * The handleIsOpen method determines whether the specified client, or any + * client if none is specified, presently has an open on this object. + * + * This implementation replaces the IOService definition of handleIsOpen(). + * @param client + * Client to check the open state of. Set to zero to check the open state + * of all clients. + * @result + * Returns true if the client was (or clients were) open, false otherwise. + */ + + virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE; + + /*! + * @function handleClose + * @discussion + * The handleClose method closes the client's access to this object. + * + * This implementation replaces the IOService definition of handleClose(). + * @param client + * Client requesting the close. + * @param options + * Options for the close. Set to zero. + */ + + virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE; + + /* + * Attach the given media object to the device tree plane. + */ + + virtual bool attachMediaObjectToDeviceTree(IOMedia * media); + + /* + * Detach the given media object from the device tree plane. + */ + + virtual void detachMediaObjectFromDeviceTree(IOMedia * media); + + /* + * Updates a set of existing partitions, represented by partitionsOld, + * with possible updates from a rescan of the disk, represented by + * partitionsNew. It returns a new set of partitions with the results, + * removing partitions from partitionsOld where applicable, adding + * partitions from partitionsNew where applicable, and folding in property + * changes to partitions from partitionsNew into partitionsOld where + * applicable. + */ + + virtual OSSet * juxtaposeMediaObjects(OSSet * partitionsOld, + OSSet * partitionsNew); + +public: + + using IOStorage::read; + using IOStorage::write; + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function read + * @discussion + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * + * For simple partition schemes, the default behavior is to simply pass the + * read through to the provider media. More complex partition schemes such + * as RAID will need to do extra processing here. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE; + + /*! + * @function write + * @discussion + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * + * For simple partition schemes, the default behavior is to simply pass the + * write through to the provider media. More complex partition schemes such + * as RAID will need to do extra processing here. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE; + + /*! + * @function synchronize + * @discussion + * Flush the cached data in the storage object, if any. + * @param client + * Client requesting the synchronization. + * @param byteStart + * Starting byte offset for the synchronization. + * @param byteCount + * Size of the synchronization. Set to zero to specify the end-of-media. + * @param options + * Options for the synchronization. See IOStorageSynchronizeOptions. + * @result + * Returns the status of the synchronization. + */ + + virtual IOReturn synchronize(IOService * client, + UInt64 byteStart, + UInt64 byteCount, + IOStorageSynchronizeOptions options = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function unmap + * @discussion + * Delete unused data from the storage object at the specified byte offsets. + * @param client + * Client requesting the operation. + * @param extents + * List of extents. See IOStorageExtent. It is legal for the callee to + * overwrite the contents of this buffer in order to satisfy the request. + * @param extentsCount + * Number of extents. + * @param options + * Options for the unmap. See IOStorageUnmapOptions. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn unmap(IOService * client, + IOStorageExtent * extents, + UInt32 extentsCount, + IOStorageUnmapOptions options = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function getProvisionStatus + * @discussion + * Get device block provision status + * @param client + * Client requesting the synchronization. + * @param byteStart + * Byte offset of logical extent on the device. + * @param byteCount + * Byte length of logical extent on the device, 0 mean the entire remaining space. + * @param extentsCount + * Number of extents allocated in extents. On return, this parameter indicate number + * of provision extents returned. + * @param extents + * List of provision extents. See IOStorageProvisionExtents. + * @result + * Returns the status of the getProvisionStatus. + */ + + virtual IOReturn getProvisionStatus(IOService * client, + UInt64 byteStart, + UInt64 byteCount, + UInt32 * extentsCount, + IOStorageProvisionExtent * extents, + IOStorageGetProvisionStatusOptions options = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @function lockPhysicalExtents + * @discussion + * Lock the contents of the storage object against relocation temporarily, + * for the purpose of getting physical extents. + * @param client + * Client requesting the operation. + * @result + * Returns true if the lock was successful, false otherwise. + */ + + virtual bool lockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE; + + /*! + * @function copyPhysicalExtent + * @discussion + * Convert the specified byte offset into a physical byte offset, relative + * to a physical storage object. This call should only be made within the + * context of lockPhysicalExtents(). + * @param client + * Client requesting the operation. + * @param byteStart + * Starting byte offset for the operation. Returns a physical byte offset, + * relative to the physical storage object, on success. + * @param byteCount + * Size of the operation. Returns the actual number of bytes which can be + * transferred, relative to the physical storage object, on success. + * @result + * A reference to the physical storage object, which should be released by + * the caller, or a null on error. + */ + + virtual IOStorage * copyPhysicalExtent(IOService * client, + UInt64 * byteStart, + UInt64 * byteCount) APPLE_KEXT_OVERRIDE; + + /*! + * @function unlockPhysicalExtents + * @discussion + * Unlock the contents of the storage object for relocation again. This + * call must balance a successful call to lockPhysicalExtents(). + * @param client + * Client requesting the operation. + */ + + virtual void unlockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE; + + /*! + * @function setPriority + * @discussion + * Reprioritize read or write requests at the specified byte offsets. + * @param client + * Client requesting the operation. + * @param extents + * List of extents. See IOStorageExtent. It is legal for the callee to + * overwrite the contents of this buffer in order to satisfy the request. + * @param extentsCount + * Number of extents. + * @param priority + * New priority. See IOStoragePriority. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setPriority(IOService * client, + IOStorageExtent * extents, + UInt32 extentsCount, + IOStoragePriority priority) APPLE_KEXT_OVERRIDE; + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of OSObject -- an IOMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOMedia * getProvider() const APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 0); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 1); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 2); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 3); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 4); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 5); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 6); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 7); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 8); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 9); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 10); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 11); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 12); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 13); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 14); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 15); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 16); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 17); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 18); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 19); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 20); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 21); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 22); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 23); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 24); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 25); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 26); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 27); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 28); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 29); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 30); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 31); +}; + +#ifdef KERNEL_PRIVATE +#define kIOPartitionScheme_partition_valid ( ( intptr_t ) 1 ) +#define _partitionSchemeState ( *( intptr_t *) &( IOPartitionScheme::_expansionData ) ) +#endif /* KERNEL_PRIVATE */ + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOPARTITIONSCHEME_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOStorage.h b/QualcommWireless/include/IOKit/storage/IOStorage.h new file mode 100644 index 0000000..34930be --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOStorage.h @@ -0,0 +1,788 @@ +/* + * Copyright (c) 1998-2015 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOStorage + * @abstract + * This header contains the IOStorage class definition. + */ + +#ifndef _IOSTORAGE_H +#define _IOSTORAGE_H + +#include <sys/kernel_types.h> +#include <IOKit/IOTypes.h> + +/*! + * @defined kIOStorageClass + * @abstract + * The name of the IOStorage class. + */ + +#define kIOStorageClass "IOStorage" + +/*! + * @defined kIOStorageCategory + * @abstract + * kIOStorageCategory is a value for IOService's kIOMatchCategoryKey property. + * @discussion + * The kIOStorageCategory value is the standard value for the IOService property + * kIOMatchCategoryKey ("IOMatchCategory") for all storage drivers. All storage + * objects that expect to drive new content (that is, produce new media objects) + * are expected to compete within the kIOStorageCategory namespace. + * + * See the IOService documentation for more information on match categories. + */ + +#define kIOStorageCategory "IOStorage" /* (as IOMatchCategory) */ + +/*! + * @defined kIOStorageFeaturesKey + * @abstract + * A property of any object in the storage stack. + * @discussion + * kIOStorageFeaturesKey is a property of any object in the storage stack that + * wishes to express support of additional features, such as Force Unit Access. + * It is typically defined in the device object below the block storage driver + * object. It has an OSDictionary value, where each entry describes one given + * feature. + */ + +#define kIOStorageFeaturesKey "IOStorageFeatures" + +/*! + * @defined kIOStorageFeatureBarrier + * @abstract + * Describes the presence of the Barrier feature. + * @discussion + * This property describes the ability of the storage stack to honor a write + * barrier, guaranteeing that on power loss, writes after the barrier will not + * be visible until all writes before the barrier are visible. It is one of the + * feature entries listed under the top-level kIOStorageFeaturesKey property + * table. It has an OSBoolean value. + */ + +#define kIOStorageFeatureBarrier "Barrier" + +/*! + * @defined kIOStorageFeatureForceUnitAccess + * @abstract + * Describes the presence of the Force Unit Access feature. + * @discussion + * This property describes the ability of the storage stack to force a request + * to access the media. It is one of the feature entries listed under the top- + * level kIOStorageFeaturesKey property table. It has an OSBoolean value. + */ + +#define kIOStorageFeatureForceUnitAccess "Force Unit Access" + +/*! + * @defined kIOStorageFeaturePriority + * @abstract + * Describes the presence of the Priority feature. + * @discussion + * This property describes the ability of the storage stack to enforce the + * priority of a request. It is one of the feature entries listed under the + * top-level kIOStorageFeaturesKey property table. It has an OSBoolean value. + */ + +#define kIOStorageFeaturePriority "Priority" + +/*! + * @defined kIOStorageFeatureUnmap + * @abstract + * Describes the presence of the Unmap feature. + * @discussion + * This property describes the ability of the storage stack to delete unused + * data from the media. It is one of the feature entries listed under the top- + * level kIOStorageFeaturesKey property table. It has an OSBoolean value. + */ + +#define kIOStorageFeatureUnmap "Unmap" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/assert.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOService.h> + +/*! + * @enum IOStorageAccess + * @discussion + * The IOStorageAccess enumeration describes the possible access levels for open + * requests. + * @constant kIOStorageAccessNone + * No access is requested; should not be passed to open(). + * @constant kIOStorageAccessReader + * Read-only access is requested. + * @constant kIOStorageAccessReaderWriter + * Read and write access is requested. + * @constant kIOStorageAccessSharedLock + * Shared access is requested. + * @constant kIOStorageAccessExclusiveLock + * Exclusive access is requested. + */ + +enum +{ + kIOStorageAccessNone = 0x00, + kIOStorageAccessReader = 0x01, + kIOStorageAccessReaderWriter = 0x03, + kIOStorageAccessSharedLock = 0x04, + kIOStorageAccessExclusiveLock = 0x08 +}; + +typedef UInt32 IOStorageAccess; + +/*! + * @enum IOStorageOptions + * @discussion + * Options for read and write storage requests. + * @constant kIOStorageOptionForceUnitAccess + * Force the request to access the media. + * @constant kIOStorageOptionIsEncrypted + * The data is already encrypted. + * @constant kIOStorageOptionIsStatic + * The data is likely to remain unaltered. + */ + +enum +{ + kIOStorageOptionNone = 0x0000, + kIOStorageOptionForceUnitAccess = 0x0001, + kIOStorageOptionIsEncrypted = 0x0010, + kIOStorageOptionIsStatic = 0x0020, + kIOStorageOptionReserved = 0xFFCE +}; + +typedef UInt16 IOStorageOptions; + +/*! + * @enum IOStoragePriority + * @discussion + * Priority of read and write storage requests. The lower the value, the + * higher the priority. + * @constant kIOStoragePriorityHigh + * This priority should only be used for I/O that is critical to system + * responsiveness. + * @constant kIOStoragePriorityDefault + * This priority is for work requested by the user, but that is not the user's + * current focus. + * @constant kIOStoragePriorityLow + * This priority is for short-running background work. + * @constant kIOStoragePriorityBackground + * This priority is for long-running, I/O intensive background work, such as + * backups, search indexing, or file synchronization. + */ + +enum +{ + kIOStoragePriorityHigh = 63, /* 0 to 63 */ + kIOStoragePriorityDefault = 127, /* 64 to 127 */ + kIOStoragePriorityLow = 191, /* 128 to 191 */ + kIOStoragePriorityBackground = 255 /* 192 to 255 */ +}; + +typedef UInt8 IOStoragePriority; + +/*! + * @enum IOStorageSynchronizeOptions + * @discussion + * Options for synchronize storage requests. + * @constant kIOStorageSynchronizeOptionBarrier + * Issue a write barrier only. + */ + +enum +{ + kIOStorageSynchronizeOptionNone = 0x00000000, + kIOStorageSynchronizeOptionBarrier = 0x00000002, + kIOStorageSynchronizeOptionReserved = 0xFFFFFFFD +}; + +typedef UInt32 IOStorageSynchronizeOptions; + +/*! + * @enum IOStorageUnmapOptions + * @discussion + * Options for unmap storage requests. + */ + +enum +{ + kIOStorageUnmapOptionReserved = 0xFFFFFFFF +}; + +typedef UInt32 IOStorageUnmapOptions; + +/*! + * @struct IOStorageAttributes + * @discussion + * Attributes of read and write storage requests. + * @field options + * Options for the request. See IOStorageOptions. + * @field priority + * Priority of the request. See IOStoragePriority. + * @field bufattr + * Reserved for future use. Set to zero. + */ + +struct IOStorageAttributes +{ + IOStorageOptions options; + IOStoragePriority priority; + UInt8 reserved0024; + UInt32 reserved0032; + UInt64 reserved0064; + UInt64 adjustedOffset; + bufattr_t bufattr; +}; + +/*! + * @struct IOStorageExtent + * @discussion + * Extent for unmap storage requests. + * @field byteStart + * Starting byte offset for the operation. + * @field byteCount + * Size of the operation. + */ + +struct IOStorageExtent +{ + UInt64 byteStart; + UInt64 byteCount; +}; + +/*! + * @enum IOStorageProvisionTypes + * @discussion + * Device block provision types, such as mapped, deallocated, or anchored. See SCSI + * SBC4 specifiction, LBA status descriptor for definitions. + */ + +enum +{ + kIOStorageProvisionTypeMapped = 0x00, + kIOStorageProvisionTypeDeallocated = 0x01, + kIOStorageProvisionTypeAnchored = 0x02 +}; + +typedef UInt64 IOStorageGetProvisionStatusOptions; +/*! + * @struct IOStorageProvisionExtent + * @discussion + * Extent for provision status. + * @field byteStart + * Starting byte offset for the operation. + * @field byteCount + * Size of the operation. + * @field provisionType + * Block provision type. See IOStorageProvisionTypes. + */ + +struct IOStorageProvisionExtent +{ + UInt64 byteStart; + UInt64 byteCount; + UInt8 provisionType; + UInt8 reserved[7]; +}; + +/*! + * @typedef IOStorageCompletionAction + * @discussion + * The IOStorageCompletionAction declaration describes the C (or C++) completion + * routine that is called once an asynchronous storage operation completes. + * @param target + * Opaque client-supplied pointer (or an instance pointer for a C++ callback). + * @param parameter + * Opaque client-supplied pointer. + * @param status + * Status of the data transfer. + * @param actualByteCount + * Actual number of bytes transferred in the data transfer. + */ + +typedef void (*IOStorageCompletionAction)(void * target, + void * parameter, + IOReturn status, + UInt64 actualByteCount); + +/*! + * @struct IOStorageCompletion + * @discussion + * The IOStorageCompletion structure describes the C (or C++) completion routine + * that is called once an asynchronous storage operation completes. The values + * passed for the target and parameter fields will be passed to the routine when + * it is called. + * @field target + * Opaque client-supplied pointer (or an instance pointer for a C++ callback). + * @field action + * Completion routine to call on completion of the data transfer. + * @field parameter + * Opaque client-supplied pointer. + */ + +struct IOStorageCompletion +{ + void * target; + IOStorageCompletionAction action; + void * parameter; +}; + +/*! + * @class IOStorage + * @abstract + * The common base class for mass storage objects. + * @discussion + * The IOStorage class is the common base class for mass storage objects. It is + * an abstract class that defines the open/close/read/write APIs that need to be + * implemented in a given subclass. Synchronous versions of the read/write APIs + * are provided here -- they are coded in such a way as to wrap the asynchronous + * versions implemented in the subclass. + */ + +class IOStorage : public IOService +{ + OSDeclareAbstractStructors(IOStorage); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + /*! + * @function handleOpen + * @discussion + * The handleOpen method grants or denies permission to access this object + * to an interested client. The argument is an IOStorageAccess value that + * specifies the level of access desired -- reader or reader-writer. + * + * This method can be invoked to upgrade or downgrade the access level for + * an existing client as well. The previous access level will prevail for + * upgrades that fail, of course. A downgrade should never fail. If the + * new access level should be the same as the old for a given client, this + * method will do nothing and return success. In all cases, one, singular + * close-per-client is expected for all opens-per-client received. + * @param client + * Client requesting the open. + * @param options + * Options for the open. Set to zero. + * @param access + * Access level for the open. Set to kIOStorageAccessReader or + * kIOStorageAccessReaderWriter. + * @result + * Returns true if the open was successful, false otherwise. + */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * access) APPLE_KEXT_OVERRIDE = 0; + + /*! + * @function handleIsOpen + * @discussion + * The handleIsOpen method determines whether the specified client, or any + * client if none is specified, presently has an open on this object. + * @param client + * Client to check the open state of. Set to zero to check the open state + * of all clients. + * @result + * Returns true if the client was (or clients were) open, false otherwise. + */ + + virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE = 0; + + /*! + * @function handleClose + * @discussion + * The handleClose method closes the client's access to this object. + * @param client + * Client requesting the close. + * @param options + * Options for the close. Set to zero. + */ + + virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE = 0; + +public: + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual bool attach(IOService * provider) APPLE_KEXT_OVERRIDE; +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + /*! + * @function complete + * @discussion + * Invokes the specified completion action of the read/write request. If + * the completion action is unspecified, no action is taken. This method + * serves simply as a convenience to storage subclass developers. + * @param completion + * Completion information for the data transfer. + * @param status + * Status of the data transfer. + * @param actualByteCount + * Actual number of bytes transferred in the data transfer. + */ + + static void complete(IOStorageCompletion * completion, + IOReturn status, + UInt64 actualByteCount = 0); + + /*! + * @function open + * @discussion + * Ask the storage object for permission to access its contents; the method + * is equivalent to IOService::open(), but with the correct parameter types. + * + * This method may also be invoked to upgrade or downgrade the access of an + * existing open (if it fails, the existing open prevails). + * @param client + * Client requesting the open. + * @param options + * Options for the open. Set to zero. + * @param access + * Access level for the open. Set to kIOStorageAccessReader or + * kIOStorageAccessReaderWriter. + * @result + * Returns true if the open was successful, false otherwise. + */ + + virtual bool open(IOService * client, + IOOptionBits options, + IOStorageAccess access); + + /*! + * @function read + * @discussion + * Read data from the storage object at the specified byte offset into the + * specified buffer, synchronously. When the read completes, this method + * will return to the caller. The actual byte count field is optional. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes = 0, + UInt64 * actualByteCount = 0); + + /*! + * @function write + * @discussion + * Write data into the storage object at the specified byte offset from the + * specified buffer, synchronously. When the write completes, this method + * will return to the caller. The actual byte count field is optional. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes = 0, + UInt64 * actualByteCount = 0); + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual IOReturn synchronizeCache(IOService * client) __attribute__ ((deprecated)); +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + /*! + * @function read + * @discussion + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion) = 0; + + /*! + * @function write + * @discussion + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion) = 0; + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual IOReturn discard(IOService * client, + UInt64 byteStart, + UInt64 byteCount) __attribute__ ((deprecated)); +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + + /*! + * @function unmap + * @discussion + * Delete unused data from the storage object at the specified byte offsets. + * @param client + * Client requesting the operation. + * @param extents + * List of extents. See IOStorageExtent. It is legal for the callee to + * overwrite the contents of this buffer in order to satisfy the request. + * @param extentsCount + * Number of extents. + * @param options + * Options for the unmap. See IOStorageUnmapOptions. + * @result + * Returns the status of the operation. + */ + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual IOReturn unmap(IOService * client, + IOStorageExtent * extents, + UInt32 extentsCount, + IOStorageUnmapOptions options = 0); /* 10.6.6 */ +#else /* !TARGET_OS_OSX || !defined(__x86_64__) */ + virtual IOReturn unmap(IOService * client, + IOStorageExtent * extents, + UInt32 extentsCount, + IOStorageUnmapOptions options = 0) = 0; +#endif /* !TARGET_OS_OSX || !defined(__x86_64__) */ + + /*! + * @function lockPhysicalExtents + * @discussion + * Lock the contents of the storage object against relocation temporarily, + * for the purpose of getting physical extents. + * @param client + * Client requesting the operation. + * @result + * Returns true if the lock was successful, false otherwise. + */ + + virtual bool lockPhysicalExtents(IOService * client); /* 10.7.0 */ + + /*! + * @function copyPhysicalExtent + * @discussion + * Convert the specified byte offset into a physical byte offset, relative + * to a physical storage object. This call should only be made within the + * context of lockPhysicalExtents(). + * @param client + * Client requesting the operation. + * @param byteStart + * Starting byte offset for the operation. Returns a physical byte offset, + * relative to the physical storage object, on success. + * @param byteCount + * Size of the operation. Returns the actual number of bytes which can be + * transferred, relative to the physical storage object, on success. + * @result + * A reference to the physical storage object, which should be released by + * the caller, or a null on error. + */ + + virtual IOStorage * copyPhysicalExtent(IOService * client, + UInt64 * byteStart, + UInt64 * byteCount); /* 10.7.0 */ + + /*! + * @function unlockPhysicalExtents + * @discussion + * Unlock the contents of the storage object for relocation again. This + * call must balance a successful call to lockPhysicalExtents(). + * @param client + * Client requesting the operation. + */ + + virtual void unlockPhysicalExtents(IOService * client); /* 10.7.0 */ + + /*! + * @function setPriority + * @discussion + * Reprioritize read or write requests at the specified byte offsets. + * @param client + * Client requesting the operation. + * @param extents + * List of extents. See IOStorageExtent. It is legal for the callee to + * overwrite the contents of this buffer in order to satisfy the request. + * @param extentsCount + * Number of extents. + * @param priority + * New priority. See IOStoragePriority. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setPriority(IOService * client, + IOStorageExtent * extents, + UInt32 extentsCount, + IOStoragePriority priority); /* 10.10.0 */ + + /*! + * @function synchronize + * @discussion + * Flush the cached data in the storage object, if any. + * @param client + * Client requesting the synchronization. + * @param byteStart + * Starting byte offset for the synchronization. + * @param byteCount + * Size of the synchronization. Set to zero to specify the end-of-media. + * @param options + * Options for the synchronization. See IOStorageSynchronizeOptions. + * @result + * Returns the status of the synchronization. + */ + +#if TARGET_OS_OSX && defined(__x86_64__) + virtual IOReturn synchronize(IOService * client, + UInt64 byteStart, + UInt64 byteCount, + IOStorageSynchronizeOptions options = 0); /* 10.11.0 */ +#else /* !TARGET_OS_OSX || !defined(__x86_64__) */ + virtual IOReturn synchronize(IOService * client, + UInt64 byteStart, + UInt64 byteCount, + IOStorageSynchronizeOptions options = 0) = 0; +#endif /* !TARGET_OS_OSX || !defined(__x86_64__) */ + + /*! + * @function getProvisionStatus + * @discussion + * Get device block provision status + * @param client + * Client requesting the synchronization. + * @param byteStart + * Byte offset of logical extent on the device. + * @param byteCount + * Byte length of logical extent on the device, 0 mean the entire remaining space. + * @param extentsCount + * Number of extents allocated in extents. On return, this parameter indicate number + * of provision extents returned. + * @param extents + * List of provision extents. See IOStorageProvisionExtents. + * @param options + * Options for get provision status. See IOStorageGetProvisionStatusOptions. + * @result + * Returns the status of the getProvisionStatus. + */ + + virtual IOReturn getProvisionStatus(IOService * client, + UInt64 byteStart, + UInt64 byteCount, + UInt32 * extentsCount, + IOStorageProvisionExtent * extents, + IOStorageGetProvisionStatusOptions options = 0 ); /* 10.12.0 */ + + OSMetaClassDeclareReservedUsed(IOStorage, 0); + OSMetaClassDeclareReservedUsed(IOStorage, 1); + OSMetaClassDeclareReservedUsed(IOStorage, 2); + OSMetaClassDeclareReservedUsed(IOStorage, 3); + OSMetaClassDeclareReservedUsed(IOStorage, 4); + OSMetaClassDeclareReservedUsed(IOStorage, 5); + OSMetaClassDeclareReservedUsed(IOStorage, 6); + OSMetaClassDeclareReservedUnused(IOStorage, 7); + OSMetaClassDeclareReservedUnused(IOStorage, 8); + OSMetaClassDeclareReservedUnused(IOStorage, 9); + OSMetaClassDeclareReservedUnused(IOStorage, 10); + OSMetaClassDeclareReservedUnused(IOStorage, 11); + OSMetaClassDeclareReservedUnused(IOStorage, 12); + OSMetaClassDeclareReservedUnused(IOStorage, 13); + OSMetaClassDeclareReservedUnused(IOStorage, 14); + OSMetaClassDeclareReservedUnused(IOStorage, 15); +}; + +#if TARGET_OS_OSX && defined(__x86_64__) +#ifdef KERNEL_PRIVATE +#define _kIOStorageSynchronizeOption_super__synchronizeCache 0xFFFFFFFF +#define _respondsTo_synchronizeCache ( IOStorage::_expansionData ) +#endif /* KERNEL_PRIVATE */ +#endif /* TARGET_OS_OSX && defined(__x86_64__) */ + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOSTORAGE_H */ diff --git a/QualcommWireless/include/IOKit/storage/IOStorageCardCharacteristics.h b/QualcommWireless/include/IOKit/storage/IOStorageCardCharacteristics.h new file mode 100644 index 0000000..143b584 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOStorageCardCharacteristics.h @@ -0,0 +1,490 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_STORAGE_CARD_CHARACTERISTICS_H_ +#define _IOKIT_IO_STORAGE_CARD_CHARACTERISTICS_H_ + + +/* + * Card Characteristics - Characteristics defined for cards. + */ + +/*! +@defined kIOPropertyCardCharacteristicsKey +@discussion This key is used to define Card Characteristics for a particular +piece of MMC/SD media and it has an associated dictionary which lists the +card characteristics. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Card Characteristics</key> + <dict> + <key>Product Name</key> + <string>SD32G</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyCardCharacteristicsKey "Card Characteristics" + + +/*! +@defined kIOPropertySlotKey +@discussion This key is used to define the slot number for the device + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Slot</key> + <integer>1<integer> + </dict> +@/textblock +</pre> +*/ +#define kIOPropertySlotKey "Slot" + + +/*! +@defined kIOProperty64BitKey +@discussion This key defines wether the device supports 64-bit. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>64-bit</key> + <true/> +</dict> +@/textblock +</pre> +*/ +#define kIOProperty64BitKey "64-bit" + + +/*! +@defined kIOPropertyClockDivisorKey + @discussion This key defines the current clock divisor for the device. + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Clock Divisor</key> + <integer>128</integer> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyClockDivisorKey "Clock Divisor" + + +/*! +@defined kIOPropertyBaseFrequencyKey +@discussion This key defines the current base frequency for the device. + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Base Frequency</key> + <integer>50</integer> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyBaseFrequencyKey "Base Frequency" + + +/*! +@defined kIOPropertyBusVoltageKey +@discussion This key defines the current bus voltage for the device in mV + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Bus Voltage</key> + <integer>3300</integer> +</dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyBusVoltageKey "Bus Voltage" + + +/*! +@defined kIOPropertyBusWidthKey +@discussion This key defines the current bus width for the device. + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Bus Width</key> + <integer>4</integer> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyBusWidthKey "Bus Width" + + +/*! +@defined kIOPropertyCardPresentKey +@discussion This key defines wether a MMC or SD card is physically present. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Card Present</key> + <true/> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyCardPresentKey "Card Present" + + +/*! + @defined kIOPropertyProductSerialNumberKey + @discussion This key is used to indicate the card serial number ID. + + Requirement: Mandatory + + Example: + <pre> + @textblock + <dict> + <key>Card Characteristics</key> + <dict> + <key>Product Name</key> + <string>SD32G</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Card Type</key> + <string>SDHC</string> + <key>Serial Number</key> + <data>0045ff</data> + </dict> + </dict> + @/textblock + </pre> + */ +#define kIOPropertyProductSerialNumberKey "Serial Number" + + +/*! + @defined kIOPropertyManufacturerIDKey + @discussion This key is used to indicate the card manufacturer ID. + + Requirement: Optional + + Example: + <pre> + @textblock + <dict> + <key>Card Characteristics</key> + <dict> + <key>Product Name</key> + <string>SD32G</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Card Type</key> + <string>SDHC</string> + <key>Manufacturer ID</key> + <data>03</data> + </dict> + </dict> + @/textblock + </pre> + */ +#define kIOPropertyManufacturerIDKey "Manufacturer ID" + + +/*! +@defined kIOPropertyApplicationIDKey + @discussion This key is used to indicate the card application ID. + +Requirement: Optional + +Example: +<pre> +@textblock +<dict> + <key>Card Characteristics</key> + <dict> + <key>Product Name</key> + <string>SD32G</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Card Type</key> + <string>SDHC</string> + <key>Application ID</key> + <data>ffff</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyApplicationIDKey "Application ID" + + +/*! +@defined kIOPropertyManufacturingDateKey + @discussion This key is used to indicate the card manufacturing date. + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Card Characteristics</key> + <dict> + <key>Product Name</key> + <string>SD32G</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Card Type</key> + <string>SDHC</string> + <key>Manufacturing Date</key> + <string>2009-12</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyManufacturingDateKey "Manufacturing Date" + + +/*! +@defined kIOPropertySpeedClassKey + @discussion This key is used to indicate SD card speed class. + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Card Characteristics</key> + <dict> + <key>Product Name</key> + <string>SD32G</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Card Type</key> + <string>SDHC</string> + <key>Speed Class</key> + <data>02</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySpeedClassKey "Speed Class" + + +/*! +@defined kIOPropertySpecificationVersionKey +@discussion This key is used to indicate the card specification version. + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Card Characteristics</key> + <dict> + <key>Product Name</key> + <string>SD32G</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Card Type</key> + <string>SDHC</string> + <key>Specification Version</key> + <string>3.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySpecificationVersionKey "Specification Version" + + +/*! +@defined kIOPropertyCardTypeKey + @discussion This key is used to indicate the card type is MMC. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Card Characteristics</key> + <dict> + <key>Product Name</key> + <string>SD32G</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Card Type</key> + <string>MMC</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyCardTypeKey "Card Type" + + +/*! +@defined kIOPropertyCardTypeMMCKey + @discussion This key is used to indicate the card type is MMC. + + Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Card Characteristics</key> + <dict> + <key>Product Name</key> + <string>SD32G</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Card Type</key> + <string>MMC</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyCardTypeMMCKey "MMC" + + +/*! +@defined kIOPropertyCardTypeSDSCKey + @discussion This key is used to indicate the card type is SDSC. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Card Characteristics</key> + <dict> + <key>Product Name</key> + <string>SD32G</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Card Type</key> + <string>SDSC</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyCardTypeSDSCKey "SDSC" + + +/*! +@defined kIOPropertyCardTypeSDHCKey + @discussion This key is used to indicate the card type is SDHC. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Card Characteristics</key> + <dict> + <key>Product Name</key> + <string>SD32G</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Card Type</key> + <string>SDHC</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyCardTypeSDHCKey "SDHC" + + +/*! +@defined kIOPropertyCardTypeSDXCKey + @discussion This key is used to indicate the card type is SDXC. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Card Characteristics</key> + <dict> + <key>Product Name</key> + <string>SD32G</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Card Type</key> + <string>SDXC</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyCardTypeSDXCKey "SDXC" + + +#endif /* _IOKIT_IO_STORAGE_CARD_CHARACTERISTICS_H_ */ diff --git a/QualcommWireless/include/IOKit/storage/IOStorageControllerCharacteristics.h b/QualcommWireless/include/IOKit/storage/IOStorageControllerCharacteristics.h new file mode 100644 index 0000000..2705809 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOStorageControllerCharacteristics.h @@ -0,0 +1,1346 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_STORAGE_CONTROLLER_CHARACTERISTICS_H_ +#define _IOKIT_IO_STORAGE_CONTROLLER_CHARACTERISTICS_H_ + + +/* + * Controller Characteristics - Characteristics defined for controllers. + */ + + +/*! +@defined kIOPropertyControllerCharacteristicsKey +@discussion This key is used to define Controller Characteristics for a particular +device and it has an associated dictionary which lists the +controller characteristics. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyControllerCharacteristicsKey "Controller Characteristics" + + +/*! +@defined kIOPropertySASAddressKey +@discussion This key is the unique 64-bit SAS Address for the device server +node located at this port, or for the initiating host port. + +Requirement: Mandatory for SAS. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SAS Address</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySASAddressKey "SAS Address" + + +/*! +@defined kIOPropertySCSIPortIdentifierKey +@discussion This key is the unique port identifier for the device server +node located at this port, or for the initiating host port. The format for +this data is allowed to be vendor-specific, as long as it is guaranteed to +be unique. Length is arbitrary, to allow for itnerfaces with non-standard +identifier rules. It is recommended to have this be a copy of an existing +standard unique identifier for this port, should one already exist for your +interface type + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Unique SCSI Port Identifier</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIPortIdentifierKey "Unique SCSI Port Identifier" + + +/*! +@defined kIOPropertyFibreChannelNodeWorldWideNameKey +@discussion This key is the unique 64-bit World Wide Name for the device server +node located at this port, or for the initiating host port. + +Requirement: Mandatory for Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Node World Wide Name</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelNodeWorldWideNameKey "Node World Wide Name" + + +/*! +@defined kIOPropertyFibreChannelPortWorldWideNameKey +@discussion This key is the unique 64-bit World Wide Name for the port. + +Requirement: Mandatory for Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port World Wide Name</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelPortWorldWideNameKey "Port World Wide Name" + + +/*! +@defined kIOPropertyFibreChannelAddressIdentifierKey +@discussion This key is the 24-bit Address Identifier (S_ID or D_ID) as +defined in the FC-FS specification. It contains the address identifier +of the source or destination Nx_Port. + +Note: This value can change. It is not a static value. + +Requirement: Optional (only necessary for Fibre Channel Interface). + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Address Identifier</key> + <data>001122</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelAddressIdentifierKey "Address Identifier" + + +/*! +@defined kIOPropertyFibreChannelALPAKey +@discussion This key is the 8-bit Arbitrated Loop Physical Address +(AL_PA) value as defined in the FC-AL-2 specification. + +Note: This value can change. It is not a static value. + +Requirement: Optional (only necessary for Fibre Channel Interface). + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>AL_PA</key> + <data>04</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelALPAKey "AL_PA" + + +/*! +@defined kIOPropertyPortStatusKey +@discussion This key is associated with the current port +status of the physical link. The port status is either +"Link Established", "No Link Established", or "Link Failed". + +Note: This value can change when the port status changes. It +is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Status</key> + <string>Link Established</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortStatusKey "Port Status" + + +/*! +@defined kIOPropertyPortSpeedKey +@discussion This key is associated with the current port +speed. The port speed can be any valid speed for the interconnect. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (1 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedKey "Port Speed" + + +/*! +@defined kIOPropertyPortTopologyKey +@discussion This key is associated with the current port +topology. The port topology can be any valid topology for the interconnect. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>Automatic (N_Port)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyKey "Port Topology" + + +/*! +@defined kIOPropertyPortDescriptionKey +@discussion This key is associated with an human +readable port description. Examples include +"Channel A", "Port 1", etc. + +Requirement: Optional for all interconnects. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Description</key> + <string>Channel A</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortDescriptionKey "Port Description" + + +/*! +@defined kIOPropertySCSIParallelSignalingTypeKey +@discussion This key is associated with the signaling type +used for this SCSI Parallel bus. Valid values include +"High Voltage Differential", "Low Voltage Differential", +and "Single Ended". + +Requirement: Optional for SCSI Parallel Interface. Not +defined for any other physical interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SCSI Parallel Signaling Type</key> + <string>High Voltage Differential</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIParallelSignalingTypeKey "SCSI Parallel Signaling Type" + + +/*! +@defined kIOPropertyFibreChannelCableDescriptionKey +@discussion This key is associated with the cabling type +used for this Fibre Channel port. Valid values include +"Copper" and "Fiber Optic". + +Requirement: Optional for Fibre Channel Interface. Not +defined for any other physical interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Fibre Channel Cabling Type</key> + <string>Copper</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelCableDescriptionKey "Fibre Channel Cabling Type" + + +/*! +@defined kIOPropertyEncryptionTypeKey +@discussion This key is associated with the encryption type +used for this storage controller. Valid values currently include +"AES-XTS", "AES-XEX" and "AES-CBC". + +Requirement: Optional for all storage controllers. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Encryption Type</key> + <string>AES-XTS</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyEncryptionTypeKey "Encryption Type" + + +/*! +@defined kIOPropertyLowPowerModeKey +@discussion This key is associated with whether the storage +device has low-power mode enabled. If enabled, it will set this +key to true. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Low Power Mode</key> + <true/> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyLowPowerModeKey "Low Power Mode" + + +/* + * Values - Values for the characteristics defined above. + */ + + +/*! +@defined kIOPropertyPortStatusLinkEstablishedKey +@discussion This key defines the value of Link Established for the key +kIOPropertyPortStatusKey. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Status</key> + <string>Link Established</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortStatusLinkEstablishedKey "Link Established" + + +/*! +@defined kIOPropertyPortStatusNoLinkEstablishedKey +@discussion This key defines the value of No Link Established for the key +kIOPropertyPortStatusKey. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Status</key> + <string>No Link Established</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortStatusNoLinkEstablishedKey "No Link Established" + + +/*! +@defined kIOPropertyPortStatusLinkFailedKey +@discussion This key defines the value of Link Failed for the key +kIOPropertyPortStatusKey. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Status</key> + <string>Link Failed</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortStatusLinkFailedKey "Link Failed" + + +/*! +@defined kIOPropertyPortSpeedAutomaticKey +@discussion This key defines the value of Automatic for the key +kIOPropertyPortSpeedKey. If the speed of the port is automatically +adjusted by the host/device and a definitive speed is not known, +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomaticKey "Automatic" + + +/*! +@defined kIOPropertyPortSpeed1GigabitKey +@discussion This key defines the value of 1 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 1 Gigabit +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>1 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed1GigabitKey "1 Gigabit" + +/*! +@defined kIOPropertyPortSpeed1_5GigabitKey +@discussion This key defines the value of 1.5 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 1.5 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>1.5 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed1_5GigabitKey "1.5 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed2GigabitKey +@discussion This key defines the value of 2 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 2 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>2 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed2GigabitKey "2 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed3GigabitKey +@discussion This key defines the value of 3 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 3 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>3 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed3GigabitKey "3 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed4GigabitKey +@discussion This key defines the value of 4 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 4 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>4 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed4GigabitKey "4 Gigabit" + +/*! +@defined kIOPropertyPortSpeed6GigabitKey +@discussion This key defines the value of 6 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 6 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>6 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed6GigabitKey "6 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed8GigabitKey +@discussion This key defines the value of 8 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 8 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>8 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed8GigabitKey "8 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed10GigabitKey +@discussion This key defines the value of 10 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 10 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>10 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed10GigabitKey "10 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed12GigabitKey +@discussion This key defines the value of 12 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 12 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>12 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed12GigabitKey "12 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed16GigabitKey +@discussion This key defines the value of 16 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 16 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>16 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> + */ +#define kIOPropertyPortSpeed16GigabitKey "16 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed40GigabitKey +@discussion This key defines the value of 40 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 40 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>40 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed40GigabitKey "40 Gigabit" + + +/*! +@defined kIOPropertyPortSpeedAutomatic1GigabitKey +@discussion This key defines the value of Automatic (1 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +1 Gigabit per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (1 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic1GigabitKey "Automatic (1 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic1_5GigabitKey +@discussion This key defines the value of Automatic (1.5 Gigabit) for the key +kIOPropertyPortSpeedKey. If the speed of the port is +1.5 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (1.5 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic1_5GigabitKey "Automatic (1.5 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic2GigabitKey +@discussion This key defines the value of Automatic (2 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +2 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (2 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic2GigabitKey "Automatic (2 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic3GigabitKey +@discussion This key defines the value of Automatic (3 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +3 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (3 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic3GigabitKey "Automatic (3 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic4GigabitKey +@discussion This key defines the value of Automatic (4 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +4 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (4 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic4GigabitKey "Automatic (4 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic6GigabitKey +@discussion This key defines the value of Automatic (6 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +6 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (6 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic6GigabitKey "Automatic (6 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic8GigabitKey +@discussion This key defines the value of Automatic (8 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +8 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (8 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic8GigabitKey "Automatic (8 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic10GigabitKey +@discussion This key defines the value of Automatic (10 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +10 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (10 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic10GigabitKey "Automatic (10 Gigabit)" + + +/*! +@defined kIOPropertyPortTopologyAutomaticKey +@discussion This key defines the value of Automatic for the key +kIOPropertyPortTopologyKey. If the topology of the port is automatically +adjusted by the host/device and a definitive topology is not known, +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>Automatic</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyAutomaticKey "Automatic" + + +/*! +@defined kIOPropertyPortTopologyNPortKey +@discussion This key defines the value of N_Port for the key +kIOPropertyPortTopologyKey. If the topology of the port is an N_Port, +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>N_Port</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyNPortKey "N_Port" + + +/*! +@defined kIOPropertyPortTopologyNLPortKey +@discussion This key defines the value of NL_Port for the key +kIOPropertyPortTopologyKey. If the topology of the port is an NL_Port, +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>NL_Port</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyNLPortKey "NL_Port" + + +/*! +@defined kIOPropertyPortTopologyAutomaticNPortKey +@discussion This key defines the value of Automatic (N_Port) for the key +kIOPropertyPortTopologyKey. If the topology of the port is +N_Port and is automatically determined by host software, this +key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>Automatic (N_Port)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyAutomaticNPortKey "Automatic (N_Port)" + + +/*! +@defined kIOPropertyPortTopologyAutomaticNLPortKey +@discussion This key defines the value of Automatic (NL_Port) for the key +kIOPropertyPortTopologyKey. If the topology of the port is +NL_Port and is automatically determined by host software, this +key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>Automatic (NL_Port)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyAutomaticNLPortKey "Automatic (NL_Port)" + + +/*! +@defined kIOPropertySCSIParallelSignalingTypeHVDKey +@discussion This key defines the value of High Voltage Differential for the key +kIOPropertySCSIParallelSignalingTypeKey. If the signaling type of the port is +High Voltage Differential, this key should be used. + +Requirement: Optional for SCSI Parallel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SCSI Parallel Signaling Type</key> + <string>High Voltage Differential</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIParallelSignalingTypeHVDKey "High Voltage Differential" + + +/*! +@defined kIOPropertySCSIParallelSignalingTypeLVDKey +@discussion This key defines the value of Low Voltage Differential for the key +kIOPropertySCSIParallelSignalingTypeKey. If the signaling type of the port is +Low Voltage Differential, this key should be used. + +Requirement: Optional for SCSI Parallel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SCSI Parallel Signaling Type</key> + <string>Low Voltage Differential</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIParallelSignalingTypeLVDKey "Low Voltage Differential" + + +/*! +@defined kIOPropertySCSIParallelSignalingTypeSEKey +@discussion This key defines the value of Single Ended for the key +kIOPropertySCSIParallelSignalingTypeKey. If the signaling type of the port is +Single Ended, this key should be used. + +Requirement: Optional for SCSI Parallel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SCSI Parallel Signaling Type</key> + <string>Single Ended</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIParallelSignalingTypeSEKey "Single Ended" + + +/*! +@defined kIOPropertyFibreChannelCableDescriptionCopperKey +@discussion This key defines the value of Copper for the key +kIOPropertyFibreChannelCableDescriptionKey. If the cabling is +Copper, this key should be used. + +Requirement: Optional for Fibre Channel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Fibre Channel Cabling Type</key> + <string>Copper</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelCableDescriptionCopperKey "Copper" + + +/*! +@defined kIOPropertyFibreChannelCableDescriptionFiberOpticKey +@discussion This key defines the value of Fiber Optic for the key +kIOPropertyFibreChannelCableDescriptionKey. If the cabling is +Fiber Optic, this key should be used. + +Requirement: Optional for Fibre Channel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Fibre Channel Cabling Type</key> + <string>Fiber Optic</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelCableDescriptionFiberOpticKey "Fiber Optic" + + +/*! +@defined kIOPropertyAESCBCKey +@discussion This key defines the value of AES-CBC for the key +kIOPropertyEncryptionTypeKey. If the encryption used is +AES-CBC, this key should be used. + +Requirement: Optional for all storage controllers. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Encryption Type</key> + <string>AES-CBC</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyAESCBCKey "AES-CBC" + + +/*! +@defined kIOPropertyAESXTSKey +@discussion This key defines the value of AES-XTS for the key +kIOPropertyEncryptionTypeKey. If the encryption used is +AES-XTS, this key should be used. + +Requirement: Optional for all storage controllers. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Encryption Type</key> + <string>AES-XTS</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyAESXTSKey "AES-XTS" + + +/*! +@defined kIOPropertyAESXEXKey +@discussion This key defines the value of AES-XEX for the key +kIOPropertyEncryptionTypeKey. If the encryption used is +AES-XEX, this key should be used. + +Requirement: Optional for all storage controllers. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Encryption Type</key> + <string>AES-XEX</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyAESXEXKey "AES-XEX" + + +#endif /* _IOKIT_IO_STORAGE_CONTROLLER_CHARACTERISTICS_H_ */ diff --git a/QualcommWireless/include/IOKit/storage/IOStorageDeviceCharacteristics.h b/QualcommWireless/include/IOKit/storage/IOStorageDeviceCharacteristics.h new file mode 100644 index 0000000..a262635 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOStorageDeviceCharacteristics.h @@ -0,0 +1,687 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_STORAGE_DEVICE_CHARACTERISTICS_H_ +#define _IOKIT_IO_STORAGE_DEVICE_CHARACTERISTICS_H_ + +#include <IOKit/storage/IOStorageProtocolCharacteristics.h> + +/* + * Device Characteristics - Characteristics defined for devices. + */ + +/*! +@defined kIOPropertyDeviceCharacteristicsKey +@discussion This key is used to define Device Characteristics for a particular +device and it has an associated dictionary which lists the +device characteristics. The device characteristics are Command Set specific +and are listed in the header files for each command set. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyDeviceCharacteristicsKey "Device Characteristics" + + +/*! +@defined kIOPropertyVendorNameKey +@discussion This key is used to define the Vendor Name for a particular device +and it has an associated string. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyVendorNameKey "Vendor Name" + + +/*! +@defined kIOPropertyProductNameKey +@discussion This key is used to define the Product Name for a particular device +and it has an associated string. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyProductNameKey "Product Name" + + +/*! +@defined kIOPropertyProductRevisionLevelKey +@discussion This key is used to define the Product Revision Level for a +particular device and it has an associated string. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyProductRevisionLevelKey "Product Revision Level" + + +/*! +@defined kIOPropertyProductSerialNumberKey +@discussion This key is used to define the Product Serial Number for a +particular device and it has an associated data. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Serial Number</key> + <string>123456789</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyProductSerialNumberKey "Serial Number" + + +/*! +@defined kIOPropertySupportedCDFeaturesKey +@discussion This key is used to define the supported CD Features for a +particular optical device and it has an associated bitfield. See +<IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the +bits and associated bitmasks. + +Requirement: Mandatory for optical devices (Peripheral Device Type 05h). + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>SuperDrive</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>CD Features</key> + <integer>1663</integer> + <key>DVD Features</key> + <integer>103</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySupportedCDFeaturesKey "CD Features" + + +/*! +@defined kIOPropertySupportedDVDFeaturesKey +@discussion This key is used to define the supported DVD Features for a +particular optical device and it has an associated bitfield. See +<IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the +bits and associated bitmasks. + +Requirement: Mandatory for optical devices (Peripheral Device Type 05h). + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>SuperDrive</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>CD Features</key> + <integer>1663</integer> + <key>DVD Features</key> + <integer>103</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySupportedDVDFeaturesKey "DVD Features" + + +/*! +@defined kIOPropertySupportedBDFeaturesKey +@discussion This key is used to define the supported BD Features for a +particular optical device and it has an associated bitfield. See +<IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the +bits and associated bitmasks. + +Requirement: Mandatory for optical devices (Peripheral Device Type 05h). + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>SuperDrive</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>CD Features</key> + <integer>1663</integer> + <key>DVD Features</key> + <integer>103</integer> + <key>BD Features</key> + <integer>21</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySupportedBDFeaturesKey "BD Features" + + +/*! +@defined kIOPropertyRigidDiskGeometryKey +@discussion This key is used to define a dictionary containing +rigid disk geometry information. + +Requirement: Optional. If a device publishes this dictionary, it +must publish all key/value pairs which are deemed Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + <key>Head Count</key> + <integer>12</integer> + <key>Cylinder Count</key> + <integer>12345</integer> + <key>Bytes per Physical Sector</key> + <integer>512</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyRigidDiskGeometryKey "Rigid Disk Geometry" + + +/*! +@defined kIOPropertySectorCountPerTrackKey +@discussion This key is used to define the number of sectors per +each track for a particular medium. + +Requirement: Mandatory element of the Rigid Disk Geometry dictionary. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySectorCountPerTrackKey "Sector Count per Track" + + +/*! +@defined kIOPropertyHeadCountKey +@discussion This key is used to define the number of heads for +a particular medium. + +Requirement: Mandatory element of the Rigid Disk Geometry dictionary. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + <key>Head Count</key> + <integer>12</integer> + <key>Cylinder Count</key> + <integer>12345</integer> + <key>Bytes per Physical Sector</key> + <integer>512</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyHeadCountKey "Head Count" + + +/*! +@defined kIOPropertyCylinderCountKey +@discussion This key is used to define the number of heads for +a particular medium. + +Requirement: Mandatory element of the Rigid Disk Geometry dictionary. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + <key>Head Count</key> + <integer>12</integer> + <key>Cylinder Count</key> + <integer>12345</integer> + <key>Bytes per Physical Sector</key> + <integer>512</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyCylinderCountKey "Cylinder Count" + + +/*! +@defined kIOPropertyBytesPerPhysicalSectorKey +@discussion This key is used to define the number of heads for +a particular medium. + +Requirement: Mandatory element of the Rigid Disk Geometry dictionary. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + <key>Head Count</key> + <integer>12</integer> + <key>Cylinder Count</key> + <integer>12345</integer> + <key>Bytes per Physical Sector</key> + <integer>512</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyBytesPerPhysicalSectorKey "Bytes per Physical Sector" + + +/*! +@defined kIOPropertyPhysicalBlockSizeKey +@discussion This key is used to define the physical block size of a hard disk drive. + +Requirement: Mandatory for hard disk drives with physical block size other than 512 bytes. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Physical Block Size</key> + <integer>4096</integer> + <key>Logical Block Size</key> + <integer>512</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalBlockSizeKey "Physical Block Size" + + +/*! +@defined kIOPropertyLogicalBlockSizeKey +@discussion This key is used to define the logical block size of a hard disk drive. + +Requirement: Mandatory for hard disk drives with logical block size other than 512 bytes +or that does not match its physical block size. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Physical Block Size</key> + <integer>4096</integer> + <key>Logical Block Size</key> + <integer>512</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyLogicalBlockSizeKey "Logical Block Size" + + +/*! +@defined kIOPropertyTargetDiskModeKey +@discussion This key is used to indicate the device is another computer in Target Disk Mode. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Target Disk Mode</key> + <true/> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyTargetDiskModeKey "Target Disk Mode" + + +/*! +@defined kIOPropertyInvalidStartupDiskKey +@discussion This key is used to denote devices when cannot be used as a startup disk. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>APPLE</string> + <key>Product Name</key> + <string>Target Disk Mode</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Invalid Startup Disk</key> + <true/> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInvalidStartupDiskKey "Invalid Startup Disk" + + +/*! +@defined kIOPropertyMediumTypeKey +@discussion This key is used to indicate the medium type of the device. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Medium Type</key> + <string>Rotational</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyMediumTypeKey "Medium Type" + + +/*! +@defined kIOPropertyMediumTypeRotationalKey +@discussion This key is used to indicate the medium type of the device is rotational. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Medium Type</key> + <string>Rotational</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyMediumTypeRotationalKey "Rotational" + + +/*! +@defined kIOPropertyMediumTypeSolidStateKey +@discussion This key is used to indicate the medium type of the device is solid state. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Medium Type</key> + <string>Solid State</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyMediumTypeSolidStateKey "Solid State" + + +/*! +@defined kIOPropertyMediumRotationRateKey +@discussion This key is used to indicate the medium rotation rate in RPM of the device. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Rotation Rate</key> + <integer>7200</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyMediumRotationRateKey "Rotation Rate" + + +#endif /* _IOKIT_IO_STORAGE_DEVICE_CHARACTERISTICS_H_ */ diff --git a/QualcommWireless/include/IOKit/storage/IOStorageProtocolCharacteristics.h b/QualcommWireless/include/IOKit/storage/IOStorageProtocolCharacteristics.h new file mode 100644 index 0000000..d7f065a --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/IOStorageProtocolCharacteristics.h @@ -0,0 +1,645 @@ +/* + * Copyright (c) 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_STORAGE_PROTOCOL_CHARACTERISTICS_H_ +#define _IOKIT_IO_STORAGE_PROTOCOL_CHARACTERISTICS_H_ + +#include <IOKit/storage/IOStorageControllerCharacteristics.h> + +/* + * Protocol Characteristics - Characteristics defined for protocols. + */ + +/*! +@defined kIOPropertyProtocolCharacteristicsKey +@discussion This key is used to define Protocol Characteristics for a particular +protocol and it has an associated dictionary which lists the +protocol characteristics. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>ATAPI</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyProtocolCharacteristicsKey "Protocol Characteristics" + + +/*! +@defined kIOPropertySCSIInitiatorIdentifierKey +@discussion An identifier that will uniquely identify this SCSI Initiator for the +SCSI Domain. + +Requirement: Mandatory for SCSI Parallel Interface, SAS, +and Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + <key>SCSI Initiator Identifier</key> + <integer>7</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIInitiatorIdentifierKey "SCSI Initiator Identifier" + + +/*! +@defined kIOPropertySCSIDomainIdentifierKey +@discussion An identifier that will uniquely identify this SCSI Domain for the +Physical Interconnect type. This identifier is only guaranteed to be unique for +any given Physical Interconnect and is not guaranteed to be the same across +restarts or shutdowns. + +Requirement: Mandatory for SCSI Parallel Interface and Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + <key>SCSI Domain Identifier</key> + <integer>0</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIDomainIdentifierKey "SCSI Domain Identifier" + + +/*! +@defined kIOPropertySCSITargetIdentifierKey +@discussion This is the SCSI Target Identifier for a given SCSI Target Device. + +Requirement: Mandatory for SCSI Parallel Interface and Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + <key>SCSI Target Identifier</key> + <integer>3</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSITargetIdentifierKey "SCSI Target Identifier" + + +/*! +@defined kIOPropertySCSILogicalUnitNumberKey +@discussion This key is the SCSI Logical Unit Number for the device server +controlled by the driver. + +Requirement: Mandatory for SCSI Parallel Interface, SAS, and Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + <key>SCSI Logical Unit Number</key> + <integer>2</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSILogicalUnitNumberKey "SCSI Logical Unit Number" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeKey +@discussion This key is used to define the Physical Interconnect to which +a device is attached. + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeKey "Physical Interconnect" + + +/*! +@defined kIOPropertyPhysicalInterconnectLocationKey +@discussion This key is used to define the Physical Interconnect +Location. + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectLocationKey "Physical Interconnect Location" + + +/*! +@defined kIOPropertySCSIProtocolMultiInitKey +@discussion This protocol characteristics key is used to inform the system +that the protocol supports having multiple devices that act as initiators. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>Multiple Initiators</key> + <string>True</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIProtocolMultiInitKey "Multiple Initiators" + + +/* + * Values - Values for the characteristics defined above. + */ + + +/*! +@defined kIOPropertyInternalKey +@discussion This key defines the value of Internal for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is +connected to an internal bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>ATA</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInternalKey "Internal" + + +/*! +@defined kIOPropertyExternalKey +@discussion This key defines the value of External for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is +connected to an external bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyExternalKey "External" + + +/*! +@defined kIOPropertyInternalExternalKey +@discussion This key defines the value of Internal/External for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is connected +to a bus and it is indeterminate whether it is internal or external, +this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal/External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInternalExternalKey "Internal/External" + + +/*! +@defined kIOPropertyInterconnectFileKey +@discussion This key defines the value of File for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is a file +that is being represented as a storage device, this key should be set. + +NOTE: This key should only be used when the Physical Interconnect is set to +Virtual Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Virtual Interface</string> + <key>Physical Interconnect Location</key> + <string>File</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInterconnectFileKey "File" + + +/*! +@defined kIOPropertyInterconnectRAMKey +@discussion This key defines the value of RAM for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is system memory +that is being represented as a storage device, this key should be set. + +NOTE: This key should only be used when the Physical Interconnect is set to +Virtual Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Virtual Interface</string> + <key>Physical Interconnect Location</key> + <string>RAM</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInterconnectRAMKey "RAM" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeATA +@discussion This key defines the value of ATA for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to an ATA bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>ATA</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeATA "ATA" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeSerialATA +@discussion This key defines the value of SATA for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a SATA bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SATA</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeSerialATA "SATA" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeSerialAttachedSCSI +@discussion This key defines the value of SAS for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a SAS bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SAS</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeSerialAttachedSCSI "SAS" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeATAPI +@discussion This key defines the value of ATAPI for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to an ATA bus and follows the ATAPI command specification, this key +should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>ATAPI</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeATAPI "ATAPI" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeUSB +@discussion This key defines the value of USB for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a USB port, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>USB</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeUSB "USB" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeFireWire +@discussion This key defines the value of USB for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a FireWire port, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>FireWire</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeFireWire "FireWire" + + +/*! + @defined kIOPropertyPhysicalInterconnectTypeSecureDigital + @discussion This key defines the value of Secure Digital for the key + kIOPropertyPhysicalInterconnectTypeSecureDigital. If the device is + connected to a Secure Digital port and follows the Secure Digital + specification, this key should be set. + + Example: + <pre> + @textblock + <dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Secure Digital</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> + </dict> + @/textblock + </pre> + */ +#define kIOPropertyPhysicalInterconnectTypeSecureDigital "Secure Digital" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeSCSIParallel +@discussion This key defines the value of SCSI Parallel Interface for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a SCSI Parallel port, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeSCSIParallel "SCSI Parallel Interface" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeFibreChannel +@discussion This key defines the value of Fibre Channel Interface for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a Fibre Channel port, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeFibreChannel "Fibre Channel Interface" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeVirtual +@discussion This key defines the value of Virtual Interface for the key +kIOPropertyPhysicalInterconnectTypeVirtual. If the device is being made to look +like a storage device, but is not such in actuality, such as a File or RAM, this +key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Virtual Interface</string> + <key>Physical Interconnect Location</key> + <string>File</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeVirtual "Virtual Interface" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypePCI +@discussion This key defines the value of PCI for the key +kIOPropertyPhysicalInterconnectTypePCI. If the device is connected +via PCI, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>PCI</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypePCI "PCI" + + +#endif /* _IOKIT_IO_STORAGE_PROTOCOL_CHARACTERISTICS_H_ */ diff --git a/QualcommWireless/include/IOKit/storage/ata/IOATAPIProtocolTransport.h b/QualcommWireless/include/IOKit/storage/ata/IOATAPIProtocolTransport.h new file mode 100644 index 0000000..3356ae7 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/ata/IOATAPIProtocolTransport.h @@ -0,0 +1,365 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOATAPIProtocolTransport + Contains the class definition for IOATAPIProtocolTransport. +*/ + + +#ifndef _IOKIT_IO_ATAPI_PROTOCOL_TRANSPORT_H_ +#define _IOKIT_IO_ATAPI_PROTOCOL_TRANSPORT_H_ + +#define kIOPropertyATAPIMassStorageCharacteristics "ATAPI Mass Storage Characteristics" + +#if defined(KERNEL) && defined(__cplusplus) + +/* General IOKit includes */ +#include <IOKit/IOLib.h> +#include <IOKit/IOMessage.h> +#include <IOKit/IOService.h> +#include <IOKit/IOCommandPool.h> + +/* IOKit ATA Family includes */ +#include <IOKit/ata/IOATADevice.h> +#include <IOKit/ata/IOATATypes.h> + +/* IOKit ATA Storage includes */ +#include <IOKit/storage/ata/IOATAStorageDefines.h> + +/* SCSI Architecture Model Family includes */ +#include <IOKit/scsi/IOSCSIProtocolServices.h> + +// Forward class declaration +class IOATAPIProtocolTransport; + +/*! + @typedef ATAPIClientData + @param cmd IOATACommand for request. + @param self Pointer to the object. + @param scsiTask SCSITaskIdentifier of request. + @discussion This structure is stuffed into the refcon so we can associate which + IOATACommand and SCSITaskIdentifier is completing. +*/ + +struct ATAPIClientData +{ + IOATACommand * cmd; + IOATAPIProtocolTransport * self; + SCSITaskIdentifier scsiTask; +}; +typedef struct ATAPIClientData ATAPIClientData; + + +/*! + @class IOATAPIProtocolTransport + @abstract SCSI Protocol Driver Family for ATAPI Devices. + @discussion IOATAPIProtocolTransport contains all the bus specific support for ATAPI compliant devices. + To add vendor specific features or workarounds you will sub-class the appropriate + methods of this family. +*/ + +class IOATAPIProtocolTransport : public IOSCSIProtocolServices +{ + + OSDeclareDefaultStructors ( IOATAPIProtocolTransport ) + +public: + + // ---- IOService methods overridden ---- + + bool init ( OSDictionary * propTable ); + + // The start method is called to start our services. If the device + // can be controlled by this object, then we return true, else we + // return false. start() is usually used to allocate resources once + // it is determined that the device can be controlled by this object. + virtual bool start ( IOService * provider ); + + // The stop method is called to stop our services. It is primarily + // called for deallocation of resources. + virtual void stop ( IOService * provider ); + + // This method is our last chance to free all resources allocated. + virtual void free ( void ); + + +protected: + + // ---- member variables ---- + + IOATADevice * fATADevice; + ataUnitID fATAUnitID; + ataDeviceType fATADeviceType; + ataSocketType fATASocketType; + atapiConfig fATAPIPacketConfig; + UInt8 fPIOMode; + UInt8 fDMAMode; + UInt8 fUltraDMAMode; + IOCommandGate * fCommandGate; + IOCommandPool * fCommandPool; + IOATACommand * fResetCommand; + IOATACommand * fConfigCommand; + IOATACommand * fIdentifyCommand; + char fRevision[kSizeOfATARevisionString + 1]; + char fModel[kSizeOfATAModelString + 1]; + bool fWakeUpResetOccurred; + bool fPhysicallyConnected; + + // Used for low-power polling support + thread_call_t fPollingThread; + + UInt16 fDeviceIdentifyData[256]; + IOMemoryDescriptor * fDeviceIdentifyBuffer; + bool fResetInProgress; + + // Binary Compatibility instance variable expansion + struct ExpansionData + { + UInt32 fSemaphore; + UInt32 fMediaNotifyValue; + }; + ExpansionData * reserved; + + // ---- IOService methods overridden ---- + + // The message method is used to listen to messages from our provider, the ATA controller. + // It sends messages for bus reset notifications and for device removal (such as MediaBay, + // PC card, etc.) + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument = 0 ); + + // ---- Protocol transport methods overridden ---- + + // Send a SCSI Command to the device. If the command was sent to the + // device and is pending completion, the subclass should return true and + // return back the kSCSIServiceResponse_Request_In_Process response. + // If the command completes immediately with an error, the subclass will + // return true and return back the appropriate status. + // if the subclass is currently processing all the commands it can, the + // subclass will return false and the command will be resent next time + // CommandCompleted is called. + virtual bool SendSCSICommand ( SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ); + + // This is a stub - not implemented in upper layer yet. Eventually, there + // will be a way to abort a task or task set and this method will be called. + // It will abort any commands which have not been executed by the ATA controller + virtual SCSIServiceResponse AbortSCSICommand ( SCSITaskIdentifier request ); + + // The IsProtocolServiceSupported method will return true if the protocol + // layer supports the specified feature. + virtual bool IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue ); + + // The HandleProtocolServiceFeature method will return true if the protocol + // layer properly handled the specified feature. + virtual bool HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue ); + + // ------ Power Management Support ------ + + // The HandlePowerOff method is called to do any bus specific activity + // necessary before shutting down and going to sleep. + virtual IOReturn HandlePowerOff ( void ); + + // The HandlePowerOn method is called to do any bus specific activity + // necessary to recover from power-on/wake from sleep (e.g. device reset on ATAPI) + virtual IOReturn HandlePowerOn ( void ); + + + // ---- Methods defined by this class ---- + + // Static callback proc for all SCSITask objects, it calls through to + // SCSITaskCallbackFunction. + static void sSCSITaskCallbackProc ( IOATACommand * cmd ); + + // Callback proc for synchronous ATA only type commands. + static void sATACallbackSync ( IOATACommand * cmd ); + + // Callback proc for asynchronous ATAPI resets. + static void sATAPIResetCallback ( IOATACommand * cmd ); + + // Callback proc that does nothing. + static void sATAPIVoidCallback ( IOATACommand * cmd ); + + // State machine for device configuration. + static void sATAPIConfigStateMachine ( IOATACommand * cmd ); + + // Used for low-power polling. + static void sPollStatusRegister ( void * xptDriver, void * refCon ); + + // Static callback for low-power polling. + static void sPollStatusRegisterCallback ( IOATACommand * cmd ); + + // This method is called by the SCSITaskCallbackFunction and it calls the + // inherited CommandCompleted message with the results of the task. + virtual void CompleteSCSITask ( SCSITaskIdentifier scsiTask, + SCSIServiceResponse serviceResponse, + SCSITaskStatus taskStatus ); + + // The SCSITaskCallbackFunction method is called by the static callback procedure + // to complete SCSITask operations. This method may be subclassed if a device + // workaround is necessary. + virtual void SCSITaskCallbackFunction ( IOATACommand * cmd, + SCSITaskIdentifier scsiTask ); + + // The ReportATAPIDeviceType method returns the ataDeviceType for ATAPI + virtual ataDeviceType ReportATAPIDeviceType ( void ) const; + + // The InspectDevice method is called to inspect the ATA device and verify + // that it is a device which can be controlled by this object + virtual bool InspectDevice ( IOATADevice * ataDevice ); + + // The AllocateATACommandObjects method is called to allocate a pool of + // IOATACommands for general purpose I/O usage. + virtual void AllocateATACommandObjects ( void ); + + // The DeallocateATACommandObjects method is called to deallocate a pool of + // IOATACommands for general purpose I/O usage. + virtual void DeallocateATACommandObjects ( void ); + + // The GetATACommandObject method is called to retrieve a command from + // the pool. Pass true to allow the method to sleep waiting for a command, + // else pass false. If false is passed, there is NO guarantee that a valid + // command will be returned. If true is passed, it IS guaranteed that a + // valid command will be returned, but the thread may be slept waiting for + // those resources. + virtual IOATACommand * GetATACommandObject ( bool okToSleep = true ); + + // The ReturnATACommandObject method is called to return a command to + // the pool. + virtual void ReturnATACommandObject ( IOATACommand * cmd ); + + // The sSwapBytes16 method is used to word-swap the Device Identify data + // on big endian systems. Since all identify data is returned in little endian + // values, it must be word-swapped before inspected. + static void sSwapBytes16 ( UInt8 * buffer, IOByteCount numBytesToSwap ); + + // The sConvertHighestBitToNumber method is used to find the highest bit in a + // word and return a numeric value. This is used to find the highest possible + // values for PIO, DMA, and UltraDMA transfer modes. + static UInt8 sConvertHighestBitToNumber ( UInt16 bitField ); + + // The sSetWakeupResetOccurred method is used to safely set member variables + // behind the command gate. + static void sSetWakeupResetOccurred ( IOATAPIProtocolTransport * driver, + bool resetOccurred ); + + // The sCheckWakeupResetOccur method is used to safely check member variables + // behind the command gate. + static void sCheckWakeupResetOccurred ( IOATAPIProtocolTransport * driver, + bool * resetOccurred ); + + // The DidWakeupResetOccur method is used to safely find out if a reset + // occurred while we were asleep. + virtual bool CheckWakeupResetOccurred ( void ); + + // The WakeupResetOccurred method is used to safely set/clear the reset flag. + virtual void SetWakeupResetOccurred ( bool resetOccurred ); + + // The SetPIOTransferMode method is used to set the programmed input-output (PIO) + // transfer mode. The highest value reported by the device is used. + virtual IOReturn SetPIOTransferMode ( IOATACommand * cmd, bool forceSync ); + + // The SetDMATransferMode method is used to set the direct memory access (DMA) + // transfer mode. The highest value reported by the device is used. + virtual IOReturn SetDMATransferMode ( IOATACommand * cmd, bool forceSync ); + + // The IdentifyAndConfigureATAPIDevice method is called to correctly identify + // and configure an ATAPI device. + virtual IOReturn IdentifyAndConfigureATAPIDevice ( void ); + + // The ConfigureATAPIDevice method is called to correctly configure the ATAPI + // device. It currently configures any PIO/DMA/UDMA transfer modes but may be + // expanded in the future. + virtual IOReturn ConfigureATAPIDevice ( void ); + + // The ReconfigureATAPIDevice method is called to correctly reconfigure the ATAPI + // device after a reset event has occurred (bus reset or device reset). It + // currently reconfigures any PIO/DMA/UDMA transfer modes but may be expanded in + // the future. + virtual IOReturn ReconfigureATAPIDevice ( void ); + + // The IdentifyATAPIDevice method is called to correctly identify the ATAPI + // device. It currently issues the Identify ATAPI Device packet command and + // uses the data to correctly configure the device. + virtual IOReturn IdentifyATAPIDevice ( void ); + + // The ResetATAPIDevice method is called to issue a Device Reset (also known + // as a SOFT RESET). This method will only reset the specified device on the + // bus. + virtual IOReturn ResetATAPIDevice ( void ); + + // The SendATASleepCommand method is called to put an ATAPI drive in sleep + // mode. + virtual IOReturn SendATASleepCommand ( void ); + + // The EnablePollingOfStatusRegister method is called to set up a timer for + // the call to PollStatusRegister. It is called when the SCSI Application Layer + // driver wants to enable low-power polling and after a poll which does not + // see a change in the register status. + virtual void EnablePollingOfStatusRegister ( void ); + + // The DisablePollingOfStatusRegister method is called to cancel any thread + // call which is doing a poll and drop the retain count on the object. + virtual void DisablePollingOfStatusRegister ( void ); + + // The PollStatusRegister method is used to do low-power polling on drives which + // support it. This feature is enabled by the SCSI Application Layer driver. + virtual void PollStatusRegister ( void * refCon ); + + // Callback method for the polling of the status register. + virtual void PollStatusRegisterCallback ( IOATACommand * cmd ); + + // The TurnDrivePowerOff method is called to turn power to the drive OFF + IOReturn TurnDrivePowerOff ( void ); + + IOReturn SendCommand ( IOATACommand * cmd ); + IOReturn GatedWaitForRequest ( void * data ); + +private: + + // Binary Compatibility reserved method space + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 1 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 2 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 3 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 4 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 5 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 6 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 7 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 8 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 9 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 10 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 11 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 12 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 13 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 14 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 15 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_ATAPI_PROTOCOL_TRANSPORT_H_ */ \ No newline at end of file diff --git a/QualcommWireless/include/IOKit/storage/ata/IOATAStorageDefines.h b/QualcommWireless/include/IOKit/storage/ata/IOATAStorageDefines.h new file mode 100644 index 0000000..fdac8b3 --- /dev/null +++ b/QualcommWireless/include/IOKit/storage/ata/IOATAStorageDefines.h @@ -0,0 +1,321 @@ +/* + * Copyright (c) 1998-2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_ATA_STORAGE_DEFINES_H_ +#define _IOKIT_IO_ATA_STORAGE_DEFINES_H_ + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Important word offsets in device identify data as + * defined in ATA-5 standard + */ + +enum +{ + kATAIdentifyConfiguration = 0, + kATAIdentifyLogicalCylinderCount = 1, + kATAIdentifyLogicalHeadCount = 3, + kATAIdentifySectorsPerTrack = 6, + kATAIdentifySerialNumber = 10, + kATAIdentifyFirmwareRevision = 23, + kATAIdentifyModelNumber = 27, + kATAIdentifyMultipleSectorCount = 47, + kATAIdentifyDriveCapabilities = 49, + kATAIdentifyDriveCapabilitiesExtended = 50, + kATAIdentifyPIOTiming = 51, + kATAIdentifyExtendedInfoSupport = 53, + kATAIdentifyCurrentCylinders = 54, + kATAIdentifyCurrentHeads = 55, + kATAIdentifyCurrentSectors = 56, + kATAIdentifyCurrentCapacity = 57, + kATAIdentifyCurrentMultipleSectors = 59, + kATAIdentifyLBACapacity = 60, + kATAIdentifySingleWordDMA = 62, + kATAIdentifyMultiWordDMA = 63, + kATAIdentifyAdvancedPIOModes = 64, + kATAIdentifyMinMultiWordDMATime = 65, + kATAIdentifyRecommendedMultiWordDMATime = 66, + kATAIdentifyMinPIOTime = 67, + kATAIdentifyMinPIOTimeWithIORDY = 68, + kATAIdentifyQueueDepth = 75, + kATAIdentifyMajorVersion = 80, + kATAIdentifyMinorVersion = 81, + kATAIdentifyCommandSetSupported = 82, + kATAIdentifyCommandSetSupported2 = 83, + kATAIdentifyCommandExtension1 = 84, + kATAIdentifyCommandExtension2 = 85, + kATAIdentifyCommandsEnabled = 86, + kATAIdentifyCommandsDefault = 87, + kATAIdentifyUltraDMASupported = 88, + kATAIdentifyPhysicalLogicalSectorSize = 106, + kATAIdentifyWordsPerLogicalSector1 = 117, + kATAIdentifyWordsPerLogicalSector2 = 118, + kATAIdentifyLogicalSectorAlignment = 209, + kATAIdentifyIntegrity = 255 +}; + + +/* + * Important bits in device identify data + * as defined in ATA-5 standard + */ + +enum +{ + // Configuration field (word 0) + kFixedDeviceBit = 6, // Fixed disk indicator bit + kRemoveableMediaBit = 7, // Removable media indicator bit + kNonMagneticDriveBit = 15, // Non-magnetic drive indicator bit + + kFixedDeviceMask = (1 << kFixedDeviceBit), // Mask for fixed disk indicator + kRemoveableMediaMask = (1 << kRemoveableMediaBit), // Mask for removable media indicator + kNonMagneticDriveMask = (1 << kNonMagneticDriveBit), // Mask for non-magnetic drive indicator + + // Capabilities field (word 49) + kDMABit = 8, // DMA supported bit + kLBABit = 9, // LBA supported bit + kIORDYDisableBit = 10, // IORDY can be disabled bit + kIORDYBit = 11, // IORDY supported bit + kStandbyTimerBit = 13, // Standby timer supported bit + + kDMASupportedMask = (1 << kDMABit), // Mask for DMA supported + kLBASupportedMask = (1 << kLBABit), // Mask for LBA supported + kDMADisableMask = (1 << kIORDYDisableBit), // Mask for DMA supported + kIORDYSupportedMask = (1 << kIORDYBit), // Mask for IORDY supported + kStandbySupportedMask = (1 << kStandbyTimerBit), // Mask for Standby Timer supported + + // Extensions field (word 53) + kCurFieldsValidBit = 0, // Bit to show words 54-58 are valid + kExtFieldsValidBit = 1, // Bit to show words 64-70 are valid + kCurFieldsValidMask = (1 << kCurFieldsValidBit), // Mask for current fields valid + kExtFieldsValidMask = (1 << kExtFieldsValidBit), // Extension word valid + + // Advanced PIO Transfer Modes field (word 64) + kMode3Bit = 0, // Bit to indicate mode 3 is supported + kMode3Mask = (1 << kMode3Bit), // Mask for mode 3 support + + // Integrity of Identify data (word 255) + kChecksumValidCookie = 0xA5 // Bits 7:0 if device supports feature + +}; + + +/* String size constants */ +enum +{ + kSizeOfATAModelString = 40, + kSizeOfATARevisionString = 8 +}; + +/* ATA Command timeout constants ( in milliseconds ) */ +enum +{ + kATATimeout10Seconds = 10000, + kATATimeout30Seconds = 30000, + kATATimeout45Seconds = 45000, + kATATimeout1Minute = 60000, + kATADefaultTimeout = kATATimeout30Seconds +}; + + +/* Retry constants */ +enum +{ + kATAZeroRetries = 0, + kATADefaultRetries = 4 +}; + +/* max number of blocks supported in ATA transaction */ +enum +{ + kIOATASectorCount8Bit = 8, + kIOATASectorCount16Bit = 16 +}; + +enum +{ + kIOATAMaximumBlockCount8Bit = (1 << kIOATASectorCount8Bit), + kIOATAMaximumBlockCount16Bit = (1 << kIOATASectorCount16Bit), + + // For backwards compatibility + kIOATAMaxBlocksPerXfer = kIOATAMaximumBlockCount8Bit +}; + + + +/* Power Management time constants (in seconds) */ +enum +{ + kSecondsInAMinute = 60, + k5Minutes = 5 * kSecondsInAMinute +}; + +/* Bits for features published in Word 82 of device identify data */ +enum +{ + kATASupportsSMARTBit = 0, + kATASupportsPowerManagementBit = 3, + kATASupportsWriteCacheBit = 5 +}; + +/* Masks for features published in Word 82 of device identify data */ +enum +{ + kATASupportsSMARTMask = (1 << kATASupportsSMARTBit), + kATASupportsPowerManagementMask = (1 << kATASupportsPowerManagementBit), + kATASupportsWriteCacheMask = (1 << kATASupportsWriteCacheBit) +}; + +/* Bits for features published in Word 83 of device identify data */ +enum +{ + kATASupportsCompactFlashBit = 2, + kATASupportsAdvancedPowerManagementBit = 3, + + kATASupports48BitAddressingBit = 10, + + kATASupportsFlushCacheBit = 12, + kATASupportsFlushCacheExtendedBit = 13 +}; + +/* Masks for features published in Word 83 of device identify data */ +enum +{ + kATASupportsCompactFlashMask = (1 << kATASupportsCompactFlashBit), + kATASupportsAdvancedPowerManagementMask = (1 << kATASupportsAdvancedPowerManagementBit), + + kATASupports48BitAddressingMask = (1 << kATASupports48BitAddressingBit), + + kATASupportsFlushCacheMask = (1 << kATASupportsFlushCacheBit), + kATASupportsFlushCacheExtendedMask = (1 << kATASupportsFlushCacheExtendedBit), + + // Mask to ensure data is valid + kIdentifyWordValidationMask = 0xC000, + kIdentifyWordValid = 0x4000 +}; + +/* Bits for features published in Word 84 of device identify data */ +enum +{ + kATAForceUnitAccessFeatureBit = 6, +}; + +/* Masks for features published in Word 84 of device identify data */ +enum +{ + kATAForceUnitAccessFeatureMask = (1 << kATAForceUnitAccessFeatureBit), +}; + +/* Bits for features published in Word 85 of device identify data */ +enum +{ + kATAWriteCacheEnabledBit = 5 +}; + +/* Masks for features published in Word 85 of device identify data */ +enum +{ + kATAWriteCacheEnabledMask = (1 << kATAWriteCacheEnabledBit) +}; + + +/* Bits for features published in Word 106 of device identify data */ +enum +{ + kATAPhysicalLogicalEnabledBit0 = 15, + kATAPhysicalLogicalEnabledBit1 = 14, + kATAMultipleLogicalSectorsBit = 13, + kATAValidLogicalSectorSizeBit = 12 +}; + +/* Masks for features published in Word 106 of device identify data */ +enum +{ + kATAPhysicalLogicalEnabledMask = (1 << kATAPhysicalLogicalEnabledBit0) | (1 << kATAPhysicalLogicalEnabledBit1), + kATAPhysicalLogicalEnabledValue = (0 << kATAPhysicalLogicalEnabledBit0) | (1 << kATAPhysicalLogicalEnabledBit1), + kATAMultipleLogicalSectorsMask = (1 << kATAMultipleLogicalSectorsBit), + kATAValidLogicalSectorSizeMask = (1 << kATAValidLogicalSectorSizeBit), + kATAPhysicalSectorSizeMask = 0xF, + kATALogicalSectorAlignmentMask = 0x3FFF +}; + +// Property table keys +#define kIOATASupportedFeaturesKey "ATA Features" + +/* ATA supported features */ +enum +{ + kIOATAFeaturePowerManagement = 0x01, /* OBSOLETE */ + kIOATAFeatureWriteCache = 0x02, /* OBSOLETE */ + kIOATAFeatureAdvancedPowerManagement = 0x04, + kIOATAFeatureCompactFlash = 0x08, + kIOATAFeature48BitLBA = 0x10, + kIOATAFeatureSMART = 0x20 +}; + +/* ATA Advanced Power Management settings (valid settings range from 1-254), +the settings below are the more common settings */ +enum +{ + kIOATAMaxPerformance = 0xFE, + kIOATADefaultPerformance = 0x80, + kIOATAMaxPowerSavings = 0x01 +}; + +/* ATA Transfer Mode bit masks */ +enum +{ + kATAEnableUltraDMAModeMask = 0x40, + kATAEnableMultiWordDMAModeMask = 0x20, + kATAEnablePIOModeMask = 0x08 +}; + + +typedef uint32_t ATAOperationType; +enum +{ + kATAOperationTypeRead = 0, + kATAOperationTypeWrite = 1, + kATAOperationTypeFlushCache = 2, + kATAOperationTypeSMART = 3, + kATAOperationTypeConfiguration = 4, + kATAOperationTypePowerManagement = 5, + kATAOperationTypeSMS = 6 +}; + +#if defined(KERNEL) + +typedef struct __ATAIORequest * ATARequestIdentifier; + +#endif // defined(KERNEL) + +#ifdef __cplusplus +} +#endif + +#endif /* _IOKIT_IO_ATA_STORAGE_DEFINES_H_ */ diff --git a/QualcommWireless/include/IOKit/stream/IOStream.h b/QualcommWireless/include/IOKit/stream/IOStream.h new file mode 100644 index 0000000..060c7cb --- /dev/null +++ b/QualcommWireless/include/IOKit/stream/IOStream.h @@ -0,0 +1,609 @@ +/* + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#if !defined(__IOKIT_IOSTREAM_H) +#define __IOKIT_IOSTREAM_H + +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOBufferMemoryDescriptor.h> +#include <IOKit/IOUserClient.h> + +#include <IOKit/stream/IOStreamShared.h> + +/*! + @header IOStream.h + Definitions for IOStream family. + */ + +class IOStreamBuffer; + +/*! + @class IOStream + @abstract + A class representing a stream of data buffers passed from kernel to + user space and back again. + @discussion + The IOStream class defines a mechanism for moving buffers of data from + kernel space to user space or vice-versa. The policy for which direction + the data flows and the nature of the data is left up the the implementer + of the driver which uses IOStream. + + Although it is expected that the client of an IOStream will be in user space, + this is not required. + + References to "output" mean "from the IOStream to the user client", and + "input" means "from the user client to the IOStream." + + */ + +class IOStream : public IOService +{ + OSDeclareDefaultStructors(IOStream); + + protected: + OSArray * _buffers; // IOStreamBuffer objects in this stream + + IOItemCount _queueCount; // Number of entries for the queues + + IOMemoryDescriptor * _inputQueueDescriptor; + IOMemoryMap * _inputQueueMap; + + IOMemoryDescriptor * _outputQueueDescriptor; + IOMemoryMap * _outputQueueMap; + + IOStreamBufferQueue * _outputQueue; // Shared memory for buffers out to user space + IOStreamBufferQueue * _inputQueue; // Shared memory for buffers in from user space + + mach_port_t _outputPort; + mach_port_t _inputPort; + + OSArray * _memoryMaps; // Maps for data queues + + IOStreamMode _streamMode; + + public: + + /*! + @functiongroup Creating IOStream objects + */ + + /*! + @function withBuffers + @param mode The initial mode of the stream, either output, input, or input/output. + @param queueLength The nuber of queue entries to reserve in the input and output queue. + Zero means to make the queues big enough to accommodate all the buffers at once. + @param properties + A dictionary of properties which will be set on the stream. + @param buffers + An array of IOStreamBuffer objects which will be the buffers for this stream. + */ + + static IOStream *withBuffers(OSArray *buffers, IOStreamMode mode = kIOStreamModeOutput, IOItemCount queueLength = 0, OSDictionary *properties = 0); + + virtual bool init(OSDictionary *properties = 0); + + /*! + @function initWithBuffers + @param mode The initial mode of the stream, either output, input, or input/output. + @param queueLength The nuber of queue entries to reserve in the input and output queue. + Zero means to make the queues big enough to accommodate all the buffers at once. + @param properties + A dictionary of properties which will be set on the stream. + @param buffers + An array of IOStreamBuffer objects which will be the buffers for this stream. + */ + virtual bool initWithBuffers(OSArray *buffers, IOStreamMode mode = kIOStreamModeOutput, IOItemCount queueLength = 0, OSDictionary *properties = 0); + + /*! + @function free + */ + virtual void free(void); + + /*! + @functiongroup Opening and closing streams + */ + + /*! + @function handleOpen + @abstract The handleOpen() method relies on the default IOService behavior + to ensure that + only one client has the stream open at a time. + The shared input and output queues are created at open time. + @param options + @param arg + */ + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + + /*! + @function handleClose + @abstract The handleClose method destroys the shared input and output + queues. + @param options + */ + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + /*! + @functiongroup Managing shared queues + */ + + /*! + @function createQueues + @abstract Creates the shared input and output queues, without regard + to whether the stream is open or not. + Normally this is called by handleOpen(). + @param queueLength + @param options + @result Returns kIOReturnSuccess if the queues were successfully created. + */ + virtual IOReturn createQueues( IOItemCount queueLength = 0, IOOptionBits options = 0 ); + + /*! + @function destroyQueues + @abstract Releases the shared input and output queues. + @result Returns kIOReturnSuccess if the queues were successfully destroyed. + The queues cannot be destroyed while the stream is open by a client. + */ + virtual IOReturn destroyQueues( void ); + + /*! + @function getOutputQueue + @result A pointer to the output IOStreamBufferQueue structure for the stream, + or NULL if the stream is not open and the queue has not been created yet. + */ + virtual IOStreamBufferQueue *getOutputQueue(void); // get shared-memory output queue + + /*! + @function getOutputQueueMemoryDescriptor + @result An IOMemoryDescriptor object repesenting the shared memory + output queue buffer. + */ + virtual IOMemoryDescriptor *getOutputQueueMemoryDescriptor(void); + + /*! + @function getInputQueue + @result A pointer to the input IOStreamBufferQueue structure for the stream, + or NULL if the stream is not open and the queue has not been created yet. + */ + virtual IOStreamBufferQueue *getInputQueue(void); // get shared-memory input queue + + /*! + @function getInputQueueMemoryDescriptor + @result An IOMemoryDescriptor object repesenting the shared memory + input queue buffer. + */ + virtual IOMemoryDescriptor *getInputQueueMemoryDescriptor(void); + + + /*! + @functiongroup Managing buffers in an IOStream + */ + + /*! + @function addBuffer + @abstract Add a buffer to an IOStream. + @param buffer + @discussion + Adds an IOStreamBuffer to an IOStream. It will be added to the end + of the buffer array, so the buffer ID of existing buffers will not change. + */ + virtual IOReturn addBuffer(IOStreamBuffer *buffer); // add a new buffer to the stream + + /*! + @function addBuffers + @param buffers + @result + */ + virtual IOReturn addBuffers(OSArray *buffers); + + /*! + @function removeBuffer + @param buffer A pointer to an IOStreamBuffer object in the stream. + @result Returns kIOReturnSuccess if the buffer was removed, or kIOReturnNotFound + if the buffer was not in this stream. + @abstract + Removes a buffer from the stream. Buffers cannot be removed + while the stream is open, as this will change the buffer IDs of existing + buffers. + */ + virtual IOReturn removeBuffer(IOStreamBuffer *buffer); + + /*! + @function removeBuffer + @param bufferID The ID of the buffer to remove. + @result Returns kIOReturnSuccess if the buffer was removed. + @abstract + Removes a buffer from the stream. Buffers cannot be removed + while the stream is open, as this will change the buffer IDs of existing + buffers. + */ + + virtual IOReturn removeBuffer(IOStreamBufferID bufferID); + + /*! + @function removeAllBuffers + @result + */ + virtual IOReturn removeAllBuffers( void ); + + /*! + @function removeAllBuffers + @result Returns kIOReturnSuccess if all the buffers were successfully + removed. Buffers cannot be removed + while the stream is open, as this will change the buffer IDs of existing + buffers. + + */ + virtual IOItemCount getBufferCount( void ); + + /*! + @function getBuffers + @abstract Get an array containing all the buffers in the stream. + @discussion + Returns an OSArray containing all the buffers in the stream in order of their buffer ID. + */ + virtual OSArray *getBuffers( void ); + + + /*! + @function getBufferWithID + @param bufferID + The ID of the buffer to get. + @result + A pointer to an IOStreamBuffer object, or NULL if the + buffer ID was invalid for this stream. + */ + + virtual IOStreamBuffer *getBufferWithID(IOStreamBufferID bufferID); + + /*! + @functiongroup Managing notification ports + */ + + /*! + @function getInputPort + @abstract Get the Mach port used to receive notifications + from user space that a buffer has been added to the input queue. + */ + virtual mach_port_t getInputPort(void); + + /*! + @function setInputPort + @abstract Set the Mach port used to receive notifications from + user space that a buffer has been added to the input queue. + @param port + + */ + virtual IOReturn setInputPort(mach_port_t port); + + /*! + @function getOutputPort + @abstract Get the Mach port used to send notifications to user space + that a buffer has been added to the output queue. + */ + virtual mach_port_t getOutputPort(void); + + /*! + @function setOutputPort + @abstract Set the Mach port used to send notifications to user space + that a buffer has been added to the output queue. + @param port + */ + virtual IOReturn setOutputPort(mach_port_t port); + + /*! + @function sendOutputNotification + @abstract Send a notification to the user client that data is available + for reading on the output queue. This will result in the user's output + handler being called, if they registered one. + @result Returns kIOReturnSuccess if the notification was successfully sent. + */ + virtual IOReturn sendOutputNotification(void); + + /*! + @functiongroup Queueing and dequeueing buffers + */ + + /*! + @function enqueueOutputBuffer + @abstract A convenience method for enqueueing a buffer. + @param buffer + @param dataOffset + @param dataLength + @param controlOffset + @param controlLength + @result + */ + virtual IOReturn enqueueOutputBuffer(IOStreamBuffer *buffer, + IOByteCount dataOffset = 0, + IOByteCount dataLength = 0, + IOByteCount controlOffset = 0, + IOByteCount controlLength = 0); + + + /*! + @function enqueueOutputEntry + @param entry + @result + */ + virtual IOReturn enqueueOutputEntry( IOStreamBufferQueueEntry *entry ); + + /*! + @function dequeueInputEntry + @param entry + @result + */ + virtual IOReturn dequeueInputEntry( IOStreamBufferQueueEntry *entry ); + + /*! + @functiongroup Managing notifications + */ + + /*! + @function inputCallback + @abstract Input callback function to be implemented by a subclass; + @param token + A 32-bit token value that can be used by convention to communicate + from user space to the stream. The semantics of this value are + defined by the IOStream subclass. + @discussion + The inputCallback() method is called as a result of a fast trap + from user space. It is called on the same thread as the user request, + but the subclass should implement this call as a notification sent + to a workloop so that the request is asynchronous. + */ + virtual void inputCallback( UInt32 token ); + + /*! + @function inputSyncCallback + @abstract Input callback function to be implemented by a subclass. + @param token + A 32-bit token value that can be used by convention to communicate + from user space to the stream. The semantics of this value are + defined by the IOStream subclass. + @discussion + The inputSyncCallback() method is called as a result of a fast trap + from user space. It is called on the same thread as the user request, + so no context switch is necessary. + */ + virtual void inputSyncCallback( UInt32 token ); + + /*! + @functiongroup Stream control + */ + + /*! + @function getStreamMode + @abstract Returns the mode of the stream, either input or output. + @result The mode of the stream, either kIOStreamModeInput + (from user space to kernel space) or the default + kIOStreamModeOutput (from kernel space to user space). + */ + virtual IOStreamMode getStreamMode(void); + + /*! + @function setStreamMode + @abstract Sets the mode of the stream, either input or output. + @discussion Subclasses may define whether it is possible + to change the mode of a stream. + */ + virtual IOReturn setStreamMode(IOStreamMode mode); + + /*! + @function startStream + @abstract Start sending data on a stream. + @result Returns kIOReturnSuccess if the stream was successfully started. + @discussion This must be implemented by a subclass. + */ + virtual IOReturn startStream(void); + + /*! + @function stopStream + @abstract Stop sending data on a stream. + @result Returns kIOReturnSuccess if the stream was successfully stopped. + @discussion This must be implemented by a subclass. + */ + virtual IOReturn stopStream(void); + + /*! + @function suspendStream + @abstract Temporarily suspend data flow on the stream. + @result Returns kIOReturnSuccess if the stream was successfully suspended. + @discussion This must be implemented by a subclass. + */ + virtual IOReturn suspendStream(void); + + /*! + @functiongroup Managing user clients + */ + + /*! + @function newUserClient + @abstract See the documentation for the IOService method newUserClient. + */ + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, OSDictionary * properties, + IOUserClient ** handler ); + + + /* Reserved slots */ + + OSMetaClassDeclareReservedUnused(IOStream, 0); + OSMetaClassDeclareReservedUnused(IOStream, 1); + OSMetaClassDeclareReservedUnused(IOStream, 2); + OSMetaClassDeclareReservedUnused(IOStream, 3); + OSMetaClassDeclareReservedUnused(IOStream, 4); + OSMetaClassDeclareReservedUnused(IOStream, 5); + OSMetaClassDeclareReservedUnused(IOStream, 6); + OSMetaClassDeclareReservedUnused(IOStream, 7); + OSMetaClassDeclareReservedUnused(IOStream, 8); + OSMetaClassDeclareReservedUnused(IOStream, 9); + OSMetaClassDeclareReservedUnused(IOStream, 10); + OSMetaClassDeclareReservedUnused(IOStream, 11); + OSMetaClassDeclareReservedUnused(IOStream, 12); + OSMetaClassDeclareReservedUnused(IOStream, 13); + OSMetaClassDeclareReservedUnused(IOStream, 14); + OSMetaClassDeclareReservedUnused(IOStream, 15); + OSMetaClassDeclareReservedUnused(IOStream, 16); + OSMetaClassDeclareReservedUnused(IOStream, 17); + OSMetaClassDeclareReservedUnused(IOStream, 18); + OSMetaClassDeclareReservedUnused(IOStream, 19); + OSMetaClassDeclareReservedUnused(IOStream, 20); + OSMetaClassDeclareReservedUnused(IOStream, 21); + OSMetaClassDeclareReservedUnused(IOStream, 22); + OSMetaClassDeclareReservedUnused(IOStream, 23); + OSMetaClassDeclareReservedUnused(IOStream, 24); + OSMetaClassDeclareReservedUnused(IOStream, 25); + OSMetaClassDeclareReservedUnused(IOStream, 26); + OSMetaClassDeclareReservedUnused(IOStream, 27); + OSMetaClassDeclareReservedUnused(IOStream, 28); + OSMetaClassDeclareReservedUnused(IOStream, 29); + OSMetaClassDeclareReservedUnused(IOStream, 30); + OSMetaClassDeclareReservedUnused(IOStream, 31); + +}; + + +/*! + @class IOStreamBuffer + A class representing a data buffer that is part of an IOStream. + */ + +class IOStreamBuffer : public OSObject +{ + OSDeclareDefaultStructors(IOStreamBuffer); + +protected: + IOMemoryDescriptor * _dataBuffer; // The data buffer is expected to be filled by hardware. + IOMemoryDescriptor * _controlBuffer; // The control buffer is expected to be defined by the hardware driver. + + IOStreamBufferID _bufferID; // Client handle for this buffer. + + OSArray * _clientMemoryMaps; // Maps for clients who are sharing these buffers. + + SInt32 _clientReferenceCount; // Count of client uses of this buffer. May be negative. + +public: + /*! + @function initWithMemoryDescriptors + */ + virtual bool initWithMemoryDescriptors(IOMemoryDescriptor *dataBuffer, + IOMemoryDescriptor *controlBuffer, + IOStreamBufferID bufferID = 0); + + /*! + @function withMemoryDescriptors + */ + static IOStreamBuffer *withMemoryDescriptors(IOMemoryDescriptor *dataBuffer, + IOMemoryDescriptor *controlBuffer, + IOStreamBufferID bufferID = 0); + + virtual void free(void); + + /*! + @function getBufferID + @abstract Gets the buffer identifier for the IOStreamBuffer object. + @discussion The buffer identifier is unique across all buffers in a stream. + */ + virtual IOStreamBufferID getBufferID(void); + + /*! + @function setBufferID + @abstract Sets the buffer identifier for the IOStreamBuffer object. + */ + + virtual void setBufferID( IOStreamBufferID bufferID ); + + /*! + @function setDataBuffer + @abstract Sets the data buffer for the IOStreamBuffer object. + */ + virtual void setDataBuffer(IOMemoryDescriptor *dataBuffer); + + /*! + @function setControlBuffer + @abstract Sets the control buffer for the IOStreamBuffer object. + */ + virtual void setControlBuffer(IOMemoryDescriptor *controlBuffer); + + /*! + @function getDataBuffer + @result A pointer to the IOMemoryDescriptor for the data buffer. + */ + virtual IOMemoryDescriptor *getDataBuffer(void); + + /*! + @function getControlBuffer + @result A pointer to the IOMemoryDescriptor for the control buffer. + */ + virtual IOMemoryDescriptor *getControlBuffer(void); + + /*! + @function getClientReferenceCount + @result The count of client references to this buffer. It may be positive + or negative, depending on whether the client is sending data into the kernel, + or the kernel is sending data out to the client. + */ + virtual SInt32 getClientReferenceCount( void ); + + /*! + @function sendClientReference + @param offset The offset in the buffer of the data sent to the client. + @param length The length of the data sent to the client. + @result The new client reference count. + @abstract + */ + virtual SInt32 sendClientReference( IOByteCount offset = 0, IOByteCount length = 0 ); + + /*! + @function receiveClientReference + @param offset The offset in the buffer of the data from the client. + @param length The length of the data from the client. + @abstract + */ + virtual SInt32 receiveClientReference( IOByteCount offset = 0, IOByteCount length = 0 ); + + /* Reserved slots */ + + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 0); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 1); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 2); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 3); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 4); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 5); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 6); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 7); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 8); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 9); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 10); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 11); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 12); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 13); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 14); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 15); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 16); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 17); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 18); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 19); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 20); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 21); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 22); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 23); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 24); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 25); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 26); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 27); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 28); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 29); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 30); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 31); + +}; + +#endif /* ! __IOKIT_IOSTREAM_H */ + diff --git a/QualcommWireless/include/IOKit/stream/IOStreamFamily.h b/QualcommWireless/include/IOKit/stream/IOStreamFamily.h new file mode 100644 index 0000000..a4eb7f0 --- /dev/null +++ b/QualcommWireless/include/IOKit/stream/IOStreamFamily.h @@ -0,0 +1,13 @@ +/* + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#ifndef __IOKIT_IOSTREAMFAMILY_H +#define __IOKIT_IOSTREAMFAMILY_H + +#include <IOKit/stream/IOStream.h> +#include <IOKit/stream/IOStreamShared.h> + + +#endif /* !__IOKIT_IOSTREAMFAMILY_H */ diff --git a/QualcommWireless/include/IOKit/stream/IOStreamShared.h b/QualcommWireless/include/IOKit/stream/IOStreamShared.h new file mode 100644 index 0000000..7d520bb --- /dev/null +++ b/QualcommWireless/include/IOKit/stream/IOStreamShared.h @@ -0,0 +1,180 @@ +/* + * IOStreamShared.h + * IOStreamFamily + * + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#if !defined(__IOKIT_IOSTREAMSHARED_H) +#define __IOKIT_IOSTREAMSHARED_H + +#include <sys/cdefs.h> + +#include <IOKit/IOTypes.h> + +/*! + @header IOStreamShared.h + IOStream definitions shared between kernel and user space. + */ + +__BEGIN_DECLS + +// Buffer numbers are guaranteed to go from 0 to bufferCount - 1. +/*! + @typedef IOStreamBufferID + */ +typedef UInt32 IOStreamBufferID; +#define kIOStreamBufferIDInvalid (~0) + +// This is the header for the shared-memory queue used to send buffer notifications +// from kernel to user space or vice versa. + +// Queue entry in input or output queue + +#ifdef __cplusplus + +/*! + @struct IOStreamBufferQueueEntry + @field bufferID The ID of the buffer passed in this queue entry. + @field dataLength The length of the valid data in the buffer. + @field reserved Reserved for future use. +*/ + +struct IOStreamBufferQueueEntry { + IOStreamBufferID bufferID; + UInt32 dataOffset; + UInt32 dataLength; + UInt32 controlOffset; + UInt32 controlLength; + UInt32 reserved[3]; +}; + + +/*! + @struct IOStreamBufferQueue + @field entryCount The number of queue entries in the queue. + @field headIndex The index of the next queue slot that will be filled in by the queue writer. + @field tailIndex The index of the next queue slot that can be read by the queue reader. + @field reserved Reserved for future use. + @field queue The array of queue entries. + */ + +struct IOStreamBufferQueue { + UInt32 entryCount; + volatile UInt32 headIndex; + volatile UInt32 tailIndex; + UInt32 reserved; + IOStreamBufferQueueEntry queue[0]; +}; + +#else + +typedef struct __IOStreamBufferQueueEntry { + IOStreamBufferID bufferID; + UInt32 dataOffset; + UInt32 dataLength; + UInt32 controlOffset; + UInt32 controlLength; + UInt32 reserved[3]; +} IOStreamBufferQueueEntry; + +typedef struct __IOStreamBufferQueue { + UInt32 entryCount; + volatile UInt32 headIndex; + volatile UInt32 tailIndex; + UInt32 reserved; + IOStreamBufferQueueEntry queue[0]; +} IOStreamBufferQueue; + +#endif + +/*! + @enum Memory mapping types + @constant kIOStreamMemoryTypeOutputQueue + @constant kIOStreamMemoryTypeInputQueue + @constant kIOStreamMemoryTypeBufferData + @constant kIOStreamMemoryTypeBufferControl + @constant kIOStreamBufferIDMask + @constant kIOStreamMemoryTypeMask + @abstract Memory types used with IOConnectMapMemory(). + @discussion + */ +enum { + kIOStreamMemoryTypeOutputQueue = 0x10000000, + kIOStreamMemoryTypeInputQueue = 0x20000000, + kIOStreamMemoryTypeBufferData = 0x30000000, + kIOStreamMemoryTypeBufferControl = 0x40000000, + kIOStreamBufferIDMask = 0x0FFFFFFF, + kIOStreamMemoryTypeMask = 0xF0000000 +}; + +/*! + @enum Mach port types + @constant kIOStreamPortTypeOutput + @constant kIOStreamPortTypeInput + @abstract Port types used with IOConnectSetNotificationPort(). + @discussion + */ +enum { + kIOStreamPortTypeOutput, + kIOStreamPortTypeInput +}; + +/*! + @enum IOStream open options + @discussion + */ + +enum { + kIOStreamOptionOpenExclusive = 0x00010000, + kIOStreamOptionOpenShared = 0x00020000 +}; + +/*! + @enum User client methods + @constant kIOStreamMethodOpen + @constant kIOStreamMethodClose + @constant kIOStreamMethodStart + @constant kIOStreamMethodStop + @constant kIOStreamMethodSuspend + @constant kIOStreamMethodGetMode + @constant kIOStreamMethodSetMode + + @abstract Client method numbers used with IOConnectMethod...() functions. + @discussion + */ +enum { + kIOStreamMethodOpen, + kIOStreamMethodClose, + kIOStreamMethodStart, + kIOStreamMethodStop, + kIOStreamMethodSuspend, + kIOStreamMethodGetMode, + kIOStreamMethodSetMode, + kIOStreamMethodGetBufferCount +}; + +/*! + @enum User client traps + @constant kIOStreamEnqueueInputTrap + @constant kIOStreamEnqueueInputSyncTrap + @abstract Client trap numbers used with IOConnectTrap..() functions. + @discussion + */ +enum { + kIOStreamEnqueueInputTrap, + kIOStreamEnqueueInputSyncTrap +}; + +typedef enum { + kIOStreamModeInput, // From user to kernel space + kIOStreamModeOutput, // From kernel to user space + kIOStreamModeInputOutput // bidirectional +} IOStreamMode; + + +__END_DECLS + +#endif /* ! __IOKIT_IOSTREAMSHARED_H */ + diff --git a/QualcommWireless/include/IOKit/stream/IOStreamUserClient.h b/QualcommWireless/include/IOKit/stream/IOStreamUserClient.h new file mode 100644 index 0000000..887575a --- /dev/null +++ b/QualcommWireless/include/IOKit/stream/IOStreamUserClient.h @@ -0,0 +1,76 @@ +/* + * IOStreamUserClient.h + * IOStreamFamily + * + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#if !defined( __IOKIT_IOSTREAMUSERCLIENT_H ) +#define __IOKIT_IOSTREAMUSERCLIENT_H + + +#include <IOKit/IOUserClient.h> + +#include <IOKit/stream/IOStreamShared.h> +#include <IOKit/stream/IOStream.h> + +class IOStreamUserClient : public IOUserClient +{ + OSDeclareDefaultStructors( IOStreamUserClient ) + +protected: + IOStream * _owner; + task_t _task; + +public: + virtual bool initWithTask( + task_t owningTask, void * securityToken, UInt32 type, + OSDictionary * properties); + virtual bool initWithTask( + task_t owningTask, void * securityToken, UInt32 type); + + virtual IOReturn clientClose( void ); + virtual IOReturn clientDied( void ); + + virtual IOService * getService( void ); + + virtual IOReturn registerNotificationPort( + mach_port_t port, UInt32 type, UInt32 refCon ); + + virtual IOReturn connectClient( IOUserClient * client ); + + virtual IOExternalMethod * getTargetAndMethodForIndex( + IOService ** targetP, UInt32 index ); + + virtual IOExternalTrap * + getTargetAndTrapForIndex( IOService **targetP, UInt32 index ); + + virtual IOReturn clientMemoryForType( UInt32 type, + IOOptionBits * options, + IOMemoryDescriptor ** memory ); + + virtual bool start( IOService * provider ); + + +protected: + virtual IOReturn openMethod( char * dataIn, char * dataOut, + IOByteCount inputSize, IOByteCount * outputSize ); + virtual IOReturn closeMethod( void ); + virtual IOReturn startMethod( void ); + virtual IOReturn stopMethod( void ); + virtual IOReturn suspendMethod( void ); + virtual IOReturn getModeMethod( char * dataOut, + IOByteCount * outputSize ); + virtual IOReturn setModeMethod( char * dataIn, + IOByteCount inputSize ); + virtual IOReturn getBufferCountMethod( char * dataOut, + IOByteCount * outputSize ); + + virtual IOReturn inputTrap( UInt32 token ); + virtual IOReturn inputSyncTrap( UInt32 token ); + +}; + +#endif /* ! __IOKIT_IOSTREAMUSERCLIENT_H */ + diff --git a/QualcommWireless/include/IOKit/system.h b/QualcommWireless/include/IOKit/system.h new file mode 100644 index 0000000..75c0ac6 --- /dev/null +++ b/QualcommWireless/include/IOKit/system.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1998-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef __IOKIT_SYSTEM_H +#define __IOKIT_SYSTEM_H + +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#include <mach/mach_types.h> +#include <mach/mach_interface.h> +#include <mach/memory_object_types.h> + +#include <stdarg.h> +#include <stdint.h> +#include <string.h> + +#include <IOKit/assert.h> /* Must be before other includes of kern/assert.h */ + +#include <kern/kern_types.h> +#include <kern/thread.h> +#include <kern/debug.h> +#include <kern/task.h> +#include <kern/sched_prim.h> +#include <kern/locks.h> +#include <kern/queue.h> +#include <kern/ipc_mig.h> +#include <libkern/libkern.h> + + +#ifndef _MISC_PROTOS_H_ +extern void _doprnt( const char *format, va_list *arg, + void (*lputc)(char), int radix ); +#endif + +__END_DECLS + +#endif /* !__IOKIT_SYSTEM_H */ diff --git a/QualcommWireless/include/IOKit/system_management/IOWatchDogTimer.h b/QualcommWireless/include/IOKit/system_management/IOWatchDogTimer.h new file mode 100644 index 0000000..0139a7b --- /dev/null +++ b/QualcommWireless/include/IOKit/system_management/IOWatchDogTimer.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOWATCHDOGTIMER_H +#define _IOWATCHDOGTIMER_H + +#include <IOKit/IOService.h> + +class IOWatchDogTimer : public IOService +{ + OSDeclareAbstractStructors(IOWatchDogTimer); + +protected: + IONotifier *notifier; + struct ExpansionData { }; + APPLE_KEXT_WSHADOW_PUSH; + ExpansionData *reserved; + APPLE_KEXT_WSHADOW_POP; + +public: + virtual bool start(IOService *provider) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService *provider) APPLE_KEXT_OVERRIDE; + virtual IOReturn setProperties(OSObject *properties) APPLE_KEXT_OVERRIDE; + virtual void setWatchDogTimer(UInt32 timeOut) = 0; + + OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 0); + OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 1); + OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 2); + OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 3); +}; + +#endif /* !_IOWATCHDOGTIMER_H */ diff --git a/QualcommWireless/include/IOKit/usb/AppleUSBDefinitions.h b/QualcommWireless/include/IOKit/usb/AppleUSBDefinitions.h new file mode 100644 index 0000000..257b46f --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/AppleUSBDefinitions.h @@ -0,0 +1,1214 @@ +/* + * Copyright (c) 1998-2019 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef AppleUSBCommon_AppleUSBDefinitions_h +#define AppleUSBCommon_AppleUSBDefinitions_h + +#include <TargetConditionals.h> +#if TARGET_OS_DRIVERKIT +#include <stdint.h> +#include <stddef.h> +#include <sys/_types/_uuid_t.h> +#include <DriverKit/IOTypes.h> +#include <DriverKit/IOLib.h> +#else +#include <IOKit/IOTypes.h> +#include <libkern/OSByteOrder.h> +#endif + +#ifndef IOUSBBit +#define IOUSBBit(bit) ((uint32_t)(1) << bit) +#endif + +#ifndef IOUSBBitRange +#define IOUSBBitRange(start, end) (~(((uint32_t)(1) << start) - 1) & (((uint32_t)(1) << end) | (((uint32_t)(1) << end) - 1))) +#endif + +#ifndef IOUSBBitRange64 +#define IOUSBBitRange64(start, end) (~(((uint64_t)(1) << start) - 1) & (((uint64_t)(1) << end) | (((uint64_t)(1) << end) - 1))) +#endif + +#ifndef IOUSBBitRangePhase +#define IOUSBBitRangePhase(start, end) (start) +#endif + +#ifndef USBToHost16 +#define USBToHost16 OSSwapLittleToHostInt16 +#endif + +#ifndef HostToUSB16 +#define HostToUSB16 OSSwapHostToLittleInt16 +#endif + +#ifndef USBToHost32 +#define USBToHost32 OSSwapLittleToHostInt32 +#endif + +#ifndef HostToUSB32 +#define HostToUSB32 OSSwapHostToLittleInt32 +#endif + +#ifndef USBToHost64 +#define USBToHost64 OSSwapLittleToHostInt64 +#endif + +#ifndef HostToUSB64 +#define HostToUSB64 OSSwapHostToLittleInt64 +#endif + +#define kIOUSB30Bitrate5Gbps ( 5 * 1000 * 1000 * 1000ULL) +#define kIOUSB30Bitrate10Gbps (10 * 1000 * 1000 * 1000ULL) +#define kIOUSB32Bitrate20Gbps (20 * 1000 * 1000 * 1000ULL) + +/*! + * @enum kIOUSBAppleVendorID + * @discussion Apple's vendor ID, assigned by the USB-IF + */ +enum +{ + kIOUSBAppleVendorID = 0x05AC +}; + +#pragma mark Descriptor definitions + +/*! + * @enum tIOUSBDescriptorType + * @brief Descriptor types defined by USB 2.0 Table 9-5 and USB 3.0 Table 9-6 + */ +enum tIOUSBDescriptorType +{ + kIOUSBDescriptorTypeDevice = 1, + kIOUSBDescriptorTypeConfiguration = 2, + kIOUSBDescriptorTypeString = 3, + kIOUSBDescriptorTypeInterface = 4, + kIOUSBDescriptorTypeEndpoint = 5, + kIOUSBDescriptorTypeDeviceQualifier = 6, + kIOUSBDescriptorTypeOtherSpeedConfiguration = 7, + kIOUSBDescriptorTypeInterfacePower = 8, + kIOUSBDescriptorTypeOTG = 9, + kIOUSBDescriptorTypeDebug = 10, + kIOUSBDescriptorTypeInterfaceAssociation = 11, + kIOUSBDescriptorTypeBOS = 15, + kIOUSBDescriptorTypeDeviceCapability = 16, + kIOUSBDecriptorTypeHID = 33, + kIOUSBDecriptorTypeReport = 34, + kIOUSBDescriptorTypePhysical = 35, + kIOUSBDescriptorTypeHub = 41, + kIOUSBDescriptorTypeSuperSpeedHub = 42, + kIOUSBDescriptorTypeSuperSpeedUSBEndpointCompanion = 48, + kIOUSBDescriptorTypeSuperSpeedPlusIsochronousEndpointCompanion = 49 +}; + +typedef enum tIOUSBDescriptorType tIOUSBDescriptorType; + +/*! + * @enum tIOUSBDescriptorSize + * @brief Size in bytes for descriptor structures + */ +enum tIOUSBDescriptorSize +{ + kIOUSBDescriptorHeaderSize = 2, + kIOUSBDescriptorSizeDevice = 18, + kIOUSBDescriptorSizeConfiguration = 9, + kIOUSBDescriptorSizeInterface = 9, + kIOUSBDescriptorSizeEndpoint = 7, + kIOUSBDescriptorSizeStringMinimum = kIOUSBDescriptorHeaderSize, + kIOUSBDescriptorSizeStringMaximum = 255, + kIOUSBDescriptorSizeDeviceQualifier = 10, + kIOUSBDescriptorSizeInterfaceAssociation = 8, + kIOUSBDescriptorSizeBOS = 5, + kIOUSBDescriptorSizeDeviceCapability = 3, + kIOUSBDescriptorSizeUSB20ExtensionCapability = 7, + kIOUSBDescriptorSizeSuperSpeedUSBDeviceCapability = 10, + kIOUSBDescriptorSizeContainerIDCapability = 20, + kIOUSBDescriptorSizeHubMinimum = 9, + kIOUSBDescriptorSizeHubMaximum = 21, + kIOUSBDescriptorSizeSuperSpeedHub = 12, + kIOUSBDescriptorSizeSuperSpeedUSBEndpointCompanion = 6, + kIOUSBDescriptorSizeSuperSpeedPlusIsochronousEndpointCompanion = 8, + kIOUSBDescriptorSizeBillboardDeviceMinimum = 44, + kIOUSBDescriptorSizeBillboardDeviceMaximum = 256, + kIOUSBDescriptorSizePlatformECIDCapability = 28, + kIOUSBDescriptorSizePlatformCapability = 20 +}; + +typedef enum tIOUSBDescriptorSize tIOUSBDescriptorSize; + +/*! + * @struct IOUSBDescriptorHeader + * @brief Base descriptor defined by USB 2.0 9.5 + * @discussion IOUSBDescriptorDefinitions declares structs to represent a variety of USB standard + * descriptors. + */ +struct IOUSBDescriptorHeader +{ + uint8_t bLength; + uint8_t bDescriptorType; +} __attribute__((packed)); + +typedef struct IOUSBDescriptorHeader IOUSBDescriptorHeader; + +/*! + * @brief Base descriptor defined by USB 2.0 9.5 + * @discussion Used to represent generic descriptor definitions + */ +typedef IOUSBDescriptorHeader IOUSBDescriptor; + +/*! + * @typedef IOUSBDeviceDescriptor + * @discussion Descriptor for a USB Device. + * See the USB Specification at <a href="http://www.usb.org" target="_blank">http://www.usb.org</a>. + */ +struct IOUSBDeviceDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t bcdUSB; + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bDeviceProtocol; + uint8_t bMaxPacketSize0; + uint16_t idVendor; + uint16_t idProduct; + uint16_t bcdDevice; + uint8_t iManufacturer; + uint8_t iProduct; + uint8_t iSerialNumber; + uint8_t bNumConfigurations; +} __attribute__((packed)); + +typedef struct IOUSBDeviceDescriptor IOUSBDeviceDescriptor; + +/*! + * @typedef IOUSBDeviceQualifierDescriptor + * @discussion USB Device Qualifier Descriptor. + * See the USB Specification at <a href="http://www.usb.org" target="_blank">http://www.usb.org</a>. + * USB 2.0 9.6.2: Device Qualifier + */ +struct IOUSBDeviceQualifierDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t bcdUSB; + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bDeviceProtocol; + uint8_t bMaxPacketSize0; + uint8_t bNumConfigurations; + uint8_t bReserved; +} __attribute__((packed)); + +typedef struct IOUSBDeviceQualifierDescriptor IOUSBDeviceQualifierDescriptor; + +/*! + * @typedef IOUSBConfigurationDescHeader + * @discussion Header of a IOUSBConfigurationDescriptor. Used to get the total length of the descriptor. + * USB 2.0 9.6.3: Configuration + */ +struct IOUSBConfigurationDescHeader +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t wTotalLength; +} __attribute__((packed)); + +typedef struct IOUSBConfigurationDescHeader IOUSBConfigurationDescHeader; + +/*! + * @typedef IOUSBConfigurationDescriptor + * @discussion Standard USB Configuration Descriptor. It is variable length, so this only specifies + * the known fields. We use the wTotalLength field to read the whole descriptor. + * See the USB Specification at <a href="http://www.usb.org" target="_blank">http://www.usb.org</a>. + * USB 2.0 9.6.3: Configuration + */ +struct IOUSBConfigurationDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t wTotalLength; + uint8_t bNumInterfaces; + uint8_t bConfigurationValue; + uint8_t iConfiguration; + uint8_t bmAttributes; + uint8_t MaxPower; +} __attribute__((packed)); + +typedef struct IOUSBConfigurationDescriptor IOUSBConfigurationDescriptor; + + +enum +{ + kIOUSBConfigurationDescriptorAttributeRemoteWakeCapable = IOUSBBit(5), + kIOUSBConfigurationDescriptorAttributeSelfPowered = IOUSBBit(6) +}; + + +/*! + * @typedef IOUSBInterfaceDescriptor + * @discussion Descriptor for a USB Interface. See the USB Specification at + * <a href="http://www.usb.org" target="_blank">http://www.usb.org</a>. + * USB 2.0 9.6.5: Interface + */ +struct IOUSBInterfaceDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bInterfaceNumber; + uint8_t bAlternateSetting; + uint8_t bNumEndpoints; + uint8_t bInterfaceClass; + uint8_t bInterfaceSubClass; + uint8_t bInterfaceProtocol; + uint8_t iInterface; +} __attribute__((packed)); + +typedef struct IOUSBInterfaceDescriptor IOUSBInterfaceDescriptor; + + +/*! + * @typedef IOUSBEndpointDescriptor + * @discussion Descriptor for a USB Endpoint. See the USB Specification at + * <a href="http://www.usb.org" target="_blank">http://www.usb.org</a>. + * USB 2.0 9.6.6: Endpoint + */ +struct IOUSBEndpointDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bEndpointAddress; + uint8_t bmAttributes; + uint16_t wMaxPacketSize; + uint8_t bInterval; +} __attribute__((packed)); + +typedef struct IOUSBEndpointDescriptor IOUSBEndpointDescriptor; + +enum +{ + kIOUSBEndpointDescriptorNumber = IOUSBBitRange(0, 3), + kIOUSBEndpointDescriptorNumberPhase = IOUSBBitRangePhase(0, 3), + kIOUSBEndpointDescriptorEndpointAddressReserved = IOUSBBitRange(4, 6), + kIOUSBEndpointDescriptorDirection = IOUSBBit(7), + kIOUSBEndpointDescriptorDirectionPhase = IOUSBBitRangePhase(7, 7), + kIOUSBEndpointDescriptorDirectionOut = 0, + kIOUSBEndpointDescriptorDirectionIn = IOUSBBit(7), + + kIOUSBEndpointDescriptorTransferType = IOUSBBitRange(0, 1), + kIOUSBEndpointDescriptorTransferTypePhase = IOUSBBitRangePhase(0, 1), + kIOUSBEndpointDescriptorTransferTypeControl = (0 << IOUSBBitRangePhase(0, 1)), + kIOUSBEndpointDescriptorTransferTypeIsochronous = (1 << IOUSBBitRangePhase(0, 1)), + kIOUSBEndpointDescriptorTransferTypeBulk = (2 << IOUSBBitRangePhase(0, 1)), + kIOUSBEndpointDescriptorTransferTypeInterrupt = (3 << IOUSBBitRangePhase(0, 1)), + kIOUSBEndpointDescriptorSynchronizationType = IOUSBBitRange(2, 3), + kIOUSBEndpointDescriptorSynchronizationTypePhase = IOUSBBitRangePhase(2, 3), + kIOUSBEndpointDescriptorSynchronizationTypeNone = (0 << IOUSBBitRangePhase(2, 3)), + kIOUSBEndpointDescriptorSynchronizationTypeAsynchronous = (1 << IOUSBBitRangePhase(2, 3)), + kIOUSBEndpointDescriptorSynchronizationTypeAdaptive = (2 << IOUSBBitRangePhase(2, 3)), + kIOUSBEndpointDescriptorSynchronizationTypeSynchronous = (3 << IOUSBBitRangePhase(2, 3)), + kIOUSBEndpointDescriptorUsageType = IOUSBBitRange(4, 5), + kIOUSBEndpointDescriptorUsageTypePhase = IOUSBBitRangePhase(4, 5), + kIOUSBEndpointDescriptorUsageTypeInterruptPeriodic = (0 << IOUSBBitRangePhase(4, 5)), + kIOUSBEndpointDescriptorUsageTypeInterruptNotification = (1 << IOUSBBitRangePhase(4, 5)), + kIOUSBEndpointDescriptorUsageTypeInterruptReserved1 = (2 << IOUSBBitRangePhase(4, 5)), + kIOUSBEndpointDescriptorUsageTypeInterruptReserved2 = (3 << IOUSBBitRangePhase(4, 5)), + kIOUSBEndpointDescriptorUsageTypeIsocData = (0 << IOUSBBitRangePhase(4, 5)), + kIOUSBEndpointDescriptorUsageTypeIsocFeedback = (1 << IOUSBBitRangePhase(4, 5)), + kIOUSBEndpointDescriptorUsageTypeIsocImplicit = (2 << IOUSBBitRangePhase(4, 5)), + kIOUSBEndpointDescriptorUsageTypeIsocReserved = (3 << IOUSBBitRangePhase(4, 5)), + + kIOUSBEndpointDescriptorPacketSize = IOUSBBitRange(0, 10), + kIOUSBEndpointDescriptorPacketSizePhase = IOUSBBitRangePhase(0, 10), + kIOUSBEndpointDescriptorPacketSizeMult = IOUSBBitRange(11, 12), + kIOUSBEndpointDescriptorPacketSizeMultPhase = IOUSBBitRangePhase(11, 12), + kIOUSBEndpointDescriptorReserved = IOUSBBitRange(13, 15), + kIOUSBEndpointDescriptorReservedPhase = IOUSBBitRangePhase(13, 15) +}; + +/*! + * @enum tIOUSBEndpointDirection + * @brief IO Direction of an endpoint + * @constant kIOUSBEndpointDirectionOut endpoint direction is host-to-device + * @constant kIOUSBEndpointDirectionIn endpoint direction is device-to-host + * @constant kIOUSBEndpointDirectionUnknown the direction is unknown + */ +enum tIOUSBEndpointDirection +{ + kIOUSBEndpointDirectionOut = (kIOUSBEndpointDescriptorDirectionOut >> kIOUSBEndpointDescriptorDirectionPhase), + kIOUSBEndpointDirectionIn = (kIOUSBEndpointDescriptorDirectionIn >> kIOUSBEndpointDescriptorDirectionPhase), + kIOUSBEndpointDirectionUnknown = 2 +}; + +typedef enum tIOUSBEndpointDirection tIOUSBEndpointDirection; + +/*! + * @enum tIOUSBEndpointType + * @brief Describes the type of endpoint + * @constant kIOUSBEndpointTypeControl endpoint is a control endpoint + * @constant kIOUSBEndpointTypeIsochronous endpoint is an isochronous endpoint + * @constant kIOUSBEndpointTypeBulk is a bulk endpoint + * @constant kIOUSBEndpointTypeInterrupt is an interrupt endpoint + */ +enum tIOUSBEndpointType +{ + kIOUSBEndpointTypeControl = (kIOUSBEndpointDescriptorTransferTypeControl >> kIOUSBEndpointDescriptorTransferTypePhase), + kIOUSBEndpointTypeIsochronous = (kIOUSBEndpointDescriptorTransferTypeIsochronous >> kIOUSBEndpointDescriptorTransferTypePhase), + kIOUSBEndpointTypeBulk = (kIOUSBEndpointDescriptorTransferTypeBulk >> kIOUSBEndpointDescriptorTransferTypePhase), + kIOUSBEndpointTypeInterrupt = (kIOUSBEndpointDescriptorTransferTypeInterrupt >> kIOUSBEndpointDescriptorTransferTypePhase) +}; + +typedef enum tIOUSBEndpointType tIOUSBEndpointType; + +enum tIOUSBEndpointSynchronizationType +{ + kIOUSBEndpointSynchronizationTypeNone = (kIOUSBEndpointDescriptorSynchronizationTypeNone >> kIOUSBEndpointDescriptorSynchronizationTypePhase), + kIOUSBEndpointSynchronizationTypeAsynchronous = (kIOUSBEndpointDescriptorSynchronizationTypeAsynchronous >> kIOUSBEndpointDescriptorSynchronizationTypePhase), + kIOUSBEndpointSynchronizationTypeAdaptive = (kIOUSBEndpointDescriptorSynchronizationTypeAdaptive >> kIOUSBEndpointDescriptorSynchronizationTypePhase), + kIOUSBEndpointSynchronizationTypeSynchronous = (kIOUSBEndpointDescriptorSynchronizationTypeSynchronous >> kIOUSBEndpointDescriptorSynchronizationTypePhase) +}; + +typedef enum tIOUSBEndpointSynchronizationType tIOUSBEndpointSynchronizationType; + +enum tIOUSBEndpointUsageType +{ + kIOUSBEndpointUsageTypeIsocData = (kIOUSBEndpointDescriptorUsageTypeIsocData >> kIOUSBEndpointDescriptorUsageTypePhase), + kIOUSBEndpointUsageTypeIsocFeedback = (kIOUSBEndpointDescriptorUsageTypeIsocFeedback >> kIOUSBEndpointDescriptorUsageTypePhase), + kIOUSBEndpointUsageTypeIsocImplicit = (kIOUSBEndpointDescriptorUsageTypeIsocImplicit >> kIOUSBEndpointDescriptorUsageTypePhase) +}; + +typedef enum tIOUSBEndpointUsageType tIOUSBEndpointUsageType; + +/*! + * @enum tIOUSBLanguageID + * @brief USB Language Identifiers 1.0 + */ +enum tIOUSBLanguageID +{ + kIOUSBLanguageIDEnglishUS = 0x0409 +}; + +typedef enum tIOUSBLanguageID tIOUSBLanguageID; + +/*! + * @typedef IOUSBStringDescriptor + * @discussion Descriptor for a USB Strings. See the USB Specification at + * <a href="http://www.usb.org" target="_blank">http://www.usb.org</a>. + * USB 2.0 9.6.7: String + */ +struct IOUSBStringDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bString[1]; +} __attribute__((packed)); + +typedef struct IOUSBStringDescriptor IOUSBStringDescriptor; + +enum tIOUSBDeviceCapabilityType +{ + // USB 3.0 Table 9-13 + kIOUSBDeviceCapabilityTypeWireless = 1, + kIOUSBDeviceCapabilityTypeUSB20Extension = 2, + kIOUSBDeviceCapabilityTypeSuperSpeed = 3, + kIOUSBDeviceCapabilityTypeContainerID = 4, + + // USB 3.1 Table 9-14 + kIOUSBDeviceCapabilityTypePlatform = 5, + kIOUSBDeviceCapabilityTypePowerDelivery = 6, + kIOUSBDeviceCapabilityTypeBatteryInfo = 7, + kIOUSBDeviceCapabilityTypePdConsumerPort = 8, + kIOUSBDeviceCapabilityTypePdProviderPort = 9, + kIOUSBDeviceCapabilityTypeSuperSpeedPlus = 10, + kIOUSBDeviceCapabilityTypePrecisionMeasurement = 11, + kIOUSBDeviceCapabilityTypeWirelessExt = 12, + kIOUSBDeviceCapabilityTypeBillboard = 13, + kIOUSBDeviceCapabilityTypeBillboardAltMode = 15 +}; + +typedef enum tIOUSBDeviceCapabilityType tIOUSBDeviceCapabilityType; + +/*! + * @typedef IOUSBBOSDescriptor + * @discussion USB BOS descriptor. See the USB Specification at + * <a href="http://www.usb.org" target="_blank">http://www.usb.org</a>. + * USB 3.0 9.6.2: Binary Device Object Store (BOS) + */ +struct IOUSBBOSDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t wTotalLength; + uint8_t bNumDeviceCaps; +} __attribute__((packed)); + +typedef struct IOUSBBOSDescriptor IOUSBBOSDescriptor; + + +/*! + * @typedef IOUSBDeviceCapabilityDescriptorHeader + * @discussion USB BOS descriptor. See the USB Specification at + * <a href="http://www.usb.org" target="_blank">http://www.usb.org</a>. + * USB 3.0 9.6.2: Binary Device Object Store (BOS) + */ +struct IOUSBDeviceCapabilityDescriptorHeader +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t bNumDeviceCaps; +} __attribute__((packed)); + +typedef struct IOUSBDeviceCapabilityDescriptorHeader IOUSBDeviceCapabilityDescriptorHeader; + +/*! + * @typedef IOUSBDeviceCapabilityUSB2Extension + * @discussion Device Capability USB 2.0 Extension. + * USB 3.0 9.6.2.1: USB 2.0 Extension + */ +struct IOUSBDeviceCapabilityUSB2Extension +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint32_t bmAttributes; +} __attribute__((packed)); + +typedef struct IOUSBDeviceCapabilityUSB2Extension IOUSBDeviceCapabilityUSB2Extension; + + +enum +{ + kIOUSBUSB20ExtensionCapabilityLPM = IOUSBBit(1), + + // From USB 2.0 ECN Errata for Link Power Management. + kIOUSBUSB20ExtensionCapabilityBESLSupport = IOUSBBit(2), + kIOUSBUSB20ExtensionCapabilityBESLValid = IOUSBBit(3), + kIOUSBUSB20ExtensionCapabilityBESLDValid = IOUSBBit(4), + kIOUSBUSB20ExtensionCapabilityBESL = IOUSBBitRange(8, 11), + kIOUSBUSB20ExtensionCapabilityBESLPhase = IOUSBBitRangePhase(8, 11), + kIOUSBUSB20ExtensionCapabilityBESLD = IOUSBBitRange(12, 15), + kIOUSBUSB20ExtensionCapabilityBESLDPhase = IOUSBBitRangePhase(12, 15) +}; + + +/*! + * @typedef IOUSBDeviceCapabilitySuperSpeedUSB + * @discussion Device Capability SuperSpeed USB. USB 3.0 9.6.2.2: SuperSpeed USB Device Capability + */ +struct IOUSBDeviceCapabilitySuperSpeedUSB +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t bmAttributes; + uint16_t wSpeedsSupported; + uint8_t bFunctionalitySupport; + uint8_t bU1DevExitLat; + uint16_t wU2DevExitLat; +} __attribute__((packed)); + +typedef struct IOUSBDeviceCapabilitySuperSpeedUSB IOUSBDeviceCapabilitySuperSpeedUSB; + + +enum +{ + kIOUSBSuperSpeedDeviceCapabilityLTM = IOUSBBit(1), + + kIOUSBSuperSpeedDeviceCapabilityLowSpeed = IOUSBBit(0), + kIOUSBSuperSpeedDeviceCapabilityFullSpeed = IOUSBBit(1), + kIOUSBSuperSpeedDeviceCapabilityHighSpeed = IOUSBBit(2), + kIOUSBSuperSpeedDeviceCapability5Gb = IOUSBBit(3), + + kIOUSBSuperSpeedDeviceCapabilitySupportLowSpeed = 0, + kIOUSBSuperSpeedDeviceCapabilitySupportFullSpeed = 1, + kIOUSBSuperSpeedDeviceCapabilitySupportHighSpeed = 2, + kIOUSBSuperSpeedDeviceCapabilitySupport5Gb = 3, + + kIOUSBSuperSpeedDeviceCapabilityU1DevExitLatMax = 0xa, + kIOUSBSuperSpeedDeviceCapabilityU2DevExitLatMax = 0x7ff +}; + + +/*! + * @typedef IOUSBDeviceCapabilitySuperSpeedPlusUSB + * @discussion Device Capability SuperSpeedPlus USB. + * USB 3.1 9.6.2.5: SuperSpeedPlus USB Device Capability + */ +struct IOUSBDeviceCapabilitySuperSpeedPlusUSB +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t bReserved; + uint32_t bmAttributes; + uint16_t wFunctionalitySupport; + uint16_t wReserved; + uint32_t bmSublinkSpeedAttr[1]; +} __attribute__((packed)); + +typedef struct IOUSBDeviceCapabilitySuperSpeedPlusUSB IOUSBDeviceCapabilitySuperSpeedPlusUSB; + +enum +{ + //bmAttributes + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedAttrCount = IOUSBBitRange(0, 4), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedAttrCountPhase = IOUSBBitRangePhase(0, 4), + + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedIdCount = IOUSBBitRange(5, 8), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedIdCountPhase = IOUSBBitRangePhase(5, 8), + + //wFunctionalitySupport + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkMinSpeedId = IOUSBBitRange(0, 3), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkMinSpeedIdPhase = IOUSBBitRangePhase(0, 3), + + kIOUSBSuperSpeedPlusDeviceCapabilityReserved = IOUSBBitRange(4, 7), + kIOUSBSuperSpeedPlusDeviceCapabilityReservedPhase = IOUSBBitRangePhase(4, 7), + + kIOUSBSuperSpeedPlusDeviceCapabilityMinRxLaneCount = IOUSBBitRange(8, 11), + kIOUSBSuperSpeedPlusDeviceCapabilityMinRxLaneCountPhase = IOUSBBitRangePhase(8, 11), + + kIOUSBSuperSpeedPlusDeviceCapabilityMinTxLaneCount = IOUSBBitRange(12, 15), + kIOUSBSuperSpeedPlusDeviceCapabilityMinTxLaneCountPhase = IOUSBBitRangePhase(12, 15), + + //bmSublinkSpeedAttr + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedId = IOUSBBitRange(0, 3), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedIdPhase = IOUSBBitRangePhase(0, 3), + + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSE = IOUSBBitRange(4, 5), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEPhase = IOUSBBitRangePhase(4, 5), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEBits = (0 << kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEPhase), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEKbits = (1 << kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEPhase), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEMbits = (2 << kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEPhase), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEGbits = (3 << kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEPhase), + + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkType = IOUSBBitRange(6, 7), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkTypePhase = IOUSBBitRangePhase(6, 7), + + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSymmetry = IOUSBBit(6), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSymmetryPhase = IOUSBBitRangePhase(6, 6), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSymmetric = (0 << kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSymmetryPhase), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkAsymmetric = (1 << kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSymmetryPhase), + + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkDirection = IOUSBBit(7), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkDirectionPhase = IOUSBBitRangePhase(7, 7), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkDirectionRx = (0 << kIOUSBSuperSpeedPlusDeviceCapabilitySublinkDirectionPhase), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkDirectionTx = (1 << kIOUSBSuperSpeedPlusDeviceCapabilitySublinkDirectionPhase), + + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkReserved = IOUSBBitRange(8, 13), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkReservedPhase = IOUSBBitRangePhase(8, 13), + + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkProtocol = IOUSBBitRange(14, 15), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkProtocolPhase = IOUSBBitRangePhase(14, 15), + + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedMantissa = IOUSBBitRange(16, 31), + kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedMantissaPhase = IOUSBBitRangePhase(16, 31), +}; + + +/*! + * @typedef IOUSBDeviceCapabilityContainerID + * @discussion Device Capability Container ID. + * USB 3.0 9.6.2.3: Container ID + */ +struct IOUSBDeviceCapabilityContainerID +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t bReservedID; + uint8_t containerID[16]; +} __attribute__((packed)); + +typedef struct IOUSBDeviceCapabilityContainerID IOUSBDeviceCapabilityContainerID; + + +/*! + * @typedef IOUSBPlatformCapabilityDescriptor + * @discussion Device Capability Platform Descriptor. + * USB 3.1 9.6.2.4: Platform Descriptor + */ +struct IOUSBPlatformCapabilityDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t bReserved; + uuid_t PlatformCapabilityUUID; +} __attribute__((packed)); + +typedef struct IOUSBPlatformCapabilityDescriptor IOUSBPlatformCapabilityDescriptor; + + +/*! + * @typedef IOUSBDeviceCapabilityBillboardAltConfig + * @discussion Device Capability Billboard Alternate Setting Info. + * USB Billboard 3.1.6.2: Billboard Capability Descriptor V1.2 + */ +struct IOUSBDeviceCapabilityBillboardAltConfigCompatibility +{ + uint16_t wSVID; + uint32_t dwAlternateMode; + uint8_t iAlternateModeString; +} __attribute__((packed)); + +typedef struct IOUSBDeviceCapabilityBillboardAltConfigCompatibility IOUSBDeviceCapabilityBillboardAltConfigCompatibility; + +/*! + * @typedef IOUSBDeviceCapabilityBillboardAltConfig + * @discussion Device Capability Billboard Alternate Setting Info. + * USB Billboard 3.1.6.2: Billboard Capability Descriptor V1.1 and 1.21+ + */ +struct IOUSBDeviceCapabilityBillboardAltConfig +{ + uint16_t wSVID; + uint8_t bAltenateMode; + uint8_t iAlternateModeString; +} __attribute__((packed)); + +typedef struct IOUSBDeviceCapabilityBillboardAltConfig IOUSBDeviceCapabilityBillboardAltConfig; + +/*! + * @typedef IOUSBDeviceCapabilityBillboard + * @discussion Device Capability Billboard. + * USB Billboard 3.1.6.2: Billboard Capability Descriptor + */ +struct IOUSBDeviceCapabilityBillboard +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t iAdditionalInfoURL; + uint8_t bNumberOfAlternateModes; + uint8_t bPreferredAlternateMode; + uint16_t vCONNPower; + uint8_t bmConfigured[32]; + uint16_t bcdVersion; + uint8_t bAdditionalFailureInfo; + uint8_t bReserved; + IOUSBDeviceCapabilityBillboardAltConfig pAltConfigurations[]; +} __attribute__((packed)); + +typedef struct IOUSBDeviceCapabilityBillboard IOUSBDeviceCapabilityBillboard; + +/*! + * @typedef IOUSBDeviceCapabilityBillboardAltMode + * @discussion Device Capability Billboard Alternate mode. + * USB Billboard 3.1.6.3: Billboard Capability Descriptor V1.21 + */ +struct IOUSBDeviceCapabilityBillboardAltMode +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t bIndex; + uint16_t dwAlternateModeVdo; +} __attribute__((packed)); + +typedef struct IOUSBDeviceCapabilityBillboardAltMode IOUSBDeviceCapabilityBillboardAltMode; + +/*! + * @typedef IOUSBInterfaceAssociationDescriptor + * @discussion USB Inerface Association Descriptor. ECN to the USB 2.0 Spec. + * See the USB Specification at <a href="http://www.usb.org" target="_blank">http://www.usb.org</a>. + * USB 3.0 9.6.4: Interface Association + */ +struct IOUSBInterfaceAssociationDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bFirstInterface; + uint8_t bInterfaceCount; + uint8_t bFunctionClass; + uint8_t bFunctionSubClass; + uint8_t bFunctionProtocol; + uint8_t iFunction; +} __attribute__((packed)); + +typedef struct IOUSBInterfaceAssociationDescriptor IOUSBInterfaceAssociationDescriptor; + + +/*! + * @typedef IOUSBSuperSpeedEndpointCompanionDescriptor + * @discussion Descriptor for a SuperSpeed USB Endpoint Companion. + * See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. + * USB 3.1 9.6.7: SuperSpeed Endpoint Companion + */ +struct IOUSBSuperSpeedEndpointCompanionDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bMaxBurst; + uint8_t bmAttributes; + uint16_t wBytesPerInterval; +} __attribute__((packed)); + +typedef struct IOUSBSuperSpeedEndpointCompanionDescriptor IOUSBSuperSpeedEndpointCompanionDescriptor; + + +enum +{ + kIOUSBSuperSpeedEndpointCompanionDescriptorMaxBurst = IOUSBBitRange(0, 4), + kIOUSBSuperSpeedEndpointCompanionDescriptorMaxBurstPhase = IOUSBBitRangePhase(0, 4), + + kIOUSBSuperSpeedEndpointCompanionDescriptorBulkMaxStreams = IOUSBBitRange(0, 4), + kIOUSBSuperSpeedEndpointCompanionDescriptorBulkMaxStreamsPhase = IOUSBBitRangePhase(0, 4), + kIOUSBSuperSpeedEndpointCompanionDescriptorBulkReserved = IOUSBBitRange(5, 7), + kIOUSBSuperSpeedEndpointCompanionDescriptorBulkReservedPhase = IOUSBBitRangePhase(5, 7), + kIOUSBSuperSpeedEndpointCompanionDescriptorIsocMult = IOUSBBitRange(0, 1), + kIOUSBSuperSpeedEndpointCompanionDescriptorIsocMultPhase = IOUSBBitRangePhase(0, 1), + kIOUSBSuperSpeedEndpointCompanionDescriptorIsocReserved = IOUSBBitRange(2, 6), + kIOUSBSuperSpeedEndpointCompanionDescriptorIsocReservedPhase = IOUSBBitRangePhase(2, 6), + kIOUSBSuperSpeedEndpointCompanionDescriptorSSPIsocCompanion = IOUSBBit(7) +}; + +/*! + * @typedef IOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptor + * @discussion Descriptor for a SuperSpeedPlus Isochronout USB Endpoint Companion. + * See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. + * USB 3.1 9.6.8: SuperSpeedPlus Isochronous Endpoint Companion + */ +struct IOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t wReserved; + uint32_t dwBytesPerInterval; +} __attribute__((packed)); + +typedef struct IOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptor IOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptor; + + + +/*! + * @typedef IOUSB20HubDescriptor + * @discussion Descriptor for a USB hub. + * See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. + * USB 2.0 11.23.2.1: Hub Descriptor + */ +struct IOUSB20HubDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bNumberPorts; + uint16_t wHubCharacteristics; + uint8_t bPowerOnToPowerGood; + uint8_t bHubControllerCurrent; + uint8_t deviceRemovable[2]; // Technically variable size + uint8_t reserved[2]; // Unused +} __attribute__((packed)); + +typedef struct IOUSB20HubDescriptor IOUSB20HubDescriptor; + + +/*! + * @typedef IOUSBSuperSpeedHubDescriptor + * @discussion Descriptor for a Super Speed USB hub. + * See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. + * USB 3.0 10.13.2.1: SuperSpeed Hub Descriptor + */ +struct IOUSBSuperSpeedHubDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bNumberPorts; + uint16_t wHubCharacteristics; + uint8_t bPowerOnToPowerGood; + uint8_t bHubControllerCurrent; + uint8_t bHubDecodeLatency; + uint16_t wHubDelay; + uint16_t deviceRemovable; +} __attribute__((packed)); + +typedef struct IOUSBSuperSpeedHubDescriptor IOUSBSuperSpeedHubDescriptor; + + +enum +{ + kIOUSBSuperSpeedHubCharacteristicsPowerSwitchingMask = IOUSBBitRange(0, 1), + kIOUSBSuperSpeedHubCharacteristicsPowerSwitchingGanged = (0 << IOUSBBitRangePhase(0, 1)), + kIOUSBSuperSpeedHubCharacteristicsPowerSwitchingIndividual = (1 << IOUSBBitRangePhase(0, 1)), + kIOUSBSuperSpeedHubCharacteristicsCompoundDevice = IOUSBBit(2), + kIOUSBSuperSpeedHubCharacteristicsOverCurrentMask = IOUSBBitRange(3, 4), + kIOUSBSuperSpeedHubCharacteristicsOverCurrentGlobal = (0 << IOUSBBitRangePhase(3, 4)), + kIOUSBSuperSpeedHubCharacteristicsOverCurrentIndividual = (1 << IOUSBBitRangePhase(3, 4)), + kIOUSBSuperSpeedHubCharacteristicsReserved = IOUSBBitRange(5, 15), + + kIOUSBSuperSpeedHubDecodeLatencyMax = 10, + kIOUSBSuperSpeedHubDelayMax = 400 +}; + +/*! + * @typedef UASPipeDescriptor + * @discussion Structure used to specify the Mass Storage Specific UAS pipe usage descriptor + */ +struct UASPipeDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bPipeID; + uint8_t bReserved; +} __attribute__((packed)); + +typedef struct UASPipeDescriptor UASPipeDescriptor; + +/*! + * @typedef IOUSBHIDDescriptor + * @discussion USB HID Descriptor. See the USB HID Specification at + * <a href="http://www.usb.org" target="_blank">http://www.usb.org</a>. + */ +struct IOUSBHIDDescriptor +{ + uint8_t descLen; + uint8_t descType; + uint16_t descVersNum; + uint8_t hidCountryCode; + uint8_t hidNumDescriptors; + uint8_t hidDescriptorType; + uint8_t hidDescriptorLengthLo; + uint8_t hidDescriptorLengthHi; +} __attribute__((packed)); + +typedef struct IOUSBHIDDescriptor IOUSBHIDDescriptor; + +/*! + * @typedef IOUSBHIDReportDesc + * @discussion USB HID Report Descriptor header. See the USB HID Specification at + * <a href="http://www.usb.org" target="_blank">http://www.usb.org</a>. + */ +struct IOUSBHIDReportDesc +{ + uint8_t hidDescriptorType; + uint8_t hidDescriptorLengthLo; + uint8_t hidDescriptorLengthHi; +} __attribute__((packed)); + +typedef struct IOUSBHIDReportDesc IOUSBHIDReportDesc; + +/*! + * @typedef IOUSBDFUDescriptor + * @discussion USB Device Firmware Update Descriptor. See the USB Device Firmware Update + * Specification at <a href="http://www.usb.org" target="_blank">http://www.usb.org</a>. + */ +struct IOUSBDFUDescriptor +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bmAttributes; + uint16_t wDetachTimeout; + uint16_t wTransferSize; +} __attribute__((packed)); + +typedef struct IOUSBDFUDescriptor IOUSBDFUDescriptor; +#pragma mark Device requests +/*! + * @typedef IOUSBDeviceRequest + * @discussion Standard device request. + * See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. + * USB 2.0 9.3: USB Device Requests + */ +struct IOUSBDeviceRequest +{ + uint8_t bmRequestType; + uint8_t bRequest; + uint16_t wValue; + uint16_t wIndex; + uint16_t wLength; +} __attribute__((packed)); + +typedef struct IOUSBDeviceRequest IOUSBDeviceRequest; + +/*! + * @typedef IOUSBDeviceRequestSetSELData + * @discussion See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. + * USB 3.0 9.4.12: Set SEL Standard Device Request + */ +struct IOUSBDeviceRequestSetSELData +{ + uint8_t u1Sel; // Time in μs for U1 System Exit Latency + uint8_t u1Pel; // Time in μs for U1 Device to Host Exit Latency + uint16_t u2Sel; // Time in μs for U2 System Exit Latency + uint16_t u2Pel; // Time in μs for U2 Device to Host Exit Latency +} __attribute__((packed)); + +typedef struct IOUSBDeviceRequestSetSELData IOUSBDeviceRequestSetSELData; + +/*! + * @enum tIOUSBDeviceRequestDirectionValue + * @brief Values of 'direction' field of a device request + * @constant kIOUSBDeviceRequestDirectionValueOut the device request data phase direction is host-to-device + * @constant kIOUSBDeviceRequestDirectionValueIn the device request data phase direction is device-to-host + */ +enum tIOUSBDeviceRequestDirectionValue +{ + kIOUSBDeviceRequestDirectionValueOut = 0, + kIOUSBDeviceRequestDirectionValueIn = 1 +}; + +typedef enum tIOUSBDeviceRequestDirectionValue tIOUSBDeviceRequestDirectionValue; + +/*! + * @enum tIOUSBDeviceRequestType + * @brief Values of 'type' field of a device request + * @constant kIOUSBDeviceRequestTypeValueStandard the device request is a standard device request + * @constant kIOUSBDeviceRequestTypeValueClass the device request is a class specified device request + * @constant kIOUSBDeviceRequestTypeValueVendor the device request is a vendor specified device request + */ +enum tIOUSBDeviceRequestTypeValue +{ + kIOUSBDeviceRequestTypeValueStandard = 0, + kIOUSBDeviceRequestTypeValueClass = 1, + kIOUSBDeviceRequestTypeValueVendor = 2 +}; + +typedef enum tIOUSBDeviceRequestTypeValue tIOUSBDeviceRequestTypeValue; + +/*! + * @enum tIOUSBDeviceRequestRecipientValue + * @brief Values of 'recipient' field of a device request + * @constant kIOUSBDeviceRequestRecipientValueDevice the device request's recipient is a device + * @constant kIOUSBDeviceRequestRecipientValueInterface the device request's recipient is an interface + * @constant kIOUSBDeviceRequestRecipientValueEndpoint the device request's recipient is an endpoint + * @constant kIOUSBDeviceRequestRecipientValueOther the device request's recipient is an other type + */ +enum tIOUSBDeviceRequestRecipientValue +{ + kIOUSBDeviceRequestRecipientValueDevice = 0, + kIOUSBDeviceRequestRecipientValueInterface = 1, + kIOUSBDeviceRequestRecipientValueEndpoint = 2, + kIOUSBDeviceRequestRecipientValueOther = 3 +}; + +typedef enum tIOUSBDeviceRequestRecipientValue tIOUSBDeviceRequestRecipientValue; + +enum tIOUSBDeviceRequest +{ + kIOUSBDeviceRequestSize = 8, + kIOUSBDeviceRequestDirectionMask = IOUSBBit(7), + kIOUSBDeviceRequestDirectionPhase = IOUSBBitRangePhase(7, 7), + kIOUSBDeviceRequestDirectionOut = (kIOUSBDeviceRequestDirectionValueOut << kIOUSBDeviceRequestDirectionPhase), + kIOUSBDeviceRequestDirectionIn = (kIOUSBDeviceRequestDirectionValueIn << kIOUSBDeviceRequestDirectionPhase), + kIOUSBDeviceRequestTypeMask = IOUSBBitRange(5, 6), + kIOUSBDeviceRequestTypePhase = IOUSBBitRangePhase(5, 6), + kIOUSBDeviceRequestTypeStandard = (kIOUSBDeviceRequestTypeValueStandard << kIOUSBDeviceRequestTypePhase), + kIOUSBDeviceRequestTypeClass = (kIOUSBDeviceRequestTypeValueClass << kIOUSBDeviceRequestTypePhase), + kIOUSBDeviceRequestTypeVendor = (kIOUSBDeviceRequestTypeValueVendor << kIOUSBDeviceRequestTypePhase), + kIOUSBDeviceRequestRecipientMask = IOUSBBitRange(0, 4), + kIOUSBDeviceRequestRecipientPhase = IOUSBBitRangePhase(0, 4), + kIOUSBDeviceRequestRecipientDevice = (kIOUSBDeviceRequestRecipientValueDevice << kIOUSBDeviceRequestRecipientPhase), + kIOUSBDeviceRequestRecipientInterface = (kIOUSBDeviceRequestRecipientValueInterface << kIOUSBDeviceRequestRecipientPhase), + kIOUSBDeviceRequestRecipientEndpoint = (kIOUSBDeviceRequestRecipientValueEndpoint << kIOUSBDeviceRequestRecipientPhase), + kIOUSBDeviceRequestRecipientOther = (kIOUSBDeviceRequestRecipientValueOther << kIOUSBDeviceRequestRecipientPhase), +}; + +// USB 2.0 9.4: Standard Device Requests +// USB 3.0 9.4: Standard Device Requests +enum +{ + kIOUSBDeviceRequestGetStatus = 0, + kIOUSBDeviceRequestClearFeature = 1, + kIOUSBDeviceRequestGetState = 2, + kIOUSBDeviceRequestSetFeature = 3, + kIOUSBDeviceRequestSetAddress = 5, + kIOUSBDeviceRequestGetDescriptor = 6, + kIOUSBDeviceRequestSetDescriptor = 7, + kIOUSBDeviceRequestGetConfiguration = 8, + kIOUSBDeviceRequestSetConfiguration = 9, + kIOUSBDeviceRequestGetInterface = 10, + kIOUSBDeviceRequestSetInterface = 11, + kIOUSBDeviceRequestSynchFrame = 12, + kIOUSBDeviceRequestSetSel = 48, + kIOUSBDeviceRequestSetIsochronousDelay = 49 +}; + +// USB 2.0 9.4.5: Get Status +// USB 3.0 9.4.5: Get Status +enum +{ + kIOUSBDeviceStatusSelfPowered = IOUSBBit(0), + kIOUSBDeviceStatusRemoteWakeEnable = IOUSBBit(1), + kIOUSBDeviceStatusU1Enable = IOUSBBit(2), + kIOUSBDeviceStatusU2Enable = IOUSBBit(3), + kIOUSBDeviceStatusLTMEnable = IOUSBBit(4), + + kIOUSBInterfaceStatusRemoteWakeCapable = IOUSBBit(0), + kIOUSBInterfaceStatusRemoteWakeEnable = IOUSBBit(1), + + IOUSBEndpointStatusHalt = IOUSBBit(0) +}; + +// USB 2.0 Table 9-6: Standard Feature Selectors +// USB 3.0 Table 9-7: Standard Feature Selectors +enum +{ + kIOUSBDeviceFeatureSelectorRemoteWakeup = 1, + kIOUSBDeviceFeatureSelectorTestMode = 2, + kIOUSBDeviceFeatureSelectorU1Enable = 48, + kIOUSBDeviceFeatureSelectorU2Enable = 49, + kIOUSBDeviceFeatureSelectorLTMEnable = 50, + + kIOUSBInterfaceFeatureSelectorSuspend = 0, + + IOUSBEndpointFeatureSelectorStall = 0, +}; + +// USB 3.0 Table 9-8: Suspend Options +enum +{ + kIOUSBInterfaceSuspendLowPower = IOUSBBit(0), + kIOUSBInterfaceSuspendRemoteWakeEnable = IOUSBBit(1) +}; + +// USB 3.0 Table 10-16: Hub Parameters +enum +{ + kIOUSBHubPort2PortExitLatencyNs = 1000, + kIOUSBHubDelayNs = 400 +}; + +// USB 3.0 Table 8-33: Timing Parameters +enum +{ + kIOUSBPingResponseTimeNs = 400 +}; + +#pragma mark Power Constants +enum tIOUSBBusVoltage +{ + kIOUSBBusVoltageDefault = 5 +}; + +enum tIOUSB20BusCurrent +{ + kIOUSB20BusCurrentMinimum = 100, + kIOUSB20BusCurrentDefault = 500, + kIOUSB20BusCurrentMaxPowerUnits = 2 +}; + +enum tIOUSB30BusCurrent +{ + kIOUSB30BusCurrentMinimum = 150, + kIOUSB30BusCurrentDefault = 900, + kIOUSB30BusCurrentMaxPowerUnits = 8 +}; + +#pragma mark USB 3.0 constants +// USB 3.0 Table 6-21 +enum tIOUSB30ResetTimeout +{ + kIOUSB30ResetMinimumTimeout = 80, + kIOUSB30ResetTypicalTimeout = 100, + kIOUSB30ResetMaximumTimeout = 120, + kIOUSB30ResetMaximumWithMarginTimeout = 150 +}; + +// USB 3.0 Table 7-12 +enum tIOUSB30LinkStateTimeout +{ + kIOUSB30LinkStateSSInactiveQuietTimeout = 12, + kIOUSB30LinkStateRxDetectQuietTimeout = 12, + kIOUSB30LinkStatePollingLFPSTimeout = 360, + kIOUSB30LinkStatePollingActiveTimeout = 12, + kIOUSB30LinkStatePollingConfigurationTimeout = 12, + kIOUSB30LinkStatePollingIdleTimeout = 2, + kIOUSB30LinkStateU0RecoveryTimeout = 1, + kIOUSB30LinkStateU0LTimeout = 0, // 10 microseconds + kIOUSB30LinkStateU1NoLFPSResponseTimeout = 2, + kIOUSB30LinkStateU1PingTimeout = 300, + kIOUSB30LinkStateU2NoLFPSResponseTimeout = 2, + kIOUSB30LinKStateU2RxDetectDelay = 100, + kIOUSB30LinkStateU3NoLFPSResponseTimeout = 10, + kIOUSB30LinkStateU3WakeupRetryDelay = 100, + kIOUSB30LinkStateU3RxDetectDelay = 100, + kIOUSB30LinkStateRecoveryActiveTimeout = 12, + kIOUSB30LinkStateRecoveryConfigurationTimeout = 6, + kIOUSB30LinkStateRecoveryIdleTimeout = 2, + kIOUSB30LinkStateLoopbackExitTimeout = 2, + kIOUSB30LinkStateHotResetActiveTimeout = 12, + kIOUSB30LinkStateHotResetExistTimeout = 2, + + // USB 3.0 7.5.4 + kIOUSB30LinkStatePollingDeadline = (kIOUSB30LinkStatePollingLFPSTimeout + 1 + kIOUSB30LinkStatePollingActiveTimeout + kIOUSB30LinkStatePollingConfigurationTimeout + kIOUSB30LinkStatePollingIdleTimeout), + + // USB 3.0 7.5.9 and 7.5.10 + kIOUSB30LinkStateSSResumeDeadline = (kIOUSB30LinkStateU3NoLFPSResponseTimeout + kIOUSB30LinkStateRecoveryActiveTimeout + kIOUSB30LinkStateRecoveryConfigurationTimeout + kIOUSB30LinkStateRecoveryIdleTimeout), +}; + +// USB 3.1 Table 8-18 +enum tIOUSB30DeviceNotificationType +{ + kIOUSB30DeviceNotificationTypeFunctionWake = 1, + kIOUSB30DeviceNotificationTypeLatencyTolerance = 2, + kIOUSB30DeviceNotificationTypeBusIntervalAdjustment = 3, + kIOUSB30DeviceNotificationTypeHostRoleRequest = 4, + kIOUSB30DeviceNotificationTypeSublinkSpeed = 5 +}; + +// USB 3.1 Table 8-36 +enum tIOUSB30TimingParameters +{ + kIOUSB30TimingParameterBELTDefaultNs = 1 * 1000 * 1000, + kIOUSB30TimingParameterBELTMinNs = 125 * 1000 +}; + +// USB 3.1 Table 10-12 Port Status Type Codes +enum tIOUSB30HubPortStatusCode +{ + kIOUSB30HubPortStatusCodeStandard = 0, + kIOUSB30HubPortStatusCodePD = 1, + kIOUSB30HubPortStatusCodeExt = 2, + kIOUSB30HubPortStatusCodeCount = 3 +}; + +/*! + * @typedef IOUSB30HubPortStatusExt + * @discussion See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. + * USB 3.1 10.16.2.6 Get Port Status + */ +struct IOUSB30HubPortStatusExt +{ + uint16_t wPortStatus; + uint16_t wPortChange; + uint32_t dwExtPortStatus; +} __attribute__((packed)); + +// USB 3.1 Table 10-11. Note, offsets are specific to dwExtPortStatus +enum tIOUSB30HubExtStatus +{ + kIOUSB30HubExtStatusRxSublinkSpeedID = IOUSBBitRange(0, 3), + kIOUSB30HubExtStatusRxSublinkSpeedIDPhase = IOUSBBitRangePhase(0, 3), + + kIOUSB30HubExtStatusTxSublinkSpeedID = IOUSBBitRange(4, 7), + kIOUSB30HubExtStatusTxSublinkSpeedIDPhase = IOUSBBitRangePhase(4, 7), + + kIOUSB30HubExtStatusRxLaneCount = IOUSBBitRange(8, 11), + kIOUSB30HubExtStatusRxLaneCountPhase = IOUSBBitRangePhase(8, 11), + + kIOUSB30HubExtStatusTxLaneCount = IOUSBBitRange(12, 15), + kIOUSB30HubExtStatusTxLaneCountPhase = IOUSBBitRangePhase(12, 15) +}; + +#endif /* AppleUSBCommon_AppleUSBDefinitions_h */ diff --git a/QualcommWireless/include/IOKit/usb/IOUSBBus.h b/QualcommWireless/include/IOKit/usb/IOUSBBus.h new file mode 100644 index 0000000..21e6534 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBBus.h @@ -0,0 +1,35 @@ +/* + * Copyright © 1998-2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBBUS_H +#define _IOKIT_IOUSBBUS_H + +#include <IOKit/IOService.h> + +class IOUSBBus : public IOService +{ + OSDeclareAbstractStructors(IOUSBBus) +}; + +#endif + diff --git a/QualcommWireless/include/IOKit/usb/IOUSBCommand.h b/QualcommWireless/include/IOKit/usb/IOUSBCommand.h new file mode 100644 index 0000000..420d951 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBCommand.h @@ -0,0 +1,280 @@ +/* + * Copyright � 1998-2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBCOMMAND_H +#define _IOKIT_IOUSBCOMMAND_H + +#include <IOKit/IOCommand.h> +#include <IOKit/IOCommandPool.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IODMACommand.h> +#include <IOKit/usb/USB.h> + +/* + * USB Command + * This is the command block for a USB command to be queued on the + * Command Gate of the WorkLoop. Although the actual work of creating + * the command and enqueueing it is done for them via the deviceRequest, + * read, and write methods, this is the primary way that devices will get + * work done. + * Note: This is private to IOUSBController and should be moved to a + * private header. + */ + +typedef enum { + DEVICE_REQUEST, // Device request using pointer + READ, + WRITE, + CREATE_EP, + DELETE_EP, + DEVICE_REQUEST_DESC, // Device request using descriptor + DEVICE_REQUEST_BUFFERCOMMAND, // Device request using a second IOUSBCommand in _bufferCommand + INVALID_SELECTOR = 0xFF, // For use to invalidate a IOUSBCommand that has been returned +} usbCommand; + +#define kUSBCommandScratchBuffers 10 +#define kUSBCommandScratch64Buffers 5 + +/* + IOUSBCommand + Subclass of IOCommand that is used to add USB specific data. +*/ +class IOUSBCommand : public IOCommand +{ + OSDeclareAbstractStructors(IOUSBCommand) + +protected: + usbCommand _selector; + IOUSBDeviceRequestPtr _request; + USBDeviceAddress _address; + UInt8 _endpoint; + UInt8 _direction; + UInt8 _type; + bool _bufferRounding; + IOMemoryDescriptor * _buffer; + IOUSBCompletion _uslCompletion; + IOUSBCompletion _clientCompletion; + UInt32 _dataRemaining; // For Control transfers + UInt8 _stage; // For Control transfers + IOReturn _status; + IOMemoryDescriptor * _origBuffer; + IOUSBCompletion _disjointCompletion; + IOByteCount _dblBufLength; + UInt32 _noDataTimeout; + UInt32 _completionTimeout; + UInt32 _UIMScratch[kUSBCommandScratchBuffers]; + + struct ExpansionData + { + IOByteCount _reqCount; + IOMemoryDescriptor *_requestMemoryDescriptor; + IOMemoryDescriptor *_bufferMemoryDescriptor; + bool _multiTransferTransaction; + bool _finalTransferInTransaction; + bool _useTimeStamp; + AbsoluteTime _timeStamp; + bool _isSyncTransfer; // Returns true if the command is used for a synchronous transfer + IODMACommand *_dmaCommand; // used to get memory mapping + IOUSBCommand *_bufferUSBCommand; // points to another IOUSBCommand used for phase 2 of control transactions + IOUSBCommand *_masterUSBCommand; // points from the bufferUSBCommand back to the parent command + UInt32 _streamID; + void * _backTrace[kUSBCommandScratchBuffers]; + UInt64 _UIMScratch64[kUSBCommandScratch64Buffers]; + }; + ExpansionData * _expansionData; + + // we override these OSObject method in order to allocate and release our expansion data + virtual bool init() APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + +public: + + // static constructor + static IOUSBCommand * NewCommand(void); + + // Manipulators + void SetSelector(usbCommand sel); + void SetRequest(IOUSBDeviceRequestPtr req); + void SetAddress(USBDeviceAddress addr); + void SetEndpoint(UInt8 ep); + void SetDirection(UInt8 dir); + void SetType(UInt8 type); + void SetBufferRounding(bool br); + void SetBuffer(IOMemoryDescriptor *buf); + void SetUSLCompletion(IOUSBCompletion completion); + void SetClientCompletion(IOUSBCompletion completion); + void SetDataRemaining(UInt32 dr); + void SetStage(UInt8 stage); + void SetStatus(IOReturn stat); + void SetOrigBuffer(IOMemoryDescriptor *buf); + void SetDisjointCompletion(IOUSBCompletion completion); + void SetDblBufLength(IOByteCount len); + void SetNoDataTimeout(UInt32 to); + void SetCompletionTimeout(UInt32 to); + void SetUIMScratch(UInt32 index, UInt32 value); + void SetUIMScratch64(UInt32 index, UInt64 value); + void SetReqCount(IOByteCount reqCount); + void SetRequestMemoryDescriptor(IOMemoryDescriptor *requestMemoryDescriptor); + void SetBufferMemoryDescriptor(IOMemoryDescriptor *bufferMemoryDescriptor); + void SetMultiTransferTransaction(bool); + void SetFinalTransferInTransaction(bool); + void SetUseTimeStamp(bool); + void SetTimeStamp(AbsoluteTime timeStamp); + void SetIsSyncTransfer(bool); + inline void SetDMACommand(IODMACommand *dmaCommand) { _expansionData->_dmaCommand = dmaCommand; } + inline void SetStreamID(UInt32 streamID) { _expansionData->_streamID = streamID; } + void SetBufferUSBCommand(IOUSBCommand *bufferUSBCommand); + void SetBT(UInt32 index, void * value); + + // Accessors + usbCommand GetSelector(void); + IOUSBDeviceRequestPtr GetRequest(void); + USBDeviceAddress GetAddress(void); + UInt8 GetEndpoint(void); + UInt8 GetDirection(void); + UInt8 GetType(void); + bool GetBufferRounding(void); + IOMemoryDescriptor * GetBuffer(void); + IOUSBCompletion GetUSLCompletion(void); + IOUSBCompletion GetClientCompletion(void); + UInt32 GetDataRemaining(void); + UInt8 GetStage(void); + IOReturn GetStatus(void); + IOMemoryDescriptor * GetOrigBuffer(void); + IOUSBCompletion GetDisjointCompletion(void); + IOByteCount GetDblBufLength(void); + UInt32 GetNoDataTimeout(void); + UInt32 GetCompletionTimeout(void); + UInt32 GetUIMScratch(UInt32 index); + UInt64 GetUIMScratch64(UInt32 index); + IOByteCount GetReqCount(void); + IOMemoryDescriptor * GetRequestMemoryDescriptor(void); + IOMemoryDescriptor * GetBufferMemoryDescriptor(void); + bool GetMultiTransferTransaction(void); + bool GetFinalTransferInTransaction(void); + bool GetUseTimeStamp(void); + AbsoluteTime GetTimeStamp(void); + bool GetIsSyncTransfer(void); + inline IODMACommand * GetDMACommand(void) {return _expansionData->_dmaCommand; } + inline UInt32 GetStreamID(void) {return _expansionData->_streamID; } + inline IOUSBCommand * GetBufferUSBCommand(void) {return _expansionData->_bufferUSBCommand; } + inline IOUSBCommand * GetMasterUSBCommand(void) {return _expansionData->_masterUSBCommand ? _expansionData->_masterUSBCommand : this;} +}; + + +class IOUSBIsocCommand : public IOCommand +{ + OSDeclareAbstractStructors(IOUSBIsocCommand) + +protected: + usbCommand _selector; + USBDeviceAddress _address; + UInt8 _endpoint; + UInt8 _direction; + IOMemoryDescriptor * _buffer; + IOUSBIsocCompletion _completion; + UInt64 _startFrame; + UInt32 _numFrames; + IOUSBIsocFrame * _frameList; + IOReturn _status; + + struct ExpansionData + { + UInt32 _updateFrequency; + bool _useTimeStamp; + AbsoluteTime _timeStamp; + bool _isSyncTransfer; // Returns true if the command is used for a synchronous transfer + bool _rosettaClient; + IODMACommand * _dmaCommand; + IOUSBIsocCompletion _uslCompletion; + bool _lowLatency; + UInt32 _UIMScratch[kUSBCommandScratchBuffers]; + }; + ExpansionData * _expansionData; + + // we override these OSObject method in order to allocate and release our expansion data + virtual bool init() APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + +public: + // static constructor + static IOUSBIsocCommand *NewCommand(void); + + // Manipulators + void SetSelector(usbCommand sel) {_selector = sel; } + void SetAddress(USBDeviceAddress addr) {_address = addr; } + void SetEndpoint(UInt8 ep) {_endpoint = ep; } + void SetDirection(UInt8 dir) {_direction = dir; } + void SetBuffer(IOMemoryDescriptor *buf) {_buffer = buf; } + void SetCompletion(IOUSBIsocCompletion completion) {_completion = completion; } + void SetStartFrame(UInt64 sf) {_startFrame = sf; } + void SetNumFrames(UInt32 nf) {_numFrames = nf; } + void SetFrameList(IOUSBIsocFrame *fl) {_frameList = fl; } + void SetStatus(IOReturn stat) {_status = stat; } + void SetUpdateFrequency( UInt32 fr) { _expansionData->_updateFrequency = fr; } + void SetUIMScratch(UInt32 index, UInt32 value) { if(index < kUSBCommandScratchBuffers)_expansionData->_UIMScratch[index] = value; } + void SetUseTimeStamp(bool useIt) { _expansionData->_useTimeStamp= useIt; } + void SetTimeStamp(AbsoluteTime timeStamp) { _expansionData->_timeStamp= timeStamp; } + void SetIsSyncTransfer(bool isSync) { _expansionData->_isSyncTransfer = isSync; } + void SetRosettaClient(bool isRosetta) { _expansionData->_rosettaClient = isRosetta; } + void SetDMACommand(IODMACommand *dmaCommand) { _expansionData->_dmaCommand = dmaCommand; } + void SetUSLCompletion(IOUSBIsocCompletion completion) { _expansionData->_uslCompletion = completion; } + void SetLowLatency(bool lowLatency) { _expansionData->_lowLatency = lowLatency; } + + // Accessors + usbCommand GetSelector(void) { return _selector; } + USBDeviceAddress GetAddress(void) { return _address; } + UInt8 GetEndpoint(void) { return _endpoint; } + UInt8 GetDirection(void) { return _direction; } + IOMemoryDescriptor * GetBuffer(void) { return _buffer; } + IOUSBIsocCompletion GetCompletion(void) { return _completion; } + UInt64 GetStartFrame(void) { return _startFrame; } + UInt32 GetNumFrames(void) { return _numFrames; } + IOUSBIsocFrame * GetFrameList(void) { return _frameList; } + UInt32 GetUpdateFrequency(void) { return _expansionData->_updateFrequency; } + UInt32 GetUIMScratch(UInt32 index) { return( (index < kUSBCommandScratchBuffers)?_expansionData->_UIMScratch[index]:0); } + IOReturn GetStatus(void) { return _status; } + bool GetUseTimeStamp(void) { return _expansionData->_useTimeStamp; } + AbsoluteTime GetTimeStamp(void) { return _expansionData->_timeStamp; } + bool GetIsSyncTransfer(void) { return _expansionData->_isSyncTransfer; } + bool GetIsRosettaClient(void) { return _expansionData->_rosettaClient; } + IODMACommand * GetDMACommand(void) { return _expansionData->_dmaCommand; } + IOUSBIsocCompletion GetUSLCompletion(void) { return _expansionData->_uslCompletion; } + bool GetLowLatency(void) { return _expansionData->_lowLatency; } +}; + +class IOUSBCommandPool : public IOCommandPool +{ + OSDeclareDefaultStructors( IOUSBCommandPool ) + +protected: + virtual IOReturn gatedReturnCommand(IOCommand * command) APPLE_KEXT_OVERRIDE; + virtual IOReturn gatedGetCommand(IOCommand ** command, bool blockForCommand) APPLE_KEXT_OVERRIDE; + +public: + static IOCommandPool * withWorkLoop(IOWorkLoop * inWorkLoop); +}; + + +#endif + diff --git a/QualcommWireless/include/IOKit/usb/IOUSBController.h b/QualcommWireless/include/IOKit/usb/IOUSBController.h new file mode 100644 index 0000000..94a9b71 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBController.h @@ -0,0 +1,1186 @@ +/* + * Copyright � 1998-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBCONTROLLER_H +#define _IOKIT_IOUSBCONTROLLER_H + +//================================================================================================ +// +// Headers +// +//================================================================================================ +// +#include <libkern/c++/OSArray.h> + +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IODeviceMemory.h> +#include <IOKit/IOWorkLoop.h> +#include <IOKit/IOCommandGate.h> +#include <IOKit/IOCommandPool.h> + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/USBHub.h> +#include <IOKit/usb/IOUSBBus.h> +#include <IOKit/usb/IOUSBNub.h> +#include <IOKit/usb/IOUSBCommand.h> +#include <IOKit/usb/IOUSBWorkLoop.h> + +#include <IOKit/acpi/IOACPIPlatformDevice.h> + + +//================================================================================================ +// +// Types and Constants +// +//================================================================================================ +// +enum +{ + kErrataCMDDisableTestMode = (1ULL << 0), // turn off UHCI test mode + kErrataOnlySinglePageTransfers = (1ULL << 1), // Don't cross page boundaries in a single transfer + kErrataRetryBufferUnderruns = (1ULL << 2), // Don't cross page boundaries in a single transfer + kErrataLSHSOpti = (1ULL << 3), // Don't cross page boundaries in a single transfer + kErrataDisableOvercurrent = (1ULL << 4), // Always set the NOCP bit in rhDescriptorA register + kErrataLucentSuspendResume = (1ULL << 5), // Don't allow port suspend at the root hub + kErrataNeedsWatchdogTimer = (1ULL << 6), // Use Watchdog timer to reset confused controllers + kErrataNeedsPortPowerOff = (1ULL << 7), // Power off the ports and back on again to clear weird status. + kErrataAgereEHCIAsyncSched = (1ULL << 8), // needs workaround for Async Sched bug + kErrataNECOHCIIsochWraparound = (1ULL << 9), // needs workaround for NEC isoch buffer wraparound problem + kErrataNECIncompleteWrite = (1ULL << 10), // needs workaround for NEC bits not sticking (errata IBB-2UE-00030 Jun 23 2005) + kErrataICH6PowerSequencing = (1ULL << 11), // needs special power sequencing for early Transition machines + kErrataICH7ISTBuffer = (1ULL << 12), // buffer for Isochronous Scheduling Threshold + kErrataUHCISupportsOvercurrent = (1ULL << 13), // UHCI controller supports overcurrent detection + kErrataNeedsOvercurrentDebounce = (1ULL << 14), // The overcurrent indicator should be debounced by 10ms + kErrataSupportsPortResumeEnable = (1ULL << 15), // UHCI has resume enable bits at config address 0xC4 + kErrataNoCSonSplitIsoch = (1ULL << 16), // MCP79 - split iscoh is a little different + kErrataOHCINoGlobalSuspendOnSleep = (1ULL << 17), // when sleeping, do not put the OHCI controller in SUSPEND state. just leave it Operational with suspended downstream ports + kErrataMissingPortChangeInt = (1ULL << 18), // sometimes the port change interrupt may be missing + kErrataMCP79IgnoreDisconnect = (1ULL << 19), // MCP79 - need to ignore a connect/disconnect on wake + kErrataUse32bitEHCI = (1ULL << 20), // MCP79 - EHCI should only run with 32 bit DMA addresses + kErrataUHCISupportsResumeDetectOnConnect = (1ULL << 21), // UHCI controller will generate a ResumeDetect interrupt while in Global Suspend if a device is plugged in + kErrataDontUseCompanionController = (1ULL << 22), // For systems which will end up being EHCI only + kErrataIgnoreRootHubPowerClearFeature = (1ULL << 23), // MCP89 - don't power off the root hub ports + kErrataDisablePCIeLinkOnSleep = (1ULL << 24), // some controllers require us to do some extra work in the PCIe bridge on sleep.. we just set a property + kErrataXHCISWAssistXHCIIdle = (1ULL << 25), // XHCI requires software assist to go to Idle + kErrataEHCIUseRLvalue = (1ULL << 26), // we want to program Control and Bulk QHs with the RL on some controllers + kErrataXHCINoMSI = (1ULL << 27), // Don't use MSI Interrupts + kErrataXHCIEnableAutoCompliance = (1ULL << 28), // Enable auto compliance on this controller + kErrataXHCIPPTMuxing = (1ULL << 29), // Has Panther Point muxing implementation + kErratakUHCIResetAfterBabble = (1ULL << 30), // Used by UHCI for a particular vendor + kErrataXHCIParkRing = (1ULL << 31), // Enable Park/Ring + kErrataXHCIPantherPoint = (1ULL << 32), // This is an Intel Panther Point controller + kErrataXHCISWBandwidthCheck = (1ULL << 33) // This XHCI requires software to check the periodic bandwidth before creating an endpoint + +#ifndef __OPEN_SOURCE__ + // Other definitions in private header file +#endif +}; + +enum +{ + kUSBWatchdogTimeoutMS = 1000, + kUSBWatchdogTimeoutMSDuringRestartOff = 100 +}; + + +// Here are some constants which really need to be moved to IOPCIFamily +// This is a Power Management Register Block (section 3.2 of the PCI Power Management Spec) +enum +{ + kPCIPMRegBlockCapID = 0, // Capability ID + kPCIPMRegBlockNext = 1, // NextItemPtr + kPCIPMRegBlockPMC = 2, // Power Management Capabilities + kPCIPMRegBlockPMCSR = 4, // Power Management Control/Status Register + kPCIPMRegBlock_BSE = 6, // PMCSR Bridge Support Extensions + kPCIPMRegBlockData = 7 // Data +}; + + +/*! + @struct + @discussion This table contains the list of errata that are necessary for known problems with particular devices. + The format is vendorID, product ID, lowest revisionID needing errata, highest rev needing errata, errataBits. + The result of all matches is ORed together, so more than one entry may match. + Typically for a given errata a list of revisions that this applies to is supplied. + @field vendID The Vendor ID of the device + @field deviceID Product ID of device + @field revisionLo Lowest product revsion to apply errata to + @field revisionHi Highest product revision to apply errata to + @field errata Bit field flagging which errata to apply to device. +*/ + +struct ErrataListEntryStruct +{ + UInt16 vendID; + UInt16 deviceID; + UInt16 revisionLo; + UInt16 revisionHi; + UInt32 errata; +}; + +typedef struct ErrataListEntryStruct ErrataListEntry, *ErrataListEntryPtr; + + +struct ErrataList64EntryStruct +{ + UInt16 vendID; + UInt16 deviceID; + UInt16 revisionLo; + UInt16 revisionHi; + UInt64 errata; +}; + +typedef struct ErrataList64EntryStruct ErrataList64Entry, *ErrataList64EntryPtr; + + +struct SleepCurrentPerModelStruct +{ + char model[14]; + UInt32 totalExtraWakeCurrent; // Above the 500mA available to each port + UInt32 maxWakeCurrentPerPort; // Any one port can not exceed this + UInt32 totalExtraSleepCurrent; // Above the 500mA available to each port + UInt32 maxSleepCurrentPerPort; // Any one port can not exceed this +}; + +typedef struct SleepCurrentPerModelStruct SleepCurrentPerModel, *SleepCurrentPerModelPtr; + + +//================================================================================================ +// +// Routines used to implement synchronous I/O +// +//================================================================================================ +// +void IOUSBSyncCompletion(void *target, void * parameter, IOReturn status, UInt32 bufferSizeRemaining); + +void IOUSBSyncIsoCompletion(void *target, void * parameter, IOReturn status, IOUSBIsocFrame *pFrames); + + +//================================================================================================ +// +// Forward Declarations +// +//================================================================================================ +// +class IOUSBDevice; +class IOUSBLog; +class IOUSBHubDevice; +class IOUSBRootHubDevice; +class IOMemoryDescriptor; +class AppleUSBHubPort; + +//================================================================================================ +// +// IOUSBController Class +// +//================================================================================================ +// +/*! + @class IOUSBController + @abstract Base class for USB hardware driver + @discussion Not many directly useful methods for USB device driver writers, + IOUSBDevice, IOUSBInterface and IOUSBPipe provide more useful abstractions. + The bulk of this class interfaces between IOKit and the low-level UIM, which is + based on the MacOS9 UIM. To impliment a new controller type, subclass + IOUSBController and impiment all the "UIM functions". AppleUSBOHCI + is an example of this implementing all the functions necessary to drive an + OHCI controller. +*/ +class IOUSBController : public IOUSBBus +{ + OSDeclareAbstractStructors(IOUSBController) + friend class IOUSBControllerV2; + friend class IOUSBControllerV3; + friend class AppleUSBHub; + friend class IOUSBRootHubDevice; + +protected: + + IOUSBWorkLoop * _workLoop; + IOCommandGate * _commandGate; + IOUSBRootHubDevice * _rootHubDevice; + UInt32 _devZeroLock; + static UInt32 _busCount; + static bool gUsedBusIDs[256]; + static UInt32 gExtraCurrentPropertiesInitialized; + + struct ExpansionData + { + IOCommandPool *freeUSBCommandPool; + IOCommandPool *freeUSBIsocCommandPool; + IOTimerEventSource *watchdogUSBTimer; + bool _terminating; + bool _watchdogTimerActive; + bool _pcCardEjected; // Obsolete + UInt32 _busNumber; + UInt32 _currentSizeOfCommandPool; + UInt32 _currentSizeOfIsocCommandPool; + UInt8 _controllerSpeed; // Controller speed, passed down for splits + thread_call_t _terminatePCCardThread; // Obsolete + bool _addressPending[kUSBMaxDevices+2]; + SInt32 _activeIsochTransfers; // isochronous transfers in the queue + IOService *_provider; // common name for our provider + bool _controllerCanSleep; // true iff the controller is able to support sleep/wake + bool _needToClose; + UInt32 _isochMaxBusStall; // value (in ns) of the maximum PCI bus stall allowed for Isoch. + SInt32 _activeInterruptTransfers; // interrupt transfers in the queue + IOUSBRootHubDevice *_rootHubDeviceSS; + UInt32 _locationID; + UInt32 _ignoreDisconnectBitmap; // Port bitmap (adjusted for HS/SS ranges for XHCI controllers) + UInt32 _watchdogTimerTimeout; + bool _usePCIBusNumber; // T if we should use the PCI bus number in the calculations for USB Bus number + UInt32 _acpiRootHubDepth; // depth of the root hub in the ACPI device tree, this value is either hard coded or set to + bool _onThunderbolt; // T if this controller is on a Thunderbolt bus + UInt32 _locationID_SS; + }; + ExpansionData *_expansionData; + + // The following methods do not use and upper case initial letter because they are part of IOKit + // + +public: + static volatile UInt32 gExternalNonSSPortsUsingExtraCurrent; + + virtual bool init( OSDictionary * propTable ) APPLE_KEXT_OVERRIDE; + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual bool finalize(IOOptionBits options) APPLE_KEXT_OVERRIDE; + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ) APPLE_KEXT_OVERRIDE; + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ) APPLE_KEXT_OVERRIDE; + + void ReturnUSBCommand( IOUSBCommand * command ); + +protected: + + IOReturn getNubResources( IOService * regEntry ); + + virtual UInt32 GetErrataBits( + UInt16 vendorID, + UInt16 deviceID, + UInt16 revisionID ); + + + static IOReturn DoDeleteEP( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoAbortEP( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoClearEPStall( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoCreateEP( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + static IOReturn DoControlTransfer( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoIOTransfer( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoIsocTransfer( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoLowLatencyIsocTransfer( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static void ControlPacketHandler( + OSObject * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + + static void InterruptPacketHandler( + OSObject * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + + static void BulkPacketHandler( + OSObject * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + + static void IsocCompletionHandler( + OSObject * target, + void * parameter, + IOReturn status, + IOUSBIsocFrame *pFrames ); + + static void LowLatencyIsocCompletionHandler( + OSObject * target, + void * parameter, + IOReturn status, + IOUSBLowLatencyIsocFrame *pFrames ); + + static void WatchdogTimer(OSObject *target, IOTimerEventSource *sender); + + // Obsolete + static void TerminatePCCard(OSObject *target); + + static IOReturn ProtectedDevZeroLock(OSObject *target, void* lock, void *, void *, void*); + + + USBDeviceAddress GetNewAddress( void ); + + IOReturn ControlTransaction( IOUSBCommand * command ); + + IOReturn InterruptTransaction( IOUSBCommand * command ); + + IOReturn BulkTransaction( IOUSBCommand * command ); + + IOReturn IsocTransaction( IOUSBIsocCommand * command ); + + IOReturn LowLatencyIsocTransaction( IOUSBIsocCommand * command ); + + void FreeCommand( IOUSBCommand * command ); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Invokes the specified completion action of the request. If + // the completion action is unspecified, no action is taken. + void Complete( + IOUSBCompletion completion, + IOReturn status, + UInt32 actualByteCount = 0 ); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Invokes the specified completion action of the request. If + // the completion action is unspecified, no action is taken. + void CompleteWithTimeStamp ( + IOUSBCompletionWithTimeStamp completion, + IOReturn status, + UInt32 actualByteCount, + AbsoluteTime timeStamp); + + + + // + // UIM methods + // + +/*! + @function UIMInitialize + @abstract UIM function, initialise the controller and UIM data structures. +*/ + virtual IOReturn UIMInitialize( IOService * provider ) = 0; + +/*! + @function UIMFinalize + @abstract UIM function, finalise the controller and UIM data structures prior to removal. +*/ + virtual IOReturn UIMFinalize() = 0; + + // Control +/*! + @function UIMCreateControlEndpoint + @abstract UIM function, create a control endpoint for the controller. + @param functionNumber The USB device ID of the device for this endpoint + @param endpointNumber The endpoint number for this endpoint + @param maxPacketSize Maximum packet size of this endpoint + @param speed speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull +*/ + virtual IOReturn UIMCreateControlEndpoint( + UInt8 functionNumber, + UInt8 endpointNumber, + UInt16 maxPacketSize, + UInt8 speed) = 0; + +/* Note: this function has been superceded. */ + virtual IOReturn UIMCreateControlTransfer( short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + void * CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction) = 0; + +/*! + @function UIMCreateControlTransfer + @abstract UIM function, Do a transfer on a control endpoint. + This method supercedes the method which takes a void * parameter. + @param functionNumber The USB device ID of the device to perform the transaction with + @param endpointNumber The endpoint number for the transaction + @param completion Action to perform when I/O completes + @param CBP Memory descriptor describing the buffer to transfer. Will never describe + memory which has disjoint packets. + @param bufferRounding If true, short packets are OK and do not cause an error + @param bufferSize Size of the data to transfer in the data phase. (C + @param direction Specifies direction and PID for transaction. kUSBIn, KUSBOut (DATA PID) or kUSBSetup (SETUP PID). +*/ + virtual IOReturn UIMCreateControlTransfer( short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + IOMemoryDescriptor * CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction) = 0; + + // Bulk +/*! + @function UIMCreateBulkEndpoint + @abstract UIM function, create a bulk endpoint for the controller. + @param functionNumber The USB device ID of the device for this endpoint + @param endpointNumber The endpoint number for this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. + @param speed speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull + @param maxPacketSize Maximum packet size of this endpoint +*/ + virtual IOReturn UIMCreateBulkEndpoint( + UInt8 functionNumber, + UInt8 endpointNumber, + UInt8 direction, + UInt8 speed, + UInt8 maxPacketSize) = 0; + +/* Note: this function has been superceded. */ + virtual IOReturn UIMCreateBulkTransfer( short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + IOMemoryDescriptor * CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction) = 0; + + // Interrupt +/*! + @function UIMCreateInterruptEndpoint + @abstract UIM function, create an interrupt endpoint for the controller. + @param functionNumber The USB device ID of the device for this endpoint + @param endpointNumber The endpoint number for this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. + @param speed speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull + @param maxPacketSize Maximum packet size of this endpoint + @param pollingRate The maximum polling interval from the endpoint descriptor. +*/ + virtual IOReturn UIMCreateInterruptEndpoint( + short functionAddress, + short endpointNumber, + UInt8 direction, + short speed, + UInt16 maxPacketSize, + short pollingRate) = 0; + +/* Note: this function has been superceded. */ + virtual IOReturn UIMCreateInterruptTransfer( short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + IOMemoryDescriptor * CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction) = 0; + + // Isoch +/*! + @function UIMCreateIsochEndpoint + @abstract Create an Isochronous endpoint in the controller. + @param functionNumber The USB device ID of the device for this endpoint + @param endpointNumber The endpoint number for this endpoint + @param maxPacketSize Maximum packet size of this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. +*/ + virtual IOReturn UIMCreateIsochEndpoint( + short functionAddress, + short endpointNumber, + UInt32 maxPacketSize, + UInt8 direction) = 0; + +/*! + @function UIMCreateIsochTransfer + @abstract UIM function, Do a transfer on an Isocchronous endpoint. + @param functionNumber The USB device ID of the device to perform the transaction with + @param endpointNumber The endpoint number for the transaction + @param completion Action to perform when I/O completes + @param direction Specifies direction for transfer. kUSBIn or KUSBOut. + @param frameStart The frame number in which to start the transactions + @param pBuffer describes memory buffer. + @param frameCount number of frames to do transactions in + @param pFrames Describes transactions in individual frames, gives sizes and reults for transactions. +*/ + virtual IOReturn UIMCreateIsochTransfer( + short functionAddress, + short endpointNumber, + IOUSBIsocCompletion completion, + UInt8 direction, + UInt64 frameStart, + IOMemoryDescriptor * pBuffer, + UInt32 frameCount, + IOUSBIsocFrame *pFrames) = 0; + +/*! + @function UIMAbortEndpoint + @abstract UIM function Abort the specified endpoint, return all transactions queued on it. + @param functionNumber The USB device ID of the device to Abort + @param endpointNumber The endpoint number to Abort + @param direction Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut. +*/ + virtual IOReturn UIMAbortEndpoint( + short functionNumber, + short endpointNumber, + short direction) = 0; + +/*! + @function UIMDeleteEndpoint + @abstract UIM function Delete the specified endpoint, returning all transactions queued on it. + @param functionNumber The USB device ID of the device to Delete + @param endpointNumber The endpoint number to Delete + @param direction Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut. +*/ + virtual IOReturn UIMDeleteEndpoint( + short functionNumber, + short endpointNumber, + short direction) = 0; + +/*! + @function UIMClearEndpointStall + @abstract UIM function Clear stall on the specified endpoint, set data toggle to zero, + return all transactions queued on it. + @param functionNumber The USB device ID of the device to Clear + @param endpointNumber The endpoint number to Clear + @param direction Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut. +*/ + virtual IOReturn UIMClearEndpointStall( + short functionNumber, + short endpointNumber, + short direction) = 0; + +/*! + @function UIMRootHubStatusChange + @abstract UIM function UIMRootHubStatusChange - This method was internal to the UIM (never called by the superclass) until + IOUSBControllerV3. For UIMs which are a subclass of IOUSBController or IOUSBControllerV2, it can + still be used internally only. For subclasses of IOUSBControllerV3, however, the meaning has changed + slightly. Now, it is used to determine if there is a status change on the root hub, and if so, it + needs to update the IOUSBControllerV3 instance variable _rootHubStatusChangedBitmap +*/ + virtual void UIMRootHubStatusChange(void) = 0; + + static const IORegistryPlane *gIOUSBPlane; + +public: + + static IOUSBLog *_log; + + IOCommandGate * GetCommandGate(void); + + /*! + @struct Endpoint + Describes an endpoint of a device. + Simply an easier to use version of the endpoint descriptor. + @field descriptor The raw endpoint descriptor. + @field number Endpoint number + @field direction Endpoint direction: kUSBOut, kUSBIn, kUSBAnyDirn + @field transferType Type of endpoint: kUSBControl, kUSBIsoc, kUSBBulk, kUSBInterrupt + @field maxPacketSize Maximum packet size for endpoint, which will include the multiplier for HS High Bandwidth endpoints + @field interval Polling interval in milliseconds (only relevent for Interrupt endpoints) + */ + struct Endpoint { + IOUSBEndpointDescriptor * descriptor; + UInt8 number; + UInt8 direction; // in, out + UInt8 transferType; // cntrl, bulk, isoc, int + UInt16 maxPacketSize; // MPS (includes the multiplier for HS High Bandwidth Isoch endpoints) + UInt8 interval; + }; + + // Implements IOService::getWorkLoop const member function + virtual IOWorkLoop * getWorkLoop() const APPLE_KEXT_OVERRIDE; + + /* + * Root hub methods + * Only of interest to the IOUSBRootHubDevice object + */ +/*! + @function GetRootHubDeviceDescriptor + @abstract UIM function, return the device descriptor of the simulated root hub device + As GET_DESCRIPTOR control request for device descrptor + @param desc Descriptor structure to return data in +*/ + virtual IOReturn GetRootHubDeviceDescriptor( IOUSBDeviceDescriptor *desc ) = 0; + +/*! + @function GetRootHubDescriptor + @abstract UIM function, return the hub descriptor of the simulated root hub device + As GET_DESCRIPTOR control request for hub descrptor + @param desc Descriptor structure to return data in +*/ + virtual IOReturn GetRootHubDescriptor( IOUSBHubDescriptor *desc ) = 0; + +/*! + @function SetRootHubDescriptor + @abstract UIM function, optional. Set the hub descriptor data. + As SET_DESCRIPTOR control request for hub descrptor + @param buffer Descriptor data +*/ + virtual IOReturn SetRootHubDescriptor( OSData *buffer ) = 0; + +/*! + @function GetRootHubConfDescriptor + @abstract UIM function, retrun the configuration descriptor of the simulated root hub device + As GET_DESCRIPTOR control request for configuration descrptor + @param desc Descriptor structure to return data in +*/ + virtual IOReturn GetRootHubConfDescriptor( OSData *desc ) = 0; + +/*! + @function GetRootHubStatus + @abstract UIM function, get the status of the root hub. As GET_STATUS control request to device. + @param status Status structure to return +*/ + virtual IOReturn GetRootHubStatus( IOUSBHubStatus *status ) = 0; + +/*! + @function SetRootHubFeature + @abstract UIM function, set feature of root hub, As SET_FEATURE control request. + @param wValue The feature to set, as would be transferred in wValue field of SETUP packet. +*/ + virtual IOReturn SetRootHubFeature( UInt16 wValue ) = 0; + +/*! + @function ClearRootHubFeature + @abstract UIM function, set feature of root hub, As CLEAR_FEATURE control request. + @param wValue The feature to clear, as would be transferred in wValue field of SETUP packet. +*/ + virtual IOReturn ClearRootHubFeature( UInt16 wValue ) = 0; + +/*! + @function GetRootHubPortStatus + @abstract UIM function, get the status of a root hub port. As GET_STATUS control request to the port. + @param status Status structure to return + @param port Port to get status for. +*/ + virtual IOReturn GetRootHubPortStatus( IOUSBHubPortStatus *status, UInt16 port ) = 0; + +/*! + @function SetRootHubPortFeature + @abstract UIM function, set feature of a root hub port, As SET_FEATURE control request to a port. + @param wValue The feature to set, as would be transferred in wValue field of SETUP packet. + @param port Port to set feature for +*/ + virtual IOReturn SetRootHubPortFeature( UInt16 wValue, UInt16 port ) = 0; + +/*! + @function ClearRootHubPortFeature + @abstract UIM function, clear feature of a root hub port, As CLEAR_FEATURE control request to a port. + @param wValue The feature to clear, as would be transferred in wValue field of SETUP packet. + @param port Port to clear feature for +*/ + virtual IOReturn ClearRootHubPortFeature( UInt16 wValue, UInt16 port ) = 0; + +/*! + @function ClearRootHubPortFeature + @abstract UIM function, Impliments GET_BUS_STATE control request, now obsolete. +*/ + virtual IOReturn GetRootHubPortState( UInt8 *state, UInt16 port ) = 0; + +/*! + @function SetHubAddress + @abstract UIM function, set the address of the simulated root hub device, as SET_ADDRESS + @param wValue New address for root hub. +*/ + virtual IOReturn SetHubAddress( UInt16 wValue ) = 0; + + + /*! + @function openPipe + Open a pipe to the specified device endpoint + @param address Address of the device on the USB bus + @param speed of the device: kUSBHighSpeed or kUSBLowSpeed + @param endpoint description of endpoint to connect to + */ + virtual IOReturn OpenPipe( USBDeviceAddress address, + UInt8 speed, + Endpoint * endpoint ); + /*! + @function closePipe + Close a pipe to the specified device endpoint + @param address Address of the device on the USB bus + @param endpoint description of endpoint + */ + virtual IOReturn ClosePipe( USBDeviceAddress address, + Endpoint * endpoint ); + + // Controlling pipe state + /*! + @function abortPipe + Abort pending I/O to/from the specified endpoint, causing them to complete with return code kIOReturnAborted + @param address Address of the device on the USB bus + @param endpoint description of endpoint + */ + virtual IOReturn AbortPipe( + USBDeviceAddress address, + Endpoint * endpoint ); + /*! + @function resetPipe + Abort pending I/O and clear stalled state - this method is a combination of abortPipe and clearPipeStall + @param address Address of the device on the USB bus + @param endpoint description of endpoint + */ + virtual IOReturn ResetPipe( USBDeviceAddress address, + Endpoint * endpoint ); + /*! + @function clearPipeStall + Clear a pipe stall. + @param address Address of the device on the USB bus + @param endpoint description of endpoint + */ + virtual IOReturn ClearPipeStall( USBDeviceAddress address, + Endpoint * endpoint ); + + // Transferring Data + /*! + @function read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + */ + virtual IOReturn Read( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion ); + /*! + @function write + Write to an interrupt or bulk endpoint + @param buffer place to get the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion ); + + /*! + @function isocIO + Read from or write to an isochronous endpoint + @param buffer place to put the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer and result for each frame + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + */ + virtual IOReturn IsocIO( IOMemoryDescriptor * buffer, + UInt64 frameStart, + UInt32 numFrames, + IOUSBIsocFrame * frameList, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBIsocCompletion * completion ); + /*! + @function deviceRequest + Make a control request to the specified endpoint + There are two versions of this method, one uses a simple void * + to point to the data portion of the transfer, the other uses an + IOMemoryDescriptor to point to the data. + @param request parameter block for the control request + @param completion describes action to take when the request has been executed + @param address Address of the device on the USB bus + @param epNum endpoint number + */ + virtual IOReturn DeviceRequest( IOUSBDevRequest * request, + IOUSBCompletion * completion, + USBDeviceAddress address, + UInt8 epNum ); + + virtual IOReturn DeviceRequest( IOUSBDevRequestDesc * request, + IOUSBCompletion * completion, + USBDeviceAddress address, + UInt8 epNum ); + + /* + * Methods used by the hub driver to initialize a device + */ + /*! + @function AcquireDeviceZero + Get the device zero lock - call this before resetting a device, to ensure there's + only one device with address 0 + */ + virtual IOReturn AcquireDeviceZero( void ); + /*! + @function ReleaseDeviceZero + Release the device zero lock - call this to release the device zero lock, + when there is no longer a device at address 0 + */ + virtual void ReleaseDeviceZero( void ); + + // non-virtual methods + void WaitForReleaseDeviceZero( void ); + IOReturn ConfigureDeviceZero( UInt8 maxPacketSize, UInt8 speed ); + IOReturn GetDeviceZeroDescriptor( IOUSBDeviceDescriptor * desc, UInt16 size ); + IOReturn SetDeviceZeroAddress(USBDeviceAddress address); + IOUSBDevice * MakeDevice(USBDeviceAddress *address); + IOUSBHubDevice * MakeHubDevice(USBDeviceAddress *address); + IOReturn CreateDevice( IOUSBDevice * device, + USBDeviceAddress deviceAddress, + UInt8 maxPacketSize, + UInt8 speed, + UInt32 powerAvailable ); + + /*! + @function GetBandwidthAvailable + Returns the available bandwidth (in bytes) per frame or microframe for + isochronous transfers. + @result maximum number of bytes that a new iso pipe could transfer + per frame given current allocations. + */ + virtual UInt32 GetBandwidthAvailable( void ) = 0; + + /*! + @function GetFrameNumber + Returns the full current frame number. + @result The frame number. + */ + virtual UInt64 GetFrameNumber( void ) = 0; + + /*! + @function GetFrameNumber32 + Returns the least significant 32 bits of the frame number. + @result The lsb 32 bits of the frame number. + */ + virtual UInt32 GetFrameNumber32( void ) = 0; + + // Debugger polled mode + virtual void PollInterrupts( IOUSBCompletionAction safeAction = 0 ) = 0; + + virtual IOReturn PolledRead( + short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + IOMemoryDescriptor * CBP, + bool bufferRounding, + UInt32 bufferSize); + + OSMetaClassDeclareReservedUsed(IOUSBController, 0); + virtual void UIMCheckForTimeouts(void); + + OSMetaClassDeclareReservedUsed(IOUSBController, 1); + virtual IOReturn UIMCreateControlTransfer( short functionNumber, + short endpointNumber, + IOUSBCommand* command, + void* CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction); + + OSMetaClassDeclareReservedUsed(IOUSBController, 2); + virtual IOReturn UIMCreateControlTransfer( short functionNumber, + short endpointNumber, + IOUSBCommand* command, + IOMemoryDescriptor* CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction); + + OSMetaClassDeclareReservedUsed(IOUSBController, 3); +/*! + @function UIMCreateBulkTransfer + @abstract UIM function, Do a transfer on a bulk endpoint. + This method supercedes the method which takes multiple parameters. + @param command paramters for transfer. +*/ + virtual IOReturn UIMCreateBulkTransfer(IOUSBCommand* command); + + OSMetaClassDeclareReservedUsed(IOUSBController, 4); +/*! + @function UIMCreateInterruptTransfer + @abstract UIM function, Do a transfer on an interrupt endpoint. + This method supercedes the method which takes multiple parameters. + @param command paramters for transfer. +*/ + virtual IOReturn UIMCreateInterruptTransfer(IOUSBCommand* command); + + /*! + @function deviceRequest + Make a control request to the specified endpoint + There are two versions of this method, one uses a simple void * + to point to the data portion of the transfer, the other uses an + IOMemoryDescriptor to point to the data. + @param request parameter block for the control request + @param completion describes action to take when the request has been executed + @param address Address of the device on the USB bus + @param epNum endpoint number + */ + OSMetaClassDeclareReservedUsed(IOUSBController, 5); + virtual IOReturn DeviceRequest( IOUSBDevRequest * request, + IOUSBCompletion * completion, + USBDeviceAddress address, + UInt8 epNum, + UInt32 noDataTimeout, + UInt32 completionTimeout ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 6); + virtual IOReturn DeviceRequest( IOUSBDevRequestDesc * request, + IOUSBCompletion * completion, + USBDeviceAddress address, + UInt8 epNum, + UInt32 noDataTimeout, + UInt32 completionTimeout ); + + + + OSMetaClassDeclareReservedUsed(IOUSBController, 7); + /*! + @function read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + */ + virtual IOReturn Read( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 8); + /*! + @function write + Write to an interrupt or bulk endpoint + @param buffer place to get the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout ); + + // this should really not be using a padding slot, since free is in our superclas, but we shipped this way so now we need to leave it. + OSMetaClassDeclareReservedUsed(IOUSBController, 9); + virtual void free() APPLE_KEXT_OVERRIDE; + +protected: + +/*! + @function UIMRootHubStatusChange(bool) + @abstract UIM function UIMRootHubStatusChange(bool) - This method was internal to the UIM (never called by the superclass) until + IOUSBControllerV3. For UIMs which are a subclass of IOUSBController or IOUSBControllerV2, it can + still be used internally only. For subclasses of IOUSBControllerV3, however, it has become obsolete + (it still needs to be implemented since it is pure virtual) +*/ + OSMetaClassDeclareReservedUsed(IOUSBController, 10); + virtual void UIMRootHubStatusChange( bool abort ) = 0; + +public: + + OSMetaClassDeclareReservedUsed(IOUSBController, 11); + virtual IOReturn CreateRootHubDevice( IOService * provider, IOUSBRootHubDevice ** rootHubDevice); + + OSMetaClassDeclareReservedUsed(IOUSBController, 12); + /*! + @function Read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + @param noDataTimeout number of milliseconds of no data movement before the request is aborted + @param completionTimeout number of milliseonds after the command is on the bus in which it must complete + @param reqCount number of bytes requested for the transfer (must not be greater than the length of the buffer) + */ + virtual IOReturn Read( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 13); + /*! + @function Write + Write to an interrupt or bulk endpoint + @param buffer place to get the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been emptied + @param noDataTimeout number of milliseconds of no data movement before the request is aborted + @param completionTimeout number of milliseonds after the command is on the bus in which it must complete + @param reqCount number of bytes requested for the transfer (must not be greater than the length of the buffer) + */ + virtual IOReturn Write( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 14); + + virtual IOReturn GetRootHubStringDescriptor(UInt8 index, OSData *desc) = 0; + + OSMetaClassDeclareReservedUsed(IOUSBController, 15); + /*! + @function IsocIO + Read from or write to an isochronous endpoint + @param buffer place to put the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer and result for each frame + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + @param updateFrequency describes how often to update the framelist once the transfer has completed (in ms) + */ + virtual IOReturn IsocIO( IOMemoryDescriptor * buffer, + UInt64 frameStart, + UInt32 numFrames, + IOUSBLowLatencyIsocFrame * frameList, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBLowLatencyIsocCompletion * completion, + UInt32 updateFrequency ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 16); + + /*! + @function UIMCreateIsochTransfer + @abstract UIM function, Do a transfer on an Isocchronous endpoint. + @param functionNumber The USB device ID of the device to perform the transaction with + @param endpointNumber The endpoint number for the transaction + @param completion Action to perform when I/O completes + @param direction Specifies direction for transfer. kUSBIn or KUSBOut. + @param frameStart The frame number in which to start the transactions + @param pBuffer describes memory buffer. + @param frameCount number of frames to do transactions in + @param pFrames Describes transactions in individual frames, gives sizes and reults for transactions. + @param updateFrequency Describes how often we update the frameList parameters (in ms) + */ + virtual IOReturn UIMCreateIsochTransfer( + short functionAddress, + short endpointNumber, + IOUSBIsocCompletion completion, + UInt8 direction, + UInt64 frameStart, + IOMemoryDescriptor * pBuffer, + UInt32 frameCount, + IOUSBLowLatencyIsocFrame *pFrames, + UInt32 updateFrequency); + + + OSMetaClassDeclareReservedUsed(IOUSBController, 17); + virtual IOReturn CheckForDisjointDescriptor(IOUSBCommand *command, UInt16 maxPacketSize); + + /*! + @function UIMCreateIsochTransfer + @abstract UIM function, Do a transfer on an Isocchronous endpoint. + @param command an IOUSBIsocCommand object with all the necessary information + */ + OSMetaClassDeclareReservedUsed(IOUSBController, 18); + virtual IOReturn UIMCreateIsochTransfer(IOUSBIsocCommand *command); + + // do not use this slot without first checking bug rdar://6022420 + OSMetaClassDeclareReservedUnused(IOUSBController, 19); + +protected: + void IncreaseIsocCommandPool(); + void IncreaseCommandPool(); + void ParsePCILocation(const char *str, int *deviceNum, int *functionNum); + int ValueOfHexDigit(char c); + + UInt32 ExpressCardPort( IORegistryEntry * provider ); + IOACPIPlatformDevice * CopyACPIDevice( IORegistryEntry * device ); + bool DumpUSBACPI( IORegistryEntry * acpiDevice ); + bool IsPortInternal( IORegistryEntry * provider, UInt32 portnum, UInt32 locationID ); + bool IsControllerMuxed( IORegistryEntry * provider, UInt32 locationID ); +#ifndef __OPEN_SOURCE__ + bool IsPortMuxed(IORegistryEntry * provider, UInt32 portnum, UInt32 locationID, char *muxName); + bool IsPortMapped(IORegistryEntry * provider, UInt32 portNumber, UInt32 locationID, UInt32 *mappedPort); +#endif + UInt8 GetControllerSpeed() { return (_expansionData ? _expansionData->_controllerSpeed : 255); } + +private: + bool HasExpressCard( IORegistryEntry * acpiDevice, UInt32 * portnum ); + bool CheckACPIUPCTable( IORegistryEntry * acpiDevice, UInt32 portnum, UInt32 locationID ); + IOReturn CheckACPIUPCTable( IORegistryEntry * acpiDevice, UInt32 portNumber, UInt32 locationID, UInt8 *connectorType ); + +#ifndef __OPEN_SOURCE__ + bool CheckACPIUPCTableForMuxedMethods( IORegistryEntry * acpiDevice, UInt32 portnum, UInt32 locationID, char* muxName ); + bool CheckACPIForPortMapping( IORegistryEntry * acpiDevice, UInt32 portNumber, UInt32 locationID, UInt32 *mappedPort ); +#endif + bool CheckACPIUPCTableForInternalHubErrataBits( IORegistryEntry* acpiDevice, UInt32 portnum, UInt32 locationID, UInt32* errataBits ); + int calculateUSBDepth(UInt32 locationID); + int calculateACPIDepth(int hubUSBDepth); +}; + +//================================================================================================ +// +// IOUSBController_ExtraCurrentIOLockClass +// +// Used for locking access to shared resources between all EHCI controllers +// +//================================================================================================ +// +class IOUSBController_ExtraCurrentIOLockClass +{ +public: + IOUSBController_ExtraCurrentIOLockClass(void); // Constructor + virtual ~IOUSBController_ExtraCurrentIOLockClass(void); // Destructor + + IOLock *lock; +}; + +#endif + diff --git a/QualcommWireless/include/IOKit/usb/IOUSBControllerListElement.h b/QualcommWireless/include/IOKit/usb/IOUSBControllerListElement.h new file mode 100644 index 0000000..fa0d591 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBControllerListElement.h @@ -0,0 +1,125 @@ +/* + * Copyright © 1998-2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOUSBCONTROLLERLISTELEMENT_H +#define _IOUSBCONTROLLERLISTELEMENT_H + + +#include <libkern/c++/OSObject.h> + +#include <IOKit/IOTypes.h> + +#include <IOKit/usb/USB.h> + + +/* + class IOUSBControllerListElement + Used by the IOUSBController to manage the USB controller lists that are common between EHCI and UHCI. +*/ +class IOUSBControllerListElement : public OSObject +{ + OSDeclareDefaultStructors(IOUSBControllerListElement) + +private: + +public: + + virtual void SetPhysicalLink(IOPhysicalAddress next) = 0; + virtual IOPhysicalAddress GetPhysicalLink(void) = 0; + virtual IOPhysicalAddress GetPhysicalAddrWithType(void) = 0; + virtual void print(int level); + + IOPhysicalAddress _sharedPhysical; // phys address of the memory shared with the controller + void * _sharedLogical; // logical address of the above + IOUSBControllerListElement *_logicalNext; // the next element in the list + +}; + + +class IOUSBControllerV2; // needed for a parameter +class IOUSBControllerIsochEndpoint; + +class IOUSBControllerIsochListElement : public IOUSBControllerListElement +{ + OSDeclareDefaultStructors(IOUSBControllerIsochListElement) + +private: + +public: + + virtual void SetPhysicalLink(IOPhysicalAddress next) APPLE_KEXT_OVERRIDE = 0; + virtual IOPhysicalAddress GetPhysicalLink(void) APPLE_KEXT_OVERRIDE = 0; + virtual IOPhysicalAddress GetPhysicalAddrWithType(void) APPLE_KEXT_OVERRIDE = 0; + virtual void print(int level) APPLE_KEXT_OVERRIDE; + + IOUSBControllerIsochEndpoint *_pEndpoint; + IOUSBIsocFrame *_pFrames; + IOUSBIsocCompletion _completion; + Boolean _lowLatency; + bool _requestFromRosettaClient; // True if the request originated from a Rosetta client in user space + UInt8 _framesInTD; // used for HS Isoch only + UInt64 _frameNumber; // frame number for scheduling purposes + UInt32 _frameIndex; // index into the myFrames array + IOUSBControllerIsochListElement *_doneQueueLink; // linkage used by done queue processing + + // pure virtual methods which must be implemented by descendants + virtual IOReturn UpdateFrameList(AbsoluteTime timeStamp) = 0; + virtual IOReturn Deallocate(IOUSBControllerV2 *uim) = 0; +}; + +class IOUSBControllerIsochEndpoint : public OSObject +{ + OSDeclareDefaultStructors(IOUSBControllerIsochEndpoint) + +public: + + virtual bool init() APPLE_KEXT_OVERRIDE; + + IOUSBControllerIsochEndpoint *nextEP; + IOUSBControllerIsochListElement *toDoList; // ITD or SITD + IOUSBControllerIsochListElement *toDoEnd; // ITD or SITD + IOUSBControllerIsochListElement *doneQueue; // ITD or SITD + IOUSBControllerIsochListElement *doneEnd; // ITD or SITD + IOUSBControllerIsochListElement *deferredQueue; // ITD or SITD + IOUSBControllerIsochListElement *deferredEnd; // ITD or SITD + UInt64 firstAvailableFrame; // next frame available for a transfer on this EP + UInt32 maxPacketSize; + UInt32 activeTDs; // + when added to todo list, - when taken from done queue + UInt32 onToDoList; // + when added to todo list, - when taken from done queue + UInt32 onDoneQueue; // + when added to todo list, - when taken from done queue + volatile SInt32 scheduledTDs; // + when linked onto periodic list, - when unlinked + UInt32 deferredTDs; + UInt32 onProducerQ; + UInt32 onReversedList; + UInt16 inSlot; // where Isoc TDs are being put in the periodic list + short functionAddress; + short endpointNumber; + IOReturn accumulatedStatus; + UInt32 interval; // this is the decoded interval value for HS endpoints and is 1 for FS endpoints + UInt8 direction; + bool aborting; +}; + + +#endif + diff --git a/QualcommWireless/include/IOKit/usb/IOUSBControllerV2.h b/QualcommWireless/include/IOKit/usb/IOUSBControllerV2.h new file mode 100644 index 0000000..fb89bbe --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBControllerV2.h @@ -0,0 +1,453 @@ +/* + * Copyright � 1998-2013 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBCONTROLLERV2_H +#define _IOKIT_IOUSBCONTROLLERV2_H + +#include <IOKit/IODMACommand.h> + +#include <IOKit/usb/IOUSBControllerListElement.h> +#include <IOKit/usb/IOUSBController.h> + +// These are the values returned in GetLowLatencyOptionsAndPhysicalMask + +#define kLowLatencyUSBDefaultOptionBits 0 // by default we don't need contiguous memory +#define kLowLatencyUSB32bitPhysicalMask 0x00000000FFFFF000ULL // 32 bit memory aligned on a 4K boundary (default) +#define kLowLatencyUSB64bitPhysicalMask 0xFFFFFFFFFFFFF000ULL // 64 bit memory aligned on a 4K boundary + + +/*! + @class IOUSBControllerV2 + @abstract subclass of the IOUSBController to provide support for high speed + devices and split transactions. + @discussion The IOUSBController class provide sufficient functionality to + work with full (12Mb/s) and low (1.5Mb/s) devices. IOUSBControllerV2 + introduces the support for high (480Mb/s) speed devices from the + USB 2.0 spec. In particular IOUSBControllerV2 indicates the high + speed hub a full or low speed device is attached to so that split + transactions can be directed to the hub at high speed to be forwarded + to the full or low speed device by the hub. + It also gives support for bulk endoints of greater than 256 bytes. +*/ + +class IOUSBControllerV2 : public IOUSBController +{ + OSDeclareAbstractStructors(IOUSBControllerV2) + +protected: + + // These for keeping track of high speed ancestor to allow controller to do splits. + // + UInt8 _highSpeedHub[128]; + UInt8 _highSpeedPort[128]; + + struct V2ExpansionData { + UInt8 _multiTT[128]; + IOUSBCommand *ClearTTCommand; + IOUSBControllerIsochEndpoint *_isochEPList; // linked list of active Isoch "endpoints" + IOUSBControllerIsochEndpoint *_freeIsochEPList; // linked list of freed Isoch EP data structures + thread_call_t _returnIsochDoneQueueThread; + }; + V2ExpansionData *_v2ExpansionData; + + // Super's expansion data + #define _freeUSBCommandPool _expansionData->freeUSBCommandPool + #define _freeUSBIsocCommandPool _expansionData->freeUSBIsocCommandPool + #define _watchdogUSBTimer _expansionData->watchdogUSBTimer + #define _controllerTerminating _expansionData->_terminating + #define _watchdogTimerActive _expansionData->_watchdogTimerActive + #define _busNumber _expansionData->_busNumber + #define _currentSizeOfCommandPool _expansionData->_currentSizeOfCommandPool + #define _currentSizeOfIsocCommandPool _expansionData->_currentSizeOfIsocCommandPool + #define _controllerSpeed _expansionData->_controllerSpeed + #define _activeIsochTransfers _expansionData->_activeIsochTransfers + #define _activeInterruptTransfers _expansionData->_activeInterruptTransfers + #define _rootHubDeviceSS _expansionData->_rootHubDeviceSS + + // this class's expansion data + #define _isochEPList _v2ExpansionData->_isochEPList + #define _freeIsochEPList _v2ExpansionData->_freeIsochEPList + #define _returnIsochDoneQueueThread _v2ExpansionData->_returnIsochDoneQueueThread + + virtual bool init( OSDictionary * propTable ) APPLE_KEXT_OVERRIDE; + virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + static IOReturn DoCreateEP(OSObject *owner, + void *arg0, void *arg1, + void *arg2, void *arg3); + + static void clearTTHandler( + OSObject * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + + void UpdateTopology(USBDeviceAddress deviceAddress, + UInt8 speed, + USBDeviceAddress hubAddress, + int port); + +public: + + /*! + @function openPipe + Open a pipe to the specified device endpoint + @param address Address of the device on the USB bus + @param speed of the device: kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh or kUSBDeviceSpeedSuper + @param endpoint description of endpoint to connect to + */ + virtual IOReturn OpenPipe( USBDeviceAddress address, + UInt8 speed, + Endpoint * endpoint ) APPLE_KEXT_OVERRIDE; + + /*! + @function CreateDevice + @abstract Create a new device as IOUSBController, making a note of the + high speed hub device ID and port number the full/low speed + device is attached to. + @param newDevice new device object to work with + @param deviceAddress USB device ID + @param maxPacketSize max packet size of endpoint zero + @param speed speed of the device kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh, kUSBDeviceSpeedSuper + @param powerAvailable power available to the device + @param hub USB ID of hub the device is immediatly attached to. (Not necessarily high speed) + @param port port number of port the device is attached to. + */ + virtual IOReturn CreateDevice( IOUSBDevice *newDevice, + USBDeviceAddress deviceAddress, + UInt8 maxPacketSize, + UInt8 speed, + UInt32 powerAvailable, + USBDeviceAddress hub, + int port); + + /*! + @function ConfigureDeviceZero + @abstract configure pipe zero of device zero, as IOUSBController, but also keeping + note of high speed hub device is attached to. + @param maxPacketSize max packet size for the pipe + @param speed speed of the device kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh, kUSBDeviceSpeedSuper + @param hub USB ID of hub the device is immediatly attached to. (Not necessarily high speed) + @param port port number of port the device is attached to. + */ + virtual IOReturn ConfigureDeviceZero(UInt8 maxPacketSize, UInt8 speed, USBDeviceAddress hub, int port); + +/*! + @function UIMCreateControlEndpoint + @abstract Create an endpoint in the controller to do control transactions. + @param functionNumber USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param maxPacketSize maximum packet size of this endpoint + @param speed speed of the device kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param highSpeedHub If speed is not kUSBDeviceSpeedHigh, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If speed is not kUSBDeviceSpeedHigh, the hub port to address split transactions to +*/ + virtual IOReturn UIMCreateControlEndpoint( + UInt8 functionNumber, + UInt8 endpointNumber, + UInt16 maxPacketSize, + UInt8 speed, + USBDeviceAddress highSpeedHub, + int highSpeedPort) = 0; + +/*! + @function UIMCreateBulkEndpoint + @abstract Create an endpoint in the controller to do bulk transactions. + @param functionNumber USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param direction Direction of data flow. kUSBIn or kUSBOut + @param maxPacketSize maximum packet size of this endpoint + @param speed speed of the device kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param highSpeedHub If speed is not kUSBDeviceSpeedHigh, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If speed is not kUSBDeviceSpeedHigh, the hub port to address split transactions to +*/ + virtual IOReturn UIMCreateBulkEndpoint( + UInt8 functionNumber, + UInt8 endpointNumber, + UInt8 direction, + UInt8 speed, + UInt16 maxPacketSize, + USBDeviceAddress highSpeedHub, + int highSpeedPort) = 0; + +/*! + @function UIMCreateInterruptEndpoint + @abstract Create an endpoint in the controller to do interrupt transactions. + @param functionAddress USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param direction Direction of data flow. kUSBIn or kUSBOut + @param speed speed of the device kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param maxPacketSize maximum packet size of this endpoint + @param pollingRate The maximum polling interval from the endpoint descriptor. + @param highSpeedHub If speed is not kUSBDeviceSpeedHigh, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If speed is not kUSBDeviceSpeedHigh, the hub port to address split transactions to +*/ + virtual IOReturn UIMCreateInterruptEndpoint( + short functionAddress, + short endpointNumber, + UInt8 direction, + short speed, + UInt16 maxPacketSize, + short pollingRate, + USBDeviceAddress highSpeedHub, + int highSpeedPort) = 0; + +/*! + @function UIMCreateIsochEndpoint + @abstract Create an endpoint in the controller to do Isochronous transactions. + @param functionAddress USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param maxPacketSize maximum packet size of this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. + @param highSpeedHub If non zero, this is a full speed device, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If highSpeedHub is non zero, the hub port to address split transactions to +*/ + virtual IOReturn UIMCreateIsochEndpoint( + short functionAddress, + short endpointNumber, + UInt32 maxPacketSize, + UInt8 direction, + USBDeviceAddress highSpeedHub, + int highSpeedPort) = 0; + + + static void ReturnIsochDoneQueueEntry(OSObject *target, thread_call_param_t endpointPtr); + + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 0); + virtual IOReturn AddHSHub(USBDeviceAddress highSpeedHub, UInt32 flags); + + static IOReturn DOHSHubMaintenance(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 1); + virtual IOReturn UIMHubMaintenance(USBDeviceAddress highSpeedHub, UInt32 highSpeedPort, UInt32 command, UInt32 flags); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 2); + virtual IOReturn RemoveHSHub(USBDeviceAddress highSpeedHub); + + static IOReturn DOSetTestMode(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 3); + virtual IOReturn SetTestMode(UInt32 mode, UInt32 port); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 4); + virtual IOReturn UIMSetTestMode(UInt32 mode, UInt32 port); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 5); + virtual UInt64 GetMicroFrameNumber( void ); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 6); + virtual void ClearTT(USBDeviceAddress addr, UInt8 endpt, Boolean IN); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 7); + /*! + @function Read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + @param noDataTimeout number of milliseconds of no data movement before the request is aborted + @param completionTimeout number of milliseonds after the command is on the bus in which it must complete + @param reqCount number of bytes requested for the transfer (must not be greater than the length of the buffer) + */ + virtual IOReturn ReadV2( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletionWithTimeStamp * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount ); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 8); +/*! + @function UIMCreateIsochEndpoint + @abstract Create an endpoint in the controller to do Isochronous transactions. + @param functionAddress USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param maxPacketSize maximum packet size of this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. + @param highSpeedHub If non zero, this is a full speed device, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If highSpeedHub is non zero, the hub port to address split transactions to + @param interval The encoded interval value from the endpoint descriptor +*/ + virtual IOReturn UIMCreateIsochEndpoint( short functionAddress, + short endpointNumber, + UInt32 maxPacketSize, + UInt8 direction, + USBDeviceAddress highSpeedHub, + int highSpeedPort, + UInt8 interval); + + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 9); + virtual IOUSBControllerIsochEndpoint* AllocateIsochEP(void); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 10); + virtual IOReturn DeallocateIsochEP(IOUSBControllerIsochEndpoint *pEP); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 11); + virtual IOUSBControllerIsochEndpoint* FindIsochronousEndpoint(short functionNumber, short endpointNumber, short direction, IOUSBControllerIsochEndpoint* *pEDBack); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 12); + virtual IOUSBControllerIsochEndpoint* CreateIsochronousEndpoint(short functionNumber, short endpointNumber, short direction); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 13); + virtual void PutTDonToDoList(IOUSBControllerIsochEndpoint* pED, IOUSBControllerIsochListElement *pTD); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 14); + virtual IOUSBControllerIsochListElement *GetTDfromToDoList(IOUSBControllerIsochEndpoint* pED); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 15); + virtual void PutTDonDeferredQueue(IOUSBControllerIsochEndpoint* pED, IOUSBControllerIsochListElement *pTD); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 16); + virtual IOUSBControllerIsochListElement *GetTDfromDeferredQueue(IOUSBControllerIsochEndpoint* pED); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 17); + virtual void PutTDonDoneQueue(IOUSBControllerIsochEndpoint* pED, IOUSBControllerIsochListElement *pTD, bool checkDeferred); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 18); + virtual IOUSBControllerIsochListElement *GetTDfromDoneQueue(IOUSBControllerIsochEndpoint* pED); + + // 7185026 - this is to make this call from behind the gate + static IOReturn GatedGetTDfromDoneQueue(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 19); + virtual void ReturnIsochDoneQueue(IOUSBControllerIsochEndpoint*); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 20); + virtual IODMACommand *GetNewDMACommand(); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 21); + /*! + @function GetLowLatencyOptionsAndPhysicalMask + @abstract Low Latency transfers require that the client have access to the memory after the Isochronous I/O request has already been scheduled. This might be used, for example to fill in outgoing data "just in time." Some controllers, however, may have requirements which need to be followed in order to make sure that the memory buffer isn't moved after the call is made. This call will return an IOOptionBits and mach_vm_address_t which can be used in a call to IOBufferMemoryDescriptor::inTaskWithPhysicalMask which will help meet these requirements. + @param optionBits Pointer to an an IOOptionBits. The only bit which may be returned is kIOMemoryPhysicallyContiguous. Other bits, e.g. direction bits, must be ORd in by the client as needed. This call replaces the old property based method of obtaining this information. + @param physicalMask Pointer to a mach_vm_address_t which should be used in the call to IOBufferMemoryDescriptor::inTaskWithPhysicalMask and will guarantee that when the memory is wired down it will be accessible by both the client and the USB controller at the same time. + @result returns kIOReturnSuccess if the method is implemented by the controller, otherwise kIOReturnUnsupported + */ + virtual IOReturn GetLowLatencyOptionsAndPhysicalMask(IOOptionBits *optionBits, mach_vm_address_t *physicalMask); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 22); + /*! + @function GetFrameNumberWithTime + @abstract Real Time A/V applications send and receive Iscohronous data scheduled on certain USB frame numbers. The clock for these frame numbers is independent of the system clock, and drivers need to synchronize these two clocks. This routine will return a system time which corresponds to the beginning of a USB frame number. It is not necessarily the currrent frame, but it will be a frame in the recent past (within the past minute). The jitter between the start of the USB frame and the system time will be as low as possible, but due to hardware interrupt latencies could be as high as 200 microseconds. + @param frameNumber A pointer to a UInt64 in which to hold the USB frame number corresponding to the given system time. + @param theTime A pointer to an AbsoluteTime corresponding to the system time at the beginning of the given USB frame number. + @result returns kIOReturnSuccess if the method is implemented by the controller, otherwise kIOReturnUnsupported + */ + virtual IOReturn GetFrameNumberWithTime(UInt64* frameNumber, AbsoluteTime *theTime); + + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 23); + /*! + @function Read + Read from a stream on a bulk endpoint + @param streamID stream ID of the stream to read from + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + @param noDataTimeout number of milliseconds of no data movement before the request is aborted + @param completionTimeout number of milliseonds after the command is on the bus in which it must complete + @param reqCount number of bytes requested for the transfer (must not be greater than the length of the buffer) + */ + virtual IOReturn ReadStream(UInt32 streamID, + IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount ); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 24); + /*! + @function Write + Write to a stream on a bulk endpoint + @param streamID stream ID of the stream to write to + @param buffer place to get the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been emptied + @param noDataTimeout number of milliseconds of no data movement before the request is aborted + @param completionTimeout number of milliseonds after the command is on the bus in which it must complete + @param reqCount number of bytes requested for the transfer (must not be greater than the length of the buffer) + */ + virtual IOReturn WriteStream(UInt32 streamID, + IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount ); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 25); + /*! + @function openPipe + Open a pipe to the specified device endpoint + @param address Address of the device on the USB bus + @param speed of the device: kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh or kUSBDeviceSpeedSuper + @param endpoint description of endpoint to connect to + @param maxStreams maximum number of streams pipe supports + @param maxBurstAndMult maximum number of bursts and burst multiplier + */ + virtual IOReturn OpenSSPipe(USBDeviceAddress address, + UInt8 speed, + Endpoint * endpoint, + UInt32 maxStreams, + UInt32 maxBurstAndMult); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 26); + /*! + @function UpdateDeviceAddress + Tell the controller about the new address of a device. Used when a device has been reset + @param deviceAddress Address of the device on the USB bus + @param speed of the device: kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh or kUSBDeviceSpeedSuper + @param highSpeedHub If non zero, this is a full speed device, the address of the high speed hub to address split transactions to. + @param highSpeedPort If highSpeedHub is non zero, the hub port to address split transactions to + */ + virtual IOReturn UpdateDeviceAddress(USBDeviceAddress oldDeviceAddress, + USBDeviceAddress newDeviceAddress, + UInt8 speed, + USBDeviceAddress hubAddress, + int port); + + + + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 27); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 28); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 29); + +}; + + +#endif diff --git a/QualcommWireless/include/IOKit/usb/IOUSBDevice.h b/QualcommWireless/include/IOKit/usb/IOUSBDevice.h new file mode 100644 index 0000000..a9ec216 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBDevice.h @@ -0,0 +1,611 @@ +/* + * Copyright � 1998-2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IOUSBDEVICE_H +#define _IOKIT_IOUSBDEVICE_H + +#include <IOKit/usb/IOUSBNub.h> +#include <IOKit/usb/IOUSBPipe.h> +#include <IOKit/usb/IOUSBPipeV2.h> +#include <IOKit/IOBufferMemoryDescriptor.h> +#include <IOKit/IOWorkLoop.h> +#include <IOKit/IOCommandGate.h> + +#include <kern/thread_call.h> + +// The following are definitions for errata properties needed for different devices. This +// should be but in the dictionary of the IOUSBDevice in question. This can be achieved +// by using the AppleUSBMergeNub class and having an IOProviderMergeProperties dictionary +// with the required properties. + +// This property allows a device to specify a configuration value of 0 in its configuration +// descriptor. This does not follow the spec, but we will allow it in order to get the device +// to work. The property should be a Boolean +// +#define kAllowConfigValueOfZero "kAllowZeroConfigValue" +#define kAllowNumConfigsOfZero "kAllowZeroNumConfigs" + + +class IOUSBController; +class IOUSBControllerV2; +class IOUSBControllerV3; +class IOUSBInterface; +class IOUSBHubPolicyMaker; +/*! + @class IOUSBDevice + @abstract The IOService object representing a device on the USB bus. + @discussion This class provides functionality to configure a device and to create + IOUSBInterface objects to represent the interfaces of the device. +*/ + +class IOUSBDevice : public IOUSBNub +{ + friend class IOUSBController; + friend class IOUSBControllerV2; + friend class IOUSBInterface; + friend class IOUSBPipe; + friend class IOUSBInterfaceUserClientV2; + friend class IOUSBInterfaceUserClientV3; + friend class IOUSBDeviceUserClientV2; + + OSDeclareDefaultStructors(IOUSBDevice) + +protected: + + USBDeviceAddress _address; + IOUSBController * _controller; + IOUSBPipe * _pipeZero; + IOUSBDeviceDescriptor _descriptor; + UInt32 _busPowerAvailable; + UInt8 _speed; + IOUSBEndpointDescriptor _endpointZero; // Fake ep for control pipe + void * _port; // Obsolete, do not use + IOBufferMemoryDescriptor** _configList; + IOUSBInterface** _interfaceList; // Obsolete, do not use + UInt8 _currentConfigValue; + UInt8 _numInterfaces; // Obsolete, do not use + + struct ExpansionData + { + UInt32 _portNumber; + thread_call_t _doPortResetThread; + IOUSBDevice * _usbPlaneParent; + bool _portResetThreadActive; + bool _allowConfigValueOfZero; + thread_call_t _doPortSuspendThread; + bool _portSuspendThreadActive; + thread_call_t _doPortReEnumerateThread; + bool _resetInProgress; + bool _portHasBeenReset; + IORecursiveLock* _XgetConfigLock; // Obsolete + bool _doneWaiting; // Obsolete + bool _notifiedWhileBooting; // Obsolete + IOWorkLoop * _workLoop; + IOTimerEventSource * _notifierHandlerTimer; // Obsolete + UInt32 _notificationType; // Obsolete + bool _suspendInProgress; + bool _portHasBeenSuspendedOrResumed; + bool _addExtraResetTime; + bool _suspendCommand; + IOCommandGate * _commandGate; + OSSet * _openInterfaces; + bool _resetCommand; + IOReturn _resetError; + IOReturn _suspendError; + thread_call_t _doMessageClientsThread; + IOUSBHubPolicyMaker * _hubPolicyMaker; + UInt32 _sleepPowerAllocated; // how much sleep power we already gave to our client + UInt32 _wakePowerAllocated; // how much extra power during wake did we already give our client + UInt32 _devicePortInfo; + bool _deviceIsInternal; // Will be set if all our upstream hubs are captive (internal to the computer) + bool _deviceIsInternalIsValid; // true if we have already determined whether the device is internal + bool _newGetConfigLock; // new lock, taken within the WL gate, when doing a GetConfig + UInt32 _resetAndReEnumerateLock; // "Lock" to prevent us from doing a reset or a re-enumerate while the other one is in progress + UInt32 _locationID; + IOLock* _interfaceArrayLock; + OSArray* _interfaceArray; + UInt32 _standardUSBPortPower; // Largest amount of current that this port can provide (e.g. 500mA for USB2.0, 900mA for USB3.0) + bool _usingExtra400mAforUSB3; + UInt32 _wakeRevocablePowerAllocated; // how much extra "revocable" power during wake did we already give our client + UInt32 _wakeUSB3PowerAllocated; // how much extra "USB3" power during wake did we already give our client + bool _attachedToEnclosureAndUsingExtraWakePower; + bool _deviceIsOnThunderbolt; // Will be set if all our upstream hubs are on Thunderbolt + UInt16 _isochDelay; + IOUSBControllerV3 * _controllerV3; + IOService * _interfacePowerParent; // default parent for joinPMTree for interface drivers + bool _loadingDriverAfterReEnumerate; + bool _hasMSCInterface; // True if any of the IOUSBInterfaces are mass storage class + }; + ExpansionData * _expansionData; + + const IOUSBConfigurationDescriptor *FindConfig(UInt8 configValue, UInt8 *configIndex=0); + + virtual IOUSBInterface * GetInterface(const IOUSBInterfaceDescriptor *interface); + +public: + virtual IOReturn SetFeature(UInt8 feature); + +protected: + virtual IOReturn GetConfigDescriptor(UInt8 configIndex, void *data, UInt32 len); + + virtual IOReturn GetDeviceDescriptor(IOUSBDeviceDescriptor *desc, UInt32 size); + + virtual bool init(USBDeviceAddress deviceAddress, UInt32 powerAvaiable, UInt8 speed, UInt8 maxPacketSize ); + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 *score) APPLE_KEXT_OVERRIDE; + +public: + // IOService methods + virtual bool init( void ) APPLE_KEXT_OVERRIDE; + virtual bool start( IOService *provider ) APPLE_KEXT_OVERRIDE; + virtual bool handleIsOpen(const IOService *forClient) const APPLE_KEXT_OVERRIDE; + virtual bool handleOpen(IOService *forClient, IOOptionBits options, void *arg) APPLE_KEXT_OVERRIDE; + virtual void handleClose(IOService *forClient, IOOptionBits options) APPLE_KEXT_OVERRIDE; + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ) APPLE_KEXT_OVERRIDE; + virtual bool terminate( IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; + virtual bool requestTerminate( IOService * provider, IOOptionBits options ) APPLE_KEXT_OVERRIDE; + virtual void stop( IOService *provider ) APPLE_KEXT_OVERRIDE; + virtual bool finalize(IOOptionBits options) APPLE_KEXT_OVERRIDE; + virtual void free( void ) APPLE_KEXT_OVERRIDE; + virtual void joinPMtree ( IOService * driver ) APPLE_KEXT_OVERRIDE; + + // IOUSBDevice methods + virtual void SetProperties(); + + // simple accessor methods + IOService *GetInterfacePowerParent(void); + + static IOUSBDevice *NewDevice(void); + + virtual void SetPort(void *port); // Obsolete, do NOT use + + /*! + @function FindNextInterfaceDescriptor + return a pointer to the next interface descriptor within the given full configuration descriptor satisfying the requirements specified, or NULL if there aren't any. + @param configDescIn the configuration descriptor within which to search. obtained from GetFullConfigurationDescriptor(configIndex). use NULL to specify the current configuration's descriptor. + @param intfDesc interface descriptor from which to start the search. NULL for the first interface descriptor in the given configuration descriptor + @param request IOUSBFindInterfaceRequest specifying the desired interface. Not changed. + @param descOut pointer to placeholder for the returned descriptor ptr + @result returns kIOReturnBadArgument if configDesc is not correct, or if configDesc is NULL and the device is not configured, or if intfDesc is not in configDesc. Otherwise returns kIOReturnSuccess or kIOUSBInterfaceNotFound. + */ + virtual IOReturn FindNextInterfaceDescriptor(const IOUSBConfigurationDescriptor *configDescIn, + const IOUSBInterfaceDescriptor *intfDesc, + const IOUSBFindInterfaceRequest *request, + IOUSBInterfaceDescriptor **descOut); + /*! + @function FindNextInterface + return an pointer to an IOUSBInterface object satisfying the requirements specified in request, or NULL if there aren't any. the device + must be configured for there to be any interfaces. + @param current interface to start searching from, NULL to start at the beginning of the device's interface list for the current configuration. + @param request specifies what properties an interface must have to match. + @result Pointer to a matching IOUSBInterface, or NULL if none match. Note: The IOUSBInterface is NOT retained for the caller. If the caller wishes to continue to use the returned object, it should call retain() on that object. + */ + LIBKERN_RETURNS_NOT_RETAINED virtual IOUSBInterface *FindNextInterface(IOUSBInterface *current, + IOUSBFindInterfaceRequest *request); + + /*! + @function CreateInterfaceIterator + return an OSIterator to iterate through interfaces satisfying the requirements specified in request. + @param request specifies what properties an interface must have to match. + @result Pointer to an OSIterator. + */ + virtual OSIterator *CreateInterfaceIterator(IOUSBFindInterfaceRequest *request); + + // Get pointer to full config info (cached in device, don't free returned pointer) + /*! + @function GetFullConfigurationDescriptor + return a pointer to all the descriptors for the requested configuration. + @param configIndex The configuration index (not the configuration value) + @result Pointer to the descriptors, which are cached in the IOUSBDevice object. + */ + virtual const IOUSBConfigurationDescriptor *GetFullConfigurationDescriptor(UInt8 configIndex); + + /*! + @function GetConfigurationDescriptor + Copy the specified amount of data for a configuration into the suppled buffer. + @param configValue The configuration value + @param data Buffer to copy data into + @param len number of bytes to copy + */ + virtual IOReturn GetConfigurationDescriptor(UInt8 configValue, void *data, UInt32 len); + + /*! + @function ResetDevice + Reset the device, returning it to the addressed, unconfigured state. + This is useful if a device has got badly confused. Note that the AppleUSBComposite driver will automatically + reconfigure the device if it is a composite device. + */ + virtual IOReturn ResetDevice(); + + /*! + @function SetConfiguration + Do a USB SetConfiguration call to the device. The caller must have the device open() in order to + actually cause a configuration change. If the device is currently configured, all IOUSBInterface objects + associated with the device are freed. After the new configuration has been set, all of its IOUSBInterface objects are + instantiated automatically. + @param forClient The client requesting the configuration change + @param configValue The desired configuration value. + @param startInterfaceMatching A boolean specifying whether IOKit should begin the process of finding + matching drivers for the new IOUSBInterface objects. + */ + virtual IOReturn SetConfiguration(IOService *forClient, UInt8 configValue, bool startInterfaceMatching=true); + + // Access to addressing and cached info + /*! + @function GetAddress + returns the bus address of the device + */ + virtual USBDeviceAddress GetAddress(void); + + /*! + @function GetSpeed + returns the speed of the device + */ + virtual UInt8 GetSpeed(void); + /*! + @function GetBus + returns a pointer to the IOUSBController object for the device + */ + virtual IOUSBController *GetBus(void); + /*! + @function GetBusPowerAvailable + returns the power available to the device, in units of 2mA + */ + virtual UInt32 GetBusPowerAvailable( void ); + /*! + @function GetMaxPacketSize + returns the maximum packet size for endpoint zero (only 8, 16, 32, 64 are valid) + */ + virtual UInt8 GetMaxPacketSize(void); + /*! + @function GetVendorID + returns the Vendor ID of the device + */ + virtual UInt16 GetVendorID(void); + /*! + @function GetProductID + returns the Product ID of the device + */ + virtual UInt16 GetProductID(void); + /*! + @function GetDeviceRelease + returns the DeviceRelease information + */ + virtual UInt16 GetDeviceRelease(void); + /*! + @function GetNumConfigurations + returns the number of configs in the device config descriptor + */ + virtual UInt8 GetNumConfigurations(void); + /*! + @function GetManufacturerStringIndex + returns the index of string descriptor describing manufacturer + */ + virtual UInt8 GetManufacturerStringIndex(void ); + /*! + @function GetProductStringIndex + returns the index of string descriptor describing product + */ + virtual UInt8 GetProductStringIndex(void ); + /*! + @function GetSerialNumberStringIndex + returns the index of string descriptor describing the device's serial number + */ + virtual UInt8 GetSerialNumberStringIndex(void ); + /*! + @function GetPipeZero + returns a pointer to the device's default control pipe + */ + virtual IOUSBPipe * GetPipeZero(void); + + // Deprecated but needed for binary compatibility + virtual IOUSBPipe* MakePipe(const IOUSBEndpointDescriptor *ep); + + // this method is deprecated. use the other DeviceRequest methods + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, + IOUSBCompletion *completion = 0); + + // Same but with a memory descriptor + virtual IOReturn DeviceRequest(IOUSBDevRequestDesc *request, + IOUSBCompletion *completion = 0); + + /*! + @function GetConfiguration + Gets the current configuration from the IOUSBDevice object. Note that this call will send a control + request on the bus to get the current configuration from the physical device. + @param configNum Pointer to place to store configuration value. + */ + virtual IOReturn GetConfiguration(UInt8 *configNumber); + + /*! + @function GetDeviceStatus + Gets the device's status. Note that this sends a control request to the physical device. + @param status Pointer to place to store the status. + */ + virtual IOReturn GetDeviceStatus(USBStatus *status); + + /*! + @function GetStringDescriptor + Get a string descriptor as ASCII, in the specified language (default is US English) + @param index Index of the string descriptor to get. + @param buf Pointer to place to store ASCII string + @param maxLen Size of buffer pointed to by buf + @param lang Language to get string in (default is US English) + */ + virtual IOReturn GetStringDescriptor(UInt8 index, char *buf, int maxLen, UInt16 lang=0x409); + + /*! + @function GetChildLocationID + Get the locationID (UInt32) given the port number and the parent's location + @param parentLocationID locationID for the hub to which this device is attached. + @param port Port number of the hub where this device is attached + */ + virtual UInt32 GetChildLocationID(UInt32 parentLocationID, int port); + + virtual const IOUSBDescriptorHeader* FindNextDescriptor(const void *cur, UInt8 descType); + + virtual void DisplayNotEnoughPowerNotice(); + + // These are non-virtual function so that we don't have to take up a binary compatibility slot. + UInt16 GetbcdUSB(void); + UInt8 GetDeviceClass(void); + UInt8 GetDeviceSubClass(void); + UInt8 GetProtocol(void); + UInt32 GetLocationID(void); + UInt16 GetIsochDelay(void); + bool IsDeviceInternal(void); + + void SetBusPowerAvailable(UInt32 newPower); + IOService *GetDevicePowerParent(void); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 0); + /*! + @function DeviceRequest + @abstract execute a control request to the default control pipe (pipe zero) + @param request The parameter block to send to the device + @param noDataTimeout Specifies an amount of time (in ms) after which the command will be aborted + if no data has been transferred on the bus. + @param completionTimeout Specifies an amount of time (in ms) after which the command will be aborted if the entire command has + not been completed. + @param completion Function to call when request completes. If omitted then + DeviceRequest() executes synchronously, blocking until the request is complete. If the request is asynchronous, the client must make sure that + the IOUSBDevRequest is not released until the callback has occurred. + + */ + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion *completion = 0); + + /*! + @function DeviceRequest + @abstract execute a control request to the default control pipe (pipe zero) + @param request The parameter block to send to the device (with the pData as an IOMemoryDesriptor) + @param noDataTimeout Specifies an amount of time (in ms) after which the command will be aborted + if no data has been transferred on the bus. + @param completionTimeout Specifies an amount of time (in ms) after which the command will be aborted if the entire command has + not been completed. + @param completion Function to call when request completes. If omitted then + DeviceRequest() executes synchronously, blocking until the request is complete. If the request is asynchronous, the client must make sure that + the IOUSBDevRequest is not released until the callback has occurred. + + */ + OSMetaClassDeclareReservedUsed(IOUSBDevice, 1); + virtual IOReturn DeviceRequest(IOUSBDevRequestDesc *request, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion *completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 2); + /*! + @function SuspendDevice + @abstract Instruct the hub to which this device is attached to suspend or resume the port to which the device is attached. + Note that if there are any outstanding transactions on any pipes in the device, those transactions will get returned with a + kIOReturnNotResponding error. + @param suspend Boolean value. true = suspend, false = resume. + */ + virtual IOReturn SuspendDevice( bool suspend); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 3); + /*! + @function ReEnumerateDevice + @abstract Instruct the hub to which this device is attached to reset the port to which this device is attached. This causes the + IOUSBDevice object and any child objects (IOUSBInterface objects or driver objects) to be terminated, and the device to be + completely reenumerated, as if it had been detached and reattached. + @param options Reserved for future use. + */ + virtual IOReturn ReEnumerateDevice( UInt32 options ); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 4); + /*! + @function DisplayUserNotification + @abstract Will use the Notification Center to display a notification to the user. Only Low Power and Overcurrent notifications are supported. + @param notificationType Which notification to display. + */ + virtual void DisplayUserNotification(UInt32 notificationType); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 5); + // Deprecated but needed for binary compatibility + virtual IOUSBPipe* MakePipe(const IOUSBEndpointDescriptor *ep, IOUSBInterface *interface); + + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 6); + /*! + @function SetHubParent + @abstract Used by the hub driver to give the nub a pointer to its HubPolicyMaker object + @param hubPolicyMaker The object representing the Hub driver + */ + virtual void SetHubParent(IOUSBHubPolicyMaker *hubParent); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 7); + /*! + @function GetHubParent + @abstract Used by the hub driver to give the nub a pointer to its HubPolicyMaker object + @param hubPolicyMaker The object representing the Hub driver + */ + virtual IOUSBHubPolicyMaker* GetHubParent(); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 8); + /*! + @function GetDeviceInformation + @abstract Returns status information about the USB device, such as whether the device is captive or whether it is in the suspended state. + @param requestedPower The desired amount of power that the client wishes to reserve + @result Actual power that was reserved + + */ + virtual IOReturn GetDeviceInformation(UInt32 *info); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 9); + /*! + @function RequestExtraPower + @abstract Clients can use this API to reserve extra power for use by this device while the machine is asleep or while it is awake. Units are milliAmps (mA). + @param type Indicates whether the power is to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake) + @param requestedPower Amount of power desired, in mA + @result Amount of power actually reserved, in mA. It can be less than the requested or zero. + + */ + virtual UInt32 RequestExtraPower(UInt32 type, UInt32 requestedPower); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 10); + /*! + @function ReturnExtraPower + @abstract Clients can use this API to tell the system that they will not use power that was previously reserved by using the RequestExtraPower API. + @param type Indicates whether the power is to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake) + @param returnedPower Amount of power that is no longer needed, in mA + @result If the returnedPower was not previously allocated, an error will be returned. This will include the case for power that was requested for sleep but was returned for wake. + + */ + virtual IOReturn ReturnExtraPower(UInt32 type, UInt32 returnedPower); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 11); + /*! + @function GetExtraPowerAllocated + @abstract Clients can use this API to ask how much extra power has already been reserved by this device. Units are milliAmps (mA). + @param type Indicates whether the allocated power was to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake) + @result Amount of power allocated, in mA. + + */ + virtual UInt32 GetExtraPowerAllocated(UInt32 type); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 12); + /*! + @function DoLocationOverrideAndModelMatch + @abstract Will look for a kOverrideIfAtLocationID array proerty with locationID entries and a "MacModel" property. If any of the locationIDs match to the Mac Model, will return true. + If there is no kOverrideAtLocationID property, it will also return true. + @result True if we have a match, false otherwise + */ + virtual bool DoLocationOverrideAndModelMatch(); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 13); + /*! + @function SetConfiguration + Do a USB SetConfiguration call to the device. The caller must have the device open() in order to + actually cause a configuration change. If the device is currently configured, all IOUSBInterface objects + associated with the device are freed. After the new configuration has been set, all of its IOUSBInterface objects are + instantiated automatically. + @param forClient The client requesting the configuration change + @param configValue The desired configuration value. + @param startInterfaceMatching A boolean specifying whether IOKit should begin the process of finding + @param issueRemoteWakeup A boolean specifying whether we should issue the SetFeature(kUSBFeatureDeviceRemoteWakeup) immediately after setting the configuration, before loading any drivers. + matching drivers for the new IOUSBInterface objects. + */ + virtual IOReturn SetConfiguration(IOService *forClient, UInt8 configValue, bool startInterfaceMatching, bool issueRemoteWakeup); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 14); + /*! + @function OpenOrCloseAllInterfacePipes + @abstract Iterates over all interfaces and either opens all the pipes, or closes them all + @param open, if true pipes are opened, else closed + */ + virtual void OpenOrCloseAllInterfacePipes(bool open); + + + + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 15); + /*! + @function MakePipe + @abstract build a pipe on a given endpoint + @param ep A description of the endpoint + @param sscd The SuperSpeed Companion Descriptor, if any (NULL if none) + @param interface The IOUSBInterface object requesting the pipe + returns the desired IOUSBPipe object + */ + virtual IOUSBPipeV2* MakePipe(const IOUSBEndpointDescriptor *ep, IOUSBSuperSpeedEndpointCompanionDescriptor *sscd, IOUSBInterface *interface); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 16); + /*! + @function SetAddress + @param address Sets the bus address of the device + */ + virtual void SetAddress(USBDeviceAddress address); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 17); + /*! + @function SetIsochDelay + @param delay Sets the delay, in nanoseconds, from the time a host transmits a packet to the time it is received by the device. Sum of all the wHubDelay's for the + upstream hubs. + */ + virtual IOReturn SetIsochDelay(UInt16 delay); + + OSMetaClassDeclareReservedUnused(IOUSBDevice, 18); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 19); + +private: + + static void ProcessPortResetEntry(__unused OSObject *target){}; // obsolete + void ProcessPortReset(void){}; // obsolete + + void TerminateInterfaces(bool terminate); + + static void ProcessPortReEnumerateEntry(OSObject *target, thread_call_param_t options); + void ProcessPortReEnumerate(UInt32 options); + + static void DoMessageClientsEntry(OSObject *target, thread_call_param_t messageStruct); + void DoMessageClients( void * messageStructPtr); + + void DisplayUserNotificationForDevice(UInt32 notificationType, UInt8 port); + + UInt32 SimpleUnicodeToUTF8(UInt16 uChar, UInt8 utf8Bytes[4]); + void SwapUniWords (UInt16 **unicodeString, UInt32 uniSize); + void TrimStringDescriptor(UInt16 **unicodeString, SInt32 *uniSize); + + IOReturn TakeGetConfigLock(void); + IOReturn ReleaseGetConfigLock(void); + static IOReturn ChangeGetConfigLock(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + + void RegisterInterfaces(void); + + static IOReturn _ResetDevice(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn _ReEnumerateDevice(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn _DeviceRequest(OSObject *target, void *arg0, void *arg1, __unused void *arg2, __unused void *arg3); + static IOReturn _DeviceRequestDesc(OSObject *target, void *arg0, void *arg1, __unused void *arg2, __unused void *arg3); + static IOReturn _GetConfiguration(OSObject *target, void *arg0, __unused void *arg1, __unused void *arg2, __unused void *arg3); + static IOReturn _GetDeviceStatus(OSObject *target, void *arg0, __unused void *arg1, __unused void *arg2, __unused void *arg3); + static IOReturn _DeviceRequestWithTimeout(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn _DeviceRequestDescWithTimeout(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + +}; + +#endif diff --git a/QualcommWireless/include/IOKit/usb/IOUSBHostDevice.h b/QualcommWireless/include/IOKit/usb/IOUSBHostDevice.h new file mode 100644 index 0000000..f9cf3b4 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBHostDevice.h @@ -0,0 +1,840 @@ +/* + * Copyright (c) 1998-2016 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/*! + @header IOUSBHostDevice.h + @brief IOUSBHostDevice is an IOService representing a USB device. + @discussion + + <h3>Session Management</h3> + + A driver that has successfully matched on an IOUSBHostDevice is able to take ownership of the device by calling the <code>open</code> method defined by IOService on the IOUSBHostDevice. Once <code>open</code> has completed successfully, the driver has an open session, and may use the deviceRequest interface to send control requests, and the setConfiguration interface to create or destroy child IOUSBHostInterface services. + + When the driver is finished with control of the IOUSBHostDevice, it must call <code>close</code> to end its session. Calling <code>close</code> will synchronously abort that session's outstanding IO on the control endpoint. If the device is terminating for any reason, such as being unplugged, the driver must call <code>close</code> on the IOUSBHostDevice, or termination will be blocked and the port will not register newly attached devices for matching. The willTerminate call into the driver is the recommended location to call <code>close</code>. + + Drivers that match on an IOUSBHostInterface service do not need to open a session to the IOUSBHostDevice, as the IOUSBHostInterface will open a session to the IOUSBHostDevice on the driver's behalf. + + <h3>deviceRequest Interface</h3> + + The <code>deviceRequest</code> methods are used to send control requests to the device's default endpoint. The <code>deviceRequest</code> methods may not be used for the following standard requests: + <ul> + <li>CLEAR_FEATURE ENDPOINT_HALT (USB 2.0 9.4.1) - Use <code>IOUSBHostPipe::clearStall</code> to send this request</li> + <li>SET_ADDRESS (USB 2.0 9.4.6)</li> + <li>SET_CONFIGURATION (USB 2.0 9.4.7) - Use <code>setConfiguration</code> to send this request</li> + <li>SET_INTERFACE (USB 2.0 9.4.10) - Use <code>IOUSBHostInterface::selectAlternateSetting</code> to send this request</li> + </ul> + + <h3>IOUSBDevice Migration</h3> + + IOUSBHostDevice serves as a replacement for IOUSBDevice. Clients that previously matched on IOUSBDevice can use the following guide to convert to IOUSBHostDevice. + + <code>virtual UInt16 IOUSBDevice::GetbcdUSB();</code><br> + Replacement: <code>USBToHost16(getDeviceDescriptor()->bcdUSB);</code> + + <code>virtual UInt8 IOUSBDevice::GetDeviceClass();</code><br> + Replacement: <code>getDeviceDescriptor()->bDeviceClass;</code> + + <code>virtual UInt8 IOUSBDevice::GetDeviceSubClass();</code><br> + Replacement: <code>getDeviceDescriptor()->bDeviceSubClass</code> + + <code>virtual UInt8 IOUSBDevice::GetProtocol();</code><br> + Replacement: <code>getDeviceDescriptor()->bDeviceProtocol</code> + + <code>virtual UInt8 IOUSBDevice::GetMaxPacketSize();</code><br> + Replacement: <code>getDeviceDescriptor->bMaxPacketSize0</code> + + <code>virtual UInt16 IOUSBDevice::GetVendorID();</code><br> + Replacement: <code>USBToHost16(getDeviceDescriptor()->idVendor)</code> + + <code>virtual UInt16 IOUSBDevice::GetProductID();</code><br> + Replacement: <code>USBToHost16(getDeviceDescriptor()->idProduct)</code> + + <code>virtual UInt16 IOUSBDevice::GetDeviceRelease();</code><br> + Replacement: <code>USBToHost16(getDeviceDescriptor()->bcdDevice)</code> + + <code>virtual UInt8 IOUSBDevice::GetNumConfigurations();</code><br> + Replacement: <code>getDeviceDescriptor()->bNumConfigurations</code> + + <code>virtual UInt8 IOUSBDevice::GetManufacturerStringIndex();</code><br> + Replacement: <code>getDeviceDescriptor()->iManufacturer</code> + + <code>virtual UInt8 IOUSBDevice::GetProductStringIndex();</code><br> + Replacement: <code>getDeviceDescriptor()->iProduct</code> + + <code>virtual UInt8 IOUSBDevice::GetSerialNumberStringIndex();</code><br> + Replacement: <code>getDeviceDescriptor()->iSerialNumber</code> + + <code>virtual IOReturn IOUSBDevice::FindNextInterfaceDescriptor(const IOUSBConfigurationDescriptor*, const IOUSBInterfaceDescriptor*, const IOUSBFindInterfaceRequest*, IOUSBInterfaceDescriptor**);</code><br> + Replacement:<br> + <pre>ConfigurationDescriptor* confDesc = getConfigurationDescriptor(); +InterfaceDescriptor* intDesc = NULL; +while((intDesc = StandardUSB::getNextInterfaceDescriptor(confDesc, intDesc)) != NULL) +{ + if(intDesc->bInterfaceClass == kMyClass) + { + break; + } +}</pre> + + <code>virtual const IOUSBConfigurationDescriptor* IOUSBDevice::GetCachedConfigurationDescriptor(UInt8 configIndex);</code><br> + <code>virtual const IOUSBConfigurationDescriptor* IOUSBDevice::GetFullConfigurationDescriptor(UInt8 configIndex);</code><br> + Replacement: <code>getConfigurationDescriptor(configIndex)</code> + + <code>virtual IOReturn IOUSBDevice::GetConfigurationDescriptor(UInt8 configValue, void* data, UInt32 len);</code><br> + Replacement: <code>getConfigurationDescriptorWithValue(configValue);</code> + + <code>virtual IOUSBHostInterface* IOUSBDevice::FindNextInterface(IOUSBHostInterface*, IOUSBFindInterfaceRequest* request);</code><br> + <code>virtual OSIterator* IOUSBDevice::CreateInterfaceIterator(IOUSBFindInterfaceRequest* request);</code><br> + Replacement:<br> + <pre>OSIterator* iterator = _device->getChildIterator(gIOServicePlane); +OSObject* candidate = NULL; +while(iterator != NULL && (candidate = iterator->getNextObject()) != NULL) +{ + IOUSBHostInterface* interfaceCandidate = OSDynamicCast(IOUSBHostInterface, candidate); + if( interfaceCandidate != NULL + && interfaceCandidate->getInterfaceDescriptor()->bInterfaceClass == kMyClass) + { + _interface = interfaceCandidate; + break; + } +} +OSSafeReleaseNULL(iterator);</pre> + + <code>virtual IOReturn IOUSBDevice::SetConfiguration(IOService*, UInt8, bool);</code><br> + Replacement: <code>setConfiguration(configNumber, startMatchingInterfaces);</code> + + <code>virtual UInt8 IOUSBDevice::GetSpeed();</code><br> + Replacement: <code>getSpeed();</code> + + <code>virtual IOUSBController* IOUSBDevice::GetBus();</code><br> + Replacement: The controller cannot be directly accessed. Use <code>getFrameNumber(...)</code> and <code>createIOBuffer(...)</code> instead. + + <code>virtual UInt32 IOUSBDevice::GetBusPowerAvailable();</code><br> + Replacement: <code>allocateDownstreamBusCurrent(...);</code> + + <code>virtual IOReturn IOUSBDevice::DeviceRequest(IOUSBDevRequest*, IOUSBCompletion*);<br> + virtual IOReturn IOUSBDevice::DeviceRequest(IOUSBDevRequestDesc*, IOUSBCompletion*);<br> + virtual IOReturn IOUSBDevice::DeviceRequest(IOUSBDevRequest*, UInt32, UInt32, IOUSBCompletion*);<br> + virtual IOReturn IOUSBDevice::DeviceRequest(IOUSBDevRequestDesc*, UInt32, UInt32, IOUSBCompletion*);<br></code> + Replacment: <code>deviceRequest(...);</code> + + <code>virtual IOReturn IOUSBDevice::GetConfiguration(UInt8*);</code><br> + Replacment: + <pre>uint8_t configNumber = 0; +StandardUSB::DeviceRequest request; +request.bmRequestType = makeDeviceRequestbmRequestType(kRequestDirectionIn, kRequestTypeStandard, kRequestRecipientDevice); +request.bRequest = kDeviceRequestGetConfiguration; +request.wValue = 0; +request.wIndex = 0; +request.wLength = sizeof(configNumber); + +uint32_t bytesTransferred = 0; + +deviceRequest(this, request, &configNumber, bytesTransferred, kUSBHostStandardRequestCompletionTimeout);</pre> + + <code>virtual IOReturn IOUSBDevice::GetDeviceStatus(USBStatus*);</code><br> + Replacement: + <pre>uint16_t status = 0; +StandardUSB::DeviceRequest request; +request.bmRequestType = makeDeviceRequestbmRequestType(kRequestDirectionIn, kRequestTypeStandard, kRequestRecipientDevice); +request.bRequest = kDeviceRequestGetStatus; +request.wValue = 0; +request.wIndex = 0; +request.wLength = sizeof(status); + +uint32_t bytesTransferred = 0; + +deviceRequest(this, request, &status, bytesTransferred, kUSBHostStandardRequestCompletionTimeout);</pre> + + <code>virtual IOUSBPipe* IOUSBDevice::GetPipeZero();</code><br> + Replacement: The IOUSBHostPipe representing the default control endpoint is not accessible. Use <code>deviceRequest(...)</code> and <code>abortDeviceRequests(...)</code> interfaces to interact with the default control endpoint. + + <code>virtual IOReturn IOUSBDevice::GetStringDescriptor(UInt8, char*, int, UInt16);</code><br> + Replacement: + <pre>char stringBuffer[256] = { 0 }; +size_t stringLength = sizeof(stringBuffer); +const StringDescriptor* stringDescriptor = getStringDescriptor(index); +if( stringDescriptor != NULL + && stringDescriptor->bLength > StandardUSB::kDescriptorSize) +{ + StandardUB::stringDescriptorToUTF8(stringDescriptor, stringBuffer, stringLength); +}</pre> + + <code>virtual const IOUSBDescriptorHeader* IOUSBDevice::FindNextDescriptor(const void*, UInt8);</code><br> + Replacement: <code>StandardUSB::getNextDescriptorWithType(getConfigurationDescriptor(), currentDescriptor, descriptorType);</code> + + <code>virtual IOReturn IOUSBDevice::SuspendDevice(bool);</code><br> + Replacement: Power management should be done using the idling system described in IOUSBHostFamily.h. + + <code>virtual IOReturn IOUSBDevice::ReEnumerateDevice(UInt32);</code><br> + Replacement: <code>reset();</code> + + <code>virtual IOReturn IOUSBDevice::GetDeviceInformation(UInt32*);</code><br> + Replacement: <code>getPortStatus();</code> + + <code>virtual UInt32 IOUSBDevice::RequestExtraPower(UInt32, UInt32);<br> + virtual IOReturn IOUSBDevice::ReturnExtraPower(UInt32, UInt32);</code><br> + Replacement: <code>allocateDownstreamBusCurrent(...);</code> + + <code>virtual tUSBHostDeviceAddress IOUSBDevice::GetAddress(void);</code><br> + Replacement: <code>getAddress();</code> + + <code>virtual IOReturn IOUSBDevice::ResetDevice();<br> + virtual UInt32 IOUSBDevice::GetExtraPowerAllocated(UInt32);<br> + void IOUSBDevice::SetBusPowerAvailable(UInt32);</code><br> + Replacement: none + */ + +#ifndef IOUSBHostFamily_IOUSBHostDevice_h +#define IOUSBHostFamily_IOUSBHostDevice_h + +#include <IOKit/usb/StandardUSB.h> +#include <IOKit/usb/IOUSBHostFamily.h> +#include <IOKit/usb/IOUSBHostPipe.h> +#include <IOKit/IOBufferMemoryDescriptor.h> + +#if TARGET_OS_OSX +#include <USBDriverKit/IOUSBHostDevice.h> +#endif + +#include <IOKit/IOWorkLoop.h> +#include <IOKit/IOCommandGate.h> +#include <IOKit/pwr_mgt/RootDomain.h> +#include <kern/thread_call.h> + +#define kUSBHostDeviceForceSuspend "kUSBHostDeviceForceSuspend" + +class AppleUSBHostController; +class IOUSBHostInterface; +class AppleUSBHostDeviceIdler; +class AppleUSBHostRequestCompleter; +class AppleUSBHostPort; +class AppleUSBDescriptorCache; +class AppleUSBHostResources; + +/*! + * @class IOUSBHostDevice + * @brief The IOService object representing a USB device + * @discussion This class provides functionality to send control requests to the default control endpoint, as well as create IOUSBHostInterface objects to represent the interfaces contained in the selected configuration. Function drivers should not subclass IOUSBHostDevice. + */ +class __IOUSBHOSTFAMILY_DEPRECATED IOUSBHostDevice : public IOService +{ + friend class AppleUSBHostController; + friend class IOUSBHostInterface; + friend class IOUSBHostIOSource; + friend class IOUSBHostPipe; + friend class IOUSBHostStream; + friend class AppleUSBIORequest; + friend class AppleUSBHostDeviceIdler; + +#if TARGET_OS_OSX + OSDeclareDefaultStructorsWithDispatch(IOUSBHostDevice) +#else + OSDeclareDefaultStructors(IOUSBHostDevice) +#endif + +public: + /*! + * @namespace IOUSBHostDevice + * @brief Powerstates supported by an IOUSBHostDevice + * @constant kPowerStateOff The device has been powered off and will be terminated. + * @constant kPowerStateSuspended The device is suspended. All I/O has been paused and the bus will be suspended once its AppleUSBHostPort power parent enters the suspend state. + * @constant kPowerStateOn The device is powered on and I/O is possible. + * @constant kPowerStateCount Number of possible power states. + */ + enum tPowerState + { + kPowerStateOff = 0, + kPowerStateSuspended, + kPowerStateOn, + kPowerStateCount + }; + + /* + * @brief Factory method for creating an IOUSBHostDevice object + * @discussion This method should not be called by function drivers. IOUSBHostDevice objects are created by AppleUSBHostPort services when a device is connected. + * @param controller Controller to which the USB device is attached + * @param speed Speed at which the device enumerated + * @param address tUSBHostDeviceAddress that has been allocated by the controller + * @return Pointer to an IOUSBHostDevice object if successful, otherwise NULL + */ + static IOUSBHostDevice* withController(AppleUSBHostController* controller, UInt8 speed, tUSBHostDeviceAddress address); + +protected: + virtual bool initWithController(AppleUSBHostController* controller, UInt8 speed, tUSBHostDeviceAddress address); + + // Pad slots for future expansion + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 0); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 1); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 2); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 3); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 4); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 5); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 6); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 7); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 8); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 9); + +#pragma mark IOService overrides +public: + /*! + * @functiongroup IOService overrides + * @discussion For a discussion of proper usage for <code>open</code> and <code>close</code>, see the discussion of "Session Management" above. + */ + + virtual bool attach(IOService* provider) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService* provider) APPLE_KEXT_OVERRIDE; + virtual bool terminate(IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + virtual bool willTerminate(IOService* provider, IOOptionBits options) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService* provider) APPLE_KEXT_OVERRIDE; + virtual void free(void) APPLE_KEXT_OVERRIDE; + + virtual bool compareProperty(OSDictionary* matching, const char* key) APPLE_KEXT_OVERRIDE; + virtual bool compareProperty(OSDictionary* matching, const OSString* key) APPLE_KEXT_OVERRIDE; + virtual bool matchPropertyTable(OSDictionary* table, SInt32* score) APPLE_KEXT_OVERRIDE; + virtual bool matchPropertyTable(OSDictionary* table) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setProperties(OSObject* properties) APPLE_KEXT_OVERRIDE; + + /*! + * @brief Open a session to the IOUSBHostDevice + * @discussion This method opens a session to an IOUSBHostDevice. It will acquire the service's workloop lock. Child IOUSBHostInterfaces may open simultaneous sessions, but only one other service may open a session. + * @param forClient The IOService that is opening a session. + * @param options See IOService.h + * @param arg See IOService.h + * @return bool true if the session could be opened, otherwise false. + */ + virtual bool open(IOService* forClient, IOOptionBits options = 0, void* arg = 0) APPLE_KEXT_OVERRIDE; + virtual bool handleOpen(IOService* forClient, IOOptionBits options, void* arg) APPLE_KEXT_OVERRIDE; + virtual bool handleIsOpen(const IOService* forClient) const APPLE_KEXT_OVERRIDE; + + /*! + * @brief Close a session to the IOUSBHostDevice + * @discussion This method closes an open session to an IOUSBHostDevice. It will acquire the service's workloop lock, abort any IO associated with the specified client, and may call commandSleep to allow processing of aborted control requests before returning. + * @param forClient The IOService that is closing its session. Any IO associated with the specified client will be aborted. + * @param options See IOService.h + */ + virtual void close(IOService* forClient, IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + virtual void handleClose(IOService* forClient, IOOptionBits options) APPLE_KEXT_OVERRIDE; + + virtual IOReturn newUserClient(task_t owningTask, void* securityID, UInt32 type, IOUserClient** handler) APPLE_KEXT_OVERRIDE; + + virtual IOReturn message(UInt32 type, IOService* provider, void* argument = 0) APPLE_KEXT_OVERRIDE; + + virtual const char* stringFromReturn(IOReturn code) APPLE_KEXT_OVERRIDE; + + virtual bool setProperty(const OSSymbol* aKey, OSObject* anObject) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const OSString* aKey, OSObject* anObject) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char* aKey, OSObject* anObject) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char* aKey, const char* aString) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char* aKey, bool aBoolean) APPLE_KEXT_OVERRIDE; + + virtual bool setProperty(const char* aKey, unsigned long long aValue, unsigned int aNumberOfBits) APPLE_KEXT_OVERRIDE; + virtual bool setProperty(const char* aKey, void* bytes, unsigned int length) APPLE_KEXT_OVERRIDE; + +protected: + virtual IOReturn terminateGated(IOOptionBits options = 0); + + virtual IOReturn openGated(IOService* forClient, IOOptionBits options, void* arg); + virtual IOReturn closeGated(IOService* forClient, IOOptionBits options); + + // Protected pad slots for IOService overrides + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 10); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 11); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 12); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 13); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 14); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 15); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 16); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 17); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 18); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 19); + +protected: + int32_t _terminationPending; + AppleUSBHostResources* _resources; + AppleUSBHostController* _controller; + AppleUSBHostPort* _port; + OSSet* _clients; + IOWorkLoop* _workLoop; + IOCommandGate* _commandGate; + +#pragma mark Power management +public: + /*! + * @functiongroup Power management + */ + + virtual void registerPowerService(); + virtual IOReturn addPowerChild(IOService* theChild) APPLE_KEXT_OVERRIDE; + virtual IOReturn removePowerChild(IOPowerConnection* theChild) APPLE_KEXT_OVERRIDE; + virtual IOReturn powerStateWillChangeTo(IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice) APPLE_KEXT_OVERRIDE; + virtual IOReturn setPowerState(unsigned long stateNumber, IOService* whatDevice) APPLE_KEXT_OVERRIDE; + virtual IOReturn powerStateDidChangeTo(IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice) APPLE_KEXT_OVERRIDE; + virtual unsigned long initialPowerStateForDomainState(IOPMPowerFlags domainState) APPLE_KEXT_OVERRIDE; + virtual void PMstop(void) APPLE_KEXT_OVERRIDE; + virtual IOReturn forcePower(tPowerState powerState, bool clamp, uint32_t timeoutMs = 0); + + /*! + * @brief Allocate bus current that does not match the bMaxPower value specified by the device's configuration descriptor + * @discussion + * Devices can use this interface to request more or less bus current than what is specified in the selected configuration descriptor's bMaxPower field. The parameters passed in are abolute values of current required for operation in kPowerStateOn and kPowerStateSuspended IOUSBHostDevice power levels, and override the bMaxPower field in the configuration descriptor. For example, if bMaxPower indicates the device requires 500mA to operate, then a request for 1000mA will double the allocated power for the device. + * A setConfiguration call to select a different configuration or unconfigure the device will reset the bus current allocations. + * The parameters are passed by reference, and may be modified before being returned. If more bus current is being requested than is available, the values may be reduced to stay within system limits. + * @param wakeUnits As input, the number of mA requested when the device is in kPowerStateOn. As output, the number of mA allocated to the device in kPowerStateOn. + * @param sleepUnits As input, the number of mA requested when the device is in kPowerStateSuspended. As output, the number of mA allocated to the device in kPowerStateSuspended. + * @return IOReturn kIOReturnSuccess if the device's allocation amounts were updated, otherwise an error code + */ + virtual IOReturn allocateDownstreamBusCurrent(uint32_t& wakeUnits, uint32_t& sleepUnits); + + enum tIdleAssertion + { + kIdleAssertionInhibit = 0, + kIdleAssertionPermit + }; + /*! + * @brief This method should be considered private and should not be called by function drivers. + */ + virtual IOReturn idleAssertion(IOService* forService, tIdleAssertion assertion); + + // Public pad slots for power management + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 20); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 21); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 22); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 23); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 24); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 25); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 26); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 27); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 28); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 29); + +protected: + static IOPMPowerState _sPowerStates[kPowerStateCount]; + static const OSSymbol* _sPowerStateSymbols[kPowerStateCount]; + + virtual void powerChangeDone(unsigned long stateNumber) APPLE_KEXT_OVERRIDE; + virtual IOReturn powerStateWillChangeToGated(IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual IOReturn setPowerStateGated(unsigned long stateNumber, IOService* whatDevice); + virtual IOReturn powerStateDidChangeToGated(IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual IOReturn forcePowerGated(tPowerState powerState, bool clamp, uint32_t timeoutMs); + virtual void addPowerChildThreadCall(thread_call_t threadCall); + virtual IOReturn addPowerChildGated(void); + + virtual void pmStopThreadCall(thread_call_t threadCall); + + virtual IOReturn allocateDownstreamBusCurrentGated(uint32_t& wakeUnits, uint32_t& sleepUnits); + + virtual IOReturn updateIdlePolicy(bool asynchronous = false); + virtual void updateIdlePolicyAsync(thread_call_t threadCall); + virtual IOReturn updateIdlePolicyGated(); + + // Protected pad slots for power management + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 30); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 31); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 32); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 33); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 34); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 35); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 36); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 37); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 38); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 39); + +protected: + bool _allowUpdateIdlePolicy; + bool _forcePowerInProgress; + IOLock* _powerChildrenLock; + OSSet* _powerChildren; + OSSet* _activePowerChildren; + IOPMDriverAssertionID _externalDevicePowerAssertion; + tPowerState _currentPowerState; + bool _powerOffPending; + +#pragma mark Descriptors +public: + /*! @functiongroup Descriptors */ + + /*! + * @brief Store the provided descriptor in the set of cached descriptors. + * @discussion This method will store a descriptor in a set of cached descriptors. If a descriptor with an identical <code>bDescriptorType</code>, <code>index</code>, and <code>languageID</code> already exists in the cache, it will be replaced. The provided descriptor is copied, and may be discarded after being stored in the cache. Future descriptor fetch calls such as getDescriptor will return the cached value. Future GET_DESCRIPTOR control requests (USB 2.0 9.4.3) will also return the cached descriptor. SET_DESCRIPTOR control requests (USB 2.0 9.4.8) will remove the cached descriptor. + * @param descriptor Pointer to the descriptor to cache + * @param length Length of the descriptor, or 0 the descriptor's bLength field should be used. + * @param index Descriptor index value. Low byte of <code>wValue</code> of the SET_DESCRIPTOR control request (USB 2.0 9.4.8). + * @param languageID Descriptor language ID. <code>wIndex</code> of the SET_DESCRIPTOR control request (USB 2.0 9.4.8). + * @return IOReturn result code + */ + virtual IOReturn cacheDescriptor(const StandardUSB::Descriptor* descriptor, uint16_t length = 0, uint8_t index = 0, uint16_t languageID = 0); + + /*! + * @brief Retrieve a descriptor from the cache or the device + * @discussion + * This method will search the descriptor cache for the descriptor that matches the input arguments. If the descriptor is not in the cache, a GET_DESCRIPTOR control request (USB 2.0 9.4.3) will be issued to retrieve the descriptor from the device. If the device request is successful, the retrieved descriptor will be added to the cache. + * This method will acquire the service's workloop lock, and may call commandSleep to perform the GET_DESCRIPTOR control request. + * @param type <code>bDescriptorType</code> of the descriptor to find. + * @param length Reference to a uint16_t which will be updated with the length of the descriptor. As input, used as <code>wLength</code> when fetching variable-length configuration or BOS descriptors, or when fetching nonstandard descriptor types. + * @param index Descriptor index value. Low byte of <code>wValue</code> of the SET_DESCRIPTOR control request (USB 2.0 9.4.8). + * @param languageID Descriptor language ID. <code>wIndex</code> of the SET_DESCRIPTOR control request (USB 2.0 9.4.8). + * @param requestType tDeviceRequestType to be used for a GET_DESCRIPTOR control request. + * @param requestRecipient tDeviceRequestRecipient to be used for a GET_DESCRIPTOR control request. + * @return Pointer to the cached descriptor if found, otherwise NULL. + */ + virtual const StandardUSB::Descriptor* getDescriptor(uint8_t type, + uint16_t& length, + uint8_t index = 0, + uint16_t languageID = 0, + tDeviceRequestType requestType = kRequestTypeStandard, + tDeviceRequestRecipient requestRecipient = kRequestRecipientDevice); + + /*! + * @brief Return the device descriptor + * @discussion This method uses getDescriptor to retrieve the device descriptor. + * @return Pointer to the device descriptor, or NULL if the service is terminating. + */ + virtual const StandardUSB::DeviceDescriptor* getDeviceDescriptor(); + + /*! + * @brief Return the configuration descriptor with the specified index + * @discussion This method uses getDescriptor to retrieve a configuration descriptor. + * @param index Descriptor index value + * @return Pointer to the configuration descriptor if found + */ + virtual const StandardUSB::ConfigurationDescriptor* getConfigurationDescriptor(uint8_t index); + + /*! + * @brief Return the configuration descriptor with the specified <code>bConfigurationValue</code> + * @discussion This method uses getDescriptor to search for a configuration descriptor with a specific <code>bConfigurationValue</code> field. + * @param bConfigurationValue Value to match + * @return Pointer to the configuration descriptor if found + */ + virtual const StandardUSB::ConfigurationDescriptor* getConfigurationDescriptorWithValue(uint8_t bConfigurationValue); + + /*! + * @brief Return the currently selected configuration descriptor + * @discussion This method uses getDescriptor to return the configuration descriptor currently selected after a successful setConfiguration call + * @return Pointer to the configuration descriptor if found, or NULL if the device is not configured + */ + virtual const StandardUSB::ConfigurationDescriptor* getConfigurationDescriptor(); + + /*! + * @brief Return the capability descriptors of the device + * @discussion This method uses getDescriptor to return the device's BOS descriptors + * @return Pointer to the BOS descriptor if found, otherwise NULL + */ + virtual const StandardUSB::BOSDescriptor* getCapabilityDescriptors(); + + /*! + * @brief Return a string descriptor from the device + * @discussion This method uses getDescriptor to return a string descriptor. + * @param index Descriptor index value. Low byte of <code>wValue</code> of the SET_DESCRIPTOR control request (USB 2.0 9.4.8). + * @param languageID Descriptor language ID. <code>wIndex</code> of the SET_DESCRIPTOR control request (USB 2.0 9.4.8). * + * @return Pointer to the descriptor if found + */ + virtual const StandardUSB::StringDescriptor* getStringDescriptor(uint8_t index, uint16_t languageID = StandardUSB::kLanguageIDEnglishUS); + + // Public pad slots for descriptors + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 40); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 41); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 42); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 43); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 44); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 45); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 46); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 47); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 48); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 49); + +protected: + virtual IOReturn cacheDescriptorGated(const StandardUSB::Descriptor* descriptor, uint16_t length, uint8_t index, uint16_t languageID); + + struct tDescriptorSelectors + { + uint8_t index; + uint16_t languageID; + tDeviceRequestType requestType; + tDeviceRequestRecipient requestRecipient; + }; + virtual IOReturn getDescriptorGated(uint8_t type, uint16_t& length, tDescriptorSelectors& selectors, const StandardUSB::Descriptor*& result); + + // Protected pad slots for descriptors + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 50); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 51); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 52); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 53); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 54); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 55); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 56); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 57); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 58); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 59); + +protected: + bool _getDescriptorInProgress; + AppleUSBDescriptorCache* _descriptorCache; + +#pragma mark Configuration, interface, and pipe management +public: + /*! @functiongroup Configuration, interface, and pipe management */ + + /*! + * @brief Select a new configuration for the device + * @discussion + * This method will select a new configuration for a device. If the device was previously configured all child interfaces will be terminated prior to setting the new configuration. This method will send the SET_CONFIGURATION control request (USB 2.0 9.4.7) to the device. + * This method will acquire the service's workloop lock, and may call commandSleep to perform the SET_CONFIGURATION control request. + * @param bConfigurationValue Configuration to select + * @param matchInterfaces If true, any interfaces within the new configuration will be registered for matching. + * @return IOReturn result code + */ + virtual IOReturn setConfiguration(uint8_t bConfigurationValue, bool matchInterfaces = true); + + /*! + * @brief The following method should be considered private and should not be called by function drivers. + * @discussion Drivers should use <code>IOUSBHostInterface::copyPipe</code> to retrieve handles to IOUSBHostPipe objects. + */ + virtual IOUSBHostPipe* createPipe(const StandardUSB::EndpointDescriptor* descriptor, const StandardUSB::SuperSpeedEndpointCompanionDescriptor* companionDescriptor, IOUSBHostInterface* interface); + + /*! + * @brief Enqueue a request on the default control endpoint + * @discussion This method will enqueue an asynchronous request on the default control endpoint. If successful, the provided completion routine will be called to report the status of the completed IO. + * @param forClient The service with an open session issuing the request. + * @param request Reference to a valid StandardUSB::DeviceRequest structure. The structure is copied and can therefore be stack-allocated. + * @param dataBuffer A void* or IOMemoryDescriptor* defining the memory to use for the request's data phase. + * @param completion Pointer to a IOUSBHostCompletion structure. This will be copied and can therefore be stack-allocated. + * @param completionTimeoutMs Timeout of the request in milliseconds. If 0, the request will never timeout. + * @return kIOReuturnSuccess if the completion will be called in the future, otherwise error + */ + virtual IOReturn deviceRequest(IOService* forClient, StandardUSB::DeviceRequest& request, void* dataBuffer, IOUSBHostCompletion* completion, uint32_t completionTimeoutMs = kUSBHostDefaultControlCompletionTimeoutMS); + virtual IOReturn deviceRequest(IOService* forClient, StandardUSB::DeviceRequest& request, IOMemoryDescriptor* dataBuffer, IOUSBHostCompletion* completion, uint32_t completionTimeoutMs = kUSBHostDefaultControlCompletionTimeoutMS); + + /*! + * @brief Send a request on the default control endpoint + * @discussion This method will send a synchronous request on the default control endpoint, and will not return until the request is complete. This method will acquire the service's workloop lock, and will call commandSleep to send the control request. + * @param forClient The service with an open session issuing the request. + * @param request Reference to a valid StandardUSB::DeviceRequest structure. + * @param dataBuffer A void* or IOMemoryDescriptor* defining the memory to use for the request's data phase. + * @param bytesTransferred A uint32_t reference which will be updated with the byte count of the completed data phase. + * @param completionTimeoutMs Timeout of the request in milliseconds. If 0, the request will never timeout. + * @return IOReturn value indicating the result of the IO request + */ + virtual IOReturn deviceRequest(IOService* forClient, StandardUSB::DeviceRequest& request, void* dataBuffer, uint32_t& bytesTransferred, uint32_t completionTimeoutMs = kUSBHostDefaultControlCompletionTimeoutMS); + virtual IOReturn deviceRequest(IOService* forClient, StandardUSB::DeviceRequest& request, IOMemoryDescriptor* dataBuffer, uint32_t& bytesTransferred, uint32_t completionTimeoutMs = kUSBHostDefaultControlCompletionTimeoutMS); + + /*! + * @brief Abort device requests made via the @link deviceRequest @/link methods by <code>forClient</code> + * @discussion This method will abort any requests associated with a specific client made via the @link deviceRequest @/link methods. It will not abort requests made by other clients. + * @param forClient Client which issued the requests + * @param options IOUSBHostIOSource::tAbortOptions + * @param withError IOReturn error value to return with the requests. The default value of kIOReturnAborted should be used. + * @return IOReturn result code + */ + virtual IOReturn abortDeviceRequests(IOService* forClient = NULL, IOOptionBits options = IOUSBHostIOSource::kAbortAsynchronous, IOReturn withError = kIOReturnAborted); + + // Public pad slots for configuration, interface, and pipe management + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 60); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 61); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 62); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 63); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 64); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 65); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 66); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 67); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 68); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 69); + +protected: + virtual IOReturn setConfigurationGated(uint8_t bConfigurationValue, bool matchInterfaces); + + virtual IOReturn createPipeGated(const StandardUSB::EndpointDescriptor* descriptor, const StandardUSB::SuperSpeedEndpointCompanionDescriptor* companionDescriptor, IOUSBHostInterface* interface, IOUSBHostPipe*& result); + + virtual IOReturn deviceRequest(IOService* forClient, StandardUSB::DeviceRequest& request, + void* rawBuffer, IOMemoryDescriptor* descriptorBuffer, + uint32_t& bytesTransferred, IOUSBHostCompletion* completion, + uint32_t completionTimeoutMs); + + virtual IOReturn internalDeviceRequest(IOService* forClient, StandardUSB::DeviceRequest& request, + void* rawBuffer, IOMemoryDescriptor* descriptorBuffer, + uint32_t& bytesTransferred, IOUSBHostCompletion* completion, + uint32_t completionTimeoutMs); + + virtual IOReturn internalDeviceRequestGated(IOUSBHostPipe::tInternalControlRequestParameters& parameters); + + virtual IOReturn abortDeviceRequestsGated(IOService* forClient, IOOptionBits options, IOReturn withError); + + virtual IOReturn getLPMExitLatencyGated(tUSBLinkState linkState, tUSBLPMExitLatency latencyType, uint32_t& latencyNs); + + virtual IOReturn updateLPMPolicyGated(); + + // Protected pad slots for configuration, interface, and pipe management + OSMetaClassDeclareReservedUsed(IOUSBHostDevice, 70); + OSMetaClassDeclareReservedUsed(IOUSBHostDevice, 71); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 72); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 73); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 74); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 75); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 76); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 77); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 78); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 79); + +#pragma mark Miscellaneous +public: + /*! @functiongroup Provider and state accessors */ + + /*! + * @brief Retrieve the device's address + * @return Current address of the device + */ + virtual tUSBHostDeviceAddress getAddress() const; + + /*! + * @brief Retrieve the device's operational speed + * @return tInternalUSBHostConnectionSpeed + */ + virtual uint8_t getSpeed() const; + + /*! + * @brief Return the current frame number of the USB controller + * @description This method will return the current frame number of the USB controller, omitting microframe. This is most useful for scheduling future isochronous requests. + * @param theTime If not NULL, this will be updated with the current system time + * @return The current frame number + */ + virtual uint64_t getFrameNumber(AbsoluteTime* theTime = NULL); + + /*! + * @brief Terminate the device and attempt to reenumerate it + * @discussion This function will reset and attempt to reenumerate the USB device. The current IOUSBHostDevice object and all of its children will be terminated. A new IOUSBHostDevice object will be created and registered if the reset is successful and the previous object has finished terminating. This function may not be called from the port workloop thread. + * @return IOReturn result code + */ + virtual IOReturn reset(); + + /*! + * @brief Return the current port status + * @discussion This method will return the current port status as described by @link tUSBHostPortStatus @/link + * @return port status + */ + virtual uint32_t getPortStatus(); + + /*! + * @brief Allocate a buffer to be used for I/O + * @discussion This method will allocate an IOBufferMemoryDescriptor optimized for use by the underlying controller hardware. A buffer allocated by this method will not be bounced to perform DMA operations. + * @param options kIODirectionOut, kIODirectionIn to set the direction of the I/O transfer. + * @param capacity Size of the buffer to allocate + * @return Pointer to an IOBufferMemoryDescriptor if successful, otherwise NULL + */ + virtual IOBufferMemoryDescriptor* createIOBuffer(IOOptionBits options, mach_vm_size_t capacity); + + /*! + * @brief Calculate desired USB LPM Exit Latency + * @discussion This method can be called to get various USB LPM Exit Latencies + * @param linkState The link state we want to exit from + * @param latencyType Desired type of Exit Latency to be calculated + * @param latencyNs Calculated Exit Latency value in Nanoseconds + * @return IOReturn result code + */ + virtual IOReturn getLPMExitLatency(tUSBLinkState linkState, tUSBLPMExitLatency latencyType, uint32_t& latencyNs); + + // Public pad slots for miscellaneous + OSMetaClassDeclareReservedUsed(IOUSBHostDevice, 80); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 81); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 82); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 83); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 84); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 85); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 86); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 87); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 88); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 89); + +protected: + // Protected pad slots for miscellaneous + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 90); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 91); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 92); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 93); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 94); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 95); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 96); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 97); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 98); + OSMetaClassDeclareReservedUnused(IOUSBHostDevice, 99); + +#if TARGET_OS_OSX + static void asyncDeviceRequestCompletionCallback(void *owner, void *parameter, IOReturn status, uint32_t bytesTransferred); +#endif + +protected: + enum + { + kClientsDefaultCapacity = 16, + kPowerChildrenDefaultCapacity = 16, + kSetConfigurationIORetries = 3, + kSetConfigurationIORetryInterval = 100 + }; + + AppleUSBHostRequestCompleter* _requestCompleter; + AppleUSBHostDeviceIdler* _deviceIdler; + tUSBHostDeviceAddress _address; + IOUSBHostPipe* _pipeZero; + UInt8 _speed; + StandardUSB::EndpointDescriptor _endpointZero; + IOBufferMemoryDescriptor** _configList; + uint32_t _configListCount; + uint8_t _currentConfigValue; + bool _setConfigurationInProgress; + uint32_t _configurationBusCurrent; // mA + uint32_t _allocatedWakeBusCurrent; // mA + uint32_t _allocatedSleepBusCurrent;// mA + uint32_t _pendingCloseCount; + + uint32_t _debugLoggingMask; + uint32_t _locationID; + + struct tExpansionData + { + OSDictionary* _lpmLatencyCache; + tUSBDeviceLPMStatus _lpmU1Status; + tUSBDeviceLPMStatus _lpmU2Status; + tUSBDeviceLPMStatus _lpmL1Status; + OSDictionary* _dkInterfaceIteratorDict; + uintptr_t _dkInterfaceInteratorRefID; + }; + + tExpansionData* _expansionData; + + +private: + enum + { + kForcePowerTimeoutMs = 1000ULL, // Milliseconds + kSuspendDeviceTimeout = 1000ULL, // Milliseconds + kTerminationTimeout = 5000ULL, // Milliseconds + kDeviceAddressInvalid = 0xffff + }; +}; + +#endif // IOUSBHostFamily_IOUSBHostDevice_h diff --git a/QualcommWireless/include/IOKit/usb/IOUSBHostFamily.h b/QualcommWireless/include/IOKit/usb/IOUSBHostFamily.h new file mode 100644 index 0000000..e5094fd --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBHostFamily.h @@ -0,0 +1,502 @@ +/* + * Copyright (c) 1998-2016 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/*! + @header IOUSBHostFamily.h + @brief IOUSBHostFamily provides support for discovering, enumerating, and communicating with USB devices. + @discussion Starting with Mac OS X El Capitan, IOUSBHostFamily serves as a replacement for IOUSBFamily. + + <h3>Architecture</h3> + + USB host controller hardware is managed by AppleUSBHostController subclasses such as AppleUSBXHCI and AppleUSBEHCI. Each AppleUSBHostController is the parent to one or more AppleUSBHostPort services, and each AppleUSBHostPort is able to enumerate a single IOUSBHostDevice service. IOUSBHostDevice is the parent to zero or more IOUSBHostInterface services, and IOUSBHostInterface provides access to zero or more IOUSBHostPipe objects. USB 3.0 and newer streaming-capable IOUSBHostPipe objects can generate one or more IOUSBHostStream objects. + + AppleUSBHostPort services provide a workloop that is dedicated for use by the port, its enumerated device, and any attached drivers. As such, drivers should not create or manage their own workloops. + + IOUSBHostDevice and IOUSBHostInterface services can be matched on and controlled by third-party drivers, and are documented in IOUSBHostDevice.h and IOUSBHostInterface.h. IOUSBHostPipe and IOUSBHostStream services share a common IOUSBHostIOSource base class, and are documented in IOUSBHostIOSource.h, IOUSBHostPipe.h, and IOUSBHostStream.h. AppleUSBHostController and AppleUSBHostPort should be considered opaque classes. + + <h3>Matching</h3> + + IOUSBHostDevice and IOUSBHostInterface matching uses the same properties as the deprecated IOUSBDevice and IOUSBInterface classes. See <a href="https://developer.apple.com/library/mac/qa/qa1076/_index.html">QA1076: Tips on USB driver matching for Mac OS X</a> for additional information. + + <h3>Power management</h3> + + IOUSBHostFamily supports more advanced power management capabilities, including pausing IO, and automatic suspend of idle devices. All of this functionality is guided by idle policies set on IOUSBHostInterface services and IOUSBHostPipe objects. The idle policy functionality allows most drivers to ignore suspend or resume events on the bus, and makes it unnecessary for them to actively participate in power management. + + <h4>Idle suspend</h4> + + By default, interfaces and pipes do not enable an idle policy, and the device will remain in the active (not suspended) state as long as the host machine is awake. To enable idle suspend, the driver controlling an IOUSBHostInterface must enable an idle policy with the <code>IOUSBHostInterface::setIdlePolicy</code> API. In the simple case of a device with only a single interface, when the interface's endpoints have no IO requests pending, the system will wait the time specified in the setIdlePolicy call, and then electrically suspend the device. A new IO request during the wait period will cancel the suspend, and a new IO request after the device has suspended will immediately resume the device and initiate the IO. + + In the more complex case of a device with multiple interfaces, a consensus idle policy must be calculated by finding the largest idle policy for all interfaces, excluding those which have not been opened by a driver. + + Selection of an idle policy depends on the individual device, and should factor in resume latency tolerance. The recommended idle policy for an interface is 50ms or larger. + + Idle suspend is disabled if a driver is the power child of the IOUSBHostDevice and resides in a power state with an input power requirement that does not include <code>kIOPMLowPower</code>. + + <h4>Pausing IO</h4> + + A more advanced approach to idle suspend allows the device to suspend while transfers are still pending. This is particularly useful for interfaces with interrupt IN endpoints that always have an IO pending, and otherwise would not idle suspend. To enable IO pause, endpoints that would otherwise keep the device in the active state must enable an idle policy with the <code>IOUSBHostPipe::setIdlePolicy</code> API. When an IOUSBHostPipe with an idle policy begins servicing a new IO, but does not complete it within the wait time specified in the idle policy, the IOUSBHostPipe is now considered idle and will not keep the device in the active state. Idle endpoints are still serviced on the bus, and the IOUSBHostPipe is capable of moving data even when idle. When all endpoints in the device have no pending IO requests or are idle, the idle suspend wait period begins as described above. + + If the idle suspend period elapses without any new IO requests that would cancel the suspend, IOUSBHostFamily will pause the transfers on the bus and suspend the device. IO requests are not aborted or returned to the driver when paused in this manner. + + After resuming the device due to a remote wake or a new IO request, the pending IO requests are resumed on the bus, and data movement can continue. If a large transfer is interrupted by a suspend, IOUSBHostFamily will combine the packets from before and after the suspend and return them as a single transfer result. Note that not all firmware supports a mid-transfer suspend/resume, and pausing IO should only be enabled for devices that have been tested for this use case. + + Control and isochronous IOUSBHostPipe objects never enable an idle policy, and pending IO on these endpoints will always prevent idle suspend. + + Selection of an idle policy depends on the individual endpoint, and should factor in resume latency tolerance and expected data transfer frequency. The recommended idle policy for IN-direction bulk and interrupt endpoints is 50ms or larger. Firmware must be capable of handling a mid-transfer suspend/resume, and should issue a remote wake when data is available to be read. Enabling an idle policy for OUT-direction bulk or interrupt endpoints is not generally recommended, but if enabled, firmware should have the ability to issue a remote wake when there is space in its endpoint buffer for additional data. + + <h4>System power state changes</h4> + + For devices that idle suspend, it may be necessary to perform IO as the system enters the sleep state, for example to enable wake-on-LAN for an Ethernet controller. Drivers that wish to perform this type of IO should call <code>IOService::registerInterestedDriver</code> on the PM root to be notified of system-level changes. During the <code>powerStateWillChangeTo</code> notification with a capability flag including <code>kIOPMSleepCapability</code>, the driver can initiate an IO request and resume the device. Once the driver acknowledges this <code>powerStateWillChangeTo</code> notification, the device may not be able to raise its power state until the system wakes. Attempting an IO request from other PM root <code>powerStateWillChangeTo</code> and <code>powerStateDidChangeTo</code> notifications may result in a deadlock waiting for a power state change. + + <h3>Comparison to IOUSBFamily</h3> + + Developers already familiar with IOUSBFamily can take advantage of new capabilities in IOUSBHostFamily that can simplify driver development and maintenace. + + <h4>Workloops</h4> + + IOUSBFamily provided a workloop for each controller, and all downstream devices shared that workloop. By contrast, each AppleUSBHostPort creates a workloop dedicated for its attached device, which significantly reduces lock contention and improves responsiveness for drivers attached to IOUSBHostDevice or IOUSBHostInterface services. Because the workloop is not shared across many unrelated services, driver developers are discouraged from creating an additional workloop. + + <h4>Synchronous IO from completion callbacks</h4> + + IOUSBFamily did not permit synchronous IO to be executed from a completion callback, but this restriction has been removed in IOUSBHostFamily. Driver developers can now issue a sequence of synchronous commands in a completion routine without chaining thread calls or using complex state machines. + + <h4>IO bookkeeping</h4> + + IOUSBHostFamily now tracks all outstanding IOs for an endpoint, and offers more predictable behavior when aborting transfers or terminating services. In most cases, driver developers no longer need to track the number of outstanding IOs, and can terminate their services with more determinism. + + <h3>Driver Recommendations</h3> + + <ul> + <li>Do not create a separate workloop</li> + <li>If joining the power plane, reside in a <code>kIOPMLowPower</code> state to enable idle suspend</li> + <li>If supporting pausing IO, only enable an idle policy on bulk or interrupt IN endpoints</li> + <li>If interested in system power state changes, call <code>registerInterestedDriver</code> on the PM root</li> + </ul> +*/ + +#ifndef IOUSBHostFamily_IOUSBHostFamily_h +#define IOUSBHostFamily_IOUSBHostFamily_h + +#include <IOKit/usb/StandardUSB.h> +#include <IOKit/usb/IOUSBHostFamilyDefinitions.h> + +#ifndef __IOUSBHOSTFAMILY_DEPRECATED +#define __IOUSBHOSTFAMILY_DEPRECATED +#endif + +#pragma mark Typedefs + +typedef uint16_t tUSBHostDeviceAddress; + +#pragma mark General enumerations + +#ifdef __cplusplus +using namespace StandardUSB; +#endif + +enum tEndpointDirection +{ + kEndpointDirectionOut = (kEndpointDescriptorDirectionOut >> kEndpointDescriptorDirectionPhase), + kEndpointDirectionIn = (kEndpointDescriptorDirectionIn >> kEndpointDescriptorDirectionPhase), + kEndpointDirectionUnknown = 2 +}; + +typedef enum tEndpointDirection tEndpointDirection; + +enum tEndpointType +{ + kEndpointTypeControl = (kEndpointDescriptorTransferTypeControl >> kEndpointDescriptorTransferTypePhase), + kEndpointTypeIsochronous = (kEndpointDescriptorTransferTypeIsochronous >> kEndpointDescriptorTransferTypePhase), + kEndpointTypeBulk = (kEndpointDescriptorTransferTypeBulk >> kEndpointDescriptorTransferTypePhase), + kEndpointTypeInterrupt = (kEndpointDescriptorTransferTypeInterrupt >> kEndpointDescriptorTransferTypePhase) +}; + +typedef enum tEndpointType tEndpointType; + +enum tDeviceRequestDirection +{ + kRequestDirectionOut = (kDeviceRequestDirectionOut >> kDeviceRequestDirectionPhase), + kRequestDirectionIn = (kDeviceRequestDirectionIn >> kDeviceRequestDirectionPhase) +}; + +typedef enum tDeviceRequestDirection tDeviceRequestDirection; + +enum tDeviceRequestType +{ + kRequestTypeStandard = (kDeviceRequestTypeStandard >> kDeviceRequestTypePhase), + kRequestTypeClass = (kDeviceRequestTypeClass >> kDeviceRequestTypePhase), + kRequestTypeVendor = (kDeviceRequestTypeVendor >> kDeviceRequestTypePhase) +}; + +typedef enum tDeviceRequestType tDeviceRequestType; + +enum tDeviceRequestRecipient +{ + kRequestRecipientDevice = (kDeviceRequestRecipientDevice >> kDeviceRequestRecipientPhase), + kRequestRecipientInterface = (kDeviceRequestRecipientInterface >> kDeviceRequestRecipientPhase), + kRequestRecipientEndpoint = (kDeviceRequestRecipientEndpoint >> kDeviceRequestRecipientPhase), + kRequestRecipientOther = (kDeviceRequestRecipientOther >> kDeviceRequestRecipientPhase) +}; + +typedef enum tDeviceRequestRecipient tDeviceRequestRecipient; + +inline uint8_t makeDeviceRequestbmRequestType(tDeviceRequestDirection direction, tDeviceRequestType type, tDeviceRequestRecipient recipient) +{ + return ((direction << kDeviceRequestDirectionPhase) & kDeviceRequestDirectionMask) + | ((type << kDeviceRequestTypePhase) & kDeviceRequestTypeMask) + | ((recipient << kDeviceRequestRecipientPhase) & kDeviceRequestRecipientMask); +} + +enum +{ + kUSBHostVendorSpecificClass = 255, + kUSBHostHubClass = 9, + kUSBHostMaxDevices = 128, // The largest number of devices permitted on USB 2.0 buses + kUSBHostMaxPipes = 32, // The largest number of endpoints permitted on USB devices + kUSBHostMaxCountFullSpeedIsochronous = 1023, // max size (bytes) of any one Isoc frame for 1 FS endpoint + kUSBHostVendorIDAppleComputer = 0x05AC +}; + +/*! + * @enum tInternalUSBHostConnectionSpeed + * @brief Connection speeds used internally by IOUSBHostFamily + */ +enum tInternalUSBHostConnectionSpeed +{ + kUSBHostConnectionSpeedLow = 0, + kUSBHostConnectionSpeedFull = 1, + kUSBHostConnectionSpeedHigh = 2, + kUSBHostConnectionSpeedSuper = 3, + kUSBHostConnectionSpeedSuperPlus = 4, + kUSBHostConnectionSpeedSuperPlusBy2 = 5, + kUSBHostConnectionSpeedCount = 6 +}; + + +/*! + @definedblock IOUSBHostFamily message codes + @discussion Messages passed between USB services using the <code>IOService::message</code> API. + */ +#define kUSBHostMessageUpdateIdlePolicy iokit_usbhost_msg(0x100) // 0xe0005100 Apple Internal use only. IOUSBHostInterface -> IOUSBHostDevice to update its idle policy. +#define kUSBHostMessageRemoteWake iokit_usbhost_msg(0x101) // 0xe0005101 Apple Internal use only. AppleUSBHostController -> AppleUSBHostPort -> IOUSBHostDevice upon a remote wake event. Argument is locationID of remote wake. +#define kUSBHostMessageDeviceSuspend iokit_usbhost_msg(0x102) // 0xe0005102 Apple Internal use only. IOUSBHostDevice -> clients upon a suspend event. +#define kUSBHostMessageDeviceResume iokit_usbhost_msg(0x103) // 0xe0005103 Apple Internal use only. IOUSBHostDevice -> clients upon a resume event. +#define kUSBHostMessagePortsCreated iokit_usbhost_msg(0x104) // 0xe0005104 Apple Internal use only. AppleUSBHostController and AppleUSBHub -> clients after all ports have been created. +#define kUSBHostMessageDeviceConnected iokit_usbhost_msg(0x105) // 0xe0005105 Apple Internal use only. AppleUSBRemovablePort -> clients after a connect. +#define kUSBHostMessageDeviceDisconnected iokit_usbhost_msg(0x106) // 0xe0005106 Apple Internal use only. AppleUSBRemovablePort -> clients after a disconnect. +#define kUSBHostMessageControllerPoweredOn iokit_usbhost_msg(0x107) // 0xe0005107 Apple Internal use only. AppleEmbeddedUSBXHCIFL1100 -> FL1100Boot after a stable power state is reached. +#define kUSBHostMessageNonInterruptIsochFrame iokit_usbhost_msg(0x108) // 0xe0005108 Apple Internal use only. +#define kUSBHostMessageInterfaceAlternateSetting iokit_usbhost_msg(0x109) // 0xe0005109 Apple Internal use only. IOUSBHostInterface -> IOUSBInterface to update interface properties after an alternate setting is selected +#define kUSBHostMessageDeviceLegacyCapture iokit_usbhost_msg(0x10A) // 0xe000510A Apple Internal use only. IOUSBHostDevice -> IOUSBDevice to relay user space re-enumeration for capturing/releasing devices + +// User Message Support + +#define kUSBLegacyMessagePortHasBeenSuspended iokit_usblegacy_err_msg(0x0d) // 0xe000400d Apple Internal use only. Message sent by an IOUSBDevice indicating the completion of a power change on the compatibility service +#define kUSBLegacyMessagePortHasBeenResumed iokit_usblegacy_err_msg(0x0b) // 0xe000400b Apple Internal use only. Message sent by an IOUSBDevice indicating the completion of a power change on the compatibility service +#define kUSBHostMessageOvercurrentCondition iokit_usblegacy_err_msg(0x13) // 0xe0004013 Apple Internal use only. Message sent to the clients of the device's hub parent, when a device causes an overcurrent condition. The message argument contains the locationID of the device +#define kUSBHostMessageNotEnoughPower iokit_usblegacy_err_msg(0x14) // 0xe0004014 Apple Internal use only. Message sent to the clients of the device's hub parent, when a device causes an low power notice to be displayed. The message argument contains the locationID of the device +#define kUSBHostMessageEndpointCountExceeded iokit_usblegacy_err_msg(0x19) // 0xe0004019 Apple Internal use only. Message sent to a device when endpoints cannot be created because the USB controller ran out of resources +#define kUSBHostMessageDeviceCountExceeded iokit_usblegacy_err_msg(0x1a) // 0xe000401a Apple Internal use only. Message sent by a hub when a device cannot be enumerated because the USB controller ran out of resources +#define kUSBHostMessageUnsupportedConfiguration iokit_usblegacy_err_msg(0x1c) // 0xe000401c Apple Internal use only. Message sent to the clients of the device when a device is not supported in the current configuration. The message argument contains the locationID of the device +#define kUSBHostMessageHubCountExceeded iokit_usblegacy_err_msg(0x1d) // 0xe000401d Apple Internal use only. Message sent when a 6th hub was plugged in and was not enumerated, as the USB spec only support 5 hubs in a chain +#define kUSBHostMessageTDMLowBattery iokit_usblegacy_err_msg(0x1e) // 0xe000401e Apple Internal use only. Message sent when when an attached TDM system battery is running low. +/*! @/definedblock */ + + +/*! + * @brief Port types returned by IOUSBHostDevice::getPortStatus + * + * @constant kUSBHostPortTypeStandard A general-purpose USB port. + * @constant kUSBHostPortTypeCaptive The attached device cannot be physically disconnected from the port. + * @constant kUSBHostPortTypeInternal The attached device cannot be physically disconnected from the host machine. + * @constant kUSBHostPortTypeAccessory The attached device may require authentication before function drivers can access it. + * @constant kUSBHostPortTypeCount The number of entries in this enum. + */ +enum tUSBHostPortType +{ + kUSBHostPortTypeStandard = kIOUSBHostPortTypeStandard, + kUSBHostPortTypeCaptive = kIOUSBHostPortTypeCaptive, + kUSBHostPortTypeInternal = kIOUSBHostPortTypeInternal, + kUSBHostPortTypeAccessory = kIOUSBHostPortTypeAccessory, + kUSBHostPortTypeExpressCard = kIOUSBHostPortTypeExpressCard, + kUSBHostPortTypeCount = kIOUSBHostPortTypeCount +}; + +/*! + * @brief Connection speeds returned by IOUSBHostDevice::getPortStatus + * @discussion This enumeration matches the default speed ID mappings defined in XHCI 1.0 Table 147. + * + * @constant kUSBHostPortConnectionSpeedNone No device is connected + * @constant kUSBHostPortConnectionSpeedFull A full-speed (12 Mb/s) device is connected + * @constant kUSBHostPortConnectionSpeedLow A low-speed (1.5 Mb/s) device is connected + * @constant kUSBHostPortConnectionSpeedHigh A high-speed (480 Mb/s) device is connected) + * @constant kUSBHostPortConnectionSpeedSuper A superspeed (5 Gb/s) device is connected) + * @constant kUSBHostPortConnectionSpeedSuperPlus A superspeed (10 Gb/s) device is connected) + * @constant kUSBHostPortConnectionSpeedUSB3Gen2By2 A superspeed (20 Gb/s) device is connected) + */ +enum tUSBHostConnectionSpeed +{ + kUSBHostPortConnectionSpeedNone = kIOUSBHostConnectionSpeedNone, + kUSBHostPortConnectionSpeedFull = kIOUSBHostConnectionSpeedFull, + kUSBHostPortConnectionSpeedLow = kIOUSBHostConnectionSpeedLow, + kUSBHostPortConnectionSpeedHigh = kIOUSBHostConnectionSpeedHigh, + kUSBHostPortConnectionSpeedSuper = kIOUSBHostConnectionSpeedSuper, + kUSBHostPortConnectionSpeedSuperPlus = kIOUSBHostConnectionSpeedSuperPlus, + kUSBHostPortConnectionSpeedSuperPlusBy2 = kIOUSBHostConnectionSpeedSuperPlusBy2, + kUSBHostPortConnectionSpeedCount = kIOUSBHostConnectionSpeedCount +}; + +/*! + * @enum tOpenOptions + * @brief Option bits used when calling ::open on IOUSBHostFamily services + */ +enum +{ + kUSBHostOpenOptionSelectAlternateSetting = StandardUSBBit(16), // IOUSBHostInterface + kUSBHostOpenOptionUserClientSession = StandardUSBBit(17) // IOUSBHostDevice: Reserved for AppleUSBHostUserClient objects +}; + +/*! + * @brief Values returned by IOUSBHostDevice::getPortStatus + * + * @constant kUSBHostPortStatusPortTypeMask The mask for bits representing the port type. + * @constant kUSBHostPortStatusPortTypeStandard A general-purpose USB port. + * @constant kUSBHostPortStatusPortTypeCaptive The attached device cannot be physically disconnected from the port. + * @constant kUSBHostPortStatusPortTypeInternal The attached device cannot be physically disconnected from the host machine. + * @constant kUSBHostPortStatusPortTypeAccessory The attached device may require authentication before function drivers can access it. + * @constant kUSBHostPortStatusConnectedSpeedMask The mask for bits representing the connection state. + * @constant kUSBHostPortStatusConnectedSpeedNone The port does not have a connected device. + * @constant kUSBHostPortStatusConnectedSpeedFull The port has a full-speed device connected. + * @constant kUSBHostPortStatusConnectedSpeedLow The port has a low-speed device connected. + * @constant kUSBHostPortStatusConnectedSpeedHigh The port has a high-speed device connected. + * @constant kUSBHostPortStatusConnectedSpeedSuper The port has a superspeed device connected. + * @constant kUSBHostPortStatusResetting The port is currently resetting the link. + * @constant kUSBHostPortStatusEnabled The port is enabled and packets are permitted to reach the device. Not valid unless kUSBHostPortStatusConnectedSpeedMask is nonzero. + * @constant kUSBHostPortStatusSuspended The port is suspended. Not valid unless kUSBHostPortStatusConnectedSpeedMask is nonzero. + * @constant kUSBHostPortStatusOvercurrent The port is in the overcurrent condition. + * @constant kUSBHostPortStatusTestMode The port is in test mode. + */ +enum tUSBHostPortStatus +{ + kUSBHostPortStatusPortTypeMask = kIOUSBHostPortStatusPortTypeMask, + kUSBHostPortStatusPortTypePhase = kIOUSBHostPortStatusPortTypePhase, + kUSBHostPortStatusPortTypeStandard = kIOUSBHostPortStatusPortTypeStandard, + kUSBHostPortStatusPortTypeCaptive = kIOUSBHostPortStatusPortTypeCaptive, + kUSBHostPortStatusPortTypeInternal = kIOUSBHostPortStatusPortTypeInternal, + kUSBHostPortStatusPortTypeAccessory = kIOUSBHostPortStatusPortTypeAccessory, + kUSBHostPortStatusPortTypeReserved = kIOUSBHostPortStatusPortTypeReserved, + kUSBHostPortStatusConnectedSpeedMask = kIOUSBHostPortStatusConnectedSpeedMask, + kUSBHostPortStatusConnectedSpeedPhase = kIOUSBHostPortStatusConnectedSpeedPhase, + kUSBHostPortStatusConnectedSpeedNone = kIOUSBHostPortStatusConnectedSpeedNone, + kUSBHostPortStatusConnectedSpeedFull = kIOUSBHostPortStatusConnectedSpeedFull, + kUSBHostPortStatusConnectedSpeedLow = kIOUSBHostPortStatusConnectedSpeedLow, + kUSBHostPortStatusConnectedSpeedHigh = kIOUSBHostPortStatusConnectedSpeedHigh, + kUSBHostPortStatusConnectedSpeedSuper = kIOUSBHostPortStatusConnectedSpeedSuper, + kUSBHostPortStatusConnectedSpeedSuperPlus = kIOUSBHostPortStatusConnectedSpeedSuperPlus, + kUSBHostPortStatusConnectedSpeedSuperPlusBy2 = kIOUSBHostPortStatusConnectedSpeedSuperPlusBy2, + kUSBHostPortStatusResetting = kIOUSBHostPortStatusResetting, + kUSBHostPortStatusEnabled = kIOUSBHostPortStatusEnabled, + kUSBHostPortStatusSuspended = kIOUSBHostPortStatusSuspended, + kUSBHostPortStatusOvercurrent = kIOUSBHostPortStatusOvercurrent, + kUSBHostPortStatusTestMode = kIOUSBHostPortStatusTestMode +}; + +/*! + @enum tUSBHostDefaultControlRequestTimeout + @brief Default control request timeout values in milliseconds + */ +enum +{ +#if USB_COMPLIANCE_MODE + kUSBHostSetAddressTimeout = 50, // USB 2.0 9.2.6.3 + kUSBHostStandardRequestNoDataTimeout = 500, // USB 2.0 9.2.6.4 + kUSBHostStandardRequestCompletionTimeout = 5000, // USB 2.0 9.2.6.4 + kUSBHostStandardRequestSimpleCompletionTimeout = 50, // USB 2.0 9.2.6.4 Standard request with no data stage + kUSBHostClassRequestNoDataTimeout = 500, // USB 2.0 9.2.6.5 + kUSBHostClassRequestCompletionTimeout = 5000, // USB 2.0 9.2.6.5 + kUSBHostVendorRequestNoDataTimeout = 0, + kUSBHostVendorRequestCompletionTimeout = 5000, +#else + // More tolerant timeout values for noncompliant devices + kUSBHostSetAddressTimeout = 1000, + kUSBHostStandardRequestNoDataTimeout = 0, + kUSBHostStandardRequestCompletionTimeout = 5000, + kUSBHostStandardRequestSimpleCompletionTimeout = 1000, + kUSBHostClassRequestNoDataTimeout = 0, + kUSBHostClassRequestCompletionTimeout = 5000, + kUSBHostVendorRequestNoDataTimeout = 0, + kUSBHostVendorRequestCompletionTimeout = 5000, +#endif + kUSBHostDefaultControlNoDataTimeoutMS = 0, + kUSBHostDefaultControlCompletionTimeoutMS = 5000 +}; + +#pragma mark APCI enumerations + +// ACPI 5.0a Table 9-227: UPC Return Package Values +typedef enum +{ + kUSBHostPortNotConnectable = 0, // Port is not connectable + kUSBHostPortConnectable = 1 // Port is connectable either user visible or invisible +} tUSBHostPortConnectable; + +// ACPI 5.0a Table 9-227: UPC Return Package Values +typedef enum +{ + kUSBHostConnectorTypeA = 0x00, + kUSBHostConnectorTypeMiniAB = 0x01, + kUSBHostConnectorTypeExpressCard = 0x02, + kUSBHostConnectorTypeUSB3A = 0x03, + kUSBHostConnectorTypeUSB3B = 0x04, + kUSBHostConnectorTypeUSB3MicroB = 0x05, + kUSBHostConnectorTypeUSB3MicroAB = 0x06, + kUSBHostConnectorTypeUSB3PowerB = 0x07, + kUSBHostConnectorTypeUSBTypeC = 0x09, + kUSBHostConnectorTypeUnknown = 0xFE, + kUSBHostConnectorTypeProprietary = 0xFF +} tUSBHostConnectorType; + +/*! + * @enum tUSBHostPowerSourceType + * @brief Power sources used internally by IOUSBHostFamily + * @constant kUSBHostPowerSourceTypeStaticPool The power source is a statically allocated pool for software to manage. + * @constant kUSBHostPowerSourceTypeSMC The power source is managed by the SMC. + * @constant kUSBHostPowerSourceTypeHardware The power source is guaranteed by the hardware and can always allocate the port current limit. + */ +typedef enum +{ + kUSBHostPowerSourceTypeStaticPool = 0, + kUSBHostPowerSourceTypeSMC, + kUSBHostPowerSourceTypeHardware +}tUSBHostPowerSourceType; + +#if TARGET_CPU_X86 || TARGET_CPU_X86_64 + +#ifndef kACPIDevicePathKey +#define kACPIDevicePathKey "acpi-path" +#endif + +#ifndef kACPIInterruptTypeValid +#define kACPIInterruptTypeValid (1 << 1) +#endif + +// ACPI methods +#define kUSBHostACPIPropertyXHCICompanion "XHCN" // The number of the companion XHCI controller, used for multiplexed ports +#define kUSBHostACPIPropertyMultiplexor "MUXS" // The ACPI method name for the port multiplexor + +// _UPC +// _EJD + +#define kSDControllerGPIOResetACPIMethod "SRST" +#define kSDControllerGPIOPowerACPIMethod "SPWR" +#define kSDPortConnectionBehaviorACPIMethod "SBHV" +#define kSDControllerGPIOResetPropertyKey "GPIO_RESET" +#define kSDControllerCaptiveUSB3ReaderKey "U3SD" +#define kGetBehaviorACPIMethod "GBHV" +#define kGPEACPIString "_GPE" +#define kRDYForGPIOTest "RDYG" +#define kReconfiguredCount "RCFG" +#define kUSBPlatformProperties "USBX" +#define kUSBTypeCCableDetectACPIMethod "MODU" +#define kUSBTypeCCableDetectACPIMethodSupported "RTPC" +#define kGPEOCACPIString "GPOC" +#define kACPIPortTimingOverride "TMG" + +// connection types returned by MODU method +typedef enum +{ + kUSBTypeCCableTypeNone = 0, + kUSBTypeCCableTypeUSB = 1, +} tUSBCTypeCableType; + +#endif + +typedef enum +{ + kLinkStateU0 = 0, // USB3 Link State U0 (On) + kLinkStateU1 = 1, // USB3 Link State U1 (Standby, fast exit) + kLinkStateU2 = 2, // USB3 Link State U2 (Standby, slower exit) + kLinkStateU3 = 3, // USB3 Link State U3 (Suspend) + + kLinkStateL0 = 0, // USB2 Link State L0 (On) + kLinkStateL1 = 1, // USB2 Link State L1 (Sleep) + kLinkStateL2 = 2, // USB2 Link State L2 (Suspend) + kLinkStateL3 = 3, // USB2 Link State L3 (Off) + +} tUSBLinkState; + +typedef enum +{ + kDescriptorExitLatency, // Descriptor Exit Latencies (DEL). + kDeviceExitLatency, // Device Initiated Exit Latencies (PEL) + kSystemExitLatency, // System Exit Latency (SEL) + kMaxExitLatency, // Max Exit Latency (MEL) + + // USB2 LPM specific latencies + kBestEffortServiceLatency, // Best Effort Service Latency + kBestEffortServiceLatencyDeep, // Best Effort Service Latency Deep + kDefaultBestEffortServiceLatency, // Default Best Effort Service Latency + kDefaultBestEffortServiceLatencyDeep, // Default Best Effort Service Latency Deep + kMaxL1BaseExitLatency, // Max Exit Latency for L1 while using BESL base value + kMaxL1DeepExitLatency, // Max Exit Latency for L1 while using BESL Deep + +} tUSBLPMExitLatency; + +enum +{ + kUSB3LPMMaxU1SEL = 0xFF, + kUSB3LPMMaxU1PEL = 0xFF, + + kUSB3LPMMaxU2SEL = 0xFFFF, + kUSB3LPMMaxU2PEL = 0xFFFF, + + kUSB3LPMMaxU1Timeout = 0x7F, + kUSB3LPMU1Disabled = 0, + kUSB3LPMU1AcceptOnly = 0xFF, + + kUSB3LPMMaxU2Timeout = 0xFE00, // In Micro Seconds + kUSB3LPMU2Disabled = 0, // In Micro Seconds + kUSB3LPMU2AcceptOnly = 0xFF00, // In Micro Seconds + + kUSB3LPMMaxT3SEL = 100, // SEL:T3 value as per USB 3.0 Section C.1.5.1 in Nano Seconds + kUSB3LPMMaxHostSchDelay = 1000, // Maximum Host Scheduling Delay for Max Exit Latency Calculations + + kUSB3LPMExtraDeviceEL = 4000, // An additional delay(buffer) in Nano Seconds added to Exit Latency reported by the device in its BOS descriptor + + kUSB2LPMMaxL1Timeout = 0xFF00, // In Micro seconds +}; + +typedef enum +{ + kUSBDeviceLPMStatusDefault = 0, + kUSBDeviceLPMStatusDisabled = 1, + kUSBDeviceLPMStatusEnabled = 2 + +} tUSBDeviceLPMStatus; + +#endif diff --git a/QualcommWireless/include/IOKit/usb/IOUSBHostFamilyDefinitions.h b/QualcommWireless/include/IOKit/usb/IOUSBHostFamilyDefinitions.h new file mode 100644 index 0000000..f552863 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBHostFamilyDefinitions.h @@ -0,0 +1,302 @@ +/* + * Copyright (c) 1998-2016 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/*! + @header IOUSBHostFamilyDefinitions.h + @brief Definitions used for the IOUSBHostFamily + !*/ + +#ifndef IOUSBHostFamily_IOUSBHostFamilyDefinitions_h +#define IOUSBHostFamily_IOUSBHostFamilyDefinitions_h + +#include <TargetConditionals.h> +#if TARGET_OS_DRIVERKIT +#include <stdint.h> +#include <stddef.h> +#include <sys/_types/_uuid_t.h> +#include <DriverKit/IOTypes.h> +#include <DriverKit/IOLib.h> +#else +#include <IOKit/IOTypes.h> +#include <libkern/OSByteOrder.h> +#endif + +#define IOUSBHostFamilyBit(bit) ((uint32_t)(1) << bit) +#define IOUSBHostFamilyBitRange(start, end) (~(((uint32_t)(1) << start) - 1) & (((uint32_t)(1) << end) | (((uint32_t)(1) << end) - 1))) +#define IOUSBHostFamilyBitRange64(start, end) (~(((uint64_t)(1) << start) - 1) & (((uint64_t)(1) << end) | (((uint64_t)(1) << end) - 1))) +#define IOUSBHostFamilyBitRangePhase(start, end) (start) + +#define iokit_usb_codemask IOUSBHostFamilyBitRange(0, 11) +#define iokit_usbhost_group (1 << IOUSBHostFamilyBitRangePhase(12, 13)) +#define iokit_usblegacy_group (0 << IOUSBHostFamilyBitRangePhase(12, 13)) +#define iokit_usbhost_err(message) ((IOReturn)(iokit_family_err(sub_iokit_usb, iokit_usbhost_group | (message & iokit_usb_codemask)))) +#define iokit_usbhost_msg(message) ((uint32_t)(iokit_family_msg(sub_iokit_usb, iokit_usbhost_group | (message & iokit_usb_codemask)))) +#define iokit_usblegacy_err_msg(message) ((uint32_t)(sys_iokit | sub_iokit_usb | message)) + +/*! + @definedblock IOUSBHostFamily message codes + @discussion Messages passed between USB services using the <code>IOService::message</code> API. + */ +#define kUSBHostMessageConfigurationSet iokit_usbhost_msg(0x00) // 0xe0005000 IOUSBHostDevice -> clients upon a setConfiguration call. +#define kUSBHostMessageRenegotiateCurrent iokit_usbhost_msg(0x01) // 0xe0005001 Request clients to renegotiate bus current allocations + +#define kUSBHostReturnPipeStalled iokit_usbhost_err(0x0) // 0xe0005000 Pipe has issued a STALL handshake. Use clearStall to clear this condition. +#define kUSBHostReturnNoPower iokit_usbhost_err(0x1) // 0xe0005001 A setConfiguration call was not able to succeed because all configurations require more power than is available. + +/*! + * @enum tIOUSBHostConnectionSpeed + * @brief Connection speeds reported in kUSBHostMatchingPropertySpeed + * @discussion This enumeration matches the default speed ID mappings defined in XHCI 1.0 Table 147. + * @constant kIOUSBHostConnectionSpeedNone No device is connected + * @constant kIOUSBHostConnectionSpeedFull A full-speed (12 Mb/s) device is connected + * @constant kIOUSBHostConnectionSpeedLow A low-speed (1.5 Mb/s) device is connected + * @constant kIOUSBHostConnectionSpeedHigh A high-speed (480 Mb/s) device is connected) + * @constant kIOUSBHostConnectionSpeedSuper A superspeed (5 Gb/s) device is connected) + * @constant kIOUSBHostConnectionSpeedSuperPlus A superspeed (10 Gb/s) device is connected) + * @constant kIOUSBHostConnectionSpeedSuperPlusBy2 A superspeed (20 Gb/s) device is connected) + */ +enum tIOUSBHostConnectionSpeed +{ + kIOUSBHostConnectionSpeedNone = 0, + kIOUSBHostConnectionSpeedFull = 1, + kIOUSBHostConnectionSpeedLow = 2, + kIOUSBHostConnectionSpeedHigh = 3, + kIOUSBHostConnectionSpeedSuper = 4, + kIOUSBHostConnectionSpeedSuperPlus = 5, + kIOUSBHostConnectionSpeedSuperPlusBy2 = 6, + kIOUSBHostConnectionSpeedCount = 7 +}; + +/*! + * @brief Port types returned by IOUSBHostDevice::getPortStatus and kUSBHostPortPropertyStatus + * + * @constant kIOUSBHostPortTypeStandard A general-purpose USB port. + * @constant kIOUSBHostPortTypeCaptive The attached device cannot be physically disconnected from the port. + * @constant kIOUSBHostPortTypeInternal The attached device cannot be physically disconnected from the host machine. + * @constant kIOUSBHostPortTypeAccessory The attached device may require authentication before function drivers can access it. + * @constant kIOUSBHostPortTypeCount The number of entries in this enum. + */ +enum tIOUSBHostPortType +{ + kIOUSBHostPortTypeStandard = 0, + kIOUSBHostPortTypeCaptive, + kIOUSBHostPortTypeInternal, + kIOUSBHostPortTypeAccessory, + kIOUSBHostPortTypeExpressCard, + kIOUSBHostPortTypeCount +}; + +/*! + * @brief Values returned by IOUSBHostDevice::getPortStatus and kUSBHostPortPropertyStatus + * + * @constant kIOUSBHostPortStatusPortTypeMask The mask for bits representing the port type. + * @constant kIOUSBHostPortStatusPortTypeStandard A general-purpose USB port. + * @constant kIOUSBHostPortStatusPortTypeCaptive The attached device cannot be physically disconnected from the port. + * @constant kIOUSBHostPortStatusPortTypeInternal The attached device cannot be physically disconnected from the host machine. + * @constant kIOUSBHostPortStatusPortTypeAccessory The attached device may require authentication before function drivers can access it. + * @constant kIOUSBHostPortStatusConnectedSpeedMask The mask for bits representing the connection state. + * @constant kIOUSBHostPortStatusConnectedSpeedNone The port does not have a connected device. + * @constant kIOUSBHostPortStatusConnectedSpeedFull The port has a full-speed device connected. + * @constant kIOUSBHostPortStatusConnectedSpeedLow The port has a low-speed device connected. + * @constant kIOUSBHostPortStatusConnectedSpeedHigh The port has a high-speed device connected. + * @constant kIOUSBHostPortStatusConnectedSpeedSuper The port has a superspeed device connected. + * @constant kIOUSBHostPortStatusResetting The port is currently resetting the link. + * @constant kIOUSBHostPortStatusEnabled The port is enabled and packets are permitted to reach the device. Not valid unless kIOUSBHostPortStatusConnectedSpeedMask is nonzero. + * @constant kIOUSBHostPortStatusSuspended The port is suspended. Not valid unless kIOUSBHostPortStatusConnectedSpeedMask is nonzero. + * @constant kIOUSBHostPortStatusOvercurrent The port is in the overcurrent condition. + * @constant kIOUSBHostPortStatusTestMode The port is in test mode. + */ +enum tIOUSBHostPortStatus +{ + kIOUSBHostPortStatusPortTypeMask = IOUSBHostFamilyBitRange(0, 3), + kIOUSBHostPortStatusPortTypePhase = IOUSBHostFamilyBitRangePhase(0, 3), + kIOUSBHostPortStatusPortTypeStandard = (kIOUSBHostPortTypeStandard << IOUSBHostFamilyBitRangePhase(0, 3)), + kIOUSBHostPortStatusPortTypeCaptive = (kIOUSBHostPortTypeCaptive << IOUSBHostFamilyBitRangePhase(0, 3)), + kIOUSBHostPortStatusPortTypeInternal = (kIOUSBHostPortTypeInternal << IOUSBHostFamilyBitRangePhase(0, 3)), + kIOUSBHostPortStatusPortTypeAccessory = (kIOUSBHostPortTypeAccessory << IOUSBHostFamilyBitRangePhase(0, 3)), + kIOUSBHostPortStatusPortTypeReserved = IOUSBHostFamilyBitRange(4, 7), + kIOUSBHostPortStatusConnectedSpeedMask = IOUSBHostFamilyBitRange(8, 10), + kIOUSBHostPortStatusConnectedSpeedPhase = IOUSBHostFamilyBitRangePhase(8, 10), + kIOUSBHostPortStatusConnectedSpeedNone = (kIOUSBHostConnectionSpeedNone << IOUSBHostFamilyBitRangePhase(8, 10)), + kIOUSBHostPortStatusConnectedSpeedFull = (kIOUSBHostConnectionSpeedFull << IOUSBHostFamilyBitRangePhase(8, 10)), + kIOUSBHostPortStatusConnectedSpeedLow = (kIOUSBHostConnectionSpeedLow << IOUSBHostFamilyBitRangePhase(8, 10)), + kIOUSBHostPortStatusConnectedSpeedHigh = (kIOUSBHostConnectionSpeedHigh << IOUSBHostFamilyBitRangePhase(8, 10)), + kIOUSBHostPortStatusConnectedSpeedSuper = (kIOUSBHostConnectionSpeedSuper << IOUSBHostFamilyBitRangePhase(8, 10)), + kIOUSBHostPortStatusConnectedSpeedSuperPlus = (kIOUSBHostConnectionSpeedSuperPlus << IOUSBHostFamilyBitRangePhase(8, 10)), + kIOUSBHostPortStatusConnectedSpeedSuperPlusBy2 = (kIOUSBHostConnectionSpeedSuperPlusBy2 << IOUSBHostFamilyBitRangePhase(8, 10)), + kIOUSBHostPortStatusResetting = IOUSBHostFamilyBit(11), + kIOUSBHostPortStatusEnabled = IOUSBHostFamilyBit(12), + kIOUSBHostPortStatusSuspended = IOUSBHostFamilyBit(13), + kIOUSBHostPortStatusOvercurrent = IOUSBHostFamilyBit(14), + kIOUSBHostPortStatusTestMode = IOUSBHostFamilyBit(15) +}; + +#pragma mark Registry property names + +#define kUSBHostMatchingPropertySpeed "USBSpeed" +#define kUSBHostMatchingPropertyPortType "USBPortType" + +#define kUSBHostMatchingPropertyVendorID "idVendor" +#define kUSBHostMatchingPropertyProductID "idProduct" +#define kUSBHostMatchingPropertyProductIDMask "idProductMask" +#define kUSBHostMatchingPropertyProductIDArray "idProductArray" +#define kUSBHostMatchingPropertyDeviceClass "bDeviceClass" +#define kUSBHostMatchingPropertyDeviceSubClass "bDeviceSubClass" +#define kUSBHostMatchingPropertyDeviceProtocol "bDeviceProtocol" +#define kUSBHostMatchingPropertyDeviceReleaseNumber "bcdDevice" +#define kUSBHostMatchingPropertyConfigurationValue "bConfigurationValue" +#define kUSBHostMatchingPropertyInterfaceClass "bInterfaceClass" +#define kUSBHostMatchingPropertyInterfaceSubClass "bInterfaceSubClass" +#define kUSBHostMatchingPropertyInterfaceProtocol "bInterfaceProtocol" +#define kUSBHostMatchingPropertyInterfaceNumber "bInterfaceNumber" + +#define kUSBHostPropertyLocationID "locationID" +#define kUSBHostPropertyDebugOptions "kUSBDebugOptions" +#define kUSBHostPropertyWakePowerSupply "kUSBWakePowerSupply" +#define kUSBHostPropertySleepPowerSupply "kUSBSleepPowerSupply" +#define kUSBHostPropertyWakePortCurrentLimit "kUSBWakePortCurrentLimit" +#define kUSBHostPropertySleepPortCurrentLimit "kUSBSleepPortCurrentLimit" +#define kUSBHostPropertyFailedRemoteWake "kUSBFailedRemoteWake" +#define kUSBHostPropertyBusCurrentPoolID "UsbBusCurrentPoolID" +#define kUSBHostPropertySmcBusCurrentPoolID "UsbSmcBusCurrentPoolID" +#define kUSBHostPropertyUserClientEntitlementRequired "UsbUserClientEntitlementRequired" +#define kUSBHostPropertyUserClientEnableReset "kUSBLegacyForceReEnumerate" // TODO: Rename this +#define kUSBHostPropertyUserClientOwningTaskName "UsbUserClientOwningTaskName" +#define kUSBHostPropertyForcePower "UsbForcePower" +#define kUSBHostPropertyForcceLinkSpeed "UsbLinkSpeed" + +#define kUSBHostDevicePropertyVendorString "kUSBVendorString" +#define kUSBHostDevicePropertySerialNumberString "kUSBSerialNumberString" +#define kUSBHostDevicePropertyContainerID "kUSBContainerID" +#define kUSBHostDevicePropertyFailedRequestedPower "kUSBFailedRequestedPower" +#define kUSBHostDevicePropertyResumeRecoveryTime "kUSBResumeRecoveryTime" +#define kUSBHostDevicePropertyPreferredConfiguration "kUSBPreferredConfiguration" +#define kUSBHostDevicePropertyPreferredRecoveryConfiguration "kUSBPreferredRecoveryConfiguration" +#define kUSBHostDevicePropertyCurrentConfiguration "kUSBCurrentConfiguration" +#define kUSBHostDevicePropertyRemoteWakeOverride "kUSBRemoteWakeOverride" +#define kUSBHostDevicePropertyConfigurationDescriptorOverride "kUSBConfigurationDescriptorOverride" +#define kUSBHostDevicePropertyDeviceDescriptorOverride "kUSBDeviceDescriptorOverride" +#define kUSBHostDevicePropertyConfigurationCurrentOverride "kUSBConfigurationCurrentOverride" +#define kUSBHostDevicePropertyResetDurationOverride "kUSBResetDurationOverride" +#define kUSBHostDevicePropertyDesiredChargingCurrent "kUSBDesiredChargingCurrent" +#define kUSBHostDevicePropertyDescriptorOverride "kUSBDescriptorOverride" +#define kUSBHostDescriptorOverrideVendorStringIndex "UsbDescriptorOverrideVendorStringIndex" +#define kUSBHostDescriptorOverrideProductStringIndex "UsbDescriptorOverrideProductStringIndex" +#define kUSBHostDescriptorOverrideSerialNumberStringIndex "UsbDescriptorOverrideSerialNumberStringIndex" +#define kUSBHostDevicePropertyDeviceECID "kUSBDeviceECID" +#define kUSBHostDevicePropertyEnableLPM "kUSBHostDeviceEnableLPM" +#define kUSBHostDevicePropertyDisablePortLPM "kUSBHostDeviceDisablePortLPM" // Disable port initiated LPM for this device + +#define kUSBHostBillboardDevicePropertyNumberOfAlternateModes "bNumberOfAlternateModes" +#define kUSBHostBillboardDevicePropertyPreferredAlternateMode "bPreferredAlternateMode" +#define kUSBHostBillboardDevicePropertyVCONNPower "VCONNPower" +#define kUSBHostBillboardDevicePropertyConfigured "bmConfigured" +#define kUSBHostBillboardDevicePropertyAdditionalFailureInfo "bAdditonalFailureInfo" +#define kUSBHostBillboardDevicePropertyBcdVersion "BcdVersion" +#define kUSBHostBillboardDevicePropertySVID "wSVID" +#define kUSBHostBillboardDevicePropertyAlternateMode "bAlternateMode" +#define kUSBHostBillboardDevicePropertyAlternateModeStringIndex "iAlternateModeString" +#define kUSBHostBillboardDevicePropertyAlternateModeString "AlternateModeString" +#define kUSBHostBillboardDevicePropertyAddtionalInfoURLIndex "iAddtionalInfoURL" +#define kUSBHostBillboardDevicePropertyAddtionalInfoURL "AddtionalInfoURL" +#define kUSBHostBillboardDevicePropertydwAlternateModeVdo "dwAlternateModeVdo" + +#define kUSBHostInterfacePropertyAlternateSetting "bAlternateSetting" + +#define kUSBHostPortPropertyStatus "port-status" +#define kUSBHostPortPropertyOvercurrent "UsbHostPortOvercurrent" +#define kUSBHostPortPropertyPortNumber "port" +#define kUSBHostPortPropertyRemovable "removable" +#define kUSBHostPortPropertyTestMode "kUSBTestMode" +#define kUSBHostPortPropertySimulateInterrupt "kUSBSimulateInterrupt" +#define kUSBHostPortPropertyBusCurrentAllocation "kUSBBusCurrentAllocation" +#define kUSBHostPortPropertyBusCurrentSleepAllocation "kUSBBusCurrentSleepAllocation" +#define kUSBHostPortPropertyConnectable "UsbConnectable" +#define kUSBHostPortPropertyConnectorType "UsbConnector" +#define kUSBHostPortPropertyMux "UsbMux" +#define kUSBHostPortPropertyCompanionIndex "kUSBCompanionIndex" +#define kUSBHostPortPropertyDisconnectInterval "kUSBDisconnectInterval" +#define kUSBHostPortPropertyUsbCPortNumber "UsbCPortNumber" +#define kUSBHostPortPropertyCompanionPortNumber "UsbCompanionPortNumber" // OSData key to set/get the port number of the companion port +#define kUSBHostPortPropertyPowerSource "UsbPowerSource" + +#define kUSBHostHubPropertyPowerSupply "kUSBHubPowerSupply" // OSNumber mA available for downstream ports, 0 for bus-powered +#define kUSBHostHubPropertyIdlePolicy "kUSBHubIdlePolicy" // OSNumber ms to be used as device idle policy +#define kUSBHostHubPropertyStartupDelay "kUSBHubStartupDelay" // OSNumber ms delay before creating downstream ports +#define kUSBHostHubPropertyPortSequenceDelay "kUSBHubPortSequenceDelay" // OSNumber ms delay between port creation +#define kUSBHostHubPropertyHubPowerSupplyType "kUSBHubPowerSupplyType" // OSNumber for tPowerSupply hub is, 2 for bus-powered, 1 for self + +#define kUSBHostControllerPropertyIsochronousRequiresContiguous "kUSBIsochronousRequiresContiguous" +#define kUSBHostControllerPropertySleepSupported "kUSBSleepSupported" +#define kUSBHostControllerPropertyRTD3Supported "UsbRTD3Supported" +#define kUSBHostControllerPropertyMuxEnabled "kUSBMuxEnabled" +#define kUSBHostControllerPropertyCompanion "kUSBCompanion" // OSBoolean false to disable all companion controllers +#define kUSBHostControllerPropertyLowSpeedCompanion "kUSBLowSpeedCompanion" // OSBoolean false to disable low-speed companion controller +#define kUSBHostControllerPropertyFullSpeedCompanion "kUSBFullSpeedCompanion" // OSBoolean false to disable full-speed companion controller +#define kUSBHostControllerPropertyHighSpeedCompanion "kUSBHighSpeedCompanion" // OSBoolean false to disable high-speed companion controller +#define kUSBHostControllerPropertySuperSpeedCompanion "kUSBSuperSpeedCompanion" // OSBoolean false to disable superspeed companion controller +#define kUSBHostControllerPropertyRevision "Revision" // OSData Major/minor revision number of controller +#define kUSBHostControllerPropertyCompanionControllerName "UsbCompanionControllerName" // OSString key to set/get the name of the service, i.e. companion controller dictionary. +#define kUSBHostControllerPropertyDisableUSB3LPM "kUSBHostControllerDisableUSB3LPM" // OSBoolean true to disable USB3 LPM on a given controller +#define kUSBHostControllerPropertyDisableUSB2LPM "kUSBHostControllerDisableUSB2LPM" // OSBoolean true to disable USB2 LPM on a given controller +#define kUSBHostControllerPropertyDisableWakeSources "UsbHostControllerDisableWakeSources" // OSBoolean true to disable connect/disconnect/overcurrent wake sources +#define kUSBHostControllerPropertyPersistFullSpeedIsochronous "UsbHostControllerPersistFullSpeedIsochronous" // OSBoolean true to reduce commands related to full-speed isochronous endpoints + +#define kUSBHostPortPropertyExternalDeviceResetController "kUSBHostPortExternalDeviceResetController" +#define kUSBHostPortPropertyExternalDevicePowerController "kUSBHostPortExternalDevicePowerController" + +#define kUSBHostPortPropertyCardReader "kUSBHostPortPropertyCardReader" +#define kUSBHostPortPropertyCardReaderValidateDescriptors "kUSBHostPortPropertyCardReaderValidateDescriptors" + +#define kUSBHostPortPropertyOffset "kUSBHostPortPropertyOffset" + +#define kIOUSBHostDeviceClassName "IOUSBHostDevice" +#define kIOUSBHostInterfaceClassName "IOUSBHostInterface" + +// for IOUSBLib compatibility +#define kUSBHostDevicePropertyAddress "kUSBAddress" +#define kUSBHostDevicePropertyManufacturerStringIndex "iManufacturer" +#define kUSBHostDevicePropertySerialNumberStringIndex "iSerialNumber" +#define kUSBHostDevicePropertyProductStringIndex "iProduct" +#define kUSBHostDevicePropertyProductString "kUSBProductString" +#define kUSBHostDevicePropertyNumConfigs "bNumConfigurations" +#define kUSBHostDevicePropertyMaxPacketSize "bMaxPacketSize0" +#define kUSBHostDevicePropertyStandardVersion "bcdUSB" + +#define kUSBHostInterfacePropertyStringIndex "iInterface" +#define kUSBHostInterfacePropertyString "kUSBString" +#define kUSBHostInterfacePropertyNumEndpoints "bNumEndpoints" + +// Legacy power properties +#define kAppleMaxPortCurrent "AAPL,current-available" +#define kAppleCurrentExtra "AAPL,current-extra" +#define kAppleMaxPortCurrentInSleep "AAPL,max-port-current-in-sleep" +#define kAppleCurrentExtraInSleep "AAPL,current-extra-in-sleep" +#define kAppleExternalConnectorBitmap "AAPL,ExternalConnectorBitmap" + +#endif /* IOUSBHostFamily_IOUSBHostFamilyDefinitions_h */ diff --git a/QualcommWireless/include/IOKit/usb/IOUSBHostHIDDevice.h b/QualcommWireless/include/IOKit/usb/IOUSBHostHIDDevice.h new file mode 100644 index 0000000..5d2088d --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBHostHIDDevice.h @@ -0,0 +1,260 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef IOUSBHOSTHIDDEVICE_H +#define IOUSBHOSTHIDDEVICE_H + +#include <IOKit/IOBufferMemoryDescriptor.h> + +#include <IOKit/hid/IOHIDDevice.h> + +#include <IOKit/usb/IOUSBHostInterface.h> +#include <IOKit/usb/StandardUSB.h> +#include <IOKit/usb/USBSpec.h> +#include <IOKit/usb/IOUSBHostFamily.h> +#include <IOKit/IOTimerEventSource.h> + + +#define ENABLE_HIDREPORT_LOGGING 0 + +enum +{ + kInterruptRetries = 10, + kErrorRecoveryInterval = 50 // Milliseconds +}; + +// from IOHIDDescriptorParser.h: +// // types of HID reports (input, output, feature) +// enum +// { +// kHIDInputReport = 1, +// kHIDOutputReport, +// kHIDFeatureReport, +// kHIDUnknownReport = 255 +// }; +// +// Report types from high level HID Manager: +// from IOHIDKeys.h: +// enum IOHIDReportType +// { +// kIOHIDReportTypeInput = 0, +// kIOHIDReportTypeOutput, +// kIOHIDReportTypeFeature, +// kIOHIDReportTypeCount +// }; +// +#define HID_MGR_2_USB_REPORT_TYPE(x) (x + 1) + +#define USB_2_HID_MGR_REPORT_TYPE(x) (x - 1) + +#define kHIDDriverRetryCount 3 + +#define kUSBHIDReportLoggingLevel "USB HID Report Logging Level" + +#define kUSBHID_DeviceIdleTimeout "Device Idle Timeout" + +#define kUSBHID_IoIdleTimeout "I/O Idle Timeout" + +#define kUSBHostHIDDevicePropertyIdlePolicy "kUSBHIDDeviceIdlePolicy" + +/*! + @typedef IOUSBHostHIDDescriptor + @discussion USB HID Descriptor. See the USB HID Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. (This structure + should have used the #pragma pack(1) compiler directive to get byte alignment. + */ +struct IOUSBHostHIDDescriptor : public StandardUSB::Descriptor +{ + uint16_t descVersNum; + uint8_t hidCountryCode; + uint8_t hidNumDescriptors; + uint8_t hidDescriptorType; + uint8_t hidDescriptorLengthLo; + uint8_t hidDescriptorLengthHi; +} __attribute__((packed)); + +/*! + @typedef IOUSBHIDReportDesc + @discussion USB HID Report Descriptor header. See the USB HID Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. (This structure + should have used the #pragma pack(1) compiler directive to get byte alignment. + */ +struct IOUSBHostHIDReportDescriptor +{ + uint8_t hidDescriptorType; + uint8_t hidDescriptorLengthLo; + uint8_t hidDescriptorLengthHi; +} __attribute__((packed)); + +/*! + @class IOUSBHostHIDDevice + @abstract Driver that matches to USB HID devices. + @discussion This class can be overriden to provide for specific behaviors. + */ +class IOUSBHostHIDDevice : public IOHIDDevice +{ + OSDeclareDefaultStructors(IOUSBHostHIDDevice) + +private: + typedef struct IOUSBHidExpansionData + { + uint8_t _bInterfaceNumber; + } tIOUSBHidExpansionData; + + tIOUSBHidExpansionData *_expansionData; + + typedef struct + { + IOUSBHostCompletion usbCompletion; + IOHIDCompletion* hidCompletion; + IOMemoryDescriptor* report; + } tAsyncContext; + + +protected: + IOWorkLoop *_workLoop; + IOCommandGate *_gate; + IOUSBHostDevice *_device; + IOUSBHostInterface *_interface; + IOUSBHostPipe *_interruptPipe; + IOUSBHostPipe *_interruptOutPipe; + IOBufferMemoryDescriptor *_buffer; + IOMemoryDescriptor *_zlpDescriptor; + IOUSBHostCompletion _completion; + IOUSBHostCompletion _zlpCompletion; + bool _interruptReadPending; + uint32_t _interruptOutMaxSize; + uint32_t _zlpBuffer; + uint32_t _debugLoggingMask; + int32_t _interruptRetries; + IOTimerEventSource *_interruptRetriesTimer; + + // IOHIDDevice Methods + virtual bool handleStart (IOService *provider) APPLE_KEXT_OVERRIDE; + virtual void interruptRetry(IOTimerEventSource* timer); + + // IOUSBHIDDevice Methods + virtual IOReturn setProtocol (uint16_t protocol); + + virtual OSString* getStringAtIndex (uint8_t index, uint16_t lang = 0x0409) const; + + virtual IOReturn getHidDescriptor (uint8_t inDescriptorType, uint8_t inDescriptorIndex, uint8_t *vOutBuf, uint32_t *vOutSize) const; + + virtual IOReturn getHidDescriptorGated (uint8_t inDescriptorType, uint8_t inDescriptorIndex, uint8_t *vOutBuf, uint32_t *vOutSize) const; + + virtual IOReturn readInterruptPipeAsync (void); + + virtual IOReturn readInterruptPipeAsyncGated (void); + + virtual void interruptReadComplete (void *parameter, IOReturn status, uint32_t bytesTransferred); + + virtual void setReportComplete (void *parameter, IOReturn status, uint32_t bytesTransferred); + + virtual void zlpWriteComplete (void *parameter, IOReturn status, uint32_t bytesTransferred); + + // Protected pad slots for future expansion + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 0); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 1); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 2); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 3); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 4); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 5); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 6); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 7); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 8); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 9); + +public: + // IOService Methods + virtual bool start (IOService *provider) APPLE_KEXT_OVERRIDE; + + virtual bool willTerminate (IOService *provider, IOOptionBits options) APPLE_KEXT_OVERRIDE; + + virtual void stop (IOService *provider) APPLE_KEXT_OVERRIDE; + + virtual void free (void) APPLE_KEXT_OVERRIDE; + + virtual bool setProperty(const OSSymbol* aKey, OSObject* anObject) APPLE_KEXT_OVERRIDE; + + virtual bool setProperty(const OSString* aKey, OSObject* anObject) APPLE_KEXT_OVERRIDE; + + virtual bool setProperty(const char* aKey, OSObject* anObject) APPLE_KEXT_OVERRIDE; + + virtual bool setProperty(const char* aKey, const char * aString) APPLE_KEXT_OVERRIDE; + + virtual bool setProperty(const char* aKey, bool aBoolean) APPLE_KEXT_OVERRIDE; + + virtual bool setProperty(const char* aKey, unsigned long long aValue, unsigned int aNumberOfBits) APPLE_KEXT_OVERRIDE; + + virtual bool setProperty(const char* aKey, void* bytes, unsigned int length) APPLE_KEXT_OVERRIDE; + + + // IOHIDDevice Methods + virtual IOReturn newReportDescriptor (IOMemoryDescriptor **descriptor ) const APPLE_KEXT_OVERRIDE; + + virtual OSString* newTransportString (void) const APPLE_KEXT_OVERRIDE; + + virtual OSString* newManufacturerString (void) const APPLE_KEXT_OVERRIDE; + + virtual OSString* newProductString (void) const APPLE_KEXT_OVERRIDE; + + virtual OSString* newSerialNumberString (void) const APPLE_KEXT_OVERRIDE; + + virtual OSNumber* newVendorIDNumber (void) const APPLE_KEXT_OVERRIDE; + + virtual OSNumber* newProductIDNumber (void) const APPLE_KEXT_OVERRIDE; + + virtual OSNumber* newVersionNumber (void) const APPLE_KEXT_OVERRIDE; + + virtual OSNumber* newLocationIDNumber (void) const APPLE_KEXT_OVERRIDE; + + virtual OSNumber* newCountryCodeNumber (void) const APPLE_KEXT_OVERRIDE; + + virtual IOReturn getReport (IOMemoryDescriptor *report, IOHIDReportType reportType, IOOptionBits options) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setReport (IOMemoryDescriptor *report, IOHIDReportType reportType, IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + + virtual IOReturn setReport(IOMemoryDescriptor * report, IOHIDReportType reportType, IOOptionBits options, UInt32 completionTimeout, IOHIDCompletion* completion = 0) APPLE_KEXT_OVERRIDE; + + + // IOUSBHIDDevice Methods + virtual IOReturn SetIdleMillisecs (UInt16 msecs); + + virtual UInt32 getMaxReportSize (void) const; + + virtual OSString* newIndexedString (UInt8 index) const; + + virtual OSNumber* newReportIntervalNumber() const APPLE_KEXT_OVERRIDE; + + // Public pad slots for future expansion + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 10); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 11); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 12); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 13); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 14); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 15); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 16); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 17); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 18); + OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 19); +}; + +#endif // IOUSBHOSTHIDDEVICE_H diff --git a/QualcommWireless/include/IOKit/usb/IOUSBHostIOSource.h b/QualcommWireless/include/IOKit/usb/IOUSBHostIOSource.h new file mode 100644 index 0000000..a4cc25e --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBHostIOSource.h @@ -0,0 +1,406 @@ +/* + * Copyright (c) 1998-2016 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/*! + @header IOUSBHostIOSource.h + @brief IOUSBHostIOSource is the base class for objects that perform USB IO. + */ + +#ifndef IOUSBHostFamily_IOUSBHostIOSource_h +#define IOUSBHostFamily_IOUSBHostIOSource_h + +#include <sys/queue.h> +#include <libkern/c++/OSObject.h> +#include <IOKit/IOCommandGate.h> +#include <IOKit/IOTimerEventSource.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/usb/IOUSBHostFamily.h> + +#define kUSBHostTransferLimit (1024) + +class AppleUSBHostController; +class IOUSBHostDevice; +class AppleUSBRequestPool; + +typedef void (*IOUSBHostCompletionAction)(void* owner, void* parameter, IOReturn status, uint32_t bytesTransferred); + +/*! + * @struct IOUSBHostCompletion + * @discussion Struture describing the completion callback for an asynchronous bulk, control, or interrupt IO operation + * @field owner Pointer to an object that owns the transfer. May be used as <code>this</code> for an action passed via OSMemberFunctionCast. + * @field action IOUSBHostCompletionAction to run when the IO request completes. + * @field parameter Pointer to be used as context within the completion action. + */ +struct IOUSBHostCompletion +{ + void* owner; + IOUSBHostCompletionAction action; + void* parameter; +}; + +typedef void (*IOUSBHostBundledCompletionAction)(void *owner, uint32_t ioCompletionCount, IOMemoryDescriptor** dataBufferArray, void** parameter, IOReturn* statusArray, uint32_t* actualByteCountArray); + +/*! + * @struct IOUSBHostBundledCompletion + * @discussion Struture describing the completion callback for an asynchronous bulk, control, or interrupt IO operation + * @field owner Pointer to an object that owns the transfer. May be used as <code>this</code> for an action passed via OSMemberFunctionCast. + * @field action IOUSBHostBundledCompletion to run when the IO request completes. + * @field parameter Pointer to be used as context within the completion action. + */ +struct IOUSBHostBundledCompletion +{ + void* owner; + IOUSBHostBundledCompletionAction action; + void* parameter; +}; + + + +/*! + * @struct IOUSBHostIsochronousFrame + * @discussion Structure representing a single frame in an isochronous transfer. + * @field status Completion status for this individual frame. IOUSBHostFamily will initialize this to kIOReturnInvalid and will update the field with a valid status code upon completion of the frame. + * @field requestCount The number of bytes requested to transfer for this frame. This field must be initialized by the caller before this structure is submitted to IOUSBHostFamily. + * @field completeCount The number of bytes actually transferred for this frame. IOUSBHostFamily will update this field upon completion of the frame. + * @field reserved Reserved for future use. + * @field timeStamp The observed AbsoluteTime for this frame's completion. Note that interrupt latency and system load may result in more than one frame completing with the same timestamp. + */ +struct IOUSBHostIsochronousFrame +{ + IOReturn status; + uint32_t requestCount; + uint32_t completeCount; + uint32_t reserved; + AbsoluteTime timeStamp; +} __attribute__((packed)); + +typedef void (*IOUSBHostIsochronousCompletionAction)(void* owner, void* parameter, IOReturn status, IOUSBHostIsochronousFrame* frameList); + +/*! + * @struct IOUSBHostIsochronousCompletion + * @discussion Struture describing the completion callback for an asynchronous isochronous operation + * @field owner Pointer to an object that owns the transfer. May be used as <code>this</code> for an action passed via OSMemberFunctionCast. + * @field action IOUSBHostIsochronousCompletionAction to run when the IO request completes. + * @field parameter Pointer to be used as context within the completion action. + */ +struct IOUSBHostIsochronousCompletion +{ + void* owner; + IOUSBHostIsochronousCompletionAction action; + void* parameter; +}; + +typedef LIST_HEAD (IOUSBHostIOSourceClientRecordList, IOUSBHostIOSourceClientRecord) IOUSBHostIOSourceClientRecordList; +typedef LIST_ENTRY (IOUSBHostIOSourceClientRecord) IOUSBHostIOSourceClientRecordLink; + +struct IOUSBHostIOSourceClientRecord +{ + IOService* forClient; + UInt32 outstandingIO; + IOUSBHostIOSourceClientRecordLink link; +}; + +/*! + * @struct tPacketFilterMetadata + * @discussion Struture providing information about the IOUSBHostIOSource's parents + * @field deviceAddress Address of the parent IOUSBHostDevice. + * @field interfaceClass If enpointAddress is non-zero, the class of the parent IOUSBHostInteface. + * @field interfaceSubClass If enpointAddress is non-zero, the sub-class of the parent IOUSBHostInteface. + * @field interfaceProtocol If enpointAddress is non-zero, the protocol of the parent IOUSBHostInteface. + * @field interfaceAltSetting Current alternate setting of the parent IOUSBHostInterface. + * @field endpointAddress The address of the endpoint including the direction. + * @field endpointType See tEndpointType in IOUSBHostFamily.h. + * @field speed See tUSBHostConnectionSpeed in IOUSBHostFamily.h. + * @field vid Vendor ID of the parent IOUSBHostDevice. + * @field pid Product ID of the parent IOUSBHostDevice. + * @field locationID USB locationID of the parent IOUSBHostDevice. + */ +struct tPacketFilterMetadata +{ + uint8_t deviceAddress; + uint8_t interfaceClass; + uint8_t interfaceSubclass; + uint8_t interfaceProtocol; + uint8_t interfaceAltSetting; + uint8_t endpointAddress; + uint8_t endpointType; + uint8_t speed; + uint16_t vid; + uint16_t pid; + uint32_t locationID; +} __attribute__((packed)); + +/*! + * @class IOUSBHostIOSource + * @brief The base class for objects that perform USB IO. + * @discussion This class provides functionality to transfer data across USB. Function drivers should not subclass IOUSBHostIOSource. + */ +class __IOUSBHOSTFAMILY_DEPRECATED IOUSBHostIOSource : public OSObject +{ + friend class AppleUSBIORequest; + friend class IOUSBHostInterface; + + OSDeclareAbstractStructors(IOUSBHostIOSource) + +protected: + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual bool initWithOwners(AppleUSBHostController* controller, IOUSBHostDevice* device); + + OSMetaClassDeclareReservedUsed(IOUSBHostIOSource, 0); + virtual IOReturn open(); + + OSMetaClassDeclareReservedUsed(IOUSBHostIOSource, 1); + virtual IOReturn openGated(); + + OSMetaClassDeclareReservedUsed(IOUSBHostIOSource, 2); + virtual IOReturn destroy(); + + OSMetaClassDeclareReservedUsed(IOUSBHostIOSource, 3); + virtual IOReturn destroyGated(); + + // Pad slots for future expansion + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 4); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 5); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 6); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 7); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 8); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 9); + +public: + /*! + * @enum tState + * @namespace IOUSBHostIOSource + * @brief Return value for <code>getState()</code> + * @constant kStateReady The I/O source is idle and fully-functional. + * @constant kStateRunningCompletions The I/O source is currently running completions. + * @constant kStateAborting The I/O source is currently aborting all requests. + * @constant kStateInactive The I/O source has been closed. + */ + enum tState + { + kStateReady, + kStateRunningCompletions, + kStateAborting, + kStateInactive, + kStateDestroyed + }; + + /*! + * @brief Returns the current state of the I/O source. + * @result @link tState @/link + */ + virtual tState getState(); + + /*! + * @enum tAbortOptions + * @brief Options for <code>abort()</code> + * @constant kAbortAsynchronous abort() should return immediately without waiting for the aborted IO to complete + * @constant kAbortSynchronous abort() should not return until the aborted IO has completed + */ + enum tAbortOptions + { + kAbortAsynchronous = 0x0, + kAbortSynchronous = 0x1 + }; + + /*! + * @brief Abort pending I/O requests. + * @discussion This method will abort all pending I/O requests. If <code>options</code> includes <code>kAbortSynchronous</code>, this method will block any new IO requests unless they are submitted from an aborted IO's completion routine. + * @param options tAbortOptions + * @param withError IOReturn error value to return with the requests. The default value of kIOReturnAborted should be used. + * @param forClient Service for which to abort requests. If NULL, all requests will be aborted. Only control endpoints can specify a non-NULL value. + * @return IOReturn result code + */ + virtual IOReturn abort(IOOptionBits options = kAbortAsynchronous, IOReturn withError = kIOReturnAborted, IOService* forClient = NULL); + + // Public pad slots for future expansion + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 10); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 11); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 12); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 13); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 14); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 15); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 16); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 17); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 18); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 19); + +protected: + // Protected pad slots for future expansion + OSMetaClassDeclareReservedUsed(IOUSBHostIOSource, 20); + virtual UInt32 getOutstandingIO(IOService* forClient); + + OSMetaClassDeclareReservedUsed(IOUSBHostIOSource, 21); + virtual UInt32 adjustOutstandingIO(IOService* forClient, SInt32 increment); + + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 22); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 23); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 24); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 25); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 26); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 27); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 28); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 29); + +protected: + struct tSynchronousParameter + { + uint32_t bytesTransferred; + IOReturn status; + }; + + virtual void synchronousCompletion(void* parameter, IOReturn status, uint32_t bytesTransferred); + virtual void synchronousIsochronousCompletion(void* parameter, IOReturn status, IOUSBHostIsochronousFrame* pFrames); + + virtual IOReturn getStateGated(tState& state); + + virtual IOReturn close(); + + virtual IOReturn closeGated(); + + virtual IOReturn abortGated(IOOptionBits options, IOReturn withError, IOService* forClient); + + virtual void timerCompletion(IOTimerEventSource* timer); + + AppleUSBHostController* _controller; + IOUSBHostDevice* _device; + + IOWorkLoop* _workloop; + IOCommandGate* _commandGate; + IOTimerEventSource* _timer; + AppleUSBRequestPool* _requestPool; + + tState _state; + UInt32 _outstandingIO; + UInt32 _completionRunning; + +#pragma mark IO +public: + /*! + * @brief Enqueue an IO request on the source + * @discussion This method is used to issue an asynchronous I/O request on a bulk or interrupt pipe. See IOUSBHostPipe::io and IOUSBHostStream::io for object-specific interface notes. + * @param dataBuffer IOMemoryDescriptor pointer containing the buffer to use for the transfer + * @param dataBufferLength Length of the request. Must be <= <code>dataBuffer->getLength()</code> + * @param completion Pointer to a IOUSBHostCompletion structure. This will be copied and can therefore be stack-allocated. + * @param completionTimeoutMs Timeout of the request in milliseconds. If 0, the request will never timeout. Must be 0 for interrupt pipes and streams. + * @return kIOReuturnSuccess if the completion will be called in the future, otherwise error + */ + virtual IOReturn io(IOMemoryDescriptor* dataBuffer, uint32_t dataBufferLength, IOUSBHostCompletion* completion, uint32_t completionTimeoutMs = 0); + + /*! + * @brief Perform an IO request on the source + * @discussion This method will send a synchronous request on the IO source, and will not return until the request is complete. This method will acquire the service's workloop lock, and will call commandSleep to send the request. See IOUSBHostPipe::io and IOUSBHostStream::io for object-specific interface notes. + * @param dataBuffer IOMemoryDescriptor pointer containing the buffer to use for the transfer + * @param dataBufferLength Length of the request. Must be <= <code>dataBuffer->getLength()</code> + * @param bytesTransferred uint32_t reference which will be updated with the bytes transferred during the request + * @param completionTimeoutMs Timeout of the request in milliseconds. If 0, the request will never timeout. Must be 0 for interrupt pipes and streams. + * @return IOReturn value indicating the result of the IO request + */ + virtual IOReturn io(IOMemoryDescriptor* dataBuffer, uint32_t dataBufferLength, uint32_t& bytesTransferred, uint32_t completionTimeoutMs = 0); + + + OSMetaClassDeclareReservedUsed(IOUSBHostIOSource, 30); + + /*! + * @brief Enqueue an IO request on the source + * @discussion This method is used to issue an asynchronous I/O request on a bulk or interrupt pipe that will trigger a IOUSBHostBundledCompletionAction callback. + * I/O requests enqueued with this method may be completed in bundles that may reduce the total number of callbacks. + * The 'ioCompletionCount' callback parameter indicates the number of completed I/Os associated with this callback and the size of the + * 'dataBufferArray', 'statusArray' and' actualByteCountArray. Clients must iterate over these arrays to extract the completion status/length + * of each individual IOMemoryDescriptor. + * See IOUSBHostPipe::io and IOUSBHostStream::io for object-specific interface notes. + * @param dataBuffer IOMemoryDescriptor pointer containing the buffer to use for the transfer + * @param dataBufferLength Length of the request. Must be <= <code>dataBuffer->getLength()</code> + * @param completion Pointer to a IOUSBHostBundledCompletion structure. This will be copied and can therefore be stack-allocated. + * @param completionTimeoutMs Timeout of the request in milliseconds. If 0, the request will never timeout. Must be 0 for interrupt pipes and streams. + * @return kIOReuturnSuccess if the completion will be called in the future, otherwise error + */ + virtual IOReturn io(IOMemoryDescriptor* dataBuffer, uint32_t dataBufferLength, IOUSBHostBundledCompletion* completion, uint32_t completionTimeoutMs = 0); + + + + + // Public pad slots for IO + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 31); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 32); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 33); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 34); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 35); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 36); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 37); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 38); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 39); + +protected: + // Protected pad slots for IO + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 40); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 41); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 42); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 43); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 44); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 45); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 46); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 47); + OSMetaClassDeclareReservedUnused(IOUSBHostIOSource, 48); + +protected: + struct tInternalDataTransferParameters + { + IOMemoryDescriptor* dataBuffer; + uint32_t dataBufferLength; + uint32_t* bytesTransferred; + IOUSBHostCompletion* completion; + IOUSBHostBundledCompletion* bundledCompletion; + uint32_t completionTimeoutMs; + IOUSBHostIsochronousFrame* frameList; + uint32_t frameListCount; + uint64_t firstFrameNumber; + IOUSBHostIsochronousCompletion* isochronousCompletion; + }; + + OSMetaClassDeclareReservedUsed(IOUSBHostIOSource, 49); + virtual IOReturn ioBundledGated(tInternalDataTransferParameters& parameters); + + virtual IOReturn ioGated(tInternalDataTransferParameters& parameters); + + struct tExpansionData + { + IOUSBHostIOSourceClientRecordList _ioRecordList; + tPacketFilterMetadata _metadata; + void* _dkMemoryDescriptorRing; + IOCommandGate* _controllerCommandGate; + }; + + tExpansionData* _expansionData; + +#pragma mark Debug + uint32_t _debugLoggingMask; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/usb/IOUSBHostInterface.h b/QualcommWireless/include/IOKit/usb/IOUSBHostInterface.h new file mode 100644 index 0000000..5a1f97c --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBHostInterface.h @@ -0,0 +1,551 @@ +/* + * Copyright (c) 1998-2016 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/*! + @header IOUSBHostInterface.h + @brief IOUSBHostInterface is an IOService representing a USB interface. + @discussion + + <h3>Session Management</h3> + + A driver that has successfully matched on an IOUSBHostInterface is able to take ownership of the interface by calling the <code>open</code> method defined by IOService on the IOUSBHostInterface. Once <code>open</code> has completed successfully, the driver has an open session, and may use the deviceRequest interface to send control requests, the selectAlternateSetting interface to change the endpoints and behavior of the interface. + + When the driver is finished with control of the IOUSBHostInterface, it must call <code>close</code> to end its session. Calling <code>close</code> will synchronously abort any IO associated with that session, including requests on the control endpoint. If the interface is terminating for any reason, such as the device being unplugged, the driver must call <code>close</code> on the IOUSBHostInterface, or termination will be blocked and the port will not register newly attached devices for matching. The willTerminate call into the driver is the recommended location to call <code>close</code>. + + <h3>deviceRequest Interface</h3> + + The <code>deviceRequest</code> methods are used to send control requests to the device's default endpoint. The <code>deviceRequest</code> methods may not be used for the following standard requests: + <ul> + <li>CLEAR_FEATURE ENDPOINT_HALT (USB 2.0 9.4.1) - Use <code>IOUSBHostPipe::clearStall</code> to send this request</li> + <li>SET_ADDRESS (USB 2.0 9.4.6)</li> + <li>SET_CONFIGURATION (USB 2.0 9.4.7) - Use <code>setConfiguration</code> to send this request</li> + <li>SET_INTERFACE (USB 2.0 9.4.10) - Use <code>IOUSBHostInterface::selectAlternateSetting</code> to send this request</li> + </ul> + + <h3>IOUSBInterface Migration</h3> + + IOUSBHostInterface serves as a replacement for IOUSBInterface. Clients that previously matched on IOUSBInterface can use the following guide to convert to IOUSBHostInterface. + + <code>virtual const IOUSBInterfaceDescriptor* IOUSBInterface::FindNextAltInterface(const IOUSBInterfaceDescriptor*, IOUSBFindInterfaceRequest*);</code><br> + Replacement: <code>StandardUSB::getNextInterfaceDescriptor(...);</code> + + <code>virtual IOUSBPipe* IOUSBInterface::FindNextPipe(IOUSBHostPipe*, IOUSBFindEndpointRequest*);<br> + virtual IOUSBPipe* IOUSBInterface::FindNextPipe(IOUSBHostPipe*, IOUSBFindEndpointRequest*, bool);</code><br> + Replacement: + <pre>const EndpointDescriptor* endpointCandidate = NULL; +IOUSBHostPipe* foundPipe = NULL; +while((endpointCandidate = StandardUSB::getNextAssociatedDescriptorWithType(getConfigurationDescriptor(), getInterfaceDescriptor(), endpointCandidate, kDescriptorTypeEndpoint)) != NULL) +{ + if(endpointCandidate->bEndpointAddress == desiredAddress>) + { + foundPipe = copyPipe(StandardUSB::getEndpointAddress(endpointCandidate)); + break; + } +}</pre> + + <code>virtual const IOUSBDescriptorHeader* IOUSBInterface::FindNextAssociatedDescriptor(const void*, UInt8);</code><br> + Replacement: <code>StandardUSB::getNextAssociatedDescriptorWithType(getConfigurationDescriptor(), getInterfaceDescriptor(), currentDescriptor, type);</code> + + <code>virtual IOReturn IOUSBInterface::SetAlternateInterface(IOService*, UInt16); + Replacement: <code>selectAlternateSetting(...);</code> + + <code>virtual IOUSBHostPipe* IOUSBInterface::GetPipeObj(UInt8);<br> + virtual IOUSBHostPipe* IOUSBInterface::GetPipeObjRetain(UInt8);</code><br> + Replacement: <code>copyPipe(endpointAddress);</code><br> + Note that <code>copyPipe</code> behaves like <code>GetPipeObjRetain</code>, and the returned pipe must be released by the caller during termination. + + <code>virtual UInt8 IOUSBInterface::GetConfigValue();</code><br> + Replacement: <code>getConfigurationDescriptor()->bConfigurationValue;</code> + + <code>virtual IOUSBHostDevice* IOUSBInterface::GetDevice();</code><br> + Replacement: + <pre>// Function drivers should not assume the immediate provider of an IOUSBHostInterface is an IOUSBHostDevice. +IOService* deviceCandidate = getProvider(); +IOUSBHostDevice* device = NULL; +while(deviceCandidate != NULL) +{ + device = OSDynamicCast(IOUSBHostDevice, deviceCandidate); + if(device != NULL) + { + break; + } + + deviceCandidate = deviceCandidate->getProvider(); +}</pre> + + <code>virtual UInt8 IOUSBInterface::GetInterfaceNumber();</code><br> + Replacement: <code>getInterfaceDescriptor()->bInterfaceNumber;</code> + + <code>virtual UInt8 IOUSBInterface::GetAlternateSetting();</code><br> + Replacement: <code>getInterfaceDescriptor()->bAlternateSetting;</code> + + <code>virtual UInt8 IOUSBInterface::GetNumEndpoints();</code><br> + Replacement: <code>getInterfaceDescriptor()->bNumEndpoints;</code> + + <code>virtual UInt8 IOUSBInterface::GetInterfaceClass();</code><br> + Replacement: <code>getInterfaceDescriptor()->bInterfaceClass;</code> + + <code>virtual UInt8 IOUSBInterface::GetInterfaceSubClass();</code><br> + Replacement: <code>getInterfaceDescriptor()->bInterfaceSubClass;</code> + + <code>virtual UInt8 IOUSBInterface::GetInterfaceProtocol();</code><br> + Replacement: <code>getInterfaceDescriptor()->bInterfaceProtocol;</code> + + <code>virtual UInt8 IOUSBInterface::GetInterfaceStringIndex();</code><br> + Replacement: <code>getInterfaceDescriptor()->iInterface;</code> + + <code>virtual IOReturn IOUSBInterface::DeviceRequest(IOUSBDevRequest* request, IOUSBCompletion* completion = 0);<br> + virtual IOReturn IOUSBInterface::DeviceRequest(IOUSBDevRequestDesc* request, IOUSBCompletion* completion = 0);</code><br> + Replacement: <code>deviceRequest(...)</code> + + <code>virtual IOReturn IOUSBInterface::GetEndpointProperties(UInt8 alternateSetting, UInt8 endpointNumber, UInt8 direction, UInt8* transferType, UInt16* maxPacketSize, UInt8* interval);<br> + virtual IOReturn GetEndpointPropertiesV3(IOUSBEndpointProperties*);</code><br> + Replacement: Use <code>StandardUSB::getEndpoint*</code> methods to retrieve endpoint properties. + + <code>virtual IOReturn RememberStreams();</code><br> + Replacement: none + + <code>virtual IOReturn RecreateStreams();</code><br> + Replacement: none + + <code>virtual void UnlinkPipes();</code><br> + Replacement: none + + <code>virtual void ReopenPipes();</code><br> + Replacement: none + + <code>virtual IOReturn GetInterfaceStatus(USBStatus*);</code><br> + Replacement: Use <code>deviceRequest(...)</code> to manually craft the control request. + + <code>virtual IOReturn SetFunctionSuspendFeature(UInt8);</code><br> + Replacement: It is not recommended for function drivers to send this request. + + <code>virtual IOReturn EnableRemoteWake(bool);</code><br> + Replacement: Use <code>deviceRequest(...)</code> to manually craft the control request. <code>IOUSBHostDevice::setConfiguration</code> will automatically enable remote wake if the descriptors indicate it is supported. + */ + +#ifndef IOUSBHostFamily_IOUSBHostInterface_h +#define IOUSBHostFamily_IOUSBHostInterface_h + +#include <IOKit/IOService.h> +#include <libkern/c++/OSData.h> + +#include <IOKit/usb/IOUSBHostFamily.h> +#include <IOKit/usb/IOUSBHostDevice.h> + +#if TARGET_OS_OSX +#include <USBDriverKit/IOUSBHostInterface.h> +#endif + +/*! + * @class IOUSBHostInterface + * @brief The IOService object representing a USB interface + * @discussion This class provides functionality to send control requests to the default control endpoint, as well as create IOUSBHostPipe objects to transfer data. Function drivers should not subclass IOUSBHostInterface. + */ +class __IOUSBHOSTFAMILY_DEPRECATED IOUSBHostInterface : public IOService +{ +#if TARGET_OS_OSX + OSDeclareDefaultStructorsWithDispatch(IOUSBHostInterface) +#else + OSDeclareDefaultStructors(IOUSBHostInterface) +#endif + +public: + /* + * @brief Factory method for creating an IOUSBHostInterface object + * @discussion This method should not be called by function drivers. To create an IOUSBHostInterface, use IOUSBHostDevice::setConfiguration(...) + * @param configurationDescriptor Descriptor for the configuration this interface belongs to + * @param interfaceDescriptor Descriptor for this interface's default alt setting + * @return Pointer to an IOUSBHostInterface object if successful, otherwise NULL + */ + static IOUSBHostInterface* withDescriptors(const StandardUSB::ConfigurationDescriptor* configurationDescriptor, const StandardUSB::InterfaceDescriptor* interfaceDescriptor); + +protected: + virtual bool initWithDescriptors(const StandardUSB::ConfigurationDescriptor* configurationDescriptor, const StandardUSB::InterfaceDescriptor* interfaceDescriptor); + + // Pad slots for future expansion + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 0); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 1); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 2); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 3); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 4); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 5); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 6); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 7); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 8); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 9); + +#pragma mark IOService overrides +public: + // The following methods, with the notable exception of <code>open</code> and <code>close</code> should be considered private and should not be called by function drivers. For a discussion of proper usage for <code>open</code> and <code>close</code>, see the discussion of "Session Management" above. + virtual bool attach(IOService* provider) APPLE_KEXT_OVERRIDE; + virtual bool start(IOService* provider) APPLE_KEXT_OVERRIDE; + virtual bool terminate(IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService* provider) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + + virtual bool compareProperty(OSDictionary* matching, const char* key) APPLE_KEXT_OVERRIDE; + virtual bool compareProperty(OSDictionary* matching, const OSString* key) APPLE_KEXT_OVERRIDE; + virtual bool matchPropertyTable(OSDictionary* table, SInt32* score) APPLE_KEXT_OVERRIDE; + virtual bool matchPropertyTable(OSDictionary* table) APPLE_KEXT_OVERRIDE; + + + enum + { + kOpenOptionsSelectAlternateInterface = kUSBHostOpenOptionSelectAlternateSetting + } __attribute__((deprecated)); + + /*! @functiongroup IOService overrides */ + + /*! + * @brief Open a session to the IOUSBHostInterface + * @discussion This method opens a session to an IOUSBHostInterface. It will acquire the service's workloop lock. Only one service may open a session at a time. + * @param forClient The IOService that is opening a session. + * @param options See IOService.h, <code>kOpenOptionsSelectAlternateInterface</code> in the options mask will immediately select the alternate setting passed by value through the <code>arg</code> parameter + * @param arg See IOService.h, or the value of the alt setting to use if <code>kUSBHostOpenOptionSelectAlternateSetting</code> is included in the options mask + * @return bool true if the session could be opened, otherwise false. + */ + virtual bool open(IOService* forClient, IOOptionBits options = 0, void* arg = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @brief Close a session to the IOUSBHostInterface + * @discussion This method closes an open session to an IOUSBHostInterface. It will acquire the service's workloop lock, abort any IO for the interface and its endpoints, and may call commandSleep to allow processing of aborted IO before returning. + * @param forClient The IOService that is closing its session. + * @param options See IOService.h + */ + virtual void close(IOService* forClient, IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + + virtual IOReturn newUserClient(task_t owningTask, void* securityID, UInt32 type, IOUserClient** handler) APPLE_KEXT_OVERRIDE; + + virtual IOReturn message(UInt32 type, IOService* provider, void* argument = 0) APPLE_KEXT_OVERRIDE; + + virtual const char* stringFromReturn(IOReturn code) APPLE_KEXT_OVERRIDE; + +protected: + virtual IOReturn openGated(IOService* forClient, IOOptionBits options, void* arg); + virtual IOReturn closeGated(IOService* forClient, IOOptionBits options); + + // Pad slots for IOService overrides + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 10); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 11); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 12); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 13); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 14); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 15); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 16); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 17); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 18); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 19); + +protected: + IOCommandGate* _commandGate; + IOWorkLoop* _workLoop; + +#pragma mark Power management +public: + /*! @functiongroup Power management */ + + /*! + * @brief Sets the desired idle suspend timeout for the interface + * @discussion Once the interface is considered idle, it will defer electrical suspend of the device for the specified duration. For a more complete discussion of idle policies, refer to "Idle suspend" in IOUSBHostFamily.h. + * @param deviceIdleTimeout The amount of time, in milliseconds, after all pipes are idle to wait before suspending the device. + * @return IOReturn result code + */ + virtual IOReturn setIdlePolicy(uint32_t deviceIdleTimeout); + + /*! + * @brief Retrieve the current idle suspend timeout. See @link setIdlePolicy @/link + * @return The amount of time, in milliseconds, after all pipes are idle to wait before suspending the device, + */ + virtual uint32_t getIdlePolicy(); + + // Public pad slots for power management + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 20); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 21); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 22); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 23); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 24); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 25); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 26); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 27); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 28); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 29); + +protected: + // Protected pad slots for power management + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 30); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 31); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 32); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 33); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 34); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 35); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 36); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 37); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 38); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 39); + +protected: + uint32_t _deviceIdleTimeout; + +#pragma mark Descriptors +public: + /*! @functiongroup Descriptors */ + + /*! + * @brief Retrieve the configuration descriptor in which this interface is defined + * @return ConfigurationDescriptor pointer + */ + virtual const StandardUSB::ConfigurationDescriptor* getConfigurationDescriptor(); + + /*! + * @brief Retrieve the interface descriptor associated with this interface + * @return InterfaceDescriptor pointer + */ + virtual const StandardUSB::InterfaceDescriptor* getInterfaceDescriptor(); + + /*! + * @brief Return a string descriptor from the device + * @discussion This method uses IOUSBHostDevice::getDescriptor to return a string descriptor. + * @param index Descriptor index value. Low byte of <code>wValue</code> of the SET_DESCRIPTOR control request (USB 2.0 9.4.8). + * @param languageID Descriptor language ID. <code>wIndex</code> of the SET_DESCRIPTOR control request (USB 2.0 9.4.8). * + * @return Pointer to the descriptor if found + */ + virtual const StandardUSB::StringDescriptor* getStringDescriptor(uint8_t index, uint16_t languageID = StandardUSB::kLanguageIDEnglishUS); + + // Public pad slots for descriptors + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 40); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 41); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 42); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 43); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 44); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 45); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 46); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 47); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 48); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 49); + +protected: + virtual IOReturn getInterfaceDescriptorGated(const StandardUSB::InterfaceDescriptor*& result); + + // Protected pad slots for descriptors + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 50); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 51); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 52); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 53); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 54); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 55); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 56); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 57); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 58); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 59); + +#pragma mark Alternate setting and pipe management +public: + /*! @functiongroup Alternate setting and pipe management */ + + /*! + * @brief Select an alternate setting for this interface + * @discussion This method is used to select an alternate setting for the interface. All pending IO on the interface's pipes will be aborted, and the open pipes will be closed. The new alternate setting will be selected via SET_INTERFACE control request (USB 2.0 9.4.10). + * @param bAlternateSetting Alternate interface number to activate + * @return IOReturn result code + */ + virtual IOReturn selectAlternateSetting(uint8_t bAlternateSetting); + + /*! + * @brief Return the pipe whose <code>bEndpointAddress</code> matches <code>address</code> + * @discussion This method will return the pipe whose <code>bEndpointAddress</code> matches <code>address</code>. If the pipe doesn't exist yet, but is part of the interface, it will first be created. The caller must release the IOUSBHostPipe when finished using it. + * @param address Address of the pipe + * @return Pointer to a retain()ed IOUSBHostPipe object or NULL + */ + virtual IOUSBHostPipe* copyPipe(uint8_t address); + + /*! + * @brief Enqueue a request on the default control endpoint + * @discussion This method will enqueue an asynchronous request on the default control endpoint. If successful, the provided completion routine will be called to report the status of the completed IO. + * @param request Reference to a valid StandardUSB::DeviceRequest structure. The structure is copied and can therefore be stack-allocated. + * @param dataBuffer A void* or IOMemoryDescriptor* defining the memory to use for the request's data phase. + * @param completion Pointer to a IOUSBHostCompletion structure. This will be copied and can therefore be stack-allocated. + * @param completionTimeoutMs Timeout of the request in milliseconds. If 0, the request will never timeout. + * @return kIOReuturnSuccess if the completion will be called in the future, otherwise error + */ + virtual IOReturn deviceRequest(StandardUSB::DeviceRequest& request, void* dataBuffer, IOUSBHostCompletion* completion, uint32_t completionTimeoutMs = kUSBHostDefaultControlCompletionTimeoutMS); + virtual IOReturn deviceRequest(StandardUSB::DeviceRequest& request, IOMemoryDescriptor* dataBuffer, IOUSBHostCompletion* completion, uint32_t completionTimeoutMs = kUSBHostDefaultControlCompletionTimeoutMS); + + /*! + * @brief Send a request on the default control endpoint + * @discussion This method will send a synchronous request on the default control endpoint, and will not return until the request is complete. This method will acquire the service's workloop lock, and will call commandSleep to send the control request. + * @param request Reference to a valid StandardUSB::DeviceRequest structure. + * @param dataBuffer A void* or IOMemoryDescriptor* defining the memory to use for the request's data phase. + * @param bytesTransferred A uint32_t reference which will be updated with the byte count of the completed data phase. + * @param completionTimeoutMs Timeout of the request in milliseconds. If 0, the request will never timeout. + * @return IOReturn value indicating the result of the IO request + */ + virtual IOReturn deviceRequest(StandardUSB::DeviceRequest& request, void* dataBuffer, uint32_t& bytesTransferred, uint32_t completionTimeoutMs = kUSBHostDefaultControlCompletionTimeoutMS); + virtual IOReturn deviceRequest(StandardUSB::DeviceRequest& request, IOMemoryDescriptor* dataBuffer, uint32_t& bytesTransferred, uint32_t completionTimeoutMs = kUSBHostDefaultControlCompletionTimeoutMS); + + /*! + * @brief Abort device requests made via the @link deviceRequest @/link methods by <code>forClient</code> + * @discussion This method will abort any requests associated with a specific client made via the @link deviceRequest @/link methods. It will not abort requests made by other clients. + * @param options IOUSBHostIOSource::tAbortOptions + * @param withError IOReturn error value to return with the requests. The default value of kIOReturnAborted should be used. + * @return IOReturn result code + */ + IOReturn abortDeviceRequests(IOOptionBits options = IOUSBHostIOSource::kAbortAsynchronous, IOReturn withError = kIOReturnAborted); + + // Public pad slots for alternate setting and pipe management + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 60); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 61); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 62); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 63); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 64); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 65); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 66); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 67); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 68); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 69); + +protected: + enum + { + kInitIORetries = 3, + kInitIORetryInterval = 100, + kDestroyPipesOptionAll = StandardUSBBit(0) + }; + + virtual void updateMatchingProperties(); + + virtual IOReturn selectAlternateSettingGated(uint8_t bAlternateSetting); + + virtual IOReturn copyPipeGated(uint8_t address, IOUSBHostPipe*& result); + + virtual void closePipes(); + virtual IOReturn closePipesGated(); + + // Must be called on the command gate + virtual void pipeLockLock(); + virtual void pipeLockUnlock(); + + + OSMetaClassDeclareReservedUsed(IOUSBHostInterface, 70); + virtual void destroyPipes(IOOptionBits options = 0); + + OSMetaClassDeclareReservedUsed(IOUSBHostInterface, 71); + virtual IOReturn destroyPipesGated(IOOptionBits options); + + // Protected pad slots for alternate setting and pipe management + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 72); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 73); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 74); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 75); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 76); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 77); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 78); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 79); + +protected: + IOUSBHostPipe* _pipeList[kUSBHostMaxPipes]; + + bool _pipeLock; + + const StandardUSB::ConfigurationDescriptor* _configurationDescriptor; + const StandardUSB::InterfaceDescriptor* _interfaceDescriptor; + IOUSBHostDevice* _device; + + uint32_t _debugLoggingMask; + uint32_t _locationID; // TODO: Initialize this for tracepoints + +#pragma mark Miscellaneous +public: + /*! @functiongroup Provider access */ + + /*! + * @brief Return the parent/provider IOUSBHostDevice object of this interface. + * @return IOUSBHostDevice pointer + */ + virtual IOUSBHostDevice* getDevice() const; + + /*! + * @brief Return the current frame number of the USB controller + * @description This method will return the current frame number of the USB controller, omitting microframe. This is most useful for scheduling future isochronous requests. + * @param theTime If not NULL, this will be updated with the current system time + * @return The current frame number + */ + virtual uint64_t getFrameNumber(AbsoluteTime* theTime = NULL) const; + + /*! + * @brief Return the current port status + * @discussion Combination of tUSBHostPortStatus values + * @return port status + */ + virtual uint32_t getPortStatus() const; + + /*! + * @brief Allocate a buffer to be used for I/O + * @discussion This method will allocate an IOBufferMemoryDescriptor optimized for use by the underlying controller hardware. A buffer allocated by this method will not be bounced to perform DMA operations. + * @param options kIODirectionOut, kIODirectionIn to set the direction of the I/O transfer. + * @param capacity Size of the buffer to allocate + * @return Pointer to an IOBufferMemoryDescriptor if successful, otherwise NULL + */ + virtual IOBufferMemoryDescriptor* createIOBuffer(IOOptionBits options, mach_vm_size_t capacity); + + // Public pad slots for miscellaneous + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 80); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 81); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 82); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 83); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 84); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 85); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 86); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 87); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 88); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 89); + +protected: + // Protected pad slots for miscellaneous + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 90); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 91); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 92); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 93); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 94); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 95); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 96); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 97); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 98); + OSMetaClassDeclareReservedUnused(IOUSBHostInterface, 99); + +protected: + struct tExpansionData + { + uint16_t _persistentOutEndpointMask; + uint16_t _persistentInEndpointMask; + bool _allPipesDestroyed; + }; + tExpansionData* _expansionData; +}; + +#endif // IOUSBHostFamily_IOUSBHostInterface_h diff --git a/QualcommWireless/include/IOKit/usb/IOUSBHostPipe.h b/QualcommWireless/include/IOKit/usb/IOUSBHostPipe.h new file mode 100644 index 0000000..03d2495 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBHostPipe.h @@ -0,0 +1,641 @@ +/* + * Copyright (c) 1998-2016 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/*! + @header IOUSBHostPipe.h + @brief IOUSBHostPipe is an object representing a USB endpoint. + @discussion + + <h3>IOUSBPipe Migration</h3> + + IOUSBHostPipe serves as a replacement for IOUSBPipe. Clients that previously used an IOUSBPipe can use the following guide to convert to IOUSBHostPipe. + + <code>virtual IOReturn IOUSBPipe::Abort(IOOptionBits, IOReturn);</code><br> + Replacement: <code>abort(...);</code> + + <code>virtual IOReturn IOUSBPipe::Reset();<br> + virtual IOReturn IOUSBPipe::ClearStall();</code><br> + Replacement: <code>clearStall(false)</code> + + <code>virtual IOReturn IOUSBPipe::ClearPipeStall(bool);</code><br> + Replacement: <code>clearStall(...);</code> + + <code>virtual IOReturn IOUSBPipe::Read(IOMemoryDescriptor*, IOUSBCompletion*, UInt32*);<br> + virtual IOReturn IOUSBPipe::Read(IOMemoryDescriptor*, UInt32, UInt32, IOUSBCompletion*, UInt32*);<br> + virtual IOReturn IOUSBPipe::Read(IOMemoryDescriptor*, UInt32, UInt32, IOByteCount, IOUSBCompletion*, UInt32*);<br> + virtual IOReturn IOUSBPipe::Read(IOMemoryDescriptor*, UInt32, UInt32, IOByteCount, IOUSBCompletionWithTimeStamp*, UInt32*);<br> + virtual IOReturn IOUSBPipe::Write(IOMemoryDescriptor*, UInt32, UInt32, IOUSBCompletion*);<br> + virtual IOReturn IOUSBPipe::Write(IOMemoryDescriptor*, UInt32, UInt32, IOByteCount, IOUSBCompletion*);<br> + virtual IOReturn IOUSBPipe::Write(IOMemoryDescriptor*, IOUSBCompletion*);<br> + virtual IOReturn IOUSBPipe::Read(IOMemoryDescriptor*, UInt64, UInt32, IOUSBIsocFrame*, IOUSBIsocCompletion*);<br> + virtual IOReturn IOUSBPipe::Read(IOMemoryDescriptor*, UInt64, UInt32, IOUSBLowLatencyIsocFrame*, IOUSBLowLatencyIsocCompletion*, UInt32);<br> + virtual IOReturn IOUSBPipe::Write(IOMemoryDescriptor*, UInt64, UInt32, IOUSBIsocFrame*, IOUSBIsocCompletion*);<br> + virtual IOReturn IOUSBPipe::Write(IOMemoryDescriptor*, UInt64, UInt32, IOUSBLowLatencyIsocFrame*, IOUSBLowLatencyIsocCompletion*, UInt32);</code><br> + Replacement: <code>io(...);</code> + + <code>virtual IOReturn IOUSBPipe::ControlRequest(IOUSBDevRequestDesc*, IOUSBCompletion*, UInt32, UInt32);<br> + virtual IOReturn IOUSBPipe::ControlRequest(IOUSBDevRequest*, IOUSBCompletion*);<br> + virtual IOReturn IOUSBPipe::ControlRequest(IOUSBDevRequestDesc*, UInt32, UInt32, IOUSBCompletion*);<br> + virtual IOReturn IOUSBPipe::ControlRequest(IOUSBDevRequest*, UInt32, UInt32, IOUSBCompletion*);</code><br> + Replacement: <code>controlRequest(...);</code> + + <code>virtual const IOUSBController::Endpoint* IOUSBPipe::GetEndpoint();<br> + virtual UInt8 IOUSBPipe::GetDirection();<br> + virtual UInt8 IOUSBPipe::GetType();<br> + virtual UInt8 IOUSBPipe::GetEndpointNumber();<br> + virtual UInt16 IOUSBPipe::GetMaxPacketSize();<br> + virtual UInt8 IOUSBPipe::GetInterval();</code><br> + Replacement: Use <code>getEndpointDescriptor()</code>, <code>getSuperSpeedEndpointCompanionDescriptor()</code>, and <code>getDescriptors()</code> with <code>StandardUSB::getEndpoint*</code> methods to retrieve endpoint characteristics + + <code>virtual tUSBHostDeviceAddress IOUSBPipe::GetAddress();</code><br> + Replacement: <code>getDeviceAddress();</code> + + <code>virtual UInt8 IOUSBPipe::GetSpeed();</code><br> + Replacement: <code>getSpeed();</code> + + <code>virtual IOReturn IOUSBPipe::GetPipeStatus();</code><br> + Replacement: If an endpoint is halted, new IO requests will be rejected with an appropriate error until the condition is cleared. + + <code>virtual IOReturn IOUSBPipe::SetPipePolicy(UInt16 maxPacketSize, UInt8 maxInterval);</code><br> + Replacement: <code>adjustPipe(...);</code> + + <h3>IOUSBPipeV2 Migration</h3> + + IOUSBPipeV2 implemented interfaces for USB 3.0 streaming endpoint support. IOUSBHostPipe provides interfaces to enable or disable streaming, and IOUSBHostStream provides interfaces to perform streaming IO. + + <code>virtual IOReturn IOUSBPipeV2::CreateStreams(UInt32);</code><br> + Replacement: <code>enableStreams();</code> and <code>disableStreams();</code> + + <code>virtual IOReturn IOUSBPipeV2::Read(UInt32, IOMemoryDescriptor*, UInt32, UInt32, IOByteCount, IOUSBCompletion*, IOByteCount*);<br> + virtual IOReturn IOUSBPipeV2::Write(UInt32, IOMemoryDescriptor*, UInt32, UInt32, IOByteCount, IOUSBCompletion*);<br> + virtual IOReturn IOUSBPipeV2::Abort(UInt32, IOOptionBits, IOReturn);</code><br> + Replacement: Use <code>copyStream</code> and IOUSBHostStream interfaces to perform IO to a streaming endpoint. + + <code>virtual UInt32 IOUSBPipeV2::GetConfiguredStreams();</code><br> + Replacement: none + + <code>virtual UInt32 IOUSBPipeV2::SupportsStreams();</code><br> + Replacement: <code>StandardUSB::getEndpointMaxStreams(...);</code> + + <code>virtual const IOUSBSuperSpeedEndpointCompanionDescriptor* IOUSBPipeV2::GetSuperSpeedEndpointCompanionDescriptor();</code><br> + Replacement: <code>getSuperSpeedEndpointCompanionDescriptor(...);</code> + + <code>virtual UInt8 IOUSBPipeV2::GetMult();</code><br> + Replacement: <code>StandardUSB::getEndpointMult(...);</code> + Refer to documentation for this method, as it may not return the same values as <code>IOUSBPipeV2::GetMult()</code>. + + <code>virtual UInt8 IOUSBPipeV2::GetMaxBurst();<br> + virtual UInt16 IOUSBPipeV2::GetBytesPerInterval();</code><br> + Replacement: <code>StandardUSB::getEndpointBurstSize(...)</code> or <code>StandardUSB::getEndpointBurstSize32(...)</code>. Refer to documentation for the replacement methods, as they may not return the same values as <code>IOUSBPipeV2::GetMaxBurst()</code> or <code>IOUSBPipeV2::GetBytesPerInterval;</code> + */ + +#ifndef IOUSBHostFamily_IOUSBHostPipe_h +#define IOUSBHostFamily_IOUSBHostPipe_h + +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> + +#include <IOKit/usb/StandardUSB.h> +#include <IOKit/usb/IOUSBHostFamily.h> +#include <IOKit/usb/IOUSBHostIOSource.h> +#include <IOKit/usb/IOUSBHostStream.h> + +#if TARGET_OS_OSX +#include <USBDriverKit/IOUSBHostPipe.h> +#endif + +class IOUSBHostInterface; +class AppleUSBHostController; + +/*! + * @class IOUSBHostPipe + * @brief The OSObject representing a USB endpoint + * @discussion This class provides functionality to transfer data across USB. Function drivers should not subclass IOUSBHostPipe. + */ +class __IOUSBHOSTFAMILY_DEPRECATED IOUSBHostPipe : public IOUSBHostIOSource +{ + friend class IOUSBHostInterface; + friend class IOUSBHostDevice; + friend class AppleUSBHostController; + friend class AppleUSBIORequest; + +#if TARGET_OS_OSX + OSDeclareDefaultStructorsWithDispatch(IOUSBHostPipe) +#else + OSDeclareDefaultStructors(IOUSBHostPipe) +#endif + +public: + /*! + * @struct StandardUSBDescriptors + * @brief Encapsulates descriptors for a single endpoint + * @discussion The StandardUSBDescriptors struct is used to intialize and adjust pipes in the system. The bcdUSB member must be initialized to the USB revision supported by the device. Acceptable values are 0x0110, 0x0200, 0x0300, 0x0310. The descriptor member must always be initialized with a pointer to a valid endpoint descriptor. The ssCompanionDescriptor and sspCompanionDescriptor members may be required for bcdUSB versions 0x0300 and greater, depending on device operating speed and values set in the descriptors. See USB 3.1 ¤ 9.5 for more information on when these descriptors may be required. + */ + struct StandardUSBDescriptors + { + uint16_t bcdUSB; + const StandardUSB::EndpointDescriptor* descriptor; + const StandardUSB::SuperSpeedEndpointCompanionDescriptor* ssCompanionDescriptor; + const StandardUSB::SuperSpeedPlusIsochronousEndpointCompanionDescriptor* sspCompanionDescriptor; + }; + + /* + * @brief Factory method for creating an IOUSBHostPipe object + * @discussion This method should not be called by function drivers. To create an IOUSBHostPipe, use IOUSBHostInterface::copyPipe(...) + * @param descriptor EndpointDescriptor for the endpoint + * @param companionDescriptor SuperSpeedEndpointCompanionDescriptor for the endpoint, or NULL + * @param controller AppleUSBHostController to which the USB endpoint is associated + * @param device IOUSBHostDevice to which this endpoint belongs, or NULL + * @param interface IOUSBHostInterface to which this endpoint belongs, or NULL + * @param speed Operational speed of the device + * @param address tUSBHostDeviceAddress that has been allocated by the controller + * @return Pointer to an IOUSBHostPipe object if successful, otherwise NULL + */ + static IOUSBHostPipe* withDescriptorsAndOwners(const StandardUSB::EndpointDescriptor* descriptor, + const StandardUSB::SuperSpeedEndpointCompanionDescriptor* companionDescriptor, + AppleUSBHostController* controller, + IOUSBHostDevice* device, + IOUSBHostInterface* interface, + UInt8 speed, + tUSBHostDeviceAddress address); + +protected: + virtual bool initWithDescriptorsAndOwners(const StandardUSB::EndpointDescriptor* descriptor, + const StandardUSB::SuperSpeedEndpointCompanionDescriptor* companionDescriptor, + AppleUSBHostController* controller, + IOUSBHostDevice* device, + IOUSBHostInterface* interface, + UInt8 speed, + tUSBHostDeviceAddress address); + +#pragma mark IOUSBHostIOSource overrides +public: + virtual void free() APPLE_KEXT_OVERRIDE; + + /*! @functiongroup IO + * @discussion All I/O calls will synchronize with the workloop. Furthermore, all completion callbacks will also synchronize with the workloop. Therefore, when using the asynchronous I/O methods it is most performant to make subsequent calls from completion callback as the workloop lock will already be owned. + */ + + /*! + * @brief Abort pending I/O requests. + * @discussion See IOUSBHostIOSource::abort for documentation + */ + virtual IOReturn abort(IOOptionBits options = kAbortAsynchronous, IOReturn withError = kIOReturnAborted, IOService* forClient = NULL) APPLE_KEXT_OVERRIDE; + +protected: + virtual IOReturn openGated() APPLE_KEXT_OVERRIDE; + virtual IOReturn closeGated() APPLE_KEXT_OVERRIDE; + virtual IOReturn destroyGated() APPLE_KEXT_OVERRIDE; + virtual IOReturn abortGated(IOOptionBits options, IOReturn withError, IOService* forClient) APPLE_KEXT_OVERRIDE; + virtual UInt32 getOutstandingIO(IOService* forClient) APPLE_KEXT_OVERRIDE; + virtual UInt32 adjustOutstandingIO(IOService* forClient, SInt32 increment) APPLE_KEXT_OVERRIDE; + + // Protected pad slots for IOUSBHostIOSource overrides + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 0); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 1); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 2); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 3); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 4); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 5); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 6); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 7); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 8); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 9); + +protected: + UInt8 _speed; + IOUSBHostInterface* _interface; + +#pragma mark Descriptors and policies +public: + /*! + * @functiongroup Descriptors + */ + + /*! + * @brief Options for <code>getEndpointDescriptor</code>, <code>getSuperSpeedEndpointCompanionDescriptor</code>, and <code>getDescriptors</code> + * + * @constant kGetEndpointDescriptorOriginal - Original descriptor used when creating the pipe + * @constant kGetEndpointDescriptorCurrentPolicy - Descriptor controlling the current endpoint policy, including changes made via the <code>adjustPolicy</code> method. + */ + enum tGetEndpointDescriptorOptions + { + kGetEndpointDescriptorOriginal = 0, + kGetEndpointDescriptorCurrentPolicy + }; + + /*! + * @brief Retrieve the EndpointDescriptor associated with this object + * @param type tGetEndpointDescriptorOptions indicating which descriptor to retrieve + * @return EndpointDescriptor pointer if successful, otherwise NULL + */ + virtual const StandardUSB::EndpointDescriptor* getEndpointDescriptor(tGetEndpointDescriptorOptions type = kGetEndpointDescriptorCurrentPolicy); + + /*! + * @brief Retrieve the SuperSpeedEndpointCompanionDescriptor associated with this object + * @param type tGetEndpointDescriptorOptions indicating which descriptor to retrieve + * @return SuperSpeedEndpointCompanionDescriptor pointer if successful, otherwise NULL + */ + virtual const StandardUSB::SuperSpeedEndpointCompanionDescriptor* getSuperSpeedEndpointCompanionDescriptor(tGetEndpointDescriptorOptions type = kGetEndpointDescriptorCurrentPolicy); + + /*! @functiongroup Policies */ + /*! + * @brief Adjust behavior of periodic endpoints to consume a different amount of bus bandwidth + * @discussion Periodic (interrupt and isochronous) endpoints reserve bus bandwidth when they are created, which takes into account max packet size, burst size, and the endpoint service interval. If a function driver knows the endpoint will not use all of the allocated bandwidth, the <code>adjustPolicy</code> method may be used to reduce the bandwidth reserved for the endpoint. The original endpoint descriptors should be copied and modified to adjust max packet size, mult, burst, and interval, and then passed to <code>adjustPolicy</code>. The altered descriptors must pass <code>StandardUSB::validateEndpointDescriptor(...)</code> for policy changes to be processed. + * @param endpointDescriptor Pointer to an EndpointDescriptor describing the new endpoint policy + * @param companionDescriptor Pointer to a SuperSpeedEndpointCompanionDescriptor describing the bandwidth request + * @return IOReturn result code + */ + virtual IOReturn adjustPipe(const StandardUSB::EndpointDescriptor* endpointDescriptor, const StandardUSB::SuperSpeedEndpointCompanionDescriptor* companionDescriptor); + + /*! + * @brief Sets the desired idle timeout for the pipe + * @discussion When a bulk or interrupt pipe is actively servicing an IO request, it will be considered "busy" for idleTimeoutMs. For a more complete discussion of idle policies, refer to "Pausing IO" in IOUSBHostFamily.h. + * @param idleTimeoutMs The amount of time, in milliseconds, before an active transfer is considered idle. If 0 the pipe will not be considered idle if there is an IO request enqueued. + * @return IOReturn result code + */ + virtual IOReturn setIdlePolicy(uint32_t idleTimeoutMs); + + /*! + * @brief Retrieve the current idle timeout for the pipe + * @return Current idle timeout in milliseconds + */ + virtual uint32_t getIdlePolicy(); + + /*! @functiongroup IO */ + /*! + * @brief Clear the halt condition of the pipe. + * @discussion When a bulk or interrupt USB endpoint encounters any IO error other than a timeout, it transitions to a Halted state which must be cleared to perform additional IO on the endpoint. This method will clear the halted condition for the endpoint, including sending a CLEAR_TT_BUFFER control request (USB 2.0 11.24.2.3) to an intermediate hub if required. All pending IO on the endpoint will be aborted, and the data toggle for the endpoint will also be reset. To keep the device's data toggle synchronized with the host's data toggle, it is recommended that the withRequest parameter is always set to true, which causes the <code>clearStall</code> call to send a CLEAR_FEATURE ENDPOINT_HALT (USB 2.0 9.4.1) command to the device. clearStall is not required for control endpoints. + * @param withRequest If true a CLEAR_FEATURE ENDPOINT_HALT (USB 2.0 9.4.1) will be sent to the device. + * + * @return IOReturn result code + */ + virtual IOReturn clearStall(bool withRequest); + + // Public pad slots for descriptors and policies + /*! @functiongroup Policies */ + OSMetaClassDeclareReservedUsed(IOUSBHostPipe, 10); + /*! + * @brief Adjust behavior of periodic endpoints to consume a different amount of bus bandwidth + * @discussion Periodic (interrupt and isochronous) endpoints reserve bus bandwidth when they are created, which takes into account max packet size, burst size, and the endpoint service interval. If a function driver knows the endpoint will not use all of the allocated bandwidth, the <code>adjustPolicy</code> method may be used to reduce the bandwidth reserved for the endpoint. The original endpoint descriptors should be copied and modified to adjust max packet size, mult, burst, and interval, and then passed to <code>adjustPolicy</code>. The altered descriptors must pass <code>StandardUSB::validateEndpointDescriptor(...)</code> for policy changes to be processed. + * @param descriptors Pointer to a StandardUSBDescriptors structure describing the new endpoint policy + * @return IOReturn result code + */ + virtual IOReturn adjustPipe(StandardUSBDescriptors* descriptors); + + /*! @functiongroup Descriptors */ + OSMetaClassDeclareReservedUsed(IOUSBHostPipe, 11); + /*! + * @brief Retrieve the descriptors associated with this object + * @param descriptors StandardUSBDescriptors pointer to populate + * @param type tGetEndpointDescriptorOptions indicating which descriptors to retrieve + * @return IOReturn result + */ + virtual IOReturn getDescriptors(StandardUSBDescriptors* descriptors, tGetEndpointDescriptorOptions type = kGetEndpointDescriptorCurrentPolicy); + + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 12); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 13); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 14); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 15); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 16); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 17); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 18); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 19); + +protected: + virtual IOReturn adjustPipeGated(const StandardUSB::EndpointDescriptor* endpointDescriptor, + const StandardUSB::SuperSpeedEndpointCompanionDescriptor* companionDescriptor); + + virtual IOReturn setIdlePolicyGated(uint32_t idleTimeoutMs); + virtual IOReturn getIdlePolicyGated(uint32_t& result); + + virtual IOReturn clearStallGated(bool withRequest); + + // Protected pad slots for descriptors and policies + OSMetaClassDeclareReservedUsed(IOUSBHostPipe, 20); + virtual IOReturn adjustPipeGatedV2(StandardUSBDescriptors* descriptors); + + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 21); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 22); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 23); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 24); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 25); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 26); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 27); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 28); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 29); + +protected: + const StandardUSB::EndpointDescriptor* _descriptor; + const StandardUSB::SuperSpeedEndpointCompanionDescriptor* _companionDescriptor; + const StandardUSB::SuperSpeedPlusIsochronousEndpointCompanionDescriptor* _sspCompanionDescriptor; + + StandardUSB::EndpointDescriptor _currentPolicyDescriptor; + StandardUSB::SuperSpeedEndpointCompanionDescriptor _currentPolicyCompanionDescriptor; + StandardUSB::SuperSpeedPlusIsochronousEndpointCompanionDescriptor _currentPolicySSPCompanionDescriptor; + + // Cached values + UInt32 _maxPacketSize; + UInt32 _burstSize; + + UInt32 _ioIdleTimeout; + +#pragma mark Control requests +public: + /*! @functiongroup IO */ + /*! + * @brief Enqueue a request on a control endpoint + * @discussion This method will enqueue an asynchronous request on a control endpoint. If successful, the provided completion routine will be called to report the status of the completed IO. + * @param forClient The service issuing the request. + * @param request Reference to a valid StandardUSB::DeviceRequest structure. The structure is copied and can therefore be stack-allocated. + * @param dataBuffer A void* or IOMemoryDescriptor* defining the memory to use for the request's data phase. + * @param completion Pointer to a IOUSBHostCompletion structure. This will be copied and can therefore be stack-allocated. + * @param completionTimeoutMs Timeout of the request in milliseconds. If 0, the request will never timeout. + * @return kIOReuturnSuccess if the completion will be called in the future, otherwise error + */ + virtual IOReturn controlRequest(IOService* forClient, StandardUSB::DeviceRequest& request, void* dataBuffer, IOUSBHostCompletion* completion, uint32_t completionTimeoutMs); + virtual IOReturn controlRequest(IOService* forClient, StandardUSB::DeviceRequest& request, IOMemoryDescriptor* dataBuffer, IOUSBHostCompletion* completion, uint32_t completionTimeoutMs); + + /*! + * @brief Send a request on a control endpoint + * @discussion This method will send a synchronous request on a control endpoint, and will not return until the request is complete. This method will acquire the owning device's workloop lock, and will call commandSleep to send the control request. + * @param forClient The service issuing the request. + * @param request Reference to a valid StandardUSB::DeviceRequest structure. + * @param dataBuffer A void* or IOMemoryDescriptor* defining the memory to use for the request's data phase. + * @param bytesTransferred A uint32_t reference which will be updated with the byte count of the completed data phase. + * @param completionTimeoutMs Timeout of the request in milliseconds. If 0, the request will never timeout. + * @return IOReturn value indicating the result of the IO request + */ + virtual IOReturn controlRequest(IOService* forClient, StandardUSB::DeviceRequest& request, void* dataBuffer, uint32_t& bytesTransferred, uint32_t completionTimeoutMs); + virtual IOReturn controlRequest(IOService* forClient, StandardUSB::DeviceRequest& request, IOMemoryDescriptor* dataBuffer, uint32_t& bytesTransferred, uint32_t completionTimeoutMs); + + // Public pad slots for control requests + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 30); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 31); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 32); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 33); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 34); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 35); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 36); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 37); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 38); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 39); + +protected: + struct tInternalControlRequestParameters + { + IOService* forClient; + StandardUSB::DeviceRequest* request; + void* rawBuffer; + IOMemoryDescriptor* descriptorBuffer; + uint32_t* bytesTransferred; + IOUSBHostCompletion* completion; + uint32_t completionTimeoutMs; + }; + virtual IOReturn controlRequestGated(tInternalControlRequestParameters& parameters); + + static void rawBufferControlRequestCompletion(void* target, void* parameter, IOReturn status, uint32_t bytesTransferred); + + // Protected pad slots for control requests + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 40); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 41); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 42); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 43); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 44); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 45); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 46); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 47); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 48); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 49); + +#pragma mark IO +public: + /*! + * @functiongroup IO + */ + + /*! + * @brief Enqueue a request on a bulk or interrupt endpoint + * @discussion See IOUSBHostIOSource::io for documentation + * @param completionTimeoutMs Must be 0 for interrupt endpoints. + */ + virtual IOReturn io(IOMemoryDescriptor* dataBuffer, uint32_t dataBufferLength, IOUSBHostCompletion* completion, uint32_t completionTimeoutMs = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @brief Perform a request on a bulk or interrupt endpoint + * @discussion See IOUSBHostIOSource::io for documentation + * @param completionTimeoutMs Must be 0 for interrupt endpoints. + */ + virtual IOReturn io(IOMemoryDescriptor* dataBuffer, uint32_t dataBufferLength, uint32_t& bytesTransferred, uint32_t completionTimeoutMs = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @brief Enqueue or perform a request on an isochronous endpoint + * @discussion + * This method is used to issue isochronous requests. The caller allocates and initializes an array of IOUSBHostIsochronousFrame structures, which is used to describe the frames that will be transferred. See @link IOUSBHostIsochronousFrame @/link for information regarding structure initialization requirements and usage. + * @param dataBuffer Pointer to a valid memory descriptor to be used as the backing store for the I/O. + * @param frameList Pointer first element in an IOUSBHostIsochronousFrame array. The array must contain at least frameListCount elements. + * @param frameListCount Number of elements in <code>frameList</code>. + * @param firstFrameNumber Frame number which this request should begin on. The current frame number can be queried via <code>IOUSHostDevice::getFrameNumber()</code> or <code>IOUSBHostInterface::getFrameNumber()</code>. If 0, the transfer will start on the next available frame (XHCI only). + * @param completion To create a synchronous I/O request, this parameter must be NULL. For an asynchronous request this paramater must be properly filled out prior to calling this method. If not NULL, this parameter will be copied and can therefore be stack-allocated. + * @return IOReturn result code + */ + virtual IOReturn io(IOMemoryDescriptor* dataBuffer, IOUSBHostIsochronousFrame* frameList, uint32_t frameListCount, uint64_t firstFrameNumber = 0, IOUSBHostIsochronousCompletion* completion = NULL); + + /*! + * @brief Enqueue a request on a bulk or interrupt endpoint + * @discussion See IOUSBHostIOSource::io for documentation + * @param completionTimeoutMs Must be 0 for interrupt endpoints. + */ + virtual IOReturn io(IOMemoryDescriptor* dataBuffer, uint32_t dataBufferLength, IOUSBHostBundledCompletion* completion, uint32_t completionTimeoutMs = 0) APPLE_KEXT_OVERRIDE; + + // Public pad slots for IO + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 50); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 51); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 52); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 53); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 54); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 55); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 56); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 57); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 58); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 59); + +protected: + virtual IOReturn isochronousIoGated(tInternalDataTransferParameters& parameters); + +#if TARGET_OS_OSX + static void asyncIOCompletionCallback(void* owner, void* parameter, IOReturn status, uint32_t bytesTransferred); + static void asyncIOCompletionCallbackBundled(void *owner, uint32_t ioCompletionCount, IOMemoryDescriptor** dataBufferArray, void** parameterArray, IOReturn* statusArray, uint32_t* actualByteCountArray); + static void asyncIsochIOCompletionCallback(void* owner, void* parameter, IOReturn status, IOUSBHostIsochronousFrame* frameList); +#endif + + // Protected pad slots for IO + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 60); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 61); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 62); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 63); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 64); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 65); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 66); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 67); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 68); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 69); + +#pragma mark Streams +public: + /*! + * @functiongroup Streams + * @discussion IOUSBHostPipe defines interfaces to enable and disable streams for an endpoint, and to create IOUSBHostStream objects. See IOUSBHostStream.h for additional documentation. + */ + + /*! + * @brief Enable streams for the IOUSBHostPipe + * @discussion This method changes the operational mode of the IOUSBHostPipe to allow streaming endpoint transfers, and must be called before copyStream will return any IOUSBHostStream objects. + * @return IOReturn result code. An error will be returned if the pipe, device, or underlying host controller does not support streams. + */ + virtual IOReturn enableStreams(); + + /*! + * @brief Disable streams for the IOUSBHostPipe + * @discussion This method changes the operational mode of the IOUSBHostPipe to disable streaming endpoint transfers. Calling this method will synchronously abort any outstanding calls on existing IOUSBHostStream objects, and therefore all stream contexts should first be set as non-active on the device via an out-of-band (class-defined) mechanism (USB 3.1 8.12.1.4). + * @return IOReturn result code. An error will be returned if streams were not enabled for this IOUSBHostPipe. + */ + virtual IOReturn disableStreams(); + + /*! + * @brief Return the stream associated with <code>streamID</code> + * @discussion This method will return the stream associated with <code>streamID</code>. If the stream doesn't exist yet it will be created. The caller must release the IOUSBHostStream when finished using it. <code>IOUSBHostPipe::enableStreams</code> must be called before this method will return a stream object. + * @param streamID Stream ID in the range of 1 to <code>max</code>, where <code>max</code> can be retrieved by calling <code>StandardUSB::getEndpointMaxStreams</code> with the endpoint descriptors. + * @return Pointer to a retain()ed IOUSBHostStream object or NULL. NULL may be returned if either the device or the underlying host controller do not support that stream ID. + */ + virtual IOUSBHostStream* copyStream(uint32_t streamID); + + // Public pad slots for streams + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 70); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 71); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 72); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 73); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 74); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 75); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 76); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 77); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 78); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 79); + +protected: + virtual IOReturn enableStreamsGated(); + + virtual IOReturn disableStreamsGated(); + + virtual IOReturn copyStreamGated(uint32_t streamID, IOUSBHostStream*& result); + + // Protected pad slots for streams + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 80); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 81); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 82); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 83); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 84); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 85); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 86); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 87); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 88); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 89); + +protected: + IOUSBHostStream** _streamArray; + bool _streamsEnabled; + +#pragma mark Miscellaneous +public: + /*! @functiongroup Provider interfaces */ + + /*! + * @brief Retrieve the device's operational speed + * @return tInternalUSBHostConnectionSpeed + */ + virtual uint8_t getSpeed() const; + + /*! + * @brief Retrieve the device's address + * @return Current address of the device + */ + virtual tUSBHostDeviceAddress getDeviceAddress() const; + + // Public pad slots for miscellaneous + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 90); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 91); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 92); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 93); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 94); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 95); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 96); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 97); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 98); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 99); + +protected: + struct tRawBufferControlRequestCompletionParameter + { + IOMemoryDescriptor* memoryDescriptor; + IOUSBHostCompletion clientCompletion; + }; + + // Protected pad slots for miscellaneous + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 100); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 101); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 102); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 103); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 104); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 105); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 106); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 107); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 108); + OSMetaClassDeclareReservedUnused(IOUSBHostPipe, 109); + + +private: + void destroyMemoryDescriptorRing(); + +#pragma mark Deprecated +public: + enum tPipeAbortOptions + { + kIOUSBPipeAbortAsync = IOUSBHostIOSource::kAbortAsynchronous, + kIOUSBPipeAbortSync = IOUSBHostIOSource::kAbortSynchronous + }; + + enum tUSBPipeState + { + kUSBPipeStateReady = IOUSBHostIOSource::kStateReady, + kUSBPipeStateRunningCompletions = IOUSBHostIOSource::kStateRunningCompletions, + kUSBPipeStateAborting = IOUSBHostIOSource::kStateAborting, + kUSBPipeStateInactive = IOUSBHostIOSource::kStateInactive + }; +}; + +#endif // IOUSBHostFamily_IOUSBHostPipe_h diff --git a/QualcommWireless/include/IOKit/usb/IOUSBHostStream.h b/QualcommWireless/include/IOKit/usb/IOUSBHostStream.h new file mode 100644 index 0000000..0efd1d8 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBHostStream.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 1998-2016 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/*! + @header IOUSBHostStream.h + @brief IOUSBHostStream is an object representing an individual stream within a streaming endpoint. + */ + +#ifndef IOUSBHostFamily_IOUSBHostStream_h +#define IOUSBHostFamily_IOUSBHostStream_h + +#include <IOKit/usb/IOUSBHostFamily.h> +#include <IOKit/usb/IOUSBHostIOSource.h> + +class IOUSBHostPipe; + +/*! + * @class IOUSBHostStream + * @brief The OSObject representing an individual stream within a USB endpoint + * @discussion This class provides functionality to transfer data across USB. Function drivers should not subclass IOUSBHostStream. + */ +class __IOUSBHOSTFAMILY_DEPRECATED IOUSBHostStream : public IOUSBHostIOSource +{ + OSDeclareDefaultStructors(IOUSBHostStream) + + friend class IOUSBHostPipe; + +public: + /*! + * @brief Factory method for creating an IOUSBHostStream object + * @discussion This method should not be called by function drivers. To create an IOUSBHostStream, use IOUSBHostPipe::copyStream(...) + * @param controller AppleUSBHostController to which the USB endpoint is associated + * @param device IOUSBHostDevice to which this endpoint belongs + * @param pipe IOUSBHostPipe to which this stream belongs + * @param streamID The stream ID for this instance + * @return Pointer to an IOUSBHostStream object if successful, otherwise NULL + */ + IOUSBHostStream* withOwnersAndStreamID(AppleUSBHostController* controller, IOUSBHostDevice* device, IOUSBHostPipe* pipe, uint32_t streamID); + + virtual void free() APPLE_KEXT_OVERRIDE; + + /*! + * @brief Abort pending I/O requests. + * @discussion See IOUSBHostIOSource::abort for documentation. A stream context must be set as non-active on the device via an out-of-band (class-defined) mechanism before this method is called (USB 3.1 8.12.1.4). A non-active stream will not be selected by the device to become the current stream on the endpoint. + */ + virtual IOReturn abort(IOOptionBits options = kAbortAsynchronous, IOReturn withError = kIOReturnAborted, IOService* forClient = NULL) APPLE_KEXT_OVERRIDE; + + /*! + * @brief Retrieve the IOUSBHostPipe to which this stream belongs + * @return IOUSBHostPipe pointer + */ + virtual IOUSBHostPipe* getPipe() const { return _pipe; } + + /*! + * @brief Retrieve the sream ID for this instance + * @return Stream ID + */ + virtual uint32_t getStreamID() const { return _streamID; } + + /*! + * @brief Enqueue a request on a stream + * @discussion See IOUSBHostIOSource::io for documentation + * @param completionTimeoutMs Must be 0 for streams. + */ + virtual IOReturn io(IOMemoryDescriptor* dataBuffer, uint32_t dataBufferLength, IOUSBHostCompletion* completion, uint32_t completionTimeoutMs = 0) APPLE_KEXT_OVERRIDE; + + /*! + * @brief Perform a request on a stream + * @discussion See IOUSBHostIOSource::io for documentation + * @param completionTimeoutMs Must be 0 for streams. + */ + virtual IOReturn io(IOMemoryDescriptor* dataBuffer, uint32_t dataBufferLength, uint32_t& bytesTransferred, uint32_t completionTimeoutMs = 0) APPLE_KEXT_OVERRIDE; + + // Public pad slots for future expansion + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 0); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 1); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 2); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 3); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 4); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 5); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 6); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 7); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 8); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 9); + +protected: + virtual bool initWithOwnersAndStreamID(AppleUSBHostController* controller, IOUSBHostDevice* device, IOUSBHostPipe* pipe, uint32_t streamID); + + virtual IOReturn closeGated() APPLE_KEXT_OVERRIDE; + + virtual IOReturn abortGated(IOOptionBits options, IOReturn withError, IOService* forClient) APPLE_KEXT_OVERRIDE; + + // Protected pad slots for future expansion + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 10); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 11); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 12); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 13); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 14); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 15); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 16); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 17); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 18); + OSMetaClassDeclareReservedUnused(IOUSBHostStream, 19); + +protected: + IOUSBHostPipe* _pipe; + uint32_t _streamID; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/usb/IOUSBInterface.h b/QualcommWireless/include/IOKit/usb/IOUSBInterface.h new file mode 100644 index 0000000..da115ce --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBInterface.h @@ -0,0 +1,366 @@ +/* + * Copyright � 1998-2007, 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBINTERFACE_H +#define _IOKIT_IOUSBINTERFACE_H + +#include <IOKit/IOService.h> +#include <libkern/c++/OSData.h> + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/IOUSBNub.h> +#include <IOKit/usb/IOUSBDevice.h> + +/*! + @class IOUSBInterface + @abstract The object representing an interface of a device on the USB bus. + @discussion This class provides functionality to find the pipes of an interface and + to read the descriptors associated with an interface. When an interface is open()ed, + all its pipes are created +*/ +class IOUSBInterface : public IOUSBNub +{ + friend class IOUSBInterfaceUserClientV2; + friend class IOUSBInterfaceUserClientV3; + friend class IOUSBDevice; + friend class IOUSBPipe; + friend class IOUSBPipeV2; + + OSDeclareDefaultStructors(IOUSBInterface) + +protected: + IOUSBPipe * _pipeList[kUSBMaxPipes]; + const IOUSBConfigurationDescriptor *_configDesc; + const IOUSBInterfaceDescriptor * _interfaceDesc; + IOUSBDevice * _device; + + // these variable are the parsed interface descriptor + UInt8 _bInterfaceNumber; + UInt8 _bAlternateSetting; + UInt8 _bNumEndpoints; + UInt8 _bInterfaceClass; + UInt8 _bInterfaceSubClass; + UInt8 _bInterfaceProtocol; + UInt8 _iInterface; + + struct ExpansionData { + IOCommandGate *_gate; + IOWorkLoop *_workLoop; + bool _needToClose; + IOLock * _pipeObjLock; // Deprecated + OSSet * _openClients; + UInt32 _RememberedStreams[kUSBMaxPipes]; + bool _openPending; + }; + ExpansionData * _expansionData; + + // private methods + virtual void ClosePipes(void); // close all pipes (except pipe zero) + virtual IOReturn CreatePipes(void); // open all pipes in the current interface/alt interface + virtual void SetProperties(void); // update my property table with the correct properties + + IOReturn ResetPipes(void); // reset all pipes (except pipe zero) (not virtual) + IOReturn AbortPipesGated(void); // abort all pipes (except pipe zero) (not virtual) + IOReturn ClosePipesGated(bool close); // Abort and close or unlink all pipes (except pipe zero) (not virtual) + IOUSBPipe* FindNextPipeGated(IOUSBPipe *current, IOUSBFindEndpointRequest *request, bool withRetain); + IOUSBPipe* GetPipeObjGated(UInt8 index); + IOReturn ReopenPipesGated(); // relink all pipes (except pipe zero) (not virtual) + void RememberStreamsGated(void); + IOReturn RecreateStreamsGated(void); + + // Return the "Full" MaxPacketSize, given an endpoint descriptor and a pointer to an sscd if there is one + // This will multiple the MPS in the ep by the mult and the burst which may or may not be present + UInt16 CalculateFullMaxPacketSize(IOUSBEndpointDescriptor *ed, IOUSBSuperSpeedEndpointCompanionDescriptor *sscd); + +public: + // static methods + static IOUSBInterface * withDescriptors(const IOUSBConfigurationDescriptor *cfDesc, const IOUSBInterfaceDescriptor *ifDesc); + static IOReturn CallSuperOpen(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn CallSuperClose(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn _ResetPipes(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn _AbortPipes(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn _ClosePipes(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn _FindNextPipe(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn _GetPipeObj(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn _ReopenPipes(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn _RememberStreams(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn _RecreateStreams(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + + static UInt8 hex2char( UInt8 digit ); + + // IOService methods + virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual bool handleOpen(IOService *forClient, IOOptionBits options = 0, void *arg = 0 ) APPLE_KEXT_OVERRIDE; + virtual bool handleIsOpen(const IOService *forClient) const APPLE_KEXT_OVERRIDE; + virtual bool open(IOService *forClient, IOOptionBits options = 0, void *arg = 0 ) APPLE_KEXT_OVERRIDE; + virtual void close(IOService *forClient, IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + virtual void handleClose(IOService *forClient, IOOptionBits options = 0) APPLE_KEXT_OVERRIDE; + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ) APPLE_KEXT_OVERRIDE; + virtual bool finalize(IOOptionBits options) APPLE_KEXT_OVERRIDE; + virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE; + virtual bool terminate( IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE; + virtual void free() APPLE_KEXT_OVERRIDE; + virtual void joinPMtree ( IOService * driver ) APPLE_KEXT_OVERRIDE; + + // IOUSBInterface class methods + virtual bool init( const IOUSBConfigurationDescriptor *cfDesc, + const IOUSBInterfaceDescriptor *ifDesc); + /*! + @function FindNextAltInterface + return alternate interface descriptor satisfying the requirements specified in request, or NULL if there aren't any. + request is updated with the properties of the returned interface. + @param current interface descriptor to start searching from, NULL to start at alternate interface 0. + @param request specifies what properties an interface must have to match. + @result Pointer to a matching interface descriptor, or NULL if none match. + */ + LIBKERN_RETURNS_NOT_RETAINED virtual const IOUSBInterfaceDescriptor *FindNextAltInterface(const IOUSBInterfaceDescriptor *current, + IOUSBFindInterfaceRequest *request); + + /*! + @function FindNextPipe + Find a pipe of the interface that matches the requirements, either + starting from the beginning of the interface's pipe list or from a specified + pipe. + @param current Pipe to start searching from, NULL to start from beginning of list. + @param request Requirements for pipe to match, updated with the found pipe's + properties. + @result Pointer to the pipe, or NULL if no pipe matches the request. + */ + LIBKERN_RETURNS_NOT_RETAINED virtual IOUSBPipe *FindNextPipe(IOUSBPipe *current, IOUSBFindEndpointRequest *request); + + /*! + @function FindNextAssociatedDescriptor + Find the next descriptor of the requested type associated with the interface. + @param current Descriptor to start searching from, NULL to start from beginning of list. + @param type Descriptor type to search for, or kUSBAnyDesc to return any descriptor type. + @result Pointer to the descriptor, or NULL if no matching descriptors found. + */ + LIBKERN_RETURNS_NOT_RETAINED virtual const IOUSBDescriptorHeader * FindNextAssociatedDescriptor(const void *current, UInt8 type); + + /*! + @function SetAlternateInterface + Select the specified alternate interface. + @param forClient The client requesting the alternate setting. This client must have the interface open in order to perform the request. + @param alternateSetting Alternate setting (from the alternate interface's interface descriptor). + @result exclusive access error if the interface is not open. otherwise the result of the transaction + */ + virtual IOReturn SetAlternateInterface(IOService *forClient, UInt16 alternateSetting); + + /*! + @function GetPipeObj + returns a handle to the pipe at the corresponding index + @param index value from zero to kUSBMaxPipes-1 + @result The IOUSBPipe object. Note that the client does not own a reference to this pipe, so the client should retain() the IOUSBPipe object if necessary. + */ + virtual IOUSBPipe *GetPipeObj(UInt8 index); + /*! + @function GetConfigValue + returns the device configuration value for the interface + @result The device configuration value. + */ + virtual UInt8 GetConfigValue(); + /*! + @function GetDevice + returns the device the interface is part of. + @result Pointer to the IOUSBDevice object which is the parent of this IOUSBInterface object. + */ + virtual IOUSBDevice *GetDevice(); + /*! + @function GetInterfaceNumber + returns the zero based value identifying the index in the array of concurrent + interfaces supported by the current configuration + @result the interface index + */ + virtual UInt8 GetInterfaceNumber(); + /*! + @function GetAlternateSetting + returns the alternate setting for this interface. + @result the alternate setting + */ + virtual UInt8 GetAlternateSetting(); + /*! + @function GetNumEndpoints + returns the number of endpoints used by this interface (excluding + device endpoint zero. If the value is zero, this interface only + uses endpoint zero. + @result the number of endpoints + */ + virtual UInt8 GetNumEndpoints(); + /*! + @function GetInterfaceClass + returns the class code for this interface (assigned by the USB) + a value of zero is reserved + if the value is FFh, the interface class is vendor-specific + all other values are reserved for assignment by the USB + @result the interface class + */ + virtual UInt8 GetInterfaceClass(); + /*! + @function GetInterfaceSubClass + returns the subclass code (assigned by the USB). + These codes are qualified by the value returned by GetInterfaceClass + @result the interface subclass + */ + virtual UInt8 GetInterfaceSubClass(); + /*! + @function GetInterfaceProtocol + returns the protocol code (assigned by the USB). + @result the interface index + */ + virtual UInt8 GetInterfaceProtocol(); + /*! + @function GetInterfaceStringIndex + returns the index of the string descriptor describing the interface + @result the string index + */ + virtual UInt8 GetInterfaceStringIndex(); + + /*! + @function DeviceRequest + @abstract Sends a control request to the default control pipe in the device (pipe zero) + @param request The parameter block to send to the device + @param completion Function to call when request completes. If omitted then + DeviceRequest() executes synchronously, blocking until the request is complete. If the request is asynchronous, the client must make sure that + the IOUSBDevRequest is not released until the callback has occurred. + */ + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, IOUSBCompletion *completion = 0); + + /*! + @function DeviceRequest + @abstract Sends a control request to the default control pipe in the device (pipe zero) + @param request The parameter block to send to the device (with the pData as an IOMemoryDesriptor) + @param completion Function to call when request completes. If omitted then + DeviceRequest() executes synchronously, blocking until the request is complete. If the request is asynchronous, the client must make sure that + the IOUSBDevRequest is not released until the callback has occurred. + */ + virtual IOReturn DeviceRequest(IOUSBDevRequestDesc *request, IOUSBCompletion *completion = 0); + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 *score) APPLE_KEXT_OVERRIDE; + + OSMetaClassDeclareReservedUsed(IOUSBInterface, 0); + /*! + @function GetEndpointProperties + @abstract Returns the properties of an endpoint, possibly in an alternate interface. + @param alternateSetting specifies the desired alternate setting + @param endpointNumber specifies the endpoint number + @param direction specifies the direction (kUSBIn, kUSBOut) + @param transferType a pointer to hold the transfer type (kUSBControl, kUSBBulk, etc.) of the endpoint if found. + @param maxPacketSize a pointer to hold the maxPacketSize in the endpoint descriptor. + @param interval a pointer to hold the interval value in the endpoint descriptor. + @result returns kIOReturnSuccess if the endpoint is found, and kIOUSBEndpointNotFound if it is not. + */ + virtual IOReturn GetEndpointProperties(UInt8 alternateSetting, UInt8 endpointNumber, UInt8 direction, UInt8 *transferType, UInt16 *maxPacketSize, UInt8 *interval); + + + OSMetaClassDeclareReservedUsed(IOUSBInterface, 1); + /*! + @function FindNextPipe + Find a pipe of the interface that matches the requirements, either + starting from the beginning of the interface's pipe list or from a specified + pipe. + @param current Pipe to start searching from, NULL to start from beginning of list. + @param request Requirements for pipe to match, updated with the found pipe's + properties. + @param withRetain Pass true to retain and the client should release it later after its use. + @result Pointer to the pipe, or NULL if no pipe matches the request. + */ + virtual IOUSBPipe* FindNextPipe(IOUSBPipe *current, IOUSBFindEndpointRequest *request, bool withRetain); + + OSMetaClassDeclareReservedUsed(IOUSBInterface, 2); + /*! + @function RememberStreams. + Make a note of which pipes have streams, so they can be recreated later. + @result returns kIOReturnSuccess if sucessful. + */ + virtual IOReturn RememberStreams(void); + + OSMetaClassDeclareReservedUsed(IOUSBInterface, 3); + /*! + @function RecreateStreams + Recreate the remembered streams after a device has been reset. + @result returns kIOReturnSuccess if sucessful. + */ + virtual IOReturn RecreateStreams(void); + + OSMetaClassDeclareReservedUsed(IOUSBInterface, 4); + virtual void UnlinkPipes(void); // delete the UIM endpoint from the pipe + + OSMetaClassDeclareReservedUsed(IOUSBInterface, 5); + virtual void ReopenPipes(void); // open all pipes in the current interface/alt interface + + OSMetaClassDeclareReservedUsed(IOUSBInterface, 6); + /*! + @function GetEndpointPropertiesV3 + @abstract Returns the properties of an endpoint, possibly in an alternate interface, including any information from the SuperSpeed Companion Descriptor + @param endpointProperties Pointer to a IOUSBEndpointProperties structure that upon success will contain the information for the endpoint. The bVersion field + needs to be initialized with the structure version (see USBEndpointVersion enum in USB.h). The bAlternateSetting, bEndpointNumber, and bDirection (kUSBIn, kUSBOut) MUST also be filled + in with the values for the desired descriptor. Not that the bMaxStreams value for Bulk endpoints is the value specified by the bmAttributes field in the SuperSpeed companion descriptor. + @result returns kIOReturnSuccess if the endpoint is found, and kIOUSBEndpointNotFound if it is not. + */ + virtual IOReturn GetEndpointPropertiesV3(IOUSBEndpointProperties *endpointProperties); + + OSMetaClassDeclareReservedUsed(IOUSBInterface, 7); + /*! + @function GetInterfaceStatus + @abstract Returns the result of issuing a GET_STATUS request on the device for this interface. + @param status Pointer to a USBStatus type which will contain the results of the operation. + @result returns kIOReturnSuccess if the request is completed successfully, otherwise returns the result of the Device Request. + */ + virtual IOReturn GetInterfaceStatus(USBStatus *status); + + OSMetaClassDeclareReservedUsed(IOUSBInterface, 8); + /*! + @function SetFunctionSuspendFeature + @abstract Issues a SET_FEATURE(FUNCTION_SUSPEND) to the interface. + @param options The suspend options passed to the Device Request. + @result returns kIOReturnSuccess if the request is completed successfully, otherwise returns the result of the Device Request. + */ + virtual IOReturn SetFunctionSuspendFeature(UInt8 options); + + OSMetaClassDeclareReservedUsed(IOUSBInterface, 9); + /*! + @function EnableRemoteWake + @abstract Will enable or disable the USB 3.0 remote wake function for the interface + @param enable Whether we enable (true) or disable (false) the remote wake.. + @result returns kIOReturnSuccess if the request is completed successfully, otherwise returns the result of the Device Request to set the feature. + */ + virtual IOReturn EnableRemoteWake(bool enable); + + + OSMetaClassDeclareReservedUnused(IOUSBInterface, 10); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 11); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 12); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 13); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 14); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 15); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 16); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 17); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 18); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 19); + +protected: + + +}; + +#endif diff --git a/QualcommWireless/include/IOKit/usb/IOUSBNub.h b/QualcommWireless/include/IOKit/usb/IOUSBNub.h new file mode 100644 index 0000000..41ee718 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBNub.h @@ -0,0 +1,85 @@ +/* + * Copyright © 1998-2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBNUB_H +#define _IOKIT_IOUSBNUB_H + +#include <IOKit/IOService.h> +#include <libkern/c++/OSData.h> +#include <IOKit/IOMemoryDescriptor.h> + +#include <IOKit/usb/USB.h> + +extern const OSSymbol *gUSBVendorID; +extern const OSSymbol *gUSBProductID; +extern const OSSymbol *gUSBInterfaceNumber; +extern const OSSymbol *gUSBConfigurationValue; +extern const OSSymbol *gUSBDeviceReleaseNumber; +extern const OSSymbol *gUSBInterfaceClass; +extern const OSSymbol *gUSBInterfaceSubClass; +extern const OSSymbol *gUSBInterfaceProtocol; +extern const OSSymbol *gUSBProductIDMask; +extern const OSSymbol *gUSBDeviceClass; +extern const OSSymbol *gUSBDeviceSubClass; +extern const OSSymbol *gUSBDeviceProtocol; + +class IOUSBController; +class IOUSBPipe; + +/* + IOUSBNub + Super class for for IOUSBDevice and IOUSBInterface. + */ +class IOUSBNub : public IOService +{ + OSDeclareDefaultStructors(IOUSBNub) + +public: + static void initialize(); + + // IOKit method + + virtual bool USBCompareProperty(OSDictionary * matching, const OSSymbol * key ); + + bool IsWildCardMatch( OSDictionary * matching, const char * key ); + bool USBComparePropertyWithMask( OSDictionary *matching, const char *key, const char * maskKey ); + bool USBComparePropertyInArray( OSDictionary *matching, const char *arrayName, const char * key, UInt32 * theProductIDThatMatched ); + bool USBComparePropertyInArrayWithMask( OSDictionary *matching, const char *arrayName, const char * key, const char * maskKey, UInt32 * theProductIDThatMatched ); + +}; + +#ifdef __cplusplus +extern "C" { +#endif + +void printDescriptor(const IOUSBDescriptorHeader *desc); +void printDeviceDescriptor(const IOUSBDeviceDescriptor *desc); +void printConfigDescriptor(const IOUSBConfigurationDescriptor *cd); +void printEndpointDescriptor(const IOUSBEndpointDescriptor *ed); +void printInterfaceDescriptor(const IOUSBInterfaceDescriptor *id); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/QualcommWireless/include/IOKit/usb/IOUSBPipe.h b/QualcommWireless/include/IOKit/usb/IOUSBPipe.h new file mode 100644 index 0000000..3979c11 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBPipe.h @@ -0,0 +1,397 @@ +/* + * Copyright � 1998-2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBPIPE_H +#define _IOKIT_IOUSBPIPE_H + +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/IOUSBController.h> +#include <IOKit/usb/IOUSBControllerV2.h> + +class IOUSBInterface; + +#define kAppleUSBSSIsocContinuousFrame 0xFFFFFFFFFFFFFFFEull + +/*! + @class IOUSBPipe + @abstract The object representing an open pipe for a device. +*/ +class IOUSBPipe : public OSObject +{ + friend class IOUSBInterface; + friend class IOUSBDevice; + + OSDeclareDefaultStructors(IOUSBPipe) + +protected: + + const IOUSBEndpointDescriptor * _descriptor; + IOUSBController::Endpoint _endpoint; // tidied up version of descriptor + IOUSBController * _controller; + USBDeviceAddress _address; + UInt8 _status; // was previously used for status. Now used to detect whether a property exists or not + + struct ExpansionData + { + IOReturn _correctStatus; + IOUSBDevice * _device; // Remember containing device for clearing TTs + UInt8 _speed; + IOUSBInterface * _interface; + bool _crossEndianCompatible; + UInt32 _locationID; + UInt8 _uasUsageID; + UInt8 _usageType; + UInt8 _syncType; + bool _zeroNoDataTimeout; + }; + ExpansionData * _expansionData; + + virtual void free() APPLE_KEXT_OVERRIDE; + + IOReturn ClosePipe(void); + +public: + + // The following 4 methods are deprecated (replaced by the new IOUSBPipeV2 class) + // + virtual bool InitToEndpoint(const IOUSBEndpointDescriptor *endpoint, UInt8 speed, + USBDeviceAddress address, IOUSBController * controller); + + static IOUSBPipe *ToEndpoint(const IOUSBEndpointDescriptor *endpoint, UInt8 speed, + USBDeviceAddress address, IOUSBController * controller); + + static IOUSBPipe *ToEndpoint(const IOUSBEndpointDescriptor *endpoint, + IOUSBDevice * device, IOUSBController * controller); + + static IOUSBPipe *ToEndpoint(const IOUSBEndpointDescriptor *endpoint, + IOUSBDevice * device, IOUSBController * controller, IOUSBInterface *interface); + + // Controlling pipe state + /*! + @function GetStatus + This method does NOT work. Do not call it. See GetPipeStatus for the correct method. + GetStatus will always return 0. + */ + virtual UInt8 GetStatus(void); + /*! + @function Abort + This method causes all outstanding I/O on a pipe to complete with return code kIOReturnAborted. It clears the halted bit but does NOT clear the + toggle bit on the endpoint in the controller. If you wish to clear the toggle bit, see ClearPipeStall + */ + virtual IOReturn Abort(void); + /*! + @function Reset + This method is identical to ClearPipeStall(false). The use of that API is preferred. + */ + virtual IOReturn Reset(void); + /*! + @function ClearStall + This method is equivalent to ClearPipeStall(false). This method is available before version 1.9. + */ + virtual IOReturn ClearStall(void); + + // + // Transferring Data + // + + // deprecated + virtual IOReturn Read(IOMemoryDescriptor * buffer, + IOUSBCompletion * completion = 0, + IOByteCount * bytesRead = 0); + + // deprecated + virtual IOReturn Write(IOMemoryDescriptor * buffer, + IOUSBCompletion * completion = 0); + + // Transfer data over Isochronous pipes + /*! + @function Read + Read from an isochronous endpoint + @param buffer place to put the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer and result for each frame + @param completion describes action to take when buffer has been filled + */ + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, + IOUSBIsocCompletion * completion = 0); + /*! + @function Write + Write to an isochronous endpoint + @param buffer place to get the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer and result for each frame + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write(IOMemoryDescriptor * buffer, + UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, + IOUSBIsocCompletion * completion = 0); + + // Do a control request over a Control pipe, using a memory descriptor + /*! + @function ControlRequest + Make a control request + There are two versions of this method, one uses a simple void * + to point to the data portion of the transfer, the other uses an + IOMemoryDescriptor to point to the data. + @param request parameter block for the control request + @param completion describes action to take when the request has been executed + */ + virtual IOReturn ControlRequest(IOUSBDevRequestDesc *request, + IOUSBCompletion *completion = 0); + + // Do a control request over a Control pipe, using a simple buffer + virtual IOReturn ControlRequest(IOUSBDevRequest *request, + IOUSBCompletion *completion = 0); + + /* + * Accessors + */ + /*! + @function GetEndpoint + returns a pointer to the Endpoint structure for the pipe. + */ + virtual const IOUSBController::Endpoint * GetEndpoint(); + /*! + @function GetEndpointDescriptor + returns the endpoint descriptor for the pipe. + */ + virtual const IOUSBEndpointDescriptor * GetEndpointDescriptor(); + /*! + @function GetDirection + returns the direction of the pipe:kUSBOut/kUSBIn for a bulk or interrupt pipe, + kUSBAnyDirn for a control pipe. + */ + virtual UInt8 GetDirection(); + /*! + @function GetType + returns the pipe type: kUSBControl, kUSBBulk or kUSBInterrupt. + */ + virtual UInt8 GetType(); + /*! + @function GetEndpointNumber + returns the endpoint number in the device that the pipe is connected to. + */ + virtual UInt8 GetEndpointNumber(); + virtual USBDeviceAddress GetAddress(); + virtual UInt16 GetMaxPacketSize(); + virtual UInt8 GetInterval(); + + // Transfer data over Bulk pipes with timeouts. + OSMetaClassDeclareReservedUsed(IOUSBPipe, 0); + + // deprecated + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion * completion = 0, + IOByteCount * bytesRead = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 1); + + // deprecated + virtual IOReturn Write(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion * completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 2); + // Do a control request over a Control pipe, using a memory descriptor + /*! + @function ControlRequest + Make a control request. + There are two versions of this method, one uses a simple void * + to point to the data portion of the transfer, the other uses an + IOMemoryDescriptor to point to the data. + @param request parameter block for the control request + @param noDataTimeout Specifies an amount of time (in ms) after which the command will be aborted + if no data has been transferred on the bus. + @param completionTimeout Specifies an amount of time (in ms) after which the command will be aborted if the entire command has + not been completed. + @param completion describes action to take when the request has been executed + */ + virtual IOReturn ControlRequest(IOUSBDevRequestDesc *request, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion *completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 3); + // Do a control request over a Control pipe, using a simple buffer + virtual IOReturn ControlRequest(IOUSBDevRequest *request, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion *completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 4); + /*! + @function Read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param noDataTimeout number of milliseconds of no bus activity until transaction times out. Note that if a tranasction times out + the driver software may have to resynchronize the data toggle. See ClearPipeStall. + @param completionTimeout number of milliseconds from the time the transaction is placed on the bus until it times out + @param reqCount requested number of bytes to transfer. must be <= buffer->getLength() + @param completion describes action to take when buffer has been filled + @param bytesRead returns total bytes read for synchronous reads + */ + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount, + IOUSBCompletion * completion = 0, + IOByteCount * bytesRead = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 5); + /*! + @function Write + Write to an interrupt or bulk endpoint + @param buffer place to get the transferred data + @param noDataTimeout number of milliseconds of no bus activity until transaction times out. Note that if a tranasction times out + the driver software may have to resynchronize the data toggle. See ClearPipeStall. + @param completionTimeout number of milliseconds from the time the transaction is placed on the bus until it times out + @param reqCount requested number of bytes to transfer. must be <= buffer->getLength() + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount, + IOUSBCompletion * completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 6); + /*! + @function GetPipeStatus + Returns the status of the pipe (kIOUSBPipeStalled of the pipe is stalled, else kIOReturnSuccess) + */ + virtual IOReturn GetPipeStatus(void); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 7); + /*! + @function ClearPipeStall + AVAILABLE ONLY IN VERSION 1.9 AND ABOVE + This method causes all outstanding I/O on a pipe to complete with return code kIOUSBTransactionReturned. It also clears both the halted bit and the + toggle bit on the endpoint in the controller. The driver may need to reset the data toggle within the device to avoid losing any data. If the + device correctly handles the ClearFeature(ENDPOINT_HALT) device request, then this API will handle that by sending the correct request to the + device. + @param withDeviceRequest if true, a ClearFeature(ENDPOINT_HALT) is sent to the appropriate endpoint on the device after the transactions on the + controllers endpoint are returned and the toggle bit on the controllers endpoint is cleared. if this parameter is false, then this is equivalent + to the pre-1.9 API. This means that the endpoint on the controller is cleared, but no DeviceRequest is sent to the device's endpoint. + */ + virtual IOReturn ClearPipeStall(bool withDeviceRequest); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 8); + /*! + @function SetPipePolicy + AVAILABLE ONLY IN VERSION 1.9 AND ABOVE + This method allows a driver to change the maxPacketSize of an Isochronous pipe, or the polling interval for an interrupt pipe. There is a limited + amount of bandwidth on any single bus, and isochronous pipes tend to use much of this bandwidth. The driver may know, however, that there + will never be as much bandwidth used as is specified in the pipe's endpoint descriptor. Therefore, the driver may return some of this + bandwidth to the system by using this method. Additionally, if on an open of an IOUSBInterface any of the Isochronous pipes is unable to be + opened because of a lack of bandwidth, the pipe will be created with a bandwidth of zero, and the driver may get some of the limited bandwidth + remaining by using this call. + This method returns kIOReturnBadArgument if the pipe is a bulk on control pipe, or if the maxPacketSize parameter is larger than the amount specified + in the endpoint descriptor. It returns kIOReturnNoBandwidth if the bandwidth requested cannot be allocated. Otherwise it returns kIOReturnSuccess. + @param maxPacketSize specifies the maximum number of bytes to be used in any one millisecond frame by this pipe. The value must be less than or + equal to the maxPacketSize specified in the endpoint descriptor. + @param maxInterval not currently used. reserved for future expansion + + */ + virtual IOReturn SetPipePolicy(UInt16 maxPacketSize, UInt8 maxInterval); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 9); + + // Transfer data over Isochronous pipes and process the frame list at hardware interrupt time + /*! + @function Read + AVAILABLE ONLY IN VERSION 1.9.2 AND ABOVE + Read from an isochronous endpoint and process the IOUSBLowLatencyIsocFrame fields at + hardware interrupt time + @param buffer place to put the transferred data + @param frameStart USB frame number of the frame to start transfer. For SuperSpeed Isoc devices, if the frameStart is kAppleUSBSSIsocContinuousFrame, then just continue after the last transfer which was called. + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer, result, and time stamp for each frame + @param completion describes action to take when buffer has been filled + @param updateFrequency describes how often (in milliseconds) should the frame list be processed + */ + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt64 frameStart, UInt32 numFrames, IOUSBLowLatencyIsocFrame *frameList, + IOUSBLowLatencyIsocCompletion * completion = 0, UInt32 updateFrequency = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 10); + /*! + @function Write + AVAILABLE ONLY IN VERSION 1.9.2 AND ABOVE + Write to an isochronous endpoint + @param buffer place to get the data to transfer + @param frameStart USB frame number of the frame to start transfer. For SuperSpeed Isoc devices, if the frameStart is kAppleUSBSSIsocContinuousFrame, then just continue after the last transfer which was called. + @param numFrames Number of frames to transfer + @param frameList Pointer to list of frames indicating bytes to transfer and result for each frame + @param completion describes action to take when buffer has been emptied + @param updateFrequency describes how often (in milliseconds) should the frame list be processed + */ + virtual IOReturn Write(IOMemoryDescriptor * buffer, + UInt64 frameStart, UInt32 numFrames, IOUSBLowLatencyIsocFrame *frameList, + IOUSBLowLatencyIsocCompletion * completion = 0, UInt32 updateFrequency = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 11); + /*! + @function Read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param noDataTimeout number of milliseconds of no bus activity until transaction times out. Note that if a tranasction times out + the driver software may have to resynchronize the data toggle. See ClearPipeStall. + @param completionTimeout number of milliseconds from the time the transaction is placed on the bus until it times out + @param reqCount requested number of bytes to transfer. must be <= buffer->getLength() + @param completion describes action to take when buffer has been filled + @param bytesRead returns total bytes read for synchronous reads + */ + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount, + IOUSBCompletionWithTimeStamp * completion = 0, + IOByteCount * bytesRead = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 12); + virtual bool InitToEndpoint(const IOUSBEndpointDescriptor *endpoint, UInt8 speed, + USBDeviceAddress address, IOUSBController * controller, IOUSBDevice * device, IOUSBInterface * interface); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 13); + virtual UInt8 GetUsageType(void); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 14); + virtual UInt8 GetSyncType(void); + + OSMetaClassDeclareReservedUnused(IOUSBPipe, 15); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 16); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 17); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 18); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 19); + +}; + +#endif diff --git a/QualcommWireless/include/IOKit/usb/IOUSBPipeV2.h b/QualcommWireless/include/IOKit/usb/IOUSBPipeV2.h new file mode 100644 index 0000000..873ada0 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBPipeV2.h @@ -0,0 +1,196 @@ +/* + * Copyright © 2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBPIPEV2_H +#define _IOKIT_IOUSBPIPEV2_H + +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/IOUSBController.h> +#include <IOKit/usb/IOUSBControllerV2.h> +#include <IOKit/usb/IOUSBPipe.h> + + +/*! + @class IOUSBPipeV2 + @abstract The object representing an open pipe for a device. +*/ +class IOUSBPipeV2 : public IOUSBPipe +{ + friend class IOUSBInterface; + friend class IOUSBDevice; + + OSDeclareDefaultStructors(IOUSBPipeV2) + +protected: + + IOUSBSuperSpeedEndpointCompanionDescriptor * _sscd; + UInt32 _maxStream; // number to be used as an exponent to get the actual maximum + UInt32 _maxBurst; // zero based (i.e. 0=1 burst) + UInt32 _configuredStreams; + UInt32 _mult; // zero based max value is 2 (meaning 3 packets) + UInt32 _bytesPerInterval; + + struct V2PipeExpansionData + { + }; + V2PipeExpansionData * _v2PipeExpansionData; + + static IOUSBPipeV2 *ToEndpoint(const IOUSBEndpointDescriptor *endpoint, IOUSBSuperSpeedEndpointCompanionDescriptor *sscd, + IOUSBDevice * device, IOUSBController * controller, IOUSBInterface *interface); + +public: + using IOUSBPipe::Read; + using IOUSBPipe::Write; + using IOUSBPipe::Abort; + + // inherited from the IOUSBPipe class + virtual IOReturn SetPipePolicy(UInt16 maxPacketSize, UInt8 maxInterval) APPLE_KEXT_OVERRIDE; //this must have the same KPI as IOUSBPipe::SetPipePolicy + + // New to IOUSBPipeV2 + virtual bool InitToEndpoint(const IOUSBEndpointDescriptor *endpoint, IOUSBSuperSpeedEndpointCompanionDescriptor *sscd, UInt8 speed, + USBDeviceAddress address, IOUSBController * controller, IOUSBDevice * device, IOUSBInterface * interface); + + /*! + @function Read + Read from a stream on a bulk endpoint + @param streamID ID of the stream to read from + @param buffer place to put the transferred data + @param noDataTimeout number of milliseconds of no bus activity until transaction times out. Note that if a tranasction times out + the driver software may have to resynchronize the data toggle. See ClearPipeStall. + @param completionTimeout number of milliseconds from the time the transaction is placed on the bus until it times out + @param reqCount requested number of bytes to transfer. must be <= buffer->getLength() + @param completion describes action to take when buffer has been filled + @param bytesRead returns total bytes read for synchronous reads + */ + virtual IOReturn Read(UInt32 streamID, + IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount, + IOUSBCompletion * completion = 0, + IOByteCount * bytesRead = 0); + + /*! + @function Write + Write to a stream on a bulk endpoint + @param streamID ID of the stream to write to + @param buffer place to get the transferred data + @param noDataTimeout number of milliseconds of no bus activity until transaction times out. Note that if a tranasction times out + the driver software may have to resynchronize the data toggle. See ClearPipeStall. + @param completionTimeout number of milliseconds from the time the transaction is placed on the bus until it times out + @param reqCount requested number of bytes to transfer. must be <= buffer->getLength() + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write(UInt32 streamID, + IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount, + IOUSBCompletion * completion = 0); + + /*! + @function SupportsStreams + Returns non zero if the pipe supports streams. + Return value is the max supported stream. + */ + virtual UInt32 SupportsStreams(void); + + /*! + @function CreateStreams + @param streamID ID of the highest stream to create (pass 0 to destroy streams) + */ + virtual IOReturn CreateStreams(UInt32 maxStreams); + + /*! + @function Abort(stream) + This method causes all outstanding I/O on a stream of a pipe to complete with return code kIOReturnAborted. It clears the halted bit but does NOT clear the + toggle bit on the endpoint in the controller. If you wish to clear the toggle bit, see ClearPipeStall + @param streamID ID of the stream to abort + */ + virtual IOReturn Abort(UInt32 streamID); + + /*! + @function GetConfiguredStreams + Get the number of streams which have been configured for the endpoint with CreateStreams + */ + virtual UInt32 GetConfiguredStreams(void); + + /*! + @function GetSuperSpeedEndpointCompanionDescriptor + returns the SuperSpeed endpoint companion descriptor for the pipe. + */ + virtual const IOUSBSuperSpeedEndpointCompanionDescriptor * GetSuperSpeedEndpointCompanionDescriptor(); + + /*! + @function GetMaxBurst + returns the value of bMaxBurst from the SuperSpeed endpoint companion descriptor + */ + virtual UInt8 GetMaxBurst(); + + /*! + @function GetMaxBurst + returns the value of bMaxBurst from the SuperSpeed endpoint companion descriptor + */ + virtual UInt8 GetMult(); + + /*! + @function GetMaxBurst + returns the value of bMaxBurst from the SuperSpeed endpoint companion descriptor + */ + virtual UInt16 GetBytesPerInterval(); + + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 0); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 1); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 2); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 3); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 4); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 5); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 6); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 7); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 8); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 9); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 10); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 11); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 12); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 13); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 14); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 15); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 16); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 17); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 18); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 19); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 20); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 21); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 22); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 23); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 24); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 25); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 26); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 27); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 28); + OSMetaClassDeclareReservedUnused(IOUSBPipeV2, 29); +}; + +#endif diff --git a/QualcommWireless/include/IOKit/usb/IOUSBWorkLoop.h b/QualcommWireless/include/IOKit/usb/IOUSBWorkLoop.h new file mode 100644 index 0000000..e4bca54 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/IOUSBWorkLoop.h @@ -0,0 +1,67 @@ +/* + * Copyright � 2001-2006 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBWORKLOOP_H +#define _IOKIT_IOUSBWORKLOOP_H + +#include <IOKit/IOWorkLoop.h> + +/* + class IOUSBWorkLoop + Subclass of IOWorkloop that allows the USB stack to more finely control sleep and wake. +*/ +class IOUSBWorkLoop : public IOWorkLoop +{ + OSDeclareDefaultStructors(IOUSBWorkLoop) + +protected: + void * fSleepToken; +#ifndef __OPEN_SOURCE__ + lck_grp_t * fLockGroup; +#endif + bool init ( const char * controllerLocation ); + void free ( void ) APPLE_KEXT_OVERRIDE; + + // Overrides to check for sleeping + virtual void closeGate() APPLE_KEXT_OVERRIDE; + virtual bool tryCloseGate() APPLE_KEXT_OVERRIDE; + +public: + // Create a workloop + static IOUSBWorkLoop * workLoop(const char * controllerLocation); + + // Put workloop to sleep (Must have gate closed, opens gate if successful) + virtual IOReturn sleep(void *token); + + // Wake workloop up (closes gate if successful) + virtual IOReturn wake(void *token); + + void CloseGate(void); + void OpenGate(void); + + int SleepWithTimeout(void *token, UInt64 timeout); + void Wakeup(void *token, bool oneThread); +}; + +#endif + diff --git a/QualcommWireless/include/IOKit/usb/StandardUSB.h b/QualcommWireless/include/IOKit/usb/StandardUSB.h new file mode 100644 index 0000000..0c88564 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/StandardUSB.h @@ -0,0 +1,1380 @@ +/* + * Copyright (c) 1998-2016 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/*! @header StandardUSB.h + @brief StandardUSB defines structures and constants to reflect the USB specification + */ + +#ifndef IOUSBHostFamily_StandardUSB_h +#define IOUSBHostFamily_StandardUSB_h + +#include <IOKit/IOTypes.h> +#include <IOKit/IOReturn.h> +#include <libkern/OSByteOrder.h> +#include <IOKit/usb/AppleUSBDefinitions.h> + + +#define StandardUSBBit(bit) IOUSBBit(bit) +#define StandardUSBBitRange(start, end) IOUSBBitRange(start, end) +#define StandardUSBBitRange64(start, end) IOUSBBitRange64(start, end) +#define StandardUSBBitRangePhase(start, end) IOUSBBitRangePhase(start, end) + +#define kUSB30Bitrate5Gbps kIOUSB30Bitrate5Gbps +#define kUSB30Bitrate10Gbps kIOUSB30Bitrate10Gbps +#define kUSB32Bitrate20Gbps kIOUSB32Bitrate20Gbps + +#ifdef __cplusplus + +#pragma mark StandardUSB namespace +namespace StandardUSB +{ + +#endif // __cplusplus + +#pragma mark Descriptor definitions + /*! + * @enum tDescriptorType + * @namespace StandardUSB + * @brief Descriptor types defined by USB 2.0 Table 9-5 and USB 3.0 Table 9-6 + */ + enum tDescriptorType + { + kDescriptorTypeDevice = kIOUSBDescriptorTypeDevice, + kDescriptorTypeConfiguration = kIOUSBDescriptorTypeConfiguration, + kDescriptorTypeString = kIOUSBDescriptorTypeString, + kDescriptorTypeInterface = kIOUSBDescriptorTypeInterface, + kDescriptorTypeEndpoint = kIOUSBDescriptorTypeEndpoint, + kDescriptorTypeDeviceQualifier = kIOUSBDescriptorTypeDeviceQualifier, + kDescriptorTypeOtherSpeedConfiguration = kIOUSBDescriptorTypeOtherSpeedConfiguration, + kDescriptorTypeInterfacePower = kIOUSBDescriptorTypeInterfacePower, + kDescriptorTypeOTG = kIOUSBDescriptorTypeOTG, + kDescriptorTypeDebug = kIOUSBDescriptorTypeDebug, + kDescriptorTypeInterfaceAssociation = kIOUSBDescriptorTypeInterfaceAssociation, + kDescriptorTypeBOS = kIOUSBDescriptorTypeBOS, + kDescriptorTypeDeviceCapability = kIOUSBDescriptorTypeDeviceCapability, + kDescriptorTypeHub = kIOUSBDescriptorTypeHub, + kDescriptorTypeSuperSpeedHub = kIOUSBDescriptorTypeSuperSpeedHub, + kDescriptorTypeSuperSpeedUSBEndpointCompanion = kIOUSBDescriptorTypeSuperSpeedUSBEndpointCompanion, + kDescriptorTypeSuperSpeedPlusIsochronousEndpointCompanion = kIOUSBDescriptorTypeSuperSpeedPlusIsochronousEndpointCompanion + }; + + typedef enum tDescriptorType tDescriptorType; + + /*! + * @enum tDescriptorSize + * @namespace StandardUSB + * @brief Size in bytes for descriptor structures + */ + enum tDescriptorSize + { + kDescriptorSize = kIOUSBDescriptorHeaderSize, + kDescriptorSizeDevice = kIOUSBDescriptorSizeDevice, + kDescriptorSizeConfiguration = kIOUSBDescriptorSizeConfiguration, + kDescriptorSizeInterface = kIOUSBDescriptorSizeInterface, + kDescriptorSizeEndpoint = kIOUSBDescriptorSizeEndpoint, + kDescriptorSizeStringMinimum = kDescriptorSize, + kDescriptorSizeStringMaximum = kIOUSBDescriptorSizeStringMaximum, + kDescriptorSizeDeviceQualifier = kIOUSBDescriptorSizeDeviceQualifier, + kDescriptorSizeInterfaceAssociation = kIOUSBDescriptorSizeInterfaceAssociation, + kDescriptorSizeBOS = kIOUSBDescriptorSizeBOS, + kDescriptorSizeDeviceCapability = kIOUSBDescriptorSizeDeviceCapability, + kDescriptorSizeUSB20ExtensionCapability = kIOUSBDescriptorSizeUSB20ExtensionCapability, + kDescriptorSizeSuperSpeedUSBDeviceCapability = kIOUSBDescriptorSizeSuperSpeedUSBDeviceCapability, + kDescriptorSizeContainerIDCapability = kIOUSBDescriptorSizeContainerIDCapability, + kDescriptorSizeHubMinimum = kIOUSBDescriptorSizeHubMinimum, + kDescriptorSizeHubMaximum = kIOUSBDescriptorSizeHubMaximum, + kDescriptorSizeSuperSpeedHub = kIOUSBDescriptorSizeSuperSpeedHub, + kDescriptorSizeSuperSpeedUSBEndpointCompanion = kIOUSBDescriptorSizeSuperSpeedUSBEndpointCompanion, + kDescriptorSizeSuperSpeedPlusIsochronousEndpointCompanion = kIOUSBDescriptorSizeSuperSpeedPlusIsochronousEndpointCompanion, + kDescriptorSizeBillboardDeviceMinimum = kIOUSBDescriptorSizeBillboardDeviceMinimum, + kDescriptorSizeBillboardDeviceMaximum = kIOUSBDescriptorSizeBillboardDeviceMaximum, + kDescriptorSizePlatformECIDCapability = kIOUSBDescriptorSizePlatformECIDCapability, + kDescriptorSizePlatformCapability = kIOUSBDescriptorSizePlatformCapability + }; + + typedef enum tDescriptorSize tDescriptorSize; + + /*! + * @struct Descriptor + * @namespace StandardUSB + * @brief Base descriptor defined by USB 2.0 9.5 + * @discussion StandardUSB.h declares structs to represent a variety of USB standard descriptors. Each of thes structs is derived from the Descriptor base struct, and can therefore be passed to methods accepting a Descriptor pointer without explicit casting. For the C language, each struct is defined independently to include the bLength and bDescriptorType fields expected for all USB descriptors. + */ + struct Descriptor + { + uint8_t bLength; + uint8_t bDescriptorType; + } __attribute__((packed)); + + typedef struct Descriptor Descriptor; + + +#ifdef __cplusplus + // USB 2.0 9.6.1: Device + struct DeviceDescriptor : public Descriptor + { +#else + struct DeviceDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint16_t bcdUSB; + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bDeviceProtocol; + uint8_t bMaxPacketSize0; + uint16_t idVendor; + uint16_t idProduct; + uint16_t bcdDevice; + uint8_t iManufacturer; + uint8_t iProduct; + uint8_t iSerialNumber; + uint8_t bNumConfigurations; + } __attribute__((packed)); + + typedef struct DeviceDescriptor DeviceDescriptor; + + +#ifdef __cplusplus + // USB 2.0 9.6.2: Device Qualifier + struct DeviceQualifierDescriptor : public Descriptor + { +#else + struct DeviceQualifierDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint16_t bcdUSB; + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bDeviceProtocol; + uint8_t bMaxPacketSize0; + uint8_t bNumConfigurations; + uint8_t bReserved; + } __attribute__((packed)); + + typedef struct DeviceQualifierDescriptor DeviceQualifierDescriptor; + + +#ifdef __cplusplus + // USB 2.0 9.6.3: Configuration + struct ConfigurationDescriptor : public Descriptor + { +#else + struct ConfigurationDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint16_t wTotalLength; + uint8_t bNumInterfaces; + uint8_t bConfigurationValue; + uint8_t iConfiguration; + uint8_t bmAttributes; + uint8_t bMaxPower; + } __attribute__((packed)); + + typedef struct ConfigurationDescriptor ConfigurationDescriptor; + + + enum + { + kConfigurationDescriptorAttributeRemoteWakeCapable = kIOUSBConfigurationDescriptorAttributeRemoteWakeCapable, + kConfigurationDescriptorAttributeSelfPowered = kIOUSBConfigurationDescriptorAttributeSelfPowered + }; + + +#ifdef __cplusplus + // USB 2.0 9.6.5: Interface + struct InterfaceDescriptor : public Descriptor + { +#else + struct InterfaceDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint8_t bInterfaceNumber; + uint8_t bAlternateSetting; + uint8_t bNumEndpoints; + uint8_t bInterfaceClass; + uint8_t bInterfaceSubClass; + uint8_t bInterfaceProtocol; + uint8_t iInterface; + } __attribute__((packed)); + + typedef struct InterfaceDescriptor InterfaceDescriptor; + + +#ifdef __cplusplus + // USB 2.0 9.6.6: Endpoint + struct EndpointDescriptor : public Descriptor + { +#else + struct EndpointDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint8_t bEndpointAddress; + uint8_t bmAttributes; + uint16_t wMaxPacketSize; + uint8_t bInterval; + } __attribute__((packed)); + + typedef struct EndpointDescriptor EndpointDescriptor; + + enum + { + kEndpointDescriptorNumber = kIOUSBEndpointDescriptorNumber, + kEndpointDescriptorEndpointAddressReserved = kIOUSBEndpointDescriptorEndpointAddressReserved, + kEndpointDescriptorDirection = kIOUSBEndpointDescriptorDirection, + kEndpointDescriptorDirectionPhase = kIOUSBEndpointDescriptorDirectionPhase, + kEndpointDescriptorDirectionOut = kIOUSBEndpointDescriptorDirectionOut, + kEndpointDescriptorDirectionIn = kIOUSBEndpointDescriptorDirectionIn, + + kEndpointDescriptorTransferType = kIOUSBEndpointDescriptorTransferType, + kEndpointDescriptorTransferTypePhase = kIOUSBEndpointDescriptorTransferTypePhase, + kEndpointDescriptorTransferTypeControl = kIOUSBEndpointDescriptorTransferTypeControl, + kEndpointDescriptorTransferTypeIsochronous = kIOUSBEndpointDescriptorTransferTypeIsochronous, + kEndpointDescriptorTransferTypeBulk = kIOUSBEndpointDescriptorTransferTypeBulk, + kEndpointDescriptorTransferTypeInterrupt = kIOUSBEndpointDescriptorTransferTypeInterrupt, + kEndpointDescriptorSynchronizationType = kIOUSBEndpointDescriptorSynchronizationType, + kEndpointDescriptorSynchronizationTypePhase = kIOUSBEndpointDescriptorSynchronizationTypePhase, + kEndpointDescriptorSynchronizationTypeNone = kIOUSBEndpointDescriptorSynchronizationTypeNone, + kEndpointDescriptorSynchronizationTypeAsynchronous = kIOUSBEndpointDescriptorSynchronizationTypeAsynchronous, + kEndpointDescriptorSynchronizationTypeAdaptive = kIOUSBEndpointDescriptorSynchronizationTypeAdaptive, + kEndpointDescriptorSynchronizationTypeSynchronous = kIOUSBEndpointDescriptorSynchronizationTypeSynchronous, + kEndpointDescriptorUsageType = kIOUSBEndpointDescriptorUsageType, + kEndpointDescriptorUsageTypePhase = kIOUSBEndpointDescriptorUsageTypePhase, + kEndpointDescriptorUsageTypeInterruptPeriodic = kIOUSBEndpointDescriptorUsageTypeInterruptPeriodic, + kEndpointDescriptorUsageTypeInterruptNotification = kIOUSBEndpointDescriptorUsageTypeInterruptNotification, + kEndpointDescriptorUsageTypeInterruptReserved1 = kIOUSBEndpointDescriptorUsageTypeInterruptReserved1, + kEndpointDescriptorUsageTypeInterruptReserved2 = kIOUSBEndpointDescriptorUsageTypeInterruptReserved2, + kEndpointDescriptorUsageTypeIsocData = kIOUSBEndpointDescriptorUsageTypeIsocData, + kEndpointDescriptorUsageTypeIsocFeedback = kIOUSBEndpointDescriptorUsageTypeIsocFeedback, + kEndpointDescriptorUsageTypeIsocImplicit = kIOUSBEndpointDescriptorUsageTypeIsocImplicit, + kEndpointDescriptorUsageTypeIsocReserved = kIOUSBEndpointDescriptorUsageTypeIsocReserved, + + kEndpointDescriptorPacketSize = kIOUSBEndpointDescriptorPacketSize, + kEndpointDescriptorPacketSizePhase = kIOUSBEndpointDescriptorPacketSizePhase, + kEndpointDescriptorPacketSizeMult = kIOUSBEndpointDescriptorPacketSizeMult, + kEndpointDescriptorPacketSizeMultPhase = kIOUSBEndpointDescriptorPacketSizeMultPhase, + kEndpointDescriptorReserved = kIOUSBEndpointDescriptorReserved, + kEndpointDescriptorReservedPhase = kIOUSBEndpointDescriptorReservedPhase + }; + + // USB Language Identifiers 1.0 + enum tLanguageID + { + kLanguageIDEnglishUS = kIOUSBLanguageIDEnglishUS + }; + + typedef enum tLanguageID tLanguageID; + + +#ifdef __cplusplus + // USB 2.0 9.6.7: String + struct StringDescriptor : public Descriptor + { +#else + struct StringDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint8_t bString[1]; + } __attribute__((packed)); + + typedef struct StringDescriptor StringDescriptor; + + + enum tDeviceCapabilityType + { + // USB 3.0 Table 9-13 + kDeviceCapabilityTypeWireless = kIOUSBDeviceCapabilityTypeWireless, + kDeviceCapabilityTypeUSB20Extension = kIOUSBDeviceCapabilityTypeUSB20Extension, + kDeviceCapabilityTypeSuperSpeed = kIOUSBDeviceCapabilityTypeSuperSpeed, + kDeviceCapabilityTypeContainerID = kIOUSBDeviceCapabilityTypeContainerID, + + // USB 3.1 Table 9-14 + kDeviceCapabilityTypePlatform = kIOUSBDeviceCapabilityTypePlatform, + kDeviceCapabilityTypePowerDelivery = kIOUSBDeviceCapabilityTypePowerDelivery, + kDeviceCapabilityTypeBatteryInfo = kIOUSBDeviceCapabilityTypeBatteryInfo, + kDeviceCapabilityTypePdConsumerPort = kIOUSBDeviceCapabilityTypePdConsumerPort, + kDeviceCapabilityTypePdProviderPort = kIOUSBDeviceCapabilityTypePdProviderPort, + kDeviceCapabilityTypeSuperSpeedPlus = kIOUSBDeviceCapabilityTypeSuperSpeedPlus, + kDeviceCapabilityTypePrecisionMeasurement = kIOUSBDeviceCapabilityTypePrecisionMeasurement, + kDeviceCapabilityTypeWirelessExt = kIOUSBDeviceCapabilityTypeWirelessExt, + kDeviceCapabilityTypeBillboard = kIOUSBDeviceCapabilityTypeBillboard, + kDeviceCapabilityTypeBillboardAltMode = kIOUSBDeviceCapabilityTypeBillboardAltMode + }; + + typedef enum tDeviceCapabilityType tDeviceCapabilityType; + + +#ifdef __cplusplus + // USB 3.0 9.6.2: Binary Device Object Store (BOS) + struct BOSDescriptor : public Descriptor + { +#else + struct BOSDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint16_t wTotalLength; + uint8_t bNumDeviceCaps; + } __attribute__((packed)); + + typedef struct BOSDescriptor BOSDescriptor; + + +#ifdef __cplusplus + // USB 3.0 9.6.2: Binary Device Object Store (BOS) + struct DeviceCapabilityDescriptor : public Descriptor + { +#else + struct DeviceCapabilityDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint8_t bDevCapabilityType; + } __attribute__((packed)); + + typedef struct DeviceCapabilityDescriptor DeviceCapabilityDescriptor; + + +#ifdef __cplusplus + // USB 3.0 9.6.2.1: USB 2.0 Extension + struct USB20ExtensionCapabilityDescriptor : public DeviceCapabilityDescriptor + { +#else + struct USB20ExtensionCapabilityDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; +#endif + uint32_t bmAttributes; + } __attribute__((packed)); + + typedef struct USB20ExtensionCapabilityDescriptor USB20ExtensionCapabilityDescriptor; + + + enum + { + kUSB20ExtensionCapabilityLPM = kIOUSBUSB20ExtensionCapabilityLPM, + + // From USB 2.0 ECN Errata for Link Power Management. + kUSB20ExtensionCapabilityBESLSupport = kIOUSBUSB20ExtensionCapabilityBESLSupport, + kUSB20ExtensionCapabilityBESLValid = kIOUSBUSB20ExtensionCapabilityBESLValid, + kUSB20ExtensionCapabilityBESLDValid = kIOUSBUSB20ExtensionCapabilityBESLDValid, + kUSB20ExtensionCapabilityBESL = kIOUSBUSB20ExtensionCapabilityBESL, + kUSB20ExtensionCapabilityBESLPhase = kIOUSBUSB20ExtensionCapabilityBESLPhase, + kUSB20ExtensionCapabilityBESLD = kIOUSBUSB20ExtensionCapabilityBESLD, + kUSB20ExtensionCapabilityBESLDPhase = kIOUSBUSB20ExtensionCapabilityBESLDPhase + }; + + +#ifdef __cplusplus + // USB 3.0 9.6.2.2: SuperSpeed USB Device Capability + struct SuperSpeedUSBDeviceCapabilityDescriptor : public DeviceCapabilityDescriptor + { +#else + struct SuperSpeedUSBDeviceCapabilityDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; +#endif + uint8_t bmAttributes; + uint16_t wSpeedsSupported; + uint8_t bFunctionalitySupport; + uint8_t bU1DevExitLat; + uint16_t bU2DevExitLat; + } __attribute__((packed)); + + typedef struct SuperSpeedUSBDeviceCapabilityDescriptor SuperSpeedUSBDeviceCapabilityDescriptor; + + + enum + { + kSuperSpeedDeviceCapabilityLTM = kIOUSBSuperSpeedDeviceCapabilityLTM, + + kSuperSpeedDeviceCapabilityLowSpeed = kIOUSBSuperSpeedDeviceCapabilityLowSpeed, + kSuperSpeedDeviceCapabilityFullSpeed = kIOUSBSuperSpeedDeviceCapabilityFullSpeed, + kSuperSpeedDeviceCapabilityHighSpeed = kIOUSBSuperSpeedDeviceCapabilityHighSpeed, + kSuperSpeedDeviceCapability5Gb = kIOUSBSuperSpeedDeviceCapability5Gb, + + kSuperSpeedDeviceCapabilitySupportLowSpeed = kIOUSBSuperSpeedDeviceCapabilitySupportLowSpeed, + kSuperSpeedDeviceCapabilitySupportFullSpeed = kIOUSBSuperSpeedDeviceCapabilitySupportFullSpeed, + kSuperSpeedDeviceCapabilitySupportHighSpeed = kIOUSBSuperSpeedDeviceCapabilitySupportHighSpeed, + kSuperSpeedDeviceCapabilitySupport5Gb = kIOUSBSuperSpeedDeviceCapabilitySupport5Gb, + + kSuperSpeedDeviceCapabilityU1DevExitLatMax = kIOUSBSuperSpeedDeviceCapabilityU1DevExitLatMax, + kSuperSpeedDeviceCapabilityU2DevExitLatMax = kIOUSBSuperSpeedDeviceCapabilityU2DevExitLatMax + }; + +#ifdef __cplusplus + // USB 3.1 9.6.2.5: SuperSpeedPlus USB Device Capability + struct SuperSpeedPlusUSBDeviceCapabilityDescriptor : public DeviceCapabilityDescriptor + { +#else + struct SuperSpeedPlusUSBDeviceCapabilityDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; +#endif + uint8_t bReserved; + uint32_t bmAttributes; + uint16_t wFunctionalitySupport; + uint16_t wReserved; + uint32_t bmSublinkSpeedAttr[1]; + + } __attribute__((packed)); + + typedef struct SuperSpeedPlusUSBDeviceCapabilityDescriptor SuperSpeedPlusUSBDeviceCapabilityDescriptor; + + enum + { + //bmAttributes + kSuperSpeedPlusDeviceCapabilitySublinkSpeedAttrCount = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedAttrCount, + kSuperSpeedPlusDeviceCapabilitySublinkSpeedAttrCountPhase = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedAttrCountPhase, + + kSuperSpeedPlusDeviceCapabilitySublinkSpeedIdCount = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedIdCount, + kSuperSpeedPlusDeviceCapabilitySublinkSpeedIdCountPhase = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedIdCountPhase, + + //wFunctionalitySupport + kSuperSpeedPlusDeviceCapabilitySublinkMinSpeedId = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkMinSpeedId, + kSuperSpeedPlusDeviceCapabilitySublinkMinSpeedIdPhase = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkMinSpeedIdPhase, + + kSuperSpeedPlusDeviceCapabilityReserved = kIOUSBSuperSpeedPlusDeviceCapabilityReserved, + kSuperSpeedPlusDeviceCapabilityReservedPhase = kIOUSBSuperSpeedPlusDeviceCapabilityReservedPhase, + + kSuperSpeedPlusDeviceCapabilityMinRxLaneCount = kIOUSBSuperSpeedPlusDeviceCapabilityMinRxLaneCount, + kSuperSpeedPlusDeviceCapabilityMinRxLaneCountPhase = kIOUSBSuperSpeedPlusDeviceCapabilityMinRxLaneCountPhase, + + kSuperSpeedPlusDeviceCapabilityMinTxLaneCount = kIOUSBSuperSpeedPlusDeviceCapabilityMinTxLaneCount, + kSuperSpeedPlusDeviceCapabilityMinTxLaneCountPhase = kIOUSBSuperSpeedPlusDeviceCapabilityMinTxLaneCountPhase, + + //bmSublinkSpeedAttr + kSuperSpeedPlusDeviceCapabilitySublinkSpeedId = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedId, + kSuperSpeedPlusDeviceCapabilitySublinkSpeedIdPhase = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedIdPhase, + + kSuperSpeedPlusDeviceCapabilitySublinkLSE = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSE, + kSuperSpeedPlusDeviceCapabilitySublinkLSEPhase = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEPhase, + kSuperSpeedPlusDeviceCapabilitySublinkLSEBits = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEBits, + kSuperSpeedPlusDeviceCapabilitySublinkLSEKbits = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEKbits, + kSuperSpeedPlusDeviceCapabilitySublinkLSEMbits = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEMbits, + kSuperSpeedPlusDeviceCapabilitySublinkLSEGbits = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkLSEGbits, + + kSuperSpeedPlusDeviceCapabilitySublinkType = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkType, + kSuperSpeedPlusDeviceCapabilitySublinkTypePhase = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkTypePhase, + + kSuperSpeedPlusDeviceCapabilitySublinkSymmetry = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSymmetry, + kSuperSpeedPlusDeviceCapabilitySublinkSymmetryPhase = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSymmetryPhase, + kSuperSpeedPlusDeviceCapabilitySublinkSymmetric = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSymmetric, + kSuperSpeedPlusDeviceCapabilitySublinkAsymmetric = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkAsymmetric, + + kSuperSpeedPlusDeviceCapabilitySublinkDirection = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkDirection, + kSuperSpeedPlusDeviceCapabilitySublinkDirectionPhase = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkDirectionPhase, + kSuperSpeedPlusDeviceCapabilitySublinkDirectionRx = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkDirectionRx, + kSuperSpeedPlusDeviceCapabilitySublinkDirectionTx = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkDirectionTx, + + kSuperSpeedPlusDeviceCapabilitySublinkReserved = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkReserved, + kSuperSpeedPlusDeviceCapabilitySublinkReservedPhase = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkReservedPhase, + + kSuperSpeedPlusDeviceCapabilitySublinkProtocol = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkProtocol, + kSuperSpeedPlusDeviceCapabilitySublinkProtocolPhase = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkProtocolPhase, + + kSuperSpeedPlusDeviceCapabilitySublinkSpeedMantissa = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedMantissa, + kSuperSpeedPlusDeviceCapabilitySublinkSpeedMantissaPhase = kIOUSBSuperSpeedPlusDeviceCapabilitySublinkSpeedMantissaPhase, + }; + + +#ifdef __cplusplus + // USB 3.0 9.6.2.3: Container ID + struct ContainerIDCapabilityDescriptor : public DeviceCapabilityDescriptor + { +#else + struct ContainerIDCapabilityDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; +#endif + uint8_t bReserved; + uint32_t containerID[4]; + } __attribute__((packed)); + + typedef struct ContainerIDCapabilityDescriptor ContainerIDCapabilityDescriptor; + +#ifdef __cplusplus + // USB 3.1 9.6.2.4: Platform Descriptor + struct PlatformCapabilityDescriptor : public DeviceCapabilityDescriptor + { +#else + struct PlatformCapabilityDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; +#endif + uint8_t bReserved; + uuid_t uuidPlatformCapability; + }__attribute__((packed)); + + typedef struct PlatformCapabilityDescriptor PlatformCapabilityDescriptor; + + // USB Billboard 3.1.6.2: Billboard Capability Descriptor V1.2 + struct BillboardAltModeCapabilityCompatibility + { + uint16_t wSVID; + uint32_t dwAlternateMode; + uint8_t iAlternateModeString; + }__attribute__((packed)); + + typedef struct BillboardAltModeCapabilityCompatibility BillboardAltModeCapabilityCompatibility; + + // USB Billboard 3.1.6.2: Billboard Capability Descriptor V1.1 and 1.21+ + struct BillboardAltModeCapability + { + uint16_t wSVID; + uint8_t bAlternateMode; + uint8_t iAlternateModeString; + }__attribute__((packed)); + + typedef struct BillboardAltModeCapability BillboardAltModeCapability; + +#ifdef __cplusplus + // USB Billboard 3.1.6.2: Billboard Capability Descriptor + struct BillboardCapabilityDescriptor : public DeviceCapabilityDescriptor + { +#else + struct BillboardCapabilityDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; +#endif + uint8_t iAddtionalInfoURL; + uint8_t bNumberOfAlternateModes; + uint8_t bPreferredAlternateMode; + uint16_t VCONNPower; + uint8_t bmConfigured[32]; + uint16_t bcdVersion; + uint8_t bAdditonalFailureInfo; + uint8_t bReserved; + uint8_t altModeCapabilities[]; + }__attribute__((packed)); + + typedef struct BillboardCapabilityDescriptor BillboardCapabilityDescriptor; + +#ifdef __cplusplus + // USB Billboard 3.1.6.3: Billboard Capability Descriptor V1.21 + struct BillboardAltModeCapabilityDescriptor : public DeviceCapabilityDescriptor + { +#else + struct BillboardAltModeCapabilityDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; +#endif + uint8_t bIndex; + uint16_t dwAlternateModeVdo; + }__attribute__((packed)); + + typedef struct BillboardAltModeCapabilityDescriptor BillboardAltModeCapabilityDescriptor; + +#ifdef __cplusplus + // USB 3.0 9.6.4: Interface Association + struct InterfaceAssociationDescriptor: public Descriptor + { +#else + struct InterfaceAssociationDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint8_t bFirstInterface; + uint8_t bInterfaceCount; + uint8_t bFunctionClass; + uint8_t bFunctionSubClass; + uint8_t bFunctionProtocol; + uint8_t iFunction; + } __attribute__((packed)); + + typedef struct InterfaceAssociationDescriptor InterfaceAssociationDescriptor; + + +#ifdef __cplusplus + // USB 3.1 9.6.7: SuperSpeed Endpoint Companion + struct SuperSpeedEndpointCompanionDescriptor : public Descriptor + { +#else + struct SuperSpeedEndpointCompanionDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint8_t bMaxBurst; + uint8_t bmAttributes; + uint16_t wBytesPerInterval; + } __attribute__((packed)); + + typedef struct SuperSpeedEndpointCompanionDescriptor SuperSpeedEndpointCompanionDescriptor; + + + enum + { + kSuperSpeedEndpointCompanionDescriptorMaxBurst = kIOUSBSuperSpeedEndpointCompanionDescriptorMaxBurst, + kSuperSpeedEndpointCompanionDescriptorMaxBurstPhase = kIOUSBSuperSpeedEndpointCompanionDescriptorMaxBurstPhase, + + kSuperSpeedEndpointCompanionDescriptorBulkMaxStreams = kIOUSBSuperSpeedEndpointCompanionDescriptorBulkMaxStreams, + kSuperSpeedEndpointCompanionDescriptorBulkMaxStreamsPhase = kIOUSBSuperSpeedEndpointCompanionDescriptorBulkMaxStreamsPhase, + kSuperSpeedEndpointCompanionDescriptorBulkReserved = kIOUSBSuperSpeedEndpointCompanionDescriptorBulkReserved, + kSuperSpeedEndpointCompanionDescriptorBulkReservedPhase = kIOUSBSuperSpeedEndpointCompanionDescriptorBulkReservedPhase, + kSuperSpeedEndpointCompanionDescriptorIsocMult = kIOUSBSuperSpeedEndpointCompanionDescriptorIsocMult, + kSuperSpeedEndpointCompanionDescriptorIsocMultPhase = kIOUSBSuperSpeedEndpointCompanionDescriptorIsocMultPhase, + kSuperSpeedEndpointCompanionDescriptorIsocReserved = kIOUSBSuperSpeedEndpointCompanionDescriptorIsocReserved, + kSuperSpeedEndpointCompanionDescriptorIsocReservedPhase = kIOUSBSuperSpeedEndpointCompanionDescriptorIsocReservedPhase, + kSuperSpeedEndpointCompanionDescriptorSSPIsocCompanion = kIOUSBSuperSpeedEndpointCompanionDescriptorSSPIsocCompanion + }; + + +#ifdef __cplusplus + // USB 3.1 9.6.8: SuperSpeedPlus Isochronous Endpoint Companion + struct SuperSpeedPlusIsochronousEndpointCompanionDescriptor : public Descriptor + { +#else + struct SuperSpeedPlusIsochronousEndpointCompanionDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint16_t wReserved; + uint32_t dwBytesPerInterval; + } __attribute__((packed)); + + typedef struct SuperSpeedPlusIsochronousEndpointCompanionDescriptor SuperSpeedPlusIsochronousEndpointCompanionDescriptor; + + +#ifdef __cplusplus + // USB 2.0 11.23.2.1: Hub Descriptor + struct HubDescriptor : public Descriptor + { +#else + struct HubDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint8_t bNumberPorts; + uint16_t wHubCharacteristics; + uint8_t bPowerOnToPowerGood; + uint8_t bHubControllerCurrent; + uint8_t deviceRemovable[2]; // Technically variable size + uint8_t reserved[2]; // Unused + } __attribute__((packed)); + + typedef struct HubDescriptor HubDescriptor; + + +#ifdef __cplusplus + // USB 3.0 10.13.2.1: SuperSpeed Hub Descriptor + struct SuperSpeedHubDescriptor : public Descriptor + { +#else + struct SuperSpeedHubDescriptor + { + uint8_t bLength; + uint8_t bDescriptorType; +#endif + uint8_t bNumberPorts; + uint16_t wHubCharacteristics; + uint8_t bPowerOnToPowerGood; + uint8_t bHubControllerCurrent; + uint8_t bHubDecodeLatency; + uint16_t wHubDelay; + uint16_t deviceRemovable; + } __attribute__((packed)); + + typedef struct SuperSpeedHubDescriptor SuperSpeedHubDescriptor; + + + enum + { + kSuperSpeedHubCharacteristicsPowerSwitchingMask = kIOUSBSuperSpeedHubCharacteristicsPowerSwitchingMask, + kSuperSpeedHubCharacteristicsPowerSwitchingGanged = kIOUSBSuperSpeedHubCharacteristicsPowerSwitchingGanged, + kSuperSpeedHubCharacteristicsPowerSwitchingIndividual = kIOUSBSuperSpeedHubCharacteristicsPowerSwitchingIndividual, + kSuperSpeedHubCharacteristicsCompoundDevice = kIOUSBSuperSpeedHubCharacteristicsCompoundDevice, + kSuperSpeedHubCharacteristicsOverCurrentMask = kIOUSBSuperSpeedHubCharacteristicsOverCurrentMask, + kSuperSpeedHubCharacteristicsOverCurrentGlobal = kIOUSBSuperSpeedHubCharacteristicsOverCurrentGlobal, + kSuperSpeedHubCharacteristicsOverCurrentIndividual = kIOUSBSuperSpeedHubCharacteristicsOverCurrentIndividual, + kSuperSpeedHubCharacteristicsReserved = kIOUSBSuperSpeedHubCharacteristicsReserved, + + kSuperSpeedHubDecodeLatencyMax = kIOUSBSuperSpeedHubDecodeLatencyMax, + kSuperSpeedHubDelayMax = kIOUSBSuperSpeedHubDelayMax + }; + +#ifdef __cplusplus +#pragma mark Descriptor list parsing + /*! + * @brief Get the next descriptor in a configuration descriptor + * @discussion This method will advance currentDescriptor by its bLength, and validate that the new descriptor fits withing the bounds of configurationDescriptor. Using NULL for currentDescriptor will return the first descriptor after the configuration descriptor. + * @param configurationDescriptor Configuration descriptor that contains the descriptors to iterate through + * @param currentDescriptor A descriptor pointer within the bounds of configurationDescriptor, or NULL + * @return Descriptor pointer, or NULL if no descriptor can be returned + */ + const Descriptor* getNextDescriptor(const ConfigurationDescriptor* configurationDescriptor, const Descriptor* currentDescriptor); + + /*! + * @brief Find the next descriptor matching a given type within a configuration descriptor + * @discussion This method uses getNextDescriptor, and further validates that the returned descriptor's bDescriptorType field matches the type parameter. + * @param configurationDescriptor Configuration descriptor that contains the descriptors to iterate through + * @param currentDescriptor A descriptor pointer within the bounds of configurationDescriptor, or NULL + * @param type tDescriptorType representing the descriptor type to find + * @return Descriptor pointer, or NULL if no matching descriptor can be found + */ + const Descriptor* getNextDescriptorWithType(const ConfigurationDescriptor* configurationDescriptor, const Descriptor* currentDescriptor, const uint8_t type); + + /*! + * @brief Get the next descriptor in a configuration descriptor that belongs to another container descriptor + * @discussion This method uses getNextDescriptor, but will return NULL if another descriptor is found whose bDescriptorType field matches the value used for parentDescriptor's bDescriptorType. Using NULL for currentDescriptor will return the first descriptor after parentDescriptor. + * @param configurationDescriptor Configuration descriptor that contains the descriptors to iterate through + * @param parentDescriptor A descriptor pointer within the bounds of configurationDescriptor + * @param currentDescriptor A descriptor pointer within the bounds of configurationDescriptor, or NULL + * @return Descriptor pointer, or NULL if no descriptor can be returned + */ + const Descriptor* getNextAssociatedDescriptor(const ConfigurationDescriptor* configurationDescriptor, const Descriptor* parentDescriptor, const Descriptor* currentDescriptor); + + /*! + * @brief Find the next descriptor matching a given type within a configuration descriptor that belongs to another container descriptor + * @discussion This method uses getNextAssociatedDescriptor, and further validates that the returned descriptor's bDescriptorType field matches the type passed parameter. + * @param configurationDescriptor Configuration descriptor that contains the descriptors to iterate through + * @param parentDescriptor A descriptor pointer within the bounds of configurationDescriptor + * @param currentDescriptor A descriptor pointer within the bounds of configurationDescriptor, or NULL + * @param type tDescriptorType representing the descriptor type to find + * @return Descriptor pointer, or NULL if no matching descriptor can be found + */ + const Descriptor* getNextAssociatedDescriptorWithType(const ConfigurationDescriptor* configurationDescriptor, const Descriptor* parentDescriptor, const Descriptor* currentDescriptor, const uint8_t type); + + /*! + * @brief Find the next interface association descriptor in a configuration descriptor + * @discussion This method uses getNextDescriptorWithType to fetch the next interface association descriptor + * @param configurationDescriptor Configuration descriptor that contains the descriptors to iterate through + * @param currentDescriptor A descriptor pointer within the bounds of configurationDescriptor, or NULL + * @return InterfaceAssociationDescriptor pointer, or NULL if no matching descriptor can be found + */ + const InterfaceAssociationDescriptor* getNextInterfaceAssociationDescriptor(const ConfigurationDescriptor* configurationDescriptor, const Descriptor* currentDescriptor); + + /*! + * @brief Find the next interface descriptor in a configuration descriptor + * @discussion This method uses getNextDescriptorWithType to fetch the next interface descriptor + * @param configurationDescriptor Configuration descriptor that contains the descriptors to iterate through + * @param currentDescriptor A descriptor pointer within the bounds of configurationDescriptor, or NULL + * @return InterfaceDescriptor pointer, or NULL if no matching descriptor can be found + */ + const InterfaceDescriptor* getNextInterfaceDescriptor(const ConfigurationDescriptor* configurationDescriptor, const Descriptor* currentDescriptor); + + /*! + * @brief Find the next endpoint descriptor associated with an interface descriptor + * @discussion This method uses getNextAssociatedDescriptorWithType to fetch the next endpoint descriptor associated with a specific interface descriptor + * @param configurationDescriptor Configuration descriptor that contains the descriptors to iterate through + * @param interfaceDescriptor An interface descriptor within the bounds of configurationDescriptor + * @param currentDescriptor A descriptor pointer within the bounds of configurationDescriptor, or NULL + * @return EndpointDescriptor pointer, or NULL if no matching descriptor can be found + */ + const EndpointDescriptor* getNextEndpointDescriptor(const ConfigurationDescriptor* configurationDescriptor, const InterfaceDescriptor* interfaceDescriptor, const Descriptor* currentDescriptor); + + /*! + * @brief Get the next device capability descriptor in a BOS descriptor + * @discussion This method will advance currentDescriptor by its bLength, and validate that the new descriptor fits withing the bounds of bosDescriptor. Using NULL for currentDescriptor will return the first descriptor after the BOS descriptor. + * @param bosDescriptor BOS descriptor that contains the descriptors to iterate through + * @param currentDescriptor A descriptor pointer within the bounds of bosDescriptor, or NULL + * @return DeviceCapabilityDescriptor pointer, or NULL if no descriptor can be returned + */ + const DeviceCapabilityDescriptor* getNextCapabilityDescriptor(const BOSDescriptor* bosDescriptor, const DeviceCapabilityDescriptor* currentDescriptor); + + /*! + * @brief Find the next descriptor matching a given type within a BOS descriptor + * @discussion This method uses getNextCapabilityDescriptor, and further validates that the returned descriptor's bDevCapabilityType field matches the type parameter. + * @param bosDescriptor BOS descriptor that contains the descriptors to iterate through + * @param currentDescriptor A descriptor pointer within the bounds of bosDescriptor, or NULL + * @param type tDeviceCapabilityType representing the descriptor type to find + * @return DeviceCapabilityDescriptor pointer, or NULL if no matching descriptor can be found + */ + const DeviceCapabilityDescriptor* getNextCapabilityDescriptorWithType(const BOSDescriptor* bosDescriptor, const DeviceCapabilityDescriptor* currentDescriptor, const uint8_t type); + + /*! + * @brief Find the first USB20ExtensionCapabilityDescriptor in a BOS descriptor + * @discussion This method uses getNextCapabilityDescriptorWithType to fetch the first USB20ExtensionCapabilityDescriptor + * @param bosDescriptor BOS descriptor that contains the descriptors to iterate through + * @return USB20ExtensionCapabilityDescriptor pointer, or NULL if no matching descriptor can be found + */ + const USB20ExtensionCapabilityDescriptor* getUSB20ExtensionDeviceCapabilityDescriptor(const BOSDescriptor* bosDescriptor); + + /*! + * @brief Find the first SuperSpeedUSBDeviceCapabilityDescriptor in a BOS descriptor + * @discussion This method uses getNextCapabilityDescriptorWithType to fetch the first SuperSpeedUSBDeviceCapabilityDescriptor + * @param bosDescriptor BOS descriptor that contains the descriptors to iterate through + * @return SuperSpeedUSBDeviceCapabilityDescriptor pointer, or NULL if no matching descriptor can be found + */ + const SuperSpeedUSBDeviceCapabilityDescriptor* getSuperSpeedDeviceCapabilityDescriptor(const BOSDescriptor* bosDescriptor); + + /*! + * @brief Find the first SuperSpeedPlusUSBDeviceCapabilityDescriptor in a BOS descriptor + * @discussion This method uses getNextCapabilityDescriptorWithType to fetch the first SuperSpeedPlusUSBDeviceCapabilityDescriptor + * @param bosDescriptor BOS descriptor that contains the descriptors to iterate through + * @return SuperSpeedPlusUSBDeviceCapabilityDescriptor pointer, or NULL if no matching descriptor can be found + */ + const SuperSpeedPlusUSBDeviceCapabilityDescriptor* getSuperSpeedPlusDeviceCapabilityDescriptor(const BOSDescriptor* bosDescriptor); + + /*! + * @brief Find the first ContainerIDCapabilityDescriptor in a BOS descriptor + * @discussion This method uses getNextCapabilityDescriptorWithType to fetch the first ContainerIDCapabilityDescriptor + * @param bosDescriptor BOS descriptor that contains the descriptors to iterate through + * @return ContainerIDCapabilityDescriptor pointer, or NULL if no matching descriptor can be found + */ + const ContainerIDCapabilityDescriptor* getContainerIDDescriptor(const BOSDescriptor* bosDescriptor); + + /*! + * @brief Find the first PlatformCapabilityDescriptor in a BOS descriptor + * @discussion This method uses getNextCapabilityDescriptorWithType to fetch the first PlatformCapabilityDescriptor + * @param bosDescriptor BOS descriptor that contains the descriptors to iterate through + * @return PlatformCapabilityDescriptor pointer, or NULL if no matching descriptor can be found + */ + const PlatformCapabilityDescriptor* getPlatformCapabilityDescriptor(const BOSDescriptor* bosDescriptor); + + /*! + * @brief Find the first BillboardCapabilityDescriptor in a BOS descriptor + * @discussion This method uses getNextCapabilityDescriptorWithType to fetch the first BillboardCapabilityDescriptor + * @param bosDescriptor BOS descriptor that contains the descriptors to iterate through + * @return BillboardCapabilityDescriptor pointer, or NULL if no matching descriptor can be found + */ + const BillboardCapabilityDescriptor* getBillboardDescriptor(const BOSDescriptor* bosDescriptor); + + +#pragma mark Device descriptor parsing + /*! + * @brief Validate the contents of a device descriptor + * @discussion This method parses a device descriptor and validates its contents. If repairable validation errors are encountered, the descriptor passed in may be modified. + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The descriptor to validate + * @return bool true if the descriptor passed validation, false if it did not + */ + bool validateDeviceDescriptor(uint32_t usbDeviceSpeed, const DeviceDescriptor* descriptor); + +#pragma mark Endpoint descriptor parsing + /*! + * @brief Extract the direction of an endpoint from an endpoint descriptor + * @discussion This method parses an endpoint descriptor to determine its transfer direction + * @param descriptor The descriptor to parse + * @return tEndpointDirection indicating the direction found. Control endpoints return tEndpointDirection. + */ + uint8_t getEndpointDirection(const EndpointDescriptor* descriptor); + + /*! + * @brief Extract the direction and number of an endpoint from an endpoint descriptor + * @discussion This method parses an endpoint descriptor to determine its address + * @param descriptor The descriptor to parse + * @return uint8_t representing direction and endpoint number + */ + uint8_t getEndpointAddress(const EndpointDescriptor* descriptor); + + /*! + * @brief Extract the number of an endpoint from an endpoint descriptor + * @discussion This method parses an endpoint descriptor to determine its number, excluding direction + * @param descriptor The descriptor to parse + * @return uint8_t representing endpoint number + */ + uint8_t getEndpointNumber(const EndpointDescriptor* descriptor); + + /*! + * @brief Extract the type of an endpoint from an endpoint descriptor + * @discussion This method parses an endpoint descriptor to determine its type + * @param descriptor The descriptor to parse + * @return tEndpointType indicating the type found. + */ + uint8_t getEndpointType(const EndpointDescriptor* descriptor); + + /*! + * @brief Validate the max packet size of an endpoint descriptor + * @discussion This method parses an endpoint descriptor and validates the max packet size. If repairable validation errors are encountered, the descriptor passed in may be modified. + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The descriptor to validate + * @return bool true if the descriptor passed validation, false if it did not + */ + bool validateEndpointMaxPacketSize(uint32_t usbDeviceSpeed, const EndpointDescriptor* descriptor); + + /*! + * @brief Extract the max packet size from an endpoint descriptor + * @discussion This method parses an endpoint descriptor to determine its max packet size, which does not take into account mult or burst factors. + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The descriptor to parse + * @return uint16_t The max packet size in bytes + */ + uint16_t getEndpointMaxPacketSize(uint32_t usbDeviceSpeed, const EndpointDescriptor* descriptor); + + /*! + * @brief Validate the burst size of endpoint descriptors + * @discussion This method parses endpoint descriptors and validates the burst size. If repairable validation errors are encountered, the descriptors passed in may be modified. + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to validate + * @param companionDescriptor The SuperSpeedEndpointCompanionDescriptor to validate, or NULL + * @return bool true if the descriptor passed validation, false if it did not + */ + bool validateEndpointBurstSize(uint32_t usbDeviceSpeed, const EndpointDescriptor* descriptor, const SuperSpeedEndpointCompanionDescriptor* companionDescriptor); + + /*! + * @brief Validate the burst size of endpoint descriptors + * @discussion This method parses endpoint descriptors and validates the burst size. If repairable validation errors are encountered, the descriptors passed in may be modified. + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to validate + * @param companionDescriptor The SuperSpeedEndpointCompanionDescriptor to validate, or NULL + * @param sspCompanionDescriptor The SuperSpeedPlusIsochronousEndpointCompanionDescriptor to validate, or NULL + * @return bool true if the descriptor passed validation, false if it did not + */ + bool validateEndpointBurstSize(uint32_t usbDeviceSpeed, + const EndpointDescriptor* descriptor, + const SuperSpeedEndpointCompanionDescriptor* companionDescriptor, + const SuperSpeedPlusIsochronousEndpointCompanionDescriptor* sspCompanionDescriptor); + + /*! + * @brief Extract the burst size from endpoint descriptors + * @discussion This method parses endpoint descriptors to determine burst size, which includes mult and burst factors as applicable. + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to parse + * @param companionDescriptor The SuperSpeedEndpointCompanionDescriptor to parse, or NULL + * @return uint16_t The burst size in bytes + */ + uint16_t getEndpointBurstSize(uint32_t usbDeviceSpeed, const EndpointDescriptor* descriptor, const SuperSpeedEndpointCompanionDescriptor* companionDescriptor); + + /*! + * @brief Extract the burst size from endpoint descriptors + * @discussion This method parses endpoint descriptors to determine burst size, which includes mult and burst factors as applicable. SuperSpeed Plus isochronous endpoints will return the dwBytesPerInterval field from the SuperSpeedPlusIsochronousEndpointCompanionDescriptor parameter. + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to parse + * @param companionDescriptor The SuperSpeedEndpointCompanionDescriptor to parse, or NULL + * @param sspCompanionDescriptor The SuperSpeedPlusIsochronousEndpointCompanionDescriptor to parse, or NULL + * @return uint32_t The burst size in bytes + */ + uint32_t getEndpointBurstSize32(uint32_t usbDeviceSpeed, + const EndpointDescriptor* descriptor, + const SuperSpeedEndpointCompanionDescriptor* companionDescriptor = NULL, + const SuperSpeedPlusIsochronousEndpointCompanionDescriptor* sspCompanionDescriptor = NULL); + + /*! + * @brief Extract the mult count from endpoint descriptors + * @discussion This method parses endpoint descriptors to determine mult + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to parse + * @param companionDescriptor The SuperSpeedEndpointCompanionDescriptor to parse, or NULL + * @param sspCompanionDescriptor The SuperSpeedPlusIsochronousEndpointCompanionDescriptor to parse, or NULL + * @return uint8_t The mult count + */ + uint8_t getEndpointMult(uint32_t usbDeviceSpeed, + const EndpointDescriptor* descriptor, + const SuperSpeedEndpointCompanionDescriptor* companionDescriptor = NULL, + const SuperSpeedPlusIsochronousEndpointCompanionDescriptor* sspCompanionDescriptor = NULL); + + /*! + * @brief Validate the interval of an endpoint descriptor + * @discussion This method parses an endpoint descriptor and validates the interval. If repairable validation errors are encountered, the descriptor passed in may be modified. + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to validate + * @return bool true if the descriptor passed validation, false if it did not + */ + bool validateEndpointInterval(uint32_t usbDeviceSpeed, const EndpointDescriptor* descriptor); + + /*! + * @brief Extract the interval of an endpoint descriptor + * @discussion This method parses an endpoint descriptor and returns the service interval as n in (2^(n-1)) microframes + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to parse + * @return uint32_t Encoded endpoint interval + */ + uint32_t getEndpointIntervalEncodedMicroframes(uint32_t usbDeviceSpeed, const EndpointDescriptor* descriptor); + + /*! + * @brief Extract the interval of an endpoint descriptor + * @discussion This method parses an endpoint descriptor and returns the service interval in microframes + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to parse + * @return uint32_t Endpoint interval in microframes + */ + uint32_t getEndpointIntervalMicroframes(uint32_t usbDeviceSpeed, const EndpointDescriptor* descriptor); + + /*! + * @brief Extract the interval of an endpoint descriptor + * @discussion This method parses an endpoint descriptor and returns the service interval in frames + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to parse + * @return uint32_t Endpoint interval in frames + */ + uint32_t getEndpointIntervalFrames(uint32_t usbDeviceSpeed, const EndpointDescriptor* descriptor); + + /*! + * @brief Extract the number of streams supported by an endpoint + * @discussion This method parses endpoint descriptors and returns the number of streams supported as n in (2^n) + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to parse + * @param companionDescriptor The SuperSpeedEndpointCompanionDescriptor to parse + * @return uint32_t Encoded number of streams + */ + uint32_t getEndpointMaxStreamsEncoded(uint32_t usbDeviceSpeed, const EndpointDescriptor* descriptor, const SuperSpeedEndpointCompanionDescriptor* companionDescriptor); + + /*! + * @brief Extract the number of streams supported by an endpoint + * @discussion This method parses endpoint descriptors and returns the number of streams supported + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to parse + * @param companionDescriptor The SuperSpeedEndpointCompanionDescriptor to parse + * @return uint32_t Number of streams + */ + uint32_t getEndpointMaxStreams(uint32_t usbDeviceSpeed, const EndpointDescriptor* descriptor, const SuperSpeedEndpointCompanionDescriptor* companionDescriptor); + + /*! + * @brief Extract the maximum bus current required by a configuration descriptor + * @discussion This method parses a configuration descriptor and returns the number of milliamps required to power the device + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The ConfigurationDescriptor to parse + * @return uint32_t milliamps required + */ + uint32_t getConfigurationMaxPowerMilliAmps(uint32_t usbDeviceSpeed, const ConfigurationDescriptor* descriptor); + + /*! + * @brief Validate the contents of an endpoint descriptor + * @discussion This method parses an endpoint descriptor and validates its contents. If repairable validation errors are encountered, the descriptor passed in may be modified. + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to validate + * @param companionDescriptor The SuperSpeedEndpointCompanionDescriptor to validate, or NULL + * @return bool true if the descriptor passed validation, false if it did not + */ + bool validateEndpointDescriptor(uint32_t usbDeviceSpeed, const EndpointDescriptor* descriptor, const SuperSpeedEndpointCompanionDescriptor* companionDescriptor); + + /*! + * @brief Validate the contents of an endpoint descriptor + * @discussion This method parses an endpoint descriptor and validates its contents. If repairable validation errors are encountered, the descriptor passed in may be modified. + * @param usbDeviceSpeed The operational speed of the device + * @param descriptor The EndpointDescriptor to validate + * @param companionDescriptor The SuperSpeedEndpointCompanionDescriptor to validate, or NULL + * @param sspCompanionDescriptor The SuperSpeedPlusIsochronousEndpointCompanionDescriptor to validate, or NULL + * @return bool true if the descriptor passed validation, false if it did not + */ + bool validateEndpointDescriptor(uint32_t usbDeviceSpeed, + const EndpointDescriptor* descriptor, + const SuperSpeedEndpointCompanionDescriptor* companionDescriptor, + const SuperSpeedPlusIsochronousEndpointCompanionDescriptor* sspCompanionDescriptor); + +#pragma mark String descriptor parsing + /*! + * @brief Convert a USB string descriptor to a UTF8 character string + * @discussion This method uses utf8_encodestr with appropriate options to convert a USB string descriptor to a UTF8 string. + * @param stringDescriptor Descriptor to convert + * @param stringBuffer Buffer to write the UTF8 string to + * @param length Reference to size_t. As input it is the size stringBuffer. As output it is the number of character written to stringBuffer. + * @return IOReturn result code. kIOReturnSuccess if any portion of the string could be converted and placed in stringBuffer. kIOReturnError if the string descriptor cannot be converted to UTF8. + */ + IOReturn stringDescriptorToUTF8(const StringDescriptor* stringDescriptor, char* stringBuffer, size_t& length); + +#pragma mark Capability descriptor parsing + /*! + * @brief Validate the contents of a BOS descriptor + * @discussion This method parses a BOS descriptor and validates its contents, as well as the contents of its associated device capability descriptors. If repairable validation errors are encountered, the descriptor passed in may be modified. + * @param bosDescriptor The BOSDescriptor to validate + * @return bool true if the descriptor passed validation, false if it did not + */ + bool validateDeviceCapabilityDescriptors(const BOSDescriptor* bosDescriptor); + +#endif // __cplusplus + +#pragma mark Device requests + // USB 2.0 9.3: USB Device Requests + struct DeviceRequest + { + uint8_t bmRequestType; + uint8_t bRequest; + uint16_t wValue; + uint16_t wIndex; + uint16_t wLength; + } __attribute__((packed)); + + typedef struct DeviceRequest DeviceRequest; + + // USB 3.0 9.4.12: Set SEL Standard Device Request + struct DeviceRequestSetSELData + { + uint8_t u1Sel; // Time in μs for U1 System Exit Latency + uint8_t u1Pel; // Time in μs for U1 Device to Host Exit Latency + uint16_t u2Sel; // Time in μs for U2 System Exit Latency + uint16_t u2Pel; // Time in μs for U2 Device to Host Exit Latency + } __attribute__((packed)); + + typedef struct DeviceRequestSetSELData DeviceRequestSetSELData; + + enum + { + kDeviceRequestSize = kIOUSBDeviceRequestSize, + kDeviceRequestDirectionMask = kIOUSBDeviceRequestDirectionMask, + kDeviceRequestDirectionPhase = kIOUSBDeviceRequestDirectionPhase, + kDeviceRequestDirectionOut = kIOUSBDeviceRequestDirectionOut, + kDeviceRequestDirectionIn = kIOUSBDeviceRequestDirectionIn, + kDeviceRequestTypeMask = kIOUSBDeviceRequestTypeMask, + kDeviceRequestTypePhase = kIOUSBDeviceRequestTypePhase, + kDeviceRequestTypeStandard = kIOUSBDeviceRequestTypeStandard, + kDeviceRequestTypeClass = kIOUSBDeviceRequestTypeClass, + kDeviceRequestTypeVendor = kIOUSBDeviceRequestTypeVendor, + kDeviceRequestRecipientMask = kIOUSBDeviceRequestRecipientMask, + kDeviceRequestRecipientPhase = kIOUSBDeviceRequestRecipientPhase, + kDeviceRequestRecipientDevice = kIOUSBDeviceRequestRecipientDevice, + kDeviceRequestRecipientInterface= kIOUSBDeviceRequestRecipientInterface, + kDeviceRequestRecipientEndpoint = kIOUSBDeviceRequestRecipientEndpoint, + kDeviceRequestRecipientOther = kIOUSBDeviceRequestRecipientOther, + }; + + // USB 2.0 9.4: Standard Device Requests + // USB 3.0 9.4: Standard Device Requests + enum + { + kDeviceRequestGetStatus = kIOUSBDeviceRequestGetStatus, + kDeviceRequestClearFeature = kIOUSBDeviceRequestClearFeature, + kDeviceRequestGetState = kIOUSBDeviceRequestGetState, + kDeviceRequestSetFeature = kIOUSBDeviceRequestSetFeature, + kDeviceRequestSetAddress = kIOUSBDeviceRequestSetAddress, + kDeviceRequestGetDescriptor = kIOUSBDeviceRequestGetDescriptor, + kDeviceRequestSetDescriptor = kIOUSBDeviceRequestSetDescriptor, + kDeviceRequestGetConfiguration = kIOUSBDeviceRequestGetConfiguration, + kDeviceRequestSetConfiguration = kIOUSBDeviceRequestSetConfiguration, + kDeviceRequestGetInterface = kIOUSBDeviceRequestGetInterface, + kDeviceRequestSetInterface = kIOUSBDeviceRequestSetInterface, + kDeviceRequestSynchFrame = kIOUSBDeviceRequestSynchFrame, + kDeviceRequestSetSel = kIOUSBDeviceRequestSetSel, + kDeviceRequestSetIsochronousDelay = kIOUSBDeviceRequestSetIsochronousDelay + }; + + // USB 2.0 9.4.5: Get Status + // USB 3.0 9.4.5: Get Status + enum + { + kDeviceStatusSelfPowered = kIOUSBDeviceStatusSelfPowered, + kDeviceStatusRemoteWakeEnable = kIOUSBDeviceStatusRemoteWakeEnable, + kDeviceStatusU1Enable = kIOUSBDeviceStatusU1Enable, + kDeviceStatusU2Enable = kIOUSBDeviceStatusU2Enable, + kDeviceStatusLTMEnable = kIOUSBDeviceStatusLTMEnable, + + kInterfaceStatusRemoteWakeCapable = kIOUSBInterfaceStatusRemoteWakeCapable, + kInterfaceStatusRemoteWakeEnable = kIOUSBInterfaceStatusRemoteWakeEnable, + + kEndpointStatusHalt = IOUSBEndpointStatusHalt + }; + + // USB 2.0 Table 9-6: Standard Feature Selectors + // USB 3.0 Table 9-7: Standard Feature Selectors + enum + { + kDeviceFeatureSelectorRemoteWakeup = kIOUSBDeviceFeatureSelectorRemoteWakeup, + kDeviceFeatureSelectorTestMode = kIOUSBDeviceFeatureSelectorTestMode, + kDeviceFeatureSelectorU1Enable = kIOUSBDeviceFeatureSelectorU1Enable, + kDeviceFeatureSelectorU2Enable = kIOUSBDeviceFeatureSelectorU2Enable, + kDeviceFeatureSelectorLTMEnable = kIOUSBDeviceFeatureSelectorLTMEnable, + + kInterfaceFeatureSelectorSuspend = kIOUSBInterfaceFeatureSelectorSuspend, + + kEndpointFeatureSelectorStall = IOUSBEndpointFeatureSelectorStall, + }; + + // USB 3.0 Table 9-8: Suspend Options + enum + { + kInterfaceSuspendLowPower = kIOUSBInterfaceSuspendLowPower, + kInterfaceSuspendRemoteWakeEnable = kIOUSBInterfaceSuspendRemoteWakeEnable + }; + + // USB 3.0 Table 10-16: Hub Parameters + enum + { + kHubPort2PortExitLatencyNs = kIOUSBHubPort2PortExitLatencyNs, + kHubDelayNs = kIOUSBHubDelayNs + }; + + // USB 3.0 Table 8-33: Timing Parameters + enum + { + kPingResponseTimeNs = kIOUSBPingResponseTimeNs + }; + + enum tBusVoltage + { + kBusVoltageDefault = kIOUSBBusVoltageDefault + }; + +#ifdef __cplusplus +} + + +namespace StandardUSB20 +{ +#pragma mark BESL & HIRD Encodings + + /*! + * @brief BESL Encodings from Table X-X1 in USB 2.0 ECN Errata for Link Power Management + * @discussion This method converts the Best Effort Service Latency Index value used in the USB 2.0 Extension descriptor to Nanoseconds. + * @param beslIndex The BESL Index value used in the USB 2.0 Extension descriptor + * @param beslNs Reference to uint32_t. As output, it is the converted BESL value in Nanoseconds + * @return result code. kIOReturnSuccess if the conversion was successful. kIOReturnBadArgument if the input beslIndex is invalid. + */ + IOReturn convertBESLIndexToNs(uint32_t beslIndex, uint32_t& beslNs); + + /*! + * @brief BESL Encodings from Table X-X1 in USB 2.0 ECN Errata for Link Power Management + * @discussion This method does the opposite of convertBESLIndexToUs. It converts the BESL value in Nanoseconds to Index. + * @param beslNs The converted BESL value in Nanoseconds + * @param beslIndex Reference to uint32_t. As output, it is the BESL Index value converted from Nanoseconds. + * @return result code. kIOReturnSuccess if the conversion was successful. kIOReturnBadArgument if the input beslNs is invalid. + */ + IOReturn convertBESLNsToIndex(uint32_t beslNs, uint32_t &beslIndex); + + enum tBusCurrent + { + kBusCurrentMinimum = kIOUSB20BusCurrentMinimum, + kBusCurrentDefault = kIOUSB20BusCurrentDefault, + kBusCurrentMaxPowerUnits = kIOUSB20BusCurrentMaxPowerUnits + + }; +} + +namespace StandardUSB30 +{ + enum tBusCurrent + { + kBusCurrentMinimum = kIOUSB30BusCurrentMinimum, + kBusCurrentDefault = kIOUSB30BusCurrentDefault, + kBusCurrentMaxPowerUnits = kIOUSB30BusCurrentMaxPowerUnits + }; + + // USB 3.0 Table 6-21 + enum tResetTimeout + { + kResetMinimumTimeout = kIOUSB30ResetMinimumTimeout, + kResetTypicalTimeout = kIOUSB30ResetTypicalTimeout, + kResetMaximumTimeout = kIOUSB30ResetMaximumTimeout, + kResetMaximumWithMarginTimeout = kIOUSB30ResetMaximumWithMarginTimeout + }; + + // USB 3.0 Table 7-12 + enum tLinkStateTimeout + { + kLinkStateSSInactiveQuietTimeout = kIOUSB30LinkStateSSInactiveQuietTimeout, + kLinkStateRxDetectQuietTimeout = kIOUSB30LinkStateRxDetectQuietTimeout, + kLinkStatePollingLFPSTimeout = kIOUSB30LinkStatePollingLFPSTimeout, + kLinkStatePollingActiveTimeout = kIOUSB30LinkStatePollingActiveTimeout, + kLinkStatePollingConfigurationTimeout = kIOUSB30LinkStatePollingConfigurationTimeout, + kLinkStatePollingIdleTimeout = kIOUSB30LinkStatePollingIdleTimeout, + kLinkStateU0RecoveryTimeout = kIOUSB30LinkStateU0RecoveryTimeout, + kLinkStateU0LTimeout = kIOUSB30LinkStateU0LTimeout, // 10 microseconds + kLinkStateU1NoLFPSResponseTimeout = kIOUSB30LinkStateU1NoLFPSResponseTimeout, + kLinkStateU1PingTimeout = kIOUSB30LinkStateU1PingTimeout, + kLinkStateU2NoLFPSResponseTimeout = kIOUSB30LinkStateU2NoLFPSResponseTimeout, + kLinKStateU2RxDetectDelay = kIOUSB30LinKStateU2RxDetectDelay, + kLinkStateU3NoLFPSResponseTimeout = kIOUSB30LinkStateU3NoLFPSResponseTimeout, + kLinkStateU3WakeupRetryDelay = kIOUSB30LinkStateU3WakeupRetryDelay, + kLinkStateU3RxDetectDelay = kIOUSB30LinkStateU3RxDetectDelay, + kLinkStateRecoveryActiveTimeout = kIOUSB30LinkStateRecoveryActiveTimeout, + kLinkStateRecoveryConfigurationTimeout = kIOUSB30LinkStateRecoveryConfigurationTimeout, + kLinkStateRecoveryIdleTimeout = kIOUSB30LinkStateRecoveryIdleTimeout, + kLinkStateLoopbackExitTimeout = kIOUSB30LinkStateLoopbackExitTimeout, + kLinkStateHotResetActiveTimeout = kIOUSB30LinkStateHotResetActiveTimeout, + kLinkStateHotResetExistTimeout = kIOUSB30LinkStateHotResetExistTimeout, + + // USB 3.0 7.5.4 + kLinkStatePollingDeadline = kIOUSB30LinkStatePollingDeadline, + + // USB 3.0 7.5.9 and 7.5.10 + kLinkStateSSResumeDeadline = kIOUSB30LinkStateSSResumeDeadline, + }; + + // USB 3.1 Table 8-18 + enum tDeviceNotificationType + { + kDeviceNotificationTypeFunctionWake = kIOUSB30DeviceNotificationTypeFunctionWake, + kDeviceNotificationTypeLatencyTolerance = kIOUSB30DeviceNotificationTypeLatencyTolerance, + kDeviceNotificationTypeBusIntervalAdjustment = kIOUSB30DeviceNotificationTypeBusIntervalAdjustment, + kDeviceNotificationTypeHostRoleRequest = kIOUSB30DeviceNotificationTypeHostRoleRequest, + kDeviceNotificationTypeSublinkSpeed = kIOUSB30DeviceNotificationTypeSublinkSpeed + }; + + // USB 3.1 Table 8-36 + enum tTimingParameters + { + kTimingParameterBELTDefaultNs = kIOUSB30TimingParameterBELTDefaultNs, + kTimingParameterBELTMinNs = kIOUSB30TimingParameterBELTMinNs + }; + + // USB 3.1 Table 10-12 Port Status Type Codes + enum tHubPortStatusCode + { + tHubPortStatusCodeStandard = kIOUSB30HubPortStatusCodeStandard, + tHubPortStatusCodePD = kIOUSB30HubPortStatusCodePD, + tHubPortStatusCodeExt = kIOUSB30HubPortStatusCodeExt, + tHubPortStatusCodeCount = kIOUSB30HubPortStatusCodeCount + }; + + // USB 3.1 10.16.2.6 Get Port Status + struct tHubPortStatusExt + { + uint16_t wPortStatus; + uint16_t wPortChange; + uint32_t dwExtPortStatus; + } __attribute__((packed)); + + // USB 3.1 Table 10-11. Note, offsets are specific to dwExtPortStatus + enum tHubExtStatus + { + kHubExtStatusRxSublinkSpeedID = kIOUSB30HubExtStatusRxSublinkSpeedID, + kHubExtStatusRxSublinkSpeedIDPhase = kIOUSB30HubExtStatusRxSublinkSpeedIDPhase, + + kHubExtStatusTxSublinkSpeedID = kIOUSB30HubExtStatusTxSublinkSpeedID, + kHubExtStatusTxSublinkSpeedIDPhase = kIOUSB30HubExtStatusTxSublinkSpeedIDPhase, + + kHubExtStatusRxLaneCount = kIOUSB30HubExtStatusRxLaneCount, + kHubExtStatusRxLaneCountPhase = kIOUSB30HubExtStatusRxLaneCountPhase, + + kHubExtStatusTxLaneCount = kIOUSB30HubExtStatusTxLaneCount, + kHubExtStatusTxLaneCountPhase = kIOUSB30HubExtStatusTxLaneCountPhase + }; +} +#endif // __cplusplus + +#endif diff --git a/QualcommWireless/include/IOKit/usb/USB.h b/QualcommWireless/include/IOKit/usb/USB.h new file mode 100644 index 0000000..eb46ee1 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/USB.h @@ -0,0 +1,1286 @@ +/* + * Copyright © 1998-2014 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _USB_H +#define _USB_H + +#include <IOKit/IOTypes.h> +#include <libkern/OSByteOrder.h> +#include <IOKit/usb/USBSpec.h> +#include <IOKit/usb/IOUSBHostFamilyDefinitions.h> +#include <IOKit/usb/AppleUSBDefinitions.h> + + +#if !__OPEN_SOURCE__ && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST +//these headers were previously exported for iOS clients +#include <IOKit/usb/IOUSBHostFamily.h> +#include <IOKit/usb/StandardUSB.h> + +// These are for Apple internal use only +#define kIOUSBMessageUpdateIdlePolicy kUSBHostMessageUpdateIdlePolicy +#define kIOUSBMessageRemoteWake kUSBHostMessageRemoteWake +#endif + +#if KERNEL +#include <IOKit/IOMemoryDescriptor.h> +#endif /* KERNEL */ + + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + @header USB.h + @abstract Public Interfaces to the USB implementation in Mac OS X. + @discussion This header file contains definitions and structures that are used in the different USB API's in Mac OS X, both in the kernel and in the user space. + */ + +/*! + @defineblock Endian conversion definitions + @discussion The USB API's use a convention of specifying parameters in the host order. The USB spec specifies that multi-byte items should be + formatted in little endian order. The following macros allow one to translate multi-byte values from Host order to USB order and vice versa. There are separate macros for + in-kernel use and for user space use. + */ +#define USBToHostWord USBToHost16 +#define HostToUSBWord HostToUSB16 +#define USBToHostLong USBToHost32 +#define HostToUSBLong HostToUSB32 +/*! @/defineblock */ + +#ifndef USBBitRange +#define USBBitRange(start, end) IOUSBBitRange(start, end) +#endif + +#ifndef USBBitRangePhase +#define USBBitRangePhase(start, end) IOUSBBitRangePhase(start, end) +#endif + +/*! + @enum Miscellaneous Constants + @discussion + */ +enum +{ + kUSBDeviceIDShift = 7, + kUSBMaxDevices = 128, + kUSBMaxDevice = kUSBMaxDevices - 1, + kUSBDeviceIDMask = 0x7f, + kUSBTooManyDevicesAddress = 0xfffe, + + kUSBPipeIDMask = 0xf, + kUSBMaxPipes = 32, // In and Out pipes can have same pipe number. + + kUSBInterfaceIDShift = 8, + kUSBMaxInterfaces = 1 << kUSBInterfaceIDShift, + kUSBInterfaceIDMask = kUSBMaxInterfaces - 1, + + kUSBEndPtShift = 7, + kUSBDeviceMask = ((1 << kUSBEndPtShift) - 1), + + kUSBNoPipeIdx = -1, + +#ifndef __OPEN_SOURCE__ + // In order to ameliorate the effects of PCI Pause on drivers that do not subscribe to the USB Notifications for it, we have decided to sleep threads that come into the UIM + // while we are in PCI Pause. We will wake those threads up after the root hub drivers are back ON. However, we needed a way to detect that an I/O was coming from user space. + // One way to solve that would be to power manage the user client and do the sleep/wake there, but that was a big undertaking. Another way is for the user client to somehow + // let the UIM know through some APIs. We decided on a quick way by using bits that are part of the API to communicate that the request is coming from user space. For device + // requests we use the wLenDone field, a 32-bit quantity, but whose maximum value is only 16 bits. Same goes for the streamID of bulk requests. Those bits are set by the user + // client and cleared by the controller after checking them. If they are set and PCI Pause is active, we will sleep that request. +#endif + kUSBUCRequestWithoutUSBNotificationMask = (1 << 30), + kUSBEndpointTransferTypeUCMask = (1 << 7), + + // Constants for streams + kUSBStream0 = 0, + kUSBMaxStream = 65533, + kUSBPRimeStream = 0xfffe, + kUSBNoStream = 0xffff, + kUSBAllStreams = 0xffffffff, // Obsolete, use kUSBStreamIDAllStreamsMask + kUSBStreamIDMask = 0xffff, + kUSBStreamIDAllStreamsMask = (1 << 31) +}; + +/*! + @enum bRequest Shifts and Masks + @discussion These are used to create the macro to encode the bRequest field of a Device Request + */ +enum +{ + kUSBRqDirnShift = kIOUSBDeviceRequestDirectionPhase, + kUSBRqDirnMask = 1, + + kUSBRqTypeShift = kIOUSBDeviceRequestTypePhase, + kUSBRqTypeMask = 3, + + kUSBRqRecipientMask = kIOUSBDeviceRequestRecipientMask +}; + +/*! + @defined USBmakebmRequestType + @discussion Macro to encode the bmRequestType field of a Device Request. It is used when constructing an IOUSBDevRequest. + */ +#define USBmakebmRequestType(direction, type, recipient) \ + (((direction & kUSBRqDirnMask) << kUSBRqDirnShift) | \ + ((type & kUSBRqTypeMask) << kUSBRqTypeShift) | \ + (recipient & kUSBRqRecipientMask)) + +/*! + @enum kUSBMaxIsocFrameReqCount + @discussion Maximum size in bytes allowed for one Isochronous frame + */ +enum +{ + kUSBMaxFSIsocEndpointReqCount = 1023, // max size (bytes) of any one Isoc frame for 1 FS endpoint + kUSBMaxHSIsocEndpointReqCount = 3072, // max size (bytes) of any one Isoc frame for 1 HS endpoint + kUSBMaxHSIsocFrameCount = 7168 // max size (bytes) of all Isoc transfers in a HS frame +}; + +/*! + @defined EncodeRequest + @discussion Macro that encodes the bRequest and bRequestType fields of a IOUSBDevRequest into a single value. It is useful when one needs + to know what type of request the IOUSBDevRequest encodes and simplifies comparisons. + */ +#define EncodeRequest(request, direction, type, recipient) \ + (((UInt16)request << 8) + \ + ((UInt16)recipient + \ + ((UInt16)type << kUSBRqTypeShift) + \ + ((UInt16)direction << kUSBRqDirnShift))) + + +/*! + @enum Standard Device Requests + @discussion Encoding of the standard device requests. + <tt> + <pre><b> + bmRequestType bRequest wValue wIndex wLength Data</b> + 00000000B CLEAR_FEATURE Feature Zero Zero None (device) + 00000001B Feature Interface Zero None (Interface) + 00000010B Feature Endpoint Zero None (Endpoint) + + 10000000B GET_CONFIGURATION Zero Zero One Configuration + 10000000B GET_DESCRIPTOR Type LangID Length Descriptor + 10000001B GET_INTERFACE Zero Interface One Alternate + + 10000000B GET_STATUS Zero Zero Two status (device) + 10000001B Zero Interface Two status (Interface) + 10000010B Zero Endpoint Two status (Endpoint) + + 00000000B SET_ADDRESS Address Zero Zero None + 00000000B SET_CONFIGURATION Configuration Zero Zero None + 00000000B SET_DESCRIPTOR Type LangID Length Descriptor + + 00000000B SET_FEATURE Feature Zero Zero None (device) + 00000001B Feature Interface Zero None (Interface) + 00000010B Feature Endpoint Zero None (Endpoint) + + 00000001B SET_INTERFACE Alternate Interface Zero None + 10000010B SYNCH_FRAME Zero Endpoint Two Frame Number + </pre> + </tt> + */ +enum +{ + kClearDeviceFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBStandard, kUSBDevice), + kClearInterfaceFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBStandard, kUSBInterface), + kClearEndpointFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBStandard, kUSBEndpoint), + kGetConfiguration = EncodeRequest(kUSBRqGetConfig, kUSBIn, kUSBStandard, kUSBDevice), + kGetDescriptor = EncodeRequest(kUSBRqGetDescriptor, kUSBIn, kUSBStandard, kUSBDevice), + kGetInterface = EncodeRequest(kUSBRqGetInterface, kUSBIn, kUSBStandard, kUSBInterface), + kGetDeviceStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBStandard, kUSBDevice), + kGetInterfaceStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBStandard, kUSBInterface), + kGetEndpointStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBStandard, kUSBEndpoint), + kSetAddress = EncodeRequest(kUSBRqSetAddress, kUSBOut, kUSBStandard, kUSBDevice), + kSetConfiguration = EncodeRequest(kUSBRqSetConfig, kUSBOut, kUSBStandard, kUSBDevice), + kSetDescriptor = EncodeRequest(kUSBRqSetDescriptor, kUSBOut, kUSBStandard, kUSBDevice), + kSetDeviceFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBStandard, kUSBDevice), + kSetInterfaceFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBStandard, kUSBInterface), + kSetEndpointFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBStandard, kUSBEndpoint), + kSetInterface = EncodeRequest(kUSBRqSetInterface, kUSBOut, kUSBStandard, kUSBInterface), + kSyncFrame = EncodeRequest(kUSBRqSyncFrame, kUSBIn, kUSBStandard, kUSBEndpoint), +}; + +/*! + @defined kCallInterfaceOpenWithGate + @discussion If the USB Device has this property, drivers for any of its interfaces will have their handleOpen method called while holding the workloop gate. + */ +#define kCallInterfaceOpenWithGate "kCallInterfaceOpenWithGate" + +// TYPES + +typedef UInt16 USBDeviceAddress; + +typedef uint32_t USBPhysicalAddress32; + +/*! + @typedef IOUSBIsocFrame + @discussion Structure used to encode information about each isoc frame. + @param frStatus Returns status associated with the frame. + @param frReqCount Input specifiying how many bytes to read or write. + @param frActCount Actual # of bytes transferred. + */ +typedef struct IOUSBIsocFrame +{ + IOReturn frStatus; + UInt16 frReqCount; + UInt16 frActCount; +} IOUSBIsocFrame; + + +/*! + @typedef IOUSBLowLatencyIsocFrame + @discussion Structure used to encode information about each isoc frame that is processed + at hardware interrupt time (low latency). + @param frStatus Returns status associated with the frame. + @param frReqCount Input specifiying how many bytes to read or write. + @param frActCount Actual # of bytes transferred. + @param frTimeStamp Time stamp that indicates time when frame was procesed. + */ +struct IOUSBLowLatencyIsocFrame +{ + IOReturn frStatus; + UInt16 frReqCount; + UInt16 frActCount; + AbsoluteTime frTimeStamp; +}; + +typedef struct IOUSBLowLatencyIsocFrame IOUSBLowLatencyIsocFrame; + +/*! + @typedef IOUSBCompletionAction + @discussion Function called when USB I/O completes. + @param target The target specified in the IOUSBCompletion struct. + @param parameter The parameter specified in the IOUSBCompletion struct. + @param status Completion status. + @param bufferSizeRemaining Bytes left to be transferred. + */ +typedef void (* IOUSBCompletionAction)(void* target, + void* parameter, + IOReturn status, + UInt32 bufferSizeRemaining); + +/*! + @typedef IOUSBCompletionActionWithTimeStamp + @discussion Function called when USB I/O completes. + @param target The target specified in the IOUSBCompletion struct. + @param parameter The parameter specified in the IOUSBCompletion struct. + @param status Completion status. + @param bufferSizeRemaining Bytes left to be transferred. + @param timeStamp Time at which the transaction was processed. + */ +typedef void (* IOUSBCompletionActionWithTimeStamp)(void* target, + void* parameter, + IOReturn status, + UInt32 bufferSizeRemaining, + AbsoluteTime timeStamp); + +/*! + @typedef IOUSBIsocCompletionAction + @discussion Function called when Isochronous USB I/O completes. + @param target The target specified in the IOUSBIsocCompletionn struct. + @param parameter The parameter specified in the IOUSBIsocCompletion struct. + @param status Completion status. + @param pFrames Pointer to the frame list containing the status for each frame transferred. + */ +typedef void (* IOUSBIsocCompletionAction)(void* target, + void* parameter, + IOReturn status, + IOUSBIsocFrame* pFrames); + +/*! + @typedef IOUSBLowLatencyIsocCompletionAction + @discussion Function called when Low Latency Isochronous USB I/O completes. + @param target The target specified in the IOUSBLowLatencyIsocCompletion struct. + @param parameter The parameter specified in the IOUSBLowLatencyIsocCompletion struct. + @param status Completion status. + @param pFrames Pointer to the low latency frame list containing the status for each frame transferred. + */ +typedef void (* IOUSBLowLatencyIsocCompletionAction)(void* target, + void* parameter, + IOReturn status, + IOUSBLowLatencyIsocFrame* pFrames); + +/*! + @typedef IOUSBCompletion + @discussion Struct specifying action to perform when a USB I/O completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. + */ +typedef struct IOUSBCompletion +{ + void* target; + IOUSBCompletionAction action; + void* parameter; +} IOUSBCompletion; + +/*! + @typedef IOUSBCompletionWithTimeStamp + @discussion Struct specifying action to perform when a USB I/O completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. + */ +typedef struct IOUSBCompletionWithTimeStamp +{ + void* target; + IOUSBCompletionActionWithTimeStamp action; + void* parameter; +} IOUSBCompletionWithTimeStamp; + +/*! + @typedef IOUSBIsocCompletion + @discussion Struct specifying action to perform when an Isochronous USB I/O completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. + */ +typedef struct IOUSBIsocCompletion +{ + void* target; + IOUSBIsocCompletionAction action; + void* parameter; +} IOUSBIsocCompletion; + +/*! + @typedef IOUSBLowLatencyIsocCompletion + @discussion Struct specifying action to perform when an Low Latency Isochronous USB I/O completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. + */ +typedef struct IOUSBLowLatencyIsocCompletion +{ + void* target; + IOUSBLowLatencyIsocCompletionAction action; + void* parameter; +} IOUSBLowLatencyIsocCompletion; + +/*! + @defineblock IOUSBFamily error codes + @discussion Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. + */ + +#define iokit_usb_err(return ) (IOReturn)(sys_iokit | sub_iokit_usb | return ) +#define kIOUSBUnknownPipeErr iokit_usb_err(0x61) // 0xe0004061 Pipe ref not recognized +#define kIOUSBTooManyPipesErr iokit_usb_err(0x60) // 0xe0004060 Too many pipes +#define kIOUSBNoAsyncPortErr iokit_usb_err(0x5f) // 0xe000405f no async port +#define kIOUSBNotEnoughPipesErr iokit_usb_err(0x5e) // 0xe000405e not enough pipes in interface +#define kIOUSBNotEnoughPowerErr iokit_usb_err(0x5d) // 0xe000405d not enough power for selected configuration +#define kIOUSBEndpointNotFound iokit_usb_err(0x57) // 0xe0004057 Endpoint Not found +#define kIOUSBConfigNotFound iokit_usb_err(0x56) // 0xe0004056 Configuration Not found +#define kIOUSBPortWasSuspended iokit_usb_err(0x52) // 0xe0004052 The transaction was returned because the port was suspended +#define kIOUSBPipeStalled iokit_usb_err(0x4f) // 0xe000404f Pipe has stalled, error needs to be cleared +#define kIOUSBInterfaceNotFound iokit_usb_err(0x4e) // 0xe000404e Interface ref not recognized +#define kIOUSBLowLatencyBufferNotPreviouslyAllocated iokit_usb_err(0x4d) // 0xe000404d Attempted to use user land low latency isoc calls w/out calling PrepareBuffer (on the data buffer) first +#define kIOUSBLowLatencyFrameListNotPreviouslyAllocated iokit_usb_err(0x4c) // 0xe000404c Attempted to use user land low latency isoc calls w/out calling PrepareBuffer (on the frame list) first +#define kIOUSBHighSpeedSplitError iokit_usb_err(0x4b) // 0xe000404b Error to hub on high speed bus trying to do split transaction +#define kIOUSBSyncRequestOnWLThread iokit_usb_err(0x4a) // 0xe000404a A synchronous USB request was made on the workloop thread (from a callback?). Only async requests are permitted in that case +#define kIOUSBDeviceNotHighSpeed iokit_usb_err(0x49) // 0xe0004049 Name is deprecated, see below +#define kIOUSBDeviceTransferredToCompanion iokit_usb_err(0x49) // 0xe0004049 The device has been tranferred to another controller for enumeration +#define kIOUSBClearPipeStallNotRecursive iokit_usb_err(0x48) // 0xe0004048 IOUSBPipe::ClearPipeStall should not be called recursively +#define kIOUSBDevicePortWasNotSuspended iokit_usb_err(0x47) // 0xe0004047 Port was not suspended +#define kIOUSBEndpointCountExceeded iokit_usb_err(0x46) // 0xe0004046 The endpoint was not created because the controller cannot support more endpoints +#define kIOUSBDeviceCountExceeded iokit_usb_err(0x45) // 0xe0004045 The device cannot be enumerated because the controller cannot support more devices +#define kIOUSBStreamsNotSupported iokit_usb_err(0x44) // 0xe0004044 The request cannot be completed because the XHCI controller does not support streams +#define kIOUSBInvalidSSEndpoint iokit_usb_err(0x43) // 0xe0004043 An endpoint found in a SuperSpeed device is invalid (usually because there is no Endpoint Companion Descriptor) +#define kIOUSBTooManyTransactionsPending iokit_usb_err(0x42) // 0xe0004042 The transaction cannot be submitted because it would exceed the allowed number of pending transactions + +#if !__OPEN_SOURCE__ && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST +#define kIOUSBTransactionReturned kIOReturnAborted +#define kIOUSBTransactionTimeout kIOReturnTimeout +#else +#define kIOUSBTransactionReturned iokit_usb_err(0x50) // 0xe0004050 The transaction has been returned to the caller +#define kIOUSBTransactionTimeout iokit_usb_err(0x51) // 0xe0004051 Transaction timed out +#endif + +/*! + @definedblock IOUSBFamily hardware error codes + @discussion These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. + For the following Completion codes, we return a generic IOKit error instead of a USB specific error. + <tt> + <pre> + Completion Code Error Returned Description + 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size + 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer + 5 kIOReturnNotResponding Device Not responding + 4 kIOUSBPipeStalled Endpoint returned a STALL PID + </pre> + </tt> + */ +#define kIOUSBLinkErr iokit_usb_err(0x10) // 0xe0004010 +#define kIOUSBNotSent2Err iokit_usb_err(0x0f) // 0xe000400f Transaction not sent +#define kIOUSBNotSent1Err iokit_usb_err(0x0e) // 0xe000400e Transaction not sent +#define kIOUSBBufferUnderrunErr iokit_usb_err(0x0d) // 0xe000400d Buffer Underrun (Host hardware failure on data out, PCI busy?) +#define kIOUSBBufferOverrunErr iokit_usb_err(0x0c) // 0xe000400c Buffer Overrun (Host hardware failure on data out, PCI busy?) +#define kIOUSBReserved2Err iokit_usb_err(0x0b) // 0xe000400b Reserved +#define kIOUSBReserved1Err iokit_usb_err(0x0a) // 0xe000400a Reserved +#define kIOUSBWrongPIDErr iokit_usb_err(0x07) // 0xe0004007 Pipe stall, Bad or wrong PID +#define kIOUSBPIDCheckErr iokit_usb_err(0x06) // 0xe0004006 Pipe stall, PID CRC error +#define kIOUSBDataToggleErr iokit_usb_err(0x03) // 0xe0004003 Pipe stall, Bad data toggle +#define kIOUSBBitstufErr iokit_usb_err(0x02) // 0xe0004002 Pipe stall, bitstuffing +#define kIOUSBCRCErr iokit_usb_err(0x01) // 0xe0004001 Pipe stall, bad CRC +/*! @/definedblock */ + + +/*! + @defineblock IOUSBFamily message codes + @discussion Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. + */ +#define iokit_usb_msg(message) (UInt32)(sys_iokit | sub_iokit_usb | message) +#define kIOUSBMessageHubResetPort iokit_usb_msg(0x01) // 0xe0004001 Message sent to a hub to reset a particular port +#define kIOUSBMessageHubSuspendPort iokit_usb_msg(0x02) // 0xe0004002 Message sent to a hub to suspend a particular port +#define kIOUSBMessageHubResumePort iokit_usb_msg(0x03) // 0xe0004003 Message sent to a hub to resume a particular port +#define kIOUSBMessageHubIsDeviceConnected iokit_usb_msg(0x04) // 0xe0004004 Message sent to a hub to inquire whether a particular port has a device connected or not +#define kIOUSBMessageHubIsPortEnabled iokit_usb_msg(0x05) // 0xe0004005 Message sent to a hub to inquire whether a particular port is enabled or not +#define kIOUSBMessageHubReEnumeratePort iokit_usb_msg(0x06) // 0xe0004006 Message sent to a hub to reenumerate the device attached to a particular port +#define kIOUSBMessagePortHasBeenReset iokit_usb_msg(0x0a) // 0xe000400a Message sent to a device indicating that the port it is attached to has been reset +#define kIOUSBMessagePortHasBeenResumed iokit_usb_msg(0x0b) // 0xe000400b Message sent to a device indicating that the port it is attached to has been resumed +#define kIOUSBMessageHubPortClearTT iokit_usb_msg(0x0c) // 0xe000400c Message sent to a hub to clear the transaction translator +#define kIOUSBMessagePortHasBeenSuspended iokit_usb_msg(0x0d) // 0xe000400d Message sent to a device indicating that the port it is attached to has been suspended +#define kIOUSBMessageFromThirdParty iokit_usb_msg(0x0e) // 0xe000400e Message sent from a third party. Uses IOUSBThirdPartyParam to encode the sender's ID +#define kIOUSBMessagePortWasNotSuspended iokit_usb_msg(0x0f) // 0xe000400f Message indicating that the hub driver received a resume request for a port that was not suspended +#define kIOUSBMessageExpressCardCantWake iokit_usb_msg(0x10) // 0xe0004010 Message from a driver to a bus that an express card will disconnect on sleep and thus shouldn't wake +#define kIOUSBMessageCompositeDriverReconfigured iokit_usb_msg(0x11) // 0xe0004011 Message from the composite driver indicating that it has finished re-configuring the device after a reset +#define kIOUSBMessageHubSetPortRecoveryTime iokit_usb_msg(0x12) // 0xe0004012 Message sent to a hub to set the # of ms required when resuming a particular port +#define kIOUSBMessageOvercurrentCondition iokit_usb_msg(0x13) // 0xe0004013 Message sent to the clients of the device's hub parent, when a device causes an overcurrent condition. The message argument contains the locationID of the device +#define kIOUSBMessageNotEnoughPower iokit_usb_msg(0x14) // 0xe0004014 Message sent to the clients of the device's hub parent, when a device causes an low power notice to be displayed. The message argument contains the locationID of the device +#define kIOUSBMessageController iokit_usb_msg(0x15) // 0xe0004015 Generic message sent from controller user client to controllers +#define kIOUSBMessageRootHubWakeEvent iokit_usb_msg(0x16) // 0xe0004016 Message from the HC Wakeup code indicating that a Root Hub port has a wake event +#define kIOUSBMessageReleaseExtraCurrent iokit_usb_msg(0x17) // 0xe0004017 Message to ask any clients using extra current to release it if possible +#define kIOUSBMessageReallocateExtraCurrent iokit_usb_msg(0x18) // 0xe0004018 Message to ask any clients using extra current to attempt to allocate it some more +#define kIOUSBMessageEndpointCountExceeded iokit_usb_msg(0x19) // 0xe0004019 Message sent to a device when endpoints cannot be created because the USB controller ran out of resources +#define kIOUSBMessageDeviceCountExceeded iokit_usb_msg(0x1a) // 0xe000401a Message sent by a hub when a device cannot be enumerated because the USB controller ran out of resources +#define kIOUSBMessageHubPortDeviceDisconnected iokit_usb_msg(0x1b) // 0xe000401b Message sent by a built-in hub when a device was disconnected +#define kIOUSBMessageUnsupportedConfiguration iokit_usb_msg(0x1c) // 0xe000401c Message sent to the clients of the device when a device is not supported in the current configuration. The message argument contains the locationID of the device +#define kIOUSBMessageHubCountExceeded iokit_usb_msg(0x1d) // 0xe000401d Message sent when a 6th hub was plugged in and was not enumerated, as the USB spec only support 5 hubs in a chain +#define kIOUSBMessageTDMLowBattery iokit_usb_msg(0x1e) // 0xe000401e Message sent when when an attached TDM system battery is running low. +#define kIOUSBMessageLegacySuspendDevice iokit_usb_msg(0x1f) // 0xe000401f Message sent to legacy interfaces when SuspedDevice() is called . +#define kIOUSBMessageLegacyResetDevice iokit_usb_msg(0x20) // 0xe0004020 Message sent to legacy interfaces when ResetDevice() is called . +#define kIOUSBMessageLegacyReEnumerateDevice iokit_usb_msg(0x21) // 0xe0004021 Message sent to legacy interfaces when ReEnumerateDevice() is called . + +#define kIOUSBMessageRenegotiateCurrent kUSBHostMessageRenegotiateCurrent + +#if !__OPEN_SOURCE__ && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST +#define kIOUSBMessageConfigurationSet kUSBHostMessageConfigurationSet +#else +#define kIOUSBMessageConfigurationSet iokit_usb_msg(0x22) // 0xe0004022 Message sent upon a SetConfiguration call +#endif + +// Obsolete +// +struct IOUSBMouseData +{ + UInt16 buttons; + SInt16 XDelta; + SInt16 YDelta; +}; + +typedef struct IOUSBMouseData IOUSBMouseData; +typedef IOUSBMouseData* IOUSBMouseDataPtr; + +// Obsolete +// +struct IOUSBKeyboardData +{ + UInt16 keycount; + UInt16 usbkeycode[32]; +}; + +typedef struct IOUSBKeyboardData IOUSBKeyboardData; +typedef IOUSBKeyboardData* IOUSBKeyboardDataPtr; + +// Obsolete +// +union IOUSBHIDData +{ + IOUSBKeyboardData kbd; + IOUSBMouseData mouse; +}; + +typedef union IOUSBHIDData IOUSBHIDData; +typedef IOUSBHIDData* IOUSBHIDDataPtr; + + +typedef IOUSBDeviceDescriptor* IOUSBDeviceDescriptorPtr; +typedef IOUSBDescriptorHeader* IOUSBDescriptorHeaderPtr; +typedef IOUSBBOSDescriptor* IOUSBBOSDescriptorPtr; +typedef IOUSBDeviceCapabilityDescriptorHeader* IOUSBDeviceCapabilityDescriptorHeaderPtr; +typedef IOUSBDeviceCapabilityUSB2Extension* IOUSBDeviceCapabilityUSB2ExtensionPtr; +typedef IOUSBDeviceCapabilitySuperSpeedUSB* IOUSBDeviceCapabilitySuperSpeedUSBPtr; +typedef IOUSBDeviceCapabilitySuperSpeedPlusUSB* IOUSBDeviceCapabilitySuperSpeedPlusUSBPtr; +typedef IOUSBDeviceCapabilityContainerID* IOUSBDeviceCapabilityContainerIDPtr; +typedef IOUSBPlatformCapabilityDescriptor* IOUSBPlatformCapabilityDescriptorPtr; +typedef IOUSBDeviceCapabilityBillboardAltConfig* IOUSBDeviceCapabilityBillboardAltConfigPtr; +typedef IOUSBDeviceCapabilityBillboard* IOUSBDeviceCapabilityBillboardPtr; +typedef IOUSBDeviceCapabilityBillboardAltMode* IOUSBDeviceCapabilityBillboardAltModePtr; +typedef IOUSBConfigurationDescriptor* IOUSBConfigurationDescriptorPtr; +typedef IOUSBConfigurationDescHeader* IOUSBConfigurationDescHeaderPtr; +typedef IOUSBInterfaceDescriptor* IOUSBInterfaceDescriptorPtr; +typedef IOUSBEndpointDescriptor* IOUSBEndpointDescriptorPtr; +typedef IOUSBStringDescriptor* IOUSBStringDescriptorPtr; +typedef IOUSBSuperSpeedEndpointCompanionDescriptor* IOUSBSuperSpeedEndpointCompanionDescriptorPtr; +typedef IOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptor* IOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptorPtr; +typedef UASPipeDescriptor* UASPipeDescriptorPtr; +typedef IOUSBHIDDescriptor* IOUSBHIDDescriptorPtr; +typedef IOUSBHIDReportDesc* IOUSBHIDReportDescPtr; +typedef IOUSBDeviceQualifierDescriptor* IOUSBDeviceQualifierDescriptorPtr; +typedef IOUSBDFUDescriptor* IOUSBDFUDescriptorPtr; +typedef IOUSBInterfaceAssociationDescriptor* IOUSBInterfaceAssociationDescriptorPtr; + +enum +{ + kIOUSBDeviceCapabilityDescriptorType = 16, + kIOUSBDeviceCapabilityDescriptorLengthMin = 3, +}; + + + +enum +{ + kUSB_EPDesc_bmAttributes_TranType_Mask = USBBitRange(0, 1), + kUSB_EPDesc_bmAttributes_TranType_Shift = USBBitRangePhase(0, 1), + kUSB_EPDesc_bmAttributes_SyncType_Mask = USBBitRange(2, 3), + kUSB_EPDesc_bmAttributes_SyncType_Shift = USBBitRangePhase(2, 3), + kUSB_EPDesc_bmAttributes_UsageType_Mask = USBBitRange(4, 5), + kUSB_EPDesc_bmAttributes_UsageType_Shift = USBBitRangePhase(4, 5), + + kUSB_EPDesc_wMaxPacketSize_MPS_Mask = USBBitRange(0, 10), + kUSB_EPDesc_wMaxPacketSize_MPS_Shift = USBBitRangePhase(0, 10), + kUSB_EPDesc_MaxMPS = 1024, // this is the maximum no matter what + + kUSB_HSFSEPDesc_wMaxPacketSize_Mult_Mask = USBBitRange(11, 12), + kUSB_HSFSEPDesc_wMaxPacketSize_Mult_Shift = USBBitRangePhase(11, 12) +}; + +enum +{ + kUSB_SSCompDesc_Bulk_MaxStreams_Mask = USBBitRange(0, 4), + kUSB_SSCompDesc_Bulk_MaxStreams_Shift = USBBitRangePhase(0, 4), + kUSB_SSCompDesc_Isoc_Mult_Mask = USBBitRange(0, 1), + kUSB_SSCompDesc_Isoc_Mult_Shift = USBBitRangePhase(0, 1) +}; + + +#ifndef __OPEN_SOURCE__ +// Leave this here because it has existed for many years, but it never really belonged here in the first place +#endif + +// these following 2 lines are deprecated and should not be used. +enum {addPacketShift = 11}; // Bits for additional packets in maxPacketField. (Table 9-13) + +#define mungeMaxPacketSize(w) ((w > 1024) ? (((w >> (addPacketShift)) + 1) * (w & ((1 << addPacketShift) - 1))) : w) + +/*! + @typedef IOUSBEndpointProperties + @discussion Structure used with the IOUSBLib GetEndpointPropertiesV3 and GetPipePropertiesV3 API. Most of the fields are taken directly from corresponding Standard Endpoint Descriptor and SuperSpeed Endpoint Companion Descriptor. wBytesPerInterval will be synthesized for High Speed High Bandwidth Isochronous endpoints. + @field bVersion Version of the structure. Currently kUSBEndpointPropertiesVersion3. Need to set this when using this structure + @field bAlternateSetting Used as an input for GetEndpointPropertiesV3. Used as an output for GetPipePropertiesV3 + @field bDirection Used as an input for GetEndpointPropertiesV3. Used as an output for GetPipePropertiesV3. One of kUSBIn or kUSBOut. + @field bEndpointNumber Used as an input for GetEndpointPropertiesV3. Used as an output for GetPipePropertiesV3 + @field bTransferType One of kUSBControl, kUSBBulk, kUSBIsoc, or kUSBInterrupt + @field bUsageType For interrupt and isoc endpoints, the usage type. For Bulk endpoints of the UAS Mass Storage Protocol, the pipe ID. + @field bSyncType For isoc endpoints only + @field bInterval The bInterval field from the Standard Endpoint descriptor. + @field wMaxPacketSize The meaning of this value depends on whether this is called with GetPipePropertiesV3 or GetEndpointPropertiesV3. See the documentation of those calls for more info. + @field bMaxBurst For SuperSpeed endpoints, maximum number of packets the endpoint can send or receive as part of a burst + @field bMaxStreams For SuperSpeed bulk endpoints, maximum number of streams this endpoint supports. + @field bMult For SuperSpeed isoc endpoints, this is the mult value from the SuperSpeed Endpoint Companion Descriptor. For High Speed isoc and interrupt endpoints, this is bits 11 and 12 of the Standard Endpoint Descriptor, which represents a similar value. + @field wBytesPerInterval For SuperSpeed interrupt and isoc endpoints, this is the wBytesPerInterval from the SuperSpeed Endpoint Companion Descriptor. For High Speed High Bandwidth isoc endpoints, this will be equal to wMaxPacketSize * (bMult+1). + */ +struct IOUSBEndpointProperties +{ + UInt8 bVersion; + UInt8 bAlternateSetting; + UInt8 bDirection; + UInt8 bEndpointNumber; + UInt8 bTransferType; + UInt8 bUsageType; + UInt8 bSyncType; + UInt8 bInterval; + UInt16 wMaxPacketSize; + UInt8 bMaxBurst; + UInt8 bMaxStreams; + UInt8 bMult; + UInt16 wBytesPerInterval; +} __attribute__((packed)); + +typedef struct IOUSBEndpointProperties IOUSBEndpointProperties; +typedef IOUSBEndpointProperties* IOUSBEndpointPropertiesPtr; + +/*! + @enum USBGetEndpointVersion + @discussion Version of the IOUSBEndpointProperties structure. + @constant kUSBEndpointPropertiesVersion3 Version that has support for USB3 SuperSpeed Endpoint Companion fields. + */ +enum +{ + kUSBEndpointPropertiesVersion3 = 0x03 +}; + +/*! + @typedef USBStatus + @discussion Type used to get a DeviceStatus as a single quantity. + */ +typedef UInt16 USBStatus; +typedef USBStatus* USBStatusPtr; + +// These constants are obsolete +// +enum +{ + kIOUSBAnyClass = 0xFFFF, + kIOUSBAnySubClass = 0xFFFF, + kIOUSBAnyProtocol = 0xFFFF, + kIOUSBAnyVendor = 0xFFFF, + kIOUSBAnyProduct = 0xFFFF +}; + +// This structure are obsolete +// +typedef struct IOUSBMatch +{ + UInt16 usbClass; + UInt16 usbSubClass; + UInt16 usbProtocol; + UInt16 usbVendor; + UInt16 usbProduct; +} IOUSBMatch; + +/*! + @typedef IOUSBFindEndpointRequest + @discussion Struct used to find endpoints of an interface + type and direction are used to match endpoints, + type, direction, maxPacketSize and interval are updated + with the properties of the found endpoint. + @field type Type of endpoint: kUSBControl, kUSBIsoc, kUSBBulk, kUSBInterrupt, kUSBAnyType. If kUSBAnyType is specified, this field is treated as a don't care. + @field direction Direction of endpoint: kUSBOut, kUSBIn, kUSBAnyDirn. If kUSBAnyDirn is specified, this field is treated as a don't care. + @field maxPacketSize maximum packet size of endpoint. + @field interval Polling interval in mSec for endpoint. + */ +typedef struct +{ + UInt8 type; + UInt8 direction; + UInt16 maxPacketSize; + UInt8 interval; +} IOUSBFindEndpointRequest; + +/*! + @struct IOUSBDevRequest + @discussion Parameter block for control requests, using a simple pointer + for the data to be transferred. + @field bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor + @field bRequest Request code + @field wValue 16 bit parameter for request, host endianess + @field wIndex 16 bit parameter for request, host endianess + @field wLength Length of data part of request, 16 bits, host endianess + @field pData Pointer to data for request - data returned in bus endianess + @field wLenDone Set by standard completion routine to number of data bytes + actually transferred + */ +typedef struct +{ + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + void* pData; + UInt32 wLenDone; +} IOUSBDevRequest; +typedef IOUSBDevRequest* IOUSBDeviceRequestPtr; + +/*! + @struct IOUSBDevRequestTO + @discussion Parameter block for control requests with timeouts, using a simple pointer + for the data to be transferred. Same as a IOUSBDevRequest except for the two extra timeout fields. + @field bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor + @field bRequest Request code + @field wValue 16 bit parameter for request, host endianess + @field wIndex 16 bit parameter for request, host endianess + @field wLength Length of data part of request, 16 bits, host endianess + @field pData Pointer to data for request - data returned in bus endianess + @field wLenDone Set by standard completion routine to number of data bytes + actually transferred + @field noDataTimeout Specifies a time value in milliseconds. Once the request is queued on the bus, if no data is transferred in this amount of time, the request will be aborted and returned. + @field completionTimeout Specifies a time value in milliseconds. Once the request is queued on the bus, if the entire request is not completed in this amount of time, the request will be aborted and returned + */ +typedef struct +{ + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + void* pData; + UInt32 wLenDone; + UInt32 noDataTimeout; + UInt32 completionTimeout; +} IOUSBDevRequestTO; + +/*! + @enum Default timeout values + @discussion default values used for data and completion timeouts. + */ +enum +{ + kUSBDefaultControlNoDataTimeoutMS = 5000, + kUSBDefaultControlCompletionTimeoutMS = 0 +}; + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +typedef struct +{ + UInt32 pipeRef; + void* buf; + UInt32 size; + UInt32 noDataTimeout; + UInt32 completionTimeout; +} IOUSBBulkPipeReq; + +#if KERNEL +/*! + @struct IOUSBDevRequestDesc + @discussion Parameter block for control requests, using a memory descriptor + for the data to be transferred. Only available in the kernel. + @field bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor + @field bRequest Request code + @field wValue 16 bit parameter for request, host endianess + @field wIndex 16 bit parameter for request, host endianess + @field wLength Length of data part of request, 16 bits, host endianess + @field pData Pointer to memory descriptor for data for request - data returned in bus endianess + @field wLenDone Set by standard completion routine to number of data bytes + actually transferred + */ +typedef struct +{ + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + IOMemoryDescriptor* pData; + UInt32 wLenDone; +} IOUSBDevRequestDesc; +// TODO: move IOUSBDevRequestDesc to be shared between kernel and user. + +/*! + @enum IOUSBFamilyIOOptionBit + @discussion Options used exclusively by the USB Family when calling calling IOService APIs, such as open() and close(). + @constant kIOUSBInterfaceOpenAlt Open the alternate interface specified when creating the interface. + @constant kUSBOptionBitOpenExclusivelyBit Used in open()'ing the IOUSBDevice or IOUSBInterface by the corresponding user client. Only 1 user client can have exclusive access to those objects + */ +enum +{ + kIOUSBInterfaceOpenAlt = 0x00010000, + kIOUSBInterfaceOpenAlternateInterfaceBit = 16, + kUSBOptionBitOpenExclusivelyBit = 17, + kIOUSBInterfaceOpenAlternateInterfaceMask = ( 1 << kIOUSBInterfaceOpenAlternateInterfaceBit ), + kUSBOptionBitOpenExclusivelyMask = ( 1 << kUSBOptionBitOpenExclusivelyBit ) +}; + +#endif + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +// use a structure because there's a limit of 6 total arguments +// to a user client method. +typedef struct +{ + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + void* pData; // data pointer + UInt32 wLenDone; // # bytes transferred + UInt8 pipeRef; +} IOUSBDevReqOOL; + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +typedef struct +{ + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + void* pData; // data pointer + UInt32 wLenDone; // # bytes transferred + UInt8 pipeRef; + UInt32 noDataTimeout; + UInt32 completionTimeout; +} IOUSBDevReqOOLTO; + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +// Structure to request isochronous transfer +// +typedef struct +{ + UInt32 fPipe; + void* fBuffer; + UInt32 fBufSize; + UInt64 fStartFrame; + UInt32 fNumFrames; + IOUSBIsocFrame* fFrameCounts; +} IOUSBIsocStruct; + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +// Structure to request low latency isochronous transfer +// +struct IOUSBLowLatencyIsocStruct +{ + UInt32 fPipe; + UInt32 fBufSize; + UInt64 fStartFrame; + UInt32 fNumFrames; + UInt32 fUpdateFrequency; + UInt32 fDataBufferCookie; + UInt32 fDataBufferOffset; + UInt32 fFrameListBufferCookie; + UInt32 fFrameListBufferOffset; +}; + +typedef struct IOUSBLowLatencyIsocStruct IOUSBLowLatencyIsocStruct; + + +/*! + @struct IOUSBGetFrameStruct + @discussion Structure used from user space to return the frame number and a timestamp on when the frame register was read. + @field frame frame number + @field timeStamp AbsoluteTime when the frame was updated + */ +typedef struct +{ + UInt64 frame; + AbsoluteTime timeStamp; +} IOUSBGetFrameStruct; + + +/*! + @struct IOUSBFindInterfaceRequest + @discussion Structure used with FindNextInterface. + */ +typedef struct +{ + UInt16 bInterfaceClass; // requested class + UInt16 bInterfaceSubClass; // requested subclass + UInt16 bInterfaceProtocol; // requested protocol + UInt16 bAlternateSetting; // requested alt setting +} IOUSBFindInterfaceRequest; + +/*! + @enum kIOUSBFindInterfaceDontCare + @discussion Constant that can be used for the fields of IOUSBFindInterfaceRequest to specify that they should not be matched. + */ +enum +{ + kIOUSBFindInterfaceDontCare = 0xFFFF +}; + +/*! + @enum kIOUSBVendorIDApple + @discussion USB Vendor ID for Apple, Inc. + */ +enum +{ + kIOUSBVendorIDAppleComputer = kIOUSBAppleVendorID, + kIOUSBVendorIDApple = kIOUSBAppleVendorID +}; + +/*! + @enum USBDeviceSpeed + @discussion Returns the speed of a particular USB device. + @constant kUSBDeviceSpeedLow The device is a low speed device. + @constant kUSBDeviceSpeedFull The device is a full speed device. + @constant kUSBDeviceSpeedHigh The device is a high speed device. + @constant kUSBDeviceSpeedSuper The device is a SuperSpeed (Gen 1) 5Gbps device + @constant kUSBDeviceSpeedSuperPlus The device is a SuperSpeed Plus (Gen 2) 10Gbps device + @constant kUSBDeviceSpeedSuperPlusBy2 The device is a SuperSpeed Plus (Gen 2 X 2) 20Gbps device + */ +enum +{ + kUSBDeviceSpeedLow = 0, + kUSBDeviceSpeedFull = 1, + kUSBDeviceSpeedHigh = 2, + kUSBDeviceSpeedSuper = 3, + kUSBDeviceSpeedSuperPlus = 4, + kUSBDeviceSpeedSuperPlusBy2 = 5 +}; + +/*! + @enum MicrosecondsInFrame + @discussion Returns the number of microseconds in a USB frame. + @constant kUSBFullSpeedMicrosecondsInFrame The device is attached to a bus running at full speed (1 ms / frame). + @constant kUSBHighSpeedMicrosecondsInFrame The device is attached to a bus running at high speed (125 microseconds / frame). + */ +enum +{ + kUSBFullSpeedMicrosecondsInFrame = 1000, + kUSBHighSpeedMicrosecondsInFrame = 125 +}; + +// During low latency transfers, the stack will set the frStatus for each frame to this value. A client can check that to see if the transfer has completed. We set the frStatus to a +// valid return code when the transfer completes. +// +enum +{ + kUSBLowLatencyIsochTransferKey = 'llit' // Set frStatus field of first frame in isoch transfer to designate as low latency +}; + +// This structure is DEPRECATED. See the LowLatencyUserBufferInfoV2 +// +typedef struct LowLatencyUserBufferInfo LowLatencyUserBufferInfo; + +struct LowLatencyUserBufferInfo +{ + UInt32 cookie; + void* bufferAddress; + IOByteCount bufferSize; + UInt32 bufferType; + Boolean isPrepared; + LowLatencyUserBufferInfo* nextBuffer; +}; + +// This structure is DEPRECATED. See the LowLatencyUserBufferInfoV3 + +typedef struct LowLatencyUserBufferInfoV2 LowLatencyUserBufferInfoV2; + +struct LowLatencyUserBufferInfoV2 +{ + UInt32 cookie; + void* bufferAddress; + IOByteCount bufferSize; + UInt32 bufferType; + Boolean isPrepared; + void* mappedUHCIAddress; + LowLatencyUserBufferInfoV2* nextBuffer; +}; + + +// This structure is used to pass information for the low latency calls between user space and the kernel. +// +typedef struct LowLatencyUserBufferInfoV3 LowLatencyUserBufferInfoV3; + +struct LowLatencyUserBufferInfoV3 +{ + uint64_t cookie; + mach_vm_address_t bufferAddress; + mach_vm_size_t bufferSize; + uint64_t bufferType; + uint64_t isPrepared; + mach_vm_address_t mappedUHCIAddress; + LowLatencyUserBufferInfoV3* nextBuffer; +}; + + +/*! + @enum USBLowLatencyBufferType + @discussion Used to specify what kind of buffer to create when calling LowLatencyCreateBuffer(). + @constant kUSBLowLatencyWriteBuffer The buffer will be used to write data out to a device. + @constant kUSBLowLatencyReadBuffer The buffer will be used to read data from a device. + @constant kUSBLowLatencyFrameListBuffer The buffer will be used for a low latency isoch frame list. + */ +typedef enum +{ + kUSBLowLatencyWriteBuffer = 0, + kUSBLowLatencyReadBuffer = 1, + kUSBLowLatencyFrameListBuffer = 2 +} USBLowLatencyBufferType; + +// USB User Notification Types +// +enum +{ + kUSBNoUserNotificationType = 0, + kUSBNotEnoughPowerNotificationType = 1, + kUSBIndividualOverCurrentNotificationType = 2, + kUSBGangOverCurrentNotificationType = 3, + kUSBiOSDeviceNotEnoughPowerNotificationType = 4, + kUSBNotEnoughPowerNoACNotificationType = 5, + kUSBDeviceCountExceededNotificationType = 6, + kUSBEndpointCountExceededNotificationType = 7, + kUSBUnsupportedNotificationType = 8, + kUSBHubCountExceededNotificationType = 9, + kUSBTDMLowBatteryType = 10, + kUSBCTBNotEnoughPowerNotificationType = 11, + kUSBCTBUnsupportedNotificationType = 12, + kUSBCUnsupportedTBPortNotificationType = 13, + kUSBCUnsupportedTBCableNotificationType = 14 +}; + +/*! + @defined Property Definitions + @discussion Useful property names in USB land. + */ +#define kUSBDevicePropertyBusPowerAvailable "Bus Power Available" +#define kUSBDevicePropertyLocationID kUSBHostPropertyLocationID +#define kUSBProductIDMask kUSBHostMatchingPropertyProductIDMask +#define kUSBProductIdsArrayName kUSBHostMatchingPropertyProductIDArray +#define kUSBSuspendPort "kSuspendPort" +#define kUSBExpressCardCantWake "ExpressCardCantWake" +#define kUSBDeviceResumeRecoveryTime kUSBHostDevicePropertyResumeRecoveryTime +#define kUSBOutOfSpecMPSOK "Out of spec MPS OK" +#define kOverrideIfAtLocationID "OverrideIfAtLocationID" +#define kUSBDeviceCurrentConfiguration kUSBHostDevicePropertyCurrentConfiguration +#define kUSBDeviceRemoteWakeOverride kUSBHostDevicePropertyRemoteWakeOverride +#define kUSBDeviceConfigurationCurrentOverride kUSBHostDevicePropertyConfigurationCurrentOverride +#define kUSBDeviceResetDurationOverride kUSBHostDevicePropertyResetDurationOverride +#define kUSBDeviceDataToggleResetOverride kUSBHostPropertyDataToggleResetOverride +#define kUSBDeviceFailedRequestedPower kUSBHostDevicePropertyFailedRequestedPower +#define kUSBPropertyRemovable kUSBHostPortPropertyRemovable +#define kUSBPropertyTestMode kUSBHostPortPropertyTestMode +#define kUSBPropertyDebugLevel kUSBHostPropertyDebugOptions +#define kUSBHubPropertyPowerSupply kUSBHostHubPropertyPowerSupply +#define kUSBControllerSleepSupported kUSBHostControllerPropertySleepSupported +#define kUSBPortPropertyBusCurrentAllocation kUSBHostPortPropertyBusCurrentAllocation + +// legacy properties +#define kUSBPreferredInterface "Preferred Interface" +#define kUSBPreferredInterfacePriority "priority" +#define kOverrideAllowLowPower "kOverrideAllowLowPower" +#define kUSBUserClientEntitlementRequired "UsbUserClientEntitlementRequired" +#define kUSBDevicePropertySpeed "Device Speed" + +#if !__OPEN_SOURCE__ && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST +#define kUSBDevicePropertyAddress kUSBHostDevicePropertyAddress +#define kUSBPreferredConfiguration kUSBHostDevicePropertyPreferredConfiguration +#define kUSBControllerNeedsContiguousMemoryForIsoch kUSBHostControllerPropertyIsochronousRequiresContiguous +#define kUSBHubDontAllowLowPower kUSBHostHubPropertyIdlePolicy +#define kConfigurationDescriptorOverride kUSBHostDevicePropertyConfigurationDescriptorOverride +#else +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_14 +#define kUSBDevicePropertyAddress "USB Address" +#define kUSBPreferredConfiguration "Preferred Configuration" +#define kUSBControllerNeedsContiguousMemoryForIsoch "Need contiguous memory for isoch" +#define kUSBHubDontAllowLowPower "kUSBHubDontAllowLowPower" +#define kConfigurationDescriptorOverride "ConfigurationDescriptorOverride" +#else +#define kUSBDevicePropertyAddress kUSBHostDevicePropertyAddress +#define kUSBPreferredConfiguration kUSBHostDevicePropertyPreferredConfiguration +#define kUSBControllerNeedsContiguousMemoryForIsoch kUSBHostControllerPropertyIsochronousRequiresContiguous +#define kUSBHubDontAllowLowPower kUSBHostHubPropertyIdlePolicy +#define kConfigurationDescriptorOverride kUSBHostDevicePropertyConfigurationDescriptorOverride +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_14 */ +#endif + + +/*! + @enum USBReEnumerateOptions + @discussion Options used when calling ReEnumerateDevice. + @constant kUSBAddExtraResetTimeBit Setting this bit will cause the Hub driver to wait 100ms before addressing the device after the reset following the re-enumeration. + @constant kUSBReEnumerateCaptureDeviceBit Setting this bit will terminate any drivers attached to an IOUSBInterface for the device and to the IOUSBDevice itself. It will not terminate + any drivers attached to a Mass Storage Class IOUSBInterface. A client needs to have the appropriate permissions in order to specify this bit. See IOUSBLib.h + @constant kUSBReEnumerateReleaseDeviceBit Setting this bit will return return any device that was captured back to the OS. The driver for the IOUSBDevice will be loaded. A client needs to have the appropriate permissions in order to specify this bit. See IOUSBLib.h + */ +typedef enum +{ + kUSBAddExtraResetTimeBit = 31, + kUSBReEnumerateCaptureDeviceBit = 30, + kUSBReEnumerateReleaseDeviceBit = 29, + kUSBAddExtraResetTimeMask = ( 1 << kUSBAddExtraResetTimeBit), + kUSBReEnumerateCaptureDeviceMask = ( 1 << kUSBReEnumerateCaptureDeviceBit), + kUSBReEnumerateReleaseDeviceMask = ( 1 << kUSBReEnumerateReleaseDeviceBit) +} USBReEnumerateOptions; + +/*! + @enum USBDeviceInformationBits + @discussion GetUSBDeviceInformation will return a unit32_t value with bits set indicating that a particular state is present in the USB device. These bits are described here + + @constant kUSBInformationDeviceIsCaptiveBit The USB device is directly attached to its hub and cannot be removed. + @constant kUSBInformationDeviceIsAttachedToRootHubBit The USB device is directly attached to the root hub + @constant kUSBInformationDeviceIsInternalBit The USB device is internal to the enclosure (all the hubs it attaches to are captive) + @constant kUSBInformationDeviceIsConnectedBit The USB device is connected to its hub + @constant kUSBInformationDeviceIsEnabledBit The hub port to which the USB device is attached is enabled + @constant kUSBInformationDeviceIsSuspendedBit The hub port to which the USB device is attached is suspended + @constant kUSBInformationDeviceIsInResetBit The hub port to which the USB device is attached is being reset + @constant kUSBInformationDeviceOvercurrentBit The USB device generated an overcurrent + @constant kUSBInformationDevicePortIsInTestModeBit The hub port to which the USB device is attached is in test mode + @constant kUSBInformationDeviceIsRootHub The device is the root hub simulation + @constant kUSBInformationRootHubisBuiltIn If this is a root hub simulation and it's built into the enclosure, this bit is set. If it's on an expansion card, it will be cleared + @constant kUSBInformationDeviceIsRemote This device is "attached" to the controller through a remote connection + @constant kUSBInformationDeviceIsAttachedToEnclosure The hub port to which the USB device is connected has a USB connector on the enclosure + @constant kUSBInformationDeviceIsOnThunderboltBit The USB device is downstream of a controller that is attached through Thunderbolt + + */ +typedef enum +{ + kUSBInformationDeviceIsCaptiveBit = 0, + kUSBInformationDeviceIsAttachedToRootHubBit = 1, + kUSBInformationDeviceIsInternalBit = 2, + kUSBInformationDeviceIsConnectedBit = 3, + kUSBInformationDeviceIsEnabledBit = 4, + kUSBInformationDeviceIsSuspendedBit = 5, + kUSBInformationDeviceIsInResetBit = 6, + kUSBInformationDeviceOvercurrentBit = 7, + kUSBInformationDevicePortIsInTestModeBit = 8, + kUSBInformationDeviceIsRootHub = 9, + kUSBInformationRootHubisBuiltIn = 10, + kUSBInformationRootHubIsBuiltInBit = 10, + kUSBInformationDeviceIsRemote = 11, + kUSBInformationDeviceIsAttachedToEnclosure = 12, + kUSBInformationDeviceIsOnThunderboltBit = 13, + kUSBInformationDeviceIsCaptiveMask = (1 << kUSBInformationDeviceIsCaptiveBit), + kUSBInformationDeviceIsAttachedToRootHubMask = (1 << kUSBInformationDeviceIsAttachedToRootHubBit), + kUSBInformationDeviceIsInternalMask = (1 << kUSBInformationDeviceIsInternalBit), + kUSBInformationDeviceIsConnectedMask = (1 << kUSBInformationDeviceIsConnectedBit), + kUSBInformationDeviceIsEnabledMask = (1 << kUSBInformationDeviceIsEnabledBit), + kUSBInformationDeviceIsSuspendedMask = (1 << kUSBInformationDeviceIsSuspendedBit), + kUSBInformationDeviceIsInResetMask = (1 << kUSBInformationDeviceIsInResetBit), + kUSBInformationDeviceOvercurrentMask = (1 << kUSBInformationDeviceOvercurrentBit), + kUSBInformationDevicePortIsInTestModeMask = (1 << kUSBInformationDevicePortIsInTestModeBit), + kUSBInformationDeviceIsRootHubMask = (1 << kUSBInformationDeviceIsRootHub), + kUSBInformationRootHubisBuiltInMask = (1 << kUSBInformationRootHubisBuiltIn), + kUSBInformationRootHubIsBuiltInMask = (1 << kUSBInformationRootHubIsBuiltInBit), + kUSBInformationDeviceIsRemoteMask = (1 << kUSBInformationDeviceIsRemote), + kUSBInformationDeviceIsAttachedToEnclosureMask = (1 << kUSBInformationDeviceIsAttachedToEnclosure), + kUSBInformationDeviceIsOnThunderboltMask = (1 << kUSBInformationDeviceIsOnThunderboltBit) +} USBDeviceInformationBits; + +/*! + @enum USBPowerRequestTypes + @discussion Used to specify what kind of power will be reserved using the IOUSBDevice RequestExtraPower and ReturnExtraPower APIs. + @constant kUSBPowerDuringSleep The power is to be used during sleep. + @constant kUSBPowerDuringWake The power is to be used while the system is awake (i.e not sleeping) + @constant kUSBPowerRequestWakeRelease When used with ReturnExtraPower(), it will send a message to all devices to return any extra wake power if possible. + @constant kUSBPowerRequestSleepRelease When used with ReturnExtraPower(), it will send a message to all devices to return any sleep power if possible. + @constant kUSBPowerRequestWakeReallocate When used with ReturnExtraPower(), it will send a message to all devices indicating that they can ask for more wake power, as some device has released it. + @constant kUSBPowerRequestSleepReallocate When used with ReturnExtraPower(), it will send a message to all devices indicating that they can ask for more sleep power, as some device has released it. + @constant kUSBPowerDuringWakeRevocable The power is to be used while the system is awake (i.e not sleeping), but can be taken away (via the kUSBPowerRequestWakeRelease message). The system can then allocate that extra power to another device. + @constant kUSBPowerDuringWakeUSB3 This is used by the USB stack to allocate the 400mA extra for USB3, above the 500ma allocated by USB2 + */ +typedef enum +{ + kUSBPowerDuringSleep = 0, + kUSBPowerDuringWake = 1, + kUSBPowerRequestWakeRelease = 2, + kUSBPowerRequestSleepRelease = 3, + kUSBPowerRequestWakeReallocate = 4, + kUSBPowerRequestSleepReallocate = 5, + kUSBPowerDuringWakeRevocable = 6, + kUSBPowerDuringWakeUSB3 = 7 +} USBPowerRequestTypes; + +// these are not for a Public API, but are just the bits used below +enum +{ + kUSBNotificationPreForcedSuspendBit = 0, + kUSBNotificationPostForcedSuspendBit = 1, + kUSBNotificationPreForcedResumeBit = 2, + kUSBNotificationPostForcedResumeBit = 3, +}; + +/*! + @enum USBNotificationTypes + @discussion Used to register for USB notifications. These types may be OR'd together if more than one notification is desired. These notification are expected to be acknowledged before the process (e.g. system sleep or system wake) can be continued. See RegisterForNotification and AcknowledgeNotification in IOUSBDeviceInterface and IOUSBInterfaceInterface. + @constant kUSBNotificationPreForcedSuspend A notification is sent prior to a forced suspend (e.g. system sleep). + @constant kUSBNotificationPostForcedSuspend A notification is sent after a forced suspend has been completed (e.g. system sleep). + @constant kUSBNotificationPreForcedResume A notification is sent before a resume which happens after a forced suspend (e.g. system wake). + @constant kUSBNotificationPostForcedResume A notification is sent after a resume which happens after a forced suspend (e.g. system wake). + */ +typedef enum +{ + kUSBNotificationPreForcedSuspend = (1 << kUSBNotificationPreForcedSuspendBit), + kUSBNotificationPostForcedSuspend = (1 << kUSBNotificationPostForcedSuspendBit), + kUSBNotificationPreForcedResume = (1 << kUSBNotificationPreForcedResumeBit), + kUSBNotificationPostForcedResume = (1 << kUSBNotificationPostForcedResumeBit), +} USBNotificationTypes; + + +// Apple specific properties +#define kAppleRevocableExtraCurrent "AAPL,revocable-extra-current" +#define kAppleExternalSuperSpeedPorts "AAPL,ExternalSSPorts" +#define kAppleUnconnectedSuperSpeedPorts "AAPL,UnconnectedSSPorts" +#define kAppleAcpiRootHubDepth "AAPL,root-hub-depth" + +#define kAppleStandardPortCurrentInSleep "AAPL,standard-port-current-in-sleep" + +#define kAppleInternalUSBDevice "AAPL,device-internal" +#define kAppleExternalConnectorBitmap "AAPL,ExternalConnectorBitmap" +#define kUSBBusID "AAPL,bus-id" +#define kApplePowerSupply "AAPL,power-supply" + +// Deprecated Names and/or values +#define kAppleCurrentAvailable "AAPL,current-available" +#define kAppleCurrentInSleep "AAPL,current-in-sleep" +#define kApplePortCurrentInSleep "AAPL,port-current-in-sleep" + +#define kOverrideAttachedToCPU "kOverrideAttachedToCPU" + +// UPC definitions from ACPI Rev 4.0 +typedef enum +{ + kUSBPortNotConnectable = 0, // Port is not connectable + kUSBPortConnectable = 1 // Port is connectable either user visible or invisible +} kUSBConnectable; + +typedef enum +{ + kUSBTypeAConnector = 0x00, // Type ÔAÕ connector + kUSBTypeMiniABConnector = 0x01, // Mini-AB connector + kUSBTypeExpressCard = 0x02, // ExpressCard + kUSB3TypeStdAConnector = 0x03, // USB 3 Standard-A connector + kUSB3TypeStdBConnector = 0x04, // USB 3 Standard-B connector + kUSB3TypeMicroBConnector = 0x05, // USB 3 Micro-B connector + kUSB3TypeMicroABConnector = 0x06, // USB 3 Micro-AB connector + kUSB3TypePowerBConnector = 0x07, // USB 3 Power-B connector + kUSBProprietaryConnector = 0xFF // Proprietary connector +} kUSBHostConnectorType; + +// Root hub definitions +enum +{ + kUSBSpeed_Mask = USBBitRange(0, 1), + kUSBSpeed_Shift = USBBitRangePhase(0, 1), + + kUSBAddress_Mask = USBBitRange(8, 15), + kUSBAddress_Shift = USBBitRangePhase(8, 15) +}; + +enum +{ + kXHCISSRootHubAddress = kUSBMaxDevices, + kXHCIUSB2RootHubAddress = kUSBMaxDevices + 1, + kSuperSpeedBusBitMask = 0x01000000 +}; + +#define ISROOTHUB(a) ((a == kXHCISSRootHubAddress) || (a == kXHCIUSB2RootHubAddress)) + +// values (in nanoseconds) which are sent to requireMaxBusStall as appropriate +#define kEHCIIsochMaxBusStall 25000 +#define kXHCIIsochMaxBusStall 25000 +#define kOHCIIsochMaxBusStall 25000 +#define kUHCIIsochMaxBusStall 10000 +#define kMaxBusStall10uS 10000 +#define kMaxBusStall25uS 25000 + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/QualcommWireless/include/IOKit/usb/USBHub.h b/QualcommWireless/include/IOKit/usb/USBHub.h new file mode 100644 index 0000000..ba41437 --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/USBHub.h @@ -0,0 +1,387 @@ +/* + * Copyright � 1998-2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _USBHUB_H +#define _USBHUB_H + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/USBSpec.h> + + /*! + @header USBHub.h + @abstract Constants and definitions used with Hub devices. + @discussion + */ + + /*! + @enum Hub Descriptor Type + @discussion + */ +enum { + kUSBHubDescriptorType = 0x29, + kUSB3HubDescriptorType = 0x2A +}; + + /*! + @enum HubFeatures + @discussion Used with SET_FEATURE to set hub and port features + */ +enum { + + kUSBHubLocalPowerChangeFeature = 0, /* Hub features */ + kUSBHubOverCurrentChangeFeature = 1, + + kUSBHubPortConnectionFeature = 0, /* port features */ + kUSBHubPortEnableFeature = 1, + kUSBHubPortSuspendFeature = 2, + kUSBHubPortOverCurrentFeature = 3, + kUSBHubPortResetFeature = 4, + kUSBHubPortPowerFeature = 8, + kUSBHubPortLowSpeedFeature = 9, + kUSBHubPortConnectionChangeFeature = 16, + kUSBHubPortEnableChangeFeature = 17, + kUSBHubPortSuspendChangeFeature = 18, + kUSBHubPortOverCurrentChangeFeature = 19, + kUSBHubPortResetChangeFeature = 20, + kUSBHubPortTestFeature = 21, + kUSBHubPortIndicatorFeature = 22, + + // USB 3.0 + kUSBHubPortLinkStateFeature = 5, /* port features */ + kUSBHubPortU1TimeoutFeature = 23, + kUSBHubPortU2TimeoutFeature = 24, + kUSBHubPortLinkStateChangeFeature = 25, + kUSBHubPortConfigErrorChangeFeature = 26, + kUSBHubPortRemoteWakeMaskFeature = 27, + kUSBHubPortBHPortResetFeature = 28, + kUSBHubPortBHResetChangeFeature = 29, + kUSBHubPortForceLinkPMAcceptFeature = 30, + +}; + + /*! + @enum HubPortStatus + @discussion Used to decode the Port Status and Change + */ +enum { + kSSHubPortStatusConnectionBit = 0, + kSSHubPortStatusEnabledBit = 1, + kSSHubPortStatusOverCurrentBit = 3, + kSSHubPortStatusResetBit = 4, + + // USB 3.0 + kSSHubPortStatusLinkStateShift = 5, + kSSHubPortStatusPowerBit = 9, + kSSHubPortStatusSpeedShift = 10, + kSSHubPortChangeBHResetBit = 5, + kSSHubPortChangePortLinkStateBit = 6, + kSSHubPortChangePortConfigErrBit = 7, + + kHubPortConnection = 0x0001, + kHubPortEnabled = 0x0002, + kHubPortSuspend = 0x0004, + kHubPortOverCurrent = 0x0008, + kHubPortBeingReset = 0x0010, + kHubPortPower = 0x0100, + kHubPortLowSpeed = 0x0200, + kHubPortHighSpeed = 0x0400, + kHubPortTestMode = 0x0800, + kHubPortIndicator = 0x1000, + kHubPortSuperSpeed = 0x2000, // This is a synthesized bit that is using a reserved bit from the Hub Port Status definition in USB 2.0. + kHubPortBit14 = 0x4000, // That bit is used by the hub driver to encode the USB3 link state into the USB2 PortStatus (using bits 5-7 as well, that are reserved in the USB 2 spec) + kHubPortDebouncing = 0x8000, // This is a synthesized bit that is using a reserved bit from the Hub Port Status definition in USB 2.0. + + // USB 3.0 + kSSHubPortStatusConnectionMask = ( 1 << kSSHubPortStatusConnectionBit ), + kSSHubPortStatusEnabledMask = ( 1 << kSSHubPortStatusEnabledBit ), + kSSHubPortStatusOverCurrentMask = ( 1 << kSSHubPortStatusOverCurrentBit ), + kSSHubPortStatusBeingResetMask = ( 1 << kSSHubPortStatusResetBit ), + kSSHubPortStatusLinkStateMask = 0x01E0, + kSSHubPortStatusPowerMask = ( 1 << kSSHubPortStatusPowerBit ), + kSSHubPortStatusSpeedMask = 0x1C00, + kSSHubPortChangeBHResetMask = ( 1 << kSSHubPortChangeBHResetBit ), + kSSHubPortChangePortLinkStateMask = ( 1 << kSSHubPortChangePortLinkStateBit ), + kSSHubPortChangePortConfigErrMask = ( 1 << kSSHubPortChangePortConfigErrBit ), + + // these are the bits which cause the hub port state machine to keep moving (USB 3.0) + kHubPortSuperSpeedStateChangeMask = (kHubPortConnection | kHubPortEnabled | kHubPortSuspend | kHubPortOverCurrent | kHubPortBeingReset | kSSHubPortStatusBeingResetMask | kSSHubPortChangePortLinkStateMask | kSSHubPortChangePortConfigErrMask), + // these are the bits which cause the hub port state machine to keep moving (USB 2.0) + kHubPortStateChangeMask = (kHubPortConnection | kHubPortEnabled | kHubPortSuspend | kHubPortOverCurrent | kHubPortBeingReset) +}; + + + /*! + @enum HubStatus + @discussion Used to decode the Hub Status and Change + */ +enum { + kHubLocalPowerStatus = 1, + kHubOverCurrentIndicator = 2, + kHubLocalPowerStatusChange = 1, + kHubOverCurrentIndicatorChange = 2 +}; + + /*! + @enum HubCharacteristics + @discussion + */ +enum { + kPerPortSwitchingBit = (1 << 0), + kNoPowerSwitchingBit = (1 << 1), + kCompoundDeviceBit = (1 << 2), + kPerPortOverCurrentBit = (1 << 3), + kNoOverCurrentBit = (1 << 4), + + kUSBHubOvercurrentMask = 0x18, + kUSBHubOvercurrentShift = 3, + + kHubTTThinkTimeMask = 0x60, + kHubTTThinkTimeShift = 5, + + kHubPortIndicatorBit = 7, + kHubPortIndicatorMask = 0x0080 +}; + +/*! +@enum PowerSwitching + @discussion + */ +enum { + kHubSupportsGangPower = 0, + kHubSupportsIndividualPortPower = 1, + kHubPortSetPowerOff = 0, + kHubPortSetPowerOn = 1 +}; + +/*! +@enum PortIndicatorSelectors + @discussion + */ +enum { + kHubPortIndicatorAutomatic = 0, + kHubPortIndicatorAmber, + kHubPortIndicatorGreen, + kHubPortIndicatorOff +}; + +/*! + @enum Root Hub specific + @discussion + */ +enum { + kPrdRootHubApple = 0x8005, // ProductID for classic speed root hubs + kPrdRootHubAppleE = 0x8006, // ProductID for high speed root hubs + kPrdRootHubAppleSS = 0x8007, // ProductID for super speed root hubs + kUSBRootHubPollingRate = 32 // Enpoint polling rate interval for root hubs +}; + +/*! + @enum Hub Class Request + @discussion Specifies values for the bRequest field of a Device Request. + */ +enum USBHubClassRequest { + kUSBHubRqGetStatus = 0, + kUSBHubRqClearFeature = 1, + kUSBHubRqGetState = 2, + kUSBHubRqSetFeature = 3, + kUSBHubRqReserved2 = 4, + kUSBHubRqSetAddress = 5, + kUSBHubRqGetDescriptor = 6, + kUSBHubRqSetDescriptor = 7, + kUSBHubRqGetConfig = 8, + kUSBHubRqSetConfig = 9, + kUSBHubRqGetInterface = 10, + kUSBHubRqSetInterface = 11, +}; + +/*! +@enum Hub Device Requests +@discussion Encoding of the hub specific standard requests +<tt> +<pre><b> +Request bmRequestType bRequest wValue wIndex wLength Data</b> +ClearHubFeature 0010 0000B CLEAR_FEATURE Feature Zero Zero None +ClearPortFeature 0010 0011B Feature Port Zero None + +GetBusState 1010 0011B GET_STATE Zero Port One Port Bus State + +GetHubDescriptor 1010 0000B GET_DESCRIPTOR Type Zero Length Descriptor + +GetHubStatus 1010 0000B GET_STATUS Zero Zero Four Hub Status +GetPortStatus 1010 0011B Zero Port Four Port Status + +SetHubDescriptor 0010 0000B SET_DESCRIPTOR Type Zero Length Descriptor + +SetHubFeature 0010 0000B SET_FEATURE Feature Zero Zero None +SetPortFeature 0010 0011B Feature Port Zero None +</pre> +</tt> + */ +enum { + kClearHubFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBClass, kUSBDevice), + kClearPortFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBClass, kUSBOther), + kGetPortState = EncodeRequest(kUSBRqGetState, kUSBIn, kUSBClass, kUSBOther), + kGetHubDescriptor = EncodeRequest(kUSBRqGetDescriptor, kUSBIn, kUSBClass, kUSBDevice), + kGetHub3Descriptor= EncodeRequest(kUSBRqGetDescriptor, kUSBIn, kUSBClass, kUSBDevice), + kGetHubStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBClass, kUSBDevice), + kGetPortStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBClass, kUSBOther), + kSetHubDescriptor = EncodeRequest(kUSBRqGetDescriptor, kUSBOut, kUSBClass, kUSBDevice), + kSetHubFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBClass, kUSBDevice), + kSetPortFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBClass, kUSBOther) +}; + + +/*! + @typedef IOUSBHubDescriptor + @discussion USB Hub Descriptor. See the USB HID Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ + +enum{ + // Support a maximum of 64 ports, which will pack into 9 bytes + kNumPortBytes = 9 +}; + +struct IOUSBHubDescriptor { + UInt8 length; + UInt8 hubType; + UInt8 numPorts; + UInt16 characteristics __attribute__((packed)); + UInt8 powerOnToGood; // Port settling time, in 2ms + UInt8 hubCurrent; + // These are received packed, will have to be unpacked + UInt8 removablePortFlags[kNumPortBytes]; + UInt8 pwrCtlPortFlags[kNumPortBytes]; +}; + +typedef struct IOUSBHubDescriptor IOUSBHubDescriptor; + +enum +{ + // these are sent to the controller when configuring a HS hub + + kUSBHSHubCommandAddHub = 1, + kUSBHSHubCommandRemoveHub = 2, + + kUSBHSHubFlagsMultiTTMask = 0x01, + kUSBHSHubFlagsMoreInfoMask = 0x02, + kUSBHSHubFlagsTTThinkTimeShift = 2, + kUSBHSHubFlagsTTThinkTimeMask = 0x0C, + kUSBHSHubFlagsNumPortsShift = 4, + kUSBHSHubFlagsNumPortsMask = 0xF0 +}; + +// To cope with the extra fields in a USB3 hub descriptor + +struct IOUSB3HubDescriptor { + UInt8 length; + UInt8 hubType; + UInt8 numPorts; + UInt16 characteristics __attribute__((packed)); + UInt8 powerOnToGood; // Port settling time, in 2ms + UInt8 hubCurrent; + UInt8 hubHdrDecLat; // Header decode latency, new 3.0 field + UInt16 hubDelay __attribute__((packed)); // new in 3.0 + + // These are received packed, will have to be unpacked + UInt8 removablePortFlags[kNumPortBytes]; + UInt8 pwrCtlPortFlags[kNumPortBytes]; // This field does not exist in the 3.0 descriptor +}; + +typedef struct IOUSB3HubDescriptor IOUSB3HubDescriptor; + +/*! + @typedef IOUSBHubStatus + @discussion Used to get the port status and change flags using GetPortStatus() +*/ +struct IOUSBHubStatus { + UInt16 statusFlags; + UInt16 changeFlags; +}; +typedef struct IOUSBHubStatus IOUSBHubStatus; +typedef IOUSBHubStatus * IOUSBHubStatusPtr; + +typedef struct IOUSBHubStatus IOUSBHubPortStatus; + + +/*! + @typedef IOUSBHubPortReEnumerateParam + @discussion Used to specify the port that needs to be reenumerated +*/ +typedef struct IOUSBHubPortReEnumerateParam IOUSBHubPortReEnumerateParam; + +struct IOUSBHubPortReEnumerateParam { + UInt32 portNumber; + UInt32 options; +}; + +typedef struct IOUSBHubPortClearTTParam IOUSBHubPortClearTTParam; + +struct IOUSBHubPortClearTTParam { + UInt32 portNumber; + UInt32 options; +#if 0 + UInt8 deviceAddress; <<0 + UInt8 endpointNum; <<8 + UInt8 endpointType; <<16 // As split transaction. 00 Control, 10 Bulk + UInt8 IN; <<24 // Direction, 1 = IN, 0 = OUT +#endif +}; + +#pragma mark USB 3 Additions + +/*! + @enum USB 3 Hub Class Request + @discussion Specifies values for the bRequest field of a Device Request. + */ +enum { + kUSBHubRqSetHubDepth = 12, + kUSBHubRqGetPortErrorCount = 13 +}; + +enum { + kSetHubDepth = EncodeRequest(kUSBHubRqSetHubDepth, kUSBOut, kUSBClass, kUSBDevice), + kGetPortErrorCount = EncodeRequest(kUSBHubRqGetPortErrorCount, kUSBIn, kUSBClass, kUSBOther) +}; + +/*! + @enum Link State for USB 3.0 + @discussion Used to decode the Port Status and Change + */ +enum { + kSSHubPortLinkStateU0 = 0, + kSSHubPortLinkStateU1 = 1, + kSSHubPortLinkStateU2 = 2, + kSSHubPortLinkStateU3 = 3, + kSSHubPortLinkStateSSDisabled = 4, + kSSHubPortLinkStateRxDetect = 5, + kSSHubPortLinkStateSSInactive = 6, + kSSHubPortLinkStatePolling = 7, + kSSHubPortLinkStateRecovery = 8, + kSSHubPortLinkStateHotReset = 9, + kSSHubPortLinkStateComplianceMode = 10, + kSSHubPortLinkStateLoopBack = 11, + + kSSHubPortSpeed5Gbps = 0 +}; + +#endif diff --git a/QualcommWireless/include/IOKit/usb/USBSpec.h b/QualcommWireless/include/IOKit/usb/USBSpec.h new file mode 100644 index 0000000..32975ba --- /dev/null +++ b/QualcommWireless/include/IOKit/usb/USBSpec.h @@ -0,0 +1,685 @@ +/* + * Copyright � 1998-2012 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Constants that both OS9 and OSX want to define, and whose values are + * specified by the USB Standard. + * Put in a seperate file so they can be included if the OS9 include file isn't already + * included. + */ +#ifndef _USBSPEC_H +#define _USBSPEC_H + +#include <IOKit/usb/AppleUSBDefinitions.h> +#include <IOKit/usb/IOUSBHostFamilyDefinitions.h> + +#if !__OPEN_SOURCE__ && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST +// these headers were previously exported for iOS clients +#include <IOKit/usb/IOUSBHostFamily.h> +#include <IOKit/usb/StandardUSB.h> +#endif + + +#ifdef __cplusplus + +#if !__OPEN_SOURCE__ && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST +using namespace StandardUSB; +#endif + +extern "C" { +#endif + +#if !__OPEN_SOURCE__ && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST +/* @enum Feature constants + @discussion Used with SET_FEATURE requests + */ +enum +{ + kUSBFunctionSuspendLowPower = kIOUSBInterfaceSuspendLowPower, + kUSBFunctionSuspendEnableRemoteWake = kIOUSBInterfaceSuspendRemoteWakeEnable +}; + +/*! + @enum Device Status + @discussion Specified bits returned by a get status request + */ +enum +{ + kUSBDeviceStatusSelfPowered = kIOUSBDeviceStatusSelfPowered, + kUSBDeviceStatusRemoteWake = kIOUSBDeviceStatusRemoteWakeEnable, + kUSBDeviceStatusU1Enable = kIOUSBDeviceStatusU1Enable, + kUSBDeviceStatusU2Enable = kIOUSBDeviceStatusU2Enable, + kUSBDeviceStatusLTMEnable = kIOUSBDeviceStatusLTMEnable, + + kUSBInterfaceStatusFunctionRemoteWakeCapable = kIOUSBInterfaceStatusRemoteWakeCapable, + kUSBInterfaceStatusFunctionRemoteWake = kIOUSBInterfaceStatusRemoteWakeEnable, + + kUSBPipeStatusHalt = IOUSBEndpointStatusHalt +}; + +#endif + +/*! + @header USBSpec.h + @abstract Constants and definitions of parameters that are used in communcating with USB devices and interfaces. + @discussion + */ + +/*! + @enum Endpoint type + @discussion Used in IOUSBFindEndpointRequest's type field + */ +enum +{ + kUSBControl = kIOUSBEndpointTypeControl, + kUSBIsoc = kIOUSBEndpointTypeIsochronous, + kUSBBulk = kIOUSBEndpointTypeBulk, + kUSBInterrupt = kIOUSBEndpointTypeInterrupt, + kUSBAnyType = 0xFF +}; + +/*! + @enum Endpoint direction + @discussion Used in IOUSBFindEndpointRequest's direction field + */ +enum +{ + kUSBOut = kIOUSBEndpointDirectionOut, + kUSBIn = kIOUSBEndpointDirectionIn, + kUSBNone = kIOUSBEndpointDirectionUnknown, + kUSBAnyDirn = 3 +}; + +/*! + @enum Device Request Type + @discussion This type is encoded in the bmRequestType field of a Device Request. It specifies the type of request: standard, class or vendor specific. + */ +enum +{ + kUSBStandard = kIOUSBDeviceRequestTypeValueStandard, + kUSBClass = kIOUSBDeviceRequestTypeValueClass, + kUSBVendor = kIOUSBDeviceRequestTypeValueVendor +}; + +/*! + @enum Device Request Recipient + @discussion This recipient is encoded in the bmRequestType field of a Device Request. It specifies the type of recipient for a request: the device, the interface, or an endpoint. + */ +enum +{ + kUSBDevice = kIOUSBDeviceRequestRecipientValueDevice, + kUSBInterface = kIOUSBDeviceRequestRecipientValueInterface, + kUSBEndpoint = kIOUSBDeviceRequestRecipientValueEndpoint, + kUSBOther = kIOUSBDeviceRequestRecipientValueOther +}; + +/*! + @enum Device Request + @discussion Specifies values for the bRequest field of a Device Request. + */ +enum +{ + kUSBRqGetStatus = kIOUSBDeviceRequestGetStatus, + kUSBRqClearFeature = kIOUSBDeviceRequestClearFeature, + kUSBRqGetState = kIOUSBDeviceRequestGetState, + kUSBRqSetFeature = kIOUSBDeviceRequestSetFeature, + kUSBRqReserved2 = 4, + kUSBRqSetAddress = kIOUSBDeviceRequestSetAddress, + kUSBRqGetDescriptor = kIOUSBDeviceRequestGetDescriptor, + kUSBRqSetDescriptor = kIOUSBDeviceRequestSetDescriptor, + kUSBRqGetConfig = kIOUSBDeviceRequestGetConfiguration, + kUSBRqSetConfig = kIOUSBDeviceRequestSetConfiguration, + kUSBRqGetInterface = kIOUSBDeviceRequestGetInterface, + kUSBRqSetInterface = kIOUSBDeviceRequestSetInterface, + kUSBRqSyncFrame = kIOUSBDeviceRequestSynchFrame, + kUSBSetSel = kIOUSBDeviceRequestSetSel, + kUSBSetIsochDelay = kIOUSBDeviceRequestSetIsochronousDelay +}; + +/*! + @enum USB Descriptors + @discussion Specifies values for diffent descriptor types. + */ +enum +{ + kUSBAnyDesc = 0, // Wildcard for searches + kUSBDeviceDesc = kIOUSBDescriptorTypeDevice, + kUSBConfDesc = kIOUSBDescriptorTypeConfiguration, + kUSBStringDesc = kIOUSBDescriptorTypeString, + kUSBInterfaceDesc = kIOUSBDescriptorTypeInterface, + kUSBEndpointDesc = kIOUSBDescriptorTypeEndpoint, + kUSBDeviceQualifierDesc = kIOUSBDescriptorTypeDeviceQualifier, + kUSBOtherSpeedConfDesc = kIOUSBDescriptorTypeOtherSpeedConfiguration, + kUSBInterfacePowerDesc = kIOUSBDescriptorTypeInterfacePower, + kUSBOnTheGoDesc = kIOUSBDescriptorTypeOTG, + kUSDebugDesc = kIOUSBDescriptorTypeDebug, + kUSBInterfaceAssociationDesc = kIOUSBDescriptorTypeInterfaceAssociation, + kUSBBOSDescriptor = kIOUSBDescriptorTypeBOS, + kUSBDeviceCapability = kIOUSBDescriptorTypeDeviceCapability, + kUSBSuperSpeedEndpointCompanion = kIOUSBDescriptorTypeSuperSpeedUSBEndpointCompanion, + kUSB3HUBDesc = kIOUSBDescriptorTypeSuperSpeedHub, + kUSBHIDDesc = kIOUSBDecriptorTypeHID, + kUSBReportDesc = kIOUSBDecriptorTypeReport, + kUSBPhysicalDesc = 0x23, + kUSBHUBDesc = kIOUSBDescriptorTypeHub, +}; + + +/*! + @enum Device Capability Types + @discussion Used with decoding the Device Capability descriptor + */ +enum +{ + kUSBDeviceCapabilityWirelessUSB = kIOUSBDeviceCapabilityTypeWireless, + kUSBDeviceCapabilityUSB20Extension = kIOUSBDeviceCapabilityTypeUSB20Extension, + kUSBDeviceCapabilitySuperSpeedUSB = kIOUSBDeviceCapabilityTypeSuperSpeed, + kUSBDeviceCapabilityContainerID = kIOUSBDeviceCapabilityTypeContainerID, + kUSBDeviceCapabilityBillboard = kIOUSBDeviceCapabilityTypeBillboard, + kUSBDeviceCapabilityBillboardAltMode = kIOUSBDeviceCapabilityTypeBillboardAltMode +}; + +/*! + @enum Feature Selectors + @discussion Used with SET/CLEAR_FEATURE requests. + */ +enum +{ + kUSBFeatureEndpointStall = IOUSBEndpointFeatureSelectorStall, // Endpoint + kUSBFeatureDeviceRemoteWakeup = kIOUSBDeviceFeatureSelectorRemoteWakeup, // Device + kUSBFeatureTestMode = kIOUSBDeviceFeatureSelectorTestMode, // Device + kUSBFeatureFunctionSuspend = kIOUSBInterfaceFeatureSelectorSuspend, // Interface + kUSBFeatureU1Enable = kIOUSBDeviceFeatureSelectorU1Enable, // Device + kUSBFeatureU2Enable = kIOUSBDeviceFeatureSelectorU2Enable, // Device + kUSBFeatureLTMEnable = kIOUSBDeviceFeatureSelectorLTMEnable // Device +}; + +/*! + @enum Miscellaneous bits and masks + */ +enum +{ + kUSBFunctionRemoteWakeCapableBit = IOUSBBit(0), // GET_STATUS + kUSBFunctionRemoteWakeupBit = IOUSBBit(1), // GET_STATUS + kUSBLowPowerSuspendStateBit = IOUSBBit(0), // SET_FEATURE(FUNCTION_SUSPEND) + kUSBFunctionRemoteWakeEnableBit = IOUSBBit(1) // SET_FEATURE(FUNCTION_SUSPEND) +}; + +/*! + @enum USB Power constants + @discussion Constants relating to USB Power. + */ +enum +{ + kUSB100mAAvailable = 50, + kUSB500mAAvailable = 250, + kUSB100mA = 50, + kUSBAtrBusPowered = 0x80, + kUSBAtrSelfPowered = 0x40, + kUSBAtrRemoteWakeup = 0x20, + kUSB2MaxPowerPerPort = kIOUSB20BusCurrentDefault, + kUSB150mAAvailable = 75, + kUSB900mAAvailable = 450, + kUSB150mA = 75, + kUSB3MaxPowerPerPort = kIOUSB30BusCurrentDefault +}; + +/*! + @enum USB Release constants + @discussion Constants relating to USB releases as found in the bcdUSB field of the Device Descriptor. + */ +enum +{ + kUSBRel10 = 0x0100, + kUSBRel11 = 0x0110, + kUSBRel20 = 0x0200, + kUSBRel30 = 0x0300 +}; + + +/*! + @enum HID requests + @discussion Constants for HID requests. + */ +enum +{ + kHIDRqGetReport = 1, + kHIDRqGetIdle = 2, + kHIDRqGetProtocol = 3, + kHIDRqSetReport = 9, + kHIDRqSetIdle = 10, + kHIDRqSetProtocol = 11 +}; + +/*! + @enum HID report types + @discussion Constants for the three kinds of HID reports. + */ +enum +{ + kHIDRtInputReport = 1, + kHIDRtOutputReport = 2, + kHIDRtFeatureReport = 3 +}; + + +/*! + @enum HID Protocol + @discussion Used in the SET_PROTOCOL device request + */ +enum +{ + kHIDBootProtocolValue = 0, + kHIDReportProtocolValue = 1 +}; + + + +enum +{ + kUSBCapsLockKey = 0x39, + kUSBNumLockKey = 0x53, + kUSBScrollLockKey = 0x47 +}; + +/*! + @enum Device Class Codes + @discussion Constants for USB Device classes (bDeviceClass). + */ +enum +{ + kUSBCompositeClass = 0, + kUSBCommClass = 2, // Deprecated + kUSBCommunicationClass = 2, + kUSBHubClass = 9, + kUSBDataClass = 10, + kUSBPersonalHealthcareClass = 15, + kUSBBillBoardClass = 17, + kUSBDiagnosticClass = 220, + kUSBWirelessControllerClass = 224, + kUSBMiscellaneousClass = 239, + kUSBApplicationSpecificClass = 254, + kUSBVendorSpecificClass = 255 +}; + +/*! + @enum Interface Class + @discussion Constants for Interface classes (bInterfaceClass). + */ +enum +{ + kUSBAudioClass = 1, // Deprecated + kUSBAudioInterfaceClass = 1, + + kUSBCommunicationControlInterfaceClass = 2, + kUSBCommunicationDataInterfaceClass = 10, + + kUSBHIDClass = 3, + kUSBHIDInterfaceClass = 3, + + kUSBPhysicalInterfaceClass = 5, + + kUSBImageInterfaceClass = 6, + + kUSBPrintingClass = 7, // Deprecated + kUSBPrintingInterfaceClass = 7, + + kUSBMassStorageClass = 8, // Deprecated + kUSBMassStorageInterfaceClass = 8, + + kUSBChipSmartCardInterfaceClass = 11, + + kUSBContentSecurityInterfaceClass = 13, + + kUSBVideoInterfaceClass = 14, + + kUSBPersonalHealthcareInterfaceClass = 15, + + kUSBDiagnosticDeviceInterfaceClass = 220, + + kUSBWirelessControllerInterfaceClass = 224, + + kUSBApplicationSpecificInterfaceClass = 254, + + kUSBVendorSpecificInterfaceClass = 255 +}; + +// Obsolete +enum +{ + kUSBDisplayClass = 4 // Obsolete +}; + +/*! + @enum Interface SubClass + @discussion Constants for USB Interface SubClasses (bInterfaceSubClass). + */ +enum +{ + kUSBCompositeSubClass = 0, + + kUSBHubSubClass = 0, + + // For the kUSBAudioInterfaceClass + // + kUSBAudioControlSubClass = 0x01, + kUSBAudioStreamingSubClass = 0x02, + kUSBMIDIStreamingSubClass = 0x03, + + // For the kUSBApplicationSpecificInterfaceClass + // + kUSBDFUSubClass = 0x01, + kUSBIrDABridgeSubClass = 0x02, + kUSBTestMeasurementSubClass = 0x03, + + // For the kUSBMassStorageInterfaceClass + // + kUSBMassStorageRBCSubClass = 0x01, + kUSBMassStorageATAPISubClass = 0x02, + kUSBMassStorageQIC157SubClass = 0x03, + kUSBMassStorageUFISubClass = 0x04, + kUSBMassStorageSFF8070iSubClass = 0x05, + kUSBMassStorageSCSISubClass = 0x06, + + // For the kUSBHIDInterfaceClass + // + kUSBHIDBootInterfaceSubClass = 0x01, + + // For the kUSBCommunicationDataInterfaceClass + // + kUSBCommDirectLineSubClass = 0x01, + kUSBCommAbstractSubClass = 0x02, + kUSBCommTelephoneSubClass = 0x03, + kUSBCommMultiChannelSubClass = 0x04, + kUSBCommCAPISubClass = 0x05, + kUSBCommEthernetNetworkingSubClass = 0x06, + kUSBATMNetworkingSubClass = 0x07, + + // For the kUSBDiagnosticDeviceInterfaceClass + // + kUSBReprogrammableDiagnosticSubClass = 0x01, + + // For the kUSBWirelessControllerInterfaceClass + // + kUSBRFControllerSubClass = 0x01, + + // For the kUSBMiscellaneousClass + // + kUSBCommonClassSubClass = 0x02, + + // For the kUSBVideoInterfaceClass + // + kUSBVideoControlSubClass = 0x01, + kUSBVideoStreamingSubClass = 0x02, + kUSBVideoInterfaceCollectionSubClass = 0x03 + +}; + +enum USBClassSpecificDesc +{ + kUSBClassSpecificDescriptor = 0x24 +}; + + +/*! + @enum Interface Protocol + @discussion Reported in the bInterfaceProtocol field of the Interface Descriptor. + */ +enum +{ + + // For kUSBHubClass + kHubSuperSpeedProtocol = 3, + + // For kUSBHIDInterfaceClass + // + kHIDNoInterfaceProtocol = 0, + kHIDKeyboardInterfaceProtocol = 1, + kHIDMouseInterfaceProtocol = 2, + kUSBVendorSpecificProtocol = 0xff, + + // For kUSBDiagnosticDeviceInterfaceClass + // + kUSB2ComplianceDeviceProtocol = 0x01, + + // For kUSBWirelessControllerInterfaceClass + // + kUSBBluetoothProgrammingInterfaceProtocol = 0x01, + + // For kUSBMiscellaneousClass + // + KUSBInterfaceAssociationDescriptorProtocol = 0x01, + + // For Mass Storage + // + kMSCProtocolControlBulkInterrupt = 0x00, + kMSCProtocolControlBulk = 0x01, + kMSCProtocolBulkOnly = 0x50, + kMSCProtocolUSBAttachedSCSI = 0x62 +}; + + +/*! + @enum DFU Class Attributes + @discussion + */ +enum +{ + kUSBDFUAttributesMask = 0x07, + kUSBDFUCanDownloadBit = 0, + kUSBDFUCanUploadBit = 1, + kUSBDFUManifestationTolerantBit = 2 +}; + +/*! + @enum Printer Class Requests + @discussion The bRequest parameter for Printing Class Sepcific Requests + */ +enum +{ + kUSPrintingClassGetDeviceID = 0, + kUSPrintingClassGePortStatus = 1, + kUSPrintingClassSoftReset = 2 +}; + +/*! + @enum Endpoint Descriptor bits + @discussion Bit definitions for endpoint descriptor fields + */ +enum +{ + kUSBbEndpointAddressMask = 0x0f, + kUSBbEndpointDirectionBit = kIOUSBEndpointDescriptorDirectionPhase, + kUSBbEndpointDirectionMask = kIOUSBEndpointDescriptorDirection, + kUSBEndpointDirectionOut = kIOUSBEndpointDescriptorDirectionOut, + kUSBEndpointDirectionIn = kIOUSBEndpointDescriptorDirectionIn, + + kUSBEndpointbmAttributesTransferTypeMask = kIOUSBEndpointDescriptorTransferType, + kUSBEndpointbmAttributesSynchronizationTypeMask = kIOUSBEndpointDescriptorSynchronizationType, + kUSBEndpointbmAttributesSynchronizationTypeShift = 2, + kUSBEndpointbmAttributesUsageTypeMask = kIOUSBEndpointDescriptorUsageType, + kUSBEndpointbmAttributesUsageTypeShift = 4, + + kUSBPeriodicInterruptUsageType = 0, + kUSBNotificationInterruptUsageType = 1, + kUSBNoSynchronizationIsocSyncType = 0, + kUSBAsynchronousIsocSyncType = 1, + kUSBAdaptiveIsocSyncType = 2, + kUSBSynchronousIsocSyncType = 3, + kUSBDataIsocUsageType = 0, + kUSBFeedbackIsocUsageType = 1, + kUSBImplicitFeedbackDataIsocUsageType = 2 +}; + +/*! + @enum USB Device Capability Type constants + @discussion Bit definitions and constants for different values of USB Device Capability types + */ +enum +{ + kUSB20ExtensionLPMSupported = 1, // Bit 1 of bmAttributes of USB 2.0 Extension Device Capability + kUSBSuperSpeedLTMCapable = 1, // Bit 1 of bmAttributes of SuperSpeed USB Device Capability + kUSBSuperSpeedSupportsLS = 0, // Value of wSpeedSupported indicating that the device supports low speed + kUSBSuperSpeedSupportsFS = 1, // Value of wSpeedSupported indicating that the device supports full speed + kUSBSuperSpeedSupportsHS = 2, // Value of wSpeedSupported indicating that the device supports high speed + kUSBSuperSpeedSupportsSS = 3, // Value of wSpeedSupported indicating that the device supports 5 Gbps +}; + +/*! + @enum USB Device Billboard Capability Vconn Power constants + @discussion Power needed by the adapter for full functionality + */ +enum +{ + kUSBBillboardVConn1Watt = 0, + kUSBBillboardVConn1P5Watt = 1, + kUSBBillboardVConn2Watt = 2, + kUSBBillboardVConn3Watt = 3, + kUSBBillboardVConn4Watt = 4, + kUSBBillboardVConn5Watt = 5, + kUSBBillboardVConn6Watt = 6, + kUSBBillboardVConnReserved = 7 +}; + +/*! + @defineblock USB Billboard Capability Descriptor Constant + @define kUSBBillboardVConnNoPowerReq bit position for No Power Required, VConn b2:0 are ignored when this bit is set + */ + +#define kUSBBillboardVConnNoPowerReq 15 + +/*! @/defineblock */ + +/*! + @enum USB Device Billboard Capability bmConfigured constants + @ A bit pair signifying the state of Alternate Modes + */ +enum +{ + kUSBBillboardUnspecifiedError = 0, + kUSBBillboardConfigNotAttempted = 1, + kUSBBillboardConfigUnsuccessful = 2, + kUSBBillboardAltModeConfigSuccess = 3 +}; + +/*! + @enum USB Device Billboard Capability AdditionalFailureInfo constants + @ A bit field signifying additional failure information + */ +enum +{ + kUSBBillboardAdditinalInfoNoPower = 1, + kUSBBillboardAdditinalInfoNoUSBPD = 2 +}; + +/*! + @defineblock USB Descriptor and IORegistry constants + @discussion Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields + + @define kUSBDeviceClass The field in the USB Device Descriptor corresponding to the device class + @define kUSBDeviceSubClass The field in the USB Device Descriptor corresponding to the device sub class + @define kUSBDeviceProtocol The field in the USB Device Descriptor corresponding to the device protocol + @define kUSBDeviceMaxPacketSize The field in the USB Device Descriptor corresponding to the maximum packet size for endpoint 0 + @define kUSBVendorID The field in the USB Device Descriptor corresponding to the device USB Vendor ID + @define kUSBVendorName Deprecated. Use kUSBVendorID + @define kUSBProductID The field in the USB Device Descriptor corresponding to the device USB Product ID + @define kUSBProductName Deprecated. Use kUSBProductID + @define kUSBDeviceReleaseNumber The field in the USB Device Descriptor corresponding to the device release version + @define kUSBManufacturerStringIndex The field in the USB Device Descriptor corresponding to the index for the manufacturer's string + @define kUSBProductStringIndex The field in the USB Device Descriptor corresponding to the index for the product name's string + @define kUSBSerialNumberStringIndex The field in the USB Device Descriptor corresponding to the index for the serial number's string + @define kUSBDeviceNumConfigs The field in the USB Configuration Descriptor corresponding to the number of configurations + @define kUSBInterfaceNumber The field in the USB Configuration Descriptor corresponding to the number of configurations + @define kUSBAlternateSetting The field in the USB Configuration Descriptor corresponding to the number of configurations + @define kUSBNumEndpoints The field in the USB Configuration Descriptor corresponding to the number of configurations + @define kUSBInterfaceClass The field in the USB Interface Descriptor corresponding to the interface class + @define kUSBInterfaceSubClass The field in the USB Interface Descriptor corresponding to the interface sub class + @define kUSBInterfaceProtocol The field in the USB Interface Descriptor corresponding to the interface protocol + @define kUSBInterfaceStringIndex The field in the USB Interface Descriptor corresponding to the index for the interface name's string + @define kUSBConfigurationValue The field in the USB Interface Descriptor corresponding to the configuration + @define kUSBProductString IORegistry key for the device's USB Product string + @define kUSBVendorString IORegistry key for the device's USB manufacturer string + @define kUSBSerialNumberString IORegistry key for the device's USB serial number string + @define kUSB1284DeviceID IORegistry key for the 1284 Device ID of a printer + + */ +#define kUSBDeviceClass kUSBHostMatchingPropertyDeviceClass +#define kUSBDeviceSubClass kUSBHostMatchingPropertyDeviceSubClass +#define kUSBDeviceProtocol kUSBHostMatchingPropertyDeviceProtocol +#define kUSBDeviceMaxPacketSize kUSBHostDevicePropertyMaxPacketSize +#define kUSBVendorID kUSBHostMatchingPropertyVendorID +#define kUSBVendorName kUSBVendorID // bad name - keep for backward compatibility +#define kUSBProductID kUSBHostMatchingPropertyProductID +#define kUSBProductName kUSBProductID // bad name - keep for backward compatibility +#define kUSBDeviceReleaseNumber kUSBHostMatchingPropertyDeviceReleaseNumber +#define kUSBManufacturerStringIndex kUSBHostDevicePropertyManufacturerStringIndex +#define kUSBProductStringIndex kUSBHostDevicePropertyProductStringIndex +#define kUSBSerialNumberStringIndex kUSBHostDevicePropertySerialNumberStringIndex +#define kUSBDeviceNumConfigs kUSBHostDevicePropertyNumConfigs +#define kUSBInterfaceNumber kUSBHostMatchingPropertyInterfaceNumber +#define kUSBAlternateSetting kUSBHostInterfacePropertyAlternateSetting +#define kUSBNumEndpoints kUSBHostInterfacePropertyNumEndpoints +#define kUSBInterfaceClass kUSBHostMatchingPropertyInterfaceClass +#define kUSBInterfaceSubClass kUSBHostMatchingPropertyInterfaceSubClass +#define kUSBInterfaceProtocol kUSBHostMatchingPropertyInterfaceProtocol +#define kUSBInterfaceStringIndex kUSBHostInterfacePropertyStringIndex +#define kUSBConfigurationValue kUSBHostMatchingPropertyConfigurationValue +#define kUSBInterfaceString kUSBHostInterfacePropertyString +#define kUSB1284DeviceID "1284 Device ID" + +#define kUSBCompatibilityMatch "USBCompatibilityMatch" +#define kUSBStandardVersion kUSBHostDevicePropertyStandardVersion +#define kUSBSpecReleaseNumber kUSBStandardVersion +#define kUSBDeviceContainerID kUSBContainerID +#define kUSBContainerID kUSBHostDevicePropertyContainerID + +#if !__OPEN_SOURCE__ && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST +#define kUSBProductString kUSBHostDevicePropertyProductString +#define kUSBVendorString kUSBHostDevicePropertyVendorString +#define kUSBSerialNumberString kUSBHostDevicePropertySerialNumberString +#else +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_14 +#define kUSBProductString "USB Product Name" +#define kUSBVendorString "USB Vendor Name" +#define kUSBSerialNumberString "USB Serial Number" +#else +#define kUSBProductString kUSBHostDevicePropertyProductString +#define kUSBVendorString kUSBHostDevicePropertyVendorString +#define kUSBSerialNumberString kUSBHostDevicePropertySerialNumberString +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_14 */ +#endif + +/*! + @enum Apple USB Vendor ID + @discussion Apple's vendor ID, assigned by the USB-IF + */ +enum +{ + kAppleVendorID = kIOUSBAppleVendorID +}; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/QualcommWireless/include/IOKit/video/IOVideoControlDictionary.h b/QualcommWireless/include/IOKit/video/IOVideoControlDictionary.h new file mode 100644 index 0000000..3ae44fd --- /dev/null +++ b/QualcommWireless/include/IOKit/video/IOVideoControlDictionary.h @@ -0,0 +1,74 @@ +/* + File: IOVideoControlDictionary.h + + Contains: + + Copyright: © 2006-2012 by Apple Inc., all rights reserved. +*/ + +#if !defined(__IOVideoControlDictionary_h__) +#define __IOVideoControlDictionary_h__ + +// System Includes +#include <IOKit/video/IOVideoTypes.h> + +class OSArray; +class OSDictionary; +class OSString; + +class IOVideoControlDictionary +{ +// Construction/Destruction +public: + static OSDictionary* create(UInt32 controlID, UInt32 baseClass, UInt32 derivedClass, UInt32 scope, UInt32 element, bool isReadOnly = false, UInt32 variant = 0, OSString* name = NULL); + static OSDictionary* createBooleanControl(UInt32 controlID, UInt32 baseClass, UInt32 derivedClass, UInt32 scope, UInt32 element, bool value, bool isReadOnly = false, UInt32 variant = 0, OSString* name = NULL); + static OSDictionary* createSelectorControl(UInt32 controlID, UInt32 baseClass, UInt32 derivedClass, UInt32 scope, UInt32 element, UInt32 value, OSArray* selectorMap, bool isReadOnly = false, UInt32 variant = 0, OSString* name = NULL); + +// General Attributes +public: + static OSDictionary* getControlByID(OSArray* controlList, UInt32 controlID); + + static UInt32 getControlID(const OSDictionary* dictionary); + static void setControlID(OSDictionary* dictionary, UInt32 controlID); + + static UInt32 getBaseClass(const OSDictionary* dictionary); + static void setBaseClass(OSDictionary* dictionary, UInt32 baseClass); + + static UInt32 getClass(const OSDictionary* dictionary); + static void setClass(OSDictionary* dictionary, UInt32 derivedClass); + + static UInt32 getScope(const OSDictionary* dictionary); + static void setScope(OSDictionary* dictionary, UInt32 scope); + + static UInt32 getElement(const OSDictionary* dictionary); + static void setElement(OSDictionary* dictionary, UInt32 element); + + static bool isReadOnly(const OSDictionary* dictionary); + static void setIsReadOnly(OSDictionary* dictionary, bool isReadOnly); + + static UInt32 getVariant(const OSDictionary* dictionary); + static void setVariant(OSDictionary* dictionary, UInt32 variant); + + static OSString* copyName(const OSDictionary* dictionary); + static void setName(OSDictionary* dictionary, const OSString* name); + +// Boolean Control Attributes +public: + static bool getBooleanControlValue(const OSDictionary* dictionary); + static void setBooleanControlValue(OSDictionary* dictionary, bool value); + +// Selector Control Attributes +public: + static UInt32 getSelectorControlValue(const OSDictionary* dictionary); + static void setSelectorControlValue(OSDictionary* dictionary, UInt32 value); + + static OSArray* copySelectorControlSelectorMap(const OSDictionary* dictionary); + static void setSelectorControlSelectorMap(OSDictionary* dictionary, const OSArray* selectorMap); + +// Selector Control Selector Map Item Support +public: + static OSDictionary* createSelectorControlSelectorMapItem(UInt32 value, const OSString* name); + static OSDictionary* createSelectorControlSelectorMapItem(UInt32 value, const OSString* name, UInt32 kind); +}; + +#endif diff --git a/QualcommWireless/include/IOKit/video/IOVideoDevice.h b/QualcommWireless/include/IOKit/video/IOVideoDevice.h new file mode 100644 index 0000000..a32b5b7 --- /dev/null +++ b/QualcommWireless/include/IOKit/video/IOVideoDevice.h @@ -0,0 +1,154 @@ +/* + File: IOVideoDevice.h + + Contains: + + Copyright: © 2006-2013 by Apple Inc., all rights reserved. +*/ + +#if !defined(__IOKIT_IOVIDEODEVICE_H) +#define __IOKIT_IOVIDEODEVICE_H + +#include <IOKit/IOService.h> +#include <IOKit/video/IOVideoTypes.h> +#include <IOKit/stream/IOStreamShared.h> + +class IOVideoStream; + +/*! + @class IOVideoDevice + @abstract A class representing a video device. + @discussion The IOVideoDevice class defines a mechanism for accessing the IOVideoStreams that a device presents. + + Although it is expected that the client of an IOVideoDevice will be in user space, this is not required. + + */ +class IOVideoDevice : public IOService +{ +// Construction/Destruction + OSDeclareDefaultStructors(IOVideoDevice); +public: + virtual bool init(OSDictionary* properties); + virtual void free(void); + +/*! + @function newUserClient + @abstract See the documentation for the IOService method newUserClient. +*/ + virtual IOReturn newUserClient(task_t owningTask, void* securityID, UInt32 type, OSDictionary* properties, IOUserClient** handler); + +/*! + @function getStreamCount + @result Returns the number of streams of the device. +*/ + virtual int getStreamCount(void); + +/*! + @function getStream + @param streamIndex + The index for which the underlying stream is desired. + @result Returns the number of streams of the device. +*/ + virtual IOVideoStream* getStream(UInt32 streamIndex); + +/*! + @function startStream + @abstract Start sending data on a stream. + @result Returns kIOReturnSuccess if the stream was successfully started. + @discussion This must be implemented by a subclass. +*/ + virtual IOReturn startStream(IOVideoStream* stream); + +/*! + @function stopStream + @abstract Stop sending data on a stream. + @result Returns kIOReturnSuccess if the stream was successfully started. + @discussion This must be implemented by a subclass. +*/ + virtual IOReturn stopStream(IOVideoStream* stream); + +/*! + @function suspendStream + @abstract Temporarily suspend data flow on the stream. + @result Returns kIOReturnSuccess if the stream was successfully suspended. + @discussion This must be implemented by a subclass. +*/ + virtual IOReturn suspendStream(IOVideoStream* stream); + +/*! + @function setStreamMode + @abstract Sets the mode of the stream, either input or output. + @discussion This must be implemented by a subclass. +*/ + virtual IOReturn setStreamMode(IOVideoStream* stream, IOStreamMode mode); + virtual IOReturn openStream(UInt32 streamIndex); + virtual IOReturn closeStream(UInt32 streamIndex); + virtual IOReturn startStream(UInt32 streamIndex); + virtual IOReturn stopStream(UInt32 streamIndex); + virtual IOReturn suspendStream(UInt32 streamIndex); + + + virtual IOReturn releaseStreams(void); + virtual void inputCallback(UInt32 token); + virtual void inputSyncCallback(UInt32 token); + + virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 type, UInt32 clientData); + + virtual void sendSingleNotification(UInt32 notificationID, UInt32 objectID, UInt32 notificationArgument1, UInt32 notificationArgument2, UInt64 notificationArgument3, UInt64 notificationArgument4); + virtual void sendMultiNotification(UInt32 numberNotifications, const IOVideoDeviceNotification* notifications); + + virtual IOReturn setStreamFormat(UInt32 streamID, const IOVideoStreamDescription* newStreamFormat); + +// Control methods + virtual IOReturn setControlValue(UInt32 controlID, UInt32 value, UInt32* newValue); + +protected: + virtual IOReturn addStream(IOVideoStream* stream); + virtual IOReturn removeStream(UInt32 streamIndex); + + OSArray* mStreams; + IOVideoDeviceNotificationMessage* mNotificationMessage; + UInt32 mMaxNumberNotifications; + UInt32 mOutstandingConfigChangeRequests; + +// Future Expansion +public: + OSMetaClassDeclareReservedUnused(IOVideoDevice, 0); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 1); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 2); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 3); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 4); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 5); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 6); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 7); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 8); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 9); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 10); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 11); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 12); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 13); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 14); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 15); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 16); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 17); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 18); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 19); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 20); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 21); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 22); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 23); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 24); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 25); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 26); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 27); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 28); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 29); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 30); + OSMetaClassDeclareReservedUnused(IOVideoDevice, 31); + +protected: + struct ExpansionData {}; + ExpansionData *mReserved; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/video/IOVideoDeviceClientInit.h b/QualcommWireless/include/IOKit/video/IOVideoDeviceClientInit.h new file mode 100644 index 0000000..0ab901f --- /dev/null +++ b/QualcommWireless/include/IOKit/video/IOVideoDeviceClientInit.h @@ -0,0 +1,26 @@ +/* + File: IOVideoDeviceClientInit.h + + Contains: This class is used to add an IOProviderMergeProperties dictionary entry to a provider's property list, thus providing a tie between hardware and a CFBundle at hardware + load time. This property usually contains the user client class name and the CFPlugInTypes UUID's but it can contain other properties. + + + Copyright: © 2006-2012 by Apple Inc., all rights reserved. +*/ + +#ifndef __IOVIDEODEVICECLIENTINIT_H +#define __IOVIDEODEVICECLIENTINIT_H + +#include <IOKit/IOService.h> + +class IOVideoDeviceUserClientInit : public IOService +{ + OSDeclareDefaultStructors(IOVideoDeviceUserClientInit); + +public: + virtual bool start(IOService* provider) ; + virtual bool MergeDictionaryIntoProvider(IOService* provider, OSDictionary* mergeDicttionary); + virtual bool MergeDictionaryIntoDictionary(OSDictionary* sourceDictionary, OSDictionary* targetDictionary); +}; + +#endif diff --git a/QualcommWireless/include/IOKit/video/IOVideoDeviceLib.h b/QualcommWireless/include/IOKit/video/IOVideoDeviceLib.h new file mode 100644 index 0000000..1f04ef8 --- /dev/null +++ b/QualcommWireless/include/IOKit/video/IOVideoDeviceLib.h @@ -0,0 +1,213 @@ +/* + File: IOVideoDeviceLib.h + + Contains: IOCFPlugin library for using IOVideoDevice objects. + The IOVideoDevice plugin provides a convenient set of functions for accessing and manipulating IOVideoDevice objects from user programs. + + Copyright: © 2006-2012 by Apple Inc., all rights reserved. +*/ + +#if !defined(__IOKIT_IOVIDEODEVICELIB_H) +#define __IOKIT_IOVIDEODEVICELIB_H + +#include <CoreFoundation/CoreFoundation.h> +#include <IOKit/IOKitLib.h> +#include <IOKit/IOCFPlugIn.h> +#include <IOKit/stream/IOStreamLib.h> +#include <IOKit/stream/IOStreamShared.h> +#include <IOKit/video/IOVideoDeviceShared.h> +#include <IOKit/video/IOVideoTypes.h> + +__BEGIN_DECLS + +#pragma mark IOVideo UUIDs + +/*! + @defined kIOVideoDeviceLibTypeID + @discussion This is the UUID of the plug-in type (5339633C-F903-4212-9C90-9B18AF01862D). +*/ +#define kIOVideoDeviceLibTypeID CFUUIDGetConstantUUIDWithBytes(kCFAllocatorDefault, 0x53, 0x39, 0x63, 0x3C, 0xF9, 0x03, 0x42, 0x12, 0x9C, 0x90, 0x9B, 0x18, 0xAF, 0x01, 0x86, 0x2D) + +/*! + @defined kIOVideoDeviceInterfaceID_v1 + @discussion This is the UUID of version 1 of the plug-in interface (080E3-5106-4D16-B70C-B3216F13CDB9A). +*/ +#define kIOVideoDeviceInterfaceID_v1 CFUUIDGetConstantUUIDWithBytes(kCFAllocatorDefault, 0x0D, 0xE0, 0x80, 0xE3, 0x51, 0x06, 0x4D, 0x16, 0xB7, 0x0C, 0xB3, 0x21, 0x6F, 0x13, 0xCD, 0xB9) +#define kIOVideoDeviceInterfaceID kIOVideoDeviceInterfaceID_v1 + +typedef struct IOVideoDeviceInterface_v1_t IOVideoDeviceInterface_v1_t; + +/*! + @typedef IOVideoDeviceRef +*/ +typedef IOVideoDeviceInterface_v1_t** IOVideoDeviceRef; + +/*! + @typedef IOVideoDeviceOutputCallback +*/ +typedef void (*IOVideoDeviceOutputCallback)( IOVideoDeviceRef stream, + void* context); + +/*! + @typedef IOVideoDeviceNotificationCallback +*/ +typedef void (*IOVideoDeviceNotificationCallback)( IOVideoDeviceRef device, + void* context, + void* message); + +/*! + @interface IOVideoDeviceInterface + @abstract Interface for accessing kernel-space video drivers from user space. + */ +typedef struct IOVideoDeviceInterface_v1_t +{ + IUNKNOWN_C_GUTS; + UInt32 Version; + UInt32 Revision; + + /*! + @functiongroup Opening and closing VideoDevices + */ + + /*! + @function Open + @abstract Open an IOVideoDevice from user space. + @discussion The Open function opens the device. + @param device + The IOVideoDeviceRef to the device returned by QueryInterface. + @param options + Open options. Currently unused. + @result If the device could not be opened an error will be returned. + */ + IOReturn + (*Open)(IOVideoDeviceRef device, IOOptionBits options); + + /*! + @function Close + @abstract Closes an IOVideoDevice. + @discussion Calling Close frees all streams belonging to the device and frees all user resources used by the device. + @param device + The IOVideoDeviceRef of the device to close. + @result Returns kIOReturnSuccess if the device was successfully closed. + */ + IOReturn + (*Close)(IOVideoDeviceRef device); + + /*! + @function GetNotificationPort + @abstract Get the notification port for device state changes sent to user space. + @param device + The IOVideoDeviceRef of the stream to operate on. + @result A CFMachPortRef of the output notification port. + */ + CFMachPortRef + (*GetNotificationPort)(IOVideoDeviceRef device); + + /*! + @function SetNotificationCallback + @abstract Set the callback function to be called when certain device state changes happen. + @param device + The IOVideoDeviceRef of the device to operate on. Pass NULL to remove the callback. + @result Returns kIOReturnSuccess if the callback was successfully set or removed. + */ + IOReturn + (*SetNotificationCallback)( IOVideoDeviceRef device, + IOVideoDeviceNotificationCallback callback, + void* context); + + /*! + @function SetControlValue + @param device + @param controlID + @param newValue + @result Returns kIOReturnSuccess if the call was successfully. + */ + IOReturn + (*SetControlValue)( IOVideoDeviceRef device, + UInt32 controlID, + UInt32 value, + UInt32* newValue); + + /*! + @function SetStreamFormat + @param device + @param streamID + @param streamFormat + @result Returns kIOReturnSuccess if the call was successfully. + */ + IOReturn + (*SetStreamFormat)( IOVideoDeviceRef device, + UInt32 streamID, + IOVideoStreamDescription* streamFormat); + + /*! + @function GetRunLoopSource + @abstract Gets a CFRunLoopSource for the CFMachPort used for notifications from the kernel that data is ready. + @param device + The IOVideoDeviceRef of the stream to operate on. + @result The CFRunLoopSourceRef for the run loop source, or NULL if there was an error creating the source. + */ + CFRunLoopSourceRef + (*GetRunLoopSource)(IOVideoDeviceRef device); + + /*! + @function AddToRunLoop + @abstract Add the CFRunLoopSource for the notification port to a run loop. + @param device + The IOVideoDeviceRef of the device to operate on. + @param runLoop + The run loop to which to add the notification source. + @result Returns kIOReturnSuccess if the source was successfully added to the run loop. + */ + + IOReturn + (*AddToRunLoop)( IOVideoDeviceRef device, + CFRunLoopRef runLoop); + + /*! + @function RemoveFromRunLoop + @abstract Remove the CFRunLoopSource for the notification port from a run loop. + @param device + The IOVideoDeviceRef of the device to operate on. + @param runLoop + The run loop from which to remove the notification source. + @result Returns kIOReturnSuccess if the source was successfully removed from the run loop. + */ + IOReturn + (*RemoveFromRunLoop)( IOVideoDeviceRef device, + CFRunLoopRef runLoop); + + /*! + @function CreateStreamInterface + @param device + The IOVideoDeviceRef of the device to operate on. + @param streamDictionary + @param streamIndex + @param isInput + @result Returns kIOReturnSuccess if the stream was successfully created. + */ + IOReturn + (*CreateStreamInterface)( IOVideoDeviceRef device, + CFDictionaryRef streamDictionary, + UInt32 streamIndex, + bool isInput, + IOStreamRef* streamRef); + + /*! + @function ReleaseStreamInterface + @param device + The IOVideoDeviceRef of the device to operate on. + @param isInput + @param streamRef + @result Returns kIOReturnSuccess if the stream was successfully released. + */ + IOReturn + (*ReleaseStreamInterface)( IOVideoDeviceRef device, + bool isInput, + IOStreamRef* streamRef); +} IOVideoDeviceInterface; + + +__END_DECLS + +#endif diff --git a/QualcommWireless/include/IOKit/video/IOVideoDeviceShared.h b/QualcommWireless/include/IOKit/video/IOVideoDeviceShared.h new file mode 100644 index 0000000..12a485e --- /dev/null +++ b/QualcommWireless/include/IOKit/video/IOVideoDeviceShared.h @@ -0,0 +1,39 @@ +/* + File: IOVideoDeviceShared.h + + Contains: + + Copyright: © 2006-2012 by Apple Inc., all rights reserved. +*/ + +#if !defined(__IOKIT_IOVIDEODEVICESHARED_H) +#define __IOKIT_IOVIDEODEVICESHARED_H + +#include <sys/cdefs.h> +#include <IOKit/IOTypes.h> + +/*! + @header IOVideoDeviceShared.h + IOVideoDevice definitions shared between kernel and user space. + */ + +__BEGIN_DECLS + +/*! + @enum Mach port types + @constant kIOVideoDevicePortTypeNotification + @constant kIOVideoDevicePortTypeOutput + @constant kIOVideoDevicePortTypeInput + @abstract Port types used with IOConnectSetNotificationPort(). + */ +enum +{ + kIOVideoDevicePortTypeNotification, + kIOVideoDevicePortTypeOutput, + kIOVideoDevicePortTypeInput +}; + +__END_DECLS + +#endif /* ! __IOKIT_IOVIDEODEVICESHARED_H */ + diff --git a/QualcommWireless/include/IOKit/video/IOVideoDeviceUserClient.h b/QualcommWireless/include/IOKit/video/IOVideoDeviceUserClient.h new file mode 100644 index 0000000..bd55ff1 --- /dev/null +++ b/QualcommWireless/include/IOKit/video/IOVideoDeviceUserClient.h @@ -0,0 +1,109 @@ +/* + File: IOVideoDeviceUserClient.h + + Contains: + + Copyright: © 2006-2012 by Apple Inc., all rights reserved. +*/ + +#if !defined(__IOKIT_IOVIDEODEVICEUSERCLIENT_H) +#define __IOKIT_IOVIDEODEVICEUSERCLIENT_H + +/*! + @enum User client methods + @constant kIOVideoDeviceMethodOpen + @constant kIOVideoDeviceMethodClose + @constant kIOVideoDeviceMethodGetMode + @constant kIOVideoDeviceMethodSetControlValue + @constant kIOVideoDeviceMethodOpenStream + @constant kIOVideoDeviceMethodCloseStream + @constant kIOVideoDeviceMethodSetStreamFormat + @constant kIOVideoDeviceMethodStartStream + @constant kIOVideoDeviceMethodStopStream + @constant kIOVideoDeviceMethodSuspendStream + + @abstract Client method numbers used with IOConnectMethod...() functions. + */ +enum +{ + kIOVideoDeviceMethodOpen = 0, + kIOVideoDeviceMethodClose, + kIOVideoDeviceMethodGetMode, + kIOVideoDeviceMethodSetMode, + kIOVideoDeviceMethodSetControlValue, + kIOVideoDeviceMethodOpenStream, + kIOVideoDeviceMethodCloseStream, + kIOVideoDeviceMethodSetStreamFormat, + kIOVideoDeviceMethodStartStream, + kIOVideoDeviceMethodStopStream, + kIOVideoDeviceMethodSuspendStream, + + kIOVideoDeviceMethodCount +}; + +#ifdef KERNEL +#ifdef __cplusplus + +#include <IOKit/IOUserClient.h> +#include <IOKit/stream/IOStreamShared.h> +#include <IOKit/video/IOVideoTypes.h> + +class IOVideoDevice; + +class IOVideoDeviceUserClient : public IOUserClient +{ +// Construction/Destruction + OSDeclareDefaultStructors(IOVideoDeviceUserClient) + +// Static versions of external methods +private: + static IOReturn sOpen(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments); + static IOReturn sClose(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments); + static IOReturn sGetMode(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments); + static IOReturn sSetMode(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments); + static IOReturn sSetControlValue(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments); + static IOReturn sOpenStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments); + static IOReturn sCloseStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments); + static IOReturn sSetStreamFormat(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments); + static IOReturn sStartStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments); + static IOReturn sStopStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments); + static IOReturn sSuspendStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments); + +protected: + const IOExternalMethodDispatch* mExternalMethods; + IOVideoDevice* mDevice; + task_t mTask; + +// IOUserClient overriden methods +public: + virtual bool initWithTask(task_t owningTask, void* securityToken, UInt32 type); + virtual bool initWithTask(task_t owningTask, void* securityToken, UInt32 type, OSDictionary* properties); + virtual IOReturn clientClose(void); + virtual IOReturn clientDied(void); + virtual IOService* getService(void); + virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 portType, UInt32 refCon); + virtual IOReturn connectClient(IOUserClient* client); + virtual IOReturn externalMethod(uint32_t selector, IOExternalMethodArguments* arguments, IOExternalMethodDispatch* dispatch, OSObject* target, void* reference); + +// IOService overriden methods + virtual bool start(IOService* provider); + +// external methods +public: + virtual IOReturn open(IOOptionBits options); + virtual IOReturn close(void); + virtual IOReturn getMode(UInt32 streamIndex, IOStreamMode* mode); + virtual IOReturn setMode(UInt32 streamIndex, IOStreamMode mode); + virtual IOReturn setControlValue(UInt32 controlID, UInt32 value, UInt32* newValue); + virtual IOReturn setStreamFormat(UInt32 streamID, const IOVideoStreamDescription* newStreamFormat); + virtual IOReturn openStream(UInt32 streamIndex); + virtual IOReturn closeStream(UInt32 streamIndex); + virtual IOReturn startStream(UInt32 streamIndex); + virtual IOReturn stopStream(UInt32 streamIndex); + virtual IOReturn suspendStream(UInt32 streamIndex); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ + +#endif diff --git a/QualcommWireless/include/IOKit/video/IOVideoStream.h b/QualcommWireless/include/IOKit/video/IOVideoStream.h new file mode 100644 index 0000000..054c37e --- /dev/null +++ b/QualcommWireless/include/IOKit/video/IOVideoStream.h @@ -0,0 +1,140 @@ +/* + File: IOVideoStream.h + + Contains: + + Copyright: © 2006-2012 by Apple Inc., all rights reserved. +*/ + +#ifndef __IOKIT_IOVIDEOSTREAM_H +#define __IOKIT_IOVIDEOSTREAM_H + +#include <IOKit/stream/IOStream.h> + +class IOVideoDevice; + +/*! + @class IOVideoStream + @abstract A class representing a stream of video data buffers passed from kernel to user space and back again. + @discussion The IOVideoStream class defines a mechanism for moving buffers of data from kernel space to user space or vice-versa. The policy for which direction the data flows and the + nature of the data is left up the the implementer of the driver which uses IOStream. + + Although it is expected that the client of an IOVideoStream will be in user space, this is not required. + + References to "output" mean "from the IOVideoStream to the user client", and "input" means "from the user client to the IOVideoStream." + + */ +class IOVideoStream : public IOStream +{ +// Construction/Destruction + OSDeclareDefaultStructors(IOVideoStream); + +protected: + IOStreamMode mStreamMode; + +public: + +/*! + @function withBuffers + @param buffers + An array of IOStreamBuffer objects which will be the buffers for this stream. + @param mode + The initial mode of the video stream, either output, input, or input/output. + @param queueLength + The nuber of queue entries to reserve in the input and output queue. Zero means to make the queues big enough to accommodate all the buffers at once. + @param properties + A dictionary of properties which will be set on the video stream. +*/ + static IOVideoStream* withBuffers(OSArray* buffers, IOStreamMode mode = kIOStreamModeOutput, IOItemCount queueLength = 0, OSDictionary* properties = 0); + + +/*! + @function initWithBuffers + @param buffers + An array of IOStreamBuffer objects which will be the buffers for this stream. + @param mode + The initial mode of the video stream, either output, input, or input/output. + @param queueLength + The nuber of queue entries to reserve in the input and output queue. Zero means to make the queues big enough to accommodate all the buffers at once. + @param properties + A dictionary of properties which will be set on the video stream. +*/ + virtual bool initWithBuffers(OSArray* buffers, IOStreamMode mode = kIOStreamModeOutput, IOItemCount queueLength = 0, OSDictionary* properties = 0); + + virtual IOVideoDevice* getDevice(void); // Returns provider cast to an IOVideoDevice + +/*! + @function getStreamMode + @abstract Returns the mode of the stream, either input or output. + @result The mode of the stream, either kIOStreamModeInput (from user space to kernel space) or the default kIOStreamModeOutput (from kernel space to user space). +*/ + virtual IOStreamMode getStreamMode(void); + +/*! + @function setStreamMode + @abstract Sets the mode of the stream, either input or output. +*/ + virtual IOReturn setStreamMode(IOStreamMode mode); + +/*! + @function startStream + @abstract Start sending data on a stream. + @result Returns kIOReturnSuccess if the stream was successfully started. +*/ + virtual IOReturn startStream(void); + +/*! + @function stopStream + @abstract Stop sending data on a stream. + @result Returns kIOReturnSuccess if the stream was successfully started. +*/ + virtual IOReturn stopStream(void); + +/*! + @function suspendStream + @abstract Temporarily suspend data flow on the stream. + @result Returns kIOReturnSuccess if the stream was successfully suspended. +*/ + virtual IOReturn suspendStream(void); + +// Future Expansion +public: + OSMetaClassDeclareReservedUnused(IOVideoStream, 0); + OSMetaClassDeclareReservedUnused(IOVideoStream, 1); + OSMetaClassDeclareReservedUnused(IOVideoStream, 2); + OSMetaClassDeclareReservedUnused(IOVideoStream, 3); + OSMetaClassDeclareReservedUnused(IOVideoStream, 4); + OSMetaClassDeclareReservedUnused(IOVideoStream, 5); + OSMetaClassDeclareReservedUnused(IOVideoStream, 6); + OSMetaClassDeclareReservedUnused(IOVideoStream, 7); + OSMetaClassDeclareReservedUnused(IOVideoStream, 8); + OSMetaClassDeclareReservedUnused(IOVideoStream, 9); + OSMetaClassDeclareReservedUnused(IOVideoStream, 10); + OSMetaClassDeclareReservedUnused(IOVideoStream, 11); + OSMetaClassDeclareReservedUnused(IOVideoStream, 12); + OSMetaClassDeclareReservedUnused(IOVideoStream, 13); + OSMetaClassDeclareReservedUnused(IOVideoStream, 14); + OSMetaClassDeclareReservedUnused(IOVideoStream, 15); + OSMetaClassDeclareReservedUnused(IOVideoStream, 16); + OSMetaClassDeclareReservedUnused(IOVideoStream, 17); + OSMetaClassDeclareReservedUnused(IOVideoStream, 18); + OSMetaClassDeclareReservedUnused(IOVideoStream, 19); + OSMetaClassDeclareReservedUnused(IOVideoStream, 20); + OSMetaClassDeclareReservedUnused(IOVideoStream, 21); + OSMetaClassDeclareReservedUnused(IOVideoStream, 22); + OSMetaClassDeclareReservedUnused(IOVideoStream, 23); + OSMetaClassDeclareReservedUnused(IOVideoStream, 24); + OSMetaClassDeclareReservedUnused(IOVideoStream, 25); + OSMetaClassDeclareReservedUnused(IOVideoStream, 26); + OSMetaClassDeclareReservedUnused(IOVideoStream, 27); + OSMetaClassDeclareReservedUnused(IOVideoStream, 28); + OSMetaClassDeclareReservedUnused(IOVideoStream, 29); + OSMetaClassDeclareReservedUnused(IOVideoStream, 30); + OSMetaClassDeclareReservedUnused(IOVideoStream, 31); + +protected: + struct ExpansionData {}; + ExpansionData *mReserved; +}; + +#endif diff --git a/QualcommWireless/include/IOKit/video/IOVideoStreamDictionary.h b/QualcommWireless/include/IOKit/video/IOVideoStreamDictionary.h new file mode 100644 index 0000000..e488716 --- /dev/null +++ b/QualcommWireless/include/IOKit/video/IOVideoStreamDictionary.h @@ -0,0 +1,47 @@ +/* + File: IOVideoStreamDictionary.h + + Contains: + + Copyright: © 2006-2012 by Apple Inc., all rights reserved. +*/ + +#if !defined(__IOVideoStreamDictionary_h__) +#define __IOVideoStreamDictionary_h__ + +// System Includes +#include <IOKit/video/IOVideoTypes.h> + +class OSArray; +class OSDictionary; + +class IOVideoStreamDictionary +{ + +// Construction/Destruction +public: + static OSDictionary* create(UInt32 streamID, UInt32 startingDeviceChannelNumber, const OSDictionary* currentFormat, OSArray* availableFormats = NULL); + +// Attributes +public: + static UInt32 getStreamID(const OSDictionary* dictionary); + static void setStreamID(OSDictionary* dictionary, UInt32 streamID); + + static UInt32 getStartingDeviceChannelNumber(const OSDictionary* dictionary); + static void setStartingDeviceChannelNumber(OSDictionary* dictionary, UInt32 startingDeviceChannelNumber); + + static IOOptionBits getBufferMappingOptions(const OSDictionary* dictionary); + static void setBufferMappingOptions(OSDictionary* dictionary, IOOptionBits bufferMappingOptions); + + static bool getCurrentFormat(const OSDictionary* dictionary, IOVideoStreamDescription& format); + static void setCurrentFormat(OSDictionary* dictionary, const IOVideoStreamDescription& format); + static OSDictionary* copyCurrentFormatDictionary(const OSDictionary* dictionary); + static void setCurrentFormatDictionary(OSDictionary* dictionary, const OSDictionary* format); + + static OSArray* copyAvailableFormats(const OSDictionary* dictionary); + static void setAvailableFormats(OSDictionary* dictionary, OSArray* availableFormats); + + static void printDictionary(const OSDictionary* dictionary); +}; + +#endif diff --git a/QualcommWireless/include/IOKit/video/IOVideoStreamFormatDictionary.h b/QualcommWireless/include/IOKit/video/IOVideoStreamFormatDictionary.h new file mode 100644 index 0000000..9485c50 --- /dev/null +++ b/QualcommWireless/include/IOKit/video/IOVideoStreamFormatDictionary.h @@ -0,0 +1,44 @@ +/* + File: IOVideoStreamFormat.h + + Contains: + + Copyright: © 2006-2012 by Apple Inc., all rights reserved. +*/ + +#if !defined(__IOVideoStreamFormat_h__) +#define __IOVideoStreamFormat_h__ + +// System Includes +#include <IOKit/video/IOVideoTypes.h> + +class OSDictionary; + +class IOVideoStreamFormatDictionary +{ +public: + static OSDictionary* create(UInt32 codecType, UInt32 codecFlags, UInt32 width, UInt32 height); + static OSDictionary* createWithDescription(const IOVideoStreamDescription& format); + +// Attributes +public: + static UInt32 getCodecType(const OSDictionary* dictionary); + static void setCodecType(OSDictionary* dictionary, UInt32 codecType); + + static UInt32 getCodecFlags(const OSDictionary* dictionary); + static void setCodecFlags(OSDictionary* dictionary, UInt32 codecFlags); + + static UInt32 getWidth(const OSDictionary* dictionary); + static void setWidth(OSDictionary* dictionary, UInt32 width); + + static UInt32 getHeight(const OSDictionary* dictionary); + static void setHeight(OSDictionary* dictionary, UInt32 height); + + static void getDescription(const OSDictionary* dictionary, IOVideoStreamDescription& format); + static void printDescription(const IOVideoStreamDescription& format); + static void printDictionary(const OSDictionary* dictionary); + + static bool isSameSampleFormat(const IOVideoStreamDescription& format1, const IOVideoStreamDescription& format2); +}; + +#endif diff --git a/QualcommWireless/include/IOKit/video/IOVideoTypes.h b/QualcommWireless/include/IOKit/video/IOVideoTypes.h new file mode 100644 index 0000000..5435812 --- /dev/null +++ b/QualcommWireless/include/IOKit/video/IOVideoTypes.h @@ -0,0 +1,321 @@ +/* + File: IOVideoTypes.h + + Contains: + + Copyright: © 2006-2014 by Apple Inc., all rights reserved. +*/ + +#if !defined(__IOVideoTypes_h__) +#define __IOVideoTypes_h__ + +// System Includes +#include <IOKit/IOTypes.h> +#include <mach/message.h> + +#if defined(__cplusplus) +extern "C" +{ +#endif + +/*! + @struct IOVideoDeviceNotification + @abstract This structure contains an individual notification from the driver. + @field mObjectID + The ID of the object to which the notification pertains. + @field mNotificationID + A UInt32 that identifies the kind of the notification. + @field mNotificationArgument1 + A UInt32 whose usage depends on the the specific kind of notification. + @field mNotificationArgument2 + A UInt32 whose usage depends on the the specific kind of notification. + @field mNotificationArgument3 + A UInt64 whose usage depends on the the specific kind of notification. + @field mNotificationArgument4 + A UInt64 whose usage depends on the the specific kind of notification. +*/ +struct IOVideoDeviceNotification +{ + UInt32 mObjectID; + UInt32 mNotificationID; + UInt32 mNotificationArgument1; + UInt32 mNotificationArgument2; + UInt64 mNotificationArgument3; + UInt64 mNotificationArgument4; +}; +typedef struct IOVideoDeviceNotification IOVideoDeviceNotification; + +/*! + @struct IOVideoDeviceNotificationMessage + @abstract This structure describes a notification from the driver. Note that the message can contain multiple notifications. + @field mMessageHeader + The mach message header. + @field mClientData + The client data that was registered with the mach port. + @field mNumberNotifications + The number of IOVideoDeviceNotifications in the mNotifications array. + @field mNotifications + A variable length array of IOVideoDeviceNotification structures that carry the actual notification data. The number of elements in this array is denoted by + mNumberNotifications, but can also be inferred from the message size in the mach message header. +*/ +struct IOVideoDeviceNotificationMessage +{ + mach_msg_header_t mMessageHeader; + UInt32 mClientData; + UInt32 mNumberNotifications; + IOVideoDeviceNotification mNotifications[1]; +}; +typedef struct IOVideoDeviceNotificationMessage IOVideoDeviceNotificationMessage; + +#define CalculateIOVideoDeviceNotificationMessageSize(numberNotifications) (sizeof(IOVideoDeviceNotificationMessage) + (((numberNotifications) - 1) * sizeof(IOVideoDeviceNotification))) + +#pragma mark Notification IDs +/*! + @enum Notification IDs + @discussion + @abstract The four char codes used to identify the kind of the notification. + @discussion All device-level notifications will have an object ID of 0. + @constant kIOVideoDeviceNotificationID_ControlValueChanged + Indicates that the value of the control with the given ID has changed. The first argument is the new value. + @constant kIOVideoDeviceNotificationID_ControlRangeChanged + Indicates that the range of the control with the given ID has changed. +*/ +enum +{ + kIOVideoDeviceNotificationID_ControlValueChanged = 'cval', + kIOVideoDeviceNotificationID_ControlRangeChanged = 'crng' +}; + +struct IOVideoStreamDescription +{ + UInt32 mVideoCodecType; + UInt32 mVideoCodecFlags; + UInt32 mWidth; + UInt32 mHeight; + UInt32 mReserved1; + UInt32 mReserved2; +}; +typedef struct IOVideoStreamDescription IOVideoStreamDescription; + +//================================================================================================== +#pragma mark Control Constants + +/*! + @enum Control Constants + @discussion + @abstract Various constants related to controls. + @constant kIOVideoControlScopeGlobal + The scope for controls that apply to the device as a whole. + @constant kIOVideoControlScopeInput + The scope for controls that apply to the input section of the device. + @constant kIOVideoControlScopeOutput + The scope for controls that apply to the output section of the device. + @constant kIOVideoControlScopePlayThrough + The scope for controls that apply to the play through section of the device. + @constant kIOVideoControlElementMaster + The element value for controls that apply to the master element or to the entire scope. Note that other elements are numbered consecutively starting from 1. +*/ +enum +{ + kIOVideoControlScopeGlobal = 'glob', + kIOVideoControlScopeInput = 'inpt', + kIOVideoControlScopeOutput = 'outp', + kIOVideoControlScopePlayThrough = 'ptru', + kIOVideoControlElementMaster = 0 +}; + +/*! + @enum Control Base Class IDs + @discussion + @abstract The class IDs that identify the various control base classes. + @constant kIOVideoControlBaseClassIDBoolean + The class ID that identifies the boolean control class which is a subclass of the base control class. Boolean controls manipulate on/off switches in the hardware. + @constant kIOVideoControlBaseClassIDSelector + The class ID that identifies the selector control class which is a subclass of the base control class. Selector controls manipulate controls that have + multiple, but discreet values. + @constant kIOVideoControlBaseClassIDFeature + The class ID that identifies the feature control class which is a subclass of the base control class. Feature controls manipulate various features that might be + present on a device, such as hue, saturation, zoom, etc. +*/ +enum +{ + kIOVideoControlBaseClassIDBoolean = 'togl', + kIOVideoControlBaseClassIDSelector = 'slct', + kIOVideoControlBaseClassIDFeature = 'ftct' + +}; + +/*! + @enum IOVideoBooleanControl Subclass IDs + @discussion + @abstract The four char codes that identify the various standard subclasses of IOVideoBooleanControl. + @constant kIOVideoBooleanControlClassIDJack + A IOVideoBooleanControl where a true value means something is plugged into that element. + @constant kIOVideoBooleanControlClassIDDirection + A IOVideoBooleanControl where a true value means the element is operating in input mode, and false means the element is operating in output mode. + This control is only needed for devices which can do input and output, but not at the same time. +*/ +enum +{ + kIOVideoBooleanControlClassIDJack = 'jack', + kIOVideoBooleanControlClassIDDirection = 'dire' +}; + +/*! + @enum IOVideoSelectorControl Subclass IDs + @discussion + @abstract The four char codes that identify the various standard subclasses of IOVideoSelectorControl. + @constant kIOVideoSelectorControlClassIDDataSource + A IOVideoSelectorControl that identifies where the data for the element is coming from. + @constant kIOVideoSelectorControlClassIDDataDestination + A IOVideoSelectorControl that identifies where the data for the element is going. +*/ +enum +{ + kIOVideoSelectorControlClassIDDataSource = 'dsrc', + kIOVideoSelectorControlClassIDDataDestination = 'dest' +}; + +/*! + @enum IOVideoFeatureControl Subclass IDs + @discussion + @abstract The four char codes that identify the various standard subclasses of IOVideoFeatureControl. + @constant kIOVideoFeatureControlClassIDBlackLevel + A IOVideoFeatureControl that controls the black level offset. The units for the control's absolute value are percetage (%). + @constant kIOVideoFeatureControlClassIDWhiteLevel + A IOVideoFeatureControl that controls the white level offset. The units for the control's absolute value are percentage (%). + @constant kIOVideoFeatureControlClassIDHue + A IOVideoFeatureControl that controls the hue offset. Positive values mean counterclockwise, negative values means clockwise on a vector scope. The units for the + control's absolute value are degrees (°). + @constant kIOVideoFeatureControlClassIDSaturation + A IOVideoFeatureControl that controls color intensity. For example, at high saturation levels, red appears to be red; at low saturation, red appears as pink. The + unit for the control's absolute value is a percentage (%). + @constant kIOVideoFeatureControlClassIDContrast + A IOVideoFeatureControl that controls a the distance bewtween the whitest whites and blackest blacks. The units for the control's absolute value are percentage (%). + @constant kIOVideoFeatureControlClassIDSharpness + A IOVideoFeatureControl that controls the sharpness of the picture. The units for the control's absolute value are undefined. + @constant kIOVideoFeatureControlClassIDBrightness + A IOVideoFeatureControl that controls the intensity of the video level. The units for the control's absolute value are percetage (%). + @constant kIOVideoFeatureControlClassIDGain + A IOVideoFeatureControl that controls the amplification of the signal. The units for the control's absolute value are decibels (dB). + @constant kIOVideoFeatureControlClassIDIris + A IOVideoFeatureControl that controls a mechanical lens iris. The units for the control's absolute value are an F number (F). + @constant kIOVideoFeatureControlClassIDShutter + A IOVideoFeatureControl that controls the integration time of the incoming light. The units for the control's absolute value are seconds (s). + @constant kIOVideoFeatureControlClassIDExposure + A IOVideoFeatureControl that controls a the total amount of light accumulated. The units for the control's absolute value are exposure value (EV). + @constant kIOVideoFeatureControlClassIDWhiteBalanceU + A IOVideoFeatureControl that controls the adjustment of the white color of the picture. The units for the control's absolute value are kelvin (K). + @constant kIOVideoFeatureControlClassIDWhiteBalanceV + A IOVideoFeatureControl that controls a adjustment of the white color of the picture. The units for the control's absolute value are kelvin (K). + @constant kIOVideoFeatureControlClassIDGamma + A IOVideoFeatureControl that defines the function between incoming light level and output picture level. The units for the control's absolute value are undefined. + @constant kIOVideoFeatureControlClassIDTemperature + A IOVideoFeatureControl that controls the temperature inside of the device and/or controlling temperature. The units for the control's absolute value are undefined. + @constant kIOVideoFeatureControlClassIDZoom + A IOVideoFeatureControl that controls the zoom. The units for the control's absolute value are power where 1 is the wide end. + @constant kIOVideoFeatureControlClassIDFocus + A IOVideoFeatureControl that controls a focus mechanism. The units for the control's absolute value are meters (m). + @constant kIOVideoFeatureControlClassIDPan + A IOVideoFeatureControl that controls a panning mechanism. Positive values mean clockwise, negative values means counterclockwise. The units for the control's + absolute value are degrees (°). + @constant kIOVideoFeatureControlClassIDTilt + A IOVideoFeatureControl that controls a tilt mechanism. Positive values mean updwards, negative values means downwards. The units for the control's absolute value are + degrees (°). + @constant kIOVideoFeatureControlClassIDOpticalFilter + A IOVideoFeatureControl that controls changing the optical filter of camera lens function. The units for the control's absolute value are are undefined. + @constant kIOVideoFeatureControlClassIDBacklightCompensation + A IOVideoFeatureControl that controls the amount of backlight compensation to apply. A low number indicates the least amount of backlight compensation. The units for the + control's absolute value are are undefined. + @constant kIOVideoFeatureControlClassIDPowerLineFrequency + A IOVideoFeatureControl to specify the power line frequency to properly implement anti-flicker processing. The units for the contorl's absolute value are hertz (Hz). +*/ +enum +{ + kIOVideoFeatureControlClassIDBlackLevel = 'bklv', + kIOVideoFeatureControlClassIDWhiteLevel = 'whlv', + kIOVideoFeatureControlClassIDHue = 'hue ', + kIOVideoFeatureControlClassIDSaturation = 'satu', + kIOVideoFeatureControlClassIDContrast = 'ctst', + kIOVideoFeatureControlClassIDSharpness = 'shrp', + kIOVideoFeatureControlClassIDBrightness = 'brit', + kIOVideoFeatureControlClassIDGain = 'gain', + kIOVideoFeatureControlClassIDIris = 'iris', + kIOVideoFeatureControlClassIDShutter = 'shtr', + kIOVideoFeatureControlClassIDExposure = 'xpsr', + kIOVideoFeatureControlClassIDWhiteBalanceU = 'whbu', + kIOVideoFeatureControlClassIDWhiteBalanceV = 'whbv', + kIOVideoFeatureControlClassIDGamma = 'gmma', + kIOVideoFeatureControlClassIDTemperature = 'temp', + kIOVideoFeatureControlClassIDZoom = 'zoom', + kIOVideoFeatureControlClassIDFocus = 'fcus', + kIOVideoFeatureControlClassIDPan = 'pan ', + kIOVideoFeatureControlClassIDTilt = 'tilt', + kIOVideoFeatureControlClassIDOpticalFilter = 'opft', + kIOVideoFeatureControlClassIDBacklightCompensation = 'bklt', + kIOVideoFeatureControlClassIDPowerLineFrequency = 'pwfq' +}; + +//================================================================================================== +#pragma mark IORegistry Keys + +// IOVideo Class Names +#define kIOVideoDevice_ClassName "IOVideoDevice" + +// IOVideoDevice IORegistry Keys +#pragma mark IOVideoDevice IORegistry Keys +#define kIOVideoDeviceKey_DeviceName "device name" +#define kIOVideoDeviceKey_DeviceManufacturer "device manufacturer" +#define kIOVideoDeviceKey_DeviceUID "device UID" +#define kIOVideoDeviceKey_IOEngineIsRunning "is running" +#define kIOVideoDeviceKey_InputLatency "input latency" +#define kIOVideoDeviceKey_OutputLatency "output latency" +#define kIOVideoDeviceKey_InputStreamList "input streams" +#define kIOVideoDeviceKey_OutputStreamList "output streams" +#define kIOVideoDeviceKey_ControlList "controls" + +// IOVideoDevice Stream Dictionary Keys +#pragma mark IOVideoDevice Stream Dictionary Keys +#define kIOVideoStreamKey_StreamID "stream ID" +#define kIOVideoStreamKey_StartingDeviceChannelNumber "starting channel" +#define kIOVideoStreamKey_BufferMappingOptions "buffer mapping options" +#define kIOVideoStreamKey_CurrentFormat "current format" +#define kIOVideoStreamKey_AvailableFormats "available formats" + +// IOVideoDevice Control Dictionary Keys +#pragma mark IOVideoDevice Control Dictionary Keys +#define kIOVideoControlKey_ControlID "control ID" +#define kIOVideoControlKey_BaseClass "base class" +#define kIOVideoControlKey_Class "class" +#define kIOVideoControlKey_Scope "scope" +#define kIOVideoControlKey_Element "element" +#define kIOVideoControlKey_IsReadOnly "read only" +#define kIOVideoControlKey_Variant "variant" +#define kIOVideoControlKey_Name "name" +#define kIOVideoControlKey_Value "value" + +// IOVideoDevice Selector Control Dictionary Keys +#pragma mark IOVideoDevice Selector Control Dictionary Keys +#define kIOVideoSelectorControlKey_SelectorMap "selectors" + +// IOVideoDevice Selector Control Selector Map Item Dictionary Keys +#pragma mark IOVideoDevice Selector Control Selector Map Item Dictionary Keys +#define kIOVideoSelectorControlSelectorMapItemKey_Value "value" +#define kIOVideoSelectorControlSelectorMapItemKey_Name "name" +#define kIOVideoSelectorControlSelectorMapItemKey_Kind "kind" + +// Stream Format Dictionary Keys +#pragma mark Stream Format Dictionary Keys +#define kIOVideoStreamFormatKey_CodecType "codec type" +#define kIOVideoStreamFormatKey_CodecFlags "codec flags" +#define kIOVideoStreamFormatKey_Width "width" +#define kIOVideoStreamFormatKey_Height "height" + + +//================================================================================================== + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md new file mode 100644 index 0000000..975fd63 --- /dev/null +++ b/docs/ARCHITECTURE.md @@ -0,0 +1,105 @@ +# Architecture de QualcommWireless + +Ce document détaille l'architecture logicielle et matérielle du pilote unifié **QualcommWireless** pour les puces combinées **Qualcomm FastConnect 7800** (SoC WCN7850) sous macOS Sequoia (15.x) et versions ultérieures. + +--- + +## 1. Vue d'Ensemble du Matériel WCN7850 + +Le module sans fil Qualcomm FastConnect 7800 (WCN7850) utilise une architecture à double bus physique : + +```mermaid +graph TD + subgraph Host["Système Hôte (macOS Sequoia - Darwin 24)"] + subgraph Kernel["Kernel Space (XNU / IOKit)"] + IO80211["com.apple.iokit.IO80211Family\n(IO80211Controller)"] + IOUSB["com.apple.iokit.IOUSBHostFamily\n(IOUSBHostDevice / Interface)"] + QWifi["QualcommWifi.kext\n(Driver Wi-Fi 7 Natif)"] + QBt["QualcommWireless.kext\n(Initialisation & Firmware BT)"] + end + subgraph Userland["Espace Utilisateur"] + AirportD["airportd / CoreWLAN / Control Center"] + BtD["bluetoothd / IOBluetoothFamily daemon"] + end + end + + subgraph Hardware["Qualcomm FastConnect 7800 (WCN7850)"] + subgraph PCIeBus["Bus PCIe Gen3 x1 (VID 0x17cb, PID 0x1107)"] + BAR0["MMIO BAR0 (512 Ko)"] + Windowing["Registre Fenêtrage (0x310c)"] + BHI["Boot Host Interface (BHI/BHIe)"] + MHI["Modem Host Interface (MHI v1.0)"] + AMSS["Firmware Wi-Fi 7 (AMSS)"] + end + subgraph USBBus["Bus USB 2.0 (VID 0x0489, PID 0xe10d)"] + EP0["Contrôle EP0 (Requêtes Vendeur QCA)"] + EP2["Bulk OUT EP2 (DFU Firmware Upload)"] + EP1["Interrupt IN EP1 (Événements HCI)"] + ROM["ROM Qualcomm & Patch RAM"] + end + end + + AirportD -->|Apple80211 IOCTL / Skywalk| IO80211 + IO80211 --> QWifi + QWifi -->|BAR0 Windowing / MHI / Ring DMA| BAR0 + BAR0 --> Windowing + Windowing --> BHI + BHI --> AMSS + + BtD -->|UserClient / HCI Packets| IOUSB + IOUSB --> QBt + QBt -->|DFU Rampatch & NVM| EP2 + QBt -->|HCI Reset| EP0 +``` + +### Caractéristiques Physiques +1. **Partie Wi-Fi (PCIe)** : + - Identifiant : `0x17cb:0x1107` + - Protocole : 802.11a/b/g/n/ac/ax/be (Wi-Fi 7) + - Bandes de fréquence : 2.4 GHz, 5 GHz, 6 GHz + - Largeur de canal maximale : 320 MHz, modulation 4096-QAM + - Débit théorique : jusqu'à 5.8 Gbps + - Bus d'interface : PCI Express Gen3 x1 + +2. **Partie Bluetooth (USB)** : + - Identifiant : `0x0489:0xe10d` (Foxconn / Hon Hai WCN7850 HCI) + - Spécification : Bluetooth 5.4, LE Audio, Auracast + - Bus d'interface : USB 2.0 haute fidélité (connecté en interne sur port USB de la carte mère) + +--- + +## 2. Découpage du Pilote Kernel + +Le pilote est structuré en deux classes IOKit distinctes et complémentaires au sein du bundle : + +### 2.1. `QualcommWifi` (`IO80211Controller`) +- **Rôle** : Pilote Wi-Fi natif. +- **Classe parente** : `IO80211Controller` (de `com.apple.iokit.IO80211Family`). +- **Fournisseur (Provider)** : `IOPCIDevice` (`pci17cb,1107`). +- **Gestion MMIO & Fenêtrage** : + - La mémoire de configuration et de contrôle du WCN7850 s'étend sur plusieurs mégaoctets de registres internes, mais le BAR0 PCIe n'expose qu'une fenêtre de 512 Ko. + - Le pilote implémente le fenêtrage dynamique Qualcomm via le registre `0x310c` (`ATH12K_PCI_WINDOW_REG_ADDRESS`). Pour toute adresse au-delà de 512 Ko, l'offset de fenêtre est programmé à la volée. +- **Cycle de vie du Firmware MHI / BHI** : + 1. Reset global du SoC (`0x3008`). + 2. Lecture de la révision matérielle TCSR (`0x1B00000`). + 3. Allocation des descripteurs DMA 36-bit alignés sur 4 Ko (`ATH12K_DMA_MASK_36BIT_PAGE`). + 4. Initialisation du Boot Host Interface (BHI). + 5. Chargement en mémoire des firmwares `amss.bin`, `m3.bin`, et `board-2.bin`. + 6. Transition de l'environnement d'exécution (Execution Environment) de `PBL` (Primary Boot Loader) vers `AMSS`. + 7. Établissement des anneaux de commande, d'événements et de données MHI (M0 State). +- **Intégration macOS 802.11** : + - Traitement natif des commandes IOCTL `APPLE80211_IOC_*` (SSID, scan passif/actif, BSSID list, RSSI, canal, association). + - Fourniture d'une véritable interface sans fil reconnue par le Centre de Contrôle et `airportd`. + +### 2.2. `QualcommWireless` (`IOService`) +- **Rôle** : Initialisation du contrôleur Bluetooth USB et téléversement du Rampatch & NVM. +- **Classe parente** : `IOService`. +- **Fournisseur (Provider)** : `IOUSBHostDevice` (`0x0489:0xe10d`). +- **Protocole de démarrage** : + 1. Interrogation de la version matérielle (`QCA_GET_TARGET_VERSION`). + 2. Vérification de l'état du microprogramme (`QCA_CHECK_STATUS`). + 3. Téléversement du RAMPATCH binaire (`rampatch_usb_00190200_bin`) via le pipe Bulk OUT (EP2) avec header DFU de 40 octets. + 4. Téléversement de la configuration NVRAM (`nvm_usb_00190200_bin`) avec header DFU de 4 octets. + 5. Envoi d'un `HCI_Reset` (`0x03, 0x0c, 0x00`) via requête de contrôle USB. + 6. Injection des métadonnées `IORegistry` (`USB Product Name`, `kUSBHostPortType=255`, spoofing `idVendor=0x0a12`). + 7. Fermeture propre des pipes et libération de l'accès exclusif afin que le daemon `bluetoothd` prenne la main sans conflit. diff --git a/docs/BLUETOOTH.md b/docs/BLUETOOTH.md new file mode 100644 index 0000000..94bb2cf --- /dev/null +++ b/docs/BLUETOOTH.md @@ -0,0 +1,106 @@ +# Diagnostic & Architecture Bluetooth (Qualcomm WCN7850) + +Ce document décrit en profondeur le fonctionnement du sous-système Bluetooth de la puce **Qualcomm FastConnect 7800 (WCN7850)**, l'analyse détaillée du crash au démarrage de session macOS, et la solution définitive. + +--- + +## 1. Description du Contrôleur Bluetooth + +- **Identifiants matériels** : + - Vendeur : `0x0489` (Foxconn / Hon Hai) + - Produit : `0xe10d` + - Nom du chipset : Qualcomm WCN7850 Bluetooth 5.4 HCI + - Bus : USB 2.0 (Interface 0 : Contrôle/Bulk HCI, Interface 1 : SCO Audio) +- **Rôle dans macOS** : + - Fournit la couche transport HCI (Host Controller Interface) au daemon système `bluetoothd`. + - Gère les périphériques HID (claviers, souris, Magic Trackpad), les casques audio A2DP/HFP, et les fonctionnalités Continuity / AirDrop si la carte Wi-Fi est associée. + +--- + +## 2. Analyse Post-Mortem du Kernel Panic au Login + +### 2.1. Symptômes observés +- Au démarrage, l'écran de verrouillage macOS s'affiche correctement. +- Dès que le mot de passe utilisateur est validé et que la session commence à charger, l'écran se fige complètement puis la machine redémarre (Kernel Panic). + +### 2.2. Traces du Kernel Panic (`Kernel-2026-10-15-174229.panic`) +```text +panic(cpu 0 caller 0xffffff800ec4b86d): A kext releasing a(n) IOBluetoothL2CAPChannel has corrupted the registry. @OSObject.cpp:224 +Panicked task 0xffffff8b71de3980: 235 threads: pid 0: kernel_task +Backtrace (CPU 0), panicked thread: 0xffffff903e00ab30, Frame : Return Address +0xfffffff2a9823bd0 : 0xffffff800edd07bd mach_kernel : _panic + 0x81 +0xfffffff2a9823cc0 : 0xffffff800ec4b86d mach_kernel : __ZNK8OSObject13taggedReleaseEPKvi + 0x8d +0xfffffff2a9823cd0 : 0xffffff8010694464 com.apple.iokit.IOBluetoothFamily : __ZN17IOBluetoothDevice13removeChannelEP23IOBluetoothL2CAPChannel + 0xae +0xfffffff2a9823d70 : 0xffffff8010697629 com.apple.iokit.IOBluetoothFamily : __ZN23IOBluetoothL2CAPChannel6stopWLEv + 0x65 +0xfffffff2a9823df0 : 0xffffff8010697583 com.apple.iokit.IOBluetoothFamily : __ZN23IOBluetoothL2CAPChannel4stopEP9IOService + 0x33 +0xfffffff2a9823e90 : 0xffffff800ecc7dd6 mach_kernel : __ZN9IOService15terminateWorkerEj + 0x8b6 +Kernel Extensions in backtrace: + com.apple.iokit.IOBluetoothFamily(9.0) +``` + +### 2.3. Cause Racine (Root Cause) +1. **L'Intrusion de `IntelBTPatcher.kext`** : + - Le kext tiers `IntelBTPatcher.kext` (conçu spécifiquement pour les puces Intel AX200/AX210) était resté activé (`Enabled: true`) dans le fichier `config.plist` d'OpenCore. + - `IntelBTPatcher` intercepte et patche globalement les méthodes virtuelles de `IOBluetoothFamily` dans le noyau pour contourner des anomalies de paquets HCI propres à Intel. +2. **Incompatibilité avec Darwin 24 (macOS 15 Sequoia)** : + - Sous macOS 15 Sequoia, Apple a profondément remanié la gestion mémoire d'IOKit, notamment la validation des `taggedRelease` dans `OSObject.cpp:224`. + - `IntelBTPatcher v2.5.0` (compilé pour Monterey/Ventura/Sonoma) n'est pas compatible avec cette sémantique et effectue une libération désynchronisée (double release ou tag invalide) lors de la fermeture d'un canal L2CAP. +3. **Le déclencheur au Login** : + - Dès la validation du mot de passe de session, `loginwindow` démarre `bluetoothd`. + - Les périphériques Apple couplés (notamment la **Magic Mouse 2** `78:CA:39:F4:15:5A` et le **Magic Keyboard** `78:CA:39:4C:A3:9A`) établissent ou réinitialisent leurs canaux L2CAP (`HID ACL`). + - Lors de la libération ou du renouvellement du canal L2CAP (`IOBluetoothDevice::removeChannel`), le hook corrompu d'IntelBTPatcher déclenche immédiatement l'assertion de corruption de registre du noyau (`OSObject::taggedRelease`), provoquant le kernel panic instantané. + +--- + +## 3. Solution et Bonnes Pratiques + +### 3.1. Désactivation définitive d'`IntelBTPatcher` +Pour les cartes **Qualcomm FastConnect 7800**, `IntelBTPatcher` ne doit **JAMAIS** être utilisé : +- Dans `/Volumes/EFI/EFI/OC/config.plist` : + ```xml + <dict> + <key>BundlePath</key> + <string>IntelBTPatcher.kext</string> + <key>Enabled</key> + <false/> + </dict> + ``` +- Suppression physique du bundle `IntelBTPatcher.kext` du dossier `EFI/OC/Kexts/`. + +### 3.2. Rôle de `BlueToolFixup.kext` +- `BlueToolFixup.kext` (de la suite BrcmPatchRAM / Acidanthera) est, quant à lui, **requis et compatible**. +- Il patche dynamiquement `bluetoothd` en espace utilisateur pour accepter les dongles tiers non-Apple et débloquer les commandes de bas niveau (HCI Vendor Commands). +- Arguments de démarrage recommandés dans `boot-args` : + `-btlfxallowanyaddr -btlfxnvramcheck` + +--- + +## 4. Séquence de Chargement du Firmware USB + +Le firmware Bluetooth Qualcomm nécessite deux étages binaires téléversés au démarrage : + +```mermaid +sequenceDiagram + autonumber + participant K as QualcommWireless (Kext) + participant USB as Contrôleur USB WCN7850 + participant D as bluetoothd (macOS) + + K->>USB: QCA_GET_TARGET_VERSION (Requête de contrôle vendeur) + USB-->>K: Versions ROM / Patch / RAM + K->>USB: QCA_CHECK_STATUS (Vérification statut) + USB-->>K: Status 0x00 (RAMPATCH et Syscfg requis) + K->>USB: EP0: Header DFU (40 octets) + K->>USB: EP2 (Bulk OUT): RAMPATCH WCN7850 (paquets de 4096 octets) + K->>USB: EP0: Header DFU (4 octets) + K->>USB: EP2 (Bulk OUT): NVM WCN7850 (paquets de 4096 octets) + K->>USB: HCI Reset (0x03, 0x0C, 0x00) + USB-->>K: HCI Command Complete Event + K->>K: Injection des propriétés IORegistry (spoofing CSR 0x0a12) + K->>K: Libération de l'interface USB (close) + Note over D,USB: bluetoothd prend la main en exclusivité + D->>USB: Établissement transport HCI USB + D->>USB: Connexion Magic Mouse 2 / Clavier (L2CAP) +``` + +Grâce à cette séquence, le contrôleur Bluetooth WCN7850 opère de manière parfaitement stable sous macOS Sequoia sans aucun crash au démarrage de session. diff --git a/docs/BUILD.md b/docs/BUILD.md new file mode 100644 index 0000000..cd32603 --- /dev/null +++ b/docs/BUILD.md @@ -0,0 +1,134 @@ +# Compilation et Déploiement de QualcommWireless + +Ce guide détaille les étapes pour compiler le kext **QualcommWireless** à partir des sources et l'intégrer proprement dans l'EFI OpenCore. + +--- + +## 1. Prérequis Système + +- **Système d'exploitation hôte** : macOS Sonoma (14.x) ou macOS Sequoia (15.x). +- **Environnement de développement** : Xcode 15+ ou 16+ avec les outils en ligne de commande (`xcode-select --install`). +- **SDK macOS** : macOS 15.x SDK (inclus dans Xcode). +- **Architectures cibles** : Binaire universel `x86_64` (Hackintosh Intel/AMD) et `arm64e` (Apple Silicon). + +--- + +## 2. Arborescence du Projet + +```text +QualcommWireless/ +├── .gitignore # Filtres pour conserver un dépôt git propre +├── docs/ # Documentation technique détaillée +│ ├── ARCHITECTURE.md # Vue d'ensemble matérielle & logicielle +│ ├── BLUETOOTH.md # Analyse Bluetooth, diagnostic crash & fix +│ ├── NATIVE_WIFI.md # Pile Wi-Fi native (IO80211Controller) +│ └── BUILD.md # Ce guide de compilation et d'installation +├── firmware/ # Binaires de microprogrammes WCN7850 +│ ├── amss.bin # Microprogramme principal Wi-Fi +│ ├── board-2.bin # Données de calibration radio RF +│ └── m3.bin # Microprogramme d'économie d'énergie M3 +├── QualcommWireless/ # Code source du pilote C++ / IOKit +│ ├── Info.plist # Descripteur et personnalités IOKit +│ ├── Firmware_WCN7850.h # Header des microprogrammes BT intégrés +│ ├── Firmware_WCN7850_Wifi.h # Déclarations des microprogrammes Wi-Fi +│ ├── QualcommWifi.hpp/.cpp # Implémentation du pilote Wi-Fi natif +│ ├── QualcommWireless.hpp/.cpp # Implémentation de la partie Bluetooth USB +│ └── include/ # Headers internes IOKit & 802.11 +└── QualcommWireless.xcodeproj # Projet Xcode configuré pour build KEXT +``` + +--- + +## 3. Compilation + +### 3.1. En Ligne de Commande (Recommandé) +Depuis la racine du projet : + +```bash +xcodebuild -project QualcommWireless.xcodeproj -configuration Release +``` + +Le bundle kext final est généré dans : +`build/Release/QualcommWireless.kext` + +### 3.2. Vérification du Binaire +Pour s'assurer que le kext est bien un binaire universel prêt pour le chargement noyau : + +```bash +file build/Release/QualcommWireless.kext/Contents/MacOS/QualcommWireless +``` + +Sortie attendue : +```text +Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit kext bundle x86_64] [arm64e] +``` + +--- + +## 4. Déploiement dans OpenCore + +### 4.1. Copie du Kext dans l'EFI +Montez votre partition EFI (ex. `/Volumes/EFI`), puis copiez le kext compilé : + +```bash +cp -R build/Release/QualcommWireless.kext /Volumes/EFI/EFI/OC/Kexts/ +``` + +### 4.2. Configuration dans `config.plist` + +Dans la section `Kernel -> Add` de votre `config.plist` : + +```xml +<dict> + <key>Arch</key> + <string>Any</string> + <key>BundlePath</key> + <string>QualcommWireless.kext</string> + <key>Comment</key> + <string>Qualcomm FastConnect 7800 Wi-Fi & Bluetooth</string> + <key>Enabled</key> + <true/> + <key>ExecutablePath</key> + <string>Contents/MacOS/QualcommWireless</string> + <key>MaxKernel</key> + <string></string> + <key>MinKernel</key> + <string></string> + <key>PlistPath</key> + <string>Contents/Info.plist</string> +</dict> +``` + +> [!CAUTION] +> **RÈGLE CRITIQUE POUR ÉVITER LES CRASHS :** +> - **DÉSACTIVEZ ET SUPPRIMEZ `IntelBTPatcher.kext`**. Il est conçu uniquement pour les puces Intel et provoque un Kernel Panic immédiat à la connexion des périphériques Bluetooth sous macOS 15 Sequoia (`IOBluetoothL2CAPChannel` taggedRelease registry corruption). +> - **CONSERVEZ `BlueToolFixup.kext`**, qui est indispensable pour activer la gestion des dongles tiers dans `bluetoothd`. + +### 4.3. Arguments de Démarrage (`NVRAM -> boot-args`) +Vérifiez la présence des arguments suivants pour assurer la compatibilité Bluetooth : +```text +-btlfxallowanyaddr -btlfxnvramcheck +``` + +--- + +## 5. Diagnostic et Commandes Utiles + +Pour vérifier l'état du système après un redémarrage : + +- **Vérifier l'état du Bluetooth** : + ```bash + system_profiler SPBluetoothDataType + ``` +- **Vérifier la détection USB du contrôleur** : + ```bash + ioreg -l -r -n "IOUSBHostDevice@00a10000" + ``` +- **Consulter les journaux Bluetooth en temps réel** : + ```bash + /usr/bin/log stream --predicate 'process == "bluetoothd"' + ``` +- **Vérifier les extensions noyau chargées** : + ```bash + kmutil showloaded | grep -iE 'qualcomm|blue' + ``` diff --git a/docs/NATIVE_WIFI.md b/docs/NATIVE_WIFI.md new file mode 100644 index 0000000..3daca4b --- /dev/null +++ b/docs/NATIVE_WIFI.md @@ -0,0 +1,116 @@ +# Pile Wi-Fi Native macOS pour Qualcomm WCN7850 + +Ce document détaille l'implémentation de la pile Wi-Fi **native** (`IO80211Controller`) pour le chipset **Qualcomm FastConnect 7800 (WCN7850)** sous macOS Sequoia (Darwin 24). + +--- + +## 1. Pourquoi le Wi-Fi Natif et non l'Émulation Ethernet ? + +Dans les premières ébauches de pilotes non officiels pour macOS, certains projets choisissaient d'émuler une interface réseau filaire standard (`IOEthernetController`), en masquant les détails Wi-Fi dans un daemon externe (comme `HeliPort`). + +Cependant, cette approche présente des limitations rédhibitoires : +- ❌ Pas d'intégration dans le menu Wi-Fi natif du Centre de Contrôle macOS. +- ❌ Absence de géolocalisation par points d'accès Wi-Fi (CoreLocation). +- ❌ Incompatibilité totale avec les services Apple (AirDrop, AirPlay, Continuité, Universal Control). +- ❌ Impossibilité pour les applications utilisant `CoreWLAN.framework` de découvrir les réseaux, obtenir le RSSI, ou basculer de canal. + +**QualcommWireless fait le choix d'une intégration 100% native** en dérivant directement de `IO80211Controller` (de `com.apple.iokit.IO80211Family`). + +--- + +## 2. Architecture de `QualcommWifi` (`IO80211Controller`) + +```mermaid +graph TD + subgraph AppleStack["Sous-Système Sans Fil Apple"] + CC["Centre de Contrôle macOS"] + CoreWLAN["CoreWLAN.framework"] + AirportD["airportd (Daemon Système)"] + Skywalk["Skywalk Family (Packet Pipeline)"] + IO80211["IO80211Family (IO80211Controller / IO80211Interface)"] + end + + subgraph Driver["QualcommWifi (Driver Kernel)"] + IoctlHandler["Gestionnaire IOCTL Apple80211 (apple80211_ioctl)"] + ScanEngine["Moteur de Scan (Passif / Actif / Multicanal)"] + RingDMA["Gestionnaire DMA & Anneaux MHI (CR / ER / TR)"] + FirmwarePipeline["Pipeline de Démarrage BHI / AMSS"] + Windowing["Module Fenêtrage PCIe BAR0 (0x310c)"] + end + + subgraph Hardware["Qualcomm WCN7850 (PCIe 0x17cb:0x1107)"] + PBL["Primary Boot Loader (PBL)"] + MHIHardware["MHI Engine (Modem Host Interface)"] + WlanFirmware["Firmware AMSS Wi-Fi 7 (ath12k/WCN7850)"] + MacPhy["MAC / Baseband PHY (802.11a/b/g/n/ac/ax/be)"] + end + + CC --> AirportD + CoreWLAN --> AirportD + AirportD -->|apple80211_ioctl| IO80211 + Skywalk --> IO80211 + IO80211 --> IoctlHandler + IoctlHandler --> ScanEngine + ScanEngine --> RingDMA + RingDMA --> Windowing + FirmwarePipeline --> Windowing + Windowing --> PBL + PBL --> MHIHardware + MHIHardware --> WlanFirmware + WlanFirmware --> MacPhy +``` + +--- + +## 3. Communication Matérielle : MHI & Fenêtrage PCIe + +### 3.1. Gestion du Fenêtrage PCIe BAR0 +Le bus PCIe expose un espace MMIO BAR0 de 512 Ko. Or, les composants internes du WCN7850 (SoC, registres MHI, BHI, mémoires partagées) s'étendent sur plusieurs mégaoctets : +- **Registre de sélection de fenêtre** : `0x310c` (`ATH12K_PCI_WINDOW_REG_ADDRESS`). +- **Calcul de la fenêtre** : Pour une adresse matérielle $A \ge 512\text{ Ko}$, le numéro de fenêtre est calculé par : + $$\text{window} = (A \gg 19) \ \& \ 0x3F$$ + $$\text{offset} = 0x80000 \ | \ (A \ \& \ 0x7FFFF)$$ +- Le pilote met à jour dynamiquement `fCurrWindow` avant d'effectuer les écritures/lectures MMIO nécessaires. + +### 3.2. Séquence de Boot MHI (Modem Host Interface) +1. **Reset initial** via `ATH12K_PCI_SOC_GLOBAL_RESET` (`0x3008`). +2. **Boot Host Interface (BHI/BHIe)** : + - Initialisation des vecteurs de transmission (`ATH12K_BHIE_TXVECADDR_LOW` / `_HIGH`). + - Transfert de l'image de firmware principale (`amss.bin`, taille ~6 Mo) et du fichier de calibration carte (`board-2.bin`, ~2.4 Mo). + - Validation de la signature et exécution dans le SoC WCN7850. +3. **Transition d'environnement MHI** : + - Transition de l'état `PBL` (Primary Boot Loader) vers `AMSS` (Advanced Mobile Subscriber Software). + - Configuration des anneaux MHI : + - *Command Ring* (CR) : Envoi des requêtes d'initialisation WMI. + - *Event Ring* (ER) : Réception asynchrone des événements et interruptions MSI-X. + - *Transfer Rings* (TR) : Transmission et réception des paquets réseau 802.11. + +--- + +## 4. Implémentation des IOCTLs Apple80211 + +Pour qu'un pilote soit reconnu par le sous-système Wi-Fi de macOS, il doit répondre aux requêtes de configuration `apple80211_ioctl` émises par `airportd` : + +| Opération IOCTL | Rôle dans le système macOS | +| :--- | :--- | +| `APPLE80211_IOC_SSID` (GET / SET) | Lecture et définition du réseau Wi-Fi cible. | +| `APPLE80211_IOC_SCAN_REQ_MULTIPLE` | Déclenchement d'un scan Wi-Fi (recherche des réseaux environnants pour l'interface graphique). | +| `APPLE80211_IOC_SCAN_RESULT` | Remontée unitaire ou groupée des points d'accès découverts (SSID, BSSID, RSSI, Beacon, Type de sécurité WPA2/WPA3). | +| `APPLE80211_IOC_BSSID_LIST` | Fourniture de la liste des BSSIDs disponibles dans le cache. | +| `APPLE80211_IOC_CHANNEL` (GET / SET) | Lecture et bascule de canal (2.4 GHz, 5 GHz, 6 GHz). | +| `APPLE80211_IOC_CHANNEL_INFO` | Enumération des canaux supportés (canaux 1 à 14, bandes 5 GHz UNII-1 à UNII-4, et canaux 6 GHz UNII-5 à UNII-8 pour le Wi-Fi 6E/7). | +| `APPLE80211_IOC_PHY_MODE` | Déclaration des modes PHY supportés (`APPLE80211_MODE_11BE`, `11AX`, `11AC`, `11N`, `11G`, `11A`, `11B`). | +| `APPLE80211_IOC_STATE` | État de la machine à états de l'interface (`RUN`, `INIT`, `SCAN`, `AUTH`, `ASSOC`). | +| `APPLE80211_IOC_RSSI` | Niveau de signal courant (en dBm, typiquement entre -30 dBm et -95 dBm). | +| `APPLE80211_IOC_RATE` | Débit négocié courant (jusqu'aux débits Wi-Fi 7 EHT MCS 0-13). | +| `APPLE80211_IOC_TXPOWER` | Puissance d'émission radio déclarée. | + +--- + +## 5. Prise en Charge du Wi-Fi 7 (802.11be) + +La puce WCN7850 introduit les caractéristiques Wi-Fi 7 suivantes, intégrées dans la table des capacités du pilote : +- **Canaux 320 MHz ultra-larges** en bande 6 GHz. +- **Modulation 4096-QAM (4K-QAM)** augmentant la densité de données de 20% par rapport au 1024-QAM du Wi-Fi 6. +- **Multi-Link Operation (MLO)** : Capacité matérielle d'agréger ou de basculer dynamiquement entre plusieurs bandes (ex. 5 GHz + 6 GHz) pour une latence ultra-faible. +- **Preamble Puncturing** : Évitement automatique des sous-canaux brouillés pour maximiser la bande passante utilisable. diff --git a/firmware/amss.bin b/firmware/amss.bin new file mode 100644 index 0000000..410bc9b Binary files /dev/null and b/firmware/amss.bin differ diff --git a/firmware/board-2.bin b/firmware/board-2.bin new file mode 100644 index 0000000..086284c Binary files /dev/null and b/firmware/board-2.bin differ diff --git a/firmware/m3.bin b/firmware/m3.bin new file mode 100644 index 0000000..cfd5c6c Binary files /dev/null and b/firmware/m3.bin differ