Rev 4467 | Rev 4998 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4467 | Rev 4470 | ||
---|---|---|---|
Line 454... | Line 454... | ||
454 | proc START stdcall, state:dword |
454 | proc START stdcall, state:dword |
Line 455... | Line 455... | ||
455 | 455 | ||
456 | cmp [state], 1 |
456 | cmp [state], 1 |
Line 457... | Line 457... | ||
457 | jne .exit |
457 | jne .exit |
458 | 458 | ||
459 | DEBUGF 2,"Loading %s driver\n", my_service |
459 | DEBUGF 2,"Loading driver\n" |
Line 460... | Line 460... | ||
460 | stdcall RegService, my_service, service_proc |
460 | stdcall RegService, my_service, service_proc |
461 | ret |
461 | ret |
Line 476... | Line 476... | ||
476 | 476 | ||
477 | align 4 |
477 | align 4 |
Line 478... | Line 478... | ||
478 | proc service_proc stdcall, ioctl:dword |
478 | proc service_proc stdcall, ioctl:dword |
479 | 479 | ||
Line 480... | Line 480... | ||
480 | mov edx, [ioctl] |
480 | mov edx, [ioctl] |
Line 481... | Line 481... | ||
481 | mov eax, [IOCTL.io_code] |
481 | mov eax, [edx + IOCTL.io_code] |
482 | 482 | ||
Line 483... | Line 483... | ||
483 | ;------------------------------------------------------ |
483 | ;------------------------------------------------------ |
484 | 484 | ||
485 | cmp eax, 0 ;SRV_GETVERSION |
485 | cmp eax, 0 ;SRV_GETVERSION |
486 | jne @F |
486 | jne @F |
Line 487... | Line 487... | ||
487 | 487 | ||
488 | cmp [IOCTL.out_size], 4 |
488 | cmp [edx + IOCTL.out_size], 4 |
Line 489... | Line 489... | ||
489 | jb .fail |
489 | jb .fail |
490 | mov eax, [IOCTL.output] |
490 | mov eax, [edx + IOCTL.output] |
491 | mov [eax], dword API_VERSION |
491 | mov [eax], dword API_VERSION |
492 | 492 | ||
Line 493... | Line 493... | ||
493 | xor eax, eax |
493 | xor eax, eax |
494 | ret |
494 | ret |
Line 495... | Line 495... | ||
495 | 495 | ||
496 | ;------------------------------------------------------ |
496 | ;------------------------------------------------------ |
497 | @@: |
497 | @@: |
Line 498... | Line 498... | ||
498 | cmp eax, 1 ;SRV_HOOK |
498 | cmp eax, 1 ;SRV_HOOK |
Line 499... | Line 499... | ||
499 | jne .fail |
499 | jne .fail |
500 | 500 | ||
501 | cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
501 | cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
502 | jb .fail |
502 | jb .fail |
Line 503... | Line 503... | ||
503 | 503 | ||
504 | mov eax, [IOCTL.input] |
504 | mov eax, [edx + IOCTL.input] |
505 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
505 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
506 | jne .fail ; other types arent supported for this card yet |
506 | jne .fail ; other types arent supported for this card yet |
507 | 507 | ||
508 | ; check if the device is already listed |
508 | ; check if the device is already listed |
Line 539... | Line 539... | ||
539 | mov [device.unload], .fail |
539 | mov [device.unload], .fail |
540 | mov [device.name], my_service |
540 | mov [device.name], my_service |
Line 541... | Line 541... | ||
541 | 541 | ||
Line 542... | Line 542... | ||
542 | ; save the pci bus and device numbers |
542 | ; save the pci bus and device numbers |
543 | 543 | ||
544 | mov eax, [IOCTL.input] |
544 | mov eax, [edx + IOCTL.input] |
545 | movzx ecx, byte [eax+1] |
545 | movzx ecx, byte [eax+1] |
546 | mov [device.pci_bus], ecx |
546 | mov [device.pci_bus], ecx |
Line 1796... | Line 1796... | ||
1796 | ;; pointer to device structure in ebx ;; |
1796 | ;; pointer to device structure in ebx ;; |
1797 | ;; ;; |
1797 | ;; ;; |
1798 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1798 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1799 | align 4 |
1799 | align 4 |
1800 | transmit: |
1800 | transmit: |
1801 | DEBUGF 2,"\nTransmitting packet, buffer:%x, size:%u\n", [esp+4], [esp+8] |
1801 | DEBUGF 2,"Transmitting packet, buffer:%x, size:%u\n", [esp+4], [esp+8] |
1802 | mov eax, [esp+4] |
1802 | mov eax, [esp+4] |
1803 | DEBUGF 2,"To: %x-%x-%x-%x-%x-%x From: %x-%x-%x-%x-%x-%x Type:%x%x\n",\ |
1803 | DEBUGF 2,"To: %x-%x-%x-%x-%x-%x From: %x-%x-%x-%x-%x-%x Type:%x%x\n",\ |
1804 | [eax+00]:2,[eax+01]:2,[eax+02]:2,[eax+03]:2,[eax+04]:2,[eax+05]:2,\ |
1804 | [eax+00]:2,[eax+01]:2,[eax+02]:2,[eax+03]:2,[eax+04]:2,[eax+05]:2,\ |
1805 | [eax+06]:2,[eax+07]:2,[eax+08]:2,[eax+09]:2,[eax+10]:2,[eax+11]:2,\ |
1805 | [eax+06]:2,[eax+07]:2,[eax+08]:2,[eax+09]:2,[eax+10]:2,[eax+11]:2,\ |
1806 | [eax+13]:2,[eax+12]:2 |
1806 | [eax+13]:2,[eax+12]:2 |
Line 1857... | Line 1857... | ||
1857 | align 4 |
1857 | align 4 |
1858 | int_handler: |
1858 | int_handler: |
Line 1859... | Line 1859... | ||
1859 | 1859 | ||
Line 1860... | Line 1860... | ||
1860 | push ebx esi edi |
1860 | push ebx esi edi |
Line 1861... | Line 1861... | ||
1861 | 1861 | ||
1862 | DEBUGF 2,"\n%s INT\n", my_service |
1862 | DEBUGF 2,"INT\n" |
Line 1863... | Line 1863... | ||
1863 | 1863 |