Lines Matching +full:0 +full:xf007
63 #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */
72 #define OCP_STD_PHY_BASE 0xa400
143 { PCI_VDEVICE(REALTEK, 0x2502) },
144 { PCI_VDEVICE(REALTEK, 0x2600) },
145 { PCI_VDEVICE(REALTEK, 0x8129) },
146 { PCI_VDEVICE(REALTEK, 0x8136), RTL_CFG_NO_GBIT },
147 { PCI_VDEVICE(REALTEK, 0x8161) },
148 { PCI_VDEVICE(REALTEK, 0x8162) },
149 { PCI_VDEVICE(REALTEK, 0x8167) },
150 { PCI_VDEVICE(REALTEK, 0x8168) },
151 { PCI_VDEVICE(NCUBE, 0x8168) },
152 { PCI_VDEVICE(REALTEK, 0x8169) },
153 { PCI_VENDOR_ID_DLINK, 0x4300,
154 PCI_VENDOR_ID_DLINK, 0x4b10, 0, 0 },
155 { PCI_VDEVICE(DLINK, 0x4300) },
156 { PCI_VDEVICE(DLINK, 0x4302) },
157 { PCI_VDEVICE(AT, 0xc107) },
158 { PCI_VDEVICE(USR, 0x0116) },
159 { PCI_VENDOR_ID_LINKSYS, 0x1032, PCI_ANY_ID, 0x0024 },
160 { 0x0001, 0x8168, PCI_ANY_ID, 0x2410 },
161 { PCI_VDEVICE(REALTEK, 0x8125) },
162 { PCI_VDEVICE(REALTEK, 0x3000) },
169 MAC0 = 0, /* Ethernet hardware address. */
172 CounterAddrLow = 0x10,
173 CounterAddrHigh = 0x14,
174 TxDescStartAddrLow = 0x20,
175 TxDescStartAddrHigh = 0x24,
176 TxHDescStartAddrLow = 0x28,
177 TxHDescStartAddrHigh = 0x2c,
178 FLASH = 0x30,
179 ERSR = 0x36,
180 ChipCmd = 0x37,
181 TxPoll = 0x38,
182 IntrMask = 0x3c,
183 IntrStatus = 0x3e,
185 TxConfig = 0x40,
189 RxConfig = 0x44,
200 Cfg9346 = 0x50,
201 Config0 = 0x51,
202 Config1 = 0x52,
203 Config2 = 0x53,
206 Config3 = 0x54,
207 Config4 = 0x55,
208 Config5 = 0x56,
209 PHYAR = 0x60,
210 PHYstatus = 0x6c,
211 RxMaxSize = 0xda,
212 CPlusCmd = 0xe0,
213 IntrMitigate = 0xe2,
218 #define RTL_COALESCE_RX_FRAMES GENMASK(3, 0)
220 #define RTL_COALESCE_T_MAX 0x0fU
223 RxDescAddrLow = 0xe4,
224 RxDescAddrHigh = 0xe8,
225 EarlyTxThres = 0xec, /* 8169. Unit of 32 bytes. */
227 #define NoEarlyTx 0x3f /* Max value : no early transmit. */
229 MaxTxPacketSize = 0xec, /* 8101/8168. Unit of 128 bytes. */
232 #define EarlySize 0x27
234 FuncEvent = 0xf0,
235 FuncEventMask = 0xf4,
236 FuncPresetState = 0xf8,
237 IBCR0 = 0xf8,
238 IBCR2 = 0xf9,
239 IBIMR0 = 0xfa,
240 IBISR0 = 0xfb,
241 FuncForceEvent = 0xfc,
245 CSIDR = 0x64,
246 CSIAR = 0x68,
247 #define CSIAR_FLAG 0x80000000
248 #define CSIAR_WRITE_CMD 0x80000000
249 #define CSIAR_BYTE_ENABLE 0x0000f000
250 #define CSIAR_ADDR_MASK 0x00000fff
251 PMCH = 0x6f,
255 EPHYAR = 0x80,
256 #define EPHYAR_FLAG 0x80000000
257 #define EPHYAR_WRITE_CMD 0x80000000
258 #define EPHYAR_REG_MASK 0x1f
260 #define EPHYAR_DATA_MASK 0xffff
261 DLLPR = 0xd0,
264 DBG_REG = 0xd1,
267 TWSI = 0xd2,
268 MCU = 0xd3,
276 EFUSEAR = 0xdc,
277 #define EFUSEAR_FLAG 0x80000000
278 #define EFUSEAR_WRITE_CMD 0x80000000
279 #define EFUSEAR_READ_CMD 0x00000000
280 #define EFUSEAR_REG_MASK 0x03ff
282 #define EFUSEAR_DATA_MASK 0xff
283 MISC_1 = 0xf2,
288 LED_FREQ = 0x1a,
289 EEE_LED = 0x1b,
290 ERIDR = 0x70,
291 ERIAR = 0x74,
292 #define ERIAR_FLAG 0x80000000
293 #define ERIAR_WRITE_CMD 0x80000000
294 #define ERIAR_READ_CMD 0x00000000
297 #define ERIAR_EXGMAC (0x00 << ERIAR_TYPE_SHIFT)
298 #define ERIAR_MSIX (0x01 << ERIAR_TYPE_SHIFT)
299 #define ERIAR_ASF (0x02 << ERIAR_TYPE_SHIFT)
300 #define ERIAR_OOB (0x02 << ERIAR_TYPE_SHIFT)
302 #define ERIAR_MASK_0001 (0x1 << ERIAR_MASK_SHIFT)
303 #define ERIAR_MASK_0011 (0x3 << ERIAR_MASK_SHIFT)
304 #define ERIAR_MASK_0100 (0x4 << ERIAR_MASK_SHIFT)
305 #define ERIAR_MASK_0101 (0x5 << ERIAR_MASK_SHIFT)
306 #define ERIAR_MASK_1111 (0xf << ERIAR_MASK_SHIFT)
307 EPHY_RXER_NUM = 0x7c,
308 OCPDR = 0xb0, /* OCP GPHY access */
309 #define OCPDR_WRITE_CMD 0x80000000
310 #define OCPDR_READ_CMD 0x00000000
311 #define OCPDR_REG_MASK 0x7f
313 #define OCPDR_DATA_MASK 0xffff
314 OCPAR = 0xb4,
315 #define OCPAR_FLAG 0x80000000
316 #define OCPAR_GPHY_WRITE_CMD 0x8000f060
317 #define OCPAR_GPHY_READ_CMD 0x0000f060
318 GPHY_OCP = 0xb8,
319 RDSAR1 = 0xd0, /* 8168c only. Undocumented on 8168dp */
320 MISC = 0xf0, /* 8168e only. */
329 IntrMask_8125 = 0x38,
330 IntrStatus_8125 = 0x3c,
331 TxPoll_8125 = 0x90,
332 MAC0_BKP = 0x19e0,
333 EEE_TXIDLE_TIMER_8125 = 0x6048,
344 SYSErr = 0x8000,
345 PCSTimeout = 0x4000,
346 SWInt = 0x0100,
347 TxDescUnavail = 0x0080,
348 RxFIFOOver = 0x0040,
349 LinkChg = 0x0020,
350 RxOverflow = 0x0010,
351 TxErr = 0x0008,
352 TxOK = 0x0004,
353 RxErr = 0x0002,
354 RxOK = 0x0001,
363 StopReq = 0x80,
364 CmdReset = 0x10,
365 CmdRxEnb = 0x08,
366 CmdTxEnb = 0x04,
367 RxBufEmpty = 0x01,
370 HPQ = 0x80, /* Poll cmd on the high prio queue */
371 NPQ = 0x40, /* Poll cmd on the low prio queue */
372 FSWInt = 0x01, /* Forced software interrupt */
375 Cfg9346_Lock = 0x00,
376 Cfg9346_Unlock = 0xc0,
379 AcceptErr = 0x20,
380 AcceptRunt = 0x10,
381 #define RX_CONFIG_ACCEPT_ERR_MASK 0x30
382 AcceptBroadcast = 0x08,
383 AcceptMulticast = 0x04,
384 AcceptMyPhys = 0x02,
385 AcceptAllPhys = 0x01,
386 #define RX_CONFIG_ACCEPT_OK_MASK 0x0f
387 #define RX_CONFIG_ACCEPT_MASK 0x3f
391 TxDMAShift = 8, /* DMA burst value (0-7) is shift this many bits */
400 PMEnable = (1 << 0), /* Power Management Enable */
405 PCI_Clock_66MHz = 0x01,
406 PCI_Clock_33MHz = 0x00,
413 Beacon_en = (1 << 0), /* 8168 only. Reserved in the 8168b */
424 PMEStatus = (1 << 0), /* PME status can be reset by PCI RST# */
425 ASPM_en = (1 << 0), /* ASPM enable */
438 Mac_dbgo_sel = 0x001c, // 8168
443 #define INTT_MASK GENMASK(1, 0)
447 TBI_Enable = 0x80,
448 TxFlowCtrl = 0x40,
449 RxFlowCtrl = 0x20,
450 _1000bpsF = 0x10,
451 _100bps = 0x08,
452 _10bps = 0x04,
453 LinkStatus = 0x02,
454 FullDup = 0x01,
457 CounterReset = 0x1,
460 CounterDump = 0x8,
478 #define TD_MSS_MAX 0x07ffu /* MSS value */
499 #define GTTCPHO_MAX 0x7f
503 #define TCPHO_MAX 0x3ff
514 PID0 = (1 << 17), /* Protocol ID bit 0/2 */
577 RTL_FLAG_TASK_ENABLED = 0,
700 for (i = 0; i < ETH_ALEN; i++) in rtl_read_mac_from_reg()
714 for (i = 0; i < n; i++) { in rtl_loop_wait()
756 *cmd |= 0xf70 << 18; in r8168fp_adjust_ocp_cmd()
769 if (WARN(addr & 3 || !mask, "addr: 0x%x, mask: 0x%08x\n", addr, mask)) in _rtl_eri_write()
793 RTL_R32(tp, ERIDR) : ~0; in _rtl_eri_read()
810 rtl_w0w1_eri(tp, addr, p, 0); in rtl_eri_set_bits()
815 rtl_w0w1_eri(tp, addr, 0, m); in rtl_eri_clear_bits()
820 return WARN_ONCE(reg & 0xffff0001, "Invalid ocp reg %x!\n", reg); in rtl_ocp_reg_failure()
841 return 0; in r8168_phy_ocp_read()
846 (RTL_R32(tp, GPHY_OCP) & 0xffff) : -ETIMEDOUT; in r8168_phy_ocp_read()
860 return 0; in r8168_mac_ocp_read()
883 rtl_eri_set_bits(tp, 0x1a8, 0xfc000000); in rtl8168g_phy_suspend_quirk()
885 rtl_eri_clear_bits(tp, 0x1a8, 0xfc000000); in rtl8168g_phy_suspend_quirk()
894 if (reg == 0x1f) { in r8168g_mdio_write()
900 reg -= 0x10; in r8168g_mdio_write()
910 if (reg == 0x1f) in r8168g_mdio_read()
911 return tp->ocp_base == OCP_STD_PHY_BASE ? 0 : tp->ocp_base >> 4; in r8168g_mdio_read()
914 reg -= 0x10; in r8168g_mdio_read()
921 if (reg == 0x1f) { in mac_mcu_write()
936 return RTL_R32(tp, PHYAR) & 0x80000000; in DECLARE_RTL_COND()
941 RTL_W32(tp, PHYAR, 0x80000000 | (reg & 0x1f) << 16 | (value & 0xffff)); in r8169_mdio_write()
955 RTL_W32(tp, PHYAR, 0x0 | (reg & 0x1f) << 16); in r8169_mdio_read()
958 RTL_R32(tp, PHYAR) & 0xffff : -ETIMEDOUT; in r8169_mdio_read()
974 #define R8168DP_1_MDIO_ACCESS_BIT 0x00020000
978 RTL_W32(tp, 0xd0, RTL_R32(tp, 0xd0) & ~R8168DP_1_MDIO_ACCESS_BIT); in r8168dp_2_mdio_start()
983 RTL_W32(tp, 0xd0, RTL_R32(tp, 0xd0) | R8168DP_1_MDIO_ACCESS_BIT); in r8168dp_2_mdio_stop()
1001 return 0xc912; in r8168dp_2_mdio_read()
1061 RTL_R32(tp, EPHYAR) & EPHYAR_DATA_MASK : ~0; in rtl_ephy_read()
1066 RTL_W32(tp, OCPAR, 0x0fu << 12 | (reg & 0x0fff)); in r8168dp_ocp_read()
1068 RTL_R32(tp, OCPDR) : ~0; in r8168dp_ocp_read()
1080 RTL_W32(tp, OCPAR, OCPAR_FLAG | ((u32)mask & 0x0f) << 12 | (reg & 0x0fff)); in r8168dp_ocp_write()
1087 _rtl_eri_write(tp, reg, ((u32)mask & 0x0f) << ERIAR_MASK_SHIFT, in r8168ep_ocp_write()
1093 rtl_eri_write(tp, 0xe8, ERIAR_MASK_0001, cmd); in r8168dp_oob_notify()
1095 r8168dp_ocp_write(tp, 0x1, 0x30, 0x00000001); in r8168dp_oob_notify()
1098 #define OOB_CMD_RESET 0x00
1099 #define OOB_CMD_DRIVER_START 0x05
1100 #define OOB_CMD_DRIVER_STOP 0x06
1104 return (tp->mac_version == RTL_GIGA_MAC_VER_31) ? 0xb8 : 0x10; in rtl8168_get_ocp_reg()
1113 return r8168dp_ocp_read(tp, reg) & 0x00000800; in DECLARE_RTL_COND()
1118 return r8168ep_ocp_read(tp, 0x124) & 0x00000001; in DECLARE_RTL_COND()
1123 return RTL_R8(tp, IBISR0) & 0x20; in DECLARE_RTL_COND()
1128 RTL_W8(tp, IBCR2, RTL_R8(tp, IBCR2) & ~0x01); in rtl8168ep_stop_cmac()
1130 RTL_W8(tp, IBISR0, RTL_R8(tp, IBISR0) | 0x20); in rtl8168ep_stop_cmac()
1131 RTL_W8(tp, IBCR0, RTL_R8(tp, IBCR0) & ~0x01); in rtl8168ep_stop_cmac()
1142 r8168ep_ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_START); in rtl8168ep_driver_start()
1143 r8168ep_ocp_write(tp, 0x01, 0x30, r8168ep_ocp_read(tp, 0x30) | 0x01); in rtl8168ep_driver_start()
1164 r8168ep_ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_STOP); in rtl8168ep_driver_stop()
1165 r8168ep_ocp_write(tp, 0x01, 0x30, r8168ep_ocp_read(tp, 0x30) | 0x01); in rtl8168ep_driver_stop()
1186 return r8168ep_ocp_read(tp, 0x128) & BIT(0); in r8168ep_check_dash()
1221 rtl_eri_clear_bits(tp, 0xdc, BIT(0)); in rtl_reset_packet_filter()
1222 rtl_eri_set_bits(tp, 0xdc, BIT(0)); in rtl_reset_packet_filter()
1235 RTL_R32(tp, EFUSEAR) & EFUSEAR_DATA_MASK : ~0; in rtl8168d_efuse_read()
1257 RTL_W32(tp, IntrMask_8125, 0); in rtl_irq_disable()
1259 RTL_W16(tp, IntrMask, 0); in rtl_irq_disable()
1273 rtl_ack_events(tp, 0xffffffff); in rtl8169_irq_mask_and_ack()
1284 rtl_eri_write(tp, 0x1bc, ERIAR_MASK_1111, 0x00000011); in rtl_link_chg_patch()
1285 rtl_eri_write(tp, 0x1dc, ERIAR_MASK_1111, 0x00000005); in rtl_link_chg_patch()
1287 rtl_eri_write(tp, 0x1bc, ERIAR_MASK_1111, 0x0000001f); in rtl_link_chg_patch()
1288 rtl_eri_write(tp, 0x1dc, ERIAR_MASK_1111, 0x00000005); in rtl_link_chg_patch()
1290 rtl_eri_write(tp, 0x1bc, ERIAR_MASK_1111, 0x0000001f); in rtl_link_chg_patch()
1291 rtl_eri_write(tp, 0x1dc, ERIAR_MASK_1111, 0x0000003f); in rtl_link_chg_patch()
1297 rtl_eri_write(tp, 0x1bc, ERIAR_MASK_1111, 0x00000011); in rtl_link_chg_patch()
1298 rtl_eri_write(tp, 0x1dc, ERIAR_MASK_1111, 0x00000005); in rtl_link_chg_patch()
1300 rtl_eri_write(tp, 0x1bc, ERIAR_MASK_1111, 0x0000001f); in rtl_link_chg_patch()
1301 rtl_eri_write(tp, 0x1dc, ERIAR_MASK_1111, 0x0000003f); in rtl_link_chg_patch()
1305 rtl_eri_write(tp, 0x1d0, ERIAR_MASK_0011, 0x4d02); in rtl_link_chg_patch()
1306 rtl_eri_write(tp, 0x1dc, ERIAR_MASK_0011, 0x0060a); in rtl_link_chg_patch()
1308 rtl_eri_write(tp, 0x1d0, ERIAR_MASK_0011, 0x0000); in rtl_link_chg_patch()
1345 rtl_eri_set_bits(tp, 0x0dc, MagicPacket_v2); in __rtl8169_set_wol()
1347 rtl_eri_clear_bits(tp, 0x0dc, MagicPacket_v2); in __rtl8169_set_wol()
1351 r8168_mac_ocp_modify(tp, 0xc0b6, 0, BIT(0)); in __rtl8169_set_wol()
1353 r8168_mac_ocp_modify(tp, 0xc0b6, BIT(0), 0); in __rtl8169_set_wol()
1356 for (i = 0; i < tmp; i++) { in __rtl8169_set_wol()
1388 tp->dev->wol_enabled = wolopts ? 1 : 0; in __rtl8169_set_wol()
1402 return 0; in rtl8169_set_wol()
1481 return 0; in rtl8169_set_features()
1487 TxVlanTag | swab16(skb_vlan_tag_get(skb)) : 0x00; in rtl8169_tx_vlan_tag()
1495 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), swab16(opts2 & 0xffff)); in rtl8169_rx_vlan_tag()
1506 for (i = 0; i < R8169_REGS_SIZE; i += 4) in rtl8169_get_regs()
1559 * is disabled. If 0xff chip may be in a PCI power-save state. in rtl8169_update_counters()
1561 if (val & CmdRxEnb && val != 0xff) in rtl8169_update_counters()
1609 data[0] = le64_to_cpu(counters->tx_packets); in rtl8169_get_ethtool_stats()
1636 * > 1 - the availability of the IntrMitigate (0xe2) register through the
1644 * (0xe0) bit 1 and bit 0.
1647 * bit[1:0] \ speed 1000M 100M 10M
1648 * 0 0 320ns 2.56us 40.96us
1649 * 0 1 2.56us 20.48us 327.7us
1650 * 1 0 5.12us 40.96us 655.4us
1654 * bit[1:0] \ speed 1000M 100M 10M
1655 * 0 0 5us 2.56us 40.96us
1656 * 0 1 40us 20.48us 327.7us
1657 * 1 0 80us 40.96us 655.4us
1661 /* rx/tx scale factors for all CPlusCmd[0:1] cases */
1674 { 0 },
1681 { 0 },
1721 memset(ec, 0, sizeof(*ec)); in rtl_get_coalesce()
1723 /* get rx/tx scale corresponding to current speed and CPlusCmd[0:1] */ in rtl_get_coalesce()
1736 /* ethtool_coalesce states usecs and max_frames must not both be 0 */ in rtl_get_coalesce()
1745 return 0; in rtl_get_coalesce()
1748 /* choose appropriate scale factor and CPlusCmd[0:1] for (speed, usec) */
1759 for (i = 0; i < 4; i++) { in rtl_coalesce_choose_scale()
1778 u16 w = 0, cp01 = 0; in rtl_set_coalesce()
1789 if (scale < 0) in rtl_set_coalesce()
1793 * not only when usecs=0 because of e.g. the following scenario: in rtl_set_coalesce()
1795 * - both rx_usecs=0 & rx_frames=0 in hardware (no delay on RX) in rtl_set_coalesce()
1796 * - rtl_get_coalesce returns rx_usecs=0, rx_frames=1 in rtl_set_coalesce()
1800 * if we want to ignore rx_frames then it has to be set to 0. in rtl_set_coalesce()
1803 rx_fr = 0; in rtl_set_coalesce()
1805 tx_fr = 0; in rtl_set_coalesce()
1835 return 0; in rtl_set_coalesce()
1884 data->tx_pause = tx_pause ? 1 : 0; in rtl8169_get_pauseparam()
1885 data->rx_pause = rx_pause ? 1 : 0; in rtl8169_get_pauseparam()
1898 return 0; in rtl8169_set_pauseparam()
1932 if (tp->eee_adv >= 0) in rtl_enable_eee()
1937 if (adv >= 0) in rtl_enable_eee()
1948 * (RTL_R32(tp, TxConfig) & 0x700000) == 0x500000 ? 8168Bf : 8168Be in rtl8169_get_mac_version()
1952 * (RTL_R32(tp, TxConfig) & 0x700000) == 0x200000 ? 8101Eb : 8101Ec in rtl8169_get_mac_version()
1960 { 0x7cf, 0x641, RTL_GIGA_MAC_VER_63 }, in rtl8169_get_mac_version()
1963 { 0x7cf, 0x609, RTL_GIGA_MAC_VER_61 }, in rtl8169_get_mac_version()
1965 * { 0x7cf, 0x608, RTL_GIGA_MAC_VER_60 }, in rtl8169_get_mac_version()
1966 * { 0x7c8, 0x608, RTL_GIGA_MAC_VER_61 }, in rtl8169_get_mac_version()
1970 { 0x7cf, 0x54b, RTL_GIGA_MAC_VER_53 }, in rtl8169_get_mac_version()
1971 { 0x7cf, 0x54a, RTL_GIGA_MAC_VER_52 }, in rtl8169_get_mac_version()
1974 { 0x7cf, 0x502, RTL_GIGA_MAC_VER_51 }, in rtl8169_get_mac_version()
1977 * { 0x7cf, 0x501, RTL_GIGA_MAC_VER_50 }, in rtl8169_get_mac_version()
1978 * { 0x7cf, 0x500, RTL_GIGA_MAC_VER_49 }, in rtl8169_get_mac_version()
1982 { 0x7cf, 0x541, RTL_GIGA_MAC_VER_46 }, in rtl8169_get_mac_version()
1985 * { 0x7cf, 0x540, RTL_GIGA_MAC_VER_45 }, in rtl8169_get_mac_version()
1989 { 0x7cf, 0x5c8, RTL_GIGA_MAC_VER_44 }, in rtl8169_get_mac_version()
1990 { 0x7cf, 0x509, RTL_GIGA_MAC_VER_42 }, in rtl8169_get_mac_version()
1993 * { 0x7cf, 0x4c1, RTL_GIGA_MAC_VER_41 }, in rtl8169_get_mac_version()
1995 { 0x7cf, 0x4c0, RTL_GIGA_MAC_VER_40 }, in rtl8169_get_mac_version()
1998 { 0x7c8, 0x488, RTL_GIGA_MAC_VER_38 }, in rtl8169_get_mac_version()
2001 * { 0x7cf, 0x481, RTL_GIGA_MAC_VER_36 }, in rtl8169_get_mac_version()
2003 { 0x7cf, 0x480, RTL_GIGA_MAC_VER_35 }, in rtl8169_get_mac_version()
2006 { 0x7c8, 0x2c8, RTL_GIGA_MAC_VER_34 }, in rtl8169_get_mac_version()
2007 { 0x7cf, 0x2c1, RTL_GIGA_MAC_VER_32 }, in rtl8169_get_mac_version()
2008 { 0x7c8, 0x2c0, RTL_GIGA_MAC_VER_33 }, in rtl8169_get_mac_version()
2011 { 0x7cf, 0x281, RTL_GIGA_MAC_VER_25 }, in rtl8169_get_mac_version()
2012 { 0x7c8, 0x280, RTL_GIGA_MAC_VER_26 }, in rtl8169_get_mac_version()
2017 * { 0x7cf, 0x288, RTL_GIGA_MAC_VER_27 }, in rtl8169_get_mac_version()
2019 { 0x7cf, 0x28a, RTL_GIGA_MAC_VER_28 }, in rtl8169_get_mac_version()
2020 { 0x7cf, 0x28b, RTL_GIGA_MAC_VER_31 }, in rtl8169_get_mac_version()
2023 { 0x7cf, 0x3c9, RTL_GIGA_MAC_VER_23 }, in rtl8169_get_mac_version()
2024 { 0x7cf, 0x3c8, RTL_GIGA_MAC_VER_18 }, in rtl8169_get_mac_version()
2025 { 0x7c8, 0x3c8, RTL_GIGA_MAC_VER_24 }, in rtl8169_get_mac_version()
2026 { 0x7cf, 0x3c0, RTL_GIGA_MAC_VER_19 }, in rtl8169_get_mac_version()
2027 { 0x7cf, 0x3c2, RTL_GIGA_MAC_VER_20 }, in rtl8169_get_mac_version()
2028 { 0x7cf, 0x3c3, RTL_GIGA_MAC_VER_21 }, in rtl8169_get_mac_version()
2029 { 0x7c8, 0x3c0, RTL_GIGA_MAC_VER_22 }, in rtl8169_get_mac_version()
2032 { 0x7c8, 0x380, RTL_GIGA_MAC_VER_17 }, in rtl8169_get_mac_version()
2033 { 0x7c8, 0x300, RTL_GIGA_MAC_VER_11 }, in rtl8169_get_mac_version()
2036 { 0x7c8, 0x448, RTL_GIGA_MAC_VER_39 }, in rtl8169_get_mac_version()
2037 { 0x7c8, 0x440, RTL_GIGA_MAC_VER_37 }, in rtl8169_get_mac_version()
2038 { 0x7cf, 0x409, RTL_GIGA_MAC_VER_29 }, in rtl8169_get_mac_version()
2039 { 0x7c8, 0x408, RTL_GIGA_MAC_VER_30 }, in rtl8169_get_mac_version()
2040 { 0x7cf, 0x349, RTL_GIGA_MAC_VER_08 }, in rtl8169_get_mac_version()
2041 { 0x7cf, 0x249, RTL_GIGA_MAC_VER_08 }, in rtl8169_get_mac_version()
2042 { 0x7cf, 0x348, RTL_GIGA_MAC_VER_07 }, in rtl8169_get_mac_version()
2043 { 0x7cf, 0x248, RTL_GIGA_MAC_VER_07 }, in rtl8169_get_mac_version()
2044 { 0x7cf, 0x240, RTL_GIGA_MAC_VER_14 }, in rtl8169_get_mac_version()
2045 { 0x7c8, 0x348, RTL_GIGA_MAC_VER_09 }, in rtl8169_get_mac_version()
2046 { 0x7c8, 0x248, RTL_GIGA_MAC_VER_09 }, in rtl8169_get_mac_version()
2047 { 0x7c8, 0x340, RTL_GIGA_MAC_VER_10 }, in rtl8169_get_mac_version()
2050 { 0xfc8, 0x980, RTL_GIGA_MAC_VER_06 }, in rtl8169_get_mac_version()
2051 { 0xfc8, 0x180, RTL_GIGA_MAC_VER_05 }, in rtl8169_get_mac_version()
2052 { 0xfc8, 0x100, RTL_GIGA_MAC_VER_04 }, in rtl8169_get_mac_version()
2053 { 0xfc8, 0x040, RTL_GIGA_MAC_VER_03 }, in rtl8169_get_mac_version()
2054 { 0xfc8, 0x008, RTL_GIGA_MAC_VER_02 }, in rtl8169_get_mac_version()
2057 { 0x000, 0x000, RTL_GIGA_MAC_NONE } in rtl8169_get_mac_version()
2106 RTL_W8(tp, EEE_LED, RTL_R8(tp, EEE_LED) & ~0x07); in rtl8168_config_eee_mac()
2108 rtl_eri_set_bits(tp, 0x1b0, 0x0003); in rtl8168_config_eee_mac()
2113 r8168_mac_ocp_modify(tp, 0xe040, 0, BIT(1) | BIT(0)); in rtl8125a_config_eee_mac()
2114 r8168_mac_ocp_modify(tp, 0xeb62, 0, BIT(2) | BIT(1)); in rtl8125a_config_eee_mac()
2119 RTL_W16(tp, EEE_TXIDLE_TIMER_8125, tp->dev->mtu + ETH_HLEN + 0x20); in rtl8125_set_eee_txidle_timer()
2125 r8168_mac_ocp_modify(tp, 0xe040, 0, BIT(1) | BIT(0)); in rtl8125b_config_eee_mac()
2130 rtl_eri_write(tp, 0xe0, ERIAR_MASK_1111, get_unaligned_le32(addr)); in rtl_rar_exgmac_set()
2131 rtl_eri_write(tp, 0xe4, ERIAR_MASK_1111, get_unaligned_le16(addr + 4)); in rtl_rar_exgmac_set()
2132 rtl_eri_write(tp, 0xf0, ERIAR_MASK_1111, get_unaligned_le16(addr) << 16); in rtl_rar_exgmac_set()
2133 rtl_eri_write(tp, 0xf4, ERIAR_MASK_1111, get_unaligned_le32(addr + 2)); in rtl_rar_exgmac_set()
2140 r8168_mac_ocp_write(tp, 0xdd02, 0x807d); in rtl8168h_2_get_adc_bias_ioffset()
2141 data1 = r8168_mac_ocp_read(tp, 0xdd02); in rtl8168h_2_get_adc_bias_ioffset()
2142 data2 = r8168_mac_ocp_read(tp, 0xdd00); in rtl8168h_2_get_adc_bias_ioffset()
2144 ioffset = (data2 >> 1) & 0x7ff8; in rtl8168h_2_get_adc_bias_ioffset()
2145 ioffset |= data2 & 0x0007; in rtl8168h_2_get_adc_bias_ioffset()
2163 pci_write_config_byte(tp->pci_dev, PCI_LATENCY_TIMER, 0x40); in rtl8169_init_phy()
2164 pci_write_config_byte(tp->pci_dev, PCI_CACHE_LINE_SIZE, 0x08); in rtl8169_init_phy()
2165 /* set undocumented MAC Reg C+CR Offset 0x82h */ in rtl8169_init_phy()
2166 RTL_W8(tp, 0x82, 0x01); in rtl8169_init_phy()
2171 tp->pci_dev->subsystem_device == 0xe000) in rtl8169_init_phy()
2172 phy_write_paged(tp->phydev, 0x0001, 0x10, 0xf01b); in rtl8169_init_phy()
2210 return 0; in rtl_set_mac_address()
2227 rtl_ephy_write(tp, 0x19, 0xff64); in rtl_prepare_power_down()
2261 tp->dirty_tx = tp->cur_tx = tp->cur_rx = 0; in rtl8169_init_ring_indexes()
2288 RTL_W8(tp, MaxTxPacketSize, 0x24); in r8168e_hw_jumbo_enable()
2290 RTL_W8(tp, Config4, RTL_R8(tp, Config4) | 0x01); in r8168e_hw_jumbo_enable()
2295 RTL_W8(tp, MaxTxPacketSize, 0x3f); in r8168e_hw_jumbo_disable()
2297 RTL_W8(tp, Config4, RTL_R8(tp, Config4) & ~0x01); in r8168e_hw_jumbo_disable()
2302 RTL_W8(tp, Config4, RTL_R8(tp, Config4) | (1 << 0)); in r8168b_1_hw_jumbo_enable()
2307 RTL_W8(tp, Config4, RTL_R8(tp, Config4) & ~(1 << 0)); in r8168b_1_hw_jumbo_disable()
2423 return (RTL_R16(tp, IntrMitigate) & 0x0103) == 0x0103; in DECLARE_RTL_COND()
2493 val = 0x000fff00; in rtl8169_set_magic_reg()
2495 val = 0x00ffff00; in rtl8169_set_magic_reg()
2500 val |= 0xff; in rtl8169_set_magic_reg()
2502 RTL_W32(tp, 0x7c, val); in rtl8169_set_magic_reg()
2509 u32 mc_filter[2] = { 0xffffffff, 0xffffffff }; in rtl_set_rx_mode()
2524 mc_filter[1] = mc_filter[0] = 0; in rtl_set_rx_mode()
2531 tmp = mc_filter[0]; in rtl_set_rx_mode()
2532 mc_filter[0] = swab32(mc_filter[1]); in rtl_set_rx_mode()
2538 RTL_W32(tp, MAR0 + 0, mc_filter[0]); in rtl_set_rx_mode()
2568 RTL_R32(tp, CSIDR) : ~0; in rtl_csi_read()
2576 /* According to Realtek the value at config space address 0x070f in rtl_set_aspm_entry_latency()
2579 * bit 0..2: L0: 0 = 1us, 1 = 2us .. 6 = 7us, 7 = 7us (no typo) in rtl_set_aspm_entry_latency()
2580 * bit 3..5: L1: 0 = 1us, 1 = 2us .. 6 = 64us, 7 = 64us in rtl_set_aspm_entry_latency()
2582 if (pdev->cfg_size > 0x070f && in rtl_set_aspm_entry_latency()
2583 pci_write_config_byte(pdev, 0x070f, val) == PCIBIOS_SUCCESSFUL) in rtl_set_aspm_entry_latency()
2588 csi = rtl_csi_read(tp, 0x070c) & 0x00ffffff; in rtl_set_aspm_entry_latency()
2589 rtl_csi_write(tp, 0x070c, csi | val << 24); in rtl_set_aspm_entry_latency()
2595 rtl_set_aspm_entry_latency(tp, 0x27); in rtl_set_def_aspm_entry_latency()
2609 while (len-- > 0) { in __rtl_ephy_init()
2648 rtl_eri_set_bits(tp, 0xd4, 0x1f00); in rtl_enable_exit_l1()
2651 rtl_eri_set_bits(tp, 0xd4, 0x0c00); in rtl_enable_exit_l1()
2654 r8168_mac_ocp_modify(tp, 0xc0ac, 0, 0x1f80); in rtl_enable_exit_l1()
2665 rtl_eri_clear_bits(tp, 0xd4, 0x1f00); in rtl_disable_exit_l1()
2668 r8168_mac_ocp_modify(tp, 0xc0ac, 0x1f80, 0); in rtl_disable_exit_l1()
2686 r8168_mac_ocp_modify(tp, 0xe094, 0xff00, 0); in rtl_hw_aspm_clkreq_enable()
2688 r8168_mac_ocp_modify(tp, 0xe092, 0x00ff, BIT(2)); in rtl_hw_aspm_clkreq_enable()
2697 r8168_mac_ocp_modify(tp, 0xe092, 0x00ff, 0); in rtl_hw_aspm_clkreq_enable()
2716 rtl_eri_write(tp, 0xc8, ERIAR_MASK_1111, (rx_stat << 16) | rx_dyn); in rtl_set_fifo_size()
2717 rtl_eri_write(tp, 0xe8, ERIAR_MASK_1111, (tx_stat << 16) | tx_dyn); in rtl_set_fifo_size()
2724 rtl_eri_write(tp, 0xcc, ERIAR_MASK_0001, low); in rtl8168g_set_pause_thresholds()
2725 rtl_eri_write(tp, 0xd0, ERIAR_MASK_0001, high); in rtl8168g_set_pause_thresholds()
2745 { 0x01, 0, 0x0001 }, in rtl_hw_start_8168cp_1()
2746 { 0x02, 0x0800, 0x1000 }, in rtl_hw_start_8168cp_1()
2747 { 0x03, 0, 0x0042 }, in rtl_hw_start_8168cp_1()
2748 { 0x06, 0x0080, 0x0000 }, in rtl_hw_start_8168cp_1()
2749 { 0x07, 0, 0x2000 } in rtl_hw_start_8168cp_1()
2773 RTL_W8(tp, DBG_REG, 0x20); in rtl_hw_start_8168cp_3()
2779 { 0x02, 0x0800, 0x1000 }, in rtl_hw_start_8168c_1()
2780 { 0x03, 0, 0x0002 }, in rtl_hw_start_8168c_1()
2781 { 0x06, 0x0080, 0x0000 } in rtl_hw_start_8168c_1()
2786 RTL_W8(tp, DBG_REG, 0x06 | FIX_NAK_1 | FIX_NAK_2); in rtl_hw_start_8168c_1()
2796 { 0x01, 0, 0x0001 }, in rtl_hw_start_8168c_2()
2797 { 0x03, 0x0400, 0x0020 } in rtl_hw_start_8168c_2()
2824 { 0x0b, 0x0000, 0x0048 }, in rtl_hw_start_8168d_4()
2825 { 0x19, 0x0020, 0x0050 }, in rtl_hw_start_8168d_4()
2826 { 0x0c, 0x0100, 0x0020 }, in rtl_hw_start_8168d_4()
2827 { 0x10, 0x0004, 0x0000 }, in rtl_hw_start_8168d_4()
2840 { 0x00, 0x0200, 0x0100 }, in rtl_hw_start_8168e_1()
2841 { 0x00, 0x0000, 0x0004 }, in rtl_hw_start_8168e_1()
2842 { 0x06, 0x0002, 0x0001 }, in rtl_hw_start_8168e_1()
2843 { 0x06, 0x0000, 0x0030 }, in rtl_hw_start_8168e_1()
2844 { 0x07, 0x0000, 0x2000 }, in rtl_hw_start_8168e_1()
2845 { 0x00, 0x0000, 0x0020 }, in rtl_hw_start_8168e_1()
2846 { 0x03, 0x5800, 0x2000 }, in rtl_hw_start_8168e_1()
2847 { 0x03, 0x0000, 0x0001 }, in rtl_hw_start_8168e_1()
2848 { 0x01, 0x0800, 0x1000 }, in rtl_hw_start_8168e_1()
2849 { 0x07, 0x0000, 0x4000 }, in rtl_hw_start_8168e_1()
2850 { 0x1e, 0x0000, 0x2000 }, in rtl_hw_start_8168e_1()
2851 { 0x19, 0xffff, 0xfe6c }, in rtl_hw_start_8168e_1()
2852 { 0x0a, 0x0000, 0x0040 } in rtl_hw_start_8168e_1()
2871 { 0x09, 0x0000, 0x0080 }, in rtl_hw_start_8168e_2()
2872 { 0x19, 0x0000, 0x0224 }, in rtl_hw_start_8168e_2()
2873 { 0x00, 0x0000, 0x0004 }, in rtl_hw_start_8168e_2()
2874 { 0x0c, 0x3df0, 0x0200 }, in rtl_hw_start_8168e_2()
2881 rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8168e_2()
2882 rtl_eri_write(tp, 0xb8, ERIAR_MASK_1111, 0x0000); in rtl_hw_start_8168e_2()
2883 rtl_set_fifo_size(tp, 0x10, 0x10, 0x02, 0x06); in rtl_hw_start_8168e_2()
2884 rtl_eri_set_bits(tp, 0x1d0, BIT(1)); in rtl_hw_start_8168e_2()
2886 rtl_eri_set_bits(tp, 0x1b0, BIT(4)); in rtl_hw_start_8168e_2()
2887 rtl_eri_write(tp, 0xcc, ERIAR_MASK_1111, 0x00000050); in rtl_hw_start_8168e_2()
2888 rtl_eri_write(tp, 0xd0, ERIAR_MASK_1111, 0x07ff0060); in rtl_hw_start_8168e_2()
2907 rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8168f()
2908 rtl_eri_write(tp, 0xb8, ERIAR_MASK_1111, 0x0000); in rtl_hw_start_8168f()
2909 rtl_set_fifo_size(tp, 0x10, 0x10, 0x02, 0x06); in rtl_hw_start_8168f()
2911 rtl_eri_set_bits(tp, 0x1b0, BIT(4)); in rtl_hw_start_8168f()
2912 rtl_eri_set_bits(tp, 0x1d0, BIT(4) | BIT(1)); in rtl_hw_start_8168f()
2913 rtl_eri_write(tp, 0xcc, ERIAR_MASK_1111, 0x00000050); in rtl_hw_start_8168f()
2914 rtl_eri_write(tp, 0xd0, ERIAR_MASK_1111, 0x00000060); in rtl_hw_start_8168f()
2929 { 0x06, 0x00c0, 0x0020 }, in rtl_hw_start_8168f_1()
2930 { 0x08, 0x0001, 0x0002 }, in rtl_hw_start_8168f_1()
2931 { 0x09, 0x0000, 0x0080 }, in rtl_hw_start_8168f_1()
2932 { 0x19, 0x0000, 0x0224 }, in rtl_hw_start_8168f_1()
2933 { 0x00, 0x0000, 0x0008 }, in rtl_hw_start_8168f_1()
2934 { 0x0c, 0x3df0, 0x0200 }, in rtl_hw_start_8168f_1()
2945 { 0x06, 0x00c0, 0x0020 }, in rtl_hw_start_8411()
2946 { 0x0f, 0xffff, 0x5200 }, in rtl_hw_start_8411()
2947 { 0x19, 0x0000, 0x0224 }, in rtl_hw_start_8411()
2948 { 0x00, 0x0000, 0x0008 }, in rtl_hw_start_8411()
2949 { 0x0c, 0x3df0, 0x0200 }, in rtl_hw_start_8411()
2960 rtl_set_fifo_size(tp, 0x08, 0x10, 0x02, 0x06); in rtl_hw_start_8168g()
2961 rtl8168g_set_pause_thresholds(tp, 0x38, 0x48); in rtl_hw_start_8168g()
2966 rtl_eri_write(tp, 0x2f8, ERIAR_MASK_0011, 0x1d8f); in rtl_hw_start_8168g()
2970 rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8168g()
2971 rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8168g()
2975 rtl_w0w1_eri(tp, 0x2fc, 0x01, 0x06); in rtl_hw_start_8168g()
2976 rtl_eri_clear_bits(tp, 0x1b0, BIT(12)); in rtl_hw_start_8168g()
2984 { 0x00, 0x0008, 0x0000 }, in rtl_hw_start_8168g_1()
2985 { 0x0c, 0x3ff0, 0x0820 }, in rtl_hw_start_8168g_1()
2986 { 0x1e, 0x0000, 0x0001 }, in rtl_hw_start_8168g_1()
2987 { 0x19, 0x8000, 0x0000 } in rtl_hw_start_8168g_1()
3001 { 0x00, 0x0008, 0x0000 }, in rtl_hw_start_8168g_2()
3002 { 0x0c, 0x3ff0, 0x0820 }, in rtl_hw_start_8168g_2()
3003 { 0x19, 0xffff, 0x7c00 }, in rtl_hw_start_8168g_2()
3004 { 0x1e, 0xffff, 0x20eb }, in rtl_hw_start_8168g_2()
3005 { 0x0d, 0xffff, 0x1666 }, in rtl_hw_start_8168g_2()
3006 { 0x00, 0xffff, 0x10a3 }, in rtl_hw_start_8168g_2()
3007 { 0x06, 0xffff, 0xf050 }, in rtl_hw_start_8168g_2()
3008 { 0x04, 0x0000, 0x0010 }, in rtl_hw_start_8168g_2()
3009 { 0x1d, 0x4000, 0x0000 }, in rtl_hw_start_8168g_2()
3022 { 0x00, 0x0008, 0x0000 }, in rtl_hw_start_8411_2()
3023 { 0x0c, 0x37d0, 0x0820 }, in rtl_hw_start_8411_2()
3024 { 0x1e, 0x0000, 0x0001 }, in rtl_hw_start_8411_2()
3025 { 0x19, 0x8021, 0x0000 }, in rtl_hw_start_8411_2()
3026 { 0x1e, 0x0000, 0x2000 }, in rtl_hw_start_8411_2()
3027 { 0x0d, 0x0100, 0x0200 }, in rtl_hw_start_8411_2()
3028 { 0x00, 0x0000, 0x0080 }, in rtl_hw_start_8411_2()
3029 { 0x06, 0x0000, 0x0010 }, in rtl_hw_start_8411_2()
3030 { 0x04, 0x0000, 0x0010 }, in rtl_hw_start_8411_2()
3031 { 0x1d, 0x0000, 0x4000 }, in rtl_hw_start_8411_2()
3043 r8168_mac_ocp_write(tp, 0xFC28, 0x0000); in rtl_hw_start_8411_2()
3044 r8168_mac_ocp_write(tp, 0xFC2A, 0x0000); in rtl_hw_start_8411_2()
3045 r8168_mac_ocp_write(tp, 0xFC2C, 0x0000); in rtl_hw_start_8411_2()
3046 r8168_mac_ocp_write(tp, 0xFC2E, 0x0000); in rtl_hw_start_8411_2()
3047 r8168_mac_ocp_write(tp, 0xFC30, 0x0000); in rtl_hw_start_8411_2()
3048 r8168_mac_ocp_write(tp, 0xFC32, 0x0000); in rtl_hw_start_8411_2()
3049 r8168_mac_ocp_write(tp, 0xFC34, 0x0000); in rtl_hw_start_8411_2()
3050 r8168_mac_ocp_write(tp, 0xFC36, 0x0000); in rtl_hw_start_8411_2()
3052 r8168_mac_ocp_write(tp, 0xFC26, 0x0000); in rtl_hw_start_8411_2()
3054 r8168_mac_ocp_write(tp, 0xF800, 0xE008); in rtl_hw_start_8411_2()
3055 r8168_mac_ocp_write(tp, 0xF802, 0xE00A); in rtl_hw_start_8411_2()
3056 r8168_mac_ocp_write(tp, 0xF804, 0xE00C); in rtl_hw_start_8411_2()
3057 r8168_mac_ocp_write(tp, 0xF806, 0xE00E); in rtl_hw_start_8411_2()
3058 r8168_mac_ocp_write(tp, 0xF808, 0xE027); in rtl_hw_start_8411_2()
3059 r8168_mac_ocp_write(tp, 0xF80A, 0xE04F); in rtl_hw_start_8411_2()
3060 r8168_mac_ocp_write(tp, 0xF80C, 0xE05E); in rtl_hw_start_8411_2()
3061 r8168_mac_ocp_write(tp, 0xF80E, 0xE065); in rtl_hw_start_8411_2()
3062 r8168_mac_ocp_write(tp, 0xF810, 0xC602); in rtl_hw_start_8411_2()
3063 r8168_mac_ocp_write(tp, 0xF812, 0xBE00); in rtl_hw_start_8411_2()
3064 r8168_mac_ocp_write(tp, 0xF814, 0x0000); in rtl_hw_start_8411_2()
3065 r8168_mac_ocp_write(tp, 0xF816, 0xC502); in rtl_hw_start_8411_2()
3066 r8168_mac_ocp_write(tp, 0xF818, 0xBD00); in rtl_hw_start_8411_2()
3067 r8168_mac_ocp_write(tp, 0xF81A, 0x074C); in rtl_hw_start_8411_2()
3068 r8168_mac_ocp_write(tp, 0xF81C, 0xC302); in rtl_hw_start_8411_2()
3069 r8168_mac_ocp_write(tp, 0xF81E, 0xBB00); in rtl_hw_start_8411_2()
3070 r8168_mac_ocp_write(tp, 0xF820, 0x080A); in rtl_hw_start_8411_2()
3071 r8168_mac_ocp_write(tp, 0xF822, 0x6420); in rtl_hw_start_8411_2()
3072 r8168_mac_ocp_write(tp, 0xF824, 0x48C2); in rtl_hw_start_8411_2()
3073 r8168_mac_ocp_write(tp, 0xF826, 0x8C20); in rtl_hw_start_8411_2()
3074 r8168_mac_ocp_write(tp, 0xF828, 0xC516); in rtl_hw_start_8411_2()
3075 r8168_mac_ocp_write(tp, 0xF82A, 0x64A4); in rtl_hw_start_8411_2()
3076 r8168_mac_ocp_write(tp, 0xF82C, 0x49C0); in rtl_hw_start_8411_2()
3077 r8168_mac_ocp_write(tp, 0xF82E, 0xF009); in rtl_hw_start_8411_2()
3078 r8168_mac_ocp_write(tp, 0xF830, 0x74A2); in rtl_hw_start_8411_2()
3079 r8168_mac_ocp_write(tp, 0xF832, 0x8CA5); in rtl_hw_start_8411_2()
3080 r8168_mac_ocp_write(tp, 0xF834, 0x74A0); in rtl_hw_start_8411_2()
3081 r8168_mac_ocp_write(tp, 0xF836, 0xC50E); in rtl_hw_start_8411_2()
3082 r8168_mac_ocp_write(tp, 0xF838, 0x9CA2); in rtl_hw_start_8411_2()
3083 r8168_mac_ocp_write(tp, 0xF83A, 0x1C11); in rtl_hw_start_8411_2()
3084 r8168_mac_ocp_write(tp, 0xF83C, 0x9CA0); in rtl_hw_start_8411_2()
3085 r8168_mac_ocp_write(tp, 0xF83E, 0xE006); in rtl_hw_start_8411_2()
3086 r8168_mac_ocp_write(tp, 0xF840, 0x74F8); in rtl_hw_start_8411_2()
3087 r8168_mac_ocp_write(tp, 0xF842, 0x48C4); in rtl_hw_start_8411_2()
3088 r8168_mac_ocp_write(tp, 0xF844, 0x8CF8); in rtl_hw_start_8411_2()
3089 r8168_mac_ocp_write(tp, 0xF846, 0xC404); in rtl_hw_start_8411_2()
3090 r8168_mac_ocp_write(tp, 0xF848, 0xBC00); in rtl_hw_start_8411_2()
3091 r8168_mac_ocp_write(tp, 0xF84A, 0xC403); in rtl_hw_start_8411_2()
3092 r8168_mac_ocp_write(tp, 0xF84C, 0xBC00); in rtl_hw_start_8411_2()
3093 r8168_mac_ocp_write(tp, 0xF84E, 0x0BF2); in rtl_hw_start_8411_2()
3094 r8168_mac_ocp_write(tp, 0xF850, 0x0C0A); in rtl_hw_start_8411_2()
3095 r8168_mac_ocp_write(tp, 0xF852, 0xE434); in rtl_hw_start_8411_2()
3096 r8168_mac_ocp_write(tp, 0xF854, 0xD3C0); in rtl_hw_start_8411_2()
3097 r8168_mac_ocp_write(tp, 0xF856, 0x49D9); in rtl_hw_start_8411_2()
3098 r8168_mac_ocp_write(tp, 0xF858, 0xF01F); in rtl_hw_start_8411_2()
3099 r8168_mac_ocp_write(tp, 0xF85A, 0xC526); in rtl_hw_start_8411_2()
3100 r8168_mac_ocp_write(tp, 0xF85C, 0x64A5); in rtl_hw_start_8411_2()
3101 r8168_mac_ocp_write(tp, 0xF85E, 0x1400); in rtl_hw_start_8411_2()
3102 r8168_mac_ocp_write(tp, 0xF860, 0xF007); in rtl_hw_start_8411_2()
3103 r8168_mac_ocp_write(tp, 0xF862, 0x0C01); in rtl_hw_start_8411_2()
3104 r8168_mac_ocp_write(tp, 0xF864, 0x8CA5); in rtl_hw_start_8411_2()
3105 r8168_mac_ocp_write(tp, 0xF866, 0x1C15); in rtl_hw_start_8411_2()
3106 r8168_mac_ocp_write(tp, 0xF868, 0xC51B); in rtl_hw_start_8411_2()
3107 r8168_mac_ocp_write(tp, 0xF86A, 0x9CA0); in rtl_hw_start_8411_2()
3108 r8168_mac_ocp_write(tp, 0xF86C, 0xE013); in rtl_hw_start_8411_2()
3109 r8168_mac_ocp_write(tp, 0xF86E, 0xC519); in rtl_hw_start_8411_2()
3110 r8168_mac_ocp_write(tp, 0xF870, 0x74A0); in rtl_hw_start_8411_2()
3111 r8168_mac_ocp_write(tp, 0xF872, 0x48C4); in rtl_hw_start_8411_2()
3112 r8168_mac_ocp_write(tp, 0xF874, 0x8CA0); in rtl_hw_start_8411_2()
3113 r8168_mac_ocp_write(tp, 0xF876, 0xC516); in rtl_hw_start_8411_2()
3114 r8168_mac_ocp_write(tp, 0xF878, 0x74A4); in rtl_hw_start_8411_2()
3115 r8168_mac_ocp_write(tp, 0xF87A, 0x48C8); in rtl_hw_start_8411_2()
3116 r8168_mac_ocp_write(tp, 0xF87C, 0x48CA); in rtl_hw_start_8411_2()
3117 r8168_mac_ocp_write(tp, 0xF87E, 0x9CA4); in rtl_hw_start_8411_2()
3118 r8168_mac_ocp_write(tp, 0xF880, 0xC512); in rtl_hw_start_8411_2()
3119 r8168_mac_ocp_write(tp, 0xF882, 0x1B00); in rtl_hw_start_8411_2()
3120 r8168_mac_ocp_write(tp, 0xF884, 0x9BA0); in rtl_hw_start_8411_2()
3121 r8168_mac_ocp_write(tp, 0xF886, 0x1B1C); in rtl_hw_start_8411_2()
3122 r8168_mac_ocp_write(tp, 0xF888, 0x483F); in rtl_hw_start_8411_2()
3123 r8168_mac_ocp_write(tp, 0xF88A, 0x9BA2); in rtl_hw_start_8411_2()
3124 r8168_mac_ocp_write(tp, 0xF88C, 0x1B04); in rtl_hw_start_8411_2()
3125 r8168_mac_ocp_write(tp, 0xF88E, 0xC508); in rtl_hw_start_8411_2()
3126 r8168_mac_ocp_write(tp, 0xF890, 0x9BA0); in rtl_hw_start_8411_2()
3127 r8168_mac_ocp_write(tp, 0xF892, 0xC505); in rtl_hw_start_8411_2()
3128 r8168_mac_ocp_write(tp, 0xF894, 0xBD00); in rtl_hw_start_8411_2()
3129 r8168_mac_ocp_write(tp, 0xF896, 0xC502); in rtl_hw_start_8411_2()
3130 r8168_mac_ocp_write(tp, 0xF898, 0xBD00); in rtl_hw_start_8411_2()
3131 r8168_mac_ocp_write(tp, 0xF89A, 0x0300); in rtl_hw_start_8411_2()
3132 r8168_mac_ocp_write(tp, 0xF89C, 0x051E); in rtl_hw_start_8411_2()
3133 r8168_mac_ocp_write(tp, 0xF89E, 0xE434); in rtl_hw_start_8411_2()
3134 r8168_mac_ocp_write(tp, 0xF8A0, 0xE018); in rtl_hw_start_8411_2()
3135 r8168_mac_ocp_write(tp, 0xF8A2, 0xE092); in rtl_hw_start_8411_2()
3136 r8168_mac_ocp_write(tp, 0xF8A4, 0xDE20); in rtl_hw_start_8411_2()
3137 r8168_mac_ocp_write(tp, 0xF8A6, 0xD3C0); in rtl_hw_start_8411_2()
3138 r8168_mac_ocp_write(tp, 0xF8A8, 0xC50F); in rtl_hw_start_8411_2()
3139 r8168_mac_ocp_write(tp, 0xF8AA, 0x76A4); in rtl_hw_start_8411_2()
3140 r8168_mac_ocp_write(tp, 0xF8AC, 0x49E3); in rtl_hw_start_8411_2()
3141 r8168_mac_ocp_write(tp, 0xF8AE, 0xF007); in rtl_hw_start_8411_2()
3142 r8168_mac_ocp_write(tp, 0xF8B0, 0x49C0); in rtl_hw_start_8411_2()
3143 r8168_mac_ocp_write(tp, 0xF8B2, 0xF103); in rtl_hw_start_8411_2()
3144 r8168_mac_ocp_write(tp, 0xF8B4, 0xC607); in rtl_hw_start_8411_2()
3145 r8168_mac_ocp_write(tp, 0xF8B6, 0xBE00); in rtl_hw_start_8411_2()
3146 r8168_mac_ocp_write(tp, 0xF8B8, 0xC606); in rtl_hw_start_8411_2()
3147 r8168_mac_ocp_write(tp, 0xF8BA, 0xBE00); in rtl_hw_start_8411_2()
3148 r8168_mac_ocp_write(tp, 0xF8BC, 0xC602); in rtl_hw_start_8411_2()
3149 r8168_mac_ocp_write(tp, 0xF8BE, 0xBE00); in rtl_hw_start_8411_2()
3150 r8168_mac_ocp_write(tp, 0xF8C0, 0x0C4C); in rtl_hw_start_8411_2()
3151 r8168_mac_ocp_write(tp, 0xF8C2, 0x0C28); in rtl_hw_start_8411_2()
3152 r8168_mac_ocp_write(tp, 0xF8C4, 0x0C2C); in rtl_hw_start_8411_2()
3153 r8168_mac_ocp_write(tp, 0xF8C6, 0xDC00); in rtl_hw_start_8411_2()
3154 r8168_mac_ocp_write(tp, 0xF8C8, 0xC707); in rtl_hw_start_8411_2()
3155 r8168_mac_ocp_write(tp, 0xF8CA, 0x1D00); in rtl_hw_start_8411_2()
3156 r8168_mac_ocp_write(tp, 0xF8CC, 0x8DE2); in rtl_hw_start_8411_2()
3157 r8168_mac_ocp_write(tp, 0xF8CE, 0x48C1); in rtl_hw_start_8411_2()
3158 r8168_mac_ocp_write(tp, 0xF8D0, 0xC502); in rtl_hw_start_8411_2()
3159 r8168_mac_ocp_write(tp, 0xF8D2, 0xBD00); in rtl_hw_start_8411_2()
3160 r8168_mac_ocp_write(tp, 0xF8D4, 0x00AA); in rtl_hw_start_8411_2()
3161 r8168_mac_ocp_write(tp, 0xF8D6, 0xE0C0); in rtl_hw_start_8411_2()
3162 r8168_mac_ocp_write(tp, 0xF8D8, 0xC502); in rtl_hw_start_8411_2()
3163 r8168_mac_ocp_write(tp, 0xF8DA, 0xBD00); in rtl_hw_start_8411_2()
3164 r8168_mac_ocp_write(tp, 0xF8DC, 0x0132); in rtl_hw_start_8411_2()
3166 r8168_mac_ocp_write(tp, 0xFC26, 0x8000); in rtl_hw_start_8411_2()
3168 r8168_mac_ocp_write(tp, 0xFC2A, 0x0743); in rtl_hw_start_8411_2()
3169 r8168_mac_ocp_write(tp, 0xFC2C, 0x0801); in rtl_hw_start_8411_2()
3170 r8168_mac_ocp_write(tp, 0xFC2E, 0x0BE9); in rtl_hw_start_8411_2()
3171 r8168_mac_ocp_write(tp, 0xFC30, 0x02FD); in rtl_hw_start_8411_2()
3172 r8168_mac_ocp_write(tp, 0xFC32, 0x0C25); in rtl_hw_start_8411_2()
3173 r8168_mac_ocp_write(tp, 0xFC34, 0x00A9); in rtl_hw_start_8411_2()
3174 r8168_mac_ocp_write(tp, 0xFC36, 0x012D); in rtl_hw_start_8411_2()
3182 { 0x1e, 0x0800, 0x0001 }, in rtl_hw_start_8168h_1()
3183 { 0x1d, 0x0000, 0x0800 }, in rtl_hw_start_8168h_1()
3184 { 0x05, 0xffff, 0x2089 }, in rtl_hw_start_8168h_1()
3185 { 0x06, 0xffff, 0x5881 }, in rtl_hw_start_8168h_1()
3186 { 0x04, 0xffff, 0x854a }, in rtl_hw_start_8168h_1()
3187 { 0x01, 0xffff, 0x068b } in rtl_hw_start_8168h_1()
3195 rtl_set_fifo_size(tp, 0x08, 0x10, 0x02, 0x06); in rtl_hw_start_8168h_1()
3196 rtl8168g_set_pause_thresholds(tp, 0x38, 0x48); in rtl_hw_start_8168h_1()
3202 rtl_eri_set_bits(tp, 0xdc, 0x001c); in rtl_hw_start_8168h_1()
3204 rtl_eri_write(tp, 0x5f0, ERIAR_MASK_0011, 0x4f87); in rtl_hw_start_8168h_1()
3208 rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8168h_1()
3209 rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8168h_1()
3218 rtl_eri_clear_bits(tp, 0x1b0, BIT(12)); in rtl_hw_start_8168h_1()
3222 rg_saw_cnt = phy_read_paged(tp->phydev, 0x0c42, 0x13) & 0x3fff; in rtl_hw_start_8168h_1()
3223 if (rg_saw_cnt > 0) { in rtl_hw_start_8168h_1()
3227 sw_cnt_1ms_ini &= 0x0fff; in rtl_hw_start_8168h_1()
3228 r8168_mac_ocp_modify(tp, 0xd412, 0x0fff, sw_cnt_1ms_ini); in rtl_hw_start_8168h_1()
3231 r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0070); in rtl_hw_start_8168h_1()
3232 r8168_mac_ocp_modify(tp, 0xe052, 0x6000, 0x8008); in rtl_hw_start_8168h_1()
3233 r8168_mac_ocp_modify(tp, 0xe0d6, 0x01ff, 0x017f); in rtl_hw_start_8168h_1()
3234 r8168_mac_ocp_modify(tp, 0xd420, 0x0fff, 0x047f); in rtl_hw_start_8168h_1()
3236 r8168_mac_ocp_write(tp, 0xe63e, 0x0001); in rtl_hw_start_8168h_1()
3237 r8168_mac_ocp_write(tp, 0xe63e, 0x0000); in rtl_hw_start_8168h_1()
3238 r8168_mac_ocp_write(tp, 0xc094, 0x0000); in rtl_hw_start_8168h_1()
3239 r8168_mac_ocp_write(tp, 0xc09e, 0x0000); in rtl_hw_start_8168h_1()
3248 rtl_set_fifo_size(tp, 0x08, 0x10, 0x02, 0x06); in rtl_hw_start_8168ep()
3249 rtl8168g_set_pause_thresholds(tp, 0x2f, 0x5f); in rtl_hw_start_8168ep()
3255 rtl_eri_write(tp, 0x5f0, ERIAR_MASK_0011, 0x4f87); in rtl_hw_start_8168ep()
3259 rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8168ep()
3260 rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8168ep()
3264 rtl_w0w1_eri(tp, 0x2fc, 0x01, 0x06); in rtl_hw_start_8168ep()
3274 { 0x00, 0x0000, 0x0080 }, in rtl_hw_start_8168ep_3()
3275 { 0x0d, 0x0100, 0x0200 }, in rtl_hw_start_8168ep_3()
3276 { 0x19, 0x8021, 0x0000 }, in rtl_hw_start_8168ep_3()
3277 { 0x1e, 0x0000, 0x2000 }, in rtl_hw_start_8168ep_3()
3289 r8168_mac_ocp_modify(tp, 0xd3e2, 0x0fff, 0x0271); in rtl_hw_start_8168ep_3()
3290 r8168_mac_ocp_modify(tp, 0xd3e4, 0x00ff, 0x0000); in rtl_hw_start_8168ep_3()
3291 r8168_mac_ocp_modify(tp, 0xe860, 0x0000, 0x0080); in rtl_hw_start_8168ep_3()
3299 { 0x19, 0x0040, 0x1100 }, in rtl_hw_start_8117()
3300 { 0x59, 0x0040, 0x1100 }, in rtl_hw_start_8117()
3310 rtl_set_fifo_size(tp, 0x08, 0x10, 0x02, 0x06); in rtl_hw_start_8117()
3311 rtl8168g_set_pause_thresholds(tp, 0x2f, 0x5f); in rtl_hw_start_8117()
3317 rtl_eri_set_bits(tp, 0xd4, 0x0010); in rtl_hw_start_8117()
3319 rtl_eri_write(tp, 0x5f0, ERIAR_MASK_0011, 0x4f87); in rtl_hw_start_8117()
3323 rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8117()
3324 rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8117()
3333 rtl_eri_clear_bits(tp, 0x1b0, BIT(12)); in rtl_hw_start_8117()
3337 rg_saw_cnt = phy_read_paged(tp->phydev, 0x0c42, 0x13) & 0x3fff; in rtl_hw_start_8117()
3338 if (rg_saw_cnt > 0) { in rtl_hw_start_8117()
3341 sw_cnt_1ms_ini = (16000000 / rg_saw_cnt) & 0x0fff; in rtl_hw_start_8117()
3342 r8168_mac_ocp_modify(tp, 0xd412, 0x0fff, sw_cnt_1ms_ini); in rtl_hw_start_8117()
3345 r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0070); in rtl_hw_start_8117()
3346 r8168_mac_ocp_write(tp, 0xea80, 0x0003); in rtl_hw_start_8117()
3347 r8168_mac_ocp_modify(tp, 0xe052, 0x0000, 0x0009); in rtl_hw_start_8117()
3348 r8168_mac_ocp_modify(tp, 0xd420, 0x0fff, 0x047f); in rtl_hw_start_8117()
3350 r8168_mac_ocp_write(tp, 0xe63e, 0x0001); in rtl_hw_start_8117()
3351 r8168_mac_ocp_write(tp, 0xe63e, 0x0000); in rtl_hw_start_8117()
3352 r8168_mac_ocp_write(tp, 0xc094, 0x0000); in rtl_hw_start_8117()
3353 r8168_mac_ocp_write(tp, 0xc09e, 0x0000); in rtl_hw_start_8117()
3364 { 0x01, 0, 0x6e65 }, in rtl_hw_start_8102e_1()
3365 { 0x02, 0, 0x091f }, in rtl_hw_start_8102e_1()
3366 { 0x03, 0, 0xc2f9 }, in rtl_hw_start_8102e_1()
3367 { 0x06, 0, 0xafb5 }, in rtl_hw_start_8102e_1()
3368 { 0x07, 0, 0x0e00 }, in rtl_hw_start_8102e_1()
3369 { 0x19, 0, 0xec80 }, in rtl_hw_start_8102e_1()
3370 { 0x01, 0, 0x2e65 }, in rtl_hw_start_8102e_1()
3371 { 0x01, 0, 0x6e65 } in rtl_hw_start_8102e_1()
3402 rtl_ephy_write(tp, 0x03, 0xc2f9); in rtl_hw_start_8102e_3()
3408 { 0x01, 0xffff, 0x6fe5 }, in rtl_hw_start_8401()
3409 { 0x03, 0xffff, 0x0599 }, in rtl_hw_start_8401()
3410 { 0x06, 0xffff, 0xaf25 }, in rtl_hw_start_8401()
3411 { 0x07, 0xffff, 0x8e68 }, in rtl_hw_start_8401()
3421 { 0x07, 0, 0x4000 }, in rtl_hw_start_8105e_1()
3422 { 0x19, 0, 0x0200 }, in rtl_hw_start_8105e_1()
3423 { 0x19, 0, 0x0020 }, in rtl_hw_start_8105e_1()
3424 { 0x1e, 0, 0x2000 }, in rtl_hw_start_8105e_1()
3425 { 0x03, 0, 0x0001 }, in rtl_hw_start_8105e_1()
3426 { 0x19, 0, 0x0100 }, in rtl_hw_start_8105e_1()
3427 { 0x19, 0, 0x0004 }, in rtl_hw_start_8105e_1()
3428 { 0x0a, 0, 0x0020 } in rtl_hw_start_8105e_1()
3432 RTL_W32(tp, FuncEvent, RTL_R32(tp, FuncEvent) | 0x002800); in rtl_hw_start_8105e_1()
3435 RTL_W32(tp, FuncEvent, RTL_R32(tp, FuncEvent) & ~0x010000); in rtl_hw_start_8105e_1()
3448 rtl_ephy_write(tp, 0x1e, rtl_ephy_read(tp, 0x1e) | 0x8000); in rtl_hw_start_8105e_2()
3454 { 0x19, 0xffff, 0xff64 }, in rtl_hw_start_8402()
3455 { 0x1e, 0, 0x4000 } in rtl_hw_start_8402()
3461 RTL_W32(tp, FuncEvent, RTL_R32(tp, FuncEvent) | 0x002800); in rtl_hw_start_8402()
3467 rtl_set_fifo_size(tp, 0x00, 0x00, 0x02, 0x06); in rtl_hw_start_8402()
3469 rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8402()
3470 rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8402()
3471 rtl_w0w1_eri(tp, 0x0d4, 0x0e00, 0xff00); in rtl_hw_start_8402()
3474 rtl_eri_write(tp, 0x1b0, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8402()
3484 RTL_W32(tp, FuncEvent, RTL_R32(tp, FuncEvent) | 0x002800); in rtl_hw_start_8106()
3491 rtl_set_aspm_entry_latency(tp, 0x2f); in rtl_hw_start_8106()
3493 rtl_eri_write(tp, 0x1d0, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8106()
3496 rtl_eri_write(tp, 0x1b0, ERIAR_MASK_0011, 0x0000); in rtl_hw_start_8106()
3504 return r8168_mac_ocp_read(tp, 0xe00e) & BIT(13); in DECLARE_RTL_COND()
3511 RTL_W16(tp, 0x382, 0x221b); in rtl_hw_start_8125_common()
3512 RTL_W8(tp, 0x4500, 0); in rtl_hw_start_8125_common()
3513 RTL_W16(tp, 0x4800, 0); in rtl_hw_start_8125_common()
3516 r8168_mac_ocp_modify(tp, 0xd40a, 0x0010, 0x0000); in rtl_hw_start_8125_common()
3518 RTL_W8(tp, Config1, RTL_R8(tp, Config1) & ~0x10); in rtl_hw_start_8125_common()
3520 r8168_mac_ocp_write(tp, 0xc140, 0xffff); in rtl_hw_start_8125_common()
3521 r8168_mac_ocp_write(tp, 0xc142, 0xffff); in rtl_hw_start_8125_common()
3523 r8168_mac_ocp_modify(tp, 0xd3e2, 0x0fff, 0x03a9); in rtl_hw_start_8125_common()
3524 r8168_mac_ocp_modify(tp, 0xd3e4, 0x00ff, 0x0000); in rtl_hw_start_8125_common()
3525 r8168_mac_ocp_modify(tp, 0xe860, 0x0000, 0x0080); in rtl_hw_start_8125_common()
3528 r8168_mac_ocp_modify(tp, 0xeb58, 0x0001, 0x0000); in rtl_hw_start_8125_common()
3531 r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0200); in rtl_hw_start_8125_common()
3533 r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0400); in rtl_hw_start_8125_common()
3536 r8168_mac_ocp_modify(tp, 0xe63e, 0x0c30, 0x0000); in rtl_hw_start_8125_common()
3538 r8168_mac_ocp_modify(tp, 0xe63e, 0x0c30, 0x0020); in rtl_hw_start_8125_common()
3540 r8168_mac_ocp_modify(tp, 0xc0b4, 0x0000, 0x000c); in rtl_hw_start_8125_common()
3541 r8168_mac_ocp_modify(tp, 0xeb6a, 0x00ff, 0x0033); in rtl_hw_start_8125_common()
3542 r8168_mac_ocp_modify(tp, 0xeb50, 0x03e0, 0x0040); in rtl_hw_start_8125_common()
3543 r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0030); in rtl_hw_start_8125_common()
3544 r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000); in rtl_hw_start_8125_common()
3545 r8168_mac_ocp_modify(tp, 0xea1c, 0x0003, 0x0001); in rtl_hw_start_8125_common()
3546 r8168_mac_ocp_modify(tp, 0xe0c0, 0x4f0f, 0x4403); in rtl_hw_start_8125_common()
3547 r8168_mac_ocp_modify(tp, 0xe052, 0x0080, 0x0068); in rtl_hw_start_8125_common()
3548 r8168_mac_ocp_modify(tp, 0xd430, 0x0fff, 0x047f); in rtl_hw_start_8125_common()
3550 r8168_mac_ocp_modify(tp, 0xea1c, 0x0004, 0x0000); in rtl_hw_start_8125_common()
3551 r8168_mac_ocp_modify(tp, 0xeb54, 0x0000, 0x0001); in rtl_hw_start_8125_common()
3553 r8168_mac_ocp_modify(tp, 0xeb54, 0x0001, 0x0000); in rtl_hw_start_8125_common()
3554 RTL_W16(tp, 0x1880, RTL_R16(tp, 0x1880) & ~0x0030); in rtl_hw_start_8125_common()
3556 r8168_mac_ocp_write(tp, 0xe098, 0xc302); in rtl_hw_start_8125_common()
3571 { 0x04, 0xffff, 0xd000 }, in rtl_hw_start_8125a_2()
3572 { 0x0a, 0xffff, 0x8653 }, in rtl_hw_start_8125a_2()
3573 { 0x23, 0xffff, 0xab66 }, in rtl_hw_start_8125a_2()
3574 { 0x20, 0xffff, 0x9455 }, in rtl_hw_start_8125a_2()
3575 { 0x21, 0xffff, 0x99ff }, in rtl_hw_start_8125a_2()
3576 { 0x29, 0xffff, 0xfe04 }, in rtl_hw_start_8125a_2()
3578 { 0x44, 0xffff, 0xd000 }, in rtl_hw_start_8125a_2()
3579 { 0x4a, 0xffff, 0x8653 }, in rtl_hw_start_8125a_2()
3580 { 0x63, 0xffff, 0xab66 }, in rtl_hw_start_8125a_2()
3581 { 0x60, 0xffff, 0x9455 }, in rtl_hw_start_8125a_2()
3582 { 0x61, 0xffff, 0x99ff }, in rtl_hw_start_8125a_2()
3583 { 0x69, 0xffff, 0xfe04 }, in rtl_hw_start_8125a_2()
3599 { 0x0b, 0xffff, 0xa908 }, in rtl_hw_start_8125b()
3600 { 0x1e, 0xffff, 0x20eb }, in rtl_hw_start_8125b()
3601 { 0x4b, 0xffff, 0xa908 }, in rtl_hw_start_8125b()
3602 { 0x5e, 0xffff, 0x20eb }, in rtl_hw_start_8125b()
3603 { 0x22, 0x0030, 0x0020 }, in rtl_hw_start_8125b()
3604 { 0x62, 0x0030, 0x0020 }, in rtl_hw_start_8125b()
3669 for (i = 0xa00; i < 0xb00; i += 4) in rtl_hw_start_8125()
3670 RTL_W32(tp, i, 0); in rtl_hw_start_8125()
3685 RTL_W16(tp, IntrMitigate, 0x0000); in rtl_hw_start_8168()
3703 RTL_W16(tp, IntrMitigate, 0x0000); in rtl_hw_start_8169()
3754 return 0; in rtl8169_change_mtu()
3761 desc->opts2 = 0; in rtl8169_mark_to_asic()
3779 mapping = dma_map_page(d, data, 0, R8169_RX_BUF_SIZE, DMA_FROM_DEVICE); in rtl8169_alloc_rx_data()
3796 for (i = 0; i < NUM_RX_DESC && tp->Rx_databuff[i]; i++) { in rtl8169_rx_clear()
3802 tp->RxDescArray[i].addr = 0; in rtl8169_rx_clear()
3803 tp->RxDescArray[i].opts1 = 0; in rtl8169_rx_clear()
3811 for (i = 0; i < NUM_RX_DESC; i++) { in rtl8169_rx_fill()
3825 return 0; in rtl8169_rx_fill()
3832 memset(tp->tx_skb, 0, sizeof(tp->tx_skb)); in rtl8169_init_ring()
3833 memset(tp->Rx_databuff, 0, sizeof(tp->Rx_databuff)); in rtl8169_init_ring()
3845 memset(desc, 0, sizeof(*desc)); in rtl8169_unmap_tx_skb()
3846 memset(tx_skb, 0, sizeof(*tx_skb)); in rtl8169_unmap_tx_skb()
3854 for (i = 0; i < n; i++) { in rtl8169_tx_clear_range()
3923 for (i = 0; i < NUM_RX_DESC; i++) in rtl_reset_work()
3957 opts1 = opts[0] | len; in rtl8169_tx_map()
3966 return 0; in rtl8169_tx_map()
3975 for (cur_frag = 0; cur_frag < info->nr_frags; cur_frag++) { in rtl8169_xmit_frags()
3986 return 0; in rtl8169_xmit_frags()
4017 unsigned int padto = 0, len = skb->len; in rtl8125_quirk_udp_padto()
4066 opts[0] |= TD_LSO; in rtl8169_tso_csum_v1()
4067 opts[0] |= mss << TD0_MSS_SHIFT; in rtl8169_tso_csum_v1()
4072 opts[0] |= TD0_IP_CS | TD0_TCP_CS; in rtl8169_tso_csum_v1()
4074 opts[0] |= TD0_IP_CS | TD0_UDP_CS; in rtl8169_tso_csum_v1()
4088 opts[0] |= TD1_GTSENV4; in rtl8169_tso_csum_v2()
4090 if (skb_cow_head(skb, 0)) in rtl8169_tso_csum_v2()
4094 opts[0] |= TD1_GTSENV6; in rtl8169_tso_csum_v2()
4099 opts[0] |= skb_transport_offset(skb) << GTTCPHO_SHIFT; in rtl8169_tso_csum_v2()
4162 RTL_W16(tp, TxPoll_8125, BIT(0)); in rtl8169_doorbell()
4184 opts[0] = 0; in rtl8169_start_xmit()
4331 netdev_err(dev, "PCI error (cmd = 0x%04x, status_errs = 0x%04x)\n", in rtl8169_pcierr_interrupt()
4340 unsigned int dirty_tx, bytes_compl = 0, pkts_compl = 0; in rtl_tx()
4411 for (count = 0; count < budget; count++, tp->cur_rx++) { in rtl_rx()
4445 pkt_size = status & GENMASK(13, 0); in rtl_rx()
4497 if ((status & 0xffff) == 0xffff || !(status & tp->irq_mask)) in rtl8169_interrupt()
4592 return 0; in r8169_phy_connect()
4651 return 0; in rtl8169_close()
4687 if (retval < 0) in rtl_open()
4694 if (retval < 0) in rtl_open()
4780 return 0; in rtl8169_runtime_resume()
4793 return 0; in rtl8169_suspend()
4816 return 0; in rtl8169_runtime_suspend()
4824 return 0; in rtl8169_runtime_suspend()
4943 value = rtl_eri_read(tp, 0xe0); in rtl_read_mac_address()
4945 value = rtl_eri_read(tp, 0xe4); in rtl_read_mac_address()
4966 if (phyaddr > 0) in r8169_mdio_read_reg()
4977 if (phyaddr > 0) in r8169_mdio_write_reg()
4982 return 0; in r8169_mdio_write_reg()
4998 new_bus->irq[0] = PHY_MAC_INTERRUPT; in r8169_mdio_register()
5009 tp->phydev = mdiobus_get_phy(new_bus, 0); in r8169_mdio_register()
5016 …dev_err(&pdev->dev, "no dedicated PHY driver found for PHY ID 0x%08x, maybe realtek.ko needs to be… in r8169_mdio_register()
5028 return 0; in r8169_mdio_register()
5039 r8168_mac_ocp_modify(tp, 0xe8de, BIT(14), 0); in rtl_hw_init_8168g()
5042 r8168_mac_ocp_modify(tp, 0xe8de, 0, BIT(15)); in rtl_hw_init_8168g()
5054 r8168_mac_ocp_modify(tp, 0xe8de, BIT(14), 0); in rtl_hw_init_8125()
5057 r8168_mac_ocp_write(tp, 0xc0aa, 0x07d0); in rtl_hw_init_8125()
5058 r8168_mac_ocp_write(tp, 0xc0a6, 0x0150); in rtl_hw_init_8125()
5059 r8168_mac_ocp_write(tp, 0xc01e, 0x5555); in rtl_hw_init_8125()
5084 return 0; in rtl_jumbo_max()
5132 r8168_mac_ocp_read(tp, 0xc0b2) & 0xf) in rtl_aspm_is_safe()
5155 tp->supports_gmii = ent->driver_data == RTL_CFG_NO_GBIT ? 0 : 1; in rtl_init_one()
5171 if (rc < 0) { in rtl_init_one()
5176 if (pcim_set_mwi(pdev) < 0) in rtl_init_one()
5181 if (region < 0) { in rtl_init_one()
5187 if (rc < 0) { in rtl_init_one()
5194 xid = (RTL_R32(tp, TxConfig) >> 20) & 0xfcf; in rtl_init_one()
5211 rc = 0; in rtl_init_one()
5235 if (rc < 0) { in rtl_init_one()
5239 tp->irq = pci_irq_vector(pdev, 0); in rtl_init_one()
5335 return 0; in rtl_init_one()