Jump to content

RealtekR1000 v3


Slice
 Share

136 posts in this topic

Recommended Posts

Doesn't work for me: dell xps 17

 

System Information:

 

Type: Ethernet Controller

Bus: PCI

Vendor ID: 0x10ec

Device ID: 0x8168

Subsystem Vendor ID: 0x1028

Subsystem ID: 0x04b7

Revision ID: 0x0006

 

System Log:

Mar 23 16:41:22 localhost kernel[0]: RealtekR1000: init
Mar 23 16:41:22 localhost kernel[0]: RealtekR1000: start
Mar 23 16:41:22 localhost kernel[0]: RTL8xxx@0x2000: Found chip reg=2f200000
Mar 23 16:41:22 localhost kernel[0]: RTL8xxx@0x2000: Realtek RTL8168E/8111E_2 (mcfg 28)
Mar 23 16:41:22 localhost kernel[0]: identified as RTL8168E/8111E_2
Mar 23 16:41:22 localhost kernel[0]: RTL8xxx@0x2000: 1000Mbps Full-duplex operation, TBI Link OK
Mar 23 16:41:22 localhost kernel[0]: RTL8xxx@0x2000: Link Status: Not Linked
Mar 23 16:41:22 localhost kernel[0]: RTL8xxx@0x2000: registerWithPolicyMaker
Mar 23 16:41:22 localhost kernel[0]: RTL8xxx@0x2000: setPowerState(1)
Mar 23 16:41:22 localhost kernel[0]: RTL8xxx@0x2000: configureInterface
Mar 23 16:41:22 localhost kernel[0]: RTL8xxx@0x2000: attaching as en0
Mar 23 16:41:22 localhost kernel[0]: en0: start: returning '1'
Mar 23 16:41:22 localhost kernel[0]: com_chucko_RealtekR1000: Ethernet address 14:fe:b5:b7:56:68
Mar 23 16:41:24 localhost kernel[0]: en0: enable
Mar 23 16:41:24 localhost kernel[0]: en0: setActivationLevel(2)
Mar 23 16:41:24 localhost kernel[0]: en0: Selected medium is NULL, forcing to autonegotiation
Mar 23 16:41:24 localhost kernel[0]: en0: selectMedium, index=6
Mar 23 16:41:24 localhost kernel[0]: en0: R1000SetMedium(0x2, 0x2, 0x1)
Mar 23 16:41:24 localhost kernel[0]: en0: setLinkStatus but no PHYStatus

Mar 23 16:41:24 localhost configd[17]: network changed.
Mar 23 16:41:24 RobinMac.local netbiosd[58]: Unable to start NetBIOS name service: 

 

In network setings I see that it initialized and get ip, also I can ping some site, no more. Telnet and other protocols doesn't work.

Link to comment
Share on other sites

Thanks Slice!

Just checking this one against reboot from Windows, like Mieze's one here: http://www.insanelymac.com/forum/topic/287161-new-driver-for-realtek-rtl8111/page__st__20#entry1900390

 

This one is a bit worse regarding this. As soon as Windows is used, this driver does not work properly any more. It connects to the net, but browsing the net from Safari does not work. Shutdowns and restarts do not help. The only thing that helps is to boot into Ubuntu and then back to OSX. This fixes the controller and then it all works fine in OSX ... until I boot to Windows again.

 

I know you do not care about Windows ( :) ), but still ... I hope somebody would resolve this.

 

The Ubuntu says that it uses r8169 driver. I guess this one: https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/realtek/r8169.c

and this one can use controller after windows just fine.

Link to comment
Share on other sites

Hello dmazar

Long ago when i was using clover for the first time i had the exactly same problem with my ethernet and i was using RealtekRTL81xx.kext.

the only way to make it work was by pulling the plug for a few seconds.

Until i choose the AppleRTC patch which solve the problem.

Link to comment
Share on other sites

Thanks Slice!

Just checking this one against reboot from Windows, like Mieze's one here: http://www.insanelym...20#entry1900390

 

This one is a bit worse regarding this. As soon as Windows is used, this driver does not work properly any more. It connects to the net, but browsing the net from Safari does not work. Shutdowns and restarts do not help. The only thing that helps is to boot into Ubuntu and then back to OSX. This fixes the controller and then it all works fine in OSX ... until I boot to Windows again.

 

I know you do not care about Windows ( :) ), but still ... I hope somebody would resolve this.

 

