Rev 3520 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3520 | Rev 3598 | ||
---|---|---|---|
Line 349... | Line 349... | ||
349 | .err assertion failed |
349 | .err assertion failed |
350 | end if |
350 | end if |
351 | lea esi, [eax+ohci_controller.IntEDs+32*sizeof.ohci_static_ep] |
351 | lea esi, [eax+ohci_controller.IntEDs+32*sizeof.ohci_static_ep] |
352 | call get_pg_addr |
352 | call get_pg_addr |
353 | add eax, ohci_controller.IntEDs |
353 | add eax, ohci_controller.IntEDs |
354 | push 32 |
- | |
355 | pop ecx |
354 | movi ecx, 32 |
356 | mov edx, ecx |
355 | mov edx, ecx |
357 | @@: |
356 | @@: |
358 | stosd |
357 | stosd |
359 | add eax, sizeof.ohci_static_ep |
358 | add eax, sizeof.ohci_static_ep |
360 | loop @b |
359 | loop @b |
Line 427... | Line 426... | ||
427 | ; 5b. State is not operational, reset is needed. |
426 | ; 5b. State is not operational, reset is needed. |
428 | .reset: |
427 | .reset: |
429 | ; 5c. Save FmInterval register. |
428 | ; 5c. Save FmInterval register. |
430 | pushd [edi+OhciFmIntervalReg] |
429 | pushd [edi+OhciFmIntervalReg] |
431 | ; 5d. Issue software reset and wait up to 10ms, checking status every 1 ms. |
430 | ; 5d. Issue software reset and wait up to 10ms, checking status every 1 ms. |
432 | push 1 |
- | |
433 | pop ecx |
431 | movi ecx, 1 |
434 | push 10 |
- | |
435 | pop edx |
432 | movi edx, 10 |
436 | mov [edi+OhciCommandStatusReg], ecx |
433 | mov [edi+OhciCommandStatusReg], ecx |
437 | @@: |
434 | @@: |
438 | mov esi, ecx |
435 | mov esi, ecx |
439 | call delay_ms |
436 | call delay_ms |
440 | test [edi+OhciCommandStatusReg], ecx |
437 | test [edi+OhciCommandStatusReg], ecx |
Line 631... | Line 628... | ||
631 | jz .has_ownership |
628 | jz .has_ownership |
632 | ; 4b. Send "take ownership" command to the BIOS. |
629 | ; 4b. Send "take ownership" command to the BIOS. |
633 | ; (This should generate SMI, BIOS should release its ownership in SMI handler.) |
630 | ; (This should generate SMI, BIOS should release its ownership in SMI handler.) |
634 | mov dword [eax+OhciCommandStatusReg], 8 |
631 | mov dword [eax+OhciCommandStatusReg], 8 |
635 | ; 4c. Wait for result no more than 50 ms, checking for status every 1 ms. |
632 | ; 4c. Wait for result no more than 50 ms, checking for status every 1 ms. |
636 | push 50 |
- | |
637 | pop ecx |
633 | movi ecx, 50 |
638 | @@: |
634 | @@: |
639 | test dword [eax+OhciControlReg], edx |
635 | test dword [eax+OhciControlReg], edx |
640 | jz .has_ownership |
636 | jz .has_ownership |
641 | push esi |
637 | push esi |
642 | push 1 |
- | |
643 | pop esi |
638 | movi esi, 1 |
644 | call delay_ms |
639 | call delay_ms |
645 | pop esi |
640 | pop esi |
646 | loop @b |
641 | loop @b |
647 | dbgstr 'warning: taking OHCI ownership from BIOS timeout' |
642 | dbgstr 'warning: taking OHCI ownership from BIOS timeout' |
648 | .has_ownership: |
643 | .has_ownership: |
Line 982... | Line 977... | ||
982 | ; based on the current bandwidth distribution and the requested bandwidth. |
977 | ; based on the current bandwidth distribution and the requested bandwidth. |
983 | ; This could fail if the requested bandwidth is not available; |
978 | ; This could fail if the requested bandwidth is not available; |
984 | ; if so, return an error. |
979 | ; if so, return an error. |
985 | lea edx, [esi + ohci_controller.IntEDs - sizeof.ohci_controller] |
980 | lea edx, [esi + ohci_controller.IntEDs - sizeof.ohci_controller] |
986 | lea eax, [esi + ohci_controller.IntEDs + 32*sizeof.ohci_static_ep - sizeof.ohci_controller] |
981 | lea eax, [esi + ohci_controller.IntEDs + 32*sizeof.ohci_static_ep - sizeof.ohci_controller] |
987 | push 64 |
- | |
988 | pop ecx |
982 | movi ecx, 64 |
989 | call usb1_select_interrupt_list |
983 | call usb1_select_interrupt_list |
990 | test edx, edx |
984 | test edx, edx |
991 | jz .return0 |
985 | jz .return0 |
992 | ; 3c. Insert endpoint at edi to the head of list in edx. |
986 | ; 3c. Insert endpoint at edi to the head of list in edx. |
993 | ; Inserting to tail would work as well, |
987 | ; Inserting to tail would work as well, |