15 #include <linux/kernel.h>
16 #include <linux/module.h>
17 #include <linux/mii.h>
18 #include <linux/ethtool.h>
22 #define MII_VSC8244_EXT_CON1 0x17
23 #define MII_VSC8244_EXTCON1_INIT 0x0000
24 #define MII_VSC8244_EXTCON1_TX_SKEW_MASK 0x0c00
25 #define MII_VSC8244_EXTCON1_RX_SKEW_MASK 0x0300
26 #define MII_VSC8244_EXTCON1_TX_SKEW 0x0800
27 #define MII_VSC8244_EXTCON1_RX_SKEW 0x0200
30 #define MII_VSC8244_IMASK 0x19
31 #define MII_VSC8244_IMASK_IEN 0x8000
32 #define MII_VSC8244_IMASK_SPEED 0x4000
33 #define MII_VSC8244_IMASK_LINK 0x2000
34 #define MII_VSC8244_IMASK_DUPLEX 0x1000
35 #define MII_VSC8244_IMASK_MASK 0xf000
37 #define MII_VSC8221_IMASK_MASK 0xa000
40 #define MII_VSC8244_ISTAT 0x1a
41 #define MII_VSC8244_ISTAT_STATUS 0x8000
42 #define MII_VSC8244_ISTAT_SPEED 0x4000
43 #define MII_VSC8244_ISTAT_LINK 0x2000
44 #define MII_VSC8244_ISTAT_DUPLEX 0x1000
47 #define MII_VSC8244_AUX_CONSTAT 0x1c
48 #define MII_VSC8244_AUXCONSTAT_INIT 0x0000
49 #define MII_VSC8244_AUXCONSTAT_DUPLEX 0x0020
50 #define MII_VSC8244_AUXCONSTAT_SPEED 0x0018
51 #define MII_VSC8244_AUXCONSTAT_GBIT 0x0010
52 #define MII_VSC8244_AUXCONSTAT_100 0x0008
54 #define MII_VSC8221_AUXCONSTAT_INIT 0x0004
55 #define MII_VSC8221_AUXCONSTAT_RESERVED 0x0004
57 #define PHY_ID_VSC8244 0x000fc6c0
58 #define PHY_ID_VSC8221 0x000fc550
86 static int vsc824x_config_init(
struct phy_device *phydev)
101 static int vsc824x_ack_interrupt(
struct phy_device *phydev)
113 return (err < 0) ? err : 0;
116 static int vsc82xx_config_intr(
struct phy_device *phydev)
141 static int vsc8221_config_init(
struct phy_device *phydev)
157 .name =
"Vitesse VSC8244",
158 .phy_id_mask = 0x000fffc0,
161 .config_init = &vsc824x_config_init,
164 .ack_interrupt = &vsc824x_ack_interrupt,
165 .config_intr = &vsc82xx_config_intr,
170 .phy_id_mask = 0x000ffff0,
171 .name =
"Vitesse VSC8221",
174 .config_init = &vsc8221_config_init,
177 .ack_interrupt = &vsc824x_ack_interrupt,
178 .config_intr = &vsc82xx_config_intr,
182 static int __init vsc82xx_init(
void)
188 static void __exit vsc82xx_exit(
void)