📄 ether.cod
字号:
000f8 e3a00001 mov r0, #1
; 168 : }
000fc e8bd4070 ldmia sp!, {r4 - r6, lr}
00100 e12fff1e bx lr
00104 |$L41868|
; 165 : }
; 166 :
; 167 : return (FALSE);
00104 e3a00000 mov r0, #0
; 168 : }
00108 e8bd4070 ldmia sp!, {r4 - r6, lr}
0010c e12fff1e bx lr
00110 |$L42080|
00110 00000000 DCD |??_C@_0DO@BCOPPBDF@INFO?3?5Performing?5PCMCIA?5NIC?5init@|
00114 |$M42076|
ENDP ; |LocatePCMCIACard|
EXPORT |??_C@_0DB@FEDFIEKD@ERROR?3?5Invalid?5PCMCIA?5configurat@| [ DATA ] ; `string'
00000 AREA |.text| { |VerifyEthernetPCMCIACard| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$VerifyEthernetPCMCIACard|, PDATA, SELECTION=5, ASSOC=|.text| { |VerifyEthernetPCMCIACard| } ; comdat associative
|$T42097| DCD |$L42096|
DCD 0x40001d01
00000 AREA |.rdata| { |??_C@_0DB@FEDFIEKD@ERROR?3?5Invalid?5PCMCIA?5configurat@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DB@FEDFIEKD@ERROR?3?5Invalid?5PCMCIA?5configurat@| DCB "ERROR: In"
DCB "valid PCMCIA configuration data 0x%x.", 0xd, 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |VerifyEthernetPCMCIACard| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |VerifyEthernetPCMCIACard| PROC
; 172 : {
00000 |$L42096|
00000 e52de004 str lr, [sp, #-4]!
00004 |$M42094|
; 173 : UINT8 Attribute;
; 174 : UINT8 *pAttribute = (UINT8 *) SlotAddress;
; 175 : UINT8 *pLastAttribute;
; 176 :
; 177 :
; 178 : // End of the PCMCIA attribute list.
; 179 : //
; 180 : pLastAttribute = pAttribute + 0x200;
; 181 :
; 182 : //
; 183 : Attribute = *pAttribute;
00004 e5d01000 ldrb r1, [r0]
00008 e2802c02 add r2, r0, #2, 24
; 184 : if (Attribute != (UINT8) 0x01)
0000c e3510001 cmp r1, #1
00010 0a000004 beq |$L41885|
; 185 : {
; 186 : EdbgOutputDebugString("ERROR: Invalid PCMCIA configuration data 0x%x.\r\n", Attribute);
00014 e59f0054 ldr r0, [pc, #0x54]
00018 eb000000 bl EdbgOutputDebugString
0001c |$L41894|
; 215 : }
; 216 : }
; 217 : }
; 218 :
; 219 : return (FALSE);
0001c e3a00000 mov r0, #0
; 220 :
; 221 : }
00020 e49de004 ldr lr, [sp], #4
00024 e12fff1e bx lr
00028 |$L41885|
; 187 : return (FALSE);
; 188 : }
; 189 :
; 190 : // Look for tuple.
; 191 : //
; 192 : while ((Attribute != (UINT8) 0x21) && (pAttribute < pLastAttribute))
00028 e1500002 cmp r0, r2
0002c 2afffffa bcs |$L41894|
; 193 : {
; 194 : pAttribute += sizeof(UINT16); // Step to tuple length.
; 195 : Attribute = *pAttribute;
; 196 : pAttribute += sizeof(UINT16) + (sizeof(UINT16) * Attribute); // Step over tuple.
00030 e5f03002 ldrb r3, [r0, #2]!
00034 e2833001 add r3, r3, #1
00038 e7f03083 ldrb r3, [r0, +r3, lsl #1]!
0003c e3530021 cmp r3, #0x21
00040 1afffff8 bne |$L41885|
; 197 : Attribute = *pAttribute;
; 198 : }
; 199 :
; 200 : // Find a valid tuple?
; 201 : //
; 202 : if (pAttribute < pLastAttribute)
00044 e1500002 cmp r0, r2
00048 2afffff3 bcs |$L41894|
; 203 : {
; 204 : pAttribute += sizeof(UINT16); // Defined tuple length.
; 205 : if ((Attribute = *pAttribute) == 2)
0004c e5f03002 ldrb r3, [r0, #2]!
00050 e3530002 cmp r3, #2
00054 1afffff0 bne |$L41894|
; 206 : {
; 207 : pAttribute += sizeof(UINT16);
; 208 : Attribute = *pAttribute;
; 209 :
; 210 : // Found an Ethernet card...
; 211 : //
; 212 : if (Attribute == 0x06)
00058 e5d03002 ldrb r3, [r0, #2]
0005c e3530006 cmp r3, #6
00060 1affffed bne |$L41894|
; 213 : {
; 214 : return (TRUE);
00064 e3a00001 mov r0, #1
; 220 :
; 221 : }
00068 e49de004 ldr lr, [sp], #4
0006c e12fff1e bx lr
00070 |$L42099|
00070 00000000 DCD |??_C@_0DB@FEDFIEKD@ERROR?3?5Invalid?5PCMCIA?5configurat@|
00074 |$M42095|
ENDP ; |VerifyEthernetPCMCIACard|
EXPORT |InitSpecifiedEthDevice|
EXPORT |??_C@_0DM@GJDOGNCA@INFO?3?5Trying?5to?5locate?1initializ@| [ DATA ] ; `string'
EXPORT |??_C@_0DM@MPEJGGJE@INFO?3?5Trying?5to?5locate?1initializ@| [ DATA ] ; `string'
EXPORT |??_C@_0DG@ELGKPAD@INFO?3?5Trying?5to?5initialize?5the?5b@| [ DATA ] ; `string'
EXPORT |??_C@_0CH@DMJOIKIF@INFO?3?55?40V?5Card?5detected?5in?5slot@| [ DATA ] ; `string'
EXPORT |??_C@_0CH@JJJJNBNM@INFO?3?53?43V?5Card?5detected?5in?5slot@| [ DATA ] ; `string'
EXPORT |??_C@_0CP@JDGKEGKO@INFO?3?5NE2000?5Ethernet?5controller@| [ DATA ] ; `string'
EXPORT |??_C@_0DJ@MAHGCFFM@ERROR?3?5Failed?5to?5initialize?5NE20@| [ DATA ] ; `string'
EXPORT |??_C@_0DI@CCHNCAOI@INFO?3?5SMSC?5LAN91C111?5Ethernet?5co@| [ DATA ] ; `string'
EXPORT |??_C@_0EB@BEPALHMI@ERROR?3?5Failed?5to?5initialize?5SMSC@| [ DATA ] ; `string'
IMPORT |LAN91CInit|
IMPORT |LAN91CSendFrame|
IMPORT |LAN91CGetFrame|
IMPORT |LAN91CEnableInts|
IMPORT |LAN91CDisableInts|
IMPORT |NE2000Init|
IMPORT |NE2000EnableInts|
IMPORT |NE2000DisableInts|
IMPORT |NE2000GetFrame|
IMPORT |NE2000SendFrame|
00000 AREA |.text| { |InitSpecifiedEthDevice| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$InitSpecifiedEthDevice|, PDATA, SELECTION=5, ASSOC=|.text| { |InitSpecifiedEthDevice| } ; comdat associative
|$T42148| DCD |$L42147|
DCD 0x4000c101
00000 AREA |.rdata| { |??_C@_0DJ@MAHGCFFM@ERROR?3?5Failed?5to?5initialize?5NE20@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DJ@MAHGCFFM@ERROR?3?5Failed?5to?5initialize?5NE20@| DCB "ERROR: F"
DCB "ailed to initialize NE2000 Ethernet controller.", 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0CP@JDGKEGKO@INFO?3?5NE2000?5Ethernet?5controller@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CP@JDGKEGKO@INFO?3?5NE2000?5Ethernet?5controller@| DCB "INFO: NE2"
DCB "000 Ethernet controller initialized.", 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0CH@JJJJNBNM@INFO?3?53?43V?5Card?5detected?5in?5slot@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CH@JJJJNBNM@INFO?3?53?43V?5Card?5detected?5in?5slot@| DCB "INFO: "
DCB "3.3V Card detected in slot %d.", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0CH@DMJOIKIF@INFO?3?55?40V?5Card?5detected?5in?5slot@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CH@DMJOIKIF@INFO?3?55?40V?5Card?5detected?5in?5slot@| DCB "INFO: "
DCB "5.0V Card detected in slot %d.", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0EB@BEPALHMI@ERROR?3?5Failed?5to?5initialize?5SMSC@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0EB@BEPALHMI@ERROR?3?5Failed?5to?5initialize?5SMSC@| DCB "ERROR: F"
DCB "ailed to initialize SMSC LAN91C111 Ethernet controller.", 0xa
DCB 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0DI@CCHNCAOI@INFO?3?5SMSC?5LAN91C111?5Ethernet?5co@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DI@CCHNCAOI@INFO?3?5SMSC?5LAN91C111?5Ethernet?5co@| DCB "INFO: SM"
DCB "SC LAN91C111 Ethernet controller initialized.", 0xd, 0xa
DCB 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0DM@GJDOGNCA@INFO?3?5Trying?5to?5locate?1initializ@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DM@GJDOGNCA@INFO?3?5Trying?5to?5locate?1initializ@| DCB "INFO: Tr"
DCB "ying to locate/initialize PCMCIA NIC in slot 0...", 0xd, 0xa
DCB 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0DM@MPEJGGJE@INFO?3?5Trying?5to?5locate?1initializ@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DM@MPEJGGJE@INFO?3?5Trying?5to?5locate?1initializ@| DCB "INFO: Tr"
DCB "ying to locate/initialize PCMCIA NIC in slot 1...", 0xd, 0xa
DCB 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0DG@ELGKPAD@INFO?3?5Trying?5to?5initialize?5the?5b@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DG@ELGKPAD@INFO?3?5Trying?5to?5initialize?5the?5b@| DCB "INFO: Tr"
DCB "ying to initialize the built-in SMSC NIC...", 0xd, 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |InitSpecifiedEthDevice| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |InitSpecifiedEthDevice| PROC
; 228 : {
00000 |$L42147|
00000 e92d47f0 stmdb sp!, {r4 - r10, lr}
00004 |$M42145|
00004 e1a09001 mov r9, r1
00008 e1a0a000 mov r10, r0
; 229 : UINT32 EbootDeviceAddress = 0;
; 230 : UINT32 Offset;
; 231 : UINT8 *pAttribute = NULL;
; 232 : UINT8 uByte;
; 233 : UINT32 SlotAddress = 0;
; 234 :
; 235 : volatile MAINSTONEII_BLR_REGS *pBLRegs = (volatile MAINSTONEII_BLR_REGS *) OALPAtoVA(MAINSTONEII_BASE_REG_PA_FPGA, FALSE);
0000c e3a01000 mov r1, #0
00010 e3a00302 mov r0, #2, 6
00014 eb000000 bl OALPAtoVA
00018 e1a05000 mov r5, r0
; 236 :
; 237 :
; 238 : // Determine the NIC's address.
; 239 : //
; 240 : switch (EthDevice)
0001c e3590000 cmp r9, #0
; 249 : break;
; 250 : case ETH_DEVICE_SMSC:
; 251 : default:
; 252 : SlotAddress = (UINT32) OALPAtoVA(MAINSTONEII_BASE_REG_PA_SMSC_ETHERNET, FALSE);
00020 e3a01000 mov r1, #0
00024 0a000018 beq |$L41912|
; 236 :
; 237 :
; 238 : // Determine the NIC's address.
; 239 : //
; 240 : switch (EthDevice)
00028 e3590001 cmp r9, #1
0002c 0a000004 beq |$L41915|
; 249 : break;
; 250 : case ETH_DEVICE_SMSC:
; 251 : default:
; 252 : SlotAddress = (UINT32) OALPAtoVA(MAINSTONEII_BASE_REG_PA_SMSC_ETHERNET, FALSE);
00030 e3a00201 mov r0, #1, 4
00034 eb000000 bl OALPAtoVA
00038 e1a04000 mov r4, r0
; 253 : EdbgOutputDebugString("INFO: Trying to initialize the built-in SMSC NIC...\r\n");
0003c e59f02bc ldr r0, [pc, #0x2BC]
; 254 : break;
00040 ea000015 b |$L42141|
00044 |$L41915|
; 245 : break;
; 246 : case ETH_DEVICE_PCMCIA1:
; 247 : SlotAddress = (UINT32) OALPAtoVA(BULVERDE_BASE_REG_PA_PCMCIA_S1_ATTR, FALSE);
00044 e3a0030e mov r0, #0xE, 6
00048 eb000000 bl OALPAtoVA
0004c e1a04000 mov r4, r0
; 248 : EdbgOutputDebugString("INFO: Trying to locate/initialize PCMCIA NIC in slot 1...\r\n");
00050 e59f02a4 ldr r0, [pc, #0x2A4]
00054 eb000000 bl EdbgOutputDebugString
00058 |$L41922|
; 260 : {
; 261 : // Locate the NIC card in the specified slot.
; 262 : //
; 263 : if (LocatePCMCIACard(EthDevice, SlotAddress))
00058 e1a01004 mov r1, r4
0005c e1a00009 mov r0, r9
00060 eb000000 bl LocatePCMCIACard
00064 e3500000 cmp r0, #0
00068 0a000089 beq |$L41941|
; 264 : {
; 265 : // Determine the PCMCIA card type.
; 266 : //
; 267 : if (VerifyEthernetPCMCIACard(SlotAddress))
0006c e5d41000 ldrb r1, [r4]
00070 e1a02004 mov r2, r4
00074 e2840c02 add r0, r4, #2, 24
00078 e3510001 cmp r1, #1
0007c 0a00002e beq |$L42117|
00080 e59f0270 ldr r0, [pc, #0x270]
00084 eb000000 bl EdbgOutputDebugString
00088 ea000081 b |$L41941|
0008c |$L41912|
; 241 : {
; 242 : case ETH_DEVICE_PCMCIA0:
; 243 : SlotAddress = (UINT32) OALPAtoVA(BULVERDE_BASE_REG_PA_PCMCIA_S0_ATTR, FALSE);
0008c e3a0030a mov r0, #0xA, 6
00090 eb000000 bl OALPAtoVA
00094 e1a04000 mov r4, r0
; 244 : EdbgOutputDebugString("INFO: Trying to locate/initialize PCMCIA NIC in slot 0...\r\n");
00098 e59f0254 ldr r0, [pc, #0x254]
0009c |$L42141|
0009c eb000000 bl EdbgOutputDebugString
; 255 : }
; 256 :
; 257 : // PCMCIA NIC?
; 258 : //
; 259 : if ((EthDevice == ETH_DEVICE_PCMCIA0) || (EthDevice == ETH_DEVICE_PCMCIA1))
000a0 e3590000 cmp r9, #0
000a4 0affffeb beq |$L41922|
000a8 e3590001 cmp r9, #1
000ac 0affffe9 beq |$L41922|
; 332 : }
; 333 : else
; 334 : {
; 335 : // Use the SMSC LAN91C111 NIC.
; 336 : //
; 337 : EbootDeviceAddress = (SlotAddress + 0x300);
; 338 :
; 339 : if (LAN91CInit((UINT8 *) EbootDeviceAddress, 0, pKITLArgs->mac))
000b0 e28a2018 add r2, r10, #0x18
000b4 e3a01000 mov r1, #0
000b8 e2840c03 add r0, r4, #3, 24
000bc eb000000 bl LAN91CInit
000c0 e3500000 cmp r0, #0
000c4 0a00001a beq |$L41945|
; 340 : {
; 341 : pfnEDbgInit = (PFN_EDBG_INIT) LAN91CInit;
; 342 : pfnEDbgGetFrame = (PFN_EDBG_GET_FRAME) LAN91CGetFrame;
; 343 : pfnEDbgSendFrame = (PFN_EDBG_SEND_FRAME) LAN91CSendFrame;
; 344 : pfnEDbgEnableInts = (PFN_EDBG_ENABLE_INTS) LAN91CEnableInts;
; 345 : pfnEDbgDisableInts = (PFN_EDBG_DISABLE_INTS)LAN91CDisableInts;
000c8 e59f11fc ldr r1, [pc, #0x1FC]
000cc e59f321c ldr r3, [pc, #0x21C]
000d0 e59f91ec ldr r9, [pc, #0x1EC]
000d4 e59f7210 ldr r7, [pc, #0x210]
000d8 e59f81dc ldr r8, [pc, #0x1DC]
000dc e59f5204 ldr r5, [pc, #0x204]
000e0 e59f61cc ldr r6, [pc, #0x1CC]
000e4 e59fe1f8 ldr lr, [pc, #0x1F8]
000e8 e59f41bc ldr r4, [pc, #0x1BC]
000ec e59f21ec ldr r2, [pc, #0x1EC]
; 346 : #ifdef IMGSHAREETH
; 347 : pfnCurrentPacketFilter = (PFN_EDBG_CURRENT_PACKET_FILTER) LAN91CCurrentPacketFilter;
; 348 : pfnMulticastList = (PFN_EDBG_MULTICAST_LIST) LAN91CMulticastList;
; 349 : #endif
; 350 :
; 351 : // Save the device location information for later use.
; 352 : //
; 353 : pKITLArgs->devLoc.IfcType = Internal;
; 354 : pKITLArgs->devLoc.BusNumber = 0;
; 355 : pKITLArgs->devLoc.PhysicalLoc = (PVOID)(MAINSTONEII_BASE_REG_PA_SMSC_ETHERNET + 0x300);
; 356 : pKITLArgs->devLoc.LogicalLoc = (DWORD)pKITLArgs->devLoc.PhysicalLoc;
; 357 :
; 358 : EdbgOutputDebugString("INFO: SMSC LAN91C111 Ethernet controller initialized.\r\n");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -