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 /** NetX Component */
17 /** */
18 /** Packet Pool Management (Packet) */
19 /** */
20 /**************************************************************************/
21 /**************************************************************************/
22
23 #define NX_SOURCE_CODE
24
25
26 /* Include necessary system files. */
27
28 #include "nx_api.h"
29 #include "nx_packet.h"
30
31 /* Bring in externs for caller checking code. */
32
33 NX_CALLER_CHECKING_EXTERNS
34
35
36 /**************************************************************************/
37 /* */
38 /* FUNCTION RELEASE */
39 /* */
40 /* _nxe_packet_pool_info_get PORTABLE C */
41 /* 6.1 */
42 /* AUTHOR */
43 /* */
44 /* Yuxin Zhou, Microsoft Corporation */
45 /* */
46 /* DESCRIPTION */
47 /* */
48 /* This function checks for errors in the packet pool information get */
49 /* function call. */
50 /* */
51 /* INPUT */
52 /* */
53 /* pool_ptr Pool to get information from */
54 /* total_packets Destination for total packets */
55 /* free_packets Destination for free packets */
56 /* empty_pool_requests Destination for empty requests*/
57 /* empty_pool_suspensions Destination for empty */
58 /* suspensions */
59 /* invalid_packet_releases Destination for invalid packet*/
60 /* release requests */
61 /* */
62 /* OUTPUT */
63 /* */
64 /* status Completion status */
65 /* */
66 /* CALLS */
67 /* */
68 /* _nx_packet_pool_info_get Actual packet pool info get */
69 /* function */
70 /* */
71 /* CALLED BY */
72 /* */
73 /* Application Code */
74 /* */
75 /* RELEASE HISTORY */
76 /* */
77 /* DATE NAME DESCRIPTION */
78 /* */
79 /* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
80 /* 09-30-2020 Yuxin Zhou Modified comment(s), */
81 /* resulting in version 6.1 */
82 /* */
83 /**************************************************************************/
_nxe_packet_pool_info_get(NX_PACKET_POOL * pool_ptr,ULONG * total_packets,ULONG * free_packets,ULONG * empty_pool_requests,ULONG * empty_pool_suspensions,ULONG * invalid_packet_releases)84 UINT _nxe_packet_pool_info_get(NX_PACKET_POOL *pool_ptr, ULONG *total_packets, ULONG *free_packets,
85 ULONG *empty_pool_requests, ULONG *empty_pool_suspensions,
86 ULONG *invalid_packet_releases)
87 {
88
89 UINT status;
90
91
92 /* Check for invalid input pointers. */
93 if ((pool_ptr == NX_NULL) || (pool_ptr -> nx_packet_pool_id != NX_PACKET_POOL_ID))
94 {
95 return(NX_PTR_ERROR);
96 }
97
98 /* Check for appropriate caller. */
99 NX_NOT_ISR_CALLER_CHECKING
100
101 /* Call actual packet pool information get function. */
102 status = _nx_packet_pool_info_get(pool_ptr, total_packets, free_packets, empty_pool_requests,
103 empty_pool_suspensions, invalid_packet_releases);
104
105 /* Return completion status. */
106 return(status);
107 }
108
109