blob: 6c10373e52a0e2f6755b3360dffb2b70491c2327 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
88
89
90
91
92
93
94
95
96
97
98
99
|
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** USBX Component */
/** */
/** Host Stack */
/** */
/**************************************************************************/
/**************************************************************************/
/* Include necessary system files. */
#define UX_SOURCE_CODE
#include "ux_api.h"
#include "ux_host_stack.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _ux_host_stack_class_interface_scan PORTABLE C */
/* 6.1.4 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function will scan all default interfaces for a single */
/* configuration and call the registered class with the */
/* Class/SubClass/Protocol of the interface. */
/* */
/* If the device has multiple configurations (like the Apple iPod), */
/* the first configuration is treated as the default configuration. */
/* If a device which has multiple configurations wants to control the */
/* configuration selection, it must ensure that the PID/VID based */
/* class at the device level claims the entire device. */
/* */
/* */
/* For the interface, there is no reason to use the PID/VID has a */
/* binding element as classes that trigger on PID/VID will be called */
/* by the device descriptor scanning process. */
/* */
/* INPUT */
/* */
/* device Device pointer */
/* */
/* OUTPUT */
/* */
/* Result of operation */
/* */
/* CALLS */
/* */
/* _ux_host_stack_class_call Call class command */
/* _ux_host_stack_device_configuration_select */
/* Select configuration */
/* (ux_host_stack_class_call) Call class from host stack */
/* (ux_host_class_entry_function) Class entry function */
/* */
/* CALLED BY */
/* */
/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_class_interface_scan(UX_DEVICE *device)
{
UX_CONFIGURATION *configuration;
UINT status;
/* Get the 1st and only configuration. If the device has multiple
configurations, we simply use the first one as default. */
configuration = device -> ux_device_first_configuration;
if (configuration == UX_NULL)
return(UX_ERROR);
/* Scan interfaces for this configuration. */
status = _ux_host_stack_configuration_interface_scan(configuration);
/* Return operation result. */
return(status);
}
|