Jump to content

BCM5722, BCM5754/M, BCM5755/M, BCM5787/M and BCM5906/M NIC driver (32/64-bit)


  • Please log in to reply
233 replies to this topic

#1
adlan

adlan

    InsanelyMac Protégé

  • Members
  • Pip
  • 8 posts
  • Gender:Male
Hi,

I've decided to scratch an itch and develop a driver for my nic(5787m). Although there has been a working driver for the card, it is a hexedited version which i thought is not a permanent solution :(.

This driver is implemented based on the BCM5722 Programmer's Guide provided in Broadcom's open source developer resource. Additional information is gleaned from Linux(tg3) and FreeBSD(if_bge) driver. Since the manual covers more than one model, i decided to include support for some of the models documented.

It should support the following models:

  • BCM5722
  • BCM5754
  • BCM5754M
  • BCM5755
  • BCM5755M
  • BCM5787
  • BCM5787M #
  • BCM5906 #
  • BCM5906M #

# - tested

Features not implemented as of this release:

  • Wake-on-LAN

Installation

Install to /System/Library/Extensions

  • manually copy the kext to /S/L/E and repair permissions or
  • use KextWizard

Issues

Please report any issues you found at https://github.com/a...BCM5722D/issues

Contributing

Source code is available at https://github.com/adlan/BCM5722D. See project's wiki for details

Credit

  • broadcom for releasing the programmer's guide
  • authors of Linux(tg3) and FreeBSD(if_bge) driver
  • early beta testers (acero,Hacktrix2006,quadomatic,queshaolangman,Zprood)

Disclaimer
This driver is neither supported nor endorsed by Broadcom. Zombies may invade your house and i take no responsibility for whatever happens. Use at your own risk

don't forget to report how it's going
enjoy!

Attached Files



#2
Hacktrix2006

Hacktrix2006

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 423 posts
  • Gender:Male
Before you say it doesn't work i would like to say it does. I have Beta Tested this for adlan so please give him the respect he deserves!

Thanks bud for this great driver

#3
adlan

adlan

    InsanelyMac Protégé

  • Members
  • Pip
  • 8 posts
  • Gender:Male

Before you say it doesn't work i would like to say it does. I have Beta Tested this for adlan so please give him the respect he deserves!

Thanks bud for this great driver


thanks! ;)

#4
Zprood

Zprood

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 251 posts
  • Gender:Male
  • Location:CHN

thanks! :)

You can reply the message now, congratulations. ;)

#5
00diabolic

00diabolic

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 812 posts
  • Gender:Male
  • Interests:Modding anything.
Thanks Man.. Its been a long time coming for the 5906 kext..

#6
farhanito

farhanito

    InsanelyMac Protégé

  • Members
  • PipPip
  • 77 posts
  • Gender:Male
thanks a lot, adlan.. wonderful...

i think its working...
congratulation

BCM5722D (Build date/time: Feb 11 2011 16:21:31)
BCM5722D (setupDriver:920): MSI index on 1
BCM5722D (resetAdapter:144): 4B657654 to B49A89AB in 0 iterations
my_name_adlan_BCM5722D: Model: BCM5906M NetLink (TM) Fast Ethernet
my_name_adlan_BCM5722D: Loaded successfully


#7
SunShineXXX

SunShineXXX

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 1 posts
Thanks men ,it work like a charm :) . I've just installed this kext on my Lenovo y430 w Bcm5906 ethernet card .

#8
MyLord

MyLord

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 2 posts
hello.. how bout BCM5789..?

#9
adlan

adlan

    InsanelyMac Protégé

  • Members
  • Pip
  • 8 posts
  • Gender:Male

thanks a lot, adlan.. wonderful...

i think its working...
congratulation

BCM5722D (Build date/time: Feb 11 2011 16:21:31)
BCM5722D (setupDriver:920): MSI index on 1
BCM5722D (resetAdapter:144): 4B657654 to B49A89AB in 0 iterations
my_name_adlan_BCM5722D: Model: BCM5906M NetLink (TM) Fast Ethernet
my_name_adlan_BCM5722D: Loaded successfully



Thanks men ,it work like a charm :) . I've just installed this kext on my Lenovo y430 w Bcm5906 ethernet card .


great! glad to hear it's working for you, thanks! ;)

#10
adlan

adlan

    InsanelyMac Protégé

  • Members
  • Pip
  • 8 posts
  • Gender:Male

hello.. how bout BCM5789..?


sorry for the delay, i was away from my computer for the last few days

i don't think this driver will work for that card. i've released the source code, so if anybody is interested can try to make it work for this card. since there is manual provided by broadcom in its oss resource page, i'll try to look at it when i have time.

#11
immo

immo

    Insanely Looking for Time to Hack

  • Members
  • PipPipPipPipPip
  • 276 posts
  • Gender:Male
