Skip to content

Commit

Permalink
IntelBTPatcher: compat for Sequoia, different from other version os m…
Browse files Browse the repository at this point in the history
…acOS, the HCI memory descriptor is not prepared and can not be used directly.
  • Loading branch information
zxystd committed Jun 24, 2024
1 parent 8b88140 commit 50e971c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions IntelBTPatcher/IntelBTPatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ PluginConfiguration ADDPR(config) {
bootargBeta,
arrsize(bootargBeta),
KernelVersion::MountainLion,
KernelVersion::Sonoma,
KernelVersion::Sequoia,
[]() {
ibtPatcher.init();
}
Expand Down Expand Up @@ -165,9 +165,12 @@ IOReturn CIntelBTPatcher::newHostDeviceRequest(void *that, IOService *provider,
char hciBuf[MAX_HCI_BUF_LEN] = {0};

if (data == nullptr) {
if (descriptor != nullptr && descriptor->getLength() > 0) {
descriptor->readBytes(0, hciBuf, min(descriptor->getLength(), MAX_HCI_BUF_LEN));
hdrLen = (uint32_t)min(descriptor->getLength(), MAX_HCI_BUF_LEN);
if (descriptor != nullptr && !descriptor->prepare(kIODirectionOut)) {
if (descriptor->getLength() > 0) {
descriptor->readBytes(0, hciBuf, min(descriptor->getLength(), MAX_HCI_BUF_LEN));
hdrLen = (uint32_t)min(descriptor->getLength(), MAX_HCI_BUF_LEN);
}
descriptor->complete(kIODirectionOut);
}
hdr = (HciCommandHdr *)hciBuf;
if (hdr->opcode == HCI_OP_LE_SET_SCAN_PARAM) {
Expand Down

0 comments on commit 50e971c

Please sign in to comment.