1 /**************************************************************************/
2 /* */
3 /* Copyright (c) Microsoft Corporation. All rights reserved. */
4 /* */
5 /* This software is licensed under the Microsoft Software License */
6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */
7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
8 /* and in the root directory of this software. */
9 /* */
10 /**************************************************************************/
11
12
13 /**************************************************************************/
14 /**************************************************************************/
15 /** */
16 /** USBX Component */
17 /** */
18 /** Host Simulator Controller Driver */
19 /** */
20 /**************************************************************************/
21 /**************************************************************************/
22
23 #define UX_SOURCE_CODE
24
25
26 /* Include necessary system files. */
27
28 #include "ux_api.h"
29 #include "ux_hcd_sim_host.h"
30
31
32 /**************************************************************************/
33 /* */
34 /* FUNCTION RELEASE */
35 /* */
36 /* _ux_hcd_sim_host_endpoint_reset PORTABLE C */
37 /* 6.1.10 */
38 /* AUTHOR */
39 /* */
40 /* Chaoqiong Xiao, Microsoft Corporation */
41 /* */
42 /* DESCRIPTION */
43 /* */
44 /* This function will reset an endpoint. */
45 /* */
46 /* INPUT */
47 /* */
48 /* hcd_sim_host Pointer to host controller */
49 /* endpoint Pointer to endpoint */
50 /* */
51 /* OUTPUT */
52 /* */
53 /* Completion Status */
54 /* */
55 /* CALLS */
56 /* */
57 /* None */
58 /* */
59 /* CALLED BY */
60 /* */
61 /* Host Simulator Controller Driver */
62 /* */
63 /* RELEASE HISTORY */
64 /* */
65 /* DATE NAME DESCRIPTION */
66 /* */
67 /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
68 /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
69 /* resulting in version 6.1 */
70 /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
71 /* added standalone support, */
72 /* resulting in version 6.1.10 */
73 /* */
74 /**************************************************************************/
_ux_hcd_sim_host_endpoint_reset(UX_HCD_SIM_HOST * hcd_sim_host,UX_ENDPOINT * endpoint)75 UINT _ux_hcd_sim_host_endpoint_reset(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint)
76 {
77
78 UX_HCD_SIM_HOST_ED *ed;
79
80 UX_PARAMETER_NOT_USED(hcd_sim_host);
81
82 /* From the endpoint container fetch the host simulator ED descriptor. */
83 ed = (UX_HCD_SIM_HOST_ED *) endpoint -> ux_endpoint_ed;
84
85 /* Reset the data0/data1 toggle bit in the Head TD. */
86 ed -> ux_sim_host_ed_toggle = 0;
87
88 #if defined(UX_HOST_STANDALONE)
89 /* Reset transfer status. */
90 ed -> ux_sim_host_ed_status &= ~UX_HCD_SIM_HOST_ED_TRANSFER;
91 #endif
92
93 /* This operation never fails. */
94 return(UX_SUCCESS);
95 }
96
97