Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3709 clevermous 1
; HID default driver, part of USBHID driver.
2
; Present only if compile-time setting HID_DUMP_UNCLAIMED is on.
3
; Active for those devices when we do not have a specialized driver.
4
; Just dumps everything to the debug board.
5
 
6
if HID_DUMP_UNCLAIMED
7
; Global constants.
8
; They are assembled in a macro to separate code and data;
9
; the code is located at the point of "include 'unclaimed.inc'",
10
; the data are collected when workers_globals is instantiated.
11
macro workers_globals
12
{
13
; include global constants from previous workers
14
	workers_globals
15
align 4
16
; Callbacks for HID layer.
17
default_driver:
18
	dd	default_driver_add_device
19
	dd	default_driver_disconnect
20
	dd	default_driver_begin_packet
21
	dd	default_driver_array_overflow?
22
	dd	default_driver_input_field
23
	dd	default_driver_end_packet
24
}
25
; This procedure is called when HID layer detects a new driverless device.
26
; in: ebx -> usb_device_data, edi -> collection
27
; out: eax = device-specific data or NULL on error
28
default_driver_add_device:
29
; just return something nonzero, no matter what
30
	xor	eax, eax
31
	inc	eax
32
	ret
33
; This procedure is called when HID layer processes every non-empty array field group.
34
; in: edi -> keyboard_device_data (pointer returned from keyboard_driver_add_device)
35
; in: ecx = fields count (always nonzero), edx = pointer to fields values
36
; in: esi -> report_field_group
37
; out: CF set => group is ok, CF cleared => group should be ignored
38
default_driver_array_overflow?:
39
; parse everything
40
	stc
41
	ret
42
; This procedure is called from HID layer for every field.
43
; in: ecx = field usage, edx = value, esi -> report_field_group
44
default_driver_input_field:
45
; Do not dump zero values in Variable fields,
46
; they are present even if the corresponding control is inactive.
47
	test	edx, edx
48
	jnz	@f
49
	test	byte [esi+report_field_group.flags], HID_FIELD_VARIABLE
50
	jnz	.nodump
51
@@:
52
	DEBUGF 1,'K : unclaimed HID input: usage=%x, value=%x\n',ecx,edx
53
.nodump:
54
; pass through
55
; Three nothing-to-do procedures.
56
default_driver_disconnect:
57
default_driver_begin_packet:
58
default_driver_end_packet:
59
	ret
60
end if