The Ubuntu says that it uses r8169 driver. I guess this one: https://github.com/t...realtek/r8169.c

and this one can use controller after windows just fine.

My sources compiled from Linux. Tell me some details about your chip.

Kernel.log

Mar 9 21:42:37 localhost kernel[0]: RealtekR1000: R1000InitBoard @ PCI 0x3,00

Mar 9 21:42:37 localhost kernel[0]: AppleIntelCPUPowerManagementClient: ready

Mar 9 21:42:37 localhost kernel[0]: RTL8xxx@0xd000: Found chip reg=2f900d00

Mar 9 21:42:37 localhost kernel[0]: RTL8xxx@0xd000: Realtek RTL8168E-VL/8111E-VL (mcfg 30)

Mar 9 21:42:37 localhost kernel[0]: identified as RTL8168E-VL/8111E-VL

Link to comment
Share on other sites

Here:

 

RealtekR1000: R1000InitBoard @ PCI 0x8,00

RTL8xxx@0xc000: Found chip reg=2f200000

RTL8xxx@0xc000: Realtek RTL8168E/8111E_2 (mcfg 28)

identified as RTL8168E/8111E_2

RTL8xxx@0xc000: 1000Mbps Full-duplex operation, TBI Link Failed

Link to comment
Share on other sites

Compared sources of my driver and linux's that you point I found no similarities... :wacko:

May be my correction for E_VL is not good for your E_2?

//rtl8168_phy_power_up
void RealtekR1000::RTL8168PowerUpPHY()
{
// DLog("RTL8168PowerUpPHY\n");
WriteGMII16(0x1F, 0x0000);
/* switch (mcfg) {
case MCFG_8168B_1:
case MCFG_8168B_2:
case MCFG_8168B_3:
case MCFG_8168C_1:
case MCFG_8168C_2:
case MCFG_8168C_3:
case MCFG_8168CP_1:
case MCFG_8168CP_2:
case MCFG_8168D_1:
case MCFG_8168D_2:
case MCFG_8168DP_1:
case MCFG_8168DP_2:
case MCFG_8168DP_3:
//what about E_VL?
 WriteGMII16(0x0E, 0x0000);
 break;
default:
 break;
} */
WriteGMII16(0x0E, 0x0000);
WriteGMII16(PHY_BMCR, PHY_Enable_Auto_Nego);
}

And I found one else difference in pll_power_down

if (tp->mac_version == RTL_GIGA_MAC_VER_32 ||
 tp->mac_version == RTL_GIGA_MAC_VER_33)
 rtl_ephy_write(tp, 0x19, 0xff64);

But I see you have problem with power up, not with power down.

Link to comment
Share on other sites

Well yes, r8168 and r8169 are quite different.

 

Both yours and Mieze's driver are working fine here once they start working. I can shutdown/restart as many times as I I want into OSX and they work. It's just after starting Windows they stop working properly . They do connect to the net, but net is not usable.

 

On the other hand, since nobody is reporting the same issue, maybe it's something specific to my Asus P8P67-M. And then ... I have the same situation on Hp ProBook also.

Link to comment
Share on other sites

Well yes, r8168 and r8169 are quite different.

 

Both yours and Mieze's driver are working fine here once they start working. I can shutdown/restart as many times as I I want into OSX and they work. It's just after starting Windows they stop working properly . They do connect to the net, but net is not usable.

 

On the other hand, since nobody is reporting the same issue, maybe it's something specific to my Asus P8P67-M. And then ... I have the same situation on Hp ProBook also.

 

I have the same issue on my Probook. After running Windows, network appears to connect (link up, mac address there, ip address there, ping works), but Chrome cannot load a webpage. It works fine after cold boot and it works fine after running Ubuntu (12.04LTS).

 

As dmazar says this is both on your driver and Meize's (not an issue w/ lnx2mac... but it is not open source??). Side note: I only get 100mbps with Slice's driver, but get 1Gpbs w/ Meize's.

 

I tried disabling a bunch of the options (offloading, etc.) in the Windows driver thinking that they might have something to do with it, but was stil unsuccessful. I guess if we could find sources for the driver in Linux, we could maybe determine what it is doing during init that is different? Way to do hardware reset?

Link to comment
Share on other sites

Did note something I may have to look further into but have no idea how and no time whatsoever at the moment to do it;

 

