16 #include <linux/kernel.h>
17 #include <linux/string.h>
18 #include <linux/errno.h>
23 #include <linux/netdevice.h>
28 #include <linux/module.h>
29 #include <linux/mii.h>
30 #include <linux/ethtool.h>
35 #include <asm/uaccess.h>
37 #define MII_DM9161_SCR 0x10
38 #define MII_DM9161_SCR_INIT 0x0610
39 #define MII_DM9161_SCR_RMII 0x0100
42 #define MII_DM9161_INTR 0x15
43 #define MII_DM9161_INTR_PEND 0x8000
44 #define MII_DM9161_INTR_DPLX_MASK 0x0800
45 #define MII_DM9161_INTR_SPD_MASK 0x0400
46 #define MII_DM9161_INTR_LINK_MASK 0x0200
47 #define MII_DM9161_INTR_MASK 0x0100
48 #define MII_DM9161_INTR_DPLX_CHANGE 0x0010
49 #define MII_DM9161_INTR_SPD_CHANGE 0x0008
50 #define MII_DM9161_INTR_LINK_CHANGE 0x0004
51 #define MII_DM9161_INTR_INIT 0x0000
52 #define MII_DM9161_INTR_STOP \
53 (MII_DM9161_INTR_DPLX_MASK | MII_DM9161_INTR_SPD_MASK \
54 | MII_DM9161_INTR_LINK_MASK | MII_DM9161_INTR_MASK)
57 #define MII_DM9161_10BTCSR 0x12
58 #define MII_DM9161_10BTCSR_INIT 0x7800
65 #define DM9161_DELAY 1
66 static int dm9161_config_intr(
struct phy_device *phydev)
85 static int dm9161_config_aneg(
struct phy_device *phydev)
104 static int dm9161_config_init(
struct phy_device *phydev)
140 static int dm9161_ack_interrupt(
struct phy_device *phydev)
144 return (err < 0) ? err : 0;
149 .phy_id = 0x0181b880,
150 .name =
"Davicom DM9161E",
151 .phy_id_mask = 0x0ffffff0,
153 .config_init = dm9161_config_init,
154 .config_aneg = dm9161_config_aneg,
158 .phy_id = 0x0181b8a0,
159 .name =
"Davicom DM9161A",
160 .phy_id_mask = 0x0ffffff0,
162 .config_init = dm9161_config_init,
163 .config_aneg = dm9161_config_aneg,
167 .phy_id = 0x00181b80,
168 .name =
"Davicom DM9131",
169 .phy_id_mask = 0x0ffffff0,
174 .ack_interrupt = dm9161_ack_interrupt,
175 .config_intr = dm9161_config_intr,
179 static int __init davicom_init(
void)
185 static void __exit davicom_exit(
void)
195 { 0x0181b880, 0x0ffffff0 },
196 { 0x0181b8a0, 0x0ffffff0 },
197 { 0x00181b80, 0x0ffffff0 },