Commit Graph

20 Commits

Author SHA1 Message Date
Ulf Lilleengen
768fe699cf
Pass the correct buffer when creating TcpSocket 2023-01-31 19:36:41 +01:00
Dario Nieuwenhuis
1f033d509a net: split driver trait to a separate crate. 2022-12-26 04:49:08 +01:00
Dario Nieuwenhuis
5655c6093f net: use atomic-polyfill on tcp client pool, for thumbv6m support. 2022-12-26 03:34:05 +01:00
Dario Nieuwenhuis
10c9cc31b1 Remove unnecessary use of atomic-polyfill.
Only use it when CAS is actually needed.
2022-12-23 20:46:49 +01:00
Dario Nieuwenhuis
aaaf5f23a8 net: move stack into lib.rs 2022-12-13 16:18:39 +01:00
Dario Nieuwenhuis
ac74613b5a net: remove packet pool.
The pool was prone to deadlocks, especially due to having a single pool
for rx+tx. If the pool got full with rx'd packets it would deadlock because
processing a rx packet requires doing another allocation on the pool, for
the possibly tx'd response, before deallocating the rx'd packet.

This also allows Device impls to allocate the packet memory in a particular
RAM kind, if needed for example to do DMA.

The `Device` trait is now token-based, like smoltcp's. In the end, this
is better because it allows callers to manage memory however they want (including
with a pool if they want to).
2022-12-13 16:18:39 +01:00
Dario Nieuwenhuis
f7fe0c1441 net: update smoltcp 2022-12-07 00:28:38 +01:00
Dario Nieuwenhuis
02abe00439 net: don't use UnsafeCell.
The "must not be called reentrantly" invariant is too "global" to
maintain comfortably, and the cost of the RefCell is negligible,
so this was a case of premature optimization.
2022-12-03 00:56:16 +01:00
Dario Nieuwenhuis
1e2fb0459d Switch to async-fn-in-trait 2022-11-25 21:02:06 +01:00
Dario Nieuwenhuis
eeb072d9cb Update Rust nightly. 2022-10-26 16:47:29 +02:00
Dario Nieuwenhuis
a0487380da Replace futures::future::poll_fn -> core::future::poll_fn. 2022-09-22 16:42:49 +02:00
Dario Nieuwenhuis
464ae67108 net: feature-gate nightly-only async traits to allow building on stable. 2022-08-30 19:43:32 +02:00
Dario Nieuwenhuis
0a98f9f48e
net: make TcpIo private.
It's just an implementation detail to share code between Socket, Reader, Writer. It wasn't supposed to be public.
2022-08-11 13:58:13 +02:00
Ulf Lilleengen
87401c49b7 Fix formatting 2022-08-09 14:51:32 +02:00
Ulf Lilleengen
80c1551153 Wrap buffers in a single state type 2022-08-09 14:43:55 +02:00
Ulf Lilleengen
18671b94ba Implement embedded-nal-async traits for embassy-net 2022-08-08 16:51:34 +02:00
Dario Nieuwenhuis
a8703b7598 Run rustfmt. 2022-06-12 22:22:31 +02:00
Ulf Lilleengen
8b676e65ad Add embedded-io implementation of ConnectError 2022-06-01 13:48:28 +02:00
Dario Nieuwenhuis
a5aea995a8 WIP embassy-net v2 2022-05-25 19:56:22 +02:00
Dario Nieuwenhuis
e3b8e35498 Make embassy-net nightly-only.
It's useless without async traits, so juggling the `nightly` feature
around is not worth the pain.
2022-05-19 06:15:01 +02:00