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

📄 cs8950.cod

📁 EP9315的BSP包(WINCE下的BSP,内有各种驱动的详细的代码)
💻 COD
📖 第 1 页 / 共 5 页
字号:
|$T14781| DCD	|CS8950SendFrame|
	DCD	0x40002d04
; Function compile flags: /Ods

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

  00000		 |CS8950SendFrame| PROC

; 365  : {

  00000	e1a0c00d	 mov       r12, sp
  00004	e92d0003	 stmdb     sp!, {r0, r1}
  00008	e92d5000	 stmdb     sp!, {r12, lr}
  0000c	e24dd010	 sub       sp, sp, #0x10
  00010		 |$M14779|

; 366  :     int status;
; 367  :     PCD  pCD;
; 368  :      
; 369  :     pCD = (PCD)pChip->pData;

  00010	e59f0098	 ldr       r0, [pc, #0x98]
  00014	e5901000	 ldr       r1, [r0]
  00018	e591200c	 ldr       r2, [r1, #0xC]
  0001c	e58d2000	 str       r2, [sp]

; 370  : 
; 371  :     /* Verify that the total length is not too big */
; 372  : /*    if ( dwLength > 1514 )
; 373  :     {
; 374  :        //VpsSendError( pChip, TX_ERR_TOO_BIG );
; 375  :        EdbgOutputDebugString("CS8950SendFrame: Frame to big!!!!\r\n");
; 376  :        return FALSE; 
; 377  :     }
; 378  : */
; 379  :     
; 380  : #if 0    
; 381  :     if (pCD->TxQueueDepth == TXBUFFCOUNT) {
; 382  :     
; 383  :          status=ProcessTxStatusQueue( pChip );
; 384  : 
; 385  :          while (pCD->pTxStatNext->TxStat & TxStat_TxFP) {
; 386  :              if ( pCD->TxQueueDepth > 0 ) {
; 387  :                ProcessTxStatusQueue( pChip );
; 388  :              } else {
; 389  :                EdbgOutputDebugString(
; 390  :                    "CS8950SendFrame() Error: TxQueueDepth==0 but Tx status in Q\n");
; 391  :                break;
; 392  :              }
; 393  :          }
; 394  :     }
; 395  : 
; 396  :     VchipSend(pChip,  (WORD)dwLength, pbData);
; 397  :     Global_TxTotal++;
; 398  : 
; 399  : 
; 400  : 
; 401  :     return TRUE;
; 402  : #endif
; 403  : //#if 0    
; 404  :     //
; 405  :     // Wait for the TxInProcess the previous frame has been transmitted.
; 406  :     //
; 407  :     if ( Global_TxInProcess == TRUE) 

  00020	e59f0084	 ldr       r0, [pc, #0x84]
  00024	e5901000	 ldr       r1, [r0]
  00028	e3510001	 cmp       r1, #1
  0002c	1a000008	 bne       |$L14043|

; 408  :     {
; 409  :         status=ProcessTxStatusQueue( pChip );

  00030	e59f0078	 ldr       r0, [pc, #0x78]
  00034	e5900000	 ldr       r0, [r0]
  00038	eb000000	 bl        ProcessTxStatusQueue
  0003c	e58d000c	 str       r0, [sp, #0xC]
  00040	e59d100c	 ldr       r1, [sp, #0xC]
  00044	e58d1004	 str       r1, [sp, #4]

; 410  :         Global_TxInProcess=FALSE;

  00048	e59f005c	 ldr       r0, [pc, #0x5C]
  0004c	e3a01000	 mov       r1, #0
  00050	e5801000	 str       r1, [r0]
  00054		 |$L14043|

; 411  :     }
; 412  : 
; 413  :     VchipSend(pChip,  (WORD)dwLength, pbData);

  00054	e59d2018	 ldr       r2, [sp, #0x18]
  00058	e59d001c	 ldr       r0, [sp, #0x1C]
  0005c	e1a01800	 mov       r1, r0, lsl #16
  00060	e1a01821	 mov       r1, r1, lsr #16
  00064	e59f0044	 ldr       r0, [pc, #0x44]
  00068	e5900000	 ldr       r0, [r0]
  0006c	eb000000	 bl        VchipSend

; 414  :     Global_TxInProcess=TRUE;

  00070	e59f3034	 ldr       r3, [pc, #0x34]
  00074	e3a00001	 mov       r0, #1
  00078	e5830000	 str       r0, [r3]

; 415  :     Global_TxTotal++;

  0007c	e59f1024	 ldr       r1, [pc, #0x24]
  00080	e5910000	 ldr       r0, [r1]
  00084	e2802001	 add       r2, r0, #1
  00088	e59f1018	 ldr       r1, [pc, #0x18]
  0008c	e5812000	 str       r2, [r1]

; 416  : 
; 417  :     return FALSE;

  00090	e3a00000	 mov       r0, #0
  00094	e1cd00b8	 strh      r0, [sp, #8]
  00098	e1dd00b8	 ldrh      r0, [sp, #8]

; 418  : //#endif // 0    
; 419  : }

  0009c	e28dd010	 add       sp, sp, #0x10
  000a0	e89d6000	 ldmia     sp, {sp, lr}
  000a4	e12fff1e	 bx        lr
  000a8		 |$L14783|
  000a8	00000000	 DCD       |Global_TxTotal|
  000ac	00000000	 DCD       |Global_TxInProcess|
  000b0	00000000	 DCD       |pChip|
  000b4		 |$M14780|

			 ENDP  ; |CS8950SendFrame|

	EXPORT	|CS8950GetFrame|
	EXPORT	|??_C@_0CB@HOMC@?6?5CS8950GetFrame?$CI?$CJ?3?5Length?5?$DN?50?$AN?6@| [ DATA ] ; `string'
	IMPORT	|memcpy|

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

  00000			 AREA	 |.pdata$$CS8950GetFrame|, PDATA, SELECTION=5, ASSOC=|.text| { |CS8950GetFrame| } ; comdat associative
|$T14790| DCD	|CS8950GetFrame|
	DCD	0x4000d504

  00000			 AREA	 |.rdata| { |??_C@_0CB@HOMC@?6?5CS8950GetFrame?$CI?$CJ?3?5Length?5?$DN?50?$AN?6@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CB@HOMC@?6?5CS8950GetFrame?$CI?$CJ?3?5Length?5?$DN?50?$AN?6@| DCB 0xa
	DCB	" CS8950GetFrame(): Length = 0", 0xd, 0xa, 0x0 ; `string'
; Function compile flags: /Ods

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

  00000		 |CS8950GetFrame| PROC

; 434  : {

  00000	e1a0c00d	 mov       r12, sp
  00004	e92d0003	 stmdb     sp!, {r0, r1}
  00008	e92d5000	 stmdb     sp!, {r12, lr}
  0000c	e24dd020	 sub       sp, sp, #0x20
  00010		 |$M14788|

; 435  :     PCD pCD;
; 436  :     volatile DWORD Status; 
; 437  :     // volatile DWORD BufIndx;
; 438  :     WORD  Errors;
; 439  :     WORD  Index;
; 440  :     DWORD RxDecDW1,RxDecDW2; 
; 441  :     DWORD *pRxDecDW; 
; 442  :     static unsigned char tempFrame[1524];
; 443  :     pCD    = (PCD)pChip->pData;

  00010	e59f0338	 ldr       r0, [pc, #0x338]
  00014	e5901000	 ldr       r1, [r0]
  00018	e591200c	 ldr       r2, [r1, #0xC]
  0001c	e58d2014	 str       r2, [sp, #0x14]

; 444  : 
; 445  :     // ULONG ulAvaliableBuffers; 
; 446  :     //ulAvaliableBuffers = AvaliableRecieveBuffers();
; 447  :     //                         
; 448  :     //if(ulAvaliableBuffers < 16)
; 449  :     //{
; 450  :     //    EdbgOutputDebugString("Avaliable = %d\r\n", ulAvaliableBuffers);
; 451  :     //}
; 452  : 
; 453  : 
; 454  :     //
; 455  :     // The documentation says that if there is no frame in the frame buffer then
; 456  :     // return.
; 457  :     //
; 458  :     Status=pCD->pRxStatNext->RxStat;

  00020	e59d0014	 ldr       r0, [sp, #0x14]
  00024	e5901014	 ldr       r1, [r0, #0x14]
  00028	e5d12003	 ldrb      r2, [r1, #3]
  0002c	e1a00402	 mov       r0, r2, lsl #8
  00030	e5d13002	 ldrb      r3, [r1, #2]
  00034	e1832000	 orr       r2, r3, r0
  00038	e1a00402	 mov       r0, r2, lsl #8
  0003c	e5d13001	 ldrb      r3, [r1, #1]
  00040	e1832000	 orr       r2, r3, r0
  00044	e1a00402	 mov       r0, r2, lsl #8
  00048	e5d13000	 ldrb      r3, [r1]
  0004c	e1832000	 orr       r2, r3, r0
  00050	e58d2010	 str       r2, [sp, #0x10]

; 459  :     if (!(Status & RxStat_RxFP))  

  00054	e59d0010	 ldr       r0, [sp, #0x10]
  00058	e3100102	 tst       r0, #2, 2
  0005c	1a000006	 bne       |$L14060|

; 460  :     {
; 461  :         Status = ReadDWord(OpReg_IntStsC);

  00060	e59f02e4	 ldr       r0, [pc, #0x2E4]
  00064	e5901000	 ldr       r1, [r0]
  00068	e591202c	 ldr       r2, [r1, #0x2C]
  0006c	e58d2010	 str       r2, [sp, #0x10]

; 462  :         return FALSE;

  00070	e3a00000	 mov       r0, #0
  00074	e1cd01bc	 strh      r0, [sp, #0x1C]
  00078	ea0000ad	 b         |$L14049|
  0007c		 |$L14060|

; 463  :     } 
; 464  : 
; 465  :     //BufIndx=pCD->pRxStatNext->BufIndx;
; 466  :     //if (!(BufIndx & RxStat_RxFP))  
; 467  :     //{
; 468  :         //Status = ReadDWord(OpReg_IntStsC);
; 469  :     //    return FALSE;
; 470  :     //} 
; 471  :     
; 472  : 
; 473  :     /* Get the total length of the frame */
; 474  :     *pwLength = pCD->pRxStatNext->FrameLength;

  0007c	e59d0014	 ldr       r0, [sp, #0x14]
  00080	e5901014	 ldr       r1, [r0, #0x14]
  00084	e2812004	 add       r2, r1, #4
  00088	e5d20001	 ldrb      r0, [r2, #1]
  0008c	e1a01400	 mov       r1, r0, lsl #8
  00090	e5d23000	 ldrb      r3, [r2]
  00094	e1830001	 orr       r0, r3, r1
  00098	e59d202c	 ldr       r2, [sp, #0x2C]
  0009c	e1c200b0	 strh      r0, [r2]

; 475  : 
; 476  :       
; 477  :     /* If the received frame has errors */
; 478  :     if ( !(Status & RxStat_RxWE) )

  000a0	e59d1010	 ldr       r1, [sp, #0x10]
  000a4	e3110101	 tst       r1, #1, 2
  000a8	1a00000c	 bne       |$L14062|

; 479  :     {
; 480  :        Errors = (WORD)((Status & RxStat_Error_Mask) >> 16);

  000ac	e59d0010	 ldr       r0, [sp, #0x10]
  000b0	e200183f	 and       r1, r0, #0x3F, 16
  000b4	e1a02821	 mov       r2, r1, lsr #16
  000b8	e1a00802	 mov       r0, r2, lsl #16
  000bc	e1a01820	 mov       r1, r0, lsr #16
  000c0	e1cd11b8	 strh      r1, [sp, #0x18]

; 481  :        VpsRecvError( pChip, Errors );

  000c4	e1dd11b8	 ldrh      r1, [sp, #0x18]
  000c8	e59f0280	 ldr       r0, [pc, #0x280]
  000cc	e5900000	 ldr       r0, [r0]
  000d0	eb000000	 bl        VpsRecvError

; 482  :        *pwLength=0; // 0 means a frame with error. */

  000d4	e59d302c	 ldr       r3, [sp, #0x2C]
  000d8	e3a00000	 mov       r0, #0
  000dc	e1c300b0	 strh      r0, [r3]
  000e0		 |$L14062|

; 483  :     }
; 484  : 
; 485  :     /* Get the index of the buffer that contains the frame data */
; 486  :     Index = (WORD)(pCD->pRxStatNext->BufIndx & RxStat_BufIndx_Mask);

  000e0	e59d0014	 ldr       r0, [sp, #0x14]
  000e4	e5901014	 ldr       r1, [r0, #0x14]
  000e8	e2812006	 add       r2, r1, #6
  000ec	e5d20001	 ldrb      r0, [r2, #1]
  000f0	e1a01400	 mov       r1, r0, lsl #8
  000f4	e5d23000	 ldrb      r3, [r2]
  000f8	e1830001	 orr       r0, r3, r1
  000fc	e1a02800	 mov       r2, r0, lsl #16
  00100	e1a01822	 mov       r1, r2, lsr #16
  00104	e3a00c7f	 mov       r0, #0x7F, 24
  00108	e38020ff	 orr       r2, r0, #0xFF
  0010c	e0013002	 and       r3, r1, r2
  00110	e1a00803	 mov       r0, r3, lsl #16
  00114	e1a01820	 mov       r1, r0, lsr #16
  00118	e1cd10b8	 strh      r1, [sp, #8]

; 487  :     memcpy(pbData, pCD->RxBuff[Index].pBuff, *pwLength);

  0011c	e59d002c	 ldr       r0, [sp, #0x2C]
  00120	e1d010b0	 ldrh      r1, [r0]
  00124	e1a02801	 mov       r2, r1, lsl #16
  00128	e1a02822	 mov       r2, r2, lsr #16
  0012c	e59d0014	 ldr       r0, [sp, #0x14]
  00130	e280103c	 add       r1, r0, #0x3C
  00134	e1dd30b8	 ldrh      r3, [sp, #8]
  00138	e1a00803	 mov       r0, r3, lsl #16
  0013c	e1a03820	 mov       r3, r0, lsr #16
  00140	e3a00008	 mov       r0, #8
  00144	e0000093	 mul       r0, r3, r0
  00148	e0813000	 add       r3, r1, r0
  0014c	e5931000	 ldr       r1, [r3]
  00150	e59d0028	 ldr       r0, [sp, #0x28]
  00154	eb000000	 bl        memcpy

; 488  : 
; 489  : 
; 490  :     /* Mark the buffer as now available */
; 491  :     pRxDecDW= (DWORD *)(pCD->pRxDesc+Index);

  00158	e1dd30b8	 ldrh      r3, [sp, #8]
  0015c	e1a00803	 mov       r0, r3, lsl #16
  00160	e1a01820	 mov       r1, r0, lsr #16
  00164	e3a02008	 mov       r2, #8
  00168	e0000291	 mul       r0, r1, r2
  0016c	e59d2014	 ldr       r2, [sp, #0x14]
  00170	e5921000	 ldr       r1, [r2]
  00174	e0813000	 add       r3, r1, r0
  00178	e58d300c	 str       r3, [sp, #0xC]

; 492  :     RxDecDW1=*pRxDecDW++;

  0017c	e59d000c	 ldr       r0, [sp, #0xC]
  00180	e5901000	 ldr       r1, [r0]
  00184	e58d1000	 str       r1, [sp]
  00188	e59d000c	 ldr       r0, [sp, #0xC]
  0018c	e2801004	 add       r1, r0, #4
  00190	e58d100c	 str       r1, [sp, #0xC]

; 493  :     RxDecDW2=*pRxDecDW;

  00194	e59d000c	 ldr       r0, [sp, #0xC]
  00198	e5901000	 ldr       r1, [r0]
  0019c	e58d1004	 str       r1, [sp, #4]

; 494  :     (pCD->pRxDesc+Index)->BufLength = RXBUFFSIZE;

  001a0	e1dd00b8	 ldrh      r0, [sp, #8]
  001a4	e1a01800	 mov       r1, r0, lsl #16
  001a8	e1a02821	 mov       r2, r1, lsr #16
  001ac	e3a00008	 mov       r0, #8
  001b0	e0010092	 mul       r1, r2, r0
  001b4	e59d0014	 ldr       r0, [sp, #0x14]
  001b8	e5902000	 ldr       r2, [r0]
  001bc	e0823001	 add       r3, r2, r1
  001c0	e2830004	 add       r0, r3, #4
  001c4	e3a01e5f	 mov       r1, #0x5F, 28
  001c8	e5c01000	 strb      r1, [r0]
  001cc	e1a02421	 mov       r2, r1, lsr #8
  001d0	e5c02001	 strb      r2, [r0, #1]

; 495  : 
; 496  :     pCD->pRxStatNext->RxStat  = 0x0;

  001d4	e59d1014	 ldr       r1, [sp, #0x14]
  001d8	e5910014	 ldr       r0, [r1, #0x14]
  001dc	e3a02000	 mov       r2, #0
  001e0	e5c02000	 strb      r2, [r0]
  001e4	e1a01422	 mov       r1, r2, lsr #8
  001e8	e1a03001	 mov       r3, r1
  001ec	e5c03001	 strb      r3, [r0, #1]
  001f0	e1a02421	 mov       r2, r1, lsr #8
  001f4	e1a03002	 mov       r3, r2
  001f8	e5c03002	 strb      r3, [r0, #2]
  001fc	e1a01422	 mov       r1, r2, lsr #8
  00200	e5c01003	 strb      r1, [r0, #3]

; 497  :     pCD->pRxStatNext->BufIndx = 0x0;

  00204	e59d2014	 ldr       r2, [sp, #0x14]
  00208	e5920014	 ldr       r0, [r2, #0x14]
  0020c	e2801006	 add       r1, r0, #6
  00210	e3a02000	 mov       r2, #0
  00214	e5c12000	 strb      r2, [r1]
  00218	e1a00422	 mov       r0, r2, lsr #8
  0021c	e5c10001	 strb      r0, [r1, #1]

; 498  :     pCD->pRxStatNext->FrameLength = 0x0;

  00220	e59d2014	 ldr       r2, [sp, #0x14]
  00224	e5920014	 ldr       r0, [r2, #0x14]
  00228	e2801004	 add       r1, r0, #4
  0022c	e3a02000	 mov       r2, #0
  00230	e5c12000	 strb      r2, [r1]
  00234	e1a00422	 mov       r0, r2, lsr #8
  00238	e5c10001	 strb      r0, [r1, #1]

; 499  : 
; 500  :     /* Increment to the next receive status entry (with wrap-around) */
; 501  :     pCD->pRxStatNext++;

  0023c	e59d2014	 ldr       r2, [sp, #0x14]
  00240	e5920014	 ldr       r0, [r2, #0x14]
  00244	e2801008	 add       r1, r0, #8
  00248	e59d2014	 ldr       r2, [sp, #0x14]
  0024c	e5821014	 str       r1, [r2, #0x14]

⌨️ 快捷键说明

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