I have "finished" writing the driver, at least for what I consider mandatory.

I have worked with the released Realtek driver (the FreeBSD flavor)
and have compared with what Aidan has found.

I have tried to organize a little the Realtek provided driver, putting
as parameters what is spread, all along, in daunting switches.

Not all the capabilities are used but at least almost all the cards
should be recognized (correctly drived is another matter).

I have verified that the driver compiles but have done strictly no
testing for the moment. As far as I'm concerned, I will first verify (later)
that the present cards (I have "old" Realtek ones) still work; and then
will switch to the Nix dedicated hardware (this was, for me, the
aim of the exercice) to see if the 8125 works and to try to make it
work starting from this.

I will let Aidan give a look at what I have written, since his work
has been quite a help when diving in the Realtek driver (there are
bits that I will have missed if I had not had his work as a guide).
The present driver incorporates main parts of his work (except what is
the Realtek black magic that I have taken from the Realtek source).

There are slight differences between what he has found and what I
found in the Realtek driver, so I have privileged the Realtek
implementation (example: addresses shifted left by 15, while Realtek
divides by 2 (translated as shifting right by 1), and then shifts left
by 16; this is not exactly the same, so I have written things
according to Realtek ((ra >>1) << 16). There are other such slight
discrepancies but mainly one finds similar treatments.

The latest version is here:

http://downloads.kergis.com/misc/9front/ether8169.c

(not a diff, since the modifications are so huge that it will make no
sense)

I suggest to make it work before speaking about style, function names
and so on.

On Mon, Apr 21, 2025 at 08:58:43AM +0200, [email protected] wrote:
> Hello Aidan,
> 
> On Sun, Apr 20, 2025 at 11:07:44AM -0700, Aidan K. Wiggins via 9fans wrote:
> > Hi Thierry,
> > 
> > Thanks for this work!
> > 
> > I think I agree that it's the right thing to do to shove all those
> > undocumented bits to the bottom of the file. I noticed that the file's
> > changed a bit since I last looked (e.g. +rtl8169getintr()), so it
> > looks like it's coming together well. I'll try and get to your patch
> > tonight; 2.5G operation doesn't work on my nic, so it very well could
> > be that these phy specific bits do just that!
> > 
> 
> I have continued to modify the file (I have added 500MF, 1500MF and
> 500MF_LITE speed flags---that Realtek sets to 1000, 1000 and 2500! I
> had a spurious rtl8168phycfg() that I suppressed; the
> rtl8168macmcucfg() has to go in attach, and not in init, as well as
> rtl8169hwinit() etc.).
> 
> So I plan to finish today and publish the version tonight (I just
> updated at the date of this email what I have for now, but it will
> evolve a bit once I understand where and how should go the Cmdplus
> stuff for example).
> 
> > Re: the mii bits.. I'll have to test around with the code a bit, but I
> > would like to make use of the recent mii() changes incorporating some
> > of Clause 45 of the 802.3 into the code. That should give us status
> > (though we can already do this through Realtek's registers), and
> > autonegotiation for 2.5G/5G (which is maybe what's missing).
> > 
> 
> This is also the part I have to look at today. For the 2.5G and 5G,
> you may perhaps get the speed flags I have added for 5000MF_LITE, that
> has to set speed to 2500! Your problem is perhaps that the incorrect
> flag is passed in the the phy status.
> 
> Best,
> --
> Thierry Laronde <tlaronde +AT+ kergis +dot+ com>
>              http://www.kergis.com/
>             http://kertex.kergis.com/
> Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C

-- 
        Thierry Laronde <tlaronde +AT+ kergis +dot+ com>
                     http://www.kergis.com/
                    http://kertex.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T6dcd1a43b39b723d-Mfc3ec3a2b8f2792fa086adc4
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to