Skip to content

Commit

Permalink
AirportItlwm: Add built-in property.
Browse files Browse the repository at this point in the history
  • Loading branch information
zxystd committed Jul 7, 2023
1 parent 4014e9f commit d738c78
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions AirportItlwm/AirportItlwmEthernetInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ attachToDataLinkLayer( IOOptionBits options, void *parameter )
IOReturn ret = super::attachToDataLinkLayer(options, parameter);
if (ret == kIOReturnSuccess && interface) {
UInt8 builtIn = 0;
IOEthernetAddress addr;
interface->setProperty("built-in", OSData::withBytes(&builtIn, sizeof(builtIn)));
snprintf(infName, sizeof(infName), "%s%u", ifnet_name(getIfnet()), ifnet_unit(getIfnet()));
interface->setProperty("IOInterfaceName", OSString::withCString(infName));
interface->setProperty("IOInterfaceUnit", OSNumber::withNumber(ifnet_unit(getIfnet()), 8));
interface->setProperty("IOInterfaceNamePrefix", OSString::withCString(ifnet_name(getIfnet())));
interface->setProperty(kIOInterfaceUnit, OSNumber::withNumber(ifnet_unit(getIfnet()), 8));
interface->setProperty(kIOInterfaceNamePrefix, OSString::withCString(ifnet_name(getIfnet())));
if (OSDynamicCast(IOEthernetController, getController())->getHardwareAddress(&addr) == kIOReturnSuccess)
setProperty(kIOMACAddress, (void *) &addr,
kIOEthernetAddressSize);
interface->registerService();
interface->prepareBSDInterface(getIfnet(), 0);
// ret = bpf_attach(getIfnet(), DLT_RAW, 0x48, &RTLEthernetInterface::bpfOutputPacket, &RTLEthernetInterface::bpfTap);
Expand Down
2 changes: 2 additions & 0 deletions AirportItlwm/AirportItlwmV2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ bool AirportItlwm::start(IOService *provider)
struct IOSkywalkEthernetInterface::RegistrationInfo registInfo;
int boot_value = 0;

UInt8 builtIn = 0;
setProperty("built-in", OSData::withBytes(&builtIn, sizeof(builtIn)));
setProperty("DriverKitDriver", kOSBooleanFalse);
if (!super::start(provider)) {
return false;
Expand Down
3 changes: 2 additions & 1 deletion AirportItlwm/IOPCIEDeviceWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ start(IOService *provider)
return false;
}
IOLog("%s::super start succeed\n", getName());

UInt8 builtIn = 0;
setProperty("built-in", OSData::withBytes(&builtIn, sizeof(builtIn)));
registerService();
return true;
}
Expand Down

0 comments on commit d738c78

Please sign in to comment.