Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint _phy_826xb_serdes_mode_init(int param_1,int param_2)
- {
- uint uVar1;
- int iVar2;
- undefined4 *puVar3;
- uint local_18 [3];
- local_18[0] = 0;
- uVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0x105,local_18);
- if (uVar1 == 0) {
- puVar3 = (undefined4 *)(*(int *)(rtl826xb_info + param_1 * 4) + param_2 * 4);
- if ((local_18[0] & 1) == 0) {
- *puVar3 = 0;
- }
- else {
- *puVar3 = 0xffff;
- }
- iVar2 = _phy_826xb_sdsReg_write(param_1,param_2,6,3,0xf,0,0x88c6);
- uVar1 = (uint)(iVar2 != 0);
- }
- return uVar1;
- }
- int _phy_826xb_serdes_reg_read
- (undefined4 param_1,undefined4 param_2,uint param_3,uint param_4,undefined4 *param_5)
- {
- int iVar1;
- int iVar2;
- undefined4 local_20;
- uint local_1c [2];
- local_1c[0] = param_3 & 0x3f | (param_4 & 0x1f) << 6 | 0x8000;
- local_20 = 0;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0x143,local_1c[0]);
- iVar2 = 10;
- if (iVar1 == 0) {
- while (iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0x143,local_1c), iVar1 == 0)
- {
- if ((local_1c[0] & 0x8000) == 0) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0x142,&local_20);
- if (iVar1 != 0) {
- return iVar1;
- }
- *param_5 = local_20;
- return 0;
- }
- iVar2 = iVar2 + -1;
- osal_time_udelay(10);
- if (iVar2 == 0) {
- return 0xf01f;
- }
- }
- }
- return iVar1;
- }
- void _phy_826xb_serdes_reg_write
- (undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
- undefined4 param_5)
- {
- int iVar1;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0x141,param_5);
- if (iVar1 == 0) {
- /* WARNING: Could not recover jumptable at 0x00b9c708. Too many branches */
- /* WARNING: Treating indirect jump as call */
- phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0x143);
- return;
- }
- return;
- }
- int _phy_826xb_serdes_mode_power_off_set(undefined4 param_1,undefined4 param_2)
- {
- int iVar1;
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0xc2,4,0,0x1f);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0xc6,4,0,0x1f);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0xc5,4,0,0x1f);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0xc4,4,0,0x1f);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0xc3,4,0,0x1f);
- if (iVar1 == 0) {
- osal_time_udelay(100000);
- }
- }
- }
- }
- }
- return iVar1;
- }
- void _phy_826xb_serdes_mode_usxgmii_set(undefined4 param_1,undefined4 param_2)
- {
- int iVar1;
- uint local_18 [2];
- local_18[0] = 0;
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0x105,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] & 0xfffffffe;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0x105,local_18[0]);
- if (iVar1 == 0) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0xc2,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] & 0xfffffc00 | 0xd;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0xc2,local_18[0]);
- if (iVar1 == 0) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0x3f1,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] & 0xffff0000 | 0x72;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0x3f1,local_18[0]);
- if (iVar1 == 0) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0x2a2,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] & 0xffffff7f;
- phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0x2a2,local_18[0]);
- }
- }
- }
- }
- }
- }
- }
- return;
- }
- void _phy_826xb_serdes_mode_10gr_set(undefined4 param_1,undefined4 param_2)
- {
- int iVar1;
- uint local_18 [2];
- local_18[0] = 0;
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0x105,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] | 1;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0x105,local_18[0]);
- if (iVar1 == 0) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0xc6,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] & 0xffffffe0 | 0x1a;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0xc6,local_18[0]);
- if (iVar1 == 0) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0xc2,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] & 0xfffffc1f;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0xc2,local_18[0]);
- if (iVar1 == 0) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0x2a2,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] & 0xffffff7f;
- phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0x2a2,local_18[0]);
- }
- }
- }
- }
- }
- }
- }
- return;
- }
- void _phy_826xb_serdes_mode_sgmii_set(undefined4 param_1,undefined4 param_2)
- {
- int iVar1;
- uint local_18 [2];
- local_18[0] = 0;
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0x105,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] | 1;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0x105,local_18[0]);
- if (iVar1 == 0) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0xc3,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] & 0xfffffff0 | 2;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0xc3,local_18[0]);
- if (iVar1 == 0) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0xc2,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] & 0xfffffc1f;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0xc2,local_18[0]);
- if (iVar1 == 0) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0x2a2,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] & 0xffffff7f;
- phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0x2a2,local_18[0]);
- }
- }
- }
- }
- }
- }
- }
- return;
- }
- int _phy_826xb_serdes_mode_set(int param_1,int param_2,uint param_3)
- {
- int iVar1;
- code *pcVar2;
- if (param_3 == 0x1001) {
- iVar1 = _phy_826xb_serdes_mode_10gr_set();
- if (iVar1 != 0) {
- return iVar1;
- }
- pcVar2 = _phy_826xb_serdes_mode_5gx_set;
- LAB_00ba4f34:
- iVar1 = (*pcVar2)(param_1,param_2);
- if (iVar1 != 0) {
- return iVar1;
- }
- pcVar2 = _phy_826xb_serdes_mode_2p5gx_set;
- }
- else {
- if (param_3 < 0x1002) {
- if (param_3 == 0) {
- pcVar2 = _phy_826xb_serdes_mode_usxgmii_set;
- }
- else {
- if (param_3 != 0xff) {
- return 0xf001;
- }
- pcVar2 = _phy_826xb_serdes_mode_power_off_set;
- }
- goto LAB_00ba4e6c;
- }
- if ((param_3 == 0x1101) || (param_3 == 0x1102)) {
- iVar1 = _phy_826xb_serdes_mode_10gr_set();
- if (iVar1 != 0) {
- return iVar1;
- }
- pcVar2 = _phy_826xb_serdes_mode_5g_off_set;
- goto LAB_00ba4f34;
- }
- if (param_3 != 0x1002) {
- return 0xf001;
- }
- iVar1 = _phy_826xb_serdes_mode_10gr_set();
- if (iVar1 != 0) {
- return iVar1;
- }
- iVar1 = _phy_826xb_serdes_mode_xfi_5g_adapt_set(param_1,param_2);
- if (iVar1 != 0) {
- return iVar1;
- }
- pcVar2 = _phy_826xb_serdes_mode_xfi_2p5g_adapt_set;
- }
- iVar1 = (*pcVar2)(param_1,param_2);
- if (iVar1 != 0) {
- return iVar1;
- }
- pcVar2 = _phy_826xb_serdes_mode_sgmii_set;
- LAB_00ba4e6c:
- iVar1 = (*pcVar2)(param_1,param_2);
- if (iVar1 == 0) {
- *(uint *)(*(int *)(rtl826xb_info + param_1 * 4) + param_2 * 4) = param_3;
- iVar1 = 0;
- }
- return iVar1;
- }
- undefined4
- hal_miim_mmd_write(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
- undefined4 param_5)
- {
- int iVar1;
- undefined4 uVar2;
- code *UNRECOVERED_JUMPTABLE;
- rt_log(8,param_2,0,0x10000,"unit=%d, port=%d, mmdAddr=0x%x, mmdReg=0x%x data=0x%x",
- param_1,param_2,param_3,param_4,param_5);
- iVar1 = hal_ctrlInfo_get(param_1);
- if (iVar1 == 0) {
- uVar2 = 0xffffffff;
- }
- else {
- UNRECOVERED_JUMPTABLE = *(code **)(*(int *)(*(int *)(iVar1 + 4) + 0x18) + 0x28);
- if (UNRECOVERED_JUMPTABLE != (code *)0x0) {
- /* WARNING: Could not recover jumptable at 0x007065d4. Too many branches */
- /* WARNING: Treating indirect jump as call */
- uVar2 = (*UNRECOVERED_JUMPTABLE)(param_1,param_2,param_3,param_4);
- return uVar2;
- }
- uVar2 = 0xf00d;
- }
- return uVar2;
- }
- void _phy_826xb_serdes_loopback_set(undefined4 param_1,undefined4 param_2,int param_3)
- {
- int iVar1;
- undefined4 uVar2;
- int local_18 [2];
- if (param_3 == 0) {
- uVar2 = 0;
- LAB_00bacf44:
- iVar1 = _phy_826xb_sdsReg_write(param_1,param_2,4,0,0xe,0xe,uVar2);
- if (iVar1 != 0) {
- return;
- }
- uVar2 = 0;
- }
- else {
- iVar1 = phy_826xb_macIntfSerdesMode_get(param_1,param_2,local_18);
- if (iVar1 != 0) {
- return;
- }
- if ((local_18[0] != 0x1a) && (local_18[0] != 0x25)) {
- if (local_18[0] == 8) {
- iVar1 = _phy_826xb_sdsReg_write(param_1,param_2,4,0,0xe,0xe,0);
- if (iVar1 != 0) {
- return;
- }
- iVar1 = _phy_826xb_sdsReg_write(param_1,param_2,2,0,0xe,0xe,0);
- if (iVar1 != 0) {
- return;
- }
- uVar2 = 1;
- goto LAB_00bacf94;
- }
- uVar2 = 1;
- goto LAB_00bacf44;
- }
- iVar1 = _phy_826xb_sdsReg_write(param_1,param_2,4,0,0xe,0xe,0);
- if (iVar1 != 0) {
- return;
- }
- uVar2 = 1;
- }
- iVar1 = _phy_826xb_sdsReg_write(param_1,param_2,2,0,0xe,0xe,uVar2);
- if (iVar1 != 0) {
- return;
- }
- uVar2 = 0;
- LAB_00bacf94:
- _phy_826xb_sdsReg_write(param_1,param_2,0,0,4,4,uVar2);
- return;
- }
- /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
- undefined4 _dal_phy_macIntfSerdes_reset(int param_1,undefined4 param_2)
- {
- int iVar1;
- undefined4 uVar2;
- undefined4 uVar3;
- undefined4 uVar4;
- if (*(int *)(&DAT_012b2b40 + param_1 * 4) != 1) {
- return 0xf00f;
- }
- iVar1 = osal_sem_mutex_take(*(undefined4 *)(&DAT_012b2b00 + param_1 * 4),0xffffffff);
- if (iVar1 == 0) {
- uVar3 = phy_serdes_rst(param_1,param_2);
- iVar1 = osal_sem_mutex_give(*(undefined4 *)(&DAT_012b2b00 + param_1 * 4));
- if (iVar1 == 0) {
- return uVar3;
- }
- iVar1 = rt_log(2);
- uVar3 = 0xf014;
- if (iVar1 != 0) {
- return 0xf014;
- }
- uVar4 = 0xf014;
- uVar2 = 0x1ca7;
- }
- else {
- iVar1 = rt_log(2);
- uVar3 = 0xf013;
- if (iVar1 != 0) {
- return 0xf013;
- }
- uVar4 = 0xf013;
- uVar2 = 0x1ca3;
- }
- fprintf(_stderr,"*** [RT_ERR] %s:%d: In function \'%s\'\n Error Code: 0x%X\n\n",
- "dal/dal_phy.c",uVar2,"_dal_phy_macIntfSerdes_reset",uVar4);
- return uVar3;
- }
- void _dal_phy_serdesLinkDown_handler(int param_1)
- {
- undefined1 uVar1;
- int iVar2;
- int *piVar3;
- uint uVar4;
- uint *puVar5;
- uint uVar6;
- int local_28 [3];
- piVar3 = (int *)(&DAT_012b26a0 + param_1 * 0x40);
- uVar4 = 0;
- puVar5 = (uint *)(phySerdes_watchdog_cnt + param_1 * 4);
- do {
- if (*(byte *)(*(int *)((&unitMapStruct)[param_1 * 2] + 0x824) + 0x58c) <= uVar4) {
- return;
- }
- iVar2 = *(int *)((&unitMapStruct)[param_1 * 2] + 0x824) + uVar4 * 8;
- uVar6 = *(uint *)(iVar2 + 0x590);
- if (((uVar6 == 0x11) || ((uVar6 & 0xfffffffb) == 9)) || (uVar6 == 0x16)) {
- uVar1 = *(undefined1 *)(iVar2 + 0x595);
- local_28[0] = 0;
- iVar2 = phy_serdes_linkdown_check(param_1,uVar1,local_28);
- if (iVar2 != 0) {
- return;
- }
- if (local_28[0] == 1) {
- iVar2 = *piVar3;
- *piVar3 = iVar2 + 1;
- if (iVar2 + 1 != 5) goto LAB_00b2cc70;
- if (*puVar5 + 1 < 0x40) {
- *puVar5 = *puVar5 + 1;
- }
- else {
- *puVar5 = 0;
- }
- phy_serdes_rst(param_1,uVar1);
- }
- *piVar3 = 0;
- }
- LAB_00b2cc70:
- uVar4 = uVar4 + 1;
- piVar3 = piVar3 + 1;
- } while( true );
- }
- void dal_longan_construct_serdesRxauiplus_initial(int param_1,uint param_2)
- {
- int iVar1;
- if (param_2 == *(byte *)((&unitMapStruct)[param_1 * 2] + param_2 + 0x154)) {
- hal_sds_field_write(param_1,param_2,0x2d,5,1,1,1);
- iVar1 = param_2 + 1;
- hal_sds_field_write(param_1,iVar1,0x2d,5,1,1,1);
- hal_sds_field_write(param_1,iVar1,0x2d,0x15,2,0,7);
- hal_sds_field_write(param_1,iVar1,0x2d,0x15,6,5,3);
- hal_sds_field_write(param_1,param_2,10,2,0xf,0xf,0);
- hal_sds_field_write(param_1,iVar1,10,2,0xf,0xf,0);
- hal_sds_field_write(param_1,param_2,10,0xd,9,9,1);
- hal_sds_field_write(param_1,param_2,0x2d,0x10,3,3,1);
- hal_sds_field_write(param_1,iVar1,0x2d,0x10,3,3,1);
- }
- return;
- }
- /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
- undefined4 phy_serdes_rst(undefined4 param_1,uint param_2)
- {
- int iVar1;
- undefined4 uVar2;
- int iVar3;
- code *pcVar4;
- rt_log(8,param_2,0,0x10000,"unit=%d, port=%d",param_1,param_2);
- iVar1 = hal_ctrlInfo_get(param_1);
- if (iVar1 == 0) {
- return 0xffffffff;
- }
- if (0x3f < param_2) {
- return 0xf030;
- }
- iVar1 = iVar1 + param_2 * 4;
- iVar3 = *(int *)(iVar1 + 0xc);
- if (iVar3 == 0) {
- return 0xf030;
- }
- if (*(int *)(iVar3 + 0x10) == 0) {
- return 0xf030;
- }
- iVar3 = hal_ctrlInfo_get(param_1);
- if (iVar3 == 0) {
- return 0xffffffff;
- }
- iVar3 = osal_sem_mutex_take(*(undefined4 *)(iVar3 + 0x144),0xffffffff);
- if (iVar3 != 0) {
- iVar1 = rt_log(2);
- if (iVar1 != 0) {
- return 0xffffffff;
- }
- uVar2 = 0x14a3;
- goto LAB_00bf3dfc;
- }
- switch(**(undefined4 **)(*(int *)(iVar1 + 0xc) + 0x10)) {
- case 10:
- pcVar4 = phy_8214fc_serdes_reset;
- break;
- default:
- goto switchD_00bf3d08_caseD_b;
- case 0xc:
- pcVar4 = phy_8218d_macIntfSerdes_reset;
- break;
- case 0x13:
- pcVar4 = phy_8295r_macIntfSerdes_reset;
- break;
- case 0x14:
- pcVar4 = phy_8214qf_macIntfSerdes_reset;
- break;
- case 0x18:
- pcVar4 = phy_8218e_macIntfSerdes_reset;
- }
- (*pcVar4)(param_1,param_2);
- switchD_00bf3d08_caseD_b:
- iVar1 = hal_ctrlInfo_get(param_1);
- if (iVar1 == 0) {
- return 0xffffffff;
- }
- iVar1 = osal_sem_mutex_give(*(undefined4 *)(iVar1 + 0x144));
- if (iVar1 == 0) {
- return 0;
- }
- iVar1 = rt_log(2);
- if (iVar1 != 0) {
- return 0xffffffff;
- }
- uVar2 = 0x14cf;
- LAB_00bf3dfc:
- fprintf(_stderr,"*** [RT_ERR] %s:%d: In function \'%s\'\n Error Code: 0x%X\n\n",
- "hal/common/miim.c",uVar2,"phy_serdes_rst",0xffffffff);
- return 0xffffffff;
- }
- int _phy_826xb_serdes_mode_update(undefined4 param_1,undefined4 param_2)
- {
- int iVar1;
- code *pcVar2;
- undefined4 local_20;
- int local_1c;
- uint local_18 [3];
- local_18[0] = 0xffff;
- iVar1 = _phy_826xb_serdes_mode_get(param_1,param_2,local_18);
- if (iVar1 != 0) {
- return iVar1;
- }
- if ((local_18[0] & 0x100) == 0) {
- return 0;
- }
- iVar1 = _phy_826xb_realTime_linkStatus_get(param_1,param_2,&local_1c);
- if (iVar1 != 0) {
- return iVar1;
- }
- if (local_1c == 0) {
- return 0;
- }
- iVar1 = phy_common_c45_speedStatusResReg_get(param_1,param_2,&local_20);
- if (iVar1 != 0) {
- return iVar1;
- }
- if (local_18[0] != 0x1101) {
- if (local_18[0] != 0x1102) {
- return 0xf00f;
- }
- switch(local_20) {
- case 1:
- case 2:
- switchD_00ba56a0_caseD_1:
- pcVar2 = _phy_826xb_serdes_mode_sgmii_set;
- break;
- default:
- LAB_00ba56f8:
- return 0;
- case 5:
- case 9:
- switchD_00ba56a0_caseD_5:
- pcVar2 = _phy_826xb_serdes_mode_2p5gx_set;
- break;
- case 6:
- case 10:
- pcVar2 = _phy_826xb_serdes_mode_xfi_5g_cpri_set;
- break;
- case 7:
- switchD_00ba56a0_caseD_7:
- pcVar2 = _phy_826xb_serdes_mode_10gr_set;
- }
- LAB_00ba56e4:
- iVar1 = (*pcVar2)(param_1,param_2);
- return iVar1;
- }
- switch(local_20) {
- case 1:
- case 2:
- goto switchD_00ba56a0_caseD_1;
- default:
- goto LAB_00ba56f8;
- case 5:
- case 9:
- goto switchD_00ba56a0_caseD_5;
- case 6:
- case 10:
- pcVar2 = _phy_826xb_serdes_mode_5gr_set;
- goto LAB_00ba56e4;
- case 7:
- goto switchD_00ba56a0_caseD_7;
- }
- }
- int _phy_identify_default_c45(undefined4 param_1,undefined4 param_2,uint param_3,uint param_4)
- {
- int iVar1;
- int iVar2;
- uint local_20;
- undefined4 local_1c;
- local_1c = 0;
- local_20 = 0;
- iVar1 = hal_ctrlInfo_get();
- if (iVar1 != 0) {
- iVar2 = *(int *)(*(int *)(iVar1 + 4) + 0x18);
- if (*(int *)(iVar2 + 4) != 0) {
- (**(code **)(iVar2 + 0x24))(param_1,param_2,1,2,&local_1c);
- (**(code **)(*(int *)(*(int *)(iVar1 + 4) + 0x18) + 0x24))(param_1,param_2,1,3,&local_20);
- iVar1 = _phy_rtk_oui_chk(local_1c,local_20);
- if (iVar1 != 0) {
- rt_log(8);
- rt_log(8);
- return iVar1;
- }
- if (((local_20 & 0x3f0) >> 4 == param_3) && (param_4 <= (local_20 & 0xf))) {
- return 0;
- }
- return 0xe000f;
- }
- }
- return -1;
- }
- int _phy_rtk_oui_chk(int param_1,uint param_2)
- {
- if (param_1 == 0x1c) {
- return -(uint)(param_2 >> 10 != 0x32);
- }
- return -1;
- }
- void phy_common_c45_autoNegoEnable_set(undefined4 param_1,undefined4 param_2,int param_3)
- {
- int iVar1;
- uint uVar2;
- uint local_18 [2];
- local_18[0] = 0;
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,7,0,local_18);
- if (iVar1 == 0) {
- uVar2 = 0;
- if (param_3 == 1) {
- uVar2 = 0x1200;
- }
- local_18[0] = uVar2 | local_18[0] & 0xffffedff;
- phy_common_general_reg_mmd_set(param_1,param_2,7,0,local_18[0]);
- }
- return;
- }
- void phy_common_c45_autoNegoEnable_get(undefined4 param_1,undefined4 param_2,uint *param_3)
- {
- int iVar1;
- uint local_10 [2];
- local_10[0] = 0;
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,7,0,local_10);
- if (iVar1 == 0) {
- *param_3 = local_10[0] >> 0xc & 1;
- }
- return;
- }
- int phy_common_c45_masterSlave_set(undefined4 param_1,undefined4 param_2,int param_3)
- {
- int iVar1;
- uint uVar2;
- uint local_20 [3];
- local_20[0] = 0;
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,7,0x20,local_20);
- if (iVar1 == 0) {
- local_20[0] = local_20[0] & 0xffff3fff;
- if (param_3 == 1) {
- local_20[0] = local_20[0] | 0x8000;
- }
- else if (param_3 != 0) {
- if (param_3 != 2) {
- return 0xf001;
- }
- local_20[0] = local_20[0] | 0xc000;
- }
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,7,0x20,local_20[0]);
- if (((iVar1 == 0) &&
- (iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,7,0,local_20), iVar1 == 0)) &&
- (uVar2 = local_20[0] & 0x1000, local_20[0] = local_20[0] | 0x200, uVar2 != 0)) {
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,7,0,local_20[0]);
- }
- }
- return iVar1;
- }
- int phy_common_c45_ieeeTestMode_set(undefined4 param_1,undefined4 param_2,int *param_3)
- {
- int iVar1;
- undefined4 uVar2;
- undefined4 uVar3;
- undefined4 uVar4;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1f,0xa412,0xe00);
- if (iVar1 != 0) {
- return iVar1;
- }
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,1,0x84,0x400);
- if (iVar1 != 0) {
- return iVar1;
- }
- iVar1 = *param_3;
- if (iVar1 == 0x1030) {
- uVar4 = 0x6400;
- }
- else {
- if (iVar1 < 0x1031) {
- if (iVar1 == 3) {
- uVar4 = 0x6e00;
- }
- else if (iVar1 < 4) {
- if (iVar1 == 1) {
- uVar4 = 0x2e00;
- }
- else {
- if (iVar1 < 2) {
- if (iVar1 == 0) {
- return 0;
- }
- return 0xf036;
- }
- uVar4 = 0x4e00;
- }
- }
- else {
- if (iVar1 == 0x1000) {
- return 0;
- }
- if (0x1000 < iVar1) {
- if (iVar1 == 0x1010) {
- uVar4 = 0x2400;
- }
- else {
- uVar4 = 0x4400;
- if (iVar1 != 0x1020) {
- return 0xf036;
- }
- }
- goto LAB_00b36b20;
- }
- uVar4 = 0x8e00;
- if (iVar1 != 4) {
- return 0xf036;
- }
- }
- uVar2 = 0x1f;
- uVar3 = 0xa412;
- goto LAB_00b36b30;
- }
- if (iVar1 == 0x1045) {
- uVar4 = 0x9400;
- }
- else if (iVar1 < 0x1046) {
- if (iVar1 == 0x1042) {
- uVar4 = 0x8800;
- }
- else if (iVar1 == 0x1044) {
- uVar4 = 0x9000;
- }
- else {
- if (iVar1 != 0x1041) {
- return 0xf036;
- }
- uVar4 = 0x8400;
- }
- }
- else if (iVar1 == 0x1050) {
- uVar4 = 0xa400;
- }
- else if (iVar1 < 0x1051) {
- uVar4 = 0x9800;
- if (iVar1 != 0x1046) {
- return 0xf036;
- }
- }
- else if (iVar1 == 0x1060) {
- uVar4 = 0xc400;
- }
- else {
- uVar4 = 0xe400;
- if (iVar1 != 0x1070) {
- return 0xf036;
- }
- }
- }
- LAB_00b36b20:
- uVar2 = 1;
- uVar3 = 0x84;
- LAB_00b36b30:
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,uVar2,uVar3,uVar4);
- return iVar1;
- }
- void phy_common_c45_enable_set(undefined4 param_1,undefined4 param_2,int param_3)
- {
- int iVar1;
- uint local_18 [2];
- local_18[0] = 0;
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,1,0,local_18);
- if (iVar1 == 0) {
- local_18[0] = (uint)(param_3 != 1) << 0xb | local_18[0] & 0xfffff7ff;
- phy_common_general_reg_mmd_set(param_1,param_2,1,0,local_18[0]);
- }
- return;
- }
- int phy_common_c45_speed_set(undefined4 param_1,undefined4 param_2,undefined4 param_3)
- {
- int iVar1;
- uint local_18 [2];
- local_18[0] = 0;
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,1,0,local_18);
- if (iVar1 == 0) {
- local_18[0] = local_18[0] & 0xffffdf83;
- switch(param_3) {
- case 0:
- break;
- case 1:
- local_18[0] = local_18[0] | 0x2000;
- break;
- case 2:
- local_18[0] = local_18[0] | 0x40;
- break;
- default:
- return 0xf00d;
- case 5:
- local_18[0] = local_18[0] | 0x2058;
- break;
- case 6:
- local_18[0] = local_18[0] | 0x205c;
- break;
- case 7:
- local_18[0] = local_18[0] | 0x2040;
- }
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,1,0,local_18[0]);
- }
- return iVar1;
- }
- int _phy_c45_check(undefined4 param_1,undefined4 param_2)
- {
- int iVar1;
- int iVar2;
- int local_20 [3];
- iVar1 = hal_ctrlInfo_get();
- if (iVar1 != 0) {
- iVar2 = *(int *)(*(int *)(iVar1 + 4) + 0x18);
- if (*(int *)(iVar2 + 4) != 0) {
- iVar2 = (**(code **)(iVar2 + 0x24))(param_1,param_2,1,2,local_20);
- if (iVar2 != 0) {
- return iVar2;
- }
- if (local_20[0] != 0) {
- return 0;
- }
- iVar2 = (**(code **)(*(int *)(*(int *)(iVar1 + 4) + 0x18) + 0x24))
- (param_1,param_2,3,2,local_20);
- if (iVar2 != 0) {
- return iVar2;
- }
- if (local_20[0] != 0) {
- return 0;
- }
- iVar2 = (**(code **)(*(int *)(*(int *)(iVar1 + 4) + 0x18) + 0x24))
- (param_1,param_2,7,2,local_20);
- if (iVar2 != 0) {
- return iVar2;
- }
- if (local_20[0] != 0) {
- return 0;
- }
- iVar1 = (**(code **)(*(int *)(*(int *)(iVar1 + 4) + 0x18) + 0x24))
- (param_1,param_2,0x1e,0x8003,local_20);
- if ((iVar1 == 0) && (local_20[0] == 0x8295)) {
- return 0;
- }
- }
- }
- return -1;
- }
- void phy_826xb_linkStatus_get(undefined4 param_1,undefined4 param_2,uint *param_3)
- {
- int iVar1;
- uint local_10 [2];
- local_10[0] = 0;
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,1,1,local_10);
- if (iVar1 == 0) {
- *param_3 = local_10[0] >> 2 & 1;
- }
- return;
- }
- void phy_826xb_macIntfSerdesLinkStatus_get(undefined4 param_1,undefined4 param_2,uint *param_3)
- {
- int iVar1;
- uint uVar2;
- int local_18;
- uint local_14;
- local_14 = 0;
- local_18 = 0;
- iVar1 = phy_826xb_macIntfSerdesMode_get(param_1,param_2,&local_18);
- if (iVar1 == 0) {
- param_3[2] = 1;
- if ((local_18 - 8U < 0x1e) && ((1 << (local_18 - 8U & 0x1f) & 0x20040001U) != 0)) {
- iVar1 = _phy_826xb_serdes_reg_read(param_1,param_2,1,0x1d,&local_14);
- if (iVar1 != 0) {
- return;
- }
- uVar2 = (uint)((local_14 & 0x111) == 0x111);
- }
- else {
- iVar1 = _phy_826xb_serdes_reg_read(param_1,param_2,5,0,&local_14);
- if (iVar1 != 0) {
- return;
- }
- uVar2 = local_14 >> 0xc & 1;
- }
- *param_3 = uVar2;
- }
- return;
- }
- void _phy_826xb_macsec_init(undefined4 param_1,undefined4 param_2)
- {
- int iVar1;
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x2e0,1,0,3);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x2d8,0xf,0,0x5212);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x2da,0xf,0,0x101);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x2dc,0xf,0,0x101);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x3c6,7,0,10);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x37b,7,0,6);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x2f7,0xf,0,0x486c);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x3f1,0xf,0,0x72);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x3f0,0xf,0,0xb0b);
- if (iVar1 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x3ee,0xf,0xd,2);
- if (iVar1 == 0) {
- /* WARNING: Could not recover jumptable at 0x00ba3654. Too many branches */
- /* WARNING: Treating indirect jump as call */
- phy_macsec_init(param_1,param_2);
- return;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return;
- }
- void _phy_826xb_phyReg_read(void)
- {
- int iVar1;
- byte in_stack_00000017;
- uint *in_stack_00000018;
- iVar1 = phy_common_general_reg_mmd_get();
- if (iVar1 == 0) {
- *in_stack_00000018 = 0 >> (in_stack_00000017 & 0x1f);
- }
- return;
- }
- void _phy_826xb_phyReg_write
- (undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
- byte param_5,byte param_6,int param_7)
- {
- int iVar1;
- uint uVar2;
- uint uVar3;
- uint local_28 [3];
- uVar2 = (uint)param_6;
- local_28[0] = 0;
- if (((param_5 != 0xf) || (uVar2 != 0)) &&
- (iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,param_3,param_4,local_28), iVar1 != 0))
- {
- return;
- }
- uVar3 = (1 << (uVar2 & 0x1f)) - 1U ^ 0xffffffffU >> (~(uint)param_5 & 0x1f);
- phy_common_general_reg_mmd_set
- (param_1,param_2,param_3,param_4,
- ~uVar3 & local_28[0] | uVar3 & param_7 << (uVar2 & 0x1f));
- return;
- }
- void _phy_826xb_reinit(int param_1,uint param_2)
- {
- int iVar1;
- undefined1 local_18 [12];
- local_18[0] = 0;
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0x145,1);
- if (iVar1 == 0) {
- iVar1 = phy_common_general_reg_mmd_set(param_1,param_2,0x1e,0x145,0);
- if (iVar1 == 0) {
- osal_time_mdelay(0x1e);
- iVar1 = hwp_get_offset_by_baseport_port
- (param_1,*(undefined1 *)((&unitMapStruct)[param_1 * 2] + param_2 + 0x6e4),
- param_2 & 0xff,local_18);
- if (iVar1 == 0) {
- iVar1 = phy_patch(param_1,param_2,local_18[0],0);
- if (iVar1 == 0) {
- phy_826xb_init(param_1,param_2);
- }
- }
- }
- }
- return;
- }
- void _phy_826xb_sdsReg_write
- (undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
- byte param_5,byte param_6,int param_7)
- {
- int iVar1;
- uint uVar2;
- uint uVar3;
- uint local_28 [3];
- uVar2 = (uint)param_6;
- local_28[0] = 0;
- if (((param_5 != 0xf) || (uVar2 != 0)) &&
- (iVar1 = _phy_826xb_serdes_reg_read(param_1,param_2,param_3,param_4,local_28), iVar1 != 0)) {
- return;
- }
- uVar3 = (1 << (uVar2 & 0x1f)) - 1U ^ 0xffffffffU >> (~(uint)param_5 & 0x1f);
- _phy_826xb_serdes_reg_write
- (param_1,param_2,param_3,param_4,
- ~uVar3 & local_28[0] | uVar3 & param_7 << (uVar2 & 0x1f));
- return;
- }
- int _phy_826xb_skew_get(undefined4 param_1,undefined4 param_2,int param_3,uint *param_4)
- {
- int iVar1;
- uint uVar2;
- uint uVar3;
- undefined4 uVar4;
- uint uVar5;
- uint local_20;
- int local_1c [2];
- local_20 = 0;
- iVar1 = phy_common_c45_speedStatusResReg_get(param_1,param_2,local_1c);
- if (iVar1 != 0) {
- return iVar1;
- }
- if (param_3 == 0x46) {
- if (local_1c[0] == 2) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1f,0xa726,&local_20);
- if (iVar1 != 0) {
- return iVar1;
- }
- uVar5 = local_20 & 0xf;
- uVar2 = (local_20 & 0xf00) >> 8;
- goto LAB_00ba2cb0;
- }
- uVar4 = 0x92;
- }
- else {
- if (param_3 == 0x47) {
- if (local_1c[0] == 2) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1f,0xa726,&local_20);
- if (iVar1 != 0) {
- return iVar1;
- }
- uVar5 = local_20 & 0xf;
- uVar2 = (local_20 & 0xf000) >> 0xc;
- goto LAB_00ba2cb0;
- }
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,1,0x92,&local_20);
- if (iVar1 != 0) {
- return iVar1;
- }
- local_20 = local_20 & 0x7f;
- goto LAB_00ba2cec;
- }
- if (param_3 != 0x45) {
- return 0xf001;
- }
- if (local_1c[0] == 2) {
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1f,0xa726);
- if (iVar1 != 0) {
- return iVar1;
- }
- uVar5 = local_20 & 0xf;
- uVar2 = (local_20 & 0xf0) >> 4;
- LAB_00ba2cb0:
- uVar3 = uVar5 - uVar2;
- if (uVar5 < uVar2) {
- uVar3 = uVar2 - uVar5;
- }
- *param_4 = uVar3;
- return 0;
- }
- uVar4 = 0x91;
- }
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,1,uVar4,&local_20);
- if (iVar1 != 0) {
- return iVar1;
- }
- local_20 = (local_20 & 0x7f00) >> 8;
- LAB_00ba2cec:
- *param_4 = local_20;
- return 0;
- }
- void _phy_rtl826xb_patch_sds_get
- (undefined4 param_1,undefined4 param_2,int param_3,int param_4,undefined4 *param_5)
- {
- int iVar1;
- undefined4 local_18 [2];
- local_18[0] = 0;
- iVar1 = _phy_rtl826xb_patch_top_set(param_1,param_2,0x28,0x13,param_3 + 0x8000 + param_4 * 0x40);
- if (iVar1 == 0) {
- iVar1 = _phy_rtl826xb_patch_top_get(param_1,param_2,0x28,0x12,local_18);
- if (iVar1 == 0) {
- *param_5 = local_18[0];
- _phy_rtl826xb_patch_wait(param_1,param_2,0x1e,0x143,0,0x8000,0);
- }
- }
- return;
- }
- void _phy_rtl826xb_patch_sds_set
- (undefined4 param_1,undefined4 param_2,int param_3,int param_4,undefined4 param_5,
- undefined1 param_6)
- {
- int iVar1;
- iVar1 = _phy_rtl826xb_patch_top_set(param_1,param_2,0x28,0x11,param_5);
- if (iVar1 == 0) {
- iVar1 = _phy_rtl826xb_patch_top_set(param_1,param_2,0x28,0x13,param_3 + 0x8800 + param_4 * 0x40)
- ;
- if (iVar1 == 0) {
- _phy_rtl826xb_patch_wait(param_1,param_2,0x1e,0x143,0,0x8000,param_6);
- }
- }
- return;
- }
- void _phy_rtl826xb_patch_top_set(undefined4 param_1,undefined4 param_2,int param_3,int param_4)
- {
- phy_common_general_reg_mmd_set(param_1,param_2,0x1e,param_4 + -0x10 + param_3 * 8);
- return;
- }
- void _phy_rtl826xb_patch_top_get
- (undefined4 param_1,undefined4 param_2,int param_3,int param_4,undefined4 *param_5)
- {
- int iVar1;
- undefined4 local_10 [3];
- local_10[0] = 0;
- iVar1 = phy_common_general_reg_mmd_get
- (param_1,param_2,0x1e,param_4 + -0x10 + param_3 * 8,local_10);
- if (iVar1 == 0) {
- *param_5 = local_10[0];
- }
- return;
- }
- int phy_826xb_autoNegoAbility_set(undefined4 param_1,uint param_2,uint *param_3)
- {
- int iVar1;
- int iVar2;
- uint uVar3;
- uint local_20 [3];
- local_20[0] = 0;
- iVar1 = _phy_826xb_chip_type_get(param_1,param_2 & 0xff);
- uVar3 = *param_3;
- iVar2 = 0xf001;
- if ((((uVar3 & 0xc0000000) == 0) && (((uVar3 & 0x200000) == 0 || (iVar1 == 0x10)))) &&
- (((uVar3 & 0x400000) == 0 || (iVar2 = 0xf001, iVar1 != 4)))) {
- iVar2 = phy_common_general_reg_mmd_get(param_1,param_2,7,0x10,local_20);
- if (iVar2 == 0) {
- uVar3 = *param_3;
- local_20[0] = uVar3 >> 0x16 & 0x80 | local_20[0] & 0xfffff21f | uVar3 >> 0x14 & 0x100 |
- uVar3 >> 10 & 0x400 | uVar3 >> 8 & 0x800;
- iVar2 = phy_common_general_reg_mmd_set(param_1,param_2,7,0x10,local_20[0]);
- if (iVar2 == 0) {
- iVar2 = phy_common_general_reg_mmd_get(param_1,param_2,7,0x20,local_20);
- if (iVar2 == 0) {
- uVar3 = *param_3;
- local_20[0] = uVar3 >> 0x10 & 0x80 | local_20[0] & 0xffffee7f | uVar3 >> 0xe & 0x100 |
- uVar3 >> 9 & 0x1000;
- iVar2 = phy_common_general_reg_mmd_set(param_1,param_2,7,0x20,local_20[0]);
- if (iVar2 == 0) {
- iVar2 = phy_common_general_reg_mmd_get(param_1,param_2,0x1f,0xa412,local_20);
- if (iVar2 == 0) {
- local_20[0] = *param_3 >> 0x13 & 0x100 | local_20[0] & 0xfffffcff |
- *param_3 >> 0x11 & 0x200;
- iVar2 = phy_common_general_reg_mmd_set(param_1,param_2,0x1f,0xa412,local_20[0]);
- if (iVar2 == 0) {
- iVar2 = _phy_826xb_an_restart(param_1,param_2);
- }
- }
- }
- }
- }
- }
- }
- return iVar2;
- }
- undefined4 phy_826xb_autoNegoAbilityLocal_get(undefined4 param_1,undefined1 param_2,ushort *param_3)
- {
- int iVar1;
- ushort uVar2;
- iVar1 = _phy_826xb_chip_type_get(param_1,param_2);
- *(undefined1 *)param_3 = 0;
- *(undefined1 *)((int)param_3 + 1) = 0;
- uVar2 = *param_3;
- *param_3 = uVar2 | 0x3418;
- *(undefined1 *)(param_3 + 1) = 0;
- *(undefined1 *)((int)param_3 + 3) = 0;
- if (iVar1 == 4) {
- *param_3 = uVar2 | 0x3498;
- }
- else {
- if (iVar1 == 8) {
- uVar2 = uVar2 | 0x34d8;
- }
- else {
- uVar2 = uVar2 | 0x34f8;
- }
- *param_3 = uVar2;
- }
- return 0;
- }
- void phy_826xb_autoNegoAbilityPeer_get(undefined4 param_1,undefined4 param_2,ushort *param_3)
- {
- int iVar1;
- uint local_18 [2];
- local_18[0] = 0;
- phy_common_c45_copperPeerAutoNegoAbility_get();
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1f,0xa414,local_18);
- if (iVar1 == 0) {
- *param_3 = *param_3 & 0xf3ff | (ushort)(local_18[0] >> 1) & 0x400 |
- (ushort)((local_18[0] & 0x400) << 1);
- }
- return;
- }
- /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
- int phy_826xb_init(int param_1,undefined4 param_2)
- {
- void *__s;
- int iVar1;
- if (*(int *)(rtl826xb_info + param_1 * 4) == 0) {
- __s = osal_alloc(0x200);
- *(void **)(rtl826xb_info + param_1 * 4) = __s;
- if (__s == (void *)0x0) {
- iVar1 = rt_log(2);
- if (iVar1 != 0) {
- return 0xf032;
- }
- fprintf(_stderr,"*** [RT_ERR] %s:%d: In function \'%s\'\n Error Code: 0x%X\n\n",
- "hal/phy/phy_rtl826xb.c",0x750,"phy_826xb_init",0xf032,param_2);
- return 0xf032;
- }
- memset(__s,0,0x200);
- }
- iVar1 = _phy_826xb_serdes_mode_init(param_1,param_2);
- if ((((iVar1 == 0) && (iVar1 = _phy_826xb_interrupt_init(param_1,param_2), iVar1 == 0)) &&
- (iVar1 = _phy_826xb_dbgCount_init(param_1,param_2), iVar1 == 0)) &&
- (iVar1 = _phy_826xb_synce_init(param_1,param_2), iVar1 == 0)) {
- /* WARNING: Could not recover jumptable at 0x00bafdb0. Too many branches */
- /* WARNING: Treating indirect jump as call */
- iVar1 = _phy_826xb_macsec_init(param_1,param_2);
- return iVar1;
- }
- return iVar1;
- }
- int phy_826xb_macsec_reg_get
- (undefined4 param_1,undefined4 param_2,int param_3,undefined4 param_4,int *param_5)
- {
- int iVar1;
- undefined4 uVar2;
- int local_18;
- int local_14;
- local_14 = 0;
- local_18 = 0;
- if (param_3 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x2fb,0xf,0,param_4);
- if (iVar1 != 0) {
- return iVar1;
- }
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x2fc,0xf,0,0x10);
- if (iVar1 != 0) {
- return iVar1;
- }
- iVar1 = _phy_826xb_phyReg_read(param_1,param_2,0x1e,0x2f8,0xf,0,&local_14);
- if (iVar1 != 0) {
- return iVar1;
- }
- uVar2 = 0x2f9;
- }
- else {
- if (param_3 != 1) {
- return 0xf001;
- }
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x300,0xf,0,param_4);
- if (iVar1 != 0) {
- return iVar1;
- }
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x301,0xf,0,0x10);
- if (iVar1 != 0) {
- return iVar1;
- }
- iVar1 = _phy_826xb_phyReg_read(param_1,param_2,0x1e,0x2fd,0xf,0,&local_14);
- if (iVar1 != 0) {
- return iVar1;
- }
- uVar2 = 0x2fe;
- }
- iVar1 = _phy_826xb_phyReg_read(param_1,param_2,0x1e,uVar2,0xf,0,&local_18);
- if (iVar1 == 0) {
- *param_5 = local_14 * 0x10000 + local_18;
- iVar1 = 0;
- }
- return iVar1;
- }
- int phy_826xb_macsec_reg_set
- (undefined4 param_1,undefined4 param_2,int param_3,undefined4 param_4,uint param_5)
- {
- int iVar1;
- undefined4 uVar2;
- if (param_3 == 0) {
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x2f8,0xf,0,param_5 >> 0x10);
- if (iVar1 != 0) {
- return iVar1;
- }
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x2f9,0xf,0,param_5 & 0xffff);
- if (iVar1 != 0) {
- return iVar1;
- }
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x2fb,0xf,0,param_4);
- if (iVar1 != 0) {
- return iVar1;
- }
- uVar2 = 0x2fc;
- }
- else {
- if (param_3 != 1) {
- return 0xf001;
- }
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x2fd,0xf,0,param_5 >> 0x10);
- if (iVar1 != 0) {
- return iVar1;
- }
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x2fe,0xf,0,param_5 & 0xffff);
- if (iVar1 != 0) {
- return iVar1;
- }
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,0x300,0xf,0,param_4);
- if (iVar1 != 0) {
- return iVar1;
- }
- uVar2 = 0x301;
- }
- iVar1 = _phy_826xb_phyReg_write(param_1,param_2,0x1e,uVar2,0xf,0,1);
- return iVar1;
- }
- void phy_826xb_sdsEyeParam_get
- (undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 *param_4)
- {
- int iVar1;
- uint local_10 [2];
- local_10[0] = 0;
- iVar1 = _phy_826xb_preemphasis_get(param_1,param_2,local_10);
- if (iVar1 == 0) {
- *param_4 = 0;
- param_4[3] = local_10[0] >> 0x1a;
- param_4[6] = local_10[0] >> 0x13 & 1;
- param_4[2] = local_10[0] >> 10 & 0x3f;
- param_4[8] = local_10[0] >> 9 & 1;
- param_4[1] = local_10[0] >> 3 & 0x3f;
- param_4[5] = local_10[0] >> 2 & 1;
- }
- return;
- }
- void phy_826xb_sdsEyeParam_set(int param_1,int param_2,undefined4 param_3,int param_4)
- {
- uint uVar1;
- char cVar2;
- int iVar3;
- int iVar4;
- uint uVar5;
- uint uVar6;
- uint uVar7;
- uint uVar8;
- uint uStack_20;
- uint auStack_1c [2];
- uVar1 = *(uint *)(param_4 + 0x18);
- iVar4 = *(int *)(param_4 + 0xc);
- uVar5 = *(uint *)(param_4 + 8);
- uVar6 = *(uint *)(param_4 + 0x20);
- uVar7 = *(uint *)(param_4 + 4);
- uVar8 = *(uint *)(param_4 + 0x14);
- iVar3 = *(int *)(*(int *)(rtl826xb_info + param_1 * 4) + (param_2 + 0x40) * 4);
- auStack_1c[0] = 0;
- uStack_20 = 0;
- cVar2 = '.';
- if (iVar3 - 8U < 0x1f) {
- cVar2 = "$.................(..........,4"[iVar3 + 0x18];
- }
- iVar3 = _phy_826xb_serdes_reg_read(param_1,param_2,cVar2,7,&uStack_20);
- if ((iVar3 == 0) &&
- (iVar3 = _phy_826xb_serdes_reg_read(param_1,param_2,cVar2,6,auStack_1c), iVar3 == 0)) {
- auStack_1c[0] = ((uVar1 & 1) << 0x13 | iVar4 << 0x1a) >> 0x10 | auStack_1c[0] & 3;
- uStack_20 = (uVar5 & 0x3f) << 10 | (uVar6 & 1) << 9 | (uVar7 & 0x3f) << 3 | (uVar8 & 1) << 2 |
- uStack_20 & 3;
- iVar3 = _phy_826xb_serdes_reg_write(param_1,param_2,cVar2,7,uStack_20);
- if (iVar3 == 0) {
- _phy_826xb_serdes_reg_write(param_1,param_2,cVar2,6,auStack_1c[0]);
- }
- }
- return;
- }
- int phy_826xb_speed_set(undefined4 param_1,undefined4 param_2,int param_3)
- {
- int iVar1;
- int local_18 [2];
- local_18[0] = 0;
- iVar1 = 0xf011;
- if ((((param_3 == 1) && (iVar1 = phy_826xb_ctrl_get(param_1,param_2,0x19,local_18), iVar1 == 0))
- && (iVar1 = phy_common_c45_speed_set(param_1,param_2,1), iVar1 == 0)) &&
- (_phy_826xb_an_restart(param_1,param_2), local_18[0] != 0)) {
- iVar1 = phy_826xb_ctrl_set(param_1,param_2,0x19);
- }
- return iVar1;
- }
- void phy_826XBdrv_mapperInit(undefined4 *param_1)
- {
- *param_1 = 0x1a;
- param_1[1] = phy_rtl826xb_patch_db_init;
- param_1[2] = phy_826xb_init;
- param_1[0x7c] = phy_common_c45_reset_set;
- param_1[5] = phy_826xb_media_get;
- param_1[3] = phy_826xb_ctrl_get;
- param_1[4] = phy_826xb_ctrl_set;
- param_1[0x7d] = phy_826xb_linkStatus_get;
- param_1[0x10] = phy_common_c45_enable_get;
- param_1[0x11] = phy_common_c45_enable_set;
- param_1[7] = phy_common_c45_autoNegoEnable_get;
- param_1[8] = phy_826xb_autoNegoEnable_set;
- param_1[9] = phy_826xb_autoNegoAbilityLocal_get;
- param_1[10] = phy_826xb_autoNegoAbility_get;
- param_1[0xb] = phy_826xb_autoNegoAbility_set;
- param_1[0x7e] = phy_826xb_autoNegoAbilityPeer_get;
- param_1[0xe] = phy_common_c45_speed_get;
- param_1[0xf] = phy_826xb_speed_set;
- param_1[0x95] = phy_common_c45_speedStatusResReg_get;
- param_1[0x99] = phy_common_c45_speedDuplexStatusResReg_get;
- param_1[0xc] = phy_826xb_duplex_get;
- param_1[0xd] = phy_826xb_duplex_set;
- param_1[0x60] = phy_common_c45_masterSlave_get;
- param_1[0x61] = phy_common_c45_masterSlave_set;
- param_1[0x1a] = phy_common_c45_crossOverStatus_get;
- param_1[0x18] = phy_826xb_crossOverMode_get;
- param_1[0x19] = phy_826xb_crossOverMode_set;
- param_1[0x7f] = phy_826xb_macIntfSerdesMode_get;
- param_1[0x83] = phy_826xb_macIntfSerdesLinkStatus_get;
- param_1[0x6f] = phy_common_c45_ieeeTestMode_set;
- param_1[0x12] = phy_826xb_rtctResult_get;
- param_1[0x13] = phy_826xb_rtct_start;
- param_1[0x8d] = phy_826xb_intrStatus_get;
- param_1[0x8b] = phy_826xb_intrEnable_get;
- param_1[0x8c] = phy_826xb_intrEnable_set;
- param_1[0x8e] = phy_826xb_intrMask_get;
- param_1[0x8f] = phy_826xb_intrMask_set;
- param_1[0x5a] = phy_common_reg_mmd_get;
- param_1[0x5b] = phy_common_reg_mmd_set;
- param_1[0x90] = phy_826xb_sdsTestMode_set;
- param_1[0x91] = phy_826xb_sdsTestModeCnt_get;
- param_1[0x98] = phy_826xb_dbgCounter_get;
- param_1[0x14] = phy_826xb_greenEnable_get;
- param_1[0x15] = phy_826xb_greenEnable_set;
- param_1[0x27] = phy_826xb_downSpeedEnable_get;
- param_1[0x28] = phy_826xb_downSpeedEnable_set;
- param_1[0x29] = phy_826xb_downSpeedStatus_get;
- param_1[0x16] = phy_826xb_eeeEnable_get;
- param_1[0x17] = phy_826xb_eeeEnable_set;
- param_1[0x23] = phy_826xb_eeepEnable_get;
- param_1[0x24] = phy_826xb_eeepEnable_set;
- param_1[0x1d] = phy_826xb_linkDownPowerSavingEnable_get;
- param_1[0x1e] = phy_826xb_linkDownPowerSavingEnable_set;
- param_1[0x62] = phy_common_c45_loopback_get;
- param_1[99] = phy_common_c45_loopback_set;
- param_1[0x84] = phy_826xb_sdsEyeParam_get;
- param_1[0x85] = phy_826xb_sdsEyeParam_set;
- param_1[0x88] = phy_826xb_mdiLoopbackEnable_get;
- param_1[0x89] = phy_826xb_mdiLoopbackEnable_set;
- param_1[0x72] = phy_826xb_eyeMonitor_start;
- param_1[0x73] = phy_826xb_eyeMonitorInfo_get;
- param_1[0x31] = phy_826xb_ptp_portRefTime_get;
- param_1[0x32] = phy_826xb_ptp_portRefTime_set;
- param_1[0x33] = phy_826xb_ptp_portRefTimeAdjust_set;
- param_1[0x46] = phy_826xb_ptp_portRefTimeFreq_get;
- param_1[0x47] = phy_826xb_ptp_portRefTimeFreq_set;
- param_1[0x38] = phy_826xb_ptp_portPtpEnable_get;
- param_1[0x39] = phy_826xb_ptp_portPtpEnable_set;
- param_1[0x48] = phy_826xb_ptp_portPtpTxInterruptStatus_get;
- param_1[0x3b] = phy_826xb_ptp_portPtpInterruptEnable_get;
- param_1[0x3c] = phy_826xb_ptp_portPtpInterruptEnable_set;
- param_1[0x3d] = phy_826xb_ptp_portPtpVlanTpid_get;
- param_1[0x3e] = phy_826xb_ptp_portPtpVlanTpid_set;
- param_1[0x43] = phy_826xb_ptp_portPtpOper_get;
- param_1[0x44] = phy_826xb_ptp_portPtpOper_set;
- param_1[0x45] = phy_826xb_ptp_portPtpLatchTime_get;
- param_1[0x49] = phy_826xb_ptp_ptpTxTimestampFifo_get;
- param_1[0x4a] = phy_826xb_ptp_ptp1PPSOutput_get;
- param_1[0x4b] = phy_826xb_ptp_ptp1PPSOutput_set;
- param_1[0x4c] = phy_826xb_ptp_ptpClockOutput_get;
- param_1[0x4d] = phy_826xb_ptp_ptpClockOutput_set;
- param_1[0x4e] = phy_826xb_ptp_portPtpOutputSigSel_get;
- param_1[0x4f] = phy_826xb_ptp_portPtpOutputSigSel_set;
- param_1[0x52] = phy_826xb_ptp_portPtpLinkDelay_get;
- param_1[0x53] = phy_826xb_ptp_portPtpLinkDelay_set;
- param_1[0x55] = phy_826xb_ptp_fullSec_get;
- param_1[0x9a] = phy_826xb_macsec_reg_get;
- param_1[0x9b] = phy_826xb_macsec_reg_set;
- param_1[0x9c] = phy_macsec_port_cfg_set;
- param_1[0x9d] = phy_macsec_port_cfg_get;
- param_1[0x9e] = phy_macsec_sc_create;
- param_1[0x9f] = phy_macsec_sc_get;
- param_1[0xa0] = phy_macsec_sc_del;
- param_1[0xa1] = phy_macsec_sc_status_get;
- param_1[0xa2] = phy_macsec_sa_create;
- param_1[0xa3] = phy_macsec_sa_get;
- param_1[0xa4] = phy_macsec_sa_del;
- param_1[0xa5] = phy_macsec_sa_activate;
- param_1[0xa6] = phy_macsec_rxsa_disable;
- param_1[0xa7] = phy_macsec_txsa_disable;
- param_1[0xa8] = phy_macsec_stat_clear;
- param_1[0xa9] = phy_macsec_stat_port_get;
- param_1[0xaa] = phy_macsec_stat_txsa_get;
- param_1[0xab] = phy_macsec_stat_rxsa_get;
- param_1[0xac] = phy_macsec_intr_status_get;
- return;
- }
- int phy_826xb_speed_set(undefined4 param_1,undefined4 param_2,int param_3)
- {
- int iVar1;
- int local_18 [2];
- local_18[0] = 0;
- iVar1 = 0xf011;
- if ((((param_3 == 1) && (iVar1 = phy_826xb_ctrl_get(param_1,param_2,0x19,local_18), iVar1 == 0))
- && (iVar1 = phy_common_c45_speed_set(param_1,param_2,1), iVar1 == 0)) &&
- (_phy_826xb_an_restart(param_1,param_2), local_18[0] != 0)) {
- iVar1 = phy_826xb_ctrl_set(param_1,param_2,0x19);
- }
- return iVar1;
- }
- int phy_rtl826xb_patch_db_init(undefined4 param_1,undefined4 param_2,undefined4 *param_3)
- {
- undefined4 *__s;
- int iVar1;
- uint local_30 [2];
- local_30[0] = 0;
- __s = (undefined4 *)osal_alloc(0x428);
- iVar1 = 0xf032;
- if (__s != (undefined4 *)0x0) {
- memset(__s,0,0x428);
- *__s = phy_rtl826xb_patch_op;
- __s[1] = phy_rtl826xb_patch_flow;
- iVar1 = phy_common_general_reg_mmd_get(param_1,param_2,0x1e,0x104,local_30);
- if (iVar1 == 0) {
- if (((local_30[0] & 0xffc0) == 0x1140) || ((local_30[0] & 0xf) != 0)) {
- *(undefined1 *)(__s + 0xe) = 5;
- __s[0x10] = 0x1f68;
- __s[0x12] = rtl8261n_c_uc_conf;
- *(undefined1 *)(__s + 0x14) = 0xc;
- __s[0x16] = 0xb90;
- *(undefined1 *)(__s + 0x1a) = 0x10;
- *(undefined1 *)(__s + 0x1b) = 0x10;
- *(undefined1 *)(__s + 0x1d) = 9;
- __s[0xf] = rtl8261n_c_uc2_conf;
- __s[0x1e] = rtl8261n_c_algxg_conf;
- __s[0x1f] = 0xe60;
- *(undefined1 *)(__s + 0x20) = 10;
- __s[0x21] = rtl8261n_c_alg_giga_conf;
- *(undefined1 *)(__s + 0x11) = 4;
- __s[0x22] = 100;
- __s[0x13] = 200;
- *(undefined1 *)(__s + 0x23) = 0xb;
- __s[0x15] = rtl8261n_c_dataram_conf;
- __s[0x24] = rtl8261n_c_normal_conf;
- *(undefined1 *)(__s + 2) = 0xe;
- *(undefined1 *)(__s + 3) = 0xe;
- __s[7] = 0x640;
- __s[10] = 0x5a0;
- __s[0xd] = 0x4498;
- *(undefined1 *)(__s + 0x17) = 0xf;
- *(undefined1 *)(__s + 0x18) = 0xf;
- __s[0x25] = 0x71c;
- *(undefined1 *)(__s + 5) = 6;
- __s[6] = rtl8261n_c_nctl0_conf;
- *(undefined1 *)(__s + 8) = 7;
- __s[9] = rtl8261n_c_nctl1_conf;
- *(undefined1 *)(__s + 0xb) = 8;
- __s[0xc] = rtl8261n_c_nctl2_conf;
- *(undefined1 *)(__s + 0x26) = 1;
- *(undefined1 *)(__s + 0x32) = 0x11;
- *(undefined1 *)(__s + 0x33) = 0x11;
- __s[0x97] = 0x640;
- __s[0x2e] = 0x26c;
- *(undefined1 *)(__s + 0x35) = 0x18;
- *(undefined1 *)(__s + 0x36) = 0x18;
- __s[0x91] = 0x26c;
- *(undefined1 *)(__s + 0x98) = 0x13;
- *(undefined1 *)(__s + 0x99) = 0x13;
- __s[0x27] = rtl8261n_c_top_conf;
- __s[0x28] = 0x154;
- *(undefined1 *)(__s + 0x29) = 2;
- __s[0x2a] = rtl8261n_c_sds_conf;
- __s[0x2b] = 0x80c;
- *(undefined1 *)(__s + 0x2c) = 3;
- __s[0x2d] = rtl8261n_c_afe_conf;
- *(undefined1 *)(__s + 0x2f) = 0xd;
- __s[0x30] = rtl8261n_c_rtct_conf;
- __s[0x31] = 0xdc0;
- *(undefined1 *)(__s + 0x86) = 0x1b;
- *(undefined1 *)(__s + 0x87) = 0x1b;
- *(undefined1 *)(__s + 0x89) = 1;
- __s[0x8a] = rtl8261n_c_top_conf;
- __s[0x8b] = 0x154;
- *(undefined1 *)(__s + 0x8c) = 2;
- __s[0x8d] = rtl8261n_c_sds_conf;
- __s[0x8e] = 0x80c;
- *(undefined1 *)(__s + 0x8f) = 3;
- __s[0x90] = rtl8261n_c_afe_conf;
- *(undefined1 *)(__s + 0x92) = 0x12;
- *(undefined1 *)(__s + 0x93) = 0x12;
- *(undefined1 *)(__s + 0x95) = 6;
- __s[0x96] = rtl8261n_c_nctl0_conf;
- *(undefined1 *)(__s + 0x9b) = 0x14;
- __s[0xa9] = 0x4498;
- *(undefined1 *)(__s + 0xaa) = 0x17;
- *(undefined1 *)(__s + 0xab) = 0x17;
- *(undefined1 *)(__s + 0xad) = 4;
- *(undefined1 *)(__s + 0xb9) = 0xf;
- __s[0xae] = rtl8261n_c_uc_conf;
- __s[0xaf] = 200;
- *(undefined1 *)(__s + 0xb0) = 5;
- *(undefined1 *)(__s + 0xba) = 0xf;
- __s[0xb1] = rtl8261n_c_uc2_conf;
- __s[0xb2] = 0x1f68;
- *(undefined1 *)(__s + 0xb3) = 0xe;
- *(undefined1 *)(__s + 0xb4) = 0xe;
- *(undefined1 *)(__s + 0xb6) = 0xc;
- __s[0xbd] = rtl8261n_c_algxg_conf;
- __s[0xb7] = rtl8261n_c_dataram_conf;
- __s[0xb8] = 0xb90;
- __s[0xa0] = 0x5a0;
- *(undefined1 *)(__s + 0xbc) = 9;
- __s[0xbe] = 0xe60;
- __s[0xc0] = rtl8261n_c_alg_giga_conf;
- *(undefined1 *)(__s + 0xa1) = 0x15;
- *(undefined1 *)(__s + 0xa2) = 0x15;
- *(undefined1 *)(__s + 0xbf) = 10;
- __s[0xc1] = 100;
- *(undefined1 *)(__s + 0x9c) = 0x14;
- *(undefined1 *)(__s + 0x9e) = 7;
- __s[0x9f] = rtl8261n_c_nctl1_conf;
- *(undefined1 *)(__s + 0xa4) = 0x16;
- *(undefined1 *)(__s + 0xa5) = 0x16;
- *(undefined1 *)(__s + 0xa7) = 8;
- __s[0xa8] = rtl8261n_c_nctl2_conf;
- *(undefined1 *)(__s + 0xc2) = 0xb;
- __s[0xc3] = rtl8261n_c_normal_conf;
- __s[0xc4] = 0x71c;
- *(undefined1 *)(__s + 0xc5) = 0xd;
- __s[0xc6] = rtl8261n_c_rtct_conf;
- __s[199] = 0xdc0;
- }
- else {
- *(undefined1 *)(__s + 0xe) = 5;
- *(undefined1 *)(__s + 0x14) = 0xc;
- __s[0x16] = 0x8c0;
- *(undefined1 *)(__s + 0x1a) = 0x10;
- *(undefined1 *)(__s + 0x1b) = 0x10;
- *(undefined1 *)(__s + 0x1d) = 9;
- __s[0x1e] = rtl8264b_algxg_conf;
- __s[0x1f] = 0x5f0;
- *(undefined1 *)(__s + 0x20) = 10;
- __s[0x21] = rtl8264b_alg_giga_conf;
- __s[0x22] = 0x514;
- __s[0x10] = 0x1a90;
- *(undefined1 *)(__s + 0x23) = 0xb;
- __s[0xf] = rtl8264b_uc2_conf;
- __s[0x15] = rtl8264b_dataram_conf;
- __s[0x24] = rtl8264b_normal_conf;
- *(undefined1 *)(__s + 2) = 0x1a;
- *(undefined1 *)(__s + 3) = 0x1a;
- __s[0x13] = 0x1428;
- *(undefined1 *)(__s + 0x17) = 0xf;
- *(undefined1 *)(__s + 0x18) = 0xf;
- __s[0x25] = 0x71c;
- *(undefined1 *)(__s + 5) = 6;
- __s[6] = rtl8264b_nctl0_conf;
- __s[7] = 0xd20;
- *(undefined1 *)(__s + 8) = 7;
- __s[9] = rtl8264b_nctl1_conf;
- __s[10] = 0;
- *(undefined1 *)(__s + 0xb) = 8;
- __s[0xc] = rtl8264b_nctl2_conf;
- __s[0xd] = 0x5118;
- *(undefined1 *)(__s + 0x11) = 4;
- __s[0x12] = rtl8264b_uc_conf;
- *(undefined1 *)(__s + 0x26) = 1;
- *(undefined1 *)(__s + 0x32) = 0x11;
- *(undefined1 *)(__s + 0x33) = 0x11;
- __s[0x28] = 0x154;
- __s[0x2e] = 0x154;
- *(undefined1 *)(__s + 0x35) = 0x19;
- *(undefined1 *)(__s + 0x36) = 0x19;
- __s[0x8b] = 0x154;
- __s[0x91] = 0x154;
- *(undefined1 *)(__s + 0x38) = 0x18;
- *(undefined1 *)(__s + 0x39) = 0x18;
- *(undefined1 *)(__s + 0x92) = 0x12;
- *(undefined1 *)(__s + 0x93) = 0x12;
- __s[0x27] = rtl8264b_top_conf;
- *(undefined1 *)(__s + 0x29) = 2;
- __s[0x2a] = rtl8264b_sds_conf;
- __s[0x2b] = 0x80c;
- *(undefined1 *)(__s + 0x2c) = 3;
- __s[0x2d] = rtl8264b_afe_conf;
- *(undefined1 *)(__s + 0x2f) = 0xd;
- __s[0x30] = rtl8264b_nctl1_conf;
- __s[0x31] = 0;
- *(undefined1 *)(__s + 0x86) = 0x1b;
- *(undefined1 *)(__s + 0x87) = 0x1b;
- *(undefined1 *)(__s + 0x89) = 1;
- __s[0x8a] = rtl8264b_top_conf;
- *(undefined1 *)(__s + 0x8c) = 2;
- __s[0x8d] = rtl8264b_sds_conf;
- __s[0x8e] = 0x80c;
- *(undefined1 *)(__s + 0x8f) = 3;
- __s[0x90] = rtl8264b_afe_conf;
- *(undefined1 *)(__s + 0x95) = 6;
- __s[0x96] = rtl8264b_nctl0_conf;
- __s[0x97] = 0xd20;
- *(undefined1 *)(__s + 0x98) = 0x13;
- *(undefined1 *)(__s + 0x99) = 0x13;
- *(undefined1 *)(__s + 0x9b) = 0x14;
- *(undefined1 *)(__s + 0x9c) = 0x14;
- *(undefined1 *)(__s + 0xa1) = 0x15;
- *(undefined1 *)(__s + 0xa2) = 0x15;
- *(undefined1 *)(__s + 0xa4) = 0x16;
- *(undefined1 *)(__s + 0xa5) = 0x16;
- *(undefined1 *)(__s + 0xaa) = 0x17;
- *(undefined1 *)(__s + 0xab) = 0x17;
- __s[0xaf] = 0x1428;
- *(undefined1 *)(__s + 0xb0) = 5;
- __s[0xb1] = rtl8264b_uc2_conf;
- __s[0xb2] = 0x1a90;
- *(undefined1 *)(__s + 0xb3) = 0x1a;
- *(undefined1 *)(__s + 0xb4) = 0x1a;
- *(undefined1 *)(__s + 0xb9) = 0xf;
- *(undefined1 *)(__s + 0xba) = 0xf;
- *(undefined1 *)(__s + 0xb6) = 0xc;
- __s[0xb8] = 0x8c0;
- *(undefined1 *)(__s + 0xbc) = 9;
- __s[0xb7] = rtl8264b_dataram_conf;
- *(undefined1 *)(__s + 0xbf) = 10;
- __s[0xbd] = rtl8264b_algxg_conf;
- __s[0xbe] = 0x5f0;
- __s[0xc0] = rtl8264b_alg_giga_conf;
- *(undefined1 *)(__s + 0x9e) = 7;
- __s[0x9f] = rtl8264b_nctl1_conf;
- __s[0xa0] = 0;
- *(undefined1 *)(__s + 0xa7) = 8;
- __s[0xa8] = rtl8264b_nctl2_conf;
- __s[0xa9] = 0x5118;
- *(undefined1 *)(__s + 0xad) = 4;
- __s[0xae] = rtl8264b_uc_conf;
- __s[0xc1] = 0x514;
- *(undefined1 *)(__s + 0xc2) = 0xb;
- __s[0xc3] = rtl8264b_normal_conf;
- __s[0xc4] = 0x71c;
- *(undefined1 *)(__s + 0xc5) = 0xd;
- __s[0xc6] = rtl8264b_nctl1_conf;
- __s[199] = 0;
- }
- *(undefined1 *)(__s + 200) = 0x1c;
- *(undefined1 *)(__s + 0xc9) = 0x1c;
- iVar1 = 0;
- *param_3 = __s;
- }
- }
- return iVar1;
- }
- void rtl826XB_config(int param_1,int param_2,undefined1 param_3)
- {
- int iVar1;
- uint uVar2;
- uint uVar3;
- uint uVar4;
- uint uVar5;
- byte local_28 [8];
- local_28[0] = 0;
- uVar5 = 4;
- if ((param_1 - 0x23U < 6) && ((1 << (param_1 - 0x23U & 0x1f) & 0x27U) != 0)) {
- uVar5 = 1;
- }
- uVar4 = 0;
- do {
- iVar1 = hwp_get_port_by_baseport_offset(param_2,param_3,uVar4,local_28);
- if (iVar1 != 0) {
- rt_log(1);
- return;
- }
- uVar2 = (uint)local_28[0];
- uVar3 = *(uint *)(*(int *)((&unitMapStruct)[param_2 * 2] + (uVar2 + 4) * 4 + 4) + 0xc);
- if ((uVar3 & 0x80) != 0) {
- iVar1 = phy_826xb_ctrl_set(param_2,uVar2,0x1d,uVar3 >> 7 & 1);
- if (iVar1 != 0) {
- rt_log(1);
- }
- uVar2 = (uint)local_28[0];
- }
- if ((*(char *)(*(int *)((&unitMapStruct)[param_2 * 2] + (uVar2 + 4) * 4 + 4) + 0x10) != '\0') &&
- (iVar1 = phy_826xb_ctrl_set(param_2,uVar2,0x1c), iVar1 != 0)) {
- rt_log(1);
- }
- uVar4 = uVar4 + 1;
- } while (uVar4 < uVar5);
- return;
- }
- void rtl826XB_config(int param_1,int param_2,undefined1 param_3)
- {
- int iVar1;
- uint uVar2;
- uint uVar3;
- uint uVar4;
- uint uVar5;
- byte local_28 [8];
- local_28[0] = 0;
- uVar5 = 4;
- if ((param_1 - 0x23U < 6) && ((1 << (param_1 - 0x23U & 0x1f) & 0x27U) != 0)) {
- uVar5 = 1;
- }
- uVar4 = 0;
- do {
- iVar1 = hwp_get_port_by_baseport_offset(param_2,param_3,uVar4,local_28);
- if (iVar1 != 0) {
- rt_log(1);
- return;
- }
- uVar2 = (uint)local_28[0];
- uVar3 = *(uint *)(*(int *)((&unitMapStruct)[param_2 * 2] + (uVar2 + 4) * 4 + 4) + 0xc);
- if ((uVar3 & 0x80) != 0) {
- iVar1 = phy_826xb_ctrl_set(param_2,uVar2,0x1d,uVar3 >> 7 & 1);
- if (iVar1 != 0) {
- rt_log(1);
- }
- uVar2 = (uint)local_28[0];
- }
- if ((*(char *)(*(int *)((&unitMapStruct)[param_2 * 2] + (uVar2 + 4) * 4 + 4) + 0x10) != '\0') &&
- (iVar1 = phy_826xb_ctrl_set(param_2,uVar2,0x1c), iVar1 != 0)) {
- rt_log(1);
- }
- uVar4 = uVar4 + 1;
- } while (uVar4 < uVar5);
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment