📄 ether.cod
字号:
001bc e3a03201 mov r3, #1, 4
001c0 e5886000 str r6, [r8]
001c4 e5850000 str r0, [r5]
001c8 e58e2000 str r2, [lr]
001cc e58a4004 str r4, [r10, #4]
001d0 e58a4008 str r4, [r10, #8]
001d4 e3833c03 orr r3, r3, #3, 24
; 397 : pKITLArgs->devLoc.LogicalLoc = (DWORD)pKITLArgs->devLoc.PhysicalLoc;
001d8 eaffffd9 b |$L40948|
001dc |$L40743|
; 246 : break;
; 247 : case ETH_DEVICE_PCMCIA1:
; 248 : SlotAddress = (UINT32) OALPAtoVA(BULVERDE_BASE_REG_PA_PCMCIA_S1_ATTR, FALSE);
001dc e3a01000 mov r1, #0
001e0 e3a0030e mov r0, #0xE, 6
001e4 eb000000 bl OALPAtoVA
; 249 : EdbgOutputDebugString("INFO: Trying to locate/initialize PCMCIA NIC in slot 1...\r\n");
001e8 e59f004c ldr r0, [pc, #0x4C]
; 250 : break;
001ec ea000009 b |$L40947|
001f0 |$L40740|
; 242 : {
; 243 : case ETH_DEVICE_PCMCIA0:
; 244 : SlotAddress = (UINT32) OALPAtoVA(BULVERDE_BASE_REG_PA_PCMCIA_S0_ATTR, FALSE);
001f0 e3a01000 mov r1, #0
001f4 e3a0030a mov r0, #0xA, 6
001f8 eb000000 bl OALPAtoVA
; 245 : EdbgOutputDebugString("INFO: Trying to locate/initialize PCMCIA NIC in slot 0...\r\n");
001fc e59f0034 ldr r0, [pc, #0x34]
; 262 : default:
; 263 : break;
; 264 : }
; 265 :
; 266 : // PCMCIA NIC?
; 267 : //
; 268 : /* if ((EthDevice == ETH_DEVICE_PCMCIA0) || (EthDevice == ETH_DEVICE_PCMCIA1))
; 269 : {
; 270 : // Locate the NIC card in the specified slot.
; 271 : //
; 272 : if (LocatePCMCIACard(EthDevice, SlotAddress))
; 273 : {
; 274 : // Determine the PCMCIA card type.
; 275 : //
; 276 : if (VerifyEthernetPCMCIACard(SlotAddress))
; 277 : {
; 278 : if ((((pBLRegs->pcmcia0_srcr & PCMCIA_POWER) == PCMCIA_VCC5V_VPP0V) && (EthDevice == ETH_DEVICE_PCMCIA0)) ||
; 279 : (((pBLRegs->pcmcia1_srcr & PCMCIA_POWER) == PCMCIA_VCC5V_VPP0V) && (EthDevice == ETH_DEVICE_PCMCIA1)))
; 280 : {
; 281 : EdbgOutputDebugString("INFO: 5.0V Card detected in slot %d.\r\n", ((EthDevice == ETH_DEVICE_PCMCIA0)?0:1));
; 282 :
; 283 : uByte = 0x21;
; 284 : Offset = CIS_R0;
; 285 : pAttribute = (UINT8 *) SlotAddress;
; 286 : pAttribute += Offset;
; 287 : *pAttribute = uByte;
; 288 :
; 289 : uByte = 0x1;
; 290 : Offset = CIS_R0 + 2;
; 291 : pAttribute = (UINT8 *) SlotAddress;
; 292 : pAttribute += Offset;
; 293 : *pAttribute = uByte;
; 294 : }
; 295 : else
; 296 : {
; 297 : EdbgOutputDebugString("INFO: 3.3V Card detected in slot %d.\r\n", ((EthDevice == ETH_DEVICE_PCMCIA0)?0:1));
; 298 :
; 299 : uByte = 0x20;
; 300 : Offset = CIS_R0;
; 301 : pAttribute = (UINT8 *) SlotAddress;
; 302 : pAttribute += Offset;
; 303 : *pAttribute = uByte;
; 304 : }
; 305 :
; 306 : EbootDeviceAddress = (EthDevice == ETH_DEVICE_PCMCIA0) ? (UINT32) OALPAtoVA(BULVERDE_BASE_REG_PA_PCMCIA_S0_IO, FALSE) + 0x300 : \
; 307 : (UINT32) OALPAtoVA(BULVERDE_BASE_REG_PA_PCMCIA_S1_IO, FALSE) + 0x300;
; 308 :
; 309 : // Only supported PCMCIA NIC is an NE2000-compatible NIC. Initialize it.
; 310 : //
; 311 : if (NE2000Init((BYTE *) EbootDeviceAddress, 1, pKITLArgs->mac))
; 312 : {
; 313 : pfnEDbgInit = NE2000Init;
; 314 : pfnEDbgGetFrame = NE2000GetFrame;
; 315 : pfnEDbgSendFrame = NE2000SendFrame;
; 316 : pfnEDbgEnableInts = NE2000EnableInts;
; 317 : pfnEDbgDisableInts = NE2000DisableInts;
; 318 : #ifdef IMGSHAREETH
; 319 : pfnCurrentPacketFilter = NULL;
; 320 : pfnMulticastList = NULL;
; 321 : #endif
; 322 :
; 323 : // Save the device location information for later use.
; 324 : //
; 325 : pKITLArgs->devLoc.IfcType = Internal;
; 326 : pKITLArgs->devLoc.BusNumber = 0;
; 327 : pKITLArgs->devLoc.PhysicalLoc = (PVOID)((EthDevice == ETH_DEVICE_PCMCIA0) ? (BULVERDE_BASE_REG_PA_PCMCIA_S0_IO + 0x300) : (BULVERDE_BASE_REG_PA_PCMCIA_S1_IO + 0x300));
; 328 : pKITLArgs->devLoc.LogicalLoc = (DWORD)pKITLArgs->devLoc.PhysicalLoc;
; 329 :
; 330 : EdbgOutputDebugString("INFO: NE2000 Ethernet controller initialized.\n");
; 331 : return(EDBG_ADAPTER_NE2000);
; 332 : }
; 333 : else
; 334 : {
; 335 : EdbgOutputDebugString("ERROR: Failed to initialize NE2000 Ethernet controller.\n");
; 336 : }
; 337 : }
; 338 : }
; 339 :
; 340 : return (-1);
; 341 : }*/
; 342 : if(EthDevice == ETH_DEVICE_DM9000)
00200 ea000004 b |$L40947|
00204 |$L40758|
; 366 : }
; 367 : else
; 368 : {
; 369 : EdbgOutputDebugString("ERROR: Failed to initialize DM9000 Ethernet controller.\n");
00204 e59f0028 ldr r0, [pc, #0x28]
; 370 : }
; 371 :
; 372 : }
; 373 : else
00208 ea000002 b |$L40947|
0020c |$L40772|
; 398 :
; 399 : EdbgOutputDebugString("INFO: SMSC LAN91C111 Ethernet controller initialized.\r\n");
; 400 : return(EDBG_ADAPTER_SMC9000);
; 401 : }
; 402 : else
; 403 : {
; 404 : EdbgOutputDebugString("ERROR: Failed to initialize SMSC LAN91C111 Ethernet controller.\n");
0020c e59f001c ldr r0, [pc, #0x1C]
; 405 : }
; 406 : }
; 407 : else if(EthDevice == ETH_DEVICE_CS8900)
00210 ea000000 b |$L40947|
00214 |$L40786|
; 433 : }
; 434 : else
; 435 : {
; 436 : EdbgOutputDebugString("ERROR: Failed to initialize CS8900 Ethernet controller.\n");
00214 e59f0010 ldr r0, [pc, #0x10]
00218 |$L40947|
00218 eb000000 bl EdbgOutputDebugString
0021c |$L40794|
; 437 : }
; 438 :
; 439 : }
; 440 :
; 441 : return (-1);
0021c e3e04000 mvn r4, #0
00220 |$L40729|
; 365 : return(EDBG_ADAPTER_SMC9000);
00220 e1a00004 mov r0, r4
; 442 :
; 443 : }
00224 e8bd47f0 ldmia sp!, {r4 - r10, lr}
00228 e12fff1e bx lr
0022c |$L40954|
0022c 00000000 DCD |??_C@_0DJ@OJIOOPLG@ERROR?3?5Failed?5to?5initialize?5CS89@|
00230 00000000 DCD |??_C@_0EB@BEPALHMI@ERROR?3?5Failed?5to?5initialize?5SMSC@|
00234 00000000 DCD |??_C@_0DJ@NEBMEBBH@ERROR?3?5Failed?5to?5initialize?5DM90@|
00238 00000000 DCD |??_C@_0DM@GJDOGNCA@INFO?3?5Trying?5to?5locate?1initializ@|
0023c 00000000 DCD |??_C@_0DM@MPEJGGJE@INFO?3?5Trying?5to?5locate?1initializ@|
00240 00000000 DCD |LAN91CEnableInts|
00244 00000000 DCD |pfnEDbgEnableInts|
00248 00000000 DCD |LAN91CSendFrame|
0024c 00000000 DCD |pfnEDbgSendFrame|
00250 00000000 DCD |LAN91CInit|
00254 00000000 DCD |pfnEDbgInit|
00258 00000000 DCD |LAN91CDisableInts|
0025c 00000000 DCD |pfnEDbgDisableInts|
00260 00000000 DCD |LAN91CGetFrame|
00264 00000000 DCD |pfnEDbgGetFrame|
00268 00000000 DCD |??_C@_0DG@ELGKPAD@INFO?3?5Trying?5to?5initialize?5the?5b@|
0026c 00000000 DCD |??_C@_0DI@CCHNCAOI@INFO?3?5SMSC?5LAN91C111?5Ethernet?5co@|
00270 00000000 DCD |CS8900ADisableInts|
00274 00000000 DCD |CS8900AEnableInts|
00278 00000000 DCD |CS8900ASendFrame|
0027c 00000000 DCD |CS8900AInit|
00280 00000000 DCD |CS8900AGetFrame|
00284 00000000 DCD |??_C@_0DI@OJHOHFCK@INFO?3?5Trying?5to?5initialize?5the?5b@|
00288 00000000 DCD |??_C@_0DA@CDHDIMPH@INFO?3?5DM9000?5Ethernet?5controller@|
0028c 00000000 DCD |Dm9isaSendFrame|
00290 00000000 DCD |Dm9isaGetFrame|
00294 00000000 DCD |Dm9isaInit|
00298 00000000 DCD |Dm9isaDisableInts|
0029c 00000000 DCD |Dm9isaEnableInts|
002a0 00000000 DCD |??_C@_0CJ@CLAOAIAB@INFO?3?5Trying?5to?5initialize?5the?5D@|
002a4 |$M40950|
ENDP ; |InitSpecifiedEthDevice|
EXPORT |OEMEthGetFrame|
00000 AREA |.text| { |OEMEthGetFrame| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$OEMEthGetFrame|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMEthGetFrame| } ; comdat associative
|$T40964| DCD |$L40963|
DCD 0x40000a01
; Function compile flags: /Ogsy
00000 AREA |.text| { |OEMEthGetFrame| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |OEMEthGetFrame| PROC
; 448 : {
00000 |$L40963|
00000 e52de004 str lr, [sp, #-4]!
00004 |$M40961|
; 449 : return (pfnEDbgGetFrame(pData, pwLength));
00004 e59f3018 ldr r3, [pc, #0x18]
00008 e5933000 ldr r3, [r3]
0000c e1a0e00f mov lr, pc
00010 e12fff13 bx r3
00014 e1a00800 mov r0, r0, lsl #16
00018 e1a00820 mov r0, r0, lsr #16
; 450 : }
0001c e49de004 ldr lr, [sp], #4
00020 e12fff1e bx lr
00024 |$L40966|
00024 00000000 DCD |pfnEDbgGetFrame|
00028 |$M40962|
ENDP ; |OEMEthGetFrame|
EXPORT |OEMEthSendFrame|
EXPORT |??_C@_0CE@HCNNFPGI@?$CBOEMEthSendFrame?5failure?0?5retry?5@| [ DATA ] ; `string'
00000 AREA |.text| { |OEMEthSendFrame| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$OEMEthSendFrame|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMEthSendFrame| } ; comdat associative
|$T40981| DCD |$L40980|
DCD 0x40001b01
00000 AREA |.rdata| { |??_C@_0CE@HCNNFPGI@?$CBOEMEthSendFrame?5failure?0?5retry?5@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CE@HCNNFPGI@?$CBOEMEthSendFrame?5failure?0?5retry?5@| DCB "!OEMEt"
DCB "hSendFrame failure, retry %u", 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |OEMEthSendFrame| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |OEMEthSendFrame| PROC
; 455 : {
00000 |$L40980|
00000 e92d40f0 stmdb sp!, {r4 - r7, lr}
00004 |$M40978|
00004 e1a05001 mov r5, r1
00008 e1a06000 mov r6, r0
; 456 : int retries = 0;
0000c e59f7054 ldr r7, [pc, #0x54]
00010 e3a04000 mov r4, #0
00014 |$L40808|
; 457 :
; 458 : // Let's be persistant here
; 459 : while (retries++ < 4)
; 460 : {
; 461 : if (!pfnEDbgSendFrame(pData, dwLength))
00014 e5973000 ldr r3, [r7]
00018 e1a01005 mov r1, r5
0001c e1a00006 mov r0, r6
00020 e2844001 add r4, r4, #1
00024 e1a0e00f mov lr, pc
00028 e12fff13 bx r3
0002c e1a03800 mov r3, r0, lsl #16
00030 e1b03823 movs r3, r3, lsr #16
00034 0a000007 beq |$L40970|
; 463 : EdbgOutputDebugString("!OEMEthSendFrame failure, retry %u\n",retries);
00038 e59f0024 ldr r0, [pc, #0x24]
0003c e1a01004 mov r1, r4
00040 eb000000 bl EdbgOutputDebugString
00044 e3540004 cmp r4, #4
00048 bafffff1 blt |$L40808|
; 464 : }
; 465 : return (FALSE);
0004c e3a00000 mov r0, #0
; 466 : }
00050 e8bd40f0 ldmia sp!, {r4 - r7, lr}
00054 e12fff1e bx lr
00058 |$L40970|
; 462 : return (TRUE);
00058 e3a00001 mov r0, #1
; 466 : }
0005c e8bd40f0 ldmia sp!, {r4 - r7, lr}
00060 e12fff1e bx lr
00064 |$L40983|
00064 00000000 DCD |??_C@_0CE@HCNNFPGI@?$CBOEMEthSendFrame?5failure?0?5retry?5@|
00068 00000000 DCD |pfnEDbgSendFrame|
0006c |$M40979|
ENDP ; |OEMEthSendFrame|
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -