Rev 5036 | Rev 5038 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5036 | Rev 5037 | ||
---|---|---|---|
Line 20... | Line 20... | ||
20 | __DEBUG_LEVEL__ = 1 |
20 | __DEBUG_LEVEL__ = 1 |
Line 21... | Line 21... | ||
21 | 21 | ||
22 | node equ ftdi_context |
22 | node equ ftdi_context |
Line 23... | Line 23... | ||
23 | node.next equ ftdi_context.next_context |
23 | node.next equ ftdi_context.next_context |
24 | 24 | ||
25 | include '../../proc32.inc' |
25 | include '../proc32.inc' |
26 | include '../../imports.inc' |
26 | include '../imports.inc' |
Line 27... | Line 27... | ||
27 | include '../../fdo.inc' |
27 | include '../fdo.inc' |
28 | include '../../struct.inc' |
28 | include '../struct.inc' |
Line 29... | Line 29... | ||
29 | 29 | ||
Line 609... | Line 609... | ||
609 | mov esi, nomemory_msg |
609 | mov esi, nomemory_msg |
610 | call SysMsgBoardStr |
610 | call SysMsgBoardStr |
611 | jmp .eventdestroy |
611 | jmp .eventdestroy |
612 | @@: |
612 | @@: |
613 | mov edi, eax |
613 | mov edi, eax |
- | 614 | push edi eax |
|
- | 615 | mov ecx, [esi+8] |
|
- | 616 | xor eax, eax |
|
- | 617 | rep stosb |
|
- | 618 | pop eax edi |
|
614 | mov dword[ConfPacket], eax ; Store in ConfPAcket ptr to allocated memory |
619 | mov dword[ConfPacket], eax ; Store in ConfPAcket ptr to allocated memory |
615 | ;---Dirty hack end |
620 | ;---Dirty hack end |
616 | xor ecx, ecx |
621 | xor ecx, ecx |
617 | .read_loop: |
622 | .read_loop: |
618 | mov edx, [esi+8] |
623 | mov edx, [esi+8] |
Line 635... | Line 640... | ||
635 | call ClearEvent |
640 | call ClearEvent |
636 | pop ebx ecx edi esi |
641 | pop ebx ecx edi esi |
637 | cmp [EventData+8], -1 |
642 | cmp [EventData+8], -1 |
638 | jz .error |
643 | jz .error |
639 | add ecx, [EventData+8] |
644 | add ecx, [EventData+8] |
640 | DEBUGF 1, 'K : In buffer %x\n', [edi] |
- | |
641 | jmp .read_loop |
645 | jmp .read_loop |
642 | ;---Dirty hack begin |
646 | ;---Dirty hack begin |
643 | .read_end: |
647 | .read_end: |
644 | mov esi, dword[ConfPacket] |
648 | mov esi, dword[ConfPacket] |
645 | mov edi, [ioctl] |
649 | mov edi, [ioctl] |
Line 685... | Line 689... | ||
685 | mov ebx, [EventData+4] |
689 | mov ebx, [EventData+4] |
686 | call WaitEvent |
690 | call WaitEvent |
687 | jmp .endswitch |
691 | jmp .endswitch |
Line 688... | Line 692... | ||
688 | 692 | ||
- | 693 | .ftdi_get_list: |
|
- | 694 | mov edi, [edi+output] |
|
689 | .ftdi_get_list: |
695 | xor ecx, ecx |
690 | call linkedlist_gethead |
696 | call linkedlist_gethead |
691 | test eax, eax |
697 | test eax, eax |
692 | jz .endswitch |
- | |
693 | mov edi, [edi+output] |
698 | jz .emptylist |
694 | push edi |
699 | push edi |
695 | add edi, 4 |
- | |
696 | xor ecx, ecx |
700 | add edi, 4 |
697 | .nextdev: |
701 | .nextdev: |
698 | inc ecx |
702 | inc ecx |
699 | cmp [eax + ftdi_context.lockPID], 0 |
703 | cmp [eax + ftdi_context.lockPID], 0 |
700 | jnz .dev_is_locked |
704 | jnz .dev_is_locked |
Line 709... | Line 713... | ||
709 | add edi, 12 |
713 | add edi, 12 |
710 | mov eax, [eax + ftdi_context.next_context] |
714 | mov eax, [eax + ftdi_context.next_context] |
711 | test eax, eax |
715 | test eax, eax |
712 | jnz .nextdev |
716 | jnz .nextdev |
713 | pop edi |
717 | pop edi |
- | 718 | .emptylist: |
|
714 | mov [edi], ecx |
719 | mov [edi], ecx |
715 | jmp .endswitch |
720 | jmp .endswitch |
Line 716... | Line 721... | ||
716 | 721 | ||
717 | .ftdi_lock: |
722 | .ftdi_lock: |
718 | mov esi, [edi+input] |
723 | mov esi, [edi+input] |
719 | mov ebx, [esi+4] |
724 | mov ebx, [esi+4] |
720 | mov eax, [ebx + ftdi_context.lockPID] |
- | |
721 | DEBUGF 1, 'K : to PID %x from PID %x\n', [esi], eax |
725 | mov eax, [ebx + ftdi_context.lockPID] |
722 | test eax, eax |
726 | test eax, eax |
723 | jnz .lockedby |
727 | jnz .lockedby |
724 | mov eax, [esi] |
728 | mov eax, [esi] |
725 | mov [ebx + ftdi_context.lockPID], eax |
729 | mov [ebx + ftdi_context.lockPID], eax |
Line 731... | Line 735... | ||
731 | .ftdi_unlock: |
735 | .ftdi_unlock: |
732 | mov esi, [edi+input] |
736 | mov esi, [edi+input] |
733 | mov edi, [edi+output] |
737 | mov edi, [edi+output] |
734 | mov ebx, [esi+4] |
738 | mov ebx, [esi+4] |
735 | mov eax, [ebx + ftdi_context.lockPID] |
739 | mov eax, [ebx + ftdi_context.lockPID] |
736 | DEBUGF 1, 'K : to PID %x from PID %x\n', [esi], eax |
- | |
737 | cmp eax, [esi] |
740 | cmp eax, [esi] |
738 | jnz .unlockimp |
741 | jnz .unlockimp |
739 | mov [ebx + ftdi_context.lockPID], 0 |
742 | mov [ebx + ftdi_context.lockPID], 0 |
740 | mov dword[edi], 0 |
743 | mov dword[edi], 0 |
741 | jmp .endswitch |
744 | jmp .endswitch |