1*1b8adde7SWilliam Kucharski /* 2*1b8adde7SWilliam Kucharski * linux/mii.h: definitions for MII-compatible transceivers 3*1b8adde7SWilliam Kucharski * Originally drivers/net/sunhme.h. 4*1b8adde7SWilliam Kucharski * 5*1b8adde7SWilliam Kucharski * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com) 6*1b8adde7SWilliam Kucharski * 7*1b8adde7SWilliam Kucharski * Copied Form Linux 2.4.25 an unneeded items removed by: 8*1b8adde7SWilliam Kucharski * Timothy Legge (timlegge at etherboot dot org) 9*1b8adde7SWilliam Kucharski * 10*1b8adde7SWilliam Kucharski * 03/26/2004 11*1b8adde7SWilliam Kucharski */ 12*1b8adde7SWilliam Kucharski 13*1b8adde7SWilliam Kucharski /* Generic MII registers. */ 14*1b8adde7SWilliam Kucharski 15*1b8adde7SWilliam Kucharski #define MII_BMCR 0x00 /* Basic mode control register */ 16*1b8adde7SWilliam Kucharski #define MII_BMSR 0x01 /* Basic mode status register */ 17*1b8adde7SWilliam Kucharski #define MII_PHYSID1 0x02 /* PHYS ID 1 */ 18*1b8adde7SWilliam Kucharski #define MII_PHYSID2 0x03 /* PHYS ID 2 */ 19*1b8adde7SWilliam Kucharski #define MII_ADVERTISE 0x04 /* Advertisement control reg */ 20*1b8adde7SWilliam Kucharski #define MII_LPA 0x05 /* Link partner ability reg */ 21*1b8adde7SWilliam Kucharski #define MII_EXPANSION 0x06 /* Expansion register */ 22*1b8adde7SWilliam Kucharski #define MII_DCOUNTER 0x12 /* Disconnect counter */ 23*1b8adde7SWilliam Kucharski #define MII_FCSCOUNTER 0x13 /* False carrier counter */ 24*1b8adde7SWilliam Kucharski #define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */ 25*1b8adde7SWilliam Kucharski #define MII_RERRCOUNTER 0x15 /* Receive error counter */ 26*1b8adde7SWilliam Kucharski #define MII_SREVISION 0x16 /* Silicon revision */ 27*1b8adde7SWilliam Kucharski #define MII_RESV1 0x17 /* Reserved... */ 28*1b8adde7SWilliam Kucharski #define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */ 29*1b8adde7SWilliam Kucharski #define MII_PHYADDR 0x19 /* PHY address */ 30*1b8adde7SWilliam Kucharski #define MII_RESV2 0x1a /* Reserved... */ 31*1b8adde7SWilliam Kucharski #define MII_TPISTATUS 0x1b /* TPI status for 10mbps */ 32*1b8adde7SWilliam Kucharski #define MII_NCONFIG 0x1c /* Network interface config */ 33*1b8adde7SWilliam Kucharski 34*1b8adde7SWilliam Kucharski /* Basic mode control register. */ 35*1b8adde7SWilliam Kucharski #define BMCR_RESV 0x007f /* Unused... */ 36*1b8adde7SWilliam Kucharski #define BMCR_CTST 0x0080 /* Collision test */ 37*1b8adde7SWilliam Kucharski #define BMCR_FULLDPLX 0x0100 /* Full duplex */ 38*1b8adde7SWilliam Kucharski #define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */ 39*1b8adde7SWilliam Kucharski #define BMCR_ISOLATE 0x0400 /* Disconnect DP83840 from MII */ 40*1b8adde7SWilliam Kucharski #define BMCR_PDOWN 0x0800 /* Powerdown the DP83840 */ 41*1b8adde7SWilliam Kucharski #define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */ 42*1b8adde7SWilliam Kucharski #define BMCR_SPEED100 0x2000 /* Select 100Mbps */ 43*1b8adde7SWilliam Kucharski #define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */ 44*1b8adde7SWilliam Kucharski #define BMCR_RESET 0x8000 /* Reset the DP83840 */ 45*1b8adde7SWilliam Kucharski 46*1b8adde7SWilliam Kucharski /* Basic mode status register. */ 47*1b8adde7SWilliam Kucharski #define BMSR_ERCAP 0x0001 /* Ext-reg capability */ 48*1b8adde7SWilliam Kucharski #define BMSR_JCD 0x0002 /* Jabber detected */ 49*1b8adde7SWilliam Kucharski #define BMSR_LSTATUS 0x0004 /* Link status */ 50*1b8adde7SWilliam Kucharski #define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */ 51*1b8adde7SWilliam Kucharski #define BMSR_RFAULT 0x0010 /* Remote fault detected */ 52*1b8adde7SWilliam Kucharski #define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */ 53*1b8adde7SWilliam Kucharski #define BMSR_RESV 0x07c0 /* Unused... */ 54*1b8adde7SWilliam Kucharski #define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */ 55*1b8adde7SWilliam Kucharski #define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */ 56*1b8adde7SWilliam Kucharski #define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */ 57*1b8adde7SWilliam Kucharski #define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */ 58*1b8adde7SWilliam Kucharski #define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */ 59*1b8adde7SWilliam Kucharski 60*1b8adde7SWilliam Kucharski /* Advertisement control register. */ 61*1b8adde7SWilliam Kucharski #define ADVERTISE_SLCT 0x001f /* Selector bits */ 62*1b8adde7SWilliam Kucharski #define ADVERTISE_CSMA 0x0001 /* Only selector supported */ 63*1b8adde7SWilliam Kucharski #define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */ 64*1b8adde7SWilliam Kucharski #define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */ 65*1b8adde7SWilliam Kucharski #define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */ 66*1b8adde7SWilliam Kucharski #define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */ 67*1b8adde7SWilliam Kucharski #define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */ 68*1b8adde7SWilliam Kucharski #define ADVERTISE_RESV 0x1c00 /* Unused... */ 69*1b8adde7SWilliam Kucharski #define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */ 70*1b8adde7SWilliam Kucharski #define ADVERTISE_LPACK 0x4000 /* Ack link partners response */ 71*1b8adde7SWilliam Kucharski #define ADVERTISE_NPAGE 0x8000 /* Next page bit */ 72*1b8adde7SWilliam Kucharski 73*1b8adde7SWilliam Kucharski #define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \ 74*1b8adde7SWilliam Kucharski ADVERTISE_CSMA) 75*1b8adde7SWilliam Kucharski #define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \ 76*1b8adde7SWilliam Kucharski ADVERTISE_100HALF | ADVERTISE_100FULL) 77*1b8adde7SWilliam Kucharski 78*1b8adde7SWilliam Kucharski /* Link partner ability register. */ 79*1b8adde7SWilliam Kucharski #define LPA_SLCT 0x001f /* Same as advertise selector */ 80*1b8adde7SWilliam Kucharski #define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */ 81*1b8adde7SWilliam Kucharski #define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */ 82*1b8adde7SWilliam Kucharski #define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */ 83*1b8adde7SWilliam Kucharski #define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */ 84*1b8adde7SWilliam Kucharski #define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */ 85*1b8adde7SWilliam Kucharski #define LPA_RESV 0x1c00 /* Unused... */ 86*1b8adde7SWilliam Kucharski #define LPA_RFAULT 0x2000 /* Link partner faulted */ 87*1b8adde7SWilliam Kucharski #define LPA_LPACK 0x4000 /* Link partner acked us */ 88*1b8adde7SWilliam Kucharski #define LPA_NPAGE 0x8000 /* Next page bit */ 89*1b8adde7SWilliam Kucharski 90*1b8adde7SWilliam Kucharski #define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) 91*1b8adde7SWilliam Kucharski #define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) 92*1b8adde7SWilliam Kucharski 93*1b8adde7SWilliam Kucharski /* Expansion register for auto-negotiation. */ 94*1b8adde7SWilliam Kucharski #define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */ 95*1b8adde7SWilliam Kucharski #define EXPANSION_LCWP 0x0002 /* Got new RX page code word */ 96*1b8adde7SWilliam Kucharski #define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */ 97*1b8adde7SWilliam Kucharski #define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */ 98*1b8adde7SWilliam Kucharski #define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */ 99*1b8adde7SWilliam Kucharski #define EXPANSION_RESV 0xffe0 /* Unused... */ 100*1b8adde7SWilliam Kucharski 101*1b8adde7SWilliam Kucharski /* N-way test register. */ 102*1b8adde7SWilliam Kucharski #define NWAYTEST_RESV1 0x00ff /* Unused... */ 103*1b8adde7SWilliam Kucharski #define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */ 104*1b8adde7SWilliam Kucharski #define NWAYTEST_RESV2 0xfe00 /* Unused... */ 105*1b8adde7SWilliam Kucharski 106