Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AirportItlwm support for macOS 10.12 10.11 10.10 #632

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

env:
BUILD_OUTPUT: 'build/Build/Products/Debug'
BUILD_LEGACY_OUTPUT: 'build-legacy/Build/Products/Debug'

jobs:

Expand Down Expand Up @@ -45,10 +46,27 @@ jobs:
run: |
xcodebuild -scheme "AirportItlwm (all)" -configuration Debug -derivedDataPath build GIT_COMMIT=_${SHORT_SHA} | xcpretty && exit ${PIPESTATUS[0]}

- name: Pack Artifacts
- name: Build AirportItlwm-legacy
run: |
xcodebuild -scheme "AirportItlwm-legacy" -configuration Debug -derivedDataPath build-legacy GIT_COMMIT=_${SHORT_SHA} | xcpretty && exit ${PIPESTATUS[0]}

- name: Pack Artifacts itlwm
run: |
cd $BUILD_OUTPUT
zip -r itlwm-v${ITLWM_VER}-DEBUG-alpha-${SHORT_SHA}.zip itlwm.kext
cd -

- name: Pack Artifacts AirportItlwm
run: |
cd $BUILD_OUTPUT
while read -r tgt ; do
zip -r AirportItlwm-${tgt// /_}-v${ITLWM_VER}-DEBUG-alpha-${SHORT_SHA}.zip "$tgt"
done < <(find . -mindepth 1 -maxdepth 1 -type d -not -path "*.kext" | cut -c 3-)
cd -

- name: Pack Artifacts AirportItlwm-legacy
run: |
cd $BUILD_LEGACY_OUTPUT
while read -r tgt ; do
zip -r AirportItlwm-${tgt// /_}-v${ITLWM_VER}-DEBUG-alpha-${SHORT_SHA}.zip "$tgt"
done < <(find . -mindepth 1 -maxdepth 1 -type d -not -path "*.kext" | cut -c 3-)
Expand Down Expand Up @@ -78,3 +96,21 @@ jobs:
artifacts: "${{ env.BUILD_OUTPUT }}/*.zip"
tag: "v${{ env.ITLWM_VER }}-alpha"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload to Artifacts itlwm
uses: actions/upload-artifact@v2
with:
name: itlwm
path: "${{ env.BUILD_OUTPUT }}/itlwm-*.zip"

- name: Upload to Artifacts AirportItlwm
uses: actions/upload-artifact@v2
with:
name: AirportItlwm
path: "${{ env.BUILD_OUTPUT }}/AirportItlwm-*.zip"

- name: Upload to Artifacts AirportItlwm-legacy
uses: actions/upload-artifact@v2
with:
name: AirportItlwm-legacy
path: "${{ env.BUILD_LEGACY_OUTPUT }}/AirportItlwm-*.zip"
16 changes: 4 additions & 12 deletions AirportItlwm/AirportItlwm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ bool AirportItlwm::start(IOService *provider)
super::stop(pciNub);
return false;
}
_fWorkloop = OSDynamicCast(IO80211WorkLoop, getWorkLoop());
if (_fWorkloop == NULL) {
XYLog("No _fWorkloop!!\n");
super::stop(pciNub);
Expand Down Expand Up @@ -482,17 +483,6 @@ bool AirportItlwm::initPCIPowerManagment(IOPCIDevice *provider)
return true;
}

bool AirportItlwm::createWorkLoop()
{
_fWorkloop = IO80211WorkLoop::workLoop();
return _fWorkloop != 0;
}

IOWorkLoop *AirportItlwm::getWorkLoop() const
{
return _fWorkloop;
}

IOReturn AirportItlwm::selectMedium(const IONetworkMedium *medium)
{
setSelectedMedium(medium);
Expand Down Expand Up @@ -583,7 +573,7 @@ void AirportItlwm::releaseAll()
fWatchdogWorkLoop->release();
fWatchdogWorkLoop = NULL;
}
_fWorkloop->release();
// _fWorkloop->release();
_fWorkloop = NULL;
}
unregistPM();
Expand Down Expand Up @@ -910,13 +900,15 @@ void AirportItlwm::setPowerStateOn()
pmPolicyMaker->acknowledgeSetPowerState();
}

#if __IO80211_TARGET >= __MAC_10_11
int AirportItlwm::
outputRaw80211Packet(IO80211Interface *interface, mbuf_t m)
{
XYLog("%s len=%zu\n", __FUNCTION__, mbuf_len(m));
freePacket(m);
return kIOReturnOutputDropped;
}
#endif

