diff options
Diffstat (limited to 'drivers/net/tulip/media.c')
| -rw-r--r-- | drivers/net/tulip/media.c | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/drivers/net/tulip/media.c b/drivers/net/tulip/media.c index a0c770ee4b64..4bd13922875d 100644 --- a/drivers/net/tulip/media.c +++ b/drivers/net/tulip/media.c | |||
| @@ -182,8 +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 with control setting %02x\n", | 185 | netdev_dbg(dev, "Using a 21140 non-MII transceiver with control setting %02x\n", |
| 186 | dev->name, p[1]); | 186 | p[1]); |
| 187 | dev->if_port = p[0]; | 187 | dev->if_port = p[0]; |
| 188 | if (startup) | 188 | if (startup) |
| 189 | iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12); | 189 | iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12); |
| @@ -204,15 +204,14 @@ void tulip_select_media(struct net_device *dev, int startup) | |||
| 204 | struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset]; | 204 | struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset]; |
| 205 | unsigned char *rst = rleaf->leafdata; | 205 | unsigned char *rst = rleaf->leafdata; |
| 206 | if (tulip_debug > 1) | 206 | if (tulip_debug > 1) |
| 207 | printk(KERN_DEBUG "%s: Resetting the transceiver\n", | 207 | netdev_dbg(dev, "Resetting the transceiver\n"); |
| 208 | dev->name); | ||
| 209 | for (i = 0; i < rst[0]; i++) | 208 | for (i = 0; i < rst[0]; i++) |
| 210 | iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15); | 209 | iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15); |
| 211 | } | 210 | } |
| 212 | if (tulip_debug > 1) | 211 | if (tulip_debug > 1) |
| 213 | printk(KERN_DEBUG "%s: 21143 non-MII %s transceiver control %04x/%04x\n", | 212 | netdev_dbg(dev, "21143 non-MII %s transceiver control %04x/%04x\n", |
| 214 | dev->name, medianame[dev->if_port], | 213 | medianame[dev->if_port], |
| 215 | setup[0], setup[1]); | 214 | setup[0], setup[1]); |
| 216 | if (p[0] & 0x40) { /* SIA (CSR13-15) setup values are provided. */ | 215 | if (p[0] & 0x40) { /* SIA (CSR13-15) setup values are provided. */ |
| 217 | csr13val = setup[0]; | 216 | csr13val = setup[0]; |
| 218 | csr14val = setup[1]; | 217 | csr14val = setup[1]; |
| @@ -239,8 +238,8 @@ void tulip_select_media(struct net_device *dev, int startup) | |||
| 239 | if (startup) iowrite32(csr13val, ioaddr + CSR13); | 238 | if (startup) iowrite32(csr13val, ioaddr + CSR13); |
| 240 | } | 239 | } |
| 241 | if (tulip_debug > 1) | 240 | if (tulip_debug > 1) |
| 242 | printk(KERN_DEBUG "%s: Setting CSR15 to %08x/%08x\n", | 241 | netdev_dbg(dev, "Setting CSR15 to %08x/%08x\n", |
| 243 | dev->name, csr15dir, csr15val); | 242 | csr15dir, csr15val); |
| 244 | if (mleaf->type == 4) | 243 | if (mleaf->type == 4) |
| 245 | new_csr6 = 0x82020000 | ((setup[2] & 0x71) << 18); | 244 | new_csr6 = 0x82020000 | ((setup[2] & 0x71) << 18); |
| 246 | else | 245 | else |
| @@ -316,9 +315,9 @@ void tulip_select_media(struct net_device *dev, int startup) | |||
| 316 | if (tp->mii_advertise == 0) | 315 | if (tp->mii_advertise == 0) |
| 317 | tp->mii_advertise = tp->advertising[phy_num]; | 316 | tp->mii_advertise = tp->advertising[phy_num]; |
| 318 | if (tulip_debug > 1) | 317 | if (tulip_debug > 1) |
| 319 | printk(KERN_DEBUG "%s: Advertising %04x on MII %d\n", | 318 | netdev_dbg(dev, " Advertising %04x on MII %d\n", |
| 320 | dev->name, tp->mii_advertise, | 319 | tp->mii_advertise, |
| 321 | tp->phys[phy_num]); | 320 | tp->phys[phy_num]); |
| 322 | tulip_mdio_write(dev, tp->phys[phy_num], 4, tp->mii_advertise); | 321 | tulip_mdio_write(dev, tp->phys[phy_num], 4, tp->mii_advertise); |
| 323 | } | 322 | } |
| 324 | break; | 323 | break; |
| @@ -335,8 +334,7 @@ void tulip_select_media(struct net_device *dev, int startup) | |||
| 335 | struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset]; | 334 | struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset]; |
| 336 | unsigned char *rst = rleaf->leafdata; | 335 | unsigned char *rst = rleaf->leafdata; |
| 337 | if (tulip_debug > 1) | 336 | if (tulip_debug > 1) |
| 338 | printk(KERN_DEBUG "%s: Resetting the transceiver\n", | 337 | netdev_dbg(dev, "Resetting the transceiver\n"); |
| 339 | dev->name); | ||
| 340 | for (i = 0; i < rst[0]; i++) | 338 | for (i = 0; i < rst[0]; i++) |
| 341 | iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15); | 339 | iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15); |
| 342 | } | 340 | } |
| @@ -344,20 +342,21 @@ void tulip_select_media(struct net_device *dev, int startup) | |||
| 344 | break; | 342 | break; |
| 345 | } | 343 | } |
| 346 | default: | 344 | default: |
| 347 | printk(KERN_DEBUG "%s: Invalid media table selection %d\n", | 345 | netdev_dbg(dev, " Invalid media table selection %d\n", |
| 348 | dev->name, mleaf->type); | 346 | mleaf->type); |
| 349 | new_csr6 = 0x020E0000; | 347 | new_csr6 = 0x020E0000; |
| 350 | } | 348 | } |
| 351 | if (tulip_debug > 1) | 349 | if (tulip_debug > 1) |
| 352 | printk(KERN_DEBUG "%s: Using media type %s, CSR12 is %02x\n", | 350 | netdev_dbg(dev, "Using media type %s, CSR12 is %02x\n", |
| 353 | dev->name, medianame[dev->if_port], | 351 | medianame[dev->if_port], |
| 354 | ioread32(ioaddr + CSR12) & 0xff); | 352 | ioread32(ioaddr + CSR12) & 0xff); |
| 355 | } else if (tp->chip_id == LC82C168) { | 353 | } else if (tp->chip_id == LC82C168) { |
| 356 | if (startup && ! tp->medialock) | 354 | if (startup && ! tp->medialock) |
| 357 | dev->if_port = tp->mii_cnt ? 11 : 0; | 355 | dev->if_port = tp->mii_cnt ? 11 : 0; |
| 358 | if (tulip_debug > 1) | 356 | if (tulip_debug > 1) |
| 359 | printk(KERN_DEBUG "%s: PNIC PHY status is %3.3x, media %s\n", | 357 | netdev_dbg(dev, "PNIC PHY status is %3.3x, media %s\n", |
| 360 | dev->name, ioread32(ioaddr + 0xB8), medianame[dev->if_port]); | 358 | ioread32(ioaddr + 0xB8), |
| 359 | medianame[dev->if_port]); | ||
| 361 | if (tp->mii_cnt) { | 360 | if (tp->mii_cnt) { |
| 362 | new_csr6 = 0x810C0000; | 361 | new_csr6 = 0x810C0000; |
| 363 | iowrite32(0x0001, ioaddr + CSR15); | 362 | iowrite32(0x0001, ioaddr + CSR15); |
| @@ -388,9 +387,9 @@ void tulip_select_media(struct net_device *dev, int startup) | |||
| 388 | } else | 387 | } else |
| 389 | new_csr6 = 0x03860000; | 388 | new_csr6 = 0x03860000; |
| 390 | if (tulip_debug > 1) | 389 | if (tulip_debug > 1) |
| 391 | printk(KERN_DEBUG "%s: No media description table, assuming %s transceiver, CSR12 %02x\n", | 390 | netdev_dbg(dev, "No media description table, assuming %s transceiver, CSR12 %02x\n", |
| 392 | dev->name, medianame[dev->if_port], | 391 | medianame[dev->if_port], |
| 393 | ioread32(ioaddr + CSR12)); | 392 | ioread32(ioaddr + CSR12)); |
| 394 | } | 393 | } |
| 395 | 394 | ||
| 396 | tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0); | 395 | tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0); |
| @@ -504,8 +503,8 @@ void __devinit tulip_find_mii (struct net_device *dev, int board_idx) | |||
| 504 | 503 | ||
| 505 | /* Fixup for DLink with miswired PHY. */ | 504 | /* Fixup for DLink with miswired PHY. */ |
| 506 | if (mii_advert != to_advert) { | 505 | if (mii_advert != to_advert) { |
| 507 | printk(KERN_DEBUG "tulip%d: Advertising %04x on PHY %d, previously advertising %04x\n", | 506 | pr_debug("tulip%d: Advertising %04x on PHY %d, previously advertising %04x\n", |
| 508 | board_idx, to_advert, phy, mii_advert); | 507 | board_idx, to_advert, phy, mii_advert); |
| 509 | tulip_mdio_write (dev, phy, 4, to_advert); | 508 | tulip_mdio_write (dev, phy, 4, to_advert); |
| 510 | } | 509 | } |
| 511 | 510 | ||
