aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cpmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/cpmac.c')
-rw-r--r--drivers/net/cpmac.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
index b85c81f60d10..60777fd90b33 100644
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -28,6 +28,7 @@
28#include <linux/delay.h> 28#include <linux/delay.h>
29 29
30#include <linux/netdevice.h> 30#include <linux/netdevice.h>
31#include <linux/if_vlan.h>
31#include <linux/etherdevice.h> 32#include <linux/etherdevice.h>
32#include <linux/ethtool.h> 33#include <linux/ethtool.h>
33#include <linux/skbuff.h> 34#include <linux/skbuff.h>
@@ -55,9 +56,9 @@ module_param(dumb_switch, int, 0444);
55MODULE_PARM_DESC(debug_level, "Number of NETIF_MSG bits to enable"); 56MODULE_PARM_DESC(debug_level, "Number of NETIF_MSG bits to enable");
56MODULE_PARM_DESC(dumb_switch, "Assume switch is not connected to MDIO bus"); 57MODULE_PARM_DESC(dumb_switch, "Assume switch is not connected to MDIO bus");
57 58
58#define CPMAC_VERSION "0.5.1" 59#define CPMAC_VERSION "0.5.2"
59/* frame size + 802.1q tag */ 60/* frame size + 802.1q tag + FCS size */
60#define CPMAC_SKB_SIZE (ETH_FRAME_LEN + 4) 61#define CPMAC_SKB_SIZE (ETH_FRAME_LEN + ETH_FCS_LEN + VLAN_HLEN)
61#define CPMAC_QUEUES 8 62#define CPMAC_QUEUES 8
62 63
63/* Ethernet registers */ 64/* Ethernet registers */
@@ -1136,8 +1137,9 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
1136 } 1137 }
1137 1138
1138 if (phy_id == PHY_MAX_ADDR) { 1139 if (phy_id == PHY_MAX_ADDR) {
1139 dev_err(&pdev->dev, "no PHY present\n"); 1140 dev_err(&pdev->dev, "no PHY present, falling back to switch on MDIO bus 0\n");
1140 return -ENODEV; 1141 strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
1142 phy_id = pdev->id;
1141 } 1143 }
1142 1144
1143 dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES); 1145 dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES);
@@ -1290,8 +1292,8 @@ void __devexit cpmac_exit(void)
1290{ 1292{
1291 platform_driver_unregister(&cpmac_driver); 1293 platform_driver_unregister(&cpmac_driver);
1292 mdiobus_unregister(cpmac_mii); 1294 mdiobus_unregister(cpmac_mii);
1293 mdiobus_free(cpmac_mii);
1294 iounmap(cpmac_mii->priv); 1295 iounmap(cpmac_mii->priv);
1296 mdiobus_free(cpmac_mii);
1295} 1297}
1296 1298
1297module_init(cpmac_init); 1299module_init(cpmac_init);