Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/ax88190.c
RevisionDateAuthorComments
 1.18  01-Jul-2021  thorpej Make sure the media / mii members in struct ethercom are initialized
so that the media-related ioctls work. Problem reported by Björn Johannesson
on current-users@.

XXX pullup-9
 1.17  30-Jun-2021  thorpej Fix a couple of problems with MII-equipped NE2000 derivatives reported by
Björn Johannesson on current-users@:

- Re-factor dp8390_stop() into dp8390_halt() (that does the stuff to
halt the hardware) and dp8390_stop() (which alls dp8390_halt() before
calling mii_down() via sc->sc_stop_card()). This prevents us from
calling mii_down() before all of the interface data structures have
been set up, which these days can trip a KASSERT().

- Add a 1-second timer to call mii_tick(), and enable it in the
sc->sc_init_card() callback, and cancel it in the sc->sc_stop_card()
and sc->sc_media_fini() callbacks. This is actually a long-standing
bug that previously didn't have much practical effect, but causes
problems with dhcpcd's link live-ness detection logic.
 1.16  04-Feb-2020  thorpej branches: 1.16.10;
Use ifmedia_fini().
 1.15  29-May-2019  msaitoh branches: 1.15.2; 1.15.4;
No functional change:
- Simplify MII structure initialization and reference.
- KNF
 1.14  29-May-2019  msaitoh Whitespace fix. No functional change.
 1.13  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.12  22-Jul-2012  matt branches: 1.12.38; 1.12.40;
Fix mii_statchg to take a 'struct ifnet *' instead of device_t. This fixes
problem with a common MDIO bus used for multiple interfaces.
Some drivers converted to CFATTACL_DECL_NEW.
 1.11  28-Apr-2008  martin branches: 1.11.34;
Remove clause 3 and 4 from TNF licenses
 1.10  12-Mar-2008  cube branches: 1.10.2; 1.10.4;
Split device_t and softc for the NE2000 Ethernet chip and all its variants
and attachments. Use device_t accessors, correct types, and ANSIfy when
appropriate.
 1.9  19-Jan-2008  dyoung branches: 1.9.2; 1.9.6;
Make many ethernet drivers share the common code for MII media
handling, ether_mediastatus() and ether_mediachange(). Check for
a non-ENXIO error return from mii_mediachg(). (ENXIO indicates
that a PHY is suspended.)

This patch shrinks the source code size by 979 lines. There was
a 5100-byte savings on the NetBSD/i386 kernel configuration, ALL.

I have made a few miscellaneous changes, too:

gem(4): use LIST_EMPTY(), LIST_FOREACH().
mtd(4): handle media ioctls, for a change!
axe(4): do not track link status in sc->axe_link any longer
nfe(4), aue(4), axe(4), udav(4), url(4): do not reset all PHYs
on a change of media

Except for the change to mtd(4), no functional changes are intended.

XXX This patch affects more architectures than I can feasibly
XXX compile and run. I have compiled macppc, sparc64, i386. I
XXX have run the patches on i386 boxen with bnx(4) and sip(4).
XXX Compiling and running on evbmips (MERAKI, ADM5120) is in
XXX progress.
 1.8  19-Oct-2007  ad branches: 1.8.2; 1.8.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.7  16-Nov-2006  christos branches: 1.7.8; 1.7.22; 1.7.24; 1.7.28;
__unused removal on arguments; approved by core.
 1.6  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.5  11-Dec-2005  christos branches: 1.5.20; 1.5.22;
merge ktrace-lwp.
 1.4  24-Aug-2004  thorpej branches: 1.4.12;
Use ANSI function decls and more use of static.
 1.3  22-Oct-2002  fair branches: 1.3.6;
Change the "dontcare bits" argument to ifmedia_init() to IFM_IMASK
so that it is possible select PHY instances other than the first
one (instance zero), if there is more than one PHY attached.
 1.2  13-Nov-2001  lukem add/cleanup RCSID
 1.1  04-Aug-2001  enami branches: 1.1.2; 1.1.4;
MII access routines for ASIX AX88190.
 1.1.4.3  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.2  25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.1.4.1  04-Aug-2001  thorpej file ax88190.c was added on branch kqueue on 2001-08-25 06:16:12 +0000
 1.1.2.4  11-Nov-2002  nathanw Catch up to -current
 1.1.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.1.2.2  24-Aug-2001  nathanw Catch up with -current.
 1.1.2.1  04-Aug-2001  nathanw file ax88190.c was added on branch nathanw_sa on 2001-08-24 00:09:17 +0000
 1.3.6.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.6.2  18-Sep-2004  skrll Sync with HEAD.
 1.3.6.1  25-Aug-2004  skrll Sync with HEAD.
 1.4.12.4  17-Mar-2008  yamt sync with head.
 1.4.12.3  21-Jan-2008  yamt sync with head
 1.4.12.2  27-Oct-2007  yamt sync with head.
 1.4.12.1  30-Dec-2006  yamt sync with head.
 1.5.22.2  10-Dec-2006  yamt sync with head.
 1.5.22.1  22-Oct-2006  yamt sync with head
 1.5.20.1  18-Nov-2006  ad Sync with head.
 1.7.28.1  25-Oct-2007  bouyer Sync with HEAD.
 1.7.24.2  23-Mar-2008  matt sync with HEAD
 1.7.24.1  06-Nov-2007  matt sync with HEAD
 1.7.22.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.7.8.1  23-Oct-2007  ad Sync with head.
 1.8.8.1  20-Jan-2008  bouyer Sync with HEAD
 1.8.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.9.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.9.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.9.2.1  24-Mar-2008  keiichi sync with head.
 1.10.4.1  16-May-2008  yamt sync with head.
 1.10.2.1  18-May-2008  yamt sync with head.
 1.11.34.1  30-Oct-2012  yamt sync with head
 1.12.40.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.12.40.1  10-Jun-2019  christos Sync with HEAD
 1.12.38.1  26-Jan-2019  pgoyette Sync with HEAD
 1.15.4.1  29-Feb-2020  ad Sync with head.
 1.15.2.1  03-Jul-2021  martin Pull up following revision(s) (requested by thorpej in ticket #1311):

sys/dev/ic/dp8390.c: revision 1.99
sys/dev/ic/dl10019.c: revision 1.17
sys/dev/ic/ax88190.c: revision 1.18

Make sure the media / mii members in struct ethercom are initialized
so that the media-related ioctls work. Problem reported by Bj�rn Johannesson
on current-users@.

XXX pullup-9
 1.16.10.1  01-Aug-2021  thorpej Sync with HEAD.

RSS XML Feed