When using the kext (first version) on a ga-z68x-ud3h-b3 with RTL8169 chipset connected directly to my cablemodem, now my cablemodem periodically (about 5 times a day) locks up and have to reset it.

It started as soon as I started using the kext, so I've been testing a few days on and off with the kext enabled and off connected with an airport card.

Just to make sure it wasn't the .3 update.

I found out without the kext an/or using the lnx2mac version I had no problems whatsoever, whenever I started using it I got the problem, and mainly after sleep or long time of inactivity, but also suddenly during normal use.

The log shows nothing out of the ordinary but there's a TPI-link failed error on booting.

Could you tell me what info you'd need to resolve this if it's something you'll be looking at?

Link to comment
Share on other sites

Finally had the time to sort out the log;

 

31-03-13 15:20:53,000 kernel[0]: RealtekR1000: init

31-03-13 15:20:53,000 kernel[0]: RealtekR1000: start

31-03-13 15:20:53,000 kernel[0]: RealtekR1000: R1000InitBoard @ PCI 0x7,00

31-03-13 15:20:53,000 kernel[0]: RTL8xxx@0xce00: Found chip reg=2f900d00

31-03-13 15:20:53,000 kernel[0]: RTL8xxx@0xce00: Realtek RTL8168E-VL/8111E-VL (mcfg 30)

31-03-13 15:20:53,000 kernel[0]: identified as RTL8168E-VL/8111E-VL

31-03-13 15:20:53,000 kernel[0]: RTL8xxx@0xce00: 1000Mbps Full-duplex operation, TBI Link Failed

31-03-13 15:20:53,000 kernel[0]: RTL8xxx@0xce00: Link Status: Not Linked

31-03-13 15:20:53,000 kernel[0]: RTL8xxx@0xce00: registerWithPolicyMaker

31-03-13 15:20:53,000 kernel[0]: RTL8xxx@0xce00: setPowerState(1)

31-03-13 15:20:53,000 kernel[0]: RTL8xxx@0xce00: configureInterface

31-03-13 15:20:53,000 kernel[0]: RTL8xxx@0xce00: attaching as en0

31-03-13 15:20:53,000 kernel[0]: en0: start: returning '1'

31-03-13 15:20:55,000 kernel[0]: en0: enable

31-03-13 15:20:55,000 kernel[0]: en0: setActivationLevel(2)

31-03-13 15:20:55,000 kernel[0]: en0: Selected medium is NULL, forcing to autonegotiation

31-03-13 15:20:55,000 kernel[0]: en0: selectMedium, index=6

31-03-13 15:20:55,000 kernel[0]: en0: R1000SetMedium(0x2, 0x2, 0x1)

31-03-13 15:20:57,000 kernel[0]: en0: Link up

 

 

 

Again this on a GA

-Z68X-UD3H-B3 board, an otherwise well supported and

popular board, except I never had the ethernet working stable.

This is the first kext working great except the occasional lockups which are pretty bothersome.

Link to comment
Share on other sites

Hi Slice,

 

Thanks for your work, as theconnactic i have an 8105E, the official driver works fine, but only in 10mbps and it's too slow when i work on big files .. , instead of hours of work to make an port of the linux driver, i think better and easier to reajust the official driver to correct the 100Mbps problem ? I don't know how to code are how to read lines code atm so.. it will be really nice if you could take a look on that :)

 

I found the datasheet document so it could help, i uploaded it in my original post here : http://www.insanelymac.com/forum/topic/287568-realtek-rtl8105e-only-10mbps-any-chance-for-100mbps/

 

Thanks again for your amazing work

Link to comment
Share on other sites

Hi Slice,

 

Thanks for your work, as theconnactic i have an 8105E, the official driver works fine, but only in 10mbps and it's too slow when i work on big files .. , instead of hours of work to make an port of the linux driver, i think better and easier to reajust the official driver to correct the 100Mbps problem ? I don't know how to code are how to read lines code atm so.. it will be really nice if you could take a look on that :)

 

I found the datasheet document so it could help, i uploaded it in my original post here : http://www.insanelym...ce-for-100mbps/

 

Thanks again for your amazing work

But how did you propose to influence on official driver?

I see only way to search a mistake in linux's sources to correct my driver.

  • Like 1
Link to comment
Share on other sites

I'm using an MSI z77 g41 board. I installed the kext, rebooted, and put in -v. It detects the RealtekR1000 in boot, but hangs at en0: Link up. If you have any idea what to do, please let me know

