summaryrefslogtreecommitdiff
path: root/embassy-net
diff options
context:
space:
mode:
authorThales Fragoso <thales.fragosoz@gmail.com>2021-06-07 02:30:38 -0300
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2021-06-16 16:48:35 +0200
commit46e1bae9e36917c2e763082730d99df302c1c625 (patch)
tree5e181740db8bdb8500808cc9b03889de8d3af05e /embassy-net
parent6386c34079913732466046194f79a683a4aefce4 (diff)
downloadembassy-46e1bae9e36917c2e763082730d99df302c1c625.zip
eth-v2: Start Ethernet peripheral implementation
Diffstat (limited to 'embassy-net')
-rw-r--r--embassy-net/src/lib.rs2
-rw-r--r--embassy-net/src/packet_pool.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs
index 88dcf0aa..51eb97a2 100644
--- a/embassy-net/src/lib.rs
+++ b/embassy-net/src/lib.rs
@@ -13,7 +13,7 @@ pub use config::DhcpConfigurator;
pub use config::{Config, Configurator, Event as ConfigEvent, StaticConfigurator};
pub use device::{Device, LinkState};
-pub use packet_pool::{Packet, PacketBox, PacketBoxExt, PacketBuf};
+pub use packet_pool::{Packet, PacketBox, PacketBoxExt, PacketBuf, MTU};
pub use stack::{init, is_config_up, is_init, is_link_up, run};
#[cfg(feature = "tcp")]
diff --git a/embassy-net/src/packet_pool.rs b/embassy-net/src/packet_pool.rs
index 2c27d401..0ec88e64 100644
--- a/embassy-net/src/packet_pool.rs
+++ b/embassy-net/src/packet_pool.rs
@@ -3,12 +3,13 @@ use core::ops::{Deref, DerefMut, Range};
use atomic_pool::{pool, Box};
-pub const MTU: usize = 1514;
+pub const MTU: usize = 1516;
pub const PACKET_POOL_SIZE: usize = 4;
pool!(pub PacketPool: [Packet; PACKET_POOL_SIZE]);
pub type PacketBox = Box<PacketPool>;
+#[repr(align(4))]
pub struct Packet(pub [u8; MTU]);
impl Packet {