⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ether.cod

📁 EP9315的BSP包(WINCE下的BSP,内有各种驱动的详细的代码)
💻 COD
📖 第 1 页 / 共 3 页
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 12.20.9615 

	TTL	d:\wince420\platform\ep931x\eboot\.\ether.c
	CODE32

  00000			 AREA	 |.drectve|, DRECTVE
	DCB	"-defaultlib:coredll.lib "
	DCB	"-defaultlib:corelibc.lib "


  00000			 AREA	 |.bss|, NOINIT
|pfnEDbgInit| %	0x4
|pfnEDbgInitDMA| % 0x4
|pfnEDbgGetFrame| % 0x4
|pfnEDbgSendFrame| % 0x4
|MyAddr| %	0xc

  00000			 AREA	 |.rdata|, DATA, READONLY
|EdbgVendorIds| DCW 0x0
	DCW	0x0
	DCD	0x4033
	DCB	0x1
	DCB	"AD", 0x0
	DCW	0x1050
	DCW	0x940
	DCD	0x4005
	DCB	0x1
	DCB	"LS", 0x0
	DCW	0x1050
	DCW	0x940
	DCD	0x2078
	DCB	0x1
	DCB	"LS", 0x0
	DCW	0x10ec
	DCW	0x8029
	DCD	0xc0f0
	DCB	0x1
	DCB	"KS", 0x0
	DCW	0x10ec
	DCW	0x8129
	DCD	0x0
	DCB	0x4
	DCB	"RT", 0x0
	DCW	0x10ec
	DCW	0x8139
	DCD	0x900b
	DCB	0x4
	DCB	"RT", 0x0
	DCW	0x10ec
	DCW	0x8139
	DCD	0xd0c9
	DCB	0x4
	DCB	"RT", 0x0
	DCW	0x10ec
	DCW	0x8139
	DCD	0xe04c
	DCB	0x4
	DCB	"RT", 0x0
	DCW	0x1186
	DCW	0x1300
	DCD	0x50ba
	DCB	0x4
	DCB	"DL", 0x0
	DCW	0x100b
	DCW	0x20
	DCD	0xa0cc
	DCB	0x5
	DCB	"NG", 0x0
	DCW	0x10b7
	DCW	0x9050
	DCD	0x6008
	DCB	0x6
	DCB	"3C", 0x0
	DCW	0x10b7
	DCW	0x9200
	DCD	0x476
	DCB	0x6
	DCB	"3C", 0x0
	EXPORT	|OEMEthGetFrame|
; File d:\wince420\platform\ep931x\eboot\ether.c

  00000			 AREA	 |.text| { |OEMEthGetFrame| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$OEMEthGetFrame|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMEthGetFrame| } ; comdat associative
|$T37674| DCD	|OEMEthGetFrame|
	DCD	0x40001101
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |OEMEthGetFrame| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |OEMEthGetFrame| PROC

