GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: core/src/ux_device_stack_transfer_all_request_abort.c Lines: 4 4 100.0 %
Date: 2026-03-06 18:57:10 Branches: 0 0 - %

Line Branch Exec Source
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_transfer_all_request_abort         PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Chaoqiong Xiao, Microsoft Corporation                               */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function cancels all the transfer requests attached to an      */
45
/*    endpoint. The endpoint is not reset and its toggle state is left    */
46
/*    the same.                                                           */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    transfer_request                      Pointer to transfer request   */
51
/*    completion_code                       Completion code               */
52
/*                                                                        */
53
/*  OUTPUT                                                                */
54
/*                                                                        */
55
/*    Completion Status                                                   */
56
/*                                                                        */
57
/*  CALLS                                                                 */
58
/*                                                                        */
59
/*    _ux_device_stack_transfer_abort       Transfer abort                */
60
/*                                                                        */
61
/*  CALLED BY                                                             */
62
/*                                                                        */
63
/*    Device Stack                                                        */
64
/*                                                                        */
65
/**************************************************************************/
66
1507
UINT  _ux_device_stack_transfer_all_request_abort(UX_SLAVE_ENDPOINT *endpoint, ULONG completion_code)
67
{
68
69
UX_SLAVE_TRANSFER       *transfer_request;
70
71
    /* If trace is enabled, insert this event into the trace buffer.  */
72
    UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_STACK_TRANSFER_ALL_REQUEST_ABORT, endpoint, completion_code, 0, 0, UX_TRACE_DEVICE_STACK_EVENTS, 0, 0)
73
74
    /* Get the transfer request for this endpoint.  */
75
1507
    transfer_request =  &endpoint -> ux_slave_endpoint_transfer_request;
76
77
    /* Abort this request.  */
78
1507
    _ux_device_stack_transfer_abort(transfer_request, completion_code);
79
80
    /* Return successful completion.  */
81
1507
    return(UX_SUCCESS);
82
}
83