1
10
13
14
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
124
125
126
127
129
136
137
138
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
173
174
175
176
177
178
179
...
...
...
#define UX_SOURCE_CODE
#include "ux_api.h"
#include "ux_host_stack.h"
...
...
VOID _ux_host_stack_rh_change_process(VOID)
{
UX_HCD *hcd;
UINT hcd_index;
ULONG port_status;
UINT port_index;
UX_INTERRUPT_SAVE_AREA
/* ... */
for(hcd_index = 0; hcd_index < UX_SYSTEM_HOST_MAX_HCD_GET(); hcd_index++)
{
hcd = &_ux_system_host -> ux_system_host_hcd_array[hcd_index];
if (hcd -> ux_hcd_status == UX_HCD_STATUS_OPERATIONAL)
{
for (port_index = 0; port_index < hcd -> ux_hcd_nb_root_hubs; port_index++)
{
if (hcd -> ux_hcd_root_hub_signal[port_index] != 0)
{
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_RH_CHANGE_PROCESS, port_index, 0, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
UX_DISABLE
hcd -> ux_hcd_root_hub_signal[port_index]--;
UX_RESTORE
port_status = hcd -> ux_hcd_entry_function(hcd, UX_HCD_GET_PORT_STATUS, (VOID *)((ALIGN_TYPE)port_index));
if (port_status != UX_PORT_INDEX_UNKNOWN)
{
/* ... */
if (port_status & UX_PS_CCS)
{
/* ... */
if ((hcd -> ux_hcd_rh_device_connection & (ULONG)(1 << port_index)) == 0)
{
/* ... */
_ux_host_stack_rh_device_insertion(hcd,port_index);
}if ((hcd -> ux_hcd_rh_device_connection & (ULONG)(1 << port_index)) == 0) { ... }
else
{
/* ... */
if (hcd -> ux_hcd_root_hub_signal[port_index] != 0)
{
UX_DISABLE
hcd -> ux_hcd_root_hub_signal[port_index] = 0;
UX_RESTORE
_ux_host_stack_rh_device_extraction(hcd,port_index);
_ux_host_stack_rh_device_insertion(hcd,port_index);
}if (hcd -> ux_hcd_root_hub_signal[port_index] != 0) { ... }
}else { ... }
}if (port_status & UX_PS_CCS) { ... }
else
{
/* ... */
if ((hcd -> ux_hcd_rh_device_connection & (ULONG)(1 << port_index)) !=0)
{
_ux_host_stack_rh_device_extraction(hcd,port_index);
}if ((hcd -> ux_hcd_rh_device_connection & (ULONG)(1 << port_index)) !=0) { ... }
}else { ... }
}if (port_status != UX_PORT_INDEX_UNKNOWN) { ... }
}if (hcd -> ux_hcd_root_hub_signal[port_index] != 0) { ... }
}for (port_index = 0; port_index < hcd -> ux_hcd_nb_root_hubs; port_index++) { ... }
}if (hcd -> ux_hcd_status == UX_HCD_STATUS_OPERATIONAL) { ... }
}for (hcd_index = 0; hcd_index < UX_SYSTEM_HOST_MAX_HCD_GET(); hcd_index++) { ... }
}{ ... }