Skip to contentSkip to conversation

ethtool support to 8260 fcc ethernet driver (and other stuff)

PATCH In review Murray Jensen 2 participants 3 messages Nov 11, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethtool support to 8260 fcc ethernet driver (and other stuff)

This patch does the following:

1. adds support for a "/proc/bus/mii/fccN" file that displays the contents of all MII PHY registers

2. adds support for the generic MII interface available in drivers/net/mii.c

3. adds support for the ioctls used by the ethtool program

4. changes statistics recording so that FIFO Overrun errors are accumulated in rx_fifo_errors instead of rx_crc_errors and Late Collision errors are accumulated in rx_over_errors instead of rx_frame_errors - this means that all the possible errors from the 8260 fcc have their own counter

5. fixes comments such as /* CONFIG_FEC_... */ to be /* CONFIG_FCC_... */

6. fixes a bug in the DM9131 PHY support where the wrong value for link status was being seen because the bit in the status register is marked as "latch low" which means if it goes low (e.g. you pull out the TP cable), it will stay that way until the register is read - I simply always read the register twice now to ensure that the current link status is seen (not the latched status). Other PHY driver writers should beware of this.

7. fix a printk which had "fec: ..." to output "fccN: ..." instead

8. the fcc driver version is tagged as containing these changes by appending " (mjj)" after the version number (which is still 0.3). People will probably want to leave this one out, or else bump the version number to 0.4 instead. (I did this so I could tell which of our boards here had the fixes).

9. set and clear the LPB (local protect bit) bit in the FCC PSMR in tandem with setting and clearing the FDE (full duplex enable) bit - if LPB is not set, the receiver is blocked while transmitting - on my board this resulted in very low throughput on input to the board (e.g. ftp to the board and PUT a file). I found this fix in a message to the list, and it solved by problem, but the official 2_4_devel sources still doesn't have it. Sorry, I don't have the reference at hand - but a search on the list should pick it up pretty quick (so the right person gets credit for the fix).

The main advantage of this patch is that you can compile and use the "ethtool" program on 8260 linuxppc. This allows you to control the fcc ethernet operating mode (e.g. 10/100, half/full duplex, auto-negotiation or not). I should point out that because of number 6 above, the need for ethtool for me went away so I haven't tested these changes much, other than confirming that ethtool runs and calls the ioctls properly - but someone might be interested in the code anyway.

Note that this requires a patch to drivers/net/Makefile so that mii.c is compiled if CONFIG_FCC_GENERIC_MII is enabled - obviously this violates the rule that non-ppc specific files shouldn't be touched, but it is essential to the patch.

Have fun. Cheers!

								Murrray...

--
Murray Jensen, CSIRO Manufacturing & Infra. Tech. Phone: +61 3 9662 7763
Locked Bag No. 9, Preston, Vic, 3072, Australia. Fax: +61 3 9662 7853
Internet: [email protected]

Hymod project: http://www.msa.cmst.csiro.au/projects/Hymod/

#1 lore raw
Quoted 30 lines · Murray Jensen

This patch does the following:

1. adds support for a "/proc/bus/mii/fccN" file that displays the contents of all MII PHY registers

2. adds support for the generic MII interface available in drivers/net/mii.c

3. adds support for the ioctls used by the ethtool program

4. changes statistics recording so that FIFO Overrun errors are accumulated in rx_fifo_errors instead of rx_crc_errors and Late Collision errors are accumulated in rx_over_errors instead of rx_frame_errors - this means that all the possible errors from the 8260 fcc have their own counter

5. fixes comments such as /* CONFIG_FEC_... */ to be /* CONFIG_FCC_... */

6. fixes a bug in the DM9131 PHY support where the wrong value for link status was being seen because the bit in the status register is marked as "latch low" which means if it goes low (e.g. you pull out the TP cable), it will stay that way until the register is read - I simply always read the register twice now to ensure that the current link status is seen (not the latched status). Other PHY driver writers should beware of this.

7. fix a printk which had "fec: ..." to output "fccN: ..." instead

8. the fcc driver version is tagged as containing these changes by appending " (mjj)" after the version number (which is still 0.3). People will probably want to leave this one out, or else bump the version number to 0.4 instead. (I did this so I could tell which of our boards here had the fixes).

Quoted 8 lines

9. set and clear the LPB (local protect bit) bit in the FCC PSMR in tandem with setting and clearing the FDE (full duplex enable) bit - if LPB is not set, the receiver is blocked while transmitting - on my board this resulted in very low throughput on input to the board (e.g. ftp to the board and PUT a file). I found this fix in a message to the list, and it solved by problem, but the official 2_4_devel sources still doesn't have it. Sorry, I don't have the reference at hand - but a search on the list should pick it up pretty quick (so the right person gets credit for the fix).

Could you please split this up into 9 logical patches then? This makes it easier for others to track things and to get it reviewed as well (ie someone who knows /proc and is well aware of common mistakes people make probably wouldn't mind looking over the patch, if it was just /proc bits).

Quoted 3 lines

Note that this requires a patch to drivers/net/Makefile so that mii.c is compiled if CONFIG_FCC_GENERIC_MII is enabled - obviously this violates the rule that non-ppc specific files shouldn't be touched, but it is essential to the patch.

That part should also just be:
obj-$(CONFIG_FCC_GENERIC_MII) += mii.o

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw
Quoted 1 line · Tom Rini

Could you please split this up into 9 logical patches then?

Hi Tom, I knew you would say this :-) But I don't have a lot of spare time at the moment, just enough to put this patch together and get it out in case it would help others. To produce this patch was fairly trivial - just a simple diff, but to split it up would take a fair amount of effort (since there would be a number of places where the various bits clashed). I will do it eventually, but don't hold your breath. Perhaps there is someone out there with more time? (yeah right :-)

Quoted 2 lines

That part should also just be:
obj-$(CONFIG_FCC_GENERIC_MII) += mii.o

OK, thanks. Cheers!

								Murray...

--
Murray Jensen, CSIRO Manufacturing & Infra. Tech. Phone: +61 3 9662 7763
Locked Bag No. 9, Preston, Vic, 3072, Australia. Fax: +61 3 9662 7853
Internet: [email protected]

Hymod project: http://www.msa.cmst.csiro.au/projects/Hymod/

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/