提交 fa0b9a4c 编写于 作者: J Joe Perches 提交者: David S. Miller

tulip/media.c: Use dev_<level> and pr_<level>

Convert printks to dev_<level> where a dev is available
Convert printks to pr_<level> where not
Coalesce format strings
Change print formats with %d.dx to %0dx
Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 abe02af8
...@@ -182,9 +182,8 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -182,9 +182,8 @@ void tulip_select_media(struct net_device *dev, int startup)
switch (mleaf->type) { switch (mleaf->type) {
case 0: /* 21140 non-MII xcvr. */ case 0: /* 21140 non-MII xcvr. */
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Using a 21140 non-MII transceiver" printk(KERN_DEBUG "%s: Using a 21140 non-MII transceiver with control setting %02x\n",
" with control setting %2.2x.\n", dev->name, p[1]);
dev->name, p[1]);
dev->if_port = p[0]; dev->if_port = p[0];
if (startup) if (startup)
iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12); iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12);
...@@ -205,15 +204,15 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -205,15 +204,15 @@ void tulip_select_media(struct net_device *dev, int startup)
struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset]; struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset];
unsigned char *rst = rleaf->leafdata; unsigned char *rst = rleaf->leafdata;
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Resetting the transceiver.\n", printk(KERN_DEBUG "%s: Resetting the transceiver\n",
dev->name); dev->name);
for (i = 0; i < rst[0]; i++) for (i = 0; i < rst[0]; i++)
iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15); iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15);
} }
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: 21143 non-MII %s transceiver control " printk(KERN_DEBUG "%s: 21143 non-MII %s transceiver control %04x/%04x\n",
"%4.4x/%4.4x.\n", dev->name, medianame[dev->if_port],
dev->name, medianame[dev->if_port], setup[0], setup[1]); setup[0], setup[1]);
if (p[0] & 0x40) { /* SIA (CSR13-15) setup values are provided. */ if (p[0] & 0x40) { /* SIA (CSR13-15) setup values are provided. */
csr13val = setup[0]; csr13val = setup[0];
csr14val = setup[1]; csr14val = setup[1];
...@@ -240,8 +239,8 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -240,8 +239,8 @@ void tulip_select_media(struct net_device *dev, int startup)
if (startup) iowrite32(csr13val, ioaddr + CSR13); if (startup) iowrite32(csr13val, ioaddr + CSR13);
} }
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Setting CSR15 to %8.8x/%8.8x.\n", printk(KERN_DEBUG "%s: Setting CSR15 to %08x/%08x\n",
dev->name, csr15dir, csr15val); dev->name, csr15dir, csr15val);
if (mleaf->type == 4) if (mleaf->type == 4)
new_csr6 = 0x82020000 | ((setup[2] & 0x71) << 18); new_csr6 = 0x82020000 | ((setup[2] & 0x71) << 18);
else else
...@@ -317,8 +316,9 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -317,8 +316,9 @@ void tulip_select_media(struct net_device *dev, int startup)
if (tp->mii_advertise == 0) if (tp->mii_advertise == 0)
tp->mii_advertise = tp->advertising[phy_num]; tp->mii_advertise = tp->advertising[phy_num];
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Advertising %4.4x on MII %d.\n", printk(KERN_DEBUG "%s: Advertising %04x on MII %d\n",
dev->name, tp->mii_advertise, tp->phys[phy_num]); dev->name, tp->mii_advertise,
tp->phys[phy_num]);
tulip_mdio_write(dev, tp->phys[phy_num], 4, tp->mii_advertise); tulip_mdio_write(dev, tp->phys[phy_num], 4, tp->mii_advertise);
} }
break; break;
...@@ -335,8 +335,8 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -335,8 +335,8 @@ void tulip_select_media(struct net_device *dev, int startup)
struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset]; struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset];
unsigned char *rst = rleaf->leafdata; unsigned char *rst = rleaf->leafdata;
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Resetting the transceiver.\n", printk(KERN_DEBUG "%s: Resetting the transceiver\n",
dev->name); dev->name);
for (i = 0; i < rst[0]; i++) for (i = 0; i < rst[0]; i++)
iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15); iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15);
} }
...@@ -344,20 +344,20 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -344,20 +344,20 @@ void tulip_select_media(struct net_device *dev, int startup)
break; break;
} }
default: default:
printk(KERN_DEBUG "%s: Invalid media table selection %d.\n", printk(KERN_DEBUG "%s: Invalid media table selection %d\n",
dev->name, mleaf->type); dev->name, mleaf->type);
new_csr6 = 0x020E0000; new_csr6 = 0x020E0000;
} }
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Using media type %s, CSR12 is %2.2x.\n", printk(KERN_DEBUG "%s: Using media type %s, CSR12 is %02x\n",
dev->name, medianame[dev->if_port], dev->name, medianame[dev->if_port],
ioread32(ioaddr + CSR12) & 0xff); ioread32(ioaddr + CSR12) & 0xff);
} else if (tp->chip_id == LC82C168) { } else if (tp->chip_id == LC82C168) {
if (startup && ! tp->medialock) if (startup && ! tp->medialock)
dev->if_port = tp->mii_cnt ? 11 : 0; dev->if_port = tp->mii_cnt ? 11 : 0;
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: PNIC PHY status is %3.3x, media %s.\n", printk(KERN_DEBUG "%s: PNIC PHY status is %3.3x, media %s\n",
dev->name, ioread32(ioaddr + 0xB8), medianame[dev->if_port]); dev->name, ioread32(ioaddr + 0xB8), medianame[dev->if_port]);
if (tp->mii_cnt) { if (tp->mii_cnt) {
new_csr6 = 0x810C0000; new_csr6 = 0x810C0000;
iowrite32(0x0001, ioaddr + CSR15); iowrite32(0x0001, ioaddr + CSR15);
...@@ -388,10 +388,9 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -388,10 +388,9 @@ void tulip_select_media(struct net_device *dev, int startup)
} else } else
new_csr6 = 0x03860000; new_csr6 = 0x03860000;
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: No media description table, assuming " printk(KERN_DEBUG "%s: No media description table, assuming %s transceiver, CSR12 %02x\n",
"%s transceiver, CSR12 %2.2x.\n", dev->name, medianame[dev->if_port],
dev->name, medianame[dev->if_port], ioread32(ioaddr + CSR12));
ioread32(ioaddr + CSR12));
} }
tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0); tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0);
...@@ -415,16 +414,17 @@ int tulip_check_duplex(struct net_device *dev) ...@@ -415,16 +414,17 @@ int tulip_check_duplex(struct net_device *dev)
bmsr = tulip_mdio_read(dev, tp->phys[0], MII_BMSR); bmsr = tulip_mdio_read(dev, tp->phys[0], MII_BMSR);
lpa = tulip_mdio_read(dev, tp->phys[0], MII_LPA); lpa = tulip_mdio_read(dev, tp->phys[0], MII_LPA);
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_INFO "%s: MII status %4.4x, Link partner report " dev_info(&dev->dev, "MII status %04x, Link partner report %04x\n",
"%4.4x.\n", dev->name, bmsr, lpa); bmsr, lpa);
if (bmsr == 0xffff) if (bmsr == 0xffff)
return -2; return -2;
if ((bmsr & BMSR_LSTATUS) == 0) { if ((bmsr & BMSR_LSTATUS) == 0) {
int new_bmsr = tulip_mdio_read(dev, tp->phys[0], MII_BMSR); int new_bmsr = tulip_mdio_read(dev, tp->phys[0], MII_BMSR);
if ((new_bmsr & BMSR_LSTATUS) == 0) { if ((new_bmsr & BMSR_LSTATUS) == 0) {
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_INFO "%s: No link beat on the MII interface," dev_info(&dev->dev,
" status %4.4x.\n", dev->name, new_bmsr); "No link beat on the MII interface, status %04x\n",
new_bmsr);
return -1; return -1;
} }
} }
...@@ -443,10 +443,10 @@ int tulip_check_duplex(struct net_device *dev) ...@@ -443,10 +443,10 @@ int tulip_check_duplex(struct net_device *dev)
tulip_restart_rxtx(tp); tulip_restart_rxtx(tp);
if (tulip_debug > 0) if (tulip_debug > 0)
printk(KERN_INFO "%s: Setting %s-duplex based on MII" dev_info(&dev->dev,
"#%d link partner capability of %4.4x.\n", "Setting %s-duplex based on MII#%d link partner capability of %04x\n",
dev->name, tp->full_duplex ? "full" : "half", tp->full_duplex ? "full" : "half",
tp->phys[0], lpa); tp->phys[0], lpa);
return 1; return 1;
} }
...@@ -501,15 +501,13 @@ void __devinit tulip_find_mii (struct net_device *dev, int board_idx) ...@@ -501,15 +501,13 @@ void __devinit tulip_find_mii (struct net_device *dev, int board_idx)
tp->phys[phy_idx++] = phy; tp->phys[phy_idx++] = phy;
printk (KERN_INFO "tulip%d: MII transceiver #%d " pr_info("tulip%d: MII transceiver #%d config %04x status %04x advertising %04x\n",
"config %4.4x status %4.4x advertising %4.4x.\n",
board_idx, phy, mii_reg0, mii_status, mii_advert); board_idx, phy, mii_reg0, mii_status, mii_advert);
/* Fixup for DLink with miswired PHY. */ /* Fixup for DLink with miswired PHY. */
if (mii_advert != to_advert) { if (mii_advert != to_advert) {
printk (KERN_DEBUG "tulip%d: Advertising %4.4x on PHY %d," printk(KERN_DEBUG "tulip%d: Advertising %04x on PHY %d, previously advertising %04x\n",
" previously advertising %4.4x.\n", board_idx, to_advert, phy, mii_advert);
board_idx, to_advert, phy, mii_advert);
tulip_mdio_write (dev, phy, 4, to_advert); tulip_mdio_write (dev, phy, 4, to_advert);
} }
...@@ -554,7 +552,7 @@ void __devinit tulip_find_mii (struct net_device *dev, int board_idx) ...@@ -554,7 +552,7 @@ void __devinit tulip_find_mii (struct net_device *dev, int board_idx)
} }
tp->mii_cnt = phy_idx; tp->mii_cnt = phy_idx;
if (tp->mtable && tp->mtable->has_mii && phy_idx == 0) { if (tp->mtable && tp->mtable->has_mii && phy_idx == 0) {
printk (KERN_INFO "tulip%d: ***WARNING***: No MII transceiver found!\n", pr_info("tulip%d: ***WARNING***: No MII transceiver found!\n",
board_idx); board_idx);
tp->phys[0] = 1; tp->phys[0] = 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册