aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r8169.c
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2007-02-20 18:10:20 -0500
committerJeff Garzik <jeff@garzik.org>2007-07-08 22:16:44 -0400
commit901dda2b5f0dfbd310d22d497ec8826d4c60363b (patch)
treeed1349c8c0fd3e8f21fc5fd7d58870a8879a546c /drivers/net/r8169.c
parent0127215c17414322b350c3c6fbd1a7d8dd13856f (diff)
r8169: remove the media option
It has been documented as deprecated: - in MODULE_PARM_DESC since may 2005 ; - at the top of the source file and in printk since june 2004. Good bye. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Edward Hsu <edward_hsu@realtek.com.tw>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r--drivers/net/r8169.c72
1 files changed, 5 insertions, 67 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 49e599bc3f48..2ac532a6ed3e 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -8,19 +8,6 @@
8 May 20 2002 - Add link status force-mode and TBI mode support. 8 May 20 2002 - Add link status force-mode and TBI mode support.
9 2004 - Massive updates. See kernel SCM system for details. 9 2004 - Massive updates. See kernel SCM system for details.
10========================================================================= 10=========================================================================
11 1. [DEPRECATED: use ethtool instead] The media can be forced in 5 modes.
12 Command: 'insmod r8169 media = SET_MEDIA'
13 Ex: 'insmod r8169 media = 0x04' will force PHY to operate in 100Mpbs Half-duplex.
14
15 SET_MEDIA can be:
16 _10_Half = 0x01
17 _10_Full = 0x02
18 _100_Half = 0x04
19 _100_Full = 0x08
20 _1000_Full = 0x10
21
22 2. Support TBI mode.
23=========================================================================
24VERSION 1.1 <2002/10/4> 11VERSION 1.1 <2002/10/4>
25 12
26 The bit4:0 of MII register 4 is called "selector field", and have to be 13 The bit4:0 of MII register 4 is called "selector field", and have to be
@@ -108,11 +95,6 @@ VERSION 2.2LK <2005/01/25>
108#define rtl8169_rx_quota(count, quota) count 95#define rtl8169_rx_quota(count, quota) count
109#endif 96#endif
110 97
111/* media options */
112#define MAX_UNITS 8
113static int media[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1 };
114static int num_media = 0;
115
116/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ 98/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
117static const int max_interrupt_work = 20; 99static const int max_interrupt_work = 20;
118 100
@@ -364,13 +346,6 @@ enum RTL8169_register_content {
364 LinkStatus = 0x02, 346 LinkStatus = 0x02,
365 FullDup = 0x01, 347 FullDup = 0x01,
366 348
367 /* _MediaType */
368 _10_Half = 0x01,
369 _10_Full = 0x02,
370 _100_Half = 0x04,
371 _100_Full = 0x08,
372 _1000_Full = 0x10,
373
374 /* _TBICSRBit */ 349 /* _TBICSRBit */
375 TBILinkOK = 0x02000000, 350 TBILinkOK = 0x02000000,
376 351
@@ -472,8 +447,6 @@ struct rtl8169_private {
472 447
473MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>"); 448MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
474MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver"); 449MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
475module_param_array(media, int, &num_media, 0);
476MODULE_PARM_DESC(media, "force phy operation. Deprecated by ethtool (8).");
477module_param(rx_copybreak, int, 0); 450module_param(rx_copybreak, int, 0);
478MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames"); 451MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames");
479module_param(use_dac, int, 0); 452module_param(use_dac, int, 0);
@@ -601,38 +574,6 @@ static void rtl8169_check_link_status(struct net_device *dev,
601 spin_unlock_irqrestore(&tp->lock, flags); 574 spin_unlock_irqrestore(&tp->lock, flags);
602} 575}
603 576
604static void rtl8169_link_option(int idx, u8 *autoneg, u16 *speed, u8 *duplex)
605{
606 struct {
607 u16 speed;
608 u8 duplex;
609 u8 autoneg;
610 u8 media;
611 } link_settings[] = {
612 { SPEED_10, DUPLEX_HALF, AUTONEG_DISABLE, _10_Half },
613 { SPEED_10, DUPLEX_FULL, AUTONEG_DISABLE, _10_Full },
614 { SPEED_100, DUPLEX_HALF, AUTONEG_DISABLE, _100_Half },
615 { SPEED_100, DUPLEX_FULL, AUTONEG_DISABLE, _100_Full },
616 { SPEED_1000, DUPLEX_FULL, AUTONEG_DISABLE, _1000_Full },
617 /* Make TBI happy */
618 { SPEED_1000, DUPLEX_FULL, AUTONEG_ENABLE, 0xff }
619 }, *p;
620 unsigned char option;
621
622 option = ((idx < MAX_UNITS) && (idx >= 0)) ? media[idx] : 0xff;
623
624 if ((option != 0xff) && !idx && netif_msg_drv(&debug))
625 printk(KERN_WARNING PFX "media option is deprecated.\n");
626
627 for (p = link_settings; p->media != 0xff; p++) {
628 if (p->media == option)
629 break;
630 }
631 *autoneg = p->autoneg;
632 *speed = p->speed;
633 *duplex = p->duplex;
634}
635
636static void rtl8169_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 577static void rtl8169_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
637{ 578{
638 struct rtl8169_private *tp = netdev_priv(dev); 579 struct rtl8169_private *tp = netdev_priv(dev);
@@ -1425,11 +1366,6 @@ static void rtl8169_phy_reset(struct net_device *dev,
1425static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp) 1366static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
1426{ 1367{
1427 void __iomem *ioaddr = tp->mmio_addr; 1368 void __iomem *ioaddr = tp->mmio_addr;
1428 static int board_idx = -1;
1429 u8 autoneg, duplex;
1430 u16 speed;
1431
1432 board_idx++;
1433 1369
1434 rtl8169_hw_phy_config(dev); 1370 rtl8169_hw_phy_config(dev);
1435 1371
@@ -1448,11 +1384,13 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
1448 mdio_write(ioaddr, 0x0b, 0x0000); //w 0x0b 15 0 0 1384 mdio_write(ioaddr, 0x0b, 0x0000); //w 0x0b 15 0 0
1449 } 1385 }
1450 1386
1451 rtl8169_link_option(board_idx, &autoneg, &speed, &duplex);
1452
1453 rtl8169_phy_reset(dev, tp); 1387 rtl8169_phy_reset(dev, tp);
1454 1388
1455 rtl8169_set_speed(dev, autoneg, speed, duplex); 1389 /*
1390 * rtl8169_set_speed_xmii takes good care of the Fast Ethernet
1391 * only 8101. Don't panic.
1392 */
1393 rtl8169_set_speed(dev, AUTONEG_ENABLE, SPEED_1000, DUPLEX_FULL);
1456 1394
1457 if ((RTL_R8(PHYstatus) & TBI_Enable) && netif_msg_link(tp)) 1395 if ((RTL_R8(PHYstatus) & TBI_Enable) && netif_msg_link(tp))
1458 printk(KERN_INFO PFX "%s: TBI auto-negotiating\n", dev->name); 1396 printk(KERN_INFO PFX "%s: TBI auto-negotiating\n", dev->name);