UInt32 AirportItlwm::
hardwareOutputQueueDepth(IO80211Interface *interface)
Expand Down
2 changes: 2 additions & 0 deletions AirportItlwm/AirportItlwm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ IOReturn set##REQ(OSObject *object, struct DATA_TYPE *data);
static void fakeScanDone(OSObject *owner, IOTimerEventSource *sender);
//authentication
virtual bool useAppleRSNSupplicant(IO80211Interface *interface) override;
#if __IO80211_TARGET >= __MAC_10_11
virtual int outputRaw80211Packet(IO80211Interface *interface, mbuf_t m) override;
#endif
//virtual interface
virtual SInt32 enableVirtualInterface(IO80211VirtualInterface *interface) override;
virtual SInt32 disableVirtualInterface(IO80211VirtualInterface *interface) override;
Expand Down
14 changes: 7 additions & 7 deletions AirportItlwm/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.iokit.IO80211Family</key>
<string>1200.12.2b1</string>
<string>400.0</string>
<key>com.apple.iokit.IONetworkingFamily</key>
<string>3.2</string>
<string>2.0</string>
<key>com.apple.iokit.IOPCIFamily</key>
<string>2.9</string>
<string>2.6.1</string>
<key>com.apple.kpi.bsd</key>
<string>16.7</string>
<string>11.0.0</string>
<key>com.apple.kpi.iokit</key>
<string>16.7</string>
<string>11.0.0</string>
<key>com.apple.kpi.libkern</key>
<string>16.7</string>
<string>11.0.0</string>
<key>com.apple.kpi.mach</key>
<string>16.7</string>
<string>11.0.0</string>
</dict>
<key>OSBundleRequired</key>
<string>Network-Root</string>
Expand Down
12 changes: 12 additions & 0 deletions include/Airport/IO80211Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ class IO80211Controller : public IOEthernetController {
virtual void requestPacketTx(void*, UInt);
virtual IOReturn getHardwareAddressForInterface(IO80211Interface *,IOEthernetAddress *);
virtual void inputMonitorPacket(mbuf_t,UInt,void *,unsigned long);
#if __IO80211_TARGET >= __MAC_10_11
virtual int outputRaw80211Packet(IO80211Interface *,mbuf_t);
virtual int outputActionFrame(IO80211Interface *,mbuf_t);
#endif
virtual int bpfOutputPacket(OSObject *,UInt,mbuf_t m);
virtual SInt32 monitorModeSetEnabled(IO80211Interface*, bool, UInt);
virtual IO80211Interface* getNetworkInterface(void);
Expand Down Expand Up @@ -199,22 +201,28 @@ class IO80211Controller : public IOEthernetController {
virtual bool requiresExplicitMBufRelease() {
return false;
}
#if __IO80211_TARGET >= __MAC_10_12
virtual bool flowIdSupported() {
return false;
}
virtual IO80211FlowQueueLegacy* requestFlowQueue(FlowIdMetadata const*);
virtual void releaseFlowQueue(IO80211FlowQueue *);
#endif
#if __IO80211_TARGET >= __MAC_10_15
virtual void getLogPipes(CCPipe**, CCPipe**, CCPipe**) {};
#endif
#if __IO80211_TARGET >= __MAC_10_13
virtual IOReturn enablePacketTimestamping(void) {
return kIOReturnUnsupported;
}
virtual IOReturn disablePacketTimestamping(void) {
return kIOReturnUnsupported;
}
#endif
#if __IO80211_TARGET >= __MAC_10_12
virtual UInt32 selfDiagnosticsReport(int,char const*,UInt);
virtual UInt32 getDataQueueDepth(OSObject *);
#endif
#if __IO80211_TARGET >= __MAC_11_0
virtual bool isAssociatedToMovingNetwork(void) { return false; }
#endif
Expand Down Expand Up @@ -280,8 +288,10 @@ class IO80211Controller : public IOEthernetController {
IOReturn setChanNoiseFloorLTE(apple80211_stat_report *,int);
IOReturn setChanNoiseFloor(apple80211_stat_report *,int);
IOReturn setChanCCA(apple80211_stat_report *,int);
#if __IO80211_TARGET >= __MAC_10_15
IOReturn setChanExtendedCCA(apple80211_stat_report *,apple80211_cca_report *);
bool setLTECoexstat(apple80211_stat_report *,apple80211_lteCoex_report *);
#endif
bool setBTCoexstat(apple80211_stat_report *,apple80211_btCoex_report *);
bool setAMPDUstat(apple80211_stat_report *,apple80211_ampdu_stat_report *,apple80211_channel *);
UInt32 getCountryCode(apple80211_country_code_data *);
Expand All @@ -303,7 +313,9 @@ class IO80211Controller : public IOEthernetController {
#if __IO80211_TARGET >= __MAC_10_15
void notifyHostapState(apple80211_hostap_state *);
#endif
#if __IO80211_TARGET >= __MAC_10_13
bool isAwdlAssistedDiscoveryEnabled(void);
#endif
void joinDone(scanSource,joinStatus);
void joinStarted(scanSource,joinStatus);
void handleChannelSwitchAnnouncement(apple80211_channel_switch_announcement *);
Expand Down
8 changes: 8 additions & 0 deletions include/Airport/IO80211Interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ class IO80211Interface : public IOEthernetInterface
virtual void setEnabledBySystem(bool);

virtual bool setLinkState(IO80211LinkState, unsigned int);
#if __IO80211_TARGET >= __MAC_10_11
virtual bool setLinkState(IO80211LinkState, int, unsigned int);
#endif
virtual UInt32 outputPacket(mbuf_t, void*);

virtual bool setLinkQualityMetric(int);
Expand Down Expand Up @@ -213,7 +215,9 @@ class IO80211Interface : public IOEthernetInterface
IOReturn reportDataTransferRates(void);
IOReturn reportDataTransferRatesGated(void);
IOReturn reportDataTransferRatesStatic(void *);
#if __IO80211_TARGET >= __MAC_10_13
IOReturn reportTransmitCompletionStatus(mbuf_t,int,UInt,UInt,UInt);
#endif
void reportTransmitStatus(mbuf_t,int,packet_info_tx *);
void reportTxStatistics(apple80211_txstats *);
void resetLeakyApStats(void);
Expand All @@ -230,11 +234,15 @@ class IO80211Interface : public IOEthernetInterface
void setDataPathState(bool);
IOReturn setDataPointerAndLengthForMessageType(apple80211_postMessage_tlv_types,void **,unsigned long *);
void setDebugFlags(unsigned long long,UInt);
#if __IO80211_TARGET >= __MAC_10_13
bool setFrameStats(apple80211_stat_report *,apple80211_frame_counters *);
#endif
bool setInterfaceCCA(apple80211_channel,int);
#if __IO80211_TARGET >= __MAC_10_13
bool setInterfaceChipCounters(apple80211_stat_report *,apple80211_chip_counters_tx *,apple80211_chip_error_counters_tx *,apple80211_chip_counters_rx *);
bool setInterfaceExtendedCCA(apple80211_channel,apple80211_cca_report *);
bool setInterfaceMIBdot11(apple80211_stat_report *,apple80211_ManagementInformationBasedot11_counters *);
#endif
IOReturn setLQM(unsigned long long);
IOReturn setLQMGated(long long);
IOReturn setLQMStatic(void *,void *);
Expand Down
8 changes: 8 additions & 0 deletions include/Airport/IO80211P2PInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class IO80211P2PInterface : public IO80211VirtualInterface {
unsigned long stateNumber,
IOService * whatDevice ) APPLE_KEXT_OVERRIDE;
virtual bool init(IO80211Controller *,ether_addr *,uint,char const*) APPLE_KEXT_OVERRIDE;
#if __IO80211_TARGET >= __MAC_10_12
virtual bool createPeerManager(ether_addr *,IO80211PeerManager **) APPLE_KEXT_OVERRIDE;
#endif
virtual IOMediumType getMediumType() APPLE_KEXT_OVERRIDE;
virtual void setLinkState(IO80211LinkState,uint) APPLE_KEXT_OVERRIDE;
virtual bool dequeueOutputPacketsWithServiceClass(uint,IOMbufServiceClass,mbuf_t*,mbuf_t*,UInt *,unsigned long long *) APPLE_KEXT_OVERRIDE;
Expand All @@ -49,8 +51,10 @@ class IO80211P2PInterface : public IO80211VirtualInterface {
virtual IOReturn controllerWillChangePowerState(IO80211Controller *,unsigned long,UInt,IOService *) APPLE_KEXT_OVERRIDE;
virtual IOReturn controllerDidChangePowerState(IO80211Controller *,unsigned long,UInt,IOService *) APPLE_KEXT_OVERRIDE;
virtual bool handleDebugCmd(apple80211_debug_command *) APPLE_KEXT_OVERRIDE;
#if __IO80211_TARGET >= __MAC_10_12
virtual IOReturn postPeerPresence(ether_addr *,int,int,int,char *) APPLE_KEXT_OVERRIDE;
virtual IOReturn postPeerAbsence(ether_addr *) APPLE_KEXT_OVERRIDE;
#endif
#if __IO80211_TARGET >= __MAC_10_15
virtual IOReturn postPeerPresenceIPv6(ether_addr *,int,int,int,char *,unsigned char *) APPLE_KEXT_OVERRIDE;
#endif
Expand All @@ -61,9 +65,11 @@ class IO80211P2PInterface : public IO80211VirtualInterface {
virtual void outputStart(uint) APPLE_KEXT_OVERRIDE;
virtual UInt32 configureAQMOutput() APPLE_KEXT_OVERRIDE;
virtual void setUnitNumber(char const*) APPLE_KEXT_OVERRIDE;
#if __IO80211_TARGET >= __MAC_10_12
virtual bool initIfnetEparams(ifnet_init_eparams *) APPLE_KEXT_OVERRIDE;
virtual bool attachToBpf() APPLE_KEXT_OVERRIDE;
virtual bool configureIfnet() APPLE_KEXT_OVERRIDE;
#endif
OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 0);
OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 1);
OSMetaClassDeclareReservedUnused( IO80211P2PInterface, 2);
Expand Down Expand Up @@ -93,7 +99,9 @@ class IO80211P2PInterface : public IO80211VirtualInterface {
#if __IO80211_TARGET >= __MAC_10_15
void notifyHostapState(apple80211_hostap_state *);
#endif
#if __IO80211_TARGET >= __MAC_10_13
bool isAwdlAssistedDiscoveryEnabled(void);
#endif
void handleChannelSwitchAnnouncement(apple80211_channel_switch_announcement *);
void awdlSetUnitNumber(char const*);
void awdlInit(void);
Expand Down
6 changes: 6 additions & 0 deletions include/Airport/IO80211VirtualInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ class IO80211VirtualInterface : public IOService {
unsigned long stateNumber,
IOService * whatDevice ) APPLE_KEXT_OVERRIDE;
virtual bool init(IO80211Controller *,ether_addr *,UInt,char const*);
#if __IO80211_TARGET >= __MAC_10_12
virtual bool createPeerManager(ether_addr *,IO80211PeerManager **);
#endif
virtual IOMediumType getMediumType();
virtual void setLinkState(IO80211LinkState,UInt);
virtual bool dequeueOutputPacketsWithServiceClass(UInt,IOMbufServiceClass,mbuf_t*,mbuf_t*,UInt *,unsigned long long *);
Expand All @@ -63,8 +65,10 @@ class IO80211VirtualInterface : public IOService {
virtual IOReturn controllerWillChangePowerState(IO80211Controller *,unsigned long,UInt,IOService *);
virtual IOReturn controllerDidChangePowerState(IO80211Controller *,unsigned long,UInt,IOService *);
virtual bool handleDebugCmd(apple80211_debug_command *);
#if __IO80211_TARGET >= __MAC_10_12
virtual IOReturn postPeerPresence(ether_addr *,int,int,int,char *);
virtual IOReturn postPeerAbsence(ether_addr *);
#endif
#if __IO80211_TARGET >= __MAC_10_15
virtual IOReturn postPeerPresenceIPv6(ether_addr *,int,int,int,char *,unsigned char *);
#endif
Expand All @@ -75,9 +79,11 @@ class IO80211VirtualInterface : public IOService {
virtual void outputStart(UInt);
virtual UInt32 configureAQMOutput();
virtual void setUnitNumber(char const*);
#if __IO80211_TARGET >= __MAC_10_12
virtual bool initIfnetEparams(ifnet_init_eparams *);
virtual bool attachToBpf();
virtual bool configureIfnet();
#endif
OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 0);
OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 1);
OSMetaClassDeclareReservedUnused( IO80211VirtualInterface, 2);
Expand Down
Loading