Subversion Repositories Kolibri OS

Rev

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

Rev 4467 Rev 4470
Line 258... Line 258...
258
 
258
 
259
align 4
259
align 4
Line 260... Line 260...
260
proc service_proc stdcall, ioctl:dword
260
proc service_proc stdcall, ioctl:dword
261
 
261
 
Line 262... Line 262...
262
        mov     edx, [ioctl]
262
        mov     edx, [ioctl]
Line 263... Line 263...
263
        mov     eax, [IOCTL.io_code]
263
        mov     eax, [edx + IOCTL.io_code]
264
 
264
 
Line 265... Line 265...
265
;------------------------------------------------------
265
;------------------------------------------------------
266
 
266
 
267
        cmp     eax, 0 ;SRV_GETVERSION
267
        cmp     eax, 0 ;SRV_GETVERSION
268
        jne     @F
268
        jne     @F
Line 269... Line 269...
269
 
269
 
270
        cmp     [IOCTL.out_size], 4
270
        cmp     [edx + IOCTL.out_size], 4
Line 271... Line 271...
271
        jb      .fail
271
        jb      .fail
272
        mov     eax, [IOCTL.output]
272
        mov     eax, [edx + IOCTL.output]
273
        mov     [eax], dword API_VERSION
273
        mov     [eax], dword API_VERSION
274
 
274
 
Line 275... Line 275...
275
        xor     eax, eax
275
        xor     eax, eax
276
        ret
276
        ret
Line 277... Line 277...
277
 
277
 
278
;------------------------------------------------------
278
;------------------------------------------------------
279
  @@:
279
  @@:
Line 280... Line 280...
280
        cmp     eax, 1 ;SRV_HOOK
280
        cmp     eax, 1 ;SRV_HOOK
Line 281... Line 281...
281
        jne     .fail
281
        jne     .fail
282
 
282
 
283
        cmp     [IOCTL.inp_size], 3                     ; Data input must be at least 3 bytes
283
        cmp     [edx + IOCTL.inp_size], 3                     ; Data input must be at least 3 bytes
284
        jb      .fail
284
        jb      .fail
Line 285... Line 285...
285
 
285
 
286
        mov     eax, [IOCTL.input]
286
        mov     eax, [edx + IOCTL.input]
287
        cmp     byte [eax], 1                           ; 1 means device number and bus number (pci) are given
287
        cmp     byte [eax], 1                           ; 1 means device number and bus number (pci) are given
288
        jne     .fail                                   ; other types arent supported for this card yet
288
        jne     .fail                                   ; other types arent supported for this card yet
289
 
289
 
290
; check if the device is already listed
290
; check if the device is already listed
Line 321... Line 321...
321
        mov     [device.unload], unload
321
        mov     [device.unload], unload
322
        mov     [device.name], my_service
322
        mov     [device.name], my_service
Line 323... Line 323...
323
 
323
 
Line 324... Line 324...
324
; save the pci bus and device numbers
324
; save the pci bus and device numbers
325
 
325
 
326
        mov     eax, [IOCTL.input]
326
        mov     eax, [edx + IOCTL.input]
327
        movzx   ecx, byte[eax+1]
327
        movzx   ecx, byte[eax+1]
328
        mov     [device.pci_bus], ecx
328
        mov     [device.pci_bus], ecx