Jump to content

Broadcom wireless patch for unsupported cards


jalavoui
 Share

1 post in this topic

Recommended Posts

This method will work with other bcm extensions. I hope this help others to make unsupported cards work.

 

 

Looking at the code of AppleAirPortBrcm4311 i found:

int _wlc_chipmatch(int arg0, int arg1) {
    rsi = arg1;
    LODWORD(rdx) = LODWORD(rsi);
    LODWORD(rax) = 0x0;
    if (LOWORD(arg0) == 0x14e4) {
            if ((LOWORD(rsi) == 0x4320) || (LOWORD(rsi) == 0x4325)) {
                    LODWORD(rax) = 0x1;
            }
            else {
                    if ((LOWORD(rsi) == 0x4303) || (LOWORD(rsi) == 0x4321)) {
                            LODWORD(rax) = 0x1;
                    }
                    else {
                            if ((LOWORD(rsi) == 0x4324) || (LOWORD(rsi) == 0x4318)) {
                                    LODWORD(rax) = 0x1;
                            }
                            else {
                                    if ((LOWORD(rsi) == 0x4319) || (LOWORD(rsi) == 0x431a)) {
                                            LODWORD(rax) = 0x1;
                                    }
                                    else {
                                            if ((LOWORD(rsi) == 0x4311) || (LOWORD(rsi) == 0x4313)) {
                                                    LODWORD(rax) = 0x1;
                                            }
                                            else {
                                                    if ((LOWORD(rsi) == 0x4312) || (LOWORD(rsi) == 0x4314)) {
                                                            LODWORD(rax) = 0x1;
                                                    }
                                                    else {
                                                            if ((LOWORD(rsi) == 0x4315) || (LOWORD(rsi) == 0x4316)) {
                                                                    LODWORD(rax) = 0x1;
                                                            }
                                                            else {
                                                                    if ((LOWORD(rsi) == 0x431b) || (LOWORD(rsi) == 0x431c)) {
                                                                            LODWORD(rax) = 0x1;
                                                                    }
                                                                    else {
                                                                            if ((LOWORD(rsi) == 0x431d) || (LOWORD(rdx + 0xffffffffffffbcd8) <= 0x2)) {
                                                                                    LODWORD(rax) = 0x1;
                                                                            }
                                                                            else {
                                                                                    if ((LOWORD(rdx + 0xffffffffffffbcd5) <= 0x2) || (LOWORD(rsi) == 0x4341)) {
                                                                                            LODWORD(rax) = 0x1;
                                                                                    }
                                                                                    else {
                                                                                            if ((LOWORD(rsi) == 0x4340) || (LOWORD(rdx + 0xffffffffffffbcb0) <= 0x2)) {
                                                                                                    LODWORD(rax) = 0x1;
                                                                                            }
                                                                                            else {
                                                                                                    LODWORD(rax) = LOBYTE(LODWORD(LOWORD(rsi) == 0x4353 ? 0x1 : 0x0) | LODWORD(LOWORD(rsi) == 0x4357 ? 0x1 : 0x0)) & 0xff;
                                                                                            }
                                                                                    }
                                                                            }
                                                                    }
                                                            }
                                                    }
                                            }
                                    }
                            }
                    }
            }
    }
    return rax;
}

This means that adding the pci card id to the kext info.plist is not enough to make it work

 

So what is really need to make new cards work?

 

 

1) Maybe patch your computer bios to remove whitelist protection and tap pin 20 if u have power on problems.

 

2) Add your card id to a "compatible" bcm kext

(e.g add pci14e4,4315 to AppleAirPortBrcm4311.kext)

 

3) Using a debugger browse the code (all of it not just the above function) and replace the bcm card id with your id

(e.g. i have a 4315 compatible with bcm 4312 so i replaced that in code)

 

New bcm kexts migth have board id checks in code or other protections. Changing your smbios might help but if u can't make the kext load the debugger is your friend.

 

Btw, changing your card eeprom is not a very good idea (some cards hate it when u log back to windows)

 

 

The airportd (place in /usr/libexec) might need tobe patched depeding on your OS version

 

In attach a modded kext 4 pci14e4,4315 tested up to 10.8.5 (also works with the osx installer dvd image). I removed the 32 bit code with lipo cmd.

 

Some cosmetic at DSDT:

Device (ARPT)
                {
                    Name (_ADR, Zero)
					Name (_SUN, One)
					Name (_PRW, Package (0x02)
					{
						0x09,
						0x03
					})
					Method (_DSM, 4, NotSerialized)
					{
						Store (Package (0x04)
							{
								"subsystem-id",
								Buffer (0x04)
								{
									 0x4E, 0x00, 0x00, 0x00
								},
								"subsystem-vendor-id",
								Buffer (0x04)
								{
									 0x6B, 0x10, 0x00, 0x00
								}
							}, Local0)
						DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
						Return (Local0)
					}
                    OperationRegion (PCFG, PCI_Config, Zero, 0x08)
                    Field (PCFG, DWordAcc, NoLock, Preserve)
                    {
                        DVID,   32, 
                        PCMS,   32
                    }
                }

Any problems?

Yes ofc! with the above patch sometimes i get a nice black screen at boot. rebooting fixs it

 

 

If u make new patches 4 unsupported cards plz share the changes here ;)

 

wifi.zip

Link to comment
Share on other sites

 Share

×
×
  • Create New...