Lines Matching +full:0 +full:xcfff
45 #define PLA_IDR 0xc000
46 #define PLA_RCR 0xc010
47 #define PLA_RCR1 0xc012
48 #define PLA_RMS 0xc016
49 #define PLA_RXFIFO_CTRL0 0xc0a0
50 #define PLA_RXFIFO_FULL 0xc0a2
51 #define PLA_RXFIFO_CTRL1 0xc0a4
52 #define PLA_RX_FIFO_FULL 0xc0a6
53 #define PLA_RXFIFO_CTRL2 0xc0a8
54 #define PLA_RX_FIFO_EMPTY 0xc0aa
55 #define PLA_DMY_REG0 0xc0b0
56 #define PLA_FMC 0xc0b4
57 #define PLA_CFG_WOL 0xc0b6
58 #define PLA_TEREDO_CFG 0xc0bc
59 #define PLA_TEREDO_WAKE_BASE 0xc0c4
60 #define PLA_MAR 0xcd00
61 #define PLA_BACKUP 0xd000
62 #define PLA_BDC_CR 0xd1a0
63 #define PLA_TEREDO_TIMER 0xd2cc
64 #define PLA_REALWOW_TIMER 0xd2e8
65 #define PLA_UPHY_TIMER 0xd388
66 #define PLA_SUSPEND_FLAG 0xd38a
67 #define PLA_INDICATE_FALG 0xd38c
68 #define PLA_MACDBG_PRE 0xd38c /* RTL_VER_04 only */
69 #define PLA_MACDBG_POST 0xd38e /* RTL_VER_04 only */
70 #define PLA_EXTRA_STATUS 0xd398
71 #define PLA_GPHY_CTRL 0xd3ae
72 #define PLA_POL_GPIO_CTRL 0xdc6a
73 #define PLA_EFUSE_DATA 0xdd00
74 #define PLA_EFUSE_CMD 0xdd02
75 #define PLA_LEDSEL 0xdd90
76 #define PLA_LED_FEATURE 0xdd92
77 #define PLA_PHYAR 0xde00
78 #define PLA_BOOT_CTRL 0xe004
79 #define PLA_LWAKE_CTRL_REG 0xe007
80 #define PLA_GPHY_INTR_IMR 0xe022
81 #define PLA_EEE_CR 0xe040
82 #define PLA_EEE_TXTWSYS 0xe04c
83 #define PLA_EEE_TXTWSYS_2P5G 0xe058
84 #define PLA_EEEP_CR 0xe080
85 #define PLA_MAC_PWR_CTRL 0xe0c0
86 #define PLA_MAC_PWR_CTRL2 0xe0ca
87 #define PLA_MAC_PWR_CTRL3 0xe0cc
88 #define PLA_MAC_PWR_CTRL4 0xe0ce
89 #define PLA_WDT6_CTRL 0xe428
90 #define PLA_TCR0 0xe610
91 #define PLA_TCR1 0xe612
92 #define PLA_MTPS 0xe615
93 #define PLA_TXFIFO_CTRL 0xe618
94 #define PLA_TXFIFO_FULL 0xe61a
95 #define PLA_RSTTALLY 0xe800
96 #define PLA_CR 0xe813
97 #define PLA_CRWECR 0xe81c
98 #define PLA_CONFIG12 0xe81e /* CONFIG1, CONFIG2 */
99 #define PLA_CONFIG34 0xe820 /* CONFIG3, CONFIG4 */
100 #define PLA_CONFIG5 0xe822
101 #define PLA_PHY_PWR 0xe84c
102 #define PLA_OOB_CTRL 0xe84f
103 #define PLA_CPCR 0xe854
104 #define PLA_MISC_0 0xe858
105 #define PLA_MISC_1 0xe85a
106 #define PLA_OCP_GPHY_BASE 0xe86c
107 #define PLA_TALLYCNT 0xe890
108 #define PLA_SFF_STS_7 0xe8de
109 #define PLA_PHYSTATUS 0xe908
110 #define PLA_CONFIG6 0xe90a /* CONFIG6 */
111 #define PLA_USB_CFG 0xe952
112 #define PLA_BP_BA 0xfc26
113 #define PLA_BP_0 0xfc28
114 #define PLA_BP_1 0xfc2a
115 #define PLA_BP_2 0xfc2c
116 #define PLA_BP_3 0xfc2e
117 #define PLA_BP_4 0xfc30
118 #define PLA_BP_5 0xfc32
119 #define PLA_BP_6 0xfc34
120 #define PLA_BP_7 0xfc36
121 #define PLA_BP_EN 0xfc38
123 #define USB_USB2PHY 0xb41e
124 #define USB_SSPHYLINK1 0xb426
125 #define USB_SSPHYLINK2 0xb428
126 #define USB_L1_CTRL 0xb45e
127 #define USB_U2P3_CTRL 0xb460
128 #define USB_CSR_DUMMY1 0xb464
129 #define USB_CSR_DUMMY2 0xb466
130 #define USB_DEV_STAT 0xb808
131 #define USB_CONNECT_TIMER 0xcbf8
132 #define USB_MSC_TIMER 0xcbfc
133 #define USB_BURST_SIZE 0xcfc0
134 #define USB_FW_FIX_EN0 0xcfca
135 #define USB_FW_FIX_EN1 0xcfcc
136 #define USB_LPM_CONFIG 0xcfd8
137 #define USB_ECM_OPTION 0xcfee
138 #define USB_CSTMR 0xcfef /* RTL8153A */
139 #define USB_MISC_2 0xcfff
140 #define USB_ECM_OP 0xd26b
141 #define USB_GPHY_CTRL 0xd284
142 #define USB_SPEED_OPTION 0xd32a
143 #define USB_FW_CTRL 0xd334 /* RTL8153B */
144 #define USB_FC_TIMER 0xd340
145 #define USB_USB_CTRL 0xd406
146 #define USB_PHY_CTRL 0xd408
147 #define USB_TX_AGG 0xd40a
148 #define USB_RX_BUF_TH 0xd40c
149 #define USB_USB_TIMER 0xd428
150 #define USB_RX_EARLY_TIMEOUT 0xd42c
151 #define USB_RX_EARLY_SIZE 0xd42e
152 #define USB_PM_CTRL_STATUS 0xd432 /* RTL8153A */
153 #define USB_RX_EXTRA_AGGR_TMR 0xd432 /* RTL8153B */
154 #define USB_TX_DMA 0xd434
155 #define USB_UPT_RXDMA_OWN 0xd437
156 #define USB_UPHY3_MDCMDIO 0xd480
157 #define USB_TOLERANCE 0xd490
158 #define USB_LPM_CTRL 0xd41a
159 #define USB_BMU_RESET 0xd4b0
160 #define USB_BMU_CONFIG 0xd4b4
161 #define USB_U1U2_TIMER 0xd4da
162 #define USB_FW_TASK 0xd4e8 /* RTL8153B */
163 #define USB_RX_AGGR_NUM 0xd4ee
164 #define USB_UPS_CTRL 0xd800
165 #define USB_POWER_CUT 0xd80a
166 #define USB_MISC_0 0xd81a
167 #define USB_MISC_1 0xd81f
168 #define USB_AFE_CTRL2 0xd824
169 #define USB_UPHY_XTAL 0xd826
170 #define USB_UPS_CFG 0xd842
171 #define USB_UPS_FLAGS 0xd848
172 #define USB_WDT1_CTRL 0xe404
173 #define USB_WDT11_CTRL 0xe43c
184 #define USB_BP_8 0xfc38 /* RTL8153B */
185 #define USB_BP_9 0xfc3a
186 #define USB_BP_10 0xfc3c
187 #define USB_BP_11 0xfc3e
188 #define USB_BP_12 0xfc40
189 #define USB_BP_13 0xfc42
190 #define USB_BP_14 0xfc44
191 #define USB_BP_15 0xfc46
192 #define USB_BP2_EN 0xfc48
195 #define OCP_ALDPS_CONFIG 0x2010
196 #define OCP_EEE_CONFIG1 0x2080
197 #define OCP_EEE_CONFIG2 0x2092
198 #define OCP_EEE_CONFIG3 0x2094
199 #define OCP_BASE_MII 0xa400
200 #define OCP_EEE_AR 0xa41a
201 #define OCP_EEE_DATA 0xa41c
202 #define OCP_PHY_STATUS 0xa420
203 #define OCP_INTR_EN 0xa424
204 #define OCP_NCTL_CFG 0xa42c
205 #define OCP_POWER_CFG 0xa430
206 #define OCP_EEE_CFG 0xa432
207 #define OCP_SRAM_ADDR 0xa436
208 #define OCP_SRAM_DATA 0xa438
209 #define OCP_DOWN_SPEED 0xa442
210 #define OCP_EEE_ABLE 0xa5c4
211 #define OCP_EEE_ADV 0xa5d0
212 #define OCP_EEE_LPABLE 0xa5d2
213 #define OCP_10GBT_CTRL 0xa5d4
214 #define OCP_10GBT_STAT 0xa5d6
215 #define OCP_EEE_ADV2 0xa6d4
216 #define OCP_PHY_STATE 0xa708 /* nway state for 8153 */
217 #define OCP_PHY_PATCH_STAT 0xb800
218 #define OCP_PHY_PATCH_CMD 0xb820
219 #define OCP_PHY_LOCK 0xb82e
220 #define OCP_ADC_IOFFSET 0xbcfc
221 #define OCP_ADC_CFG 0xbc06
222 #define OCP_SYSCLK_CFG 0xc416
225 #define SRAM_GREEN_CFG 0x8011
226 #define SRAM_LPF_CFG 0x8012
227 #define SRAM_GPHY_FW_VER 0x801e
228 #define SRAM_10M_AMP1 0x8080
229 #define SRAM_10M_AMP2 0x8082
230 #define SRAM_IMPEDANCE 0x8084
231 #define SRAM_PHY_LOCK 0xb82e
234 #define RCR_AAP 0x00000001
235 #define RCR_APM 0x00000002
236 #define RCR_AM 0x00000004
237 #define RCR_AB 0x00000008
246 #define RXFIFO_THR1_NORMAL 0x00080002
247 #define RXFIFO_THR1_OOB 0x01800003
250 #define RXFIFO_FULL_MASK 0xfff
253 #define RXFIFO_THR2_FULL 0x00000060
254 #define RXFIFO_THR2_HIGH 0x00000038
255 #define RXFIFO_THR2_OOB 0x0000004a
256 #define RXFIFO_THR2_NORMAL 0x00a0
259 #define RXFIFO_THR3_FULL 0x00000078
260 #define RXFIFO_THR3_HIGH 0x00000048
261 #define RXFIFO_THR3_OOB 0x0000005a
262 #define RXFIFO_THR3_NORMAL 0x0110
265 #define TXFIFO_THR_NORMAL 0x00400008
266 #define TXFIFO_THR_NORMAL2 0x01000008
269 #define ECM_ALDPS 0x0002
272 #define FMC_FCR_MCU_EN 0x0001
275 #define EEEP_CR_EEEP_TX 0x0002
278 #define WDT6_SET_MODE 0x0010
281 #define TCR0_TX_EMPTY 0x0800
282 #define TCR0_AUTO_FIFO 0x0080
285 #define VERSION_MASK 0x7cf0
295 #define TALLY_RESET 0x0001
298 #define CR_RST 0x10
299 #define CR_RE 0x08
300 #define CR_TE 0x04
303 #define CRWECR_NORAML 0x00
304 #define CRWECR_CONFIG 0xc0
307 #define NOW_IS_OOB 0x80
308 #define TXFIFO_EMPTY 0x20
309 #define RXFIFO_EMPTY 0x10
310 #define LINK_LIST_READY 0x02
311 #define DIS_MCU_CLROOB 0x01
315 #define RXDY_GATED_EN 0x0008
318 #define RE_INIT_LL 0x8000
319 #define MCU_BORW_EN 0x4000
322 #define FLOW_CTRL_EN BIT(0)
323 #define CPCR_RX_VLAN 0x0040
326 #define MAGIC_EN 0x0001
329 #define TEREDO_SEL 0x8000
330 #define TEREDO_WAKE_MASK 0x7f00
331 #define TEREDO_RS_EVENT_MASK 0x00fe
332 #define OOB_TEREDO_EN 0x0001
335 #define ALDPS_PROXY_MODE 0x0001
342 #define LINK_ON_WAKE_EN 0x0010
343 #define LINK_OFF_WAKE_EN 0x0008
346 #define LANWAKE_CLR_EN BIT(0)
353 #define BWF_EN 0x0040
354 #define MWF_EN 0x0020
355 #define UWF_EN 0x0010
356 #define LAN_WAKE_EN 0x0002
359 #define LED_MODE_MASK 0x0700
362 #define TX_10M_IDLE_EN 0x0080
363 #define PFM_PWM_SWITCH 0x0040
367 #define D3_CLK_GATED_EN 0x00004000
368 #define MCU_CLK_RATIO 0x07010f07
369 #define MCU_CLK_RATIO_MASK 0x0f0f0f0f
370 #define ALDPS_SPDWN_RATIO 0x0f87
373 #define EEE_SPDWN_RATIO 0x8007
375 #define EEE_SPDWN_RATIO_MASK 0xff
379 #define PKT_AVAIL_SPDWN_EN 0x0100
380 #define SUSPEND_SPDWN_EN 0x0004
381 #define U1U2_SPDWN_EN 0x0002
382 #define L1_SPDWN_EN 0x0001
385 #define PWRSAVE_SPDWN_EN 0x1000
386 #define RXDV_SPDWN_EN 0x0800
387 #define TX10MIDLE_EN 0x0100
389 #define TP100_SPDWN_EN 0x0020
390 #define TP500_SPDWN_EN 0x0010
391 #define TP1000_SPDWN_EN 0x0008
392 #define EEE_SPDWN_EN 0x0001
395 #define GPHY_STS_MSK 0x0001
396 #define SPEED_DOWN_MSK 0x0002
397 #define SPDWN_RXDV_MSK 0x0004
398 #define SPDWN_LINKCHG_MSK 0x0008
401 #define PHYAR_FLAG 0x80000000
404 #define EEE_RX_EN 0x0001
405 #define EEE_TX_EN 0x0002
408 #define AUTOLOAD_DONE 0x0002
414 #define LINK_CHG_EVENT BIT(0)
417 #define UPCOMING_RUNTIME_D3 BIT(0)
420 #define DEBUG_OE BIT(0)
421 #define DEBUG_LTSSM 0x0082
427 #define POLL_LINK_CHG BIT(0)
437 #define USB2PHY_SUSPEND 0x0001
438 #define USB2PHY_L1 0x0002
444 #define pwd_dn_scale_mask 0x3ffe
448 #define DYNAMIC_BURST 0x0001
451 #define EP4_FULL_FC 0x0001
454 #define STAT_SPEED_MASK 0x0006
455 #define STAT_SPEED_HIGH 0x0000
456 #define STAT_SPEED_FULL 0x0002
465 #define LPM_U1U2_EN BIT(0)
468 #define TX_AGG_MAX_THRESHOLD 0x03
471 #define RX_THR_SUPPER 0x0c350180
472 #define RX_THR_HIGH 0x7a120180
473 #define RX_THR_SLOW 0xffff0180
474 #define RX_THR_B 0x00010001
477 #define TEST_MODE_DISABLE 0x00000001
478 #define TX_SIZE_ADJUST1 0x00000100
481 #define BMU_RESET_EP_IN 0x01
482 #define BMU_RESET_EP_OUT 0x02
488 #define OWN_UPDATE BIT(0)
495 #define RX_AGGR_NUM_MASK 0x1ff
498 #define POWER_CUT 0x0100
501 #define RESUME_INDICATE 0x0001
507 #define FORCE_SUPER BIT(0)
510 #define UPS_FORCE_PWR_DOWN BIT(0)
513 #define EN_ALL_SPEED BIT(0)
534 #define RX_AGG_DISABLE 0x0010
535 #define RX_ZERO_EN 0x0080
538 #define U2P3_ENABLE 0x0001
542 #define PWR_EN 0x0001
543 #define PHASE2_EN 0x0008
548 #define PCUT_STATUS 0x0001
556 #define WTD1_EN BIT(0)
559 #define TIMER11_EN 0x0001
563 #define FIFO_EMPTY_1FB 0x30 /* 0x1fb * 64 = 32448 bytes */
565 #define LPM_TIMER_MASK 0x0c
566 #define LPM_TIMER_500MS 0x04 /* 500 ms */
567 #define LPM_TIMER_500US 0x0c /* 500 us */
568 #define ROK_EXIT_LPM 0x02
571 #define SEN_VAL_MASK 0xf800
572 #define SEN_VAL_NORMAL 0xa000
573 #define SEL_RXIDLE 0x0100
579 #define SAW_CNT_1MS_MASK 0x0fff
583 #define UPS_FLAGS_R_TUNE BIT(0)
588 #define UPS_FLAGS_SPEED_MASK (0xf << 16)
614 #define ENPWRSAVE 0x8000
615 #define ENPDNPS 0x0200
616 #define LINKENA 0x0100
617 #define DIS_SDSAVE 0x0010
620 #define PHY_STAT_MASK 0x0007
632 #define EEE_CLKDIV_EN 0x8000
633 #define EN_ALDPS 0x0004
634 #define EN_10M_PLLOFF 0x0001
637 #define RG_TXLPI_MSK_HFDUP 0x8000
638 #define RG_MATCLR_EN 0x4000
639 #define EEE_10_CAP 0x2000
640 #define EEE_NWAY_EN 0x1000
641 #define TX_QUIET_EN 0x0200
642 #define RX_QUIET_EN 0x0100
643 #define sd_rise_time_mask 0x0070
645 #define RG_RXLPI_MSK_HFDUP 0x0008
646 #define SDFALLTIME 0x0007 /* bit 0 ~ 2 */
649 #define RG_LPIHYS_NUM 0x7000 /* bit 12 ~ 15 */
650 #define RG_DACQUIET_EN 0x0400
651 #define RG_LDVQUIET_EN 0x0200
652 #define RG_CKRSEL 0x0020
653 #define RG_EEEPRG_EN 0x0010
656 #define fast_snr_mask 0xff80
657 #define fast_snr(x) (min(x, 0x1ff) << 7) /* bit 7 ~ 15 */
658 #define RG_LFS_SEL 0x0060 /* bit 6 ~ 5 */
659 #define MSK_PH 0x0006 /* bit 0 ~ 3 */
663 #define FUN_ADDR 0x0000
664 #define FUN_DATA 0x4000
665 /* bit[4:0] device addr */
668 #define CTAP_SHORT_EN 0x0040
669 #define EEE10_EN 0x0010
676 #define EN_10M_BGOFF 0x0080
682 #define TXDIS_STATE 0x01
683 #define ABD_STATE 0x02
692 #define PATCH_LOCK BIT(0)
695 #define CKADSEL_L 0x0100
696 #define ADC_EN 0x0080
697 #define EN_EMI_L 0x0040
708 #define LPF_AUTO_TUNE 0x8000
711 #define GDAC_IB_UPALL 0x0008
714 #define AMP_DN 0x0200
717 #define RX_DRIVING_MASK 0x6000
720 #define PHY_PATCH_LOCK 0x0001
723 #define AD_MASK 0xfee0
724 #define BND_MASK 0x0004
725 #define BD_MASK 0x0001
726 #define EFUSE 0xcfdb
727 #define PASS_THRU_MASK 0x1
729 #define BP4_SUPER_ONLY 0x1578 /* RTL_VER_04 only */
737 _1000bps = 0x10,
738 _100bps = 0x08,
739 _10bps = 0x04,
740 LINK_STATUS = 0x02,
741 FULL_DUP = 0x01,
756 #define INTR_LINK 0x0004
767 RTL8152_INACCESSIBLE = 0,
781 #define DEVICE_ID_LENOVO_USB_C_TRAVEL_HUB 0x721e
782 #define DEVICE_ID_THINKPAD_ONELINK_PLUS_DOCK 0x3054
783 #define DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2 0x3082
784 #define DEVICE_ID_THINKPAD_USB_C_DONGLE 0x720c
785 #define DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2 0xa387
786 #define DEVICE_ID_THINKPAD_USB_C_DOCK_GEN3 0x3062
806 #define RX_LEN_MASK 0x7fff
832 #define GTTCPHO_MAX 0x7fU
833 #define TX_LEN_MAX 0x3ffffU
841 #define MSS_MAX 0x7ffU
843 #define TCPHO_MAX 0x7ffU
989 FW_FLAGS_USB = 0,
1003 FW_FIXUP_AND = 0,
1146 RTL_FW_END = 0,
1164 RTL_VER_UNKNOWN = 0,
1187 TX_CSUM_SUCCESS = 0,
1192 #define RTL_ADVERTISED_10_HALF BIT(0)
1248 if (ret >= 0) { in r8152_control_msg()
1249 tp->reg_access_reset_count = 0; in r8152_control_msg()
1312 if (ret < 0) in get_registers()
1313 memset(data, 0xff, size); in get_registers()
1351 int ret = 0; in generic_ocp_read()
1360 if ((u32)index + (u32)size > 0xffff) in generic_ocp_read()
1366 if (ret < 0) in generic_ocp_read()
1374 if (ret < 0) in generic_ocp_read()
1379 size = 0; in generic_ocp_read()
1404 if ((u32)index + (u32)size > 0xffff) in generic_ocp_write()
1412 /* Split the first DWORD if the byte_en is not 0xff */ in generic_ocp_write()
1415 if (ret < 0) in generic_ocp_write()
1426 /* Split the last DWORD if the byte_en is not 0xff */ in generic_ocp_write()
1435 if (ret < 0) in generic_ocp_write()
1445 if (ret < 0) in generic_ocp_write()
1450 size = 0; in generic_ocp_write()
1515 data &= 0xffff; in ocp_read_word()
1522 u32 mask = 0xffff; in ocp_write_word()
1553 data &= 0xff; in ocp_read_byte()
1560 u32 mask = 0xff; in ocp_write_byte()
1583 ocp_base = addr & 0xf000; in ocp_reg_read()
1589 ocp_index = (addr & 0x0fff) | 0xb000; in ocp_reg_read()
1597 ocp_base = addr & 0xf000; in ocp_reg_write()
1603 ocp_index = (addr & 0x0fff) | 0xb000; in ocp_reg_write()
1678 if (ret < 0) in __rtl8152_set_mac_address()
1722 mac_strlen = 0x16; in vendor_mac_passthru_addr_read()
1726 if ((ocp_data & AD_MASK) == 0x1000) { in vendor_mac_passthru_addr_read()
1737 if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK) == 0) { in vendor_mac_passthru_addr_read()
1746 mac_strlen = 0x17; in vendor_mac_passthru_addr_read()
1761 if (strncmp(obj->string.pointer, "_AUXMAC_#", 9) != 0 || in vendor_mac_passthru_addr_read()
1762 strncmp(obj->string.pointer + 0x15, "#", 1) != 0) { in vendor_mac_passthru_addr_read()
1768 if (!(ret == 0 && is_valid_ether_addr(buf))) { in vendor_mac_passthru_addr_read()
1792 if (ret < 0) { in determine_ethernet_addr()
1800 if (ret < 0) in determine_ethernet_addr()
1806 if (ret < 0) { in determine_ethernet_addr()
1815 return 0; in determine_ethernet_addr()
1828 if (ret < 0) in set_ethernet_addr()
1871 case 0: in read_bulk_callback()
1885 urb->actual_length = 0; in read_bulk_callback()
1972 case 0: /* success */ in intr_callback()
1995 if (INTR_LINK & __le16_to_cpu(d[0])) { in intr_callback()
1998 schedule_delayed_work(&tp->schedule, 0); in intr_callback()
2004 schedule_delayed_work(&tp->schedule, 0); in intr_callback()
2058 rx_agg->urb = usb_alloc_urb(0, mflags); in alloc_rx_agg()
2096 for (i = 0; i < RTL8152_MAX_TX; i++) { in free_all_mem()
2129 atomic_set(&tp->rx_count, 0); in alloc_all_mem()
2131 for (i = 0; i < RTL8152_MAX_RX; i++) { in alloc_all_mem()
2136 for (i = 0; i < RTL8152_MAX_TX; i++) { in alloc_all_mem()
2152 urb = usb_alloc_urb(0, GFP_KERNEL); in alloc_all_mem()
2167 tp->intr_urb = usb_alloc_urb(0, GFP_KERNEL); in alloc_all_mem()
2180 return 0; in alloc_all_mem()
2235 if (skb_checksum_help(skb) < 0) in r8152_csum_workaround()
2265 swab16(opts2 & 0xffff)); in rtl_rx_vlan_tag()
2272 u32 opts1, opts2 = 0; in r8152_tx_csum()
2284 "Invalid transport offset 0x%x for TSO\n", in r8152_tx_csum()
2296 if (skb_cow_head(skb, 0)) { in r8152_tx_csum()
2317 "Invalid transport offset 0x%x\n", in r8152_tx_csum()
2368 agg->skb_num = 0; in r8152_tx_agg_fill()
2369 agg->skb_len = 0; in r8152_tx_agg_fill()
2401 if (skb_copy_bits(skb, 0, tx_data, len) < 0) { in r8152_tx_agg_fill()
2437 if (ret < 0) in r8152_tx_agg_fill()
2445 if (ret < 0) in r8152_tx_agg_fill()
2525 int ret = 0, work_done = 0; in rx_bottom()
2558 int len_used = 0; in rx_bottom()
2566 if (urb->status != 0 || urb->actual_length < ETH_ZLEN) in rx_bottom()
2613 skb_add_rx_frag(skb, 0, agg->page, in rx_bottom()
2656 urb->actual_length = 0; in rx_bottom()
2705 } while (res == 0); in tx_bottom()
2734 return 0; in r8152_poll()
2757 return 0; in r8152_submit_rx()
2771 urb->actual_length = 0; in r8152_submit_rx()
2820 schedule_delayed_work(&tp->schedule, 0); in rtl8152_set_rx_mode()
2840 mc_filter[1] = 0xffffffff; in _rtl8152_set_rx_mode()
2841 mc_filter[0] = 0xffffffff; in _rtl8152_set_rx_mode()
2847 mc_filter[1] = 0xffffffff; in _rtl8152_set_rx_mode()
2848 mc_filter[0] = 0xffffffff; in _rtl8152_set_rx_mode()
2850 mc_filter[1] = 0; in _rtl8152_set_rx_mode()
2851 mc_filter[0] = 0; in _rtl8152_set_rx_mode()
2865 tmp[0] = __cpu_to_le32(swab32(mc_filter[1])); in _rtl8152_set_rx_mode()
2866 tmp[1] = __cpu_to_le32(swab32(mc_filter[0])); in _rtl8152_set_rx_mode()
2901 schedule_delayed_work(&tp->schedule, 0); in rtl8152_start_xmit()
2961 for (i = 0; i < 1000; i++) { in rtl8152_nic_reset()
3017 int ret = 0, i = 0; in rtl_start_rx()
3038 } else if (unlikely(ret < 0)) { in rtl_start_rx()
3092 return 0; in rtl_stop_rx()
3150 return 0; in rtl_enable()
3285 for (i = 0; i < RTL8152_MAX_TX; i++) in rtl_disable()
3290 for (i = 0; i < 1000; i++) { in rtl_disable()
3297 for (i = 0; i < 1000; i++) { in rtl_disable()
3372 if (ret < 0) in rtl8152_set_features()
3397 u32 wolopts = 0; in __rtl_get_wol()
3475 0x0403); in r8156_mac_clk_spd()
3479 ocp_data |= MAC_CLK_SPDWN_EN | 0x03; /* eee_spdwn_ratio */ in r8156_mac_clk_spd()
3493 memset(u1u2, 0xff, sizeof(u1u2)); in r8153_u1u2en()
3495 memset(u1u2, 0x00, sizeof(u1u2)); in r8153_u1u2en()
3527 u32 ups_flags = 0; in r8153b_ups_flags()
3602 u32 ups_flags = 0; in r8156_ups_flags()
3633 ups_flags |= ups_flags_speed(0); in r8156_ups_flags()
3668 ups_flags |= 0 << 5; in r8156_ups_flags()
3673 case 0: in r8156_ups_flags()
3699 sram_write(tp, 0x8045, 0); /* 10M abiq&ldvbias */ in r8153b_green_en()
3700 sram_write(tp, 0x804d, 0x1222); /* 100M short abiq&ldvbias */ in r8153b_green_en()
3701 sram_write(tp, 0x805d, 0x0022); /* 1000M short abiq&ldvbias */ in r8153b_green_en()
3703 sram_write(tp, 0x8045, 0x2444); /* 10M abiq&ldvbias */ in r8153b_green_en()
3704 sram_write(tp, 0x804d, 0x2444); /* 100M short abiq&ldvbias */ in r8153b_green_en()
3705 sram_write(tp, 0x805d, 0x2444); /* 1000M short abiq&ldvbias */ in r8153b_green_en()
3716 for (i = 0; i < 500; i++) { in r8153_phy_status()
3759 for (i = 0; i < 500; i++) { in r8153b_ups_en()
3801 for (i = 0; i < 500; i++) { in r8153c_ups_en()
4056 /* The bit 0 ~ 7 are relative with teredo settings. They are in r8153_teredo_off()
4059 ocp_write_byte(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG, 0xff); in r8153_teredo_off()
4064 ocp_write_word(tp, MCU_TYPE_PLA, PLA_REALWOW_TIMER, 0); in r8153_teredo_off()
4065 ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TEREDO_TIMER, 0); in r8153_teredo_off()
4082 u16 bp[16] = {0}; in rtl_clear_bp()
4094 ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0); in rtl_clear_bp()
4103 ocp_write_byte(tp, type, PLA_BP_EN, 0); in rtl_clear_bp()
4112 ocp_write_word(tp, type, USB_BP2_EN, 0); in rtl_clear_bp()
4121 ocp_write_word(tp, type, PLA_BP_BA, 0); in rtl_clear_bp()
4137 check = 0; in rtl_phy_patch_request()
4144 for (i = 0; wait && i < 5000; i++) { in rtl_phy_patch_request()
4162 return 0; in rtl_phy_patch_request()
4174 sram_write(tp, 0x0000, 0x0000); in rtl_patch_key_set()
4180 sram_write(tp, key_addr, 0x0000); in rtl_patch_key_set()
4194 return 0; in rtl_pre_ram_code()
4199 rtl_patch_key_set(tp, key_addr, 0); in rtl_post_ram_code()
4203 return 0; in rtl_post_ram_code()
4246 if (__le16_to_cpu(phy->fw_reg) != 0x9A00) { in rtl8152_is_fw_phy_speed_up_ok()
4372 fw_reg = 0xa014; in rtl8152_is_fw_phy_nc_ok()
4373 ba_reg = 0xa012; in rtl8152_is_fw_phy_nc_ok()
4374 patch_en_addr = 0xa01a; in rtl8152_is_fw_phy_nc_ok()
4375 mode_reg = 0xb820; in rtl8152_is_fw_phy_nc_ok()
4376 bp_start = 0xa000; in rtl8152_is_fw_phy_nc_ok()
4451 fw_reg = 0xf800; in rtl8152_is_fw_mac_ok()
4453 bp_en_addr = 0; in rtl8152_is_fw_mac_ok()
4467 fw_reg = 0xf800; in rtl8152_is_fw_mac_ok()
4474 fw_reg = 0xf800; in rtl8152_is_fw_mac_ok()
4489 fw_reg = 0xf800; in rtl8152_is_fw_mac_ok()
4502 fw_reg = 0xe600; in rtl8152_is_fw_mac_ok()
4587 alg = crypto_alloc_shash("sha256", 0, 0); in rtl8152_fw_verify_checksum()
4629 unsigned long fw_flags = 0; in rtl8152_check_firmware()
4904 return 0; in rtl8152_check_firmware()
4941 generic_ocp_write(tp, __le16_to_cpu(phy->fw_reg), 0xff, size, data, MCU_TYPE_USB); in rtl_ram_code_speed_up()
4950 for (i = 0; i < 1000; i++) { in rtl_ram_code_speed_up()
4982 return 0; in rtl8152_fw_phy_ver()
5032 for (i = 0; i < num; i++) in rtl8152_fw_phy_union_apply()
5042 for (i = 0; i < num; i++) in rtl8152_fw_phy_union_apply()
5046 for (i = 0; i < num; i++) in rtl8152_fw_phy_union_apply()
5074 for (i = 0; i < num; i++) in rtl8152_fw_phy_nc_apply()
5082 for (i = 0; i < num; i++) { in rtl8152_fw_phy_nc_apply()
5132 generic_ocp_write(tp, __le16_to_cpu(mac->fw_reg), 0xff, length, data, in rtl8152_fw_mac_apply()
5159 u16 key_addr = 0; in rtl8152_apply_firmware()
5249 rc = 0; in rtl8152_request_firmware()
5254 if (rc < 0) in rtl8152_request_firmware()
5258 if (rc < 0) in rtl8152_request_firmware()
5298 ocp_reg_write(tp, OCP_EEE_AR, 0x0000); in r8152_mmd_read()
5307 ocp_reg_write(tp, OCP_EEE_AR, 0x0000); in r8152_mmd_write()
5391 r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0); in rtl_eee_enable()
5406 ocp_reg_write(tp, OCP_EEE_ADV, 0); in rtl_eee_enable()
5419 ocp_reg_write(tp, OCP_EEE_ADV, 0); in rtl_eee_enable()
5460 for (i = 0; i < 1000; i++) { in wait_oob_link_list_ready()
5474 for (i = 0; i < 100; i++) { in r8156b_wait_loading_flash()
5493 ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, 0x00); in r8152b_exit_oob()
5594 for (i = 0; i < 104; i++) { in r8153_pre_firmware_1()
5602 return 0; in r8153_pre_firmware_1()
5614 return 0; in r8153_post_firmware_1()
5627 return 0; in r8153_pre_firmware_2()
5637 ocp_data |= BIT(0); in r8153_post_firmware_2()
5655 return 0; in r8153_post_firmware_2()
5670 return 0; in r8153_post_firmware_3()
5679 return 0; in r8153b_pre_firmware_1()
5690 ocp_data |= BIT(0); in r8153b_post_firmware_1()
5706 return 0; in r8153b_post_firmware_1()
5721 return 0; in r8153c_post_firmware_1()
5733 ocp_write_dword(tp, MCU_TYPE_USB, USB_UPHY3_MDCMDIO, 0x4026840e); in r8156a_post_firmware_1()
5734 ocp_write_dword(tp, MCU_TYPE_USB, USB_UPHY3_MDCMDIO, 0x4001acc9); in r8156a_post_firmware_1()
5736 return 0; in r8156a_post_firmware_1()
5752 for (i = 0; i < 20; i++) { in r8153_aldps_en()
5754 if (ocp_read_word(tp, MCU_TYPE_PLA, 0xe000) & 0x0100) in r8153_aldps_en()
5791 sram_write(tp, SRAM_IMPEDANCE, 0x0b13); in r8153_hw_phy_cfg()
5798 sram_write(tp, SRAM_LPF_CFG, 0xf70f); in r8153_hw_phy_cfg()
5801 sram_write(tp, SRAM_10M_AMP1, 0x00af); in r8153_hw_phy_cfg()
5802 sram_write(tp, SRAM_10M_AMP2, 0x0208); in r8153_hw_phy_cfg()
5856 data = r8153_phy_status(tp, 0); in r8153b_hw_phy_cfg()
5883 * read efuse offset 0x7d to get a 17-bit data. Remove the dummy/fake in r8153b_hw_phy_cfg()
5887 ocp_data = r8152_efuse_read(tp, 0x7d); in r8153b_hw_phy_cfg()
5888 data = (u16)(((ocp_data & 0x1fff0) >> 1) | (ocp_data & 0x7)); in r8153b_hw_phy_cfg()
5889 if (data != 0xffff) in r8153b_hw_phy_cfg()
5893 * rg_saw_cnt = OCP reg 0xC426 Bit[13:0] in r8153b_hw_phy_cfg()
5896 ocp_data = ocp_reg_read(tp, 0xc426); in r8153b_hw_phy_cfg()
5897 ocp_data &= 0x3fff; in r8153b_hw_phy_cfg()
5925 ocp_reg_write(tp, OCP_SYSCLK_CFG, 0); in r8153b_hw_phy_cfg()
6043 * type. Set it to zero. bits[7:0] are the W1C bits about in r8153_enter_oob()
6046 ocp_write_word(tp, MCU_TYPE_PLA, PLA_TEREDO_WAKE_BASE, 0x00ff); in r8153_enter_oob()
6126 ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEE_TXTWSYS, 0x11); in rtl8156_enable()
6128 ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEE_TXTWSYS, 0x3d); in rtl8156_enable()
6131 /* USB 0xb45e[3:0] l1_nyet_hird */ in rtl8156_enable()
6133 ocp_data &= ~0xf; in rtl8156_enable()
6135 ocp_data |= 0xf; in rtl8156_enable()
6137 ocp_data |= 0x1; in rtl8156_enable()
6153 ocp_write_word(tp, MCU_TYPE_PLA, PLA_RX_FIFO_FULL, 0); in rtl8156_disable()
6154 ocp_write_word(tp, MCU_TYPE_PLA, PLA_RX_FIFO_EMPTY, 0); in rtl8156_disable()
6189 ocp_data &= ~0xf; in rtl8156b_enable()
6191 ocp_data |= 0xf; in rtl8156b_enable()
6193 ocp_data |= 0x1; in rtl8156b_enable()
6211 int ret = 0; in rtl8152_set_speed()
6251 tp->mii.full_duplex = 0; in rtl8152_set_speed()
6326 tp->mii.force_media = 0; in rtl8152_set_speed()
6337 for (i = 0; i < 50; i++) { in rtl8152_set_speed()
6339 if ((r8152_mdio_read(tp, MII_BMCR) & BMCR_RESET) == 0) in rtl8152_set_speed()
6537 ocp_write_byte(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL0, 0x02); in rtl8153c_up()
6538 ocp_write_byte(tp, MCU_TYPE_PLA, PLA_RXFIFO_FULL, 0x08); in rtl8153c_up()
6622 ocp_data |= 0x08; in rtl8156_up()
6633 ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_BUF_TH, 0x00600400); in rtl8156_up()
6681 * type. Set it to zero. bits[7:0] are the W1C bits about in rtl8156_down()
6684 ocp_write_word(tp, MCU_TYPE_PLA, PLA_TEREDO_WAKE_BASE, 0x00ff); in rtl8156_down()
6708 ocp_write_word(tp, MCU_TYPE_PLA, PLA_OCP_GPHY_BASE, 0x2000); in rtl8152_in_nway()
6709 tp->ocp_base = 0x2000; in rtl8152_in_nway()
6710 ocp_write_byte(tp, MCU_TYPE_PLA, 0xb014, 0x4c); /* phy state */ in rtl8152_in_nway()
6711 nway_state = ocp_read_word(tp, MCU_TYPE_PLA, 0xb01a); in rtl8152_in_nway()
6714 if (nway_state & 0xc000) in rtl8152_in_nway()
6722 u16 phy_state = ocp_reg_read(tp, OCP_PHY_STATE) & 0xff; in rtl8153_in_nway()
6734 /* Select force mode through 0xa5b4 bit 15 in r8156_mdio_force_mode()
6735 * 0: MDIO force mode in r8156_mdio_force_mode()
6738 data = ocp_reg_read(tp, 0xa5b4); in r8156_mdio_force_mode()
6741 ocp_reg_write(tp, 0xa5b4, data); in r8156_mdio_force_mode()
6792 if (usb_autopm_get_interface(tp->intf) < 0) in rtl_work_func_t()
6799 schedule_delayed_work(&tp->schedule, 0); in rtl_work_func_t()
6831 if (usb_autopm_get_interface(tp->intf) < 0) in rtl_hw_phy_work_func_t()
6887 int res = 0; in rtl8152_open()
6899 if (res < 0) in rtl8152_open()
6928 return 0; in rtl8152_open()
6942 int res = 0; in rtl8152_close()
6955 if (res < 0 || test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { in rtl8152_close()
7037 for (i = 0; i < 500; i++) { in r8153_init()
7047 data = r8153_phy_status(tp, 0); in r8153_init()
7078 if (ocp_read_word(tp, MCU_TYPE_USB, USB_BURST_SIZE) == 0) in r8153_init()
7085 if (ocp_read_word(tp, MCU_TYPE_USB, USB_BURST_SIZE) == 0) in r8153_init()
7126 ocp_write_word(tp, MCU_TYPE_USB, USB_CONNECT_TIMER, 0x0001); in r8153_init()
7177 for (i = 0; i < 500; i++) { in r8153b_init()
7187 data = r8153_phy_status(tp, 0); in r8153b_init()
7199 /* MSC timer = 0xfff * 8ms = 32760 ms */ in r8153b_init()
7200 ocp_write_word(tp, MCU_TYPE_USB, USB_MSC_TIMER, 0x0fff); in r8153b_init()
7229 if (ocp_read_byte(tp, MCU_TYPE_PLA, 0xdc00) & BIT(5)) { in r8153b_init()
7264 ocp_data = ocp_read_word(tp, MCU_TYPE_USB, 0xcbf0); in r8153c_init()
7266 ocp_write_word(tp, MCU_TYPE_USB, 0xcbf0, ocp_data); in r8153c_init()
7268 for (i = 0; i < 500; i++) { in r8153c_init()
7278 data = r8153_phy_status(tp, 0); in r8153c_init()
7290 /* MSC timer = 0xfff * 8ms = 32760 ms */ in r8153c_init()
7291 ocp_write_word(tp, MCU_TYPE_USB, USB_MSC_TIMER, 0x0fff); in r8153c_init()
7341 data = r8153_phy_status(tp, 0); in r8156_hw_phy_cfg()
7346 data = ocp_reg_read(tp, 0xa468); in r8156_hw_phy_cfg()
7348 ocp_reg_write(tp, 0xa468, data); in r8156_hw_phy_cfg()
7372 data = ocp_reg_read(tp, 0xad40); in r8156_hw_phy_cfg()
7373 data &= ~0x3ff; in r8156_hw_phy_cfg()
7375 ocp_reg_write(tp, 0xad40, data); in r8156_hw_phy_cfg()
7377 data = ocp_reg_read(tp, 0xad4e); in r8156_hw_phy_cfg()
7379 ocp_reg_write(tp, 0xad4e, data); in r8156_hw_phy_cfg()
7380 data = ocp_reg_read(tp, 0xad16); in r8156_hw_phy_cfg()
7381 data &= ~0x3ff; in r8156_hw_phy_cfg()
7382 data |= 0x6; in r8156_hw_phy_cfg()
7383 ocp_reg_write(tp, 0xad16, data); in r8156_hw_phy_cfg()
7384 data = ocp_reg_read(tp, 0xad32); in r8156_hw_phy_cfg()
7385 data &= ~0x3f; in r8156_hw_phy_cfg()
7387 ocp_reg_write(tp, 0xad32, data); in r8156_hw_phy_cfg()
7388 data = ocp_reg_read(tp, 0xac08); in r8156_hw_phy_cfg()
7390 ocp_reg_write(tp, 0xac08, data); in r8156_hw_phy_cfg()
7391 data = ocp_reg_read(tp, 0xac8a); in r8156_hw_phy_cfg()
7394 ocp_reg_write(tp, 0xac8a, data); in r8156_hw_phy_cfg()
7395 data = ocp_reg_read(tp, 0xad18); in r8156_hw_phy_cfg()
7397 ocp_reg_write(tp, 0xad18, data); in r8156_hw_phy_cfg()
7398 data = ocp_reg_read(tp, 0xad1a); in r8156_hw_phy_cfg()
7399 data |= 0x3ff; in r8156_hw_phy_cfg()
7400 ocp_reg_write(tp, 0xad1a, data); in r8156_hw_phy_cfg()
7401 data = ocp_reg_read(tp, 0xad1c); in r8156_hw_phy_cfg()
7402 data |= 0x3ff; in r8156_hw_phy_cfg()
7403 ocp_reg_write(tp, 0xad1c, data); in r8156_hw_phy_cfg()
7405 data = sram_read(tp, 0x80ea); in r8156_hw_phy_cfg()
7406 data &= ~0xff00; in r8156_hw_phy_cfg()
7407 data |= 0xc400; in r8156_hw_phy_cfg()
7408 sram_write(tp, 0x80ea, data); in r8156_hw_phy_cfg()
7409 data = sram_read(tp, 0x80eb); in r8156_hw_phy_cfg()
7410 data &= ~0x0700; in r8156_hw_phy_cfg()
7411 data |= 0x0300; in r8156_hw_phy_cfg()
7412 sram_write(tp, 0x80eb, data); in r8156_hw_phy_cfg()
7413 data = sram_read(tp, 0x80f8); in r8156_hw_phy_cfg()
7414 data &= ~0xff00; in r8156_hw_phy_cfg()
7415 data |= 0x1c00; in r8156_hw_phy_cfg()
7416 sram_write(tp, 0x80f8, data); in r8156_hw_phy_cfg()
7417 data = sram_read(tp, 0x80f1); in r8156_hw_phy_cfg()
7418 data &= ~0xff00; in r8156_hw_phy_cfg()
7419 data |= 0x3000; in r8156_hw_phy_cfg()
7420 sram_write(tp, 0x80f1, data); in r8156_hw_phy_cfg()
7422 data = sram_read(tp, 0x80fe); in r8156_hw_phy_cfg()
7423 data &= ~0xff00; in r8156_hw_phy_cfg()
7424 data |= 0xa500; in r8156_hw_phy_cfg()
7425 sram_write(tp, 0x80fe, data); in r8156_hw_phy_cfg()
7426 data = sram_read(tp, 0x8102); in r8156_hw_phy_cfg()
7427 data &= ~0xff00; in r8156_hw_phy_cfg()
7428 data |= 0x5000; in r8156_hw_phy_cfg()
7429 sram_write(tp, 0x8102, data); in r8156_hw_phy_cfg()
7430 data = sram_read(tp, 0x8015); in r8156_hw_phy_cfg()
7431 data &= ~0xff00; in r8156_hw_phy_cfg()
7432 data |= 0x3300; in r8156_hw_phy_cfg()
7433 sram_write(tp, 0x8015, data); in r8156_hw_phy_cfg()
7434 data = sram_read(tp, 0x8100); in r8156_hw_phy_cfg()
7435 data &= ~0xff00; in r8156_hw_phy_cfg()
7436 data |= 0x7000; in r8156_hw_phy_cfg()
7437 sram_write(tp, 0x8100, data); in r8156_hw_phy_cfg()
7438 data = sram_read(tp, 0x8014); in r8156_hw_phy_cfg()
7439 data &= ~0xff00; in r8156_hw_phy_cfg()
7440 data |= 0xf000; in r8156_hw_phy_cfg()
7441 sram_write(tp, 0x8014, data); in r8156_hw_phy_cfg()
7442 data = sram_read(tp, 0x8016); in r8156_hw_phy_cfg()
7443 data &= ~0xff00; in r8156_hw_phy_cfg()
7444 data |= 0x6500; in r8156_hw_phy_cfg()
7445 sram_write(tp, 0x8016, data); in r8156_hw_phy_cfg()
7446 data = sram_read(tp, 0x80dc); in r8156_hw_phy_cfg()
7447 data &= ~0xff00; in r8156_hw_phy_cfg()
7448 data |= 0xed00; in r8156_hw_phy_cfg()
7449 sram_write(tp, 0x80dc, data); in r8156_hw_phy_cfg()
7450 data = sram_read(tp, 0x80df); in r8156_hw_phy_cfg()
7452 sram_write(tp, 0x80df, data); in r8156_hw_phy_cfg()
7453 data = sram_read(tp, 0x80e1); in r8156_hw_phy_cfg()
7455 sram_write(tp, 0x80e1, data); in r8156_hw_phy_cfg()
7457 data = ocp_reg_read(tp, 0xbf06); in r8156_hw_phy_cfg()
7458 data &= ~0x003f; in r8156_hw_phy_cfg()
7459 data |= 0x0038; in r8156_hw_phy_cfg()
7460 ocp_reg_write(tp, 0xbf06, data); in r8156_hw_phy_cfg()
7462 sram_write(tp, 0x819f, 0xddb6); in r8156_hw_phy_cfg()
7464 ocp_reg_write(tp, 0xbc34, 0x5555); in r8156_hw_phy_cfg()
7465 data = ocp_reg_read(tp, 0xbf0a); in r8156_hw_phy_cfg()
7466 data &= ~0x0e00; in r8156_hw_phy_cfg()
7467 data |= 0x0a00; in r8156_hw_phy_cfg()
7468 ocp_reg_write(tp, 0xbf0a, data); in r8156_hw_phy_cfg()
7470 data = ocp_reg_read(tp, 0xbd2c); in r8156_hw_phy_cfg()
7472 ocp_reg_write(tp, 0xbd2c, data); in r8156_hw_phy_cfg()
7475 data = ocp_reg_read(tp, 0xad16); in r8156_hw_phy_cfg()
7476 data |= 0x3ff; in r8156_hw_phy_cfg()
7477 ocp_reg_write(tp, 0xad16, data); in r8156_hw_phy_cfg()
7478 data = ocp_reg_read(tp, 0xad32); in r8156_hw_phy_cfg()
7479 data &= ~0x3f; in r8156_hw_phy_cfg()
7481 ocp_reg_write(tp, 0xad32, data); in r8156_hw_phy_cfg()
7482 data = ocp_reg_read(tp, 0xac08); in r8156_hw_phy_cfg()
7484 ocp_reg_write(tp, 0xac08, data); in r8156_hw_phy_cfg()
7485 data = ocp_reg_read(tp, 0xacc0); in r8156_hw_phy_cfg()
7486 data &= ~0x3; in r8156_hw_phy_cfg()
7488 ocp_reg_write(tp, 0xacc0, data); in r8156_hw_phy_cfg()
7489 data = ocp_reg_read(tp, 0xad40); in r8156_hw_phy_cfg()
7490 data &= ~0xe7; in r8156_hw_phy_cfg()
7492 ocp_reg_write(tp, 0xad40, data); in r8156_hw_phy_cfg()
7493 data = ocp_reg_read(tp, 0xac14); in r8156_hw_phy_cfg()
7495 ocp_reg_write(tp, 0xac14, data); in r8156_hw_phy_cfg()
7496 data = ocp_reg_read(tp, 0xac80); in r8156_hw_phy_cfg()
7498 ocp_reg_write(tp, 0xac80, data); in r8156_hw_phy_cfg()
7499 data = ocp_reg_read(tp, 0xac5e); in r8156_hw_phy_cfg()
7500 data &= ~0x7; in r8156_hw_phy_cfg()
7502 ocp_reg_write(tp, 0xac5e, data); in r8156_hw_phy_cfg()
7503 ocp_reg_write(tp, 0xad4c, 0x00a8); in r8156_hw_phy_cfg()
7504 ocp_reg_write(tp, 0xac5c, 0x01ff); in r8156_hw_phy_cfg()
7505 data = ocp_reg_read(tp, 0xac8a); in r8156_hw_phy_cfg()
7506 data &= ~0xf0; in r8156_hw_phy_cfg()
7508 ocp_reg_write(tp, 0xac8a, data); in r8156_hw_phy_cfg()
7509 ocp_reg_write(tp, 0xb87c, 0x8157); in r8156_hw_phy_cfg()
7510 data = ocp_reg_read(tp, 0xb87e); in r8156_hw_phy_cfg()
7511 data &= ~0xff00; in r8156_hw_phy_cfg()
7512 data |= 0x0500; in r8156_hw_phy_cfg()
7513 ocp_reg_write(tp, 0xb87e, data); in r8156_hw_phy_cfg()
7514 ocp_reg_write(tp, 0xb87c, 0x8159); in r8156_hw_phy_cfg()
7515 data = ocp_reg_read(tp, 0xb87e); in r8156_hw_phy_cfg()
7516 data &= ~0xff00; in r8156_hw_phy_cfg()
7517 data |= 0x0700; in r8156_hw_phy_cfg()
7518 ocp_reg_write(tp, 0xb87e, data); in r8156_hw_phy_cfg()
7521 ocp_reg_write(tp, 0xb87c, 0x80a2); in r8156_hw_phy_cfg()
7522 ocp_reg_write(tp, 0xb87e, 0x0153); in r8156_hw_phy_cfg()
7523 ocp_reg_write(tp, 0xb87c, 0x809c); in r8156_hw_phy_cfg()
7524 ocp_reg_write(tp, 0xb87e, 0x0153); in r8156_hw_phy_cfg()
7527 ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEE_TXTWSYS_2P5G, 0x0056); in r8156_hw_phy_cfg()
7533 sram_write(tp, 0x8257, 0x020f); /* XG PLL */ in r8156_hw_phy_cfg()
7534 sram_write(tp, 0x80ea, 0x7843); /* GIGA Master */ in r8156_hw_phy_cfg()
7557 ocp_reg_write(tp, OCP_SYSCLK_CFG, 0); in r8156_hw_phy_cfg()
7564 data = ocp_reg_read(tp, 0xd068); in r8156_hw_phy_cfg()
7566 ocp_reg_write(tp, 0xd068, data); in r8156_hw_phy_cfg()
7569 data = sram_read(tp, 0x81a2); in r8156_hw_phy_cfg()
7571 sram_write(tp, 0x81a2, data); in r8156_hw_phy_cfg()
7572 data = ocp_reg_read(tp, 0xb54c); in r8156_hw_phy_cfg()
7573 data &= ~0xff00; in r8156_hw_phy_cfg()
7574 data |= 0xdb00; in r8156_hw_phy_cfg()
7575 ocp_reg_write(tp, 0xb54c, data); in r8156_hw_phy_cfg()
7578 data = ocp_reg_read(tp, 0xa454); in r8156_hw_phy_cfg()
7579 data &= ~BIT(0); in r8156_hw_phy_cfg()
7580 ocp_reg_write(tp, 0xa454, data); in r8156_hw_phy_cfg()
7586 data = ocp_reg_read(tp, 0xad4e); in r8156_hw_phy_cfg()
7588 ocp_reg_write(tp, 0xad4e, data); in r8156_hw_phy_cfg()
7589 data = ocp_reg_read(tp, 0xa86a); in r8156_hw_phy_cfg()
7590 data &= ~BIT(0); in r8156_hw_phy_cfg()
7591 ocp_reg_write(tp, 0xa86a, data); in r8156_hw_phy_cfg()
7595 (ocp_reg_read(tp, 0xd068) & BIT(1))) { in r8156_hw_phy_cfg()
7598 data = ocp_reg_read(tp, 0xd068); in r8156_hw_phy_cfg()
7599 data &= ~0x1f; in r8156_hw_phy_cfg()
7600 data |= 0x1; /* p0 */ in r8156_hw_phy_cfg()
7601 ocp_reg_write(tp, 0xd068, data); in r8156_hw_phy_cfg()
7602 swap_a = ocp_reg_read(tp, 0xd06a); in r8156_hw_phy_cfg()
7603 data &= ~0x18; in r8156_hw_phy_cfg()
7604 data |= 0x18; /* p3 */ in r8156_hw_phy_cfg()
7605 ocp_reg_write(tp, 0xd068, data); in r8156_hw_phy_cfg()
7606 swap_b = ocp_reg_read(tp, 0xd06a); in r8156_hw_phy_cfg()
7607 data &= ~0x18; /* p0 */ in r8156_hw_phy_cfg()
7608 ocp_reg_write(tp, 0xd068, data); in r8156_hw_phy_cfg()
7609 ocp_reg_write(tp, 0xd06a, in r8156_hw_phy_cfg()
7610 (swap_a & ~0x7ff) | (swap_b & 0x7ff)); in r8156_hw_phy_cfg()
7611 data |= 0x18; /* p3 */ in r8156_hw_phy_cfg()
7612 ocp_reg_write(tp, 0xd068, data); in r8156_hw_phy_cfg()
7613 ocp_reg_write(tp, 0xd06a, in r8156_hw_phy_cfg()
7614 (swap_b & ~0x7ff) | (swap_a & 0x7ff)); in r8156_hw_phy_cfg()
7615 data &= ~0x18; in r8156_hw_phy_cfg()
7616 data |= 0x08; /* p1 */ in r8156_hw_phy_cfg()
7617 ocp_reg_write(tp, 0xd068, data); in r8156_hw_phy_cfg()
7618 swap_a = ocp_reg_read(tp, 0xd06a); in r8156_hw_phy_cfg()
7619 data &= ~0x18; in r8156_hw_phy_cfg()
7620 data |= 0x10; /* p2 */ in r8156_hw_phy_cfg()
7621 ocp_reg_write(tp, 0xd068, data); in r8156_hw_phy_cfg()
7622 swap_b = ocp_reg_read(tp, 0xd06a); in r8156_hw_phy_cfg()
7623 data &= ~0x18; in r8156_hw_phy_cfg()
7624 data |= 0x08; /* p1 */ in r8156_hw_phy_cfg()
7625 ocp_reg_write(tp, 0xd068, data); in r8156_hw_phy_cfg()
7626 ocp_reg_write(tp, 0xd06a, in r8156_hw_phy_cfg()
7627 (swap_a & ~0x7ff) | (swap_b & 0x7ff)); in r8156_hw_phy_cfg()
7628 data &= ~0x18; in r8156_hw_phy_cfg()
7629 data |= 0x10; /* p2 */ in r8156_hw_phy_cfg()
7630 ocp_reg_write(tp, 0xd068, data); in r8156_hw_phy_cfg()
7631 ocp_reg_write(tp, 0xd06a, in r8156_hw_phy_cfg()
7632 (swap_b & ~0x7ff) | (swap_a & 0x7ff)); in r8156_hw_phy_cfg()
7633 swap_a = ocp_reg_read(tp, 0xbd5a); in r8156_hw_phy_cfg()
7634 swap_b = ocp_reg_read(tp, 0xbd5c); in r8156_hw_phy_cfg()
7635 ocp_reg_write(tp, 0xbd5a, (swap_a & ~0x1f1f) | in r8156_hw_phy_cfg()
7636 ((swap_b & 0x1f) << 8) | in r8156_hw_phy_cfg()
7637 ((swap_b >> 8) & 0x1f)); in r8156_hw_phy_cfg()
7638 ocp_reg_write(tp, 0xbd5c, (swap_b & ~0x1f1f) | in r8156_hw_phy_cfg()
7639 ((swap_a & 0x1f) << 8) | in r8156_hw_phy_cfg()
7640 ((swap_a >> 8) & 0x1f)); in r8156_hw_phy_cfg()
7641 swap_a = ocp_reg_read(tp, 0xbc18); in r8156_hw_phy_cfg()
7642 swap_b = ocp_reg_read(tp, 0xbc1a); in r8156_hw_phy_cfg()
7643 ocp_reg_write(tp, 0xbc18, (swap_a & ~0x1f1f) | in r8156_hw_phy_cfg()
7644 ((swap_b & 0x1f) << 8) | in r8156_hw_phy_cfg()
7645 ((swap_b >> 8) & 0x1f)); in r8156_hw_phy_cfg()
7646 ocp_reg_write(tp, 0xbc1a, (swap_b & ~0x1f1f) | in r8156_hw_phy_cfg()
7647 ((swap_a & 0x1f) << 8) | in r8156_hw_phy_cfg()
7648 ((swap_a >> 8) & 0x1f)); in r8156_hw_phy_cfg()
7662 data = ocp_reg_read(tp, 0xa428); in r8156_hw_phy_cfg()
7664 ocp_reg_write(tp, 0xa428, data); in r8156_hw_phy_cfg()
7665 data = ocp_reg_read(tp, 0xa5ea); in r8156_hw_phy_cfg()
7666 data &= ~BIT(0); in r8156_hw_phy_cfg()
7667 ocp_reg_write(tp, 0xa5ea, data); in r8156_hw_phy_cfg()
7668 tp->ups_info.lite_mode = 0; in r8156_hw_phy_cfg()
7687 ocp_reg_write(tp, 0xbf86, 0x9000); in r8156b_hw_phy_cfg()
7688 data = ocp_reg_read(tp, 0xc402); in r8156b_hw_phy_cfg()
7690 ocp_reg_write(tp, 0xc402, data); in r8156b_hw_phy_cfg()
7692 ocp_reg_write(tp, 0xc402, data); in r8156b_hw_phy_cfg()
7693 ocp_reg_write(tp, 0xbd86, 0x1010); in r8156b_hw_phy_cfg()
7694 ocp_reg_write(tp, 0xbd88, 0x1010); in r8156b_hw_phy_cfg()
7695 data = ocp_reg_read(tp, 0xbd4e); in r8156b_hw_phy_cfg()
7698 ocp_reg_write(tp, 0xbd4e, data); in r8156b_hw_phy_cfg()
7699 data = ocp_reg_read(tp, 0xbf46); in r8156b_hw_phy_cfg()
7700 data &= ~0xf00; in r8156b_hw_phy_cfg()
7701 data |= 0x700; in r8156b_hw_phy_cfg()
7702 ocp_reg_write(tp, 0xbf46, data); in r8156b_hw_phy_cfg()
7718 data = r8153_phy_status(tp, 0); in r8156b_hw_phy_cfg()
7723 data = ocp_reg_read(tp, 0xa466); in r8156b_hw_phy_cfg()
7724 data &= ~BIT(0); in r8156b_hw_phy_cfg()
7725 ocp_reg_write(tp, 0xa466, data); in r8156b_hw_phy_cfg()
7727 data = ocp_reg_read(tp, 0xa468); in r8156b_hw_phy_cfg()
7729 ocp_reg_write(tp, 0xa468, data); in r8156b_hw_phy_cfg()
7759 data = ocp_reg_read(tp, 0xbc08); in r8156b_hw_phy_cfg()
7761 ocp_reg_write(tp, 0xbc08, data); in r8156b_hw_phy_cfg()
7763 data = sram_read(tp, 0x8fff); in r8156b_hw_phy_cfg()
7764 data &= ~0xff00; in r8156b_hw_phy_cfg()
7765 data |= 0x0400; in r8156b_hw_phy_cfg()
7766 sram_write(tp, 0x8fff, data); in r8156b_hw_phy_cfg()
7768 data = ocp_reg_read(tp, 0xacda); in r8156b_hw_phy_cfg()
7769 data |= 0xff00; in r8156b_hw_phy_cfg()
7770 ocp_reg_write(tp, 0xacda, data); in r8156b_hw_phy_cfg()
7771 data = ocp_reg_read(tp, 0xacde); in r8156b_hw_phy_cfg()
7772 data |= 0xf000; in r8156b_hw_phy_cfg()
7773 ocp_reg_write(tp, 0xacde, data); in r8156b_hw_phy_cfg()
7774 ocp_reg_write(tp, 0xac8c, 0x0ffc); in r8156b_hw_phy_cfg()
7775 ocp_reg_write(tp, 0xac46, 0xb7b4); in r8156b_hw_phy_cfg()
7776 ocp_reg_write(tp, 0xac50, 0x0fbc); in r8156b_hw_phy_cfg()
7777 ocp_reg_write(tp, 0xac3c, 0x9240); in r8156b_hw_phy_cfg()
7778 ocp_reg_write(tp, 0xac4e, 0x0db4); in r8156b_hw_phy_cfg()
7779 ocp_reg_write(tp, 0xacc6, 0x0707); in r8156b_hw_phy_cfg()
7780 ocp_reg_write(tp, 0xacc8, 0xa0d3); in r8156b_hw_phy_cfg()
7781 ocp_reg_write(tp, 0xad08, 0x0007); in r8156b_hw_phy_cfg()
7783 ocp_reg_write(tp, 0xb87c, 0x8560); in r8156b_hw_phy_cfg()
7784 ocp_reg_write(tp, 0xb87e, 0x19cc); in r8156b_hw_phy_cfg()
7785 ocp_reg_write(tp, 0xb87c, 0x8562); in r8156b_hw_phy_cfg()
7786 ocp_reg_write(tp, 0xb87e, 0x19cc); in r8156b_hw_phy_cfg()
7787 ocp_reg_write(tp, 0xb87c, 0x8564); in r8156b_hw_phy_cfg()
7788 ocp_reg_write(tp, 0xb87e, 0x19cc); in r8156b_hw_phy_cfg()
7789 ocp_reg_write(tp, 0xb87c, 0x8566); in r8156b_hw_phy_cfg()
7790 ocp_reg_write(tp, 0xb87e, 0x147d); in r8156b_hw_phy_cfg()
7791 ocp_reg_write(tp, 0xb87c, 0x8568); in r8156b_hw_phy_cfg()
7792 ocp_reg_write(tp, 0xb87e, 0x147d); in r8156b_hw_phy_cfg()
7793 ocp_reg_write(tp, 0xb87c, 0x856a); in r8156b_hw_phy_cfg()
7794 ocp_reg_write(tp, 0xb87e, 0x147d); in r8156b_hw_phy_cfg()
7795 ocp_reg_write(tp, 0xb87c, 0x8ffe); in r8156b_hw_phy_cfg()
7796 ocp_reg_write(tp, 0xb87e, 0x0907); in r8156b_hw_phy_cfg()
7797 ocp_reg_write(tp, 0xb87c, 0x80d6); in r8156b_hw_phy_cfg()
7798 ocp_reg_write(tp, 0xb87e, 0x2801); in r8156b_hw_phy_cfg()
7799 ocp_reg_write(tp, 0xb87c, 0x80f2); in r8156b_hw_phy_cfg()
7800 ocp_reg_write(tp, 0xb87e, 0x2801); in r8156b_hw_phy_cfg()
7801 ocp_reg_write(tp, 0xb87c, 0x80f4); in r8156b_hw_phy_cfg()
7802 ocp_reg_write(tp, 0xb87e, 0x6077); in r8156b_hw_phy_cfg()
7803 ocp_reg_write(tp, 0xb506, 0x01e7); in r8156b_hw_phy_cfg()
7805 ocp_reg_write(tp, 0xb87c, 0x8013); in r8156b_hw_phy_cfg()
7806 ocp_reg_write(tp, 0xb87e, 0x0700); in r8156b_hw_phy_cfg()
7807 ocp_reg_write(tp, 0xb87c, 0x8fb9); in r8156b_hw_phy_cfg()
7808 ocp_reg_write(tp, 0xb87e, 0x2801); in r8156b_hw_phy_cfg()
7809 ocp_reg_write(tp, 0xb87c, 0x8fba); in r8156b_hw_phy_cfg()
7810 ocp_reg_write(tp, 0xb87e, 0x0100); in r8156b_hw_phy_cfg()
7811 ocp_reg_write(tp, 0xb87c, 0x8fbc); in r8156b_hw_phy_cfg()
7812 ocp_reg_write(tp, 0xb87e, 0x1900); in r8156b_hw_phy_cfg()
7813 ocp_reg_write(tp, 0xb87c, 0x8fbe); in r8156b_hw_phy_cfg()
7814 ocp_reg_write(tp, 0xb87e, 0xe100); in r8156b_hw_phy_cfg()
7815 ocp_reg_write(tp, 0xb87c, 0x8fc0); in r8156b_hw_phy_cfg()
7816 ocp_reg_write(tp, 0xb87e, 0x0800); in r8156b_hw_phy_cfg()
7817 ocp_reg_write(tp, 0xb87c, 0x8fc2); in r8156b_hw_phy_cfg()
7818 ocp_reg_write(tp, 0xb87e, 0xe500); in r8156b_hw_phy_cfg()
7819 ocp_reg_write(tp, 0xb87c, 0x8fc4); in r8156b_hw_phy_cfg()
7820 ocp_reg_write(tp, 0xb87e, 0x0f00); in r8156b_hw_phy_cfg()
7821 ocp_reg_write(tp, 0xb87c, 0x8fc6); in r8156b_hw_phy_cfg()
7822 ocp_reg_write(tp, 0xb87e, 0xf100); in r8156b_hw_phy_cfg()
7823 ocp_reg_write(tp, 0xb87c, 0x8fc8); in r8156b_hw_phy_cfg()
7824 ocp_reg_write(tp, 0xb87e, 0x0400); in r8156b_hw_phy_cfg()
7825 ocp_reg_write(tp, 0xb87c, 0x8fca); in r8156b_hw_phy_cfg()
7826 ocp_reg_write(tp, 0xb87e, 0xf300); in r8156b_hw_phy_cfg()
7827 ocp_reg_write(tp, 0xb87c, 0x8fcc); in r8156b_hw_phy_cfg()
7828 ocp_reg_write(tp, 0xb87e, 0xfd00); in r8156b_hw_phy_cfg()
7829 ocp_reg_write(tp, 0xb87c, 0x8fce); in r8156b_hw_phy_cfg()
7830 ocp_reg_write(tp, 0xb87e, 0xff00); in r8156b_hw_phy_cfg()
7831 ocp_reg_write(tp, 0xb87c, 0x8fd0); in r8156b_hw_phy_cfg()
7832 ocp_reg_write(tp, 0xb87e, 0xfb00); in r8156b_hw_phy_cfg()
7833 ocp_reg_write(tp, 0xb87c, 0x8fd2); in r8156b_hw_phy_cfg()
7834 ocp_reg_write(tp, 0xb87e, 0x0100); in r8156b_hw_phy_cfg()
7835 ocp_reg_write(tp, 0xb87c, 0x8fd4); in r8156b_hw_phy_cfg()
7836 ocp_reg_write(tp, 0xb87e, 0xf400); in r8156b_hw_phy_cfg()
7837 ocp_reg_write(tp, 0xb87c, 0x8fd6); in r8156b_hw_phy_cfg()
7838 ocp_reg_write(tp, 0xb87e, 0xff00); in r8156b_hw_phy_cfg()
7839 ocp_reg_write(tp, 0xb87c, 0x8fd8); in r8156b_hw_phy_cfg()
7840 ocp_reg_write(tp, 0xb87e, 0xf600); in r8156b_hw_phy_cfg()
7845 ocp_reg_write(tp, 0xb87c, 0x813d); in r8156b_hw_phy_cfg()
7846 ocp_reg_write(tp, 0xb87e, 0x390e); in r8156b_hw_phy_cfg()
7847 ocp_reg_write(tp, 0xb87c, 0x814f); in r8156b_hw_phy_cfg()
7848 ocp_reg_write(tp, 0xb87e, 0x790e); in r8156b_hw_phy_cfg()
7849 ocp_reg_write(tp, 0xb87c, 0x80b0); in r8156b_hw_phy_cfg()
7850 ocp_reg_write(tp, 0xb87e, 0x0f31); in r8156b_hw_phy_cfg()
7851 data = ocp_reg_read(tp, 0xbf4c); in r8156b_hw_phy_cfg()
7853 ocp_reg_write(tp, 0xbf4c, data); in r8156b_hw_phy_cfg()
7854 data = ocp_reg_read(tp, 0xbcca); in r8156b_hw_phy_cfg()
7856 ocp_reg_write(tp, 0xbcca, data); in r8156b_hw_phy_cfg()
7857 ocp_reg_write(tp, 0xb87c, 0x8141); in r8156b_hw_phy_cfg()
7858 ocp_reg_write(tp, 0xb87e, 0x320e); in r8156b_hw_phy_cfg()
7859 ocp_reg_write(tp, 0xb87c, 0x8153); in r8156b_hw_phy_cfg()
7860 ocp_reg_write(tp, 0xb87e, 0x720e); in r8156b_hw_phy_cfg()
7861 ocp_reg_write(tp, 0xb87c, 0x8529); in r8156b_hw_phy_cfg()
7862 ocp_reg_write(tp, 0xb87e, 0x050e); in r8156b_hw_phy_cfg()
7867 sram_write(tp, 0x816c, 0xc4a0); in r8156b_hw_phy_cfg()
7868 sram_write(tp, 0x8170, 0xc4a0); in r8156b_hw_phy_cfg()
7869 sram_write(tp, 0x8174, 0x04a0); in r8156b_hw_phy_cfg()
7870 sram_write(tp, 0x8178, 0x04a0); in r8156b_hw_phy_cfg()
7871 sram_write(tp, 0x817c, 0x0719); in r8156b_hw_phy_cfg()
7872 sram_write(tp, 0x8ff4, 0x0400); in r8156b_hw_phy_cfg()
7873 sram_write(tp, 0x8ff1, 0x0404); in r8156b_hw_phy_cfg()
7875 ocp_reg_write(tp, 0xbf4a, 0x001b); in r8156b_hw_phy_cfg()
7876 ocp_reg_write(tp, 0xb87c, 0x8033); in r8156b_hw_phy_cfg()
7877 ocp_reg_write(tp, 0xb87e, 0x7c13); in r8156b_hw_phy_cfg()
7878 ocp_reg_write(tp, 0xb87c, 0x8037); in r8156b_hw_phy_cfg()
7879 ocp_reg_write(tp, 0xb87e, 0x7c13); in r8156b_hw_phy_cfg()
7880 ocp_reg_write(tp, 0xb87c, 0x803b); in r8156b_hw_phy_cfg()
7881 ocp_reg_write(tp, 0xb87e, 0xfc32); in r8156b_hw_phy_cfg()
7882 ocp_reg_write(tp, 0xb87c, 0x803f); in r8156b_hw_phy_cfg()
7883 ocp_reg_write(tp, 0xb87e, 0x7c13); in r8156b_hw_phy_cfg()
7884 ocp_reg_write(tp, 0xb87c, 0x8043); in r8156b_hw_phy_cfg()
7885 ocp_reg_write(tp, 0xb87e, 0x7c13); in r8156b_hw_phy_cfg()
7886 ocp_reg_write(tp, 0xb87c, 0x8047); in r8156b_hw_phy_cfg()
7887 ocp_reg_write(tp, 0xb87e, 0x7c13); in r8156b_hw_phy_cfg()
7889 ocp_reg_write(tp, 0xb87c, 0x8145); in r8156b_hw_phy_cfg()
7890 ocp_reg_write(tp, 0xb87e, 0x370e); in r8156b_hw_phy_cfg()
7891 ocp_reg_write(tp, 0xb87c, 0x8157); in r8156b_hw_phy_cfg()
7892 ocp_reg_write(tp, 0xb87e, 0x770e); in r8156b_hw_phy_cfg()
7893 ocp_reg_write(tp, 0xb87c, 0x8169); in r8156b_hw_phy_cfg()
7894 ocp_reg_write(tp, 0xb87e, 0x0d0a); in r8156b_hw_phy_cfg()
7895 ocp_reg_write(tp, 0xb87c, 0x817b); in r8156b_hw_phy_cfg()
7896 ocp_reg_write(tp, 0xb87e, 0x1d0a); in r8156b_hw_phy_cfg()
7898 data = sram_read(tp, 0x8217); in r8156b_hw_phy_cfg()
7899 data &= ~0xff00; in r8156b_hw_phy_cfg()
7900 data |= 0x5000; in r8156b_hw_phy_cfg()
7901 sram_write(tp, 0x8217, data); in r8156b_hw_phy_cfg()
7902 data = sram_read(tp, 0x821a); in r8156b_hw_phy_cfg()
7903 data &= ~0xff00; in r8156b_hw_phy_cfg()
7904 data |= 0x5000; in r8156b_hw_phy_cfg()
7905 sram_write(tp, 0x821a, data); in r8156b_hw_phy_cfg()
7906 sram_write(tp, 0x80da, 0x0403); in r8156b_hw_phy_cfg()
7907 data = sram_read(tp, 0x80dc); in r8156b_hw_phy_cfg()
7908 data &= ~0xff00; in r8156b_hw_phy_cfg()
7909 data |= 0x1000; in r8156b_hw_phy_cfg()
7910 sram_write(tp, 0x80dc, data); in r8156b_hw_phy_cfg()
7911 sram_write(tp, 0x80b3, 0x0384); in r8156b_hw_phy_cfg()
7912 sram_write(tp, 0x80b7, 0x2007); in r8156b_hw_phy_cfg()
7913 data = sram_read(tp, 0x80ba); in r8156b_hw_phy_cfg()
7914 data &= ~0xff00; in r8156b_hw_phy_cfg()
7915 data |= 0x6c00; in r8156b_hw_phy_cfg()
7916 sram_write(tp, 0x80ba, data); in r8156b_hw_phy_cfg()
7917 sram_write(tp, 0x80b5, 0xf009); in r8156b_hw_phy_cfg()
7918 data = sram_read(tp, 0x80bd); in r8156b_hw_phy_cfg()
7919 data &= ~0xff00; in r8156b_hw_phy_cfg()
7920 data |= 0x9f00; in r8156b_hw_phy_cfg()
7921 sram_write(tp, 0x80bd, data); in r8156b_hw_phy_cfg()
7922 sram_write(tp, 0x80c7, 0xf083); in r8156b_hw_phy_cfg()
7923 sram_write(tp, 0x80dd, 0x03f0); in r8156b_hw_phy_cfg()
7924 data = sram_read(tp, 0x80df); in r8156b_hw_phy_cfg()
7925 data &= ~0xff00; in r8156b_hw_phy_cfg()
7926 data |= 0x1000; in r8156b_hw_phy_cfg()
7927 sram_write(tp, 0x80df, data); in r8156b_hw_phy_cfg()
7928 sram_write(tp, 0x80cb, 0x2007); in r8156b_hw_phy_cfg()
7929 data = sram_read(tp, 0x80ce); in r8156b_hw_phy_cfg()
7930 data &= ~0xff00; in r8156b_hw_phy_cfg()
7931 data |= 0x6c00; in r8156b_hw_phy_cfg()
7932 sram_write(tp, 0x80ce, data); in r8156b_hw_phy_cfg()
7933 sram_write(tp, 0x80c9, 0x8009); in r8156b_hw_phy_cfg()
7934 data = sram_read(tp, 0x80d1); in r8156b_hw_phy_cfg()
7935 data &= ~0xff00; in r8156b_hw_phy_cfg()
7936 data |= 0x8000; in r8156b_hw_phy_cfg()
7937 sram_write(tp, 0x80d1, data); in r8156b_hw_phy_cfg()
7938 sram_write(tp, 0x80a3, 0x200a); in r8156b_hw_phy_cfg()
7939 sram_write(tp, 0x80a5, 0xf0ad); in r8156b_hw_phy_cfg()
7940 sram_write(tp, 0x809f, 0x6073); in r8156b_hw_phy_cfg()
7941 sram_write(tp, 0x80a1, 0x000b); in r8156b_hw_phy_cfg()
7942 data = sram_read(tp, 0x80a9); in r8156b_hw_phy_cfg()
7943 data &= ~0xff00; in r8156b_hw_phy_cfg()
7944 data |= 0xc000; in r8156b_hw_phy_cfg()
7945 sram_write(tp, 0x80a9, data); in r8156b_hw_phy_cfg()
7950 data = ocp_reg_read(tp, 0xb896); in r8156b_hw_phy_cfg()
7951 data &= ~BIT(0); in r8156b_hw_phy_cfg()
7952 ocp_reg_write(tp, 0xb896, data); in r8156b_hw_phy_cfg()
7953 data = ocp_reg_read(tp, 0xb892); in r8156b_hw_phy_cfg()
7954 data &= ~0xff00; in r8156b_hw_phy_cfg()
7955 ocp_reg_write(tp, 0xb892, data); in r8156b_hw_phy_cfg()
7956 ocp_reg_write(tp, 0xb88e, 0xc23e); in r8156b_hw_phy_cfg()
7957 ocp_reg_write(tp, 0xb890, 0x0000); in r8156b_hw_phy_cfg()
7958 ocp_reg_write(tp, 0xb88e, 0xc240); in r8156b_hw_phy_cfg()
7959 ocp_reg_write(tp, 0xb890, 0x0103); in r8156b_hw_phy_cfg()
7960 ocp_reg_write(tp, 0xb88e, 0xc242); in r8156b_hw_phy_cfg()
7961 ocp_reg_write(tp, 0xb890, 0x0507); in r8156b_hw_phy_cfg()
7962 ocp_reg_write(tp, 0xb88e, 0xc244); in r8156b_hw_phy_cfg()
7963 ocp_reg_write(tp, 0xb890, 0x090b); in r8156b_hw_phy_cfg()
7964 ocp_reg_write(tp, 0xb88e, 0xc246); in r8156b_hw_phy_cfg()
7965 ocp_reg_write(tp, 0xb890, 0x0c0e); in r8156b_hw_phy_cfg()
7966 ocp_reg_write(tp, 0xb88e, 0xc248); in r8156b_hw_phy_cfg()
7967 ocp_reg_write(tp, 0xb890, 0x1012); in r8156b_hw_phy_cfg()
7968 ocp_reg_write(tp, 0xb88e, 0xc24a); in r8156b_hw_phy_cfg()
7969 ocp_reg_write(tp, 0xb890, 0x1416); in r8156b_hw_phy_cfg()
7970 data = ocp_reg_read(tp, 0xb896); in r8156b_hw_phy_cfg()
7971 data |= BIT(0); in r8156b_hw_phy_cfg()
7972 ocp_reg_write(tp, 0xb896, data); in r8156b_hw_phy_cfg()
7976 data = ocp_reg_read(tp, 0xa86a); in r8156b_hw_phy_cfg()
7977 data |= BIT(0); in r8156b_hw_phy_cfg()
7978 ocp_reg_write(tp, 0xa86a, data); in r8156b_hw_phy_cfg()
7979 data = ocp_reg_read(tp, 0xa6f0); in r8156b_hw_phy_cfg()
7980 data |= BIT(0); in r8156b_hw_phy_cfg()
7981 ocp_reg_write(tp, 0xa6f0, data); in r8156b_hw_phy_cfg()
7983 ocp_reg_write(tp, 0xbfa0, 0xd70d); in r8156b_hw_phy_cfg()
7984 ocp_reg_write(tp, 0xbfa2, 0x4100); in r8156b_hw_phy_cfg()
7985 ocp_reg_write(tp, 0xbfa4, 0xe868); in r8156b_hw_phy_cfg()
7986 ocp_reg_write(tp, 0xbfa6, 0xdc59); in r8156b_hw_phy_cfg()
7987 ocp_reg_write(tp, 0xb54c, 0x3c18); in r8156b_hw_phy_cfg()
7988 data = ocp_reg_read(tp, 0xbfa4); in r8156b_hw_phy_cfg()
7990 ocp_reg_write(tp, 0xbfa4, data); in r8156b_hw_phy_cfg()
7991 data = sram_read(tp, 0x817d); in r8156b_hw_phy_cfg()
7993 sram_write(tp, 0x817d, data); in r8156b_hw_phy_cfg()
7997 data = ocp_reg_read(tp, 0xac46); in r8156b_hw_phy_cfg()
7998 data &= ~0x00f0; in r8156b_hw_phy_cfg()
7999 data |= 0x0090; in r8156b_hw_phy_cfg()
8000 ocp_reg_write(tp, 0xac46, data); in r8156b_hw_phy_cfg()
8001 data = ocp_reg_read(tp, 0xad30); in r8156b_hw_phy_cfg()
8002 data &= ~0x0003; in r8156b_hw_phy_cfg()
8003 data |= 0x0001; in r8156b_hw_phy_cfg()
8004 ocp_reg_write(tp, 0xad30, data); in r8156b_hw_phy_cfg()
8008 ocp_reg_write(tp, 0xb87c, 0x80f5); in r8156b_hw_phy_cfg()
8009 ocp_reg_write(tp, 0xb87e, 0x760e); in r8156b_hw_phy_cfg()
8010 ocp_reg_write(tp, 0xb87c, 0x8107); in r8156b_hw_phy_cfg()
8011 ocp_reg_write(tp, 0xb87e, 0x360e); in r8156b_hw_phy_cfg()
8012 ocp_reg_write(tp, 0xb87c, 0x8551); in r8156b_hw_phy_cfg()
8013 data = ocp_reg_read(tp, 0xb87e); in r8156b_hw_phy_cfg()
8014 data &= ~0xff00; in r8156b_hw_phy_cfg()
8015 data |= 0x0800; in r8156b_hw_phy_cfg()
8016 ocp_reg_write(tp, 0xb87e, data); in r8156b_hw_phy_cfg()
8019 data = ocp_reg_read(tp, 0xbf00); in r8156b_hw_phy_cfg()
8020 data &= ~0xe000; in r8156b_hw_phy_cfg()
8021 data |= 0xa000; in r8156b_hw_phy_cfg()
8022 ocp_reg_write(tp, 0xbf00, data); in r8156b_hw_phy_cfg()
8023 data = ocp_reg_read(tp, 0xbf46); in r8156b_hw_phy_cfg()
8024 data &= ~0x0f00; in r8156b_hw_phy_cfg()
8025 data |= 0x0300; in r8156b_hw_phy_cfg()
8026 ocp_reg_write(tp, 0xbf46, data); in r8156b_hw_phy_cfg()
8029 sram_write(tp, 0x8044, 0x2417); in r8156b_hw_phy_cfg()
8030 sram_write(tp, 0x804a, 0x2417); in r8156b_hw_phy_cfg()
8031 sram_write(tp, 0x8050, 0x2417); in r8156b_hw_phy_cfg()
8032 sram_write(tp, 0x8056, 0x2417); in r8156b_hw_phy_cfg()
8033 sram_write(tp, 0x805c, 0x2417); in r8156b_hw_phy_cfg()
8034 sram_write(tp, 0x8062, 0x2417); in r8156b_hw_phy_cfg()
8035 sram_write(tp, 0x8068, 0x2417); in r8156b_hw_phy_cfg()
8036 sram_write(tp, 0x806e, 0x2417); in r8156b_hw_phy_cfg()
8037 sram_write(tp, 0x8074, 0x2417); in r8156b_hw_phy_cfg()
8038 sram_write(tp, 0x807a, 0x2417); in r8156b_hw_phy_cfg()
8041 data = ocp_reg_read(tp, 0xbf84); in r8156b_hw_phy_cfg()
8042 data &= ~0xe000; in r8156b_hw_phy_cfg()
8043 data |= 0xa000; in r8156b_hw_phy_cfg()
8044 ocp_reg_write(tp, 0xbf84, data); in r8156b_hw_phy_cfg()
8079 data = ocp_reg_read(tp, 0xa428); in r8156b_hw_phy_cfg()
8081 ocp_reg_write(tp, 0xa428, data); in r8156b_hw_phy_cfg()
8082 data = ocp_reg_read(tp, 0xa5ea); in r8156b_hw_phy_cfg()
8083 data &= ~BIT(0); in r8156b_hw_phy_cfg()
8084 ocp_reg_write(tp, 0xa5ea, data); in r8156b_hw_phy_cfg()
8085 tp->ups_info.lite_mode = 0; in r8156b_hw_phy_cfg()
8110 ocp_write_word(tp, MCU_TYPE_USB, USB_SPEED_OPTION, 0); in r8156_init()
8118 for (i = 0; i < 500; i++) { in r8156_init()
8128 data = r8153_phy_status(tp, 0); in r8156_init()
8130 data = ocp_reg_read(tp, 0xa468); in r8156_init()
8132 ocp_reg_write(tp, 0xa468, data); in r8156_init()
8146 /* MSC timer = 0xfff * 8ms = 32760 ms */ in r8156_init()
8147 ocp_write_word(tp, MCU_TYPE_USB, USB_MSC_TIMER, 0x0fff); in r8156_init()
8206 ocp_write_word(tp, MCU_TYPE_USB, USB_SPEED_OPTION, 0); in r8156b_init()
8227 for (i = 0; i < 500; i++) { in r8156b_init()
8237 data = r8153_phy_status(tp, 0); in r8156b_init()
8239 data = ocp_reg_read(tp, 0xa468); in r8156b_init()
8241 ocp_reg_write(tp, 0xa468, data); in r8156b_init()
8243 data = ocp_reg_read(tp, 0xa466); in r8156b_init()
8244 data &= ~BIT(0); in r8156b_init()
8245 ocp_reg_write(tp, 0xa466, data); in r8156b_init()
8258 /* MSC timer = 0xfff * 8ms = 32760 ms */ in r8156b_init()
8259 ocp_write_word(tp, MCU_TYPE_USB, USB_MSC_TIMER, 0x0fff); in r8156b_init()
8328 if (usb_find_common_endpoints(alt, &in, &out, &intr, NULL) < 0) { in rtl_check_vendor_ok()
8360 return 0; in rtl8152_pre_reset()
8364 return 0; in rtl8152_pre_reset()
8380 return 0; in rtl8152_pre_reset()
8390 return 0; in rtl8152_post_reset()
8395 if (determine_ethernet_addr(tp, &sa) >= 0) { in rtl8152_post_reset()
8403 return 0; in rtl8152_post_reset()
8422 return 0; in rtl8152_post_reset()
8484 return 0; in rtl8152_runtime_resume()
8500 return 0; in rtl8152_system_resume()
8506 int ret = 0; in rtl8152_runtime_suspend()
8515 u32 rcr = 0; in rtl8152_runtime_suspend()
8580 return 0; in rtl8152_system_suspend()
8626 queue_delayed_work(system_long_wq, &tp->hw_phy_work, 0); in rtl8152_reset_resume()
8635 if (usb_autopm_get_interface(tp->intf) < 0) in rtl8152_get_wol()
8639 wol->supported = 0; in rtl8152_get_wol()
8640 wol->wolopts = 0; in rtl8152_get_wol()
8663 if (ret < 0) in rtl8152_set_wol()
8717 if (ret < 0) in rtl8152_get_link_ksettings()
8752 u32 advertising = 0; in rtl8152_set_link_ksettings()
8756 if (ret < 0) in rtl8152_set_link_ksettings()
8838 if (usb_autopm_get_interface(tp->intf) < 0) in rtl8152_get_ethtool_stats()
8845 data[0] = le64_to_cpu(tally.tx_packets); in rtl8152_get_ethtool_stats()
8871 u32 lp, adv, supported = 0; in r8152_get_eee()
8889 return 0; in r8152_get_eee()
8901 return 0; in r8152_set_eee()
8906 u32 lp, adv, supported = 0; in r8153_get_eee()
8924 return 0; in r8153_get_eee()
8939 if (ret < 0) in rtl_ethtool_get_eee()
8966 if (ret < 0) in rtl_ethtool_set_eee()
8989 if (ret < 0) in rtl8152_nway_reset()
9022 return 0; in rtl8152_get_coalesce()
9046 if (ret < 0) in rtl8152_set_coalesce()
9087 return 0; in rtl8152_get_tunable()
9122 return 0; in rtl8152_set_tunable()
9158 return 0; in rtl8152_set_ringparam()
9167 if (usb_autopm_get_interface(tp->intf) < 0) in rtl8152_get_pauseparam()
9181 pause->autoneg = 0; in rtl8152_get_pauseparam()
9182 pause->rx_pause = 0; in rtl8152_get_pauseparam()
9183 pause->tx_pause = 0; in rtl8152_get_pauseparam()
9202 u8 cap = 0; in rtl8152_set_pauseparam()
9206 if (ret < 0) in rtl8152_set_pauseparam()
9270 if (res < 0) in rtl8152_ioctl()
9314 return 0; in rtl8152_change_mtu()
9320 if (ret < 0) in rtl8152_change_mtu()
9394 int ret = 0; in rtl_ops_init()
9586 return 0; in rtl_fw_init()
9591 u32 ocp_data = 0; in __rtl_get_hw_ver()
9599 return 0; in __rtl_get_hw_ver()
9605 for (i = 0; i < 3; i++) { in __rtl_get_hw_ver()
9606 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), in __rtl_get_hw_ver()
9610 if (ret > 0) { in __rtl_get_hw_ver()
9616 if (i != 0 && ret > 0) in __rtl_get_hw_ver()
9622 case 0x4c00: in __rtl_get_hw_ver()
9625 case 0x4c10: in __rtl_get_hw_ver()
9628 case 0x5c00: in __rtl_get_hw_ver()
9631 case 0x5c10: in __rtl_get_hw_ver()
9634 case 0x5c20: in __rtl_get_hw_ver()
9637 case 0x5c30: in __rtl_get_hw_ver()
9640 case 0x4800: in __rtl_get_hw_ver()
9643 case 0x6000: in __rtl_get_hw_ver()
9646 case 0x6010: in __rtl_get_hw_ver()
9649 case 0x7010: in __rtl_get_hw_ver()
9652 case 0x7020: in __rtl_get_hw_ver()
9655 case 0x7030: in __rtl_get_hw_ver()
9658 case 0x7400: in __rtl_get_hw_ver()
9661 case 0x7410: in __rtl_get_hw_ver()
9664 case 0x6400: in __rtl_get_hw_ver()
9667 case 0x7420: in __rtl_get_hw_ver()
9672 dev_info(&udev->dev, "Unknown version 0x%04x\n", ocp_data); in __rtl_get_hw_ver()
9685 dev_dbg(&intf->dev, "Detected version 0x%04x\n", version); in rtl8152_get_version()
9709 case 0x8153: in rtl8152_supports_lenovo_macpassthru()
9713 return 0; in rtl8152_supports_lenovo_macpassthru()
9733 tp->msg_enable = 0x7FFF; in rtl8152_probe_once()
9740 tp->pipe_ctrl_in = usb_rcvctrlpipe(udev, 0); in rtl8152_probe_once()
9741 tp->pipe_ctrl_out = usb_sndctrlpipe(udev, 0); in rtl8152_probe_once()
9750 tp->mii.supports_gmii = 0; in rtl8152_probe_once()
9791 if (le16_to_cpu(udev->descriptor.bcdDevice) == 0x3011 && udev->serial && in rtl8152_probe_once()
9833 tp->mii.phy_id_mask = 0x3f; in rtl8152_probe_once()
9834 tp->mii.reg_num_mask = 0x1f; in rtl8152_probe_once()
9859 __rtl_set_wol(tp, 0); in rtl8152_probe_once()
9868 queue_delayed_work(system_long_wq, &tp->hw_phy_work, 0); in rtl8152_probe_once()
9876 if (ret != 0) { in rtl8152_probe_once()
9895 return 0; in rtl8152_probe_once()
9934 for (i = 0; i < RTL8152_PROBE_TRIES; i++) { in rtl8152_probe()
9969 { USB_DEVICE(VENDOR_ID_REALTEK, 0x8050) },
9970 { USB_DEVICE(VENDOR_ID_REALTEK, 0x8053) },
9971 { USB_DEVICE(VENDOR_ID_REALTEK, 0x8152) },
9972 { USB_DEVICE(VENDOR_ID_REALTEK, 0x8153) },
9973 { USB_DEVICE(VENDOR_ID_REALTEK, 0x8155) },
9974 { USB_DEVICE(VENDOR_ID_REALTEK, 0x8156) },
9977 { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab) },
9978 { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6) },
9979 { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927) },
9980 { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0c5e) },
9981 { USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101) },
9982 { USB_DEVICE(VENDOR_ID_LENOVO, 0x304f) },
9983 { USB_DEVICE(VENDOR_ID_LENOVO, 0x3054) },
9984 { USB_DEVICE(VENDOR_ID_LENOVO, 0x3062) },
9985 { USB_DEVICE(VENDOR_ID_LENOVO, 0x3069) },
9986 { USB_DEVICE(VENDOR_ID_LENOVO, 0x3082) },
9987 { USB_DEVICE(VENDOR_ID_LENOVO, 0x7205) },
9988 { USB_DEVICE(VENDOR_ID_LENOVO, 0x720c) },
9989 { USB_DEVICE(VENDOR_ID_LENOVO, 0x7214) },
9990 { USB_DEVICE(VENDOR_ID_LENOVO, 0x721e) },
9991 { USB_DEVICE(VENDOR_ID_LENOVO, 0xa387) },
9992 { USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) },
9993 { USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) },
9994 { USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) },
9995 { USB_DEVICE(VENDOR_ID_DLINK, 0xb301) },
10024 return 0; in rtl8152_cfgselector_probe()
10029 for (i = 0; i < num_configs; (i++, c++)) { in rtl8152_cfgselector_probe()
10034 desc = &c->intf_cache[0]->altsetting->desc; in rtl8152_cfgselector_probe()
10048 return 0; in rtl8152_cfgselector_probe()