}
} else
#endif /* INET6 */
- {
+ {
/*
* Get IP and TCP header together in first mbuf.
* Note: IP leaves IP header in first mbuf.
if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) {
if (apple_hwcksum_rx && (m->m_pkthdr.csum_flags & CSUM_TCP_SUM16)) {
u_short pseudo;
+ char b[9];
+ *(uint32_t*)&b[0] = *(uint32_t*)&ipov->ih_x1[0];
+ *(uint32_t*)&b[4] = *(uint32_t*)&ipov->ih_x1[4];
+ *(uint8_t*)&b[8] = *(uint8_t*)&ipov->ih_x1[8];
+
bzero(ipov->ih_x1, sizeof(ipov->ih_x1));
ipov->ih_len = (u_short)tlen;
HTONS(ipov->ih_len);
pseudo = in_cksum(m, sizeof (struct ip));
+
+ *(uint32_t*)&ipov->ih_x1[0] = *(uint32_t*)&b[0];
+ *(uint32_t*)&ipov->ih_x1[4] = *(uint32_t*)&b[4];
+ *(uint8_t*)&ipov->ih_x1[8] = *(uint8_t*)&b[8];
+
th->th_sum = in_addword(pseudo, (m->m_pkthdr.csum_data & 0xFFFF));
} else {
if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR)
}
th->th_sum ^= 0xffff;
} else {
+ char b[9];
/*
* Checksum extended TCP header and data.
*/
+ *(uint32_t*)&b[0] = *(uint32_t*)&ipov->ih_x1[0];
+ *(uint32_t*)&b[4] = *(uint32_t*)&ipov->ih_x1[4];
+ *(uint8_t*)&b[8] = *(uint8_t*)&ipov->ih_x1[8];
+
len = sizeof (struct ip) + tlen;
bzero(ipov->ih_x1, sizeof(ipov->ih_x1));
ipov->ih_len = (u_short)tlen;
HTONS(ipov->ih_len);
th->th_sum = in_cksum(m, len);
+
+ *(uint32_t*)&ipov->ih_x1[0] = *(uint32_t*)&b[0];
+ *(uint32_t*)&ipov->ih_x1[4] = *(uint32_t*)&b[4];
+ *(uint8_t*)&ipov->ih_x1[8] = *(uint8_t*)&b[8];
}
if (th->th_sum) {
tcpstat.tcps_rcvbadsum++;
/* Re-initialization for later version check */
ip->ip_v = IPVERSION;
#endif
- }
+ }
/*
* Check that TCP offset makes sense,
* Checksum extended UDP header and data.
*/
if (uh->uh_sum) {
- if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) {
- if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR)
- uh->uh_sum = m->m_pkthdr.csum_data;
- else
- goto doudpcksum;
- uh->uh_sum ^= 0xffff;
- } else {
+ if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) {
+ if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR)
+ uh->uh_sum = m->m_pkthdr.csum_data;
+ else
+ goto doudpcksum;
+ uh->uh_sum ^= 0xffff;
+ } else {
+ char b[9];
doudpcksum:
+ *(uint32_t*)&b[0] = *(uint32_t*)&((struct ipovly *)ip)->ih_x1[0];
+ *(uint32_t*)&b[4] = *(uint32_t*)&((struct ipovly *)ip)->ih_x1[4];
+ *(uint8_t*)&b[8] = *(uint8_t*)&((struct ipovly *)ip)->ih_x1[8];
+
bzero(((struct ipovly *)ip)->ih_x1, 9);
((struct ipovly *)ip)->ih_len = uh->uh_ulen;
uh->uh_sum = in_cksum(m, len + sizeof (struct ip));
+
+ *(uint32_t*)&((struct ipovly *)ip)->ih_x1[0] = *(uint32_t*)&b[0];
+ *(uint32_t*)&((struct ipovly *)ip)->ih_x1[4] = *(uint32_t*)&b[4];
+ *(uint8_t*)&((struct ipovly *)ip)->ih_x1[8] = *(uint8_t*)&b[8];
}
if (uh->uh_sum) {
udpstat.udps_badsum++;
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
- <string>System Resource Pseudoextension, Apple Computer Inc, 6.5</string>
+ <string>System Resource Pseudoextension, Apple Computer Inc, 6.6</string>
<key>CFBundleIdentifier</key>
<string>com.apple.kernel</string>
<key>CFBundleInfoDictionaryVersion</key>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>OSBundleCompatibleVersion</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>OSBundleRequired</key>
<string>Root</string>
<key>OSKernelResource</key>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
- <string>AppleNMI Pseudoextension, Apple Computer Inc, 6.5</string>
+ <string>AppleNMI Pseudoextension, Apple Computer Inc, 6.6</string>
<key>CFBundleIdentifier</key>
<string>com.apple.driver.AppleNMI</string>
<key>CFBundleInfoDictionaryVersion</key>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>OSBundleRequired</key>
<string>Root</string>
<key>OSKernelResource</key>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
- <string>Apple Platform Family Pseudoextension, Apple Computer Inc, 6.5</string>
+ <string>Apple Platform Family Pseudoextension, Apple Computer Inc, 6.6</string>
<key>CFBundleIdentifier</key>
<string>com.apple.iokit.ApplePlatformFamily</string>
<key>CFBundleInfoDictionaryVersion</key>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>OSBundleCompatibleVersion</key>
<string>1.0</string>
<key>OSBundleRequired</key>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
- <string>BSD Kernel Pseudoextension, Apple Computer Inc, 6.5</string>
+ <string>BSD Kernel Pseudoextension, Apple Computer Inc, 6.6</string>
<key>CFBundleIdentifier</key>
<string>com.apple.kernel.bsd</string>
<key>CFBundleInfoDictionaryVersion</key>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>OSBundleCompatibleVersion</key>
<string>1.1</string>
<key>OSBundleRequired</key>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
- <string>ADB Family Pseudoextension, Apple Computer Inc, 6.5</string>
+ <string>ADB Family Pseudoextension, Apple Computer Inc, 6.6</string>
<key>CFBundleIdentifier</key>
<string>com.apple.iokit.IOADBFamily</string>
<key>CFBundleInfoDictionaryVersion</key>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>OSBundleCompatibleVersion</key>
<string>1.0.0b1</string>
<key>OSBundleRequired</key>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
- <string>I/O Kit Pseudoextension, Apple Computer Inc, 6.5</string>
+ <string>I/O Kit Pseudoextension, Apple Computer Inc, 6.6</string>
<key>CFBundleIdentifier</key>
<string>com.apple.kernel.iokit</string>
<key>CFBundleInfoDictionaryVersion</key>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>OSBundleCompatibleVersion</key>
<string>1.0.0b1</string>
<key>OSBundleRequired</key>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
- <string>AppleNMI Pseudoextension, Apple Computer Inc, 6.5</string>
+ <string>AppleNMI Pseudoextension, Apple Computer Inc, 6.6</string>
<key>CFBundleIdentifier</key>
<string>com.apple.iokit.IONVRAMFamily</string>
<key>CFBundleInfoDictionaryVersion</key>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>OSBundleCompatibleVersion</key>
<string>1.1</string>
<key>OSBundleRequired</key>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
- <string>System Management Pseudoextension, Apple Computer Inc, 6.5</string>
+ <string>System Management Pseudoextension, Apple Computer Inc, 6.6</string>
<key>CFBundleIdentifier</key>
<string>com.apple.iokit.IOSystemManagementFamily</string>
<key>CFBundleInfoDictionaryVersion</key>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>OSBundleCompatibleVersion</key>
<string>1.0.0b1</string>
<key>OSBundleRequired</key>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
- <string>Libkern Pseudoextension, Apple Computer Inc, 6.5</string>
+ <string>Libkern Pseudoextension, Apple Computer Inc, 6.6</string>
<key>CFBundleIdentifier</key>
<string>com.apple.kernel.libkern</string>
<key>CFBundleInfoDictionaryVersion</key>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>OSBundleCompatibleVersion</key>
<string>1.0.0b1</string>
<key>OSBundleRequired</key>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
- <string>Mach Kernel Pseudoextension, Apple Computer Inc, 6.5</string>
+ <string>Mach Kernel Pseudoextension, Apple Computer Inc, 6.6</string>
<key>CFBundleIdentifier</key>
<string>com.apple.kernel.mach</string>
<key>CFBundleInfoDictionaryVersion</key>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>6.5</string>
+ <string>6.6</string>
<key>OSBundleCompatibleVersion</key>
<string>1.0.0b1</string>
<key>OSBundleRequired</key>
originalNub = vector->nub;
originalSource = vector->source;
- // Save the dis/enable state for the original consumer's interrupt.
- // Then disable the source
- wasDisabledSoft = vector->interruptDisabledSoft;
- disableInterrupt(originalNub, originalSource);
+ // Physically disable the interrupt, but mark it as being enables in the hardware.
+ // The interruptDisabledSoft now indicates the driver's request for enablement.
+ disableVectorHard(vectorNumber, vector);
+ vector->interruptDisabledHard = 0;
// Initialize the new shared interrupt controller.
error = vector->sharedController->initInterruptController(this,
// put the original consumor's interrupt back to normal and
// get rid of whats left of the shared controller.
if (error != kIOReturnSuccess) {
+ // Save the driver's interrupt enablement state.
+ wasDisabledSoft = vector->interruptDisabledSoft;
+
+ // Make the interrupt really hard disabled.
+ vector->interruptDisabledSoft = 1;
+ vector->interruptDisabledHard = 1;
+
+ // Enable the original consumer's interrupt if needed.
+ if (!wasDisabledSoft) originalNub->enableInterrupt(originalSource);
enableInterrupt(originalNub, originalSource);
+
vector->sharedController->release();
vector->sharedController = 0;
IOUnlock(vector->interruptLock);
vector->target = vector->sharedController;
vector->refCon = 0;
+ // Save the driver's interrupt enablement state.
+ wasDisabledSoft = vector->interruptDisabledSoft;
+
+ // Make the interrupt really hard disabled.
+ vector->interruptDisabledSoft = 1;
+ vector->interruptDisabledHard = 1;
+
// Enable the original consumer's interrupt if needed.
if (!wasDisabledSoft) originalNub->enableInterrupt(originalSource);
}
}
// Allocate the memory for the vectors
- numVectors = 8; // For now a constant number.
+ numVectors = 32; // For now a constant number.
vectors = (IOInterruptVector *)IOMalloc(numVectors * sizeof(IOInterruptVector));
if (vectors == NULL) {
IOFree(_interruptSources, sizeof(IOInterruptSource));
nvPath = start;
else if (nvName == 0)
nvName = start;
- else if (entry ==
- IORegistryEntry::fromPath((const char *) nvPath, gIODTPlane)) {
- *name = OSSymbol::withCString((const char *) nvName);
- *value = unescapeBytesToData(start, where - start - 1);
- if ((*name != 0) && (*value != 0))
- err = kIOReturnSuccess;
- else
- err = kIOReturnNoMemory;
- break;
- } else
+ else {
+ IORegistryEntry * compareEntry = IORegistryEntry::fromPath((const char *) nvPath, gIODTPlane);
+ if (entry == compareEntry) {
+ if (compareEntry)
+ compareEntry->release();
+ *name = OSSymbol::withCString((const char *) nvName);
+ *value = unescapeBytesToData(start, where - start - 1);
+ if ((*name != 0) && (*value != 0))
+ err = kIOReturnSuccess;
+ else
+ err = kIOReturnNoMemory;
+ break;
+ }
+ if (compareEntry)
+ compareEntry->release();
nvPath = nvName = 0;
-
+ }
start = where;
}
nvPath = start;
else if (nvName == 0)
nvName = start;
- else if (entry ==
- IORegistryEntry::fromPath((const char *) nvPath, gIODTPlane)) {
- // delete old property (nvPath -> where)
- data = OSData::withBytes(propStart, nvPath - propStart);
- if (data)
- ok &= data->appendBytes(where, end - where);
- break;
- } else
+ else {
+ IORegistryEntry * compareEntry = IORegistryEntry::fromPath((const char *) nvPath, gIODTPlane);
+ if (entry == compareEntry) {
+ if (compareEntry)
+ compareEntry->release();
+ // delete old property (nvPath -> where)
+ data = OSData::withBytes(propStart, nvPath - propStart);
+ if (data)
+ ok &= data->appendBytes(where, end - where);
+ break;
+ }
+ if (compareEntry)
+ compareEntry->release();
nvPath = nvName = 0;
+ }
start = where;
}
*/
const char * gIOKernelKmods =
"{
- 'com.apple.kernel' = '6.5';
- 'com.apple.kernel.bsd' = '6.5';
- 'com.apple.kernel.iokit' = '6.5';
- 'com.apple.kernel.libkern' = '6.5';
- 'com.apple.kernel.mach' = '6.5';
- 'com.apple.iokit.IOADBFamily' = '6.5';
- 'com.apple.iokit.IONVRAMFamily' = '6.5';
- 'com.apple.iokit.IOSystemManagementFamily' = '6.5';
- 'com.apple.iokit.ApplePlatformFamily' = '6.5';
- 'com.apple.driver.AppleNMI' = '6.5';
+ 'com.apple.kernel' = '6.6';
+ 'com.apple.kernel.bsd' = '6.6';
+ 'com.apple.kernel.iokit' = '6.6';
+ 'com.apple.kernel.libkern' = '6.6';
+ 'com.apple.kernel.mach' = '6.6';
+ 'com.apple.iokit.IOADBFamily' = '6.6';
+ 'com.apple.iokit.IONVRAMFamily' = '6.6';
+ 'com.apple.iokit.IOSystemManagementFamily' = '6.6';
+ 'com.apple.iokit.ApplePlatformFamily' = '6.6';
+ 'com.apple.driver.AppleNMI' = '6.6';
}";