; 74   : {

  00000	e52de004	 str       lr, [sp, #-4]!
  00004		 |$M37672|
  00004	e1a03000	 mov       r3, r0

; 75   :     if (pfnEDbgGetFrame)

  00008	e59f0030	 ldr       r0, [pc, #0x30]
  0000c	e5902000	 ldr       r2, [r0]
  00010	e3520000	 cmp       r2, #0
  00014	0a000006	 beq       |$L37519|

; 76   :         return(pfnEDbgGetFrame(pData, pwLength));

  00018	e1a00003	 mov       r0, r3
  0001c	e1a0e00f	 mov       lr, pc
  00020	e12fff12	 bx        r2
  00024	e1a01800	 mov       r1, r0, lsl #16
  00028	e1a00821	 mov       r0, r1, lsr #16

; 79   : }

  0002c	e8bd4000	 ldmia     sp!, {lr}
  00030	e12fff1e	 bx        lr
  00034		 |$L37519|

; 77   : 
; 78   :     return(FALSE);

  00034	e3a00000	 mov       r0, #0

; 79   : }

  00038	e8bd4000	 ldmia     sp!, {lr}
  0003c	e12fff1e	 bx        lr
  00040		 |$L37676|
  00040	00000000	 DCD       |pfnEDbgGetFrame|
  00044		 |$M37673|

			 ENDP  ; |OEMEthGetFrame|

	EXPORT	|OEMEthSendFrame|
	EXPORT	|??_C@_0CL@HAGH@ERROR?3?5OEMEthSendFrame?5failure?0?5@| [ DATA ] ; `string'
	IMPORT	|EdbgOutputDebugString|

  00000			 AREA	 |.text| { |OEMEthSendFrame| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$OEMEthSendFrame|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMEthSendFrame| } ; comdat associative
|$T37688| DCD	|OEMEthSendFrame|
	DCD	0x40001b01

  00000			 AREA	 |.rdata| { |??_C@_0CL@HAGH@ERROR?3?5OEMEthSendFrame?5failure?0?5@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CL@HAGH@ERROR?3?5OEMEthSendFrame?5failure?0?5@| DCB "ERROR: OEMEt"
	DCB	"hSendFrame failure, retry %u", 0xd, 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |OEMEthSendFrame| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |OEMEthSendFrame| PROC

; 95   : {

  00000	e92d41f0	 stmdb     sp!, {r4 - r8, lr}
  00004		 |$M37686|
  00004	e1a06000	 mov       r6, r0
  00008	e1a05001	 mov       r5, r1

; 96   :     int retries = 0;

  0000c	e59f4054	 ldr       r4, [pc, #0x54]
  00010	e3a08000	 mov       r8, #0
  00014	e1a07008	 mov       r7, r8
  00018		 |$L37527|

; 97   : 
; 98   :     // Let's be persistant here
; 99   :     while (retries++ < 4) 
; 100  :     {
; 101  :         if (!pfnEDbgSendFrame(pData, dwLength))

  00018	e5942000	 ldr       r2, [r4]
  0001c	e1a01005	 mov       r1, r5
  00020	e1a00006	 mov       r0, r6
  00024	e2877001	 add       r7, r7, #1
  00028	e1a0e00f	 mov       lr, pc
  0002c	e12fff12	 bx        r2
  00030	e1a01800	 mov       r1, r0, lsl #16
  00034	e1b02821	 movs      r2, r1, lsr #16
  00038	0a000005	 beq       |$L37680|

; 103  :         else
; 104  :             EdbgOutputDebugString("ERROR: OEMEthSendFrame failure, retry %u\r\n", retries);

  0003c	e59f0020	 ldr       r0, [pc, #0x20]
  00040	e1a01007	 mov       r1, r7
  00044	eb000000	 bl        EdbgOutputDebugString
  00048	e3570004	 cmp       r7, #4
  0004c	bafffff1	 blt       |$L37527|

; 97   : 
; 98   :     // Let's be persistant here
; 99   :     while (retries++ < 4) 
; 100  :     {
; 101  :         if (!pfnEDbgSendFrame(pData, dwLength))

  00050	ea000000	 b         |$L37524|
  00054		 |$L37680|

; 102  :             return TRUE;

  00054	e3a08001	 mov       r8, #1
  00058		 |$L37524|
  00058	e1a00008	 mov       r0, r8

; 105  :     }
; 106  :     return(FALSE);
; 107  : }

  0005c	e8bd41f0	 ldmia     sp!, {r4 - r8, lr}
  00060	e12fff1e	 bx        lr
  00064		 |$L37690|
  00064	00000000	 DCD       |??_C@_0CL@HAGH@ERROR?3?5OEMEthSendFrame?5failure?0?5@|
  00068	00000000	 DCD       |pfnEDbgSendFrame|
  0006c		 |$M37687|

			 ENDP  ; |OEMEthSendFrame|

	EXPORT	|OEMEthHardwareInit|
	EXPORT	|??_C@_06GGLE@EP931x?$AA@| [ DATA ]	; `string'
	EXPORT	|??_C@_06DDP@NE2000?$AA@| [ DATA ]	; `string'
	EXPORT	|??_C@_06EBAD@CS8950?$AA@| [ DATA ]	; `string'
	EXPORT	|??_C@_0DB@LMBN@ERROR?3?5Failed?5to?5Initialize?5CS89@| [ DATA ] ; `string'
	EXPORT	|??_C@_0CG@GFND@ERROR?3?5Unable?5to?5find?5network?5ca@| [ DATA ] ; `string'
	EXPORT	|??_C@_0CC@JFEM@Card?5Type?5?$DN?5?$CFs?0?5Address?5?$DN?50x?$CFx?4?$AN@| [ DATA ] ; `string'
	EXPORT	|??_C@_0CD@IFFA@ERROR?3?5Failed?5to?5initialize?5NIC?4@| [ DATA ] ; `string'
	IMPORT	|strncpy|
	IMPORT	|NE2000Init|
	IMPORT	|NE2000GetFrame|
	IMPORT	|NE2000SendFrame|
	IMPORT	|CS8950Init|
	IMPORT	|CS8950GetFrame|
	IMPORT	|CS8950SendFrame|
	IMPORT	|CS8950WriteEEPROM|
	IMPORT	|CS8950DMAInit|
	IMPORT	|OEMNE2000Detect|

  00000			 AREA	 |.text| { |OEMEthHardwareInit| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$OEMEthHardwareInit|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMEthHardwareInit| } ; comdat associative
|$T37700| DCD	|OEMEthHardwareInit|
	DCD	0x40006302

  00000			 AREA	 |.rdata| { |??_C@_06GGLE@EP931x?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_06GGLE@EP931x?$AA@| DCB "EP931x", 0x0		; `string'

  00000			 AREA	 |.rdata| { |??_C@_0CG@GFND@ERROR?3?5Unable?5to?5find?5network?5ca@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CG@GFND@ERROR?3?5Unable?5to?5find?5network?5ca@| DCB "ERROR: Unab"
	DCB	"le to find network card.", 0xd, 0xa, 0x0 ; `string'

  00000			 AREA	 |.rdata| { |??_C@_06EBAD@CS8950?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_06EBAD@CS8950?$AA@| DCB "CS8950", 0x0		; `string'

  00000			 AREA	 |.rdata| { |??_C@_0DB@LMBN@ERROR?3?5Failed?5to?5Initialize?5CS89@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DB@LMBN@ERROR?3?5Failed?5to?5Initialize?5CS89@| DCB "ERROR: Faile"
	DCB	"d to Initialize CS8950 DMA buffer.", 0xd, 0xa, 0x0 ; `string'

  00000			 AREA	 |.rdata| { |??_C@_06DDP@NE2000?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_06DDP@NE2000?$AA@| DCB "NE2000", 0x0		; `string'

  00000			 AREA	 |.rdata| { |??_C@_0CC@JFEM@Card?5Type?5?$DN?5?$CFs?0?5Address?5?$DN?50x?$CFx?4?$AN@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CC@JFEM@Card?5Type?5?$DN?5?$CFs?0?5Address?5?$DN?50x?$CFx?4?$AN@| DCB "C"
	DCB	"ard Type = %s, Address = 0x%x.", 0xd, 0xa, 0x0 ; `string'

  00000			 AREA	 |.rdata| { |??_C@_0CD@IFFA@ERROR?3?5Failed?5to?5initialize?5NIC?4@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CD@IFFA@ERROR?3?5Failed?5to?5initialize?5NIC?4@| DCB "ERROR: Fail"
	DCB	"ed to initialize NIC.", 0xd, 0xa, 0x0	; `string'
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |OEMEthHardwareInit| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |OEMEthHardwareInit| PROC

; 115  : {

  00000	e92d41f0	 stmdb     sp!, {r4 - r8, lr}
  00004	e24dd010	 sub       sp, sp, #0x10
  00008		 |$M37698|

; 116  :     char        szPlatformString[EDBG_MAX_DEV_NAMELEN];
; 117  :     USHORT      usCS8950MacAddress[3]   = EBOOT_CS8950_MAC_ADDRESS;
; 118  :     ULONG *     pulEthernetBase         = 0;
; 119  :     char *      pszEthernetCardType;
; 120  :     BOOL        bTemp;
; 121  : 
; 122  :     //
; 123  :     // Form platform name string...
; 124  :     //
; 125  :     strncpy(szPlatformString, "EP931x", EDBG_MAX_DEV_NAMELEN);

  00008	e59f1178	 ldr       r1, [pc, #0x178]
  0000c	e3a02010	 mov       r2, #0x10
  00010	e28d0000	 add       r0, sp, #0
  00014	eb000000	 bl        strncpy

; 126  :     //
; 127  :     // Put ethernet checking here.
; 128  :     //
; 129  : 
; 130  :     if(OEMNE2000Detect())

  00018	eb000000	 bl        OEMNE2000Detect
  0001c	e3500000	 cmp       r0, #0

; 131  :     {
; 132  :         pDriverGlobals->eth.EdbgHardwareType = EDBG_ADAPTER_NE2000;

  00020	e3a00b22	 mov       r0, #0x22, 22
  00024	e3800060	 orr       r0, r0, #0x60
  00028	e3a08001	 mov       r8, #1

; 133  :     }
; 134  :     else
; 135  :     {
; 136  :         pDriverGlobals->eth.EdbgHardwareType = EDBG_ADAPTER_CS8950;

  0002c	03a01012	 moveq     r1, #0x12
  00030	15808000	 strne     r8, [r0]
  00034	05801000	 streq     r1, [r0]

; 137  :     }
; 138  : 
; 139  : 
; 140  :     //
; 141  :     // Check to see if a NE2000 card is plugged into the system.
; 142  :     //
; 143  :     //if(OEMNE2000Detect())
; 144  :     //{
; 145  :     //    pDriverGlobals->eth.EdbgHardwareType = EDBG_ADAPTER_NE2000;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -