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

Murray Jensen Murray.Jensen at csiro.au
Mon Nov 11 14:55:35 EST 2002


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: Murray.Jensen at csiro.au

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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6_FCC_ET.GZ
Type: application/x-gzip
Size: 5970 bytes
Desc: 6_fcc_ether_ethtool.gz
Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20021111/728afe1f/attachment.bin 


More information about the Linuxppc-embedded mailing list