aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r8169.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2009-11-25 18:54:21 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-25 18:54:21 -0500
commit350f75960c8ba317935b4274c56c16412e085b08 (patch)
tree9a7f6c04efeb5a1d4763c45810eb17610925e26d /drivers/net/r8169.c
parentbc74b0c8af17458ecae77f725e507ab5fd100105 (diff)
r8169: move PHY regs tables to .rodata
As side effect, consume less stack. -rtl8169_get_mac_version [vmlinux]: 432 -rtl8169_init_one [vmlinux]: 376 +rtl8169_init_one [vmlinux]: 136 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r--drivers/net/r8169.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 98f6c51b7608..5dba9fa2bc19 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -794,7 +794,7 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
794 struct rtl8169_private *tp = netdev_priv(dev); 794 struct rtl8169_private *tp = netdev_priv(dev);
795 void __iomem *ioaddr = tp->mmio_addr; 795 void __iomem *ioaddr = tp->mmio_addr;
796 unsigned int i; 796 unsigned int i;
797 static struct { 797 static const struct {
798 u32 opt; 798 u32 opt;
799 u16 reg; 799 u16 reg;
800 u8 mask; 800 u8 mask;
@@ -1277,7 +1277,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
1277 * 1277 *
1278 * (RTL_R32(TxConfig) & 0x700000) == 0x200000 ? 8101Eb : 8101Ec 1278 * (RTL_R32(TxConfig) & 0x700000) == 0x200000 ? 8101Eb : 8101Ec
1279 */ 1279 */
1280 const struct { 1280 static const struct {
1281 u32 mask; 1281 u32 mask;
1282 u32 val; 1282 u32 val;
1283 int mac_version; 1283 int mac_version;
@@ -1351,7 +1351,7 @@ struct phy_reg {
1351 u16 val; 1351 u16 val;
1352}; 1352};
1353 1353
1354static void rtl_phy_write(void __iomem *ioaddr, struct phy_reg *regs, int len) 1354static void rtl_phy_write(void __iomem *ioaddr, const struct phy_reg *regs, int len)
1355{ 1355{
1356 while (len-- > 0) { 1356 while (len-- > 0) {
1357 mdio_write(ioaddr, regs->reg, regs->val); 1357 mdio_write(ioaddr, regs->reg, regs->val);
@@ -1361,7 +1361,7 @@ static void rtl_phy_write(void __iomem *ioaddr, struct phy_reg *regs, int len)
1361 1361
1362static void rtl8169s_hw_phy_config(void __iomem *ioaddr) 1362static void rtl8169s_hw_phy_config(void __iomem *ioaddr)
1363{ 1363{
1364 struct phy_reg phy_reg_init[] = { 1364 static const struct phy_reg phy_reg_init[] = {
1365 { 0x1f, 0x0001 }, 1365 { 0x1f, 0x0001 },
1366 { 0x06, 0x006e }, 1366 { 0x06, 0x006e },
1367 { 0x08, 0x0708 }, 1367 { 0x08, 0x0708 },
@@ -1428,7 +1428,7 @@ static void rtl8169s_hw_phy_config(void __iomem *ioaddr)
1428 1428
1429static void rtl8169sb_hw_phy_config(void __iomem *ioaddr) 1429static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
1430{ 1430{
1431 struct phy_reg phy_reg_init[] = { 1431 static const struct phy_reg phy_reg_init[] = {
1432 { 0x1f, 0x0002 }, 1432 { 0x1f, 0x0002 },
1433 { 0x01, 0x90d0 }, 1433 { 0x01, 0x90d0 },
1434 { 0x1f, 0x0000 } 1434 { 0x1f, 0x0000 }
@@ -1457,7 +1457,7 @@ static void rtl8169scd_hw_phy_config_quirk(struct rtl8169_private *tp,
1457static void rtl8169scd_hw_phy_config(struct rtl8169_private *tp, 1457static void rtl8169scd_hw_phy_config(struct rtl8169_private *tp,
1458 void __iomem *ioaddr) 1458 void __iomem *ioaddr)
1459{ 1459{
1460 struct phy_reg phy_reg_init[] = { 1460 static const struct phy_reg phy_reg_init[] = {
1461 { 0x1f, 0x0001 }, 1461 { 0x1f, 0x0001 },
1462 { 0x04, 0x0000 }, 1462 { 0x04, 0x0000 },
1463 { 0x03, 0x00a1 }, 1463 { 0x03, 0x00a1 },
@@ -1504,7 +1504,7 @@ static void rtl8169scd_hw_phy_config(struct rtl8169_private *tp,
1504 1504
1505static void rtl8169sce_hw_phy_config(void __iomem *ioaddr) 1505static void rtl8169sce_hw_phy_config(void __iomem *ioaddr)
1506{ 1506{
1507 struct phy_reg phy_reg_init[] = { 1507 static const struct phy_reg phy_reg_init[] = {
1508 { 0x1f, 0x0001 }, 1508 { 0x1f, 0x0001 },
1509 { 0x04, 0x0000 }, 1509 { 0x04, 0x0000 },
1510 { 0x03, 0x00a1 }, 1510 { 0x03, 0x00a1 },
@@ -1557,7 +1557,7 @@ static void rtl8169sce_hw_phy_config(void __iomem *ioaddr)
1557 1557
1558static void rtl8168bb_hw_phy_config(void __iomem *ioaddr) 1558static void rtl8168bb_hw_phy_config(void __iomem *ioaddr)
1559{ 1559{
1560 struct phy_reg phy_reg_init[] = { 1560 static const struct phy_reg phy_reg_init[] = {
1561 { 0x10, 0xf41b }, 1561 { 0x10, 0xf41b },
1562 { 0x1f, 0x0000 } 1562 { 0x1f, 0x0000 }
1563 }; 1563 };
@@ -1570,7 +1570,7 @@ static void rtl8168bb_hw_phy_config(void __iomem *ioaddr)
1570 1570
1571static void rtl8168bef_hw_phy_config(void __iomem *ioaddr) 1571static void rtl8168bef_hw_phy_config(void __iomem *ioaddr)
1572{ 1572{
1573 struct phy_reg phy_reg_init[] = { 1573 static const struct phy_reg phy_reg_init[] = {
1574 { 0x1f, 0x0001 }, 1574 { 0x1f, 0x0001 },
1575 { 0x10, 0xf41b }, 1575 { 0x10, 0xf41b },
1576 { 0x1f, 0x0000 } 1576 { 0x1f, 0x0000 }
@@ -1581,7 +1581,7 @@ static void rtl8168bef_hw_phy_config(void __iomem *ioaddr)
1581 1581
1582static void rtl8168cp_1_hw_phy_config(void __iomem *ioaddr) 1582static void rtl8168cp_1_hw_phy_config(void __iomem *ioaddr)
1583{ 1583{
1584 struct phy_reg phy_reg_init[] = { 1584 static const struct phy_reg phy_reg_init[] = {
1585 { 0x1f, 0x0000 }, 1585 { 0x1f, 0x0000 },
1586 { 0x1d, 0x0f00 }, 1586 { 0x1d, 0x0f00 },
1587 { 0x1f, 0x0002 }, 1587 { 0x1f, 0x0002 },
@@ -1594,7 +1594,7 @@ static void rtl8168cp_1_hw_phy_config(void __iomem *ioaddr)
1594 1594
1595static void rtl8168cp_2_hw_phy_config(void __iomem *ioaddr) 1595static void rtl8168cp_2_hw_phy_config(void __iomem *ioaddr)
1596{ 1596{
1597 struct phy_reg phy_reg_init[] = { 1597 static const struct phy_reg phy_reg_init[] = {
1598 { 0x1f, 0x0001 }, 1598 { 0x1f, 0x0001 },
1599 { 0x1d, 0x3d98 }, 1599 { 0x1d, 0x3d98 },
1600 { 0x1f, 0x0000 } 1600 { 0x1f, 0x0000 }
@@ -1609,7 +1609,7 @@ static void rtl8168cp_2_hw_phy_config(void __iomem *ioaddr)
1609 1609
1610static void rtl8168c_1_hw_phy_config(void __iomem *ioaddr) 1610static void rtl8168c_1_hw_phy_config(void __iomem *ioaddr)
1611{ 1611{
1612 struct phy_reg phy_reg_init[] = { 1612 static const struct phy_reg phy_reg_init[] = {
1613 { 0x1f, 0x0001 }, 1613 { 0x1f, 0x0001 },
1614 { 0x12, 0x2300 }, 1614 { 0x12, 0x2300 },
1615 { 0x1f, 0x0002 }, 1615 { 0x1f, 0x0002 },
@@ -1638,7 +1638,7 @@ static void rtl8168c_1_hw_phy_config(void __iomem *ioaddr)
1638 1638
1639static void rtl8168c_2_hw_phy_config(void __iomem *ioaddr) 1639static void rtl8168c_2_hw_phy_config(void __iomem *ioaddr)
1640{ 1640{
1641 struct phy_reg phy_reg_init[] = { 1641 static const struct phy_reg phy_reg_init[] = {
1642 { 0x1f, 0x0001 }, 1642 { 0x1f, 0x0001 },
1643 { 0x12, 0x2300 }, 1643 { 0x12, 0x2300 },
1644 { 0x03, 0x802f }, 1644 { 0x03, 0x802f },
@@ -1666,7 +1666,7 @@ static void rtl8168c_2_hw_phy_config(void __iomem *ioaddr)
1666 1666
1667static void rtl8168c_3_hw_phy_config(void __iomem *ioaddr) 1667static void rtl8168c_3_hw_phy_config(void __iomem *ioaddr)
1668{ 1668{
1669 struct phy_reg phy_reg_init[] = { 1669 static const struct phy_reg phy_reg_init[] = {
1670 { 0x1f, 0x0001 }, 1670 { 0x1f, 0x0001 },
1671 { 0x12, 0x2300 }, 1671 { 0x12, 0x2300 },
1672 { 0x1d, 0x3d98 }, 1672 { 0x1d, 0x3d98 },
@@ -1693,7 +1693,7 @@ static void rtl8168c_4_hw_phy_config(void __iomem *ioaddr)
1693 1693
1694static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr) 1694static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
1695{ 1695{
1696 static struct phy_reg phy_reg_init_0[] = { 1696 static const struct phy_reg phy_reg_init_0[] = {
1697 { 0x1f, 0x0001 }, 1697 { 0x1f, 0x0001 },
1698 { 0x06, 0x4064 }, 1698 { 0x06, 0x4064 },
1699 { 0x07, 0x2863 }, 1699 { 0x07, 0x2863 },
@@ -1712,14 +1712,14 @@ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
1712 { 0x1a, 0x05ad }, 1712 { 0x1a, 0x05ad },
1713 { 0x14, 0x94c0 } 1713 { 0x14, 0x94c0 }
1714 }; 1714 };
1715 static struct phy_reg phy_reg_init_1[] = { 1715 static const struct phy_reg phy_reg_init_1[] = {
1716 { 0x1f, 0x0002 }, 1716 { 0x1f, 0x0002 },
1717 { 0x06, 0x5561 }, 1717 { 0x06, 0x5561 },
1718 { 0x1f, 0x0005 }, 1718 { 0x1f, 0x0005 },
1719 { 0x05, 0x8332 }, 1719 { 0x05, 0x8332 },
1720 { 0x06, 0x5561 } 1720 { 0x06, 0x5561 }
1721 }; 1721 };
1722 static struct phy_reg phy_reg_init_2[] = { 1722 static const struct phy_reg phy_reg_init_2[] = {
1723 { 0x1f, 0x0005 }, 1723 { 0x1f, 0x0005 },
1724 { 0x05, 0xffc2 }, 1724 { 0x05, 0xffc2 },
1725 { 0x1f, 0x0005 }, 1725 { 0x1f, 0x0005 },
@@ -2084,7 +2084,7 @@ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
2084 rtl_phy_write(ioaddr, phy_reg_init_1, ARRAY_SIZE(phy_reg_init_1)); 2084 rtl_phy_write(ioaddr, phy_reg_init_1, ARRAY_SIZE(phy_reg_init_1));
2085 2085
2086 if (rtl8168d_efuse_read(ioaddr, 0x01) == 0xb1) { 2086 if (rtl8168d_efuse_read(ioaddr, 0x01) == 0xb1) {
2087 struct phy_reg phy_reg_init[] = { 2087 static const struct phy_reg phy_reg_init[] = {
2088 { 0x1f, 0x0002 }, 2088 { 0x1f, 0x0002 },
2089 { 0x05, 0x669a }, 2089 { 0x05, 0x669a },
2090 { 0x1f, 0x0005 }, 2090 { 0x1f, 0x0005 },
@@ -2099,7 +2099,7 @@ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
2099 val = mdio_read(ioaddr, 0x0d); 2099 val = mdio_read(ioaddr, 0x0d);
2100 2100
2101 if ((val & 0x00ff) != 0x006c) { 2101 if ((val & 0x00ff) != 0x006c) {
2102 u32 set[] = { 2102 static const u32 set[] = {
2103 0x0065, 0x0066, 0x0067, 0x0068, 2103 0x0065, 0x0066, 0x0067, 0x0068,
2104 0x0069, 0x006a, 0x006b, 0x006c 2104 0x0069, 0x006a, 0x006b, 0x006c
2105 }; 2105 };
@@ -2112,7 +2112,7 @@ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
2112 mdio_write(ioaddr, 0x0d, val | set[i]); 2112 mdio_write(ioaddr, 0x0d, val | set[i]);
2113 } 2113 }
2114 } else { 2114 } else {
2115 struct phy_reg phy_reg_init[] = { 2115 static const struct phy_reg phy_reg_init[] = {
2116 { 0x1f, 0x0002 }, 2116 { 0x1f, 0x0002 },
2117 { 0x05, 0x6662 }, 2117 { 0x05, 0x6662 },
2118 { 0x1f, 0x0005 }, 2118 { 0x1f, 0x0005 },
@@ -2136,7 +2136,7 @@ static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr)
2136 2136
2137static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr) 2137static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
2138{ 2138{
2139 static struct phy_reg phy_reg_init_0[] = { 2139 static const struct phy_reg phy_reg_init_0[] = {
2140 { 0x1f, 0x0001 }, 2140 { 0x1f, 0x0001 },
2141 { 0x06, 0x4064 }, 2141 { 0x06, 0x4064 },
2142 { 0x07, 0x2863 }, 2142 { 0x07, 0x2863 },
@@ -2161,7 +2161,7 @@ static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
2161 { 0x05, 0x8332 }, 2161 { 0x05, 0x8332 },
2162 { 0x06, 0x5561 } 2162 { 0x06, 0x5561 }
2163 }; 2163 };
2164 static struct phy_reg phy_reg_init_1[] = { 2164 static const struct phy_reg phy_reg_init_1[] = {
2165 { 0x1f, 0x0005 }, 2165 { 0x1f, 0x0005 },
2166 { 0x05, 0xffc2 }, 2166 { 0x05, 0xffc2 },
2167 { 0x1f, 0x0005 }, 2167 { 0x1f, 0x0005 },
@@ -2477,7 +2477,7 @@ static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
2477 rtl_phy_write(ioaddr, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0)); 2477 rtl_phy_write(ioaddr, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0));
2478 2478
2479 if (rtl8168d_efuse_read(ioaddr, 0x01) == 0xb1) { 2479 if (rtl8168d_efuse_read(ioaddr, 0x01) == 0xb1) {
2480 struct phy_reg phy_reg_init[] = { 2480 static const struct phy_reg phy_reg_init[] = {
2481 { 0x1f, 0x0002 }, 2481 { 0x1f, 0x0002 },
2482 { 0x05, 0x669a }, 2482 { 0x05, 0x669a },
2483 { 0x1f, 0x0005 }, 2483 { 0x1f, 0x0005 },
@@ -2505,7 +2505,7 @@ static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
2505 mdio_write(ioaddr, 0x0d, val | set[i]); 2505 mdio_write(ioaddr, 0x0d, val | set[i]);
2506 } 2506 }
2507 } else { 2507 } else {
2508 struct phy_reg phy_reg_init[] = { 2508 static const struct phy_reg phy_reg_init[] = {
2509 { 0x1f, 0x0002 }, 2509 { 0x1f, 0x0002 },
2510 { 0x05, 0x2642 }, 2510 { 0x05, 0x2642 },
2511 { 0x1f, 0x0005 }, 2511 { 0x1f, 0x0005 },
@@ -2531,7 +2531,7 @@ static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
2531 2531
2532static void rtl8168d_3_hw_phy_config(void __iomem *ioaddr) 2532static void rtl8168d_3_hw_phy_config(void __iomem *ioaddr)
2533{ 2533{
2534 struct phy_reg phy_reg_init[] = { 2534 static const struct phy_reg phy_reg_init[] = {
2535 { 0x1f, 0x0002 }, 2535 { 0x1f, 0x0002 },
2536 { 0x10, 0x0008 }, 2536 { 0x10, 0x0008 },
2537 { 0x0d, 0x006c }, 2537 { 0x0d, 0x006c },
@@ -2592,7 +2592,7 @@ static void rtl8168d_3_hw_phy_config(void __iomem *ioaddr)
2592 2592
2593static void rtl8102e_hw_phy_config(void __iomem *ioaddr) 2593static void rtl8102e_hw_phy_config(void __iomem *ioaddr)
2594{ 2594{
2595 struct phy_reg phy_reg_init[] = { 2595 static const struct phy_reg phy_reg_init[] = {
2596 { 0x1f, 0x0003 }, 2596 { 0x1f, 0x0003 },
2597 { 0x08, 0x441d }, 2597 { 0x08, 0x441d },
2598 { 0x01, 0x9100 }, 2598 { 0x01, 0x9100 },
@@ -3384,7 +3384,7 @@ static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz)
3384 3384
3385static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) 3385static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version)
3386{ 3386{
3387 struct { 3387 static const struct {
3388 u32 mac_version; 3388 u32 mac_version;
3389 u32 clk; 3389 u32 clk;
3390 u32 val; 3390 u32 val;
@@ -3508,7 +3508,7 @@ struct ephy_info {
3508 u16 bits; 3508 u16 bits;
3509}; 3509};
3510 3510
3511static void rtl_ephy_init(void __iomem *ioaddr, struct ephy_info *e, int len) 3511static void rtl_ephy_init(void __iomem *ioaddr, const struct ephy_info *e, int len)
3512{ 3512{
3513 u16 w; 3513 u16 w;
3514 3514
@@ -3579,7 +3579,7 @@ static void __rtl_hw_start_8168cp(void __iomem *ioaddr, struct pci_dev *pdev)
3579 3579
3580static void rtl_hw_start_8168cp_1(void __iomem *ioaddr, struct pci_dev *pdev) 3580static void rtl_hw_start_8168cp_1(void __iomem *ioaddr, struct pci_dev *pdev)
3581{ 3581{
3582 static struct ephy_info e_info_8168cp[] = { 3582 static const struct ephy_info e_info_8168cp[] = {
3583 { 0x01, 0, 0x0001 }, 3583 { 0x01, 0, 0x0001 },
3584 { 0x02, 0x0800, 0x1000 }, 3584 { 0x02, 0x0800, 0x1000 },
3585 { 0x03, 0, 0x0042 }, 3585 { 0x03, 0, 0x0042 },
@@ -3623,7 +3623,7 @@ static void rtl_hw_start_8168cp_3(void __iomem *ioaddr, struct pci_dev *pdev)
3623 3623
3624static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev) 3624static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev)
3625{ 3625{
3626 static struct ephy_info e_info_8168c_1[] = { 3626 static const struct ephy_info e_info_8168c_1[] = {
3627 { 0x02, 0x0800, 0x1000 }, 3627 { 0x02, 0x0800, 0x1000 },
3628 { 0x03, 0, 0x0002 }, 3628 { 0x03, 0, 0x0002 },
3629 { 0x06, 0x0080, 0x0000 } 3629 { 0x06, 0x0080, 0x0000 }
@@ -3640,7 +3640,7 @@ static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev)
3640 3640
3641static void rtl_hw_start_8168c_2(void __iomem *ioaddr, struct pci_dev *pdev) 3641static void rtl_hw_start_8168c_2(void __iomem *ioaddr, struct pci_dev *pdev)
3642{ 3642{
3643 static struct ephy_info e_info_8168c_2[] = { 3643 static const struct ephy_info e_info_8168c_2[] = {
3644 { 0x01, 0, 0x0001 }, 3644 { 0x01, 0, 0x0001 },
3645 { 0x03, 0x0400, 0x0220 } 3645 { 0x03, 0x0400, 0x0220 }
3646 }; 3646 };
@@ -3783,7 +3783,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
3783 3783
3784static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev) 3784static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
3785{ 3785{
3786 static struct ephy_info e_info_8102e_1[] = { 3786 static const struct ephy_info e_info_8102e_1[] = {
3787 { 0x01, 0, 0x6e65 }, 3787 { 0x01, 0, 0x6e65 },
3788 { 0x02, 0, 0x091f }, 3788 { 0x02, 0, 0x091f },
3789 { 0x03, 0, 0xc2f9 }, 3789 { 0x03, 0, 0xc2f9 },