Skip to content

Commit e37e8b8

Browse files
author
Holden
committed
merge buffer allocation methods
1 parent 8830d99 commit e37e8b8

File tree

4 files changed

+595
-1034
lines changed

4 files changed

+595
-1034
lines changed

source/include/NetworkBufferManagement.h

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,45 +34,35 @@
3434
#endif
3535
/* *INDENT-ON* */
3636

37+
#ifndef ipconfigBUFFER_ALLOC
38+
#define ipconfigBUFFER_ALLOC 0
39+
#endif
40+
3741
/* NOTE PUBLIC API FUNCTIONS. */
3842
BaseType_t xNetworkBuffersInitialise( void );
43+
3944
NetworkBufferDescriptor_t * pxGetNetworkBufferWithDescriptor( size_t xRequestedSizeBytes,
4045
TickType_t xBlockTimeTicks );
4146

42-
/* The definition of the below function is only available if BufferAllocation_2.c has been linked into the source. */
43-
NetworkBufferDescriptor_t * pxNetworkBufferGetFromISR( size_t xRequestedSizeBytes );
4447
void vReleaseNetworkBufferAndDescriptor( NetworkBufferDescriptor_t * const pxNetworkBuffer );
4548

46-
/* The definition of the below function is only available if BufferAllocation_2.c has been linked into the source. */
49+
NetworkBufferDescriptor_t * pxDuplicateNetworkBufferWithDescriptor( const NetworkBufferDescriptor_t * const pxNetworkBuffer,
50+
size_t uxNewLength );
51+
52+
#if ( ipconfigBUFFER_ALLOC != 0 )
53+
NetworkBufferDescriptor_t * pxResizeNetworkBufferWithDescriptor( NetworkBufferDescriptor_t * pxNetworkBuffer,
54+
size_t xNewSizeBytes );
55+
NetworkBufferDescriptor_t * pxNetworkBufferGetFromISR( size_t xRequestedSizeBytes );
56+
4757
BaseType_t vNetworkBufferReleaseFromISR( NetworkBufferDescriptor_t * const pxNetworkBuffer );
48-
uint8_t * pucGetNetworkBuffer( size_t * pxRequestedSizeBytes );
49-
void vReleaseNetworkBuffer( uint8_t * pucEthernetBuffer );
58+
#endif
5059

5160
/* Get the current number of free network buffers. */
5261
UBaseType_t uxGetNumberOfFreeNetworkBuffers( void );
5362

5463
/* Get the lowest number of free network buffers. */
5564
UBaseType_t uxGetMinimumFreeNetworkBuffers( void );
5665

57-
/* Copy a network buffer into a bigger buffer. */
58-
NetworkBufferDescriptor_t * pxDuplicateNetworkBufferWithDescriptor( const NetworkBufferDescriptor_t * const pxNetworkBuffer,
59-
size_t uxNewLength );
60-
61-
/* Increase the size of a Network Buffer.
62-
* In case BufferAllocation_2.c is used, the new space must be allocated. */
63-
NetworkBufferDescriptor_t * pxResizeNetworkBufferWithDescriptor( NetworkBufferDescriptor_t * pxNetworkBuffer,
64-
size_t xNewSizeBytes );
65-
66-
#if ipconfigTCP_IP_SANITY
67-
68-
/*
69-
* Check if an address is a valid pointer to a network descriptor
70-
* by looking it up in the array of network descriptors
71-
*/
72-
UBaseType_t bIsValidNetworkDescriptor( const NetworkBufferDescriptor_t * pxDesc );
73-
BaseType_t prvIsFreeBuffer( const NetworkBufferDescriptor_t * pxDescr );
74-
#endif
75-
7666
/* *INDENT-OFF* */
7767
#ifdef __cplusplus
7868
} /* extern "C" */

0 commit comments

Comments
 (0)