Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213803
b: refs/heads/master
c: 559764d
h: refs/heads/master
i:
  213801: c83bcd9
  213799: e7b9cf1
v: v3
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Aug 17, 2010
1 parent 039654f commit ec0da4e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 264fd77a67f1a4fe102477d824014459c7ff61f3
refs/heads/master: 559764d1996e6ae769feb07918687b0806f2d975
33 changes: 20 additions & 13 deletions trunk/drivers/net/cpmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/clk.h>
#include <asm/gpio.h>
#include <linux/gpio.h>
#include <asm/atomic.h>

MODULE_AUTHOR("Eugene Konev <ejka@imfi.kspu.ru>");
Expand Down Expand Up @@ -108,7 +108,7 @@ MODULE_PARM_DESC(dumb_switch, "Assume switch is not connected to MDIO bus");
#define CPMAC_RX_INT_CLEAR 0x019c
#define CPMAC_MAC_INT_ENABLE 0x01a8
#define CPMAC_MAC_INT_CLEAR 0x01ac
#define CPMAC_MAC_ADDR_LO(channel) (0x01b0 + (channel) * 4)
#define CPMAC_MAC_ADDR_LO(channel) (0x01b0 + (channel) * 4)
#define CPMAC_MAC_ADDR_MID 0x01d0
#define CPMAC_MAC_ADDR_HI 0x01d4
#define CPMAC_MAC_HASH_LO 0x01d8
Expand Down Expand Up @@ -227,7 +227,7 @@ static void cpmac_dump_regs(struct net_device *dev)
for (i = 0; i < CPMAC_REG_END; i += 4) {
if (i % 16 == 0) {
if (i)
printk("\n");
pr_cont("\n");
printk(KERN_DEBUG "%s: reg[%p]:", dev->name,
priv->regs + i);
}
Expand Down Expand Up @@ -262,7 +262,7 @@ static void cpmac_dump_skb(struct net_device *dev, struct sk_buff *skb)
for (i = 0; i < skb->len; i++) {
if (i % 16 == 0) {
if (i)
printk("\n");
pr_cont("\n");
printk(KERN_DEBUG "%s: data[%p]:", dev->name,
skb->data + i);
}
Expand Down Expand Up @@ -873,7 +873,8 @@ static int cpmac_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
return -EINVAL;
}

static void cpmac_get_ringparam(struct net_device *dev, struct ethtool_ringparam* ring)
static void cpmac_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ring)
{
struct cpmac_priv *priv = netdev_priv(dev);

Expand All @@ -888,7 +889,8 @@ static void cpmac_get_ringparam(struct net_device *dev, struct ethtool_ringparam
ring->tx_pending = 1;
}

static int cpmac_set_ringparam(struct net_device *dev, struct ethtool_ringparam* ring)
static int cpmac_set_ringparam(struct net_device *dev,
struct ethtool_ringparam *ring)
{
struct cpmac_priv *priv = netdev_priv(dev);

Expand Down Expand Up @@ -1012,8 +1014,8 @@ static int cpmac_open(struct net_device *dev)

priv->rx_head->prev->hw_next = (u32)0;

if ((res = request_irq(dev->irq, cpmac_irq, IRQF_SHARED,
dev->name, dev))) {
res = request_irq(dev->irq, cpmac_irq, IRQF_SHARED, dev->name, dev);
if (res) {
if (netif_msg_drv(priv))
printk(KERN_ERR "%s: failed to obtain irq\n",
dev->name);
Expand Down Expand Up @@ -1133,7 +1135,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
}

if (phy_id == PHY_MAX_ADDR) {
dev_err(&pdev->dev, "no PHY present, falling back to switch on MDIO bus 0\n");
dev_err(&pdev->dev, "no PHY present, falling back "
"to switch on MDIO bus 0\n");
strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
phy_id = pdev->id;
}
Expand Down Expand Up @@ -1169,7 +1172,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
priv->msg_enable = netif_msg_init(debug_level, 0xff);
memcpy(dev->dev_addr, pdata->dev_addr, sizeof(pdata->dev_addr));

snprintf(priv->phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
snprintf(priv->phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT,
mdio_bus_id, phy_id);

priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0,
PHY_INTERFACE_MODE_MII);
Expand All @@ -1182,7 +1186,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
goto fail;
}

if ((rc = register_netdev(dev))) {
rc = register_netdev(dev);
if (rc) {
printk(KERN_ERR "cpmac: error %i registering device %s\n", rc,
dev->name);
goto fail;
Expand Down Expand Up @@ -1248,11 +1253,13 @@ int __devinit cpmac_init(void)

cpmac_mii->reset(cpmac_mii);

for (i = 0; i < 300; i++)
if ((mask = cpmac_read(cpmac_mii->priv, CPMAC_MDIO_ALIVE)))
for (i = 0; i < 300; i++) {
mask = cpmac_read(cpmac_mii->priv, CPMAC_MDIO_ALIVE);
if (mask)
break;
else
msleep(10);
}

mask &= 0x7fffffff;
if (mask & (mask - 1)) {
Expand Down

0 comments on commit ec0da4e

Please sign in to comment.