Skip to content

Commit fb6a2c0

Browse files
gaborkerteszmmorenobarm
authored andcommitted
Implement low-level Ethernet interface for lwIP
Based on lwip_ethernetif.c skeleton file, use init, receive and transfer functionality of SMSC9220 Ethernet driver for the lightweight IP stack. Receive mechanism is interrupt driven. HW buffer sizes: Tx = 4608 bytes (MTU) Rx = 10560 bytes lwIP fine tuning: mbed-os/features/FEATURE_LWIP/lwip-interface/lwip/src/include/lwip/opt.h Change-Id: I0ea95650c65fb32cafb5c2d3dde11420c61dba66 Signed-off-by: Gabor Kertesz <[email protected]>
1 parent e4501f3 commit fb6a2c0

File tree

3 files changed

+454
-0
lines changed

3 files changed

+454
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* Copyright (c) 2017 ARM Limited
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
#ifndef LWIPOPTS_CONF_H
17+
#define LWIPOPTS_CONF_H
18+
19+
#define LWIP_TRANSPORT_ETHERNET 1
20+
21+
/* The IEEE 802.3ac standard says the maximum Ethernet frame */
22+
/* size is 1522 bytes to accommodate the four-byte VLAN tag. */
23+
#define ETH_MAX_FLEN 1522u /* recommended size for a VLAN frame */
24+
25+
/* Maximum Transfer Unit
26+
* The IEEE 802.3 specification limits the data portion of the 802.3 frame
27+
* to a minimum of 46 and a maximum of 1500 bytes, this is on L3 level.
28+
*/
29+
#define ETH_L2_HEADER_LEN 22u
30+
31+
#define ETH_MAX_PAYLOAD_LEN (ETH_MAX_FLEN - ETH_L2_HEADER_LEN)
32+
33+
#endif /* LWIPOPTS_CONF_H */

0 commit comments

Comments
 (0)