Mbed OS Reference
Loading...
Searching...
No Matches
EMACMemoryManager.h
1/* Copyright (c) 2017 ARM Limited
2 * SPDX-License-Identifier: Apache-2.0
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef EMAC_MEMORY_MANAGER_H
18#define EMAC_MEMORY_MANAGER_H
19
20/**
21 * Emac interface memory manager
22 *
23 * This interface provides abstraction for memory modules used in different IP stacks (often to accommodate zero
24 * copy). Emac interface is required to accept output packets and provide received data using this stack-
25 * independent API. This header should be implemented for each IP stack, so that we keep emacs module independent.
26 *
27 * Emac memory interface uses memory buffer chains to store data. Data passed in either direction
28 * may be either contiguous (a single-buffer chain), or may consist of multiple buffers.
29 * Chaining of the buffers is made using singly-linked list. The Emac data-passing APIs do not specify
30 * alignment or structure of the chain in either direction.
31 *
32 * Memory buffers can be allocated either from heap or from memory pools. Heap buffers are always contiguous.
33 * Memory pool buffers may be either contiguous or chained depending on allocation size.
34 *
35 * On Emac interface buffer chain ownership is transferred. Emac must free buffer chain that it is given for
36 * link output and the stack must free the buffer chain that it is given for link input.
37 *
38 */
39
40#include "nsapi.h"
41#include "NetStackMemoryManager.h"
42
43typedef void emac_mem_buf_t; // Memory buffer
44
46
47};
48
49#endif /* EMAC_MEMORY_MANAGER_H */