Excellent work :( I thought there would never be a driver for these old Broadcom 100MBit network cards. I've been using the Apple USB Lan dongle until now, and I've noticed a huge drop in CPU usage during Lan activity using the built in network port with your kext. Thanks!

#12
orewriter

orewriter

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 1 posts
thx adlan..anyone what broadcomm5904 kext support for leopard??

#13
IDDPioneer

IDDPioneer

    InsanelyMac Protégé

  • Members
  • PipPip
  • 66 posts
  • Gender:Male
  • Location:Brazil
Hey man !!! I have a BCM5906M and it is working perfectly well!!!




Thanx and countinue the good work







congratulations !!!!!

#14
jriker1

jriker1

    InsanelyMac Protégé

  • Members
  • Pip
  • 39 posts
This is good news to hear in general. Question as I don't know these other cards, just that numericall they aren't far off. I have a Broadcom BCM5751. I assume this won't work with it? I tried the kext but no joy. Wasn't sure if I just needed to add my pci string into the kext to recognize or or if it's to different of a card.



Thanks.



JR

Edit: By the way, with this driver should the MAC address be automatically detected or is a bunch of zeros normal? Do I need to set them each boot with ifconfig? Unfortunately where I am now I do not have access to a wired connection but did make the change and added my device's pci value in there and is showing that the new interface was detected and has a self assigned DHCP IP but in terminal ifconfig shows a bunch of zeros still for the MAC address.

#15
Jaykob

Jaykob

    InsanelyMac Protégé

  • Members
  • Pip
  • 21 posts
Thank you very much adlan!
I already started to implement a bcm5906 driver on my own but didn't find the time lately. Now I don't have to to it anymore because your driver works perfectly on my Lenovo G550! Great work, will have a look at the source code soon.

#16
artur-pt

artur-pt

    InsanelyMacaholic

  • Local Moderators
  • 4,427 posts
  • Gender:Male
  • Location:Portugal
  • Interests:TechManiaco

hi,

i've decided to scratch an itch and develop a driver for my nic(5787m). Although there has been a working driver for the card, it is a hexedited version which i thought is not a permanent solution plus no source code is accessible. well, if it did, this project wouldn't exist :) .

This driver is implemented based on the BCM5722 Programmer's Guide provided in Broadcom's open source developer resource. Additional information is gleaned from Linux(tg3) and FreeBSD(if_bge) driver. Since the manual covers more than one model, i decided to include support for some of the models documented.

It should support the following models:

  • BCM5754
  • BCM5754M
  • BCM5755
  • BCM5755M
  • BCM5787
  • BCM5787M #
  • BCM5906 #
  • BCM5906M #

# - tested

Features not implemented as of this release:

  • Wake-on-LAN
  • BCM5906/M
    • Isochronous Send Ring
  • BCM5755/M
    • Receive Side Scaling

Installation

Install to /System/Library/Extensions or simply use Kext Helper

please report any issues you found at https://github.com/a...BCM5722D/issues

source code is available at https://github.com/adlan/BCM5722D

credit to
  • broadcom for releasing the programmer's guide
  • authors of Linux(tg3) and FreeBSD(if_bge) driver
  • early beta testers (acero,Hacktrix2006,quadomatic,queshaolangman,Zprood)

Disclaimer
This driver is neither supported nor endorsed by Broadcom. Zombies may invade your house and i take no responsibility for whatever happens. Use at your own risk

don't forget to report how it's going
enjoy!


thanks good job men

14e4 : 1692

works well snow 64 and lion 10.7 (Build 11A459e) 64

#17
adlan

adlan

    InsanelyMac Protégé

  • Members
  • Pip
  • 8 posts
  • Gender:Male
sorry I totally forgot this thread. I thought it's deeply buried in the new user lounge and today I just noticed that this has moved to the appropriate section, thanks mod! now the driver has 2 homes B)

Edit: By the way, with this driver should the MAC address be automatically detected or is a bunch of zeros normal? Do I need to set them each boot with ifconfig? Unfortunately where I am now I do not have access to a wired connection but did make the change and added my device's pci value in there and is showing that the new interface was detected and has a self assigned DHCP IP but in terminal ifconfig shows a bunch of zeros still for the MAC address.


I thought BCM5751 has a working driver? Does this driver works for you? MAC address will be automatically populated by the driver. I checked the programmer's guide for the model and it seems it has the same register address for MAC address value, so it should have no problem. tg3(linux) and bge(freebsd) driver checks a number of places for MAC address value whereas this driver depends only on the MAC address register for the address and I think that causes a bunch of zeros. However, I didn't check for initialization steps for this model, maybe it has something to do with that.

#18
Stratus Fear

Stratus Fear

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
Works great on 10.7 64-bit with a BCM57788 (14e4:1691). Thanks!

#19
Stratus Fear

Stratus Fear

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
In trying out the driver, I noticed that, no matter what I did, I could not get a 1000FD connection. Even if I forced it and my switch is advertising it, the PHY would only set to half-duplex. I would see this in the output of ifconfig:

media: autoselect (1000baseT <half-duplex>)

When forcing:

media: 1000baseT <full-duplex> (1000baseT <half-duplex>)

