Skip to content

Commit

Permalink
IntelBTPatcher: reduce side effect for systems before Sequoia.
Browse files Browse the repository at this point in the history
  • Loading branch information
zxystd committed Sep 17, 2024
1 parent 50e971c commit 01cc180
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions IntelBTPatcher/IntelBTPatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,14 @@ IOReturn CIntelBTPatcher::newHostDeviceRequest(void *that, IOService *provider,
char hciBuf[MAX_HCI_BUF_LEN] = {0};

if (data == nullptr) {
if (descriptor != nullptr && !descriptor->prepare(kIODirectionOut)) {
if (descriptor != nullptr &&
(getKernelVersion() < KernelVersion::Sequoia || !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);
if (getKernelVersion() >= KernelVersion::Sequoia)
descriptor->complete(kIODirectionOut);
}
hdr = (HciCommandHdr *)hciBuf;
if (hdr->opcode == HCI_OP_LE_SET_SCAN_PARAM) {
Expand Down

0 comments on commit 01cc180

Please sign in to comment.