aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-01-28 15:59:23 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-01 02:26:55 -0500
commitfa0b9a4c41490d550ebd3bd418f4551c989fec5d (patch)
tree8b3cc8933ae63ecf08a0cb3022152a4028b6da34 /drivers/net/tulip
parentabe02af8263ae17e201994a1be7fc5eac6642acf (diff)
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: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r--drivers/net/tulip/media.c74
1 files changed, 36 insertions, 38 deletions
diff --git a/drivers/net/tulip/media.c b/drivers/net/tulip/media.c
index d8fda83705bf..68b170ae4d15 100644
--- a/drivers/net/tulip/media.c
+++ b/drivers/net/tulip/media.c
@@ -182,9 +182,8 @@ void tulip_select_media(struct net_device *dev, int startup)
182 switch (mleaf->type) { 182 switch (mleaf->type) {
183 case 0: /* 21140 non-MII xcvr. */ 183 case 0: /* 21140 non-MII xcvr. */
184 if (tulip_debug > 1) 184 if (tulip_debug > 1)
185 printk(KERN_DEBUG "%s: Using a 21140 non-MII transceiver" 185 printk(KERN_DEBUG "%s: Using a 21140 non-MII transceiver with control setting %02x\n",
186 " with control setting %2.2x.\n", 186 dev->name, p[1]);
187 dev->name, p[1]);
188 dev->if_port = p[0]; 187 dev->if_port = p[0];
189 if (startup) 188 if (startup)
190 iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12); 189 iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12);
@@ -205,15 +204,15 @@ void tulip_select_media(struct net_device *dev, int startup)
205 struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset]; 204 struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset];
206 unsigned char *rst = rleaf->leafdata; 205 unsigned char *rst = rleaf->leafdata;
207 if (tulip_debug > 1) 206 if (tulip_debug > 1)
208 printk(KERN_DEBUG "%s: Resetting the transceiver.\n", 207 printk(KERN_DEBUG "%s: Resetting the transceiver\n",
209 dev->name); 208 dev->name);
210 for (i = 0; i < rst[0]; i++) 209 for (i = 0; i < rst[0]; i++)
211 iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15); 210 iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15);
212 } 211 }
213 if (tulip_debug > 1) 212 if (tulip_debug > 1)
214 printk(KERN_DEBUG "%s: 21143 non-MII %s transceiver control " 213 printk(KERN_DEBUG "%s: 21143 non-MII %s transceiver control %04x/%04x\n",
215 "%4.4x/%4.4x.\n", 214 dev->name, medianame[dev->if_port],
216 dev->name, medianame[dev->if_port], setup[0], setup[1]); 215 setup[0], setup[1]);
217 if (p[0] & 0x40) { /* SIA (CSR13-15) setup values are provided. */ 216 if (p[0] & 0x40) { /* SIA (CSR13-15) setup values are provided. */
218 csr13val = setup[0]; 217 csr13val = setup[0];
219 csr14val = setup[1]; 218 csr14val = setup[1];
@@ -240,8 +239,8 @@ void tulip_select_media(struct net_device *dev, int startup)
240 if (startup) iowrite32(csr13val, ioaddr + CSR13); 239 if (startup) iowrite32(csr13val, ioaddr + CSR13);
241 } 240 }
242 if (tulip_debug > 1) 241 if (tulip_debug > 1)
243 printk(KERN_DEBUG "%s: Setting CSR15 to %8.8x/%8.8x.\n", 242 printk(KERN_DEBUG "%s: Setting CSR15 to %08x/%08x\n",
244 dev->name, csr15dir, csr15val); 243 dev->name, csr15dir, csr15val);
245 if (mleaf->type == 4) 244 if (mleaf->type == 4)
246 new_csr6 = 0x82020000 | ((setup[2] & 0x71) << 18); 245 new_csr6 = 0x82020000 | ((setup[2] & 0x71) << 18);
247 else 246 else
@@ -317,8 +316,9 @@ void tulip_select_media(struct net_device *dev, int startup)
317 if (tp->mii_advertise == 0) 316 if (tp->mii_advertise == 0)
318 tp->mii_advertise = tp->advertising[phy_num]; 317 tp->mii_advertise = tp->advertising[phy_num];
319 if (tulip_debug > 1) 318 if (tulip_debug > 1)
320 printk(KERN_DEBUG "%s: Advertising %4.4x on MII %d.\n", 319 printk(KERN_DEBUG "%s: Advertising %04x on MII %d\n",
321 dev->name, tp->mii_advertise, tp->phys[phy_num]); 320 dev->name, tp->mii_advertise,
321 tp->phys[phy_num]);
322 tulip_mdio_write(dev, tp->phys[phy_num], 4, tp->mii_advertise); 322 tulip_mdio_write(dev, tp->phys[phy_num], 4, tp->mii_advertise);
323 } 323 }
324 break; 324 break;
@@ -335,8 +335,8 @@ void tulip_select_media(struct net_device *dev, int startup)
335 struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset]; 335 struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset];
336 unsigned char *rst = rleaf->leafdata; 336 unsigned char *rst = rleaf->leafdata;
337 if (tulip_debug > 1) 337 if (tulip_debug > 1)
338 printk(KERN_DEBUG "%s: Resetting the transceiver.\n", 338 printk(KERN_DEBUG "%s: Resetting the transceiver\n",
339 dev->name); 339 dev->name);
340 for (i = 0; i < rst[0]; i++) 340 for (i = 0; i < rst[0]; i++)
341 iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15); 341 iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15);
342 } 342 }
@@ -344,20 +344,20 @@ void tulip_select_media(struct net_device *dev, int startup)
344 break; 344 break;
345 } 345 }
346 default: 346 default:
347 printk(KERN_DEBUG "%s: Invalid media table selection %d.\n", 347 printk(KERN_DEBUG "%s: Invalid media table selection %d\n",
348 dev->name, mleaf->type); 348 dev->name, mleaf->type);
349 new_csr6 = 0x020E0000; 349 new_csr6 = 0x020E0000;
350 } 350 }
351 if (tulip_debug > 1) 351 if (tulip_debug > 1)
352 printk(KERN_DEBUG "%s: Using media type %s, CSR12 is %2.2x.\n", 352 printk(KERN_DEBUG "%s: Using media type %s, CSR12 is %02x\n",
353 dev->name, medianame[dev->if_port], 353 dev->name, medianame[dev->if_port],
354 ioread32(ioaddr + CSR12) & 0xff); 354 ioread32(ioaddr + CSR12) & 0xff);
355 } else if (tp->chip_id == LC82C168) { 355 } else if (tp->chip_id == LC82C168) {
356 if (startup && ! tp->medialock) 356 if (startup && ! tp->medialock)
357 dev->if_port = tp->mii_cnt ? 11 : 0; 357 dev->if_port = tp->mii_cnt ? 11 : 0;
358 if (tulip_debug > 1) 358 if (tulip_debug > 1)
359 printk(KERN_DEBUG "%s: PNIC PHY status is %3.3x, media %s.\n", 359 printk(KERN_DEBUG "%s: PNIC PHY status is %3.3x, media %s\n",
360 dev->name, ioread32(ioaddr + 0xB8), medianame[dev->if_port]); 360 dev->name, ioread32(ioaddr + 0xB8), medianame[dev->if_port]);
361 if (tp->mii_cnt) { 361 if (tp->mii_cnt) {
362 new_csr6 = 0x810C0000; 362 new_csr6 = 0x810C0000;
363 iowrite32(0x0001, ioaddr + CSR15); 363 iowrite32(0x0001, ioaddr + CSR15);
@@ -388,10 +388,9 @@ void tulip_select_media(struct net_device *dev, int startup)
388 } else 388 } else
389 new_csr6 = 0x03860000; 389 new_csr6 = 0x03860000;
390 if (tulip_debug > 1) 390 if (tulip_debug > 1)
391 printk(KERN_DEBUG "%s: No media description table, assuming " 391 printk(KERN_DEBUG "%s: No media description table, assuming %s transceiver, CSR12 %02x\n",
392 "%s transceiver, CSR12 %2.2x.\n", 392 dev->name, medianame[dev->if_port],
393 dev->name, medianame[dev->if_port], 393 ioread32(ioaddr + CSR12));
394 ioread32(ioaddr + CSR12));
395 } 394 }
396 395
397 tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0); 396 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 bmsr = tulip_mdio_read(dev, tp->phys[0], MII_BMSR); 414 bmsr = tulip_mdio_read(dev, tp->phys[0], MII_BMSR);
416 lpa = tulip_mdio_read(dev, tp->phys[0], MII_LPA); 415 lpa = tulip_mdio_read(dev, tp->phys[0], MII_LPA);
417 if (tulip_debug > 1) 416 if (tulip_debug > 1)
418 printk(KERN_INFO "%s: MII status %4.4x, Link partner report " 417 dev_info(&dev->dev, "MII status %04x, Link partner report %04x\n",
419 "%4.4x.\n", dev->name, bmsr, lpa); 418 bmsr, lpa);
420 if (bmsr == 0xffff) 419 if (bmsr == 0xffff)
421 return -2; 420 return -2;
422 if ((bmsr & BMSR_LSTATUS) == 0) { 421 if ((bmsr & BMSR_LSTATUS) == 0) {
423 int new_bmsr = tulip_mdio_read(dev, tp->phys[0], MII_BMSR); 422 int new_bmsr = tulip_mdio_read(dev, tp->phys[0], MII_BMSR);
424 if ((new_bmsr & BMSR_LSTATUS) == 0) { 423 if ((new_bmsr & BMSR_LSTATUS) == 0) {
425 if (tulip_debug > 1) 424 if (tulip_debug > 1)
426 printk(KERN_INFO "%s: No link beat on the MII interface," 425 dev_info(&dev->dev,
427 " status %4.4x.\n", dev->name, new_bmsr); 426 "No link beat on the MII interface, status %04x\n",
427 new_bmsr);
428 return -1; 428 return -1;
429 } 429 }
430 } 430 }
@@ -443,10 +443,10 @@ int tulip_check_duplex(struct net_device *dev)
443 tulip_restart_rxtx(tp); 443 tulip_restart_rxtx(tp);
444 444
445 if (tulip_debug > 0) 445 if (tulip_debug > 0)
446 printk(KERN_INFO "%s: Setting %s-duplex based on MII" 446 dev_info(&dev->dev,
447 "#%d link partner capability of %4.4x.\n", 447 "Setting %s-duplex based on MII#%d link partner capability of %04x\n",
448 dev->name, tp->full_duplex ? "full" : "half", 448 tp->full_duplex ? "full" : "half",
449 tp->phys[0], lpa); 449 tp->phys[0], lpa);
450 return 1; 450 return 1;
451 } 451 }
452 452
@@ -501,15 +501,13 @@ void __devinit tulip_find_mii (struct net_device *dev, int board_idx)
501 501
502 tp->phys[phy_idx++] = phy; 502 tp->phys[phy_idx++] = phy;
503 503
504 printk (KERN_INFO "tulip%d: MII transceiver #%d " 504 pr_info("tulip%d: MII transceiver #%d config %04x status %04x advertising %04x\n",
505 "config %4.4x status %4.4x advertising %4.4x.\n",
506 board_idx, phy, mii_reg0, mii_status, mii_advert); 505 board_idx, phy, mii_reg0, mii_status, mii_advert);
507 506
508 /* Fixup for DLink with miswired PHY. */ 507 /* Fixup for DLink with miswired PHY. */
509 if (mii_advert != to_advert) { 508 if (mii_advert != to_advert) {
510 printk (KERN_DEBUG "tulip%d: Advertising %4.4x on PHY %d," 509 printk(KERN_DEBUG "tulip%d: Advertising %04x on PHY %d, previously advertising %04x\n",
511 " previously advertising %4.4x.\n", 510 board_idx, to_advert, phy, mii_advert);
512 board_idx, to_advert, phy, mii_advert);
513 tulip_mdio_write (dev, phy, 4, to_advert); 511 tulip_mdio_write (dev, phy, 4, to_advert);
514 } 512 }
515 513
@@ -554,7 +552,7 @@ void __devinit tulip_find_mii (struct net_device *dev, int board_idx)
554 } 552 }
555 tp->mii_cnt = phy_idx; 553 tp->mii_cnt = phy_idx;
556 if (tp->mtable && tp->mtable->has_mii && phy_idx == 0) { 554 if (tp->mtable && tp->mtable->has_mii && phy_idx == 0) {
557 printk (KERN_INFO "tulip%d: ***WARNING***: No MII transceiver found!\n", 555 pr_info("tulip%d: ***WARNING***: No MII transceiver found!\n",
558 board_idx); 556 board_idx);
559 tp->phys[0] = 1; 557 tp->phys[0] = 1;
560 } 558 }