I took at look at the code and found spots in Register.h that look to have accidentally had HD and FD bits swapped according to the BCM5722 Programmer's Guide (I found some in 10, 100, and 1000 modes for advertisement and negotiation, as well as mode set), and the section of PHY.cpp that sets the PHY mode was setting 1000HD register bits for both 1000HD and 1000FD mode. I fixed those and added my network controller to the model list (0x1691). Upon testing the modifications, the card is recognized and model name is output in the system logs, and 1000FD appears to be set correctly.

media: autoselect (1000baseT <full-duplex>)

My switch also reports 1000baseT FDX operation.

I attached the modified files below in a zip.

Please feel free to double check any changes I made. I'm not really a programmer, but I know enough to be able to follow what's happening in source code, so hopefully I didn't break anything. But it appears to work correctly. Thanks so much for creating this driver! I was ripping my hair out trying to get my card to work in Lion with AppleBCM5701Ethernet to no avail, as the previously hex edited driver that worked in SL had unresolved symbol linking errors in Lion.

Attached Files



#20
Stratus Fear

Stratus Fear

    InsanelyMac Protégé

  • Members
  • PipPip
  • 51 posts
  • Gender:Male
Just for the record here are the diffs that came out of github:mac:

BCM5722D.cpp:
[codebox]@@ -36,6 +36,7 @@ static const struct SupportedDevice
{ DEVICEID_BCM5787M, "BCM5787M NetLink ™ Gigabit Ethernet" },
{ DEVICEID_BCM5906, "BCM5906 NetLink ™ Fast Ethernet" },
{ DEVICEID_BCM5906M, "BCM5906M NetLink ™ Fast Ethernet" },
+ { DEVICEID_BCM57788, "BCM57788 NetLink ™ Gigabit Ethernet" },
{ 0, NULL }
};[/codebox]

Info.plist:
[codebox]@@ -39,6 +39,7 @@
<string>pci14e4,1672</string>
<string>pci14e4,167b</string>
<string>pci14e4,1673</string>
+ <string>pci14e4,1691</string>
<string>pci14e4,169b</string>
<string>pci14e4,1693</string>
<string>pci14e4,1712</string>[/codebox]

PHY.cpp:
[codebox]@@ -687,7 +687,7 @@ void BCM5722D::resolveOperatingSpeedAndLinkDuplex(UInt16 status)

media.speed = kLinkSpeed1000;
media.duplex = kLinkDuplexFull;
- currentMediumIndex = kMediumTypeIndex1000HD;
+ currentMediumIndex = kMediumTypeIndex1000FD;

break;[/codebox]

Register.h:
[codebox]@@ -30,6 +30,7 @@
#define DEVICEID_BCM5787M 0x1693
#define DEVICEID_BCM5906 0x1712
#define DEVICEID_BCM5906M 0x1713
+#define DEVICEID_BCM57788 0x1691

#define PHYID_MODEL_5754_5787 0x0E
#define PHYID_MODEL_5755 0x0C
@@ -729,17 +730,17 @@ enum {
#define PHY_AUTONEGADVERT_802_3 BIT(0)
#define PHY_AUTONEGADVERT_10HD BIT(5)
#define PHY_AUTONEGADVERT_10FD BIT(6)
-#define PHY_AUTONEGADVERT_100FD BIT(7)
-#define PHY_AUTONEGADVERT_100HD BIT(8)
+#define PHY_AUTONEGADVERT_100HD BIT(7)
+#define PHY_AUTONEGADVERT_100FD BIT(8)
#define PHY_AUTONEGADVERT_PAUSECAP BIT(10)
#define PHY_AUTONEGADVERT_ASYMPAUSE BIT(11)

// Auto-Negotiation Link Partner Ability Register
#define PHY_AUTONEGPARTNER 0x05
-#define PHY_AUTONEGPARTNER_10FD BIT(5)
-#define PHY_AUTONEGPARTNER_10HD BIT(6)
-#define PHY_AUTONEGPARTNER_100FD BIT(7)
-#define PHY_AUTONEGPARTNER_100HD BIT(8)
+#define PHY_AUTONEGPARTNER_10HD BIT(5)
+#define PHY_AUTONEGPARTNER_10FD BIT(6)
+#define PHY_AUTONEGPARTNER_100HD BIT(7)
+#define PHY_AUTONEGPARTNER_100FD BIT(8)
#define PHY_AUTONEGPARTNER_PAUSECAP BIT(10)
#define PHY_AUTONEGPARTNER_ASYMPAUSE BIT(11)

@@ -750,8 +751,8 @@ enum {

// 1000BASE-T Status Register
#define PHY_1000BASETSTS 0x0A
-#define PHY_1000BASETSTS_PARTNERFD BIT(10)
-#define PHY_1000BASETSTS_PARTNERHD BIT(11)
+#define PHY_1000BASETSTS_PARTNERHD BIT(10)
+#define PHY_1000BASETSTS_PARTNERFD BIT(11)

#define PHY_DSPRWPORT 0x15[/codebox]





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy