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>
39 #define MII_LXT970_IER 17
41 #define MII_LXT970_IER_IEN 0x0002
43 #define MII_LXT970_ISR 18
45 #define MII_LXT970_CONFIG 19
51 #define MII_LXT971_IER 18
52 #define MII_LXT971_IER_IEN 0x00f2
54 #define MII_LXT971_ISR 19
57 #define MII_LXT973_PCR 16
58 #define PCR_FIBER_SELECT 1
64 static int lxt970_ack_interrupt(
struct phy_device *phydev)
81 static int lxt970_config_intr(
struct phy_device *phydev)
93 static int lxt970_config_init(
struct phy_device *phydev)
103 static int lxt971_ack_interrupt(
struct phy_device *phydev)
113 static int lxt971_config_intr(
struct phy_device *phydev)
130 static int lxt973a2_update_link(
struct phy_device *phydev)
149 }
while (status >= 0 && retry-- && status == control);
170 err = lxt973a2_update_link(phydev);
191 }
while (lpa == adv && retry--);
242 static int lxt973_probe(
struct phy_device *phydev)
256 phydev->
priv = lxt973_probe;
263 static int lxt973_config_aneg(
struct phy_device *phydev)
271 .phy_id = 0x78100000,
273 .phy_id_mask = 0xfffffff0,
276 .config_init = lxt970_config_init,
279 .ack_interrupt = lxt970_ack_interrupt,
280 .config_intr = lxt970_config_intr,
283 .phy_id = 0x001378e0,
285 .phy_id_mask = 0xfffffff0,
290 .ack_interrupt = lxt971_ack_interrupt,
291 .config_intr = lxt971_config_intr,
294 .phy_id = 0x00137a10,
296 .phy_id_mask = 0xffffffff,
299 .probe = lxt973_probe,
300 .config_aneg = lxt973_config_aneg,
304 .phy_id = 0x00137a10,
306 .phy_id_mask = 0xfffffff0,
309 .probe = lxt973_probe,
310 .config_aneg = lxt973_config_aneg,
315 static int __init lxt_init(
void)
321 static void __exit lxt_exit(
void)
331 { 0x78100000, 0xfffffff0 },
332 { 0x001378e0, 0xfffffff0 },
333 { 0x00137a10, 0xfffffff0 },