diff options
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 0fe2fc90f207..f6899c3500b5 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 | ||
1354 | static void rtl_phy_write(void __iomem *ioaddr, struct phy_reg *regs, int len) | 1354 | static 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 | ||
1362 | static void rtl8169s_hw_phy_config(void __iomem *ioaddr) | 1362 | static 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 | ||
1429 | static void rtl8169sb_hw_phy_config(void __iomem *ioaddr) | 1429 | static 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, | |||
1457 | static void rtl8169scd_hw_phy_config(struct rtl8169_private *tp, | 1457 | static 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 | ||
1505 | static void rtl8169sce_hw_phy_config(void __iomem *ioaddr) | 1505 | static 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 | ||
1558 | static void rtl8168bb_hw_phy_config(void __iomem *ioaddr) | 1558 | static 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 | ||
1571 | static void rtl8168bef_hw_phy_config(void __iomem *ioaddr) | 1571 | static 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 | ||
1582 | static void rtl8168cp_1_hw_phy_config(void __iomem *ioaddr) | 1582 | static 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 | ||
1595 | static void rtl8168cp_2_hw_phy_config(void __iomem *ioaddr) | 1595 | static 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 | ||
1610 | static void rtl8168c_1_hw_phy_config(void __iomem *ioaddr) | 1610 | static 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 | ||
1639 | static void rtl8168c_2_hw_phy_config(void __iomem *ioaddr) | 1639 | static 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 | ||
1667 | static void rtl8168c_3_hw_phy_config(void __iomem *ioaddr) | 1667 | static 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 | ||
1694 | static void rtl8168d_1_hw_phy_config(void __iomem *ioaddr) | 1694 | static 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 | ||
2137 | static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr) | 2137 | static 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 | ||
2532 | static void rtl8168d_3_hw_phy_config(void __iomem *ioaddr) | 2532 | static 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 | ||
2593 | static void rtl8102e_hw_phy_config(void __iomem *ioaddr) | 2593 | static 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 }, |
@@ -3388,7 +3388,7 @@ static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz) | |||
3388 | 3388 | ||
3389 | static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) | 3389 | static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) |
3390 | { | 3390 | { |
3391 | struct { | 3391 | static const struct { |
3392 | u32 mac_version; | 3392 | u32 mac_version; |
3393 | u32 clk; | 3393 | u32 clk; |
3394 | u32 val; | 3394 | u32 val; |
@@ -3512,7 +3512,7 @@ struct ephy_info { | |||
3512 | u16 bits; | 3512 | u16 bits; |
3513 | }; | 3513 | }; |
3514 | 3514 | ||
3515 | static void rtl_ephy_init(void __iomem *ioaddr, struct ephy_info *e, int len) | 3515 | static void rtl_ephy_init(void __iomem *ioaddr, const struct ephy_info *e, int len) |
3516 | { | 3516 | { |
3517 | u16 w; | 3517 | u16 w; |
3518 | 3518 | ||
@@ -3583,7 +3583,7 @@ static void __rtl_hw_start_8168cp(void __iomem *ioaddr, struct pci_dev *pdev) | |||
3583 | 3583 | ||
3584 | static void rtl_hw_start_8168cp_1(void __iomem *ioaddr, struct pci_dev *pdev) | 3584 | static void rtl_hw_start_8168cp_1(void __iomem *ioaddr, struct pci_dev *pdev) |
3585 | { | 3585 | { |
3586 | static struct ephy_info e_info_8168cp[] = { | 3586 | static const struct ephy_info e_info_8168cp[] = { |
3587 | { 0x01, 0, 0x0001 }, | 3587 | { 0x01, 0, 0x0001 }, |
3588 | { 0x02, 0x0800, 0x1000 }, | 3588 | { 0x02, 0x0800, 0x1000 }, |
3589 | { 0x03, 0, 0x0042 }, | 3589 | { 0x03, 0, 0x0042 }, |
@@ -3627,7 +3627,7 @@ static void rtl_hw_start_8168cp_3(void __iomem *ioaddr, struct pci_dev *pdev) | |||
3627 | 3627 | ||
3628 | static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev) | 3628 | static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev) |
3629 | { | 3629 | { |
3630 | static struct ephy_info e_info_8168c_1[] = { | 3630 | static const struct ephy_info e_info_8168c_1[] = { |
3631 | { 0x02, 0x0800, 0x1000 }, | 3631 | { 0x02, 0x0800, 0x1000 }, |
3632 | { 0x03, 0, 0x0002 }, | 3632 | { 0x03, 0, 0x0002 }, |
3633 | { 0x06, 0x0080, 0x0000 } | 3633 | { 0x06, 0x0080, 0x0000 } |
@@ -3644,7 +3644,7 @@ static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev) | |||
3644 | 3644 | ||
3645 | static void rtl_hw_start_8168c_2(void __iomem *ioaddr, struct pci_dev *pdev) | 3645 | static void rtl_hw_start_8168c_2(void __iomem *ioaddr, struct pci_dev *pdev) |
3646 | { | 3646 | { |
3647 | static struct ephy_info e_info_8168c_2[] = { | 3647 | static const struct ephy_info e_info_8168c_2[] = { |
3648 | { 0x01, 0, 0x0001 }, | 3648 | { 0x01, 0, 0x0001 }, |
3649 | { 0x03, 0x0400, 0x0220 } | 3649 | { 0x03, 0x0400, 0x0220 } |
3650 | }; | 3650 | }; |
@@ -3787,7 +3787,7 @@ static void rtl_hw_start_8168(struct net_device *dev) | |||
3787 | 3787 | ||
3788 | static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev) | 3788 | static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev) |
3789 | { | 3789 | { |
3790 | static struct ephy_info e_info_8102e_1[] = { | 3790 | static const struct ephy_info e_info_8102e_1[] = { |
3791 | { 0x01, 0, 0x6e65 }, | 3791 | { 0x01, 0, 0x6e65 }, |
3792 | { 0x02, 0, 0x091f }, | 3792 | { 0x02, 0, 0x091f }, |
3793 | { 0x03, 0, 0xc2f9 }, | 3793 | { 0x03, 0, 0xc2f9 }, |
@@ -4447,13 +4447,12 @@ static inline bool rtl8169_try_rx_copy(struct sk_buff **sk_buff, | |||
4447 | if (pkt_size >= rx_copybreak) | 4447 | if (pkt_size >= rx_copybreak) |
4448 | goto out; | 4448 | goto out; |
4449 | 4449 | ||
4450 | skb = netdev_alloc_skb(tp->dev, pkt_size + NET_IP_ALIGN); | 4450 | skb = netdev_alloc_skb_ip_align(tp->dev, pkt_size); |
4451 | if (!skb) | 4451 | if (!skb) |
4452 | goto out; | 4452 | goto out; |
4453 | 4453 | ||
4454 | pci_dma_sync_single_for_cpu(tp->pci_dev, addr, pkt_size, | 4454 | pci_dma_sync_single_for_cpu(tp->pci_dev, addr, pkt_size, |
4455 | PCI_DMA_FROMDEVICE); | 4455 | PCI_DMA_FROMDEVICE); |
4456 | skb_reserve(skb, NET_IP_ALIGN); | ||
4457 | skb_copy_from_linear_data(*sk_buff, skb->data, pkt_size); | 4456 | skb_copy_from_linear_data(*sk_buff, skb->data, pkt_size); |
4458 | *sk_buff = skb; | 4457 | *sk_buff = skb; |
4459 | done = true; | 4458 | done = true; |