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_controller_disable PORTABLE C */
37 /* 6.1.2 */
38 /* AUTHOR */
39 /* */
40 /* Chaoqiong Xiao, Microsoft Corporation */
41 /* */
42 /* DESCRIPTION */
43 /* */
44 /* This function will disable the simulated host controller. */
45 /* The controller will release all its resources (memory, IO ...). */
46 /* After this, the controller will not send SOF any longer. */
47 /* */
48 /* INPUT */
49 /* */
50 /* hcd_sim_host Pointer to host controller */
51 /* */
52 /* OUTPUT */
53 /* */
54 /* Completion Status */
55 /* */
56 /* CALLS */
57 /* */
58 /* */
59 /* CALLED BY */
60 /* */
61 /* Host Simulator Controller Driver */
62 /* */
63 /* RELEASE HISTORY */
64 /* */
65 /* DATE NAME DESCRIPTION */
66 /* */
67 /* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
68 /* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
69 /* did controller halt only, */
70 /* resulting in version 6.1.2 */
71 /* */
72 /**************************************************************************/
_ux_hcd_sim_host_controller_disable(UX_HCD_SIM_HOST * hcd_sim_host)73 UINT _ux_hcd_sim_host_controller_disable(UX_HCD_SIM_HOST *hcd_sim_host)
74 {
75
76 UX_HCD *hcd = hcd_sim_host -> ux_hcd_sim_host_hcd_owner;
77
78
79 /* Set the state of the controller to HALTED. */
80 hcd -> ux_hcd_status = UX_HCD_STATUS_HALTED;
81
82 /* Return successful completion. */
83 return(UX_SUCCESS);
84 }
85