aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-05 10:55:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-05 10:55:07 -0400
commit7437e7d3672b6d23c08212c68752c9a9c25f8e9e (patch)
tree809507a1d8c1cadce9a7cab87970da95aa772d2d /drivers/net/phy
parent38c9e91bc396672e9ea8013bad63ea4f59d9d31c (diff)
parent7cff0943a1104479fc9fc2d6ced24c02ba81e73e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: FEC: Fix kernel panic in fec_set_mac_address. ipv6: Fix default multicast hops setting. net: ep93xx_eth stops receiving packets drivers/net/phy: micrel phy driver dm9601: fix phy/eeprom write routine ppp_generic: handle non-linear skbs when passing them to pppd ppp_generic: pull 2 bytes so that PPP_PROTO(skb) is valid net: fix compile error due to double return type in SOCK_DEBUG net/usb: initiate sync sequence in sierra_net.c driver net/usb: remove default in Kconfig for sierra_net driver r8169: Fix rtl8169_rx_interrupt() e1000e: Fix oops caused by ASPM patch. net/sb1250: register mdio bus in probe sctp: Fix skb_over_panic resulting from multiple invalid parameter errors (CVE-2010-1173) (v4) p54pci: fix bugs in p54p_check_tx_ring
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/Kconfig5
-rw-r--r--drivers/net/phy/Makefile1
-rw-r--r--drivers/net/phy/micrel.c104
3 files changed, 110 insertions, 0 deletions
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index fc5938ba3d78..a527e37728cd 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -88,6 +88,11 @@ config LSI_ET1011C_PHY
88 ---help--- 88 ---help---
89 Supports the LSI ET1011C PHY. 89 Supports the LSI ET1011C PHY.
90 90
91config MICREL_PHY
92 tristate "Driver for Micrel PHYs"
93 ---help---
94 Supports the KSZ9021, VSC8201, KS8001 PHYs.
95
91config FIXED_PHY 96config FIXED_PHY
92 bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" 97 bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs"
93 depends on PHYLIB=y 98 depends on PHYLIB=y
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index 1342585af381..13bebab65d02 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -20,4 +20,5 @@ obj-$(CONFIG_MDIO_BITBANG) += mdio-bitbang.o
20obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o 20obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o
21obj-$(CONFIG_NATIONAL_PHY) += national.o 21obj-$(CONFIG_NATIONAL_PHY) += national.o
22obj-$(CONFIG_STE10XP) += ste10Xp.o 22obj-$(CONFIG_STE10XP) += ste10Xp.o
23obj-$(CONFIG_MICREL_PHY) += micrel.o
23obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o 24obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
new file mode 100644
index 000000000000..0cd80e4d71d9
--- /dev/null
+++ b/drivers/net/phy/micrel.c
@@ -0,0 +1,104 @@
1/*
2 * drivers/net/phy/micrel.c
3 *
4 * Driver for Micrel PHYs
5 *
6 * Author: David J. Choi
7 *
8 * Copyright (c) 2010 Micrel, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 * Support : ksz9021 , vsc8201, ks8001
16 */
17
18#include <linux/kernel.h>
19#include <linux/module.h>
20#include <linux/phy.h>
21
22#define PHY_ID_KSZ9021 0x00221611
23#define PHY_ID_VSC8201 0x000FC413
24#define PHY_ID_KS8001 0x0022161A
25
26
27static int kszphy_config_init(struct phy_device *phydev)
28{
29 return 0;
30}
31
32
33static struct phy_driver ks8001_driver = {
34 .phy_id = PHY_ID_KS8001,
35 .phy_id_mask = 0x00fffff0,
36 .features = PHY_BASIC_FEATURES,
37 .flags = PHY_POLL,
38 .config_init = kszphy_config_init,
39 .config_aneg = genphy_config_aneg,
40 .read_status = genphy_read_status,
41 .driver = { .owner = THIS_MODULE,},
42};
43
44static struct phy_driver vsc8201_driver = {
45 .phy_id = PHY_ID_VSC8201,
46 .name = "Micrel VSC8201",
47 .phy_id_mask = 0x00fffff0,
48 .features = PHY_BASIC_FEATURES,
49 .flags = PHY_POLL,
50 .config_init = kszphy_config_init,
51 .config_aneg = genphy_config_aneg,
52 .read_status = genphy_read_status,
53 .driver = { .owner = THIS_MODULE,},
54};
55
56static struct phy_driver ksz9021_driver = {
57 .phy_id = PHY_ID_KSZ9021,
58 .phy_id_mask = 0x000fff10,
59 .name = "Micrel KSZ9021 Gigabit PHY",
60 .features = PHY_GBIT_FEATURES | SUPPORTED_Pause,
61 .flags = PHY_POLL,
62 .config_init = kszphy_config_init,
63 .config_aneg = genphy_config_aneg,
64 .read_status = genphy_read_status,
65 .driver = { .owner = THIS_MODULE, },
66};
67
68static int __init ksphy_init(void)
69{
70 int ret;
71
72 ret = phy_driver_register(&ks8001_driver);
73 if (ret)
74 goto err1;
75 ret = phy_driver_register(&vsc8201_driver);
76 if (ret)
77 goto err2;
78
79 ret = phy_driver_register(&ksz9021_driver);
80 if (ret)
81 goto err3;
82 return 0;
83
84err3:
85 phy_driver_unregister(&vsc8201_driver);
86err2:
87 phy_driver_unregister(&ks8001_driver);
88err1:
89 return ret;
90}
91
92static void __exit ksphy_exit(void)
93{
94 phy_driver_unregister(&ks8001_driver);
95 phy_driver_unregister(&vsc8201_driver);
96 phy_driver_unregister(&ksz9021_driver);
97}
98
99module_init(ksphy_init);
100module_exit(ksphy_exit);
101
102MODULE_DESCRIPTION("Micrel PHY driver");
103MODULE_AUTHOR("David J. Choi");
104MODULE_LICENSE("GPL");