📄 smsndis.cod
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 13.10.4345
TTL E:\WM604\PLATFORM\SEUICBSP\SRC\DRIVERS\DMBDRV\SmsNdis\.\SmsNdis.c
CODE32
00000 AREA |.drectve|, DRECTVE
DCB "-defaultlib:coredll.lib "
DCB "-defaultlib:corelibc.lib "
EXPORT |dpCurSettings| [ DATA ]
00000 AREA |.data|, DATA
|RemoteMAC| DCB 0x0
DCB 0x1
DCB 0x1
DCB 0x3
DCB 0x4
DCB 0x40
% 2
|LocalMAC| DCB 0x0
DCB 0x4
DCB 0x76
DCB 0xd
DCB 0xad
DCB 0x7a
% 2
|dpCurSettings| DCB "S", 0x0, "i", 0x0, "a", 0x0, "n", 0x0, "o", 0x0, " ", 0x0
DCB "N", 0x0, "D", 0x0, "I", 0x0, "S", 0x0, 0x0, 0x0
% 42
DCB "E", 0x0, "r", 0x0, "r", 0x0, "o", 0x0, "r", 0x0, "s", 0x0
DCB 0x0, 0x0
% 50
DCB "W", 0x0, "a", 0x0, "r", 0x0, "n", 0x0, "i", 0x0, "n", 0x0
DCB "g", 0x0, "s", 0x0, 0x0, 0x0
% 46
DCB "I", 0x0, "n", 0x0, "i", 0x0, "t", 0x0, 0x0, 0x0
% 54
DCB "I", 0x0, "n", 0x0, "f", 0x0, "o", 0x0, 0x0, 0x0
% 54
DCB "U", 0x0, "n", 0x0, "d", 0x0, "e", 0x0, "f", 0x0, "i", 0x0
DCB "n", 0x0, "e", 0x0, "d", 0x0, 0x0, 0x0
% 44
DCB "U", 0x0, "n", 0x0, "d", 0x0, "e", 0x0, "f", 0x0, "i", 0x0
DCB "n", 0x0, "e", 0x0, "d", 0x0, 0x0, 0x0
% 44
DCB "U", 0x0, "n", 0x0, "d", 0x0, "e", 0x0, "f", 0x0, "i", 0x0
DCB "n", 0x0, "e", 0x0, "d", 0x0, 0x0, 0x0
% 44
DCB "T", 0x0, "e", 0x0, "m", 0x0, "p", 0x0, "o", 0x0, "r", 0x0
DCB "a", 0x0, "r", 0x0, "y", 0x0, 0x0, 0x0
% 44
DCB "U", 0x0, "n", 0x0, "d", 0x0, "e", 0x0, "f", 0x0, "i", 0x0
DCB "n", 0x0, "e", 0x0, "d", 0x0, 0x0, 0x0
% 44
DCB "U", 0x0, "n", 0x0, "d", 0x0, "e", 0x0, "f", 0x0, "i", 0x0
DCB "n", 0x0, "e", 0x0, "d", 0x0, 0x0, 0x0
% 44
DCB "U", 0x0, "n", 0x0, "d", 0x0, "e", 0x0, "f", 0x0, "i", 0x0
DCB "n", 0x0, "e", 0x0, "d", 0x0, 0x0, 0x0
% 44
DCB "U", 0x0, "n", 0x0, "d", 0x0, "e", 0x0, "f", 0x0, "i", 0x0
DCB "n", 0x0, "e", 0x0, "d", 0x0, 0x0, 0x0
% 44
DCB "U", 0x0, "n", 0x0, "d", 0x0, "e", 0x0, "f", 0x0, "i", 0x0
DCB "n", 0x0, "e", 0x0, "d", 0x0, 0x0, 0x0
% 44
DCB "U", 0x0, "n", 0x0, "d", 0x0, "e", 0x0, "f", 0x0, "i", 0x0
DCB "n", 0x0, "e", 0x0, "d", 0x0, 0x0, 0x0
% 44
DCB "U", 0x0, "n", 0x0, "d", 0x0, "e", 0x0, "f", 0x0, "i", 0x0
DCB "n", 0x0, "e", 0x0, "d", 0x0, 0x0, 0x0
% 44
DCB "U", 0x0, "n", 0x0, "d", 0x0, "e", 0x0, "f", 0x0, "i", 0x0
DCB "n", 0x0, "e", 0x0, "d", 0x0, 0x0, 0x0
% 44
DCD 0x3
EXPORT |DllMain|
; File e:\wm604\platform\seuicbsp\src\drivers\dmbdrv\smsndis\smsndis.c
00000 AREA |.text| { |DllMain| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$DllMain|, PDATA, SELECTION=5, ASSOC=|.text| { |DllMain| } ; comdat associative
|$T42309| DCD |$L42308|
DCD 0x40000200
; Function compile flags: /Ogsy
00000 AREA |.text| { |DllMain| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |DllMain| PROC
; 120 : {
00000 |$L42308|
00000 |$M42306|
; 121 : BOOL bRc = TRUE;
; 122 :
; 123 : UNREFERENCED_PARAMETER(hDllHandle);
; 124 : UNREFERENCED_PARAMETER(lpreserved);
; 125 :
; 126 : switch (dwReason)
; 127 : {
; 128 : case DLL_PROCESS_ATTACH:
; 129 : REGISTERZONES(hDllHandle);
; 130 : #ifdef LOG_TO_FILE
; 131 : hLogFile = CreateFile(LOG_FILE,
; 132 : GENERIC_WRITE,
; 133 : FILE_SHARE_READ | FILE_SHARE_WRITE,
; 134 : NULL,
; 135 : CREATE_ALWAYS,
; 136 : 0,
; 137 : NULL);
; 138 :
; 139 : if (hLogFile == INVALID_HANDLE_VALUE)
; 140 : return FALSE;
; 141 : InitializeCriticalSection(&g_CriticalSection);
; 142 : #endif
; 143 : DBGMSG(ZONE_INIT, (TEXT("SmsNdis: DLL_PROCESS_ATTACH\r\n")));
; 144 : break;
; 145 :
; 146 : case DLL_PROCESS_DETACH:
; 147 : DBGMSG(ZONE_INIT, (TEXT("SmsNdis: DLL_PROCESS_DETACH\r\n")));
; 148 : #ifdef LOG_TO_FILE
; 149 : if (hLogFile != INVALID_HANDLE_VALUE)
; 150 : {
; 151 : CloseHandle(hLogFile);
; 152 : }
; 153 : DeleteCriticalSection(&g_CriticalSection);
; 154 : #endif
; 155 : break;
; 156 :
; 157 : default:
; 158 : break;
; 159 : }
; 160 :
; 161 : return bRc;
00000 e3a00001 mov r0, #1
; 162 : }
00004 e12fff1e bx lr
00008 |$M42307|
ENDP ; |DllMain|
EXPORT |SmsNdis_HaltHandler|
IMPORT |NdisFreeMemory|
IMPORT |NdisTerminateWrapper|
IMPORT |CloseHandle|
00000 AREA |.text| { |SmsNdis_HaltHandler| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$SmsNdis_HaltHandler|, PDATA, SELECTION=5, ASSOC=|.text| { |SmsNdis_HaltHandler| } ; comdat associative
|$T42317| DCD |$L42316|
DCD 0x40001401
; Function compile flags: /Ogsy
00000 AREA |.text| { |SmsNdis_HaltHandler| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |SmsNdis_HaltHandler| PROC
; 251 : {
00000 |$L42316|
00000 e92d4010 stmdb sp!, {r4, lr}
00004 |$M42314|
00004 e1b04000 movs r4, r0
; 252 : PSMS_SMS_NDIS_ST pSmsNdis = (PSMS_SMS_NDIS_ST)MiniportAdapterContext;
; 253 :
; 254 : DBGMSG(ZONE_INFO, (TEXT("SmsNdis: +SmsNdis_HaltHandler\r\n")));
; 255 :
; 256 : if (pSmsNdis)
00008 0a00000e beq |$L41704|
; 257 : {
; 258 : if (pSmsNdis->hGenDrv)
0000c e5943008 ldr r3, [r4, #8]
00010 e3530000 cmp r3, #0
00014 0a000003 beq |$L41705|
; 259 : {
; 260 : CloseHandle(pSmsNdis->hGenDrv);
00018 e1a00003 mov r0, r3
0001c eb000000 bl CloseHandle
; 261 : pSmsNdis->hGenDrv = NULL;
00020 e3a03000 mov r3, #0
00024 e5843008 str r3, [r4, #8]
00028 |$L41705|
; 262 : }
; 263 :
; 264 : NdisTerminateWrapper(pSmsNdis->hWrapperConfigContext,NULL);
00028 e5940004 ldr r0, [r4, #4]
0002c e3a01000 mov r1, #0
00030 eb000000 bl NdisTerminateWrapper
; 265 :
; 266 : // freeing the SmsNdis device
; 267 : NdisFreeMemory(pSmsNdis,sizeof(SMS_SMS_NDIS_ST),0);
00034 e3a01e65 mov r1, #0x65, 28
00038 e3811004 orr r1, r1, #4
0003c e3a02000 mov r2, #0
00040 e1a00004 mov r0, r4
00044 eb000000 bl NdisFreeMemory
00048 |$L41704|
; 268 : }
; 269 :
; 270 : DBGMSG(ZONE_INFO, (TEXT("SmsNdis: -SmsNdis_HaltHandler\r\n")));
; 271 : }
00048 e8bd4010 ldmia sp!, {r4, lr}
0004c e12fff1e bx lr
00050 |$M42315|
ENDP ; |SmsNdis_HaltHandler|
EXPORT |SmsNdis_QueryInformationHandler|
EXPORT |??_C@_0BF@HDBOHGE@Siano?5NDIS?5Miniport?$AA?$AA@| [ DATA ] ; `string'
IMPORT |__security_cookie|
IMPORT |__security_check_cookie|
IMPORT |strlen|
IMPORT |memcpy|
00000 AREA |.text| { |SmsNdis_QueryInformationHandler| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$SmsNdis_QueryInformationHandler|, PDATA, SELECTION=5, ASSOC=|.text| { |SmsNdis_QueryInformationHandler| } ; comdat associative
|$T42353| DCD |$L42352|
DCD 0x4000e802
00000 AREA |.rdata| { |??_C@_0BF@HDBOHGE@Siano?5NDIS?5Miniport?$AA?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BF@HDBOHGE@Siano?5NDIS?5Miniport?$AA?$AA@| DCB "Siano NDIS Minipo"
DCB "rt", 0x0, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |SmsNdis_QueryInformationHandler| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |SmsNdis_QueryInformationHandler| PROC
; 293 : {
00000 |$L42352|
00000 e92d4ff0 stmdb sp!, {r4 - r11, lr}
00004 e24dd010 sub sp, sp, #0x10
00008 |$M42350|
00008 e1a08003 mov r8, r3
0000c e1a0a002 mov r10, r2
00010 e59fe384 ldr lr, [pc, #0x384]
00014 e59ee000 ldr lr, [lr]
00018 e58de00c str lr, [sp, #0xC]
; 294 : NDIS_STATUS ndisStatus;
; 295 : PSMS_SMS_NDIS_ST pSmsNdis;
; 296 : PVOID pReturnBuff;
; 297 : ULONG returnBuffLen;
; 298 : ULONG tmpULong;
; 299 : USHORT tmpUshort;
; 300 : NDIS_HARDWARE_STATUS hwStatus;
; 301 : NDIS_MEDIUM ndisMedium;
; 302 : const PCHAR strVendor = "Siano NDIS Miniport\0";
; 303 : const UCHAR EmuEthernetAddr[] = {0x00,0x04,0x76,0x0D,0xAD,0x7A};
; 304 :
; 305 : DBGMSG(ZONE_INFO, (TEXT("SmsNdis: +SmsNdis_QueryInformationHandler\r\n"),Oid));
; 306 :
; 307 : pSmsNdis = (PSMS_SMS_NDIS_ST)MiniportAdapterContext;
; 308 : *pBytesWritten = 0;
0001c e59d9034 ldr r9, [sp, #0x34]
; 309 : *pBytesNeeded = 0;
00020 e59d7038 ldr r7, [sp, #0x38]
00024 e3a0e000 mov lr, #0
00028 e589e000 str lr, [r9]
0002c e587e000 str lr, [r7]
; 310 : ndisStatus = NDIS_STATUS_SUCCESS;
; 311 : pReturnBuff = NULL;
; 312 : returnBuffLen = 0;
; 313 :
; 314 : #define CASE_OID(Oid) \
; 315 : case Oid: \
; 316 : DBGMSG(ZONE_INFO, (TEXT("SmsNdis: Query 0x%08X ") TEXT(#Oid) TEXT("\r\n"),Oid));
; 317 :
; 318 : #define CASE_OID_NOT_SUPPORTED(Oid) \
; 319 : case Oid: \
; 320 : DBGMSG(ZONE_WARNING, (TEXT("SmsNdis: Query 0x%08X ") TEXT(#Oid) TEXT(" not supported\r\n"),Oid)); \
; 321 : ndisStatus = NDIS_STATUS_NOT_SUPPORTED;
; 322 :
; 323 : switch(Oid)
00030 e59fe360 ldr lr, [pc, #0x360]
00034 e3a04076 mov r4, #0x76
00038 e3a03000 mov r3, #0
0003c e3a02004 mov r2, #4
00040 e3a0500d mov r5, #0xD
00044 e3a060ad mov r6, #0xAD
00048 e3a0b07a mov r11, #0x7A
0004c e5cd4006 strb r4, [sp, #6]
00050 e151000e cmp r1, lr
00054 e5cd3004 strb r3, [sp, #4]
00058 e5cd2005 strb r2, [sp, #5]
0005c e5cd5007 strb r5, [sp, #7]
00060 e5cd6008 strb r6, [sp, #8]
00064 e5cdb009 strb r11, [sp, #9]
00068 e3a04000 mov r4, #0
0006c 8a000033 bhi |$L42321|
00070 0a000098 beq |$L41851|
00074 e59f3318 ldr r3, [pc, #0x318]
00078 e0412003 sub r2, r1, r3
0007c e3520015 cmp r2, #0x15
00080 8a000047 bhi |$L41940|
00084 e1a03082 mov r3, r2, lsl #1
00088 e083300f add r3, r3, pc
0008c e1d330b4 ldrh r3, [r3, #4]
00090 e08ff003 add pc, pc, r3
00094 |$L42347|
00094 |$L42346|
00094 0240 DCW 0x240
00096 0028 DCW 0x28
00098 0028 DCW 0x28
0009a 0028 DCW 0x28
0009c 003c DCW 0x3c
0009e 003c DCW 0x3c
000a0 0054 DCW 0x54
000a2 0028 DCW 0x28
000a4 003c DCW 0x3c
000a6 0028 DCW 0x28
000a8 003c DCW 0x3c
000aa 0240 DCW 0x240
000ac 0060 DCW 0x60
000ae 0088 DCW 0x88
000b0 0090 DCW 0x90
000b2 0074 DCW 0x74
000b4 003c DCW 0x3c
000b6 010c DCW 0x10c
000b8 0098 DCW 0x98
000ba 0028 DCW 0x28
000bc 00a0 DCW 0xa0
000be 0074 DCW 0x74
000c0 |$L41744|
; 324 : {
; 325 : CASE_OID(OID_GEN_HARDWARE_STATUS)
; 326 : hwStatus = NdisHardwareStatusReady;
000c0 e3a03000 mov r3, #0
000c4 |$L42343|
000c4 e58d3000 str r3, [sp]
; 327 : pReturnBuff = (PVOID)&hwStatus;
000c8 e28d6000 add r6, sp, #0
; 328 : returnBuffLen = sizeof(hwStatus);
000cc e3a05004 mov r5, #4
; 329 : break;
000d0 ea00008c b |$L41741|
000d4 |$L41753|
; 330 : CASE_OID(OID_GEN_MEDIA_SUPPORTED)
; 331 : ndisMedium = NdisMedium802_3;
; 332 : pReturnBuff = (PVOID)&ndisMedium;
; 333 : returnBuffLen = sizeof(ndisMedium);
; 334 : break;
; 335 : CASE_OID(OID_GEN_MEDIA_IN_USE)
; 336 : ndisMedium = NdisMedium802_3;
; 337 : pReturnBuff = (PVOID)&ndisMedium;
; 338 : returnBuffLen = sizeof(ndisMedium);
; 339 : break;
; 340 : CASE_OID(OID_GEN_MAXIMUM_LOOKAHEAD)
; 341 : tmpULong = MAX_IP_PACKET_LEN;
000d4 e3a03e5d mov r3, #0x5D, 28
000d8 e383300c orr r3, r3, #0xC
000dc |$L42344|
; 342 : pReturnBuff = (PVOID)&tmpULong;
000dc e28d6000 add r6, sp, #0
; 343 : returnBuffLen = sizeof(tmpULong);
000e0 e3a05004 mov r5, #4
000e4 e58d3000 str r3, [sp]
; 344 : break;
000e8 ea000086 b |$L41741|
000ec |$L41759|
; 345 : CASE_OID(OID_GEN_MAXIMUM_FRAME_SIZE)
; 346 : tmpULong = MAX_IP_PACKET_LEN;
; 347 : pReturnBuff = (PVOID)&tmpULong;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -