Subversion Repositories Kolibri OS

Rev

Rev 3699 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3699 Rev 3700
Line 1383... Line 1383...
1383
.interval       dd      ?
1383
.interval       dd      ?
1384
end virtual
1384
end virtual
1385
; 1. Initialize ErrorTD to zero.
1385
; 1. Initialize ErrorTD to zero.
1386
        and     [edi+uhci_pipe.ErrorTD-sizeof.uhci_pipe], 0
1386
        and     [edi+uhci_pipe.ErrorTD-sizeof.uhci_pipe], 0
1387
; 2. Initialize HeadTD to the physical address of the first TD.
1387
; 2. Initialize HeadTD to the physical address of the first TD.
1388
        push    eax     ; store pointer to the first TD for step ?
1388
        push    eax     ; store pointer to the first TD for step 4
1389
        sub     eax, sizeof.uhci_gtd
1389
        sub     eax, sizeof.uhci_gtd
1390
        call    get_phys_addr
1390
        call    get_phys_addr
1391
        mov     [edi+uhci_pipe.HeadTD-sizeof.uhci_pipe], eax
1391
        mov     [edi+uhci_pipe.HeadTD-sizeof.uhci_pipe], eax
1392
; 3. Initialize Token field:
1392
; 3. Initialize Token field:
1393
; take DeviceAddress and LowSpeedDevice from the parent pipe,
1393
; take DeviceAddress and LowSpeedDevice from the parent pipe,
Line 1414... Line 1414...
1414
@@:
1414
@@:
1415
        mov     [edi+uhci_pipe.Token-sizeof.uhci_pipe], eax
1415
        mov     [edi+uhci_pipe.Token-sizeof.uhci_pipe], eax
1416
; 4. Initialize the first TD:
1416
; 4. Initialize the first TD:
1417
; copy Token from uhci_pipe.Token zeroing reserved bit 20,
1417
; copy Token from uhci_pipe.Token zeroing reserved bit 20,
1418
; set ControlStatus for future transfers, bit make it inactive,
1418
; set ControlStatus for future transfers, bit make it inactive,
1419
; set bit 0 in NextTD = "no next TD".
1419
; set bit 0 in NextTD = "no next TD",
-
 
1420
; zero OrigBufferInfo.
1420
        pop     edx     ; restore pointer saved in step 2
1421
        pop     edx     ; restore pointer saved in step 2
1421
        mov     [edx+uhci_gtd.Token-sizeof.uhci_gtd], eax
1422
        mov     [edx+uhci_gtd.Token-sizeof.uhci_gtd], eax
1422
        and     byte [edx+uhci_gtd.Token+2-sizeof.uhci_gtd], not (1 shl (20-16))
1423
        and     byte [edx+uhci_gtd.Token+2-sizeof.uhci_gtd], not (1 shl (20-16))
1423
        and     eax, 1 shl 20
1424
        and     eax, 1 shl 20
1424
        shl     eax, 6
1425
        shl     eax, 6
1425
        or      eax, UHCI_INVALID_LENGTH + (3 shl 27)
1426
        or      eax, UHCI_INVALID_LENGTH + (3 shl 27)
1426
                ; not processed, inactive, allow 3 errors
1427
                ; not processed, inactive, allow 3 errors
-
 
1428
        and     [edx+uhci_gtd.OrigBufferInfo-sizeof.uhci_gtd], 0
1427
        mov     [edx+uhci_gtd.ControlStatus-sizeof.uhci_gtd], eax
1429
        mov     [edx+uhci_gtd.ControlStatus-sizeof.uhci_gtd], eax
1428
        mov     [edx+uhci_gtd.NextTD-sizeof.uhci_gtd], 1
1430
        mov     [edx+uhci_gtd.NextTD-sizeof.uhci_gtd], 1
1429
; 5. Select the corresponding list and insert to the list.
1431
; 5. Select the corresponding list and insert to the list.
1430
; 5a. Use Control list for control pipes, Bulk list for bulk pipes.
1432
; 5a. Use Control list for control pipes, Bulk list for bulk pipes.
1431
        lea     edx, [esi+uhci_controller.ControlED.SoftwarePart-sizeof.uhci_controller]
1433
        lea     edx, [esi+uhci_controller.ControlED.SoftwarePart-sizeof.uhci_controller]