Subversion Repositories Kolibri OS

Rev

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

Rev 4467 Rev 4470
Line 314... Line 314...
314
 
314
 
315
align 4
315
align 4
Line 316... Line 316...
316
proc service_proc stdcall, ioctl:dword
316
proc service_proc stdcall, ioctl:dword
317
 
317
 
Line 318... Line 318...
318
        mov     edx, [ioctl]
318
        mov     edx, [ioctl]
Line 319... Line 319...
319
        mov     eax, [IOCTL.io_code]
319
        mov     eax, [edx + IOCTL.io_code]
320
 
320
 
Line 321... Line 321...
321
;------------------------------------------------------
321
;------------------------------------------------------
322
 
322
 
323
        cmp     eax, 0 ;SRV_GETVERSION
323
        cmp     eax, 0 ;SRV_GETVERSION
324
        jne     @F
324
        jne     @F
Line 325... Line 325...
325
 
325
 
326
        cmp     [IOCTL.out_size], 4
326
        cmp     [edx + IOCTL.out_size], 4
Line 327... Line 327...
327
        jb      .fail
327
        jb      .fail
328
        mov     eax, [IOCTL.output]
328
        mov     eax, [edx + IOCTL.output]
329
        mov     [eax], dword API_VERSION
329
        mov     [eax], dword API_VERSION
330
 
330
 
Line 331... Line 331...
331
        xor     eax, eax
331
        xor     eax, eax
332
        ret
332
        ret
Line 333... Line 333...
333
 
333
 
334
;------------------------------------------------------
334
;------------------------------------------------------
335
  @@:
335
  @@:
Line 336... Line 336...
336
        cmp     eax, 1 ;SRV_HOOK
336
        cmp     eax, 1 ;SRV_HOOK
Line 337... Line 337...
337
        jne     .fail
337
        jne     .fail
338
 
338
 
339
        cmp     [IOCTL.inp_size], 3                     ; Data input must be at least 3 bytes
339
        cmp     [edx + IOCTL.inp_size], 3                     ; Data input must be at least 3 bytes
340
        jb      .fail
340
        jb      .fail
Line 341... Line 341...
341
 
341
 
342
        mov     eax, [IOCTL.input]
342
        mov     eax, [edx + IOCTL.input]
343
        cmp     byte [eax], 1                           ; 1 means device number and bus number (pci) are given
343
        cmp     byte [eax], 1                           ; 1 means device number and bus number (pci) are given
344
        jne     .fail                                   ; other types arent supported for this card yet
344
        jne     .fail                                   ; other types arent supported for this card yet
345
 
345
 
346
; check if the device is already listed
346
; check if the device is already listed
Line 377... Line 377...
377
        mov     [device.unload], unload
377
        mov     [device.unload], unload
378
        mov     [device.name], my_service
378
        mov     [device.name], my_service
Line 379... Line 379...
379
 
379
 
Line 380... Line 380...
380
; save the pci bus and device numbers
380
; save the pci bus and device numbers
381
 
381
 
382
        mov     eax, [IOCTL.input]
382
        mov     eax, [edx + IOCTL.input]
383
        movzx   ecx, byte [eax+1]
383
        movzx   ecx, byte [eax+1]
384
        mov     [device.pci_bus], ecx
384
        mov     [device.pci_bus], ecx