1 |
|
|
/*************************************************************************** |
2 |
|
|
* Copyright (c) 2024 Microsoft Corporation |
3 |
|
|
* Copyright (c) 2026-present Eclipse ThreadX contributors |
4 |
|
|
* |
5 |
|
|
* This program and the accompanying materials are made available under the |
6 |
|
|
* terms of the MIT License which is available at |
7 |
|
|
* https://opensource.org/licenses/MIT. |
8 |
|
|
* |
9 |
|
|
* SPDX-License-Identifier: MIT |
10 |
|
|
**************************************************************************/ |
11 |
|
|
|
12 |
|
|
|
13 |
|
|
/**************************************************************************/ |
14 |
|
|
/**************************************************************************/ |
15 |
|
|
/** */ |
16 |
|
|
/** USBX Component */ |
17 |
|
|
/** */ |
18 |
|
|
/** Device Stack */ |
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_device_stack.h" |
30 |
|
|
|
31 |
|
|
|
32 |
|
|
/**************************************************************************/ |
33 |
|
|
/* */ |
34 |
|
|
/* FUNCTION RELEASE */ |
35 |
|
|
/* */ |
36 |
|
|
/* _ux_device_stack_host_wakeup PORTABLE C */ |
37 |
|
|
/* 6.1 */ |
38 |
|
|
/* AUTHOR */ |
39 |
|
|
/* */ |
40 |
|
|
/* Chaoqiong Xiao, Microsoft Corporation */ |
41 |
|
|
/* */ |
42 |
|
|
/* DESCRIPTION */ |
43 |
|
|
/* */ |
44 |
|
|
/* This function is called when the device wants to wake up the host. */ |
45 |
|
|
/* This command is only valid when the device is in suspend mode. */ |
46 |
|
|
/* */ |
47 |
|
|
/* INPUT */ |
48 |
|
|
/* */ |
49 |
|
|
/* None */ |
50 |
|
|
/* */ |
51 |
|
|
/* OUTPUT */ |
52 |
|
|
/* */ |
53 |
|
|
/* Completion Status */ |
54 |
|
|
/* */ |
55 |
|
|
/* CALLS */ |
56 |
|
|
/* */ |
57 |
|
|
/* (ux_slave_dcd_function) DCD dispatch function */ |
58 |
|
|
/* */ |
59 |
|
|
/* CALLED BY */ |
60 |
|
|
/* */ |
61 |
|
|
/* Application */ |
62 |
|
|
/* */ |
63 |
|
|
/**************************************************************************/ |
64 |
|
2 |
UINT _ux_device_stack_host_wakeup(VOID) |
65 |
|
|
{ |
66 |
|
|
|
67 |
|
|
UX_SLAVE_DCD *dcd; |
68 |
|
2 |
UINT status = UX_FUNCTION_NOT_SUPPORTED; |
69 |
|
|
|
70 |
|
|
/* If trace is enabled, insert this event into the trace buffer. */ |
71 |
|
|
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_STACK_HOST_WAKEUP, 0, 0, 0, 0, UX_TRACE_DEVICE_STACK_EVENTS, 0, 0) |
72 |
|
|
|
73 |
|
|
/* Get the pointer to the DCD. */ |
74 |
|
2 |
dcd = &_ux_system_slave -> ux_system_slave_dcd; |
75 |
|
|
|
76 |
|
|
/* Check if DEVICE_REMOTE_WAKEUP feature is enabled. */ |
77 |
✓✓ |
2 |
if (_ux_system_slave -> ux_system_slave_remote_wakeup_enabled) |
78 |
|
|
|
79 |
|
|
/* Send the change signal to the controller driver. */ |
80 |
|
1 |
status = dcd -> ux_slave_dcd_function(dcd, UX_DCD_CHANGE_STATE, (VOID *) UX_DEVICE_REMOTE_WAKEUP); |
81 |
|
|
|
82 |
|
|
/* Return the status to the caller. */ |
83 |
|
2 |
return(status); |
84 |
|
|
} |
85 |
|
|
|