├── .gitignore ├── AppleIntelWiFiMVM.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── ammulder.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── ammulder.xcuserdatad │ └── xcschemes │ ├── AppleIntelWiFiMVM.xcscheme │ └── xcschememanagement.plist ├── AppleIntelWiFiMVM ├── AppleIntelWiFiMVM.cpp ├── AppleIntelWiFiMVM.h ├── FirmwareLoader.cpp ├── FirmwareParser.cpp ├── FirmwareParser.h ├── Info.plist ├── firmware │ ├── iwlwifi-3160-16.ucode │ ├── iwlwifi-7260-16.ucode │ ├── iwlwifi-7265-16.ucode │ ├── iwlwifi-7265D-16.ucode │ └── iwlwifi-8000C-16.ucode └── linux │ ├── device-list.h │ ├── firmware-defs.h │ ├── ieee80211.h │ ├── if_ether.h │ ├── iwl-7000.h │ ├── iwl-8000.h │ ├── iwl-agn-hw.h │ ├── iwl-config.h │ ├── iwl-fw-error-dump.h │ ├── iwl-trans.h │ ├── linux-80211.h │ ├── linux-porting.h │ └── netdev_features.h ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | 19 | # Compiled Static libraries 20 | *.lai 21 | *.la 22 | *.a 23 | *.lib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 843096591C6FC3320020E454 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = 843096571C6FC3320020E454 /* README.md */; }; 11 | 843096601C7004920020E454 /* iwl-trans.h in Headers */ = {isa = PBXBuildFile; fileRef = 8430965F1C7004920020E454 /* iwl-trans.h */; }; 12 | 843096631C70CE6F0020E454 /* FirmwareParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 843096611C70CE6F0020E454 /* FirmwareParser.cpp */; }; 13 | 843096641C70CE6F0020E454 /* FirmwareParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 843096621C70CE6F0020E454 /* FirmwareParser.h */; }; 14 | 843096661C70EA6C0020E454 /* iwl-fw-error-dump.h in Headers */ = {isa = PBXBuildFile; fileRef = 843096651C70EA6C0020E454 /* iwl-fw-error-dump.h */; }; 15 | 844145681C717D2700D92381 /* iwlwifi-3160-16.ucode in Resources */ = {isa = PBXBuildFile; fileRef = 844145641C717D2700D92381 /* iwlwifi-3160-16.ucode */; }; 16 | 844145691C717D2700D92381 /* iwlwifi-7260-16.ucode in Resources */ = {isa = PBXBuildFile; fileRef = 844145651C717D2700D92381 /* iwlwifi-7260-16.ucode */; }; 17 | 8441456A1C717D2700D92381 /* iwlwifi-7265-16.ucode in Resources */ = {isa = PBXBuildFile; fileRef = 844145661C717D2700D92381 /* iwlwifi-7265-16.ucode */; }; 18 | 8441456B1C717D2700D92381 /* iwlwifi-7265D-16.ucode in Resources */ = {isa = PBXBuildFile; fileRef = 844145671C717D2700D92381 /* iwlwifi-7265D-16.ucode */; }; 19 | 846A8A6A1C6CB86400888583 /* iwl-agn-hw.h in Headers */ = {isa = PBXBuildFile; fileRef = 846A8A671C6CB86400888583 /* iwl-agn-hw.h */; }; 20 | 846A8A6E1C6CBA6300888583 /* iwl-config.h in Headers */ = {isa = PBXBuildFile; fileRef = 846A8A6D1C6CBA6300888583 /* iwl-config.h */; }; 21 | 846A8A701C6CBB1E00888583 /* linux-porting.h in Headers */ = {isa = PBXBuildFile; fileRef = 846A8A6F1C6CBB1E00888583 /* linux-porting.h */; }; 22 | 847F26C81C6EA19C0007A5B0 /* iwlwifi-8000C-16.ucode in Resources */ = {isa = PBXBuildFile; fileRef = 847F26C71C6EA19C0007A5B0 /* iwlwifi-8000C-16.ucode */; }; 23 | 847F26CA1C6EA2870007A5B0 /* FirmwareLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F26C91C6EA2870007A5B0 /* FirmwareLoader.cpp */; }; 24 | 84C01A021C6C1F4100408046 /* AppleIntelWiFiMVM.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C01A011C6C1F4100408046 /* AppleIntelWiFiMVM.h */; }; 25 | 84C01A041C6C1F4100408046 /* AppleIntelWiFiMVM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C01A031C6C1F4100408046 /* AppleIntelWiFiMVM.cpp */; }; 26 | 84E3AE731C6CF3F1004694CB /* ieee80211.h in Headers */ = {isa = PBXBuildFile; fileRef = 84E3AE721C6CF3F1004694CB /* ieee80211.h */; }; 27 | 84E3AE751C6CF475004694CB /* if_ether.h in Headers */ = {isa = PBXBuildFile; fileRef = 84E3AE741C6CF475004694CB /* if_ether.h */; }; 28 | 84EF564C1C6D903B00C97EDD /* netdev_features.h in Headers */ = {isa = PBXBuildFile; fileRef = 84EF564B1C6D903B00C97EDD /* netdev_features.h */; }; 29 | 84EF564E1C6D943E00C97EDD /* iwl-7000.h in Headers */ = {isa = PBXBuildFile; fileRef = 84EF564D1C6D943E00C97EDD /* iwl-7000.h */; }; 30 | 84EF56501C6D951E00C97EDD /* device-list.h in Headers */ = {isa = PBXBuildFile; fileRef = 84EF564F1C6D951E00C97EDD /* device-list.h */; }; 31 | 84EF56521C6D95C300C97EDD /* iwl-8000.h in Headers */ = {isa = PBXBuildFile; fileRef = 84EF56511C6D95C300C97EDD /* iwl-8000.h */; }; 32 | /* End PBXBuildFile section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 843096561C6FC3320020E454 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 36 | 843096571C6FC3320020E454 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 37 | 8430965E1C6FFB820020E454 /* firmware-defs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "firmware-defs.h"; path = "linux/firmware-defs.h"; sourceTree = ""; }; 38 | 8430965F1C7004920020E454 /* iwl-trans.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "iwl-trans.h"; path = "linux/iwl-trans.h"; sourceTree = ""; }; 39 | 843096611C70CE6F0020E454 /* FirmwareParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FirmwareParser.cpp; sourceTree = ""; }; 40 | 843096621C70CE6F0020E454 /* FirmwareParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FirmwareParser.h; sourceTree = ""; }; 41 | 843096651C70EA6C0020E454 /* iwl-fw-error-dump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "iwl-fw-error-dump.h"; path = "linux/iwl-fw-error-dump.h"; sourceTree = ""; }; 42 | 844145641C717D2700D92381 /* iwlwifi-3160-16.ucode */ = {isa = PBXFileReference; lastKnownFileType = file; name = "iwlwifi-3160-16.ucode"; path = "firmware/iwlwifi-3160-16.ucode"; sourceTree = ""; }; 43 | 844145651C717D2700D92381 /* iwlwifi-7260-16.ucode */ = {isa = PBXFileReference; lastKnownFileType = file; name = "iwlwifi-7260-16.ucode"; path = "firmware/iwlwifi-7260-16.ucode"; sourceTree = ""; }; 44 | 844145661C717D2700D92381 /* iwlwifi-7265-16.ucode */ = {isa = PBXFileReference; lastKnownFileType = file; name = "iwlwifi-7265-16.ucode"; path = "firmware/iwlwifi-7265-16.ucode"; sourceTree = ""; }; 45 | 844145671C717D2700D92381 /* iwlwifi-7265D-16.ucode */ = {isa = PBXFileReference; lastKnownFileType = file; name = "iwlwifi-7265D-16.ucode"; path = "firmware/iwlwifi-7265D-16.ucode"; sourceTree = ""; }; 46 | 846A8A671C6CB86400888583 /* iwl-agn-hw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "iwl-agn-hw.h"; path = "linux/iwl-agn-hw.h"; sourceTree = ""; }; 47 | 846A8A6D1C6CBA6300888583 /* iwl-config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "iwl-config.h"; path = "linux/iwl-config.h"; sourceTree = ""; }; 48 | 846A8A6F1C6CBB1E00888583 /* linux-porting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "linux-porting.h"; path = "linux/linux-porting.h"; sourceTree = ""; }; 49 | 847F26C71C6EA19C0007A5B0 /* iwlwifi-8000C-16.ucode */ = {isa = PBXFileReference; lastKnownFileType = file; name = "iwlwifi-8000C-16.ucode"; path = "firmware/iwlwifi-8000C-16.ucode"; sourceTree = ""; }; 50 | 847F26C91C6EA2870007A5B0 /* FirmwareLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FirmwareLoader.cpp; sourceTree = ""; }; 51 | 84C019FE1C6C1F4100408046 /* AppleIntelWiFiMVM.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AppleIntelWiFiMVM.kext; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 84C01A011C6C1F4100408046 /* AppleIntelWiFiMVM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppleIntelWiFiMVM.h; sourceTree = ""; }; 53 | 84C01A031C6C1F4100408046 /* AppleIntelWiFiMVM.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AppleIntelWiFiMVM.cpp; sourceTree = ""; }; 54 | 84C01A051C6C1F4100408046 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 84E3AE721C6CF3F1004694CB /* ieee80211.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ieee80211.h; path = linux/ieee80211.h; sourceTree = ""; }; 56 | 84E3AE741C6CF475004694CB /* if_ether.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = if_ether.h; path = linux/if_ether.h; sourceTree = ""; }; 57 | 84EF564A1C6D8D7800C97EDD /* linux-80211.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "linux-80211.h"; path = "linux/linux-80211.h"; sourceTree = ""; }; 58 | 84EF564B1C6D903B00C97EDD /* netdev_features.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = netdev_features.h; path = linux/netdev_features.h; sourceTree = ""; }; 59 | 84EF564D1C6D943E00C97EDD /* iwl-7000.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "iwl-7000.h"; path = "linux/iwl-7000.h"; sourceTree = ""; }; 60 | 84EF564F1C6D951E00C97EDD /* device-list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "device-list.h"; path = "linux/device-list.h"; sourceTree = ""; }; 61 | 84EF56511C6D95C300C97EDD /* iwl-8000.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "iwl-8000.h"; path = "linux/iwl-8000.h"; sourceTree = ""; }; 62 | /* End PBXFileReference section */ 63 | 64 | /* Begin PBXFrameworksBuildPhase section */ 65 | 84C019FA1C6C1F4100408046 /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | /* End PBXFrameworksBuildPhase section */ 73 | 74 | /* Begin PBXGroup section */ 75 | 846A8A641C6CB54700888583 /* linux */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | 843096651C70EA6C0020E454 /* iwl-fw-error-dump.h */, 79 | 84EF564F1C6D951E00C97EDD /* device-list.h */, 80 | 8430965E1C6FFB820020E454 /* firmware-defs.h */, 81 | 84E3AE721C6CF3F1004694CB /* ieee80211.h */, 82 | 84E3AE741C6CF475004694CB /* if_ether.h */, 83 | 84EF564D1C6D943E00C97EDD /* iwl-7000.h */, 84 | 84EF56511C6D95C300C97EDD /* iwl-8000.h */, 85 | 846A8A671C6CB86400888583 /* iwl-agn-hw.h */, 86 | 846A8A6D1C6CBA6300888583 /* iwl-config.h */, 87 | 8430965F1C7004920020E454 /* iwl-trans.h */, 88 | 84EF564A1C6D8D7800C97EDD /* linux-80211.h */, 89 | 846A8A6F1C6CBB1E00888583 /* linux-porting.h */, 90 | 84EF564B1C6D903B00C97EDD /* netdev_features.h */, 91 | ); 92 | name = linux; 93 | sourceTree = ""; 94 | }; 95 | 847F26C61C6EA0A90007A5B0 /* Firmware */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 844145641C717D2700D92381 /* iwlwifi-3160-16.ucode */, 99 | 844145651C717D2700D92381 /* iwlwifi-7260-16.ucode */, 100 | 844145661C717D2700D92381 /* iwlwifi-7265-16.ucode */, 101 | 844145671C717D2700D92381 /* iwlwifi-7265D-16.ucode */, 102 | 847F26C71C6EA19C0007A5B0 /* iwlwifi-8000C-16.ucode */, 103 | ); 104 | name = Firmware; 105 | sourceTree = ""; 106 | }; 107 | 84C019F41C6C1F4100408046 = { 108 | isa = PBXGroup; 109 | children = ( 110 | 843096561C6FC3320020E454 /* LICENSE */, 111 | 843096571C6FC3320020E454 /* README.md */, 112 | 84C01A001C6C1F4100408046 /* AppleIntelWiFiMVM */, 113 | 84C019FF1C6C1F4100408046 /* Products */, 114 | ); 115 | sourceTree = ""; 116 | }; 117 | 84C019FF1C6C1F4100408046 /* Products */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 84C019FE1C6C1F4100408046 /* AppleIntelWiFiMVM.kext */, 121 | ); 122 | name = Products; 123 | sourceTree = ""; 124 | }; 125 | 84C01A001C6C1F4100408046 /* AppleIntelWiFiMVM */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 84C01A051C6C1F4100408046 /* Info.plist */, 129 | 847F26C61C6EA0A90007A5B0 /* Firmware */, 130 | 846A8A641C6CB54700888583 /* linux */, 131 | 84C01A011C6C1F4100408046 /* AppleIntelWiFiMVM.h */, 132 | 84C01A031C6C1F4100408046 /* AppleIntelWiFiMVM.cpp */, 133 | 847F26C91C6EA2870007A5B0 /* FirmwareLoader.cpp */, 134 | 843096621C70CE6F0020E454 /* FirmwareParser.h */, 135 | 843096611C70CE6F0020E454 /* FirmwareParser.cpp */, 136 | ); 137 | path = AppleIntelWiFiMVM; 138 | sourceTree = ""; 139 | }; 140 | /* End PBXGroup section */ 141 | 142 | /* Begin PBXHeadersBuildPhase section */ 143 | 84C019FB1C6C1F4100408046 /* Headers */ = { 144 | isa = PBXHeadersBuildPhase; 145 | buildActionMask = 2147483647; 146 | files = ( 147 | 84EF56501C6D951E00C97EDD /* device-list.h in Headers */, 148 | 84EF564E1C6D943E00C97EDD /* iwl-7000.h in Headers */, 149 | 843096601C7004920020E454 /* iwl-trans.h in Headers */, 150 | 84EF564C1C6D903B00C97EDD /* netdev_features.h in Headers */, 151 | 843096641C70CE6F0020E454 /* FirmwareParser.h in Headers */, 152 | 84E3AE751C6CF475004694CB /* if_ether.h in Headers */, 153 | 846A8A6E1C6CBA6300888583 /* iwl-config.h in Headers */, 154 | 843096661C70EA6C0020E454 /* iwl-fw-error-dump.h in Headers */, 155 | 846A8A701C6CBB1E00888583 /* linux-porting.h in Headers */, 156 | 84E3AE731C6CF3F1004694CB /* ieee80211.h in Headers */, 157 | 84EF56521C6D95C300C97EDD /* iwl-8000.h in Headers */, 158 | 846A8A6A1C6CB86400888583 /* iwl-agn-hw.h in Headers */, 159 | 84C01A021C6C1F4100408046 /* AppleIntelWiFiMVM.h in Headers */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXHeadersBuildPhase section */ 164 | 165 | /* Begin PBXNativeTarget section */ 166 | 84C019FD1C6C1F4100408046 /* AppleIntelWiFiMVM */ = { 167 | isa = PBXNativeTarget; 168 | buildConfigurationList = 84C01A081C6C1F4100408046 /* Build configuration list for PBXNativeTarget "AppleIntelWiFiMVM" */; 169 | buildPhases = ( 170 | 84C019F91C6C1F4100408046 /* Sources */, 171 | 84C019FA1C6C1F4100408046 /* Frameworks */, 172 | 84C019FB1C6C1F4100408046 /* Headers */, 173 | 84C019FC1C6C1F4100408046 /* Resources */, 174 | ); 175 | buildRules = ( 176 | ); 177 | dependencies = ( 178 | ); 179 | name = AppleIntelWiFiMVM; 180 | productName = AppleIntelWiFiMVM; 181 | productReference = 84C019FE1C6C1F4100408046 /* AppleIntelWiFiMVM.kext */; 182 | productType = "com.apple.product-type.kernel-extension"; 183 | }; 184 | /* End PBXNativeTarget section */ 185 | 186 | /* Begin PBXProject section */ 187 | 84C019F51C6C1F4100408046 /* Project object */ = { 188 | isa = PBXProject; 189 | attributes = { 190 | LastUpgradeCheck = 0720; 191 | ORGANIZATIONNAME = "Aaron Mulder"; 192 | TargetAttributes = { 193 | 84C019FD1C6C1F4100408046 = { 194 | CreatedOnToolsVersion = 7.2.1; 195 | }; 196 | }; 197 | }; 198 | buildConfigurationList = 84C019F81C6C1F4100408046 /* Build configuration list for PBXProject "AppleIntelWiFiMVM" */; 199 | compatibilityVersion = "Xcode 3.2"; 200 | developmentRegion = English; 201 | hasScannedForEncodings = 0; 202 | knownRegions = ( 203 | en, 204 | ); 205 | mainGroup = 84C019F41C6C1F4100408046; 206 | productRefGroup = 84C019FF1C6C1F4100408046 /* Products */; 207 | projectDirPath = ""; 208 | projectRoot = ""; 209 | targets = ( 210 | 84C019FD1C6C1F4100408046 /* AppleIntelWiFiMVM */, 211 | ); 212 | }; 213 | /* End PBXProject section */ 214 | 215 | /* Begin PBXResourcesBuildPhase section */ 216 | 84C019FC1C6C1F4100408046 /* Resources */ = { 217 | isa = PBXResourcesBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | 844145681C717D2700D92381 /* iwlwifi-3160-16.ucode in Resources */, 221 | 8441456A1C717D2700D92381 /* iwlwifi-7265-16.ucode in Resources */, 222 | 844145691C717D2700D92381 /* iwlwifi-7260-16.ucode in Resources */, 223 | 8441456B1C717D2700D92381 /* iwlwifi-7265D-16.ucode in Resources */, 224 | 847F26C81C6EA19C0007A5B0 /* iwlwifi-8000C-16.ucode in Resources */, 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | /* End PBXResourcesBuildPhase section */ 229 | 230 | /* Begin PBXSourcesBuildPhase section */ 231 | 84C019F91C6C1F4100408046 /* Sources */ = { 232 | isa = PBXSourcesBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | 843096591C6FC3320020E454 /* README.md in Sources */, 236 | 843096631C70CE6F0020E454 /* FirmwareParser.cpp in Sources */, 237 | 84C01A041C6C1F4100408046 /* AppleIntelWiFiMVM.cpp in Sources */, 238 | 847F26CA1C6EA2870007A5B0 /* FirmwareLoader.cpp in Sources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | /* End PBXSourcesBuildPhase section */ 243 | 244 | /* Begin XCBuildConfiguration section */ 245 | 84C01A061C6C1F4100408046 /* Debug */ = { 246 | isa = XCBuildConfiguration; 247 | buildSettings = { 248 | ALWAYS_SEARCH_USER_PATHS = NO; 249 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 250 | CLANG_CXX_LIBRARY = "libc++"; 251 | CLANG_ENABLE_MODULES = YES; 252 | CLANG_ENABLE_OBJC_ARC = YES; 253 | CLANG_WARN_BOOL_CONVERSION = YES; 254 | CLANG_WARN_CONSTANT_CONVERSION = YES; 255 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 256 | CLANG_WARN_EMPTY_BODY = YES; 257 | CLANG_WARN_ENUM_CONVERSION = YES; 258 | CLANG_WARN_INT_CONVERSION = YES; 259 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | CODE_SIGN_IDENTITY = "-"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = dwarf; 265 | ENABLE_STRICT_OBJC_MSGSEND = YES; 266 | ENABLE_TESTABILITY = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_DYNAMIC_NO_PIC = NO; 269 | GCC_NO_COMMON_BLOCKS = YES; 270 | GCC_OPTIMIZATION_LEVEL = 0; 271 | GCC_PREPROCESSOR_DEFINITIONS = ( 272 | "DEBUG=1", 273 | "$(inherited)", 274 | ); 275 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 276 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 277 | GCC_WARN_UNDECLARED_SELECTOR = YES; 278 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 279 | GCC_WARN_UNUSED_FUNCTION = YES; 280 | GCC_WARN_UNUSED_VARIABLE = YES; 281 | MACOSX_DEPLOYMENT_TARGET = 10.11; 282 | MTL_ENABLE_DEBUG_INFO = YES; 283 | ONLY_ACTIVE_ARCH = YES; 284 | SDKROOT = macosx; 285 | }; 286 | name = Debug; 287 | }; 288 | 84C01A071C6C1F4100408046 /* Release */ = { 289 | isa = XCBuildConfiguration; 290 | buildSettings = { 291 | ALWAYS_SEARCH_USER_PATHS = NO; 292 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 293 | CLANG_CXX_LIBRARY = "libc++"; 294 | CLANG_ENABLE_MODULES = YES; 295 | CLANG_ENABLE_OBJC_ARC = YES; 296 | CLANG_WARN_BOOL_CONVERSION = YES; 297 | CLANG_WARN_CONSTANT_CONVERSION = YES; 298 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 299 | CLANG_WARN_EMPTY_BODY = YES; 300 | CLANG_WARN_ENUM_CONVERSION = YES; 301 | CLANG_WARN_INT_CONVERSION = YES; 302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 303 | CLANG_WARN_UNREACHABLE_CODE = YES; 304 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 305 | CODE_SIGN_IDENTITY = "-"; 306 | COPY_PHASE_STRIP = NO; 307 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 308 | ENABLE_NS_ASSERTIONS = NO; 309 | ENABLE_STRICT_OBJC_MSGSEND = YES; 310 | GCC_C_LANGUAGE_STANDARD = gnu99; 311 | GCC_NO_COMMON_BLOCKS = YES; 312 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 313 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 314 | GCC_WARN_UNDECLARED_SELECTOR = YES; 315 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 316 | GCC_WARN_UNUSED_FUNCTION = YES; 317 | GCC_WARN_UNUSED_VARIABLE = YES; 318 | MACOSX_DEPLOYMENT_TARGET = 10.11; 319 | MTL_ENABLE_DEBUG_INFO = NO; 320 | SDKROOT = macosx; 321 | }; 322 | name = Release; 323 | }; 324 | 84C01A091C6C1F4100408046 /* Debug */ = { 325 | isa = XCBuildConfiguration; 326 | buildSettings = { 327 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 328 | CODE_SIGN_IDENTITY = ""; 329 | COMBINE_HIDPI_IMAGES = YES; 330 | CURRENT_PROJECT_VERSION = 1.0.0d1; 331 | INFOPLIST_FILE = AppleIntelWiFiMVM/Info.plist; 332 | MODULE_NAME = org.opentools.AppleIntelWiFiMVM; 333 | MODULE_VERSION = 1.0.0d1; 334 | PRODUCT_BUNDLE_IDENTIFIER = org.opentools.AppleIntelWiFiMVM; 335 | PRODUCT_NAME = "$(TARGET_NAME)"; 336 | VALID_ARCHS = x86_64; 337 | WRAPPER_EXTENSION = kext; 338 | }; 339 | name = Debug; 340 | }; 341 | 84C01A0A1C6C1F4100408046 /* Release */ = { 342 | isa = XCBuildConfiguration; 343 | buildSettings = { 344 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 345 | CODE_SIGN_IDENTITY = ""; 346 | COMBINE_HIDPI_IMAGES = YES; 347 | CURRENT_PROJECT_VERSION = 1.0.0d1; 348 | INFOPLIST_FILE = AppleIntelWiFiMVM/Info.plist; 349 | MODULE_NAME = org.opentools.AppleIntelWiFiMVM; 350 | MODULE_VERSION = 1.0.0d1; 351 | PRODUCT_BUNDLE_IDENTIFIER = org.opentools.AppleIntelWiFiMVM; 352 | PRODUCT_NAME = "$(TARGET_NAME)"; 353 | VALID_ARCHS = x86_64; 354 | WRAPPER_EXTENSION = kext; 355 | }; 356 | name = Release; 357 | }; 358 | /* End XCBuildConfiguration section */ 359 | 360 | /* Begin XCConfigurationList section */ 361 | 84C019F81C6C1F4100408046 /* Build configuration list for PBXProject "AppleIntelWiFiMVM" */ = { 362 | isa = XCConfigurationList; 363 | buildConfigurations = ( 364 | 84C01A061C6C1F4100408046 /* Debug */, 365 | 84C01A071C6C1F4100408046 /* Release */, 366 | ); 367 | defaultConfigurationIsVisible = 0; 368 | defaultConfigurationName = Release; 369 | }; 370 | 84C01A081C6C1F4100408046 /* Build configuration list for PBXNativeTarget "AppleIntelWiFiMVM" */ = { 371 | isa = XCConfigurationList; 372 | buildConfigurations = ( 373 | 84C01A091C6C1F4100408046 /* Debug */, 374 | 84C01A0A1C6C1F4100408046 /* Release */, 375 | ); 376 | defaultConfigurationIsVisible = 0; 377 | defaultConfigurationName = Release; 378 | }; 379 | /* End XCConfigurationList section */ 380 | }; 381 | rootObject = 84C019F51C6C1F4100408046 /* Project object */; 382 | } 383 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM.xcodeproj/project.xcworkspace/xcuserdata/ammulder.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammulder/AppleIntelWiFiMVM/c0ad7ac62675abcc9aba96b8af72bbedf335f367/AppleIntelWiFiMVM.xcodeproj/project.xcworkspace/xcuserdata/ammulder.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /AppleIntelWiFiMVM.xcodeproj/xcuserdata/ammulder.xcuserdatad/xcschemes/AppleIntelWiFiMVM.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM.xcodeproj/xcuserdata/ammulder.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AppleIntelWiFiMVM.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 84C019FD1C6C1F4100408046 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/AppleIntelWiFiMVM.cpp: -------------------------------------------------------------------------------- 1 | #include "AppleIntelWiFiMVM.h" 2 | extern "C" { 3 | #include "linux/linux-porting.h" 4 | #include "linux/device-list.h" 5 | } 6 | 7 | #define super IOService 8 | OSDefineMetaClassAndStructors(AppleIntelWiFiMVM, IOService); 9 | 10 | // ------------------------ IOService Methods ---------------------------- 11 | 12 | bool AppleIntelWiFiMVM::init(OSDictionary *dict) { 13 | bool res = super::init(dict); 14 | DEBUGLOG("%s::init\n", MYNAME); 15 | return res; 16 | } 17 | 18 | bool AppleIntelWiFiMVM::start(IOService* provider) { 19 | DEBUGLOG("%s::start\n", MYNAME); 20 | if(!super::start(provider)) { 21 | IOLog("%s Super start failed\n", MYNAME); 22 | return false; 23 | } 24 | 25 | // Ensure we have a PCI device provider 26 | pciDevice = OSDynamicCast(IOPCIDevice, provider); 27 | if(!pciDevice) { 28 | IOLog("%s Provider not a PCIDevice\n", MYNAME); 29 | return false; 30 | } 31 | 32 | UInt16 vendor = pciDevice->configRead16(kIOPCIConfigVendorID); 33 | UInt16 device = pciDevice->configRead16(kIOPCIConfigDeviceID); 34 | UInt16 subsystem_vendor = pciDevice->configRead16(kIOPCIConfigSubSystemVendorID); 35 | UInt16 subsystem_device = pciDevice->configRead16(kIOPCIConfigSubSystemID); 36 | UInt8 revision = pciDevice->configRead8(kIOPCIConfigRevisionID); 37 | // vendor = 0x8086; 38 | // subsystem_vendor = 0x8086; 39 | // Broadwell NUC 7265 40 | // device = 0x095a; 41 | // subsystem_device = 0x9510; 42 | // Skylake NUC 8260 43 | // device = 0x24F3; 44 | // subsystem_device = 0x9010; 45 | // 7260 46 | // device = 0x08B1; 47 | // subsystem_device = 0x4070; 48 | // 3160 49 | // device = 0x08B3; 50 | // subsystem_device = 0x0070; 51 | // 3165 uses 7165D firmware 52 | // device = 0x3165; 53 | // subsystem_device = 0x4010; 54 | // 4165 uses 8260 firmware above, not retested here 55 | 56 | if(vendor != 0x8086 || subsystem_vendor != 0x8086) { 57 | IOLog("%s Unrecognized vendor/sub-vendor ID %#06x/%#06x; expecting 0x8086 for both; cannot load driver.\n", 58 | MYNAME, vendor, subsystem_vendor); 59 | return false; 60 | } 61 | 62 | // DEBUGLOG("%s Vendor %#06x Device %#06x SubVendor %#06x SubDevice %#06x Revision %#04x\n", MYNAME, vendor, device, subsystem_vendor, subsystem_device, revision); 63 | const struct iwl_cfg *card = identifyWiFiCard(device, subsystem_device); 64 | if(!card) { 65 | IOLog("%s Card has the right device ID %#06x but unmatched sub-device ID %#06x; cannot load driver.\n", 66 | MYNAME, device, subsystem_device); 67 | return false; 68 | } 69 | IOLog("%s loading for device %s\n", MYNAME, card->name); 70 | 71 | // Create locks for synchronization 72 | firmwareLoadLock = IOLockAlloc(); 73 | if (!firmwareLoadLock) { 74 | IOLog("%s Unable to allocate firmware load lock\n", MYNAME); 75 | return false; 76 | } 77 | 78 | pciDevice->retain(); 79 | 80 | IOLog("%s Starting Firmware...\n", MYNAME); 81 | if(!startFirmware(card, NULL)) {// TODO: PCI transport 82 | IOLog("%s Unable to start firmware\n", MYNAME); 83 | return false; 84 | } 85 | 86 | pciDevice->setMemoryEnable(true); 87 | registerService(); 88 | 89 | return true; 90 | } 91 | 92 | void AppleIntelWiFiMVM::stop(IOService* provider) { 93 | DEBUGLOG("%s::stop\n", MYNAME); 94 | if(driver) stopFirmware(); 95 | if (firmwareLoadLock) 96 | { 97 | IOLockFree(firmwareLoadLock); 98 | firmwareLoadLock = NULL; 99 | } 100 | super::stop(provider); 101 | } 102 | 103 | void AppleIntelWiFiMVM::free() { 104 | DEBUGLOG("%s::free\n", MYNAME); 105 | RELEASE(pciDevice); 106 | if(driver) IOFree(driver, sizeof(iwl_drv)); 107 | super::free(); 108 | } 109 | 110 | const struct iwl_cfg *AppleIntelWiFiMVM::identifyWiFiCard(UInt16 device, UInt16 subdevice) { 111 | UInt32 i; 112 | for(i=0; i 2 | #include 3 | #include 4 | #include "linux/device-list.h" 5 | #include "FirmwareParser.h" 6 | 7 | class AppleIntelWiFiMVM : public IOService { 8 | OSDeclareDefaultStructors(AppleIntelWiFiMVM); 9 | 10 | public: 11 | // --------------- IOService methods --------------- 12 | virtual bool init(OSDictionary *properties) override; 13 | virtual bool start(IOService *provider) override; 14 | virtual void stop(IOService *provider) override; 15 | virtual void free() override; 16 | 17 | private: 18 | // --------------- Methods --------------- 19 | const struct iwl_cfg *identifyWiFiCard(UInt16 device, UInt16 subdevice); 20 | bool startFirmware(const struct iwl_cfg *device, struct iwl_trans *trans); 21 | void stopFirmware(); 22 | OSData* loadFirmwareSync(struct iwl_drv *drv, const struct iwl_cfg *device); 23 | static void firmwareLoadComplete( OSKextRequestTag requestTag, OSReturn result, const void *resourceData, uint32_t resourceDataLength, void *context); 24 | 25 | // --------------- Structs --------------- 26 | struct FirmwareLoadProgress { 27 | AppleIntelWiFiMVM *driver; 28 | OSData *firmwareData; 29 | }; 30 | 31 | // --------------- Variables --------------- 32 | IOLock *firmwareLoadLock; 33 | IOPCIDevice *pciDevice; 34 | iwl_drv *driver; 35 | bool firmwareLoaded = false; 36 | FirmwareParser *parser; 37 | }; 38 | 39 | #define MYNAME "AppleIntelWiFiMVM" 40 | #define DEBUGLOG(args...) IOLog(args) 41 | #define RELEASE(x) if(x){(x)->release();(x)=NULL;} 42 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/FirmwareLoader.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // FirmwareLoader.cpp 3 | // 4 | // Copyright © 2016 Aaron Mulder. All rights reserved. 5 | // 6 | #include "AppleIntelWiFiMVM.h" 7 | 8 | // static 9 | void AppleIntelWiFiMVM::firmwareLoadComplete( OSKextRequestTag requestTag, OSReturn result, const void *resourceData, uint32_t resourceDataLength, void *context) { 10 | DEBUGLOG("%s Received firmware load callback...\n", MYNAME); 11 | FirmwareLoadProgress *progress = (FirmwareLoadProgress *)context; 12 | DEBUGLOG("%s Attempting firmware lock to prepare data\n", MYNAME); 13 | IOLockLock(progress->driver->firmwareLoadLock); 14 | if(result == kOSReturnSuccess) { 15 | progress->firmwareData = OSData::withBytes(resourceData, resourceDataLength); 16 | } else 17 | IOLog("%s firmwareLoadComplete FAILURE: %08x.\n", MYNAME, result); 18 | DEBUGLOG("%s Releasing firmware lock\n", MYNAME); 19 | IOLockUnlock(progress->driver->firmwareLoadLock); 20 | DEBUGLOG("%s Waking sleepers...\n", MYNAME); 21 | IOLockWakeup(progress->driver->firmwareLoadLock, progress->driver, true); 22 | DEBUGLOG("%s Callback complete\n", MYNAME); 23 | } 24 | 25 | OSData* AppleIntelWiFiMVM::loadFirmwareSync(struct iwl_drv *drv, const struct iwl_cfg *device) { 26 | DEBUGLOG("%s Loading firmware\n", MYNAME); 27 | const char *name_pre = drv->cfg->fw_name_pre; 28 | char tag[8]; 29 | 30 | IOLockLock(firmwareLoadLock); 31 | FirmwareLoadProgress progress = {.driver = this, .firmwareData = NULL}; 32 | drv->fw_index = drv->cfg->ucode_api_max; 33 | while(true) { 34 | snprintf(tag, 8, "%d", drv->fw_index); 35 | /* 36 | * Starting 8000B - FW name format has changed. This overwrites the 37 | * previous name and uses the new format. 38 | */ 39 | // if (drv->trans->cfg->device_family == IWL_DEVICE_FAMILY_8000) { TODO:FIXME 40 | if (name_pre[8] == '8') { 41 | char rev_step = 'A' + 2;// CSR_HW_REV_STEP(drv->trans->hw_rev); TODO:FIXME replace 2 42 | 43 | snprintf(drv->firmware_name, sizeof(drv->firmware_name), 44 | "%s%c-%s.ucode", name_pre, rev_step, tag); 45 | } else { 46 | snprintf(drv->firmware_name, sizeof(drv->firmware_name), "%s%s.ucode", 47 | name_pre, tag); 48 | } 49 | DEBUGLOG("%s Requesting firmware load for [%s]...\n", MYNAME, drv->firmware_name); 50 | OSReturn ret = OSKextRequestResource(OSKextGetCurrentIdentifier(), 51 | drv->firmware_name, 52 | firmwareLoadComplete, 53 | &progress, 54 | NULL); 55 | if(ret != kOSReturnSuccess) { 56 | IOLog("%s Unable to load firmware file %08x\n", MYNAME, ret); 57 | IOLockUnlock(firmwareLoadLock); 58 | return NULL; 59 | } 60 | DEBUGLOG("%s Waiting for firmware load...\n", MYNAME); 61 | IOLockSleep(firmwareLoadLock, this, THREAD_INTERRUPTIBLE); 62 | DEBUGLOG("%s Woke up after waiting for firmware lock...\n", MYNAME); 63 | if(progress.firmwareData) break; 64 | if(--drv->fw_index < drv->cfg->ucode_api_min) break; 65 | if(drv->fw_index < 0) break; 66 | } 67 | IOLockUnlock(firmwareLoadLock); 68 | 69 | DEBUGLOG("%s %s firmware file %s\n", MYNAME, progress.firmwareData ? "LOADED" : "FAILED", drv->firmware_name); 70 | 71 | return progress.firmwareData; 72 | } 73 | 74 | bool AppleIntelWiFiMVM::startFirmware(const struct iwl_cfg *device, struct iwl_trans *trans) { 75 | // struct iwl_drv *drv; 76 | // int ret; 77 | 78 | driver = (struct iwl_drv*)IOMalloc(sizeof(*driver)); 79 | if (!driver) { 80 | return false; 81 | } 82 | 83 | driver->trans = trans; 84 | // drv->dev = trans->dev; 85 | driver->cfg = device; 86 | 87 | // init_completion(&drv->request_firmware_complete); 88 | // INIT_LIST_HEAD(&drv->list); 89 | 90 | //#ifdef CONFIG_IWLWIFI_DEBUGFS 91 | // /* Create the device debugfs entries. */ 92 | // drv->dbgfs_drv = debugfs_create_dir(dev_name(trans->dev), 93 | // iwl_dbgfs_root); 94 | // 95 | // if (!drv->dbgfs_drv) { 96 | // IWL_ERR(drv, "failed to create debugfs directory\n"); 97 | // ret = -ENOMEM; 98 | // goto err_free_drv; 99 | // } 100 | // 101 | // /* Create transport layer debugfs dir */ 102 | // drv->trans->dbgfs_dir = debugfs_create_dir("trans", drv->dbgfs_drv); 103 | // 104 | // if (!drv->trans->dbgfs_dir) { 105 | // IWL_ERR(drv, "failed to create transport debugfs directory\n"); 106 | // ret = -ENOMEM; 107 | // goto err_free_dbgfs; 108 | // } 109 | //#endif 110 | IOLog("%s Attempting to load Firmware...\n", MYNAME); 111 | 112 | OSData *fwData = loadFirmwareSync(driver, device); 113 | if(!fwData) { 114 | IOFree(driver, sizeof(*driver)); 115 | driver = NULL; 116 | return false; 117 | } 118 | 119 | parser = new FirmwareParser(); 120 | IOLog("%s Attempting to parse Firmware...\n", MYNAME); 121 | bool result = parser->processFirmwareData(fwData, driver); 122 | if(result) { 123 | IOLog("%s Parsed firmware!\n", MYNAME); 124 | IOLockLock(firmwareLoadLock); 125 | firmwareLoaded = true; 126 | IOLockUnlock(firmwareLoadLock); 127 | } 128 | else IOLog("%s Firmware parse failed :(\n", MYNAME); 129 | RELEASE(fwData) 130 | 131 | return true; 132 | 133 | //err_fw: 134 | //#ifdef CONFIG_IWLWIFI_DEBUGFS 135 | //err_free_dbgfs: 136 | // debugfs_remove_recursive(drv->dbgfs_drv); 137 | //err_free_drv: 138 | //#endif 139 | // IOFree(drv, sizeof(*drv)); 140 | //err: 141 | // return NULL; 142 | } 143 | 144 | void AppleIntelWiFiMVM::stopFirmware() { 145 | if(!driver) return; 146 | // wait_for_completion(&drv->request_firmware_complete); 147 | IOLockLock(firmwareLoadLock); 148 | if(!firmwareLoaded) { 149 | IOLog("%s Stopping before firmware is loaded: waiting\n", MYNAME); 150 | IOLockSleep(firmwareLoadLock, this, THREAD_INTERRUPTIBLE); 151 | IOLog("%s Load complete; now stopping\n", MYNAME); 152 | } 153 | IOLockUnlock(firmwareLoadLock); 154 | 155 | // _iwl_op_mode_stop(drv); 156 | 157 | if(parser) { 158 | parser->releaseFirmware(driver); 159 | RELEASE(parser) 160 | } 161 | 162 | // mutex_lock(&iwlwifi_opmode_table_mtx); 163 | // /* 164 | // * List is empty (this item wasn't added) 165 | // * when firmware loading failed -- in that 166 | // * case we can't remove it from any list. 167 | // */ 168 | // if (!list_empty(&drv->list)) 169 | // list_del(&drv->list); 170 | // mutex_unlock(&iwlwifi_opmode_table_mtx); 171 | 172 | //#ifdef CONFIG_IWLWIFI_DEBUGFS 173 | // debugfs_remove_recursive(drv->dbgfs_drv); 174 | //#endif 175 | 176 | IOFree(driver, sizeof(*driver)); 177 | driver = NULL; 178 | } 179 | 180 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/FirmwareParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // firmware.h 3 | // AppleIntelWiFiMVM 4 | // 5 | // Created by Aaron Mulder on 2/13/16. 6 | // Copyright © 2016 Aaron Mulder. All rights reserved. 7 | // 8 | 9 | #ifndef firmware_h 10 | #define firmware_h 11 | 12 | #include 13 | #include 14 | //#include 15 | //#include 16 | #include "firmware-defs.h" 17 | #include "iwl-config.h" 18 | #include "iwl-agn-hw.h" 19 | 20 | 21 | class FirmwareParser : public OSObject { 22 | OSDeclareDefaultStructors(FirmwareParser); 23 | 24 | public: 25 | bool processFirmwareData(OSData *raw, struct iwl_drv *drv); 26 | void releaseFirmware(struct iwl_drv *drv); 27 | 28 | //private: 29 | }; 30 | 31 | static int iwl_parse_tlv_firmware(struct iwl_drv *drv, 32 | OSData *ucode_raw, 33 | struct iwl_firmware_pieces *pieces, 34 | struct iwl_ucode_capabilities *capa); 35 | //static int validate_sec_sizes(struct iwl_drv *drv, 36 | // struct iwl_firmware_pieces *pieces, 37 | // const struct iwl_cfg *cfg); 38 | static int iwl_alloc_ucode(struct iwl_drv *drv, 39 | struct iwl_firmware_pieces *pieces, 40 | enum iwl_ucode_type type); 41 | static void iwl_dealloc_ucode(struct iwl_drv *drv); 42 | 43 | /** 44 | * struct iwl_fw - variables associated with the firmware 45 | * 46 | * @ucode_ver: ucode version from the ucode file 47 | * @fw_version: firmware version string 48 | * @img: ucode image like ucode_rt, ucode_init, ucode_wowlan. 49 | * @ucode_capa: capabilities parsed from the ucode file. 50 | * @enhance_sensitivity_table: device can do enhanced sensitivity. 51 | * @init_evtlog_ptr: event log offset for init ucode. 52 | * @init_evtlog_size: event log size for init ucode. 53 | * @init_errlog_ptr: error log offfset for init ucode. 54 | * @inst_evtlog_ptr: event log offset for runtime ucode. 55 | * @inst_evtlog_size: event log size for runtime ucode. 56 | * @inst_errlog_ptr: error log offfset for runtime ucode. 57 | * @mvm_fw: indicates this is MVM firmware 58 | * @cipher_scheme: optional external cipher scheme. 59 | * @human_readable: human readable version 60 | * @sdio_adma_addr: the default address to set for the ADMA in SDIO mode until 61 | * we get the ALIVE from the uCode 62 | * @dbg_dest_tlv: points to the destination TLV for debug 63 | * @dbg_conf_tlv: array of pointers to configuration TLVs for debug 64 | * @dbg_conf_tlv_len: lengths of the @dbg_conf_tlv entries 65 | * @dbg_trigger_tlv: array of pointers to triggers TLVs 66 | * @dbg_trigger_tlv_len: lengths of the @dbg_trigger_tlv entries 67 | * @dbg_dest_reg_num: num of reg_ops in %dbg_dest_tlv 68 | */ 69 | struct iwl_fw { 70 | u32 ucode_ver; 71 | 72 | char fw_version[ETHTOOL_FWVERS_LEN]; 73 | 74 | /* ucode images */ 75 | struct fw_img img[IWL_UCODE_TYPE_MAX]; 76 | 77 | struct iwl_ucode_capabilities ucode_capa; 78 | bool enhance_sensitivity_table; 79 | 80 | u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr; 81 | u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr; 82 | 83 | struct iwl_tlv_calib_ctrl default_calib[IWL_UCODE_TYPE_MAX]; 84 | u32 phy_config; 85 | u8 valid_tx_ant; 86 | u8 valid_rx_ant; 87 | 88 | bool mvm_fw; 89 | 90 | struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS]; 91 | u8 human_readable[FW_VER_HUMAN_READABLE_SZ]; 92 | 93 | u32 sdio_adma_addr; 94 | 95 | struct iwl_fw_dbg_dest_tlv *dbg_dest_tlv; 96 | struct iwl_fw_dbg_conf_tlv *dbg_conf_tlv[FW_DBG_CONF_MAX]; 97 | size_t dbg_conf_tlv_len[FW_DBG_CONF_MAX]; 98 | struct iwl_fw_dbg_trigger_tlv *dbg_trigger_tlv[FW_DBG_TRIGGER_MAX]; 99 | size_t dbg_trigger_tlv_len[FW_DBG_TRIGGER_MAX]; 100 | u8 dbg_dest_reg_num; 101 | struct iwl_gscan_capabilities gscan_capa; 102 | }; 103 | 104 | /** 105 | * struct iwl_drv - drv common data 106 | * @list: list of drv structures using this opmode 107 | * @fw: the iwl_fw structure 108 | * @op_mode: the running op_mode 109 | * @trans: transport layer 110 | * @dev: for debug prints only 111 | * @cfg: configuration struct 112 | * @fw_index: firmware revision to try loading 113 | * @firmware_name: composite filename of ucode file to load 114 | * @request_firmware_complete: the firmware has been obtained from user space 115 | */ 116 | struct iwl_drv { 117 | // struct list_head list; 118 | struct iwl_fw fw; 119 | 120 | struct iwl_op_mode *op_mode; 121 | struct iwl_trans *trans; 122 | // struct device *dev; 123 | const struct iwl_cfg *cfg; 124 | 125 | int fw_index; /* firmware we're trying to load */ 126 | char firmware_name[32]; /* name of firmware file to load */ 127 | 128 | struct { 129 | int dbg_dest_tlv; 130 | int dbg_conf_tlv[FW_DBG_CONF_MAX]; 131 | int dbg_trigger_tlv[FW_DBG_TRIGGER_MAX]; 132 | } sizes; 133 | }; 134 | 135 | 136 | 137 | #endif /* firmware_h */ 138 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | KEXT 17 | CFBundleShortVersionString 18 | 0.1.1d1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 0.1.1d1 23 | IOKitPersonalities 24 | 25 | AppleIntelWiFiMVM 26 | 27 | CFBundleIdentifier 28 | org.opentools.${PRODUCT_NAME:rfc1034identifier} 29 | IOClass 30 | AppleIntelWiFiMVM 31 | IOProviderClass 32 | IOPCIDevice 33 | IOPCIPrimaryMatch 34 | 0x08b18086 0x08b28086 0x08b38086 0x08b48086 0x31658086 0x31668086 0x095a8086 0x095b8086 0x24f38086 0x24f48086 35 | IOProbeScore 36 | 1000 37 | 38 | 39 | NSHumanReadableCopyright 40 | Copyright © 2016 Aaron Mulder. All rights reserved. 41 | OSBundleLibraries 42 | 43 | com.apple.kpi.mach 44 | 9.0.0 45 | com.apple.kpi.iokit 46 | 9.0.0 47 | com.apple.kpi.libkern 48 | 9.0.0 49 | com.apple.iokit.IOPCIFamily 50 | 1.7 51 | com.apple.iokit.IONetworkingFamily 52 | 1.5.0 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/firmware/iwlwifi-3160-16.ucode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammulder/AppleIntelWiFiMVM/c0ad7ac62675abcc9aba96b8af72bbedf335f367/AppleIntelWiFiMVM/firmware/iwlwifi-3160-16.ucode -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/firmware/iwlwifi-7260-16.ucode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammulder/AppleIntelWiFiMVM/c0ad7ac62675abcc9aba96b8af72bbedf335f367/AppleIntelWiFiMVM/firmware/iwlwifi-7260-16.ucode -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/firmware/iwlwifi-7265-16.ucode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammulder/AppleIntelWiFiMVM/c0ad7ac62675abcc9aba96b8af72bbedf335f367/AppleIntelWiFiMVM/firmware/iwlwifi-7265-16.ucode -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/firmware/iwlwifi-7265D-16.ucode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammulder/AppleIntelWiFiMVM/c0ad7ac62675abcc9aba96b8af72bbedf335f367/AppleIntelWiFiMVM/firmware/iwlwifi-7265D-16.ucode -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/firmware/iwlwifi-8000C-16.ucode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ammulder/AppleIntelWiFiMVM/c0ad7ac62675abcc9aba96b8af72bbedf335f367/AppleIntelWiFiMVM/firmware/iwlwifi-8000C-16.ucode -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/linux/device-list.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * This file is provided under a dual BSD/GPLv2 license. When using or 4 | * redistributing this file, you may do so under either license. 5 | * 6 | * GPL LICENSE SUMMARY 7 | * 8 | * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of version 2 of the GNU General Public License as 13 | * published by the Free Software Foundation. 14 | * 15 | * This program is distributed in the hope that it will be useful, but 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 23 | * USA 24 | * 25 | * The full GNU General Public License is included in this distribution 26 | * in the file called COPYING. 27 | * 28 | * Contact Information: 29 | * Intel Linux Wireless 30 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 31 | * 32 | * BSD LICENSE 33 | * 34 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 35 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 36 | * All rights reserved. 37 | * 38 | * Redistribution and use in source and binary forms, with or without 39 | * modification, are permitted provided that the following conditions 40 | * are met: 41 | * 42 | * * Redistributions of source code must retain the above copyright 43 | * notice, this list of conditions and the following disclaimer. 44 | * * Redistributions in binary form must reproduce the above copyright 45 | * notice, this list of conditions and the following disclaimer in 46 | * the documentation and/or other materials provided with the 47 | * distribution. 48 | * * Neither the name Intel Corporation nor the names of its 49 | * contributors may be used to endorse or promote products derived 50 | * from this software without specific prior written permission. 51 | * 52 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 53 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 54 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 55 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 56 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 57 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 58 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 59 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 60 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 61 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 62 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 63 | * 64 | *****************************************************************************/ 65 | 66 | /** See iwlwifi/pcie/drv.c */ 67 | 68 | #ifndef __MVM_DEVICE_LIST_H 69 | #define __MVM_DEVICE_LIST_H 70 | 71 | #include "iwl-7000.h" 72 | #include "iwl-8000.h" 73 | 74 | #define IWL_PCI_DEVICE(dev, subdev, cfg) \ 75 | .device = (dev), \ 76 | .subdevice = (subdev), \ 77 | .config = &(cfg) 78 | 79 | struct wifi_card { 80 | UInt16 device; 81 | UInt16 subdevice; 82 | const struct iwl_cfg *config; 83 | }; 84 | 85 | static const struct wifi_card wifi_card_ids[] = { 86 | /* 7260 Series */ 87 | {IWL_PCI_DEVICE(0x08B1, 0x4070, iwl7260_2ac_cfg)}, 88 | {IWL_PCI_DEVICE(0x08B1, 0x4072, iwl7260_2ac_cfg)}, 89 | {IWL_PCI_DEVICE(0x08B1, 0x4170, iwl7260_2ac_cfg)}, 90 | {IWL_PCI_DEVICE(0x08B1, 0x4C60, iwl7260_2ac_cfg)}, 91 | {IWL_PCI_DEVICE(0x08B1, 0x4C70, iwl7260_2ac_cfg)}, 92 | {IWL_PCI_DEVICE(0x08B1, 0x4060, iwl7260_2n_cfg)}, 93 | {IWL_PCI_DEVICE(0x08B1, 0x406A, iwl7260_2n_cfg)}, 94 | {IWL_PCI_DEVICE(0x08B1, 0x4160, iwl7260_2n_cfg)}, 95 | {IWL_PCI_DEVICE(0x08B1, 0x4062, iwl7260_n_cfg)}, 96 | {IWL_PCI_DEVICE(0x08B1, 0x4162, iwl7260_n_cfg)}, 97 | {IWL_PCI_DEVICE(0x08B2, 0x4270, iwl7260_2ac_cfg)}, 98 | {IWL_PCI_DEVICE(0x08B2, 0x4272, iwl7260_2ac_cfg)}, 99 | {IWL_PCI_DEVICE(0x08B2, 0x4260, iwl7260_2n_cfg)}, 100 | {IWL_PCI_DEVICE(0x08B2, 0x426A, iwl7260_2n_cfg)}, 101 | {IWL_PCI_DEVICE(0x08B2, 0x4262, iwl7260_n_cfg)}, 102 | {IWL_PCI_DEVICE(0x08B1, 0x4470, iwl7260_2ac_cfg)}, 103 | {IWL_PCI_DEVICE(0x08B1, 0x4472, iwl7260_2ac_cfg)}, 104 | {IWL_PCI_DEVICE(0x08B1, 0x4460, iwl7260_2n_cfg)}, 105 | {IWL_PCI_DEVICE(0x08B1, 0x446A, iwl7260_2n_cfg)}, 106 | {IWL_PCI_DEVICE(0x08B1, 0x4462, iwl7260_n_cfg)}, 107 | {IWL_PCI_DEVICE(0x08B1, 0x4870, iwl7260_2ac_cfg)}, 108 | {IWL_PCI_DEVICE(0x08B1, 0x486E, iwl7260_2ac_cfg)}, 109 | {IWL_PCI_DEVICE(0x08B1, 0x4A70, iwl7260_2ac_cfg_high_temp)}, 110 | {IWL_PCI_DEVICE(0x08B1, 0x4A6E, iwl7260_2ac_cfg_high_temp)}, 111 | {IWL_PCI_DEVICE(0x08B1, 0x4A6C, iwl7260_2ac_cfg_high_temp)}, 112 | {IWL_PCI_DEVICE(0x08B1, 0x4570, iwl7260_2ac_cfg)}, 113 | {IWL_PCI_DEVICE(0x08B1, 0x4560, iwl7260_2n_cfg)}, 114 | {IWL_PCI_DEVICE(0x08B2, 0x4370, iwl7260_2ac_cfg)}, 115 | {IWL_PCI_DEVICE(0x08B2, 0x4360, iwl7260_2n_cfg)}, 116 | {IWL_PCI_DEVICE(0x08B1, 0x5070, iwl7260_2ac_cfg)}, 117 | {IWL_PCI_DEVICE(0x08B1, 0x5072, iwl7260_2ac_cfg)}, 118 | {IWL_PCI_DEVICE(0x08B1, 0x5170, iwl7260_2ac_cfg)}, 119 | {IWL_PCI_DEVICE(0x08B1, 0x5770, iwl7260_2ac_cfg)}, 120 | {IWL_PCI_DEVICE(0x08B1, 0x4020, iwl7260_2n_cfg)}, 121 | {IWL_PCI_DEVICE(0x08B1, 0x402A, iwl7260_2n_cfg)}, 122 | {IWL_PCI_DEVICE(0x08B2, 0x4220, iwl7260_2n_cfg)}, 123 | {IWL_PCI_DEVICE(0x08B1, 0x4420, iwl7260_2n_cfg)}, 124 | {IWL_PCI_DEVICE(0x08B1, 0xC070, iwl7260_2ac_cfg)}, 125 | {IWL_PCI_DEVICE(0x08B1, 0xC072, iwl7260_2ac_cfg)}, 126 | {IWL_PCI_DEVICE(0x08B1, 0xC170, iwl7260_2ac_cfg)}, 127 | {IWL_PCI_DEVICE(0x08B1, 0xC060, iwl7260_2n_cfg)}, 128 | {IWL_PCI_DEVICE(0x08B1, 0xC06A, iwl7260_2n_cfg)}, 129 | {IWL_PCI_DEVICE(0x08B1, 0xC160, iwl7260_2n_cfg)}, 130 | {IWL_PCI_DEVICE(0x08B1, 0xC062, iwl7260_n_cfg)}, 131 | {IWL_PCI_DEVICE(0x08B1, 0xC162, iwl7260_n_cfg)}, 132 | {IWL_PCI_DEVICE(0x08B1, 0xC770, iwl7260_2ac_cfg)}, 133 | {IWL_PCI_DEVICE(0x08B1, 0xC760, iwl7260_2n_cfg)}, 134 | {IWL_PCI_DEVICE(0x08B2, 0xC270, iwl7260_2ac_cfg)}, 135 | {IWL_PCI_DEVICE(0x08B1, 0xCC70, iwl7260_2ac_cfg)}, 136 | {IWL_PCI_DEVICE(0x08B1, 0xCC60, iwl7260_2ac_cfg)}, 137 | {IWL_PCI_DEVICE(0x08B2, 0xC272, iwl7260_2ac_cfg)}, 138 | {IWL_PCI_DEVICE(0x08B2, 0xC260, iwl7260_2n_cfg)}, 139 | {IWL_PCI_DEVICE(0x08B2, 0xC26A, iwl7260_n_cfg)}, 140 | {IWL_PCI_DEVICE(0x08B2, 0xC262, iwl7260_n_cfg)}, 141 | {IWL_PCI_DEVICE(0x08B1, 0xC470, iwl7260_2ac_cfg)}, 142 | {IWL_PCI_DEVICE(0x08B1, 0xC472, iwl7260_2ac_cfg)}, 143 | {IWL_PCI_DEVICE(0x08B1, 0xC460, iwl7260_2n_cfg)}, 144 | {IWL_PCI_DEVICE(0x08B1, 0xC462, iwl7260_n_cfg)}, 145 | {IWL_PCI_DEVICE(0x08B1, 0xC570, iwl7260_2ac_cfg)}, 146 | {IWL_PCI_DEVICE(0x08B1, 0xC560, iwl7260_2n_cfg)}, 147 | {IWL_PCI_DEVICE(0x08B2, 0xC370, iwl7260_2ac_cfg)}, 148 | {IWL_PCI_DEVICE(0x08B1, 0xC360, iwl7260_2n_cfg)}, 149 | {IWL_PCI_DEVICE(0x08B1, 0xC020, iwl7260_2n_cfg)}, 150 | {IWL_PCI_DEVICE(0x08B1, 0xC02A, iwl7260_2n_cfg)}, 151 | {IWL_PCI_DEVICE(0x08B2, 0xC220, iwl7260_2n_cfg)}, 152 | {IWL_PCI_DEVICE(0x08B1, 0xC420, iwl7260_2n_cfg)}, 153 | 154 | /* 3160 Series */ 155 | {IWL_PCI_DEVICE(0x08B3, 0x0070, iwl3160_2ac_cfg)}, 156 | {IWL_PCI_DEVICE(0x08B3, 0x0072, iwl3160_2ac_cfg)}, 157 | {IWL_PCI_DEVICE(0x08B3, 0x0170, iwl3160_2ac_cfg)}, 158 | {IWL_PCI_DEVICE(0x08B3, 0x0172, iwl3160_2ac_cfg)}, 159 | {IWL_PCI_DEVICE(0x08B3, 0x0060, iwl3160_2n_cfg)}, 160 | {IWL_PCI_DEVICE(0x08B3, 0x0062, iwl3160_n_cfg)}, 161 | {IWL_PCI_DEVICE(0x08B4, 0x0270, iwl3160_2ac_cfg)}, 162 | {IWL_PCI_DEVICE(0x08B4, 0x0272, iwl3160_2ac_cfg)}, 163 | {IWL_PCI_DEVICE(0x08B3, 0x0470, iwl3160_2ac_cfg)}, 164 | {IWL_PCI_DEVICE(0x08B3, 0x0472, iwl3160_2ac_cfg)}, 165 | {IWL_PCI_DEVICE(0x08B4, 0x0370, iwl3160_2ac_cfg)}, 166 | {IWL_PCI_DEVICE(0x08B3, 0x8070, iwl3160_2ac_cfg)}, 167 | {IWL_PCI_DEVICE(0x08B3, 0x8072, iwl3160_2ac_cfg)}, 168 | {IWL_PCI_DEVICE(0x08B3, 0x8170, iwl3160_2ac_cfg)}, 169 | {IWL_PCI_DEVICE(0x08B3, 0x8172, iwl3160_2ac_cfg)}, 170 | {IWL_PCI_DEVICE(0x08B3, 0x8060, iwl3160_2n_cfg)}, 171 | {IWL_PCI_DEVICE(0x08B3, 0x8062, iwl3160_n_cfg)}, 172 | {IWL_PCI_DEVICE(0x08B4, 0x8270, iwl3160_2ac_cfg)}, 173 | {IWL_PCI_DEVICE(0x08B4, 0x8370, iwl3160_2ac_cfg)}, 174 | {IWL_PCI_DEVICE(0x08B4, 0x8272, iwl3160_2ac_cfg)}, 175 | {IWL_PCI_DEVICE(0x08B3, 0x8470, iwl3160_2ac_cfg)}, 176 | {IWL_PCI_DEVICE(0x08B3, 0x8570, iwl3160_2ac_cfg)}, 177 | {IWL_PCI_DEVICE(0x08B3, 0x1070, iwl3160_2ac_cfg)}, 178 | {IWL_PCI_DEVICE(0x08B3, 0x1170, iwl3160_2ac_cfg)}, 179 | 180 | /* 3165 Series */ 181 | {IWL_PCI_DEVICE(0x3165, 0x4010, iwl3165_2ac_cfg)}, 182 | {IWL_PCI_DEVICE(0x3165, 0x4012, iwl3165_2ac_cfg)}, 183 | {IWL_PCI_DEVICE(0x3166, 0x4212, iwl3165_2ac_cfg)}, 184 | {IWL_PCI_DEVICE(0x3165, 0x4410, iwl3165_2ac_cfg)}, 185 | {IWL_PCI_DEVICE(0x3165, 0x4510, iwl3165_2ac_cfg)}, 186 | {IWL_PCI_DEVICE(0x3165, 0x4110, iwl3165_2ac_cfg)}, 187 | {IWL_PCI_DEVICE(0x3166, 0x4310, iwl3165_2ac_cfg)}, 188 | {IWL_PCI_DEVICE(0x3166, 0x4210, iwl3165_2ac_cfg)}, 189 | {IWL_PCI_DEVICE(0x3165, 0x8010, iwl3165_2ac_cfg)}, 190 | {IWL_PCI_DEVICE(0x3165, 0x8110, iwl3165_2ac_cfg)}, 191 | 192 | /* 7265 Series */ 193 | {IWL_PCI_DEVICE(0x095A, 0x5010, iwl7265_2ac_cfg)}, 194 | {IWL_PCI_DEVICE(0x095A, 0x5110, iwl7265_2ac_cfg)}, 195 | {IWL_PCI_DEVICE(0x095A, 0x5100, iwl7265_2ac_cfg)}, 196 | {IWL_PCI_DEVICE(0x095B, 0x5310, iwl7265_2ac_cfg)}, 197 | {IWL_PCI_DEVICE(0x095B, 0x5302, iwl7265_n_cfg)}, 198 | {IWL_PCI_DEVICE(0x095B, 0x5210, iwl7265_2ac_cfg)}, 199 | {IWL_PCI_DEVICE(0x095A, 0x5012, iwl7265_2ac_cfg)}, 200 | {IWL_PCI_DEVICE(0x095A, 0x5412, iwl7265_2ac_cfg)}, 201 | {IWL_PCI_DEVICE(0x095A, 0x5410, iwl7265_2ac_cfg)}, 202 | {IWL_PCI_DEVICE(0x095A, 0x5510, iwl7265_2ac_cfg)}, 203 | {IWL_PCI_DEVICE(0x095A, 0x5400, iwl7265_2ac_cfg)}, 204 | {IWL_PCI_DEVICE(0x095A, 0x1010, iwl7265_2ac_cfg)}, 205 | {IWL_PCI_DEVICE(0x095A, 0x5000, iwl7265_2n_cfg)}, 206 | {IWL_PCI_DEVICE(0x095A, 0x500A, iwl7265_2n_cfg)}, 207 | {IWL_PCI_DEVICE(0x095B, 0x5200, iwl7265_2n_cfg)}, 208 | {IWL_PCI_DEVICE(0x095A, 0x5002, iwl7265_n_cfg)}, 209 | {IWL_PCI_DEVICE(0x095A, 0x5102, iwl7265_n_cfg)}, 210 | {IWL_PCI_DEVICE(0x095B, 0x5202, iwl7265_n_cfg)}, 211 | {IWL_PCI_DEVICE(0x095A, 0x9010, iwl7265_2ac_cfg)}, 212 | {IWL_PCI_DEVICE(0x095A, 0x9012, iwl7265_2ac_cfg)}, 213 | {IWL_PCI_DEVICE(0x095A, 0x900A, iwl7265_2ac_cfg)}, 214 | {IWL_PCI_DEVICE(0x095A, 0x9110, iwl7265_2ac_cfg)}, 215 | {IWL_PCI_DEVICE(0x095A, 0x9112, iwl7265_2ac_cfg)}, 216 | {IWL_PCI_DEVICE(0x095A, 0x9210, iwl7265_2ac_cfg)}, 217 | {IWL_PCI_DEVICE(0x095B, 0x9200, iwl7265_2ac_cfg)}, 218 | {IWL_PCI_DEVICE(0x095A, 0x9510, iwl7265_2ac_cfg)}, 219 | {IWL_PCI_DEVICE(0x095A, 0x9310, iwl7265_2ac_cfg)}, 220 | {IWL_PCI_DEVICE(0x095A, 0x9410, iwl7265_2ac_cfg)}, 221 | {IWL_PCI_DEVICE(0x095A, 0x5020, iwl7265_2n_cfg)}, 222 | {IWL_PCI_DEVICE(0x095A, 0x502A, iwl7265_2n_cfg)}, 223 | {IWL_PCI_DEVICE(0x095A, 0x5420, iwl7265_2n_cfg)}, 224 | {IWL_PCI_DEVICE(0x095A, 0x5090, iwl7265_2ac_cfg)}, 225 | {IWL_PCI_DEVICE(0x095A, 0x5190, iwl7265_2ac_cfg)}, 226 | {IWL_PCI_DEVICE(0x095A, 0x5590, iwl7265_2ac_cfg)}, 227 | {IWL_PCI_DEVICE(0x095B, 0x5290, iwl7265_2ac_cfg)}, 228 | {IWL_PCI_DEVICE(0x095A, 0x5490, iwl7265_2ac_cfg)}, 229 | {IWL_PCI_DEVICE(0x095A, 0x5F10, iwl7265_2ac_cfg)}, 230 | {IWL_PCI_DEVICE(0x095B, 0x5212, iwl7265_2ac_cfg)}, 231 | {IWL_PCI_DEVICE(0x095B, 0x520A, iwl7265_2ac_cfg)}, 232 | {IWL_PCI_DEVICE(0x095A, 0x9000, iwl7265_2ac_cfg)}, 233 | {IWL_PCI_DEVICE(0x095A, 0x9400, iwl7265_2ac_cfg)}, 234 | 235 | /* 8000 Series */ 236 | {IWL_PCI_DEVICE(0x24F3, 0x0010, iwl8260_2ac_cfg)}, 237 | {IWL_PCI_DEVICE(0x24F3, 0x1010, iwl8260_2ac_cfg)}, 238 | {IWL_PCI_DEVICE(0x24F3, 0x0130, iwl8260_2ac_cfg)}, 239 | {IWL_PCI_DEVICE(0x24F3, 0x1130, iwl8260_2ac_cfg)}, 240 | {IWL_PCI_DEVICE(0x24F3, 0x0132, iwl8260_2ac_cfg)}, 241 | {IWL_PCI_DEVICE(0x24F3, 0x1132, iwl8260_2ac_cfg)}, 242 | {IWL_PCI_DEVICE(0x24F3, 0x0110, iwl8260_2ac_cfg)}, 243 | {IWL_PCI_DEVICE(0x24F3, 0x01F0, iwl8260_2ac_cfg)}, 244 | {IWL_PCI_DEVICE(0x24F3, 0x0012, iwl8260_2ac_cfg)}, 245 | {IWL_PCI_DEVICE(0x24F3, 0x1012, iwl8260_2ac_cfg)}, 246 | {IWL_PCI_DEVICE(0x24F3, 0x1110, iwl8260_2ac_cfg)}, 247 | {IWL_PCI_DEVICE(0x24F3, 0x0050, iwl8260_2ac_cfg)}, 248 | {IWL_PCI_DEVICE(0x24F3, 0x0250, iwl8260_2ac_cfg)}, 249 | {IWL_PCI_DEVICE(0x24F3, 0x1050, iwl8260_2ac_cfg)}, 250 | {IWL_PCI_DEVICE(0x24F3, 0x0150, iwl8260_2ac_cfg)}, 251 | {IWL_PCI_DEVICE(0x24F3, 0x1150, iwl8260_2ac_cfg)}, 252 | {IWL_PCI_DEVICE(0x24F4, 0x0030, iwl8260_2ac_cfg)}, 253 | {IWL_PCI_DEVICE(0x24F4, 0x1030, iwl8260_2ac_cfg)}, 254 | {IWL_PCI_DEVICE(0x24F3, 0xC010, iwl8260_2ac_cfg)}, 255 | {IWL_PCI_DEVICE(0x24F3, 0xC110, iwl8260_2ac_cfg)}, 256 | {IWL_PCI_DEVICE(0x24F3, 0xD010, iwl8260_2ac_cfg)}, 257 | {IWL_PCI_DEVICE(0x24F3, 0xC050, iwl8260_2ac_cfg)}, 258 | {IWL_PCI_DEVICE(0x24F3, 0xD050, iwl8260_2ac_cfg)}, 259 | {IWL_PCI_DEVICE(0x24F3, 0x8010, iwl8260_2ac_cfg)}, 260 | {IWL_PCI_DEVICE(0x24F3, 0x8110, iwl8260_2ac_cfg)}, 261 | {IWL_PCI_DEVICE(0x24F3, 0x9010, iwl8260_2ac_cfg)}, 262 | {IWL_PCI_DEVICE(0x24F3, 0x9110, iwl8260_2ac_cfg)}, 263 | {IWL_PCI_DEVICE(0x24F4, 0x8030, iwl8260_2ac_cfg)}, 264 | {IWL_PCI_DEVICE(0x24F4, 0x9030, iwl8260_2ac_cfg)}, 265 | {IWL_PCI_DEVICE(0x24F3, 0x8130, iwl8260_2ac_cfg)}, 266 | {IWL_PCI_DEVICE(0x24F3, 0x9130, iwl8260_2ac_cfg)}, 267 | {IWL_PCI_DEVICE(0x24F3, 0x8132, iwl8260_2ac_cfg)}, 268 | {IWL_PCI_DEVICE(0x24F3, 0x9132, iwl8260_2ac_cfg)}, 269 | {IWL_PCI_DEVICE(0x24F3, 0x8050, iwl8260_2ac_cfg)}, 270 | {IWL_PCI_DEVICE(0x24F3, 0x8150, iwl8260_2ac_cfg)}, 271 | {IWL_PCI_DEVICE(0x24F3, 0x9050, iwl8260_2ac_cfg)}, 272 | {IWL_PCI_DEVICE(0x24F3, 0x9150, iwl8260_2ac_cfg)}, 273 | {IWL_PCI_DEVICE(0x24F3, 0x0004, iwl8260_2n_cfg)}, 274 | {IWL_PCI_DEVICE(0x24F3, 0x0044, iwl8260_2n_cfg)}, 275 | {IWL_PCI_DEVICE(0x24F5, 0x0010, iwl4165_2ac_cfg)}, 276 | {IWL_PCI_DEVICE(0x24F6, 0x0030, iwl4165_2ac_cfg)}, 277 | {IWL_PCI_DEVICE(0x24F3, 0x0810, iwl8260_2ac_cfg)}, 278 | {IWL_PCI_DEVICE(0x24F3, 0x0910, iwl8260_2ac_cfg)}, 279 | {IWL_PCI_DEVICE(0x24F3, 0x0850, iwl8260_2ac_cfg)}, 280 | {IWL_PCI_DEVICE(0x24F3, 0x0950, iwl8260_2ac_cfg)}, 281 | {IWL_PCI_DEVICE(0x24F3, 0x0930, iwl8260_2ac_cfg)} 282 | }; 283 | 284 | #endif -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/linux/firmware-defs.h: -------------------------------------------------------------------------------- 1 | // 2 | // firmware-defs.h 3 | // AppleIntelWiFiMVM 4 | // 5 | // Created by Aaron Mulder on 2/13/16. 6 | // Copyright © 2016 Aaron Mulder. All rights reserved. 7 | // 8 | 9 | #ifndef firmware_defs_h 10 | #define firmware_defs_h 11 | 12 | #include "linux-porting.h" 13 | #include "linux-80211.h" 14 | #include "iwl-fw-error-dump.h" 15 | //#include "iwl-trans.h" 16 | 17 | #define IWL_DEBUG_INFO(drv, args...) IOLog(args) 18 | #define IWL_ERR(drv, args...) IOLog(args) 19 | #define IWL_INFO(drv, args...) IOLog(args) 20 | #define IWL_DEBUG_FW(drv, args...) IOLog(args) 21 | #define iwl_print_hex_dump(m, level, p, len) IOLog("%s Unable to print hex dump; see iwl-debug.h", "AppleIntelWiFiMVM") 22 | 23 | 24 | // Bitwise int types 25 | typedef unsigned int /*__bitwise__*/ iwl_ucode_tlv_api_t; 26 | typedef unsigned int /*__bitwise__*/ iwl_ucode_tlv_capa_t; 27 | 28 | // from uapi/linux/ethtool.h 29 | #define ETHTOOL_FWVERS_LEN 32 30 | 31 | /* 32 | * For 16.0 uCode and above, there is no differentiation between sections, 33 | * just an offset to the HW address. 34 | */ 35 | #define IWL_UCODE_SECTION_MAX 16 36 | #define CPU1_CPU2_SEPARATOR_SECTION 0xFFFFCCCC 37 | #define PAGING_SEPARATOR_SECTION 0xAAAABBBB 38 | 39 | /* uCode version contains 4 values: Major/Minor/API/Serial */ 40 | #define IWL_UCODE_MAJOR(ver) (((ver) & 0xFF000000) >> 24) 41 | #define IWL_UCODE_MINOR(ver) (((ver) & 0x00FF0000) >> 16) 42 | #define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8) 43 | #define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF) 44 | 45 | #define IWL_UCODE_MAX_CS 1 46 | #define IWL_TLV_UCODE_MAGIC 0x0a4c5749 47 | 48 | /* The default max probe length if not specified by the firmware file */ 49 | #define IWL_DEFAULT_MAX_PROBE_LENGTH 200 50 | 51 | /* The default calibrate table size if not specified by firmware file */ 52 | #define IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE 18 53 | #define IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE 19 54 | #define IWL_MAX_PHY_CALIBRATE_TBL_SIZE 253 55 | 56 | #define IWL_DEFAULT_SCAN_CHANNELS 40 57 | 58 | #define UCODE_EXPERIMENTAL_INDEX 100 59 | #define UCODE_EXPERIMENTAL_TAG "exp" 60 | 61 | #define FW_DBG_START_FROM_ALIVE 0 62 | #define FW_DBG_CONF_MAX 32 63 | #define FW_DBG_INVALID 0xff 64 | 65 | /* 66 | * Block paging calculations 67 | */ 68 | #define PAGE_2_EXP_SIZE 12 /* 4K == 2^12 */ 69 | #define FW_PAGING_SIZE BIT(PAGE_2_EXP_SIZE) /* page size is 4KB */ 70 | #define PAGE_PER_GROUP_2_EXP_SIZE 3 71 | /* 8 pages per group */ 72 | #define NUM_OF_PAGE_PER_GROUP BIT(PAGE_PER_GROUP_2_EXP_SIZE) 73 | /* don't change, support only 32KB size */ 74 | #define PAGING_BLOCK_SIZE (NUM_OF_PAGE_PER_GROUP * FW_PAGING_SIZE) 75 | /* 32K == 2^15 */ 76 | #define BLOCK_2_EXP_SIZE (PAGE_2_EXP_SIZE + PAGE_PER_GROUP_2_EXP_SIZE) 77 | 78 | /* 79 | * Image paging calculations 80 | */ 81 | #define BLOCK_PER_IMAGE_2_EXP_SIZE 5 82 | /* 2^5 == 32 blocks per image */ 83 | #define NUM_OF_BLOCK_PER_IMAGE BIT(BLOCK_PER_IMAGE_2_EXP_SIZE) 84 | /* maximum image size 1024KB */ 85 | #define MAX_PAGING_IMAGE_SIZE (NUM_OF_BLOCK_PER_IMAGE * PAGING_BLOCK_SIZE) 86 | 87 | 88 | /** 89 | * enum iwl_ucode_type 90 | * 91 | * The type of ucode. 92 | * 93 | * @IWL_UCODE_REGULAR: Normal runtime ucode 94 | * @IWL_UCODE_INIT: Initial ucode 95 | * @IWL_UCODE_WOWLAN: Wake on Wireless enabled ucode 96 | * @IWL_UCODE_REGULAR_USNIFFER: Normal runtime ucode when using usniffer image 97 | */ 98 | enum iwl_ucode_type { 99 | IWL_UCODE_REGULAR, 100 | IWL_UCODE_INIT, 101 | IWL_UCODE_WOWLAN, 102 | IWL_UCODE_REGULAR_USNIFFER, 103 | IWL_UCODE_TYPE_MAX, 104 | }; 105 | 106 | /* 107 | * enumeration of ucode section. 108 | * This enumeration is used directly for older firmware (before 16.0). 109 | * For new firmware, there can be up to 4 sections (see below) but the 110 | * first one packaged into the firmware file is the DATA section and 111 | * some debugging code accesses that. 112 | */ 113 | enum iwl_ucode_sec { 114 | IWL_UCODE_SECTION_DATA, 115 | IWL_UCODE_SECTION_INST, 116 | }; 117 | 118 | /* 119 | * Calibration control struct. 120 | * Sent as part of the phy configuration command. 121 | * @flow_trigger: bitmap for which calibrations to perform according to 122 | * flow triggers. 123 | * @event_trigger: bitmap for which calibrations to perform according to 124 | * event triggers. 125 | */ 126 | #pragma pack(1) 127 | struct iwl_tlv_calib_ctrl { 128 | __le32 flow_trigger; 129 | __le32 event_trigger; 130 | } /*__packed*/; 131 | #pragma options align=reset 132 | 133 | /* one for each uCode image (inst/data, init/runtime/wowlan) */ 134 | struct fw_desc { 135 | void *data; /* vmalloc'ed data */ 136 | size_t len; /* size in bytes */ 137 | u32 offset; /* offset in the device */ 138 | }; 139 | 140 | 141 | struct fw_img { 142 | struct fw_desc sec[IWL_UCODE_SECTION_MAX]; 143 | bool is_dual_cpus; 144 | u32 paging_mem_size; 145 | }; 146 | 147 | /** 148 | * enum iwl_ucode_tlv_capa - ucode capabilities 149 | * @IWL_UCODE_TLV_CAPA_D0I3_SUPPORT: supports D0i3 150 | * @IWL_UCODE_TLV_CAPA_LAR_SUPPORT: supports Location Aware Regulatory 151 | * @IWL_UCODE_TLV_CAPA_UMAC_SCAN: supports UMAC scan. 152 | * @IWL_UCODE_TLV_CAPA_BEAMFORMER: supports Beamformer 153 | * @IWL_UCODE_TLV_CAPA_TOF_SUPPORT: supports Time of Flight (802.11mc FTM) 154 | * @IWL_UCODE_TLV_CAPA_TDLS_SUPPORT: support basic TDLS functionality 155 | * @IWL_UCODE_TLV_CAPA_TXPOWER_INSERTION_SUPPORT: supports insertion of current 156 | * tx power value into TPC Report action frame and Link Measurement Report 157 | * action frame 158 | * @IWL_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT: supports updating current 159 | * channel in DS parameter set element in probe requests. 160 | * @IWL_UCODE_TLV_CAPA_WFA_TPC_REP_IE_SUPPORT: supports adding TPC Report IE in 161 | * probe requests. 162 | * @IWL_UCODE_TLV_CAPA_QUIET_PERIOD_SUPPORT: supports Quiet Period requests 163 | * @IWL_UCODE_TLV_CAPA_DQA_SUPPORT: supports dynamic queue allocation (DQA), 164 | * which also implies support for the scheduler configuration command 165 | * @IWL_UCODE_TLV_CAPA_TDLS_CHANNEL_SWITCH: supports TDLS channel switching 166 | * @IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT: supports Hot Spot Command 167 | * @IWL_UCODE_TLV_CAPA_DC2DC_SUPPORT: supports DC2DC Command 168 | * @IWL_UCODE_TLV_CAPA_CSUM_SUPPORT: supports TCP Checksum Offload 169 | * @IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS: support radio and beacon statistics 170 | * @IWL_UCODE_TLV_CAPA_BT_COEX_PLCR: enabled BT Coex packet level co-running 171 | * @IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC: ucode supports LAR updates with different 172 | * sources for the MCC. This TLV bit is a future replacement to 173 | * IWL_UCODE_TLV_API_WIFI_MCC_UPDATE. When either is set, multi-source LAR 174 | * is supported. 175 | * @IWL_UCODE_TLV_CAPA_BT_COEX_RRC: supports BT Coex RRC 176 | * @IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT: supports gscan 177 | * @IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE: extended DTS measurement 178 | * @IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS: supports short PM timeouts 179 | * 180 | * @NUM_IWL_UCODE_TLV_CAPA: number of bits used 181 | */ 182 | enum iwl_ucode_tlv_capa { 183 | IWL_UCODE_TLV_CAPA_D0I3_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)0, 184 | IWL_UCODE_TLV_CAPA_LAR_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)1, 185 | IWL_UCODE_TLV_CAPA_UMAC_SCAN = (/*__force__*/ iwl_ucode_tlv_capa_t)2, 186 | IWL_UCODE_TLV_CAPA_BEAMFORMER = (/*__force__*/ iwl_ucode_tlv_capa_t)3, 187 | IWL_UCODE_TLV_CAPA_TOF_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)5, 188 | IWL_UCODE_TLV_CAPA_TDLS_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)6, 189 | IWL_UCODE_TLV_CAPA_TXPOWER_INSERTION_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)8, 190 | IWL_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)9, 191 | IWL_UCODE_TLV_CAPA_WFA_TPC_REP_IE_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)10, 192 | IWL_UCODE_TLV_CAPA_QUIET_PERIOD_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)11, 193 | IWL_UCODE_TLV_CAPA_DQA_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)12, 194 | IWL_UCODE_TLV_CAPA_TDLS_CHANNEL_SWITCH = (/*__force__*/ iwl_ucode_tlv_capa_t)13, 195 | IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)18, 196 | IWL_UCODE_TLV_CAPA_DC2DC_CONFIG_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)19, 197 | IWL_UCODE_TLV_CAPA_CSUM_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)21, 198 | IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS = (/*__force__*/ iwl_ucode_tlv_capa_t)22, 199 | IWL_UCODE_TLV_CAPA_BT_COEX_PLCR = (/*__force__*/ iwl_ucode_tlv_capa_t)28, 200 | IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC = (/*__force__*/ iwl_ucode_tlv_capa_t)29, 201 | IWL_UCODE_TLV_CAPA_BT_COEX_RRC = (/*__force__*/ iwl_ucode_tlv_capa_t)30, 202 | IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT = (/*__force__*/ iwl_ucode_tlv_capa_t)31, 203 | IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE = (/*__force__*/ iwl_ucode_tlv_capa_t)64, 204 | IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS = (/*__force__*/ iwl_ucode_tlv_capa_t)65, 205 | 206 | NUM_IWL_UCODE_TLV_CAPA 207 | }; 208 | 209 | 210 | /** 211 | * enum iwl_ucode_tlv_api - ucode api 212 | * @IWL_UCODE_TLV_API_BT_COEX_SPLIT: new API for BT Coex 213 | * @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time 214 | * longer than the passive one, which is essential for fragmented scan. 215 | * @IWL_UCODE_TLV_API_WIFI_MCC_UPDATE: ucode supports MCC updates with source. 216 | * @IWL_UCODE_TLV_API_WIDE_CMD_HDR: ucode supports wide command header 217 | * @IWL_UCODE_TLV_API_LQ_SS_PARAMS: Configure STBC/BFER via LQ CMD ss_params 218 | * @IWL_UCODE_TLV_API_NEW_VERSION: new versioning format 219 | * @IWL_UCODE_TLV_API_EXT_SCAN_PRIORITY: scan APIs use 8-level priority 220 | * instead of 3. 221 | * @IWL_UCODE_TLV_API_TX_POWER_CHAIN: TX power API has larger command size 222 | * (command version 3) that supports per-chain limits 223 | * 224 | * @NUM_IWL_UCODE_TLV_API: number of bits used 225 | */ 226 | enum iwl_ucode_tlv_api { 227 | IWL_UCODE_TLV_API_BT_COEX_SPLIT = (/*__force*/ iwl_ucode_tlv_api_t)3, 228 | IWL_UCODE_TLV_API_FRAGMENTED_SCAN = (/*__force*/ iwl_ucode_tlv_api_t)8, 229 | IWL_UCODE_TLV_API_WIFI_MCC_UPDATE = (/*__force*/ iwl_ucode_tlv_api_t)9, 230 | IWL_UCODE_TLV_API_WIDE_CMD_HDR = (/*__force*/ iwl_ucode_tlv_api_t)14, 231 | IWL_UCODE_TLV_API_LQ_SS_PARAMS = (/*__force*/ iwl_ucode_tlv_api_t)18, 232 | IWL_UCODE_TLV_API_NEW_VERSION = (/*__force*/ iwl_ucode_tlv_api_t)20, 233 | IWL_UCODE_TLV_API_EXT_SCAN_PRIORITY = (/*__force*/ iwl_ucode_tlv_api_t)24, 234 | IWL_UCODE_TLV_API_TX_POWER_CHAIN = (/*__force*/ iwl_ucode_tlv_api_t)27, 235 | 236 | NUM_IWL_UCODE_TLV_API 237 | }; 238 | 239 | struct iwl_ucode_capabilities { 240 | u32 max_probe_length; 241 | u32 n_scan_channels; 242 | u32 standard_phy_calibration_size; 243 | u32 flags; 244 | unsigned long _api[BITS_TO_LONGS(NUM_IWL_UCODE_TLV_API)]; 245 | unsigned long _capa[BITS_TO_LONGS(NUM_IWL_UCODE_TLV_CAPA)]; 246 | }; 247 | 248 | /** 249 | * enum iwl_fw_dbg_monitor_mode - available monitor recording modes 250 | * 251 | * @SMEM_MODE: monitor stores the data in SMEM 252 | * @EXTERNAL_MODE: monitor stores the data in allocated DRAM 253 | * @MARBH_MODE: monitor stores the data in MARBH buffer 254 | * @MIPI_MODE: monitor outputs the data through the MIPI interface 255 | */ 256 | enum iwl_fw_dbg_monitor_mode { 257 | SMEM_MODE = 0, 258 | EXTERNAL_MODE = 1, 259 | MARBH_MODE = 2, 260 | MIPI_MODE = 3, 261 | }; 262 | 263 | static inline bool 264 | fw_has_api(const struct iwl_ucode_capabilities *capabilities, 265 | iwl_ucode_tlv_api_t api) 266 | { 267 | return test_bit(/*(__force long)*/api, capabilities->_api); 268 | } 269 | 270 | static inline bool 271 | fw_has_capa(const struct iwl_ucode_capabilities *capabilities, 272 | iwl_ucode_tlv_capa_t capa) 273 | { 274 | return test_bit(/*(__force long)*/capa, capabilities->_capa); 275 | } 276 | 277 | static inline const char *get_fw_dbg_mode_string(int mode) 278 | { 279 | switch (mode) { 280 | case SMEM_MODE: 281 | return "SMEM"; 282 | case EXTERNAL_MODE: 283 | return "EXTERNAL_DRAM"; 284 | case MARBH_MODE: 285 | return "MARBH"; 286 | case MIPI_MODE: 287 | return "MIPI"; 288 | default: 289 | return "UNKNOWN"; 290 | } 291 | } 292 | 293 | 294 | 295 | /** 296 | * struct iwl_gscan_capabilities - gscan capabilities supported by FW 297 | * @max_scan_cache_size: total space allocated for scan results (in bytes). 298 | * @max_scan_buckets: maximum number of channel buckets. 299 | * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan. 300 | * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI. 301 | * @max_scan_reporting_threshold: max possible report threshold. in percentage. 302 | * @max_hotlist_aps: maximum number of entries for hotlist APs. 303 | * @max_significant_change_aps: maximum number of entries for significant 304 | * change APs. 305 | * @max_bssid_history_entries: number of BSSID/RSSI entries that the device can 306 | * hold. 307 | */ 308 | struct iwl_gscan_capabilities { 309 | u32 max_scan_cache_size; 310 | u32 max_scan_buckets; 311 | u32 max_ap_cache_per_scan; 312 | u32 max_rssi_sample_size; 313 | u32 max_scan_reporting_threshold; 314 | u32 max_hotlist_aps; 315 | u32 max_significant_change_aps; 316 | u32 max_bssid_history_entries; 317 | }; 318 | 319 | /* 320 | * struct fw_sec: Just for the image parsing process. 321 | * For the fw storage we are using struct fw_desc. 322 | */ 323 | struct fw_sec { 324 | const void *data; /* the sec data */ 325 | size_t size; /* section size */ 326 | u32 offset; /* offset of writing in the device */ 327 | }; 328 | 329 | struct fw_img_parsing { 330 | struct fw_sec sec[IWL_UCODE_SECTION_MAX]; 331 | int sec_counter; 332 | }; 333 | 334 | struct iwl_firmware_pieces { 335 | struct fw_img_parsing img[IWL_UCODE_TYPE_MAX]; 336 | 337 | u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr; 338 | u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr; 339 | 340 | /* FW debug data parsed for driver usage */ 341 | struct iwl_fw_dbg_dest_tlv *dbg_dest_tlv; 342 | struct iwl_fw_dbg_conf_tlv *dbg_conf_tlv[FW_DBG_CONF_MAX]; 343 | size_t dbg_conf_tlv_len[FW_DBG_CONF_MAX]; 344 | struct iwl_fw_dbg_trigger_tlv *dbg_trigger_tlv[FW_DBG_TRIGGER_MAX]; 345 | size_t dbg_trigger_tlv_len[FW_DBG_TRIGGER_MAX]; 346 | }; 347 | 348 | /** 349 | * struct iwl_fw_dbg_reg_op - an operation on a register 350 | * 351 | * @op: %enum iwl_fw_dbg_reg_operator 352 | * @addr: offset of the register 353 | * @val: value 354 | */ 355 | #pragma pack(1) 356 | struct iwl_fw_dbg_reg_op { 357 | u8 op; 358 | u8 reserved[3]; 359 | __le32 addr; 360 | __le32 val; 361 | };// __packed; 362 | 363 | /** 364 | * struct iwl_fw_dbg_dest_tlv - configures the destination of the debug data 365 | * 366 | * @version: version of the TLV - currently 0 367 | * @monitor_mode: %enum iwl_fw_dbg_monitor_mode 368 | * @size_power: buffer size will be 2^(size_power + 11) 369 | * @base_reg: addr of the base addr register (PRPH) 370 | * @end_reg: addr of the end addr register (PRPH) 371 | * @write_ptr_reg: the addr of the reg of the write pointer 372 | * @wrap_count: the addr of the reg of the wrap_count 373 | * @base_shift: shift right of the base addr reg 374 | * @end_shift: shift right of the end addr reg 375 | * @reg_ops: array of registers operations 376 | * 377 | * This parses IWL_UCODE_TLV_FW_DBG_DEST 378 | */ 379 | struct iwl_fw_dbg_dest_tlv { 380 | u8 version; 381 | u8 monitor_mode; 382 | u8 size_power; 383 | u8 reserved; 384 | __le32 base_reg; 385 | __le32 end_reg; 386 | __le32 write_ptr_reg; 387 | __le32 wrap_count; 388 | u8 base_shift; 389 | u8 end_shift; 390 | struct iwl_fw_dbg_reg_op reg_ops[0]; 391 | };// __packed; 392 | #pragma options align=reset 393 | 394 | #pragma pack(1) 395 | struct iwl_fw_dbg_conf_hcmd { 396 | u8 id; 397 | u8 reserved; 398 | __le16 len; 399 | u8 data[0]; 400 | };// __packed; 401 | #pragma options align=reset 402 | 403 | /** 404 | * enum iwl_fw_dbg_trigger_mode - triggers functionalities 405 | * 406 | * @IWL_FW_DBG_TRIGGER_START: when trigger occurs re-conf the dbg mechanism 407 | * @IWL_FW_DBG_TRIGGER_STOP: when trigger occurs pull the dbg data 408 | * @IWL_FW_DBG_TRIGGER_MONITOR_ONLY: when trigger occurs trigger is set to 409 | * collect only monitor data 410 | */ 411 | enum iwl_fw_dbg_trigger_mode { 412 | IWL_FW_DBG_TRIGGER_START = BIT(0), 413 | IWL_FW_DBG_TRIGGER_STOP = BIT(1), 414 | IWL_FW_DBG_TRIGGER_MONITOR_ONLY = BIT(2), 415 | }; 416 | 417 | /** 418 | * enum iwl_fw_dbg_trigger_vif_type - define the VIF type for a trigger 419 | * @IWL_FW_DBG_CONF_VIF_ANY: any vif type 420 | * @IWL_FW_DBG_CONF_VIF_IBSS: IBSS mode 421 | * @IWL_FW_DBG_CONF_VIF_STATION: BSS mode 422 | * @IWL_FW_DBG_CONF_VIF_AP: AP mode 423 | * @IWL_FW_DBG_CONF_VIF_P2P_CLIENT: P2P Client mode 424 | * @IWL_FW_DBG_CONF_VIF_P2P_GO: P2P GO mode 425 | * @IWL_FW_DBG_CONF_VIF_P2P_DEVICE: P2P device 426 | */ 427 | enum iwl_fw_dbg_trigger_vif_type { 428 | IWL_FW_DBG_CONF_VIF_ANY = NL80211_IFTYPE_UNSPECIFIED, 429 | IWL_FW_DBG_CONF_VIF_IBSS = NL80211_IFTYPE_ADHOC, 430 | IWL_FW_DBG_CONF_VIF_STATION = NL80211_IFTYPE_STATION, 431 | IWL_FW_DBG_CONF_VIF_AP = NL80211_IFTYPE_AP, 432 | IWL_FW_DBG_CONF_VIF_P2P_CLIENT = NL80211_IFTYPE_P2P_CLIENT, 433 | IWL_FW_DBG_CONF_VIF_P2P_GO = NL80211_IFTYPE_P2P_GO, 434 | IWL_FW_DBG_CONF_VIF_P2P_DEVICE = NL80211_IFTYPE_P2P_DEVICE, 435 | }; 436 | 437 | /** 438 | * struct iwl_fw_dbg_trigger_tlv - a TLV that describes the trigger 439 | * @id: %enum iwl_fw_dbg_trigger 440 | * @vif_type: %enum iwl_fw_dbg_trigger_vif_type 441 | * @stop_conf_ids: bitmap of configurations this trigger relates to. 442 | * if the mode is %IWL_FW_DBG_TRIGGER_STOP, then if the bit corresponding 443 | * to the currently running configuration is set, the data should be 444 | * collected. 445 | * @stop_delay: how many milliseconds to wait before collecting the data 446 | * after the STOP trigger fires. 447 | * @mode: %enum iwl_fw_dbg_trigger_mode - can be stop / start of both 448 | * @start_conf_id: if mode is %IWL_FW_DBG_TRIGGER_START, this defines what 449 | * configuration should be applied when the triggers kicks in. 450 | * @occurrences: number of occurrences. 0 means the trigger will never fire. 451 | */ 452 | #pragma pack(1) 453 | struct iwl_fw_dbg_trigger_tlv { 454 | __le32 id; 455 | __le32 vif_type; 456 | __le32 stop_conf_ids; 457 | __le32 stop_delay; 458 | u8 mode; 459 | u8 start_conf_id; 460 | __le16 occurrences; 461 | __le32 reserved[2]; 462 | 463 | u8 data[0]; 464 | };// __packed; 465 | 466 | /** 467 | * struct iwl_fw_dbg_trigger_missed_bcon - configures trigger for missed beacons 468 | * @stop_consec_missed_bcon: stop recording if threshold is crossed. 469 | * @stop_consec_missed_bcon_since_rx: stop recording if threshold is crossed. 470 | * @start_consec_missed_bcon: start recording if threshold is crossed. 471 | * @start_consec_missed_bcon_since_rx: start recording if threshold is crossed. 472 | * @reserved1: reserved 473 | * @reserved2: reserved 474 | */ 475 | struct iwl_fw_dbg_trigger_missed_bcon { 476 | __le32 stop_consec_missed_bcon; 477 | __le32 stop_consec_missed_bcon_since_rx; 478 | __le32 reserved2[2]; 479 | __le32 start_consec_missed_bcon; 480 | __le32 start_consec_missed_bcon_since_rx; 481 | __le32 reserved1[2]; 482 | };// __packed; 483 | 484 | /** 485 | * struct iwl_fw_dbg_trigger_cmd - configures trigger for messages from FW. 486 | * cmds: the list of commands to trigger the collection on 487 | */ 488 | struct iwl_fw_dbg_trigger_cmd { 489 | struct cmd { 490 | u8 cmd_id; 491 | u8 group_id; 492 | } /*__packed*/ cmds[16]; 493 | };// __packed; 494 | 495 | /** 496 | * iwl_fw_dbg_trigger_stats - configures trigger for statistics 497 | * @stop_offset: the offset of the value to be monitored 498 | * @stop_threshold: the threshold above which to collect 499 | * @start_offset: the offset of the value to be monitored 500 | * @start_threshold: the threshold above which to start recording 501 | */ 502 | struct iwl_fw_dbg_trigger_stats { 503 | __le32 stop_offset; 504 | __le32 stop_threshold; 505 | __le32 start_offset; 506 | __le32 start_threshold; 507 | };// __packed; 508 | 509 | /** 510 | * struct iwl_fw_dbg_trigger_low_rssi - trigger for low beacon RSSI 511 | * @rssi: RSSI value to trigger at 512 | */ 513 | struct iwl_fw_dbg_trigger_low_rssi { 514 | __le32 rssi; 515 | };// __packed; 516 | 517 | /** 518 | * struct iwl_fw_dbg_trigger_mlme - configures trigger for mlme events 519 | * @stop_auth_denied: number of denied authentication to collect 520 | * @stop_auth_timeout: number of authentication timeout to collect 521 | * @stop_rx_deauth: number of Rx deauth before to collect 522 | * @stop_tx_deauth: number of Tx deauth before to collect 523 | * @stop_assoc_denied: number of denied association to collect 524 | * @stop_assoc_timeout: number of association timeout to collect 525 | * @stop_connection_loss: number of connection loss to collect 526 | * @start_auth_denied: number of denied authentication to start recording 527 | * @start_auth_timeout: number of authentication timeout to start recording 528 | * @start_rx_deauth: number of Rx deauth to start recording 529 | * @start_tx_deauth: number of Tx deauth to start recording 530 | * @start_assoc_denied: number of denied association to start recording 531 | * @start_assoc_timeout: number of association timeout to start recording 532 | * @start_connection_loss: number of connection loss to start recording 533 | */ 534 | struct iwl_fw_dbg_trigger_mlme { 535 | u8 stop_auth_denied; 536 | u8 stop_auth_timeout; 537 | u8 stop_rx_deauth; 538 | u8 stop_tx_deauth; 539 | 540 | u8 stop_assoc_denied; 541 | u8 stop_assoc_timeout; 542 | u8 stop_connection_loss; 543 | u8 reserved; 544 | 545 | u8 start_auth_denied; 546 | u8 start_auth_timeout; 547 | u8 start_rx_deauth; 548 | u8 start_tx_deauth; 549 | 550 | u8 start_assoc_denied; 551 | u8 start_assoc_timeout; 552 | u8 start_connection_loss; 553 | u8 reserved2; 554 | };// __packed; 555 | 556 | /** 557 | * struct iwl_fw_dbg_trigger_txq_timer - configures the Tx queue's timer 558 | * @command_queue: timeout for the command queue in ms 559 | * @bss: timeout for the queues of a BSS (except for TDLS queues) in ms 560 | * @softap: timeout for the queues of a softAP in ms 561 | * @p2p_go: timeout for the queues of a P2P GO in ms 562 | * @p2p_client: timeout for the queues of a P2P client in ms 563 | * @p2p_device: timeout for the queues of a P2P device in ms 564 | * @ibss: timeout for the queues of an IBSS in ms 565 | * @tdls: timeout for the queues of a TDLS station in ms 566 | */ 567 | struct iwl_fw_dbg_trigger_txq_timer { 568 | __le32 command_queue; 569 | __le32 bss; 570 | __le32 softap; 571 | __le32 p2p_go; 572 | __le32 p2p_client; 573 | __le32 p2p_device; 574 | __le32 ibss; 575 | __le32 tdls; 576 | __le32 reserved[4]; 577 | };// __packed; 578 | 579 | /** 580 | * struct iwl_fw_dbg_trigger_time_event - configures a time event trigger 581 | * time_Events: a list of tuples . The driver will issue a 582 | * trigger each time a time event notification that relates to time event 583 | * id with one of the actions in the bitmap is received and 584 | * BIT(notif->status) is set in status_bitmap. 585 | * 586 | */ 587 | struct iwl_fw_dbg_trigger_time_event { 588 | struct { 589 | __le32 id; 590 | __le32 action_bitmap; 591 | __le32 status_bitmap; 592 | } /*__packed*/ time_events[16]; 593 | };// __packed; 594 | 595 | /** 596 | * struct iwl_fw_dbg_trigger_ba - configures BlockAck related trigger 597 | * rx_ba_start: tid bitmap to configure on what tid the trigger should occur 598 | * when an Rx BlockAck session is started. 599 | * rx_ba_stop: tid bitmap to configure on what tid the trigger should occur 600 | * when an Rx BlockAck session is stopped. 601 | * tx_ba_start: tid bitmap to configure on what tid the trigger should occur 602 | * when a Tx BlockAck session is started. 603 | * tx_ba_stop: tid bitmap to configure on what tid the trigger should occur 604 | * when a Tx BlockAck session is stopped. 605 | * rx_bar: tid bitmap to configure on what tid the trigger should occur 606 | * when a BAR is received (for a Tx BlockAck session). 607 | * tx_bar: tid bitmap to configure on what tid the trigger should occur 608 | * when a BAR is send (for an Rx BlocAck session). 609 | * frame_timeout: tid bitmap to configure on what tid the trigger should occur 610 | * when a frame times out in the reodering buffer. 611 | */ 612 | struct iwl_fw_dbg_trigger_ba { 613 | __le16 rx_ba_start; 614 | __le16 rx_ba_stop; 615 | __le16 tx_ba_start; 616 | __le16 tx_ba_stop; 617 | __le16 rx_bar; 618 | __le16 tx_bar; 619 | __le16 frame_timeout; 620 | };// __packed; 621 | #pragma options align=reset 622 | 623 | /* 624 | * new TLV uCode file layout 625 | * 626 | * The new TLV file format contains TLVs, that each specify 627 | * some piece of data. 628 | */ 629 | 630 | enum iwl_ucode_tlv_type { 631 | IWL_UCODE_TLV_INVALID = 0, /* unused */ 632 | IWL_UCODE_TLV_INST = 1, 633 | IWL_UCODE_TLV_DATA = 2, 634 | IWL_UCODE_TLV_INIT = 3, 635 | IWL_UCODE_TLV_INIT_DATA = 4, 636 | IWL_UCODE_TLV_BOOT = 5, 637 | IWL_UCODE_TLV_PROBE_MAX_LEN = 6, /* a u32 value */ 638 | IWL_UCODE_TLV_PAN = 7, 639 | IWL_UCODE_TLV_RUNT_EVTLOG_PTR = 8, 640 | IWL_UCODE_TLV_RUNT_EVTLOG_SIZE = 9, 641 | IWL_UCODE_TLV_RUNT_ERRLOG_PTR = 10, 642 | IWL_UCODE_TLV_INIT_EVTLOG_PTR = 11, 643 | IWL_UCODE_TLV_INIT_EVTLOG_SIZE = 12, 644 | IWL_UCODE_TLV_INIT_ERRLOG_PTR = 13, 645 | IWL_UCODE_TLV_ENHANCE_SENS_TBL = 14, 646 | IWL_UCODE_TLV_PHY_CALIBRATION_SIZE = 15, 647 | IWL_UCODE_TLV_WOWLAN_INST = 16, 648 | IWL_UCODE_TLV_WOWLAN_DATA = 17, 649 | IWL_UCODE_TLV_FLAGS = 18, 650 | IWL_UCODE_TLV_SEC_RT = 19, 651 | IWL_UCODE_TLV_SEC_INIT = 20, 652 | IWL_UCODE_TLV_SEC_WOWLAN = 21, 653 | IWL_UCODE_TLV_DEF_CALIB = 22, 654 | IWL_UCODE_TLV_PHY_SKU = 23, 655 | IWL_UCODE_TLV_SECURE_SEC_RT = 24, 656 | IWL_UCODE_TLV_SECURE_SEC_INIT = 25, 657 | IWL_UCODE_TLV_SECURE_SEC_WOWLAN = 26, 658 | IWL_UCODE_TLV_NUM_OF_CPU = 27, 659 | IWL_UCODE_TLV_CSCHEME = 28, 660 | IWL_UCODE_TLV_API_CHANGES_SET = 29, 661 | IWL_UCODE_TLV_ENABLED_CAPABILITIES = 30, 662 | IWL_UCODE_TLV_N_SCAN_CHANNELS = 31, 663 | IWL_UCODE_TLV_PAGING = 32, 664 | IWL_UCODE_TLV_SEC_RT_USNIFFER = 34, 665 | IWL_UCODE_TLV_SDIO_ADMA_ADDR = 35, 666 | IWL_UCODE_TLV_FW_VERSION = 36, 667 | IWL_UCODE_TLV_FW_DBG_DEST = 38, 668 | IWL_UCODE_TLV_FW_DBG_CONF = 39, 669 | IWL_UCODE_TLV_FW_DBG_TRIGGER = 40, 670 | IWL_UCODE_TLV_FW_GSCAN_CAPA = 50, 671 | }; 672 | 673 | struct iwl_ucode_tlv { 674 | __le32 type; /* see above */ 675 | __le32 length; /* not including type/length fields */ 676 | u8 data[0]; 677 | }; 678 | 679 | struct iwl_tlv_ucode_header { 680 | /* 681 | * The TLV style ucode header is distinguished from 682 | * the v1/v2 style header by first four bytes being 683 | * zero, as such is an invalid combination of 684 | * major/minor/API/serial versions. 685 | */ 686 | __le32 zero; 687 | __le32 magic; 688 | u8 human_readable[FW_VER_HUMAN_READABLE_SZ]; 689 | /* major/minor/API/serial or major in new format */ 690 | __le32 ver; 691 | __le32 build; 692 | __le64 ignore; 693 | /* 694 | * The data contained herein has a TLV layout, 695 | * see above for the TLV header and types. 696 | * Note that each TLV is padded to a length 697 | * that is a multiple of 4 for alignment. 698 | */ 699 | u8 data[0]; 700 | }; 701 | 702 | /* 703 | * ucode TLVs 704 | * 705 | * ability to get extension for: flags & capabilities from ucode binaries files 706 | */ 707 | #pragma pack(1) 708 | struct iwl_ucode_api { 709 | __le32 api_index; 710 | __le32 api_flags; 711 | };// __packed; 712 | 713 | struct iwl_ucode_capa { 714 | __le32 api_index; 715 | __le32 api_capa; 716 | };// __packed; 717 | #pragma options align=reset 718 | 719 | /** 720 | * enum iwl_ucode_tlv_flag - ucode API flags 721 | * @IWL_UCODE_TLV_FLAGS_PAN: This is PAN capable microcode; this previously 722 | * was a separate TLV but moved here to save space. 723 | * @IWL_UCODE_TLV_FLAGS_NEWSCAN: new uCode scan behavior on hidden SSID, 724 | * treats good CRC threshold as a boolean 725 | * @IWL_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w). 726 | * @IWL_UCODE_TLV_FLAGS_P2P: This uCode image supports P2P. 727 | * @IWL_UCODE_TLV_FLAGS_DW_BC_TABLE: The SCD byte count table is in DWORDS 728 | * @IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT: This uCode image supports uAPSD 729 | * @IWL_UCODE_TLV_FLAGS_SHORT_BL: 16 entries of black list instead of 64 in scan 730 | * offload profile config command. 731 | * @IWL_UCODE_TLV_FLAGS_D3_6_IPV6_ADDRS: D3 image supports up to six 732 | * (rather than two) IPv6 addresses 733 | * @IWL_UCODE_TLV_FLAGS_NO_BASIC_SSID: not sending a probe with the SSID element 734 | * from the probe request template. 735 | * @IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL: new NS offload (small version) 736 | * @IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE: new NS offload (large version) 737 | * @IWL_UCODE_TLV_FLAGS_P2P_PM: P2P client supports PM as a stand alone MAC 738 | * @IWL_UCODE_TLV_FLAGS_P2P_BSS_PS_DCM: support power save on BSS station and 739 | * P2P client interfaces simultaneously if they are in different bindings. 740 | * @IWL_UCODE_TLV_FLAGS_P2P_BSS_PS_SCM: support power save on BSS station and 741 | * P2P client interfaces simultaneously if they are in same bindings. 742 | * @IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT: General support for uAPSD 743 | * @IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD: P2P client supports uAPSD power save 744 | * @IWL_UCODE_TLV_FLAGS_BCAST_FILTERING: uCode supports broadcast filtering. 745 | * @IWL_UCODE_TLV_FLAGS_GO_UAPSD: AP/GO interfaces support uAPSD clients 746 | * @IWL_UCODE_TLV_FLAGS_EBS_SUPPORT: this uCode image supports EBS. 747 | */ 748 | enum iwl_ucode_tlv_flag { 749 | IWL_UCODE_TLV_FLAGS_PAN = BIT(0), 750 | IWL_UCODE_TLV_FLAGS_NEWSCAN = BIT(1), 751 | IWL_UCODE_TLV_FLAGS_MFP = BIT(2), 752 | IWL_UCODE_TLV_FLAGS_P2P = BIT(3), 753 | IWL_UCODE_TLV_FLAGS_DW_BC_TABLE = BIT(4), 754 | IWL_UCODE_TLV_FLAGS_SHORT_BL = BIT(7), 755 | IWL_UCODE_TLV_FLAGS_D3_6_IPV6_ADDRS = BIT(10), 756 | IWL_UCODE_TLV_FLAGS_NO_BASIC_SSID = BIT(12), 757 | IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL = BIT(15), 758 | IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE = BIT(16), 759 | IWL_UCODE_TLV_FLAGS_P2P_PM = BIT(21), 760 | IWL_UCODE_TLV_FLAGS_BSS_P2P_PS_DCM = BIT(22), 761 | IWL_UCODE_TLV_FLAGS_BSS_P2P_PS_SCM = BIT(23), 762 | IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT = BIT(24), 763 | IWL_UCODE_TLV_FLAGS_EBS_SUPPORT = BIT(25), 764 | IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD = BIT(26), 765 | IWL_UCODE_TLV_FLAGS_BCAST_FILTERING = BIT(29), 766 | IWL_UCODE_TLV_FLAGS_GO_UAPSD = BIT(30), 767 | }; 768 | 769 | enum iwl_fw_phy_cfg { 770 | FW_PHY_CFG_RADIO_TYPE_POS = 0, 771 | FW_PHY_CFG_RADIO_TYPE = 0x3 << FW_PHY_CFG_RADIO_TYPE_POS, 772 | FW_PHY_CFG_RADIO_STEP_POS = 2, 773 | FW_PHY_CFG_RADIO_STEP = 0x3 << FW_PHY_CFG_RADIO_STEP_POS, 774 | FW_PHY_CFG_RADIO_DASH_POS = 4, 775 | FW_PHY_CFG_RADIO_DASH = 0x3 << FW_PHY_CFG_RADIO_DASH_POS, 776 | FW_PHY_CFG_TX_CHAIN_POS = 16, 777 | FW_PHY_CFG_TX_CHAIN = 0xf << FW_PHY_CFG_TX_CHAIN_POS, 778 | FW_PHY_CFG_RX_CHAIN_POS = 20, 779 | FW_PHY_CFG_RX_CHAIN = 0xf << FW_PHY_CFG_RX_CHAIN_POS, 780 | }; 781 | 782 | /* 783 | * struct fw_sec_parsing: to extract fw section and it's offset from tlv 784 | */ 785 | #pragma pack(1) 786 | struct fw_sec_parsing { 787 | __le32 offset; 788 | const u8 data[]; 789 | };// __packed; 790 | 791 | /** 792 | * struct iwl_tlv_calib_data - parse the default calib data from TLV 793 | * 794 | * @ucode_type: the uCode to which the following default calib relates. 795 | * @calib: default calibrations. 796 | */ 797 | struct iwl_tlv_calib_data { 798 | __le32 ucode_type; 799 | struct iwl_tlv_calib_ctrl calib; 800 | };// __packed; 801 | 802 | /** 803 | * struct iwl_fw_cipher_scheme - a cipher scheme supported by FW. 804 | * @cipher: a cipher suite selector 805 | * @flags: cipher scheme flags (currently reserved for a future use) 806 | * @hdr_len: a size of MPDU security header 807 | * @pn_len: a size of PN 808 | * @pn_off: an offset of pn from the beginning of the security header 809 | * @key_idx_off: an offset of key index byte in the security header 810 | * @key_idx_mask: a bit mask of key_idx bits 811 | * @key_idx_shift: bit shift needed to get key_idx 812 | * @mic_len: mic length in bytes 813 | * @hw_cipher: a HW cipher index used in host commands 814 | */ 815 | struct iwl_fw_cipher_scheme { 816 | __le32 cipher; 817 | u8 flags; 818 | u8 hdr_len; 819 | u8 pn_len; 820 | u8 pn_off; 821 | u8 key_idx_off; 822 | u8 key_idx_mask; 823 | u8 key_idx_shift; 824 | u8 mic_len; 825 | u8 hw_cipher; 826 | };// __packed; 827 | 828 | /** 829 | * struct iwl_fw_cscheme_list - a cipher scheme list 830 | * @size: a number of entries 831 | * @cs: cipher scheme entries 832 | */ 833 | struct iwl_fw_cscheme_list { 834 | u8 size; 835 | struct iwl_fw_cipher_scheme cs[]; 836 | };// __packed; 837 | 838 | /** 839 | * struct iwl_fw_dbg_conf_tlv - a TLV that describes a debug configuration. 840 | * @id: conf id 841 | * @usniffer: should the uSniffer image be used 842 | * @num_of_hcmds: how many HCMDs to send are present here 843 | * @hcmd: a variable length host command to be sent to apply the configuration. 844 | * If there is more than one HCMD to send, they will appear one after the 845 | * other and be sent in the order that they appear in. 846 | * This parses IWL_UCODE_TLV_FW_DBG_CONF. The user can add up-to 847 | * %FW_DBG_CONF_MAX configuration per run. 848 | */ 849 | struct iwl_fw_dbg_conf_tlv { 850 | u8 id; 851 | u8 usniffer; 852 | u8 reserved; 853 | u8 num_of_hcmds; 854 | struct iwl_fw_dbg_conf_hcmd hcmd; 855 | };// __packed; 856 | 857 | /** 858 | * struct iwl_fw_gscan_capabilities - gscan capabilities supported by FW 859 | * @max_scan_cache_size: total space allocated for scan results (in bytes). 860 | * @max_scan_buckets: maximum number of channel buckets. 861 | * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan. 862 | * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI. 863 | * @max_scan_reporting_threshold: max possible report threshold. in percentage. 864 | * @max_hotlist_aps: maximum number of entries for hotlist APs. 865 | * @max_significant_change_aps: maximum number of entries for significant 866 | * change APs. 867 | * @max_bssid_history_entries: number of BSSID/RSSI entries that the device can 868 | * hold. 869 | */ 870 | struct iwl_fw_gscan_capabilities { 871 | __le32 max_scan_cache_size; 872 | __le32 max_scan_buckets; 873 | __le32 max_ap_cache_per_scan; 874 | __le32 max_rssi_sample_size; 875 | __le32 max_scan_reporting_threshold; 876 | __le32 max_hotlist_aps; 877 | __le32 max_significant_change_aps; 878 | __le32 max_bssid_history_entries; 879 | };// __packed; 880 | #pragma options align=reset 881 | 882 | #endif /* firmware_defs_h */ 883 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/linux/if_ether.h: -------------------------------------------------------------------------------- 1 | /* 2 | * INET An implementation of the TCP/IP protocol suite for the LINUX 3 | * operating system. INET is implemented using the BSD Socket 4 | * interface as the means of communication with the user level. 5 | * 6 | * Global definitions for the Ethernet IEEE 802.3 interface. 7 | * 8 | * Version: @(#)if_ether.h 1.0.1a 02/08/94 9 | * 10 | * Author: Fred N. van Kempen, 11 | * Donald Becker, 12 | * Alan Cox, 13 | * Steve Whitehouse, 14 | * 15 | * This program is free software; you can redistribute it and/or 16 | * modify it under the terms of the GNU General Public License 17 | * as published by the Free Software Foundation; either version 18 | * 2 of the License, or (at your option) any later version. 19 | */ 20 | 21 | #ifndef _UAPI_LINUX_IF_ETHER_H 22 | #define _UAPI_LINUX_IF_ETHER_H 23 | 24 | //#include 25 | 26 | /* 27 | * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble 28 | * and FCS/CRC (frame check sequence). 29 | */ 30 | 31 | #define ETH_ALEN 6 /* Octets in one ethernet addr */ 32 | #define ETH_HLEN 14 /* Total octets in header. */ 33 | #define ETH_ZLEN 60 /* Min. octets in frame sans FCS */ 34 | #define ETH_DATA_LEN 1500 /* Max. octets in payload */ 35 | #define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */ 36 | #define ETH_FCS_LEN 4 /* Octets in the FCS */ 37 | 38 | /* 39 | * These are the defined Ethernet Protocol ID's. 40 | */ 41 | 42 | #define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */ 43 | #define ETH_P_PUP 0x0200 /* Xerox PUP packet */ 44 | #define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */ 45 | #define ETH_P_TSN 0x22F0 /* TSN (IEEE 1722) packet */ 46 | #define ETH_P_IP 0x0800 /* Internet Protocol packet */ 47 | #define ETH_P_X25 0x0805 /* CCITT X.25 */ 48 | #define ETH_P_ARP 0x0806 /* Address Resolution packet */ 49 | #define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */ 50 | #define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ 51 | #define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */ 52 | #define ETH_P_BATMAN 0x4305 /* B.A.T.M.A.N.-Advanced packet [ NOT AN OFFICIALLY REGISTERED ID ] */ 53 | #define ETH_P_DEC 0x6000 /* DEC Assigned proto */ 54 | #define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */ 55 | #define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */ 56 | #define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */ 57 | #define ETH_P_LAT 0x6004 /* DEC LAT */ 58 | #define ETH_P_DIAG 0x6005 /* DEC Diagnostics */ 59 | #define ETH_P_CUST 0x6006 /* DEC Customer use */ 60 | #define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */ 61 | #define ETH_P_TEB 0x6558 /* Trans Ether Bridging */ 62 | #define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */ 63 | #define ETH_P_ATALK 0x809B /* Appletalk DDP */ 64 | #define ETH_P_AARP 0x80F3 /* Appletalk AARP */ 65 | #define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */ 66 | #define ETH_P_IPX 0x8137 /* IPX over DIX */ 67 | #define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */ 68 | #define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */ 69 | #define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */ 70 | #define ETH_P_WCCP 0x883E /* Web-cache coordination protocol 71 | * defined in draft-wilson-wrec-wccp-v2-00.txt */ 72 | #define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */ 73 | #define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */ 74 | #define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */ 75 | #define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */ 76 | #define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */ 77 | #define ETH_P_LINK_CTL 0x886c /* HPNA, wlan link local tunnel */ 78 | #define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport 79 | * over Ethernet 80 | */ 81 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ 82 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ 83 | #define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */ 84 | #define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */ 85 | #define ETH_P_TIPC 0x88CA /* TIPC */ 86 | #define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */ 87 | #define ETH_P_MVRP 0x88F5 /* 802.1Q MVRP */ 88 | #define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ 89 | #define ETH_P_PRP 0x88FB /* IEC 62439-3 PRP/HSRv0 */ 90 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ 91 | #define ETH_P_TDLS 0x890D /* TDLS */ 92 | #define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ 93 | #define ETH_P_80221 0x8917 /* IEEE 802.21 Media Independent Handover Protocol */ 94 | #define ETH_P_LOOPBACK 0x9000 /* Ethernet loopback packet, per IEEE 802.3 */ 95 | #define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ 96 | #define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ 97 | #define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ 98 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ 99 | #define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */ 100 | 101 | #define ETH_P_802_3_MIN 0x0600 /* If the value in the ethernet type is less than this value 102 | * then the frame is Ethernet II. Else it is 802.3 */ 103 | 104 | /* 105 | * Non DIX types. Won't clash for 1500 types. 106 | */ 107 | 108 | #define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */ 109 | #define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */ 110 | #define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */ 111 | #define ETH_P_802_2 0x0004 /* 802.2 frames */ 112 | #define ETH_P_SNAP 0x0005 /* Internal only */ 113 | #define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */ 114 | #define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/ 115 | #define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */ 116 | #define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */ 117 | #define ETH_P_CAN 0x000C /* CAN: Controller Area Network */ 118 | #define ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/ 119 | #define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/ 120 | #define ETH_P_TR_802_2 0x0011 /* 802.2 frames */ 121 | #define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */ 122 | #define ETH_P_CONTROL 0x0016 /* Card specific control frames */ 123 | #define ETH_P_IRDA 0x0017 /* Linux-IrDA */ 124 | #define ETH_P_ECONET 0x0018 /* Acorn Econet */ 125 | #define ETH_P_HDLC 0x0019 /* HDLC frames */ 126 | #define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */ 127 | #define ETH_P_DSA 0x001B /* Distributed Switch Arch. */ 128 | #define ETH_P_TRAILER 0x001C /* Trailer switch tagging */ 129 | #define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */ 130 | #define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */ 131 | #define ETH_P_CAIF 0x00F7 /* ST-Ericsson CAIF protocol */ 132 | #define ETH_P_XDSA 0x00F8 /* Multiplexed DSA protocol */ 133 | 134 | /* 135 | * This is an Ethernet frame header. 136 | */ 137 | 138 | struct ethhdr { 139 | unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ 140 | unsigned char h_source[ETH_ALEN]; /* source ether addr */ 141 | __be16 h_proto; /* packet type ID field */ 142 | } __attribute__((packed)); 143 | 144 | 145 | #endif /* _UAPI_LINUX_IF_ETHER_H */ 146 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/linux/iwl-7000.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * This file is provided under a dual BSD/GPLv2 license. When using or 4 | * redistributing this file, you may do so under either license. 5 | * 6 | * GPL LICENSE SUMMARY 7 | * 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of version 2 of the GNU General Public License as 13 | * published by the Free Software Foundation. 14 | * 15 | * This program is distributed in the hope that it will be useful, but 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 23 | * USA 24 | * 25 | * The full GNU General Public License is included in this distribution 26 | * in the file called COPYING. 27 | * 28 | * Contact Information: 29 | * Intel Linux Wireless 30 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 31 | * 32 | * BSD LICENSE 33 | * 34 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 35 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 36 | * All rights reserved. 37 | * 38 | * Redistribution and use in source and binary forms, with or without 39 | * modification, are permitted provided that the following conditions 40 | * are met: 41 | * 42 | * * Redistributions of source code must retain the above copyright 43 | * notice, this list of conditions and the following disclaimer. 44 | * * Redistributions in binary form must reproduce the above copyright 45 | * notice, this list of conditions and the following disclaimer in 46 | * the documentation and/or other materials provided with the 47 | * distribution. 48 | * * Neither the name Intel Corporation nor the names of its 49 | * contributors may be used to endorse or promote products derived 50 | * from this software without specific prior written permission. 51 | * 52 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 53 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 54 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 55 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 56 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 57 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 58 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 59 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 60 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 61 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 62 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 63 | * 64 | *****************************************************************************/ 65 | #ifndef _INTEL_IWL_7000_H 66 | #define _INTEL_IWL_7000_H 67 | 68 | #include "iwl-config.h" 69 | #include "iwl-agn-hw.h" 70 | 71 | /* Highest firmware API version supported */ 72 | #define IWL7260_UCODE_API_MAX 17 73 | #define IWL7265_UCODE_API_MAX 19 74 | #define IWL7265D_UCODE_API_MAX 19 75 | 76 | /* Oldest version we won't warn about */ 77 | #define IWL7260_UCODE_API_OK 13 78 | #define IWL7265_UCODE_API_OK 13 79 | #define IWL7265D_UCODE_API_OK 13 80 | 81 | /* Lowest firmware API version supported */ 82 | #define IWL7260_UCODE_API_MIN 13 83 | #define IWL7265_UCODE_API_MIN 13 84 | #define IWL7265D_UCODE_API_MIN 13 85 | 86 | /* NVM versions */ 87 | #define IWL7260_NVM_VERSION 0x0a1d 88 | #define IWL7260_TX_POWER_VERSION 0xffff /* meaningless */ 89 | #define IWL3160_NVM_VERSION 0x709 90 | #define IWL3160_TX_POWER_VERSION 0xffff /* meaningless */ 91 | #define IWL3165_NVM_VERSION 0x709 92 | #define IWL3165_TX_POWER_VERSION 0xffff /* meaningless */ 93 | #define IWL7265_NVM_VERSION 0x0a1d 94 | #define IWL7265_TX_POWER_VERSION 0xffff /* meaningless */ 95 | #define IWL7265D_NVM_VERSION 0x0c11 96 | #define IWL7265_TX_POWER_VERSION 0xffff /* meaningless */ 97 | 98 | /* DCCM offsets and lengths */ 99 | #define IWL7000_DCCM_OFFSET 0x800000 100 | #define IWL7260_DCCM_LEN 0x14000 101 | #define IWL3160_DCCM_LEN 0x10000 102 | #define IWL7265_DCCM_LEN 0x17A00 103 | 104 | #define IWL7260_FW_PRE "iwlwifi-7260-" 105 | #define IWL7260_MODULE_FIRMWARE(api) IWL7260_FW_PRE __stringify(api) ".ucode" 106 | 107 | #define IWL3160_FW_PRE "iwlwifi-3160-" 108 | #define IWL3160_MODULE_FIRMWARE(api) IWL3160_FW_PRE __stringify(api) ".ucode" 109 | 110 | #define IWL7265_FW_PRE "iwlwifi-7265-" 111 | #define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode" 112 | 113 | #define IWL7265D_FW_PRE "iwlwifi-7265D-" 114 | #define IWL7265D_MODULE_FIRMWARE(api) IWL7265D_FW_PRE __stringify(api) ".ucode" 115 | 116 | #define NVM_HW_SECTION_NUM_FAMILY_7000 0 117 | 118 | static const struct iwl_base_params iwl7000_base_params = { 119 | .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_7000, 120 | .num_of_queues = 31, 121 | .pll_cfg_val = 0, 122 | .shadow_ram_support = true, 123 | .led_compensation = 57, 124 | .wd_timeout = IWL_LONG_WD_TIMEOUT, 125 | .max_event_log_size = 512, 126 | .shadow_reg_enable = true, 127 | .pcie_l1_allowed = true, 128 | .apmg_wake_up_wa = true, 129 | }; 130 | 131 | static const struct iwl_tt_params iwl7000_high_temp_tt_params = { 132 | .ct_kill_entry = 118, 133 | .ct_kill_exit = 96, 134 | .ct_kill_duration = 5, 135 | .dynamic_smps_entry = 114, 136 | .dynamic_smps_exit = 110, 137 | .tx_protection_entry = 114, 138 | .tx_protection_exit = 108, 139 | .tx_backoff = { 140 | {.temperature = 112, .backoff = 300}, 141 | {.temperature = 113, .backoff = 800}, 142 | {.temperature = 114, .backoff = 1500}, 143 | {.temperature = 115, .backoff = 3000}, 144 | {.temperature = 116, .backoff = 5000}, 145 | {.temperature = 117, .backoff = 10000}, 146 | }, 147 | .support_ct_kill = true, 148 | .support_dynamic_smps = true, 149 | .support_tx_protection = true, 150 | .support_tx_backoff = true, 151 | }; 152 | 153 | static const struct iwl_ht_params iwl7000_ht_params = { 154 | .stbc = true, 155 | .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ), 156 | }; 157 | 158 | #define IWL_DEVICE_7000_COMMON \ 159 | .device_family = IWL_DEVICE_FAMILY_7000, \ 160 | .max_inst_size = IWL60_RTC_INST_SIZE, \ 161 | .max_data_size = IWL60_RTC_DATA_SIZE, \ 162 | .base_params = &iwl7000_base_params, \ 163 | .led_mode = IWL_LED_RF_STATE, \ 164 | .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_7000, \ 165 | .non_shared_ant = ANT_A, \ 166 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \ 167 | .dccm_offset = IWL7000_DCCM_OFFSET 168 | 169 | #define IWL_DEVICE_7000 \ 170 | IWL_DEVICE_7000_COMMON, \ 171 | .ucode_api_max = IWL7260_UCODE_API_MAX, \ 172 | .ucode_api_ok = IWL7260_UCODE_API_OK, \ 173 | .ucode_api_min = IWL7260_UCODE_API_MIN 174 | 175 | #define IWL_DEVICE_7005 \ 176 | IWL_DEVICE_7000_COMMON, \ 177 | .ucode_api_max = IWL7265_UCODE_API_MAX, \ 178 | .ucode_api_ok = IWL7265_UCODE_API_OK, \ 179 | .ucode_api_min = IWL7265_UCODE_API_MIN 180 | 181 | #define IWL_DEVICE_7005D \ 182 | IWL_DEVICE_7000_COMMON, \ 183 | .ucode_api_max = IWL7265D_UCODE_API_MAX, \ 184 | .ucode_api_ok = IWL7265D_UCODE_API_OK, \ 185 | .ucode_api_min = IWL7265D_UCODE_API_MIN 186 | 187 | const struct iwl_cfg iwl7260_2ac_cfg = { 188 | .name = "Intel(R) Dual Band Wireless AC 7260", 189 | .fw_name_pre = IWL7260_FW_PRE, 190 | IWL_DEVICE_7000, 191 | .ht_params = &iwl7000_ht_params, 192 | .nvm_ver = IWL7260_NVM_VERSION, 193 | .nvm_calib_ver = IWL7260_TX_POWER_VERSION, 194 | .host_interrupt_operation_mode = true, 195 | .lp_xtal_workaround = true, 196 | .dccm_len = IWL7260_DCCM_LEN, 197 | }; 198 | 199 | const struct iwl_cfg iwl7260_2ac_cfg_high_temp = { 200 | .name = "Intel(R) Dual Band Wireless AC 7260", 201 | .fw_name_pre = IWL7260_FW_PRE, 202 | IWL_DEVICE_7000, 203 | .ht_params = &iwl7000_ht_params, 204 | .nvm_ver = IWL7260_NVM_VERSION, 205 | .nvm_calib_ver = IWL7260_TX_POWER_VERSION, 206 | .high_temp = true, 207 | .host_interrupt_operation_mode = true, 208 | .lp_xtal_workaround = true, 209 | .dccm_len = IWL7260_DCCM_LEN, 210 | .thermal_params = &iwl7000_high_temp_tt_params, 211 | }; 212 | 213 | const struct iwl_cfg iwl7260_2n_cfg = { 214 | .name = "Intel(R) Dual Band Wireless N 7260", 215 | .fw_name_pre = IWL7260_FW_PRE, 216 | IWL_DEVICE_7000, 217 | .ht_params = &iwl7000_ht_params, 218 | .nvm_ver = IWL7260_NVM_VERSION, 219 | .nvm_calib_ver = IWL7260_TX_POWER_VERSION, 220 | .host_interrupt_operation_mode = true, 221 | .lp_xtal_workaround = true, 222 | .dccm_len = IWL7260_DCCM_LEN, 223 | }; 224 | 225 | const struct iwl_cfg iwl7260_n_cfg = { 226 | .name = "Intel(R) Wireless N 7260", 227 | .fw_name_pre = IWL7260_FW_PRE, 228 | IWL_DEVICE_7000, 229 | .ht_params = &iwl7000_ht_params, 230 | .nvm_ver = IWL7260_NVM_VERSION, 231 | .nvm_calib_ver = IWL7260_TX_POWER_VERSION, 232 | .host_interrupt_operation_mode = true, 233 | .lp_xtal_workaround = true, 234 | .dccm_len = IWL7260_DCCM_LEN, 235 | }; 236 | 237 | const struct iwl_cfg iwl3160_2ac_cfg = { 238 | .name = "Intel(R) Dual Band Wireless AC 3160", 239 | .fw_name_pre = IWL3160_FW_PRE, 240 | IWL_DEVICE_7000, 241 | .ht_params = &iwl7000_ht_params, 242 | .nvm_ver = IWL3160_NVM_VERSION, 243 | .nvm_calib_ver = IWL3160_TX_POWER_VERSION, 244 | .host_interrupt_operation_mode = true, 245 | .dccm_len = IWL3160_DCCM_LEN, 246 | }; 247 | 248 | const struct iwl_cfg iwl3160_2n_cfg = { 249 | .name = "Intel(R) Dual Band Wireless N 3160", 250 | .fw_name_pre = IWL3160_FW_PRE, 251 | IWL_DEVICE_7000, 252 | .ht_params = &iwl7000_ht_params, 253 | .nvm_ver = IWL3160_NVM_VERSION, 254 | .nvm_calib_ver = IWL3160_TX_POWER_VERSION, 255 | .host_interrupt_operation_mode = true, 256 | .dccm_len = IWL3160_DCCM_LEN, 257 | }; 258 | 259 | const struct iwl_cfg iwl3160_n_cfg = { 260 | .name = "Intel(R) Wireless N 3160", 261 | .fw_name_pre = IWL3160_FW_PRE, 262 | IWL_DEVICE_7000, 263 | .ht_params = &iwl7000_ht_params, 264 | .nvm_ver = IWL3160_NVM_VERSION, 265 | .nvm_calib_ver = IWL3160_TX_POWER_VERSION, 266 | .host_interrupt_operation_mode = true, 267 | .dccm_len = IWL3160_DCCM_LEN, 268 | }; 269 | 270 | static const struct iwl_pwr_tx_backoff iwl7265_pwr_tx_backoffs[] = { 271 | {.pwr = 1600, .backoff = 0}, 272 | {.pwr = 1300, .backoff = 467}, 273 | {.pwr = 900, .backoff = 1900}, 274 | {.pwr = 800, .backoff = 2630}, 275 | {.pwr = 700, .backoff = 3720}, 276 | {.pwr = 600, .backoff = 5550}, 277 | {.pwr = 500, .backoff = 9350}, 278 | {0}, 279 | }; 280 | 281 | static const struct iwl_ht_params iwl7265_ht_params = { 282 | .stbc = true, 283 | .ldpc = true, 284 | .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ), 285 | }; 286 | 287 | const struct iwl_cfg iwl3165_2ac_cfg = { 288 | .name = "Intel(R) Dual Band Wireless AC 3165", 289 | .fw_name_pre = IWL7265D_FW_PRE, 290 | IWL_DEVICE_7005D, 291 | .ht_params = &iwl7000_ht_params, 292 | .nvm_ver = IWL3165_NVM_VERSION, 293 | .nvm_calib_ver = IWL3165_TX_POWER_VERSION, 294 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 295 | .dccm_len = IWL7265_DCCM_LEN, 296 | }; 297 | 298 | const struct iwl_cfg iwl7265_2ac_cfg = { 299 | .name = "Intel(R) Dual Band Wireless AC 7265", 300 | .fw_name_pre = IWL7265_FW_PRE, 301 | IWL_DEVICE_7005, 302 | .ht_params = &iwl7265_ht_params, 303 | .nvm_ver = IWL7265_NVM_VERSION, 304 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, 305 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 306 | .dccm_len = IWL7265_DCCM_LEN, 307 | }; 308 | 309 | const struct iwl_cfg iwl7265_2n_cfg = { 310 | .name = "Intel(R) Dual Band Wireless N 7265", 311 | .fw_name_pre = IWL7265_FW_PRE, 312 | IWL_DEVICE_7005, 313 | .ht_params = &iwl7265_ht_params, 314 | .nvm_ver = IWL7265_NVM_VERSION, 315 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, 316 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 317 | .dccm_len = IWL7265_DCCM_LEN, 318 | }; 319 | 320 | const struct iwl_cfg iwl7265_n_cfg = { 321 | .name = "Intel(R) Wireless N 7265", 322 | .fw_name_pre = IWL7265_FW_PRE, 323 | IWL_DEVICE_7005, 324 | .ht_params = &iwl7265_ht_params, 325 | .nvm_ver = IWL7265_NVM_VERSION, 326 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, 327 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 328 | .dccm_len = IWL7265_DCCM_LEN, 329 | }; 330 | 331 | const struct iwl_cfg iwl7265d_2ac_cfg = { 332 | .name = "Intel(R) Dual Band Wireless AC 7265", 333 | .fw_name_pre = IWL7265D_FW_PRE, 334 | IWL_DEVICE_7005D, 335 | .ht_params = &iwl7265_ht_params, 336 | .nvm_ver = IWL7265D_NVM_VERSION, 337 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, 338 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 339 | .dccm_len = IWL7265_DCCM_LEN, 340 | }; 341 | 342 | const struct iwl_cfg iwl7265d_2n_cfg = { 343 | .name = "Intel(R) Dual Band Wireless N 7265", 344 | .fw_name_pre = IWL7265D_FW_PRE, 345 | IWL_DEVICE_7005D, 346 | .ht_params = &iwl7265_ht_params, 347 | .nvm_ver = IWL7265D_NVM_VERSION, 348 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, 349 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 350 | .dccm_len = IWL7265_DCCM_LEN, 351 | }; 352 | 353 | const struct iwl_cfg iwl7265d_n_cfg = { 354 | .name = "Intel(R) Wireless N 7265", 355 | .fw_name_pre = IWL7265D_FW_PRE, 356 | IWL_DEVICE_7005D, 357 | .ht_params = &iwl7265_ht_params, 358 | .nvm_ver = IWL7265D_NVM_VERSION, 359 | .nvm_calib_ver = IWL7265_TX_POWER_VERSION, 360 | .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs, 361 | .dccm_len = IWL7265_DCCM_LEN, 362 | }; 363 | 364 | //MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 365 | //MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 366 | //MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7265_UCODE_API_OK)); 367 | //MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7265D_UCODE_API_OK)); 368 | 369 | #endif -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/linux/iwl-8000.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * This file is provided under a dual BSD/GPLv2 license. When using or 4 | * redistributing this file, you may do so under either license. 5 | * 6 | * GPL LICENSE SUMMARY 7 | * 8 | * Copyright(c) 2014 Intel Corporation. All rights reserved. 9 | * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of version 2 of the GNU General Public License as 13 | * published by the Free Software Foundation. 14 | * 15 | * This program is distributed in the hope that it will be useful, but 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 23 | * USA 24 | * 25 | * The full GNU General Public License is included in this distribution 26 | * in the file called COPYING. 27 | * 28 | * Contact Information: 29 | * Intel Linux Wireless 30 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 31 | * 32 | * BSD LICENSE 33 | * 34 | * Copyright(c) 2014 Intel Corporation. All rights reserved. 35 | * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH 36 | * All rights reserved. 37 | * 38 | * Redistribution and use in source and binary forms, with or without 39 | * modification, are permitted provided that the following conditions 40 | * are met: 41 | * 42 | * * Redistributions of source code must retain the above copyright 43 | * notice, this list of conditions and the following disclaimer. 44 | * * Redistributions in binary form must reproduce the above copyright 45 | * notice, this list of conditions and the following disclaimer in 46 | * the documentation and/or other materials provided with the 47 | * distribution. 48 | * * Neither the name Intel Corporation nor the names of its 49 | * contributors may be used to endorse or promote products derived 50 | * from this software without specific prior written permission. 51 | * 52 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 53 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 54 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 55 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 56 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 57 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 58 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 59 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 60 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 61 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 62 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 63 | * 64 | *****************************************************************************/ 65 | 66 | #ifndef _INTEL_IWL_8000_H 67 | #define _INTEL_IWL_8000_H 68 | 69 | #include "iwl-config.h" 70 | #include "iwl-agn-hw.h" 71 | 72 | /* Highest firmware API version supported */ 73 | #define IWL8000_UCODE_API_MAX 19 74 | 75 | /* Oldest version we won't warn about */ 76 | #define IWL8000_UCODE_API_OK 13 77 | 78 | /* Lowest firmware API version supported */ 79 | #define IWL8000_UCODE_API_MIN 13 80 | 81 | /* NVM versions */ 82 | #define IWL8000_NVM_VERSION 0x0a1d 83 | #define IWL8000_TX_POWER_VERSION 0xffff /* meaningless */ 84 | 85 | /* Memory offsets and lengths */ 86 | #define IWL8260_DCCM_OFFSET 0x800000 87 | #define IWL8260_DCCM_LEN 0x18000 88 | #define IWL8260_DCCM2_OFFSET 0x880000 89 | #define IWL8260_DCCM2_LEN 0x8000 90 | #define IWL8260_SMEM_OFFSET 0x400000 91 | #define IWL8260_SMEM_LEN 0x68000 92 | 93 | #define IWL8000_FW_PRE "iwlwifi-8000" 94 | #define IWL8000_MODULE_FIRMWARE(api) \ 95 | IWL8000_FW_PRE "-" __stringify(api) ".ucode" 96 | 97 | #define NVM_HW_SECTION_NUM_FAMILY_8000 10 98 | #define DEFAULT_NVM_FILE_FAMILY_8000B "nvmData-8000B" 99 | #define DEFAULT_NVM_FILE_FAMILY_8000C "nvmData-8000C" 100 | 101 | /* Max SDIO RX/TX aggregation sizes of the ADDBA request/response */ 102 | #define MAX_RX_AGG_SIZE_8260_SDIO 21 103 | #define MAX_TX_AGG_SIZE_8260_SDIO 40 104 | 105 | /* Max A-MPDU exponent for HT and VHT */ 106 | #define MAX_HT_AMPDU_EXPONENT_8260_SDIO IEEE80211_HT_MAX_AMPDU_32K 107 | #define MAX_VHT_AMPDU_EXPONENT_8260_SDIO IEEE80211_VHT_MAX_AMPDU_32K 108 | 109 | static const struct iwl_base_params iwl8000_base_params = { 110 | .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_8000, 111 | .num_of_queues = 31, 112 | .pll_cfg_val = 0, 113 | .shadow_ram_support = true, 114 | .led_compensation = 57, 115 | .wd_timeout = IWL_LONG_WD_TIMEOUT, 116 | .max_event_log_size = 512, 117 | .shadow_reg_enable = true, 118 | .pcie_l1_allowed = true, 119 | }; 120 | 121 | static const struct iwl_ht_params iwl8000_ht_params = { 122 | .stbc = true, 123 | .ldpc = true, 124 | .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ), 125 | }; 126 | 127 | static const struct iwl_tt_params iwl8000_tt_params = { 128 | .ct_kill_entry = 115, 129 | .ct_kill_exit = 93, 130 | .ct_kill_duration = 5, 131 | .dynamic_smps_entry = 111, 132 | .dynamic_smps_exit = 107, 133 | .tx_protection_entry = 112, 134 | .tx_protection_exit = 105, 135 | .tx_backoff = { 136 | {.temperature = 110, .backoff = 200}, 137 | {.temperature = 111, .backoff = 600}, 138 | {.temperature = 112, .backoff = 1200}, 139 | {.temperature = 113, .backoff = 2000}, 140 | {.temperature = 114, .backoff = 4000}, 141 | }, 142 | .support_ct_kill = true, 143 | .support_dynamic_smps = true, 144 | .support_tx_protection = true, 145 | .support_tx_backoff = true, 146 | }; 147 | 148 | #define IWL_DEVICE_8000 \ 149 | .ucode_api_max = IWL8000_UCODE_API_MAX, \ 150 | .ucode_api_ok = IWL8000_UCODE_API_OK, \ 151 | .ucode_api_min = IWL8000_UCODE_API_MIN, \ 152 | .device_family = IWL_DEVICE_FAMILY_8000, \ 153 | .max_inst_size = IWL60_RTC_INST_SIZE, \ 154 | .max_data_size = IWL60_RTC_DATA_SIZE, \ 155 | .base_params = &iwl8000_base_params, \ 156 | .led_mode = IWL_LED_RF_STATE, \ 157 | .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_8000, \ 158 | .d0i3 = true, \ 159 | .features = NETIF_F_RXCSUM, \ 160 | .non_shared_ant = ANT_A, \ 161 | .dccm_offset = IWL8260_DCCM_OFFSET, \ 162 | .dccm_len = IWL8260_DCCM_LEN, \ 163 | .dccm2_offset = IWL8260_DCCM2_OFFSET, \ 164 | .dccm2_len = IWL8260_DCCM2_LEN, \ 165 | .smem_offset = IWL8260_SMEM_OFFSET, \ 166 | .smem_len = IWL8260_SMEM_LEN, \ 167 | .default_nvm_file_B_step = DEFAULT_NVM_FILE_FAMILY_8000B, \ 168 | .default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C, \ 169 | .thermal_params = &iwl8000_tt_params, \ 170 | .apmg_not_supported = true 171 | 172 | const struct iwl_cfg iwl8260_2n_cfg = { 173 | .name = "Intel(R) Dual Band Wireless N 8260", 174 | .fw_name_pre = IWL8000_FW_PRE, 175 | IWL_DEVICE_8000, 176 | .ht_params = &iwl8000_ht_params, 177 | .nvm_ver = IWL8000_NVM_VERSION, 178 | .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 179 | }; 180 | 181 | const struct iwl_cfg iwl8260_2ac_cfg = { 182 | .name = "Intel(R) Dual Band Wireless AC 8260", 183 | .fw_name_pre = IWL8000_FW_PRE, 184 | IWL_DEVICE_8000, 185 | .ht_params = &iwl8000_ht_params, 186 | .nvm_ver = IWL8000_NVM_VERSION, 187 | .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 188 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, 189 | }; 190 | 191 | const struct iwl_cfg iwl4165_2ac_cfg = { 192 | .name = "Intel(R) Dual Band Wireless AC 4165", 193 | .fw_name_pre = IWL8000_FW_PRE, 194 | IWL_DEVICE_8000, 195 | .ht_params = &iwl8000_ht_params, 196 | .nvm_ver = IWL8000_NVM_VERSION, 197 | .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 198 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, 199 | }; 200 | 201 | const struct iwl_cfg iwl8260_2ac_sdio_cfg = { 202 | .name = "Intel(R) Dual Band Wireless-AC 8260", 203 | .fw_name_pre = IWL8000_FW_PRE, 204 | IWL_DEVICE_8000, 205 | .ht_params = &iwl8000_ht_params, 206 | .nvm_ver = IWL8000_NVM_VERSION, 207 | .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 208 | .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO, 209 | .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO, 210 | .disable_dummy_notification = true, 211 | .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO, 212 | .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO, 213 | }; 214 | 215 | const struct iwl_cfg iwl4165_2ac_sdio_cfg = { 216 | .name = "Intel(R) Dual Band Wireless-AC 4165", 217 | .fw_name_pre = IWL8000_FW_PRE, 218 | IWL_DEVICE_8000, 219 | .ht_params = &iwl8000_ht_params, 220 | .nvm_ver = IWL8000_NVM_VERSION, 221 | .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 222 | .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO, 223 | .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO, 224 | .bt_shared_single_ant = true, 225 | .disable_dummy_notification = true, 226 | .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO, 227 | .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO, 228 | }; 229 | 230 | //MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_OK)); 231 | #endif 232 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/linux/iwl-agn-hw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * This file is provided under a dual BSD/GPLv2 license. When using or 4 | * redistributing this file, you may do so under either license. 5 | * 6 | * GPL LICENSE SUMMARY 7 | * 8 | * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of version 2 of the GNU General Public License as 12 | * published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 22 | * USA 23 | * 24 | * The full GNU General Public License is included in this distribution 25 | * in the file called COPYING. 26 | * 27 | * Contact Information: 28 | * Intel Linux Wireless 29 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 30 | * 31 | * BSD LICENSE 32 | * 33 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 34 | * All rights reserved. 35 | * 36 | * Redistribution and use in source and binary forms, with or without 37 | * modification, are permitted provided that the following conditions 38 | * are met: 39 | * 40 | * * Redistributions of source code must retain the above copyright 41 | * notice, this list of conditions and the following disclaimer. 42 | * * Redistributions in binary form must reproduce the above copyright 43 | * notice, this list of conditions and the following disclaimer in 44 | * the documentation and/or other materials provided with the 45 | * distribution. 46 | * * Neither the name Intel Corporation nor the names of its 47 | * contributors may be used to endorse or promote products derived 48 | * from this software without specific prior written permission. 49 | * 50 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 51 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 52 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 53 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 54 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 55 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 56 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 57 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 58 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 59 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 60 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 61 | * 62 | *****************************************************************************/ 63 | /* 64 | * Please use this file (iwl-agn-hw.h) only for hardware-related definitions. 65 | */ 66 | 67 | #ifndef __iwl_agn_hw_h__ 68 | #define __iwl_agn_hw_h__ 69 | 70 | #define IWLAGN_RTC_INST_LOWER_BOUND (0x000000) 71 | #define IWLAGN_RTC_INST_UPPER_BOUND (0x020000) 72 | 73 | #define IWLAGN_RTC_DATA_LOWER_BOUND (0x800000) 74 | #define IWLAGN_RTC_DATA_UPPER_BOUND (0x80C000) 75 | 76 | #define IWLAGN_RTC_INST_SIZE (IWLAGN_RTC_INST_UPPER_BOUND - \ 77 | IWLAGN_RTC_INST_LOWER_BOUND) 78 | #define IWLAGN_RTC_DATA_SIZE (IWLAGN_RTC_DATA_UPPER_BOUND - \ 79 | IWLAGN_RTC_DATA_LOWER_BOUND) 80 | 81 | #define IWL60_RTC_INST_LOWER_BOUND (0x000000) 82 | #define IWL60_RTC_INST_UPPER_BOUND (0x040000) 83 | #define IWL60_RTC_DATA_LOWER_BOUND (0x800000) 84 | #define IWL60_RTC_DATA_UPPER_BOUND (0x814000) 85 | #define IWL60_RTC_INST_SIZE \ 86 | (IWL60_RTC_INST_UPPER_BOUND - IWL60_RTC_INST_LOWER_BOUND) 87 | #define IWL60_RTC_DATA_SIZE \ 88 | (IWL60_RTC_DATA_UPPER_BOUND - IWL60_RTC_DATA_LOWER_BOUND) 89 | 90 | /* RSSI to dBm */ 91 | #define IWLAGN_RSSI_OFFSET 44 92 | 93 | #define IWLAGN_DEFAULT_TX_RETRY 15 94 | #define IWLAGN_MGMT_DFAULT_RETRY_LIMIT 3 95 | #define IWLAGN_RTS_DFAULT_RETRY_LIMIT 60 96 | #define IWLAGN_BAR_DFAULT_RETRY_LIMIT 60 97 | #define IWLAGN_LOW_RETRY_LIMIT 7 98 | 99 | /* Limit range of txpower output target to be between these values */ 100 | #define IWLAGN_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm: 1 milliwatt */ 101 | #define IWLAGN_TX_POWER_TARGET_POWER_MAX (16) /* 16 dBm */ 102 | 103 | /* EEPROM */ 104 | #define IWLAGN_EEPROM_IMG_SIZE 2048 105 | 106 | /* high blocks contain PAPD data */ 107 | #define OTP_HIGH_IMAGE_SIZE_6x00 (6 * 512 * sizeof(u16)) /* 6 KB */ 108 | #define OTP_HIGH_IMAGE_SIZE_1000 (0x200 * sizeof(u16)) /* 1024 bytes */ 109 | #define OTP_MAX_LL_ITEMS_1000 (3) /* OTP blocks for 1000 */ 110 | #define OTP_MAX_LL_ITEMS_6x00 (4) /* OTP blocks for 6x00 */ 111 | #define OTP_MAX_LL_ITEMS_6x50 (7) /* OTP blocks for 6x50 */ 112 | #define OTP_MAX_LL_ITEMS_2x00 (4) /* OTP blocks for 2x00 */ 113 | 114 | 115 | #define IWLAGN_NUM_QUEUES 20 116 | 117 | #endif /* __iwl_agn_hw_h__ */ 118 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/linux/iwl-config.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * This file is provided under a dual BSD/GPLv2 license. When using or 4 | * redistributing this file, you may do so under either license. 5 | * 6 | * GPL LICENSE SUMMARY 7 | * 8 | * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of version 2 of the GNU General Public License as 12 | * published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 22 | * USA 23 | * 24 | * The full GNU General Public License is included in this distribution 25 | * in the file called COPYING. 26 | * 27 | * Contact Information: 28 | * Intel Linux Wireless 29 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 30 | * 31 | * BSD LICENSE 32 | * 33 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 34 | * All rights reserved. 35 | * 36 | * Redistribution and use in source and binary forms, with or without 37 | * modification, are permitted provided that the following conditions 38 | * are met: 39 | * 40 | * * Redistributions of source code must retain the above copyright 41 | * notice, this list of conditions and the following disclaimer. 42 | * * Redistributions in binary form must reproduce the above copyright 43 | * notice, this list of conditions and the following disclaimer in 44 | * the documentation and/or other materials provided with the 45 | * distribution. 46 | * * Neither the name Intel Corporation nor the names of its 47 | * contributors may be used to endorse or promote products derived 48 | * from this software without specific prior written permission. 49 | * 50 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 51 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 52 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 53 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 54 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 55 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 56 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 57 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 58 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 59 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 60 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 61 | * 62 | *****************************************************************************/ 63 | #ifndef __IWL_CONFIG_H__ 64 | #define __IWL_CONFIG_H__ 65 | 66 | #include "linux-porting.h" 67 | 68 | //#include 69 | //#include "mac80211.h" 70 | #include "ieee80211.h" 71 | #include "linux-80211.h" 72 | #include "netdev_features.h" 73 | 74 | 75 | enum iwl_device_family { 76 | IWL_DEVICE_FAMILY_UNDEFINED, 77 | // IWL_DEVICE_FAMILY_1000, 78 | // IWL_DEVICE_FAMILY_100, 79 | // IWL_DEVICE_FAMILY_2000, 80 | // IWL_DEVICE_FAMILY_2030, 81 | // IWL_DEVICE_FAMILY_105, 82 | // IWL_DEVICE_FAMILY_135, 83 | // IWL_DEVICE_FAMILY_5000, 84 | // IWL_DEVICE_FAMILY_5150, 85 | // IWL_DEVICE_FAMILY_6000, 86 | // IWL_DEVICE_FAMILY_6000i, 87 | // IWL_DEVICE_FAMILY_6005, 88 | // IWL_DEVICE_FAMILY_6030, 89 | // IWL_DEVICE_FAMILY_6050, 90 | // IWL_DEVICE_FAMILY_6150, 91 | IWL_DEVICE_FAMILY_7000, 92 | IWL_DEVICE_FAMILY_8000, 93 | }; 94 | 95 | static inline bool iwl_has_secure_boot(u32 hw_rev, 96 | enum iwl_device_family family) 97 | { 98 | /* return 1 only for family 8000 B0 */ 99 | if ((family == IWL_DEVICE_FAMILY_8000) && (hw_rev & 0xC)) 100 | return true; 101 | 102 | return false; 103 | } 104 | 105 | /* 106 | * LED mode 107 | * IWL_LED_DEFAULT: use device default 108 | * IWL_LED_RF_STATE: turn LED on/off based on RF state 109 | * LED ON = RF ON 110 | * LED OFF = RF OFF 111 | * IWL_LED_BLINK: adjust led blink rate based on blink table 112 | * IWL_LED_DISABLE: led disabled 113 | */ 114 | enum iwl_led_mode { 115 | IWL_LED_DEFAULT, 116 | IWL_LED_RF_STATE, 117 | IWL_LED_BLINK, 118 | IWL_LED_DISABLE, 119 | }; 120 | 121 | /* 122 | * This is the threshold value of plcp error rate per 100mSecs. It is 123 | * used to set and check for the validity of plcp_delta. 124 | */ 125 | #define IWL_MAX_PLCP_ERR_THRESHOLD_MIN 1 126 | #define IWL_MAX_PLCP_ERR_THRESHOLD_DEF 50 127 | #define IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF 100 128 | #define IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF 200 129 | #define IWL_MAX_PLCP_ERR_THRESHOLD_MAX 255 130 | #define IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE 0 131 | 132 | /* TX queue watchdog timeouts in mSecs */ 133 | #define IWL_WATCHDOG_DISABLED 0 134 | #define IWL_DEF_WD_TIMEOUT 2500 135 | #define IWL_LONG_WD_TIMEOUT 10000 136 | #define IWL_MAX_WD_TIMEOUT 120000 137 | 138 | #define IWL_DEFAULT_MAX_TX_POWER 22 139 | 140 | /* Antenna presence definitions */ 141 | #define ANT_NONE 0x0 142 | #define ANT_A BIT(0) 143 | #define ANT_B BIT(1) 144 | #define ANT_C BIT(2) 145 | #define ANT_AB (ANT_A | ANT_B) 146 | #define ANT_AC (ANT_A | ANT_C) 147 | #define ANT_BC (ANT_B | ANT_C) 148 | #define ANT_ABC (ANT_A | ANT_B | ANT_C) 149 | 150 | static inline u8 num_of_ant(u8 mask) 151 | { 152 | return !!((mask) & ANT_A) + 153 | !!((mask) & ANT_B) + 154 | !!((mask) & ANT_C); 155 | } 156 | 157 | /* 158 | * @max_ll_items: max number of OTP blocks 159 | * @shadow_ram_support: shadow support for OTP memory 160 | * @led_compensation: compensate on the led on/off time per HW according 161 | * to the deviation to achieve the desired led frequency. 162 | * The detail algorithm is described in iwl-led.c 163 | * @wd_timeout: TX queues watchdog timeout 164 | * @max_event_log_size: size of event log buffer size for ucode event logging 165 | * @shadow_reg_enable: HW shadow register support 166 | * @apmg_wake_up_wa: should the MAC access REQ be asserted when a command 167 | * is in flight. This is due to a HW bug in 7260, 3160 and 7265. 168 | * @scd_chain_ext_wa: should the chain extension feature in SCD be disabled. 169 | */ 170 | struct iwl_base_params { 171 | int eeprom_size; 172 | int num_of_queues; /* def: HW dependent */ 173 | /* for iwl_pcie_apm_init() */ 174 | u32 pll_cfg_val; 175 | 176 | const u16 max_ll_items; 177 | const bool shadow_ram_support; 178 | u16 led_compensation; 179 | unsigned int wd_timeout; 180 | u32 max_event_log_size; 181 | const bool shadow_reg_enable; 182 | const bool pcie_l1_allowed; 183 | const bool apmg_wake_up_wa; 184 | const bool scd_chain_ext_wa; 185 | }; 186 | 187 | /* 188 | * @stbc: support Tx STBC and 1*SS Rx STBC 189 | * @ldpc: support Tx/Rx with LDPC 190 | * @use_rts_for_aggregation: use rts/cts protection for HT traffic 191 | * @ht40_bands: bitmap of bands (using %IEEE80211_BAND_*) that support HT40 192 | */ 193 | struct iwl_ht_params { 194 | enum ieee80211_smps_mode smps_mode; 195 | const bool ht_greenfield_support; /* if used set to true */ 196 | const bool stbc; 197 | const bool ldpc; 198 | bool use_rts_for_aggregation; 199 | u8 ht40_bands; 200 | }; 201 | 202 | /* 203 | * Tx-backoff threshold 204 | * @temperature: The threshold in Celsius 205 | * @backoff: The tx-backoff in uSec 206 | */ 207 | struct iwl_tt_tx_backoff { 208 | s32 temperature; 209 | u32 backoff; 210 | }; 211 | 212 | #define TT_TX_BACKOFF_SIZE 6 213 | 214 | /** 215 | * struct iwl_tt_params - thermal throttling parameters 216 | * @ct_kill_entry: CT Kill entry threshold 217 | * @ct_kill_exit: CT Kill exit threshold 218 | * @ct_kill_duration: The time intervals (in uSec) in which the driver needs 219 | * to checks whether to exit CT Kill. 220 | * @dynamic_smps_entry: Dynamic SMPS entry threshold 221 | * @dynamic_smps_exit: Dynamic SMPS exit threshold 222 | * @tx_protection_entry: TX protection entry threshold 223 | * @tx_protection_exit: TX protection exit threshold 224 | * @tx_backoff: Array of thresholds for tx-backoff , in ascending order. 225 | * @support_ct_kill: Support CT Kill? 226 | * @support_dynamic_smps: Support dynamic SMPS? 227 | * @support_tx_protection: Support tx protection? 228 | * @support_tx_backoff: Support tx-backoff? 229 | */ 230 | struct iwl_tt_params { 231 | u32 ct_kill_entry; 232 | u32 ct_kill_exit; 233 | u32 ct_kill_duration; 234 | u32 dynamic_smps_entry; 235 | u32 dynamic_smps_exit; 236 | u32 tx_protection_entry; 237 | u32 tx_protection_exit; 238 | struct iwl_tt_tx_backoff tx_backoff[TT_TX_BACKOFF_SIZE]; 239 | bool support_ct_kill; 240 | bool support_dynamic_smps; 241 | bool support_tx_protection; 242 | bool support_tx_backoff; 243 | }; 244 | 245 | /* 246 | * information on how to parse the EEPROM 247 | */ 248 | #define EEPROM_REG_BAND_1_CHANNELS 0x08 249 | #define EEPROM_REG_BAND_2_CHANNELS 0x26 250 | #define EEPROM_REG_BAND_3_CHANNELS 0x42 251 | #define EEPROM_REG_BAND_4_CHANNELS 0x5C 252 | #define EEPROM_REG_BAND_5_CHANNELS 0x74 253 | #define EEPROM_REG_BAND_24_HT40_CHANNELS 0x82 254 | #define EEPROM_REG_BAND_52_HT40_CHANNELS 0x92 255 | #define EEPROM_6000_REG_BAND_24_HT40_CHANNELS 0x80 256 | #define EEPROM_REGULATORY_BAND_NO_HT40 0 257 | 258 | /* lower blocks contain EEPROM image and calibration data */ 259 | #define OTP_LOW_IMAGE_SIZE (2 * 512 * sizeof(u16)) /* 2 KB */ 260 | #define OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(u16)) /* 16 KB */ 261 | #define OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(u16)) /* 32 KB */ 262 | 263 | struct iwl_eeprom_params { 264 | const u8 regulatory_bands[7]; 265 | bool enhanced_txpower; 266 | }; 267 | 268 | /* Tx-backoff power threshold 269 | * @pwr: The power limit in mw 270 | * @backoff: The tx-backoff in uSec 271 | */ 272 | struct iwl_pwr_tx_backoff { 273 | u32 pwr; 274 | u32 backoff; 275 | }; 276 | 277 | /** 278 | * struct iwl_cfg 279 | * @name: Official name of the device 280 | * @fw_name_pre: Firmware filename prefix. The api version and extension 281 | * (.ucode) will be added to filename before loading from disk. The 282 | * filename is constructed as fw_name_pre.ucode. 283 | * @ucode_api_max: Highest version of uCode API supported by driver. 284 | * @ucode_api_ok: oldest version of the uCode API that is OK to load 285 | * without a warning, for use in transitions 286 | * @ucode_api_min: Lowest version of uCode API supported by driver. 287 | * @max_inst_size: The maximal length of the fw inst section 288 | * @max_data_size: The maximal length of the fw data section 289 | * @valid_tx_ant: valid transmit antenna 290 | * @valid_rx_ant: valid receive antenna 291 | * @non_shared_ant: the antenna that is for WiFi only 292 | * @nvm_ver: NVM version 293 | * @nvm_calib_ver: NVM calibration version 294 | * @lib: pointer to the lib ops 295 | * @base_params: pointer to basic parameters 296 | * @ht_params: point to ht parameters 297 | * @led_mode: 0=blinking, 1=On(RF On)/Off(RF Off) 298 | * @rx_with_siso_diversity: 1x1 device with rx antenna diversity 299 | * @internal_wimax_coex: internal wifi/wimax combo device 300 | * @high_temp: Is this NIC is designated to be in high temperature. 301 | * @host_interrupt_operation_mode: device needs host interrupt operation 302 | * mode set 303 | * @d0i3: device uses d0i3 instead of d3 304 | * @nvm_hw_section_num: the ID of the HW NVM section 305 | * @features: hw features, any combination of feature_whitelist 306 | * @pwr_tx_backoffs: translation table between power limits and backoffs 307 | * @max_rx_agg_size: max RX aggregation size of the ADDBA request/response 308 | * @max_tx_agg_size: max TX aggregation size of the ADDBA request/response 309 | * @max_ht_ampdu_factor: the exponent of the max length of A-MPDU that the 310 | * station can receive in HT 311 | * @max_vht_ampdu_exponent: the exponent of the max length of A-MPDU that the 312 | * station can receive in VHT 313 | * @dccm_offset: offset from which DCCM begins 314 | * @dccm_len: length of DCCM (including runtime stack CCM) 315 | * @dccm2_offset: offset from which the second DCCM begins 316 | * @dccm2_len: length of the second DCCM 317 | * @smem_offset: offset from which the SMEM begins 318 | * @smem_len: the length of SMEM 319 | * 320 | * We enable the driver to be backward compatible wrt. hardware features. 321 | * API differences in uCode shouldn't be handled here but through TLVs 322 | * and/or the uCode API version instead. 323 | */ 324 | struct iwl_cfg { 325 | /* params specific to an individual device within a device family */ 326 | const char *name; 327 | const char *fw_name_pre; 328 | const unsigned int ucode_api_max; 329 | const unsigned int ucode_api_ok; 330 | const unsigned int ucode_api_min; 331 | const enum iwl_device_family device_family; 332 | const u32 max_data_size; 333 | const u32 max_inst_size; 334 | u8 valid_tx_ant; 335 | u8 valid_rx_ant; 336 | u8 non_shared_ant; 337 | bool bt_shared_single_ant; 338 | u16 nvm_ver; 339 | u16 nvm_calib_ver; 340 | /* params not likely to change within a device family */ 341 | const struct iwl_base_params *base_params; 342 | /* params likely to change within a device family */ 343 | const struct iwl_ht_params *ht_params; 344 | const struct iwl_eeprom_params *eeprom_params; 345 | enum iwl_led_mode led_mode; 346 | const bool rx_with_siso_diversity; 347 | const bool internal_wimax_coex; 348 | const bool host_interrupt_operation_mode; 349 | bool high_temp; 350 | bool d0i3; 351 | u8 nvm_hw_section_num; 352 | bool lp_xtal_workaround; 353 | const struct iwl_pwr_tx_backoff *pwr_tx_backoffs; 354 | bool no_power_up_nic_in_init; 355 | const char *default_nvm_file_B_step; 356 | const char *default_nvm_file_C_step; 357 | netdev_features_t features; 358 | unsigned int max_rx_agg_size; 359 | bool disable_dummy_notification; 360 | unsigned int max_tx_agg_size; 361 | unsigned int max_ht_ampdu_exponent; 362 | unsigned int max_vht_ampdu_exponent; 363 | const u32 dccm_offset; 364 | const u32 dccm_len; 365 | const u32 dccm2_offset; 366 | const u32 dccm2_len; 367 | const u32 smem_offset; 368 | const u32 smem_len; 369 | const struct iwl_tt_params *thermal_params; 370 | bool apmg_not_supported; 371 | }; 372 | 373 | /* 374 | * This list declares the config structures for all devices. 375 | */ 376 | //#if IS_ENABLED(CONFIG_IWLDVM) 377 | //extern const struct iwl_cfg iwl5300_agn_cfg; 378 | //extern const struct iwl_cfg iwl5100_agn_cfg; 379 | //extern const struct iwl_cfg iwl5350_agn_cfg; 380 | //extern const struct iwl_cfg iwl5100_bgn_cfg; 381 | //extern const struct iwl_cfg iwl5100_abg_cfg; 382 | //extern const struct iwl_cfg iwl5150_agn_cfg; 383 | //extern const struct iwl_cfg iwl5150_abg_cfg; 384 | //extern const struct iwl_cfg iwl6005_2agn_cfg; 385 | //extern const struct iwl_cfg iwl6005_2abg_cfg; 386 | //extern const struct iwl_cfg iwl6005_2bg_cfg; 387 | //extern const struct iwl_cfg iwl6005_2agn_sff_cfg; 388 | //extern const struct iwl_cfg iwl6005_2agn_d_cfg; 389 | //extern const struct iwl_cfg iwl6005_2agn_mow1_cfg; 390 | //extern const struct iwl_cfg iwl6005_2agn_mow2_cfg; 391 | //extern const struct iwl_cfg iwl1030_bgn_cfg; 392 | //extern const struct iwl_cfg iwl1030_bg_cfg; 393 | //extern const struct iwl_cfg iwl6030_2agn_cfg; 394 | //extern const struct iwl_cfg iwl6030_2abg_cfg; 395 | //extern const struct iwl_cfg iwl6030_2bgn_cfg; 396 | //extern const struct iwl_cfg iwl6030_2bg_cfg; 397 | //extern const struct iwl_cfg iwl6000i_2agn_cfg; 398 | //extern const struct iwl_cfg iwl6000i_2abg_cfg; 399 | //extern const struct iwl_cfg iwl6000i_2bg_cfg; 400 | //extern const struct iwl_cfg iwl6000_3agn_cfg; 401 | //extern const struct iwl_cfg iwl6050_2agn_cfg; 402 | //extern const struct iwl_cfg iwl6050_2abg_cfg; 403 | //extern const struct iwl_cfg iwl6150_bgn_cfg; 404 | //extern const struct iwl_cfg iwl6150_bg_cfg; 405 | //extern const struct iwl_cfg iwl1000_bgn_cfg; 406 | //extern const struct iwl_cfg iwl1000_bg_cfg; 407 | //extern const struct iwl_cfg iwl100_bgn_cfg; 408 | //extern const struct iwl_cfg iwl100_bg_cfg; 409 | //extern const struct iwl_cfg iwl130_bgn_cfg; 410 | //extern const struct iwl_cfg iwl130_bg_cfg; 411 | //extern const struct iwl_cfg iwl2000_2bgn_cfg; 412 | //extern const struct iwl_cfg iwl2000_2bgn_d_cfg; 413 | //extern const struct iwl_cfg iwl2030_2bgn_cfg; 414 | //extern const struct iwl_cfg iwl6035_2agn_cfg; 415 | //extern const struct iwl_cfg iwl6035_2agn_sff_cfg; 416 | //extern const struct iwl_cfg iwl105_bgn_cfg; 417 | //extern const struct iwl_cfg iwl105_bgn_d_cfg; 418 | //extern const struct iwl_cfg iwl135_bgn_cfg; 419 | //#endif /* CONFIG_IWLDVM */ 420 | //#if IS_ENABLED(CONFIG_IWLMVM) 421 | //extern const struct iwl_cfg iwl7260_2ac_cfg; 422 | //extern const struct iwl_cfg iwl7260_2ac_cfg_high_temp; 423 | //extern const struct iwl_cfg iwl7260_2n_cfg; 424 | //extern const struct iwl_cfg iwl7260_n_cfg; 425 | //extern const struct iwl_cfg iwl3160_2ac_cfg; 426 | //extern const struct iwl_cfg iwl3160_2n_cfg; 427 | //extern const struct iwl_cfg iwl3160_n_cfg; 428 | //extern const struct iwl_cfg iwl3165_2ac_cfg; 429 | //extern const struct iwl_cfg iwl7265_2ac_cfg; 430 | //extern const struct iwl_cfg iwl7265_2n_cfg; 431 | //extern const struct iwl_cfg iwl7265_n_cfg; 432 | //extern const struct iwl_cfg iwl7265d_2ac_cfg; 433 | //extern const struct iwl_cfg iwl7265d_2n_cfg; 434 | //extern const struct iwl_cfg iwl7265d_n_cfg; 435 | //extern const struct iwl_cfg iwl8260_2n_cfg; 436 | //extern const struct iwl_cfg iwl8260_2ac_cfg; 437 | //extern const struct iwl_cfg iwl4165_2ac_cfg; 438 | //extern const struct iwl_cfg iwl8260_2ac_sdio_cfg; 439 | //extern const struct iwl_cfg iwl4165_2ac_sdio_cfg; 440 | //#endif /* CONFIG_IWLMVM */ 441 | 442 | #endif /* __IWL_CONFIG_H__ */ 443 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/linux/iwl-fw-error-dump.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * This file is provided under a dual BSD/GPLv2 license. When using or 4 | * redistributing this file, you may do so under either license. 5 | * 6 | * GPL LICENSE SUMMARY 7 | * 8 | * Copyright(c) 2014 Intel Corporation. All rights reserved. 9 | * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of version 2 of the GNU General Public License as 13 | * published by the Free Software Foundation. 14 | * 15 | * This program is distributed in the hope that it will be useful, but 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 23 | * USA 24 | * 25 | * The full GNU General Public License is included in this distribution 26 | * in the file called COPYING. 27 | * 28 | * Contact Information: 29 | * Intel Linux Wireless 30 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 31 | * 32 | * BSD LICENSE 33 | * 34 | * Copyright(c) 2014 Intel Corporation. All rights reserved. 35 | * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH 36 | * All rights reserved. 37 | * 38 | * Redistribution and use in source and binary forms, with or without 39 | * modification, are permitted provided that the following conditions 40 | * are met: 41 | * 42 | * * Redistributions of source code must retain the above copyright 43 | * notice, this list of conditions and the following disclaimer. 44 | * * Redistributions in binary form must reproduce the above copyright 45 | * notice, this list of conditions and the following disclaimer in 46 | * the documentation and/or other materials provided with the 47 | * distribution. 48 | * * Neither the name Intel Corporation nor the names of its 49 | * contributors may be used to endorse or promote products derived 50 | * from this software without specific prior written permission. 51 | * 52 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 53 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 54 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 55 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 56 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 57 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 58 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 59 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 60 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 61 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 62 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 63 | *****************************************************************************/ 64 | 65 | #ifndef __fw_error_dump_h__ 66 | #define __fw_error_dump_h__ 67 | 68 | //#include 69 | 70 | #define IWL_FW_ERROR_DUMP_BARKER 0x14789632 71 | #define FW_VER_HUMAN_READABLE_SZ 64 72 | 73 | /** 74 | * enum iwl_fw_error_dump_type - types of data in the dump file 75 | * @IWL_FW_ERROR_DUMP_CSR: Control Status Registers - from offset 0 76 | * @IWL_FW_ERROR_DUMP_RXF: 77 | * @IWL_FW_ERROR_DUMP_TXCMD: last TX command data, structured as 78 | * &struct iwl_fw_error_dump_txcmd packets 79 | * @IWL_FW_ERROR_DUMP_DEV_FW_INFO: struct %iwl_fw_error_dump_info 80 | * info on the device / firmware. 81 | * @IWL_FW_ERROR_DUMP_FW_MONITOR: firmware monitor 82 | * @IWL_FW_ERROR_DUMP_PRPH: range of periphery registers - there can be several 83 | * sections like this in a single file. 84 | * @IWL_FW_ERROR_DUMP_FH_REGS: range of FH registers 85 | * @IWL_FW_ERROR_DUMP_MEM: chunk of memory 86 | * @IWL_FW_ERROR_DUMP_ERROR_INFO: description of what triggered this dump. 87 | * Structured as &struct iwl_fw_error_dump_trigger_desc. 88 | * @IWL_FW_ERROR_DUMP_RB: the content of an RB structured as 89 | * &struct iwl_fw_error_dump_rb 90 | * @IWL_FW_ERROR_PAGING: UMAC's image memory segments which were 91 | * paged to the DRAM. 92 | */ 93 | enum iwl_fw_error_dump_type { 94 | /* 0 is deprecated */ 95 | IWL_FW_ERROR_DUMP_CSR = 1, 96 | IWL_FW_ERROR_DUMP_RXF = 2, 97 | IWL_FW_ERROR_DUMP_TXCMD = 3, 98 | IWL_FW_ERROR_DUMP_DEV_FW_INFO = 4, 99 | IWL_FW_ERROR_DUMP_FW_MONITOR = 5, 100 | IWL_FW_ERROR_DUMP_PRPH = 6, 101 | IWL_FW_ERROR_DUMP_TXF = 7, 102 | IWL_FW_ERROR_DUMP_FH_REGS = 8, 103 | IWL_FW_ERROR_DUMP_MEM = 9, 104 | IWL_FW_ERROR_DUMP_ERROR_INFO = 10, 105 | IWL_FW_ERROR_DUMP_RB = 11, 106 | IWL_FW_ERROR_DUMP_PAGING = 12, 107 | 108 | IWL_FW_ERROR_DUMP_MAX, 109 | }; 110 | 111 | /** 112 | * struct iwl_fw_error_dump_data - data for one type 113 | * @type: %enum iwl_fw_error_dump_type 114 | * @len: the length starting from %data 115 | * @data: the data itself 116 | */ 117 | #pragma pack(1) 118 | struct iwl_fw_error_dump_data { 119 | __le32 type; 120 | __le32 len; 121 | __u8 data[]; 122 | };//__packed; 123 | #pragma options align=reset 124 | 125 | /** 126 | * struct iwl_fw_error_dump_file - the layout of the header of the file 127 | * @barker: must be %IWL_FW_ERROR_DUMP_BARKER 128 | * @file_len: the length of all the file starting from %barker 129 | * @data: array of %struct iwl_fw_error_dump_data 130 | */ 131 | #pragma pack(1) 132 | struct iwl_fw_error_dump_file { 133 | __le32 barker; 134 | __le32 file_len; 135 | u8 data[0]; 136 | };//__packed; 137 | #pragma options align=reset 138 | 139 | /** 140 | * struct iwl_fw_error_dump_txcmd - TX command data 141 | * @cmdlen: original length of command 142 | * @caplen: captured length of command (may be less) 143 | * @data: captured command data, @caplen bytes 144 | */ 145 | #pragma pack(1) 146 | struct iwl_fw_error_dump_txcmd { 147 | __le32 cmdlen; 148 | __le32 caplen; 149 | u8 data[]; 150 | };//__packed; 151 | #pragma options align=reset 152 | 153 | 154 | /** 155 | * struct iwl_fw_error_dump_fifo - RX/TX FIFO data 156 | * @fifo_num: number of FIFO (starting from 0) 157 | * @available_bytes: num of bytes available in FIFO (may be less than FIFO size) 158 | * @wr_ptr: position of write pointer 159 | * @rd_ptr: position of read pointer 160 | * @fence_ptr: position of fence pointer 161 | * @fence_mode: the current mode of the fence (before locking) - 162 | * 0=follow RD pointer ; 1 = freeze 163 | * @data: all of the FIFO's data 164 | */ 165 | #pragma pack(1) 166 | struct iwl_fw_error_dump_fifo { 167 | __le32 fifo_num; 168 | __le32 available_bytes; 169 | __le32 wr_ptr; 170 | __le32 rd_ptr; 171 | __le32 fence_ptr; 172 | __le32 fence_mode; 173 | u8 data[]; 174 | };//__packed; 175 | #pragma options align=reset 176 | 177 | 178 | enum iwl_fw_error_dump_family { 179 | IWL_FW_ERROR_DUMP_FAMILY_7 = 7, 180 | IWL_FW_ERROR_DUMP_FAMILY_8 = 8, 181 | }; 182 | 183 | /** 184 | * struct iwl_fw_error_dump_info - info on the device / firmware 185 | * @device_family: the family of the device (7 / 8) 186 | * @hw_step: the step of the device 187 | * @fw_human_readable: human readable FW version 188 | * @dev_human_readable: name of the device 189 | * @bus_human_readable: name of the bus used 190 | */ 191 | #pragma pack(1) 192 | struct iwl_fw_error_dump_info { 193 | __le32 device_family; 194 | __le32 hw_step; 195 | u8 fw_human_readable[FW_VER_HUMAN_READABLE_SZ]; 196 | u8 dev_human_readable[64]; 197 | u8 bus_human_readable[8]; 198 | };//__packed; 199 | #pragma options align=reset 200 | 201 | 202 | /** 203 | * struct iwl_fw_error_dump_fw_mon - FW monitor data 204 | * @fw_mon_wr_ptr: the position of the write pointer in the cyclic buffer 205 | * @fw_mon_base_ptr: base pointer of the data 206 | * @fw_mon_cycle_cnt: number of wraparounds 207 | * @reserved: for future use 208 | * @data: captured data 209 | */ 210 | #pragma pack(1) 211 | struct iwl_fw_error_dump_fw_mon { 212 | __le32 fw_mon_wr_ptr; 213 | __le32 fw_mon_base_ptr; 214 | __le32 fw_mon_cycle_cnt; 215 | __le32 reserved[3]; 216 | u8 data[]; 217 | };//__packed; 218 | #pragma options align=reset 219 | 220 | 221 | /** 222 | * struct iwl_fw_error_dump_prph - periphery registers data 223 | * @prph_start: address of the first register in this chunk 224 | * @data: the content of the registers 225 | */ 226 | struct iwl_fw_error_dump_prph { 227 | __le32 prph_start; 228 | __le32 data[]; 229 | }; 230 | 231 | enum iwl_fw_error_dump_mem_type { 232 | IWL_FW_ERROR_DUMP_MEM_SRAM, 233 | IWL_FW_ERROR_DUMP_MEM_SMEM, 234 | }; 235 | 236 | /** 237 | * struct iwl_fw_error_dump_mem - chunk of memory 238 | * @type: %enum iwl_fw_error_dump_mem_type 239 | * @offset: the offset from which the memory was read 240 | * @data: the content of the memory 241 | */ 242 | struct iwl_fw_error_dump_mem { 243 | __le32 type; 244 | __le32 offset; 245 | u8 data[]; 246 | }; 247 | 248 | /** 249 | * struct iwl_fw_error_dump_rb - content of an Receive Buffer 250 | * @index: the index of the Receive Buffer in the Rx queue 251 | * @rxq: the RB's Rx queue 252 | * @reserved: 253 | * @data: the content of the Receive Buffer 254 | */ 255 | struct iwl_fw_error_dump_rb { 256 | __le32 index; 257 | __le32 rxq; 258 | __le32 reserved; 259 | u8 data[]; 260 | }; 261 | 262 | /** 263 | * struct iwl_fw_error_dump_paging - content of the UMAC's image page 264 | * block on DRAM 265 | * @index: the index of the page block 266 | * @reserved: 267 | * @data: the content of the page block 268 | */ 269 | struct iwl_fw_error_dump_paging { 270 | __le32 index; 271 | __le32 reserved; 272 | u8 data[]; 273 | }; 274 | 275 | /** 276 | * iwl_fw_error_next_data - advance fw error dump data pointer 277 | * @data: previous data block 278 | * Returns: next data block 279 | */ 280 | static inline struct iwl_fw_error_dump_data * 281 | iwl_fw_error_next_data(struct iwl_fw_error_dump_data *data) 282 | { 283 | return (struct iwl_fw_error_dump_data *)(data->data + le32_to_cpu(data->len)); 284 | } 285 | 286 | /** 287 | * enum iwl_fw_dbg_trigger - triggers available 288 | * 289 | * @FW_DBG_TRIGGER_USER: trigger log collection by user 290 | * This should not be defined as a trigger to the driver, but a value the 291 | * driver should set to indicate that the trigger was initiated by the 292 | * user. 293 | * @FW_DBG_TRIGGER_FW_ASSERT: trigger log collection when the firmware asserts 294 | * @FW_DBG_TRIGGER_MISSED_BEACONS: trigger log collection when beacons are 295 | * missed. 296 | * @FW_DBG_TRIGGER_CHANNEL_SWITCH: trigger log collection upon channel switch. 297 | * @FW_DBG_TRIGGER_FW_NOTIF: trigger log collection when the firmware sends a 298 | * command response or a notification. 299 | * @FW_DBG_TRIGGER_MLME: trigger log collection upon MLME event. 300 | * @FW_DBG_TRIGGER_STATS: trigger log collection upon statistics threshold. 301 | * @FW_DBG_TRIGGER_RSSI: trigger log collection when the rssi of the beacon 302 | * goes below a threshold. 303 | * @FW_DBG_TRIGGER_TXQ_TIMERS: configures the timers for the Tx queue hang 304 | * detection. 305 | * @FW_DBG_TRIGGER_TIME_EVENT: trigger log collection upon time events related 306 | * events. 307 | * @FW_DBG_TRIGGER_BA: trigger log collection upon BlockAck related events. 308 | */ 309 | enum iwl_fw_dbg_trigger { 310 | FW_DBG_TRIGGER_INVALID = 0, 311 | FW_DBG_TRIGGER_USER, 312 | FW_DBG_TRIGGER_FW_ASSERT, 313 | FW_DBG_TRIGGER_MISSED_BEACONS, 314 | FW_DBG_TRIGGER_CHANNEL_SWITCH, 315 | FW_DBG_TRIGGER_FW_NOTIF, 316 | FW_DBG_TRIGGER_MLME, 317 | FW_DBG_TRIGGER_STATS, 318 | FW_DBG_TRIGGER_RSSI, 319 | FW_DBG_TRIGGER_TXQ_TIMERS, 320 | FW_DBG_TRIGGER_TIME_EVENT, 321 | FW_DBG_TRIGGER_BA, 322 | 323 | /* must be last */ 324 | FW_DBG_TRIGGER_MAX, 325 | }; 326 | 327 | /** 328 | * struct iwl_fw_error_dump_trigger_desc - describes the trigger condition 329 | * @type: %enum iwl_fw_dbg_trigger 330 | * @data: raw data about what happened 331 | */ 332 | struct iwl_fw_error_dump_trigger_desc { 333 | __le32 type; 334 | u8 data[]; 335 | }; 336 | 337 | #endif /* __fw_error_dump_h__ */ 338 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/linux/linux-80211.h: -------------------------------------------------------------------------------- 1 | // 2 | // linux-80211.h 3 | // 4 | // Various definitions from Linux 80211 header files used by the included Intel header files 5 | // 6 | // Copyright © 2016 Aaron Mulder. All rights reserved. 7 | // 8 | 9 | #ifndef linux_80211_h 10 | #define linux_80211_h 11 | 12 | /** 13 | * enum nl80211_band - Frequency band 14 | * @NL80211_BAND_2GHZ: 2.4 GHz ISM band 15 | * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz) 16 | * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz) 17 | */ 18 | enum nl80211_band { 19 | NL80211_BAND_2GHZ, 20 | NL80211_BAND_5GHZ, 21 | NL80211_BAND_60GHZ, 22 | }; 23 | 24 | /** 25 | * enum ieee80211_band - supported frequency bands 26 | * 27 | * The bands are assigned this way because the supported 28 | * bitrates differ in these bands. 29 | * 30 | * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band 31 | * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7) 32 | * @IEEE80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz) 33 | * @IEEE80211_NUM_BANDS: number of defined bands 34 | */ 35 | enum ieee80211_band { 36 | IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ, 37 | IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ, 38 | IEEE80211_BAND_60GHZ = NL80211_BAND_60GHZ, 39 | 40 | /* keep last */ 41 | IEEE80211_NUM_BANDS 42 | }; 43 | 44 | 45 | /** 46 | * enum ieee80211_smps_mode - spatial multiplexing power save mode 47 | * 48 | * @IEEE80211_SMPS_AUTOMATIC: automatic 49 | * @IEEE80211_SMPS_OFF: off 50 | * @IEEE80211_SMPS_STATIC: static 51 | * @IEEE80211_SMPS_DYNAMIC: dynamic 52 | * @IEEE80211_SMPS_NUM_MODES: internal, don't use 53 | */ 54 | enum ieee80211_smps_mode { 55 | IEEE80211_SMPS_AUTOMATIC, 56 | IEEE80211_SMPS_OFF, 57 | IEEE80211_SMPS_STATIC, 58 | IEEE80211_SMPS_DYNAMIC, 59 | 60 | /* keep last */ 61 | IEEE80211_SMPS_NUM_MODES, 62 | }; 63 | 64 | /** 65 | * struct ieee80211_cipher_scheme - cipher scheme 66 | * 67 | * This structure contains a cipher scheme information defining 68 | * the secure packet crypto handling. 69 | * 70 | * @cipher: a cipher suite selector 71 | * @iftype: a cipher iftype bit mask indicating an allowed cipher usage 72 | * @hdr_len: a length of a security header used the cipher 73 | * @pn_len: a length of a packet number in the security header 74 | * @pn_off: an offset of pn from the beginning of the security header 75 | * @key_idx_off: an offset of key index byte in the security header 76 | * @key_idx_mask: a bit mask of key_idx bits 77 | * @key_idx_shift: a bit shift needed to get key_idx 78 | * key_idx value calculation: 79 | * (sec_header_base[key_idx_off] & key_idx_mask) >> key_idx_shift 80 | * @mic_len: a mic length in bytes 81 | */ 82 | struct ieee80211_cipher_scheme { 83 | u32 cipher; 84 | u16 iftype; 85 | u8 hdr_len; 86 | u8 pn_len; 87 | u8 pn_off; 88 | u8 key_idx_off; 89 | u8 key_idx_mask; 90 | u8 key_idx_shift; 91 | u8 mic_len; 92 | }; 93 | 94 | /** 95 | * enum nl80211_iftype - (virtual) interface types 96 | * 97 | * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides 98 | * @NL80211_IFTYPE_ADHOC: independent BSS member 99 | * @NL80211_IFTYPE_STATION: managed BSS member 100 | * @NL80211_IFTYPE_AP: access point 101 | * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points; VLAN interfaces 102 | * are a bit special in that they must always be tied to a pre-existing 103 | * AP type interface. 104 | * @NL80211_IFTYPE_WDS: wireless distribution interface 105 | * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames 106 | * @NL80211_IFTYPE_MESH_POINT: mesh point 107 | * @NL80211_IFTYPE_P2P_CLIENT: P2P client 108 | * @NL80211_IFTYPE_P2P_GO: P2P group owner 109 | * @NL80211_IFTYPE_P2P_DEVICE: P2P device interface type, this is not a netdev 110 | * and therefore can't be created in the normal ways, use the 111 | * %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE 112 | * commands to create and destroy one 113 | * @NL80211_IF_TYPE_OCB: Outside Context of a BSS 114 | * This mode corresponds to the MIB variable dot11OCBActivated=true 115 | * @NL80211_IFTYPE_MAX: highest interface type number currently defined 116 | * @NUM_NL80211_IFTYPES: number of defined interface types 117 | * 118 | * These values are used with the %NL80211_ATTR_IFTYPE 119 | * to set the type of an interface. 120 | * 121 | */ 122 | enum nl80211_iftype { 123 | NL80211_IFTYPE_UNSPECIFIED, 124 | NL80211_IFTYPE_ADHOC, 125 | NL80211_IFTYPE_STATION, 126 | NL80211_IFTYPE_AP, 127 | NL80211_IFTYPE_AP_VLAN, 128 | NL80211_IFTYPE_WDS, 129 | NL80211_IFTYPE_MONITOR, 130 | NL80211_IFTYPE_MESH_POINT, 131 | NL80211_IFTYPE_P2P_CLIENT, 132 | NL80211_IFTYPE_P2P_GO, 133 | NL80211_IFTYPE_P2P_DEVICE, 134 | NL80211_IFTYPE_OCB, 135 | 136 | /* keep last */ 137 | NUM_NL80211_IFTYPES, 138 | NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1 139 | }; 140 | 141 | #endif /* linux_80211_h */ 142 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/linux/linux-porting.h: -------------------------------------------------------------------------------- 1 | /* linux.h -- Definitions to make the linux code compile under OS X. 2 | * 3 | * Copyright (c) 2014 Laura Müller 4 | * Copyright (c) 2016 Aaron Mulder 5 | * 6 | * This program is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 2 of the License, or (at your option) 9 | * any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 | * more details. 15 | */ 16 | 17 | #ifndef __linux_porting_h 18 | #define __linux_porting_h 19 | 20 | #include 21 | 22 | /******************************************************************************/ 23 | #pragma mark - 24 | #pragma mark Debugging 25 | #pragma mark - 26 | /******************************************************************************/ 27 | 28 | #define printk(args...) IOLog(args) 29 | #define WARN(test, message) check_warn_condition(test, message) 30 | #define WARN_ON(x) x 31 | #define WARN_ON_ONCE(x) x 32 | #define __rcu 33 | 34 | static bool check_warn_condition(bool test, char *message) { 35 | if(test) IOLog("%s %s", "AppleIntelWiFiMVM", message); 36 | return test; 37 | } 38 | 39 | /******************************************************************************/ 40 | #pragma mark - 41 | #pragma mark Bits and Bytes 42 | #pragma mark - 43 | /******************************************************************************/ 44 | 45 | #define HZ 1000 // Milliseconds. 46 | 47 | #if defined(__LITTLE_ENDIAN__) 48 | #define __LITTLE_ENDIAN 1234 49 | #define __LITTLE_ENDIAN_BITFIELD 50 | 51 | #elif defined(__BIG_ENDIAN__) 52 | #define __BIG_ENDIAN 4321 53 | #define __BIG_ENDIAN_BITFIELD 54 | 55 | #endif // ENDIAN 56 | 57 | #define s8 SInt8 58 | #define u8 UInt8 59 | #define u16 UInt16 60 | #define u32 UInt32 61 | #define u64 UInt64 62 | #define s32 SInt32 63 | #define s64 SInt64 64 | #define __be16 SInt16 65 | #define __be32 SInt32 66 | #define __be64 SInt64 67 | #define __le16 SInt16 68 | #define __le32 SInt32 69 | #define __le64 SInt64 70 | #define __s8 SInt8 71 | #define __s16 SInt16 72 | #define __s32 SInt32 73 | #define __s64 SInt64 74 | #define __u8 UInt8 75 | #define __u16 UInt16 76 | #define __u32 UInt32 77 | #define __u64 UInt64 78 | 79 | #define __sum16 UInt16 80 | 81 | #define ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask)) 82 | #define ALIGN(x, a) ALIGN_MASK(x, (typeof(x))(a) - 1) 83 | 84 | #define cpu_to_le16(x) OSSwapHostToLittleInt16(x) 85 | #define cpu_to_le32(x) OSSwapHostToLittleInt32(x) 86 | #define cpu_to_le64(x) OSSwapHostToLittleInt64(x) 87 | #define le16_to_cpu(x) OSSwapLittleToHostInt16(x) 88 | #define le32_to_cpu(x) OSSwapLittleToHostInt32(x) 89 | #define le64_to_cpu(x) OSSwapLittleToHostInt64(x) 90 | 91 | #define cpu_to_be16(x) OSSwapHostToBigInt16(x) 92 | #define cpu_to_be32(x) OSSwapHostToBigInt32(x) 93 | #define cpu_to_be64(x) OSSwapHostToBigInt64(x) 94 | #define be16_to_cpu(x) OSSwapBigToHostInt16(x) 95 | #define be32_to_cpu(x) OSSwapBigToHostInt32(x) 96 | #define be64_to_cpu(x) OSSwapBigToHostInt64(x) 97 | 98 | #define le16_to_cpus(x) ((*x) = OSSwapLittleToHostInt16((*x))) 99 | #define le32_to_cpus(x) ((*x) = OSSwapLittleToHostInt32((*x))) 100 | #define le64_to_cpus(x) ((*x) = OSSwapLittleToHostInt64((*x))) 101 | 102 | #define container_of(ptr, type, member) ({ \ 103 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 104 | (type *)( (char *)__mptr - offsetof(type,member) );}) 105 | 106 | //#define BITS_PER_LONG LONG_BIT 107 | #define BITS_PER_LONG 64 108 | #define BIT(nr) (1UL << (nr)) 109 | #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) 110 | #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) 111 | #define BITS_PER_BYTE 8 112 | #define BITS_TO_LONGS(bits) (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) 113 | 114 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 115 | 116 | #define min_t(type,x,y) \ 117 | ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; }) 118 | 119 | #define max_t(type, x, y) \ 120 | ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; }) 121 | 122 | #if 0 123 | enum bool_t 124 | { 125 | false = 0, 126 | true = 1 127 | }; 128 | typedef enum bool_t bool; 129 | #endif 130 | 131 | #define dma_addr_t IOPhysicalAddress64 132 | 133 | #define likely(x) __builtin_expect(!!(x), 1) 134 | #define unlikely(x) __builtin_expect(!!(x), 0) 135 | 136 | static inline int atomic_dec_and_test(volatile SInt32 * addr) 137 | { 138 | return ((OSDecrementAtomic(addr) == 1) ? 1 : 0); 139 | } 140 | 141 | static inline int atomic_inc_and_test(volatile SInt32 * addr) 142 | { 143 | return ((OSIncrementAtomic(addr) == -1) ? 1 : 0); 144 | } 145 | 146 | #define atomic_inc(v) OSIncrementAtomic(v) 147 | #define atomic_dec(v) OSDecrementAtomic(v) 148 | 149 | static inline int 150 | test_bit(int nr, const volatile unsigned long *addr) 151 | { 152 | return (OSAddAtomic(0, addr) & (1 << nr)) != 0; 153 | } 154 | 155 | static inline void 156 | set_bit(unsigned int nr, volatile unsigned long *addr) 157 | { 158 | OSTestAndSet(nr, (volatile UInt8 *)addr); 159 | } 160 | 161 | static inline void 162 | clear_bit(unsigned int nr, volatile unsigned long *addr) 163 | { 164 | OSTestAndClear(nr, (volatile UInt8 *)addr); 165 | } 166 | 167 | static inline int 168 | test_and_clear_bit(unsigned int nr, volatile unsigned long *addr) 169 | { 170 | return !OSTestAndClear(nr, (volatile UInt8 *)addr); 171 | } 172 | 173 | static inline int 174 | test_and_set_bit(unsigned int nr, volatile unsigned long *addr) 175 | { 176 | return OSTestAndSet(nr, (volatile UInt8 *)addr); 177 | } 178 | 179 | /******************************************************************************/ 180 | #pragma mark - 181 | #pragma mark Read/Write Registers 182 | #pragma mark - 183 | /******************************************************************************/ 184 | 185 | OS_INLINE 186 | void 187 | _OSWriteInt8( 188 | volatile void * base, 189 | uintptr_t byteOffset, 190 | uint16_t data 191 | ) 192 | { 193 | *(volatile uint8_t *)((uintptr_t)base + byteOffset) = data; 194 | } 195 | 196 | OS_INLINE 197 | uint8_t 198 | _OSReadInt8( 199 | const volatile void * base, 200 | uintptr_t byteOffset 201 | ) 202 | { 203 | return *(volatile uint8_t *)((uintptr_t)base + byteOffset); 204 | } 205 | 206 | #define OSWriteLittleInt8(base, byteOffset, data) \ 207 | _OSWriteInt8((base), (byteOffset), (data)) 208 | #define OSReadLittleInt8(base, byteOffset) \ 209 | _OSReadInt8((base), (byteOffset)) 210 | 211 | #define writew(hw, reg, val16) OSWriteLittleInt16((hw->hw_addr), (reg), (val16)) 212 | #define writel(hw, reg, val32) OSWriteLittleInt32((hw->hw_addr), (reg), (val32)) 213 | 214 | #define readw(hw, reg) OSReadLittleInt16((hw->hw_addr), (reg)) 215 | #define readl(hw, reg) OSReadLittleInt32((hw->hw_addr), (reg)) 216 | 217 | #define __er32(hw, reg) OSReadLittleInt32((hw->hw_addr), (reg)) 218 | 219 | #define E1000_WRITE_REG_ARRAY(a, reg, offset, value) \ 220 | (OSWriteLittleInt32((hw->hw_addr), (reg + ((offset) << 2)), (value))) 221 | 222 | #define E1000_READ_REG_ARRAY(a, reg, offset) \ 223 | (OSReadLittleInt32((hw->hw_addr), (reg + ((offset) << 2)))) 224 | 225 | #define wmb() OSSynchronizeIO() 226 | 227 | #define __er16flash(hw, reg) \ 228 | OSReadLittleInt16((hw->flash_address), (reg)) 229 | 230 | #define __er32flash(hw, reg) \ 231 | OSReadLittleInt32((hw->flash_address), (reg)) 232 | 233 | #define __ew16flash(hw, reg, val) \ 234 | OSWriteLittleInt16((hw->flash_address), (reg), (val)) 235 | 236 | #define __ew32flash(hw, reg, val) \ 237 | OSWriteLittleInt32((hw->flash_address), (reg), (val)) 238 | 239 | /******************************************************************************/ 240 | #pragma mark - 241 | #pragma mark Locks 242 | #pragma mark - 243 | /******************************************************************************/ 244 | 245 | #define spinlock_t IOSimpleLock * 246 | #define atomic_t volatile SInt32 247 | 248 | 249 | #define spin_lock_init(slock) \ 250 | do \ 251 | { \ 252 | if (*slock == NULL) \ 253 | { \ 254 | *(slock) = IOSimpleLockAlloc(); \ 255 | } \ 256 | } while (0) 257 | 258 | #define spin_lock(lock) 259 | 260 | #define spin_unlock(lock) 261 | 262 | #define spin_lock_irqsave(lock,flags) 263 | 264 | #define spin_trylock_irqsave(lock,flags) 265 | 266 | #define spin_unlock_irqrestore(lock,flags) 267 | 268 | #define usec_delay(x) IODelay(x) 269 | #define msec_delay(x) IOSleep(x) 270 | #define udelay(x) IODelay(x) 271 | #define mdelay(x) IODelay(1000*(x)) 272 | #define msleep(x) IOSleep(x) 273 | 274 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 275 | #define usleep_range(min, max) msleep(DIV_ROUND_UP(min, 1000)) 276 | 277 | enum 278 | { 279 | GFP_KERNEL, 280 | GFP_ATOMIC, 281 | }; 282 | 283 | #define EIO kIOReturnError 284 | #define EINVAL kIOReturnBadArgument 285 | #define ERFKILL kIOReturnError 286 | #define ENOMEM kIOReturnNoMemory 287 | 288 | #define __iomem volatile 289 | #define __devinit 290 | 291 | #define LINUX_VERSION_CODE 30000 292 | #define KERNEL_VERSION(x,y,z) (x*10000+100*y+z) 293 | 294 | #define irqreturn_t int 295 | 296 | 297 | #define __always_unused 298 | 299 | #define DISABLED_CODE 0 300 | 301 | struct pci_dev { 302 | UInt16 vendor; 303 | UInt16 device; 304 | UInt16 subsystem_vendor; 305 | UInt16 subsystem_device; 306 | UInt16 maxSnoop; 307 | UInt16 maxNoSnoop; 308 | UInt8 revision; 309 | }; 310 | 311 | #define dev_err(x,y,z) 312 | 313 | /** 314 | * is_zero_ether_addr - Determine if give Ethernet address is all zeros. 315 | * @addr: Pointer to a six-byte array containing the Ethernet address 316 | * 317 | * Return true if the address is all zeroes. 318 | * 319 | * Please note: addr must be aligned to u16. 320 | */ 321 | static inline bool is_zero_ether_addr(const u8 *addr) 322 | { 323 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) 324 | return ((*(const u32 *)addr) | (*(const u16 *)(addr + 4))) == 0; 325 | #else 326 | return (*(const u16 *)(addr + 0) | 327 | *(const u16 *)(addr + 2) | 328 | *(const u16 *)(addr + 4)) == 0; 329 | #endif 330 | } 331 | 332 | /** 333 | * is_multicast_ether_addr - Determine if the Ethernet address is a multicast. 334 | * @addr: Pointer to a six-byte array containing the Ethernet address 335 | * 336 | * Return true if the address is a multicast address. 337 | * By definition the broadcast address is also a multicast address. 338 | */ 339 | static inline bool is_multicast_ether_addr(const u8 *addr) 340 | { 341 | return 0x01 & addr[0]; 342 | } 343 | 344 | /** 345 | * is_valid_ether_addr - Determine if the given Ethernet address is valid 346 | * @addr: Pointer to a six-byte array containing the Ethernet address 347 | * 348 | * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not 349 | * a multicast address, and is not FF:FF:FF:FF:FF:FF. 350 | * 351 | * Return true if the address is valid. 352 | * 353 | * Please note: addr must be aligned to u16. 354 | */ 355 | static inline bool is_valid_ether_addr(const u8 *addr) 356 | { 357 | /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to 358 | * explicitly check for it here. */ 359 | return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); 360 | } 361 | 362 | #define e_dbg(format, arg...) 363 | #define e_err(format, arg...) 364 | #define e_info(format, arg...) 365 | #define e_warn(format, arg...) 366 | #define e_notice(format, arg...) 367 | 368 | #define DEFINE_MUTEX(x) void x##_dummy(){} 369 | #define mutex_lock(x) 370 | #define mutex_unlock(x) 371 | 372 | #define net_device e1000_adapter 373 | #define netdev_priv(x) ((struct e1000_adapter *)x) 374 | 375 | #define do_div(lat_ns, speed) \ 376 | (lat_ns) = (UInt64)(lat_ns) / (speed) 377 | 378 | #define ether_crc_le(length, data) _kc_ether_crc_le(length, data) 379 | 380 | static inline unsigned int _kc_ether_crc_le(int length, unsigned char *data) 381 | { 382 | unsigned int crc = 0xffffffff; /* Initial value. */ 383 | while(--length >= 0) { 384 | unsigned char current_octet = *data++; 385 | int bit; 386 | for (bit = 8; --bit >= 0; current_octet >>= 1) { 387 | if ((crc ^ current_octet) & 1) { 388 | crc >>= 1; 389 | crc ^= 0xedb88320U; 390 | } else 391 | crc >>= 1; 392 | } 393 | } 394 | return crc; 395 | } 396 | 397 | /** 398 | * kmemdup - duplicate region of memory 399 | * 400 | * @src: memory region to duplicate 401 | * @len: memory region length 402 | * @gfp: GFP mask to use 403 | */ 404 | static void *kmemdup(const void *src, size_t len, int gfp) { 405 | void *p; 406 | p = IOMalloc(len); 407 | if (p) 408 | memcpy(p, src, len); 409 | return p; 410 | } 411 | 412 | 413 | #define VLAN_ETH_FRAME_LEN 1518 /* Max. octets in frame sans FCS */ 414 | 415 | #endif 416 | -------------------------------------------------------------------------------- /AppleIntelWiFiMVM/linux/netdev_features.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Network device features. 3 | * 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 8 | * 2 of the License, or (at your option) any later version. 9 | */ 10 | #ifndef _LINUX_NETDEV_FEATURES_H 11 | #define _LINUX_NETDEV_FEATURES_H 12 | 13 | //#include 14 | 15 | typedef u64 netdev_features_t; 16 | 17 | enum { 18 | NETIF_F_SG_BIT, /* Scatter/gather IO. */ 19 | NETIF_F_IP_CSUM_BIT, /* Can checksum TCP/UDP over IPv4. */ 20 | __UNUSED_NETIF_F_1, 21 | NETIF_F_HW_CSUM_BIT, /* Can checksum all the packets. */ 22 | NETIF_F_IPV6_CSUM_BIT, /* Can checksum TCP/UDP over IPV6 */ 23 | NETIF_F_HIGHDMA_BIT, /* Can DMA to high memory. */ 24 | NETIF_F_FRAGLIST_BIT, /* Scatter/gather IO. */ 25 | NETIF_F_HW_VLAN_CTAG_TX_BIT, /* Transmit VLAN CTAG HW acceleration */ 26 | NETIF_F_HW_VLAN_CTAG_RX_BIT, /* Receive VLAN CTAG HW acceleration */ 27 | NETIF_F_HW_VLAN_CTAG_FILTER_BIT,/* Receive filtering on VLAN CTAGs */ 28 | NETIF_F_VLAN_CHALLENGED_BIT, /* Device cannot handle VLAN packets */ 29 | NETIF_F_GSO_BIT, /* Enable software GSO. */ 30 | NETIF_F_LLTX_BIT, /* LockLess TX - deprecated. Please */ 31 | /* do not use LLTX in new drivers */ 32 | NETIF_F_NETNS_LOCAL_BIT, /* Does not change network namespaces */ 33 | NETIF_F_GRO_BIT, /* Generic receive offload */ 34 | NETIF_F_LRO_BIT, /* large receive offload */ 35 | 36 | /**/NETIF_F_GSO_SHIFT, /* keep the order of SKB_GSO_* bits */ 37 | NETIF_F_TSO_BIT /* ... TCPv4 segmentation */ 38 | = NETIF_F_GSO_SHIFT, 39 | NETIF_F_UFO_BIT, /* ... UDPv4 fragmentation */ 40 | NETIF_F_GSO_ROBUST_BIT, /* ... ->SKB_GSO_DODGY */ 41 | NETIF_F_TSO_ECN_BIT, /* ... TCP ECN support */ 42 | NETIF_F_TSO6_BIT, /* ... TCPv6 segmentation */ 43 | NETIF_F_FSO_BIT, /* ... FCoE segmentation */ 44 | NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */ 45 | NETIF_F_GSO_GRE_CSUM_BIT, /* ... GRE with csum with TSO */ 46 | NETIF_F_GSO_IPIP_BIT, /* ... IPIP tunnel with TSO */ 47 | NETIF_F_GSO_SIT_BIT, /* ... SIT tunnel with TSO */ 48 | NETIF_F_GSO_UDP_TUNNEL_BIT, /* ... UDP TUNNEL with TSO */ 49 | NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT,/* ... UDP TUNNEL with TSO & CSUM */ 50 | NETIF_F_GSO_TUNNEL_REMCSUM_BIT, /* ... TUNNEL with TSO & REMCSUM */ 51 | /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */ 52 | NETIF_F_GSO_TUNNEL_REMCSUM_BIT, 53 | 54 | NETIF_F_FCOE_CRC_BIT, /* FCoE CRC32 */ 55 | NETIF_F_SCTP_CSUM_BIT, /* SCTP checksum offload */ 56 | NETIF_F_FCOE_MTU_BIT, /* Supports max FCoE MTU, 2158 bytes*/ 57 | NETIF_F_NTUPLE_BIT, /* N-tuple filters supported */ 58 | NETIF_F_RXHASH_BIT, /* Receive hashing offload */ 59 | NETIF_F_RXCSUM_BIT, /* Receive checksumming offload */ 60 | NETIF_F_NOCACHE_COPY_BIT, /* Use no-cache copyfromuser */ 61 | NETIF_F_LOOPBACK_BIT, /* Enable loopback */ 62 | NETIF_F_RXFCS_BIT, /* Append FCS to skb pkt data */ 63 | NETIF_F_RXALL_BIT, /* Receive errored frames too */ 64 | NETIF_F_HW_VLAN_STAG_TX_BIT, /* Transmit VLAN STAG HW acceleration */ 65 | NETIF_F_HW_VLAN_STAG_RX_BIT, /* Receive VLAN STAG HW acceleration */ 66 | NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */ 67 | NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ 68 | NETIF_F_BUSY_POLL_BIT, /* Busy poll */ 69 | 70 | /* 71 | * Add your fresh new feature above and remember to update 72 | * netdev_features_strings[] in net/core/ethtool.c and maybe 73 | * some feature mask #defines below. Please also describe it 74 | * in Documentation/networking/netdev-features.txt. 75 | */ 76 | 77 | /**/NETDEV_FEATURE_COUNT 78 | }; 79 | 80 | /* copy'n'paste compression ;) */ 81 | #define __NETIF_F_BIT(bit) ((netdev_features_t)1 << (bit)) 82 | #define __NETIF_F(name) __NETIF_F_BIT(NETIF_F_##name##_BIT) 83 | 84 | #define NETIF_F_FCOE_CRC __NETIF_F(FCOE_CRC) 85 | #define NETIF_F_FCOE_MTU __NETIF_F(FCOE_MTU) 86 | #define NETIF_F_FRAGLIST __NETIF_F(FRAGLIST) 87 | #define NETIF_F_FSO __NETIF_F(FSO) 88 | #define NETIF_F_GRO __NETIF_F(GRO) 89 | #define NETIF_F_GSO __NETIF_F(GSO) 90 | #define NETIF_F_GSO_ROBUST __NETIF_F(GSO_ROBUST) 91 | #define NETIF_F_HIGHDMA __NETIF_F(HIGHDMA) 92 | #define NETIF_F_HW_CSUM __NETIF_F(HW_CSUM) 93 | #define NETIF_F_HW_VLAN_CTAG_FILTER __NETIF_F(HW_VLAN_CTAG_FILTER) 94 | #define NETIF_F_HW_VLAN_CTAG_RX __NETIF_F(HW_VLAN_CTAG_RX) 95 | #define NETIF_F_HW_VLAN_CTAG_TX __NETIF_F(HW_VLAN_CTAG_TX) 96 | #define NETIF_F_IP_CSUM __NETIF_F(IP_CSUM) 97 | #define NETIF_F_IPV6_CSUM __NETIF_F(IPV6_CSUM) 98 | #define NETIF_F_LLTX __NETIF_F(LLTX) 99 | #define NETIF_F_LOOPBACK __NETIF_F(LOOPBACK) 100 | #define NETIF_F_LRO __NETIF_F(LRO) 101 | #define NETIF_F_NETNS_LOCAL __NETIF_F(NETNS_LOCAL) 102 | #define NETIF_F_NOCACHE_COPY __NETIF_F(NOCACHE_COPY) 103 | #define NETIF_F_NTUPLE __NETIF_F(NTUPLE) 104 | #define NETIF_F_RXCSUM __NETIF_F(RXCSUM) 105 | #define NETIF_F_RXHASH __NETIF_F(RXHASH) 106 | #define NETIF_F_SCTP_CSUM __NETIF_F(SCTP_CSUM) 107 | #define NETIF_F_SG __NETIF_F(SG) 108 | #define NETIF_F_TSO6 __NETIF_F(TSO6) 109 | #define NETIF_F_TSO_ECN __NETIF_F(TSO_ECN) 110 | #define NETIF_F_TSO __NETIF_F(TSO) 111 | #define NETIF_F_UFO __NETIF_F(UFO) 112 | #define NETIF_F_VLAN_CHALLENGED __NETIF_F(VLAN_CHALLENGED) 113 | #define NETIF_F_RXFCS __NETIF_F(RXFCS) 114 | #define NETIF_F_RXALL __NETIF_F(RXALL) 115 | #define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE) 116 | #define NETIF_F_GSO_GRE_CSUM __NETIF_F(GSO_GRE_CSUM) 117 | #define NETIF_F_GSO_IPIP __NETIF_F(GSO_IPIP) 118 | #define NETIF_F_GSO_SIT __NETIF_F(GSO_SIT) 119 | #define NETIF_F_GSO_UDP_TUNNEL __NETIF_F(GSO_UDP_TUNNEL) 120 | #define NETIF_F_GSO_UDP_TUNNEL_CSUM __NETIF_F(GSO_UDP_TUNNEL_CSUM) 121 | #define NETIF_F_GSO_TUNNEL_REMCSUM __NETIF_F(GSO_TUNNEL_REMCSUM) 122 | #define NETIF_F_HW_VLAN_STAG_FILTER __NETIF_F(HW_VLAN_STAG_FILTER) 123 | #define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX) 124 | #define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) 125 | #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) 126 | #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) 127 | 128 | #define for_each_netdev_feature(mask_addr, bit) \ 129 | for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT) 130 | 131 | /* Features valid for ethtool to change */ 132 | /* = all defined minus driver/device-class-related */ 133 | #define NETIF_F_NEVER_CHANGE (NETIF_F_VLAN_CHALLENGED | \ 134 | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL) 135 | 136 | /* remember that ((t)1 << t_BITS) is undefined in C99 */ 137 | #define NETIF_F_ETHTOOL_BITS ((__NETIF_F_BIT(NETDEV_FEATURE_COUNT - 1) | \ 138 | (__NETIF_F_BIT(NETDEV_FEATURE_COUNT - 1) - 1)) & \ 139 | ~NETIF_F_NEVER_CHANGE) 140 | 141 | /* Segmentation offload feature mask */ 142 | #define NETIF_F_GSO_MASK (__NETIF_F_BIT(NETIF_F_GSO_LAST + 1) - \ 143 | __NETIF_F_BIT(NETIF_F_GSO_SHIFT)) 144 | 145 | /* List of features with software fallbacks. */ 146 | #define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | \ 147 | NETIF_F_TSO6 | NETIF_F_UFO) 148 | 149 | #define NETIF_F_GEN_CSUM NETIF_F_HW_CSUM 150 | #define NETIF_F_V4_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM) 151 | #define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM) 152 | #define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM) 153 | 154 | #define NETIF_F_ALL_TSO (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN) 155 | 156 | #define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ 157 | NETIF_F_FSO) 158 | 159 | /* 160 | * If one device supports one of these features, then enable them 161 | * for all in netdev_increment_features. 162 | */ 163 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ 164 | NETIF_F_SG | NETIF_F_HIGHDMA | \ 165 | NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED) 166 | 167 | /* 168 | * If one device doesn't support one of these features, then disable it 169 | * for all in netdev_increment_features. 170 | */ 171 | #define NETIF_F_ALL_FOR_ALL (NETIF_F_NOCACHE_COPY | NETIF_F_FSO) 172 | 173 | /* 174 | * If upper/master device has these features disabled, they must be disabled 175 | * on all lower/slave devices as well. 176 | */ 177 | #define NETIF_F_UPPER_DISABLES NETIF_F_LRO 178 | 179 | /* changeable features with no special hardware requirements */ 180 | #define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO) 181 | 182 | #define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \ 183 | NETIF_F_HW_VLAN_CTAG_RX | \ 184 | NETIF_F_HW_VLAN_CTAG_TX | \ 185 | NETIF_F_HW_VLAN_STAG_FILTER | \ 186 | NETIF_F_HW_VLAN_STAG_RX | \ 187 | NETIF_F_HW_VLAN_STAG_TX) 188 | 189 | #define NETIF_F_GSO_ENCAP_ALL (NETIF_F_GSO_GRE | \ 190 | NETIF_F_GSO_GRE_CSUM | \ 191 | NETIF_F_GSO_IPIP | \ 192 | NETIF_F_GSO_SIT | \ 193 | NETIF_F_GSO_UDP_TUNNEL | \ 194 | NETIF_F_GSO_UDP_TUNNEL_CSUM) 195 | 196 | #endif /* _LINUX_NETDEV_FEATURES_H */ 197 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AppleIntelWiFiMVM 2 | The goal of this project is to create an OS X driver for those Intel WiFi cards based on the MVM firmware (basically, the current and previous generations). 3 | 4 | ## Supported Hardware 5 | The following Intel WiFi cards/chips are supported: 6 | * Intel® Wireless 3160 7 | * Intel® Wireless 3165 8 | * Intel® Wireless 4165 9 | * Intel® Wireless 7260 10 | * Intel® Wireless 7265 11 | * Intel® Wireless 8260 12 | * NUC on-board wireless for NUC 5i\*RY\* 13 | * NUC on-board wireless for NUC 6i\*SY\* 14 | 15 | ## Driver Status 16 | This driver is still in the "can it be done?" stage. 17 | 18 | As of this writing the driver recognizes the appropriate hardware and loads a matching firmware file, but does not yet send the firmware to the hardware. 19 | 20 | Now I'm in the process of trying to get all the Linux driver code to build on Mac OS X. This will be a very long process. Work is currently happening on the "Porting" branch, but only a small subset of the code even compiles right now. 21 | 22 | Long story short, __this driver does not yet actually connect to wireless networks__. 23 | 24 | If you're interested in helping, it would be great to have more people try test builds just to ensure it accurately identifies all the hardware I don't have on hand to try. 25 | 26 | ## Development Status 27 | 28 | There are notes on [the project wiki](https://github.com/ammulder/AppleIntelWiFiMVM/wiki). If you're interested in helping out at the code level, that would be super. 29 | 30 | Right now all the action is on the "Porting" branch. 31 | 32 | ## Loading/Installation 33 | Typical third-party driver kexts should be installed to /Library/Extensions, but that's not recommended for this driver yet. Even in this initial work I've managed to craft a bug that crashed my machine when the driver loaded. If the driver was installed system-wide, that would happen on every boot, which seems rather unfortunate. So the manual loading process is recommended for now. 34 | 35 | #### Manual Testing 36 | 1. Download the latest AppleIntelWiFiMVM.kext.zip (or build from source) 37 | 2. Unzip if needed 38 | 3. From Terminal, go to where the kext is and run: 39 | ```Shell 40 | chown -R root:wheel AppleIntelWiFiMVM.kext 41 | sudo kextload AppleIntelWiFiMVM.kext 42 | sudo kextunload AppleIntelWiFiMVM.kext 43 | ``` 44 | 4. Run Console.app and scroll to the bottom of the system log (usually displayed by default) or search it for AppleIntelWiFiMVM. You should see output such as: 45 | ```Text 46 | 2/12/16 11:16:51.000 PM kernel[0]: AppleIntelWiFiMVM loading for device Intel(R) Dual Band Wireless AC 7265 47 | 2/12/16 11:16:51.000 PM kernel[0]: AppleIntelWiFiMVM LOADED firmware file iwlwifi-8000C-16.ucode 48 | ``` 49 | 50 | #### System-wide Installation 51 | You've been warned! 52 | 53 | But to install system-wide, use your favorite kext installer tool to install the kext to /Library/Extensions. It should load automatically, and generate the same output as above that you can view in Console.app 54 | 55 | ## Credits 56 | 57 | In building this driver, I'm relying on: 58 | * The iwlwifi Linux driver 59 | * The Intel firmware releases for this hardware (probably largely due to the Linux drivers) 60 | * Mieze's IntelMausiEthernet OS X driver for wired Ethernet adapters 61 | * RehabMan and the-darkvoid's BrcmPatchRAM OS X driver for USB Bluetooth adapters 62 | 63 | ## License 64 | 65 | This driver (including any code I used in it from the projects above) is covered by the [GPL v2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) 66 | 67 | The Intel firmware is covered by the [firmware license](http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=blob_plain;f=LICENCE.iwlwifi_firmware;hb=HEAD) 68 | --------------------------------------------------------------------------------