Link to comment
Share on other sites

Slice, when I disconnect the cable your driver always gets an automatic ip.

 

At boot, connected to the router:

06/04/13 10:16:19,000 kernel[0]: RealtekR1000: init
06/04/13 10:16:19,000 kernel[0]: RealtekR1000: start
06/04/13 10:16:19,000 kernel[0]: RealtekR1000: R1000InitBoard @ PCI 0x4,00
06/04/13 10:16:19,000 kernel[0]: RTL8xxx@0xd000: Found chip reg=2f900d00
06/04/13 10:16:19,000 kernel[0]: RTL8xxx@0xd000: Realtek RTL8168E-VL/8111E-VL_2 (mcfg 30)
06/04/13 10:16:19,000 kernel[0]: identified as RTL8168E-VL/8111E-VL_2
06/04/13 10:16:19,000 kernel[0]: RTL8xxx@0xd000: 1000Mbps Full-duplex operation, TBI Link Failed
06/04/13 10:16:19,000 kernel[0]: RTL8xxx@0xd000: Link Status: Not Linked
06/04/13 10:16:19,000 kernel[0]: RTL8xxx@0xd000: registerWithPolicyMaker
06/04/13 10:16:19,000 kernel[0]: RTL8xxx@0xd000: setPowerState(1)
06/04/13 10:16:19,000 kernel[0]: RTL8xxx@0xd000: configureInterface
06/04/13 10:16:19,000 kernel[0]: RTL8xxx@0xd000: attaching as en0
06/04/13 10:16:19,000 kernel[0]: en0: start: returning '1'
06/04/13 10:16:20,000 kernel[0]: com_chucko_RealtekR1000: Ethernet address _________________
06/04/13 10:16:21,000 kernel[0]: en0: enable
06/04/13 10:16:21,000 kernel[0]: en0: setActivationLevel(2)
06/04/13 10:16:21,000 kernel[0]: en0: Selected medium is NULL, forcing to autonegotiation
06/04/13 10:16:21,000 kernel[0]: en0: selectMedium, index=6
06/04/13 10:16:21,000 kernel[0]: en0: R1000SetMedium(0x2, 0x2, 0x1)
06/04/13 10:16:21,000 kernel[0]: en0: setLinkStatus but no PHYStatus

When I disconnect the cable:

06/04/13 13:31:09,000 kernel[0]: en0: Link down
06/04/13 13:31:10,805 configd[18]: network changed: v4(en1:192.168.0.100, en0-:192.168.2.100) DNS* Proxy SMB
06/04/13 13:31:38,676 configd[18]: network changed: v4(en1:192.168.0.100, en0+:169.254.243.225) DNS* Proxy SMB

Link to comment
Share on other sites

But how did you propose to influence on official driver?

I see only way to search a mistake in linux's sources to correct my driver.

 

I also think porting the Linux drivers is the only way, since 8105E works like a trait under Ubuntu, and porting network drivers from Linux to OSX, unlike graphics, is doable (Slice, Mieze and Lnx2Mac do precisely that), but i gave up to do it by myself: it's above my level of knowledge. Sorry, scellow!

Link to comment
Share on other sites

What you are doing is not really the injection for EN0 here is an example of the code I use for my Realtek NIC. Use my guide here if you need more information:

 

http://rampagedev.wordpress.com/guides/inject-ethernet-built-in-into-a-dsdt/

 

   OperationRegion (GPIO, SystemIO, 0x0800, 0x06)
           Field (GPIO, ByteAcc, NoLock, Preserve)
           {
               GO01,   8, 
               GO02,   8, 
               GO03,   8, 
               GO04,   8, 
               GO05,   8, 
               GP9,    1
           }
           Device (LAN0)
           {
               Name (_ADR, 0x001C0001)
               Method (_PRW, 0, NotSerialized)
               {
                   Return (GPRW (0x09, 0x04))
               }
               Method (_PRT, 0, NotSerialized)
               {
                   If (PICM)
                   {
                       Return (AR05)
                   }
                   Return (PR05)
               }
               Device (GIGE)
               {
                   Name (_ADR, Zero)
                   Name (_PRW, Package (0x02)
                   {
                       0x09, 
                       0x03
                   })
                   Method (EWOL, 1, NotSerialized)
                   {
                       If (LEqual (Arg0, One))
                       {
                           Or (GP9, One, GP9)
                       }
                       Else
                       {
                           And (GP9, Zero, GP9)
                       }
                       If (LEqual (Arg0, GP9))
                       {
                           Return (Zero)
                       }
                       Else
                       {
                           Return (One)
                       }
                   }
                   Method (_DSM, 4, NotSerialized)
                   {
                       Store (Package (0x08)
                           {
                               "AAPL,slot-name", 
                               Buffer (0x09)
                               {
                                   "Internal"
                               }, 
                               "built-in", 
                               Buffer (One)
                               {
                                    0x01
                               }, 
                               "device_type", 
                               Buffer (0x14)
                               {
                                   "Ethernet Controller"
                               }, 
                               "model", 
                               Buffer (0x1D)
                               {
                                   "Realtek 8111DL PCI-E Gigabit"
                               }
                           }, Local0)
                       DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                       Return (Local0)
                   }
               }
           }

