Skip to content

Commit

Permalink
Version 2.2.2 - Fixes a problem with may cause trouble when trying to…
Browse files Browse the repository at this point in the history
… change the MAC address.
  • Loading branch information
Mieze committed Sep 25, 2017
1 parent 0ad0f35 commit a23d958
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions AtherosE2200Ethernet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@
INFOPLIST_FILE = "AtherosE2200Ethernet/AtherosE2200Ethernet-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.12;
MODULE_NAME = com.insanelymac.AtherosE2200Ethernet;
MODULE_VERSION = 2.2.1;
MODULE_VERSION = 2.2.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.insanelymac.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = AtherosE2200Ethernet;
SDKROOT = macosx;
Expand All @@ -473,7 +473,7 @@
INFOPLIST_FILE = "AtherosE2200Ethernet/AtherosE2200Ethernet-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.12;
MODULE_NAME = com.insanelymac.AtherosE2200Ethernet;
MODULE_VERSION = 2.2.1;
MODULE_VERSION = 2.2.2;
PRODUCT_BUNDLE_IDENTIFIER = "com.insanelymac.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = AtherosE2200Ethernet;
SDKROOT = macosx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "EF5DE8B8-F8CD-42F3-BFAD-A74E560D7A6D",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"CDCA2184861B0BBA9C5ECB0C5CE4459094A5CB2E" : "AtherosE2200Ethernet\/",
"322B76FC62564D70D3D2B79682113A4F1191D2DD" : "IntelMausiEthernet",
"322B76FC62564D70D3D2B79682113A4F1191D2DD" : "IntelMausiEthernet\/",
"52FD44A8D7C2885B44C325DC0C12115B6E4CC996" : "RealtekRTL8111\/"
},
"DVTSourceControlWorkspaceBlueprintNameKey" : "AtherosE2200Ethernet",
Expand Down
38 changes: 19 additions & 19 deletions AtherosE2200Ethernet/AtherosE2200Ethernet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,25 +1033,18 @@ IOReturn AtherosE2200::getPacketFilters(const OSSymbol *group, UInt32 *filters)
return result;
}

/* There seems to be a hardware bug which prevents the Killer and AR816x/AR817x
* NICs from changing their MAC address. Writes to the MAC adddress registers
* result in a messed up address register effectively killing unicast packet
* reception until the next reset. As a workaround, we acknowledge the request
* without performing any action as refusing it would break LACP.
*/
IOReturn AtherosE2200::setHardwareAddress(const IOEthernetAddress *addr)
{
IOReturn result = kIOReturnSuccess;

DebugLog("setHardwareAddress() ===>\n");
/*
if (addr && ether_addr_equal(&addr->bytes[0], &origMacAddr.bytes[0])) {
memcpy(&currMacAddr.bytes[0], &addr->bytes[0], kIOEthernetAddressSize);
alxSetHardwareAddress(addr);

result = kIOReturnSuccess;
if (addr && ether_addr_equal(&addr->bytes[0], &origMacAddr.bytes[0])) {
alxLoadDefaultAddress();
} else {
result = alxSetHardwareAddress(addr);
}
*/

DebugLog("setHardwareAddress() <===\n");

return result;
Expand Down Expand Up @@ -2347,17 +2340,24 @@ bool AtherosE2200::alxLoadDefaultAddress()
return result;
}

void AtherosE2200::alxSetHardwareAddress(const IOEthernetAddress *addr)
IOReturn AtherosE2200::alxSetHardwareAddress(const IOEthernetAddress *addr)
{
IOReturn result = kIOReturnSuccess;
UInt32 mac0, mac1;

mac0 = ((addr->bytes[2] << 24) || (addr->bytes[3] << 16) || (addr->bytes[4] << 8) || addr->bytes[5]);
mac0 = OSSwapBigToHostInt32(*((UInt32 *)&addr->bytes[2]));
alxWriteMem32(ALX_STAD0, mac0);
mac1 = ((addr->bytes[0] << 8) || addr->bytes[1]);
mac1 = OSSwapBigToHostInt16(*((UInt16 *)&addr->bytes[0]));
alxWriteMem32(ALX_STAD1, mac1);

if ((alxReadMem32(ALX_STAD0) != mac0) || (alxReadMem32(ALX_STAD1) != mac1))
IOLog("Ethernet [AtherosE2200]: Failed to set MAC address.\n");
if ((alxReadMem32(ALX_STAD0) != mac0) || (alxReadMem32(ALX_STAD1) != mac1)) {
alxLoadDefaultAddress();
IOLog("Ethernet [AtherosE2200]: Failed to set MAC address. Permanent address restored.\n");
result = kIOReturnError;
} else {
memcpy(&currMacAddr.bytes[0], &addr->bytes[0], kIOEthernetAddressSize);
}
return result;
}

bool AtherosE2200::alxStart(UInt32 maxIntrRate)
Expand Down Expand Up @@ -2431,8 +2431,8 @@ bool AtherosE2200::alxStart(UInt32 maxIntrRate)
IOLog("Ethernet [AtherosE2200]: Failed to identify PHY.\n");
goto done;
}
IOLog("Ethernet [AtherosE2200]: %s: (Rev. %u) at 0x%lx, %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n",
chipNames[chip], pciDeviceData.revision, (unsigned long)baseAddr,
IOLog("Ethernet [AtherosE2200]: %s: (Rev. %u) at 0x%p, %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n",
chipNames[chip], pciDeviceData.revision, baseAddr,
origMacAddr.bytes[0], origMacAddr.bytes[1],
origMacAddr.bytes[2], origMacAddr.bytes[3],
origMacAddr.bytes[4], origMacAddr.bytes[5]);
Expand Down
2 changes: 1 addition & 1 deletion AtherosE2200Ethernet/AtherosE2200Ethernet.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class AtherosE2200 : public super
bool checkForDeadlock();

/* Hardware specific methods */
void alxSetHardwareAddress(const IOEthernetAddress *addr);
IOReturn alxSetHardwareAddress(const IOEthernetAddress *addr);
bool alxLoadDefaultAddress();
bool alxStart(UInt32 maxIntrRate);
void alxEnable();
Expand Down

0 comments on commit a23d958

Please sign in to comment.