Subversion Repositories Kolibri OS

Rev

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

Rev 4423 Rev 5201
Line -... Line 1...
-
 
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
 
2
;;                                                              ;;
-
 
3
;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;;
-
 
4
;; Distributed under terms of the GNU General Public License    ;;
-
 
5
;;                                                              ;;
-
 
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
 
7
 
-
 
8
$Revision: 4850 $
-
 
9
 
-
 
10
 
1
; USB Host Controller support code: hardware-independent part,
11
; USB Host Controller support code: hardware-independent part,
2
; common for all controller types.
12
; common for all controller types.
Line 3... Line 13...
3
 
13
 
4
iglobal
14
iglobal
Line 112... Line 122...
112
        add     eax, ecx
122
        add     eax, ecx
113
        pop     ecx
123
        pop     ecx
114
        ret
124
        ret
115
endp
125
endp
Line 116... Line 126...
116
 
126
 
117
; Put the given control pipe in the wait list;
127
; Put the given control/bulk pipe in the wait list;
118
; called when the pipe structure is changed and a possible hardware cache
128
; called when the pipe structure is changed and a possible hardware cache
119
; needs to be synchronized. When it will be known that the cache is updated,
129
; needs to be synchronized. When it will be known that the cache is updated,
120
; usb_subscription_done procedure will be called.
130
; usb_subscription_done procedure will be called.
121
proc usb_subscribe_control
131
proc usb_subscribe_control
Line 126... Line 136...
126
        mov     [esi+usb_controller.WaitPipeListAsync], ebx
136
        mov     [esi+usb_controller.WaitPipeListAsync], ebx
127
@@:
137
@@:
128
        ret
138
        ret
129
endp
139
endp
Line -... Line 140...
-
 
140
 
-
 
141
; Same as usb_subscribe_control, but for interrupt/isochronous pipe.
-
 
142
proc usb_subscribe_periodic
-
 
143
        cmp     [ebx+usb_pipe.NextWait], -1
-
 
144
        jnz     @f
-
 
145
        mov     eax, [esi+usb_controller.WaitPipeListPeriodic]
-
 
146
        mov     [ebx+usb_pipe.NextWait], eax
-
 
147
        mov     [esi+usb_controller.WaitPipeListPeriodic], ebx
-
 
148
@@:
-
 
149
        ret
-
 
150
endp
130
 
151
 
131
; Called after synchronization of hardware cache with software changes.
152
; Called after synchronization of hardware cache with software changes.
132
; Continues process of device enumeration based on when it was delayed
153
; Continues process of device enumeration based on when it was delayed
133
; due to call to usb_subscribe_control.
154
; due to call to usb_subscribe_control.
134
proc usb_subscription_done
155
proc usb_subscription_done
Line 252... Line 273...
252
        mov     eax, [esi+usb_controller.WaitPipeListAsync+edx]
273
        mov     eax, [esi+usb_controller.WaitPipeListAsync+edx]
253
        mov     [ebx+usb_pipe.NextWait], eax
274
        mov     [ebx+usb_pipe.NextWait], eax
254
        mov     [esi+usb_controller.WaitPipeListAsync+edx], ebx
275
        mov     [esi+usb_controller.WaitPipeListAsync+edx], ebx
255
        jmp     .continue
276
        jmp     .continue
256
.process:
277
.process:
257
; 7. Call the handler depending on USB_FLAG_CLOSED.
278
; 7. Call the handler depending on USB_FLAG_CLOSED and USB_FLAG_DISABLED.
258
        or      [ebx+usb_pipe.NextWait], -1
279
        or      [ebx+usb_pipe.NextWait], -1
259
        test    [ebx+usb_pipe.Flags], USB_FLAG_CLOSED
280
        test    [ebx+usb_pipe.Flags], USB_FLAG_CLOSED
260
        jz      .nodisconnect
281
        jz      .nodisconnect
261
        call    usb_pipe_closed
282
        call    usb_pipe_closed
262
        jmp     .continue
283
        jmp     .continue
263
.nodisconnect:
284
.nodisconnect:
-
 
285
        test    [ebx+usb_pipe.Flags], USB_FLAG_DISABLED
-
 
286
        jz      .nodisabled
-
 
287
        call    usb_pipe_disabled
-
 
288
        jmp     .continue
-
 
289
.nodisabled:
264
        call    usb_subscription_done
290
        call    usb_subscription_done
265
.continue:
291
.continue:
266
; 8. Restore edx and next pipe saved in step 5 and continue the loop.
292
; 8. Restore edx and next pipe saved in step 5 and continue the loop.
267
        pop     ebx
293
        pop     ebx
268
        pop     edx
294
        pop     edx