Link to comment
Share on other sites

  • 2 weeks later...

Hi Slice,

 

Thank you for your work, it worked almost fine on a GA-Z77N-WIFI (8111F).

There is a problem with Virtualbox, client is Windows 7 and host is OS X 10.8.3, the network adapter is set to bridged adapter.

Every time host wake up from hibernate, the client will lost connection, but after reboot host, it will work properly again.

Link to comment
Share on other sites

Both yours and Mieze's driver are working fine here once they start working. I can shutdown/restart as many times as I I want into OSX and they work. It's just after starting Windows they stop working properly . They do connect to the net, but net is not usable.

Ok, Mieze found out that her driver is not setting RxMaxSize register. The same is here. Adding something like "WriteMMIO16(RxMaxSize, 2000);" to RTL8168.cpp around line 229 fixes the issue.

WriteMMIO32(RxConfig, rx_mode);

   /* Set RxMaxSize register */
   WriteMMIO16(RxMaxSize, 2000);

WriteMMIO8(Cfg9346, Cfg9346_Lock);

  • Like 1
Link to comment
Share on other sites

Ok, Mieze found out that her driver is not setting RxMaxSize register. The same is here. Adding something like "WriteMMIO16(RxMaxSize, 2000);" to RTL8168.cpp around line 229 fixes the issue.

WriteMMIO32(RxConfig, rx_mode);

/* Set RxMaxSize register */
WriteMMIO16(RxMaxSize, 2000);

WriteMMIO8(Cfg9346, Cfg9346_Lock);

Big thanks!

I will make this as v3.0.4. Check the topic.

  • Like 1
Link to comment
Share on other sites

Hi Slice!

 

Thanks for your another good work. :)

I've install RealtekR1000SL.kext in Clover's 10.8 folder now.

 

I found out that unlike RealtekRTL81xx.kext, there is no "Wake for Ethernet network access" option in "System Preferences>Energy Saver."

Is it possible for you to add one?

 

By the way, I felt RealtekR1000SL.kext is a little faster than RealtekRTL81xx.kext. :P

 

Regards, Kevin

Link to comment
Share on other sites

Hi Slice,

 

Tried the newest on ML 10.8.3, working great!

The only thing is that I need to set it manually on 1000baseT, instead of (auto) 100baseTX.

 

I have tried searching in the console, but no debug shown. Anyway I can give you info? :)

 

Card: Realtek 8168/8101E Gigabit Ethernet

 

Thank you very much! :)

Link to comment
Share on other sites

Hello Slice.

 

I want to try you kext, so i´ve to ask if your kext supports the RTL8111C Chipset!?

Also tried the kext of mieze but with her kext WOL is not working.

 

Thanks & Greetz

Link to comment
Share on other sites

  • 3 weeks later...

Hello Slice.

 

I want to try you kext, so i´ve to ask if your kext supports the RTL8111C Chipset!?

Also tried the kext of mieze but with her kext WOL is not working.

 

Thanks & Greetz

Recently I apply this kext to system with 8111C (GA-EP31 motherboard). OS 10.7.5. Works fine. I need no WOL and didn't test it.

Link to comment
Share on other sites

  • 4 weeks later...

Absolutely love the driver so far, seems to perform better than the lnx2mac one ive been using for eons.   Is there any chance that Jumbo Frames will be supported in the future?  I think thats the main thing missing between all the Realtek driver options.

Link to comment
Share on other sites

 Share

×
×
  • Create New...