Hi! On Thursday 08 August 2002 15:52, Gernot Hillier wrote: > Hi! > > I'm currently working on epic100-fiber support for the SMC9432FTX-SC cards > using the LevelOne LXT970 transceiver (patch will follow in the next days). > > I now added the necessary symbols to include/linux/mii.h as I think this is > better then coding the magic numbers in epic100.c. > > I also made some little cosmetic changes to this file. [...] Sorry for the follow up, but I made a silly mistake. Please ignore the FIXME-comment in the last patch. :-(( Correct patch attached. Please apply to include/linux/mii.h... -- Ciao, Gernot
--- mii.h Thu Aug 8 17:33:01 2002 +++ mii-new.h Thu Aug 8 17:32:56 2002 @@ -3,6 +3,9 @@ * Originally drivers/net/sunhme.h. * * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com) + * + * 2002-08-08: symbols for LXT970 MII transceiver added (<gernot@hillier.de>) + * */ #ifndef __LINUX_MII_H__ @@ -10,15 +13,18 @@ #include <linux/types.h> -/* Generic MII registers. */ - +/* Generic MII registers (0,1 mandatory, 2-7 optional). */ #define MII_BMCR 0x00 /* Basic mode control register */ #define MII_BMSR 0x01 /* Basic mode status register */ #define MII_PHYSID1 0x02 /* PHYS ID 1 */ #define MII_PHYSID2 0x03 /* PHYS ID 2 */ #define MII_ADVERTISE 0x04 /* Advertisement control reg */ #define MII_LPA 0x05 /* Link partner ability reg */ -#define MII_EXPANSION 0x06 /* Expansion register */ +#define MII_EXPANSION 0x06 /* Auto-Negotiation Expansion */ +#define MII_NEXTPAGE 0x07 /* Auto-Negotiation Next Page */ +/* 0x07 - 0x0F: reserved */ + +/* vendor specific MII registers. */ #define MII_DCOUNTER 0x12 /* Disconnect counter */ #define MII_FCSCOUNTER 0x13 /* False carrier counter */ #define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */ @@ -31,6 +37,14 @@ #define MII_TPISTATUS 0x1b /* TPI status for 10mbps */ #define MII_NCONFIG 0x1c /* Network interface config */ +/* vendor specific MII registers for Level One LXT970 transceiver (see LXT970 Data Sheet, Revision 1.1 of May 1997). */ +#define MII_LXT970_MIRROR 0x10 /* Mirror Register */ +#define MII_LXT970_INTENAB 0x11 /* Interrupt Enable Register */ +#define MII_LXT970_INTSTAT 0x12 /* Interrupt Status Register */ +#define MII_LXT970_CONFIG 0x13 /* Config Register */ +#define MII_LXT970_CHIPSTAT 0x14 /* Chip Status Register */ + + /* Basic mode control register. */ #define BMCR_RESV 0x007f /* Unused... */ #define BMCR_CTST 0x0080 /* Collision test */ @@ -50,7 +64,11 @@ #define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */ #define BMSR_RFAULT 0x0010 /* Remote fault detected */ #define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */ -#define BMSR_RESV 0x07c0 /* Unused... */ +#define BMSR_MFPREAMBLESUP 0x0040 /* MF with suppressed preamble */ +#define BMSR_MSCONFIGFAULT 0x0080 /* Master-Slave config fault */ +#define BMSR_RESV 0x0100 /* Unused... */ +#define BMSR_100BASE2HALF 0x0200 /* Can do 100BASET2, half-dupl */ +#define BMSR_100BASE2FULL 0x0400 /* Can do 100BASET2, full-dupl */ #define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */ #define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */ #define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */ @@ -103,6 +121,53 @@ #define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */ #define NWAYTEST_RESV2 0xfe00 /* Unused... */ +/* LXT970 Interrupt Enable Register. */ +#define LXT970_INTENAB_TINT 0x0001 /* force MDINT */ +#define LXT970_INTENAB_INTEN 0x0002 /* enable interrupts */ +#define LXT970_INTENAB_RESV 0xfffc /* Unused... */ + +/* LXT970 Interrupt Status Register. */ +#define LXT970_INTSTAT_RESV 0x3fff /* Unused... */ +#define LXT970_INTSTAT_XTALOK 0x4000 /* XTAL circuit available */ +#define LXT970_INTSTAT_MINT 0x8000 /* MII interrupt pending */ + +/* LXT970 Configuration Register. */ +#define LXT970_CONFIG_TRANSDISC 0x0001 /* disconnect TP transmitter */ +#define LXT970_CONFIG_RESV1 0x0002 /* Unused... */ +#define LXT970_CONFIG_100BASEFX 0x0004 /* enable fiber interface */ +#define LXT970_CONFIG_NOSCRAM 0x0008 /* bypass scramblers */ +#define LXT970_CONFIG_5BSYMBOL 0x0010 /* 5-bit Symbol Mode */ +#define LXT970_CONFIG_TXCLOCK 0x0020 /* special TX clock mode */ +#define LXT970_CONFIG_LEDC_COLL 0x0000 /* LEDC indicates collision */ +#define LXT970_CONFIG_LEDC_OFF 0x0040 /* LEDC off */ +#define LXT970_CONFIG_LEDC_ACT 0x0080 /* LEDC indicates activity */ +#define LXT970_CONFIG_LEDC_ON 0x00c0 /* LEDC continuously on */ +#define LXT970_CONFIG_NOLINKTST 0x0100 /* disable 10BaseT link test */ +#define LXT970_CONFIG_NOJABBER 0x0200 /* disable 10BaseT jabber */ +#define LXT970_CONFIG_SQE 0x0400 /* enable 10BaseT SQE */ +#define LXT970_CONFIG_NOTPLOOPB 0x0800 /* disable 10BaseT TP loopback */ +#define LXT970_CONFIG_MDIOINT 0x1000 /* enable MDIO interrupt */ +#define LXT970_CONFIG_REPEATER 0x2000 /* enable repeater mode */ +#define LXT970_CONFIG_TXTEST 0x4000 /* enable 100BaseT transmit tst*/ +#define LXT970_CONFIG_RESV2 0x8000 /* Unused... */ + +/* LXT970 Chip Status Register. */ +#define LXT970_CHIPSTAT_NOPLL 0x0001 /* 100BaseTX/FX recv not locked*/ +#define LXT970_CHIPSTAT_RESV1 0x0002 /* Unused... */ +#define LXT970_CHIPSTAT_LVFAULT 0x0004 /* low voltage fault on VCC */ +#define LXT970_CHIPSTAT_RESV2 0x0008 /* Unused... */ +#define LXT970_CHIPSTAT_MLT3ERR 0x0010 /* MLT3 encoding error */ +#define LXT970_CHIPSTAT_SYMBERR 0x0020 /* Symbol Error detected */ +#define LXT970_CHIPSTAT_STREAML 0x0040 /* scrambler/decoder locked */ +#define LXT970_CHIPSTAT_RESV3 0x0080 /* Unused... */ +#define LXT970_CHIPSTAT_PAGERCV 0x0100 /* duplicate of EXPANSION_LCWP */ +#define LXT970_CHIPSTAT_ANCOMPL 0x0200 /* dupl of BMSR_ANEGCOMPLETE */ +#define LXT970_CHIPSTAT_RESV4 0x0400 /* Unused... */ +#define LXT970_CHIPSTAT_100MBPS 0x0800 /* 100 Mbps operation */ +#define LXT970_CHIPSTAT_FULLDPL 0x1000 /* full duplex operation */ +#define LXT970_CHIPSTAT_LINKOK 0x2000 /* link is up (dynamic) */ +#define LXT970_CHIPSTAT_RESV5 0xc000 /* Unused... */ + struct mii_if_info { int phy_id;