Home | History | Annotate | Download | only in mii
History log of /src/sys/dev/mii/mii_bitbang.c
RevisionDateAuthorComments
 1.14  22-Jan-2019  msaitoh Change MII PHY read/write API from:

int (*mii_readreg_t)(device_t, int, int);
void (*mii_writereg_t)(device_t, int, int, int);
to:

int (*mii_readreg_t)(device_t, int, int, uint16_t *);
int (*mii_writereg_t)(device_t, int, int, uint16_t);

Now we can test if a read/write operation failed or not by the return value.

In 802.3 spec says that the PHY shall not respond to read/write transaction
to the unimplemented register(22.2.4.3). Detecting timeout can be used to
check whether a register is implemented or not (if the register conforms to
the spec). ukphy(4) can be used this for MII_MMDACR and MII_MMDAADR.

Note that I noticed that the following code do infinite loop in the
read/wirte function. If it accesses unimplemented PHY register, it will hang.
It should be fixed:

arm/at91/at91emac.c
arm/ep93xx/epe.c
arm/omap/omapl1x_emac.c
mips/ralink/ralink_eth.c
arch/powerpc/booke/dev/pq3etsec.c(read)
dev/cadence/if_cemac.c <- hkenken
dev/ic/lan9118.c


Tested with the following device:

axe+ukphy
axe+rgephy
axen+rgephy (tested by Andrius V)
wm+atphy
wm+ukphy
wm+igphy
wm+ihphy
wm+makphy
sk+makphy
sk+brgphy
sk+gentbi
msk+makphy
sip+icsphy
sip+ukphy
re+rgephy
bge+brgphy
bnx+brgphy
gsip+gphyter
rtk+rlphy
fxp+inphy (tested by Andrius V)
tlp+acphy
ex+exphy
epic+qsphy
vge+ciphy (tested by Andrius V)
vr+ukphy (tested by Andrius V)
vte+ukphy (tested by Andrius V)

Not tested (MAC):
arm:at91emac
arm:cemac
arm:epe
arm:geminigmac
arm:enet
arm:cpsw
arm:emac(omac)
arm:emac(sunxi)
arm:npe
evbppc:temac
macppc:bm
macppc:gm
mips:aumac
mips:ae
mips:cnmac
mips:reth
mips:sbmac
playstation2:smap
powerpc:tsec
powerpc:emac(ibm4xx)
sgimips:mec
sparc:be
sf
ne(ax88190, dl10019)
awge
ep
gem
hme
smsh
mtd
sm
age
alc
ale
bce
cas
et
jme
lii
nfe
pcn
ste
stge
tl
xi
aue
mue
smsc
udav
url

Not tested (PHY):
amhphy
bmtphy
dmphy
etphy
glxtphy
ikphy
iophy
lxtphy
nsphyter
pnaphy
rdcphy
sqphy
tlphy
tqphy
urlphy
 1.13  08-Jan-2019  msaitoh s/u_int32_t/uint32_t/
 1.12  04-May-2008  xtraeme branches: 1.12.86; 1.12.88;
device_t/softc split for all mii(4) devices, and other related
cosmetic changes.
 1.11  28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.10  11-Dec-2005  christos branches: 1.10.70; 1.10.72; 1.10.74;
merge ktrace-lwp.
 1.9  09-Aug-2005  chris Remove changes to bitbang code for de devices to work as tlps on cats.

I need to investigate a proper fix that doesn't break other platforms, eg:
PR kern/30952
 1.8  07-Aug-2005  chris Following feedback from thorpej, remove the #ifdef cats block, and update
comment.

All platforms will now send a change in direction, then the 32 MDO bits
when synchronising with the phy. Rather than sending the change in
direction with the first MDO bit.
 1.7  06-Aug-2005  chris Check in cats specific tweak to make older de cards work as tlp devices.

With this tweak I've completed a full install from NFS of 3.99.7, using a
card the previously didn't work as a tlp device.
 1.6  23-Aug-2004  thorpej Make use of static.
 1.5  13-Nov-2001  lukem branches: 1.5.16;
add RCSID
 1.4  11-Nov-2001  perry fix a couple of signed->unsigned warnings lint found
 1.3  25-Aug-2001  thorpej branches: 1.3.4;
ANSI'ify.
 1.2  30-Apr-2001  lukem branches: 1.2.2;
remove some lint
 1.1  17-Nov-1999  thorpej branches: 1.1.2; 1.1.8; 1.1.10;
Common module for bit-bang'ing the MII.
 1.1.10.3  14-Nov-2001  nathanw Catch up to -current.
 1.1.10.2  21-Sep-2001  nathanw Catch up to -current.
 1.1.10.1  21-Jun-2001  nathanw Catch up to -current.
 1.1.8.2  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.8.1  17-Nov-1999  bouyer file mii_bitbang.c was added on branch thorpej_scsipi on 2000-11-20 11:42:10 +0000
 1.1.2.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1  13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.3.4.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.5.16.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.16.2  18-Sep-2004  skrll Sync with HEAD.
 1.5.16.1  25-Aug-2004  skrll Sync with HEAD.
 1.10.74.1  16-May-2008  yamt sync with head.
 1.10.72.1  18-May-2008  yamt sync with head.
 1.10.70.1  02-Jun-2008  mjf Sync with HEAD.
 1.12.88.1  10-Jun-2019  christos Sync with HEAD
 1.12.86.2  26-Jan-2019  pgoyette Sync with HEAD
 1.12.86.1  18-Jan-2019  pgoyette Synch with HEAD

RSS XML Feed