Skip to content

Commit fd9abb3

Browse files
Steve GlendinningJeff Garzik
authored andcommitted
SMSC LAN911x and LAN921x vendor driver
Attached is a driver for SMSC's LAN911x and LAN921x families of embedded ethernet controllers. There is an existing smc911x driver in the tree; this is intended to replace it. Dustin McIntire (the author of the smc911x driver) has expressed his support for switching to this driver. This driver contains workarounds for all known hardware issues, and has been tested on all flavours of the chip on multiple architectures. This driver now uses phylib, so this patch also adds support for the device's internal phy Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com> Signed-off-by: Bahadir Balban <Bahadir.Balban@arm.com> Signed-off-by: Dustin Mcintire <dustin@sensoria.com> Signed-off-by: Bill Gatliff <bgat@billgatliff.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
1 parent c5916cf commit fd9abb3

7 files changed

Lines changed: 2576 additions & 0 deletions

File tree

‎MAINTAINERS‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3853,6 +3853,12 @@ M: mhoffman@lightlink.com
38533853
L: lm-sensors@lm-sensors.org
38543854
S: Maintained
38553855

3856+
SMSC911x ETHERNET DRIVER
3857+
P: Steve Glendinning
3858+
M: steve.glendinning@smsc.com
3859+
L: netdev@vger.kernel.org
3860+
S: Supported
3861+
38563862
SMX UIO Interface
38573863
P: Ben Nizette
38583864
M: bn@niasdigital.com

‎drivers/net/Kconfig‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,20 @@ config SMC911X
979979
called smc911x. If you want to compile it as a module, say M
980980
here and read <file:Documentation/kbuild/modules.txt>
981981

982+
config SMSC911X
983+
tristate "SMSC LAN911x/LAN921x families embedded ethernet support"
984+
depends on ARM || SUPERH
985+
select CRC32
986+
select MII
987+
select PHYLIB
988+
---help---
989+
Say Y here if you want support for SMSC LAN911x and LAN921x families
990+
of ethernet controllers.
991+
992+
To compile this driver as a module, choose M here and read
993+
<file:Documentation/networking/net-modules.txt>. The module
994+
will be called smsc911x.
995+
982996
config NET_VENDOR_RACAL
983997
bool "Racal-Interlan (Micom) NI cards"
984998
depends on ISA

‎drivers/net/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ obj-$(CONFIG_S2IO) += s2io.o
219219
obj-$(CONFIG_MYRI10GE) += myri10ge/
220220
obj-$(CONFIG_SMC91X) += smc91x.o
221221
obj-$(CONFIG_SMC911X) += smc911x.o
222+
obj-$(CONFIG_SMSC911X) += smsc911x.o
222223
obj-$(CONFIG_BFIN_MAC) += bfin_mac.o
223224
obj-$(CONFIG_DM9000) += dm9000.o
224225
obj-$(CONFIG_PASEMI_MAC) += pasemi_mac_driver.o

‎drivers/net/phy/smsc.c‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,27 @@ static struct phy_driver lan8700_driver = {
126126
.driver = { .owner = THIS_MODULE, }
127127
};
128128

129+
static struct phy_driver lan911x_int_driver = {
130+
.phy_id = 0x0007c0d0, /* OUI=0x00800f, Model#=0x0d */
131+
.phy_id_mask = 0xfffffff0,
132+
.name = "SMSC LAN911x Internal PHY",
133+
134+
.features = (PHY_BASIC_FEATURES | SUPPORTED_Pause
135+
| SUPPORTED_Asym_Pause),
136+
.flags = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG,
137+
138+
/* basic functions */
139+
.config_aneg = genphy_config_aneg,
140+
.read_status = genphy_read_status,
141+
.config_init = smsc_phy_config_init,
142+
143+
/* IRQ related */
144+
.ack_interrupt = smsc_phy_ack_interrupt,
145+
.config_intr = smsc_phy_config_intr,
146+
147+
.driver = { .owner = THIS_MODULE, }
148+
};
149+
129150
static int __init smsc_init(void)
130151
{
131152
int ret;
@@ -142,8 +163,14 @@ static int __init smsc_init(void)
142163
if (ret)
143164
goto err3;
144165

166+
ret = phy_driver_register (&lan911x_int_driver);
167+
if (ret)
168+
goto err4;
169+
145170
return 0;
146171

172+
err4:
173+
phy_driver_unregister (&lan8700_driver);
147174
err3:
148175
phy_driver_unregister (&lan8187_driver);
149176
err2:
@@ -154,6 +181,7 @@ static int __init smsc_init(void)
154181

155182
static void __exit smsc_exit(void)
156183
{
184+
phy_driver_unregister (&lan911x_int_driver);
157185
phy_driver_unregister (&lan8700_driver);
158186
phy_driver_unregister (&lan8187_driver);
159187
phy_driver_unregister (&lan83c185_driver);

0 commit comments

Comments
 (0)